3 # If these # comments don't work, trim them. Don't worry about any other
4 # shell scripts, Configure will trim # comments from them for you.
6 # (If you are trying to port this package to a machine without sh,
7 # I would suggest you have a look at the prototypical config_h.SH file
8 # and edit it to reflect your system. Some packages may include samples
9 # of config.h for certain machines, so you might look for one of those.)
11 # Yes, you may rip this off to use in other distribution packages. This
12 # script belongs to the public domain and cannot be copyrighted.
14 # (Note: this Configure script was generated automatically. Rather than
15 # working with this copy of Configure, you may wish to get metaconfig.
16 # The dist-3.0 package (which contains metaconfig) was posted in
17 # comp.sources.misc and is available on CPAN under authors/id/RAM so
18 # you may fetch it yourself from your nearest archive site.)
21 # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
23 # Generated on Fri Dec 15 04:41:40 EET 2000 [metaconfig 3.0 PL70]
24 # (with additional metaconfig patches by perlbug@perl.org)
29 SCO csh still thinks true is false. Write to SCO today and tell them that next
30 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
32 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
33 we'd have to do is go in and swap the && and || tokens, wherever they are.)
35 [End of diatribe. We now return you to your regularly scheduled programming...]
39 OOPS! You naughty creature! You didn't run Configure with sh!
40 I will attempt to remedy the situation by running sh for you...
44 true || exec sh $0 $argv:q
46 (exit $?0) || cat c2$$
47 (exit $?0) || exec sh $0 $argv:q
50 : compute my invocation name
54 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
59 : Proper separator for the PATH environment variable
61 : On OS/2 this directory should exist if this is not floppy only system :-]
62 if test -d c:/. ; then
63 if test -n "$OS2_SHELL"; then
65 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
66 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
67 elif test -n "$DJGPP"; then
73 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
74 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
75 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
76 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
77 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
78 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /usr/ccs/bin"
79 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
80 paths="$paths /sbin /usr/sbin /usr/libexec"
86 *) test -d $p && PATH=$PATH$p_$p ;;
93 : shall we be using ksh?
99 if (PATH=.; alias -x) >/dev/null 2>&1; then
102 if test -f /hp-ux -a -f /bin/ksh; then
103 needksh='to avoid sh bug in "here document" expansion'
105 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
106 if test X`/usr/bin/uname -v` = X4; then
107 avoidksh="to avoid AIX 4's /bin/sh"
111 if test -f /osf_boot -a -f /usr/sbin/setld; then
112 if test X`/usr/bin/uname -s` = XOSF1; then
113 avoidksh="to avoid Digital UNIX' ksh"
115 unset BIN_SH # if this is 'xpg4' sh will start up ksh
118 case "$inksh/$needksh" in
125 case "$inksh/$avoidksh" in
131 case "$inksh/$needksh-$avoidksh-" in
134 (I see you are using the Korn shell. Some ksh's blow up on $me,
135 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
141 echo "(Feeding myself to $newsh $reason.)"
143 Configure|*/Configure) exec $newsh $0 "$@";;
144 *) exec $newsh Configure "$@";;
149 : if needed set CDPATH to a harmless value that is not chatty
150 : avoid bash 2.02 problems with empty CDPATH.
154 *bash*) CDPATH='.' ;;
159 : Configure runs within the UU subdirectory
160 test -d UU || mkdir UU
465 d_old_pthread_create_joinable=''
466 old_pthread_create_joinable=''
544 d_stdio_ptr_lval_nochange_cnt=''
545 d_stdio_ptr_lval_sets_cnt=''
717 inc_version_list_init=''
735 ignore_versioned_solibs=''
794 d_perl_otherlibdirs=''
811 d_nv_preserves_uv_bits=''
909 d_stdio_stream_array=''
910 stdio_stream_array=''
920 ccflags_uselargefiles=''
921 ldflags_uselargefiles=''
922 libswanted_uselargefiles=''
965 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
968 : We must find out about Eunice early
970 if test -f /etc/unixtovms; then
971 eunicefix=/etc/unixtovms
973 if test -f /etc/unixtovms.exe; then
974 eunicefix=/etc/unixtovms.exe
981 : set useposix=false in your hint file to disable the POSIX extension.
983 : set useopcode=false in your hint file to disable the Opcode extension.
985 : Trailing extension. Override this in a hint file, if needed.
987 : Extra object files, if any, needed on this platform.
990 : Possible local include directories to search.
991 : Set locincpth to "" in a hint file to defeat local include searches.
992 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
993 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
995 : no include file wanted by default
999 : change the next line if compiling for Xenix/286 on Xenix/386
1000 xlibpth='/usr/lib/386 /lib/386'
1001 : Possible local library directories to search.
1002 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1003 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1005 : general looking path for locating libraries
1006 glibpth="/lib /usr/lib $xlibpth"
1007 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1008 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1009 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1011 : Private path used by Configure to find libraries. Its value
1012 : is prepended to libpth. This variable takes care of special
1013 : machines, like the mips. Usually, it should be empty.
1016 : default library list
1018 : some systems want to use only the non-versioned libso:s
1019 ignore_versioned_solibs=''
1021 ccflags_uselargefiles=''
1022 ldflags_uselargefiles=''
1023 libswanted_uselargefiles=''
1024 : set usemultiplicity on the Configure command line to enable multiplicity.
1025 : set usesocks on the Configure command line to enable socks.
1026 : set usethreads on the Configure command line to enable threads.
1027 : full support for void wanted by default
1030 : List of libraries we want.
1031 : If anyone needs -lnet, put it in a hint file.
1032 libswanted='sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl'
1033 libswanted="$libswanted dld ld sun m c cposix posix"
1034 libswanted="$libswanted ndir dir crypt sec"
1035 libswanted="$libswanted ucb bsd BSD PW x iconv util"
1036 : We probably want to search /usr/shlib before most other libraries.
1037 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1038 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1039 glibpth="/usr/shlib $glibpth"
1040 : Do not use vfork unless overridden by a hint file.
1043 : Find the basic shell for Bourne shell scripts
1047 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1050 if test -f "$xxx"; then
1053 : Build up a list and do a single loop so we can 'break' out.
1054 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1055 for xxx in sh bash ksh pdksh ash; do
1057 try="$try ${p}/${xxx}"
1061 if test -f "$xxx"; then
1064 elif test -f "$xxx.exe"; then
1075 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1077 Usually it's in /bin/sh. How did you even get this far?
1078 Please contact me (Perl Maintainers) at perlbug@perl.org and
1079 we'll try to straighten this all out.
1085 : see if sh knows # comments
1086 if `$sh -c '#' >/dev/null 2>&1`; then
1090 test -f $xcat || xcat=/usr/bin/cat
1095 if test -s today; then
1098 echo "#! $xcat" > try
1102 if test -s today; then
1110 echo "Your $sh doesn't grok # comments--I will strip them later on."
1113 echo "exec grep -v '^[ ]*#'" >spitshell
1115 $eunicefix spitshell
1116 spitshell=`pwd`/spitshell
1118 echo "I presume that if # doesn't work, #! won't work either!"
1123 : figure out how to guarantee sh startup
1125 '') startsh=${sharpbang}${sh} ;;
1137 : echo "Yup, it does."
1139 echo "Hmm... '$startsh' does not guarantee sh startup..."
1140 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1145 : Save command line options in file UU/cmdline.opt for later use in
1146 : generating config.sh.
1147 cat > cmdline.opt <<EOSH
1148 # Configure command line arguments.
1155 cat >>cmdline.opt <<EOSH
1156 config_arg$argn='$arg'
1158 argn=`expr $argn + 1`
1161 : produce awk script to parse command line options
1162 cat >options.awk <<'EOF'
1164 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1166 len = length(optstr);
1167 for (i = 1; i <= len; i++) {
1168 c = substr(optstr, i, 1);
1169 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1180 if (substr(str, 1, 1) != "-") {
1181 printf("'%s'\n", str);
1185 for (i = 2; i <= len; i++) {
1186 c = substr(str, i, 1);
1188 printf("-%s\n", substr(str, i));
1194 printf("'%s'\n", substr(str, i + 1));
1207 : process the command line options
1208 set X `for arg in "$@"; do echo "X$arg"; done |
1209 sed -e s/X// | awk -f options.awk`
1214 : set up default values
1224 rm -f optdef.sh posthint.sh
1225 cat >optdef.sh <<EOS
1231 while test $# -gt 0; do
1233 -d) shift; fastread=yes;;
1234 -e) shift; alldone=cont;;
1238 if test -r "$1"; then
1241 echo "$me: cannot read config file $1." >&2
1246 -h) shift; error=true;;
1247 -r) shift; reuseval=true;;
1248 -s) shift; silent=true; realsilent=true;;
1249 -E) shift; alldone=exit;;
1250 -K) shift; knowitall=true;;
1251 -O) shift; override=true;;
1252 -S) shift; silent=true; extractsh=true;;
1257 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1258 echo "$me: ignoring -D $1" >&2
1261 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1262 *) echo "$1='define'" >> optdef.sh;;
1269 *=) echo "$1" >> optdef.sh;;
1271 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1272 echo "$me: ignoring -U $1" >&2
1274 *) echo "$1='undef'" >> optdef.sh;;
1285 *=*) zzz=`echo $yyy|sed 's!=.*!!'`
1289 zzz=" "`echo $yyy|sed 's!^[^=]*=!!'`
1290 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1296 *:*) xxx=`echo $yyy|sed 's!:.*!!'`
1297 yyy=`echo $yyy|sed 's!^[^:]*:!!'`
1298 zzz=`echo $yyy|sed 's!^[^=]*=!!'`
1299 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1300 *) xxx=`echo $yyy|sed 's!:.*!!'`
1301 yyy=`echo $yyy|sed 's!^[^:]*:!!'` ;;
1307 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1309 echo "$yyy=''" >> posthint.sh ;;
1314 echo "$yyy='$zzz'" >> posthint.sh ;;
1316 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1318 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1323 echo "$yyy=$zzz" >> posthint.sh ;;
1324 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1328 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1331 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1339 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1340 [-U symbol] [-U symbol=] [-A command:symbol...]
1341 -d : use defaults for all answers.
1342 -e : go on without questioning past the production of config.sh.
1343 -f : specify an alternate default configuration file.
1344 -h : print this help message and exit (with an error status).
1345 -r : reuse C symbols value if possible (skips costly nm extraction).
1346 -s : silent mode, only echoes questions and essential information.
1347 -D : define symbol to have some value:
1348 -D symbol symbol gets the value 'define'
1349 -D symbol=value symbol gets the value 'value'
1350 -E : stop at the end of questions, after having produced config.sh.
1351 -K : do not use unless you know what you are doing.
1352 -O : let -D and -U override definitions from loaded configuration file.
1353 -S : perform variable substitutions on all .SH files (can mix with -f)
1354 -U : undefine symbol:
1355 -U symbol symbol gets the value 'undef'
1356 -U symbol= symbol gets completely empty
1357 -A : manipulate symbol after the platform specific hints have been applied:
1358 -A symbol=value append " "value to symbol
1359 -A append:symbol=value append value to symbol
1360 -A define:symbol=value define symbol to have value
1361 -A clear:symbol define symbol to be ''
1362 -A define:symbol define symbol to be 'define'
1363 -A eval:symbol=value define symbol to be eval of value
1364 -A prepend:symbol=value prepend value to symbol
1365 -A undef:symbol define symbol to be 'undef'
1366 -A undef:symbol= define symbol to be ''
1367 -V : print version number and exit (with a zero status).
1374 case "$fastread$alldone" in
1377 case "$extractsh" in
1380 if test ! -t 0; then
1381 echo "Say 'sh Configure', not 'sh <Configure'"
1391 true) exec 1>/dev/null;;
1394 : run the defines and the undefines, if any, but leave the file out there...
1397 : create the posthint manipulation script and leave the file out there...
1402 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1403 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1404 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1405 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1406 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1409 : Some greps do not return status, grrr.
1410 echo "grimblepritz" >grimble
1411 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1413 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1419 : the following should work in any shell
1423 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1424 cat >contains <<'EOSS'
1425 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1430 : Find the path to the source tree
1433 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1436 *) src=`cd ../$src && pwd` ;;
1449 if test -f $rsrc/Configure && \
1450 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1452 : found it, so we are ok.
1455 for src in . .. ../.. ../../.. ../../../..; do
1456 if test -f ../$src/Configure && \
1457 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1468 Sorry, I can't seem to locate the source dir for $package. Please start
1469 Configure with an explicit path -- i.e. /some/path/Configure.
1477 echo "Sources for $package found in \"$src\"." >&4
1481 : script used to extract .SH files with variable substitutions
1482 cat >extract <<'EOS'
1484 echo "Doing variable substitutions on .SH files..."
1485 if test -f $src/MANIFEST; then
1486 set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH$'`
1488 echo "(Looking for .SH files under the source directory.)"
1489 set x `(cd $src; find . -name "*.SH" -print)`
1493 0) set x `(cd $src; echo *.SH)`; shift;;
1495 if test ! -f $src/$1; then
1501 while test $name; do
1502 if test ! -d "$name"; then
1503 create="$name $create";
1504 name=`echo $name | sed -e "s|^[^/]*$||"`;
1505 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1510 for file in $create; do
1519 dir=`expr X$file : 'X\(.*\)/'`
1520 file=`expr X$file : 'X.*/\(.*\)'`
1521 (cd $dir && . ./$file)
1531 dir=`expr X$file : 'X\(.*\)/'`
1532 file=`expr X$file : 'X.*/\(.*\)'`
1533 (set x $dir; shift; eval $mkdir_p)
1543 if test -f $src/config_h.SH; then
1544 if test ! -f config.h; then
1545 : oops, they left it out of MANIFEST, probably, so do it anyway.
1551 : extract files and exit if asked to do so
1552 case "$extractsh" in
1554 case "$realsilent" in
1558 case "$config_sh" in
1559 '') config_sh='config.sh';;
1562 echo "Fetching answers from $config_sh..."
1565 test "$override" && . ./optdef.sh
1574 : Eunice requires " " instead of "", can you believe it
1577 echo "Beginning of configuration questions for $package."
1579 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1581 : first determine how to suppress newline on echo command
1583 echo "Checking echo to see how to suppress newlines..."
1584 (echo "hi there\c" ; echo " ") >.echotmp
1585 if $contains c .echotmp >/dev/null 2>&1 ; then
1596 echo $n "The star should be here-->$c"
1600 : Now test for existence of everything in MANIFEST
1602 if test -f $rsrc/MANIFEST; then
1603 echo "First let's make sure your kit is complete. Checking..." >&4
1604 awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
1607 for filelist in x??; do
1608 (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
1610 if test -s missing; then
1614 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1616 You have the option of continuing the configuration process, despite the
1617 distinct possibility that your kit is damaged, by typing 'y'es. If you
1618 do, don't blame me if something goes wrong. I advise you to type 'n'o
1619 and contact the author (perlbug@perl.org).
1622 echo $n "Continue? [n] $c" >&4
1626 echo "Continuing..." >&4
1630 echo "ABORTING..." >&4
1635 echo "Looks good..."
1638 echo "There is no MANIFEST file. I hope your kit is complete !"
1643 : Find the appropriate value for a newline for tr
1644 if test -n "$DJGPP"; then
1647 if test X"$trnl" = X; then
1648 case "`echo foo|tr '\n' x 2>/dev/null`" in
1652 if test X"$trnl" = X; then
1653 case "`echo foo|tr '\012' x 2>/dev/null`" in
1654 foox) trnl='\012' ;;
1657 if test X"$trnl" = X; then
1660 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1666 : compute the number of columns on the terminal for proper question formatting
1671 : set up the echo used in my read
1672 myecho="case \"\$xxxm\" in
1673 '') echo $n \"\$rp $c\" >&4;;
1675 '') echo $n \"[\$xxxm] $c\";;
1677 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1679 echo $n \"[\$xxxm] $c\" >&4
1681 echo $n \"\$rp [\$xxxm] $c\" >&4
1687 : now set up to do reads with possible shell escape and default assignment
1693 case "\$fastread" in
1694 yes) case "\$dflt" in
1697 case "\$silent-\$rp" in
1702 *) case "\$silent" in
1703 true) case "\$rp" in
1708 while expr "X\$ans" : "X!" >/dev/null; do
1712 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1720 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1729 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1734 echo "(OK, I'll run with -d after this question.)" >&4
1737 echo "*** Sorry, \$1 not supported yet." >&4
1747 echo "*** Substitution done -- please confirm."
1749 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1754 echo "*** Error -- try again."
1761 case "\$ans\$xxxm\$nostick" in
1773 : create .config dir to save info across Configure sessions
1774 test -d ../.config || mkdir ../.config
1775 cat >../.config/README <<EOF
1776 This directory created by Configure to save information that should
1777 persist across sessions for $package.
1779 You may safely delete it if you wish.
1782 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
1784 $define|true|[yY]*) ;;
1785 *) case "$xversion" in
1788 *** WHOA THERE!!! ***
1790 This is an UNSTABLE DEVELOPMENT release.
1791 The version of this $package distribution is $xversion, that is, odd,
1792 (as opposed to even) and that signifies a development release.
1793 If you want a maintenance release, you want an even-numbered version.
1795 Do ***NOT*** install this into production use.
1796 Data corruption and crashes are possible.
1798 It is most seriously suggested that you do not continue any further
1799 unless you want to help in developing and debugging Perl.
1802 rp='Do you really want to continue?'
1806 [yY]) echo >&4 "Okay, continuing." ;;
1807 *) echo >&4 "Okay, bye."
1816 : general instructions
1819 user=`(logname) 2>/dev/null`
1821 '') user=`whoami 2>&1`;;
1823 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1826 rp='Would you like to see the instructions?'
1837 This installation shell script will examine your system and ask you questions
1838 to determine how the perl5 package should be installed. If you get
1839 stuck on a question, you may use a ! shell escape to start a subshell or
1840 execute a command. Many of the questions will have default answers in square
1841 brackets; typing carriage return will give you the default.
1843 On some of the questions which ask for file or directory names you are allowed
1844 to use the ~name construct to specify the login directory belonging to "name",
1845 even if you don't have a shell which knows about that. Questions where this is
1846 allowed will be marked "(~name ok)".
1850 dflt='Type carriage return to continue'
1854 The prompter used in this script allows you to use shell variables and
1855 backticks in your answers. You may use $1, $2, etc... to refer to the words
1856 in the default answer, as if the default line was a set of arguments given to a
1857 script shell. This means you may also use $* to repeat the whole default line,
1858 so you do not have to re-type everything to add something to the default.
1860 Everytime there is a substitution, you will have to confirm. If there is an
1861 error (e.g. an unmatched backtick), the default answer will remain unchanged
1862 and you will be prompted again.
1864 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1865 the questions and use the computed defaults (or the previous answers if there
1866 was already a config.sh file). Type 'Configure -h' for a list of options.
1867 You may also start interactively and then answer '& -d' at any prompt to turn
1868 on the non-interactive behaviour for the remainder of the execution.
1874 Much effort has been expended to ensure that this shell script will run on any
1875 Unix system. If despite that it blows up on yours, your best bet is to edit
1876 Configure and run it again. If you can't run Configure for some reason,
1877 you'll have to generate a config.sh file by hand. Whatever problems you
1878 have, let me (perlbug@perl.org) know how I blew it.
1880 This installation script affects things in two ways:
1882 1) it may do direct variable substitutions on some of the files included
1884 2) it builds a config.h file for inclusion in C programs. You may edit
1885 any of these files as the need arises after running this script.
1887 If you make a mistake on a question, there is no easy way to back up to it
1888 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1889 files. Configure will offer to let you do this before it runs the SH files.
1892 dflt='Type carriage return to continue'
1894 case "$firsttime" in
1895 true) echo $user >>../.config/instruct;;
1899 : find out where common programs are
1901 echo "Locating common programs..." >&4
1914 if test -d \$dir/\$thing; then
1920 for thisthing in \$dir/\$thing; do
1921 : just loop through to pick last item
1923 if test -f \$thisthing; then
1926 elif test -f \$dir/\$thing.exe; then
1927 if test -n "$DJGPP"; then
1928 echo \$dir/\$thing.exe
1930 : on Eunice apparently
1980 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1981 pth="$pth /lib /usr/lib"
1982 for file in $loclist; do
1986 if test -f "$xxx"; then
1989 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1990 xxx=`./loc $file $file $pth`
1993 '') xxx=`./loc $file $file $pth`;;
1994 *) xxx=`./loc $xxx $xxx $pth`;;
2000 echo $file is in $xxx.
2003 echo $file is in $xxx.
2006 echo "I don't know where '$file' is, and my life depends on it." >&4
2007 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2013 echo "Don't worry if any of the following aren't found..."
2015 for file in $trylist; do
2019 if test -f "$xxx"; then
2022 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2023 xxx=`./loc $file $file $pth`
2026 '') xxx=`./loc $file $file $pth`;;
2027 *) xxx=`./loc $xxx $xxx $pth`;;
2033 echo $file is in $xxx.
2036 echo $file is in $xxx.
2039 echo "I don't see $file out there, $say."
2046 echo "Substituting grep for egrep."
2052 echo "Substituting cp for ln."
2058 echo "Hopefully test is built into your sh."
2061 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2062 echo "Using the test built into your sh."
2070 echo "Hopefully echo is built into your sh."
2075 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2076 $echo $n "hi there$c" >foo1
2077 echo $n "hi there$c" >foo2
2078 if cmp foo1 foo2 >/dev/null 2>&1; then
2079 echo "They are compatible. In fact, they may be identical."
2086 They are not compatible! You are probably running ksh on a non-USG system.
2087 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2088 have echo built in and we may have to run some Bourne shell scripts. That
2089 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2092 $echo $n "The star should be here-->$c"
2102 cat <<'EOSC' >>checkcc
2107 int main(int argc, char *argv[]) {
2111 if $cc -o try $ccflags try.c; then
2114 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2120 case "`$cc -v -c try.c 2>&1`" in
2123 if $test X"$trygcc" = Xyes; then
2124 if gcc -o try -c try.c; then
2126 echo "You seem to have a working gcc, though." >&4
2127 rp="Would you like to use it?"
2129 if $test -f myread; then
2132 if $test -f UU/myread; then
2135 echo "Cannot find myread, sorry. Aborting." >&2
2140 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no ;;
2144 if $test X"$despair" = Xyes; then
2146 You need to find a working C compiler.
2147 Either (purchase and) install the C compiler supplied by your OS vendor,
2148 or for a free C compiler try http://gcc.gnu.org/
2149 I cannot continue any further, aborting.
2159 : determine whether symbolic links are supported
2162 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2163 echo "Symbolic links are supported." >&4
2166 echo "Symbolic links are NOT supported." >&4
2171 : see whether [:lower:] and [:upper:] are supported character classes
2173 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2175 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2179 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
2180 # (0xc9 and 0xd1), therefore that is a nice testing point.
2181 if test "X$up" = X -o "X$low" = X; then
2182 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
2188 if test "X$up" = X -o "X$low" = X; then
2189 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
2195 if test "X$up" = X -o "X$low" = X; then
2196 case "`echo IJ | od -x 2>/dev/null`" in
2198 echo "Hey, this might be EBCDIC." >&4
2199 if test "X$up" = X -o "X$low" = X; then
2200 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2201 ij) up='[A-IJ-RS-Z]'
2206 if test "X$up" = X -o "X$low" = X; then
2207 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2217 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
2219 echo "Using $up and $low to convert case." >&4
2222 echo "I don't know how to translate letters from upper to lower case." >&4
2223 echo "Your tr is not acting any way I know of." >&4
2227 : set up the translation script tr, must be called with ./tr of course
2231 '[A-Z][a-z]') exec $tr '$up' '$low';;
2232 '[a-z][A-Z]') exec $tr '$low' '$up';;
2239 : Try to determine whether config.sh was made on this system
2240 case "$config_sh" in
2242 myuname=`$uname -a 2>/dev/null`
2243 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2244 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2245 # because the A-Z/a-z are not consecutive.
2246 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2247 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2248 newmyuname="$myuname"
2250 case "$knowitall" in
2252 if test -f ../config.sh; then
2253 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2254 eval "`grep myuname= ../config.sh`"
2256 if test "X$myuname" = "X$newmyuname"; then
2264 : Get old answers from old config file if Configure was run on the
2265 : same system, otherwise use the hints.
2268 if test -f config.sh; then
2270 rp="I see a config.sh file. Shall I use it to set the defaults?"
2273 n*|N*) echo "OK, I'll ignore it."
2274 mv config.sh config.sh.old
2275 myuname="$newmyuname"
2277 *) echo "Fetching default answers from your old config.sh file..." >&4
2285 : Older versions did not always set $sh. Catch re-use of such
2295 if test ! -f config.sh; then
2298 First time through, eh? I have some defaults handy for some systems
2299 that need some extra help getting the Configure answers right:
2302 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2304 : Half the following guesses are probably wrong... If you have better
2305 : tests or hints, please send them to perlbug@perl.org
2306 : The metaconfig authors would also appreciate a copy...
2307 $test -f /irix && osname=irix
2308 $test -f /xenix && osname=sco_xenix
2309 $test -f /dynix && osname=dynix
2310 $test -f /dnix && osname=dnix
2311 $test -f /lynx.os && osname=lynxos
2312 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2313 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
2314 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2315 $test -f /bin/mips && /bin/mips && osname=mips
2316 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
2317 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
2318 $test -d /usr/apollo/bin && osname=apollo
2319 $test -f /etc/saf/_sactab && osname=svr4
2320 $test -d /usr/include/minix && osname=minix
2321 if $test -d /MachTen -o -d /MachTen_Folder; then
2323 if $test -x /sbin/version; then
2324 osvers=`/sbin/version | $awk '{print $2}' |
2325 $sed -e 's/[A-Za-z]$//'`
2326 elif $test -x /usr/etc/version; then
2327 osvers=`/usr/etc/version | $awk '{print $2}' |
2328 $sed -e 's/[A-Za-z]$//'`
2334 $test -f /sys/posix.dll &&
2335 $test -f /usr/bin/what &&
2336 set X `/usr/bin/what /sys/posix.dll` &&
2337 $test "$3" = UWIN &&
2341 if $test -f $uname; then
2349 umips) osname=umips ;;
2352 [23]100) osname=mips ;;
2353 next*) osname=next ;;
2355 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
2356 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
2359 elif $test -f /etc/kconfig; then
2361 if test "$lns" = "$ln -s"; then
2363 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
2365 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
2372 if test -n "$DJGPP"; then
2381 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
2383 'not found') osvers="$4"."$3" ;;
2384 '<3240'|'<>3240') osvers=3.2.0 ;;
2385 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
2386 '=3250'|'>3250') osvers=3.2.5 ;;
2390 bsd386) osname=bsd386
2393 cygwin*) osname=cygwin
2396 *dc.osx) osname=dcosx
2402 domainos) osname=apollo
2408 dynixptx*) osname=dynixptx
2409 osvers=`echo "$4"|sed 's/^v//'`
2411 freebsd) osname=freebsd
2413 genix) osname=genix ;;
2415 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
2431 netbsd*) osname=netbsd
2434 news-os) osvers="$3"
2436 4*) osname=newsos4 ;;
2440 next*) osname=next ;;
2441 nonstop-ux) osname=nonstopux ;;
2442 POSIX-BC | posix-bc ) osname=posix-bc
2445 powerux | power_ux | powermax_os | powermaxos | \
2446 powerunix | power_unix) osname=powerux
2452 solaris) osname=solaris
2454 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2461 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2465 titanos) osname=titanos
2474 ultrix) osname=ultrix
2477 osf1|mls+) case "$5" in
2480 osvers=`sizer -v | awk '{print $3}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
2483 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
2486 hp*) osname=hp_osf1 ;;
2487 mips) osname=mips_osf1 ;;
2490 unixware) osname=svr5
2496 $2) case "$osname" in
2500 : svr4.x or possibly later
2510 if test -f /stand/boot ; then
2511 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
2512 if test -n "$INITPROG" -a -f "$INITPROG"; then
2513 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
2514 if test -n "$isesix"; then
2522 *) if test -f /etc/systemid; then
2524 set `echo $3 | $sed 's/\./ /g'` $4
2525 if $test -f $src/hints/sco_$1_$2_$3.sh; then
2527 elif $test -f $src/hints/sco_$1_$2.sh; then
2529 elif $test -f $src/hints/sco_$1.sh; then
2534 '') : Still unknown. Probably a generic Sys V.
2543 *) case "$osname" in
2544 '') : Still unknown. Probably a generic BSD.
2552 if test -f /vmunix -a -f $src/hints/news_os.sh; then
2553 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
2554 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
2557 $rm -f UU/kernel.what
2558 elif test -d c:/.; then
2565 : Now look for a hint file osname_osvers, unless one has been
2566 : specified already.
2569 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
2570 : Also try without trailing minor version numbers.
2571 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
2572 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
2573 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
2574 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
2577 *) case "$osvers" in
2580 *) if $test -f $src/hints/$file.sh ; then
2582 elif $test -f $src/hints/$xfile.sh ; then
2584 elif $test -f $src/hints/$xxfile.sh ; then
2586 elif $test -f $src/hints/$xxxfile.sh ; then
2588 elif $test -f $src/hints/$xxxxfile.sh ; then
2590 elif $test -f "$src/hints/${osname}.sh" ; then
2599 if $test -f Policy.sh ; then
2602 none) dflt="Policy" ;;
2603 *) dflt="Policy $dflt" ;;
2608 dflt=`echo $hintfile | $sed 's/\.sh$//'`
2612 if $test -f Policy.sh ; then
2615 There's also a Policy hint file available, which should make the
2616 site-specific (policy) questions easier to answer.
2623 You may give one or more space-separated answers, or "none" if appropriate.
2624 A well-behaved OS will have no hints, so answering "none" or just "Policy"
2625 is a good thing. DO NOT give a wrong version or a wrong OS.
2629 rp="Which of these apply, if any?"
2632 for file in $tans; do
2633 if $test X$file = XPolicy -a -f Policy.sh; then
2635 $cat Policy.sh >> UU/config.sh
2636 elif $test -f $src/hints/$file.sh; then
2637 . $src/hints/$file.sh
2638 $cat $src/hints/$file.sh >> UU/config.sh
2639 elif $test X$tans = X -o X$tans = Xnone ; then
2642 : Give one chance to correct a possible typo.
2643 echo "$file.sh does not exist"
2645 rp="hint to use instead?"
2647 for file in $ans; do
2648 if $test -f "$src/hints/$file.sh"; then
2649 . $src/hints/$file.sh
2650 $cat $src/hints/$file.sh >> UU/config.sh
2651 elif $test X$ans = X -o X$ans = Xnone ; then
2654 echo "$file.sh does not exist -- ignored."
2661 : Remember our hint file for later.
2662 if $test -f "$src/hints/$file.sh" ; then
2672 echo "Fetching default answers from $config_sh..." >&4
2676 cp $config_sh config.sh 2>/dev/null
2686 test "$override" && . ./optdef.sh
2688 : Restore computed paths
2689 for file in $loclist $trylist; do
2690 eval $file="\$_$file"
2695 Configure uses the operating system name and version to set some defaults.
2696 The default value is probably right if the name rings a bell. Otherwise,
2697 since spelling matters for me, either accept the default or answer "none"
2704 ''|' '|none) dflt=none ;;
2705 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
2708 *) dflt="$osname" ;;
2710 rp="Operating system name?"
2714 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
2720 ''|' '|none) dflt=none ;;
2721 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
2722 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
2724 ''|' ') dflt=none ;;
2729 *) dflt="$osvers" ;;
2731 rp="Operating system version?"
2741 : who configured the system
2742 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
2743 cf_by=`(logname) 2>/dev/null`
2746 cf_by=`(whoami) 2>/dev/null`
2748 "") cf_by=unknown ;;
2752 : set up the script used to warn in case of inconsistency
2759 echo "*** WHOA THERE!!! ***" >&4
2760 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2761 rp=" Keep the $hint value?"
2764 y) td=$was; tu=$was;;
2768 : function used to set $1 to $val
2769 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2771 $define$undef) . ./whoa; eval "$var=\$td";;
2772 $undef$define) . ./whoa; eval "$var=\$tu";;
2773 *) eval "$var=$val";;
2776 case "$usethreads" in
2777 $define|true|[yY]*) dflt='y';;
2782 Perl can be built to take advantage of threads on some systems.
2783 To do so, Configure can be run with -Dusethreads.
2785 Note that threading is a highly experimental feature, and
2786 some known race conditions still remain. If you choose to try
2787 it, be very sure to not actually deploy it for production
2788 purposes. README.threads has more details, and is required
2789 reading if you enable threads.
2791 If this doesn't make any sense to you, just accept the default '$dflt'.
2793 rp='Build a threading Perl?'
2796 y|Y) val="$define" ;;
2802 case "$usethreads" in
2806 As of 5.5.640, Perl has two different internal threading implementations,
2807 the 5.005 version (5005threads) and an interpreter-based version
2808 (ithreads) that has one interpreter per thread. Both are very
2809 experimental. This arrangement exists to help developers work out
2810 which one is better.
2812 If you're a casual user, you probably don't want interpreter-threads
2813 at this time. There doesn't yet exist a way to create threads from
2814 within Perl in this model, i.e., "use Thread;" will NOT work.
2816 : Default to ithreads unless overridden on command line or with
2819 case "$use5005threads" in
2820 $define|true|[yY]*) dflt='n';;
2822 case "$useithreads" in
2823 $undef|false|[nN]*) dflt='n';;
2825 rp='Use interpreter-based ithreads?'
2828 y|Y) val="$define" ;;
2833 : Now set use5005threads to the opposite value.
2834 case "$useithreads" in
2835 $define) val="$undef" ;;
2842 useithreads="$undef"
2843 use5005threads="$undef"
2847 case "$d_oldpthreads" in
2848 '') : Configure tests would be welcome here. For now, assume undef.
2850 *) val="$d_oldpthreads" ;;
2856 case "$usethreads" in
2857 "$define"|true|[yY]*)
2858 : Look for a hint-file generated 'call-back-unit'. If the
2859 : user has specified that a threading perl is to be built,
2860 : we may need to set or change some other defaults.
2861 if $test -f usethreads.cbu; then
2862 echo "Your platform has some specific hints for threaded builds, using them..."
2866 (Your platform doesn't have any specific hints for threaded builds.
2867 Assuming POSIX threads, then.)
2875 Perl can be built so that multiple Perl interpreters can coexist
2876 within the same Perl executable.
2879 case "$useithreads" in
2882 This multiple interpreter support is required for interpreter-based threads.
2886 *) case "$usemultiplicity" in
2887 $define|true|[yY]*) dflt='y';;
2891 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
2892 rp='Build Perl for multiplicity?'
2895 y|Y) val="$define" ;;
2903 : make some quick guesses about what we are up against
2905 $echo $n "Hmm... $c"
2915 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
2916 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
2918 echo "Looks kind of like an OSF/1 system, but we'll see..."
2920 elif test `echo abc | $tr a-z A-Z` = Abc ; then
2921 xxx=`./loc addbib blurfl $pth`
2922 if $test -f $xxx; then
2923 echo "Looks kind of like a USG system with BSD features, but we'll see..."
2927 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
2928 echo "Looks kind of like an extended USG system, but we'll see..."
2930 echo "Looks kind of like a USG system, but we'll see..."
2934 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
2935 echo "Looks kind of like a BSD system, but we'll see..."
2939 echo "Looks kind of like a Version 7 system, but we'll see..."
2942 case "$eunicefix" in
2945 There is, however, a strange, musty smell in the air that reminds me of
2946 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
2950 : it so happens the Eunice I know will not run shell scripts in Unix format
2954 echo "Congratulations. You aren't running Eunice."
2958 : Detect OS2. The p_ variable is set above in the Head.U unit.
2959 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
2960 : semicolon as a patch separator
2965 I have the feeling something is not exactly right, however...don't tell me...
2966 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
2967 (Or you may be running DOS with DJGPP.)
2972 if test -f /xenix; then
2973 echo "Actually, this looks more like a XENIX system..."
2978 echo "It's not Xenix..."
2983 if test -f /venix; then
2984 echo "Actually, this looks more like a VENIX system..."
2991 echo "Nor is it Venix..."
2994 chmod +x bsd usg v7 osf1 eunice xenix venix os2
2995 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3002 rp="Use which C compiler?"
3005 : Look for a hint-file generated 'call-back-unit'. Now that the
3006 : user has specified the compiler, we may need to set or change some
3008 if $test -f cc.cbu; then
3014 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3015 $cat >gccvers.c <<EOM
3020 printf("%s\n", __VERSION__);
3022 printf("%s\n", "1");
3028 if $cc -o gccvers $ldflags gccvers.c; then
3029 gccversion=`./gccvers`
3030 case "$gccversion" in
3031 '') echo "You are not using GNU cc." ;;
3032 *) echo "You are using GNU cc $gccversion."
3038 echo "*** WHOA THERE!!! ***" >&4
3039 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3040 case "$knowitall" in
3042 echo " You'd better start hunting for one and let me know about it." >&4
3048 case "$gccversion" in
3049 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3051 case "$gccversion" in
3052 '') gccosandvers='' ;;
3053 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
3054 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
3056 case "$gccosandvers" in
3057 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
3058 $osname$osvers) ;; # looking good
3059 $osname*) cat <<EOM >&4
3061 *** WHOA THERE!!! ***
3063 Your gcc has not been compiled for the exact release of
3064 your operating system ($gccosandvers versus $osname$osvers).
3066 In general it is a good idea to keep gcc synchronized with
3067 the operating system because otherwise serious problems
3068 may ensue when trying to compile software, like Perl.
3070 I'm trying to be optimistic here, though, and will continue.
3071 If later during the configuration and build icky compilation
3072 problems appear (headerfile conflicts being the most common
3073 manifestation), I suggest reinstalling the gcc to match
3074 your operating system release.
3078 *) gccosandvers='' ;; # failed to parse, better be silent
3086 : see how we invoke the C preprocessor
3088 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3089 cat <<'EOT' >testcpp.c
3095 if test ! -f cppstdin; then
3096 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
3097 # AIX cc -E doesn't show the absolute headerfile
3098 # locations but we'll cheat by using the -M flag.
3099 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
3101 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3104 echo "Keeping your $hint cppstdin wrapper."
3107 wrapper=`pwd`/cppstdin
3111 if $test "X$cppstdin" != "X" && \
3112 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3113 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3115 echo "You used to use $cppstdin $cppminus so we'll use that again."
3117 '') echo "But let's see if we can live without a wrapper..." ;;
3119 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3120 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3122 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3125 echo "(However, $cpprun $cpplast does not work, let's see...)"
3133 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3140 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3141 $cc -E <testcpp.c >testcpp.out 2>&1; \
3142 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3143 echo "Yup, it does."
3146 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
3147 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3148 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3149 echo "Yup, it does."
3152 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
3153 $cc -P <testcpp.c >testcpp.out 2>&1; \
3154 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3155 echo "Yipee, that works!"
3158 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
3159 $cc -P - <testcpp.c >testcpp.out 2>&1; \
3160 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3161 echo "At long last!"
3164 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
3165 $cpp <testcpp.c >testcpp.out 2>&1; \
3166 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3170 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
3171 $cpp - <testcpp.c >testcpp.out 2>&1; \
3172 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3173 echo "Hooray, it works! I was beginning to wonder."
3176 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
3177 $wrapper <testcpp.c >testcpp.out 2>&1; \
3178 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3184 rp="No dice. I can't find a C preprocessor. Name one:"
3188 $x_cpp <testcpp.c >testcpp.out 2>&1
3189 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3190 echo "OK, that will do." >&4
3192 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
3207 echo "Perhaps can we force $cc -E using a wrapper..."
3208 if $wrapper <testcpp.c >testcpp.out 2>&1; \
3209 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3215 echo "Nope, we'll have to live without it..."
3229 "$wrapper"|'cppstdin') ;;
3230 *) $rm -f $wrapper;;
3232 $rm -f testcpp.c testcpp.out
3234 : decide how portable to be. Allow command line overrides.
3235 case "$d_portable" in
3237 *) d_portable="$define" ;;
3240 : set up shell script to do ~ expansion
3246 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3249 if $test -f /bin/csh; then
3250 /bin/csh -f -c "glob \$1"
3255 name=\`$expr x\$1 : '..\([^/]*\)'\`
3256 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3257 if $test ! -d "\$dir"; then
3259 echo "\$me: can't locate home directory for: \$name" >&2
3264 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3280 : now set up to get a file name
3284 cat <<'EOSC' >>getfile
3300 expr $fn : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3301 fn=`echo $fn | sed 's/(.*)//'`
3307 loc_file=`expr $fn : '.*:\(.*\)'`
3308 fn=`expr $fn : '\(.*\):.*'`
3316 */*) fullpath=true;;
3325 *e*) exp_file=true;;
3328 *p*) nopath_ok=true;;
3333 *d*) type='Directory';;
3334 *l*) type='Locate';;
3339 Locate) what='File';;
3344 case "$d_portable" in
3352 while test "$type"; do
3357 true) rp="$rp (~name ok)";;
3360 if test -f UU/getfile.ok && \
3361 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3380 value=`UU/filexp $ans`
3383 if test "$ans" != "$value"; then
3384 echo "(That expands to $value on this system.)"
3398 /*) value="$ansexp" ;;
3399 [a-zA-Z]:/*) value="$ansexp" ;;
3404 echo "I shall only accept a full path name, as in /bin/ls." >&4
3405 echo "Use a ! shell escape if you wish to check pathnames." >&4
3408 echo "Please give a full path name, starting with slash." >&4
3411 echo "Note that using ~name is ok provided it expands well." >&4
3424 for fp in $gfpth; do
3425 if test "X$fp" = X.; then
3430 if test -f "$pf"; then
3432 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3434 echo "($value is not a plain file, but that's ok.)"
3437 if test X"$type" = X; then
3444 for fp in $gfpth; do
3445 if test "X$fp" = X.; then
3450 direxp="$fp/$ansexp"
3452 if test -d "$direxp"; then
3460 if test -d "$ansexp"; then
3461 echo "(Looking for $loc_file in directory $value.)"
3462 value="$value/$loc_file"
3463 ansexp="$ansexp/$loc_file"
3465 if test -f "$ansexp"; then
3468 case "$nopath_ok" in
3469 true) case "$value" in
3471 *) echo "Assuming $value will be in people's path."
3487 if test "$fastread" = yes; then
3492 rp="$what $value doesn't exist. Use that name anyway?"
3511 test "X$gfpthkeep" != Xy && gfpth=""
3514 : What should the include directory be ?
3516 $echo $n "Hmm... $c"
3520 if $test -f /bin/mips && /bin/mips; then
3521 echo "Looks like a MIPS system..."
3522 $cat >usr.c <<'EOCP'
3523 #ifdef SYSTYPE_BSD43
3527 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3528 dflt='/bsd43/usr/include'
3532 mips_type='System V'
3534 $rm -f usr.c usr.out
3535 echo "and you're compiling with the $mips_type compiler and libraries."
3539 echo "Doesn't look like a MIPS system."
3549 case "$xxx_prompt" in
3552 rp='Where are the include files you want to use?'
3560 : Set private lib path
3563 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
3568 '') dlist="$loclibpth $plibpth $glibpth";;
3569 *) dlist="$libpth";;
3572 : Now check and see which directories actually exist, avoiding duplicates
3576 if $test -d $xxx; then
3579 *) libpth="$libpth $xxx";;
3585 Some systems have incompatible or broken versions of libraries. Among
3586 the directories listed in the question below, please remove any you
3587 know not to be holding relevant libraries, and add any that are needed.
3588 Say "none" for none.
3599 rp="Directories to use for library searches?"
3606 : compute shared library extension
3609 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
3619 On some systems, shared libraries may be available. Answer 'none' if
3620 you want to suppress searching of shared libraries for the remainder
3621 of this configuration.
3624 rp='What is the file extension used for shared libraries?'
3628 : Define several unixisms.
3629 : Hints files or command line option can be used to override them.
3630 : The convoluted testing is in case hints files set either the old
3633 '') case "$exe_ext" in
3635 *) _exe="$exe_ext" ;;
3640 '') case "$lib_ext" in
3647 '') case "$obj_ext" in
3654 '') case "$path_sep" in
3665 : Which makefile gets called first. This is used by make depend.
3666 case "$firstmakefile" in
3667 '') firstmakefile='makefile';;
3671 $define|true|[yY]*) dflt='y';;
3676 Perl can be built to use the SOCKS proxy protocol library. To do so,
3677 Configure must be run with -Dusesocks. If you use SOCKS you also need
3678 to use the PerlIO abstraction layer, this will be implicitly selected.
3680 If this doesn't make any sense to you, just accept the default '$dflt'.
3682 rp='Build Perl for SOCKS?'
3685 y|Y) val="$define" ;;
3692 $define|true|[yY]*) useperlio="$define";;
3695 : Looking for optional libraries
3697 echo "Checking for optional libraries..." >&4
3702 case "$libswanted" in
3703 '') libswanted='c_s';;
3706 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
3712 for thisdir in $libpth $xlibpth; do
3713 test -d $thisdir && libspath="$libspath $thisdir"
3715 for thislib in $libswanted; do
3716 for thisdir in $libspath; do
3718 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
3719 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|tail -1`
3720 $test -f "$xxx" && eval $libscheck
3721 $test -f "$xxx" && libstyle=shared
3723 if test ! -f "$xxx"; then
3724 xxx=$thisdir/lib$thislib.$so
3725 $test -f "$xxx" && eval $libscheck
3726 $test -f "$xxx" && libstyle=shared
3728 if test ! -f "$xxx"; then
3729 xxx=$thisdir/lib$thislib$_a
3730 $test -f "$xxx" && eval $libscheck
3731 $test -f "$xxx" && libstyle=static
3733 if test ! -f "$xxx"; then
3734 xxx=$thisdir/$thislib$_a
3735 $test -f "$xxx" && eval $libscheck
3736 $test -f "$xxx" && libstyle=static
3738 if test ! -f "$xxx"; then
3739 xxx=$thisdir/lib${thislib}_s$_a
3740 $test -f "$xxx" && eval $libscheck
3741 $test -f "$xxx" && libstyle=static
3742 $test -f "$xxx" && thislib=${thislib}_s
3744 if test ! -f "$xxx"; then
3745 xxx=$thisdir/Slib$thislib$_a
3746 $test -f "$xxx" && eval $libscheck
3747 $test -f "$xxx" && libstyle=static
3749 if $test -f "$xxx"; then
3751 shared) echo "Found -l$thislib (shared)." ;;
3752 static) echo "Found -l$thislib." ;;
3753 *) echo "Found -l$thislib ($libstyle)." ;;
3757 *) dflt="$dflt -l$thislib"
3758 libsfound="$libsfound $xxx"
3760 libsfiles="$libsfiles $yyy"
3761 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
3762 case " $libsdirs " in
3764 *) libsdirs="$libsdirs $yyy" ;;
3771 if $test ! -f "$xxx"; then
3772 echo "No -l$thislib."
3783 ' '|'') dflt='none';;
3788 In order to compile $package on your machine, a number of libraries
3789 are usually needed. Include any other special libraries here as well.
3790 Say "none" for none. The default list is almost always right.
3794 rp="What libraries to use?"
3801 : determine optimization, if desired, or use for debug flag also
3803 ' '|$undef) dflt='none';;
3805 *) dflt="$optimize";;
3809 By default, $package compiles with the -O flag to use the optimizer.
3810 Alternately, you might want to use the symbolic debugger, which uses
3811 the -g flag (on traditional Unix systems). Either flag can be
3812 specified here. To use neither flag, specify the word "none".
3815 rp="What optimizer/debugger flag should be used?"
3819 'none') optimize=" ";;
3823 : We will not override a previous value, but we might want to
3824 : augment a hint file
3826 default|recommended)
3827 case "$gccversion" in
3828 1*) dflt='-fpcc-struct-return' ;;
3831 *-g*) dflt="$dflt -DDEBUGGING";;
3833 case "$gccversion" in
3834 2*) if test -d /etc/conf/kconfig.d &&
3835 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
3841 case "$gccversion" in
3845 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
3846 echo 'int main(void) { return 0; }' > gcctest.c
3847 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
3848 echo "Yes, it does." 2>&1
3851 echo "Leaving current flags $ccflags alone." 2>&1
3853 *) dflt="$dflt -fno-strict-aliasing" ;;
3856 echo "Nope, it doesn't, but that's ok." 2>&1
3863 case "$mips_type" in
3864 *BSD*|'') inclwanted="$locincpth $usrinc";;
3865 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
3867 for thisincl in $inclwanted; do
3868 if $test -d $thisincl; then
3869 if $test x$thisincl != x$usrinc; then
3871 *" -I$thisincl "*);;
3872 *) dflt="$dflt -I$thisincl ";;
3878 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
3880 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
3888 *) dflt="$dflt -D$2";;
3892 set signal.h LANGUAGE_C; eval $inctest
3896 ccflags="$ccflags -DSOCKS"
3901 default|recommended) dflt="$ccflags $dflt" ;;
3902 *) dflt="$ccflags";;
3911 Your C compiler may want other flags. For this question you should include
3912 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
3913 but you should NOT include libraries or ld flags like -lwhatever. If you
3914 want $package to honor its debug switch, you should include -DDEBUGGING here.
3915 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
3917 To use no flags, specify the word "none".
3923 rp="Any additional cc flags?"
3930 : the following weeds options from ccflags that are of no interest to cpp
3932 case "$gccversion" in
3933 1*) cppflags="$cppflags -D__GNUC__"
3935 case "$mips_type" in
3937 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
3943 echo "Let me guess what the preprocessor flags are..." >&4
3957 *) ftry="$previous $flag";;
3959 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
3960 >cpp1.out 2>/dev/null && \
3961 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
3962 >cpp2.out 2>/dev/null && \
3963 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
3964 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
3966 cppflags="$cppflags $ftry"
3976 *-*) echo "They appear to be: $cppflags";;
3978 $rm -f cpp.c cpp?.out
3982 : flags used in final linking phase
3984 '') if ./venix; then
3990 *-posix*) dflt="$dflt -posix" ;;
3993 *) dflt="$ldflags";;
3996 : Try to guess additional flags to pick up local libraries.
3997 for thislibdir in $libpth; do
3998 case " $loclibpth " in
4001 *"-L$thislibdir "*) ;;
4002 *) dflt="$dflt -L$thislibdir" ;;
4014 Your C linker may need flags. For this question you should
4015 include -L/whatever and any other flags used by the C linker, but you
4016 should NOT include libraries like -lwhatever.
4018 Make sure you include the appropriate -L/path flags if your C linker
4019 does not normally search all of the directories you specified above,
4022 To use no flags, specify the word "none".
4026 rp="Any additional ld flags (NOT including libraries)?"
4032 rmlist="$rmlist pdp11"
4036 echo "Checking your choice of C compiler and flags for coherency..." >&4
4037 $cat > try.c <<'EOF'
4039 int main() { printf("Ok\n"); exit(0); }
4041 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
4043 $cat >try.msg <<'EOM'
4044 I've tried to compile and run the following simple program:
4047 $cat try.c >> try.msg
4049 $cat >> try.msg <<EOM
4056 and I got the following output:
4060 if sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
4061 if sh -c './try' >>try.msg 2>&1; then
4065 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4068 cat >> try.msg <<'EOQS'
4069 If $libs contains -lsfio, and sfio is mis-configured, then it
4070 sometimes (apparently) runs and exits with a 0 status, but with no
4071 output! It may have to do with sfio's use of _exit vs. exit.
4074 rp="You have a big problem. Shall I abort Configure"
4081 echo "The program compiled OK, but exited with status $?." >>try.msg
4082 rp="You have a problem. Shall I abort Configure"
4086 echo "I can't compile the test program." >>try.msg
4087 rp="You have a BIG problem. Shall I abort Configure"
4093 case "$knowitall" in
4095 echo "(The supplied flags or libraries might be incorrect.)"
4103 *) echo "Ok. Stopping Configure." >&4
4108 n) echo "OK, that should do.";;
4110 $rm -f try try.* core
4112 : define an is-a-typedef? function
4113 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
4115 "") inclist="sys/types.h";;
4117 eval "varval=\$$var";
4121 for inc in $inclist; do
4122 echo "#include <$inc>" >>temp.c;
4124 echo "#ifdef $type" >> temp.c;
4125 echo "printf(\"We have $type\");" >> temp.c;
4126 echo "#endif" >> temp.c;
4127 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
4128 if $contains $type temp.E >/dev/null 2>&1; then
4134 *) eval "$var=\$varval";;
4137 : define an is-a-typedef? function that prompts if the type is not available.
4138 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
4140 "") inclist="sys/types.h";;
4142 eval "varval=\$$var";
4146 for inc in $inclist; do
4147 echo "#include <$inc>" >>temp.c;
4149 echo "#ifdef $type" >> temp.c;
4150 echo "printf(\"We have $type\");" >> temp.c;
4151 echo "#endif" >> temp.c;
4152 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
4154 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
4155 if $contains $type temp.E >/dev/null 2>&1; then
4156 echo "$type found." >&4;
4159 echo "$type NOT found." >&4;
4165 *) eval "$var=\$varval";;
4168 : define a shorthand compile call
4172 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
4173 : define a shorthand compile call for compilations that should be ok.
4177 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
4179 : check for lengths of integral types
4183 echo "Checking to see how big your integers are..." >&4
4184 $cat >intsize.c <<'EOCP'
4188 printf("intsize=%d;\n", (int)sizeof(int));
4189 printf("longsize=%d;\n", (int)sizeof(long));
4190 printf("shortsize=%d;\n", (int)sizeof(short));
4195 if eval $compile_ok && ./intsize > /dev/null; then
4197 echo "Your integers are $intsize bytes long."
4198 echo "Your long integers are $longsize bytes long."
4199 echo "Your short integers are $shortsize bytes long."
4203 Help! I can't compile and run the intsize test program: please enlighten me!
4204 (This is probably a misconfiguration in your system or libraries, and
4205 you really ought to fix it. Still, I'll try anyway.)
4209 rp="What is the size of an integer (in bytes)?"
4213 rp="What is the size of a long integer (in bytes)?"
4217 rp="What is the size of a short integer (in bytes)?"
4223 $rm -f intsize intsize.*
4225 : see what type lseek is declared as in the kernel
4226 rp="What is the type used for lseek's offset on this system?"
4227 set off_t lseektype long stdio.h sys/types.h
4231 echo "Checking to see how big your file offsets are..." >&4
4233 #include <sys/types.h>
4237 printf("%d\n", (int)sizeof($lseektype));
4242 if eval $compile_ok; then
4244 echo "Your file offsets are $lseeksize bytes long."
4248 echo "(I can't seem to compile the test program. Guessing...)"
4249 rp="What is the size of your file offsets (in bytes)?"
4255 : see what type file positions are declared as in the library
4256 rp="What is the type for file position used by fsetpos()?"
4257 set fpos_t fpostype long stdio.h sys/types.h
4262 *_t) zzz="$fpostype" ;;
4265 echo "Checking the size of $zzz..." >&4
4267 #include <sys/types.h>
4270 printf("%d\n", (int)sizeof($fpostype));
4275 if eval $compile_ok; then
4279 echo "(I can't execute the test program--guessing $fpossize.)" >&4
4282 echo "Your $zzz is $fpossize bytes long."
4288 echo "(I can't compile the test program. Guessing...)" >&4
4289 rp="What is the size of your file positions (in bytes)?"
4296 # Backward compatibility (uselfs is deprecated).
4298 "$define"|true|[yY]*)
4301 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
4303 uselargefiles="$define"
4307 case "$lseeksize:$fpossize" in
4310 You can have files larger than 2 gigabytes.
4313 *) case "$uselargefiles" in
4314 "$undef"|false|[nN]*) dflt='n' ;;
4319 Perl can be built to understand large files (files larger than 2 gigabytes)
4320 on some systems. To do so, Configure can be run with -Duselargefiles.
4322 If this doesn't make any sense to you, just accept the default '$dflt'.
4324 rp='Try to understand large files, if available?'
4327 y|Y) val="$define" ;;
4334 case "$uselargefiles" in
4336 : Look for a hint-file generated 'call-back-unit'. If the
4337 : user has specified that a large files perl is to be built,
4338 : we may need to set or change some other defaults.
4339 if $test -f uselargefiles.cbu; then
4340 echo "Your platform has some specific hints for large file builds, using them..."
4341 . ./uselargefiles.cbu
4343 echo "Rechecking to see how big your file offsets are..." >&4
4345 #include <sys/types.h>
4349 printf("%d\n", (int)sizeof($lseektype));
4354 if eval $compile_ok; then
4356 $echo "Your file offsets are now $lseeksize bytes long."
4360 echo "(I can't seem to compile the test program. Guessing...)"
4361 rp="What is the size of your file offsets (in bytes)?"
4366 *_t) zzz="$fpostype" ;;
4369 $echo $n "Rechecking the size of $zzz...$c" >&4
4371 #include <sys/types.h>
4374 printf("%d\n", (int)sizeof($fpostype));
4379 if eval $compile_ok; then
4384 echo "(I can't execute the test program--guessing $fpossize.)" >&4
4387 echo " $fpossize bytes." >&4
4393 echo "(I can't compile the test program. Guessing...)" >&4
4394 rp="What is the size of your file positions (in bytes)?"
4404 case "$usemorebits" in
4405 "$define"|true|[yY]*)
4406 use64bitint="$define"
4407 uselongdouble="$define"
4408 usemorebits="$define"
4410 *) usemorebits="$undef"
4415 case "$uselonglong" in
4416 "$define"|true|[yY]*)
4419 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
4421 use64bitint="$define"
4424 case "$use64bits" in
4425 "$define"|true|[yY]*)
4428 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
4430 use64bitint="$define"
4433 case "$use64bitints" in
4434 "$define"|true|[yY]*)
4437 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
4439 use64bitint="$define"
4442 case "$use64bitsint" in
4443 "$define"|true|[yY]*)
4446 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
4448 use64bitint="$define"
4451 case "$uselonglongs" in
4452 "$define"|true|[yY]*)
4455 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
4457 use64bitint="$define"
4460 case "$use64bitsall" in
4461 "$define"|true|[yY]*)
4464 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
4466 use64bitall="$define"
4471 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
4473 case "$use64bitall" in
4474 "$define"|true|[yY]*) use64bitint="$define" ;;
4480 You have natively 64-bit long integers.
4484 *) case "$use64bitint" in
4485 "$define"|true|[yY]*) dflt='y';;
4490 Perl can be built to take advantage of 64-bit integer types
4491 on some systems. To do so, Configure can be run with -Duse64bitint.
4492 Choosing this option will most probably introduce binary incompatibilities.
4494 If this doesn't make any sense to you, just accept the default '$dflt'.
4496 rp='Try to use 64-bit integers, if available?'
4499 [yY]*) val="$define" ;;
4507 case "$use64bitall" in
4508 "$define"|true|[yY]*) dflt='y' ;;
4509 *) case "$longsize" in
4517 You may also choose to try maximal 64-bitness. It means using as much
4518 64-bitness as possible on the platform. This in turn means even more
4519 binary incompatibilities. On the other hand, your platform may not
4520 have any more 64-bitness available than what you already have chosen.
4522 If this doesn't make any sense to you, just accept the default '$dflt'.
4524 rp='Try to use maximal 64-bit support, if available?'
4527 [yY]*) val="$define" ;;
4532 case "$use64bitall" in
4534 case "$use64bitint" in
4538 Since you have chosen a maximally 64-bit build, I'm also turning on
4539 the use of 64-bit integers.
4541 use64bitint="$define" ;;
4546 case "$use64bitint" in
4547 "$define"|true|[yY]*)
4548 : Look for a hint-file generated 'call-back-unit'. If the
4549 : user has specified that a 64-bit perl is to be built,
4550 : we may need to set or change some other defaults.
4551 if $test -f use64bitint.cbu; then
4552 echo "Your platform has some specific hints for 64-bit integers, using them..."
4556 4) case "$archname64" in
4557 '') archname64=64int ;;
4564 case "$use64bitall" in
4565 "$define"|true|[yY]*)
4566 : Look for a hint-file generated 'call-back-unit'. If the
4567 : user has specified that a maximally 64-bit perl is to be built,
4568 : we may need to set or change some other defaults.
4569 if $test -f use64bitall.cbu; then
4570 echo "Your platform has some specific hints for 64-bit builds, using them..."
4574 4) case "$archname64" in
4575 ''|64int) archname64=64all ;;
4583 echo "Checking for GNU C Library..." >&4
4584 cat >gnulibc.c <<EOM
4596 if eval $compile_ok && ./gnulibc; then
4598 echo "You are using the GNU C Library"
4601 echo "You are not using the GNU C Library"
4607 : see if nm is to be used to determine whether a symbol is defined or not
4611 case "$d_gnulibc" in
4614 echo "nm probably won't work on the GNU C Library." >&4
4620 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
4622 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
4623 echo "'nm' won't be sufficient on this sytem." >&4
4629 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
4630 if $test $dflt -gt 20; then
4640 true|$define) dflt=y;;
4647 I can use $nm to extract the symbols from your C libraries. This
4648 is a time consuming task which may generate huge output on the disk (up
4649 to 3 megabytes) but that should make the symbols extraction faster. The
4650 alternative is to skip the 'nm' extraction part and to compile a small
4651 test program instead to determine whether each symbol is present. If
4652 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
4653 this may be the best solution.
4655 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
4658 rp="Shall I use $nm to extract C symbols from the libraries?"
4661 [Nn]*) usenm=false;;
4670 : nm options which may be necessary
4672 '') if $test -f /mach_boot; then
4674 elif $test -d /usr/ccs/lib; then
4675 nm_opt='-p' # Solaris (and SunOS?)
4676 elif $test -f /dgux; then
4678 elif $test -f /lib64/rld; then
4679 nm_opt='-p' # 64-bit Irix
4685 : nm options which may be necessary for shared libraries but illegal
4686 : for archive libraries. Thank you, Linux.
4687 case "$nm_so_opt" in
4688 '') case "$myuname" in
4690 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
4691 nm_so_opt='--dynamic'
4700 : get list of predefined functions in a handy place
4705 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
4712 *) for thislib in $libs; do
4715 : Handle C library specially below.
4718 thislib=`echo $thislib | $sed -e 's/^-l//'`
4719 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
4721 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
4723 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
4725 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
4727 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
4729 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
4731 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
4736 libnames="$libnames $try"
4738 *) libnames="$libnames $thislib" ;;
4747 for xxx in $libpth; do
4748 $test -r $1 || set $xxx/libc.$so
4749 : The messy sed command sorts on library version numbers.
4751 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
4752 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
4754 s/[0-9][0-9]*/0000&/g
4755 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
4758 $sort | $sed -e 's/^.* //'`
4761 $test -r $1 || set /usr/ccs/lib/libc.$so
4762 $test -r $1 || set /lib/libsys_s$_a
4768 if $test -r "$1"; then
4769 echo "Your (shared) C library seems to be in $1."
4771 elif $test -r /lib/libc && $test -r /lib/clib; then
4772 echo "Your C library seems to be in both /lib/clib and /lib/libc."
4774 libc='/lib/clib /lib/libc'
4775 if $test -r /lib/syslib; then
4776 echo "(Your math library is in /lib/syslib.)"
4777 libc="$libc /lib/syslib"
4779 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
4780 echo "Your C library seems to be in $libc, as you said before."
4781 elif $test -r $incpath/usr/lib/libc$_a; then
4782 libc=$incpath/usr/lib/libc$_a;
4783 echo "Your C library seems to be in $libc. That's fine."
4784 elif $test -r /lib/libc$_a; then
4786 echo "Your C library seems to be in $libc. You're normal."
4788 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
4790 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
4791 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
4792 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
4794 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
4796 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
4799 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
4801 if $test -r "$tans"; then
4802 echo "Your C library seems to be in $tans, of all places."
4808 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
4812 If the guess above is wrong (which it might be if you're using a strange
4813 compiler, or your machine supports multiple models), you can override it here.
4818 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
4820 I can't seem to find your C library. I've looked in the following places:
4823 $sed 's/^/ /' libpath
4826 None of these seems to contain your C library. I need to get its name...
4831 rp='Where is your C library?'
4836 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
4837 set X `cat libnames`
4840 case $# in 1) xxx=file; esac
4841 echo "Extracting names from the following $xxx for later perusal:" >&4
4843 $sed 's/^/ /' libnames >&4
4845 $echo $n "This may take a while...$c" >&4
4849 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
4850 *) $nm $nm_opt $file 2>/dev/null;;
4855 $grep fprintf libc.tmp > libc.ptf
4856 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
4857 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
4859 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
4861 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4863 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
4865 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4867 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
4869 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4871 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
4873 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4875 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
4877 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4879 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
4881 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4883 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
4884 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
4886 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4888 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
4890 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4892 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
4894 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4896 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
4898 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4900 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
4902 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4904 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
4906 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4908 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
4910 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4912 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
4914 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4917 $nm -p $* 2>/dev/null >libc.tmp
4918 $grep fprintf libc.tmp > libc.ptf
4919 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
4920 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
4926 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
4928 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
4929 for thisname in $libnames $libc; do
4930 $ar t $thisname >>libc.tmp
4932 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
4934 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
4935 # Repeat libc to extract forwarders to DLL entries too
4936 for thisname in $libnames $libc; do
4937 $ar tv $thisname >>libc.tmp
4938 # Revision 50 of EMX has bug in $ar.
4939 # it will not extract forwarders to DLL entries
4940 # Use emximp which will extract exactly them.
4941 emximp -o tmp.imp $thisname \
4943 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
4944 < tmp.imp >>libc.tmp
4947 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
4950 echo "$ar didn't seem to work right." >&4
4951 echo "Maybe this is a Cray...trying bld instead..." >&4
4952 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
4954 for thisname in $libnames; do
4956 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
4957 $ar t $thisname >>libc.tmp
4961 echo "That didn't work either. Giving up." >&4
4968 if $test -f /lib/syscalls.exp; then
4970 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
4971 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*$/\1/p' /lib/syscalls.exp >>libc.list
4975 $rm -f libnames libpath
4977 : is a C symbol defined?
4980 -v) tf=libc.tmp; tc=""; tdc="";;
4981 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
4982 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
4985 case "$reuseval-$4" in
4987 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
4993 if $contains $tlook $tf >/dev/null 2>&1;
4998 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
4999 if $cc -o t $optimize $ccflags $ldflags t.c $libs >/dev/null 2>&1;
5007 $define) tval=true;;
5013 : define an is-in-libc? function
5014 inlibc='echo " "; td=$define; tu=$undef;
5015 sym=$1; var=$2; eval "was=\$$2";
5017 case "$reuseval$was" in
5027 echo "$sym() found." >&4;
5028 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
5030 echo "$sym() NOT found." >&4;
5031 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
5035 $define) echo "$sym() found." >&4;;
5036 *) echo "$sym() NOT found." >&4;;
5040 : see if sqrtl exists
5045 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
5048 case "$uselongdouble" in
5049 $define|true|[yY]*) dflt='y';;
5054 Perl can be built to take advantage of long doubles which
5055 (if available) may give more accuracy and range for floating point numbers.
5057 If this doesn't make any sense to you, just accept the default '$dflt'.
5059 rp='Try to use long doubles if available?'
5062 y|Y) val="$define" ;;
5068 case "$uselongdouble" in
5069 true|[yY]*) uselongdouble="$define" ;;
5072 case "$uselongdouble" in
5074 : Look for a hint-file generated 'call-back-unit'. If the
5075 : user has specified that long doubles should be used,
5076 : we may need to set or change some other defaults.
5077 if $test -f uselongdouble.cbu; then
5078 echo "Your platform has some specific hints for long doubles, using them..."
5079 . ./uselongdouble.cbu
5082 (Your platform doesn't have any specific hints for long doubles.)
5088 case "$uselongdouble:$d_sqrtl" in
5092 *** You requested the use of long doubles but you do not seem to have
5093 *** the mathematic functions for long doubles. I'm disabling the use
5094 *** of long doubles.
5097 uselongdouble=$undef
5101 : check for length of double
5103 case "$doublesize" in
5105 echo "Checking to see how big your double precision numbers are..." >&4
5106 $cat >try.c <<'EOCP'
5110 printf("%d\n", (int)sizeof(double));
5115 if eval $compile_ok; then
5117 echo "Your double is $doublesize bytes long."
5120 echo "(I can't seem to compile the test program. Guessing...)"
5121 rp="What is the size of a double precision number (in bytes)?"
5129 : check for long doubles
5131 echo "Checking to see if you have long double..." >&4
5132 echo 'int main() { long double x = 7.0; }' > try.c
5134 if eval $compile; then
5136 echo "You have long double."
5139 echo "You do not have long double."
5145 : check for length of long double
5146 case "${d_longdbl}${longdblsize}" in
5149 echo "Checking to see how big your long doubles are..." >&4
5150 $cat >try.c <<'EOCP'
5154 printf("%d\n", sizeof(long double));
5159 if eval $compile; then
5160 longdblsize=`./try$exe_ext`
5161 echo "Your long doubles are $longdblsize bytes long."
5165 echo "(I can't seem to compile the test program. Guessing...)" >&4
5166 rp="What is the size of a long double (in bytes)?"
5170 if $test "X$doublesize" = "X$longdblsize"; then
5171 echo "(That isn't any different from an ordinary double.)"
5177 : determine the architecture name
5179 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5180 tarch=`arch`"-$osname"
5181 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5182 if uname -m > tmparch 2>&1 ; then
5183 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5184 -e 's/$/'"-$osname/" tmparch`
5192 case "$myarchname" in
5195 echo "(Your architecture name used to be $myarchname.)"
5202 *) dflt="$archname";;
5204 rp='What is your architecture name'
5207 case "$usethreads" in
5209 echo "Threads selected." >&4
5211 *-thread*) echo "...and architecture name already has -thread." >&4
5213 *) archname="$archname-thread"
5214 echo "...setting architecture name to $archname." >&4
5219 case "$usemultiplicity" in
5221 echo "Multiplicity selected." >&4
5223 *-multi*) echo "...and architecture name already has -multi." >&4
5225 *) archname="$archname-multi"
5226 echo "...setting architecture name to $archname." >&4
5231 case "$use64bitint$use64bitall" in
5233 case "$archname64" in
5235 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
5238 case "$use64bitint" in
5239 "$define") echo "64 bit integers selected." >&4 ;;
5241 case "$use64bitall" in
5242 "$define") echo "Maximal 64 bitness selected." >&4 ;;
5245 *-$archname64*) echo "...and architecture name already has $archname64." >&4
5247 *) archname="$archname-$archname64"
5248 echo "...setting architecture name to $archname." >&4
5254 case "$uselongdouble" in
5256 echo "Long doubles selected." >&4
5257 case "$longdblsize" in
5259 "...but long doubles are equal to doubles, not changing architecture name." >&4
5263 *-ld*) echo "...and architecture name already has -ld." >&4
5265 *) archname="$archname-ld"
5266 echo "...setting architecture name to $archname." >&4
5274 : determine root of directory hierarchy where package will be installed.
5277 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
5285 By default, $package will be installed in $dflt/bin, manual pages
5286 under $dflt/man, etc..., i.e. with $dflt as prefix for all
5287 installation directories. Typically this is something like /usr/local.
5288 If you wish to have binaries under /usr/bin but other parts of the
5289 installation under /usr/local, that's ok: you will be prompted
5290 separately for each of the installation directories, the prefix being
5291 only used to set the defaults.
5295 rp='Installation prefix to use?'
5303 *) oldprefix="$prefix";;
5313 $define|true) afs=true ;;
5314 $undef|false) afs=false ;;
5315 *) if test -d /afs; then
5323 echo "AFS may be running... I'll be extra cautious then..." >&4
5325 echo "AFS does not seem to be running..." >&4
5328 : determine installation prefix for where package is to be installed.
5332 Since you are running AFS, I need to distinguish the directory in which
5333 files will reside from the directory in which they are installed (and from
5334 which they are presumably copied to the former directory by occult means).
5337 case "$installprefix" in
5338 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
5339 *) dflt="$installprefix";;
5344 In some special cases, particularly when building $package for distribution,
5345 it is convenient to distinguish between the directory in which files should
5346 be installed from the directory ($prefix) in which they
5347 will eventually reside. For most users, these two directories are the same.
5350 case "$installprefix" in
5352 *) dflt=$installprefix;;
5356 rp='What installation prefix should I use for installing files?'
5358 installprefix="$ans"
5359 installprefixexp="$ansexp"
5361 : set the prefixit variable, to compute a suitable default value
5362 prefixit='case "$3" in
5364 case "$oldprefix" in
5365 "") eval "$1=\"\$$2\"";;
5372 ""|" ") eval "$1=\"\$$2\"";;
5378 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
5380 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
5381 /*-$oldprefix/*|\~*-$oldprefix/*)
5382 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
5383 *) eval "$1=\"\$$2\"";;
5388 : get the patchlevel
5390 echo "Getting the current patchlevel..." >&4
5391 if $test -r $rsrc/patchlevel.h;then
5392 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
5393 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
5394 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5395 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
5396 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
5397 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5406 $echo "(You have $package version $patchlevel subversion $subversion.)"
5409 : XXX Should be a Configure test for double-dots in filenames.
5410 version=`echo $revision $patchlevel $subversion | \
5411 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
5412 api_versionstring=`echo $api_revision $api_version $api_subversion | \
5413 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
5416 version=`echo $revision $patchlevel $subversion | \
5417 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
5418 api_versionstring=`echo $api_revision $api_version $api_subversion | \
5419 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
5422 : Special case the 5.005_xx maintenance series, which used 5.005
5423 : without any subversion label as a subdirectory in $sitelib
5424 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
5425 api_versionstring='5.005'
5428 : determine installation style
5429 : For now, try to deduce it from prefix unless it is already set.
5430 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
5431 case "$installstyle" in
5432 '') case "$prefix" in
5433 *perl*) dflt='lib';;
5434 *) dflt='lib/perl5' ;;
5437 *) dflt="$installstyle" ;;
5439 : Probably not worth prompting for this since we prompt for all
5440 : the directories individually, and the prompt would be too long and
5444 : determine where private library files go
5445 : Usual default is /usr/local/lib/perl5/$version.
5446 : Also allow things like /opt/perl/lib/$version, since
5447 : /opt/perl/lib/perl5... would be redundant.
5448 : The default "style" setting is made in installstyle.U
5449 case "$installstyle" in
5450 *lib/perl5*) set dflt privlib lib/$package/$version ;;
5451 *) set dflt privlib lib/$version ;;
5456 There are some auxiliary files for $package that need to be put into a
5457 private library directory that is accessible by everyone.
5461 rp='Pathname where the private library files will reside?'
5464 privlibexp="$ansexp"
5465 : Change installation prefix, if necessary.
5466 if $test X"$prefix" != X"$installprefix"; then
5467 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
5469 installprivlib="$privlibexp"
5472 : set the prefixup variable, to restore leading tilda escape
5473 prefixup='case "$prefixexp" in
5475 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
5478 : determine where public architecture dependent libraries go
5481 : privlib default is /usr/local/lib/$package/$version
5482 : archlib default is /usr/local/lib/$package/$version/$archname
5483 : privlib may have an optional trailing /share.
5484 tdflt=`echo $privlib | $sed 's,/share$,,'`
5485 tdflt=$tdflt/$archname
5494 $spackage contains architecture-dependent library files. If you are
5495 sharing libraries in a heterogeneous environment, you might store
5496 these files in a separate location. Otherwise, you can just include
5497 them with the rest of the public library files.
5501 rp='Where do you want to put the public architecture-dependent libraries?'
5504 archlibexp="$ansexp"
5505 if $test X"$archlib" = X"$privlib"; then
5510 : Change installation prefix, if necessary.
5511 if $test X"$prefix" != X"$installprefix"; then
5512 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
5514 installarchlib="$archlibexp"
5518 : Binary compatibility with 5.005 is not possible for builds
5519 : with advanced features
5520 case "$usethreads$usemultiplicity" in
5522 bincompat5005="$undef"
5523 d_bincompat5005="$undef"
5527 This version of Perl can be compiled for binary compatibility with 5.005.
5528 If you decide to do so, you will be able to continue using most of the
5529 extensions that were compiled for Perl 5.005.
5532 case "$bincompat5005$d_bincompat5005" in
5533 *"$undef"*) dflt=n ;;
5536 rp='Binary compatibility with Perl 5.005?'
5539 y*) val="$define" ;;
5544 case "$d_bincompat5005" in
5546 bincompat5005="$define"
5548 *) bincompat5005="$undef"
5549 d_bincompat5005="$undef"
5556 : see if setuid scripts can be secure
5559 Some kernels have a bug that prevents setuid #! scripts from being
5560 secure. Some sites have disabled setuid #! scripts because of this.
5562 First let's decide if your kernel supports secure setuid #! scripts.
5563 (If setuid #! scripts would be secure but have been disabled anyway,
5564 don't say that they are secure if asked.)
5569 if $test -d /dev/fd; then
5570 echo "#!$ls" >reflect
5571 chmod +x,u+s reflect
5572 ./reflect >flect 2>&1
5573 if $contains "/dev/fd" flect >/dev/null; then
5574 echo "Congratulations, your kernel has secure setuid scripts!" >&4
5578 If you are not sure if they are secure, I can check but I'll need a
5579 username and password different from the one you are using right now.
5580 If you don't have such a username or don't want me to test, simply
5584 rp='Other username to test security of setuid scripts with?'
5589 case "$d_suidsafe" in
5590 '') echo "I'll assume setuid scripts are *not* secure." >&4
5593 echo "Well, the $hint value is *not* secure." >&4
5595 *) echo "Well, the $hint value *is* secure." >&4
5600 $rm -f reflect flect
5601 echo "#!$ls" >reflect
5602 chmod +x,u+s reflect
5605 echo '"su" will (probably) prompt you for '"$ans's password."
5606 su $ans -c './reflect >flect'
5607 if $contains "/dev/fd" flect >/dev/null; then
5608 echo "Okay, it looks like setuid scripts are secure." >&4
5611 echo "I don't think setuid scripts are secure." >&4
5616 rp='Does your kernel have *secure* setuid scripts?'
5619 [yY]*) val="$define";;
5624 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
5625 echo "(That's for file descriptors, not floppy disks.)"
5631 $rm -f reflect flect
5633 : now see if they want to do setuid emulation
5636 case "$d_suidsafe" in
5639 echo "No need to emulate SUID scripts since they are secure here." >& 4
5643 Some systems have disabled setuid scripts, especially systems where
5644 setuid scripts cannot be secure. On systems where setuid scripts have
5645 been disabled, the setuid/setgid bits on scripts are currently
5646 useless. It is possible for $package to detect those bits and emulate
5647 setuid/setgid in a secure fashion. This emulation will only work if
5648 setuid scripts have been disabled in your kernel.
5652 "$define") dflt=y ;;
5655 rp="Do you want to do setuid/setgid emulation?"
5658 [yY]*) val="$define";;
5666 : determine filename position in cpp output
5668 echo "Computing filename position in cpp output for #include directives..." >&4
5669 echo '#include <stdio.h>' > foo.c
5672 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5673 $grep '^[ ]*#.*stdio\.h' | \
5674 while read cline; do
5677 while $test \$# -gt 0; do
5678 if $test -r \`echo \$1 | $tr -d '"'\`; then
5683 pos=\`expr \$pos + 1\`
5695 *) pos="${fieldn}th";;
5697 echo "Your cpp writes the filename in the $pos field of the line."
5699 : locate header file
5704 for usrincdir in $usrinc
5706 if test -f \$usrincdir/\$wanted; then
5707 echo "\$usrincdir/\$wanted"
5711 awkprg='{ print \$$fieldn }'
5712 echo "#include <\$wanted>" > foo\$\$.c
5713 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5714 $grep "^[ ]*#.*\$wanted" | \
5715 while read cline; do
5716 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5718 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5719 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5724 # status = 0: grep returned 0 lines, case statement not executed
5725 # status = 1: headerfile found
5726 # status = 2: while loop executed, no headerfile found
5730 if test \$status -eq 1; then
5737 : define an alternate in-header-list? function
5738 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5739 cont=true; xxf="echo \"<\$1> found.\" >&4";
5740 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5741 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5743 case $# in 4) instead=instead;; *) instead="at last";; esac;
5744 while $test "$cont"; do
5746 var=$2; eval "was=\$$2";
5747 if $test "$xxx" && $test -r "$xxx";
5749 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5752 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5753 set $yyy; shift; shift; yyy=$@;
5754 case $# in 0) cont="";;
5755 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5756 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5757 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5758 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5762 do set $yyy; var=$2; eval "was=\$$2";
5763 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5764 set $yyy; shift; shift; yyy=$@;
5767 : see if this is a malloc.h system
5768 set malloc.h i_malloc
5771 : see if stdlib is available
5772 set stdlib.h i_stdlib
5775 : determine which malloc to compile in
5777 case "$usemymalloc" in
5778 ''|[yY]*|true|$define) dflt='y' ;;
5781 rp="Do you wish to attempt to use the malloc that comes with $package?"
5787 mallocsrc='malloc.c'
5788 mallocobj="malloc$_o"
5789 d_mymalloc="$define"
5792 : Remove malloc from list of libraries to use
5793 echo "Removing unneeded -lmalloc from library list" >&4
5794 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
5797 echo "libs = $libs" >&4
5809 : compute the return types of malloc and free
5811 $cat >malloc.c <<END
5815 #include <sys/types.h>
5829 case "$malloctype" in
5831 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
5838 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
5842 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
5849 echo "Your system uses $freetype free(), it would seem." >&4
5853 After $package is installed, you may wish to install various
5854 add-on modules and utilities. Typically, these add-ons will
5855 be installed under $prefix with the rest
5856 of this package. However, you may wish to install such add-ons
5857 elsewhere under a different prefix.
5859 If you do not wish to put everything under a single prefix, that's
5860 ok. You will be prompted for the individual locations; this siteprefix
5861 is only used to suggest the defaults.
5863 The default should be fine for most people.
5867 rp='Installation prefix to use for add-on modules and utilities?'
5868 : XXX Here might be another good place for an installstyle setting.
5869 case "$siteprefix" in
5871 *) dflt=$siteprefix ;;
5874 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
5876 case "$siteprefix" in
5880 *) oldsiteprefix="$prefix";;
5885 siteprefixexp="$ansexp"
5887 : determine where site specific libraries go.
5888 : Usual default is /usr/local/lib/perl5/site_perl/$version
5889 : The default "style" setting is made in installstyle.U
5890 : XXX No longer works with Prefixit stuff.
5891 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5893 '') case "$installstyle" in
5894 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
5895 *) dflt=$siteprefix/lib/site_$prog/$version ;;
5903 The installation process will create a directory for
5904 site-specific extensions and modules. Most users find it convenient
5905 to place all site-specific files in this directory rather than in the
5906 main distribution directory.
5910 rp='Pathname for the site-specific library files?'
5913 sitelibexp="$ansexp"
5914 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
5915 : Change installation prefix, if necessary.
5916 if $test X"$prefix" != X"$installprefix"; then
5917 installsitelib=`echo $sitelibexp | $sed "s#^$prefix#$installprefix#"`
5919 installsitelib="$sitelibexp"
5922 : determine where site specific architecture-dependent libraries go.
5923 : sitelib default is /usr/local/lib/perl5/site_perl/$version
5924 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
5925 : sitelib may have an optional trailing /share.
5927 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
5928 dflt="$dflt/$archname"
5933 set sitearch sitearch none
5937 The installation process will also create a directory for
5938 architecture-dependent site-specific extensions and modules.
5942 rp='Pathname for the site-specific architecture-dependent library files?'
5945 sitearchexp="$ansexp"
5946 : Change installation prefix, if necessary.
5947 if $test X"$prefix" != X"$installprefix"; then
5948 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
5950 installsitearch="$sitearchexp"
5955 The installation process will also create a directory for
5956 vendor-supplied add-ons. Vendors who supply perl with their system
5957 may find it convenient to place all vendor-supplied files in this
5958 directory rather than in the main distribution directory. This will
5959 ease upgrades between binary-compatible maintenance versions of perl.
5961 Of course you may also use these directories in whatever way you see
5962 fit. For example, you might use them to access modules shared over a
5963 company-wide network.
5965 The default answer should be fine for most people.
5966 This causes further questions about vendor add-ons to be skipped
5967 and no vendor-specific directories will be configured for perl.
5970 rp='Do you want to configure vendor-specific add-on directories?'
5971 case "$usevendorprefix" in
5972 define|true|[yY]*) dflt=y ;;
5973 *) : User may have set vendorprefix directly on Configure command line.
5974 case "$vendorprefix" in
5983 rp='Installation prefix to use for vendor-supplied add-ons?'
5984 case "$vendorprefix" in
5986 *) dflt=$vendorprefix ;;
5989 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
5991 case "$vendorprefix" in
5995 *) oldvendorprefix="$prefix";;
5999 usevendorprefix="$define"
6001 vendorprefixexp="$ansexp"
6003 *) usevendorprefix="$undef"
6009 case "$vendorprefix" in
6010 '') d_vendorlib="$undef"
6014 *) d_vendorlib="$define"
6015 : determine where vendor-supplied modules go.
6016 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6017 case "$vendorlib" in
6019 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6020 case "$installstyle" in
6021 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6022 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6025 *) dflt="$vendorlib"
6029 rp='Pathname for the vendor-supplied library files?'
6032 vendorlibexp="$ansexp"
6035 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6036 : Change installation prefix, if necessary.
6037 if $test X"$prefix" != X"$installprefix"; then
6038 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
6040 installvendorlib="$vendorlibexp"
6043 case "$vendorprefix" in
6044 '') d_vendorarch="$undef"
6048 *) d_vendorarch="$define"
6049 : determine where vendor-supplied architecture-dependent libraries go.
6050 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6051 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6052 : vendorlib may have an optional trailing /share.
6053 case "$vendorarch" in
6054 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6055 dflt="$dflt/$archname"
6057 *) dflt="$vendorarch" ;;
6060 rp='Pathname for vendor-supplied architecture-dependent files?'
6063 vendorarchexp="$ansexp"
6066 : Change installation prefix, if necessary.
6067 if $test X"$prefix" != X"$installprefix"; then
6068 installvendorarch=`echo $vendorarchexp | sed "s#^$prefix#$installprefix#"`
6070 installvendorarch="$vendorarchexp"
6073 : Final catch-all directories to search
6076 Lastly, you can have perl look in other directories for extensions and
6077 modules in addition to those already specified.
6078 These directories will be searched after
6082 test X"$vendorlib" != "X" && echo ' ' $vendorlib
6083 test X"$vendorarch" != "X" && echo ' ' $vendorarch
6085 case "$otherlibdirs" in
6086 ''|' ') dflt='none' ;;
6087 *) dflt="$otherlibdirs" ;;
6090 Enter a colon-separated set of extra paths to include in perl's @INC
6091 search path, or enter 'none' for no extra paths.
6095 rp='Colon-separated list of additional directories for perl to search?'
6098 ' '|''|none) otherlibdirs=' ' ;;
6099 *) otherlibdirs="$ans" ;;
6101 case "$otherlibdirs" in
6105 set d_perl_otherlibdirs
6108 : Cruising for prototypes
6110 echo "Checking out function prototypes..." >&4
6111 $cat >prototype.c <<'EOCP'
6112 int main(int argc, char *argv[]) {
6115 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
6116 echo "Your C compiler appears to support function prototypes."
6119 echo "Your C compiler doesn't seem to understand function prototypes."
6126 case "$prototype" in
6128 *) ansi2knr='ansi2knr'
6133 This version of $package can only be compiled by a compiler that
6134 understands function prototypes. Unfortunately, your C compiler
6136 doesn't seem to understand them. Sorry about that.
6138 If GNU cc is available for your system, perhaps you could try that instead.
6140 Eventually, we hope to support building Perl with pre-ANSI compilers.
6141 If you would like to help in that effort, please contact <perlbug@perl.org>.
6143 Aborting Configure now.
6149 : determine where public executables go
6154 rp='Pathname where the public executables will reside?'
6156 if $test "X$ansexp" != "X$binexp"; then
6161 : Change installation prefix, if necessary.
6162 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6163 if $test X"$prefix" != X"$installprefix"; then
6164 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
6166 installbin="$binexp"
6169 : Find perl5.005 or later.
6170 echo "Looking for a previously installed perl5.005 or later... "
6172 '') for tdir in `echo "$binexp:$PATH" | $sed "s/$path_sep/ /g"`; do
6173 : Check if this perl is recent and can load a simple module
6174 if $test -x $tdir/perl && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6177 elif $test -x $tdir/perl5 && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6187 '') echo "None found. That's ok.";;
6188 *) echo "Using $perl5." ;;
6191 : Determine list of previous versions to include in @INC
6192 $cat > getverlist <<EOPL
6195 \$api_versionstring = "$api_versionstring";
6196 \$version = "$version";
6197 \$stem = "$sitelib_stem";
6198 \$archname = "$archname";
6200 $cat >> getverlist <<'EOPL'
6201 # Can't have leading @ because metaconfig interprets it as a command!
6202 ;@inc_version_list=();
6203 # XXX Redo to do opendir/readdir?
6206 ;@candidates = glob("5.*");
6212 # XXX ToDo: These comparisons must be reworked when two-digit
6213 # subversions come along, so that 5.7.10 compares as greater than
6214 # 5.7.3! By that time, hope that 5.6.x is sufficiently
6215 # widespread that we can use the built-in version vectors rather
6216 # than reinventing them here. For 5.6.0, however, we must
6217 # assume this script will likely be run by 5.005_0x. --AD 1/2000.
6218 foreach $d (@candidates) {
6219 if ($d lt $version) {
6220 if ($d ge $api_versionstring) {
6221 unshift(@inc_version_list, grep { -d } "$d/$archname", $d);
6223 elsif ($d ge "5.005") {
6224 unshift(@inc_version_list, grep { -d } $d);
6228 # Skip newer version. I.e. don't look in
6229 # 5.7.0 if we're installing 5.6.1.
6233 if (@inc_version_list) {
6234 print join(' ', @inc_version_list);
6237 # Blank space to preserve value for next Configure run.
6242 case "$inc_version_list" in
6243 '') if test -x "$perl5"; then
6244 dflt=`$perl5 getverlist`
6249 $undef) dflt='none' ;;
6250 *) dflt="$inc_version_list" ;;
6253 ''|' ') dflt=none ;;
6256 5.005) case "$bincompat5005" in
6257 $define|true|[yY]*) ;;
6264 In order to ease the process of upgrading, this version of perl
6265 can be configured to use modules built and installed with earlier
6266 versions of perl that were installed under $prefix. Specify here
6267 the list of earlier versions that this version of perl should check.
6268 If Configure detected no earlier versions of perl installed under
6269 $prefix, then the list will be empty. Answer 'none' to tell perl
6270 to not search earlier versions.
6272 The default should almost always be sensible, so if you're not sure,
6273 just accept the default.
6276 rp='List of earlier versions to include in @INC?'
6279 [Nn]one|''|' ') inc_version_list=' ' ;;
6280 *) inc_version_list="$ans" ;;
6282 case "$inc_version_list" in
6284 inc_version_list_init='0';;
6285 *) inc_version_list_init=`echo $inc_version_list |
6286 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6291 : determine whether to install perl also as /usr/bin/perl
6294 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
6296 Many scripts expect perl to be installed as /usr/bin/perl.
6297 I can install the perl you are about to compile also as /usr/bin/perl
6298 (in addition to $installbin/perl).
6300 case "$installusrbinperl" in
6301 "$undef"|[nN]*) dflt='n';;
6304 rp="Do you want to install perl as /usr/bin/perl?"
6307 [yY]*) val="$define";;
6313 set installusrbinperl
6316 : see if dld is available
6320 : see if dlopen exists
6327 : determine which dynamic loading, if any, to compile in
6329 dldir="ext/DynaLoader"
6342 $define) dflt='y' ;;
6345 $define) dflt='y' ;;
6347 : Does a dl_xxx.xs file exist for this operating system
6348 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
6351 rp="Do you wish to use dynamic loading?"
6358 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
6359 dflt="$dldir/dl_${osname}.xs"
6360 elif $test "$d_dlopen" = "$define" ; then
6361 dflt="$dldir/dl_dlopen.xs"
6362 elif $test "$i_dld" = "$define" ; then
6363 dflt="$dldir/dl_dld.xs"
6368 *) dflt="$dldir/$dlsrc"
6371 echo "The following dynamic loading files are available:"
6372 : Can not go over to $dldir because getfile has path hard-coded in.
6373 tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir
6374 rp="Source file to use for dynamic loading"
6380 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
6384 Some systems may require passing special flags to $cc -c to
6385 compile modules that will be used to create a shared library.
6386 To use no flags, say "none".
6389 case "$cccdlflags" in
6390 '') case "$gccversion" in
6391 '') case "$osname" in
6393 next) dflt='none' ;;
6394 irix*) dflt='-KPIC' ;;
6395 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
6396 sunos) dflt='-pic' ;;
6400 *) case "$osname" in
6401 svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
6406 *) dflt="$cccdlflags" ;;
6408 rp="Any special flags to pass to $cc -c to compile shared library modules?"
6411 none) cccdlflags=' ' ;;
6412 *) cccdlflags="$ans" ;;
6417 Some systems use ld to create libraries that can be dynamically loaded,
6418 while other systems (such as those using ELF) use $cc.
6422 '') $cat >try.c <<'EOM'
6423 /* Test for whether ELF binaries are produced */
6428 int i = open("a.out",O_RDONLY);
6431 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
6432 exit(0); /* succeed (yes, it's ELF) */
6437 if $cc $ccflags try.c >/dev/null 2>&1 && ./a.out; then
6439 You appear to have ELF support. I'll use $cc to build dynamic libraries.
6443 echo "I'll use ld to build dynamic libraries."
6452 rp="What command should be used to create dynamic libraries?"
6458 Some systems may require passing special flags to $ld to create a
6459 library that can be dynamically loaded. If your ld flags include
6460 -L/other/path options to locate libraries outside your loader's normal
6461 search path, you may need to specify those -L options here as well. To
6462 use no flags, say "none".
6465 case "$lddlflags" in
6466 '') case "$osname" in
6467 beos) dflt='-nostart' ;;
6469 case "$gccversion" in
6470 '') dflt="$dflt +vnocompatwarnings" ;;
6473 linux|irix*) dflt='-shared' ;;
6474 next) dflt='none' ;;
6475 solaris) dflt='-G' ;;
6476 sunos) dflt='-assert nodefinitions' ;;
6477 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
6481 *) dflt="$lddlflags" ;;
6484 : Try to guess additional flags to pick up local libraries.
6485 : Be careful not to append to a plain 'none'
6489 for thisflag in $ldflags; do
6494 *) dflt="$dflt $thisflag" ;;
6501 ''|' ') dflt='none' ;;
6504 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
6507 none) lddlflags=' ' ;;
6508 *) lddlflags="$ans" ;;
6513 Some systems may require passing special flags to $cc to indicate that
6514 the resulting executable will use dynamic linking. To use no flags,
6518 case "$ccdlflags" in
6519 '') case "$osname" in
6520 hpux) dflt='-Wl,-E' ;;
6521 linux) dflt='-rdynamic' ;;
6522 next) dflt='none' ;;
6523 sunos) dflt='none' ;;
6527 *) dflt="$ccdlflags" ;;
6529 rp="Any special flags to pass to $cc to use dynamic linking?"
6532 none) ccdlflags=' ' ;;
6533 *) ccdlflags="$ans" ;;
6547 # No dynamic loading being used, so don't bother even to prompt.
6550 *) case "$useshrplib" in
6551 '') case "$osname" in
6552 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
6554 also='Building a shared libperl is required for dynamic loading to work on your system.'
6559 also='Building a shared libperl is needed for MAB support.'
6577 The perl executable is normally obtained by linking perlmain.c with
6578 libperl${_a}, any static extensions (usually just DynaLoader), and
6579 any other libraries needed on this system (such as -lm, etc.). Since
6580 your system supports dynamic loading, it is probably possible to build
6581 a shared libperl.$so. If you will have more than one executable linked
6582 to libperl.$so, this will significantly reduce the size of each
6583 executable, but it may have a noticeable affect on performance. The
6584 default is probably sensible for your system.
6588 rp="Build a shared libperl.$so (y/n)"
6592 useshrplib='true' ;;
6593 *) useshrplib='false' ;;
6598 case "$useshrplib" in
6602 # Figure out a good name for libperl.so. Since it gets stored in
6603 # a version-specific architecture-dependent library, the version
6604 # number isn't really that important, except for making cc/ld happy.
6606 # A name such as libperl.so.3.1
6607 majmin="libperl.$so.$patchlevel.$subversion"
6608 # A name such as libperl.so.301
6609 majonly=`echo $patchlevel $subversion |
6610 $awk '{printf "%d%02d", $1, $2}'`
6611 majonly=libperl.$so.$majonly
6612 # I'd prefer to keep the os-specific stuff here to a minimum, and
6613 # rely on figuring it out from the naming of libc.
6614 case "${osname}${osvers}" in
6617 # XXX How handle the --version stuff for MAB?
6619 linux*) # ld won't link with a bare -lperl otherwise.
6622 cygwin*) # include version
6623 dflt=`echo libperl$version | sed -e 's/\./_/g'`$lib_ext
6625 *) # Try to guess based on whether libc has major.minor.
6627 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
6628 *libc.$so.[0-9]*) dflt=$majonly ;;
6629 *) dflt=libperl.$so ;;
6639 I need to select a good name for the shared libperl. If your system uses
6640 library names with major and minor numbers, then you might want something
6641 like $majmin. Alternatively, if your system uses a single version
6642 number for shared libraries, then you might want to use $majonly.
6643 Or, your system might be quite happy with a simple libperl.$so.
6645 Since the shared libperl will get installed into a version-specific
6646 architecture-dependent directory, the version number of the shared perl
6647 library probably isn't important, so the default should be o.k.
6650 rp='What name do you want to give to the shared libperl?'
6653 echo "Ok, I'll use $libperl"
6656 libperl="libperl${_a}"
6660 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
6664 WARNING: Use of the shrpdir variable for the installation location of
6665 the shared $libperl is not supported. It was never documented and
6666 will not work in this version. Let me (perlbug@perl.org)
6667 know of any problems this may cause.
6673 But your current setting of $shrpdir is
6674 the default anyway, so it's harmless.
6679 Further, your current attempted setting of $shrpdir
6680 conflicts with the value of $archlibexp/CORE
6681 that installperl will use.
6688 # How will the perl executable find the installed shared $libperl?
6689 # Add $xxx to ccdlflags.
6690 # If we can't figure out a command-line option, use $shrpenv to
6691 # set env LD_RUN_PATH. The main perl makefile uses this.
6692 shrpdir=$archlibexp/CORE
6695 if "$useshrplib"; then
6698 # We'll set it in Makefile.SH...
6704 xxx="-Wl,-R$shrpdir"
6706 linux|irix*|dec_osf)
6707 xxx="-Wl,-rpath,$shrpdir"
6710 # next doesn't like the default...
6713 # beos doesn't like the default, either.
6716 # hpux doesn't like the default, either.
6717 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
6720 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
6726 # Only add $xxx if it isn't already in ccdlflags.
6727 case " $ccdlflags " in
6729 *) ccdlflags="$ccdlflags $xxx"
6732 Adding $xxx to the flags
6733 passed to $ld so that the perl executable will find the
6734 installed shared $libperl.
6742 # Fix ccdlflags in AIX for building external extensions.
6743 # (For building Perl itself bare -bE:perl.exp is needed,
6744 # Makefile.SH takes care of this.)
6746 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
6748 # Respect a hint or command-line value.
6750 '') shrpenv="$tmp_shrpenv" ;;
6752 case "$ldlibpthname" in
6753 '') ldlibpthname=LD_LIBRARY_PATH ;;
6754 none) ldlibpthname='' ;;
6757 : determine where manual pages are on this system
6761 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
6762 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
6763 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
6764 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
6765 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
6766 sysman=`./loc . /usr/man/man1 $syspath`
6769 if $test -d "$sysman"; then
6770 echo "System manual is in $sysman." >&4
6772 echo "Could not find manual pages in source form." >&4
6775 : determine where manual pages go
6776 set man1dir man1dir none
6780 $spackage has manual pages available in source form.
6784 echo "However, you don't have nroff, so they're probably useless to you."
6786 '') man1dir="none";;
6789 echo "If you don't want the manual sources installed, answer 'none'."
6794 lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
6795 lookpath="$lookpath $prefixexp/man/p_man/man1"
6796 lookpath="$lookpath $prefixexp/man/u_man/man1"
6797 lookpath="$lookpath $prefixexp/man/man.1"
6799 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
6800 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
6810 rp="Where do the main $spackage manual pages (source) go?"
6812 if $test "X$man1direxp" != "X$ansexp"; then
6816 man1direxp="$ansexp"
6822 : Change installation prefix, if necessary.
6823 if $test X"$prefix" != X"$installprefix"; then
6824 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
6826 installman1dir="$man1direxp"
6829 : What suffix to use on installed man pages
6836 rp="What suffix should be used for the main $spackage man pages?"
6838 '') case "$man1dir" in
6852 *) dflt="$man1ext";;
6859 : see if we can have long filenames
6861 first=123456789abcdef
6863 if (echo hi >$first) 2>/dev/null; then
6864 if $test -f 123456789abcde; then
6865 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
6868 echo 'You can have filenames longer than 14 characters.'>&4
6873 You can't have filenames longer than 14 chars.
6874 You can't even think about them!
6880 $rm -rf 123456789abcde*
6882 : determine where library module manual pages go
6883 set man3dir man3dir none
6887 $spackage has manual pages for many of the library modules.
6893 However, you don't have nroff, so they're probably useless to you.
6896 '') man3dir="none";;
6900 case "$d_flexfnam" in
6903 However, your system can't handle the long file names like File::Basename.3.
6906 '') man3dir="none";;
6910 echo "If you don't want the manual sources installed, answer 'none'."
6911 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6913 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
6914 if $test -d "$privlib/man/man3"; then
6917 WARNING: Previous versions of perl installed man3 pages into
6918 $privlib/man/man3. This version will suggest a
6919 new default of $dflt.
6923 rp='Do you wish to preserve the old behavior?(y/n)'
6926 y*) dflt="$privlib/man/man3" ;;
6931 *) dflt="$man3dir" ;;
6938 rp="Where do the $package library man pages (source) go?"
6941 man3direxp="$ansexp"
6947 : Change installation prefix, if necessary.
6948 if $test X"$prefix" != X"$installprefix"; then
6949 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
6951 installman3dir="$man3direxp"
6954 : What suffix to use on installed man pages
6960 rp="What suffix should be used for the $package library man pages?"
6962 '') case "$man3dir" in
6976 *) dflt="$man3ext";;
6983 : see if we have to deal with yellow pages, now NIS.
6984 if $test -d /usr/etc/yp || $test -d /etc/yp; then
6985 if $test -f /usr/etc/nibindd; then
6987 echo "I'm fairly confident you're on a NeXT."
6989 rp='Do you get the hosts file via NetInfo?'
6998 y*) hostcat='nidump hosts .';;
6999 *) case "$hostcat" in
7000 nidump*) hostcat='';;
7010 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
7018 rp='Are you getting the hosts file via yellow pages?'
7021 y*) hostcat='ypcat hosts';;
7022 *) hostcat='cat /etc/hosts';;
7028 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
7031 '') test -f /etc/group && groupcat='cat /etc/group';;
7034 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
7037 : now get the host name
7039 echo "Figuring out host name..." >&4
7040 case "$myhostname" in
7042 echo 'Maybe "hostname" will work...'
7043 if tans=`sh -c hostname 2>&1` ; then
7051 if $test "$cont"; then
7053 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
7054 if tans=`cat /etc/systemid 2>&1` ; then
7056 phostname='cat /etc/systemid'
7057 echo "Whadyaknow. Xenix always was a bit strange..."
7060 elif $test -r /etc/systemid; then
7061 echo "(What is a non-Xenix system doing with /etc/systemid?)"
7064 if $test "$cont"; then
7065 echo 'No, maybe "uuname -l" will work...'
7066 if tans=`sh -c 'uuname -l' 2>&1` ; then
7068 phostname='uuname -l'
7070 echo 'Strange. Maybe "uname -n" will work...'
7071 if tans=`sh -c 'uname -n' 2>&1` ; then
7073 phostname='uname -n'
7075 echo 'Oh well, maybe I can mine it out of whoami.h...'
7076 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
7077 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
7078 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
7080 case "$myhostname" in
7081 '') echo "Does this machine have an identity crisis or something?"
7084 echo "Well, you said $myhostname before..."
7085 phostname='echo $myhostname';;
7091 : you do not want to know about this
7096 if $test "$myhostname" ; then
7098 rp='Your host name appears to be "'$myhostname'".'" Right?"
7106 : bad guess or no guess
7107 while $test "X$myhostname" = X ; do
7109 rp="Please type the (one word) name of your host:"
7114 : translate upper to lower if necessary
7115 case "$myhostname" in
7117 echo "(Normalizing case in your host name)"
7118 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
7122 case "$myhostname" in
7124 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
7125 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
7126 echo "(Trimming domain name from host name--host name is now $myhostname)"
7128 *) case "$mydomain" in
7131 test "X$hostcat" = "Xypcat hosts" &&
7132 ypmatch "$myhostname" hosts 2>/dev/null |\
7133 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
7136 test "X$hostcat" != "X" &&
7137 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
7138 /[ ]$myhostname[ . ]/p" > hosts
7141 if $test -f hosts; then
7142 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
7143 END { print sum }" hosts` = x1 || tmp_re="[ ]"
7144 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
7145 hosts | $sort | $uniq | \
7146 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
7147 case `$echo X$dflt` in
7148 X*\ *) echo "(Several hosts in the database matched hostname)"
7151 X.) echo "(You do not have fully-qualified names in the hosts database)"
7155 echo "(I cannot locate a hosts database anywhere)"
7160 tans=`./loc resolv.conf X /etc /usr/etc`
7161 if $test -f "$tans"; then
7162 echo "(Attempting domain name extraction from $tans)"
7163 dflt=.`$sed -n -e 's/ / /g' \
7164 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
7165 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
7167 .) dflt=.`$sed -n -e 's/ / /g' \
7168 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
7169 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
7176 .) echo "(No help from resolv.conf either -- attempting clever guess)"
7177 dflt=.`sh -c domainname 2>/dev/null`
7180 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
7185 .) echo "(Lost all hope -- silly guess then)"
7191 *) dflt="$mydomain";;
7195 rp="What is your domain name?"
7205 : translate upper to lower if necessary
7208 echo "(Normalizing case in your domain name)"
7209 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
7213 : a little sanity check here
7214 case "$phostname" in
7217 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
7218 $myhostname$mydomain|$myhostname) ;;
7220 case "$phostname" in
7222 echo "(That doesn't agree with your whoami.h file, by the way.)"
7225 echo "(That doesn't agree with your $phostname command, by the way.)"
7235 I need to get your e-mail address in Internet format if possible, i.e.
7236 something like user@host.domain. Please answer accurately since I have
7237 no easy means to double check it. The default value provided below
7238 is most probably close to reality but may not be valid from outside
7239 your organization...
7243 while test "$cont"; do
7245 '') dflt="$cf_by@$myhostname$mydomain";;
7246 *) dflt="$cf_email";;
7248 rp='What is your e-mail address?'
7254 rp='Address does not look like an Internet one. Use it anyway?'
7270 If you or somebody else will be maintaining perl at your site, please
7271 fill in the correct e-mail address here so that they may be contacted
7272 if necessary. Currently, the "perlbug" program included with perl
7273 will send mail to this address in addition to perlbug@perl.org. You may
7274 enter "none" for no administrator.
7277 case "$perladmin" in
7278 '') dflt="$cf_email";;
7279 *) dflt="$perladmin";;
7281 rp='Perl administrator e-mail address'
7285 : determine whether to only install version-specific parts.
7288 Do you want to install only the version-specific parts of the perl
7289 distribution? Usually you do *not* want to do this.
7291 case "$versiononly" in
7292 "$define"|[Yy]*|true) dflt='y' ;;
7295 rp="Do you want to install only the version-specific parts of perl?"
7298 [yY]*) val="$define";;
7304 : figure out how to guarantee perl startup
7305 case "$startperl" in
7307 case "$sharpbang" in
7311 I can use the #! construct to start perl on your system. This will
7312 make startup of perl scripts faster, but may cause problems if you
7313 want to share those scripts and perl is not in a standard place
7314 ($binexp/perl) on all your platforms. The alternative is to force
7315 a shell by starting the script with a single ':' character.
7318 case "$versiononly" in
7319 "$define") dflt="$binexp/perl$version";;
7320 *) dflt="$binexp/perl";;
7322 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
7325 none) startperl=": # use perl";;
7326 *) startperl="#!$ans"
7327 if $test 30 -lt `echo "$ans" | wc -c`; then
7330 WARNING: Some systems limit the #! command to 32 characters.
7331 If you experience difficulty running Perl scripts with #!, try
7332 installing Perl in a directory with a shorter pathname.
7338 *) startperl=": # use perl"
7343 echo "I'll use $startperl to start perl scripts."
7345 : figure best path for perl in scripts
7348 perlpath="$binexp/perl"
7349 case "$startperl" in
7354 I will use the "eval 'exec'" idiom to start Perl on your system.
7355 I can use the full path of your Perl binary for this purpose, but
7356 doing so may cause problems if you want to share those scripts and
7357 Perl is not always in a standard place ($binexp/perl).
7361 rp="What path shall I use in \"eval 'exec'\"?"
7368 case "$startperl" in
7370 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
7373 : determine where public executable scripts go
7374 set scriptdir scriptdir
7376 case "$scriptdir" in
7379 : guess some guesses
7380 $test -d /usr/share/scripts && dflt=/usr/share/scripts
7381 $test -d /usr/share/bin && dflt=/usr/share/bin
7382 $test -d /usr/local/script && dflt=/usr/local/script
7383 $test -d /usr/local/scripts && dflt=/usr/local/scripts
7384 $test -d $prefixexp/script && dflt=$prefixexp/script
7388 *) dflt="$scriptdir"
7393 Some installations have a separate directory just for executable scripts so
7394 that they can mount it across multiple architectures but keep the scripts in
7395 one spot. You might, for example, have a subdirectory of /usr/share for this.
7396 Or you might just lump your scripts in with all your other executables.
7400 rp='Where do you keep publicly executable scripts?'
7402 if $test "X$ansexp" != "X$scriptdirexp"; then
7406 scriptdirexp="$ansexp"
7407 : Change installation prefix, if necessary.
7408 if $test X"$prefix" != X"$installprefix"; then
7409 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
7411 installscript="$scriptdirexp"
7414 : determine where add-on public executables go
7416 '') dflt=$siteprefix/bin ;;
7420 rp='Pathname where the add-on public executables should be installed?'
7423 sitebinexp="$ansexp"
7424 : Change installation prefix, if necessary.
7425 if $test X"$prefix" != X"$installprefix"; then
7426 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
7428 installsitebin="$sitebinexp"
7431 case "$useperlio" in
7432 $define|true|[yY]*) dflt='y';;
7437 Previous version of $package used the standard IO mechanisms as
7438 defined in <stdio.h>. Versions 5.003_02 and later of perl allow
7439 alternate IO mechanisms via the PerlIO abstraction layer, but the
7440 stdio mechanism is still the default. This abstraction layer can
7441 use AT&T's sfio (if you already have sfio installed) or regular stdio.
7442 Using PerlIO with sfio may cause problems with some extension modules.
7444 If this doesn't make any sense to you, just accept the default '$dflt'.
7446 rp='Use the experimental PerlIO abstraction layer?'
7453 echo "Ok, doing things the stdio way."
7462 case "$useperlio" in
7463 $define|true|[yY]*) ;;
7466 You are using the SOCKS proxy protocol library which means that you
7467 should also use the PerlIO layer. You may be headed for trouble.
7476 case "$vendorprefix" in
7477 '') d_vendorbin="$undef"
7481 *) d_vendorbin="$define"
7482 : determine where vendor-supplied executables go.
7483 case "$vendorbin" in
7484 '') dflt=$vendorprefix/bin ;;
7485 *) dflt="$vendorbin" ;;
7488 rp='Pathname for the vendor-supplied executables directory?'
7491 vendorbinexp="$ansexp"
7494 : Change installation prefix, if necessary.
7495 if $test X"$prefix" != X"$installprefix"; then
7496 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
7498 installvendorbin="$vendorbinexp"
7501 : see if qgcvt exists
7507 if $test X"$d_longdbl" = X"$define"; then
7509 echo "Checking how to print long doubles..." >&4
7511 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
7512 $cat >try.c <<'EOCP'
7513 #include <sys/types.h>
7517 printf("%.3f\n", d);
7521 if eval $compile; then
7525 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
7526 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
7527 echo "We will use %f."
7533 if $test X"$sPRIfldbl" = X; then
7534 $cat >try.c <<'EOCP'
7535 #include <sys/types.h>
7538 long double d = 123.456;
7539 printf("%.3llf\n", d);
7543 if eval $compile; then
7547 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
7548 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
7549 echo "We will use %llf."
7555 if $test X"$sPRIfldbl" = X; then
7556 $cat >try.c <<'EOCP'
7557 #include <sys/types.h>
7560 long double d = 123.456;
7561 printf("%.3Lf\n", d);
7565 if eval $compile; then
7569 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
7570 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
7571 echo "We will use %Lf."
7577 if $test X"$sPRIfldbl" = X; then
7578 $cat >try.c <<'EOCP'
7579 #include <sys/types.h>
7582 long double d = 123.456;
7583 printf("%.3lf\n", d);
7587 if eval $compile; then
7591 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
7592 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
7593 echo "We will use %lf."
7599 if $test X"$sPRIfldbl" = X; then
7600 echo "Cannot figure out how to print long doubles." >&4
7602 sSCNfldbl=$sPRIfldbl # expect consistency
7609 case "$sPRIfldbl" in
7610 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
7611 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
7612 d_SCNfldbl="$undef";
7614 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
7615 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
7616 d_SCNfldbl="$define";
7620 : Check how to convert floats to strings.
7622 echo "Checking for an efficient way to convert floats to strings."
7624 case "$uselongdouble" in
7625 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
7627 case "$d_longdbl" in
7628 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
7630 case "$d_PRIgldbl" in
7631 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
7635 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
7636 char *myname = "gconvert";
7639 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
7640 char *myname = "gcvt";
7643 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
7644 char *myname = "qgcvt";
7645 #define DOUBLETYPE long double
7648 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE) && defined(HAS_PRIgldbl)
7649 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
7651 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
7653 char *myname = "sprintf";
7657 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
7658 #define DOUBLETYPE long double
7660 #define DOUBLETYPE double
7666 #define I_STDLIB $i_stdlib
7672 checkit(expect, got)
7676 if (strcmp(expect, got)) {
7677 printf("%s oddity: Expected %s, got %s\n",
7678 myname, expect, got);
7688 /* This must be 1st test on (which?) platform */
7689 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
7690 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
7691 checkit("0.1", buf);
7693 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
7696 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
7697 checkit("1.1", buf);
7699 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
7700 checkit("1.01", buf);
7702 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
7703 checkit("1.001", buf);
7705 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
7706 checkit("1.0001", buf);
7708 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
7709 checkit("1.00001", buf);
7711 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
7712 checkit("1.000001", buf);
7714 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
7717 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
7720 /* Some Linux gcvt's give 1.e+5 here. */
7721 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
7722 checkit("100000", buf);
7724 /* Some Linux gcvt's give -1.e+5 here. */
7725 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
7726 checkit("-100000", buf);
7728 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
7729 checkit("123.456", buf);
7734 case "$d_Gconvert" in
7735 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
7736 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
7737 sprintf*) xxx_list='sprintf gconvert gcvt' ;;
7738 *) xxx_list='gconvert gcvt sprintf' ;;
7741 case "$d_longdbl$uselongdouble$d_PRIgldbl" in
7742 "$define$define$define")
7743 # for long doubles prefer first qgcvt, then sprintf
7744 xxx_list="`echo $xxx_list|sed s/sprintf//`"
7745 xxx_list="sprintf $xxx_list"
7747 "$define") xxx_list="qgcvt $xxx_list" ;;
7752 for xxx_convert in $xxx_list; do
7753 echo "Trying $xxx_convert..."
7755 set try -DTRY_$xxx_convert
7756 if eval $compile; then
7757 echo "$xxx_convert() found." >&4
7759 echo "I'll use $xxx_convert to convert floats into a string." >&4
7762 echo "...But $xxx_convert didn't work as I expected."
7765 echo "$xxx_convert NOT found." >&4
7769 case "$xxx_convert" in
7770 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
7771 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
7772 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
7773 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
7774 "$define$define$define")
7775 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
7776 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
7781 : see if _fwalk exists
7785 : Initialize h_fcntl
7788 : Initialize h_sysfile
7791 : access call always available on UNIX
7795 : locate the flags for 'access()'
7799 $cat >access.c <<'EOCP'
7800 #include <sys/types.h>
7805 #include <sys/file.h>
7814 : check sys/file.h first, no particular reason here
7815 if $test `./findhdr sys/file.h` && \
7816 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
7818 echo "<sys/file.h> defines the *_OK access constants." >&4
7819 elif $test `./findhdr fcntl.h` && \
7820 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
7822 echo "<fcntl.h> defines the *_OK access constants." >&4
7823 elif $test `./findhdr unistd.h` && \
7824 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
7825 echo "<unistd.h> defines the *_OK access constants." >&4
7827 echo "I can't find the four *_OK access constants--I'll use mine." >&4
7833 : see if accessx exists
7834 set accessx d_accessx
7837 : see if alarm exists
7841 : see if atolf exists
7845 : see if atoll exists
7849 : Look for GNU-cc style attribute checking
7851 echo "Checking whether your compiler can handle __attribute__ ..." >&4
7852 $cat >attrib.c <<'EOCP'
7854 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
7856 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
7857 if $contains 'warning' attrib.out >/dev/null 2>&1; then
7858 echo "Your C compiler doesn't fully support __attribute__."
7861 echo "Your C compiler supports __attribute__."
7865 echo "Your C compiler doesn't seem to understand __attribute__ at all."
7872 : see if bcmp exists
7876 : see if bcopy exists
7880 : see if this is a unistd.h system
7881 set unistd.h i_unistd
7884 : see if getpgrp exists
7885 set getpgrp d_getpgrp
7888 case "$d_getpgrp" in
7891 echo "Checking to see which flavor of getpgrp is in use..."
7894 #include <sys/types.h>
7896 # include <unistd.h>
7900 if (getuid() == 0) {
7901 printf("(I see you are running Configure as super-user...)\n");
7905 if (getpgrp(1) == 0)
7914 if $cc -o set -DTRY_BSD_PGRP $ccflags $ldflags set.c $libs >/dev/null 2>&1 && ./set; then
7915 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
7917 elif $cc -o set $ccflags $ldflags set.c $libs >/dev/null 2>&1 && ./set; then
7918 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
7921 echo "I can't seem to compile and run the test program."
7923 xxx="a USG one, i.e. you use getpgrp()."
7925 # SVR4 systems can appear rather BSD-ish.
7928 xxx="a BSD one, i.e. you use getpgrp(pid)."
7932 xxx="probably a USG one, i.e. you use getpgrp()."
7937 echo "Assuming your getpgrp is $xxx" >&4
7946 : see if setpgrp exists
7947 set setpgrp d_setpgrp
7950 case "$d_setpgrp" in
7953 echo "Checking to see which flavor of setpgrp is in use..."
7956 #include <sys/types.h>
7958 # include <unistd.h>
7962 if (getuid() == 0) {
7963 printf("(I see you are running Configure as super-user...)\n");
7967 if (-1 == setpgrp(1, 1))
7970 if (setpgrp() != -1)
7976 if $cc -o set -DTRY_BSD_PGRP $ccflags $ldflags set.c $libs >/dev/null 2>&1 && ./set; then
7977 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
7979 elif $cc -o set $ccflags $ldflags set.c $libs >/dev/null 2>&1 && ./set; then
7980 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
7983 echo "(I can't seem to compile and run the test program.)"
7985 xxx="a USG one, i.e. you use setpgrp()."
7987 # SVR4 systems can appear rather BSD-ish.
7990 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
7994 xxx="probably a USG one, i.e. you use setpgrp()."
7999 echo "Assuming your setpgrp is $xxx" >&4
8007 : see if bzero exists
8011 : see if signal is declared as pointer to function returning int or void
8013 xxx=`./findhdr signal.h`
8014 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
8015 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
8016 echo "You have int (*signal())() instead of void." >&4
8018 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
8019 echo "You have void (*signal())()." >&4
8021 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
8022 echo "You have int (*signal())() instead of void." >&4
8024 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
8025 echo "You have void (*signal())()." >&4
8028 case "$d_voidsig" in
8030 echo "I can't determine whether signal handler returns void or int..." >&4
8032 rp="What type does your signal handler return?"
8039 echo "As you already told me, signal handler returns void." >&4
8042 *) echo "As you already told me, signal handler returns int." >&4
8049 case "$d_voidsig" in
8050 "$define") signal_t="void";;
8055 : check for ability to cast large floats to 32-bit ints.
8057 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
8058 if $test "$intsize" -ge 4; then
8065 #include <sys/types.h>
8067 $signal_t blech(s) int s; { exit(3); }
8074 signal(SIGFPE, blech);
8076 /* Don't let compiler optimize the test away. Store the number
8077 in a writable string for gcc to pass to sscanf under HP/UX.
8079 sprintf(str, "2147483647");
8080 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
8084 /* x86 processors will probably give 0x8000 0000, which is a
8085 sign change. We don't want that. We want to mimic SPARC
8086 behavior here, which is to preserve the sign and give
8089 if (i32 != ($xxx) f)
8095 if eval $compile_ok; then
8099 echo "(I can't seem to compile the test program--assuming it can't)"
8107 echo "Nope, it can't."
8114 : check for ability to cast negative floats to unsigned
8116 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
8119 #include <sys/types.h>
8121 $signal_t blech(s) int s; { exit(7); }
8122 $signal_t blech_in_list(s) int s; { exit(4); }
8123 unsigned long dummy_long(p) unsigned long p; { return p; }
8124 unsigned int dummy_int(p) unsigned int p; { return p; }
8125 unsigned short dummy_short(p) unsigned short p; { return p; }
8129 unsigned long along;
8131 unsigned short ashort;
8135 /* Frustrate gcc-2.7.2's optimizer which failed this test with
8136 a direct f = -123. assignment. gcc-2.8.0 reportedly
8137 optimized the whole file away
8139 /* Store the number in a writable string for gcc to pass to
8142 sprintf(str, "-123");
8143 sscanf(str, "%lf", &f); /* f = -123.; */
8145 signal(SIGFPE, blech);
8146 along = (unsigned long)f;
8147 aint = (unsigned int)f;
8148 ashort = (unsigned short)f;
8149 if (along != (unsigned long)-123)
8151 if (aint != (unsigned int)-123)
8153 if (ashort != (unsigned short)-123)
8155 sprintf(str, "1073741824.");
8156 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
8159 along = (unsigned long)f;
8160 if (along != 0x80000000)
8164 along = (unsigned long)f;
8165 if (along != 0x7fffffff)
8169 along = (unsigned long)f;
8170 if (along != 0x80000001)
8174 signal(SIGFPE, blech_in_list);
8175 sprintf(str, "123.");
8176 sscanf(str, "%lf", &f); /* f = 123.; */
8177 along = dummy_long((unsigned long)f);
8178 aint = dummy_int((unsigned int)f);
8179 ashort = dummy_short((unsigned short)f);
8180 if (along != (unsigned long)123)
8182 if (aint != (unsigned int)123)
8184 if (ashort != (unsigned short)123)
8191 if eval $compile_ok; then
8195 echo "(I can't seem to compile the test program--assuming it can't)"
8198 case "$castflags" in
8203 echo "Nope, it can't."
8210 : see if vprintf exists
8212 if set vprintf val -f d_vprintf; eval $csym; $val; then
8213 echo 'vprintf() found.' >&4
8215 $cat >vprintf.c <<'EOF'
8216 #include <varargs.h>
8218 int main() { xxx("foo"); }
8227 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
8231 if eval $compile && ./vprintf; then
8232 echo "Your vsprintf() returns (int)." >&4
8235 echo "Your vsprintf() returns (char*)." >&4
8239 echo 'vprintf() NOT found.' >&4
8249 : see if chown exists
8253 : see if chroot exists
8257 : see if chsize exists
8261 : check for const keyword
8263 echo 'Checking to see if your C compiler knows about "const"...' >&4
8264 $cat >const.c <<'EOCP'
8265 typedef struct spug { int drokk; } spug;
8272 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
8274 echo "Yup, it does."
8277 echo "Nope, it doesn't."
8282 : see if crypt exists
8284 if set crypt val -f d_crypt; eval $csym; $val; then
8285 echo 'crypt() found.' >&4
8289 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
8290 if $test -z "$cryptlib"; then
8291 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
8295 if $test -z "$cryptlib"; then
8296 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
8300 if $test -z "$cryptlib"; then
8301 cryptlib=`./loc libcrypt$_a "" $libpth`
8305 if $test -z "$cryptlib"; then
8306 echo 'crypt() NOT found.' >&4
8315 : get csh whereabouts
8317 'csh') val="$undef" ;;
8322 : Respect a hint or command line value for full_csh.
8324 '') full_csh=$csh ;;
8327 : see if cuserid exists
8328 set cuserid d_cuserid
8331 : see if this is a limits.h system
8332 set limits.h i_limits
8335 : see if this is a float.h system
8339 : See if number of significant digits in a double precision number is known
8341 $cat >dbl_dig.c <<EOM
8351 printf("Contains DBL_DIG");
8354 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
8355 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
8356 echo "DBL_DIG found." >&4
8359 echo "DBL_DIG NOT found." >&4
8366 : see if difftime exists
8367 set difftime d_difftime
8370 : see if this is a dirent system
8372 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
8374 echo "<dirent.h> found." >&4
8377 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
8378 echo "<sys/dir.h> found." >&4
8381 xinc=`./findhdr sys/ndir.h`
8383 echo "<dirent.h> NOT found." >&4
8388 : Look for type of directory structure.
8390 $cppstdin $cppflags $cppminus < "$xinc" > try.c
8392 case "$direntrytype" in
8395 $define) guess1='struct dirent' ;;
8396 *) guess1='struct direct' ;;
8399 *) guess1="$direntrytype"
8404 'struct dirent') guess2='struct direct' ;;
8405 *) guess2='struct dirent' ;;
8408 if $contains "$guess1" try.c >/dev/null 2>&1; then
8409 direntrytype="$guess1"
8410 echo "Your directory entries are $direntrytype." >&4
8411 elif $contains "$guess2" try.c >/dev/null 2>&1; then
8412 direntrytype="$guess2"
8413 echo "Your directory entries seem to be $direntrytype." >&4
8415 echo "I don't recognize your system's directory entries." >&4
8416 rp="What type is used for directory entries on this system?"
8424 : see if the directory entry stores field length
8426 $cppstdin $cppflags $cppminus < "$xinc" > try.c
8427 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
8428 echo "Good, your directory entry keeps length information in d_namlen." >&4
8431 echo "Your directory entry does not know about the d_namlen field." >&4
8438 : see if dlerror exists
8441 set dlerror d_dlerror
8445 : see if dlfcn is available
8453 On a few systems, the dynamically loaded modules that perl generates and uses
8454 will need a different extension than shared libs. The default will probably
8462 rp='What is the extension of dynamically loaded modules'
8471 : Check if dlsym need a leading underscore
8477 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
8478 $cat >dyna.c <<'EOM'
8487 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
8489 #include <sys/types.h>
8503 int mode = RTLD_LAZY ;
8505 handle = dlopen("./dyna.$dlext", mode) ;
8506 if (handle == NULL) {
8511 symbol = dlsym(handle, "fred") ;
8512 if (symbol == NULL) {
8513 /* try putting a leading underscore */
8514 symbol = dlsym(handle, "_fred") ;
8515 if (symbol == NULL) {
8528 : Call the object file tmp-dyna.o in case dlext=o.
8529 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
8530 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
8531 $ld -o dyna.$dlext $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
8532 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then
8535 1) echo "Test program failed using dlopen." >&4
8536 echo "Perhaps you should not use dynamic loading." >&4;;
8537 2) echo "Test program failed using dlsym." >&4
8538 echo "Perhaps you should not use dynamic loading." >&4;;
8539 3) echo "dlsym needs a leading underscore" >&4
8541 4) echo "dlsym doesn't need a leading underscore." >&4;;
8544 echo "I can't compile and run the test program." >&4
8545 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
8550 $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
8555 hasproto='varname=$1; func=$2; shift; shift;
8556 while $test $# -ge 2; do
8558 $define) echo "#include <$2>";;
8562 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
8563 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
8564 echo "$func() prototype found.";
8567 echo "$func() prototype NOT found.";
8572 $rm -f try.c tryout.c'
8574 : see if prototype for drand48 is available
8576 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
8579 : see if dup2 exists
8583 : see if eaccess exists
8584 set eaccess d_eaccess
8587 : see if endgrent exists
8588 set endgrent d_endgrent
8591 : see if endhostent exists
8592 set endhostent d_endhent
8595 : see if endnetent exists
8596 set endnetent d_endnent
8599 : see if endprotoent exists
8600 set endprotoent d_endpent
8603 : see if endpwent exists
8604 set endpwent d_endpwent
8607 : see if endservent exists
8608 set endservent d_endsent
8611 : Locate the flags for 'open()'
8613 $cat >open3.c <<'EOCP'
8614 #include <sys/types.h>
8619 #include <sys/file.h>
8630 : check sys/file.h first to get FREAD on Sun
8631 if $test `./findhdr sys/file.h` && \
8632 set open3 -DI_SYS_FILE && eval $compile; then
8634 echo "<sys/file.h> defines the O_* constants..." >&4
8636 echo "and you have the 3 argument form of open()." >&4
8639 echo "but not the 3 argument form of open(). Oh, well." >&4
8642 elif $test `./findhdr fcntl.h` && \
8643 set open3 -DI_FCNTL && eval $compile; then
8645 echo "<fcntl.h> defines the O_* constants..." >&4
8647 echo "and you have the 3 argument form of open()." >&4
8650 echo "but not the 3 argument form of open(). Oh, well." >&4
8655 echo "I can't find the O_* constant definitions! You got problems." >&4
8661 : see which of string.h or strings.h is needed
8663 strings=`./findhdr string.h`
8664 if $test "$strings" && $test -r "$strings"; then
8665 echo "Using <string.h> instead of <strings.h>." >&4
8669 strings=`./findhdr strings.h`
8670 if $test "$strings" && $test -r "$strings"; then
8671 echo "Using <strings.h> instead of <string.h>." >&4
8673 echo "No string header found -- You'll surely have problems." >&4
8679 "$undef") strings=`./findhdr strings.h`;;
8680 *) strings=`./findhdr string.h`;;
8683 : check for non-blocking I/O stuff
8684 case "$h_sysfile" in
8685 true) echo "#include <sys/file.h>" > head.c;;
8688 true) echo "#include <fcntl.h>" > head.c;;
8689 *) echo "#include <sys/fcntl.h>" > head.c;;
8694 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
8695 case "$o_nonblock" in
8698 $cat >>try.c <<'EOCP'
8702 printf("O_NONBLOCK\n");
8706 printf("O_NDELAY\n");
8710 printf("FNDELAY\n");
8717 if eval $compile_ok; then
8719 case "$o_nonblock" in
8720 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
8721 *) echo "Seems like we can use $o_nonblock.";;
8724 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
8727 *) echo "Using $hint value $o_nonblock.";;
8729 $rm -f try try.* .out core
8732 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
8738 #include <sys/types.h>
8741 #define MY_O_NONBLOCK $o_nonblock
8742 #ifndef errno /* XXX need better Configure test */
8753 #include <strings.h>
8755 $signal_t blech(x) int x; { exit(3); }
8757 $cat >> try.c <<'EOCP'
8765 pipe(pd); /* Down: child -> parent */
8766 pipe(pu); /* Up: parent -> child */
8769 close(pd[1]); /* Parent reads from pd[0] */
8770 close(pu[0]); /* Parent writes (blocking) to pu[1] */
8771 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
8773 signal(SIGALRM, blech);
8775 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
8777 sprintf(string, "%d\n", ret);
8778 write(2, string, strlen(string));
8781 if (errno == EAGAIN) {
8787 if (errno == EWOULDBLOCK)
8788 printf("EWOULDBLOCK\n");
8791 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
8792 sleep(2); /* Give it time to close our pipe */
8794 ret = read(pd[0], buf, 1); /* Should read EOF */
8796 sprintf(string, "%d\n", ret);
8797 write(3, string, strlen(string));
8801 close(pd[0]); /* We write to pd[1] */
8802 close(pu[1]); /* We read from pu[0] */
8803 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
8804 close(pd[1]); /* Pipe pd is now fully closed! */
8805 exit(0); /* Bye bye, thank you for playing! */
8809 if eval $compile_ok; then
8810 echo "$startsh" >mtry
8811 echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
8813 ./mtry >/dev/null 2>&1
8815 0) eagain=`$cat try.out`;;
8816 1) echo "Could not perform non-blocking setting!";;
8817 2) echo "I did a successful read() for something that was not there!";;
8818 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
8819 *) echo "Something terribly wrong happened during testing.";;
8821 rd_nodata=`$cat try.ret`
8822 echo "A read() system call with no data present returns $rd_nodata."
8823 case "$rd_nodata" in
8826 echo "(That's peculiar, fixing that to be -1.)"
8832 echo "Forcing errno EAGAIN on read() with no data available."
8836 echo "Your read() sets errno to $eagain when no data is available."
8839 status=`$cat try.err`
8841 0) echo "And it correctly returns 0 to signal EOF.";;
8842 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
8843 *) echo "However, your read() returns '$status' on EOF??";;
8846 if test "$status" = "$rd_nodata"; then
8847 echo "WARNING: you can't distinguish between EOF and no data!"
8851 echo "I can't compile the test program--assuming errno EAGAIN will do."
8858 echo "Using $hint value $eagain."
8859 echo "Your read() returns $rd_nodata when no data is present."
8860 case "$d_eofnblk" in
8861 "$define") echo "And you can see EOF because read() returns 0.";;
8862 "$undef") echo "But you can't see EOF status from read() returned value.";;
8864 echo "(Assuming you can't see EOF status from read anyway.)"
8870 $rm -f try try.* .out core head.c mtry
8872 : see if fchmod exists
8876 : see if fchown exists
8880 : see if this is an fcntl system
8885 : See if fcntl-based locking works.
8886 $cat >try.c <<'EOCP'
8891 #if defined(F_SETLK) && defined(F_SETLKW)
8894 fd = open("try.c", O_RDONLY);
8895 flock.l_type = F_RDLCK;
8896 flock.l_whence = SEEK_SET;
8897 flock.l_start = flock.l_len = 0;
8898 retval = fcntl(fd, F_SETLK, &flock);
8900 (retval < 0 ? exit(2) : exit(0));
8906 echo "Checking if fcntl-based file locking works... "
8910 if eval $compile_ok; then
8912 echo "Yes, it seems to work."
8915 echo "Nope, it didn't work."
8919 echo "I'm unable to compile the test program, so I'll assume not."
8924 echo "Nope, since you don't even have fcntl()."
8927 set d_fcntl_can_lock
8932 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
8933 while $test $# -ge 2; do
8935 $define) echo "#include <$2>";;
8939 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
8941 if eval $compile; then
8952 : see whether socket exists
8954 $echo $n "Hmm... $c" >&4
8955 if set socket val -f d_socket; eval $csym; $val; then
8956 echo "Looks like you have Berkeley networking support." >&4
8958 if set setsockopt val -f; eval $csym; $val; then
8961 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
8965 if $contains socklib libc.list >/dev/null 2>&1; then
8966 echo "Looks like you have Berkeley networking support." >&4
8968 : we will have to assume that it supports the 4.2 BSD interface
8971 echo "You don't have Berkeley networking in libc$_a..." >&4
8972 if test "X$d_socket" = "X$define"; then
8973 echo "...but you seem to believe that you have sockets." >&4
8975 for net in net socket
8977 if test -f /usr/lib/lib$net$_a; then
8978 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
8979 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
8980 if $contains socket libc.list >/dev/null 2>&1; then
8985 echo "...but the Wollongong group seems to have hacked it in." >&4
8986 sockethdr="-I/usr/netinclude"
8989 echo "Found Berkeley sockets interface in lib$net." >& 4
8990 if $contains setsockopt libc.list >/dev/null 2>&1; then
8993 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
9000 if test "X$d_socket" != "X$define"; then
9001 echo "or anywhere else I see." >&4
9009 : see if socketpair exists
9010 set socketpair d_sockpair
9015 echo "Checking the availability of certain socket constants..." >& 4
9016 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
9017 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
9019 #include <sys/types.h>
9020 #include <sys/socket.h>
9026 set try; if eval $compile; then
9029 set d_${enum}; eval $setvar
9033 : see if sys/select.h has to be included
9034 set sys/select.h i_sysselct
9037 : see if we should include time.h, sys/time.h, or both
9039 if test "X$timeincl" = X; then
9040 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9041 $echo $n "I'm now running the test program...$c"
9042 $cat >try.c <<'EOCP'
9043 #include <sys/types.h>
9048 #ifdef SYSTIMEKERNEL
9051 #include <sys/time.h>
9054 #include <sys/select.h>
9063 struct timezone tzp;
9065 if (foo.tm_sec == foo.tm_sec)
9068 if (bar.tv_sec == bar.tv_sec)
9075 for s_timezone in '-DS_TIMEZONE' ''; do
9077 for s_timeval in '-DS_TIMEVAL' ''; do
9078 for i_systimek in '' '-DSYSTIMEKERNEL'; do
9079 for i_time in '' '-DI_TIME'; do
9080 for i_systime in '-DI_SYSTIME' ''; do
9083 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
9084 if eval $compile; then
9085 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
9089 $echo $n "Succeeded with $flags$c"
9101 *SYSTIMEKERNEL*) i_systimek="$define"
9102 timeincl=`./findhdr sys/time.h`
9103 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
9104 *) i_systimek="$undef";;
9107 *I_TIME*) i_time="$define"
9108 timeincl=`./findhdr time.h`" $timeincl"
9109 echo "We'll include <time.h>." >&4;;
9110 *) i_time="$undef";;
9113 *I_SYSTIME*) i_systime="$define"
9114 timeincl=`./findhdr sys/time.h`" $timeincl"
9115 echo "We'll include <sys/time.h>." >&4;;
9116 *) i_systime="$undef";;
9121 : check for fd_set items
9124 Checking to see how well your C compiler handles fd_set and friends ...
9126 $cat >fd_set.c <<EOCP
9127 #$i_systime I_SYS_TIME
9128 #$i_sysselct I_SYS_SELECT
9129 #$d_socket HAS_SOCKET
9130 #include <sys/types.h>
9132 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
9135 #include <sys/time.h>
9138 #include <sys/select.h>
9147 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
9154 set fd_set -DTRYBITS
9155 if eval $compile; then
9156 d_fds_bits="$define"
9158 echo "Well, your system knows about the normal fd_set typedef..." >&4
9160 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
9161 d_fd_macros="$define"
9164 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
9166 d_fd_macros="$undef"
9170 Hmm, your compiler has some difficulty with fd_set. Checking further...
9173 if eval $compile; then
9176 echo "Well, your system has some sort of fd_set available..." >&4
9178 echo "and you have the normal fd_set macros." >&4
9179 d_fd_macros="$define"
9182 but not the normal fd_set macros! Gross! More work for me...
9184 d_fd_macros="$undef"
9187 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
9190 d_fd_macros="$undef"
9195 : see if fgetpos exists
9196 set fgetpos d_fgetpos
9199 : see if flock exists
9203 : see if fork exists
9207 : see if pathconf exists
9208 set pathconf d_pathconf
9211 : see if fpathconf exists
9212 set fpathconf d_fpathconf
9216 : check for fpos64_t
9218 echo "Checking to see if you have fpos64_t..." >&4
9221 int main() { fpos64_t x = 7; }
9224 if eval $compile; then
9226 echo "You have fpos64_t."
9229 echo "You do not have fpos64_t."
9231 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
9238 : see if frexpl exists
9242 hasstruct='varname=$1; struct=$2; shift; shift;
9243 while $test $# -ge 2; do
9245 $define) echo "#include <$2>";;
9249 echo "int main () { struct $struct foo; }" >> try.c;
9251 if eval $compile; then
9260 : see if this is a sys/param system
9261 set sys/param.h i_sysparam
9264 : see if this is a sys/mount.h system
9265 set sys/mount.h i_sysmount
9268 : see if sys/types.h has to be included
9269 set sys/types.h i_systypes
9274 echo "Checking to see if your system supports struct fs_data..." >&4
9275 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
9277 case "$d_fs_data_s" in
9278 "$define") echo "Yes, it does." ;;
9279 *) echo "No, it doesn't." ;;
9282 : see if fseeko exists
9286 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
9289 : see if fsetpos exists
9290 set fsetpos d_fsetpos
9294 : see if fstatfs exists
9295 set fstatfs d_fstatfs
9299 : see if statvfs exists
9300 set statvfs d_statvfs
9303 : see if fstatvfs exists
9304 set fstatvfs d_fstatvfs
9308 : see if fsync exists
9312 : see if ftello exists
9316 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
9319 : see if getcwd exists
9323 : see if getespwnam exists
9324 set getespwnam d_getespwnam
9328 : see if getfsstat exists
9329 set getfsstat d_getfsstat
9332 : see if getgrent exists
9333 set getgrent d_getgrent
9336 : see if gethostbyaddr exists
9337 set gethostbyaddr d_gethbyaddr
9340 : see if gethostbyname exists
9341 set gethostbyname d_gethbyname
9344 : see if gethostent exists
9345 set gethostent d_gethent
9348 : see how we will look up host name
9351 if set gethostname val -f d_gethname; eval $csym; $val; then
9352 echo 'gethostname() found.' >&4
9353 d_gethname="$define"
9356 if set uname val -f d_uname; eval $csym; $val; then
9359 uname() was found, but you're running xenix, and older versions of xenix
9360 have a broken uname(). If you don't really know whether your xenix is old
9361 enough to have a broken system call, use the default answer.
9368 rp='Is your uname() broken?'
9371 n*) d_uname="$define"; call=uname;;
9374 echo 'uname() found.' >&4
9381 case "$d_gethname" in
9382 '') d_gethname="$undef";;
9385 '') d_uname="$undef";;
9387 case "$d_uname$d_gethname" in
9392 Every now and then someone has a $call() that lies about the hostname
9393 but can't be fixed for political or economic reasons. If you wish, I can
9394 pretend $call() isn't there and maybe compute hostname at run-time
9395 thanks to the '$phostname' command.
9398 rp="Shall I ignore $call() from now on?"
9401 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
9404 case "$phostname" in
9406 *) case "$aphostname" in
9412 file=`./loc $file $file $pth`
9413 aphostname=`echo $file $*`
9418 case "$d_uname$d_gethname" in
9421 case "$phostname" in
9423 echo "There will be no way for $package to get your hostname." >&4;;
9425 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
9429 case "$d_phostname" in
9430 '') d_phostname="$undef";;
9433 : see if this is a netdb.h system
9437 : see if prototypes for various gethostxxx netdb.h functions are available
9439 set d_gethostprotos gethostent $i_netdb netdb.h
9442 : see if getlogin exists
9443 set getlogin d_getlogin
9446 : see if getmnt exists
9450 : see if getmntent exists
9451 set getmntent d_getmntent
9454 : see if getnetbyaddr exists
9455 set getnetbyaddr d_getnbyaddr
9458 : see if getnetbyname exists
9459 set getnetbyname d_getnbyname
9462 : see if getnetent exists
9463 set getnetent d_getnent
9466 : see if prototypes for various getnetxxx netdb.h functions are available
9468 set d_getnetprotos getnetent $i_netdb netdb.h
9471 : see if getpagesize exists
9472 set getpagesize d_getpagsz
9476 : see if getprotobyname exists
9477 set getprotobyname d_getpbyname
9480 : see if getprotobynumber exists
9481 set getprotobynumber d_getpbynumber
9484 : see if getprotoent exists
9485 set getprotoent d_getpent
9488 : see if getpgid exists
9489 set getpgid d_getpgid
9492 : see if getpgrp2 exists
9493 set getpgrp2 d_getpgrp2
9496 : see if getppid exists
9497 set getppid d_getppid
9500 : see if getpriority exists
9501 set getpriority d_getprior
9504 : see if prototypes for various getprotoxxx netdb.h functions are available
9506 set d_getprotoprotos getprotoent $i_netdb netdb.h
9509 : see if getprpwnam exists
9510 set getprpwnam d_getprpwnam
9513 : see if getpwent exists
9514 set getpwent d_getpwent
9518 : see if getservbyname exists
9519 set getservbyname d_getsbyname
9522 : see if getservbyport exists
9523 set getservbyport d_getsbyport
9526 : see if getservent exists
9527 set getservent d_getsent
9530 : see if prototypes for various getservxxx netdb.h functions are available
9532 set d_getservprotos getservent $i_netdb netdb.h
9535 : see if getspnam exists
9536 set getspnam d_getspnam
9539 : see if gettimeofday or ftime exists
9540 set gettimeofday d_gettimeod
9542 case "$d_gettimeod" in
9548 val="$undef"; set d_ftime; eval $setvar
9551 case "$d_gettimeod$d_ftime" in
9554 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
9558 : see if this is an grp system
9564 xxx=`./findhdr grp.h`
9565 $cppstdin $cppflags $cppminus < $xxx >$$.h
9567 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
9579 set d_grpasswd; eval $setvar
9583 : see if hasmntopt exists
9584 set hasmntopt d_hasmntopt
9587 : see if this is a netinet/in.h or sys/in.h system
9588 set netinet/in.h i_niin sys/in.h i_sysin
9591 : see if arpa/inet.h has to be included
9592 set arpa/inet.h i_arpainet
9595 : see if htonl --and friends-- exists
9600 : Maybe they are macros.
9605 #include <sys/types.h>
9606 #$i_niin I_NETINET_IN
9608 #$i_arpainet I_ARPA_INET
9610 #include <netinet/in.h>
9616 #include <arpa/inet.h>
9619 printf("Defined as a macro.");
9622 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
9623 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
9625 echo "But it seems to be defined as a macro." >&4
9633 : see if iconv exists
9639 if set index val -f; eval $csym; $val; then
9640 if set strchr val -f d_strchr; eval $csym; $val; then
9641 if $contains strchr "$strings" >/dev/null 2>&1 ; then
9644 echo "strchr() found." >&4
9648 echo "index() found." >&4
9653 echo "index() found." >&4
9656 if set strchr val -f d_strchr; eval $csym; $val; then
9659 echo "strchr() found." >&4
9661 echo "No index() or strchr() found!" >&4
9666 set d_strchr; eval $setvar
9668 set d_index; eval $setvar
9670 : check whether inet_aton exists
9671 set inet_aton d_inetaton
9674 : see if inttypes.h is available
9675 : we want a real compile instead of Inhdr because some systems
9676 : have an inttypes.h which includes non-existent headers
9679 #include <inttypes.h>
9681 static int32_t foo32 = 0x12345678;
9685 if eval $compile; then
9686 echo "<inttypes.h> found." >&4
9689 echo "<inttypes.h> NOT found." >&4
9698 echo "Checking to see if you have int64_t..." >&4
9700 #include <sys/types.h>
9701 #$i_inttypes I_INTTYPES
9703 #include <inttypes.h>
9705 int main() { int64_t x = 7; }
9708 if eval $compile; then
9710 echo "You have int64_t."
9713 echo "You do not have int64_t."
9721 $cat >isascii.c <<'EOCP'
9733 if eval $compile; then
9734 echo "isascii() found." >&4
9737 echo "isascii() NOT found." >&4
9744 : see if isnan exists
9748 : see if isnanl exists
9752 : see if killpg exists
9756 : see if lchown exists
9758 $cat > try.c <<'EOCP'
9759 /* System header to define __stub macros and hopefully few prototypes,
9760 which can conflict with char lchown(); below. */
9762 /* Override any gcc2 internal prototype to avoid an error. */
9763 /* We use char because int might match the return type of a gcc2
9764 builtin and then its argument prototype would still apply. */
9767 /* The GNU C library defines this for functions which it implements
9768 to always fail with ENOSYS. Some functions are actually named
9769 something starting with __ and the normal name is an alias. */
9770 #if defined (__stub_lchown) || defined (__stub___lchown)
9778 if eval $compile; then
9779 $echo "lchown() found." >&4
9782 $echo "lchown() NOT found." >&4
9788 : See if number of significant digits in a double precision number is known
9790 $cat >ldbl_dig.c <<EOM
9800 printf("Contains LDBL_DIG");
9803 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
9804 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
9805 echo "LDBL_DIG found." >&4
9808 echo "LDBL_DIG NOT found." >&4
9815 : see if link exists
9819 : see if localeconv exists
9820 set localeconv d_locconv
9823 : see if lockf exists
9827 : check for long long
9829 echo "Checking to see if you have long long..." >&4
9830 echo 'int main() { long long x = 7; return 0; }' > try.c
9832 if eval $compile; then
9834 echo "You have long long."
9837 echo "You do not have long long."
9843 : check for length of long long
9844 case "${d_longlong}${longlongsize}" in
9847 echo "Checking to see how big your long longs are..." >&4
9848 $cat >try.c <<'EOCP'
9852 printf("%d\n", (int)sizeof(long long));
9857 if eval $compile_ok; then
9858 longlongsize=`./try$exe_ext`
9859 echo "Your long longs are $longlongsize bytes long."
9863 echo "(I can't seem to compile the test program. Guessing...)"
9864 rp="What is the size of a long long (in bytes)?"
9868 if $test "X$longsize" = "X$longlongsize"; then
9869 echo "(That isn't any different from an ordinary long.)"
9875 : see if prototype for lseek is available
9877 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
9880 : see if lstat exists
9884 : see if madvise exists
9885 set madvise d_madvise
9888 : see if mblen exists
9892 : see if mbstowcs exists
9893 set mbstowcs d_mbstowcs
9896 : see if mbtowc exists
9900 : see if memchr exists
9904 : see if memcmp exists
9908 : see if memcpy exists
9912 : see if memmove exists
9913 set memmove d_memmove
9916 : see if memset exists
9920 : see if mkdir exists
9924 : see if mkdtemp exists
9925 set mkdtemp d_mkdtemp
9928 : see if mkfifo exists
9932 : see if mkstemp exists
9933 set mkstemp d_mkstemp
9936 : see if mkstemps exists
9937 set mkstemps d_mkstemps
9940 : see if mktime exists
9944 : see if this is a sys/mman.h system
9945 set sys/mman.h i_sysmman
9948 : see if mmap exists
9951 : see what shmat returns
9952 : default to something harmless
9954 case "$i_sysmman$d_mmap" in
9956 $cat >mmap.c <<'END'
9957 #include <sys/mman.h>
9960 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
9965 echo "and it returns ($mmaptype)." >&4
9971 : see if modfl exists
9975 : see if mprotect exists
9976 set mprotect d_mprotect
9979 : see if msgctl exists
9983 : see if msgget exists
9987 : see if msgsnd exists
9991 : see if msgrcv exists
9995 : see how much of the 'msg*(2)' library is present.
9998 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
9999 *"$undef"*) h_msg=false;;
10003 case "`ipcs 2>&1`" in
10004 "SVID messages"*"not configured"*)
10005 echo "Your $osname does not have the msg*(2) configured." >&4
10008 set msgctl d_msgctl
10010 set msgget d_msgget
10012 set msgsnd d_msgsnd
10014 set msgrcv d_msgrcv
10020 : we could also check for sys/ipc.h ...
10021 if $h_msg && $test `./findhdr sys/msg.h`; then
10022 echo "You have the full msg*(2) library." >&4
10025 echo "You don't have the full msg*(2) library." >&4
10031 : see if msync exists
10035 : see if munmap exists
10036 set munmap d_munmap
10039 : see if nice exists
10045 echo "Checking which 64-bit integer type we could use..." >&4
10051 val='"unsigned int"'
10056 *) case "$longsize" in
10060 val='"unsigned long"'
10065 *) case "$d_longlong:$longlongsize" in
10070 val='"unsigned long long"'
10075 *) case "$d_int64_t" in
10093 case "$quadtype" in
10094 '') echo "Alas, no 64-bit integer types in sight." >&4
10097 *) if test X"$use64bitint" = Xdefine -o X"$longsize" = X8; then
10102 echo "We $verb use '$quadtype' for 64-bit integers." >&4
10107 : check for length of character
10109 case "$charsize" in
10111 echo "Checking to see how big your characters are (hey, you never know)..." >&4
10112 $cat >try.c <<'EOCP'
10116 printf("%d\n", (int)sizeof(char));
10121 if eval $compile_ok; then
10125 echo "(I can't seem to compile the test program. Guessing...)"
10132 rp="What is the size of a character (in bytes)?"
10137 : check for volatile keyword
10139 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
10140 $cat >try.c <<'EOCP'
10143 typedef struct _goo_struct goo_struct;
10144 goo_struct * volatile goo = ((goo_struct *)0);
10145 struct _goo_struct {
10150 typedef unsigned short foo_t;
10151 char *volatile foo;
10153 volatile foo_t blech;
10157 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
10159 echo "Yup, it does."
10162 echo "Nope, it doesn't."
10170 $echo "Choosing the C types to be used for Perl's internal types..." >&4
10172 case "$use64bitint:$d_quad:$quadtype" in
10175 uvtype="$uquadtype"
10180 uvtype="unsigned long"
10186 case "$uselongdouble:$d_longdbl" in
10188 nvtype="long double"
10189 nvsize=$longdblsize
10196 $echo "(IV will be "$ivtype", $ivsize bytes)"
10197 $echo "(UV will be "$uvtype", $uvsize bytes)"
10198 $echo "(NV will be "$nvtype", $nvsize bytes)"
10201 #$i_inttypes I_INTTYPES
10203 #include <inttypes.h>
10208 int8_t i = INT8_MAX;
10209 uint8_t u = UINT8_MAX;
10210 printf("int8_t\n");
10213 int16_t i = INT16_MAX;
10214 uint16_t i = UINT16_MAX;
10215 printf("int16_t\n");
10218 int32_t i = INT32_MAX;
10219 uint32_t u = UINT32_MAX;
10220 printf("int32_t\n");
10226 '') case "$charsize" in
10228 u8type="unsigned char"
10237 if eval $compile; then
10238 case "`./try$exe_ext`" in
10239 int8_t) i8type=int8_t
10249 '') if $test $charsize -ge 1; then
10251 u8type="unsigned char"
10259 '') case "$shortsize" in
10261 u16type="unsigned short"
10269 '') set try -DINT16
10270 if eval $compile; then
10271 case "`./try$exe_ext`" in
10283 '') if $test $shortsize -ge 2; then
10285 u16type="unsigned short"
10293 '') case "$longsize" in
10295 u32type="unsigned long"
10299 *) case "$intsize" in
10301 u32type="unsigned int"
10311 '') set try -DINT32
10312 if eval $compile; then
10313 case "`./try$exe_ext`" in
10325 '') if $test $intsize -ge 4; then
10327 u32type="unsigned int"
10335 '') case "$d_quad:$quadtype" in
10337 i64type="$quadtype"
10338 u64type="$uquadtype"
10346 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
10347 : volatile so that the compiler has to store it out to memory.
10348 if test X"$d_volatile" = X"$define"; then
10353 #include <sys/types.h>
10354 #include <signal.h>
10356 $volatile int bletched = 0;
10357 $signal_t blech(s) int s; { bletched = 1; }
10362 int n = 8 * $uvsize;
10365 signal(SIGFPE, blech);
10368 for (i = 0; i < n; i++) {
10369 u = u << 1 | ($uvtype)1;
10371 if (($uvtype)d != u)
10375 d = ($nvtype)(u - 1);
10376 if (($uvtype)d != (u - 1))
10384 printf("%d\n", ((i == n) ? -n : i));
10390 d_nv_preserves_uv="$undef"
10391 if eval $compile; then
10392 d_nv_preserves_uv_bits="`./try$exe_ext`"
10394 case "$d_nv_preserves_uv_bits" in
10396 d_nv_preserves_uv_bits=`expr 0 - $d_nv_preserves_uv_bits`
10397 $echo "Your NVs can preserve all $d_nv_preserves_uv_bits bits of your UVs." 2>&1
10398 d_nv_preserves_uv="$define"
10400 [1-9]*) $echo "Your NVs can preserve only $d_nv_preserves_uv_bits bits of your UVs." 2>&1
10401 d_nv_preserves_uv="$undef" ;;
10402 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
10403 d_nv_preserves_uv_bits="$undef" ;;
10409 : check for off64_t
10411 echo "Checking to see if you have off64_t..." >&4
10413 #include <sys/types.h>
10414 #include <unistd.h>
10415 int main() { off64_t x = 7; }
10418 if eval $compile; then
10420 echo "You have off64_t."
10423 echo "You do not have off64_t."
10424 case "$lseeksize" in
10425 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
10432 : see if POSIX threads are available
10433 set pthread.h i_pthread
10439 : how to create joinable pthreads
10440 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
10442 echo "Checking what constant to use for creating joinable pthreads..." >&4
10443 $cat >try.c <<'EOCP'
10444 #include <pthread.h>
10446 int detachstate = JOINABLE;
10449 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
10450 if eval $compile; then
10451 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
10452 val="$undef" # Yes, undef.
10453 set d_old_pthread_create_joinable
10456 set old_pthread_create_joinable
10459 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
10460 if eval $compile; then
10461 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
10463 set d_old_pthread_create_joinable
10465 val=PTHREAD_CREATE_UNDETACHED
10466 set old_pthread_create_joinable
10469 set try -DJOINABLE=__UNDETACHED
10470 if eval $compile; then
10471 echo "You seem to use __UNDETACHED." >&4
10473 set d_old_pthread_create_joinable
10476 set old_pthread_create_joinable
10479 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
10481 set d_old_pthread_create_joinable
10484 set old_pthread_create_joinable
10491 d_old_pthread_create_joinable="$undef"
10492 old_pthread_create_joinable=""
10495 : see if pause exists
10499 : see if pipe exists
10503 : see if poll exists
10508 : see whether the various POSIXish _yields exist
10510 #include <pthread.h>
10516 #ifdef PTHREAD_YIELD
10519 #ifdef PTHREAD_YIELD_NULL
10520 pthread_yield(NULL);
10526 : see if sched_yield exists
10527 set try -DSCHED_YIELD
10528 if eval $compile; then
10530 sched_yield='sched_yield()'
10534 case "$usethreads" in
10537 $define) echo 'sched_yield() found.' >&4 ;;
10538 *) echo 'sched_yield() NOT found.' >&4 ;;
10544 : see if pthread_yield exists
10545 set try -DPTHREAD_YIELD
10546 if eval $compile; then
10548 case "$sched_yield" in
10549 '') sched_yield='pthread_yield()' ;;
10552 set try -DPTHREAD_YIELD_NULL
10553 if eval $compile; then
10555 case "$sched_yield" in
10556 '') sched_yield='pthread_yield(NULL)' ;;
10562 case "$usethreads" in
10565 $define) echo 'pthread_yield() found.' >&4 ;;
10566 *) echo 'pthread_yield() NOT found.' >&4 ;;
10570 set d_pthread_yield
10573 case "$sched_yield" in
10574 '') sched_yield=undef ;;
10579 : see if this is a pwd.h system
10585 xxx=`./findhdr pwd.h`
10586 $cppstdin $cppflags $cppminus < $xxx >$$.h
10588 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
10596 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
10604 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
10612 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
10620 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
10628 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
10636 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
10644 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
10656 set d_pwquota; eval $setvar
10657 set d_pwage; eval $setvar
10658 set d_pwchange; eval $setvar
10659 set d_pwclass; eval $setvar
10660 set d_pwexpire; eval $setvar
10661 set d_pwcomment; eval $setvar
10662 set d_pwgecos; eval $setvar
10663 set d_pwpasswd; eval $setvar
10667 : see if readdir and friends exist
10668 set readdir d_readdir
10670 set seekdir d_seekdir
10672 set telldir d_telldir
10674 set rewinddir d_rewinddir
10677 : see if readlink exists
10678 set readlink d_readlink
10681 : see if rename exists
10682 set rename d_rename
10685 : see if rmdir exists
10689 : see if memory.h is available.
10694 : See if it conflicts with string.h
10700 $cppstdin $cppflags $cppminus < $strings > mem.h
10701 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
10703 echo "We won't be including <memory.h>."
10713 : can bcopy handle overlapping blocks?
10718 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
10720 #$i_memory I_MEMORY
10721 #$i_stdlib I_STDLIB
10722 #$i_string I_STRING
10723 #$i_unistd I_UNISTD
10725 $cat >>try.c <<'EOCP'
10728 # include <memory.h>
10731 # include <stdlib.h>
10734 # include <string.h>
10736 # include <strings.h>
10739 # include <unistd.h> /* Needed for NetBSD */
10743 char buf[128], abc[128];
10749 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
10751 for (align = 7; align >= 0; align--) {
10752 for (len = 36; len; len--) {
10754 bcopy(abc, b, len);
10755 for (off = 1; off <= len; off++) {
10756 bcopy(b, b+off, len);
10757 bcopy(b+off, b, len);
10758 if (bcmp(b, abc, len))
10767 if eval $compile_ok; then
10768 if ./try 2>/dev/null; then
10769 echo "Yes, it can."
10772 echo "It can't, sorry."
10773 case "$d_memmove" in
10774 "$define") echo "But that's Ok since you have memmove()." ;;
10778 echo "(I can't compile the test program, so we'll assume not...)"
10779 case "$d_memmove" in
10780 "$define") echo "But that's Ok since you have memmove()." ;;
10785 $rm -f try.* try core
10789 : can memcpy handle overlapping blocks?
10791 case "$d_memcpy" in
10794 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
10796 #$i_memory I_MEMORY
10797 #$i_stdlib I_STDLIB
10798 #$i_string I_STRING
10799 #$i_unistd I_UNISTD
10801 $cat >>try.c <<'EOCP'
10804 # include <memory.h>
10807 # include <stdlib.h>
10810 # include <string.h>
10812 # include <strings.h>
10815 # include <unistd.h> /* Needed for NetBSD */
10819 char buf[128], abc[128];
10825 /* Copy "abcde..." string to char abc[] so that gcc doesn't
10826 try to store the string in read-only memory. */
10827 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
10829 for (align = 7; align >= 0; align--) {
10830 for (len = 36; len; len--) {
10832 memcpy(b, abc, len);
10833 for (off = 1; off <= len; off++) {
10834 memcpy(b+off, b, len);
10835 memcpy(b, b+off, len);
10836 if (memcmp(b, abc, len))
10845 if eval $compile_ok; then
10846 if ./try 2>/dev/null; then
10847 echo "Yes, it can."
10850 echo "It can't, sorry."
10851 case "$d_memmove" in
10852 "$define") echo "But that's Ok since you have memmove()." ;;
10856 echo "(I can't compile the test program, so we'll assume not...)"
10857 case "$d_memmove" in
10858 "$define") echo "But that's Ok since you have memmove()." ;;
10863 $rm -f try.* try core
10867 : can memcmp be trusted to compare relative magnitude?
10869 case "$d_memcmp" in
10872 echo "Checking if your memcmp() can compare relative magnitude..." >&4
10874 #$i_memory I_MEMORY
10875 #$i_stdlib I_STDLIB
10876 #$i_string I_STRING
10877 #$i_unistd I_UNISTD
10879 $cat >>try.c <<'EOCP'
10882 # include <memory.h>
10885 # include <stdlib.h>
10888 # include <string.h>
10890 # include <strings.h>
10893 # include <unistd.h> /* Needed for NetBSD */
10899 if ((a < b) && memcmp(&a, &b, 1) < 0)
10905 if eval $compile_ok; then
10906 if ./try 2>/dev/null; then
10907 echo "Yes, it can."
10910 echo "No, it can't (it uses signed chars)."
10913 echo "(I can't compile the test program, so we'll assume not...)"
10917 $rm -f try.* try core
10921 : see if prototype for sbrk is available
10923 set d_sbrkproto sbrk $i_unistd unistd.h
10926 : see if select exists
10927 set select d_select
10930 : see if semctl exists
10931 set semctl d_semctl
10934 : see if semget exists
10935 set semget d_semget
10938 : see if semop exists
10942 : see how much of the 'sem*(2)' library is present.
10945 case "$d_semctl$d_semget$d_semop" in
10946 *"$undef"*) h_sem=false;;
10950 case "`ipcs 2>&1`" in
10951 "SVID messages"*"not configured"*)
10952 echo "Your $osname does not have the sem*(2) configured." >&4
10955 set semctl d_semctl
10957 set semget d_semget
10965 : we could also check for sys/ipc.h ...
10966 if $h_sem && $test `./findhdr sys/sem.h`; then
10967 echo "You have the full sem*(2) library." >&4
10970 echo "You don't have the full sem*(2) library." >&4
10976 : see whether sys/sem.h defines union semun
10978 $cat > try.c <<'END'
10979 #include <sys/types.h>
10980 #include <sys/ipc.h>
10981 #include <sys/sem.h>
10982 int main () { union semun semun; semun.buf = 0; }
10985 if eval $compile; then
10986 echo "You have union semun in <sys/sem.h>." >&4
10989 echo "You do not have union semun in <sys/sem.h>." >&4
10992 $rm -f try try.c try.h
10996 : see how to do semctl IPC_STAT
10999 : see whether semctl IPC_STAT can use union semun
11004 # define S_IRUSR S_IREAD
11005 # define S_IWUSR S_IWRITE
11006 # define S_IXUSR S_IEXEC
11008 # define S_IRUSR 0400
11009 # define S_IWUSR 0200
11010 # define S_IXUSR 0100
11012 # define S_IRGRP (S_IRUSR>>3)
11013 # define S_IWGRP (S_IWUSR>>3)
11014 # define S_IXGRP (S_IXUSR>>3)
11015 # define S_IROTH (S_IRUSR>>6)
11016 # define S_IWOTH (S_IWUSR>>6)
11017 # define S_IXOTH (S_IXUSR>>6)
11020 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
11021 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
11022 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
11027 #include <sys/types.h>
11028 #include <sys/ipc.h>
11029 #include <sys/sem.h>
11030 #include <sys/stat.h>
11037 #$d_union_semun HAS_UNION_SEMUN
11040 #ifndef HAS_UNION_SEMUN
11043 struct semid_ds *buf;
11044 unsigned short *array;
11050 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
11051 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
11053 struct semid_ds argbuf;
11056 st = semctl(sem, 0, IPC_STAT, arg);
11060 # endif /* IPC_STAT */
11061 printf("semctl IPC_STAT failed: errno = %d\n", errno);
11063 if (semctl(sem, 0, IPC_RMID, arg) != 0)
11064 # endif /* IPC_RMID */
11065 printf("semctl IPC_RMID failed: errno = %d\n", errno);
11067 #endif /* IPC_PRIVATE && ... */
11068 printf("semget failed: errno = %d\n", errno);
11074 if eval $compile; then
11077 semun) val="$define" ;;
11083 case "$d_semctl_semun" in
11085 echo "You can use union semun for semctl IPC_STAT." >&4
11088 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
11093 : see whether semctl IPC_STAT can use struct semid_ds pointer
11094 $cat > try.c <<'END'
11095 #include <sys/types.h>
11096 #include <sys/ipc.h>
11097 #include <sys/sem.h>
11098 #include <sys/stat.h>
11106 struct semid_ds arg;
11109 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
11110 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
11113 st = semctl(sem, 0, IPC_STAT, &arg);
11115 printf("semid_ds\n");
11117 # endif /* IPC_STAT */
11118 printf("semctl IPC_STAT failed: errno = %d\n", errno);
11120 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
11121 # endif /* IPC_RMID */
11122 printf("semctl IPC_RMID failed: errno = %d\n", errno);
11124 #endif /* IPC_PRIVATE && ... */
11125 printf("semget failed: errno = %d\n", errno);
11132 if eval $compile; then
11135 semid_ds) val="$define" ;;
11139 set d_semctl_semid_ds
11141 case "$d_semctl_semid_ds" in
11143 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
11145 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
11152 # We do not have the full sem*(2) library, so assume we can not
11158 set d_semctl_semid_ds
11163 : see if setegid exists
11164 set setegid d_setegid
11167 : see if seteuid exists
11168 set seteuid d_seteuid
11171 : see if setgrent exists
11172 set setgrent d_setgrent
11175 : see if sethostent exists
11176 set sethostent d_sethent
11179 : see if setlinebuf exists
11180 set setlinebuf d_setlinebuf
11183 : see if setlocale exists
11184 set setlocale d_setlocale
11187 : see if setnetent exists
11188 set setnetent d_setnent
11191 : see if setprotoent exists
11192 set setprotoent d_setpent
11195 : see if setpgid exists
11196 set setpgid d_setpgid
11199 : see if setpgrp2 exists
11200 set setpgrp2 d_setpgrp2
11203 : see if setpriority exists
11204 set setpriority d_setprior
11207 : see if setproctitle exists
11208 set setproctitle d_setproctitle
11211 : see if setpwent exists
11212 set setpwent d_setpwent
11215 : see if setregid exists
11216 set setregid d_setregid
11218 set setresgid d_setresgid
11221 : see if setreuid exists
11222 set setreuid d_setreuid
11224 set setresuid d_setresuid
11227 : see if setrgid exists
11228 set setrgid d_setrgid
11231 : see if setruid exists
11232 set setruid d_setruid
11235 : see if setservent exists
11236 set setservent d_setsent
11239 : see if setsid exists
11240 set setsid d_setsid
11243 : see if setvbuf exists
11244 set setvbuf d_setvbuf
11247 : see if sfio.h is available
11252 : see if sfio library is available
11263 : Ok, but do we want to use it.
11267 true|$define|[yY]*) dflt='y';;
11270 echo "$package can use the sfio library, but it is experimental."
11271 case "$useperlio" in
11273 echo "For sfio also the PerlIO abstraction layer is needed."
11274 echo "Earlier you said you wouldn't want that."
11277 rp="You seem to have sfio available, do you want to try using it?"
11280 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
11281 useperlio="$define"
11284 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
11286 : Remove sfio from list of libraries to use
11287 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
11290 echo "libs = $libs" >&4
11294 *) case "$usesfio" in
11295 true|$define|[yY]*)
11296 echo "Sorry, cannot find sfio on this machine." >&4
11297 echo "Ignoring your setting of usesfio=$usesfio." >&4
11306 $define) usesfio='true';;
11307 *) usesfio='false';;
11310 : see if shmctl exists
11311 set shmctl d_shmctl
11314 : see if shmget exists
11315 set shmget d_shmget
11318 : see if shmat exists
11321 : see what shmat returns
11324 $cat >shmat.c <<'END'
11325 #include <sys/shm.h>
11328 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
11333 echo "and it returns ($shmattype)." >&4
11334 : see if a prototype for shmat is available
11335 xxx=`./findhdr sys/shm.h`
11336 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
11337 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
11348 set d_shmatprototype
11351 : see if shmdt exists
11355 : see how much of the 'shm*(2)' library is present.
11358 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
11359 *"$undef"*) h_shm=false;;
11363 case "`ipcs 2>&1`" in
11364 "SVID shared memory"*"not configured"*)
11365 echo "Your $osname does not have the shm*(2) configured." >&4
11368 set shmctl d_shmctl
11370 set shmget d_shmget
11380 : we could also check for sys/ipc.h ...
11381 if $h_shm && $test `./findhdr sys/shm.h`; then
11382 echo "You have the full shm*(2) library." >&4
11385 echo "You don't have the full shm*(2) library." >&4
11392 : see if we have sigaction
11393 if set sigaction val -f d_sigaction; eval $csym; $val; then
11394 echo 'sigaction() found.' >&4
11395 $cat > try.c <<'EOP'
11397 #include <sys/types.h>
11398 #include <signal.h>
11401 struct sigaction act, oact;
11403 oact.sa_handler = 0;
11404 /* so that act and oact are used */
11405 exit(act.sa_flags == 0 && oact.sa_handler == 0);
11409 if eval $compile_ok; then
11412 echo "But you don't seem to have a useable struct sigaction." >&4
11416 echo 'sigaction NOT found.' >&4
11419 set d_sigaction; eval $setvar
11420 $rm -f try try$_o try.c
11422 : see if sigsetjmp exists
11424 case "$d_sigsetjmp" in
11426 $cat >try.c <<'EOP'
11427 #include <setjmp.h>
11432 if (sigsetjmp(env,1))
11435 siglongjmp(env, 1);
11440 if eval $compile; then
11441 if ./try >/dev/null 2>&1; then
11442 echo "POSIX sigsetjmp found." >&4
11446 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
11452 echo "sigsetjmp not found." >&4
11456 *) val="$d_sigsetjmp"
11457 case "$d_sigsetjmp" in
11458 $define) echo "POSIX sigsetjmp found." >&4;;
11459 $undef) echo "sigsetjmp not found." >&4;;
11467 : see if socks5_init exists
11468 set socks5_init d_socks5_init
11471 : see if sys/stat.h is available
11472 set sys/stat.h i_sysstat
11476 : see if stat knows about block sizes
11478 echo "Checking to see if your struct stat has st_blocks field..." >&4
11479 set d_statblks stat st_blocks $i_sysstat sys/stat.h
11483 : see if this is a sys/vfs.h system
11484 set sys/vfs.h i_sysvfs
11488 : see if this is a sys/statfs.h system
11489 set sys/statfs.h i_sysstatfs
11494 echo "Checking to see if your system supports struct statfs..." >&4
11495 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
11497 case "$d_statfs_s" in
11498 "$define") echo "Yes, it does." ;;
11499 *) echo "No, it doesn't." ;;
11504 : see if struct statfs knows about f_flags
11505 case "$d_statfs_s" in
11508 echo "Checking to see if your struct statfs has f_flags field..." >&4
11509 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
11513 set d_statfs_f_flags
11517 case "$d_statfs_f_flags" in
11518 "$define") echo "Yes, it does." ;;
11519 *) echo "No, it doesn't." ;;
11522 : see if _ptr and _cnt from stdio act std
11525 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
11526 echo "(Looks like you have stdio.h from BSD.)"
11527 case "$stdio_ptr" in
11528 '') stdio_ptr='((fp)->_p)'
11531 *) ptr_lval=$d_stdio_ptr_lval;;
11533 case "$stdio_cnt" in
11534 '') stdio_cnt='((fp)->_r)'
11537 *) cnt_lval=$d_stdio_cnt_lval;;
11539 case "$stdio_base" in
11540 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
11542 case "$stdio_bufsiz" in
11543 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
11545 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
11546 echo "(Looks like you have stdio.h from Linux.)"
11547 case "$stdio_ptr" in
11548 '') stdio_ptr='((fp)->_IO_read_ptr)'
11551 *) ptr_lval=$d_stdio_ptr_lval;;
11553 case "$stdio_cnt" in
11554 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
11557 *) cnt_lval=$d_stdio_cnt_lval;;
11559 case "$stdio_base" in
11560 '') stdio_base='((fp)->_IO_read_base)';;
11562 case "$stdio_bufsiz" in
11563 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
11566 case "$stdio_ptr" in
11567 '') stdio_ptr='((fp)->_ptr)'
11570 *) ptr_lval=$d_stdio_ptr_lval;;
11572 case "$stdio_cnt" in
11573 '') stdio_cnt='((fp)->_cnt)'
11576 *) cnt_lval=$d_stdio_cnt_lval;;
11578 case "$stdio_base" in
11579 '') stdio_base='((fp)->_base)';;
11581 case "$stdio_bufsiz" in
11582 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
11586 : test whether _ptr and _cnt really work
11587 echo "Checking how std your stdio is..." >&4
11590 #define FILE_ptr(fp) $stdio_ptr
11591 #define FILE_cnt(fp) $stdio_cnt
11593 FILE *fp = fopen("try.c", "r");
11596 18 <= FILE_cnt(fp) &&
11597 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
11605 if eval $compile; then
11607 echo "Your stdio acts pretty std."
11610 echo "Your stdio isn't very std."
11613 echo "Your stdio doesn't appear very std."
11619 : Can _ptr be used as an lvalue?
11620 case "$d_stdstdio$ptr_lval" in
11621 $define$define) val=$define ;;
11624 set d_stdio_ptr_lval
11627 : Can _cnt be used as an lvalue?
11628 case "$d_stdstdio$cnt_lval" in
11629 $define$define) val=$define ;;
11632 set d_stdio_cnt_lval
11636 : test whether setting _ptr sets _cnt as a side effect
11637 d_stdio_ptr_lval_sets_cnt="$undef"
11638 d_stdio_ptr_lval_nochange_cnt="$undef"
11639 case "$d_stdio_ptr_lval$d_stdstdio" in
11641 echo "Checking to see what happens if we set the stdio ptr..." >&4
11644 /* Can we scream? */
11645 /* Eat dust sed :-) */
11646 /* In the buffer space, no one can hear you scream. */
11647 #define FILE_ptr(fp) $stdio_ptr
11648 #define FILE_cnt(fp) $stdio_cnt
11649 #include <sys/types.h>
11651 FILE *fp = fopen("try.c", "r");
11656 puts("Fail even to read");
11659 c = getc(fp); /* Read away the first # */
11661 puts("Fail even to read");
11665 18 <= FILE_cnt(fp) &&
11666 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
11668 puts("Fail even to read");
11671 ptr = (char*) FILE_ptr(fp);
11672 cnt = (size_t)FILE_cnt(fp);
11674 FILE_ptr(fp) += 42;
11676 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
11677 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
11680 if (FILE_cnt(fp) <= 20) {
11681 printf ("Fail (<20 chars to test)");
11684 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
11685 puts("Fail compare");
11688 if (cnt == FILE_cnt(fp)) {
11689 puts("Pass_unchanged");
11692 if (FILE_cnt(fp) == (cnt - 42)) {
11693 puts("Pass_changed");
11696 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
11702 if eval $compile; then
11703 case `./try$exe_ext` in
11705 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
11706 d_stdio_ptr_lval_sets_cnt="$define" ;;
11708 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
11709 d_stdio_ptr_lval_nochange_cnt="$define" ;;
11711 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
11713 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
11716 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
11722 : see if _base is also standard
11724 case "$d_stdstdio" in
11728 #define FILE_base(fp) $stdio_base
11729 #define FILE_bufsiz(fp) $stdio_bufsiz
11731 FILE *fp = fopen("try.c", "r");
11734 19 <= FILE_bufsiz(fp) &&
11735 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
11742 if eval $compile; then
11744 echo "And its _base field acts std."
11747 echo "But its _base field isn't std."
11750 echo "However, it seems to be lacking the _base field."
11759 Checking how to access stdio streams by file descriptor number...
11761 case "$stdio_stream_array" in
11762 '') $cat >try.c <<EOCP
11765 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
11769 for s in _iob __iob __sF
11771 set try -DSTDIO_STREAM_ARRAY=$s
11772 if eval $compile; then
11773 case "`./try$exe_ext`" in
11774 yes) stdio_stream_array=$s; break ;;
11778 $rm -f try.* try$exe_ext
11780 case "$stdio_stream_array" in
11782 I can't figure out how to access stdio streams by file descriptor number.
11784 d_stdio_stream_array="$undef"
11787 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
11789 d_stdio_stream_array="$define"
11793 : see if strcoll exists
11794 set strcoll d_strcoll
11797 : check for structure copying
11799 echo "Checking to see if your C compiler can copy structs..." >&4
11800 $cat >try.c <<'EOCP'
11810 if $cc -c try.c >/dev/null 2>&1 ; then
11812 echo "Yup, it can."
11815 echo "Nope, it can't."
11821 : see if strerror and/or sys_errlist[] exist
11823 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
11824 if set strerror val -f d_strerror; eval $csym; $val; then
11825 echo 'strerror() found.' >&4
11826 d_strerror="$define"
11827 d_strerrm='strerror(e)'
11828 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
11829 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
11830 d_syserrlst="$define"
11832 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
11833 d_syserrlst="$undef"
11835 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
11836 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
11837 echo 'strerror() found in string header.' >&4
11838 d_strerror="$define"
11839 d_strerrm='strerror(e)'
11840 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
11841 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
11842 d_syserrlst="$define"
11844 echo "(You don't appear to have any sys_errlist[], how can this be?)"
11845 d_syserrlst="$undef"
11847 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
11848 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
11849 d_strerror="$undef"
11850 d_syserrlst="$define"
11851 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
11853 echo 'strerror() and sys_errlist[] NOT found.' >&4
11854 d_strerror="$undef"
11855 d_syserrlst="$undef"
11856 d_strerrm='"unknown"'
11860 : see if strtod exists
11861 set strtod d_strtod
11864 : see if strtol exists
11865 set strtol d_strtol
11868 : see if strtold exists
11869 set strtold d_strtold
11872 : see if strtoll exists
11873 set strtoll d_strtoll
11876 case "$d_longlong-$d_strtoll" in
11879 Checking whether your strtoll() works okay...
11881 $cat >try.c <<'EOCP'
11884 #define strtoll __strtoll
11887 #define strtoll _strtoll
11890 extern long long int strtoll(char *s, char **, int);
11891 static int bad = 0;
11892 int check(char *s, long long ell, int een) {
11895 gll = strtoll(s, 0, 10);
11896 if (!((gll == ell) && (errno == een)))
11900 check(" 1", 1LL, 0);
11901 check(" 0", 0LL, 0);
11902 check("-1", -1LL, 0);
11903 check("-9223372036854775808", -9223372036854775808LL, 0);
11904 check("-9223372036854775808", -9223372036854775808LL, 0);
11905 check(" 9223372036854775807", 9223372036854775807LL, 0);
11906 check("-9223372036854775808", -9223372036854775808LL, 0);
11907 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
11908 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
11914 if eval $compile; then
11917 ok) echo "Your strtoll() seems to be working okay." ;;
11919 Your strtoll() doesn't seem to be working okay.
11925 echo "(I can't seem to compile the test program--assuming it doesn't)"
11931 : see if strtoq exists
11932 set strtoq d_strtoq
11935 : see if strtoul exists
11936 set strtoul d_strtoul
11939 case "$d_strtoul" in
11942 Checking whether your strtoul() works okay...
11944 $cat >try.c <<'EOCP'
11947 extern unsigned long int strtoul(char *s, char **, int);
11948 static int bad = 0;
11949 void check(char *s, unsigned long eul, int een) {
11952 gul = strtoul(s, 0, 10);
11953 if (!((gul == eul) && (errno == een)))
11957 check(" 1", 1L, 0);
11958 check(" 0", 0L, 0);
11960 case "$longsize" in
11962 $cat >>try.c <<'EOCP'
11963 check("18446744073709551615", 18446744073709551615ULL, 0);
11964 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
11965 check("-1", 18446744073709551615ULL, 0);
11966 check("-18446744073709551614", 2, 0);
11967 check("-18446744073709551615", 1, 0);
11968 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
11969 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
11973 $cat >>try.c <<'EOCP'
11974 check("4294967295", 4294967295UL, 0);
11975 check("4294967296", 4294967295UL, ERANGE);
11976 check("-1", 4294967295UL, 0);
11977 check("-4294967294", 2, 0);
11978 check("-4294967295", 1, 0);
11979 check("-4294967296", 4294967295UL, ERANGE);
11980 check("-4294967297", 4294967295UL, ERANGE);
11984 : Should we write these tests to be more portable by sprintf-ing
11985 : ~0 and then manipulating that char string as input for strtol?
11988 $cat >>try.c <<'EOCP'
11995 if eval $compile; then
11997 ok) echo "Your strtoul() seems to be working okay." ;;
11999 Your strtoul() doesn't seem to be working okay.
12008 : see if strtoull exists
12009 set strtoull d_strtoull
12012 case "$d_longlong-$d_strtoull" in
12015 Checking whether your strtoull() works okay...
12017 $cat >try.c <<'EOCP'
12020 #define strtoull __strtoull
12023 extern unsigned long long int strtoull(char *s, char **, int);
12024 static int bad = 0;
12025 int check(char *s, long long eull, int een) {
12028 gull = strtoull(s, 0, 10);
12029 if (!((gull == eull) && (errno == een)))
12033 check(" 1", 1LL, 0);
12034 check(" 0", 0LL, 0);
12035 check("18446744073709551615", 18446744073709551615ULL, 0);
12036 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
12037 check("-1", 18446744073709551615ULL, 0);
12038 check("-18446744073709551614", 2LL, 0);
12039 check("-18446744073709551615", 1LL, 0);
12040 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
12041 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
12047 if eval $compile; then
12049 ok) echo "Your strtoull() seems to be working okay." ;;
12051 Your strtoull() doesn't seem to be working okay.
12053 d_strtoull="$undef"
12060 : see if strtouq exists
12061 set strtouq d_strtouq
12064 case "$d_strtouq" in
12067 Checking whether your strtouq() works okay...
12069 $cat >try.c <<'EOCP'
12072 extern unsigned long long int strtouq(char *s, char **, int);
12073 static int bad = 0;
12074 void check(char *s, unsigned long long eull, int een) {
12075 unsigned long long gull;
12077 gull = strtouq(s, 0, 10);
12078 if (!((gull == eull) && (errno == een)))
12082 check(" 1", 1LL, 0);
12083 check(" 0", 0LL, 0);
12084 check("18446744073709551615", 18446744073709551615ULL, 0);
12085 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
12086 check("-1", 18446744073709551615ULL, 0);
12087 check("-18446744073709551614", 2LL, 0);
12088 check("-18446744073709551615", 1LL, 0);
12089 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
12090 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
12097 if eval $compile; then
12099 ok) echo "Your strtouq() seems to be working okay." ;;
12101 Your strtouq() doesn't seem to be working okay.
12110 : see if strxfrm exists
12111 set strxfrm d_strxfrm
12114 : see if symlink exists
12115 set symlink d_symlink
12118 : see if syscall exists
12119 set syscall d_syscall
12122 : see if sysconf exists
12123 set sysconf d_sysconf
12126 : see if system exists
12127 set system d_system
12130 : see if tcgetpgrp exists
12131 set tcgetpgrp d_tcgetpgrp
12134 : see if tcsetpgrp exists
12135 set tcsetpgrp d_tcsetpgrp
12138 : see if prototype for telldir is available
12140 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
12143 : see if this is a sys/times.h system
12144 set sys/times.h i_systimes
12147 : see if times exists
12149 if set times val -f d_times; eval $csym; $val; then
12150 echo 'times() found.' >&4
12153 case "$i_systimes" in
12154 "$define") inc='sys/times.h';;
12156 rp="What is the type returned by times() on this system?"
12157 set clock_t clocktype long stdio.h sys/types.h $inc
12160 echo 'times() NOT found, hope that will do.' >&4
12165 : see if truncate exists
12166 set truncate d_truncate
12169 : see if tzname[] exists
12171 if set tzname val -a d_tzname; eval $csym; $val; then
12173 echo 'tzname[] found.' >&4
12176 echo 'tzname[] NOT found.' >&4
12181 : see if umask exists
12185 : see if ustat exists
12189 : backward compatibility for d_hvfork
12190 if test X$d_hvfork != X; then
12191 d_vfork="$d_hvfork"
12194 : see if there is a vfork
12199 : Ok, but do we want to use it. vfork is reportedly unreliable in
12200 : perl on Solaris 2.x, and probably elsewhere.
12204 case "$usevfork" in
12210 Perl can only use a vfork() that doesn't suffer from strict
12211 restrictions on calling functions or modifying global data in
12212 the child. For example, glibc-2.1 contains such a vfork()
12213 that is unsuitable. If your system provides a proper fork()
12214 call, chances are that you do NOT want perl to use vfork().
12217 rp="Do you still want to use vfork()?"
12222 echo "Ok, we won't use vfork()."
12231 $define) usevfork='true';;
12232 *) usevfork='false';;
12235 : see if this is an sysdir system
12236 set sys/dir.h i_sysdir
12239 : see if this is an sysndir system
12240 set sys/ndir.h i_sysndir
12243 : see if closedir exists
12244 set closedir d_closedir
12247 case "$d_closedir" in
12250 echo "Checking whether closedir() returns a status..." >&4
12251 cat > closedir.c <<EOM
12252 #$i_dirent I_DIRENT /**/
12253 #$i_sysdir I_SYS_DIR /**/
12254 #$i_sysndir I_SYS_NDIR /**/
12255 #$i_systypes I_SYS_TYPES /**/
12257 #if defined(I_SYS_TYPES)
12258 #include <sys/types.h>
12260 #if defined(I_DIRENT)
12261 #include <dirent.h>
12262 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
12263 #include <sys/dir.h>
12267 #include <sys/ndir.h>
12271 #include <ndir.h> /* may be wrong in the future */
12273 #include <sys/dir.h>
12278 int main() { return closedir(opendir(".")); }
12281 if eval $compile_ok; then
12282 if ./closedir > /dev/null 2>&1 ; then
12283 echo "Yes, it does."
12286 echo "No, it doesn't."
12290 echo "(I can't seem to compile the test program--assuming it doesn't)"
12298 set d_void_closedir
12301 : see if there is a wait4
12305 : see if waitpid exists
12306 set waitpid d_waitpid
12309 : see if wcstombs exists
12310 set wcstombs d_wcstombs
12313 : see if wctomb exists
12314 set wctomb d_wctomb
12317 : preserve RCS keywords in files with variable substitution, grrr
12322 Revision='$Revision'
12324 case "$crosscompile" in
12325 ''|[nN]*) crosscompile="$undef" ;;
12329 next|rhapsody|darwin) multiarch="$define" ;;
12331 case "$multiarch" in
12332 ''|[nN]*) multiarch="$undef" ;;
12335 : check for alignment requirements
12337 case "$crosscompile$multiarch" in
12340 You seem to be either cross-compiling or doing a multiarchitecture build,
12341 skipping the memory alignment check.
12344 case "$alignbytes" in
12345 '') alignbytes=8 ;;
12349 case "$alignbytes" in
12350 '') echo "Checking alignment constraints..." >&4
12351 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
12352 $cat >try.c <<'EOCP'
12353 typedef long double NV;
12356 $cat >try.c <<'EOCP'
12360 $cat >>try.c <<'EOCP'
12368 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
12373 if eval $compile_ok; then
12377 echo "(I can't seem to compile the test program...)"
12380 *) dflt="$alignbytes"
12383 rp="Doubles must be aligned on a how-many-byte boundary?"
12391 : set the base revision
12394 : check for ordering of bytes in a long
12396 case "$crosscompile$multiarch" in
12399 You seem to be either cross-compiling or doing a multiarchitecture build,
12400 skipping the byteorder check.
12406 case "$byteorder" in
12409 In the following, larger digits indicate more significance. A big-endian
12410 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
12411 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
12412 machines may have weird orders like 3412. A Cray will report 87654321,
12413 an Alpha will report 12345678. If the test program works the default is
12415 I'm now running the test program...
12417 $cat >try.c <<'EOCP'
12424 char c[sizeof(long)];
12427 if (sizeof(long) > 4)
12428 u.l = (0x08070605L << 32) | 0x04030201L;
12431 for (i = 0; i < sizeof(long); i++)
12432 printf("%c", u.c[i]+'0');
12439 if eval $compile && ./try > /dev/null; then
12442 [1-4][1-4][1-4][1-4]|12345678|87654321)
12443 echo "(The test program ran ok.)"
12444 echo "byteorder=$dflt"
12447 ????|????????) echo "(The test program ran ok.)" ;;
12448 *) echo "(The test program didn't run right for some reason.)" ;;
12453 (I can't seem to compile the test program. Guessing big-endian...)
12456 case "$xxx_prompt" in
12458 rp="What is the order of bytes in a long?"
12472 : how do we catenate cpp tokens here?
12474 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
12475 $cat >cpp_stuff.c <<'EOCP'
12476 #define RCAT(a,b)a/**/b
12477 #define ACAT(a,b)a ## b
12481 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
12482 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
12483 echo "Oh! Smells like ANSI's been here." >&4
12484 echo "We can catify or stringify, separately or together!"
12486 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
12487 echo "Ah, yes! The good old days!" >&4
12488 echo "However, in the good old days we don't know how to stringify and"
12489 echo "catify at the same time."
12493 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
12494 to have to edit the values of CAT[2-5] in config.h...
12496 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
12500 : see if this is a db.h system
12506 : Check db version.
12508 echo "Checking Berkeley DB version ..." >&4
12514 #include <sys/types.h>
12519 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
12520 int Major, Minor, Patch ;
12521 unsigned long Version ;
12522 (void)db_version(&Major, &Minor, &Patch) ;
12523 printf("You have Berkeley DB Version 2 or greater\n");
12525 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
12526 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
12527 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
12528 Major, Minor, Patch) ;
12530 /* check that db.h & libdb are compatible */
12531 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
12532 printf("db.h and libdb are incompatible\n") ;
12536 printf("db.h and libdb are compatible\n") ;
12538 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
12539 + DB_VERSION_PATCH ;
12541 /* needs to be >= 2.3.4 */
12542 if (Version < 2003004) {
12543 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
12544 printf("but Perl needs Berkeley DB 2.3.4 or greater\n") ;
12550 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
12551 printf("You have Berkeley DB Version 1\n");
12552 exit(0); /* DB version < 2: the coast is clear. */
12554 exit(1); /* <db.h> not Berkeley DB? */
12560 if eval $compile_ok && ./try; then
12561 echo 'Looks OK.' >&4
12563 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
12567 : Remove db from list of libraries to use
12568 echo "Removing unusable -ldb from library list" >&4
12569 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
12572 echo "libs = $libs" >&4
12582 : Check the return type needed for hash
12584 echo "Checking return type needed for hash for Berkeley DB ..." >&4
12590 #include <sys/types.h>
12593 #ifndef DB_VERSION_MAJOR
12594 u_int32_t hash_cb (ptr, size)
12602 info.hash = hash_cb;
12606 if $cc $ccflags -c try.c >try.out 2>&1 ; then
12607 if $contains warning try.out >>/dev/null 2>&1 ; then
12610 db_hashtype='u_int32_t'
12613 : XXX Maybe we should just give up here.
12614 db_hashtype=u_int32_t
12616 echo "Help: I can't seem to compile the db test program." >&4
12617 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
12620 echo "Your version of Berkeley DB uses $db_hashtype for hash."
12622 *) db_hashtype=u_int32_t
12627 : Check the return type needed for prefix
12629 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
12635 #include <sys/types.h>
12638 #ifndef DB_VERSION_MAJOR
12639 size_t prefix_cb (key1, key2)
12647 info.prefix = prefix_cb;
12651 if $cc $ccflags -c try.c >try.out 2>&1 ; then
12652 if $contains warning try.out >>/dev/null 2>&1 ; then
12653 db_prefixtype='int'
12655 db_prefixtype='size_t'
12658 db_prefixtype='size_t'
12659 : XXX Maybe we should just give up here.
12661 echo "Help: I can't seem to compile the db test program." >&4
12662 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
12665 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
12667 *) db_prefixtype='size_t'
12671 : check for void type
12673 echo "Checking to see how well your C compiler groks the void type..." >&4
12674 case "$voidflags" in
12676 $cat >try.c <<'EOCP'
12682 extern void moo(); /* function returning void */
12683 void (*goo)(); /* ptr to func returning void */
12685 void *hue; /* generic ptr */
12698 int main() { sub(); }
12700 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
12701 voidflags=$defvoidused
12702 echo "Good. It appears to support void to the level $package wants.">&4
12703 if $contains warning .out >/dev/null 2>&1; then
12704 echo "However, you might get some warnings that look like this:"
12708 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
12709 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
12710 echo "It supports 1..."
12711 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
12712 echo "It also supports 2..."
12713 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
12715 echo "And it supports 4 but not 8 definitely."
12717 echo "It doesn't support 4..."
12718 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
12720 echo "But it supports 8."
12723 echo "Neither does it support 8."
12727 echo "It does not support 2..."
12728 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
12730 echo "But it supports 4 and 8."
12732 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
12734 echo "And it supports 4 but has not heard about 8."
12736 echo "However it supports 8 but not 4."
12741 echo "There is no support at all for void."
12746 case "$voidflags" in
12748 *) $cat >&4 <<'EOM'
12749 Support flag bits are:
12750 1: basic void declarations.
12751 2: arrays of pointers to functions returning void.
12752 4: operations between pointers to and addresses of void functions.
12753 8: generic void pointers.
12756 rp="Your void support flags add up to what?"
12764 : How can we generate normalized random numbers ?
12766 echo "Looking for a random number function..." >&4
12767 case "$randfunc" in
12769 if set drand48 val -f; eval $csym; $val; then
12771 echo "Good, found drand48()." >&4
12772 elif set random val -f; eval $csym; $val; then
12774 echo "OK, found random()." >&4
12777 echo "Yick, looks like I have to use rand()." >&4
12788 *-Dmy_rand=*|*-Dmy_srand=*)
12789 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
12790 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
12791 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
12792 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
12796 while $test "$cont"; do
12797 rp="Use which function to generate random numbers?"
12799 if $test "$ans" = "$dflt"; then
12805 if set $ans val -f; eval $csym; $val; then
12809 rp="I cannot find function $ans. Use that name anyway?"
12818 case "$randfunc" in
12820 drand01="drand48()"
12826 case "$randbits" in
12828 echo "Checking to see how many bits your $randfunc() function produces..." >&4
12830 #$i_unistd I_UNISTD
12831 #$i_stdlib I_STDLIB
12834 # include <unistd.h>
12837 # include <stdlib.h>
12842 register unsigned long tmp;
12843 register unsigned long max = 0L;
12845 for (i = 1000; i; i--) {
12846 tmp = (unsigned long) $randfunc();
12847 if (tmp > max) max = tmp;
12849 for (i = 0; max; i++)
12855 if eval $compile_ok; then
12859 echo "(I can't seem to compile the test program...)"
12866 rp="How many bits does your $randfunc() function produce?"
12870 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
12871 seedfunc="s$randfunc"
12872 randseedtype=unsigned
12876 rp="How many bits does your $randfunc() function produce?"
12879 seedfunc="s$randfunc"
12880 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
12881 if set $seedfunc val -f; eval $csym; $val; then
12882 echo "(Using $seedfunc() to seed random generator)"
12884 echo "(Warning: no $seedfunc() to seed random generator)"
12887 randseedtype=unsigned
12895 echo "Determining whether or not we are on an EBCDIC system..." >&4
12896 $cat >tebcdic.c <<'EOM'
12899 if ('M'==0xd4) return 0;
12906 if eval $compile_ok; then
12908 echo "You seem to speak EBCDIC." >&4
12911 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF8." >&4
12914 echo "I'm unable to compile the test program." >&4
12915 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
12917 $rm -f tebcdic.c tebcdic
12923 Checking how to flush all pending stdio output...
12925 # I only know how to find the first 32 possibly open files on SunOS.
12926 # See also hints/sunos_4_1.sh and util.c --AD
12928 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
12930 $cat >>try.c <<EOCP
12932 #$i_unistd I_UNISTD
12934 # include <unistd.h>
12936 #$d_sysconf HAS_SYSCONF
12937 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
12938 #ifdef HAS_STDIO_STREAM_ARRAY
12939 # define STDIO_STREAM_ARRAY $stdio_stream_array
12942 FILE* p = fopen("try.out", "w");
12946 # ifdef TRY_FPRINTF
12950 #ifdef TRY_FFLUSH_NULL
12953 #ifdef TRY_FFLUSH_ALL
12955 long open_max = -1;
12956 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
12957 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
12959 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
12960 open_max = sysconf(_SC_OPEN_MAX);
12963 open_max = FOPEN_MAX;
12966 open_max = OPEN_MAX;
12975 # ifdef HAS_STDIO_STREAM_ARRAY
12976 if (open_max > 0) {
12978 for (i = 0; i < open_max; i++)
12979 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
12980 STDIO_STREAM_ARRAY[i]._file < open_max &&
12981 STDIO_STREAM_ARRAY[i]._flag)
12982 fflush(&STDIO_STREAM_ARRAY[i]);
12990 : first we have to find out how _not_ to flush
12991 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
12993 set try -DTRY_FPUTC
12994 if eval $compile; then
12996 ./try$exe_ext 2>/dev/null
12997 if $test ! -s try.out -a "X$?" = X42; then
13003 set try -DTRY_FPRINTF
13005 if eval $compile; then
13007 ./try$exe_ext 2>/dev/null
13008 if $test ! -s try.out -a "X$?" = X42; then
13009 output=-DTRY_FPRINTF
13015 : check for fflush NULL behaviour
13016 case "$fflushNULL" in
13017 '') set try -DTRY_FFLUSH_NULL $output
13018 if eval $compile; then
13020 ./try$exe_ext 2>/dev/null
13022 if $test -s try.out -a "X$code" = X42; then
13023 fflushNULL="`$cat try.out`"
13025 if $test "X$code" != X42; then
13027 (If this test failed, don't worry, we'll try another method shortly.)
13032 $rm -f core try.core core.try.*
13033 case "$fflushNULL" in
13035 Your fflush(NULL) works okay for output streams.
13036 Let's see if it clobbers input pipes...
13038 # As of mid-March 2000 all versions of Solaris appear to have a stdio
13039 # bug that improperly flushes the input end of pipes. So we avoid the
13040 # autoflush on fork/system/exec support for now. :-(
13041 $cat >tryp.c <<EOCP
13044 main(int argc, char **argv)
13050 while ((i = getc(stdin)) != -1
13051 && (*bp++ = i) != '\n'
13052 && bp < &buf[1024])
13055 fprintf(stdout, "%s", buf);
13063 fflushNULL="$define"
13065 if eval $compile; then
13067 $cat tryp.c | ./tryp$exe_ext 2>/dev/null > tryp.out
13068 if cmp tryp.c tryp.out >/dev/null 2>&1; then
13070 fflush(NULL) seems to behave okay with input streams.
13072 fflushNULL="$define"
13075 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
13077 fflushNULL="$undef"
13080 $rm -f core tryp.c tryp.core core.tryp.*
13083 Your fflush(NULL) isn't working (contrary to ANSI C).
13085 fflushNULL="$undef"
13088 Cannot figure out whether your fflush(NULL) works or not.
13089 I'm assuming it doesn't (contrary to ANSI C).
13091 fflushNULL="$undef"
13095 $define|true|[yY]*)
13096 fflushNULL="$define"
13099 fflushNULL="$undef"
13102 : check explicit looping only if NULL did not work, and if the pipe
13103 : bug does not show up on an explicit flush too
13104 case "$fflushNULL" in
13106 $cat >tryp.c <<EOCP
13109 main(int argc, char **argv)
13115 while ((i = getc(stdin)) != -1
13116 && (*bp++ = i) != '\n'
13117 && bp < &buf[1024])
13120 fprintf(stdout, "%s", buf);
13129 if eval $compile; then
13131 $cat tryp.c | ./tryp$exe_ext 2>/dev/null > tryp.out
13132 if cmp tryp.c tryp.out >/dev/null 2>&1; then
13134 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
13136 : now check for fflushall behaviour
13137 case "$fflushall" in
13138 '') set try -DTRY_FFLUSH_ALL $output
13139 if eval $compile; then
13141 (Now testing the other method--but note that this also may fail.)
13144 ./try$exe_ext 2>/dev/null
13145 if $test -s try.out -a "X$?" = X42; then
13146 fflushall="`$cat try.out`"
13149 $rm -f core try.core core.try.*
13150 case "$fflushall" in
13152 Whew. Flushing explicitly all the stdio streams works.
13154 fflushall="$define"
13157 Sigh. Flushing explicitly all the stdio streams doesn't work.
13162 Cannot figure out whether flushing stdio streams explicitly works or not.
13163 I'm assuming it doesn't.
13169 "$define"|true|[yY]*)
13170 fflushall="$define"
13178 All is futile. Even fflush(stdin) clobbers input pipes!
13185 $rm -f core tryp.c tryp.core core.tryp.*
13187 *) fflushall="$undef"
13191 case "$fflushNULL$fflushall" in
13194 OK, I give up. I cannot figure out how to flush pending stdio output.
13195 We won't be flushing handles at all before fork/exec/popen.
13199 $rm -f try.* try$exe_ext
13201 : Store the full pathname to the ar program for use in the C program
13202 : Respect a hint or command line value for full_ar.
13207 : Store the full pathname to the sed program for use in the C program
13210 : see what type gids are declared as in the kernel
13212 echo "Looking for the type for group ids returned by getgid()."
13213 set gid_t gidtype xxx stdio.h sys/types.h
13217 xxx=`./findhdr sys/user.h`
13218 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
13220 unsigned) dflt="$1 $2" ;;
13224 *) dflt="$gidtype";;
13227 gid_t) echo "gid_t found." ;;
13228 *) rp="What is the type for group ids returned by getgid()?"
13236 *_t) zzz="$gidtype" ;;
13239 echo "Checking the size of $zzz..." >&4
13241 #include <sys/types.h>
13244 printf("%d\n", (int)sizeof($gidtype));
13249 if eval $compile_ok; then
13253 echo "(I can't execute the test program--guessing $gidsize.)" >&4
13256 echo "Your $zzz is $gidsize bytes long."
13261 echo "(I can't compile the test program--guessing $gidsize.)" >&4
13267 *_t) zzz="$gidtype" ;;
13270 echo "Checking the sign of $zzz..." >&4
13272 #include <sys/types.h>
13283 if eval $compile; then
13287 echo "(I can't execute the test program--guessing unsigned.)" >&4
13291 1) echo "Your $zzz is unsigned." ;;
13292 -1) echo "Your $zzz is signed." ;;
13298 echo "(I can't compile the test program--guessing unsigned.)" >&4
13304 if $test X"$quadtype" != X; then
13306 echo "Checking how to print 64-bit integers..." >&4
13308 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
13309 $cat >try.c <<'EOCP'
13310 #include <sys/types.h>
13313 int q = 12345678901;
13314 printf("%ld\n", q);
13318 if eval $compile; then
13319 yyy=`./try$exe_ext`
13322 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
13323 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
13324 echo "We will use %d."
13330 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
13331 $cat >try.c <<'EOCP'
13332 #include <sys/types.h>
13335 long q = 12345678901;
13336 printf("%ld\n", q);
13340 if eval $compile; then
13341 yyy=`./try$exe_ext`
13344 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
13345 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
13346 echo "We will use %ld."
13352 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
13353 $cat >try.c <<'EOCP'
13354 #include <sys/types.h>
13355 #include <inttypes.h>
13358 int64_t q = 12345678901;
13359 printf("%" PRId64 "\n", q);
13363 if eval $compile; then
13364 yyy=`./try$exe_ext`
13367 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
13368 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
13369 echo "We will use the C9X style."
13375 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
13376 $cat >try.c <<'EOCP'
13377 #include <sys/types.h>
13380 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
13381 printf("%lld\n", q);
13385 if eval $compile; then
13386 yyy=`./try$exe_ext`
13389 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
13390 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
13391 echo "We will use the %lld style."
13397 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
13399 #include <sys/types.h>
13402 $quadtype q = 12345678901;
13403 printf("%Ld\n", q);
13407 if eval $compile; then
13408 yyy=`./try$exe_ext`
13411 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
13412 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
13413 echo "We will use %Ld."
13419 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
13421 #include <sys/types.h>
13424 $quadtype q = 12345678901;
13425 printf("%qd\n", q);
13429 if eval $compile; then
13430 yyy=`./try$exe_ext`
13433 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
13434 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
13435 echo "We will use %qd."
13441 if $test X"$sPRId64" = X; then
13442 echo "Cannot figure out how to print 64-bit integers." >&4
13450 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
13451 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
13453 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
13454 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
13460 $echo "Checking the format strings to be used for Perl's internal types..." >&4
13462 if $test X"$ivsize" = X8; then
13463 ivdformat="$sPRId64"
13464 uvuformat="$sPRIu64"
13465 uvoformat="$sPRIo64"
13466 uvxformat="$sPRIx64"
13467 uvXUformat="$sPRIXU64"
13469 if $test X"$ivsize" = X"$longsize"; then
13476 if $test X"$ivsize" = X"$intsize"; then
13484 if $test X"$ivsize" = X"$shortsize"; then
13495 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
13496 nveformat="$sPRIeldbl"
13497 nvfformat="$sPRIfldbl"
13498 nvgformat="$sPRIgldbl"
13499 nvEUformat="$sPRIEUldbl"
13500 nvFUformat="$sPRIFUldbl"
13501 nvGUformat="$sPRIGUldbl"
13511 case "$ivdformat" in
13512 '') echo "$0: Fatal: failed to find format strings, cannot continue." >& 4
13519 $echo "Checking the format string to be used for gids..." >&4
13522 -1) if $test X"$gidsize" = X"$ivsize"; then
13523 gidformat="$ivdformat"
13525 if $test X"$gidsize" = X"$longsize"; then
13528 if $test X"$gidsize" = X"$intsize"; then
13531 if $test X"$gidsize" = X"$shortsize"; then
13538 *) if $test X"$gidsize" = X"$uvsize"; then
13539 gidformat="$uvuformat"
13541 if $test X"$gidsize" = X"$longsize"; then
13544 if $test X"$gidsize" = X"$intsize"; then
13547 if $test X"$gidsize" = X"$shortsize"; then
13556 : see if getgroups exists
13557 set getgroups d_getgrps
13560 : see if setgroups exists
13561 set setgroups d_setgrps
13565 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
13567 case "$d_getgrps$d_setgrps" in
13569 case "$groupstype" in
13570 '') dflt="$gidtype" ;;
13571 *) dflt="$groupstype" ;;
13574 What type of pointer is the second argument to getgroups() and setgroups()?
13575 Usually this is the same as group ids, $gidtype, but not always.
13578 rp='What type pointer is the second argument to getgroups() and setgroups()?'
13582 *) groupstype="$gidtype";;
13586 echo "Checking if your $make program sets \$(MAKE)..." >&4
13587 case "$make_set_make" in
13589 $sed 's/^X //' > testmake.mak << 'EOF'
13591 X @echo 'maketemp="$(MAKE)"'
13593 case "`$make -f testmake.mak 2>/dev/null`" in
13594 *maketemp=*) make_set_make='#' ;;
13595 *) make_set_make="MAKE=$make" ;;
13597 $rm -f testmake.mak
13600 case "$make_set_make" in
13601 '#') echo "Yup, it does.";;
13602 *) echo "Nope, it doesn't.";;
13605 : see what type is used for mode_t
13606 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
13607 set mode_t modetype int stdio.h sys/types.h
13610 : see if stdarg is available
13612 if $test `./findhdr stdarg.h`; then
13613 echo "<stdarg.h> found." >&4
13616 echo "<stdarg.h> NOT found." >&4
13620 : see if varags is available
13622 if $test `./findhdr varargs.h`; then
13623 echo "<varargs.h> found." >&4
13625 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
13628 : set up the varargs testing programs
13629 $cat > varargs.c <<EOP
13631 #include <stdarg.h>
13634 #include <varargs.h>
13638 int f(char *p, ...)
13652 p = va_arg(ap, char *);
13657 $cat > varargs <<EOP
13659 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
13668 : now check which varargs header should be included
13673 if `./varargs I_STDARG`; then
13675 elif `./varargs I_VARARGS`; then
13680 if `./varargs I_VARARGS`; then
13687 echo "I could not find the definition for va_dcl... You have problems..." >&4
13688 val="$undef"; set i_stdarg; eval $setvar
13689 val="$undef"; set i_varargs; eval $setvar
13694 case "$i_varhdr" in
13696 val="$define"; set i_stdarg; eval $setvar
13697 val="$undef"; set i_varargs; eval $setvar
13700 val="$undef"; set i_stdarg; eval $setvar
13701 val="$define"; set i_varargs; eval $setvar
13704 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
13708 : see if we need va_copy
13710 case "$i_stdarg" in
13713 #include <stdarg.h>
13715 #$i_stdlib I_STDLIB
13717 #include <stdlib.h>
13719 #include <signal.h>
13722 ivfprintf(FILE *f, const char *fmt, va_list *valp)
13724 return vfprintf(f, fmt, *valp);
13728 myvfprintf(FILE *f, const char *fmt, va_list val)
13730 return ivfprintf(f, fmt, &val);
13734 myprintf(char *fmt, ...)
13737 va_start(val, fmt);
13738 return myvfprintf(stdout, fmt, val);
13742 main(int ac, char **av)
13744 signal(SIGSEGV, exit);
13746 myprintf("%s%cs all right, then\n", "that", '\'');
13751 if eval $compile && ./try 2>&1 >/dev/null; then
13753 "that's all right, then")
13759 yes) echo "It seems that you don't need va_copy()." >&4
13760 need_va_copy="$undef"
13762 *) echo "It seems that va_copy() or similar will be needed." >&4
13763 need_va_copy="$define"
13766 $rm -f try.* core core.* *.core *.core.*
13768 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
13772 : define a fucntion to check prototypes
13773 $cat > protochk <<EOSH
13776 optimize="$optimize"
13778 prototype="$prototype"
13783 $cat >> protochk <<'EOSH'
13788 while test $# -ge 2; do
13790 $define) echo "#include <$2>" >> try.c ;;
13791 literal) echo "$2" >> try.c ;;
13795 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
13796 cat >> try.c <<'EOCP'
13797 #ifdef CAN_PROTOTYPE
13798 #define _(args) args
13803 echo "$foo" >> try.c
13804 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
13805 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
13811 $eunicefix protochk
13813 : see what type is used for size_t
13814 rp="What is the type used for the length parameter for string functions?"
13815 set size_t sizetype 'unsigned int' stdio.h sys/types.h
13818 : check for type of arguments to gethostbyaddr.
13819 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
13820 case "$d_gethbyaddr" in
13824 Checking to see what type of arguments are accepted by gethostbyaddr().
13826 hdrs="$define sys/types.h
13827 $d_socket sys/socket.h
13828 $i_niin netinet/in.h
13830 $i_unistd unistd.h"
13831 : The first arg can 'char *' or 'void *'
13832 : The second arg is some of integral type
13833 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
13834 for yyy in size_t long int; do
13835 case "$netdb_host_type" in
13836 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
13837 if ./protochk "$try" $hdrs; then
13838 echo "Your system accepts $xxx for the first arg."
13839 echo "...and $yyy for the second arg."
13840 netdb_host_type="$xxx"
13841 netdb_hlen_type="$yyy"
13847 : In case none of those worked, prompt the user.
13848 case "$netdb_host_type" in
13849 '') rp='What is the type for the 1st argument to gethostbyaddr?'
13852 netdb_host_type=$ans
13853 rp='What is the type for the 2nd argument to gethostbyaddr?'
13856 netdb_hlen_type=$ans
13860 *) : no gethostbyaddr, so pick harmless defaults
13861 netdb_host_type='char *'
13862 netdb_hlen_type="$sizetype"
13865 # Remove the "const" if needed. -- but then we'll have a
13867 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
13870 : check for type of argument to gethostbyname.
13871 if test "X$netdb_name_type" = X ; then
13872 case "$d_gethbyname" in
13876 Checking to see what type of argument is accepted by gethostbyname().
13878 hdrs="$define sys/types.h
13879 $d_socket sys/socket.h
13880 $i_niin netinet/in.h
13882 $i_unistd unistd.h"
13883 for xxx in "const char *" "char *"; do
13884 case "$netdb_name_type" in
13885 '') try="extern struct hostent *gethostbyname($xxx);"
13886 if ./protochk "$try" $hdrs; then
13887 echo "Your system accepts $xxx."
13888 netdb_name_type="$xxx"
13893 : In case none of those worked, prompt the user.
13894 case "$netdb_name_type" in
13895 '') rp='What is the type for the 1st argument to gethostbyname?'
13898 netdb_name_type=$ans
13902 *) : no gethostbyname, so pick harmless default
13903 netdb_name_type='char *'
13908 : check for type of 1st argument to getnetbyaddr.
13909 if test "X$netdb_net_type" = X ; then
13910 case "$d_getnbyaddr" in
13914 Checking to see what type of 1st argument is accepted by getnetbyaddr().
13916 hdrs="$define sys/types.h
13917 $d_socket sys/socket.h
13918 $i_niin netinet/in.h
13920 $i_unistd unistd.h"
13921 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
13922 case "$netdb_net_type" in
13923 '') try="extern struct netent *getnetbyaddr($xxx, int);"
13924 if ./protochk "$try" $hdrs; then
13925 echo "Your system accepts $xxx."
13926 netdb_net_type="$xxx"
13931 : In case none of those worked, prompt the user.
13932 case "$netdb_net_type" in
13933 '') rp='What is the type for the 1st argument to getnetbyaddr?'
13936 netdb_net_type=$ans
13940 *) : no getnetbyaddr, so pick harmless default
13941 netdb_net_type='long'
13945 : locate the preferred pager for this system
13951 [a-zA-Z]:/*) dflt=$pg;;
13955 [a-zA-Z]:/*) dflt=$more;;
13959 [a-zA-Z]:/*) dflt=$less;;
13962 '') dflt=/usr/ucb/more;;
13969 rp='What pager is used on your system?'
13973 : see what type pids are declared as in the kernel
13974 rp="What is the type of process ids on this system?"
13975 set pid_t pidtype int stdio.h sys/types.h
13978 : Find earliest binary compatible site_perl subdirectory perl can use.
13979 case "$bincompat5005" in
13980 "$define") xs_apiversion='5.005' ;;
13981 *) xs_apiversion=$version ;; # The current site_perl version.
13983 : Find earliest pure perl site_perl subdirectory perl can use.
13984 : The versioned directories started at 5.005.
13985 pm_apiversion='5.005'
13987 : check for length of pointer
13991 echo "Checking to see how big your pointers are..." >&4
13992 if test "$voidflags" -gt 7; then
13993 echo '#define VOID_PTR char *' > try.c
13995 echo '#define VOID_PTR void *' > try.c
13997 $cat >>try.c <<'EOCP'
14001 printf("%d\n", (int)sizeof(VOID_PTR));
14006 if eval $compile_ok; then
14008 echo "Your pointers are $ptrsize bytes long."
14011 echo "(I can't seem to compile the test program. Guessing...)" >&4
14012 rp="What is the size of a pointer (in bytes)?"
14020 : see if ar generates random libraries by itself
14022 echo "Checking how to generate random libraries on your machine..." >&4
14023 echo 'int bar1() { return bar2(); }' > bar1.c
14024 echo 'int bar2() { return 2; }' > bar2.c
14025 $cat > foo.c <<'EOP'
14026 int main() { printf("%d\n", bar1()); exit(0); }
14028 $cc $ccflags -c bar1.c >/dev/null 2>&1
14029 $cc $ccflags -c bar2.c >/dev/null 2>&1
14030 $cc $ccflags -c foo.c >/dev/null 2>&1
14031 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
14032 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
14033 ./foobar >/dev/null 2>&1; then
14034 echo "$ar appears to generate random libraries itself."
14037 elif $ar ts bar$_a >/dev/null 2>&1 &&
14038 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
14039 ./foobar >/dev/null 2>&1; then
14040 echo "a table of contents needs to be added with '$ar ts'."
14047 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
14048 $test -f $ranlib || ranlib=''
14051 if $test -n "$ranlib"; then
14052 echo "your system has '$ranlib'; we'll use that."
14055 echo "your system doesn't seem to support random libraries"
14056 echo "so we'll use lorder and tsort to order the libraries."
14063 : check for type of arguments to select.
14064 case "$selecttype" in
14065 '') case "$d_select" in
14069 Checking to see what type of arguments are accepted by select().
14071 hdrs="$define sys/types.h
14072 $i_systime sys/time.h
14073 $i_sysselct sys/select.h
14074 $d_socket sys/socket.h"
14075 : The first arg can be int, unsigned, or size_t
14076 : The last arg may or may not be 'const'
14078 : void pointer has been seen but using that
14079 : breaks the selectminbits test
14080 for xxx in 'fd_set *' 'int *'; do
14081 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
14082 for tmo in 'struct timeval *' 'const struct timeval *'; do
14084 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
14085 if ./protochk "$try" $hdrs; then
14086 echo "Your system accepts $xxx."
14095 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
14096 case "$d_fd_set" in
14097 $define) dflt="fd_set *" ;;
14106 *) : no select, so pick a harmless default
14113 : check for the select 'width'
14114 case "$selectminbits" in
14115 '') case "$d_select" in
14119 Checking to see on how many bits at a time your select() operates...
14122 #include <sys/types.h>
14124 #$i_systime I_SYS_TIME
14125 #$i_systimek I_SYS_TIME_KERNEL
14130 # ifdef I_SYS_TIME_KERNEL
14133 # include <sys/time.h>
14134 # ifdef I_SYS_TIME_KERNEL
14138 #$i_sysselct I_SYS_SELECT
14139 #ifdef I_SYS_SELECT
14140 #include <sys/select.h>
14142 #$d_socket HAS_SOCKET
14144 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
14148 #define S sizeof(*(b))
14150 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
14151 #define NBITS (NBYTES * 8)
14160 fp = fopen("try.c", "r");
14166 b = ($selecttype)s;
14167 for (i = 0; i < NBITS; i++)
14171 select(fd + 1, b, 0, 0, &t);
14172 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
14173 printf("%d\n", i + 1);
14178 if eval $compile_ok; then
14179 selectminbits=`./try`
14180 case "$selectminbits" in
14182 Cannot figure out on how many bits at a time your select() operates.
14183 I'll play safe and guess it is 32 bits.
14189 *) bits="$selectminbits bits" ;;
14191 echo "Your select() operates on $bits at a time." >&4
14193 rp='What is the minimum number of bits your select() operates on?'
14194 case "$byteorder" in
14195 1234|12345678) dflt=32 ;;
14200 selectminbits="$val"
14204 *) : no select, so pick a harmless default
14211 : Trace out the files included by signal.h, then look for SIGxxx names.
14212 : Remove SIGARRAYSIZE used by HPUX.
14213 : Remove SIGSTKSIZE used by Linux.
14214 : Remove SIGSTKSZ used by Posix.
14215 : Remove SIGTYP void lines used by OS2.
14216 : Some cpps, like os390, dont give the file name anywhere
14217 if [ "X$fieldn" = X ]; then
14218 : Just make some guesses. We check them later.
14219 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
14221 xxx=`echo '#include <signal.h>' |
14222 $cppstdin $cppminus $cppflags 2>/dev/null |
14223 $grep '^[ ]*#.*include' |
14224 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq`
14226 : Check this list of files to be sure we have parsed the cpp output ok.
14227 : This will also avoid potentially non-existent files, such
14230 for xx in $xxx /dev/null ; do
14231 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
14233 : If we have found no files, at least try signal.h
14234 case "$xxxfiles" in
14235 '') xxxfiles=`./findhdr signal.h` ;;
14238 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
14239 print substr($2, 4, 20)
14241 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
14242 print substr($3, 4, 20)
14244 : Append some common names just in case the awk scan failed.
14245 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
14246 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
14247 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
14248 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
14249 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
14251 : generate a few handy files for later
14252 $cat > signal.c <<'EOCP'
14253 #include <sys/types.h>
14254 #include <signal.h>
14258 /* Strange style to avoid deeply-nested #if/#else/#endif */
14261 # define NSIG (_NSIG)
14267 # define NSIG (SIGMAX+1)
14273 # define NSIG (SIG_MAX+1)
14279 # define NSIG (MAXSIG+1)
14285 # define NSIG (MAX_SIG+1)
14290 # ifdef SIGARRAYSIZE
14291 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
14297 # define NSIG (_sys_nsig) /* Solaris 2.5 */
14301 /* Default to some arbitrary number that's big enough to get most
14302 of the common signals.
14308 printf("NSIG %d\n", NSIG);
14314 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
14316 printf "#ifdef SIG"; printf $1; printf "\n"
14317 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
14318 printf $1; printf ");\n"
14322 printf "#endif /* JUST_NSIG */\n";
14323 printf "exit(0);\n}\n";
14326 $cat >signal.awk <<'EOP'
14327 BEGIN { ndups = 0 }
14328 $1 ~ /^NSIG$/ { nsig = $2 }
14329 ($1 !~ /^NSIG$/) && (NF == 2) {
14330 if ($2 > maxsig) { maxsig = $2 }
14331 if (sig_name[$2]) {
14332 dup_name[ndups] = $1
14333 dup_num[ndups] = $2
14345 printf("NSIG %d\n", nsig);
14346 for (n = 1; n < nsig; n++) {
14348 printf("%s %d\n", sig_name[n], sig_num[n])
14351 printf("NUM%d %d\n", n, n)
14354 for (n = 0; n < ndups; n++) {
14355 printf("%s %d\n", dup_name[n], dup_num[n])
14359 $cat >signal_cmd <<EOS
14361 if $test -s signal.lst; then
14362 echo "Using your existing signal.lst file"
14367 $cat >>signal_cmd <<'EOS'
14370 if eval $compile_ok; then
14371 ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
14373 echo "(I can't seem be able to compile the whole test program)" >&4
14374 echo "(I'll try it in little pieces.)" >&4
14375 set signal -DJUST_NSIG
14376 if eval $compile_ok; then
14377 ./signal$_exe > signal.nsg
14380 echo "I can't seem to figure out how many signals you have." >&4
14381 echo "Guessing 50." >&4
14382 echo 'NSIG 50' > signal.nsg
14384 : Now look at all the signal names, one at a time.
14385 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
14386 $cat > signal.c <<EOCP
14387 #include <sys/types.h>
14388 #include <signal.h>
14391 printf("$xx %d\n", SIG${xx});
14396 if eval $compile; then
14397 echo "SIG${xx} found."
14398 ./signal$_exe >> signal.ls1
14400 echo "SIG${xx} NOT found."
14403 if $test -s signal.ls1; then
14404 $cat signal.nsg signal.ls1 |
14405 $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
14409 if $test -s signal.lst; then
14412 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
14413 echo 'kill -l' >signal
14414 set X `csh -f <signal`
14418 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
14420 echo $@ | $tr ' ' $trnl | \
14421 $awk '{ printf "%s %d\n", $1, ++s; }
14422 END { printf "NSIG %d\n", ++s }' >signal.lst
14424 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
14426 chmod a+x signal_cmd
14427 $eunicefix signal_cmd
14429 : generate list of signal names
14431 case "$sig_name_init" in
14433 *) case "$sig_num_init" in
14434 ''|*,*) doinit=yes ;;
14439 echo "Generating a list of signal names and numbers..." >&4
14441 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
14442 sig_name=`$awk 'BEGIN { printf "ZERO " }
14443 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
14444 sig_num=`$awk 'BEGIN { printf "0 " }
14445 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
14446 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
14447 !/^NSIG/ { printf "\"%s\", ", $1 }
14448 END { printf "0\n" }' signal.lst`
14449 sig_num_init=`$awk 'BEGIN { printf "0, " }
14450 !/^NSIG/ { printf "%d, ", $2}
14451 END { printf "0\n"}' signal.lst`
14454 echo "The following $sig_count signals are available:"
14456 echo $sig_name | $awk \
14457 'BEGIN { linelen = 0 }
14459 for (i = 1; i <= NF; i++) {
14460 name = "SIG" $i " "
14461 linelen = linelen + length(name)
14462 if (linelen > 70) {
14464 linelen = length(name)
14470 $rm -f signal signal.c signal.awk signal.lst signal_cmd
14473 case "$sizetype" in
14474 *_t) zzz="$sizetype" ;;
14475 *) zzz="filesize" ;;
14477 echo "Checking the size of $zzz..." >&4
14479 #include <sys/types.h>
14482 printf("%d\n", (int)sizeof($sizetype));
14487 if eval $compile_ok; then
14491 echo "(I can't execute the test program--guessing $sizesize.)" >&4
14494 echo "Your $zzz size is $sizesize bytes."
14499 echo "(I can't compile the test program--guessing $sizesize.)" >&4
14503 : check for socklen_t
14505 echo "Checking to see if you have socklen_t..." >&4
14507 #include <sys/types.h>
14508 #$d_socket HAS_SOCKET
14510 #include <sys/socket.h>
14512 int main() { socklen_t x = 16; }
14515 if eval $compile; then
14517 echo "You have socklen_t."
14520 echo "You do not have socklen_t."
14521 case "$sizetype" in
14522 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
14529 : see if this is a socks.h system
14530 set socks.h i_socks
14533 : check for type of the size argument to socket calls
14534 case "$d_socket" in
14538 Checking to see what type is the last argument of accept().
14541 case "$d_socklen_t" in
14542 "$define") yyy="$yyy socklen_t"
14544 yyy="$yyy $sizetype int long unsigned"
14545 for xxx in $yyy; do
14546 case "$socksizetype" in
14547 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
14548 case "$usesocks" in
14550 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
14551 echo "Your system accepts '$xxx *' for the last argument of accept()."
14552 socksizetype="$xxx"
14555 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
14556 echo "Your system accepts '$xxx *' for the last argument of accept()."
14557 socksizetype="$xxx"
14564 : In case none of those worked, prompt the user.
14565 case "$socksizetype" in
14566 '') rp='What is the type for socket address structure sizes?'
14573 *) : no sockets, so pick relatively harmless default
14578 : see what type is used for signed size_t
14579 set ssize_t ssizetype int stdio.h sys/types.h
14582 $cat > ssize.c <<EOM
14584 #include <sys/types.h>
14585 #define Size_t $sizetype
14586 #define SSize_t $dflt
14589 if (sizeof(Size_t) == sizeof(SSize_t))
14591 else if (sizeof(Size_t) == sizeof(int))
14600 if eval $compile_ok && ./ssize > /dev/null; then
14601 ssizetype=`./ssize`
14602 echo "I'll be using $ssizetype for functions returning a byte count." >&4
14605 Help! I can't compile and run the ssize_t test program: please enlighten me!
14606 (This is probably a misconfiguration in your system or libraries, and
14607 you really ought to fix it. Still, I'll try anyway.)
14609 I need a type that is the same size as $sizetype, but is guaranteed to
14610 be signed. Common values are ssize_t, int and long.
14613 rp="What signed type is the same size as $sizetype?"
14617 $rm -f ssize ssize.*
14619 : see what type of char stdio uses.
14621 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
14622 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
14623 echo "Your stdio uses unsigned chars." >&4
14624 stdchar="unsigned char"
14626 echo "Your stdio uses signed chars." >&4
14633 : see if time exists
14635 if test "X$d_time" = X -o X"$timetype" = X; then
14636 if set time val -f d_time; eval $csym; $val; then
14637 echo 'time() found.' >&4
14639 rp="What is the type returned by time() on this system?"
14640 set time_t timetype long stdio.h sys/types.h
14643 echo 'time() not found, hope that will do.' >&4
14651 : see what type uids are declared as in the kernel
14653 echo "Looking for the type for user ids returned by getuid()."
14654 set uid_t uidtype xxx stdio.h sys/types.h
14658 xxx=`./findhdr sys/user.h`
14659 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
14661 unsigned) dflt="$1 $2" ;;
14665 *) dflt="$uidtype";;
14668 uid_t) echo "uid_t found." ;;
14669 *) rp="What is the type for user ids returned by getuid()?"
14677 *_t) zzz="$uidtype" ;;
14680 echo "Checking the size of $zzz..." >&4
14682 #include <sys/types.h>
14685 printf("%d\n", (int)sizeof($uidtype));
14690 if eval $compile_ok; then
14694 echo "(I can't execute the test program--guessing $uidsize.)" >&4
14697 echo "Your $zzz is $uidsize bytes long."
14702 echo "(I can't compile the test program--guessing $uidsize.)" >&4
14707 *_t) zzz="$uidtype" ;;
14710 echo "Checking the sign of $zzz..." >&4
14712 #include <sys/types.h>
14723 if eval $compile; then
14727 echo "(I can't execute the test program--guessing unsigned.)" >&4
14731 1) echo "Your $zzz is unsigned." ;;
14732 -1) echo "Your $zzz is signed." ;;
14738 echo "(I can't compile the test program--guessing unsigned.)" >&4
14744 $echo "Checking the format string to be used for uids..." >&4
14747 -1) if $test X"$uidsize" = X"$ivsize"; then
14748 uidformat="$ivdformat"
14750 if $test X"$uidsize" = X"$longsize"; then
14753 if $test X"$uidsize" = X"$intsize"; then
14756 if $test X"$uidsize" = X"$shortsize"; then
14763 *) if $test X"$uidsize" = X"$uvsize"; then
14764 uidformat="$uvuformat"
14766 if $test X"$uidsize" = X"$longsize"; then
14769 if $test X"$uidsize" = X"$intsize"; then
14772 if $test X"$uidsize" = X"$shortsize"; then
14781 : see if dbm.h is available
14782 : see if dbmclose exists
14783 set dbmclose d_dbmclose
14786 case "$d_dbmclose" in
14796 *) set rpcsvc/dbm.h i_rpcsvcdbm
14801 *) echo "We won't be including <dbm.h>"
14811 : see if this is a sys/file.h system
14816 : do we need to include sys/file.h ?
14820 if $h_sysfile; then
14822 echo "We'll be including <sys/file.h>." >&4
14825 echo "We won't be including <sys/file.h>." >&4
14835 : see if fcntl.h is there
14840 : see if we can include fcntl.h
14846 echo "We'll be including <fcntl.h>." >&4
14849 if $h_sysfile; then
14850 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
14852 echo "We won't be including <fcntl.h>." >&4
14864 : see if this is a iconv.h system
14865 set iconv.h i_iconv
14868 : see if this is a ieeefp.h system
14869 set ieeefp.h i_ieeefp
14872 : see if this is a libutil.h system
14873 set libutil.h i_libutil
14876 : see if locale.h is available
14877 set locale.h i_locale
14880 : see if mach cthreads are available
14881 if test "X$usethreads" = "X$define"; then
14882 set mach/cthreads.h i_machcthr
14885 i_machcthr="$undef"
14890 : see if this is a math.h system
14894 : see if this is a mntent.h system
14895 set mntent.h i_mntent
14898 : see if ndbm.h is available
14903 : see if dbm_open exists
14904 set dbm_open d_dbm_open
14906 case "$d_dbm_open" in
14909 echo "We won't be including <ndbm.h>"
14918 : see if net/errno.h is available
14920 set net/errno.h val
14923 : Unfortunately, it causes problems on some systems. Arrgh.
14926 cat > try.c <<'EOM'
14929 #include <net/errno.h>
14935 if $cc $ccflags -c try.c >/dev/null 2>&1; then
14936 echo "We'll be including <net/errno.h>." >&4
14938 echo "We won't be including <net/errno.h>." >&4
14947 : see if netinet/tcp.h is available
14948 set netinet/tcp.h i_netinettcp
14951 : see if this is a poll.h system
14955 : see if this is a prot.h system
14960 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
14961 $cat <<'EOSH' > Cppsym.know
14962 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
14963 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
14964 alliant alpha am29000 AM29000 amiga AMIGAOS AMIX
14965 ansi ANSI_C_SOURCE apollo ardent atarist att386 att3b BeOS
14966 BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
14967 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
14968 bull c cadmus clipper CMU COFF COMPILER_VERSION
14969 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
14970 CYGWIN DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
14971 Dynix DynixPTX ELF encore EPI EXTENSIONS FILE_OFFSET_BITS
14972 FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
14973 GNU_SOURCE GNUC GNUC_MINOR GO32 gould GOULD_PN
14974 H3050R H3050RX hbullx20 hcx host_mips
14975 hp200 hp300 hp700 HP700 hp800 hp9000
14976 hp9000s200 hp9000s300 hp9000s400 hp9000s500
14977 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
14978 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
14979 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
14980 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
14981 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
14982 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
14983 Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
14984 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
14985 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
14986 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
14987 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
14988 MATH_HAS_NO_SIDE_EFFECTS
14989 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
14990 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
14991 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
14992 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
14993 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
14994 NetBSD news1500 news1700 news1800 news1900 news3700
14995 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
14996 ns32016 ns32332 ns32k nsc32000
14997 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
14998 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
14999 pc532 pdp11 PGC PIC plexus PORTAR posix
15000 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
15001 POSIX_C_SOURCE POSIX_SOURCE POWER
15002 PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
15003 riscix riscos RT scs SCO sequent sgi SGI_SOURCE sinix
15004 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
15005 sony sony_news sonyrisc sparc sparclite spectrum
15006 stardent stdc STDC_EXT stratos sun sun3 sun386
15007 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
15008 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
15009 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
15010 sysV68 sysV88 Tek4132 Tek4300 titan
15011 tower tower32 tower32_200 tower32_600 tower32_700
15012 tower32_800 tower32_850 tss
15013 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
15014 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
15015 unix UNIX95 UNIX99 unixpc unos USGr4 USGr4_2
15016 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms xenix Xenix286
15017 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
15018 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
15021 # Maybe put other stuff here too.
15022 cat <<EOSH >>Cppsym.know
15025 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
15026 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
15027 $cat Cppsym.know > Cppsym.c
15028 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
15029 $rm -f Cppsym.a Cppsym.b Cppsym.c
15030 cat <<EOSH > Cppsym
15032 if $test \$# -gt 0; then
15033 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
15034 if $test -s Cppsym.got; then
15041 $tr " " "$trnl" | ./Cppsym.try
15047 cat <<EOSH > Cppsym.try
15049 cat <<'EOCP' > try.c
15055 cat <<'EOSH' >> Cppsym.try
15057 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
15058 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
15059 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
15060 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
15064 cat <<EOSH >> Cppsym.try
15066 case "$osname-$gccversion" in
15067 irix-) ccflags="\$ccflags -woff 1178" ;;
15068 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
15070 $cc -o try $optimize \$ccflags $ldflags try.c $libs && ./try$exe_ext
15072 chmod +x Cppsym.try
15073 $eunicefix Cppsym.try
15074 ./Cppsym < Cppsym.know > Cppsym.true
15075 : now check the C compiler for additional symbols
15076 postprocess_cc_v=''
15078 aix) postprocess_cc_v="|$tr , ' '" ;;
15085 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
15088 -D*) echo "\$i" | $sed 's/^-D//';;
15089 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
15094 postprocess_cc_v=''
15097 ./ccsym > ccsym1.raw
15098 if $test -s ccsym1.raw; then
15099 $sort ccsym1.raw | $uniq >ccsym.raw
15101 mv ccsym1.raw ccsym.raw
15104 $awk '/\=/ { print $0; next }
15105 { print $0"=1" }' ccsym.raw >ccsym.list
15106 $awk '/\=/ { print $0; next }
15107 { print $0"=1" }' Cppsym.true >ccsym.true
15108 $comm -13 ccsym.true ccsym.list >ccsym.own
15109 $comm -12 ccsym.true ccsym.list >ccsym.com
15110 $comm -23 ccsym.true ccsym.list >ccsym.cpp
15112 if $test -z ccsym.raw; then
15113 echo "Your C compiler doesn't seem to define any symbols!" >&4
15115 echo "However, your C preprocessor defines the following symbols:"
15118 cppsymbols=`$cat Cppsym.true`
15119 cppsymbols=`echo $cppsymbols`
15120 cppccsymbols="$cppsymbols"
15122 if $test -s ccsym.com; then
15123 echo "Your C compiler and pre-processor define these symbols:"
15124 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
15127 cppccsymbols=`$cat ccsym.com`
15128 cppccsymbols=`echo $cppccsymbols`
15129 $test "$silent" || sleep 1
15131 if $test -s ccsym.cpp; then
15132 $test "$also" && echo " "
15133 echo "Your C pre-processor ${also}defines the following symbols:"
15134 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
15136 cppsymbols=`$cat ccsym.cpp`
15137 cppsymbols=`echo $cppsymbols`
15138 $test "$silent" || sleep 1
15140 if $test -s ccsym.own; then
15141 $test "$also" && echo " "
15142 echo "Your C compiler ${also}defines the following cpp symbols:"
15143 $sed -e 's/\(..*\)=1/\1/' ccsym.own
15144 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
15145 ccsymbols=`$cat ccsym.own`
15146 ccsymbols=`echo $ccsymbols`
15147 $test "$silent" || sleep 1
15150 $rm -f ccsym* Cppsym.*
15152 : see if this is a termio system
15156 if $test `./findhdr termios.h`; then
15157 set tcsetattr i_termios
15163 "$define") echo "You have POSIX termios.h... good!" >&4;;
15164 *) if ./Cppsym pyr; then
15165 case "`/bin/universe`" in
15166 ucb) if $test `./findhdr sgtty.h`; then
15168 echo "<sgtty.h> found." >&4
15170 echo "System is pyramid with BSD universe."
15171 echo "<sgtty.h> not found--you could have problems." >&4
15173 *) if $test `./findhdr termio.h`; then
15175 echo "<termio.h> found." >&4
15177 echo "System is pyramid with USG universe."
15178 echo "<termio.h> not found--you could have problems." >&4
15182 if $test `./findhdr termio.h`; then
15183 echo "<termio.h> found." >&4
15185 elif $test `./findhdr sgtty.h`; then
15186 echo "<sgtty.h> found." >&4
15189 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
15192 if $test `./findhdr sgtty.h`; then
15193 echo "<sgtty.h> found." >&4
15195 elif $test `./findhdr termio.h`; then
15196 echo "<termio.h> found." >&4
15199 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
15203 set i_termio; eval $setvar
15204 val=$val2; set i_sgtty; eval $setvar
15205 val=$val3; set i_termios; eval $setvar
15207 : see if this is a shadow.h system
15208 set shadow.h i_shadow
15211 : see if stddef is available
15212 set stddef.h i_stddef
15215 : see if this is a sunmath.h system
15216 set sunmath.h i_sunmath
15219 : see if sys/access.h is available
15220 set sys/access.h i_sysaccess
15223 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
15224 set sys/filio.h i_sysfilio
15227 if $test `./findhdr sys/ioctl.h`; then
15229 echo '<sys/ioctl.h> found.' >&4
15232 if $test $i_sysfilio = "$define"; then
15233 echo '<sys/ioctl.h> NOT found.' >&4
15235 $test $i_sgtty = "$define" && xxx="sgtty.h"
15236 $test $i_termio = "$define" && xxx="termio.h"
15237 $test $i_termios = "$define" && xxx="termios.h"
15238 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
15245 : see if this is a syslog.h system
15246 set syslog.h i_syslog
15250 : see if this is a sys/mode.h system
15251 set sys/mode.h i_sysmode
15254 : see if sys/resource.h has to be included
15255 set sys/resource.h i_sysresrc
15258 : see if sys/security.h is available
15259 set sys/security.h i_syssecrt
15262 : see if this is a sys/statvfs.h system
15263 set sys/statvfs.h i_sysstatvfs
15266 : see if this is a sys/uio.h system
15267 set sys/uio.h i_sysuio
15270 : see if this is a sys/un.h system
15271 set sys/un.h i_sysun
15275 : see if this is a sys/utsname.h system
15276 set sys/utsname.h i_sysutsname
15279 : see if this is a syswait system
15280 set sys/wait.h i_syswait
15283 : see if this is a ustat.h system
15284 set ustat.h i_ustat
15287 : see if this is an utime system
15288 set utime.h i_utime
15291 : see if this is a values.h system
15292 set values.h i_values
15295 : see if this is a vfork system
15298 set vfork.h i_vfork
15306 : see if gdbm.h is available
15311 : see if gdbm_open exists
15312 set gdbm_open d_gdbm_open
15314 case "$d_gdbm_open" in
15317 echo "We won't be including <gdbm.h>"
15327 echo "Looking for extensions..." >&4
15328 : If we are using the old config.sh, known_extensions may contain
15329 : old or inaccurate or duplicate values.
15330 known_extensions=''
15331 nonxs_extensions=''
15332 : We do not use find because it might not be available.
15333 : We do not just use MANIFEST because the user may have dropped
15334 : some additional extensions into the source tree and expect them
15337 : Function to recursively find available extensions, ignoring DynaLoader
15338 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
15342 DynaLoader|dynaload) ;;
15344 if $test -f $xxx/$xxx.xs; then
15345 known_extensions="$known_extensions $1$xxx";
15346 elif $test -f $xxx/Makefile.PL; then
15347 nonxs_extensions="$nonxs_extensions $1$xxx";
15349 if $test -d $xxx -a $# -lt 10; then
15352 eval $find_extensions;
15364 eval $find_extensions
15365 set X $nonxs_extensions
15367 nonxs_extensions="$*"
15368 set X $known_extensions
15370 known_extensions="$*"
15373 : Now see which are supported on this system.
15375 for xxx in $known_extensions ; do
15379 $define) avail_ext="$avail_ext $xxx" ;;
15382 GDBM_File|gdbm_fil)
15384 $define) avail_ext="$avail_ext $xxx" ;;
15387 NDBM_File|ndbm_fil)
15390 case "$osname-$use64bitint" in
15393 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
15396 *) avail_ext="$avail_ext $xxx" ;;
15401 ODBM_File|odbm_fil)
15402 case "${i_dbm}${i_rpcsvcdbm}" in
15404 case "$osname-$use64bitint" in
15407 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
15410 *) avail_ext="$avail_ext $xxx" ;;
15416 case "$useposix" in
15417 true|define|y) avail_ext="$avail_ext $xxx" ;;
15421 case "$useopcode" in
15422 true|define|y) avail_ext="$avail_ext $xxx" ;;
15426 case "$d_socket" in
15427 true|$define|y) avail_ext="$avail_ext $xxx" ;;
15430 Sys/Syslog|sys/syslog)
15431 : XXX syslog requires socket
15432 case "$d_socket" in
15433 true|$define|y) avail_ext="$avail_ext $xxx" ;;
15437 case "$usethreads" in
15438 true|$define|y) avail_ext="$avail_ext $xxx" ;;
15442 : XXX Do we need a useipcsysv variable here
15443 case "${d_msg}${d_sem}${d_shm}" in
15444 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
15447 *) avail_ext="$avail_ext $xxx"
15456 : Now see which nonxs extensions are supported on this system.
15457 : For now assume all are.
15459 for xxx in $nonxs_extensions ; do
15461 *) nonxs_ext="$nonxs_ext $xxx"
15473 A number of extensions are supplied with $package. You may choose to
15474 compile these extensions for dynamic loading (the default), compile
15475 them into the $package executable (static loading), or not include
15476 them at all. Answer "none" to include no extensions.
15477 Note that DynaLoader is always built and need not be mentioned here.
15480 case "$dynamic_ext" in
15481 '') dflt="$avail_ext" ;;
15482 *) dflt="$dynamic_ext"
15483 # Perhaps we are reusing an old out-of-date config.sh.
15486 if test X"$dynamic_ext" != X"$avail_ext"; then
15488 NOTICE: Your previous config.sh list may be incorrect.
15489 The extensions now available to you are
15491 but the default list from your previous config.sh is
15503 rp="What extensions do you wish to load dynamically?"
15506 none) dynamic_ext=' ' ;;
15507 *) dynamic_ext="$ans" ;;
15510 case "$static_ext" in
15512 : Exclude those already listed in dynamic linking
15514 for xxx in $avail_ext; do
15515 case " $dynamic_ext " in
15517 *) dflt="$dflt $xxx" ;;
15524 *) dflt="$static_ext"
15531 rp="What extensions do you wish to load statically?"
15534 none) static_ext=' ' ;;
15535 *) static_ext="$ans" ;;
15540 A number of extensions are supplied with $package. Answer "none"
15541 to include no extensions.
15542 Note that DynaLoader is always built and need not be mentioned here.
15545 case "$static_ext" in
15546 '') dflt="$avail_ext" ;;
15547 *) dflt="$static_ext"
15548 # Perhaps we are reusing an old out-of-date config.sh.
15551 if test X"$static_ext" != X"$avail_ext"; then
15553 NOTICE: Your previous config.sh list may be incorrect.
15554 The extensions now available to you are
15556 but the default list from your previous config.sh is
15565 : Exclude those that are not xs extensions
15569 rp="What extensions do you wish to include?"
15572 none) static_ext=' ' ;;
15573 *) static_ext="$ans" ;;
15578 set X $dynamic_ext $static_ext $nonxs_ext
15582 : Remove libraries needed only for extensions
15583 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
15584 : The exception is SunOS 4.x, which needs them.
15585 case "${osname}X${osvers}" in
15589 *) case "$usedl" in
15590 $define|true|[yY]*)
15591 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
15595 *) perllibs="$libs"
15601 : Remove build directory name from cppstdin so it can be used from
15602 : either the present location or the final installed location.
15604 : Get out of the UU directory to get correct path name.
15606 case "$cppstdin" in
15608 echo "Stripping down cppstdin path name"
15614 : end of configuration questions
15616 echo "End of configuration questions."
15619 : back to where it started
15620 if test -d ../UU; then
15624 : configuration may be patched via a 'config.over' file
15625 if $test -f config.over; then
15628 rp='I see a config.over file. Do you wish to load it?'
15631 n*) echo "OK, I'll ignore it.";;
15633 echo "Configuration override changes have been loaded."
15638 : in case they want portability, strip down executable paths
15639 case "$d_portable" in
15642 echo "Stripping down executable paths..." >&4
15643 for file in $loclist $trylist; do
15645 eval $file=`basename $temp`
15650 : create config.sh file
15652 echo "Creating config.sh..." >&4
15653 $spitshell <<EOT >config.sh
15656 # This file was produced by running the Configure script. It holds all the
15657 # definitions figured out by Configure. Should you modify one of these values,
15658 # do not forget to propagate your changes by running "Configure -der". You may
15659 # instead choose to run each of the .SH files by yourself, or "Configure -S".
15662 # Package name : $package
15663 # Source directory : $src
15664 # Configuration time: $cf_time
15665 # Configured by : $cf_by
15666 # Target system : $myuname
15676 Revision='$Revision'
15683 alignbytes='$alignbytes'
15684 ansi2knr='$ansi2knr'
15685 aphostname='$aphostname'
15686 api_revision='$api_revision'
15687 api_subversion='$api_subversion'
15688 api_version='$api_version'
15689 api_versionstring='$api_versionstring'
15692 archlibexp='$archlibexp'
15693 archname64='$archname64'
15694 archname='$archname'
15695 archobjs='$archobjs'
15700 bincompat5005='$bincompat5005'
15704 byteorder='$byteorder'
15706 castflags='$castflags'
15709 cccdlflags='$cccdlflags'
15710 ccdlflags='$ccdlflags'
15712 ccflags_uselargefiles='$ccflags_uselargefiles'
15714 ccsymbols='$ccsymbols'
15715 ccversion='$ccversion'
15717 cf_email='$cf_email'
15719 charsize='$charsize'
15723 clocktype='$clocktype'
15725 compress='$compress'
15726 contains='$contains'
15730 cpp_stuff='$cpp_stuff'
15731 cppccsymbols='$cppccsymbols'
15732 cppflags='$cppflags'
15734 cppminus='$cppminus'
15736 cppstdin='$cppstdin'
15737 cppsymbols='$cppsymbols'
15738 crosscompile='$crosscompile'
15739 cryptlib='$cryptlib'
15741 d_Gconvert='$d_Gconvert'
15742 d_PRIEUldbl='$d_PRIEUldbl'
15743 d_PRIFUldbl='$d_PRIFUldbl'
15744 d_PRIGUldbl='$d_PRIGUldbl'
15745 d_PRIXU64='$d_PRIXU64'
15746 d_PRId64='$d_PRId64'
15747 d_PRIeldbl='$d_PRIeldbl'
15748 d_PRIfldbl='$d_PRIfldbl'
15749 d_PRIgldbl='$d_PRIgldbl'
15750 d_PRIi64='$d_PRIi64'
15751 d_PRIo64='$d_PRIo64'
15752 d_PRIu64='$d_PRIu64'
15753 d_PRIx64='$d_PRIx64'
15754 d_SCNfldbl='$d_SCNfldbl'
15755 d__fwalk='$d__fwalk'
15756 d_access='$d_access'
15757 d_accessx='$d_accessx'
15759 d_archlib='$d_archlib'
15762 d_attribut='$d_attribut'
15765 d_bincompat5005='$d_bincompat5005'
15767 d_bsdgetpgrp='$d_bsdgetpgrp'
15768 d_bsdsetpgrp='$d_bsdsetpgrp'
15770 d_casti32='$d_casti32'
15771 d_castneg='$d_castneg'
15772 d_charvspr='$d_charvspr'
15774 d_chroot='$d_chroot'
15775 d_chsize='$d_chsize'
15776 d_closedir='$d_closedir'
15780 d_cuserid='$d_cuserid'
15781 d_dbl_dig='$d_dbl_dig'
15782 d_difftime='$d_difftime'
15783 d_dirnamlen='$d_dirnamlen'
15784 d_dlerror='$d_dlerror'
15785 d_dlopen='$d_dlopen'
15786 d_dlsymun='$d_dlsymun'
15787 d_dosuid='$d_dosuid'
15788 d_drand48proto='$d_drand48proto'
15790 d_eaccess='$d_eaccess'
15791 d_endgrent='$d_endgrent'
15792 d_endhent='$d_endhent'
15793 d_endnent='$d_endnent'
15794 d_endpent='$d_endpent'
15795 d_endpwent='$d_endpwent'
15796 d_endsent='$d_endsent'
15797 d_eofnblk='$d_eofnblk'
15798 d_eunice='$d_eunice'
15799 d_fchmod='$d_fchmod'
15800 d_fchown='$d_fchown'
15802 d_fcntl_can_lock='$d_fcntl_can_lock'
15803 d_fd_macros='$d_fd_macros'
15804 d_fd_set='$d_fd_set'
15805 d_fds_bits='$d_fds_bits'
15806 d_fgetpos='$d_fgetpos'
15807 d_flexfnam='$d_flexfnam'
15810 d_fpathconf='$d_fpathconf'
15811 d_fpos64_t='$d_fpos64_t'
15812 d_frexpl='$d_frexpl'
15813 d_fs_data_s='$d_fs_data_s'
15814 d_fseeko='$d_fseeko'
15815 d_fsetpos='$d_fsetpos'
15816 d_fstatfs='$d_fstatfs'
15817 d_fstatvfs='$d_fstatvfs'
15819 d_ftello='$d_ftello'
15821 d_getcwd='$d_getcwd'
15822 d_getespwnam='$d_getespwnam'
15823 d_getfsstat='$d_getfsstat'
15824 d_getgrent='$d_getgrent'
15825 d_getgrps='$d_getgrps'
15826 d_gethbyaddr='$d_gethbyaddr'
15827 d_gethbyname='$d_gethbyname'
15828 d_gethent='$d_gethent'
15829 d_gethname='$d_gethname'
15830 d_gethostprotos='$d_gethostprotos'
15831 d_getlogin='$d_getlogin'
15832 d_getmnt='$d_getmnt'
15833 d_getmntent='$d_getmntent'
15834 d_getnbyaddr='$d_getnbyaddr'
15835 d_getnbyname='$d_getnbyname'
15836 d_getnent='$d_getnent'
15837 d_getnetprotos='$d_getnetprotos'
15838 d_getpagsz='$d_getpagsz'
15839 d_getpbyname='$d_getpbyname'
15840 d_getpbynumber='$d_getpbynumber'
15841 d_getpent='$d_getpent'
15842 d_getpgid='$d_getpgid'
15843 d_getpgrp2='$d_getpgrp2'
15844 d_getpgrp='$d_getpgrp'
15845 d_getppid='$d_getppid'
15846 d_getprior='$d_getprior'
15847 d_getprotoprotos='$d_getprotoprotos'
15848 d_getprpwnam='$d_getprpwnam'
15849 d_getpwent='$d_getpwent'
15850 d_getsbyname='$d_getsbyname'
15851 d_getsbyport='$d_getsbyport'
15852 d_getsent='$d_getsent'
15853 d_getservprotos='$d_getservprotos'
15854 d_getspnam='$d_getspnam'
15855 d_gettimeod='$d_gettimeod'
15856 d_gnulibc='$d_gnulibc'
15857 d_grpasswd='$d_grpasswd'
15858 d_hasmntopt='$d_hasmntopt'
15862 d_inetaton='$d_inetaton'
15863 d_int64_t='$d_int64_t'
15864 d_isascii='$d_isascii'
15866 d_isnanl='$d_isnanl'
15867 d_killpg='$d_killpg'
15868 d_lchown='$d_lchown'
15869 d_ldbl_dig='$d_ldbl_dig'
15871 d_locconv='$d_locconv'
15873 d_longdbl='$d_longdbl'
15874 d_longlong='$d_longlong'
15875 d_lseekproto='$d_lseekproto'
15877 d_madvise='$d_madvise'
15879 d_mbstowcs='$d_mbstowcs'
15880 d_mbtowc='$d_mbtowc'
15881 d_memchr='$d_memchr'
15882 d_memcmp='$d_memcmp'
15883 d_memcpy='$d_memcpy'
15884 d_memmove='$d_memmove'
15885 d_memset='$d_memset'
15887 d_mkdtemp='$d_mkdtemp'
15888 d_mkfifo='$d_mkfifo'
15889 d_mkstemp='$d_mkstemp'
15890 d_mkstemps='$d_mkstemps'
15891 d_mktime='$d_mktime'
15894 d_mprotect='$d_mprotect'
15896 d_msg_ctrunc='$d_msg_ctrunc'
15897 d_msg_dontroute='$d_msg_dontroute'
15898 d_msg_oob='$d_msg_oob'
15899 d_msg_peek='$d_msg_peek'
15900 d_msg_proxy='$d_msg_proxy'
15901 d_msgctl='$d_msgctl'
15902 d_msgget='$d_msgget'
15903 d_msgrcv='$d_msgrcv'
15904 d_msgsnd='$d_msgsnd'
15906 d_munmap='$d_munmap'
15907 d_mymalloc='$d_mymalloc'
15909 d_nv_preserves_uv='$d_nv_preserves_uv'
15910 d_nv_preserves_uv_bits='$d_nv_preserves_uv_bits'
15911 d_off64_t='$d_off64_t'
15912 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
15913 d_oldpthreads='$d_oldpthreads'
15914 d_oldsock='$d_oldsock'
15916 d_pathconf='$d_pathconf'
15918 d_perl_otherlibdirs='$d_perl_otherlibdirs'
15919 d_phostname='$d_phostname'
15922 d_portable='$d_portable'
15923 d_pthread_yield='$d_pthread_yield'
15925 d_pwchange='$d_pwchange'
15926 d_pwclass='$d_pwclass'
15927 d_pwcomment='$d_pwcomment'
15928 d_pwexpire='$d_pwexpire'
15929 d_pwgecos='$d_pwgecos'
15930 d_pwpasswd='$d_pwpasswd'
15931 d_pwquota='$d_pwquota'
15934 d_readdir='$d_readdir'
15935 d_readlink='$d_readlink'
15936 d_rename='$d_rename'
15937 d_rewinddir='$d_rewinddir'
15939 d_safebcpy='$d_safebcpy'
15940 d_safemcpy='$d_safemcpy'
15941 d_sanemcmp='$d_sanemcmp'
15942 d_sbrkproto='$d_sbrkproto'
15943 d_sched_yield='$d_sched_yield'
15944 d_scm_rights='$d_scm_rights'
15945 d_seekdir='$d_seekdir'
15946 d_select='$d_select'
15948 d_semctl='$d_semctl'
15949 d_semctl_semid_ds='$d_semctl_semid_ds'
15950 d_semctl_semun='$d_semctl_semun'
15951 d_semget='$d_semget'
15953 d_setegid='$d_setegid'
15954 d_seteuid='$d_seteuid'
15955 d_setgrent='$d_setgrent'
15956 d_setgrps='$d_setgrps'
15957 d_sethent='$d_sethent'
15958 d_setlinebuf='$d_setlinebuf'
15959 d_setlocale='$d_setlocale'
15960 d_setnent='$d_setnent'
15961 d_setpent='$d_setpent'
15962 d_setpgid='$d_setpgid'
15963 d_setpgrp2='$d_setpgrp2'
15964 d_setpgrp='$d_setpgrp'
15965 d_setprior='$d_setprior'
15966 d_setproctitle='$d_setproctitle'
15967 d_setpwent='$d_setpwent'
15968 d_setregid='$d_setregid'
15969 d_setresgid='$d_setresgid'
15970 d_setresuid='$d_setresuid'
15971 d_setreuid='$d_setreuid'
15972 d_setrgid='$d_setrgid'
15973 d_setruid='$d_setruid'
15974 d_setsent='$d_setsent'
15975 d_setsid='$d_setsid'
15976 d_setvbuf='$d_setvbuf'
15980 d_shmatprototype='$d_shmatprototype'
15981 d_shmctl='$d_shmctl'
15983 d_shmget='$d_shmget'
15984 d_sigaction='$d_sigaction'
15985 d_sigsetjmp='$d_sigsetjmp'
15986 d_socket='$d_socket'
15987 d_socklen_t='$d_socklen_t'
15988 d_sockpair='$d_sockpair'
15989 d_socks5_init='$d_socks5_init'
15991 d_statblks='$d_statblks'
15992 d_statfs_f_flags='$d_statfs_f_flags'
15993 d_statfs_s='$d_statfs_s'
15994 d_statvfs='$d_statvfs'
15995 d_stdio_cnt_lval='$d_stdio_cnt_lval'
15996 d_stdio_ptr_lval='$d_stdio_ptr_lval'
15997 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
15998 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
15999 d_stdio_stream_array='$d_stdio_stream_array'
16000 d_stdiobase='$d_stdiobase'
16001 d_stdstdio='$d_stdstdio'
16002 d_strchr='$d_strchr'
16003 d_strcoll='$d_strcoll'
16004 d_strctcpy='$d_strctcpy'
16005 d_strerrm='$d_strerrm'
16006 d_strerror='$d_strerror'
16007 d_strtod='$d_strtod'
16008 d_strtol='$d_strtol'
16009 d_strtold='$d_strtold'
16010 d_strtoll='$d_strtoll'
16011 d_strtoq='$d_strtoq'
16012 d_strtoul='$d_strtoul'
16013 d_strtoull='$d_strtoull'
16014 d_strtouq='$d_strtouq'
16015 d_strxfrm='$d_strxfrm'
16016 d_suidsafe='$d_suidsafe'
16017 d_symlink='$d_symlink'
16018 d_syscall='$d_syscall'
16019 d_sysconf='$d_sysconf'
16020 d_sysernlst='$d_sysernlst'
16021 d_syserrlst='$d_syserrlst'
16022 d_system='$d_system'
16023 d_tcgetpgrp='$d_tcgetpgrp'
16024 d_tcsetpgrp='$d_tcsetpgrp'
16025 d_telldir='$d_telldir'
16026 d_telldirproto='$d_telldirproto'
16029 d_truncate='$d_truncate'
16030 d_tzname='$d_tzname'
16033 d_union_semun='$d_union_semun'
16035 d_vendorarch='$d_vendorarch'
16036 d_vendorbin='$d_vendorbin'
16037 d_vendorlib='$d_vendorlib'
16039 d_void_closedir='$d_void_closedir'
16040 d_voidsig='$d_voidsig'
16041 d_voidtty='$d_voidtty'
16042 d_volatile='$d_volatile'
16043 d_vprintf='$d_vprintf'
16045 d_waitpid='$d_waitpid'
16046 d_wcstombs='$d_wcstombs'
16047 d_wctomb='$d_wctomb'
16050 db_hashtype='$db_hashtype'
16051 db_prefixtype='$db_prefixtype'
16052 defvoidused='$defvoidused'
16053 direntrytype='$direntrytype'
16056 doublesize='$doublesize'
16058 dynamic_ext='$dynamic_ext'
16064 eunicefix='$eunicefix'
16067 extensions='$extensions'
16068 fflushNULL='$fflushNULL'
16069 fflushall='$fflushall'
16071 firstmakefile='$firstmakefile'
16073 fpossize='$fpossize'
16074 fpostype='$fpostype'
16075 freetype='$freetype'
16077 full_csh='$full_csh'
16078 full_sed='$full_sed'
16079 gccosandvers='$gccosandvers'
16080 gccversion='$gccversion'
16081 gidformat='$gidformat'
16087 groupcat='$groupcat'
16088 groupstype='$groupstype'
16091 h_sysfile='$h_sysfile'
16102 i_arpainet='$i_arpainet'
16103 i_bsdioctl='$i_bsdioctl'
16106 i_dirent='$i_dirent'
16114 i_ieeefp='$i_ieeefp'
16115 i_inttypes='$i_inttypes'
16116 i_libutil='$i_libutil'
16117 i_limits='$i_limits'
16118 i_locale='$i_locale'
16119 i_machcthr='$i_machcthr'
16120 i_malloc='$i_malloc'
16122 i_memory='$i_memory'
16123 i_mntent='$i_mntent'
16126 i_neterrno='$i_neterrno'
16127 i_netinettcp='$i_netinettcp'
16131 i_pthread='$i_pthread'
16133 i_rpcsvcdbm='$i_rpcsvcdbm'
16136 i_shadow='$i_shadow'
16138 i_stdarg='$i_stdarg'
16139 i_stddef='$i_stddef'
16140 i_stdlib='$i_stdlib'
16141 i_string='$i_string'
16142 i_sunmath='$i_sunmath'
16143 i_sysaccess='$i_sysaccess'
16144 i_sysdir='$i_sysdir'
16145 i_sysfile='$i_sysfile'
16146 i_sysfilio='$i_sysfilio'
16148 i_sysioctl='$i_sysioctl'
16149 i_syslog='$i_syslog'
16150 i_sysmman='$i_sysmman'
16151 i_sysmode='$i_sysmode'
16152 i_sysmount='$i_sysmount'
16153 i_sysndir='$i_sysndir'
16154 i_sysparam='$i_sysparam'
16155 i_sysresrc='$i_sysresrc'
16156 i_syssecrt='$i_syssecrt'
16157 i_sysselct='$i_sysselct'
16158 i_syssockio='$i_syssockio'
16159 i_sysstat='$i_sysstat'
16160 i_sysstatfs='$i_sysstatfs'
16161 i_sysstatvfs='$i_sysstatvfs'
16162 i_systime='$i_systime'
16163 i_systimek='$i_systimek'
16164 i_systimes='$i_systimes'
16165 i_systypes='$i_systypes'
16166 i_sysuio='$i_sysuio'
16168 i_sysutsname='$i_sysutsname'
16169 i_sysvfs='$i_sysvfs'
16170 i_syswait='$i_syswait'
16171 i_termio='$i_termio'
16172 i_termios='$i_termios'
16174 i_unistd='$i_unistd'
16177 i_values='$i_values'
16178 i_varargs='$i_varargs'
16179 i_varhdr='$i_varhdr'
16181 ignore_versioned_solibs='$ignore_versioned_solibs'
16182 inc_version_list='$inc_version_list'
16183 inc_version_list_init='$inc_version_list_init'
16186 installarchlib='$installarchlib'
16187 installbin='$installbin'
16188 installman1dir='$installman1dir'
16189 installman3dir='$installman3dir'
16190 installprefix='$installprefix'
16191 installprefixexp='$installprefixexp'
16192 installprivlib='$installprivlib'
16193 installscript='$installscript'
16194 installsitearch='$installsitearch'
16195 installsitebin='$installsitebin'
16196 installsitelib='$installsitelib'
16197 installstyle='$installstyle'
16198 installusrbinperl='$installusrbinperl'
16199 installvendorarch='$installvendorarch'
16200 installvendorbin='$installvendorbin'
16201 installvendorlib='$installvendorlib'
16203 ivdformat='$ivdformat'
16206 known_extensions='$known_extensions'
16209 lddlflags='$lddlflags'
16211 ldflags_uselargefiles='$ldflags_uselargefiles'
16212 ldlibpthname='$ldlibpthname'
16219 libsdirs='$libsdirs'
16220 libsfiles='$libsfiles'
16221 libsfound='$libsfound'
16222 libspath='$libspath'
16223 libswanted='$libswanted'
16224 libswanted_uselargefiles='$libswanted_uselargefiles'
16230 locincpth='$locincpth'
16231 loclibpth='$loclibpth'
16232 longdblsize='$longdblsize'
16233 longlongsize='$longlongsize'
16234 longsize='$longsize'
16238 lseeksize='$lseeksize'
16239 lseektype='$lseektype'
16243 make_set_make='$make_set_make'
16244 mallocobj='$mallocobj'
16245 mallocsrc='$mallocsrc'
16246 malloctype='$malloctype'
16248 man1direxp='$man1direxp'
16251 man3direxp='$man3direxp'
16253 mips_type='$mips_type'
16255 mmaptype='$mmaptype'
16256 modetype='$modetype'
16258 multiarch='$multiarch'
16260 myarchname='$myarchname'
16261 mydomain='$mydomain'
16262 myhostname='$myhostname'
16265 need_va_copy='$need_va_copy'
16266 netdb_hlen_type='$netdb_hlen_type'
16267 netdb_host_type='$netdb_host_type'
16268 netdb_name_type='$netdb_name_type'
16269 netdb_net_type='$netdb_net_type'
16272 nm_so_opt='$nm_so_opt'
16273 nonxs_ext='$nonxs_ext'
16275 nvEUformat='$nvEUformat'
16276 nvFUformat='$nvFUformat'
16277 nvGUformat='$nvGUformat'
16278 nveformat='$nveformat'
16279 nvfformat='$nvfformat'
16280 nvgformat='$nvgformat'
16283 o_nonblock='$o_nonblock'
16285 old_pthread_create_joinable='$old_pthread_create_joinable'
16286 optimize='$optimize'
16287 orderlib='$orderlib'
16290 otherlibdirs='$otherlibdirs'
16294 patchlevel='$patchlevel'
16295 path_sep='$path_sep'
16298 perladmin='$perladmin'
16299 perllibs='$perllibs'
16300 perlpath='$perlpath'
16302 phostname='$phostname'
16305 pm_apiversion='$pm_apiversion'
16309 prefixexp='$prefixexp'
16311 privlibexp='$privlibexp'
16312 prototype='$prototype'
16314 quadkind='$quadkind'
16315 quadtype='$quadtype'
16316 randbits='$randbits'
16317 randfunc='$randfunc'
16318 randseedtype='$randseedtype'
16320 rd_nodata='$rd_nodata'
16321 revision='$revision'
16325 sPRIEUldbl='$sPRIEUldbl'
16326 sPRIFUldbl='$sPRIFUldbl'
16327 sPRIGUldbl='$sPRIGUldbl'
16328 sPRIXU64='$sPRIXU64'
16330 sPRIeldbl='$sPRIeldbl'
16331 sPRIfldbl='$sPRIfldbl'
16332 sPRIgldbl='$sPRIgldbl'
16337 sSCNfldbl='$sSCNfldbl'
16338 sched_yield='$sched_yield'
16339 scriptdir='$scriptdir'
16340 scriptdirexp='$scriptdirexp'
16342 seedfunc='$seedfunc'
16343 selectminbits='$selectminbits'
16344 selecttype='$selecttype'
16345 sendmail='$sendmail'
16348 sharpbang='$sharpbang'
16349 shmattype='$shmattype'
16350 shortsize='$shortsize'
16353 sig_count='$sig_count'
16354 sig_name='$sig_name'
16355 sig_name_init='$sig_name_init'
16357 sig_num_init='$sig_num_init'
16358 signal_t='$signal_t'
16359 sitearch='$sitearch'
16360 sitearchexp='$sitearchexp'
16362 sitebinexp='$sitebinexp'
16364 sitelib_stem='$sitelib_stem'
16365 sitelibexp='$sitelibexp'
16366 siteprefix='$siteprefix'
16367 siteprefixexp='$siteprefixexp'
16368 sizesize='$sizesize'
16369 sizetype='$sizetype'
16373 sockethdr='$sockethdr'
16374 socketlib='$socketlib'
16375 socksizetype='$socksizetype'
16377 spackage='$spackage'
16378 spitshell='$spitshell'
16380 ssizetype='$ssizetype'
16381 startperl='$startperl'
16383 static_ext='$static_ext'
16385 stdio_base='$stdio_base'
16386 stdio_bufsiz='$stdio_bufsiz'
16387 stdio_cnt='$stdio_cnt'
16388 stdio_filbuf='$stdio_filbuf'
16389 stdio_ptr='$stdio_ptr'
16390 stdio_stream_array='$stdio_stream_array'
16393 subversion='$subversion'
16400 timeincl='$timeincl'
16401 timetype='$timetype'
16414 uidformat='$uidformat'
16420 uquadtype='$uquadtype'
16421 use5005threads='$use5005threads'
16422 use64bitall='$use64bitall'
16423 use64bitint='$use64bitint'
16425 useithreads='$useithreads'
16426 uselargefiles='$uselargefiles'
16427 uselongdouble='$uselongdouble'
16428 usemorebits='$usemorebits'
16429 usemultiplicity='$usemultiplicity'
16430 usemymalloc='$usemymalloc'
16432 useopcode='$useopcode'
16433 useperlio='$useperlio'
16434 useposix='$useposix'
16436 useshrplib='$useshrplib'
16437 usesocks='$usesocks'
16438 usethreads='$usethreads'
16439 usevendorprefix='$usevendorprefix'
16440 usevfork='$usevfork'
16443 uvXUformat='$uvXUformat'
16444 uvoformat='$uvoformat'
16447 uvuformat='$uvuformat'
16448 uvxformat='$uvxformat'
16449 vendorarch='$vendorarch'
16450 vendorarchexp='$vendorarchexp'
16451 vendorbin='$vendorbin'
16452 vendorbinexp='$vendorbinexp'
16453 vendorlib='$vendorlib'
16454 vendorlib_stem='$vendorlib_stem'
16455 vendorlibexp='$vendorlibexp'
16456 vendorprefix='$vendorprefix'
16457 vendorprefixexp='$vendorprefixexp'
16459 versiononly='$versiononly'
16461 voidflags='$voidflags'
16463 xs_apiversion='$xs_apiversion'
16468 : Add in command line options if available
16469 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
16471 : add special variables
16472 $test -f $src/patchlevel.h && \
16473 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
16474 echo "CONFIGDOTSH=true" >>config.sh
16476 : propagate old symbols
16477 if $test -f UU/config.sh; then
16478 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
16479 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
16480 $sort | $uniq -u >UU/oldsyms
16481 set X `cat UU/oldsyms`
16487 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
16489 echo "# Variables propagated from previous config.sh file." >>config.sh
16490 for sym in `cat UU/oldsyms`; do
16491 echo " Propagating $hint variable "'$'"$sym..."
16492 eval 'tmp="$'"${sym}"'"'
16494 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
16500 : Finish up by extracting the .SH files
16514 If you'd like to make any changes to the config.sh file before I begin
16515 to configure things, do it as a shell escape now (e.g. !vi config.sh).
16518 rp="Press return or use a shell escape to edit config.sh:"
16523 *) : in case they cannot read
16524 sh 1>&4 -c "$ans";;
16529 : if this fails, just run all the .SH files by hand
16536 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
16543 Now you need to generate make dependencies by running "$make depend".
16544 You might prefer to run it in background: "$make depend > makedepend.out &"
16545 It can take a while, so you might not want to run it right now.
16550 rp="Run $make depend now?"
16554 $make depend && echo "Now you must run '$make'."
16557 echo "You must run '$make depend' then '$make'."
16560 elif test -f [Mm]akefile; then
16562 echo "Now you must run a $make."
16567 if $test -f Policy.sh; then
16570 If you compile $package on a different machine or from a different object
16571 directory, copy the Policy.sh file from this object directory to the
16572 new one before you run Configure -- this will help you with most of
16573 the policy defaults.
16577 if $test -f config.msg; then
16578 echo "Hmm. I also noted the following information while running:"
16580 $cat config.msg >&4
16583 $rm -f kit*isdone ark*isdone