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 Thu Aug 9 16:34:00 EET DST 2001 [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
488 d_old_pthread_create_joinable=''
489 old_pthread_create_joinable=''
577 d_stdio_ptr_lval_nochange_cnt=''
578 d_stdio_ptr_lval_sets_cnt=''
764 inc_version_list_init=''
783 ignore_versioned_solibs=''
842 d_perl_otherlibdirs=''
856 version_patchlevel_string=''
861 d_nv_preserves_uv_bits=''
960 d_stdio_stream_array=''
961 stdio_stream_array=''
971 ccflags_uselargefiles=''
972 ldflags_uselargefiles=''
973 libswanted_uselargefiles=''
1019 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1022 : We must find out about Eunice early
1024 if test -f /etc/unixtovms; then
1025 eunicefix=/etc/unixtovms
1027 if test -f /etc/unixtovms.exe; then
1028 eunicefix=/etc/unixtovms.exe
1035 : set useposix=false in your hint file to disable the POSIX extension.
1037 : set useopcode=false in your hint file to disable the Opcode extension.
1039 : Trailing extension. Override this in a hint file, if needed.
1041 : Extra object files, if any, needed on this platform.
1044 : Possible local include directories to search.
1045 : Set locincpth to "" in a hint file to defeat local include searches.
1046 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1047 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1049 : no include file wanted by default
1054 : change the next line if compiling for Xenix/286 on Xenix/386
1055 xlibpth='/usr/lib/386 /lib/386'
1056 : Possible local library directories to search.
1057 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1058 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1060 : general looking path for locating libraries
1061 glibpth="/lib /usr/lib $xlibpth"
1062 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1063 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1064 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1066 : Private path used by Configure to find libraries. Its value
1067 : is prepended to libpth. This variable takes care of special
1068 : machines, like the mips. Usually, it should be empty.
1071 : default library list
1073 : some systems want to use only the non-versioned libso:s
1074 ignore_versioned_solibs=''
1076 ccflags_uselargefiles=''
1077 ldflags_uselargefiles=''
1078 libswanted_uselargefiles=''
1079 : set usemultiplicity on the Configure command line to enable multiplicity.
1080 : set usesocks on the Configure command line to enable socks.
1081 : set usethreads on the Configure command line to enable threads.
1082 usereentrant='undef'
1083 : full support for void wanted by default
1086 : List of libraries we want.
1087 : If anyone needs -lnet, put it in a hint file.
1088 libswanted='sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl'
1089 libswanted="$libswanted dld ld sun m c cposix posix"
1090 libswanted="$libswanted ndir dir crypt sec"
1091 libswanted="$libswanted ucb bsd BSD PW x iconv util"
1092 : We probably want to search /usr/shlib before most other libraries.
1093 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1094 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1095 glibpth="/usr/shlib $glibpth"
1096 : Do not use vfork unless overridden by a hint file.
1099 : Find the basic shell for Bourne shell scripts
1103 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1106 if test -f "$xxx"; then
1109 : Build up a list and do a single loop so we can 'break' out.
1110 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1111 for xxx in sh bash ksh pdksh ash; do
1113 try="$try ${p}/${xxx}"
1117 if test -f "$xxx"; then
1120 elif test -f "$xxx.exe"; then
1131 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1133 Usually it's in /bin/sh. How did you even get this far?
1134 Please contact me (Perl Maintainers) at perlbug@perl.org and
1135 we'll try to straighten this all out.
1141 : see if sh knows # comments
1142 if `$sh -c '#' >/dev/null 2>&1`; then
1146 test -f $xcat || xcat=/usr/bin/cat
1147 echo "#!$xcat" >sharp
1151 if test -s today; then
1154 echo "#! $xcat" > sharp
1158 if test -s today; then
1166 echo "Your $sh doesn't grok # comments--I will strip them later on."
1169 echo "exec grep -v '^[ ]*#'" >spitshell
1171 $eunicefix spitshell
1172 spitshell=`pwd`/spitshell
1174 echo "I presume that if # doesn't work, #! won't work either!"
1179 : figure out how to guarantee sh startup
1181 '') startsh=${sharpbang}${sh} ;;
1193 : echo "Yup, it does."
1195 echo "Hmm... '$startsh' does not guarantee sh startup..."
1196 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1201 : Save command line options in file UU/cmdline.opt for later use in
1202 : generating config.sh.
1203 cat > cmdline.opt <<EOSH
1204 # Configure command line arguments.
1213 cat >>cmdline.opt <<EOSH
1214 config_arg$argn='$arg'
1216 # Extreme backslashitis: replace each ' by '"'"'
1217 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1220 arg_exp=`cat cmdl.opt`
1221 args_exp="$args_exp$args_sep'$arg_exp'"
1222 argn=`expr $argn + 1`
1225 # args_exp is good for restarting self: eval "set X $args_exp"; shift; $0 "$@"
1226 # used by ./hints/os2.sh
1229 : produce awk script to parse command line options
1230 cat >options.awk <<'EOF'
1232 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1234 len = length(optstr);
1235 for (i = 1; i <= len; i++) {
1236 c = substr(optstr, i, 1);
1237 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1248 if (substr(str, 1, 1) != "-") {
1249 printf("'%s'\n", str);
1253 for (i = 2; i <= len; i++) {
1254 c = substr(str, i, 1);
1256 printf("-%s\n", substr(str, i));
1262 printf("'%s'\n", substr(str, i + 1));
1275 : process the command line options
1276 set X `for arg in "$@"; do echo "X$arg"; done |
1277 sed -e s/X// | awk -f options.awk`
1282 : set up default values
1292 rm -f optdef.sh posthint.sh
1293 cat >optdef.sh <<EOS
1299 while test $# -gt 0; do
1301 -d) shift; fastread=yes;;
1302 -e) shift; alldone=cont;;
1306 if test -r "$1"; then
1309 echo "$me: cannot read config file $1." >&2
1314 -h) shift; error=true;;
1315 -r) shift; reuseval=true;;
1316 -s) shift; silent=true; realsilent=true;;
1317 -E) shift; alldone=exit;;
1318 -K) shift; knowitall=true;;
1319 -O) shift; override=true;;
1320 -S) shift; silent=true; extractsh=true;;
1325 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1326 echo "$me: ignoring -D $1" >&2
1329 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1330 *) echo "$1='define'" >> optdef.sh;;
1337 *=) echo "$1" >> optdef.sh;;
1339 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1340 echo "$me: ignoring -U $1" >&2
1342 *) echo "$1='undef'" >> optdef.sh;;
1353 *=*) zzz=`echo $yyy|sed 's!=.*!!'`
1357 zzz=" "`echo $yyy|sed 's!^[^=]*=!!'`
1358 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1364 *:*) xxx=`echo $yyy|sed 's!:.*!!'`
1365 yyy=`echo $yyy|sed 's!^[^:]*:!!'`
1366 zzz=`echo $yyy|sed 's!^[^=]*=!!'`
1367 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1368 *) xxx=`echo $yyy|sed 's!:.*!!'`
1369 yyy=`echo $yyy|sed 's!^[^:]*:!!'` ;;
1375 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1377 echo "$yyy=''" >> posthint.sh ;;
1382 echo "$yyy='$zzz'" >> posthint.sh ;;
1384 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1386 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1391 echo "$yyy=$zzz" >> posthint.sh ;;
1392 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1396 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1399 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1407 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1408 [-U symbol] [-U symbol=] [-A command:symbol...]
1409 -d : use defaults for all answers.
1410 -e : go on without questioning past the production of config.sh.
1411 -f : specify an alternate default configuration file.
1412 -h : print this help message and exit (with an error status).
1413 -r : reuse C symbols value if possible (skips costly nm extraction).
1414 -s : silent mode, only echoes questions and essential information.
1415 -D : define symbol to have some value:
1416 -D symbol symbol gets the value 'define'
1417 -D symbol=value symbol gets the value 'value'
1418 -E : stop at the end of questions, after having produced config.sh.
1419 -K : do not use unless you know what you are doing.
1420 -O : let -D and -U override definitions from loaded configuration file.
1421 -S : perform variable substitutions on all .SH files (can mix with -f)
1422 -U : undefine symbol:
1423 -U symbol symbol gets the value 'undef'
1424 -U symbol= symbol gets completely empty
1425 -A : manipulate symbol after the platform specific hints have been applied:
1426 -A symbol=value append " "value to symbol
1427 -A append:symbol=value append value to symbol
1428 -A define:symbol=value define symbol to have value
1429 -A clear:symbol define symbol to be ''
1430 -A define:symbol define symbol to be 'define'
1431 -A eval:symbol=value define symbol to be eval of value
1432 -A prepend:symbol=value prepend value to symbol
1433 -A undef:symbol define symbol to be 'undef'
1434 -A undef:symbol= define symbol to be ''
1435 -V : print version number and exit (with a zero status).
1442 case "$fastread$alldone" in
1445 case "$extractsh" in
1448 if test ! -t 0; then
1449 echo "Say 'sh Configure', not 'sh <Configure'"
1459 true) exec 1>/dev/null;;
1462 : run the defines and the undefines, if any, but leave the file out there...
1465 : create the posthint manipulation script and leave the file out there...
1470 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1471 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1472 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1473 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1474 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1477 : Some greps do not return status, grrr.
1478 echo "grimblepritz" >grimble
1479 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1481 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1487 : the following should work in any shell
1491 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1492 cat >contains <<'EOSS'
1493 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1498 : Find the path to the source tree
1501 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1505 *) src=`cd ../$src && pwd` ;;
1518 if test -f $rsrc/Configure && \
1519 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1521 : found it, so we are ok.
1524 for src in . .. ../.. ../../.. ../../../..; do
1525 if test -f ../$src/Configure && \
1526 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1537 Sorry, I can't seem to locate the source dir for $package. Please start
1538 Configure with an explicit path -- i.e. /some/path/Configure.
1546 echo "Sources for $package found in \"$src\"." >&4
1550 : script used to extract .SH files with variable substitutions
1551 cat >extract <<'EOS'
1553 echo "Doing variable substitutions on .SH files..."
1554 if test -f MANIFEST; then
1555 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1557 echo "(Looking for .SH files under the source directory.)"
1558 set x `(cd $src; find . -name "*.SH" -print)`
1562 0) set x `(cd $src; echo *.SH)`; shift;;
1564 if test ! -f $src/$1; then
1570 while test $name; do
1571 if test ! -d "$name"; then
1572 create="$name $create";
1573 name=`echo $name | sed -e "s|^[^/]*$||"`;
1574 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1579 for file in $create; do
1588 dir=`expr X$file : 'X\(.*\)/'`
1589 file=`expr X$file : 'X.*/\(.*\)'`
1590 (cd $dir && . ./$file)
1600 dir=`expr X$file : 'X\(.*\)/'`
1601 file=`expr X$file : 'X.*/\(.*\)'`
1602 (set x $dir; shift; eval $mkdir_p)
1612 if test -f $src/config_h.SH; then
1613 if test ! -f config.h; then
1614 : oops, they left it out of MANIFEST, probably, so do it anyway.
1620 : extract files and exit if asked to do so
1621 case "$extractsh" in
1623 case "$realsilent" in
1627 case "$config_sh" in
1628 '') config_sh='config.sh';;
1631 echo "Fetching answers from $config_sh..."
1634 test "$override" && . ./optdef.sh
1638 echo "Extraction done."
1643 : Eunice requires " " instead of "", can you believe it
1646 echo "Beginning of configuration questions for $package."
1648 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1650 : first determine how to suppress newline on echo command
1652 echo "Checking echo to see how to suppress newlines..."
1653 (echo "hi there\c" ; echo " ") >.echotmp
1654 if $contains c .echotmp >/dev/null 2>&1 ; then
1665 echo $n "The star should be here-->$c"
1669 : Now test for existence of everything in MANIFEST
1671 if test -f $rsrc/MANIFEST; then
1672 echo "First let's make sure your kit is complete. Checking..." >&4
1673 awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
1676 for filelist in x??; do
1677 (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
1679 if test -s missing; then
1683 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1685 You have the option of continuing the configuration process, despite the
1686 distinct possibility that your kit is damaged, by typing 'y'es. If you
1687 do, don't blame me if something goes wrong. I advise you to type 'n'o
1688 and contact the author (perlbug@perl.org).
1691 echo $n "Continue? [n] $c" >&4
1695 echo "Continuing..." >&4
1699 echo "ABORTING..." >&4
1704 echo "Looks good..."
1707 echo "There is no MANIFEST file. I hope your kit is complete !"
1712 : Find the appropriate value for a newline for tr
1713 if test -n "$DJGPP"; then
1716 if test X"$trnl" = X; then
1717 case "`echo foo|tr '\n' x 2>/dev/null`" in
1721 if test X"$trnl" = X; then
1722 case "`echo foo|tr '\012' x 2>/dev/null`" in
1723 foox) trnl='\012' ;;
1726 if test X"$trnl" = X; then
1729 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1735 : compute the number of columns on the terminal for proper question formatting
1740 : set up the echo used in my read
1741 myecho="case \"\$xxxm\" in
1742 '') echo $n \"\$rp $c\" >&4;;
1744 '') echo $n \"[\$xxxm] $c\";;
1746 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1748 echo $n \"[\$xxxm] $c\" >&4
1750 echo $n \"\$rp [\$xxxm] $c\" >&4
1756 : now set up to do reads with possible shell escape and default assignment
1762 case "\$fastread" in
1763 yes) case "\$dflt" in
1766 case "\$silent-\$rp" in
1771 *) case "\$silent" in
1772 true) case "\$rp" in
1777 while expr "X\$ans" : "X!" >/dev/null; do
1781 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1789 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1798 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1803 echo "(OK, I'll run with -d after this question.)" >&4
1806 echo "*** Sorry, \$1 not supported yet." >&4
1816 echo "*** Substitution done -- please confirm."
1818 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1823 echo "*** Error -- try again."
1830 case "\$ans\$xxxm\$nostick" in
1842 : create .config dir to save info across Configure sessions
1843 test -d ../.config || mkdir ../.config
1844 cat >../.config/README <<EOF
1845 This directory created by Configure to save information that should
1846 persist across sessions for $package.
1848 You may safely delete it if you wish.
1851 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
1853 $define|true|[yY]*) ;;
1854 *) case "$xversion" in
1857 *** WHOA THERE!!! ***
1859 This is an UNSTABLE DEVELOPMENT release.
1860 The version of this $package distribution is $xversion, that is, odd,
1861 (as opposed to even) and that signifies a development release.
1862 If you want a maintenance release, you want an even-numbered version.
1864 Do ***NOT*** install this into production use.
1865 Data corruption and crashes are possible.
1867 It is most seriously suggested that you do not continue any further
1868 unless you want to help in developing and debugging Perl.
1870 If you *still* want to build perl, you can answer 'y' now,
1871 or pass -Dusedevel to Configure.
1874 rp='Do you really want to continue?'
1878 [yY]) echo >&4 "Okay, continuing."
1879 usedevel="$define" ;;
1880 *) echo >&4 "Okay, bye."
1890 case "$versiononly" in
1891 '') versiononly="$define" ;;
1893 case "$installusrbinperl" in
1894 '') installusrbinperl="$undef" ;;
1899 : general instructions
1902 user=`(logname) 2>/dev/null`
1904 '') user=`whoami 2>&1`;;
1906 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1909 rp='Would you like to see the instructions?'
1920 This installation shell script will examine your system and ask you questions
1921 to determine how the perl5 package should be installed. If you get
1922 stuck on a question, you may use a ! shell escape to start a subshell or
1923 execute a command. Many of the questions will have default answers in square
1924 brackets; typing carriage return will give you the default.
1926 On some of the questions which ask for file or directory names you are allowed
1927 to use the ~name construct to specify the login directory belonging to "name",
1928 even if you don't have a shell which knows about that. Questions where this is
1929 allowed will be marked "(~name ok)".
1933 dflt='Type carriage return to continue'
1937 The prompter used in this script allows you to use shell variables and
1938 backticks in your answers. You may use $1, $2, etc... to refer to the words
1939 in the default answer, as if the default line was a set of arguments given to a
1940 script shell. This means you may also use $* to repeat the whole default line,
1941 so you do not have to re-type everything to add something to the default.
1943 Everytime there is a substitution, you will have to confirm. If there is an
1944 error (e.g. an unmatched backtick), the default answer will remain unchanged
1945 and you will be prompted again.
1947 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1948 the questions and use the computed defaults (or the previous answers if there
1949 was already a config.sh file). Type 'Configure -h' for a list of options.
1950 You may also start interactively and then answer '& -d' at any prompt to turn
1951 on the non-interactive behaviour for the remainder of the execution.
1957 Much effort has been expended to ensure that this shell script will run on any
1958 Unix system. If despite that it blows up on yours, your best bet is to edit
1959 Configure and run it again. If you can't run Configure for some reason,
1960 you'll have to generate a config.sh file by hand. Whatever problems you
1961 have, let me (perlbug@perl.org) know how I blew it.
1963 This installation script affects things in two ways:
1965 1) it may do direct variable substitutions on some of the files included
1967 2) it builds a config.h file for inclusion in C programs. You may edit
1968 any of these files as the need arises after running this script.
1970 If you make a mistake on a question, there is no easy way to back up to it
1971 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1972 files. Configure will offer to let you do this before it runs the SH files.
1975 dflt='Type carriage return to continue'
1977 case "$firsttime" in
1978 true) echo $user >>../.config/instruct;;
1982 : find out where common programs are
1984 echo "Locating common programs..." >&4
1997 if test -d \$dir/\$thing; then
2003 for thisthing in \$dir/\$thing; do
2004 : just loop through to pick last item
2006 if test -f \$thisthing; then
2009 elif test -f \$dir/\$thing.exe; then
2010 if test -n "$DJGPP"; then
2011 echo \$dir/\$thing.exe
2013 : on Eunice apparently
2065 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2066 pth="$pth /lib /usr/lib"
2067 for file in $loclist; do
2071 if test -f "$xxx"; then
2074 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2075 xxx=`./loc $file $file $pth`
2078 '') xxx=`./loc $file $file $pth`;;
2079 *) xxx=`./loc $xxx $xxx $pth`;;
2085 echo $file is in $xxx.
2088 echo $file is in $xxx.
2091 echo "I don't know where '$file' is, and my life depends on it." >&4
2092 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2098 echo "Don't worry if any of the following aren't found..."
2100 for file in $trylist; do
2104 if test -f "$xxx"; then
2107 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2108 xxx=`./loc $file $file $pth`
2111 '') xxx=`./loc $file $file $pth`;;
2112 *) xxx=`./loc $xxx $xxx $pth`;;
2118 echo $file is in $xxx.
2121 echo $file is in $xxx.
2124 echo "I don't see $file out there, $say."
2131 echo "Substituting grep for egrep."
2137 echo "Substituting cp for ln."
2143 echo "Hopefully test is built into your sh."
2146 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2147 echo "Using the test built into your sh."
2155 echo "Hopefully echo is built into your sh."
2160 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2161 $echo $n "hi there$c" >foo1
2162 echo $n "hi there$c" >foo2
2163 if cmp foo1 foo2 >/dev/null 2>&1; then
2164 echo "They are compatible. In fact, they may be identical."
2171 They are not compatible! You are probably running ksh on a non-USG system.
2172 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2173 have echo built in and we may have to run some Bourne shell scripts. That
2174 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2177 $echo $n "The star should be here-->$c"
2187 cat <<'EOSC' >>checkcc
2192 int main(int argc, char *argv[]) {
2196 if $cc -o try $ccflags $ldflags try.c; then
2199 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2205 case "`$cc -v -c try.c 2>&1`" in
2208 if $test X"$trygcc" = Xyes; then
2209 if gcc -o try -c try.c; then
2211 echo "You seem to have a working gcc, though." >&4
2212 rp="Would you like to use it?"
2214 if $test -f myread; then
2217 if $test -f UU/myread; then
2220 echo "Cannot find myread, sorry. Aborting." >&2
2225 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no ;;
2229 if $test X"$despair" = Xyes; then
2231 You need to find a working C compiler.
2232 Either (purchase and) install the C compiler supplied by your OS vendor,
2233 or for a free C compiler try http://gcc.gnu.org/
2234 I cannot continue any further, aborting.
2244 : determine whether symbolic links are supported
2247 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2248 echo "Symbolic links are supported." >&4
2251 echo "Symbolic links are NOT supported." >&4
2256 : determine whether symbolic links are supported
2260 echo "Checking how to test for symbolic links..." >&4
2262 if $test "X$issymlink" = X; then
2263 sh -c "PATH= test -h sym" >/dev/null 2>&1
2264 if test $? = 0; then
2268 if $test "X$issymlink" = X; then
2269 if $test -h >/dev/null 2>&1; then
2270 issymlink="$test -h"
2271 echo "Your builtin 'test -h' may be broken, I'm using external '$test -h'." >&4
2274 if $test "X$issymlink" = X; then
2275 if $test -L sym 2>/dev/null; then
2276 issymlink="$test -L"
2279 if $test "X$issymlink" != X; then
2280 echo "You can test for symbolic links with '$issymlink'." >&4
2282 echo "I do not know how you can test for symbolic links." >&4
2286 *) echo "No symbolic links, so not testing for their testing..." >&4
2292 case "$mksymlinks" in
2295 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2298 *) case "$lns:$issymlink" in
2299 *"ln -s:"*"test -"?)
2300 echo "Creating the symbolic links..." >&4
2301 echo "(First creating the subdirectories...)" >&4
2303 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2305 test -z "$directory" && break
2309 if test ! -d t/base; then
2310 echo "Failed to create the subdirectories. Aborting." >&4
2313 echo "(Then creating the symlinks...)" >&4
2314 awk '{print $1}' $src/MANIFEST | while true; do
2316 test -z "$filename" && break
2317 if test -f $filename; then
2318 if $issymlink $filename; then
2322 if test -f $filename; then
2323 echo "$filename already exists, not symlinking."
2325 ln -s $src/$filename $filename
2329 if test ! -f t/base/lex.t; then
2330 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2335 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2344 case "$usecrosscompile" in
2346 $echo "Cross-compiling..."
2349 *-*-gcc) # A cross-compiling gcc, probably.
2350 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2352 # leave out ld, choosing it is more complex
2354 ranlib=$targetarch-ranlib
2355 $echo 'extern int foo;' > try.c
2356 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2358 if $test $# -gt 0; then
2360 incpth="`$echo $incpth|$sed 's/^ //'`"
2361 echo "Guessing incpth '$incpth'." >&4
2363 j="`$echo $i|$sed 's,/include$,/lib,'`"
2364 if $test -d $j; then
2368 libpth="`$echo $libpth|$sed 's/^ //'`"
2369 echo "Guessing libpth '$libpth'." >&4
2374 case "$targetarch" in
2375 '') echo "Targetarch not defined." >&4; croak=y ;;
2376 *) echo "Using targetarch $targetarch." >&4 ;;
2379 '') echo "Incpth not defined." >&4; croak=y ;;
2380 *) echo "Using incpth '$incpth'." >&4 ;;
2383 '') echo "Libpth not defined." >&4; croak=y ;;
2384 *) echo "Using libpth '$libpth'." >&4 ;;
2387 '') for i in $incpth; do
2388 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2390 echo "Guessing usrinc $usrinc." >&4
2395 '') echo "Usrinc not defined." >&4; croak=y ;;
2398 *) echo "Using usrinc $usrinc." >&4 ;;
2400 case "$targethost" in
2401 '') echo "Targethost not defined." >&4; croak=y ;;
2402 *) echo "Using targethost $targethost." >&4
2407 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2410 /*) run=$src/Cross/run
2411 targetmkdir=$src/Cross/mkdir
2413 from=$src/Cross/from
2415 *) pwd=`$test -f ../Configure & cd ..; pwd`
2417 targetmkdir=$pwd/Cross/mkdir
2419 from=$pwd/Cross/from
2422 case "$targetrun" in
2423 '') targetrun=ssh ;;
2428 case "$targetfrom" in
2429 '') targetfrom=scp ;;
2433 from=$from-$targetfrom
2434 case "$targetdir" in
2436 echo "Guessing targetdir $targetdir." >&4
2439 case "$targetuser" in
2441 echo "Guessing targetuser $targetuser." >&4
2444 case "$targetfrom" in
2448 case "$targetrun" in
2460 '') cwd=$targetdir ;;
2464 if $test ! -f \$exe.xok; then
2468 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2471 *) echo "Unknown targetrun '$targetrun'" >&4
2475 case "$targetmkdir" in
2477 cat >$targetmkdir <<EOF
2479 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2481 $chmod a+rx $targetmkdir
2483 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2495 $targetmkdir \`dirname \$f\`
2496 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2499 $targetmkdir $targetdir/\`dirname \$f\`
2500 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2513 $mkdir -p $targetdir/\`dirname \$f\`
2514 $cp \$f $targetdir/\$f || exit 1
2517 $targetmkdir $targetdir/\`dirname \$f\`
2518 $cp \$f $targetdir/\$f || exit 1
2525 *) echo "Unknown targetto '$targetto'" >&4
2529 case "$targetfrom" in
2536 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2541 cp) cat >$from <<EOF
2546 cp $targetdir/\$f . || exit 1
2551 *) echo "Unknown targetfrom '$targetfrom'" >&4
2555 if $test ! -f $run; then
2556 echo "Target 'run' script '$run' not found." >&4
2560 if $test ! -f $to; then
2561 echo "Target 'to' script '$to' not found." >&4
2565 if $test ! -f $from; then
2566 echo "Target 'from' script '$from' not found." >&4
2570 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2574 Using '$run' for remote execution,
2575 and '$from' and '$to'
2576 for remote file transfer.
2582 usecrosscompile='undef'
2587 : see whether [:lower:] and [:upper:] are supported character classes
2589 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2591 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2595 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
2596 # (0xc9 and 0xd1), therefore that is a nice testing point.
2597 if test "X$up" = X -o "X$low" = X; then
2598 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
2604 if test "X$up" = X -o "X$low" = X; then
2605 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
2611 if test "X$up" = X -o "X$low" = X; then
2612 case "`echo IJ | od -x 2>/dev/null`" in
2614 echo "Hey, this might be EBCDIC." >&4
2615 if test "X$up" = X -o "X$low" = X; then
2616 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2617 ij) up='[A-IJ-RS-Z]'
2622 if test "X$up" = X -o "X$low" = X; then
2623 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2633 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
2635 echo "Using $up and $low to convert case." >&4
2638 echo "I don't know how to translate letters from upper to lower case." >&4
2639 echo "Your tr is not acting any way I know of." >&4
2643 : set up the translation script tr, must be called with ./tr of course
2647 '[A-Z][a-z]') exec $tr '$up' '$low';;
2648 '[a-z][A-Z]') exec $tr '$low' '$up';;
2655 : Try to determine whether config.sh was made on this system
2656 case "$config_sh" in
2658 myuname=`$uname -a 2>/dev/null`
2659 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2660 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2661 # because the A-Z/a-z are not consecutive.
2662 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2663 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2664 newmyuname="$myuname"
2666 case "$knowitall" in
2668 if test -f ../config.sh; then
2669 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2670 eval "`grep myuname= ../config.sh`"
2672 if test "X$myuname" = "X$newmyuname"; then
2680 : Get old answers from old config file if Configure was run on the
2681 : same system, otherwise use the hints.
2684 if test -f config.sh; then
2686 rp="I see a config.sh file. Shall I use it to set the defaults?"
2689 n*|N*) echo "OK, I'll ignore it."
2690 mv config.sh config.sh.old
2691 myuname="$newmyuname"
2693 *) echo "Fetching default answers from your old config.sh file..." >&4
2701 : Older versions did not always set $sh. Catch re-use of such
2711 if test ! -f config.sh; then
2714 First time through, eh? I have some defaults handy for some systems
2715 that need some extra help getting the Configure answers right:
2718 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2720 : Half the following guesses are probably wrong... If you have better
2721 : tests or hints, please send them to perlbug@perl.org
2722 : The metaconfig authors would also appreciate a copy...
2723 $test -f /irix && osname=irix
2724 $test -f /xenix && osname=sco_xenix
2725 $test -f /dynix && osname=dynix
2726 $test -f /dnix && osname=dnix
2727 $test -f /lynx.os && osname=lynxos
2728 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2729 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
2730 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2731 $test -f /bin/mips && /bin/mips && osname=mips
2732 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
2733 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
2734 $test -d /usr/apollo/bin && osname=apollo
2735 $test -f /etc/saf/_sactab && osname=svr4
2736 $test -d /usr/include/minix && osname=minix
2737 if $test -d /MachTen -o -d /MachTen_Folder; then
2739 if $test -x /sbin/version; then
2740 osvers=`/sbin/version | $awk '{print $2}' |
2741 $sed -e 's/[A-Za-z]$//'`
2742 elif $test -x /usr/etc/version; then
2743 osvers=`/usr/etc/version | $awk '{print $2}' |
2744 $sed -e 's/[A-Za-z]$//'`
2750 $test -f /sys/posix.dll &&
2751 $test -f /usr/bin/what &&
2752 set X `/usr/bin/what /sys/posix.dll` &&
2753 $test "$3" = UWIN &&
2757 if $test -f $uname; then
2765 umips) osname=umips ;;
2768 [23]100) osname=mips ;;
2769 next*) osname=next ;;
2771 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
2772 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
2775 elif $test -f /etc/kconfig; then
2777 if test "$lns" = "$ln -s"; then
2779 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
2781 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
2788 if test -n "$DJGPP"; then
2797 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
2799 'not found') osvers="$4"."$3" ;;
2800 '<3240'|'<>3240') osvers=3.2.0 ;;
2801 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
2802 '=3250'|'>3250') osvers=3.2.5 ;;
2806 bsd386) osname=bsd386
2809 cygwin*) osname=cygwin
2812 *dc.osx) osname=dcosx
2818 domainos) osname=apollo
2824 dynixptx*) osname=dynixptx
2825 osvers=`echo "$4"|sed 's/^v//'`
2827 freebsd) osname=freebsd
2829 genix) osname=genix ;;
2831 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
2847 netbsd*) osname=netbsd
2850 news-os) osvers="$3"
2852 4*) osname=newsos4 ;;
2856 next*) osname=next ;;
2857 nonstop-ux) osname=nonstopux ;;
2858 POSIX-BC | posix-bc ) osname=posix-bc
2861 powerux | power_ux | powermax_os | powermaxos | \
2862 powerunix | power_unix) osname=powerux
2868 solaris) osname=solaris
2870 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2877 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2881 titanos) osname=titanos
2890 ultrix) osname=ultrix
2893 osf1|mls+) case "$5" in
2896 osvers=`sizer -v | awk '{print $3}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
2899 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
2902 hp*) osname=hp_osf1 ;;
2903 mips) osname=mips_osf1 ;;
2906 unixware) osname=svr5
2912 $2) case "$osname" in
2916 : svr4.x or possibly later
2926 if test -f /stand/boot ; then
2927 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
2928 if test -n "$INITPROG" -a -f "$INITPROG"; then
2929 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
2930 if test -n "$isesix"; then
2938 *) if test -f /etc/systemid; then
2940 set `echo $3 | $sed 's/\./ /g'` $4
2941 if $test -f $src/hints/sco_$1_$2_$3.sh; then
2943 elif $test -f $src/hints/sco_$1_$2.sh; then
2945 elif $test -f $src/hints/sco_$1.sh; then
2950 '') : Still unknown. Probably a generic Sys V.
2959 *) case "$osname" in
2960 '') : Still unknown. Probably a generic BSD.
2968 if test -f /vmunix -a -f $src/hints/news_os.sh; then
2969 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
2970 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
2973 $rm -f UU/kernel.what
2974 elif test -d c:/.; then
2981 case "$targetarch" in
2984 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
2989 : Now look for a hint file osname_osvers, unless one has been
2990 : specified already.
2993 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
2994 : Also try without trailing minor version numbers.
2995 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
2996 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
2997 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
2998 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3001 *) case "$osvers" in
3004 *) if $test -f $src/hints/$file.sh ; then
3006 elif $test -f $src/hints/$xfile.sh ; then
3008 elif $test -f $src/hints/$xxfile.sh ; then
3010 elif $test -f $src/hints/$xxxfile.sh ; then
3012 elif $test -f $src/hints/$xxxxfile.sh ; then
3014 elif $test -f "$src/hints/${osname}.sh" ; then
3023 if $test -f Policy.sh ; then
3026 none) dflt="Policy" ;;
3027 *) dflt="Policy $dflt" ;;
3032 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3036 if $test -f Policy.sh ; then
3039 There's also a Policy hint file available, which should make the
3040 site-specific (policy) questions easier to answer.
3047 You may give one or more space-separated answers, or "none" if appropriate.
3048 A well-behaved OS will have no hints, so answering "none" or just "Policy"
3049 is a good thing. DO NOT give a wrong version or a wrong OS.
3053 rp="Which of these apply, if any?"
3056 for file in $tans; do
3057 if $test X$file = XPolicy -a -f Policy.sh; then
3059 $cat Policy.sh >> UU/config.sh
3060 elif $test -f $src/hints/$file.sh; then
3061 . $src/hints/$file.sh
3062 $cat $src/hints/$file.sh >> UU/config.sh
3063 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3066 : Give one chance to correct a possible typo.
3067 echo "$file.sh does not exist"
3069 rp="hint to use instead?"
3071 for file in $ans; do
3072 if $test -f "$src/hints/$file.sh"; then
3073 . $src/hints/$file.sh
3074 $cat $src/hints/$file.sh >> UU/config.sh
3075 elif $test X$ans = X -o X$ans = Xnone ; then
3078 echo "$file.sh does not exist -- ignored."
3085 : Remember our hint file for later.
3086 if $test -f "$src/hints/$file.sh" ; then
3096 echo "Fetching default answers from $config_sh..." >&4
3100 cp $config_sh config.sh 2>/dev/null
3110 test "$override" && . ./optdef.sh
3112 : Restore computed paths
3113 for file in $loclist $trylist; do
3114 eval $file="\$_$file"
3119 Configure uses the operating system name and version to set some defaults.
3120 The default value is probably right if the name rings a bell. Otherwise,
3121 since spelling matters for me, either accept the default or answer "none"
3128 ''|' '|none) dflt=none ;;
3129 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3132 *) dflt="$osname" ;;
3134 rp="Operating system name?"
3138 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3144 ''|' '|none) dflt=none ;;
3145 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3146 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3148 ''|' ') dflt=none ;;
3153 *) dflt="$osvers" ;;
3155 rp="Operating system version?"
3165 : who configured the system
3166 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3167 cf_by=`(logname) 2>/dev/null`
3170 cf_by=`(whoami) 2>/dev/null`
3172 "") cf_by=unknown ;;
3176 : set up the script used to warn in case of inconsistency
3183 echo "*** WHOA THERE!!! ***" >&4
3184 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
3185 rp=" Keep the $hint value?"
3188 y) td=$was; tu=$was;;
3192 : function used to set $1 to $val
3193 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
3195 $define$undef) . ./whoa; eval "$var=\$td";;
3196 $undef$define) . ./whoa; eval "$var=\$tu";;
3197 *) eval "$var=$val";;
3200 case "$usethreads" in
3201 $define|true|[yY]*) dflt='y';;
3206 Perl can be built to take advantage of threads on some systems.
3207 To do so, Configure can be run with -Dusethreads.
3209 Note that threading is a highly experimental feature, and
3210 some known race conditions still remain. If you choose to try
3211 it, be very sure to not actually deploy it for production
3212 purposes. README.threads has more details, and is required
3213 reading if you enable threads.
3215 If this doesn't make any sense to you, just accept the default '$dflt'.
3217 rp='Build a threading Perl?'
3220 y|Y) val="$define" ;;
3226 case "$usethreads" in
3230 As of 5.5.640, Perl has two different internal threading implementations,
3231 the 5.005 version (5005threads) and an interpreter-based version
3232 (ithreads) that has one interpreter per thread. Both are very
3233 experimental. This arrangement exists to help developers work out
3234 which one is better.
3236 If you're a casual user, you probably don't want interpreter-threads
3237 at this time. There doesn't yet exist a way to create threads from
3238 within Perl in this model, i.e., "use Thread;" will NOT work.
3240 : Default to ithreads unless overridden on command line or with
3243 case "$use5005threads" in
3244 $define|true|[yY]*) dflt='n';;
3246 case "$useithreads" in
3247 $undef|false|[nN]*) dflt='n';;
3249 rp='Use interpreter-based ithreads?'
3252 y|Y) val="$define" ;;
3257 : Now set use5005threads to the opposite value.
3258 case "$useithreads" in
3259 $define) val="$undef" ;;
3266 useithreads="$undef"
3267 use5005threads="$undef"
3271 case "$useithreads$use5005threads" in
3275 You cannot have both the ithreads and the 5.005 threads enabled
3276 at the same time. Disabling the 5.005 threads since they are
3277 much less stable than the ithreads.
3280 use5005threads="$undef"
3284 case "$d_oldpthreads" in
3285 '') : Configure tests would be welcome here. For now, assume undef.
3287 *) val="$d_oldpthreads" ;;
3293 case "$usethreads" in
3294 "$define"|true|[yY]*)
3295 : Look for a hint-file generated 'call-back-unit'. If the
3296 : user has specified that a threading perl is to be built,
3297 : we may need to set or change some other defaults.
3298 if $test -f usethreads.cbu; then
3299 echo "Your platform has some specific hints for threaded builds, using them..."
3303 (Your platform doesn't have any specific hints for threaded builds.
3304 Assuming POSIX threads, then.)
3312 Perl can be built so that multiple Perl interpreters can coexist
3313 within the same Perl executable.
3316 case "$useithreads" in
3319 This multiple interpreter support is required for interpreter-based threads.
3323 *) case "$usemultiplicity" in
3324 $define|true|[yY]*) dflt='y';;
3328 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
3329 rp='Build Perl for multiplicity?'
3332 y|Y) val="$define" ;;
3341 case "$usemorebits" in
3342 "$define"|true|[yY]*)
3343 use64bitint="$define"
3344 uselongdouble="$define"
3345 usemorebits="$define"
3347 *) usemorebits="$undef"
3351 : make some quick guesses about what we are up against
3353 $echo $n "Hmm... $c"
3363 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
3364 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
3366 echo "Looks kind of like an OSF/1 system, but we'll see..."
3368 elif test `echo abc | $tr a-z A-Z` = Abc ; then
3369 xxx=`./loc addbib blurfl $pth`
3370 if $test -f $xxx; then
3371 echo "Looks kind of like a USG system with BSD features, but we'll see..."
3375 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
3376 echo "Looks kind of like an extended USG system, but we'll see..."
3378 echo "Looks kind of like a USG system, but we'll see..."
3382 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
3383 echo "Looks kind of like a BSD system, but we'll see..."
3387 echo "Looks kind of like a Version 7 system, but we'll see..."
3390 case "$eunicefix" in
3393 There is, however, a strange, musty smell in the air that reminds me of
3394 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
3398 : it so happens the Eunice I know will not run shell scripts in Unix format
3402 echo "Congratulations. You aren't running Eunice."
3406 : Detect OS2. The p_ variable is set above in the Head.U unit.
3407 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
3408 : semicolon as a patch separator
3413 I have the feeling something is not exactly right, however...don't tell me...
3414 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
3415 (Or you may be running DOS with DJGPP.)
3420 if test -f /xenix; then
3421 echo "Actually, this looks more like a XENIX system..."
3426 echo "It's not Xenix..."
3431 if test -f /venix; then
3432 echo "Actually, this looks more like a VENIX system..."
3439 echo "Nor is it Venix..."
3442 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3443 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3450 rp="Use which C compiler?"
3453 : Look for a hint-file generated 'call-back-unit'. Now that the
3454 : user has specified the compiler, we may need to set or change some
3456 if $test -f cc.cbu; then
3462 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3468 printf("%s\n", __VERSION__);
3470 printf("%s\n", "1");
3476 if $cc -o try $ccflags $ldflags try.c; then
3477 gccversion=`$run ./try`
3478 case "$gccversion" in
3479 '') echo "You are not using GNU cc." ;;
3480 *) echo "You are using GNU cc $gccversion."
3486 echo "*** WHOA THERE!!! ***" >&4
3487 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3488 case "$knowitall" in
3490 echo " You'd better start hunting for one and let me know about it." >&4
3496 case "$gccversion" in
3497 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3499 case "$gccversion" in
3500 '') gccosandvers='' ;;
3501 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
3502 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
3504 case "$gccosandvers" in
3505 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
3506 $osname$osvers) ;; # looking good
3507 $osname*) cat <<EOM >&4
3509 *** WHOA THERE!!! ***
3511 Your gcc has not been compiled for the exact release of
3512 your operating system ($gccosandvers versus $osname$osvers).
3514 In general it is a good idea to keep gcc synchronized with
3515 the operating system because otherwise serious problems
3516 may ensue when trying to compile software, like Perl.
3518 I'm trying to be optimistic here, though, and will continue.
3519 If later during the configuration and build icky compilation
3520 problems appear (headerfile conflicts being the most common
3521 manifestation), I suggest reinstalling the gcc to match
3522 your operating system release.
3526 *) gccosandvers='' ;; # failed to parse, better be silent
3535 : decide how portable to be. Allow command line overrides.
3536 case "$d_portable" in
3538 *) d_portable="$define" ;;
3541 : set up shell script to do ~ expansion
3547 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3550 if $test -f /bin/csh; then
3551 /bin/csh -f -c "glob \$1"
3556 name=\`$expr x\$1 : '..\([^/]*\)'\`
3557 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3558 if $test ! -d "\$dir"; then
3560 echo "\$me: can't locate home directory for: \$name" >&2
3565 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3581 : now set up to get a file name
3585 cat <<'EOSC' >>getfile
3601 expr $fn : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3602 fn=`echo $fn | sed 's/(.*)//'`
3608 loc_file=`expr $fn : '.*:\(.*\)'`
3609 fn=`expr $fn : '\(.*\):.*'`
3617 */*) fullpath=true;;
3626 *e*) exp_file=true;;
3629 *p*) nopath_ok=true;;
3634 *d*) type='Directory';;
3635 *l*) type='Locate';;
3640 Locate) what='File';;
3645 case "$d_portable" in
3653 while test "$type"; do
3658 true) rp="$rp (~name ok)";;
3661 if test -f UU/getfile.ok && \
3662 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3681 value=`UU/filexp $ans`
3684 if test "$ans" != "$value"; then
3685 echo "(That expands to $value on this system.)"
3699 /*) value="$ansexp" ;;
3700 [a-zA-Z]:/*) value="$ansexp" ;;
3705 echo "I shall only accept a full path name, as in /bin/ls." >&4
3706 echo "Use a ! shell escape if you wish to check pathnames." >&4
3709 echo "Please give a full path name, starting with slash." >&4
3712 echo "Note that using ~name is ok provided it expands well." >&4
3725 for fp in $gfpth; do
3726 if test "X$fp" = X.; then
3731 if test -f "$pf"; then
3733 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3735 echo "($value is not a plain file, but that's ok.)"
3738 if test X"$type" = X; then
3745 for fp in $gfpth; do
3746 if test "X$fp" = X.; then
3751 direxp="$fp/$ansexp"
3753 if test -d "$direxp"; then
3761 if test -d "$ansexp"; then
3762 echo "(Looking for $loc_file in directory $value.)"
3763 value="$value/$loc_file"
3764 ansexp="$ansexp/$loc_file"
3766 if test -f "$ansexp"; then
3769 case "$nopath_ok" in
3770 true) case "$value" in
3772 *) echo "Assuming $value will be in people's path."
3788 if test "$fastread" = yes; then
3793 rp="$what $value doesn't exist. Use that name anyway?"
3812 test "X$gfpthkeep" != Xy && gfpth=""
3815 : What should the include directory be ?
3817 $echo $n "Hmm... $c"
3821 if $test -f /bin/mips && /bin/mips; then
3822 echo "Looks like a MIPS system..."
3823 $cat >usr.c <<'EOCP'
3824 #ifdef SYSTYPE_BSD43
3828 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3829 dflt='/bsd43/usr/include'
3833 mips_type='System V'
3835 $rm -f usr.c usr.out
3836 echo "and you're compiling with the $mips_type compiler and libraries."
3840 echo "Doesn't look like a MIPS system."
3850 case "$xxx_prompt" in
3853 rp='Where are the include files you want to use?'
3861 : see how we invoke the C preprocessor
3863 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3864 cat <<'EOT' >testcpp.c
3870 if test ! -f cppstdin; then
3871 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
3872 # AIX cc -E doesn't show the absolute headerfile
3873 # locations but we'll cheat by using the -M flag.
3874 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
3876 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3879 echo "Keeping your $hint cppstdin wrapper."
3882 wrapper=`pwd`/cppstdin
3886 if $test "X$cppstdin" != "X" && \
3887 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3888 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3890 echo "You used to use $cppstdin $cppminus so we'll use that again."
3892 '') echo "But let's see if we can live without a wrapper..." ;;
3894 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3895 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3897 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3900 echo "(However, $cpprun $cpplast does not work, let's see...)"
3908 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3915 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3916 $cc -E <testcpp.c >testcpp.out 2>&1; \
3917 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3918 echo "Yup, it does."
3921 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
3922 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3923 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3924 echo "Yup, it does."
3927 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
3928 $cc -P <testcpp.c >testcpp.out 2>&1; \
3929 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3930 echo "Yipee, that works!"
3933 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
3934 $cc -P - <testcpp.c >testcpp.out 2>&1; \
3935 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3936 echo "At long last!"
3939 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
3940 $cpp <testcpp.c >testcpp.out 2>&1; \
3941 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3945 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
3946 $cpp - <testcpp.c >testcpp.out 2>&1; \
3947 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3948 echo "Hooray, it works! I was beginning to wonder."
3951 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
3952 $wrapper <testcpp.c >testcpp.out 2>&1; \
3953 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3959 rp="No dice. I can't find a C preprocessor. Name one:"
3963 $x_cpp <testcpp.c >testcpp.out 2>&1
3964 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3965 echo "OK, that will do." >&4
3967 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
3982 echo "Perhaps can we force $cc -E using a wrapper..."
3983 if $wrapper <testcpp.c >testcpp.out 2>&1; \
3984 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3990 echo "Nope, we'll have to live without it..."
4004 "$wrapper"|'cppstdin') ;;
4005 *) $rm -f $wrapper;;
4007 $rm -f testcpp.c testcpp.out
4009 : Set private lib path
4012 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4017 '') dlist="$loclibpth $plibpth $glibpth";;
4018 *) dlist="$libpth";;
4021 : Now check and see which directories actually exist, avoiding duplicates
4025 if $test -d $xxx; then
4028 *) libpth="$libpth $xxx";;
4034 Some systems have incompatible or broken versions of libraries. Among
4035 the directories listed in the question below, please remove any you
4036 know not to be holding relevant libraries, and add any that are needed.
4037 Say "none" for none.
4048 rp="Directories to use for library searches?"
4055 : compute shared library extension
4058 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4068 On some systems, shared libraries may be available. Answer 'none' if
4069 you want to suppress searching of shared libraries for the remainder
4070 of this configuration.
4073 rp='What is the file extension used for shared libraries?'
4077 : Define several unixisms.
4078 : Hints files or command line option can be used to override them.
4079 : The convoluted testing is in case hints files set either the old
4082 '') case "$exe_ext" in
4084 *) _exe="$exe_ext" ;;
4089 '') case "$lib_ext" in
4096 '') case "$obj_ext" in
4103 '') case "$path_sep" in
4114 : Which makefile gets called first. This is used by make depend.
4115 case "$firstmakefile" in
4116 '') firstmakefile='makefile';;
4120 $define|true|[yY]*) dflt='y';;
4125 Perl can be built to use the SOCKS proxy protocol library. To do so,
4126 Configure must be run with -Dusesocks. If you use SOCKS you also need
4127 to use the PerlIO abstraction layer, this will be implicitly selected.
4129 If this doesn't make any sense to you, just accept the default '$dflt'.
4131 rp='Build Perl for SOCKS?'
4134 y|Y) val="$define" ;;
4141 $define|true|[yY]*) useperlio="$define";;
4144 : Looking for optional libraries
4146 echo "Checking for optional libraries..." >&4
4151 case "$libswanted" in
4152 '') libswanted='c_s';;
4155 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4161 for thisdir in $libpth $xlibpth; do
4162 test -d $thisdir && libspath="$libspath $thisdir"
4164 for thislib in $libswanted; do
4165 for thisdir in $libspath; do
4167 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4168 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|tail -1`
4169 $test -f "$xxx" && eval $libscheck
4170 $test -f "$xxx" && libstyle=shared
4172 if test ! -f "$xxx"; then
4173 xxx=$thisdir/lib$thislib.$so
4174 $test -f "$xxx" && eval $libscheck
4175 $test -f "$xxx" && libstyle=shared
4177 if test ! -f "$xxx"; then
4178 xxx=$thisdir/lib$thislib$_a
4179 $test -f "$xxx" && eval $libscheck
4180 $test -f "$xxx" && libstyle=static
4182 if test ! -f "$xxx"; then
4183 xxx=$thisdir/$thislib$_a
4184 $test -f "$xxx" && eval $libscheck
4185 $test -f "$xxx" && libstyle=static
4187 if test ! -f "$xxx"; then
4188 xxx=$thisdir/lib${thislib}_s$_a
4189 $test -f "$xxx" && eval $libscheck
4190 $test -f "$xxx" && libstyle=static
4191 $test -f "$xxx" && thislib=${thislib}_s
4193 if test ! -f "$xxx"; then
4194 xxx=$thisdir/Slib$thislib$_a
4195 $test -f "$xxx" && eval $libscheck
4196 $test -f "$xxx" && libstyle=static
4198 if $test -f "$xxx"; then
4200 shared) echo "Found -l$thislib (shared)." ;;
4201 static) echo "Found -l$thislib." ;;
4202 *) echo "Found -l$thislib ($libstyle)." ;;
4206 *) dflt="$dflt -l$thislib"
4207 libsfound="$libsfound $xxx"
4209 libsfiles="$libsfiles $yyy"
4210 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4211 case " $libsdirs " in
4213 *) libsdirs="$libsdirs $yyy" ;;
4220 if $test ! -f "$xxx"; then
4221 echo "No -l$thislib."
4232 ' '|'') dflt='none';;
4237 In order to compile $package on your machine, a number of libraries
4238 are usually needed. Include any other special libraries here as well.
4239 Say "none" for none. The default list is almost always right.
4243 rp="What libraries to use?"
4250 : determine optimization, if desired, or use for debug flag also
4252 ' '|$undef) dflt='none';;
4254 *) dflt="$optimize";;
4258 By default, $package compiles with the -O flag to use the optimizer.
4259 Alternately, you might want to use the symbolic debugger, which uses
4260 the -g flag (on traditional Unix systems). Either flag can be
4261 specified here. To use neither flag, specify the word "none".
4264 rp="What optimizer/debugger flag should be used?"
4268 'none') optimize=" ";;
4272 : We will not override a previous value, but we might want to
4273 : augment a hint file
4275 default|recommended)
4276 case "$gccversion" in
4277 1*) dflt='-fpcc-struct-return' ;;
4280 *-g*) dflt="$dflt -DDEBUGGING";;
4282 case "$gccversion" in
4283 2*) if test -d /etc/conf/kconfig.d &&
4284 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4290 case "$gccversion" in
4294 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
4295 echo 'int main(void) { return 0; }' > gcctest.c
4296 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
4297 echo "Yes, it does." 2>&1
4300 echo "Leaving current flags $ccflags alone." 2>&1
4302 *) dflt="$dflt -fno-strict-aliasing" ;;
4305 echo "Nope, it doesn't, but that's ok." 2>&1
4312 case "$mips_type" in
4313 *BSD*|'') inclwanted="$locincpth $usrinc";;
4314 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4316 for thisincl in $inclwanted; do
4317 if $test -d $thisincl; then
4318 if $test x$thisincl != x$usrinc; then
4320 *" -I$thisincl "*);;
4321 *) dflt="$dflt -I$thisincl ";;
4327 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4329 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4337 *) dflt="$dflt -D$2";;
4341 set signal.h LANGUAGE_C; eval $inctest
4345 ccflags="$ccflags -DSOCKS"
4350 default|recommended) dflt="$ccflags $dflt" ;;
4351 *) dflt="$ccflags";;
4360 Your C compiler may want other flags. For this question you should include
4361 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4362 but you should NOT include libraries or ld flags like -lwhatever. If you
4363 want $package to honor its debug switch, you should include -DDEBUGGING here.
4364 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4366 To use no flags, specify the word "none".
4372 rp="Any additional cc flags?"
4379 : the following weeds options from ccflags that are of no interest to cpp
4381 '') cppflags="$ccflags" ;;
4382 *) cppflags="$cppflags $ccflags" ;;
4384 case "$gccversion" in
4385 1*) cppflags="$cppflags -D__GNUC__"
4387 case "$mips_type" in
4389 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4395 echo "Let me guess what the preprocessor flags are..." >&4
4409 *) ftry="$previous $flag";;
4411 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4412 >cpp1.out 2>/dev/null && \
4413 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4414 >cpp2.out 2>/dev/null && \
4415 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4416 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4418 cppflags="$cppflags $ftry"
4428 *-*) echo "They appear to be: $cppflags";;
4430 $rm -f cpp.c cpp?.out
4434 : flags used in final linking phase
4436 '') if ./venix; then
4442 *-posix*) dflt="$dflt -posix" ;;
4445 *) dflt="$ldflags";;
4448 : Try to guess additional flags to pick up local libraries.
4449 for thislibdir in $libpth; do
4450 case " $loclibpth " in
4453 *"-L$thislibdir "*) ;;
4454 *) dflt="$dflt -L$thislibdir" ;;
4466 Your C linker may need flags. For this question you should
4467 include -L/whatever and any other flags used by the C linker, but you
4468 should NOT include libraries like -lwhatever.
4470 Make sure you include the appropriate -L/path flags if your C linker
4471 does not normally search all of the directories you specified above,
4474 To use no flags, specify the word "none".
4478 rp="Any additional ld flags (NOT including libraries)?"
4484 rmlist="$rmlist pdp11"
4488 echo "Checking your choice of C compiler and flags for coherency..." >&4
4489 $cat > try.c <<'EOF'
4491 int main() { printf("Ok\n"); exit(0); }
4493 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
4495 $cat >try.msg <<'EOM'
4496 I've tried to compile and run the following simple program:
4499 $cat try.c >> try.msg
4501 $cat >> try.msg <<EOM
4508 and I got the following output:
4512 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
4513 if $sh -c "$run ./try" >>try.msg 2>&1; then
4517 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4520 cat >> try.msg <<'EOQS'
4521 If $libs contains -lsfio, and sfio is mis-configured, then it
4522 sometimes (apparently) runs and exits with a 0 status, but with no
4523 output! It may have to do with sfio's use of _exit vs. exit.
4526 rp="You have a big problem. Shall I abort Configure"
4533 echo "The program compiled OK, but exited with status $?." >>try.msg
4534 rp="You have a problem. Shall I abort Configure"
4538 echo "I can't compile the test program." >>try.msg
4539 rp="You have a BIG problem. Shall I abort Configure"
4545 case "$knowitall" in
4547 echo "(The supplied flags or libraries might be incorrect.)"
4555 *) echo "Ok. Stopping Configure." >&4
4560 n) echo "OK, that should do.";;
4562 $rm -f try try.* core
4564 : define a shorthand compile call
4568 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
4569 : define a shorthand compile call for compilations that should be ok.
4573 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
4575 : check for lengths of integral types
4579 echo "Checking to see how big your integers are..." >&4
4580 $cat >try.c <<'EOCP'
4584 printf("intsize=%d;\n", (int)sizeof(int));
4585 printf("longsize=%d;\n", (int)sizeof(long));
4586 printf("shortsize=%d;\n", (int)sizeof(short));
4591 if eval $compile_ok && $run ./try > /dev/null; then
4593 echo "Your integers are $intsize bytes long."
4594 echo "Your long integers are $longsize bytes long."
4595 echo "Your short integers are $shortsize bytes long."
4599 Help! I can't compile and run the intsize test program: please enlighten me!
4600 (This is probably a misconfiguration in your system or libraries, and
4601 you really ought to fix it. Still, I'll try anyway.)
4605 rp="What is the size of an integer (in bytes)?"
4609 rp="What is the size of a long integer (in bytes)?"
4613 rp="What is the size of a short integer (in bytes)?"
4621 : check for void type
4623 echo "Checking to see how well your C compiler groks the void type..." >&4
4624 case "$voidflags" in
4626 $cat >try.c <<'EOCP'
4632 extern void moo(); /* function returning void */
4633 void (*goo)(); /* ptr to func returning void */
4635 void *hue; /* generic ptr */
4648 int main() { sub(); }
4650 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
4651 voidflags=$defvoidused
4652 echo "Good. It appears to support void to the level $package wants.">&4
4653 if $contains warning .out >/dev/null 2>&1; then
4654 echo "However, you might get some warnings that look like this:"
4658 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
4659 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
4660 echo "It supports 1..."
4661 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
4662 echo "It also supports 2..."
4663 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
4665 echo "And it supports 4 but not 8 definitely."
4667 echo "It doesn't support 4..."
4668 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
4670 echo "But it supports 8."
4673 echo "Neither does it support 8."
4677 echo "It does not support 2..."
4678 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
4680 echo "But it supports 4 and 8."
4682 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
4684 echo "And it supports 4 but has not heard about 8."
4686 echo "However it supports 8 but not 4."
4691 echo "There is no support at all for void."
4696 case "$voidflags" in
4699 Support flag bits are:
4700 1: basic void declarations.
4701 2: arrays of pointers to functions returning void.
4702 4: operations between pointers to and addresses of void functions.
4703 8: generic void pointers.
4706 rp="Your void support flags add up to what?"
4713 : check for length of pointer
4717 echo "Checking to see how big your pointers are..." >&4
4718 if test "$voidflags" -gt 7; then
4719 echo '#define VOID_PTR char *' > try.c
4721 echo '#define VOID_PTR void *' > try.c
4723 $cat >>try.c <<'EOCP'
4727 printf("%d\n", (int)sizeof(VOID_PTR));
4732 if eval $compile_ok; then
4733 ptrsize=`$run ./try`
4734 echo "Your pointers are $ptrsize bytes long."
4737 echo "(I can't seem to compile the test program. Guessing...)" >&4
4738 rp="What is the size of a pointer (in bytes)?"
4746 : check for long long
4748 echo "Checking to see if you have long long..." >&4
4749 echo 'int main() { long long x = 7; return 0; }' > try.c
4751 if eval $compile; then
4753 echo "You have long long."
4756 echo "You do not have long long."
4762 : check for length of long long
4763 case "${d_longlong}${longlongsize}" in
4766 echo "Checking to see how big your long longs are..." >&4
4767 $cat >try.c <<'EOCP'
4771 printf("%d\n", (int)sizeof(long long));
4776 if eval $compile_ok; then
4777 longlongsize=`$run ./try`
4778 echo "Your long longs are $longlongsize bytes long."
4782 echo "(I can't seem to compile the test program. Guessing...)"
4783 rp="What is the size of a long long (in bytes)?"
4787 if $test "X$longsize" = "X$longlongsize"; then
4788 echo "(That isn't any different from an ordinary long.)"
4794 : determine filename position in cpp output
4796 echo "Computing filename position in cpp output for #include directives..." >&4
4797 echo '#include <stdio.h>' > foo.c
4800 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
4801 $grep '^[ ]*#.*stdio\.h' | \
4802 while read cline; do
4805 while $test \$# -gt 0; do
4806 if $test -r \`echo \$1 | $tr -d '"'\`; then
4811 pos=\`expr \$pos + 1\`
4823 *) pos="${fieldn}th";;
4825 echo "Your cpp writes the filename in the $pos field of the line."
4827 : locate header file
4832 for usrincdir in $usrinc
4834 if test -f \$usrincdir/\$wanted; then
4835 echo "\$usrincdir/\$wanted"
4839 awkprg='{ print \$$fieldn }'
4840 echo "#include <\$wanted>" > foo\$\$.c
4841 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
4842 $grep "^[ ]*#.*\$wanted" | \
4843 while read cline; do
4844 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
4846 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
4847 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
4852 # status = 0: grep returned 0 lines, case statement not executed
4853 # status = 1: headerfile found
4854 # status = 2: while loop executed, no headerfile found
4858 if test \$status -eq 1; then
4865 : define an alternate in-header-list? function
4866 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
4867 cont=true; xxf="echo \"<\$1> found.\" >&4";
4868 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
4869 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
4871 case $# in 4) instead=instead;; *) instead="at last";; esac;
4872 while $test "$cont"; do
4874 var=$2; eval "was=\$$2";
4875 if $test "$xxx" && $test -r "$xxx";
4877 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
4880 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
4881 set $yyy; shift; shift; yyy=$@;
4882 case $# in 0) cont="";;
4883 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
4884 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
4885 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
4886 xxnf="echo \"there is no <\$1>, ...\" >&4";;
4890 do set $yyy; var=$2; eval "was=\$$2";
4891 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
4892 set $yyy; shift; shift; yyy=$@;
4895 : see if inttypes.h is available
4896 : we want a real compile instead of Inhdr because some systems
4897 : have an inttypes.h which includes non-existent headers
4900 #include <inttypes.h>
4902 static int32_t foo32 = 0x12345678;
4906 if eval $compile; then
4907 echo "<inttypes.h> found." >&4
4910 echo "<inttypes.h> NOT found." >&4
4919 echo "Checking to see if you have int64_t..." >&4
4921 #include <sys/types.h>
4922 #$i_inttypes I_INTTYPES
4924 #include <inttypes.h>
4926 int main() { int64_t x = 7; }
4929 if eval $compile; then
4931 echo "You have int64_t."
4934 echo "You do not have int64_t."
4942 echo "Checking which 64-bit integer type we could use..." >&4
4948 val='"unsigned int"'
4953 *) case "$longsize" in
4957 val='"unsigned long"'
4962 *) case "$d_longlong:$longlongsize" in
4967 val='"unsigned long long"'
4972 *) case "$d_int64_t" in
4991 '') echo "Alas, no 64-bit integer types in sight." >&4
4994 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5000 case "$uselonglong" in
5001 "$define"|true|[yY]*)
5004 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5006 use64bitint="$define"
5009 case "$use64bits" in
5010 "$define"|true|[yY]*)
5013 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5015 use64bitint="$define"
5018 case "$use64bitints" in
5019 "$define"|true|[yY]*)
5022 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5024 use64bitint="$define"
5027 case "$use64bitsint" in
5028 "$define"|true|[yY]*)
5031 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5033 use64bitint="$define"
5036 case "$uselonglongs" in
5037 "$define"|true|[yY]*)
5040 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5042 use64bitint="$define"
5045 case "$use64bitsall" in
5046 "$define"|true|[yY]*)
5049 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5051 use64bitall="$define"
5056 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5058 case "$use64bitall" in
5059 "$define"|true|[yY]*) use64bitint="$define" ;;
5065 You have natively 64-bit long integers.
5069 *) case "$use64bitint" in
5070 "$define"|true|[yY]*) dflt='y';;
5079 Perl can be built to take advantage of 64-bit integer types
5080 on some systems. To do so, Configure can be run with -Duse64bitint.
5081 Choosing this option will most probably introduce binary incompatibilities.
5083 If this doesn't make any sense to you, just accept the default '$dflt'.
5084 (The default has been chosen based on your configuration.)
5086 rp='Try to use 64-bit integers, if available?'
5089 [yY]*) val="$define" ;;
5097 case "$use64bitall" in
5098 "$define"|true|[yY]*) dflt='y' ;;
5099 *) case "$longsize" in
5107 You may also choose to try maximal 64-bitness. It means using as much
5108 64-bitness as possible on the platform. This in turn means even more
5109 binary incompatibilities. On the other hand, your platform may not
5110 have any more 64-bitness available than what you already have chosen.
5112 If this doesn't make any sense to you, just accept the default '$dflt'.
5113 (The default has been chosen based on your configuration.)
5115 rp='Try to use maximal 64-bit support, if available?'
5118 [yY]*) val="$define" ;;
5123 case "$use64bitall" in
5125 case "$use64bitint" in
5129 Since you have chosen a maximally 64-bit build, I'm also turning on
5130 the use of 64-bit integers.
5132 use64bitint="$define" ;;
5137 case "$use64bitall" in
5138 "$define"|true|[yY]*)
5142 *** You have chosen a maximally 64-bit build, but your pointers
5143 *** are only 4 bytes wide, disabling maximal 64-bitness.
5146 use64bitall="$undef"
5147 case "$use64bitint" in
5148 "$define"|true|[yY]*) ;;
5151 *** Downgrading from maximal 64-bitness to using 64-bit integers.
5154 use64bitint="$define"
5162 case "$use64bitint" in
5163 "$define"|true|[yY]*)
5164 : Look for a hint-file generated 'call-back-unit'. If the
5165 : user has specified that a 64-bit perl is to be built,
5166 : we may need to set or change some other defaults.
5167 if $test -f use64bitint.cbu; then
5168 echo "Your platform has some specific hints for 64-bit integers, using them..."
5172 4) case "$archname64" in
5173 '') archname64=64int ;;
5180 case "$use64bitall" in
5181 "$define"|true|[yY]*)
5182 : Look for a hint-file generated 'call-back-unit'. If the
5183 : user has specified that a maximally 64-bit perl is to be built,
5184 : we may need to set or change some other defaults.
5185 if $test -f use64bitall.cbu; then
5186 echo "Your platform has some specific hints for 64-bit builds, using them..."
5190 4) case "$archname64" in
5191 ''|64int) archname64=64all ;;
5199 echo "Checking for GNU C Library..." >&4
5212 if eval $compile_ok && $run ./try; then
5214 echo "You are using the GNU C Library"
5217 echo "You are not using the GNU C Library"
5223 : see if nm is to be used to determine whether a symbol is defined or not
5227 case "$d_gnulibc" in
5230 echo "nm probably won't work on the GNU C Library." >&4
5236 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
5238 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
5239 echo "'nm' won't be sufficient on this sytem." >&4
5245 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
5246 if $test $dflt -gt 20; then
5256 true|$define) dflt=y;;
5263 I can use $nm to extract the symbols from your C libraries. This
5264 is a time consuming task which may generate huge output on the disk (up
5265 to 3 megabytes) but that should make the symbols extraction faster. The
5266 alternative is to skip the 'nm' extraction part and to compile a small
5267 test program instead to determine whether each symbol is present. If
5268 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
5269 this may be the best solution.
5271 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
5274 rp="Shall I use $nm to extract C symbols from the libraries?"
5277 [Nn]*) usenm=false;;
5286 : nm options which may be necessary
5288 '') if $test -f /mach_boot; then
5290 elif $test -d /usr/ccs/lib; then
5291 nm_opt='-p' # Solaris (and SunOS?)
5292 elif $test -f /dgux; then
5294 elif $test -f /lib64/rld; then
5295 nm_opt='-p' # 64-bit Irix
5301 : nm options which may be necessary for shared libraries but illegal
5302 : for archive libraries. Thank you, Linux.
5303 case "$nm_so_opt" in
5304 '') case "$myuname" in
5306 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
5307 nm_so_opt='--dynamic'
5316 : get list of predefined functions in a handy place
5321 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
5327 *) for thislib in $libs; do
5330 : Handle C library specially below.
5333 thislib=`echo $thislib | $sed -e 's/^-l//'`
5334 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
5336 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
5338 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
5340 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
5342 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
5344 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
5346 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
5351 libnames="$libnames $try"
5353 *) libnames="$libnames $thislib" ;;
5362 for xxx in $libpth; do
5363 $test -r $1 || set $xxx/libc.$so
5364 : The messy sed command sorts on library version numbers.
5366 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
5367 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
5369 s/[0-9][0-9]*/0000&/g
5370 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
5373 $sort | $sed -e 's/^.* //'`
5376 $test -r $1 || set /usr/ccs/lib/libc.$so
5377 $test -r $1 || set /lib/libsys_s$_a
5383 if $test -r "$1"; then
5384 echo "Your (shared) C library seems to be in $1."
5386 elif $test -r /lib/libc && $test -r /lib/clib; then
5387 echo "Your C library seems to be in both /lib/clib and /lib/libc."
5389 libc='/lib/clib /lib/libc'
5390 if $test -r /lib/syslib; then
5391 echo "(Your math library is in /lib/syslib.)"
5392 libc="$libc /lib/syslib"
5394 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5395 echo "Your C library seems to be in $libc, as you said before."
5396 elif $test -r $incpath/usr/lib/libc$_a; then
5397 libc=$incpath/usr/lib/libc$_a;
5398 echo "Your C library seems to be in $libc. That's fine."
5399 elif $test -r /lib/libc$_a; then
5401 echo "Your C library seems to be in $libc. You're normal."
5403 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
5405 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
5406 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
5407 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
5409 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5411 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5414 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
5416 if $test -r "$tans"; then
5417 echo "Your C library seems to be in $tans, of all places."
5423 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5427 If the guess above is wrong (which it might be if you're using a strange
5428 compiler, or your machine supports multiple models), you can override it here.
5433 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
5435 I can't seem to find your C library. I've looked in the following places:
5438 $sed 's/^/ /' libpath
5441 None of these seems to contain your C library. I need to get its name...
5446 rp='Where is your C library?'
5451 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
5452 set X `cat libnames`
5455 case $# in 1) xxx=file; esac
5456 echo "Extracting names from the following $xxx for later perusal:" >&4
5458 $sed 's/^/ /' libnames >&4
5460 $echo $n "This may take a while...$c" >&4
5464 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
5465 *) $nm $nm_opt $file 2>/dev/null;;
5470 $grep fprintf libc.tmp > libc.ptf
5471 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
5472 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
5474 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
5476 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5478 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
5480 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5482 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
5484 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5486 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
5488 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5490 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
5492 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5494 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
5496 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5498 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
5499 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
5501 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5503 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
5505 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5507 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
5509 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5511 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
5513 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5515 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
5517 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5519 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
5521 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5523 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
5525 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5527 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
5529 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5532 $nm -p $* 2>/dev/null >libc.tmp
5533 $grep fprintf libc.tmp > libc.ptf
5534 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
5535 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
5541 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
5543 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
5544 for thisname in $libnames $libc; do
5545 $ar t $thisname >>libc.tmp
5547 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
5549 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
5550 # Repeat libc to extract forwarders to DLL entries too
5551 for thisname in $libnames $libc; do
5552 $ar tv $thisname >>libc.tmp
5553 # Revision 50 of EMX has bug in $ar.
5554 # it will not extract forwarders to DLL entries
5555 # Use emximp which will extract exactly them.
5556 emximp -o tmp.imp $thisname \
5558 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
5559 < tmp.imp >>libc.tmp
5562 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
5565 echo "$ar didn't seem to work right." >&4
5566 echo "Maybe this is a Cray...trying bld instead..." >&4
5567 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
5569 for thisname in $libnames; do
5571 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
5572 $ar t $thisname >>libc.tmp
5576 echo "That didn't work either. Giving up." >&4
5583 if $test -f /lib/syscalls.exp; then
5585 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
5586 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' /lib/syscalls.exp >>libc.list
5590 $rm -f libnames libpath
5592 : is a C symbol defined?
5595 -v) tf=libc.tmp; tc=""; tdc="";;
5596 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
5597 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
5600 case "$reuseval-$4" in
5602 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
5608 if $contains $tlook $tf >/dev/null 2>&1;
5613 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
5614 if $cc -o t $optimize $ccflags $ldflags t.c $libs >/dev/null 2>&1;
5622 $define) tval=true;;
5628 : define an is-in-libc? function
5629 inlibc='echo " "; td=$define; tu=$undef;
5630 sym=$1; var=$2; eval "was=\$$2";
5632 case "$reuseval$was" in
5642 echo "$sym() found." >&4;
5643 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
5645 echo "$sym() NOT found." >&4;
5646 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
5650 $define) echo "$sym() found." >&4;;
5651 *) echo "$sym() NOT found." >&4;;
5655 : see if sqrtl exists
5660 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
5663 case "$uselongdouble" in
5664 $define|true|[yY]*) dflt='y';;
5669 Perl can be built to take advantage of long doubles which
5670 (if available) may give more accuracy and range for floating point numbers.
5672 If this doesn't make any sense to you, just accept the default '$dflt'.
5674 rp='Try to use long doubles if available?'
5677 y|Y) val="$define" ;;
5683 case "$uselongdouble" in
5684 true|[yY]*) uselongdouble="$define" ;;
5687 case "$uselongdouble" in
5689 : Look for a hint-file generated 'call-back-unit'. If the
5690 : user has specified that long doubles should be used,
5691 : we may need to set or change some other defaults.
5692 if $test -f uselongdouble.cbu; then
5693 echo "Your platform has some specific hints for long doubles, using them..."
5694 . ./uselongdouble.cbu
5697 (Your platform doesn't have any specific hints for long doubles.)
5703 case "$uselongdouble:$d_sqrtl" in
5707 *** You requested the use of long doubles but you do not seem to have
5708 *** the mathematic functions for long doubles. I'm disabling the use
5709 *** of long doubles.
5712 uselongdouble=$undef
5716 : check for length of double
5718 case "$doublesize" in
5720 echo "Checking to see how big your double precision numbers are..." >&4
5721 $cat >try.c <<'EOCP'
5725 printf("%d\n", (int)sizeof(double));
5730 if eval $compile_ok; then
5731 doublesize=`$run ./try`
5732 echo "Your double is $doublesize bytes long."
5735 echo "(I can't seem to compile the test program. Guessing...)"
5736 rp="What is the size of a double precision number (in bytes)?"
5744 : check for long doubles
5746 echo "Checking to see if you have long double..." >&4
5747 echo 'int main() { long double x = 7.0; }' > try.c
5749 if eval $compile; then
5751 echo "You have long double."
5754 echo "You do not have long double."
5760 : check for length of long double
5761 case "${d_longdbl}${longdblsize}" in
5764 echo "Checking to see how big your long doubles are..." >&4
5765 $cat >try.c <<'EOCP'
5769 printf("%d\n", sizeof(long double));
5774 if eval $compile; then
5775 longdblsize=`$run ./try`
5776 echo "Your long doubles are $longdblsize bytes long."
5780 echo "(I can't seem to compile the test program. Guessing...)" >&4
5781 rp="What is the size of a long double (in bytes)?"
5785 if $test "X$doublesize" = "X$longdblsize"; then
5786 echo "(That isn't any different from an ordinary double.)"
5792 case "$useperlio" in
5793 $define|true|[yY]*|'') dflt='y';;
5798 Previous version of $package used the standard IO mechanisms as
5799 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
5800 alternate IO mechanisms via the PerlIO abstraction layer, but the
5801 stdio mechanism is still available if needed. The abstraction layer
5802 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
5803 Using PerlIO with sfio may cause problems with some extension modules.
5805 If this doesn't make any sense to you, just accept the default '$dflt'.
5807 rp='Use the PerlIO abstraction layer?'
5814 echo "Ok, doing things the stdio way."
5823 case "$useperlio" in
5824 $define|true|[yY]*) ;;
5827 You are using the SOCKS proxy protocol library which means that you
5828 should also use the PerlIO layer. You may be headed for trouble.
5837 : determine the architecture name
5839 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5840 tarch=`arch`"-$osname"
5841 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5842 if uname -m > tmparch 2>&1 ; then
5843 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5844 -e 's/$/'"-$osname/" tmparch`
5852 case "$myarchname" in
5855 echo "(Your architecture name used to be $myarchname.)"
5859 case "$targetarch" in
5861 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
5866 *) dflt="$archname";;
5868 rp='What is your architecture name'
5871 case "$usethreads" in
5873 echo "Threads selected." >&4
5875 *-thread*) echo "...and architecture name already has -thread." >&4
5877 *) archname="$archname-thread"
5878 echo "...setting architecture name to $archname." >&4
5883 case "$usemultiplicity" in
5885 echo "Multiplicity selected." >&4
5887 *-multi*) echo "...and architecture name already has -multi." >&4
5889 *) archname="$archname-multi"
5890 echo "...setting architecture name to $archname." >&4
5895 case "$use64bitint$use64bitall" in
5897 case "$archname64" in
5899 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
5902 case "$use64bitint" in
5903 "$define") echo "64 bit integers selected." >&4 ;;
5905 case "$use64bitall" in
5906 "$define") echo "Maximal 64 bitness selected." >&4 ;;
5909 *-$archname64*) echo "...and architecture name already has $archname64." >&4
5911 *) archname="$archname-$archname64"
5912 echo "...setting architecture name to $archname." >&4
5918 case "$uselongdouble" in
5920 echo "Long doubles selected." >&4
5921 case "$longdblsize" in
5923 "...but long doubles are equal to doubles, not changing architecture name." >&4
5927 *-ld*) echo "...and architecture name already has -ld." >&4
5929 *) archname="$archname-ld"
5930 echo "...setting architecture name to $archname." >&4
5937 case "$useperlio" in
5939 echo "Perlio selected." >&4
5942 echo "Perlio not selected, using stdio." >&4
5944 *-stdio*) echo "...and architecture name already has -stdio." >&4
5946 *) archname="$archname-stdio"
5947 echo "...setting architecture name to $archname." >&4
5953 : determine root of directory hierarchy where package will be installed.
5956 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
5964 By default, $package will be installed in $dflt/bin, manual pages
5965 under $dflt/man, etc..., i.e. with $dflt as prefix for all
5966 installation directories. Typically this is something like /usr/local.
5967 If you wish to have binaries under /usr/bin but other parts of the
5968 installation under /usr/local, that's ok: you will be prompted
5969 separately for each of the installation directories, the prefix being
5970 only used to set the defaults.
5974 rp='Installation prefix to use?'
5982 *) oldprefix="$prefix";;
5991 *) afsroot=$afsroot ;;
5997 $define|true) afs=true ;;
5998 $undef|false) afs=false ;;
5999 *) if test -d $afsroot; then
6007 echo "AFS may be running... I'll be extra cautious then..." >&4
6009 echo "AFS does not seem to be running..." >&4
6012 : determine installation prefix for where package is to be installed.
6016 Since you are running AFS, I need to distinguish the directory in which
6017 files will reside from the directory in which they are installed (and from
6018 which they are presumably copied to the former directory by occult means).
6021 case "$installprefix" in
6022 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
6023 *) dflt="$installprefix";;
6028 In some special cases, particularly when building $package for distribution,
6029 it is convenient to distinguish between the directory in which files should
6030 be installed from the directory ($prefix) in which they
6031 will eventually reside. For most users, these two directories are the same.
6034 case "$installprefix" in
6036 *) dflt=$installprefix;;
6040 rp='What installation prefix should I use for installing files?'
6042 installprefix="$ans"
6043 installprefixexp="$ansexp"
6045 : set the prefixit variable, to compute a suitable default value
6046 prefixit='case "$3" in
6048 case "$oldprefix" in
6049 "") eval "$1=\"\$$2\"";;
6056 ""|" ") eval "$1=\"\$$2\"";;
6062 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6064 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6065 /*-$oldprefix/*|\~*-$oldprefix/*)
6066 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6067 *) eval "$1=\"\$$2\"";;
6071 : get the patchlevel
6073 echo "Getting the current patchlevel..." >&4
6074 if $test -r $rsrc/patchlevel.h;then
6075 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
6076 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
6077 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
6078 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
6079 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
6080 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
6081 perl_patchlevel=`grep ',"DEVEL[0-9][0-9]*"' $rsrc/patchlevel.h|sed 's/[^0-9]//g'`
6090 $echo "(You do not have patchlevel.h. Eek.)"
6092 if $test -r $rsrc/.patch ; then
6093 if $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
6094 perl_patchlevel=`cat $rsrc/.patch`
6097 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
6098 version_patchlevel_string="version $patchlevel subversion $subversion"
6099 case "$perl_patchlevel" in
6101 *) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;;
6104 $echo "(You have $package $version_patchlevel_string.)"
6108 : XXX Should be a Configure test for double-dots in filenames.
6109 version=`echo $revision $patchlevel $subversion | \
6110 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
6111 api_versionstring=`echo $api_revision $api_version $api_subversion | \
6112 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
6115 version=`echo $revision $patchlevel $subversion | \
6116 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
6117 api_versionstring=`echo $api_revision $api_version $api_subversion | \
6118 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
6121 : Special case the 5.005_xx maintenance series, which used 5.005
6122 : without any subversion label as a subdirectory in $sitelib
6123 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
6124 api_versionstring='5.005'
6127 : determine installation style
6128 : For now, try to deduce it from prefix unless it is already set.
6129 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6130 case "$installstyle" in
6131 '') case "$prefix" in
6132 *perl*) dflt='lib';;
6133 *) dflt='lib/perl5' ;;
6136 *) dflt="$installstyle" ;;
6138 : Probably not worth prompting for this since we prompt for all
6139 : the directories individually, and the prompt would be too long and
6143 : determine where private library files go
6144 : Usual default is /usr/local/lib/perl5/$version.
6145 : Also allow things like /opt/perl/lib/$version, since
6146 : /opt/perl/lib/perl5... would be redundant.
6147 : The default "style" setting is made in installstyle.U
6148 case "$installstyle" in
6149 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6150 *) set dflt privlib lib/$version ;;
6155 There are some auxiliary files for $package that need to be put into a
6156 private library directory that is accessible by everyone.
6160 rp='Pathname where the private library files will reside?'
6163 privlibexp="$ansexp"
6164 : Change installation prefix, if necessary.
6165 if $test X"$prefix" != X"$installprefix"; then
6166 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
6168 installprivlib="$privlibexp"
6171 : set the prefixup variable, to restore leading tilda escape
6172 prefixup='case "$prefixexp" in
6174 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6177 : determine where public architecture dependent libraries go
6180 : privlib default is /usr/local/lib/$package/$version
6181 : archlib default is /usr/local/lib/$package/$version/$archname
6182 : privlib may have an optional trailing /share.
6183 tdflt=`echo $privlib | $sed 's,/share$,,'`
6184 tdflt=$tdflt/$archname
6193 $spackage contains architecture-dependent library files. If you are
6194 sharing libraries in a heterogeneous environment, you might store
6195 these files in a separate location. Otherwise, you can just include
6196 them with the rest of the public library files.
6200 rp='Where do you want to put the public architecture-dependent libraries?'
6203 archlibexp="$ansexp"
6204 if $test X"$archlib" = X"$privlib"; then
6209 : Change installation prefix, if necessary.
6210 if $test X"$prefix" != X"$installprefix"; then
6211 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
6213 installarchlib="$archlibexp"
6217 : Binary compatibility with 5.005 is not possible for builds
6218 : with advanced features
6219 case "$usethreads$usemultiplicity" in
6221 bincompat5005="$undef"
6222 d_bincompat5005="$undef"
6226 This version of Perl can be compiled for binary compatibility with 5.005.
6227 If you decide to do so, you will be able to continue using most of the
6228 extensions that were compiled for Perl 5.005.
6231 case "$bincompat5005$d_bincompat5005" in
6232 *"$undef"*) dflt=n ;;
6235 rp='Binary compatibility with Perl 5.005?'
6238 y*) val="$define" ;;
6243 case "$d_bincompat5005" in
6245 bincompat5005="$define"
6247 *) bincompat5005="$undef"
6248 d_bincompat5005="$undef"
6255 : see if setuid scripts can be secure
6258 Some kernels have a bug that prevents setuid #! scripts from being
6259 secure. Some sites have disabled setuid #! scripts because of this.
6261 First let's decide if your kernel supports secure setuid #! scripts.
6262 (If setuid #! scripts would be secure but have been disabled anyway,
6263 don't say that they are secure if asked.)
6268 if $test -d /dev/fd; then
6269 echo "#!$ls" >reflect
6270 chmod +x,u+s reflect
6271 ./reflect >flect 2>&1
6272 if $contains "/dev/fd" flect >/dev/null; then
6273 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6277 If you are not sure if they are secure, I can check but I'll need a
6278 username and password different from the one you are using right now.
6279 If you don't have such a username or don't want me to test, simply
6283 rp='Other username to test security of setuid scripts with?'
6288 case "$d_suidsafe" in
6289 '') echo "I'll assume setuid scripts are *not* secure." >&4
6292 echo "Well, the $hint value is *not* secure." >&4
6294 *) echo "Well, the $hint value *is* secure." >&4
6299 $rm -f reflect flect
6300 echo "#!$ls" >reflect
6301 chmod +x,u+s reflect
6304 echo '"su" will (probably) prompt you for '"$ans's password."
6305 su $ans -c './reflect >flect'
6306 if $contains "/dev/fd" flect >/dev/null; then
6307 echo "Okay, it looks like setuid scripts are secure." >&4
6310 echo "I don't think setuid scripts are secure." >&4
6315 rp='Does your kernel have *secure* setuid scripts?'
6318 [yY]*) val="$define";;
6323 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6324 echo "(That's for file descriptors, not floppy disks.)"
6330 $rm -f reflect flect
6332 : now see if they want to do setuid emulation
6335 case "$d_suidsafe" in
6338 echo "No need to emulate SUID scripts since they are secure here." >& 4
6342 Some systems have disabled setuid scripts, especially systems where
6343 setuid scripts cannot be secure. On systems where setuid scripts have
6344 been disabled, the setuid/setgid bits on scripts are currently
6345 useless. It is possible for $package to detect those bits and emulate
6346 setuid/setgid in a secure fashion. This emulation will only work if
6347 setuid scripts have been disabled in your kernel.
6351 "$define") dflt=y ;;
6354 rp="Do you want to do setuid/setgid emulation?"
6357 [yY]*) val="$define";;
6365 : see if this is a malloc.h system
6366 set malloc.h i_malloc
6369 : see if stdlib is available
6370 set stdlib.h i_stdlib
6373 : determine which malloc to compile in
6375 case "$usemymalloc" in
6376 [yY]*|true|$define) dflt='y' ;;
6377 [nN]*|false|$undef) dflt='n' ;;
6378 *) case "$ptrsize" in
6384 rp="Do you wish to attempt to use the malloc that comes with $package?"
6390 mallocsrc='malloc.c'
6391 mallocobj="malloc$_o"
6392 d_mymalloc="$define"
6395 : Remove malloc from list of libraries to use
6396 echo "Removing unneeded -lmalloc from library list" >&4
6397 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6400 echo "libs = $libs" >&4
6412 : compute the return types of malloc and free
6414 $cat >malloc.c <<END
6418 #include <sys/types.h>
6432 case "$malloctype" in
6434 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6441 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6445 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6452 echo "Your system uses $freetype free(), it would seem." >&4
6456 After $package is installed, you may wish to install various
6457 add-on modules and utilities. Typically, these add-ons will
6458 be installed under $prefix with the rest
6459 of this package. However, you may wish to install such add-ons
6460 elsewhere under a different prefix.
6462 If you do not wish to put everything under a single prefix, that's
6463 ok. You will be prompted for the individual locations; this siteprefix
6464 is only used to suggest the defaults.
6466 The default should be fine for most people.
6470 rp='Installation prefix to use for add-on modules and utilities?'
6471 : XXX Here might be another good place for an installstyle setting.
6472 case "$siteprefix" in
6474 *) dflt=$siteprefix ;;
6477 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6479 case "$siteprefix" in
6483 *) oldsiteprefix="$prefix";;
6488 siteprefixexp="$ansexp"
6490 : determine where site specific libraries go.
6491 : Usual default is /usr/local/lib/perl5/site_perl/$version
6492 : The default "style" setting is made in installstyle.U
6493 : XXX No longer works with Prefixit stuff.
6494 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6496 '') case "$installstyle" in
6497 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6498 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6506 The installation process will create a directory for
6507 site-specific extensions and modules. Most users find it convenient
6508 to place all site-specific files in this directory rather than in the
6509 main distribution directory.
6513 rp='Pathname for the site-specific library files?'
6516 sitelibexp="$ansexp"
6517 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6518 : Change installation prefix, if necessary.
6519 if $test X"$prefix" != X"$installprefix"; then
6520 installsitelib=`echo $sitelibexp | $sed "s#^$prefix#$installprefix#"`
6522 installsitelib="$sitelibexp"
6525 : determine where site specific architecture-dependent libraries go.
6526 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6527 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6528 : sitelib may have an optional trailing /share.
6530 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6531 dflt="$dflt/$archname"
6536 set sitearch sitearch none
6540 The installation process will also create a directory for
6541 architecture-dependent site-specific extensions and modules.
6545 rp='Pathname for the site-specific architecture-dependent library files?'
6548 sitearchexp="$ansexp"
6549 : Change installation prefix, if necessary.
6550 if $test X"$prefix" != X"$installprefix"; then
6551 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
6553 installsitearch="$sitearchexp"
6558 The installation process will also create a directory for
6559 vendor-supplied add-ons. Vendors who supply perl with their system
6560 may find it convenient to place all vendor-supplied files in this
6561 directory rather than in the main distribution directory. This will
6562 ease upgrades between binary-compatible maintenance versions of perl.
6564 Of course you may also use these directories in whatever way you see
6565 fit. For example, you might use them to access modules shared over a
6566 company-wide network.
6568 The default answer should be fine for most people.
6569 This causes further questions about vendor add-ons to be skipped
6570 and no vendor-specific directories will be configured for perl.
6573 rp='Do you want to configure vendor-specific add-on directories?'
6574 case "$usevendorprefix" in
6575 define|true|[yY]*) dflt=y ;;
6576 *) : User may have set vendorprefix directly on Configure command line.
6577 case "$vendorprefix" in
6586 rp='Installation prefix to use for vendor-supplied add-ons?'
6587 case "$vendorprefix" in
6589 *) dflt=$vendorprefix ;;
6592 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6594 case "$vendorprefix" in
6598 *) oldvendorprefix="$prefix";;
6602 usevendorprefix="$define"
6604 vendorprefixexp="$ansexp"
6606 *) usevendorprefix="$undef"
6612 case "$vendorprefix" in
6613 '') d_vendorlib="$undef"
6617 *) d_vendorlib="$define"
6618 : determine where vendor-supplied modules go.
6619 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6620 case "$vendorlib" in
6622 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6623 case "$installstyle" in
6624 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6625 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6628 *) dflt="$vendorlib"
6632 rp='Pathname for the vendor-supplied library files?'
6635 vendorlibexp="$ansexp"
6638 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6639 : Change installation prefix, if necessary.
6640 if $test X"$prefix" != X"$installprefix"; then
6641 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
6643 installvendorlib="$vendorlibexp"
6646 case "$vendorprefix" in
6647 '') d_vendorarch="$undef"
6651 *) d_vendorarch="$define"
6652 : determine where vendor-supplied architecture-dependent libraries go.
6653 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6654 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6655 : vendorlib may have an optional trailing /share.
6656 case "$vendorarch" in
6657 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6658 dflt="$dflt/$archname"
6660 *) dflt="$vendorarch" ;;
6663 rp='Pathname for vendor-supplied architecture-dependent files?'
6666 vendorarchexp="$ansexp"
6669 : Change installation prefix, if necessary.
6670 if $test X"$prefix" != X"$installprefix"; then
6671 installvendorarch=`echo $vendorarchexp | sed "s#^$prefix#$installprefix#"`
6673 installvendorarch="$vendorarchexp"
6676 : Final catch-all directories to search
6679 Lastly, you can have perl look in other directories for extensions and
6680 modules in addition to those already specified.
6681 These directories will be searched after
6685 test X"$vendorlib" != "X" && echo ' ' $vendorlib
6686 test X"$vendorarch" != "X" && echo ' ' $vendorarch
6688 case "$otherlibdirs" in
6689 ''|' ') dflt='none' ;;
6690 *) dflt="$otherlibdirs" ;;
6693 Enter a colon-separated set of extra paths to include in perl's @INC
6694 search path, or enter 'none' for no extra paths.
6698 rp='Colon-separated list of additional directories for perl to search?'
6701 ' '|''|none) otherlibdirs=' ' ;;
6702 *) otherlibdirs="$ans" ;;
6704 case "$otherlibdirs" in
6708 set d_perl_otherlibdirs
6711 : Cruising for prototypes
6713 echo "Checking out function prototypes..." >&4
6714 $cat >prototype.c <<'EOCP'
6715 int main(int argc, char *argv[]) {
6718 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
6719 echo "Your C compiler appears to support function prototypes."
6722 echo "Your C compiler doesn't seem to understand function prototypes."
6729 case "$prototype" in
6731 *) ansi2knr='ansi2knr'
6736 This version of $package can only be compiled by a compiler that
6737 understands function prototypes. Unfortunately, your C compiler
6739 doesn't seem to understand them. Sorry about that.
6741 If GNU cc is available for your system, perhaps you could try that instead.
6743 Eventually, we hope to support building Perl with pre-ANSI compilers.
6744 If you would like to help in that effort, please contact <perlbug@perl.org>.
6746 Aborting Configure now.
6752 : determine where public executables go
6757 rp='Pathname where the public executables will reside?'
6759 if $test "X$ansexp" != "X$binexp"; then
6764 : Change installation prefix, if necessary.
6765 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6766 if $test X"$prefix" != X"$installprefix"; then
6767 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
6769 installbin="$binexp"
6778 Perl can be built with extra modules or bundles of modules which
6779 will be fetched from the CPAN and installed alongside Perl.
6781 Notice that you will need access to the CPAN; either via the Internet,
6782 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
6783 be asked later to configure the CPAN.pm module which will in turn do
6784 the installation of the rest of the extra modules or bundles.)
6786 Notice also that if the modules require any external software such as
6787 libraries and headers (the libz library and the zlib.h header for the
6788 Compress::Zlib module, for example) you MUST have any such software
6789 already installed, this configuration process will NOT install such
6792 If this doesn't make any sense to you, just accept the default '$dflt'.
6794 rp='Install any extra modules (y or n)?'
6800 Please list any extra modules or bundles to be installed from CPAN,
6801 with spaces between the names. The names can be in any format the
6802 'install' command of CPAN.pm will understand. (Answer 'none',
6803 without the quotes, to install no extra modules or bundles.)
6813 $rm -f ../extras.lst
6815 *) echo "(Saving the list of extras for later...)"
6816 echo "$extras" > ../extras.lst
6824 : Find perl5.005 or later.
6825 echo "Looking for a previously installed perl5.005 or later... "
6827 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6828 : Check if this perl is recent and can load a simple module
6829 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6832 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6842 '') echo "None found. That's ok.";;
6843 *) echo "Using $perl5." ;;
6846 : Determine list of previous versions to include in @INC
6847 $cat > getverlist <<EOPL
6850 \$api_versionstring = "$api_versionstring";
6851 \$version = "$version";
6852 \$stem = "$sitelib_stem";
6853 \$archname = "$archname";
6855 $cat >> getverlist <<'EOPL'
6856 # Can't have leading @ because metaconfig interprets it as a command!
6857 ;@inc_version_list=();
6858 # XXX Redo to do opendir/readdir?
6861 ;@candidates = glob("5.*");
6867 # XXX ToDo: These comparisons must be reworked when two-digit
6868 # subversions come along, so that 5.7.10 compares as greater than
6869 # 5.7.3! By that time, hope that 5.6.x is sufficiently
6870 # widespread that we can use the built-in version vectors rather
6871 # than reinventing them here. For 5.6.0, however, we must
6872 # assume this script will likely be run by 5.005_0x. --AD 1/2000.
6873 foreach $d (@candidates) {
6874 if ($d lt $version) {
6875 if ($d ge $api_versionstring) {
6876 unshift(@inc_version_list, grep { -d } "$d/$archname", $d);
6878 elsif ($d ge "5.005") {
6879 unshift(@inc_version_list, grep { -d } $d);
6883 # Skip newer version. I.e. don't look in
6884 # 5.7.0 if we're installing 5.6.1.
6888 if (@inc_version_list) {
6889 print join(' ', @inc_version_list);
6892 # Blank space to preserve value for next Configure run.
6897 case "$inc_version_list" in
6898 '') if test -x "$perl5$exe_ext"; then
6899 dflt=`$perl5 getverlist`
6904 $undef) dflt='none' ;;
6905 *) eval dflt=\"$inc_version_list\" ;;
6908 ''|' ') dflt=none ;;
6911 5.005) case "$bincompat5005" in
6912 $define|true|[yY]*) ;;
6919 In order to ease the process of upgrading, this version of perl
6920 can be configured to use modules built and installed with earlier
6921 versions of perl that were installed under $prefix. Specify here
6922 the list of earlier versions that this version of perl should check.
6923 If Configure detected no earlier versions of perl installed under
6924 $prefix, then the list will be empty. Answer 'none' to tell perl
6925 to not search earlier versions.
6927 The default should almost always be sensible, so if you're not sure,
6928 just accept the default.
6931 rp='List of earlier versions to include in @INC?'
6934 [Nn]one|''|' ') inc_version_list=' ' ;;
6935 *) inc_version_list="$ans" ;;
6937 case "$inc_version_list" in
6939 inc_version_list_init='0';;
6940 *) inc_version_list_init=`echo $inc_version_list |
6941 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6946 : determine whether to install perl also as /usr/bin/perl
6949 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
6951 Many scripts expect perl to be installed as /usr/bin/perl.
6952 I can install the perl you are about to compile also as /usr/bin/perl
6953 (in addition to $installbin/perl).
6955 case "$installusrbinperl" in
6956 "$undef"|[nN]*) dflt='n';;
6959 rp="Do you want to install perl as /usr/bin/perl?"
6962 [yY]*) val="$define";;
6968 set installusrbinperl
6971 : see if dld is available
6975 : see if dlopen exists
6982 : determine which dynamic loading, if any, to compile in
6984 dldir="ext/DynaLoader"
6997 $define) dflt='y' ;;
7000 $define) dflt='y' ;;
7002 : Does a dl_xxx.xs file exist for this operating system
7003 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7006 rp="Do you wish to use dynamic loading?"
7013 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7014 dflt="$dldir/dl_${osname}.xs"
7015 elif $test "$d_dlopen" = "$define" ; then
7016 dflt="$dldir/dl_dlopen.xs"
7017 elif $test "$i_dld" = "$define" ; then
7018 dflt="$dldir/dl_dld.xs"
7023 *) dflt="$dldir/$dlsrc"
7026 echo "The following dynamic loading files are available:"
7027 : Can not go over to $dldir because getfile has path hard-coded in.
7028 tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir
7029 rp="Source file to use for dynamic loading"
7035 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7039 Some systems may require passing special flags to $cc -c to
7040 compile modules that will be used to create a shared library.
7041 To use no flags, say "none".
7044 case "$cccdlflags" in
7045 '') case "$gccversion" in
7046 '') case "$osname" in
7048 next) dflt='none' ;;
7049 irix*) dflt='-KPIC' ;;
7050 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7051 sunos) dflt='-pic' ;;
7055 *) case "$osname" in
7056 darwin) dflt='none' ;;
7057 svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7062 *) dflt="$cccdlflags" ;;
7064 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7067 none) cccdlflags=' ' ;;
7068 *) cccdlflags="$ans" ;;
7073 Some systems use ld to create libraries that can be dynamically loaded,
7074 while other systems (such as those using ELF) use $cc.
7078 '') $cat >try.c <<'EOM'
7079 /* Test for whether ELF binaries are produced */
7084 int i = open("a.out",O_RDONLY);
7087 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7088 exit(0); /* succeed (yes, it's ELF) */
7093 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7095 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7099 echo "I'll use ld to build dynamic libraries."
7108 rp="What command should be used to create dynamic libraries?"
7114 Some systems may require passing special flags to $ld to create a
7115 library that can be dynamically loaded. If your ld flags include
7116 -L/other/path options to locate libraries outside your loader's normal
7117 search path, you may need to specify those -L options here as well. To
7118 use no flags, say "none".
7121 case "$lddlflags" in
7122 '') case "$osname" in
7123 beos) dflt='-nostart' ;;
7125 case "$gccversion" in
7126 '') dflt="$dflt +vnocompatwarnings" ;;
7129 linux|irix*) dflt='-shared' ;;
7130 next) dflt='none' ;;
7131 solaris) dflt='-G' ;;
7132 sunos) dflt='-assert nodefinitions' ;;
7133 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
7137 *) dflt="$lddlflags" ;;
7140 : Try to guess additional flags to pick up local libraries.
7141 : Be careful not to append to a plain 'none'
7145 for thisflag in $ldflags; do
7150 *) dflt="$dflt $thisflag" ;;
7157 ''|' ') dflt='none' ;;
7160 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
7163 none) lddlflags=' ' ;;
7164 *) lddlflags="$ans" ;;
7169 Some systems may require passing special flags to $cc to indicate that
7170 the resulting executable will use dynamic linking. To use no flags,
7174 case "$ccdlflags" in
7175 '') case "$osname" in
7176 hpux) dflt='-Wl,-E' ;;
7177 linux) dflt='-rdynamic' ;;
7178 next) dflt='none' ;;
7179 sunos) dflt='none' ;;
7183 *) dflt="$ccdlflags" ;;
7185 rp="Any special flags to pass to $cc to use dynamic linking?"
7188 none) ccdlflags=' ' ;;
7189 *) ccdlflags="$ans" ;;
7203 # No dynamic loading being used, so don't bother even to prompt.
7206 *) case "$useshrplib" in
7207 '') case "$osname" in
7208 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
7210 also='Building a shared libperl is required for dynamic loading to work on your system.'
7215 also='Building a shared libperl is needed for MAB support.'
7233 The perl executable is normally obtained by linking perlmain.c with
7234 libperl${_a}, any static extensions (usually just DynaLoader), and
7235 any other libraries needed on this system (such as -lm, etc.). Since
7236 your system supports dynamic loading, it is probably possible to build
7237 a shared libperl.$so. If you will have more than one executable linked
7238 to libperl.$so, this will significantly reduce the size of each
7239 executable, but it may have a noticeable affect on performance. The
7240 default is probably sensible for your system.
7244 rp="Build a shared libperl.$so (y/n)"
7248 useshrplib='true' ;;
7249 *) useshrplib='false' ;;
7254 case "$useshrplib" in
7258 # Figure out a good name for libperl.so. Since it gets stored in
7259 # a version-specific architecture-dependent library, the version
7260 # number isn't really that important, except for making cc/ld happy.
7262 # A name such as libperl.so.3.1
7263 majmin="libperl.$so.$patchlevel.$subversion"
7264 # A name such as libperl.so.301
7265 majonly=`echo $patchlevel $subversion |
7266 $awk '{printf "%d%02d", $1, $2}'`
7267 majonly=libperl.$so.$majonly
7268 # I'd prefer to keep the os-specific stuff here to a minimum, and
7269 # rely on figuring it out from the naming of libc.
7270 case "${osname}${osvers}" in
7273 # XXX How handle the --version stuff for MAB?
7275 linux*) # ld won't link with a bare -lperl otherwise.
7278 cygwin*) # include version
7279 dflt=`echo libperl$version | sed -e 's/\./_/g'`$lib_ext
7281 *) # Try to guess based on whether libc has major.minor.
7283 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
7284 *libc.$so.[0-9]*) dflt=$majonly ;;
7285 *) dflt=libperl.$so ;;
7295 I need to select a good name for the shared libperl. If your system uses
7296 library names with major and minor numbers, then you might want something
7297 like $majmin. Alternatively, if your system uses a single version
7298 number for shared libraries, then you might want to use $majonly.
7299 Or, your system might be quite happy with a simple libperl.$so.
7301 Since the shared libperl will get installed into a version-specific
7302 architecture-dependent directory, the version number of the shared perl
7303 library probably isn't important, so the default should be o.k.
7306 rp='What name do you want to give to the shared libperl?'
7309 echo "Ok, I'll use $libperl"
7312 libperl="libperl${_a}"
7316 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
7320 WARNING: Use of the shrpdir variable for the installation location of
7321 the shared $libperl is not supported. It was never documented and
7322 will not work in this version. Let me (perlbug@perl.org)
7323 know of any problems this may cause.
7329 But your current setting of $shrpdir is
7330 the default anyway, so it's harmless.
7335 Further, your current attempted setting of $shrpdir
7336 conflicts with the value of $archlibexp/CORE
7337 that installperl will use.
7344 # How will the perl executable find the installed shared $libperl?
7345 # Add $xxx to ccdlflags.
7346 # If we can't figure out a command-line option, use $shrpenv to
7347 # set env LD_RUN_PATH. The main perl makefile uses this.
7348 shrpdir=$archlibexp/CORE
7351 if "$useshrplib"; then
7354 # We'll set it in Makefile.SH...
7360 xxx="-Wl,-R$shrpdir"
7362 linux|irix*|dec_osf)
7363 xxx="-Wl,-rpath,$shrpdir"
7366 # next doesn't like the default...
7369 # beos doesn't like the default, either.
7372 # hpux doesn't like the default, either.
7373 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
7376 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
7382 # Only add $xxx if it isn't already in ccdlflags.
7383 case " $ccdlflags " in
7385 *) ccdlflags="$ccdlflags $xxx"
7388 Adding $xxx to the flags
7389 passed to $ld so that the perl executable will find the
7390 installed shared $libperl.
7398 # Fix ccdlflags in AIX for building external extensions.
7399 # (For building Perl itself bare -bE:perl.exp is needed,
7400 # Makefile.SH takes care of this.)
7402 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
7404 # Respect a hint or command-line value.
7406 '') shrpenv="$tmp_shrpenv" ;;
7408 case "$ldlibpthname" in
7409 '') ldlibpthname=LD_LIBRARY_PATH ;;
7410 none) ldlibpthname='' ;;
7413 : determine where manual pages are on this system
7417 syspath='/usr/share/man/man1 /usr/man/man1'
7418 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
7419 syspath="$syspath /usr/man/u_man/man1"
7420 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
7421 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
7422 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
7423 sysman=`./loc . /usr/man/man1 $syspath`
7426 if $test -d "$sysman"; then
7427 echo "System manual is in $sysman." >&4
7429 echo "Could not find manual pages in source form." >&4
7432 : determine where manual pages go
7433 set man1dir man1dir none
7437 $spackage has manual pages available in source form.
7441 echo "However, you don't have nroff, so they're probably useless to you."
7443 '') man1dir="none";;
7446 echo "If you don't want the manual sources installed, answer 'none'."
7451 lookpath="$prefixexp/share/man/man1"
7452 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
7453 lookpath="$lookpath $prefixexp/man/p_man/man1"
7454 lookpath="$lookpath $prefixexp/man/u_man/man1"
7455 lookpath="$lookpath $prefixexp/man/man.1"
7457 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
7458 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
7468 rp="Where do the main $spackage manual pages (source) go?"
7470 if $test "X$man1direxp" != "X$ansexp"; then
7474 man1direxp="$ansexp"
7480 : Change installation prefix, if necessary.
7481 if $test X"$prefix" != X"$installprefix"; then
7482 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
7484 installman1dir="$man1direxp"
7487 : What suffix to use on installed man pages
7494 rp="What suffix should be used for the main $spackage man pages?"
7496 '') case "$man1dir" in
7510 *) dflt="$man1ext";;
7517 : see if we can have long filenames
7519 first=123456789abcdef
7521 if (echo hi >$first) 2>/dev/null; then
7522 if $test -f 123456789abcde; then
7523 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
7526 echo 'You can have filenames longer than 14 characters.'>&4
7531 You can't have filenames longer than 14 chars.
7532 You can't even think about them!
7538 $rm -rf 123456789abcde*
7540 : determine where library module manual pages go
7541 set man3dir man3dir none
7545 $spackage has manual pages for many of the library modules.
7551 However, you don't have nroff, so they're probably useless to you.
7554 '') man3dir="none";;
7558 case "$d_flexfnam" in
7561 However, your system can't handle the long file names like File::Basename.3.
7564 '') man3dir="none";;
7568 echo "If you don't want the manual sources installed, answer 'none'."
7569 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7571 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
7572 if $test -d "$privlib/man/man3"; then
7575 WARNING: Previous versions of perl installed man3 pages into
7576 $privlib/man/man3. This version will suggest a
7577 new default of $dflt.
7581 rp='Do you wish to preserve the old behavior?(y/n)'
7584 y*) dflt="$privlib/man/man3" ;;
7589 *) dflt="$man3dir" ;;
7596 rp="Where do the $package library man pages (source) go?"
7599 man3direxp="$ansexp"
7605 : Change installation prefix, if necessary.
7606 if $test X"$prefix" != X"$installprefix"; then
7607 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
7609 installman3dir="$man3direxp"
7612 : What suffix to use on installed man pages
7618 rp="What suffix should be used for the $package library man pages?"
7620 '') case "$man3dir" in
7634 *) dflt="$man3ext";;
7641 : see if we have to deal with yellow pages, now NIS.
7642 if $test -d /usr/etc/yp || $test -d /etc/yp; then
7643 if $test -f /usr/etc/nibindd; then
7645 echo "I'm fairly confident you're on a NeXT."
7647 rp='Do you get the hosts file via NetInfo?'
7656 y*) hostcat='nidump hosts .';;
7657 *) case "$hostcat" in
7658 nidump*) hostcat='';;
7668 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
7676 rp='Are you getting the hosts file via yellow pages?'
7679 y*) hostcat='ypcat hosts';;
7680 *) hostcat='cat /etc/hosts';;
7686 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
7689 '') test -f /etc/group && groupcat='cat /etc/group';;
7692 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
7695 : now get the host name
7697 echo "Figuring out host name..." >&4
7698 case "$myhostname" in
7700 echo 'Maybe "hostname" will work...'
7701 if tans=`sh -c hostname 2>&1` ; then
7709 if $test "$cont"; then
7711 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
7712 if tans=`cat /etc/systemid 2>&1` ; then
7714 phostname='cat /etc/systemid'
7715 echo "Whadyaknow. Xenix always was a bit strange..."
7718 elif $test -r /etc/systemid; then
7719 echo "(What is a non-Xenix system doing with /etc/systemid?)"
7722 if $test "$cont"; then
7723 echo 'No, maybe "uuname -l" will work...'
7724 if tans=`sh -c 'uuname -l' 2>&1` ; then
7726 phostname='uuname -l'
7728 echo 'Strange. Maybe "uname -n" will work...'
7729 if tans=`sh -c 'uname -n' 2>&1` ; then
7731 phostname='uname -n'
7733 echo 'Oh well, maybe I can mine it out of whoami.h...'
7734 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
7735 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
7736 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
7738 case "$myhostname" in
7739 '') echo "Does this machine have an identity crisis or something?"
7742 echo "Well, you said $myhostname before..."
7743 phostname='echo $myhostname';;
7749 : you do not want to know about this
7754 if $test "$myhostname" ; then
7756 rp='Your host name appears to be "'$myhostname'".'" Right?"
7764 : bad guess or no guess
7765 while $test "X$myhostname" = X ; do
7767 rp="Please type the (one word) name of your host:"
7772 : translate upper to lower if necessary
7773 case "$myhostname" in
7775 echo "(Normalizing case in your host name)"
7776 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
7780 case "$myhostname" in
7782 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
7783 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
7784 echo "(Trimming domain name from host name--host name is now $myhostname)"
7786 *) case "$mydomain" in
7789 test "X$hostcat" = "Xypcat hosts" &&
7790 ypmatch "$myhostname" hosts 2>/dev/null |\
7791 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
7794 test "X$hostcat" != "X" &&
7795 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
7796 /[ ]$myhostname[ . ]/p" > hosts
7799 if $test -f hosts; then
7800 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
7801 END { print sum }" hosts` = x1 || tmp_re="[ ]"
7802 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
7803 hosts | $sort | $uniq | \
7804 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
7805 case `$echo X$dflt` in
7806 X*\ *) echo "(Several hosts in the database matched hostname)"
7809 X.) echo "(You do not have fully-qualified names in the hosts database)"
7813 echo "(I cannot locate a hosts database anywhere)"
7818 tans=`./loc resolv.conf X /etc /usr/etc`
7819 if $test -f "$tans"; then
7820 echo "(Attempting domain name extraction from $tans)"
7821 dflt=.`$sed -n -e 's/ / /g' \
7822 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
7823 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
7825 .) dflt=.`$sed -n -e 's/ / /g' \
7826 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
7827 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
7834 .) echo "(No help from resolv.conf either -- attempting clever guess)"
7835 dflt=.`sh -c domainname 2>/dev/null`
7838 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
7842 case "$dflt$osname" in
7843 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
7844 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
7848 .) echo "(Lost all hope -- silly guess then)"
7854 *) dflt="$mydomain";;
7858 rp="What is your domain name?"
7868 : translate upper to lower if necessary
7871 echo "(Normalizing case in your domain name)"
7872 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
7876 : a little sanity check here
7877 case "$phostname" in
7880 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
7881 $myhostname$mydomain|$myhostname) ;;
7883 case "$phostname" in
7885 echo "(That doesn't agree with your whoami.h file, by the way.)"
7888 echo "(That doesn't agree with your $phostname command, by the way.)"
7898 I need to get your e-mail address in Internet format if possible, i.e.
7899 something like user@host.domain. Please answer accurately since I have
7900 no easy means to double check it. The default value provided below
7901 is most probably close to reality but may not be valid from outside
7902 your organization...
7906 while test "$cont"; do
7908 '') dflt="$cf_by@$myhostname$mydomain";;
7909 *) dflt="$cf_email";;
7911 rp='What is your e-mail address?'
7917 rp='Address does not look like an Internet one. Use it anyway?'
7933 If you or somebody else will be maintaining perl at your site, please
7934 fill in the correct e-mail address here so that they may be contacted
7935 if necessary. Currently, the "perlbug" program included with perl
7936 will send mail to this address in addition to perlbug@perl.org. You may
7937 enter "none" for no administrator.
7940 case "$perladmin" in
7941 '') dflt="$cf_email";;
7942 *) dflt="$perladmin";;
7944 rp='Perl administrator e-mail address'
7948 : determine whether to only install version-specific parts.
7951 Do you want to install only the version-specific parts of the perl
7952 distribution? Usually you do *not* want to do this.
7954 case "$versiononly" in
7955 "$define"|[Yy]*|true) dflt='y' ;;
7958 rp="Do you want to install only the version-specific parts of perl?"
7961 [yY]*) val="$define";;
7967 : figure out how to guarantee perl startup
7968 case "$startperl" in
7970 case "$sharpbang" in
7974 I can use the #! construct to start perl on your system. This will
7975 make startup of perl scripts faster, but may cause problems if you
7976 want to share those scripts and perl is not in a standard place
7977 ($binexp/perl) on all your platforms. The alternative is to force
7978 a shell by starting the script with a single ':' character.
7981 case "$versiononly" in
7982 "$define") dflt="$binexp/perl$version";;
7983 *) dflt="$binexp/perl";;
7985 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
7988 none) startperl=": # use perl";;
7989 *) startperl="#!$ans"
7990 if $test 30 -lt `echo "$ans" | wc -c`; then
7993 WARNING: Some systems limit the #! command to 32 characters.
7994 If you experience difficulty running Perl scripts with #!, try
7995 installing Perl in a directory with a shorter pathname.
8001 *) startperl=": # use perl"
8006 echo "I'll use $startperl to start perl scripts."
8008 : figure best path for perl in scripts
8011 perlpath="$binexp/perl"
8012 case "$startperl" in
8017 I will use the "eval 'exec'" idiom to start Perl on your system.
8018 I can use the full path of your Perl binary for this purpose, but
8019 doing so may cause problems if you want to share those scripts and
8020 Perl is not always in a standard place ($binexp/perl).
8024 rp="What path shall I use in \"eval 'exec'\"?"
8031 case "$startperl" in
8033 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8036 : determine where public executable scripts go
8037 set scriptdir scriptdir
8039 case "$scriptdir" in
8042 : guess some guesses
8043 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8044 $test -d /usr/share/bin && dflt=/usr/share/bin
8045 $test -d /usr/local/script && dflt=/usr/local/script
8046 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8047 $test -d $prefixexp/script && dflt=$prefixexp/script
8051 *) dflt="$scriptdir"
8056 Some installations have a separate directory just for executable scripts so
8057 that they can mount it across multiple architectures but keep the scripts in
8058 one spot. You might, for example, have a subdirectory of /usr/share for this.
8059 Or you might just lump your scripts in with all your other executables.
8063 rp='Where do you keep publicly executable scripts?'
8065 if $test "X$ansexp" != "X$scriptdirexp"; then
8069 scriptdirexp="$ansexp"
8070 : Change installation prefix, if necessary.
8071 if $test X"$prefix" != X"$installprefix"; then
8072 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
8074 installscript="$scriptdirexp"
8077 : determine where add-on public executables go
8079 '') dflt=$siteprefix/bin ;;
8083 rp='Pathname where the add-on public executables should be installed?'
8086 sitebinexp="$ansexp"
8087 : Change installation prefix, if necessary.
8088 if $test X"$prefix" != X"$installprefix"; then
8089 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
8091 installsitebin="$sitebinexp"
8094 : define an is-a-typedef? function
8095 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8097 "") inclist="sys/types.h";;
8099 eval "varval=\$$var";
8103 for inc in $inclist; do
8104 echo "#include <$inc>" >>temp.c;
8106 echo "#ifdef $type" >> temp.c;
8107 echo "printf(\"We have $type\");" >> temp.c;
8108 echo "#endif" >> temp.c;
8109 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8110 if $contains $type temp.E >/dev/null 2>&1; then
8116 *) eval "$var=\$varval";;
8119 : define an is-a-typedef? function that prompts if the type is not available.
8120 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8122 "") inclist="sys/types.h";;
8124 eval "varval=\$$var";
8128 for inc in $inclist; do
8129 echo "#include <$inc>" >>temp.c;
8131 echo "#ifdef $type" >> temp.c;
8132 echo "printf(\"We have $type\");" >> temp.c;
8133 echo "#endif" >> temp.c;
8134 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8136 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
8137 if $contains $type temp.E >/dev/null 2>&1; then
8138 echo "$type found." >&4;
8141 echo "$type NOT found." >&4;
8147 *) eval "$var=\$varval";;
8150 : see what type lseek is declared as in the kernel
8151 rp="What is the type used for lseek's offset on this system?"
8152 set off_t lseektype long stdio.h sys/types.h
8156 echo "Checking to see how big your file offsets are..." >&4
8158 #include <sys/types.h>
8162 printf("%d\n", (int)sizeof($lseektype));
8167 if eval $compile_ok; then
8168 lseeksize=`$run ./try`
8169 echo "Your file offsets are $lseeksize bytes long."
8173 echo "(I can't seem to compile the test program. Guessing...)"
8174 rp="What is the size of your file offsets (in bytes)?"
8180 : see what type file positions are declared as in the library
8181 rp="What is the type for file position used by fsetpos()?"
8182 set fpos_t fpostype long stdio.h sys/types.h
8187 *_t) zzz="$fpostype" ;;
8190 echo "Checking the size of $zzz..." >&4
8192 #include <sys/types.h>
8195 printf("%d\n", (int)sizeof($fpostype));
8200 if eval $compile_ok; then
8204 echo "(I can't execute the test program--guessing $fpossize.)" >&4
8207 echo "Your $zzz is $fpossize bytes long."
8213 echo "(I can't compile the test program. Guessing...)" >&4
8214 rp="What is the size of your file positions (in bytes)?"
8221 # Backward compatibility (uselfs is deprecated).
8223 "$define"|true|[yY]*)
8226 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
8228 uselargefiles="$define"
8232 case "$lseeksize:$fpossize" in
8235 You can have files larger than 2 gigabytes.
8238 *) case "$uselargefiles" in
8239 "$undef"|false|[nN]*) dflt='n' ;;
8244 Perl can be built to understand large files (files larger than 2 gigabytes)
8245 on some systems. To do so, Configure can be run with -Duselargefiles.
8247 If this doesn't make any sense to you, just accept the default '$dflt'.
8249 rp='Try to understand large files, if available?'
8252 y|Y) val="$define" ;;
8259 case "$uselargefiles" in
8261 : Look for a hint-file generated 'call-back-unit'. If the
8262 : user has specified that a large files perl is to be built,
8263 : we may need to set or change some other defaults.
8264 if $test -f uselargefiles.cbu; then
8265 echo "Your platform has some specific hints for large file builds, using them..."
8266 . ./uselargefiles.cbu
8268 echo "Rechecking to see how big your file offsets are..." >&4
8270 #include <sys/types.h>
8274 printf("%d\n", (int)sizeof($lseektype));
8279 if eval $compile_ok; then
8280 lseeksize=`$run ./try`
8281 $echo "Your file offsets are now $lseeksize bytes long."
8285 echo "(I can't seem to compile the test program. Guessing...)"
8286 rp="What is the size of your file offsets (in bytes)?"
8291 *_t) zzz="$fpostype" ;;
8294 $echo $n "Rechecking the size of $zzz...$c" >&4
8296 #include <sys/types.h>
8299 printf("%d\n", (int)sizeof($fpostype));
8304 if eval $compile_ok; then
8309 echo "(I can't execute the test program--guessing $fpossize.)" >&4
8312 echo " $fpossize bytes." >&4
8318 echo "(I can't compile the test program. Guessing...)" >&4
8319 rp="What is the size of your file positions (in bytes)?"
8328 case "$vendorprefix" in
8329 '') d_vendorbin="$undef"
8333 *) d_vendorbin="$define"
8334 : determine where vendor-supplied executables go.
8335 case "$vendorbin" in
8336 '') dflt=$vendorprefix/bin ;;
8337 *) dflt="$vendorbin" ;;
8340 rp='Pathname for the vendor-supplied executables directory?'
8343 vendorbinexp="$ansexp"
8346 : Change installation prefix, if necessary.
8347 if $test X"$prefix" != X"$installprefix"; then
8348 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
8350 installvendorbin="$vendorbinexp"
8353 : see if qgcvt exists
8359 if $test X"$d_longdbl" = X"$define"; then
8361 echo "Checking how to print long doubles..." >&4
8363 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
8364 $cat >try.c <<'EOCP'
8365 #include <sys/types.h>
8369 printf("%.3f\n", d);
8373 if eval $compile; then
8377 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
8378 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
8379 echo "We will use %f."
8385 if $test X"$sPRIfldbl" = X; then
8386 $cat >try.c <<'EOCP'
8387 #include <sys/types.h>
8390 long double d = 123.456;
8391 printf("%.3Lf\n", d);
8395 if eval $compile; then
8399 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
8400 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
8401 echo "We will use %Lf."
8407 if $test X"$sPRIfldbl" = X; then
8408 $cat >try.c <<'EOCP'
8409 #include <sys/types.h>
8412 long double d = 123.456;
8413 printf("%.3llf\n", d);
8417 if eval $compile; then
8421 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
8422 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
8423 echo "We will use %llf."
8429 if $test X"$sPRIfldbl" = X; then
8430 $cat >try.c <<'EOCP'
8431 #include <sys/types.h>
8434 long double d = 123.456;
8435 printf("%.3lf\n", d);
8439 if eval $compile; then
8443 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
8444 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
8445 echo "We will use %lf."
8451 if $test X"$sPRIfldbl" = X; then
8452 echo "Cannot figure out how to print long doubles." >&4
8454 sSCNfldbl=$sPRIfldbl # expect consistency
8461 case "$sPRIfldbl" in
8462 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
8463 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
8464 d_SCNfldbl="$undef";
8466 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
8467 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
8468 d_SCNfldbl="$define";
8472 : Check how to convert floats to strings.
8474 echo "Checking for an efficient way to convert floats to strings."
8476 case "$uselongdouble" in
8477 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
8479 case "$d_longdbl" in
8480 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
8482 case "$d_PRIgldbl" in
8483 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
8487 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
8488 char *myname = "gconvert";
8491 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
8492 char *myname = "gcvt";
8495 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
8496 char *myname = "qgcvt";
8497 #define DOUBLETYPE long double
8500 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE) && defined(HAS_PRIgldbl)
8501 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
8503 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
8505 char *myname = "sprintf";
8509 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
8510 #define DOUBLETYPE long double
8512 #define DOUBLETYPE double
8518 #define I_STDLIB $i_stdlib
8524 checkit(expect, got)
8528 if (strcmp(expect, got)) {
8529 printf("%s oddity: Expected %s, got %s\n",
8530 myname, expect, got);
8540 /* This must be 1st test on (which?) platform */
8541 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
8542 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
8543 checkit("0.1", buf);
8545 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
8548 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
8549 checkit("1.1", buf);
8551 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
8552 checkit("1.01", buf);
8554 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
8555 checkit("1.001", buf);
8557 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
8558 checkit("1.0001", buf);
8560 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
8561 checkit("1.00001", buf);
8563 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
8564 checkit("1.000001", buf);
8566 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
8569 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
8572 /* Some Linux gcvt's give 1.e+5 here. */
8573 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
8574 checkit("100000", buf);
8576 /* Some Linux gcvt's give -1.e+5 here. */
8577 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
8578 checkit("-100000", buf);
8580 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
8581 checkit("123.456", buf);
8583 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
8584 Gconvert((DOUBLETYPE)1e30, 8, 0, buf);
8585 if (strlen(buf) > 5)
8586 checkit("1e+030", buf); /* for Microsoft */
8588 checkit("1e+30", buf);
8593 case "$d_Gconvert" in
8594 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
8595 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
8596 sprintf*) xxx_list='sprintf gconvert gcvt' ;;
8597 *) xxx_list='gconvert gcvt sprintf' ;;
8600 case "$d_longdbl$uselongdouble$d_PRIgldbl" in
8601 "$define$define$define")
8602 # for long doubles prefer first qgcvt, then sprintf
8603 xxx_list="`echo $xxx_list|sed s/sprintf//`"
8604 xxx_list="sprintf $xxx_list"
8606 "$define") xxx_list="qgcvt $xxx_list" ;;
8611 for xxx_convert in $xxx_list; do
8612 echo "Trying $xxx_convert..."
8614 set try -DTRY_$xxx_convert
8615 if eval $compile; then
8616 echo "$xxx_convert() found." >&4
8618 echo "I'll use $xxx_convert to convert floats into a string." >&4
8621 echo "...But $xxx_convert didn't work as I expected."
8624 echo "$xxx_convert NOT found." >&4
8628 case "$xxx_convert" in
8629 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
8630 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
8631 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
8632 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
8633 "$define$define$define")
8634 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
8635 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
8640 : see if _fwalk exists
8644 : Initialize h_fcntl
8647 : Initialize h_sysfile
8650 : access call always available on UNIX
8654 : locate the flags for 'access()'
8658 $cat >access.c <<'EOCP'
8659 #include <sys/types.h>
8664 #include <sys/file.h>
8673 : check sys/file.h first, no particular reason here
8674 if $test `./findhdr sys/file.h` && \
8675 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
8677 echo "<sys/file.h> defines the *_OK access constants." >&4
8678 elif $test `./findhdr fcntl.h` && \
8679 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
8681 echo "<fcntl.h> defines the *_OK access constants." >&4
8682 elif $test `./findhdr unistd.h` && \
8683 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
8684 echo "<unistd.h> defines the *_OK access constants." >&4
8686 echo "I can't find the four *_OK access constants--I'll use mine." >&4
8692 : see if accessx exists
8693 set accessx d_accessx
8696 : see if alarm exists
8700 : see if atolf exists
8704 : see if atoll exists
8708 : Look for GNU-cc style attribute checking
8710 echo "Checking whether your compiler can handle __attribute__ ..." >&4
8711 $cat >attrib.c <<'EOCP'
8713 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
8715 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
8716 if $contains 'warning' attrib.out >/dev/null 2>&1; then
8717 echo "Your C compiler doesn't fully support __attribute__."
8720 echo "Your C compiler supports __attribute__."
8724 echo "Your C compiler doesn't seem to understand __attribute__ at all."
8731 : see if bcmp exists
8735 : see if bcopy exists
8739 : see if this is a unistd.h system
8740 set unistd.h i_unistd
8743 : see if getpgrp exists
8744 set getpgrp d_getpgrp
8747 case "$d_getpgrp" in
8750 echo "Checking to see which flavor of getpgrp is in use..."
8753 #include <sys/types.h>
8755 # include <unistd.h>
8759 if (getuid() == 0) {
8760 printf("(I see you are running Configure as super-user...)\n");
8764 if (getpgrp(1) == 0)
8773 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
8774 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
8776 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
8777 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
8780 echo "I can't seem to compile and run the test program."
8782 xxx="a USG one, i.e. you use getpgrp()."
8784 # SVR4 systems can appear rather BSD-ish.
8787 xxx="a BSD one, i.e. you use getpgrp(pid)."
8791 xxx="probably a USG one, i.e. you use getpgrp()."
8796 echo "Assuming your getpgrp is $xxx" >&4
8805 : see if setpgrp exists
8806 set setpgrp d_setpgrp
8809 case "$d_setpgrp" in
8812 echo "Checking to see which flavor of setpgrp is in use..."
8815 #include <sys/types.h>
8817 # include <unistd.h>
8821 if (getuid() == 0) {
8822 printf("(I see you are running Configure as super-user...)\n");
8826 if (-1 == setpgrp(1, 1))
8829 if (setpgrp() != -1)
8835 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
8836 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
8838 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
8839 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
8842 echo "(I can't seem to compile and run the test program.)"
8844 xxx="a USG one, i.e. you use setpgrp()."
8846 # SVR4 systems can appear rather BSD-ish.
8849 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
8853 xxx="probably a USG one, i.e. you use setpgrp()."
8858 echo "Assuming your setpgrp is $xxx" >&4
8866 : see if bzero exists
8870 : see if signal is declared as pointer to function returning int or void
8872 xxx=`./findhdr signal.h`
8873 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
8874 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
8875 echo "You have int (*signal())() instead of void." >&4
8877 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
8878 echo "You have void (*signal())()." >&4
8880 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
8881 echo "You have int (*signal())() instead of void." >&4
8883 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
8884 echo "You have void (*signal())()." >&4
8887 case "$d_voidsig" in
8889 echo "I can't determine whether signal handler returns void or int..." >&4
8891 rp="What type does your signal handler return?"
8898 echo "As you already told me, signal handler returns void." >&4
8901 *) echo "As you already told me, signal handler returns int." >&4
8908 case "$d_voidsig" in
8909 "$define") signal_t="void";;
8914 : check for ability to cast large floats to 32-bit ints.
8916 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
8917 if $test "$intsize" -ge 4; then
8924 #include <sys/types.h>
8926 $signal_t blech(s) int s; { exit(3); }
8933 signal(SIGFPE, blech);
8935 /* Don't let compiler optimize the test away. Store the number
8936 in a writable string for gcc to pass to sscanf under HP/UX.
8938 sprintf(str, "2147483647");
8939 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
8943 /* x86 processors will probably give 0x8000 0000, which is a
8944 sign change. We don't want that. We want to mimic SPARC
8945 behavior here, which is to preserve the sign and give
8948 if (i32 != ($xxx) f)
8954 if eval $compile_ok; then
8958 echo "(I can't seem to compile the test program--assuming it can't)"
8966 echo "Nope, it can't."
8973 : check for ability to cast negative floats to unsigned
8975 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
8978 #include <sys/types.h>
8980 $signal_t blech(s) int s; { exit(7); }
8981 $signal_t blech_in_list(s) int s; { exit(4); }
8982 unsigned long dummy_long(p) unsigned long p; { return p; }
8983 unsigned int dummy_int(p) unsigned int p; { return p; }
8984 unsigned short dummy_short(p) unsigned short p; { return p; }
8988 unsigned long along;
8990 unsigned short ashort;
8994 /* Frustrate gcc-2.7.2's optimizer which failed this test with
8995 a direct f = -123. assignment. gcc-2.8.0 reportedly
8996 optimized the whole file away
8998 /* Store the number in a writable string for gcc to pass to
9001 sprintf(str, "-123");
9002 sscanf(str, "%lf", &f); /* f = -123.; */
9004 signal(SIGFPE, blech);
9005 along = (unsigned long)f;
9006 aint = (unsigned int)f;
9007 ashort = (unsigned short)f;
9008 if (along != (unsigned long)-123)
9010 if (aint != (unsigned int)-123)
9012 if (ashort != (unsigned short)-123)
9014 sprintf(str, "1073741824.");
9015 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
9018 along = (unsigned long)f;
9019 if (along != 0x80000000)
9023 along = (unsigned long)f;
9024 if (along != 0x7fffffff)
9028 along = (unsigned long)f;
9029 if (along != 0x80000001)
9033 signal(SIGFPE, blech_in_list);
9034 sprintf(str, "123.");
9035 sscanf(str, "%lf", &f); /* f = 123.; */
9036 along = dummy_long((unsigned long)f);
9037 aint = dummy_int((unsigned int)f);
9038 ashort = dummy_short((unsigned short)f);
9039 if (along != (unsigned long)123)
9041 if (aint != (unsigned int)123)
9043 if (ashort != (unsigned short)123)
9050 if eval $compile_ok; then
9054 echo "(I can't seem to compile the test program--assuming it can't)"
9057 case "$castflags" in
9062 echo "Nope, it can't."
9069 : see if vprintf exists
9071 if set vprintf val -f d_vprintf; eval $csym; $val; then
9072 echo 'vprintf() found.' >&4
9075 #include <varargs.h>
9077 int main() { xxx("foo"); }
9086 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
9090 if eval $compile && $run ./try; then
9091 echo "Your vsprintf() returns (int)." >&4
9094 echo "Your vsprintf() returns (char*)." >&4
9098 echo 'vprintf() NOT found.' >&4
9109 : see if chown exists
9113 : see if chroot exists
9117 : see if chsize exists
9121 : see if class exists
9125 hasstruct='varname=$1; struct=$2; shift; shift;
9126 while $test $# -ge 2; do
9128 $define) echo "#include <$2>";;
9132 echo "int main () { struct $struct foo; }" >> try.c;
9134 if eval $compile; then
9143 : see if sys/types.h has to be included
9144 set sys/types.h i_systypes
9147 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
9148 while $test $# -ge 2; do
9150 $define) echo "#include <$2>";;
9154 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
9156 if eval $compile; then
9167 : see whether socket exists
9169 $echo $n "Hmm... $c" >&4
9170 if set socket val -f d_socket; eval $csym; $val; then
9171 echo "Looks like you have Berkeley networking support." >&4
9173 if set setsockopt val -f; eval $csym; $val; then
9176 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
9180 if $contains socklib libc.list >/dev/null 2>&1; then
9181 echo "Looks like you have Berkeley networking support." >&4
9183 : we will have to assume that it supports the 4.2 BSD interface
9186 echo "You don't have Berkeley networking in libc$_a..." >&4
9187 if test "X$d_socket" = "X$define"; then
9188 echo "...but you seem to believe that you have sockets." >&4
9190 for net in net socket
9192 if test -f /usr/lib/lib$net$_a; then
9193 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
9194 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
9195 if $contains socket libc.list >/dev/null 2>&1; then
9200 echo "...but the Wollongong group seems to have hacked it in." >&4
9201 sockethdr="-I/usr/netinclude"
9204 echo "Found Berkeley sockets interface in lib$net." >& 4
9205 if $contains setsockopt libc.list >/dev/null 2>&1; then
9208 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
9215 if test "X$d_socket" != "X$define"; then
9216 echo "or anywhere else I see." >&4
9224 : see if socketpair exists
9225 set socketpair d_sockpair
9230 echo "Checking the availability of certain socket constants..." >& 4
9231 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
9232 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
9234 #include <sys/types.h>
9235 #include <sys/socket.h>
9241 set try; if eval $compile; then
9244 set d_${enum}; eval $setvar
9248 : see if this is a sys/uio.h system
9249 set sys/uio.h i_sysuio
9254 echo "Checking to see if your system supports struct cmsghdr..." >&4
9255 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
9257 case "$d_cmsghdr_s" in
9258 "$define") echo "Yes, it does." ;;
9259 *) echo "No, it doesn't." ;;
9263 : check for const keyword
9265 echo 'Checking to see if your C compiler knows about "const"...' >&4
9266 $cat >const.c <<'EOCP'
9267 typedef struct spug { int drokk; } spug;
9274 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
9276 echo "Yup, it does."
9279 echo "Nope, it doesn't."
9284 : see if crypt exists
9286 if set crypt val -f d_crypt; eval $csym; $val; then
9287 echo 'crypt() found.' >&4
9291 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
9292 if $test -z "$cryptlib"; then
9293 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
9297 if $test -z "$cryptlib"; then
9298 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
9302 if $test -z "$cryptlib"; then
9303 cryptlib=`./loc libcrypt$_a "" $libpth`
9307 if $test -z "$cryptlib"; then
9308 echo 'crypt() NOT found.' >&4
9317 : get csh whereabouts
9319 'csh') val="$undef" ;;
9324 : Respect a hint or command line value for full_csh.
9326 '') full_csh=$csh ;;
9329 : see if cuserid exists
9330 set cuserid d_cuserid
9333 : see if this is a limits.h system
9334 set limits.h i_limits
9337 : see if this is a float.h system
9341 : See if number of significant digits in a double precision number is known
9343 $cat >dbl_dig.c <<EOM
9353 printf("Contains DBL_DIG");
9356 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
9357 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
9358 echo "DBL_DIG found." >&4
9361 echo "DBL_DIG NOT found." >&4
9368 hasproto='varname=$1; func=$2; shift; shift;
9369 while $test $# -ge 2; do
9371 $define) echo "#include <$2>";;
9375 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
9376 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
9377 echo "$func() prototype found.";
9380 echo "$func() prototype NOT found.";
9385 $rm -f try.c tryout.c'
9387 : see if dbm.h is available
9388 : see if dbmclose exists
9389 set dbmclose d_dbmclose
9392 case "$d_dbmclose" in
9402 *) set rpcsvc/dbm.h i_rpcsvcdbm
9407 *) echo "We won't be including <dbm.h>"
9417 : see if prototype for dbminit is available
9419 set d_dbminitproto dbminit $i_dbm dbm.h
9422 : see if difftime exists
9423 set difftime d_difftime
9426 : see if this is a dirent system
9428 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
9430 echo "<dirent.h> found." >&4
9433 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
9434 echo "<sys/dir.h> found." >&4
9437 xinc=`./findhdr sys/ndir.h`
9439 echo "<dirent.h> NOT found." >&4
9444 : Look for type of directory structure.
9446 $cppstdin $cppflags $cppminus < "$xinc" > try.c
9448 case "$direntrytype" in
9451 $define) guess1='struct dirent' ;;
9452 *) guess1='struct direct' ;;
9455 *) guess1="$direntrytype"
9460 'struct dirent') guess2='struct direct' ;;
9461 *) guess2='struct dirent' ;;
9464 if $contains "$guess1" try.c >/dev/null 2>&1; then
9465 direntrytype="$guess1"
9466 echo "Your directory entries are $direntrytype." >&4
9467 elif $contains "$guess2" try.c >/dev/null 2>&1; then
9468 direntrytype="$guess2"
9469 echo "Your directory entries seem to be $direntrytype." >&4
9471 echo "I don't recognize your system's directory entries." >&4
9472 rp="What type is used for directory entries on this system?"
9480 : see if the directory entry stores field length
9482 $cppstdin $cppflags $cppminus < "$xinc" > try.c
9483 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
9484 echo "Good, your directory entry keeps length information in d_namlen." >&4
9487 echo "Your directory entry does not know about the d_namlen field." >&4
9494 : see if dlerror exists
9497 set dlerror d_dlerror
9501 : see if dlfcn is available
9509 On a few systems, the dynamically loaded modules that perl generates and uses
9510 will need a different extension than shared libs. The default will probably
9518 rp='What is the extension of dynamically loaded modules'
9527 : Check if dlsym need a leading underscore
9533 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
9534 $cat >dyna.c <<'EOM'
9543 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
9545 #include <sys/types.h>
9559 int mode = RTLD_LAZY ;
9561 handle = dlopen("./dyna.$dlext", mode) ;
9562 if (handle == NULL) {
9567 symbol = dlsym(handle, "fred") ;
9568 if (symbol == NULL) {
9569 /* try putting a leading underscore */
9570 symbol = dlsym(handle, "_fred") ;
9571 if (symbol == NULL) {
9584 : Call the object file tmp-dyna.o in case dlext=o.
9585 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
9586 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
9587 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
9588 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
9591 1) echo "Test program failed using dlopen." >&4
9592 echo "Perhaps you should not use dynamic loading." >&4;;
9593 2) echo "Test program failed using dlsym." >&4
9594 echo "Perhaps you should not use dynamic loading." >&4;;
9595 3) echo "dlsym needs a leading underscore" >&4
9597 4) echo "dlsym doesn't need a leading underscore." >&4;;
9600 echo "I can't compile and run the test program." >&4
9601 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
9606 $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
9611 : see if prototype for drand48 is available
9613 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
9616 : see if dup2 exists
9620 : see if eaccess exists
9621 set eaccess d_eaccess
9624 : see if endgrent exists
9625 set endgrent d_endgrent
9628 : see if endhostent exists
9629 set endhostent d_endhent
9632 : see if endnetent exists
9633 set endnetent d_endnent
9636 : see if endprotoent exists
9637 set endprotoent d_endpent
9640 : see if endpwent exists
9641 set endpwent d_endpwent
9644 : see if endservent exists
9645 set endservent d_endsent
9648 : Locate the flags for 'open()'
9650 $cat >try.c <<'EOCP'
9651 #include <sys/types.h>
9656 #include <sys/file.h>
9667 : check sys/file.h first to get FREAD on Sun
9668 if $test `./findhdr sys/file.h` && \
9669 set try -DI_SYS_FILE && eval $compile; then
9671 echo "<sys/file.h> defines the O_* constants..." >&4
9673 echo "and you have the 3 argument form of open()." >&4
9676 echo "but not the 3 argument form of open(). Oh, well." >&4
9679 elif $test `./findhdr fcntl.h` && \
9680 set try -DI_FCNTL && eval $compile; then
9682 echo "<fcntl.h> defines the O_* constants..." >&4
9684 echo "and you have the 3 argument form of open()." >&4
9687 echo "but not the 3 argument form of open(). Oh, well." >&4
9692 echo "I can't find the O_* constant definitions! You got problems." >&4
9698 : see which of string.h or strings.h is needed
9700 strings=`./findhdr string.h`
9701 if $test "$strings" && $test -r "$strings"; then
9702 echo "Using <string.h> instead of <strings.h>." >&4
9706 strings=`./findhdr strings.h`
9707 if $test "$strings" && $test -r "$strings"; then
9708 echo "Using <strings.h> instead of <string.h>." >&4
9710 echo "No string header found -- You'll surely have problems." >&4
9716 "$undef") strings=`./findhdr strings.h`;;
9717 *) strings=`./findhdr string.h`;;
9720 : check for non-blocking I/O stuff
9721 case "$h_sysfile" in
9722 true) echo "#include <sys/file.h>" > head.c;;
9725 true) echo "#include <fcntl.h>" > head.c;;
9726 *) echo "#include <sys/fcntl.h>" > head.c;;
9731 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
9732 case "$o_nonblock" in
9735 $cat >>try.c <<'EOCP'
9740 printf("O_NONBLOCK\n");
9744 printf("O_NDELAY\n");
9748 printf("FNDELAY\n");
9755 if eval $compile_ok; then
9756 o_nonblock=`$run ./try`
9757 case "$o_nonblock" in
9758 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
9759 *) echo "Seems like we can use $o_nonblock.";;
9762 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
9765 *) echo "Using $hint value $o_nonblock.";;
9767 $rm -f try try.* .out core
9770 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
9776 #include <sys/types.h>
9780 #define MY_O_NONBLOCK $o_nonblock
9781 #ifndef errno /* XXX need better Configure test */
9792 #include <strings.h>
9794 $signal_t blech(x) int x; { exit(3); }
9796 $cat >> try.c <<'EOCP'
9804 pipe(pd); /* Down: child -> parent */
9805 pipe(pu); /* Up: parent -> child */
9808 close(pd[1]); /* Parent reads from pd[0] */
9809 close(pu[0]); /* Parent writes (blocking) to pu[1] */
9811 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
9816 signal(SIGALRM, blech);
9818 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
9820 sprintf(string, "%d\n", ret);
9821 write(2, string, strlen(string));
9824 if (errno == EAGAIN) {
9830 if (errno == EWOULDBLOCK)
9831 printf("EWOULDBLOCK\n");
9834 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
9835 sleep(2); /* Give it time to close our pipe */
9837 ret = read(pd[0], buf, 1); /* Should read EOF */
9839 sprintf(string, "%d\n", ret);
9840 write(3, string, strlen(string));
9844 close(pd[0]); /* We write to pd[1] */
9845 close(pu[1]); /* We read from pu[0] */
9846 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
9847 close(pd[1]); /* Pipe pd is now fully closed! */
9848 exit(0); /* Bye bye, thank you for playing! */
9852 if eval $compile_ok; then
9853 echo "$startsh" >mtry
9854 echo "$run ./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
9856 ./mtry >/dev/null 2>&1
9858 0) eagain=`$cat try.out`;;
9859 1) echo "Could not perform non-blocking setting!";;
9860 2) echo "I did a successful read() for something that was not there!";;
9861 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
9862 4) echo "Could not find F_SETFL!";;
9863 *) echo "Something terribly wrong happened during testing.";;
9865 rd_nodata=`$cat try.ret`
9866 echo "A read() system call with no data present returns $rd_nodata."
9867 case "$rd_nodata" in
9870 echo "(That's peculiar, fixing that to be -1.)"
9876 echo "Forcing errno EAGAIN on read() with no data available."
9880 echo "Your read() sets errno to $eagain when no data is available."
9883 status=`$cat try.err`
9885 0) echo "And it correctly returns 0 to signal EOF.";;
9886 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
9887 *) echo "However, your read() returns '$status' on EOF??";;
9890 if test "$status" = "$rd_nodata"; then
9891 echo "WARNING: you can't distinguish between EOF and no data!"
9895 echo "I can't compile the test program--assuming errno EAGAIN will do."
9902 echo "Using $hint value $eagain."
9903 echo "Your read() returns $rd_nodata when no data is present."
9904 case "$d_eofnblk" in
9905 "$define") echo "And you can see EOF because read() returns 0.";;
9906 "$undef") echo "But you can't see EOF status from read() returned value.";;
9908 echo "(Assuming you can't see EOF status from read anyway.)"
9914 $rm -f try try.* .out core head.c mtry
9916 : see if fchdir exists
9920 : see if fchmod exists
9924 : see if fchown exists
9928 : see if this is an fcntl system
9933 : See if fcntl-based locking works.
9939 $signal_t blech(x) int x; { exit(3); }
9941 #if defined(F_SETLK) && defined(F_SETLKW)
9944 fd = open("try.c", O_RDONLY);
9945 flock.l_type = F_RDLCK;
9946 flock.l_whence = SEEK_SET;
9947 flock.l_start = flock.l_len = 0;
9948 signal(SIGALRM, blech);
9950 retval = fcntl(fd, F_SETLK, &flock);
9952 (retval < 0 ? exit(2) : exit(0));
9958 echo "Checking if fcntl-based file locking works... "
9962 if eval $compile_ok; then
9964 echo "Yes, it seems to work."
9967 echo "Nope, it didn't work."
9972 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
9973 *** This is (almost) impossible.
9974 *** If your NFS lock daemons are not feeling well, something like
9975 *** this may happen, please investigate. Cannot continue, aborting.
9983 echo "I'm unable to compile the test program, so I'll assume not."
9988 echo "Nope, since you don't even have fcntl()."
9991 set d_fcntl_can_lock
9996 : see if sys/select.h has to be included
9997 set sys/select.h i_sysselct
10000 : see if we should include time.h, sys/time.h, or both
10002 if test "X$timeincl" = X; then
10003 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10004 $echo $n "I'm now running the test program...$c"
10005 $cat >try.c <<'EOCP'
10006 #include <sys/types.h>
10011 #ifdef SYSTIMEKERNEL
10014 #include <sys/time.h>
10017 #include <sys/select.h>
10023 struct timeval bar;
10026 struct timezone tzp;
10028 if (foo.tm_sec == foo.tm_sec)
10031 if (bar.tv_sec == bar.tv_sec)
10038 for s_timezone in '-DS_TIMEZONE' ''; do
10040 for s_timeval in '-DS_TIMEVAL' ''; do
10041 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10042 for i_time in '' '-DI_TIME'; do
10043 for i_systime in '-DI_SYSTIME' ''; do
10046 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10047 if eval $compile; then
10048 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10052 $echo $n "Succeeded with $flags$c"
10064 *SYSTIMEKERNEL*) i_systimek="$define"
10065 timeincl=`./findhdr sys/time.h`
10066 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10067 *) i_systimek="$undef";;
10070 *I_TIME*) i_time="$define"
10071 timeincl=`./findhdr time.h`" $timeincl"
10072 echo "We'll include <time.h>." >&4;;
10073 *) i_time="$undef";;
10076 *I_SYSTIME*) i_systime="$define"
10077 timeincl=`./findhdr sys/time.h`" $timeincl"
10078 echo "We'll include <sys/time.h>." >&4;;
10079 *) i_systime="$undef";;
10084 : check for fd_set items
10087 Checking to see how well your C compiler handles fd_set and friends ...
10090 #$i_systime I_SYS_TIME
10091 #$i_sysselct I_SYS_SELECT
10092 #$d_socket HAS_SOCKET
10093 #include <sys/types.h>
10095 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
10098 #include <sys/time.h>
10100 #ifdef I_SYS_SELECT
10101 #include <sys/select.h>
10110 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
10118 if eval $compile; then
10119 d_fds_bits="$define"
10121 echo "Well, your system knows about the normal fd_set typedef..." >&4
10122 if $run ./try; then
10123 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
10124 d_fd_macros="$define"
10127 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
10129 d_fd_macros="$undef"
10133 Hmm, your compiler has some difficulty with fd_set. Checking further...
10136 if eval $compile; then
10137 d_fds_bits="$undef"
10139 echo "Well, your system has some sort of fd_set available..." >&4
10140 if $run ./try; then
10141 echo "and you have the normal fd_set macros." >&4
10142 d_fd_macros="$define"
10145 but not the normal fd_set macros! Gross! More work for me...
10147 d_fd_macros="$undef"
10150 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
10152 d_fds_bits="$undef"
10153 d_fd_macros="$undef"
10158 : see if fgetpos exists
10159 set fgetpos d_fgetpos
10162 : see if finite exists
10163 set finite d_finite
10166 : see if finitel exists
10167 set finitel d_finitel
10170 : see if flock exists
10174 : see if this is a sys/file.h system
10179 : do we need to include sys/file.h ?
10183 if $h_sysfile; then
10185 echo "We'll be including <sys/file.h>." >&4
10188 echo "We won't be including <sys/file.h>." >&4
10198 : see if prototype for flock is available
10200 set d_flockproto flock $i_sysfile sys/file.h
10203 : see if fork exists
10207 : see if fp_class exists
10208 set fp_class d_fp_class
10211 : see if pathconf exists
10212 set pathconf d_pathconf
10215 : see if fpathconf exists
10216 set fpathconf d_fpathconf
10219 : see if fpclass exists
10220 set fpclass d_fpclass
10223 : see if fpclassify exists
10224 set fpclassify d_fpclassify
10227 : see if fpclassl exists
10228 set fpclassl d_fpclassl
10232 : check for fpos64_t
10234 echo "Checking to see if you have fpos64_t..." >&4
10237 int main() { fpos64_t x = 7; }
10240 if eval $compile; then
10242 echo "You have fpos64_t."
10245 echo "You do not have fpos64_t."
10246 case "$fpossize" in
10247 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
10254 : see if frexpl exists
10255 set frexpl d_frexpl
10258 : see if this is a sys/param system
10259 set sys/param.h i_sysparam
10262 : see if this is a sys/mount.h system
10263 set sys/mount.h i_sysmount
10268 echo "Checking to see if your system supports struct fs_data..." >&4
10269 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
10271 case "$d_fs_data_s" in
10272 "$define") echo "Yes, it does." ;;
10273 *) echo "No, it doesn't." ;;
10276 : see if fseeko exists
10277 set fseeko d_fseeko
10279 case "$longsize" in
10280 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
10283 : see if fsetpos exists
10284 set fsetpos d_fsetpos
10288 : see if fstatfs exists
10289 set fstatfs d_fstatfs
10293 : see if statvfs exists
10294 set statvfs d_statvfs
10297 : see if fstatvfs exists
10298 set fstatvfs d_fstatvfs
10302 : see if fsync exists
10306 : see if ftello exists
10307 set ftello d_ftello
10309 case "$longsize" in
10310 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
10313 : see if getcwd exists
10314 set getcwd d_getcwd
10317 : see if getespwnam exists
10318 set getespwnam d_getespwnam
10322 : see if getfsstat exists
10323 set getfsstat d_getfsstat
10326 : see if getgrent exists
10327 set getgrent d_getgrent
10330 : see if gethostbyaddr exists
10331 set gethostbyaddr d_gethbyaddr
10334 : see if gethostbyname exists
10335 set gethostbyname d_gethbyname
10338 : see if gethostent exists
10339 set gethostent d_gethent
10342 : see how we will look up host name
10345 if set gethostname val -f d_gethname; eval $csym; $val; then
10346 echo 'gethostname() found.' >&4
10347 d_gethname="$define"
10350 if set uname val -f d_uname; eval $csym; $val; then
10353 uname() was found, but you're running xenix, and older versions of xenix
10354 have a broken uname(). If you don't really know whether your xenix is old
10355 enough to have a broken system call, use the default answer.
10360 "$define") dflt=n;;
10362 rp='Is your uname() broken?'
10365 n*) d_uname="$define"; call=uname;;
10368 echo 'uname() found.' >&4
10375 case "$d_gethname" in
10376 '') d_gethname="$undef";;
10379 '') d_uname="$undef";;
10381 case "$d_uname$d_gethname" in
10386 Every now and then someone has a $call() that lies about the hostname
10387 but can't be fixed for political or economic reasons. If you wish, I can
10388 pretend $call() isn't there and maybe compute hostname at run-time
10389 thanks to the '$phostname' command.
10392 rp="Shall I ignore $call() from now on?"
10395 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
10398 case "$phostname" in
10399 '') aphostname='';;
10400 *) case "$aphostname" in
10402 *) set X $phostname
10406 file=`./loc $file $file $pth`
10407 aphostname=`echo $file $*`
10412 case "$d_uname$d_gethname" in
10415 case "$phostname" in
10417 echo "There will be no way for $package to get your hostname." >&4;;
10419 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
10423 case "$d_phostname" in
10424 '') d_phostname="$undef";;
10427 : see if this is a netdb.h system
10428 set netdb.h i_netdb
10431 : see if prototypes for various gethostxxx netdb.h functions are available
10433 set d_gethostprotos gethostent $i_netdb netdb.h
10436 : see if getitimer exists
10437 set getitimer d_getitimer
10440 : see if getlogin exists
10441 set getlogin d_getlogin
10444 : see if getmnt exists
10445 set getmnt d_getmnt
10448 : see if getmntent exists
10449 set getmntent d_getmntent
10452 : see if getnetbyaddr exists
10453 set getnetbyaddr d_getnbyaddr
10456 : see if getnetbyname exists
10457 set getnetbyname d_getnbyname
10460 : see if getnetent exists
10461 set getnetent d_getnent
10464 : see if prototypes for various getnetxxx netdb.h functions are available
10466 set d_getnetprotos getnetent $i_netdb netdb.h
10469 : see if getpagesize exists
10470 set getpagesize d_getpagsz
10474 : see if getprotobyname exists
10475 set getprotobyname d_getpbyname
10478 : see if getprotobynumber exists
10479 set getprotobynumber d_getpbynumber
10482 : see if getprotoent exists
10483 set getprotoent d_getpent
10486 : see if getpgid exists
10487 set getpgid d_getpgid
10490 : see if getpgrp2 exists
10491 set getpgrp2 d_getpgrp2
10494 : see if getppid exists
10495 set getppid d_getppid
10498 : see if getpriority exists
10499 set getpriority d_getprior
10502 : see if prototypes for various getprotoxxx netdb.h functions are available
10504 set d_getprotoprotos getprotoent $i_netdb netdb.h
10507 : see if getprpwnam exists
10508 set getprpwnam d_getprpwnam
10511 : see if getpwent exists
10512 set getpwent d_getpwent
10516 : see if getservbyname exists
10517 set getservbyname d_getsbyname
10520 : see if getservbyport exists
10521 set getservbyport d_getsbyport
10524 : see if getservent exists
10525 set getservent d_getsent
10528 : see if prototypes for various getservxxx netdb.h functions are available
10530 set d_getservprotos getservent $i_netdb netdb.h
10533 : see if getspnam exists
10534 set getspnam d_getspnam
10537 : see if gettimeofday or ftime exists
10538 set gettimeofday d_gettimeod
10540 case "$d_gettimeod" in
10546 val="$undef"; set d_ftime; eval $setvar
10549 case "$d_gettimeod$d_ftime" in
10552 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
10556 : see if this is an grp system
10562 xxx=`./findhdr grp.h`
10563 $cppstdin $cppflags $cppminus < $xxx >$$.h
10565 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
10577 set d_grpasswd; eval $setvar
10581 : see if hasmntopt exists
10582 set hasmntopt d_hasmntopt
10585 : see if this is a netinet/in.h or sys/in.h system
10586 set netinet/in.h i_niin sys/in.h i_sysin
10589 : see if arpa/inet.h has to be included
10590 set arpa/inet.h i_arpainet
10593 : see if htonl --and friends-- exists
10598 : Maybe they are macros.
10601 $cat >htonl.c <<EOM
10603 #include <sys/types.h>
10604 #$i_niin I_NETINET_IN
10606 #$i_arpainet I_ARPA_INET
10607 #ifdef I_NETINET_IN
10608 #include <netinet/in.h>
10611 #include <sys/in.h>
10614 #include <arpa/inet.h>
10617 printf("Defined as a macro.");
10620 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
10621 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
10623 echo "But it seems to be defined as a macro." >&4
10631 : see if iconv exists
10637 if set index val -f; eval $csym; $val; then
10638 if set strchr val -f d_strchr; eval $csym; $val; then
10639 if $contains strchr "$strings" >/dev/null 2>&1 ; then
10642 echo "strchr() found." >&4
10646 echo "index() found." >&4
10651 echo "index() found." >&4
10654 if set strchr val -f d_strchr; eval $csym; $val; then
10657 echo "strchr() found." >&4
10659 echo "No index() or strchr() found!" >&4
10664 set d_strchr; eval $setvar
10666 set d_index; eval $setvar
10668 : check whether inet_aton exists
10669 set inet_aton d_inetaton
10674 $cat >isascii.c <<'EOCP'
10686 if eval $compile; then
10687 echo "isascii() found." >&4
10690 echo "isascii() NOT found." >&4
10697 : see if isfinite exists
10698 set isfinite d_isfinite
10701 : see if isinf exists
10705 : see if isnan exists
10709 : see if isnanl exists
10710 set isnanl d_isnanl
10713 : see if killpg exists
10714 set killpg d_killpg
10717 : see if lchown exists
10719 $cat > try.c <<'EOCP'
10720 /* System header to define __stub macros and hopefully few prototypes,
10721 which can conflict with char lchown(); below. */
10722 #include <assert.h>
10723 /* Override any gcc2 internal prototype to avoid an error. */
10724 /* We use char because int might match the return type of a gcc2
10725 builtin and then its argument prototype would still apply. */
10728 /* The GNU C library defines this for functions which it implements
10729 to always fail with ENOSYS. Some functions are actually named
10730 something starting with __ and the normal name is an alias. */
10731 #if defined (__stub_lchown) || defined (__stub___lchown)
10739 if eval $compile; then
10740 $echo "lchown() found." >&4
10743 $echo "lchown() NOT found." >&4
10749 : See if number of significant digits in a double precision number is known
10751 $cat >ldbl_dig.c <<EOM
10752 #$i_limits I_LIMITS
10755 #include <limits.h>
10761 printf("Contains LDBL_DIG");
10764 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
10765 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
10766 echo "LDBL_DIG found." >&4
10769 echo "LDBL_DIG NOT found." >&4
10776 : see if link exists
10780 : see if localeconv exists
10781 set localeconv d_locconv
10784 : see if lockf exists
10788 : see if prototype for lseek is available
10790 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
10793 : see if lstat exists
10797 : see if madvise exists
10798 set madvise d_madvise
10801 : see if mblen exists
10805 : see if mbstowcs exists
10806 set mbstowcs d_mbstowcs
10809 : see if mbtowc exists
10810 set mbtowc d_mbtowc
10813 : see if memchr exists
10814 set memchr d_memchr
10817 : see if memcmp exists
10818 set memcmp d_memcmp
10821 : see if memcpy exists
10822 set memcpy d_memcpy
10825 : see if memmove exists
10826 set memmove d_memmove
10829 : see if memset exists
10830 set memset d_memset
10833 : see if mkdir exists
10837 : see if mkdtemp exists
10838 set mkdtemp d_mkdtemp
10841 : see if mkfifo exists
10842 set mkfifo d_mkfifo
10845 : see if mkstemp exists
10846 set mkstemp d_mkstemp
10849 : see if mkstemps exists
10850 set mkstemps d_mkstemps
10853 : see if mktime exists
10854 set mktime d_mktime
10857 : see if this is a sys/mman.h system
10858 set sys/mman.h i_sysmman
10861 : see if mmap exists
10864 : see what shmat returns
10865 : default to something harmless
10867 case "$i_sysmman$d_mmap" in
10869 $cat >mmap.c <<'END'
10870 #include <sys/mman.h>
10873 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
10878 echo "and it returns ($mmaptype)." >&4
10884 : see if modfl exists
10888 d_modfl_pow32_bug="$undef"
10890 case "$d_longdbl$d_modfl" in
10893 Checking to see whether your modfl() is okay for large values...
10899 long double nv = 4294967303.15;
10905 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
10909 case "$osname:$gccversion" in
10910 aix:) saveccflags="$ccflags"
10911 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
10914 if eval $compile; then
10917 *" 4294967303.150000 1.150000 4294967302.000000")
10918 echo >&4 "Your modfl() is broken for large values."
10919 d_modfl_pow32_bug="$define"
10921 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
10925 *" 4294967303.150000 0.150000 4294967303.000000")
10926 echo >&4 "Your modfl() seems okay for large values."
10928 *) echo >&4 "I don't understand your modfl() at all."
10932 $rm -f try.* try core core.try.*
10934 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
10937 case "$osname:$gccversion" in
10938 aix:) ccflags="$saveccflags" ;; # restore
10943 : see if mprotect exists
10944 set mprotect d_mprotect
10947 : see if msgctl exists
10948 set msgctl d_msgctl
10951 : see if msgget exists
10952 set msgget d_msgget
10955 : see if msgsnd exists
10956 set msgsnd d_msgsnd
10959 : see if msgrcv exists
10960 set msgrcv d_msgrcv
10963 : see how much of the 'msg*(2)' library is present.
10966 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
10967 *"$undef"*) h_msg=false;;
10971 case "`ipcs 2>&1`" in
10972 "SVID messages"*"not configured"*)
10973 echo "Your $osname does not have the msg*(2) configured." >&4
10976 set msgctl d_msgctl
10978 set msgget d_msgget
10980 set msgsnd d_msgsnd
10982 set msgrcv d_msgrcv
10988 : we could also check for sys/ipc.h ...
10989 if $h_msg && $test `./findhdr sys/msg.h`; then
10990 echo "You have the full msg*(2) library." >&4
10993 echo "You don't have the full msg*(2) library." >&4
11001 echo "Checking to see if your system supports struct msghdr..." >&4
11002 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
11004 case "$d_msghdr_s" in
11005 "$define") echo "Yes, it does." ;;
11006 *) echo "No, it doesn't." ;;
11010 : see if msync exists
11014 : see if munmap exists
11015 set munmap d_munmap
11018 : see if nice exists
11022 : see if this is a langinfo.h system
11023 set langinfo.h i_langinfo
11026 : see if nl_langinfo exists
11027 set nl_langinfo d_nl_langinfo
11030 : check for length of character
11032 case "$charsize" in
11034 echo "Checking to see how big your characters are (hey, you never know)..." >&4
11035 $cat >try.c <<'EOCP'
11039 printf("%d\n", (int)sizeof(char));
11044 if eval $compile_ok; then
11048 echo "(I can't seem to compile the test program. Guessing...)"
11055 rp="What is the size of a character (in bytes)?"
11060 : check for volatile keyword
11062 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
11063 $cat >try.c <<'EOCP'
11066 typedef struct _goo_struct goo_struct;
11067 goo_struct * volatile goo = ((goo_struct *)0);
11068 struct _goo_struct {
11073 typedef unsigned short foo_t;
11074 char *volatile foo;
11076 volatile foo_t blech;
11080 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
11082 echo "Yup, it does."
11085 echo "Nope, it doesn't."
11093 $echo "Choosing the C types to be used for Perl's internal types..." >&4
11095 case "$use64bitint:$d_quad:$quadtype" in
11098 uvtype="$uquadtype"
11103 uvtype="unsigned long"
11109 case "$uselongdouble:$d_longdbl" in
11111 nvtype="long double"
11112 nvsize=$longdblsize
11119 $echo "(IV will be "$ivtype", $ivsize bytes)"
11120 $echo "(UV will be "$uvtype", $uvsize bytes)"
11121 $echo "(NV will be "$nvtype", $nvsize bytes)"
11124 #$i_inttypes I_INTTYPES
11126 #include <inttypes.h>
11131 int8_t i = INT8_MAX;
11132 uint8_t u = UINT8_MAX;
11133 printf("int8_t\n");
11136 int16_t i = INT16_MAX;
11137 uint16_t i = UINT16_MAX;
11138 printf("int16_t\n");
11141 int32_t i = INT32_MAX;
11142 uint32_t u = UINT32_MAX;
11143 printf("int32_t\n");
11149 '') case "$charsize" in
11151 u8type="unsigned char"
11160 if eval $compile; then
11161 case "`$run ./try`" in
11162 int8_t) i8type=int8_t
11172 '') if $test $charsize -ge 1; then
11174 u8type="unsigned char"
11182 '') case "$shortsize" in
11184 u16type="unsigned short"
11192 '') set try -DINT16
11193 if eval $compile; then
11194 case "`$run ./try`" in
11206 '') if $test $shortsize -ge 2; then
11208 u16type="unsigned short"
11216 '') case "$longsize" in
11218 u32type="unsigned long"
11222 *) case "$intsize" in
11224 u32type="unsigned int"
11234 '') set try -DINT32
11235 if eval $compile; then
11236 case "`$run ./try`" in
11248 '') if $test $intsize -ge 4; then
11250 u32type="unsigned int"
11258 '') case "$d_quad:$quadtype" in
11260 i64type="$quadtype"
11261 u64type="$uquadtype"
11269 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
11270 : volatile so that the compiler has to store it out to memory.
11271 if test X"$d_volatile" = X"$define"; then
11276 #include <sys/types.h>
11277 #include <signal.h>
11279 $volatile int bletched = 0;
11280 $signal_t blech(s) int s; { bletched = 1; }
11285 int n = 8 * $uvsize;
11288 signal(SIGFPE, blech);
11291 for (i = 0; i < n; i++) {
11292 u = u << 1 | ($uvtype)1;
11294 if (($uvtype)d != u)
11298 d = ($nvtype)(u - 1);
11299 if (($uvtype)d != (u - 1))
11307 printf("%d\n", ((i == n) ? -n : i));
11313 d_nv_preserves_uv="$undef"
11314 if eval $compile; then
11315 d_nv_preserves_uv_bits="`$run ./try`"
11317 case "$d_nv_preserves_uv_bits" in
11319 d_nv_preserves_uv_bits=`expr 0 - $d_nv_preserves_uv_bits`
11320 $echo "Your NVs can preserve all $d_nv_preserves_uv_bits bits of your UVs." 2>&1
11321 d_nv_preserves_uv="$define"
11323 [1-9]*) $echo "Your NVs can preserve only $d_nv_preserves_uv_bits bits of your UVs." 2>&1
11324 d_nv_preserves_uv="$undef" ;;
11325 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
11326 d_nv_preserves_uv_bits="$undef" ;;
11332 : check for off64_t
11334 echo "Checking to see if you have off64_t..." >&4
11336 #include <sys/types.h>
11337 #include <unistd.h>
11338 int main() { off64_t x = 7; }
11341 if eval $compile; then
11343 echo "You have off64_t."
11346 echo "You do not have off64_t."
11347 case "$lseeksize" in
11348 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
11355 : see if POSIX threads are available
11356 set pthread.h i_pthread
11362 : how to create joinable pthreads
11363 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
11365 echo "Checking what constant to use for creating joinable pthreads..." >&4
11366 $cat >try.c <<'EOCP'
11367 #include <pthread.h>
11369 int detachstate = JOINABLE;
11372 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
11373 if eval $compile; then
11374 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
11375 val="$undef" # Yes, undef.
11376 set d_old_pthread_create_joinable
11379 set old_pthread_create_joinable
11382 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
11383 if eval $compile; then
11384 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
11386 set d_old_pthread_create_joinable
11388 val=PTHREAD_CREATE_UNDETACHED
11389 set old_pthread_create_joinable
11392 set try -DJOINABLE=__UNDETACHED
11393 if eval $compile; then
11394 echo "You seem to use __UNDETACHED." >&4
11396 set d_old_pthread_create_joinable
11399 set old_pthread_create_joinable
11402 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
11404 set d_old_pthread_create_joinable
11407 set old_pthread_create_joinable
11414 d_old_pthread_create_joinable="$undef"
11415 old_pthread_create_joinable=""
11418 : see if pause exists
11422 : see if pipe exists
11426 : see if poll exists
11430 : see if pthread_atfork exists
11431 set pthread_atfork d_pthread_atfork
11435 : see whether the various POSIXish _yields exist
11437 #include <pthread.h>
11443 #ifdef PTHREAD_YIELD
11446 #ifdef PTHREAD_YIELD_NULL
11447 pthread_yield(NULL);
11453 : see if sched_yield exists
11454 set try -DSCHED_YIELD
11455 if eval $compile; then
11457 sched_yield='sched_yield()'
11461 case "$usethreads" in
11464 $define) echo 'sched_yield() found.' >&4 ;;
11465 *) echo 'sched_yield() NOT found.' >&4 ;;
11471 : see if pthread_yield exists
11472 set try -DPTHREAD_YIELD
11473 if eval $compile; then
11475 case "$sched_yield" in
11476 '') sched_yield='pthread_yield()' ;;
11479 set try -DPTHREAD_YIELD_NULL
11480 if eval $compile; then
11482 case "$sched_yield" in
11483 '') sched_yield='pthread_yield(NULL)' ;;
11489 case "$usethreads" in
11492 $define) echo 'pthread_yield() found.' >&4 ;;
11493 *) echo 'pthread_yield() NOT found.' >&4 ;;
11497 set d_pthread_yield
11500 case "$sched_yield" in
11501 '') sched_yield=undef ;;
11506 : see if this is a pwd.h system
11512 xxx=`./findhdr pwd.h`
11513 $cppstdin $cppflags $cppminus < $xxx >$$.h
11515 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
11523 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
11531 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
11539 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
11547 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
11555 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
11563 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
11571 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
11583 set d_pwquota; eval $setvar
11584 set d_pwage; eval $setvar
11585 set d_pwchange; eval $setvar
11586 set d_pwclass; eval $setvar
11587 set d_pwexpire; eval $setvar
11588 set d_pwcomment; eval $setvar
11589 set d_pwgecos; eval $setvar
11590 set d_pwpasswd; eval $setvar
11594 : see if readdir and friends exist
11595 set readdir d_readdir
11597 set seekdir d_seekdir
11599 set telldir d_telldir
11601 set rewinddir d_rewinddir
11604 : see if readlink exists
11605 set readlink d_readlink
11608 : see if readv exists
11612 : see if recvmsg exists
11613 set recvmsg d_recvmsg
11616 : see if rename exists
11617 set rename d_rename
11620 : see if rmdir exists
11624 : see if memory.h is available.
11629 : See if it conflicts with string.h
11635 $cppstdin $cppflags $cppminus < $strings > mem.h
11636 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
11638 echo "We won't be including <memory.h>."
11648 : can bcopy handle overlapping blocks?
11651 case "$d_memmove" in
11652 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
11653 *) case "$d_bcopy" in
11655 echo "Checking to see if bcopy() can do overlapping copies..." >&4
11657 #$i_memory I_MEMORY
11658 #$i_stdlib I_STDLIB
11659 #$i_string I_STRING
11660 #$i_unistd I_UNISTD
11662 $cat >>try.c <<'EOCP'
11665 # include <memory.h>
11668 # include <stdlib.h>
11671 # include <string.h>
11673 # include <strings.h>
11676 # include <unistd.h> /* Needed for NetBSD */
11680 char buf[128], abc[128];
11686 /* Copy "abcde..." string to char abc[] so that gcc doesn't
11687 try to store the string in read-only memory. */
11688 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
11690 for (align = 7; align >= 0; align--) {
11691 for (len = 36; len; len--) {
11693 bcopy(abc, b, len);
11694 for (off = 1; off <= len; off++) {
11695 bcopy(b, b+off, len);
11696 bcopy(b+off, b, len);
11697 if (bcmp(b, abc, len))
11706 if eval $compile_ok; then
11707 if ./try 2>/dev/null; then
11708 echo "Yes, it can."
11711 echo "It can't, sorry."
11714 echo "(I can't compile the test program, so we'll assume not...)"
11718 $rm -f try.* try core
11724 : can memcpy handle overlapping blocks?
11727 case "$d_memmove" in
11728 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
11729 *) case "$d_memcpy" in
11731 echo "Checking to see if memcpy() can do overlapping copies..." >&4
11733 #$i_memory I_MEMORY
11734 #$i_stdlib I_STDLIB
11735 #$i_string I_STRING
11736 #$i_unistd I_UNISTD
11738 $cat >>try.c <<'EOCP'
11741 # include <memory.h>
11744 # include <stdlib.h>
11747 # include <string.h>
11749 # include <strings.h>
11752 # include <unistd.h> /* Needed for NetBSD */
11756 char buf[128], abc[128];
11762 /* Copy "abcde..." string to char abc[] so that gcc doesn't
11763 try to store the string in read-only memory. */
11764 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
11766 for (align = 7; align >= 0; align--) {
11767 for (len = 36; len; len--) {
11769 memcpy(b, abc, len);
11770 for (off = 1; off <= len; off++) {
11771 memcpy(b+off, b, len);
11772 memcpy(b, b+off, len);
11773 if (memcmp(b, abc, len))
11782 if eval $compile_ok; then
11783 if ./try 2>/dev/null; then
11784 echo "Yes, it can."
11787 echo "It can't, sorry."
11790 echo "(I can't compile the test program, so we'll assume not...)"
11794 $rm -f try.* try core
11800 : can memcmp be trusted to compare relative magnitude?
11802 case "$d_memcmp" in
11805 echo "Checking if your memcmp() can compare relative magnitude..." >&4
11807 #$i_memory I_MEMORY
11808 #$i_stdlib I_STDLIB
11809 #$i_string I_STRING
11810 #$i_unistd I_UNISTD
11812 $cat >>try.c <<'EOCP'
11815 # include <memory.h>
11818 # include <stdlib.h>
11821 # include <string.h>
11823 # include <strings.h>
11826 # include <unistd.h> /* Needed for NetBSD */
11832 if ((a < b) && memcmp(&a, &b, 1) < 0)
11838 if eval $compile_ok; then
11839 if $run ./try 2>/dev/null; then
11840 echo "Yes, it can."
11843 echo "No, it can't (it uses signed chars)."
11846 echo "(I can't compile the test program, so we'll assume not...)"
11850 $rm -f try.* try core
11854 : see if prototype for sbrk is available
11856 set d_sbrkproto sbrk $i_unistd unistd.h
11859 : see if select exists
11860 set select d_select
11863 : see if semctl exists
11864 set semctl d_semctl
11867 : see if semget exists
11868 set semget d_semget
11871 : see if semop exists
11875 : see how much of the 'sem*(2)' library is present.
11878 case "$d_semctl$d_semget$d_semop" in
11879 *"$undef"*) h_sem=false;;
11883 case "`ipcs 2>&1`" in
11884 "SVID messages"*"not configured"*)
11885 echo "Your $osname does not have the sem*(2) configured." >&4
11888 set semctl d_semctl
11890 set semget d_semget
11898 : we could also check for sys/ipc.h ...
11899 if $h_sem && $test `./findhdr sys/sem.h`; then
11900 echo "You have the full sem*(2) library." >&4
11903 echo "You don't have the full sem*(2) library." >&4
11909 : see whether sys/sem.h defines union semun
11911 $cat > try.c <<'END'
11912 #include <sys/types.h>
11913 #include <sys/ipc.h>
11914 #include <sys/sem.h>
11915 int main () { union semun semun; semun.buf = 0; }
11918 if eval $compile; then
11919 echo "You have union semun in <sys/sem.h>." >&4
11922 echo "You do not have union semun in <sys/sem.h>." >&4
11925 $rm -f try try.c try.h
11929 : see how to do semctl IPC_STAT
11932 : see whether semctl IPC_STAT can use union semun
11937 # define S_IRUSR S_IREAD
11938 # define S_IWUSR S_IWRITE
11939 # define S_IXUSR S_IEXEC
11941 # define S_IRUSR 0400
11942 # define S_IWUSR 0200
11943 # define S_IXUSR 0100
11945 # define S_IRGRP (S_IRUSR>>3)
11946 # define S_IWGRP (S_IWUSR>>3)
11947 # define S_IXGRP (S_IXUSR>>3)
11948 # define S_IROTH (S_IRUSR>>6)
11949 # define S_IWOTH (S_IWUSR>>6)
11950 # define S_IXOTH (S_IXUSR>>6)
11953 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
11954 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
11955 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
11960 #include <sys/types.h>
11961 #include <sys/ipc.h>
11962 #include <sys/sem.h>
11963 #include <sys/stat.h>
11970 #$d_union_semun HAS_UNION_SEMUN
11973 #ifndef HAS_UNION_SEMUN
11976 struct semid_ds *buf;
11977 unsigned short *array;
11983 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
11984 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
11986 struct semid_ds argbuf;
11989 st = semctl(sem, 0, IPC_STAT, arg);
11993 # endif /* IPC_STAT */
11994 printf("semctl IPC_STAT failed: errno = %d\n", errno);
11996 if (semctl(sem, 0, IPC_RMID, arg) != 0)
11997 # endif /* IPC_RMID */
11998 printf("semctl IPC_RMID failed: errno = %d\n", errno);
12000 #endif /* IPC_PRIVATE && ... */
12001 printf("semget failed: errno = %d\n", errno);
12007 if eval $compile; then
12010 semun) val="$define" ;;
12016 case "$d_semctl_semun" in
12018 echo "You can use union semun for semctl IPC_STAT." >&4
12021 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
12026 : see whether semctl IPC_STAT can use struct semid_ds pointer
12027 $cat > try.c <<'END'
12028 #include <sys/types.h>
12029 #include <sys/ipc.h>
12030 #include <sys/sem.h>
12031 #include <sys/stat.h>
12039 struct semid_ds arg;
12042 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
12043 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
12046 st = semctl(sem, 0, IPC_STAT, &arg);
12048 printf("semid_ds\n");
12050 # endif /* IPC_STAT */
12051 printf("semctl IPC_STAT failed: errno = %d\n", errno);
12053 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
12054 # endif /* IPC_RMID */
12055 printf("semctl IPC_RMID failed: errno = %d\n", errno);
12057 #endif /* IPC_PRIVATE && ... */
12058 printf("semget failed: errno = %d\n", errno);
12065 if eval $compile; then
12068 semid_ds) val="$define" ;;
12072 set d_semctl_semid_ds
12074 case "$d_semctl_semid_ds" in
12076 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
12078 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
12085 # We do not have the full sem*(2) library, so assume we can not
12091 set d_semctl_semid_ds
12096 : see if sendmsg exists
12097 set sendmsg d_sendmsg
12100 : see if setegid exists
12101 set setegid d_setegid
12104 : see if seteuid exists
12105 set seteuid d_seteuid
12108 : see if setgrent exists
12109 set setgrent d_setgrent
12112 : see if sethostent exists
12113 set sethostent d_sethent
12116 : see if setitimer exists
12117 set setitimer d_setitimer
12120 : see if setlinebuf exists
12121 set setlinebuf d_setlinebuf
12124 : see if setlocale exists
12125 set setlocale d_setlocale
12128 : see if setnetent exists
12129 set setnetent d_setnent
12132 : see if setprotoent exists
12133 set setprotoent d_setpent
12136 : see if setpgid exists
12137 set setpgid d_setpgid
12140 : see if setpgrp2 exists
12141 set setpgrp2 d_setpgrp2
12144 : see if setpriority exists
12145 set setpriority d_setprior
12148 : see if setproctitle exists
12149 set setproctitle d_setproctitle
12152 : see if setpwent exists
12153 set setpwent d_setpwent
12156 : see if setregid exists
12157 set setregid d_setregid
12159 set setresgid d_setresgid
12162 : see if setreuid exists
12163 set setreuid d_setreuid
12165 set setresuid d_setresuid
12168 : see if setrgid exists
12169 set setrgid d_setrgid
12172 : see if setruid exists
12173 set setruid d_setruid
12176 : see if setservent exists
12177 set setservent d_setsent
12180 : see if setsid exists
12181 set setsid d_setsid
12184 : see if setvbuf exists
12185 set setvbuf d_setvbuf
12188 : see if sfio.h is available
12193 : see if sfio library is available
12204 : Ok, but do we want to use it.
12208 true|$define|[yY]*) dflt='y';;
12211 echo "$package can use the sfio library, but it is experimental."
12212 case "$useperlio" in
12214 echo "For sfio also the PerlIO abstraction layer is needed."
12215 echo "Earlier you said you wouldn't want that."
12218 rp="You seem to have sfio available, do you want to try using it?"
12221 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
12222 useperlio="$define"
12225 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
12230 *) case "$usesfio" in
12231 true|$define|[yY]*)
12232 echo "Sorry, cannot find sfio on this machine." >&4
12233 echo "Ignoring your setting of usesfio=$usesfio." >&4
12242 $define) usesfio='true';;
12243 *) usesfio='false';;
12247 *) : Remove sfio from list of libraries to use
12250 echo "Removing unneeded -lsfio from library list" >&4
12251 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
12254 echo "libs = $libs" >&4
12261 : see if shmctl exists
12262 set shmctl d_shmctl
12265 : see if shmget exists
12266 set shmget d_shmget
12269 : see if shmat exists
12272 : see what shmat returns
12275 $cat >shmat.c <<'END'
12276 #include <sys/shm.h>
12279 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
12284 echo "and it returns ($shmattype)." >&4
12285 : see if a prototype for shmat is available
12286 xxx=`./findhdr sys/shm.h`
12287 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
12288 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
12299 set d_shmatprototype
12302 : see if shmdt exists
12306 : see how much of the 'shm*(2)' library is present.
12309 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
12310 *"$undef"*) h_shm=false;;
12314 case "`ipcs 2>&1`" in
12315 "SVID shared memory"*"not configured"*)
12316 echo "Your $osname does not have the shm*(2) configured." >&4
12319 set shmctl d_shmctl
12321 set shmget d_shmget
12331 : we could also check for sys/ipc.h ...
12332 if $h_shm && $test `./findhdr sys/shm.h`; then
12333 echo "You have the full shm*(2) library." >&4
12336 echo "You don't have the full shm*(2) library." >&4
12343 : see if we have sigaction
12344 if set sigaction val -f d_sigaction; eval $csym; $val; then
12345 echo 'sigaction() found.' >&4
12346 $cat > try.c <<'EOP'
12348 #include <sys/types.h>
12349 #include <signal.h>
12352 struct sigaction act, oact;
12354 oact.sa_handler = 0;
12355 /* so that act and oact are used */
12356 exit(act.sa_flags == 0 && oact.sa_handler == 0);
12360 if eval $compile_ok; then
12363 echo "But you don't seem to have a useable struct sigaction." >&4
12367 echo 'sigaction NOT found.' >&4
12370 set d_sigaction; eval $setvar
12371 $rm -f try try$_o try.c
12373 : see if sigprocmask exists
12374 set sigprocmask d_sigprocmask
12377 : see if sigsetjmp exists
12379 case "$d_sigsetjmp" in
12381 $cat >try.c <<'EOP'
12382 #include <setjmp.h>
12387 if (sigsetjmp(env,1))
12390 siglongjmp(env, 1);
12395 if eval $compile; then
12396 if $run ./try >/dev/null 2>&1; then
12397 echo "POSIX sigsetjmp found." >&4
12401 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
12407 echo "sigsetjmp not found." >&4
12411 *) val="$d_sigsetjmp"
12412 case "$d_sigsetjmp" in
12413 $define) echo "POSIX sigsetjmp found." >&4;;
12414 $undef) echo "sigsetjmp not found." >&4;;
12422 : see if sockatmark exists
12423 set sockatmark d_sockatmark
12426 : see if prototype for sockatmark is available
12428 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
12431 : see if socks5_init exists
12432 set socks5_init d_socks5_init
12435 : see if prototype for setresgid is available
12437 set d_sresgproto setresgid $i_unistd unistd.h
12440 : see if prototype for setresuid is available
12442 set d_sresuproto setresuid $i_unistd unistd.h
12445 : see if sys/stat.h is available
12446 set sys/stat.h i_sysstat
12450 : see if stat knows about block sizes
12452 echo "Checking to see if your struct stat has st_blocks field..." >&4
12453 set d_statblks stat st_blocks $i_sysstat sys/stat.h
12457 : see if this is a sys/vfs.h system
12458 set sys/vfs.h i_sysvfs
12462 : see if this is a sys/statfs.h system
12463 set sys/statfs.h i_sysstatfs
12468 echo "Checking to see if your system supports struct statfs..." >&4
12469 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
12471 case "$d_statfs_s" in
12472 "$define") echo "Yes, it does." ;;
12473 *) echo "No, it doesn't." ;;
12478 : see if struct statfs knows about f_flags
12479 case "$d_statfs_s" in
12482 echo "Checking to see if your struct statfs has f_flags field..." >&4
12483 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
12487 set d_statfs_f_flags
12491 case "$d_statfs_f_flags" in
12492 "$define") echo "Yes, it does." ;;
12493 *) echo "No, it doesn't." ;;
12496 : see if _ptr and _cnt from stdio act std
12499 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12500 echo "(Looks like you have stdio.h from BSD.)"
12501 case "$stdio_ptr" in
12502 '') stdio_ptr='((fp)->_p)'
12505 *) ptr_lval=$d_stdio_ptr_lval;;
12507 case "$stdio_cnt" in
12508 '') stdio_cnt='((fp)->_r)'
12511 *) cnt_lval=$d_stdio_cnt_lval;;
12513 case "$stdio_base" in
12514 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12516 case "$stdio_bufsiz" in
12517 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12519 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12520 echo "(Looks like you have stdio.h from Linux.)"
12521 case "$stdio_ptr" in
12522 '') stdio_ptr='((fp)->_IO_read_ptr)'
12525 *) ptr_lval=$d_stdio_ptr_lval;;
12527 case "$stdio_cnt" in
12528 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12531 *) cnt_lval=$d_stdio_cnt_lval;;
12533 case "$stdio_base" in
12534 '') stdio_base='((fp)->_IO_read_base)';;
12536 case "$stdio_bufsiz" in
12537 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12540 case "$stdio_ptr" in
12541 '') stdio_ptr='((fp)->_ptr)'
12544 *) ptr_lval=$d_stdio_ptr_lval;;
12546 case "$stdio_cnt" in
12547 '') stdio_cnt='((fp)->_cnt)'
12550 *) cnt_lval=$d_stdio_cnt_lval;;
12552 case "$stdio_base" in
12553 '') stdio_base='((fp)->_base)';;
12555 case "$stdio_bufsiz" in
12556 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12560 : test whether _ptr and _cnt really work
12561 echo "Checking how std your stdio is..." >&4
12564 #define FILE_ptr(fp) $stdio_ptr
12565 #define FILE_cnt(fp) $stdio_cnt
12567 FILE *fp = fopen("try.c", "r");
12570 18 <= FILE_cnt(fp) &&
12571 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12579 if eval $compile && $to try.c; then
12580 if $run ./try; then
12581 echo "Your stdio acts pretty std."
12584 echo "Your stdio isn't very std."
12587 echo "Your stdio doesn't appear very std."
12593 : Can _ptr be used as an lvalue?
12594 case "$d_stdstdio$ptr_lval" in
12595 $define$define) val=$define ;;
12598 set d_stdio_ptr_lval
12601 : Can _cnt be used as an lvalue?
12602 case "$d_stdstdio$cnt_lval" in
12603 $define$define) val=$define ;;
12606 set d_stdio_cnt_lval
12610 : test whether setting _ptr sets _cnt as a side effect
12611 d_stdio_ptr_lval_sets_cnt="$undef"
12612 d_stdio_ptr_lval_nochange_cnt="$undef"
12613 case "$d_stdio_ptr_lval$d_stdstdio" in
12615 echo "Checking to see what happens if we set the stdio ptr..." >&4
12618 /* Can we scream? */
12619 /* Eat dust sed :-) */
12620 /* In the buffer space, no one can hear you scream. */
12621 #define FILE_ptr(fp) $stdio_ptr
12622 #define FILE_cnt(fp) $stdio_cnt
12623 #include <sys/types.h>
12625 FILE *fp = fopen("try.c", "r");
12630 puts("Fail even to read");
12633 c = getc(fp); /* Read away the first # */
12635 puts("Fail even to read");
12639 18 <= FILE_cnt(fp) &&
12640 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12642 puts("Fail even to read");
12645 ptr = (char*) FILE_ptr(fp);
12646 cnt = (size_t)FILE_cnt(fp);
12648 FILE_ptr(fp) += 42;
12650 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12651 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12654 if (FILE_cnt(fp) <= 20) {
12655 printf ("Fail (<20 chars to test)");
12658 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12659 puts("Fail compare");
12662 if (cnt == FILE_cnt(fp)) {
12663 puts("Pass_unchanged");
12666 if (FILE_cnt(fp) == (cnt - 42)) {
12667 puts("Pass_changed");
12670 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12676 if eval $compile && $to try.c; then
12677 case `$run ./try` in
12679 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12680 d_stdio_ptr_lval_sets_cnt="$define" ;;
12682 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12683 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12685 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12687 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12690 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12696 : see if _base is also standard
12698 case "$d_stdstdio" in
12702 #define FILE_base(fp) $stdio_base
12703 #define FILE_bufsiz(fp) $stdio_bufsiz
12705 FILE *fp = fopen("try.c", "r");
12708 19 <= FILE_bufsiz(fp) &&
12709 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
12716 if eval $compile && $to try.c; then
12717 if $run ./try; then
12718 echo "And its _base field acts std."
12721 echo "But its _base field isn't std."
12724 echo "However, it seems to be lacking the _base field."
12733 Checking how to access stdio streams by file descriptor number...
12735 case "$stdio_stream_array" in
12736 '') $cat >try.c <<EOCP
12739 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
12743 for s in _iob __iob __sF
12745 set try -DSTDIO_STREAM_ARRAY=$s
12746 if eval $compile; then
12747 case "`$run ./try`" in
12748 yes) stdio_stream_array=$s; break ;;
12752 $rm -f try.* try$exe_ext
12754 case "$stdio_stream_array" in
12756 I can't figure out how to access stdio streams by file descriptor number.
12758 d_stdio_stream_array="$undef"
12761 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
12763 d_stdio_stream_array="$define"
12767 : see if strcoll exists
12768 set strcoll d_strcoll
12771 : check for structure copying
12773 echo "Checking to see if your C compiler can copy structs..." >&4
12774 $cat >try.c <<'EOCP'
12784 if $cc -c try.c >/dev/null 2>&1 ; then
12786 echo "Yup, it can."
12789 echo "Nope, it can't."
12795 : see if strerror and/or sys_errlist[] exist
12797 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
12798 if set strerror val -f d_strerror; eval $csym; $val; then
12799 echo 'strerror() found.' >&4
12800 d_strerror="$define"
12801 d_strerrm='strerror(e)'
12802 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
12803 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
12804 d_syserrlst="$define"
12806 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
12807 d_syserrlst="$undef"
12809 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
12810 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
12811 echo 'strerror() found in string header.' >&4
12812 d_strerror="$define"
12813 d_strerrm='strerror(e)'
12814 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
12815 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
12816 d_syserrlst="$define"
12818 echo "(You don't appear to have any sys_errlist[], how can this be?)"
12819 d_syserrlst="$undef"
12821 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
12822 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
12823 d_strerror="$undef"
12824 d_syserrlst="$define"
12825 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
12827 echo 'strerror() and sys_errlist[] NOT found.' >&4
12828 d_strerror="$undef"
12829 d_syserrlst="$undef"
12830 d_strerrm='"unknown"'
12834 : see if strftime exists
12835 set strftime d_strftime
12838 : see if strtod exists
12839 set strtod d_strtod
12842 : see if strtol exists
12843 set strtol d_strtol
12846 : see if strtold exists
12847 set strtold d_strtold
12850 : see if strtoll exists
12851 set strtoll d_strtoll
12854 case "$d_longlong-$d_strtoll" in
12857 Checking whether your strtoll() works okay...
12859 $cat >try.c <<'EOCP'
12862 #define strtoll __strtoll
12865 #define strtoll _strtoll
12868 extern long long int strtoll(char *s, char **, int);
12869 static int bad = 0;
12870 int check(char *s, long long ell, int een) {
12873 gll = strtoll(s, 0, 10);
12874 if (!((gll == ell) && (errno == een)))
12878 check(" 1", 1LL, 0);
12879 check(" 0", 0LL, 0);
12880 check("-1", -1LL, 0);
12881 check("-9223372036854775808", -9223372036854775808LL, 0);
12882 check("-9223372036854775808", -9223372036854775808LL, 0);
12883 check(" 9223372036854775807", 9223372036854775807LL, 0);
12884 check("-9223372036854775808", -9223372036854775808LL, 0);
12885 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
12886 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
12892 if eval $compile; then
12895 ok) echo "Your strtoll() seems to be working okay." ;;
12897 Your strtoll() doesn't seem to be working okay.
12903 echo "(I can't seem to compile the test program--assuming it doesn't)"
12909 : see if strtoq exists
12910 set strtoq d_strtoq
12913 : see if strtoul exists
12914 set strtoul d_strtoul
12917 case "$d_strtoul" in
12920 Checking whether your strtoul() works okay...
12922 $cat >try.c <<'EOCP'
12925 extern unsigned long int strtoul(char *s, char **, int);
12926 static int bad = 0;
12927 void check(char *s, unsigned long eul, int een) {
12930 gul = strtoul(s, 0, 10);
12931 if (!((gul == eul) && (errno == een)))
12935 check(" 1", 1L, 0);
12936 check(" 0", 0L, 0);
12938 case "$longsize" in
12940 $cat >>try.c <<'EOCP'
12941 check("18446744073709551615", 18446744073709551615UL, 0);
12942 check("18446744073709551616", 18446744073709551615UL, ERANGE);
12943 #if 0 /* strtoul() for /^-/ strings is undefined. */
12944 check("-1", 18446744073709551615UL, 0);
12945 check("-18446744073709551614", 2, 0);
12946 check("-18446744073709551615", 1, 0);
12947 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
12948 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
12953 $cat >>try.c <<'EOCP'
12954 check("4294967295", 4294967295UL, 0);
12955 check("4294967296", 4294967295UL, ERANGE);
12956 #if 0 /* strtoul() for /^-/ strings is undefined. */
12957 check("-1", 4294967295UL, 0);
12958 check("-4294967294", 2, 0);
12959 check("-4294967295", 1, 0);
12960 check("-4294967296", 4294967295UL, ERANGE);
12961 check("-4294967297", 4294967295UL, ERANGE);
12966 : Should we write these tests to be more portable by sprintf-ing
12967 : ~0 and then manipulating that char string as input for strtol?
12970 $cat >>try.c <<'EOCP'
12977 if eval $compile; then
12978 case "`$run ./try`" in
12979 ok) echo "Your strtoul() seems to be working okay." ;;
12981 Your strtoul() doesn't seem to be working okay.
12990 : see if strtoull exists
12991 set strtoull d_strtoull
12994 case "$d_longlong-$d_strtoull" in
12997 Checking whether your strtoull() works okay...
12999 $cat >try.c <<'EOCP'
13002 #define strtoull __strtoull
13005 extern unsigned long long int strtoull(char *s, char **, int);
13006 static int bad = 0;
13007 int check(char *s, long long eull, int een) {
13010 gull = strtoull(s, 0, 10);
13011 if (!((gull == eull) && (errno == een)))
13015 check(" 1", 1LL, 0);
13016 check(" 0", 0LL, 0);
13017 check("18446744073709551615", 18446744073709551615ULL, 0);
13018 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
13019 #if 0 /* strtoull() for /^-/ strings is undefined. */
13020 check("-1", 18446744073709551615ULL, 0);
13021 check("-18446744073709551614", 2LL, 0);
13022 check("-18446744073709551615", 1LL, 0);
13023 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
13024 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
13031 if eval $compile; then
13032 case "`$run ./try`" in
13033 ok) echo "Your strtoull() seems to be working okay." ;;
13035 Your strtoull() doesn't seem to be working okay.
13037 d_strtoull="$undef"
13044 : see if strtouq exists
13045 set strtouq d_strtouq
13048 case "$d_strtouq" in
13051 Checking whether your strtouq() works okay...
13053 $cat >try.c <<'EOCP'
13056 extern unsigned long long int strtouq(char *s, char **, int);
13057 static int bad = 0;
13058 void check(char *s, unsigned long long eull, int een) {
13059 unsigned long long gull;
13061 gull = strtouq(s, 0, 10);
13062 if (!((gull == eull) && (errno == een)))
13066 check(" 1", 1LL, 0);
13067 check(" 0", 0LL, 0);
13068 check("18446744073709551615", 18446744073709551615ULL, 0);
13069 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
13070 #if 0 /* strtouq() for /^-/ strings is undefined. */
13071 check("-1", 18446744073709551615ULL, 0);
13072 check("-18446744073709551614", 2LL, 0);
13073 check("-18446744073709551615", 1LL, 0);
13074 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
13075 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
13083 if eval $compile; then
13084 case "`$run ./try`" in
13085 ok) echo "Your strtouq() seems to be working okay." ;;
13087 Your strtouq() doesn't seem to be working okay.
13096 : see if strxfrm exists
13097 set strxfrm d_strxfrm
13100 : see if symlink exists
13101 set symlink d_symlink
13104 : see if syscall exists
13105 set syscall d_syscall
13108 : see if prototype for syscall is available
13110 set d_syscallproto syscall $i_unistd unistd.h
13113 : see if sysconf exists
13114 set sysconf d_sysconf
13117 : see if system exists
13118 set system d_system
13121 : see if tcgetpgrp exists
13122 set tcgetpgrp d_tcgetpgrp
13125 : see if tcsetpgrp exists
13126 set tcsetpgrp d_tcsetpgrp
13129 : see if prototype for telldir is available
13131 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
13134 : see if this is a sys/times.h system
13135 set sys/times.h i_systimes
13138 : see if times exists
13140 if set times val -f d_times; eval $csym; $val; then
13141 echo 'times() found.' >&4
13144 case "$i_systimes" in
13145 "$define") inc='sys/times.h';;
13147 rp="What is the type returned by times() on this system?"
13148 set clock_t clocktype long stdio.h sys/types.h $inc
13151 echo 'times() NOT found, hope that will do.' >&4
13156 : see if truncate exists
13157 set truncate d_truncate
13160 : see if tzname[] exists
13162 if set tzname val -a d_tzname; eval $csym; $val; then
13164 echo 'tzname[] found.' >&4
13167 echo 'tzname[] NOT found.' >&4
13173 next|rhapsody|darwin) multiarch="$define" ;;
13175 case "$multiarch" in
13176 ''|[nN]*) multiarch="$undef" ;;
13179 : check for ordering of bytes in a long
13181 case "$usecrosscompile$multiarch" in
13184 You seem to be either cross-compiling or doing a multiarchitecture build,
13185 skipping the byteorder check.
13191 case "$byteorder" in
13194 In the following, larger digits indicate more significance. A big-endian
13195 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
13196 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
13197 machines may have weird orders like 3412. A Cray will report 87654321,
13198 an Alpha will report 12345678. If the test program works the default is
13200 I'm now running the test program...
13202 $cat >try.c <<'EOCP'
13209 char c[sizeof(long)];
13212 if (sizeof(long) > 4)
13213 u.l = (0x08070605L << 32) | 0x04030201L;
13216 for (i = 0; i < sizeof(long); i++)
13217 printf("%c", u.c[i]+'0');
13224 if eval $compile && ./try > /dev/null; then
13227 [1-4][1-4][1-4][1-4]|12345678|87654321)
13228 echo "(The test program ran ok.)"
13229 echo "byteorder=$dflt"
13232 ????|????????) echo "(The test program ran ok.)" ;;
13233 *) echo "(The test program didn't run right for some reason.)" ;;
13238 (I can't seem to compile the test program. Guessing big-endian...)
13241 case "$xxx_prompt" in
13243 rp="What is the order of bytes in a long?"
13259 Checking to see whether you can access character data unalignedly...
13263 #define U32 $u32type
13264 #define BYTEORDER $byteorder
13266 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
13267 U8 buf[] = "\0\0\0\1\0\0\0\0";
13271 if (sizeof(U32) != 4) {
13272 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
13278 for (i = 0; i < 4; i++) {
13279 up = (U32*)(buf + i);
13280 if (! ((*up == 1 << (8*i)) || /* big-endian */
13281 (*up == 1 << (8*(3-i))) /* little-endian */
13285 printf("read failed (%x)\n", *up);
13291 for (i = 0; i < 4; i++) {
13292 up = (U32*)(buf + i);
13294 if (*up != 0xBeef) {
13295 printf("write failed (%x)\n", *up);
13309 if eval $compile_ok; then
13310 echo "(Testing for character data alignment may dump core.)" >&4
13311 $run ./try 2>&1 >/dev/null
13314 You can access character data pretty unalignedly.
13316 d_u32align="$undef"
13319 It seems that you must access character data in an aligned manner.
13321 d_u32align="$define"
13324 $rm -f core core.try.* try.core
13326 rp='Can you access character data at unaligned addresses?'
13330 [yY]*) d_u32align="$undef" ;;
13331 *) d_u32align="$define" ;;
13335 : see if ualarm exists
13336 set ualarm d_ualarm
13339 : see if umask exists
13343 : see if unordered exists
13344 set unordered d_unordered
13347 : see if usleep exists
13348 set usleep d_usleep
13351 : see if prototype for usleep is available
13353 set d_usleepproto usleep $i_unistd unistd.h
13356 : see if ustat exists
13360 : backward compatibility for d_hvfork
13361 if test X$d_hvfork != X; then
13362 d_vfork="$d_hvfork"
13365 : see if there is a vfork
13370 : Ok, but do we want to use it. vfork is reportedly unreliable in
13371 : perl on Solaris 2.x, and probably elsewhere.
13375 case "$usevfork" in
13381 Perl can only use a vfork() that doesn't suffer from strict
13382 restrictions on calling functions or modifying global data in
13383 the child. For example, glibc-2.1 contains such a vfork()
13384 that is unsuitable. If your system provides a proper fork()
13385 call, chances are that you do NOT want perl to use vfork().
13388 rp="Do you still want to use vfork()?"
13393 echo "Ok, we won't use vfork()."
13402 $define) usevfork='true';;
13403 *) usevfork='false';;
13406 : see if this is an sysdir system
13407 set sys/dir.h i_sysdir
13410 : see if this is an sysndir system
13411 set sys/ndir.h i_sysndir
13414 : see if closedir exists
13415 set closedir d_closedir
13418 case "$d_closedir" in
13421 echo "Checking whether closedir() returns a status..." >&4
13423 #$i_dirent I_DIRENT /**/
13424 #$i_sysdir I_SYS_DIR /**/
13425 #$i_sysndir I_SYS_NDIR /**/
13426 #$i_systypes I_SYS_TYPES /**/
13428 #if defined(I_SYS_TYPES)
13429 #include <sys/types.h>
13431 #if defined(I_DIRENT)
13432 #include <dirent.h>
13433 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
13434 #include <sys/dir.h>
13438 #include <sys/ndir.h>
13442 #include <ndir.h> /* may be wrong in the future */
13444 #include <sys/dir.h>
13449 int main() { return closedir(opendir(".")); }
13452 if eval $compile_ok; then
13453 if $run ./try > /dev/null 2>&1 ; then
13454 echo "Yes, it does."
13457 echo "No, it doesn't."
13461 echo "(I can't seem to compile the test program--assuming it doesn't)"
13469 set d_void_closedir
13472 : see if there is a wait4
13476 : see if waitpid exists
13477 set waitpid d_waitpid
13480 : see if wcstombs exists
13481 set wcstombs d_wcstombs
13484 : see if wctomb exists
13485 set wctomb d_wctomb
13488 : see if writev exists
13489 set writev d_writev
13492 : preserve RCS keywords in files with variable substitution, grrr
13497 Revision='$Revision'
13499 : check for alignment requirements
13501 case "$usecrosscompile$multiarch" in
13504 You seem to be either cross-compiling or doing a multiarchitecture build,
13505 skipping the memory alignment check.
13508 case "$alignbytes" in
13509 '') alignbytes=8 ;;
13513 case "$alignbytes" in
13514 '') echo "Checking alignment constraints..." >&4
13515 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
13516 $cat >try.c <<'EOCP'
13517 typedef long double NV;
13520 $cat >try.c <<'EOCP'
13524 $cat >>try.c <<'EOCP'
13532 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
13537 if eval $compile_ok; then
13541 echo "(I can't seem to compile the test program...)"
13544 *) dflt="$alignbytes"
13547 rp="Doubles must be aligned on a how-many-byte boundary?"
13555 : set the base revision
13558 : how do we catenate cpp tokens here?
13560 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
13561 $cat >cpp_stuff.c <<'EOCP'
13562 #define RCAT(a,b)a/**/b
13563 #define ACAT(a,b)a ## b
13567 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
13568 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
13569 echo "Oh! Smells like ANSI's been here." >&4
13570 echo "We can catify or stringify, separately or together!"
13572 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
13573 echo "Ah, yes! The good old days!" >&4
13574 echo "However, in the good old days we don't know how to stringify and"
13575 echo "catify at the same time."
13579 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
13580 to have to edit the values of CAT[2-5] in config.h...
13582 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
13586 : see if this is a db.h system
13592 : Check db version.
13594 echo "Checking Berkeley DB version ..." >&4
13600 #include <sys/types.h>
13603 int main(int argc, char *argv[])
13605 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
13606 int Major, Minor, Patch ;
13607 unsigned long Version ;
13608 (void)db_version(&Major, &Minor, &Patch) ;
13610 printf("%d %d %d %d %d %d\n",
13611 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
13612 Major, Minor, Patch);
13615 printf("You have Berkeley DB Version 2 or greater.\n");
13617 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
13618 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
13619 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
13620 Major, Minor, Patch) ;
13622 /* check that db.h & libdb are compatible */
13623 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
13624 printf("db.h and libdb are incompatible.\n") ;
13628 printf("db.h and libdb are compatible.\n") ;
13630 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
13631 + DB_VERSION_PATCH ;
13633 /* needs to be >= 2.3.4 */
13634 if (Version < 2003004) {
13635 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
13636 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
13642 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
13647 printf("You have Berkeley DB Version 1.\n");
13648 exit(0); /* DB version < 2: the coast is clear. */
13650 exit(1); /* <db.h> not Berkeley DB? */
13656 if eval $compile_ok && $run ./try; then
13657 echo 'Looks OK.' >&4
13659 db_version_major=$1
13660 db_version_minor=$2
13661 db_version_patch=$3
13663 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
13667 : Remove db from list of libraries to use
13668 echo "Removing unusable -ldb from library list" >&4
13669 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
13672 echo "libs = $libs" >&4
13682 : Check the return type needed for hash
13684 echo "Checking return type needed for hash for Berkeley DB ..." >&4
13690 #include <sys/types.h>
13693 #ifndef DB_VERSION_MAJOR
13694 u_int32_t hash_cb (ptr, size)
13702 info.hash = hash_cb;
13706 if $cc $ccflags -c try.c >try.out 2>&1 ; then
13707 if $contains warning try.out >>/dev/null 2>&1 ; then
13710 db_hashtype='u_int32_t'
13713 : XXX Maybe we should just give up here.
13714 db_hashtype=u_int32_t
13716 echo "Help: I can't seem to compile the db test program." >&4
13717 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
13720 echo "Your version of Berkeley DB uses $db_hashtype for hash."
13722 *) db_hashtype=u_int32_t
13727 : Check the return type needed for prefix
13729 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
13735 #include <sys/types.h>
13738 #ifndef DB_VERSION_MAJOR
13739 size_t prefix_cb (key1, key2)
13747 info.prefix = prefix_cb;
13751 if $cc $ccflags -c try.c >try.out 2>&1 ; then
13752 if $contains warning try.out >>/dev/null 2>&1 ; then
13753 db_prefixtype='int'
13755 db_prefixtype='size_t'
13758 db_prefixtype='size_t'
13759 : XXX Maybe we should just give up here.
13761 echo "Help: I can't seem to compile the db test program." >&4
13762 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
13765 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
13767 *) db_prefixtype='size_t'
13772 : How can we generate normalized random numbers ?
13774 echo "Looking for a random number function..." >&4
13775 case "$randfunc" in
13777 if set drand48 val -f; eval $csym; $val; then
13779 echo "Good, found drand48()." >&4
13780 elif set random val -f; eval $csym; $val; then
13782 echo "OK, found random()." >&4
13785 echo "Yick, looks like I have to use rand()." >&4
13796 *-Dmy_rand=*|*-Dmy_srand=*)
13797 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
13798 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
13799 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
13800 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
13804 while $test "$cont"; do
13805 rp="Use which function to generate random numbers?"
13807 if $test "$ans" = "$dflt"; then
13813 if set $ans val -f; eval $csym; $val; then
13817 rp="I cannot find function $ans. Use that name anyway?"
13826 case "$randfunc" in
13828 drand01="drand48()"
13834 case "$randbits" in
13836 echo "Checking to see how many bits your $randfunc() function produces..." >&4
13838 #$i_unistd I_UNISTD
13839 #$i_stdlib I_STDLIB
13842 # include <unistd.h>
13845 # include <stdlib.h>
13850 register unsigned long tmp;
13851 register unsigned long max = 0L;
13853 for (i = 1000; i; i--) {
13854 tmp = (unsigned long) $randfunc();
13855 if (tmp > max) max = tmp;
13857 for (i = 0; max; i++)
13863 if eval $compile_ok; then
13867 echo "(I can't seem to compile the test program...)"
13874 rp="How many bits does your $randfunc() function produce?"
13878 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
13879 seedfunc="s$randfunc"
13880 randseedtype=unsigned
13884 rp="How many bits does your $randfunc() function produce?"
13887 seedfunc="s$randfunc"
13888 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
13889 if set $seedfunc val -f; eval $csym; $val; then
13890 echo "(Using $seedfunc() to seed random generator)"
13892 echo "(Warning: no $seedfunc() to seed random generator)"
13895 randseedtype=unsigned
13903 echo "Determining whether or not we are on an EBCDIC system..." >&4
13904 $cat >try.c <<'EOM'
13907 if ('M'==0xd4) return 0;
13914 if eval $compile_ok; then
13915 if $run ./try; then
13916 echo "You seem to speak EBCDIC." >&4
13919 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
13922 echo "I'm unable to compile the test program." >&4
13923 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
13931 Checking how to flush all pending stdio output...
13933 # I only know how to find the first 32 possibly open files on SunOS.
13934 # See also hints/sunos_4_1.sh and util.c --AD
13936 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
13938 $cat >>try.c <<EOCP
13940 #$i_unistd I_UNISTD
13942 # include <unistd.h>
13944 #$d_sysconf HAS_SYSCONF
13945 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
13946 #ifdef HAS_STDIO_STREAM_ARRAY
13947 # define STDIO_STREAM_ARRAY $stdio_stream_array
13952 p = fopen("try.out", "w");
13956 # ifdef TRY_FPRINTF
13960 #ifdef TRY_FFLUSH_NULL
13963 #ifdef TRY_FFLUSH_ALL
13965 long open_max = -1;
13966 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
13967 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
13969 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
13970 open_max = sysconf(_SC_OPEN_MAX);
13973 open_max = FOPEN_MAX;
13976 open_max = OPEN_MAX;
13985 # ifdef HAS_STDIO_STREAM_ARRAY
13986 if (open_max > 0) {
13988 for (i = 0; i < open_max; i++)
13989 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
13990 STDIO_STREAM_ARRAY[i]._file < open_max &&
13991 STDIO_STREAM_ARRAY[i]._flag)
13992 fflush(&STDIO_STREAM_ARRAY[i]);
14000 : first we have to find out how _not_ to flush
14002 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
14004 set try -DTRY_FPUTC
14005 if eval $compile; then
14006 $run ./try 2>/dev/null
14009 if $test ! -s try.out -a "X$code" = X42; then
14015 set try -DTRY_FPRINTF
14016 if eval $compile; then
14017 $run ./try 2>/dev/null
14020 if $test ! -s try.out -a "X$code" = X42; then
14021 output=-DTRY_FPRINTF
14027 : check for fflush NULL behaviour
14028 case "$fflushNULL" in
14029 '') set try -DTRY_FFLUSH_NULL $output
14030 if eval $compile; then
14031 $run ./try 2>/dev/null
14034 if $test -s try.out -a "X$code" = X42; then
14035 fflushNULL="`$cat try.out`"
14037 if $test "X$code" != X42; then
14039 (If this test failed, don't worry, we'll try another method shortly.)
14044 $rm -f core try.core core.try.*
14045 case "$fflushNULL" in
14047 Your fflush(NULL) works okay for output streams.
14048 Let's see if it clobbers input pipes...
14050 # As of mid-March 2000 all versions of Solaris appear to have a stdio
14051 # bug that improperly flushes the input end of pipes. So we avoid the
14052 # autoflush on fork/system/exec support for now. :-(
14053 $cat >tryp.c <<EOCP
14056 main(int argc, char **argv)
14062 while ((i = getc(stdin)) != -1
14063 && (*bp++ = i) != '\n'
14064 && bp < &buf[1024])
14067 fprintf(stdout, "%s", buf);
14075 fflushNULL="$define"
14077 if eval $compile; then
14079 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
14080 if cmp tryp.c tryp.out >/dev/null 2>&1; then
14082 fflush(NULL) seems to behave okay with input streams.
14084 fflushNULL="$define"
14087 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
14089 fflushNULL="$undef"
14092 $rm -f core tryp.c tryp.core core.tryp.*
14095 Your fflush(NULL) isn't working (contrary to ANSI C).
14097 fflushNULL="$undef"
14100 Cannot figure out whether your fflush(NULL) works or not.
14101 I'm assuming it doesn't (contrary to ANSI C).
14103 fflushNULL="$undef"
14107 $define|true|[yY]*)
14108 fflushNULL="$define"
14111 fflushNULL="$undef"
14114 : check explicit looping only if NULL did not work, and if the pipe
14115 : bug does not show up on an explicit flush too
14116 case "$fflushNULL" in
14118 $cat >tryp.c <<EOCP
14121 main(int argc, char **argv)
14127 while ((i = getc(stdin)) != -1
14128 && (*bp++ = i) != '\n'
14129 && bp < &buf[1024])
14132 fprintf(stdout, "%s", buf);
14141 if eval $compile; then
14143 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
14144 if cmp tryp.c tryp.out >/dev/null 2>&1; then
14146 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
14148 : now check for fflushall behaviour
14149 case "$fflushall" in
14150 '') set try -DTRY_FFLUSH_ALL $output
14151 if eval $compile; then
14153 (Now testing the other method--but note that this also may fail.)
14155 $run ./try 2>/dev/null
14158 if $test -s try.out -a "X$code" = X42; then
14159 fflushall="`$cat try.out`"
14162 $rm -f core try.core core.try.*
14163 case "$fflushall" in
14165 Whew. Flushing explicitly all the stdio streams works.
14167 fflushall="$define"
14170 Sigh. Flushing explicitly all the stdio streams doesn't work.
14175 Cannot figure out whether flushing stdio streams explicitly works or not.
14176 I'm assuming it doesn't.
14182 "$define"|true|[yY]*)
14183 fflushall="$define"
14191 All is futile. Even fflush(stdin) clobbers input pipes!
14198 $rm -f core tryp.c tryp.core core.tryp.*
14200 *) fflushall="$undef"
14204 case "$fflushNULL$fflushall" in
14207 OK, I give up. I cannot figure out how to flush pending stdio output.
14208 We won't be flushing handles at all before fork/exec/popen.
14212 $rm -f try.* try$exe_ext
14214 : Store the full pathname to the ar program for use in the C program
14215 : Respect a hint or command line value for full_ar.
14220 : Store the full pathname to the sed program for use in the C program
14223 : see what type gids are declared as in the kernel
14225 echo "Looking for the type for group ids returned by getgid()."
14226 set gid_t gidtype xxx stdio.h sys/types.h
14230 xxx=`./findhdr sys/user.h`
14231 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
14233 unsigned) dflt="$1 $2" ;;
14237 *) dflt="$gidtype";;
14240 gid_t) echo "gid_t found." ;;
14241 *) rp="What is the type for group ids returned by getgid()?"
14249 *_t) zzz="$gidtype" ;;
14252 echo "Checking the size of $zzz..." >&4
14254 #include <sys/types.h>
14257 printf("%d\n", (int)sizeof($gidtype));
14262 if eval $compile_ok; then
14266 echo "(I can't execute the test program--guessing $gidsize.)" >&4
14269 echo "Your $zzz is $gidsize bytes long."
14274 echo "(I can't compile the test program--guessing $gidsize.)" >&4
14280 *_t) zzz="$gidtype" ;;
14283 echo "Checking the sign of $zzz..." >&4
14285 #include <sys/types.h>
14296 if eval $compile; then
14300 echo "(I can't execute the test program--guessing unsigned.)" >&4
14304 1) echo "Your $zzz is unsigned." ;;
14305 -1) echo "Your $zzz is signed." ;;
14311 echo "(I can't compile the test program--guessing unsigned.)" >&4
14317 if $test X"$quadtype" != X; then
14319 echo "Checking how to print 64-bit integers..." >&4
14321 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
14322 $cat >try.c <<'EOCP'
14323 #include <sys/types.h>
14326 int q = 12345678901;
14327 printf("%ld\n", q);
14331 if eval $compile; then
14335 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
14336 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
14337 echo "We will use %d."
14343 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
14344 $cat >try.c <<'EOCP'
14345 #include <sys/types.h>
14348 long q = 12345678901;
14349 printf("%ld\n", q);
14353 if eval $compile; then
14357 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
14358 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
14359 echo "We will use %ld."
14365 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
14366 $cat >try.c <<'EOCP'
14367 #include <sys/types.h>
14368 #include <inttypes.h>
14371 int64_t q = 12345678901;
14372 printf("%" PRId64 "\n", q);
14376 if eval $compile; then
14380 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
14381 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
14382 echo "We will use the C9X style."
14388 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
14390 #include <sys/types.h>
14393 $quadtype q = 12345678901;
14394 printf("%Ld\n", q);
14398 if eval $compile; then
14402 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
14403 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
14404 echo "We will use %Ld."
14410 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
14411 $cat >try.c <<'EOCP'
14412 #include <sys/types.h>
14415 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
14416 printf("%lld\n", q);
14420 if eval $compile; then
14424 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
14425 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
14426 echo "We will use the %lld style."
14432 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
14434 #include <sys/types.h>
14437 $quadtype q = 12345678901;
14438 printf("%qd\n", q);
14442 if eval $compile; then
14446 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
14447 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
14448 echo "We will use %qd."
14454 if $test X"$sPRId64" = X; then
14455 echo "Cannot figure out how to print 64-bit integers." >&4
14463 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
14464 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
14466 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
14467 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
14473 $echo "Checking the format strings to be used for Perl's internal types..." >&4
14475 if $test X"$ivsize" = X8; then
14476 ivdformat="$sPRId64"
14477 uvuformat="$sPRIu64"
14478 uvoformat="$sPRIo64"
14479 uvxformat="$sPRIx64"
14480 uvXUformat="$sPRIXU64"
14482 if $test X"$ivsize" = X"$longsize"; then
14489 if $test X"$ivsize" = X"$intsize"; then
14497 if $test X"$ivsize" = X"$shortsize"; then
14508 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
14509 nveformat="$sPRIeldbl"
14510 nvfformat="$sPRIfldbl"
14511 nvgformat="$sPRIgldbl"
14512 nvEUformat="$sPRIEUldbl"
14513 nvFUformat="$sPRIFUldbl"
14514 nvGUformat="$sPRIGUldbl"
14524 case "$ivdformat" in
14525 '') echo "$0: Fatal: failed to find format strings, cannot continue." >& 4
14532 $echo "Checking the format string to be used for gids..." >&4
14535 -1) if $test X"$gidsize" = X"$ivsize"; then
14536 gidformat="$ivdformat"
14538 if $test X"$gidsize" = X"$longsize"; then
14541 if $test X"$gidsize" = X"$intsize"; then
14544 if $test X"$gidsize" = X"$shortsize"; then
14551 *) if $test X"$gidsize" = X"$uvsize"; then
14552 gidformat="$uvuformat"
14554 if $test X"$gidsize" = X"$longsize"; then
14557 if $test X"$gidsize" = X"$intsize"; then
14560 if $test X"$gidsize" = X"$shortsize"; then
14569 : see if getgroups exists
14570 set getgroups d_getgrps
14573 : see if setgroups exists
14574 set setgroups d_setgrps
14578 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
14580 case "$d_getgrps$d_setgrps" in
14582 case "$groupstype" in
14583 '') dflt="$gidtype" ;;
14584 *) dflt="$groupstype" ;;
14587 What type of pointer is the second argument to getgroups() and setgroups()?
14588 Usually this is the same as group ids, $gidtype, but not always.
14591 rp='What type pointer is the second argument to getgroups() and setgroups()?'
14595 *) groupstype="$gidtype";;
14599 echo "Checking if your $make program sets \$(MAKE)..." >&4
14600 case "$make_set_make" in
14602 $sed 's/^X //' > testmake.mak << 'EOF'
14604 X @echo 'maketemp="$(MAKE)"'
14606 case "`$make -f testmake.mak 2>/dev/null`" in
14607 *maketemp=*) make_set_make='#' ;;
14608 *) make_set_make="MAKE=$make" ;;
14610 $rm -f testmake.mak
14613 case "$make_set_make" in
14614 '#') echo "Yup, it does.";;
14615 *) echo "Nope, it doesn't.";;
14618 : see what type is used for mode_t
14619 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
14620 set mode_t modetype int stdio.h sys/types.h
14623 : see if stdarg is available
14625 if $test `./findhdr stdarg.h`; then
14626 echo "<stdarg.h> found." >&4
14629 echo "<stdarg.h> NOT found." >&4
14633 : see if varags is available
14635 if $test `./findhdr varargs.h`; then
14636 echo "<varargs.h> found." >&4
14638 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
14641 : set up the varargs testing programs
14642 $cat > varargs.c <<EOP
14644 #include <stdarg.h>
14647 #include <varargs.h>
14651 int f(char *p, ...)
14665 p = va_arg(ap, char *);
14670 $cat > varargs <<EOP
14672 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
14681 : now check which varargs header should be included
14686 if `./varargs I_STDARG`; then
14688 elif `./varargs I_VARARGS`; then
14693 if `./varargs I_VARARGS`; then
14700 echo "I could not find the definition for va_dcl... You have problems..." >&4
14701 val="$undef"; set i_stdarg; eval $setvar
14702 val="$undef"; set i_varargs; eval $setvar
14707 case "$i_varhdr" in
14709 val="$define"; set i_stdarg; eval $setvar
14710 val="$undef"; set i_varargs; eval $setvar
14713 val="$undef"; set i_stdarg; eval $setvar
14714 val="$define"; set i_varargs; eval $setvar
14717 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
14721 : see if we need va_copy
14723 case "$i_stdarg" in
14726 #include <stdarg.h>
14728 #$i_stdlib I_STDLIB
14730 #include <stdlib.h>
14732 #include <signal.h>
14735 ivfprintf(FILE *f, const char *fmt, va_list *valp)
14737 return vfprintf(f, fmt, *valp);
14741 myvfprintf(FILE *f, const char *fmt, va_list val)
14743 return ivfprintf(f, fmt, &val);
14747 myprintf(char *fmt, ...)
14750 va_start(val, fmt);
14751 return myvfprintf(stdout, fmt, val);
14755 main(int ac, char **av)
14757 signal(SIGSEGV, exit);
14759 myprintf("%s%cs all right, then\n", "that", '\'');
14764 if eval $compile && $run ./try 2>&1 >/dev/null; then
14765 case "`$run ./try`" in
14766 "that's all right, then")
14772 yes) echo "It seems that you don't need va_copy()." >&4
14773 need_va_copy="$undef"
14775 *) echo "It seems that va_copy() or similar will be needed." >&4
14776 need_va_copy="$define"
14779 $rm -f try.* core core.* *.core *.core.*
14781 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
14785 : define a fucntion to check prototypes
14786 $cat > protochk <<EOSH
14789 optimize="$optimize"
14791 prototype="$prototype"
14796 $cat >> protochk <<'EOSH'
14801 while test $# -ge 2; do
14803 $define) echo "#include <$2>" >> try.c ;;
14804 literal) echo "$2" >> try.c ;;
14808 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
14809 cat >> try.c <<'EOCP'
14810 #ifdef CAN_PROTOTYPE
14811 #define _(args) args
14816 echo "$foo" >> try.c
14817 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
14818 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
14824 $eunicefix protochk
14826 : see what type is used for size_t
14827 rp="What is the type used for the length parameter for string functions?"
14828 set size_t sizetype 'unsigned int' stdio.h sys/types.h
14831 : check for type of arguments to gethostbyaddr.
14832 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
14833 case "$d_gethbyaddr" in
14837 Checking to see what type of arguments are accepted by gethostbyaddr().
14839 hdrs="$define sys/types.h
14840 $d_socket sys/socket.h
14841 $i_niin netinet/in.h
14843 $i_unistd unistd.h"
14844 : The first arg can 'char *' or 'void *'
14845 : The second arg is some of integral type
14846 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
14847 for yyy in size_t long int; do
14848 case "$netdb_host_type" in
14849 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
14850 if ./protochk "$try" $hdrs; then
14851 echo "Your system accepts $xxx for the first arg."
14852 echo "...and $yyy for the second arg."
14853 netdb_host_type="$xxx"
14854 netdb_hlen_type="$yyy"
14860 : In case none of those worked, prompt the user.
14861 case "$netdb_host_type" in
14862 '') rp='What is the type for the 1st argument to gethostbyaddr?'
14865 netdb_host_type=$ans
14866 rp='What is the type for the 2nd argument to gethostbyaddr?'
14869 netdb_hlen_type=$ans
14873 *) : no gethostbyaddr, so pick harmless defaults
14874 netdb_host_type='char *'
14875 netdb_hlen_type="$sizetype"
14878 # Remove the "const" if needed. -- but then we'll have a
14880 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
14883 : check for type of argument to gethostbyname.
14884 if test "X$netdb_name_type" = X ; then
14885 case "$d_gethbyname" in
14889 Checking to see what type of argument is accepted by gethostbyname().
14891 hdrs="$define sys/types.h
14892 $d_socket sys/socket.h
14893 $i_niin netinet/in.h
14895 $i_unistd unistd.h"
14896 for xxx in "const char *" "char *"; do
14897 case "$netdb_name_type" in
14898 '') try="extern struct hostent *gethostbyname($xxx);"
14899 if ./protochk "$try" $hdrs; then
14900 echo "Your system accepts $xxx."
14901 netdb_name_type="$xxx"
14906 : In case none of those worked, prompt the user.
14907 case "$netdb_name_type" in
14908 '') rp='What is the type for the 1st argument to gethostbyname?'
14911 netdb_name_type=$ans
14915 *) : no gethostbyname, so pick harmless default
14916 netdb_name_type='char *'
14921 : check for type of 1st argument to getnetbyaddr.
14922 if test "X$netdb_net_type" = X ; then
14923 case "$d_getnbyaddr" in
14927 Checking to see what type of 1st argument is accepted by getnetbyaddr().
14929 hdrs="$define sys/types.h
14930 $d_socket sys/socket.h
14931 $i_niin netinet/in.h
14933 $i_unistd unistd.h"
14934 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
14935 case "$netdb_net_type" in
14936 '') try="extern struct netent *getnetbyaddr($xxx, int);"
14937 if ./protochk "$try" $hdrs; then
14938 echo "Your system accepts $xxx."
14939 netdb_net_type="$xxx"
14944 : In case none of those worked, prompt the user.
14945 case "$netdb_net_type" in
14946 '') rp='What is the type for the 1st argument to getnetbyaddr?'
14949 netdb_net_type=$ans
14953 *) : no getnetbyaddr, so pick harmless default
14954 netdb_net_type='long'
14958 : locate the preferred pager for this system
14964 [a-zA-Z]:/*) dflt=$pg;;
14968 [a-zA-Z]:/*) dflt=$more;;
14972 [a-zA-Z]:/*) dflt=$less;;
14975 '') dflt=/usr/ucb/more;;
14982 rp='What pager is used on your system?'
14986 : see what type pids are declared as in the kernel
14987 rp="What is the type of process ids on this system?"
14988 set pid_t pidtype int stdio.h sys/types.h
14991 : Find earliest binary compatible site_perl subdirectory perl can use.
14992 case "$bincompat5005" in
14993 "$define") xs_apiversion='5.005' ;;
14994 *) xs_apiversion=$version ;; # The current site_perl version.
14996 : Find earliest pure perl site_perl subdirectory perl can use.
14997 : The versioned directories started at 5.005.
14998 pm_apiversion='5.005'
15000 : see if ar generates random libraries by itself
15002 echo "Checking how to generate random libraries on your machine..." >&4
15003 echo 'int bar1() { return bar2(); }' > bar1.c
15004 echo 'int bar2() { return 2; }' > bar2.c
15005 $cat > foo.c <<'EOP'
15006 int main() { printf("%d\n", bar1()); exit(0); }
15008 $cc $ccflags -c bar1.c >/dev/null 2>&1
15009 $cc $ccflags -c bar2.c >/dev/null 2>&1
15010 $cc $ccflags -c foo.c >/dev/null 2>&1
15011 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
15012 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
15013 $run ./foobar >/dev/null 2>&1; then
15014 echo "$ar appears to generate random libraries itself."
15017 elif $ar ts bar$_a >/dev/null 2>&1 &&
15018 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
15019 $run ./foobar >/dev/null 2>&1; then
15020 echo "a table of contents needs to be added with '$ar ts'."
15027 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
15028 $test -f $ranlib || ranlib=''
15031 if $test -n "$ranlib"; then
15032 echo "your system has '$ranlib'; we'll use that."
15035 echo "your system doesn't seem to support random libraries"
15036 echo "so we'll use lorder and tsort to order the libraries."
15043 : check for type of arguments to select.
15044 case "$selecttype" in
15045 '') case "$d_select" in
15049 Checking to see what type of arguments are accepted by select().
15051 hdrs="$define sys/types.h
15052 $i_systime sys/time.h
15053 $i_sysselct sys/select.h
15054 $d_socket sys/socket.h"
15055 : The first arg can be int, unsigned, or size_t
15056 : The last arg may or may not be 'const'
15058 : void pointer has been seen but using that
15059 : breaks the selectminbits test
15060 for xxx in 'fd_set *' 'int *'; do
15061 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
15062 for tmo in 'struct timeval *' 'const struct timeval *'; do
15064 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
15065 if ./protochk "$try" $hdrs; then
15066 echo "Your system accepts $xxx."
15075 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
15076 case "$d_fd_set" in
15077 $define) dflt="fd_set *" ;;
15086 *) : no select, so pick a harmless default
15093 : check for the select 'width'
15094 case "$selectminbits" in
15095 '') case "$d_select" in
15099 Checking to see on how many bits at a time your select() operates...
15102 #include <sys/types.h>
15104 #$i_systime I_SYS_TIME
15105 #$i_systimek I_SYS_TIME_KERNEL
15110 # ifdef I_SYS_TIME_KERNEL
15113 # include <sys/time.h>
15114 # ifdef I_SYS_TIME_KERNEL
15118 #$i_sysselct I_SYS_SELECT
15119 #ifdef I_SYS_SELECT
15120 #include <sys/select.h>
15122 #$d_socket HAS_SOCKET
15124 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
15128 #define S sizeof(*(b))
15130 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
15131 #define NBITS (NBYTES * 8)
15140 fp = fopen("try.c", "r");
15146 b = ($selecttype)s;
15147 for (i = 0; i < NBITS; i++)
15151 select(fd + 1, b, 0, 0, &t);
15152 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
15153 printf("%d\n", i + 1);
15158 if eval $compile_ok; then
15159 selectminbits=`$run ./try`
15160 case "$selectminbits" in
15162 Cannot figure out on how many bits at a time your select() operates.
15163 I'll play safe and guess it is 32 bits.
15169 *) bits="$selectminbits bits" ;;
15171 echo "Your select() operates on $bits at a time." >&4
15173 rp='What is the minimum number of bits your select() operates on?'
15174 case "$byteorder" in
15175 1234|12345678) dflt=32 ;;
15180 selectminbits="$val"
15184 *) : no select, so pick a harmless default
15191 : Trace out the files included by signal.h, then look for SIGxxx names.
15192 : Remove SIGARRAYSIZE used by HPUX.
15193 : Remove SIGSTKSIZE used by Linux.
15194 : Remove SIGSTKSZ used by Posix.
15195 : Remove SIGTYP void lines used by OS2.
15196 : Some cpps, like os390, dont give the file name anywhere
15197 if [ "X$fieldn" = X ]; then
15198 : Just make some guesses. We check them later.
15199 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
15201 xxx=`echo '#include <signal.h>' |
15202 $cppstdin $cppminus $cppflags 2>/dev/null |
15203 $grep '^[ ]*#.*include' |
15204 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
15206 : Check this list of files to be sure we have parsed the cpp output ok.
15207 : This will also avoid potentially non-existent files, such
15210 for xx in $xxx /dev/null ; do
15211 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
15213 : If we have found no files, at least try signal.h
15214 case "$xxxfiles" in
15215 '') xxxfiles=`./findhdr signal.h` ;;
15218 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
15219 print substr($2, 4, 20)
15221 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
15222 print substr($3, 4, 20)
15224 : Append some common names just in case the awk scan failed.
15225 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
15226 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
15227 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
15228 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
15229 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
15231 : generate a few handy files for later
15232 $cat > signal.c <<'EOCP'
15233 #include <sys/types.h>
15234 #include <signal.h>
15238 /* Strange style to avoid deeply-nested #if/#else/#endif */
15241 # define NSIG (_NSIG)
15247 # define NSIG (SIGMAX+1)
15253 # define NSIG (SIG_MAX+1)
15259 # define NSIG (MAXSIG+1)
15265 # define NSIG (MAX_SIG+1)
15270 # ifdef SIGARRAYSIZE
15271 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
15277 # define NSIG (_sys_nsig) /* Solaris 2.5 */
15281 /* Default to some arbitrary number that's big enough to get most
15282 of the common signals.
15288 printf("NSIG %d\n", NSIG);
15294 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
15296 printf "#ifdef SIG"; printf $1; printf "\n"
15297 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
15298 printf $1; printf ");\n"
15302 printf "#endif /* JUST_NSIG */\n";
15303 printf "exit(0);\n}\n";
15306 $cat >signal.awk <<'EOP'
15307 BEGIN { ndups = 0 }
15308 $1 ~ /^NSIG$/ { nsig = $2 }
15309 ($1 !~ /^NSIG$/) && (NF == 2) {
15310 if ($2 > maxsig) { maxsig = $2 }
15311 if (sig_name[$2]) {
15312 dup_name[ndups] = $1
15313 dup_num[ndups] = $2
15325 printf("NSIG %d\n", nsig);
15326 for (n = 1; n < nsig; n++) {
15328 printf("%s %d\n", sig_name[n], sig_num[n])
15331 printf("NUM%d %d\n", n, n)
15334 for (n = 0; n < ndups; n++) {
15335 printf("%s %d\n", dup_name[n], dup_num[n])
15339 $cat >signal_cmd <<EOS
15341 if $test -s signal.lst; then
15342 echo "Using your existing signal.lst file"
15347 $cat >>signal_cmd <<'EOS'
15350 if eval $compile_ok; then
15351 $run ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
15353 echo "(I can't seem be able to compile the whole test program)" >&4
15354 echo "(I'll try it in little pieces.)" >&4
15355 set signal -DJUST_NSIG
15356 if eval $compile_ok; then
15357 $run ./signal$_exe > signal.nsg
15360 echo "I can't seem to figure out how many signals you have." >&4
15361 echo "Guessing 50." >&4
15362 echo 'NSIG 50' > signal.nsg
15364 : Now look at all the signal names, one at a time.
15365 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
15366 $cat > signal.c <<EOCP
15367 #include <sys/types.h>
15368 #include <signal.h>
15371 printf("$xx %d\n", SIG${xx});
15376 if eval $compile; then
15377 echo "SIG${xx} found."
15378 $run ./signal$_exe >> signal.ls1
15380 echo "SIG${xx} NOT found."
15383 if $test -s signal.ls1; then
15384 $cat signal.nsg signal.ls1 |
15385 $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
15389 if $test -s signal.lst; then
15392 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
15393 echo 'kill -l' >signal
15394 set X `csh -f <signal`
15398 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
15400 echo $@ | $tr ' ' $trnl | \
15401 $awk '{ printf "%s %d\n", $1, ++s; }
15402 END { printf "NSIG %d\n", ++s }' >signal.lst
15404 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
15406 chmod a+x signal_cmd
15407 $eunicefix signal_cmd
15409 : generate list of signal names
15411 case "$sig_name_init" in
15413 *) case "$sig_num_init" in
15414 ''|*,*) doinit=yes ;;
15419 echo "Generating a list of signal names and numbers..." >&4
15421 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
15422 sig_name=`$awk 'BEGIN { printf "ZERO " }
15423 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
15424 sig_num=`$awk 'BEGIN { printf "0 " }
15425 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
15426 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
15427 !/^NSIG/ { printf "\"%s\", ", $1 }
15428 END { printf "0\n" }' signal.lst`
15429 sig_num_init=`$awk 'BEGIN { printf "0, " }
15430 !/^NSIG/ { printf "%d, ", $2}
15431 END { printf "0\n"}' signal.lst`
15434 echo "The following $sig_count signals are available:"
15436 echo $sig_name | $awk \
15437 'BEGIN { linelen = 0 }
15439 for (i = 1; i <= NF; i++) {
15440 name = "SIG" $i " "
15441 linelen = linelen + length(name)
15442 if (linelen > 70) {
15444 linelen = length(name)
15450 sig_size=`echo $sig_name | awk '{print NF}'`
15451 $rm -f signal signal.c signal.awk signal.lst signal_cmd
15454 case "$sizetype" in
15455 *_t) zzz="$sizetype" ;;
15456 *) zzz="filesize" ;;
15458 echo "Checking the size of $zzz..." >&4
15460 #include <sys/types.h>
15463 printf("%d\n", (int)sizeof($sizetype));
15468 if eval $compile_ok; then
15472 echo "(I can't execute the test program--guessing $sizesize.)" >&4
15475 echo "Your $zzz size is $sizesize bytes."
15480 echo "(I can't compile the test program--guessing $sizesize.)" >&4
15484 : check for socklen_t
15486 echo "Checking to see if you have socklen_t..." >&4
15488 #include <sys/types.h>
15489 #$d_socket HAS_SOCKET
15491 #include <sys/socket.h>
15493 int main() { socklen_t x = 16; }
15496 if eval $compile; then
15498 echo "You have socklen_t."
15501 echo "You do not have socklen_t."
15502 case "$sizetype" in
15503 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
15510 : see if this is a socks.h system
15511 set socks.h i_socks
15514 : check for type of the size argument to socket calls
15515 case "$d_socket" in
15519 Checking to see what type is the last argument of accept().
15522 case "$d_socklen_t" in
15523 "$define") yyy="$yyy socklen_t"
15525 yyy="$yyy $sizetype int long unsigned"
15526 for xxx in $yyy; do
15527 case "$socksizetype" in
15528 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
15529 case "$usesocks" in
15531 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
15532 echo "Your system accepts '$xxx *' for the last argument of accept()."
15533 socksizetype="$xxx"
15536 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
15537 echo "Your system accepts '$xxx *' for the last argument of accept()."
15538 socksizetype="$xxx"
15545 : In case none of those worked, prompt the user.
15546 case "$socksizetype" in
15547 '') rp='What is the type for socket address structure sizes?'
15554 *) : no sockets, so pick relatively harmless default
15559 : see what type is used for signed size_t
15560 set ssize_t ssizetype int stdio.h sys/types.h
15565 #include <sys/types.h>
15566 #define Size_t $sizetype
15567 #define SSize_t $dflt
15570 if (sizeof(Size_t) == sizeof(SSize_t))
15572 else if (sizeof(Size_t) == sizeof(int))
15581 if eval $compile_ok && $run ./try > /dev/null; then
15582 ssizetype=`$run ./try`
15583 echo "I'll be using $ssizetype for functions returning a byte count." >&4
15586 Help! I can't compile and run the ssize_t test program: please enlighten me!
15587 (This is probably a misconfiguration in your system or libraries, and
15588 you really ought to fix it. Still, I'll try anyway.)
15590 I need a type that is the same size as $sizetype, but is guaranteed to
15591 be signed. Common values are ssize_t, int and long.
15594 rp="What signed type is the same size as $sizetype?"
15600 : see what type of char stdio uses.
15602 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
15603 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
15604 echo "Your stdio uses unsigned chars." >&4
15605 stdchar="unsigned char"
15607 echo "Your stdio uses signed chars." >&4
15614 : see if time exists
15616 if test "X$d_time" = X -o X"$timetype" = X; then
15617 if set time val -f d_time; eval $csym; $val; then
15618 echo 'time() found.' >&4
15620 rp="What is the type returned by time() on this system?"
15621 set time_t timetype long stdio.h sys/types.h
15624 echo 'time() not found, hope that will do.' >&4
15632 : see what type uids are declared as in the kernel
15634 echo "Looking for the type for user ids returned by getuid()."
15635 set uid_t uidtype xxx stdio.h sys/types.h
15639 xxx=`./findhdr sys/user.h`
15640 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
15642 unsigned) dflt="$1 $2" ;;
15646 *) dflt="$uidtype";;
15649 uid_t) echo "uid_t found." ;;
15650 *) rp="What is the type for user ids returned by getuid()?"
15658 *_t) zzz="$uidtype" ;;
15661 echo "Checking the size of $zzz..." >&4
15663 #include <sys/types.h>
15666 printf("%d\n", (int)sizeof($uidtype));
15671 if eval $compile_ok; then
15675 echo "(I can't execute the test program--guessing $uidsize.)" >&4
15678 echo "Your $zzz is $uidsize bytes long."
15683 echo "(I can't compile the test program--guessing $uidsize.)" >&4
15688 *_t) zzz="$uidtype" ;;
15691 echo "Checking the sign of $zzz..." >&4
15693 #include <sys/types.h>
15704 if eval $compile; then
15708 echo "(I can't execute the test program--guessing unsigned.)" >&4
15712 1) echo "Your $zzz is unsigned." ;;
15713 -1) echo "Your $zzz is signed." ;;
15719 echo "(I can't compile the test program--guessing unsigned.)" >&4
15725 $echo "Checking the format string to be used for uids..." >&4
15728 -1) if $test X"$uidsize" = X"$ivsize"; then
15729 uidformat="$ivdformat"
15731 if $test X"$uidsize" = X"$longsize"; then
15734 if $test X"$uidsize" = X"$intsize"; then
15737 if $test X"$uidsize" = X"$shortsize"; then
15744 *) if $test X"$uidsize" = X"$uvsize"; then
15745 uidformat="$uvuformat"
15747 if $test X"$uidsize" = X"$longsize"; then
15750 if $test X"$uidsize" = X"$intsize"; then
15753 if $test X"$uidsize" = X"$shortsize"; then
15762 : determine compiler compiler
15771 if $test -f "$byacc"; then
15773 comp="byacc or $comp"
15775 if $test -f "$bison"; then
15776 comp="$comp or bison -y"
15778 rp="Which compiler compiler ($comp) shall I use?"
15787 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
15793 : see if fcntl.h is there
15798 : see if we can include fcntl.h
15804 echo "We'll be including <fcntl.h>." >&4
15807 if $h_sysfile; then
15808 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
15810 echo "We won't be including <fcntl.h>." >&4
15822 : see if this is a fp.h system
15826 : see if this is a fp_class.h system
15827 set fp_class.h i_fp_class
15830 : see if this is a iconv.h system
15831 set iconv.h i_iconv
15834 : see if this is a ieeefp.h system
15835 set ieeefp.h i_ieeefp
15838 : see if this is a libutil.h system
15839 set libutil.h i_libutil
15842 : see if locale.h is available
15843 set locale.h i_locale
15846 : see if mach cthreads are available
15847 if test "X$usethreads" = "X$define"; then
15848 set mach/cthreads.h i_machcthr
15851 i_machcthr="$undef"
15856 : see if this is a math.h system
15860 : see if this is a mntent.h system
15861 set mntent.h i_mntent
15864 : see if ndbm.h is available
15869 : see if dbm_open exists
15870 set dbm_open d_dbm_open
15872 case "$d_dbm_open" in
15875 echo "We won't be including <ndbm.h>"
15884 : see if net/errno.h is available
15886 set net/errno.h val
15889 : Unfortunately, it causes problems on some systems. Arrgh.
15892 cat > try.c <<'EOM'
15895 #include <net/errno.h>
15901 if $cc $ccflags -c try.c >/dev/null 2>&1; then
15902 echo "We'll be including <net/errno.h>." >&4
15904 echo "We won't be including <net/errno.h>." >&4
15913 : see if netinet/tcp.h is available
15914 set netinet/tcp.h i_netinettcp
15917 : see if this is a poll.h system
15921 : see if this is a prot.h system
15926 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
15927 $cat <<'EOSH' > Cppsym.know
15928 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
15929 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
15930 alliant alpha am29000 AM29000 AMD64 amiga AMIGAOS AMIX
15931 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
15932 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
15933 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
15934 bull c cadmus clipper CMU COFF COMPILER_VERSION
15935 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
15936 CYGWIN DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
15937 Dynix DynixPTX ELF encore EPI EXTENSIONS FILE_OFFSET_BITS
15938 FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
15939 GNU_SOURCE GNUC GNUC_MINOR GO32 gould GOULD_PN
15940 H3050R H3050RX hbullx20 hcx host_mips
15941 hp200 hp300 hp700 HP700 hp800 hp9000
15942 hp9000s200 hp9000s300 hp9000s400 hp9000s500
15943 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
15944 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
15945 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
15946 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
15947 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
15948 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
15949 Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
15950 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
15951 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
15952 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
15953 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
15954 MATH_HAS_NO_SIDE_EFFECTS
15955 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
15956 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
15957 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
15958 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
15959 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
15960 NetBSD news1500 news1700 news1800 news1900 news3700
15961 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
15962 ns32016 ns32332 ns32k nsc32000
15963 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
15964 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
15965 pc532 pdp11 PGC PIC plexus PORTAR posix
15966 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
15967 POSIX_C_SOURCE POSIX_SOURCE POWER
15968 PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
15969 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
15970 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
15971 sony sony_news sonyrisc sparc sparclite spectrum
15972 stardent stdc STDC_EXT stratos sun sun3 sun386
15973 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
15974 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
15975 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
15976 sysV68 sysV88 Tek4132 Tek4300 titan
15977 TM3200 TM5400 TM5600
15978 tower tower32 tower32_200 tower32_600 tower32_700
15979 tower32_800 tower32_850 tss
15980 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
15981 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
15982 unix UNIX95 UNIX99 unixpc unos USGr4 USGr4_2
15983 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms xenix Xenix286
15984 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
15985 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
15988 # Maybe put other stuff here too.
15989 cat <<EOSH >>Cppsym.know
15992 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
15993 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
15994 $cat Cppsym.know > Cppsym.c
15995 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
15996 $rm -f Cppsym.a Cppsym.b Cppsym.c
15997 cat <<EOSH > Cppsym
15999 if $test \$# -gt 0; then
16000 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
16001 if $test -s Cppsym.got; then
16008 $tr " " "$trnl" | ./Cppsym.try
16014 cat <<EOSH > Cppsym.try
16016 cat <<'EOCP' > try.c
16022 cat <<'EOSH' >> Cppsym.try
16024 printf "#ifdef %s\n#if %s+0\nprintf(\"%s=%%ld\\n\", (long)%s);\n#else\nprintf(\"%s\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1
16025 printf "#ifdef _%s\n#if _%s+0\nprintf(\"_%s=%%ld\\n\", (long)_%s);\n#else\nprintf(\"_%s\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1
16026 printf "#ifdef __%s\n#if __%s+0\nprintf(\"__%s=%%ld\\n\", (long)__%s);\n#else\nprintf(\"__%s\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1
16027 printf "#ifdef __%s__\n#if __%s__+0\nprintf(\"__%s__=%%ld\\n\", (long)__%s__);\n#else\nprintf(\"__%s__\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1
16029 echo 'return 0;}' >> try.c
16031 cat <<EOSH >> Cppsym.try
16033 case "$osname-$gccversion" in
16034 irix-) ccflags="\$ccflags -woff 1178" ;;
16035 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
16037 $cc -o try $optimize \$ccflags $ldflags try.c $libs && $run ./try
16039 chmod +x Cppsym.try
16040 $eunicefix Cppsym.try
16041 ./Cppsym < Cppsym.know > Cppsym.true
16042 : now check the C compiler for additional symbols
16043 postprocess_cc_v=''
16045 aix) postprocess_cc_v="|$tr , ' '" ;;
16052 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
16055 -D*) echo "\$i" | $sed 's/^-D//';;
16056 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
16061 postprocess_cc_v=''
16064 ./ccsym > ccsym1.raw
16065 if $test -s ccsym1.raw; then
16066 $sort ccsym1.raw | $uniq >ccsym.raw
16068 mv ccsym1.raw ccsym.raw
16071 $awk '/\=/ { print $0; next }
16072 { print $0"=1" }' ccsym.raw >ccsym.list
16073 $awk '/\=/ { print $0; next }
16074 { print $0"=1" }' Cppsym.true >ccsym.true
16075 $comm -13 ccsym.true ccsym.list >ccsym.own
16076 $comm -12 ccsym.true ccsym.list >ccsym.com
16077 $comm -23 ccsym.true ccsym.list >ccsym.cpp
16079 if $test -z ccsym.raw; then
16080 echo "Your C compiler doesn't seem to define any symbols!" >&4
16082 echo "However, your C preprocessor defines the following symbols:"
16085 cppsymbols=`$cat Cppsym.true`
16086 cppsymbols=`echo $cppsymbols`
16087 cppccsymbols="$cppsymbols"
16089 if $test -s ccsym.com; then
16090 echo "Your C compiler and pre-processor define these symbols:"
16091 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
16094 cppccsymbols=`$cat ccsym.com`
16095 cppccsymbols=`echo $cppccsymbols`
16096 $test "$silent" || sleep 1
16098 if $test -s ccsym.cpp; then
16099 $test "$also" && echo " "
16100 echo "Your C pre-processor ${also}defines the following symbols:"
16101 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
16103 cppsymbols=`$cat ccsym.cpp`
16104 cppsymbols=`echo $cppsymbols`
16105 $test "$silent" || sleep 1
16107 if $test -s ccsym.own; then
16108 $test "$also" && echo " "
16109 echo "Your C compiler ${also}defines the following cpp symbols:"
16110 $sed -e 's/\(..*\)=1/\1/' ccsym.own
16111 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
16112 ccsymbols=`$cat ccsym.own`
16113 ccsymbols=`echo $ccsymbols`
16114 $test "$silent" || sleep 1
16118 : see if this is a termio system
16122 if $test `./findhdr termios.h`; then
16123 set tcsetattr i_termios
16129 "$define") echo "You have POSIX termios.h... good!" >&4;;
16130 *) if ./Cppsym pyr; then
16131 case "`/bin/universe`" in
16132 ucb) if $test `./findhdr sgtty.h`; then
16134 echo "<sgtty.h> found." >&4
16136 echo "System is pyramid with BSD universe."
16137 echo "<sgtty.h> not found--you could have problems." >&4
16139 *) if $test `./findhdr termio.h`; then
16141 echo "<termio.h> found." >&4
16143 echo "System is pyramid with USG universe."
16144 echo "<termio.h> not found--you could have problems." >&4
16148 if $test `./findhdr termio.h`; then
16149 echo "<termio.h> found." >&4
16151 elif $test `./findhdr sgtty.h`; then
16152 echo "<sgtty.h> found." >&4
16155 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
16158 if $test `./findhdr sgtty.h`; then
16159 echo "<sgtty.h> found." >&4
16161 elif $test `./findhdr termio.h`; then
16162 echo "<termio.h> found." >&4
16165 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
16169 set i_termio; eval $setvar
16170 val=$val2; set i_sgtty; eval $setvar
16171 val=$val3; set i_termios; eval $setvar
16173 : see if this is a shadow.h system
16174 set shadow.h i_shadow
16177 : see if stddef is available
16178 set stddef.h i_stddef
16181 : see if this is a sunmath.h system
16182 set sunmath.h i_sunmath
16185 : see if sys/access.h is available
16186 set sys/access.h i_sysaccess
16189 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
16190 set sys/filio.h i_sysfilio
16193 if $test `./findhdr sys/ioctl.h`; then
16195 echo '<sys/ioctl.h> found.' >&4
16198 if $test $i_sysfilio = "$define"; then
16199 echo '<sys/ioctl.h> NOT found.' >&4
16201 $test $i_sgtty = "$define" && xxx="sgtty.h"
16202 $test $i_termio = "$define" && xxx="termio.h"
16203 $test $i_termios = "$define" && xxx="termios.h"
16204 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
16210 : see if socket ioctl defs are in sys/sockio.h
16212 xxx=`./findhdr sys/sockio.h`
16213 if $test "$xxx"; then
16214 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
16216 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
16219 echo "No socket ioctls found in <sys/sockio.h>." >&4
16224 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
16231 : see if this is a syslog.h system
16232 set syslog.h i_syslog
16236 : see if this is a sys/mode.h system
16237 set sys/mode.h i_sysmode
16240 : see if sys/resource.h has to be included
16241 set sys/resource.h i_sysresrc
16244 : see if sys/security.h is available
16245 set sys/security.h i_syssecrt
16248 : see if this is a sys/statvfs.h system
16249 set sys/statvfs.h i_sysstatvfs
16252 : see if this is a sys/un.h system
16253 set sys/un.h i_sysun
16257 : see if this is a sys/utsname.h system
16258 set sys/utsname.h i_sysutsname
16261 : see if this is a syswait system
16262 set sys/wait.h i_syswait
16265 : see if this is a ustat.h system
16266 set ustat.h i_ustat
16269 : see if this is an utime system
16270 set utime.h i_utime
16273 : see if this is a values.h system
16274 set values.h i_values
16277 : see if this is a vfork system
16280 set vfork.h i_vfork
16288 : see if gdbm.h is available
16293 : see if gdbm_open exists
16294 set gdbm_open d_gdbm_open
16296 case "$d_gdbm_open" in
16299 echo "We won't be including <gdbm.h>"
16309 echo "Looking for extensions..." >&4
16310 : If we are using the old config.sh, known_extensions may contain
16311 : old or inaccurate or duplicate values.
16312 known_extensions=''
16313 nonxs_extensions=''
16314 : We do not use find because it might not be available.
16315 : We do not just use MANIFEST because the user may have dropped
16316 : some additional extensions into the source tree and expect them
16319 : Function to recursively find available extensions, ignoring DynaLoader
16320 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
16324 DynaLoader|dynaload) ;;
16326 if $test -f $xxx/$xxx.xs; then
16327 known_extensions="$known_extensions $1$xxx";
16328 elif $test -f $xxx/Makefile.PL; then
16329 nonxs_extensions="$nonxs_extensions $1$xxx";
16331 if $test -d $xxx -a $# -lt 10; then
16334 eval $find_extensions;
16346 eval $find_extensions
16347 set X $nonxs_extensions
16349 nonxs_extensions="$*"
16350 set X $known_extensions
16352 known_extensions="$*"
16355 : Now see which are supported on this system.
16357 for xxx in $known_extensions ; do
16361 $define) avail_ext="$avail_ext $xxx" ;;
16364 GDBM_File|gdbm_fil)
16366 $define) avail_ext="$avail_ext $xxx" ;;
16369 I18N/Langinfo|i18n_lan)
16370 case "$i_langinfo$d_nl_langinfo" in
16371 $define$define) avail_ext="$avail_ext $xxx" ;;
16374 NDBM_File|ndbm_fil)
16377 case "$osname-$use64bitint" in
16378 cygwin-*|hpux-define)
16380 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
16383 *) avail_ext="$avail_ext $xxx" ;;
16388 ODBM_File|odbm_fil)
16389 case "${i_dbm}${i_rpcsvcdbm}" in
16391 case "$osname-$use64bitint" in
16392 cygwin-*|hpux-define)
16394 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
16397 *) avail_ext="$avail_ext $xxx" ;;
16403 case "$useposix" in
16404 true|define|y) avail_ext="$avail_ext $xxx" ;;
16408 case "$useopcode" in
16409 true|define|y) avail_ext="$avail_ext $xxx" ;;
16413 case "$d_socket" in
16414 true|$define|y) avail_ext="$avail_ext $xxx" ;;
16417 Sys/Syslog|sys/syslog)
16418 : XXX syslog requires socket
16419 case "$d_socket" in
16420 true|$define|y) avail_ext="$avail_ext $xxx" ;;
16424 case "$usethreads" in
16426 case "$useithreads" in
16427 $undef|false|[nN]*) avail_ext="$avail_ext $xxx" ;;
16432 : XXX Do we need a useipcsysv variable here
16433 case "${d_msg}${d_sem}${d_shm}" in
16434 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
16437 *) avail_ext="$avail_ext $xxx"
16446 : Now see which nonxs extensions are supported on this system.
16447 : For now assume all are.
16449 for xxx in $nonxs_extensions ; do
16451 *) nonxs_ext="$nonxs_ext $xxx"
16463 A number of extensions are supplied with $package. You may choose to
16464 compile these extensions for dynamic loading (the default), compile
16465 them into the $package executable (static loading), or not include
16466 them at all. Answer "none" to include no extensions.
16467 Note that DynaLoader is always built and need not be mentioned here.
16470 case "$dynamic_ext" in
16471 '') dflt="$avail_ext" ;;
16472 *) dflt="$dynamic_ext"
16473 # Perhaps we are reusing an old out-of-date config.sh.
16476 if test X"$dynamic_ext" != X"$avail_ext"; then
16478 NOTICE: Your previous config.sh list may be incorrect.
16479 The extensions now available to you are
16481 but the default list from your previous config.sh is
16493 rp="What extensions do you wish to load dynamically?"
16496 none) dynamic_ext=' ' ;;
16497 *) dynamic_ext="$ans" ;;
16500 case "$static_ext" in
16502 : Exclude those already listed in dynamic linking
16504 for xxx in $avail_ext; do
16505 case " $dynamic_ext " in
16507 *) dflt="$dflt $xxx" ;;
16514 *) dflt="$static_ext"
16521 rp="What extensions do you wish to load statically?"
16524 none) static_ext=' ' ;;
16525 *) static_ext="$ans" ;;
16530 A number of extensions are supplied with $package. Answer "none"
16531 to include no extensions.
16532 Note that DynaLoader is always built and need not be mentioned here.
16535 case "$static_ext" in
16536 '') dflt="$avail_ext" ;;
16537 *) dflt="$static_ext"
16538 # Perhaps we are reusing an old out-of-date config.sh.
16541 if test X"$static_ext" != X"$avail_ext"; then
16543 NOTICE: Your previous config.sh list may be incorrect.
16544 The extensions now available to you are
16546 but the default list from your previous config.sh is
16555 : Exclude those that are not xs extensions
16559 rp="What extensions do you wish to include?"
16562 none) static_ext=' ' ;;
16563 *) static_ext="$ans" ;;
16568 set X $dynamic_ext $static_ext $nonxs_ext
16572 : Remove libraries needed only for extensions
16573 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
16574 : The exception is SunOS 4.x, which needs them.
16575 case "${osname}X${osvers}" in
16579 *) case "$usedl" in
16580 $define|true|[yY]*)
16581 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
16585 *) perllibs="$libs"
16591 : Remove build directory name from cppstdin so it can be used from
16592 : either the present location or the final installed location.
16594 : Get out of the UU directory to get correct path name.
16596 case "$cppstdin" in
16598 echo "Stripping down cppstdin path name"
16604 : end of configuration questions
16606 echo "End of configuration questions."
16609 : back to where it started
16610 if test -d ../UU; then
16614 : configuration may be patched via a 'config.over' file
16615 if $test -f config.over; then
16618 rp='I see a config.over file. Do you wish to load it?'
16621 n*) echo "OK, I'll ignore it.";;
16623 echo "Configuration override changes have been loaded."
16628 : in case they want portability, strip down executable paths
16629 case "$d_portable" in
16632 echo "Stripping down executable paths..." >&4
16633 for file in $loclist $trylist; do
16635 eval $file=`basename $temp`
16640 : create config.sh file
16642 echo "Creating config.sh..." >&4
16643 $spitshell <<EOT >config.sh
16646 # This file was produced by running the Configure script. It holds all the
16647 # definitions figured out by Configure. Should you modify one of these values,
16648 # do not forget to propagate your changes by running "Configure -der". You may
16649 # instead choose to run each of the .SH files by yourself, or "Configure -S".
16652 # Package name : $package
16653 # Source directory : $src
16654 # Configuration time: $cf_time
16655 # Configured by : $cf_by
16656 # Target system : $myuname
16666 Revision='$Revision'
16674 alignbytes='$alignbytes'
16675 ansi2knr='$ansi2knr'
16676 aphostname='$aphostname'
16677 api_revision='$api_revision'
16678 api_subversion='$api_subversion'
16679 api_version='$api_version'
16680 api_versionstring='$api_versionstring'
16683 archlibexp='$archlibexp'
16684 archname64='$archname64'
16685 archname='$archname'
16686 archobjs='$archobjs'
16691 bincompat5005='$bincompat5005'
16695 byteorder='$byteorder'
16697 castflags='$castflags'
16700 cccdlflags='$cccdlflags'
16701 ccdlflags='$ccdlflags'
16703 ccflags_uselargefiles='$ccflags_uselargefiles'
16705 ccsymbols='$ccsymbols'
16706 ccversion='$ccversion'
16708 cf_email='$cf_email'
16710 charsize='$charsize'
16714 clocktype='$clocktype'
16716 compress='$compress'
16717 contains='$contains'
16721 cpp_stuff='$cpp_stuff'
16722 cppccsymbols='$cppccsymbols'
16723 cppflags='$cppflags'
16725 cppminus='$cppminus'
16727 cppstdin='$cppstdin'
16728 cppsymbols='$cppsymbols'
16729 cryptlib='$cryptlib'
16731 d_Gconvert='$d_Gconvert'
16732 d_PRIEUldbl='$d_PRIEUldbl'
16733 d_PRIFUldbl='$d_PRIFUldbl'
16734 d_PRIGUldbl='$d_PRIGUldbl'
16735 d_PRIXU64='$d_PRIXU64'
16736 d_PRId64='$d_PRId64'
16737 d_PRIeldbl='$d_PRIeldbl'
16738 d_PRIfldbl='$d_PRIfldbl'
16739 d_PRIgldbl='$d_PRIgldbl'
16740 d_PRIi64='$d_PRIi64'
16741 d_PRIo64='$d_PRIo64'
16742 d_PRIu64='$d_PRIu64'
16743 d_PRIx64='$d_PRIx64'
16744 d_SCNfldbl='$d_SCNfldbl'
16745 d__fwalk='$d__fwalk'
16746 d_access='$d_access'
16747 d_accessx='$d_accessx'
16749 d_archlib='$d_archlib'
16752 d_attribut='$d_attribut'
16755 d_bincompat5005='$d_bincompat5005'
16757 d_bsdgetpgrp='$d_bsdgetpgrp'
16758 d_bsdsetpgrp='$d_bsdsetpgrp'
16760 d_casti32='$d_casti32'
16761 d_castneg='$d_castneg'
16762 d_charvspr='$d_charvspr'
16764 d_chroot='$d_chroot'
16765 d_chsize='$d_chsize'
16767 d_closedir='$d_closedir'
16768 d_cmsghdr_s='$d_cmsghdr_s'
16772 d_cuserid='$d_cuserid'
16773 d_dbl_dig='$d_dbl_dig'
16774 d_dbminitproto='$d_dbminitproto'
16775 d_difftime='$d_difftime'
16776 d_dirnamlen='$d_dirnamlen'
16777 d_dlerror='$d_dlerror'
16778 d_dlopen='$d_dlopen'
16779 d_dlsymun='$d_dlsymun'
16780 d_dosuid='$d_dosuid'
16781 d_drand48proto='$d_drand48proto'
16783 d_eaccess='$d_eaccess'
16784 d_endgrent='$d_endgrent'
16785 d_endhent='$d_endhent'
16786 d_endnent='$d_endnent'
16787 d_endpent='$d_endpent'
16788 d_endpwent='$d_endpwent'
16789 d_endsent='$d_endsent'
16790 d_eofnblk='$d_eofnblk'
16791 d_eunice='$d_eunice'
16792 d_fchdir='$d_fchdir'
16793 d_fchmod='$d_fchmod'
16794 d_fchown='$d_fchown'
16796 d_fcntl_can_lock='$d_fcntl_can_lock'
16797 d_fd_macros='$d_fd_macros'
16798 d_fd_set='$d_fd_set'
16799 d_fds_bits='$d_fds_bits'
16800 d_fgetpos='$d_fgetpos'
16801 d_finite='$d_finite'
16802 d_finitel='$d_finitel'
16803 d_flexfnam='$d_flexfnam'
16805 d_flockproto='$d_flockproto'
16807 d_fp_class='$d_fp_class'
16808 d_fpathconf='$d_fpathconf'
16809 d_fpclass='$d_fpclass'
16810 d_fpclassify='$d_fpclassify'
16811 d_fpclassl='$d_fpclassl'
16812 d_fpos64_t='$d_fpos64_t'
16813 d_frexpl='$d_frexpl'
16814 d_fs_data_s='$d_fs_data_s'
16815 d_fseeko='$d_fseeko'
16816 d_fsetpos='$d_fsetpos'
16817 d_fstatfs='$d_fstatfs'
16818 d_fstatvfs='$d_fstatvfs'
16820 d_ftello='$d_ftello'
16822 d_getcwd='$d_getcwd'
16823 d_getespwnam='$d_getespwnam'
16824 d_getfsstat='$d_getfsstat'
16825 d_getgrent='$d_getgrent'
16826 d_getgrps='$d_getgrps'
16827 d_gethbyaddr='$d_gethbyaddr'
16828 d_gethbyname='$d_gethbyname'
16829 d_gethent='$d_gethent'
16830 d_gethname='$d_gethname'
16831 d_gethostprotos='$d_gethostprotos'
16832 d_getitimer='$d_getitimer'
16833 d_getlogin='$d_getlogin'
16834 d_getmnt='$d_getmnt'
16835 d_getmntent='$d_getmntent'
16836 d_getnbyaddr='$d_getnbyaddr'
16837 d_getnbyname='$d_getnbyname'
16838 d_getnent='$d_getnent'
16839 d_getnetprotos='$d_getnetprotos'
16840 d_getpagsz='$d_getpagsz'
16841 d_getpbyname='$d_getpbyname'
16842 d_getpbynumber='$d_getpbynumber'
16843 d_getpent='$d_getpent'
16844 d_getpgid='$d_getpgid'
16845 d_getpgrp2='$d_getpgrp2'
16846 d_getpgrp='$d_getpgrp'
16847 d_getppid='$d_getppid'
16848 d_getprior='$d_getprior'
16849 d_getprotoprotos='$d_getprotoprotos'
16850 d_getprpwnam='$d_getprpwnam'
16851 d_getpwent='$d_getpwent'
16852 d_getsbyname='$d_getsbyname'
16853 d_getsbyport='$d_getsbyport'
16854 d_getsent='$d_getsent'
16855 d_getservprotos='$d_getservprotos'
16856 d_getspnam='$d_getspnam'
16857 d_gettimeod='$d_gettimeod'
16858 d_gnulibc='$d_gnulibc'
16859 d_grpasswd='$d_grpasswd'
16860 d_hasmntopt='$d_hasmntopt'
16864 d_inetaton='$d_inetaton'
16865 d_int64_t='$d_int64_t'
16866 d_isascii='$d_isascii'
16867 d_isfinite='$d_isfinite'
16870 d_isnanl='$d_isnanl'
16871 d_killpg='$d_killpg'
16872 d_lchown='$d_lchown'
16873 d_ldbl_dig='$d_ldbl_dig'
16875 d_locconv='$d_locconv'
16877 d_longdbl='$d_longdbl'
16878 d_longlong='$d_longlong'
16879 d_lseekproto='$d_lseekproto'
16881 d_madvise='$d_madvise'
16883 d_mbstowcs='$d_mbstowcs'
16884 d_mbtowc='$d_mbtowc'
16885 d_memchr='$d_memchr'
16886 d_memcmp='$d_memcmp'
16887 d_memcpy='$d_memcpy'
16888 d_memmove='$d_memmove'
16889 d_memset='$d_memset'
16891 d_mkdtemp='$d_mkdtemp'
16892 d_mkfifo='$d_mkfifo'
16893 d_mkstemp='$d_mkstemp'
16894 d_mkstemps='$d_mkstemps'
16895 d_mktime='$d_mktime'
16898 d_modfl_pow32_bug='$d_modfl_pow32_bug'
16899 d_mprotect='$d_mprotect'
16901 d_msg_ctrunc='$d_msg_ctrunc'
16902 d_msg_dontroute='$d_msg_dontroute'
16903 d_msg_oob='$d_msg_oob'
16904 d_msg_peek='$d_msg_peek'
16905 d_msg_proxy='$d_msg_proxy'
16906 d_msgctl='$d_msgctl'
16907 d_msgget='$d_msgget'
16908 d_msghdr_s='$d_msghdr_s'
16909 d_msgrcv='$d_msgrcv'
16910 d_msgsnd='$d_msgsnd'
16912 d_munmap='$d_munmap'
16913 d_mymalloc='$d_mymalloc'
16915 d_nl_langinfo='$d_nl_langinfo'
16916 d_nv_preserves_uv='$d_nv_preserves_uv'
16917 d_nv_preserves_uv_bits='$d_nv_preserves_uv_bits'
16918 d_off64_t='$d_off64_t'
16919 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
16920 d_oldpthreads='$d_oldpthreads'
16921 d_oldsock='$d_oldsock'
16923 d_pathconf='$d_pathconf'
16925 d_perl_otherlibdirs='$d_perl_otherlibdirs'
16926 d_phostname='$d_phostname'
16929 d_portable='$d_portable'
16930 d_pthread_atfork='$d_pthread_atfork'
16931 d_pthread_yield='$d_pthread_yield'
16933 d_pwchange='$d_pwchange'
16934 d_pwclass='$d_pwclass'
16935 d_pwcomment='$d_pwcomment'
16936 d_pwexpire='$d_pwexpire'
16937 d_pwgecos='$d_pwgecos'
16938 d_pwpasswd='$d_pwpasswd'
16939 d_pwquota='$d_pwquota'
16942 d_readdir='$d_readdir'
16943 d_readlink='$d_readlink'
16945 d_recvmsg='$d_recvmsg'
16946 d_rename='$d_rename'
16947 d_rewinddir='$d_rewinddir'
16949 d_safebcpy='$d_safebcpy'
16950 d_safemcpy='$d_safemcpy'
16951 d_sanemcmp='$d_sanemcmp'
16952 d_sbrkproto='$d_sbrkproto'
16953 d_sched_yield='$d_sched_yield'
16954 d_scm_rights='$d_scm_rights'
16955 d_seekdir='$d_seekdir'
16956 d_select='$d_select'
16958 d_semctl='$d_semctl'
16959 d_semctl_semid_ds='$d_semctl_semid_ds'
16960 d_semctl_semun='$d_semctl_semun'
16961 d_semget='$d_semget'
16963 d_sendmsg='$d_sendmsg'
16964 d_setegid='$d_setegid'
16965 d_seteuid='$d_seteuid'
16966 d_setgrent='$d_setgrent'
16967 d_setgrps='$d_setgrps'
16968 d_sethent='$d_sethent'
16969 d_setitimer='$d_setitimer'
16970 d_setlinebuf='$d_setlinebuf'
16971 d_setlocale='$d_setlocale'
16972 d_setnent='$d_setnent'
16973 d_setpent='$d_setpent'
16974 d_setpgid='$d_setpgid'
16975 d_setpgrp2='$d_setpgrp2'
16976 d_setpgrp='$d_setpgrp'
16977 d_setprior='$d_setprior'
16978 d_setproctitle='$d_setproctitle'
16979 d_setpwent='$d_setpwent'
16980 d_setregid='$d_setregid'
16981 d_setresgid='$d_setresgid'
16982 d_setresuid='$d_setresuid'
16983 d_setreuid='$d_setreuid'
16984 d_setrgid='$d_setrgid'
16985 d_setruid='$d_setruid'
16986 d_setsent='$d_setsent'
16987 d_setsid='$d_setsid'
16988 d_setvbuf='$d_setvbuf'
16992 d_shmatprototype='$d_shmatprototype'
16993 d_shmctl='$d_shmctl'
16995 d_shmget='$d_shmget'
16996 d_sigaction='$d_sigaction'
16997 d_sigprocmask='$d_sigprocmask'
16998 d_sigsetjmp='$d_sigsetjmp'
16999 d_sockatmark='$d_sockatmark'
17000 d_sockatmarkproto='$d_sockatmarkproto'
17001 d_socket='$d_socket'
17002 d_socklen_t='$d_socklen_t'
17003 d_sockpair='$d_sockpair'
17004 d_socks5_init='$d_socks5_init'
17006 d_sresgproto='$d_sresgproto'
17007 d_sresuproto='$d_sresuproto'
17008 d_statblks='$d_statblks'
17009 d_statfs_f_flags='$d_statfs_f_flags'
17010 d_statfs_s='$d_statfs_s'
17011 d_statvfs='$d_statvfs'
17012 d_stdio_cnt_lval='$d_stdio_cnt_lval'
17013 d_stdio_ptr_lval='$d_stdio_ptr_lval'
17014 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
17015 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
17016 d_stdio_stream_array='$d_stdio_stream_array'
17017 d_stdiobase='$d_stdiobase'
17018 d_stdstdio='$d_stdstdio'
17019 d_strchr='$d_strchr'
17020 d_strcoll='$d_strcoll'
17021 d_strctcpy='$d_strctcpy'
17022 d_strerrm='$d_strerrm'
17023 d_strerror='$d_strerror'
17024 d_strftime='$d_strftime'
17025 d_strtod='$d_strtod'
17026 d_strtol='$d_strtol'
17027 d_strtold='$d_strtold'
17028 d_strtoll='$d_strtoll'
17029 d_strtoq='$d_strtoq'
17030 d_strtoul='$d_strtoul'
17031 d_strtoull='$d_strtoull'
17032 d_strtouq='$d_strtouq'
17033 d_strxfrm='$d_strxfrm'
17034 d_suidsafe='$d_suidsafe'
17035 d_symlink='$d_symlink'
17036 d_syscall='$d_syscall'
17037 d_syscallproto='$d_syscallproto'
17038 d_sysconf='$d_sysconf'
17039 d_sysernlst='$d_sysernlst'
17040 d_syserrlst='$d_syserrlst'
17041 d_system='$d_system'
17042 d_tcgetpgrp='$d_tcgetpgrp'
17043 d_tcsetpgrp='$d_tcsetpgrp'
17044 d_telldir='$d_telldir'
17045 d_telldirproto='$d_telldirproto'
17048 d_truncate='$d_truncate'
17049 d_tzname='$d_tzname'
17050 d_u32align='$d_u32align'
17051 d_ualarm='$d_ualarm'
17054 d_union_semun='$d_union_semun'
17055 d_unordered='$d_unordered'
17056 d_usleep='$d_usleep'
17057 d_usleepproto='$d_usleepproto'
17059 d_vendorarch='$d_vendorarch'
17060 d_vendorbin='$d_vendorbin'
17061 d_vendorlib='$d_vendorlib'
17063 d_void_closedir='$d_void_closedir'
17064 d_voidsig='$d_voidsig'
17065 d_voidtty='$d_voidtty'
17066 d_volatile='$d_volatile'
17067 d_vprintf='$d_vprintf'
17069 d_waitpid='$d_waitpid'
17070 d_wcstombs='$d_wcstombs'
17071 d_wctomb='$d_wctomb'
17072 d_writev='$d_writev'
17075 db_hashtype='$db_hashtype'
17076 db_prefixtype='$db_prefixtype'
17077 db_version_major='$db_version_major'
17078 db_version_minor='$db_version_minor'
17079 db_version_patch='$db_version_patch'
17080 defvoidused='$defvoidused'
17081 direntrytype='$direntrytype'
17084 doublesize='$doublesize'
17086 dynamic_ext='$dynamic_ext'
17092 eunicefix='$eunicefix'
17095 extensions='$extensions'
17097 fflushNULL='$fflushNULL'
17098 fflushall='$fflushall'
17100 firstmakefile='$firstmakefile'
17102 fpossize='$fpossize'
17103 fpostype='$fpostype'
17104 freetype='$freetype'
17107 full_csh='$full_csh'
17108 full_sed='$full_sed'
17109 gccosandvers='$gccosandvers'
17110 gccversion='$gccversion'
17111 gidformat='$gidformat'
17117 groupcat='$groupcat'
17118 groupstype='$groupstype'
17121 h_sysfile='$h_sysfile'
17132 i_arpainet='$i_arpainet'
17133 i_bsdioctl='$i_bsdioctl'
17136 i_dirent='$i_dirent'
17142 i_fp_class='$i_fp_class'
17146 i_ieeefp='$i_ieeefp'
17147 i_inttypes='$i_inttypes'
17148 i_langinfo='$i_langinfo'
17149 i_libutil='$i_libutil'
17150 i_limits='$i_limits'
17151 i_locale='$i_locale'
17152 i_machcthr='$i_machcthr'
17153 i_malloc='$i_malloc'
17155 i_memory='$i_memory'
17156 i_mntent='$i_mntent'
17159 i_neterrno='$i_neterrno'
17160 i_netinettcp='$i_netinettcp'
17164 i_pthread='$i_pthread'
17166 i_rpcsvcdbm='$i_rpcsvcdbm'
17169 i_shadow='$i_shadow'
17171 i_stdarg='$i_stdarg'
17172 i_stddef='$i_stddef'
17173 i_stdlib='$i_stdlib'
17174 i_string='$i_string'
17175 i_sunmath='$i_sunmath'
17176 i_sysaccess='$i_sysaccess'
17177 i_sysdir='$i_sysdir'
17178 i_sysfile='$i_sysfile'
17179 i_sysfilio='$i_sysfilio'
17181 i_sysioctl='$i_sysioctl'
17182 i_syslog='$i_syslog'
17183 i_sysmman='$i_sysmman'
17184 i_sysmode='$i_sysmode'
17185 i_sysmount='$i_sysmount'
17186 i_sysndir='$i_sysndir'
17187 i_sysparam='$i_sysparam'
17188 i_sysresrc='$i_sysresrc'
17189 i_syssecrt='$i_syssecrt'
17190 i_sysselct='$i_sysselct'
17191 i_syssockio='$i_syssockio'
17192 i_sysstat='$i_sysstat'
17193 i_sysstatfs='$i_sysstatfs'
17194 i_sysstatvfs='$i_sysstatvfs'
17195 i_systime='$i_systime'
17196 i_systimek='$i_systimek'
17197 i_systimes='$i_systimes'
17198 i_systypes='$i_systypes'
17199 i_sysuio='$i_sysuio'
17201 i_sysutsname='$i_sysutsname'
17202 i_sysvfs='$i_sysvfs'
17203 i_syswait='$i_syswait'
17204 i_termio='$i_termio'
17205 i_termios='$i_termios'
17207 i_unistd='$i_unistd'
17210 i_values='$i_values'
17211 i_varargs='$i_varargs'
17212 i_varhdr='$i_varhdr'
17214 ignore_versioned_solibs='$ignore_versioned_solibs'
17215 inc_version_list='$inc_version_list'
17216 inc_version_list_init='$inc_version_list_init'
17219 installarchlib='$installarchlib'
17220 installbin='$installbin'
17221 installman1dir='$installman1dir'
17222 installman3dir='$installman3dir'
17223 installprefix='$installprefix'
17224 installprefixexp='$installprefixexp'
17225 installprivlib='$installprivlib'
17226 installscript='$installscript'
17227 installsitearch='$installsitearch'
17228 installsitebin='$installsitebin'
17229 installsitelib='$installsitelib'
17230 installstyle='$installstyle'
17231 installusrbinperl='$installusrbinperl'
17232 installvendorarch='$installvendorarch'
17233 installvendorbin='$installvendorbin'
17234 installvendorlib='$installvendorlib'
17236 issymlink='$issymlink'
17237 ivdformat='$ivdformat'
17240 known_extensions='$known_extensions'
17243 lddlflags='$lddlflags'
17245 ldflags_uselargefiles='$ldflags_uselargefiles'
17246 ldlibpthname='$ldlibpthname'
17253 libsdirs='$libsdirs'
17254 libsfiles='$libsfiles'
17255 libsfound='$libsfound'
17256 libspath='$libspath'
17257 libswanted='$libswanted'
17258 libswanted_uselargefiles='$libswanted_uselargefiles'
17264 locincpth='$locincpth'
17265 loclibpth='$loclibpth'
17266 longdblsize='$longdblsize'
17267 longlongsize='$longlongsize'
17268 longsize='$longsize'
17272 lseeksize='$lseeksize'
17273 lseektype='$lseektype'
17277 make_set_make='$make_set_make'
17278 mallocobj='$mallocobj'
17279 mallocsrc='$mallocsrc'
17280 malloctype='$malloctype'
17282 man1direxp='$man1direxp'
17285 man3direxp='$man3direxp'
17287 mips_type='$mips_type'
17289 mmaptype='$mmaptype'
17290 modetype='$modetype'
17292 multiarch='$multiarch'
17294 myarchname='$myarchname'
17295 mydomain='$mydomain'
17296 myhostname='$myhostname'
17299 need_va_copy='$need_va_copy'
17300 netdb_hlen_type='$netdb_hlen_type'
17301 netdb_host_type='$netdb_host_type'
17302 netdb_name_type='$netdb_name_type'
17303 netdb_net_type='$netdb_net_type'
17306 nm_so_opt='$nm_so_opt'
17307 nonxs_ext='$nonxs_ext'
17309 nvEUformat='$nvEUformat'
17310 nvFUformat='$nvFUformat'
17311 nvGUformat='$nvGUformat'
17312 nveformat='$nveformat'
17313 nvfformat='$nvfformat'
17314 nvgformat='$nvgformat'
17317 o_nonblock='$o_nonblock'
17319 old_pthread_create_joinable='$old_pthread_create_joinable'
17320 optimize='$optimize'
17321 orderlib='$orderlib'
17324 otherlibdirs='$otherlibdirs'
17328 patchlevel='$patchlevel'
17329 path_sep='$path_sep'
17332 perl_patchlevel='$perl_patchlevel'
17333 perladmin='$perladmin'
17334 perllibs='$perllibs'
17335 perlpath='$perlpath'
17337 phostname='$phostname'
17340 pm_apiversion='$pm_apiversion'
17344 prefixexp='$prefixexp'
17346 privlibexp='$privlibexp'
17347 prototype='$prototype'
17349 quadkind='$quadkind'
17350 quadtype='$quadtype'
17351 randbits='$randbits'
17352 randfunc='$randfunc'
17353 randseedtype='$randseedtype'
17355 rd_nodata='$rd_nodata'
17356 revision='$revision'
17361 sPRIEUldbl='$sPRIEUldbl'
17362 sPRIFUldbl='$sPRIFUldbl'
17363 sPRIGUldbl='$sPRIGUldbl'
17364 sPRIXU64='$sPRIXU64'
17366 sPRIeldbl='$sPRIeldbl'
17367 sPRIfldbl='$sPRIfldbl'
17368 sPRIgldbl='$sPRIgldbl'
17373 sSCNfldbl='$sSCNfldbl'
17374 sched_yield='$sched_yield'
17375 scriptdir='$scriptdir'
17376 scriptdirexp='$scriptdirexp'
17378 seedfunc='$seedfunc'
17379 selectminbits='$selectminbits'
17380 selecttype='$selecttype'
17381 sendmail='$sendmail'
17384 sharpbang='$sharpbang'
17385 shmattype='$shmattype'
17386 shortsize='$shortsize'
17389 sig_count='$sig_count'
17390 sig_name='$sig_name'
17391 sig_name_init='$sig_name_init'
17393 sig_num_init='$sig_num_init'
17394 sig_size='$sig_size'
17395 signal_t='$signal_t'
17396 sitearch='$sitearch'
17397 sitearchexp='$sitearchexp'
17399 sitebinexp='$sitebinexp'
17401 sitelib_stem='$sitelib_stem'
17402 sitelibexp='$sitelibexp'
17403 siteprefix='$siteprefix'
17404 siteprefixexp='$siteprefixexp'
17405 sizesize='$sizesize'
17406 sizetype='$sizetype'
17410 sockethdr='$sockethdr'
17411 socketlib='$socketlib'
17412 socksizetype='$socksizetype'
17414 spackage='$spackage'
17415 spitshell='$spitshell'
17417 ssizetype='$ssizetype'
17418 startperl='$startperl'
17420 static_ext='$static_ext'
17422 stdio_base='$stdio_base'
17423 stdio_bufsiz='$stdio_bufsiz'
17424 stdio_cnt='$stdio_cnt'
17425 stdio_filbuf='$stdio_filbuf'
17426 stdio_ptr='$stdio_ptr'
17427 stdio_stream_array='$stdio_stream_array'
17430 subversion='$subversion'
17434 targetarch='$targetarch'
17438 timeincl='$timeincl'
17439 timetype='$timetype'
17453 uidformat='$uidformat'
17459 uquadtype='$uquadtype'
17460 use5005threads='$use5005threads'
17461 use64bitall='$use64bitall'
17462 use64bitint='$use64bitint'
17463 usecrosscompile='$usecrosscompile'
17465 useithreads='$useithreads'
17466 uselargefiles='$uselargefiles'
17467 uselongdouble='$uselongdouble'
17468 usemorebits='$usemorebits'
17469 usemultiplicity='$usemultiplicity'
17470 usemymalloc='$usemymalloc'
17472 useopcode='$useopcode'
17473 useperlio='$useperlio'
17474 useposix='$useposix'
17475 usereentrant='$usereentrant'
17477 useshrplib='$useshrplib'
17478 usesocks='$usesocks'
17479 usethreads='$usethreads'
17480 usevendorprefix='$usevendorprefix'
17481 usevfork='$usevfork'
17484 uvXUformat='$uvXUformat'
17485 uvoformat='$uvoformat'
17488 uvuformat='$uvuformat'
17489 uvxformat='$uvxformat'
17490 vendorarch='$vendorarch'
17491 vendorarchexp='$vendorarchexp'
17492 vendorbin='$vendorbin'
17493 vendorbinexp='$vendorbinexp'
17494 vendorlib='$vendorlib'
17495 vendorlib_stem='$vendorlib_stem'
17496 vendorlibexp='$vendorlibexp'
17497 vendorprefix='$vendorprefix'
17498 vendorprefixexp='$vendorprefixexp'
17500 version_patchlevel_string='$version_patchlevel_string'
17501 versiononly='$versiononly'
17503 voidflags='$voidflags'
17505 xs_apiversion='$xs_apiversion'
17507 yaccflags='$yaccflags'
17512 : Add in command line options if available
17513 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
17515 : add special variables
17516 $test -f $src/patchlevel.h && \
17517 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
17518 echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
17519 echo "PERL_CONFIG_SH=true" >>config.sh
17521 : propagate old symbols
17522 if $test -f UU/config.sh; then
17523 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
17524 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
17525 $sort | $uniq -u >UU/oldsyms
17526 set X `cat UU/oldsyms`
17532 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
17534 echo "# Variables propagated from previous config.sh file." >>config.sh
17535 for sym in `cat UU/oldsyms`; do
17536 echo " Propagating $hint variable "'$'"$sym..."
17537 eval 'tmp="$'"${sym}"'"'
17539 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
17545 : Finish up by extracting the .SH files
17549 echo "Extraction done."
17559 If you'd like to make any changes to the config.sh file before I begin
17560 to configure things, do it as a shell escape now (e.g. !vi config.sh).
17563 rp="Press return or use a shell escape to edit config.sh:"
17568 *) : in case they cannot read
17569 sh 1>&4 -c "$ans";;
17574 : if this fails, just run all the .SH files by hand
17583 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
17590 Now you need to generate make dependencies by running "$make depend".
17591 You might prefer to run it in background: "$make depend > makedepend.out &"
17592 It can take a while, so you might not want to run it right now.
17597 rp="Run $make depend now?"
17601 $make depend && echo "Now you must run '$make'."
17604 echo "You must run '$make depend' then '$make'."
17607 elif test -f [Mm]akefile; then
17609 echo "Now you must run a $make."
17611 echo "Configure done."
17614 if $test -f Policy.sh; then
17617 If you compile $package on a different machine or from a different object
17618 directory, copy the Policy.sh file from this object directory to the
17619 new one before you run Configure -- this will help you with most of
17620 the policy defaults.
17624 if $test -f config.msg; then
17625 echo "Hmm. I also noted the following information while running:"
17627 $cat config.msg >&4
17630 $rm -f kit*isdone ark*isdone