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 Nov 22 08:04:01 EET 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
68 case "X${MACHTYPE:-nonesuchmach}" in
76 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
77 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
78 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
79 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
80 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
81 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /usr/ccs/bin"
82 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
83 paths="$paths /sbin /usr/sbin /usr/libexec"
89 *) test -d $p && PATH=$PATH$p_$p ;;
96 : shall we be using ksh?
102 if (PATH=.; alias -x) >/dev/null 2>&1; then
105 if test -f /hp-ux -a -f /bin/ksh; then
106 needksh='to avoid sh bug in "here document" expansion'
108 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
109 if test X`/usr/bin/uname -v` = X4; then
110 avoidksh="to avoid AIX 4's /bin/sh"
114 if test -f /osf_boot -a -f /usr/sbin/setld; then
115 if test X`/usr/bin/uname -s` = XOSF1; then
116 avoidksh="to avoid Digital UNIX' ksh"
118 unset BIN_SH # if this is 'xpg4' sh will start up ksh
121 case "$inksh/$needksh" in
128 case "$inksh/$avoidksh" in
134 case "$inksh/$needksh-$avoidksh-" in
137 (I see you are using the Korn shell. Some ksh's blow up on $me,
138 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
145 echo "(Feeding myself to $newsh $reason.)"
147 Configure|*/Configure) exec $newsh $0 "$@";;
148 *) exec $newsh Configure "$@";;
153 : if needed set CDPATH to a harmless value that is not chatty
154 : avoid bash 2.02 problems with empty CDPATH.
158 *bash*) CDPATH='.' ;;
163 : Configure runs within the UU subdirectory
164 test -d UU || mkdir UU
492 d_old_pthread_create_joinable=''
493 old_pthread_create_joinable=''
581 d_stdio_ptr_lval_nochange_cnt=''
582 d_stdio_ptr_lval_sets_cnt=''
767 inc_version_list_init=''
786 ignore_versioned_solibs=''
845 d_perl_otherlibdirs=''
859 version_patchlevel_string=''
864 d_nv_preserves_uv_bits=''
963 d_stdio_stream_array=''
964 stdio_stream_array=''
974 ccflags_uselargefiles=''
975 ldflags_uselargefiles=''
976 libswanted_uselargefiles=''
1022 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1025 : We must find out about Eunice early
1027 if test -f /etc/unixtovms; then
1028 eunicefix=/etc/unixtovms
1030 if test -f /etc/unixtovms.exe; then
1031 eunicefix=/etc/unixtovms.exe
1038 : set useposix=false in your hint file to disable the POSIX extension.
1040 : set useopcode=false in your hint file to disable the Opcode extension.
1042 : Trailing extension. Override this in a hint file, if needed.
1044 : Extra object files, if any, needed on this platform.
1047 : Possible local include directories to search.
1048 : Set locincpth to "" in a hint file to defeat local include searches.
1049 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1050 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1052 : no include file wanted by default
1057 : change the next line if compiling for Xenix/286 on Xenix/386
1058 xlibpth='/usr/lib/386 /lib/386'
1059 : Possible local library directories to search.
1060 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1061 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1063 : general looking path for locating libraries
1064 glibpth="/lib /usr/lib $xlibpth"
1065 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1066 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1067 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1069 : Private path used by Configure to find libraries. Its value
1070 : is prepended to libpth. This variable takes care of special
1071 : machines, like the mips. Usually, it should be empty.
1074 : default library list
1076 : some systems want to use only the non-versioned libso:s
1077 ignore_versioned_solibs=''
1079 ccflags_uselargefiles=''
1080 ldflags_uselargefiles=''
1081 libswanted_uselargefiles=''
1082 : set usemultiplicity on the Configure command line to enable multiplicity.
1083 : set usesocks on the Configure command line to enable socks.
1084 : set usethreads on the Configure command line to enable threads.
1085 usereentrant='undef'
1086 : full support for void wanted by default
1089 : List of libraries we want.
1090 : If anyone needs -lnet, put it in a hint file.
1091 libswanted='sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl'
1092 libswanted="$libswanted dld ld sun m c cposix posix"
1093 libswanted="$libswanted ndir dir crypt sec"
1094 libswanted="$libswanted ucb bsd BSD PW x util"
1095 : We probably want to search /usr/shlib before most other libraries.
1096 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1097 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1098 glibpth="/usr/shlib $glibpth"
1099 : Do not use vfork unless overridden by a hint file.
1102 : Find the basic shell for Bourne shell scripts
1106 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1109 if test -f "$xxx"; then
1112 : Build up a list and do a single loop so we can 'break' out.
1113 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1114 for xxx in sh bash ksh pdksh ash; do
1116 try="$try ${p}/${xxx}"
1120 if test -f "$xxx"; then
1123 elif test -f "$xxx.exe"; then
1134 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1136 Usually it's in /bin/sh. How did you even get this far?
1137 Please contact me (Perl Maintainers) at perlbug@perl.org and
1138 we'll try to straighten this all out.
1144 : see if sh knows # comments
1145 if `$sh -c '#' >/dev/null 2>&1`; then
1149 test -f $xcat || xcat=/usr/bin/cat
1150 echo "#!$xcat" >sharp
1154 if test -s today; then
1157 echo "#! $xcat" > sharp
1161 if test -s today; then
1169 echo "Your $sh doesn't grok # comments--I will strip them later on."
1172 echo "exec grep -v '^[ ]*#'" >spitshell
1174 $eunicefix spitshell
1175 spitshell=`pwd`/spitshell
1177 echo "I presume that if # doesn't work, #! won't work either!"
1182 : figure out how to guarantee sh startup
1184 '') startsh=${sharpbang}${sh} ;;
1196 : echo "Yup, it does."
1198 echo "Hmm... '$startsh' does not guarantee sh startup..."
1199 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1204 : Save command line options in file UU/cmdline.opt for later use in
1205 : generating config.sh.
1206 cat > cmdline.opt <<EOSH
1207 # Configure command line arguments.
1216 cat >>cmdline.opt <<EOSH
1217 config_arg$argn='$arg'
1219 # Extreme backslashitis: replace each ' by '"'"'
1220 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1223 arg_exp=`cat cmdl.opt`
1224 args_exp="$args_exp$args_sep'$arg_exp'"
1225 argn=`expr $argn + 1`
1228 # args_exp is good for restarting self: eval "set X $args_exp"; shift; $0 "$@"
1229 # used by ./hints/os2.sh
1232 : produce awk script to parse command line options
1233 cat >options.awk <<'EOF'
1235 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1237 len = length(optstr);
1238 for (i = 1; i <= len; i++) {
1239 c = substr(optstr, i, 1);
1240 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1251 if (substr(str, 1, 1) != "-") {
1252 printf("'%s'\n", str);
1256 for (i = 2; i <= len; i++) {
1257 c = substr(str, i, 1);
1259 printf("-%s\n", substr(str, i));
1265 printf("'%s'\n", substr(str, i + 1));
1278 : process the command line options
1279 set X `for arg in "$@"; do echo "X$arg"; done |
1280 sed -e s/X// | awk -f options.awk`
1285 : set up default values
1295 rm -f optdef.sh posthint.sh
1296 cat >optdef.sh <<EOS
1302 while test $# -gt 0; do
1304 -d) shift; fastread=yes;;
1305 -e) shift; alldone=cont;;
1309 if test -r "$1"; then
1312 echo "$me: cannot read config file $1." >&2
1317 -h) shift; error=true;;
1318 -r) shift; reuseval=true;;
1319 -s) shift; silent=true; realsilent=true;;
1320 -E) shift; alldone=exit;;
1321 -K) shift; knowitall=true;;
1322 -O) shift; override=true;;
1323 -S) shift; silent=true; extractsh=true;;
1328 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1329 echo "$me: ignoring -D $1" >&2
1332 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1333 *) echo "$1='define'" >> optdef.sh;;
1340 *=) echo "$1" >> optdef.sh;;
1342 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1343 echo "$me: ignoring -U $1" >&2
1345 *) echo "$1='undef'" >> optdef.sh;;
1356 *=*) zzz=`echo $yyy|sed 's!=.*!!'`
1360 zzz=" "`echo $yyy|sed 's!^[^=]*=!!'`
1361 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1367 *:*) xxx=`echo $yyy|sed 's!:.*!!'`
1368 yyy=`echo $yyy|sed 's!^[^:]*:!!'`
1369 zzz=`echo $yyy|sed 's!^[^=]*=!!'`
1370 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1371 *) xxx=`echo $yyy|sed 's!:.*!!'`
1372 yyy=`echo $yyy|sed 's!^[^:]*:!!'` ;;
1378 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1380 echo "$yyy=''" >> posthint.sh ;;
1385 echo "$yyy='$zzz'" >> posthint.sh ;;
1387 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1389 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1394 echo "$yyy=$zzz" >> posthint.sh ;;
1395 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1399 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1402 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1410 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1411 [-U symbol] [-U symbol=] [-A command:symbol...]
1412 -d : use defaults for all answers.
1413 -e : go on without questioning past the production of config.sh.
1414 -f : specify an alternate default configuration file.
1415 -h : print this help message and exit (with an error status).
1416 -r : reuse C symbols value if possible (skips costly nm extraction).
1417 -s : silent mode, only echoes questions and essential information.
1418 -D : define symbol to have some value:
1419 -D symbol symbol gets the value 'define'
1420 -D symbol=value symbol gets the value 'value'
1421 -E : stop at the end of questions, after having produced config.sh.
1422 -K : do not use unless you know what you are doing.
1423 -O : let -D and -U override definitions from loaded configuration file.
1424 -S : perform variable substitutions on all .SH files (can mix with -f)
1425 -U : undefine symbol:
1426 -U symbol symbol gets the value 'undef'
1427 -U symbol= symbol gets completely empty
1428 -A : manipulate symbol after the platform specific hints have been applied:
1429 -A symbol=value append " "value to symbol
1430 -A append:symbol=value append value to symbol
1431 -A define:symbol=value define symbol to have value
1432 -A clear:symbol define symbol to be ''
1433 -A define:symbol define symbol to be 'define'
1434 -A eval:symbol=value define symbol to be eval of value
1435 -A prepend:symbol=value prepend value to symbol
1436 -A undef:symbol define symbol to be 'undef'
1437 -A undef:symbol= define symbol to be ''
1438 -V : print version number and exit (with a zero status).
1445 case "$fastread$alldone" in
1448 case "$extractsh" in
1451 if test ! -t 0; then
1452 echo "Say 'sh Configure', not 'sh <Configure'"
1462 true) exec 1>/dev/null;;
1465 : run the defines and the undefines, if any, but leave the file out there...
1468 : create the posthint manipulation script and leave the file out there...
1473 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1474 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1475 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1476 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1477 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1480 : Some greps do not return status, grrr.
1481 echo "grimblepritz" >grimble
1482 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1484 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1490 : the following should work in any shell
1494 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1495 cat >contains <<'EOSS'
1496 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1501 : Find the path to the source tree
1504 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1508 *) src=`cd ../$src && pwd` ;;
1521 if test -f $rsrc/Configure && \
1522 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1524 : found it, so we are ok.
1527 for src in . .. ../.. ../../.. ../../../..; do
1528 if test -f ../$src/Configure && \
1529 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1540 Sorry, I can't seem to locate the source dir for $package. Please start
1541 Configure with an explicit path -- i.e. /some/path/Configure.
1549 echo "Sources for $package found in \"$src\"." >&4
1553 : script used to extract .SH files with variable substitutions
1554 cat >extract <<'EOS'
1556 echo "Doing variable substitutions on .SH files..."
1557 if test -f MANIFEST; then
1558 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1560 echo "(Looking for .SH files under the source directory.)"
1561 set x `(cd $src; find . -name "*.SH" -print)`
1565 0) set x `(cd $src; echo *.SH)`; shift;;
1567 if test ! -f $src/$1; then
1573 while test $name; do
1574 if test ! -d "$name"; then
1575 create="$name $create";
1576 name=`echo $name | sed -e "s|^[^/]*$||"`;
1577 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1582 for file in $create; do
1591 dir=`expr X$file : 'X\(.*\)/'`
1592 file=`expr X$file : 'X.*/\(.*\)'`
1593 (cd $dir && . ./$file)
1603 dir=`expr X$file : 'X\(.*\)/'`
1604 file=`expr X$file : 'X.*/\(.*\)'`
1605 (set x $dir; shift; eval $mkdir_p)
1615 if test -f $src/config_h.SH; then
1616 if test ! -f config.h; then
1617 : oops, they left it out of MANIFEST, probably, so do it anyway.
1623 : extract files and exit if asked to do so
1624 case "$extractsh" in
1626 case "$realsilent" in
1630 case "$config_sh" in
1631 '') config_sh='config.sh';;
1634 echo "Fetching answers from $config_sh..."
1637 test "$override" && . ./optdef.sh
1641 echo "Extraction done."
1646 : Eunice requires " " instead of "", can you believe it
1649 echo "Beginning of configuration questions for $package."
1651 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1653 : first determine how to suppress newline on echo command
1655 echo "Checking echo to see how to suppress newlines..."
1656 (echo "hi there\c" ; echo " ") >.echotmp
1657 if $contains c .echotmp >/dev/null 2>&1 ; then
1668 echo $n "The star should be here-->$c"
1672 : Now test for existence of everything in MANIFEST
1674 if test -f $rsrc/MANIFEST; then
1675 echo "First let's make sure your kit is complete. Checking..." >&4
1676 awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
1679 for filelist in x??; do
1680 (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
1682 if test -s missing; then
1686 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1688 You have the option of continuing the configuration process, despite the
1689 distinct possibility that your kit is damaged, by typing 'y'es. If you
1690 do, don't blame me if something goes wrong. I advise you to type 'n'o
1691 and contact the author (perlbug@perl.org).
1694 echo $n "Continue? [n] $c" >&4
1698 echo "Continuing..." >&4
1702 echo "ABORTING..." >&4
1707 echo "Looks good..."
1710 echo "There is no MANIFEST file. I hope your kit is complete !"
1715 : Find the appropriate value for a newline for tr
1716 if test -n "$DJGPP"; then
1719 if test X"$trnl" = X; then
1720 case "`echo foo|tr '\n' x 2>/dev/null`" in
1724 if test X"$trnl" = X; then
1725 case "`echo foo|tr '\012' x 2>/dev/null`" in
1726 foox) trnl='\012' ;;
1729 if test X"$trnl" = X; then
1732 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1738 : compute the number of columns on the terminal for proper question formatting
1743 : set up the echo used in my read
1744 myecho="case \"\$xxxm\" in
1745 '') echo $n \"\$rp $c\" >&4;;
1747 '') echo $n \"[\$xxxm] $c\";;
1749 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1751 echo $n \"[\$xxxm] $c\" >&4
1753 echo $n \"\$rp [\$xxxm] $c\" >&4
1759 : now set up to do reads with possible shell escape and default assignment
1765 case "\$fastread" in
1766 yes) case "\$dflt" in
1769 case "\$silent-\$rp" in
1774 *) case "\$silent" in
1775 true) case "\$rp" in
1780 while expr "X\$ans" : "X!" >/dev/null; do
1784 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1792 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1801 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1806 echo "(OK, I'll run with -d after this question.)" >&4
1809 echo "*** Sorry, \$1 not supported yet." >&4
1819 echo "*** Substitution done -- please confirm."
1821 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1826 echo "*** Error -- try again."
1833 case "\$ans\$xxxm\$nostick" in
1845 : create .config dir to save info across Configure sessions
1846 test -d ../.config || mkdir ../.config
1847 cat >../.config/README <<EOF
1848 This directory created by Configure to save information that should
1849 persist across sessions for $package.
1851 You may safely delete it if you wish.
1854 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
1856 $define|true|[yY]*) ;;
1857 *) case "$xversion" in
1860 *** WHOA THERE!!! ***
1862 This is an UNSTABLE DEVELOPMENT release.
1863 The version of this $package distribution is $xversion, that is, odd,
1864 (as opposed to even) and that signifies a development release.
1865 If you want a maintenance release, you want an even-numbered version.
1867 Do ***NOT*** install this into production use.
1868 Data corruption and crashes are possible.
1870 It is most seriously suggested that you do not continue any further
1871 unless you want to help in developing and debugging Perl.
1873 If you *still* want to build perl, you can answer 'y' now,
1874 or pass -Dusedevel to Configure.
1877 rp='Do you really want to continue?'
1881 [yY]) echo >&4 "Okay, continuing."
1882 usedevel="$define" ;;
1883 *) echo >&4 "Okay, bye."
1893 case "$versiononly" in
1894 '') versiononly="$define" ;;
1896 case "$installusrbinperl" in
1897 '') installusrbinperl="$undef" ;;
1902 : general instructions
1905 user=`(logname) 2>/dev/null`
1907 '') user=`whoami 2>&1`;;
1909 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1912 rp='Would you like to see the instructions?'
1923 This installation shell script will examine your system and ask you questions
1924 to determine how the perl5 package should be installed. If you get
1925 stuck on a question, you may use a ! shell escape to start a subshell or
1926 execute a command. Many of the questions will have default answers in square
1927 brackets; typing carriage return will give you the default.
1929 On some of the questions which ask for file or directory names you are allowed
1930 to use the ~name construct to specify the login directory belonging to "name",
1931 even if you don't have a shell which knows about that. Questions where this is
1932 allowed will be marked "(~name ok)".
1936 dflt='Type carriage return to continue'
1940 The prompter used in this script allows you to use shell variables and
1941 backticks in your answers. You may use $1, $2, etc... to refer to the words
1942 in the default answer, as if the default line was a set of arguments given to a
1943 script shell. This means you may also use $* to repeat the whole default line,
1944 so you do not have to re-type everything to add something to the default.
1946 Everytime there is a substitution, you will have to confirm. If there is an
1947 error (e.g. an unmatched backtick), the default answer will remain unchanged
1948 and you will be prompted again.
1950 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1951 the questions and use the computed defaults (or the previous answers if there
1952 was already a config.sh file). Type 'Configure -h' for a list of options.
1953 You may also start interactively and then answer '& -d' at any prompt to turn
1954 on the non-interactive behaviour for the remainder of the execution.
1960 Much effort has been expended to ensure that this shell script will run on any
1961 Unix system. If despite that it blows up on yours, your best bet is to edit
1962 Configure and run it again. If you can't run Configure for some reason,
1963 you'll have to generate a config.sh file by hand. Whatever problems you
1964 have, let me (perlbug@perl.org) know how I blew it.
1966 This installation script affects things in two ways:
1968 1) it may do direct variable substitutions on some of the files included
1970 2) it builds a config.h file for inclusion in C programs. You may edit
1971 any of these files as the need arises after running this script.
1973 If you make a mistake on a question, there is no easy way to back up to it
1974 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1975 files. Configure will offer to let you do this before it runs the SH files.
1978 dflt='Type carriage return to continue'
1980 case "$firsttime" in
1981 true) echo $user >>../.config/instruct;;
1985 : find out where common programs are
1987 echo "Locating common programs..." >&4
2000 if test -d \$dir/\$thing; then
2006 for thisthing in \$dir/\$thing; do
2007 : just loop through to pick last item
2009 if test -f \$thisthing; then
2012 elif test -f \$dir/\$thing.exe; then
2013 if test -n "$DJGPP"; then
2014 echo \$dir/\$thing.exe
2016 : on Eunice apparently
2068 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2069 pth="$pth /lib /usr/lib"
2070 for file in $loclist; do
2074 if test -f "$xxx"; then
2077 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2078 xxx=`./loc $file $file $pth`
2081 '') xxx=`./loc $file $file $pth`;;
2082 *) xxx=`./loc $xxx $xxx $pth`;;
2088 echo $file is in $xxx.
2091 echo $file is in $xxx.
2094 echo "I don't know where '$file' is, and my life depends on it." >&4
2095 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2101 echo "Don't worry if any of the following aren't found..."
2103 for file in $trylist; do
2107 if test -f "$xxx"; then
2110 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2111 xxx=`./loc $file $file $pth`
2114 '') xxx=`./loc $file $file $pth`;;
2115 *) xxx=`./loc $xxx $xxx $pth`;;
2121 echo $file is in $xxx.
2124 echo $file is in $xxx.
2127 echo "I don't see $file out there, $say."
2134 echo "Substituting grep for egrep."
2140 echo "Substituting cp for ln."
2146 echo "Hopefully test is built into your sh."
2149 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2150 echo "Using the test built into your sh."
2158 echo "Hopefully echo is built into your sh."
2163 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2164 $echo $n "hi there$c" >foo1
2165 echo $n "hi there$c" >foo2
2166 if cmp foo1 foo2 >/dev/null 2>&1; then
2167 echo "They are compatible. In fact, they may be identical."
2174 They are not compatible! You are probably running ksh on a non-USG system.
2175 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2176 have echo built in and we may have to run some Bourne shell scripts. That
2177 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2180 $echo $n "The star should be here-->$c"
2190 cat <<'EOSC' >>checkcc
2195 int main(int argc, char *argv[]) {
2199 if $cc -o try $ccflags $ldflags try.c; then
2202 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2208 case "`$cc -v -c try.c 2>&1`" in
2211 if $test X"$trygcc" = Xyes; then
2212 if gcc -o try -c try.c; then
2214 echo "You seem to have a working gcc, though." >&4
2215 rp="Would you like to use it?"
2217 if $test -f myread; then
2220 if $test -f UU/myread; then
2223 echo "Cannot find myread, sorry. Aborting." >&2
2228 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no ;;
2232 if $test X"$despair" = Xyes; then
2234 You need to find a working C compiler.
2235 Either (purchase and) install the C compiler supplied by your OS vendor,
2236 or for a free C compiler try http://gcc.gnu.org/
2237 I cannot continue any further, aborting.
2247 : determine whether symbolic links are supported
2250 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2251 echo "Symbolic links are supported." >&4
2254 echo "Symbolic links are NOT supported." >&4
2259 : determine whether symbolic links are supported
2263 echo "Checking how to test for symbolic links..." >&4
2265 if $test "X$issymlink" = X; then
2267 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2268 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2270 if test $? = 0; then
2273 echo "Your builtin 'test -h' may be broken." >&4
2276 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2279 if test -f "$p/$test"; then
2288 echo "Trying external '$test -h'." >&4
2289 issymlink="$test -h"
2290 if $test ! -h sym >/dev/null 2>&1; then
2291 echo "External '$test -h' is broken, too." >& 4
2299 if $test "X$issymlink" = X; then
2300 if $test -L sym 2>/dev/null; then
2301 issymlink="$test -L"
2302 echo "The builtin '$test -L' worked." >&4
2305 if $test "X$issymlink" != X; then
2306 echo "You can test for symbolic links with '$issymlink'." >&4
2308 echo "I do not know how you can test for symbolic links." >&4
2312 *) echo "No symbolic links, so not testing for their testing..." >&4
2318 case "$mksymlinks" in
2321 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2324 *) case "$lns:$issymlink" in
2325 *"ln -s:"*"test -"?)
2326 echo "Creating the symbolic links..." >&4
2327 echo "(First creating the subdirectories...)" >&4
2329 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2331 test -z "$directory" && break
2335 if test ! -d t/base; then
2336 echo "Failed to create the subdirectories. Aborting." >&4
2339 echo "(Then creating the symlinks...)" >&4
2340 awk '{print $1}' $src/MANIFEST | while true; do
2342 test -z "$filename" && break
2343 if test -f $filename; then
2344 if $issymlink $filename; then
2348 if test -f $filename; then
2349 echo "$filename already exists, not symlinking."
2351 ln -s $src/$filename $filename
2355 if test ! -f t/base/lex.t; then
2356 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2361 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2370 case "$usecrosscompile" in
2372 $echo "Cross-compiling..."
2375 *-*-gcc) # A cross-compiling gcc, probably.
2376 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2378 # leave out ld, choosing it is more complex
2380 ranlib=$targetarch-ranlib
2381 $echo 'extern int foo;' > try.c
2382 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2384 if $test $# -gt 0; then
2386 incpth="`$echo $incpth|$sed 's/^ //'`"
2387 echo "Guessing incpth '$incpth'." >&4
2389 j="`$echo $i|$sed 's,/include$,/lib,'`"
2390 if $test -d $j; then
2394 libpth="`$echo $libpth|$sed 's/^ //'`"
2395 echo "Guessing libpth '$libpth'." >&4
2400 case "$targetarch" in
2401 '') echo "Targetarch not defined." >&4; croak=y ;;
2402 *) echo "Using targetarch $targetarch." >&4 ;;
2405 '') echo "Incpth not defined." >&4; croak=y ;;
2406 *) echo "Using incpth '$incpth'." >&4 ;;
2409 '') echo "Libpth not defined." >&4; croak=y ;;
2410 *) echo "Using libpth '$libpth'." >&4 ;;
2413 '') for i in $incpth; do
2414 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2416 echo "Guessing usrinc $usrinc." >&4
2421 '') echo "Usrinc not defined." >&4; croak=y ;;
2424 *) echo "Using usrinc $usrinc." >&4 ;;
2426 case "$targethost" in
2427 '') echo "Targethost not defined." >&4; croak=y ;;
2428 *) echo "Using targethost $targethost." >&4
2433 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2436 /*) run=$src/Cross/run
2437 targetmkdir=$src/Cross/mkdir
2439 from=$src/Cross/from
2441 *) pwd=`$test -f ../Configure & cd ..; pwd`
2443 targetmkdir=$pwd/Cross/mkdir
2445 from=$pwd/Cross/from
2448 case "$targetrun" in
2449 '') targetrun=ssh ;;
2454 case "$targetfrom" in
2455 '') targetfrom=scp ;;
2459 from=$from-$targetfrom
2460 case "$targetdir" in
2462 echo "Guessing targetdir $targetdir." >&4
2465 case "$targetuser" in
2467 echo "Guessing targetuser $targetuser." >&4
2470 case "$targetfrom" in
2474 case "$targetrun" in
2486 '') cwd=$targetdir ;;
2490 if $test ! -f \$exe.xok; then
2494 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2497 *) echo "Unknown targetrun '$targetrun'" >&4
2501 case "$targetmkdir" in
2503 cat >$targetmkdir <<EOF
2505 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2507 $chmod a+rx $targetmkdir
2509 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2521 $targetmkdir \`dirname \$f\`
2522 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2525 $targetmkdir $targetdir/\`dirname \$f\`
2526 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2539 $mkdir -p $targetdir/\`dirname \$f\`
2540 $cp \$f $targetdir/\$f || exit 1
2543 $targetmkdir $targetdir/\`dirname \$f\`
2544 $cp \$f $targetdir/\$f || exit 1
2551 *) echo "Unknown targetto '$targetto'" >&4
2555 case "$targetfrom" in
2562 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2567 cp) cat >$from <<EOF
2572 cp $targetdir/\$f . || exit 1
2577 *) echo "Unknown targetfrom '$targetfrom'" >&4
2581 if $test ! -f $run; then
2582 echo "Target 'run' script '$run' not found." >&4
2586 if $test ! -f $to; then
2587 echo "Target 'to' script '$to' not found." >&4
2591 if $test ! -f $from; then
2592 echo "Target 'from' script '$from' not found." >&4
2596 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2600 Using '$run' for remote execution,
2601 and '$from' and '$to'
2602 for remote file transfer.
2608 usecrosscompile='undef'
2613 : see whether [:lower:] and [:upper:] are supported character classes
2615 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2617 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2621 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
2622 # (0xc9 and 0xd1), therefore that is a nice testing point.
2623 if test "X$up" = X -o "X$low" = X; then
2624 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
2630 if test "X$up" = X -o "X$low" = X; then
2631 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
2637 if test "X$up" = X -o "X$low" = X; then
2638 case "`echo IJ | od -x 2>/dev/null`" in
2640 echo "Hey, this might be EBCDIC." >&4
2641 if test "X$up" = X -o "X$low" = X; then
2642 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2643 ij) up='[A-IJ-RS-Z]'
2648 if test "X$up" = X -o "X$low" = X; then
2649 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2659 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
2661 echo "Using $up and $low to convert case." >&4
2664 echo "I don't know how to translate letters from upper to lower case." >&4
2665 echo "Your tr is not acting any way I know of." >&4
2669 : set up the translation script tr, must be called with ./tr of course
2673 '[A-Z][a-z]') exec $tr '$up' '$low';;
2674 '[a-z][A-Z]') exec $tr '$low' '$up';;
2681 : Try to determine whether config.sh was made on this system
2682 case "$config_sh" in
2684 myuname=`$uname -a 2>/dev/null`
2685 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2686 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2687 # because the A-Z/a-z are not consecutive.
2688 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2689 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2690 newmyuname="$myuname"
2692 case "$knowitall" in
2694 if test -f ../config.sh; then
2695 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2696 eval "`grep myuname= ../config.sh`"
2698 if test "X$myuname" = "X$newmyuname"; then
2706 : Get old answers from old config file if Configure was run on the
2707 : same system, otherwise use the hints.
2710 if test -f config.sh; then
2712 rp="I see a config.sh file. Shall I use it to set the defaults?"
2715 n*|N*) echo "OK, I'll ignore it."
2716 mv config.sh config.sh.old
2717 myuname="$newmyuname"
2719 *) echo "Fetching default answers from your old config.sh file..." >&4
2727 : Older versions did not always set $sh. Catch re-use of such
2737 if test ! -f config.sh; then
2740 First time through, eh? I have some defaults handy for some systems
2741 that need some extra help getting the Configure answers right:
2744 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2746 : Half the following guesses are probably wrong... If you have better
2747 : tests or hints, please send them to perlbug@perl.org
2748 : The metaconfig authors would also appreciate a copy...
2749 $test -f /irix && osname=irix
2750 $test -f /xenix && osname=sco_xenix
2751 $test -f /dynix && osname=dynix
2752 $test -f /dnix && osname=dnix
2753 $test -f /lynx.os && osname=lynxos
2754 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2755 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
2756 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2757 $test -f /bin/mips && /bin/mips && osname=mips
2758 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
2759 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
2760 $test -d /usr/apollo/bin && osname=apollo
2761 $test -f /etc/saf/_sactab && osname=svr4
2762 $test -d /usr/include/minix && osname=minix
2763 if $test -d /MachTen -o -d /MachTen_Folder; then
2765 if $test -x /sbin/version; then
2766 osvers=`/sbin/version | $awk '{print $2}' |
2767 $sed -e 's/[A-Za-z]$//'`
2768 elif $test -x /usr/etc/version; then
2769 osvers=`/usr/etc/version | $awk '{print $2}' |
2770 $sed -e 's/[A-Za-z]$//'`
2776 $test -f /sys/posix.dll &&
2777 $test -f /usr/bin/what &&
2778 set X `/usr/bin/what /sys/posix.dll` &&
2779 $test "$3" = UWIN &&
2783 if $test -f $uname; then
2791 umips) osname=umips ;;
2794 [23]100) osname=mips ;;
2795 next*) osname=next ;;
2797 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
2798 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
2801 elif $test -f /etc/kconfig; then
2803 if test "$lns" = "$ln -s"; then
2805 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
2807 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
2814 if test -n "$DJGPP"; then
2823 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
2825 'not found') osvers="$4"."$3" ;;
2826 '<3240'|'<>3240') osvers=3.2.0 ;;
2827 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
2828 '=3250'|'>3250') osvers=3.2.5 ;;
2832 bsd386) osname=bsd386
2835 cygwin*) osname=cygwin
2838 *dc.osx) osname=dcosx
2844 domainos) osname=apollo
2850 dynixptx*) osname=dynixptx
2851 osvers=`echo "$4"|sed 's/^v//'`
2853 freebsd) osname=freebsd
2855 genix) osname=genix ;;
2857 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
2873 netbsd*) osname=netbsd
2876 news-os) osvers="$3"
2878 4*) osname=newsos4 ;;
2882 next*) osname=next ;;
2883 nonstop-ux) osname=nonstopux ;;
2884 POSIX-BC | posix-bc ) osname=posix-bc
2887 powerux | power_ux | powermax_os | powermaxos | \
2888 powerunix | power_unix) osname=powerux
2894 solaris) osname=solaris
2896 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2903 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2907 titanos) osname=titanos
2916 ultrix) osname=ultrix
2919 osf1|mls+) case "$5" in
2922 osvers=`sizer -v | awk '{print $3}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
2925 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
2928 hp*) osname=hp_osf1 ;;
2929 mips) osname=mips_osf1 ;;
2932 unixware) osname=svr5
2938 $2) case "$osname" in
2942 : svr4.x or possibly later
2952 if test -f /stand/boot ; then
2953 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
2954 if test -n "$INITPROG" -a -f "$INITPROG"; then
2955 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
2956 if test -n "$isesix"; then
2964 *) if test -f /etc/systemid; then
2966 set `echo $3 | $sed 's/\./ /g'` $4
2967 if $test -f $src/hints/sco_$1_$2_$3.sh; then
2969 elif $test -f $src/hints/sco_$1_$2.sh; then
2971 elif $test -f $src/hints/sco_$1.sh; then
2976 '') : Still unknown. Probably a generic Sys V.
2985 *) case "$osname" in
2986 '') : Still unknown. Probably a generic BSD.
2994 if test -f /vmunix -a -f $src/hints/news_os.sh; then
2995 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
2996 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
2999 $rm -f UU/kernel.what
3000 elif test -d c:/.; then
3007 case "$targetarch" in
3010 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3015 : Now look for a hint file osname_osvers, unless one has been
3016 : specified already.
3019 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3020 : Also try without trailing minor version numbers.
3021 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3022 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3023 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3024 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3027 *) case "$osvers" in
3030 *) if $test -f $src/hints/$file.sh ; then
3032 elif $test -f $src/hints/$xfile.sh ; then
3034 elif $test -f $src/hints/$xxfile.sh ; then
3036 elif $test -f $src/hints/$xxxfile.sh ; then
3038 elif $test -f $src/hints/$xxxxfile.sh ; then
3040 elif $test -f "$src/hints/${osname}.sh" ; then
3049 if $test -f Policy.sh ; then
3052 none) dflt="Policy" ;;
3053 *) dflt="Policy $dflt" ;;
3058 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3062 if $test -f Policy.sh ; then
3065 There's also a Policy hint file available, which should make the
3066 site-specific (policy) questions easier to answer.
3073 You may give one or more space-separated answers, or "none" if appropriate.
3074 A well-behaved OS will have no hints, so answering "none" or just "Policy"
3075 is a good thing. DO NOT give a wrong version or a wrong OS.
3079 rp="Which of these apply, if any?"
3082 for file in $tans; do
3083 if $test X$file = XPolicy -a -f Policy.sh; then
3085 $cat Policy.sh >> UU/config.sh
3086 elif $test -f $src/hints/$file.sh; then
3087 . $src/hints/$file.sh
3088 $cat $src/hints/$file.sh >> UU/config.sh
3089 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3092 : Give one chance to correct a possible typo.
3093 echo "$file.sh does not exist"
3095 rp="hint to use instead?"
3097 for file in $ans; do
3098 if $test -f "$src/hints/$file.sh"; then
3099 . $src/hints/$file.sh
3100 $cat $src/hints/$file.sh >> UU/config.sh
3101 elif $test X$ans = X -o X$ans = Xnone ; then
3104 echo "$file.sh does not exist -- ignored."
3111 : Remember our hint file for later.
3112 if $test -f "$src/hints/$file.sh" ; then
3122 echo "Fetching default answers from $config_sh..." >&4
3126 cp $config_sh config.sh 2>/dev/null
3136 test "$override" && . ./optdef.sh
3138 : Restore computed paths
3139 for file in $loclist $trylist; do
3140 eval $file="\$_$file"
3145 Configure uses the operating system name and version to set some defaults.
3146 The default value is probably right if the name rings a bell. Otherwise,
3147 since spelling matters for me, either accept the default or answer "none"
3154 ''|' '|none) dflt=none ;;
3155 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3158 *) dflt="$osname" ;;
3160 rp="Operating system name?"
3164 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3170 ''|' '|none) dflt=none ;;
3171 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3172 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3174 ''|' ') dflt=none ;;
3179 *) dflt="$osvers" ;;
3181 rp="Operating system version?"
3191 : who configured the system
3192 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3193 cf_by=`(logname) 2>/dev/null`
3196 cf_by=`(whoami) 2>/dev/null`
3198 "") cf_by=unknown ;;
3202 : set up the script used to warn in case of inconsistency
3209 echo "*** WHOA THERE!!! ***" >&4
3210 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
3211 rp=" Keep the $hint value?"
3214 y) td=$was; tu=$was;;
3218 : function used to set $1 to $val
3219 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
3221 $define$undef) . ./whoa; eval "$var=\$td";;
3222 $undef$define) . ./whoa; eval "$var=\$tu";;
3223 *) eval "$var=$val";;
3226 case "$usethreads" in
3227 $define|true|[yY]*) dflt='y';;
3232 Perl can be built to take advantage of threads on some systems.
3233 To do so, Configure can be run with -Dusethreads.
3235 Note that threading is a highly experimental feature, and
3236 some known race conditions still remain. If you choose to try
3237 it, be very sure to not actually deploy it for production
3238 purposes. README.threads has more details, and is required
3239 reading if you enable threads.
3241 If this doesn't make any sense to you, just accept the default '$dflt'.
3243 rp='Build a threading Perl?'
3246 y|Y) val="$define" ;;
3252 case "$usethreads" in
3256 As of 5.5.640, Perl has two different internal threading implementations,
3257 the 5.005 version (5005threads) and an interpreter-based version
3258 (ithreads) that has one interpreter per thread. Both are very
3259 experimental. This arrangement exists to help developers work out
3260 which one is better.
3262 If you're a casual user, you probably don't want interpreter-threads
3263 at this time. There doesn't yet exist a way to create threads from
3264 within Perl in this model, i.e., "use Thread;" will NOT work.
3266 : Default to ithreads unless overridden on command line or with
3269 case "$use5005threads" in
3270 $define|true|[yY]*) dflt='n';;
3272 case "$useithreads" in
3273 $undef|false|[nN]*) dflt='n';;
3275 rp='Use interpreter-based ithreads?'
3278 y|Y) val="$define" ;;
3283 : Now set use5005threads to the opposite value.
3284 case "$useithreads" in
3285 $define) val="$undef" ;;
3292 useithreads="$undef"
3293 use5005threads="$undef"
3297 case "$useithreads$use5005threads" in
3301 You cannot have both the ithreads and the 5.005 threads enabled
3302 at the same time. Disabling the 5.005 threads since they are
3303 much less stable than the ithreads.
3306 use5005threads="$undef"
3310 case "$d_oldpthreads" in
3311 '') : Configure tests would be welcome here. For now, assume undef.
3313 *) val="$d_oldpthreads" ;;
3319 case "$usethreads" in
3320 "$define"|true|[yY]*)
3321 : Look for a hint-file generated 'call-back-unit'. If the
3322 : user has specified that a threading perl is to be built,
3323 : we may need to set or change some other defaults.
3324 if $test -f usethreads.cbu; then
3325 echo "Your platform has some specific hints for threaded builds, using them..."
3329 (Your platform doesn't have any specific hints for threaded builds.
3330 Assuming POSIX threads, then.)
3338 Perl can be built so that multiple Perl interpreters can coexist
3339 within the same Perl executable.
3342 case "$useithreads" in
3345 This multiple interpreter support is required for interpreter-based threads.
3349 *) case "$usemultiplicity" in
3350 $define|true|[yY]*) dflt='y';;
3354 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
3355 rp='Build Perl for multiplicity?'
3358 y|Y) val="$define" ;;
3367 case "$usemorebits" in
3368 "$define"|true|[yY]*)
3369 use64bitint="$define"
3370 uselongdouble="$define"
3371 usemorebits="$define"
3373 *) usemorebits="$undef"
3377 : make some quick guesses about what we are up against
3379 $echo $n "Hmm... $c"
3389 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
3390 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
3392 echo "Looks kind of like an OSF/1 system, but we'll see..."
3394 elif test `echo abc | $tr a-z A-Z` = Abc ; then
3395 xxx=`./loc addbib blurfl $pth`
3396 if $test -f $xxx; then
3397 echo "Looks kind of like a USG system with BSD features, but we'll see..."
3401 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
3402 echo "Looks kind of like an extended USG system, but we'll see..."
3404 echo "Looks kind of like a USG system, but we'll see..."
3408 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
3409 echo "Looks kind of like a BSD system, but we'll see..."
3413 echo "Looks kind of like a Version 7 system, but we'll see..."
3416 case "$eunicefix" in
3419 There is, however, a strange, musty smell in the air that reminds me of
3420 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
3424 : it so happens the Eunice I know will not run shell scripts in Unix format
3428 echo "Congratulations. You aren't running Eunice."
3432 : Detect OS2. The p_ variable is set above in the Head.U unit.
3433 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
3434 : semicolon as a patch separator
3439 I have the feeling something is not exactly right, however...don't tell me...
3440 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
3441 (Or you may be running DOS with DJGPP.)
3446 if test -f /xenix; then
3447 echo "Actually, this looks more like a XENIX system..."
3452 echo "It's not Xenix..."
3457 if test -f /venix; then
3458 echo "Actually, this looks more like a VENIX system..."
3465 echo "Nor is it Venix..."
3468 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3469 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3476 rp="Use which C compiler?"
3479 : Look for a hint-file generated 'call-back-unit'. Now that the
3480 : user has specified the compiler, we may need to set or change some
3482 if $test -f cc.cbu; then
3488 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3494 printf("%s\n", __VERSION__);
3496 printf("%s\n", "1");
3502 if $cc -o try $ccflags $ldflags try.c; then
3503 gccversion=`$run ./try`
3504 case "$gccversion" in
3505 '') echo "You are not using GNU cc." ;;
3506 *) echo "You are using GNU cc $gccversion."
3512 echo "*** WHOA THERE!!! ***" >&4
3513 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3514 case "$knowitall" in
3516 echo " You'd better start hunting for one and let me know about it." >&4
3522 case "$gccversion" in
3523 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3525 case "$gccversion" in
3526 '') gccosandvers='' ;;
3527 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
3528 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
3530 case "$gccosandvers" in
3531 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
3532 $osname$osvers) ;; # looking good
3533 $osname*) cat <<EOM >&4
3535 *** WHOA THERE!!! ***
3537 Your gcc has not been compiled for the exact release of
3538 your operating system ($gccosandvers versus $osname$osvers).
3540 In general it is a good idea to keep gcc synchronized with
3541 the operating system because otherwise serious problems
3542 may ensue when trying to compile software, like Perl.
3544 I'm trying to be optimistic here, though, and will continue.
3545 If later during the configuration and build icky compilation
3546 problems appear (headerfile conflicts being the most common
3547 manifestation), I suggest reinstalling the gcc to match
3548 your operating system release.
3552 *) gccosandvers='' ;; # failed to parse, better be silent
3561 : decide how portable to be. Allow command line overrides.
3562 case "$d_portable" in
3564 *) d_portable="$define" ;;
3567 : set up shell script to do ~ expansion
3573 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3576 if $test -f /bin/csh; then
3577 /bin/csh -f -c "glob \$1"
3582 name=\`$expr x\$1 : '..\([^/]*\)'\`
3583 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3584 if $test ! -d "\$dir"; then
3586 echo "\$me: can't locate home directory for: \$name" >&2
3591 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3607 : now set up to get a file name
3611 cat <<'EOSC' >>getfile
3627 expr $fn : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3628 fn=`echo $fn | sed 's/(.*)//'`
3634 loc_file=`expr $fn : '.*:\(.*\)'`
3635 fn=`expr $fn : '\(.*\):.*'`
3643 */*) fullpath=true;;
3652 *e*) exp_file=true;;
3655 *p*) nopath_ok=true;;
3660 *d*) type='Directory';;
3661 *l*) type='Locate';;
3666 Locate) what='File';;
3671 case "$d_portable" in
3679 while test "$type"; do
3684 true) rp="$rp (~name ok)";;
3687 if test -f UU/getfile.ok && \
3688 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3707 value=`UU/filexp $ans`
3710 if test "$ans" != "$value"; then
3711 echo "(That expands to $value on this system.)"
3725 /*) value="$ansexp" ;;
3726 [a-zA-Z]:/*) value="$ansexp" ;;
3731 echo "I shall only accept a full path name, as in /bin/ls." >&4
3732 echo "Use a ! shell escape if you wish to check pathnames." >&4
3735 echo "Please give a full path name, starting with slash." >&4
3738 echo "Note that using ~name is ok provided it expands well." >&4
3751 for fp in $gfpth; do
3752 if test "X$fp" = X.; then
3757 if test -f "$pf"; then
3759 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3761 echo "($value is not a plain file, but that's ok.)"
3764 if test X"$type" = X; then
3771 for fp in $gfpth; do
3772 if test "X$fp" = X.; then
3777 direxp="$fp/$ansexp"
3779 if test -d "$direxp"; then
3787 if test -d "$ansexp"; then
3788 echo "(Looking for $loc_file in directory $value.)"
3789 value="$value/$loc_file"
3790 ansexp="$ansexp/$loc_file"
3792 if test -f "$ansexp"; then
3795 case "$nopath_ok" in
3796 true) case "$value" in
3798 *) echo "Assuming $value will be in people's path."
3814 if test "$fastread" = yes; then
3819 rp="$what $value doesn't exist. Use that name anyway?"
3838 test "X$gfpthkeep" != Xy && gfpth=""
3841 : What should the include directory be ?
3843 $echo $n "Hmm... $c"
3847 if $test -f /bin/mips && /bin/mips; then
3848 echo "Looks like a MIPS system..."
3849 $cat >usr.c <<'EOCP'
3850 #ifdef SYSTYPE_BSD43
3854 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3855 dflt='/bsd43/usr/include'
3859 mips_type='System V'
3861 $rm -f usr.c usr.out
3862 echo "and you're compiling with the $mips_type compiler and libraries."
3866 echo "Doesn't look like a MIPS system."
3876 case "$xxx_prompt" in
3879 rp='Where are the include files you want to use?'
3887 : see how we invoke the C preprocessor
3889 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3890 cat <<'EOT' >testcpp.c
3896 if test ! -f cppstdin; then
3897 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
3898 # AIX cc -E doesn't show the absolute headerfile
3899 # locations but we'll cheat by using the -M flag.
3900 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
3902 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3905 echo "Keeping your $hint cppstdin wrapper."
3908 wrapper=`pwd`/cppstdin
3912 if $test "X$cppstdin" != "X" && \
3913 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3914 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3916 echo "You used to use $cppstdin $cppminus so we'll use that again."
3918 '') echo "But let's see if we can live without a wrapper..." ;;
3920 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3921 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3923 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3926 echo "(However, $cpprun $cpplast does not work, let's see...)"
3934 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3941 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3942 $cc -E <testcpp.c >testcpp.out 2>&1; \
3943 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3944 echo "Yup, it does."
3947 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
3948 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3949 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3950 echo "Yup, it does."
3953 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
3954 $cc -P <testcpp.c >testcpp.out 2>&1; \
3955 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3956 echo "Yipee, that works!"
3959 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
3960 $cc -P - <testcpp.c >testcpp.out 2>&1; \
3961 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3962 echo "At long last!"
3965 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
3966 $cpp <testcpp.c >testcpp.out 2>&1; \
3967 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3971 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
3972 $cpp - <testcpp.c >testcpp.out 2>&1; \
3973 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3974 echo "Hooray, it works! I was beginning to wonder."
3977 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
3978 $wrapper <testcpp.c >testcpp.out 2>&1; \
3979 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3985 rp="No dice. I can't find a C preprocessor. Name one:"
3989 $x_cpp <testcpp.c >testcpp.out 2>&1
3990 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3991 echo "OK, that will do." >&4
3993 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4008 echo "Perhaps can we force $cc -E using a wrapper..."
4009 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4010 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4016 echo "Nope, we'll have to live without it..."
4030 "$wrapper"|'cppstdin') ;;
4031 *) $rm -f $wrapper;;
4033 $rm -f testcpp.c testcpp.out
4035 : Set private lib path
4038 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4043 '') dlist="$loclibpth $plibpth $glibpth";;
4044 *) dlist="$libpth";;
4047 : Now check and see which directories actually exist, avoiding duplicates
4051 if $test -d $xxx; then
4054 *) libpth="$libpth $xxx";;
4060 Some systems have incompatible or broken versions of libraries. Among
4061 the directories listed in the question below, please remove any you
4062 know not to be holding relevant libraries, and add any that are needed.
4063 Say "none" for none.
4074 rp="Directories to use for library searches?"
4081 : compute shared library extension
4084 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4094 On some systems, shared libraries may be available. Answer 'none' if
4095 you want to suppress searching of shared libraries for the remainder
4096 of this configuration.
4099 rp='What is the file extension used for shared libraries?'
4103 : Define several unixisms.
4104 : Hints files or command line option can be used to override them.
4105 : The convoluted testing is in case hints files set either the old
4108 '') case "$exe_ext" in
4110 *) _exe="$exe_ext" ;;
4115 '') case "$lib_ext" in
4122 '') case "$obj_ext" in
4129 '') case "$path_sep" in
4140 : Which makefile gets called first. This is used by make depend.
4141 case "$firstmakefile" in
4142 '') firstmakefile='makefile';;
4146 $define|true|[yY]*) dflt='y';;
4151 Perl can be built to use the SOCKS proxy protocol library. To do so,
4152 Configure must be run with -Dusesocks. If you use SOCKS you also need
4153 to use the PerlIO abstraction layer, this will be implicitly selected.
4155 If this doesn't make any sense to you, just accept the default '$dflt'.
4157 rp='Build Perl for SOCKS?'
4160 y|Y) val="$define" ;;
4167 $define|true|[yY]*) useperlio="$define";;
4170 : Looking for optional libraries
4172 echo "Checking for optional libraries..." >&4
4177 case "$libswanted" in
4178 '') libswanted='c_s';;
4181 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4187 for thisdir in $libpth $xlibpth; do
4188 test -d $thisdir && libspath="$libspath $thisdir"
4190 for thislib in $libswanted; do
4191 for thisdir in $libspath; do
4193 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4194 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|tail -1`
4195 $test -f "$xxx" && eval $libscheck
4196 $test -f "$xxx" && libstyle=shared
4198 if test ! -f "$xxx"; then
4199 xxx=$thisdir/lib$thislib.$so
4200 $test -f "$xxx" && eval $libscheck
4201 $test -f "$xxx" && libstyle=shared
4203 if test ! -f "$xxx"; then
4204 xxx=$thisdir/lib$thislib$_a
4205 $test -f "$xxx" && eval $libscheck
4206 $test -f "$xxx" && libstyle=static
4208 if test ! -f "$xxx"; then
4209 xxx=$thisdir/$thislib$_a
4210 $test -f "$xxx" && eval $libscheck
4211 $test -f "$xxx" && libstyle=static
4213 if test ! -f "$xxx"; then
4214 xxx=$thisdir/lib${thislib}_s$_a
4215 $test -f "$xxx" && eval $libscheck
4216 $test -f "$xxx" && libstyle=static
4217 $test -f "$xxx" && thislib=${thislib}_s
4219 if test ! -f "$xxx"; then
4220 xxx=$thisdir/Slib$thislib$_a
4221 $test -f "$xxx" && eval $libscheck
4222 $test -f "$xxx" && libstyle=static
4224 if $test -f "$xxx"; then
4226 shared) echo "Found -l$thislib (shared)." ;;
4227 static) echo "Found -l$thislib." ;;
4228 *) echo "Found -l$thislib ($libstyle)." ;;
4232 *) dflt="$dflt -l$thislib"
4233 libsfound="$libsfound $xxx"
4235 libsfiles="$libsfiles $yyy"
4236 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4237 case " $libsdirs " in
4239 *) libsdirs="$libsdirs $yyy" ;;
4246 if $test ! -f "$xxx"; then
4247 echo "No -l$thislib."
4258 ' '|'') dflt='none';;
4263 In order to compile $package on your machine, a number of libraries
4264 are usually needed. Include any other special libraries here as well.
4265 Say "none" for none. The default list is almost always right.
4269 rp="What libraries to use?"
4276 : determine optimization, if desired, or use for debug flag also
4278 ' '|$undef) dflt='none';;
4280 *) dflt="$optimize";;
4284 By default, $package compiles with the -O flag to use the optimizer.
4285 Alternately, you might want to use the symbolic debugger, which uses
4286 the -g flag (on traditional Unix systems). Either flag can be
4287 specified here. To use neither flag, specify the word "none".
4290 rp="What optimizer/debugger flag should be used?"
4294 'none') optimize=" ";;
4298 : We will not override a previous value, but we might want to
4299 : augment a hint file
4301 default|recommended)
4302 case "$gccversion" in
4303 1*) dflt='-fpcc-struct-return' ;;
4306 *-g*) dflt="$dflt -DDEBUGGING";;
4308 case "$gccversion" in
4309 2*) if test -d /etc/conf/kconfig.d &&
4310 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4316 case "$gccversion" in
4320 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
4321 echo 'int main(void) { return 0; }' > gcctest.c
4322 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
4323 echo "Yes, it does." 2>&1
4326 echo "Leaving current flags $ccflags alone." 2>&1
4328 *) dflt="$dflt -fno-strict-aliasing" ;;
4331 echo "Nope, it doesn't, but that's ok." 2>&1
4338 case "$mips_type" in
4339 *BSD*|'') inclwanted="$locincpth $usrinc";;
4340 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4342 for thisincl in $inclwanted; do
4343 if $test -d $thisincl; then
4344 if $test x$thisincl != x$usrinc; then
4346 *" -I$thisincl "*);;
4347 *) dflt="$dflt -I$thisincl ";;
4353 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4355 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4363 *) dflt="$dflt -D$2";;
4367 set signal.h LANGUAGE_C; eval $inctest
4371 ccflags="$ccflags -DSOCKS"
4376 default|recommended) dflt="$ccflags $dflt" ;;
4377 *) dflt="$ccflags";;
4386 Your C compiler may want other flags. For this question you should include
4387 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4388 but you should NOT include libraries or ld flags like -lwhatever. If you
4389 want $package to honor its debug switch, you should include -DDEBUGGING here.
4390 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4392 To use no flags, specify the word "none".
4398 rp="Any additional cc flags?"
4405 : the following weeds options from ccflags that are of no interest to cpp
4407 '') cppflags="$ccflags" ;;
4408 *) cppflags="$cppflags $ccflags" ;;
4410 case "$gccversion" in
4411 1*) cppflags="$cppflags -D__GNUC__"
4413 case "$mips_type" in
4415 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4421 echo "Let me guess what the preprocessor flags are..." >&4
4435 *) ftry="$previous $flag";;
4437 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4438 >cpp1.out 2>/dev/null && \
4439 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4440 >cpp2.out 2>/dev/null && \
4441 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4442 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4444 cppflags="$cppflags $ftry"
4454 *-*) echo "They appear to be: $cppflags";;
4456 $rm -f cpp.c cpp?.out
4460 : flags used in final linking phase
4462 '') if ./venix; then
4468 *-posix*) dflt="$dflt -posix" ;;
4471 *) dflt="$ldflags";;
4474 : Try to guess additional flags to pick up local libraries.
4475 for thislibdir in $libpth; do
4476 case " $loclibpth " in
4479 *"-L$thislibdir "*) ;;
4480 *) dflt="$dflt -L$thislibdir" ;;
4492 Your C linker may need flags. For this question you should
4493 include -L/whatever and any other flags used by the C linker, but you
4494 should NOT include libraries like -lwhatever.
4496 Make sure you include the appropriate -L/path flags if your C linker
4497 does not normally search all of the directories you specified above,
4500 To use no flags, specify the word "none".
4504 rp="Any additional ld flags (NOT including libraries)?"
4510 rmlist="$rmlist pdp11"
4514 echo "Checking your choice of C compiler and flags for coherency..." >&4
4515 $cat > try.c <<'EOF'
4517 int main() { printf("Ok\n"); exit(0); }
4519 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
4521 $cat >try.msg <<'EOM'
4522 I've tried to compile and run the following simple program:
4525 $cat try.c >> try.msg
4527 $cat >> try.msg <<EOM
4534 and I got the following output:
4538 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
4539 if $sh -c "$run ./try" >>try.msg 2>&1; then
4543 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4546 cat >> try.msg <<'EOQS'
4547 If $libs contains -lsfio, and sfio is mis-configured, then it
4548 sometimes (apparently) runs and exits with a 0 status, but with no
4549 output! It may have to do with sfio's use of _exit vs. exit.
4552 rp="You have a big problem. Shall I abort Configure"
4559 echo "The program compiled OK, but exited with status $?." >>try.msg
4560 rp="You have a problem. Shall I abort Configure"
4564 echo "I can't compile the test program." >>try.msg
4565 rp="You have a BIG problem. Shall I abort Configure"
4571 case "$knowitall" in
4573 echo "(The supplied flags or libraries might be incorrect.)"
4581 *) echo "Ok. Stopping Configure." >&4
4586 n) echo "OK, that should do.";;
4588 $rm -f try try.* core
4590 : define a shorthand compile call
4594 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
4595 : define a shorthand compile call for compilations that should be ok.
4599 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
4601 : check for lengths of integral types
4605 echo "Checking to see how big your integers are..." >&4
4606 $cat >try.c <<'EOCP'
4610 printf("intsize=%d;\n", (int)sizeof(int));
4611 printf("longsize=%d;\n", (int)sizeof(long));
4612 printf("shortsize=%d;\n", (int)sizeof(short));
4617 if eval $compile_ok && $run ./try > /dev/null; then
4619 echo "Your integers are $intsize bytes long."
4620 echo "Your long integers are $longsize bytes long."
4621 echo "Your short integers are $shortsize bytes long."
4625 Help! I can't compile and run the intsize test program: please enlighten me!
4626 (This is probably a misconfiguration in your system or libraries, and
4627 you really ought to fix it. Still, I'll try anyway.)
4631 rp="What is the size of an integer (in bytes)?"
4635 rp="What is the size of a long integer (in bytes)?"
4639 rp="What is the size of a short integer (in bytes)?"
4647 : check for void type
4649 echo "Checking to see how well your C compiler groks the void type..." >&4
4650 case "$voidflags" in
4652 $cat >try.c <<'EOCP'
4658 extern void moo(); /* function returning void */
4659 void (*goo)(); /* ptr to func returning void */
4661 void *hue; /* generic ptr */
4674 int main() { sub(); }
4676 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
4677 voidflags=$defvoidused
4678 echo "Good. It appears to support void to the level $package wants.">&4
4679 if $contains warning .out >/dev/null 2>&1; then
4680 echo "However, you might get some warnings that look like this:"
4684 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
4685 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
4686 echo "It supports 1..."
4687 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
4688 echo "It also supports 2..."
4689 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
4691 echo "And it supports 4 but not 8 definitely."
4693 echo "It doesn't support 4..."
4694 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
4696 echo "But it supports 8."
4699 echo "Neither does it support 8."
4703 echo "It does not support 2..."
4704 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
4706 echo "But it supports 4 and 8."
4708 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
4710 echo "And it supports 4 but has not heard about 8."
4712 echo "However it supports 8 but not 4."
4717 echo "There is no support at all for void."
4722 case "$voidflags" in
4725 Support flag bits are:
4726 1: basic void declarations.
4727 2: arrays of pointers to functions returning void.
4728 4: operations between pointers to and addresses of void functions.
4729 8: generic void pointers.
4732 rp="Your void support flags add up to what?"
4739 : check for length of pointer
4743 echo "Checking to see how big your pointers are..." >&4
4744 if test "$voidflags" -gt 7; then
4745 echo '#define VOID_PTR char *' > try.c
4747 echo '#define VOID_PTR void *' > try.c
4749 $cat >>try.c <<'EOCP'
4753 printf("%d\n", (int)sizeof(VOID_PTR));
4758 if eval $compile_ok; then
4759 ptrsize=`$run ./try`
4760 echo "Your pointers are $ptrsize bytes long."
4763 echo "(I can't seem to compile the test program. Guessing...)" >&4
4764 rp="What is the size of a pointer (in bytes)?"
4772 : check for long long
4774 echo "Checking to see if you have long long..." >&4
4775 echo 'int main() { long long x = 7; return 0; }' > try.c
4777 if eval $compile; then
4779 echo "You have long long."
4782 echo "You do not have long long."
4788 : check for length of long long
4789 case "${d_longlong}${longlongsize}" in
4792 echo "Checking to see how big your long longs are..." >&4
4793 $cat >try.c <<'EOCP'
4797 printf("%d\n", (int)sizeof(long long));
4802 if eval $compile_ok; then
4803 longlongsize=`$run ./try`
4804 echo "Your long longs are $longlongsize bytes long."
4808 echo "(I can't seem to compile the test program. Guessing...)"
4809 rp="What is the size of a long long (in bytes)?"
4813 if $test "X$longsize" = "X$longlongsize"; then
4814 echo "(That isn't any different from an ordinary long.)"
4820 : determine filename position in cpp output
4822 echo "Computing filename position in cpp output for #include directives..." >&4
4823 echo '#include <stdio.h>' > foo.c
4826 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
4827 $grep '^[ ]*#.*stdio\.h' | \
4828 while read cline; do
4831 while $test \$# -gt 0; do
4832 if $test -r \`echo \$1 | $tr -d '"'\`; then
4837 pos=\`expr \$pos + 1\`
4849 *) pos="${fieldn}th";;
4851 echo "Your cpp writes the filename in the $pos field of the line."
4853 : locate header file
4858 for usrincdir in $usrinc
4860 if test -f \$usrincdir/\$wanted; then
4861 echo "\$usrincdir/\$wanted"
4865 awkprg='{ print \$$fieldn }'
4866 echo "#include <\$wanted>" > foo\$\$.c
4867 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
4868 $grep "^[ ]*#.*\$wanted" | \
4869 while read cline; do
4870 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
4872 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
4873 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
4878 # status = 0: grep returned 0 lines, case statement not executed
4879 # status = 1: headerfile found
4880 # status = 2: while loop executed, no headerfile found
4884 if test \$status -eq 1; then
4891 : define an alternate in-header-list? function
4892 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
4893 cont=true; xxf="echo \"<\$1> found.\" >&4";
4894 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
4895 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
4897 case $# in 4) instead=instead;; *) instead="at last";; esac;
4898 while $test "$cont"; do
4900 var=$2; eval "was=\$$2";
4901 if $test "$xxx" && $test -r "$xxx";
4903 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
4906 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
4907 set $yyy; shift; shift; yyy=$@;
4908 case $# in 0) cont="";;
4909 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
4910 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
4911 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
4912 xxnf="echo \"there is no <\$1>, ...\" >&4";;
4916 do set $yyy; var=$2; eval "was=\$$2";
4917 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
4918 set $yyy; shift; shift; yyy=$@;
4921 : see if inttypes.h is available
4922 : we want a real compile instead of Inhdr because some systems
4923 : have an inttypes.h which includes non-existent headers
4926 #include <inttypes.h>
4928 static int32_t foo32 = 0x12345678;
4932 if eval $compile; then
4933 echo "<inttypes.h> found." >&4
4936 echo "<inttypes.h> NOT found." >&4
4945 echo "Checking to see if you have int64_t..." >&4
4947 #include <sys/types.h>
4948 #$i_inttypes I_INTTYPES
4950 #include <inttypes.h>
4952 int main() { int64_t x = 7; }
4955 if eval $compile; then
4957 echo "You have int64_t."
4960 echo "You do not have int64_t."
4968 echo "Checking which 64-bit integer type we could use..." >&4
4974 val='"unsigned int"'
4979 *) case "$longsize" in
4983 val='"unsigned long"'
4988 *) case "$d_longlong:$longlongsize" in
4993 val='"unsigned long long"'
4998 *) case "$d_int64_t" in
5017 '') echo "Alas, no 64-bit integer types in sight." >&4
5020 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5026 case "$uselonglong" in
5027 "$define"|true|[yY]*)
5030 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5032 use64bitint="$define"
5035 case "$use64bits" in
5036 "$define"|true|[yY]*)
5039 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5041 use64bitint="$define"
5044 case "$use64bitints" in
5045 "$define"|true|[yY]*)
5048 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5050 use64bitint="$define"
5053 case "$use64bitsint" in
5054 "$define"|true|[yY]*)
5057 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5059 use64bitint="$define"
5062 case "$uselonglongs" in
5063 "$define"|true|[yY]*)
5066 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5068 use64bitint="$define"
5071 case "$use64bitsall" in
5072 "$define"|true|[yY]*)
5075 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5077 use64bitall="$define"
5082 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5084 case "$use64bitall" in
5085 "$define"|true|[yY]*) use64bitint="$define" ;;
5091 You have natively 64-bit long integers.
5095 *) case "$use64bitint" in
5096 "$define"|true|[yY]*) dflt='y';;
5105 Perl can be built to take advantage of 64-bit integer types
5106 on some systems. To do so, Configure can be run with -Duse64bitint.
5107 Choosing this option will most probably introduce binary incompatibilities.
5109 If this doesn't make any sense to you, just accept the default '$dflt'.
5110 (The default has been chosen based on your configuration.)
5112 rp='Try to use 64-bit integers, if available?'
5115 [yY]*) val="$define" ;;
5123 case "$use64bitall" in
5124 "$define"|true|[yY]*) dflt='y' ;;
5125 *) case "$longsize" in
5133 You may also choose to try maximal 64-bitness. It means using as much
5134 64-bitness as possible on the platform. This in turn means even more
5135 binary incompatibilities. On the other hand, your platform may not
5136 have any more 64-bitness available than what you already have chosen.
5138 If this doesn't make any sense to you, just accept the default '$dflt'.
5139 (The default has been chosen based on your configuration.)
5141 rp='Try to use maximal 64-bit support, if available?'
5144 [yY]*) val="$define" ;;
5149 case "$use64bitall" in
5151 case "$use64bitint" in
5155 Since you have chosen a maximally 64-bit build, I'm also turning on
5156 the use of 64-bit integers.
5158 use64bitint="$define" ;;
5163 case "$use64bitall" in
5164 "$define"|true|[yY]*)
5168 *** You have chosen a maximally 64-bit build, but your pointers
5169 *** are only 4 bytes wide, disabling maximal 64-bitness.
5172 use64bitall="$undef"
5173 case "$use64bitint" in
5174 "$define"|true|[yY]*) ;;
5177 *** Downgrading from maximal 64-bitness to using 64-bit integers.
5180 use64bitint="$define"
5188 case "$use64bitint" in
5189 "$define"|true|[yY]*)
5190 : Look for a hint-file generated 'call-back-unit'. If the
5191 : user has specified that a 64-bit perl is to be built,
5192 : we may need to set or change some other defaults.
5193 if $test -f use64bitint.cbu; then
5194 echo "Your platform has some specific hints for 64-bit integers, using them..."
5198 4) case "$archname64" in
5199 '') archname64=64int ;;
5206 case "$use64bitall" in
5207 "$define"|true|[yY]*)
5208 : Look for a hint-file generated 'call-back-unit'. If the
5209 : user has specified that a maximally 64-bit perl is to be built,
5210 : we may need to set or change some other defaults.
5211 if $test -f use64bitall.cbu; then
5212 echo "Your platform has some specific hints for 64-bit builds, using them..."
5216 4) case "$archname64" in
5217 ''|64int) archname64=64all ;;
5225 echo "Checking for GNU C Library..." >&4
5238 if eval $compile_ok && $run ./try; then
5240 echo "You are using the GNU C Library"
5243 echo "You are not using the GNU C Library"
5249 : see if nm is to be used to determine whether a symbol is defined or not
5253 case "$d_gnulibc" in
5256 echo "nm probably won't work on the GNU C Library." >&4
5262 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
5264 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
5265 echo "'nm' won't be sufficient on this sytem." >&4
5271 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
5272 if $test $dflt -gt 20; then
5282 true|$define) dflt=y;;
5289 I can use $nm to extract the symbols from your C libraries. This
5290 is a time consuming task which may generate huge output on the disk (up
5291 to 3 megabytes) but that should make the symbols extraction faster. The
5292 alternative is to skip the 'nm' extraction part and to compile a small
5293 test program instead to determine whether each symbol is present. If
5294 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
5295 this may be the best solution.
5297 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
5300 rp="Shall I use $nm to extract C symbols from the libraries?"
5303 [Nn]*) usenm=false;;
5312 : nm options which may be necessary
5314 '') if $test -f /mach_boot; then
5316 elif $test -d /usr/ccs/lib; then
5317 nm_opt='-p' # Solaris (and SunOS?)
5318 elif $test -f /dgux; then
5320 elif $test -f /lib64/rld; then
5321 nm_opt='-p' # 64-bit Irix
5327 : nm options which may be necessary for shared libraries but illegal
5328 : for archive libraries. Thank you, Linux.
5329 case "$nm_so_opt" in
5330 '') case "$myuname" in
5332 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
5333 nm_so_opt='--dynamic'
5342 : get list of predefined functions in a handy place
5347 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
5353 *) for thislib in $libs; do
5356 : Handle C library specially below.
5359 thislib=`echo $thislib | $sed -e 's/^-l//'`
5360 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
5362 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
5364 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
5366 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
5368 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
5370 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
5372 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
5377 libnames="$libnames $try"
5379 *) libnames="$libnames $thislib" ;;
5388 for xxx in $libpth; do
5389 $test -r $1 || set $xxx/libc.$so
5390 : The messy sed command sorts on library version numbers.
5392 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
5393 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
5395 s/[0-9][0-9]*/0000&/g
5396 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
5399 $sort | $sed -e 's/^.* //'`
5402 $test -r $1 || set /usr/ccs/lib/libc.$so
5403 $test -r $1 || set /lib/libsys_s$_a
5409 if $test -r "$1"; then
5410 echo "Your (shared) C library seems to be in $1."
5412 elif $test -r /lib/libc && $test -r /lib/clib; then
5413 echo "Your C library seems to be in both /lib/clib and /lib/libc."
5415 libc='/lib/clib /lib/libc'
5416 if $test -r /lib/syslib; then
5417 echo "(Your math library is in /lib/syslib.)"
5418 libc="$libc /lib/syslib"
5420 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5421 echo "Your C library seems to be in $libc, as you said before."
5422 elif $test -r $incpath/usr/lib/libc$_a; then
5423 libc=$incpath/usr/lib/libc$_a;
5424 echo "Your C library seems to be in $libc. That's fine."
5425 elif $test -r /lib/libc$_a; then
5427 echo "Your C library seems to be in $libc. You're normal."
5429 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
5431 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
5432 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
5433 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
5435 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5437 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5440 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
5442 if $test -r "$tans"; then
5443 echo "Your C library seems to be in $tans, of all places."
5449 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5453 If the guess above is wrong (which it might be if you're using a strange
5454 compiler, or your machine supports multiple models), you can override it here.
5459 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
5461 I can't seem to find your C library. I've looked in the following places:
5464 $sed 's/^/ /' libpath
5467 None of these seems to contain your C library. I need to get its name...
5472 rp='Where is your C library?'
5477 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
5478 set X `cat libnames`
5481 case $# in 1) xxx=file; esac
5482 echo "Extracting names from the following $xxx for later perusal:" >&4
5484 $sed 's/^/ /' libnames >&4
5486 $echo $n "This may take a while...$c" >&4
5490 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
5491 *) $nm $nm_opt $file 2>/dev/null;;
5496 $grep fprintf libc.tmp > libc.ptf
5497 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
5498 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
5500 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
5502 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5504 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
5506 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5508 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
5510 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5512 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
5514 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5516 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
5518 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5520 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
5522 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5524 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
5525 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
5527 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5529 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
5531 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5533 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
5535 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5537 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
5539 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5541 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
5543 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5545 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
5547 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5549 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
5551 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5553 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
5555 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5558 $nm -p $* 2>/dev/null >libc.tmp
5559 $grep fprintf libc.tmp > libc.ptf
5560 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
5561 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
5567 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
5569 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
5570 for thisname in $libnames $libc; do
5571 $ar t $thisname >>libc.tmp
5573 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
5575 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
5576 # Repeat libc to extract forwarders to DLL entries too
5577 for thisname in $libnames $libc; do
5578 $ar tv $thisname >>libc.tmp
5579 # Revision 50 of EMX has bug in $ar.
5580 # it will not extract forwarders to DLL entries
5581 # Use emximp which will extract exactly them.
5582 emximp -o tmp.imp $thisname \
5584 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
5585 < tmp.imp >>libc.tmp
5588 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
5591 echo "$ar didn't seem to work right." >&4
5592 echo "Maybe this is a Cray...trying bld instead..." >&4
5593 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
5595 for thisname in $libnames; do
5597 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
5598 $ar t $thisname >>libc.tmp
5602 echo "That didn't work either. Giving up." >&4
5609 if $test -f /lib/syscalls.exp; then
5611 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
5612 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' /lib/syscalls.exp >>libc.list
5616 $rm -f libnames libpath
5618 : is a C symbol defined?
5621 -v) tf=libc.tmp; tc=""; tdc="";;
5622 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
5623 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
5626 case "$reuseval-$4" in
5628 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
5634 if $contains $tlook $tf >/dev/null 2>&1;
5639 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
5640 if $cc -o t $optimize $ccflags $ldflags t.c $libs >/dev/null 2>&1;
5648 $define) tval=true;;
5654 : define an is-in-libc? function
5655 inlibc='echo " "; td=$define; tu=$undef;
5656 sym=$1; var=$2; eval "was=\$$2";
5658 case "$reuseval$was" in
5668 echo "$sym() found." >&4;
5669 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
5671 echo "$sym() NOT found." >&4;
5672 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
5676 $define) echo "$sym() found." >&4;;
5677 *) echo "$sym() NOT found." >&4;;
5681 : see if sqrtl exists
5686 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
5689 case "$uselongdouble" in
5690 $define|true|[yY]*) dflt='y';;
5695 Perl can be built to take advantage of long doubles which
5696 (if available) may give more accuracy and range for floating point numbers.
5698 If this doesn't make any sense to you, just accept the default '$dflt'.
5700 rp='Try to use long doubles if available?'
5703 y|Y) val="$define" ;;
5709 case "$uselongdouble" in
5710 true|[yY]*) uselongdouble="$define" ;;
5713 case "$uselongdouble" in
5715 : Look for a hint-file generated 'call-back-unit'. If the
5716 : user has specified that long doubles should be used,
5717 : we may need to set or change some other defaults.
5718 if $test -f uselongdouble.cbu; then
5719 echo "Your platform has some specific hints for long doubles, using them..."
5720 . ./uselongdouble.cbu
5723 (Your platform doesn't have any specific hints for long doubles.)
5729 case "$uselongdouble:$d_sqrtl" in
5733 *** You requested the use of long doubles but you do not seem to have
5734 *** the mathematic functions for long doubles. I'm disabling the use
5735 *** of long doubles.
5738 uselongdouble=$undef
5742 : check for length of double
5744 case "$doublesize" in
5746 echo "Checking to see how big your double precision numbers are..." >&4
5747 $cat >try.c <<'EOCP'
5751 printf("%d\n", (int)sizeof(double));
5756 if eval $compile_ok; then
5757 doublesize=`$run ./try`
5758 echo "Your double is $doublesize bytes long."
5761 echo "(I can't seem to compile the test program. Guessing...)"
5762 rp="What is the size of a double precision number (in bytes)?"
5770 : check for long doubles
5772 echo "Checking to see if you have long double..." >&4
5773 echo 'int main() { long double x = 7.0; }' > try.c
5775 if eval $compile; then
5777 echo "You have long double."
5780 echo "You do not have long double."
5786 : check for length of long double
5787 case "${d_longdbl}${longdblsize}" in
5790 echo "Checking to see how big your long doubles are..." >&4
5791 $cat >try.c <<'EOCP'
5795 printf("%d\n", sizeof(long double));
5800 if eval $compile; then
5801 longdblsize=`$run ./try`
5802 echo "Your long doubles are $longdblsize bytes long."
5806 echo "(I can't seem to compile the test program. Guessing...)" >&4
5807 rp="What is the size of a long double (in bytes)?"
5811 if $test "X$doublesize" = "X$longdblsize"; then
5812 echo "(That isn't any different from an ordinary double.)"
5818 case "$useperlio" in
5819 $define|true|[yY]*|'') dflt='y';;
5824 Previous version of $package used the standard IO mechanisms as
5825 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
5826 alternate IO mechanisms via the PerlIO abstraction layer, but the
5827 stdio mechanism is still available if needed. The abstraction layer
5828 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
5829 Using PerlIO with sfio may cause problems with some extension modules.
5831 If this doesn't make any sense to you, just accept the default '$dflt'.
5833 rp='Use the PerlIO abstraction layer?'
5840 echo "Ok, doing things the stdio way."
5849 case "$useperlio" in
5850 $define|true|[yY]*) ;;
5853 You are using the SOCKS proxy protocol library which means that you
5854 should also use the PerlIO layer. You may be headed for trouble.
5863 : determine the architecture name
5865 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5866 tarch=`arch`"-$osname"
5867 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5868 if uname -m > tmparch 2>&1 ; then
5869 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5870 -e 's/$/'"-$osname/" tmparch`
5878 case "$myarchname" in
5881 echo "(Your architecture name used to be $myarchname.)"
5885 case "$targetarch" in
5887 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
5892 *) dflt="$archname";;
5894 rp='What is your architecture name'
5897 case "$usethreads" in
5899 echo "Threads selected." >&4
5901 *-thread*) echo "...and architecture name already has -thread." >&4
5903 *) archname="$archname-thread"
5904 echo "...setting architecture name to $archname." >&4
5909 case "$usemultiplicity" in
5911 echo "Multiplicity selected." >&4
5913 *-multi*) echo "...and architecture name already has -multi." >&4
5915 *) archname="$archname-multi"
5916 echo "...setting architecture name to $archname." >&4
5921 case "$use64bitint$use64bitall" in
5923 case "$archname64" in
5925 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
5928 case "$use64bitint" in
5929 "$define") echo "64 bit integers selected." >&4 ;;
5931 case "$use64bitall" in
5932 "$define") echo "Maximal 64 bitness selected." >&4 ;;
5935 *-$archname64*) echo "...and architecture name already has $archname64." >&4
5937 *) archname="$archname-$archname64"
5938 echo "...setting architecture name to $archname." >&4
5944 case "$uselongdouble" in
5946 echo "Long doubles selected." >&4
5947 case "$longdblsize" in
5949 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
5953 *-ld*) echo "...and architecture name already has -ld." >&4
5955 *) archname="$archname-ld"
5956 echo "...setting architecture name to $archname." >&4
5963 case "$useperlio" in
5965 echo "Perlio selected." >&4
5968 echo "Perlio not selected, using stdio." >&4
5970 *-stdio*) echo "...and architecture name already has -stdio." >&4
5972 *) archname="$archname-stdio"
5973 echo "...setting architecture name to $archname." >&4
5979 : determine root of directory hierarchy where package will be installed.
5982 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
5990 By default, $package will be installed in $dflt/bin, manual pages
5991 under $dflt/man, etc..., i.e. with $dflt as prefix for all
5992 installation directories. Typically this is something like /usr/local.
5993 If you wish to have binaries under /usr/bin but other parts of the
5994 installation under /usr/local, that's ok: you will be prompted
5995 separately for each of the installation directories, the prefix being
5996 only used to set the defaults.
6000 rp='Installation prefix to use?'
6008 *) oldprefix="$prefix";;
6017 *) afsroot=$afsroot ;;
6023 $define|true) afs=true ;;
6024 $undef|false) afs=false ;;
6025 *) if test -d $afsroot; then
6033 echo "AFS may be running... I'll be extra cautious then..." >&4
6035 echo "AFS does not seem to be running..." >&4
6038 : determine installation prefix for where package is to be installed.
6042 Since you are running AFS, I need to distinguish the directory in which
6043 files will reside from the directory in which they are installed (and from
6044 which they are presumably copied to the former directory by occult means).
6047 case "$installprefix" in
6048 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
6049 *) dflt="$installprefix";;
6054 In some special cases, particularly when building $package for distribution,
6055 it is convenient to distinguish between the directory in which files should
6056 be installed from the directory ($prefix) in which they
6057 will eventually reside. For most users, these two directories are the same.
6060 case "$installprefix" in
6062 *) dflt=$installprefix;;
6066 rp='What installation prefix should I use for installing files?'
6068 installprefix="$ans"
6069 installprefixexp="$ansexp"
6071 : set the prefixit variable, to compute a suitable default value
6072 prefixit='case "$3" in
6074 case "$oldprefix" in
6075 "") eval "$1=\"\$$2\"";;
6082 ""|" ") eval "$1=\"\$$2\"";;
6088 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6090 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6091 /*-$oldprefix/*|\~*-$oldprefix/*)
6092 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6093 *) eval "$1=\"\$$2\"";;
6097 : get the patchlevel
6099 echo "Getting the current patchlevel..." >&4
6100 if $test -r $rsrc/patchlevel.h;then
6101 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
6102 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
6103 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
6104 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
6105 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
6106 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
6107 perl_patchlevel=`grep ',"DEVEL[0-9][0-9]*"' $rsrc/patchlevel.h|sed 's/[^0-9]//g'`
6116 $echo "(You do not have patchlevel.h. Eek.)"
6118 if $test -r $rsrc/.patch ; then
6119 if $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
6120 perl_patchlevel=`cat $rsrc/.patch`
6123 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
6124 version_patchlevel_string="version $patchlevel subversion $subversion"
6125 case "$perl_patchlevel" in
6127 *) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;;
6130 $echo "(You have $package $version_patchlevel_string.)"
6134 : XXX Should be a Configure test for double-dots in filenames.
6135 version=`echo $revision $patchlevel $subversion | \
6136 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
6137 api_versionstring=`echo $api_revision $api_version $api_subversion | \
6138 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
6141 version=`echo $revision $patchlevel $subversion | \
6142 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
6143 api_versionstring=`echo $api_revision $api_version $api_subversion | \
6144 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
6147 : Special case the 5.005_xx maintenance series, which used 5.005
6148 : without any subversion label as a subdirectory in $sitelib
6149 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
6150 api_versionstring='5.005'
6153 : determine installation style
6154 : For now, try to deduce it from prefix unless it is already set.
6155 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6156 case "$installstyle" in
6157 '') case "$prefix" in
6158 *perl*) dflt='lib';;
6159 *) dflt='lib/perl5' ;;
6162 *) dflt="$installstyle" ;;
6164 : Probably not worth prompting for this since we prompt for all
6165 : the directories individually, and the prompt would be too long and
6169 : determine where private library files go
6170 : Usual default is /usr/local/lib/perl5/$version.
6171 : Also allow things like /opt/perl/lib/$version, since
6172 : /opt/perl/lib/perl5... would be redundant.
6173 : The default "style" setting is made in installstyle.U
6174 case "$installstyle" in
6175 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6176 *) set dflt privlib lib/$version ;;
6181 There are some auxiliary files for $package that need to be put into a
6182 private library directory that is accessible by everyone.
6186 rp='Pathname where the private library files will reside?'
6189 privlibexp="$ansexp"
6190 : Change installation prefix, if necessary.
6191 if $test X"$prefix" != X"$installprefix"; then
6192 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
6194 installprivlib="$privlibexp"
6197 : set the prefixup variable, to restore leading tilda escape
6198 prefixup='case "$prefixexp" in
6200 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6203 : determine where public architecture dependent libraries go
6206 : privlib default is /usr/local/lib/$package/$version
6207 : archlib default is /usr/local/lib/$package/$version/$archname
6208 : privlib may have an optional trailing /share.
6209 tdflt=`echo $privlib | $sed 's,/share$,,'`
6210 tdflt=$tdflt/$archname
6219 $spackage contains architecture-dependent library files. If you are
6220 sharing libraries in a heterogeneous environment, you might store
6221 these files in a separate location. Otherwise, you can just include
6222 them with the rest of the public library files.
6226 rp='Where do you want to put the public architecture-dependent libraries?'
6229 archlibexp="$ansexp"
6230 if $test X"$archlib" = X"$privlib"; then
6235 : Change installation prefix, if necessary.
6236 if $test X"$prefix" != X"$installprefix"; then
6237 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
6239 installarchlib="$archlibexp"
6243 : Binary compatibility with 5.005 is not possible for builds
6244 : with advanced features
6245 case "$usethreads$usemultiplicity" in
6247 bincompat5005="$undef"
6248 d_bincompat5005="$undef"
6252 This version of Perl can be compiled for binary compatibility with 5.005.
6253 If you decide to do so, you will be able to continue using most of the
6254 extensions that were compiled for Perl 5.005.
6257 case "$bincompat5005$d_bincompat5005" in
6258 *"$undef"*) dflt=n ;;
6261 rp='Binary compatibility with Perl 5.005?'
6264 y*) val="$define" ;;
6269 case "$d_bincompat5005" in
6271 bincompat5005="$define"
6273 *) bincompat5005="$undef"
6274 d_bincompat5005="$undef"
6281 : see if setuid scripts can be secure
6284 Some kernels have a bug that prevents setuid #! scripts from being
6285 secure. Some sites have disabled setuid #! scripts because of this.
6287 First let's decide if your kernel supports secure setuid #! scripts.
6288 (If setuid #! scripts would be secure but have been disabled anyway,
6289 don't say that they are secure if asked.)
6294 if $test -d /dev/fd; then
6295 echo "#!$ls" >reflect
6296 chmod +x,u+s reflect
6297 ./reflect >flect 2>&1
6298 if $contains "/dev/fd" flect >/dev/null; then
6299 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6303 If you are not sure if they are secure, I can check but I'll need a
6304 username and password different from the one you are using right now.
6305 If you don't have such a username or don't want me to test, simply
6309 rp='Other username to test security of setuid scripts with?'
6314 case "$d_suidsafe" in
6315 '') echo "I'll assume setuid scripts are *not* secure." >&4
6318 echo "Well, the $hint value is *not* secure." >&4
6320 *) echo "Well, the $hint value *is* secure." >&4
6325 $rm -f reflect flect
6326 echo "#!$ls" >reflect
6327 chmod +x,u+s reflect
6330 echo '"su" will (probably) prompt you for '"$ans's password."
6331 su $ans -c './reflect >flect'
6332 if $contains "/dev/fd" flect >/dev/null; then
6333 echo "Okay, it looks like setuid scripts are secure." >&4
6336 echo "I don't think setuid scripts are secure." >&4
6341 rp='Does your kernel have *secure* setuid scripts?'
6344 [yY]*) val="$define";;
6349 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6350 echo "(That's for file descriptors, not floppy disks.)"
6356 $rm -f reflect flect
6358 : now see if they want to do setuid emulation
6361 case "$d_suidsafe" in
6364 echo "No need to emulate SUID scripts since they are secure here." >& 4
6368 Some systems have disabled setuid scripts, especially systems where
6369 setuid scripts cannot be secure. On systems where setuid scripts have
6370 been disabled, the setuid/setgid bits on scripts are currently
6371 useless. It is possible for $package to detect those bits and emulate
6372 setuid/setgid in a secure fashion. This emulation will only work if
6373 setuid scripts have been disabled in your kernel.
6377 "$define") dflt=y ;;
6380 rp="Do you want to do setuid/setgid emulation?"
6383 [yY]*) val="$define";;
6391 : see if this is a malloc.h system
6392 set malloc.h i_malloc
6395 : see if stdlib is available
6396 set stdlib.h i_stdlib
6399 : determine which malloc to compile in
6401 case "$usemymalloc" in
6402 [yY]*|true|$define) dflt='y' ;;
6403 [nN]*|false|$undef) dflt='n' ;;
6404 *) case "$ptrsize" in
6410 rp="Do you wish to attempt to use the malloc that comes with $package?"
6416 mallocsrc='malloc.c'
6417 mallocobj="malloc$_o"
6418 d_mymalloc="$define"
6421 : Remove malloc from list of libraries to use
6422 echo "Removing unneeded -lmalloc from library list" >&4
6423 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6426 echo "libs = $libs" >&4
6438 : compute the return types of malloc and free
6440 $cat >malloc.c <<END
6444 #include <sys/types.h>
6458 case "$malloctype" in
6460 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6467 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6471 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6478 echo "Your system uses $freetype free(), it would seem." >&4
6482 After $package is installed, you may wish to install various
6483 add-on modules and utilities. Typically, these add-ons will
6484 be installed under $prefix with the rest
6485 of this package. However, you may wish to install such add-ons
6486 elsewhere under a different prefix.
6488 If you do not wish to put everything under a single prefix, that's
6489 ok. You will be prompted for the individual locations; this siteprefix
6490 is only used to suggest the defaults.
6492 The default should be fine for most people.
6496 rp='Installation prefix to use for add-on modules and utilities?'
6497 : XXX Here might be another good place for an installstyle setting.
6498 case "$siteprefix" in
6500 *) dflt=$siteprefix ;;
6503 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6505 case "$siteprefix" in
6509 *) oldsiteprefix="$prefix";;
6514 siteprefixexp="$ansexp"
6516 : determine where site specific libraries go.
6517 : Usual default is /usr/local/lib/perl5/site_perl/$version
6518 : The default "style" setting is made in installstyle.U
6519 : XXX No longer works with Prefixit stuff.
6520 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6522 '') case "$installstyle" in
6523 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6524 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6532 The installation process will create a directory for
6533 site-specific extensions and modules. Most users find it convenient
6534 to place all site-specific files in this directory rather than in the
6535 main distribution directory.
6539 rp='Pathname for the site-specific library files?'
6542 sitelibexp="$ansexp"
6543 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6544 : Change installation prefix, if necessary.
6545 if $test X"$prefix" != X"$installprefix"; then
6546 installsitelib=`echo $sitelibexp | $sed "s#^$prefix#$installprefix#"`
6548 installsitelib="$sitelibexp"
6551 : determine where site specific architecture-dependent libraries go.
6552 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6553 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6554 : sitelib may have an optional trailing /share.
6556 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6557 dflt="$dflt/$archname"
6562 set sitearch sitearch none
6566 The installation process will also create a directory for
6567 architecture-dependent site-specific extensions and modules.
6571 rp='Pathname for the site-specific architecture-dependent library files?'
6574 sitearchexp="$ansexp"
6575 : Change installation prefix, if necessary.
6576 if $test X"$prefix" != X"$installprefix"; then
6577 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
6579 installsitearch="$sitearchexp"
6584 The installation process will also create a directory for
6585 vendor-supplied add-ons. Vendors who supply perl with their system
6586 may find it convenient to place all vendor-supplied files in this
6587 directory rather than in the main distribution directory. This will
6588 ease upgrades between binary-compatible maintenance versions of perl.
6590 Of course you may also use these directories in whatever way you see
6591 fit. For example, you might use them to access modules shared over a
6592 company-wide network.
6594 The default answer should be fine for most people.
6595 This causes further questions about vendor add-ons to be skipped
6596 and no vendor-specific directories will be configured for perl.
6599 rp='Do you want to configure vendor-specific add-on directories?'
6600 case "$usevendorprefix" in
6601 define|true|[yY]*) dflt=y ;;
6602 *) : User may have set vendorprefix directly on Configure command line.
6603 case "$vendorprefix" in
6612 rp='Installation prefix to use for vendor-supplied add-ons?'
6613 case "$vendorprefix" in
6615 *) dflt=$vendorprefix ;;
6618 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6620 case "$vendorprefix" in
6624 *) oldvendorprefix="$prefix";;
6628 usevendorprefix="$define"
6630 vendorprefixexp="$ansexp"
6632 *) usevendorprefix="$undef"
6638 case "$vendorprefix" in
6639 '') d_vendorlib="$undef"
6643 *) d_vendorlib="$define"
6644 : determine where vendor-supplied modules go.
6645 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6646 case "$vendorlib" in
6648 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6649 case "$installstyle" in
6650 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6651 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6654 *) dflt="$vendorlib"
6658 rp='Pathname for the vendor-supplied library files?'
6661 vendorlibexp="$ansexp"
6664 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6665 : Change installation prefix, if necessary.
6666 if $test X"$prefix" != X"$installprefix"; then
6667 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
6669 installvendorlib="$vendorlibexp"
6672 case "$vendorprefix" in
6673 '') d_vendorarch="$undef"
6677 *) d_vendorarch="$define"
6678 : determine where vendor-supplied architecture-dependent libraries go.
6679 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6680 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6681 : vendorlib may have an optional trailing /share.
6682 case "$vendorarch" in
6683 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6684 dflt="$dflt/$archname"
6686 *) dflt="$vendorarch" ;;
6689 rp='Pathname for vendor-supplied architecture-dependent files?'
6692 vendorarchexp="$ansexp"
6695 : Change installation prefix, if necessary.
6696 if $test X"$prefix" != X"$installprefix"; then
6697 installvendorarch=`echo $vendorarchexp | sed "s#^$prefix#$installprefix#"`
6699 installvendorarch="$vendorarchexp"
6702 : Final catch-all directories to search
6705 Lastly, you can have perl look in other directories for extensions and
6706 modules in addition to those already specified.
6707 These directories will be searched after
6711 test X"$vendorlib" != "X" && echo ' ' $vendorlib
6712 test X"$vendorarch" != "X" && echo ' ' $vendorarch
6714 case "$otherlibdirs" in
6715 ''|' ') dflt='none' ;;
6716 *) dflt="$otherlibdirs" ;;
6719 Enter a colon-separated set of extra paths to include in perl's @INC
6720 search path, or enter 'none' for no extra paths.
6724 rp='Colon-separated list of additional directories for perl to search?'
6727 ' '|''|none) otherlibdirs=' ' ;;
6728 *) otherlibdirs="$ans" ;;
6730 case "$otherlibdirs" in
6734 set d_perl_otherlibdirs
6737 : Cruising for prototypes
6739 echo "Checking out function prototypes..." >&4
6740 $cat >prototype.c <<'EOCP'
6741 int main(int argc, char *argv[]) {
6744 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
6745 echo "Your C compiler appears to support function prototypes."
6748 echo "Your C compiler doesn't seem to understand function prototypes."
6755 case "$prototype" in
6757 *) ansi2knr='ansi2knr'
6762 This version of $package can only be compiled by a compiler that
6763 understands function prototypes. Unfortunately, your C compiler
6765 doesn't seem to understand them. Sorry about that.
6767 If GNU cc is available for your system, perhaps you could try that instead.
6769 Eventually, we hope to support building Perl with pre-ANSI compilers.
6770 If you would like to help in that effort, please contact <perlbug@perl.org>.
6772 Aborting Configure now.
6778 : determine where public executables go
6783 rp='Pathname where the public executables will reside?'
6785 if $test "X$ansexp" != "X$binexp"; then
6790 : Change installation prefix, if necessary.
6791 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6792 if $test X"$prefix" != X"$installprefix"; then
6793 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
6795 installbin="$binexp"
6804 Perl can be built with extra modules or bundles of modules which
6805 will be fetched from the CPAN and installed alongside Perl.
6807 Notice that you will need access to the CPAN; either via the Internet,
6808 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
6809 be asked later to configure the CPAN.pm module which will in turn do
6810 the installation of the rest of the extra modules or bundles.)
6812 Notice also that if the modules require any external software such as
6813 libraries and headers (the libz library and the zlib.h header for the
6814 Compress::Zlib module, for example) you MUST have any such software
6815 already installed, this configuration process will NOT install such
6818 If this doesn't make any sense to you, just accept the default '$dflt'.
6820 rp='Install any extra modules (y or n)?'
6826 Please list any extra modules or bundles to be installed from CPAN,
6827 with spaces between the names. The names can be in any format the
6828 'install' command of CPAN.pm will understand. (Answer 'none',
6829 without the quotes, to install no extra modules or bundles.)
6839 $rm -f ../extras.lst
6841 *) echo "(Saving the list of extras for later...)"
6842 echo "$extras" > ../extras.lst
6850 : Find perl5.005 or later.
6851 echo "Looking for a previously installed perl5.005 or later... "
6853 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6854 : Check if this perl is recent and can load a simple module
6855 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6858 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6868 '') echo "None found. That's ok.";;
6869 *) echo "Using $perl5." ;;
6872 : Determine list of previous versions to include in @INC
6873 $cat > getverlist <<EOPL
6876 \$api_versionstring = "$api_versionstring";
6877 \$version = "$version";
6878 \$stem = "$sitelib_stem";
6879 \$archname = "$archname";
6881 $cat >> getverlist <<'EOPL'
6882 # Can't have leading @ because metaconfig interprets it as a command!
6883 ;@inc_version_list=();
6884 # XXX Redo to do opendir/readdir?
6887 ;@candidates = glob("5.*");
6893 # XXX ToDo: These comparisons must be reworked when two-digit
6894 # subversions come along, so that 5.7.10 compares as greater than
6895 # 5.7.3! By that time, hope that 5.6.x is sufficiently
6896 # widespread that we can use the built-in version vectors rather
6897 # than reinventing them here. For 5.6.0, however, we must
6898 # assume this script will likely be run by 5.005_0x. --AD 1/2000.
6899 foreach $d (@candidates) {
6900 if ($d lt $version) {
6901 if ($d ge $api_versionstring) {
6902 unshift(@inc_version_list, grep { -d } "$d/$archname", $d);
6904 elsif ($d ge "5.005") {
6905 unshift(@inc_version_list, grep { -d } $d);
6909 # Skip newer version. I.e. don't look in
6910 # 5.7.0 if we're installing 5.6.1.
6914 if (@inc_version_list) {
6915 print join(' ', @inc_version_list);
6918 # Blank space to preserve value for next Configure run.
6923 case "$inc_version_list" in
6924 '') if test -x "$perl5$exe_ext"; then
6925 dflt=`$perl5 getverlist`
6930 $undef) dflt='none' ;;
6931 *) eval dflt=\"$inc_version_list\" ;;
6934 ''|' ') dflt=none ;;
6937 5.005) case "$bincompat5005" in
6938 $define|true|[yY]*) ;;
6945 In order to ease the process of upgrading, this version of perl
6946 can be configured to use modules built and installed with earlier
6947 versions of perl that were installed under $prefix. Specify here
6948 the list of earlier versions that this version of perl should check.
6949 If Configure detected no earlier versions of perl installed under
6950 $prefix, then the list will be empty. Answer 'none' to tell perl
6951 to not search earlier versions.
6953 The default should almost always be sensible, so if you're not sure,
6954 just accept the default.
6957 rp='List of earlier versions to include in @INC?'
6960 [Nn]one|''|' ') inc_version_list=' ' ;;
6961 *) inc_version_list="$ans" ;;
6963 case "$inc_version_list" in
6965 inc_version_list_init='0';;
6966 *) inc_version_list_init=`echo $inc_version_list |
6967 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6972 : determine whether to install perl also as /usr/bin/perl
6975 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
6977 Many scripts expect perl to be installed as /usr/bin/perl.
6978 I can install the perl you are about to compile also as /usr/bin/perl
6979 (in addition to $installbin/perl).
6981 case "$installusrbinperl" in
6982 "$undef"|[nN]*) dflt='n';;
6985 rp="Do you want to install perl as /usr/bin/perl?"
6988 [yY]*) val="$define";;
6994 set installusrbinperl
6997 : see if dld is available
7001 : see if dlopen exists
7008 : determine which dynamic loading, if any, to compile in
7010 dldir="ext/DynaLoader"
7023 $define) dflt='y' ;;
7026 $define) dflt='y' ;;
7028 : Does a dl_xxx.xs file exist for this operating system
7029 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7032 rp="Do you wish to use dynamic loading?"
7039 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7040 dflt="$dldir/dl_${osname}.xs"
7041 elif $test "$d_dlopen" = "$define" ; then
7042 dflt="$dldir/dl_dlopen.xs"
7043 elif $test "$i_dld" = "$define" ; then
7044 dflt="$dldir/dl_dld.xs"
7049 *) dflt="$dldir/$dlsrc"
7052 echo "The following dynamic loading files are available:"
7053 : Can not go over to $dldir because getfile has path hard-coded in.
7054 tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir
7055 rp="Source file to use for dynamic loading"
7061 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7065 Some systems may require passing special flags to $cc -c to
7066 compile modules that will be used to create a shared library.
7067 To use no flags, say "none".
7070 case "$cccdlflags" in
7071 '') case "$gccversion" in
7072 '') case "$osname" in
7074 next) dflt='none' ;;
7075 irix*) dflt='-KPIC' ;;
7076 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7077 sunos) dflt='-pic' ;;
7081 *) case "$osname" in
7082 darwin) dflt='none' ;;
7083 svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7088 *) dflt="$cccdlflags" ;;
7090 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7093 none) cccdlflags=' ' ;;
7094 *) cccdlflags="$ans" ;;
7099 Some systems use ld to create libraries that can be dynamically loaded,
7100 while other systems (such as those using ELF) use $cc.
7104 '') $cat >try.c <<'EOM'
7105 /* Test for whether ELF binaries are produced */
7110 int i = open("a.out",O_RDONLY);
7113 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7114 exit(0); /* succeed (yes, it's ELF) */
7119 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7121 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7125 echo "I'll use ld to build dynamic libraries."
7134 rp="What command should be used to create dynamic libraries?"
7140 Some systems may require passing special flags to $ld to create a
7141 library that can be dynamically loaded. If your ld flags include
7142 -L/other/path options to locate libraries outside your loader's normal
7143 search path, you may need to specify those -L options here as well. To
7144 use no flags, say "none".
7147 case "$lddlflags" in
7148 '') case "$osname" in
7149 beos) dflt='-nostart' ;;
7151 case "$gccversion" in
7152 '') dflt="$dflt +vnocompatwarnings" ;;
7155 linux|irix*) dflt='-shared' ;;
7156 next) dflt='none' ;;
7157 solaris) dflt='-G' ;;
7158 sunos) dflt='-assert nodefinitions' ;;
7159 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
7163 *) dflt="$lddlflags" ;;
7166 : Try to guess additional flags to pick up local libraries.
7167 : Be careful not to append to a plain 'none'
7171 for thisflag in $ldflags; do
7176 *) dflt="$dflt $thisflag" ;;
7183 ''|' ') dflt='none' ;;
7186 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
7189 none) lddlflags=' ' ;;
7190 *) lddlflags="$ans" ;;
7195 Some systems may require passing special flags to $cc to indicate that
7196 the resulting executable will use dynamic linking. To use no flags,
7200 case "$ccdlflags" in
7201 '') case "$osname" in
7202 hpux) dflt='-Wl,-E' ;;
7203 linux) dflt='-rdynamic' ;;
7204 next) dflt='none' ;;
7205 sunos) dflt='none' ;;
7209 *) dflt="$ccdlflags" ;;
7211 rp="Any special flags to pass to $cc to use dynamic linking?"
7214 none) ccdlflags=' ' ;;
7215 *) ccdlflags="$ans" ;;
7229 # No dynamic loading being used, so don't bother even to prompt.
7232 *) case "$useshrplib" in
7233 '') case "$osname" in
7234 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
7236 also='Building a shared libperl is required for dynamic loading to work on your system.'
7241 also='Building a shared libperl is needed for MAB support.'
7259 The perl executable is normally obtained by linking perlmain.c with
7260 libperl${_a}, any static extensions (usually just DynaLoader), and
7261 any other libraries needed on this system (such as -lm, etc.). Since
7262 your system supports dynamic loading, it is probably possible to build
7263 a shared libperl.$so. If you will have more than one executable linked
7264 to libperl.$so, this will significantly reduce the size of each
7265 executable, but it may have a noticeable affect on performance. The
7266 default is probably sensible for your system.
7270 rp="Build a shared libperl.$so (y/n)"
7274 useshrplib='true' ;;
7275 *) useshrplib='false' ;;
7280 case "$useshrplib" in
7284 # Figure out a good name for libperl.so. Since it gets stored in
7285 # a version-specific architecture-dependent library, the version
7286 # number isn't really that important, except for making cc/ld happy.
7288 # A name such as libperl.so.3.1
7289 majmin="libperl.$so.$patchlevel.$subversion"
7290 # A name such as libperl.so.301
7291 majonly=`echo $patchlevel $subversion |
7292 $awk '{printf "%d%02d", $1, $2}'`
7293 majonly=libperl.$so.$majonly
7294 # I'd prefer to keep the os-specific stuff here to a minimum, and
7295 # rely on figuring it out from the naming of libc.
7296 case "${osname}${osvers}" in
7299 # XXX How handle the --version stuff for MAB?
7301 linux*) # ld won't link with a bare -lperl otherwise.
7304 cygwin*) # include version
7305 dflt=`echo libperl$version | sed -e 's/\./_/g'`$lib_ext
7307 *) # Try to guess based on whether libc has major.minor.
7309 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
7310 *libc.$so.[0-9]*) dflt=$majonly ;;
7311 *) dflt=libperl.$so ;;
7321 I need to select a good name for the shared libperl. If your system uses
7322 library names with major and minor numbers, then you might want something
7323 like $majmin. Alternatively, if your system uses a single version
7324 number for shared libraries, then you might want to use $majonly.
7325 Or, your system might be quite happy with a simple libperl.$so.
7327 Since the shared libperl will get installed into a version-specific
7328 architecture-dependent directory, the version number of the shared perl
7329 library probably isn't important, so the default should be o.k.
7332 rp='What name do you want to give to the shared libperl?'
7335 echo "Ok, I'll use $libperl"
7338 libperl="libperl${_a}"
7342 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
7346 WARNING: Use of the shrpdir variable for the installation location of
7347 the shared $libperl is not supported. It was never documented and
7348 will not work in this version. Let me (perlbug@perl.org)
7349 know of any problems this may cause.
7355 But your current setting of $shrpdir is
7356 the default anyway, so it's harmless.
7361 Further, your current attempted setting of $shrpdir
7362 conflicts with the value of $archlibexp/CORE
7363 that installperl will use.
7370 # How will the perl executable find the installed shared $libperl?
7371 # Add $xxx to ccdlflags.
7372 # If we can't figure out a command-line option, use $shrpenv to
7373 # set env LD_RUN_PATH. The main perl makefile uses this.
7374 shrpdir=$archlibexp/CORE
7377 if "$useshrplib"; then
7380 # We'll set it in Makefile.SH...
7386 xxx="-Wl,-R$shrpdir"
7388 linux|irix*|dec_osf)
7389 xxx="-Wl,-rpath,$shrpdir"
7392 # next doesn't like the default...
7395 # beos doesn't like the default, either.
7398 # hpux doesn't like the default, either.
7399 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
7402 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
7408 # Only add $xxx if it isn't already in ccdlflags.
7409 case " $ccdlflags " in
7411 *) ccdlflags="$ccdlflags $xxx"
7414 Adding $xxx to the flags
7415 passed to $ld so that the perl executable will find the
7416 installed shared $libperl.
7424 # Fix ccdlflags in AIX for building external extensions.
7425 # (For building Perl itself bare -bE:perl.exp is needed,
7426 # Makefile.SH takes care of this.)
7428 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
7430 # Respect a hint or command-line value.
7432 '') shrpenv="$tmp_shrpenv" ;;
7434 case "$ldlibpthname" in
7435 '') ldlibpthname=LD_LIBRARY_PATH ;;
7436 none) ldlibpthname='' ;;
7439 : determine where manual pages are on this system
7443 syspath='/usr/share/man/man1 /usr/man/man1'
7444 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
7445 syspath="$syspath /usr/man/u_man/man1"
7446 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
7447 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
7448 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
7449 sysman=`./loc . /usr/man/man1 $syspath`
7452 if $test -d "$sysman"; then
7453 echo "System manual is in $sysman." >&4
7455 echo "Could not find manual pages in source form." >&4
7458 : determine where manual pages go
7459 set man1dir man1dir none
7463 $spackage has manual pages available in source form.
7467 echo "However, you don't have nroff, so they're probably useless to you."
7469 '') man1dir="none";;
7472 echo "If you don't want the manual sources installed, answer 'none'."
7477 lookpath="$prefixexp/share/man/man1"
7478 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
7479 lookpath="$lookpath $prefixexp/man/p_man/man1"
7480 lookpath="$lookpath $prefixexp/man/u_man/man1"
7481 lookpath="$lookpath $prefixexp/man/man.1"
7483 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
7484 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
7494 rp="Where do the main $spackage manual pages (source) go?"
7496 if $test "X$man1direxp" != "X$ansexp"; then
7500 man1direxp="$ansexp"
7506 : Change installation prefix, if necessary.
7507 if $test X"$prefix" != X"$installprefix"; then
7508 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
7510 installman1dir="$man1direxp"
7513 : What suffix to use on installed man pages
7520 rp="What suffix should be used for the main $spackage man pages?"
7522 '') case "$man1dir" in
7536 *) dflt="$man1ext";;
7543 : see if we can have long filenames
7545 first=123456789abcdef
7547 if (echo hi >$first) 2>/dev/null; then
7548 if $test -f 123456789abcde; then
7549 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
7552 echo 'You can have filenames longer than 14 characters.'>&4
7557 You can't have filenames longer than 14 chars.
7558 You can't even think about them!
7564 $rm -rf 123456789abcde*
7566 : determine where library module manual pages go
7567 set man3dir man3dir none
7571 $spackage has manual pages for many of the library modules.
7577 However, you don't have nroff, so they're probably useless to you.
7580 '') man3dir="none";;
7584 case "$d_flexfnam" in
7587 However, your system can't handle the long file names like File::Basename.3.
7590 '') man3dir="none";;
7594 echo "If you don't want the manual sources installed, answer 'none'."
7595 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7597 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
7598 if $test -d "$privlib/man/man3"; then
7601 WARNING: Previous versions of perl installed man3 pages into
7602 $privlib/man/man3. This version will suggest a
7603 new default of $dflt.
7607 rp='Do you wish to preserve the old behavior?(y/n)'
7610 y*) dflt="$privlib/man/man3" ;;
7615 *) dflt="$man3dir" ;;
7622 rp="Where do the $package library man pages (source) go?"
7625 man3direxp="$ansexp"
7631 : Change installation prefix, if necessary.
7632 if $test X"$prefix" != X"$installprefix"; then
7633 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
7635 installman3dir="$man3direxp"
7638 : What suffix to use on installed man pages
7644 rp="What suffix should be used for the $package library man pages?"
7646 '') case "$man3dir" in
7660 *) dflt="$man3ext";;
7667 : see if we have to deal with yellow pages, now NIS.
7668 if $test -d /usr/etc/yp || $test -d /etc/yp; then
7669 if $test -f /usr/etc/nibindd; then
7671 echo "I'm fairly confident you're on a NeXT."
7673 rp='Do you get the hosts file via NetInfo?'
7682 y*) hostcat='nidump hosts .';;
7683 *) case "$hostcat" in
7684 nidump*) hostcat='';;
7694 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
7702 rp='Are you getting the hosts file via yellow pages?'
7705 y*) hostcat='ypcat hosts';;
7706 *) hostcat='cat /etc/hosts';;
7712 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
7715 '') test -f /etc/group && groupcat='cat /etc/group';;
7718 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
7721 : now get the host name
7723 echo "Figuring out host name..." >&4
7724 case "$myhostname" in
7726 echo 'Maybe "hostname" will work...'
7727 if tans=`sh -c hostname 2>&1` ; then
7735 if $test "$cont"; then
7737 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
7738 if tans=`cat /etc/systemid 2>&1` ; then
7740 phostname='cat /etc/systemid'
7741 echo "Whadyaknow. Xenix always was a bit strange..."
7744 elif $test -r /etc/systemid; then
7745 echo "(What is a non-Xenix system doing with /etc/systemid?)"
7748 if $test "$cont"; then
7749 echo 'No, maybe "uuname -l" will work...'
7750 if tans=`sh -c 'uuname -l' 2>&1` ; then
7752 phostname='uuname -l'
7754 echo 'Strange. Maybe "uname -n" will work...'
7755 if tans=`sh -c 'uname -n' 2>&1` ; then
7757 phostname='uname -n'
7759 echo 'Oh well, maybe I can mine it out of whoami.h...'
7760 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
7761 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
7762 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
7764 case "$myhostname" in
7765 '') echo "Does this machine have an identity crisis or something?"
7768 echo "Well, you said $myhostname before..."
7769 phostname='echo $myhostname';;
7775 : you do not want to know about this
7780 if $test "$myhostname" ; then
7782 rp='Your host name appears to be "'$myhostname'".'" Right?"
7790 : bad guess or no guess
7791 while $test "X$myhostname" = X ; do
7793 rp="Please type the (one word) name of your host:"
7798 : translate upper to lower if necessary
7799 case "$myhostname" in
7801 echo "(Normalizing case in your host name)"
7802 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
7806 case "$myhostname" in
7808 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
7809 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
7810 echo "(Trimming domain name from host name--host name is now $myhostname)"
7812 *) case "$mydomain" in
7815 test "X$hostcat" = "Xypcat hosts" &&
7816 ypmatch "$myhostname" hosts 2>/dev/null |\
7817 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
7820 test "X$hostcat" != "X" &&
7821 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
7822 /[ ]$myhostname[ . ]/p" > hosts
7825 if $test -f hosts; then
7826 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
7827 END { print sum }" hosts` = x1 || tmp_re="[ ]"
7828 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
7829 hosts | $sort | $uniq | \
7830 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
7831 case `$echo X$dflt` in
7832 X*\ *) echo "(Several hosts in the database matched hostname)"
7835 X.) echo "(You do not have fully-qualified names in the hosts database)"
7839 echo "(I cannot locate a hosts database anywhere)"
7844 tans=`./loc resolv.conf X /etc /usr/etc`
7845 if $test -f "$tans"; then
7846 echo "(Attempting domain name extraction from $tans)"
7847 dflt=.`$sed -n -e 's/ / /g' \
7848 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
7849 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
7851 .) dflt=.`$sed -n -e 's/ / /g' \
7852 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
7853 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
7860 .) echo "(No help from resolv.conf either -- attempting clever guess)"
7861 dflt=.`sh -c domainname 2>/dev/null`
7864 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
7868 case "$dflt$osname" in
7869 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
7870 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
7874 .) echo "(Lost all hope -- silly guess then)"
7880 *) dflt="$mydomain";;
7884 rp="What is your domain name?"
7894 : translate upper to lower if necessary
7897 echo "(Normalizing case in your domain name)"
7898 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
7902 : a little sanity check here
7903 case "$phostname" in
7906 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
7907 $myhostname$mydomain|$myhostname) ;;
7909 case "$phostname" in
7911 echo "(That doesn't agree with your whoami.h file, by the way.)"
7914 echo "(That doesn't agree with your $phostname command, by the way.)"
7924 I need to get your e-mail address in Internet format if possible, i.e.
7925 something like user@host.domain. Please answer accurately since I have
7926 no easy means to double check it. The default value provided below
7927 is most probably close to reality but may not be valid from outside
7928 your organization...
7932 while test "$cont"; do
7934 '') dflt="$cf_by@$myhostname$mydomain";;
7935 *) dflt="$cf_email";;
7937 rp='What is your e-mail address?'
7943 rp='Address does not look like an Internet one. Use it anyway?'
7959 If you or somebody else will be maintaining perl at your site, please
7960 fill in the correct e-mail address here so that they may be contacted
7961 if necessary. Currently, the "perlbug" program included with perl
7962 will send mail to this address in addition to perlbug@perl.org. You may
7963 enter "none" for no administrator.
7966 case "$perladmin" in
7967 '') dflt="$cf_email";;
7968 *) dflt="$perladmin";;
7970 rp='Perl administrator e-mail address'
7974 : determine whether to only install version-specific parts.
7977 Do you want to install only the version-specific parts of the perl
7978 distribution? Usually you do *not* want to do this.
7980 case "$versiononly" in
7981 "$define"|[Yy]*|true) dflt='y' ;;
7984 rp="Do you want to install only the version-specific parts of perl?"
7987 [yY]*) val="$define";;
7993 : figure out how to guarantee perl startup
7994 case "$startperl" in
7996 case "$sharpbang" in
8000 I can use the #! construct to start perl on your system. This will
8001 make startup of perl scripts faster, but may cause problems if you
8002 want to share those scripts and perl is not in a standard place
8003 ($binexp/perl) on all your platforms. The alternative is to force
8004 a shell by starting the script with a single ':' character.
8007 case "$versiononly" in
8008 "$define") dflt="$binexp/perl$version";;
8009 *) dflt="$binexp/perl";;
8011 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8014 none) startperl=": # use perl";;
8015 *) startperl="#!$ans"
8016 if $test 30 -lt `echo "$ans" | wc -c`; then
8019 WARNING: Some systems limit the #! command to 32 characters.
8020 If you experience difficulty running Perl scripts with #!, try
8021 installing Perl in a directory with a shorter pathname.
8027 *) startperl=": # use perl"
8032 echo "I'll use $startperl to start perl scripts."
8034 : figure best path for perl in scripts
8037 perlpath="$binexp/perl"
8038 case "$startperl" in
8043 I will use the "eval 'exec'" idiom to start Perl on your system.
8044 I can use the full path of your Perl binary for this purpose, but
8045 doing so may cause problems if you want to share those scripts and
8046 Perl is not always in a standard place ($binexp/perl).
8050 rp="What path shall I use in \"eval 'exec'\"?"
8057 case "$startperl" in
8059 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8062 : determine where public executable scripts go
8063 set scriptdir scriptdir
8065 case "$scriptdir" in
8068 : guess some guesses
8069 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8070 $test -d /usr/share/bin && dflt=/usr/share/bin
8071 $test -d /usr/local/script && dflt=/usr/local/script
8072 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8073 $test -d $prefixexp/script && dflt=$prefixexp/script
8077 *) dflt="$scriptdir"
8082 Some installations have a separate directory just for executable scripts so
8083 that they can mount it across multiple architectures but keep the scripts in
8084 one spot. You might, for example, have a subdirectory of /usr/share for this.
8085 Or you might just lump your scripts in with all your other executables.
8089 rp='Where do you keep publicly executable scripts?'
8091 if $test "X$ansexp" != "X$scriptdirexp"; then
8095 scriptdirexp="$ansexp"
8096 : Change installation prefix, if necessary.
8097 if $test X"$prefix" != X"$installprefix"; then
8098 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
8100 installscript="$scriptdirexp"
8103 : determine where add-on public executables go
8105 '') dflt=$siteprefix/bin ;;
8109 rp='Pathname where the add-on public executables should be installed?'
8112 sitebinexp="$ansexp"
8113 : Change installation prefix, if necessary.
8114 if $test X"$prefix" != X"$installprefix"; then
8115 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
8117 installsitebin="$sitebinexp"
8120 : define an is-a-typedef? function
8121 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8123 "") inclist="sys/types.h";;
8125 eval "varval=\$$var";
8129 for inc in $inclist; do
8130 echo "#include <$inc>" >>temp.c;
8132 echo "#ifdef $type" >> temp.c;
8133 echo "printf(\"We have $type\");" >> temp.c;
8134 echo "#endif" >> temp.c;
8135 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8136 if $contains $type temp.E >/dev/null 2>&1; then
8142 *) eval "$var=\$varval";;
8145 : define an is-a-typedef? function that prompts if the type is not available.
8146 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8148 "") inclist="sys/types.h";;
8150 eval "varval=\$$var";
8154 for inc in $inclist; do
8155 echo "#include <$inc>" >>temp.c;
8157 echo "#ifdef $type" >> temp.c;
8158 echo "printf(\"We have $type\");" >> temp.c;
8159 echo "#endif" >> temp.c;
8160 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8162 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
8163 if $contains $type temp.E >/dev/null 2>&1; then
8164 echo "$type found." >&4;
8167 echo "$type NOT found." >&4;
8173 *) eval "$var=\$varval";;
8176 : see what type lseek is declared as in the kernel
8177 rp="What is the type used for lseek's offset on this system?"
8178 set off_t lseektype long stdio.h sys/types.h
8182 echo "Checking to see how big your file offsets are..." >&4
8184 #include <sys/types.h>
8188 printf("%d\n", (int)sizeof($lseektype));
8193 if eval $compile_ok; then
8194 lseeksize=`$run ./try`
8195 echo "Your file offsets are $lseeksize bytes long."
8199 echo "(I can't seem to compile the test program. Guessing...)"
8200 rp="What is the size of your file offsets (in bytes)?"
8206 : see what type file positions are declared as in the library
8207 rp="What is the type for file position used by fsetpos()?"
8208 set fpos_t fpostype long stdio.h sys/types.h
8213 *_t) zzz="$fpostype" ;;
8216 echo "Checking the size of $zzz..." >&4
8218 #include <sys/types.h>
8221 printf("%d\n", (int)sizeof($fpostype));
8226 if eval $compile_ok; then
8230 echo "(I can't execute the test program--guessing $fpossize.)" >&4
8233 echo "Your $zzz is $fpossize bytes long."
8239 echo "(I can't compile the test program. Guessing...)" >&4
8240 rp="What is the size of your file positions (in bytes)?"
8247 # Backward compatibility (uselfs is deprecated).
8249 "$define"|true|[yY]*)
8252 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
8254 uselargefiles="$define"
8258 case "$lseeksize:$fpossize" in
8261 You can have files larger than 2 gigabytes.
8264 *) case "$uselargefiles" in
8265 "$undef"|false|[nN]*) dflt='n' ;;
8270 Perl can be built to understand large files (files larger than 2 gigabytes)
8271 on some systems. To do so, Configure can be run with -Duselargefiles.
8273 If this doesn't make any sense to you, just accept the default '$dflt'.
8275 rp='Try to understand large files, if available?'
8278 y|Y) val="$define" ;;
8285 case "$uselargefiles" in
8287 : Look for a hint-file generated 'call-back-unit'. If the
8288 : user has specified that a large files perl is to be built,
8289 : we may need to set or change some other defaults.
8290 if $test -f uselargefiles.cbu; then
8291 echo "Your platform has some specific hints for large file builds, using them..."
8292 . ./uselargefiles.cbu
8294 echo "Rechecking to see how big your file offsets are..." >&4
8296 #include <sys/types.h>
8300 printf("%d\n", (int)sizeof($lseektype));
8305 if eval $compile_ok; then
8306 lseeksize=`$run ./try`
8307 $echo "Your file offsets are now $lseeksize bytes long."
8311 echo "(I can't seem to compile the test program. Guessing...)"
8312 rp="What is the size of your file offsets (in bytes)?"
8317 *_t) zzz="$fpostype" ;;
8320 $echo $n "Rechecking the size of $zzz...$c" >&4
8322 #include <sys/types.h>
8325 printf("%d\n", (int)sizeof($fpostype));
8330 if eval $compile_ok; then
8335 echo "(I can't execute the test program--guessing $fpossize.)" >&4
8338 echo " $fpossize bytes." >&4
8344 echo "(I can't compile the test program. Guessing...)" >&4
8345 rp="What is the size of your file positions (in bytes)?"
8354 case "$vendorprefix" in
8355 '') d_vendorbin="$undef"
8359 *) d_vendorbin="$define"
8360 : determine where vendor-supplied executables go.
8361 case "$vendorbin" in
8362 '') dflt=$vendorprefix/bin ;;
8363 *) dflt="$vendorbin" ;;
8366 rp='Pathname for the vendor-supplied executables directory?'
8369 vendorbinexp="$ansexp"
8372 : Change installation prefix, if necessary.
8373 if $test X"$prefix" != X"$installprefix"; then
8374 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
8376 installvendorbin="$vendorbinexp"
8379 : see if qgcvt exists
8385 if $test X"$d_longdbl" = X"$define"; then
8387 echo "Checking how to print long doubles..." >&4
8389 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
8390 $cat >try.c <<'EOCP'
8391 #include <sys/types.h>
8395 printf("%.3f\n", d);
8399 if eval $compile; then
8403 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
8404 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
8405 echo "We will use %f."
8411 if $test X"$sPRIfldbl" = X; then
8412 $cat >try.c <<'EOCP'
8413 #include <sys/types.h>
8416 long double d = 123.456;
8417 printf("%.3Lf\n", d);
8421 if eval $compile; then
8425 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
8426 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
8427 echo "We will use %Lf."
8433 if $test X"$sPRIfldbl" = X; then
8434 $cat >try.c <<'EOCP'
8435 #include <sys/types.h>
8438 long double d = 123.456;
8439 printf("%.3llf\n", d);
8443 if eval $compile; then
8447 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
8448 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
8449 echo "We will use %llf."
8455 if $test X"$sPRIfldbl" = X; then
8456 $cat >try.c <<'EOCP'
8457 #include <sys/types.h>
8460 long double d = 123.456;
8461 printf("%.3lf\n", d);
8465 if eval $compile; then
8469 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
8470 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
8471 echo "We will use %lf."
8477 if $test X"$sPRIfldbl" = X; then
8478 echo "Cannot figure out how to print long doubles." >&4
8480 sSCNfldbl=$sPRIfldbl # expect consistency
8487 case "$sPRIfldbl" in
8488 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
8489 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
8490 d_SCNfldbl="$undef";
8492 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
8493 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
8494 d_SCNfldbl="$define";
8498 : Check how to convert floats to strings.
8500 echo "Checking for an efficient way to convert floats to strings."
8502 case "$uselongdouble" in
8503 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
8505 case "$d_longdbl" in
8506 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
8508 case "$d_PRIgldbl" in
8509 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
8513 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
8514 char *myname = "gconvert";
8517 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
8518 char *myname = "gcvt";
8521 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
8522 char *myname = "qgcvt";
8523 #define DOUBLETYPE long double
8526 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE) && defined(HAS_PRIgldbl)
8527 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
8529 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
8531 char *myname = "sprintf";
8535 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
8536 #define DOUBLETYPE long double
8538 #define DOUBLETYPE double
8544 #define I_STDLIB $i_stdlib
8550 checkit(expect, got)
8554 if (strcmp(expect, got)) {
8555 printf("%s oddity: Expected %s, got %s\n",
8556 myname, expect, got);
8566 /* This must be 1st test on (which?) platform */
8567 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
8568 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
8569 checkit("0.1", buf);
8571 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
8574 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
8575 checkit("1.1", buf);
8577 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
8578 checkit("1.01", buf);
8580 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
8581 checkit("1.001", buf);
8583 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
8584 checkit("1.0001", buf);
8586 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
8587 checkit("1.00001", buf);
8589 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
8590 checkit("1.000001", buf);
8592 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
8595 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
8598 /* Some Linux gcvt's give 1.e+5 here. */
8599 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
8600 checkit("100000", buf);
8602 /* Some Linux gcvt's give -1.e+5 here. */
8603 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
8604 checkit("-100000", buf);
8606 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
8607 checkit("123.456", buf);
8609 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
8610 Gconvert((DOUBLETYPE)1e30, 8, 0, buf);
8611 if (strlen(buf) > 5)
8612 checkit("1e+030", buf); /* for Microsoft */
8614 checkit("1e+30", buf);
8619 case "$d_Gconvert" in
8620 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
8621 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
8622 sprintf*) xxx_list='sprintf gconvert gcvt' ;;
8623 *) xxx_list='gconvert gcvt sprintf' ;;
8626 case "$d_longdbl$uselongdouble$d_PRIgldbl" in
8627 "$define$define$define")
8628 # for long doubles prefer first qgcvt, then sprintf
8629 xxx_list="`echo $xxx_list|sed s/sprintf//`"
8630 xxx_list="sprintf $xxx_list"
8632 "$define") xxx_list="qgcvt $xxx_list" ;;
8637 for xxx_convert in $xxx_list; do
8638 echo "Trying $xxx_convert..."
8640 set try -DTRY_$xxx_convert
8641 if eval $compile; then
8642 echo "$xxx_convert() found." >&4
8644 echo "I'll use $xxx_convert to convert floats into a string." >&4
8647 echo "...But $xxx_convert didn't work as I expected."
8650 echo "$xxx_convert NOT found." >&4
8654 case "$xxx_convert" in
8655 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
8656 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
8657 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
8658 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
8659 "$define$define$define")
8660 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
8661 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
8666 : see if _fwalk exists
8670 : Initialize h_fcntl
8673 : Initialize h_sysfile
8676 : access call always available on UNIX
8680 : locate the flags for 'access()'
8684 $cat >access.c <<'EOCP'
8685 #include <sys/types.h>
8690 #include <sys/file.h>
8699 : check sys/file.h first, no particular reason here
8700 if $test `./findhdr sys/file.h` && \
8701 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
8703 echo "<sys/file.h> defines the *_OK access constants." >&4
8704 elif $test `./findhdr fcntl.h` && \
8705 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
8707 echo "<fcntl.h> defines the *_OK access constants." >&4
8708 elif $test `./findhdr unistd.h` && \
8709 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
8710 echo "<unistd.h> defines the *_OK access constants." >&4
8712 echo "I can't find the four *_OK access constants--I'll use mine." >&4
8718 : see if accessx exists
8719 set accessx d_accessx
8722 : see if alarm exists
8726 : see if atolf exists
8730 : see if atoll exists
8734 : Look for GNU-cc style attribute checking
8736 echo "Checking whether your compiler can handle __attribute__ ..." >&4
8737 $cat >attrib.c <<'EOCP'
8739 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
8741 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
8742 if $contains 'warning' attrib.out >/dev/null 2>&1; then
8743 echo "Your C compiler doesn't fully support __attribute__."
8746 echo "Your C compiler supports __attribute__."
8750 echo "Your C compiler doesn't seem to understand __attribute__ at all."
8757 : see if bcmp exists
8761 : see if bcopy exists
8765 : see if this is a unistd.h system
8766 set unistd.h i_unistd
8769 : see if getpgrp exists
8770 set getpgrp d_getpgrp
8773 case "$d_getpgrp" in
8776 echo "Checking to see which flavor of getpgrp is in use..."
8779 #include <sys/types.h>
8781 # include <unistd.h>
8785 if (getuid() == 0) {
8786 printf("(I see you are running Configure as super-user...)\n");
8790 if (getpgrp(1) == 0)
8799 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
8800 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
8802 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
8803 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
8806 echo "I can't seem to compile and run the test program."
8808 xxx="a USG one, i.e. you use getpgrp()."
8810 # SVR4 systems can appear rather BSD-ish.
8813 xxx="a BSD one, i.e. you use getpgrp(pid)."
8817 xxx="probably a USG one, i.e. you use getpgrp()."
8822 echo "Assuming your getpgrp is $xxx" >&4
8831 : see if setpgrp exists
8832 set setpgrp d_setpgrp
8835 case "$d_setpgrp" in
8838 echo "Checking to see which flavor of setpgrp is in use..."
8841 #include <sys/types.h>
8843 # include <unistd.h>
8847 if (getuid() == 0) {
8848 printf("(I see you are running Configure as super-user...)\n");
8852 if (-1 == setpgrp(1, 1))
8855 if (setpgrp() != -1)
8861 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
8862 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
8864 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
8865 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
8868 echo "(I can't seem to compile and run the test program.)"
8870 xxx="a USG one, i.e. you use setpgrp()."
8872 # SVR4 systems can appear rather BSD-ish.
8875 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
8879 xxx="probably a USG one, i.e. you use setpgrp()."
8884 echo "Assuming your setpgrp is $xxx" >&4
8892 : see if bzero exists
8896 : see if signal is declared as pointer to function returning int or void
8898 xxx=`./findhdr signal.h`
8899 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
8900 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
8901 echo "You have int (*signal())() instead of void." >&4
8903 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
8904 echo "You have void (*signal())()." >&4
8906 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
8907 echo "You have int (*signal())() instead of void." >&4
8909 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
8910 echo "You have void (*signal())()." >&4
8913 case "$d_voidsig" in
8915 echo "I can't determine whether signal handler returns void or int..." >&4
8917 rp="What type does your signal handler return?"
8924 echo "As you already told me, signal handler returns void." >&4
8927 *) echo "As you already told me, signal handler returns int." >&4
8934 case "$d_voidsig" in
8935 "$define") signal_t="void";;
8940 : check for ability to cast large floats to 32-bit ints.
8942 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
8943 if $test "$intsize" -ge 4; then
8950 #include <sys/types.h>
8952 $signal_t blech(s) int s; { exit(3); }
8959 signal(SIGFPE, blech);
8961 /* Don't let compiler optimize the test away. Store the number
8962 in a writable string for gcc to pass to sscanf under HP/UX.
8964 sprintf(str, "2147483647");
8965 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
8969 /* x86 processors will probably give 0x8000 0000, which is a
8970 sign change. We don't want that. We want to mimic SPARC
8971 behavior here, which is to preserve the sign and give
8974 if (i32 != ($xxx) f)
8980 if eval $compile_ok; then
8984 echo "(I can't seem to compile the test program--assuming it can't)"
8992 echo "Nope, it can't."
8999 : check for ability to cast negative floats to unsigned
9001 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
9004 #include <sys/types.h>
9006 $signal_t blech(s) int s; { exit(7); }
9007 $signal_t blech_in_list(s) int s; { exit(4); }
9008 unsigned long dummy_long(p) unsigned long p; { return p; }
9009 unsigned int dummy_int(p) unsigned int p; { return p; }
9010 unsigned short dummy_short(p) unsigned short p; { return p; }
9014 unsigned long along;
9016 unsigned short ashort;
9020 /* Frustrate gcc-2.7.2's optimizer which failed this test with
9021 a direct f = -123. assignment. gcc-2.8.0 reportedly
9022 optimized the whole file away
9024 /* Store the number in a writable string for gcc to pass to
9027 sprintf(str, "-123");
9028 sscanf(str, "%lf", &f); /* f = -123.; */
9030 signal(SIGFPE, blech);
9031 along = (unsigned long)f;
9032 aint = (unsigned int)f;
9033 ashort = (unsigned short)f;
9034 if (along != (unsigned long)-123)
9036 if (aint != (unsigned int)-123)
9038 if (ashort != (unsigned short)-123)
9040 sprintf(str, "1073741824.");
9041 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
9044 along = (unsigned long)f;
9045 if (along != 0x80000000)
9049 along = (unsigned long)f;
9050 if (along != 0x7fffffff)
9054 along = (unsigned long)f;
9055 if (along != 0x80000001)
9059 signal(SIGFPE, blech_in_list);
9060 sprintf(str, "123.");
9061 sscanf(str, "%lf", &f); /* f = 123.; */
9062 along = dummy_long((unsigned long)f);
9063 aint = dummy_int((unsigned int)f);
9064 ashort = dummy_short((unsigned short)f);
9065 if (along != (unsigned long)123)
9067 if (aint != (unsigned int)123)
9069 if (ashort != (unsigned short)123)
9076 if eval $compile_ok; then
9080 echo "(I can't seem to compile the test program--assuming it can't)"
9083 case "$castflags" in
9088 echo "Nope, it can't."
9095 : see if vprintf exists
9097 if set vprintf val -f d_vprintf; eval $csym; $val; then
9098 echo 'vprintf() found.' >&4
9101 #include <varargs.h>
9103 int main() { xxx("foo"); }
9112 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
9116 if eval $compile && $run ./try; then
9117 echo "Your vsprintf() returns (int)." >&4
9120 echo "Your vsprintf() returns (char*)." >&4
9124 echo 'vprintf() NOT found.' >&4
9135 : see if chown exists
9139 : see if chroot exists
9143 : see if chsize exists
9147 : see if class exists
9151 hasstruct='varname=$1; struct=$2; shift; shift;
9152 while $test $# -ge 2; do
9154 $define) echo "#include <$2>";;
9158 echo "int main () { struct $struct foo; }" >> try.c;
9160 if eval $compile; then
9169 : see if sys/types.h has to be included
9170 set sys/types.h i_systypes
9173 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
9174 while $test $# -ge 2; do
9176 $define) echo "#include <$2>";;
9180 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
9182 if eval $compile; then
9193 : see whether socket exists
9195 $echo $n "Hmm... $c" >&4
9196 if set socket val -f d_socket; eval $csym; $val; then
9197 echo "Looks like you have Berkeley networking support." >&4
9199 if set setsockopt val -f; eval $csym; $val; then
9202 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
9206 if $contains socklib libc.list >/dev/null 2>&1; then
9207 echo "Looks like you have Berkeley networking support." >&4
9209 : we will have to assume that it supports the 4.2 BSD interface
9212 echo "You don't have Berkeley networking in libc$_a..." >&4
9213 if test "X$d_socket" = "X$define"; then
9214 echo "...but you seem to believe that you have sockets." >&4
9216 for net in net socket
9218 if test -f /usr/lib/lib$net$_a; then
9219 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
9220 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
9221 if $contains socket libc.list >/dev/null 2>&1; then
9226 echo "...but the Wollongong group seems to have hacked it in." >&4
9227 sockethdr="-I/usr/netinclude"
9230 echo "Found Berkeley sockets interface in lib$net." >& 4
9231 if $contains setsockopt libc.list >/dev/null 2>&1; then
9234 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
9241 if test "X$d_socket" != "X$define"; then
9242 echo "or anywhere else I see." >&4
9250 : see if socketpair exists
9251 set socketpair d_sockpair
9256 echo "Checking the availability of certain socket constants..." >& 4
9257 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
9258 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
9260 #include <sys/types.h>
9261 #include <sys/socket.h>
9267 set try; if eval $compile; then
9270 set d_${enum}; eval $setvar
9274 : see if this is a sys/uio.h system
9275 set sys/uio.h i_sysuio
9280 echo "Checking to see if your system supports struct cmsghdr..." >&4
9281 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
9283 case "$d_cmsghdr_s" in
9284 "$define") echo "Yes, it does." ;;
9285 *) echo "No, it doesn't." ;;
9289 : check for const keyword
9291 echo 'Checking to see if your C compiler knows about "const"...' >&4
9292 $cat >const.c <<'EOCP'
9293 typedef struct spug { int drokk; } spug;
9300 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
9302 echo "Yup, it does."
9305 echo "Nope, it doesn't."
9310 : see if crypt exists
9312 if set crypt val -f d_crypt; eval $csym; $val; then
9313 echo 'crypt() found.' >&4
9317 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
9318 if $test -z "$cryptlib"; then
9319 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
9323 if $test -z "$cryptlib"; then
9324 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
9328 if $test -z "$cryptlib"; then
9329 cryptlib=`./loc libcrypt$_a "" $libpth`
9333 if $test -z "$cryptlib"; then
9334 echo 'crypt() NOT found.' >&4
9343 : get csh whereabouts
9345 'csh') val="$undef" ;;
9350 : Respect a hint or command line value for full_csh.
9352 '') full_csh=$csh ;;
9355 : see if cuserid exists
9356 set cuserid d_cuserid
9359 : see if this is a limits.h system
9360 set limits.h i_limits
9363 : see if this is a float.h system
9367 : See if number of significant digits in a double precision number is known
9369 $cat >dbl_dig.c <<EOM
9379 printf("Contains DBL_DIG");
9382 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
9383 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
9384 echo "DBL_DIG found." >&4
9387 echo "DBL_DIG NOT found." >&4
9394 hasproto='varname=$1; func=$2; shift; shift;
9395 while $test $# -ge 2; do
9397 $define) echo "#include <$2>";;
9401 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
9402 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
9403 echo "$func() prototype found.";
9406 echo "$func() prototype NOT found.";
9411 $rm -f try.c tryout.c'
9413 : see if dbm.h is available
9414 : see if dbmclose exists
9415 set dbmclose d_dbmclose
9418 case "$d_dbmclose" in
9428 *) set rpcsvc/dbm.h i_rpcsvcdbm
9433 *) echo "We won't be including <dbm.h>"
9443 : see if prototype for dbminit is available
9445 set d_dbminitproto dbminit $i_dbm dbm.h
9448 : see if difftime exists
9449 set difftime d_difftime
9452 : see if this is a dirent system
9454 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
9456 echo "<dirent.h> found." >&4
9459 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
9460 echo "<sys/dir.h> found." >&4
9463 xinc=`./findhdr sys/ndir.h`
9465 echo "<dirent.h> NOT found." >&4
9470 : Look for type of directory structure.
9472 $cppstdin $cppflags $cppminus < "$xinc" > try.c
9474 case "$direntrytype" in
9477 $define) guess1='struct dirent' ;;
9478 *) guess1='struct direct' ;;
9481 *) guess1="$direntrytype"
9486 'struct dirent') guess2='struct direct' ;;
9487 *) guess2='struct dirent' ;;
9490 if $contains "$guess1" try.c >/dev/null 2>&1; then
9491 direntrytype="$guess1"
9492 echo "Your directory entries are $direntrytype." >&4
9493 elif $contains "$guess2" try.c >/dev/null 2>&1; then
9494 direntrytype="$guess2"
9495 echo "Your directory entries seem to be $direntrytype." >&4
9497 echo "I don't recognize your system's directory entries." >&4
9498 rp="What type is used for directory entries on this system?"
9506 : see if the directory entry stores field length
9508 $cppstdin $cppflags $cppminus < "$xinc" > try.c
9509 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
9510 echo "Good, your directory entry keeps length information in d_namlen." >&4
9513 echo "Your directory entry does not know about the d_namlen field." >&4
9520 : see if dlerror exists
9523 set dlerror d_dlerror
9527 : see if dlfcn is available
9535 On a few systems, the dynamically loaded modules that perl generates and uses
9536 will need a different extension than shared libs. The default will probably
9544 rp='What is the extension of dynamically loaded modules'
9553 : Check if dlsym need a leading underscore
9559 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
9560 $cat >dyna.c <<'EOM'
9569 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
9571 #include <sys/types.h>
9585 int mode = RTLD_LAZY ;
9587 handle = dlopen("./dyna.$dlext", mode) ;
9588 if (handle == NULL) {
9593 symbol = dlsym(handle, "fred") ;
9594 if (symbol == NULL) {
9595 /* try putting a leading underscore */
9596 symbol = dlsym(handle, "_fred") ;
9597 if (symbol == NULL) {
9610 : Call the object file tmp-dyna.o in case dlext=o.
9611 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
9612 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
9613 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
9614 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
9617 1) echo "Test program failed using dlopen." >&4
9618 echo "Perhaps you should not use dynamic loading." >&4;;
9619 2) echo "Test program failed using dlsym." >&4
9620 echo "Perhaps you should not use dynamic loading." >&4;;
9621 3) echo "dlsym needs a leading underscore" >&4
9623 4) echo "dlsym doesn't need a leading underscore." >&4;;
9626 echo "I can't compile and run the test program." >&4
9627 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
9632 $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
9637 : see if prototype for drand48 is available
9639 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
9642 : see if dup2 exists
9646 : see if eaccess exists
9647 set eaccess d_eaccess
9650 : see if endgrent exists
9651 set endgrent d_endgrent
9654 : see if endhostent exists
9655 set endhostent d_endhent
9658 : see if endnetent exists
9659 set endnetent d_endnent
9662 : see if endprotoent exists
9663 set endprotoent d_endpent
9666 : see if endpwent exists
9667 set endpwent d_endpwent
9670 : see if endservent exists
9671 set endservent d_endsent
9674 : Locate the flags for 'open()'
9676 $cat >try.c <<'EOCP'
9677 #include <sys/types.h>
9682 #include <sys/file.h>
9693 : check sys/file.h first to get FREAD on Sun
9694 if $test `./findhdr sys/file.h` && \
9695 set try -DI_SYS_FILE && eval $compile; then
9697 echo "<sys/file.h> defines the O_* constants..." >&4
9699 echo "and you have the 3 argument form of open()." >&4
9702 echo "but not the 3 argument form of open(). Oh, well." >&4
9705 elif $test `./findhdr fcntl.h` && \
9706 set try -DI_FCNTL && eval $compile; then
9708 echo "<fcntl.h> defines the O_* constants..." >&4
9710 echo "and you have the 3 argument form of open()." >&4
9713 echo "but not the 3 argument form of open(). Oh, well." >&4
9718 echo "I can't find the O_* constant definitions! You got problems." >&4
9724 : see which of string.h or strings.h is needed
9726 strings=`./findhdr string.h`
9727 if $test "$strings" && $test -r "$strings"; then
9728 echo "Using <string.h> instead of <strings.h>." >&4
9732 strings=`./findhdr strings.h`
9733 if $test "$strings" && $test -r "$strings"; then
9734 echo "Using <strings.h> instead of <string.h>." >&4
9736 echo "No string header found -- You'll surely have problems." >&4
9742 "$undef") strings=`./findhdr strings.h`;;
9743 *) strings=`./findhdr string.h`;;
9746 : check for non-blocking I/O stuff
9747 case "$h_sysfile" in
9748 true) echo "#include <sys/file.h>" > head.c;;
9751 true) echo "#include <fcntl.h>" > head.c;;
9752 *) echo "#include <sys/fcntl.h>" > head.c;;
9757 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
9758 case "$o_nonblock" in
9761 $cat >>try.c <<'EOCP'
9766 printf("O_NONBLOCK\n");
9770 printf("O_NDELAY\n");
9774 printf("FNDELAY\n");
9781 if eval $compile_ok; then
9782 o_nonblock=`$run ./try`
9783 case "$o_nonblock" in
9784 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
9785 *) echo "Seems like we can use $o_nonblock.";;
9788 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
9791 *) echo "Using $hint value $o_nonblock.";;
9793 $rm -f try try.* .out core
9796 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
9802 #include <sys/types.h>
9806 #define MY_O_NONBLOCK $o_nonblock
9807 #ifndef errno /* XXX need better Configure test */
9818 #include <strings.h>
9820 $signal_t blech(x) int x; { exit(3); }
9822 $cat >> try.c <<'EOCP'
9830 pipe(pd); /* Down: child -> parent */
9831 pipe(pu); /* Up: parent -> child */
9834 close(pd[1]); /* Parent reads from pd[0] */
9835 close(pu[0]); /* Parent writes (blocking) to pu[1] */
9837 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
9842 signal(SIGALRM, blech);
9844 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
9846 sprintf(string, "%d\n", ret);
9847 write(2, string, strlen(string));
9850 if (errno == EAGAIN) {
9856 if (errno == EWOULDBLOCK)
9857 printf("EWOULDBLOCK\n");
9860 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
9861 sleep(2); /* Give it time to close our pipe */
9863 ret = read(pd[0], buf, 1); /* Should read EOF */
9865 sprintf(string, "%d\n", ret);
9866 write(3, string, strlen(string));
9870 close(pd[0]); /* We write to pd[1] */
9871 close(pu[1]); /* We read from pu[0] */
9872 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
9873 close(pd[1]); /* Pipe pd is now fully closed! */
9874 exit(0); /* Bye bye, thank you for playing! */
9878 if eval $compile_ok; then
9879 echo "$startsh" >mtry
9880 echo "$run ./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
9882 ./mtry >/dev/null 2>&1
9884 0) eagain=`$cat try.out`;;
9885 1) echo "Could not perform non-blocking setting!";;
9886 2) echo "I did a successful read() for something that was not there!";;
9887 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
9888 4) echo "Could not find F_SETFL!";;
9889 *) echo "Something terribly wrong happened during testing.";;
9891 rd_nodata=`$cat try.ret`
9892 echo "A read() system call with no data present returns $rd_nodata."
9893 case "$rd_nodata" in
9896 echo "(That's peculiar, fixing that to be -1.)"
9902 echo "Forcing errno EAGAIN on read() with no data available."
9906 echo "Your read() sets errno to $eagain when no data is available."
9909 status=`$cat try.err`
9911 0) echo "And it correctly returns 0 to signal EOF.";;
9912 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
9913 *) echo "However, your read() returns '$status' on EOF??";;
9916 if test "$status" = "$rd_nodata"; then
9917 echo "WARNING: you can't distinguish between EOF and no data!"
9921 echo "I can't compile the test program--assuming errno EAGAIN will do."
9928 echo "Using $hint value $eagain."
9929 echo "Your read() returns $rd_nodata when no data is present."
9930 case "$d_eofnblk" in
9931 "$define") echo "And you can see EOF because read() returns 0.";;
9932 "$undef") echo "But you can't see EOF status from read() returned value.";;
9934 echo "(Assuming you can't see EOF status from read anyway.)"
9940 $rm -f try try.* .out core head.c mtry
9942 : see if fchdir exists
9946 : see if fchmod exists
9950 : see if fchown exists
9954 : see if this is an fcntl system
9959 : See if fcntl-based locking works.
9965 $signal_t blech(x) int x; { exit(3); }
9967 #if defined(F_SETLK) && defined(F_SETLKW)
9970 fd = open("try.c", O_RDONLY);
9971 flock.l_type = F_RDLCK;
9972 flock.l_whence = SEEK_SET;
9973 flock.l_start = flock.l_len = 0;
9974 signal(SIGALRM, blech);
9976 retval = fcntl(fd, F_SETLK, &flock);
9978 (retval < 0 ? exit(2) : exit(0));
9984 echo "Checking if fcntl-based file locking works... "
9988 if eval $compile_ok; then
9990 echo "Yes, it seems to work."
9993 echo "Nope, it didn't work."
9998 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
9999 *** This is (almost) impossible.
10000 *** If your NFS lock daemons are not feeling well, something like
10001 *** this may happen, please investigate. Cannot continue, aborting.
10009 echo "I'm unable to compile the test program, so I'll assume not."
10014 echo "Nope, since you don't even have fcntl()."
10017 set d_fcntl_can_lock
10022 : see if sys/select.h has to be included
10023 set sys/select.h i_sysselct
10026 : see if we should include time.h, sys/time.h, or both
10028 if test "X$timeincl" = X; then
10029 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10030 $echo $n "I'm now running the test program...$c"
10031 $cat >try.c <<'EOCP'
10032 #include <sys/types.h>
10037 #ifdef SYSTIMEKERNEL
10040 #include <sys/time.h>
10043 #include <sys/select.h>
10049 struct timeval bar;
10052 struct timezone tzp;
10054 if (foo.tm_sec == foo.tm_sec)
10057 if (bar.tv_sec == bar.tv_sec)
10064 for s_timezone in '-DS_TIMEZONE' ''; do
10066 for s_timeval in '-DS_TIMEVAL' ''; do
10067 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10068 for i_time in '' '-DI_TIME'; do
10069 for i_systime in '-DI_SYSTIME' ''; do
10072 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10073 if eval $compile; then
10074 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10078 $echo $n "Succeeded with $flags$c"
10090 *SYSTIMEKERNEL*) i_systimek="$define"
10091 timeincl=`./findhdr sys/time.h`
10092 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10093 *) i_systimek="$undef";;
10096 *I_TIME*) i_time="$define"
10097 timeincl=`./findhdr time.h`" $timeincl"
10098 echo "We'll include <time.h>." >&4;;
10099 *) i_time="$undef";;
10102 *I_SYSTIME*) i_systime="$define"
10103 timeincl=`./findhdr sys/time.h`" $timeincl"
10104 echo "We'll include <sys/time.h>." >&4;;
10105 *) i_systime="$undef";;
10110 : check for fd_set items
10113 Checking to see how well your C compiler handles fd_set and friends ...
10116 #$i_systime I_SYS_TIME
10117 #$i_sysselct I_SYS_SELECT
10118 #$d_socket HAS_SOCKET
10119 #include <sys/types.h>
10121 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
10124 #include <sys/time.h>
10126 #ifdef I_SYS_SELECT
10127 #include <sys/select.h>
10136 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
10144 if eval $compile; then
10145 d_fds_bits="$define"
10147 echo "Well, your system knows about the normal fd_set typedef..." >&4
10148 if $run ./try; then
10149 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
10150 d_fd_macros="$define"
10153 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
10155 d_fd_macros="$undef"
10159 Hmm, your compiler has some difficulty with fd_set. Checking further...
10162 if eval $compile; then
10163 d_fds_bits="$undef"
10165 echo "Well, your system has some sort of fd_set available..." >&4
10166 if $run ./try; then
10167 echo "and you have the normal fd_set macros." >&4
10168 d_fd_macros="$define"
10171 but not the normal fd_set macros! Gross! More work for me...
10173 d_fd_macros="$undef"
10176 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
10178 d_fds_bits="$undef"
10179 d_fd_macros="$undef"
10184 : see if fgetpos exists
10185 set fgetpos d_fgetpos
10188 : see if finite exists
10189 set finite d_finite
10192 : see if finitel exists
10193 set finitel d_finitel
10196 : see if flock exists
10200 : see if this is a sys/file.h system
10205 : do we need to include sys/file.h ?
10209 if $h_sysfile; then
10211 echo "We'll be including <sys/file.h>." >&4
10214 echo "We won't be including <sys/file.h>." >&4
10224 : see if prototype for flock is available
10226 set d_flockproto flock $i_sysfile sys/file.h
10229 : see if fork exists
10233 : see if fp_class exists
10234 set fp_class d_fp_class
10237 : see if pathconf exists
10238 set pathconf d_pathconf
10241 : see if fpathconf exists
10242 set fpathconf d_fpathconf
10245 : see if fpclass exists
10246 set fpclass d_fpclass
10249 : see if fpclassify exists
10250 set fpclassify d_fpclassify
10253 : see if fpclassl exists
10254 set fpclassl d_fpclassl
10258 : check for fpos64_t
10260 echo "Checking to see if you have fpos64_t..." >&4
10263 int main() { fpos64_t x = 7; }
10266 if eval $compile; then
10268 echo "You have fpos64_t."
10271 echo "You do not have fpos64_t."
10272 case "$fpossize" in
10273 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
10280 : see if frexpl exists
10281 set frexpl d_frexpl
10284 : see if this is a sys/param system
10285 set sys/param.h i_sysparam
10288 : see if this is a sys/mount.h system
10289 set sys/mount.h i_sysmount
10294 echo "Checking to see if your system supports struct fs_data..." >&4
10295 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
10297 case "$d_fs_data_s" in
10298 "$define") echo "Yes, it does." ;;
10299 *) echo "No, it doesn't." ;;
10302 : see if fseeko exists
10303 set fseeko d_fseeko
10305 case "$longsize" in
10306 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
10309 : see if fsetpos exists
10310 set fsetpos d_fsetpos
10314 : see if fstatfs exists
10315 set fstatfs d_fstatfs
10319 : see if statvfs exists
10320 set statvfs d_statvfs
10323 : see if fstatvfs exists
10324 set fstatvfs d_fstatvfs
10328 : see if fsync exists
10332 : see if ftello exists
10333 set ftello d_ftello
10335 case "$longsize" in
10336 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
10339 : see if getcwd exists
10340 set getcwd d_getcwd
10343 : see if getespwnam exists
10344 set getespwnam d_getespwnam
10348 : see if getfsstat exists
10349 set getfsstat d_getfsstat
10352 : see if getgrent exists
10353 set getgrent d_getgrent
10356 : see if gethostbyaddr exists
10357 set gethostbyaddr d_gethbyaddr
10360 : see if gethostbyname exists
10361 set gethostbyname d_gethbyname
10364 : see if gethostent exists
10365 set gethostent d_gethent
10368 : see how we will look up host name
10371 if set gethostname val -f d_gethname; eval $csym; $val; then
10372 echo 'gethostname() found.' >&4
10373 d_gethname="$define"
10376 if set uname val -f d_uname; eval $csym; $val; then
10379 uname() was found, but you're running xenix, and older versions of xenix
10380 have a broken uname(). If you don't really know whether your xenix is old
10381 enough to have a broken system call, use the default answer.
10386 "$define") dflt=n;;
10388 rp='Is your uname() broken?'
10391 n*) d_uname="$define"; call=uname;;
10394 echo 'uname() found.' >&4
10401 case "$d_gethname" in
10402 '') d_gethname="$undef";;
10405 '') d_uname="$undef";;
10407 case "$d_uname$d_gethname" in
10412 Every now and then someone has a $call() that lies about the hostname
10413 but can't be fixed for political or economic reasons. If you wish, I can
10414 pretend $call() isn't there and maybe compute hostname at run-time
10415 thanks to the '$phostname' command.
10418 rp="Shall I ignore $call() from now on?"
10421 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
10424 case "$phostname" in
10425 '') aphostname='';;
10426 *) case "$aphostname" in
10428 *) set X $phostname
10432 file=`./loc $file $file $pth`
10433 aphostname=`echo $file $*`
10438 case "$d_uname$d_gethname" in
10441 case "$phostname" in
10443 echo "There will be no way for $package to get your hostname." >&4;;
10445 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
10449 case "$d_phostname" in
10450 '') d_phostname="$undef";;
10453 : see if this is a netdb.h system
10454 set netdb.h i_netdb
10457 : see if prototypes for various gethostxxx netdb.h functions are available
10459 set d_gethostprotos gethostent $i_netdb netdb.h
10462 : see if getitimer exists
10463 set getitimer d_getitimer
10466 : see if getlogin exists
10467 set getlogin d_getlogin
10470 : see if getmnt exists
10471 set getmnt d_getmnt
10474 : see if getmntent exists
10475 set getmntent d_getmntent
10478 : see if getnetbyaddr exists
10479 set getnetbyaddr d_getnbyaddr
10482 : see if getnetbyname exists
10483 set getnetbyname d_getnbyname
10486 : see if getnetent exists
10487 set getnetent d_getnent
10490 : see if prototypes for various getnetxxx netdb.h functions are available
10492 set d_getnetprotos getnetent $i_netdb netdb.h
10495 : see if getpagesize exists
10496 set getpagesize d_getpagsz
10500 : see if getprotobyname exists
10501 set getprotobyname d_getpbyname
10504 : see if getprotobynumber exists
10505 set getprotobynumber d_getpbynumber
10508 : see if getprotoent exists
10509 set getprotoent d_getpent
10512 : see if getpgid exists
10513 set getpgid d_getpgid
10516 : see if getpgrp2 exists
10517 set getpgrp2 d_getpgrp2
10520 : see if getppid exists
10521 set getppid d_getppid
10524 : see if getpriority exists
10525 set getpriority d_getprior
10528 : see if prototypes for various getprotoxxx netdb.h functions are available
10530 set d_getprotoprotos getprotoent $i_netdb netdb.h
10533 : see if getprpwnam exists
10534 set getprpwnam d_getprpwnam
10537 : see if getpwent exists
10538 set getpwent d_getpwent
10542 : see if getservbyname exists
10543 set getservbyname d_getsbyname
10546 : see if getservbyport exists
10547 set getservbyport d_getsbyport
10550 : see if getservent exists
10551 set getservent d_getsent
10554 : see if prototypes for various getservxxx netdb.h functions are available
10556 set d_getservprotos getservent $i_netdb netdb.h
10559 : see if getspnam exists
10560 set getspnam d_getspnam
10563 : see if gettimeofday or ftime exists
10564 set gettimeofday d_gettimeod
10566 case "$d_gettimeod" in
10572 val="$undef"; set d_ftime; eval $setvar
10575 case "$d_gettimeod$d_ftime" in
10578 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
10582 : see if this is an grp system
10588 xxx=`./findhdr grp.h`
10589 $cppstdin $cppflags $cppminus < $xxx >$$.h
10591 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
10603 set d_grpasswd; eval $setvar
10607 : see if hasmntopt exists
10608 set hasmntopt d_hasmntopt
10611 : see if this is a netinet/in.h or sys/in.h system
10612 set netinet/in.h i_niin sys/in.h i_sysin
10615 : see if arpa/inet.h has to be included
10616 set arpa/inet.h i_arpainet
10619 : see if htonl --and friends-- exists
10624 : Maybe they are macros.
10627 $cat >htonl.c <<EOM
10629 #include <sys/types.h>
10630 #$i_niin I_NETINET_IN
10632 #$i_arpainet I_ARPA_INET
10633 #ifdef I_NETINET_IN
10634 #include <netinet/in.h>
10637 #include <sys/in.h>
10640 #include <arpa/inet.h>
10643 printf("Defined as a macro.");
10646 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
10647 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
10649 echo "But it seems to be defined as a macro." >&4
10659 if set index val -f; eval $csym; $val; then
10660 if set strchr val -f d_strchr; eval $csym; $val; then
10661 if $contains strchr "$strings" >/dev/null 2>&1 ; then
10664 echo "strchr() found." >&4
10668 echo "index() found." >&4
10673 echo "index() found." >&4
10676 if set strchr val -f d_strchr; eval $csym; $val; then
10679 echo "strchr() found." >&4
10681 echo "No index() or strchr() found!" >&4
10686 set d_strchr; eval $setvar
10688 set d_index; eval $setvar
10690 : check whether inet_aton exists
10691 set inet_aton d_inetaton
10696 $cat >isascii.c <<'EOCP'
10708 if eval $compile; then
10709 echo "isascii() found." >&4
10712 echo "isascii() NOT found." >&4
10719 : see if isfinite exists
10720 set isfinite d_isfinite
10723 : see if isinf exists
10727 : see if isnan exists
10731 : see if isnanl exists
10732 set isnanl d_isnanl
10735 : see if killpg exists
10736 set killpg d_killpg
10739 : see if lchown exists
10741 $cat > try.c <<'EOCP'
10742 /* System header to define __stub macros and hopefully few prototypes,
10743 which can conflict with char lchown(); below. */
10744 #include <assert.h>
10745 /* Override any gcc2 internal prototype to avoid an error. */
10746 /* We use char because int might match the return type of a gcc2
10747 builtin and then its argument prototype would still apply. */
10750 /* The GNU C library defines this for functions which it implements
10751 to always fail with ENOSYS. Some functions are actually named
10752 something starting with __ and the normal name is an alias. */
10753 #if defined (__stub_lchown) || defined (__stub___lchown)
10761 if eval $compile; then
10762 $echo "lchown() found." >&4
10765 $echo "lchown() NOT found." >&4
10771 : See if number of significant digits in a double precision number is known
10773 $cat >ldbl_dig.c <<EOM
10774 #$i_limits I_LIMITS
10777 #include <limits.h>
10783 printf("Contains LDBL_DIG");
10786 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
10787 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
10788 echo "LDBL_DIG found." >&4
10791 echo "LDBL_DIG NOT found." >&4
10798 : see if link exists
10802 : see if localeconv exists
10803 set localeconv d_locconv
10806 : see if lockf exists
10810 : see if prototype for lseek is available
10812 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
10815 : see if lstat exists
10819 : see if madvise exists
10820 set madvise d_madvise
10823 : see if mblen exists
10827 : see if mbstowcs exists
10828 set mbstowcs d_mbstowcs
10831 : see if mbtowc exists
10832 set mbtowc d_mbtowc
10835 : see if memchr exists
10836 set memchr d_memchr
10839 : see if memcmp exists
10840 set memcmp d_memcmp
10843 : see if memcpy exists
10844 set memcpy d_memcpy
10847 : see if memmove exists
10848 set memmove d_memmove
10851 : see if memset exists
10852 set memset d_memset
10855 : see if mkdir exists
10859 : see if mkdtemp exists
10860 set mkdtemp d_mkdtemp
10863 : see if mkfifo exists
10864 set mkfifo d_mkfifo
10867 : see if mkstemp exists
10868 set mkstemp d_mkstemp
10871 : see if mkstemps exists
10872 set mkstemps d_mkstemps
10875 : see if mktime exists
10876 set mktime d_mktime
10879 : see if this is a sys/mman.h system
10880 set sys/mman.h i_sysmman
10883 : see if mmap exists
10886 : see what shmat returns
10887 : default to something harmless
10889 case "$i_sysmman$d_mmap" in
10891 $cat >mmap.c <<'END'
10892 #include <sys/mman.h>
10895 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
10900 echo "and it returns ($mmaptype)." >&4
10906 : see if modfl exists
10910 d_modfl_pow32_bug="$undef"
10912 case "$d_longdbl$d_modfl" in
10915 Checking to see whether your modfl() is okay for large values...
10921 long double nv = 4294967303.15;
10927 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
10931 case "$osname:$gccversion" in
10932 aix:) saveccflags="$ccflags"
10933 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
10936 if eval $compile; then
10939 *" 4294967303.150000 1.150000 4294967302.000000")
10940 echo >&4 "Your modfl() is broken for large values."
10941 d_modfl_pow32_bug="$define"
10943 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
10947 *" 4294967303.150000 0.150000 4294967303.000000")
10948 echo >&4 "Your modfl() seems okay for large values."
10950 *) echo >&4 "I don't understand your modfl() at all."
10954 $rm -f try.* try core core.try.*
10956 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
10959 case "$osname:$gccversion" in
10960 aix:) ccflags="$saveccflags" ;; # restore
10965 : see if mprotect exists
10966 set mprotect d_mprotect
10969 : see if msgctl exists
10970 set msgctl d_msgctl
10973 : see if msgget exists
10974 set msgget d_msgget
10977 : see if msgsnd exists
10978 set msgsnd d_msgsnd
10981 : see if msgrcv exists
10982 set msgrcv d_msgrcv
10985 : see how much of the 'msg*(2)' library is present.
10988 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
10989 *"$undef"*) h_msg=false;;
10993 case "`ipcs 2>&1`" in
10994 "SVID messages"*"not configured"*)
10995 echo "Your $osname does not have the msg*(2) configured." >&4
10998 set msgctl d_msgctl
11000 set msgget d_msgget
11002 set msgsnd d_msgsnd
11004 set msgrcv d_msgrcv
11010 : we could also check for sys/ipc.h ...
11011 if $h_msg && $test `./findhdr sys/msg.h`; then
11012 echo "You have the full msg*(2) library." >&4
11015 echo "You don't have the full msg*(2) library." >&4
11023 echo "Checking to see if your system supports struct msghdr..." >&4
11024 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
11026 case "$d_msghdr_s" in
11027 "$define") echo "Yes, it does." ;;
11028 *) echo "No, it doesn't." ;;
11032 : see if msync exists
11036 : see if munmap exists
11037 set munmap d_munmap
11040 : see if nice exists
11044 : see if this is a langinfo.h system
11045 set langinfo.h i_langinfo
11048 : see if nl_langinfo exists
11049 set nl_langinfo d_nl_langinfo
11052 : check for length of character
11054 case "$charsize" in
11056 echo "Checking to see how big your characters are (hey, you never know)..." >&4
11057 $cat >try.c <<'EOCP'
11061 printf("%d\n", (int)sizeof(char));
11066 if eval $compile_ok; then
11070 echo "(I can't seem to compile the test program. Guessing...)"
11077 rp="What is the size of a character (in bytes)?"
11082 : check for volatile keyword
11084 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
11085 $cat >try.c <<'EOCP'
11088 typedef struct _goo_struct goo_struct;
11089 goo_struct * volatile goo = ((goo_struct *)0);
11090 struct _goo_struct {
11095 typedef unsigned short foo_t;
11096 char *volatile foo;
11098 volatile foo_t blech;
11102 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
11104 echo "Yup, it does."
11107 echo "Nope, it doesn't."
11115 $echo "Choosing the C types to be used for Perl's internal types..." >&4
11117 case "$use64bitint:$d_quad:$quadtype" in
11120 uvtype="$uquadtype"
11125 uvtype="unsigned long"
11131 case "$uselongdouble:$d_longdbl" in
11133 nvtype="long double"
11134 nvsize=$longdblsize
11141 $echo "(IV will be "$ivtype", $ivsize bytes)"
11142 $echo "(UV will be "$uvtype", $uvsize bytes)"
11143 $echo "(NV will be "$nvtype", $nvsize bytes)"
11146 #$i_inttypes I_INTTYPES
11148 #include <inttypes.h>
11153 int8_t i = INT8_MAX;
11154 uint8_t u = UINT8_MAX;
11155 printf("int8_t\n");
11158 int16_t i = INT16_MAX;
11159 uint16_t i = UINT16_MAX;
11160 printf("int16_t\n");
11163 int32_t i = INT32_MAX;
11164 uint32_t u = UINT32_MAX;
11165 printf("int32_t\n");
11171 '') case "$charsize" in
11173 u8type="unsigned char"
11182 if eval $compile; then
11183 case "`$run ./try`" in
11184 int8_t) i8type=int8_t
11194 '') if $test $charsize -ge 1; then
11196 u8type="unsigned char"
11204 '') case "$shortsize" in
11206 u16type="unsigned short"
11214 '') set try -DINT16
11215 if eval $compile; then
11216 case "`$run ./try`" in
11228 '') if $test $shortsize -ge 2; then
11230 u16type="unsigned short"
11238 '') case "$longsize" in
11240 u32type="unsigned long"
11244 *) case "$intsize" in
11246 u32type="unsigned int"
11256 '') set try -DINT32
11257 if eval $compile; then
11258 case "`$run ./try`" in
11270 '') if $test $intsize -ge 4; then
11272 u32type="unsigned int"
11280 '') case "$d_quad:$quadtype" in
11282 i64type="$quadtype"
11283 u64type="$uquadtype"
11291 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
11292 : volatile so that the compiler has to store it out to memory.
11293 if test X"$d_volatile" = X"$define"; then
11298 #include <sys/types.h>
11299 #include <signal.h>
11301 $volatile int bletched = 0;
11302 $signal_t blech(s) int s; { bletched = 1; }
11307 int n = 8 * $uvsize;
11310 signal(SIGFPE, blech);
11313 for (i = 0; i < n; i++) {
11314 u = u << 1 | ($uvtype)1;
11316 if (($uvtype)d != u)
11320 d = ($nvtype)(u - 1);
11321 if (($uvtype)d != (u - 1))
11329 printf("%d\n", ((i == n) ? -n : i));
11335 d_nv_preserves_uv="$undef"
11336 if eval $compile; then
11337 d_nv_preserves_uv_bits="`$run ./try`"
11339 case "$d_nv_preserves_uv_bits" in
11341 d_nv_preserves_uv_bits=`expr 0 - $d_nv_preserves_uv_bits`
11342 $echo "Your NVs can preserve all $d_nv_preserves_uv_bits bits of your UVs." 2>&1
11343 d_nv_preserves_uv="$define"
11345 [1-9]*) $echo "Your NVs can preserve only $d_nv_preserves_uv_bits bits of your UVs." 2>&1
11346 d_nv_preserves_uv="$undef" ;;
11347 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
11348 d_nv_preserves_uv_bits="$undef" ;;
11354 : check for off64_t
11356 echo "Checking to see if you have off64_t..." >&4
11358 #include <sys/types.h>
11359 #include <unistd.h>
11360 int main() { off64_t x = 7; }
11363 if eval $compile; then
11365 echo "You have off64_t."
11368 echo "You do not have off64_t."
11369 case "$lseeksize" in
11370 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
11377 : see if POSIX threads are available
11378 set pthread.h i_pthread
11384 : how to create joinable pthreads
11385 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
11387 echo "Checking what constant to use for creating joinable pthreads..." >&4
11388 $cat >try.c <<'EOCP'
11389 #include <pthread.h>
11391 int detachstate = JOINABLE;
11394 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
11395 if eval $compile; then
11396 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
11397 val="$undef" # Yes, undef.
11398 set d_old_pthread_create_joinable
11401 set old_pthread_create_joinable
11404 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
11405 if eval $compile; then
11406 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
11408 set d_old_pthread_create_joinable
11410 val=PTHREAD_CREATE_UNDETACHED
11411 set old_pthread_create_joinable
11414 set try -DJOINABLE=__UNDETACHED
11415 if eval $compile; then
11416 echo "You seem to use __UNDETACHED." >&4
11418 set d_old_pthread_create_joinable
11421 set old_pthread_create_joinable
11424 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
11426 set d_old_pthread_create_joinable
11429 set old_pthread_create_joinable
11436 d_old_pthread_create_joinable="$undef"
11437 old_pthread_create_joinable=""
11440 : see if pause exists
11444 : see if pipe exists
11448 : see if poll exists
11452 : see if readlink exists
11453 set readlink d_readlink
11457 echo "Checking for /proc/self/exe..." >&4
11459 case "$d_readlink" in
11461 if $issymlink /proc/self/exe ; then
11462 $ls -l /proc/self/exe > reflect
11463 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
11465 echo "You have Linux-like /proc/self/exe."
11474 : see if pthread_atfork exists
11475 set pthread_atfork d_pthread_atfork
11479 : see whether the various POSIXish _yields exist
11481 #include <pthread.h>
11487 #ifdef PTHREAD_YIELD
11490 #ifdef PTHREAD_YIELD_NULL
11491 pthread_yield(NULL);
11497 : see if sched_yield exists
11498 set try -DSCHED_YIELD
11499 if eval $compile; then
11501 sched_yield='sched_yield()'
11505 case "$usethreads" in
11508 $define) echo 'sched_yield() found.' >&4 ;;
11509 *) echo 'sched_yield() NOT found.' >&4 ;;
11515 : see if pthread_yield exists
11516 set try -DPTHREAD_YIELD
11517 if eval $compile; then
11519 case "$sched_yield" in
11520 '') sched_yield='pthread_yield()' ;;
11523 set try -DPTHREAD_YIELD_NULL
11524 if eval $compile; then
11526 case "$sched_yield" in
11527 '') sched_yield='pthread_yield(NULL)' ;;
11533 case "$usethreads" in
11536 $define) echo 'pthread_yield() found.' >&4 ;;
11537 *) echo 'pthread_yield() NOT found.' >&4 ;;
11541 set d_pthread_yield
11544 case "$sched_yield" in
11545 '') sched_yield=undef ;;
11550 : see if this is a pwd.h system
11556 xxx=`./findhdr pwd.h`
11557 $cppstdin $cppflags $cppminus < $xxx >$$.h
11559 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
11567 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
11575 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
11583 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
11591 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
11599 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
11607 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
11615 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
11627 set d_pwquota; eval $setvar
11628 set d_pwage; eval $setvar
11629 set d_pwchange; eval $setvar
11630 set d_pwclass; eval $setvar
11631 set d_pwexpire; eval $setvar
11632 set d_pwcomment; eval $setvar
11633 set d_pwgecos; eval $setvar
11634 set d_pwpasswd; eval $setvar
11638 : see if readdir and friends exist
11639 set readdir d_readdir
11641 set seekdir d_seekdir
11643 set telldir d_telldir
11645 set rewinddir d_rewinddir
11648 : see if readv exists
11652 : see if recvmsg exists
11653 set recvmsg d_recvmsg
11656 : see if rename exists
11657 set rename d_rename
11660 : see if rmdir exists
11664 : see if memory.h is available.
11669 : See if it conflicts with string.h
11675 $cppstdin $cppflags $cppminus < $strings > mem.h
11676 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
11678 echo "We won't be including <memory.h>."
11688 : can bcopy handle overlapping blocks?
11691 case "$d_memmove" in
11692 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
11693 *) case "$d_bcopy" in
11695 echo "Checking to see if bcopy() can do overlapping copies..." >&4
11697 #$i_memory I_MEMORY
11698 #$i_stdlib I_STDLIB
11699 #$i_string I_STRING
11700 #$i_unistd I_UNISTD
11702 $cat >>try.c <<'EOCP'
11705 # include <memory.h>
11708 # include <stdlib.h>
11711 # include <string.h>
11713 # include <strings.h>
11716 # include <unistd.h> /* Needed for NetBSD */
11720 char buf[128], abc[128];
11726 /* Copy "abcde..." string to char abc[] so that gcc doesn't
11727 try to store the string in read-only memory. */
11728 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
11730 for (align = 7; align >= 0; align--) {
11731 for (len = 36; len; len--) {
11733 bcopy(abc, b, len);
11734 for (off = 1; off <= len; off++) {
11735 bcopy(b, b+off, len);
11736 bcopy(b+off, b, len);
11737 if (bcmp(b, abc, len))
11746 if eval $compile_ok; then
11747 if ./try 2>/dev/null; then
11748 echo "Yes, it can."
11751 echo "It can't, sorry."
11754 echo "(I can't compile the test program, so we'll assume not...)"
11758 $rm -f try.* try core
11764 : can memcpy handle overlapping blocks?
11767 case "$d_memmove" in
11768 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
11769 *) case "$d_memcpy" in
11771 echo "Checking to see if memcpy() can do overlapping copies..." >&4
11773 #$i_memory I_MEMORY
11774 #$i_stdlib I_STDLIB
11775 #$i_string I_STRING
11776 #$i_unistd I_UNISTD
11778 $cat >>try.c <<'EOCP'
11781 # include <memory.h>
11784 # include <stdlib.h>
11787 # include <string.h>
11789 # include <strings.h>
11792 # include <unistd.h> /* Needed for NetBSD */
11796 char buf[128], abc[128];
11802 /* Copy "abcde..." string to char abc[] so that gcc doesn't
11803 try to store the string in read-only memory. */
11804 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
11806 for (align = 7; align >= 0; align--) {
11807 for (len = 36; len; len--) {
11809 memcpy(b, abc, len);
11810 for (off = 1; off <= len; off++) {
11811 memcpy(b+off, b, len);
11812 memcpy(b, b+off, len);
11813 if (memcmp(b, abc, len))
11822 if eval $compile_ok; then
11823 if ./try 2>/dev/null; then
11824 echo "Yes, it can."
11827 echo "It can't, sorry."
11830 echo "(I can't compile the test program, so we'll assume not...)"
11834 $rm -f try.* try core
11840 : can memcmp be trusted to compare relative magnitude?
11842 case "$d_memcmp" in
11845 echo "Checking if your memcmp() can compare relative magnitude..." >&4
11847 #$i_memory I_MEMORY
11848 #$i_stdlib I_STDLIB
11849 #$i_string I_STRING
11850 #$i_unistd I_UNISTD
11852 $cat >>try.c <<'EOCP'
11855 # include <memory.h>
11858 # include <stdlib.h>
11861 # include <string.h>
11863 # include <strings.h>
11866 # include <unistd.h> /* Needed for NetBSD */
11872 if ((a < b) && memcmp(&a, &b, 1) < 0)
11878 if eval $compile_ok; then
11879 if $run ./try 2>/dev/null; then
11880 echo "Yes, it can."
11883 echo "No, it can't (it uses signed chars)."
11886 echo "(I can't compile the test program, so we'll assume not...)"
11890 $rm -f try.* try core
11894 : see if prototype for sbrk is available
11896 set d_sbrkproto sbrk $i_unistd unistd.h
11899 : see if select exists
11900 set select d_select
11903 : see if semctl exists
11904 set semctl d_semctl
11907 : see if semget exists
11908 set semget d_semget
11911 : see if semop exists
11915 : see how much of the 'sem*(2)' library is present.
11918 case "$d_semctl$d_semget$d_semop" in
11919 *"$undef"*) h_sem=false;;
11923 case "`ipcs 2>&1`" in
11924 "SVID messages"*"not configured"*)
11925 echo "Your $osname does not have the sem*(2) configured." >&4
11928 set semctl d_semctl
11930 set semget d_semget
11938 : we could also check for sys/ipc.h ...
11939 if $h_sem && $test `./findhdr sys/sem.h`; then
11940 echo "You have the full sem*(2) library." >&4
11943 echo "You don't have the full sem*(2) library." >&4
11949 : see whether sys/sem.h defines union semun
11951 $cat > try.c <<'END'
11952 #include <sys/types.h>
11953 #include <sys/ipc.h>
11954 #include <sys/sem.h>
11955 int main () { union semun semun; semun.buf = 0; }
11958 if eval $compile; then
11959 echo "You have union semun in <sys/sem.h>." >&4
11962 echo "You do not have union semun in <sys/sem.h>." >&4
11965 $rm -f try try.c try.h
11969 : see how to do semctl IPC_STAT
11972 : see whether semctl IPC_STAT can use union semun
11977 # define S_IRUSR S_IREAD
11978 # define S_IWUSR S_IWRITE
11979 # define S_IXUSR S_IEXEC
11981 # define S_IRUSR 0400
11982 # define S_IWUSR 0200
11983 # define S_IXUSR 0100
11985 # define S_IRGRP (S_IRUSR>>3)
11986 # define S_IWGRP (S_IWUSR>>3)
11987 # define S_IXGRP (S_IXUSR>>3)
11988 # define S_IROTH (S_IRUSR>>6)
11989 # define S_IWOTH (S_IWUSR>>6)
11990 # define S_IXOTH (S_IXUSR>>6)
11993 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
11994 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
11995 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
12000 #include <sys/types.h>
12001 #include <sys/ipc.h>
12002 #include <sys/sem.h>
12003 #include <sys/stat.h>
12010 #$d_union_semun HAS_UNION_SEMUN
12013 #ifndef HAS_UNION_SEMUN
12016 struct semid_ds *buf;
12017 unsigned short *array;
12023 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
12024 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
12026 struct semid_ds argbuf;
12029 st = semctl(sem, 0, IPC_STAT, arg);
12033 # endif /* IPC_STAT */
12034 printf("semctl IPC_STAT failed: errno = %d\n", errno);
12036 if (semctl(sem, 0, IPC_RMID, arg) != 0)
12037 # endif /* IPC_RMID */
12038 printf("semctl IPC_RMID failed: errno = %d\n", errno);
12040 #endif /* IPC_PRIVATE && ... */
12041 printf("semget failed: errno = %d\n", errno);
12047 if eval $compile; then
12050 semun) val="$define" ;;
12056 case "$d_semctl_semun" in
12058 echo "You can use union semun for semctl IPC_STAT." >&4
12061 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
12066 : see whether semctl IPC_STAT can use struct semid_ds pointer
12067 $cat > try.c <<'END'
12068 #include <sys/types.h>
12069 #include <sys/ipc.h>
12070 #include <sys/sem.h>
12071 #include <sys/stat.h>
12079 struct semid_ds arg;
12082 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
12083 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
12086 st = semctl(sem, 0, IPC_STAT, &arg);
12088 printf("semid_ds\n");
12090 # endif /* IPC_STAT */
12091 printf("semctl IPC_STAT failed: errno = %d\n", errno);
12093 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
12094 # endif /* IPC_RMID */
12095 printf("semctl IPC_RMID failed: errno = %d\n", errno);
12097 #endif /* IPC_PRIVATE && ... */
12098 printf("semget failed: errno = %d\n", errno);
12105 if eval $compile; then
12108 semid_ds) val="$define" ;;
12112 set d_semctl_semid_ds
12114 case "$d_semctl_semid_ds" in
12116 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
12118 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
12125 # We do not have the full sem*(2) library, so assume we can not
12131 set d_semctl_semid_ds
12136 : see if sendmsg exists
12137 set sendmsg d_sendmsg
12140 : see if setegid exists
12141 set setegid d_setegid
12144 : see if seteuid exists
12145 set seteuid d_seteuid
12148 : see if setgrent exists
12149 set setgrent d_setgrent
12152 : see if sethostent exists
12153 set sethostent d_sethent
12156 : see if setitimer exists
12157 set setitimer d_setitimer
12160 : see if setlinebuf exists
12161 set setlinebuf d_setlinebuf
12164 : see if setlocale exists
12165 set setlocale d_setlocale
12168 : see if setnetent exists
12169 set setnetent d_setnent
12172 : see if setprotoent exists
12173 set setprotoent d_setpent
12176 : see if setpgid exists
12177 set setpgid d_setpgid
12180 : see if setpgrp2 exists
12181 set setpgrp2 d_setpgrp2
12184 : see if setpriority exists
12185 set setpriority d_setprior
12188 : see if setproctitle exists
12189 set setproctitle d_setproctitle
12192 : see if setpwent exists
12193 set setpwent d_setpwent
12196 : see if setregid exists
12197 set setregid d_setregid
12199 set setresgid d_setresgid
12202 : see if setreuid exists
12203 set setreuid d_setreuid
12205 set setresuid d_setresuid
12208 : see if setrgid exists
12209 set setrgid d_setrgid
12212 : see if setruid exists
12213 set setruid d_setruid
12216 : see if setservent exists
12217 set setservent d_setsent
12220 : see if setsid exists
12221 set setsid d_setsid
12224 : see if setvbuf exists
12225 set setvbuf d_setvbuf
12228 : see if sfio.h is available
12233 : see if sfio library is available
12244 : Ok, but do we want to use it.
12248 true|$define|[yY]*) dflt='y';;
12251 echo "$package can use the sfio library, but it is experimental."
12252 case "$useperlio" in
12254 echo "For sfio also the PerlIO abstraction layer is needed."
12255 echo "Earlier you said you wouldn't want that."
12258 rp="You seem to have sfio available, do you want to try using it?"
12261 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
12262 useperlio="$define"
12265 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
12270 *) case "$usesfio" in
12271 true|$define|[yY]*)
12272 echo "Sorry, cannot find sfio on this machine." >&4
12273 echo "Ignoring your setting of usesfio=$usesfio." >&4
12282 $define) usesfio='true';;
12283 *) usesfio='false';;
12287 *) : Remove sfio from list of libraries to use
12290 echo "Removing unneeded -lsfio from library list" >&4
12291 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
12294 echo "libs = $libs" >&4
12301 : see if shmctl exists
12302 set shmctl d_shmctl
12305 : see if shmget exists
12306 set shmget d_shmget
12309 : see if shmat exists
12312 : see what shmat returns
12315 $cat >shmat.c <<'END'
12316 #include <sys/shm.h>
12319 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
12324 echo "and it returns ($shmattype)." >&4
12325 : see if a prototype for shmat is available
12326 xxx=`./findhdr sys/shm.h`
12327 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
12328 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
12339 set d_shmatprototype
12342 : see if shmdt exists
12346 : see how much of the 'shm*(2)' library is present.
12349 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
12350 *"$undef"*) h_shm=false;;
12354 case "`ipcs 2>&1`" in
12355 "SVID shared memory"*"not configured"*)
12356 echo "Your $osname does not have the shm*(2) configured." >&4
12359 set shmctl d_shmctl
12361 set shmget d_shmget
12371 : we could also check for sys/ipc.h ...
12372 if $h_shm && $test `./findhdr sys/shm.h`; then
12373 echo "You have the full shm*(2) library." >&4
12376 echo "You don't have the full shm*(2) library." >&4
12383 : see if we have sigaction
12384 if set sigaction val -f d_sigaction; eval $csym; $val; then
12385 echo 'sigaction() found.' >&4
12386 $cat > try.c <<'EOP'
12388 #include <sys/types.h>
12389 #include <signal.h>
12392 struct sigaction act, oact;
12394 oact.sa_handler = 0;
12395 /* so that act and oact are used */
12396 exit(act.sa_flags == 0 && oact.sa_handler == 0);
12400 if eval $compile_ok; then
12403 echo "But you don't seem to have a useable struct sigaction." >&4
12407 echo 'sigaction NOT found.' >&4
12410 set d_sigaction; eval $setvar
12411 $rm -f try try$_o try.c
12413 : see if sigprocmask exists
12414 set sigprocmask d_sigprocmask
12417 : see if sigsetjmp exists
12419 case "$d_sigsetjmp" in
12421 $cat >try.c <<'EOP'
12422 #include <setjmp.h>
12427 if (sigsetjmp(env,1))
12430 siglongjmp(env, 1);
12435 if eval $compile; then
12436 if $run ./try >/dev/null 2>&1; then
12437 echo "POSIX sigsetjmp found." >&4
12441 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
12447 echo "sigsetjmp not found." >&4
12451 *) val="$d_sigsetjmp"
12452 case "$d_sigsetjmp" in
12453 $define) echo "POSIX sigsetjmp found." >&4;;
12454 $undef) echo "sigsetjmp not found." >&4;;
12462 : see if sockatmark exists
12463 set sockatmark d_sockatmark
12466 : see if prototype for sockatmark is available
12468 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
12471 : see if socks5_init exists
12472 set socks5_init d_socks5_init
12475 : see if prototype for setresgid is available
12477 set d_sresgproto setresgid $i_unistd unistd.h
12480 : see if prototype for setresuid is available
12482 set d_sresuproto setresuid $i_unistd unistd.h
12485 : see if sys/stat.h is available
12486 set sys/stat.h i_sysstat
12490 : see if stat knows about block sizes
12492 echo "Checking to see if your struct stat has st_blocks field..." >&4
12493 set d_statblks stat st_blocks $i_sysstat sys/stat.h
12497 : see if this is a sys/vfs.h system
12498 set sys/vfs.h i_sysvfs
12502 : see if this is a sys/statfs.h system
12503 set sys/statfs.h i_sysstatfs
12508 echo "Checking to see if your system supports struct statfs..." >&4
12509 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
12511 case "$d_statfs_s" in
12512 "$define") echo "Yes, it does." ;;
12513 *) echo "No, it doesn't." ;;
12518 : see if struct statfs knows about f_flags
12519 case "$d_statfs_s" in
12522 echo "Checking to see if your struct statfs has f_flags field..." >&4
12523 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
12527 set d_statfs_f_flags
12531 case "$d_statfs_f_flags" in
12532 "$define") echo "Yes, it does." ;;
12533 *) echo "No, it doesn't." ;;
12536 : see if _ptr and _cnt from stdio act std
12539 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12540 echo "(Looks like you have stdio.h from BSD.)"
12541 case "$stdio_ptr" in
12542 '') stdio_ptr='((fp)->_p)'
12545 *) ptr_lval=$d_stdio_ptr_lval;;
12547 case "$stdio_cnt" in
12548 '') stdio_cnt='((fp)->_r)'
12551 *) cnt_lval=$d_stdio_cnt_lval;;
12553 case "$stdio_base" in
12554 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12556 case "$stdio_bufsiz" in
12557 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12559 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12560 echo "(Looks like you have stdio.h from Linux.)"
12561 case "$stdio_ptr" in
12562 '') stdio_ptr='((fp)->_IO_read_ptr)'
12565 *) ptr_lval=$d_stdio_ptr_lval;;
12567 case "$stdio_cnt" in
12568 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12571 *) cnt_lval=$d_stdio_cnt_lval;;
12573 case "$stdio_base" in
12574 '') stdio_base='((fp)->_IO_read_base)';;
12576 case "$stdio_bufsiz" in
12577 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12580 case "$stdio_ptr" in
12581 '') stdio_ptr='((fp)->_ptr)'
12584 *) ptr_lval=$d_stdio_ptr_lval;;
12586 case "$stdio_cnt" in
12587 '') stdio_cnt='((fp)->_cnt)'
12590 *) cnt_lval=$d_stdio_cnt_lval;;
12592 case "$stdio_base" in
12593 '') stdio_base='((fp)->_base)';;
12595 case "$stdio_bufsiz" in
12596 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12600 : test whether _ptr and _cnt really work
12601 echo "Checking how std your stdio is..." >&4
12604 #define FILE_ptr(fp) $stdio_ptr
12605 #define FILE_cnt(fp) $stdio_cnt
12607 FILE *fp = fopen("try.c", "r");
12610 18 <= FILE_cnt(fp) &&
12611 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12619 if eval $compile && $to try.c; then
12620 if $run ./try; then
12621 echo "Your stdio acts pretty std."
12624 echo "Your stdio isn't very std."
12627 echo "Your stdio doesn't appear very std."
12633 : Can _ptr be used as an lvalue?
12634 case "$d_stdstdio$ptr_lval" in
12635 $define$define) val=$define ;;
12638 set d_stdio_ptr_lval
12641 : Can _cnt be used as an lvalue?
12642 case "$d_stdstdio$cnt_lval" in
12643 $define$define) val=$define ;;
12646 set d_stdio_cnt_lval
12650 : test whether setting _ptr sets _cnt as a side effect
12651 d_stdio_ptr_lval_sets_cnt="$undef"
12652 d_stdio_ptr_lval_nochange_cnt="$undef"
12653 case "$d_stdio_ptr_lval$d_stdstdio" in
12655 echo "Checking to see what happens if we set the stdio ptr..." >&4
12658 /* Can we scream? */
12659 /* Eat dust sed :-) */
12660 /* In the buffer space, no one can hear you scream. */
12661 #define FILE_ptr(fp) $stdio_ptr
12662 #define FILE_cnt(fp) $stdio_cnt
12663 #include <sys/types.h>
12665 FILE *fp = fopen("try.c", "r");
12670 puts("Fail even to read");
12673 c = getc(fp); /* Read away the first # */
12675 puts("Fail even to read");
12679 18 <= FILE_cnt(fp) &&
12680 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12682 puts("Fail even to read");
12685 ptr = (char*) FILE_ptr(fp);
12686 cnt = (size_t)FILE_cnt(fp);
12688 FILE_ptr(fp) += 42;
12690 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12691 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12694 if (FILE_cnt(fp) <= 20) {
12695 printf ("Fail (<20 chars to test)");
12698 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12699 puts("Fail compare");
12702 if (cnt == FILE_cnt(fp)) {
12703 puts("Pass_unchanged");
12706 if (FILE_cnt(fp) == (cnt - 42)) {
12707 puts("Pass_changed");
12710 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12716 if eval $compile && $to try.c; then
12717 case `$run ./try` in
12719 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12720 d_stdio_ptr_lval_sets_cnt="$define" ;;
12722 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12723 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12725 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12727 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12730 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12736 : see if _base is also standard
12738 case "$d_stdstdio" in
12742 #define FILE_base(fp) $stdio_base
12743 #define FILE_bufsiz(fp) $stdio_bufsiz
12745 FILE *fp = fopen("try.c", "r");
12748 19 <= FILE_bufsiz(fp) &&
12749 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
12756 if eval $compile && $to try.c; then
12757 if $run ./try; then
12758 echo "And its _base field acts std."
12761 echo "But its _base field isn't std."
12764 echo "However, it seems to be lacking the _base field."
12773 Checking how to access stdio streams by file descriptor number...
12775 case "$stdio_stream_array" in
12776 '') $cat >try.c <<EOCP
12779 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
12783 for s in _iob __iob __sF
12785 set try -DSTDIO_STREAM_ARRAY=$s
12786 if eval $compile; then
12787 case "`$run ./try`" in
12788 yes) stdio_stream_array=$s; break ;;
12792 $rm -f try.* try$exe_ext
12794 case "$stdio_stream_array" in
12796 I can't figure out how to access stdio streams by file descriptor number.
12798 d_stdio_stream_array="$undef"
12801 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
12803 d_stdio_stream_array="$define"
12807 : see if strcoll exists
12808 set strcoll d_strcoll
12811 : check for structure copying
12813 echo "Checking to see if your C compiler can copy structs..." >&4
12814 $cat >try.c <<'EOCP'
12824 if $cc -c try.c >/dev/null 2>&1 ; then
12826 echo "Yup, it can."
12829 echo "Nope, it can't."
12835 : see if strerror and/or sys_errlist[] exist
12837 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
12838 if set strerror val -f d_strerror; eval $csym; $val; then
12839 echo 'strerror() found.' >&4
12840 d_strerror="$define"
12841 d_strerrm='strerror(e)'
12842 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
12843 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
12844 d_syserrlst="$define"
12846 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
12847 d_syserrlst="$undef"
12849 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
12850 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
12851 echo 'strerror() found in string header.' >&4
12852 d_strerror="$define"
12853 d_strerrm='strerror(e)'
12854 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
12855 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
12856 d_syserrlst="$define"
12858 echo "(You don't appear to have any sys_errlist[], how can this be?)"
12859 d_syserrlst="$undef"
12861 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
12862 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
12863 d_strerror="$undef"
12864 d_syserrlst="$define"
12865 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
12867 echo 'strerror() and sys_errlist[] NOT found.' >&4
12868 d_strerror="$undef"
12869 d_syserrlst="$undef"
12870 d_strerrm='"unknown"'
12874 : see if strftime exists
12875 set strftime d_strftime
12878 : see if strtod exists
12879 set strtod d_strtod
12882 : see if strtol exists
12883 set strtol d_strtol
12886 : see if strtold exists
12887 set strtold d_strtold
12890 : see if strtoll exists
12891 set strtoll d_strtoll
12894 case "$d_longlong-$d_strtoll" in
12897 Checking whether your strtoll() works okay...
12899 $cat >try.c <<'EOCP'
12902 #define strtoll __strtoll
12905 #define strtoll _strtoll
12908 extern long long int strtoll(char *s, char **, int);
12909 static int bad = 0;
12910 int check(char *s, long long ell, int een) {
12913 gll = strtoll(s, 0, 10);
12914 if (!((gll == ell) && (errno == een)))
12918 check(" 1", 1LL, 0);
12919 check(" 0", 0LL, 0);
12920 check("-1", -1LL, 0);
12921 check("-9223372036854775808", -9223372036854775808LL, 0);
12922 check("-9223372036854775808", -9223372036854775808LL, 0);
12923 check(" 9223372036854775807", 9223372036854775807LL, 0);
12924 check("-9223372036854775808", -9223372036854775808LL, 0);
12925 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
12926 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
12932 if eval $compile; then
12935 ok) echo "Your strtoll() seems to be working okay." ;;
12937 Your strtoll() doesn't seem to be working okay.
12943 echo "(I can't seem to compile the test program--assuming it doesn't)"
12949 : see if strtoq exists
12950 set strtoq d_strtoq
12953 : see if strtoul exists
12954 set strtoul d_strtoul
12957 case "$d_strtoul" in
12960 Checking whether your strtoul() works okay...
12962 $cat >try.c <<'EOCP'
12965 extern unsigned long int strtoul(char *s, char **, int);
12966 static int bad = 0;
12967 void check(char *s, unsigned long eul, int een) {
12970 gul = strtoul(s, 0, 10);
12971 if (!((gul == eul) && (errno == een)))
12975 check(" 1", 1L, 0);
12976 check(" 0", 0L, 0);
12978 case "$longsize" in
12980 $cat >>try.c <<'EOCP'
12981 check("18446744073709551615", 18446744073709551615UL, 0);
12982 check("18446744073709551616", 18446744073709551615UL, ERANGE);
12983 #if 0 /* strtoul() for /^-/ strings is undefined. */
12984 check("-1", 18446744073709551615UL, 0);
12985 check("-18446744073709551614", 2, 0);
12986 check("-18446744073709551615", 1, 0);
12987 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
12988 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
12993 $cat >>try.c <<'EOCP'
12994 check("4294967295", 4294967295UL, 0);
12995 check("4294967296", 4294967295UL, ERANGE);
12996 #if 0 /* strtoul() for /^-/ strings is undefined. */
12997 check("-1", 4294967295UL, 0);
12998 check("-4294967294", 2, 0);
12999 check("-4294967295", 1, 0);
13000 check("-4294967296", 4294967295UL, ERANGE);
13001 check("-4294967297", 4294967295UL, ERANGE);
13006 : Should we write these tests to be more portable by sprintf-ing
13007 : ~0 and then manipulating that char string as input for strtol?
13010 $cat >>try.c <<'EOCP'
13017 if eval $compile; then
13018 case "`$run ./try`" in
13019 ok) echo "Your strtoul() seems to be working okay." ;;
13021 Your strtoul() doesn't seem to be working okay.
13030 : see if strtoull exists
13031 set strtoull d_strtoull
13034 case "$d_longlong-$d_strtoull" in
13037 Checking whether your strtoull() works okay...
13039 $cat >try.c <<'EOCP'
13042 #define strtoull __strtoull
13045 extern unsigned long long int strtoull(char *s, char **, int);
13046 static int bad = 0;
13047 int check(char *s, long long eull, int een) {
13050 gull = strtoull(s, 0, 10);
13051 if (!((gull == eull) && (errno == een)))
13055 check(" 1", 1LL, 0);
13056 check(" 0", 0LL, 0);
13057 check("18446744073709551615", 18446744073709551615ULL, 0);
13058 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
13059 #if 0 /* strtoull() for /^-/ strings is undefined. */
13060 check("-1", 18446744073709551615ULL, 0);
13061 check("-18446744073709551614", 2LL, 0);
13062 check("-18446744073709551615", 1LL, 0);
13063 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
13064 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
13071 if eval $compile; then
13072 case "`$run ./try`" in
13073 ok) echo "Your strtoull() seems to be working okay." ;;
13075 Your strtoull() doesn't seem to be working okay.
13077 d_strtoull="$undef"
13084 : see if strtouq exists
13085 set strtouq d_strtouq
13088 case "$d_strtouq" in
13091 Checking whether your strtouq() works okay...
13093 $cat >try.c <<'EOCP'
13096 extern unsigned long long int strtouq(char *s, char **, int);
13097 static int bad = 0;
13098 void check(char *s, unsigned long long eull, int een) {
13099 unsigned long long gull;
13101 gull = strtouq(s, 0, 10);
13102 if (!((gull == eull) && (errno == een)))
13106 check(" 1", 1LL, 0);
13107 check(" 0", 0LL, 0);
13108 check("18446744073709551615", 18446744073709551615ULL, 0);
13109 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
13110 #if 0 /* strtouq() for /^-/ strings is undefined. */
13111 check("-1", 18446744073709551615ULL, 0);
13112 check("-18446744073709551614", 2LL, 0);
13113 check("-18446744073709551615", 1LL, 0);
13114 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
13115 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
13123 if eval $compile; then
13124 case "`$run ./try`" in
13125 ok) echo "Your strtouq() seems to be working okay." ;;
13127 Your strtouq() doesn't seem to be working okay.
13136 : see if strxfrm exists
13137 set strxfrm d_strxfrm
13140 : see if symlink exists
13141 set symlink d_symlink
13144 : see if syscall exists
13145 set syscall d_syscall
13148 : see if prototype for syscall is available
13150 set d_syscallproto syscall $i_unistd unistd.h
13153 : see if sysconf exists
13154 set sysconf d_sysconf
13157 : see if system exists
13158 set system d_system
13161 : see if tcgetpgrp exists
13162 set tcgetpgrp d_tcgetpgrp
13165 : see if tcsetpgrp exists
13166 set tcsetpgrp d_tcsetpgrp
13169 : see if prototype for telldir is available
13171 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
13174 : see if this is a sys/times.h system
13175 set sys/times.h i_systimes
13178 : see if times exists
13180 if set times val -f d_times; eval $csym; $val; then
13181 echo 'times() found.' >&4
13184 case "$i_systimes" in
13185 "$define") inc='sys/times.h';;
13187 rp="What is the type returned by times() on this system?"
13188 set clock_t clocktype long stdio.h sys/types.h $inc
13191 echo 'times() NOT found, hope that will do.' >&4
13196 : see if truncate exists
13197 set truncate d_truncate
13200 : see if tzname[] exists
13202 if set tzname val -a d_tzname; eval $csym; $val; then
13204 echo 'tzname[] found.' >&4
13207 echo 'tzname[] NOT found.' >&4
13213 next|rhapsody|darwin) multiarch="$define" ;;
13215 case "$multiarch" in
13216 ''|[nN]*) multiarch="$undef" ;;
13219 : check for ordering of bytes in a long
13221 case "$usecrosscompile$multiarch" in
13224 You seem to be either cross-compiling or doing a multiarchitecture build,
13225 skipping the byteorder check.
13231 case "$byteorder" in
13234 In the following, larger digits indicate more significance. A big-endian
13235 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
13236 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
13237 machines may have weird orders like 3412. A Cray will report 87654321,
13238 an Alpha will report 12345678. If the test program works the default is
13240 I'm now running the test program...
13242 $cat >try.c <<'EOCP'
13249 char c[sizeof(long)];
13252 if (sizeof(long) > 4)
13253 u.l = (0x08070605L << 32) | 0x04030201L;
13256 for (i = 0; i < sizeof(long); i++)
13257 printf("%c", u.c[i]+'0');
13264 if eval $compile && ./try > /dev/null; then
13267 [1-4][1-4][1-4][1-4]|12345678|87654321)
13268 echo "(The test program ran ok.)"
13269 echo "byteorder=$dflt"
13272 ????|????????) echo "(The test program ran ok.)" ;;
13273 *) echo "(The test program didn't run right for some reason.)" ;;
13278 (I can't seem to compile the test program. Guessing big-endian...)
13281 case "$xxx_prompt" in
13283 rp="What is the order of bytes in a long?"
13299 Checking to see whether you can access character data unalignedly...
13303 #define U32 $u32type
13304 #define BYTEORDER $byteorder
13306 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
13307 U8 buf[] = "\0\0\0\1\0\0\0\0";
13311 if (sizeof(U32) != 4) {
13312 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
13318 for (i = 0; i < 4; i++) {
13319 up = (U32*)(buf + i);
13320 if (! ((*up == 1 << (8*i)) || /* big-endian */
13321 (*up == 1 << (8*(3-i))) /* little-endian */
13325 printf("read failed (%x)\n", *up);
13331 for (i = 0; i < 4; i++) {
13332 up = (U32*)(buf + i);
13334 if (*up != 0xBeef) {
13335 printf("write failed (%x)\n", *up);
13349 if eval $compile_ok; then
13350 echo "(Testing for character data alignment may dump core.)" >&4
13351 $run ./try 2>&1 >/dev/null
13354 You can access character data pretty unalignedly.
13356 d_u32align="$undef"
13359 It seems that you must access character data in an aligned manner.
13361 d_u32align="$define"
13364 $rm -f core core.try.* try.core
13366 rp='Can you access character data at unaligned addresses?'
13370 [yY]*) d_u32align="$undef" ;;
13371 *) d_u32align="$define" ;;
13375 : see if ualarm exists
13376 set ualarm d_ualarm
13379 : see if umask exists
13383 : see if unordered exists
13384 set unordered d_unordered
13387 : see if usleep exists
13388 set usleep d_usleep
13391 : see if prototype for usleep is available
13393 set d_usleepproto usleep $i_unistd unistd.h
13396 : see if ustat exists
13400 : backward compatibility for d_hvfork
13401 if test X$d_hvfork != X; then
13402 d_vfork="$d_hvfork"
13405 : see if there is a vfork
13410 : Ok, but do we want to use it. vfork is reportedly unreliable in
13411 : perl on Solaris 2.x, and probably elsewhere.
13415 case "$usevfork" in
13421 Perl can only use a vfork() that doesn't suffer from strict
13422 restrictions on calling functions or modifying global data in
13423 the child. For example, glibc-2.1 contains such a vfork()
13424 that is unsuitable. If your system provides a proper fork()
13425 call, chances are that you do NOT want perl to use vfork().
13428 rp="Do you still want to use vfork()?"
13433 echo "Ok, we won't use vfork()."
13442 $define) usevfork='true';;
13443 *) usevfork='false';;
13446 : see if this is an sysdir system
13447 set sys/dir.h i_sysdir
13450 : see if this is an sysndir system
13451 set sys/ndir.h i_sysndir
13454 : see if closedir exists
13455 set closedir d_closedir
13458 case "$d_closedir" in
13461 echo "Checking whether closedir() returns a status..." >&4
13463 #$i_dirent I_DIRENT /**/
13464 #$i_sysdir I_SYS_DIR /**/
13465 #$i_sysndir I_SYS_NDIR /**/
13466 #$i_systypes I_SYS_TYPES /**/
13468 #if defined(I_SYS_TYPES)
13469 #include <sys/types.h>
13471 #if defined(I_DIRENT)
13472 #include <dirent.h>
13473 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
13474 #include <sys/dir.h>
13478 #include <sys/ndir.h>
13482 #include <ndir.h> /* may be wrong in the future */
13484 #include <sys/dir.h>
13489 int main() { return closedir(opendir(".")); }
13492 if eval $compile_ok; then
13493 if $run ./try > /dev/null 2>&1 ; then
13494 echo "Yes, it does."
13497 echo "No, it doesn't."
13501 echo "(I can't seem to compile the test program--assuming it doesn't)"
13509 set d_void_closedir
13512 : see if there is a wait4
13516 : see if waitpid exists
13517 set waitpid d_waitpid
13520 : see if wcstombs exists
13521 set wcstombs d_wcstombs
13524 : see if wctomb exists
13525 set wctomb d_wctomb
13528 : see if writev exists
13529 set writev d_writev
13532 : preserve RCS keywords in files with variable substitution, grrr
13537 Revision='$Revision'
13539 : check for alignment requirements
13541 case "$usecrosscompile$multiarch" in
13544 You seem to be either cross-compiling or doing a multiarchitecture build,
13545 skipping the memory alignment check.
13548 case "$alignbytes" in
13549 '') alignbytes=8 ;;
13553 case "$alignbytes" in
13554 '') echo "Checking alignment constraints..." >&4
13555 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
13556 $cat >try.c <<'EOCP'
13557 typedef long double NV;
13560 $cat >try.c <<'EOCP'
13564 $cat >>try.c <<'EOCP'
13572 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
13577 if eval $compile_ok; then
13581 echo "(I can't seem to compile the test program...)"
13584 *) dflt="$alignbytes"
13587 rp="Doubles must be aligned on a how-many-byte boundary?"
13595 : set the base revision
13598 : how do we catenate cpp tokens here?
13600 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
13601 $cat >cpp_stuff.c <<'EOCP'
13602 #define RCAT(a,b)a/**/b
13603 #define ACAT(a,b)a ## b
13607 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
13608 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
13609 echo "Oh! Smells like ANSI's been here." >&4
13610 echo "We can catify or stringify, separately or together!"
13612 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
13613 echo "Ah, yes! The good old days!" >&4
13614 echo "However, in the good old days we don't know how to stringify and"
13615 echo "catify at the same time."
13619 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
13620 to have to edit the values of CAT[2-5] in config.h...
13622 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
13626 : see if this is a db.h system
13632 : Check db version.
13634 echo "Checking Berkeley DB version ..." >&4
13640 #include <sys/types.h>
13643 int main(int argc, char *argv[])
13645 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
13646 int Major, Minor, Patch ;
13647 unsigned long Version ;
13648 (void)db_version(&Major, &Minor, &Patch) ;
13650 printf("%d %d %d %d %d %d\n",
13651 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
13652 Major, Minor, Patch);
13655 printf("You have Berkeley DB Version 2 or greater.\n");
13657 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
13658 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
13659 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
13660 Major, Minor, Patch) ;
13662 /* check that db.h & libdb are compatible */
13663 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
13664 printf("db.h and libdb are incompatible.\n") ;
13668 printf("db.h and libdb are compatible.\n") ;
13670 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
13671 + DB_VERSION_PATCH ;
13673 /* needs to be >= 2.3.4 */
13674 if (Version < 2003004) {
13675 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
13676 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
13682 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
13687 printf("You have Berkeley DB Version 1.\n");
13688 exit(0); /* DB version < 2: the coast is clear. */
13690 exit(1); /* <db.h> not Berkeley DB? */
13696 if eval $compile_ok && $run ./try; then
13697 echo 'Looks OK.' >&4
13699 db_version_major=$1
13700 db_version_minor=$2
13701 db_version_patch=$3
13703 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
13707 : Remove db from list of libraries to use
13708 echo "Removing unusable -ldb from library list" >&4
13709 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
13712 echo "libs = $libs" >&4
13722 : Check the return type needed for hash
13724 echo "Checking return type needed for hash for Berkeley DB ..." >&4
13730 #include <sys/types.h>
13733 #ifndef DB_VERSION_MAJOR
13734 u_int32_t hash_cb (ptr, size)
13742 info.hash = hash_cb;
13746 if $cc $ccflags -c try.c >try.out 2>&1 ; then
13747 if $contains warning try.out >>/dev/null 2>&1 ; then
13750 db_hashtype='u_int32_t'
13753 : XXX Maybe we should just give up here.
13754 db_hashtype=u_int32_t
13756 echo "Help: I can't seem to compile the db test program." >&4
13757 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
13760 echo "Your version of Berkeley DB uses $db_hashtype for hash."
13762 *) db_hashtype=u_int32_t
13767 : Check the return type needed for prefix
13769 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
13775 #include <sys/types.h>
13778 #ifndef DB_VERSION_MAJOR
13779 size_t prefix_cb (key1, key2)
13787 info.prefix = prefix_cb;
13791 if $cc $ccflags -c try.c >try.out 2>&1 ; then
13792 if $contains warning try.out >>/dev/null 2>&1 ; then
13793 db_prefixtype='int'
13795 db_prefixtype='size_t'
13798 db_prefixtype='size_t'
13799 : XXX Maybe we should just give up here.
13801 echo "Help: I can't seem to compile the db test program." >&4
13802 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
13805 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
13807 *) db_prefixtype='size_t'
13812 : How can we generate normalized random numbers ?
13814 echo "Looking for a random number function..." >&4
13815 case "$randfunc" in
13817 if set drand48 val -f; eval $csym; $val; then
13819 echo "Good, found drand48()." >&4
13820 elif set random val -f; eval $csym; $val; then
13822 echo "OK, found random()." >&4
13825 echo "Yick, looks like I have to use rand()." >&4
13836 *-Dmy_rand=*|*-Dmy_srand=*)
13837 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
13838 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
13839 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
13840 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
13844 while $test "$cont"; do
13845 rp="Use which function to generate random numbers?"
13847 if $test "$ans" = "$dflt"; then
13853 if set $ans val -f; eval $csym; $val; then
13857 rp="I cannot find function $ans. Use that name anyway?"
13866 case "$randfunc" in
13868 drand01="drand48()"
13874 case "$randbits" in
13876 echo "Checking to see how many bits your $randfunc() function produces..." >&4
13878 #$i_unistd I_UNISTD
13879 #$i_stdlib I_STDLIB
13882 # include <unistd.h>
13885 # include <stdlib.h>
13890 register unsigned long tmp;
13891 register unsigned long max = 0L;
13893 for (i = 1000; i; i--) {
13894 tmp = (unsigned long) $randfunc();
13895 if (tmp > max) max = tmp;
13897 for (i = 0; max; i++)
13903 if eval $compile_ok; then
13907 echo "(I can't seem to compile the test program...)"
13914 rp="How many bits does your $randfunc() function produce?"
13918 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
13919 seedfunc="s$randfunc"
13920 randseedtype=unsigned
13924 rp="How many bits does your $randfunc() function produce?"
13927 seedfunc="s$randfunc"
13928 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
13929 if set $seedfunc val -f; eval $csym; $val; then
13930 echo "(Using $seedfunc() to seed random generator)"
13932 echo "(Warning: no $seedfunc() to seed random generator)"
13935 randseedtype=unsigned
13943 echo "Determining whether or not we are on an EBCDIC system..." >&4
13944 $cat >try.c <<'EOM'
13947 if ('M'==0xd4) return 0;
13954 if eval $compile_ok; then
13955 if $run ./try; then
13956 echo "You seem to speak EBCDIC." >&4
13959 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
13962 echo "I'm unable to compile the test program." >&4
13963 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
13971 Checking how to flush all pending stdio output...
13973 # I only know how to find the first 32 possibly open files on SunOS.
13974 # See also hints/sunos_4_1.sh and util.c --AD
13976 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
13978 $cat >>try.c <<EOCP
13980 #$i_unistd I_UNISTD
13982 # include <unistd.h>
13984 #$d_sysconf HAS_SYSCONF
13985 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
13986 #ifdef HAS_STDIO_STREAM_ARRAY
13987 # define STDIO_STREAM_ARRAY $stdio_stream_array
13992 p = fopen("try.out", "w");
13996 # ifdef TRY_FPRINTF
14000 #ifdef TRY_FFLUSH_NULL
14003 #ifdef TRY_FFLUSH_ALL
14005 long open_max = -1;
14006 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
14007 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
14009 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
14010 open_max = sysconf(_SC_OPEN_MAX);
14013 open_max = FOPEN_MAX;
14016 open_max = OPEN_MAX;
14025 # ifdef HAS_STDIO_STREAM_ARRAY
14026 if (open_max > 0) {
14028 for (i = 0; i < open_max; i++)
14029 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
14030 STDIO_STREAM_ARRAY[i]._file < open_max &&
14031 STDIO_STREAM_ARRAY[i]._flag)
14032 fflush(&STDIO_STREAM_ARRAY[i]);
14040 : first we have to find out how _not_ to flush
14042 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
14044 set try -DTRY_FPUTC
14045 if eval $compile; then
14046 $run ./try 2>/dev/null
14049 if $test ! -s try.out -a "X$code" = X42; then
14055 set try -DTRY_FPRINTF
14056 if eval $compile; then
14057 $run ./try 2>/dev/null
14060 if $test ! -s try.out -a "X$code" = X42; then
14061 output=-DTRY_FPRINTF
14067 : check for fflush NULL behaviour
14068 case "$fflushNULL" in
14069 '') set try -DTRY_FFLUSH_NULL $output
14070 if eval $compile; then
14071 $run ./try 2>/dev/null
14074 if $test -s try.out -a "X$code" = X42; then
14075 fflushNULL="`$cat try.out`"
14077 if $test "X$code" != X42; then
14079 (If this test failed, don't worry, we'll try another method shortly.)
14084 $rm -f core try.core core.try.*
14085 case "$fflushNULL" in
14087 Your fflush(NULL) works okay for output streams.
14088 Let's see if it clobbers input pipes...
14090 # As of mid-March 2000 all versions of Solaris appear to have a stdio
14091 # bug that improperly flushes the input end of pipes. So we avoid the
14092 # autoflush on fork/system/exec support for now. :-(
14093 $cat >tryp.c <<EOCP
14096 main(int argc, char **argv)
14102 while ((i = getc(stdin)) != -1
14103 && (*bp++ = i) != '\n'
14104 && bp < &buf[1024])
14107 fprintf(stdout, "%s", buf);
14115 fflushNULL="$define"
14117 if eval $compile; then
14119 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
14120 if cmp tryp.c tryp.out >/dev/null 2>&1; then
14122 fflush(NULL) seems to behave okay with input streams.
14124 fflushNULL="$define"
14127 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
14129 fflushNULL="$undef"
14132 $rm -f core tryp.c tryp.core core.tryp.*
14135 Your fflush(NULL) isn't working (contrary to ANSI C).
14137 fflushNULL="$undef"
14140 Cannot figure out whether your fflush(NULL) works or not.
14141 I'm assuming it doesn't (contrary to ANSI C).
14143 fflushNULL="$undef"
14147 $define|true|[yY]*)
14148 fflushNULL="$define"
14151 fflushNULL="$undef"
14154 : check explicit looping only if NULL did not work, and if the pipe
14155 : bug does not show up on an explicit flush too
14156 case "$fflushNULL" in
14158 $cat >tryp.c <<EOCP
14161 main(int argc, char **argv)
14167 while ((i = getc(stdin)) != -1
14168 && (*bp++ = i) != '\n'
14169 && bp < &buf[1024])
14172 fprintf(stdout, "%s", buf);
14181 if eval $compile; then
14183 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
14184 if cmp tryp.c tryp.out >/dev/null 2>&1; then
14186 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
14188 : now check for fflushall behaviour
14189 case "$fflushall" in
14190 '') set try -DTRY_FFLUSH_ALL $output
14191 if eval $compile; then
14193 (Now testing the other method--but note that this also may fail.)
14195 $run ./try 2>/dev/null
14198 if $test -s try.out -a "X$code" = X42; then
14199 fflushall="`$cat try.out`"
14202 $rm -f core try.core core.try.*
14203 case "$fflushall" in
14205 Whew. Flushing explicitly all the stdio streams works.
14207 fflushall="$define"
14210 Sigh. Flushing explicitly all the stdio streams doesn't work.
14215 Cannot figure out whether flushing stdio streams explicitly works or not.
14216 I'm assuming it doesn't.
14222 "$define"|true|[yY]*)
14223 fflushall="$define"
14231 All is futile. Even fflush(stdin) clobbers input pipes!
14238 $rm -f core tryp.c tryp.core core.tryp.*
14240 *) fflushall="$undef"
14244 case "$fflushNULL$fflushall" in
14247 OK, I give up. I cannot figure out how to flush pending stdio output.
14248 We won't be flushing handles at all before fork/exec/popen.
14252 $rm -f try.* try$exe_ext
14254 : Store the full pathname to the ar program for use in the C program
14255 : Respect a hint or command line value for full_ar.
14260 : Store the full pathname to the sed program for use in the C program
14263 : see what type gids are declared as in the kernel
14265 echo "Looking for the type for group ids returned by getgid()."
14266 set gid_t gidtype xxx stdio.h sys/types.h
14270 xxx=`./findhdr sys/user.h`
14271 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
14273 unsigned) dflt="$1 $2" ;;
14277 *) dflt="$gidtype";;
14280 gid_t) echo "gid_t found." ;;
14281 *) rp="What is the type for group ids returned by getgid()?"
14289 *_t) zzz="$gidtype" ;;
14292 echo "Checking the size of $zzz..." >&4
14294 #include <sys/types.h>
14297 printf("%d\n", (int)sizeof($gidtype));
14302 if eval $compile_ok; then
14306 echo "(I can't execute the test program--guessing $gidsize.)" >&4
14309 echo "Your $zzz is $gidsize bytes long."
14314 echo "(I can't compile the test program--guessing $gidsize.)" >&4
14320 *_t) zzz="$gidtype" ;;
14323 echo "Checking the sign of $zzz..." >&4
14325 #include <sys/types.h>
14336 if eval $compile; then
14340 echo "(I can't execute the test program--guessing unsigned.)" >&4
14344 1) echo "Your $zzz is unsigned." ;;
14345 -1) echo "Your $zzz is signed." ;;
14351 echo "(I can't compile the test program--guessing unsigned.)" >&4
14357 if $test X"$quadtype" != X; then
14359 echo "Checking how to print 64-bit integers..." >&4
14361 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
14362 $cat >try.c <<'EOCP'
14363 #include <sys/types.h>
14366 int q = 12345678901;
14367 printf("%ld\n", q);
14371 if eval $compile; then
14375 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
14376 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
14377 echo "We will use %d."
14383 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
14384 $cat >try.c <<'EOCP'
14385 #include <sys/types.h>
14388 long q = 12345678901;
14389 printf("%ld\n", q);
14393 if eval $compile; then
14397 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
14398 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
14399 echo "We will use %ld."
14405 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
14406 $cat >try.c <<'EOCP'
14407 #include <sys/types.h>
14408 #include <inttypes.h>
14411 int64_t q = 12345678901;
14412 printf("%" PRId64 "\n", q);
14416 if eval $compile; then
14420 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
14421 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
14422 echo "We will use the C9X style."
14428 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
14430 #include <sys/types.h>
14433 $quadtype q = 12345678901;
14434 printf("%Ld\n", q);
14438 if eval $compile; then
14442 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
14443 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
14444 echo "We will use %Ld."
14450 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
14451 $cat >try.c <<'EOCP'
14452 #include <sys/types.h>
14455 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
14456 printf("%lld\n", q);
14460 if eval $compile; then
14464 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
14465 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
14466 echo "We will use the %lld style."
14472 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
14474 #include <sys/types.h>
14477 $quadtype q = 12345678901;
14478 printf("%qd\n", q);
14482 if eval $compile; then
14486 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
14487 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
14488 echo "We will use %qd."
14494 if $test X"$sPRId64" = X; then
14495 echo "Cannot figure out how to print 64-bit integers." >&4
14503 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
14504 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
14506 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
14507 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
14513 $echo "Checking the format strings to be used for Perl's internal types..." >&4
14515 if $test X"$ivsize" = X8; then
14516 ivdformat="$sPRId64"
14517 uvuformat="$sPRIu64"
14518 uvoformat="$sPRIo64"
14519 uvxformat="$sPRIx64"
14520 uvXUformat="$sPRIXU64"
14522 if $test X"$ivsize" = X"$longsize"; then
14529 if $test X"$ivsize" = X"$intsize"; then
14537 if $test X"$ivsize" = X"$shortsize"; then
14548 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
14549 nveformat="$sPRIeldbl"
14550 nvfformat="$sPRIfldbl"
14551 nvgformat="$sPRIgldbl"
14552 nvEUformat="$sPRIEUldbl"
14553 nvFUformat="$sPRIFUldbl"
14554 nvGUformat="$sPRIGUldbl"
14564 case "$ivdformat" in
14565 '') echo "$0: Fatal: failed to find format strings, cannot continue." >& 4
14572 $echo "Checking the format string to be used for gids..." >&4
14575 -1) if $test X"$gidsize" = X"$ivsize"; then
14576 gidformat="$ivdformat"
14578 if $test X"$gidsize" = X"$longsize"; then
14581 if $test X"$gidsize" = X"$intsize"; then
14584 if $test X"$gidsize" = X"$shortsize"; then
14591 *) if $test X"$gidsize" = X"$uvsize"; then
14592 gidformat="$uvuformat"
14594 if $test X"$gidsize" = X"$longsize"; then
14597 if $test X"$gidsize" = X"$intsize"; then
14600 if $test X"$gidsize" = X"$shortsize"; then
14609 : see if getgroups exists
14610 set getgroups d_getgrps
14613 : see if setgroups exists
14614 set setgroups d_setgrps
14618 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
14620 case "$d_getgrps$d_setgrps" in
14622 case "$groupstype" in
14623 '') dflt="$gidtype" ;;
14624 *) dflt="$groupstype" ;;
14627 What type of pointer is the second argument to getgroups() and setgroups()?
14628 Usually this is the same as group ids, $gidtype, but not always.
14631 rp='What type pointer is the second argument to getgroups() and setgroups()?'
14635 *) groupstype="$gidtype";;
14639 echo "Checking if your $make program sets \$(MAKE)..." >&4
14640 case "$make_set_make" in
14642 $sed 's/^X //' > testmake.mak << 'EOF'
14644 X @echo 'maketemp="$(MAKE)"'
14646 case "`$make -f testmake.mak 2>/dev/null`" in
14647 *maketemp=*) make_set_make='#' ;;
14648 *) make_set_make="MAKE=$make" ;;
14650 $rm -f testmake.mak
14653 case "$make_set_make" in
14654 '#') echo "Yup, it does.";;
14655 *) echo "Nope, it doesn't.";;
14658 : see what type is used for mode_t
14659 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
14660 set mode_t modetype int stdio.h sys/types.h
14663 : see if stdarg is available
14665 if $test `./findhdr stdarg.h`; then
14666 echo "<stdarg.h> found." >&4
14669 echo "<stdarg.h> NOT found." >&4
14673 : see if varags is available
14675 if $test `./findhdr varargs.h`; then
14676 echo "<varargs.h> found." >&4
14678 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
14681 : set up the varargs testing programs
14682 $cat > varargs.c <<EOP
14684 #include <stdarg.h>
14687 #include <varargs.h>
14691 int f(char *p, ...)
14705 p = va_arg(ap, char *);
14710 $cat > varargs <<EOP
14712 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
14721 : now check which varargs header should be included
14726 if `./varargs I_STDARG`; then
14728 elif `./varargs I_VARARGS`; then
14733 if `./varargs I_VARARGS`; then
14740 echo "I could not find the definition for va_dcl... You have problems..." >&4
14741 val="$undef"; set i_stdarg; eval $setvar
14742 val="$undef"; set i_varargs; eval $setvar
14747 case "$i_varhdr" in
14749 val="$define"; set i_stdarg; eval $setvar
14750 val="$undef"; set i_varargs; eval $setvar
14753 val="$undef"; set i_stdarg; eval $setvar
14754 val="$define"; set i_varargs; eval $setvar
14757 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
14761 : see if we need va_copy
14763 case "$i_stdarg" in
14766 #include <stdarg.h>
14768 #$i_stdlib I_STDLIB
14770 #include <stdlib.h>
14772 #include <signal.h>
14775 ivfprintf(FILE *f, const char *fmt, va_list *valp)
14777 return vfprintf(f, fmt, *valp);
14781 myvfprintf(FILE *f, const char *fmt, va_list val)
14783 return ivfprintf(f, fmt, &val);
14787 myprintf(char *fmt, ...)
14790 va_start(val, fmt);
14791 return myvfprintf(stdout, fmt, val);
14795 main(int ac, char **av)
14797 signal(SIGSEGV, exit);
14799 myprintf("%s%cs all right, then\n", "that", '\'');
14804 if eval $compile && $run ./try 2>&1 >/dev/null; then
14805 case "`$run ./try`" in
14806 "that's all right, then")
14812 yes) echo "It seems that you don't need va_copy()." >&4
14813 need_va_copy="$undef"
14815 *) echo "It seems that va_copy() or similar will be needed." >&4
14816 need_va_copy="$define"
14819 $rm -f try.* core core.* *.core *.core.*
14821 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
14825 : define a fucntion to check prototypes
14826 $cat > protochk <<EOSH
14829 optimize="$optimize"
14831 prototype="$prototype"
14836 $cat >> protochk <<'EOSH'
14841 while test $# -ge 2; do
14843 $define) echo "#include <$2>" >> try.c ;;
14844 literal) echo "$2" >> try.c ;;
14848 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
14849 cat >> try.c <<'EOCP'
14850 #ifdef CAN_PROTOTYPE
14851 #define _(args) args
14856 echo "$foo" >> try.c
14857 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
14858 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
14864 $eunicefix protochk
14866 : see what type is used for size_t
14867 rp="What is the type used for the length parameter for string functions?"
14868 set size_t sizetype 'unsigned int' stdio.h sys/types.h
14871 : check for type of arguments to gethostbyaddr.
14872 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
14873 case "$d_gethbyaddr" in
14877 Checking to see what type of arguments are accepted by gethostbyaddr().
14879 hdrs="$define sys/types.h
14880 $d_socket sys/socket.h
14881 $i_niin netinet/in.h
14883 $i_unistd unistd.h"
14884 : The first arg can 'char *' or 'void *'
14885 : The second arg is some of integral type
14886 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
14887 for yyy in size_t long int; do
14888 case "$netdb_host_type" in
14889 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
14890 if ./protochk "$try" $hdrs; then
14891 echo "Your system accepts $xxx for the first arg."
14892 echo "...and $yyy for the second arg."
14893 netdb_host_type="$xxx"
14894 netdb_hlen_type="$yyy"
14900 : In case none of those worked, prompt the user.
14901 case "$netdb_host_type" in
14902 '') rp='What is the type for the 1st argument to gethostbyaddr?'
14905 netdb_host_type=$ans
14906 rp='What is the type for the 2nd argument to gethostbyaddr?'
14909 netdb_hlen_type=$ans
14913 *) : no gethostbyaddr, so pick harmless defaults
14914 netdb_host_type='char *'
14915 netdb_hlen_type="$sizetype"
14918 # Remove the "const" if needed. -- but then we'll have a
14920 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
14923 : check for type of argument to gethostbyname.
14924 if test "X$netdb_name_type" = X ; then
14925 case "$d_gethbyname" in
14929 Checking to see what type of argument is accepted by gethostbyname().
14931 hdrs="$define sys/types.h
14932 $d_socket sys/socket.h
14933 $i_niin netinet/in.h
14935 $i_unistd unistd.h"
14936 for xxx in "const char *" "char *"; do
14937 case "$netdb_name_type" in
14938 '') try="extern struct hostent *gethostbyname($xxx);"
14939 if ./protochk "$try" $hdrs; then
14940 echo "Your system accepts $xxx."
14941 netdb_name_type="$xxx"
14946 : In case none of those worked, prompt the user.
14947 case "$netdb_name_type" in
14948 '') rp='What is the type for the 1st argument to gethostbyname?'
14951 netdb_name_type=$ans
14955 *) : no gethostbyname, so pick harmless default
14956 netdb_name_type='char *'
14961 : check for type of 1st argument to getnetbyaddr.
14962 if test "X$netdb_net_type" = X ; then
14963 case "$d_getnbyaddr" in
14967 Checking to see what type of 1st argument is accepted by getnetbyaddr().
14969 hdrs="$define sys/types.h
14970 $d_socket sys/socket.h
14971 $i_niin netinet/in.h
14973 $i_unistd unistd.h"
14974 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
14975 case "$netdb_net_type" in
14976 '') try="extern struct netent *getnetbyaddr($xxx, int);"
14977 if ./protochk "$try" $hdrs; then
14978 echo "Your system accepts $xxx."
14979 netdb_net_type="$xxx"
14984 : In case none of those worked, prompt the user.
14985 case "$netdb_net_type" in
14986 '') rp='What is the type for the 1st argument to getnetbyaddr?'
14989 netdb_net_type=$ans
14993 *) : no getnetbyaddr, so pick harmless default
14994 netdb_net_type='long'
14998 : locate the preferred pager for this system
15004 [a-zA-Z]:/*) dflt=$pg;;
15008 [a-zA-Z]:/*) dflt=$more;;
15012 [a-zA-Z]:/*) dflt=$less;;
15015 '') dflt=/usr/ucb/more;;
15022 rp='What pager is used on your system?'
15026 : see what type pids are declared as in the kernel
15027 rp="What is the type of process ids on this system?"
15028 set pid_t pidtype int stdio.h sys/types.h
15031 : Find earliest binary compatible site_perl subdirectory perl can use.
15032 case "$bincompat5005" in
15033 "$define") xs_apiversion='5.005' ;;
15034 *) xs_apiversion=$version ;; # The current site_perl version.
15036 : Find earliest pure perl site_perl subdirectory perl can use.
15037 : The versioned directories started at 5.005.
15038 pm_apiversion='5.005'
15040 : see if ar generates random libraries by itself
15042 echo "Checking how to generate random libraries on your machine..." >&4
15043 echo 'int bar1() { return bar2(); }' > bar1.c
15044 echo 'int bar2() { return 2; }' > bar2.c
15045 $cat > foo.c <<'EOP'
15046 int main() { printf("%d\n", bar1()); exit(0); }
15048 $cc $ccflags -c bar1.c >/dev/null 2>&1
15049 $cc $ccflags -c bar2.c >/dev/null 2>&1
15050 $cc $ccflags -c foo.c >/dev/null 2>&1
15051 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
15052 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
15053 $run ./foobar >/dev/null 2>&1; then
15054 echo "$ar appears to generate random libraries itself."
15057 elif $ar ts bar$_a >/dev/null 2>&1 &&
15058 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
15059 $run ./foobar >/dev/null 2>&1; then
15060 echo "a table of contents needs to be added with '$ar ts'."
15067 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
15068 $test -f $ranlib || ranlib=''
15071 if $test -n "$ranlib"; then
15072 echo "your system has '$ranlib'; we'll use that."
15075 echo "your system doesn't seem to support random libraries"
15076 echo "so we'll use lorder and tsort to order the libraries."
15083 : check for type of arguments to select.
15084 case "$selecttype" in
15085 '') case "$d_select" in
15089 Checking to see what type of arguments are accepted by select().
15091 hdrs="$define sys/types.h
15092 $i_systime sys/time.h
15093 $i_sysselct sys/select.h
15094 $d_socket sys/socket.h"
15095 : The first arg can be int, unsigned, or size_t
15096 : The last arg may or may not be 'const'
15098 : void pointer has been seen but using that
15099 : breaks the selectminbits test
15100 for xxx in 'fd_set *' 'int *'; do
15101 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
15102 for tmo in 'struct timeval *' 'const struct timeval *'; do
15104 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
15105 if ./protochk "$try" $hdrs; then
15106 echo "Your system accepts $xxx."
15115 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
15116 case "$d_fd_set" in
15117 $define) dflt="fd_set *" ;;
15126 *) : no select, so pick a harmless default
15133 : check for the select 'width'
15134 case "$selectminbits" in
15135 '') case "$d_select" in
15139 Checking to see on how many bits at a time your select() operates...
15142 #include <sys/types.h>
15144 #$i_systime I_SYS_TIME
15145 #$i_systimek I_SYS_TIME_KERNEL
15150 # ifdef I_SYS_TIME_KERNEL
15153 # include <sys/time.h>
15154 # ifdef I_SYS_TIME_KERNEL
15158 #$i_sysselct I_SYS_SELECT
15159 #ifdef I_SYS_SELECT
15160 #include <sys/select.h>
15162 #$d_socket HAS_SOCKET
15164 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
15168 #define S sizeof(*(b))
15170 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
15171 #define NBITS (NBYTES * 8)
15180 fp = fopen("try.c", "r");
15186 b = ($selecttype)s;
15187 for (i = 0; i < NBITS; i++)
15191 select(fd + 1, b, 0, 0, &t);
15192 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
15193 printf("%d\n", i + 1);
15198 if eval $compile_ok; then
15199 selectminbits=`$run ./try`
15200 case "$selectminbits" in
15202 Cannot figure out on how many bits at a time your select() operates.
15203 I'll play safe and guess it is 32 bits.
15209 *) bits="$selectminbits bits" ;;
15211 echo "Your select() operates on $bits at a time." >&4
15213 rp='What is the minimum number of bits your select() operates on?'
15214 case "$byteorder" in
15215 1234|12345678) dflt=32 ;;
15220 selectminbits="$val"
15224 *) : no select, so pick a harmless default
15231 : Trace out the files included by signal.h, then look for SIGxxx names.
15232 : Remove SIGARRAYSIZE used by HPUX.
15233 : Remove SIGSTKSIZE used by Linux.
15234 : Remove SIGSTKSZ used by Posix.
15235 : Remove SIGTYP void lines used by OS2.
15236 : Some cpps, like os390, dont give the file name anywhere
15237 if [ "X$fieldn" = X ]; then
15238 : Just make some guesses. We check them later.
15239 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
15241 xxx=`echo '#include <signal.h>' |
15242 $cppstdin $cppminus $cppflags 2>/dev/null |
15243 $grep '^[ ]*#.*include' |
15244 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
15246 : Check this list of files to be sure we have parsed the cpp output ok.
15247 : This will also avoid potentially non-existent files, such
15250 for xx in $xxx /dev/null ; do
15251 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
15253 : If we have found no files, at least try signal.h
15254 case "$xxxfiles" in
15255 '') xxxfiles=`./findhdr signal.h` ;;
15258 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
15259 print substr($2, 4, 20)
15261 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
15262 print substr($3, 4, 20)
15264 : Append some common names just in case the awk scan failed.
15265 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
15266 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
15267 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
15268 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
15269 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
15271 : generate a few handy files for later
15272 $cat > signal.c <<'EOCP'
15273 #include <sys/types.h>
15274 #include <signal.h>
15278 /* Strange style to avoid deeply-nested #if/#else/#endif */
15281 # define NSIG (_NSIG)
15287 # define NSIG (SIGMAX+1)
15293 # define NSIG (SIG_MAX+1)
15299 # define NSIG (MAXSIG+1)
15305 # define NSIG (MAX_SIG+1)
15310 # ifdef SIGARRAYSIZE
15311 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
15317 # define NSIG (_sys_nsig) /* Solaris 2.5 */
15321 /* Default to some arbitrary number that's big enough to get most
15322 of the common signals.
15328 printf("NSIG %d\n", NSIG);
15334 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
15336 printf "#ifdef SIG"; printf $1; printf "\n"
15337 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
15338 printf $1; printf ");\n"
15342 printf "#endif /* JUST_NSIG */\n";
15343 printf "exit(0);\n}\n";
15346 $cat >signal.awk <<'EOP'
15347 BEGIN { ndups = 0 }
15348 $1 ~ /^NSIG$/ { nsig = $2 }
15349 ($1 !~ /^NSIG$/) && (NF == 2) {
15350 if ($2 > maxsig) { maxsig = $2 }
15351 if (sig_name[$2]) {
15352 dup_name[ndups] = $1
15353 dup_num[ndups] = $2
15365 printf("NSIG %d\n", nsig);
15366 for (n = 1; n < nsig; n++) {
15368 printf("%s %d\n", sig_name[n], sig_num[n])
15371 printf("NUM%d %d\n", n, n)
15374 for (n = 0; n < ndups; n++) {
15375 printf("%s %d\n", dup_name[n], dup_num[n])
15379 $cat >signal_cmd <<EOS
15381 if $test -s signal.lst; then
15382 echo "Using your existing signal.lst file"
15387 $cat >>signal_cmd <<'EOS'
15390 if eval $compile_ok; then
15391 $run ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
15393 echo "(I can't seem be able to compile the whole test program)" >&4
15394 echo "(I'll try it in little pieces.)" >&4
15395 set signal -DJUST_NSIG
15396 if eval $compile_ok; then
15397 $run ./signal$_exe > signal.nsg
15400 echo "I can't seem to figure out how many signals you have." >&4
15401 echo "Guessing 50." >&4
15402 echo 'NSIG 50' > signal.nsg
15404 : Now look at all the signal names, one at a time.
15405 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
15406 $cat > signal.c <<EOCP
15407 #include <sys/types.h>
15408 #include <signal.h>
15411 printf("$xx %d\n", SIG${xx});
15416 if eval $compile; then
15417 echo "SIG${xx} found."
15418 $run ./signal$_exe >> signal.ls1
15420 echo "SIG${xx} NOT found."
15423 if $test -s signal.ls1; then
15424 $cat signal.nsg signal.ls1 |
15425 $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
15429 if $test -s signal.lst; then
15432 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
15433 echo 'kill -l' >signal
15434 set X `csh -f <signal`
15438 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
15440 echo $@ | $tr ' ' $trnl | \
15441 $awk '{ printf "%s %d\n", $1, ++s; }
15442 END { printf "NSIG %d\n", ++s }' >signal.lst
15444 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
15446 chmod a+x signal_cmd
15447 $eunicefix signal_cmd
15449 : generate list of signal names
15451 case "$sig_name_init" in
15453 *) case "$sig_num_init" in
15454 ''|*,*) doinit=yes ;;
15459 echo "Generating a list of signal names and numbers..." >&4
15461 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
15462 sig_name=`$awk 'BEGIN { printf "ZERO " }
15463 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
15464 sig_num=`$awk 'BEGIN { printf "0 " }
15465 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
15466 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
15467 !/^NSIG/ { printf "\"%s\", ", $1 }
15468 END { printf "0\n" }' signal.lst`
15469 sig_num_init=`$awk 'BEGIN { printf "0, " }
15470 !/^NSIG/ { printf "%d, ", $2}
15471 END { printf "0\n"}' signal.lst`
15474 echo "The following $sig_count signals are available:"
15476 echo $sig_name | $awk \
15477 'BEGIN { linelen = 0 }
15479 for (i = 1; i <= NF; i++) {
15480 name = "SIG" $i " "
15481 linelen = linelen + length(name)
15482 if (linelen > 70) {
15484 linelen = length(name)
15490 sig_size=`echo $sig_name | awk '{print NF}'`
15491 $rm -f signal signal.c signal.awk signal.lst signal_cmd
15494 case "$sizetype" in
15495 *_t) zzz="$sizetype" ;;
15496 *) zzz="filesize" ;;
15498 echo "Checking the size of $zzz..." >&4
15500 #include <sys/types.h>
15503 printf("%d\n", (int)sizeof($sizetype));
15508 if eval $compile_ok; then
15512 echo "(I can't execute the test program--guessing $sizesize.)" >&4
15515 echo "Your $zzz size is $sizesize bytes."
15520 echo "(I can't compile the test program--guessing $sizesize.)" >&4
15524 : check for socklen_t
15526 echo "Checking to see if you have socklen_t..." >&4
15528 #include <sys/types.h>
15529 #$d_socket HAS_SOCKET
15531 #include <sys/socket.h>
15533 int main() { socklen_t x = 16; }
15536 if eval $compile; then
15538 echo "You have socklen_t."
15541 echo "You do not have socklen_t."
15542 case "$sizetype" in
15543 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
15550 : see if this is a socks.h system
15551 set socks.h i_socks
15554 : check for type of the size argument to socket calls
15555 case "$d_socket" in
15559 Checking to see what type is the last argument of accept().
15562 case "$d_socklen_t" in
15563 "$define") yyy="$yyy socklen_t"
15565 yyy="$yyy $sizetype int long unsigned"
15566 for xxx in $yyy; do
15567 case "$socksizetype" in
15568 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
15569 case "$usesocks" in
15571 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
15572 echo "Your system accepts '$xxx *' for the last argument of accept()."
15573 socksizetype="$xxx"
15576 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
15577 echo "Your system accepts '$xxx *' for the last argument of accept()."
15578 socksizetype="$xxx"
15585 : In case none of those worked, prompt the user.
15586 case "$socksizetype" in
15587 '') rp='What is the type for socket address structure sizes?'
15594 *) : no sockets, so pick relatively harmless default
15599 : see what type is used for signed size_t
15600 set ssize_t ssizetype int stdio.h sys/types.h
15605 #include <sys/types.h>
15606 #define Size_t $sizetype
15607 #define SSize_t $dflt
15610 if (sizeof(Size_t) == sizeof(SSize_t))
15612 else if (sizeof(Size_t) == sizeof(int))
15621 if eval $compile_ok && $run ./try > /dev/null; then
15622 ssizetype=`$run ./try`
15623 echo "I'll be using $ssizetype for functions returning a byte count." >&4
15626 Help! I can't compile and run the ssize_t test program: please enlighten me!
15627 (This is probably a misconfiguration in your system or libraries, and
15628 you really ought to fix it. Still, I'll try anyway.)
15630 I need a type that is the same size as $sizetype, but is guaranteed to
15631 be signed. Common values are ssize_t, int and long.
15634 rp="What signed type is the same size as $sizetype?"
15640 : see what type of char stdio uses.
15642 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
15643 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
15644 echo "Your stdio uses unsigned chars." >&4
15645 stdchar="unsigned char"
15647 echo "Your stdio uses signed chars." >&4
15654 : see if time exists
15656 if test "X$d_time" = X -o X"$timetype" = X; then
15657 if set time val -f d_time; eval $csym; $val; then
15658 echo 'time() found.' >&4
15660 rp="What is the type returned by time() on this system?"
15661 set time_t timetype long stdio.h sys/types.h
15664 echo 'time() not found, hope that will do.' >&4
15672 : see what type uids are declared as in the kernel
15674 echo "Looking for the type for user ids returned by getuid()."
15675 set uid_t uidtype xxx stdio.h sys/types.h
15679 xxx=`./findhdr sys/user.h`
15680 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
15682 unsigned) dflt="$1 $2" ;;
15686 *) dflt="$uidtype";;
15689 uid_t) echo "uid_t found." ;;
15690 *) rp="What is the type for user ids returned by getuid()?"
15698 *_t) zzz="$uidtype" ;;
15701 echo "Checking the size of $zzz..." >&4
15703 #include <sys/types.h>
15706 printf("%d\n", (int)sizeof($uidtype));
15711 if eval $compile_ok; then
15715 echo "(I can't execute the test program--guessing $uidsize.)" >&4
15718 echo "Your $zzz is $uidsize bytes long."
15723 echo "(I can't compile the test program--guessing $uidsize.)" >&4
15728 *_t) zzz="$uidtype" ;;
15731 echo "Checking the sign of $zzz..." >&4
15733 #include <sys/types.h>
15744 if eval $compile; then
15748 echo "(I can't execute the test program--guessing unsigned.)" >&4
15752 1) echo "Your $zzz is unsigned." ;;
15753 -1) echo "Your $zzz is signed." ;;
15759 echo "(I can't compile the test program--guessing unsigned.)" >&4
15765 $echo "Checking the format string to be used for uids..." >&4
15768 -1) if $test X"$uidsize" = X"$ivsize"; then
15769 uidformat="$ivdformat"
15771 if $test X"$uidsize" = X"$longsize"; then
15774 if $test X"$uidsize" = X"$intsize"; then
15777 if $test X"$uidsize" = X"$shortsize"; then
15784 *) if $test X"$uidsize" = X"$uvsize"; then
15785 uidformat="$uvuformat"
15787 if $test X"$uidsize" = X"$longsize"; then
15790 if $test X"$uidsize" = X"$intsize"; then
15793 if $test X"$uidsize" = X"$shortsize"; then
15802 : determine compiler compiler
15811 if $test -f "$byacc"; then
15813 comp="byacc or $comp"
15815 if $test -f "$bison"; then
15816 comp="$comp or bison -y"
15818 rp="Which compiler compiler ($comp) shall I use?"
15827 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
15833 : see if fcntl.h is there
15838 : see if we can include fcntl.h
15844 echo "We'll be including <fcntl.h>." >&4
15847 if $h_sysfile; then
15848 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
15850 echo "We won't be including <fcntl.h>." >&4
15862 : see if this is a fp.h system
15866 : see if this is a fp_class.h system
15867 set fp_class.h i_fp_class
15870 : see if this is a ieeefp.h system
15871 set ieeefp.h i_ieeefp
15874 : see if this is a libutil.h system
15875 set libutil.h i_libutil
15878 : see if locale.h is available
15879 set locale.h i_locale
15882 : see if mach cthreads are available
15883 if test "X$usethreads" = "X$define"; then
15884 set mach/cthreads.h i_machcthr
15887 i_machcthr="$undef"
15892 : see if this is a math.h system
15896 : see if this is a mntent.h system
15897 set mntent.h i_mntent
15900 : see if ndbm.h is available
15905 : see if dbm_open exists
15906 set dbm_open d_dbm_open
15908 case "$d_dbm_open" in
15911 echo "We won't be including <ndbm.h>"
15920 : see if net/errno.h is available
15922 set net/errno.h val
15925 : Unfortunately, it causes problems on some systems. Arrgh.
15928 cat > try.c <<'EOM'
15931 #include <net/errno.h>
15937 if $cc $ccflags -c try.c >/dev/null 2>&1; then
15938 echo "We'll be including <net/errno.h>." >&4
15940 echo "We won't be including <net/errno.h>." >&4
15949 : see if netinet/tcp.h is available
15950 set netinet/tcp.h i_netinettcp
15953 : see if this is a poll.h system
15957 : see if this is a prot.h system
15962 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
15963 $cat <<'EOSH' > Cppsym.know
15964 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
15965 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
15966 alliant alpha am29000 AM29000 AMD64 amiga AMIGAOS AMIX
15967 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
15968 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
15969 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
15970 bull c cadmus clipper CMU COFF COMPILER_VERSION
15971 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
15972 CYGWIN DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
15973 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
15974 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
15976 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
15977 H3050R H3050RX hbullx20 hcx host_mips
15978 hp200 hp300 hp700 HP700 hp800 hp9000
15979 hp9000s200 hp9000s300 hp9000s400 hp9000s500
15980 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
15981 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
15982 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
15983 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
15984 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
15985 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
15986 Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
15987 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
15988 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
15989 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
15990 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
15991 MATH_HAS_NO_SIDE_EFFECTS
15992 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
15993 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
15994 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
15995 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
15996 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
15997 NetBSD news1500 news1700 news1800 news1900 news3700
15998 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
15999 ns32016 ns32332 ns32k nsc32000
16000 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
16001 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
16002 pc532 pdp11 PGC PIC plexus PORTAR posix
16003 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
16004 POSIX_C_SOURCE POSIX_SOURCE POWER
16005 PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
16006 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
16007 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
16008 sony sony_news sonyrisc sparc sparclite spectrum
16009 stardent stdc STDC_EXT stratos sun sun3 sun386
16010 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
16011 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
16012 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
16013 sysV68 sysV88 Tek4132 Tek4300 titan
16014 TM3200 TM5400 TM5600
16015 tower tower32 tower32_200 tower32_600 tower32_700
16016 tower32_800 tower32_850 tss
16017 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
16018 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
16019 unix UNIX95 UNIX99 unixpc unos
16020 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
16021 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
16022 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
16024 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms xenix Xenix286
16025 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
16026 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
16029 # Maybe put other stuff here too.
16030 cat <<EOSH >>Cppsym.know
16033 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
16034 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
16035 $cat Cppsym.know > Cppsym.c
16036 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
16037 $rm -f Cppsym.a Cppsym.b Cppsym.c
16038 cat <<EOSH > Cppsym
16040 if $test \$# -gt 0; then
16041 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
16042 if $test -s Cppsym.got; then
16049 $tr " " "$trnl" | ./Cppsym.try
16055 cat <<EOSH > Cppsym.try
16057 cat <<'EOCP' > try.c
16063 cat <<'EOSH' >> Cppsym.try
16065 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
16066 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
16067 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
16068 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
16070 echo 'return 0;}' >> try.c
16072 cat <<EOSH >> Cppsym.try
16074 case "$osname-$gccversion" in
16075 irix-) ccflags="\$ccflags -woff 1178" ;;
16076 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
16078 $cc -o try $optimize \$ccflags $ldflags try.c $libs && $run ./try
16080 chmod +x Cppsym.try
16081 $eunicefix Cppsym.try
16082 ./Cppsym < Cppsym.know > Cppsym.true
16083 : now check the C compiler for additional symbols
16084 postprocess_cc_v=''
16086 aix) postprocess_cc_v="|$tr , ' '" ;;
16093 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
16096 -D*) echo "\$i" | $sed 's/^-D//';;
16097 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
16102 postprocess_cc_v=''
16105 ./ccsym > ccsym1.raw
16106 if $test -s ccsym1.raw; then
16107 $sort ccsym1.raw | $uniq >ccsym.raw
16109 mv ccsym1.raw ccsym.raw
16112 $awk '/\=/ { print $0; next }
16113 { print $0"=1" }' ccsym.raw >ccsym.list
16114 $awk '/\=/ { print $0; next }
16115 { print $0"=1" }' Cppsym.true >ccsym.true
16116 $comm -13 ccsym.true ccsym.list >ccsym.own
16117 $comm -12 ccsym.true ccsym.list >ccsym.com
16118 $comm -23 ccsym.true ccsym.list >ccsym.cpp
16120 if $test -z ccsym.raw; then
16121 echo "Your C compiler doesn't seem to define any symbols!" >&4
16123 echo "However, your C preprocessor defines the following symbols:"
16126 cppsymbols=`$cat Cppsym.true`
16127 cppsymbols=`echo $cppsymbols`
16128 cppccsymbols="$cppsymbols"
16130 if $test -s ccsym.com; then
16131 echo "Your C compiler and pre-processor define these symbols:"
16132 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
16135 cppccsymbols=`$cat ccsym.com`
16136 cppccsymbols=`echo $cppccsymbols`
16137 $test "$silent" || sleep 1
16139 if $test -s ccsym.cpp; then
16140 $test "$also" && echo " "
16141 echo "Your C pre-processor ${also}defines the following symbols:"
16142 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
16144 cppsymbols=`$cat ccsym.cpp`
16145 cppsymbols=`echo $cppsymbols`
16146 $test "$silent" || sleep 1
16148 if $test -s ccsym.own; then
16149 $test "$also" && echo " "
16150 echo "Your C compiler ${also}defines the following cpp symbols:"
16151 $sed -e 's/\(..*\)=1/\1/' ccsym.own
16152 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
16153 ccsymbols=`$cat ccsym.own`
16154 ccsymbols=`echo $ccsymbols`
16155 $test "$silent" || sleep 1
16159 : see if this is a termio system
16163 if $test `./findhdr termios.h`; then
16164 set tcsetattr i_termios
16170 "$define") echo "You have POSIX termios.h... good!" >&4;;
16171 *) if ./Cppsym pyr; then
16172 case "`/bin/universe`" in
16173 ucb) if $test `./findhdr sgtty.h`; then
16175 echo "<sgtty.h> found." >&4
16177 echo "System is pyramid with BSD universe."
16178 echo "<sgtty.h> not found--you could have problems." >&4
16180 *) if $test `./findhdr termio.h`; then
16182 echo "<termio.h> found." >&4
16184 echo "System is pyramid with USG universe."
16185 echo "<termio.h> not found--you could have problems." >&4
16189 if $test `./findhdr termio.h`; then
16190 echo "<termio.h> found." >&4
16192 elif $test `./findhdr sgtty.h`; then
16193 echo "<sgtty.h> found." >&4
16196 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
16199 if $test `./findhdr sgtty.h`; then
16200 echo "<sgtty.h> found." >&4
16202 elif $test `./findhdr termio.h`; then
16203 echo "<termio.h> found." >&4
16206 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
16210 set i_termio; eval $setvar
16211 val=$val2; set i_sgtty; eval $setvar
16212 val=$val3; set i_termios; eval $setvar
16214 : see if this is a shadow.h system
16215 set shadow.h i_shadow
16218 : see if stddef is available
16219 set stddef.h i_stddef
16222 : see if this is a sunmath.h system
16223 set sunmath.h i_sunmath
16226 : see if sys/access.h is available
16227 set sys/access.h i_sysaccess
16230 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
16231 set sys/filio.h i_sysfilio
16234 if $test `./findhdr sys/ioctl.h`; then
16236 echo '<sys/ioctl.h> found.' >&4
16239 if $test $i_sysfilio = "$define"; then
16240 echo '<sys/ioctl.h> NOT found.' >&4
16242 $test $i_sgtty = "$define" && xxx="sgtty.h"
16243 $test $i_termio = "$define" && xxx="termio.h"
16244 $test $i_termios = "$define" && xxx="termios.h"
16245 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
16251 : see if socket ioctl defs are in sys/sockio.h
16253 xxx=`./findhdr sys/sockio.h`
16254 if $test "$xxx"; then
16255 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
16257 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
16260 echo "No socket ioctls found in <sys/sockio.h>." >&4
16265 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
16272 : see if this is a syslog.h system
16273 set syslog.h i_syslog
16277 : see if this is a sys/mode.h system
16278 set sys/mode.h i_sysmode
16281 : see if sys/resource.h has to be included
16282 set sys/resource.h i_sysresrc
16285 : see if sys/security.h is available
16286 set sys/security.h i_syssecrt
16289 : see if this is a sys/statvfs.h system
16290 set sys/statvfs.h i_sysstatvfs
16293 : see if this is a sys/un.h system
16294 set sys/un.h i_sysun
16298 : see if this is a sys/utsname.h system
16299 set sys/utsname.h i_sysutsname
16302 : see if this is a syswait system
16303 set sys/wait.h i_syswait
16306 : see if this is a ustat.h system
16307 set ustat.h i_ustat
16310 : see if this is an utime system
16311 set utime.h i_utime
16314 : see if this is a values.h system
16315 set values.h i_values
16318 : see if this is a vfork system
16321 set vfork.h i_vfork
16329 : see if gdbm.h is available
16334 : see if gdbm_open exists
16335 set gdbm_open d_gdbm_open
16337 case "$d_gdbm_open" in
16340 echo "We won't be including <gdbm.h>"
16350 echo "Looking for extensions..." >&4
16351 : If we are using the old config.sh, known_extensions may contain
16352 : old or inaccurate or duplicate values.
16353 known_extensions=''
16354 nonxs_extensions=''
16355 : We do not use find because it might not be available.
16356 : We do not just use MANIFEST because the user may have dropped
16357 : some additional extensions into the source tree and expect them
16360 : Function to recursively find available extensions, ignoring DynaLoader
16361 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
16365 DynaLoader|dynaload) ;;
16367 if $test -f $xxx/$xxx.xs; then
16368 known_extensions="$known_extensions $1$xxx";
16369 elif $test -f $xxx/Makefile.PL; then
16370 nonxs_extensions="$nonxs_extensions $1$xxx";
16372 if $test -d $xxx -a $# -lt 10; then
16375 eval $find_extensions;
16387 eval $find_extensions
16388 # Special case: Add in threads/shared since it is not picked up by the
16389 # recursive find above (and adding in general recursive finding breaks
16390 # SDBM_File/sdbm). A.D. 10/25/2001.
16391 known_extensions="$known_extensions threads/shared"
16392 set X $nonxs_extensions
16394 nonxs_extensions="$*"
16395 set X $known_extensions
16397 known_extensions="$*"
16400 : Now see which are supported on this system.
16402 for xxx in $known_extensions ; do
16406 $define) avail_ext="$avail_ext $xxx" ;;
16409 GDBM_File|gdbm_fil)
16411 $define) avail_ext="$avail_ext $xxx" ;;
16414 I18N/Langinfo|i18n_lan)
16415 case "$i_langinfo$d_nl_langinfo" in
16416 $define$define) avail_ext="$avail_ext $xxx" ;;
16419 NDBM_File|ndbm_fil)
16422 case "$osname-$use64bitint" in
16423 cygwin-*|hpux-define)
16425 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
16428 *) avail_ext="$avail_ext $xxx" ;;
16433 ODBM_File|odbm_fil)
16434 case "${i_dbm}${i_rpcsvcdbm}" in
16436 case "$osname-$use64bitint" in
16437 cygwin-*|hpux-define)
16439 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
16442 *) avail_ext="$avail_ext $xxx" ;;
16448 case "$useposix" in
16449 true|define|y) avail_ext="$avail_ext $xxx" ;;
16453 case "$useopcode" in
16454 true|define|y) avail_ext="$avail_ext $xxx" ;;
16458 case "$d_socket" in
16459 true|$define|y) avail_ext="$avail_ext $xxx" ;;
16462 Sys/Syslog|sys/syslog)
16463 : XXX syslog requires socket
16464 case "$d_socket" in
16465 true|$define|y) avail_ext="$avail_ext $xxx" ;;
16469 case "$usethreads" in
16471 case "$useithreads" in
16472 $undef|false|[nN]*) avail_ext="$avail_ext $xxx" ;;
16476 threads|threads/shared)
16477 case "$usethreads" in
16479 case "$useithreads" in
16480 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
16485 : XXX Do we need a useipcsysv variable here
16486 case "${d_msg}${d_sem}${d_shm}" in
16487 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
16490 *) avail_ext="$avail_ext $xxx"
16499 : Now see which nonxs extensions are supported on this system.
16500 : For now assume all are.
16502 for xxx in $nonxs_extensions ; do
16504 *) nonxs_ext="$nonxs_ext $xxx"
16516 A number of extensions are supplied with $package. You may choose to
16517 compile these extensions for dynamic loading (the default), compile
16518 them into the $package executable (static loading), or not include
16519 them at all. Answer "none" to include no extensions.
16520 Note that DynaLoader is always built and need not be mentioned here.
16523 case "$dynamic_ext" in
16524 '') dflt="$avail_ext" ;;
16525 *) dflt="$dynamic_ext"
16526 # Perhaps we are reusing an old out-of-date config.sh.
16529 if test X"$dynamic_ext" != X"$avail_ext"; then
16531 NOTICE: Your previous config.sh list may be incorrect.
16532 The extensions now available to you are
16534 but the default list from your previous config.sh is
16546 rp="What extensions do you wish to load dynamically?"
16549 none) dynamic_ext=' ' ;;
16550 *) dynamic_ext="$ans" ;;
16553 case "$static_ext" in
16555 : Exclude those already listed in dynamic linking
16557 for xxx in $avail_ext; do
16558 case " $dynamic_ext " in
16560 *) dflt="$dflt $xxx" ;;
16567 *) dflt="$static_ext"
16574 rp="What extensions do you wish to load statically?"
16577 none) static_ext=' ' ;;
16578 *) static_ext="$ans" ;;
16583 A number of extensions are supplied with $package. Answer "none"
16584 to include no extensions.
16585 Note that DynaLoader is always built and need not be mentioned here.
16588 case "$static_ext" in
16589 '') dflt="$avail_ext" ;;
16590 *) dflt="$static_ext"
16591 # Perhaps we are reusing an old out-of-date config.sh.
16594 if test X"$static_ext" != X"$avail_ext"; then
16596 NOTICE: Your previous config.sh list may be incorrect.
16597 The extensions now available to you are
16599 but the default list from your previous config.sh is
16608 : Exclude those that are not xs extensions
16612 rp="What extensions do you wish to include?"
16615 none) static_ext=' ' ;;
16616 *) static_ext="$ans" ;;
16621 set X $dynamic_ext $static_ext $nonxs_ext
16625 : Remove libraries needed only for extensions
16626 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
16627 : The exception is SunOS 4.x, which needs them.
16628 case "${osname}X${osvers}" in
16632 *) case "$usedl" in
16633 $define|true|[yY]*)
16634 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
16638 *) perllibs="$libs"
16644 : Remove build directory name from cppstdin so it can be used from
16645 : either the present location or the final installed location.
16647 : Get out of the UU directory to get correct path name.
16649 case "$cppstdin" in
16651 echo "Stripping down cppstdin path name"
16657 : end of configuration questions
16659 echo "End of configuration questions."
16662 : back to where it started
16663 if test -d ../UU; then
16667 : configuration may be patched via a 'config.arch' file
16668 if $test -f config.arch; then
16669 echo "I see a config.arch file, loading it."
16673 : configuration may be patched via a 'config.over' file
16674 if $test -f config.over; then
16677 rp='I see a config.over file. Do you wish to load it?'
16680 n*) echo "OK, I'll ignore it.";;
16682 echo "Configuration override changes have been loaded."
16687 : in case they want portability, strip down executable paths
16688 case "$d_portable" in
16691 echo "Stripping down executable paths..." >&4
16692 for file in $loclist $trylist; do
16694 eval $file=`basename $temp`
16699 : create config.sh file
16701 echo "Creating config.sh..." >&4
16702 $spitshell <<EOT >config.sh
16705 # This file was produced by running the Configure script. It holds all the
16706 # definitions figured out by Configure. Should you modify one of these values,
16707 # do not forget to propagate your changes by running "Configure -der". You may
16708 # instead choose to run each of the .SH files by yourself, or "Configure -S".
16711 # Package name : $package
16712 # Source directory : $src
16713 # Configuration time: $cf_time
16714 # Configured by : $cf_by
16715 # Target system : $myuname
16725 Revision='$Revision'
16733 alignbytes='$alignbytes'
16734 ansi2knr='$ansi2knr'
16735 aphostname='$aphostname'
16736 api_revision='$api_revision'
16737 api_subversion='$api_subversion'
16738 api_version='$api_version'
16739 api_versionstring='$api_versionstring'
16742 archlibexp='$archlibexp'
16743 archname64='$archname64'
16744 archname='$archname'
16745 archobjs='$archobjs'
16750 bincompat5005='$bincompat5005'
16754 byteorder='$byteorder'
16756 castflags='$castflags'
16759 cccdlflags='$cccdlflags'
16760 ccdlflags='$ccdlflags'
16762 ccflags_uselargefiles='$ccflags_uselargefiles'
16764 ccsymbols='$ccsymbols'
16765 ccversion='$ccversion'
16767 cf_email='$cf_email'
16769 charsize='$charsize'
16773 clocktype='$clocktype'
16775 compress='$compress'
16776 contains='$contains'
16780 cpp_stuff='$cpp_stuff'
16781 cppccsymbols='$cppccsymbols'
16782 cppflags='$cppflags'
16784 cppminus='$cppminus'
16786 cppstdin='$cppstdin'
16787 cppsymbols='$cppsymbols'
16788 cryptlib='$cryptlib'
16790 d_Gconvert='$d_Gconvert'
16791 d_PRIEUldbl='$d_PRIEUldbl'
16792 d_PRIFUldbl='$d_PRIFUldbl'
16793 d_PRIGUldbl='$d_PRIGUldbl'
16794 d_PRIXU64='$d_PRIXU64'
16795 d_PRId64='$d_PRId64'
16796 d_PRIeldbl='$d_PRIeldbl'
16797 d_PRIfldbl='$d_PRIfldbl'
16798 d_PRIgldbl='$d_PRIgldbl'
16799 d_PRIi64='$d_PRIi64'
16800 d_PRIo64='$d_PRIo64'
16801 d_PRIu64='$d_PRIu64'
16802 d_PRIx64='$d_PRIx64'
16803 d_SCNfldbl='$d_SCNfldbl'
16804 d__fwalk='$d__fwalk'
16805 d_access='$d_access'
16806 d_accessx='$d_accessx'
16808 d_archlib='$d_archlib'
16811 d_attribut='$d_attribut'
16814 d_bincompat5005='$d_bincompat5005'
16816 d_bsdgetpgrp='$d_bsdgetpgrp'
16817 d_bsdsetpgrp='$d_bsdsetpgrp'
16819 d_casti32='$d_casti32'
16820 d_castneg='$d_castneg'
16821 d_charvspr='$d_charvspr'
16823 d_chroot='$d_chroot'
16824 d_chsize='$d_chsize'
16826 d_closedir='$d_closedir'
16827 d_cmsghdr_s='$d_cmsghdr_s'
16831 d_cuserid='$d_cuserid'
16832 d_dbl_dig='$d_dbl_dig'
16833 d_dbminitproto='$d_dbminitproto'
16834 d_difftime='$d_difftime'
16835 d_dirnamlen='$d_dirnamlen'
16836 d_dlerror='$d_dlerror'
16837 d_dlopen='$d_dlopen'
16838 d_dlsymun='$d_dlsymun'
16839 d_dosuid='$d_dosuid'
16840 d_drand48proto='$d_drand48proto'
16842 d_eaccess='$d_eaccess'
16843 d_endgrent='$d_endgrent'
16844 d_endhent='$d_endhent'
16845 d_endnent='$d_endnent'
16846 d_endpent='$d_endpent'
16847 d_endpwent='$d_endpwent'
16848 d_endsent='$d_endsent'
16849 d_eofnblk='$d_eofnblk'
16850 d_eunice='$d_eunice'
16851 d_fchdir='$d_fchdir'
16852 d_fchmod='$d_fchmod'
16853 d_fchown='$d_fchown'
16855 d_fcntl_can_lock='$d_fcntl_can_lock'
16856 d_fd_macros='$d_fd_macros'
16857 d_fd_set='$d_fd_set'
16858 d_fds_bits='$d_fds_bits'
16859 d_fgetpos='$d_fgetpos'
16860 d_finite='$d_finite'
16861 d_finitel='$d_finitel'
16862 d_flexfnam='$d_flexfnam'
16864 d_flockproto='$d_flockproto'
16866 d_fp_class='$d_fp_class'
16867 d_fpathconf='$d_fpathconf'
16868 d_fpclass='$d_fpclass'
16869 d_fpclassify='$d_fpclassify'
16870 d_fpclassl='$d_fpclassl'
16871 d_fpos64_t='$d_fpos64_t'
16872 d_frexpl='$d_frexpl'
16873 d_fs_data_s='$d_fs_data_s'
16874 d_fseeko='$d_fseeko'
16875 d_fsetpos='$d_fsetpos'
16876 d_fstatfs='$d_fstatfs'
16877 d_fstatvfs='$d_fstatvfs'
16879 d_ftello='$d_ftello'
16881 d_getcwd='$d_getcwd'
16882 d_getespwnam='$d_getespwnam'
16883 d_getfsstat='$d_getfsstat'
16884 d_getgrent='$d_getgrent'
16885 d_getgrps='$d_getgrps'
16886 d_gethbyaddr='$d_gethbyaddr'
16887 d_gethbyname='$d_gethbyname'
16888 d_gethent='$d_gethent'
16889 d_gethname='$d_gethname'
16890 d_gethostprotos='$d_gethostprotos'
16891 d_getitimer='$d_getitimer'
16892 d_getlogin='$d_getlogin'
16893 d_getmnt='$d_getmnt'
16894 d_getmntent='$d_getmntent'
16895 d_getnbyaddr='$d_getnbyaddr'
16896 d_getnbyname='$d_getnbyname'
16897 d_getnent='$d_getnent'
16898 d_getnetprotos='$d_getnetprotos'
16899 d_getpagsz='$d_getpagsz'
16900 d_getpbyname='$d_getpbyname'
16901 d_getpbynumber='$d_getpbynumber'
16902 d_getpent='$d_getpent'
16903 d_getpgid='$d_getpgid'
16904 d_getpgrp2='$d_getpgrp2'
16905 d_getpgrp='$d_getpgrp'
16906 d_getppid='$d_getppid'
16907 d_getprior='$d_getprior'
16908 d_getprotoprotos='$d_getprotoprotos'
16909 d_getprpwnam='$d_getprpwnam'
16910 d_getpwent='$d_getpwent'
16911 d_getsbyname='$d_getsbyname'
16912 d_getsbyport='$d_getsbyport'
16913 d_getsent='$d_getsent'
16914 d_getservprotos='$d_getservprotos'
16915 d_getspnam='$d_getspnam'
16916 d_gettimeod='$d_gettimeod'
16917 d_gnulibc='$d_gnulibc'
16918 d_grpasswd='$d_grpasswd'
16919 d_hasmntopt='$d_hasmntopt'
16922 d_inetaton='$d_inetaton'
16923 d_int64_t='$d_int64_t'
16924 d_isascii='$d_isascii'
16925 d_isfinite='$d_isfinite'
16928 d_isnanl='$d_isnanl'
16929 d_killpg='$d_killpg'
16930 d_lchown='$d_lchown'
16931 d_ldbl_dig='$d_ldbl_dig'
16933 d_locconv='$d_locconv'
16935 d_longdbl='$d_longdbl'
16936 d_longlong='$d_longlong'
16937 d_lseekproto='$d_lseekproto'
16939 d_madvise='$d_madvise'
16941 d_mbstowcs='$d_mbstowcs'
16942 d_mbtowc='$d_mbtowc'
16943 d_memchr='$d_memchr'
16944 d_memcmp='$d_memcmp'
16945 d_memcpy='$d_memcpy'
16946 d_memmove='$d_memmove'
16947 d_memset='$d_memset'
16949 d_mkdtemp='$d_mkdtemp'
16950 d_mkfifo='$d_mkfifo'
16951 d_mkstemp='$d_mkstemp'
16952 d_mkstemps='$d_mkstemps'
16953 d_mktime='$d_mktime'
16956 d_modfl_pow32_bug='$d_modfl_pow32_bug'
16957 d_mprotect='$d_mprotect'
16959 d_msg_ctrunc='$d_msg_ctrunc'
16960 d_msg_dontroute='$d_msg_dontroute'
16961 d_msg_oob='$d_msg_oob'
16962 d_msg_peek='$d_msg_peek'
16963 d_msg_proxy='$d_msg_proxy'
16964 d_msgctl='$d_msgctl'
16965 d_msgget='$d_msgget'
16966 d_msghdr_s='$d_msghdr_s'
16967 d_msgrcv='$d_msgrcv'
16968 d_msgsnd='$d_msgsnd'
16970 d_munmap='$d_munmap'
16971 d_mymalloc='$d_mymalloc'
16973 d_nl_langinfo='$d_nl_langinfo'
16974 d_nv_preserves_uv='$d_nv_preserves_uv'
16975 d_nv_preserves_uv_bits='$d_nv_preserves_uv_bits'
16976 d_off64_t='$d_off64_t'
16977 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
16978 d_oldpthreads='$d_oldpthreads'
16979 d_oldsock='$d_oldsock'
16981 d_pathconf='$d_pathconf'
16983 d_perl_otherlibdirs='$d_perl_otherlibdirs'
16984 d_phostname='$d_phostname'
16987 d_portable='$d_portable'
16988 d_procselfexe='$d_procselfexe'
16989 d_pthread_atfork='$d_pthread_atfork'
16990 d_pthread_yield='$d_pthread_yield'
16992 d_pwchange='$d_pwchange'
16993 d_pwclass='$d_pwclass'
16994 d_pwcomment='$d_pwcomment'
16995 d_pwexpire='$d_pwexpire'
16996 d_pwgecos='$d_pwgecos'
16997 d_pwpasswd='$d_pwpasswd'
16998 d_pwquota='$d_pwquota'
17001 d_readdir='$d_readdir'
17002 d_readlink='$d_readlink'
17004 d_recvmsg='$d_recvmsg'
17005 d_rename='$d_rename'
17006 d_rewinddir='$d_rewinddir'
17008 d_safebcpy='$d_safebcpy'
17009 d_safemcpy='$d_safemcpy'
17010 d_sanemcmp='$d_sanemcmp'
17011 d_sbrkproto='$d_sbrkproto'
17012 d_sched_yield='$d_sched_yield'
17013 d_scm_rights='$d_scm_rights'
17014 d_seekdir='$d_seekdir'
17015 d_select='$d_select'
17017 d_semctl='$d_semctl'
17018 d_semctl_semid_ds='$d_semctl_semid_ds'
17019 d_semctl_semun='$d_semctl_semun'
17020 d_semget='$d_semget'
17022 d_sendmsg='$d_sendmsg'
17023 d_setegid='$d_setegid'
17024 d_seteuid='$d_seteuid'
17025 d_setgrent='$d_setgrent'
17026 d_setgrps='$d_setgrps'
17027 d_sethent='$d_sethent'
17028 d_setitimer='$d_setitimer'
17029 d_setlinebuf='$d_setlinebuf'
17030 d_setlocale='$d_setlocale'
17031 d_setnent='$d_setnent'
17032 d_setpent='$d_setpent'
17033 d_setpgid='$d_setpgid'
17034 d_setpgrp2='$d_setpgrp2'
17035 d_setpgrp='$d_setpgrp'
17036 d_setprior='$d_setprior'
17037 d_setproctitle='$d_setproctitle'
17038 d_setpwent='$d_setpwent'
17039 d_setregid='$d_setregid'
17040 d_setresgid='$d_setresgid'
17041 d_setresuid='$d_setresuid'
17042 d_setreuid='$d_setreuid'
17043 d_setrgid='$d_setrgid'
17044 d_setruid='$d_setruid'
17045 d_setsent='$d_setsent'
17046 d_setsid='$d_setsid'
17047 d_setvbuf='$d_setvbuf'
17051 d_shmatprototype='$d_shmatprototype'
17052 d_shmctl='$d_shmctl'
17054 d_shmget='$d_shmget'
17055 d_sigaction='$d_sigaction'
17056 d_sigprocmask='$d_sigprocmask'
17057 d_sigsetjmp='$d_sigsetjmp'
17058 d_sockatmark='$d_sockatmark'
17059 d_sockatmarkproto='$d_sockatmarkproto'
17060 d_socket='$d_socket'
17061 d_socklen_t='$d_socklen_t'
17062 d_sockpair='$d_sockpair'
17063 d_socks5_init='$d_socks5_init'
17065 d_sresgproto='$d_sresgproto'
17066 d_sresuproto='$d_sresuproto'
17067 d_statblks='$d_statblks'
17068 d_statfs_f_flags='$d_statfs_f_flags'
17069 d_statfs_s='$d_statfs_s'
17070 d_statvfs='$d_statvfs'
17071 d_stdio_cnt_lval='$d_stdio_cnt_lval'
17072 d_stdio_ptr_lval='$d_stdio_ptr_lval'
17073 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
17074 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
17075 d_stdio_stream_array='$d_stdio_stream_array'
17076 d_stdiobase='$d_stdiobase'
17077 d_stdstdio='$d_stdstdio'
17078 d_strchr='$d_strchr'
17079 d_strcoll='$d_strcoll'
17080 d_strctcpy='$d_strctcpy'
17081 d_strerrm='$d_strerrm'
17082 d_strerror='$d_strerror'
17083 d_strftime='$d_strftime'
17084 d_strtod='$d_strtod'
17085 d_strtol='$d_strtol'
17086 d_strtold='$d_strtold'
17087 d_strtoll='$d_strtoll'
17088 d_strtoq='$d_strtoq'
17089 d_strtoul='$d_strtoul'
17090 d_strtoull='$d_strtoull'
17091 d_strtouq='$d_strtouq'
17092 d_strxfrm='$d_strxfrm'
17093 d_suidsafe='$d_suidsafe'
17094 d_symlink='$d_symlink'
17095 d_syscall='$d_syscall'
17096 d_syscallproto='$d_syscallproto'
17097 d_sysconf='$d_sysconf'
17098 d_sysernlst='$d_sysernlst'
17099 d_syserrlst='$d_syserrlst'
17100 d_system='$d_system'
17101 d_tcgetpgrp='$d_tcgetpgrp'
17102 d_tcsetpgrp='$d_tcsetpgrp'
17103 d_telldir='$d_telldir'
17104 d_telldirproto='$d_telldirproto'
17107 d_truncate='$d_truncate'
17108 d_tzname='$d_tzname'
17109 d_u32align='$d_u32align'
17110 d_ualarm='$d_ualarm'
17113 d_union_semun='$d_union_semun'
17114 d_unordered='$d_unordered'
17115 d_usleep='$d_usleep'
17116 d_usleepproto='$d_usleepproto'
17118 d_vendorarch='$d_vendorarch'
17119 d_vendorbin='$d_vendorbin'
17120 d_vendorlib='$d_vendorlib'
17122 d_void_closedir='$d_void_closedir'
17123 d_voidsig='$d_voidsig'
17124 d_voidtty='$d_voidtty'
17125 d_volatile='$d_volatile'
17126 d_vprintf='$d_vprintf'
17128 d_waitpid='$d_waitpid'
17129 d_wcstombs='$d_wcstombs'
17130 d_wctomb='$d_wctomb'
17131 d_writev='$d_writev'
17134 db_hashtype='$db_hashtype'
17135 db_prefixtype='$db_prefixtype'
17136 db_version_major='$db_version_major'
17137 db_version_minor='$db_version_minor'
17138 db_version_patch='$db_version_patch'
17139 defvoidused='$defvoidused'
17140 direntrytype='$direntrytype'
17143 doublesize='$doublesize'
17145 dynamic_ext='$dynamic_ext'
17151 eunicefix='$eunicefix'
17154 extensions='$extensions'
17156 fflushNULL='$fflushNULL'
17157 fflushall='$fflushall'
17159 firstmakefile='$firstmakefile'
17161 fpossize='$fpossize'
17162 fpostype='$fpostype'
17163 freetype='$freetype'
17166 full_csh='$full_csh'
17167 full_sed='$full_sed'
17168 gccosandvers='$gccosandvers'
17169 gccversion='$gccversion'
17170 gidformat='$gidformat'
17176 groupcat='$groupcat'
17177 groupstype='$groupstype'
17180 h_sysfile='$h_sysfile'
17191 i_arpainet='$i_arpainet'
17192 i_bsdioctl='$i_bsdioctl'
17195 i_dirent='$i_dirent'
17201 i_fp_class='$i_fp_class'
17204 i_ieeefp='$i_ieeefp'
17205 i_inttypes='$i_inttypes'
17206 i_langinfo='$i_langinfo'
17207 i_libutil='$i_libutil'
17208 i_limits='$i_limits'
17209 i_locale='$i_locale'
17210 i_machcthr='$i_machcthr'
17211 i_malloc='$i_malloc'
17213 i_memory='$i_memory'
17214 i_mntent='$i_mntent'
17217 i_neterrno='$i_neterrno'
17218 i_netinettcp='$i_netinettcp'
17222 i_pthread='$i_pthread'
17224 i_rpcsvcdbm='$i_rpcsvcdbm'
17227 i_shadow='$i_shadow'
17229 i_stdarg='$i_stdarg'
17230 i_stddef='$i_stddef'
17231 i_stdlib='$i_stdlib'
17232 i_string='$i_string'
17233 i_sunmath='$i_sunmath'
17234 i_sysaccess='$i_sysaccess'
17235 i_sysdir='$i_sysdir'
17236 i_sysfile='$i_sysfile'
17237 i_sysfilio='$i_sysfilio'
17239 i_sysioctl='$i_sysioctl'
17240 i_syslog='$i_syslog'
17241 i_sysmman='$i_sysmman'
17242 i_sysmode='$i_sysmode'
17243 i_sysmount='$i_sysmount'
17244 i_sysndir='$i_sysndir'
17245 i_sysparam='$i_sysparam'
17246 i_sysresrc='$i_sysresrc'
17247 i_syssecrt='$i_syssecrt'
17248 i_sysselct='$i_sysselct'
17249 i_syssockio='$i_syssockio'
17250 i_sysstat='$i_sysstat'
17251 i_sysstatfs='$i_sysstatfs'
17252 i_sysstatvfs='$i_sysstatvfs'
17253 i_systime='$i_systime'
17254 i_systimek='$i_systimek'
17255 i_systimes='$i_systimes'
17256 i_systypes='$i_systypes'
17257 i_sysuio='$i_sysuio'
17259 i_sysutsname='$i_sysutsname'
17260 i_sysvfs='$i_sysvfs'
17261 i_syswait='$i_syswait'
17262 i_termio='$i_termio'
17263 i_termios='$i_termios'
17265 i_unistd='$i_unistd'
17268 i_values='$i_values'
17269 i_varargs='$i_varargs'
17270 i_varhdr='$i_varhdr'
17272 ignore_versioned_solibs='$ignore_versioned_solibs'
17273 inc_version_list='$inc_version_list'
17274 inc_version_list_init='$inc_version_list_init'
17277 installarchlib='$installarchlib'
17278 installbin='$installbin'
17279 installman1dir='$installman1dir'
17280 installman3dir='$installman3dir'
17281 installprefix='$installprefix'
17282 installprefixexp='$installprefixexp'
17283 installprivlib='$installprivlib'
17284 installscript='$installscript'
17285 installsitearch='$installsitearch'
17286 installsitebin='$installsitebin'
17287 installsitelib='$installsitelib'
17288 installstyle='$installstyle'
17289 installusrbinperl='$installusrbinperl'
17290 installvendorarch='$installvendorarch'
17291 installvendorbin='$installvendorbin'
17292 installvendorlib='$installvendorlib'
17294 issymlink='$issymlink'
17295 ivdformat='$ivdformat'
17298 known_extensions='$known_extensions'
17301 lddlflags='$lddlflags'
17303 ldflags_uselargefiles='$ldflags_uselargefiles'
17304 ldlibpthname='$ldlibpthname'
17311 libsdirs='$libsdirs'
17312 libsfiles='$libsfiles'
17313 libsfound='$libsfound'
17314 libspath='$libspath'
17315 libswanted='$libswanted'
17316 libswanted_uselargefiles='$libswanted_uselargefiles'
17322 locincpth='$locincpth'
17323 loclibpth='$loclibpth'
17324 longdblsize='$longdblsize'
17325 longlongsize='$longlongsize'
17326 longsize='$longsize'
17330 lseeksize='$lseeksize'
17331 lseektype='$lseektype'
17335 make_set_make='$make_set_make'
17336 mallocobj='$mallocobj'
17337 mallocsrc='$mallocsrc'
17338 malloctype='$malloctype'
17340 man1direxp='$man1direxp'
17343 man3direxp='$man3direxp'
17345 mips_type='$mips_type'
17347 mmaptype='$mmaptype'
17348 modetype='$modetype'
17350 multiarch='$multiarch'
17352 myarchname='$myarchname'
17353 mydomain='$mydomain'
17354 myhostname='$myhostname'
17357 need_va_copy='$need_va_copy'
17358 netdb_hlen_type='$netdb_hlen_type'
17359 netdb_host_type='$netdb_host_type'
17360 netdb_name_type='$netdb_name_type'
17361 netdb_net_type='$netdb_net_type'
17364 nm_so_opt='$nm_so_opt'
17365 nonxs_ext='$nonxs_ext'
17367 nvEUformat='$nvEUformat'
17368 nvFUformat='$nvFUformat'
17369 nvGUformat='$nvGUformat'
17370 nveformat='$nveformat'
17371 nvfformat='$nvfformat'
17372 nvgformat='$nvgformat'
17375 o_nonblock='$o_nonblock'
17377 old_pthread_create_joinable='$old_pthread_create_joinable'
17378 optimize='$optimize'
17379 orderlib='$orderlib'
17382 otherlibdirs='$otherlibdirs'
17386 patchlevel='$patchlevel'
17387 path_sep='$path_sep'
17390 perl_patchlevel='$perl_patchlevel'
17391 perladmin='$perladmin'
17392 perllibs='$perllibs'
17393 perlpath='$perlpath'
17395 phostname='$phostname'
17398 pm_apiversion='$pm_apiversion'
17402 prefixexp='$prefixexp'
17404 privlibexp='$privlibexp'
17405 prototype='$prototype'
17407 quadkind='$quadkind'
17408 quadtype='$quadtype'
17409 randbits='$randbits'
17410 randfunc='$randfunc'
17411 randseedtype='$randseedtype'
17413 rd_nodata='$rd_nodata'
17414 revision='$revision'
17419 sPRIEUldbl='$sPRIEUldbl'
17420 sPRIFUldbl='$sPRIFUldbl'
17421 sPRIGUldbl='$sPRIGUldbl'
17422 sPRIXU64='$sPRIXU64'
17424 sPRIeldbl='$sPRIeldbl'
17425 sPRIfldbl='$sPRIfldbl'
17426 sPRIgldbl='$sPRIgldbl'
17431 sSCNfldbl='$sSCNfldbl'
17432 sched_yield='$sched_yield'
17433 scriptdir='$scriptdir'
17434 scriptdirexp='$scriptdirexp'
17436 seedfunc='$seedfunc'
17437 selectminbits='$selectminbits'
17438 selecttype='$selecttype'
17439 sendmail='$sendmail'
17442 sharpbang='$sharpbang'
17443 shmattype='$shmattype'
17444 shortsize='$shortsize'
17447 sig_count='$sig_count'
17448 sig_name='$sig_name'
17449 sig_name_init='$sig_name_init'
17451 sig_num_init='$sig_num_init'
17452 sig_size='$sig_size'
17453 signal_t='$signal_t'
17454 sitearch='$sitearch'
17455 sitearchexp='$sitearchexp'
17457 sitebinexp='$sitebinexp'
17459 sitelib_stem='$sitelib_stem'
17460 sitelibexp='$sitelibexp'
17461 siteprefix='$siteprefix'
17462 siteprefixexp='$siteprefixexp'
17463 sizesize='$sizesize'
17464 sizetype='$sizetype'
17468 sockethdr='$sockethdr'
17469 socketlib='$socketlib'
17470 socksizetype='$socksizetype'
17472 spackage='$spackage'
17473 spitshell='$spitshell'
17475 ssizetype='$ssizetype'
17476 startperl='$startperl'
17478 static_ext='$static_ext'
17480 stdio_base='$stdio_base'
17481 stdio_bufsiz='$stdio_bufsiz'
17482 stdio_cnt='$stdio_cnt'
17483 stdio_filbuf='$stdio_filbuf'
17484 stdio_ptr='$stdio_ptr'
17485 stdio_stream_array='$stdio_stream_array'
17488 subversion='$subversion'
17492 targetarch='$targetarch'
17496 timeincl='$timeincl'
17497 timetype='$timetype'
17511 uidformat='$uidformat'
17517 uquadtype='$uquadtype'
17518 use5005threads='$use5005threads'
17519 use64bitall='$use64bitall'
17520 use64bitint='$use64bitint'
17521 usecrosscompile='$usecrosscompile'
17523 useithreads='$useithreads'
17524 uselargefiles='$uselargefiles'
17525 uselongdouble='$uselongdouble'
17526 usemorebits='$usemorebits'
17527 usemultiplicity='$usemultiplicity'
17528 usemymalloc='$usemymalloc'
17530 useopcode='$useopcode'
17531 useperlio='$useperlio'
17532 useposix='$useposix'
17533 usereentrant='$usereentrant'
17535 useshrplib='$useshrplib'
17536 usesocks='$usesocks'
17537 usethreads='$usethreads'
17538 usevendorprefix='$usevendorprefix'
17539 usevfork='$usevfork'
17542 uvXUformat='$uvXUformat'
17543 uvoformat='$uvoformat'
17546 uvuformat='$uvuformat'
17547 uvxformat='$uvxformat'
17548 vendorarch='$vendorarch'
17549 vendorarchexp='$vendorarchexp'
17550 vendorbin='$vendorbin'
17551 vendorbinexp='$vendorbinexp'
17552 vendorlib='$vendorlib'
17553 vendorlib_stem='$vendorlib_stem'
17554 vendorlibexp='$vendorlibexp'
17555 vendorprefix='$vendorprefix'
17556 vendorprefixexp='$vendorprefixexp'
17558 version_patchlevel_string='$version_patchlevel_string'
17559 versiononly='$versiononly'
17561 voidflags='$voidflags'
17563 xs_apiversion='$xs_apiversion'
17565 yaccflags='$yaccflags'
17570 : Add in command line options if available
17571 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
17573 : add special variables
17574 $test -f $src/patchlevel.h && \
17575 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
17576 echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
17577 echo "PERL_CONFIG_SH=true" >>config.sh
17579 : propagate old symbols
17580 if $test -f UU/config.sh; then
17581 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
17582 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
17583 $sort | $uniq -u >UU/oldsyms
17584 set X `cat UU/oldsyms`
17590 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
17592 echo "# Variables propagated from previous config.sh file." >>config.sh
17593 for sym in `cat UU/oldsyms`; do
17594 echo " Propagating $hint variable "'$'"$sym..."
17595 eval 'tmp="$'"${sym}"'"'
17597 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
17603 : Finish up by extracting the .SH files
17607 echo "Extraction done."
17617 If you'd like to make any changes to the config.sh file before I begin
17618 to configure things, do it as a shell escape now (e.g. !vi config.sh).
17621 rp="Press return or use a shell escape to edit config.sh:"
17626 *) : in case they cannot read
17627 sh 1>&4 -c "$ans";;
17632 : if this fails, just run all the .SH files by hand
17641 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
17648 Now you need to generate make dependencies by running "$make depend".
17649 You might prefer to run it in background: "$make depend > makedepend.out &"
17650 It can take a while, so you might not want to run it right now.
17655 rp="Run $make depend now?"
17659 $make depend && echo "Now you must run '$make'."
17662 echo "You must run '$make depend' then '$make'."
17665 elif test -f [Mm]akefile; then
17667 echo "Now you must run a $make."
17669 echo "Configure done."
17672 if $test -f Policy.sh; then
17675 If you compile $package on a different machine or from a different object
17676 directory, copy the Policy.sh file from this object directory to the
17677 new one before you run Configure -- this will help you with most of
17678 the policy defaults.
17682 if $test -f config.msg; then
17683 echo "Hmm. I also noted the following information while running:"
17685 $cat config.msg >&4
17688 $rm -f kit*isdone ark*isdone