3 # If these # comments don't work, trim them. Don't worry about any other
4 # shell scripts, Configure will trim # comments from them for you.
6 # (If you are trying to port this package to a machine without sh,
7 # I would suggest you have a look at the prototypical config_h.SH file
8 # and edit it to reflect your system. Some packages may include samples
9 # of config.h for certain machines, so you might look for one of those.)
11 # Yes, you may rip this off to use in other distribution packages. This
12 # script belongs to the public domain and cannot be copyrighted.
14 # (Note: this Configure script was generated automatically. Rather than
15 # working with this copy of Configure, you may wish to get metaconfig.
16 # The dist-3.0 package (which contains metaconfig) was posted in
17 # comp.sources.misc and is available on CPAN under authors/id/RAM so
18 # you may fetch it yourself from your nearest archive site.)
21 # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
23 # Generated on Mon Jun 4 06:11:38 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
469 d_old_pthread_create_joinable=''
470 old_pthread_create_joinable=''
557 d_stdio_ptr_lval_nochange_cnt=''
558 d_stdio_ptr_lval_sets_cnt=''
738 inc_version_list_init=''
757 ignore_versioned_solibs=''
816 d_perl_otherlibdirs=''
834 d_nv_preserves_uv_bits=''
933 d_stdio_stream_array=''
934 stdio_stream_array=''
944 ccflags_uselargefiles=''
945 ldflags_uselargefiles=''
946 libswanted_uselargefiles=''
991 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
994 : We must find out about Eunice early
996 if test -f /etc/unixtovms; then
997 eunicefix=/etc/unixtovms
999 if test -f /etc/unixtovms.exe; then
1000 eunicefix=/etc/unixtovms.exe
1007 : set useposix=false in your hint file to disable the POSIX extension.
1009 : set useopcode=false in your hint file to disable the Opcode extension.
1011 : Trailing extension. Override this in a hint file, if needed.
1013 : Extra object files, if any, needed on this platform.
1016 : Possible local include directories to search.
1017 : Set locincpth to "" in a hint file to defeat local include searches.
1018 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1019 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1021 : no include file wanted by default
1025 : change the next line if compiling for Xenix/286 on Xenix/386
1026 xlibpth='/usr/lib/386 /lib/386'
1027 : Possible local library directories to search.
1028 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1029 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1031 : general looking path for locating libraries
1032 glibpth="/lib /usr/lib $xlibpth"
1033 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1034 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1035 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1037 : Private path used by Configure to find libraries. Its value
1038 : is prepended to libpth. This variable takes care of special
1039 : machines, like the mips. Usually, it should be empty.
1042 : default library list
1044 : some systems want to use only the non-versioned libso:s
1045 ignore_versioned_solibs=''
1047 ccflags_uselargefiles=''
1048 ldflags_uselargefiles=''
1049 libswanted_uselargefiles=''
1050 : set usemultiplicity on the Configure command line to enable multiplicity.
1051 : set usesocks on the Configure command line to enable socks.
1052 : set usethreads on the Configure command line to enable threads.
1053 : full support for void wanted by default
1056 : List of libraries we want.
1057 : If anyone needs -lnet, put it in a hint file.
1058 libswanted='sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl'
1059 libswanted="$libswanted dld ld sun m c cposix posix"
1060 libswanted="$libswanted ndir dir crypt sec"
1061 libswanted="$libswanted ucb bsd BSD PW x iconv util"
1062 : We probably want to search /usr/shlib before most other libraries.
1063 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1064 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1065 glibpth="/usr/shlib $glibpth"
1066 : Do not use vfork unless overridden by a hint file.
1069 : Find the basic shell for Bourne shell scripts
1073 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1076 if test -f "$xxx"; then
1079 : Build up a list and do a single loop so we can 'break' out.
1080 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1081 for xxx in sh bash ksh pdksh ash; do
1083 try="$try ${p}/${xxx}"
1087 if test -f "$xxx"; then
1090 elif test -f "$xxx.exe"; then
1101 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1103 Usually it's in /bin/sh. How did you even get this far?
1104 Please contact me (Perl Maintainers) at perlbug@perl.org and
1105 we'll try to straighten this all out.
1111 : see if sh knows # comments
1112 if `$sh -c '#' >/dev/null 2>&1`; then
1116 test -f $xcat || xcat=/usr/bin/cat
1121 if test -s today; then
1124 echo "#! $xcat" > try
1128 if test -s today; then
1136 echo "Your $sh doesn't grok # comments--I will strip them later on."
1139 echo "exec grep -v '^[ ]*#'" >spitshell
1141 $eunicefix spitshell
1142 spitshell=`pwd`/spitshell
1144 echo "I presume that if # doesn't work, #! won't work either!"
1149 : figure out how to guarantee sh startup
1151 '') startsh=${sharpbang}${sh} ;;
1163 : echo "Yup, it does."
1165 echo "Hmm... '$startsh' does not guarantee sh startup..."
1166 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1171 : Save command line options in file UU/cmdline.opt for later use in
1172 : generating config.sh.
1173 cat > cmdline.opt <<EOSH
1174 # Configure command line arguments.
1181 cat >>cmdline.opt <<EOSH
1182 config_arg$argn='$arg'
1184 argn=`expr $argn + 1`
1187 : produce awk script to parse command line options
1188 cat >options.awk <<'EOF'
1190 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1192 len = length(optstr);
1193 for (i = 1; i <= len; i++) {
1194 c = substr(optstr, i, 1);
1195 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1206 if (substr(str, 1, 1) != "-") {
1207 printf("'%s'\n", str);
1211 for (i = 2; i <= len; i++) {
1212 c = substr(str, i, 1);
1214 printf("-%s\n", substr(str, i));
1220 printf("'%s'\n", substr(str, i + 1));
1233 : process the command line options
1234 set X `for arg in "$@"; do echo "X$arg"; done |
1235 sed -e s/X// | awk -f options.awk`
1240 : set up default values
1250 rm -f optdef.sh posthint.sh
1251 cat >optdef.sh <<EOS
1257 while test $# -gt 0; do
1259 -d) shift; fastread=yes;;
1260 -e) shift; alldone=cont;;
1264 if test -r "$1"; then
1267 echo "$me: cannot read config file $1." >&2
1272 -h) shift; error=true;;
1273 -r) shift; reuseval=true;;
1274 -s) shift; silent=true; realsilent=true;;
1275 -E) shift; alldone=exit;;
1276 -K) shift; knowitall=true;;
1277 -O) shift; override=true;;
1278 -S) shift; silent=true; extractsh=true;;
1283 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1284 echo "$me: ignoring -D $1" >&2
1287 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1288 *) echo "$1='define'" >> optdef.sh;;
1295 *=) echo "$1" >> optdef.sh;;
1297 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1298 echo "$me: ignoring -U $1" >&2
1300 *) echo "$1='undef'" >> optdef.sh;;
1311 *=*) zzz=`echo $yyy|sed 's!=.*!!'`
1315 zzz=" "`echo $yyy|sed 's!^[^=]*=!!'`
1316 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1322 *:*) xxx=`echo $yyy|sed 's!:.*!!'`
1323 yyy=`echo $yyy|sed 's!^[^:]*:!!'`
1324 zzz=`echo $yyy|sed 's!^[^=]*=!!'`
1325 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1326 *) xxx=`echo $yyy|sed 's!:.*!!'`
1327 yyy=`echo $yyy|sed 's!^[^:]*:!!'` ;;
1333 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1335 echo "$yyy=''" >> posthint.sh ;;
1340 echo "$yyy='$zzz'" >> posthint.sh ;;
1342 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1344 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1349 echo "$yyy=$zzz" >> posthint.sh ;;
1350 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1354 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1357 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1365 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1366 [-U symbol] [-U symbol=] [-A command:symbol...]
1367 -d : use defaults for all answers.
1368 -e : go on without questioning past the production of config.sh.
1369 -f : specify an alternate default configuration file.
1370 -h : print this help message and exit (with an error status).
1371 -r : reuse C symbols value if possible (skips costly nm extraction).
1372 -s : silent mode, only echoes questions and essential information.
1373 -D : define symbol to have some value:
1374 -D symbol symbol gets the value 'define'
1375 -D symbol=value symbol gets the value 'value'
1376 -E : stop at the end of questions, after having produced config.sh.
1377 -K : do not use unless you know what you are doing.
1378 -O : let -D and -U override definitions from loaded configuration file.
1379 -S : perform variable substitutions on all .SH files (can mix with -f)
1380 -U : undefine symbol:
1381 -U symbol symbol gets the value 'undef'
1382 -U symbol= symbol gets completely empty
1383 -A : manipulate symbol after the platform specific hints have been applied:
1384 -A symbol=value append " "value to symbol
1385 -A append:symbol=value append value to symbol
1386 -A define:symbol=value define symbol to have value
1387 -A clear:symbol define symbol to be ''
1388 -A define:symbol define symbol to be 'define'
1389 -A eval:symbol=value define symbol to be eval of value
1390 -A prepend:symbol=value prepend value to symbol
1391 -A undef:symbol define symbol to be 'undef'
1392 -A undef:symbol= define symbol to be ''
1393 -V : print version number and exit (with a zero status).
1400 case "$fastread$alldone" in
1403 case "$extractsh" in
1406 if test ! -t 0; then
1407 echo "Say 'sh Configure', not 'sh <Configure'"
1417 true) exec 1>/dev/null;;
1420 : run the defines and the undefines, if any, but leave the file out there...
1423 : create the posthint manipulation script and leave the file out there...
1428 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1429 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1430 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1431 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1432 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1435 : Some greps do not return status, grrr.
1436 echo "grimblepritz" >grimble
1437 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1439 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1445 : the following should work in any shell
1449 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1450 cat >contains <<'EOSS'
1451 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1456 : Find the path to the source tree
1459 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1463 *) src=`cd ../$src && pwd` ;;
1476 if test -f $rsrc/Configure && \
1477 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1479 : found it, so we are ok.
1482 for src in . .. ../.. ../../.. ../../../..; do
1483 if test -f ../$src/Configure && \
1484 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1495 Sorry, I can't seem to locate the source dir for $package. Please start
1496 Configure with an explicit path -- i.e. /some/path/Configure.
1504 echo "Sources for $package found in \"$src\"." >&4
1508 : script used to extract .SH files with variable substitutions
1509 cat >extract <<'EOS'
1511 echo "Doing variable substitutions on .SH files..."
1512 if test -f $src/MANIFEST; then
1513 set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH$'`
1515 echo "(Looking for .SH files under the source directory.)"
1516 set x `(cd $src; find . -name "*.SH" -print)`
1520 0) set x `(cd $src; echo *.SH)`; shift;;
1522 if test ! -f $src/$1; then
1528 while test $name; do
1529 if test ! -d "$name"; then
1530 create="$name $create";
1531 name=`echo $name | sed -e "s|^[^/]*$||"`;
1532 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1537 for file in $create; do
1546 dir=`expr X$file : 'X\(.*\)/'`
1547 file=`expr X$file : 'X.*/\(.*\)'`
1548 (cd $dir && . ./$file)
1558 dir=`expr X$file : 'X\(.*\)/'`
1559 file=`expr X$file : 'X.*/\(.*\)'`
1560 (set x $dir; shift; eval $mkdir_p)
1570 if test -f $src/config_h.SH; then
1571 if test ! -f config.h; then
1572 : oops, they left it out of MANIFEST, probably, so do it anyway.
1578 : extract files and exit if asked to do so
1579 case "$extractsh" in
1581 case "$realsilent" in
1585 case "$config_sh" in
1586 '') config_sh='config.sh';;
1589 echo "Fetching answers from $config_sh..."
1592 test "$override" && . ./optdef.sh
1601 : Eunice requires " " instead of "", can you believe it
1604 echo "Beginning of configuration questions for $package."
1606 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1608 : first determine how to suppress newline on echo command
1610 echo "Checking echo to see how to suppress newlines..."
1611 (echo "hi there\c" ; echo " ") >.echotmp
1612 if $contains c .echotmp >/dev/null 2>&1 ; then
1623 echo $n "The star should be here-->$c"
1627 : Now test for existence of everything in MANIFEST
1629 if test -f $rsrc/MANIFEST; then
1630 echo "First let's make sure your kit is complete. Checking..." >&4
1631 awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
1634 for filelist in x??; do
1635 (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
1637 if test -s missing; then
1641 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1643 You have the option of continuing the configuration process, despite the
1644 distinct possibility that your kit is damaged, by typing 'y'es. If you
1645 do, don't blame me if something goes wrong. I advise you to type 'n'o
1646 and contact the author (perlbug@perl.org).
1649 echo $n "Continue? [n] $c" >&4
1653 echo "Continuing..." >&4
1657 echo "ABORTING..." >&4
1662 echo "Looks good..."
1665 echo "There is no MANIFEST file. I hope your kit is complete !"
1670 : Find the appropriate value for a newline for tr
1671 if test -n "$DJGPP"; then
1674 if test X"$trnl" = X; then
1675 case "`echo foo|tr '\n' x 2>/dev/null`" in
1679 if test X"$trnl" = X; then
1680 case "`echo foo|tr '\012' x 2>/dev/null`" in
1681 foox) trnl='\012' ;;
1684 if test X"$trnl" = X; then
1687 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1693 : compute the number of columns on the terminal for proper question formatting
1698 : set up the echo used in my read
1699 myecho="case \"\$xxxm\" in
1700 '') echo $n \"\$rp $c\" >&4;;
1702 '') echo $n \"[\$xxxm] $c\";;
1704 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1706 echo $n \"[\$xxxm] $c\" >&4
1708 echo $n \"\$rp [\$xxxm] $c\" >&4
1714 : now set up to do reads with possible shell escape and default assignment
1720 case "\$fastread" in
1721 yes) case "\$dflt" in
1724 case "\$silent-\$rp" in
1729 *) case "\$silent" in
1730 true) case "\$rp" in
1735 while expr "X\$ans" : "X!" >/dev/null; do
1739 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1747 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1756 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1761 echo "(OK, I'll run with -d after this question.)" >&4
1764 echo "*** Sorry, \$1 not supported yet." >&4
1774 echo "*** Substitution done -- please confirm."
1776 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1781 echo "*** Error -- try again."
1788 case "\$ans\$xxxm\$nostick" in
1800 : create .config dir to save info across Configure sessions
1801 test -d ../.config || mkdir ../.config
1802 cat >../.config/README <<EOF
1803 This directory created by Configure to save information that should
1804 persist across sessions for $package.
1806 You may safely delete it if you wish.
1809 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
1811 $define|true|[yY]*) ;;
1812 *) case "$xversion" in
1815 *** WHOA THERE!!! ***
1817 This is an UNSTABLE DEVELOPMENT release.
1818 The version of this $package distribution is $xversion, that is, odd,
1819 (as opposed to even) and that signifies a development release.
1820 If you want a maintenance release, you want an even-numbered version.
1822 Do ***NOT*** install this into production use.
1823 Data corruption and crashes are possible.
1825 It is most seriously suggested that you do not continue any further
1826 unless you want to help in developing and debugging Perl.
1828 If you *still* want to build perl, you can answer 'y' now,
1829 or pass -Dusedevel to Configure.
1832 rp='Do you really want to continue?'
1836 [yY]) echo >&4 "Okay, continuing."
1837 usedevel="$define" ;;
1838 *) echo >&4 "Okay, bye."
1848 case "$versiononly" in
1849 '') versiononly="$define" ;;
1851 case "$installusrbinperl" in
1852 '') installusrbinperl="$undef" ;;
1857 : general instructions
1860 user=`(logname) 2>/dev/null`
1862 '') user=`whoami 2>&1`;;
1864 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1867 rp='Would you like to see the instructions?'
1878 This installation shell script will examine your system and ask you questions
1879 to determine how the perl5 package should be installed. If you get
1880 stuck on a question, you may use a ! shell escape to start a subshell or
1881 execute a command. Many of the questions will have default answers in square
1882 brackets; typing carriage return will give you the default.
1884 On some of the questions which ask for file or directory names you are allowed
1885 to use the ~name construct to specify the login directory belonging to "name",
1886 even if you don't have a shell which knows about that. Questions where this is
1887 allowed will be marked "(~name ok)".
1891 dflt='Type carriage return to continue'
1895 The prompter used in this script allows you to use shell variables and
1896 backticks in your answers. You may use $1, $2, etc... to refer to the words
1897 in the default answer, as if the default line was a set of arguments given to a
1898 script shell. This means you may also use $* to repeat the whole default line,
1899 so you do not have to re-type everything to add something to the default.
1901 Everytime there is a substitution, you will have to confirm. If there is an
1902 error (e.g. an unmatched backtick), the default answer will remain unchanged
1903 and you will be prompted again.
1905 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1906 the questions and use the computed defaults (or the previous answers if there
1907 was already a config.sh file). Type 'Configure -h' for a list of options.
1908 You may also start interactively and then answer '& -d' at any prompt to turn
1909 on the non-interactive behaviour for the remainder of the execution.
1915 Much effort has been expended to ensure that this shell script will run on any
1916 Unix system. If despite that it blows up on yours, your best bet is to edit
1917 Configure and run it again. If you can't run Configure for some reason,
1918 you'll have to generate a config.sh file by hand. Whatever problems you
1919 have, let me (perlbug@perl.org) know how I blew it.
1921 This installation script affects things in two ways:
1923 1) it may do direct variable substitutions on some of the files included
1925 2) it builds a config.h file for inclusion in C programs. You may edit
1926 any of these files as the need arises after running this script.
1928 If you make a mistake on a question, there is no easy way to back up to it
1929 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1930 files. Configure will offer to let you do this before it runs the SH files.
1933 dflt='Type carriage return to continue'
1935 case "$firsttime" in
1936 true) echo $user >>../.config/instruct;;
1940 : find out where common programs are
1942 echo "Locating common programs..." >&4
1955 if test -d \$dir/\$thing; then
1961 for thisthing in \$dir/\$thing; do
1962 : just loop through to pick last item
1964 if test -f \$thisthing; then
1967 elif test -f \$dir/\$thing.exe; then
1968 if test -n "$DJGPP"; then
1969 echo \$dir/\$thing.exe
1971 : on Eunice apparently
2022 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2023 pth="$pth /lib /usr/lib"
2024 for file in $loclist; do
2028 if test -f "$xxx"; then
2031 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2032 xxx=`./loc $file $file $pth`
2035 '') xxx=`./loc $file $file $pth`;;
2036 *) xxx=`./loc $xxx $xxx $pth`;;
2042 echo $file is in $xxx.
2045 echo $file is in $xxx.
2048 echo "I don't know where '$file' is, and my life depends on it." >&4
2049 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2055 echo "Don't worry if any of the following aren't found..."
2057 for file in $trylist; do
2061 if test -f "$xxx"; then
2064 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2065 xxx=`./loc $file $file $pth`
2068 '') xxx=`./loc $file $file $pth`;;
2069 *) xxx=`./loc $xxx $xxx $pth`;;
2075 echo $file is in $xxx.
2078 echo $file is in $xxx.
2081 echo "I don't see $file out there, $say."
2088 echo "Substituting grep for egrep."
2094 echo "Substituting cp for ln."
2100 echo "Hopefully test is built into your sh."
2103 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2104 echo "Using the test built into your sh."
2112 echo "Hopefully echo is built into your sh."
2117 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2118 $echo $n "hi there$c" >foo1
2119 echo $n "hi there$c" >foo2
2120 if cmp foo1 foo2 >/dev/null 2>&1; then
2121 echo "They are compatible. In fact, they may be identical."
2128 They are not compatible! You are probably running ksh on a non-USG system.
2129 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2130 have echo built in and we may have to run some Bourne shell scripts. That
2131 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2134 $echo $n "The star should be here-->$c"
2144 cat <<'EOSC' >>checkcc
2149 int main(int argc, char *argv[]) {
2153 if $cc -o try $ccflags $ldflags try.c; then
2156 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2162 case "`$cc -v -c try.c 2>&1`" in
2165 if $test X"$trygcc" = Xyes; then
2166 if gcc -o try -c try.c; then
2168 echo "You seem to have a working gcc, though." >&4
2169 rp="Would you like to use it?"
2171 if $test -f myread; then
2174 if $test -f UU/myread; then
2177 echo "Cannot find myread, sorry. Aborting." >&2
2182 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no ;;
2186 if $test X"$despair" = Xyes; then
2188 You need to find a working C compiler.
2189 Either (purchase and) install the C compiler supplied by your OS vendor,
2190 or for a free C compiler try http://gcc.gnu.org/
2191 I cannot continue any further, aborting.
2201 : determine whether symbolic links are supported
2204 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2205 echo "Symbolic links are supported." >&4
2208 echo "Symbolic links are NOT supported." >&4
2213 : determine whether symbolic links are supported
2217 echo "Checking how to test for symbolic links..." >&4
2219 if $test "X$issymlink" = X; then
2220 sh -c "PATH= test -h sym" >/dev/null 2>&1
2221 if test $? = 0; then
2225 if $test "X$issymlink" = X; then
2226 if $test -h >/dev/null 2>&1; then
2227 issymlink="$test -h"
2228 echo "Your builtin 'test -h' may be broken, I'm using external '$test -h'." >&4
2231 if $test "X$issymlink" = X; then
2232 if $test -L sym 2>/dev/null; then
2233 issymlink="$test -L"
2236 if $test "X$issymlink" != X; then
2237 echo "You can test for symbolic links with '$issymlink'." >&4
2239 echo "I do not know how you can test for symbolic links." >&4
2243 *) echo "No symbolic links, so not testing for their testing..." >&4
2249 case "$mksymlinks" in
2252 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2255 *) case "$lns:$issymlink" in
2256 *"ln -s:"*"test -"?)
2257 echo "Creating the symbolic links..." >&4
2258 echo "(First creating the subdirectories...)" >&4
2260 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2262 test -z "$directory" && break
2266 if test ! -d t/base; then
2267 echo "Failed to create the subdirectories. Aborting." >&4
2270 echo "(Then creating the symlinks...)" >&4
2271 awk '{print $1}' $src/MANIFEST | while true; do
2273 test -z "$filename" && break
2274 if test -f $filename; then
2275 if $issymlink $filename; then
2279 if test -f $filename; then
2280 echo "$filename already exists, not symlinking."
2282 ln -s $src/$filename $filename
2286 if test ! -f t/base/commonsense.t; then
2287 echo "Failed to create the symlinks. Aborting." >&4
2292 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2300 : see whether [:lower:] and [:upper:] are supported character classes
2302 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2304 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2308 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
2309 # (0xc9 and 0xd1), therefore that is a nice testing point.
2310 if test "X$up" = X -o "X$low" = X; then
2311 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
2317 if test "X$up" = X -o "X$low" = X; then
2318 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
2324 if test "X$up" = X -o "X$low" = X; then
2325 case "`echo IJ | od -x 2>/dev/null`" in
2327 echo "Hey, this might be EBCDIC." >&4
2328 if test "X$up" = X -o "X$low" = X; then
2329 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2330 ij) up='[A-IJ-RS-Z]'
2335 if test "X$up" = X -o "X$low" = X; then
2336 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2346 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
2348 echo "Using $up and $low to convert case." >&4
2351 echo "I don't know how to translate letters from upper to lower case." >&4
2352 echo "Your tr is not acting any way I know of." >&4
2356 : set up the translation script tr, must be called with ./tr of course
2360 '[A-Z][a-z]') exec $tr '$up' '$low';;
2361 '[a-z][A-Z]') exec $tr '$low' '$up';;
2368 : Try to determine whether config.sh was made on this system
2369 case "$config_sh" in
2371 myuname=`$uname -a 2>/dev/null`
2372 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2373 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2374 # because the A-Z/a-z are not consecutive.
2375 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2376 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2377 newmyuname="$myuname"
2379 case "$knowitall" in
2381 if test -f ../config.sh; then
2382 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2383 eval "`grep myuname= ../config.sh`"
2385 if test "X$myuname" = "X$newmyuname"; then
2393 : Get old answers from old config file if Configure was run on the
2394 : same system, otherwise use the hints.
2397 if test -f config.sh; then
2399 rp="I see a config.sh file. Shall I use it to set the defaults?"
2402 n*|N*) echo "OK, I'll ignore it."
2403 mv config.sh config.sh.old
2404 myuname="$newmyuname"
2406 *) echo "Fetching default answers from your old config.sh file..." >&4
2414 : Older versions did not always set $sh. Catch re-use of such
2424 if test ! -f config.sh; then
2427 First time through, eh? I have some defaults handy for some systems
2428 that need some extra help getting the Configure answers right:
2431 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2433 : Half the following guesses are probably wrong... If you have better
2434 : tests or hints, please send them to perlbug@perl.org
2435 : The metaconfig authors would also appreciate a copy...
2436 $test -f /irix && osname=irix
2437 $test -f /xenix && osname=sco_xenix
2438 $test -f /dynix && osname=dynix
2439 $test -f /dnix && osname=dnix
2440 $test -f /lynx.os && osname=lynxos
2441 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2442 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
2443 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2444 $test -f /bin/mips && /bin/mips && osname=mips
2445 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
2446 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
2447 $test -d /usr/apollo/bin && osname=apollo
2448 $test -f /etc/saf/_sactab && osname=svr4
2449 $test -d /usr/include/minix && osname=minix
2450 if $test -d /MachTen -o -d /MachTen_Folder; then
2452 if $test -x /sbin/version; then
2453 osvers=`/sbin/version | $awk '{print $2}' |
2454 $sed -e 's/[A-Za-z]$//'`
2455 elif $test -x /usr/etc/version; then
2456 osvers=`/usr/etc/version | $awk '{print $2}' |
2457 $sed -e 's/[A-Za-z]$//'`
2463 $test -f /sys/posix.dll &&
2464 $test -f /usr/bin/what &&
2465 set X `/usr/bin/what /sys/posix.dll` &&
2466 $test "$3" = UWIN &&
2470 if $test -f $uname; then
2478 umips) osname=umips ;;
2481 [23]100) osname=mips ;;
2482 next*) osname=next ;;
2484 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
2485 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
2488 elif $test -f /etc/kconfig; then
2490 if test "$lns" = "$ln -s"; then
2492 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
2494 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
2501 if test -n "$DJGPP"; then
2510 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
2512 'not found') osvers="$4"."$3" ;;
2513 '<3240'|'<>3240') osvers=3.2.0 ;;
2514 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
2515 '=3250'|'>3250') osvers=3.2.5 ;;
2519 bsd386) osname=bsd386
2522 cygwin*) osname=cygwin
2525 *dc.osx) osname=dcosx
2531 domainos) osname=apollo
2537 dynixptx*) osname=dynixptx
2538 osvers=`echo "$4"|sed 's/^v//'`
2540 freebsd) osname=freebsd
2542 genix) osname=genix ;;
2544 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
2560 netbsd*) osname=netbsd
2563 news-os) osvers="$3"
2565 4*) osname=newsos4 ;;
2569 next*) osname=next ;;
2570 nonstop-ux) osname=nonstopux ;;
2571 POSIX-BC | posix-bc ) osname=posix-bc
2574 powerux | power_ux | powermax_os | powermaxos | \
2575 powerunix | power_unix) osname=powerux
2581 solaris) osname=solaris
2583 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2590 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2594 titanos) osname=titanos
2603 ultrix) osname=ultrix
2606 osf1|mls+) case "$5" in
2609 osvers=`sizer -v | awk '{print $3}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
2612 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
2615 hp*) osname=hp_osf1 ;;
2616 mips) osname=mips_osf1 ;;
2619 unixware) osname=svr5
2625 $2) case "$osname" in
2629 : svr4.x or possibly later
2639 if test -f /stand/boot ; then
2640 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
2641 if test -n "$INITPROG" -a -f "$INITPROG"; then
2642 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
2643 if test -n "$isesix"; then
2651 *) if test -f /etc/systemid; then
2653 set `echo $3 | $sed 's/\./ /g'` $4
2654 if $test -f $src/hints/sco_$1_$2_$3.sh; then
2656 elif $test -f $src/hints/sco_$1_$2.sh; then
2658 elif $test -f $src/hints/sco_$1.sh; then
2663 '') : Still unknown. Probably a generic Sys V.
2672 *) case "$osname" in
2673 '') : Still unknown. Probably a generic BSD.
2681 if test -f /vmunix -a -f $src/hints/news_os.sh; then
2682 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
2683 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
2686 $rm -f UU/kernel.what
2687 elif test -d c:/.; then
2694 : Now look for a hint file osname_osvers, unless one has been
2695 : specified already.
2698 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
2699 : Also try without trailing minor version numbers.
2700 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
2701 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
2702 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
2703 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
2706 *) case "$osvers" in
2709 *) if $test -f $src/hints/$file.sh ; then
2711 elif $test -f $src/hints/$xfile.sh ; then
2713 elif $test -f $src/hints/$xxfile.sh ; then
2715 elif $test -f $src/hints/$xxxfile.sh ; then
2717 elif $test -f $src/hints/$xxxxfile.sh ; then
2719 elif $test -f "$src/hints/${osname}.sh" ; then
2728 if $test -f Policy.sh ; then
2731 none) dflt="Policy" ;;
2732 *) dflt="Policy $dflt" ;;
2737 dflt=`echo $hintfile | $sed 's/\.sh$//'`
2741 if $test -f Policy.sh ; then
2744 There's also a Policy hint file available, which should make the
2745 site-specific (policy) questions easier to answer.
2752 You may give one or more space-separated answers, or "none" if appropriate.
2753 A well-behaved OS will have no hints, so answering "none" or just "Policy"
2754 is a good thing. DO NOT give a wrong version or a wrong OS.
2758 rp="Which of these apply, if any?"
2761 for file in $tans; do
2762 if $test X$file = XPolicy -a -f Policy.sh; then
2764 $cat Policy.sh >> UU/config.sh
2765 elif $test -f $src/hints/$file.sh; then
2766 . $src/hints/$file.sh
2767 $cat $src/hints/$file.sh >> UU/config.sh
2768 elif $test X$tans = X -o X$tans = Xnone ; then
2771 : Give one chance to correct a possible typo.
2772 echo "$file.sh does not exist"
2774 rp="hint to use instead?"
2776 for file in $ans; do
2777 if $test -f "$src/hints/$file.sh"; then
2778 . $src/hints/$file.sh
2779 $cat $src/hints/$file.sh >> UU/config.sh
2780 elif $test X$ans = X -o X$ans = Xnone ; then
2783 echo "$file.sh does not exist -- ignored."
2790 : Remember our hint file for later.
2791 if $test -f "$src/hints/$file.sh" ; then
2801 echo "Fetching default answers from $config_sh..." >&4
2805 cp $config_sh config.sh 2>/dev/null
2815 test "$override" && . ./optdef.sh
2817 : Restore computed paths
2818 for file in $loclist $trylist; do
2819 eval $file="\$_$file"
2824 Configure uses the operating system name and version to set some defaults.
2825 The default value is probably right if the name rings a bell. Otherwise,
2826 since spelling matters for me, either accept the default or answer "none"
2833 ''|' '|none) dflt=none ;;
2834 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
2837 *) dflt="$osname" ;;
2839 rp="Operating system name?"
2843 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
2849 ''|' '|none) dflt=none ;;
2850 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
2851 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
2853 ''|' ') dflt=none ;;
2858 *) dflt="$osvers" ;;
2860 rp="Operating system version?"
2870 : who configured the system
2871 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
2872 cf_by=`(logname) 2>/dev/null`
2875 cf_by=`(whoami) 2>/dev/null`
2877 "") cf_by=unknown ;;
2881 : set up the script used to warn in case of inconsistency
2888 echo "*** WHOA THERE!!! ***" >&4
2889 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2890 rp=" Keep the $hint value?"
2893 y) td=$was; tu=$was;;
2897 : function used to set $1 to $val
2898 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2900 $define$undef) . ./whoa; eval "$var=\$td";;
2901 $undef$define) . ./whoa; eval "$var=\$tu";;
2902 *) eval "$var=$val";;
2905 case "$usethreads" in
2906 $define|true|[yY]*) dflt='y';;
2911 Perl can be built to take advantage of threads on some systems.
2912 To do so, Configure can be run with -Dusethreads.
2914 Note that threading is a highly experimental feature, and
2915 some known race conditions still remain. If you choose to try
2916 it, be very sure to not actually deploy it for production
2917 purposes. README.threads has more details, and is required
2918 reading if you enable threads.
2920 If this doesn't make any sense to you, just accept the default '$dflt'.
2922 rp='Build a threading Perl?'
2925 y|Y) val="$define" ;;
2931 case "$usethreads" in
2935 As of 5.5.640, Perl has two different internal threading implementations,
2936 the 5.005 version (5005threads) and an interpreter-based version
2937 (ithreads) that has one interpreter per thread. Both are very
2938 experimental. This arrangement exists to help developers work out
2939 which one is better.
2941 If you're a casual user, you probably don't want interpreter-threads
2942 at this time. There doesn't yet exist a way to create threads from
2943 within Perl in this model, i.e., "use Thread;" will NOT work.
2945 : Default to ithreads unless overridden on command line or with
2948 case "$use5005threads" in
2949 $define|true|[yY]*) dflt='n';;
2951 case "$useithreads" in
2952 $undef|false|[nN]*) dflt='n';;
2954 rp='Use interpreter-based ithreads?'
2957 y|Y) val="$define" ;;
2962 : Now set use5005threads to the opposite value.
2963 case "$useithreads" in
2964 $define) val="$undef" ;;
2971 useithreads="$undef"
2972 use5005threads="$undef"
2976 case "$useithreads$use5005threads" in
2980 You cannot have both the ithreads and the 5.005 threads enabled
2981 at the same time. Disabling the 5.005 threads since they are
2982 much less stable than the ithreads.
2985 use5005threads="$undef"
2989 case "$d_oldpthreads" in
2990 '') : Configure tests would be welcome here. For now, assume undef.
2992 *) val="$d_oldpthreads" ;;
2998 case "$usethreads" in
2999 "$define"|true|[yY]*)
3000 : Look for a hint-file generated 'call-back-unit'. If the
3001 : user has specified that a threading perl is to be built,
3002 : we may need to set or change some other defaults.
3003 if $test -f usethreads.cbu; then
3004 echo "Your platform has some specific hints for threaded builds, using them..."
3008 (Your platform doesn't have any specific hints for threaded builds.
3009 Assuming POSIX threads, then.)
3017 Perl can be built so that multiple Perl interpreters can coexist
3018 within the same Perl executable.
3021 case "$useithreads" in
3024 This multiple interpreter support is required for interpreter-based threads.
3028 *) case "$usemultiplicity" in
3029 $define|true|[yY]*) dflt='y';;
3033 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
3034 rp='Build Perl for multiplicity?'
3037 y|Y) val="$define" ;;
3045 : make some quick guesses about what we are up against
3047 $echo $n "Hmm... $c"
3057 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
3058 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
3060 echo "Looks kind of like an OSF/1 system, but we'll see..."
3062 elif test `echo abc | $tr a-z A-Z` = Abc ; then
3063 xxx=`./loc addbib blurfl $pth`
3064 if $test -f $xxx; then
3065 echo "Looks kind of like a USG system with BSD features, but we'll see..."
3069 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
3070 echo "Looks kind of like an extended USG system, but we'll see..."
3072 echo "Looks kind of like a USG system, but we'll see..."
3076 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
3077 echo "Looks kind of like a BSD system, but we'll see..."
3081 echo "Looks kind of like a Version 7 system, but we'll see..."
3084 case "$eunicefix" in
3087 There is, however, a strange, musty smell in the air that reminds me of
3088 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
3092 : it so happens the Eunice I know will not run shell scripts in Unix format
3096 echo "Congratulations. You aren't running Eunice."
3100 : Detect OS2. The p_ variable is set above in the Head.U unit.
3101 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
3102 : semicolon as a patch separator
3107 I have the feeling something is not exactly right, however...don't tell me...
3108 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
3109 (Or you may be running DOS with DJGPP.)
3114 if test -f /xenix; then
3115 echo "Actually, this looks more like a XENIX system..."
3120 echo "It's not Xenix..."
3125 if test -f /venix; then
3126 echo "Actually, this looks more like a VENIX system..."
3133 echo "Nor is it Venix..."
3136 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3137 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3144 rp="Use which C compiler?"
3147 : Look for a hint-file generated 'call-back-unit'. Now that the
3148 : user has specified the compiler, we may need to set or change some
3150 if $test -f cc.cbu; then
3156 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3157 $cat >gccvers.c <<EOM
3162 printf("%s\n", __VERSION__);
3164 printf("%s\n", "1");
3170 if $cc -o gccvers $ccflags $ldflags gccvers.c; then
3171 gccversion=`./gccvers`
3172 case "$gccversion" in
3173 '') echo "You are not using GNU cc." ;;
3174 *) echo "You are using GNU cc $gccversion."
3180 echo "*** WHOA THERE!!! ***" >&4
3181 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3182 case "$knowitall" in
3184 echo " You'd better start hunting for one and let me know about it." >&4
3190 case "$gccversion" in
3191 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3193 case "$gccversion" in
3194 '') gccosandvers='' ;;
3195 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
3196 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
3198 case "$gccosandvers" in
3199 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
3200 $osname$osvers) ;; # looking good
3201 $osname*) cat <<EOM >&4
3203 *** WHOA THERE!!! ***
3205 Your gcc has not been compiled for the exact release of
3206 your operating system ($gccosandvers versus $osname$osvers).
3208 In general it is a good idea to keep gcc synchronized with
3209 the operating system because otherwise serious problems
3210 may ensue when trying to compile software, like Perl.
3212 I'm trying to be optimistic here, though, and will continue.
3213 If later during the configuration and build icky compilation
3214 problems appear (headerfile conflicts being the most common
3215 manifestation), I suggest reinstalling the gcc to match
3216 your operating system release.
3220 *) gccosandvers='' ;; # failed to parse, better be silent
3228 case "$gccversion" in
3230 *) case "$ccflags" in
3232 *) ccflags="$ccflags -Wall" ;;
3237 : see how we invoke the C preprocessor
3239 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3240 cat <<'EOT' >testcpp.c
3246 if test ! -f cppstdin; then
3247 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
3248 # AIX cc -E doesn't show the absolute headerfile
3249 # locations but we'll cheat by using the -M flag.
3250 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
3252 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3255 echo "Keeping your $hint cppstdin wrapper."
3258 wrapper=`pwd`/cppstdin
3262 if $test "X$cppstdin" != "X" && \
3263 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3264 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3266 echo "You used to use $cppstdin $cppminus so we'll use that again."
3268 '') echo "But let's see if we can live without a wrapper..." ;;
3270 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3271 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3273 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3276 echo "(However, $cpprun $cpplast does not work, let's see...)"
3284 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3291 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3292 $cc -E <testcpp.c >testcpp.out 2>&1; \
3293 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3294 echo "Yup, it does."
3297 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
3298 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3299 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3300 echo "Yup, it does."
3303 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
3304 $cc -P <testcpp.c >testcpp.out 2>&1; \
3305 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3306 echo "Yipee, that works!"
3309 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
3310 $cc -P - <testcpp.c >testcpp.out 2>&1; \
3311 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3312 echo "At long last!"
3315 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
3316 $cpp <testcpp.c >testcpp.out 2>&1; \
3317 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3321 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
3322 $cpp - <testcpp.c >testcpp.out 2>&1; \
3323 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3324 echo "Hooray, it works! I was beginning to wonder."
3327 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
3328 $wrapper <testcpp.c >testcpp.out 2>&1; \
3329 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3335 rp="No dice. I can't find a C preprocessor. Name one:"
3339 $x_cpp <testcpp.c >testcpp.out 2>&1
3340 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3341 echo "OK, that will do." >&4
3343 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
3358 echo "Perhaps can we force $cc -E using a wrapper..."
3359 if $wrapper <testcpp.c >testcpp.out 2>&1; \
3360 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3366 echo "Nope, we'll have to live without it..."
3380 "$wrapper"|'cppstdin') ;;
3381 *) $rm -f $wrapper;;
3383 $rm -f testcpp.c testcpp.out
3385 : decide how portable to be. Allow command line overrides.
3386 case "$d_portable" in
3388 *) d_portable="$define" ;;
3391 : set up shell script to do ~ expansion
3397 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3400 if $test -f /bin/csh; then
3401 /bin/csh -f -c "glob \$1"
3406 name=\`$expr x\$1 : '..\([^/]*\)'\`
3407 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3408 if $test ! -d "\$dir"; then
3410 echo "\$me: can't locate home directory for: \$name" >&2
3415 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3431 : now set up to get a file name
3435 cat <<'EOSC' >>getfile
3451 expr $fn : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3452 fn=`echo $fn | sed 's/(.*)//'`
3458 loc_file=`expr $fn : '.*:\(.*\)'`
3459 fn=`expr $fn : '\(.*\):.*'`
3467 */*) fullpath=true;;
3476 *e*) exp_file=true;;
3479 *p*) nopath_ok=true;;
3484 *d*) type='Directory';;
3485 *l*) type='Locate';;
3490 Locate) what='File';;
3495 case "$d_portable" in
3503 while test "$type"; do
3508 true) rp="$rp (~name ok)";;
3511 if test -f UU/getfile.ok && \
3512 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3531 value=`UU/filexp $ans`
3534 if test "$ans" != "$value"; then
3535 echo "(That expands to $value on this system.)"
3549 /*) value="$ansexp" ;;
3550 [a-zA-Z]:/*) value="$ansexp" ;;
3555 echo "I shall only accept a full path name, as in /bin/ls." >&4
3556 echo "Use a ! shell escape if you wish to check pathnames." >&4
3559 echo "Please give a full path name, starting with slash." >&4
3562 echo "Note that using ~name is ok provided it expands well." >&4
3575 for fp in $gfpth; do
3576 if test "X$fp" = X.; then
3581 if test -f "$pf"; then
3583 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3585 echo "($value is not a plain file, but that's ok.)"
3588 if test X"$type" = X; then
3595 for fp in $gfpth; do
3596 if test "X$fp" = X.; then
3601 direxp="$fp/$ansexp"
3603 if test -d "$direxp"; then
3611 if test -d "$ansexp"; then
3612 echo "(Looking for $loc_file in directory $value.)"
3613 value="$value/$loc_file"
3614 ansexp="$ansexp/$loc_file"
3616 if test -f "$ansexp"; then
3619 case "$nopath_ok" in
3620 true) case "$value" in
3622 *) echo "Assuming $value will be in people's path."
3638 if test "$fastread" = yes; then
3643 rp="$what $value doesn't exist. Use that name anyway?"
3662 test "X$gfpthkeep" != Xy && gfpth=""
3665 : What should the include directory be ?
3667 $echo $n "Hmm... $c"
3671 if $test -f /bin/mips && /bin/mips; then
3672 echo "Looks like a MIPS system..."
3673 $cat >usr.c <<'EOCP'
3674 #ifdef SYSTYPE_BSD43
3678 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3679 dflt='/bsd43/usr/include'
3683 mips_type='System V'
3685 $rm -f usr.c usr.out
3686 echo "and you're compiling with the $mips_type compiler and libraries."
3690 echo "Doesn't look like a MIPS system."
3700 case "$xxx_prompt" in
3703 rp='Where are the include files you want to use?'
3711 : Set private lib path
3714 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
3719 '') dlist="$loclibpth $plibpth $glibpth";;
3720 *) dlist="$libpth";;
3723 : Now check and see which directories actually exist, avoiding duplicates
3727 if $test -d $xxx; then
3730 *) libpth="$libpth $xxx";;
3736 Some systems have incompatible or broken versions of libraries. Among
3737 the directories listed in the question below, please remove any you
3738 know not to be holding relevant libraries, and add any that are needed.
3739 Say "none" for none.
3750 rp="Directories to use for library searches?"
3757 : compute shared library extension
3760 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
3770 On some systems, shared libraries may be available. Answer 'none' if
3771 you want to suppress searching of shared libraries for the remainder
3772 of this configuration.
3775 rp='What is the file extension used for shared libraries?'
3779 : Define several unixisms.
3780 : Hints files or command line option can be used to override them.
3781 : The convoluted testing is in case hints files set either the old
3784 '') case "$exe_ext" in
3786 *) _exe="$exe_ext" ;;
3791 '') case "$lib_ext" in
3798 '') case "$obj_ext" in
3805 '') case "$path_sep" in
3816 : Which makefile gets called first. This is used by make depend.
3817 case "$firstmakefile" in
3818 '') firstmakefile='makefile';;
3822 $define|true|[yY]*) dflt='y';;
3827 Perl can be built to use the SOCKS proxy protocol library. To do so,
3828 Configure must be run with -Dusesocks. If you use SOCKS you also need
3829 to use the PerlIO abstraction layer, this will be implicitly selected.
3831 If this doesn't make any sense to you, just accept the default '$dflt'.
3833 rp='Build Perl for SOCKS?'
3836 y|Y) val="$define" ;;
3843 $define|true|[yY]*) useperlio="$define";;
3846 : Looking for optional libraries
3848 echo "Checking for optional libraries..." >&4
3853 case "$libswanted" in
3854 '') libswanted='c_s';;
3857 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
3863 for thisdir in $libpth $xlibpth; do
3864 test -d $thisdir && libspath="$libspath $thisdir"
3866 for thislib in $libswanted; do
3867 for thisdir in $libspath; do
3869 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
3870 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|tail -1`
3871 $test -f "$xxx" && eval $libscheck
3872 $test -f "$xxx" && libstyle=shared
3874 if test ! -f "$xxx"; then
3875 xxx=$thisdir/lib$thislib.$so
3876 $test -f "$xxx" && eval $libscheck
3877 $test -f "$xxx" && libstyle=shared
3879 if test ! -f "$xxx"; then
3880 xxx=$thisdir/lib$thislib$_a
3881 $test -f "$xxx" && eval $libscheck
3882 $test -f "$xxx" && libstyle=static
3884 if test ! -f "$xxx"; then
3885 xxx=$thisdir/$thislib$_a
3886 $test -f "$xxx" && eval $libscheck
3887 $test -f "$xxx" && libstyle=static
3889 if test ! -f "$xxx"; then
3890 xxx=$thisdir/lib${thislib}_s$_a
3891 $test -f "$xxx" && eval $libscheck
3892 $test -f "$xxx" && libstyle=static
3893 $test -f "$xxx" && thislib=${thislib}_s
3895 if test ! -f "$xxx"; then
3896 xxx=$thisdir/Slib$thislib$_a
3897 $test -f "$xxx" && eval $libscheck
3898 $test -f "$xxx" && libstyle=static
3900 if $test -f "$xxx"; then
3902 shared) echo "Found -l$thislib (shared)." ;;
3903 static) echo "Found -l$thislib." ;;
3904 *) echo "Found -l$thislib ($libstyle)." ;;
3908 *) dflt="$dflt -l$thislib"
3909 libsfound="$libsfound $xxx"
3911 libsfiles="$libsfiles $yyy"
3912 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
3913 case " $libsdirs " in
3915 *) libsdirs="$libsdirs $yyy" ;;
3922 if $test ! -f "$xxx"; then
3923 echo "No -l$thislib."
3934 ' '|'') dflt='none';;
3939 In order to compile $package on your machine, a number of libraries
3940 are usually needed. Include any other special libraries here as well.
3941 Say "none" for none. The default list is almost always right.
3945 rp="What libraries to use?"
3952 : determine optimization, if desired, or use for debug flag also
3954 ' '|$undef) dflt='none';;
3956 *) dflt="$optimize";;
3960 By default, $package compiles with the -O flag to use the optimizer.
3961 Alternately, you might want to use the symbolic debugger, which uses
3962 the -g flag (on traditional Unix systems). Either flag can be
3963 specified here. To use neither flag, specify the word "none".
3966 rp="What optimizer/debugger flag should be used?"
3970 'none') optimize=" ";;
3974 : We will not override a previous value, but we might want to
3975 : augment a hint file
3977 default|recommended)
3978 case "$gccversion" in
3979 1*) dflt='-fpcc-struct-return' ;;
3982 *-g*) dflt="$dflt -DDEBUGGING";;
3984 case "$gccversion" in
3985 2*) if test -d /etc/conf/kconfig.d &&
3986 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
3992 case "$gccversion" in
3996 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
3997 echo 'int main(void) { return 0; }' > gcctest.c
3998 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
3999 echo "Yes, it does." 2>&1
4002 echo "Leaving current flags $ccflags alone." 2>&1
4004 *) dflt="$dflt -fno-strict-aliasing" ;;
4007 echo "Nope, it doesn't, but that's ok." 2>&1
4014 case "$mips_type" in
4015 *BSD*|'') inclwanted="$locincpth $usrinc";;
4016 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4018 for thisincl in $inclwanted; do
4019 if $test -d $thisincl; then
4020 if $test x$thisincl != x$usrinc; then
4022 *" -I$thisincl "*);;
4023 *) dflt="$dflt -I$thisincl ";;
4029 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4031 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4039 *) dflt="$dflt -D$2";;
4043 set signal.h LANGUAGE_C; eval $inctest
4047 ccflags="$ccflags -DSOCKS"
4052 default|recommended) dflt="$ccflags $dflt" ;;
4053 *) dflt="$ccflags";;
4062 Your C compiler may want other flags. For this question you should include
4063 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4064 but you should NOT include libraries or ld flags like -lwhatever. If you
4065 want $package to honor its debug switch, you should include -DDEBUGGING here.
4066 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4068 To use no flags, specify the word "none".
4074 rp="Any additional cc flags?"
4081 : the following weeds options from ccflags that are of no interest to cpp
4083 '') cppflags="$ccflags" ;;
4084 *) cppflags="$cppflags $ccflags" ;;
4086 case "$gccversion" in
4087 1*) cppflags="$cppflags -D__GNUC__"
4089 case "$mips_type" in
4091 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4097 echo "Let me guess what the preprocessor flags are..." >&4
4111 *) ftry="$previous $flag";;
4113 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4114 >cpp1.out 2>/dev/null && \
4115 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4116 >cpp2.out 2>/dev/null && \
4117 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4118 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4120 cppflags="$cppflags $ftry"
4130 *-*) echo "They appear to be: $cppflags";;
4132 $rm -f cpp.c cpp?.out
4136 : flags used in final linking phase
4138 '') if ./venix; then
4144 *-posix*) dflt="$dflt -posix" ;;
4147 *) dflt="$ldflags";;
4150 : Try to guess additional flags to pick up local libraries.
4151 for thislibdir in $libpth; do
4152 case " $loclibpth " in
4155 *"-L$thislibdir "*) ;;
4156 *) dflt="$dflt -L$thislibdir" ;;
4168 Your C linker may need flags. For this question you should
4169 include -L/whatever and any other flags used by the C linker, but you
4170 should NOT include libraries like -lwhatever.
4172 Make sure you include the appropriate -L/path flags if your C linker
4173 does not normally search all of the directories you specified above,
4176 To use no flags, specify the word "none".
4180 rp="Any additional ld flags (NOT including libraries)?"
4186 rmlist="$rmlist pdp11"
4190 echo "Checking your choice of C compiler and flags for coherency..." >&4
4191 $cat > try.c <<'EOF'
4193 int main() { printf("Ok\n"); exit(0); }
4195 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
4197 $cat >try.msg <<'EOM'
4198 I've tried to compile and run the following simple program:
4201 $cat try.c >> try.msg
4203 $cat >> try.msg <<EOM
4210 and I got the following output:
4214 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
4215 if $sh -c './try' >>try.msg 2>&1; then
4219 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4222 cat >> try.msg <<'EOQS'
4223 If $libs contains -lsfio, and sfio is mis-configured, then it
4224 sometimes (apparently) runs and exits with a 0 status, but with no
4225 output! It may have to do with sfio's use of _exit vs. exit.
4228 rp="You have a big problem. Shall I abort Configure"
4235 echo "The program compiled OK, but exited with status $?." >>try.msg
4236 rp="You have a problem. Shall I abort Configure"
4240 echo "I can't compile the test program." >>try.msg
4241 rp="You have a BIG problem. Shall I abort Configure"
4247 case "$knowitall" in
4249 echo "(The supplied flags or libraries might be incorrect.)"
4257 *) echo "Ok. Stopping Configure." >&4
4262 n) echo "OK, that should do.";;
4264 $rm -f try try.* core
4266 : define an is-a-typedef? function
4267 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
4269 "") inclist="sys/types.h";;
4271 eval "varval=\$$var";
4275 for inc in $inclist; do
4276 echo "#include <$inc>" >>temp.c;
4278 echo "#ifdef $type" >> temp.c;
4279 echo "printf(\"We have $type\");" >> temp.c;
4280 echo "#endif" >> temp.c;
4281 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
4282 if $contains $type temp.E >/dev/null 2>&1; then
4288 *) eval "$var=\$varval";;
4291 : define an is-a-typedef? function that prompts if the type is not available.
4292 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
4294 "") inclist="sys/types.h";;
4296 eval "varval=\$$var";
4300 for inc in $inclist; do
4301 echo "#include <$inc>" >>temp.c;
4303 echo "#ifdef $type" >> temp.c;
4304 echo "printf(\"We have $type\");" >> temp.c;
4305 echo "#endif" >> temp.c;
4306 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
4308 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
4309 if $contains $type temp.E >/dev/null 2>&1; then
4310 echo "$type found." >&4;
4313 echo "$type NOT found." >&4;
4319 *) eval "$var=\$varval";;
4322 : define a shorthand compile call
4326 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
4327 : define a shorthand compile call for compilations that should be ok.
4331 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
4333 : check for lengths of integral types
4337 echo "Checking to see how big your integers are..." >&4
4338 $cat >intsize.c <<'EOCP'
4342 printf("intsize=%d;\n", (int)sizeof(int));
4343 printf("longsize=%d;\n", (int)sizeof(long));
4344 printf("shortsize=%d;\n", (int)sizeof(short));
4349 if eval $compile_ok && ./intsize > /dev/null; then
4351 echo "Your integers are $intsize bytes long."
4352 echo "Your long integers are $longsize bytes long."
4353 echo "Your short integers are $shortsize bytes long."
4357 Help! I can't compile and run the intsize test program: please enlighten me!
4358 (This is probably a misconfiguration in your system or libraries, and
4359 you really ought to fix it. Still, I'll try anyway.)
4363 rp="What is the size of an integer (in bytes)?"
4367 rp="What is the size of a long integer (in bytes)?"
4371 rp="What is the size of a short integer (in bytes)?"
4377 $rm -f intsize intsize.*
4379 : see what type lseek is declared as in the kernel
4380 rp="What is the type used for lseek's offset on this system?"
4381 set off_t lseektype long stdio.h sys/types.h
4385 echo "Checking to see how big your file offsets are..." >&4
4387 #include <sys/types.h>
4391 printf("%d\n", (int)sizeof($lseektype));
4396 if eval $compile_ok; then
4398 echo "Your file offsets are $lseeksize bytes long."
4402 echo "(I can't seem to compile the test program. Guessing...)"
4403 rp="What is the size of your file offsets (in bytes)?"
4409 : see what type file positions are declared as in the library
4410 rp="What is the type for file position used by fsetpos()?"
4411 set fpos_t fpostype long stdio.h sys/types.h
4416 *_t) zzz="$fpostype" ;;
4419 echo "Checking the size of $zzz..." >&4
4421 #include <sys/types.h>
4424 printf("%d\n", (int)sizeof($fpostype));
4429 if eval $compile_ok; then
4433 echo "(I can't execute the test program--guessing $fpossize.)" >&4
4436 echo "Your $zzz is $fpossize bytes long."
4442 echo "(I can't compile the test program. Guessing...)" >&4
4443 rp="What is the size of your file positions (in bytes)?"
4450 # Backward compatibility (uselfs is deprecated).
4452 "$define"|true|[yY]*)
4455 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
4457 uselargefiles="$define"
4461 case "$lseeksize:$fpossize" in
4464 You can have files larger than 2 gigabytes.
4467 *) case "$uselargefiles" in
4468 "$undef"|false|[nN]*) dflt='n' ;;
4473 Perl can be built to understand large files (files larger than 2 gigabytes)
4474 on some systems. To do so, Configure can be run with -Duselargefiles.
4476 If this doesn't make any sense to you, just accept the default '$dflt'.
4478 rp='Try to understand large files, if available?'
4481 y|Y) val="$define" ;;
4488 case "$uselargefiles" in
4490 : Look for a hint-file generated 'call-back-unit'. If the
4491 : user has specified that a large files perl is to be built,
4492 : we may need to set or change some other defaults.
4493 if $test -f uselargefiles.cbu; then
4494 echo "Your platform has some specific hints for large file builds, using them..."
4495 . ./uselargefiles.cbu
4497 echo "Rechecking to see how big your file offsets are..." >&4
4499 #include <sys/types.h>
4503 printf("%d\n", (int)sizeof($lseektype));
4508 if eval $compile_ok; then
4510 $echo "Your file offsets are now $lseeksize bytes long."
4514 echo "(I can't seem to compile the test program. Guessing...)"
4515 rp="What is the size of your file offsets (in bytes)?"
4520 *_t) zzz="$fpostype" ;;
4523 $echo $n "Rechecking the size of $zzz...$c" >&4
4525 #include <sys/types.h>
4528 printf("%d\n", (int)sizeof($fpostype));
4533 if eval $compile_ok; then
4538 echo "(I can't execute the test program--guessing $fpossize.)" >&4
4541 echo " $fpossize bytes." >&4
4547 echo "(I can't compile the test program. Guessing...)" >&4
4548 rp="What is the size of your file positions (in bytes)?"
4558 case "$usemorebits" in
4559 "$define"|true|[yY]*)
4560 use64bitint="$define"
4561 uselongdouble="$define"
4562 usemorebits="$define"
4564 *) usemorebits="$undef"
4568 : check for void type
4570 echo "Checking to see how well your C compiler groks the void type..." >&4
4571 case "$voidflags" in
4573 $cat >try.c <<'EOCP'
4579 extern void moo(); /* function returning void */
4580 void (*goo)(); /* ptr to func returning void */
4582 void *hue; /* generic ptr */
4595 int main() { sub(); }
4597 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
4598 voidflags=$defvoidused
4599 echo "Good. It appears to support void to the level $package wants.">&4
4600 if $contains warning .out >/dev/null 2>&1; then
4601 echo "However, you might get some warnings that look like this:"
4605 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
4606 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
4607 echo "It supports 1..."
4608 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
4609 echo "It also supports 2..."
4610 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
4612 echo "And it supports 4 but not 8 definitely."
4614 echo "It doesn't support 4..."
4615 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
4617 echo "But it supports 8."
4620 echo "Neither does it support 8."
4624 echo "It does not support 2..."
4625 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
4627 echo "But it supports 4 and 8."
4629 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
4631 echo "And it supports 4 but has not heard about 8."
4633 echo "However it supports 8 but not 4."
4638 echo "There is no support at all for void."
4643 case "$voidflags" in
4646 Support flag bits are:
4647 1: basic void declarations.
4648 2: arrays of pointers to functions returning void.
4649 4: operations between pointers to and addresses of void functions.
4650 8: generic void pointers.
4653 rp="Your void support flags add up to what?"
4660 : check for length of pointer
4664 echo "Checking to see how big your pointers are..." >&4
4665 if test "$voidflags" -gt 7; then
4666 echo '#define VOID_PTR char *' > try.c
4668 echo '#define VOID_PTR void *' > try.c
4670 $cat >>try.c <<'EOCP'
4674 printf("%d\n", (int)sizeof(VOID_PTR));
4679 if eval $compile_ok; then
4681 echo "Your pointers are $ptrsize bytes long."
4684 echo "(I can't seem to compile the test program. Guessing...)" >&4
4685 rp="What is the size of a pointer (in bytes)?"
4693 : check for long long
4695 echo "Checking to see if you have long long..." >&4
4696 echo 'int main() { long long x = 7; return 0; }' > try.c
4698 if eval $compile; then
4700 echo "You have long long."
4703 echo "You do not have long long."
4709 : check for length of long long
4710 case "${d_longlong}${longlongsize}" in
4713 echo "Checking to see how big your long longs are..." >&4
4714 $cat >try.c <<'EOCP'
4718 printf("%d\n", (int)sizeof(long long));
4723 if eval $compile_ok; then
4724 longlongsize=`./try$exe_ext`
4725 echo "Your long longs are $longlongsize bytes long."
4729 echo "(I can't seem to compile the test program. Guessing...)"
4730 rp="What is the size of a long long (in bytes)?"
4734 if $test "X$longsize" = "X$longlongsize"; then
4735 echo "(That isn't any different from an ordinary long.)"
4741 : determine filename position in cpp output
4743 echo "Computing filename position in cpp output for #include directives..." >&4
4744 echo '#include <stdio.h>' > foo.c
4747 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
4748 $grep '^[ ]*#.*stdio\.h' | \
4749 while read cline; do
4752 while $test \$# -gt 0; do
4753 if $test -r \`echo \$1 | $tr -d '"'\`; then
4758 pos=\`expr \$pos + 1\`
4770 *) pos="${fieldn}th";;
4772 echo "Your cpp writes the filename in the $pos field of the line."
4774 : locate header file
4779 for usrincdir in $usrinc
4781 if test -f \$usrincdir/\$wanted; then
4782 echo "\$usrincdir/\$wanted"
4786 awkprg='{ print \$$fieldn }'
4787 echo "#include <\$wanted>" > foo\$\$.c
4788 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
4789 $grep "^[ ]*#.*\$wanted" | \
4790 while read cline; do
4791 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
4793 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
4794 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
4799 # status = 0: grep returned 0 lines, case statement not executed
4800 # status = 1: headerfile found
4801 # status = 2: while loop executed, no headerfile found
4805 if test \$status -eq 1; then
4812 : define an alternate in-header-list? function
4813 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
4814 cont=true; xxf="echo \"<\$1> found.\" >&4";
4815 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
4816 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
4818 case $# in 4) instead=instead;; *) instead="at last";; esac;
4819 while $test "$cont"; do
4821 var=$2; eval "was=\$$2";
4822 if $test "$xxx" && $test -r "$xxx";
4824 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
4827 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
4828 set $yyy; shift; shift; yyy=$@;
4829 case $# in 0) cont="";;
4830 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
4831 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
4832 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
4833 xxnf="echo \"there is no <\$1>, ...\" >&4";;
4837 do set $yyy; var=$2; eval "was=\$$2";
4838 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
4839 set $yyy; shift; shift; yyy=$@;
4842 : see if inttypes.h is available
4843 : we want a real compile instead of Inhdr because some systems
4844 : have an inttypes.h which includes non-existent headers
4847 #include <inttypes.h>
4849 static int32_t foo32 = 0x12345678;
4853 if eval $compile; then
4854 echo "<inttypes.h> found." >&4
4857 echo "<inttypes.h> NOT found." >&4
4866 echo "Checking to see if you have int64_t..." >&4
4868 #include <sys/types.h>
4869 #$i_inttypes I_INTTYPES
4871 #include <inttypes.h>
4873 int main() { int64_t x = 7; }
4876 if eval $compile; then
4878 echo "You have int64_t."
4881 echo "You do not have int64_t."
4889 echo "Checking which 64-bit integer type we could use..." >&4
4895 val='"unsigned int"'
4900 *) case "$longsize" in
4904 val='"unsigned long"'
4909 *) case "$d_longlong:$longlongsize" in
4914 val='"unsigned long long"'
4919 *) case "$d_int64_t" in
4938 '') echo "Alas, no 64-bit integer types in sight." >&4
4941 *) echo "We could use '$quadtype' for 64-bit integers." >&4
4947 case "$uselonglong" in
4948 "$define"|true|[yY]*)
4951 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
4953 use64bitint="$define"
4956 case "$use64bits" in
4957 "$define"|true|[yY]*)
4960 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
4962 use64bitint="$define"
4965 case "$use64bitints" in
4966 "$define"|true|[yY]*)
4969 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
4971 use64bitint="$define"
4974 case "$use64bitsint" in
4975 "$define"|true|[yY]*)
4978 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
4980 use64bitint="$define"
4983 case "$uselonglongs" in
4984 "$define"|true|[yY]*)
4987 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
4989 use64bitint="$define"
4992 case "$use64bitsall" in
4993 "$define"|true|[yY]*)
4996 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
4998 use64bitall="$define"
5003 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5005 case "$use64bitall" in
5006 "$define"|true|[yY]*) use64bitint="$define" ;;
5012 You have natively 64-bit long integers.
5016 *) case "$use64bitint" in
5017 "$define"|true|[yY]*) dflt='y';;
5026 Perl can be built to take advantage of 64-bit integer types
5027 on some systems. To do so, Configure can be run with -Duse64bitint.
5028 Choosing this option will most probably introduce binary incompatibilities.
5030 If this doesn't make any sense to you, just accept the default '$dflt'.
5031 (The default has been chosen based on your configuration.)
5033 rp='Try to use 64-bit integers, if available?'
5036 [yY]*) val="$define" ;;
5044 case "$use64bitall" in
5045 "$define"|true|[yY]*) dflt='y' ;;
5046 *) case "$longsize" in
5054 You may also choose to try maximal 64-bitness. It means using as much
5055 64-bitness as possible on the platform. This in turn means even more
5056 binary incompatibilities. On the other hand, your platform may not
5057 have any more 64-bitness available than what you already have chosen.
5059 If this doesn't make any sense to you, just accept the default '$dflt'.
5060 (The default has been chosen based on your configuration.)
5062 rp='Try to use maximal 64-bit support, if available?'
5065 [yY]*) val="$define" ;;
5070 case "$use64bitall" in
5072 case "$use64bitint" in
5076 Since you have chosen a maximally 64-bit build, I'm also turning on
5077 the use of 64-bit integers.
5079 use64bitint="$define" ;;
5084 case "$use64bitall" in
5085 "$define"|true|[yY]*)
5089 *** You have chosen a maximally 64-bit build, but your pointers
5090 *** are only 4 bytes wide, disabling maximal 64-bitness.
5093 use64bitall="$undef"
5094 case "$use64bitint" in
5095 "$define"|true|[yY]*) ;;
5098 *** Downgrading from maximal 64-bitness to using 64-bit integers.
5101 use64bitint="$define"
5109 case "$use64bitint" in
5110 "$define"|true|[yY]*)
5111 : Look for a hint-file generated 'call-back-unit'. If the
5112 : user has specified that a 64-bit perl is to be built,
5113 : we may need to set or change some other defaults.
5114 if $test -f use64bitint.cbu; then
5115 echo "Your platform has some specific hints for 64-bit integers, using them..."
5119 4) case "$archname64" in
5120 '') archname64=64int ;;
5127 case "$use64bitall" in
5128 "$define"|true|[yY]*)
5129 : Look for a hint-file generated 'call-back-unit'. If the
5130 : user has specified that a maximally 64-bit perl is to be built,
5131 : we may need to set or change some other defaults.
5132 if $test -f use64bitall.cbu; then
5133 echo "Your platform has some specific hints for 64-bit builds, using them..."
5137 4) case "$archname64" in
5138 ''|64int) archname64=64all ;;
5146 echo "Checking for GNU C Library..." >&4
5147 cat >gnulibc.c <<EOM
5159 if eval $compile_ok && ./gnulibc; then
5161 echo "You are using the GNU C Library"
5164 echo "You are not using the GNU C Library"
5170 : see if nm is to be used to determine whether a symbol is defined or not
5174 case "$d_gnulibc" in
5177 echo "nm probably won't work on the GNU C Library." >&4
5183 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
5185 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
5186 echo "'nm' won't be sufficient on this sytem." >&4
5192 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
5193 if $test $dflt -gt 20; then
5203 true|$define) dflt=y;;
5210 I can use $nm to extract the symbols from your C libraries. This
5211 is a time consuming task which may generate huge output on the disk (up
5212 to 3 megabytes) but that should make the symbols extraction faster. The
5213 alternative is to skip the 'nm' extraction part and to compile a small
5214 test program instead to determine whether each symbol is present. If
5215 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
5216 this may be the best solution.
5218 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
5221 rp="Shall I use $nm to extract C symbols from the libraries?"
5224 [Nn]*) usenm=false;;
5233 : nm options which may be necessary
5235 '') if $test -f /mach_boot; then
5237 elif $test -d /usr/ccs/lib; then
5238 nm_opt='-p' # Solaris (and SunOS?)
5239 elif $test -f /dgux; then
5241 elif $test -f /lib64/rld; then
5242 nm_opt='-p' # 64-bit Irix
5248 : nm options which may be necessary for shared libraries but illegal
5249 : for archive libraries. Thank you, Linux.
5250 case "$nm_so_opt" in
5251 '') case "$myuname" in
5253 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
5254 nm_so_opt='--dynamic'
5263 : get list of predefined functions in a handy place
5268 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
5275 *) for thislib in $libs; do
5278 : Handle C library specially below.
5281 thislib=`echo $thislib | $sed -e 's/^-l//'`
5282 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
5284 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
5286 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
5288 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
5290 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
5292 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
5294 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
5299 libnames="$libnames $try"
5301 *) libnames="$libnames $thislib" ;;
5310 for xxx in $libpth; do
5311 $test -r $1 || set $xxx/libc.$so
5312 : The messy sed command sorts on library version numbers.
5314 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
5315 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
5317 s/[0-9][0-9]*/0000&/g
5318 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
5321 $sort | $sed -e 's/^.* //'`
5324 $test -r $1 || set /usr/ccs/lib/libc.$so
5325 $test -r $1 || set /lib/libsys_s$_a
5331 if $test -r "$1"; then
5332 echo "Your (shared) C library seems to be in $1."
5334 elif $test -r /lib/libc && $test -r /lib/clib; then
5335 echo "Your C library seems to be in both /lib/clib and /lib/libc."
5337 libc='/lib/clib /lib/libc'
5338 if $test -r /lib/syslib; then
5339 echo "(Your math library is in /lib/syslib.)"
5340 libc="$libc /lib/syslib"
5342 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5343 echo "Your C library seems to be in $libc, as you said before."
5344 elif $test -r $incpath/usr/lib/libc$_a; then
5345 libc=$incpath/usr/lib/libc$_a;
5346 echo "Your C library seems to be in $libc. That's fine."
5347 elif $test -r /lib/libc$_a; then
5349 echo "Your C library seems to be in $libc. You're normal."
5351 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
5353 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
5354 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
5355 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
5357 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5359 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5362 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
5364 if $test -r "$tans"; then
5365 echo "Your C library seems to be in $tans, of all places."
5371 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5375 If the guess above is wrong (which it might be if you're using a strange
5376 compiler, or your machine supports multiple models), you can override it here.
5381 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
5383 I can't seem to find your C library. I've looked in the following places:
5386 $sed 's/^/ /' libpath
5389 None of these seems to contain your C library. I need to get its name...
5394 rp='Where is your C library?'
5399 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
5400 set X `cat libnames`
5403 case $# in 1) xxx=file; esac
5404 echo "Extracting names from the following $xxx for later perusal:" >&4
5406 $sed 's/^/ /' libnames >&4
5408 $echo $n "This may take a while...$c" >&4
5412 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
5413 *) $nm $nm_opt $file 2>/dev/null;;
5418 $grep fprintf libc.tmp > libc.ptf
5419 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
5420 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
5422 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
5424 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5426 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
5428 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5430 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
5432 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5434 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
5436 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5438 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
5440 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5442 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
5444 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5446 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
5447 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
5449 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5451 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
5453 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5455 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
5457 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5459 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
5461 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5463 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
5465 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5467 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
5469 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5471 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
5473 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5475 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
5477 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5480 $nm -p $* 2>/dev/null >libc.tmp
5481 $grep fprintf libc.tmp > libc.ptf
5482 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
5483 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
5489 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
5491 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
5492 for thisname in $libnames $libc; do
5493 $ar t $thisname >>libc.tmp
5495 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
5497 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
5498 # Repeat libc to extract forwarders to DLL entries too
5499 for thisname in $libnames $libc; do
5500 $ar tv $thisname >>libc.tmp
5501 # Revision 50 of EMX has bug in $ar.
5502 # it will not extract forwarders to DLL entries
5503 # Use emximp which will extract exactly them.
5504 emximp -o tmp.imp $thisname \
5506 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
5507 < tmp.imp >>libc.tmp
5510 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
5513 echo "$ar didn't seem to work right." >&4
5514 echo "Maybe this is a Cray...trying bld instead..." >&4
5515 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
5517 for thisname in $libnames; do
5519 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
5520 $ar t $thisname >>libc.tmp
5524 echo "That didn't work either. Giving up." >&4
5531 if $test -f /lib/syscalls.exp; then
5533 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
5534 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*$/\1/p' /lib/syscalls.exp >>libc.list
5538 $rm -f libnames libpath
5540 : is a C symbol defined?
5543 -v) tf=libc.tmp; tc=""; tdc="";;
5544 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
5545 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
5548 case "$reuseval-$4" in
5550 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
5556 if $contains $tlook $tf >/dev/null 2>&1;
5561 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
5562 if $cc -o t $optimize $ccflags $ldflags t.c $libs >/dev/null 2>&1;
5570 $define) tval=true;;
5576 : define an is-in-libc? function
5577 inlibc='echo " "; td=$define; tu=$undef;
5578 sym=$1; var=$2; eval "was=\$$2";
5580 case "$reuseval$was" in
5590 echo "$sym() found." >&4;
5591 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
5593 echo "$sym() NOT found." >&4;
5594 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
5598 $define) echo "$sym() found." >&4;;
5599 *) echo "$sym() NOT found." >&4;;
5603 : see if sqrtl exists
5608 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
5611 case "$uselongdouble" in
5612 $define|true|[yY]*) dflt='y';;
5617 Perl can be built to take advantage of long doubles which
5618 (if available) may give more accuracy and range for floating point numbers.
5620 If this doesn't make any sense to you, just accept the default '$dflt'.
5622 rp='Try to use long doubles if available?'
5625 y|Y) val="$define" ;;
5631 case "$uselongdouble" in
5632 true|[yY]*) uselongdouble="$define" ;;
5635 case "$uselongdouble" in
5637 : Look for a hint-file generated 'call-back-unit'. If the
5638 : user has specified that long doubles should be used,
5639 : we may need to set or change some other defaults.
5640 if $test -f uselongdouble.cbu; then
5641 echo "Your platform has some specific hints for long doubles, using them..."
5642 . ./uselongdouble.cbu
5645 (Your platform doesn't have any specific hints for long doubles.)
5651 case "$uselongdouble:$d_sqrtl" in
5655 *** You requested the use of long doubles but you do not seem to have
5656 *** the mathematic functions for long doubles. I'm disabling the use
5657 *** of long doubles.
5660 uselongdouble=$undef
5664 : check for length of double
5666 case "$doublesize" in
5668 echo "Checking to see how big your double precision numbers are..." >&4
5669 $cat >try.c <<'EOCP'
5673 printf("%d\n", (int)sizeof(double));
5678 if eval $compile_ok; then
5680 echo "Your double is $doublesize bytes long."
5683 echo "(I can't seem to compile the test program. Guessing...)"
5684 rp="What is the size of a double precision number (in bytes)?"
5692 : check for long doubles
5694 echo "Checking to see if you have long double..." >&4
5695 echo 'int main() { long double x = 7.0; }' > try.c
5697 if eval $compile; then
5699 echo "You have long double."
5702 echo "You do not have long double."
5708 : check for length of long double
5709 case "${d_longdbl}${longdblsize}" in
5712 echo "Checking to see how big your long doubles are..." >&4
5713 $cat >try.c <<'EOCP'
5717 printf("%d\n", sizeof(long double));
5722 if eval $compile; then
5723 longdblsize=`./try$exe_ext`
5724 echo "Your long doubles are $longdblsize bytes long."
5728 echo "(I can't seem to compile the test program. Guessing...)" >&4
5729 rp="What is the size of a long double (in bytes)?"
5733 if $test "X$doublesize" = "X$longdblsize"; then
5734 echo "(That isn't any different from an ordinary double.)"
5740 case "$useperlio" in
5741 $define|true|[yY]*|'') dflt='y';;
5746 Previous version of $package used the standard IO mechanisms as
5747 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
5748 alternate IO mechanisms via the PerlIO abstraction layer, but the
5749 stdio mechanism is still available if needed. The abstraction layer
5750 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
5751 Using PerlIO with sfio may cause problems with some extension modules.
5753 If this doesn't make any sense to you, just accept the default '$dflt'.
5755 rp='Use the PerlIO abstraction layer?'
5762 echo "Ok, doing things the stdio way."
5771 case "$useperlio" in
5772 $define|true|[yY]*) ;;
5775 You are using the SOCKS proxy protocol library which means that you
5776 should also use the PerlIO layer. You may be headed for trouble.
5785 : determine the architecture name
5787 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5788 tarch=`arch`"-$osname"
5789 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5790 if uname -m > tmparch 2>&1 ; then
5791 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5792 -e 's/$/'"-$osname/" tmparch`
5800 case "$myarchname" in
5803 echo "(Your architecture name used to be $myarchname.)"
5810 *) dflt="$archname";;
5812 rp='What is your architecture name'
5815 case "$usethreads" in
5817 echo "Threads selected." >&4
5819 *-thread*) echo "...and architecture name already has -thread." >&4
5821 *) archname="$archname-thread"
5822 echo "...setting architecture name to $archname." >&4
5827 case "$usemultiplicity" in
5829 echo "Multiplicity selected." >&4
5831 *-multi*) echo "...and architecture name already has -multi." >&4
5833 *) archname="$archname-multi"
5834 echo "...setting architecture name to $archname." >&4
5839 case "$use64bitint$use64bitall" in
5841 case "$archname64" in
5843 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
5846 case "$use64bitint" in
5847 "$define") echo "64 bit integers selected." >&4 ;;
5849 case "$use64bitall" in
5850 "$define") echo "Maximal 64 bitness selected." >&4 ;;
5853 *-$archname64*) echo "...and architecture name already has $archname64." >&4
5855 *) archname="$archname-$archname64"
5856 echo "...setting architecture name to $archname." >&4
5862 case "$uselongdouble" in
5864 echo "Long doubles selected." >&4
5865 case "$longdblsize" in
5867 "...but long doubles are equal to doubles, not changing architecture name." >&4
5871 *-ld*) echo "...and architecture name already has -ld." >&4
5873 *) archname="$archname-ld"
5874 echo "...setting architecture name to $archname." >&4
5881 case "$useperlio" in
5883 echo "Perlio selected." >&4
5886 echo "Perlio not selected, using stdio." >&4
5888 *-stdio*) echo "...and architecture name already has -stdio." >&4
5890 *) archname="$archname-stdio"
5891 echo "...setting architecture name to $archname." >&4
5897 : determine root of directory hierarchy where package will be installed.
5900 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
5908 By default, $package will be installed in $dflt/bin, manual pages
5909 under $dflt/man, etc..., i.e. with $dflt as prefix for all
5910 installation directories. Typically this is something like /usr/local.
5911 If you wish to have binaries under /usr/bin but other parts of the
5912 installation under /usr/local, that's ok: you will be prompted
5913 separately for each of the installation directories, the prefix being
5914 only used to set the defaults.
5918 rp='Installation prefix to use?'
5926 *) oldprefix="$prefix";;
5935 *) afsroot=$afsroot ;;
5941 $define|true) afs=true ;;
5942 $undef|false) afs=false ;;
5943 *) if test -d $afsroot; then
5951 echo "AFS may be running... I'll be extra cautious then..." >&4
5953 echo "AFS does not seem to be running..." >&4
5956 : determine installation prefix for where package is to be installed.
5960 Since you are running AFS, I need to distinguish the directory in which
5961 files will reside from the directory in which they are installed (and from
5962 which they are presumably copied to the former directory by occult means).
5965 case "$installprefix" in
5966 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
5967 *) dflt="$installprefix";;
5972 In some special cases, particularly when building $package for distribution,
5973 it is convenient to distinguish between the directory in which files should
5974 be installed from the directory ($prefix) in which they
5975 will eventually reside. For most users, these two directories are the same.
5978 case "$installprefix" in
5980 *) dflt=$installprefix;;
5984 rp='What installation prefix should I use for installing files?'
5986 installprefix="$ans"
5987 installprefixexp="$ansexp"
5989 : set the prefixit variable, to compute a suitable default value
5990 prefixit='case "$3" in
5992 case "$oldprefix" in
5993 "") eval "$1=\"\$$2\"";;
6000 ""|" ") eval "$1=\"\$$2\"";;
6006 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6008 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6009 /*-$oldprefix/*|\~*-$oldprefix/*)
6010 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6011 *) eval "$1=\"\$$2\"";;
6016 : get the patchlevel
6018 echo "Getting the current patchlevel..." >&4
6019 if $test -r $rsrc/patchlevel.h;then
6020 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
6021 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
6022 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
6023 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
6024 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
6025 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
6026 perl_patchlevel=`grep ',"DEVEL[0-9][0-9]*"' $rsrc/patchlevel.h|sed 's/[^0-9]//g'`
6035 $echo "(You do not have patchlevel.h. Eek.)"
6037 if $test -r $rsrc/.patch ; then
6038 if $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
6039 perl_patchlevel=`cat $rsrc/.patch`
6042 case "$perl_patchlevel" in
6044 '') $echo "(You have $package version $patchlevel subversion $subversion.)" ;;
6045 *) $echo "(You have $package version $patchlevel subversion $subversion patchlevel $perl_patchlevel.)" ;;
6049 : XXX Should be a Configure test for double-dots in filenames.
6050 version=`echo $revision $patchlevel $subversion | \
6051 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
6052 api_versionstring=`echo $api_revision $api_version $api_subversion | \
6053 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
6056 version=`echo $revision $patchlevel $subversion | \
6057 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
6058 api_versionstring=`echo $api_revision $api_version $api_subversion | \
6059 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
6062 : Special case the 5.005_xx maintenance series, which used 5.005
6063 : without any subversion label as a subdirectory in $sitelib
6064 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
6065 api_versionstring='5.005'
6068 : determine installation style
6069 : For now, try to deduce it from prefix unless it is already set.
6070 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6071 case "$installstyle" in
6072 '') case "$prefix" in
6073 *perl*) dflt='lib';;
6074 *) dflt='lib/perl5' ;;
6077 *) dflt="$installstyle" ;;
6079 : Probably not worth prompting for this since we prompt for all
6080 : the directories individually, and the prompt would be too long and
6084 : determine where private library files go
6085 : Usual default is /usr/local/lib/perl5/$version.
6086 : Also allow things like /opt/perl/lib/$version, since
6087 : /opt/perl/lib/perl5... would be redundant.
6088 : The default "style" setting is made in installstyle.U
6089 case "$installstyle" in
6090 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6091 *) set dflt privlib lib/$version ;;
6096 There are some auxiliary files for $package that need to be put into a
6097 private library directory that is accessible by everyone.
6101 rp='Pathname where the private library files will reside?'
6104 privlibexp="$ansexp"
6105 : Change installation prefix, if necessary.
6106 if $test X"$prefix" != X"$installprefix"; then
6107 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
6109 installprivlib="$privlibexp"
6112 : set the prefixup variable, to restore leading tilda escape
6113 prefixup='case "$prefixexp" in
6115 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6118 : determine where public architecture dependent libraries go
6121 : privlib default is /usr/local/lib/$package/$version
6122 : archlib default is /usr/local/lib/$package/$version/$archname
6123 : privlib may have an optional trailing /share.
6124 tdflt=`echo $privlib | $sed 's,/share$,,'`
6125 tdflt=$tdflt/$archname
6134 $spackage contains architecture-dependent library files. If you are
6135 sharing libraries in a heterogeneous environment, you might store
6136 these files in a separate location. Otherwise, you can just include
6137 them with the rest of the public library files.
6141 rp='Where do you want to put the public architecture-dependent libraries?'
6144 archlibexp="$ansexp"
6145 if $test X"$archlib" = X"$privlib"; then
6150 : Change installation prefix, if necessary.
6151 if $test X"$prefix" != X"$installprefix"; then
6152 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
6154 installarchlib="$archlibexp"
6158 : Binary compatibility with 5.005 is not possible for builds
6159 : with advanced features
6160 case "$usethreads$usemultiplicity" in
6162 bincompat5005="$undef"
6163 d_bincompat5005="$undef"
6167 This version of Perl can be compiled for binary compatibility with 5.005.
6168 If you decide to do so, you will be able to continue using most of the
6169 extensions that were compiled for Perl 5.005.
6172 case "$bincompat5005$d_bincompat5005" in
6173 *"$undef"*) dflt=n ;;
6176 rp='Binary compatibility with Perl 5.005?'
6179 y*) val="$define" ;;
6184 case "$d_bincompat5005" in
6186 bincompat5005="$define"
6188 *) bincompat5005="$undef"
6189 d_bincompat5005="$undef"
6196 : see if setuid scripts can be secure
6199 Some kernels have a bug that prevents setuid #! scripts from being
6200 secure. Some sites have disabled setuid #! scripts because of this.
6202 First let's decide if your kernel supports secure setuid #! scripts.
6203 (If setuid #! scripts would be secure but have been disabled anyway,
6204 don't say that they are secure if asked.)
6209 if $test -d /dev/fd; then
6210 echo "#!$ls" >reflect
6211 chmod +x,u+s reflect
6212 ./reflect >flect 2>&1
6213 if $contains "/dev/fd" flect >/dev/null; then
6214 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6218 If you are not sure if they are secure, I can check but I'll need a
6219 username and password different from the one you are using right now.
6220 If you don't have such a username or don't want me to test, simply
6224 rp='Other username to test security of setuid scripts with?'
6229 case "$d_suidsafe" in
6230 '') echo "I'll assume setuid scripts are *not* secure." >&4
6233 echo "Well, the $hint value is *not* secure." >&4
6235 *) echo "Well, the $hint value *is* secure." >&4
6240 $rm -f reflect flect
6241 echo "#!$ls" >reflect
6242 chmod +x,u+s reflect
6245 echo '"su" will (probably) prompt you for '"$ans's password."
6246 su $ans -c './reflect >flect'
6247 if $contains "/dev/fd" flect >/dev/null; then
6248 echo "Okay, it looks like setuid scripts are secure." >&4
6251 echo "I don't think setuid scripts are secure." >&4
6256 rp='Does your kernel have *secure* setuid scripts?'
6259 [yY]*) val="$define";;
6264 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6265 echo "(That's for file descriptors, not floppy disks.)"
6271 $rm -f reflect flect
6273 : now see if they want to do setuid emulation
6276 case "$d_suidsafe" in
6279 echo "No need to emulate SUID scripts since they are secure here." >& 4
6283 Some systems have disabled setuid scripts, especially systems where
6284 setuid scripts cannot be secure. On systems where setuid scripts have
6285 been disabled, the setuid/setgid bits on scripts are currently
6286 useless. It is possible for $package to detect those bits and emulate
6287 setuid/setgid in a secure fashion. This emulation will only work if
6288 setuid scripts have been disabled in your kernel.
6292 "$define") dflt=y ;;
6295 rp="Do you want to do setuid/setgid emulation?"
6298 [yY]*) val="$define";;
6306 : see if this is a malloc.h system
6307 set malloc.h i_malloc
6310 : see if stdlib is available
6311 set stdlib.h i_stdlib
6314 : determine which malloc to compile in
6316 case "$usemymalloc" in
6317 [yY]*|true|$define) dflt='y' ;;
6318 [nN]*|false|$undef) dflt='n' ;;
6319 *) case "$ptrsize" in
6325 rp="Do you wish to attempt to use the malloc that comes with $package?"
6331 mallocsrc='malloc.c'
6332 mallocobj="malloc$_o"
6333 d_mymalloc="$define"
6336 : Remove malloc from list of libraries to use
6337 echo "Removing unneeded -lmalloc from library list" >&4
6338 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6341 echo "libs = $libs" >&4
6353 : compute the return types of malloc and free
6355 $cat >malloc.c <<END
6359 #include <sys/types.h>
6373 case "$malloctype" in
6375 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6382 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6386 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6393 echo "Your system uses $freetype free(), it would seem." >&4
6397 After $package is installed, you may wish to install various
6398 add-on modules and utilities. Typically, these add-ons will
6399 be installed under $prefix with the rest
6400 of this package. However, you may wish to install such add-ons
6401 elsewhere under a different prefix.
6403 If you do not wish to put everything under a single prefix, that's
6404 ok. You will be prompted for the individual locations; this siteprefix
6405 is only used to suggest the defaults.
6407 The default should be fine for most people.
6411 rp='Installation prefix to use for add-on modules and utilities?'
6412 : XXX Here might be another good place for an installstyle setting.
6413 case "$siteprefix" in
6415 *) dflt=$siteprefix ;;
6418 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6420 case "$siteprefix" in
6424 *) oldsiteprefix="$prefix";;
6429 siteprefixexp="$ansexp"
6431 : determine where site specific libraries go.
6432 : Usual default is /usr/local/lib/perl5/site_perl/$version
6433 : The default "style" setting is made in installstyle.U
6434 : XXX No longer works with Prefixit stuff.
6435 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6437 '') case "$installstyle" in
6438 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6439 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6447 The installation process will create a directory for
6448 site-specific extensions and modules. Most users find it convenient
6449 to place all site-specific files in this directory rather than in the
6450 main distribution directory.
6454 rp='Pathname for the site-specific library files?'
6457 sitelibexp="$ansexp"
6458 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6459 : Change installation prefix, if necessary.
6460 if $test X"$prefix" != X"$installprefix"; then
6461 installsitelib=`echo $sitelibexp | $sed "s#^$prefix#$installprefix#"`
6463 installsitelib="$sitelibexp"
6466 : determine where site specific architecture-dependent libraries go.
6467 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6468 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6469 : sitelib may have an optional trailing /share.
6471 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6472 dflt="$dflt/$archname"
6477 set sitearch sitearch none
6481 The installation process will also create a directory for
6482 architecture-dependent site-specific extensions and modules.
6486 rp='Pathname for the site-specific architecture-dependent library files?'
6489 sitearchexp="$ansexp"
6490 : Change installation prefix, if necessary.
6491 if $test X"$prefix" != X"$installprefix"; then
6492 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
6494 installsitearch="$sitearchexp"
6499 The installation process will also create a directory for
6500 vendor-supplied add-ons. Vendors who supply perl with their system
6501 may find it convenient to place all vendor-supplied files in this
6502 directory rather than in the main distribution directory. This will
6503 ease upgrades between binary-compatible maintenance versions of perl.
6505 Of course you may also use these directories in whatever way you see
6506 fit. For example, you might use them to access modules shared over a
6507 company-wide network.
6509 The default answer should be fine for most people.
6510 This causes further questions about vendor add-ons to be skipped
6511 and no vendor-specific directories will be configured for perl.
6514 rp='Do you want to configure vendor-specific add-on directories?'
6515 case "$usevendorprefix" in
6516 define|true|[yY]*) dflt=y ;;
6517 *) : User may have set vendorprefix directly on Configure command line.
6518 case "$vendorprefix" in
6527 rp='Installation prefix to use for vendor-supplied add-ons?'
6528 case "$vendorprefix" in
6530 *) dflt=$vendorprefix ;;
6533 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6535 case "$vendorprefix" in
6539 *) oldvendorprefix="$prefix";;
6543 usevendorprefix="$define"
6545 vendorprefixexp="$ansexp"
6547 *) usevendorprefix="$undef"
6553 case "$vendorprefix" in
6554 '') d_vendorlib="$undef"
6558 *) d_vendorlib="$define"
6559 : determine where vendor-supplied modules go.
6560 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6561 case "$vendorlib" in
6563 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6564 case "$installstyle" in
6565 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6566 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6569 *) dflt="$vendorlib"
6573 rp='Pathname for the vendor-supplied library files?'
6576 vendorlibexp="$ansexp"
6579 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6580 : Change installation prefix, if necessary.
6581 if $test X"$prefix" != X"$installprefix"; then
6582 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
6584 installvendorlib="$vendorlibexp"
6587 case "$vendorprefix" in
6588 '') d_vendorarch="$undef"
6592 *) d_vendorarch="$define"
6593 : determine where vendor-supplied architecture-dependent libraries go.
6594 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6595 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6596 : vendorlib may have an optional trailing /share.
6597 case "$vendorarch" in
6598 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6599 dflt="$dflt/$archname"
6601 *) dflt="$vendorarch" ;;
6604 rp='Pathname for vendor-supplied architecture-dependent files?'
6607 vendorarchexp="$ansexp"
6610 : Change installation prefix, if necessary.
6611 if $test X"$prefix" != X"$installprefix"; then
6612 installvendorarch=`echo $vendorarchexp | sed "s#^$prefix#$installprefix#"`
6614 installvendorarch="$vendorarchexp"
6617 : Final catch-all directories to search
6620 Lastly, you can have perl look in other directories for extensions and
6621 modules in addition to those already specified.
6622 These directories will be searched after
6626 test X"$vendorlib" != "X" && echo ' ' $vendorlib
6627 test X"$vendorarch" != "X" && echo ' ' $vendorarch
6629 case "$otherlibdirs" in
6630 ''|' ') dflt='none' ;;
6631 *) dflt="$otherlibdirs" ;;
6634 Enter a colon-separated set of extra paths to include in perl's @INC
6635 search path, or enter 'none' for no extra paths.
6639 rp='Colon-separated list of additional directories for perl to search?'
6642 ' '|''|none) otherlibdirs=' ' ;;
6643 *) otherlibdirs="$ans" ;;
6645 case "$otherlibdirs" in
6649 set d_perl_otherlibdirs
6652 : Cruising for prototypes
6654 echo "Checking out function prototypes..." >&4
6655 $cat >prototype.c <<'EOCP'
6656 int main(int argc, char *argv[]) {
6659 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
6660 echo "Your C compiler appears to support function prototypes."
6663 echo "Your C compiler doesn't seem to understand function prototypes."
6670 case "$prototype" in
6672 *) ansi2knr='ansi2knr'
6677 This version of $package can only be compiled by a compiler that
6678 understands function prototypes. Unfortunately, your C compiler
6680 doesn't seem to understand them. Sorry about that.
6682 If GNU cc is available for your system, perhaps you could try that instead.
6684 Eventually, we hope to support building Perl with pre-ANSI compilers.
6685 If you would like to help in that effort, please contact <perlbug@perl.org>.
6687 Aborting Configure now.
6693 : determine where public executables go
6698 rp='Pathname where the public executables will reside?'
6700 if $test "X$ansexp" != "X$binexp"; then
6705 : Change installation prefix, if necessary.
6706 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6707 if $test X"$prefix" != X"$installprefix"; then
6708 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
6710 installbin="$binexp"
6713 : Find perl5.005 or later.
6714 echo "Looking for a previously installed perl5.005 or later... "
6716 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6717 : Check if this perl is recent and can load a simple module
6718 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6721 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6731 '') echo "None found. That's ok.";;
6732 *) echo "Using $perl5." ;;
6735 : Determine list of previous versions to include in @INC
6736 $cat > getverlist <<EOPL
6739 \$api_versionstring = "$api_versionstring";
6740 \$version = "$version";
6741 \$stem = "$sitelib_stem";
6742 \$archname = "$archname";
6744 $cat >> getverlist <<'EOPL'
6745 # Can't have leading @ because metaconfig interprets it as a command!
6746 ;@inc_version_list=();
6747 # XXX Redo to do opendir/readdir?
6750 ;@candidates = glob("5.*");
6756 # XXX ToDo: These comparisons must be reworked when two-digit
6757 # subversions come along, so that 5.7.10 compares as greater than
6758 # 5.7.3! By that time, hope that 5.6.x is sufficiently
6759 # widespread that we can use the built-in version vectors rather
6760 # than reinventing them here. For 5.6.0, however, we must
6761 # assume this script will likely be run by 5.005_0x. --AD 1/2000.
6762 foreach $d (@candidates) {
6763 if ($d lt $version) {
6764 if ($d ge $api_versionstring) {
6765 unshift(@inc_version_list, grep { -d } "$d/$archname", $d);
6767 elsif ($d ge "5.005") {
6768 unshift(@inc_version_list, grep { -d } $d);
6772 # Skip newer version. I.e. don't look in
6773 # 5.7.0 if we're installing 5.6.1.
6777 if (@inc_version_list) {
6778 print join(' ', @inc_version_list);
6781 # Blank space to preserve value for next Configure run.
6786 case "$inc_version_list" in
6787 '') if test -x "$perl5$exe_ext"; then
6788 dflt=`$perl5 getverlist`
6793 $undef) dflt='none' ;;
6794 *) eval dflt=\"$inc_version_list\" ;;
6797 ''|' ') dflt=none ;;
6800 5.005) case "$bincompat5005" in
6801 $define|true|[yY]*) ;;
6808 In order to ease the process of upgrading, this version of perl
6809 can be configured to use modules built and installed with earlier
6810 versions of perl that were installed under $prefix. Specify here
6811 the list of earlier versions that this version of perl should check.
6812 If Configure detected no earlier versions of perl installed under
6813 $prefix, then the list will be empty. Answer 'none' to tell perl
6814 to not search earlier versions.
6816 The default should almost always be sensible, so if you're not sure,
6817 just accept the default.
6820 rp='List of earlier versions to include in @INC?'
6823 [Nn]one|''|' ') inc_version_list=' ' ;;
6824 *) inc_version_list="$ans" ;;
6826 case "$inc_version_list" in
6828 inc_version_list_init='0';;
6829 *) inc_version_list_init=`echo $inc_version_list |
6830 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6835 : determine whether to install perl also as /usr/bin/perl
6838 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
6840 Many scripts expect perl to be installed as /usr/bin/perl.
6841 I can install the perl you are about to compile also as /usr/bin/perl
6842 (in addition to $installbin/perl).
6844 case "$installusrbinperl" in
6845 "$undef"|[nN]*) dflt='n';;
6848 rp="Do you want to install perl as /usr/bin/perl?"
6851 [yY]*) val="$define";;
6857 set installusrbinperl
6860 : see if dld is available
6864 : see if dlopen exists
6871 : determine which dynamic loading, if any, to compile in
6873 dldir="ext/DynaLoader"
6886 $define) dflt='y' ;;
6889 $define) dflt='y' ;;
6891 : Does a dl_xxx.xs file exist for this operating system
6892 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
6895 rp="Do you wish to use dynamic loading?"
6902 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
6903 dflt="$dldir/dl_${osname}.xs"
6904 elif $test "$d_dlopen" = "$define" ; then
6905 dflt="$dldir/dl_dlopen.xs"
6906 elif $test "$i_dld" = "$define" ; then
6907 dflt="$dldir/dl_dld.xs"
6912 *) dflt="$dldir/$dlsrc"
6915 echo "The following dynamic loading files are available:"
6916 : Can not go over to $dldir because getfile has path hard-coded in.
6917 tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir
6918 rp="Source file to use for dynamic loading"
6924 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
6928 Some systems may require passing special flags to $cc -c to
6929 compile modules that will be used to create a shared library.
6930 To use no flags, say "none".
6933 case "$cccdlflags" in
6934 '') case "$gccversion" in
6935 '') case "$osname" in
6937 next) dflt='none' ;;
6938 irix*) dflt='-KPIC' ;;
6939 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
6940 sunos) dflt='-pic' ;;
6944 *) case "$osname" in
6945 svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
6950 *) dflt="$cccdlflags" ;;
6952 rp="Any special flags to pass to $cc -c to compile shared library modules?"
6955 none) cccdlflags=' ' ;;
6956 *) cccdlflags="$ans" ;;
6961 Some systems use ld to create libraries that can be dynamically loaded,
6962 while other systems (such as those using ELF) use $cc.
6966 '') $cat >try.c <<'EOM'
6967 /* Test for whether ELF binaries are produced */
6972 int i = open("a.out",O_RDONLY);
6975 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
6976 exit(0); /* succeed (yes, it's ELF) */
6981 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && ./a.out; then
6983 You appear to have ELF support. I'll use $cc to build dynamic libraries.
6987 echo "I'll use ld to build dynamic libraries."
6996 rp="What command should be used to create dynamic libraries?"
7002 Some systems may require passing special flags to $ld to create a
7003 library that can be dynamically loaded. If your ld flags include
7004 -L/other/path options to locate libraries outside your loader's normal
7005 search path, you may need to specify those -L options here as well. To
7006 use no flags, say "none".
7009 case "$lddlflags" in
7010 '') case "$osname" in
7011 beos) dflt='-nostart' ;;
7013 case "$gccversion" in
7014 '') dflt="$dflt +vnocompatwarnings" ;;
7017 linux|irix*) dflt='-shared' ;;
7018 next) dflt='none' ;;
7019 solaris) dflt='-G' ;;
7020 sunos) dflt='-assert nodefinitions' ;;
7021 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
7025 *) dflt="$lddlflags" ;;
7028 : Try to guess additional flags to pick up local libraries.
7029 : Be careful not to append to a plain 'none'
7033 for thisflag in $ldflags; do
7038 *) dflt="$dflt $thisflag" ;;
7045 ''|' ') dflt='none' ;;
7048 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
7051 none) lddlflags=' ' ;;
7052 *) lddlflags="$ans" ;;
7057 Some systems may require passing special flags to $cc to indicate that
7058 the resulting executable will use dynamic linking. To use no flags,
7062 case "$ccdlflags" in
7063 '') case "$osname" in
7064 hpux) dflt='-Wl,-E' ;;
7065 linux) dflt='-rdynamic' ;;
7066 next) dflt='none' ;;
7067 sunos) dflt='none' ;;
7071 *) dflt="$ccdlflags" ;;
7073 rp="Any special flags to pass to $cc to use dynamic linking?"
7076 none) ccdlflags=' ' ;;
7077 *) ccdlflags="$ans" ;;
7091 # No dynamic loading being used, so don't bother even to prompt.
7094 *) case "$useshrplib" in
7095 '') case "$osname" in
7096 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
7098 also='Building a shared libperl is required for dynamic loading to work on your system.'
7103 also='Building a shared libperl is needed for MAB support.'
7121 The perl executable is normally obtained by linking perlmain.c with
7122 libperl${_a}, any static extensions (usually just DynaLoader), and
7123 any other libraries needed on this system (such as -lm, etc.). Since
7124 your system supports dynamic loading, it is probably possible to build
7125 a shared libperl.$so. If you will have more than one executable linked
7126 to libperl.$so, this will significantly reduce the size of each
7127 executable, but it may have a noticeable affect on performance. The
7128 default is probably sensible for your system.
7132 rp="Build a shared libperl.$so (y/n)"
7136 useshrplib='true' ;;
7137 *) useshrplib='false' ;;
7142 case "$useshrplib" in
7146 # Figure out a good name for libperl.so. Since it gets stored in
7147 # a version-specific architecture-dependent library, the version
7148 # number isn't really that important, except for making cc/ld happy.
7150 # A name such as libperl.so.3.1
7151 majmin="libperl.$so.$patchlevel.$subversion"
7152 # A name such as libperl.so.301
7153 majonly=`echo $patchlevel $subversion |
7154 $awk '{printf "%d%02d", $1, $2}'`
7155 majonly=libperl.$so.$majonly
7156 # I'd prefer to keep the os-specific stuff here to a minimum, and
7157 # rely on figuring it out from the naming of libc.
7158 case "${osname}${osvers}" in
7161 # XXX How handle the --version stuff for MAB?
7163 linux*) # ld won't link with a bare -lperl otherwise.
7166 cygwin*) # include version
7167 dflt=`echo libperl$version | sed -e 's/\./_/g'`$lib_ext
7169 *) # Try to guess based on whether libc has major.minor.
7171 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
7172 *libc.$so.[0-9]*) dflt=$majonly ;;
7173 *) dflt=libperl.$so ;;
7183 I need to select a good name for the shared libperl. If your system uses
7184 library names with major and minor numbers, then you might want something
7185 like $majmin. Alternatively, if your system uses a single version
7186 number for shared libraries, then you might want to use $majonly.
7187 Or, your system might be quite happy with a simple libperl.$so.
7189 Since the shared libperl will get installed into a version-specific
7190 architecture-dependent directory, the version number of the shared perl
7191 library probably isn't important, so the default should be o.k.
7194 rp='What name do you want to give to the shared libperl?'
7197 echo "Ok, I'll use $libperl"
7200 libperl="libperl${_a}"
7204 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
7208 WARNING: Use of the shrpdir variable for the installation location of
7209 the shared $libperl is not supported. It was never documented and
7210 will not work in this version. Let me (perlbug@perl.org)
7211 know of any problems this may cause.
7217 But your current setting of $shrpdir is
7218 the default anyway, so it's harmless.
7223 Further, your current attempted setting of $shrpdir
7224 conflicts with the value of $archlibexp/CORE
7225 that installperl will use.
7232 # How will the perl executable find the installed shared $libperl?
7233 # Add $xxx to ccdlflags.
7234 # If we can't figure out a command-line option, use $shrpenv to
7235 # set env LD_RUN_PATH. The main perl makefile uses this.
7236 shrpdir=$archlibexp/CORE
7239 if "$useshrplib"; then
7242 # We'll set it in Makefile.SH...
7248 xxx="-Wl,-R$shrpdir"
7250 linux|irix*|dec_osf)
7251 xxx="-Wl,-rpath,$shrpdir"
7254 # next doesn't like the default...
7257 # beos doesn't like the default, either.
7260 # hpux doesn't like the default, either.
7261 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
7264 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
7270 # Only add $xxx if it isn't already in ccdlflags.
7271 case " $ccdlflags " in
7273 *) ccdlflags="$ccdlflags $xxx"
7276 Adding $xxx to the flags
7277 passed to $ld so that the perl executable will find the
7278 installed shared $libperl.
7286 # Fix ccdlflags in AIX for building external extensions.
7287 # (For building Perl itself bare -bE:perl.exp is needed,
7288 # Makefile.SH takes care of this.)
7290 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
7292 # Respect a hint or command-line value.
7294 '') shrpenv="$tmp_shrpenv" ;;
7296 case "$ldlibpthname" in
7297 '') ldlibpthname=LD_LIBRARY_PATH ;;
7298 none) ldlibpthname='' ;;
7301 : determine where manual pages are on this system
7305 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
7306 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
7307 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
7308 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
7309 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
7310 sysman=`./loc . /usr/man/man1 $syspath`
7313 if $test -d "$sysman"; then
7314 echo "System manual is in $sysman." >&4
7316 echo "Could not find manual pages in source form." >&4
7319 : determine where manual pages go
7320 set man1dir man1dir none
7324 $spackage has manual pages available in source form.
7328 echo "However, you don't have nroff, so they're probably useless to you."
7330 '') man1dir="none";;
7333 echo "If you don't want the manual sources installed, answer 'none'."
7338 lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
7339 lookpath="$lookpath $prefixexp/man/p_man/man1"
7340 lookpath="$lookpath $prefixexp/man/u_man/man1"
7341 lookpath="$lookpath $prefixexp/man/man.1"
7343 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
7344 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
7354 rp="Where do the main $spackage manual pages (source) go?"
7356 if $test "X$man1direxp" != "X$ansexp"; then
7360 man1direxp="$ansexp"
7366 : Change installation prefix, if necessary.
7367 if $test X"$prefix" != X"$installprefix"; then
7368 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
7370 installman1dir="$man1direxp"
7373 : What suffix to use on installed man pages
7380 rp="What suffix should be used for the main $spackage man pages?"
7382 '') case "$man1dir" in
7396 *) dflt="$man1ext";;
7403 : see if we can have long filenames
7405 first=123456789abcdef
7407 if (echo hi >$first) 2>/dev/null; then
7408 if $test -f 123456789abcde; then
7409 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
7412 echo 'You can have filenames longer than 14 characters.'>&4
7417 You can't have filenames longer than 14 chars.
7418 You can't even think about them!
7424 $rm -rf 123456789abcde*
7426 : determine where library module manual pages go
7427 set man3dir man3dir none
7431 $spackage has manual pages for many of the library modules.
7437 However, you don't have nroff, so they're probably useless to you.
7440 '') man3dir="none";;
7444 case "$d_flexfnam" in
7447 However, your system can't handle the long file names like File::Basename.3.
7450 '') man3dir="none";;
7454 echo "If you don't want the manual sources installed, answer 'none'."
7455 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7457 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
7458 if $test -d "$privlib/man/man3"; then
7461 WARNING: Previous versions of perl installed man3 pages into
7462 $privlib/man/man3. This version will suggest a
7463 new default of $dflt.
7467 rp='Do you wish to preserve the old behavior?(y/n)'
7470 y*) dflt="$privlib/man/man3" ;;
7475 *) dflt="$man3dir" ;;
7482 rp="Where do the $package library man pages (source) go?"
7485 man3direxp="$ansexp"
7491 : Change installation prefix, if necessary.
7492 if $test X"$prefix" != X"$installprefix"; then
7493 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
7495 installman3dir="$man3direxp"
7498 : What suffix to use on installed man pages
7504 rp="What suffix should be used for the $package library man pages?"
7506 '') case "$man3dir" in
7520 *) dflt="$man3ext";;
7527 : see if we have to deal with yellow pages, now NIS.
7528 if $test -d /usr/etc/yp || $test -d /etc/yp; then
7529 if $test -f /usr/etc/nibindd; then
7531 echo "I'm fairly confident you're on a NeXT."
7533 rp='Do you get the hosts file via NetInfo?'
7542 y*) hostcat='nidump hosts .';;
7543 *) case "$hostcat" in
7544 nidump*) hostcat='';;
7554 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
7562 rp='Are you getting the hosts file via yellow pages?'
7565 y*) hostcat='ypcat hosts';;
7566 *) hostcat='cat /etc/hosts';;
7572 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
7575 '') test -f /etc/group && groupcat='cat /etc/group';;
7578 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
7581 : now get the host name
7583 echo "Figuring out host name..." >&4
7584 case "$myhostname" in
7586 echo 'Maybe "hostname" will work...'
7587 if tans=`sh -c hostname 2>&1` ; then
7595 if $test "$cont"; then
7597 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
7598 if tans=`cat /etc/systemid 2>&1` ; then
7600 phostname='cat /etc/systemid'
7601 echo "Whadyaknow. Xenix always was a bit strange..."
7604 elif $test -r /etc/systemid; then
7605 echo "(What is a non-Xenix system doing with /etc/systemid?)"
7608 if $test "$cont"; then
7609 echo 'No, maybe "uuname -l" will work...'
7610 if tans=`sh -c 'uuname -l' 2>&1` ; then
7612 phostname='uuname -l'
7614 echo 'Strange. Maybe "uname -n" will work...'
7615 if tans=`sh -c 'uname -n' 2>&1` ; then
7617 phostname='uname -n'
7619 echo 'Oh well, maybe I can mine it out of whoami.h...'
7620 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
7621 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
7622 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
7624 case "$myhostname" in
7625 '') echo "Does this machine have an identity crisis or something?"
7628 echo "Well, you said $myhostname before..."
7629 phostname='echo $myhostname';;
7635 : you do not want to know about this
7640 if $test "$myhostname" ; then
7642 rp='Your host name appears to be "'$myhostname'".'" Right?"
7650 : bad guess or no guess
7651 while $test "X$myhostname" = X ; do
7653 rp="Please type the (one word) name of your host:"
7658 : translate upper to lower if necessary
7659 case "$myhostname" in
7661 echo "(Normalizing case in your host name)"
7662 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
7666 case "$myhostname" in
7668 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
7669 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
7670 echo "(Trimming domain name from host name--host name is now $myhostname)"
7672 *) case "$mydomain" in
7675 test "X$hostcat" = "Xypcat hosts" &&
7676 ypmatch "$myhostname" hosts 2>/dev/null |\
7677 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
7680 test "X$hostcat" != "X" &&
7681 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
7682 /[ ]$myhostname[ . ]/p" > hosts
7685 if $test -f hosts; then
7686 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
7687 END { print sum }" hosts` = x1 || tmp_re="[ ]"
7688 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
7689 hosts | $sort | $uniq | \
7690 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
7691 case `$echo X$dflt` in
7692 X*\ *) echo "(Several hosts in the database matched hostname)"
7695 X.) echo "(You do not have fully-qualified names in the hosts database)"
7699 echo "(I cannot locate a hosts database anywhere)"
7704 tans=`./loc resolv.conf X /etc /usr/etc`
7705 if $test -f "$tans"; then
7706 echo "(Attempting domain name extraction from $tans)"
7707 dflt=.`$sed -n -e 's/ / /g' \
7708 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
7709 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
7711 .) dflt=.`$sed -n -e 's/ / /g' \
7712 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
7713 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
7720 .) echo "(No help from resolv.conf either -- attempting clever guess)"
7721 dflt=.`sh -c domainname 2>/dev/null`
7724 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
7728 case "$dflt$osname" in
7729 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
7730 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
7734 .) echo "(Lost all hope -- silly guess then)"
7740 *) dflt="$mydomain";;
7744 rp="What is your domain name?"
7754 : translate upper to lower if necessary
7757 echo "(Normalizing case in your domain name)"
7758 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
7762 : a little sanity check here
7763 case "$phostname" in
7766 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
7767 $myhostname$mydomain|$myhostname) ;;
7769 case "$phostname" in
7771 echo "(That doesn't agree with your whoami.h file, by the way.)"
7774 echo "(That doesn't agree with your $phostname command, by the way.)"
7784 I need to get your e-mail address in Internet format if possible, i.e.
7785 something like user@host.domain. Please answer accurately since I have
7786 no easy means to double check it. The default value provided below
7787 is most probably close to reality but may not be valid from outside
7788 your organization...
7792 while test "$cont"; do
7794 '') dflt="$cf_by@$myhostname$mydomain";;
7795 *) dflt="$cf_email";;
7797 rp='What is your e-mail address?'
7803 rp='Address does not look like an Internet one. Use it anyway?'
7819 If you or somebody else will be maintaining perl at your site, please
7820 fill in the correct e-mail address here so that they may be contacted
7821 if necessary. Currently, the "perlbug" program included with perl
7822 will send mail to this address in addition to perlbug@perl.org. You may
7823 enter "none" for no administrator.
7826 case "$perladmin" in
7827 '') dflt="$cf_email";;
7828 *) dflt="$perladmin";;
7830 rp='Perl administrator e-mail address'
7834 : determine whether to only install version-specific parts.
7837 Do you want to install only the version-specific parts of the perl
7838 distribution? Usually you do *not* want to do this.
7840 case "$versiononly" in
7841 "$define"|[Yy]*|true) dflt='y' ;;
7844 rp="Do you want to install only the version-specific parts of perl?"
7847 [yY]*) val="$define";;
7853 : figure out how to guarantee perl startup
7854 case "$startperl" in
7856 case "$sharpbang" in
7860 I can use the #! construct to start perl on your system. This will
7861 make startup of perl scripts faster, but may cause problems if you
7862 want to share those scripts and perl is not in a standard place
7863 ($binexp/perl) on all your platforms. The alternative is to force
7864 a shell by starting the script with a single ':' character.
7867 case "$versiononly" in
7868 "$define") dflt="$binexp/perl$version";;
7869 *) dflt="$binexp/perl";;
7871 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
7874 none) startperl=": # use perl";;
7875 *) startperl="#!$ans"
7876 if $test 30 -lt `echo "$ans" | wc -c`; then
7879 WARNING: Some systems limit the #! command to 32 characters.
7880 If you experience difficulty running Perl scripts with #!, try
7881 installing Perl in a directory with a shorter pathname.
7887 *) startperl=": # use perl"
7892 echo "I'll use $startperl to start perl scripts."
7894 : figure best path for perl in scripts
7897 perlpath="$binexp/perl"
7898 case "$startperl" in
7903 I will use the "eval 'exec'" idiom to start Perl on your system.
7904 I can use the full path of your Perl binary for this purpose, but
7905 doing so may cause problems if you want to share those scripts and
7906 Perl is not always in a standard place ($binexp/perl).
7910 rp="What path shall I use in \"eval 'exec'\"?"
7917 case "$startperl" in
7919 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
7922 : determine where public executable scripts go
7923 set scriptdir scriptdir
7925 case "$scriptdir" in
7928 : guess some guesses
7929 $test -d /usr/share/scripts && dflt=/usr/share/scripts
7930 $test -d /usr/share/bin && dflt=/usr/share/bin
7931 $test -d /usr/local/script && dflt=/usr/local/script
7932 $test -d /usr/local/scripts && dflt=/usr/local/scripts
7933 $test -d $prefixexp/script && dflt=$prefixexp/script
7937 *) dflt="$scriptdir"
7942 Some installations have a separate directory just for executable scripts so
7943 that they can mount it across multiple architectures but keep the scripts in
7944 one spot. You might, for example, have a subdirectory of /usr/share for this.
7945 Or you might just lump your scripts in with all your other executables.
7949 rp='Where do you keep publicly executable scripts?'
7951 if $test "X$ansexp" != "X$scriptdirexp"; then
7955 scriptdirexp="$ansexp"
7956 : Change installation prefix, if necessary.
7957 if $test X"$prefix" != X"$installprefix"; then
7958 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
7960 installscript="$scriptdirexp"
7963 : determine where add-on public executables go
7965 '') dflt=$siteprefix/bin ;;
7969 rp='Pathname where the add-on public executables should be installed?'
7972 sitebinexp="$ansexp"
7973 : Change installation prefix, if necessary.
7974 if $test X"$prefix" != X"$installprefix"; then
7975 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
7977 installsitebin="$sitebinexp"
7980 case "$vendorprefix" in
7981 '') d_vendorbin="$undef"
7985 *) d_vendorbin="$define"
7986 : determine where vendor-supplied executables go.
7987 case "$vendorbin" in
7988 '') dflt=$vendorprefix/bin ;;
7989 *) dflt="$vendorbin" ;;
7992 rp='Pathname for the vendor-supplied executables directory?'
7995 vendorbinexp="$ansexp"
7998 : Change installation prefix, if necessary.
7999 if $test X"$prefix" != X"$installprefix"; then
8000 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
8002 installvendorbin="$vendorbinexp"
8005 : see if qgcvt exists
8011 if $test X"$d_longdbl" = X"$define"; then
8013 echo "Checking how to print long doubles..." >&4
8015 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
8016 $cat >try.c <<'EOCP'
8017 #include <sys/types.h>
8021 printf("%.3f\n", d);
8025 if eval $compile; then
8029 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
8030 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
8031 echo "We will use %f."
8037 if $test X"$sPRIfldbl" = X; then
8038 $cat >try.c <<'EOCP'
8039 #include <sys/types.h>
8042 long double d = 123.456;
8043 printf("%.3llf\n", d);
8047 if eval $compile; then
8051 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
8052 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
8053 echo "We will use %llf."
8059 if $test X"$sPRIfldbl" = X; then
8060 $cat >try.c <<'EOCP'
8061 #include <sys/types.h>
8064 long double d = 123.456;
8065 printf("%.3Lf\n", d);
8069 if eval $compile; then
8073 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
8074 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
8075 echo "We will use %Lf."
8081 if $test X"$sPRIfldbl" = X; then
8082 $cat >try.c <<'EOCP'
8083 #include <sys/types.h>
8086 long double d = 123.456;
8087 printf("%.3lf\n", d);
8091 if eval $compile; then
8095 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
8096 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
8097 echo "We will use %lf."
8103 if $test X"$sPRIfldbl" = X; then
8104 echo "Cannot figure out how to print long doubles." >&4
8106 sSCNfldbl=$sPRIfldbl # expect consistency
8113 case "$sPRIfldbl" in
8114 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
8115 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
8116 d_SCNfldbl="$undef";
8118 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
8119 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
8120 d_SCNfldbl="$define";
8124 : Check how to convert floats to strings.
8126 echo "Checking for an efficient way to convert floats to strings."
8128 case "$uselongdouble" in
8129 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
8131 case "$d_longdbl" in
8132 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
8134 case "$d_PRIgldbl" in
8135 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
8139 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
8140 char *myname = "gconvert";
8143 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
8144 char *myname = "gcvt";
8147 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
8148 char *myname = "qgcvt";
8149 #define DOUBLETYPE long double
8152 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE) && defined(HAS_PRIgldbl)
8153 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
8155 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
8157 char *myname = "sprintf";
8161 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
8162 #define DOUBLETYPE long double
8164 #define DOUBLETYPE double
8170 #define I_STDLIB $i_stdlib
8176 checkit(expect, got)
8180 if (strcmp(expect, got)) {
8181 printf("%s oddity: Expected %s, got %s\n",
8182 myname, expect, got);
8192 /* This must be 1st test on (which?) platform */
8193 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
8194 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
8195 checkit("0.1", buf);
8197 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
8200 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
8201 checkit("1.1", buf);
8203 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
8204 checkit("1.01", buf);
8206 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
8207 checkit("1.001", buf);
8209 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
8210 checkit("1.0001", buf);
8212 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
8213 checkit("1.00001", buf);
8215 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
8216 checkit("1.000001", buf);
8218 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
8221 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
8224 /* Some Linux gcvt's give 1.e+5 here. */
8225 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
8226 checkit("100000", buf);
8228 /* Some Linux gcvt's give -1.e+5 here. */
8229 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
8230 checkit("-100000", buf);
8232 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
8233 checkit("123.456", buf);
8238 case "$d_Gconvert" in
8239 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
8240 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
8241 sprintf*) xxx_list='sprintf gconvert gcvt' ;;
8242 *) xxx_list='gconvert gcvt sprintf' ;;
8245 case "$d_longdbl$uselongdouble$d_PRIgldbl" in
8246 "$define$define$define")
8247 # for long doubles prefer first qgcvt, then sprintf
8248 xxx_list="`echo $xxx_list|sed s/sprintf//`"
8249 xxx_list="sprintf $xxx_list"
8251 "$define") xxx_list="qgcvt $xxx_list" ;;
8256 for xxx_convert in $xxx_list; do
8257 echo "Trying $xxx_convert..."
8259 set try -DTRY_$xxx_convert
8260 if eval $compile; then
8261 echo "$xxx_convert() found." >&4
8263 echo "I'll use $xxx_convert to convert floats into a string." >&4
8266 echo "...But $xxx_convert didn't work as I expected."
8269 echo "$xxx_convert NOT found." >&4
8273 case "$xxx_convert" in
8274 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
8275 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
8276 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
8277 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
8278 "$define$define$define")
8279 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
8280 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
8285 : see if _fwalk exists
8289 : Initialize h_fcntl
8292 : Initialize h_sysfile
8295 : access call always available on UNIX
8299 : locate the flags for 'access()'
8303 $cat >access.c <<'EOCP'
8304 #include <sys/types.h>
8309 #include <sys/file.h>
8318 : check sys/file.h first, no particular reason here
8319 if $test `./findhdr sys/file.h` && \
8320 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
8322 echo "<sys/file.h> defines the *_OK access constants." >&4
8323 elif $test `./findhdr fcntl.h` && \
8324 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
8326 echo "<fcntl.h> defines the *_OK access constants." >&4
8327 elif $test `./findhdr unistd.h` && \
8328 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
8329 echo "<unistd.h> defines the *_OK access constants." >&4
8331 echo "I can't find the four *_OK access constants--I'll use mine." >&4
8337 : see if accessx exists
8338 set accessx d_accessx
8341 : see if alarm exists
8345 : see if atolf exists
8349 : see if atoll exists
8353 : Look for GNU-cc style attribute checking
8355 echo "Checking whether your compiler can handle __attribute__ ..." >&4
8356 $cat >attrib.c <<'EOCP'
8358 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
8360 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
8361 if $contains 'warning' attrib.out >/dev/null 2>&1; then
8362 echo "Your C compiler doesn't fully support __attribute__."
8365 echo "Your C compiler supports __attribute__."
8369 echo "Your C compiler doesn't seem to understand __attribute__ at all."
8376 : see if bcmp exists
8380 : see if bcopy exists
8384 : see if this is a unistd.h system
8385 set unistd.h i_unistd
8388 : see if getpgrp exists
8389 set getpgrp d_getpgrp
8392 case "$d_getpgrp" in
8395 echo "Checking to see which flavor of getpgrp is in use..."
8398 #include <sys/types.h>
8400 # include <unistd.h>
8404 if (getuid() == 0) {
8405 printf("(I see you are running Configure as super-user...)\n");
8409 if (getpgrp(1) == 0)
8418 if $cc -o set -DTRY_BSD_PGRP $ccflags $ldflags set.c $libs >/dev/null 2>&1 && ./set; then
8419 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
8421 elif $cc -o set $ccflags $ldflags set.c $libs >/dev/null 2>&1 && ./set; then
8422 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
8425 echo "I can't seem to compile and run the test program."
8427 xxx="a USG one, i.e. you use getpgrp()."
8429 # SVR4 systems can appear rather BSD-ish.
8432 xxx="a BSD one, i.e. you use getpgrp(pid)."
8436 xxx="probably a USG one, i.e. you use getpgrp()."
8441 echo "Assuming your getpgrp is $xxx" >&4
8450 : see if setpgrp exists
8451 set setpgrp d_setpgrp
8454 case "$d_setpgrp" in
8457 echo "Checking to see which flavor of setpgrp is in use..."
8460 #include <sys/types.h>
8462 # include <unistd.h>
8466 if (getuid() == 0) {
8467 printf("(I see you are running Configure as super-user...)\n");
8471 if (-1 == setpgrp(1, 1))
8474 if (setpgrp() != -1)
8480 if $cc -o set -DTRY_BSD_PGRP $ccflags $ldflags set.c $libs >/dev/null 2>&1 && ./set; then
8481 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
8483 elif $cc -o set $ccflags $ldflags set.c $libs >/dev/null 2>&1 && ./set; then
8484 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
8487 echo "(I can't seem to compile and run the test program.)"
8489 xxx="a USG one, i.e. you use setpgrp()."
8491 # SVR4 systems can appear rather BSD-ish.
8494 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
8498 xxx="probably a USG one, i.e. you use setpgrp()."
8503 echo "Assuming your setpgrp is $xxx" >&4
8511 : see if bzero exists
8515 : see if signal is declared as pointer to function returning int or void
8517 xxx=`./findhdr signal.h`
8518 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
8519 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
8520 echo "You have int (*signal())() instead of void." >&4
8522 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
8523 echo "You have void (*signal())()." >&4
8525 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
8526 echo "You have int (*signal())() instead of void." >&4
8528 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
8529 echo "You have void (*signal())()." >&4
8532 case "$d_voidsig" in
8534 echo "I can't determine whether signal handler returns void or int..." >&4
8536 rp="What type does your signal handler return?"
8543 echo "As you already told me, signal handler returns void." >&4
8546 *) echo "As you already told me, signal handler returns int." >&4
8553 case "$d_voidsig" in
8554 "$define") signal_t="void";;
8559 : check for ability to cast large floats to 32-bit ints.
8561 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
8562 if $test "$intsize" -ge 4; then
8569 #include <sys/types.h>
8571 $signal_t blech(s) int s; { exit(3); }
8578 signal(SIGFPE, blech);
8580 /* Don't let compiler optimize the test away. Store the number
8581 in a writable string for gcc to pass to sscanf under HP/UX.
8583 sprintf(str, "2147483647");
8584 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
8588 /* x86 processors will probably give 0x8000 0000, which is a
8589 sign change. We don't want that. We want to mimic SPARC
8590 behavior here, which is to preserve the sign and give
8593 if (i32 != ($xxx) f)
8599 if eval $compile_ok; then
8603 echo "(I can't seem to compile the test program--assuming it can't)"
8611 echo "Nope, it can't."
8618 : check for ability to cast negative floats to unsigned
8620 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
8623 #include <sys/types.h>
8625 $signal_t blech(s) int s; { exit(7); }
8626 $signal_t blech_in_list(s) int s; { exit(4); }
8627 unsigned long dummy_long(p) unsigned long p; { return p; }
8628 unsigned int dummy_int(p) unsigned int p; { return p; }
8629 unsigned short dummy_short(p) unsigned short p; { return p; }
8633 unsigned long along;
8635 unsigned short ashort;
8639 /* Frustrate gcc-2.7.2's optimizer which failed this test with
8640 a direct f = -123. assignment. gcc-2.8.0 reportedly
8641 optimized the whole file away
8643 /* Store the number in a writable string for gcc to pass to
8646 sprintf(str, "-123");
8647 sscanf(str, "%lf", &f); /* f = -123.; */
8649 signal(SIGFPE, blech);
8650 along = (unsigned long)f;
8651 aint = (unsigned int)f;
8652 ashort = (unsigned short)f;
8653 if (along != (unsigned long)-123)
8655 if (aint != (unsigned int)-123)
8657 if (ashort != (unsigned short)-123)
8659 sprintf(str, "1073741824.");
8660 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
8663 along = (unsigned long)f;
8664 if (along != 0x80000000)
8668 along = (unsigned long)f;
8669 if (along != 0x7fffffff)
8673 along = (unsigned long)f;
8674 if (along != 0x80000001)
8678 signal(SIGFPE, blech_in_list);
8679 sprintf(str, "123.");
8680 sscanf(str, "%lf", &f); /* f = 123.; */
8681 along = dummy_long((unsigned long)f);
8682 aint = dummy_int((unsigned int)f);
8683 ashort = dummy_short((unsigned short)f);
8684 if (along != (unsigned long)123)
8686 if (aint != (unsigned int)123)
8688 if (ashort != (unsigned short)123)
8695 if eval $compile_ok; then
8699 echo "(I can't seem to compile the test program--assuming it can't)"
8702 case "$castflags" in
8707 echo "Nope, it can't."
8714 : see if vprintf exists
8716 if set vprintf val -f d_vprintf; eval $csym; $val; then
8717 echo 'vprintf() found.' >&4
8719 $cat >vprintf.c <<'EOF'
8720 #include <varargs.h>
8722 int main() { xxx("foo"); }
8731 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
8735 if eval $compile && ./vprintf; then
8736 echo "Your vsprintf() returns (int)." >&4
8739 echo "Your vsprintf() returns (char*)." >&4
8743 echo 'vprintf() NOT found.' >&4
8753 : see if chown exists
8757 : see if chroot exists
8761 : see if chsize exists
8765 hasstruct='varname=$1; struct=$2; shift; shift;
8766 while $test $# -ge 2; do
8768 $define) echo "#include <$2>";;
8772 echo "int main () { struct $struct foo; }" >> try.c;
8774 if eval $compile; then
8783 : see if sys/types.h has to be included
8784 set sys/types.h i_systypes
8787 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
8788 while $test $# -ge 2; do
8790 $define) echo "#include <$2>";;
8794 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
8796 if eval $compile; then
8807 : see whether socket exists
8809 $echo $n "Hmm... $c" >&4
8810 if set socket val -f d_socket; eval $csym; $val; then
8811 echo "Looks like you have Berkeley networking support." >&4
8813 if set setsockopt val -f; eval $csym; $val; then
8816 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
8820 if $contains socklib libc.list >/dev/null 2>&1; then
8821 echo "Looks like you have Berkeley networking support." >&4
8823 : we will have to assume that it supports the 4.2 BSD interface
8826 echo "You don't have Berkeley networking in libc$_a..." >&4
8827 if test "X$d_socket" = "X$define"; then
8828 echo "...but you seem to believe that you have sockets." >&4
8830 for net in net socket
8832 if test -f /usr/lib/lib$net$_a; then
8833 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
8834 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
8835 if $contains socket libc.list >/dev/null 2>&1; then
8840 echo "...but the Wollongong group seems to have hacked it in." >&4
8841 sockethdr="-I/usr/netinclude"
8844 echo "Found Berkeley sockets interface in lib$net." >& 4
8845 if $contains setsockopt libc.list >/dev/null 2>&1; then
8848 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
8855 if test "X$d_socket" != "X$define"; then
8856 echo "or anywhere else I see." >&4
8864 : see if socketpair exists
8865 set socketpair d_sockpair
8870 echo "Checking the availability of certain socket constants..." >& 4
8871 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
8872 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
8874 #include <sys/types.h>
8875 #include <sys/socket.h>
8881 set try; if eval $compile; then
8884 set d_${enum}; eval $setvar
8888 : see if this is a sys/uio.h system
8889 set sys/uio.h i_sysuio
8894 echo "Checking to see if your system supports struct cmsghdr..." >&4
8895 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
8897 case "$d_cmsghdr_s" in
8898 "$define") echo "Yes, it does." ;;
8899 *) echo "No, it doesn't." ;;
8903 : check for const keyword
8905 echo 'Checking to see if your C compiler knows about "const"...' >&4
8906 $cat >const.c <<'EOCP'
8907 typedef struct spug { int drokk; } spug;
8914 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
8916 echo "Yup, it does."
8919 echo "Nope, it doesn't."
8924 : see if crypt exists
8926 if set crypt val -f d_crypt; eval $csym; $val; then
8927 echo 'crypt() found.' >&4
8931 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
8932 if $test -z "$cryptlib"; then
8933 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
8937 if $test -z "$cryptlib"; then
8938 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
8942 if $test -z "$cryptlib"; then
8943 cryptlib=`./loc libcrypt$_a "" $libpth`
8947 if $test -z "$cryptlib"; then
8948 echo 'crypt() NOT found.' >&4
8957 : get csh whereabouts
8959 'csh') val="$undef" ;;
8964 : Respect a hint or command line value for full_csh.
8966 '') full_csh=$csh ;;
8969 : see if cuserid exists
8970 set cuserid d_cuserid
8973 : see if this is a limits.h system
8974 set limits.h i_limits
8977 : see if this is a float.h system
8981 : See if number of significant digits in a double precision number is known
8983 $cat >dbl_dig.c <<EOM
8993 printf("Contains DBL_DIG");
8996 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
8997 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
8998 echo "DBL_DIG found." >&4
9001 echo "DBL_DIG NOT found." >&4
9008 : see if difftime exists
9009 set difftime d_difftime
9012 : see if this is a dirent system
9014 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
9016 echo "<dirent.h> found." >&4
9019 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
9020 echo "<sys/dir.h> found." >&4
9023 xinc=`./findhdr sys/ndir.h`
9025 echo "<dirent.h> NOT found." >&4
9030 : Look for type of directory structure.
9032 $cppstdin $cppflags $cppminus < "$xinc" > try.c
9034 case "$direntrytype" in
9037 $define) guess1='struct dirent' ;;
9038 *) guess1='struct direct' ;;
9041 *) guess1="$direntrytype"
9046 'struct dirent') guess2='struct direct' ;;
9047 *) guess2='struct dirent' ;;
9050 if $contains "$guess1" try.c >/dev/null 2>&1; then
9051 direntrytype="$guess1"
9052 echo "Your directory entries are $direntrytype." >&4
9053 elif $contains "$guess2" try.c >/dev/null 2>&1; then
9054 direntrytype="$guess2"
9055 echo "Your directory entries seem to be $direntrytype." >&4
9057 echo "I don't recognize your system's directory entries." >&4
9058 rp="What type is used for directory entries on this system?"
9066 : see if the directory entry stores field length
9068 $cppstdin $cppflags $cppminus < "$xinc" > try.c
9069 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
9070 echo "Good, your directory entry keeps length information in d_namlen." >&4
9073 echo "Your directory entry does not know about the d_namlen field." >&4
9080 : see if dlerror exists
9083 set dlerror d_dlerror
9087 : see if dlfcn is available
9095 On a few systems, the dynamically loaded modules that perl generates and uses
9096 will need a different extension than shared libs. The default will probably
9104 rp='What is the extension of dynamically loaded modules'
9113 : Check if dlsym need a leading underscore
9119 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
9120 $cat >dyna.c <<'EOM'
9129 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
9131 #include <sys/types.h>
9145 int mode = RTLD_LAZY ;
9147 handle = dlopen("./dyna.$dlext", mode) ;
9148 if (handle == NULL) {
9153 symbol = dlsym(handle, "fred") ;
9154 if (symbol == NULL) {
9155 /* try putting a leading underscore */
9156 symbol = dlsym(handle, "_fred") ;
9157 if (symbol == NULL) {
9170 : Call the object file tmp-dyna.o in case dlext=o.
9171 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
9172 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
9173 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
9174 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then
9177 1) echo "Test program failed using dlopen." >&4
9178 echo "Perhaps you should not use dynamic loading." >&4;;
9179 2) echo "Test program failed using dlsym." >&4
9180 echo "Perhaps you should not use dynamic loading." >&4;;
9181 3) echo "dlsym needs a leading underscore" >&4
9183 4) echo "dlsym doesn't need a leading underscore." >&4;;
9186 echo "I can't compile and run the test program." >&4
9187 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
9192 $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
9197 hasproto='varname=$1; func=$2; shift; shift;
9198 while $test $# -ge 2; do
9200 $define) echo "#include <$2>";;
9204 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
9205 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
9206 echo "$func() prototype found.";
9209 echo "$func() prototype NOT found.";
9214 $rm -f try.c tryout.c'
9216 : see if prototype for drand48 is available
9218 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
9221 : see if dup2 exists
9225 : see if eaccess exists
9226 set eaccess d_eaccess
9229 : see if endgrent exists
9230 set endgrent d_endgrent
9233 : see if endhostent exists
9234 set endhostent d_endhent
9237 : see if endnetent exists
9238 set endnetent d_endnent
9241 : see if endprotoent exists
9242 set endprotoent d_endpent
9245 : see if endpwent exists
9246 set endpwent d_endpwent
9249 : see if endservent exists
9250 set endservent d_endsent
9253 : Locate the flags for 'open()'
9255 $cat >open3.c <<'EOCP'
9256 #include <sys/types.h>
9261 #include <sys/file.h>
9272 : check sys/file.h first to get FREAD on Sun
9273 if $test `./findhdr sys/file.h` && \
9274 set open3 -DI_SYS_FILE && eval $compile; then
9276 echo "<sys/file.h> defines the O_* constants..." >&4
9278 echo "and you have the 3 argument form of open()." >&4
9281 echo "but not the 3 argument form of open(). Oh, well." >&4
9284 elif $test `./findhdr fcntl.h` && \
9285 set open3 -DI_FCNTL && eval $compile; then
9287 echo "<fcntl.h> defines the O_* constants..." >&4
9289 echo "and you have the 3 argument form of open()." >&4
9292 echo "but not the 3 argument form of open(). Oh, well." >&4
9297 echo "I can't find the O_* constant definitions! You got problems." >&4
9303 : see which of string.h or strings.h is needed
9305 strings=`./findhdr string.h`
9306 if $test "$strings" && $test -r "$strings"; then
9307 echo "Using <string.h> instead of <strings.h>." >&4
9311 strings=`./findhdr strings.h`
9312 if $test "$strings" && $test -r "$strings"; then
9313 echo "Using <strings.h> instead of <string.h>." >&4
9315 echo "No string header found -- You'll surely have problems." >&4
9321 "$undef") strings=`./findhdr strings.h`;;
9322 *) strings=`./findhdr string.h`;;
9325 : check for non-blocking I/O stuff
9326 case "$h_sysfile" in
9327 true) echo "#include <sys/file.h>" > head.c;;
9330 true) echo "#include <fcntl.h>" > head.c;;
9331 *) echo "#include <sys/fcntl.h>" > head.c;;
9336 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
9337 case "$o_nonblock" in
9340 $cat >>try.c <<'EOCP'
9344 printf("O_NONBLOCK\n");
9348 printf("O_NDELAY\n");
9352 printf("FNDELAY\n");
9359 if eval $compile_ok; then
9361 case "$o_nonblock" in
9362 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
9363 *) echo "Seems like we can use $o_nonblock.";;
9366 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
9369 *) echo "Using $hint value $o_nonblock.";;
9371 $rm -f try try.* .out core
9374 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
9380 #include <sys/types.h>
9383 #define MY_O_NONBLOCK $o_nonblock
9384 #ifndef errno /* XXX need better Configure test */
9395 #include <strings.h>
9397 $signal_t blech(x) int x; { exit(3); }
9399 $cat >> try.c <<'EOCP'
9407 pipe(pd); /* Down: child -> parent */
9408 pipe(pu); /* Up: parent -> child */
9411 close(pd[1]); /* Parent reads from pd[0] */
9412 close(pu[0]); /* Parent writes (blocking) to pu[1] */
9414 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
9419 signal(SIGALRM, blech);
9421 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
9423 sprintf(string, "%d\n", ret);
9424 write(2, string, strlen(string));
9427 if (errno == EAGAIN) {
9433 if (errno == EWOULDBLOCK)
9434 printf("EWOULDBLOCK\n");
9437 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
9438 sleep(2); /* Give it time to close our pipe */
9440 ret = read(pd[0], buf, 1); /* Should read EOF */
9442 sprintf(string, "%d\n", ret);
9443 write(3, string, strlen(string));
9447 close(pd[0]); /* We write to pd[1] */
9448 close(pu[1]); /* We read from pu[0] */
9449 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
9450 close(pd[1]); /* Pipe pd is now fully closed! */
9451 exit(0); /* Bye bye, thank you for playing! */
9455 if eval $compile_ok; then
9456 echo "$startsh" >mtry
9457 echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
9459 ./mtry >/dev/null 2>&1
9461 0) eagain=`$cat try.out`;;
9462 1) echo "Could not perform non-blocking setting!";;
9463 2) echo "I did a successful read() for something that was not there!";;
9464 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
9465 4) echo "Could not find F_SETFL!";;
9466 *) echo "Something terribly wrong happened during testing.";;
9468 rd_nodata=`$cat try.ret`
9469 echo "A read() system call with no data present returns $rd_nodata."
9470 case "$rd_nodata" in
9473 echo "(That's peculiar, fixing that to be -1.)"
9479 echo "Forcing errno EAGAIN on read() with no data available."
9483 echo "Your read() sets errno to $eagain when no data is available."
9486 status=`$cat try.err`
9488 0) echo "And it correctly returns 0 to signal EOF.";;
9489 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
9490 *) echo "However, your read() returns '$status' on EOF??";;
9493 if test "$status" = "$rd_nodata"; then
9494 echo "WARNING: you can't distinguish between EOF and no data!"
9498 echo "I can't compile the test program--assuming errno EAGAIN will do."
9505 echo "Using $hint value $eagain."
9506 echo "Your read() returns $rd_nodata when no data is present."
9507 case "$d_eofnblk" in
9508 "$define") echo "And you can see EOF because read() returns 0.";;
9509 "$undef") echo "But you can't see EOF status from read() returned value.";;
9511 echo "(Assuming you can't see EOF status from read anyway.)"
9517 $rm -f try try.* .out core head.c mtry
9519 : see if fchmod exists
9523 : see if fchown exists
9527 : see if this is an fcntl system
9532 : See if fcntl-based locking works.
9533 $cat >try.c <<'EOCP'
9538 #if defined(F_SETLK) && defined(F_SETLKW)
9541 fd = open("try.c", O_RDONLY);
9542 flock.l_type = F_RDLCK;
9543 flock.l_whence = SEEK_SET;
9544 flock.l_start = flock.l_len = 0;
9545 retval = fcntl(fd, F_SETLK, &flock);
9547 (retval < 0 ? exit(2) : exit(0));
9553 echo "Checking if fcntl-based file locking works... "
9557 if eval $compile_ok; then
9559 echo "Yes, it seems to work."
9562 echo "Nope, it didn't work."
9566 echo "I'm unable to compile the test program, so I'll assume not."
9571 echo "Nope, since you don't even have fcntl()."
9574 set d_fcntl_can_lock
9579 : see if sys/select.h has to be included
9580 set sys/select.h i_sysselct
9583 : see if we should include time.h, sys/time.h, or both
9585 if test "X$timeincl" = X; then
9586 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9587 $echo $n "I'm now running the test program...$c"
9588 $cat >try.c <<'EOCP'
9589 #include <sys/types.h>
9594 #ifdef SYSTIMEKERNEL
9597 #include <sys/time.h>
9600 #include <sys/select.h>
9609 struct timezone tzp;
9611 if (foo.tm_sec == foo.tm_sec)
9614 if (bar.tv_sec == bar.tv_sec)
9621 for s_timezone in '-DS_TIMEZONE' ''; do
9623 for s_timeval in '-DS_TIMEVAL' ''; do
9624 for i_systimek in '' '-DSYSTIMEKERNEL'; do
9625 for i_time in '' '-DI_TIME'; do
9626 for i_systime in '-DI_SYSTIME' ''; do
9629 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
9630 if eval $compile; then
9631 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
9635 $echo $n "Succeeded with $flags$c"
9647 *SYSTIMEKERNEL*) i_systimek="$define"
9648 timeincl=`./findhdr sys/time.h`
9649 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
9650 *) i_systimek="$undef";;
9653 *I_TIME*) i_time="$define"
9654 timeincl=`./findhdr time.h`" $timeincl"
9655 echo "We'll include <time.h>." >&4;;
9656 *) i_time="$undef";;
9659 *I_SYSTIME*) i_systime="$define"
9660 timeincl=`./findhdr sys/time.h`" $timeincl"
9661 echo "We'll include <sys/time.h>." >&4;;
9662 *) i_systime="$undef";;
9667 : check for fd_set items
9670 Checking to see how well your C compiler handles fd_set and friends ...
9672 $cat >fd_set.c <<EOCP
9673 #$i_systime I_SYS_TIME
9674 #$i_sysselct I_SYS_SELECT
9675 #$d_socket HAS_SOCKET
9676 #include <sys/types.h>
9678 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
9681 #include <sys/time.h>
9684 #include <sys/select.h>
9693 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
9700 set fd_set -DTRYBITS
9701 if eval $compile; then
9702 d_fds_bits="$define"
9704 echo "Well, your system knows about the normal fd_set typedef..." >&4
9706 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
9707 d_fd_macros="$define"
9710 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
9712 d_fd_macros="$undef"
9716 Hmm, your compiler has some difficulty with fd_set. Checking further...
9719 if eval $compile; then
9722 echo "Well, your system has some sort of fd_set available..." >&4
9724 echo "and you have the normal fd_set macros." >&4
9725 d_fd_macros="$define"
9728 but not the normal fd_set macros! Gross! More work for me...
9730 d_fd_macros="$undef"
9733 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
9736 d_fd_macros="$undef"
9741 : see if fgetpos exists
9742 set fgetpos d_fgetpos
9745 : see if flock exists
9749 : see if fork exists
9753 : see if pathconf exists
9754 set pathconf d_pathconf
9757 : see if fpathconf exists
9758 set fpathconf d_fpathconf
9762 : check for fpos64_t
9764 echo "Checking to see if you have fpos64_t..." >&4
9767 int main() { fpos64_t x = 7; }
9770 if eval $compile; then
9772 echo "You have fpos64_t."
9775 echo "You do not have fpos64_t."
9777 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
9784 : see if frexpl exists
9788 : see if this is a sys/param system
9789 set sys/param.h i_sysparam
9792 : see if this is a sys/mount.h system
9793 set sys/mount.h i_sysmount
9798 echo "Checking to see if your system supports struct fs_data..." >&4
9799 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
9801 case "$d_fs_data_s" in
9802 "$define") echo "Yes, it does." ;;
9803 *) echo "No, it doesn't." ;;
9806 : see if fseeko exists
9810 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
9813 : see if fsetpos exists
9814 set fsetpos d_fsetpos
9818 : see if fstatfs exists
9819 set fstatfs d_fstatfs
9823 : see if statvfs exists
9824 set statvfs d_statvfs
9827 : see if fstatvfs exists
9828 set fstatvfs d_fstatvfs
9832 : see if fsync exists
9836 : see if ftello exists
9840 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
9843 : see if getcwd exists
9847 : see if getespwnam exists
9848 set getespwnam d_getespwnam
9852 : see if getfsstat exists
9853 set getfsstat d_getfsstat
9856 : see if getgrent exists
9857 set getgrent d_getgrent
9860 : see if gethostbyaddr exists
9861 set gethostbyaddr d_gethbyaddr
9864 : see if gethostbyname exists
9865 set gethostbyname d_gethbyname
9868 : see if gethostent exists
9869 set gethostent d_gethent
9872 : see how we will look up host name
9875 if set gethostname val -f d_gethname; eval $csym; $val; then
9876 echo 'gethostname() found.' >&4
9877 d_gethname="$define"
9880 if set uname val -f d_uname; eval $csym; $val; then
9883 uname() was found, but you're running xenix, and older versions of xenix
9884 have a broken uname(). If you don't really know whether your xenix is old
9885 enough to have a broken system call, use the default answer.
9892 rp='Is your uname() broken?'
9895 n*) d_uname="$define"; call=uname;;
9898 echo 'uname() found.' >&4
9905 case "$d_gethname" in
9906 '') d_gethname="$undef";;
9909 '') d_uname="$undef";;
9911 case "$d_uname$d_gethname" in
9916 Every now and then someone has a $call() that lies about the hostname
9917 but can't be fixed for political or economic reasons. If you wish, I can
9918 pretend $call() isn't there and maybe compute hostname at run-time
9919 thanks to the '$phostname' command.
9922 rp="Shall I ignore $call() from now on?"
9925 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
9928 case "$phostname" in
9930 *) case "$aphostname" in
9936 file=`./loc $file $file $pth`
9937 aphostname=`echo $file $*`
9942 case "$d_uname$d_gethname" in
9945 case "$phostname" in
9947 echo "There will be no way for $package to get your hostname." >&4;;
9949 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
9953 case "$d_phostname" in
9954 '') d_phostname="$undef";;
9957 : see if this is a netdb.h system
9961 : see if prototypes for various gethostxxx netdb.h functions are available
9963 set d_gethostprotos gethostent $i_netdb netdb.h
9966 : see if getitimer exists
9967 set getitimer d_getitimer
9970 : see if getlogin exists
9971 set getlogin d_getlogin
9974 : see if getmnt exists
9978 : see if getmntent exists
9979 set getmntent d_getmntent
9982 : see if getnetbyaddr exists
9983 set getnetbyaddr d_getnbyaddr
9986 : see if getnetbyname exists
9987 set getnetbyname d_getnbyname
9990 : see if getnetent exists
9991 set getnetent d_getnent
9994 : see if prototypes for various getnetxxx netdb.h functions are available
9996 set d_getnetprotos getnetent $i_netdb netdb.h
9999 : see if getpagesize exists
10000 set getpagesize d_getpagsz
10004 : see if getprotobyname exists
10005 set getprotobyname d_getpbyname
10008 : see if getprotobynumber exists
10009 set getprotobynumber d_getpbynumber
10012 : see if getprotoent exists
10013 set getprotoent d_getpent
10016 : see if getpgid exists
10017 set getpgid d_getpgid
10020 : see if getpgrp2 exists
10021 set getpgrp2 d_getpgrp2
10024 : see if getppid exists
10025 set getppid d_getppid
10028 : see if getpriority exists
10029 set getpriority d_getprior
10032 : see if prototypes for various getprotoxxx netdb.h functions are available
10034 set d_getprotoprotos getprotoent $i_netdb netdb.h
10037 : see if getprpwnam exists
10038 set getprpwnam d_getprpwnam
10041 : see if getpwent exists
10042 set getpwent d_getpwent
10046 : see if getservbyname exists
10047 set getservbyname d_getsbyname
10050 : see if getservbyport exists
10051 set getservbyport d_getsbyport
10054 : see if getservent exists
10055 set getservent d_getsent
10058 : see if prototypes for various getservxxx netdb.h functions are available
10060 set d_getservprotos getservent $i_netdb netdb.h
10063 : see if getspnam exists
10064 set getspnam d_getspnam
10067 : see if gettimeofday or ftime exists
10068 set gettimeofday d_gettimeod
10070 case "$d_gettimeod" in
10076 val="$undef"; set d_ftime; eval $setvar
10079 case "$d_gettimeod$d_ftime" in
10082 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
10086 : see if this is an grp system
10092 xxx=`./findhdr grp.h`
10093 $cppstdin $cppflags $cppminus < $xxx >$$.h
10095 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
10107 set d_grpasswd; eval $setvar
10111 : see if hasmntopt exists
10112 set hasmntopt d_hasmntopt
10115 : see if this is a netinet/in.h or sys/in.h system
10116 set netinet/in.h i_niin sys/in.h i_sysin
10119 : see if arpa/inet.h has to be included
10120 set arpa/inet.h i_arpainet
10123 : see if htonl --and friends-- exists
10128 : Maybe they are macros.
10131 $cat >htonl.c <<EOM
10133 #include <sys/types.h>
10134 #$i_niin I_NETINET_IN
10136 #$i_arpainet I_ARPA_INET
10137 #ifdef I_NETINET_IN
10138 #include <netinet/in.h>
10141 #include <sys/in.h>
10144 #include <arpa/inet.h>
10147 printf("Defined as a macro.");
10150 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
10151 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
10153 echo "But it seems to be defined as a macro." >&4
10161 : see if iconv exists
10167 if set index val -f; eval $csym; $val; then
10168 if set strchr val -f d_strchr; eval $csym; $val; then
10169 if $contains strchr "$strings" >/dev/null 2>&1 ; then
10172 echo "strchr() found." >&4
10176 echo "index() found." >&4
10181 echo "index() found." >&4
10184 if set strchr val -f d_strchr; eval $csym; $val; then
10187 echo "strchr() found." >&4
10189 echo "No index() or strchr() found!" >&4
10194 set d_strchr; eval $setvar
10196 set d_index; eval $setvar
10198 : check whether inet_aton exists
10199 set inet_aton d_inetaton
10204 $cat >isascii.c <<'EOCP'
10216 if eval $compile; then
10217 echo "isascii() found." >&4
10220 echo "isascii() NOT found." >&4
10227 : see if isnan exists
10231 : see if isnanl exists
10232 set isnanl d_isnanl
10235 : see if killpg exists
10236 set killpg d_killpg
10239 : see if lchown exists
10241 $cat > try.c <<'EOCP'
10242 /* System header to define __stub macros and hopefully few prototypes,
10243 which can conflict with char lchown(); below. */
10244 #include <assert.h>
10245 /* Override any gcc2 internal prototype to avoid an error. */
10246 /* We use char because int might match the return type of a gcc2
10247 builtin and then its argument prototype would still apply. */
10250 /* The GNU C library defines this for functions which it implements
10251 to always fail with ENOSYS. Some functions are actually named
10252 something starting with __ and the normal name is an alias. */
10253 #if defined (__stub_lchown) || defined (__stub___lchown)
10261 if eval $compile; then
10262 $echo "lchown() found." >&4
10265 $echo "lchown() NOT found." >&4
10271 : See if number of significant digits in a double precision number is known
10273 $cat >ldbl_dig.c <<EOM
10274 #$i_limits I_LIMITS
10277 #include <limits.h>
10283 printf("Contains LDBL_DIG");
10286 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
10287 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
10288 echo "LDBL_DIG found." >&4
10291 echo "LDBL_DIG NOT found." >&4
10298 : see if link exists
10302 : see if localeconv exists
10303 set localeconv d_locconv
10306 : see if lockf exists
10310 : see if prototype for lseek is available
10312 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
10315 : see if lstat exists
10319 : see if madvise exists
10320 set madvise d_madvise
10323 : see if mblen exists
10327 : see if mbstowcs exists
10328 set mbstowcs d_mbstowcs
10331 : see if mbtowc exists
10332 set mbtowc d_mbtowc
10335 : see if memchr exists
10336 set memchr d_memchr
10339 : see if memcmp exists
10340 set memcmp d_memcmp
10343 : see if memcpy exists
10344 set memcpy d_memcpy
10347 : see if memmove exists
10348 set memmove d_memmove
10351 : see if memset exists
10352 set memset d_memset
10355 : see if mkdir exists
10359 : see if mkdtemp exists
10360 set mkdtemp d_mkdtemp
10363 : see if mkfifo exists
10364 set mkfifo d_mkfifo
10367 : see if mkstemp exists
10368 set mkstemp d_mkstemp
10371 : see if mkstemps exists
10372 set mkstemps d_mkstemps
10375 : see if mktime exists
10376 set mktime d_mktime
10379 : see if this is a sys/mman.h system
10380 set sys/mman.h i_sysmman
10383 : see if mmap exists
10386 : see what shmat returns
10387 : default to something harmless
10389 case "$i_sysmman$d_mmap" in
10391 $cat >mmap.c <<'END'
10392 #include <sys/mman.h>
10395 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
10400 echo "and it returns ($mmaptype)." >&4
10406 : see if modfl exists
10410 : see if mprotect exists
10411 set mprotect d_mprotect
10414 : see if msgctl exists
10415 set msgctl d_msgctl
10418 : see if msgget exists
10419 set msgget d_msgget
10422 : see if msgsnd exists
10423 set msgsnd d_msgsnd
10426 : see if msgrcv exists
10427 set msgrcv d_msgrcv
10430 : see how much of the 'msg*(2)' library is present.
10433 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
10434 *"$undef"*) h_msg=false;;
10438 case "`ipcs 2>&1`" in
10439 "SVID messages"*"not configured"*)
10440 echo "Your $osname does not have the msg*(2) configured." >&4
10443 set msgctl d_msgctl
10445 set msgget d_msgget
10447 set msgsnd d_msgsnd
10449 set msgrcv d_msgrcv
10455 : we could also check for sys/ipc.h ...
10456 if $h_msg && $test `./findhdr sys/msg.h`; then
10457 echo "You have the full msg*(2) library." >&4
10460 echo "You don't have the full msg*(2) library." >&4
10468 echo "Checking to see if your system supports struct msghdr..." >&4
10469 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
10471 case "$d_msghdr_s" in
10472 "$define") echo "Yes, it does." ;;
10473 *) echo "No, it doesn't." ;;
10477 : see if msync exists
10481 : see if munmap exists
10482 set munmap d_munmap
10485 : see if nice exists
10489 : check for length of character
10491 case "$charsize" in
10493 echo "Checking to see how big your characters are (hey, you never know)..." >&4
10494 $cat >try.c <<'EOCP'
10498 printf("%d\n", (int)sizeof(char));
10503 if eval $compile_ok; then
10507 echo "(I can't seem to compile the test program. Guessing...)"
10514 rp="What is the size of a character (in bytes)?"
10519 : check for volatile keyword
10521 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
10522 $cat >try.c <<'EOCP'
10525 typedef struct _goo_struct goo_struct;
10526 goo_struct * volatile goo = ((goo_struct *)0);
10527 struct _goo_struct {
10532 typedef unsigned short foo_t;
10533 char *volatile foo;
10535 volatile foo_t blech;
10539 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
10541 echo "Yup, it does."
10544 echo "Nope, it doesn't."
10552 $echo "Choosing the C types to be used for Perl's internal types..." >&4
10554 case "$use64bitint:$d_quad:$quadtype" in
10557 uvtype="$uquadtype"
10562 uvtype="unsigned long"
10568 case "$uselongdouble:$d_longdbl" in
10570 nvtype="long double"
10571 nvsize=$longdblsize
10578 $echo "(IV will be "$ivtype", $ivsize bytes)"
10579 $echo "(UV will be "$uvtype", $uvsize bytes)"
10580 $echo "(NV will be "$nvtype", $nvsize bytes)"
10583 #$i_inttypes I_INTTYPES
10585 #include <inttypes.h>
10590 int8_t i = INT8_MAX;
10591 uint8_t u = UINT8_MAX;
10592 printf("int8_t\n");
10595 int16_t i = INT16_MAX;
10596 uint16_t i = UINT16_MAX;
10597 printf("int16_t\n");
10600 int32_t i = INT32_MAX;
10601 uint32_t u = UINT32_MAX;
10602 printf("int32_t\n");
10608 '') case "$charsize" in
10610 u8type="unsigned char"
10619 if eval $compile; then
10620 case "`./try$exe_ext`" in
10621 int8_t) i8type=int8_t
10631 '') if $test $charsize -ge 1; then
10633 u8type="unsigned char"
10641 '') case "$shortsize" in
10643 u16type="unsigned short"
10651 '') set try -DINT16
10652 if eval $compile; then
10653 case "`./try$exe_ext`" in
10665 '') if $test $shortsize -ge 2; then
10667 u16type="unsigned short"
10675 '') case "$longsize" in
10677 u32type="unsigned long"
10681 *) case "$intsize" in
10683 u32type="unsigned int"
10693 '') set try -DINT32
10694 if eval $compile; then
10695 case "`./try$exe_ext`" in
10707 '') if $test $intsize -ge 4; then
10709 u32type="unsigned int"
10717 '') case "$d_quad:$quadtype" in
10719 i64type="$quadtype"
10720 u64type="$uquadtype"
10728 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
10729 : volatile so that the compiler has to store it out to memory.
10730 if test X"$d_volatile" = X"$define"; then
10735 #include <sys/types.h>
10736 #include <signal.h>
10738 $volatile int bletched = 0;
10739 $signal_t blech(s) int s; { bletched = 1; }
10744 int n = 8 * $uvsize;
10747 signal(SIGFPE, blech);
10750 for (i = 0; i < n; i++) {
10751 u = u << 1 | ($uvtype)1;
10753 if (($uvtype)d != u)
10757 d = ($nvtype)(u - 1);
10758 if (($uvtype)d != (u - 1))
10766 printf("%d\n", ((i == n) ? -n : i));
10772 d_nv_preserves_uv="$undef"
10773 if eval $compile; then
10774 d_nv_preserves_uv_bits="`./try$exe_ext`"
10776 case "$d_nv_preserves_uv_bits" in
10778 d_nv_preserves_uv_bits=`expr 0 - $d_nv_preserves_uv_bits`
10779 $echo "Your NVs can preserve all $d_nv_preserves_uv_bits bits of your UVs." 2>&1
10780 d_nv_preserves_uv="$define"
10782 [1-9]*) $echo "Your NVs can preserve only $d_nv_preserves_uv_bits bits of your UVs." 2>&1
10783 d_nv_preserves_uv="$undef" ;;
10784 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
10785 d_nv_preserves_uv_bits="$undef" ;;
10791 : check for off64_t
10793 echo "Checking to see if you have off64_t..." >&4
10795 #include <sys/types.h>
10796 #include <unistd.h>
10797 int main() { off64_t x = 7; }
10800 if eval $compile; then
10802 echo "You have off64_t."
10805 echo "You do not have off64_t."
10806 case "$lseeksize" in
10807 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
10814 : see if POSIX threads are available
10815 set pthread.h i_pthread
10821 : how to create joinable pthreads
10822 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
10824 echo "Checking what constant to use for creating joinable pthreads..." >&4
10825 $cat >try.c <<'EOCP'
10826 #include <pthread.h>
10828 int detachstate = JOINABLE;
10831 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
10832 if eval $compile; then
10833 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
10834 val="$undef" # Yes, undef.
10835 set d_old_pthread_create_joinable
10838 set old_pthread_create_joinable
10841 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
10842 if eval $compile; then
10843 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
10845 set d_old_pthread_create_joinable
10847 val=PTHREAD_CREATE_UNDETACHED
10848 set old_pthread_create_joinable
10851 set try -DJOINABLE=__UNDETACHED
10852 if eval $compile; then
10853 echo "You seem to use __UNDETACHED." >&4
10855 set d_old_pthread_create_joinable
10858 set old_pthread_create_joinable
10861 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
10863 set d_old_pthread_create_joinable
10866 set old_pthread_create_joinable
10873 d_old_pthread_create_joinable="$undef"
10874 old_pthread_create_joinable=""
10877 : see if pause exists
10881 : see if pipe exists
10885 : see if poll exists
10890 : see whether the various POSIXish _yields exist
10892 #include <pthread.h>
10898 #ifdef PTHREAD_YIELD
10901 #ifdef PTHREAD_YIELD_NULL
10902 pthread_yield(NULL);
10908 : see if sched_yield exists
10909 set try -DSCHED_YIELD
10910 if eval $compile; then
10912 sched_yield='sched_yield()'
10916 case "$usethreads" in
10919 $define) echo 'sched_yield() found.' >&4 ;;
10920 *) echo 'sched_yield() NOT found.' >&4 ;;
10926 : see if pthread_yield exists
10927 set try -DPTHREAD_YIELD
10928 if eval $compile; then
10930 case "$sched_yield" in
10931 '') sched_yield='pthread_yield()' ;;
10934 set try -DPTHREAD_YIELD_NULL
10935 if eval $compile; then
10937 case "$sched_yield" in
10938 '') sched_yield='pthread_yield(NULL)' ;;
10944 case "$usethreads" in
10947 $define) echo 'pthread_yield() found.' >&4 ;;
10948 *) echo 'pthread_yield() NOT found.' >&4 ;;
10952 set d_pthread_yield
10955 case "$sched_yield" in
10956 '') sched_yield=undef ;;
10961 : see if this is a pwd.h system
10967 xxx=`./findhdr pwd.h`
10968 $cppstdin $cppflags $cppminus < $xxx >$$.h
10970 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
10978 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
10986 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
10994 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
11002 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
11010 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
11018 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
11026 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
11038 set d_pwquota; eval $setvar
11039 set d_pwage; eval $setvar
11040 set d_pwchange; eval $setvar
11041 set d_pwclass; eval $setvar
11042 set d_pwexpire; eval $setvar
11043 set d_pwcomment; eval $setvar
11044 set d_pwgecos; eval $setvar
11045 set d_pwpasswd; eval $setvar
11049 : see if readdir and friends exist
11050 set readdir d_readdir
11052 set seekdir d_seekdir
11054 set telldir d_telldir
11056 set rewinddir d_rewinddir
11059 : see if readlink exists
11060 set readlink d_readlink
11063 : see if readv exists
11067 : see if realpath exists
11068 set realpath d_realpath
11071 : see if recvmsg exists
11072 set recvmsg d_recvmsg
11075 : see if rename exists
11076 set rename d_rename
11079 : see if rmdir exists
11083 : see if memory.h is available.
11088 : See if it conflicts with string.h
11094 $cppstdin $cppflags $cppminus < $strings > mem.h
11095 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
11097 echo "We won't be including <memory.h>."
11107 : can bcopy handle overlapping blocks?
11112 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
11114 #$i_memory I_MEMORY
11115 #$i_stdlib I_STDLIB
11116 #$i_string I_STRING
11117 #$i_unistd I_UNISTD
11119 $cat >>try.c <<'EOCP'
11122 # include <memory.h>
11125 # include <stdlib.h>
11128 # include <string.h>
11130 # include <strings.h>
11133 # include <unistd.h> /* Needed for NetBSD */
11137 char buf[128], abc[128];
11143 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
11145 for (align = 7; align >= 0; align--) {
11146 for (len = 36; len; len--) {
11148 bcopy(abc, b, len);
11149 for (off = 1; off <= len; off++) {
11150 bcopy(b, b+off, len);
11151 bcopy(b+off, b, len);
11152 if (bcmp(b, abc, len))
11161 if eval $compile_ok; then
11162 if ./try 2>/dev/null; then
11163 echo "Yes, it can."
11166 echo "It can't, sorry."
11167 case "$d_memmove" in
11168 "$define") echo "But that's Ok since you have memmove()." ;;
11172 echo "(I can't compile the test program, so we'll assume not...)"
11173 case "$d_memmove" in
11174 "$define") echo "But that's Ok since you have memmove()." ;;
11179 $rm -f try.* try core
11183 : can memcpy handle overlapping blocks?
11185 case "$d_memcpy" in
11188 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
11190 #$i_memory I_MEMORY
11191 #$i_stdlib I_STDLIB
11192 #$i_string I_STRING
11193 #$i_unistd I_UNISTD
11195 $cat >>try.c <<'EOCP'
11198 # include <memory.h>
11201 # include <stdlib.h>
11204 # include <string.h>
11206 # include <strings.h>
11209 # include <unistd.h> /* Needed for NetBSD */
11213 char buf[128], abc[128];
11219 /* Copy "abcde..." string to char abc[] so that gcc doesn't
11220 try to store the string in read-only memory. */
11221 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
11223 for (align = 7; align >= 0; align--) {
11224 for (len = 36; len; len--) {
11226 memcpy(b, abc, len);
11227 for (off = 1; off <= len; off++) {
11228 memcpy(b+off, b, len);
11229 memcpy(b, b+off, len);
11230 if (memcmp(b, abc, len))
11239 if eval $compile_ok; then
11240 if ./try 2>/dev/null; then
11241 echo "Yes, it can."
11244 echo "It can't, sorry."
11245 case "$d_memmove" in
11246 "$define") echo "But that's Ok since you have memmove()." ;;
11250 echo "(I can't compile the test program, so we'll assume not...)"
11251 case "$d_memmove" in
11252 "$define") echo "But that's Ok since you have memmove()." ;;
11257 $rm -f try.* try core
11261 : can memcmp be trusted to compare relative magnitude?
11263 case "$d_memcmp" in
11266 echo "Checking if your memcmp() can compare relative magnitude..." >&4
11268 #$i_memory I_MEMORY
11269 #$i_stdlib I_STDLIB
11270 #$i_string I_STRING
11271 #$i_unistd I_UNISTD
11273 $cat >>try.c <<'EOCP'
11276 # include <memory.h>
11279 # include <stdlib.h>
11282 # include <string.h>
11284 # include <strings.h>
11287 # include <unistd.h> /* Needed for NetBSD */
11293 if ((a < b) && memcmp(&a, &b, 1) < 0)
11299 if eval $compile_ok; then
11300 if ./try 2>/dev/null; then
11301 echo "Yes, it can."
11304 echo "No, it can't (it uses signed chars)."
11307 echo "(I can't compile the test program, so we'll assume not...)"
11311 $rm -f try.* try core
11315 : see if prototype for sbrk is available
11317 set d_sbrkproto sbrk $i_unistd unistd.h
11320 : see if select exists
11321 set select d_select
11324 : see if semctl exists
11325 set semctl d_semctl
11328 : see if semget exists
11329 set semget d_semget
11332 : see if semop exists
11336 : see how much of the 'sem*(2)' library is present.
11339 case "$d_semctl$d_semget$d_semop" in
11340 *"$undef"*) h_sem=false;;
11344 case "`ipcs 2>&1`" in
11345 "SVID messages"*"not configured"*)
11346 echo "Your $osname does not have the sem*(2) configured." >&4
11349 set semctl d_semctl
11351 set semget d_semget
11359 : we could also check for sys/ipc.h ...
11360 if $h_sem && $test `./findhdr sys/sem.h`; then
11361 echo "You have the full sem*(2) library." >&4
11364 echo "You don't have the full sem*(2) library." >&4
11370 : see whether sys/sem.h defines union semun
11372 $cat > try.c <<'END'
11373 #include <sys/types.h>
11374 #include <sys/ipc.h>
11375 #include <sys/sem.h>
11376 int main () { union semun semun; semun.buf = 0; }
11379 if eval $compile; then
11380 echo "You have union semun in <sys/sem.h>." >&4
11383 echo "You do not have union semun in <sys/sem.h>." >&4
11386 $rm -f try try.c try.h
11390 : see how to do semctl IPC_STAT
11393 : see whether semctl IPC_STAT can use union semun
11398 # define S_IRUSR S_IREAD
11399 # define S_IWUSR S_IWRITE
11400 # define S_IXUSR S_IEXEC
11402 # define S_IRUSR 0400
11403 # define S_IWUSR 0200
11404 # define S_IXUSR 0100
11406 # define S_IRGRP (S_IRUSR>>3)
11407 # define S_IWGRP (S_IWUSR>>3)
11408 # define S_IXGRP (S_IXUSR>>3)
11409 # define S_IROTH (S_IRUSR>>6)
11410 # define S_IWOTH (S_IWUSR>>6)
11411 # define S_IXOTH (S_IXUSR>>6)
11414 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
11415 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
11416 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
11421 #include <sys/types.h>
11422 #include <sys/ipc.h>
11423 #include <sys/sem.h>
11424 #include <sys/stat.h>
11431 #$d_union_semun HAS_UNION_SEMUN
11434 #ifndef HAS_UNION_SEMUN
11437 struct semid_ds *buf;
11438 unsigned short *array;
11444 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
11445 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
11447 struct semid_ds argbuf;
11450 st = semctl(sem, 0, IPC_STAT, arg);
11454 # endif /* IPC_STAT */
11455 printf("semctl IPC_STAT failed: errno = %d\n", errno);
11457 if (semctl(sem, 0, IPC_RMID, arg) != 0)
11458 # endif /* IPC_RMID */
11459 printf("semctl IPC_RMID failed: errno = %d\n", errno);
11461 #endif /* IPC_PRIVATE && ... */
11462 printf("semget failed: errno = %d\n", errno);
11468 if eval $compile; then
11471 semun) val="$define" ;;
11477 case "$d_semctl_semun" in
11479 echo "You can use union semun for semctl IPC_STAT." >&4
11482 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
11487 : see whether semctl IPC_STAT can use struct semid_ds pointer
11488 $cat > try.c <<'END'
11489 #include <sys/types.h>
11490 #include <sys/ipc.h>
11491 #include <sys/sem.h>
11492 #include <sys/stat.h>
11500 struct semid_ds arg;
11503 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
11504 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
11507 st = semctl(sem, 0, IPC_STAT, &arg);
11509 printf("semid_ds\n");
11511 # endif /* IPC_STAT */
11512 printf("semctl IPC_STAT failed: errno = %d\n", errno);
11514 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
11515 # endif /* IPC_RMID */
11516 printf("semctl IPC_RMID failed: errno = %d\n", errno);
11518 #endif /* IPC_PRIVATE && ... */
11519 printf("semget failed: errno = %d\n", errno);
11526 if eval $compile; then
11529 semid_ds) val="$define" ;;
11533 set d_semctl_semid_ds
11535 case "$d_semctl_semid_ds" in
11537 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
11539 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
11546 # We do not have the full sem*(2) library, so assume we can not
11552 set d_semctl_semid_ds
11557 : see if sendmsg exists
11558 set sendmsg d_sendmsg
11561 : see if setegid exists
11562 set setegid d_setegid
11565 : see if seteuid exists
11566 set seteuid d_seteuid
11569 : see if setgrent exists
11570 set setgrent d_setgrent
11573 : see if sethostent exists
11574 set sethostent d_sethent
11577 : see if setitimer exists
11578 set setitimer d_setitimer
11581 : see if setlinebuf exists
11582 set setlinebuf d_setlinebuf
11585 : see if setlocale exists
11586 set setlocale d_setlocale
11589 : see if setnetent exists
11590 set setnetent d_setnent
11593 : see if setprotoent exists
11594 set setprotoent d_setpent
11597 : see if setpgid exists
11598 set setpgid d_setpgid
11601 : see if setpgrp2 exists
11602 set setpgrp2 d_setpgrp2
11605 : see if setpriority exists
11606 set setpriority d_setprior
11609 : see if setproctitle exists
11610 set setproctitle d_setproctitle
11613 : see if setpwent exists
11614 set setpwent d_setpwent
11617 : see if setregid exists
11618 set setregid d_setregid
11620 set setresgid d_setresgid
11623 : see if setreuid exists
11624 set setreuid d_setreuid
11626 set setresuid d_setresuid
11629 : see if setrgid exists
11630 set setrgid d_setrgid
11633 : see if setruid exists
11634 set setruid d_setruid
11637 : see if setservent exists
11638 set setservent d_setsent
11641 : see if setsid exists
11642 set setsid d_setsid
11645 : see if setvbuf exists
11646 set setvbuf d_setvbuf
11649 : see if sfio.h is available
11654 : see if sfio library is available
11665 : Ok, but do we want to use it.
11669 true|$define|[yY]*) dflt='y';;
11672 echo "$package can use the sfio library, but it is experimental."
11673 case "$useperlio" in
11675 echo "For sfio also the PerlIO abstraction layer is needed."
11676 echo "Earlier you said you wouldn't want that."
11679 rp="You seem to have sfio available, do you want to try using it?"
11682 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
11683 useperlio="$define"
11686 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
11691 *) case "$usesfio" in
11692 true|$define|[yY]*)
11693 echo "Sorry, cannot find sfio on this machine." >&4
11694 echo "Ignoring your setting of usesfio=$usesfio." >&4
11703 $define) usesfio='true';;
11704 *) usesfio='false';;
11708 *) : Remove sfio from list of libraries to use
11709 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
11712 echo "libs = $libs" >&4
11717 : see if shmctl exists
11718 set shmctl d_shmctl
11721 : see if shmget exists
11722 set shmget d_shmget
11725 : see if shmat exists
11728 : see what shmat returns
11731 $cat >shmat.c <<'END'
11732 #include <sys/shm.h>
11735 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
11740 echo "and it returns ($shmattype)." >&4
11741 : see if a prototype for shmat is available
11742 xxx=`./findhdr sys/shm.h`
11743 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
11744 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
11755 set d_shmatprototype
11758 : see if shmdt exists
11762 : see how much of the 'shm*(2)' library is present.
11765 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
11766 *"$undef"*) h_shm=false;;
11770 case "`ipcs 2>&1`" in
11771 "SVID shared memory"*"not configured"*)
11772 echo "Your $osname does not have the shm*(2) configured." >&4
11775 set shmctl d_shmctl
11777 set shmget d_shmget
11787 : we could also check for sys/ipc.h ...
11788 if $h_shm && $test `./findhdr sys/shm.h`; then
11789 echo "You have the full shm*(2) library." >&4
11792 echo "You don't have the full shm*(2) library." >&4
11799 : see if we have sigaction
11800 if set sigaction val -f d_sigaction; eval $csym; $val; then
11801 echo 'sigaction() found.' >&4
11802 $cat > try.c <<'EOP'
11804 #include <sys/types.h>
11805 #include <signal.h>
11808 struct sigaction act, oact;
11810 oact.sa_handler = 0;
11811 /* so that act and oact are used */
11812 exit(act.sa_flags == 0 && oact.sa_handler == 0);
11816 if eval $compile_ok; then
11819 echo "But you don't seem to have a useable struct sigaction." >&4
11823 echo 'sigaction NOT found.' >&4
11826 set d_sigaction; eval $setvar
11827 $rm -f try try$_o try.c
11829 : see if sigprocmask exists
11830 set sigprocmask d_sigprocmask
11833 : see if sigsetjmp exists
11835 case "$d_sigsetjmp" in
11837 $cat >try.c <<'EOP'
11838 #include <setjmp.h>
11843 if (sigsetjmp(env,1))
11846 siglongjmp(env, 1);
11851 if eval $compile; then
11852 if ./try >/dev/null 2>&1; then
11853 echo "POSIX sigsetjmp found." >&4
11857 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
11863 echo "sigsetjmp not found." >&4
11867 *) val="$d_sigsetjmp"
11868 case "$d_sigsetjmp" in
11869 $define) echo "POSIX sigsetjmp found." >&4;;
11870 $undef) echo "sigsetjmp not found." >&4;;
11878 : see if sockatmark exists
11879 set sockatmark d_sockatmark
11882 : see if socks5_init exists
11883 set socks5_init d_socks5_init
11886 : see if prototype for setresgid is available
11888 set d_sresgproto setresgid $i_unistd unistd.h
11891 : see if prototype for setresuid is available
11893 set d_sresuproto setresuid $i_unistd unistd.h
11896 : see if sys/stat.h is available
11897 set sys/stat.h i_sysstat
11901 : see if stat knows about block sizes
11903 echo "Checking to see if your struct stat has st_blocks field..." >&4
11904 set d_statblks stat st_blocks $i_sysstat sys/stat.h
11908 : see if this is a sys/vfs.h system
11909 set sys/vfs.h i_sysvfs
11913 : see if this is a sys/statfs.h system
11914 set sys/statfs.h i_sysstatfs
11919 echo "Checking to see if your system supports struct statfs..." >&4
11920 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
11922 case "$d_statfs_s" in
11923 "$define") echo "Yes, it does." ;;
11924 *) echo "No, it doesn't." ;;
11929 : see if struct statfs knows about f_flags
11930 case "$d_statfs_s" in
11933 echo "Checking to see if your struct statfs has f_flags field..." >&4
11934 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
11938 set d_statfs_f_flags
11942 case "$d_statfs_f_flags" in
11943 "$define") echo "Yes, it does." ;;
11944 *) echo "No, it doesn't." ;;
11947 : see if _ptr and _cnt from stdio act std
11950 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
11951 echo "(Looks like you have stdio.h from BSD.)"
11952 case "$stdio_ptr" in
11953 '') stdio_ptr='((fp)->_p)'
11956 *) ptr_lval=$d_stdio_ptr_lval;;
11958 case "$stdio_cnt" in
11959 '') stdio_cnt='((fp)->_r)'
11962 *) cnt_lval=$d_stdio_cnt_lval;;
11964 case "$stdio_base" in
11965 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
11967 case "$stdio_bufsiz" in
11968 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
11970 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
11971 echo "(Looks like you have stdio.h from Linux.)"
11972 case "$stdio_ptr" in
11973 '') stdio_ptr='((fp)->_IO_read_ptr)'
11976 *) ptr_lval=$d_stdio_ptr_lval;;
11978 case "$stdio_cnt" in
11979 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
11982 *) cnt_lval=$d_stdio_cnt_lval;;
11984 case "$stdio_base" in
11985 '') stdio_base='((fp)->_IO_read_base)';;
11987 case "$stdio_bufsiz" in
11988 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
11991 case "$stdio_ptr" in
11992 '') stdio_ptr='((fp)->_ptr)'
11995 *) ptr_lval=$d_stdio_ptr_lval;;
11997 case "$stdio_cnt" in
11998 '') stdio_cnt='((fp)->_cnt)'
12001 *) cnt_lval=$d_stdio_cnt_lval;;
12003 case "$stdio_base" in
12004 '') stdio_base='((fp)->_base)';;
12006 case "$stdio_bufsiz" in
12007 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12011 : test whether _ptr and _cnt really work
12012 echo "Checking how std your stdio is..." >&4
12015 #define FILE_ptr(fp) $stdio_ptr
12016 #define FILE_cnt(fp) $stdio_cnt
12018 FILE *fp = fopen("try.c", "r");
12021 18 <= FILE_cnt(fp) &&
12022 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12030 if eval $compile; then
12032 echo "Your stdio acts pretty std."
12035 echo "Your stdio isn't very std."
12038 echo "Your stdio doesn't appear very std."
12044 : Can _ptr be used as an lvalue?
12045 case "$d_stdstdio$ptr_lval" in
12046 $define$define) val=$define ;;
12049 set d_stdio_ptr_lval
12052 : Can _cnt be used as an lvalue?
12053 case "$d_stdstdio$cnt_lval" in
12054 $define$define) val=$define ;;
12057 set d_stdio_cnt_lval
12061 : test whether setting _ptr sets _cnt as a side effect
12062 d_stdio_ptr_lval_sets_cnt="$undef"
12063 d_stdio_ptr_lval_nochange_cnt="$undef"
12064 case "$d_stdio_ptr_lval$d_stdstdio" in
12066 echo "Checking to see what happens if we set the stdio ptr..." >&4
12069 /* Can we scream? */
12070 /* Eat dust sed :-) */
12071 /* In the buffer space, no one can hear you scream. */
12072 #define FILE_ptr(fp) $stdio_ptr
12073 #define FILE_cnt(fp) $stdio_cnt
12074 #include <sys/types.h>
12076 FILE *fp = fopen("try.c", "r");
12081 puts("Fail even to read");
12084 c = getc(fp); /* Read away the first # */
12086 puts("Fail even to read");
12090 18 <= FILE_cnt(fp) &&
12091 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12093 puts("Fail even to read");
12096 ptr = (char*) FILE_ptr(fp);
12097 cnt = (size_t)FILE_cnt(fp);
12099 FILE_ptr(fp) += 42;
12101 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12102 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12105 if (FILE_cnt(fp) <= 20) {
12106 printf ("Fail (<20 chars to test)");
12109 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12110 puts("Fail compare");
12113 if (cnt == FILE_cnt(fp)) {
12114 puts("Pass_unchanged");
12117 if (FILE_cnt(fp) == (cnt - 42)) {
12118 puts("Pass_changed");
12121 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12127 if eval $compile; then
12128 case `./try$exe_ext` in
12130 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12131 d_stdio_ptr_lval_sets_cnt="$define" ;;
12133 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12134 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12136 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12138 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12141 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12147 : see if _base is also standard
12149 case "$d_stdstdio" in
12153 #define FILE_base(fp) $stdio_base
12154 #define FILE_bufsiz(fp) $stdio_bufsiz
12156 FILE *fp = fopen("try.c", "r");
12159 19 <= FILE_bufsiz(fp) &&
12160 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
12167 if eval $compile; then
12169 echo "And its _base field acts std."
12172 echo "But its _base field isn't std."
12175 echo "However, it seems to be lacking the _base field."
12184 Checking how to access stdio streams by file descriptor number...
12186 case "$stdio_stream_array" in
12187 '') $cat >try.c <<EOCP
12190 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
12194 for s in _iob __iob __sF
12196 set try -DSTDIO_STREAM_ARRAY=$s
12197 if eval $compile; then
12198 case "`./try$exe_ext`" in
12199 yes) stdio_stream_array=$s; break ;;
12203 $rm -f try.* try$exe_ext
12205 case "$stdio_stream_array" in
12207 I can't figure out how to access stdio streams by file descriptor number.
12209 d_stdio_stream_array="$undef"
12212 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
12214 d_stdio_stream_array="$define"
12218 : see if strcoll exists
12219 set strcoll d_strcoll
12222 : check for structure copying
12224 echo "Checking to see if your C compiler can copy structs..." >&4
12225 $cat >try.c <<'EOCP'
12235 if $cc -c try.c >/dev/null 2>&1 ; then
12237 echo "Yup, it can."
12240 echo "Nope, it can't."
12246 : see if strerror and/or sys_errlist[] exist
12248 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
12249 if set strerror val -f d_strerror; eval $csym; $val; then
12250 echo 'strerror() found.' >&4
12251 d_strerror="$define"
12252 d_strerrm='strerror(e)'
12253 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
12254 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
12255 d_syserrlst="$define"
12257 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
12258 d_syserrlst="$undef"
12260 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
12261 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
12262 echo 'strerror() found in string header.' >&4
12263 d_strerror="$define"
12264 d_strerrm='strerror(e)'
12265 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
12266 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
12267 d_syserrlst="$define"
12269 echo "(You don't appear to have any sys_errlist[], how can this be?)"
12270 d_syserrlst="$undef"
12272 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
12273 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
12274 d_strerror="$undef"
12275 d_syserrlst="$define"
12276 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
12278 echo 'strerror() and sys_errlist[] NOT found.' >&4
12279 d_strerror="$undef"
12280 d_syserrlst="$undef"
12281 d_strerrm='"unknown"'
12285 : see if strftime exists
12286 set strftime d_strftime
12289 : see if strtod exists
12290 set strtod d_strtod
12293 : see if strtol exists
12294 set strtol d_strtol
12297 : see if strtold exists
12298 set strtold d_strtold
12301 : see if strtoll exists
12302 set strtoll d_strtoll
12305 case "$d_longlong-$d_strtoll" in
12308 Checking whether your strtoll() works okay...
12310 $cat >try.c <<'EOCP'
12313 #define strtoll __strtoll
12316 #define strtoll _strtoll
12319 extern long long int strtoll(char *s, char **, int);
12320 static int bad = 0;
12321 int check(char *s, long long ell, int een) {
12324 gll = strtoll(s, 0, 10);
12325 if (!((gll == ell) && (errno == een)))
12329 check(" 1", 1LL, 0);
12330 check(" 0", 0LL, 0);
12331 check("-1", -1LL, 0);
12332 check("-9223372036854775808", -9223372036854775808LL, 0);
12333 check("-9223372036854775808", -9223372036854775808LL, 0);
12334 check(" 9223372036854775807", 9223372036854775807LL, 0);
12335 check("-9223372036854775808", -9223372036854775808LL, 0);
12336 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
12337 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
12343 if eval $compile; then
12346 ok) echo "Your strtoll() seems to be working okay." ;;
12348 Your strtoll() doesn't seem to be working okay.
12354 echo "(I can't seem to compile the test program--assuming it doesn't)"
12360 : see if strtoq exists
12361 set strtoq d_strtoq
12364 : see if strtoul exists
12365 set strtoul d_strtoul
12368 case "$d_strtoul" in
12371 Checking whether your strtoul() works okay...
12373 $cat >try.c <<'EOCP'
12376 extern unsigned long int strtoul(char *s, char **, int);
12377 static int bad = 0;
12378 void check(char *s, unsigned long eul, int een) {
12381 gul = strtoul(s, 0, 10);
12382 if (!((gul == eul) && (errno == een)))
12386 check(" 1", 1L, 0);
12387 check(" 0", 0L, 0);
12389 case "$longsize" in
12391 $cat >>try.c <<'EOCP'
12392 check("18446744073709551615", 18446744073709551615UL, 0);
12393 check("18446744073709551616", 18446744073709551615UL, ERANGE);
12394 #if 0 /* strtoul() for /^-/ strings is undefined. */
12395 check("-1", 18446744073709551615UL, 0);
12396 check("-18446744073709551614", 2, 0);
12397 check("-18446744073709551615", 1, 0);
12398 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
12399 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
12404 $cat >>try.c <<'EOCP'
12405 check("4294967295", 4294967295UL, 0);
12406 check("4294967296", 4294967295UL, ERANGE);
12407 #if 0 /* strtoul() for /^-/ strings is undefined. */
12408 check("-1", 4294967295UL, 0);
12409 check("-4294967294", 2, 0);
12410 check("-4294967295", 1, 0);
12411 check("-4294967296", 4294967295UL, ERANGE);
12412 check("-4294967297", 4294967295UL, ERANGE);
12417 : Should we write these tests to be more portable by sprintf-ing
12418 : ~0 and then manipulating that char string as input for strtol?
12421 $cat >>try.c <<'EOCP'
12428 if eval $compile; then
12430 ok) echo "Your strtoul() seems to be working okay." ;;
12432 Your strtoul() doesn't seem to be working okay.
12441 : see if strtoull exists
12442 set strtoull d_strtoull
12445 case "$d_longlong-$d_strtoull" in
12448 Checking whether your strtoull() works okay...
12450 $cat >try.c <<'EOCP'
12453 #define strtoull __strtoull
12456 extern unsigned long long int strtoull(char *s, char **, int);
12457 static int bad = 0;
12458 int check(char *s, long long eull, int een) {
12461 gull = strtoull(s, 0, 10);
12462 if (!((gull == eull) && (errno == een)))
12466 check(" 1", 1LL, 0);
12467 check(" 0", 0LL, 0);
12468 check("18446744073709551615", 18446744073709551615ULL, 0);
12469 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
12470 #if 0 /* strtoull() for /^-/ strings is undefined. */
12471 check("-1", 18446744073709551615ULL, 0);
12472 check("-18446744073709551614", 2LL, 0);
12473 check("-18446744073709551615", 1LL, 0);
12474 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
12475 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
12482 if eval $compile; then
12484 ok) echo "Your strtoull() seems to be working okay." ;;
12486 Your strtoull() doesn't seem to be working okay.
12488 d_strtoull="$undef"
12495 : see if strtouq exists
12496 set strtouq d_strtouq
12499 case "$d_strtouq" in
12502 Checking whether your strtouq() works okay...
12504 $cat >try.c <<'EOCP'
12507 extern unsigned long long int strtouq(char *s, char **, int);
12508 static int bad = 0;
12509 void check(char *s, unsigned long long eull, int een) {
12510 unsigned long long gull;
12512 gull = strtouq(s, 0, 10);
12513 if (!((gull == eull) && (errno == een)))
12517 check(" 1", 1LL, 0);
12518 check(" 0", 0LL, 0);
12519 check("18446744073709551615", 18446744073709551615ULL, 0);
12520 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
12521 #if 0 /* strtouq() for /^-/ strings is undefined. */
12522 check("-1", 18446744073709551615ULL, 0);
12523 check("-18446744073709551614", 2LL, 0);
12524 check("-18446744073709551615", 1LL, 0);
12525 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
12526 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
12534 if eval $compile; then
12536 ok) echo "Your strtouq() seems to be working okay." ;;
12538 Your strtouq() doesn't seem to be working okay.
12547 : see if strxfrm exists
12548 set strxfrm d_strxfrm
12551 : see if symlink exists
12552 set symlink d_symlink
12555 : see if syscall exists
12556 set syscall d_syscall
12559 : see if sysconf exists
12560 set sysconf d_sysconf
12563 : see if system exists
12564 set system d_system
12567 : see if tcgetpgrp exists
12568 set tcgetpgrp d_tcgetpgrp
12571 : see if tcsetpgrp exists
12572 set tcsetpgrp d_tcsetpgrp
12575 : see if prototype for telldir is available
12577 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
12580 : see if this is a sys/times.h system
12581 set sys/times.h i_systimes
12584 : see if times exists
12586 if set times val -f d_times; eval $csym; $val; then
12587 echo 'times() found.' >&4
12590 case "$i_systimes" in
12591 "$define") inc='sys/times.h';;
12593 rp="What is the type returned by times() on this system?"
12594 set clock_t clocktype long stdio.h sys/types.h $inc
12597 echo 'times() NOT found, hope that will do.' >&4
12602 : see if truncate exists
12603 set truncate d_truncate
12606 : see if tzname[] exists
12608 if set tzname val -a d_tzname; eval $csym; $val; then
12610 echo 'tzname[] found.' >&4
12613 echo 'tzname[] NOT found.' >&4
12618 case "$crosscompile" in
12619 ''|[nN]*) crosscompile="$undef" ;;
12623 next|rhapsody|darwin) multiarch="$define" ;;
12625 case "$multiarch" in
12626 ''|[nN]*) multiarch="$undef" ;;
12629 : check for ordering of bytes in a long
12631 case "$crosscompile$multiarch" in
12634 You seem to be either cross-compiling or doing a multiarchitecture build,
12635 skipping the byteorder check.
12641 case "$byteorder" in
12644 In the following, larger digits indicate more significance. A big-endian
12645 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
12646 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
12647 machines may have weird orders like 3412. A Cray will report 87654321,
12648 an Alpha will report 12345678. If the test program works the default is
12650 I'm now running the test program...
12652 $cat >try.c <<'EOCP'
12659 char c[sizeof(long)];
12662 if (sizeof(long) > 4)
12663 u.l = (0x08070605L << 32) | 0x04030201L;
12666 for (i = 0; i < sizeof(long); i++)
12667 printf("%c", u.c[i]+'0');
12674 if eval $compile && ./try > /dev/null; then
12677 [1-4][1-4][1-4][1-4]|12345678|87654321)
12678 echo "(The test program ran ok.)"
12679 echo "byteorder=$dflt"
12682 ????|????????) echo "(The test program ran ok.)" ;;
12683 *) echo "(The test program didn't run right for some reason.)" ;;
12688 (I can't seem to compile the test program. Guessing big-endian...)
12691 case "$xxx_prompt" in
12693 rp="What is the order of bytes in a long?"
12709 Checking to see whether you can access character data unalignedly...
12713 #define U32 $u32type
12714 #define BYTEORDER $byteorder
12716 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
12717 U8 buf[] = "\0\0\0\1\0\0\0\0";
12721 if (sizeof(U32) != 4) {
12722 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
12728 for (i = 0; i < 4; i++) {
12729 up = (U32*)(buf + i);
12730 if (! ((*up == 1 << (8*i)) || /* big-endian */
12731 (*up == 1 << (8*(3-i))) /* little-endian */
12735 printf("read failed (%x)\n", *up);
12741 for (i = 0; i < 4; i++) {
12742 up = (U32*)(buf + i);
12744 if (*up != 0xBeef) {
12745 printf("write failed (%x)\n", *up);
12759 if eval $compile_ok; then
12760 echo "(This test may dump core.)" >&4
12761 ./try >&2 >/dev/null
12764 You can access character data pretty unalignedly.
12766 d_u32align="$undef"
12769 It seems that you must access character data in an aligned manner.
12771 d_u32align="$define"
12774 $rm -f core core.try.* try.core
12776 rp='Can you access character data at unaligned addresses?'
12780 [yY]*) d_u32align="$undef" ;;
12781 *) d_u32align="$define" ;;
12785 : see if ualarm exists
12786 set ualarm d_ualarm
12789 : see if umask exists
12793 : see if usleep exists
12794 set usleep d_usleep
12797 : see if ustat exists
12801 : backward compatibility for d_hvfork
12802 if test X$d_hvfork != X; then
12803 d_vfork="$d_hvfork"
12806 : see if there is a vfork
12811 : Ok, but do we want to use it. vfork is reportedly unreliable in
12812 : perl on Solaris 2.x, and probably elsewhere.
12816 case "$usevfork" in
12822 Perl can only use a vfork() that doesn't suffer from strict
12823 restrictions on calling functions or modifying global data in
12824 the child. For example, glibc-2.1 contains such a vfork()
12825 that is unsuitable. If your system provides a proper fork()
12826 call, chances are that you do NOT want perl to use vfork().
12829 rp="Do you still want to use vfork()?"
12834 echo "Ok, we won't use vfork()."
12843 $define) usevfork='true';;
12844 *) usevfork='false';;
12847 : see if this is an sysdir system
12848 set sys/dir.h i_sysdir
12851 : see if this is an sysndir system
12852 set sys/ndir.h i_sysndir
12855 : see if closedir exists
12856 set closedir d_closedir
12859 case "$d_closedir" in
12862 echo "Checking whether closedir() returns a status..." >&4
12863 cat > closedir.c <<EOM
12864 #$i_dirent I_DIRENT /**/
12865 #$i_sysdir I_SYS_DIR /**/
12866 #$i_sysndir I_SYS_NDIR /**/
12867 #$i_systypes I_SYS_TYPES /**/
12869 #if defined(I_SYS_TYPES)
12870 #include <sys/types.h>
12872 #if defined(I_DIRENT)
12873 #include <dirent.h>
12874 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
12875 #include <sys/dir.h>
12879 #include <sys/ndir.h>
12883 #include <ndir.h> /* may be wrong in the future */
12885 #include <sys/dir.h>
12890 int main() { return closedir(opendir(".")); }
12893 if eval $compile_ok; then
12894 if ./closedir > /dev/null 2>&1 ; then
12895 echo "Yes, it does."
12898 echo "No, it doesn't."
12902 echo "(I can't seem to compile the test program--assuming it doesn't)"
12910 set d_void_closedir
12913 : see if there is a wait4
12917 : see if waitpid exists
12918 set waitpid d_waitpid
12921 : see if wcstombs exists
12922 set wcstombs d_wcstombs
12925 : see if wctomb exists
12926 set wctomb d_wctomb
12929 : see if writev exists
12930 set writev d_writev
12933 : preserve RCS keywords in files with variable substitution, grrr
12938 Revision='$Revision'
12940 : check for alignment requirements
12942 case "$crosscompile$multiarch" in
12945 You seem to be either cross-compiling or doing a multiarchitecture build,
12946 skipping the memory alignment check.
12949 case "$alignbytes" in
12950 '') alignbytes=8 ;;
12954 case "$alignbytes" in
12955 '') echo "Checking alignment constraints..." >&4
12956 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
12957 $cat >try.c <<'EOCP'
12958 typedef long double NV;
12961 $cat >try.c <<'EOCP'
12965 $cat >>try.c <<'EOCP'
12973 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
12978 if eval $compile_ok; then
12982 echo "(I can't seem to compile the test program...)"
12985 *) dflt="$alignbytes"
12988 rp="Doubles must be aligned on a how-many-byte boundary?"
12996 : set the base revision
12999 : how do we catenate cpp tokens here?
13001 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
13002 $cat >cpp_stuff.c <<'EOCP'
13003 #define RCAT(a,b)a/**/b
13004 #define ACAT(a,b)a ## b
13008 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
13009 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
13010 echo "Oh! Smells like ANSI's been here." >&4
13011 echo "We can catify or stringify, separately or together!"
13013 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
13014 echo "Ah, yes! The good old days!" >&4
13015 echo "However, in the good old days we don't know how to stringify and"
13016 echo "catify at the same time."
13020 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
13021 to have to edit the values of CAT[2-5] in config.h...
13023 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
13027 : see if this is a db.h system
13033 : Check db version.
13035 echo "Checking Berkeley DB version ..." >&4
13041 #include <sys/types.h>
13044 int main(int argc, char *argv[])
13046 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
13047 int Major, Minor, Patch ;
13048 unsigned long Version ;
13049 (void)db_version(&Major, &Minor, &Patch) ;
13051 printf("%d %d %d %d %d %d\n",
13052 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
13053 Major, Minor, Patch);
13056 printf("You have Berkeley DB Version 2 or greater.\n");
13058 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
13059 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
13060 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
13061 Major, Minor, Patch) ;
13063 /* check that db.h & libdb are compatible */
13064 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
13065 printf("db.h and libdb are incompatible.\n") ;
13069 printf("db.h and libdb are compatible.\n") ;
13071 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
13072 + DB_VERSION_PATCH ;
13074 /* needs to be >= 2.3.4 */
13075 if (Version < 2003004) {
13076 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
13077 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
13083 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
13088 printf("You have Berkeley DB Version 1.\n");
13089 exit(0); /* DB version < 2: the coast is clear. */
13091 exit(1); /* <db.h> not Berkeley DB? */
13097 if eval $compile_ok && ./try; then
13098 echo 'Looks OK.' >&4
13100 db_version_major=$1
13101 db_version_minor=$2
13102 db_version_patch=$3
13104 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
13108 : Remove db from list of libraries to use
13109 echo "Removing unusable -ldb from library list" >&4
13110 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
13113 echo "libs = $libs" >&4
13123 : Check the return type needed for hash
13125 echo "Checking return type needed for hash for Berkeley DB ..." >&4
13131 #include <sys/types.h>
13134 #ifndef DB_VERSION_MAJOR
13135 u_int32_t hash_cb (ptr, size)
13143 info.hash = hash_cb;
13147 if $cc $ccflags -c try.c >try.out 2>&1 ; then
13148 if $contains warning try.out >>/dev/null 2>&1 ; then
13151 db_hashtype='u_int32_t'
13154 : XXX Maybe we should just give up here.
13155 db_hashtype=u_int32_t
13157 echo "Help: I can't seem to compile the db test program." >&4
13158 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
13161 echo "Your version of Berkeley DB uses $db_hashtype for hash."
13163 *) db_hashtype=u_int32_t
13168 : Check the return type needed for prefix
13170 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
13176 #include <sys/types.h>
13179 #ifndef DB_VERSION_MAJOR
13180 size_t prefix_cb (key1, key2)
13188 info.prefix = prefix_cb;
13192 if $cc $ccflags -c try.c >try.out 2>&1 ; then
13193 if $contains warning try.out >>/dev/null 2>&1 ; then
13194 db_prefixtype='int'
13196 db_prefixtype='size_t'
13199 db_prefixtype='size_t'
13200 : XXX Maybe we should just give up here.
13202 echo "Help: I can't seem to compile the db test program." >&4
13203 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
13206 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
13208 *) db_prefixtype='size_t'
13213 : How can we generate normalized random numbers ?
13215 echo "Looking for a random number function..." >&4
13216 case "$randfunc" in
13218 if set drand48 val -f; eval $csym; $val; then
13220 echo "Good, found drand48()." >&4
13221 elif set random val -f; eval $csym; $val; then
13223 echo "OK, found random()." >&4
13226 echo "Yick, looks like I have to use rand()." >&4
13237 *-Dmy_rand=*|*-Dmy_srand=*)
13238 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
13239 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
13240 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
13241 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
13245 while $test "$cont"; do
13246 rp="Use which function to generate random numbers?"
13248 if $test "$ans" = "$dflt"; then
13254 if set $ans val -f; eval $csym; $val; then
13258 rp="I cannot find function $ans. Use that name anyway?"
13267 case "$randfunc" in
13269 drand01="drand48()"
13275 case "$randbits" in
13277 echo "Checking to see how many bits your $randfunc() function produces..." >&4
13279 #$i_unistd I_UNISTD
13280 #$i_stdlib I_STDLIB
13283 # include <unistd.h>
13286 # include <stdlib.h>
13291 register unsigned long tmp;
13292 register unsigned long max = 0L;
13294 for (i = 1000; i; i--) {
13295 tmp = (unsigned long) $randfunc();
13296 if (tmp > max) max = tmp;
13298 for (i = 0; max; i++)
13304 if eval $compile_ok; then
13308 echo "(I can't seem to compile the test program...)"
13315 rp="How many bits does your $randfunc() function produce?"
13319 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
13320 seedfunc="s$randfunc"
13321 randseedtype=unsigned
13325 rp="How many bits does your $randfunc() function produce?"
13328 seedfunc="s$randfunc"
13329 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
13330 if set $seedfunc val -f; eval $csym; $val; then
13331 echo "(Using $seedfunc() to seed random generator)"
13333 echo "(Warning: no $seedfunc() to seed random generator)"
13336 randseedtype=unsigned
13344 echo "Determining whether or not we are on an EBCDIC system..." >&4
13345 $cat >tebcdic.c <<'EOM'
13348 if ('M'==0xd4) return 0;
13355 if eval $compile_ok; then
13357 echo "You seem to speak EBCDIC." >&4
13360 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF8." >&4
13363 echo "I'm unable to compile the test program." >&4
13364 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
13366 $rm -f tebcdic.c tebcdic
13372 Checking how to flush all pending stdio output...
13374 # I only know how to find the first 32 possibly open files on SunOS.
13375 # See also hints/sunos_4_1.sh and util.c --AD
13377 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
13379 $cat >>try.c <<EOCP
13381 #$i_unistd I_UNISTD
13383 # include <unistd.h>
13385 #$d_sysconf HAS_SYSCONF
13386 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
13387 #ifdef HAS_STDIO_STREAM_ARRAY
13388 # define STDIO_STREAM_ARRAY $stdio_stream_array
13391 FILE* p = fopen("try.out", "w");
13395 # ifdef TRY_FPRINTF
13399 #ifdef TRY_FFLUSH_NULL
13402 #ifdef TRY_FFLUSH_ALL
13404 long open_max = -1;
13405 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
13406 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
13408 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
13409 open_max = sysconf(_SC_OPEN_MAX);
13412 open_max = FOPEN_MAX;
13415 open_max = OPEN_MAX;
13424 # ifdef HAS_STDIO_STREAM_ARRAY
13425 if (open_max > 0) {
13427 for (i = 0; i < open_max; i++)
13428 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
13429 STDIO_STREAM_ARRAY[i]._file < open_max &&
13430 STDIO_STREAM_ARRAY[i]._flag)
13431 fflush(&STDIO_STREAM_ARRAY[i]);
13439 : first we have to find out how _not_ to flush
13440 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
13442 set try -DTRY_FPUTC
13443 if eval $compile; then
13445 ./try$exe_ext 2>/dev/null
13446 if $test ! -s try.out -a "X$?" = X42; then
13452 set try -DTRY_FPRINTF
13454 if eval $compile; then
13456 ./try$exe_ext 2>/dev/null
13457 if $test ! -s try.out -a "X$?" = X42; then
13458 output=-DTRY_FPRINTF
13464 : check for fflush NULL behaviour
13465 case "$fflushNULL" in
13466 '') set try -DTRY_FFLUSH_NULL $output
13467 if eval $compile; then
13469 ./try$exe_ext 2>/dev/null
13471 if $test -s try.out -a "X$code" = X42; then
13472 fflushNULL="`$cat try.out`"
13474 if $test "X$code" != X42; then
13476 (If this test failed, don't worry, we'll try another method shortly.)
13481 $rm -f core try.core core.try.*
13482 case "$fflushNULL" in
13484 Your fflush(NULL) works okay for output streams.
13485 Let's see if it clobbers input pipes...
13487 # As of mid-March 2000 all versions of Solaris appear to have a stdio
13488 # bug that improperly flushes the input end of pipes. So we avoid the
13489 # autoflush on fork/system/exec support for now. :-(
13490 $cat >tryp.c <<EOCP
13493 main(int argc, char **argv)
13499 while ((i = getc(stdin)) != -1
13500 && (*bp++ = i) != '\n'
13501 && bp < &buf[1024])
13504 fprintf(stdout, "%s", buf);
13512 fflushNULL="$define"
13514 if eval $compile; then
13516 $cat tryp.c | ./tryp$exe_ext 2>/dev/null > tryp.out
13517 if cmp tryp.c tryp.out >/dev/null 2>&1; then
13519 fflush(NULL) seems to behave okay with input streams.
13521 fflushNULL="$define"
13524 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
13526 fflushNULL="$undef"
13529 $rm -f core tryp.c tryp.core core.tryp.*
13532 Your fflush(NULL) isn't working (contrary to ANSI C).
13534 fflushNULL="$undef"
13537 Cannot figure out whether your fflush(NULL) works or not.
13538 I'm assuming it doesn't (contrary to ANSI C).
13540 fflushNULL="$undef"
13544 $define|true|[yY]*)
13545 fflushNULL="$define"
13548 fflushNULL="$undef"
13551 : check explicit looping only if NULL did not work, and if the pipe
13552 : bug does not show up on an explicit flush too
13553 case "$fflushNULL" in
13555 $cat >tryp.c <<EOCP
13558 main(int argc, char **argv)
13564 while ((i = getc(stdin)) != -1
13565 && (*bp++ = i) != '\n'
13566 && bp < &buf[1024])
13569 fprintf(stdout, "%s", buf);
13578 if eval $compile; then
13580 $cat tryp.c | ./tryp$exe_ext 2>/dev/null > tryp.out
13581 if cmp tryp.c tryp.out >/dev/null 2>&1; then
13583 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
13585 : now check for fflushall behaviour
13586 case "$fflushall" in
13587 '') set try -DTRY_FFLUSH_ALL $output
13588 if eval $compile; then
13590 (Now testing the other method--but note that this also may fail.)
13593 ./try$exe_ext 2>/dev/null
13594 if $test -s try.out -a "X$?" = X42; then
13595 fflushall="`$cat try.out`"
13598 $rm -f core try.core core.try.*
13599 case "$fflushall" in
13601 Whew. Flushing explicitly all the stdio streams works.
13603 fflushall="$define"
13606 Sigh. Flushing explicitly all the stdio streams doesn't work.
13611 Cannot figure out whether flushing stdio streams explicitly works or not.
13612 I'm assuming it doesn't.
13618 "$define"|true|[yY]*)
13619 fflushall="$define"
13627 All is futile. Even fflush(stdin) clobbers input pipes!
13634 $rm -f core tryp.c tryp.core core.tryp.*
13636 *) fflushall="$undef"
13640 case "$fflushNULL$fflushall" in
13643 OK, I give up. I cannot figure out how to flush pending stdio output.
13644 We won't be flushing handles at all before fork/exec/popen.
13648 $rm -f try.* try$exe_ext
13650 : Store the full pathname to the ar program for use in the C program
13651 : Respect a hint or command line value for full_ar.
13656 : Store the full pathname to the sed program for use in the C program
13659 : see what type gids are declared as in the kernel
13661 echo "Looking for the type for group ids returned by getgid()."
13662 set gid_t gidtype xxx stdio.h sys/types.h
13666 xxx=`./findhdr sys/user.h`
13667 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
13669 unsigned) dflt="$1 $2" ;;
13673 *) dflt="$gidtype";;
13676 gid_t) echo "gid_t found." ;;
13677 *) rp="What is the type for group ids returned by getgid()?"
13685 *_t) zzz="$gidtype" ;;
13688 echo "Checking the size of $zzz..." >&4
13690 #include <sys/types.h>
13693 printf("%d\n", (int)sizeof($gidtype));
13698 if eval $compile_ok; then
13702 echo "(I can't execute the test program--guessing $gidsize.)" >&4
13705 echo "Your $zzz is $gidsize bytes long."
13710 echo "(I can't compile the test program--guessing $gidsize.)" >&4
13716 *_t) zzz="$gidtype" ;;
13719 echo "Checking the sign of $zzz..." >&4
13721 #include <sys/types.h>
13732 if eval $compile; then
13736 echo "(I can't execute the test program--guessing unsigned.)" >&4
13740 1) echo "Your $zzz is unsigned." ;;
13741 -1) echo "Your $zzz is signed." ;;
13747 echo "(I can't compile the test program--guessing unsigned.)" >&4
13753 if $test X"$quadtype" != X; then
13755 echo "Checking how to print 64-bit integers..." >&4
13757 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
13758 $cat >try.c <<'EOCP'
13759 #include <sys/types.h>
13762 int q = 12345678901;
13763 printf("%ld\n", q);
13767 if eval $compile; then
13768 yyy=`./try$exe_ext`
13771 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
13772 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
13773 echo "We will use %d."
13779 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
13780 $cat >try.c <<'EOCP'
13781 #include <sys/types.h>
13784 long q = 12345678901;
13785 printf("%ld\n", q);
13789 if eval $compile; then
13790 yyy=`./try$exe_ext`
13793 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
13794 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
13795 echo "We will use %ld."
13801 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
13802 $cat >try.c <<'EOCP'
13803 #include <sys/types.h>
13804 #include <inttypes.h>
13807 int64_t q = 12345678901;
13808 printf("%" PRId64 "\n", q);
13812 if eval $compile; then
13813 yyy=`./try$exe_ext`
13816 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
13817 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
13818 echo "We will use the C9X style."
13824 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
13825 $cat >try.c <<'EOCP'
13826 #include <sys/types.h>
13829 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
13830 printf("%lld\n", q);
13834 if eval $compile; then
13835 yyy=`./try$exe_ext`
13838 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
13839 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
13840 echo "We will use the %lld style."
13846 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
13848 #include <sys/types.h>
13851 $quadtype q = 12345678901;
13852 printf("%Ld\n", q);
13856 if eval $compile; then
13857 yyy=`./try$exe_ext`
13860 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
13861 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
13862 echo "We will use %Ld."
13868 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
13870 #include <sys/types.h>
13873 $quadtype q = 12345678901;
13874 printf("%qd\n", q);
13878 if eval $compile; then
13879 yyy=`./try$exe_ext`
13882 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
13883 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
13884 echo "We will use %qd."
13890 if $test X"$sPRId64" = X; then
13891 echo "Cannot figure out how to print 64-bit integers." >&4
13899 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
13900 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
13902 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
13903 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
13909 $echo "Checking the format strings to be used for Perl's internal types..." >&4
13911 if $test X"$ivsize" = X8; then
13912 ivdformat="$sPRId64"
13913 uvuformat="$sPRIu64"
13914 uvoformat="$sPRIo64"
13915 uvxformat="$sPRIx64"
13916 uvXUformat="$sPRIXU64"
13918 if $test X"$ivsize" = X"$longsize"; then
13925 if $test X"$ivsize" = X"$intsize"; then
13933 if $test X"$ivsize" = X"$shortsize"; then
13944 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
13945 nveformat="$sPRIeldbl"
13946 nvfformat="$sPRIfldbl"
13947 nvgformat="$sPRIgldbl"
13948 nvEUformat="$sPRIEUldbl"
13949 nvFUformat="$sPRIFUldbl"
13950 nvGUformat="$sPRIGUldbl"
13960 case "$ivdformat" in
13961 '') echo "$0: Fatal: failed to find format strings, cannot continue." >& 4
13968 $echo "Checking the format string to be used for gids..." >&4
13971 -1) if $test X"$gidsize" = X"$ivsize"; then
13972 gidformat="$ivdformat"
13974 if $test X"$gidsize" = X"$longsize"; then
13977 if $test X"$gidsize" = X"$intsize"; then
13980 if $test X"$gidsize" = X"$shortsize"; then
13987 *) if $test X"$gidsize" = X"$uvsize"; then
13988 gidformat="$uvuformat"
13990 if $test X"$gidsize" = X"$longsize"; then
13993 if $test X"$gidsize" = X"$intsize"; then
13996 if $test X"$gidsize" = X"$shortsize"; then
14005 : see if getgroups exists
14006 set getgroups d_getgrps
14009 : see if setgroups exists
14010 set setgroups d_setgrps
14014 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
14016 case "$d_getgrps$d_setgrps" in
14018 case "$groupstype" in
14019 '') dflt="$gidtype" ;;
14020 *) dflt="$groupstype" ;;
14023 What type of pointer is the second argument to getgroups() and setgroups()?
14024 Usually this is the same as group ids, $gidtype, but not always.
14027 rp='What type pointer is the second argument to getgroups() and setgroups()?'
14031 *) groupstype="$gidtype";;
14035 echo "Checking if your $make program sets \$(MAKE)..." >&4
14036 case "$make_set_make" in
14038 $sed 's/^X //' > testmake.mak << 'EOF'
14040 X @echo 'maketemp="$(MAKE)"'
14042 case "`$make -f testmake.mak 2>/dev/null`" in
14043 *maketemp=*) make_set_make='#' ;;
14044 *) make_set_make="MAKE=$make" ;;
14046 $rm -f testmake.mak
14049 case "$make_set_make" in
14050 '#') echo "Yup, it does.";;
14051 *) echo "Nope, it doesn't.";;
14054 : see what type is used for mode_t
14055 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
14056 set mode_t modetype int stdio.h sys/types.h
14059 : see if stdarg is available
14061 if $test `./findhdr stdarg.h`; then
14062 echo "<stdarg.h> found." >&4
14065 echo "<stdarg.h> NOT found." >&4
14069 : see if varags is available
14071 if $test `./findhdr varargs.h`; then
14072 echo "<varargs.h> found." >&4
14074 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
14077 : set up the varargs testing programs
14078 $cat > varargs.c <<EOP
14080 #include <stdarg.h>
14083 #include <varargs.h>
14087 int f(char *p, ...)
14101 p = va_arg(ap, char *);
14106 $cat > varargs <<EOP
14108 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
14117 : now check which varargs header should be included
14122 if `./varargs I_STDARG`; then
14124 elif `./varargs I_VARARGS`; then
14129 if `./varargs I_VARARGS`; then
14136 echo "I could not find the definition for va_dcl... You have problems..." >&4
14137 val="$undef"; set i_stdarg; eval $setvar
14138 val="$undef"; set i_varargs; eval $setvar
14143 case "$i_varhdr" in
14145 val="$define"; set i_stdarg; eval $setvar
14146 val="$undef"; set i_varargs; eval $setvar
14149 val="$undef"; set i_stdarg; eval $setvar
14150 val="$define"; set i_varargs; eval $setvar
14153 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
14157 : see if we need va_copy
14159 case "$i_stdarg" in
14162 #include <stdarg.h>
14164 #$i_stdlib I_STDLIB
14166 #include <stdlib.h>
14168 #include <signal.h>
14171 ivfprintf(FILE *f, const char *fmt, va_list *valp)
14173 return vfprintf(f, fmt, *valp);
14177 myvfprintf(FILE *f, const char *fmt, va_list val)
14179 return ivfprintf(f, fmt, &val);
14183 myprintf(char *fmt, ...)
14186 va_start(val, fmt);
14187 return myvfprintf(stdout, fmt, val);
14191 main(int ac, char **av)
14193 signal(SIGSEGV, exit);
14195 myprintf("%s%cs all right, then\n", "that", '\'');
14200 if eval $compile && ./try 2>&1 >/dev/null; then
14202 "that's all right, then")
14208 yes) echo "It seems that you don't need va_copy()." >&4
14209 need_va_copy="$undef"
14211 *) echo "It seems that va_copy() or similar will be needed." >&4
14212 need_va_copy="$define"
14215 $rm -f try.* core core.* *.core *.core.*
14217 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
14221 : define a fucntion to check prototypes
14222 $cat > protochk <<EOSH
14225 optimize="$optimize"
14227 prototype="$prototype"
14232 $cat >> protochk <<'EOSH'
14237 while test $# -ge 2; do
14239 $define) echo "#include <$2>" >> try.c ;;
14240 literal) echo "$2" >> try.c ;;
14244 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
14245 cat >> try.c <<'EOCP'
14246 #ifdef CAN_PROTOTYPE
14247 #define _(args) args
14252 echo "$foo" >> try.c
14253 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
14254 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
14260 $eunicefix protochk
14262 : see what type is used for size_t
14263 rp="What is the type used for the length parameter for string functions?"
14264 set size_t sizetype 'unsigned int' stdio.h sys/types.h
14267 : check for type of arguments to gethostbyaddr.
14268 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
14269 case "$d_gethbyaddr" in
14273 Checking to see what type of arguments are accepted by gethostbyaddr().
14275 hdrs="$define sys/types.h
14276 $d_socket sys/socket.h
14277 $i_niin netinet/in.h
14279 $i_unistd unistd.h"
14280 : The first arg can 'char *' or 'void *'
14281 : The second arg is some of integral type
14282 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
14283 for yyy in size_t long int; do
14284 case "$netdb_host_type" in
14285 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
14286 if ./protochk "$try" $hdrs; then
14287 echo "Your system accepts $xxx for the first arg."
14288 echo "...and $yyy for the second arg."
14289 netdb_host_type="$xxx"
14290 netdb_hlen_type="$yyy"
14296 : In case none of those worked, prompt the user.
14297 case "$netdb_host_type" in
14298 '') rp='What is the type for the 1st argument to gethostbyaddr?'
14301 netdb_host_type=$ans
14302 rp='What is the type for the 2nd argument to gethostbyaddr?'
14305 netdb_hlen_type=$ans
14309 *) : no gethostbyaddr, so pick harmless defaults
14310 netdb_host_type='char *'
14311 netdb_hlen_type="$sizetype"
14314 # Remove the "const" if needed. -- but then we'll have a
14316 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
14319 : check for type of argument to gethostbyname.
14320 if test "X$netdb_name_type" = X ; then
14321 case "$d_gethbyname" in
14325 Checking to see what type of argument is accepted by gethostbyname().
14327 hdrs="$define sys/types.h
14328 $d_socket sys/socket.h
14329 $i_niin netinet/in.h
14331 $i_unistd unistd.h"
14332 for xxx in "const char *" "char *"; do
14333 case "$netdb_name_type" in
14334 '') try="extern struct hostent *gethostbyname($xxx);"
14335 if ./protochk "$try" $hdrs; then
14336 echo "Your system accepts $xxx."
14337 netdb_name_type="$xxx"
14342 : In case none of those worked, prompt the user.
14343 case "$netdb_name_type" in
14344 '') rp='What is the type for the 1st argument to gethostbyname?'
14347 netdb_name_type=$ans
14351 *) : no gethostbyname, so pick harmless default
14352 netdb_name_type='char *'
14357 : check for type of 1st argument to getnetbyaddr.
14358 if test "X$netdb_net_type" = X ; then
14359 case "$d_getnbyaddr" in
14363 Checking to see what type of 1st argument is accepted by getnetbyaddr().
14365 hdrs="$define sys/types.h
14366 $d_socket sys/socket.h
14367 $i_niin netinet/in.h
14369 $i_unistd unistd.h"
14370 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
14371 case "$netdb_net_type" in
14372 '') try="extern struct netent *getnetbyaddr($xxx, int);"
14373 if ./protochk "$try" $hdrs; then
14374 echo "Your system accepts $xxx."
14375 netdb_net_type="$xxx"
14380 : In case none of those worked, prompt the user.
14381 case "$netdb_net_type" in
14382 '') rp='What is the type for the 1st argument to getnetbyaddr?'
14385 netdb_net_type=$ans
14389 *) : no getnetbyaddr, so pick harmless default
14390 netdb_net_type='long'
14394 : locate the preferred pager for this system
14400 [a-zA-Z]:/*) dflt=$pg;;
14404 [a-zA-Z]:/*) dflt=$more;;
14408 [a-zA-Z]:/*) dflt=$less;;
14411 '') dflt=/usr/ucb/more;;
14418 rp='What pager is used on your system?'
14422 : see what type pids are declared as in the kernel
14423 rp="What is the type of process ids on this system?"
14424 set pid_t pidtype int stdio.h sys/types.h
14427 : Find earliest binary compatible site_perl subdirectory perl can use.
14428 case "$bincompat5005" in
14429 "$define") xs_apiversion='5.005' ;;
14430 *) xs_apiversion=$version ;; # The current site_perl version.
14432 : Find earliest pure perl site_perl subdirectory perl can use.
14433 : The versioned directories started at 5.005.
14434 pm_apiversion='5.005'
14436 : see if ar generates random libraries by itself
14438 echo "Checking how to generate random libraries on your machine..." >&4
14439 echo 'int bar1() { return bar2(); }' > bar1.c
14440 echo 'int bar2() { return 2; }' > bar2.c
14441 $cat > foo.c <<'EOP'
14442 int main() { printf("%d\n", bar1()); exit(0); }
14444 $cc $ccflags -c bar1.c >/dev/null 2>&1
14445 $cc $ccflags -c bar2.c >/dev/null 2>&1
14446 $cc $ccflags -c foo.c >/dev/null 2>&1
14447 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
14448 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
14449 ./foobar >/dev/null 2>&1; then
14450 echo "$ar appears to generate random libraries itself."
14453 elif $ar ts bar$_a >/dev/null 2>&1 &&
14454 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
14455 ./foobar >/dev/null 2>&1; then
14456 echo "a table of contents needs to be added with '$ar ts'."
14463 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
14464 $test -f $ranlib || ranlib=''
14467 if $test -n "$ranlib"; then
14468 echo "your system has '$ranlib'; we'll use that."
14471 echo "your system doesn't seem to support random libraries"
14472 echo "so we'll use lorder and tsort to order the libraries."
14479 : check for type of arguments to select.
14480 case "$selecttype" in
14481 '') case "$d_select" in
14485 Checking to see what type of arguments are accepted by select().
14487 hdrs="$define sys/types.h
14488 $i_systime sys/time.h
14489 $i_sysselct sys/select.h
14490 $d_socket sys/socket.h"
14491 : The first arg can be int, unsigned, or size_t
14492 : The last arg may or may not be 'const'
14494 : void pointer has been seen but using that
14495 : breaks the selectminbits test
14496 for xxx in 'fd_set *' 'int *'; do
14497 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
14498 for tmo in 'struct timeval *' 'const struct timeval *'; do
14500 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
14501 if ./protochk "$try" $hdrs; then
14502 echo "Your system accepts $xxx."
14511 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
14512 case "$d_fd_set" in
14513 $define) dflt="fd_set *" ;;
14522 *) : no select, so pick a harmless default
14529 : check for the select 'width'
14530 case "$selectminbits" in
14531 '') case "$d_select" in
14535 Checking to see on how many bits at a time your select() operates...
14538 #include <sys/types.h>
14540 #$i_systime I_SYS_TIME
14541 #$i_systimek I_SYS_TIME_KERNEL
14546 # ifdef I_SYS_TIME_KERNEL
14549 # include <sys/time.h>
14550 # ifdef I_SYS_TIME_KERNEL
14554 #$i_sysselct I_SYS_SELECT
14555 #ifdef I_SYS_SELECT
14556 #include <sys/select.h>
14558 #$d_socket HAS_SOCKET
14560 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
14564 #define S sizeof(*(b))
14566 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
14567 #define NBITS (NBYTES * 8)
14576 fp = fopen("try.c", "r");
14582 b = ($selecttype)s;
14583 for (i = 0; i < NBITS; i++)
14587 select(fd + 1, b, 0, 0, &t);
14588 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
14589 printf("%d\n", i + 1);
14594 if eval $compile_ok; then
14595 selectminbits=`./try`
14596 case "$selectminbits" in
14598 Cannot figure out on how many bits at a time your select() operates.
14599 I'll play safe and guess it is 32 bits.
14605 *) bits="$selectminbits bits" ;;
14607 echo "Your select() operates on $bits at a time." >&4
14609 rp='What is the minimum number of bits your select() operates on?'
14610 case "$byteorder" in
14611 1234|12345678) dflt=32 ;;
14616 selectminbits="$val"
14620 *) : no select, so pick a harmless default
14627 : Trace out the files included by signal.h, then look for SIGxxx names.
14628 : Remove SIGARRAYSIZE used by HPUX.
14629 : Remove SIGSTKSIZE used by Linux.
14630 : Remove SIGSTKSZ used by Posix.
14631 : Remove SIGTYP void lines used by OS2.
14632 : Some cpps, like os390, dont give the file name anywhere
14633 if [ "X$fieldn" = X ]; then
14634 : Just make some guesses. We check them later.
14635 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
14637 xxx=`echo '#include <signal.h>' |
14638 $cppstdin $cppminus $cppflags 2>/dev/null |
14639 $grep '^[ ]*#.*include' |
14640 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
14642 : Check this list of files to be sure we have parsed the cpp output ok.
14643 : This will also avoid potentially non-existent files, such
14646 for xx in $xxx /dev/null ; do
14647 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
14649 : If we have found no files, at least try signal.h
14650 case "$xxxfiles" in
14651 '') xxxfiles=`./findhdr signal.h` ;;
14654 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
14655 print substr($2, 4, 20)
14657 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
14658 print substr($3, 4, 20)
14660 : Append some common names just in case the awk scan failed.
14661 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
14662 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
14663 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
14664 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
14665 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
14667 : generate a few handy files for later
14668 $cat > signal.c <<'EOCP'
14669 #include <sys/types.h>
14670 #include <signal.h>
14674 /* Strange style to avoid deeply-nested #if/#else/#endif */
14677 # define NSIG (_NSIG)
14683 # define NSIG (SIGMAX+1)
14689 # define NSIG (SIG_MAX+1)
14695 # define NSIG (MAXSIG+1)
14701 # define NSIG (MAX_SIG+1)
14706 # ifdef SIGARRAYSIZE
14707 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
14713 # define NSIG (_sys_nsig) /* Solaris 2.5 */
14717 /* Default to some arbitrary number that's big enough to get most
14718 of the common signals.
14724 printf("NSIG %d\n", NSIG);
14730 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
14732 printf "#ifdef SIG"; printf $1; printf "\n"
14733 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
14734 printf $1; printf ");\n"
14738 printf "#endif /* JUST_NSIG */\n";
14739 printf "exit(0);\n}\n";
14742 $cat >signal.awk <<'EOP'
14743 BEGIN { ndups = 0 }
14744 $1 ~ /^NSIG$/ { nsig = $2 }
14745 ($1 !~ /^NSIG$/) && (NF == 2) {
14746 if ($2 > maxsig) { maxsig = $2 }
14747 if (sig_name[$2]) {
14748 dup_name[ndups] = $1
14749 dup_num[ndups] = $2
14761 printf("NSIG %d\n", nsig);
14762 for (n = 1; n < nsig; n++) {
14764 printf("%s %d\n", sig_name[n], sig_num[n])
14767 printf("NUM%d %d\n", n, n)
14770 for (n = 0; n < ndups; n++) {
14771 printf("%s %d\n", dup_name[n], dup_num[n])
14775 $cat >signal_cmd <<EOS
14777 if $test -s signal.lst; then
14778 echo "Using your existing signal.lst file"
14783 $cat >>signal_cmd <<'EOS'
14786 if eval $compile_ok; then
14787 ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
14789 echo "(I can't seem be able to compile the whole test program)" >&4
14790 echo "(I'll try it in little pieces.)" >&4
14791 set signal -DJUST_NSIG
14792 if eval $compile_ok; then
14793 ./signal$_exe > signal.nsg
14796 echo "I can't seem to figure out how many signals you have." >&4
14797 echo "Guessing 50." >&4
14798 echo 'NSIG 50' > signal.nsg
14800 : Now look at all the signal names, one at a time.
14801 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
14802 $cat > signal.c <<EOCP
14803 #include <sys/types.h>
14804 #include <signal.h>
14807 printf("$xx %d\n", SIG${xx});
14812 if eval $compile; then
14813 echo "SIG${xx} found."
14814 ./signal$_exe >> signal.ls1
14816 echo "SIG${xx} NOT found."
14819 if $test -s signal.ls1; then
14820 $cat signal.nsg signal.ls1 |
14821 $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
14825 if $test -s signal.lst; then
14828 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
14829 echo 'kill -l' >signal
14830 set X `csh -f <signal`
14834 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
14836 echo $@ | $tr ' ' $trnl | \
14837 $awk '{ printf "%s %d\n", $1, ++s; }
14838 END { printf "NSIG %d\n", ++s }' >signal.lst
14840 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
14842 chmod a+x signal_cmd
14843 $eunicefix signal_cmd
14845 : generate list of signal names
14847 case "$sig_name_init" in
14849 *) case "$sig_num_init" in
14850 ''|*,*) doinit=yes ;;
14855 echo "Generating a list of signal names and numbers..." >&4
14857 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
14858 sig_name=`$awk 'BEGIN { printf "ZERO " }
14859 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
14860 sig_num=`$awk 'BEGIN { printf "0 " }
14861 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
14862 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
14863 !/^NSIG/ { printf "\"%s\", ", $1 }
14864 END { printf "0\n" }' signal.lst`
14865 sig_num_init=`$awk 'BEGIN { printf "0, " }
14866 !/^NSIG/ { printf "%d, ", $2}
14867 END { printf "0\n"}' signal.lst`
14870 echo "The following $sig_count signals are available:"
14872 echo $sig_name | $awk \
14873 'BEGIN { linelen = 0 }
14875 for (i = 1; i <= NF; i++) {
14876 name = "SIG" $i " "
14877 linelen = linelen + length(name)
14878 if (linelen > 70) {
14880 linelen = length(name)
14886 sig_size=`echo $sig_name | awk '{print NF}'`
14887 $rm -f signal signal.c signal.awk signal.lst signal_cmd
14890 case "$sizetype" in
14891 *_t) zzz="$sizetype" ;;
14892 *) zzz="filesize" ;;
14894 echo "Checking the size of $zzz..." >&4
14896 #include <sys/types.h>
14899 printf("%d\n", (int)sizeof($sizetype));
14904 if eval $compile_ok; then
14908 echo "(I can't execute the test program--guessing $sizesize.)" >&4
14911 echo "Your $zzz size is $sizesize bytes."
14916 echo "(I can't compile the test program--guessing $sizesize.)" >&4
14920 : check for socklen_t
14922 echo "Checking to see if you have socklen_t..." >&4
14924 #include <sys/types.h>
14925 #$d_socket HAS_SOCKET
14927 #include <sys/socket.h>
14929 int main() { socklen_t x = 16; }
14932 if eval $compile; then
14934 echo "You have socklen_t."
14937 echo "You do not have socklen_t."
14938 case "$sizetype" in
14939 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
14946 : see if this is a socks.h system
14947 set socks.h i_socks
14950 : check for type of the size argument to socket calls
14951 case "$d_socket" in
14955 Checking to see what type is the last argument of accept().
14958 case "$d_socklen_t" in
14959 "$define") yyy="$yyy socklen_t"
14961 yyy="$yyy $sizetype int long unsigned"
14962 for xxx in $yyy; do
14963 case "$socksizetype" in
14964 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
14965 case "$usesocks" in
14967 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
14968 echo "Your system accepts '$xxx *' for the last argument of accept()."
14969 socksizetype="$xxx"
14972 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
14973 echo "Your system accepts '$xxx *' for the last argument of accept()."
14974 socksizetype="$xxx"
14981 : In case none of those worked, prompt the user.
14982 case "$socksizetype" in
14983 '') rp='What is the type for socket address structure sizes?'
14990 *) : no sockets, so pick relatively harmless default
14995 : see what type is used for signed size_t
14996 set ssize_t ssizetype int stdio.h sys/types.h
14999 $cat > ssize.c <<EOM
15001 #include <sys/types.h>
15002 #define Size_t $sizetype
15003 #define SSize_t $dflt
15006 if (sizeof(Size_t) == sizeof(SSize_t))
15008 else if (sizeof(Size_t) == sizeof(int))
15017 if eval $compile_ok && ./ssize > /dev/null; then
15018 ssizetype=`./ssize`
15019 echo "I'll be using $ssizetype for functions returning a byte count." >&4
15022 Help! I can't compile and run the ssize_t test program: please enlighten me!
15023 (This is probably a misconfiguration in your system or libraries, and
15024 you really ought to fix it. Still, I'll try anyway.)
15026 I need a type that is the same size as $sizetype, but is guaranteed to
15027 be signed. Common values are ssize_t, int and long.
15030 rp="What signed type is the same size as $sizetype?"
15034 $rm -f ssize ssize.*
15036 : see what type of char stdio uses.
15038 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
15039 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
15040 echo "Your stdio uses unsigned chars." >&4
15041 stdchar="unsigned char"
15043 echo "Your stdio uses signed chars." >&4
15050 : see if time exists
15052 if test "X$d_time" = X -o X"$timetype" = X; then
15053 if set time val -f d_time; eval $csym; $val; then
15054 echo 'time() found.' >&4
15056 rp="What is the type returned by time() on this system?"
15057 set time_t timetype long stdio.h sys/types.h
15060 echo 'time() not found, hope that will do.' >&4
15068 : see what type uids are declared as in the kernel
15070 echo "Looking for the type for user ids returned by getuid()."
15071 set uid_t uidtype xxx stdio.h sys/types.h
15075 xxx=`./findhdr sys/user.h`
15076 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
15078 unsigned) dflt="$1 $2" ;;
15082 *) dflt="$uidtype";;
15085 uid_t) echo "uid_t found." ;;
15086 *) rp="What is the type for user ids returned by getuid()?"
15094 *_t) zzz="$uidtype" ;;
15097 echo "Checking the size of $zzz..." >&4
15099 #include <sys/types.h>
15102 printf("%d\n", (int)sizeof($uidtype));
15107 if eval $compile_ok; then
15111 echo "(I can't execute the test program--guessing $uidsize.)" >&4
15114 echo "Your $zzz is $uidsize bytes long."
15119 echo "(I can't compile the test program--guessing $uidsize.)" >&4
15124 *_t) zzz="$uidtype" ;;
15127 echo "Checking the sign of $zzz..." >&4
15129 #include <sys/types.h>
15140 if eval $compile; then
15144 echo "(I can't execute the test program--guessing unsigned.)" >&4
15148 1) echo "Your $zzz is unsigned." ;;
15149 -1) echo "Your $zzz is signed." ;;
15155 echo "(I can't compile the test program--guessing unsigned.)" >&4
15161 $echo "Checking the format string to be used for uids..." >&4
15164 -1) if $test X"$uidsize" = X"$ivsize"; then
15165 uidformat="$ivdformat"
15167 if $test X"$uidsize" = X"$longsize"; then
15170 if $test X"$uidsize" = X"$intsize"; then
15173 if $test X"$uidsize" = X"$shortsize"; then
15180 *) if $test X"$uidsize" = X"$uvsize"; then
15181 uidformat="$uvuformat"
15183 if $test X"$uidsize" = X"$longsize"; then
15186 if $test X"$uidsize" = X"$intsize"; then
15189 if $test X"$uidsize" = X"$shortsize"; then
15198 : determine compiler compiler
15207 if $test -f "$byacc"; then
15209 comp="byacc or $comp"
15211 if $test -f "$bison"; then
15212 comp="$comp or bison -y"
15214 rp="Which compiler compiler ($comp) shall I use?"
15223 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
15229 : see if dbm.h is available
15230 : see if dbmclose exists
15231 set dbmclose d_dbmclose
15234 case "$d_dbmclose" in
15244 *) set rpcsvc/dbm.h i_rpcsvcdbm
15249 *) echo "We won't be including <dbm.h>"
15259 : see if this is a sys/file.h system
15264 : do we need to include sys/file.h ?
15268 if $h_sysfile; then
15270 echo "We'll be including <sys/file.h>." >&4
15273 echo "We won't be including <sys/file.h>." >&4
15283 : see if fcntl.h is there
15288 : see if we can include fcntl.h
15294 echo "We'll be including <fcntl.h>." >&4
15297 if $h_sysfile; then
15298 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
15300 echo "We won't be including <fcntl.h>." >&4
15312 : see if this is a iconv.h system
15313 set iconv.h i_iconv
15316 : see if this is a ieeefp.h system
15317 set ieeefp.h i_ieeefp
15320 : see if this is a libutil.h system
15321 set libutil.h i_libutil
15324 : see if locale.h is available
15325 set locale.h i_locale
15328 : see if mach cthreads are available
15329 if test "X$usethreads" = "X$define"; then
15330 set mach/cthreads.h i_machcthr
15333 i_machcthr="$undef"
15338 : see if this is a math.h system
15342 : see if this is a mntent.h system
15343 set mntent.h i_mntent
15346 : see if ndbm.h is available
15351 : see if dbm_open exists
15352 set dbm_open d_dbm_open
15354 case "$d_dbm_open" in
15357 echo "We won't be including <ndbm.h>"
15366 : see if net/errno.h is available
15368 set net/errno.h val
15371 : Unfortunately, it causes problems on some systems. Arrgh.
15374 cat > try.c <<'EOM'
15377 #include <net/errno.h>
15383 if $cc $ccflags -c try.c >/dev/null 2>&1; then
15384 echo "We'll be including <net/errno.h>." >&4
15386 echo "We won't be including <net/errno.h>." >&4
15395 : see if netinet/tcp.h is available
15396 set netinet/tcp.h i_netinettcp
15399 : see if this is a poll.h system
15403 : see if this is a prot.h system
15408 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
15409 $cat <<'EOSH' > Cppsym.know
15410 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
15411 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
15412 alliant alpha am29000 AM29000 AMD64 amiga AMIGAOS AMIX
15413 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
15414 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
15415 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
15416 bull c cadmus clipper CMU COFF COMPILER_VERSION
15417 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
15418 CYGWIN DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
15419 Dynix DynixPTX ELF encore EPI EXTENSIONS FILE_OFFSET_BITS
15420 FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
15421 GNU_SOURCE GNUC GNUC_MINOR GO32 gould GOULD_PN
15422 H3050R H3050RX hbullx20 hcx host_mips
15423 hp200 hp300 hp700 HP700 hp800 hp9000
15424 hp9000s200 hp9000s300 hp9000s400 hp9000s500
15425 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
15426 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
15427 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
15428 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
15429 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
15430 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
15431 Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
15432 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
15433 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
15434 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
15435 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
15436 MATH_HAS_NO_SIDE_EFFECTS
15437 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
15438 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
15439 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
15440 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
15441 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
15442 NetBSD news1500 news1700 news1800 news1900 news3700
15443 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
15444 ns32016 ns32332 ns32k nsc32000
15445 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
15446 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
15447 pc532 pdp11 PGC PIC plexus PORTAR posix
15448 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
15449 POSIX_C_SOURCE POSIX_SOURCE POWER
15450 PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
15451 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
15452 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
15453 sony sony_news sonyrisc sparc sparclite spectrum
15454 stardent stdc STDC_EXT stratos sun sun3 sun386
15455 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
15456 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
15457 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
15458 sysV68 sysV88 Tek4132 Tek4300 titan
15459 TM3200 TM5400 TM5600
15460 tower tower32 tower32_200 tower32_600 tower32_700
15461 tower32_800 tower32_850 tss
15462 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
15463 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
15464 unix UNIX95 UNIX99 unixpc unos USGr4 USGr4_2
15465 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms xenix Xenix286
15466 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
15467 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
15470 # Maybe put other stuff here too.
15471 cat <<EOSH >>Cppsym.know
15474 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
15475 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
15476 $cat Cppsym.know > Cppsym.c
15477 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
15478 $rm -f Cppsym.a Cppsym.b Cppsym.c
15479 cat <<EOSH > Cppsym
15481 if $test \$# -gt 0; then
15482 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
15483 if $test -s Cppsym.got; then
15490 $tr " " "$trnl" | ./Cppsym.try
15496 cat <<EOSH > Cppsym.try
15498 cat <<'EOCP' > try.c
15504 cat <<'EOSH' >> Cppsym.try
15506 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
15507 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
15508 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
15509 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
15513 cat <<EOSH >> Cppsym.try
15515 case "$osname-$gccversion" in
15516 irix-) ccflags="\$ccflags -woff 1178" ;;
15517 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
15519 $cc -o try $optimize \$ccflags $ldflags try.c $libs && ./try$exe_ext
15521 chmod +x Cppsym.try
15522 $eunicefix Cppsym.try
15523 ./Cppsym < Cppsym.know > Cppsym.true
15524 : now check the C compiler for additional symbols
15525 postprocess_cc_v=''
15527 aix) postprocess_cc_v="|$tr , ' '" ;;
15534 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
15537 -D*) echo "\$i" | $sed 's/^-D//';;
15538 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
15543 postprocess_cc_v=''
15546 ./ccsym > ccsym1.raw
15547 if $test -s ccsym1.raw; then
15548 $sort ccsym1.raw | $uniq >ccsym.raw
15550 mv ccsym1.raw ccsym.raw
15553 $awk '/\=/ { print $0; next }
15554 { print $0"=1" }' ccsym.raw >ccsym.list
15555 $awk '/\=/ { print $0; next }
15556 { print $0"=1" }' Cppsym.true >ccsym.true
15557 $comm -13 ccsym.true ccsym.list >ccsym.own
15558 $comm -12 ccsym.true ccsym.list >ccsym.com
15559 $comm -23 ccsym.true ccsym.list >ccsym.cpp
15561 if $test -z ccsym.raw; then
15562 echo "Your C compiler doesn't seem to define any symbols!" >&4
15564 echo "However, your C preprocessor defines the following symbols:"
15567 cppsymbols=`$cat Cppsym.true`
15568 cppsymbols=`echo $cppsymbols`
15569 cppccsymbols="$cppsymbols"
15571 if $test -s ccsym.com; then
15572 echo "Your C compiler and pre-processor define these symbols:"
15573 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
15576 cppccsymbols=`$cat ccsym.com`
15577 cppccsymbols=`echo $cppccsymbols`
15578 $test "$silent" || sleep 1
15580 if $test -s ccsym.cpp; then
15581 $test "$also" && echo " "
15582 echo "Your C pre-processor ${also}defines the following symbols:"
15583 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
15585 cppsymbols=`$cat ccsym.cpp`
15586 cppsymbols=`echo $cppsymbols`
15587 $test "$silent" || sleep 1
15589 if $test -s ccsym.own; then
15590 $test "$also" && echo " "
15591 echo "Your C compiler ${also}defines the following cpp symbols:"
15592 $sed -e 's/\(..*\)=1/\1/' ccsym.own
15593 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
15594 ccsymbols=`$cat ccsym.own`
15595 ccsymbols=`echo $ccsymbols`
15596 $test "$silent" || sleep 1
15599 $rm -f ccsym* Cppsym.*
15601 : see if this is a termio system
15605 if $test `./findhdr termios.h`; then
15606 set tcsetattr i_termios
15612 "$define") echo "You have POSIX termios.h... good!" >&4;;
15613 *) if ./Cppsym pyr; then
15614 case "`/bin/universe`" in
15615 ucb) if $test `./findhdr sgtty.h`; then
15617 echo "<sgtty.h> found." >&4
15619 echo "System is pyramid with BSD universe."
15620 echo "<sgtty.h> not found--you could have problems." >&4
15622 *) if $test `./findhdr termio.h`; then
15624 echo "<termio.h> found." >&4
15626 echo "System is pyramid with USG universe."
15627 echo "<termio.h> not found--you could have problems." >&4
15631 if $test `./findhdr termio.h`; then
15632 echo "<termio.h> found." >&4
15634 elif $test `./findhdr sgtty.h`; then
15635 echo "<sgtty.h> found." >&4
15638 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
15641 if $test `./findhdr sgtty.h`; then
15642 echo "<sgtty.h> found." >&4
15644 elif $test `./findhdr termio.h`; then
15645 echo "<termio.h> found." >&4
15648 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
15652 set i_termio; eval $setvar
15653 val=$val2; set i_sgtty; eval $setvar
15654 val=$val3; set i_termios; eval $setvar
15656 : see if this is a shadow.h system
15657 set shadow.h i_shadow
15660 : see if stddef is available
15661 set stddef.h i_stddef
15664 : see if this is a sunmath.h system
15665 set sunmath.h i_sunmath
15668 : see if sys/access.h is available
15669 set sys/access.h i_sysaccess
15672 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
15673 set sys/filio.h i_sysfilio
15676 if $test `./findhdr sys/ioctl.h`; then
15678 echo '<sys/ioctl.h> found.' >&4
15681 if $test $i_sysfilio = "$define"; then
15682 echo '<sys/ioctl.h> NOT found.' >&4
15684 $test $i_sgtty = "$define" && xxx="sgtty.h"
15685 $test $i_termio = "$define" && xxx="termio.h"
15686 $test $i_termios = "$define" && xxx="termios.h"
15687 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
15693 : see if socket ioctl defs are in sys/sockio.h
15695 xxx=`./findhdr sys/sockio.h`
15696 if $test "$xxx"; then
15697 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
15699 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
15702 echo "No socket ioctls found in <sys/sockio.h>." >&4
15707 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
15714 : see if this is a syslog.h system
15715 set syslog.h i_syslog
15719 : see if this is a sys/mode.h system
15720 set sys/mode.h i_sysmode
15723 : see if sys/resource.h has to be included
15724 set sys/resource.h i_sysresrc
15727 : see if sys/security.h is available
15728 set sys/security.h i_syssecrt
15731 : see if this is a sys/statvfs.h system
15732 set sys/statvfs.h i_sysstatvfs
15735 : see if this is a sys/un.h system
15736 set sys/un.h i_sysun
15740 : see if this is a sys/utsname.h system
15741 set sys/utsname.h i_sysutsname
15744 : see if this is a syswait system
15745 set sys/wait.h i_syswait
15748 : see if this is a ustat.h system
15749 set ustat.h i_ustat
15752 : see if this is an utime system
15753 set utime.h i_utime
15756 : see if this is a values.h system
15757 set values.h i_values
15760 : see if this is a vfork system
15763 set vfork.h i_vfork
15771 : see if gdbm.h is available
15776 : see if gdbm_open exists
15777 set gdbm_open d_gdbm_open
15779 case "$d_gdbm_open" in
15782 echo "We won't be including <gdbm.h>"
15792 echo "Looking for extensions..." >&4
15793 : If we are using the old config.sh, known_extensions may contain
15794 : old or inaccurate or duplicate values.
15795 known_extensions=''
15796 nonxs_extensions=''
15797 : We do not use find because it might not be available.
15798 : We do not just use MANIFEST because the user may have dropped
15799 : some additional extensions into the source tree and expect them
15802 : Function to recursively find available extensions, ignoring DynaLoader
15803 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
15807 DynaLoader|dynaload) ;;
15809 if $test -f $xxx/$xxx.xs; then
15810 known_extensions="$known_extensions $1$xxx";
15811 elif $test -f $xxx/Makefile.PL; then
15812 nonxs_extensions="$nonxs_extensions $1$xxx";
15814 if $test -d $xxx -a $# -lt 10; then
15817 eval $find_extensions;
15829 eval $find_extensions
15830 set X $nonxs_extensions
15832 nonxs_extensions="$*"
15833 set X $known_extensions
15835 known_extensions="$*"
15838 : Now see which are supported on this system.
15840 for xxx in $known_extensions ; do
15844 $define) avail_ext="$avail_ext $xxx" ;;
15847 GDBM_File|gdbm_fil)
15849 $define) avail_ext="$avail_ext $xxx" ;;
15852 NDBM_File|ndbm_fil)
15855 case "$osname-$use64bitint" in
15858 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
15861 *) avail_ext="$avail_ext $xxx" ;;
15866 ODBM_File|odbm_fil)
15867 case "${i_dbm}${i_rpcsvcdbm}" in
15869 case "$osname-$use64bitint" in
15872 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
15875 *) avail_ext="$avail_ext $xxx" ;;
15881 case "$useposix" in
15882 true|define|y) avail_ext="$avail_ext $xxx" ;;
15886 case "$useopcode" in
15887 true|define|y) avail_ext="$avail_ext $xxx" ;;
15891 case "$d_socket" in
15892 true|$define|y) avail_ext="$avail_ext $xxx" ;;
15895 Sys/Syslog|sys/syslog)
15896 : XXX syslog requires socket
15897 case "$d_socket" in
15898 true|$define|y) avail_ext="$avail_ext $xxx" ;;
15902 case "$usethreads" in
15903 true|$define|y) avail_ext="$avail_ext $xxx" ;;
15907 : XXX Do we need a useipcsysv variable here
15908 case "${d_msg}${d_sem}${d_shm}" in
15909 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
15912 *) avail_ext="$avail_ext $xxx"
15921 : Now see which nonxs extensions are supported on this system.
15922 : For now assume all are.
15924 for xxx in $nonxs_extensions ; do
15926 *) nonxs_ext="$nonxs_ext $xxx"
15938 A number of extensions are supplied with $package. You may choose to
15939 compile these extensions for dynamic loading (the default), compile
15940 them into the $package executable (static loading), or not include
15941 them at all. Answer "none" to include no extensions.
15942 Note that DynaLoader is always built and need not be mentioned here.
15945 case "$dynamic_ext" in
15946 '') dflt="$avail_ext" ;;
15947 *) dflt="$dynamic_ext"
15948 # Perhaps we are reusing an old out-of-date config.sh.
15951 if test X"$dynamic_ext" != X"$avail_ext"; then
15953 NOTICE: Your previous config.sh list may be incorrect.
15954 The extensions now available to you are
15956 but the default list from your previous config.sh is
15968 rp="What extensions do you wish to load dynamically?"
15971 none) dynamic_ext=' ' ;;
15972 *) dynamic_ext="$ans" ;;
15975 case "$static_ext" in
15977 : Exclude those already listed in dynamic linking
15979 for xxx in $avail_ext; do
15980 case " $dynamic_ext " in
15982 *) dflt="$dflt $xxx" ;;
15989 *) dflt="$static_ext"
15996 rp="What extensions do you wish to load statically?"
15999 none) static_ext=' ' ;;
16000 *) static_ext="$ans" ;;
16005 A number of extensions are supplied with $package. Answer "none"
16006 to include no extensions.
16007 Note that DynaLoader is always built and need not be mentioned here.
16010 case "$static_ext" in
16011 '') dflt="$avail_ext" ;;
16012 *) dflt="$static_ext"
16013 # Perhaps we are reusing an old out-of-date config.sh.
16016 if test X"$static_ext" != X"$avail_ext"; then
16018 NOTICE: Your previous config.sh list may be incorrect.
16019 The extensions now available to you are
16021 but the default list from your previous config.sh is
16030 : Exclude those that are not xs extensions
16034 rp="What extensions do you wish to include?"
16037 none) static_ext=' ' ;;
16038 *) static_ext="$ans" ;;
16043 set X $dynamic_ext $static_ext $nonxs_ext
16047 : Remove libraries needed only for extensions
16048 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
16049 : The exception is SunOS 4.x, which needs them.
16050 case "${osname}X${osvers}" in
16054 *) case "$usedl" in
16055 $define|true|[yY]*)
16056 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
16060 *) perllibs="$libs"
16066 : Remove build directory name from cppstdin so it can be used from
16067 : either the present location or the final installed location.
16069 : Get out of the UU directory to get correct path name.
16071 case "$cppstdin" in
16073 echo "Stripping down cppstdin path name"
16079 : end of configuration questions
16081 echo "End of configuration questions."
16084 : back to where it started
16085 if test -d ../UU; then
16089 : configuration may be patched via a 'config.over' file
16090 if $test -f config.over; then
16093 rp='I see a config.over file. Do you wish to load it?'
16096 n*) echo "OK, I'll ignore it.";;
16098 echo "Configuration override changes have been loaded."
16103 : in case they want portability, strip down executable paths
16104 case "$d_portable" in
16107 echo "Stripping down executable paths..." >&4
16108 for file in $loclist $trylist; do
16110 eval $file=`basename $temp`
16115 : create config.sh file
16117 echo "Creating config.sh..." >&4
16118 $spitshell <<EOT >config.sh
16121 # This file was produced by running the Configure script. It holds all the
16122 # definitions figured out by Configure. Should you modify one of these values,
16123 # do not forget to propagate your changes by running "Configure -der". You may
16124 # instead choose to run each of the .SH files by yourself, or "Configure -S".
16127 # Package name : $package
16128 # Source directory : $src
16129 # Configuration time: $cf_time
16130 # Configured by : $cf_by
16131 # Target system : $myuname
16141 Revision='$Revision'
16149 alignbytes='$alignbytes'
16150 ansi2knr='$ansi2knr'
16151 aphostname='$aphostname'
16152 api_revision='$api_revision'
16153 api_subversion='$api_subversion'
16154 api_version='$api_version'
16155 api_versionstring='$api_versionstring'
16158 archlibexp='$archlibexp'
16159 archname64='$archname64'
16160 archname='$archname'
16161 archobjs='$archobjs'
16166 bincompat5005='$bincompat5005'
16170 byteorder='$byteorder'
16172 castflags='$castflags'
16175 cccdlflags='$cccdlflags'
16176 ccdlflags='$ccdlflags'
16178 ccflags_uselargefiles='$ccflags_uselargefiles'
16180 ccsymbols='$ccsymbols'
16181 ccversion='$ccversion'
16183 cf_email='$cf_email'
16185 charsize='$charsize'
16189 clocktype='$clocktype'
16191 compress='$compress'
16192 contains='$contains'
16196 cpp_stuff='$cpp_stuff'
16197 cppccsymbols='$cppccsymbols'
16198 cppflags='$cppflags'
16200 cppminus='$cppminus'
16202 cppstdin='$cppstdin'
16203 cppsymbols='$cppsymbols'
16204 crosscompile='$crosscompile'
16205 cryptlib='$cryptlib'
16207 d_Gconvert='$d_Gconvert'
16208 d_PRIEUldbl='$d_PRIEUldbl'
16209 d_PRIFUldbl='$d_PRIFUldbl'
16210 d_PRIGUldbl='$d_PRIGUldbl'
16211 d_PRIXU64='$d_PRIXU64'
16212 d_PRId64='$d_PRId64'
16213 d_PRIeldbl='$d_PRIeldbl'
16214 d_PRIfldbl='$d_PRIfldbl'
16215 d_PRIgldbl='$d_PRIgldbl'
16216 d_PRIi64='$d_PRIi64'
16217 d_PRIo64='$d_PRIo64'
16218 d_PRIu64='$d_PRIu64'
16219 d_PRIx64='$d_PRIx64'
16220 d_SCNfldbl='$d_SCNfldbl'
16221 d__fwalk='$d__fwalk'
16222 d_access='$d_access'
16223 d_accessx='$d_accessx'
16225 d_archlib='$d_archlib'
16228 d_attribut='$d_attribut'
16231 d_bincompat5005='$d_bincompat5005'
16233 d_bsdgetpgrp='$d_bsdgetpgrp'
16234 d_bsdsetpgrp='$d_bsdsetpgrp'
16236 d_casti32='$d_casti32'
16237 d_castneg='$d_castneg'
16238 d_charvspr='$d_charvspr'
16240 d_chroot='$d_chroot'
16241 d_chsize='$d_chsize'
16242 d_closedir='$d_closedir'
16243 d_cmsghdr_s='$d_cmsghdr_s'
16247 d_cuserid='$d_cuserid'
16248 d_dbl_dig='$d_dbl_dig'
16249 d_difftime='$d_difftime'
16250 d_dirnamlen='$d_dirnamlen'
16251 d_dlerror='$d_dlerror'
16252 d_dlopen='$d_dlopen'
16253 d_dlsymun='$d_dlsymun'
16254 d_dosuid='$d_dosuid'
16255 d_drand48proto='$d_drand48proto'
16257 d_eaccess='$d_eaccess'
16258 d_endgrent='$d_endgrent'
16259 d_endhent='$d_endhent'
16260 d_endnent='$d_endnent'
16261 d_endpent='$d_endpent'
16262 d_endpwent='$d_endpwent'
16263 d_endsent='$d_endsent'
16264 d_eofnblk='$d_eofnblk'
16265 d_eunice='$d_eunice'
16266 d_fchmod='$d_fchmod'
16267 d_fchown='$d_fchown'
16269 d_fcntl_can_lock='$d_fcntl_can_lock'
16270 d_fd_macros='$d_fd_macros'
16271 d_fd_set='$d_fd_set'
16272 d_fds_bits='$d_fds_bits'
16273 d_fgetpos='$d_fgetpos'
16274 d_flexfnam='$d_flexfnam'
16277 d_fpathconf='$d_fpathconf'
16278 d_fpos64_t='$d_fpos64_t'
16279 d_frexpl='$d_frexpl'
16280 d_fs_data_s='$d_fs_data_s'
16281 d_fseeko='$d_fseeko'
16282 d_fsetpos='$d_fsetpos'
16283 d_fstatfs='$d_fstatfs'
16284 d_fstatvfs='$d_fstatvfs'
16286 d_ftello='$d_ftello'
16288 d_getcwd='$d_getcwd'
16289 d_getespwnam='$d_getespwnam'
16290 d_getfsstat='$d_getfsstat'
16291 d_getgrent='$d_getgrent'
16292 d_getgrps='$d_getgrps'
16293 d_gethbyaddr='$d_gethbyaddr'
16294 d_gethbyname='$d_gethbyname'
16295 d_gethent='$d_gethent'
16296 d_gethname='$d_gethname'
16297 d_gethostprotos='$d_gethostprotos'
16298 d_getitimer='$d_getitimer'
16299 d_getlogin='$d_getlogin'
16300 d_getmnt='$d_getmnt'
16301 d_getmntent='$d_getmntent'
16302 d_getnbyaddr='$d_getnbyaddr'
16303 d_getnbyname='$d_getnbyname'
16304 d_getnent='$d_getnent'
16305 d_getnetprotos='$d_getnetprotos'
16306 d_getpagsz='$d_getpagsz'
16307 d_getpbyname='$d_getpbyname'
16308 d_getpbynumber='$d_getpbynumber'
16309 d_getpent='$d_getpent'
16310 d_getpgid='$d_getpgid'
16311 d_getpgrp2='$d_getpgrp2'
16312 d_getpgrp='$d_getpgrp'
16313 d_getppid='$d_getppid'
16314 d_getprior='$d_getprior'
16315 d_getprotoprotos='$d_getprotoprotos'
16316 d_getprpwnam='$d_getprpwnam'
16317 d_getpwent='$d_getpwent'
16318 d_getsbyname='$d_getsbyname'
16319 d_getsbyport='$d_getsbyport'
16320 d_getsent='$d_getsent'
16321 d_getservprotos='$d_getservprotos'
16322 d_getspnam='$d_getspnam'
16323 d_gettimeod='$d_gettimeod'
16324 d_gnulibc='$d_gnulibc'
16325 d_grpasswd='$d_grpasswd'
16326 d_hasmntopt='$d_hasmntopt'
16330 d_inetaton='$d_inetaton'
16331 d_int64_t='$d_int64_t'
16332 d_isascii='$d_isascii'
16334 d_isnanl='$d_isnanl'
16335 d_killpg='$d_killpg'
16336 d_lchown='$d_lchown'
16337 d_ldbl_dig='$d_ldbl_dig'
16339 d_locconv='$d_locconv'
16341 d_longdbl='$d_longdbl'
16342 d_longlong='$d_longlong'
16343 d_lseekproto='$d_lseekproto'
16345 d_madvise='$d_madvise'
16347 d_mbstowcs='$d_mbstowcs'
16348 d_mbtowc='$d_mbtowc'
16349 d_memchr='$d_memchr'
16350 d_memcmp='$d_memcmp'
16351 d_memcpy='$d_memcpy'
16352 d_memmove='$d_memmove'
16353 d_memset='$d_memset'
16355 d_mkdtemp='$d_mkdtemp'
16356 d_mkfifo='$d_mkfifo'
16357 d_mkstemp='$d_mkstemp'
16358 d_mkstemps='$d_mkstemps'
16359 d_mktime='$d_mktime'
16362 d_mprotect='$d_mprotect'
16364 d_msg_ctrunc='$d_msg_ctrunc'
16365 d_msg_dontroute='$d_msg_dontroute'
16366 d_msg_oob='$d_msg_oob'
16367 d_msg_peek='$d_msg_peek'
16368 d_msg_proxy='$d_msg_proxy'
16369 d_msgctl='$d_msgctl'
16370 d_msgget='$d_msgget'
16371 d_msghdr_s='$d_msghdr_s'
16372 d_msgrcv='$d_msgrcv'
16373 d_msgsnd='$d_msgsnd'
16375 d_munmap='$d_munmap'
16376 d_mymalloc='$d_mymalloc'
16378 d_nv_preserves_uv='$d_nv_preserves_uv'
16379 d_nv_preserves_uv_bits='$d_nv_preserves_uv_bits'
16380 d_off64_t='$d_off64_t'
16381 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
16382 d_oldpthreads='$d_oldpthreads'
16383 d_oldsock='$d_oldsock'
16385 d_pathconf='$d_pathconf'
16387 d_perl_otherlibdirs='$d_perl_otherlibdirs'
16388 d_phostname='$d_phostname'
16391 d_portable='$d_portable'
16392 d_pthread_yield='$d_pthread_yield'
16394 d_pwchange='$d_pwchange'
16395 d_pwclass='$d_pwclass'
16396 d_pwcomment='$d_pwcomment'
16397 d_pwexpire='$d_pwexpire'
16398 d_pwgecos='$d_pwgecos'
16399 d_pwpasswd='$d_pwpasswd'
16400 d_pwquota='$d_pwquota'
16403 d_readdir='$d_readdir'
16404 d_readlink='$d_readlink'
16406 d_realpath='$d_realpath'
16407 d_recvmsg='$d_recvmsg'
16408 d_rename='$d_rename'
16409 d_rewinddir='$d_rewinddir'
16411 d_safebcpy='$d_safebcpy'
16412 d_safemcpy='$d_safemcpy'
16413 d_sanemcmp='$d_sanemcmp'
16414 d_sbrkproto='$d_sbrkproto'
16415 d_sched_yield='$d_sched_yield'
16416 d_scm_rights='$d_scm_rights'
16417 d_seekdir='$d_seekdir'
16418 d_select='$d_select'
16420 d_semctl='$d_semctl'
16421 d_semctl_semid_ds='$d_semctl_semid_ds'
16422 d_semctl_semun='$d_semctl_semun'
16423 d_semget='$d_semget'
16425 d_sendmsg='$d_sendmsg'
16426 d_setegid='$d_setegid'
16427 d_seteuid='$d_seteuid'
16428 d_setgrent='$d_setgrent'
16429 d_setgrps='$d_setgrps'
16430 d_sethent='$d_sethent'
16431 d_setitimer='$d_setitimer'
16432 d_setlinebuf='$d_setlinebuf'
16433 d_setlocale='$d_setlocale'
16434 d_setnent='$d_setnent'
16435 d_setpent='$d_setpent'
16436 d_setpgid='$d_setpgid'
16437 d_setpgrp2='$d_setpgrp2'
16438 d_setpgrp='$d_setpgrp'
16439 d_setprior='$d_setprior'
16440 d_setproctitle='$d_setproctitle'
16441 d_setpwent='$d_setpwent'
16442 d_setregid='$d_setregid'
16443 d_setresgid='$d_setresgid'
16444 d_setresuid='$d_setresuid'
16445 d_setreuid='$d_setreuid'
16446 d_setrgid='$d_setrgid'
16447 d_setruid='$d_setruid'
16448 d_setsent='$d_setsent'
16449 d_setsid='$d_setsid'
16450 d_setvbuf='$d_setvbuf'
16454 d_shmatprototype='$d_shmatprototype'
16455 d_shmctl='$d_shmctl'
16457 d_shmget='$d_shmget'
16458 d_sigaction='$d_sigaction'
16459 d_sigprocmask='$d_sigprocmask'
16460 d_sigsetjmp='$d_sigsetjmp'
16461 d_sockatmark='$d_sockatmark'
16462 d_socket='$d_socket'
16463 d_socklen_t='$d_socklen_t'
16464 d_sockpair='$d_sockpair'
16465 d_socks5_init='$d_socks5_init'
16467 d_sresgproto='$d_sresgproto'
16468 d_sresuproto='$d_sresuproto'
16469 d_statblks='$d_statblks'
16470 d_statfs_f_flags='$d_statfs_f_flags'
16471 d_statfs_s='$d_statfs_s'
16472 d_statvfs='$d_statvfs'
16473 d_stdio_cnt_lval='$d_stdio_cnt_lval'
16474 d_stdio_ptr_lval='$d_stdio_ptr_lval'
16475 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
16476 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
16477 d_stdio_stream_array='$d_stdio_stream_array'
16478 d_stdiobase='$d_stdiobase'
16479 d_stdstdio='$d_stdstdio'
16480 d_strchr='$d_strchr'
16481 d_strcoll='$d_strcoll'
16482 d_strctcpy='$d_strctcpy'
16483 d_strerrm='$d_strerrm'
16484 d_strerror='$d_strerror'
16485 d_strftime='$d_strftime'
16486 d_strtod='$d_strtod'
16487 d_strtol='$d_strtol'
16488 d_strtold='$d_strtold'
16489 d_strtoll='$d_strtoll'
16490 d_strtoq='$d_strtoq'
16491 d_strtoul='$d_strtoul'
16492 d_strtoull='$d_strtoull'
16493 d_strtouq='$d_strtouq'
16494 d_strxfrm='$d_strxfrm'
16495 d_suidsafe='$d_suidsafe'
16496 d_symlink='$d_symlink'
16497 d_syscall='$d_syscall'
16498 d_sysconf='$d_sysconf'
16499 d_sysernlst='$d_sysernlst'
16500 d_syserrlst='$d_syserrlst'
16501 d_system='$d_system'
16502 d_tcgetpgrp='$d_tcgetpgrp'
16503 d_tcsetpgrp='$d_tcsetpgrp'
16504 d_telldir='$d_telldir'
16505 d_telldirproto='$d_telldirproto'
16508 d_truncate='$d_truncate'
16509 d_tzname='$d_tzname'
16510 d_u32align='$d_u32align'
16511 d_ualarm='$d_ualarm'
16514 d_union_semun='$d_union_semun'
16515 d_usleep='$d_usleep'
16517 d_vendorarch='$d_vendorarch'
16518 d_vendorbin='$d_vendorbin'
16519 d_vendorlib='$d_vendorlib'
16521 d_void_closedir='$d_void_closedir'
16522 d_voidsig='$d_voidsig'
16523 d_voidtty='$d_voidtty'
16524 d_volatile='$d_volatile'
16525 d_vprintf='$d_vprintf'
16527 d_waitpid='$d_waitpid'
16528 d_wcstombs='$d_wcstombs'
16529 d_wctomb='$d_wctomb'
16530 d_writev='$d_writev'
16533 db_hashtype='$db_hashtype'
16534 db_prefixtype='$db_prefixtype'
16535 db_version_major='$db_version_major'
16536 db_version_minor='$db_version_minor'
16537 db_version_patch='$db_version_patch'
16538 defvoidused='$defvoidused'
16539 direntrytype='$direntrytype'
16542 doublesize='$doublesize'
16544 dynamic_ext='$dynamic_ext'
16550 eunicefix='$eunicefix'
16553 extensions='$extensions'
16554 fflushNULL='$fflushNULL'
16555 fflushall='$fflushall'
16557 firstmakefile='$firstmakefile'
16559 fpossize='$fpossize'
16560 fpostype='$fpostype'
16561 freetype='$freetype'
16563 full_csh='$full_csh'
16564 full_sed='$full_sed'
16565 gccosandvers='$gccosandvers'
16566 gccversion='$gccversion'
16567 gidformat='$gidformat'
16573 groupcat='$groupcat'
16574 groupstype='$groupstype'
16577 h_sysfile='$h_sysfile'
16588 i_arpainet='$i_arpainet'
16589 i_bsdioctl='$i_bsdioctl'
16592 i_dirent='$i_dirent'
16600 i_ieeefp='$i_ieeefp'
16601 i_inttypes='$i_inttypes'
16602 i_libutil='$i_libutil'
16603 i_limits='$i_limits'
16604 i_locale='$i_locale'
16605 i_machcthr='$i_machcthr'
16606 i_malloc='$i_malloc'
16608 i_memory='$i_memory'
16609 i_mntent='$i_mntent'
16612 i_neterrno='$i_neterrno'
16613 i_netinettcp='$i_netinettcp'
16617 i_pthread='$i_pthread'
16619 i_rpcsvcdbm='$i_rpcsvcdbm'
16622 i_shadow='$i_shadow'
16624 i_stdarg='$i_stdarg'
16625 i_stddef='$i_stddef'
16626 i_stdlib='$i_stdlib'
16627 i_string='$i_string'
16628 i_sunmath='$i_sunmath'
16629 i_sysaccess='$i_sysaccess'
16630 i_sysdir='$i_sysdir'
16631 i_sysfile='$i_sysfile'
16632 i_sysfilio='$i_sysfilio'
16634 i_sysioctl='$i_sysioctl'
16635 i_syslog='$i_syslog'
16636 i_sysmman='$i_sysmman'
16637 i_sysmode='$i_sysmode'
16638 i_sysmount='$i_sysmount'
16639 i_sysndir='$i_sysndir'
16640 i_sysparam='$i_sysparam'
16641 i_sysresrc='$i_sysresrc'
16642 i_syssecrt='$i_syssecrt'
16643 i_sysselct='$i_sysselct'
16644 i_syssockio='$i_syssockio'
16645 i_sysstat='$i_sysstat'
16646 i_sysstatfs='$i_sysstatfs'
16647 i_sysstatvfs='$i_sysstatvfs'
16648 i_systime='$i_systime'
16649 i_systimek='$i_systimek'
16650 i_systimes='$i_systimes'
16651 i_systypes='$i_systypes'
16652 i_sysuio='$i_sysuio'
16654 i_sysutsname='$i_sysutsname'
16655 i_sysvfs='$i_sysvfs'
16656 i_syswait='$i_syswait'
16657 i_termio='$i_termio'
16658 i_termios='$i_termios'
16660 i_unistd='$i_unistd'
16663 i_values='$i_values'
16664 i_varargs='$i_varargs'
16665 i_varhdr='$i_varhdr'
16667 ignore_versioned_solibs='$ignore_versioned_solibs'
16668 inc_version_list='$inc_version_list'
16669 inc_version_list_init='$inc_version_list_init'
16672 installarchlib='$installarchlib'
16673 installbin='$installbin'
16674 installman1dir='$installman1dir'
16675 installman3dir='$installman3dir'
16676 installprefix='$installprefix'
16677 installprefixexp='$installprefixexp'
16678 installprivlib='$installprivlib'
16679 installscript='$installscript'
16680 installsitearch='$installsitearch'
16681 installsitebin='$installsitebin'
16682 installsitelib='$installsitelib'
16683 installstyle='$installstyle'
16684 installusrbinperl='$installusrbinperl'
16685 installvendorarch='$installvendorarch'
16686 installvendorbin='$installvendorbin'
16687 installvendorlib='$installvendorlib'
16689 issymlink='$issymlink'
16690 ivdformat='$ivdformat'
16693 known_extensions='$known_extensions'
16696 lddlflags='$lddlflags'
16698 ldflags_uselargefiles='$ldflags_uselargefiles'
16699 ldlibpthname='$ldlibpthname'
16706 libsdirs='$libsdirs'
16707 libsfiles='$libsfiles'
16708 libsfound='$libsfound'
16709 libspath='$libspath'
16710 libswanted='$libswanted'
16711 libswanted_uselargefiles='$libswanted_uselargefiles'
16717 locincpth='$locincpth'
16718 loclibpth='$loclibpth'
16719 longdblsize='$longdblsize'
16720 longlongsize='$longlongsize'
16721 longsize='$longsize'
16725 lseeksize='$lseeksize'
16726 lseektype='$lseektype'
16730 make_set_make='$make_set_make'
16731 mallocobj='$mallocobj'
16732 mallocsrc='$mallocsrc'
16733 malloctype='$malloctype'
16735 man1direxp='$man1direxp'
16738 man3direxp='$man3direxp'
16740 mips_type='$mips_type'
16742 mmaptype='$mmaptype'
16743 modetype='$modetype'
16745 multiarch='$multiarch'
16747 myarchname='$myarchname'
16748 mydomain='$mydomain'
16749 myhostname='$myhostname'
16752 need_va_copy='$need_va_copy'
16753 netdb_hlen_type='$netdb_hlen_type'
16754 netdb_host_type='$netdb_host_type'
16755 netdb_name_type='$netdb_name_type'
16756 netdb_net_type='$netdb_net_type'
16759 nm_so_opt='$nm_so_opt'
16760 nonxs_ext='$nonxs_ext'
16762 nvEUformat='$nvEUformat'
16763 nvFUformat='$nvFUformat'
16764 nvGUformat='$nvGUformat'
16765 nveformat='$nveformat'
16766 nvfformat='$nvfformat'
16767 nvgformat='$nvgformat'
16770 o_nonblock='$o_nonblock'
16772 old_pthread_create_joinable='$old_pthread_create_joinable'
16773 optimize='$optimize'
16774 orderlib='$orderlib'
16777 otherlibdirs='$otherlibdirs'
16781 patchlevel='$patchlevel'
16782 path_sep='$path_sep'
16785 perl_patchlevel='$perl_patchlevel'
16786 perladmin='$perladmin'
16787 perllibs='$perllibs'
16788 perlpath='$perlpath'
16790 phostname='$phostname'
16793 pm_apiversion='$pm_apiversion'
16797 prefixexp='$prefixexp'
16799 privlibexp='$privlibexp'
16800 prototype='$prototype'
16802 quadkind='$quadkind'
16803 quadtype='$quadtype'
16804 randbits='$randbits'
16805 randfunc='$randfunc'
16806 randseedtype='$randseedtype'
16808 rd_nodata='$rd_nodata'
16809 revision='$revision'
16813 sPRIEUldbl='$sPRIEUldbl'
16814 sPRIFUldbl='$sPRIFUldbl'
16815 sPRIGUldbl='$sPRIGUldbl'
16816 sPRIXU64='$sPRIXU64'
16818 sPRIeldbl='$sPRIeldbl'
16819 sPRIfldbl='$sPRIfldbl'
16820 sPRIgldbl='$sPRIgldbl'
16825 sSCNfldbl='$sSCNfldbl'
16826 sched_yield='$sched_yield'
16827 scriptdir='$scriptdir'
16828 scriptdirexp='$scriptdirexp'
16830 seedfunc='$seedfunc'
16831 selectminbits='$selectminbits'
16832 selecttype='$selecttype'
16833 sendmail='$sendmail'
16836 sharpbang='$sharpbang'
16837 shmattype='$shmattype'
16838 shortsize='$shortsize'
16841 sig_count='$sig_count'
16842 sig_name='$sig_name'
16843 sig_name_init='$sig_name_init'
16845 sig_num_init='$sig_num_init'
16846 sig_size='$sig_size'
16847 signal_t='$signal_t'
16848 sitearch='$sitearch'
16849 sitearchexp='$sitearchexp'
16851 sitebinexp='$sitebinexp'
16853 sitelib_stem='$sitelib_stem'
16854 sitelibexp='$sitelibexp'
16855 siteprefix='$siteprefix'
16856 siteprefixexp='$siteprefixexp'
16857 sizesize='$sizesize'
16858 sizetype='$sizetype'
16862 sockethdr='$sockethdr'
16863 socketlib='$socketlib'
16864 socksizetype='$socksizetype'
16866 spackage='$spackage'
16867 spitshell='$spitshell'
16869 ssizetype='$ssizetype'
16870 startperl='$startperl'
16872 static_ext='$static_ext'
16874 stdio_base='$stdio_base'
16875 stdio_bufsiz='$stdio_bufsiz'
16876 stdio_cnt='$stdio_cnt'
16877 stdio_filbuf='$stdio_filbuf'
16878 stdio_ptr='$stdio_ptr'
16879 stdio_stream_array='$stdio_stream_array'
16882 subversion='$subversion'
16889 timeincl='$timeincl'
16890 timetype='$timetype'
16903 uidformat='$uidformat'
16909 uquadtype='$uquadtype'
16910 use5005threads='$use5005threads'
16911 use64bitall='$use64bitall'
16912 use64bitint='$use64bitint'
16914 useithreads='$useithreads'
16915 uselargefiles='$uselargefiles'
16916 uselongdouble='$uselongdouble'
16917 usemorebits='$usemorebits'
16918 usemultiplicity='$usemultiplicity'
16919 usemymalloc='$usemymalloc'
16921 useopcode='$useopcode'
16922 useperlio='$useperlio'
16923 useposix='$useposix'
16925 useshrplib='$useshrplib'
16926 usesocks='$usesocks'
16927 usethreads='$usethreads'
16928 usevendorprefix='$usevendorprefix'
16929 usevfork='$usevfork'
16932 uvXUformat='$uvXUformat'
16933 uvoformat='$uvoformat'
16936 uvuformat='$uvuformat'
16937 uvxformat='$uvxformat'
16938 vendorarch='$vendorarch'
16939 vendorarchexp='$vendorarchexp'
16940 vendorbin='$vendorbin'
16941 vendorbinexp='$vendorbinexp'
16942 vendorlib='$vendorlib'
16943 vendorlib_stem='$vendorlib_stem'
16944 vendorlibexp='$vendorlibexp'
16945 vendorprefix='$vendorprefix'
16946 vendorprefixexp='$vendorprefixexp'
16948 versiononly='$versiononly'
16950 voidflags='$voidflags'
16952 xs_apiversion='$xs_apiversion'
16954 yaccflags='$yaccflags'
16959 : Add in command line options if available
16960 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
16962 : add special variables
16963 $test -f $src/patchlevel.h && \
16964 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
16965 echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
16966 echo "PERL_CONFIG_SH=true" >>config.sh
16968 : propagate old symbols
16969 if $test -f UU/config.sh; then
16970 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
16971 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
16972 $sort | $uniq -u >UU/oldsyms
16973 set X `cat UU/oldsyms`
16979 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
16981 echo "# Variables propagated from previous config.sh file." >>config.sh
16982 for sym in `cat UU/oldsyms`; do
16983 echo " Propagating $hint variable "'$'"$sym..."
16984 eval 'tmp="$'"${sym}"'"'
16986 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
16992 : Finish up by extracting the .SH files
17006 If you'd like to make any changes to the config.sh file before I begin
17007 to configure things, do it as a shell escape now (e.g. !vi config.sh).
17010 rp="Press return or use a shell escape to edit config.sh:"
17015 *) : in case they cannot read
17016 sh 1>&4 -c "$ans";;
17021 : if this fails, just run all the .SH files by hand
17028 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
17035 Now you need to generate make dependencies by running "$make depend".
17036 You might prefer to run it in background: "$make depend > makedepend.out &"
17037 It can take a while, so you might not want to run it right now.
17042 rp="Run $make depend now?"
17046 $make depend && echo "Now you must run '$make'."
17049 echo "You must run '$make depend' then '$make'."
17052 elif test -f [Mm]akefile; then
17054 echo "Now you must run a $make."
17059 if $test -f Policy.sh; then
17062 If you compile $package on a different machine or from a different object
17063 directory, copy the Policy.sh file from this object directory to the
17064 new one before you run Configure -- this will help you with most of
17065 the policy defaults.
17069 if $test -f config.msg; then
17070 echo "Hmm. I also noted the following information while running:"
17072 $cat config.msg >&4
17075 $rm -f kit*isdone ark*isdone