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 Mon Dec 24 04:14:27 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"
84 paths="$paths /system/gnu_library/bin"
90 *) test -d $p && PATH=$PATH$p_$p ;;
97 : shall we be using ksh?
103 if (PATH=.; alias -x) >/dev/null 2>&1; then
106 if test -f /hp-ux -a -f /bin/ksh; then
107 needksh='to avoid sh bug in "here document" expansion'
109 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
110 if test X`/usr/bin/uname -v` = X4; then
111 avoidksh="to avoid AIX 4's /bin/sh"
115 if test -f /osf_boot -a -f /usr/sbin/setld; then
116 if test X`/usr/bin/uname -s` = XOSF1; then
117 avoidksh="to avoid Digital UNIX' ksh"
119 unset BIN_SH # if this is 'xpg4' sh will start up ksh
122 case "$inksh/$needksh" in
129 case "$inksh/$avoidksh" in
135 case "$inksh/$needksh-$avoidksh-" in
138 (I see you are using the Korn shell. Some ksh's blow up on $me,
139 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
146 echo "(Feeding myself to $newsh $reason.)"
148 Configure|*/Configure) exec $newsh $0 "$@";;
149 *) exec $newsh Configure "$@";;
154 : if needed set CDPATH to a harmless value that is not chatty
155 : avoid bash 2.02 problems with empty CDPATH.
159 *bash*) CDPATH='.' ;;
164 : Configure runs within the UU subdirectory
165 test -d UU || mkdir UU
168 if test -f "/system/gnu_library/bin/ar.pm"; then
502 d_old_pthread_create_joinable=''
503 old_pthread_create_joinable=''
591 d_stdio_ptr_lval_nochange_cnt=''
592 d_stdio_ptr_lval_sets_cnt=''
777 inc_version_list_init=''
796 ignore_versioned_solibs=''
855 d_perl_otherlibdirs=''
869 version_patchlevel_string=''
874 d_nv_preserves_uv_bits=''
973 d_stdio_stream_array=''
974 stdio_stream_array=''
984 ccflags_uselargefiles=''
985 ldflags_uselargefiles=''
986 libswanted_uselargefiles=''
1006 installvendorarch=''
1032 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1035 : We must find out about Eunice early
1037 if test -f /etc/unixtovms; then
1038 eunicefix=/etc/unixtovms
1040 if test -f /etc/unixtovms.exe; then
1041 eunicefix=/etc/unixtovms.exe
1048 : set useposix=false in your hint file to disable the POSIX extension.
1050 : set useopcode=false in your hint file to disable the Opcode extension.
1052 : Trailing extension. Override this in a hint file, if needed.
1053 : Extra object files, if any, needed on this platform.
1057 : Possible local include directories to search.
1058 : Set locincpth to "" in a hint file to defeat local include searches.
1059 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1060 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1062 : no include file wanted by default
1067 : change the next line if compiling for Xenix/286 on Xenix/386
1068 xlibpth='/usr/lib/386 /lib/386'
1069 : Possible local library directories to search.
1070 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1071 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1073 : general looking path for locating libraries
1074 glibpth="/lib /usr/lib $xlibpth"
1075 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1076 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1077 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1079 : Private path used by Configure to find libraries. Its value
1080 : is prepended to libpth. This variable takes care of special
1081 : machines, like the mips. Usually, it should be empty.
1084 : default library list
1086 : some systems want to use only the non-versioned libso:s
1087 ignore_versioned_solibs=''
1089 ccflags_uselargefiles=''
1090 ldflags_uselargefiles=''
1091 libswanted_uselargefiles=''
1092 : set usemultiplicity on the Configure command line to enable multiplicity.
1093 : set usesocks on the Configure command line to enable socks.
1094 : set usethreads on the Configure command line to enable threads.
1095 usereentrant='undef'
1096 : full support for void wanted by default
1099 : List of libraries we want.
1100 : If anyone needs -lnet, put it in a hint file.
1101 libswanted='sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl'
1102 libswanted="$libswanted dld ld sun m c cposix posix"
1103 libswanted="$libswanted ndir dir crypt sec"
1104 libswanted="$libswanted ucb bsd BSD PW x util"
1105 : We probably want to search /usr/shlib before most other libraries.
1106 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1107 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1108 glibpth="/usr/shlib $glibpth"
1109 : Do not use vfork unless overridden by a hint file.
1112 : Find the basic shell for Bourne shell scripts
1116 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1119 if test -f "$xxx"; then
1122 : Build up a list and do a single loop so we can 'break' out.
1123 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1124 for xxx in sh bash ksh pdksh ash; do
1126 try="$try ${p}/${xxx}"
1130 if test -f "$xxx"; then
1133 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1136 elif test -f "$xxx.exe"; then
1147 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1149 Usually it's in /bin/sh. How did you even get this far?
1150 Please contact me (Perl Maintainers) at perlbug@perl.org and
1151 we'll try to straighten this all out.
1157 : see if sh knows # comments
1158 if `$sh -c '#' >/dev/null 2>&1`; then
1162 test -f $xcat$_exe || xcat=/usr/bin/cat
1163 if test ! -f $xcat$_exe; then
1165 if test -f $p/cat$_exe; then
1170 if test ! -f $xcat$_exe; then
1171 echo "Can't find cat anywhere!"
1175 echo "#!$xcat" >sharp
1179 if test -s today; then
1182 echo "#! $xcat" > sharp
1186 if test -s today; then
1194 echo "Your $sh doesn't grok # comments--I will strip them later on."
1197 echo "exec grep -v '^[ ]*#'" >spitshell
1199 $eunicefix spitshell
1200 spitshell=`pwd`/spitshell
1202 echo "I presume that if # doesn't work, #! won't work either!"
1207 : figure out how to guarantee sh startup
1209 '') startsh=${sharpbang}${sh} ;;
1221 : echo "Yup, it does."
1223 echo "Hmm... '$startsh' does not guarantee sh startup..."
1224 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1229 : Save command line options in file UU/cmdline.opt for later use in
1230 : generating config.sh.
1231 cat > cmdline.opt <<EOSH
1232 # Configure command line arguments.
1241 cat >>cmdline.opt <<EOSH
1242 config_arg$argn='$arg'
1244 # Extreme backslashitis: replace each ' by '"'"'
1245 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1248 arg_exp=`cat cmdl.opt`
1249 args_exp="$args_exp$args_sep'$arg_exp'"
1250 argn=`expr $argn + 1`
1253 # args_exp is good for restarting self: eval "set X $args_exp"; shift; $0 "$@"
1254 # used by ./hints/os2.sh
1257 : produce awk script to parse command line options
1258 cat >options.awk <<'EOF'
1260 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1262 len = length(optstr);
1263 for (i = 1; i <= len; i++) {
1264 c = substr(optstr, i, 1);
1265 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1276 if (substr(str, 1, 1) != "-") {
1277 printf("'%s'\n", str);
1281 for (i = 2; i <= len; i++) {
1282 c = substr(str, i, 1);
1284 printf("-%s\n", substr(str, i));
1290 printf("'%s'\n", substr(str, i + 1));
1303 : process the command line options
1304 set X `for arg in "$@"; do echo "X$arg"; done |
1305 sed -e s/X// | awk -f options.awk`
1310 : set up default values
1320 rm -f optdef.sh posthint.sh
1321 cat >optdef.sh <<EOS
1327 while test $# -gt 0; do
1329 -d) shift; fastread=yes;;
1330 -e) shift; alldone=cont;;
1334 if test -r "$1"; then
1337 echo "$me: cannot read config file $1." >&2
1342 -h) shift; error=true;;
1343 -r) shift; reuseval=true;;
1344 -s) shift; silent=true; realsilent=true;;
1345 -E) shift; alldone=exit;;
1346 -K) shift; knowitall=true;;
1347 -O) shift; override=true;;
1348 -S) shift; silent=true; extractsh=true;;
1353 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1354 echo "$me: ignoring -D $1" >&2
1357 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1358 *) echo "$1='define'" >> optdef.sh;;
1365 *=) echo "$1" >> optdef.sh;;
1367 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1368 echo "$me: ignoring -U $1" >&2
1370 *) echo "$1='undef'" >> optdef.sh;;
1381 *=*) zzz=`echo $yyy|sed 's!=.*!!'`
1385 zzz=" "`echo $yyy|sed 's!^[^=]*=!!'`
1386 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1392 *:*) xxx=`echo $yyy|sed 's!:.*!!'`
1393 yyy=`echo $yyy|sed 's!^[^:]*:!!'`
1394 zzz=`echo $yyy|sed 's!^[^=]*=!!'`
1395 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1396 *) xxx=`echo $yyy|sed 's!:.*!!'`
1397 yyy=`echo $yyy|sed 's!^[^:]*:!!'` ;;
1403 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1405 echo "$yyy=''" >> posthint.sh ;;
1410 echo "$yyy='$zzz'" >> posthint.sh ;;
1412 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1414 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1419 echo "$yyy=$zzz" >> posthint.sh ;;
1420 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1424 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1427 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1435 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1436 [-U symbol] [-U symbol=] [-A command:symbol...]
1437 -d : use defaults for all answers.
1438 -e : go on without questioning past the production of config.sh.
1439 -f : specify an alternate default configuration file.
1440 -h : print this help message and exit (with an error status).
1441 -r : reuse C symbols value if possible (skips costly nm extraction).
1442 -s : silent mode, only echoes questions and essential information.
1443 -D : define symbol to have some value:
1444 -D symbol symbol gets the value 'define'
1445 -D symbol=value symbol gets the value 'value'
1446 -E : stop at the end of questions, after having produced config.sh.
1447 -K : do not use unless you know what you are doing.
1448 -O : let -D and -U override definitions from loaded configuration file.
1449 -S : perform variable substitutions on all .SH files (can mix with -f)
1450 -U : undefine symbol:
1451 -U symbol symbol gets the value 'undef'
1452 -U symbol= symbol gets completely empty
1453 -A : manipulate symbol after the platform specific hints have been applied:
1454 -A symbol=value append " "value to symbol
1455 -A append:symbol=value append value to symbol
1456 -A define:symbol=value define symbol to have value
1457 -A clear:symbol define symbol to be ''
1458 -A define:symbol define symbol to be 'define'
1459 -A eval:symbol=value define symbol to be eval of value
1460 -A prepend:symbol=value prepend value to symbol
1461 -A undef:symbol define symbol to be 'undef'
1462 -A undef:symbol= define symbol to be ''
1463 -V : print version number and exit (with a zero status).
1470 case "$fastread$alldone" in
1473 case "$extractsh" in
1476 if test ! -t 0; then
1477 echo "Say 'sh Configure', not 'sh <Configure'"
1487 true) exec 1>/dev/null;;
1490 : run the defines and the undefines, if any, but leave the file out there...
1493 : create the posthint manipulation script and leave the file out there...
1498 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1499 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1500 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1501 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1502 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1505 : Some greps do not return status, grrr.
1506 echo "grimblepritz" >grimble
1507 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1509 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1515 : the following should work in any shell
1519 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1520 cat >contains <<'EOSS'
1521 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1526 : Find the path to the source tree
1529 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1533 *) src=`cd ../$src && pwd` ;;
1546 if test -f $rsrc/Configure && \
1547 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1549 : found it, so we are ok.
1552 for src in . .. ../.. ../../.. ../../../..; do
1553 if test -f ../$src/Configure && \
1554 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1565 Sorry, I can't seem to locate the source dir for $package. Please start
1566 Configure with an explicit path -- i.e. /some/path/Configure.
1574 echo "Sources for $package found in \"$src\"." >&4
1578 : script used to extract .SH files with variable substitutions
1579 cat >extract <<'EOS'
1581 echo "Doing variable substitutions on .SH files..."
1582 if test -f MANIFEST; then
1583 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1585 echo "(Looking for .SH files under the source directory.)"
1586 set x `(cd $src; find . -name "*.SH" -print)`
1590 0) set x `(cd $src; echo *.SH)`; shift;;
1592 if test ! -f $src/$1; then
1598 while test $name; do
1599 if test ! -d "$name"; then
1600 create="$name $create";
1601 name=`echo $name | sed -e "s|^[^/]*$||"`;
1602 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1607 for file in $create; do
1616 dir=`expr X$file : 'X\(.*\)/'`
1617 file=`expr X$file : 'X.*/\(.*\)'`
1618 (cd $dir && . ./$file)
1628 dir=`expr X$file : 'X\(.*\)/'`
1629 file=`expr X$file : 'X.*/\(.*\)'`
1630 (set x $dir; shift; eval $mkdir_p)
1640 if test -f $src/config_h.SH; then
1641 if test ! -f config.h; then
1642 : oops, they left it out of MANIFEST, probably, so do it anyway.
1648 : extract files and exit if asked to do so
1649 case "$extractsh" in
1651 case "$realsilent" in
1655 case "$config_sh" in
1656 '') config_sh='config.sh';;
1659 echo "Fetching answers from $config_sh..."
1662 test "$override" && . ./optdef.sh
1666 echo "Extraction done."
1671 : Eunice requires " " instead of "", can you believe it
1674 echo "Beginning of configuration questions for $package."
1676 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1678 : first determine how to suppress newline on echo command
1680 echo "Checking echo to see how to suppress newlines..."
1681 (echo "hi there\c" ; echo " ") >.echotmp
1682 if $contains c .echotmp >/dev/null 2>&1 ; then
1693 echo $n "The star should be here-->$c"
1697 : Now test for existence of everything in MANIFEST
1699 if test -f $rsrc/MANIFEST; then
1700 echo "First let's make sure your kit is complete. Checking..." >&4
1701 awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
1704 for filelist in x??; do
1705 (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
1707 if test -s missing; then
1711 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1713 You have the option of continuing the configuration process, despite the
1714 distinct possibility that your kit is damaged, by typing 'y'es. If you
1715 do, don't blame me if something goes wrong. I advise you to type 'n'o
1716 and contact the author (perlbug@perl.org).
1719 echo $n "Continue? [n] $c" >&4
1723 echo "Continuing..." >&4
1727 echo "ABORTING..." >&4
1732 echo "Looks good..."
1735 echo "There is no MANIFEST file. I hope your kit is complete !"
1740 : Find the appropriate value for a newline for tr
1741 if test -n "$DJGPP"; then
1744 if test X"$trnl" = X; then
1745 case "`echo foo|tr '\n' x 2>/dev/null`" in
1749 if test X"$trnl" = X; then
1750 case "`echo foo|tr '\012' x 2>/dev/null`" in
1751 foox) trnl='\012' ;;
1754 if test X"$trnl" = X; then
1757 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1763 : compute the number of columns on the terminal for proper question formatting
1768 : set up the echo used in my read
1769 myecho="case \"\$xxxm\" in
1770 '') echo $n \"\$rp $c\" >&4;;
1772 '') echo $n \"[\$xxxm] $c\";;
1774 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1776 echo $n \"[\$xxxm] $c\" >&4
1778 echo $n \"\$rp [\$xxxm] $c\" >&4
1784 : now set up to do reads with possible shell escape and default assignment
1790 case "\$fastread" in
1791 yes) case "\$dflt" in
1794 case "\$silent-\$rp" in
1799 *) case "\$silent" in
1800 true) case "\$rp" in
1805 while expr "X\$ans" : "X!" >/dev/null; do
1809 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1817 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1826 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1831 echo "(OK, I'll run with -d after this question.)" >&4
1834 echo "*** Sorry, \$1 not supported yet." >&4
1844 echo "*** Substitution done -- please confirm."
1846 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1851 echo "*** Error -- try again."
1858 case "\$ans\$xxxm\$nostick" in
1870 : create .config dir to save info across Configure sessions
1871 test -d ../.config || mkdir ../.config
1872 cat >../.config/README <<EOF
1873 This directory created by Configure to save information that should
1874 persist across sessions for $package.
1876 You may safely delete it if you wish.
1879 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
1881 $define|true|[yY]*) ;;
1882 *) case "$xversion" in
1885 *** WHOA THERE!!! ***
1887 This is an UNSTABLE DEVELOPMENT release.
1888 The version of this $package distribution is $xversion, that is, odd,
1889 (as opposed to even) and that signifies a development release.
1890 If you want a maintenance release, you want an even-numbered version.
1892 Do ***NOT*** install this into production use.
1893 Data corruption and crashes are possible.
1895 It is most seriously suggested that you do not continue any further
1896 unless you want to help in developing and debugging Perl.
1898 If you *still* want to build perl, you can answer 'y' now,
1899 or pass -Dusedevel to Configure.
1902 rp='Do you really want to continue?'
1906 [yY]) echo >&4 "Okay, continuing."
1907 usedevel="$define" ;;
1908 *) echo >&4 "Okay, bye."
1918 case "$versiononly" in
1919 '') versiononly="$define" ;;
1921 case "$installusrbinperl" in
1922 '') installusrbinperl="$undef" ;;
1927 : general instructions
1930 user=`(logname) 2>/dev/null`
1932 '') user=`whoami 2>&1`;;
1934 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1937 rp='Would you like to see the instructions?'
1948 This installation shell script will examine your system and ask you questions
1949 to determine how the perl5 package should be installed. If you get
1950 stuck on a question, you may use a ! shell escape to start a subshell or
1951 execute a command. Many of the questions will have default answers in square
1952 brackets; typing carriage return will give you the default.
1954 On some of the questions which ask for file or directory names you are allowed
1955 to use the ~name construct to specify the login directory belonging to "name",
1956 even if you don't have a shell which knows about that. Questions where this is
1957 allowed will be marked "(~name ok)".
1961 dflt='Type carriage return to continue'
1965 The prompter used in this script allows you to use shell variables and
1966 backticks in your answers. You may use $1, $2, etc... to refer to the words
1967 in the default answer, as if the default line was a set of arguments given to a
1968 script shell. This means you may also use $* to repeat the whole default line,
1969 so you do not have to re-type everything to add something to the default.
1971 Everytime there is a substitution, you will have to confirm. If there is an
1972 error (e.g. an unmatched backtick), the default answer will remain unchanged
1973 and you will be prompted again.
1975 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1976 the questions and use the computed defaults (or the previous answers if there
1977 was already a config.sh file). Type 'Configure -h' for a list of options.
1978 You may also start interactively and then answer '& -d' at any prompt to turn
1979 on the non-interactive behaviour for the remainder of the execution.
1985 Much effort has been expended to ensure that this shell script will run on any
1986 Unix system. If despite that it blows up on yours, your best bet is to edit
1987 Configure and run it again. If you can't run Configure for some reason,
1988 you'll have to generate a config.sh file by hand. Whatever problems you
1989 have, let me (perlbug@perl.org) know how I blew it.
1991 This installation script affects things in two ways:
1993 1) it may do direct variable substitutions on some of the files included
1995 2) it builds a config.h file for inclusion in C programs. You may edit
1996 any of these files as the need arises after running this script.
1998 If you make a mistake on a question, there is no easy way to back up to it
1999 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2000 files. Configure will offer to let you do this before it runs the SH files.
2003 dflt='Type carriage return to continue'
2005 case "$firsttime" in
2006 true) echo $user >>../.config/instruct;;
2010 : find out where common programs are
2012 echo "Locating common programs..." >&4
2025 if test -d \$dir/\$thing; then
2031 for thisthing in \$dir/\$thing; do
2032 : just loop through to pick last item
2034 if test -f \$thisthing; then
2037 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2040 elif test -f \$dir/\$thing.exe; then
2041 if test -n "$DJGPP"; then
2042 echo \$dir/\$thing.exe
2044 : on Eunice apparently
2097 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2098 pth="$pth /lib /usr/lib"
2099 for file in $loclist; do
2103 if test -f "$xxx"; then
2106 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2107 xxx=`./loc $file $file $pth`
2110 '') xxx=`./loc $file $file $pth`;;
2111 *) xxx=`./loc $xxx $xxx $pth`;;
2113 eval $file=$xxx$_exe
2117 echo $file is in $xxx.
2120 echo $file is in $xxx.
2123 echo "I don't know where '$file' is, and my life depends on it." >&4
2124 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2130 echo "Don't worry if any of the following aren't found..."
2132 for file in $trylist; do
2136 if test -f "$xxx"; then
2139 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2140 xxx=`./loc $file $file $pth`
2143 '') xxx=`./loc $file $file $pth`;;
2144 *) xxx=`./loc $xxx $xxx $pth`;;
2150 echo $file is in $xxx.
2153 echo $file is in $xxx.
2156 echo "I don't see $file out there, $say."
2163 echo "Substituting grep for egrep."
2169 echo "Substituting cp for ln."
2177 echo "I can't find make or gmake, and my life depends on it." >&4
2178 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2186 *) # We can't have osname yet.
2187 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2188 # Assume that gmake, if found, is definitely GNU make
2189 # and prefer it over the system make.
2190 echo "Substituting gmake for make."
2197 echo "Hopefully test is built into your sh."
2200 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2201 echo "Using the test built into your sh."
2209 echo "Hopefully echo is built into your sh."
2214 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2215 $echo $n "hi there$c" >foo1
2216 echo $n "hi there$c" >foo2
2217 if cmp foo1 foo2 >/dev/null 2>&1; then
2218 echo "They are compatible. In fact, they may be identical."
2225 They are not compatible! You are probably running ksh on a non-USG system.
2226 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2227 have echo built in and we may have to run some Bourne shell scripts. That
2228 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2231 $echo $n "The star should be here-->$c"
2241 cat <<'EOSC' >>checkcc
2246 int main(int argc, char *argv[]) {
2250 if $cc -o try $ccflags $ldflags try.c; then
2253 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2259 case "`$cc -v -c try.c 2>&1`" in
2262 if $test X"$trygcc" = Xyes; then
2263 if gcc -o try -c try.c; then
2265 echo "You seem to have a working gcc, though." >&4
2266 rp="Would you like to use it?"
2268 if $test -f myread; then
2271 if $test -f UU/myread; then
2274 echo "Cannot find myread, sorry. Aborting." >&2
2279 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no ;;
2283 if $test X"$despair" = Xyes; then
2285 You need to find a working C compiler.
2286 Either (purchase and) install the C compiler supplied by your OS vendor,
2287 or for a free C compiler try http://gcc.gnu.org/
2288 I cannot continue any further, aborting.
2298 : determine whether symbolic links are supported
2301 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2302 echo "Symbolic links are supported." >&4
2305 echo "Symbolic links are NOT supported." >&4
2310 : determine whether symbolic links are supported
2314 echo "Checking how to test for symbolic links..." >&4
2316 if $test "X$issymlink" = X; then
2318 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2319 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2321 if test $? = 0; then
2324 echo "Your builtin 'test -h' may be broken." >&4
2327 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2330 if test -f "$p/$test"; then
2339 echo "Trying external '$test -h'." >&4
2340 issymlink="$test -h"
2341 if $test ! -h sym >/dev/null 2>&1; then
2342 echo "External '$test -h' is broken, too." >&4
2350 if $test "X$issymlink" = X; then
2351 if $test -L sym 2>/dev/null; then
2352 issymlink="$test -L"
2353 echo "The builtin '$test -L' worked." >&4
2356 if $test "X$issymlink" != X; then
2357 echo "You can test for symbolic links with '$issymlink'." >&4
2359 echo "I do not know how you can test for symbolic links." >&4
2363 *) echo "No symbolic links, so not testing for their testing..." >&4
2369 case "$mksymlinks" in
2372 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2375 *) case "$lns:$issymlink" in
2376 *"ln -s:"*"test -"?)
2377 echo "Creating the symbolic links..." >&4
2378 echo "(First creating the subdirectories...)" >&4
2380 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2382 test -z "$directory" && break
2386 if test ! -d t/base; then
2387 echo "Failed to create the subdirectories. Aborting." >&4
2390 echo "(Then creating the symlinks...)" >&4
2391 awk '{print $1}' $src/MANIFEST | while true; do
2393 test -z "$filename" && break
2394 if test -f $filename; then
2395 if $issymlink $filename; then
2399 if test -f $filename; then
2400 echo "$filename already exists, not symlinking."
2402 ln -s $src/$filename $filename
2406 if test ! -f t/base/lex.t; then
2407 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2412 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2421 case "$usecrosscompile" in
2423 $echo "Cross-compiling..."
2426 *-*-gcc) # A cross-compiling gcc, probably.
2427 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2429 # leave out ld, choosing it is more complex
2431 ranlib=$targetarch-ranlib
2432 $echo 'extern int foo;' > try.c
2433 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2435 if $test $# -gt 0; then
2437 incpth="`$echo $incpth|$sed 's/^ //'`"
2438 echo "Guessing incpth '$incpth'." >&4
2440 j="`$echo $i|$sed 's,/include$,/lib,'`"
2441 if $test -d $j; then
2445 libpth="`$echo $libpth|$sed 's/^ //'`"
2446 echo "Guessing libpth '$libpth'." >&4
2451 case "$targetarch" in
2452 '') echo "Targetarch not defined." >&4; croak=y ;;
2453 *) echo "Using targetarch $targetarch." >&4 ;;
2456 '') echo "Incpth not defined." >&4; croak=y ;;
2457 *) echo "Using incpth '$incpth'." >&4 ;;
2460 '') echo "Libpth not defined." >&4; croak=y ;;
2461 *) echo "Using libpth '$libpth'." >&4 ;;
2464 '') for i in $incpth; do
2465 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2467 echo "Guessing usrinc $usrinc." >&4
2472 '') echo "Usrinc not defined." >&4; croak=y ;;
2475 *) echo "Using usrinc $usrinc." >&4 ;;
2477 case "$targethost" in
2478 '') echo "Targethost not defined." >&4; croak=y ;;
2479 *) echo "Using targethost $targethost." >&4
2484 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2487 /*) run=$src/Cross/run
2488 targetmkdir=$src/Cross/mkdir
2490 from=$src/Cross/from
2492 *) pwd=`$test -f ../Configure & cd ..; pwd`
2494 targetmkdir=$pwd/Cross/mkdir
2496 from=$pwd/Cross/from
2499 case "$targetrun" in
2500 '') targetrun=ssh ;;
2505 case "$targetfrom" in
2506 '') targetfrom=scp ;;
2510 from=$from-$targetfrom
2511 case "$targetdir" in
2513 echo "Guessing targetdir $targetdir." >&4
2516 case "$targetuser" in
2518 echo "Guessing targetuser $targetuser." >&4
2521 case "$targetfrom" in
2525 case "$targetrun" in
2537 '') cwd=$targetdir ;;
2541 if $test ! -f \$exe.xok; then
2545 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2548 *) echo "Unknown targetrun '$targetrun'" >&4
2552 case "$targetmkdir" in
2554 cat >$targetmkdir <<EOF
2556 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2558 $chmod a+rx $targetmkdir
2560 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2572 $targetmkdir \`dirname \$f\`
2573 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2576 $targetmkdir $targetdir/\`dirname \$f\`
2577 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2590 $mkdir -p $targetdir/\`dirname \$f\`
2591 $cp \$f $targetdir/\$f || exit 1
2594 $targetmkdir $targetdir/\`dirname \$f\`
2595 $cp \$f $targetdir/\$f || exit 1
2602 *) echo "Unknown targetto '$targetto'" >&4
2606 case "$targetfrom" in
2613 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2618 cp) cat >$from <<EOF
2623 cp $targetdir/\$f . || exit 1
2628 *) echo "Unknown targetfrom '$targetfrom'" >&4
2632 if $test ! -f $run; then
2633 echo "Target 'run' script '$run' not found." >&4
2637 if $test ! -f $to; then
2638 echo "Target 'to' script '$to' not found." >&4
2642 if $test ! -f $from; then
2643 echo "Target 'from' script '$from' not found." >&4
2647 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2651 Using '$run' for remote execution,
2652 and '$from' and '$to'
2653 for remote file transfer.
2659 usecrosscompile='undef'
2664 : see whether [:lower:] and [:upper:] are supported character classes
2666 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2668 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2672 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
2673 # (0xc9 and 0xd1), therefore that is a nice testing point.
2674 if test "X$up" = X -o "X$low" = X; then
2675 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
2681 if test "X$up" = X -o "X$low" = X; then
2682 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
2688 if test "X$up" = X -o "X$low" = X; then
2689 case "`echo IJ | od -x 2>/dev/null`" in
2691 echo "Hey, this might be EBCDIC." >&4
2692 if test "X$up" = X -o "X$low" = X; then
2693 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2694 ij) up='[A-IJ-RS-Z]'
2699 if test "X$up" = X -o "X$low" = X; then
2700 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2710 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
2712 echo "Using $up and $low to convert case." >&4
2715 echo "I don't know how to translate letters from upper to lower case." >&4
2716 echo "Your tr is not acting any way I know of." >&4
2720 : set up the translation script tr, must be called with ./tr of course
2724 '[A-Z][a-z]') exec $tr '$up' '$low';;
2725 '[a-z][A-Z]') exec $tr '$low' '$up';;
2732 : Try to determine whether config.sh was made on this system
2733 case "$config_sh" in
2735 myuname=`$uname -a 2>/dev/null`
2736 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2737 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2738 # because the A-Z/a-z are not consecutive.
2739 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2740 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2741 newmyuname="$myuname"
2743 case "$knowitall" in
2745 if test -f ../config.sh; then
2746 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2747 eval "`grep myuname= ../config.sh`"
2749 if test "X$myuname" = "X$newmyuname"; then
2757 : Get old answers from old config file if Configure was run on the
2758 : same system, otherwise use the hints.
2761 if test -f config.sh; then
2763 rp="I see a config.sh file. Shall I use it to set the defaults?"
2766 n*|N*) echo "OK, I'll ignore it."
2767 mv config.sh config.sh.old
2768 myuname="$newmyuname"
2770 *) echo "Fetching default answers from your old config.sh file..." >&4
2778 : Older versions did not always set $sh. Catch re-use of such
2788 if test ! -f config.sh; then
2791 First time through, eh? I have some defaults handy for some systems
2792 that need some extra help getting the Configure answers right:
2795 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2797 : Half the following guesses are probably wrong... If you have better
2798 : tests or hints, please send them to perlbug@perl.org
2799 : The metaconfig authors would also appreciate a copy...
2800 $test -f /irix && osname=irix
2801 $test -f /xenix && osname=sco_xenix
2802 $test -f /dynix && osname=dynix
2803 $test -f /dnix && osname=dnix
2804 $test -f /lynx.os && osname=lynxos
2805 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2806 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
2807 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2808 $test -f /bin/mips && /bin/mips && osname=mips
2809 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
2810 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
2811 $test -d /usr/apollo/bin && osname=apollo
2812 $test -f /etc/saf/_sactab && osname=svr4
2813 $test -d /usr/include/minix && osname=minix
2814 $test -d /system && osname=vos
2815 if $test -d /MachTen -o -d /MachTen_Folder; then
2817 if $test -x /sbin/version; then
2818 osvers=`/sbin/version | $awk '{print $2}' |
2819 $sed -e 's/[A-Za-z]$//'`
2820 elif $test -x /usr/etc/version; then
2821 osvers=`/usr/etc/version | $awk '{print $2}' |
2822 $sed -e 's/[A-Za-z]$//'`
2828 $test -f /sys/posix.dll &&
2829 $test -f /usr/bin/what &&
2830 set X `/usr/bin/what /sys/posix.dll` &&
2831 $test "$3" = UWIN &&
2835 if $test -f $uname; then
2843 umips) osname=umips ;;
2846 [23]100) osname=mips ;;
2847 next*) osname=next ;;
2849 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
2850 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
2853 elif $test -f /etc/kconfig; then
2855 if test "$lns" = "$ln -s"; then
2857 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
2859 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
2866 if test -n "$DJGPP"; then
2875 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
2877 'not found') osvers="$4"."$3" ;;
2878 '<3240'|'<>3240') osvers=3.2.0 ;;
2879 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
2880 '=3250'|'>3250') osvers=3.2.5 ;;
2884 bsd386) osname=bsd386
2887 cygwin*) osname=cygwin
2890 *dc.osx) osname=dcosx
2896 domainos) osname=apollo
2902 dynixptx*) osname=dynixptx
2903 osvers=`echo "$4"|sed 's/^v//'`
2905 freebsd) osname=freebsd
2907 genix) osname=genix ;;
2909 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
2925 netbsd*) osname=netbsd
2928 news-os) osvers="$3"
2930 4*) osname=newsos4 ;;
2934 next*) osname=next ;;
2935 nonstop-ux) osname=nonstopux ;;
2936 POSIX-BC | posix-bc ) osname=posix-bc
2939 powerux | power_ux | powermax_os | powermaxos | \
2940 powerunix | power_unix) osname=powerux
2946 solaris) osname=solaris
2948 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2955 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2959 titanos) osname=titanos
2968 ultrix) osname=ultrix
2971 osf1|mls+) case "$5" in
2974 osvers=`sizer -v | awk '{print $3}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
2977 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
2980 hp*) osname=hp_osf1 ;;
2981 mips) osname=mips_osf1 ;;
2984 unixware) osname=svr5
2992 $2) case "$osname" in
2996 : svr4.x or possibly later
3006 if test -f /stand/boot ; then
3007 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3008 if test -n "$INITPROG" -a -f "$INITPROG"; then
3009 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3010 if test -n "$isesix"; then
3018 *) if test -f /etc/systemid; then
3020 set `echo $3 | $sed 's/\./ /g'` $4
3021 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3023 elif $test -f $src/hints/sco_$1_$2.sh; then
3025 elif $test -f $src/hints/sco_$1.sh; then
3030 '') : Still unknown. Probably a generic Sys V.
3039 *) case "$osname" in
3040 '') : Still unknown. Probably a generic BSD.
3048 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3049 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3050 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3053 $rm -f UU/kernel.what
3054 elif test -d c:/.; then
3061 case "$targetarch" in
3064 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3069 : Now look for a hint file osname_osvers, unless one has been
3070 : specified already.
3073 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3074 : Also try without trailing minor version numbers.
3075 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3076 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3077 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3078 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3081 *) case "$osvers" in
3084 *) if $test -f $src/hints/$file.sh ; then
3086 elif $test -f $src/hints/$xfile.sh ; then
3088 elif $test -f $src/hints/$xxfile.sh ; then
3090 elif $test -f $src/hints/$xxxfile.sh ; then
3092 elif $test -f $src/hints/$xxxxfile.sh ; then
3094 elif $test -f "$src/hints/${osname}.sh" ; then
3103 if $test -f Policy.sh ; then
3106 none) dflt="Policy" ;;
3107 *) dflt="Policy $dflt" ;;
3112 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3116 if $test -f Policy.sh ; then
3119 There's also a Policy hint file available, which should make the
3120 site-specific (policy) questions easier to answer.
3127 You may give one or more space-separated answers, or "none" if appropriate.
3128 A well-behaved OS will have no hints, so answering "none" or just "Policy"
3129 is a good thing. DO NOT give a wrong version or a wrong OS.
3133 rp="Which of these apply, if any?"
3136 for file in $tans; do
3137 if $test X$file = XPolicy -a -f Policy.sh; then
3139 $cat Policy.sh >> UU/config.sh
3140 elif $test -f $src/hints/$file.sh; then
3141 . $src/hints/$file.sh
3142 $cat $src/hints/$file.sh >> UU/config.sh
3143 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3146 : Give one chance to correct a possible typo.
3147 echo "$file.sh does not exist"
3149 rp="hint to use instead?"
3151 for file in $ans; do
3152 if $test -f "$src/hints/$file.sh"; then
3153 . $src/hints/$file.sh
3154 $cat $src/hints/$file.sh >> UU/config.sh
3155 elif $test X$ans = X -o X$ans = Xnone ; then
3158 echo "$file.sh does not exist -- ignored."
3165 : Remember our hint file for later.
3166 if $test -f "$src/hints/$file.sh" ; then
3176 echo "Fetching default answers from $config_sh..." >&4
3180 cp $config_sh config.sh 2>/dev/null
3190 test "$override" && . ./optdef.sh
3192 : Restore computed paths
3193 for file in $loclist $trylist; do
3194 eval $file="\$_$file"
3199 Configure uses the operating system name and version to set some defaults.
3200 The default value is probably right if the name rings a bell. Otherwise,
3201 since spelling matters for me, either accept the default or answer "none"
3208 ''|' '|none) dflt=none ;;
3209 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3212 *) dflt="$osname" ;;
3214 rp="Operating system name?"
3218 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3224 ''|' '|none) dflt=none ;;
3225 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3226 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3228 ''|' ') dflt=none ;;
3233 *) dflt="$osvers" ;;
3235 rp="Operating system version?"
3245 : who configured the system
3246 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3247 cf_by=`(logname) 2>/dev/null`
3250 cf_by=`(whoami) 2>/dev/null`
3252 "") cf_by=unknown ;;
3256 : set up the script used to warn in case of inconsistency
3263 echo "*** WHOA THERE!!! ***" >&4
3264 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
3265 rp=" Keep the $hint value?"
3268 y) td=$was; tu=$was;;
3272 : function used to set $1 to $val
3273 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
3275 $define$undef) . ./whoa; eval "$var=\$td";;
3276 $undef$define) . ./whoa; eval "$var=\$tu";;
3277 *) eval "$var=$val";;
3280 case "$usethreads" in
3281 $define|true|[yY]*) dflt='y';;
3286 Perl can be built to take advantage of threads on some systems.
3287 To do so, Configure can be run with -Dusethreads.
3289 Note that threading is a highly experimental feature, and
3290 some known race conditions still remain. If you choose to try
3291 it, be very sure to not actually deploy it for production
3292 purposes. README.threads has more details, and is required
3293 reading if you enable threads.
3295 If this doesn't make any sense to you, just accept the default '$dflt'.
3297 rp='Build a threading Perl?'
3300 y|Y) val="$define" ;;
3306 case "$usethreads" in
3310 As of 5.5.640, Perl has two different internal threading implementations,
3311 the 5.005 version (5005threads) and an interpreter-based version
3312 (ithreads) that has one interpreter per thread. Both are very
3313 experimental. This arrangement exists to help developers work out
3314 which one is better.
3316 If you're a casual user, you probably don't want interpreter-threads
3317 at this time. But if you do, the 'threads' module allows their use,
3318 and the 'Thread' module offers an interface to both 5005threads and
3319 ithreads (whichever has been configured).
3321 : Default to ithreads unless overridden on command line or with
3324 case "$use5005threads" in
3325 $define|true|[yY]*) dflt='n';;
3327 case "$useithreads" in
3328 $undef|false|[nN]*) dflt='n';;
3330 rp='Use interpreter-based ithreads?'
3333 y|Y) val="$define" ;;
3338 : Now set use5005threads to the opposite value.
3339 case "$useithreads" in
3340 $define) val="$undef" ;;
3347 useithreads="$undef"
3348 use5005threads="$undef"
3352 case "$useithreads$use5005threads" in
3356 You cannot have both the ithreads and the 5.005 threads enabled
3357 at the same time. Disabling the 5.005 threads since they are
3358 much less stable than the ithreads.
3361 use5005threads="$undef"
3365 case "$d_oldpthreads" in
3366 '') : Configure tests would be welcome here. For now, assume undef.
3368 *) val="$d_oldpthreads" ;;
3374 case "$usethreads" in
3375 "$define"|true|[yY]*)
3376 : Look for a hint-file generated 'call-back-unit'. If the
3377 : user has specified that a threading perl is to be built,
3378 : we may need to set or change some other defaults.
3379 if $test -f usethreads.cbu; then
3380 echo "Your platform has some specific hints for threaded builds, using them..."
3384 (Your platform doesn't have any specific hints for threaded builds.
3385 Assuming POSIX threads, then.)
3393 Perl can be built so that multiple Perl interpreters can coexist
3394 within the same Perl executable.
3397 case "$useithreads" in
3400 This multiple interpreter support is required for interpreter-based threads.
3404 *) case "$usemultiplicity" in
3405 $define|true|[yY]*) dflt='y';;
3409 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
3410 rp='Build Perl for multiplicity?'
3413 y|Y) val="$define" ;;
3422 case "$usemorebits" in
3423 "$define"|true|[yY]*)
3424 use64bitint="$define"
3425 uselongdouble="$define"
3426 usemorebits="$define"
3428 *) usemorebits="$undef"
3432 : make some quick guesses about what we are up against
3434 $echo $n "Hmm... $c"
3444 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
3445 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
3447 echo "Looks kind of like an OSF/1 system, but we'll see..."
3449 elif test `echo abc | $tr a-z A-Z` = Abc ; then
3450 xxx=`./loc addbib blurfl $pth`
3451 if $test -f $xxx; then
3452 echo "Looks kind of like a USG system with BSD features, but we'll see..."
3456 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
3457 echo "Looks kind of like an extended USG system, but we'll see..."
3459 echo "Looks kind of like a USG system, but we'll see..."
3463 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
3464 echo "Looks kind of like a BSD system, but we'll see..."
3468 echo "Looks kind of like a Version 7 system, but we'll see..."
3471 case "$eunicefix" in
3474 There is, however, a strange, musty smell in the air that reminds me of
3475 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
3479 : it so happens the Eunice I know will not run shell scripts in Unix format
3483 echo "Congratulations. You aren't running Eunice."
3487 : Detect OS2. The p_ variable is set above in the Head.U unit.
3488 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
3489 : semicolon as a patch separator
3494 I have the feeling something is not exactly right, however...don't tell me...
3495 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
3496 (Or you may be running DOS with DJGPP.)
3501 if test -f /xenix; then
3502 echo "Actually, this looks more like a XENIX system..."
3507 echo "It's not Xenix..."
3512 if test -f /venix; then
3513 echo "Actually, this looks more like a VENIX system..."
3520 echo "Nor is it Venix..."
3523 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3524 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3531 rp="Use which C compiler?"
3534 : Look for a hint-file generated 'call-back-unit'. Now that the
3535 : user has specified the compiler, we may need to set or change some
3537 if $test -f cc.cbu; then
3543 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3549 printf("%s\n", __VERSION__);
3551 printf("%s\n", "1");
3557 if $cc -o try $ccflags $ldflags try.c; then
3558 gccversion=`$run ./try`
3559 case "$gccversion" in
3560 '') echo "You are not using GNU cc." ;;
3561 *) echo "You are using GNU cc $gccversion."
3567 echo "*** WHOA THERE!!! ***" >&4
3568 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3569 case "$knowitall" in
3571 echo " You'd better start hunting for one and let me know about it." >&4
3577 case "$gccversion" in
3578 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3580 case "$gccversion" in
3581 '') gccosandvers='' ;;
3582 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
3583 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
3585 case "$gccosandvers" in
3586 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
3587 $osname$osvers) ;; # looking good
3588 $osname*) cat <<EOM >&4
3590 *** WHOA THERE!!! ***
3592 Your gcc has not been compiled for the exact release of
3593 your operating system ($gccosandvers versus $osname$osvers).
3595 In general it is a good idea to keep gcc synchronized with
3596 the operating system because otherwise serious problems
3597 may ensue when trying to compile software, like Perl.
3599 I'm trying to be optimistic here, though, and will continue.
3600 If later during the configuration and build icky compilation
3601 problems appear (headerfile conflicts being the most common
3602 manifestation), I suggest reinstalling the gcc to match
3603 your operating system release.
3607 *) gccosandvers='' ;; # failed to parse, better be silent
3616 : decide how portable to be. Allow command line overrides.
3617 case "$d_portable" in
3619 *) d_portable="$define" ;;
3622 : set up shell script to do ~ expansion
3628 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3631 if $test -f /bin/csh; then
3632 /bin/csh -f -c "glob \$1"
3637 name=\`$expr x\$1 : '..\([^/]*\)'\`
3638 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3639 if $test ! -d "\$dir"; then
3641 echo "\$me: can't locate home directory for: \$name" >&2
3646 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3662 : now set up to get a file name
3666 cat <<'EOSC' >>getfile
3682 expr $fn : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3683 fn=`echo $fn | sed 's/(.*)//'`
3689 loc_file=`expr $fn : '.*:\(.*\)'`
3690 fn=`expr $fn : '\(.*\):.*'`
3698 */*) fullpath=true;;
3707 *e*) exp_file=true;;
3710 *p*) nopath_ok=true;;
3715 *d*) type='Directory';;
3716 *l*) type='Locate';;
3721 Locate) what='File';;
3726 case "$d_portable" in
3734 while test "$type"; do
3739 true) rp="$rp (~name ok)";;
3742 if test -f UU/getfile.ok && \
3743 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3762 value=`UU/filexp $ans`
3765 if test "$ans" != "$value"; then
3766 echo "(That expands to $value on this system.)"
3780 /*) value="$ansexp" ;;
3781 [a-zA-Z]:/*) value="$ansexp" ;;
3786 echo "I shall only accept a full path name, as in /bin/ls." >&4
3787 echo "Use a ! shell escape if you wish to check pathnames." >&4
3790 echo "Please give a full path name, starting with slash." >&4
3793 echo "Note that using ~name is ok provided it expands well." >&4
3806 for fp in $gfpth; do
3807 if test "X$fp" = X.; then
3812 if test -f "$pf"; then
3814 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3816 echo "($value is not a plain file, but that's ok.)"
3819 if test X"$type" = X; then
3826 for fp in $gfpth; do
3827 if test "X$fp" = X.; then
3832 direxp="$fp/$ansexp"
3834 if test -d "$direxp"; then
3842 if test -d "$ansexp"; then
3843 echo "(Looking for $loc_file in directory $value.)"
3844 value="$value/$loc_file"
3845 ansexp="$ansexp/$loc_file"
3847 if test -f "$ansexp"; then
3850 case "$nopath_ok" in
3851 true) case "$value" in
3853 *) echo "Assuming $value will be in people's path."
3869 if test "$fastread" = yes; then
3874 rp="$what $value doesn't exist. Use that name anyway?"
3893 test "X$gfpthkeep" != Xy && gfpth=""
3896 : What should the include directory be ?
3898 $echo $n "Hmm... $c"
3902 if $test -f /bin/mips && /bin/mips; then
3903 echo "Looks like a MIPS system..."
3904 $cat >usr.c <<'EOCP'
3905 #ifdef SYSTYPE_BSD43
3909 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3910 dflt='/bsd43/usr/include'
3914 mips_type='System V'
3916 $rm -f usr.c usr.out
3917 echo "and you're compiling with the $mips_type compiler and libraries."
3921 echo "Doesn't look like a MIPS system."
3931 case "$xxx_prompt" in
3934 rp='Where are the include files you want to use?'
3942 : see how we invoke the C preprocessor
3944 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3945 cat <<'EOT' >testcpp.c
3951 if test ! -f cppstdin; then
3952 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
3953 # AIX cc -E doesn't show the absolute headerfile
3954 # locations but we'll cheat by using the -M flag.
3955 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
3957 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3960 echo "Keeping your $hint cppstdin wrapper."
3963 wrapper=`pwd`/cppstdin
3967 if $test "X$cppstdin" != "X" && \
3968 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3969 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3971 echo "You used to use $cppstdin $cppminus so we'll use that again."
3973 '') echo "But let's see if we can live without a wrapper..." ;;
3975 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3976 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3978 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3981 echo "(However, $cpprun $cpplast does not work, let's see...)"
3989 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3996 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3997 $cc -E <testcpp.c >testcpp.out 2>&1; \
3998 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3999 echo "Yup, it does."
4002 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4003 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4004 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4005 echo "Yup, it does."
4008 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4009 $cc -P <testcpp.c >testcpp.out 2>&1; \
4010 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4011 echo "Yipee, that works!"
4014 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4015 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4016 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4017 echo "At long last!"
4020 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4021 $cpp <testcpp.c >testcpp.out 2>&1; \
4022 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4026 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4027 $cpp - <testcpp.c >testcpp.out 2>&1; \
4028 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4029 echo "Hooray, it works! I was beginning to wonder."
4032 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4033 $wrapper <testcpp.c >testcpp.out 2>&1; \
4034 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4040 rp="No dice. I can't find a C preprocessor. Name one:"
4044 $x_cpp <testcpp.c >testcpp.out 2>&1
4045 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4046 echo "OK, that will do." >&4
4048 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4063 echo "Perhaps can we force $cc -E using a wrapper..."
4064 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4065 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4071 echo "Nope, we'll have to live without it..."
4085 "$wrapper"|'cppstdin') ;;
4086 *) $rm -f $wrapper;;
4088 $rm -f testcpp.c testcpp.out
4090 : Set private lib path
4093 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4098 '') dlist="$loclibpth $plibpth $glibpth";;
4099 *) dlist="$libpth";;
4102 : Now check and see which directories actually exist, avoiding duplicates
4106 if $test -d $xxx; then
4109 *) libpth="$libpth $xxx";;
4115 Some systems have incompatible or broken versions of libraries. Among
4116 the directories listed in the question below, please remove any you
4117 know not to be holding relevant libraries, and add any that are needed.
4118 Say "none" for none.
4129 rp="Directories to use for library searches?"
4136 : compute shared library extension
4139 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4149 On some systems, shared libraries may be available. Answer 'none' if
4150 you want to suppress searching of shared libraries for the remainder
4151 of this configuration.
4154 rp='What is the file extension used for shared libraries?'
4158 : Define several unixisms.
4159 : Hints files or command line option can be used to override them.
4160 : The convoluted testing is in case hints files set either the old
4163 '') case "$exe_ext" in
4165 *) _exe="$exe_ext" ;;
4170 '') case "$lib_ext" in
4177 '') case "$obj_ext" in
4184 '') case "$path_sep" in
4195 : Which makefile gets called first. This is used by make depend.
4196 case "$firstmakefile" in
4197 '') firstmakefile='makefile';;
4201 $define|true|[yY]*) dflt='y';;
4206 Perl can be built to use the SOCKS proxy protocol library. To do so,
4207 Configure must be run with -Dusesocks. If you use SOCKS you also need
4208 to use the PerlIO abstraction layer, this will be implicitly selected.
4210 If this doesn't make any sense to you, just accept the default '$dflt'.
4212 rp='Build Perl for SOCKS?'
4215 y|Y) val="$define" ;;
4222 $define|true|[yY]*) useperlio="$define";;
4225 : Looking for optional libraries
4227 echo "Checking for optional libraries..." >&4
4232 case "$libswanted" in
4233 '') libswanted='c_s';;
4236 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4242 for thisdir in $libpth $xlibpth; do
4243 test -d $thisdir && libspath="$libspath $thisdir"
4245 for thislib in $libswanted; do
4246 for thisdir in $libspath; do
4248 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4249 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|tail -1`
4250 $test -f "$xxx" && eval $libscheck
4251 $test -f "$xxx" && libstyle=shared
4253 if test ! -f "$xxx"; then
4254 xxx=$thisdir/lib$thislib.$so
4255 $test -f "$xxx" && eval $libscheck
4256 $test -f "$xxx" && libstyle=shared
4258 if test ! -f "$xxx"; then
4259 xxx=$thisdir/lib$thislib$_a
4260 $test -f "$xxx" && eval $libscheck
4261 $test -f "$xxx" && libstyle=static
4263 if test ! -f "$xxx"; then
4264 xxx=$thisdir/$thislib$_a
4265 $test -f "$xxx" && eval $libscheck
4266 $test -f "$xxx" && libstyle=static
4268 if test ! -f "$xxx"; then
4269 xxx=$thisdir/lib${thislib}_s$_a
4270 $test -f "$xxx" && eval $libscheck
4271 $test -f "$xxx" && libstyle=static
4272 $test -f "$xxx" && thislib=${thislib}_s
4274 if test ! -f "$xxx"; then
4275 xxx=$thisdir/Slib$thislib$_a
4276 $test -f "$xxx" && eval $libscheck
4277 $test -f "$xxx" && libstyle=static
4279 if $test -f "$xxx"; then
4281 shared) echo "Found -l$thislib (shared)." ;;
4282 static) echo "Found -l$thislib." ;;
4283 *) echo "Found -l$thislib ($libstyle)." ;;
4287 *) dflt="$dflt -l$thislib"
4288 libsfound="$libsfound $xxx"
4290 libsfiles="$libsfiles $yyy"
4291 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4292 case " $libsdirs " in
4294 *) libsdirs="$libsdirs $yyy" ;;
4301 if $test ! -f "$xxx"; then
4302 echo "No -l$thislib."
4313 ' '|'') dflt='none';;
4318 In order to compile $package on your machine, a number of libraries
4319 are usually needed. Include any other special libraries here as well.
4320 Say "none" for none. The default list is almost always right.
4324 rp="What libraries to use?"
4331 : determine optimization, if desired, or use for debug flag also
4333 ' '|$undef) dflt='none';;
4335 *) dflt="$optimize";;
4339 By default, $package compiles with the -O flag to use the optimizer.
4340 Alternately, you might want to use the symbolic debugger, which uses
4341 the -g flag (on traditional Unix systems). Either flag can be
4342 specified here. To use neither flag, specify the word "none".
4345 rp="What optimizer/debugger flag should be used?"
4349 'none') optimize=" ";;
4353 : We will not override a previous value, but we might want to
4354 : augment a hint file
4356 default|recommended)
4357 case "$gccversion" in
4358 1*) dflt='-fpcc-struct-return' ;;
4361 *-g*) dflt="$dflt -DDEBUGGING";;
4363 case "$gccversion" in
4364 2*) if test -d /etc/conf/kconfig.d &&
4365 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4371 case "$gccversion" in
4375 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
4376 echo 'int main(void) { return 0; }' > gcctest.c
4377 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
4378 echo "Yes, it does." 2>&1
4381 echo "Leaving current flags $ccflags alone." 2>&1
4383 *) dflt="$dflt -fno-strict-aliasing" ;;
4386 echo "Nope, it doesn't, but that's ok." 2>&1
4393 case "$mips_type" in
4394 *BSD*|'') inclwanted="$locincpth $usrinc";;
4395 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4397 for thisincl in $inclwanted; do
4398 if $test -d $thisincl; then
4399 if $test x$thisincl != x$usrinc; then
4401 *" -I$thisincl "*);;
4402 *) dflt="$dflt -I$thisincl ";;
4408 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4410 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4418 *) dflt="$dflt -D$2";;
4422 set signal.h LANGUAGE_C; eval $inctest
4426 ccflags="$ccflags -DSOCKS"
4431 default|recommended) dflt="$ccflags $dflt" ;;
4432 *) dflt="$ccflags";;
4441 Your C compiler may want other flags. For this question you should include
4442 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4443 but you should NOT include libraries or ld flags like -lwhatever. If you
4444 want $package to honor its debug switch, you should include -DDEBUGGING here.
4445 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4447 To use no flags, specify the word "none".
4453 rp="Any additional cc flags?"
4460 : the following weeds options from ccflags that are of no interest to cpp
4462 '') cppflags="$ccflags" ;;
4463 *) cppflags="$cppflags $ccflags" ;;
4465 case "$gccversion" in
4466 1*) cppflags="$cppflags -D__GNUC__"
4468 case "$mips_type" in
4470 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4476 echo "Let me guess what the preprocessor flags are..." >&4
4490 *) ftry="$previous $flag";;
4492 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4493 >cpp1.out 2>/dev/null && \
4494 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4495 >cpp2.out 2>/dev/null && \
4496 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4497 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4499 cppflags="$cppflags $ftry"
4509 *-*) echo "They appear to be: $cppflags";;
4511 $rm -f cpp.c cpp?.out
4515 : flags used in final linking phase
4517 '') if ./venix; then
4523 *-posix*) dflt="$dflt -posix" ;;
4526 *) dflt="$ldflags";;
4529 : Try to guess additional flags to pick up local libraries.
4530 for thislibdir in $libpth; do
4531 case " $loclibpth " in
4534 *"-L$thislibdir "*) ;;
4535 *) dflt="$dflt -L$thislibdir" ;;
4547 Your C linker may need flags. For this question you should
4548 include -L/whatever and any other flags used by the C linker, but you
4549 should NOT include libraries like -lwhatever.
4551 Make sure you include the appropriate -L/path flags if your C linker
4552 does not normally search all of the directories you specified above,
4555 To use no flags, specify the word "none".
4559 rp="Any additional ld flags (NOT including libraries)?"
4565 rmlist="$rmlist pdp11"
4569 echo "Checking your choice of C compiler and flags for coherency..." >&4
4570 $cat > try.c <<'EOF'
4572 int main() { printf("Ok\n"); exit(0); }
4574 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
4576 $cat >try.msg <<'EOM'
4577 I've tried to compile and run the following simple program:
4580 $cat try.c >> try.msg
4582 $cat >> try.msg <<EOM
4589 and I got the following output:
4593 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
4594 if $sh -c "$run ./try" >>try.msg 2>&1; then
4598 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4601 cat >> try.msg <<'EOQS'
4602 If $libs contains -lsfio, and sfio is mis-configured, then it
4603 sometimes (apparently) runs and exits with a 0 status, but with no
4604 output! It may have to do with sfio's use of _exit vs. exit.
4607 rp="You have a big problem. Shall I abort Configure"
4614 echo "The program compiled OK, but exited with status $?." >>try.msg
4615 rp="You have a problem. Shall I abort Configure"
4619 echo "I can't compile the test program." >>try.msg
4620 rp="You have a BIG problem. Shall I abort Configure"
4626 case "$knowitall" in
4628 echo "(The supplied flags or libraries might be incorrect.)"
4636 *) echo "Ok. Stopping Configure." >&4
4641 n) echo "OK, that should do.";;
4643 $rm -f try try.* core
4645 : define a shorthand compile call
4649 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
4650 : define a shorthand compile call for compilations that should be ok.
4654 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
4656 : check for lengths of integral types
4660 echo "Checking to see how big your integers are..." >&4
4661 $cat >try.c <<'EOCP'
4665 printf("intsize=%d;\n", (int)sizeof(int));
4666 printf("longsize=%d;\n", (int)sizeof(long));
4667 printf("shortsize=%d;\n", (int)sizeof(short));
4672 if eval $compile_ok && $run ./try > /dev/null; then
4674 echo "Your integers are $intsize bytes long."
4675 echo "Your long integers are $longsize bytes long."
4676 echo "Your short integers are $shortsize bytes long."
4680 Help! I can't compile and run the intsize test program: please enlighten me!
4681 (This is probably a misconfiguration in your system or libraries, and
4682 you really ought to fix it. Still, I'll try anyway.)
4686 rp="What is the size of an integer (in bytes)?"
4690 rp="What is the size of a long integer (in bytes)?"
4694 rp="What is the size of a short integer (in bytes)?"
4702 : check for void type
4704 echo "Checking to see how well your C compiler groks the void type..." >&4
4705 case "$voidflags" in
4707 $cat >try.c <<'EOCP'
4713 extern void moo(); /* function returning void */
4714 void (*goo)(); /* ptr to func returning void */
4716 void *hue; /* generic ptr */
4729 int main() { sub(); }
4731 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
4732 voidflags=$defvoidused
4733 echo "Good. It appears to support void to the level $package wants.">&4
4734 if $contains warning .out >/dev/null 2>&1; then
4735 echo "However, you might get some warnings that look like this:"
4739 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
4740 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
4741 echo "It supports 1..."
4742 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
4743 echo "It also supports 2..."
4744 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
4746 echo "And it supports 4 but not 8 definitely."
4748 echo "It doesn't support 4..."
4749 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
4751 echo "But it supports 8."
4754 echo "Neither does it support 8."
4758 echo "It does not support 2..."
4759 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
4761 echo "But it supports 4 and 8."
4763 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
4765 echo "And it supports 4 but has not heard about 8."
4767 echo "However it supports 8 but not 4."
4772 echo "There is no support at all for void."
4777 case "$voidflags" in
4780 Support flag bits are:
4781 1: basic void declarations.
4782 2: arrays of pointers to functions returning void.
4783 4: operations between pointers to and addresses of void functions.
4784 8: generic void pointers.
4787 rp="Your void support flags add up to what?"
4794 : check for length of pointer
4798 echo "Checking to see how big your pointers are..." >&4
4799 if test "$voidflags" -gt 7; then
4800 echo '#define VOID_PTR char *' > try.c
4802 echo '#define VOID_PTR void *' > try.c
4804 $cat >>try.c <<'EOCP'
4808 printf("%d\n", (int)sizeof(VOID_PTR));
4813 if eval $compile_ok; then
4814 ptrsize=`$run ./try`
4815 echo "Your pointers are $ptrsize bytes long."
4818 echo "(I can't seem to compile the test program. Guessing...)" >&4
4819 rp="What is the size of a pointer (in bytes)?"
4827 : check for long long
4829 echo "Checking to see if you have long long..." >&4
4830 echo 'int main() { long long x = 7; return 0; }' > try.c
4832 if eval $compile; then
4834 echo "You have long long."
4837 echo "You do not have long long."
4843 : check for length of long long
4844 case "${d_longlong}${longlongsize}" in
4847 echo "Checking to see how big your long longs are..." >&4
4848 $cat >try.c <<'EOCP'
4852 printf("%d\n", (int)sizeof(long long));
4857 if eval $compile_ok; then
4858 longlongsize=`$run ./try`
4859 echo "Your long longs are $longlongsize bytes long."
4863 echo "(I can't seem to compile the test program. Guessing...)"
4864 rp="What is the size of a long long (in bytes)?"
4868 if $test "X$longsize" = "X$longlongsize"; then
4869 echo "(That isn't any different from an ordinary long.)"
4875 : determine filename position in cpp output
4877 echo "Computing filename position in cpp output for #include directives..." >&4
4879 vos) testaccess=-e ;;
4882 echo '#include <stdio.h>' > foo.c
4885 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
4886 $grep '^[ ]*#.*stdio\.h' | \
4887 while read cline; do
4890 while $test \$# -gt 0; do
4891 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
4896 pos=\`expr \$pos + 1\`
4908 *) pos="${fieldn}th";;
4910 echo "Your cpp writes the filename in the $pos field of the line."
4913 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
4916 : locate header file
4921 for usrincdir in $usrinc
4923 if test -f \$usrincdir/\$wanted; then
4924 echo "\$usrincdir/\$wanted"
4928 awkprg='{ print \$$fieldn }'
4929 echo "#include <\$wanted>" > foo\$\$.c
4930 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
4931 $cppfilter $grep "^[ ]*#.*\$wanted" | \
4932 while read cline; do
4933 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
4935 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
4936 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
4941 # status = 0: grep returned 0 lines, case statement not executed
4942 # status = 1: headerfile found
4943 # status = 2: while loop executed, no headerfile found
4947 if test \$status -eq 1; then
4954 : define an alternate in-header-list? function
4955 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
4956 cont=true; xxf="echo \"<\$1> found.\" >&4";
4957 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
4958 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
4960 case $# in 4) instead=instead;; *) instead="at last";; esac;
4961 while $test "$cont"; do
4963 var=$2; eval "was=\$$2";
4964 if $test "$xxx" && $test -r "$xxx";
4966 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
4969 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
4970 set $yyy; shift; shift; yyy=$@;
4971 case $# in 0) cont="";;
4972 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
4973 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
4974 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
4975 xxnf="echo \"there is no <\$1>, ...\" >&4";;
4979 do set $yyy; var=$2; eval "was=\$$2";
4980 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
4981 set $yyy; shift; shift; yyy=$@;
4984 : see if inttypes.h is available
4985 : we want a real compile instead of Inhdr because some systems
4986 : have an inttypes.h which includes non-existent headers
4989 #include <inttypes.h>
4991 static int32_t foo32 = 0x12345678;
4995 if eval $compile; then
4996 echo "<inttypes.h> found." >&4
4999 echo "<inttypes.h> NOT found." >&4
5008 echo "Checking to see if you have int64_t..." >&4
5010 #include <sys/types.h>
5011 #$i_inttypes I_INTTYPES
5013 #include <inttypes.h>
5015 int main() { int64_t x = 7; }
5018 if eval $compile; then
5020 echo "You have int64_t."
5023 echo "You do not have int64_t."
5031 echo "Checking which 64-bit integer type we could use..." >&4
5037 val='"unsigned int"'
5042 *) case "$longsize" in
5046 val='"unsigned long"'
5051 *) case "$d_longlong:$longlongsize" in
5056 val='"unsigned long long"'
5061 *) case "$d_int64_t" in
5080 '') echo "Alas, no 64-bit integer types in sight." >&4
5083 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5089 case "$uselonglong" in
5090 "$define"|true|[yY]*)
5093 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5095 use64bitint="$define"
5098 case "$use64bits" in
5099 "$define"|true|[yY]*)
5102 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5104 use64bitint="$define"
5107 case "$use64bitints" in
5108 "$define"|true|[yY]*)
5111 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5113 use64bitint="$define"
5116 case "$use64bitsint" in
5117 "$define"|true|[yY]*)
5120 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5122 use64bitint="$define"
5125 case "$uselonglongs" in
5126 "$define"|true|[yY]*)
5129 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5131 use64bitint="$define"
5134 case "$use64bitsall" in
5135 "$define"|true|[yY]*)
5138 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5140 use64bitall="$define"
5145 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5147 case "$use64bitall" in
5148 "$define"|true|[yY]*) use64bitint="$define" ;;
5154 You have natively 64-bit long integers.
5158 *) case "$use64bitint" in
5159 "$define"|true|[yY]*) dflt='y';;
5168 Perl can be built to take advantage of 64-bit integer types
5169 on some systems. To do so, Configure can be run with -Duse64bitint.
5170 Choosing this option will most probably introduce binary incompatibilities.
5172 If this doesn't make any sense to you, just accept the default '$dflt'.
5173 (The default has been chosen based on your configuration.)
5175 rp='Try to use 64-bit integers, if available?'
5178 [yY]*) val="$define" ;;
5186 case "$use64bitall" in
5187 "$define"|true|[yY]*) dflt='y' ;;
5188 *) case "$longsize" in
5196 You may also choose to try maximal 64-bitness. It means using as much
5197 64-bitness as possible on the platform. This in turn means even more
5198 binary incompatibilities. On the other hand, your platform may not
5199 have any more 64-bitness available than what you already have chosen.
5201 If this doesn't make any sense to you, just accept the default '$dflt'.
5202 (The default has been chosen based on your configuration.)
5204 rp='Try to use maximal 64-bit support, if available?'
5207 [yY]*) val="$define" ;;
5212 case "$use64bitall" in
5214 case "$use64bitint" in
5218 Since you have chosen a maximally 64-bit build, I'm also turning on
5219 the use of 64-bit integers.
5221 use64bitint="$define" ;;
5226 case "$use64bitall" in
5227 "$define"|true|[yY]*)
5231 *** You have chosen a maximally 64-bit build, but your pointers
5232 *** are only 4 bytes wide, disabling maximal 64-bitness.
5235 use64bitall="$undef"
5236 case "$use64bitint" in
5237 "$define"|true|[yY]*) ;;
5240 *** Downgrading from maximal 64-bitness to using 64-bit integers.
5243 use64bitint="$define"
5251 case "$use64bitint" in
5252 "$define"|true|[yY]*)
5253 : Look for a hint-file generated 'call-back-unit'. If the
5254 : user has specified that a 64-bit perl is to be built,
5255 : we may need to set or change some other defaults.
5256 if $test -f use64bitint.cbu; then
5257 echo "Your platform has some specific hints for 64-bit integers, using them..."
5261 4) case "$archname64" in
5262 '') archname64=64int ;;
5269 case "$use64bitall" in
5270 "$define"|true|[yY]*)
5271 : Look for a hint-file generated 'call-back-unit'. If the
5272 : user has specified that a maximally 64-bit perl is to be built,
5273 : we may need to set or change some other defaults.
5274 if $test -f use64bitall.cbu; then
5275 echo "Your platform has some specific hints for 64-bit builds, using them..."
5279 4) case "$archname64" in
5280 ''|64int) archname64=64all ;;
5288 echo "Checking for GNU C Library..." >&4
5301 if eval $compile_ok && $run ./try; then
5303 echo "You are using the GNU C Library"
5306 echo "You are not using the GNU C Library"
5312 : see if nm is to be used to determine whether a symbol is defined or not
5316 case "$d_gnulibc" in
5319 echo "nm probably won't work on the GNU C Library." >&4
5325 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
5327 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
5328 echo "'nm' won't be sufficient on this sytem." >&4
5334 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
5335 if $test $dflt -gt 20; then
5345 true|$define) dflt=y;;
5352 I can use $nm to extract the symbols from your C libraries. This
5353 is a time consuming task which may generate huge output on the disk (up
5354 to 3 megabytes) but that should make the symbols extraction faster. The
5355 alternative is to skip the 'nm' extraction part and to compile a small
5356 test program instead to determine whether each symbol is present. If
5357 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
5358 this may be the best solution.
5360 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
5363 rp="Shall I use $nm to extract C symbols from the libraries?"
5366 [Nn]*) usenm=false;;
5375 : nm options which may be necessary
5377 '') if $test -f /mach_boot; then
5379 elif $test -d /usr/ccs/lib; then
5380 nm_opt='-p' # Solaris (and SunOS?)
5381 elif $test -f /dgux; then
5383 elif $test -f /lib64/rld; then
5384 nm_opt='-p' # 64-bit Irix
5390 : nm options which may be necessary for shared libraries but illegal
5391 : for archive libraries. Thank you, Linux.
5392 case "$nm_so_opt" in
5393 '') case "$myuname" in
5395 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
5396 nm_so_opt='--dynamic'
5405 : get list of predefined functions in a handy place
5410 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
5416 *) for thislib in $libs; do
5419 : Handle C library specially below.
5422 thislib=`echo $thislib | $sed -e 's/^-l//'`
5423 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
5425 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
5427 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
5429 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
5431 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
5433 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
5435 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
5440 libnames="$libnames $try"
5442 *) libnames="$libnames $thislib" ;;
5451 for xxx in $libpth; do
5452 $test -r $1 || set $xxx/libc.$so
5453 : The messy sed command sorts on library version numbers.
5455 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
5456 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
5458 s/[0-9][0-9]*/0000&/g
5459 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
5462 $sort | $sed -e 's/^.* //'`
5465 $test -r $1 || set /usr/ccs/lib/libc.$so
5466 $test -r $1 || set /lib/libsys_s$_a
5472 if $test -r "$1"; then
5473 echo "Your (shared) C library seems to be in $1."
5475 elif $test -r /lib/libc && $test -r /lib/clib; then
5476 echo "Your C library seems to be in both /lib/clib and /lib/libc."
5478 libc='/lib/clib /lib/libc'
5479 if $test -r /lib/syslib; then
5480 echo "(Your math library is in /lib/syslib.)"
5481 libc="$libc /lib/syslib"
5483 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5484 echo "Your C library seems to be in $libc, as you said before."
5485 elif $test -r $incpath/usr/lib/libc$_a; then
5486 libc=$incpath/usr/lib/libc$_a;
5487 echo "Your C library seems to be in $libc. That's fine."
5488 elif $test -r /lib/libc$_a; then
5490 echo "Your C library seems to be in $libc. You're normal."
5492 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
5494 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
5495 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
5496 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
5498 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5500 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5503 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
5505 if $test -r "$tans"; then
5506 echo "Your C library seems to be in $tans, of all places."
5512 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5516 If the guess above is wrong (which it might be if you're using a strange
5517 compiler, or your machine supports multiple models), you can override it here.
5522 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
5524 I can't seem to find your C library. I've looked in the following places:
5527 $sed 's/^/ /' libpath
5530 None of these seems to contain your C library. I need to get its name...
5535 rp='Where is your C library?'
5540 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
5541 set X `cat libnames`
5544 case $# in 1) xxx=file; esac
5545 echo "Extracting names from the following $xxx for later perusal:" >&4
5547 $sed 's/^/ /' libnames >&4
5549 $echo $n "This may take a while...$c" >&4
5553 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
5554 *) $nm $nm_opt $file 2>/dev/null;;
5559 $grep fprintf libc.tmp > libc.ptf
5560 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
5561 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
5563 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
5565 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5567 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
5569 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5571 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
5573 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5575 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
5577 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5579 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
5581 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5583 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
5585 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5587 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
5588 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
5590 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5592 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
5594 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5596 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
5598 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5600 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
5602 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5604 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
5606 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5608 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
5610 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5612 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
5614 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5616 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
5618 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5621 $nm -p $* 2>/dev/null >libc.tmp
5622 $grep fprintf libc.tmp > libc.ptf
5623 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
5624 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
5630 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
5632 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
5633 for thisname in $libnames $libc; do
5634 $ar t $thisname >>libc.tmp
5636 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
5638 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
5639 # Repeat libc to extract forwarders to DLL entries too
5640 for thisname in $libnames $libc; do
5641 $ar tv $thisname >>libc.tmp
5642 # Revision 50 of EMX has bug in $ar.
5643 # it will not extract forwarders to DLL entries
5644 # Use emximp which will extract exactly them.
5645 emximp -o tmp.imp $thisname \
5647 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
5648 < tmp.imp >>libc.tmp
5651 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
5654 echo "$ar didn't seem to work right." >&4
5655 echo "Maybe this is a Cray...trying bld instead..." >&4
5656 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
5658 for thisname in $libnames; do
5660 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
5661 $ar t $thisname >>libc.tmp
5665 echo "That didn't work either. Giving up." >&4
5672 if $test -f /lib/syscalls.exp; then
5674 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
5675 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' /lib/syscalls.exp >>libc.list
5679 $rm -f libnames libpath
5681 : is a C symbol defined?
5684 -v) tf=libc.tmp; tc=""; tdc="";;
5685 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
5686 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
5689 case "$reuseval-$4" in
5691 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
5697 if $contains $tlook $tf >/dev/null 2>&1;
5702 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
5703 if $cc -o t $optimize $ccflags $ldflags t.c $libs >/dev/null 2>&1;
5711 $define) tval=true;;
5717 : define an is-in-libc? function
5718 inlibc='echo " "; td=$define; tu=$undef;
5719 sym=$1; var=$2; eval "was=\$$2";
5721 case "$reuseval$was" in
5731 echo "$sym() found." >&4;
5732 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
5734 echo "$sym() NOT found." >&4;
5735 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
5739 $define) echo "$sym() found." >&4;;
5740 *) echo "$sym() NOT found." >&4;;
5744 : see if sqrtl exists
5749 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
5752 case "$uselongdouble" in
5753 $define|true|[yY]*) dflt='y';;
5758 Perl can be built to take advantage of long doubles which
5759 (if available) may give more accuracy and range for floating point numbers.
5761 If this doesn't make any sense to you, just accept the default '$dflt'.
5763 rp='Try to use long doubles if available?'
5766 y|Y) val="$define" ;;
5772 case "$uselongdouble" in
5773 true|[yY]*) uselongdouble="$define" ;;
5776 case "$uselongdouble" in
5778 : Look for a hint-file generated 'call-back-unit'. If the
5779 : user has specified that long doubles should be used,
5780 : we may need to set or change some other defaults.
5781 if $test -f uselongdouble.cbu; then
5782 echo "Your platform has some specific hints for long doubles, using them..."
5783 . ./uselongdouble.cbu
5786 (Your platform doesn't have any specific hints for long doubles.)
5792 case "$uselongdouble:$d_sqrtl" in
5796 *** You requested the use of long doubles but you do not seem to have
5797 *** the mathematic functions for long doubles. I'm disabling the use
5798 *** of long doubles.
5801 uselongdouble=$undef
5805 : check for length of double
5807 case "$doublesize" in
5809 echo "Checking to see how big your double precision numbers are..." >&4
5810 $cat >try.c <<'EOCP'
5814 printf("%d\n", (int)sizeof(double));
5819 if eval $compile_ok; then
5820 doublesize=`$run ./try`
5821 echo "Your double is $doublesize bytes long."
5824 echo "(I can't seem to compile the test program. Guessing...)"
5825 rp="What is the size of a double precision number (in bytes)?"
5833 : check for long doubles
5835 echo "Checking to see if you have long double..." >&4
5836 echo 'int main() { long double x = 7.0; }' > try.c
5838 if eval $compile; then
5840 echo "You have long double."
5843 echo "You do not have long double."
5849 : check for length of long double
5850 case "${d_longdbl}${longdblsize}" in
5853 echo "Checking to see how big your long doubles are..." >&4
5854 $cat >try.c <<'EOCP'
5858 printf("%d\n", sizeof(long double));
5863 if eval $compile; then
5864 longdblsize=`$run ./try`
5865 echo "Your long doubles are $longdblsize bytes long."
5869 echo "(I can't seem to compile the test program. Guessing...)" >&4
5870 rp="What is the size of a long double (in bytes)?"
5874 if $test "X$doublesize" = "X$longdblsize"; then
5875 echo "(That isn't any different from an ordinary double.)"
5881 case "$useperlio" in
5882 $define|true|[yY]*|'') dflt='y';;
5887 Previous version of $package used the standard IO mechanisms as
5888 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
5889 alternate IO mechanisms via the PerlIO abstraction layer, but the
5890 stdio mechanism is still available if needed. The abstraction layer
5891 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
5892 Using PerlIO with sfio may cause problems with some extension modules.
5894 If this doesn't make any sense to you, just accept the default '$dflt'.
5896 rp='Use the PerlIO abstraction layer?'
5903 echo "Ok, doing things the stdio way."
5912 case "$useperlio" in
5913 $define|true|[yY]*) ;;
5916 You are using the SOCKS proxy protocol library which means that you
5917 should also use the PerlIO layer. You may be headed for trouble.
5926 : determine the architecture name
5928 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5929 tarch=`arch`"-$osname"
5930 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5931 if uname -m > tmparch 2>&1 ; then
5932 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5933 -e 's/$/'"-$osname/" tmparch`
5941 case "$myarchname" in
5944 echo "(Your architecture name used to be $myarchname.)"
5948 case "$targetarch" in
5950 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
5955 *) dflt="$archname";;
5957 rp='What is your architecture name'
5960 case "$usethreads" in
5962 echo "Threads selected." >&4
5964 *-thread*) echo "...and architecture name already has -thread." >&4
5966 *) archname="$archname-thread"
5967 echo "...setting architecture name to $archname." >&4
5972 case "$usemultiplicity" in
5974 echo "Multiplicity selected." >&4
5976 *-multi*) echo "...and architecture name already has -multi." >&4
5978 *) archname="$archname-multi"
5979 echo "...setting architecture name to $archname." >&4
5984 case "$use64bitint$use64bitall" in
5986 case "$archname64" in
5988 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
5991 case "$use64bitint" in
5992 "$define") echo "64 bit integers selected." >&4 ;;
5994 case "$use64bitall" in
5995 "$define") echo "Maximal 64 bitness selected." >&4 ;;
5998 *-$archname64*) echo "...and architecture name already has $archname64." >&4
6000 *) archname="$archname-$archname64"
6001 echo "...setting architecture name to $archname." >&4
6007 case "$uselongdouble" in
6009 echo "Long doubles selected." >&4
6010 case "$longdblsize" in
6012 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
6016 *-ld*) echo "...and architecture name already has -ld." >&4
6018 *) archname="$archname-ld"
6019 echo "...setting architecture name to $archname." >&4
6026 case "$useperlio" in
6028 echo "Perlio selected." >&4
6031 echo "Perlio not selected, using stdio." >&4
6033 *-stdio*) echo "...and architecture name already has -stdio." >&4
6035 *) archname="$archname-stdio"
6036 echo "...setting architecture name to $archname." >&4
6042 : determine root of directory hierarchy where package will be installed.
6045 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
6053 By default, $package will be installed in $dflt/bin, manual pages
6054 under $dflt/man, etc..., i.e. with $dflt as prefix for all
6055 installation directories. Typically this is something like /usr/local.
6056 If you wish to have binaries under /usr/bin but other parts of the
6057 installation under /usr/local, that's ok: you will be prompted
6058 separately for each of the installation directories, the prefix being
6059 only used to set the defaults.
6063 rp='Installation prefix to use?'
6071 *) oldprefix="$prefix";;
6080 *) afsroot=$afsroot ;;
6086 $define|true) afs=true ;;
6087 $undef|false) afs=false ;;
6088 *) if test -d $afsroot; then
6096 echo "AFS may be running... I'll be extra cautious then..." >&4
6098 echo "AFS does not seem to be running..." >&4
6101 : determine installation prefix for where package is to be installed.
6105 Since you are running AFS, I need to distinguish the directory in which
6106 files will reside from the directory in which they are installed (and from
6107 which they are presumably copied to the former directory by occult means).
6110 case "$installprefix" in
6111 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
6112 *) dflt="$installprefix";;
6117 In some special cases, particularly when building $package for distribution,
6118 it is convenient to distinguish between the directory in which files should
6119 be installed from the directory ($prefix) in which they
6120 will eventually reside. For most users, these two directories are the same.
6123 case "$installprefix" in
6125 *) dflt=$installprefix;;
6129 rp='What installation prefix should I use for installing files?'
6131 installprefix="$ans"
6132 installprefixexp="$ansexp"
6134 : set the prefixit variable, to compute a suitable default value
6135 prefixit='case "$3" in
6137 case "$oldprefix" in
6138 "") eval "$1=\"\$$2\"";;
6145 ""|" ") eval "$1=\"\$$2\"";;
6151 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6153 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6154 /*-$oldprefix/*|\~*-$oldprefix/*)
6155 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6156 *) eval "$1=\"\$$2\"";;
6160 : get the patchlevel
6162 echo "Getting the current patchlevel..." >&4
6163 if $test -r $rsrc/patchlevel.h;then
6164 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
6165 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
6166 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
6167 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
6168 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
6169 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
6170 perl_patchlevel=`grep ',"DEVEL[0-9][0-9]*"' $rsrc/patchlevel.h|sed 's/[^0-9]//g'`
6179 $echo "(You do not have patchlevel.h. Eek.)"
6181 if $test -r $rsrc/.patch ; then
6182 if $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
6183 perl_patchlevel=`cat $rsrc/.patch`
6186 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
6187 version_patchlevel_string="version $patchlevel subversion $subversion"
6188 case "$perl_patchlevel" in
6190 *) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;;
6193 $echo "(You have $package $version_patchlevel_string.)"
6197 : XXX Should be a Configure test for double-dots in filenames.
6198 version=`echo $revision $patchlevel $subversion | \
6199 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
6200 api_versionstring=`echo $api_revision $api_version $api_subversion | \
6201 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
6204 version=`echo $revision $patchlevel $subversion | \
6205 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
6206 api_versionstring=`echo $api_revision $api_version $api_subversion | \
6207 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
6210 : Special case the 5.005_xx maintenance series, which used 5.005
6211 : without any subversion label as a subdirectory in $sitelib
6212 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
6213 api_versionstring='5.005'
6216 : determine installation style
6217 : For now, try to deduce it from prefix unless it is already set.
6218 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6219 case "$installstyle" in
6220 '') case "$prefix" in
6221 *perl*) dflt='lib';;
6222 *) dflt='lib/perl5' ;;
6225 *) dflt="$installstyle" ;;
6227 : Probably not worth prompting for this since we prompt for all
6228 : the directories individually, and the prompt would be too long and
6232 : determine where private library files go
6233 : Usual default is /usr/local/lib/perl5/$version.
6234 : Also allow things like /opt/perl/lib/$version, since
6235 : /opt/perl/lib/perl5... would be redundant.
6236 : The default "style" setting is made in installstyle.U
6237 case "$installstyle" in
6238 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6239 *) set dflt privlib lib/$version ;;
6244 There are some auxiliary files for $package that need to be put into a
6245 private library directory that is accessible by everyone.
6249 rp='Pathname where the private library files will reside?'
6252 privlibexp="$ansexp"
6253 : Change installation prefix, if necessary.
6254 if $test X"$prefix" != X"$installprefix"; then
6255 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
6257 installprivlib="$privlibexp"
6260 : set the prefixup variable, to restore leading tilda escape
6261 prefixup='case "$prefixexp" in
6263 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6266 : determine where public architecture dependent libraries go
6269 : privlib default is /usr/local/lib/$package/$version
6270 : archlib default is /usr/local/lib/$package/$version/$archname
6271 : privlib may have an optional trailing /share.
6272 tdflt=`echo $privlib | $sed 's,/share$,,'`
6273 tdflt=$tdflt/$archname
6282 $spackage contains architecture-dependent library files. If you are
6283 sharing libraries in a heterogeneous environment, you might store
6284 these files in a separate location. Otherwise, you can just include
6285 them with the rest of the public library files.
6289 rp='Where do you want to put the public architecture-dependent libraries?'
6292 archlibexp="$ansexp"
6293 if $test X"$archlib" = X"$privlib"; then
6298 : Change installation prefix, if necessary.
6299 if $test X"$prefix" != X"$installprefix"; then
6300 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
6302 installarchlib="$archlibexp"
6306 : Binary compatibility with 5.005 is not possible for builds
6307 : with advanced features
6308 case "$usethreads$usemultiplicity" in
6310 bincompat5005="$undef"
6311 d_bincompat5005="$undef"
6315 This version of Perl can be compiled for binary compatibility with 5.005.
6316 If you decide to do so, you will be able to continue using most of the
6317 extensions that were compiled for Perl 5.005.
6320 case "$bincompat5005$d_bincompat5005" in
6321 *"$undef"*) dflt=n ;;
6324 rp='Binary compatibility with Perl 5.005?'
6327 y*) val="$define" ;;
6332 case "$d_bincompat5005" in
6334 bincompat5005="$define"
6336 *) bincompat5005="$undef"
6337 d_bincompat5005="$undef"
6344 : see if setuid scripts can be secure
6347 Some kernels have a bug that prevents setuid #! scripts from being
6348 secure. Some sites have disabled setuid #! scripts because of this.
6350 First let's decide if your kernel supports secure setuid #! scripts.
6351 (If setuid #! scripts would be secure but have been disabled anyway,
6352 don't say that they are secure if asked.)
6357 if $test -d /dev/fd; then
6358 echo "#!$ls" >reflect
6359 chmod +x,u+s reflect
6360 ./reflect >flect 2>&1
6361 if $contains "/dev/fd" flect >/dev/null; then
6362 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6366 If you are not sure if they are secure, I can check but I'll need a
6367 username and password different from the one you are using right now.
6368 If you don't have such a username or don't want me to test, simply
6372 rp='Other username to test security of setuid scripts with?'
6377 case "$d_suidsafe" in
6378 '') echo "I'll assume setuid scripts are *not* secure." >&4
6381 echo "Well, the $hint value is *not* secure." >&4
6383 *) echo "Well, the $hint value *is* secure." >&4
6388 $rm -f reflect flect
6389 echo "#!$ls" >reflect
6390 chmod +x,u+s reflect
6393 echo '"su" will (probably) prompt you for '"$ans's password."
6394 su $ans -c './reflect >flect'
6395 if $contains "/dev/fd" flect >/dev/null; then
6396 echo "Okay, it looks like setuid scripts are secure." >&4
6399 echo "I don't think setuid scripts are secure." >&4
6404 rp='Does your kernel have *secure* setuid scripts?'
6407 [yY]*) val="$define";;
6412 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6413 echo "(That's for file descriptors, not floppy disks.)"
6419 $rm -f reflect flect
6421 : now see if they want to do setuid emulation
6424 case "$d_suidsafe" in
6427 echo "No need to emulate SUID scripts since they are secure here." >&4
6431 Some systems have disabled setuid scripts, especially systems where
6432 setuid scripts cannot be secure. On systems where setuid scripts have
6433 been disabled, the setuid/setgid bits on scripts are currently
6434 useless. It is possible for $package to detect those bits and emulate
6435 setuid/setgid in a secure fashion. This emulation will only work if
6436 setuid scripts have been disabled in your kernel.
6440 "$define") dflt=y ;;
6443 rp="Do you want to do setuid/setgid emulation?"
6446 [yY]*) val="$define";;
6454 : see if this is a malloc.h system
6455 set malloc.h i_malloc
6458 : see if stdlib is available
6459 set stdlib.h i_stdlib
6462 : determine which malloc to compile in
6464 case "$usemymalloc" in
6465 [yY]*|true|$define) dflt='y' ;;
6466 [nN]*|false|$undef) dflt='n' ;;
6467 *) case "$ptrsize" in
6473 rp="Do you wish to attempt to use the malloc that comes with $package?"
6479 mallocsrc='malloc.c'
6480 mallocobj="malloc$_o"
6481 d_mymalloc="$define"
6484 : Remove malloc from list of libraries to use
6485 echo "Removing unneeded -lmalloc from library list" >&4
6486 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6489 echo "libs = $libs" >&4
6501 : compute the return types of malloc and free
6503 $cat >malloc.c <<END
6507 #include <sys/types.h>
6521 case "$malloctype" in
6523 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6530 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6534 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6541 echo "Your system uses $freetype free(), it would seem." >&4
6545 After $package is installed, you may wish to install various
6546 add-on modules and utilities. Typically, these add-ons will
6547 be installed under $prefix with the rest
6548 of this package. However, you may wish to install such add-ons
6549 elsewhere under a different prefix.
6551 If you do not wish to put everything under a single prefix, that's
6552 ok. You will be prompted for the individual locations; this siteprefix
6553 is only used to suggest the defaults.
6555 The default should be fine for most people.
6559 rp='Installation prefix to use for add-on modules and utilities?'
6560 : XXX Here might be another good place for an installstyle setting.
6561 case "$siteprefix" in
6563 *) dflt=$siteprefix ;;
6566 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6568 case "$siteprefix" in
6572 *) oldsiteprefix="$prefix";;
6577 siteprefixexp="$ansexp"
6579 : determine where site specific libraries go.
6580 : Usual default is /usr/local/lib/perl5/site_perl/$version
6581 : The default "style" setting is made in installstyle.U
6582 : XXX No longer works with Prefixit stuff.
6583 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6585 '') case "$installstyle" in
6586 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6587 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6595 The installation process will create a directory for
6596 site-specific extensions and modules. Most users find it convenient
6597 to place all site-specific files in this directory rather than in the
6598 main distribution directory.
6602 rp='Pathname for the site-specific library files?'
6605 sitelibexp="$ansexp"
6606 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6607 : Change installation prefix, if necessary.
6608 if $test X"$prefix" != X"$installprefix"; then
6609 installsitelib=`echo $sitelibexp | $sed "s#^$prefix#$installprefix#"`
6611 installsitelib="$sitelibexp"
6614 : determine where site specific architecture-dependent libraries go.
6615 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6616 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6617 : sitelib may have an optional trailing /share.
6619 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6620 dflt="$dflt/$archname"
6625 set sitearch sitearch none
6629 The installation process will also create a directory for
6630 architecture-dependent site-specific extensions and modules.
6634 rp='Pathname for the site-specific architecture-dependent library files?'
6637 sitearchexp="$ansexp"
6638 : Change installation prefix, if necessary.
6639 if $test X"$prefix" != X"$installprefix"; then
6640 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
6642 installsitearch="$sitearchexp"
6647 The installation process will also create a directory for
6648 vendor-supplied add-ons. Vendors who supply perl with their system
6649 may find it convenient to place all vendor-supplied files in this
6650 directory rather than in the main distribution directory. This will
6651 ease upgrades between binary-compatible maintenance versions of perl.
6653 Of course you may also use these directories in whatever way you see
6654 fit. For example, you might use them to access modules shared over a
6655 company-wide network.
6657 The default answer should be fine for most people.
6658 This causes further questions about vendor add-ons to be skipped
6659 and no vendor-specific directories will be configured for perl.
6662 rp='Do you want to configure vendor-specific add-on directories?'
6663 case "$usevendorprefix" in
6664 define|true|[yY]*) dflt=y ;;
6665 *) : User may have set vendorprefix directly on Configure command line.
6666 case "$vendorprefix" in
6675 rp='Installation prefix to use for vendor-supplied add-ons?'
6676 case "$vendorprefix" in
6678 *) dflt=$vendorprefix ;;
6681 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6683 case "$vendorprefix" in
6687 *) oldvendorprefix="$prefix";;
6691 usevendorprefix="$define"
6693 vendorprefixexp="$ansexp"
6695 *) usevendorprefix="$undef"
6701 case "$vendorprefix" in
6702 '') d_vendorlib="$undef"
6706 *) d_vendorlib="$define"
6707 : determine where vendor-supplied modules go.
6708 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6709 case "$vendorlib" in
6711 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6712 case "$installstyle" in
6713 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6714 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6717 *) dflt="$vendorlib"
6721 rp='Pathname for the vendor-supplied library files?'
6724 vendorlibexp="$ansexp"
6727 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6728 : Change installation prefix, if necessary.
6729 if $test X"$prefix" != X"$installprefix"; then
6730 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
6732 installvendorlib="$vendorlibexp"
6735 case "$vendorprefix" in
6736 '') d_vendorarch="$undef"
6740 *) d_vendorarch="$define"
6741 : determine where vendor-supplied architecture-dependent libraries go.
6742 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6743 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6744 : vendorlib may have an optional trailing /share.
6745 case "$vendorarch" in
6746 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6747 dflt="$dflt/$archname"
6749 *) dflt="$vendorarch" ;;
6752 rp='Pathname for vendor-supplied architecture-dependent files?'
6755 vendorarchexp="$ansexp"
6758 : Change installation prefix, if necessary.
6759 if $test X"$prefix" != X"$installprefix"; then
6760 installvendorarch=`echo $vendorarchexp | sed "s#^$prefix#$installprefix#"`
6762 installvendorarch="$vendorarchexp"
6765 : Final catch-all directories to search
6768 Lastly, you can have perl look in other directories for extensions and
6769 modules in addition to those already specified.
6770 These directories will be searched after
6774 test X"$vendorlib" != "X" && echo ' ' $vendorlib
6775 test X"$vendorarch" != "X" && echo ' ' $vendorarch
6777 case "$otherlibdirs" in
6778 ''|' ') dflt='none' ;;
6779 *) dflt="$otherlibdirs" ;;
6782 Enter a colon-separated set of extra paths to include in perl's @INC
6783 search path, or enter 'none' for no extra paths.
6787 rp='Colon-separated list of additional directories for perl to search?'
6790 ' '|''|none) otherlibdirs=' ' ;;
6791 *) otherlibdirs="$ans" ;;
6793 case "$otherlibdirs" in
6797 set d_perl_otherlibdirs
6800 : Cruising for prototypes
6802 echo "Checking out function prototypes..." >&4
6803 $cat >prototype.c <<'EOCP'
6804 int main(int argc, char *argv[]) {
6807 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
6808 echo "Your C compiler appears to support function prototypes."
6811 echo "Your C compiler doesn't seem to understand function prototypes."
6818 case "$prototype" in
6820 *) ansi2knr='ansi2knr'
6825 This version of $package can only be compiled by a compiler that
6826 understands function prototypes. Unfortunately, your C compiler
6828 doesn't seem to understand them. Sorry about that.
6830 If GNU cc is available for your system, perhaps you could try that instead.
6832 Eventually, we hope to support building Perl with pre-ANSI compilers.
6833 If you would like to help in that effort, please contact <perlbug@perl.org>.
6835 Aborting Configure now.
6841 : determine where public executables go
6846 rp='Pathname where the public executables will reside?'
6848 if $test "X$ansexp" != "X$binexp"; then
6853 : Change installation prefix, if necessary.
6854 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6855 if $test X"$prefix" != X"$installprefix"; then
6856 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
6858 installbin="$binexp"
6867 Perl can be built with extra modules or bundles of modules which
6868 will be fetched from the CPAN and installed alongside Perl.
6870 Notice that you will need access to the CPAN; either via the Internet,
6871 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
6872 be asked later to configure the CPAN.pm module which will in turn do
6873 the installation of the rest of the extra modules or bundles.)
6875 Notice also that if the modules require any external software such as
6876 libraries and headers (the libz library and the zlib.h header for the
6877 Compress::Zlib module, for example) you MUST have any such software
6878 already installed, this configuration process will NOT install such
6881 If this doesn't make any sense to you, just accept the default '$dflt'.
6883 rp='Install any extra modules (y or n)?'
6889 Please list any extra modules or bundles to be installed from CPAN,
6890 with spaces between the names. The names can be in any format the
6891 'install' command of CPAN.pm will understand. (Answer 'none',
6892 without the quotes, to install no extra modules or bundles.)
6902 $rm -f ../extras.lst
6904 *) echo "(Saving the list of extras for later...)"
6905 echo "$extras" > ../extras.lst
6913 : Find perl5.005 or later.
6914 echo "Looking for a previously installed perl5.005 or later... "
6916 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6917 : Check if this perl is recent and can load a simple module
6918 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6921 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6931 '') echo "None found. That's ok.";;
6932 *) echo "Using $perl5." ;;
6935 : Determine list of previous versions to include in @INC
6936 $cat > getverlist <<EOPL
6939 \$api_versionstring = "$api_versionstring";
6940 \$version = "$version";
6941 \$stem = "$sitelib_stem";
6942 \$archname = "$archname";
6944 $cat >> getverlist <<'EOPL'
6945 # Can't have leading @ because metaconfig interprets it as a command!
6946 ;@inc_version_list=();
6947 # XXX Redo to do opendir/readdir?
6950 ;@candidates = glob("5.*");
6956 # XXX ToDo: These comparisons must be reworked when two-digit
6957 # subversions come along, so that 5.7.10 compares as greater than
6958 # 5.7.3! By that time, hope that 5.6.x is sufficiently
6959 # widespread that we can use the built-in version vectors rather
6960 # than reinventing them here. For 5.6.0, however, we must
6961 # assume this script will likely be run by 5.005_0x. --AD 1/2000.
6962 foreach $d (@candidates) {
6963 if ($d lt $version) {
6964 if ($d ge $api_versionstring) {
6965 unshift(@inc_version_list, grep { -d } "$d/$archname", $d);
6967 elsif ($d ge "5.005") {
6968 unshift(@inc_version_list, grep { -d } $d);
6972 # Skip newer version. I.e. don't look in
6973 # 5.7.0 if we're installing 5.6.1.
6977 if (@inc_version_list) {
6978 print join(' ', @inc_version_list);
6981 # Blank space to preserve value for next Configure run.
6986 case "$inc_version_list" in
6987 '') if test -x "$perl5$exe_ext"; then
6988 dflt=`$perl5 getverlist`
6993 $undef) dflt='none' ;;
6994 *) eval dflt=\"$inc_version_list\" ;;
6997 ''|' ') dflt=none ;;
7000 5.005) case "$bincompat5005" in
7001 $define|true|[yY]*) ;;
7008 In order to ease the process of upgrading, this version of perl
7009 can be configured to use modules built and installed with earlier
7010 versions of perl that were installed under $prefix. Specify here
7011 the list of earlier versions that this version of perl should check.
7012 If Configure detected no earlier versions of perl installed under
7013 $prefix, then the list will be empty. Answer 'none' to tell perl
7014 to not search earlier versions.
7016 The default should almost always be sensible, so if you're not sure,
7017 just accept the default.
7020 rp='List of earlier versions to include in @INC?'
7023 [Nn]one|''|' ') inc_version_list=' ' ;;
7024 *) inc_version_list="$ans" ;;
7026 case "$inc_version_list" in
7028 inc_version_list_init='0';;
7029 *) inc_version_list_init=`echo $inc_version_list |
7030 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
7035 : determine whether to install perl also as /usr/bin/perl
7038 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7040 Many scripts expect perl to be installed as /usr/bin/perl.
7041 I can install the perl you are about to compile also as /usr/bin/perl
7042 (in addition to $installbin/perl).
7044 case "$installusrbinperl" in
7045 "$undef"|[nN]*) dflt='n';;
7048 rp="Do you want to install perl as /usr/bin/perl?"
7051 [yY]*) val="$define";;
7057 set installusrbinperl
7060 : see if dld is available
7064 : see if dlopen exists
7071 : determine which dynamic loading, if any, to compile in
7073 dldir="ext/DynaLoader"
7086 $define) dflt='y' ;;
7089 $define) dflt='y' ;;
7091 : Does a dl_xxx.xs file exist for this operating system
7092 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7095 rp="Do you wish to use dynamic loading?"
7102 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7103 dflt="$dldir/dl_${osname}.xs"
7104 elif $test "$d_dlopen" = "$define" ; then
7105 dflt="$dldir/dl_dlopen.xs"
7106 elif $test "$i_dld" = "$define" ; then
7107 dflt="$dldir/dl_dld.xs"
7112 *) dflt="$dldir/$dlsrc"
7115 echo "The following dynamic loading files are available:"
7116 : Can not go over to $dldir because getfile has path hard-coded in.
7117 tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir
7118 rp="Source file to use for dynamic loading"
7124 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7128 Some systems may require passing special flags to $cc -c to
7129 compile modules that will be used to create a shared library.
7130 To use no flags, say "none".
7133 case "$cccdlflags" in
7134 '') case "$gccversion" in
7135 '') case "$osname" in
7137 next) dflt='none' ;;
7138 irix*) dflt='-KPIC' ;;
7139 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7140 sunos) dflt='-pic' ;;
7144 *) case "$osname" in
7145 darwin) dflt='none' ;;
7146 svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7151 *) dflt="$cccdlflags" ;;
7153 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7156 none) cccdlflags=' ' ;;
7157 *) cccdlflags="$ans" ;;
7162 Some systems use ld to create libraries that can be dynamically loaded,
7163 while other systems (such as those using ELF) use $cc.
7167 '') $cat >try.c <<'EOM'
7168 /* Test for whether ELF binaries are produced */
7173 int i = open("a.out",O_RDONLY);
7176 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7177 exit(0); /* succeed (yes, it's ELF) */
7182 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7184 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7188 echo "I'll use ld to build dynamic libraries."
7197 rp="What command should be used to create dynamic libraries?"
7203 Some systems may require passing special flags to $ld to create a
7204 library that can be dynamically loaded. If your ld flags include
7205 -L/other/path options to locate libraries outside your loader's normal
7206 search path, you may need to specify those -L options here as well. To
7207 use no flags, say "none".
7210 case "$lddlflags" in
7211 '') case "$osname" in
7212 beos) dflt='-nostart' ;;
7214 case "$gccversion" in
7215 '') dflt="$dflt +vnocompatwarnings" ;;
7218 linux|irix*) dflt='-shared' ;;
7219 next) dflt='none' ;;
7220 solaris) dflt='-G' ;;
7221 sunos) dflt='-assert nodefinitions' ;;
7222 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
7226 *) dflt="$lddlflags" ;;
7229 : Try to guess additional flags to pick up local libraries.
7230 : Be careful not to append to a plain 'none'
7234 for thisflag in $ldflags; do
7239 *) dflt="$dflt $thisflag" ;;
7246 ''|' ') dflt='none' ;;
7249 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
7252 none) lddlflags=' ' ;;
7253 *) lddlflags="$ans" ;;
7258 Some systems may require passing special flags to $cc to indicate that
7259 the resulting executable will use dynamic linking. To use no flags,
7263 case "$ccdlflags" in
7264 '') case "$osname" in
7265 hpux) dflt='-Wl,-E' ;;
7266 linux) dflt='-rdynamic' ;;
7267 next) dflt='none' ;;
7268 sunos) dflt='none' ;;
7272 *) dflt="$ccdlflags" ;;
7274 rp="Any special flags to pass to $cc to use dynamic linking?"
7277 none) ccdlflags=' ' ;;
7278 *) ccdlflags="$ans" ;;
7292 # No dynamic loading being used, so don't bother even to prompt.
7295 *) case "$useshrplib" in
7296 '') case "$osname" in
7297 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
7299 also='Building a shared libperl is required for dynamic loading to work on your system.'
7304 also='Building a shared libperl is needed for MAB support.'
7322 The perl executable is normally obtained by linking perlmain.c with
7323 libperl${_a}, any static extensions (usually just DynaLoader), and
7324 any other libraries needed on this system (such as -lm, etc.). Since
7325 your system supports dynamic loading, it is probably possible to build
7326 a shared libperl.$so. If you will have more than one executable linked
7327 to libperl.$so, this will significantly reduce the size of each
7328 executable, but it may have a noticeable affect on performance. The
7329 default is probably sensible for your system.
7333 rp="Build a shared libperl.$so (y/n)"
7337 useshrplib='true' ;;
7338 *) useshrplib='false' ;;
7343 case "$useshrplib" in
7347 # Figure out a good name for libperl.so. Since it gets stored in
7348 # a version-specific architecture-dependent library, the version
7349 # number isn't really that important, except for making cc/ld happy.
7351 # A name such as libperl.so.3.1
7352 majmin="libperl.$so.$patchlevel.$subversion"
7353 # A name such as libperl.so.301
7354 majonly=`echo $patchlevel $subversion |
7355 $awk '{printf "%d%02d", $1, $2}'`
7356 majonly=libperl.$so.$majonly
7357 # I'd prefer to keep the os-specific stuff here to a minimum, and
7358 # rely on figuring it out from the naming of libc.
7359 case "${osname}${osvers}" in
7362 # XXX How handle the --version stuff for MAB?
7364 linux*) # ld won't link with a bare -lperl otherwise.
7367 cygwin*) # include version
7368 dflt=`echo libperl$version | sed -e 's/\./_/g'`$lib_ext
7370 *) # Try to guess based on whether libc has major.minor.
7372 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
7373 *libc.$so.[0-9]*) dflt=$majonly ;;
7374 *) dflt=libperl.$so ;;
7384 I need to select a good name for the shared libperl. If your system uses
7385 library names with major and minor numbers, then you might want something
7386 like $majmin. Alternatively, if your system uses a single version
7387 number for shared libraries, then you might want to use $majonly.
7388 Or, your system might be quite happy with a simple libperl.$so.
7390 Since the shared libperl will get installed into a version-specific
7391 architecture-dependent directory, the version number of the shared perl
7392 library probably isn't important, so the default should be o.k.
7395 rp='What name do you want to give to the shared libperl?'
7398 echo "Ok, I'll use $libperl"
7401 libperl="libperl${_a}"
7405 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
7409 WARNING: Use of the shrpdir variable for the installation location of
7410 the shared $libperl is not supported. It was never documented and
7411 will not work in this version. Let me (perlbug@perl.org)
7412 know of any problems this may cause.
7418 But your current setting of $shrpdir is
7419 the default anyway, so it's harmless.
7424 Further, your current attempted setting of $shrpdir
7425 conflicts with the value of $archlibexp/CORE
7426 that installperl will use.
7433 # How will the perl executable find the installed shared $libperl?
7434 # Add $xxx to ccdlflags.
7435 # If we can't figure out a command-line option, use $shrpenv to
7436 # set env LD_RUN_PATH. The main perl makefile uses this.
7437 shrpdir=$archlibexp/CORE
7440 if "$useshrplib"; then
7443 # We'll set it in Makefile.SH...
7449 xxx="-Wl,-R$shrpdir"
7451 linux|irix*|dec_osf)
7452 xxx="-Wl,-rpath,$shrpdir"
7455 # next doesn't like the default...
7458 # beos doesn't like the default, either.
7461 # hpux doesn't like the default, either.
7462 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
7465 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
7471 # Only add $xxx if it isn't already in ccdlflags.
7472 case " $ccdlflags " in
7474 *) ccdlflags="$ccdlflags $xxx"
7477 Adding $xxx to the flags
7478 passed to $ld so that the perl executable will find the
7479 installed shared $libperl.
7487 # Fix ccdlflags in AIX for building external extensions.
7488 # (For building Perl itself bare -bE:perl.exp is needed,
7489 # Makefile.SH takes care of this.)
7491 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
7493 # Respect a hint or command-line value.
7495 '') shrpenv="$tmp_shrpenv" ;;
7497 case "$ldlibpthname" in
7498 '') ldlibpthname=LD_LIBRARY_PATH ;;
7499 none) ldlibpthname='' ;;
7502 : determine where manual pages are on this system
7506 syspath='/usr/share/man/man1 /usr/man/man1'
7507 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
7508 syspath="$syspath /usr/man/u_man/man1"
7509 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
7510 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
7511 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
7512 sysman=`./loc . /usr/man/man1 $syspath`
7515 if $test -d "$sysman"; then
7516 echo "System manual is in $sysman." >&4
7518 echo "Could not find manual pages in source form." >&4
7521 : determine where manual pages go
7522 set man1dir man1dir none
7526 $spackage has manual pages available in source form.
7530 echo "However, you don't have nroff, so they're probably useless to you."
7532 '') man1dir="none";;
7535 echo "If you don't want the manual sources installed, answer 'none'."
7540 lookpath="$prefixexp/share/man/man1"
7541 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
7542 lookpath="$lookpath $prefixexp/man/p_man/man1"
7543 lookpath="$lookpath $prefixexp/man/u_man/man1"
7544 lookpath="$lookpath $prefixexp/man/man.1"
7546 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
7547 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
7557 rp="Where do the main $spackage manual pages (source) go?"
7559 if $test "X$man1direxp" != "X$ansexp"; then
7563 man1direxp="$ansexp"
7569 : Change installation prefix, if necessary.
7570 if $test X"$prefix" != X"$installprefix"; then
7571 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
7573 installman1dir="$man1direxp"
7576 : What suffix to use on installed man pages
7583 rp="What suffix should be used for the main $spackage man pages?"
7585 '') case "$man1dir" in
7599 *) dflt="$man1ext";;
7606 : see if we can have long filenames
7608 first=123456789abcdef
7610 if (echo hi >$first) 2>/dev/null; then
7611 if $test -f 123456789abcde; then
7612 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
7615 echo 'You can have filenames longer than 14 characters.'>&4
7620 You can't have filenames longer than 14 chars.
7621 You can't even think about them!
7627 $rm -rf 123456789abcde*
7629 : determine where library module manual pages go
7630 set man3dir man3dir none
7634 $spackage has manual pages for many of the library modules.
7640 However, you don't have nroff, so they're probably useless to you.
7643 '') man3dir="none";;
7647 case "$d_flexfnam" in
7650 However, your system can't handle the long file names like File::Basename.3.
7653 '') man3dir="none";;
7657 echo "If you don't want the manual sources installed, answer 'none'."
7658 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7660 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
7661 if $test -d "$privlib/man/man3"; then
7664 WARNING: Previous versions of perl installed man3 pages into
7665 $privlib/man/man3. This version will suggest a
7666 new default of $dflt.
7670 rp='Do you wish to preserve the old behavior?(y/n)'
7673 y*) dflt="$privlib/man/man3" ;;
7678 *) dflt="$man3dir" ;;
7685 rp="Where do the $package library man pages (source) go?"
7688 man3direxp="$ansexp"
7694 : Change installation prefix, if necessary.
7695 if $test X"$prefix" != X"$installprefix"; then
7696 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
7698 installman3dir="$man3direxp"
7701 : What suffix to use on installed man pages
7707 rp="What suffix should be used for the $package library man pages?"
7709 '') case "$man3dir" in
7723 *) dflt="$man3ext";;
7730 : see if we have to deal with yellow pages, now NIS.
7731 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
7732 if $test -f /usr/etc/nibindd; then
7734 echo "I'm fairly confident you're on a NeXT."
7736 rp='Do you get the hosts file via NetInfo?'
7745 y*) hostcat='nidump hosts .';;
7746 *) case "$hostcat" in
7747 nidump*) hostcat='';;
7757 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
7765 rp='Are you getting the hosts file via yellow pages?'
7768 y*) hostcat='ypcat hosts';;
7769 *) hostcat='cat /etc/hosts';;
7775 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
7778 '') test -f /etc/group && groupcat='cat /etc/group';;
7781 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
7784 : now get the host name
7786 echo "Figuring out host name..." >&4
7787 case "$myhostname" in
7789 echo 'Maybe "hostname" will work...'
7790 if tans=`sh -c hostname 2>&1` ; then
7798 if $test "$cont"; then
7800 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
7801 if tans=`cat /etc/systemid 2>&1` ; then
7803 phostname='cat /etc/systemid'
7804 echo "Whadyaknow. Xenix always was a bit strange..."
7807 elif $test -r /etc/systemid; then
7808 echo "(What is a non-Xenix system doing with /etc/systemid?)"
7811 if $test "$cont"; then
7812 echo 'No, maybe "uuname -l" will work...'
7813 if tans=`sh -c 'uuname -l' 2>&1` ; then
7815 phostname='uuname -l'
7817 echo 'Strange. Maybe "uname -n" will work...'
7818 if tans=`sh -c 'uname -n' 2>&1` ; then
7820 phostname='uname -n'
7822 echo 'Oh well, maybe I can mine it out of whoami.h...'
7823 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
7824 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
7825 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
7827 case "$myhostname" in
7828 '') echo "Does this machine have an identity crisis or something?"
7831 echo "Well, you said $myhostname before..."
7832 phostname='echo $myhostname';;
7838 : you do not want to know about this
7843 if $test "$myhostname" ; then
7845 rp='Your host name appears to be "'$myhostname'".'" Right?"
7853 : bad guess or no guess
7854 while $test "X$myhostname" = X ; do
7856 rp="Please type the (one word) name of your host:"
7861 : translate upper to lower if necessary
7862 case "$myhostname" in
7864 echo "(Normalizing case in your host name)"
7865 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
7869 case "$myhostname" in
7871 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
7872 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
7873 echo "(Trimming domain name from host name--host name is now $myhostname)"
7875 *) case "$mydomain" in
7878 test "X$hostcat" = "Xypcat hosts" &&
7879 ypmatch "$myhostname" hosts 2>/dev/null |\
7880 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
7883 test "X$hostcat" != "X" &&
7884 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
7885 /[ ]$myhostname[ . ]/p" > hosts
7888 if $test -f hosts; then
7889 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
7890 END { print sum }" hosts` = x1 || tmp_re="[ ]"
7891 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
7892 hosts | $sort | $uniq | \
7893 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
7894 case `$echo X$dflt` in
7895 X*\ *) echo "(Several hosts in the database matched hostname)"
7898 X.) echo "(You do not have fully-qualified names in the hosts database)"
7902 echo "(I cannot locate a hosts database anywhere)"
7907 tans=`./loc resolv.conf X /etc /usr/etc`
7908 if $test -f "$tans"; then
7909 echo "(Attempting domain name extraction from $tans)"
7910 dflt=.`$sed -n -e 's/ / /g' \
7911 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
7912 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
7914 .) dflt=.`$sed -n -e 's/ / /g' \
7915 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
7916 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
7923 .) echo "(No help from resolv.conf either -- attempting clever guess)"
7924 dflt=.`sh -c domainname 2>/dev/null`
7927 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
7931 case "$dflt$osname" in
7932 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
7933 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
7937 .) echo "(Lost all hope -- silly guess then)"
7943 *) dflt="$mydomain";;
7947 rp="What is your domain name?"
7957 : translate upper to lower if necessary
7960 echo "(Normalizing case in your domain name)"
7961 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
7965 : a little sanity check here
7966 case "$phostname" in
7969 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
7970 $myhostname$mydomain|$myhostname) ;;
7972 case "$phostname" in
7974 echo "(That doesn't agree with your whoami.h file, by the way.)"
7977 echo "(That doesn't agree with your $phostname command, by the way.)"
7987 I need to get your e-mail address in Internet format if possible, i.e.
7988 something like user@host.domain. Please answer accurately since I have
7989 no easy means to double check it. The default value provided below
7990 is most probably close to reality but may not be valid from outside
7991 your organization...
7995 while test "$cont"; do
7997 '') dflt="$cf_by@$myhostname$mydomain";;
7998 *) dflt="$cf_email";;
8000 rp='What is your e-mail address?'
8006 rp='Address does not look like an Internet one. Use it anyway?'
8022 If you or somebody else will be maintaining perl at your site, please
8023 fill in the correct e-mail address here so that they may be contacted
8024 if necessary. Currently, the "perlbug" program included with perl
8025 will send mail to this address in addition to perlbug@perl.org. You may
8026 enter "none" for no administrator.
8029 case "$perladmin" in
8030 '') dflt="$cf_email";;
8031 *) dflt="$perladmin";;
8033 rp='Perl administrator e-mail address'
8037 : determine whether to only install version-specific parts.
8040 Do you want to install only the version-specific parts of the perl
8041 distribution? Usually you do *not* want to do this.
8043 case "$versiononly" in
8044 "$define"|[Yy]*|true) dflt='y' ;;
8047 rp="Do you want to install only the version-specific parts of perl?"
8050 [yY]*) val="$define";;
8056 : figure out how to guarantee perl startup
8057 case "$startperl" in
8059 case "$sharpbang" in
8063 I can use the #! construct to start perl on your system. This will
8064 make startup of perl scripts faster, but may cause problems if you
8065 want to share those scripts and perl is not in a standard place
8066 ($binexp/perl) on all your platforms. The alternative is to force
8067 a shell by starting the script with a single ':' character.
8070 case "$versiononly" in
8071 "$define") dflt="$binexp/perl$version";;
8072 *) dflt="$binexp/perl";;
8074 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8077 none) startperl=": # use perl";;
8078 *) startperl="#!$ans"
8079 if $test 30 -lt `echo "$ans" | wc -c`; then
8082 WARNING: Some systems limit the #! command to 32 characters.
8083 If you experience difficulty running Perl scripts with #!, try
8084 installing Perl in a directory with a shorter pathname.
8090 *) startperl=": # use perl"
8095 echo "I'll use $startperl to start perl scripts."
8097 : figure best path for perl in scripts
8100 case "$versiononly" in
8101 "$define") perlpath="$binexp/perl$version";;
8102 *) perlpath="$binexp/perl";;
8104 case "$startperl" in
8109 I will use the "eval 'exec'" idiom to start Perl on your system.
8110 I can use the full path of your Perl binary for this purpose, but
8111 doing so may cause problems if you want to share those scripts and
8112 Perl is not always in a standard place ($binexp/perl).
8116 rp="What path shall I use in \"eval 'exec'\"?"
8123 case "$startperl" in
8125 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8128 : determine where public executable scripts go
8129 set scriptdir scriptdir
8131 case "$scriptdir" in
8134 : guess some guesses
8135 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8136 $test -d /usr/share/bin && dflt=/usr/share/bin
8137 $test -d /usr/local/script && dflt=/usr/local/script
8138 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8139 $test -d $prefixexp/script && dflt=$prefixexp/script
8143 *) dflt="$scriptdir"
8148 Some installations have a separate directory just for executable scripts so
8149 that they can mount it across multiple architectures but keep the scripts in
8150 one spot. You might, for example, have a subdirectory of /usr/share for this.
8151 Or you might just lump your scripts in with all your other executables.
8155 rp='Where do you keep publicly executable scripts?'
8157 if $test "X$ansexp" != "X$scriptdirexp"; then
8161 scriptdirexp="$ansexp"
8162 : Change installation prefix, if necessary.
8163 if $test X"$prefix" != X"$installprefix"; then
8164 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
8166 installscript="$scriptdirexp"
8169 : determine where add-on public executables go
8171 '') dflt=$siteprefix/bin ;;
8175 rp='Pathname where the add-on public executables should be installed?'
8178 sitebinexp="$ansexp"
8179 : Change installation prefix, if necessary.
8180 if $test X"$prefix" != X"$installprefix"; then
8181 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
8183 installsitebin="$sitebinexp"
8186 : define an is-a-typedef? function
8187 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8189 "") inclist="sys/types.h";;
8191 eval "varval=\$$var";
8195 for inc in $inclist; do
8196 echo "#include <$inc>" >>temp.c;
8198 echo "#ifdef $type" >> temp.c;
8199 echo "printf(\"We have $type\");" >> temp.c;
8200 echo "#endif" >> temp.c;
8201 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8202 if $contains $type temp.E >/dev/null 2>&1; then
8208 *) eval "$var=\$varval";;
8211 : define an is-a-typedef? function that prompts if the type is not available.
8212 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8214 "") inclist="sys/types.h";;
8216 eval "varval=\$$var";
8220 for inc in $inclist; do
8221 echo "#include <$inc>" >>temp.c;
8223 echo "#ifdef $type" >> temp.c;
8224 echo "printf(\"We have $type\");" >> temp.c;
8225 echo "#endif" >> temp.c;
8226 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8228 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
8229 if $contains $type temp.E >/dev/null 2>&1; then
8230 echo "$type found." >&4;
8233 echo "$type NOT found." >&4;
8239 *) eval "$var=\$varval";;
8242 : see what type lseek is declared as in the kernel
8243 rp="What is the type used for lseek's offset on this system?"
8244 set off_t lseektype long stdio.h sys/types.h
8248 echo "Checking to see how big your file offsets are..." >&4
8250 #include <sys/types.h>
8254 printf("%d\n", (int)sizeof($lseektype));
8259 if eval $compile_ok; then
8260 lseeksize=`$run ./try`
8261 echo "Your file offsets are $lseeksize bytes long."
8265 echo "(I can't seem to compile the test program. Guessing...)"
8266 rp="What is the size of your file offsets (in bytes)?"
8272 : see what type file positions are declared as in the library
8273 rp="What is the type for file position used by fsetpos()?"
8274 set fpos_t fpostype long stdio.h sys/types.h
8279 *_t) zzz="$fpostype" ;;
8282 echo "Checking the size of $zzz..." >&4
8284 #include <sys/types.h>
8287 printf("%d\n", (int)sizeof($fpostype));
8292 if eval $compile_ok; then
8296 echo "(I can't execute the test program--guessing $fpossize.)" >&4
8299 echo "Your $zzz is $fpossize bytes long."
8305 echo "(I can't compile the test program. Guessing...)" >&4
8306 rp="What is the size of your file positions (in bytes)?"
8313 # Backward compatibility (uselfs is deprecated).
8315 "$define"|true|[yY]*)
8318 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
8320 uselargefiles="$define"
8324 case "$lseeksize:$fpossize" in
8327 You can have files larger than 2 gigabytes.
8330 *) case "$uselargefiles" in
8331 "$undef"|false|[nN]*) dflt='n' ;;
8336 Perl can be built to understand large files (files larger than 2 gigabytes)
8337 on some systems. To do so, Configure can be run with -Duselargefiles.
8339 If this doesn't make any sense to you, just accept the default '$dflt'.
8341 rp='Try to understand large files, if available?'
8344 y|Y) val="$define" ;;
8351 case "$uselargefiles" in
8353 : Look for a hint-file generated 'call-back-unit'. If the
8354 : user has specified that a large files perl is to be built,
8355 : we may need to set or change some other defaults.
8356 if $test -f uselargefiles.cbu; then
8357 echo "Your platform has some specific hints for large file builds, using them..."
8358 . ./uselargefiles.cbu
8360 echo "Rechecking to see how big your file offsets are..." >&4
8362 #include <sys/types.h>
8366 printf("%d\n", (int)sizeof($lseektype));
8371 if eval $compile_ok; then
8372 lseeksize=`$run ./try`
8373 $echo "Your file offsets are now $lseeksize bytes long."
8377 echo "(I can't seem to compile the test program. Guessing...)"
8378 rp="What is the size of your file offsets (in bytes)?"
8383 *_t) zzz="$fpostype" ;;
8386 $echo $n "Rechecking the size of $zzz...$c" >&4
8388 #include <sys/types.h>
8391 printf("%d\n", (int)sizeof($fpostype));
8396 if eval $compile_ok; then
8401 echo "(I can't execute the test program--guessing $fpossize.)" >&4
8404 echo " $fpossize bytes." >&4
8410 echo "(I can't compile the test program. Guessing...)" >&4
8411 rp="What is the size of your file positions (in bytes)?"
8420 case "$vendorprefix" in
8421 '') d_vendorbin="$undef"
8425 *) d_vendorbin="$define"
8426 : determine where vendor-supplied executables go.
8427 case "$vendorbin" in
8428 '') dflt=$vendorprefix/bin ;;
8429 *) dflt="$vendorbin" ;;
8432 rp='Pathname for the vendor-supplied executables directory?'
8435 vendorbinexp="$ansexp"
8438 : Change installation prefix, if necessary.
8439 if $test X"$prefix" != X"$installprefix"; then
8440 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
8442 installvendorbin="$vendorbinexp"
8445 : see if qgcvt exists
8451 if $test X"$d_longdbl" = X"$define"; then
8453 echo "Checking how to print long doubles..." >&4
8455 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
8456 $cat >try.c <<'EOCP'
8457 #include <sys/types.h>
8461 printf("%.3f\n", d);
8465 if eval $compile; then
8469 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
8470 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
8471 echo "We will use %f."
8477 if $test X"$sPRIfldbl" = X; then
8478 $cat >try.c <<'EOCP'
8479 #include <sys/types.h>
8482 long double d = 123.456;
8483 printf("%.3Lf\n", d);
8487 if eval $compile; then
8491 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
8492 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
8493 echo "We will use %Lf."
8499 if $test X"$sPRIfldbl" = X; then
8500 $cat >try.c <<'EOCP'
8501 #include <sys/types.h>
8504 long double d = 123.456;
8505 printf("%.3llf\n", d);
8509 if eval $compile; then
8513 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
8514 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
8515 echo "We will use %llf."
8521 if $test X"$sPRIfldbl" = X; then
8522 $cat >try.c <<'EOCP'
8523 #include <sys/types.h>
8526 long double d = 123.456;
8527 printf("%.3lf\n", d);
8531 if eval $compile; then
8535 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
8536 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
8537 echo "We will use %lf."
8543 if $test X"$sPRIfldbl" = X; then
8544 echo "Cannot figure out how to print long doubles." >&4
8546 sSCNfldbl=$sPRIfldbl # expect consistency
8553 case "$sPRIfldbl" in
8554 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
8555 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
8556 d_SCNfldbl="$undef";
8558 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
8559 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
8560 d_SCNfldbl="$define";
8564 : Check how to convert floats to strings.
8566 echo "Checking for an efficient way to convert floats to strings."
8568 case "$uselongdouble" in
8569 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
8571 case "$d_longdbl" in
8572 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
8574 case "$d_PRIgldbl" in
8575 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
8579 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
8580 char *myname = "gconvert";
8583 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
8584 char *myname = "gcvt";
8587 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
8588 char *myname = "qgcvt";
8589 #define DOUBLETYPE long double
8592 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE) && defined(HAS_PRIgldbl)
8593 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
8595 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
8597 char *myname = "sprintf";
8601 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
8602 #define DOUBLETYPE long double
8604 #define DOUBLETYPE double
8610 #define I_STDLIB $i_stdlib
8616 checkit(expect, got)
8620 if (strcmp(expect, got)) {
8621 printf("%s oddity: Expected %s, got %s\n",
8622 myname, expect, got);
8632 /* This must be 1st test on (which?) platform */
8633 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
8634 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
8635 checkit("0.1", buf);
8637 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
8640 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
8641 checkit("1.1", buf);
8643 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
8644 checkit("1.01", buf);
8646 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
8647 checkit("1.001", buf);
8649 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
8650 checkit("1.0001", buf);
8652 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
8653 checkit("1.00001", buf);
8655 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
8656 checkit("1.000001", buf);
8658 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
8661 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
8664 /* Some Linux gcvt's give 1.e+5 here. */
8665 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
8666 checkit("100000", buf);
8668 /* Some Linux gcvt's give -1.e+5 here. */
8669 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
8670 checkit("-100000", buf);
8672 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
8673 checkit("123.456", buf);
8675 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
8676 Gconvert((DOUBLETYPE)1e30, 8, 0, buf);
8677 if (strlen(buf) > 5)
8678 checkit("1e+030", buf); /* for Microsoft */
8680 checkit("1e+30", buf);
8685 case "$d_Gconvert" in
8686 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
8687 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
8688 sprintf*) xxx_list='sprintf gconvert gcvt' ;;
8689 *) xxx_list='gconvert gcvt sprintf' ;;
8692 case "$d_longdbl$uselongdouble$d_PRIgldbl" in
8693 "$define$define$define")
8694 # for long doubles prefer first qgcvt, then sprintf
8695 xxx_list="`echo $xxx_list|sed s/sprintf//`"
8696 xxx_list="sprintf $xxx_list"
8698 "$define") xxx_list="qgcvt $xxx_list" ;;
8703 for xxx_convert in $xxx_list; do
8704 echo "Trying $xxx_convert..."
8706 set try -DTRY_$xxx_convert
8707 if eval $compile; then
8708 echo "$xxx_convert() found." >&4
8710 echo "I'll use $xxx_convert to convert floats into a string." >&4
8713 echo "...But $xxx_convert didn't work as I expected."
8716 echo "$xxx_convert NOT found." >&4
8720 case "$xxx_convert" in
8721 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
8722 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
8723 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
8724 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
8725 "$define$define$define")
8726 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
8727 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
8732 : see if _fwalk exists
8736 : Initialize h_fcntl
8739 : Initialize h_sysfile
8742 : access call always available on UNIX
8746 : locate the flags for 'access()'
8750 $cat >access.c <<'EOCP'
8751 #include <sys/types.h>
8756 #include <sys/file.h>
8765 : check sys/file.h first, no particular reason here
8766 if $test `./findhdr sys/file.h` && \
8767 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
8769 echo "<sys/file.h> defines the *_OK access constants." >&4
8770 elif $test `./findhdr fcntl.h` && \
8771 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
8773 echo "<fcntl.h> defines the *_OK access constants." >&4
8774 elif $test `./findhdr unistd.h` && \
8775 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
8776 echo "<unistd.h> defines the *_OK access constants." >&4
8778 echo "I can't find the four *_OK access constants--I'll use mine." >&4
8784 : see if accessx exists
8785 set accessx d_accessx
8788 : see if alarm exists
8792 : see if atolf exists
8796 : see if atoll exists
8800 : Look for GNU-cc style attribute checking
8802 echo "Checking whether your compiler can handle __attribute__ ..." >&4
8803 $cat >attrib.c <<'EOCP'
8805 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
8807 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
8808 if $contains 'warning' attrib.out >/dev/null 2>&1; then
8809 echo "Your C compiler doesn't fully support __attribute__."
8812 echo "Your C compiler supports __attribute__."
8816 echo "Your C compiler doesn't seem to understand __attribute__ at all."
8823 : see if bcmp exists
8827 : see if bcopy exists
8831 : see if this is a unistd.h system
8832 set unistd.h i_unistd
8835 : see if getpgrp exists
8836 set getpgrp d_getpgrp
8839 case "$d_getpgrp" in
8842 echo "Checking to see which flavor of getpgrp is in use..."
8845 #include <sys/types.h>
8847 # include <unistd.h>
8851 if (getuid() == 0) {
8852 printf("(I see you are running Configure as super-user...)\n");
8856 if (getpgrp(1) == 0)
8865 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
8866 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
8868 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
8869 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
8872 echo "I can't seem to compile and run the test program."
8874 xxx="a USG one, i.e. you use getpgrp()."
8876 # SVR4 systems can appear rather BSD-ish.
8879 xxx="a BSD one, i.e. you use getpgrp(pid)."
8883 xxx="probably a USG one, i.e. you use getpgrp()."
8888 echo "Assuming your getpgrp is $xxx" >&4
8897 : see if setpgrp exists
8898 set setpgrp d_setpgrp
8901 case "$d_setpgrp" in
8904 echo "Checking to see which flavor of setpgrp is in use..."
8907 #include <sys/types.h>
8909 # include <unistd.h>
8913 if (getuid() == 0) {
8914 printf("(I see you are running Configure as super-user...)\n");
8918 if (-1 == setpgrp(1, 1))
8921 if (setpgrp() != -1)
8927 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
8928 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
8930 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
8931 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
8934 echo "(I can't seem to compile and run the test program.)"
8936 xxx="a USG one, i.e. you use setpgrp()."
8938 # SVR4 systems can appear rather BSD-ish.
8941 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
8945 xxx="probably a USG one, i.e. you use setpgrp()."
8950 echo "Assuming your setpgrp is $xxx" >&4
8958 : see if bzero exists
8962 : see if signal is declared as pointer to function returning int or void
8964 xxx=`./findhdr signal.h`
8965 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
8966 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
8967 echo "You have int (*signal())() instead of void." >&4
8969 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
8970 echo "You have void (*signal())()." >&4
8972 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
8973 echo "You have int (*signal())() instead of void." >&4
8975 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
8976 echo "You have void (*signal())()." >&4
8979 case "$d_voidsig" in
8981 echo "I can't determine whether signal handler returns void or int..." >&4
8983 rp="What type does your signal handler return?"
8990 echo "As you already told me, signal handler returns void." >&4
8993 *) echo "As you already told me, signal handler returns int." >&4
9000 case "$d_voidsig" in
9001 "$define") signal_t="void";;
9006 : check for ability to cast large floats to 32-bit ints.
9008 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
9009 if $test "$intsize" -ge 4; then
9016 #include <sys/types.h>
9018 $signal_t blech(s) int s; { exit(3); }
9025 signal(SIGFPE, blech);
9027 /* Don't let compiler optimize the test away. Store the number
9028 in a writable string for gcc to pass to sscanf under HP/UX.
9030 sprintf(str, "2147483647");
9031 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
9035 /* x86 processors will probably give 0x8000 0000, which is a
9036 sign change. We don't want that. We want to mimic SPARC
9037 behavior here, which is to preserve the sign and give
9040 if (i32 != ($xxx) f)
9046 if eval $compile_ok; then
9050 echo "(I can't seem to compile the test program--assuming it can't)"
9058 echo "Nope, it can't."
9065 : check for ability to cast negative floats to unsigned
9067 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
9070 #include <sys/types.h>
9072 $signal_t blech(s) int s; { exit(7); }
9073 $signal_t blech_in_list(s) int s; { exit(4); }
9074 unsigned long dummy_long(p) unsigned long p; { return p; }
9075 unsigned int dummy_int(p) unsigned int p; { return p; }
9076 unsigned short dummy_short(p) unsigned short p; { return p; }
9080 unsigned long along;
9082 unsigned short ashort;
9086 /* Frustrate gcc-2.7.2's optimizer which failed this test with
9087 a direct f = -123. assignment. gcc-2.8.0 reportedly
9088 optimized the whole file away
9090 /* Store the number in a writable string for gcc to pass to
9093 sprintf(str, "-123");
9094 sscanf(str, "%lf", &f); /* f = -123.; */
9096 signal(SIGFPE, blech);
9097 along = (unsigned long)f;
9098 aint = (unsigned int)f;
9099 ashort = (unsigned short)f;
9100 if (along != (unsigned long)-123)
9102 if (aint != (unsigned int)-123)
9104 if (ashort != (unsigned short)-123)
9106 sprintf(str, "1073741824.");
9107 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
9110 along = (unsigned long)f;
9111 if (along != 0x80000000)
9115 along = (unsigned long)f;
9116 if (along != 0x7fffffff)
9120 along = (unsigned long)f;
9121 if (along != 0x80000001)
9125 signal(SIGFPE, blech_in_list);
9126 sprintf(str, "123.");
9127 sscanf(str, "%lf", &f); /* f = 123.; */
9128 along = dummy_long((unsigned long)f);
9129 aint = dummy_int((unsigned int)f);
9130 ashort = dummy_short((unsigned short)f);
9131 if (along != (unsigned long)123)
9133 if (aint != (unsigned int)123)
9135 if (ashort != (unsigned short)123)
9142 if eval $compile_ok; then
9146 echo "(I can't seem to compile the test program--assuming it can't)"
9149 case "$castflags" in
9154 echo "Nope, it can't."
9161 : see if vprintf exists
9163 if set vprintf val -f d_vprintf; eval $csym; $val; then
9164 echo 'vprintf() found.' >&4
9167 #include <varargs.h>
9169 int main() { xxx("foo"); }
9178 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
9182 if eval $compile && $run ./try; then
9183 echo "Your vsprintf() returns (int)." >&4
9186 echo "Your vsprintf() returns (char*)." >&4
9190 echo 'vprintf() NOT found.' >&4
9201 : see if chown exists
9205 : see if chroot exists
9209 : see if chsize exists
9213 : see if class exists
9217 hasstruct='varname=$1; struct=$2; shift; shift;
9218 while $test $# -ge 2; do
9220 $define) echo "#include <$2>";;
9224 echo "int main () { struct $struct foo; }" >> try.c;
9226 if eval $compile; then
9235 : see if sys/types.h has to be included
9236 set sys/types.h i_systypes
9239 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
9240 while $test $# -ge 2; do
9242 $define) echo "#include <$2>";;
9246 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
9248 if eval $compile; then
9259 : see whether socket exists
9261 $echo $n "Hmm... $c" >&4
9262 if set socket val -f d_socket; eval $csym; $val; then
9263 echo "Looks like you have Berkeley networking support." >&4
9265 if set setsockopt val -f; eval $csym; $val; then
9268 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
9272 if $contains socklib libc.list >/dev/null 2>&1; then
9273 echo "Looks like you have Berkeley networking support." >&4
9275 : we will have to assume that it supports the 4.2 BSD interface
9278 echo "You don't have Berkeley networking in libc$_a..." >&4
9279 if test "X$d_socket" = "X$define"; then
9280 echo "...but you seem to believe that you have sockets." >&4
9282 for net in net socket
9284 if test -f /usr/lib/lib$net$_a; then
9285 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
9286 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
9287 if $contains socket libc.list >/dev/null 2>&1; then
9292 echo "...but the Wollongong group seems to have hacked it in." >&4
9293 sockethdr="-I/usr/netinclude"
9296 echo "Found Berkeley sockets interface in lib$net." >&4
9297 if $contains setsockopt libc.list >/dev/null 2>&1; then
9300 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
9307 if test "X$d_socket" != "X$define"; then
9308 echo "or anywhere else I see." >&4
9316 : see if socketpair exists
9317 set socketpair d_sockpair
9322 echo "Checking the availability of certain socket constants..." >&4
9323 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
9324 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
9326 #include <sys/types.h>
9327 #include <sys/socket.h>
9333 set try; if eval $compile; then
9336 set d_${enum}; eval $setvar
9340 : see if this is a sys/uio.h system
9341 set sys/uio.h i_sysuio
9346 echo "Checking to see if your system supports struct cmsghdr..." >&4
9347 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
9349 case "$d_cmsghdr_s" in
9350 "$define") echo "Yes, it does." ;;
9351 *) echo "No, it doesn't." ;;
9355 : check for const keyword
9357 echo 'Checking to see if your C compiler knows about "const"...' >&4
9358 $cat >const.c <<'EOCP'
9359 typedef struct spug { int drokk; } spug;
9366 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
9368 echo "Yup, it does."
9371 echo "Nope, it doesn't."
9376 : see if crypt exists
9381 $define) cryptlib='' ;;
9382 *) if set crypt val -f d_crypt; eval $csym; $val; then
9383 echo 'crypt() found.' >&4
9387 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
9388 if $test -z "$cryptlib"; then
9389 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
9393 if $test -z "$cryptlib"; then
9394 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
9398 if $test -z "$cryptlib"; then
9399 cryptlib=`./loc libcrypt$_a "" $libpth`
9403 if $test -z "$cryptlib"; then
9404 echo 'crypt() NOT found.' >&4
9415 : get csh whereabouts
9417 'csh') val="$undef" ;;
9422 : Respect a hint or command line value for full_csh.
9424 '') full_csh=$csh ;;
9427 : see if cuserid exists
9428 set cuserid d_cuserid
9431 : see if this is a limits.h system
9432 set limits.h i_limits
9435 : see if this is a float.h system
9439 : See if number of significant digits in a double precision number is known
9441 $cat >dbl_dig.c <<EOM
9451 printf("Contains DBL_DIG");
9454 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
9455 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
9456 echo "DBL_DIG found." >&4
9459 echo "DBL_DIG NOT found." >&4
9466 hasproto='varname=$1; func=$2; shift; shift;
9467 while $test $# -ge 2; do
9469 $define) echo "#include <$2>";;
9473 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
9474 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
9475 echo "$func() prototype found.";
9478 echo "$func() prototype NOT found.";
9483 $rm -f try.c tryout.c'
9485 : see if dbm.h is available
9486 : see if dbmclose exists
9487 set dbmclose d_dbmclose
9490 case "$d_dbmclose" in
9500 *) set rpcsvc/dbm.h i_rpcsvcdbm
9505 *) echo "We won't be including <dbm.h>"
9515 : see if prototype for dbminit is available
9517 set d_dbminitproto dbminit $i_dbm dbm.h
9520 : see if difftime exists
9521 set difftime d_difftime
9524 : see if this is a dirent system
9526 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
9528 echo "<dirent.h> found." >&4
9531 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
9532 echo "<sys/dir.h> found." >&4
9535 xinc=`./findhdr sys/ndir.h`
9537 echo "<dirent.h> NOT found." >&4
9542 : Look for type of directory structure.
9544 $cppstdin $cppflags $cppminus < "$xinc" > try.c
9546 case "$direntrytype" in
9549 $define) guess1='struct dirent' ;;
9550 *) guess1='struct direct' ;;
9553 *) guess1="$direntrytype"
9558 'struct dirent') guess2='struct direct' ;;
9559 *) guess2='struct dirent' ;;
9562 if $contains "$guess1" try.c >/dev/null 2>&1; then
9563 direntrytype="$guess1"
9564 echo "Your directory entries are $direntrytype." >&4
9565 elif $contains "$guess2" try.c >/dev/null 2>&1; then
9566 direntrytype="$guess2"
9567 echo "Your directory entries seem to be $direntrytype." >&4
9569 echo "I don't recognize your system's directory entries." >&4
9570 rp="What type is used for directory entries on this system?"
9578 : see if the directory entry stores field length
9580 $cppstdin $cppflags $cppminus < "$xinc" > try.c
9581 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
9582 echo "Good, your directory entry keeps length information in d_namlen." >&4
9585 echo "Your directory entry does not know about the d_namlen field." >&4
9592 : see if this is an sysdir system
9593 set sys/dir.h i_sysdir
9596 : see if this is an sysndir system
9597 set sys/ndir.h i_sysndir
9604 #$i_dirent I_DIRENT /**/
9605 #$i_sysdir I_SYS_DIR /**/
9606 #$i_sysndir I_SYS_NDIR /**/
9607 #$i_systypes I_SYS_TYPES /**/
9608 #if defined(I_SYS_TYPES)
9609 #include <sys/types.h>
9611 #if defined(I_DIRENT)
9613 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
9614 #include <sys/dir.h>
9618 #include <sys/ndir.h>
9622 #include <ndir.h> /* may be wrong in the future */
9624 #include <sys/dir.h>
9630 DIR *dirp = opendir(".");
9631 if (dirfd(dirp) >= 0)
9638 if eval $compile; then
9642 $define) echo "dirfd() found." >&4 ;;
9643 *) echo "dirfd() NOT found." >&4 ;;
9649 : see if dlerror exists
9652 set dlerror d_dlerror
9656 : see if dlfcn is available
9664 On a few systems, the dynamically loaded modules that perl generates and uses
9665 will need a different extension than shared libs. The default will probably
9673 rp='What is the extension of dynamically loaded modules'
9682 : Check if dlsym need a leading underscore
9688 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
9689 $cat >dyna.c <<'EOM'
9698 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
9700 #include <sys/types.h>
9714 int mode = RTLD_LAZY ;
9716 handle = dlopen("./dyna.$dlext", mode) ;
9717 if (handle == NULL) {
9722 symbol = dlsym(handle, "fred") ;
9723 if (symbol == NULL) {
9724 /* try putting a leading underscore */
9725 symbol = dlsym(handle, "_fred") ;
9726 if (symbol == NULL) {
9739 : Call the object file tmp-dyna.o in case dlext=o.
9740 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
9741 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
9742 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
9743 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
9746 1) echo "Test program failed using dlopen." >&4
9747 echo "Perhaps you should not use dynamic loading." >&4;;
9748 2) echo "Test program failed using dlsym." >&4
9749 echo "Perhaps you should not use dynamic loading." >&4;;
9750 3) echo "dlsym needs a leading underscore" >&4
9752 4) echo "dlsym doesn't need a leading underscore." >&4;;
9755 echo "I can't compile and run the test program." >&4
9756 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
9761 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
9766 : see if prototype for drand48 is available
9768 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
9771 : see if dup2 exists
9775 : see if eaccess exists
9776 set eaccess d_eaccess
9779 : see if endgrent exists
9780 set endgrent d_endgrent
9783 : see if endhostent exists
9784 set endhostent d_endhent
9787 : see if endnetent exists
9788 set endnetent d_endnent
9791 : see if endprotoent exists
9792 set endprotoent d_endpent
9795 : see if endpwent exists
9796 set endpwent d_endpwent
9799 : see if endservent exists
9800 set endservent d_endsent
9803 : Locate the flags for 'open()'
9805 $cat >try.c <<'EOCP'
9806 #include <sys/types.h>
9811 #include <sys/file.h>
9822 : check sys/file.h first to get FREAD on Sun
9823 if $test `./findhdr sys/file.h` && \
9824 set try -DI_SYS_FILE && eval $compile; then
9826 echo "<sys/file.h> defines the O_* constants..." >&4
9828 echo "and you have the 3 argument form of open()." >&4
9831 echo "but not the 3 argument form of open(). Oh, well." >&4
9834 elif $test `./findhdr fcntl.h` && \
9835 set try -DI_FCNTL && eval $compile; then
9837 echo "<fcntl.h> defines the O_* constants..." >&4
9839 echo "and you have the 3 argument form of open()." >&4
9842 echo "but not the 3 argument form of open(). Oh, well." >&4
9847 echo "I can't find the O_* constant definitions! You got problems." >&4
9853 : see which of string.h or strings.h is needed
9855 strings=`./findhdr string.h`
9856 if $test "$strings" && $test -r "$strings"; then
9857 echo "Using <string.h> instead of <strings.h>." >&4
9861 strings=`./findhdr strings.h`
9862 if $test "$strings" && $test -r "$strings"; then
9863 echo "Using <strings.h> instead of <string.h>." >&4
9865 echo "No string header found -- You'll surely have problems." >&4
9871 "$undef") strings=`./findhdr strings.h`;;
9872 *) strings=`./findhdr string.h`;;
9875 : see if this is a sys/file.h system
9880 : do we need to include sys/file.h ?
9886 echo "We'll be including <sys/file.h>." >&4
9889 echo "We won't be including <sys/file.h>." >&4
9899 : see if fcntl.h is there
9904 : see if we can include fcntl.h
9910 echo "We'll be including <fcntl.h>." >&4
9914 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
9916 echo "We won't be including <fcntl.h>." >&4
9928 : check for non-blocking I/O stuff
9929 case "$h_sysfile" in
9930 true) echo "#include <sys/file.h>" > head.c;;
9933 true) echo "#include <fcntl.h>" > head.c;;
9934 *) echo "#include <sys/fcntl.h>" > head.c;;
9939 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
9940 case "$o_nonblock" in
9952 printf("O_NONBLOCK\n");
9956 printf("O_NDELAY\n");
9960 printf("FNDELAY\n");
9967 if eval $compile_ok; then
9968 o_nonblock=`$run ./try`
9969 case "$o_nonblock" in
9970 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
9971 *) echo "Seems like we can use $o_nonblock.";;
9974 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
9977 *) echo "Using $hint value $o_nonblock.";;
9979 $rm -f try try.* .out core
9982 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
9988 #include <sys/types.h>
9996 #define MY_O_NONBLOCK $o_nonblock
9997 #ifndef errno /* XXX need better Configure test */
10000 #$i_unistd I_UNISTD
10002 #include <unistd.h>
10004 #$i_string I_STRING
10006 #include <string.h>
10008 #include <strings.h>
10010 $signal_t blech(x) int x; { exit(3); }
10012 $cat >> try.c <<'EOCP'
10020 pipe(pd); /* Down: child -> parent */
10021 pipe(pu); /* Up: parent -> child */
10024 close(pd[1]); /* Parent reads from pd[0] */
10025 close(pu[0]); /* Parent writes (blocking) to pu[1] */
10027 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
10032 signal(SIGALRM, blech);
10034 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
10036 sprintf(string, "%d\n", ret);
10037 write(2, string, strlen(string));
10040 if (errno == EAGAIN) {
10041 printf("EAGAIN\n");
10046 if (errno == EWOULDBLOCK)
10047 printf("EWOULDBLOCK\n");
10050 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
10051 sleep(2); /* Give it time to close our pipe */
10053 ret = read(pd[0], buf, 1); /* Should read EOF */
10055 sprintf(string, "%d\n", ret);
10056 write(3, string, strlen(string));
10060 close(pd[0]); /* We write to pd[1] */
10061 close(pu[1]); /* We read from pu[0] */
10062 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
10063 close(pd[1]); /* Pipe pd is now fully closed! */
10064 exit(0); /* Bye bye, thank you for playing! */
10068 if eval $compile_ok; then
10069 echo "$startsh" >mtry
10070 echo "$run ./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
10072 ./mtry >/dev/null 2>&1
10074 0) eagain=`$cat try.out`;;
10075 1) echo "Could not perform non-blocking setting!";;
10076 2) echo "I did a successful read() for something that was not there!";;
10077 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
10078 4) echo "Could not find F_SETFL!";;
10079 *) echo "Something terribly wrong happened during testing.";;
10081 rd_nodata=`$cat try.ret`
10082 echo "A read() system call with no data present returns $rd_nodata."
10083 case "$rd_nodata" in
10086 echo "(That's peculiar, fixing that to be -1.)"
10092 echo "Forcing errno EAGAIN on read() with no data available."
10096 echo "Your read() sets errno to $eagain when no data is available."
10099 status=`$cat try.err`
10101 0) echo "And it correctly returns 0 to signal EOF.";;
10102 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
10103 *) echo "However, your read() returns '$status' on EOF??";;
10106 if test "$status" = "$rd_nodata"; then
10107 echo "WARNING: you can't distinguish between EOF and no data!"
10111 echo "I can't compile the test program--assuming errno EAGAIN will do."
10118 echo "Using $hint value $eagain."
10119 echo "Your read() returns $rd_nodata when no data is present."
10120 case "$d_eofnblk" in
10121 "$define") echo "And you can see EOF because read() returns 0.";;
10122 "$undef") echo "But you can't see EOF status from read() returned value.";;
10124 echo "(Assuming you can't see EOF status from read anyway.)"
10130 $rm -f try try.* .out core head.c mtry
10132 : see if fchdir exists
10133 set fchdir d_fchdir
10136 : see if fchmod exists
10137 set fchmod d_fchmod
10140 : see if fchown exists
10141 set fchown d_fchown
10144 : see if this is an fcntl system
10149 : See if fcntl-based locking works.
10151 #include <stdlib.h>
10152 #include <unistd.h>
10154 #include <signal.h>
10155 $signal_t blech(x) int x; { exit(3); }
10157 #if defined(F_SETLK) && defined(F_SETLKW)
10158 struct flock flock;
10160 fd = open("try.c", O_RDONLY);
10161 flock.l_type = F_RDLCK;
10162 flock.l_whence = SEEK_SET;
10163 flock.l_start = flock.l_len = 0;
10164 signal(SIGALRM, blech);
10166 retval = fcntl(fd, F_SETLK, &flock);
10168 (retval < 0 ? exit(2) : exit(0));
10174 echo "Checking if fcntl-based file locking works... "
10178 if eval $compile_ok; then
10179 if $run ./try; then
10180 echo "Yes, it seems to work."
10183 echo "Nope, it didn't work."
10188 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
10189 *** This is (almost) impossible.
10190 *** If your NFS lock daemons are not feeling well, something like
10191 *** this may happen, please investigate. Cannot continue, aborting.
10199 echo "I'm unable to compile the test program, so I'll assume not."
10204 echo "Nope, since you don't even have fcntl()."
10207 set d_fcntl_can_lock
10212 : see if sys/select.h has to be included
10213 set sys/select.h i_sysselct
10216 : see if we should include time.h, sys/time.h, or both
10218 if test "X$timeincl" = X; then
10219 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10220 $echo $n "I'm now running the test program...$c"
10221 $cat >try.c <<'EOCP'
10222 #include <sys/types.h>
10227 #ifdef SYSTIMEKERNEL
10230 #include <sys/time.h>
10233 #include <sys/select.h>
10239 struct timeval bar;
10242 struct timezone tzp;
10244 if (foo.tm_sec == foo.tm_sec)
10247 if (bar.tv_sec == bar.tv_sec)
10254 for s_timezone in '-DS_TIMEZONE' ''; do
10256 for s_timeval in '-DS_TIMEVAL' ''; do
10257 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10258 for i_time in '' '-DI_TIME'; do
10259 for i_systime in '-DI_SYSTIME' ''; do
10262 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10263 if eval $compile; then
10264 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10268 $echo $n "Succeeded with $flags$c"
10280 *SYSTIMEKERNEL*) i_systimek="$define"
10281 timeincl=`./findhdr sys/time.h`
10282 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10283 *) i_systimek="$undef";;
10286 *I_TIME*) i_time="$define"
10287 timeincl=`./findhdr time.h`" $timeincl"
10288 echo "We'll include <time.h>." >&4;;
10289 *) i_time="$undef";;
10292 *I_SYSTIME*) i_systime="$define"
10293 timeincl=`./findhdr sys/time.h`" $timeincl"
10294 echo "We'll include <sys/time.h>." >&4;;
10295 *) i_systime="$undef";;
10300 : check for fd_set items
10303 Checking to see how well your C compiler handles fd_set and friends ...
10306 #$i_systime I_SYS_TIME
10307 #$i_sysselct I_SYS_SELECT
10308 #$d_socket HAS_SOCKET
10309 #include <sys/types.h>
10311 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
10314 #include <sys/time.h>
10316 #ifdef I_SYS_SELECT
10317 #include <sys/select.h>
10326 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
10334 if eval $compile; then
10335 d_fds_bits="$define"
10337 echo "Well, your system knows about the normal fd_set typedef..." >&4
10338 if $run ./try; then
10339 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
10340 d_fd_macros="$define"
10343 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
10345 d_fd_macros="$undef"
10349 Hmm, your compiler has some difficulty with fd_set. Checking further...
10352 if eval $compile; then
10353 d_fds_bits="$undef"
10355 echo "Well, your system has some sort of fd_set available..." >&4
10356 if $run ./try; then
10357 echo "and you have the normal fd_set macros." >&4
10358 d_fd_macros="$define"
10361 but not the normal fd_set macros! Gross! More work for me...
10363 d_fd_macros="$undef"
10366 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
10368 d_fds_bits="$undef"
10369 d_fd_macros="$undef"
10374 : see if fgetpos exists
10375 set fgetpos d_fgetpos
10378 : see if finite exists
10379 set finite d_finite
10382 : see if finitel exists
10383 set finitel d_finitel
10386 : see if flock exists
10390 : see if prototype for flock is available
10392 set d_flockproto flock $i_sysfile sys/file.h
10395 : see if fork exists
10399 : see if fp_class exists
10400 set fp_class d_fp_class
10403 : see if pathconf exists
10404 set pathconf d_pathconf
10407 : see if fpathconf exists
10408 set fpathconf d_fpathconf
10411 : see if fpclass exists
10412 set fpclass d_fpclass
10415 : see if fpclassify exists
10416 set fpclassify d_fpclassify
10419 : see if fpclassl exists
10420 set fpclassl d_fpclassl
10424 : check for fpos64_t
10426 echo "Checking to see if you have fpos64_t..." >&4
10429 int main() { fpos64_t x = 7; }
10432 if eval $compile; then
10434 echo "You have fpos64_t."
10437 echo "You do not have fpos64_t."
10438 case "$fpossize" in
10439 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
10446 : see if frexpl exists
10447 set frexpl d_frexpl
10450 : see if this is a sys/param system
10451 set sys/param.h i_sysparam
10454 : see if this is a sys/mount.h system
10455 set sys/mount.h i_sysmount
10460 echo "Checking to see if your system supports struct fs_data..." >&4
10461 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
10463 case "$d_fs_data_s" in
10464 "$define") echo "Yes, it does." ;;
10465 *) echo "No, it doesn't." ;;
10468 : see if fseeko exists
10469 set fseeko d_fseeko
10471 case "$longsize" in
10472 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
10475 : see if fsetpos exists
10476 set fsetpos d_fsetpos
10480 : see if fstatfs exists
10481 set fstatfs d_fstatfs
10485 : see if statvfs exists
10486 set statvfs d_statvfs
10489 : see if fstatvfs exists
10490 set fstatvfs d_fstatvfs
10494 : see if fsync exists
10498 : see if ftello exists
10499 set ftello d_ftello
10501 case "$longsize" in
10502 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
10505 : see if getcwd exists
10506 set getcwd d_getcwd
10509 : see if getespwnam exists
10510 set getespwnam d_getespwnam
10514 : see if getfsstat exists
10515 set getfsstat d_getfsstat
10518 : see if getgrent exists
10519 set getgrent d_getgrent
10522 : see if gethostbyaddr exists
10523 set gethostbyaddr d_gethbyaddr
10526 : see if gethostbyname exists
10527 set gethostbyname d_gethbyname
10530 : see if gethostent exists
10531 set gethostent d_gethent
10534 : see how we will look up host name
10537 if set gethostname val -f d_gethname; eval $csym; $val; then
10538 echo 'gethostname() found.' >&4
10539 d_gethname="$define"
10542 if set uname val -f d_uname; eval $csym; $val; then
10545 uname() was found, but you're running xenix, and older versions of xenix
10546 have a broken uname(). If you don't really know whether your xenix is old
10547 enough to have a broken system call, use the default answer.
10552 "$define") dflt=n;;
10554 rp='Is your uname() broken?'
10557 n*) d_uname="$define"; call=uname;;
10560 echo 'uname() found.' >&4
10567 case "$d_gethname" in
10568 '') d_gethname="$undef";;
10571 '') d_uname="$undef";;
10573 case "$d_uname$d_gethname" in
10578 Every now and then someone has a $call() that lies about the hostname
10579 but can't be fixed for political or economic reasons. If you wish, I can
10580 pretend $call() isn't there and maybe compute hostname at run-time
10581 thanks to the '$phostname' command.
10584 rp="Shall I ignore $call() from now on?"
10587 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
10590 case "$phostname" in
10591 '') aphostname='';;
10592 *) case "$aphostname" in
10594 *) set X $phostname
10598 file=`./loc $file $file $pth`
10599 aphostname=`echo $file $*`
10604 case "$d_uname$d_gethname" in
10607 case "$phostname" in
10609 echo "There will be no way for $package to get your hostname." >&4;;
10611 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
10615 case "$d_phostname" in
10616 '') d_phostname="$undef";;
10619 : see if this is a netdb.h system
10620 set netdb.h i_netdb
10623 : see if prototypes for various gethostxxx netdb.h functions are available
10625 set d_gethostprotos gethostent $i_netdb netdb.h
10628 : see if getitimer exists
10629 set getitimer d_getitimer
10632 : see if getlogin exists
10633 set getlogin d_getlogin
10636 : see if getmnt exists
10637 set getmnt d_getmnt
10640 : see if getmntent exists
10641 set getmntent d_getmntent
10644 : see if getnetbyaddr exists
10645 set getnetbyaddr d_getnbyaddr
10648 : see if getnetbyname exists
10649 set getnetbyname d_getnbyname
10652 : see if getnetent exists
10653 set getnetent d_getnent
10656 : see if prototypes for various getnetxxx netdb.h functions are available
10658 set d_getnetprotos getnetent $i_netdb netdb.h
10661 : see if getpagesize exists
10662 set getpagesize d_getpagsz
10666 : see if getprotobyname exists
10667 set getprotobyname d_getpbyname
10670 : see if getprotobynumber exists
10671 set getprotobynumber d_getpbynumber
10674 : see if getprotoent exists
10675 set getprotoent d_getpent
10678 : see if getpgid exists
10679 set getpgid d_getpgid
10682 : see if getpgrp2 exists
10683 set getpgrp2 d_getpgrp2
10686 : see if getppid exists
10687 set getppid d_getppid
10690 : see if getpriority exists
10691 set getpriority d_getprior
10694 : see if prototypes for various getprotoxxx netdb.h functions are available
10696 set d_getprotoprotos getprotoent $i_netdb netdb.h
10699 : see if getprpwnam exists
10700 set getprpwnam d_getprpwnam
10703 : see if getpwent exists
10704 set getpwent d_getpwent
10708 : see if getservbyname exists
10709 set getservbyname d_getsbyname
10712 : see if getservbyport exists
10713 set getservbyport d_getsbyport
10716 : see if getservent exists
10717 set getservent d_getsent
10720 : see if prototypes for various getservxxx netdb.h functions are available
10722 set d_getservprotos getservent $i_netdb netdb.h
10725 : see if getspnam exists
10726 set getspnam d_getspnam
10729 : see if gettimeofday or ftime exists
10730 set gettimeofday d_gettimeod
10732 case "$d_gettimeod" in
10738 val="$undef"; set d_ftime; eval $setvar
10741 case "$d_gettimeod$d_ftime" in
10744 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
10748 : see if this is an grp system
10754 xxx=`./findhdr grp.h`
10755 $cppstdin $cppflags $cppminus < $xxx >$$.h
10757 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
10769 set d_grpasswd; eval $setvar
10773 : see if hasmntopt exists
10774 set hasmntopt d_hasmntopt
10777 : see if this is a netinet/in.h or sys/in.h system
10778 set netinet/in.h i_niin sys/in.h i_sysin
10781 : see if arpa/inet.h has to be included
10782 set arpa/inet.h i_arpainet
10785 : see if htonl --and friends-- exists
10790 : Maybe they are macros.
10793 $cat >htonl.c <<EOM
10795 #include <sys/types.h>
10796 #$i_niin I_NETINET_IN
10798 #$i_arpainet I_ARPA_INET
10799 #ifdef I_NETINET_IN
10800 #include <netinet/in.h>
10803 #include <sys/in.h>
10806 #include <arpa/inet.h>
10809 printf("Defined as a macro.");
10812 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
10813 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
10815 echo "But it seems to be defined as a macro." >&4
10825 if set index val -f; eval $csym; $val; then
10826 if set strchr val -f d_strchr; eval $csym; $val; then
10827 if $contains strchr "$strings" >/dev/null 2>&1 ; then
10830 echo "strchr() found." >&4
10834 echo "index() found." >&4
10839 echo "index() found." >&4
10842 if set strchr val -f d_strchr; eval $csym; $val; then
10845 echo "strchr() found." >&4
10847 echo "No index() or strchr() found!" >&4
10852 set d_strchr; eval $setvar
10854 set d_index; eval $setvar
10856 : check whether inet_aton exists
10857 set inet_aton d_inetaton
10862 $cat >isascii.c <<'EOCP'
10874 if eval $compile; then
10875 echo "isascii() found." >&4
10878 echo "isascii() NOT found." >&4
10885 : see if isfinite exists
10886 set isfinite d_isfinite
10889 : see if isinf exists
10893 : see if isnan exists
10897 : see if isnanl exists
10898 set isnanl d_isnanl
10901 : see if killpg exists
10902 set killpg d_killpg
10905 : see if lchown exists
10907 $cat > try.c <<'EOCP'
10908 /* System header to define __stub macros and hopefully few prototypes,
10909 which can conflict with char lchown(); below. */
10910 #include <assert.h>
10911 /* Override any gcc2 internal prototype to avoid an error. */
10912 /* We use char because int might match the return type of a gcc2
10913 builtin and then its argument prototype would still apply. */
10916 /* The GNU C library defines this for functions which it implements
10917 to always fail with ENOSYS. Some functions are actually named
10918 something starting with __ and the normal name is an alias. */
10919 #if defined (__stub_lchown) || defined (__stub___lchown)
10927 if eval $compile; then
10928 $echo "lchown() found." >&4
10931 $echo "lchown() NOT found." >&4
10937 : See if number of significant digits in a double precision number is known
10939 $cat >ldbl_dig.c <<EOM
10940 #$i_limits I_LIMITS
10943 #include <limits.h>
10949 printf("Contains LDBL_DIG");
10952 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
10953 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
10954 echo "LDBL_DIG found." >&4
10957 echo "LDBL_DIG NOT found." >&4
10964 : see if link exists
10968 : see if localeconv exists
10969 set localeconv d_locconv
10972 : see if lockf exists
10976 : see if prototype for lseek is available
10978 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
10981 : see if lstat exists
10985 : see if madvise exists
10986 set madvise d_madvise
10989 : see if mblen exists
10993 : see if mbstowcs exists
10994 set mbstowcs d_mbstowcs
10997 : see if mbtowc exists
10998 set mbtowc d_mbtowc
11001 : see if memchr exists
11002 set memchr d_memchr
11005 : see if memcmp exists
11006 set memcmp d_memcmp
11009 : see if memcpy exists
11010 set memcpy d_memcpy
11013 : see if memmove exists
11014 set memmove d_memmove
11017 : see if memset exists
11018 set memset d_memset
11021 : see if mkdir exists
11025 : see if mkdtemp exists
11026 set mkdtemp d_mkdtemp
11029 : see if mkfifo exists
11030 set mkfifo d_mkfifo
11033 : see if mkstemp exists
11034 set mkstemp d_mkstemp
11037 : see if mkstemps exists
11038 set mkstemps d_mkstemps
11041 : see if mktime exists
11042 set mktime d_mktime
11045 : see if this is a sys/mman.h system
11046 set sys/mman.h i_sysmman
11049 : see if mmap exists
11052 : see what shmat returns
11053 : default to something harmless
11055 case "$i_sysmman$d_mmap" in
11057 $cat >mmap.c <<'END'
11058 #include <sys/mman.h>
11061 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
11066 echo "and it returns ($mmaptype)." >&4
11072 : see if modfl exists
11076 d_modfl_pow32_bug="$undef"
11078 case "$d_longdbl$d_modfl" in
11081 Checking to see whether your modfl() is okay for large values...
11087 long double nv = 4294967303.15;
11093 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
11097 case "$osname:$gccversion" in
11098 aix:) saveccflags="$ccflags"
11099 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
11102 if eval $compile; then
11105 *" 4294967303.150000 1.150000 4294967302.000000")
11106 echo >&4 "Your modfl() is broken for large values."
11107 d_modfl_pow32_bug="$define"
11109 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
11113 *" 4294967303.150000 0.150000 4294967303.000000")
11114 echo >&4 "Your modfl() seems okay for large values."
11116 *) echo >&4 "I don't understand your modfl() at all."
11120 $rm -f try.* try core core.try.*
11122 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
11125 case "$osname:$gccversion" in
11126 aix:) ccflags="$saveccflags" ;; # restore
11131 : see if mprotect exists
11132 set mprotect d_mprotect
11135 : see if msgctl exists
11136 set msgctl d_msgctl
11139 : see if msgget exists
11140 set msgget d_msgget
11143 : see if msgsnd exists
11144 set msgsnd d_msgsnd
11147 : see if msgrcv exists
11148 set msgrcv d_msgrcv
11151 : see how much of the 'msg*(2)' library is present.
11154 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
11155 *"$undef"*) h_msg=false;;
11159 case "`ipcs 2>&1`" in
11160 "SVID messages"*"not configured"*)
11161 echo "Your $osname does not have the msg*(2) configured." >&4
11164 set msgctl d_msgctl
11166 set msgget d_msgget
11168 set msgsnd d_msgsnd
11170 set msgrcv d_msgrcv
11176 : we could also check for sys/ipc.h ...
11177 if $h_msg && $test `./findhdr sys/msg.h`; then
11178 echo "You have the full msg*(2) library." >&4
11181 echo "You don't have the full msg*(2) library." >&4
11189 echo "Checking to see if your system supports struct msghdr..." >&4
11190 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
11192 case "$d_msghdr_s" in
11193 "$define") echo "Yes, it does." ;;
11194 *) echo "No, it doesn't." ;;
11198 : see if msync exists
11202 : see if munmap exists
11203 set munmap d_munmap
11206 : see if nice exists
11210 : see if this is a langinfo.h system
11211 set langinfo.h i_langinfo
11214 : see if nl_langinfo exists
11215 set nl_langinfo d_nl_langinfo
11218 : check for length of character
11220 case "$charsize" in
11222 echo "Checking to see how big your characters are (hey, you never know)..." >&4
11223 $cat >try.c <<'EOCP'
11227 printf("%d\n", (int)sizeof(char));
11232 if eval $compile_ok; then
11236 echo "(I can't seem to compile the test program. Guessing...)"
11243 rp="What is the size of a character (in bytes)?"
11248 : check for volatile keyword
11250 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
11251 $cat >try.c <<'EOCP'
11254 typedef struct _goo_struct goo_struct;
11255 goo_struct * volatile goo = ((goo_struct *)0);
11256 struct _goo_struct {
11261 typedef unsigned short foo_t;
11262 char *volatile foo;
11264 volatile foo_t blech;
11268 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
11270 echo "Yup, it does."
11273 echo "Nope, it doesn't."
11281 $echo "Choosing the C types to be used for Perl's internal types..." >&4
11283 case "$use64bitint:$d_quad:$quadtype" in
11286 uvtype="$uquadtype"
11291 uvtype="unsigned long"
11297 case "$uselongdouble:$d_longdbl" in
11299 nvtype="long double"
11300 nvsize=$longdblsize
11307 $echo "(IV will be "$ivtype", $ivsize bytes)"
11308 $echo "(UV will be "$uvtype", $uvsize bytes)"
11309 $echo "(NV will be "$nvtype", $nvsize bytes)"
11312 #$i_inttypes I_INTTYPES
11314 #include <inttypes.h>
11319 int8_t i = INT8_MAX;
11320 uint8_t u = UINT8_MAX;
11321 printf("int8_t\n");
11324 int16_t i = INT16_MAX;
11325 uint16_t i = UINT16_MAX;
11326 printf("int16_t\n");
11329 int32_t i = INT32_MAX;
11330 uint32_t u = UINT32_MAX;
11331 printf("int32_t\n");
11337 '') case "$charsize" in
11339 u8type="unsigned char"
11348 if eval $compile; then
11349 case "`$run ./try`" in
11350 int8_t) i8type=int8_t
11360 '') if $test $charsize -ge 1; then
11362 u8type="unsigned char"
11370 '') case "$shortsize" in
11372 u16type="unsigned short"
11380 '') set try -DINT16
11381 if eval $compile; then
11382 case "`$run ./try`" in
11394 '') if $test $shortsize -ge 2; then
11396 u16type="unsigned short"
11404 '') case "$longsize" in
11406 u32type="unsigned long"
11410 *) case "$intsize" in
11412 u32type="unsigned int"
11422 '') set try -DINT32
11423 if eval $compile; then
11424 case "`$run ./try`" in
11436 '') if $test $intsize -ge 4; then
11438 u32type="unsigned int"
11446 '') case "$d_quad:$quadtype" in
11448 i64type="$quadtype"
11449 u64type="$uquadtype"
11457 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
11458 : volatile so that the compiler has to store it out to memory.
11459 if test X"$d_volatile" = X"$define"; then
11464 #include <sys/types.h>
11465 #include <signal.h>
11467 $volatile int bletched = 0;
11468 $signal_t blech(s) int s; { bletched = 1; }
11473 int n = 8 * $uvsize;
11476 signal(SIGFPE, blech);
11479 for (i = 0; i < n; i++) {
11480 u = u << 1 | ($uvtype)1;
11482 if (($uvtype)d != u)
11486 d = ($nvtype)(u - 1);
11487 if (($uvtype)d != (u - 1))
11495 printf("%d\n", ((i == n) ? -n : i));
11501 d_nv_preserves_uv="$undef"
11502 if eval $compile; then
11503 d_nv_preserves_uv_bits="`$run ./try`"
11505 case "$d_nv_preserves_uv_bits" in
11507 d_nv_preserves_uv_bits=`expr 0 - $d_nv_preserves_uv_bits`
11508 $echo "Your NVs can preserve all $d_nv_preserves_uv_bits bits of your UVs." 2>&1
11509 d_nv_preserves_uv="$define"
11511 [1-9]*) $echo "Your NVs can preserve only $d_nv_preserves_uv_bits bits of your UVs." 2>&1
11512 d_nv_preserves_uv="$undef" ;;
11513 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
11514 d_nv_preserves_uv_bits="$undef" ;;
11520 : check for off64_t
11522 echo "Checking to see if you have off64_t..." >&4
11524 #include <sys/types.h>
11525 #include <unistd.h>
11526 int main() { off64_t x = 7; }
11529 if eval $compile; then
11531 echo "You have off64_t."
11534 echo "You do not have off64_t."
11535 case "$lseeksize" in
11536 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
11543 : see if POSIX threads are available
11544 set pthread.h i_pthread
11550 : how to create joinable pthreads
11551 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
11553 echo "Checking what constant to use for creating joinable pthreads..." >&4
11554 $cat >try.c <<'EOCP'
11555 #include <pthread.h>
11557 int detachstate = JOINABLE;
11560 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
11561 if eval $compile; then
11562 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
11563 val="$undef" # Yes, undef.
11564 set d_old_pthread_create_joinable
11567 set old_pthread_create_joinable
11570 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
11571 if eval $compile; then
11572 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
11574 set d_old_pthread_create_joinable
11576 val=PTHREAD_CREATE_UNDETACHED
11577 set old_pthread_create_joinable
11580 set try -DJOINABLE=__UNDETACHED
11581 if eval $compile; then
11582 echo "You seem to use __UNDETACHED." >&4
11584 set d_old_pthread_create_joinable
11587 set old_pthread_create_joinable
11590 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
11592 set d_old_pthread_create_joinable
11595 set old_pthread_create_joinable
11602 d_old_pthread_create_joinable="$undef"
11603 old_pthread_create_joinable=""
11606 : see if pause exists
11610 : see if pipe exists
11614 : see if poll exists
11618 : see if readlink exists
11619 set readlink d_readlink
11625 case "$d_readlink" in
11627 if $issymlink /proc/self/exe ; then
11628 $ls -l /proc/self/exe > reflect
11629 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
11630 echo "You have Linux-like /proc/self/exe."
11631 procselfexe='"/proc/self/exe"'
11635 if $issymlink /proc/curproc/file ; then
11636 $ls -l /proc/curproc/file > reflect
11637 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
11638 echo "You have BSD-like /proc/curproc/file."
11639 procselfexe='"/proc/curproc/file"'
11649 : see if pthread_atfork exists
11650 set pthread_atfork d_pthread_atfork
11654 : see whether the various POSIXish _yields exist
11656 #include <pthread.h>
11662 #ifdef PTHREAD_YIELD
11665 #ifdef PTHREAD_YIELD_NULL
11666 pthread_yield(NULL);
11672 : see if sched_yield exists
11673 set try -DSCHED_YIELD
11674 if eval $compile; then
11676 sched_yield='sched_yield()'
11680 case "$usethreads" in
11683 $define) echo 'sched_yield() found.' >&4 ;;
11684 *) echo 'sched_yield() NOT found.' >&4 ;;
11690 : see if pthread_yield exists
11691 set try -DPTHREAD_YIELD
11692 if eval $compile; then
11694 case "$sched_yield" in
11695 '') sched_yield='pthread_yield()' ;;
11698 set try -DPTHREAD_YIELD_NULL
11699 if eval $compile; then
11701 case "$sched_yield" in
11702 '') sched_yield='pthread_yield(NULL)' ;;
11708 case "$usethreads" in
11711 $define) echo 'pthread_yield() found.' >&4 ;;
11712 *) echo 'pthread_yield() NOT found.' >&4 ;;
11716 set d_pthread_yield
11719 case "$sched_yield" in
11720 '') sched_yield=undef ;;
11725 : see if this is a pwd.h system
11731 xxx=`./findhdr pwd.h`
11732 $cppstdin $cppflags $cppminus < $xxx >$$.h
11734 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
11742 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
11750 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
11758 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
11766 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
11774 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
11782 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
11790 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
11802 set d_pwquota; eval $setvar
11803 set d_pwage; eval $setvar
11804 set d_pwchange; eval $setvar
11805 set d_pwclass; eval $setvar
11806 set d_pwexpire; eval $setvar
11807 set d_pwcomment; eval $setvar
11808 set d_pwgecos; eval $setvar
11809 set d_pwpasswd; eval $setvar
11813 : see if readdir and friends exist
11814 set readdir d_readdir
11816 set seekdir d_seekdir
11818 set telldir d_telldir
11820 set rewinddir d_rewinddir
11823 : see if readv exists
11827 : see if recvmsg exists
11828 set recvmsg d_recvmsg
11831 : see if rename exists
11832 set rename d_rename
11835 : see if rmdir exists
11839 : see if memory.h is available.
11844 : See if it conflicts with string.h
11850 $cppstdin $cppflags $cppminus < $strings > mem.h
11851 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
11853 echo "We won't be including <memory.h>."
11863 : can bcopy handle overlapping blocks?
11866 case "$d_memmove" in
11867 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
11868 *) case "$d_bcopy" in
11870 echo "Checking to see if bcopy() can do overlapping copies..." >&4
11872 #$i_memory I_MEMORY
11873 #$i_stdlib I_STDLIB
11874 #$i_string I_STRING
11875 #$i_unistd I_UNISTD
11877 $cat >>try.c <<'EOCP'
11880 # include <memory.h>
11883 # include <stdlib.h>
11886 # include <string.h>
11888 # include <strings.h>
11891 # include <unistd.h> /* Needed for NetBSD */
11895 char buf[128], abc[128];
11901 /* Copy "abcde..." string to char abc[] so that gcc doesn't
11902 try to store the string in read-only memory. */
11903 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
11905 for (align = 7; align >= 0; align--) {
11906 for (len = 36; len; len--) {
11908 bcopy(abc, b, len);
11909 for (off = 1; off <= len; off++) {
11910 bcopy(b, b+off, len);
11911 bcopy(b+off, b, len);
11912 if (bcmp(b, abc, len))
11921 if eval $compile_ok; then
11922 if ./try 2>/dev/null; then
11923 echo "Yes, it can."
11926 echo "It can't, sorry."
11929 echo "(I can't compile the test program, so we'll assume not...)"
11933 $rm -f try.* try core
11939 : can memcpy handle overlapping blocks?
11942 case "$d_memmove" in
11943 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
11944 *) case "$d_memcpy" in
11946 echo "Checking to see if memcpy() can do overlapping copies..." >&4
11948 #$i_memory I_MEMORY
11949 #$i_stdlib I_STDLIB
11950 #$i_string I_STRING
11951 #$i_unistd I_UNISTD
11953 $cat >>try.c <<'EOCP'
11956 # include <memory.h>
11959 # include <stdlib.h>
11962 # include <string.h>
11964 # include <strings.h>
11967 # include <unistd.h> /* Needed for NetBSD */
11971 char buf[128], abc[128];
11977 /* Copy "abcde..." string to char abc[] so that gcc doesn't
11978 try to store the string in read-only memory. */
11979 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
11981 for (align = 7; align >= 0; align--) {
11982 for (len = 36; len; len--) {
11984 memcpy(b, abc, len);
11985 for (off = 1; off <= len; off++) {
11986 memcpy(b+off, b, len);
11987 memcpy(b, b+off, len);
11988 if (memcmp(b, abc, len))
11997 if eval $compile_ok; then
11998 if ./try 2>/dev/null; then
11999 echo "Yes, it can."
12002 echo "It can't, sorry."
12005 echo "(I can't compile the test program, so we'll assume not...)"
12009 $rm -f try.* try core
12015 : can memcmp be trusted to compare relative magnitude?
12017 case "$d_memcmp" in
12020 echo "Checking if your memcmp() can compare relative magnitude..." >&4
12022 #$i_memory I_MEMORY
12023 #$i_stdlib I_STDLIB
12024 #$i_string I_STRING
12025 #$i_unistd I_UNISTD
12027 $cat >>try.c <<'EOCP'
12030 # include <memory.h>
12033 # include <stdlib.h>
12036 # include <string.h>
12038 # include <strings.h>
12041 # include <unistd.h> /* Needed for NetBSD */
12047 if ((a < b) && memcmp(&a, &b, 1) < 0)
12053 if eval $compile_ok; then
12054 if $run ./try 2>/dev/null; then
12055 echo "Yes, it can."
12058 echo "No, it can't (it uses signed chars)."
12061 echo "(I can't compile the test program, so we'll assume not...)"
12065 $rm -f try.* try core
12069 : see if prototype for sbrk is available
12071 set d_sbrkproto sbrk $i_unistd unistd.h
12074 : see if select exists
12075 set select d_select
12078 : see if semctl exists
12079 set semctl d_semctl
12082 : see if semget exists
12083 set semget d_semget
12086 : see if semop exists
12090 : see how much of the 'sem*(2)' library is present.
12093 case "$d_semctl$d_semget$d_semop" in
12094 *"$undef"*) h_sem=false;;
12098 case "`ipcs 2>&1`" in
12099 "SVID messages"*"not configured"*)
12100 echo "Your $osname does not have the sem*(2) configured." >&4
12103 set semctl d_semctl
12105 set semget d_semget
12113 : we could also check for sys/ipc.h ...
12114 if $h_sem && $test `./findhdr sys/sem.h`; then
12115 echo "You have the full sem*(2) library." >&4
12118 echo "You don't have the full sem*(2) library." >&4
12124 : see whether sys/sem.h defines union semun
12126 $cat > try.c <<'END'
12127 #include <sys/types.h>
12128 #include <sys/ipc.h>
12129 #include <sys/sem.h>
12130 int main () { union semun semun; semun.buf = 0; }
12133 if eval $compile; then
12134 echo "You have union semun in <sys/sem.h>." >&4
12137 echo "You do not have union semun in <sys/sem.h>." >&4
12140 $rm -f try try.c try.h
12144 : see how to do semctl IPC_STAT
12147 : see whether semctl IPC_STAT can use union semun
12152 # define S_IRUSR S_IREAD
12153 # define S_IWUSR S_IWRITE
12154 # define S_IXUSR S_IEXEC
12156 # define S_IRUSR 0400
12157 # define S_IWUSR 0200
12158 # define S_IXUSR 0100
12160 # define S_IRGRP (S_IRUSR>>3)
12161 # define S_IWGRP (S_IWUSR>>3)
12162 # define S_IXGRP (S_IXUSR>>3)
12163 # define S_IROTH (S_IRUSR>>6)
12164 # define S_IWOTH (S_IWUSR>>6)
12165 # define S_IXOTH (S_IXUSR>>6)
12168 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
12169 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
12170 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
12175 #include <sys/types.h>
12176 #include <sys/ipc.h>
12177 #include <sys/sem.h>
12178 #include <sys/stat.h>
12185 #$d_union_semun HAS_UNION_SEMUN
12188 #ifndef HAS_UNION_SEMUN
12191 struct semid_ds *buf;
12192 unsigned short *array;
12198 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
12199 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
12201 struct semid_ds argbuf;
12204 st = semctl(sem, 0, IPC_STAT, arg);
12208 # endif /* IPC_STAT */
12209 printf("semctl IPC_STAT failed: errno = %d\n", errno);
12211 if (semctl(sem, 0, IPC_RMID, arg) != 0)
12212 # endif /* IPC_RMID */
12213 printf("semctl IPC_RMID failed: errno = %d\n", errno);
12215 #endif /* IPC_PRIVATE && ... */
12216 printf("semget failed: errno = %d\n", errno);
12222 if eval $compile; then
12225 semun) val="$define" ;;
12231 case "$d_semctl_semun" in
12233 echo "You can use union semun for semctl IPC_STAT." >&4
12236 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
12241 : see whether semctl IPC_STAT can use struct semid_ds pointer
12242 $cat > try.c <<'END'
12243 #include <sys/types.h>
12244 #include <sys/ipc.h>
12245 #include <sys/sem.h>
12246 #include <sys/stat.h>
12254 struct semid_ds arg;
12257 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
12258 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
12261 st = semctl(sem, 0, IPC_STAT, &arg);
12263 printf("semid_ds\n");
12265 # endif /* IPC_STAT */
12266 printf("semctl IPC_STAT failed: errno = %d\n", errno);
12268 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
12269 # endif /* IPC_RMID */
12270 printf("semctl IPC_RMID failed: errno = %d\n", errno);
12272 #endif /* IPC_PRIVATE && ... */
12273 printf("semget failed: errno = %d\n", errno);
12280 if eval $compile; then
12283 semid_ds) val="$define" ;;
12287 set d_semctl_semid_ds
12289 case "$d_semctl_semid_ds" in
12291 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
12293 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
12300 # We do not have the full sem*(2) library, so assume we can not
12306 set d_semctl_semid_ds
12311 : see if sendmsg exists
12312 set sendmsg d_sendmsg
12315 : see if setegid exists
12316 set setegid d_setegid
12319 : see if seteuid exists
12320 set seteuid d_seteuid
12323 : see if setgrent exists
12324 set setgrent d_setgrent
12327 : see if sethostent exists
12328 set sethostent d_sethent
12331 : see if setitimer exists
12332 set setitimer d_setitimer
12335 : see if setlinebuf exists
12336 set setlinebuf d_setlinebuf
12339 : see if setlocale exists
12340 set setlocale d_setlocale
12343 : see if setnetent exists
12344 set setnetent d_setnent
12347 : see if setprotoent exists
12348 set setprotoent d_setpent
12351 : see if setpgid exists
12352 set setpgid d_setpgid
12355 : see if setpgrp2 exists
12356 set setpgrp2 d_setpgrp2
12359 : see if setpriority exists
12360 set setpriority d_setprior
12363 : see if setproctitle exists
12364 set setproctitle d_setproctitle
12367 : see if setpwent exists
12368 set setpwent d_setpwent
12371 : see if setregid exists
12372 set setregid d_setregid
12374 set setresgid d_setresgid
12377 : see if setreuid exists
12378 set setreuid d_setreuid
12380 set setresuid d_setresuid
12383 : see if setrgid exists
12384 set setrgid d_setrgid
12387 : see if setruid exists
12388 set setruid d_setruid
12391 : see if setservent exists
12392 set setservent d_setsent
12395 : see if setsid exists
12396 set setsid d_setsid
12399 : see if setvbuf exists
12400 set setvbuf d_setvbuf
12403 : see if sfio.h is available
12408 : see if sfio library is available
12419 : Ok, but do we want to use it.
12423 true|$define|[yY]*) dflt='y';;
12426 echo "$package can use the sfio library, but it is experimental."
12427 case "$useperlio" in
12429 echo "For sfio also the PerlIO abstraction layer is needed."
12430 echo "Earlier you said you wouldn't want that."
12433 rp="You seem to have sfio available, do you want to try using it?"
12436 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
12437 useperlio="$define"
12440 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
12445 *) case "$usesfio" in
12446 true|$define|[yY]*)
12447 echo "Sorry, cannot find sfio on this machine." >&4
12448 echo "Ignoring your setting of usesfio=$usesfio." >&4
12457 $define) usesfio='true';;
12458 *) usesfio='false';;
12462 *) : Remove sfio from list of libraries to use
12465 echo "Removing unneeded -lsfio from library list" >&4
12466 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
12469 echo "libs = $libs" >&4
12476 : see if shmctl exists
12477 set shmctl d_shmctl
12480 : see if shmget exists
12481 set shmget d_shmget
12484 : see if shmat exists
12487 : see what shmat returns
12490 $cat >shmat.c <<'END'
12491 #include <sys/shm.h>
12494 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
12499 echo "and it returns ($shmattype)." >&4
12500 : see if a prototype for shmat is available
12501 xxx=`./findhdr sys/shm.h`
12502 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
12503 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
12514 set d_shmatprototype
12517 : see if shmdt exists
12521 : see how much of the 'shm*(2)' library is present.
12524 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
12525 *"$undef"*) h_shm=false;;
12529 case "`ipcs 2>&1`" in
12530 "SVID shared memory"*"not configured"*)
12531 echo "Your $osname does not have the shm*(2) configured." >&4
12534 set shmctl d_shmctl
12536 set shmget d_shmget
12546 : we could also check for sys/ipc.h ...
12547 if $h_shm && $test `./findhdr sys/shm.h`; then
12548 echo "You have the full shm*(2) library." >&4
12551 echo "You don't have the full shm*(2) library." >&4
12558 : see if we have sigaction
12559 if set sigaction val -f d_sigaction; eval $csym; $val; then
12560 echo 'sigaction() found.' >&4
12561 $cat > try.c <<'EOP'
12563 #include <sys/types.h>
12564 #include <signal.h>
12567 struct sigaction act, oact;
12569 oact.sa_handler = 0;
12570 /* so that act and oact are used */
12571 exit(act.sa_flags == 0 && oact.sa_handler == 0);
12575 if eval $compile_ok; then
12578 echo "But you don't seem to have a useable struct sigaction." >&4
12582 echo 'sigaction NOT found.' >&4
12585 set d_sigaction; eval $setvar
12586 $rm -f try try$_o try.c
12588 : see if sigprocmask exists
12589 set sigprocmask d_sigprocmask
12592 : see if sigsetjmp exists
12594 case "$d_sigsetjmp" in
12596 $cat >try.c <<'EOP'
12597 #include <setjmp.h>
12602 if (sigsetjmp(env,1))
12605 siglongjmp(env, 1);
12610 if eval $compile; then
12611 if $run ./try >/dev/null 2>&1; then
12612 echo "POSIX sigsetjmp found." >&4
12616 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
12622 echo "sigsetjmp not found." >&4
12626 *) val="$d_sigsetjmp"
12627 case "$d_sigsetjmp" in
12628 $define) echo "POSIX sigsetjmp found." >&4;;
12629 $undef) echo "sigsetjmp not found." >&4;;
12637 : see if sockatmark exists
12638 set sockatmark d_sockatmark
12641 : see if prototype for sockatmark is available
12643 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
12646 : see if socks5_init exists
12647 set socks5_init d_socks5_init
12650 : see if prototype for setresgid is available
12652 set d_sresgproto setresgid $i_unistd unistd.h
12655 : see if prototype for setresuid is available
12657 set d_sresuproto setresuid $i_unistd unistd.h
12660 : see if sys/stat.h is available
12661 set sys/stat.h i_sysstat
12665 : see if stat knows about block sizes
12667 echo "Checking to see if your struct stat has st_blocks field..." >&4
12668 set d_statblks stat st_blocks $i_sysstat sys/stat.h
12672 : see if this is a sys/vfs.h system
12673 set sys/vfs.h i_sysvfs
12677 : see if this is a sys/statfs.h system
12678 set sys/statfs.h i_sysstatfs
12683 echo "Checking to see if your system supports struct statfs..." >&4
12684 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
12686 case "$d_statfs_s" in
12687 "$define") echo "Yes, it does." ;;
12688 *) echo "No, it doesn't." ;;
12693 : see if struct statfs knows about f_flags
12694 case "$d_statfs_s" in
12697 echo "Checking to see if your struct statfs has f_flags field..." >&4
12698 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
12702 set d_statfs_f_flags
12706 case "$d_statfs_f_flags" in
12707 "$define") echo "Yes, it does." ;;
12708 *) echo "No, it doesn't." ;;
12711 : see if _ptr and _cnt from stdio act std
12714 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12715 echo "(Looks like you have stdio.h from BSD.)"
12716 case "$stdio_ptr" in
12717 '') stdio_ptr='((fp)->_p)'
12720 *) ptr_lval=$d_stdio_ptr_lval;;
12722 case "$stdio_cnt" in
12723 '') stdio_cnt='((fp)->_r)'
12726 *) cnt_lval=$d_stdio_cnt_lval;;
12728 case "$stdio_base" in
12729 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12731 case "$stdio_bufsiz" in
12732 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12734 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12735 echo "(Looks like you have stdio.h from Linux.)"
12736 case "$stdio_ptr" in
12737 '') stdio_ptr='((fp)->_IO_read_ptr)'
12740 *) ptr_lval=$d_stdio_ptr_lval;;
12742 case "$stdio_cnt" in
12743 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12746 *) cnt_lval=$d_stdio_cnt_lval;;
12748 case "$stdio_base" in
12749 '') stdio_base='((fp)->_IO_read_base)';;
12751 case "$stdio_bufsiz" in
12752 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12755 case "$stdio_ptr" in
12756 '') stdio_ptr='((fp)->_ptr)'
12759 *) ptr_lval=$d_stdio_ptr_lval;;
12761 case "$stdio_cnt" in
12762 '') stdio_cnt='((fp)->_cnt)'
12765 *) cnt_lval=$d_stdio_cnt_lval;;
12767 case "$stdio_base" in
12768 '') stdio_base='((fp)->_base)';;
12770 case "$stdio_bufsiz" in
12771 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12775 : test whether _ptr and _cnt really work
12776 echo "Checking how std your stdio is..." >&4
12779 #define FILE_ptr(fp) $stdio_ptr
12780 #define FILE_cnt(fp) $stdio_cnt
12782 FILE *fp = fopen("try.c", "r");
12785 18 <= FILE_cnt(fp) &&
12786 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12794 if eval $compile && $to try.c; then
12795 if $run ./try; then
12796 echo "Your stdio acts pretty std."
12799 echo "Your stdio isn't very std."
12802 echo "Your stdio doesn't appear very std."
12808 : Can _ptr be used as an lvalue?
12809 case "$d_stdstdio$ptr_lval" in
12810 $define$define) val=$define ;;
12813 set d_stdio_ptr_lval
12816 : Can _cnt be used as an lvalue?
12817 case "$d_stdstdio$cnt_lval" in
12818 $define$define) val=$define ;;
12821 set d_stdio_cnt_lval
12825 : test whether setting _ptr sets _cnt as a side effect
12826 d_stdio_ptr_lval_sets_cnt="$undef"
12827 d_stdio_ptr_lval_nochange_cnt="$undef"
12828 case "$d_stdio_ptr_lval$d_stdstdio" in
12830 echo "Checking to see what happens if we set the stdio ptr..." >&4
12833 /* Can we scream? */
12834 /* Eat dust sed :-) */
12835 /* In the buffer space, no one can hear you scream. */
12836 #define FILE_ptr(fp) $stdio_ptr
12837 #define FILE_cnt(fp) $stdio_cnt
12838 #include <sys/types.h>
12840 FILE *fp = fopen("try.c", "r");
12845 puts("Fail even to read");
12848 c = getc(fp); /* Read away the first # */
12850 puts("Fail even to read");
12854 18 <= FILE_cnt(fp) &&
12855 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12857 puts("Fail even to read");
12860 ptr = (char*) FILE_ptr(fp);
12861 cnt = (size_t)FILE_cnt(fp);
12863 FILE_ptr(fp) += 42;
12865 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12866 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12869 if (FILE_cnt(fp) <= 20) {
12870 printf ("Fail (<20 chars to test)");
12873 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12874 puts("Fail compare");
12877 if (cnt == FILE_cnt(fp)) {
12878 puts("Pass_unchanged");
12881 if (FILE_cnt(fp) == (cnt - 42)) {
12882 puts("Pass_changed");
12885 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12891 if eval $compile && $to try.c; then
12892 case `$run ./try` in
12894 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12895 d_stdio_ptr_lval_sets_cnt="$define" ;;
12897 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12898 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12900 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12902 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12905 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12911 : see if _base is also standard
12913 case "$d_stdstdio" in
12917 #define FILE_base(fp) $stdio_base
12918 #define FILE_bufsiz(fp) $stdio_bufsiz
12920 FILE *fp = fopen("try.c", "r");
12923 19 <= FILE_bufsiz(fp) &&
12924 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
12931 if eval $compile && $to try.c; then
12932 if $run ./try; then
12933 echo "And its _base field acts std."
12936 echo "But its _base field isn't std."
12939 echo "However, it seems to be lacking the _base field."
12948 Checking how to access stdio streams by file descriptor number...
12950 case "$stdio_stream_array" in
12951 '') $cat >try.c <<EOCP
12954 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
12958 for s in _iob __iob __sF
12960 set try -DSTDIO_STREAM_ARRAY=$s
12961 if eval $compile; then
12962 case "`$run ./try`" in
12963 yes) stdio_stream_array=$s; break ;;
12967 $rm -f try.* try$exe_ext
12969 case "$stdio_stream_array" in
12971 I can't figure out how to access stdio streams by file descriptor number.
12973 d_stdio_stream_array="$undef"
12976 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
12978 d_stdio_stream_array="$define"
12982 : see if strcoll exists
12983 set strcoll d_strcoll
12986 : check for structure copying
12988 echo "Checking to see if your C compiler can copy structs..." >&4
12989 $cat >try.c <<'EOCP'
12999 if $cc -c try.c >/dev/null 2>&1 ; then
13001 echo "Yup, it can."
13004 echo "Nope, it can't."
13010 : see if strerror and/or sys_errlist[] exist
13012 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
13013 if set strerror val -f d_strerror; eval $csym; $val; then
13014 echo 'strerror() found.' >&4
13015 d_strerror="$define"
13016 d_strerrm='strerror(e)'
13017 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
13018 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
13019 d_syserrlst="$define"
13021 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
13022 d_syserrlst="$undef"
13024 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
13025 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
13026 echo 'strerror() found in string header.' >&4
13027 d_strerror="$define"
13028 d_strerrm='strerror(e)'
13029 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
13030 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
13031 d_syserrlst="$define"
13033 echo "(You don't appear to have any sys_errlist[], how can this be?)"
13034 d_syserrlst="$undef"
13036 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
13037 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
13038 d_strerror="$undef"
13039 d_syserrlst="$define"
13040 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
13042 echo 'strerror() and sys_errlist[] NOT found.' >&4
13043 d_strerror="$undef"
13044 d_syserrlst="$undef"
13045 d_strerrm='"unknown"'
13049 : see if strftime exists
13050 set strftime d_strftime
13053 : see if strtod exists
13054 set strtod d_strtod
13057 : see if strtol exists
13058 set strtol d_strtol
13061 : see if strtold exists
13062 set strtold d_strtold
13065 : see if strtoll exists
13066 set strtoll d_strtoll
13069 case "$d_longlong-$d_strtoll" in
13072 Checking whether your strtoll() works okay...
13074 $cat >try.c <<'EOCP'
13077 #define strtoll __strtoll
13080 #define strtoll _strtoll
13083 extern long long int strtoll(char *s, char **, int);
13084 static int bad = 0;
13085 int check(char *s, long long ell, int een) {
13088 gll = strtoll(s, 0, 10);
13089 if (!((gll == ell) && (errno == een)))
13093 check(" 1", 1LL, 0);
13094 check(" 0", 0LL, 0);
13095 check("-1", -1LL, 0);
13096 check("-9223372036854775808", -9223372036854775808LL, 0);
13097 check("-9223372036854775808", -9223372036854775808LL, 0);
13098 check(" 9223372036854775807", 9223372036854775807LL, 0);
13099 check("-9223372036854775808", -9223372036854775808LL, 0);
13100 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
13101 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
13107 if eval $compile; then
13110 ok) echo "Your strtoll() seems to be working okay." ;;
13112 Your strtoll() doesn't seem to be working okay.
13118 echo "(I can't seem to compile the test program--assuming it doesn't)"
13124 : see if strtoq exists
13125 set strtoq d_strtoq
13128 : see if strtoul exists
13129 set strtoul d_strtoul
13132 case "$d_strtoul" in
13135 Checking whether your strtoul() works okay...
13137 $cat >try.c <<'EOCP'
13140 extern unsigned long int strtoul(char *s, char **, int);
13141 static int bad = 0;
13142 void check(char *s, unsigned long eul, int een) {
13145 gul = strtoul(s, 0, 10);
13146 if (!((gul == eul) && (errno == een)))
13150 check(" 1", 1L, 0);
13151 check(" 0", 0L, 0);
13153 case "$longsize" in
13155 $cat >>try.c <<'EOCP'
13156 check("18446744073709551615", 18446744073709551615UL, 0);
13157 check("18446744073709551616", 18446744073709551615UL, ERANGE);
13158 #if 0 /* strtoul() for /^-/ strings is undefined. */
13159 check("-1", 18446744073709551615UL, 0);
13160 check("-18446744073709551614", 2, 0);
13161 check("-18446744073709551615", 1, 0);
13162 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
13163 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
13168 $cat >>try.c <<'EOCP'
13169 check("4294967295", 4294967295UL, 0);
13170 check("4294967296", 4294967295UL, ERANGE);
13171 #if 0 /* strtoul() for /^-/ strings is undefined. */
13172 check("-1", 4294967295UL, 0);
13173 check("-4294967294", 2, 0);
13174 check("-4294967295", 1, 0);
13175 check("-4294967296", 4294967295UL, ERANGE);
13176 check("-4294967297", 4294967295UL, ERANGE);
13181 : Should we write these tests to be more portable by sprintf-ing
13182 : ~0 and then manipulating that char string as input for strtol?
13185 $cat >>try.c <<'EOCP'
13192 if eval $compile; then
13193 case "`$run ./try`" in
13194 ok) echo "Your strtoul() seems to be working okay." ;;
13196 Your strtoul() doesn't seem to be working okay.
13205 : see if strtoull exists
13206 set strtoull d_strtoull
13209 case "$d_longlong-$d_strtoull" in
13212 Checking whether your strtoull() works okay...
13214 $cat >try.c <<'EOCP'
13217 #define strtoull __strtoull
13220 extern unsigned long long int strtoull(char *s, char **, int);
13221 static int bad = 0;
13222 int check(char *s, long long eull, int een) {
13225 gull = strtoull(s, 0, 10);
13226 if (!((gull == eull) && (errno == een)))
13230 check(" 1", 1LL, 0);
13231 check(" 0", 0LL, 0);
13232 check("18446744073709551615", 18446744073709551615ULL, 0);
13233 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
13234 #if 0 /* strtoull() for /^-/ strings is undefined. */
13235 check("-1", 18446744073709551615ULL, 0);
13236 check("-18446744073709551614", 2LL, 0);
13237 check("-18446744073709551615", 1LL, 0);
13238 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
13239 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
13246 if eval $compile; then
13247 case "`$run ./try`" in
13248 ok) echo "Your strtoull() seems to be working okay." ;;
13250 Your strtoull() doesn't seem to be working okay.
13252 d_strtoull="$undef"
13259 : see if strtouq exists
13260 set strtouq d_strtouq
13263 case "$d_strtouq" in
13266 Checking whether your strtouq() works okay...
13268 $cat >try.c <<'EOCP'
13271 extern unsigned long long int strtouq(char *s, char **, int);
13272 static int bad = 0;
13273 void check(char *s, unsigned long long eull, int een) {
13274 unsigned long long gull;
13276 gull = strtouq(s, 0, 10);
13277 if (!((gull == eull) && (errno == een)))
13281 check(" 1", 1LL, 0);
13282 check(" 0", 0LL, 0);
13283 check("18446744073709551615", 18446744073709551615ULL, 0);
13284 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
13285 #if 0 /* strtouq() for /^-/ strings is undefined. */
13286 check("-1", 18446744073709551615ULL, 0);
13287 check("-18446744073709551614", 2LL, 0);
13288 check("-18446744073709551615", 1LL, 0);
13289 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
13290 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
13298 if eval $compile; then
13299 case "`$run ./try`" in
13300 ok) echo "Your strtouq() seems to be working okay." ;;
13302 Your strtouq() doesn't seem to be working okay.
13311 : see if strxfrm exists
13312 set strxfrm d_strxfrm
13315 : see if symlink exists
13316 set symlink d_symlink
13319 : see if syscall exists
13320 set syscall d_syscall
13323 : see if prototype for syscall is available
13325 set d_syscallproto syscall $i_unistd unistd.h
13328 : see if sysconf exists
13329 set sysconf d_sysconf
13332 : see if system exists
13333 set system d_system
13336 : see if tcgetpgrp exists
13337 set tcgetpgrp d_tcgetpgrp
13340 : see if tcsetpgrp exists
13341 set tcsetpgrp d_tcsetpgrp
13344 : see if prototype for telldir is available
13346 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
13349 : see if this is a sys/times.h system
13350 set sys/times.h i_systimes
13353 : see if times exists
13355 if set times val -f d_times; eval $csym; $val; then
13356 echo 'times() found.' >&4
13359 case "$i_systimes" in
13360 "$define") inc='sys/times.h';;
13362 rp="What is the type returned by times() on this system?"
13363 set clock_t clocktype long stdio.h sys/types.h $inc
13366 echo 'times() NOT found, hope that will do.' >&4
13371 : see if truncate exists
13372 set truncate d_truncate
13375 : see if tzname[] exists
13377 if set tzname val -a d_tzname; eval $csym; $val; then
13379 echo 'tzname[] found.' >&4
13382 echo 'tzname[] NOT found.' >&4
13388 next|rhapsody|darwin) multiarch="$define" ;;
13390 case "$multiarch" in
13391 ''|[nN]*) multiarch="$undef" ;;
13394 : check for ordering of bytes in a long
13396 case "$usecrosscompile$multiarch" in
13399 You seem to be either cross-compiling or doing a multiarchitecture build,
13400 skipping the byteorder check.
13406 case "$byteorder" in
13409 In the following, larger digits indicate more significance. A big-endian
13410 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
13411 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
13412 machines may have weird orders like 3412. A Cray will report 87654321,
13413 an Alpha will report 12345678. If the test program works the default is
13415 I'm now running the test program...
13417 $cat >try.c <<'EOCP'
13424 char c[sizeof(long)];
13427 if (sizeof(long) > 4)
13428 u.l = (0x08070605L << 32) | 0x04030201L;
13431 for (i = 0; i < sizeof(long); i++)
13432 printf("%c", u.c[i]+'0');
13439 if eval $compile && ./try > /dev/null; then
13442 [1-4][1-4][1-4][1-4]|12345678|87654321)
13443 echo "(The test program ran ok.)"
13444 echo "byteorder=$dflt"
13447 ????|????????) echo "(The test program ran ok.)" ;;
13448 *) echo "(The test program didn't run right for some reason.)" ;;
13453 (I can't seem to compile the test program. Guessing big-endian...)
13456 case "$xxx_prompt" in
13458 rp="What is the order of bytes in a long?"
13474 Checking to see whether you can access character data unalignedly...
13478 #define U32 $u32type
13479 #define BYTEORDER 0x$byteorder
13482 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
13483 U8 buf[] = "\0\0\0\1\0\0\0\0";
13487 if (sizeof(U32) != 4) {
13488 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
13494 for (i = 0; i < 4; i++) {
13495 up = (U32*)(buf + i);
13496 if (! ((*up == 1 << (8*i)) || /* big-endian */
13497 (*up == 1 << (8*(3-i))) /* little-endian */
13501 printf("read failed (%x)\n", *up);
13507 for (i = 0; i < 4; i++) {
13508 up = (U32*)(buf + i);
13510 if (*up != 0xBeef) {
13511 printf("write failed (%x)\n", *up);
13525 if eval $compile_ok; then
13526 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
13527 $run ./try 2>&1 >/dev/null
13530 You can access character data pretty unalignedly.
13532 d_u32align="$undef"
13535 It seems that you must access character data in an aligned manner.
13537 d_u32align="$define"
13540 $rm -f core core.try.* try.core
13542 rp='Can you access character data at unaligned addresses?'
13546 [yY]*) d_u32align="$undef" ;;
13547 *) d_u32align="$define" ;;
13551 : see if ualarm exists
13552 set ualarm d_ualarm
13555 : see if umask exists
13559 : see if unordered exists
13560 set unordered d_unordered
13563 : see if usleep exists
13564 set usleep d_usleep
13567 : see if prototype for usleep is available
13569 set d_usleepproto usleep $i_unistd unistd.h
13572 : see if ustat exists
13576 : backward compatibility for d_hvfork
13577 if test X$d_hvfork != X; then
13578 d_vfork="$d_hvfork"
13581 : see if there is a vfork
13586 : Ok, but do we want to use it. vfork is reportedly unreliable in
13587 : perl on Solaris 2.x, and probably elsewhere.
13591 case "$usevfork" in
13597 Perl can only use a vfork() that doesn't suffer from strict
13598 restrictions on calling functions or modifying global data in
13599 the child. For example, glibc-2.1 contains such a vfork()
13600 that is unsuitable. If your system provides a proper fork()
13601 call, chances are that you do NOT want perl to use vfork().
13604 rp="Do you still want to use vfork()?"
13609 echo "Ok, we won't use vfork()."
13618 $define) usevfork='true';;
13619 *) usevfork='false';;
13622 : see if closedir exists
13623 set closedir d_closedir
13626 case "$d_closedir" in
13629 echo "Checking whether closedir() returns a status..." >&4
13631 #$i_dirent I_DIRENT /**/
13632 #$i_sysdir I_SYS_DIR /**/
13633 #$i_sysndir I_SYS_NDIR /**/
13634 #$i_systypes I_SYS_TYPES /**/
13636 #if defined(I_SYS_TYPES)
13637 #include <sys/types.h>
13639 #if defined(I_DIRENT)
13640 #include <dirent.h>
13641 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
13642 #include <sys/dir.h>
13646 #include <sys/ndir.h>
13650 #include <ndir.h> /* may be wrong in the future */
13652 #include <sys/dir.h>
13657 int main() { return closedir(opendir(".")); }
13660 if eval $compile_ok; then
13661 if $run ./try > /dev/null 2>&1 ; then
13662 echo "Yes, it does."
13665 echo "No, it doesn't."
13669 echo "(I can't seem to compile the test program--assuming it doesn't)"
13677 set d_void_closedir
13680 : see if there is a wait4
13684 : see if waitpid exists
13685 set waitpid d_waitpid
13688 : see if wcstombs exists
13689 set wcstombs d_wcstombs
13692 : see if wctomb exists
13693 set wctomb d_wctomb
13696 : see if writev exists
13697 set writev d_writev
13700 : preserve RCS keywords in files with variable substitution, grrr
13705 Revision='$Revision'
13707 : check for alignment requirements
13709 case "$usecrosscompile$multiarch" in
13712 You seem to be either cross-compiling or doing a multiarchitecture build,
13713 skipping the memory alignment check.
13716 case "$alignbytes" in
13717 '') alignbytes=8 ;;
13721 case "$alignbytes" in
13722 '') echo "Checking alignment constraints..." >&4
13723 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
13724 $cat >try.c <<'EOCP'
13725 typedef long double NV;
13728 $cat >try.c <<'EOCP'
13732 $cat >>try.c <<'EOCP'
13740 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
13745 if eval $compile_ok; then
13749 echo "(I can't seem to compile the test program...)"
13752 *) dflt="$alignbytes"
13755 rp="Doubles must be aligned on a how-many-byte boundary?"
13763 : set the base revision
13766 : how do we catenate cpp tokens here?
13768 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
13769 $cat >cpp_stuff.c <<'EOCP'
13770 #define RCAT(a,b)a/**/b
13771 #define ACAT(a,b)a ## b
13775 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
13776 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
13777 echo "Oh! Smells like ANSI's been here." >&4
13778 echo "We can catify or stringify, separately or together!"
13780 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
13781 echo "Ah, yes! The good old days!" >&4
13782 echo "However, in the good old days we don't know how to stringify and"
13783 echo "catify at the same time."
13787 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
13788 to have to edit the values of CAT[2-5] in config.h...
13790 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
13794 : see if this is a db.h system
13800 : Check db version.
13802 echo "Checking Berkeley DB version ..." >&4
13808 #include <sys/types.h>
13811 int main(int argc, char *argv[])
13813 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
13814 int Major, Minor, Patch ;
13815 unsigned long Version ;
13816 (void)db_version(&Major, &Minor, &Patch) ;
13818 printf("%d %d %d %d %d %d\n",
13819 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
13820 Major, Minor, Patch);
13823 printf("You have Berkeley DB Version 2 or greater.\n");
13825 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
13826 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
13827 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
13828 Major, Minor, Patch) ;
13830 /* check that db.h & libdb are compatible */
13831 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
13832 printf("db.h and libdb are incompatible.\n") ;
13836 printf("db.h and libdb are compatible.\n") ;
13838 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
13839 + DB_VERSION_PATCH ;
13841 /* needs to be >= 2.3.4 */
13842 if (Version < 2003004) {
13843 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
13844 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
13850 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
13855 printf("You have Berkeley DB Version 1.\n");
13856 exit(0); /* DB version < 2: the coast is clear. */
13858 exit(1); /* <db.h> not Berkeley DB? */
13864 if eval $compile_ok && $run ./try; then
13865 echo 'Looks OK.' >&4
13867 db_version_major=$1
13868 db_version_minor=$2
13869 db_version_patch=$3
13871 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
13875 : Remove db from list of libraries to use
13876 echo "Removing unusable -ldb from library list" >&4
13877 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
13880 echo "libs = $libs" >&4
13890 : Check the return type needed for hash
13892 echo "Checking return type needed for hash for Berkeley DB ..." >&4
13898 #include <sys/types.h>
13901 #ifndef DB_VERSION_MAJOR
13902 u_int32_t hash_cb (ptr, size)
13910 info.hash = hash_cb;
13914 if $cc $ccflags -c try.c >try.out 2>&1 ; then
13915 if $contains warning try.out >>/dev/null 2>&1 ; then
13918 db_hashtype='u_int32_t'
13921 : XXX Maybe we should just give up here.
13922 db_hashtype=u_int32_t
13924 echo "Help: I can't seem to compile the db test program." >&4
13925 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
13928 echo "Your version of Berkeley DB uses $db_hashtype for hash."
13930 *) db_hashtype=u_int32_t
13935 : Check the return type needed for prefix
13937 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
13943 #include <sys/types.h>
13946 #ifndef DB_VERSION_MAJOR
13947 size_t prefix_cb (key1, key2)
13955 info.prefix = prefix_cb;
13959 if $cc $ccflags -c try.c >try.out 2>&1 ; then
13960 if $contains warning try.out >>/dev/null 2>&1 ; then
13961 db_prefixtype='int'
13963 db_prefixtype='size_t'
13966 db_prefixtype='size_t'
13967 : XXX Maybe we should just give up here.
13969 echo "Help: I can't seem to compile the db test program." >&4
13970 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
13973 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
13975 *) db_prefixtype='size_t'
13980 : How can we generate normalized random numbers ?
13982 echo "Looking for a random number function..." >&4
13983 case "$randfunc" in
13985 if set drand48 val -f; eval $csym; $val; then
13987 echo "Good, found drand48()." >&4
13988 elif set random val -f; eval $csym; $val; then
13990 echo "OK, found random()." >&4
13993 echo "Yick, looks like I have to use rand()." >&4
14004 *-Dmy_rand=*|*-Dmy_srand=*)
14005 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
14006 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
14007 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
14008 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
14012 while $test "$cont"; do
14013 rp="Use which function to generate random numbers?"
14015 if $test "$ans" = "$dflt"; then
14021 if set $ans val -f; eval $csym; $val; then
14025 rp="I cannot find function $ans. Use that name anyway?"
14034 case "$randfunc" in
14036 drand01="drand48()"
14042 case "$randbits" in
14044 echo "Checking to see how many bits your $randfunc() function produces..." >&4
14046 #$i_unistd I_UNISTD
14047 #$i_stdlib I_STDLIB
14050 # include <unistd.h>
14053 # include <stdlib.h>
14058 register unsigned long tmp;
14059 register unsigned long max = 0L;
14061 for (i = 1000; i; i--) {
14062 tmp = (unsigned long) $randfunc();
14063 if (tmp > max) max = tmp;
14065 for (i = 0; max; i++)
14071 if eval $compile_ok; then
14075 echo "(I can't seem to compile the test program...)"
14082 rp="How many bits does your $randfunc() function produce?"
14086 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
14087 seedfunc="s$randfunc"
14088 randseedtype=unsigned
14092 rp="How many bits does your $randfunc() function produce?"
14095 seedfunc="s$randfunc"
14096 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
14097 if set $seedfunc val -f; eval $csym; $val; then
14098 echo "(Using $seedfunc() to seed random generator)"
14100 echo "(Warning: no $seedfunc() to seed random generator)"
14103 randseedtype=unsigned
14111 echo "Determining whether or not we are on an EBCDIC system..." >&4
14112 $cat >try.c <<'EOM'
14115 if ('M'==0xd4) return 0;
14122 if eval $compile_ok; then
14123 if $run ./try; then
14124 echo "You seem to speak EBCDIC." >&4
14127 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
14130 echo "I'm unable to compile the test program." >&4
14131 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
14139 Checking how to flush all pending stdio output...
14141 # I only know how to find the first 32 possibly open files on SunOS.
14142 # See also hints/sunos_4_1.sh and util.c --AD
14144 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
14146 $cat >>try.c <<EOCP
14148 #$i_unistd I_UNISTD
14150 # include <unistd.h>
14152 #$d_sysconf HAS_SYSCONF
14153 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
14154 #ifdef HAS_STDIO_STREAM_ARRAY
14155 # define STDIO_STREAM_ARRAY $stdio_stream_array
14160 p = fopen("try.out", "w");
14164 # ifdef TRY_FPRINTF
14168 #ifdef TRY_FFLUSH_NULL
14171 #ifdef TRY_FFLUSH_ALL
14173 long open_max = -1;
14174 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
14175 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
14177 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
14178 open_max = sysconf(_SC_OPEN_MAX);
14181 open_max = FOPEN_MAX;
14184 open_max = OPEN_MAX;
14193 # ifdef HAS_STDIO_STREAM_ARRAY
14194 if (open_max > 0) {
14196 for (i = 0; i < open_max; i++)
14197 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
14198 STDIO_STREAM_ARRAY[i]._file < open_max &&
14199 STDIO_STREAM_ARRAY[i]._flag)
14200 fflush(&STDIO_STREAM_ARRAY[i]);
14208 : first we have to find out how _not_ to flush
14210 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
14212 set try -DTRY_FPUTC
14213 if eval $compile; then
14214 $run ./try 2>/dev/null
14217 if $test ! -s try.out -a "X$code" = X42; then
14223 set try -DTRY_FPRINTF
14224 if eval $compile; then
14225 $run ./try 2>/dev/null
14228 if $test ! -s try.out -a "X$code" = X42; then
14229 output=-DTRY_FPRINTF
14235 : check for fflush NULL behaviour
14236 case "$fflushNULL" in
14237 '') set try -DTRY_FFLUSH_NULL $output
14238 if eval $compile; then
14239 $run ./try 2>/dev/null
14242 if $test -s try.out -a "X$code" = X42; then
14243 fflushNULL="`$cat try.out`"
14245 if $test "X$code" != X42; then
14247 (If this test failed, don't worry, we'll try another method shortly.)
14252 $rm -f core try.core core.try.*
14253 case "$fflushNULL" in
14255 Your fflush(NULL) works okay for output streams.
14256 Let's see if it clobbers input pipes...
14258 # As of mid-March 2000 all versions of Solaris appear to have a stdio
14259 # bug that improperly flushes the input end of pipes. So we avoid the
14260 # autoflush on fork/system/exec support for now. :-(
14261 $cat >tryp.c <<EOCP
14264 main(int argc, char **argv)
14270 while ((i = getc(stdin)) != -1
14271 && (*bp++ = i) != '\n'
14272 && bp < &buf[1024])
14275 fprintf(stdout, "%s", buf);
14283 fflushNULL="$define"
14285 if eval $compile; then
14287 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
14288 if cmp tryp.c tryp.out >/dev/null 2>&1; then
14290 fflush(NULL) seems to behave okay with input streams.
14292 fflushNULL="$define"
14295 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
14297 fflushNULL="$undef"
14300 $rm -f core tryp.c tryp.core core.tryp.*
14303 Your fflush(NULL) isn't working (contrary to ANSI C).
14305 fflushNULL="$undef"
14308 Cannot figure out whether your fflush(NULL) works or not.
14309 I'm assuming it doesn't (contrary to ANSI C).
14311 fflushNULL="$undef"
14315 $define|true|[yY]*)
14316 fflushNULL="$define"
14319 fflushNULL="$undef"
14322 : check explicit looping only if NULL did not work, and if the pipe
14323 : bug does not show up on an explicit flush too
14324 case "$fflushNULL" in
14326 $cat >tryp.c <<EOCP
14329 main(int argc, char **argv)
14335 while ((i = getc(stdin)) != -1
14336 && (*bp++ = i) != '\n'
14337 && bp < &buf[1024])
14340 fprintf(stdout, "%s", buf);
14349 if eval $compile; then
14351 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
14352 if cmp tryp.c tryp.out >/dev/null 2>&1; then
14354 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
14356 : now check for fflushall behaviour
14357 case "$fflushall" in
14358 '') set try -DTRY_FFLUSH_ALL $output
14359 if eval $compile; then
14361 (Now testing the other method--but note that this also may fail.)
14363 $run ./try 2>/dev/null
14366 if $test -s try.out -a "X$code" = X42; then
14367 fflushall="`$cat try.out`"
14370 $rm -f core try.core core.try.*
14371 case "$fflushall" in
14373 Whew. Flushing explicitly all the stdio streams works.
14375 fflushall="$define"
14378 Sigh. Flushing explicitly all the stdio streams doesn't work.
14383 Cannot figure out whether flushing stdio streams explicitly works or not.
14384 I'm assuming it doesn't.
14390 "$define"|true|[yY]*)
14391 fflushall="$define"
14399 All is futile. Even fflush(stdin) clobbers input pipes!
14406 $rm -f core tryp.c tryp.core core.tryp.*
14408 *) fflushall="$undef"
14412 case "$fflushNULL$fflushall" in
14415 OK, I give up. I cannot figure out how to flush pending stdio output.
14416 We won't be flushing handles at all before fork/exec/popen.
14420 $rm -f try.* try$exe_ext
14422 : Store the full pathname to the ar program for use in the C program
14423 : Respect a hint or command line value for full_ar.
14428 : Store the full pathname to the sed program for use in the C program
14431 : see what type gids are declared as in the kernel
14433 echo "Looking for the type for group ids returned by getgid()."
14434 set gid_t gidtype xxx stdio.h sys/types.h
14438 xxx=`./findhdr sys/user.h`
14439 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
14441 unsigned) dflt="$1 $2" ;;
14445 *) dflt="$gidtype";;
14448 gid_t) echo "gid_t found." ;;
14449 *) rp="What is the type for group ids returned by getgid()?"
14457 *_t) zzz="$gidtype" ;;
14460 echo "Checking the size of $zzz..." >&4
14462 #include <sys/types.h>
14465 printf("%d\n", (int)sizeof($gidtype));
14470 if eval $compile_ok; then
14474 echo "(I can't execute the test program--guessing $gidsize.)" >&4
14477 echo "Your $zzz is $gidsize bytes long."
14482 echo "(I can't compile the test program--guessing $gidsize.)" >&4
14488 *_t) zzz="$gidtype" ;;
14491 echo "Checking the sign of $zzz..." >&4
14493 #include <sys/types.h>
14504 if eval $compile; then
14508 echo "(I can't execute the test program--guessing unsigned.)" >&4
14512 1) echo "Your $zzz is unsigned." ;;
14513 -1) echo "Your $zzz is signed." ;;
14519 echo "(I can't compile the test program--guessing unsigned.)" >&4
14525 if $test X"$quadtype" != X; then
14527 echo "Checking how to print 64-bit integers..." >&4
14529 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
14530 $cat >try.c <<'EOCP'
14531 #include <sys/types.h>
14534 int q = 12345678901;
14535 printf("%ld\n", q);
14539 if eval $compile; then
14543 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
14544 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
14545 echo "We will use %d."
14551 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
14552 $cat >try.c <<'EOCP'
14553 #include <sys/types.h>
14556 long q = 12345678901;
14557 printf("%ld\n", q);
14561 if eval $compile; then
14565 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
14566 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
14567 echo "We will use %ld."
14573 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
14574 $cat >try.c <<'EOCP'
14575 #include <sys/types.h>
14576 #include <inttypes.h>
14579 int64_t q = 12345678901;
14580 printf("%" PRId64 "\n", q);
14584 if eval $compile; then
14588 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
14589 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
14590 echo "We will use the C9X style."
14596 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
14598 #include <sys/types.h>
14601 $quadtype q = 12345678901;
14602 printf("%Ld\n", q);
14606 if eval $compile; then
14610 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
14611 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
14612 echo "We will use %Ld."
14618 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
14619 $cat >try.c <<'EOCP'
14620 #include <sys/types.h>
14623 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
14624 printf("%lld\n", q);
14628 if eval $compile; then
14632 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
14633 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
14634 echo "We will use the %lld style."
14640 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
14642 #include <sys/types.h>
14645 $quadtype q = 12345678901;
14646 printf("%qd\n", q);
14650 if eval $compile; then
14654 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
14655 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
14656 echo "We will use %qd."
14662 if $test X"$sPRId64" = X; then
14663 echo "Cannot figure out how to print 64-bit integers." >&4
14671 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
14672 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
14674 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
14675 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
14681 $echo "Checking the format strings to be used for Perl's internal types..." >&4
14683 if $test X"$ivsize" = X8; then
14684 ivdformat="$sPRId64"
14685 uvuformat="$sPRIu64"
14686 uvoformat="$sPRIo64"
14687 uvxformat="$sPRIx64"
14688 uvXUformat="$sPRIXU64"
14690 if $test X"$ivsize" = X"$longsize"; then
14697 if $test X"$ivsize" = X"$intsize"; then
14705 if $test X"$ivsize" = X"$shortsize"; then
14716 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
14717 nveformat="$sPRIeldbl"
14718 nvfformat="$sPRIfldbl"
14719 nvgformat="$sPRIgldbl"
14720 nvEUformat="$sPRIEUldbl"
14721 nvFUformat="$sPRIFUldbl"
14722 nvGUformat="$sPRIGUldbl"
14732 case "$ivdformat" in
14733 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
14740 $echo "Checking the format string to be used for gids..." >&4
14743 -1) if $test X"$gidsize" = X"$ivsize"; then
14744 gidformat="$ivdformat"
14746 if $test X"$gidsize" = X"$longsize"; then
14749 if $test X"$gidsize" = X"$intsize"; then
14752 if $test X"$gidsize" = X"$shortsize"; then
14759 *) if $test X"$gidsize" = X"$uvsize"; then
14760 gidformat="$uvuformat"
14762 if $test X"$gidsize" = X"$longsize"; then
14765 if $test X"$gidsize" = X"$intsize"; then
14768 if $test X"$gidsize" = X"$shortsize"; then
14777 : see if getgroups exists
14778 set getgroups d_getgrps
14781 : see if setgroups exists
14782 set setgroups d_setgrps
14786 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
14788 case "$d_getgrps$d_setgrps" in
14790 case "$groupstype" in
14791 '') dflt="$gidtype" ;;
14792 *) dflt="$groupstype" ;;
14795 What type of pointer is the second argument to getgroups() and setgroups()?
14796 Usually this is the same as group ids, $gidtype, but not always.
14799 rp='What type pointer is the second argument to getgroups() and setgroups()?'
14803 *) groupstype="$gidtype";;
14807 echo "Checking if your $make program sets \$(MAKE)..." >&4
14808 case "$make_set_make" in
14810 $sed 's/^X //' > testmake.mak << 'EOF'
14812 X @echo 'maketemp="$(MAKE)"'
14814 case "`$make -f testmake.mak 2>/dev/null`" in
14815 *maketemp=*) make_set_make='#' ;;
14816 *) make_set_make="MAKE=$make" ;;
14818 $rm -f testmake.mak
14821 case "$make_set_make" in
14822 '#') echo "Yup, it does.";;
14823 *) echo "Nope, it doesn't.";;
14826 : see what type is used for mode_t
14827 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
14828 set mode_t modetype int stdio.h sys/types.h
14831 : see if stdarg is available
14833 if $test `./findhdr stdarg.h`; then
14834 echo "<stdarg.h> found." >&4
14837 echo "<stdarg.h> NOT found." >&4
14841 : see if varags is available
14843 if $test `./findhdr varargs.h`; then
14844 echo "<varargs.h> found." >&4
14846 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
14849 : set up the varargs testing programs
14850 $cat > varargs.c <<EOP
14852 #include <stdarg.h>
14855 #include <varargs.h>
14859 int f(char *p, ...)
14873 p = va_arg(ap, char *);
14878 $cat > varargs <<EOP
14880 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
14889 : now check which varargs header should be included
14894 if `./varargs I_STDARG`; then
14896 elif `./varargs I_VARARGS`; then
14901 if `./varargs I_VARARGS`; then
14908 echo "I could not find the definition for va_dcl... You have problems..." >&4
14909 val="$undef"; set i_stdarg; eval $setvar
14910 val="$undef"; set i_varargs; eval $setvar
14915 case "$i_varhdr" in
14917 val="$define"; set i_stdarg; eval $setvar
14918 val="$undef"; set i_varargs; eval $setvar
14921 val="$undef"; set i_stdarg; eval $setvar
14922 val="$define"; set i_varargs; eval $setvar
14925 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
14929 : see if we need va_copy
14931 case "$i_stdarg" in
14934 #include <stdarg.h>
14936 #$i_stdlib I_STDLIB
14938 #include <stdlib.h>
14940 #include <signal.h>
14943 ivfprintf(FILE *f, const char *fmt, va_list *valp)
14945 return vfprintf(f, fmt, *valp);
14949 myvfprintf(FILE *f, const char *fmt, va_list val)
14951 return ivfprintf(f, fmt, &val);
14955 myprintf(char *fmt, ...)
14958 va_start(val, fmt);
14959 return myvfprintf(stdout, fmt, val);
14963 main(int ac, char **av)
14965 signal(SIGSEGV, exit);
14967 myprintf("%s%cs all right, then\n", "that", '\'');
14972 if eval $compile && $run ./try 2>&1 >/dev/null; then
14973 case "`$run ./try`" in
14974 "that's all right, then")
14980 yes) echo "It seems that you don't need va_copy()." >&4
14981 need_va_copy="$undef"
14983 *) echo "It seems that va_copy() or similar will be needed." >&4
14984 need_va_copy="$define"
14987 $rm -f try.* core core.* *.core *.core.*
14989 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
14993 : define a fucntion to check prototypes
14994 $cat > protochk <<EOSH
14997 optimize="$optimize"
14999 prototype="$prototype"
15004 $cat >> protochk <<'EOSH'
15009 while test $# -ge 2; do
15011 $define) echo "#include <$2>" >> try.c ;;
15012 literal) echo "$2" >> try.c ;;
15016 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
15017 cat >> try.c <<'EOCP'
15018 #ifdef CAN_PROTOTYPE
15019 #define _(args) args
15024 echo "$foo" >> try.c
15025 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
15026 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
15032 $eunicefix protochk
15034 : see what type is used for size_t
15035 rp="What is the type used for the length parameter for string functions?"
15036 set size_t sizetype 'unsigned int' stdio.h sys/types.h
15039 : check for type of arguments to gethostbyaddr.
15040 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
15041 case "$d_gethbyaddr" in
15045 Checking to see what type of arguments are accepted by gethostbyaddr().
15047 hdrs="$define sys/types.h
15048 $d_socket sys/socket.h
15049 $i_niin netinet/in.h
15051 $i_unistd unistd.h"
15052 : The first arg can 'char *' or 'void *'
15053 : The second arg is some of integral type
15054 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
15055 for yyy in size_t long int; do
15056 case "$netdb_host_type" in
15057 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
15058 if ./protochk "$try" $hdrs; then
15059 echo "Your system accepts $xxx for the first arg."
15060 echo "...and $yyy for the second arg."
15061 netdb_host_type="$xxx"
15062 netdb_hlen_type="$yyy"
15068 : In case none of those worked, prompt the user.
15069 case "$netdb_host_type" in
15070 '') rp='What is the type for the 1st argument to gethostbyaddr?'
15073 netdb_host_type=$ans
15074 rp='What is the type for the 2nd argument to gethostbyaddr?'
15077 netdb_hlen_type=$ans
15081 *) : no gethostbyaddr, so pick harmless defaults
15082 netdb_host_type='char *'
15083 netdb_hlen_type="$sizetype"
15086 # Remove the "const" if needed. -- but then we'll have a
15088 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
15091 : check for type of argument to gethostbyname.
15092 if test "X$netdb_name_type" = X ; then
15093 case "$d_gethbyname" in
15097 Checking to see what type of argument is accepted by gethostbyname().
15099 hdrs="$define sys/types.h
15100 $d_socket sys/socket.h
15101 $i_niin netinet/in.h
15103 $i_unistd unistd.h"
15104 for xxx in "const char *" "char *"; do
15105 case "$netdb_name_type" in
15106 '') try="extern struct hostent *gethostbyname($xxx);"
15107 if ./protochk "$try" $hdrs; then
15108 echo "Your system accepts $xxx."
15109 netdb_name_type="$xxx"
15114 : In case none of those worked, prompt the user.
15115 case "$netdb_name_type" in
15116 '') rp='What is the type for the 1st argument to gethostbyname?'
15119 netdb_name_type=$ans
15123 *) : no gethostbyname, so pick harmless default
15124 netdb_name_type='char *'
15129 : check for type of 1st argument to getnetbyaddr.
15130 if test "X$netdb_net_type" = X ; then
15131 case "$d_getnbyaddr" in
15135 Checking to see what type of 1st argument is accepted by getnetbyaddr().
15137 hdrs="$define sys/types.h
15138 $d_socket sys/socket.h
15139 $i_niin netinet/in.h
15141 $i_unistd unistd.h"
15142 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
15143 case "$netdb_net_type" in
15144 '') try="extern struct netent *getnetbyaddr($xxx, int);"
15145 if ./protochk "$try" $hdrs; then
15146 echo "Your system accepts $xxx."
15147 netdb_net_type="$xxx"
15152 : In case none of those worked, prompt the user.
15153 case "$netdb_net_type" in
15154 '') rp='What is the type for the 1st argument to getnetbyaddr?'
15157 netdb_net_type=$ans
15161 *) : no getnetbyaddr, so pick harmless default
15162 netdb_net_type='long'
15166 : locate the preferred pager for this system
15172 [a-zA-Z]:/*) dflt=$pg;;
15176 [a-zA-Z]:/*) dflt=$more;;
15180 [a-zA-Z]:/*) dflt=$less;;
15183 '') dflt=/usr/ucb/more;;
15190 rp='What pager is used on your system?'
15194 : see what type pids are declared as in the kernel
15195 rp="What is the type of process ids on this system?"
15196 set pid_t pidtype int stdio.h sys/types.h
15199 : Find earliest binary compatible site_perl subdirectory perl can use.
15200 case "$bincompat5005" in
15201 "$define") xs_apiversion='5.005' ;;
15202 *) xs_apiversion=$version ;; # The current site_perl version.
15204 : Find earliest pure perl site_perl subdirectory perl can use.
15205 : The versioned directories started at 5.005.
15206 pm_apiversion='5.005'
15208 : see if ar generates random libraries by itself
15210 echo "Checking how to generate random libraries on your machine..." >&4
15211 echo 'int bar1() { return bar2(); }' > bar1.c
15212 echo 'int bar2() { return 2; }' > bar2.c
15213 $cat > foo.c <<'EOP'
15214 int main() { printf("%d\n", bar1()); exit(0); }
15216 $cc $ccflags -c bar1.c >/dev/null 2>&1
15217 $cc $ccflags -c bar2.c >/dev/null 2>&1
15218 $cc $ccflags -c foo.c >/dev/null 2>&1
15219 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
15220 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
15221 $run ./foobar >/dev/null 2>&1; then
15222 echo "$ar appears to generate random libraries itself."
15225 elif $ar ts bar$_a >/dev/null 2>&1 &&
15226 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
15227 $run ./foobar >/dev/null 2>&1; then
15228 echo "a table of contents needs to be added with '$ar ts'."
15235 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
15236 $test -f $ranlib || ranlib=''
15239 if $test -n "$ranlib"; then
15240 echo "your system has '$ranlib'; we'll use that."
15243 echo "your system doesn't seem to support random libraries"
15244 echo "so we'll use lorder and tsort to order the libraries."
15251 : check for type of arguments to select.
15252 case "$selecttype" in
15253 '') case "$d_select" in
15257 Checking to see what type of arguments are accepted by select().
15259 hdrs="$define sys/types.h
15260 $i_systime sys/time.h
15261 $i_sysselct sys/select.h
15262 $d_socket sys/socket.h"
15263 : The first arg can be int, unsigned, or size_t
15264 : The last arg may or may not be 'const'
15266 : void pointer has been seen but using that
15267 : breaks the selectminbits test
15268 for xxx in 'fd_set *' 'int *'; do
15269 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
15270 for tmo in 'struct timeval *' 'const struct timeval *'; do
15272 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
15273 if ./protochk "$try" $hdrs; then
15274 echo "Your system accepts $xxx."
15283 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
15284 case "$d_fd_set" in
15285 $define) dflt="fd_set *" ;;
15294 *) : no select, so pick a harmless default
15301 : check for the select 'width'
15302 case "$selectminbits" in
15303 '') case "$d_select" in
15307 Checking to see on how many bits at a time your select() operates...
15310 #include <sys/types.h>
15312 #$i_systime I_SYS_TIME
15313 #$i_systimek I_SYS_TIME_KERNEL
15318 # ifdef I_SYS_TIME_KERNEL
15321 # include <sys/time.h>
15322 # ifdef I_SYS_TIME_KERNEL
15326 #$i_sysselct I_SYS_SELECT
15327 #ifdef I_SYS_SELECT
15328 #include <sys/select.h>
15330 #$d_socket HAS_SOCKET
15332 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
15336 #define S sizeof(*(b))
15338 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
15339 #define NBITS (NBYTES * 8)
15348 fp = fopen("try.c", "r");
15354 b = ($selecttype)s;
15355 for (i = 0; i < NBITS; i++)
15359 select(fd + 1, b, 0, 0, &t);
15360 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
15361 printf("%d\n", i + 1);
15366 if eval $compile_ok; then
15367 selectminbits=`$run ./try`
15368 case "$selectminbits" in
15370 Cannot figure out on how many bits at a time your select() operates.
15371 I'll play safe and guess it is 32 bits.
15377 *) bits="$selectminbits bits" ;;
15379 echo "Your select() operates on $bits at a time." >&4
15381 rp='What is the minimum number of bits your select() operates on?'
15382 case "$byteorder" in
15383 1234|12345678) dflt=32 ;;
15388 selectminbits="$val"
15392 *) : no select, so pick a harmless default
15399 : Trace out the files included by signal.h, then look for SIGxxx names.
15400 : Remove SIGARRAYSIZE used by HPUX.
15401 : Remove SIGSTKSIZE used by Linux.
15402 : Remove SIGSTKSZ used by Posix.
15403 : Remove SIGTYP void lines used by OS2.
15404 : Some cpps, like os390, dont give the file name anywhere
15405 if [ "X$fieldn" = X ]; then
15406 : Just make some guesses. We check them later.
15407 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
15409 xxx=`echo '#include <signal.h>' |
15410 $cppstdin $cppminus $cppflags 2>/dev/null |
15411 $grep '^[ ]*#.*include' |
15412 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
15414 : Check this list of files to be sure we have parsed the cpp output ok.
15415 : This will also avoid potentially non-existent files, such
15418 for xx in $xxx /dev/null ; do
15419 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
15421 : If we have found no files, at least try signal.h
15422 case "$xxxfiles" in
15423 '') xxxfiles=`./findhdr signal.h` ;;
15426 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
15427 print substr($2, 4, 20)
15429 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
15430 print substr($3, 4, 20)
15432 : Append some common names just in case the awk scan failed.
15433 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
15434 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
15435 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
15436 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
15437 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
15439 : generate a few handy files for later
15440 $cat > signal.c <<'EOCP'
15441 #include <sys/types.h>
15442 #include <signal.h>
15446 /* Strange style to avoid deeply-nested #if/#else/#endif */
15449 # define NSIG (_NSIG)
15455 # define NSIG (SIGMAX+1)
15461 # define NSIG (SIG_MAX+1)
15467 # define NSIG (MAXSIG+1)
15473 # define NSIG (MAX_SIG+1)
15478 # ifdef SIGARRAYSIZE
15479 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
15485 # define NSIG (_sys_nsig) /* Solaris 2.5 */
15489 /* Default to some arbitrary number that's big enough to get most
15490 of the common signals.
15496 printf("NSIG %d\n", NSIG);
15502 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
15504 printf "#ifdef SIG"; printf $1; printf "\n"
15505 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
15506 printf $1; printf ");\n"
15510 printf "#endif /* JUST_NSIG */\n";
15511 printf "exit(0);\n}\n";
15514 $cat >signal.awk <<'EOP'
15515 BEGIN { ndups = 0 }
15516 $1 ~ /^NSIG$/ { nsig = $2 }
15517 ($1 !~ /^NSIG$/) && (NF == 2) {
15518 if ($2 > maxsig) { maxsig = $2 }
15519 if (sig_name[$2]) {
15520 dup_name[ndups] = $1
15521 dup_num[ndups] = $2
15533 printf("NSIG %d\n", nsig);
15534 for (n = 1; n < nsig; n++) {
15536 printf("%s %d\n", sig_name[n], sig_num[n])
15539 printf("NUM%d %d\n", n, n)
15542 for (n = 0; n < ndups; n++) {
15543 printf("%s %d\n", dup_name[n], dup_num[n])
15547 $cat >signal_cmd <<EOS
15549 if $test -s signal.lst; then
15550 echo "Using your existing signal.lst file"
15555 $cat >>signal_cmd <<'EOS'
15558 if eval $compile_ok; then
15559 $run ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
15561 echo "(I can't seem be able to compile the whole test program)" >&4
15562 echo "(I'll try it in little pieces.)" >&4
15563 set signal -DJUST_NSIG
15564 if eval $compile_ok; then
15565 $run ./signal$_exe > signal.nsg
15568 echo "I can't seem to figure out how many signals you have." >&4
15569 echo "Guessing 50." >&4
15570 echo 'NSIG 50' > signal.nsg
15572 : Now look at all the signal names, one at a time.
15573 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
15574 $cat > signal.c <<EOCP
15575 #include <sys/types.h>
15576 #include <signal.h>
15579 printf("$xx %d\n", SIG${xx});
15584 if eval $compile; then
15585 echo "SIG${xx} found."
15586 $run ./signal$_exe >> signal.ls1
15588 echo "SIG${xx} NOT found."
15591 if $test -s signal.ls1; then
15592 $cat signal.nsg signal.ls1 |
15593 $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
15597 if $test -s signal.lst; then
15600 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
15601 echo 'kill -l' >signal
15602 set X `csh -f <signal`
15606 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
15608 echo $@ | $tr ' ' $trnl | \
15609 $awk '{ printf "%s %d\n", $1, ++s; }
15610 END { printf "NSIG %d\n", ++s }' >signal.lst
15612 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
15614 chmod a+x signal_cmd
15615 $eunicefix signal_cmd
15617 : generate list of signal names
15619 case "$sig_name_init" in
15621 *) case "$sig_num_init" in
15622 ''|*,*) doinit=yes ;;
15627 echo "Generating a list of signal names and numbers..." >&4
15629 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
15630 sig_name=`$awk 'BEGIN { printf "ZERO " }
15631 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
15632 sig_num=`$awk 'BEGIN { printf "0 " }
15633 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
15634 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
15635 !/^NSIG/ { printf "\"%s\", ", $1 }
15636 END { printf "0\n" }' signal.lst`
15637 sig_num_init=`$awk 'BEGIN { printf "0, " }
15638 !/^NSIG/ { printf "%d, ", $2}
15639 END { printf "0\n"}' signal.lst`
15642 echo "The following $sig_count signals are available:"
15644 echo $sig_name | $awk \
15645 'BEGIN { linelen = 0 }
15647 for (i = 1; i <= NF; i++) {
15648 name = "SIG" $i " "
15649 linelen = linelen + length(name)
15650 if (linelen > 70) {
15652 linelen = length(name)
15658 sig_size=`echo $sig_name | awk '{print NF}'`
15659 $rm -f signal signal.c signal.awk signal.lst signal_cmd
15662 case "$sizetype" in
15663 *_t) zzz="$sizetype" ;;
15664 *) zzz="filesize" ;;
15666 echo "Checking the size of $zzz..." >&4
15668 #include <sys/types.h>
15671 printf("%d\n", (int)sizeof($sizetype));
15676 if eval $compile_ok; then
15680 echo "(I can't execute the test program--guessing $sizesize.)" >&4
15683 echo "Your $zzz size is $sizesize bytes."
15688 echo "(I can't compile the test program--guessing $sizesize.)" >&4
15692 : check for socklen_t
15694 echo "Checking to see if you have socklen_t..." >&4
15696 #include <sys/types.h>
15697 #$d_socket HAS_SOCKET
15699 #include <sys/socket.h>
15701 int main() { socklen_t x = 16; }
15704 if eval $compile; then
15706 echo "You have socklen_t."
15709 echo "You do not have socklen_t."
15710 case "$sizetype" in
15711 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
15718 : see if this is a socks.h system
15719 set socks.h i_socks
15722 : check for type of the size argument to socket calls
15723 case "$d_socket" in
15727 Checking to see what type is the last argument of accept().
15730 case "$d_socklen_t" in
15731 "$define") yyy="$yyy socklen_t"
15733 yyy="$yyy $sizetype int long unsigned"
15734 for xxx in $yyy; do
15735 case "$socksizetype" in
15736 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
15737 case "$usesocks" in
15739 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
15740 echo "Your system accepts '$xxx *' for the last argument of accept()."
15741 socksizetype="$xxx"
15744 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
15745 echo "Your system accepts '$xxx *' for the last argument of accept()."
15746 socksizetype="$xxx"
15753 : In case none of those worked, prompt the user.
15754 case "$socksizetype" in
15755 '') rp='What is the type for socket address structure sizes?'
15762 *) : no sockets, so pick relatively harmless default
15767 : see what type is used for signed size_t
15768 set ssize_t ssizetype int stdio.h sys/types.h
15773 #include <sys/types.h>
15774 #define Size_t $sizetype
15775 #define SSize_t $dflt
15778 if (sizeof(Size_t) == sizeof(SSize_t))
15780 else if (sizeof(Size_t) == sizeof(int))
15789 if eval $compile_ok && $run ./try > /dev/null; then
15790 ssizetype=`$run ./try`
15791 echo "I'll be using $ssizetype for functions returning a byte count." >&4
15794 Help! I can't compile and run the ssize_t test program: please enlighten me!
15795 (This is probably a misconfiguration in your system or libraries, and
15796 you really ought to fix it. Still, I'll try anyway.)
15798 I need a type that is the same size as $sizetype, but is guaranteed to
15799 be signed. Common values are ssize_t, int and long.
15802 rp="What signed type is the same size as $sizetype?"
15808 : see what type of char stdio uses.
15810 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
15811 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
15812 echo "Your stdio uses unsigned chars." >&4
15813 stdchar="unsigned char"
15815 echo "Your stdio uses signed chars." >&4
15822 : see if time exists
15824 if test "X$d_time" = X -o X"$timetype" = X; then
15825 if set time val -f d_time; eval $csym; $val; then
15826 echo 'time() found.' >&4
15828 rp="What is the type returned by time() on this system?"
15829 set time_t timetype long stdio.h sys/types.h
15832 echo 'time() not found, hope that will do.' >&4
15840 : see what type uids are declared as in the kernel
15842 echo "Looking for the type for user ids returned by getuid()."
15843 set uid_t uidtype xxx stdio.h sys/types.h
15847 xxx=`./findhdr sys/user.h`
15848 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
15850 unsigned) dflt="$1 $2" ;;
15854 *) dflt="$uidtype";;
15857 uid_t) echo "uid_t found." ;;
15858 *) rp="What is the type for user ids returned by getuid()?"
15866 *_t) zzz="$uidtype" ;;
15869 echo "Checking the size of $zzz..." >&4
15871 #include <sys/types.h>
15874 printf("%d\n", (int)sizeof($uidtype));
15879 if eval $compile_ok; then
15883 echo "(I can't execute the test program--guessing $uidsize.)" >&4
15886 echo "Your $zzz is $uidsize bytes long."
15891 echo "(I can't compile the test program--guessing $uidsize.)" >&4
15896 *_t) zzz="$uidtype" ;;
15899 echo "Checking the sign of $zzz..." >&4
15901 #include <sys/types.h>
15912 if eval $compile; then
15916 echo "(I can't execute the test program--guessing unsigned.)" >&4
15920 1) echo "Your $zzz is unsigned." ;;
15921 -1) echo "Your $zzz is signed." ;;
15927 echo "(I can't compile the test program--guessing unsigned.)" >&4
15933 $echo "Checking the format string to be used for uids..." >&4
15936 -1) if $test X"$uidsize" = X"$ivsize"; then
15937 uidformat="$ivdformat"
15939 if $test X"$uidsize" = X"$longsize"; then
15942 if $test X"$uidsize" = X"$intsize"; then
15945 if $test X"$uidsize" = X"$shortsize"; then
15952 *) if $test X"$uidsize" = X"$uvsize"; then
15953 uidformat="$uvuformat"
15955 if $test X"$uidsize" = X"$longsize"; then
15958 if $test X"$uidsize" = X"$intsize"; then
15961 if $test X"$uidsize" = X"$shortsize"; then
15970 : determine compiler compiler
15979 if $test -f "$byacc$_exe"; then
15981 comp="byacc or $comp"
15983 if $test -f "$bison$_exe"; then
15984 comp="$comp or bison -y"
15986 rp="Which compiler compiler ($comp) shall I use?"
15995 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
16001 : see if this is a fp.h system
16005 : see if this is a fp_class.h system
16006 set fp_class.h i_fp_class
16009 : see if this is a ieeefp.h system
16010 case "$i_ieeefp" in
16011 '' ) set ieeefp.h i_ieeefp
16016 : see if this is a libutil.h system
16017 set libutil.h i_libutil
16020 : see if locale.h is available
16021 set locale.h i_locale
16024 : see if mach cthreads are available
16025 if test "X$usethreads" = "X$define"; then
16026 set mach/cthreads.h i_machcthr
16029 i_machcthr="$undef"
16034 : see if this is a math.h system
16038 : see if this is a mntent.h system
16039 set mntent.h i_mntent
16042 : see if ndbm.h is available
16047 : see if dbm_open exists
16048 set dbm_open d_dbm_open
16050 case "$d_dbm_open" in
16053 echo "We won't be including <ndbm.h>"
16062 : see if net/errno.h is available
16064 set net/errno.h val
16067 : Unfortunately, it causes problems on some systems. Arrgh.
16070 cat > try.c <<'EOM'
16073 #include <net/errno.h>
16079 if $cc $ccflags -c try.c >/dev/null 2>&1; then
16080 echo "We'll be including <net/errno.h>." >&4
16082 echo "We won't be including <net/errno.h>." >&4
16091 : see if netinet/tcp.h is available
16092 set netinet/tcp.h i_netinettcp
16095 : see if this is a poll.h system
16099 : see if this is a prot.h system
16104 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
16105 $cat <<'EOSH' > Cppsym.know
16106 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
16107 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
16108 alliant alpha am29000 AM29000 AMD64 amiga AMIGAOS AMIX
16109 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
16110 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
16111 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
16112 bull c cadmus clipper CMU COFF COMPILER_VERSION
16113 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
16114 CYGWIN DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
16115 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
16116 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
16118 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
16119 H3050R H3050RX hbullx20 hcx host_mips
16120 hp200 hp300 hp700 HP700 hp800 hp9000
16121 hp9000s200 hp9000s300 hp9000s400 hp9000s500
16122 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
16123 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
16124 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
16125 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
16126 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
16127 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
16128 Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
16129 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
16130 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
16131 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
16132 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
16133 MATH_HAS_NO_SIDE_EFFECTS
16134 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
16135 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
16136 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
16137 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
16138 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
16139 NetBSD news1500 news1700 news1800 news1900 news3700
16140 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
16141 ns32016 ns32332 ns32k nsc32000
16142 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
16143 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
16144 pc532 pdp11 PGC PIC plexus PORTAR posix
16145 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
16146 POSIX_C_SOURCE POSIX_SOURCE POWER
16147 PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
16148 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
16149 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
16150 sony sony_news sonyrisc sparc sparclite spectrum
16151 stardent stdc STDC_EXT stratos sun sun3 sun386
16152 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
16153 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
16154 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
16155 sysV68 sysV88 Tek4132 Tek4300 titan
16156 TM3200 TM5400 TM5600
16157 tower tower32 tower32_200 tower32_600 tower32_700
16158 tower32_800 tower32_850 tss
16159 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
16160 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
16161 unix UNIX95 UNIX99 unixpc unos
16162 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
16163 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
16164 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
16166 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms xenix Xenix286
16167 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
16168 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
16171 # Maybe put other stuff here too.
16172 cat <<EOSH >>Cppsym.know
16175 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
16176 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
16177 $cat Cppsym.know > Cppsym.c
16178 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
16179 $rm -f Cppsym.a Cppsym.b Cppsym.c
16180 cat <<EOSH > Cppsym
16182 if $test \$# -gt 0; then
16183 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
16184 if $test -s Cppsym.got; then
16191 $tr " " "$trnl" | ./Cppsym.try
16197 cat <<EOSH > Cppsym.try
16199 cat <<'EOCP' > try.c
16205 cat <<'EOSH' >> Cppsym.try
16207 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
16208 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
16209 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
16210 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
16212 echo 'return 0;}' >> try.c
16214 cat <<EOSH >> Cppsym.try
16216 case "$osname-$gccversion" in
16217 irix-) ccflags="\$ccflags -woff 1178" ;;
16218 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
16220 $cc -o try $optimize \$ccflags $ldflags try.c $libs && $run ./try
16222 chmod +x Cppsym.try
16223 $eunicefix Cppsym.try
16224 ./Cppsym < Cppsym.know > Cppsym.true
16225 : now check the C compiler for additional symbols
16226 postprocess_cc_v=''
16228 aix) postprocess_cc_v="|$tr , ' '" ;;
16235 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
16238 -D*) echo "\$i" | $sed 's/^-D//';;
16239 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
16244 postprocess_cc_v=''
16247 ./ccsym > ccsym1.raw
16248 if $test -s ccsym1.raw; then
16249 $sort ccsym1.raw | $uniq >ccsym.raw
16251 mv ccsym1.raw ccsym.raw
16254 $awk '/\=/ { print $0; next }
16255 { print $0"=1" }' ccsym.raw >ccsym.list
16256 $awk '/\=/ { print $0; next }
16257 { print $0"=1" }' Cppsym.true >ccsym.true
16258 $comm -13 ccsym.true ccsym.list >ccsym.own
16259 $comm -12 ccsym.true ccsym.list >ccsym.com
16260 $comm -23 ccsym.true ccsym.list >ccsym.cpp
16262 if $test -z ccsym.raw; then
16263 echo "Your C compiler doesn't seem to define any symbols!" >&4
16265 echo "However, your C preprocessor defines the following symbols:"
16268 cppsymbols=`$cat Cppsym.true`
16269 cppsymbols=`echo $cppsymbols`
16270 cppccsymbols="$cppsymbols"
16272 if $test -s ccsym.com; then
16273 echo "Your C compiler and pre-processor define these symbols:"
16274 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
16277 cppccsymbols=`$cat ccsym.com`
16278 cppccsymbols=`echo $cppccsymbols`
16279 $test "$silent" || sleep 1
16281 if $test -s ccsym.cpp; then
16282 $test "$also" && echo " "
16283 echo "Your C pre-processor ${also}defines the following symbols:"
16284 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
16286 cppsymbols=`$cat ccsym.cpp`
16287 cppsymbols=`echo $cppsymbols`
16288 $test "$silent" || sleep 1
16290 if $test -s ccsym.own; then
16291 $test "$also" && echo " "
16292 echo "Your C compiler ${also}defines the following cpp symbols:"
16293 $sed -e 's/\(..*\)=1/\1/' ccsym.own
16294 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
16295 ccsymbols=`$cat ccsym.own`
16296 ccsymbols=`echo $ccsymbols`
16297 $test "$silent" || sleep 1
16301 : see if this is a termio system
16305 if $test `./findhdr termios.h`; then
16306 set tcsetattr i_termios
16312 "$define") echo "You have POSIX termios.h... good!" >&4;;
16313 *) if ./Cppsym pyr; then
16314 case "`/bin/universe`" in
16315 ucb) if $test `./findhdr sgtty.h`; then
16317 echo "<sgtty.h> found." >&4
16319 echo "System is pyramid with BSD universe."
16320 echo "<sgtty.h> not found--you could have problems." >&4
16322 *) if $test `./findhdr termio.h`; then
16324 echo "<termio.h> found." >&4
16326 echo "System is pyramid with USG universe."
16327 echo "<termio.h> not found--you could have problems." >&4
16331 if $test `./findhdr termio.h`; then
16332 echo "<termio.h> found." >&4
16334 elif $test `./findhdr sgtty.h`; then
16335 echo "<sgtty.h> found." >&4
16338 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
16341 if $test `./findhdr sgtty.h`; then
16342 echo "<sgtty.h> found." >&4
16344 elif $test `./findhdr termio.h`; then
16345 echo "<termio.h> found." >&4
16348 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
16352 set i_termio; eval $setvar
16353 val=$val2; set i_sgtty; eval $setvar
16354 val=$val3; set i_termios; eval $setvar
16356 : see if this is a shadow.h system
16357 set shadow.h i_shadow
16360 : see if stddef is available
16361 set stddef.h i_stddef
16364 : see if this is a sunmath.h system
16365 set sunmath.h i_sunmath
16368 : see if sys/access.h is available
16369 set sys/access.h i_sysaccess
16372 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
16373 set sys/filio.h i_sysfilio
16376 if $test `./findhdr sys/ioctl.h`; then
16378 echo '<sys/ioctl.h> found.' >&4
16381 if $test $i_sysfilio = "$define"; then
16382 echo '<sys/ioctl.h> NOT found.' >&4
16384 $test $i_sgtty = "$define" && xxx="sgtty.h"
16385 $test $i_termio = "$define" && xxx="termio.h"
16386 $test $i_termios = "$define" && xxx="termios.h"
16387 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
16393 : see if socket ioctl defs are in sys/sockio.h
16395 xxx=`./findhdr sys/sockio.h`
16396 if $test "$xxx"; then
16397 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
16399 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
16402 echo "No socket ioctls found in <sys/sockio.h>." >&4
16407 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
16414 : see if this is a syslog.h system
16415 set syslog.h i_syslog
16419 : see if this is a sys/mode.h system
16420 set sys/mode.h i_sysmode
16423 : see if sys/resource.h has to be included
16424 set sys/resource.h i_sysresrc
16427 : see if sys/security.h is available
16428 set sys/security.h i_syssecrt
16431 : see if this is a sys/statvfs.h system
16432 set sys/statvfs.h i_sysstatvfs
16435 : see if this is a sys/un.h system
16436 set sys/un.h i_sysun
16440 : see if this is a sys/utsname.h system
16441 set sys/utsname.h i_sysutsname
16444 : see if this is a syswait system
16445 set sys/wait.h i_syswait
16448 : see if this is a ustat.h system
16449 set ustat.h i_ustat
16452 : see if this is an utime system
16453 set utime.h i_utime
16456 : see if this is a values.h system
16457 set values.h i_values
16460 : see if this is a vfork system
16463 set vfork.h i_vfork
16471 : see if gdbm.h is available
16476 : see if gdbm_open exists
16477 set gdbm_open d_gdbm_open
16479 case "$d_gdbm_open" in
16482 echo "We won't be including <gdbm.h>"
16492 echo "Looking for extensions..." >&4
16493 : If we are using the old config.sh, known_extensions may contain
16494 : old or inaccurate or duplicate values.
16495 known_extensions=''
16496 nonxs_extensions=''
16497 : We do not use find because it might not be available.
16498 : We do not just use MANIFEST because the user may have dropped
16499 : some additional extensions into the source tree and expect them
16502 : Function to recursively find available extensions, ignoring DynaLoader
16503 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
16507 DynaLoader|dynaload) ;;
16509 if $test -f $xxx/$xxx.xs; then
16510 known_extensions="$known_extensions $1$xxx";
16511 elif $test -f $xxx/Makefile.PL; then
16512 nonxs_extensions="$nonxs_extensions $1$xxx";
16514 if $test -d $xxx -a $# -lt 10; then
16517 eval $find_extensions;
16529 eval $find_extensions
16530 # Special case: Add in threads/shared since it is not picked up by the
16531 # recursive find above (and adding in general recursive finding breaks
16532 # SDBM_File/sdbm). A.D. 10/25/2001.
16533 known_extensions="$known_extensions threads/shared"
16534 set X $nonxs_extensions
16536 nonxs_extensions="$*"
16537 set X $known_extensions
16539 known_extensions="$*"
16542 : Now see which are supported on this system.
16544 for xxx in $known_extensions ; do
16548 $define) avail_ext="$avail_ext $xxx" ;;
16551 GDBM_File|gdbm_fil)
16553 $define) avail_ext="$avail_ext $xxx" ;;
16556 I18N/Langinfo|i18n_lan)
16557 case "$i_langinfo$d_nl_langinfo" in
16558 $define$define) avail_ext="$avail_ext $xxx" ;;
16561 NDBM_File|ndbm_fil)
16564 case "$osname-$use64bitint" in
16565 cygwin-*|hpux-define)
16567 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
16570 *) avail_ext="$avail_ext $xxx" ;;
16575 ODBM_File|odbm_fil)
16576 case "${i_dbm}${i_rpcsvcdbm}" in
16578 case "$osname-$use64bitint" in
16579 cygwin-*|hpux-define)
16581 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
16584 *) avail_ext="$avail_ext $xxx" ;;
16590 case "$useposix" in
16591 true|define|y) avail_ext="$avail_ext $xxx" ;;
16595 case "$useopcode" in
16596 true|define|y) avail_ext="$avail_ext $xxx" ;;
16600 case "$d_socket" in
16603 beos) ;; # not unless BONE
16604 *) avail_ext="$avail_ext $xxx" ;;
16609 Sys/Syslog|sys/syslog)
16610 : XXX syslog requires socket
16611 case "$d_socket" in
16612 true|$define|y) avail_ext="$avail_ext $xxx" ;;
16616 case "$usethreads" in
16618 case "$useithreads" in
16619 $undef|false|[nN]*) avail_ext="$avail_ext $xxx" ;;
16623 threads|threads/shared)
16624 case "$usethreads" in
16626 case "$useithreads" in
16627 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
16632 : XXX Do we need a useipcsysv variable here
16633 case "${d_msg}${d_sem}${d_shm}" in
16634 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
16637 *) avail_ext="$avail_ext $xxx"
16646 : Now see which nonxs extensions are supported on this system.
16647 : For now assume all are.
16649 for xxx in $nonxs_extensions ; do
16651 *) nonxs_ext="$nonxs_ext $xxx"
16663 A number of extensions are supplied with $package. You may choose to
16664 compile these extensions for dynamic loading (the default), compile
16665 them into the $package executable (static loading), or not include
16666 them at all. Answer "none" to include no extensions.
16667 Note that DynaLoader is always built and need not be mentioned here.
16670 case "$dynamic_ext" in
16671 '') dflt="$avail_ext" ;;
16672 *) dflt="$dynamic_ext"
16673 # Perhaps we are reusing an old out-of-date config.sh.
16676 if test X"$dynamic_ext" != X"$avail_ext"; then
16678 NOTICE: Your previous config.sh list may be incorrect.
16679 The extensions now available to you are
16681 but the default list from your previous config.sh is
16693 rp="What extensions do you wish to load dynamically?"
16696 none) dynamic_ext=' ' ;;
16697 *) dynamic_ext="$ans" ;;
16700 case "$static_ext" in
16702 : Exclude those already listed in dynamic linking
16704 for xxx in $avail_ext; do
16705 case " $dynamic_ext " in
16707 *) dflt="$dflt $xxx" ;;
16714 *) dflt="$static_ext"
16721 rp="What extensions do you wish to load statically?"
16724 none) static_ext=' ' ;;
16725 *) static_ext="$ans" ;;
16730 A number of extensions are supplied with $package. Answer "none"
16731 to include no extensions.
16732 Note that DynaLoader is always built and need not be mentioned here.
16735 case "$static_ext" in
16736 '') dflt="$avail_ext" ;;
16737 *) dflt="$static_ext"
16738 # Perhaps we are reusing an old out-of-date config.sh.
16741 if test X"$static_ext" != X"$avail_ext"; then
16743 NOTICE: Your previous config.sh list may be incorrect.
16744 The extensions now available to you are
16746 but the default list from your previous config.sh is
16755 : Exclude those that are not xs extensions
16759 rp="What extensions do you wish to include?"
16762 none) static_ext=' ' ;;
16763 *) static_ext="$ans" ;;
16768 set X $dynamic_ext $static_ext $nonxs_ext
16772 : Remove libraries needed only for extensions
16773 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
16774 : The exception is SunOS 4.x, which needs them.
16775 case "${osname}X${osvers}" in
16779 *) case "$usedl" in
16780 $define|true|[yY]*)
16781 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
16785 *) perllibs="$libs"
16791 : Remove build directory name from cppstdin so it can be used from
16792 : either the present location or the final installed location.
16794 : Get out of the UU directory to get correct path name.
16796 case "$cppstdin" in
16798 echo "Stripping down cppstdin path name"
16804 : end of configuration questions
16806 echo "End of configuration questions."
16809 : back to where it started
16810 if test -d ../UU; then
16814 : configuration may be patched via a 'config.arch' file
16815 if $test -f config.arch; then
16816 echo "I see a config.arch file, loading it."
16820 : configuration may be patched via a 'config.over' file
16821 if $test -f config.over; then
16824 rp='I see a config.over file. Do you wish to load it?'
16827 n*) echo "OK, I'll ignore it.";;
16829 echo "Configuration override changes have been loaded."
16834 : in case they want portability, strip down executable paths
16835 case "$d_portable" in
16838 echo "Stripping down executable paths..." >&4
16839 for file in $loclist $trylist; do
16841 eval $file=`basename $temp`
16846 : create config.sh file
16848 echo "Creating config.sh..." >&4
16849 $spitshell <<EOT >config.sh
16852 # This file was produced by running the Configure script. It holds all the
16853 # definitions figured out by Configure. Should you modify one of these values,
16854 # do not forget to propagate your changes by running "Configure -der". You may
16855 # instead choose to run each of the .SH files by yourself, or "Configure -S".
16858 # Package name : $package
16859 # Source directory : $src
16860 # Configuration time: $cf_time
16861 # Configured by : $cf_by
16862 # Target system : $myuname
16872 Revision='$Revision'
16880 alignbytes='$alignbytes'
16881 ansi2knr='$ansi2knr'
16882 aphostname='$aphostname'
16883 api_revision='$api_revision'
16884 api_subversion='$api_subversion'
16885 api_version='$api_version'
16886 api_versionstring='$api_versionstring'
16889 archlibexp='$archlibexp'
16890 archname64='$archname64'
16891 archname='$archname'
16892 archobjs='$archobjs'
16897 bincompat5005='$bincompat5005'
16901 byteorder='$byteorder'
16903 castflags='$castflags'
16906 cccdlflags='$cccdlflags'
16907 ccdlflags='$ccdlflags'
16909 ccflags_uselargefiles='$ccflags_uselargefiles'
16911 ccsymbols='$ccsymbols'
16912 ccversion='$ccversion'
16914 cf_email='$cf_email'
16916 charsize='$charsize'
16920 clocktype='$clocktype'
16922 compress='$compress'
16923 contains='$contains'
16927 cpp_stuff='$cpp_stuff'
16928 cppccsymbols='$cppccsymbols'
16929 cppflags='$cppflags'
16931 cppminus='$cppminus'
16933 cppstdin='$cppstdin'
16934 cppsymbols='$cppsymbols'
16935 cryptlib='$cryptlib'
16937 d_Gconvert='$d_Gconvert'
16938 d_PRIEUldbl='$d_PRIEUldbl'
16939 d_PRIFUldbl='$d_PRIFUldbl'
16940 d_PRIGUldbl='$d_PRIGUldbl'
16941 d_PRIXU64='$d_PRIXU64'
16942 d_PRId64='$d_PRId64'
16943 d_PRIeldbl='$d_PRIeldbl'
16944 d_PRIfldbl='$d_PRIfldbl'
16945 d_PRIgldbl='$d_PRIgldbl'
16946 d_PRIi64='$d_PRIi64'
16947 d_PRIo64='$d_PRIo64'
16948 d_PRIu64='$d_PRIu64'
16949 d_PRIx64='$d_PRIx64'
16950 d_SCNfldbl='$d_SCNfldbl'
16951 d__fwalk='$d__fwalk'
16952 d_access='$d_access'
16953 d_accessx='$d_accessx'
16955 d_archlib='$d_archlib'
16958 d_attribut='$d_attribut'
16961 d_bincompat5005='$d_bincompat5005'
16963 d_bsdgetpgrp='$d_bsdgetpgrp'
16964 d_bsdsetpgrp='$d_bsdsetpgrp'
16966 d_casti32='$d_casti32'
16967 d_castneg='$d_castneg'
16968 d_charvspr='$d_charvspr'
16970 d_chroot='$d_chroot'
16971 d_chsize='$d_chsize'
16973 d_closedir='$d_closedir'
16974 d_cmsghdr_s='$d_cmsghdr_s'
16978 d_cuserid='$d_cuserid'
16979 d_dbl_dig='$d_dbl_dig'
16980 d_dbminitproto='$d_dbminitproto'
16981 d_difftime='$d_difftime'
16983 d_dirnamlen='$d_dirnamlen'
16984 d_dlerror='$d_dlerror'
16985 d_dlopen='$d_dlopen'
16986 d_dlsymun='$d_dlsymun'
16987 d_dosuid='$d_dosuid'
16988 d_drand48proto='$d_drand48proto'
16990 d_eaccess='$d_eaccess'
16991 d_endgrent='$d_endgrent'
16992 d_endhent='$d_endhent'
16993 d_endnent='$d_endnent'
16994 d_endpent='$d_endpent'
16995 d_endpwent='$d_endpwent'
16996 d_endsent='$d_endsent'
16997 d_eofnblk='$d_eofnblk'
16998 d_eunice='$d_eunice'
16999 d_fchdir='$d_fchdir'
17000 d_fchmod='$d_fchmod'
17001 d_fchown='$d_fchown'
17003 d_fcntl_can_lock='$d_fcntl_can_lock'
17004 d_fd_macros='$d_fd_macros'
17005 d_fd_set='$d_fd_set'
17006 d_fds_bits='$d_fds_bits'
17007 d_fgetpos='$d_fgetpos'
17008 d_finite='$d_finite'
17009 d_finitel='$d_finitel'
17010 d_flexfnam='$d_flexfnam'
17012 d_flockproto='$d_flockproto'
17014 d_fp_class='$d_fp_class'
17015 d_fpathconf='$d_fpathconf'
17016 d_fpclass='$d_fpclass'
17017 d_fpclassify='$d_fpclassify'
17018 d_fpclassl='$d_fpclassl'
17019 d_fpos64_t='$d_fpos64_t'
17020 d_frexpl='$d_frexpl'
17021 d_fs_data_s='$d_fs_data_s'
17022 d_fseeko='$d_fseeko'
17023 d_fsetpos='$d_fsetpos'
17024 d_fstatfs='$d_fstatfs'
17025 d_fstatvfs='$d_fstatvfs'
17027 d_ftello='$d_ftello'
17029 d_getcwd='$d_getcwd'
17030 d_getespwnam='$d_getespwnam'
17031 d_getfsstat='$d_getfsstat'
17032 d_getgrent='$d_getgrent'
17033 d_getgrps='$d_getgrps'
17034 d_gethbyaddr='$d_gethbyaddr'
17035 d_gethbyname='$d_gethbyname'
17036 d_gethent='$d_gethent'
17037 d_gethname='$d_gethname'
17038 d_gethostprotos='$d_gethostprotos'
17039 d_getitimer='$d_getitimer'
17040 d_getlogin='$d_getlogin'
17041 d_getmnt='$d_getmnt'
17042 d_getmntent='$d_getmntent'
17043 d_getnbyaddr='$d_getnbyaddr'
17044 d_getnbyname='$d_getnbyname'
17045 d_getnent='$d_getnent'
17046 d_getnetprotos='$d_getnetprotos'
17047 d_getpagsz='$d_getpagsz'
17048 d_getpbyname='$d_getpbyname'
17049 d_getpbynumber='$d_getpbynumber'
17050 d_getpent='$d_getpent'
17051 d_getpgid='$d_getpgid'
17052 d_getpgrp2='$d_getpgrp2'
17053 d_getpgrp='$d_getpgrp'
17054 d_getppid='$d_getppid'
17055 d_getprior='$d_getprior'
17056 d_getprotoprotos='$d_getprotoprotos'
17057 d_getprpwnam='$d_getprpwnam'
17058 d_getpwent='$d_getpwent'
17059 d_getsbyname='$d_getsbyname'
17060 d_getsbyport='$d_getsbyport'
17061 d_getsent='$d_getsent'
17062 d_getservprotos='$d_getservprotos'
17063 d_getspnam='$d_getspnam'
17064 d_gettimeod='$d_gettimeod'
17065 d_gnulibc='$d_gnulibc'
17066 d_grpasswd='$d_grpasswd'
17067 d_hasmntopt='$d_hasmntopt'
17070 d_inetaton='$d_inetaton'
17071 d_int64_t='$d_int64_t'
17072 d_isascii='$d_isascii'
17073 d_isfinite='$d_isfinite'
17076 d_isnanl='$d_isnanl'
17077 d_killpg='$d_killpg'
17078 d_lchown='$d_lchown'
17079 d_ldbl_dig='$d_ldbl_dig'
17081 d_locconv='$d_locconv'
17083 d_longdbl='$d_longdbl'
17084 d_longlong='$d_longlong'
17085 d_lseekproto='$d_lseekproto'
17087 d_madvise='$d_madvise'
17089 d_mbstowcs='$d_mbstowcs'
17090 d_mbtowc='$d_mbtowc'
17091 d_memchr='$d_memchr'
17092 d_memcmp='$d_memcmp'
17093 d_memcpy='$d_memcpy'
17094 d_memmove='$d_memmove'
17095 d_memset='$d_memset'
17097 d_mkdtemp='$d_mkdtemp'
17098 d_mkfifo='$d_mkfifo'
17099 d_mkstemp='$d_mkstemp'
17100 d_mkstemps='$d_mkstemps'
17101 d_mktime='$d_mktime'
17104 d_modfl_pow32_bug='$d_modfl_pow32_bug'
17105 d_mprotect='$d_mprotect'
17107 d_msg_ctrunc='$d_msg_ctrunc'
17108 d_msg_dontroute='$d_msg_dontroute'
17109 d_msg_oob='$d_msg_oob'
17110 d_msg_peek='$d_msg_peek'
17111 d_msg_proxy='$d_msg_proxy'
17112 d_msgctl='$d_msgctl'
17113 d_msgget='$d_msgget'
17114 d_msghdr_s='$d_msghdr_s'
17115 d_msgrcv='$d_msgrcv'
17116 d_msgsnd='$d_msgsnd'
17118 d_munmap='$d_munmap'
17119 d_mymalloc='$d_mymalloc'
17121 d_nl_langinfo='$d_nl_langinfo'
17122 d_nv_preserves_uv='$d_nv_preserves_uv'
17123 d_nv_preserves_uv_bits='$d_nv_preserves_uv_bits'
17124 d_off64_t='$d_off64_t'
17125 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
17126 d_oldpthreads='$d_oldpthreads'
17127 d_oldsock='$d_oldsock'
17129 d_pathconf='$d_pathconf'
17131 d_perl_otherlibdirs='$d_perl_otherlibdirs'
17132 d_phostname='$d_phostname'
17135 d_portable='$d_portable'
17136 d_procselfexe='$d_procselfexe'
17137 d_pthread_atfork='$d_pthread_atfork'
17138 d_pthread_yield='$d_pthread_yield'
17140 d_pwchange='$d_pwchange'
17141 d_pwclass='$d_pwclass'
17142 d_pwcomment='$d_pwcomment'
17143 d_pwexpire='$d_pwexpire'
17144 d_pwgecos='$d_pwgecos'
17145 d_pwpasswd='$d_pwpasswd'
17146 d_pwquota='$d_pwquota'
17149 d_readdir='$d_readdir'
17150 d_readlink='$d_readlink'
17152 d_recvmsg='$d_recvmsg'
17153 d_rename='$d_rename'
17154 d_rewinddir='$d_rewinddir'
17156 d_safebcpy='$d_safebcpy'
17157 d_safemcpy='$d_safemcpy'
17158 d_sanemcmp='$d_sanemcmp'
17159 d_sbrkproto='$d_sbrkproto'
17160 d_sched_yield='$d_sched_yield'
17161 d_scm_rights='$d_scm_rights'
17162 d_seekdir='$d_seekdir'
17163 d_select='$d_select'
17165 d_semctl='$d_semctl'
17166 d_semctl_semid_ds='$d_semctl_semid_ds'
17167 d_semctl_semun='$d_semctl_semun'
17168 d_semget='$d_semget'
17170 d_sendmsg='$d_sendmsg'
17171 d_setegid='$d_setegid'
17172 d_seteuid='$d_seteuid'
17173 d_setgrent='$d_setgrent'
17174 d_setgrps='$d_setgrps'
17175 d_sethent='$d_sethent'
17176 d_setitimer='$d_setitimer'
17177 d_setlinebuf='$d_setlinebuf'
17178 d_setlocale='$d_setlocale'
17179 d_setnent='$d_setnent'
17180 d_setpent='$d_setpent'
17181 d_setpgid='$d_setpgid'
17182 d_setpgrp2='$d_setpgrp2'
17183 d_setpgrp='$d_setpgrp'
17184 d_setprior='$d_setprior'
17185 d_setproctitle='$d_setproctitle'
17186 d_setpwent='$d_setpwent'
17187 d_setregid='$d_setregid'
17188 d_setresgid='$d_setresgid'
17189 d_setresuid='$d_setresuid'
17190 d_setreuid='$d_setreuid'
17191 d_setrgid='$d_setrgid'
17192 d_setruid='$d_setruid'
17193 d_setsent='$d_setsent'
17194 d_setsid='$d_setsid'
17195 d_setvbuf='$d_setvbuf'
17199 d_shmatprototype='$d_shmatprototype'
17200 d_shmctl='$d_shmctl'
17202 d_shmget='$d_shmget'
17203 d_sigaction='$d_sigaction'
17204 d_sigprocmask='$d_sigprocmask'
17205 d_sigsetjmp='$d_sigsetjmp'
17206 d_sockatmark='$d_sockatmark'
17207 d_sockatmarkproto='$d_sockatmarkproto'
17208 d_socket='$d_socket'
17209 d_socklen_t='$d_socklen_t'
17210 d_sockpair='$d_sockpair'
17211 d_socks5_init='$d_socks5_init'
17213 d_sresgproto='$d_sresgproto'
17214 d_sresuproto='$d_sresuproto'
17215 d_statblks='$d_statblks'
17216 d_statfs_f_flags='$d_statfs_f_flags'
17217 d_statfs_s='$d_statfs_s'
17218 d_statvfs='$d_statvfs'
17219 d_stdio_cnt_lval='$d_stdio_cnt_lval'
17220 d_stdio_ptr_lval='$d_stdio_ptr_lval'
17221 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
17222 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
17223 d_stdio_stream_array='$d_stdio_stream_array'
17224 d_stdiobase='$d_stdiobase'
17225 d_stdstdio='$d_stdstdio'
17226 d_strchr='$d_strchr'
17227 d_strcoll='$d_strcoll'
17228 d_strctcpy='$d_strctcpy'
17229 d_strerrm='$d_strerrm'
17230 d_strerror='$d_strerror'
17231 d_strftime='$d_strftime'
17232 d_strtod='$d_strtod'
17233 d_strtol='$d_strtol'
17234 d_strtold='$d_strtold'
17235 d_strtoll='$d_strtoll'
17236 d_strtoq='$d_strtoq'
17237 d_strtoul='$d_strtoul'
17238 d_strtoull='$d_strtoull'
17239 d_strtouq='$d_strtouq'
17240 d_strxfrm='$d_strxfrm'
17241 d_suidsafe='$d_suidsafe'
17242 d_symlink='$d_symlink'
17243 d_syscall='$d_syscall'
17244 d_syscallproto='$d_syscallproto'
17245 d_sysconf='$d_sysconf'
17246 d_sysernlst='$d_sysernlst'
17247 d_syserrlst='$d_syserrlst'
17248 d_system='$d_system'
17249 d_tcgetpgrp='$d_tcgetpgrp'
17250 d_tcsetpgrp='$d_tcsetpgrp'
17251 d_telldir='$d_telldir'
17252 d_telldirproto='$d_telldirproto'
17255 d_truncate='$d_truncate'
17256 d_tzname='$d_tzname'
17257 d_u32align='$d_u32align'
17258 d_ualarm='$d_ualarm'
17261 d_union_semun='$d_union_semun'
17262 d_unordered='$d_unordered'
17263 d_usleep='$d_usleep'
17264 d_usleepproto='$d_usleepproto'
17266 d_vendorarch='$d_vendorarch'
17267 d_vendorbin='$d_vendorbin'
17268 d_vendorlib='$d_vendorlib'
17270 d_void_closedir='$d_void_closedir'
17271 d_voidsig='$d_voidsig'
17272 d_voidtty='$d_voidtty'
17273 d_volatile='$d_volatile'
17274 d_vprintf='$d_vprintf'
17276 d_waitpid='$d_waitpid'
17277 d_wcstombs='$d_wcstombs'
17278 d_wctomb='$d_wctomb'
17279 d_writev='$d_writev'
17282 db_hashtype='$db_hashtype'
17283 db_prefixtype='$db_prefixtype'
17284 db_version_major='$db_version_major'
17285 db_version_minor='$db_version_minor'
17286 db_version_patch='$db_version_patch'
17287 defvoidused='$defvoidused'
17288 direntrytype='$direntrytype'
17291 doublesize='$doublesize'
17293 dynamic_ext='$dynamic_ext'
17299 eunicefix='$eunicefix'
17302 extensions='$extensions'
17304 fflushNULL='$fflushNULL'
17305 fflushall='$fflushall'
17307 firstmakefile='$firstmakefile'
17309 fpossize='$fpossize'
17310 fpostype='$fpostype'
17311 freetype='$freetype'
17314 full_csh='$full_csh'
17315 full_sed='$full_sed'
17316 gccosandvers='$gccosandvers'
17317 gccversion='$gccversion'
17318 gidformat='$gidformat'
17325 groupcat='$groupcat'
17326 groupstype='$groupstype'
17329 h_sysfile='$h_sysfile'
17340 i_arpainet='$i_arpainet'
17341 i_bsdioctl='$i_bsdioctl'
17344 i_dirent='$i_dirent'
17350 i_fp_class='$i_fp_class'
17353 i_ieeefp='$i_ieeefp'
17354 i_inttypes='$i_inttypes'
17355 i_langinfo='$i_langinfo'
17356 i_libutil='$i_libutil'
17357 i_limits='$i_limits'
17358 i_locale='$i_locale'
17359 i_machcthr='$i_machcthr'
17360 i_malloc='$i_malloc'
17362 i_memory='$i_memory'
17363 i_mntent='$i_mntent'
17366 i_neterrno='$i_neterrno'
17367 i_netinettcp='$i_netinettcp'
17371 i_pthread='$i_pthread'
17373 i_rpcsvcdbm='$i_rpcsvcdbm'
17376 i_shadow='$i_shadow'
17378 i_stdarg='$i_stdarg'
17379 i_stddef='$i_stddef'
17380 i_stdlib='$i_stdlib'
17381 i_string='$i_string'
17382 i_sunmath='$i_sunmath'
17383 i_sysaccess='$i_sysaccess'
17384 i_sysdir='$i_sysdir'
17385 i_sysfile='$i_sysfile'
17386 i_sysfilio='$i_sysfilio'
17388 i_sysioctl='$i_sysioctl'
17389 i_syslog='$i_syslog'
17390 i_sysmman='$i_sysmman'
17391 i_sysmode='$i_sysmode'
17392 i_sysmount='$i_sysmount'
17393 i_sysndir='$i_sysndir'
17394 i_sysparam='$i_sysparam'
17395 i_sysresrc='$i_sysresrc'
17396 i_syssecrt='$i_syssecrt'
17397 i_sysselct='$i_sysselct'
17398 i_syssockio='$i_syssockio'
17399 i_sysstat='$i_sysstat'
17400 i_sysstatfs='$i_sysstatfs'
17401 i_sysstatvfs='$i_sysstatvfs'
17402 i_systime='$i_systime'
17403 i_systimek='$i_systimek'
17404 i_systimes='$i_systimes'
17405 i_systypes='$i_systypes'
17406 i_sysuio='$i_sysuio'
17408 i_sysutsname='$i_sysutsname'
17409 i_sysvfs='$i_sysvfs'
17410 i_syswait='$i_syswait'
17411 i_termio='$i_termio'
17412 i_termios='$i_termios'
17414 i_unistd='$i_unistd'
17417 i_values='$i_values'
17418 i_varargs='$i_varargs'
17419 i_varhdr='$i_varhdr'
17421 ignore_versioned_solibs='$ignore_versioned_solibs'
17422 inc_version_list='$inc_version_list'
17423 inc_version_list_init='$inc_version_list_init'
17426 installarchlib='$installarchlib'
17427 installbin='$installbin'
17428 installman1dir='$installman1dir'
17429 installman3dir='$installman3dir'
17430 installprefix='$installprefix'
17431 installprefixexp='$installprefixexp'
17432 installprivlib='$installprivlib'
17433 installscript='$installscript'
17434 installsitearch='$installsitearch'
17435 installsitebin='$installsitebin'
17436 installsitelib='$installsitelib'
17437 installstyle='$installstyle'
17438 installusrbinperl='$installusrbinperl'
17439 installvendorarch='$installvendorarch'
17440 installvendorbin='$installvendorbin'
17441 installvendorlib='$installvendorlib'
17443 issymlink='$issymlink'
17444 ivdformat='$ivdformat'
17447 known_extensions='$known_extensions'
17450 lddlflags='$lddlflags'
17452 ldflags_uselargefiles='$ldflags_uselargefiles'
17453 ldlibpthname='$ldlibpthname'
17460 libsdirs='$libsdirs'
17461 libsfiles='$libsfiles'
17462 libsfound='$libsfound'
17463 libspath='$libspath'
17464 libswanted='$libswanted'
17465 libswanted_uselargefiles='$libswanted_uselargefiles'
17471 locincpth='$locincpth'
17472 loclibpth='$loclibpth'
17473 longdblsize='$longdblsize'
17474 longlongsize='$longlongsize'
17475 longsize='$longsize'
17479 lseeksize='$lseeksize'
17480 lseektype='$lseektype'
17484 make_set_make='$make_set_make'
17485 mallocobj='$mallocobj'
17486 mallocsrc='$mallocsrc'
17487 malloctype='$malloctype'
17489 man1direxp='$man1direxp'
17492 man3direxp='$man3direxp'
17494 mips_type='$mips_type'
17496 mmaptype='$mmaptype'
17497 modetype='$modetype'
17499 multiarch='$multiarch'
17501 myarchname='$myarchname'
17502 mydomain='$mydomain'
17503 myhostname='$myhostname'
17506 need_va_copy='$need_va_copy'
17507 netdb_hlen_type='$netdb_hlen_type'
17508 netdb_host_type='$netdb_host_type'
17509 netdb_name_type='$netdb_name_type'
17510 netdb_net_type='$netdb_net_type'
17513 nm_so_opt='$nm_so_opt'
17514 nonxs_ext='$nonxs_ext'
17516 nvEUformat='$nvEUformat'
17517 nvFUformat='$nvFUformat'
17518 nvGUformat='$nvGUformat'
17519 nveformat='$nveformat'
17520 nvfformat='$nvfformat'
17521 nvgformat='$nvgformat'
17524 o_nonblock='$o_nonblock'
17526 old_pthread_create_joinable='$old_pthread_create_joinable'
17527 optimize='$optimize'
17528 orderlib='$orderlib'
17531 otherlibdirs='$otherlibdirs'
17535 patchlevel='$patchlevel'
17536 path_sep='$path_sep'
17539 perl_patchlevel='$perl_patchlevel'
17540 perladmin='$perladmin'
17541 perllibs='$perllibs'
17542 perlpath='$perlpath'
17544 phostname='$phostname'
17547 pm_apiversion='$pm_apiversion'
17551 prefixexp='$prefixexp'
17553 privlibexp='$privlibexp'
17554 procselfexe='$procselfexe'
17555 prototype='$prototype'
17557 quadkind='$quadkind'
17558 quadtype='$quadtype'
17559 randbits='$randbits'
17560 randfunc='$randfunc'
17561 randseedtype='$randseedtype'
17563 rd_nodata='$rd_nodata'
17564 revision='$revision'
17569 sPRIEUldbl='$sPRIEUldbl'
17570 sPRIFUldbl='$sPRIFUldbl'
17571 sPRIGUldbl='$sPRIGUldbl'
17572 sPRIXU64='$sPRIXU64'
17574 sPRIeldbl='$sPRIeldbl'
17575 sPRIfldbl='$sPRIfldbl'
17576 sPRIgldbl='$sPRIgldbl'
17581 sSCNfldbl='$sSCNfldbl'
17582 sched_yield='$sched_yield'
17583 scriptdir='$scriptdir'
17584 scriptdirexp='$scriptdirexp'
17586 seedfunc='$seedfunc'
17587 selectminbits='$selectminbits'
17588 selecttype='$selecttype'
17589 sendmail='$sendmail'
17592 sharpbang='$sharpbang'
17593 shmattype='$shmattype'
17594 shortsize='$shortsize'
17597 sig_count='$sig_count'
17598 sig_name='$sig_name'
17599 sig_name_init='$sig_name_init'
17601 sig_num_init='$sig_num_init'
17602 sig_size='$sig_size'
17603 signal_t='$signal_t'
17604 sitearch='$sitearch'
17605 sitearchexp='$sitearchexp'
17607 sitebinexp='$sitebinexp'
17609 sitelib_stem='$sitelib_stem'
17610 sitelibexp='$sitelibexp'
17611 siteprefix='$siteprefix'
17612 siteprefixexp='$siteprefixexp'
17613 sizesize='$sizesize'
17614 sizetype='$sizetype'
17618 sockethdr='$sockethdr'
17619 socketlib='$socketlib'
17620 socksizetype='$socksizetype'
17622 spackage='$spackage'
17623 spitshell='$spitshell'
17625 ssizetype='$ssizetype'
17626 startperl='$startperl'
17628 static_ext='$static_ext'
17630 stdio_base='$stdio_base'
17631 stdio_bufsiz='$stdio_bufsiz'
17632 stdio_cnt='$stdio_cnt'
17633 stdio_filbuf='$stdio_filbuf'
17634 stdio_ptr='$stdio_ptr'
17635 stdio_stream_array='$stdio_stream_array'
17638 subversion='$subversion'
17642 targetarch='$targetarch'
17646 timeincl='$timeincl'
17647 timetype='$timetype'
17661 uidformat='$uidformat'
17667 uquadtype='$uquadtype'
17668 use5005threads='$use5005threads'
17669 use64bitall='$use64bitall'
17670 use64bitint='$use64bitint'
17671 usecrosscompile='$usecrosscompile'
17673 useithreads='$useithreads'
17674 uselargefiles='$uselargefiles'
17675 uselongdouble='$uselongdouble'
17676 usemorebits='$usemorebits'
17677 usemultiplicity='$usemultiplicity'
17678 usemymalloc='$usemymalloc'
17680 useopcode='$useopcode'
17681 useperlio='$useperlio'
17682 useposix='$useposix'
17683 usereentrant='$usereentrant'
17685 useshrplib='$useshrplib'
17686 usesocks='$usesocks'
17687 usethreads='$usethreads'
17688 usevendorprefix='$usevendorprefix'
17689 usevfork='$usevfork'
17692 uvXUformat='$uvXUformat'
17693 uvoformat='$uvoformat'
17696 uvuformat='$uvuformat'
17697 uvxformat='$uvxformat'
17698 vendorarch='$vendorarch'
17699 vendorarchexp='$vendorarchexp'
17700 vendorbin='$vendorbin'
17701 vendorbinexp='$vendorbinexp'
17702 vendorlib='$vendorlib'
17703 vendorlib_stem='$vendorlib_stem'
17704 vendorlibexp='$vendorlibexp'
17705 vendorprefix='$vendorprefix'
17706 vendorprefixexp='$vendorprefixexp'
17708 version_patchlevel_string='$version_patchlevel_string'
17709 versiononly='$versiononly'
17711 voidflags='$voidflags'
17713 xs_apiversion='$xs_apiversion'
17715 yaccflags='$yaccflags'
17720 : Add in command line options if available
17721 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
17723 : add special variables
17724 $test -f $src/patchlevel.h && \
17725 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
17726 echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
17727 echo "PERL_CONFIG_SH=true" >>config.sh
17729 : propagate old symbols
17730 if $test -f UU/config.sh; then
17731 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
17732 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
17733 $sort | $uniq -u >UU/oldsyms
17734 set X `cat UU/oldsyms`
17740 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
17742 echo "# Variables propagated from previous config.sh file." >>config.sh
17743 for sym in `cat UU/oldsyms`; do
17744 echo " Propagating $hint variable "'$'"$sym..."
17745 eval 'tmp="$'"${sym}"'"'
17747 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
17753 : Finish up by extracting the .SH files
17757 echo "Extraction done."
17767 If you'd like to make any changes to the config.sh file before I begin
17768 to configure things, do it as a shell escape now (e.g. !vi config.sh).
17771 rp="Press return or use a shell escape to edit config.sh:"
17776 *) : in case they cannot read
17777 sh 1>&4 -c "$ans";;
17782 : if this fails, just run all the .SH files by hand
17791 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
17798 Now you need to generate make dependencies by running "$make depend".
17799 You might prefer to run it in background: "$make depend > makedepend.out &"
17800 It can take a while, so you might not want to run it right now.
17805 rp="Run $make depend now?"
17809 $make depend && echo "Now you must run '$make'."
17812 echo "You must run '$make depend' then '$make'."
17815 elif test -f [Mm]akefile; then
17817 echo "Now you must run a $make."
17819 echo "Configure done."
17822 if $test -f Policy.sh; then
17825 If you compile $package on a different machine or from a different object
17826 directory, copy the Policy.sh file from this object directory to the
17827 new one before you run Configure -- this will help you with most of
17828 the policy defaults.
17832 if $test -f config.msg; then
17833 echo "Hmm. I also noted the following information while running:"
17835 $cat config.msg >&4
17838 $rm -f kit*isdone ark*isdone