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 Sun Apr 8 02:03:47 EET DST 2001 [metaconfig 3.0 PL70]
24 # (with additional metaconfig patches by perlbug@perl.org)
29 SCO csh still thinks true is false. Write to SCO today and tell them that next
30 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
32 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
33 we'd have to do is go in and swap the && and || tokens, wherever they are.)
35 [End of diatribe. We now return you to your regularly scheduled programming...]
39 OOPS! You naughty creature! You didn't run Configure with sh!
40 I will attempt to remedy the situation by running sh for you...
44 true || exec sh $0 $argv:q
46 (exit $?0) || cat c2$$
47 (exit $?0) || exec sh $0 $argv:q
50 : compute my invocation name
54 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
59 : Proper separator for the PATH environment variable
61 : On OS/2 this directory should exist if this is not floppy only system :-]
62 if test -d c:/. ; then
63 if test -n "$OS2_SHELL"; then
65 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
66 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
67 elif test -n "$DJGPP"; then
73 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
74 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
75 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
76 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
77 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
78 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /usr/ccs/bin"
79 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
80 paths="$paths /sbin /usr/sbin /usr/libexec"
86 *) test -d $p && PATH=$PATH$p_$p ;;
93 : shall we be using ksh?
99 if (PATH=.; alias -x) >/dev/null 2>&1; then
102 if test -f /hp-ux -a -f /bin/ksh; then
103 needksh='to avoid sh bug in "here document" expansion'
105 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
106 if test X`/usr/bin/uname -v` = X4; then
107 avoidksh="to avoid AIX 4's /bin/sh"
111 if test -f /osf_boot -a -f /usr/sbin/setld; then
112 if test X`/usr/bin/uname -s` = XOSF1; then
113 avoidksh="to avoid Digital UNIX' ksh"
115 unset BIN_SH # if this is 'xpg4' sh will start up ksh
118 case "$inksh/$needksh" in
125 case "$inksh/$avoidksh" in
131 case "$inksh/$needksh-$avoidksh-" in
134 (I see you are using the Korn shell. Some ksh's blow up on $me,
135 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
141 echo "(Feeding myself to $newsh $reason.)"
143 Configure|*/Configure) exec $newsh $0 "$@";;
144 *) exec $newsh Configure "$@";;
149 : if needed set CDPATH to a harmless value that is not chatty
150 : avoid bash 2.02 problems with empty CDPATH.
154 *bash*) CDPATH='.' ;;
159 : Configure runs within the UU subdirectory
160 test -d UU || mkdir UU
468 d_old_pthread_create_joinable=''
469 old_pthread_create_joinable=''
553 d_stdio_ptr_lval_nochange_cnt=''
554 d_stdio_ptr_lval_sets_cnt=''
730 inc_version_list_init=''
749 ignore_versioned_solibs=''
808 d_perl_otherlibdirs=''
825 d_nv_preserves_uv_bits=''
924 d_stdio_stream_array=''
925 stdio_stream_array=''
935 ccflags_uselargefiles=''
936 ldflags_uselargefiles=''
937 libswanted_uselargefiles=''
982 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
985 : We must find out about Eunice early
987 if test -f /etc/unixtovms; then
988 eunicefix=/etc/unixtovms
990 if test -f /etc/unixtovms.exe; then
991 eunicefix=/etc/unixtovms.exe
998 : set useposix=false in your hint file to disable the POSIX extension.
1000 : set useopcode=false in your hint file to disable the Opcode extension.
1002 : Trailing extension. Override this in a hint file, if needed.
1004 : Extra object files, if any, needed on this platform.
1007 : Possible local include directories to search.
1008 : Set locincpth to "" in a hint file to defeat local include searches.
1009 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1010 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1012 : no include file wanted by default
1016 : change the next line if compiling for Xenix/286 on Xenix/386
1017 xlibpth='/usr/lib/386 /lib/386'
1018 : Possible local library directories to search.
1019 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1020 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1022 : general looking path for locating libraries
1023 glibpth="/lib /usr/lib $xlibpth"
1024 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1025 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1026 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1028 : Private path used by Configure to find libraries. Its value
1029 : is prepended to libpth. This variable takes care of special
1030 : machines, like the mips. Usually, it should be empty.
1033 : default library list
1035 : some systems want to use only the non-versioned libso:s
1036 ignore_versioned_solibs=''
1038 ccflags_uselargefiles=''
1039 ldflags_uselargefiles=''
1040 libswanted_uselargefiles=''
1041 : set usemultiplicity on the Configure command line to enable multiplicity.
1042 : set usesocks on the Configure command line to enable socks.
1043 : set usethreads on the Configure command line to enable threads.
1044 : full support for void wanted by default
1047 : List of libraries we want.
1048 : If anyone needs -lnet, put it in a hint file.
1049 libswanted='sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl'
1050 libswanted="$libswanted dld ld sun m c cposix posix"
1051 libswanted="$libswanted ndir dir crypt sec"
1052 libswanted="$libswanted ucb bsd BSD PW x iconv util"
1053 : We probably want to search /usr/shlib before most other libraries.
1054 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1055 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1056 glibpth="/usr/shlib $glibpth"
1057 : Do not use vfork unless overridden by a hint file.
1060 : Find the basic shell for Bourne shell scripts
1064 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1067 if test -f "$xxx"; then
1070 : Build up a list and do a single loop so we can 'break' out.
1071 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1072 for xxx in sh bash ksh pdksh ash; do
1074 try="$try ${p}/${xxx}"
1078 if test -f "$xxx"; then
1081 elif test -f "$xxx.exe"; then
1092 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1094 Usually it's in /bin/sh. How did you even get this far?
1095 Please contact me (Perl Maintainers) at perlbug@perl.org and
1096 we'll try to straighten this all out.
1102 : see if sh knows # comments
1103 if `$sh -c '#' >/dev/null 2>&1`; then
1107 test -f $xcat || xcat=/usr/bin/cat
1112 if test -s today; then
1115 echo "#! $xcat" > try
1119 if test -s today; then
1127 echo "Your $sh doesn't grok # comments--I will strip them later on."
1130 echo "exec grep -v '^[ ]*#'" >spitshell
1132 $eunicefix spitshell
1133 spitshell=`pwd`/spitshell
1135 echo "I presume that if # doesn't work, #! won't work either!"
1140 : figure out how to guarantee sh startup
1142 '') startsh=${sharpbang}${sh} ;;
1154 : echo "Yup, it does."
1156 echo "Hmm... '$startsh' does not guarantee sh startup..."
1157 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1162 : Save command line options in file UU/cmdline.opt for later use in
1163 : generating config.sh.
1164 cat > cmdline.opt <<EOSH
1165 # Configure command line arguments.
1172 cat >>cmdline.opt <<EOSH
1173 config_arg$argn='$arg'
1175 argn=`expr $argn + 1`
1178 : produce awk script to parse command line options
1179 cat >options.awk <<'EOF'
1181 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1183 len = length(optstr);
1184 for (i = 1; i <= len; i++) {
1185 c = substr(optstr, i, 1);
1186 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1197 if (substr(str, 1, 1) != "-") {
1198 printf("'%s'\n", str);
1202 for (i = 2; i <= len; i++) {
1203 c = substr(str, i, 1);
1205 printf("-%s\n", substr(str, i));
1211 printf("'%s'\n", substr(str, i + 1));
1224 : process the command line options
1225 set X `for arg in "$@"; do echo "X$arg"; done |
1226 sed -e s/X// | awk -f options.awk`
1231 : set up default values
1241 rm -f optdef.sh posthint.sh
1242 cat >optdef.sh <<EOS
1248 while test $# -gt 0; do
1250 -d) shift; fastread=yes;;
1251 -e) shift; alldone=cont;;
1255 if test -r "$1"; then
1258 echo "$me: cannot read config file $1." >&2
1263 -h) shift; error=true;;
1264 -r) shift; reuseval=true;;
1265 -s) shift; silent=true; realsilent=true;;
1266 -E) shift; alldone=exit;;
1267 -K) shift; knowitall=true;;
1268 -O) shift; override=true;;
1269 -S) shift; silent=true; extractsh=true;;
1274 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1275 echo "$me: ignoring -D $1" >&2
1278 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1279 *) echo "$1='define'" >> optdef.sh;;
1286 *=) echo "$1" >> optdef.sh;;
1288 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1289 echo "$me: ignoring -U $1" >&2
1291 *) echo "$1='undef'" >> optdef.sh;;
1302 *=*) zzz=`echo $yyy|sed 's!=.*!!'`
1306 zzz=" "`echo $yyy|sed 's!^[^=]*=!!'`
1307 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1313 *:*) xxx=`echo $yyy|sed 's!:.*!!'`
1314 yyy=`echo $yyy|sed 's!^[^:]*:!!'`
1315 zzz=`echo $yyy|sed 's!^[^=]*=!!'`
1316 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1317 *) xxx=`echo $yyy|sed 's!:.*!!'`
1318 yyy=`echo $yyy|sed 's!^[^:]*:!!'` ;;
1324 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1326 echo "$yyy=''" >> posthint.sh ;;
1331 echo "$yyy='$zzz'" >> posthint.sh ;;
1333 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1335 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1340 echo "$yyy=$zzz" >> posthint.sh ;;
1341 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1345 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1348 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1356 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1357 [-U symbol] [-U symbol=] [-A command:symbol...]
1358 -d : use defaults for all answers.
1359 -e : go on without questioning past the production of config.sh.
1360 -f : specify an alternate default configuration file.
1361 -h : print this help message and exit (with an error status).
1362 -r : reuse C symbols value if possible (skips costly nm extraction).
1363 -s : silent mode, only echoes questions and essential information.
1364 -D : define symbol to have some value:
1365 -D symbol symbol gets the value 'define'
1366 -D symbol=value symbol gets the value 'value'
1367 -E : stop at the end of questions, after having produced config.sh.
1368 -K : do not use unless you know what you are doing.
1369 -O : let -D and -U override definitions from loaded configuration file.
1370 -S : perform variable substitutions on all .SH files (can mix with -f)
1371 -U : undefine symbol:
1372 -U symbol symbol gets the value 'undef'
1373 -U symbol= symbol gets completely empty
1374 -A : manipulate symbol after the platform specific hints have been applied:
1375 -A symbol=value append " "value to symbol
1376 -A append:symbol=value append value to symbol
1377 -A define:symbol=value define symbol to have value
1378 -A clear:symbol define symbol to be ''
1379 -A define:symbol define symbol to be 'define'
1380 -A eval:symbol=value define symbol to be eval of value
1381 -A prepend:symbol=value prepend value to symbol
1382 -A undef:symbol define symbol to be 'undef'
1383 -A undef:symbol= define symbol to be ''
1384 -V : print version number and exit (with a zero status).
1391 case "$fastread$alldone" in
1394 case "$extractsh" in
1397 if test ! -t 0; then
1398 echo "Say 'sh Configure', not 'sh <Configure'"
1408 true) exec 1>/dev/null;;
1411 : run the defines and the undefines, if any, but leave the file out there...
1414 : create the posthint manipulation script and leave the file out there...
1419 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1420 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1421 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1422 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1423 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1426 : Some greps do not return status, grrr.
1427 echo "grimblepritz" >grimble
1428 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1430 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1436 : the following should work in any shell
1440 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1441 cat >contains <<'EOSS'
1442 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1447 : Find the path to the source tree
1450 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1454 *) src=`cd ../$src && pwd` ;;
1467 if test -f $rsrc/Configure && \
1468 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1470 : found it, so we are ok.
1473 for src in . .. ../.. ../../.. ../../../..; do
1474 if test -f ../$src/Configure && \
1475 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1486 Sorry, I can't seem to locate the source dir for $package. Please start
1487 Configure with an explicit path -- i.e. /some/path/Configure.
1495 echo "Sources for $package found in \"$src\"." >&4
1499 : script used to extract .SH files with variable substitutions
1500 cat >extract <<'EOS'
1502 echo "Doing variable substitutions on .SH files..."
1503 if test -f $src/MANIFEST; then
1504 set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH$'`
1506 echo "(Looking for .SH files under the source directory.)"
1507 set x `(cd $src; find . -name "*.SH" -print)`
1511 0) set x `(cd $src; echo *.SH)`; shift;;
1513 if test ! -f $src/$1; then
1519 while test $name; do
1520 if test ! -d "$name"; then
1521 create="$name $create";
1522 name=`echo $name | sed -e "s|^[^/]*$||"`;
1523 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1528 for file in $create; do
1537 dir=`expr X$file : 'X\(.*\)/'`
1538 file=`expr X$file : 'X.*/\(.*\)'`
1539 (cd $dir && . ./$file)
1549 dir=`expr X$file : 'X\(.*\)/'`
1550 file=`expr X$file : 'X.*/\(.*\)'`
1551 (set x $dir; shift; eval $mkdir_p)
1561 if test -f $src/config_h.SH; then
1562 if test ! -f config.h; then
1563 : oops, they left it out of MANIFEST, probably, so do it anyway.
1569 : extract files and exit if asked to do so
1570 case "$extractsh" in
1572 case "$realsilent" in
1576 case "$config_sh" in
1577 '') config_sh='config.sh';;
1580 echo "Fetching answers from $config_sh..."
1583 test "$override" && . ./optdef.sh
1592 : Eunice requires " " instead of "", can you believe it
1595 echo "Beginning of configuration questions for $package."
1597 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1599 : first determine how to suppress newline on echo command
1601 echo "Checking echo to see how to suppress newlines..."
1602 (echo "hi there\c" ; echo " ") >.echotmp
1603 if $contains c .echotmp >/dev/null 2>&1 ; then
1614 echo $n "The star should be here-->$c"
1618 : Now test for existence of everything in MANIFEST
1620 if test -f $rsrc/MANIFEST; then
1621 echo "First let's make sure your kit is complete. Checking..." >&4
1622 awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
1625 for filelist in x??; do
1626 (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
1628 if test -s missing; then
1632 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1634 You have the option of continuing the configuration process, despite the
1635 distinct possibility that your kit is damaged, by typing 'y'es. If you
1636 do, don't blame me if something goes wrong. I advise you to type 'n'o
1637 and contact the author (perlbug@perl.org).
1640 echo $n "Continue? [n] $c" >&4
1644 echo "Continuing..." >&4
1648 echo "ABORTING..." >&4
1653 echo "Looks good..."
1656 echo "There is no MANIFEST file. I hope your kit is complete !"
1661 : Find the appropriate value for a newline for tr
1662 if test -n "$DJGPP"; then
1665 if test X"$trnl" = X; then
1666 case "`echo foo|tr '\n' x 2>/dev/null`" in
1670 if test X"$trnl" = X; then
1671 case "`echo foo|tr '\012' x 2>/dev/null`" in
1672 foox) trnl='\012' ;;
1675 if test X"$trnl" = X; then
1678 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1684 : compute the number of columns on the terminal for proper question formatting
1689 : set up the echo used in my read
1690 myecho="case \"\$xxxm\" in
1691 '') echo $n \"\$rp $c\" >&4;;
1693 '') echo $n \"[\$xxxm] $c\";;
1695 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1697 echo $n \"[\$xxxm] $c\" >&4
1699 echo $n \"\$rp [\$xxxm] $c\" >&4
1705 : now set up to do reads with possible shell escape and default assignment
1711 case "\$fastread" in
1712 yes) case "\$dflt" in
1715 case "\$silent-\$rp" in
1720 *) case "\$silent" in
1721 true) case "\$rp" in
1726 while expr "X\$ans" : "X!" >/dev/null; do
1730 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1738 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1747 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1752 echo "(OK, I'll run with -d after this question.)" >&4
1755 echo "*** Sorry, \$1 not supported yet." >&4
1765 echo "*** Substitution done -- please confirm."
1767 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1772 echo "*** Error -- try again."
1779 case "\$ans\$xxxm\$nostick" in
1791 : create .config dir to save info across Configure sessions
1792 test -d ../.config || mkdir ../.config
1793 cat >../.config/README <<EOF
1794 This directory created by Configure to save information that should
1795 persist across sessions for $package.
1797 You may safely delete it if you wish.
1800 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
1802 $define|true|[yY]*) ;;
1803 *) case "$xversion" in
1806 *** WHOA THERE!!! ***
1808 This is an UNSTABLE DEVELOPMENT release.
1809 The version of this $package distribution is $xversion, that is, odd,
1810 (as opposed to even) and that signifies a development release.
1811 If you want a maintenance release, you want an even-numbered version.
1813 Do ***NOT*** install this into production use.
1814 Data corruption and crashes are possible.
1816 It is most seriously suggested that you do not continue any further
1817 unless you want to help in developing and debugging Perl.
1819 If you *still* want to build perl, you can answer 'y' now,
1820 or pass -Dusedevel to Configure.
1823 rp='Do you really want to continue?'
1827 [yY]) echo >&4 "Okay, continuing."
1828 usedevel="$define" ;;
1829 *) echo >&4 "Okay, bye."
1839 case "$versiononly" in
1840 '') versiononly="$define" ;;
1842 case "$installusrbinperl" in
1843 '') installusrbinperl="$undef" ;;
1848 : general instructions
1851 user=`(logname) 2>/dev/null`
1853 '') user=`whoami 2>&1`;;
1855 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1858 rp='Would you like to see the instructions?'
1869 This installation shell script will examine your system and ask you questions
1870 to determine how the perl5 package should be installed. If you get
1871 stuck on a question, you may use a ! shell escape to start a subshell or
1872 execute a command. Many of the questions will have default answers in square
1873 brackets; typing carriage return will give you the default.
1875 On some of the questions which ask for file or directory names you are allowed
1876 to use the ~name construct to specify the login directory belonging to "name",
1877 even if you don't have a shell which knows about that. Questions where this is
1878 allowed will be marked "(~name ok)".
1882 dflt='Type carriage return to continue'
1886 The prompter used in this script allows you to use shell variables and
1887 backticks in your answers. You may use $1, $2, etc... to refer to the words
1888 in the default answer, as if the default line was a set of arguments given to a
1889 script shell. This means you may also use $* to repeat the whole default line,
1890 so you do not have to re-type everything to add something to the default.
1892 Everytime there is a substitution, you will have to confirm. If there is an
1893 error (e.g. an unmatched backtick), the default answer will remain unchanged
1894 and you will be prompted again.
1896 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1897 the questions and use the computed defaults (or the previous answers if there
1898 was already a config.sh file). Type 'Configure -h' for a list of options.
1899 You may also start interactively and then answer '& -d' at any prompt to turn
1900 on the non-interactive behaviour for the remainder of the execution.
1906 Much effort has been expended to ensure that this shell script will run on any
1907 Unix system. If despite that it blows up on yours, your best bet is to edit
1908 Configure and run it again. If you can't run Configure for some reason,
1909 you'll have to generate a config.sh file by hand. Whatever problems you
1910 have, let me (perlbug@perl.org) know how I blew it.
1912 This installation script affects things in two ways:
1914 1) it may do direct variable substitutions on some of the files included
1916 2) it builds a config.h file for inclusion in C programs. You may edit
1917 any of these files as the need arises after running this script.
1919 If you make a mistake on a question, there is no easy way to back up to it
1920 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1921 files. Configure will offer to let you do this before it runs the SH files.
1924 dflt='Type carriage return to continue'
1926 case "$firsttime" in
1927 true) echo $user >>../.config/instruct;;
1931 : find out where common programs are
1933 echo "Locating common programs..." >&4
1946 if test -d \$dir/\$thing; then
1952 for thisthing in \$dir/\$thing; do
1953 : just loop through to pick last item
1955 if test -f \$thisthing; then
1958 elif test -f \$dir/\$thing.exe; then
1959 if test -n "$DJGPP"; then
1960 echo \$dir/\$thing.exe
1962 : on Eunice apparently
2013 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2014 pth="$pth /lib /usr/lib"
2015 for file in $loclist; do
2019 if test -f "$xxx"; then
2022 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2023 xxx=`./loc $file $file $pth`
2026 '') xxx=`./loc $file $file $pth`;;
2027 *) xxx=`./loc $xxx $xxx $pth`;;
2033 echo $file is in $xxx.
2036 echo $file is in $xxx.
2039 echo "I don't know where '$file' is, and my life depends on it." >&4
2040 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2046 echo "Don't worry if any of the following aren't found..."
2048 for file in $trylist; do
2052 if test -f "$xxx"; then
2055 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2056 xxx=`./loc $file $file $pth`
2059 '') xxx=`./loc $file $file $pth`;;
2060 *) xxx=`./loc $xxx $xxx $pth`;;
2066 echo $file is in $xxx.
2069 echo $file is in $xxx.
2072 echo "I don't see $file out there, $say."
2079 echo "Substituting grep for egrep."
2085 echo "Substituting cp for ln."
2091 echo "Hopefully test is built into your sh."
2094 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2095 echo "Using the test built into your sh."
2103 echo "Hopefully echo is built into your sh."
2108 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2109 $echo $n "hi there$c" >foo1
2110 echo $n "hi there$c" >foo2
2111 if cmp foo1 foo2 >/dev/null 2>&1; then
2112 echo "They are compatible. In fact, they may be identical."
2119 They are not compatible! You are probably running ksh on a non-USG system.
2120 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2121 have echo built in and we may have to run some Bourne shell scripts. That
2122 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2125 $echo $n "The star should be here-->$c"
2135 cat <<'EOSC' >>checkcc
2140 int main(int argc, char *argv[]) {
2144 if $cc -o try $ccflags try.c; then
2147 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2153 case "`$cc -v -c try.c 2>&1`" in
2156 if $test X"$trygcc" = Xyes; then
2157 if gcc -o try -c try.c; then
2159 echo "You seem to have a working gcc, though." >&4
2160 rp="Would you like to use it?"
2162 if $test -f myread; then
2165 if $test -f UU/myread; then
2168 echo "Cannot find myread, sorry. Aborting." >&2
2173 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no ;;
2177 if $test X"$despair" = Xyes; then
2179 You need to find a working C compiler.
2180 Either (purchase and) install the C compiler supplied by your OS vendor,
2181 or for a free C compiler try http://gcc.gnu.org/
2182 I cannot continue any further, aborting.
2192 : determine whether symbolic links are supported
2195 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2196 echo "Symbolic links are supported." >&4
2199 echo "Symbolic links are NOT supported." >&4
2204 : determine whether symbolic links are supported
2208 echo "Checking how to test for symbolic links..." >&4
2210 if $test "X$issymlink" = X; then
2211 sh -c "PATH= test -h sym" >/dev/null 2>&1
2212 if test $? = 0; then
2216 if $test "X$issymlink" = X; then
2217 if $test -h >/dev/null 2>&1; then
2218 issymlink="$test -h"
2219 echo "Your builtin 'test -h' may be broken, I'm using external '$test -h'." >&4
2222 if $test "X$issymlink" = X; then
2223 if $test -L sym 2>/dev/null; then
2224 issymlink="$test -L"
2227 if $test "X$issymlink" != X; then
2228 echo "You can test for symbolic links with '$issymlink'." >&4
2230 echo "I do not know how you can test for symbolic links." >&4
2234 *) echo "No symbolic links, so not testing for their testing..." >&4
2240 case "$mksymlinks" in
2243 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2246 *) case "$lns:$issymlink" in
2247 *"ln -s:"*"test -"?)
2248 echo "Creating the symbolic links..." >&4
2249 echo "(First creating the subdirectories...)" >&4
2251 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2253 test -z "$directory" && break
2257 if test ! -d t/base; then
2258 echo "Failed to create the subdirectories. Aborting." >&4
2261 echo "(Then creating the symlinks...)" >&4
2262 awk '{print $1}' $src/MANIFEST | while true; do
2264 test -z "$filename" && break
2265 if test -f $filename; then
2266 if $issymlink $filename; then
2270 if test -f $filename; then
2271 echo "$filename already exists, not symlinking."
2273 ln -s $src/$filename $filename
2277 if test ! -f t/base/commonsense.t; then
2278 echo "Failed to create the symlinks. Aborting." >&4
2283 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2291 : see whether [:lower:] and [:upper:] are supported character classes
2293 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2295 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2299 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
2300 # (0xc9 and 0xd1), therefore that is a nice testing point.
2301 if test "X$up" = X -o "X$low" = X; then
2302 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
2308 if test "X$up" = X -o "X$low" = X; then
2309 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
2315 if test "X$up" = X -o "X$low" = X; then
2316 case "`echo IJ | od -x 2>/dev/null`" in
2318 echo "Hey, this might be EBCDIC." >&4
2319 if test "X$up" = X -o "X$low" = X; then
2320 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2321 ij) up='[A-IJ-RS-Z]'
2326 if test "X$up" = X -o "X$low" = X; then
2327 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2337 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
2339 echo "Using $up and $low to convert case." >&4
2342 echo "I don't know how to translate letters from upper to lower case." >&4
2343 echo "Your tr is not acting any way I know of." >&4
2347 : set up the translation script tr, must be called with ./tr of course
2351 '[A-Z][a-z]') exec $tr '$up' '$low';;
2352 '[a-z][A-Z]') exec $tr '$low' '$up';;
2359 : Try to determine whether config.sh was made on this system
2360 case "$config_sh" in
2362 myuname=`$uname -a 2>/dev/null`
2363 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2364 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2365 # because the A-Z/a-z are not consecutive.
2366 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2367 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2368 newmyuname="$myuname"
2370 case "$knowitall" in
2372 if test -f ../config.sh; then
2373 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2374 eval "`grep myuname= ../config.sh`"
2376 if test "X$myuname" = "X$newmyuname"; then
2384 : Get old answers from old config file if Configure was run on the
2385 : same system, otherwise use the hints.
2388 if test -f config.sh; then
2390 rp="I see a config.sh file. Shall I use it to set the defaults?"
2393 n*|N*) echo "OK, I'll ignore it."
2394 mv config.sh config.sh.old
2395 myuname="$newmyuname"
2397 *) echo "Fetching default answers from your old config.sh file..." >&4
2405 : Older versions did not always set $sh. Catch re-use of such
2415 if test ! -f config.sh; then
2418 First time through, eh? I have some defaults handy for some systems
2419 that need some extra help getting the Configure answers right:
2422 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2424 : Half the following guesses are probably wrong... If you have better
2425 : tests or hints, please send them to perlbug@perl.org
2426 : The metaconfig authors would also appreciate a copy...
2427 $test -f /irix && osname=irix
2428 $test -f /xenix && osname=sco_xenix
2429 $test -f /dynix && osname=dynix
2430 $test -f /dnix && osname=dnix
2431 $test -f /lynx.os && osname=lynxos
2432 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2433 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
2434 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2435 $test -f /bin/mips && /bin/mips && osname=mips
2436 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
2437 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
2438 $test -d /usr/apollo/bin && osname=apollo
2439 $test -f /etc/saf/_sactab && osname=svr4
2440 $test -d /usr/include/minix && osname=minix
2441 if $test -d /MachTen -o -d /MachTen_Folder; then
2443 if $test -x /sbin/version; then
2444 osvers=`/sbin/version | $awk '{print $2}' |
2445 $sed -e 's/[A-Za-z]$//'`
2446 elif $test -x /usr/etc/version; then
2447 osvers=`/usr/etc/version | $awk '{print $2}' |
2448 $sed -e 's/[A-Za-z]$//'`
2454 $test -f /sys/posix.dll &&
2455 $test -f /usr/bin/what &&
2456 set X `/usr/bin/what /sys/posix.dll` &&
2457 $test "$3" = UWIN &&
2461 if $test -f $uname; then
2469 umips) osname=umips ;;
2472 [23]100) osname=mips ;;
2473 next*) osname=next ;;
2475 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
2476 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
2479 elif $test -f /etc/kconfig; then
2481 if test "$lns" = "$ln -s"; then
2483 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
2485 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
2492 if test -n "$DJGPP"; then
2501 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
2503 'not found') osvers="$4"."$3" ;;
2504 '<3240'|'<>3240') osvers=3.2.0 ;;
2505 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
2506 '=3250'|'>3250') osvers=3.2.5 ;;
2510 bsd386) osname=bsd386
2513 cygwin*) osname=cygwin
2516 *dc.osx) osname=dcosx
2522 domainos) osname=apollo
2528 dynixptx*) osname=dynixptx
2529 osvers=`echo "$4"|sed 's/^v//'`
2531 freebsd) osname=freebsd
2533 genix) osname=genix ;;
2535 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
2551 netbsd*) osname=netbsd
2554 news-os) osvers="$3"
2556 4*) osname=newsos4 ;;
2560 next*) osname=next ;;
2561 nonstop-ux) osname=nonstopux ;;
2562 POSIX-BC | posix-bc ) osname=posix-bc
2565 powerux | power_ux | powermax_os | powermaxos | \
2566 powerunix | power_unix) osname=powerux
2572 solaris) osname=solaris
2574 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2581 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2585 titanos) osname=titanos
2594 ultrix) osname=ultrix
2597 osf1|mls+) case "$5" in
2600 osvers=`sizer -v | awk '{print $3}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
2603 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
2606 hp*) osname=hp_osf1 ;;
2607 mips) osname=mips_osf1 ;;
2610 unixware) osname=svr5
2616 $2) case "$osname" in
2620 : svr4.x or possibly later
2630 if test -f /stand/boot ; then
2631 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
2632 if test -n "$INITPROG" -a -f "$INITPROG"; then
2633 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
2634 if test -n "$isesix"; then
2642 *) if test -f /etc/systemid; then
2644 set `echo $3 | $sed 's/\./ /g'` $4
2645 if $test -f $src/hints/sco_$1_$2_$3.sh; then
2647 elif $test -f $src/hints/sco_$1_$2.sh; then
2649 elif $test -f $src/hints/sco_$1.sh; then
2654 '') : Still unknown. Probably a generic Sys V.
2663 *) case "$osname" in
2664 '') : Still unknown. Probably a generic BSD.
2672 if test -f /vmunix -a -f $src/hints/news_os.sh; then
2673 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
2674 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
2677 $rm -f UU/kernel.what
2678 elif test -d c:/.; then
2685 : Now look for a hint file osname_osvers, unless one has been
2686 : specified already.
2689 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
2690 : Also try without trailing minor version numbers.
2691 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
2692 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
2693 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
2694 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
2697 *) case "$osvers" in
2700 *) if $test -f $src/hints/$file.sh ; then
2702 elif $test -f $src/hints/$xfile.sh ; then
2704 elif $test -f $src/hints/$xxfile.sh ; then
2706 elif $test -f $src/hints/$xxxfile.sh ; then
2708 elif $test -f $src/hints/$xxxxfile.sh ; then
2710 elif $test -f "$src/hints/${osname}.sh" ; then
2719 if $test -f Policy.sh ; then
2722 none) dflt="Policy" ;;
2723 *) dflt="Policy $dflt" ;;
2728 dflt=`echo $hintfile | $sed 's/\.sh$//'`
2732 if $test -f Policy.sh ; then
2735 There's also a Policy hint file available, which should make the
2736 site-specific (policy) questions easier to answer.
2743 You may give one or more space-separated answers, or "none" if appropriate.
2744 A well-behaved OS will have no hints, so answering "none" or just "Policy"
2745 is a good thing. DO NOT give a wrong version or a wrong OS.
2749 rp="Which of these apply, if any?"
2752 for file in $tans; do
2753 if $test X$file = XPolicy -a -f Policy.sh; then
2755 $cat Policy.sh >> UU/config.sh
2756 elif $test -f $src/hints/$file.sh; then
2757 . $src/hints/$file.sh
2758 $cat $src/hints/$file.sh >> UU/config.sh
2759 elif $test X$tans = X -o X$tans = Xnone ; then
2762 : Give one chance to correct a possible typo.
2763 echo "$file.sh does not exist"
2765 rp="hint to use instead?"
2767 for file in $ans; do
2768 if $test -f "$src/hints/$file.sh"; then
2769 . $src/hints/$file.sh
2770 $cat $src/hints/$file.sh >> UU/config.sh
2771 elif $test X$ans = X -o X$ans = Xnone ; then
2774 echo "$file.sh does not exist -- ignored."
2781 : Remember our hint file for later.
2782 if $test -f "$src/hints/$file.sh" ; then
2792 echo "Fetching default answers from $config_sh..." >&4
2796 cp $config_sh config.sh 2>/dev/null
2806 test "$override" && . ./optdef.sh
2808 : Restore computed paths
2809 for file in $loclist $trylist; do
2810 eval $file="\$_$file"
2815 Configure uses the operating system name and version to set some defaults.
2816 The default value is probably right if the name rings a bell. Otherwise,
2817 since spelling matters for me, either accept the default or answer "none"
2824 ''|' '|none) dflt=none ;;
2825 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
2828 *) dflt="$osname" ;;
2830 rp="Operating system name?"
2834 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
2840 ''|' '|none) dflt=none ;;
2841 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
2842 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
2844 ''|' ') dflt=none ;;
2849 *) dflt="$osvers" ;;
2851 rp="Operating system version?"
2861 : who configured the system
2862 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
2863 cf_by=`(logname) 2>/dev/null`
2866 cf_by=`(whoami) 2>/dev/null`
2868 "") cf_by=unknown ;;
2872 : set up the script used to warn in case of inconsistency
2879 echo "*** WHOA THERE!!! ***" >&4
2880 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2881 rp=" Keep the $hint value?"
2884 y) td=$was; tu=$was;;
2888 : function used to set $1 to $val
2889 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2891 $define$undef) . ./whoa; eval "$var=\$td";;
2892 $undef$define) . ./whoa; eval "$var=\$tu";;
2893 *) eval "$var=$val";;
2896 case "$usethreads" in
2897 $define|true|[yY]*) dflt='y';;
2902 Perl can be built to take advantage of threads on some systems.
2903 To do so, Configure can be run with -Dusethreads.
2905 Note that threading is a highly experimental feature, and
2906 some known race conditions still remain. If you choose to try
2907 it, be very sure to not actually deploy it for production
2908 purposes. README.threads has more details, and is required
2909 reading if you enable threads.
2911 If this doesn't make any sense to you, just accept the default '$dflt'.
2913 rp='Build a threading Perl?'
2916 y|Y) val="$define" ;;
2922 case "$usethreads" in
2926 As of 5.5.640, Perl has two different internal threading implementations,
2927 the 5.005 version (5005threads) and an interpreter-based version
2928 (ithreads) that has one interpreter per thread. Both are very
2929 experimental. This arrangement exists to help developers work out
2930 which one is better.
2932 If you're a casual user, you probably don't want interpreter-threads
2933 at this time. There doesn't yet exist a way to create threads from
2934 within Perl in this model, i.e., "use Thread;" will NOT work.
2936 : Default to ithreads unless overridden on command line or with
2939 case "$use5005threads" in
2940 $define|true|[yY]*) dflt='n';;
2942 case "$useithreads" in
2943 $undef|false|[nN]*) dflt='n';;
2945 rp='Use interpreter-based ithreads?'
2948 y|Y) val="$define" ;;
2953 : Now set use5005threads to the opposite value.
2954 case "$useithreads" in
2955 $define) val="$undef" ;;
2962 useithreads="$undef"
2963 use5005threads="$undef"
2967 case "$useithreads$use5005threads" in
2971 You cannot have both the ithreads and the 5.005 threads enabled
2972 at the same time. Disabling the 5.005 threads since they are
2973 much less stable than the ithreads.
2976 use5005threads="$undef"
2980 case "$d_oldpthreads" in
2981 '') : Configure tests would be welcome here. For now, assume undef.
2983 *) val="$d_oldpthreads" ;;
2989 case "$usethreads" in
2990 "$define"|true|[yY]*)
2991 : Look for a hint-file generated 'call-back-unit'. If the
2992 : user has specified that a threading perl is to be built,
2993 : we may need to set or change some other defaults.
2994 if $test -f usethreads.cbu; then
2995 echo "Your platform has some specific hints for threaded builds, using them..."
2999 (Your platform doesn't have any specific hints for threaded builds.
3000 Assuming POSIX threads, then.)
3008 Perl can be built so that multiple Perl interpreters can coexist
3009 within the same Perl executable.
3012 case "$useithreads" in
3015 This multiple interpreter support is required for interpreter-based threads.
3019 *) case "$usemultiplicity" in
3020 $define|true|[yY]*) dflt='y';;
3024 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
3025 rp='Build Perl for multiplicity?'
3028 y|Y) val="$define" ;;
3036 : make some quick guesses about what we are up against
3038 $echo $n "Hmm... $c"
3048 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
3049 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
3051 echo "Looks kind of like an OSF/1 system, but we'll see..."
3053 elif test `echo abc | $tr a-z A-Z` = Abc ; then
3054 xxx=`./loc addbib blurfl $pth`
3055 if $test -f $xxx; then
3056 echo "Looks kind of like a USG system with BSD features, but we'll see..."
3060 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
3061 echo "Looks kind of like an extended USG system, but we'll see..."
3063 echo "Looks kind of like a USG system, but we'll see..."
3067 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
3068 echo "Looks kind of like a BSD system, but we'll see..."
3072 echo "Looks kind of like a Version 7 system, but we'll see..."
3075 case "$eunicefix" in
3078 There is, however, a strange, musty smell in the air that reminds me of
3079 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
3083 : it so happens the Eunice I know will not run shell scripts in Unix format
3087 echo "Congratulations. You aren't running Eunice."
3091 : Detect OS2. The p_ variable is set above in the Head.U unit.
3092 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
3093 : semicolon as a patch separator
3098 I have the feeling something is not exactly right, however...don't tell me...
3099 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
3100 (Or you may be running DOS with DJGPP.)
3105 if test -f /xenix; then
3106 echo "Actually, this looks more like a XENIX system..."
3111 echo "It's not Xenix..."
3116 if test -f /venix; then
3117 echo "Actually, this looks more like a VENIX system..."
3124 echo "Nor is it Venix..."
3127 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3128 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3135 rp="Use which C compiler?"
3138 : Look for a hint-file generated 'call-back-unit'. Now that the
3139 : user has specified the compiler, we may need to set or change some
3141 if $test -f cc.cbu; then
3147 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3148 $cat >gccvers.c <<EOM
3153 printf("%s\n", __VERSION__);
3155 printf("%s\n", "1");
3161 if $cc -o gccvers $ccflags $ldflags gccvers.c; then
3162 gccversion=`./gccvers`
3163 case "$gccversion" in
3164 '') echo "You are not using GNU cc." ;;
3165 *) echo "You are using GNU cc $gccversion."
3171 echo "*** WHOA THERE!!! ***" >&4
3172 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3173 case "$knowitall" in
3175 echo " You'd better start hunting for one and let me know about it." >&4
3181 case "$gccversion" in
3182 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3184 case "$gccversion" in
3185 '') gccosandvers='' ;;
3186 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
3187 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
3189 case "$gccosandvers" in
3190 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
3191 $osname$osvers) ;; # looking good
3192 $osname*) cat <<EOM >&4
3194 *** WHOA THERE!!! ***
3196 Your gcc has not been compiled for the exact release of
3197 your operating system ($gccosandvers versus $osname$osvers).
3199 In general it is a good idea to keep gcc synchronized with
3200 the operating system because otherwise serious problems
3201 may ensue when trying to compile software, like Perl.
3203 I'm trying to be optimistic here, though, and will continue.
3204 If later during the configuration and build icky compilation
3205 problems appear (headerfile conflicts being the most common
3206 manifestation), I suggest reinstalling the gcc to match
3207 your operating system release.
3211 *) gccosandvers='' ;; # failed to parse, better be silent
3219 : see how we invoke the C preprocessor
3221 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3222 cat <<'EOT' >testcpp.c
3228 if test ! -f cppstdin; then
3229 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
3230 # AIX cc -E doesn't show the absolute headerfile
3231 # locations but we'll cheat by using the -M flag.
3232 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
3234 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3237 echo "Keeping your $hint cppstdin wrapper."
3240 wrapper=`pwd`/cppstdin
3244 if $test "X$cppstdin" != "X" && \
3245 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3246 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3248 echo "You used to use $cppstdin $cppminus so we'll use that again."
3250 '') echo "But let's see if we can live without a wrapper..." ;;
3252 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3253 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3255 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3258 echo "(However, $cpprun $cpplast does not work, let's see...)"
3266 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3273 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3274 $cc -E <testcpp.c >testcpp.out 2>&1; \
3275 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3276 echo "Yup, it does."
3279 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
3280 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3281 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3282 echo "Yup, it does."
3285 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
3286 $cc -P <testcpp.c >testcpp.out 2>&1; \
3287 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3288 echo "Yipee, that works!"
3291 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
3292 $cc -P - <testcpp.c >testcpp.out 2>&1; \
3293 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3294 echo "At long last!"
3297 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
3298 $cpp <testcpp.c >testcpp.out 2>&1; \
3299 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3303 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
3304 $cpp - <testcpp.c >testcpp.out 2>&1; \
3305 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3306 echo "Hooray, it works! I was beginning to wonder."
3309 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
3310 $wrapper <testcpp.c >testcpp.out 2>&1; \
3311 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3317 rp="No dice. I can't find a C preprocessor. Name one:"
3321 $x_cpp <testcpp.c >testcpp.out 2>&1
3322 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3323 echo "OK, that will do." >&4
3325 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
3340 echo "Perhaps can we force $cc -E using a wrapper..."
3341 if $wrapper <testcpp.c >testcpp.out 2>&1; \
3342 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3348 echo "Nope, we'll have to live without it..."
3362 "$wrapper"|'cppstdin') ;;
3363 *) $rm -f $wrapper;;
3365 $rm -f testcpp.c testcpp.out
3367 : decide how portable to be. Allow command line overrides.
3368 case "$d_portable" in
3370 *) d_portable="$define" ;;
3373 : set up shell script to do ~ expansion
3379 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3382 if $test -f /bin/csh; then
3383 /bin/csh -f -c "glob \$1"
3388 name=\`$expr x\$1 : '..\([^/]*\)'\`
3389 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3390 if $test ! -d "\$dir"; then
3392 echo "\$me: can't locate home directory for: \$name" >&2
3397 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3413 : now set up to get a file name
3417 cat <<'EOSC' >>getfile
3433 expr $fn : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3434 fn=`echo $fn | sed 's/(.*)//'`
3440 loc_file=`expr $fn : '.*:\(.*\)'`
3441 fn=`expr $fn : '\(.*\):.*'`
3449 */*) fullpath=true;;
3458 *e*) exp_file=true;;
3461 *p*) nopath_ok=true;;
3466 *d*) type='Directory';;
3467 *l*) type='Locate';;
3472 Locate) what='File';;
3477 case "$d_portable" in
3485 while test "$type"; do
3490 true) rp="$rp (~name ok)";;
3493 if test -f UU/getfile.ok && \
3494 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3513 value=`UU/filexp $ans`
3516 if test "$ans" != "$value"; then
3517 echo "(That expands to $value on this system.)"
3531 /*) value="$ansexp" ;;
3532 [a-zA-Z]:/*) value="$ansexp" ;;
3537 echo "I shall only accept a full path name, as in /bin/ls." >&4
3538 echo "Use a ! shell escape if you wish to check pathnames." >&4
3541 echo "Please give a full path name, starting with slash." >&4
3544 echo "Note that using ~name is ok provided it expands well." >&4
3557 for fp in $gfpth; do
3558 if test "X$fp" = X.; then
3563 if test -f "$pf"; then
3565 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3567 echo "($value is not a plain file, but that's ok.)"
3570 if test X"$type" = X; then
3577 for fp in $gfpth; do
3578 if test "X$fp" = X.; then
3583 direxp="$fp/$ansexp"
3585 if test -d "$direxp"; then
3593 if test -d "$ansexp"; then
3594 echo "(Looking for $loc_file in directory $value.)"
3595 value="$value/$loc_file"
3596 ansexp="$ansexp/$loc_file"
3598 if test -f "$ansexp"; then
3601 case "$nopath_ok" in
3602 true) case "$value" in
3604 *) echo "Assuming $value will be in people's path."
3620 if test "$fastread" = yes; then
3625 rp="$what $value doesn't exist. Use that name anyway?"
3644 test "X$gfpthkeep" != Xy && gfpth=""
3647 : What should the include directory be ?
3649 $echo $n "Hmm... $c"
3653 if $test -f /bin/mips && /bin/mips; then
3654 echo "Looks like a MIPS system..."
3655 $cat >usr.c <<'EOCP'
3656 #ifdef SYSTYPE_BSD43
3660 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3661 dflt='/bsd43/usr/include'
3665 mips_type='System V'
3667 $rm -f usr.c usr.out
3668 echo "and you're compiling with the $mips_type compiler and libraries."
3672 echo "Doesn't look like a MIPS system."
3682 case "$xxx_prompt" in
3685 rp='Where are the include files you want to use?'
3693 : Set private lib path
3696 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
3701 '') dlist="$loclibpth $plibpth $glibpth";;
3702 *) dlist="$libpth";;
3705 : Now check and see which directories actually exist, avoiding duplicates
3709 if $test -d $xxx; then
3712 *) libpth="$libpth $xxx";;
3718 Some systems have incompatible or broken versions of libraries. Among
3719 the directories listed in the question below, please remove any you
3720 know not to be holding relevant libraries, and add any that are needed.
3721 Say "none" for none.
3732 rp="Directories to use for library searches?"
3739 : compute shared library extension
3742 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
3752 On some systems, shared libraries may be available. Answer 'none' if
3753 you want to suppress searching of shared libraries for the remainder
3754 of this configuration.
3757 rp='What is the file extension used for shared libraries?'
3761 : Define several unixisms.
3762 : Hints files or command line option can be used to override them.
3763 : The convoluted testing is in case hints files set either the old
3766 '') case "$exe_ext" in
3768 *) _exe="$exe_ext" ;;
3773 '') case "$lib_ext" in
3780 '') case "$obj_ext" in
3787 '') case "$path_sep" in
3798 : Which makefile gets called first. This is used by make depend.
3799 case "$firstmakefile" in
3800 '') firstmakefile='makefile';;
3804 $define|true|[yY]*) dflt='y';;
3809 Perl can be built to use the SOCKS proxy protocol library. To do so,
3810 Configure must be run with -Dusesocks. If you use SOCKS you also need
3811 to use the PerlIO abstraction layer, this will be implicitly selected.
3813 If this doesn't make any sense to you, just accept the default '$dflt'.
3815 rp='Build Perl for SOCKS?'
3818 y|Y) val="$define" ;;
3825 $define|true|[yY]*) useperlio="$define";;
3828 : Looking for optional libraries
3830 echo "Checking for optional libraries..." >&4
3835 case "$libswanted" in
3836 '') libswanted='c_s';;
3839 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
3845 for thisdir in $libpth $xlibpth; do
3846 test -d $thisdir && libspath="$libspath $thisdir"
3848 for thislib in $libswanted; do
3849 for thisdir in $libspath; do
3851 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
3852 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|tail -1`
3853 $test -f "$xxx" && eval $libscheck
3854 $test -f "$xxx" && libstyle=shared
3856 if test ! -f "$xxx"; then
3857 xxx=$thisdir/lib$thislib.$so
3858 $test -f "$xxx" && eval $libscheck
3859 $test -f "$xxx" && libstyle=shared
3861 if test ! -f "$xxx"; then
3862 xxx=$thisdir/lib$thislib$_a
3863 $test -f "$xxx" && eval $libscheck
3864 $test -f "$xxx" && libstyle=static
3866 if test ! -f "$xxx"; then
3867 xxx=$thisdir/$thislib$_a
3868 $test -f "$xxx" && eval $libscheck
3869 $test -f "$xxx" && libstyle=static
3871 if test ! -f "$xxx"; then
3872 xxx=$thisdir/lib${thislib}_s$_a
3873 $test -f "$xxx" && eval $libscheck
3874 $test -f "$xxx" && libstyle=static
3875 $test -f "$xxx" && thislib=${thislib}_s
3877 if test ! -f "$xxx"; then
3878 xxx=$thisdir/Slib$thislib$_a
3879 $test -f "$xxx" && eval $libscheck
3880 $test -f "$xxx" && libstyle=static
3882 if $test -f "$xxx"; then
3884 shared) echo "Found -l$thislib (shared)." ;;
3885 static) echo "Found -l$thislib." ;;
3886 *) echo "Found -l$thislib ($libstyle)." ;;
3890 *) dflt="$dflt -l$thislib"
3891 libsfound="$libsfound $xxx"
3893 libsfiles="$libsfiles $yyy"
3894 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
3895 case " $libsdirs " in
3897 *) libsdirs="$libsdirs $yyy" ;;
3904 if $test ! -f "$xxx"; then
3905 echo "No -l$thislib."
3916 ' '|'') dflt='none';;
3921 In order to compile $package on your machine, a number of libraries
3922 are usually needed. Include any other special libraries here as well.
3923 Say "none" for none. The default list is almost always right.
3927 rp="What libraries to use?"
3934 : determine optimization, if desired, or use for debug flag also
3936 ' '|$undef) dflt='none';;
3938 *) dflt="$optimize";;
3942 By default, $package compiles with the -O flag to use the optimizer.
3943 Alternately, you might want to use the symbolic debugger, which uses
3944 the -g flag (on traditional Unix systems). Either flag can be
3945 specified here. To use neither flag, specify the word "none".
3948 rp="What optimizer/debugger flag should be used?"
3952 'none') optimize=" ";;
3956 : We will not override a previous value, but we might want to
3957 : augment a hint file
3959 default|recommended)
3960 case "$gccversion" in
3961 1*) dflt='-fpcc-struct-return' ;;
3964 *-g*) dflt="$dflt -DDEBUGGING";;
3966 case "$gccversion" in
3967 2*) if test -d /etc/conf/kconfig.d &&
3968 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
3974 case "$gccversion" in
3978 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
3979 echo 'int main(void) { return 0; }' > gcctest.c
3980 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
3981 echo "Yes, it does." 2>&1
3984 echo "Leaving current flags $ccflags alone." 2>&1
3986 *) dflt="$dflt -fno-strict-aliasing" ;;
3989 echo "Nope, it doesn't, but that's ok." 2>&1
3996 case "$mips_type" in
3997 *BSD*|'') inclwanted="$locincpth $usrinc";;
3998 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4000 for thisincl in $inclwanted; do
4001 if $test -d $thisincl; then
4002 if $test x$thisincl != x$usrinc; then
4004 *" -I$thisincl "*);;
4005 *) dflt="$dflt -I$thisincl ";;
4011 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4013 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4021 *) dflt="$dflt -D$2";;
4025 set signal.h LANGUAGE_C; eval $inctest
4029 ccflags="$ccflags -DSOCKS"
4034 default|recommended) dflt="$ccflags $dflt" ;;
4035 *) dflt="$ccflags";;
4044 Your C compiler may want other flags. For this question you should include
4045 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4046 but you should NOT include libraries or ld flags like -lwhatever. If you
4047 want $package to honor its debug switch, you should include -DDEBUGGING here.
4048 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4050 To use no flags, specify the word "none".
4056 rp="Any additional cc flags?"
4063 : the following weeds options from ccflags that are of no interest to cpp
4065 case "$gccversion" in
4066 1*) cppflags="$cppflags -D__GNUC__"
4068 case "$mips_type" in
4070 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4076 echo "Let me guess what the preprocessor flags are..." >&4
4090 *) ftry="$previous $flag";;
4092 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4093 >cpp1.out 2>/dev/null && \
4094 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4095 >cpp2.out 2>/dev/null && \
4096 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4097 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4099 cppflags="$cppflags $ftry"
4109 *-*) echo "They appear to be: $cppflags";;
4111 $rm -f cpp.c cpp?.out
4115 : flags used in final linking phase
4117 '') if ./venix; then
4123 *-posix*) dflt="$dflt -posix" ;;
4126 *) dflt="$ldflags";;
4129 : Try to guess additional flags to pick up local libraries.
4130 for thislibdir in $libpth; do
4131 case " $loclibpth " in
4134 *"-L$thislibdir "*) ;;
4135 *) dflt="$dflt -L$thislibdir" ;;
4147 Your C linker may need flags. For this question you should
4148 include -L/whatever and any other flags used by the C linker, but you
4149 should NOT include libraries like -lwhatever.
4151 Make sure you include the appropriate -L/path flags if your C linker
4152 does not normally search all of the directories you specified above,
4155 To use no flags, specify the word "none".
4159 rp="Any additional ld flags (NOT including libraries)?"
4165 rmlist="$rmlist pdp11"
4169 echo "Checking your choice of C compiler and flags for coherency..." >&4
4170 $cat > try.c <<'EOF'
4172 int main() { printf("Ok\n"); exit(0); }
4174 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
4176 $cat >try.msg <<'EOM'
4177 I've tried to compile and run the following simple program:
4180 $cat try.c >> try.msg
4182 $cat >> try.msg <<EOM
4189 and I got the following output:
4193 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
4194 if $sh -c './try' >>try.msg 2>&1; then
4198 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4201 cat >> try.msg <<'EOQS'
4202 If $libs contains -lsfio, and sfio is mis-configured, then it
4203 sometimes (apparently) runs and exits with a 0 status, but with no
4204 output! It may have to do with sfio's use of _exit vs. exit.
4207 rp="You have a big problem. Shall I abort Configure"
4214 echo "The program compiled OK, but exited with status $?." >>try.msg
4215 rp="You have a problem. Shall I abort Configure"
4219 echo "I can't compile the test program." >>try.msg
4220 rp="You have a BIG problem. Shall I abort Configure"
4226 case "$knowitall" in
4228 echo "(The supplied flags or libraries might be incorrect.)"
4236 *) echo "Ok. Stopping Configure." >&4
4241 n) echo "OK, that should do.";;
4243 $rm -f try try.* core
4245 : define an is-a-typedef? function
4246 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
4248 "") inclist="sys/types.h";;
4250 eval "varval=\$$var";
4254 for inc in $inclist; do
4255 echo "#include <$inc>" >>temp.c;
4257 echo "#ifdef $type" >> temp.c;
4258 echo "printf(\"We have $type\");" >> temp.c;
4259 echo "#endif" >> temp.c;
4260 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
4261 if $contains $type temp.E >/dev/null 2>&1; then
4267 *) eval "$var=\$varval";;
4270 : define an is-a-typedef? function that prompts if the type is not available.
4271 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
4273 "") inclist="sys/types.h";;
4275 eval "varval=\$$var";
4279 for inc in $inclist; do
4280 echo "#include <$inc>" >>temp.c;
4282 echo "#ifdef $type" >> temp.c;
4283 echo "printf(\"We have $type\");" >> temp.c;
4284 echo "#endif" >> temp.c;
4285 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
4287 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
4288 if $contains $type temp.E >/dev/null 2>&1; then
4289 echo "$type found." >&4;
4292 echo "$type NOT found." >&4;
4298 *) eval "$var=\$varval";;
4301 : define a shorthand compile call
4305 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
4306 : define a shorthand compile call for compilations that should be ok.
4310 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
4312 : check for lengths of integral types
4316 echo "Checking to see how big your integers are..." >&4
4317 $cat >intsize.c <<'EOCP'
4321 printf("intsize=%d;\n", (int)sizeof(int));
4322 printf("longsize=%d;\n", (int)sizeof(long));
4323 printf("shortsize=%d;\n", (int)sizeof(short));
4328 if eval $compile_ok && ./intsize > /dev/null; then
4330 echo "Your integers are $intsize bytes long."
4331 echo "Your long integers are $longsize bytes long."
4332 echo "Your short integers are $shortsize bytes long."
4336 Help! I can't compile and run the intsize test program: please enlighten me!
4337 (This is probably a misconfiguration in your system or libraries, and
4338 you really ought to fix it. Still, I'll try anyway.)
4342 rp="What is the size of an integer (in bytes)?"
4346 rp="What is the size of a long integer (in bytes)?"
4350 rp="What is the size of a short integer (in bytes)?"
4356 $rm -f intsize intsize.*
4358 : see what type lseek is declared as in the kernel
4359 rp="What is the type used for lseek's offset on this system?"
4360 set off_t lseektype long stdio.h sys/types.h
4364 echo "Checking to see how big your file offsets are..." >&4
4366 #include <sys/types.h>
4370 printf("%d\n", (int)sizeof($lseektype));
4375 if eval $compile_ok; then
4377 echo "Your file offsets are $lseeksize bytes long."
4381 echo "(I can't seem to compile the test program. Guessing...)"
4382 rp="What is the size of your file offsets (in bytes)?"
4388 : see what type file positions are declared as in the library
4389 rp="What is the type for file position used by fsetpos()?"
4390 set fpos_t fpostype long stdio.h sys/types.h
4395 *_t) zzz="$fpostype" ;;
4398 echo "Checking the size of $zzz..." >&4
4400 #include <sys/types.h>
4403 printf("%d\n", (int)sizeof($fpostype));
4408 if eval $compile_ok; then
4412 echo "(I can't execute the test program--guessing $fpossize.)" >&4
4415 echo "Your $zzz is $fpossize bytes long."
4421 echo "(I can't compile the test program. Guessing...)" >&4
4422 rp="What is the size of your file positions (in bytes)?"
4429 # Backward compatibility (uselfs is deprecated).
4431 "$define"|true|[yY]*)
4434 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
4436 uselargefiles="$define"
4440 case "$lseeksize:$fpossize" in
4443 You can have files larger than 2 gigabytes.
4446 *) case "$uselargefiles" in
4447 "$undef"|false|[nN]*) dflt='n' ;;
4452 Perl can be built to understand large files (files larger than 2 gigabytes)
4453 on some systems. To do so, Configure can be run with -Duselargefiles.
4455 If this doesn't make any sense to you, just accept the default '$dflt'.
4457 rp='Try to understand large files, if available?'
4460 y|Y) val="$define" ;;
4467 case "$uselargefiles" in
4469 : Look for a hint-file generated 'call-back-unit'. If the
4470 : user has specified that a large files perl is to be built,
4471 : we may need to set or change some other defaults.
4472 if $test -f uselargefiles.cbu; then
4473 echo "Your platform has some specific hints for large file builds, using them..."
4474 . ./uselargefiles.cbu
4476 echo "Rechecking to see how big your file offsets are..." >&4
4478 #include <sys/types.h>
4482 printf("%d\n", (int)sizeof($lseektype));
4487 if eval $compile_ok; then
4489 $echo "Your file offsets are now $lseeksize bytes long."
4493 echo "(I can't seem to compile the test program. Guessing...)"
4494 rp="What is the size of your file offsets (in bytes)?"
4499 *_t) zzz="$fpostype" ;;
4502 $echo $n "Rechecking the size of $zzz...$c" >&4
4504 #include <sys/types.h>
4507 printf("%d\n", (int)sizeof($fpostype));
4512 if eval $compile_ok; then
4517 echo "(I can't execute the test program--guessing $fpossize.)" >&4
4520 echo " $fpossize bytes." >&4
4526 echo "(I can't compile the test program. Guessing...)" >&4
4527 rp="What is the size of your file positions (in bytes)?"
4537 case "$usemorebits" in
4538 "$define"|true|[yY]*)
4539 use64bitint="$define"
4540 uselongdouble="$define"
4541 usemorebits="$define"
4543 *) usemorebits="$undef"
4547 : check for void type
4549 echo "Checking to see how well your C compiler groks the void type..." >&4
4550 case "$voidflags" in
4552 $cat >try.c <<'EOCP'
4558 extern void moo(); /* function returning void */
4559 void (*goo)(); /* ptr to func returning void */
4561 void *hue; /* generic ptr */
4574 int main() { sub(); }
4576 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
4577 voidflags=$defvoidused
4578 echo "Good. It appears to support void to the level $package wants.">&4
4579 if $contains warning .out >/dev/null 2>&1; then
4580 echo "However, you might get some warnings that look like this:"
4584 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
4585 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
4586 echo "It supports 1..."
4587 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
4588 echo "It also supports 2..."
4589 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
4591 echo "And it supports 4 but not 8 definitely."
4593 echo "It doesn't support 4..."
4594 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
4596 echo "But it supports 8."
4599 echo "Neither does it support 8."
4603 echo "It does not support 2..."
4604 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
4606 echo "But it supports 4 and 8."
4608 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
4610 echo "And it supports 4 but has not heard about 8."
4612 echo "However it supports 8 but not 4."
4617 echo "There is no support at all for void."
4622 case "$voidflags" in
4625 Support flag bits are:
4626 1: basic void declarations.
4627 2: arrays of pointers to functions returning void.
4628 4: operations between pointers to and addresses of void functions.
4629 8: generic void pointers.
4632 rp="Your void support flags add up to what?"
4639 : check for length of pointer
4643 echo "Checking to see how big your pointers are..." >&4
4644 if test "$voidflags" -gt 7; then
4645 echo '#define VOID_PTR char *' > try.c
4647 echo '#define VOID_PTR void *' > try.c
4649 $cat >>try.c <<'EOCP'
4653 printf("%d\n", (int)sizeof(VOID_PTR));
4658 if eval $compile_ok; then
4660 echo "Your pointers are $ptrsize bytes long."
4663 echo "(I can't seem to compile the test program. Guessing...)" >&4
4664 rp="What is the size of a pointer (in bytes)?"
4672 : check for long long
4674 echo "Checking to see if you have long long..." >&4
4675 echo 'int main() { long long x = 7; return 0; }' > try.c
4677 if eval $compile; then
4679 echo "You have long long."
4682 echo "You do not have long long."
4688 : check for length of long long
4689 case "${d_longlong}${longlongsize}" in
4692 echo "Checking to see how big your long longs are..." >&4
4693 $cat >try.c <<'EOCP'
4697 printf("%d\n", (int)sizeof(long long));
4702 if eval $compile_ok; then
4703 longlongsize=`./try$exe_ext`
4704 echo "Your long longs are $longlongsize bytes long."
4708 echo "(I can't seem to compile the test program. Guessing...)"
4709 rp="What is the size of a long long (in bytes)?"
4713 if $test "X$longsize" = "X$longlongsize"; then
4714 echo "(That isn't any different from an ordinary long.)"
4720 : determine filename position in cpp output
4722 echo "Computing filename position in cpp output for #include directives..." >&4
4723 echo '#include <stdio.h>' > foo.c
4726 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
4727 $grep '^[ ]*#.*stdio\.h' | \
4728 while read cline; do
4731 while $test \$# -gt 0; do
4732 if $test -r \`echo \$1 | $tr -d '"'\`; then
4737 pos=\`expr \$pos + 1\`
4749 *) pos="${fieldn}th";;
4751 echo "Your cpp writes the filename in the $pos field of the line."
4753 : locate header file
4758 for usrincdir in $usrinc
4760 if test -f \$usrincdir/\$wanted; then
4761 echo "\$usrincdir/\$wanted"
4765 awkprg='{ print \$$fieldn }'
4766 echo "#include <\$wanted>" > foo\$\$.c
4767 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
4768 $grep "^[ ]*#.*\$wanted" | \
4769 while read cline; do
4770 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
4772 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
4773 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
4778 # status = 0: grep returned 0 lines, case statement not executed
4779 # status = 1: headerfile found
4780 # status = 2: while loop executed, no headerfile found
4784 if test \$status -eq 1; then
4791 : define an alternate in-header-list? function
4792 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
4793 cont=true; xxf="echo \"<\$1> found.\" >&4";
4794 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
4795 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
4797 case $# in 4) instead=instead;; *) instead="at last";; esac;
4798 while $test "$cont"; do
4800 var=$2; eval "was=\$$2";
4801 if $test "$xxx" && $test -r "$xxx";
4803 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
4806 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
4807 set $yyy; shift; shift; yyy=$@;
4808 case $# in 0) cont="";;
4809 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
4810 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
4811 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
4812 xxnf="echo \"there is no <\$1>, ...\" >&4";;
4816 do set $yyy; var=$2; eval "was=\$$2";
4817 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
4818 set $yyy; shift; shift; yyy=$@;
4821 : see if inttypes.h is available
4822 : we want a real compile instead of Inhdr because some systems
4823 : have an inttypes.h which includes non-existent headers
4826 #include <inttypes.h>
4828 static int32_t foo32 = 0x12345678;
4832 if eval $compile; then
4833 echo "<inttypes.h> found." >&4
4836 echo "<inttypes.h> NOT found." >&4
4845 echo "Checking to see if you have int64_t..." >&4
4847 #include <sys/types.h>
4848 #$i_inttypes I_INTTYPES
4850 #include <inttypes.h>
4852 int main() { int64_t x = 7; }
4855 if eval $compile; then
4857 echo "You have int64_t."
4860 echo "You do not have int64_t."
4868 echo "Checking which 64-bit integer type we could use..." >&4
4874 val='"unsigned int"'
4879 *) case "$longsize" in
4883 val='"unsigned long"'
4888 *) case "$d_longlong:$longlongsize" in
4893 val='"unsigned long long"'
4898 *) case "$d_int64_t" in
4917 '') echo "Alas, no 64-bit integer types in sight." >&4
4920 *) echo "We could use '$quadtype' for 64-bit integers." >&4
4926 case "$uselonglong" in
4927 "$define"|true|[yY]*)
4930 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
4932 use64bitint="$define"
4935 case "$use64bits" in
4936 "$define"|true|[yY]*)
4939 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
4941 use64bitint="$define"
4944 case "$use64bitints" in
4945 "$define"|true|[yY]*)
4948 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
4950 use64bitint="$define"
4953 case "$use64bitsint" in
4954 "$define"|true|[yY]*)
4957 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
4959 use64bitint="$define"
4962 case "$uselonglongs" in
4963 "$define"|true|[yY]*)
4966 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
4968 use64bitint="$define"
4971 case "$use64bitsall" in
4972 "$define"|true|[yY]*)
4975 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
4977 use64bitall="$define"
4982 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
4984 case "$use64bitall" in
4985 "$define"|true|[yY]*) use64bitint="$define" ;;
4991 You have natively 64-bit long integers.
4995 *) case "$use64bitint" in
4996 "$define"|true|[yY]*) dflt='y';;
5005 Perl can be built to take advantage of 64-bit integer types
5006 on some systems. To do so, Configure can be run with -Duse64bitint.
5007 Choosing this option will most probably introduce binary incompatibilities.
5009 If this doesn't make any sense to you, just accept the default '$dflt'.
5010 (The default has been chosen based on your configuration.)
5012 rp='Try to use 64-bit integers, if available?'
5015 [yY]*) val="$define" ;;
5023 case "$use64bitall" in
5024 "$define"|true|[yY]*) dflt='y' ;;
5025 *) case "$longsize" in
5033 You may also choose to try maximal 64-bitness. It means using as much
5034 64-bitness as possible on the platform. This in turn means even more
5035 binary incompatibilities. On the other hand, your platform may not
5036 have any more 64-bitness available than what you already have chosen.
5038 If this doesn't make any sense to you, just accept the default '$dflt'.
5039 (The default has been chosen based on your configuration.)
5041 rp='Try to use maximal 64-bit support, if available?'
5044 [yY]*) val="$define" ;;
5049 case "$use64bitall" in
5051 case "$use64bitint" in
5055 Since you have chosen a maximally 64-bit build, I'm also turning on
5056 the use of 64-bit integers.
5058 use64bitint="$define" ;;
5063 case "$use64bitall" in
5064 "$define"|true|[yY]*)
5068 *** You have chosen a maximally 64-bit build, but your pointers
5069 *** are only 4 bytes wide, disabling maximal 64-bitness.
5072 use64bitall="$undef"
5073 case "$use64bitint" in
5074 "$define"|true|[yY]*) ;;
5077 *** Downgrading from maximal 64-bitness to using 64-bit integers.
5080 use64bitint="$define"
5088 case "$use64bitint" in
5089 "$define"|true|[yY]*)
5090 : Look for a hint-file generated 'call-back-unit'. If the
5091 : user has specified that a 64-bit perl is to be built,
5092 : we may need to set or change some other defaults.
5093 if $test -f use64bitint.cbu; then
5094 echo "Your platform has some specific hints for 64-bit integers, using them..."
5098 4) case "$archname64" in
5099 '') archname64=64int ;;
5106 case "$use64bitall" in
5107 "$define"|true|[yY]*)
5108 : Look for a hint-file generated 'call-back-unit'. If the
5109 : user has specified that a maximally 64-bit perl is to be built,
5110 : we may need to set or change some other defaults.
5111 if $test -f use64bitall.cbu; then
5112 echo "Your platform has some specific hints for 64-bit builds, using them..."
5116 4) case "$archname64" in
5117 ''|64int) archname64=64all ;;
5125 echo "Checking for GNU C Library..." >&4
5126 cat >gnulibc.c <<EOM
5138 if eval $compile_ok && ./gnulibc; then
5140 echo "You are using the GNU C Library"
5143 echo "You are not using the GNU C Library"
5149 : see if nm is to be used to determine whether a symbol is defined or not
5153 case "$d_gnulibc" in
5156 echo "nm probably won't work on the GNU C Library." >&4
5162 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
5164 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
5165 echo "'nm' won't be sufficient on this sytem." >&4
5171 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
5172 if $test $dflt -gt 20; then
5182 true|$define) dflt=y;;
5189 I can use $nm to extract the symbols from your C libraries. This
5190 is a time consuming task which may generate huge output on the disk (up
5191 to 3 megabytes) but that should make the symbols extraction faster. The
5192 alternative is to skip the 'nm' extraction part and to compile a small
5193 test program instead to determine whether each symbol is present. If
5194 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
5195 this may be the best solution.
5197 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
5200 rp="Shall I use $nm to extract C symbols from the libraries?"
5203 [Nn]*) usenm=false;;
5212 : nm options which may be necessary
5214 '') if $test -f /mach_boot; then
5216 elif $test -d /usr/ccs/lib; then
5217 nm_opt='-p' # Solaris (and SunOS?)
5218 elif $test -f /dgux; then
5220 elif $test -f /lib64/rld; then
5221 nm_opt='-p' # 64-bit Irix
5227 : nm options which may be necessary for shared libraries but illegal
5228 : for archive libraries. Thank you, Linux.
5229 case "$nm_so_opt" in
5230 '') case "$myuname" in
5232 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
5233 nm_so_opt='--dynamic'
5242 : get list of predefined functions in a handy place
5247 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
5254 *) for thislib in $libs; do
5257 : Handle C library specially below.
5260 thislib=`echo $thislib | $sed -e 's/^-l//'`
5261 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
5263 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
5265 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
5267 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
5269 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
5271 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
5273 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
5278 libnames="$libnames $try"
5280 *) libnames="$libnames $thislib" ;;
5289 for xxx in $libpth; do
5290 $test -r $1 || set $xxx/libc.$so
5291 : The messy sed command sorts on library version numbers.
5293 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
5294 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
5296 s/[0-9][0-9]*/0000&/g
5297 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
5300 $sort | $sed -e 's/^.* //'`
5303 $test -r $1 || set /usr/ccs/lib/libc.$so
5304 $test -r $1 || set /lib/libsys_s$_a
5310 if $test -r "$1"; then
5311 echo "Your (shared) C library seems to be in $1."
5313 elif $test -r /lib/libc && $test -r /lib/clib; then
5314 echo "Your C library seems to be in both /lib/clib and /lib/libc."
5316 libc='/lib/clib /lib/libc'
5317 if $test -r /lib/syslib; then
5318 echo "(Your math library is in /lib/syslib.)"
5319 libc="$libc /lib/syslib"
5321 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5322 echo "Your C library seems to be in $libc, as you said before."
5323 elif $test -r $incpath/usr/lib/libc$_a; then
5324 libc=$incpath/usr/lib/libc$_a;
5325 echo "Your C library seems to be in $libc. That's fine."
5326 elif $test -r /lib/libc$_a; then
5328 echo "Your C library seems to be in $libc. You're normal."
5330 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
5332 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
5333 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
5334 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
5336 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5338 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5341 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
5343 if $test -r "$tans"; then
5344 echo "Your C library seems to be in $tans, of all places."
5350 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5354 If the guess above is wrong (which it might be if you're using a strange
5355 compiler, or your machine supports multiple models), you can override it here.
5360 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
5362 I can't seem to find your C library. I've looked in the following places:
5365 $sed 's/^/ /' libpath
5368 None of these seems to contain your C library. I need to get its name...
5373 rp='Where is your C library?'
5378 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
5379 set X `cat libnames`
5382 case $# in 1) xxx=file; esac
5383 echo "Extracting names from the following $xxx for later perusal:" >&4
5385 $sed 's/^/ /' libnames >&4
5387 $echo $n "This may take a while...$c" >&4
5391 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
5392 *) $nm $nm_opt $file 2>/dev/null;;
5397 $grep fprintf libc.tmp > libc.ptf
5398 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
5399 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
5401 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
5403 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5405 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
5407 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5409 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
5411 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5413 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
5415 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5417 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
5419 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5421 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
5423 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5425 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
5426 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
5428 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5430 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
5432 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5434 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
5436 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5438 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
5440 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5442 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
5444 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5446 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
5448 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5450 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
5452 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5454 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
5456 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5459 $nm -p $* 2>/dev/null >libc.tmp
5460 $grep fprintf libc.tmp > libc.ptf
5461 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
5462 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
5468 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
5470 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
5471 for thisname in $libnames $libc; do
5472 $ar t $thisname >>libc.tmp
5474 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
5476 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
5477 # Repeat libc to extract forwarders to DLL entries too
5478 for thisname in $libnames $libc; do
5479 $ar tv $thisname >>libc.tmp
5480 # Revision 50 of EMX has bug in $ar.
5481 # it will not extract forwarders to DLL entries
5482 # Use emximp which will extract exactly them.
5483 emximp -o tmp.imp $thisname \
5485 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
5486 < tmp.imp >>libc.tmp
5489 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
5492 echo "$ar didn't seem to work right." >&4
5493 echo "Maybe this is a Cray...trying bld instead..." >&4
5494 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
5496 for thisname in $libnames; do
5498 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
5499 $ar t $thisname >>libc.tmp
5503 echo "That didn't work either. Giving up." >&4
5510 if $test -f /lib/syscalls.exp; then
5512 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
5513 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*$/\1/p' /lib/syscalls.exp >>libc.list
5517 $rm -f libnames libpath
5519 : is a C symbol defined?
5522 -v) tf=libc.tmp; tc=""; tdc="";;
5523 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
5524 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
5527 case "$reuseval-$4" in
5529 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
5535 if $contains $tlook $tf >/dev/null 2>&1;
5540 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
5541 if $cc -o t $optimize $ccflags $ldflags t.c $libs >/dev/null 2>&1;
5549 $define) tval=true;;
5555 : define an is-in-libc? function
5556 inlibc='echo " "; td=$define; tu=$undef;
5557 sym=$1; var=$2; eval "was=\$$2";
5559 case "$reuseval$was" in
5569 echo "$sym() found." >&4;
5570 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
5572 echo "$sym() NOT found." >&4;
5573 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
5577 $define) echo "$sym() found." >&4;;
5578 *) echo "$sym() NOT found." >&4;;
5582 : see if sqrtl exists
5587 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
5590 case "$uselongdouble" in
5591 $define|true|[yY]*) dflt='y';;
5596 Perl can be built to take advantage of long doubles which
5597 (if available) may give more accuracy and range for floating point numbers.
5599 If this doesn't make any sense to you, just accept the default '$dflt'.
5601 rp='Try to use long doubles if available?'
5604 y|Y) val="$define" ;;
5610 case "$uselongdouble" in
5611 true|[yY]*) uselongdouble="$define" ;;
5614 case "$uselongdouble" in
5616 : Look for a hint-file generated 'call-back-unit'. If the
5617 : user has specified that long doubles should be used,
5618 : we may need to set or change some other defaults.
5619 if $test -f uselongdouble.cbu; then
5620 echo "Your platform has some specific hints for long doubles, using them..."
5621 . ./uselongdouble.cbu
5624 (Your platform doesn't have any specific hints for long doubles.)
5630 case "$uselongdouble:$d_sqrtl" in
5634 *** You requested the use of long doubles but you do not seem to have
5635 *** the mathematic functions for long doubles. I'm disabling the use
5636 *** of long doubles.
5639 uselongdouble=$undef
5643 : check for length of double
5645 case "$doublesize" in
5647 echo "Checking to see how big your double precision numbers are..." >&4
5648 $cat >try.c <<'EOCP'
5652 printf("%d\n", (int)sizeof(double));
5657 if eval $compile_ok; then
5659 echo "Your double is $doublesize bytes long."
5662 echo "(I can't seem to compile the test program. Guessing...)"
5663 rp="What is the size of a double precision number (in bytes)?"
5671 : check for long doubles
5673 echo "Checking to see if you have long double..." >&4
5674 echo 'int main() { long double x = 7.0; }' > try.c
5676 if eval $compile; then
5678 echo "You have long double."
5681 echo "You do not have long double."
5687 : check for length of long double
5688 case "${d_longdbl}${longdblsize}" in
5691 echo "Checking to see how big your long doubles are..." >&4
5692 $cat >try.c <<'EOCP'
5696 printf("%d\n", sizeof(long double));
5701 if eval $compile; then
5702 longdblsize=`./try$exe_ext`
5703 echo "Your long doubles are $longdblsize bytes long."
5707 echo "(I can't seem to compile the test program. Guessing...)" >&4
5708 rp="What is the size of a long double (in bytes)?"
5712 if $test "X$doublesize" = "X$longdblsize"; then
5713 echo "(That isn't any different from an ordinary double.)"
5719 case "$useperlio" in
5720 $define|true|[yY]*|'') dflt='y';;
5725 Previous version of $package used the standard IO mechanisms as
5726 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
5727 alternate IO mechanisms via the PerlIO abstraction layer, but the
5728 stdio mechanism is still available if needed. The abstraction layer
5729 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
5730 Using PerlIO with sfio may cause problems with some extension modules.
5732 If this doesn't make any sense to you, just accept the default '$dflt'.
5734 rp='Use the PerlIO abstraction layer?'
5741 echo "Ok, doing things the stdio way."
5750 case "$useperlio" in
5751 $define|true|[yY]*) ;;
5754 You are using the SOCKS proxy protocol library which means that you
5755 should also use the PerlIO layer. You may be headed for trouble.
5764 : determine the architecture name
5766 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5767 tarch=`arch`"-$osname"
5768 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5769 if uname -m > tmparch 2>&1 ; then
5770 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5771 -e 's/$/'"-$osname/" tmparch`
5779 case "$myarchname" in
5782 echo "(Your architecture name used to be $myarchname.)"
5789 *) dflt="$archname";;
5791 rp='What is your architecture name'
5794 case "$usethreads" in
5796 echo "Threads selected." >&4
5798 *-thread*) echo "...and architecture name already has -thread." >&4
5800 *) archname="$archname-thread"
5801 echo "...setting architecture name to $archname." >&4
5806 case "$usemultiplicity" in
5808 echo "Multiplicity selected." >&4
5810 *-multi*) echo "...and architecture name already has -multi." >&4
5812 *) archname="$archname-multi"
5813 echo "...setting architecture name to $archname." >&4
5818 case "$use64bitint$use64bitall" in
5820 case "$archname64" in
5822 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
5825 case "$use64bitint" in
5826 "$define") echo "64 bit integers selected." >&4 ;;
5828 case "$use64bitall" in
5829 "$define") echo "Maximal 64 bitness selected." >&4 ;;
5832 *-$archname64*) echo "...and architecture name already has $archname64." >&4
5834 *) archname="$archname-$archname64"
5835 echo "...setting architecture name to $archname." >&4
5841 case "$uselongdouble" in
5843 echo "Long doubles selected." >&4
5844 case "$longdblsize" in
5846 "...but long doubles are equal to doubles, not changing architecture name." >&4
5850 *-ld*) echo "...and architecture name already has -ld." >&4
5852 *) archname="$archname-ld"
5853 echo "...setting architecture name to $archname." >&4
5860 case "$useperlio" in
5862 echo "Perlio selected." >&4
5865 echo "Perlio not selected, using stdio." >&4
5867 *-stdio*) echo "...and architecture name already has -stdio." >&4
5869 *) archname="$archname-stdio"
5870 echo "...setting architecture name to $archname." >&4
5876 : determine root of directory hierarchy where package will be installed.
5879 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
5887 By default, $package will be installed in $dflt/bin, manual pages
5888 under $dflt/man, etc..., i.e. with $dflt as prefix for all
5889 installation directories. Typically this is something like /usr/local.
5890 If you wish to have binaries under /usr/bin but other parts of the
5891 installation under /usr/local, that's ok: you will be prompted
5892 separately for each of the installation directories, the prefix being
5893 only used to set the defaults.
5897 rp='Installation prefix to use?'
5905 *) oldprefix="$prefix";;
5915 $define|true) afs=true ;;
5916 $undef|false) afs=false ;;
5917 *) if test -d /afs; then
5925 echo "AFS may be running... I'll be extra cautious then..." >&4
5927 echo "AFS does not seem to be running..." >&4
5930 : determine installation prefix for where package is to be installed.
5934 Since you are running AFS, I need to distinguish the directory in which
5935 files will reside from the directory in which they are installed (and from
5936 which they are presumably copied to the former directory by occult means).
5939 case "$installprefix" in
5940 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
5941 *) dflt="$installprefix";;
5946 In some special cases, particularly when building $package for distribution,
5947 it is convenient to distinguish between the directory in which files should
5948 be installed from the directory ($prefix) in which they
5949 will eventually reside. For most users, these two directories are the same.
5952 case "$installprefix" in
5954 *) dflt=$installprefix;;
5958 rp='What installation prefix should I use for installing files?'
5960 installprefix="$ans"
5961 installprefixexp="$ansexp"
5963 : set the prefixit variable, to compute a suitable default value
5964 prefixit='case "$3" in
5966 case "$oldprefix" in
5967 "") eval "$1=\"\$$2\"";;
5974 ""|" ") eval "$1=\"\$$2\"";;
5980 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
5982 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
5983 /*-$oldprefix/*|\~*-$oldprefix/*)
5984 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
5985 *) eval "$1=\"\$$2\"";;
5990 : get the patchlevel
5992 echo "Getting the current patchlevel..." >&4
5993 if $test -r $rsrc/patchlevel.h;then
5994 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
5995 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
5996 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5997 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
5998 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
5999 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
6008 $echo "(You have $package version $patchlevel subversion $subversion.)"
6011 : XXX Should be a Configure test for double-dots in filenames.
6012 version=`echo $revision $patchlevel $subversion | \
6013 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
6014 api_versionstring=`echo $api_revision $api_version $api_subversion | \
6015 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
6018 version=`echo $revision $patchlevel $subversion | \
6019 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
6020 api_versionstring=`echo $api_revision $api_version $api_subversion | \
6021 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
6024 : Special case the 5.005_xx maintenance series, which used 5.005
6025 : without any subversion label as a subdirectory in $sitelib
6026 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
6027 api_versionstring='5.005'
6030 : determine installation style
6031 : For now, try to deduce it from prefix unless it is already set.
6032 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6033 case "$installstyle" in
6034 '') case "$prefix" in
6035 *perl*) dflt='lib';;
6036 *) dflt='lib/perl5' ;;
6039 *) dflt="$installstyle" ;;
6041 : Probably not worth prompting for this since we prompt for all
6042 : the directories individually, and the prompt would be too long and
6046 : determine where private library files go
6047 : Usual default is /usr/local/lib/perl5/$version.
6048 : Also allow things like /opt/perl/lib/$version, since
6049 : /opt/perl/lib/perl5... would be redundant.
6050 : The default "style" setting is made in installstyle.U
6051 case "$installstyle" in
6052 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6053 *) set dflt privlib lib/$version ;;
6058 There are some auxiliary files for $package that need to be put into a
6059 private library directory that is accessible by everyone.
6063 rp='Pathname where the private library files will reside?'
6066 privlibexp="$ansexp"
6067 : Change installation prefix, if necessary.
6068 if $test X"$prefix" != X"$installprefix"; then
6069 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
6071 installprivlib="$privlibexp"
6074 : set the prefixup variable, to restore leading tilda escape
6075 prefixup='case "$prefixexp" in
6077 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6080 : determine where public architecture dependent libraries go
6083 : privlib default is /usr/local/lib/$package/$version
6084 : archlib default is /usr/local/lib/$package/$version/$archname
6085 : privlib may have an optional trailing /share.
6086 tdflt=`echo $privlib | $sed 's,/share$,,'`
6087 tdflt=$tdflt/$archname
6096 $spackage contains architecture-dependent library files. If you are
6097 sharing libraries in a heterogeneous environment, you might store
6098 these files in a separate location. Otherwise, you can just include
6099 them with the rest of the public library files.
6103 rp='Where do you want to put the public architecture-dependent libraries?'
6106 archlibexp="$ansexp"
6107 if $test X"$archlib" = X"$privlib"; then
6112 : Change installation prefix, if necessary.
6113 if $test X"$prefix" != X"$installprefix"; then
6114 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
6116 installarchlib="$archlibexp"
6120 : Binary compatibility with 5.005 is not possible for builds
6121 : with advanced features
6122 case "$usethreads$usemultiplicity" in
6124 bincompat5005="$undef"
6125 d_bincompat5005="$undef"
6129 This version of Perl can be compiled for binary compatibility with 5.005.
6130 If you decide to do so, you will be able to continue using most of the
6131 extensions that were compiled for Perl 5.005.
6134 case "$bincompat5005$d_bincompat5005" in
6135 *"$undef"*) dflt=n ;;
6138 rp='Binary compatibility with Perl 5.005?'
6141 y*) val="$define" ;;
6146 case "$d_bincompat5005" in
6148 bincompat5005="$define"
6150 *) bincompat5005="$undef"
6151 d_bincompat5005="$undef"
6158 : see if setuid scripts can be secure
6161 Some kernels have a bug that prevents setuid #! scripts from being
6162 secure. Some sites have disabled setuid #! scripts because of this.
6164 First let's decide if your kernel supports secure setuid #! scripts.
6165 (If setuid #! scripts would be secure but have been disabled anyway,
6166 don't say that they are secure if asked.)
6171 if $test -d /dev/fd; then
6172 echo "#!$ls" >reflect
6173 chmod +x,u+s reflect
6174 ./reflect >flect 2>&1
6175 if $contains "/dev/fd" flect >/dev/null; then
6176 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6180 If you are not sure if they are secure, I can check but I'll need a
6181 username and password different from the one you are using right now.
6182 If you don't have such a username or don't want me to test, simply
6186 rp='Other username to test security of setuid scripts with?'
6191 case "$d_suidsafe" in
6192 '') echo "I'll assume setuid scripts are *not* secure." >&4
6195 echo "Well, the $hint value is *not* secure." >&4
6197 *) echo "Well, the $hint value *is* secure." >&4
6202 $rm -f reflect flect
6203 echo "#!$ls" >reflect
6204 chmod +x,u+s reflect
6207 echo '"su" will (probably) prompt you for '"$ans's password."
6208 su $ans -c './reflect >flect'
6209 if $contains "/dev/fd" flect >/dev/null; then
6210 echo "Okay, it looks like setuid scripts are secure." >&4
6213 echo "I don't think setuid scripts are secure." >&4
6218 rp='Does your kernel have *secure* setuid scripts?'
6221 [yY]*) val="$define";;
6226 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6227 echo "(That's for file descriptors, not floppy disks.)"
6233 $rm -f reflect flect
6235 : now see if they want to do setuid emulation
6238 case "$d_suidsafe" in
6241 echo "No need to emulate SUID scripts since they are secure here." >& 4
6245 Some systems have disabled setuid scripts, especially systems where
6246 setuid scripts cannot be secure. On systems where setuid scripts have
6247 been disabled, the setuid/setgid bits on scripts are currently
6248 useless. It is possible for $package to detect those bits and emulate
6249 setuid/setgid in a secure fashion. This emulation will only work if
6250 setuid scripts have been disabled in your kernel.
6254 "$define") dflt=y ;;
6257 rp="Do you want to do setuid/setgid emulation?"
6260 [yY]*) val="$define";;
6268 : see if this is a malloc.h system
6269 set malloc.h i_malloc
6272 : see if stdlib is available
6273 set stdlib.h i_stdlib
6276 : determine which malloc to compile in
6278 case "$usemymalloc" in
6279 ''|[yY]*|true|$define) dflt='y' ;;
6286 rp="Do you wish to attempt to use the malloc that comes with $package?"
6292 mallocsrc='malloc.c'
6293 mallocobj="malloc$_o"
6294 d_mymalloc="$define"
6297 : Remove malloc from list of libraries to use
6298 echo "Removing unneeded -lmalloc from library list" >&4
6299 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6302 echo "libs = $libs" >&4
6314 : compute the return types of malloc and free
6316 $cat >malloc.c <<END
6320 #include <sys/types.h>
6334 case "$malloctype" in
6336 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6343 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6347 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6354 echo "Your system uses $freetype free(), it would seem." >&4
6358 After $package is installed, you may wish to install various
6359 add-on modules and utilities. Typically, these add-ons will
6360 be installed under $prefix with the rest
6361 of this package. However, you may wish to install such add-ons
6362 elsewhere under a different prefix.
6364 If you do not wish to put everything under a single prefix, that's
6365 ok. You will be prompted for the individual locations; this siteprefix
6366 is only used to suggest the defaults.
6368 The default should be fine for most people.
6372 rp='Installation prefix to use for add-on modules and utilities?'
6373 : XXX Here might be another good place for an installstyle setting.
6374 case "$siteprefix" in
6376 *) dflt=$siteprefix ;;
6379 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6381 case "$siteprefix" in
6385 *) oldsiteprefix="$prefix";;
6390 siteprefixexp="$ansexp"
6392 : determine where site specific libraries go.
6393 : Usual default is /usr/local/lib/perl5/site_perl/$version
6394 : The default "style" setting is made in installstyle.U
6395 : XXX No longer works with Prefixit stuff.
6396 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6398 '') case "$installstyle" in
6399 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6400 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6408 The installation process will create a directory for
6409 site-specific extensions and modules. Most users find it convenient
6410 to place all site-specific files in this directory rather than in the
6411 main distribution directory.
6415 rp='Pathname for the site-specific library files?'
6418 sitelibexp="$ansexp"
6419 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6420 : Change installation prefix, if necessary.
6421 if $test X"$prefix" != X"$installprefix"; then
6422 installsitelib=`echo $sitelibexp | $sed "s#^$prefix#$installprefix#"`
6424 installsitelib="$sitelibexp"
6427 : determine where site specific architecture-dependent libraries go.
6428 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6429 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6430 : sitelib may have an optional trailing /share.
6432 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6433 dflt="$dflt/$archname"
6438 set sitearch sitearch none
6442 The installation process will also create a directory for
6443 architecture-dependent site-specific extensions and modules.
6447 rp='Pathname for the site-specific architecture-dependent library files?'
6450 sitearchexp="$ansexp"
6451 : Change installation prefix, if necessary.
6452 if $test X"$prefix" != X"$installprefix"; then
6453 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
6455 installsitearch="$sitearchexp"
6460 The installation process will also create a directory for
6461 vendor-supplied add-ons. Vendors who supply perl with their system
6462 may find it convenient to place all vendor-supplied files in this
6463 directory rather than in the main distribution directory. This will
6464 ease upgrades between binary-compatible maintenance versions of perl.
6466 Of course you may also use these directories in whatever way you see
6467 fit. For example, you might use them to access modules shared over a
6468 company-wide network.
6470 The default answer should be fine for most people.
6471 This causes further questions about vendor add-ons to be skipped
6472 and no vendor-specific directories will be configured for perl.
6475 rp='Do you want to configure vendor-specific add-on directories?'
6476 case "$usevendorprefix" in
6477 define|true|[yY]*) dflt=y ;;
6478 *) : User may have set vendorprefix directly on Configure command line.
6479 case "$vendorprefix" in
6488 rp='Installation prefix to use for vendor-supplied add-ons?'
6489 case "$vendorprefix" in
6491 *) dflt=$vendorprefix ;;
6494 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6496 case "$vendorprefix" in
6500 *) oldvendorprefix="$prefix";;
6504 usevendorprefix="$define"
6506 vendorprefixexp="$ansexp"
6508 *) usevendorprefix="$undef"
6514 case "$vendorprefix" in
6515 '') d_vendorlib="$undef"
6519 *) d_vendorlib="$define"
6520 : determine where vendor-supplied modules go.
6521 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6522 case "$vendorlib" in
6524 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6525 case "$installstyle" in
6526 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6527 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6530 *) dflt="$vendorlib"
6534 rp='Pathname for the vendor-supplied library files?'
6537 vendorlibexp="$ansexp"
6540 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6541 : Change installation prefix, if necessary.
6542 if $test X"$prefix" != X"$installprefix"; then
6543 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
6545 installvendorlib="$vendorlibexp"
6548 case "$vendorprefix" in
6549 '') d_vendorarch="$undef"
6553 *) d_vendorarch="$define"
6554 : determine where vendor-supplied architecture-dependent libraries go.
6555 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6556 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6557 : vendorlib may have an optional trailing /share.
6558 case "$vendorarch" in
6559 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6560 dflt="$dflt/$archname"
6562 *) dflt="$vendorarch" ;;
6565 rp='Pathname for vendor-supplied architecture-dependent files?'
6568 vendorarchexp="$ansexp"
6571 : Change installation prefix, if necessary.
6572 if $test X"$prefix" != X"$installprefix"; then
6573 installvendorarch=`echo $vendorarchexp | sed "s#^$prefix#$installprefix#"`
6575 installvendorarch="$vendorarchexp"
6578 : Final catch-all directories to search
6581 Lastly, you can have perl look in other directories for extensions and
6582 modules in addition to those already specified.
6583 These directories will be searched after
6587 test X"$vendorlib" != "X" && echo ' ' $vendorlib
6588 test X"$vendorarch" != "X" && echo ' ' $vendorarch
6590 case "$otherlibdirs" in
6591 ''|' ') dflt='none' ;;
6592 *) dflt="$otherlibdirs" ;;
6595 Enter a colon-separated set of extra paths to include in perl's @INC
6596 search path, or enter 'none' for no extra paths.
6600 rp='Colon-separated list of additional directories for perl to search?'
6603 ' '|''|none) otherlibdirs=' ' ;;
6604 *) otherlibdirs="$ans" ;;
6606 case "$otherlibdirs" in
6610 set d_perl_otherlibdirs
6613 : Cruising for prototypes
6615 echo "Checking out function prototypes..." >&4
6616 $cat >prototype.c <<'EOCP'
6617 int main(int argc, char *argv[]) {
6620 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
6621 echo "Your C compiler appears to support function prototypes."
6624 echo "Your C compiler doesn't seem to understand function prototypes."
6631 case "$prototype" in
6633 *) ansi2knr='ansi2knr'
6638 This version of $package can only be compiled by a compiler that
6639 understands function prototypes. Unfortunately, your C compiler
6641 doesn't seem to understand them. Sorry about that.
6643 If GNU cc is available for your system, perhaps you could try that instead.
6645 Eventually, we hope to support building Perl with pre-ANSI compilers.
6646 If you would like to help in that effort, please contact <perlbug@perl.org>.
6648 Aborting Configure now.
6654 : determine where public executables go
6659 rp='Pathname where the public executables will reside?'
6661 if $test "X$ansexp" != "X$binexp"; then
6666 : Change installation prefix, if necessary.
6667 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6668 if $test X"$prefix" != X"$installprefix"; then
6669 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
6671 installbin="$binexp"
6674 : Find perl5.005 or later.
6675 echo "Looking for a previously installed perl5.005 or later... "
6677 '') for tdir in `echo "$binexp:$PATH" | $sed "s/$path_sep/ /g"`; do
6678 : Check if this perl is recent and can load a simple module
6679 if $test -x $tdir/perl && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6682 elif $test -x $tdir/perl5 && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6692 '') echo "None found. That's ok.";;
6693 *) echo "Using $perl5." ;;
6696 : Determine list of previous versions to include in @INC
6697 $cat > getverlist <<EOPL
6700 \$api_versionstring = "$api_versionstring";
6701 \$version = "$version";
6702 \$stem = "$sitelib_stem";
6703 \$archname = "$archname";
6705 $cat >> getverlist <<'EOPL'
6706 # Can't have leading @ because metaconfig interprets it as a command!
6707 ;@inc_version_list=();
6708 # XXX Redo to do opendir/readdir?
6711 ;@candidates = glob("5.*");
6717 # XXX ToDo: These comparisons must be reworked when two-digit
6718 # subversions come along, so that 5.7.10 compares as greater than
6719 # 5.7.3! By that time, hope that 5.6.x is sufficiently
6720 # widespread that we can use the built-in version vectors rather
6721 # than reinventing them here. For 5.6.0, however, we must
6722 # assume this script will likely be run by 5.005_0x. --AD 1/2000.
6723 foreach $d (@candidates) {
6724 if ($d lt $version) {
6725 if ($d ge $api_versionstring) {
6726 unshift(@inc_version_list, grep { -d } "$d/$archname", $d);
6728 elsif ($d ge "5.005") {
6729 unshift(@inc_version_list, grep { -d } $d);
6733 # Skip newer version. I.e. don't look in
6734 # 5.7.0 if we're installing 5.6.1.
6738 if (@inc_version_list) {
6739 print join(' ', @inc_version_list);
6742 # Blank space to preserve value for next Configure run.
6747 case "$inc_version_list" in
6748 '') if test -x "$perl5"; then
6749 dflt=`$perl5 getverlist`
6754 $undef) dflt='none' ;;
6755 *) dflt="$inc_version_list" ;;
6758 ''|' ') dflt=none ;;
6761 5.005) case "$bincompat5005" in
6762 $define|true|[yY]*) ;;
6769 In order to ease the process of upgrading, this version of perl
6770 can be configured to use modules built and installed with earlier
6771 versions of perl that were installed under $prefix. Specify here
6772 the list of earlier versions that this version of perl should check.
6773 If Configure detected no earlier versions of perl installed under
6774 $prefix, then the list will be empty. Answer 'none' to tell perl
6775 to not search earlier versions.
6777 The default should almost always be sensible, so if you're not sure,
6778 just accept the default.
6781 rp='List of earlier versions to include in @INC?'
6784 [Nn]one|''|' ') inc_version_list=' ' ;;
6785 *) inc_version_list="$ans" ;;
6787 case "$inc_version_list" in
6789 inc_version_list_init='0';;
6790 *) inc_version_list_init=`echo $inc_version_list |
6791 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6796 : determine whether to install perl also as /usr/bin/perl
6799 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
6801 Many scripts expect perl to be installed as /usr/bin/perl.
6802 I can install the perl you are about to compile also as /usr/bin/perl
6803 (in addition to $installbin/perl).
6805 case "$installusrbinperl" in
6806 "$undef"|[nN]*) dflt='n';;
6809 rp="Do you want to install perl as /usr/bin/perl?"
6812 [yY]*) val="$define";;
6818 set installusrbinperl
6821 : see if dld is available
6825 : see if dlopen exists
6832 : determine which dynamic loading, if any, to compile in
6834 dldir="ext/DynaLoader"
6847 $define) dflt='y' ;;
6850 $define) dflt='y' ;;
6852 : Does a dl_xxx.xs file exist for this operating system
6853 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
6856 rp="Do you wish to use dynamic loading?"
6863 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
6864 dflt="$dldir/dl_${osname}.xs"
6865 elif $test "$d_dlopen" = "$define" ; then
6866 dflt="$dldir/dl_dlopen.xs"
6867 elif $test "$i_dld" = "$define" ; then
6868 dflt="$dldir/dl_dld.xs"
6873 *) dflt="$dldir/$dlsrc"
6876 echo "The following dynamic loading files are available:"
6877 : Can not go over to $dldir because getfile has path hard-coded in.
6878 tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir
6879 rp="Source file to use for dynamic loading"
6885 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
6889 Some systems may require passing special flags to $cc -c to
6890 compile modules that will be used to create a shared library.
6891 To use no flags, say "none".
6894 case "$cccdlflags" in
6895 '') case "$gccversion" in
6896 '') case "$osname" in
6898 next) dflt='none' ;;
6899 irix*) dflt='-KPIC' ;;
6900 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
6901 sunos) dflt='-pic' ;;
6905 *) case "$osname" in
6906 svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
6911 *) dflt="$cccdlflags" ;;
6913 rp="Any special flags to pass to $cc -c to compile shared library modules?"
6916 none) cccdlflags=' ' ;;
6917 *) cccdlflags="$ans" ;;
6922 Some systems use ld to create libraries that can be dynamically loaded,
6923 while other systems (such as those using ELF) use $cc.
6927 '') $cat >try.c <<'EOM'
6928 /* Test for whether ELF binaries are produced */
6933 int i = open("a.out",O_RDONLY);
6936 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
6937 exit(0); /* succeed (yes, it's ELF) */
6942 if $cc $ccflags try.c >/dev/null 2>&1 && ./a.out; then
6944 You appear to have ELF support. I'll use $cc to build dynamic libraries.
6948 echo "I'll use ld to build dynamic libraries."
6957 rp="What command should be used to create dynamic libraries?"
6963 Some systems may require passing special flags to $ld to create a
6964 library that can be dynamically loaded. If your ld flags include
6965 -L/other/path options to locate libraries outside your loader's normal
6966 search path, you may need to specify those -L options here as well. To
6967 use no flags, say "none".
6970 case "$lddlflags" in
6971 '') case "$osname" in
6972 beos) dflt='-nostart' ;;
6974 case "$gccversion" in
6975 '') dflt="$dflt +vnocompatwarnings" ;;
6978 linux|irix*) dflt='-shared' ;;
6979 next) dflt='none' ;;
6980 solaris) dflt='-G' ;;
6981 sunos) dflt='-assert nodefinitions' ;;
6982 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
6986 *) dflt="$lddlflags" ;;
6989 : Try to guess additional flags to pick up local libraries.
6990 : Be careful not to append to a plain 'none'
6994 for thisflag in $ldflags; do
6999 *) dflt="$dflt $thisflag" ;;
7006 ''|' ') dflt='none' ;;
7009 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
7012 none) lddlflags=' ' ;;
7013 *) lddlflags="$ans" ;;
7018 Some systems may require passing special flags to $cc to indicate that
7019 the resulting executable will use dynamic linking. To use no flags,
7023 case "$ccdlflags" in
7024 '') case "$osname" in
7025 hpux) dflt='-Wl,-E' ;;
7026 linux) dflt='-rdynamic' ;;
7027 next) dflt='none' ;;
7028 sunos) dflt='none' ;;
7032 *) dflt="$ccdlflags" ;;
7034 rp="Any special flags to pass to $cc to use dynamic linking?"
7037 none) ccdlflags=' ' ;;
7038 *) ccdlflags="$ans" ;;
7052 # No dynamic loading being used, so don't bother even to prompt.
7055 *) case "$useshrplib" in
7056 '') case "$osname" in
7057 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
7059 also='Building a shared libperl is required for dynamic loading to work on your system.'
7064 also='Building a shared libperl is needed for MAB support.'
7082 The perl executable is normally obtained by linking perlmain.c with
7083 libperl${_a}, any static extensions (usually just DynaLoader), and
7084 any other libraries needed on this system (such as -lm, etc.). Since
7085 your system supports dynamic loading, it is probably possible to build
7086 a shared libperl.$so. If you will have more than one executable linked
7087 to libperl.$so, this will significantly reduce the size of each
7088 executable, but it may have a noticeable affect on performance. The
7089 default is probably sensible for your system.
7093 rp="Build a shared libperl.$so (y/n)"
7097 useshrplib='true' ;;
7098 *) useshrplib='false' ;;
7103 case "$useshrplib" in
7107 # Figure out a good name for libperl.so. Since it gets stored in
7108 # a version-specific architecture-dependent library, the version
7109 # number isn't really that important, except for making cc/ld happy.
7111 # A name such as libperl.so.3.1
7112 majmin="libperl.$so.$patchlevel.$subversion"
7113 # A name such as libperl.so.301
7114 majonly=`echo $patchlevel $subversion |
7115 $awk '{printf "%d%02d", $1, $2}'`
7116 majonly=libperl.$so.$majonly
7117 # I'd prefer to keep the os-specific stuff here to a minimum, and
7118 # rely on figuring it out from the naming of libc.
7119 case "${osname}${osvers}" in
7122 # XXX How handle the --version stuff for MAB?
7124 linux*) # ld won't link with a bare -lperl otherwise.
7127 cygwin*) # include version
7128 dflt=`echo libperl$version | sed -e 's/\./_/g'`$lib_ext
7130 *) # Try to guess based on whether libc has major.minor.
7132 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
7133 *libc.$so.[0-9]*) dflt=$majonly ;;
7134 *) dflt=libperl.$so ;;
7144 I need to select a good name for the shared libperl. If your system uses
7145 library names with major and minor numbers, then you might want something
7146 like $majmin. Alternatively, if your system uses a single version
7147 number for shared libraries, then you might want to use $majonly.
7148 Or, your system might be quite happy with a simple libperl.$so.
7150 Since the shared libperl will get installed into a version-specific
7151 architecture-dependent directory, the version number of the shared perl
7152 library probably isn't important, so the default should be o.k.
7155 rp='What name do you want to give to the shared libperl?'
7158 echo "Ok, I'll use $libperl"
7161 libperl="libperl${_a}"
7165 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
7169 WARNING: Use of the shrpdir variable for the installation location of
7170 the shared $libperl is not supported. It was never documented and
7171 will not work in this version. Let me (perlbug@perl.org)
7172 know of any problems this may cause.
7178 But your current setting of $shrpdir is
7179 the default anyway, so it's harmless.
7184 Further, your current attempted setting of $shrpdir
7185 conflicts with the value of $archlibexp/CORE
7186 that installperl will use.
7193 # How will the perl executable find the installed shared $libperl?
7194 # Add $xxx to ccdlflags.
7195 # If we can't figure out a command-line option, use $shrpenv to
7196 # set env LD_RUN_PATH. The main perl makefile uses this.
7197 shrpdir=$archlibexp/CORE
7200 if "$useshrplib"; then
7203 # We'll set it in Makefile.SH...
7209 xxx="-Wl,-R$shrpdir"
7211 linux|irix*|dec_osf)
7212 xxx="-Wl,-rpath,$shrpdir"
7215 # next doesn't like the default...
7218 # beos doesn't like the default, either.
7221 # hpux doesn't like the default, either.
7222 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
7225 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
7231 # Only add $xxx if it isn't already in ccdlflags.
7232 case " $ccdlflags " in
7234 *) ccdlflags="$ccdlflags $xxx"
7237 Adding $xxx to the flags
7238 passed to $ld so that the perl executable will find the
7239 installed shared $libperl.
7247 # Fix ccdlflags in AIX for building external extensions.
7248 # (For building Perl itself bare -bE:perl.exp is needed,
7249 # Makefile.SH takes care of this.)
7251 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
7253 # Respect a hint or command-line value.
7255 '') shrpenv="$tmp_shrpenv" ;;
7257 case "$ldlibpthname" in
7258 '') ldlibpthname=LD_LIBRARY_PATH ;;
7259 none) ldlibpthname='' ;;
7262 : determine where manual pages are on this system
7266 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
7267 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
7268 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
7269 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
7270 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
7271 sysman=`./loc . /usr/man/man1 $syspath`
7274 if $test -d "$sysman"; then
7275 echo "System manual is in $sysman." >&4
7277 echo "Could not find manual pages in source form." >&4
7280 : determine where manual pages go
7281 set man1dir man1dir none
7285 $spackage has manual pages available in source form.
7289 echo "However, you don't have nroff, so they're probably useless to you."
7291 '') man1dir="none";;
7294 echo "If you don't want the manual sources installed, answer 'none'."
7299 lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
7300 lookpath="$lookpath $prefixexp/man/p_man/man1"
7301 lookpath="$lookpath $prefixexp/man/u_man/man1"
7302 lookpath="$lookpath $prefixexp/man/man.1"
7304 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
7305 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
7315 rp="Where do the main $spackage manual pages (source) go?"
7317 if $test "X$man1direxp" != "X$ansexp"; then
7321 man1direxp="$ansexp"
7327 : Change installation prefix, if necessary.
7328 if $test X"$prefix" != X"$installprefix"; then
7329 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
7331 installman1dir="$man1direxp"
7334 : What suffix to use on installed man pages
7341 rp="What suffix should be used for the main $spackage man pages?"
7343 '') case "$man1dir" in
7357 *) dflt="$man1ext";;
7364 : see if we can have long filenames
7366 first=123456789abcdef
7368 if (echo hi >$first) 2>/dev/null; then
7369 if $test -f 123456789abcde; then
7370 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
7373 echo 'You can have filenames longer than 14 characters.'>&4
7378 You can't have filenames longer than 14 chars.
7379 You can't even think about them!
7385 $rm -rf 123456789abcde*
7387 : determine where library module manual pages go
7388 set man3dir man3dir none
7392 $spackage has manual pages for many of the library modules.
7398 However, you don't have nroff, so they're probably useless to you.
7401 '') man3dir="none";;
7405 case "$d_flexfnam" in
7408 However, your system can't handle the long file names like File::Basename.3.
7411 '') man3dir="none";;
7415 echo "If you don't want the manual sources installed, answer 'none'."
7416 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7418 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
7419 if $test -d "$privlib/man/man3"; then
7422 WARNING: Previous versions of perl installed man3 pages into
7423 $privlib/man/man3. This version will suggest a
7424 new default of $dflt.
7428 rp='Do you wish to preserve the old behavior?(y/n)'
7431 y*) dflt="$privlib/man/man3" ;;
7436 *) dflt="$man3dir" ;;
7443 rp="Where do the $package library man pages (source) go?"
7446 man3direxp="$ansexp"
7452 : Change installation prefix, if necessary.
7453 if $test X"$prefix" != X"$installprefix"; then
7454 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
7456 installman3dir="$man3direxp"
7459 : What suffix to use on installed man pages
7465 rp="What suffix should be used for the $package library man pages?"
7467 '') case "$man3dir" in
7481 *) dflt="$man3ext";;
7488 : see if we have to deal with yellow pages, now NIS.
7489 if $test -d /usr/etc/yp || $test -d /etc/yp; then
7490 if $test -f /usr/etc/nibindd; then
7492 echo "I'm fairly confident you're on a NeXT."
7494 rp='Do you get the hosts file via NetInfo?'
7503 y*) hostcat='nidump hosts .';;
7504 *) case "$hostcat" in
7505 nidump*) hostcat='';;
7515 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
7523 rp='Are you getting the hosts file via yellow pages?'
7526 y*) hostcat='ypcat hosts';;
7527 *) hostcat='cat /etc/hosts';;
7533 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
7536 '') test -f /etc/group && groupcat='cat /etc/group';;
7539 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
7542 : now get the host name
7544 echo "Figuring out host name..." >&4
7545 case "$myhostname" in
7547 echo 'Maybe "hostname" will work...'
7548 if tans=`sh -c hostname 2>&1` ; then
7556 if $test "$cont"; then
7558 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
7559 if tans=`cat /etc/systemid 2>&1` ; then
7561 phostname='cat /etc/systemid'
7562 echo "Whadyaknow. Xenix always was a bit strange..."
7565 elif $test -r /etc/systemid; then
7566 echo "(What is a non-Xenix system doing with /etc/systemid?)"
7569 if $test "$cont"; then
7570 echo 'No, maybe "uuname -l" will work...'
7571 if tans=`sh -c 'uuname -l' 2>&1` ; then
7573 phostname='uuname -l'
7575 echo 'Strange. Maybe "uname -n" will work...'
7576 if tans=`sh -c 'uname -n' 2>&1` ; then
7578 phostname='uname -n'
7580 echo 'Oh well, maybe I can mine it out of whoami.h...'
7581 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
7582 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
7583 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
7585 case "$myhostname" in
7586 '') echo "Does this machine have an identity crisis or something?"
7589 echo "Well, you said $myhostname before..."
7590 phostname='echo $myhostname';;
7596 : you do not want to know about this
7601 if $test "$myhostname" ; then
7603 rp='Your host name appears to be "'$myhostname'".'" Right?"
7611 : bad guess or no guess
7612 while $test "X$myhostname" = X ; do
7614 rp="Please type the (one word) name of your host:"
7619 : translate upper to lower if necessary
7620 case "$myhostname" in
7622 echo "(Normalizing case in your host name)"
7623 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
7627 case "$myhostname" in
7629 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
7630 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
7631 echo "(Trimming domain name from host name--host name is now $myhostname)"
7633 *) case "$mydomain" in
7636 test "X$hostcat" = "Xypcat hosts" &&
7637 ypmatch "$myhostname" hosts 2>/dev/null |\
7638 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
7641 test "X$hostcat" != "X" &&
7642 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
7643 /[ ]$myhostname[ . ]/p" > hosts
7646 if $test -f hosts; then
7647 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
7648 END { print sum }" hosts` = x1 || tmp_re="[ ]"
7649 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
7650 hosts | $sort | $uniq | \
7651 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
7652 case `$echo X$dflt` in
7653 X*\ *) echo "(Several hosts in the database matched hostname)"
7656 X.) echo "(You do not have fully-qualified names in the hosts database)"
7660 echo "(I cannot locate a hosts database anywhere)"
7665 tans=`./loc resolv.conf X /etc /usr/etc`
7666 if $test -f "$tans"; then
7667 echo "(Attempting domain name extraction from $tans)"
7668 dflt=.`$sed -n -e 's/ / /g' \
7669 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
7670 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
7672 .) dflt=.`$sed -n -e 's/ / /g' \
7673 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
7674 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
7681 .) echo "(No help from resolv.conf either -- attempting clever guess)"
7682 dflt=.`sh -c domainname 2>/dev/null`
7685 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
7689 case "$dflt$osname" in
7690 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
7691 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
7695 .) echo "(Lost all hope -- silly guess then)"
7701 *) dflt="$mydomain";;
7705 rp="What is your domain name?"
7715 : translate upper to lower if necessary
7718 echo "(Normalizing case in your domain name)"
7719 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
7723 : a little sanity check here
7724 case "$phostname" in
7727 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
7728 $myhostname$mydomain|$myhostname) ;;
7730 case "$phostname" in
7732 echo "(That doesn't agree with your whoami.h file, by the way.)"
7735 echo "(That doesn't agree with your $phostname command, by the way.)"
7745 I need to get your e-mail address in Internet format if possible, i.e.
7746 something like user@host.domain. Please answer accurately since I have
7747 no easy means to double check it. The default value provided below
7748 is most probably close to reality but may not be valid from outside
7749 your organization...
7753 while test "$cont"; do
7755 '') dflt="$cf_by@$myhostname$mydomain";;
7756 *) dflt="$cf_email";;
7758 rp='What is your e-mail address?'
7764 rp='Address does not look like an Internet one. Use it anyway?'
7780 If you or somebody else will be maintaining perl at your site, please
7781 fill in the correct e-mail address here so that they may be contacted
7782 if necessary. Currently, the "perlbug" program included with perl
7783 will send mail to this address in addition to perlbug@perl.org. You may
7784 enter "none" for no administrator.
7787 case "$perladmin" in
7788 '') dflt="$cf_email";;
7789 *) dflt="$perladmin";;
7791 rp='Perl administrator e-mail address'
7795 : determine whether to only install version-specific parts.
7798 Do you want to install only the version-specific parts of the perl
7799 distribution? Usually you do *not* want to do this.
7801 case "$versiononly" in
7802 "$define"|[Yy]*|true) dflt='y' ;;
7805 rp="Do you want to install only the version-specific parts of perl?"
7808 [yY]*) val="$define";;
7814 : figure out how to guarantee perl startup
7815 case "$startperl" in
7817 case "$sharpbang" in
7821 I can use the #! construct to start perl on your system. This will
7822 make startup of perl scripts faster, but may cause problems if you
7823 want to share those scripts and perl is not in a standard place
7824 ($binexp/perl) on all your platforms. The alternative is to force
7825 a shell by starting the script with a single ':' character.
7828 case "$versiononly" in
7829 "$define") dflt="$binexp/perl$version";;
7830 *) dflt="$binexp/perl";;
7832 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
7835 none) startperl=": # use perl";;
7836 *) startperl="#!$ans"
7837 if $test 30 -lt `echo "$ans" | wc -c`; then
7840 WARNING: Some systems limit the #! command to 32 characters.
7841 If you experience difficulty running Perl scripts with #!, try
7842 installing Perl in a directory with a shorter pathname.
7848 *) startperl=": # use perl"
7853 echo "I'll use $startperl to start perl scripts."
7855 : figure best path for perl in scripts
7858 perlpath="$binexp/perl"
7859 case "$startperl" in
7864 I will use the "eval 'exec'" idiom to start Perl on your system.
7865 I can use the full path of your Perl binary for this purpose, but
7866 doing so may cause problems if you want to share those scripts and
7867 Perl is not always in a standard place ($binexp/perl).
7871 rp="What path shall I use in \"eval 'exec'\"?"
7878 case "$startperl" in
7880 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
7883 : determine where public executable scripts go
7884 set scriptdir scriptdir
7886 case "$scriptdir" in
7889 : guess some guesses
7890 $test -d /usr/share/scripts && dflt=/usr/share/scripts
7891 $test -d /usr/share/bin && dflt=/usr/share/bin
7892 $test -d /usr/local/script && dflt=/usr/local/script
7893 $test -d /usr/local/scripts && dflt=/usr/local/scripts
7894 $test -d $prefixexp/script && dflt=$prefixexp/script
7898 *) dflt="$scriptdir"
7903 Some installations have a separate directory just for executable scripts so
7904 that they can mount it across multiple architectures but keep the scripts in
7905 one spot. You might, for example, have a subdirectory of /usr/share for this.
7906 Or you might just lump your scripts in with all your other executables.
7910 rp='Where do you keep publicly executable scripts?'
7912 if $test "X$ansexp" != "X$scriptdirexp"; then
7916 scriptdirexp="$ansexp"
7917 : Change installation prefix, if necessary.
7918 if $test X"$prefix" != X"$installprefix"; then
7919 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
7921 installscript="$scriptdirexp"
7924 : determine where add-on public executables go
7926 '') dflt=$siteprefix/bin ;;
7930 rp='Pathname where the add-on public executables should be installed?'
7933 sitebinexp="$ansexp"
7934 : Change installation prefix, if necessary.
7935 if $test X"$prefix" != X"$installprefix"; then
7936 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
7938 installsitebin="$sitebinexp"
7941 case "$vendorprefix" in
7942 '') d_vendorbin="$undef"
7946 *) d_vendorbin="$define"
7947 : determine where vendor-supplied executables go.
7948 case "$vendorbin" in
7949 '') dflt=$vendorprefix/bin ;;
7950 *) dflt="$vendorbin" ;;
7953 rp='Pathname for the vendor-supplied executables directory?'
7956 vendorbinexp="$ansexp"
7959 : Change installation prefix, if necessary.
7960 if $test X"$prefix" != X"$installprefix"; then
7961 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
7963 installvendorbin="$vendorbinexp"
7966 : see if qgcvt exists
7972 if $test X"$d_longdbl" = X"$define"; then
7974 echo "Checking how to print long doubles..." >&4
7976 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
7977 $cat >try.c <<'EOCP'
7978 #include <sys/types.h>
7982 printf("%.3f\n", d);
7986 if eval $compile; then
7990 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
7991 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
7992 echo "We will use %f."
7998 if $test X"$sPRIfldbl" = X; then
7999 $cat >try.c <<'EOCP'
8000 #include <sys/types.h>
8003 long double d = 123.456;
8004 printf("%.3llf\n", d);
8008 if eval $compile; then
8012 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
8013 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
8014 echo "We will use %llf."
8020 if $test X"$sPRIfldbl" = X; then
8021 $cat >try.c <<'EOCP'
8022 #include <sys/types.h>
8025 long double d = 123.456;
8026 printf("%.3Lf\n", d);
8030 if eval $compile; then
8034 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
8035 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
8036 echo "We will use %Lf."
8042 if $test X"$sPRIfldbl" = X; then
8043 $cat >try.c <<'EOCP'
8044 #include <sys/types.h>
8047 long double d = 123.456;
8048 printf("%.3lf\n", d);
8052 if eval $compile; then
8056 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
8057 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
8058 echo "We will use %lf."
8064 if $test X"$sPRIfldbl" = X; then
8065 echo "Cannot figure out how to print long doubles." >&4
8067 sSCNfldbl=$sPRIfldbl # expect consistency
8074 case "$sPRIfldbl" in
8075 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
8076 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
8077 d_SCNfldbl="$undef";
8079 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
8080 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
8081 d_SCNfldbl="$define";
8085 : Check how to convert floats to strings.
8087 echo "Checking for an efficient way to convert floats to strings."
8089 case "$uselongdouble" in
8090 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
8092 case "$d_longdbl" in
8093 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
8095 case "$d_PRIgldbl" in
8096 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
8100 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
8101 char *myname = "gconvert";
8104 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
8105 char *myname = "gcvt";
8108 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
8109 char *myname = "qgcvt";
8110 #define DOUBLETYPE long double
8113 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE) && defined(HAS_PRIgldbl)
8114 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
8116 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
8118 char *myname = "sprintf";
8122 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
8123 #define DOUBLETYPE long double
8125 #define DOUBLETYPE double
8131 #define I_STDLIB $i_stdlib
8137 checkit(expect, got)
8141 if (strcmp(expect, got)) {
8142 printf("%s oddity: Expected %s, got %s\n",
8143 myname, expect, got);
8153 /* This must be 1st test on (which?) platform */
8154 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
8155 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
8156 checkit("0.1", buf);
8158 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
8161 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
8162 checkit("1.1", buf);
8164 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
8165 checkit("1.01", buf);
8167 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
8168 checkit("1.001", buf);
8170 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
8171 checkit("1.0001", buf);
8173 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
8174 checkit("1.00001", buf);
8176 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
8177 checkit("1.000001", buf);
8179 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
8182 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
8185 /* Some Linux gcvt's give 1.e+5 here. */
8186 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
8187 checkit("100000", buf);
8189 /* Some Linux gcvt's give -1.e+5 here. */
8190 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
8191 checkit("-100000", buf);
8193 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
8194 checkit("123.456", buf);
8199 case "$d_Gconvert" in
8200 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
8201 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
8202 sprintf*) xxx_list='sprintf gconvert gcvt' ;;
8203 *) xxx_list='gconvert gcvt sprintf' ;;
8206 case "$d_longdbl$uselongdouble$d_PRIgldbl" in
8207 "$define$define$define")
8208 # for long doubles prefer first qgcvt, then sprintf
8209 xxx_list="`echo $xxx_list|sed s/sprintf//`"
8210 xxx_list="sprintf $xxx_list"
8212 "$define") xxx_list="qgcvt $xxx_list" ;;
8217 for xxx_convert in $xxx_list; do
8218 echo "Trying $xxx_convert..."
8220 set try -DTRY_$xxx_convert
8221 if eval $compile; then
8222 echo "$xxx_convert() found." >&4
8224 echo "I'll use $xxx_convert to convert floats into a string." >&4
8227 echo "...But $xxx_convert didn't work as I expected."
8230 echo "$xxx_convert NOT found." >&4
8234 case "$xxx_convert" in
8235 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
8236 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
8237 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
8238 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
8239 "$define$define$define")
8240 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
8241 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
8246 : see if _fwalk exists
8250 : Initialize h_fcntl
8253 : Initialize h_sysfile
8256 : access call always available on UNIX
8260 : locate the flags for 'access()'
8264 $cat >access.c <<'EOCP'
8265 #include <sys/types.h>
8270 #include <sys/file.h>
8279 : check sys/file.h first, no particular reason here
8280 if $test `./findhdr sys/file.h` && \
8281 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
8283 echo "<sys/file.h> defines the *_OK access constants." >&4
8284 elif $test `./findhdr fcntl.h` && \
8285 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
8287 echo "<fcntl.h> defines the *_OK access constants." >&4
8288 elif $test `./findhdr unistd.h` && \
8289 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
8290 echo "<unistd.h> defines the *_OK access constants." >&4
8292 echo "I can't find the four *_OK access constants--I'll use mine." >&4
8298 : see if accessx exists
8299 set accessx d_accessx
8302 : see if alarm exists
8306 : see if atolf exists
8310 : see if atoll exists
8314 : Look for GNU-cc style attribute checking
8316 echo "Checking whether your compiler can handle __attribute__ ..." >&4
8317 $cat >attrib.c <<'EOCP'
8319 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
8321 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
8322 if $contains 'warning' attrib.out >/dev/null 2>&1; then
8323 echo "Your C compiler doesn't fully support __attribute__."
8326 echo "Your C compiler supports __attribute__."
8330 echo "Your C compiler doesn't seem to understand __attribute__ at all."
8337 : see if bcmp exists
8341 : see if bcopy exists
8345 : see if this is a unistd.h system
8346 set unistd.h i_unistd
8349 : see if getpgrp exists
8350 set getpgrp d_getpgrp
8353 case "$d_getpgrp" in
8356 echo "Checking to see which flavor of getpgrp is in use..."
8359 #include <sys/types.h>
8361 # include <unistd.h>
8365 if (getuid() == 0) {
8366 printf("(I see you are running Configure as super-user...)\n");
8370 if (getpgrp(1) == 0)
8379 if $cc -o set -DTRY_BSD_PGRP $ccflags $ldflags set.c $libs >/dev/null 2>&1 && ./set; then
8380 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
8382 elif $cc -o set $ccflags $ldflags set.c $libs >/dev/null 2>&1 && ./set; then
8383 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
8386 echo "I can't seem to compile and run the test program."
8388 xxx="a USG one, i.e. you use getpgrp()."
8390 # SVR4 systems can appear rather BSD-ish.
8393 xxx="a BSD one, i.e. you use getpgrp(pid)."
8397 xxx="probably a USG one, i.e. you use getpgrp()."
8402 echo "Assuming your getpgrp is $xxx" >&4
8411 : see if setpgrp exists
8412 set setpgrp d_setpgrp
8415 case "$d_setpgrp" in
8418 echo "Checking to see which flavor of setpgrp is in use..."
8421 #include <sys/types.h>
8423 # include <unistd.h>
8427 if (getuid() == 0) {
8428 printf("(I see you are running Configure as super-user...)\n");
8432 if (-1 == setpgrp(1, 1))
8435 if (setpgrp() != -1)
8441 if $cc -o set -DTRY_BSD_PGRP $ccflags $ldflags set.c $libs >/dev/null 2>&1 && ./set; then
8442 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
8444 elif $cc -o set $ccflags $ldflags set.c $libs >/dev/null 2>&1 && ./set; then
8445 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
8448 echo "(I can't seem to compile and run the test program.)"
8450 xxx="a USG one, i.e. you use setpgrp()."
8452 # SVR4 systems can appear rather BSD-ish.
8455 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
8459 xxx="probably a USG one, i.e. you use setpgrp()."
8464 echo "Assuming your setpgrp is $xxx" >&4
8472 : see if bzero exists
8476 : see if signal is declared as pointer to function returning int or void
8478 xxx=`./findhdr signal.h`
8479 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
8480 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
8481 echo "You have int (*signal())() instead of void." >&4
8483 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
8484 echo "You have void (*signal())()." >&4
8486 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
8487 echo "You have int (*signal())() instead of void." >&4
8489 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
8490 echo "You have void (*signal())()." >&4
8493 case "$d_voidsig" in
8495 echo "I can't determine whether signal handler returns void or int..." >&4
8497 rp="What type does your signal handler return?"
8504 echo "As you already told me, signal handler returns void." >&4
8507 *) echo "As you already told me, signal handler returns int." >&4
8514 case "$d_voidsig" in
8515 "$define") signal_t="void";;
8520 : check for ability to cast large floats to 32-bit ints.
8522 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
8523 if $test "$intsize" -ge 4; then
8530 #include <sys/types.h>
8532 $signal_t blech(s) int s; { exit(3); }
8539 signal(SIGFPE, blech);
8541 /* Don't let compiler optimize the test away. Store the number
8542 in a writable string for gcc to pass to sscanf under HP/UX.
8544 sprintf(str, "2147483647");
8545 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
8549 /* x86 processors will probably give 0x8000 0000, which is a
8550 sign change. We don't want that. We want to mimic SPARC
8551 behavior here, which is to preserve the sign and give
8554 if (i32 != ($xxx) f)
8560 if eval $compile_ok; then
8564 echo "(I can't seem to compile the test program--assuming it can't)"
8572 echo "Nope, it can't."
8579 : check for ability to cast negative floats to unsigned
8581 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
8584 #include <sys/types.h>
8586 $signal_t blech(s) int s; { exit(7); }
8587 $signal_t blech_in_list(s) int s; { exit(4); }
8588 unsigned long dummy_long(p) unsigned long p; { return p; }
8589 unsigned int dummy_int(p) unsigned int p; { return p; }
8590 unsigned short dummy_short(p) unsigned short p; { return p; }
8594 unsigned long along;
8596 unsigned short ashort;
8600 /* Frustrate gcc-2.7.2's optimizer which failed this test with
8601 a direct f = -123. assignment. gcc-2.8.0 reportedly
8602 optimized the whole file away
8604 /* Store the number in a writable string for gcc to pass to
8607 sprintf(str, "-123");
8608 sscanf(str, "%lf", &f); /* f = -123.; */
8610 signal(SIGFPE, blech);
8611 along = (unsigned long)f;
8612 aint = (unsigned int)f;
8613 ashort = (unsigned short)f;
8614 if (along != (unsigned long)-123)
8616 if (aint != (unsigned int)-123)
8618 if (ashort != (unsigned short)-123)
8620 sprintf(str, "1073741824.");
8621 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
8624 along = (unsigned long)f;
8625 if (along != 0x80000000)
8629 along = (unsigned long)f;
8630 if (along != 0x7fffffff)
8634 along = (unsigned long)f;
8635 if (along != 0x80000001)
8639 signal(SIGFPE, blech_in_list);
8640 sprintf(str, "123.");
8641 sscanf(str, "%lf", &f); /* f = 123.; */
8642 along = dummy_long((unsigned long)f);
8643 aint = dummy_int((unsigned int)f);
8644 ashort = dummy_short((unsigned short)f);
8645 if (along != (unsigned long)123)
8647 if (aint != (unsigned int)123)
8649 if (ashort != (unsigned short)123)
8656 if eval $compile_ok; then
8660 echo "(I can't seem to compile the test program--assuming it can't)"
8663 case "$castflags" in
8668 echo "Nope, it can't."
8675 : see if vprintf exists
8677 if set vprintf val -f d_vprintf; eval $csym; $val; then
8678 echo 'vprintf() found.' >&4
8680 $cat >vprintf.c <<'EOF'
8681 #include <varargs.h>
8683 int main() { xxx("foo"); }
8692 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
8696 if eval $compile && ./vprintf; then
8697 echo "Your vsprintf() returns (int)." >&4
8700 echo "Your vsprintf() returns (char*)." >&4
8704 echo 'vprintf() NOT found.' >&4
8714 : see if chown exists
8718 : see if chroot exists
8722 : see if chsize exists
8726 hasstruct='varname=$1; struct=$2; shift; shift;
8727 while $test $# -ge 2; do
8729 $define) echo "#include <$2>";;
8733 echo "int main () { struct $struct foo; }" >> try.c;
8735 if eval $compile; then
8744 : see if sys/types.h has to be included
8745 set sys/types.h i_systypes
8748 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
8749 while $test $# -ge 2; do
8751 $define) echo "#include <$2>";;
8755 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
8757 if eval $compile; then
8768 : see whether socket exists
8770 $echo $n "Hmm... $c" >&4
8771 if set socket val -f d_socket; eval $csym; $val; then
8772 echo "Looks like you have Berkeley networking support." >&4
8774 if set setsockopt val -f; eval $csym; $val; then
8777 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
8781 if $contains socklib libc.list >/dev/null 2>&1; then
8782 echo "Looks like you have Berkeley networking support." >&4
8784 : we will have to assume that it supports the 4.2 BSD interface
8787 echo "You don't have Berkeley networking in libc$_a..." >&4
8788 if test "X$d_socket" = "X$define"; then
8789 echo "...but you seem to believe that you have sockets." >&4
8791 for net in net socket
8793 if test -f /usr/lib/lib$net$_a; then
8794 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
8795 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
8796 if $contains socket libc.list >/dev/null 2>&1; then
8801 echo "...but the Wollongong group seems to have hacked it in." >&4
8802 sockethdr="-I/usr/netinclude"
8805 echo "Found Berkeley sockets interface in lib$net." >& 4
8806 if $contains setsockopt libc.list >/dev/null 2>&1; then
8809 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
8816 if test "X$d_socket" != "X$define"; then
8817 echo "or anywhere else I see." >&4
8825 : see if socketpair exists
8826 set socketpair d_sockpair
8831 echo "Checking the availability of certain socket constants..." >& 4
8832 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
8833 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
8835 #include <sys/types.h>
8836 #include <sys/socket.h>
8842 set try; if eval $compile; then
8845 set d_${enum}; eval $setvar
8849 : see if this is a sys/uio.h system
8850 set sys/uio.h i_sysuio
8855 echo "Checking to see if your system supports struct cmsghdr..." >&4
8856 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
8858 case "$d_cmsghdr_s" in
8859 "$define") echo "Yes, it does." ;;
8860 *) echo "No, it doesn't." ;;
8864 : check for const keyword
8866 echo 'Checking to see if your C compiler knows about "const"...' >&4
8867 $cat >const.c <<'EOCP'
8868 typedef struct spug { int drokk; } spug;
8875 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
8877 echo "Yup, it does."
8880 echo "Nope, it doesn't."
8885 : see if crypt exists
8887 if set crypt val -f d_crypt; eval $csym; $val; then
8888 echo 'crypt() found.' >&4
8892 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
8893 if $test -z "$cryptlib"; then
8894 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
8898 if $test -z "$cryptlib"; then
8899 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
8903 if $test -z "$cryptlib"; then
8904 cryptlib=`./loc libcrypt$_a "" $libpth`
8908 if $test -z "$cryptlib"; then
8909 echo 'crypt() NOT found.' >&4
8918 : get csh whereabouts
8920 'csh') val="$undef" ;;
8925 : Respect a hint or command line value for full_csh.
8927 '') full_csh=$csh ;;
8930 : see if cuserid exists
8931 set cuserid d_cuserid
8934 : see if this is a limits.h system
8935 set limits.h i_limits
8938 : see if this is a float.h system
8942 : See if number of significant digits in a double precision number is known
8944 $cat >dbl_dig.c <<EOM
8954 printf("Contains DBL_DIG");
8957 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
8958 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
8959 echo "DBL_DIG found." >&4
8962 echo "DBL_DIG NOT found." >&4
8969 : see if difftime exists
8970 set difftime d_difftime
8973 : see if this is a dirent system
8975 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
8977 echo "<dirent.h> found." >&4
8980 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
8981 echo "<sys/dir.h> found." >&4
8984 xinc=`./findhdr sys/ndir.h`
8986 echo "<dirent.h> NOT found." >&4
8991 : Look for type of directory structure.
8993 $cppstdin $cppflags $cppminus < "$xinc" > try.c
8995 case "$direntrytype" in
8998 $define) guess1='struct dirent' ;;
8999 *) guess1='struct direct' ;;
9002 *) guess1="$direntrytype"
9007 'struct dirent') guess2='struct direct' ;;
9008 *) guess2='struct dirent' ;;
9011 if $contains "$guess1" try.c >/dev/null 2>&1; then
9012 direntrytype="$guess1"
9013 echo "Your directory entries are $direntrytype." >&4
9014 elif $contains "$guess2" try.c >/dev/null 2>&1; then
9015 direntrytype="$guess2"
9016 echo "Your directory entries seem to be $direntrytype." >&4
9018 echo "I don't recognize your system's directory entries." >&4
9019 rp="What type is used for directory entries on this system?"
9027 : see if the directory entry stores field length
9029 $cppstdin $cppflags $cppminus < "$xinc" > try.c
9030 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
9031 echo "Good, your directory entry keeps length information in d_namlen." >&4
9034 echo "Your directory entry does not know about the d_namlen field." >&4
9041 : see if dlerror exists
9044 set dlerror d_dlerror
9048 : see if dlfcn is available
9056 On a few systems, the dynamically loaded modules that perl generates and uses
9057 will need a different extension than shared libs. The default will probably
9065 rp='What is the extension of dynamically loaded modules'
9074 : Check if dlsym need a leading underscore
9080 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
9081 $cat >dyna.c <<'EOM'
9090 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
9092 #include <sys/types.h>
9106 int mode = RTLD_LAZY ;
9108 handle = dlopen("./dyna.$dlext", mode) ;
9109 if (handle == NULL) {
9114 symbol = dlsym(handle, "fred") ;
9115 if (symbol == NULL) {
9116 /* try putting a leading underscore */
9117 symbol = dlsym(handle, "_fred") ;
9118 if (symbol == NULL) {
9131 : Call the object file tmp-dyna.o in case dlext=o.
9132 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
9133 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
9134 $ld -o dyna.$dlext $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
9135 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then
9138 1) echo "Test program failed using dlopen." >&4
9139 echo "Perhaps you should not use dynamic loading." >&4;;
9140 2) echo "Test program failed using dlsym." >&4
9141 echo "Perhaps you should not use dynamic loading." >&4;;
9142 3) echo "dlsym needs a leading underscore" >&4
9144 4) echo "dlsym doesn't need a leading underscore." >&4;;
9147 echo "I can't compile and run the test program." >&4
9148 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
9153 $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
9158 hasproto='varname=$1; func=$2; shift; shift;
9159 while $test $# -ge 2; do
9161 $define) echo "#include <$2>";;
9165 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
9166 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
9167 echo "$func() prototype found.";
9170 echo "$func() prototype NOT found.";
9175 $rm -f try.c tryout.c'
9177 : see if prototype for drand48 is available
9179 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
9182 : see if dup2 exists
9186 : see if eaccess exists
9187 set eaccess d_eaccess
9190 : see if endgrent exists
9191 set endgrent d_endgrent
9194 : see if endhostent exists
9195 set endhostent d_endhent
9198 : see if endnetent exists
9199 set endnetent d_endnent
9202 : see if endprotoent exists
9203 set endprotoent d_endpent
9206 : see if endpwent exists
9207 set endpwent d_endpwent
9210 : see if endservent exists
9211 set endservent d_endsent
9214 : Locate the flags for 'open()'
9216 $cat >open3.c <<'EOCP'
9217 #include <sys/types.h>
9222 #include <sys/file.h>
9233 : check sys/file.h first to get FREAD on Sun
9234 if $test `./findhdr sys/file.h` && \
9235 set open3 -DI_SYS_FILE && eval $compile; then
9237 echo "<sys/file.h> defines the O_* constants..." >&4
9239 echo "and you have the 3 argument form of open()." >&4
9242 echo "but not the 3 argument form of open(). Oh, well." >&4
9245 elif $test `./findhdr fcntl.h` && \
9246 set open3 -DI_FCNTL && eval $compile; then
9248 echo "<fcntl.h> defines the O_* constants..." >&4
9250 echo "and you have the 3 argument form of open()." >&4
9253 echo "but not the 3 argument form of open(). Oh, well." >&4
9258 echo "I can't find the O_* constant definitions! You got problems." >&4
9264 : see which of string.h or strings.h is needed
9266 strings=`./findhdr string.h`
9267 if $test "$strings" && $test -r "$strings"; then
9268 echo "Using <string.h> instead of <strings.h>." >&4
9272 strings=`./findhdr strings.h`
9273 if $test "$strings" && $test -r "$strings"; then
9274 echo "Using <strings.h> instead of <string.h>." >&4
9276 echo "No string header found -- You'll surely have problems." >&4
9282 "$undef") strings=`./findhdr strings.h`;;
9283 *) strings=`./findhdr string.h`;;
9286 : check for non-blocking I/O stuff
9287 case "$h_sysfile" in
9288 true) echo "#include <sys/file.h>" > head.c;;
9291 true) echo "#include <fcntl.h>" > head.c;;
9292 *) echo "#include <sys/fcntl.h>" > head.c;;
9297 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
9298 case "$o_nonblock" in
9301 $cat >>try.c <<'EOCP'
9305 printf("O_NONBLOCK\n");
9309 printf("O_NDELAY\n");
9313 printf("FNDELAY\n");
9320 if eval $compile_ok; then
9322 case "$o_nonblock" in
9323 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
9324 *) echo "Seems like we can use $o_nonblock.";;
9327 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
9330 *) echo "Using $hint value $o_nonblock.";;
9332 $rm -f try try.* .out core
9335 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
9341 #include <sys/types.h>
9344 #define MY_O_NONBLOCK $o_nonblock
9345 #ifndef errno /* XXX need better Configure test */
9356 #include <strings.h>
9358 $signal_t blech(x) int x; { exit(3); }
9360 $cat >> try.c <<'EOCP'
9368 pipe(pd); /* Down: child -> parent */
9369 pipe(pu); /* Up: parent -> child */
9372 close(pd[1]); /* Parent reads from pd[0] */
9373 close(pu[0]); /* Parent writes (blocking) to pu[1] */
9375 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
9380 signal(SIGALRM, blech);
9382 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
9384 sprintf(string, "%d\n", ret);
9385 write(2, string, strlen(string));
9388 if (errno == EAGAIN) {
9394 if (errno == EWOULDBLOCK)
9395 printf("EWOULDBLOCK\n");
9398 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
9399 sleep(2); /* Give it time to close our pipe */
9401 ret = read(pd[0], buf, 1); /* Should read EOF */
9403 sprintf(string, "%d\n", ret);
9404 write(3, string, strlen(string));
9408 close(pd[0]); /* We write to pd[1] */
9409 close(pu[1]); /* We read from pu[0] */
9410 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
9411 close(pd[1]); /* Pipe pd is now fully closed! */
9412 exit(0); /* Bye bye, thank you for playing! */
9416 if eval $compile_ok; then
9417 echo "$startsh" >mtry
9418 echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
9420 ./mtry >/dev/null 2>&1
9422 0) eagain=`$cat try.out`;;
9423 1) echo "Could not perform non-blocking setting!";;
9424 2) echo "I did a successful read() for something that was not there!";;
9425 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
9426 4) echo "Could not find F_SETFL!";;
9427 *) echo "Something terribly wrong happened during testing.";;
9429 rd_nodata=`$cat try.ret`
9430 echo "A read() system call with no data present returns $rd_nodata."
9431 case "$rd_nodata" in
9434 echo "(That's peculiar, fixing that to be -1.)"
9440 echo "Forcing errno EAGAIN on read() with no data available."
9444 echo "Your read() sets errno to $eagain when no data is available."
9447 status=`$cat try.err`
9449 0) echo "And it correctly returns 0 to signal EOF.";;
9450 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
9451 *) echo "However, your read() returns '$status' on EOF??";;
9454 if test "$status" = "$rd_nodata"; then
9455 echo "WARNING: you can't distinguish between EOF and no data!"
9459 echo "I can't compile the test program--assuming errno EAGAIN will do."
9466 echo "Using $hint value $eagain."
9467 echo "Your read() returns $rd_nodata when no data is present."
9468 case "$d_eofnblk" in
9469 "$define") echo "And you can see EOF because read() returns 0.";;
9470 "$undef") echo "But you can't see EOF status from read() returned value.";;
9472 echo "(Assuming you can't see EOF status from read anyway.)"
9478 $rm -f try try.* .out core head.c mtry
9480 : see if fchmod exists
9484 : see if fchown exists
9488 : see if this is an fcntl system
9493 : See if fcntl-based locking works.
9494 $cat >try.c <<'EOCP'
9499 #if defined(F_SETLK) && defined(F_SETLKW)
9502 fd = open("try.c", O_RDONLY);
9503 flock.l_type = F_RDLCK;
9504 flock.l_whence = SEEK_SET;
9505 flock.l_start = flock.l_len = 0;
9506 retval = fcntl(fd, F_SETLK, &flock);
9508 (retval < 0 ? exit(2) : exit(0));
9514 echo "Checking if fcntl-based file locking works... "
9518 if eval $compile_ok; then
9520 echo "Yes, it seems to work."
9523 echo "Nope, it didn't work."
9527 echo "I'm unable to compile the test program, so I'll assume not."
9532 echo "Nope, since you don't even have fcntl()."
9535 set d_fcntl_can_lock
9540 : see if sys/select.h has to be included
9541 set sys/select.h i_sysselct
9544 : see if we should include time.h, sys/time.h, or both
9546 if test "X$timeincl" = X; then
9547 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9548 $echo $n "I'm now running the test program...$c"
9549 $cat >try.c <<'EOCP'
9550 #include <sys/types.h>
9555 #ifdef SYSTIMEKERNEL
9558 #include <sys/time.h>
9561 #include <sys/select.h>
9570 struct timezone tzp;
9572 if (foo.tm_sec == foo.tm_sec)
9575 if (bar.tv_sec == bar.tv_sec)
9582 for s_timezone in '-DS_TIMEZONE' ''; do
9584 for s_timeval in '-DS_TIMEVAL' ''; do
9585 for i_systimek in '' '-DSYSTIMEKERNEL'; do
9586 for i_time in '' '-DI_TIME'; do
9587 for i_systime in '-DI_SYSTIME' ''; do
9590 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
9591 if eval $compile; then
9592 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
9596 $echo $n "Succeeded with $flags$c"
9608 *SYSTIMEKERNEL*) i_systimek="$define"
9609 timeincl=`./findhdr sys/time.h`
9610 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
9611 *) i_systimek="$undef";;
9614 *I_TIME*) i_time="$define"
9615 timeincl=`./findhdr time.h`" $timeincl"
9616 echo "We'll include <time.h>." >&4;;
9617 *) i_time="$undef";;
9620 *I_SYSTIME*) i_systime="$define"
9621 timeincl=`./findhdr sys/time.h`" $timeincl"
9622 echo "We'll include <sys/time.h>." >&4;;
9623 *) i_systime="$undef";;
9628 : check for fd_set items
9631 Checking to see how well your C compiler handles fd_set and friends ...
9633 $cat >fd_set.c <<EOCP
9634 #$i_systime I_SYS_TIME
9635 #$i_sysselct I_SYS_SELECT
9636 #$d_socket HAS_SOCKET
9637 #include <sys/types.h>
9639 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
9642 #include <sys/time.h>
9645 #include <sys/select.h>
9654 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
9661 set fd_set -DTRYBITS
9662 if eval $compile; then
9663 d_fds_bits="$define"
9665 echo "Well, your system knows about the normal fd_set typedef..." >&4
9667 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
9668 d_fd_macros="$define"
9671 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
9673 d_fd_macros="$undef"
9677 Hmm, your compiler has some difficulty with fd_set. Checking further...
9680 if eval $compile; then
9683 echo "Well, your system has some sort of fd_set available..." >&4
9685 echo "and you have the normal fd_set macros." >&4
9686 d_fd_macros="$define"
9689 but not the normal fd_set macros! Gross! More work for me...
9691 d_fd_macros="$undef"
9694 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
9697 d_fd_macros="$undef"
9702 : see if fgetpos exists
9703 set fgetpos d_fgetpos
9706 : see if flock exists
9710 : see if fork exists
9714 : see if pathconf exists
9715 set pathconf d_pathconf
9718 : see if fpathconf exists
9719 set fpathconf d_fpathconf
9723 : check for fpos64_t
9725 echo "Checking to see if you have fpos64_t..." >&4
9728 int main() { fpos64_t x = 7; }
9731 if eval $compile; then
9733 echo "You have fpos64_t."
9736 echo "You do not have fpos64_t."
9738 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
9745 : see if frexpl exists
9749 : see if this is a sys/param system
9750 set sys/param.h i_sysparam
9753 : see if this is a sys/mount.h system
9754 set sys/mount.h i_sysmount
9759 echo "Checking to see if your system supports struct fs_data..." >&4
9760 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
9762 case "$d_fs_data_s" in
9763 "$define") echo "Yes, it does." ;;
9764 *) echo "No, it doesn't." ;;
9767 : see if fseeko exists
9771 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
9774 : see if fsetpos exists
9775 set fsetpos d_fsetpos
9779 : see if fstatfs exists
9780 set fstatfs d_fstatfs
9784 : see if statvfs exists
9785 set statvfs d_statvfs
9788 : see if fstatvfs exists
9789 set fstatvfs d_fstatvfs
9793 : see if fsync exists
9797 : see if ftello exists
9801 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
9804 : see if getcwd exists
9808 : see if getespwnam exists
9809 set getespwnam d_getespwnam
9813 : see if getfsstat exists
9814 set getfsstat d_getfsstat
9817 : see if getgrent exists
9818 set getgrent d_getgrent
9821 : see if gethostbyaddr exists
9822 set gethostbyaddr d_gethbyaddr
9825 : see if gethostbyname exists
9826 set gethostbyname d_gethbyname
9829 : see if gethostent exists
9830 set gethostent d_gethent
9833 : see how we will look up host name
9836 if set gethostname val -f d_gethname; eval $csym; $val; then
9837 echo 'gethostname() found.' >&4
9838 d_gethname="$define"
9841 if set uname val -f d_uname; eval $csym; $val; then
9844 uname() was found, but you're running xenix, and older versions of xenix
9845 have a broken uname(). If you don't really know whether your xenix is old
9846 enough to have a broken system call, use the default answer.
9853 rp='Is your uname() broken?'
9856 n*) d_uname="$define"; call=uname;;
9859 echo 'uname() found.' >&4
9866 case "$d_gethname" in
9867 '') d_gethname="$undef";;
9870 '') d_uname="$undef";;
9872 case "$d_uname$d_gethname" in
9877 Every now and then someone has a $call() that lies about the hostname
9878 but can't be fixed for political or economic reasons. If you wish, I can
9879 pretend $call() isn't there and maybe compute hostname at run-time
9880 thanks to the '$phostname' command.
9883 rp="Shall I ignore $call() from now on?"
9886 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
9889 case "$phostname" in
9891 *) case "$aphostname" in
9897 file=`./loc $file $file $pth`
9898 aphostname=`echo $file $*`
9903 case "$d_uname$d_gethname" in
9906 case "$phostname" in
9908 echo "There will be no way for $package to get your hostname." >&4;;
9910 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
9914 case "$d_phostname" in
9915 '') d_phostname="$undef";;
9918 : see if this is a netdb.h system
9922 : see if prototypes for various gethostxxx netdb.h functions are available
9924 set d_gethostprotos gethostent $i_netdb netdb.h
9927 : see if getitimer exists
9928 set getitimer d_getitimer
9931 : see if getlogin exists
9932 set getlogin d_getlogin
9935 : see if getmnt exists
9939 : see if getmntent exists
9940 set getmntent d_getmntent
9943 : see if getnetbyaddr exists
9944 set getnetbyaddr d_getnbyaddr
9947 : see if getnetbyname exists
9948 set getnetbyname d_getnbyname
9951 : see if getnetent exists
9952 set getnetent d_getnent
9955 : see if prototypes for various getnetxxx netdb.h functions are available
9957 set d_getnetprotos getnetent $i_netdb netdb.h
9960 : see if getpagesize exists
9961 set getpagesize d_getpagsz
9965 : see if getprotobyname exists
9966 set getprotobyname d_getpbyname
9969 : see if getprotobynumber exists
9970 set getprotobynumber d_getpbynumber
9973 : see if getprotoent exists
9974 set getprotoent d_getpent
9977 : see if getpgid exists
9978 set getpgid d_getpgid
9981 : see if getpgrp2 exists
9982 set getpgrp2 d_getpgrp2
9985 : see if getppid exists
9986 set getppid d_getppid
9989 : see if getpriority exists
9990 set getpriority d_getprior
9993 : see if prototypes for various getprotoxxx netdb.h functions are available
9995 set d_getprotoprotos getprotoent $i_netdb netdb.h
9998 : see if getprpwnam exists
9999 set getprpwnam d_getprpwnam
10002 : see if getpwent exists
10003 set getpwent d_getpwent
10007 : see if getservbyname exists
10008 set getservbyname d_getsbyname
10011 : see if getservbyport exists
10012 set getservbyport d_getsbyport
10015 : see if getservent exists
10016 set getservent d_getsent
10019 : see if prototypes for various getservxxx netdb.h functions are available
10021 set d_getservprotos getservent $i_netdb netdb.h
10024 : see if getspnam exists
10025 set getspnam d_getspnam
10028 : see if gettimeofday or ftime exists
10029 set gettimeofday d_gettimeod
10031 case "$d_gettimeod" in
10037 val="$undef"; set d_ftime; eval $setvar
10040 case "$d_gettimeod$d_ftime" in
10043 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
10047 : see if this is an grp system
10053 xxx=`./findhdr grp.h`
10054 $cppstdin $cppflags $cppminus < $xxx >$$.h
10056 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
10068 set d_grpasswd; eval $setvar
10072 : see if hasmntopt exists
10073 set hasmntopt d_hasmntopt
10076 : see if this is a netinet/in.h or sys/in.h system
10077 set netinet/in.h i_niin sys/in.h i_sysin
10080 : see if arpa/inet.h has to be included
10081 set arpa/inet.h i_arpainet
10084 : see if htonl --and friends-- exists
10089 : Maybe they are macros.
10092 $cat >htonl.c <<EOM
10094 #include <sys/types.h>
10095 #$i_niin I_NETINET_IN
10097 #$i_arpainet I_ARPA_INET
10098 #ifdef I_NETINET_IN
10099 #include <netinet/in.h>
10102 #include <sys/in.h>
10105 #include <arpa/inet.h>
10108 printf("Defined as a macro.");
10111 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
10112 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
10114 echo "But it seems to be defined as a macro." >&4
10122 : see if iconv exists
10128 if set index val -f; eval $csym; $val; then
10129 if set strchr val -f d_strchr; eval $csym; $val; then
10130 if $contains strchr "$strings" >/dev/null 2>&1 ; then
10133 echo "strchr() found." >&4
10137 echo "index() found." >&4
10142 echo "index() found." >&4
10145 if set strchr val -f d_strchr; eval $csym; $val; then
10148 echo "strchr() found." >&4
10150 echo "No index() or strchr() found!" >&4
10155 set d_strchr; eval $setvar
10157 set d_index; eval $setvar
10159 : check whether inet_aton exists
10160 set inet_aton d_inetaton
10165 $cat >isascii.c <<'EOCP'
10177 if eval $compile; then
10178 echo "isascii() found." >&4
10181 echo "isascii() NOT found." >&4
10188 : see if isnan exists
10192 : see if isnanl exists
10193 set isnanl d_isnanl
10196 : see if killpg exists
10197 set killpg d_killpg
10200 : see if lchown exists
10202 $cat > try.c <<'EOCP'
10203 /* System header to define __stub macros and hopefully few prototypes,
10204 which can conflict with char lchown(); below. */
10205 #include <assert.h>
10206 /* Override any gcc2 internal prototype to avoid an error. */
10207 /* We use char because int might match the return type of a gcc2
10208 builtin and then its argument prototype would still apply. */
10211 /* The GNU C library defines this for functions which it implements
10212 to always fail with ENOSYS. Some functions are actually named
10213 something starting with __ and the normal name is an alias. */
10214 #if defined (__stub_lchown) || defined (__stub___lchown)
10222 if eval $compile; then
10223 $echo "lchown() found." >&4
10226 $echo "lchown() NOT found." >&4
10232 : See if number of significant digits in a double precision number is known
10234 $cat >ldbl_dig.c <<EOM
10235 #$i_limits I_LIMITS
10238 #include <limits.h>
10244 printf("Contains LDBL_DIG");
10247 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
10248 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
10249 echo "LDBL_DIG found." >&4
10252 echo "LDBL_DIG NOT found." >&4
10259 : see if link exists
10263 : see if localeconv exists
10264 set localeconv d_locconv
10267 : see if lockf exists
10271 : see if prototype for lseek is available
10273 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
10276 : see if lstat exists
10280 : see if madvise exists
10281 set madvise d_madvise
10284 : see if mblen exists
10288 : see if mbstowcs exists
10289 set mbstowcs d_mbstowcs
10292 : see if mbtowc exists
10293 set mbtowc d_mbtowc
10296 : see if memchr exists
10297 set memchr d_memchr
10300 : see if memcmp exists
10301 set memcmp d_memcmp
10304 : see if memcpy exists
10305 set memcpy d_memcpy
10308 : see if memmove exists
10309 set memmove d_memmove
10312 : see if memset exists
10313 set memset d_memset
10316 : see if mkdir exists
10320 : see if mkdtemp exists
10321 set mkdtemp d_mkdtemp
10324 : see if mkfifo exists
10325 set mkfifo d_mkfifo
10328 : see if mkstemp exists
10329 set mkstemp d_mkstemp
10332 : see if mkstemps exists
10333 set mkstemps d_mkstemps
10336 : see if mktime exists
10337 set mktime d_mktime
10340 : see if this is a sys/mman.h system
10341 set sys/mman.h i_sysmman
10344 : see if mmap exists
10347 : see what shmat returns
10348 : default to something harmless
10350 case "$i_sysmman$d_mmap" in
10352 $cat >mmap.c <<'END'
10353 #include <sys/mman.h>
10356 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
10361 echo "and it returns ($mmaptype)." >&4
10367 : see if modfl exists
10371 : see if mprotect exists
10372 set mprotect d_mprotect
10375 : see if msgctl exists
10376 set msgctl d_msgctl
10379 : see if msgget exists
10380 set msgget d_msgget
10383 : see if msgsnd exists
10384 set msgsnd d_msgsnd
10387 : see if msgrcv exists
10388 set msgrcv d_msgrcv
10391 : see how much of the 'msg*(2)' library is present.
10394 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
10395 *"$undef"*) h_msg=false;;
10399 case "`ipcs 2>&1`" in
10400 "SVID messages"*"not configured"*)
10401 echo "Your $osname does not have the msg*(2) configured." >&4
10404 set msgctl d_msgctl
10406 set msgget d_msgget
10408 set msgsnd d_msgsnd
10410 set msgrcv d_msgrcv
10416 : we could also check for sys/ipc.h ...
10417 if $h_msg && $test `./findhdr sys/msg.h`; then
10418 echo "You have the full msg*(2) library." >&4
10421 echo "You don't have the full msg*(2) library." >&4
10429 echo "Checking to see if your system supports struct msghdr..." >&4
10430 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
10432 case "$d_msghdr_s" in
10433 "$define") echo "Yes, it does." ;;
10434 *) echo "No, it doesn't." ;;
10438 : see if msync exists
10442 : see if munmap exists
10443 set munmap d_munmap
10446 : see if nice exists
10450 : check for length of character
10452 case "$charsize" in
10454 echo "Checking to see how big your characters are (hey, you never know)..." >&4
10455 $cat >try.c <<'EOCP'
10459 printf("%d\n", (int)sizeof(char));
10464 if eval $compile_ok; then
10468 echo "(I can't seem to compile the test program. Guessing...)"
10475 rp="What is the size of a character (in bytes)?"
10480 : check for volatile keyword
10482 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
10483 $cat >try.c <<'EOCP'
10486 typedef struct _goo_struct goo_struct;
10487 goo_struct * volatile goo = ((goo_struct *)0);
10488 struct _goo_struct {
10493 typedef unsigned short foo_t;
10494 char *volatile foo;
10496 volatile foo_t blech;
10500 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
10502 echo "Yup, it does."
10505 echo "Nope, it doesn't."
10513 $echo "Choosing the C types to be used for Perl's internal types..." >&4
10515 case "$use64bitint:$d_quad:$quadtype" in
10518 uvtype="$uquadtype"
10523 uvtype="unsigned long"
10529 case "$uselongdouble:$d_longdbl" in
10531 nvtype="long double"
10532 nvsize=$longdblsize
10539 $echo "(IV will be "$ivtype", $ivsize bytes)"
10540 $echo "(UV will be "$uvtype", $uvsize bytes)"
10541 $echo "(NV will be "$nvtype", $nvsize bytes)"
10544 #$i_inttypes I_INTTYPES
10546 #include <inttypes.h>
10551 int8_t i = INT8_MAX;
10552 uint8_t u = UINT8_MAX;
10553 printf("int8_t\n");
10556 int16_t i = INT16_MAX;
10557 uint16_t i = UINT16_MAX;
10558 printf("int16_t\n");
10561 int32_t i = INT32_MAX;
10562 uint32_t u = UINT32_MAX;
10563 printf("int32_t\n");
10569 '') case "$charsize" in
10571 u8type="unsigned char"
10580 if eval $compile; then
10581 case "`./try$exe_ext`" in
10582 int8_t) i8type=int8_t
10592 '') if $test $charsize -ge 1; then
10594 u8type="unsigned char"
10602 '') case "$shortsize" in
10604 u16type="unsigned short"
10612 '') set try -DINT16
10613 if eval $compile; then
10614 case "`./try$exe_ext`" in
10626 '') if $test $shortsize -ge 2; then
10628 u16type="unsigned short"
10636 '') case "$longsize" in
10638 u32type="unsigned long"
10642 *) case "$intsize" in
10644 u32type="unsigned int"
10654 '') set try -DINT32
10655 if eval $compile; then
10656 case "`./try$exe_ext`" in
10668 '') if $test $intsize -ge 4; then
10670 u32type="unsigned int"
10678 '') case "$d_quad:$quadtype" in
10680 i64type="$quadtype"
10681 u64type="$uquadtype"
10689 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
10690 : volatile so that the compiler has to store it out to memory.
10691 if test X"$d_volatile" = X"$define"; then
10696 #include <sys/types.h>
10697 #include <signal.h>
10699 $volatile int bletched = 0;
10700 $signal_t blech(s) int s; { bletched = 1; }
10705 int n = 8 * $uvsize;
10708 signal(SIGFPE, blech);
10711 for (i = 0; i < n; i++) {
10712 u = u << 1 | ($uvtype)1;
10714 if (($uvtype)d != u)
10718 d = ($nvtype)(u - 1);
10719 if (($uvtype)d != (u - 1))
10727 printf("%d\n", ((i == n) ? -n : i));
10733 d_nv_preserves_uv="$undef"
10734 if eval $compile; then
10735 d_nv_preserves_uv_bits="`./try$exe_ext`"
10737 case "$d_nv_preserves_uv_bits" in
10739 d_nv_preserves_uv_bits=`expr 0 - $d_nv_preserves_uv_bits`
10740 $echo "Your NVs can preserve all $d_nv_preserves_uv_bits bits of your UVs." 2>&1
10741 d_nv_preserves_uv="$define"
10743 [1-9]*) $echo "Your NVs can preserve only $d_nv_preserves_uv_bits bits of your UVs." 2>&1
10744 d_nv_preserves_uv="$undef" ;;
10745 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
10746 d_nv_preserves_uv_bits="$undef" ;;
10752 : check for off64_t
10754 echo "Checking to see if you have off64_t..." >&4
10756 #include <sys/types.h>
10757 #include <unistd.h>
10758 int main() { off64_t x = 7; }
10761 if eval $compile; then
10763 echo "You have off64_t."
10766 echo "You do not have off64_t."
10767 case "$lseeksize" in
10768 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
10775 : see if POSIX threads are available
10776 set pthread.h i_pthread
10782 : how to create joinable pthreads
10783 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
10785 echo "Checking what constant to use for creating joinable pthreads..." >&4
10786 $cat >try.c <<'EOCP'
10787 #include <pthread.h>
10789 int detachstate = JOINABLE;
10792 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
10793 if eval $compile; then
10794 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
10795 val="$undef" # Yes, undef.
10796 set d_old_pthread_create_joinable
10799 set old_pthread_create_joinable
10802 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
10803 if eval $compile; then
10804 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
10806 set d_old_pthread_create_joinable
10808 val=PTHREAD_CREATE_UNDETACHED
10809 set old_pthread_create_joinable
10812 set try -DJOINABLE=__UNDETACHED
10813 if eval $compile; then
10814 echo "You seem to use __UNDETACHED." >&4
10816 set d_old_pthread_create_joinable
10819 set old_pthread_create_joinable
10822 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
10824 set d_old_pthread_create_joinable
10827 set old_pthread_create_joinable
10834 d_old_pthread_create_joinable="$undef"
10835 old_pthread_create_joinable=""
10838 : see if pause exists
10842 : see if pipe exists
10846 : see if poll exists
10851 : see whether the various POSIXish _yields exist
10853 #include <pthread.h>
10859 #ifdef PTHREAD_YIELD
10862 #ifdef PTHREAD_YIELD_NULL
10863 pthread_yield(NULL);
10869 : see if sched_yield exists
10870 set try -DSCHED_YIELD
10871 if eval $compile; then
10873 sched_yield='sched_yield()'
10877 case "$usethreads" in
10880 $define) echo 'sched_yield() found.' >&4 ;;
10881 *) echo 'sched_yield() NOT found.' >&4 ;;
10887 : see if pthread_yield exists
10888 set try -DPTHREAD_YIELD
10889 if eval $compile; then
10891 case "$sched_yield" in
10892 '') sched_yield='pthread_yield()' ;;
10895 set try -DPTHREAD_YIELD_NULL
10896 if eval $compile; then
10898 case "$sched_yield" in
10899 '') sched_yield='pthread_yield(NULL)' ;;
10905 case "$usethreads" in
10908 $define) echo 'pthread_yield() found.' >&4 ;;
10909 *) echo 'pthread_yield() NOT found.' >&4 ;;
10913 set d_pthread_yield
10916 case "$sched_yield" in
10917 '') sched_yield=undef ;;
10922 : see if this is a pwd.h system
10928 xxx=`./findhdr pwd.h`
10929 $cppstdin $cppflags $cppminus < $xxx >$$.h
10931 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
10939 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
10947 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
10955 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
10963 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
10971 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
10979 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
10987 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
10999 set d_pwquota; eval $setvar
11000 set d_pwage; eval $setvar
11001 set d_pwchange; eval $setvar
11002 set d_pwclass; eval $setvar
11003 set d_pwexpire; eval $setvar
11004 set d_pwcomment; eval $setvar
11005 set d_pwgecos; eval $setvar
11006 set d_pwpasswd; eval $setvar
11010 : see if readdir and friends exist
11011 set readdir d_readdir
11013 set seekdir d_seekdir
11015 set telldir d_telldir
11017 set rewinddir d_rewinddir
11020 : see if readlink exists
11021 set readlink d_readlink
11024 : see if readv exists
11028 : see if recvmsg exists
11029 set recvmsg d_recvmsg
11032 : see if rename exists
11033 set rename d_rename
11036 : see if rmdir exists
11040 : see if memory.h is available.
11045 : See if it conflicts with string.h
11051 $cppstdin $cppflags $cppminus < $strings > mem.h
11052 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
11054 echo "We won't be including <memory.h>."
11064 : can bcopy handle overlapping blocks?
11069 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
11071 #$i_memory I_MEMORY
11072 #$i_stdlib I_STDLIB
11073 #$i_string I_STRING
11074 #$i_unistd I_UNISTD
11076 $cat >>try.c <<'EOCP'
11079 # include <memory.h>
11082 # include <stdlib.h>
11085 # include <string.h>
11087 # include <strings.h>
11090 # include <unistd.h> /* Needed for NetBSD */
11094 char buf[128], abc[128];
11100 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
11102 for (align = 7; align >= 0; align--) {
11103 for (len = 36; len; len--) {
11105 bcopy(abc, b, len);
11106 for (off = 1; off <= len; off++) {
11107 bcopy(b, b+off, len);
11108 bcopy(b+off, b, len);
11109 if (bcmp(b, abc, len))
11118 if eval $compile_ok; then
11119 if ./try 2>/dev/null; then
11120 echo "Yes, it can."
11123 echo "It can't, sorry."
11124 case "$d_memmove" in
11125 "$define") echo "But that's Ok since you have memmove()." ;;
11129 echo "(I can't compile the test program, so we'll assume not...)"
11130 case "$d_memmove" in
11131 "$define") echo "But that's Ok since you have memmove()." ;;
11136 $rm -f try.* try core
11140 : can memcpy handle overlapping blocks?
11142 case "$d_memcpy" in
11145 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
11147 #$i_memory I_MEMORY
11148 #$i_stdlib I_STDLIB
11149 #$i_string I_STRING
11150 #$i_unistd I_UNISTD
11152 $cat >>try.c <<'EOCP'
11155 # include <memory.h>
11158 # include <stdlib.h>
11161 # include <string.h>
11163 # include <strings.h>
11166 # include <unistd.h> /* Needed for NetBSD */
11170 char buf[128], abc[128];
11176 /* Copy "abcde..." string to char abc[] so that gcc doesn't
11177 try to store the string in read-only memory. */
11178 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
11180 for (align = 7; align >= 0; align--) {
11181 for (len = 36; len; len--) {
11183 memcpy(b, abc, len);
11184 for (off = 1; off <= len; off++) {
11185 memcpy(b+off, b, len);
11186 memcpy(b, b+off, len);
11187 if (memcmp(b, abc, len))
11196 if eval $compile_ok; then
11197 if ./try 2>/dev/null; then
11198 echo "Yes, it can."
11201 echo "It can't, sorry."
11202 case "$d_memmove" in
11203 "$define") echo "But that's Ok since you have memmove()." ;;
11207 echo "(I can't compile the test program, so we'll assume not...)"
11208 case "$d_memmove" in
11209 "$define") echo "But that's Ok since you have memmove()." ;;
11214 $rm -f try.* try core
11218 : can memcmp be trusted to compare relative magnitude?
11220 case "$d_memcmp" in
11223 echo "Checking if your memcmp() can compare relative magnitude..." >&4
11225 #$i_memory I_MEMORY
11226 #$i_stdlib I_STDLIB
11227 #$i_string I_STRING
11228 #$i_unistd I_UNISTD
11230 $cat >>try.c <<'EOCP'
11233 # include <memory.h>
11236 # include <stdlib.h>
11239 # include <string.h>
11241 # include <strings.h>
11244 # include <unistd.h> /* Needed for NetBSD */
11250 if ((a < b) && memcmp(&a, &b, 1) < 0)
11256 if eval $compile_ok; then
11257 if ./try 2>/dev/null; then
11258 echo "Yes, it can."
11261 echo "No, it can't (it uses signed chars)."
11264 echo "(I can't compile the test program, so we'll assume not...)"
11268 $rm -f try.* try core
11272 : see if prototype for sbrk is available
11274 set d_sbrkproto sbrk $i_unistd unistd.h
11277 : see if select exists
11278 set select d_select
11281 : see if semctl exists
11282 set semctl d_semctl
11285 : see if semget exists
11286 set semget d_semget
11289 : see if semop exists
11293 : see how much of the 'sem*(2)' library is present.
11296 case "$d_semctl$d_semget$d_semop" in
11297 *"$undef"*) h_sem=false;;
11301 case "`ipcs 2>&1`" in
11302 "SVID messages"*"not configured"*)
11303 echo "Your $osname does not have the sem*(2) configured." >&4
11306 set semctl d_semctl
11308 set semget d_semget
11316 : we could also check for sys/ipc.h ...
11317 if $h_sem && $test `./findhdr sys/sem.h`; then
11318 echo "You have the full sem*(2) library." >&4
11321 echo "You don't have the full sem*(2) library." >&4
11327 : see whether sys/sem.h defines union semun
11329 $cat > try.c <<'END'
11330 #include <sys/types.h>
11331 #include <sys/ipc.h>
11332 #include <sys/sem.h>
11333 int main () { union semun semun; semun.buf = 0; }
11336 if eval $compile; then
11337 echo "You have union semun in <sys/sem.h>." >&4
11340 echo "You do not have union semun in <sys/sem.h>." >&4
11343 $rm -f try try.c try.h
11347 : see how to do semctl IPC_STAT
11350 : see whether semctl IPC_STAT can use union semun
11355 # define S_IRUSR S_IREAD
11356 # define S_IWUSR S_IWRITE
11357 # define S_IXUSR S_IEXEC
11359 # define S_IRUSR 0400
11360 # define S_IWUSR 0200
11361 # define S_IXUSR 0100
11363 # define S_IRGRP (S_IRUSR>>3)
11364 # define S_IWGRP (S_IWUSR>>3)
11365 # define S_IXGRP (S_IXUSR>>3)
11366 # define S_IROTH (S_IRUSR>>6)
11367 # define S_IWOTH (S_IWUSR>>6)
11368 # define S_IXOTH (S_IXUSR>>6)
11371 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
11372 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
11373 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
11378 #include <sys/types.h>
11379 #include <sys/ipc.h>
11380 #include <sys/sem.h>
11381 #include <sys/stat.h>
11388 #$d_union_semun HAS_UNION_SEMUN
11391 #ifndef HAS_UNION_SEMUN
11394 struct semid_ds *buf;
11395 unsigned short *array;
11401 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
11402 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
11404 struct semid_ds argbuf;
11407 st = semctl(sem, 0, IPC_STAT, arg);
11411 # endif /* IPC_STAT */
11412 printf("semctl IPC_STAT failed: errno = %d\n", errno);
11414 if (semctl(sem, 0, IPC_RMID, arg) != 0)
11415 # endif /* IPC_RMID */
11416 printf("semctl IPC_RMID failed: errno = %d\n", errno);
11418 #endif /* IPC_PRIVATE && ... */
11419 printf("semget failed: errno = %d\n", errno);
11425 if eval $compile; then
11428 semun) val="$define" ;;
11434 case "$d_semctl_semun" in
11436 echo "You can use union semun for semctl IPC_STAT." >&4
11439 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
11444 : see whether semctl IPC_STAT can use struct semid_ds pointer
11445 $cat > try.c <<'END'
11446 #include <sys/types.h>
11447 #include <sys/ipc.h>
11448 #include <sys/sem.h>
11449 #include <sys/stat.h>
11457 struct semid_ds arg;
11460 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
11461 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
11464 st = semctl(sem, 0, IPC_STAT, &arg);
11466 printf("semid_ds\n");
11468 # endif /* IPC_STAT */
11469 printf("semctl IPC_STAT failed: errno = %d\n", errno);
11471 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
11472 # endif /* IPC_RMID */
11473 printf("semctl IPC_RMID failed: errno = %d\n", errno);
11475 #endif /* IPC_PRIVATE && ... */
11476 printf("semget failed: errno = %d\n", errno);
11483 if eval $compile; then
11486 semid_ds) val="$define" ;;
11490 set d_semctl_semid_ds
11492 case "$d_semctl_semid_ds" in
11494 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
11496 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
11503 # We do not have the full sem*(2) library, so assume we can not
11509 set d_semctl_semid_ds
11514 : see if sendmsg exists
11515 set sendmsg d_sendmsg
11518 : see if setegid exists
11519 set setegid d_setegid
11522 : see if seteuid exists
11523 set seteuid d_seteuid
11526 : see if setgrent exists
11527 set setgrent d_setgrent
11530 : see if sethostent exists
11531 set sethostent d_sethent
11534 : see if setitimer exists
11535 set setitimer d_setitimer
11538 : see if setlinebuf exists
11539 set setlinebuf d_setlinebuf
11542 : see if setlocale exists
11543 set setlocale d_setlocale
11546 : see if setnetent exists
11547 set setnetent d_setnent
11550 : see if setprotoent exists
11551 set setprotoent d_setpent
11554 : see if setpgid exists
11555 set setpgid d_setpgid
11558 : see if setpgrp2 exists
11559 set setpgrp2 d_setpgrp2
11562 : see if setpriority exists
11563 set setpriority d_setprior
11566 : see if setproctitle exists
11567 set setproctitle d_setproctitle
11570 : see if setpwent exists
11571 set setpwent d_setpwent
11574 : see if setregid exists
11575 set setregid d_setregid
11577 set setresgid d_setresgid
11580 : see if setreuid exists
11581 set setreuid d_setreuid
11583 set setresuid d_setresuid
11586 : see if setrgid exists
11587 set setrgid d_setrgid
11590 : see if setruid exists
11591 set setruid d_setruid
11594 : see if setservent exists
11595 set setservent d_setsent
11598 : see if setsid exists
11599 set setsid d_setsid
11602 : see if setvbuf exists
11603 set setvbuf d_setvbuf
11606 : see if sfio.h is available
11611 : see if sfio library is available
11622 : Ok, but do we want to use it.
11626 true|$define|[yY]*) dflt='y';;
11629 echo "$package can use the sfio library, but it is experimental."
11630 case "$useperlio" in
11632 echo "For sfio also the PerlIO abstraction layer is needed."
11633 echo "Earlier you said you wouldn't want that."
11636 rp="You seem to have sfio available, do you want to try using it?"
11639 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
11640 useperlio="$define"
11643 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
11648 *) case "$usesfio" in
11649 true|$define|[yY]*)
11650 echo "Sorry, cannot find sfio on this machine." >&4
11651 echo "Ignoring your setting of usesfio=$usesfio." >&4
11660 $define) usesfio='true';;
11661 *) usesfio='false';;
11665 *) : Remove sfio from list of libraries to use
11666 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
11669 echo "libs = $libs" >&4
11674 : see if shmctl exists
11675 set shmctl d_shmctl
11678 : see if shmget exists
11679 set shmget d_shmget
11682 : see if shmat exists
11685 : see what shmat returns
11688 $cat >shmat.c <<'END'
11689 #include <sys/shm.h>
11692 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
11697 echo "and it returns ($shmattype)." >&4
11698 : see if a prototype for shmat is available
11699 xxx=`./findhdr sys/shm.h`
11700 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
11701 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
11712 set d_shmatprototype
11715 : see if shmdt exists
11719 : see how much of the 'shm*(2)' library is present.
11722 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
11723 *"$undef"*) h_shm=false;;
11727 case "`ipcs 2>&1`" in
11728 "SVID shared memory"*"not configured"*)
11729 echo "Your $osname does not have the shm*(2) configured." >&4
11732 set shmctl d_shmctl
11734 set shmget d_shmget
11744 : we could also check for sys/ipc.h ...
11745 if $h_shm && $test `./findhdr sys/shm.h`; then
11746 echo "You have the full shm*(2) library." >&4
11749 echo "You don't have the full shm*(2) library." >&4
11756 : see if we have sigaction
11757 if set sigaction val -f d_sigaction; eval $csym; $val; then
11758 echo 'sigaction() found.' >&4
11759 $cat > try.c <<'EOP'
11761 #include <sys/types.h>
11762 #include <signal.h>
11765 struct sigaction act, oact;
11767 oact.sa_handler = 0;
11768 /* so that act and oact are used */
11769 exit(act.sa_flags == 0 && oact.sa_handler == 0);
11773 if eval $compile_ok; then
11776 echo "But you don't seem to have a useable struct sigaction." >&4
11780 echo 'sigaction NOT found.' >&4
11783 set d_sigaction; eval $setvar
11784 $rm -f try try$_o try.c
11786 : see if sigprocmask exists
11787 set sigprocmask d_sigprocmask
11790 : see if sigsetjmp exists
11792 case "$d_sigsetjmp" in
11794 $cat >try.c <<'EOP'
11795 #include <setjmp.h>
11800 if (sigsetjmp(env,1))
11803 siglongjmp(env, 1);
11808 if eval $compile; then
11809 if ./try >/dev/null 2>&1; then
11810 echo "POSIX sigsetjmp found." >&4
11814 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
11820 echo "sigsetjmp not found." >&4
11824 *) val="$d_sigsetjmp"
11825 case "$d_sigsetjmp" in
11826 $define) echo "POSIX sigsetjmp found." >&4;;
11827 $undef) echo "sigsetjmp not found." >&4;;
11835 : see if sockatmark exists
11836 set sockatmark d_sockatmark
11839 : see if socks5_init exists
11840 set socks5_init d_socks5_init
11843 : see if sys/stat.h is available
11844 set sys/stat.h i_sysstat
11848 : see if stat knows about block sizes
11850 echo "Checking to see if your struct stat has st_blocks field..." >&4
11851 set d_statblks stat st_blocks $i_sysstat sys/stat.h
11855 : see if this is a sys/vfs.h system
11856 set sys/vfs.h i_sysvfs
11860 : see if this is a sys/statfs.h system
11861 set sys/statfs.h i_sysstatfs
11866 echo "Checking to see if your system supports struct statfs..." >&4
11867 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
11869 case "$d_statfs_s" in
11870 "$define") echo "Yes, it does." ;;
11871 *) echo "No, it doesn't." ;;
11876 : see if struct statfs knows about f_flags
11877 case "$d_statfs_s" in
11880 echo "Checking to see if your struct statfs has f_flags field..." >&4
11881 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
11885 set d_statfs_f_flags
11889 case "$d_statfs_f_flags" in
11890 "$define") echo "Yes, it does." ;;
11891 *) echo "No, it doesn't." ;;
11894 : see if _ptr and _cnt from stdio act std
11897 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
11898 echo "(Looks like you have stdio.h from BSD.)"
11899 case "$stdio_ptr" in
11900 '') stdio_ptr='((fp)->_p)'
11903 *) ptr_lval=$d_stdio_ptr_lval;;
11905 case "$stdio_cnt" in
11906 '') stdio_cnt='((fp)->_r)'
11909 *) cnt_lval=$d_stdio_cnt_lval;;
11911 case "$stdio_base" in
11912 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
11914 case "$stdio_bufsiz" in
11915 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
11917 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
11918 echo "(Looks like you have stdio.h from Linux.)"
11919 case "$stdio_ptr" in
11920 '') stdio_ptr='((fp)->_IO_read_ptr)'
11923 *) ptr_lval=$d_stdio_ptr_lval;;
11925 case "$stdio_cnt" in
11926 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
11929 *) cnt_lval=$d_stdio_cnt_lval;;
11931 case "$stdio_base" in
11932 '') stdio_base='((fp)->_IO_read_base)';;
11934 case "$stdio_bufsiz" in
11935 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
11938 case "$stdio_ptr" in
11939 '') stdio_ptr='((fp)->_ptr)'
11942 *) ptr_lval=$d_stdio_ptr_lval;;
11944 case "$stdio_cnt" in
11945 '') stdio_cnt='((fp)->_cnt)'
11948 *) cnt_lval=$d_stdio_cnt_lval;;
11950 case "$stdio_base" in
11951 '') stdio_base='((fp)->_base)';;
11953 case "$stdio_bufsiz" in
11954 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
11958 : test whether _ptr and _cnt really work
11959 echo "Checking how std your stdio is..." >&4
11962 #define FILE_ptr(fp) $stdio_ptr
11963 #define FILE_cnt(fp) $stdio_cnt
11965 FILE *fp = fopen("try.c", "r");
11968 18 <= FILE_cnt(fp) &&
11969 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
11977 if eval $compile; then
11979 echo "Your stdio acts pretty std."
11982 echo "Your stdio isn't very std."
11985 echo "Your stdio doesn't appear very std."
11991 : Can _ptr be used as an lvalue?
11992 case "$d_stdstdio$ptr_lval" in
11993 $define$define) val=$define ;;
11996 set d_stdio_ptr_lval
11999 : Can _cnt be used as an lvalue?
12000 case "$d_stdstdio$cnt_lval" in
12001 $define$define) val=$define ;;
12004 set d_stdio_cnt_lval
12008 : test whether setting _ptr sets _cnt as a side effect
12009 d_stdio_ptr_lval_sets_cnt="$undef"
12010 d_stdio_ptr_lval_nochange_cnt="$undef"
12011 case "$d_stdio_ptr_lval$d_stdstdio" in
12013 echo "Checking to see what happens if we set the stdio ptr..." >&4
12016 /* Can we scream? */
12017 /* Eat dust sed :-) */
12018 /* In the buffer space, no one can hear you scream. */
12019 #define FILE_ptr(fp) $stdio_ptr
12020 #define FILE_cnt(fp) $stdio_cnt
12021 #include <sys/types.h>
12023 FILE *fp = fopen("try.c", "r");
12028 puts("Fail even to read");
12031 c = getc(fp); /* Read away the first # */
12033 puts("Fail even to read");
12037 18 <= FILE_cnt(fp) &&
12038 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12040 puts("Fail even to read");
12043 ptr = (char*) FILE_ptr(fp);
12044 cnt = (size_t)FILE_cnt(fp);
12046 FILE_ptr(fp) += 42;
12048 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12049 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12052 if (FILE_cnt(fp) <= 20) {
12053 printf ("Fail (<20 chars to test)");
12056 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12057 puts("Fail compare");
12060 if (cnt == FILE_cnt(fp)) {
12061 puts("Pass_unchanged");
12064 if (FILE_cnt(fp) == (cnt - 42)) {
12065 puts("Pass_changed");
12068 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12074 if eval $compile; then
12075 case `./try$exe_ext` in
12077 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12078 d_stdio_ptr_lval_sets_cnt="$define" ;;
12080 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12081 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12083 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12085 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12088 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12094 : see if _base is also standard
12096 case "$d_stdstdio" in
12100 #define FILE_base(fp) $stdio_base
12101 #define FILE_bufsiz(fp) $stdio_bufsiz
12103 FILE *fp = fopen("try.c", "r");
12106 19 <= FILE_bufsiz(fp) &&
12107 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
12114 if eval $compile; then
12116 echo "And its _base field acts std."
12119 echo "But its _base field isn't std."
12122 echo "However, it seems to be lacking the _base field."
12131 Checking how to access stdio streams by file descriptor number...
12133 case "$stdio_stream_array" in
12134 '') $cat >try.c <<EOCP
12137 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
12141 for s in _iob __iob __sF
12143 set try -DSTDIO_STREAM_ARRAY=$s
12144 if eval $compile; then
12145 case "`./try$exe_ext`" in
12146 yes) stdio_stream_array=$s; break ;;
12150 $rm -f try.* try$exe_ext
12152 case "$stdio_stream_array" in
12154 I can't figure out how to access stdio streams by file descriptor number.
12156 d_stdio_stream_array="$undef"
12159 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
12161 d_stdio_stream_array="$define"
12165 : see if strcoll exists
12166 set strcoll d_strcoll
12169 : check for structure copying
12171 echo "Checking to see if your C compiler can copy structs..." >&4
12172 $cat >try.c <<'EOCP'
12182 if $cc -c try.c >/dev/null 2>&1 ; then
12184 echo "Yup, it can."
12187 echo "Nope, it can't."
12193 : see if strerror and/or sys_errlist[] exist
12195 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
12196 if set strerror val -f d_strerror; eval $csym; $val; then
12197 echo 'strerror() found.' >&4
12198 d_strerror="$define"
12199 d_strerrm='strerror(e)'
12200 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
12201 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
12202 d_syserrlst="$define"
12204 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
12205 d_syserrlst="$undef"
12207 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
12208 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
12209 echo 'strerror() found in string header.' >&4
12210 d_strerror="$define"
12211 d_strerrm='strerror(e)'
12212 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
12213 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
12214 d_syserrlst="$define"
12216 echo "(You don't appear to have any sys_errlist[], how can this be?)"
12217 d_syserrlst="$undef"
12219 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
12220 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
12221 d_strerror="$undef"
12222 d_syserrlst="$define"
12223 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
12225 echo 'strerror() and sys_errlist[] NOT found.' >&4
12226 d_strerror="$undef"
12227 d_syserrlst="$undef"
12228 d_strerrm='"unknown"'
12232 : see if strtod exists
12233 set strtod d_strtod
12236 : see if strtol exists
12237 set strtol d_strtol
12240 : see if strtold exists
12241 set strtold d_strtold
12244 : see if strtoll exists
12245 set strtoll d_strtoll
12248 case "$d_longlong-$d_strtoll" in
12251 Checking whether your strtoll() works okay...
12253 $cat >try.c <<'EOCP'
12256 #define strtoll __strtoll
12259 #define strtoll _strtoll
12262 extern long long int strtoll(char *s, char **, int);
12263 static int bad = 0;
12264 int check(char *s, long long ell, int een) {
12267 gll = strtoll(s, 0, 10);
12268 if (!((gll == ell) && (errno == een)))
12272 check(" 1", 1LL, 0);
12273 check(" 0", 0LL, 0);
12274 check("-1", -1LL, 0);
12275 check("-9223372036854775808", -9223372036854775808LL, 0);
12276 check("-9223372036854775808", -9223372036854775808LL, 0);
12277 check(" 9223372036854775807", 9223372036854775807LL, 0);
12278 check("-9223372036854775808", -9223372036854775808LL, 0);
12279 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
12280 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
12286 if eval $compile; then
12289 ok) echo "Your strtoll() seems to be working okay." ;;
12291 Your strtoll() doesn't seem to be working okay.
12297 echo "(I can't seem to compile the test program--assuming it doesn't)"
12303 : see if strtoq exists
12304 set strtoq d_strtoq
12307 : see if strtoul exists
12308 set strtoul d_strtoul
12311 case "$d_strtoul" in
12314 Checking whether your strtoul() works okay...
12316 $cat >try.c <<'EOCP'
12319 extern unsigned long int strtoul(char *s, char **, int);
12320 static int bad = 0;
12321 void check(char *s, unsigned long eul, int een) {
12324 gul = strtoul(s, 0, 10);
12325 if (!((gul == eul) && (errno == een)))
12329 check(" 1", 1L, 0);
12330 check(" 0", 0L, 0);
12332 case "$longsize" in
12334 $cat >>try.c <<'EOCP'
12335 check("18446744073709551615", 18446744073709551615UL, 0);
12336 check("18446744073709551616", 18446744073709551615UL, ERANGE);
12337 #if 0 /* strtoul() for /^-/ strings is undefined. */
12338 check("-1", 18446744073709551615UL, 0);
12339 check("-18446744073709551614", 2, 0);
12340 check("-18446744073709551615", 1, 0);
12341 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
12342 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
12347 $cat >>try.c <<'EOCP'
12348 check("4294967295", 4294967295UL, 0);
12349 check("4294967296", 4294967295UL, ERANGE);
12350 #if 0 /* strtoul() for /^-/ strings is undefined. */
12351 check("-1", 4294967295UL, 0);
12352 check("-4294967294", 2, 0);
12353 check("-4294967295", 1, 0);
12354 check("-4294967296", 4294967295UL, ERANGE);
12355 check("-4294967297", 4294967295UL, ERANGE);
12360 : Should we write these tests to be more portable by sprintf-ing
12361 : ~0 and then manipulating that char string as input for strtol?
12364 $cat >>try.c <<'EOCP'
12371 if eval $compile; then
12373 ok) echo "Your strtoul() seems to be working okay." ;;
12375 Your strtoul() doesn't seem to be working okay.
12384 : see if strtoull exists
12385 set strtoull d_strtoull
12388 case "$d_longlong-$d_strtoull" in
12391 Checking whether your strtoull() works okay...
12393 $cat >try.c <<'EOCP'
12396 #define strtoull __strtoull
12399 extern unsigned long long int strtoull(char *s, char **, int);
12400 static int bad = 0;
12401 int check(char *s, long long eull, int een) {
12404 gull = strtoull(s, 0, 10);
12405 if (!((gull == eull) && (errno == een)))
12409 check(" 1", 1LL, 0);
12410 check(" 0", 0LL, 0);
12411 check("18446744073709551615", 18446744073709551615ULL, 0);
12412 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
12413 #if 0 /* strtoull() for /^-/ strings is undefined. */
12414 check("-1", 18446744073709551615ULL, 0);
12415 check("-18446744073709551614", 2LL, 0);
12416 check("-18446744073709551615", 1LL, 0);
12417 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
12418 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
12425 if eval $compile; then
12427 ok) echo "Your strtoull() seems to be working okay." ;;
12429 Your strtoull() doesn't seem to be working okay.
12431 d_strtoull="$undef"
12438 : see if strtouq exists
12439 set strtouq d_strtouq
12442 case "$d_strtouq" in
12445 Checking whether your strtouq() works okay...
12447 $cat >try.c <<'EOCP'
12450 extern unsigned long long int strtouq(char *s, char **, int);
12451 static int bad = 0;
12452 void check(char *s, unsigned long long eull, int een) {
12453 unsigned long long gull;
12455 gull = strtouq(s, 0, 10);
12456 if (!((gull == eull) && (errno == een)))
12460 check(" 1", 1LL, 0);
12461 check(" 0", 0LL, 0);
12462 check("18446744073709551615", 18446744073709551615ULL, 0);
12463 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
12464 #if 0 /* strtouq() for /^-/ strings is undefined. */
12465 check("-1", 18446744073709551615ULL, 0);
12466 check("-18446744073709551614", 2LL, 0);
12467 check("-18446744073709551615", 1LL, 0);
12468 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
12469 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
12477 if eval $compile; then
12479 ok) echo "Your strtouq() seems to be working okay." ;;
12481 Your strtouq() doesn't seem to be working okay.
12490 : see if strxfrm exists
12491 set strxfrm d_strxfrm
12494 : see if symlink exists
12495 set symlink d_symlink
12498 : see if syscall exists
12499 set syscall d_syscall
12502 : see if sysconf exists
12503 set sysconf d_sysconf
12506 : see if system exists
12507 set system d_system
12510 : see if tcgetpgrp exists
12511 set tcgetpgrp d_tcgetpgrp
12514 : see if tcsetpgrp exists
12515 set tcsetpgrp d_tcsetpgrp
12518 : see if prototype for telldir is available
12520 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
12523 : see if this is a sys/times.h system
12524 set sys/times.h i_systimes
12527 : see if times exists
12529 if set times val -f d_times; eval $csym; $val; then
12530 echo 'times() found.' >&4
12533 case "$i_systimes" in
12534 "$define") inc='sys/times.h';;
12536 rp="What is the type returned by times() on this system?"
12537 set clock_t clocktype long stdio.h sys/types.h $inc
12540 echo 'times() NOT found, hope that will do.' >&4
12545 : see if truncate exists
12546 set truncate d_truncate
12549 : see if tzname[] exists
12551 if set tzname val -a d_tzname; eval $csym; $val; then
12553 echo 'tzname[] found.' >&4
12556 echo 'tzname[] NOT found.' >&4
12561 case "$crosscompile" in
12562 ''|[nN]*) crosscompile="$undef" ;;
12566 next|rhapsody|darwin) multiarch="$define" ;;
12568 case "$multiarch" in
12569 ''|[nN]*) multiarch="$undef" ;;
12572 : check for ordering of bytes in a long
12574 case "$crosscompile$multiarch" in
12577 You seem to be either cross-compiling or doing a multiarchitecture build,
12578 skipping the byteorder check.
12584 case "$byteorder" in
12587 In the following, larger digits indicate more significance. A big-endian
12588 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
12589 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
12590 machines may have weird orders like 3412. A Cray will report 87654321,
12591 an Alpha will report 12345678. If the test program works the default is
12593 I'm now running the test program...
12595 $cat >try.c <<'EOCP'
12602 char c[sizeof(long)];
12605 if (sizeof(long) > 4)
12606 u.l = (0x08070605L << 32) | 0x04030201L;
12609 for (i = 0; i < sizeof(long); i++)
12610 printf("%c", u.c[i]+'0');
12617 if eval $compile && ./try > /dev/null; then
12620 [1-4][1-4][1-4][1-4]|12345678|87654321)
12621 echo "(The test program ran ok.)"
12622 echo "byteorder=$dflt"
12625 ????|????????) echo "(The test program ran ok.)" ;;
12626 *) echo "(The test program didn't run right for some reason.)" ;;
12631 (I can't seem to compile the test program. Guessing big-endian...)
12634 case "$xxx_prompt" in
12636 rp="What is the order of bytes in a long?"
12652 Checking to see whether you can access character data unalignedly...
12656 #define U32 $u32type
12657 #define BYTEORDER $byteorder
12659 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
12660 U8 buf[] = "\0\0\0\1\0\0\0\0";
12664 if (sizeof(U32) != 4) {
12665 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
12671 for (i = 0; i < 4; i++) {
12672 up = (U32*)(buf + i);
12673 if (! ((*up == 1 << (8*i)) || /* big-endian */
12674 (*up == 1 << (8*(3-i))) /* little-endian */
12678 printf("read failed (%x)\n", *up);
12684 for (i = 0; i < 4; i++) {
12685 up = (U32*)(buf + i);
12687 if (*up != 0xBeef) {
12688 printf("write failed (%x)\n", *up);
12702 if eval $compile_ok; then
12703 echo "(This test may dump core.)" >&4
12704 ./try >&2 >/dev/null
12707 You can access character data pretty unalignedly.
12709 d_u32align="$undef"
12712 It seems that you must access character data in an aligned manner.
12714 d_u32align="$define"
12717 $rm -f core core.try.* try.core
12719 rp='Can you access character data at unaligned addresses?'
12723 [yY]*) d_u32align="$undef" ;;
12724 *) d_u32align="$define" ;;
12728 : see if ualarm exists
12729 set ualarm d_ualarm
12732 : see if umask exists
12736 : see if usleep exists
12737 set usleep d_usleep
12740 : see if ustat exists
12744 : backward compatibility for d_hvfork
12745 if test X$d_hvfork != X; then
12746 d_vfork="$d_hvfork"
12749 : see if there is a vfork
12754 : Ok, but do we want to use it. vfork is reportedly unreliable in
12755 : perl on Solaris 2.x, and probably elsewhere.
12759 case "$usevfork" in
12765 Perl can only use a vfork() that doesn't suffer from strict
12766 restrictions on calling functions or modifying global data in
12767 the child. For example, glibc-2.1 contains such a vfork()
12768 that is unsuitable. If your system provides a proper fork()
12769 call, chances are that you do NOT want perl to use vfork().
12772 rp="Do you still want to use vfork()?"
12777 echo "Ok, we won't use vfork()."
12786 $define) usevfork='true';;
12787 *) usevfork='false';;
12790 : see if this is an sysdir system
12791 set sys/dir.h i_sysdir
12794 : see if this is an sysndir system
12795 set sys/ndir.h i_sysndir
12798 : see if closedir exists
12799 set closedir d_closedir
12802 case "$d_closedir" in
12805 echo "Checking whether closedir() returns a status..." >&4
12806 cat > closedir.c <<EOM
12807 #$i_dirent I_DIRENT /**/
12808 #$i_sysdir I_SYS_DIR /**/
12809 #$i_sysndir I_SYS_NDIR /**/
12810 #$i_systypes I_SYS_TYPES /**/
12812 #if defined(I_SYS_TYPES)
12813 #include <sys/types.h>
12815 #if defined(I_DIRENT)
12816 #include <dirent.h>
12817 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
12818 #include <sys/dir.h>
12822 #include <sys/ndir.h>
12826 #include <ndir.h> /* may be wrong in the future */
12828 #include <sys/dir.h>
12833 int main() { return closedir(opendir(".")); }
12836 if eval $compile_ok; then
12837 if ./closedir > /dev/null 2>&1 ; then
12838 echo "Yes, it does."
12841 echo "No, it doesn't."
12845 echo "(I can't seem to compile the test program--assuming it doesn't)"
12853 set d_void_closedir
12856 : see if there is a wait4
12860 : see if waitpid exists
12861 set waitpid d_waitpid
12864 : see if wcstombs exists
12865 set wcstombs d_wcstombs
12868 : see if wctomb exists
12869 set wctomb d_wctomb
12872 : see if writev exists
12873 set writev d_writev
12876 : preserve RCS keywords in files with variable substitution, grrr
12881 Revision='$Revision'
12883 : check for alignment requirements
12885 case "$crosscompile$multiarch" in
12888 You seem to be either cross-compiling or doing a multiarchitecture build,
12889 skipping the memory alignment check.
12892 case "$alignbytes" in
12893 '') alignbytes=8 ;;
12897 case "$alignbytes" in
12898 '') echo "Checking alignment constraints..." >&4
12899 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
12900 $cat >try.c <<'EOCP'
12901 typedef long double NV;
12904 $cat >try.c <<'EOCP'
12908 $cat >>try.c <<'EOCP'
12916 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
12921 if eval $compile_ok; then
12925 echo "(I can't seem to compile the test program...)"
12928 *) dflt="$alignbytes"
12931 rp="Doubles must be aligned on a how-many-byte boundary?"
12939 : set the base revision
12942 : how do we catenate cpp tokens here?
12944 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
12945 $cat >cpp_stuff.c <<'EOCP'
12946 #define RCAT(a,b)a/**/b
12947 #define ACAT(a,b)a ## b
12951 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
12952 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
12953 echo "Oh! Smells like ANSI's been here." >&4
12954 echo "We can catify or stringify, separately or together!"
12956 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
12957 echo "Ah, yes! The good old days!" >&4
12958 echo "However, in the good old days we don't know how to stringify and"
12959 echo "catify at the same time."
12963 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
12964 to have to edit the values of CAT[2-5] in config.h...
12966 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
12970 : see if this is a db.h system
12976 : Check db version.
12978 echo "Checking Berkeley DB version ..." >&4
12984 #include <sys/types.h>
12989 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
12990 int Major, Minor, Patch ;
12991 unsigned long Version ;
12992 (void)db_version(&Major, &Minor, &Patch) ;
12993 printf("You have Berkeley DB Version 2 or greater\n");
12995 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
12996 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
12997 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
12998 Major, Minor, Patch) ;
13000 /* check that db.h & libdb are compatible */
13001 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
13002 printf("db.h and libdb are incompatible\n") ;
13006 printf("db.h and libdb are compatible\n") ;
13008 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
13009 + DB_VERSION_PATCH ;
13011 /* needs to be >= 2.3.4 */
13012 if (Version < 2003004) {
13013 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
13014 printf("but Perl needs Berkeley DB 2.3.4 or greater\n") ;
13020 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
13021 printf("You have Berkeley DB Version 1\n");
13022 exit(0); /* DB version < 2: the coast is clear. */
13024 exit(1); /* <db.h> not Berkeley DB? */
13030 if eval $compile_ok && ./try; then
13031 echo 'Looks OK.' >&4
13033 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
13037 : Remove db from list of libraries to use
13038 echo "Removing unusable -ldb from library list" >&4
13039 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
13042 echo "libs = $libs" >&4
13052 : Check the return type needed for hash
13054 echo "Checking return type needed for hash for Berkeley DB ..." >&4
13060 #include <sys/types.h>
13063 #ifndef DB_VERSION_MAJOR
13064 u_int32_t hash_cb (ptr, size)
13072 info.hash = hash_cb;
13076 if $cc $ccflags -c try.c >try.out 2>&1 ; then
13077 if $contains warning try.out >>/dev/null 2>&1 ; then
13080 db_hashtype='u_int32_t'
13083 : XXX Maybe we should just give up here.
13084 db_hashtype=u_int32_t
13086 echo "Help: I can't seem to compile the db test program." >&4
13087 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
13090 echo "Your version of Berkeley DB uses $db_hashtype for hash."
13092 *) db_hashtype=u_int32_t
13097 : Check the return type needed for prefix
13099 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
13105 #include <sys/types.h>
13108 #ifndef DB_VERSION_MAJOR
13109 size_t prefix_cb (key1, key2)
13117 info.prefix = prefix_cb;
13121 if $cc $ccflags -c try.c >try.out 2>&1 ; then
13122 if $contains warning try.out >>/dev/null 2>&1 ; then
13123 db_prefixtype='int'
13125 db_prefixtype='size_t'
13128 db_prefixtype='size_t'
13129 : XXX Maybe we should just give up here.
13131 echo "Help: I can't seem to compile the db test program." >&4
13132 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
13135 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
13137 *) db_prefixtype='size_t'
13142 : How can we generate normalized random numbers ?
13144 echo "Looking for a random number function..." >&4
13145 case "$randfunc" in
13147 if set drand48 val -f; eval $csym; $val; then
13149 echo "Good, found drand48()." >&4
13150 elif set random val -f; eval $csym; $val; then
13152 echo "OK, found random()." >&4
13155 echo "Yick, looks like I have to use rand()." >&4
13166 *-Dmy_rand=*|*-Dmy_srand=*)
13167 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
13168 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
13169 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
13170 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
13174 while $test "$cont"; do
13175 rp="Use which function to generate random numbers?"
13177 if $test "$ans" = "$dflt"; then
13183 if set $ans val -f; eval $csym; $val; then
13187 rp="I cannot find function $ans. Use that name anyway?"
13196 case "$randfunc" in
13198 drand01="drand48()"
13204 case "$randbits" in
13206 echo "Checking to see how many bits your $randfunc() function produces..." >&4
13208 #$i_unistd I_UNISTD
13209 #$i_stdlib I_STDLIB
13212 # include <unistd.h>
13215 # include <stdlib.h>
13220 register unsigned long tmp;
13221 register unsigned long max = 0L;
13223 for (i = 1000; i; i--) {
13224 tmp = (unsigned long) $randfunc();
13225 if (tmp > max) max = tmp;
13227 for (i = 0; max; i++)
13233 if eval $compile_ok; then
13237 echo "(I can't seem to compile the test program...)"
13244 rp="How many bits does your $randfunc() function produce?"
13248 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
13249 seedfunc="s$randfunc"
13250 randseedtype=unsigned
13254 rp="How many bits does your $randfunc() function produce?"
13257 seedfunc="s$randfunc"
13258 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
13259 if set $seedfunc val -f; eval $csym; $val; then
13260 echo "(Using $seedfunc() to seed random generator)"
13262 echo "(Warning: no $seedfunc() to seed random generator)"
13265 randseedtype=unsigned
13273 echo "Determining whether or not we are on an EBCDIC system..." >&4
13274 $cat >tebcdic.c <<'EOM'
13277 if ('M'==0xd4) return 0;
13284 if eval $compile_ok; then
13286 echo "You seem to speak EBCDIC." >&4
13289 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF8." >&4
13292 echo "I'm unable to compile the test program." >&4
13293 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
13295 $rm -f tebcdic.c tebcdic
13301 Checking how to flush all pending stdio output...
13303 # I only know how to find the first 32 possibly open files on SunOS.
13304 # See also hints/sunos_4_1.sh and util.c --AD
13306 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
13308 $cat >>try.c <<EOCP
13310 #$i_unistd I_UNISTD
13312 # include <unistd.h>
13314 #$d_sysconf HAS_SYSCONF
13315 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
13316 #ifdef HAS_STDIO_STREAM_ARRAY
13317 # define STDIO_STREAM_ARRAY $stdio_stream_array
13320 FILE* p = fopen("try.out", "w");
13324 # ifdef TRY_FPRINTF
13328 #ifdef TRY_FFLUSH_NULL
13331 #ifdef TRY_FFLUSH_ALL
13333 long open_max = -1;
13334 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
13335 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
13337 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
13338 open_max = sysconf(_SC_OPEN_MAX);
13341 open_max = FOPEN_MAX;
13344 open_max = OPEN_MAX;
13353 # ifdef HAS_STDIO_STREAM_ARRAY
13354 if (open_max > 0) {
13356 for (i = 0; i < open_max; i++)
13357 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
13358 STDIO_STREAM_ARRAY[i]._file < open_max &&
13359 STDIO_STREAM_ARRAY[i]._flag)
13360 fflush(&STDIO_STREAM_ARRAY[i]);
13368 : first we have to find out how _not_ to flush
13369 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
13371 set try -DTRY_FPUTC
13372 if eval $compile; then
13374 ./try$exe_ext 2>/dev/null
13375 if $test ! -s try.out -a "X$?" = X42; then
13381 set try -DTRY_FPRINTF
13383 if eval $compile; then
13385 ./try$exe_ext 2>/dev/null
13386 if $test ! -s try.out -a "X$?" = X42; then
13387 output=-DTRY_FPRINTF
13393 : check for fflush NULL behaviour
13394 case "$fflushNULL" in
13395 '') set try -DTRY_FFLUSH_NULL $output
13396 if eval $compile; then
13398 ./try$exe_ext 2>/dev/null
13400 if $test -s try.out -a "X$code" = X42; then
13401 fflushNULL="`$cat try.out`"
13403 if $test "X$code" != X42; then
13405 (If this test failed, don't worry, we'll try another method shortly.)
13410 $rm -f core try.core core.try.*
13411 case "$fflushNULL" in
13413 Your fflush(NULL) works okay for output streams.
13414 Let's see if it clobbers input pipes...
13416 # As of mid-March 2000 all versions of Solaris appear to have a stdio
13417 # bug that improperly flushes the input end of pipes. So we avoid the
13418 # autoflush on fork/system/exec support for now. :-(
13419 $cat >tryp.c <<EOCP
13422 main(int argc, char **argv)
13428 while ((i = getc(stdin)) != -1
13429 && (*bp++ = i) != '\n'
13430 && bp < &buf[1024])
13433 fprintf(stdout, "%s", buf);
13441 fflushNULL="$define"
13443 if eval $compile; then
13445 $cat tryp.c | ./tryp$exe_ext 2>/dev/null > tryp.out
13446 if cmp tryp.c tryp.out >/dev/null 2>&1; then
13448 fflush(NULL) seems to behave okay with input streams.
13450 fflushNULL="$define"
13453 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
13455 fflushNULL="$undef"
13458 $rm -f core tryp.c tryp.core core.tryp.*
13461 Your fflush(NULL) isn't working (contrary to ANSI C).
13463 fflushNULL="$undef"
13466 Cannot figure out whether your fflush(NULL) works or not.
13467 I'm assuming it doesn't (contrary to ANSI C).
13469 fflushNULL="$undef"
13473 $define|true|[yY]*)
13474 fflushNULL="$define"
13477 fflushNULL="$undef"
13480 : check explicit looping only if NULL did not work, and if the pipe
13481 : bug does not show up on an explicit flush too
13482 case "$fflushNULL" in
13484 $cat >tryp.c <<EOCP
13487 main(int argc, char **argv)
13493 while ((i = getc(stdin)) != -1
13494 && (*bp++ = i) != '\n'
13495 && bp < &buf[1024])
13498 fprintf(stdout, "%s", buf);
13507 if eval $compile; then
13509 $cat tryp.c | ./tryp$exe_ext 2>/dev/null > tryp.out
13510 if cmp tryp.c tryp.out >/dev/null 2>&1; then
13512 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
13514 : now check for fflushall behaviour
13515 case "$fflushall" in
13516 '') set try -DTRY_FFLUSH_ALL $output
13517 if eval $compile; then
13519 (Now testing the other method--but note that this also may fail.)
13522 ./try$exe_ext 2>/dev/null
13523 if $test -s try.out -a "X$?" = X42; then
13524 fflushall="`$cat try.out`"
13527 $rm -f core try.core core.try.*
13528 case "$fflushall" in
13530 Whew. Flushing explicitly all the stdio streams works.
13532 fflushall="$define"
13535 Sigh. Flushing explicitly all the stdio streams doesn't work.
13540 Cannot figure out whether flushing stdio streams explicitly works or not.
13541 I'm assuming it doesn't.
13547 "$define"|true|[yY]*)
13548 fflushall="$define"
13556 All is futile. Even fflush(stdin) clobbers input pipes!
13563 $rm -f core tryp.c tryp.core core.tryp.*
13565 *) fflushall="$undef"
13569 case "$fflushNULL$fflushall" in
13572 OK, I give up. I cannot figure out how to flush pending stdio output.
13573 We won't be flushing handles at all before fork/exec/popen.
13577 $rm -f try.* try$exe_ext
13579 : Store the full pathname to the ar program for use in the C program
13580 : Respect a hint or command line value for full_ar.
13585 : Store the full pathname to the sed program for use in the C program
13588 : see what type gids are declared as in the kernel
13590 echo "Looking for the type for group ids returned by getgid()."
13591 set gid_t gidtype xxx stdio.h sys/types.h
13595 xxx=`./findhdr sys/user.h`
13596 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
13598 unsigned) dflt="$1 $2" ;;
13602 *) dflt="$gidtype";;
13605 gid_t) echo "gid_t found." ;;
13606 *) rp="What is the type for group ids returned by getgid()?"
13614 *_t) zzz="$gidtype" ;;
13617 echo "Checking the size of $zzz..." >&4
13619 #include <sys/types.h>
13622 printf("%d\n", (int)sizeof($gidtype));
13627 if eval $compile_ok; then
13631 echo "(I can't execute the test program--guessing $gidsize.)" >&4
13634 echo "Your $zzz is $gidsize bytes long."
13639 echo "(I can't compile the test program--guessing $gidsize.)" >&4
13645 *_t) zzz="$gidtype" ;;
13648 echo "Checking the sign of $zzz..." >&4
13650 #include <sys/types.h>
13661 if eval $compile; then
13665 echo "(I can't execute the test program--guessing unsigned.)" >&4
13669 1) echo "Your $zzz is unsigned." ;;
13670 -1) echo "Your $zzz is signed." ;;
13676 echo "(I can't compile the test program--guessing unsigned.)" >&4
13682 if $test X"$quadtype" != X; then
13684 echo "Checking how to print 64-bit integers..." >&4
13686 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
13687 $cat >try.c <<'EOCP'
13688 #include <sys/types.h>
13691 int q = 12345678901;
13692 printf("%ld\n", q);
13696 if eval $compile; then
13697 yyy=`./try$exe_ext`
13700 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
13701 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
13702 echo "We will use %d."
13708 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
13709 $cat >try.c <<'EOCP'
13710 #include <sys/types.h>
13713 long q = 12345678901;
13714 printf("%ld\n", q);
13718 if eval $compile; then
13719 yyy=`./try$exe_ext`
13722 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
13723 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
13724 echo "We will use %ld."
13730 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
13731 $cat >try.c <<'EOCP'
13732 #include <sys/types.h>
13733 #include <inttypes.h>
13736 int64_t q = 12345678901;
13737 printf("%" PRId64 "\n", q);
13741 if eval $compile; then
13742 yyy=`./try$exe_ext`
13745 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
13746 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
13747 echo "We will use the C9X style."
13753 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
13754 $cat >try.c <<'EOCP'
13755 #include <sys/types.h>
13758 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
13759 printf("%lld\n", q);
13763 if eval $compile; then
13764 yyy=`./try$exe_ext`
13767 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
13768 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
13769 echo "We will use the %lld style."
13775 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
13777 #include <sys/types.h>
13780 $quadtype q = 12345678901;
13781 printf("%Ld\n", q);
13785 if eval $compile; then
13786 yyy=`./try$exe_ext`
13789 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
13790 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
13791 echo "We will use %Ld."
13797 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
13799 #include <sys/types.h>
13802 $quadtype q = 12345678901;
13803 printf("%qd\n", q);
13807 if eval $compile; then
13808 yyy=`./try$exe_ext`
13811 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
13812 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
13813 echo "We will use %qd."
13819 if $test X"$sPRId64" = X; then
13820 echo "Cannot figure out how to print 64-bit integers." >&4
13828 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
13829 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
13831 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
13832 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
13838 $echo "Checking the format strings to be used for Perl's internal types..." >&4
13840 if $test X"$ivsize" = X8; then
13841 ivdformat="$sPRId64"
13842 uvuformat="$sPRIu64"
13843 uvoformat="$sPRIo64"
13844 uvxformat="$sPRIx64"
13845 uvXUformat="$sPRIXU64"
13847 if $test X"$ivsize" = X"$longsize"; then
13854 if $test X"$ivsize" = X"$intsize"; then
13862 if $test X"$ivsize" = X"$shortsize"; then
13873 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
13874 nveformat="$sPRIeldbl"
13875 nvfformat="$sPRIfldbl"
13876 nvgformat="$sPRIgldbl"
13877 nvEUformat="$sPRIEUldbl"
13878 nvFUformat="$sPRIFUldbl"
13879 nvGUformat="$sPRIGUldbl"
13889 case "$ivdformat" in
13890 '') echo "$0: Fatal: failed to find format strings, cannot continue." >& 4
13897 $echo "Checking the format string to be used for gids..." >&4
13900 -1) if $test X"$gidsize" = X"$ivsize"; then
13901 gidformat="$ivdformat"
13903 if $test X"$gidsize" = X"$longsize"; then
13906 if $test X"$gidsize" = X"$intsize"; then
13909 if $test X"$gidsize" = X"$shortsize"; then
13916 *) if $test X"$gidsize" = X"$uvsize"; then
13917 gidformat="$uvuformat"
13919 if $test X"$gidsize" = X"$longsize"; then
13922 if $test X"$gidsize" = X"$intsize"; then
13925 if $test X"$gidsize" = X"$shortsize"; then
13934 : see if getgroups exists
13935 set getgroups d_getgrps
13938 : see if setgroups exists
13939 set setgroups d_setgrps
13943 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
13945 case "$d_getgrps$d_setgrps" in
13947 case "$groupstype" in
13948 '') dflt="$gidtype" ;;
13949 *) dflt="$groupstype" ;;
13952 What type of pointer is the second argument to getgroups() and setgroups()?
13953 Usually this is the same as group ids, $gidtype, but not always.
13956 rp='What type pointer is the second argument to getgroups() and setgroups()?'
13960 *) groupstype="$gidtype";;
13964 echo "Checking if your $make program sets \$(MAKE)..." >&4
13965 case "$make_set_make" in
13967 $sed 's/^X //' > testmake.mak << 'EOF'
13969 X @echo 'maketemp="$(MAKE)"'
13971 case "`$make -f testmake.mak 2>/dev/null`" in
13972 *maketemp=*) make_set_make='#' ;;
13973 *) make_set_make="MAKE=$make" ;;
13975 $rm -f testmake.mak
13978 case "$make_set_make" in
13979 '#') echo "Yup, it does.";;
13980 *) echo "Nope, it doesn't.";;
13983 : see what type is used for mode_t
13984 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
13985 set mode_t modetype int stdio.h sys/types.h
13988 : see if stdarg is available
13990 if $test `./findhdr stdarg.h`; then
13991 echo "<stdarg.h> found." >&4
13994 echo "<stdarg.h> NOT found." >&4
13998 : see if varags is available
14000 if $test `./findhdr varargs.h`; then
14001 echo "<varargs.h> found." >&4
14003 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
14006 : set up the varargs testing programs
14007 $cat > varargs.c <<EOP
14009 #include <stdarg.h>
14012 #include <varargs.h>
14016 int f(char *p, ...)
14030 p = va_arg(ap, char *);
14035 $cat > varargs <<EOP
14037 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
14046 : now check which varargs header should be included
14051 if `./varargs I_STDARG`; then
14053 elif `./varargs I_VARARGS`; then
14058 if `./varargs I_VARARGS`; then
14065 echo "I could not find the definition for va_dcl... You have problems..." >&4
14066 val="$undef"; set i_stdarg; eval $setvar
14067 val="$undef"; set i_varargs; eval $setvar
14072 case "$i_varhdr" in
14074 val="$define"; set i_stdarg; eval $setvar
14075 val="$undef"; set i_varargs; eval $setvar
14078 val="$undef"; set i_stdarg; eval $setvar
14079 val="$define"; set i_varargs; eval $setvar
14082 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
14086 : see if we need va_copy
14088 case "$i_stdarg" in
14091 #include <stdarg.h>
14093 #$i_stdlib I_STDLIB
14095 #include <stdlib.h>
14097 #include <signal.h>
14100 ivfprintf(FILE *f, const char *fmt, va_list *valp)
14102 return vfprintf(f, fmt, *valp);
14106 myvfprintf(FILE *f, const char *fmt, va_list val)
14108 return ivfprintf(f, fmt, &val);
14112 myprintf(char *fmt, ...)
14115 va_start(val, fmt);
14116 return myvfprintf(stdout, fmt, val);
14120 main(int ac, char **av)
14122 signal(SIGSEGV, exit);
14124 myprintf("%s%cs all right, then\n", "that", '\'');
14129 if eval $compile && ./try 2>&1 >/dev/null; then
14131 "that's all right, then")
14137 yes) echo "It seems that you don't need va_copy()." >&4
14138 need_va_copy="$undef"
14140 *) echo "It seems that va_copy() or similar will be needed." >&4
14141 need_va_copy="$define"
14144 $rm -f try.* core core.* *.core *.core.*
14146 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
14150 : define a fucntion to check prototypes
14151 $cat > protochk <<EOSH
14154 optimize="$optimize"
14156 prototype="$prototype"
14161 $cat >> protochk <<'EOSH'
14166 while test $# -ge 2; do
14168 $define) echo "#include <$2>" >> try.c ;;
14169 literal) echo "$2" >> try.c ;;
14173 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
14174 cat >> try.c <<'EOCP'
14175 #ifdef CAN_PROTOTYPE
14176 #define _(args) args
14181 echo "$foo" >> try.c
14182 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
14183 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
14189 $eunicefix protochk
14191 : see what type is used for size_t
14192 rp="What is the type used for the length parameter for string functions?"
14193 set size_t sizetype 'unsigned int' stdio.h sys/types.h
14196 : check for type of arguments to gethostbyaddr.
14197 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
14198 case "$d_gethbyaddr" in
14202 Checking to see what type of arguments are accepted by gethostbyaddr().
14204 hdrs="$define sys/types.h
14205 $d_socket sys/socket.h
14206 $i_niin netinet/in.h
14208 $i_unistd unistd.h"
14209 : The first arg can 'char *' or 'void *'
14210 : The second arg is some of integral type
14211 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
14212 for yyy in size_t long int; do
14213 case "$netdb_host_type" in
14214 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
14215 if ./protochk "$try" $hdrs; then
14216 echo "Your system accepts $xxx for the first arg."
14217 echo "...and $yyy for the second arg."
14218 netdb_host_type="$xxx"
14219 netdb_hlen_type="$yyy"
14225 : In case none of those worked, prompt the user.
14226 case "$netdb_host_type" in
14227 '') rp='What is the type for the 1st argument to gethostbyaddr?'
14230 netdb_host_type=$ans
14231 rp='What is the type for the 2nd argument to gethostbyaddr?'
14234 netdb_hlen_type=$ans
14238 *) : no gethostbyaddr, so pick harmless defaults
14239 netdb_host_type='char *'
14240 netdb_hlen_type="$sizetype"
14243 # Remove the "const" if needed. -- but then we'll have a
14245 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
14248 : check for type of argument to gethostbyname.
14249 if test "X$netdb_name_type" = X ; then
14250 case "$d_gethbyname" in
14254 Checking to see what type of argument is accepted by gethostbyname().
14256 hdrs="$define sys/types.h
14257 $d_socket sys/socket.h
14258 $i_niin netinet/in.h
14260 $i_unistd unistd.h"
14261 for xxx in "const char *" "char *"; do
14262 case "$netdb_name_type" in
14263 '') try="extern struct hostent *gethostbyname($xxx);"
14264 if ./protochk "$try" $hdrs; then
14265 echo "Your system accepts $xxx."
14266 netdb_name_type="$xxx"
14271 : In case none of those worked, prompt the user.
14272 case "$netdb_name_type" in
14273 '') rp='What is the type for the 1st argument to gethostbyname?'
14276 netdb_name_type=$ans
14280 *) : no gethostbyname, so pick harmless default
14281 netdb_name_type='char *'
14286 : check for type of 1st argument to getnetbyaddr.
14287 if test "X$netdb_net_type" = X ; then
14288 case "$d_getnbyaddr" in
14292 Checking to see what type of 1st argument is accepted by getnetbyaddr().
14294 hdrs="$define sys/types.h
14295 $d_socket sys/socket.h
14296 $i_niin netinet/in.h
14298 $i_unistd unistd.h"
14299 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
14300 case "$netdb_net_type" in
14301 '') try="extern struct netent *getnetbyaddr($xxx, int);"
14302 if ./protochk "$try" $hdrs; then
14303 echo "Your system accepts $xxx."
14304 netdb_net_type="$xxx"
14309 : In case none of those worked, prompt the user.
14310 case "$netdb_net_type" in
14311 '') rp='What is the type for the 1st argument to getnetbyaddr?'
14314 netdb_net_type=$ans
14318 *) : no getnetbyaddr, so pick harmless default
14319 netdb_net_type='long'
14323 : locate the preferred pager for this system
14329 [a-zA-Z]:/*) dflt=$pg;;
14333 [a-zA-Z]:/*) dflt=$more;;
14337 [a-zA-Z]:/*) dflt=$less;;
14340 '') dflt=/usr/ucb/more;;
14347 rp='What pager is used on your system?'
14351 : see what type pids are declared as in the kernel
14352 rp="What is the type of process ids on this system?"
14353 set pid_t pidtype int stdio.h sys/types.h
14356 : Find earliest binary compatible site_perl subdirectory perl can use.
14357 case "$bincompat5005" in
14358 "$define") xs_apiversion='5.005' ;;
14359 *) xs_apiversion=$version ;; # The current site_perl version.
14361 : Find earliest pure perl site_perl subdirectory perl can use.
14362 : The versioned directories started at 5.005.
14363 pm_apiversion='5.005'
14365 : see if ar generates random libraries by itself
14367 echo "Checking how to generate random libraries on your machine..." >&4
14368 echo 'int bar1() { return bar2(); }' > bar1.c
14369 echo 'int bar2() { return 2; }' > bar2.c
14370 $cat > foo.c <<'EOP'
14371 int main() { printf("%d\n", bar1()); exit(0); }
14373 $cc $ccflags -c bar1.c >/dev/null 2>&1
14374 $cc $ccflags -c bar2.c >/dev/null 2>&1
14375 $cc $ccflags -c foo.c >/dev/null 2>&1
14376 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
14377 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
14378 ./foobar >/dev/null 2>&1; then
14379 echo "$ar appears to generate random libraries itself."
14382 elif $ar ts bar$_a >/dev/null 2>&1 &&
14383 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
14384 ./foobar >/dev/null 2>&1; then
14385 echo "a table of contents needs to be added with '$ar ts'."
14392 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
14393 $test -f $ranlib || ranlib=''
14396 if $test -n "$ranlib"; then
14397 echo "your system has '$ranlib'; we'll use that."
14400 echo "your system doesn't seem to support random libraries"
14401 echo "so we'll use lorder and tsort to order the libraries."
14408 : check for type of arguments to select.
14409 case "$selecttype" in
14410 '') case "$d_select" in
14414 Checking to see what type of arguments are accepted by select().
14416 hdrs="$define sys/types.h
14417 $i_systime sys/time.h
14418 $i_sysselct sys/select.h
14419 $d_socket sys/socket.h"
14420 : The first arg can be int, unsigned, or size_t
14421 : The last arg may or may not be 'const'
14423 : void pointer has been seen but using that
14424 : breaks the selectminbits test
14425 for xxx in 'fd_set *' 'int *'; do
14426 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
14427 for tmo in 'struct timeval *' 'const struct timeval *'; do
14429 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
14430 if ./protochk "$try" $hdrs; then
14431 echo "Your system accepts $xxx."
14440 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
14441 case "$d_fd_set" in
14442 $define) dflt="fd_set *" ;;
14451 *) : no select, so pick a harmless default
14458 : check for the select 'width'
14459 case "$selectminbits" in
14460 '') case "$d_select" in
14464 Checking to see on how many bits at a time your select() operates...
14467 #include <sys/types.h>
14469 #$i_systime I_SYS_TIME
14470 #$i_systimek I_SYS_TIME_KERNEL
14475 # ifdef I_SYS_TIME_KERNEL
14478 # include <sys/time.h>
14479 # ifdef I_SYS_TIME_KERNEL
14483 #$i_sysselct I_SYS_SELECT
14484 #ifdef I_SYS_SELECT
14485 #include <sys/select.h>
14487 #$d_socket HAS_SOCKET
14489 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
14493 #define S sizeof(*(b))
14495 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
14496 #define NBITS (NBYTES * 8)
14505 fp = fopen("try.c", "r");
14511 b = ($selecttype)s;
14512 for (i = 0; i < NBITS; i++)
14516 select(fd + 1, b, 0, 0, &t);
14517 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
14518 printf("%d\n", i + 1);
14523 if eval $compile_ok; then
14524 selectminbits=`./try`
14525 case "$selectminbits" in
14527 Cannot figure out on how many bits at a time your select() operates.
14528 I'll play safe and guess it is 32 bits.
14534 *) bits="$selectminbits bits" ;;
14536 echo "Your select() operates on $bits at a time." >&4
14538 rp='What is the minimum number of bits your select() operates on?'
14539 case "$byteorder" in
14540 1234|12345678) dflt=32 ;;
14545 selectminbits="$val"
14549 *) : no select, so pick a harmless default
14556 : Trace out the files included by signal.h, then look for SIGxxx names.
14557 : Remove SIGARRAYSIZE used by HPUX.
14558 : Remove SIGSTKSIZE used by Linux.
14559 : Remove SIGSTKSZ used by Posix.
14560 : Remove SIGTYP void lines used by OS2.
14561 : Some cpps, like os390, dont give the file name anywhere
14562 if [ "X$fieldn" = X ]; then
14563 : Just make some guesses. We check them later.
14564 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
14566 xxx=`echo '#include <signal.h>' |
14567 $cppstdin $cppminus $cppflags 2>/dev/null |
14568 $grep '^[ ]*#.*include' |
14569 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq`
14571 : Check this list of files to be sure we have parsed the cpp output ok.
14572 : This will also avoid potentially non-existent files, such
14575 for xx in $xxx /dev/null ; do
14576 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
14578 : If we have found no files, at least try signal.h
14579 case "$xxxfiles" in
14580 '') xxxfiles=`./findhdr signal.h` ;;
14583 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
14584 print substr($2, 4, 20)
14586 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
14587 print substr($3, 4, 20)
14589 : Append some common names just in case the awk scan failed.
14590 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
14591 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
14592 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
14593 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
14594 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
14596 : generate a few handy files for later
14597 $cat > signal.c <<'EOCP'
14598 #include <sys/types.h>
14599 #include <signal.h>
14603 /* Strange style to avoid deeply-nested #if/#else/#endif */
14606 # define NSIG (_NSIG)
14612 # define NSIG (SIGMAX+1)
14618 # define NSIG (SIG_MAX+1)
14624 # define NSIG (MAXSIG+1)
14630 # define NSIG (MAX_SIG+1)
14635 # ifdef SIGARRAYSIZE
14636 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
14642 # define NSIG (_sys_nsig) /* Solaris 2.5 */
14646 /* Default to some arbitrary number that's big enough to get most
14647 of the common signals.
14653 printf("NSIG %d\n", NSIG);
14659 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
14661 printf "#ifdef SIG"; printf $1; printf "\n"
14662 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
14663 printf $1; printf ");\n"
14667 printf "#endif /* JUST_NSIG */\n";
14668 printf "exit(0);\n}\n";
14671 $cat >signal.awk <<'EOP'
14672 BEGIN { ndups = 0 }
14673 $1 ~ /^NSIG$/ { nsig = $2 }
14674 ($1 !~ /^NSIG$/) && (NF == 2) {
14675 if ($2 > maxsig) { maxsig = $2 }
14676 if (sig_name[$2]) {
14677 dup_name[ndups] = $1
14678 dup_num[ndups] = $2
14690 printf("NSIG %d\n", nsig);
14691 for (n = 1; n < nsig; n++) {
14693 printf("%s %d\n", sig_name[n], sig_num[n])
14696 printf("NUM%d %d\n", n, n)
14699 for (n = 0; n < ndups; n++) {
14700 printf("%s %d\n", dup_name[n], dup_num[n])
14704 $cat >signal_cmd <<EOS
14706 if $test -s signal.lst; then
14707 echo "Using your existing signal.lst file"
14712 $cat >>signal_cmd <<'EOS'
14715 if eval $compile_ok; then
14716 ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
14718 echo "(I can't seem be able to compile the whole test program)" >&4
14719 echo "(I'll try it in little pieces.)" >&4
14720 set signal -DJUST_NSIG
14721 if eval $compile_ok; then
14722 ./signal$_exe > signal.nsg
14725 echo "I can't seem to figure out how many signals you have." >&4
14726 echo "Guessing 50." >&4
14727 echo 'NSIG 50' > signal.nsg
14729 : Now look at all the signal names, one at a time.
14730 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
14731 $cat > signal.c <<EOCP
14732 #include <sys/types.h>
14733 #include <signal.h>
14736 printf("$xx %d\n", SIG${xx});
14741 if eval $compile; then
14742 echo "SIG${xx} found."
14743 ./signal$_exe >> signal.ls1
14745 echo "SIG${xx} NOT found."
14748 if $test -s signal.ls1; then
14749 $cat signal.nsg signal.ls1 |
14750 $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
14754 if $test -s signal.lst; then
14757 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
14758 echo 'kill -l' >signal
14759 set X `csh -f <signal`
14763 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
14765 echo $@ | $tr ' ' $trnl | \
14766 $awk '{ printf "%s %d\n", $1, ++s; }
14767 END { printf "NSIG %d\n", ++s }' >signal.lst
14769 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
14771 chmod a+x signal_cmd
14772 $eunicefix signal_cmd
14774 : generate list of signal names
14776 case "$sig_name_init" in
14778 *) case "$sig_num_init" in
14779 ''|*,*) doinit=yes ;;
14784 echo "Generating a list of signal names and numbers..." >&4
14786 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
14787 sig_name=`$awk 'BEGIN { printf "ZERO " }
14788 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
14789 sig_num=`$awk 'BEGIN { printf "0 " }
14790 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
14791 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
14792 !/^NSIG/ { printf "\"%s\", ", $1 }
14793 END { printf "0\n" }' signal.lst`
14794 sig_num_init=`$awk 'BEGIN { printf "0, " }
14795 !/^NSIG/ { printf "%d, ", $2}
14796 END { printf "0\n"}' signal.lst`
14799 echo "The following $sig_count signals are available:"
14801 echo $sig_name | $awk \
14802 'BEGIN { linelen = 0 }
14804 for (i = 1; i <= NF; i++) {
14805 name = "SIG" $i " "
14806 linelen = linelen + length(name)
14807 if (linelen > 70) {
14809 linelen = length(name)
14815 sig_size=`echo $sig_name | awk '{print NF}'`
14816 $rm -f signal signal.c signal.awk signal.lst signal_cmd
14819 case "$sizetype" in
14820 *_t) zzz="$sizetype" ;;
14821 *) zzz="filesize" ;;
14823 echo "Checking the size of $zzz..." >&4
14825 #include <sys/types.h>
14828 printf("%d\n", (int)sizeof($sizetype));
14833 if eval $compile_ok; then
14837 echo "(I can't execute the test program--guessing $sizesize.)" >&4
14840 echo "Your $zzz size is $sizesize bytes."
14845 echo "(I can't compile the test program--guessing $sizesize.)" >&4
14849 : check for socklen_t
14851 echo "Checking to see if you have socklen_t..." >&4
14853 #include <sys/types.h>
14854 #$d_socket HAS_SOCKET
14856 #include <sys/socket.h>
14858 int main() { socklen_t x = 16; }
14861 if eval $compile; then
14863 echo "You have socklen_t."
14866 echo "You do not have socklen_t."
14867 case "$sizetype" in
14868 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
14875 : see if this is a socks.h system
14876 set socks.h i_socks
14879 : check for type of the size argument to socket calls
14880 case "$d_socket" in
14884 Checking to see what type is the last argument of accept().
14887 case "$d_socklen_t" in
14888 "$define") yyy="$yyy socklen_t"
14890 yyy="$yyy $sizetype int long unsigned"
14891 for xxx in $yyy; do
14892 case "$socksizetype" in
14893 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
14894 case "$usesocks" in
14896 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
14897 echo "Your system accepts '$xxx *' for the last argument of accept()."
14898 socksizetype="$xxx"
14901 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
14902 echo "Your system accepts '$xxx *' for the last argument of accept()."
14903 socksizetype="$xxx"
14910 : In case none of those worked, prompt the user.
14911 case "$socksizetype" in
14912 '') rp='What is the type for socket address structure sizes?'
14919 *) : no sockets, so pick relatively harmless default
14924 : see what type is used for signed size_t
14925 set ssize_t ssizetype int stdio.h sys/types.h
14928 $cat > ssize.c <<EOM
14930 #include <sys/types.h>
14931 #define Size_t $sizetype
14932 #define SSize_t $dflt
14935 if (sizeof(Size_t) == sizeof(SSize_t))
14937 else if (sizeof(Size_t) == sizeof(int))
14946 if eval $compile_ok && ./ssize > /dev/null; then
14947 ssizetype=`./ssize`
14948 echo "I'll be using $ssizetype for functions returning a byte count." >&4
14951 Help! I can't compile and run the ssize_t test program: please enlighten me!
14952 (This is probably a misconfiguration in your system or libraries, and
14953 you really ought to fix it. Still, I'll try anyway.)
14955 I need a type that is the same size as $sizetype, but is guaranteed to
14956 be signed. Common values are ssize_t, int and long.
14959 rp="What signed type is the same size as $sizetype?"
14963 $rm -f ssize ssize.*
14965 : see what type of char stdio uses.
14967 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
14968 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
14969 echo "Your stdio uses unsigned chars." >&4
14970 stdchar="unsigned char"
14972 echo "Your stdio uses signed chars." >&4
14979 : see if time exists
14981 if test "X$d_time" = X -o X"$timetype" = X; then
14982 if set time val -f d_time; eval $csym; $val; then
14983 echo 'time() found.' >&4
14985 rp="What is the type returned by time() on this system?"
14986 set time_t timetype long stdio.h sys/types.h
14989 echo 'time() not found, hope that will do.' >&4
14997 : see what type uids are declared as in the kernel
14999 echo "Looking for the type for user ids returned by getuid()."
15000 set uid_t uidtype xxx stdio.h sys/types.h
15004 xxx=`./findhdr sys/user.h`
15005 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
15007 unsigned) dflt="$1 $2" ;;
15011 *) dflt="$uidtype";;
15014 uid_t) echo "uid_t found." ;;
15015 *) rp="What is the type for user ids returned by getuid()?"
15023 *_t) zzz="$uidtype" ;;
15026 echo "Checking the size of $zzz..." >&4
15028 #include <sys/types.h>
15031 printf("%d\n", (int)sizeof($uidtype));
15036 if eval $compile_ok; then
15040 echo "(I can't execute the test program--guessing $uidsize.)" >&4
15043 echo "Your $zzz is $uidsize bytes long."
15048 echo "(I can't compile the test program--guessing $uidsize.)" >&4
15053 *_t) zzz="$uidtype" ;;
15056 echo "Checking the sign of $zzz..." >&4
15058 #include <sys/types.h>
15069 if eval $compile; then
15073 echo "(I can't execute the test program--guessing unsigned.)" >&4
15077 1) echo "Your $zzz is unsigned." ;;
15078 -1) echo "Your $zzz is signed." ;;
15084 echo "(I can't compile the test program--guessing unsigned.)" >&4
15090 $echo "Checking the format string to be used for uids..." >&4
15093 -1) if $test X"$uidsize" = X"$ivsize"; then
15094 uidformat="$ivdformat"
15096 if $test X"$uidsize" = X"$longsize"; then
15099 if $test X"$uidsize" = X"$intsize"; then
15102 if $test X"$uidsize" = X"$shortsize"; then
15109 *) if $test X"$uidsize" = X"$uvsize"; then
15110 uidformat="$uvuformat"
15112 if $test X"$uidsize" = X"$longsize"; then
15115 if $test X"$uidsize" = X"$intsize"; then
15118 if $test X"$uidsize" = X"$shortsize"; then
15127 : determine compiler compiler
15136 if $test -f "$byacc"; then
15138 comp="byacc or $comp"
15140 if $test -f "$bison"; then
15141 comp="$comp or bison -y"
15143 rp="Which compiler compiler ($comp) shall I use?"
15152 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
15158 : see if dbm.h is available
15159 : see if dbmclose exists
15160 set dbmclose d_dbmclose
15163 case "$d_dbmclose" in
15173 *) set rpcsvc/dbm.h i_rpcsvcdbm
15178 *) echo "We won't be including <dbm.h>"
15188 : see if this is a sys/file.h system
15193 : do we need to include sys/file.h ?
15197 if $h_sysfile; then
15199 echo "We'll be including <sys/file.h>." >&4
15202 echo "We won't be including <sys/file.h>." >&4
15212 : see if fcntl.h is there
15217 : see if we can include fcntl.h
15223 echo "We'll be including <fcntl.h>." >&4
15226 if $h_sysfile; then
15227 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
15229 echo "We won't be including <fcntl.h>." >&4
15241 : see if this is a iconv.h system
15242 set iconv.h i_iconv
15245 : see if this is a ieeefp.h system
15246 set ieeefp.h i_ieeefp
15249 : see if this is a libutil.h system
15250 set libutil.h i_libutil
15253 : see if locale.h is available
15254 set locale.h i_locale
15257 : see if mach cthreads are available
15258 if test "X$usethreads" = "X$define"; then
15259 set mach/cthreads.h i_machcthr
15262 i_machcthr="$undef"
15267 : see if this is a math.h system
15271 : see if this is a mntent.h system
15272 set mntent.h i_mntent
15275 : see if ndbm.h is available
15280 : see if dbm_open exists
15281 set dbm_open d_dbm_open
15283 case "$d_dbm_open" in
15286 echo "We won't be including <ndbm.h>"
15295 : see if net/errno.h is available
15297 set net/errno.h val
15300 : Unfortunately, it causes problems on some systems. Arrgh.
15303 cat > try.c <<'EOM'
15306 #include <net/errno.h>
15312 if $cc $ccflags -c try.c >/dev/null 2>&1; then
15313 echo "We'll be including <net/errno.h>." >&4
15315 echo "We won't be including <net/errno.h>." >&4
15324 : see if netinet/tcp.h is available
15325 set netinet/tcp.h i_netinettcp
15328 : see if this is a poll.h system
15332 : see if this is a prot.h system
15337 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
15338 $cat <<'EOSH' > Cppsym.know
15339 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
15340 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
15341 alliant alpha am29000 AM29000 AMD64 amiga AMIGAOS AMIX
15342 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
15343 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
15344 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
15345 bull c cadmus clipper CMU COFF COMPILER_VERSION
15346 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
15347 CYGWIN DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
15348 Dynix DynixPTX ELF encore EPI EXTENSIONS FILE_OFFSET_BITS
15349 FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
15350 GNU_SOURCE GNUC GNUC_MINOR GO32 gould GOULD_PN
15351 H3050R H3050RX hbullx20 hcx host_mips
15352 hp200 hp300 hp700 HP700 hp800 hp9000
15353 hp9000s200 hp9000s300 hp9000s400 hp9000s500
15354 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
15355 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
15356 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
15357 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
15358 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
15359 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
15360 Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
15361 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
15362 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
15363 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
15364 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
15365 MATH_HAS_NO_SIDE_EFFECTS
15366 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
15367 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
15368 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
15369 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
15370 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
15371 NetBSD news1500 news1700 news1800 news1900 news3700
15372 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
15373 ns32016 ns32332 ns32k nsc32000
15374 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
15375 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
15376 pc532 pdp11 PGC PIC plexus PORTAR posix
15377 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
15378 POSIX_C_SOURCE POSIX_SOURCE POWER
15379 PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
15380 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
15381 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
15382 sony sony_news sonyrisc sparc sparclite spectrum
15383 stardent stdc STDC_EXT stratos sun sun3 sun386
15384 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
15385 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
15386 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
15387 sysV68 sysV88 Tek4132 Tek4300 titan
15388 TM3200 TM5400 TM5600
15389 tower tower32 tower32_200 tower32_600 tower32_700
15390 tower32_800 tower32_850 tss
15391 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
15392 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
15393 unix UNIX95 UNIX99 unixpc unos USGr4 USGr4_2
15394 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms xenix Xenix286
15395 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
15396 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
15399 # Maybe put other stuff here too.
15400 cat <<EOSH >>Cppsym.know
15403 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
15404 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
15405 $cat Cppsym.know > Cppsym.c
15406 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
15407 $rm -f Cppsym.a Cppsym.b Cppsym.c
15408 cat <<EOSH > Cppsym
15410 if $test \$# -gt 0; then
15411 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
15412 if $test -s Cppsym.got; then
15419 $tr " " "$trnl" | ./Cppsym.try
15425 cat <<EOSH > Cppsym.try
15427 cat <<'EOCP' > try.c
15433 cat <<'EOSH' >> Cppsym.try
15435 printf "#ifdef %s\n#if %s+0\nprintf(\"%s=%%ld\\n\", %s);\n#else\nprintf(\"%s\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1
15436 printf "#ifdef _%s\n#if _%s+0\nprintf(\"_%s=%%ld\\n\", _%s);\n#else\nprintf(\"_%s\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1
15437 printf "#ifdef __%s\n#if __%s+0\nprintf(\"__%s=%%ld\\n\", __%s);\n#else\nprintf(\"__%s\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1
15438 printf "#ifdef __%s__\n#if __%s__+0\nprintf(\"__%s__=%%ld\\n\", __%s__);\n#else\nprintf(\"__%s__\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1
15442 cat <<EOSH >> Cppsym.try
15444 case "$osname-$gccversion" in
15445 irix-) ccflags="\$ccflags -woff 1178" ;;
15446 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
15448 $cc -o try $optimize \$ccflags $ldflags try.c $libs && ./try$exe_ext
15450 chmod +x Cppsym.try
15451 $eunicefix Cppsym.try
15452 ./Cppsym < Cppsym.know > Cppsym.true
15453 : now check the C compiler for additional symbols
15454 postprocess_cc_v=''
15456 aix) postprocess_cc_v="|$tr , ' '" ;;
15463 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
15466 -D*) echo "\$i" | $sed 's/^-D//';;
15467 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
15472 postprocess_cc_v=''
15475 ./ccsym > ccsym1.raw
15476 if $test -s ccsym1.raw; then
15477 $sort ccsym1.raw | $uniq >ccsym.raw
15479 mv ccsym1.raw ccsym.raw
15482 $awk '/\=/ { print $0; next }
15483 { print $0"=1" }' ccsym.raw >ccsym.list
15484 $awk '/\=/ { print $0; next }
15485 { print $0"=1" }' Cppsym.true >ccsym.true
15486 $comm -13 ccsym.true ccsym.list >ccsym.own
15487 $comm -12 ccsym.true ccsym.list >ccsym.com
15488 $comm -23 ccsym.true ccsym.list >ccsym.cpp
15490 if $test -z ccsym.raw; then
15491 echo "Your C compiler doesn't seem to define any symbols!" >&4
15493 echo "However, your C preprocessor defines the following symbols:"
15496 cppsymbols=`$cat Cppsym.true`
15497 cppsymbols=`echo $cppsymbols`
15498 cppccsymbols="$cppsymbols"
15500 if $test -s ccsym.com; then
15501 echo "Your C compiler and pre-processor define these symbols:"
15502 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
15505 cppccsymbols=`$cat ccsym.com`
15506 cppccsymbols=`echo $cppccsymbols`
15507 $test "$silent" || sleep 1
15509 if $test -s ccsym.cpp; then
15510 $test "$also" && echo " "
15511 echo "Your C pre-processor ${also}defines the following symbols:"
15512 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
15514 cppsymbols=`$cat ccsym.cpp`
15515 cppsymbols=`echo $cppsymbols`
15516 $test "$silent" || sleep 1
15518 if $test -s ccsym.own; then
15519 $test "$also" && echo " "
15520 echo "Your C compiler ${also}defines the following cpp symbols:"
15521 $sed -e 's/\(..*\)=1/\1/' ccsym.own
15522 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
15523 ccsymbols=`$cat ccsym.own`
15524 ccsymbols=`echo $ccsymbols`
15525 $test "$silent" || sleep 1
15528 $rm -f ccsym* Cppsym.*
15530 : see if this is a termio system
15534 if $test `./findhdr termios.h`; then
15535 set tcsetattr i_termios
15541 "$define") echo "You have POSIX termios.h... good!" >&4;;
15542 *) if ./Cppsym pyr; then
15543 case "`/bin/universe`" in
15544 ucb) if $test `./findhdr sgtty.h`; then
15546 echo "<sgtty.h> found." >&4
15548 echo "System is pyramid with BSD universe."
15549 echo "<sgtty.h> not found--you could have problems." >&4
15551 *) if $test `./findhdr termio.h`; then
15553 echo "<termio.h> found." >&4
15555 echo "System is pyramid with USG universe."
15556 echo "<termio.h> not found--you could have problems." >&4
15560 if $test `./findhdr termio.h`; then
15561 echo "<termio.h> found." >&4
15563 elif $test `./findhdr sgtty.h`; then
15564 echo "<sgtty.h> found." >&4
15567 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
15570 if $test `./findhdr sgtty.h`; then
15571 echo "<sgtty.h> found." >&4
15573 elif $test `./findhdr termio.h`; then
15574 echo "<termio.h> found." >&4
15577 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
15581 set i_termio; eval $setvar
15582 val=$val2; set i_sgtty; eval $setvar
15583 val=$val3; set i_termios; eval $setvar
15585 : see if this is a shadow.h system
15586 set shadow.h i_shadow
15589 : see if stddef is available
15590 set stddef.h i_stddef
15593 : see if this is a sunmath.h system
15594 set sunmath.h i_sunmath
15597 : see if sys/access.h is available
15598 set sys/access.h i_sysaccess
15601 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
15602 set sys/filio.h i_sysfilio
15605 if $test `./findhdr sys/ioctl.h`; then
15607 echo '<sys/ioctl.h> found.' >&4
15610 if $test $i_sysfilio = "$define"; then
15611 echo '<sys/ioctl.h> NOT found.' >&4
15613 $test $i_sgtty = "$define" && xxx="sgtty.h"
15614 $test $i_termio = "$define" && xxx="termio.h"
15615 $test $i_termios = "$define" && xxx="termios.h"
15616 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
15622 : see if socket ioctl defs are in sys/sockio.h
15624 xxx=`./findhdr sys/sockio.h`
15625 if $test "$xxx"; then
15626 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
15628 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
15631 echo "No socket ioctls found in <sys/sockio.h>." >&4
15636 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
15643 : see if this is a syslog.h system
15644 set syslog.h i_syslog
15648 : see if this is a sys/mode.h system
15649 set sys/mode.h i_sysmode
15652 : see if sys/resource.h has to be included
15653 set sys/resource.h i_sysresrc
15656 : see if sys/security.h is available
15657 set sys/security.h i_syssecrt
15660 : see if this is a sys/statvfs.h system
15661 set sys/statvfs.h i_sysstatvfs
15664 : see if this is a sys/un.h system
15665 set sys/un.h i_sysun
15669 : see if this is a sys/utsname.h system
15670 set sys/utsname.h i_sysutsname
15673 : see if this is a syswait system
15674 set sys/wait.h i_syswait
15677 : see if this is a ustat.h system
15678 set ustat.h i_ustat
15681 : see if this is an utime system
15682 set utime.h i_utime
15685 : see if this is a values.h system
15686 set values.h i_values
15689 : see if this is a vfork system
15692 set vfork.h i_vfork
15700 : see if gdbm.h is available
15705 : see if gdbm_open exists
15706 set gdbm_open d_gdbm_open
15708 case "$d_gdbm_open" in
15711 echo "We won't be including <gdbm.h>"
15721 echo "Looking for extensions..." >&4
15722 : If we are using the old config.sh, known_extensions may contain
15723 : old or inaccurate or duplicate values.
15724 known_extensions=''
15725 nonxs_extensions=''
15726 : We do not use find because it might not be available.
15727 : We do not just use MANIFEST because the user may have dropped
15728 : some additional extensions into the source tree and expect them
15731 : Function to recursively find available extensions, ignoring DynaLoader
15732 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
15736 DynaLoader|dynaload) ;;
15738 if $test -f $xxx/$xxx.xs; then
15739 known_extensions="$known_extensions $1$xxx";
15740 elif $test -f $xxx/Makefile.PL; then
15741 nonxs_extensions="$nonxs_extensions $1$xxx";
15743 if $test -d $xxx -a $# -lt 10; then
15746 eval $find_extensions;
15758 eval $find_extensions
15759 set X $nonxs_extensions
15761 nonxs_extensions="$*"
15762 set X $known_extensions
15764 known_extensions="$*"
15767 : Now see which are supported on this system.
15769 for xxx in $known_extensions ; do
15773 $define) avail_ext="$avail_ext $xxx" ;;
15776 GDBM_File|gdbm_fil)
15778 $define) avail_ext="$avail_ext $xxx" ;;
15781 NDBM_File|ndbm_fil)
15784 case "$osname-$use64bitint" in
15787 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
15790 *) avail_ext="$avail_ext $xxx" ;;
15795 ODBM_File|odbm_fil)
15796 case "${i_dbm}${i_rpcsvcdbm}" in
15798 case "$osname-$use64bitint" in
15801 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
15804 *) avail_ext="$avail_ext $xxx" ;;
15810 case "$useposix" in
15811 true|define|y) avail_ext="$avail_ext $xxx" ;;
15815 case "$useopcode" in
15816 true|define|y) avail_ext="$avail_ext $xxx" ;;
15820 case "$d_socket" in
15821 true|$define|y) avail_ext="$avail_ext $xxx" ;;
15824 Sys/Syslog|sys/syslog)
15825 : XXX syslog requires socket
15826 case "$d_socket" in
15827 true|$define|y) avail_ext="$avail_ext $xxx" ;;
15831 case "$usethreads" in
15832 true|$define|y) avail_ext="$avail_ext $xxx" ;;
15836 : XXX Do we need a useipcsysv variable here
15837 case "${d_msg}${d_sem}${d_shm}" in
15838 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
15841 *) avail_ext="$avail_ext $xxx"
15850 : Now see which nonxs extensions are supported on this system.
15851 : For now assume all are.
15853 for xxx in $nonxs_extensions ; do
15855 *) nonxs_ext="$nonxs_ext $xxx"
15867 A number of extensions are supplied with $package. You may choose to
15868 compile these extensions for dynamic loading (the default), compile
15869 them into the $package executable (static loading), or not include
15870 them at all. Answer "none" to include no extensions.
15871 Note that DynaLoader is always built and need not be mentioned here.
15874 case "$dynamic_ext" in
15875 '') dflt="$avail_ext" ;;
15876 *) dflt="$dynamic_ext"
15877 # Perhaps we are reusing an old out-of-date config.sh.
15880 if test X"$dynamic_ext" != X"$avail_ext"; then
15882 NOTICE: Your previous config.sh list may be incorrect.
15883 The extensions now available to you are
15885 but the default list from your previous config.sh is
15897 rp="What extensions do you wish to load dynamically?"
15900 none) dynamic_ext=' ' ;;
15901 *) dynamic_ext="$ans" ;;
15904 case "$static_ext" in
15906 : Exclude those already listed in dynamic linking
15908 for xxx in $avail_ext; do
15909 case " $dynamic_ext " in
15911 *) dflt="$dflt $xxx" ;;
15918 *) dflt="$static_ext"
15925 rp="What extensions do you wish to load statically?"
15928 none) static_ext=' ' ;;
15929 *) static_ext="$ans" ;;
15934 A number of extensions are supplied with $package. Answer "none"
15935 to include no extensions.
15936 Note that DynaLoader is always built and need not be mentioned here.
15939 case "$static_ext" in
15940 '') dflt="$avail_ext" ;;
15941 *) dflt="$static_ext"
15942 # Perhaps we are reusing an old out-of-date config.sh.
15945 if test X"$static_ext" != X"$avail_ext"; then
15947 NOTICE: Your previous config.sh list may be incorrect.
15948 The extensions now available to you are
15950 but the default list from your previous config.sh is
15959 : Exclude those that are not xs extensions
15963 rp="What extensions do you wish to include?"
15966 none) static_ext=' ' ;;
15967 *) static_ext="$ans" ;;
15972 set X $dynamic_ext $static_ext $nonxs_ext
15976 : Remove libraries needed only for extensions
15977 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
15978 : The exception is SunOS 4.x, which needs them.
15979 case "${osname}X${osvers}" in
15983 *) case "$usedl" in
15984 $define|true|[yY]*)
15985 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
15989 *) perllibs="$libs"
15995 : Remove build directory name from cppstdin so it can be used from
15996 : either the present location or the final installed location.
15998 : Get out of the UU directory to get correct path name.
16000 case "$cppstdin" in
16002 echo "Stripping down cppstdin path name"
16008 : end of configuration questions
16010 echo "End of configuration questions."
16013 : back to where it started
16014 if test -d ../UU; then
16018 : configuration may be patched via a 'config.over' file
16019 if $test -f config.over; then
16022 rp='I see a config.over file. Do you wish to load it?'
16025 n*) echo "OK, I'll ignore it.";;
16027 echo "Configuration override changes have been loaded."
16032 : in case they want portability, strip down executable paths
16033 case "$d_portable" in
16036 echo "Stripping down executable paths..." >&4
16037 for file in $loclist $trylist; do
16039 eval $file=`basename $temp`
16044 : create config.sh file
16046 echo "Creating config.sh..." >&4
16047 $spitshell <<EOT >config.sh
16050 # This file was produced by running the Configure script. It holds all the
16051 # definitions figured out by Configure. Should you modify one of these values,
16052 # do not forget to propagate your changes by running "Configure -der". You may
16053 # instead choose to run each of the .SH files by yourself, or "Configure -S".
16056 # Package name : $package
16057 # Source directory : $src
16058 # Configuration time: $cf_time
16059 # Configured by : $cf_by
16060 # Target system : $myuname
16070 Revision='$Revision'
16077 alignbytes='$alignbytes'
16078 ansi2knr='$ansi2knr'
16079 aphostname='$aphostname'
16080 api_revision='$api_revision'
16081 api_subversion='$api_subversion'
16082 api_version='$api_version'
16083 api_versionstring='$api_versionstring'
16086 archlibexp='$archlibexp'
16087 archname64='$archname64'
16088 archname='$archname'
16089 archobjs='$archobjs'
16094 bincompat5005='$bincompat5005'
16098 byteorder='$byteorder'
16100 castflags='$castflags'
16103 cccdlflags='$cccdlflags'
16104 ccdlflags='$ccdlflags'
16106 ccflags_uselargefiles='$ccflags_uselargefiles'
16108 ccsymbols='$ccsymbols'
16109 ccversion='$ccversion'
16111 cf_email='$cf_email'
16113 charsize='$charsize'
16117 clocktype='$clocktype'
16119 compress='$compress'
16120 contains='$contains'
16124 cpp_stuff='$cpp_stuff'
16125 cppccsymbols='$cppccsymbols'
16126 cppflags='$cppflags'
16128 cppminus='$cppminus'
16130 cppstdin='$cppstdin'
16131 cppsymbols='$cppsymbols'
16132 crosscompile='$crosscompile'
16133 cryptlib='$cryptlib'
16135 d_Gconvert='$d_Gconvert'
16136 d_PRIEUldbl='$d_PRIEUldbl'
16137 d_PRIFUldbl='$d_PRIFUldbl'
16138 d_PRIGUldbl='$d_PRIGUldbl'
16139 d_PRIXU64='$d_PRIXU64'
16140 d_PRId64='$d_PRId64'
16141 d_PRIeldbl='$d_PRIeldbl'
16142 d_PRIfldbl='$d_PRIfldbl'
16143 d_PRIgldbl='$d_PRIgldbl'
16144 d_PRIi64='$d_PRIi64'
16145 d_PRIo64='$d_PRIo64'
16146 d_PRIu64='$d_PRIu64'
16147 d_PRIx64='$d_PRIx64'
16148 d_SCNfldbl='$d_SCNfldbl'
16149 d__fwalk='$d__fwalk'
16150 d_access='$d_access'
16151 d_accessx='$d_accessx'
16153 d_archlib='$d_archlib'
16156 d_attribut='$d_attribut'
16159 d_bincompat5005='$d_bincompat5005'
16161 d_bsdgetpgrp='$d_bsdgetpgrp'
16162 d_bsdsetpgrp='$d_bsdsetpgrp'
16164 d_casti32='$d_casti32'
16165 d_castneg='$d_castneg'
16166 d_charvspr='$d_charvspr'
16168 d_chroot='$d_chroot'
16169 d_chsize='$d_chsize'
16170 d_closedir='$d_closedir'
16171 d_cmsghdr_s='$d_cmsghdr_s'
16175 d_cuserid='$d_cuserid'
16176 d_dbl_dig='$d_dbl_dig'
16177 d_difftime='$d_difftime'
16178 d_dirnamlen='$d_dirnamlen'
16179 d_dlerror='$d_dlerror'
16180 d_dlopen='$d_dlopen'
16181 d_dlsymun='$d_dlsymun'
16182 d_dosuid='$d_dosuid'
16183 d_drand48proto='$d_drand48proto'
16185 d_eaccess='$d_eaccess'
16186 d_endgrent='$d_endgrent'
16187 d_endhent='$d_endhent'
16188 d_endnent='$d_endnent'
16189 d_endpent='$d_endpent'
16190 d_endpwent='$d_endpwent'
16191 d_endsent='$d_endsent'
16192 d_eofnblk='$d_eofnblk'
16193 d_eunice='$d_eunice'
16194 d_fchmod='$d_fchmod'
16195 d_fchown='$d_fchown'
16197 d_fcntl_can_lock='$d_fcntl_can_lock'
16198 d_fd_macros='$d_fd_macros'
16199 d_fd_set='$d_fd_set'
16200 d_fds_bits='$d_fds_bits'
16201 d_fgetpos='$d_fgetpos'
16202 d_flexfnam='$d_flexfnam'
16205 d_fpathconf='$d_fpathconf'
16206 d_fpos64_t='$d_fpos64_t'
16207 d_frexpl='$d_frexpl'
16208 d_fs_data_s='$d_fs_data_s'
16209 d_fseeko='$d_fseeko'
16210 d_fsetpos='$d_fsetpos'
16211 d_fstatfs='$d_fstatfs'
16212 d_fstatvfs='$d_fstatvfs'
16214 d_ftello='$d_ftello'
16216 d_getcwd='$d_getcwd'
16217 d_getespwnam='$d_getespwnam'
16218 d_getfsstat='$d_getfsstat'
16219 d_getgrent='$d_getgrent'
16220 d_getgrps='$d_getgrps'
16221 d_gethbyaddr='$d_gethbyaddr'
16222 d_gethbyname='$d_gethbyname'
16223 d_gethent='$d_gethent'
16224 d_gethname='$d_gethname'
16225 d_gethostprotos='$d_gethostprotos'
16226 d_getitimer='$d_getitimer'
16227 d_getlogin='$d_getlogin'
16228 d_getmnt='$d_getmnt'
16229 d_getmntent='$d_getmntent'
16230 d_getnbyaddr='$d_getnbyaddr'
16231 d_getnbyname='$d_getnbyname'
16232 d_getnent='$d_getnent'
16233 d_getnetprotos='$d_getnetprotos'
16234 d_getpagsz='$d_getpagsz'
16235 d_getpbyname='$d_getpbyname'
16236 d_getpbynumber='$d_getpbynumber'
16237 d_getpent='$d_getpent'
16238 d_getpgid='$d_getpgid'
16239 d_getpgrp2='$d_getpgrp2'
16240 d_getpgrp='$d_getpgrp'
16241 d_getppid='$d_getppid'
16242 d_getprior='$d_getprior'
16243 d_getprotoprotos='$d_getprotoprotos'
16244 d_getprpwnam='$d_getprpwnam'
16245 d_getpwent='$d_getpwent'
16246 d_getsbyname='$d_getsbyname'
16247 d_getsbyport='$d_getsbyport'
16248 d_getsent='$d_getsent'
16249 d_getservprotos='$d_getservprotos'
16250 d_getspnam='$d_getspnam'
16251 d_gettimeod='$d_gettimeod'
16252 d_gnulibc='$d_gnulibc'
16253 d_grpasswd='$d_grpasswd'
16254 d_hasmntopt='$d_hasmntopt'
16258 d_inetaton='$d_inetaton'
16259 d_int64_t='$d_int64_t'
16260 d_isascii='$d_isascii'
16262 d_isnanl='$d_isnanl'
16263 d_killpg='$d_killpg'
16264 d_lchown='$d_lchown'
16265 d_ldbl_dig='$d_ldbl_dig'
16267 d_locconv='$d_locconv'
16269 d_longdbl='$d_longdbl'
16270 d_longlong='$d_longlong'
16271 d_lseekproto='$d_lseekproto'
16273 d_madvise='$d_madvise'
16275 d_mbstowcs='$d_mbstowcs'
16276 d_mbtowc='$d_mbtowc'
16277 d_memchr='$d_memchr'
16278 d_memcmp='$d_memcmp'
16279 d_memcpy='$d_memcpy'
16280 d_memmove='$d_memmove'
16281 d_memset='$d_memset'
16283 d_mkdtemp='$d_mkdtemp'
16284 d_mkfifo='$d_mkfifo'
16285 d_mkstemp='$d_mkstemp'
16286 d_mkstemps='$d_mkstemps'
16287 d_mktime='$d_mktime'
16290 d_mprotect='$d_mprotect'
16292 d_msg_ctrunc='$d_msg_ctrunc'
16293 d_msg_dontroute='$d_msg_dontroute'
16294 d_msg_oob='$d_msg_oob'
16295 d_msg_peek='$d_msg_peek'
16296 d_msg_proxy='$d_msg_proxy'
16297 d_msgctl='$d_msgctl'
16298 d_msgget='$d_msgget'
16299 d_msghdr_s='$d_msghdr_s'
16300 d_msgrcv='$d_msgrcv'
16301 d_msgsnd='$d_msgsnd'
16303 d_munmap='$d_munmap'
16304 d_mymalloc='$d_mymalloc'
16306 d_nv_preserves_uv='$d_nv_preserves_uv'
16307 d_nv_preserves_uv_bits='$d_nv_preserves_uv_bits'
16308 d_off64_t='$d_off64_t'
16309 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
16310 d_oldpthreads='$d_oldpthreads'
16311 d_oldsock='$d_oldsock'
16313 d_pathconf='$d_pathconf'
16315 d_perl_otherlibdirs='$d_perl_otherlibdirs'
16316 d_phostname='$d_phostname'
16319 d_portable='$d_portable'
16320 d_pthread_yield='$d_pthread_yield'
16322 d_pwchange='$d_pwchange'
16323 d_pwclass='$d_pwclass'
16324 d_pwcomment='$d_pwcomment'
16325 d_pwexpire='$d_pwexpire'
16326 d_pwgecos='$d_pwgecos'
16327 d_pwpasswd='$d_pwpasswd'
16328 d_pwquota='$d_pwquota'
16331 d_readdir='$d_readdir'
16332 d_readlink='$d_readlink'
16334 d_recvmsg='$d_recvmsg'
16335 d_rename='$d_rename'
16336 d_rewinddir='$d_rewinddir'
16338 d_safebcpy='$d_safebcpy'
16339 d_safemcpy='$d_safemcpy'
16340 d_sanemcmp='$d_sanemcmp'
16341 d_sbrkproto='$d_sbrkproto'
16342 d_sched_yield='$d_sched_yield'
16343 d_scm_rights='$d_scm_rights'
16344 d_seekdir='$d_seekdir'
16345 d_select='$d_select'
16347 d_semctl='$d_semctl'
16348 d_semctl_semid_ds='$d_semctl_semid_ds'
16349 d_semctl_semun='$d_semctl_semun'
16350 d_semget='$d_semget'
16352 d_sendmsg='$d_sendmsg'
16353 d_setegid='$d_setegid'
16354 d_seteuid='$d_seteuid'
16355 d_setgrent='$d_setgrent'
16356 d_setgrps='$d_setgrps'
16357 d_sethent='$d_sethent'
16358 d_setitimer='$d_setitimer'
16359 d_setlinebuf='$d_setlinebuf'
16360 d_setlocale='$d_setlocale'
16361 d_setnent='$d_setnent'
16362 d_setpent='$d_setpent'
16363 d_setpgid='$d_setpgid'
16364 d_setpgrp2='$d_setpgrp2'
16365 d_setpgrp='$d_setpgrp'
16366 d_setprior='$d_setprior'
16367 d_setproctitle='$d_setproctitle'
16368 d_setpwent='$d_setpwent'
16369 d_setregid='$d_setregid'
16370 d_setresgid='$d_setresgid'
16371 d_setresuid='$d_setresuid'
16372 d_setreuid='$d_setreuid'
16373 d_setrgid='$d_setrgid'
16374 d_setruid='$d_setruid'
16375 d_setsent='$d_setsent'
16376 d_setsid='$d_setsid'
16377 d_setvbuf='$d_setvbuf'
16381 d_shmatprototype='$d_shmatprototype'
16382 d_shmctl='$d_shmctl'
16384 d_shmget='$d_shmget'
16385 d_sigaction='$d_sigaction'
16386 d_sigprocmask='$d_sigprocmask'
16387 d_sigsetjmp='$d_sigsetjmp'
16388 d_sockatmark='$d_sockatmark'
16389 d_socket='$d_socket'
16390 d_socklen_t='$d_socklen_t'
16391 d_sockpair='$d_sockpair'
16392 d_socks5_init='$d_socks5_init'
16394 d_statblks='$d_statblks'
16395 d_statfs_f_flags='$d_statfs_f_flags'
16396 d_statfs_s='$d_statfs_s'
16397 d_statvfs='$d_statvfs'
16398 d_stdio_cnt_lval='$d_stdio_cnt_lval'
16399 d_stdio_ptr_lval='$d_stdio_ptr_lval'
16400 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
16401 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
16402 d_stdio_stream_array='$d_stdio_stream_array'
16403 d_stdiobase='$d_stdiobase'
16404 d_stdstdio='$d_stdstdio'
16405 d_strchr='$d_strchr'
16406 d_strcoll='$d_strcoll'
16407 d_strctcpy='$d_strctcpy'
16408 d_strerrm='$d_strerrm'
16409 d_strerror='$d_strerror'
16410 d_strtod='$d_strtod'
16411 d_strtol='$d_strtol'
16412 d_strtold='$d_strtold'
16413 d_strtoll='$d_strtoll'
16414 d_strtoq='$d_strtoq'
16415 d_strtoul='$d_strtoul'
16416 d_strtoull='$d_strtoull'
16417 d_strtouq='$d_strtouq'
16418 d_strxfrm='$d_strxfrm'
16419 d_suidsafe='$d_suidsafe'
16420 d_symlink='$d_symlink'
16421 d_syscall='$d_syscall'
16422 d_sysconf='$d_sysconf'
16423 d_sysernlst='$d_sysernlst'
16424 d_syserrlst='$d_syserrlst'
16425 d_system='$d_system'
16426 d_tcgetpgrp='$d_tcgetpgrp'
16427 d_tcsetpgrp='$d_tcsetpgrp'
16428 d_telldir='$d_telldir'
16429 d_telldirproto='$d_telldirproto'
16432 d_truncate='$d_truncate'
16433 d_tzname='$d_tzname'
16434 d_u32align='$d_u32align'
16435 d_ualarm='$d_ualarm'
16438 d_union_semun='$d_union_semun'
16439 d_usleep='$d_usleep'
16441 d_vendorarch='$d_vendorarch'
16442 d_vendorbin='$d_vendorbin'
16443 d_vendorlib='$d_vendorlib'
16445 d_void_closedir='$d_void_closedir'
16446 d_voidsig='$d_voidsig'
16447 d_voidtty='$d_voidtty'
16448 d_volatile='$d_volatile'
16449 d_vprintf='$d_vprintf'
16451 d_waitpid='$d_waitpid'
16452 d_wcstombs='$d_wcstombs'
16453 d_wctomb='$d_wctomb'
16454 d_writev='$d_writev'
16457 db_hashtype='$db_hashtype'
16458 db_prefixtype='$db_prefixtype'
16459 defvoidused='$defvoidused'
16460 direntrytype='$direntrytype'
16463 doublesize='$doublesize'
16465 dynamic_ext='$dynamic_ext'
16471 eunicefix='$eunicefix'
16474 extensions='$extensions'
16475 fflushNULL='$fflushNULL'
16476 fflushall='$fflushall'
16478 firstmakefile='$firstmakefile'
16480 fpossize='$fpossize'
16481 fpostype='$fpostype'
16482 freetype='$freetype'
16484 full_csh='$full_csh'
16485 full_sed='$full_sed'
16486 gccosandvers='$gccosandvers'
16487 gccversion='$gccversion'
16488 gidformat='$gidformat'
16494 groupcat='$groupcat'
16495 groupstype='$groupstype'
16498 h_sysfile='$h_sysfile'
16509 i_arpainet='$i_arpainet'
16510 i_bsdioctl='$i_bsdioctl'
16513 i_dirent='$i_dirent'
16521 i_ieeefp='$i_ieeefp'
16522 i_inttypes='$i_inttypes'
16523 i_libutil='$i_libutil'
16524 i_limits='$i_limits'
16525 i_locale='$i_locale'
16526 i_machcthr='$i_machcthr'
16527 i_malloc='$i_malloc'
16529 i_memory='$i_memory'
16530 i_mntent='$i_mntent'
16533 i_neterrno='$i_neterrno'
16534 i_netinettcp='$i_netinettcp'
16538 i_pthread='$i_pthread'
16540 i_rpcsvcdbm='$i_rpcsvcdbm'
16543 i_shadow='$i_shadow'
16545 i_stdarg='$i_stdarg'
16546 i_stddef='$i_stddef'
16547 i_stdlib='$i_stdlib'
16548 i_string='$i_string'
16549 i_sunmath='$i_sunmath'
16550 i_sysaccess='$i_sysaccess'
16551 i_sysdir='$i_sysdir'
16552 i_sysfile='$i_sysfile'
16553 i_sysfilio='$i_sysfilio'
16555 i_sysioctl='$i_sysioctl'
16556 i_syslog='$i_syslog'
16557 i_sysmman='$i_sysmman'
16558 i_sysmode='$i_sysmode'
16559 i_sysmount='$i_sysmount'
16560 i_sysndir='$i_sysndir'
16561 i_sysparam='$i_sysparam'
16562 i_sysresrc='$i_sysresrc'
16563 i_syssecrt='$i_syssecrt'
16564 i_sysselct='$i_sysselct'
16565 i_syssockio='$i_syssockio'
16566 i_sysstat='$i_sysstat'
16567 i_sysstatfs='$i_sysstatfs'
16568 i_sysstatvfs='$i_sysstatvfs'
16569 i_systime='$i_systime'
16570 i_systimek='$i_systimek'
16571 i_systimes='$i_systimes'
16572 i_systypes='$i_systypes'
16573 i_sysuio='$i_sysuio'
16575 i_sysutsname='$i_sysutsname'
16576 i_sysvfs='$i_sysvfs'
16577 i_syswait='$i_syswait'
16578 i_termio='$i_termio'
16579 i_termios='$i_termios'
16581 i_unistd='$i_unistd'
16584 i_values='$i_values'
16585 i_varargs='$i_varargs'
16586 i_varhdr='$i_varhdr'
16588 ignore_versioned_solibs='$ignore_versioned_solibs'
16589 inc_version_list='$inc_version_list'
16590 inc_version_list_init='$inc_version_list_init'
16593 installarchlib='$installarchlib'
16594 installbin='$installbin'
16595 installman1dir='$installman1dir'
16596 installman3dir='$installman3dir'
16597 installprefix='$installprefix'
16598 installprefixexp='$installprefixexp'
16599 installprivlib='$installprivlib'
16600 installscript='$installscript'
16601 installsitearch='$installsitearch'
16602 installsitebin='$installsitebin'
16603 installsitelib='$installsitelib'
16604 installstyle='$installstyle'
16605 installusrbinperl='$installusrbinperl'
16606 installvendorarch='$installvendorarch'
16607 installvendorbin='$installvendorbin'
16608 installvendorlib='$installvendorlib'
16610 issymlink='$issymlink'
16611 ivdformat='$ivdformat'
16614 known_extensions='$known_extensions'
16617 lddlflags='$lddlflags'
16619 ldflags_uselargefiles='$ldflags_uselargefiles'
16620 ldlibpthname='$ldlibpthname'
16627 libsdirs='$libsdirs'
16628 libsfiles='$libsfiles'
16629 libsfound='$libsfound'
16630 libspath='$libspath'
16631 libswanted='$libswanted'
16632 libswanted_uselargefiles='$libswanted_uselargefiles'
16638 locincpth='$locincpth'
16639 loclibpth='$loclibpth'
16640 longdblsize='$longdblsize'
16641 longlongsize='$longlongsize'
16642 longsize='$longsize'
16646 lseeksize='$lseeksize'
16647 lseektype='$lseektype'
16651 make_set_make='$make_set_make'
16652 mallocobj='$mallocobj'
16653 mallocsrc='$mallocsrc'
16654 malloctype='$malloctype'
16656 man1direxp='$man1direxp'
16659 man3direxp='$man3direxp'
16661 mips_type='$mips_type'
16663 mmaptype='$mmaptype'
16664 modetype='$modetype'
16666 multiarch='$multiarch'
16668 myarchname='$myarchname'
16669 mydomain='$mydomain'
16670 myhostname='$myhostname'
16673 need_va_copy='$need_va_copy'
16674 netdb_hlen_type='$netdb_hlen_type'
16675 netdb_host_type='$netdb_host_type'
16676 netdb_name_type='$netdb_name_type'
16677 netdb_net_type='$netdb_net_type'
16680 nm_so_opt='$nm_so_opt'
16681 nonxs_ext='$nonxs_ext'
16683 nvEUformat='$nvEUformat'
16684 nvFUformat='$nvFUformat'
16685 nvGUformat='$nvGUformat'
16686 nveformat='$nveformat'
16687 nvfformat='$nvfformat'
16688 nvgformat='$nvgformat'
16691 o_nonblock='$o_nonblock'
16693 old_pthread_create_joinable='$old_pthread_create_joinable'
16694 optimize='$optimize'
16695 orderlib='$orderlib'
16698 otherlibdirs='$otherlibdirs'
16702 patchlevel='$patchlevel'
16703 path_sep='$path_sep'
16706 perladmin='$perladmin'
16707 perllibs='$perllibs'
16708 perlpath='$perlpath'
16710 phostname='$phostname'
16713 pm_apiversion='$pm_apiversion'
16717 prefixexp='$prefixexp'
16719 privlibexp='$privlibexp'
16720 prototype='$prototype'
16722 quadkind='$quadkind'
16723 quadtype='$quadtype'
16724 randbits='$randbits'
16725 randfunc='$randfunc'
16726 randseedtype='$randseedtype'
16728 rd_nodata='$rd_nodata'
16729 revision='$revision'
16733 sPRIEUldbl='$sPRIEUldbl'
16734 sPRIFUldbl='$sPRIFUldbl'
16735 sPRIGUldbl='$sPRIGUldbl'
16736 sPRIXU64='$sPRIXU64'
16738 sPRIeldbl='$sPRIeldbl'
16739 sPRIfldbl='$sPRIfldbl'
16740 sPRIgldbl='$sPRIgldbl'
16745 sSCNfldbl='$sSCNfldbl'
16746 sched_yield='$sched_yield'
16747 scriptdir='$scriptdir'
16748 scriptdirexp='$scriptdirexp'
16750 seedfunc='$seedfunc'
16751 selectminbits='$selectminbits'
16752 selecttype='$selecttype'
16753 sendmail='$sendmail'
16756 sharpbang='$sharpbang'
16757 shmattype='$shmattype'
16758 shortsize='$shortsize'
16761 sig_count='$sig_count'
16762 sig_name='$sig_name'
16763 sig_name_init='$sig_name_init'
16765 sig_num_init='$sig_num_init'
16766 sig_size='$sig_size'
16767 signal_t='$signal_t'
16768 sitearch='$sitearch'
16769 sitearchexp='$sitearchexp'
16771 sitebinexp='$sitebinexp'
16773 sitelib_stem='$sitelib_stem'
16774 sitelibexp='$sitelibexp'
16775 siteprefix='$siteprefix'
16776 siteprefixexp='$siteprefixexp'
16777 sizesize='$sizesize'
16778 sizetype='$sizetype'
16782 sockethdr='$sockethdr'
16783 socketlib='$socketlib'
16784 socksizetype='$socksizetype'
16786 spackage='$spackage'
16787 spitshell='$spitshell'
16789 ssizetype='$ssizetype'
16790 startperl='$startperl'
16792 static_ext='$static_ext'
16794 stdio_base='$stdio_base'
16795 stdio_bufsiz='$stdio_bufsiz'
16796 stdio_cnt='$stdio_cnt'
16797 stdio_filbuf='$stdio_filbuf'
16798 stdio_ptr='$stdio_ptr'
16799 stdio_stream_array='$stdio_stream_array'
16802 subversion='$subversion'
16809 timeincl='$timeincl'
16810 timetype='$timetype'
16823 uidformat='$uidformat'
16829 uquadtype='$uquadtype'
16830 use5005threads='$use5005threads'
16831 use64bitall='$use64bitall'
16832 use64bitint='$use64bitint'
16834 useithreads='$useithreads'
16835 uselargefiles='$uselargefiles'
16836 uselongdouble='$uselongdouble'
16837 usemorebits='$usemorebits'
16838 usemultiplicity='$usemultiplicity'
16839 usemymalloc='$usemymalloc'
16841 useopcode='$useopcode'
16842 useperlio='$useperlio'
16843 useposix='$useposix'
16845 useshrplib='$useshrplib'
16846 usesocks='$usesocks'
16847 usethreads='$usethreads'
16848 usevendorprefix='$usevendorprefix'
16849 usevfork='$usevfork'
16852 uvXUformat='$uvXUformat'
16853 uvoformat='$uvoformat'
16856 uvuformat='$uvuformat'
16857 uvxformat='$uvxformat'
16858 vendorarch='$vendorarch'
16859 vendorarchexp='$vendorarchexp'
16860 vendorbin='$vendorbin'
16861 vendorbinexp='$vendorbinexp'
16862 vendorlib='$vendorlib'
16863 vendorlib_stem='$vendorlib_stem'
16864 vendorlibexp='$vendorlibexp'
16865 vendorprefix='$vendorprefix'
16866 vendorprefixexp='$vendorprefixexp'
16868 versiononly='$versiononly'
16870 voidflags='$voidflags'
16872 xs_apiversion='$xs_apiversion'
16874 yaccflags='$yaccflags'
16879 : Add in command line options if available
16880 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
16882 : add special variables
16883 $test -f $src/patchlevel.h && \
16884 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
16885 echo "CONFIGDOTSH=true" >>config.sh
16887 : propagate old symbols
16888 if $test -f UU/config.sh; then
16889 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
16890 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
16891 $sort | $uniq -u >UU/oldsyms
16892 set X `cat UU/oldsyms`
16898 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
16900 echo "# Variables propagated from previous config.sh file." >>config.sh
16901 for sym in `cat UU/oldsyms`; do
16902 echo " Propagating $hint variable "'$'"$sym..."
16903 eval 'tmp="$'"${sym}"'"'
16905 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
16911 : Finish up by extracting the .SH files
16925 If you'd like to make any changes to the config.sh file before I begin
16926 to configure things, do it as a shell escape now (e.g. !vi config.sh).
16929 rp="Press return or use a shell escape to edit config.sh:"
16934 *) : in case they cannot read
16935 sh 1>&4 -c "$ans";;
16940 : if this fails, just run all the .SH files by hand
16947 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
16954 Now you need to generate make dependencies by running "$make depend".
16955 You might prefer to run it in background: "$make depend > makedepend.out &"
16956 It can take a while, so you might not want to run it right now.
16961 rp="Run $make depend now?"
16965 $make depend && echo "Now you must run '$make'."
16968 echo "You must run '$make depend' then '$make'."
16971 elif test -f [Mm]akefile; then
16973 echo "Now you must run a $make."
16978 if $test -f Policy.sh; then
16981 If you compile $package on a different machine or from a different object
16982 directory, copy the Policy.sh file from this object directory to the
16983 new one before you run Configure -- this will help you with most of
16984 the policy defaults.
16988 if $test -f config.msg; then
16989 echo "Hmm. I also noted the following information while running:"
16991 $cat config.msg >&4
16994 $rm -f kit*isdone ark*isdone