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 Tue Apr 3 04:12:27 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
465 d_old_pthread_create_joinable=''
466 old_pthread_create_joinable=''
546 d_stdio_ptr_lval_nochange_cnt=''
547 d_stdio_ptr_lval_sets_cnt=''
719 inc_version_list_init=''
738 ignore_versioned_solibs=''
797 d_perl_otherlibdirs=''
814 d_nv_preserves_uv_bits=''
913 d_stdio_stream_array=''
914 stdio_stream_array=''
924 ccflags_uselargefiles=''
925 ldflags_uselargefiles=''
926 libswanted_uselargefiles=''
971 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
974 : We must find out about Eunice early
976 if test -f /etc/unixtovms; then
977 eunicefix=/etc/unixtovms
979 if test -f /etc/unixtovms.exe; then
980 eunicefix=/etc/unixtovms.exe
987 : set useposix=false in your hint file to disable the POSIX extension.
989 : set useopcode=false in your hint file to disable the Opcode extension.
991 : Trailing extension. Override this in a hint file, if needed.
993 : Extra object files, if any, needed on this platform.
996 : Possible local include directories to search.
997 : Set locincpth to "" in a hint file to defeat local include searches.
998 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
999 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1001 : no include file wanted by default
1005 : change the next line if compiling for Xenix/286 on Xenix/386
1006 xlibpth='/usr/lib/386 /lib/386'
1007 : Possible local library directories to search.
1008 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1009 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1011 : general looking path for locating libraries
1012 glibpth="/lib /usr/lib $xlibpth"
1013 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1014 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1015 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1017 : Private path used by Configure to find libraries. Its value
1018 : is prepended to libpth. This variable takes care of special
1019 : machines, like the mips. Usually, it should be empty.
1022 : default library list
1024 : some systems want to use only the non-versioned libso:s
1025 ignore_versioned_solibs=''
1027 ccflags_uselargefiles=''
1028 ldflags_uselargefiles=''
1029 libswanted_uselargefiles=''
1030 : set usemultiplicity on the Configure command line to enable multiplicity.
1031 : set usesocks on the Configure command line to enable socks.
1032 : set usethreads on the Configure command line to enable threads.
1033 : full support for void wanted by default
1036 : List of libraries we want.
1037 : If anyone needs -lnet, put it in a hint file.
1038 libswanted='sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl'
1039 libswanted="$libswanted dld ld sun m c cposix posix"
1040 libswanted="$libswanted ndir dir crypt sec"
1041 libswanted="$libswanted ucb bsd BSD PW x iconv util"
1042 : We probably want to search /usr/shlib before most other libraries.
1043 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1044 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1045 glibpth="/usr/shlib $glibpth"
1046 : Do not use vfork unless overridden by a hint file.
1049 : Find the basic shell for Bourne shell scripts
1053 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1056 if test -f "$xxx"; then
1059 : Build up a list and do a single loop so we can 'break' out.
1060 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1061 for xxx in sh bash ksh pdksh ash; do
1063 try="$try ${p}/${xxx}"
1067 if test -f "$xxx"; then
1070 elif test -f "$xxx.exe"; then
1081 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1083 Usually it's in /bin/sh. How did you even get this far?
1084 Please contact me (Perl Maintainers) at perlbug@perl.org and
1085 we'll try to straighten this all out.
1091 : see if sh knows # comments
1092 if `$sh -c '#' >/dev/null 2>&1`; then
1096 test -f $xcat || xcat=/usr/bin/cat
1101 if test -s today; then
1104 echo "#! $xcat" > try
1108 if test -s today; then
1116 echo "Your $sh doesn't grok # comments--I will strip them later on."
1119 echo "exec grep -v '^[ ]*#'" >spitshell
1121 $eunicefix spitshell
1122 spitshell=`pwd`/spitshell
1124 echo "I presume that if # doesn't work, #! won't work either!"
1129 : figure out how to guarantee sh startup
1131 '') startsh=${sharpbang}${sh} ;;
1143 : echo "Yup, it does."
1145 echo "Hmm... '$startsh' does not guarantee sh startup..."
1146 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1151 : Save command line options in file UU/cmdline.opt for later use in
1152 : generating config.sh.
1153 cat > cmdline.opt <<EOSH
1154 # Configure command line arguments.
1161 cat >>cmdline.opt <<EOSH
1162 config_arg$argn='$arg'
1164 argn=`expr $argn + 1`
1167 : produce awk script to parse command line options
1168 cat >options.awk <<'EOF'
1170 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1172 len = length(optstr);
1173 for (i = 1; i <= len; i++) {
1174 c = substr(optstr, i, 1);
1175 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1186 if (substr(str, 1, 1) != "-") {
1187 printf("'%s'\n", str);
1191 for (i = 2; i <= len; i++) {
1192 c = substr(str, i, 1);
1194 printf("-%s\n", substr(str, i));
1200 printf("'%s'\n", substr(str, i + 1));
1213 : process the command line options
1214 set X `for arg in "$@"; do echo "X$arg"; done |
1215 sed -e s/X// | awk -f options.awk`
1220 : set up default values
1230 rm -f optdef.sh posthint.sh
1231 cat >optdef.sh <<EOS
1237 while test $# -gt 0; do
1239 -d) shift; fastread=yes;;
1240 -e) shift; alldone=cont;;
1244 if test -r "$1"; then
1247 echo "$me: cannot read config file $1." >&2
1252 -h) shift; error=true;;
1253 -r) shift; reuseval=true;;
1254 -s) shift; silent=true; realsilent=true;;
1255 -E) shift; alldone=exit;;
1256 -K) shift; knowitall=true;;
1257 -O) shift; override=true;;
1258 -S) shift; silent=true; extractsh=true;;
1263 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1264 echo "$me: ignoring -D $1" >&2
1267 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1268 *) echo "$1='define'" >> optdef.sh;;
1275 *=) echo "$1" >> optdef.sh;;
1277 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1278 echo "$me: ignoring -U $1" >&2
1280 *) echo "$1='undef'" >> optdef.sh;;
1291 *=*) zzz=`echo $yyy|sed 's!=.*!!'`
1295 zzz=" "`echo $yyy|sed 's!^[^=]*=!!'`
1296 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1302 *:*) xxx=`echo $yyy|sed 's!:.*!!'`
1303 yyy=`echo $yyy|sed 's!^[^:]*:!!'`
1304 zzz=`echo $yyy|sed 's!^[^=]*=!!'`
1305 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1306 *) xxx=`echo $yyy|sed 's!:.*!!'`
1307 yyy=`echo $yyy|sed 's!^[^:]*:!!'` ;;
1313 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1315 echo "$yyy=''" >> posthint.sh ;;
1320 echo "$yyy='$zzz'" >> posthint.sh ;;
1322 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1324 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1329 echo "$yyy=$zzz" >> posthint.sh ;;
1330 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1334 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1337 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1345 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1346 [-U symbol] [-U symbol=] [-A command:symbol...]
1347 -d : use defaults for all answers.
1348 -e : go on without questioning past the production of config.sh.
1349 -f : specify an alternate default configuration file.
1350 -h : print this help message and exit (with an error status).
1351 -r : reuse C symbols value if possible (skips costly nm extraction).
1352 -s : silent mode, only echoes questions and essential information.
1353 -D : define symbol to have some value:
1354 -D symbol symbol gets the value 'define'
1355 -D symbol=value symbol gets the value 'value'
1356 -E : stop at the end of questions, after having produced config.sh.
1357 -K : do not use unless you know what you are doing.
1358 -O : let -D and -U override definitions from loaded configuration file.
1359 -S : perform variable substitutions on all .SH files (can mix with -f)
1360 -U : undefine symbol:
1361 -U symbol symbol gets the value 'undef'
1362 -U symbol= symbol gets completely empty
1363 -A : manipulate symbol after the platform specific hints have been applied:
1364 -A symbol=value append " "value to symbol
1365 -A append:symbol=value append value to symbol
1366 -A define:symbol=value define symbol to have value
1367 -A clear:symbol define symbol to be ''
1368 -A define:symbol define symbol to be 'define'
1369 -A eval:symbol=value define symbol to be eval of value
1370 -A prepend:symbol=value prepend value to symbol
1371 -A undef:symbol define symbol to be 'undef'
1372 -A undef:symbol= define symbol to be ''
1373 -V : print version number and exit (with a zero status).
1380 case "$fastread$alldone" in
1383 case "$extractsh" in
1386 if test ! -t 0; then
1387 echo "Say 'sh Configure', not 'sh <Configure'"
1397 true) exec 1>/dev/null;;
1400 : run the defines and the undefines, if any, but leave the file out there...
1403 : create the posthint manipulation script and leave the file out there...
1408 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1409 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1410 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1411 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1412 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1415 : Some greps do not return status, grrr.
1416 echo "grimblepritz" >grimble
1417 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1419 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1425 : the following should work in any shell
1429 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1430 cat >contains <<'EOSS'
1431 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1436 : Find the path to the source tree
1439 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1443 *) src=`cd ../$src && pwd` ;;
1456 if test -f $rsrc/Configure && \
1457 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1459 : found it, so we are ok.
1462 for src in . .. ../.. ../../.. ../../../..; do
1463 if test -f ../$src/Configure && \
1464 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1475 Sorry, I can't seem to locate the source dir for $package. Please start
1476 Configure with an explicit path -- i.e. /some/path/Configure.
1484 echo "Sources for $package found in \"$src\"." >&4
1488 : script used to extract .SH files with variable substitutions
1489 cat >extract <<'EOS'
1491 echo "Doing variable substitutions on .SH files..."
1492 if test -f $src/MANIFEST; then
1493 set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH$'`
1495 echo "(Looking for .SH files under the source directory.)"
1496 set x `(cd $src; find . -name "*.SH" -print)`
1500 0) set x `(cd $src; echo *.SH)`; shift;;
1502 if test ! -f $src/$1; then
1508 while test $name; do
1509 if test ! -d "$name"; then
1510 create="$name $create";
1511 name=`echo $name | sed -e "s|^[^/]*$||"`;
1512 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1517 for file in $create; do
1526 dir=`expr X$file : 'X\(.*\)/'`
1527 file=`expr X$file : 'X.*/\(.*\)'`
1528 (cd $dir && . ./$file)
1538 dir=`expr X$file : 'X\(.*\)/'`
1539 file=`expr X$file : 'X.*/\(.*\)'`
1540 (set x $dir; shift; eval $mkdir_p)
1550 if test -f $src/config_h.SH; then
1551 if test ! -f config.h; then
1552 : oops, they left it out of MANIFEST, probably, so do it anyway.
1558 : extract files and exit if asked to do so
1559 case "$extractsh" in
1561 case "$realsilent" in
1565 case "$config_sh" in
1566 '') config_sh='config.sh';;
1569 echo "Fetching answers from $config_sh..."
1572 test "$override" && . ./optdef.sh
1581 : Eunice requires " " instead of "", can you believe it
1584 echo "Beginning of configuration questions for $package."
1586 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1588 : first determine how to suppress newline on echo command
1590 echo "Checking echo to see how to suppress newlines..."
1591 (echo "hi there\c" ; echo " ") >.echotmp
1592 if $contains c .echotmp >/dev/null 2>&1 ; then
1603 echo $n "The star should be here-->$c"
1607 : Now test for existence of everything in MANIFEST
1609 if test -f $rsrc/MANIFEST; then
1610 echo "First let's make sure your kit is complete. Checking..." >&4
1611 awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
1614 for filelist in x??; do
1615 (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
1617 if test -s missing; then
1621 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1623 You have the option of continuing the configuration process, despite the
1624 distinct possibility that your kit is damaged, by typing 'y'es. If you
1625 do, don't blame me if something goes wrong. I advise you to type 'n'o
1626 and contact the author (perlbug@perl.org).
1629 echo $n "Continue? [n] $c" >&4
1633 echo "Continuing..." >&4
1637 echo "ABORTING..." >&4
1642 echo "Looks good..."
1645 echo "There is no MANIFEST file. I hope your kit is complete !"
1650 : Find the appropriate value for a newline for tr
1651 if test -n "$DJGPP"; then
1654 if test X"$trnl" = X; then
1655 case "`echo foo|tr '\n' x 2>/dev/null`" in
1659 if test X"$trnl" = X; then
1660 case "`echo foo|tr '\012' x 2>/dev/null`" in
1661 foox) trnl='\012' ;;
1664 if test X"$trnl" = X; then
1667 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1673 : compute the number of columns on the terminal for proper question formatting
1678 : set up the echo used in my read
1679 myecho="case \"\$xxxm\" in
1680 '') echo $n \"\$rp $c\" >&4;;
1682 '') echo $n \"[\$xxxm] $c\";;
1684 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1686 echo $n \"[\$xxxm] $c\" >&4
1688 echo $n \"\$rp [\$xxxm] $c\" >&4
1694 : now set up to do reads with possible shell escape and default assignment
1700 case "\$fastread" in
1701 yes) case "\$dflt" in
1704 case "\$silent-\$rp" in
1709 *) case "\$silent" in
1710 true) case "\$rp" in
1715 while expr "X\$ans" : "X!" >/dev/null; do
1719 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1727 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1736 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1741 echo "(OK, I'll run with -d after this question.)" >&4
1744 echo "*** Sorry, \$1 not supported yet." >&4
1754 echo "*** Substitution done -- please confirm."
1756 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1761 echo "*** Error -- try again."
1768 case "\$ans\$xxxm\$nostick" in
1780 : create .config dir to save info across Configure sessions
1781 test -d ../.config || mkdir ../.config
1782 cat >../.config/README <<EOF
1783 This directory created by Configure to save information that should
1784 persist across sessions for $package.
1786 You may safely delete it if you wish.
1789 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
1791 $define|true|[yY]*) ;;
1792 *) case "$xversion" in
1795 *** WHOA THERE!!! ***
1797 This is an UNSTABLE DEVELOPMENT release.
1798 The version of this $package distribution is $xversion, that is, odd,
1799 (as opposed to even) and that signifies a development release.
1800 If you want a maintenance release, you want an even-numbered version.
1802 Do ***NOT*** install this into production use.
1803 Data corruption and crashes are possible.
1805 It is most seriously suggested that you do not continue any further
1806 unless you want to help in developing and debugging Perl.
1808 If you *still* want to build perl, you can answer 'y' now,
1809 or pass -Dusedevel to Configure.
1812 rp='Do you really want to continue?'
1816 [yY]) echo >&4 "Okay, continuing."
1817 usedevel="$define" ;;
1818 *) echo >&4 "Okay, bye."
1828 case "$versiononly" in
1829 '') versiononly="$define" ;;
1831 case "$installusrbinperl" in
1832 '') installusrbinperl="$undef" ;;
1837 : general instructions
1840 user=`(logname) 2>/dev/null`
1842 '') user=`whoami 2>&1`;;
1844 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1847 rp='Would you like to see the instructions?'
1858 This installation shell script will examine your system and ask you questions
1859 to determine how the perl5 package should be installed. If you get
1860 stuck on a question, you may use a ! shell escape to start a subshell or
1861 execute a command. Many of the questions will have default answers in square
1862 brackets; typing carriage return will give you the default.
1864 On some of the questions which ask for file or directory names you are allowed
1865 to use the ~name construct to specify the login directory belonging to "name",
1866 even if you don't have a shell which knows about that. Questions where this is
1867 allowed will be marked "(~name ok)".
1871 dflt='Type carriage return to continue'
1875 The prompter used in this script allows you to use shell variables and
1876 backticks in your answers. You may use $1, $2, etc... to refer to the words
1877 in the default answer, as if the default line was a set of arguments given to a
1878 script shell. This means you may also use $* to repeat the whole default line,
1879 so you do not have to re-type everything to add something to the default.
1881 Everytime there is a substitution, you will have to confirm. If there is an
1882 error (e.g. an unmatched backtick), the default answer will remain unchanged
1883 and you will be prompted again.
1885 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1886 the questions and use the computed defaults (or the previous answers if there
1887 was already a config.sh file). Type 'Configure -h' for a list of options.
1888 You may also start interactively and then answer '& -d' at any prompt to turn
1889 on the non-interactive behaviour for the remainder of the execution.
1895 Much effort has been expended to ensure that this shell script will run on any
1896 Unix system. If despite that it blows up on yours, your best bet is to edit
1897 Configure and run it again. If you can't run Configure for some reason,
1898 you'll have to generate a config.sh file by hand. Whatever problems you
1899 have, let me (perlbug@perl.org) know how I blew it.
1901 This installation script affects things in two ways:
1903 1) it may do direct variable substitutions on some of the files included
1905 2) it builds a config.h file for inclusion in C programs. You may edit
1906 any of these files as the need arises after running this script.
1908 If you make a mistake on a question, there is no easy way to back up to it
1909 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1910 files. Configure will offer to let you do this before it runs the SH files.
1913 dflt='Type carriage return to continue'
1915 case "$firsttime" in
1916 true) echo $user >>../.config/instruct;;
1920 : find out where common programs are
1922 echo "Locating common programs..." >&4
1935 if test -d \$dir/\$thing; then
1941 for thisthing in \$dir/\$thing; do
1942 : just loop through to pick last item
1944 if test -f \$thisthing; then
1947 elif test -f \$dir/\$thing.exe; then
1948 if test -n "$DJGPP"; then
1949 echo \$dir/\$thing.exe
1951 : on Eunice apparently
2002 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2003 pth="$pth /lib /usr/lib"
2004 for file in $loclist; do
2008 if test -f "$xxx"; then
2011 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2012 xxx=`./loc $file $file $pth`
2015 '') xxx=`./loc $file $file $pth`;;
2016 *) xxx=`./loc $xxx $xxx $pth`;;
2022 echo $file is in $xxx.
2025 echo $file is in $xxx.
2028 echo "I don't know where '$file' is, and my life depends on it." >&4
2029 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2035 echo "Don't worry if any of the following aren't found..."
2037 for file in $trylist; do
2041 if test -f "$xxx"; then
2044 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2045 xxx=`./loc $file $file $pth`
2048 '') xxx=`./loc $file $file $pth`;;
2049 *) xxx=`./loc $xxx $xxx $pth`;;
2055 echo $file is in $xxx.
2058 echo $file is in $xxx.
2061 echo "I don't see $file out there, $say."
2068 echo "Substituting grep for egrep."
2074 echo "Substituting cp for ln."
2080 echo "Hopefully test is built into your sh."
2083 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2084 echo "Using the test built into your sh."
2092 echo "Hopefully echo is built into your sh."
2097 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2098 $echo $n "hi there$c" >foo1
2099 echo $n "hi there$c" >foo2
2100 if cmp foo1 foo2 >/dev/null 2>&1; then
2101 echo "They are compatible. In fact, they may be identical."
2108 They are not compatible! You are probably running ksh on a non-USG system.
2109 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2110 have echo built in and we may have to run some Bourne shell scripts. That
2111 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2114 $echo $n "The star should be here-->$c"
2124 cat <<'EOSC' >>checkcc
2129 int main(int argc, char *argv[]) {
2133 if $cc -o try $ccflags try.c; then
2136 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2142 case "`$cc -v -c try.c 2>&1`" in
2145 if $test X"$trygcc" = Xyes; then
2146 if gcc -o try -c try.c; then
2148 echo "You seem to have a working gcc, though." >&4
2149 rp="Would you like to use it?"
2151 if $test -f myread; then
2154 if $test -f UU/myread; then
2157 echo "Cannot find myread, sorry. Aborting." >&2
2162 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no ;;
2166 if $test X"$despair" = Xyes; then
2168 You need to find a working C compiler.
2169 Either (purchase and) install the C compiler supplied by your OS vendor,
2170 or for a free C compiler try http://gcc.gnu.org/
2171 I cannot continue any further, aborting.
2181 : determine whether symbolic links are supported
2184 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2185 echo "Symbolic links are supported." >&4
2188 echo "Symbolic links are NOT supported." >&4
2193 : determine whether symbolic links are supported
2197 echo "Checking how to test for symbolic links..." >&4
2199 if $test "X$issymlink" = X; then
2200 sh -c "PATH= test -h sym" >/dev/null 2>&1
2201 if test $? = 0; then
2205 if $test "X$issymlink" = X; then
2206 if $test -h >/dev/null 2>&1; then
2207 issymlink="$test -h"
2208 echo "Your builtin 'test -h' may be broken, I'm using external '$test -h'." >&4
2211 if $test "X$issymlink" = X; then
2212 if $test -L sym 2>/dev/null; then
2213 issymlink="$test -L"
2216 if $test "X$issymlink" != X; then
2217 echo "You can test for symbolic links with '$issymlink'." >&4
2219 echo "I do not know how you can test for symbolic links." >&4
2223 *) echo "No symbolic links, so not testing for their testing..." >&4
2229 case "$mksymlinks" in
2232 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2235 *) case "$lns:$issymlink" in
2236 *"ln -s:"*"test -"?)
2237 echo "Creating the symbolic links..." >&4
2238 echo "(First creating the subdirectories...)" >&4
2240 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2242 test -z "$directory" && break
2246 if test ! -d t/base; then
2247 echo "Failed to create the subdirectories. Aborting." >&4
2250 echo "(Then creating the symlinks...)" >&4
2251 awk '{print $1}' $src/MANIFEST | while true; do
2253 test -z "$filename" && break
2254 if test -f $filename; then
2255 if $issymlink $filename; then
2259 if test -f $filename; then
2260 echo "$filename already exists, not symlinking."
2262 ln -s $src/$filename $filename
2266 if test ! -f t/base/commonsense.t; then
2267 echo "Failed to create the symlinks. Aborting." >&4
2272 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2280 : see whether [:lower:] and [:upper:] are supported character classes
2282 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2284 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2288 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
2289 # (0xc9 and 0xd1), therefore that is a nice testing point.
2290 if test "X$up" = X -o "X$low" = X; then
2291 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
2297 if test "X$up" = X -o "X$low" = X; then
2298 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
2304 if test "X$up" = X -o "X$low" = X; then
2305 case "`echo IJ | od -x 2>/dev/null`" in
2307 echo "Hey, this might be EBCDIC." >&4
2308 if test "X$up" = X -o "X$low" = X; then
2309 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2310 ij) up='[A-IJ-RS-Z]'
2315 if test "X$up" = X -o "X$low" = X; then
2316 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2326 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
2328 echo "Using $up and $low to convert case." >&4
2331 echo "I don't know how to translate letters from upper to lower case." >&4
2332 echo "Your tr is not acting any way I know of." >&4
2336 : set up the translation script tr, must be called with ./tr of course
2340 '[A-Z][a-z]') exec $tr '$up' '$low';;
2341 '[a-z][A-Z]') exec $tr '$low' '$up';;
2348 : Try to determine whether config.sh was made on this system
2349 case "$config_sh" in
2351 myuname=`$uname -a 2>/dev/null`
2352 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2353 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2354 # because the A-Z/a-z are not consecutive.
2355 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2356 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2357 newmyuname="$myuname"
2359 case "$knowitall" in
2361 if test -f ../config.sh; then
2362 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2363 eval "`grep myuname= ../config.sh`"
2365 if test "X$myuname" = "X$newmyuname"; then
2373 : Get old answers from old config file if Configure was run on the
2374 : same system, otherwise use the hints.
2377 if test -f config.sh; then
2379 rp="I see a config.sh file. Shall I use it to set the defaults?"
2382 n*|N*) echo "OK, I'll ignore it."
2383 mv config.sh config.sh.old
2384 myuname="$newmyuname"
2386 *) echo "Fetching default answers from your old config.sh file..." >&4
2394 : Older versions did not always set $sh. Catch re-use of such
2404 if test ! -f config.sh; then
2407 First time through, eh? I have some defaults handy for some systems
2408 that need some extra help getting the Configure answers right:
2411 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2413 : Half the following guesses are probably wrong... If you have better
2414 : tests or hints, please send them to perlbug@perl.org
2415 : The metaconfig authors would also appreciate a copy...
2416 $test -f /irix && osname=irix
2417 $test -f /xenix && osname=sco_xenix
2418 $test -f /dynix && osname=dynix
2419 $test -f /dnix && osname=dnix
2420 $test -f /lynx.os && osname=lynxos
2421 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2422 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
2423 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2424 $test -f /bin/mips && /bin/mips && osname=mips
2425 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
2426 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
2427 $test -d /usr/apollo/bin && osname=apollo
2428 $test -f /etc/saf/_sactab && osname=svr4
2429 $test -d /usr/include/minix && osname=minix
2430 if $test -d /MachTen -o -d /MachTen_Folder; then
2432 if $test -x /sbin/version; then
2433 osvers=`/sbin/version | $awk '{print $2}' |
2434 $sed -e 's/[A-Za-z]$//'`
2435 elif $test -x /usr/etc/version; then
2436 osvers=`/usr/etc/version | $awk '{print $2}' |
2437 $sed -e 's/[A-Za-z]$//'`
2443 $test -f /sys/posix.dll &&
2444 $test -f /usr/bin/what &&
2445 set X `/usr/bin/what /sys/posix.dll` &&
2446 $test "$3" = UWIN &&
2450 if $test -f $uname; then
2458 umips) osname=umips ;;
2461 [23]100) osname=mips ;;
2462 next*) osname=next ;;
2464 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
2465 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
2468 elif $test -f /etc/kconfig; then
2470 if test "$lns" = "$ln -s"; then
2472 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
2474 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
2481 if test -n "$DJGPP"; then
2490 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
2492 'not found') osvers="$4"."$3" ;;
2493 '<3240'|'<>3240') osvers=3.2.0 ;;
2494 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
2495 '=3250'|'>3250') osvers=3.2.5 ;;
2499 bsd386) osname=bsd386
2502 cygwin*) osname=cygwin
2505 *dc.osx) osname=dcosx
2511 domainos) osname=apollo
2517 dynixptx*) osname=dynixptx
2518 osvers=`echo "$4"|sed 's/^v//'`
2520 freebsd) osname=freebsd
2522 genix) osname=genix ;;
2524 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
2540 netbsd*) osname=netbsd
2543 news-os) osvers="$3"
2545 4*) osname=newsos4 ;;
2549 next*) osname=next ;;
2550 nonstop-ux) osname=nonstopux ;;
2551 POSIX-BC | posix-bc ) osname=posix-bc
2554 powerux | power_ux | powermax_os | powermaxos | \
2555 powerunix | power_unix) osname=powerux
2561 solaris) osname=solaris
2563 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2570 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2574 titanos) osname=titanos
2583 ultrix) osname=ultrix
2586 osf1|mls+) case "$5" in
2589 osvers=`sizer -v | awk '{print $3}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
2592 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
2595 hp*) osname=hp_osf1 ;;
2596 mips) osname=mips_osf1 ;;
2599 unixware) osname=svr5
2605 $2) case "$osname" in
2609 : svr4.x or possibly later
2619 if test -f /stand/boot ; then
2620 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
2621 if test -n "$INITPROG" -a -f "$INITPROG"; then
2622 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
2623 if test -n "$isesix"; then
2631 *) if test -f /etc/systemid; then
2633 set `echo $3 | $sed 's/\./ /g'` $4
2634 if $test -f $src/hints/sco_$1_$2_$3.sh; then
2636 elif $test -f $src/hints/sco_$1_$2.sh; then
2638 elif $test -f $src/hints/sco_$1.sh; then
2643 '') : Still unknown. Probably a generic Sys V.
2652 *) case "$osname" in
2653 '') : Still unknown. Probably a generic BSD.
2661 if test -f /vmunix -a -f $src/hints/news_os.sh; then
2662 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
2663 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
2666 $rm -f UU/kernel.what
2667 elif test -d c:/.; then
2674 : Now look for a hint file osname_osvers, unless one has been
2675 : specified already.
2678 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
2679 : Also try without trailing minor version numbers.
2680 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
2681 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
2682 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
2683 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
2686 *) case "$osvers" in
2689 *) if $test -f $src/hints/$file.sh ; then
2691 elif $test -f $src/hints/$xfile.sh ; then
2693 elif $test -f $src/hints/$xxfile.sh ; then
2695 elif $test -f $src/hints/$xxxfile.sh ; then
2697 elif $test -f $src/hints/$xxxxfile.sh ; then
2699 elif $test -f "$src/hints/${osname}.sh" ; then
2708 if $test -f Policy.sh ; then
2711 none) dflt="Policy" ;;
2712 *) dflt="Policy $dflt" ;;
2717 dflt=`echo $hintfile | $sed 's/\.sh$//'`
2721 if $test -f Policy.sh ; then
2724 There's also a Policy hint file available, which should make the
2725 site-specific (policy) questions easier to answer.
2732 You may give one or more space-separated answers, or "none" if appropriate.
2733 A well-behaved OS will have no hints, so answering "none" or just "Policy"
2734 is a good thing. DO NOT give a wrong version or a wrong OS.
2738 rp="Which of these apply, if any?"
2741 for file in $tans; do
2742 if $test X$file = XPolicy -a -f Policy.sh; then
2744 $cat Policy.sh >> UU/config.sh
2745 elif $test -f $src/hints/$file.sh; then
2746 . $src/hints/$file.sh
2747 $cat $src/hints/$file.sh >> UU/config.sh
2748 elif $test X$tans = X -o X$tans = Xnone ; then
2751 : Give one chance to correct a possible typo.
2752 echo "$file.sh does not exist"
2754 rp="hint to use instead?"
2756 for file in $ans; do
2757 if $test -f "$src/hints/$file.sh"; then
2758 . $src/hints/$file.sh
2759 $cat $src/hints/$file.sh >> UU/config.sh
2760 elif $test X$ans = X -o X$ans = Xnone ; then
2763 echo "$file.sh does not exist -- ignored."
2770 : Remember our hint file for later.
2771 if $test -f "$src/hints/$file.sh" ; then
2781 echo "Fetching default answers from $config_sh..." >&4
2785 cp $config_sh config.sh 2>/dev/null
2795 test "$override" && . ./optdef.sh
2797 : Restore computed paths
2798 for file in $loclist $trylist; do
2799 eval $file="\$_$file"
2804 Configure uses the operating system name and version to set some defaults.
2805 The default value is probably right if the name rings a bell. Otherwise,
2806 since spelling matters for me, either accept the default or answer "none"
2813 ''|' '|none) dflt=none ;;
2814 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
2817 *) dflt="$osname" ;;
2819 rp="Operating system name?"
2823 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
2829 ''|' '|none) dflt=none ;;
2830 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
2831 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
2833 ''|' ') dflt=none ;;
2838 *) dflt="$osvers" ;;
2840 rp="Operating system version?"
2850 : who configured the system
2851 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
2852 cf_by=`(logname) 2>/dev/null`
2855 cf_by=`(whoami) 2>/dev/null`
2857 "") cf_by=unknown ;;
2861 : set up the script used to warn in case of inconsistency
2868 echo "*** WHOA THERE!!! ***" >&4
2869 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2870 rp=" Keep the $hint value?"
2873 y) td=$was; tu=$was;;
2877 : function used to set $1 to $val
2878 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2880 $define$undef) . ./whoa; eval "$var=\$td";;
2881 $undef$define) . ./whoa; eval "$var=\$tu";;
2882 *) eval "$var=$val";;
2885 case "$usethreads" in
2886 $define|true|[yY]*) dflt='y';;
2891 Perl can be built to take advantage of threads on some systems.
2892 To do so, Configure can be run with -Dusethreads.
2894 Note that threading is a highly experimental feature, and
2895 some known race conditions still remain. If you choose to try
2896 it, be very sure to not actually deploy it for production
2897 purposes. README.threads has more details, and is required
2898 reading if you enable threads.
2900 If this doesn't make any sense to you, just accept the default '$dflt'.
2902 rp='Build a threading Perl?'
2905 y|Y) val="$define" ;;
2911 case "$usethreads" in
2915 As of 5.5.640, Perl has two different internal threading implementations,
2916 the 5.005 version (5005threads) and an interpreter-based version
2917 (ithreads) that has one interpreter per thread. Both are very
2918 experimental. This arrangement exists to help developers work out
2919 which one is better.
2921 If you're a casual user, you probably don't want interpreter-threads
2922 at this time. There doesn't yet exist a way to create threads from
2923 within Perl in this model, i.e., "use Thread;" will NOT work.
2925 : Default to ithreads unless overridden on command line or with
2928 case "$use5005threads" in
2929 $define|true|[yY]*) dflt='n';;
2931 case "$useithreads" in
2932 $undef|false|[nN]*) dflt='n';;
2934 rp='Use interpreter-based ithreads?'
2937 y|Y) val="$define" ;;
2942 : Now set use5005threads to the opposite value.
2943 case "$useithreads" in
2944 $define) val="$undef" ;;
2951 useithreads="$undef"
2952 use5005threads="$undef"
2956 case "$useithreads$use5005threads" in
2960 You cannot have both the ithreads and the 5.005 threads enabled
2961 at the same time. Disabling the 5.005 threads since they are
2962 much less stable than the ithreads.
2965 use5005threads="$undef"
2969 case "$d_oldpthreads" in
2970 '') : Configure tests would be welcome here. For now, assume undef.
2972 *) val="$d_oldpthreads" ;;
2978 case "$usethreads" in
2979 "$define"|true|[yY]*)
2980 : Look for a hint-file generated 'call-back-unit'. If the
2981 : user has specified that a threading perl is to be built,
2982 : we may need to set or change some other defaults.
2983 if $test -f usethreads.cbu; then
2984 echo "Your platform has some specific hints for threaded builds, using them..."
2988 (Your platform doesn't have any specific hints for threaded builds.
2989 Assuming POSIX threads, then.)
2997 Perl can be built so that multiple Perl interpreters can coexist
2998 within the same Perl executable.
3001 case "$useithreads" in
3004 This multiple interpreter support is required for interpreter-based threads.
3008 *) case "$usemultiplicity" in
3009 $define|true|[yY]*) dflt='y';;
3013 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
3014 rp='Build Perl for multiplicity?'
3017 y|Y) val="$define" ;;
3025 : make some quick guesses about what we are up against
3027 $echo $n "Hmm... $c"
3037 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
3038 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
3040 echo "Looks kind of like an OSF/1 system, but we'll see..."
3042 elif test `echo abc | $tr a-z A-Z` = Abc ; then
3043 xxx=`./loc addbib blurfl $pth`
3044 if $test -f $xxx; then
3045 echo "Looks kind of like a USG system with BSD features, but we'll see..."
3049 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
3050 echo "Looks kind of like an extended USG system, but we'll see..."
3052 echo "Looks kind of like a USG system, but we'll see..."
3056 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
3057 echo "Looks kind of like a BSD system, but we'll see..."
3061 echo "Looks kind of like a Version 7 system, but we'll see..."
3064 case "$eunicefix" in
3067 There is, however, a strange, musty smell in the air that reminds me of
3068 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
3072 : it so happens the Eunice I know will not run shell scripts in Unix format
3076 echo "Congratulations. You aren't running Eunice."
3080 : Detect OS2. The p_ variable is set above in the Head.U unit.
3081 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
3082 : semicolon as a patch separator
3087 I have the feeling something is not exactly right, however...don't tell me...
3088 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
3089 (Or you may be running DOS with DJGPP.)
3094 if test -f /xenix; then
3095 echo "Actually, this looks more like a XENIX system..."
3100 echo "It's not Xenix..."
3105 if test -f /venix; then
3106 echo "Actually, this looks more like a VENIX system..."
3113 echo "Nor is it Venix..."
3116 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3117 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3124 rp="Use which C compiler?"
3127 : Look for a hint-file generated 'call-back-unit'. Now that the
3128 : user has specified the compiler, we may need to set or change some
3130 if $test -f cc.cbu; then
3136 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3137 $cat >gccvers.c <<EOM
3142 printf("%s\n", __VERSION__);
3144 printf("%s\n", "1");
3150 if $cc -o gccvers $ccflags $ldflags gccvers.c; then
3151 gccversion=`./gccvers`
3152 case "$gccversion" in
3153 '') echo "You are not using GNU cc." ;;
3154 *) echo "You are using GNU cc $gccversion."
3160 echo "*** WHOA THERE!!! ***" >&4
3161 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3162 case "$knowitall" in
3164 echo " You'd better start hunting for one and let me know about it." >&4
3170 case "$gccversion" in
3171 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3173 case "$gccversion" in
3174 '') gccosandvers='' ;;
3175 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
3176 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
3178 case "$gccosandvers" in
3179 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
3180 $osname$osvers) ;; # looking good
3181 $osname*) cat <<EOM >&4
3183 *** WHOA THERE!!! ***
3185 Your gcc has not been compiled for the exact release of
3186 your operating system ($gccosandvers versus $osname$osvers).
3188 In general it is a good idea to keep gcc synchronized with
3189 the operating system because otherwise serious problems
3190 may ensue when trying to compile software, like Perl.
3192 I'm trying to be optimistic here, though, and will continue.
3193 If later during the configuration and build icky compilation
3194 problems appear (headerfile conflicts being the most common
3195 manifestation), I suggest reinstalling the gcc to match
3196 your operating system release.
3200 *) gccosandvers='' ;; # failed to parse, better be silent
3208 : see how we invoke the C preprocessor
3210 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3211 cat <<'EOT' >testcpp.c
3217 if test ! -f cppstdin; then
3218 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
3219 # AIX cc -E doesn't show the absolute headerfile
3220 # locations but we'll cheat by using the -M flag.
3221 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
3223 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3226 echo "Keeping your $hint cppstdin wrapper."
3229 wrapper=`pwd`/cppstdin
3233 if $test "X$cppstdin" != "X" && \
3234 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3235 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3237 echo "You used to use $cppstdin $cppminus so we'll use that again."
3239 '') echo "But let's see if we can live without a wrapper..." ;;
3241 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3242 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3244 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3247 echo "(However, $cpprun $cpplast does not work, let's see...)"
3255 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3262 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3263 $cc -E <testcpp.c >testcpp.out 2>&1; \
3264 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3265 echo "Yup, it does."
3268 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
3269 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3270 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3271 echo "Yup, it does."
3274 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
3275 $cc -P <testcpp.c >testcpp.out 2>&1; \
3276 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3277 echo "Yipee, that works!"
3280 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
3281 $cc -P - <testcpp.c >testcpp.out 2>&1; \
3282 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3283 echo "At long last!"
3286 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
3287 $cpp <testcpp.c >testcpp.out 2>&1; \
3288 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3292 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
3293 $cpp - <testcpp.c >testcpp.out 2>&1; \
3294 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3295 echo "Hooray, it works! I was beginning to wonder."
3298 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
3299 $wrapper <testcpp.c >testcpp.out 2>&1; \
3300 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3306 rp="No dice. I can't find a C preprocessor. Name one:"
3310 $x_cpp <testcpp.c >testcpp.out 2>&1
3311 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3312 echo "OK, that will do." >&4
3314 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
3329 echo "Perhaps can we force $cc -E using a wrapper..."
3330 if $wrapper <testcpp.c >testcpp.out 2>&1; \
3331 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3337 echo "Nope, we'll have to live without it..."
3351 "$wrapper"|'cppstdin') ;;
3352 *) $rm -f $wrapper;;
3354 $rm -f testcpp.c testcpp.out
3356 : decide how portable to be. Allow command line overrides.
3357 case "$d_portable" in
3359 *) d_portable="$define" ;;
3362 : set up shell script to do ~ expansion
3368 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3371 if $test -f /bin/csh; then
3372 /bin/csh -f -c "glob \$1"
3377 name=\`$expr x\$1 : '..\([^/]*\)'\`
3378 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3379 if $test ! -d "\$dir"; then
3381 echo "\$me: can't locate home directory for: \$name" >&2
3386 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3402 : now set up to get a file name
3406 cat <<'EOSC' >>getfile
3422 expr $fn : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3423 fn=`echo $fn | sed 's/(.*)//'`
3429 loc_file=`expr $fn : '.*:\(.*\)'`
3430 fn=`expr $fn : '\(.*\):.*'`
3438 */*) fullpath=true;;
3447 *e*) exp_file=true;;
3450 *p*) nopath_ok=true;;
3455 *d*) type='Directory';;
3456 *l*) type='Locate';;
3461 Locate) what='File';;
3466 case "$d_portable" in
3474 while test "$type"; do
3479 true) rp="$rp (~name ok)";;
3482 if test -f UU/getfile.ok && \
3483 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3502 value=`UU/filexp $ans`
3505 if test "$ans" != "$value"; then
3506 echo "(That expands to $value on this system.)"
3520 /*) value="$ansexp" ;;
3521 [a-zA-Z]:/*) value="$ansexp" ;;
3526 echo "I shall only accept a full path name, as in /bin/ls." >&4
3527 echo "Use a ! shell escape if you wish to check pathnames." >&4
3530 echo "Please give a full path name, starting with slash." >&4
3533 echo "Note that using ~name is ok provided it expands well." >&4
3546 for fp in $gfpth; do
3547 if test "X$fp" = X.; then
3552 if test -f "$pf"; then
3554 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3556 echo "($value is not a plain file, but that's ok.)"
3559 if test X"$type" = X; then
3566 for fp in $gfpth; do
3567 if test "X$fp" = X.; then
3572 direxp="$fp/$ansexp"
3574 if test -d "$direxp"; then
3582 if test -d "$ansexp"; then
3583 echo "(Looking for $loc_file in directory $value.)"
3584 value="$value/$loc_file"
3585 ansexp="$ansexp/$loc_file"
3587 if test -f "$ansexp"; then
3590 case "$nopath_ok" in
3591 true) case "$value" in
3593 *) echo "Assuming $value will be in people's path."
3609 if test "$fastread" = yes; then
3614 rp="$what $value doesn't exist. Use that name anyway?"
3633 test "X$gfpthkeep" != Xy && gfpth=""
3636 : What should the include directory be ?
3638 $echo $n "Hmm... $c"
3642 if $test -f /bin/mips && /bin/mips; then
3643 echo "Looks like a MIPS system..."
3644 $cat >usr.c <<'EOCP'
3645 #ifdef SYSTYPE_BSD43
3649 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3650 dflt='/bsd43/usr/include'
3654 mips_type='System V'
3656 $rm -f usr.c usr.out
3657 echo "and you're compiling with the $mips_type compiler and libraries."
3661 echo "Doesn't look like a MIPS system."
3671 case "$xxx_prompt" in
3674 rp='Where are the include files you want to use?'
3682 : Set private lib path
3685 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
3690 '') dlist="$loclibpth $plibpth $glibpth";;
3691 *) dlist="$libpth";;
3694 : Now check and see which directories actually exist, avoiding duplicates
3698 if $test -d $xxx; then
3701 *) libpth="$libpth $xxx";;
3707 Some systems have incompatible or broken versions of libraries. Among
3708 the directories listed in the question below, please remove any you
3709 know not to be holding relevant libraries, and add any that are needed.
3710 Say "none" for none.
3721 rp="Directories to use for library searches?"
3728 : compute shared library extension
3731 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
3741 On some systems, shared libraries may be available. Answer 'none' if
3742 you want to suppress searching of shared libraries for the remainder
3743 of this configuration.
3746 rp='What is the file extension used for shared libraries?'
3750 : Define several unixisms.
3751 : Hints files or command line option can be used to override them.
3752 : The convoluted testing is in case hints files set either the old
3755 '') case "$exe_ext" in
3757 *) _exe="$exe_ext" ;;
3762 '') case "$lib_ext" in
3769 '') case "$obj_ext" in
3776 '') case "$path_sep" in
3787 : Which makefile gets called first. This is used by make depend.
3788 case "$firstmakefile" in
3789 '') firstmakefile='makefile';;
3793 $define|true|[yY]*) dflt='y';;
3798 Perl can be built to use the SOCKS proxy protocol library. To do so,
3799 Configure must be run with -Dusesocks. If you use SOCKS you also need
3800 to use the PerlIO abstraction layer, this will be implicitly selected.
3802 If this doesn't make any sense to you, just accept the default '$dflt'.
3804 rp='Build Perl for SOCKS?'
3807 y|Y) val="$define" ;;
3814 $define|true|[yY]*) useperlio="$define";;
3817 : Looking for optional libraries
3819 echo "Checking for optional libraries..." >&4
3824 case "$libswanted" in
3825 '') libswanted='c_s';;
3828 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
3834 for thisdir in $libpth $xlibpth; do
3835 test -d $thisdir && libspath="$libspath $thisdir"
3837 for thislib in $libswanted; do
3838 for thisdir in $libspath; do
3840 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
3841 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|tail -1`
3842 $test -f "$xxx" && eval $libscheck
3843 $test -f "$xxx" && libstyle=shared
3845 if test ! -f "$xxx"; then
3846 xxx=$thisdir/lib$thislib.$so
3847 $test -f "$xxx" && eval $libscheck
3848 $test -f "$xxx" && libstyle=shared
3850 if test ! -f "$xxx"; then
3851 xxx=$thisdir/lib$thislib$_a
3852 $test -f "$xxx" && eval $libscheck
3853 $test -f "$xxx" && libstyle=static
3855 if test ! -f "$xxx"; then
3856 xxx=$thisdir/$thislib$_a
3857 $test -f "$xxx" && eval $libscheck
3858 $test -f "$xxx" && libstyle=static
3860 if test ! -f "$xxx"; then
3861 xxx=$thisdir/lib${thislib}_s$_a
3862 $test -f "$xxx" && eval $libscheck
3863 $test -f "$xxx" && libstyle=static
3864 $test -f "$xxx" && thislib=${thislib}_s
3866 if test ! -f "$xxx"; then
3867 xxx=$thisdir/Slib$thislib$_a
3868 $test -f "$xxx" && eval $libscheck
3869 $test -f "$xxx" && libstyle=static
3871 if $test -f "$xxx"; then
3873 shared) echo "Found -l$thislib (shared)." ;;
3874 static) echo "Found -l$thislib." ;;
3875 *) echo "Found -l$thislib ($libstyle)." ;;
3879 *) dflt="$dflt -l$thislib"
3880 libsfound="$libsfound $xxx"
3882 libsfiles="$libsfiles $yyy"
3883 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
3884 case " $libsdirs " in
3886 *) libsdirs="$libsdirs $yyy" ;;
3893 if $test ! -f "$xxx"; then
3894 echo "No -l$thislib."
3905 ' '|'') dflt='none';;
3910 In order to compile $package on your machine, a number of libraries
3911 are usually needed. Include any other special libraries here as well.
3912 Say "none" for none. The default list is almost always right.
3916 rp="What libraries to use?"
3923 : determine optimization, if desired, or use for debug flag also
3925 ' '|$undef) dflt='none';;
3927 *) dflt="$optimize";;
3931 By default, $package compiles with the -O flag to use the optimizer.
3932 Alternately, you might want to use the symbolic debugger, which uses
3933 the -g flag (on traditional Unix systems). Either flag can be
3934 specified here. To use neither flag, specify the word "none".
3937 rp="What optimizer/debugger flag should be used?"
3941 'none') optimize=" ";;
3945 : We will not override a previous value, but we might want to
3946 : augment a hint file
3948 default|recommended)
3949 case "$gccversion" in
3950 1*) dflt='-fpcc-struct-return' ;;
3953 *-g*) dflt="$dflt -DDEBUGGING";;
3955 case "$gccversion" in
3956 2*) if test -d /etc/conf/kconfig.d &&
3957 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
3963 case "$gccversion" in
3967 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
3968 echo 'int main(void) { return 0; }' > gcctest.c
3969 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
3970 echo "Yes, it does." 2>&1
3973 echo "Leaving current flags $ccflags alone." 2>&1
3975 *) dflt="$dflt -fno-strict-aliasing" ;;
3978 echo "Nope, it doesn't, but that's ok." 2>&1
3985 case "$mips_type" in
3986 *BSD*|'') inclwanted="$locincpth $usrinc";;
3987 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
3989 for thisincl in $inclwanted; do
3990 if $test -d $thisincl; then
3991 if $test x$thisincl != x$usrinc; then
3993 *" -I$thisincl "*);;
3994 *) dflt="$dflt -I$thisincl ";;
4000 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4002 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4010 *) dflt="$dflt -D$2";;
4014 set signal.h LANGUAGE_C; eval $inctest
4018 ccflags="$ccflags -DSOCKS"
4023 default|recommended) dflt="$ccflags $dflt" ;;
4024 *) dflt="$ccflags";;
4033 Your C compiler may want other flags. For this question you should include
4034 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4035 but you should NOT include libraries or ld flags like -lwhatever. If you
4036 want $package to honor its debug switch, you should include -DDEBUGGING here.
4037 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4039 To use no flags, specify the word "none".
4045 rp="Any additional cc flags?"
4052 : the following weeds options from ccflags that are of no interest to cpp
4054 case "$gccversion" in
4055 1*) cppflags="$cppflags -D__GNUC__"
4057 case "$mips_type" in
4059 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4065 echo "Let me guess what the preprocessor flags are..." >&4
4079 *) ftry="$previous $flag";;
4081 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4082 >cpp1.out 2>/dev/null && \
4083 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4084 >cpp2.out 2>/dev/null && \
4085 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4086 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4088 cppflags="$cppflags $ftry"
4098 *-*) echo "They appear to be: $cppflags";;
4100 $rm -f cpp.c cpp?.out
4104 : flags used in final linking phase
4106 '') if ./venix; then
4112 *-posix*) dflt="$dflt -posix" ;;
4115 *) dflt="$ldflags";;
4118 : Try to guess additional flags to pick up local libraries.
4119 for thislibdir in $libpth; do
4120 case " $loclibpth " in
4123 *"-L$thislibdir "*) ;;
4124 *) dflt="$dflt -L$thislibdir" ;;
4136 Your C linker may need flags. For this question you should
4137 include -L/whatever and any other flags used by the C linker, but you
4138 should NOT include libraries like -lwhatever.
4140 Make sure you include the appropriate -L/path flags if your C linker
4141 does not normally search all of the directories you specified above,
4144 To use no flags, specify the word "none".
4148 rp="Any additional ld flags (NOT including libraries)?"
4154 rmlist="$rmlist pdp11"
4158 echo "Checking your choice of C compiler and flags for coherency..." >&4
4159 $cat > try.c <<'EOF'
4161 int main() { printf("Ok\n"); exit(0); }
4163 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
4165 $cat >try.msg <<'EOM'
4166 I've tried to compile and run the following simple program:
4169 $cat try.c >> try.msg
4171 $cat >> try.msg <<EOM
4178 and I got the following output:
4182 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
4183 if $sh -c './try' >>try.msg 2>&1; then
4187 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4190 cat >> try.msg <<'EOQS'
4191 If $libs contains -lsfio, and sfio is mis-configured, then it
4192 sometimes (apparently) runs and exits with a 0 status, but with no
4193 output! It may have to do with sfio's use of _exit vs. exit.
4196 rp="You have a big problem. Shall I abort Configure"
4203 echo "The program compiled OK, but exited with status $?." >>try.msg
4204 rp="You have a problem. Shall I abort Configure"
4208 echo "I can't compile the test program." >>try.msg
4209 rp="You have a BIG problem. Shall I abort Configure"
4215 case "$knowitall" in
4217 echo "(The supplied flags or libraries might be incorrect.)"
4225 *) echo "Ok. Stopping Configure." >&4
4230 n) echo "OK, that should do.";;
4232 $rm -f try try.* core
4234 : define an is-a-typedef? function
4235 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
4237 "") inclist="sys/types.h";;
4239 eval "varval=\$$var";
4243 for inc in $inclist; do
4244 echo "#include <$inc>" >>temp.c;
4246 echo "#ifdef $type" >> temp.c;
4247 echo "printf(\"We have $type\");" >> temp.c;
4248 echo "#endif" >> temp.c;
4249 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
4250 if $contains $type temp.E >/dev/null 2>&1; then
4256 *) eval "$var=\$varval";;
4259 : define an is-a-typedef? function that prompts if the type is not available.
4260 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
4262 "") inclist="sys/types.h";;
4264 eval "varval=\$$var";
4268 for inc in $inclist; do
4269 echo "#include <$inc>" >>temp.c;
4271 echo "#ifdef $type" >> temp.c;
4272 echo "printf(\"We have $type\");" >> temp.c;
4273 echo "#endif" >> temp.c;
4274 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
4276 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
4277 if $contains $type temp.E >/dev/null 2>&1; then
4278 echo "$type found." >&4;
4281 echo "$type NOT found." >&4;
4287 *) eval "$var=\$varval";;
4290 : define a shorthand compile call
4294 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
4295 : define a shorthand compile call for compilations that should be ok.
4299 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
4301 : check for lengths of integral types
4305 echo "Checking to see how big your integers are..." >&4
4306 $cat >intsize.c <<'EOCP'
4310 printf("intsize=%d;\n", (int)sizeof(int));
4311 printf("longsize=%d;\n", (int)sizeof(long));
4312 printf("shortsize=%d;\n", (int)sizeof(short));
4317 if eval $compile_ok && ./intsize > /dev/null; then
4319 echo "Your integers are $intsize bytes long."
4320 echo "Your long integers are $longsize bytes long."
4321 echo "Your short integers are $shortsize bytes long."
4325 Help! I can't compile and run the intsize test program: please enlighten me!
4326 (This is probably a misconfiguration in your system or libraries, and
4327 you really ought to fix it. Still, I'll try anyway.)
4331 rp="What is the size of an integer (in bytes)?"
4335 rp="What is the size of a long integer (in bytes)?"
4339 rp="What is the size of a short integer (in bytes)?"
4345 $rm -f intsize intsize.*
4347 : see what type lseek is declared as in the kernel
4348 rp="What is the type used for lseek's offset on this system?"
4349 set off_t lseektype long stdio.h sys/types.h
4353 echo "Checking to see how big your file offsets are..." >&4
4355 #include <sys/types.h>
4359 printf("%d\n", (int)sizeof($lseektype));
4364 if eval $compile_ok; then
4366 echo "Your file offsets are $lseeksize bytes long."
4370 echo "(I can't seem to compile the test program. Guessing...)"
4371 rp="What is the size of your file offsets (in bytes)?"
4377 : see what type file positions are declared as in the library
4378 rp="What is the type for file position used by fsetpos()?"
4379 set fpos_t fpostype long stdio.h sys/types.h
4384 *_t) zzz="$fpostype" ;;
4387 echo "Checking the size of $zzz..." >&4
4389 #include <sys/types.h>
4392 printf("%d\n", (int)sizeof($fpostype));
4397 if eval $compile_ok; then
4401 echo "(I can't execute the test program--guessing $fpossize.)" >&4
4404 echo "Your $zzz is $fpossize bytes long."
4410 echo "(I can't compile the test program. Guessing...)" >&4
4411 rp="What is the size of your file positions (in bytes)?"
4418 # Backward compatibility (uselfs is deprecated).
4420 "$define"|true|[yY]*)
4423 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
4425 uselargefiles="$define"
4429 case "$lseeksize:$fpossize" in
4432 You can have files larger than 2 gigabytes.
4435 *) case "$uselargefiles" in
4436 "$undef"|false|[nN]*) dflt='n' ;;
4441 Perl can be built to understand large files (files larger than 2 gigabytes)
4442 on some systems. To do so, Configure can be run with -Duselargefiles.
4444 If this doesn't make any sense to you, just accept the default '$dflt'.
4446 rp='Try to understand large files, if available?'
4449 y|Y) val="$define" ;;
4456 case "$uselargefiles" in
4458 : Look for a hint-file generated 'call-back-unit'. If the
4459 : user has specified that a large files perl is to be built,
4460 : we may need to set or change some other defaults.
4461 if $test -f uselargefiles.cbu; then
4462 echo "Your platform has some specific hints for large file builds, using them..."
4463 . ./uselargefiles.cbu
4465 echo "Rechecking to see how big your file offsets are..." >&4
4467 #include <sys/types.h>
4471 printf("%d\n", (int)sizeof($lseektype));
4476 if eval $compile_ok; then
4478 $echo "Your file offsets are now $lseeksize bytes long."
4482 echo "(I can't seem to compile the test program. Guessing...)"
4483 rp="What is the size of your file offsets (in bytes)?"
4488 *_t) zzz="$fpostype" ;;
4491 $echo $n "Rechecking the size of $zzz...$c" >&4
4493 #include <sys/types.h>
4496 printf("%d\n", (int)sizeof($fpostype));
4501 if eval $compile_ok; then
4506 echo "(I can't execute the test program--guessing $fpossize.)" >&4
4509 echo " $fpossize bytes." >&4
4515 echo "(I can't compile the test program. Guessing...)" >&4
4516 rp="What is the size of your file positions (in bytes)?"
4526 case "$usemorebits" in
4527 "$define"|true|[yY]*)
4528 use64bitint="$define"
4529 uselongdouble="$define"
4530 usemorebits="$define"
4532 *) usemorebits="$undef"
4536 : check for void type
4538 echo "Checking to see how well your C compiler groks the void type..." >&4
4539 case "$voidflags" in
4541 $cat >try.c <<'EOCP'
4547 extern void moo(); /* function returning void */
4548 void (*goo)(); /* ptr to func returning void */
4550 void *hue; /* generic ptr */
4563 int main() { sub(); }
4565 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
4566 voidflags=$defvoidused
4567 echo "Good. It appears to support void to the level $package wants.">&4
4568 if $contains warning .out >/dev/null 2>&1; then
4569 echo "However, you might get some warnings that look like this:"
4573 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
4574 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
4575 echo "It supports 1..."
4576 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
4577 echo "It also supports 2..."
4578 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
4580 echo "And it supports 4 but not 8 definitely."
4582 echo "It doesn't support 4..."
4583 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
4585 echo "But it supports 8."
4588 echo "Neither does it support 8."
4592 echo "It does not support 2..."
4593 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
4595 echo "But it supports 4 and 8."
4597 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
4599 echo "And it supports 4 but has not heard about 8."
4601 echo "However it supports 8 but not 4."
4606 echo "There is no support at all for void."
4611 case "$voidflags" in
4614 Support flag bits are:
4615 1: basic void declarations.
4616 2: arrays of pointers to functions returning void.
4617 4: operations between pointers to and addresses of void functions.
4618 8: generic void pointers.
4621 rp="Your void support flags add up to what?"
4628 : check for length of pointer
4632 echo "Checking to see how big your pointers are..." >&4
4633 if test "$voidflags" -gt 7; then
4634 echo '#define VOID_PTR char *' > try.c
4636 echo '#define VOID_PTR void *' > try.c
4638 $cat >>try.c <<'EOCP'
4642 printf("%d\n", (int)sizeof(VOID_PTR));
4647 if eval $compile_ok; then
4649 echo "Your pointers are $ptrsize bytes long."
4652 echo "(I can't seem to compile the test program. Guessing...)" >&4
4653 rp="What is the size of a pointer (in bytes)?"
4661 : check for long long
4663 echo "Checking to see if you have long long..." >&4
4664 echo 'int main() { long long x = 7; return 0; }' > try.c
4666 if eval $compile; then
4668 echo "You have long long."
4671 echo "You do not have long long."
4677 : check for length of long long
4678 case "${d_longlong}${longlongsize}" in
4681 echo "Checking to see how big your long longs are..." >&4
4682 $cat >try.c <<'EOCP'
4686 printf("%d\n", (int)sizeof(long long));
4691 if eval $compile_ok; then
4692 longlongsize=`./try$exe_ext`
4693 echo "Your long longs are $longlongsize bytes long."
4697 echo "(I can't seem to compile the test program. Guessing...)"
4698 rp="What is the size of a long long (in bytes)?"
4702 if $test "X$longsize" = "X$longlongsize"; then
4703 echo "(That isn't any different from an ordinary long.)"
4709 : determine filename position in cpp output
4711 echo "Computing filename position in cpp output for #include directives..." >&4
4712 echo '#include <stdio.h>' > foo.c
4715 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
4716 $grep '^[ ]*#.*stdio\.h' | \
4717 while read cline; do
4720 while $test \$# -gt 0; do
4721 if $test -r \`echo \$1 | $tr -d '"'\`; then
4726 pos=\`expr \$pos + 1\`
4738 *) pos="${fieldn}th";;
4740 echo "Your cpp writes the filename in the $pos field of the line."
4742 : locate header file
4747 for usrincdir in $usrinc
4749 if test -f \$usrincdir/\$wanted; then
4750 echo "\$usrincdir/\$wanted"
4754 awkprg='{ print \$$fieldn }'
4755 echo "#include <\$wanted>" > foo\$\$.c
4756 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
4757 $grep "^[ ]*#.*\$wanted" | \
4758 while read cline; do
4759 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
4761 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
4762 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
4767 # status = 0: grep returned 0 lines, case statement not executed
4768 # status = 1: headerfile found
4769 # status = 2: while loop executed, no headerfile found
4773 if test \$status -eq 1; then
4780 : define an alternate in-header-list? function
4781 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
4782 cont=true; xxf="echo \"<\$1> found.\" >&4";
4783 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
4784 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
4786 case $# in 4) instead=instead;; *) instead="at last";; esac;
4787 while $test "$cont"; do
4789 var=$2; eval "was=\$$2";
4790 if $test "$xxx" && $test -r "$xxx";
4792 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
4795 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
4796 set $yyy; shift; shift; yyy=$@;
4797 case $# in 0) cont="";;
4798 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
4799 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
4800 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
4801 xxnf="echo \"there is no <\$1>, ...\" >&4";;
4805 do set $yyy; var=$2; eval "was=\$$2";
4806 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
4807 set $yyy; shift; shift; yyy=$@;
4810 : see if inttypes.h is available
4811 : we want a real compile instead of Inhdr because some systems
4812 : have an inttypes.h which includes non-existent headers
4815 #include <inttypes.h>
4817 static int32_t foo32 = 0x12345678;
4821 if eval $compile; then
4822 echo "<inttypes.h> found." >&4
4825 echo "<inttypes.h> NOT found." >&4
4834 echo "Checking to see if you have int64_t..." >&4
4836 #include <sys/types.h>
4837 #$i_inttypes I_INTTYPES
4839 #include <inttypes.h>
4841 int main() { int64_t x = 7; }
4844 if eval $compile; then
4846 echo "You have int64_t."
4849 echo "You do not have int64_t."
4857 echo "Checking which 64-bit integer type we could use..." >&4
4863 val='"unsigned int"'
4868 *) case "$longsize" in
4872 val='"unsigned long"'
4877 *) case "$d_longlong:$longlongsize" in
4882 val='"unsigned long long"'
4887 *) case "$d_int64_t" in
4906 '') echo "Alas, no 64-bit integer types in sight." >&4
4909 *) echo "We could use '$quadtype' for 64-bit integers." >&4
4915 case "$uselonglong" in
4916 "$define"|true|[yY]*)
4919 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
4921 use64bitint="$define"
4924 case "$use64bits" in
4925 "$define"|true|[yY]*)
4928 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
4930 use64bitint="$define"
4933 case "$use64bitints" in
4934 "$define"|true|[yY]*)
4937 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
4939 use64bitint="$define"
4942 case "$use64bitsint" in
4943 "$define"|true|[yY]*)
4946 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
4948 use64bitint="$define"
4951 case "$uselonglongs" in
4952 "$define"|true|[yY]*)
4955 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
4957 use64bitint="$define"
4960 case "$use64bitsall" in
4961 "$define"|true|[yY]*)
4964 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
4966 use64bitall="$define"
4971 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
4973 case "$use64bitall" in
4974 "$define"|true|[yY]*) use64bitint="$define" ;;
4980 You have natively 64-bit long integers.
4984 *) case "$use64bitint" in
4985 "$define"|true|[yY]*) dflt='y';;
4994 Perl can be built to take advantage of 64-bit integer types
4995 on some systems. To do so, Configure can be run with -Duse64bitint.
4996 Choosing this option will most probably introduce binary incompatibilities.
4998 If this doesn't make any sense to you, just accept the default '$dflt'.
4999 (The default has been chosen based on your configuration.)
5001 rp='Try to use 64-bit integers, if available?'
5004 [yY]*) val="$define" ;;
5012 case "$use64bitall" in
5013 "$define"|true|[yY]*) dflt='y' ;;
5014 *) case "$longsize" in
5022 You may also choose to try maximal 64-bitness. It means using as much
5023 64-bitness as possible on the platform. This in turn means even more
5024 binary incompatibilities. On the other hand, your platform may not
5025 have any more 64-bitness available than what you already have chosen.
5027 If this doesn't make any sense to you, just accept the default '$dflt'.
5028 (The default has been chosen based on your configuration.)
5030 rp='Try to use maximal 64-bit support, if available?'
5033 [yY]*) val="$define" ;;
5038 case "$use64bitall" in
5040 case "$use64bitint" in
5044 Since you have chosen a maximally 64-bit build, I'm also turning on
5045 the use of 64-bit integers.
5047 use64bitint="$define" ;;
5052 case "$use64bitall" in
5053 "$define"|true|[yY]*)
5057 *** You have chosen a maximally 64-bit build, but your pointers
5058 *** are only 4 bytes wide, disabling maximal 64-bitness.
5061 use64bitall="$undef"
5062 case "$use64bitint" in
5063 "$define"|true|[yY]*) ;;
5066 *** Downgrading from maximal 64-bitness to using 64-bit integers.
5069 use64bitint="$define"
5077 case "$use64bitint" in
5078 "$define"|true|[yY]*)
5079 : Look for a hint-file generated 'call-back-unit'. If the
5080 : user has specified that a 64-bit perl is to be built,
5081 : we may need to set or change some other defaults.
5082 if $test -f use64bitint.cbu; then
5083 echo "Your platform has some specific hints for 64-bit integers, using them..."
5087 4) case "$archname64" in
5088 '') archname64=64int ;;
5095 case "$use64bitall" in
5096 "$define"|true|[yY]*)
5097 : Look for a hint-file generated 'call-back-unit'. If the
5098 : user has specified that a maximally 64-bit perl is to be built,
5099 : we may need to set or change some other defaults.
5100 if $test -f use64bitall.cbu; then
5101 echo "Your platform has some specific hints for 64-bit builds, using them..."
5105 4) case "$archname64" in
5106 ''|64int) archname64=64all ;;
5114 echo "Checking for GNU C Library..." >&4
5115 cat >gnulibc.c <<EOM
5127 if eval $compile_ok && ./gnulibc; then
5129 echo "You are using the GNU C Library"
5132 echo "You are not using the GNU C Library"
5138 : see if nm is to be used to determine whether a symbol is defined or not
5142 case "$d_gnulibc" in
5145 echo "nm probably won't work on the GNU C Library." >&4
5151 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
5153 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
5154 echo "'nm' won't be sufficient on this sytem." >&4
5160 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
5161 if $test $dflt -gt 20; then
5171 true|$define) dflt=y;;
5178 I can use $nm to extract the symbols from your C libraries. This
5179 is a time consuming task which may generate huge output on the disk (up
5180 to 3 megabytes) but that should make the symbols extraction faster. The
5181 alternative is to skip the 'nm' extraction part and to compile a small
5182 test program instead to determine whether each symbol is present. If
5183 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
5184 this may be the best solution.
5186 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
5189 rp="Shall I use $nm to extract C symbols from the libraries?"
5192 [Nn]*) usenm=false;;
5201 : nm options which may be necessary
5203 '') if $test -f /mach_boot; then
5205 elif $test -d /usr/ccs/lib; then
5206 nm_opt='-p' # Solaris (and SunOS?)
5207 elif $test -f /dgux; then
5209 elif $test -f /lib64/rld; then
5210 nm_opt='-p' # 64-bit Irix
5216 : nm options which may be necessary for shared libraries but illegal
5217 : for archive libraries. Thank you, Linux.
5218 case "$nm_so_opt" in
5219 '') case "$myuname" in
5221 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
5222 nm_so_opt='--dynamic'
5231 : get list of predefined functions in a handy place
5236 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
5243 *) for thislib in $libs; do
5246 : Handle C library specially below.
5249 thislib=`echo $thislib | $sed -e 's/^-l//'`
5250 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
5252 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
5254 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
5256 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
5258 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
5260 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
5262 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
5267 libnames="$libnames $try"
5269 *) libnames="$libnames $thislib" ;;
5278 for xxx in $libpth; do
5279 $test -r $1 || set $xxx/libc.$so
5280 : The messy sed command sorts on library version numbers.
5282 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
5283 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
5285 s/[0-9][0-9]*/0000&/g
5286 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
5289 $sort | $sed -e 's/^.* //'`
5292 $test -r $1 || set /usr/ccs/lib/libc.$so
5293 $test -r $1 || set /lib/libsys_s$_a
5299 if $test -r "$1"; then
5300 echo "Your (shared) C library seems to be in $1."
5302 elif $test -r /lib/libc && $test -r /lib/clib; then
5303 echo "Your C library seems to be in both /lib/clib and /lib/libc."
5305 libc='/lib/clib /lib/libc'
5306 if $test -r /lib/syslib; then
5307 echo "(Your math library is in /lib/syslib.)"
5308 libc="$libc /lib/syslib"
5310 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5311 echo "Your C library seems to be in $libc, as you said before."
5312 elif $test -r $incpath/usr/lib/libc$_a; then
5313 libc=$incpath/usr/lib/libc$_a;
5314 echo "Your C library seems to be in $libc. That's fine."
5315 elif $test -r /lib/libc$_a; then
5317 echo "Your C library seems to be in $libc. You're normal."
5319 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
5321 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
5322 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
5323 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
5325 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5327 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5330 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
5332 if $test -r "$tans"; then
5333 echo "Your C library seems to be in $tans, of all places."
5339 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5343 If the guess above is wrong (which it might be if you're using a strange
5344 compiler, or your machine supports multiple models), you can override it here.
5349 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
5351 I can't seem to find your C library. I've looked in the following places:
5354 $sed 's/^/ /' libpath
5357 None of these seems to contain your C library. I need to get its name...
5362 rp='Where is your C library?'
5367 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
5368 set X `cat libnames`
5371 case $# in 1) xxx=file; esac
5372 echo "Extracting names from the following $xxx for later perusal:" >&4
5374 $sed 's/^/ /' libnames >&4
5376 $echo $n "This may take a while...$c" >&4
5380 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
5381 *) $nm $nm_opt $file 2>/dev/null;;
5386 $grep fprintf libc.tmp > libc.ptf
5387 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
5388 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
5390 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
5392 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5394 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
5396 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5398 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
5400 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5402 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
5404 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5406 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
5408 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5410 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
5412 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5414 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
5415 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
5417 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5419 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
5421 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5423 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
5425 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5427 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
5429 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5431 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
5433 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5435 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
5437 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5439 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
5441 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5443 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
5445 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5448 $nm -p $* 2>/dev/null >libc.tmp
5449 $grep fprintf libc.tmp > libc.ptf
5450 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
5451 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
5457 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
5459 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
5460 for thisname in $libnames $libc; do
5461 $ar t $thisname >>libc.tmp
5463 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
5465 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
5466 # Repeat libc to extract forwarders to DLL entries too
5467 for thisname in $libnames $libc; do
5468 $ar tv $thisname >>libc.tmp
5469 # Revision 50 of EMX has bug in $ar.
5470 # it will not extract forwarders to DLL entries
5471 # Use emximp which will extract exactly them.
5472 emximp -o tmp.imp $thisname \
5474 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
5475 < tmp.imp >>libc.tmp
5478 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
5481 echo "$ar didn't seem to work right." >&4
5482 echo "Maybe this is a Cray...trying bld instead..." >&4
5483 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
5485 for thisname in $libnames; do
5487 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
5488 $ar t $thisname >>libc.tmp
5492 echo "That didn't work either. Giving up." >&4
5499 if $test -f /lib/syscalls.exp; then
5501 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
5502 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*$/\1/p' /lib/syscalls.exp >>libc.list
5506 $rm -f libnames libpath
5508 : is a C symbol defined?
5511 -v) tf=libc.tmp; tc=""; tdc="";;
5512 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
5513 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
5516 case "$reuseval-$4" in
5518 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
5524 if $contains $tlook $tf >/dev/null 2>&1;
5529 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
5530 if $cc -o t $optimize $ccflags $ldflags t.c $libs >/dev/null 2>&1;
5538 $define) tval=true;;
5544 : define an is-in-libc? function
5545 inlibc='echo " "; td=$define; tu=$undef;
5546 sym=$1; var=$2; eval "was=\$$2";
5548 case "$reuseval$was" in
5558 echo "$sym() found." >&4;
5559 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
5561 echo "$sym() NOT found." >&4;
5562 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
5566 $define) echo "$sym() found." >&4;;
5567 *) echo "$sym() NOT found." >&4;;
5571 : see if sqrtl exists
5576 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
5579 case "$uselongdouble" in
5580 $define|true|[yY]*) dflt='y';;
5585 Perl can be built to take advantage of long doubles which
5586 (if available) may give more accuracy and range for floating point numbers.
5588 If this doesn't make any sense to you, just accept the default '$dflt'.
5590 rp='Try to use long doubles if available?'
5593 y|Y) val="$define" ;;
5599 case "$uselongdouble" in
5600 true|[yY]*) uselongdouble="$define" ;;
5603 case "$uselongdouble" in
5605 : Look for a hint-file generated 'call-back-unit'. If the
5606 : user has specified that long doubles should be used,
5607 : we may need to set or change some other defaults.
5608 if $test -f uselongdouble.cbu; then
5609 echo "Your platform has some specific hints for long doubles, using them..."
5610 . ./uselongdouble.cbu
5613 (Your platform doesn't have any specific hints for long doubles.)
5619 case "$uselongdouble:$d_sqrtl" in
5623 *** You requested the use of long doubles but you do not seem to have
5624 *** the mathematic functions for long doubles. I'm disabling the use
5625 *** of long doubles.
5628 uselongdouble=$undef
5632 : check for length of double
5634 case "$doublesize" in
5636 echo "Checking to see how big your double precision numbers are..." >&4
5637 $cat >try.c <<'EOCP'
5641 printf("%d\n", (int)sizeof(double));
5646 if eval $compile_ok; then
5648 echo "Your double is $doublesize bytes long."
5651 echo "(I can't seem to compile the test program. Guessing...)"
5652 rp="What is the size of a double precision number (in bytes)?"
5660 : check for long doubles
5662 echo "Checking to see if you have long double..." >&4
5663 echo 'int main() { long double x = 7.0; }' > try.c
5665 if eval $compile; then
5667 echo "You have long double."
5670 echo "You do not have long double."
5676 : check for length of long double
5677 case "${d_longdbl}${longdblsize}" in
5680 echo "Checking to see how big your long doubles are..." >&4
5681 $cat >try.c <<'EOCP'
5685 printf("%d\n", sizeof(long double));
5690 if eval $compile; then
5691 longdblsize=`./try$exe_ext`
5692 echo "Your long doubles are $longdblsize bytes long."
5696 echo "(I can't seem to compile the test program. Guessing...)" >&4
5697 rp="What is the size of a long double (in bytes)?"
5701 if $test "X$doublesize" = "X$longdblsize"; then
5702 echo "(That isn't any different from an ordinary double.)"
5708 case "$useperlio" in
5709 $define|true|[yY]*|'') dflt='y';;
5714 Previous version of $package used the standard IO mechanisms as
5715 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
5716 alternate IO mechanisms via the PerlIO abstraction layer, but the
5717 stdio mechanism is still available if needed. The abstraction layer
5718 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
5719 Using PerlIO with sfio may cause problems with some extension modules.
5721 If this doesn't make any sense to you, just accept the default '$dflt'.
5723 rp='Use the PerlIO abstraction layer?'
5730 echo "Ok, doing things the stdio way."
5739 case "$useperlio" in
5740 $define|true|[yY]*) ;;
5743 You are using the SOCKS proxy protocol library which means that you
5744 should also use the PerlIO layer. You may be headed for trouble.
5753 : determine the architecture name
5755 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5756 tarch=`arch`"-$osname"
5757 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5758 if uname -m > tmparch 2>&1 ; then
5759 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5760 -e 's/$/'"-$osname/" tmparch`
5768 case "$myarchname" in
5771 echo "(Your architecture name used to be $myarchname.)"
5778 *) dflt="$archname";;
5780 rp='What is your architecture name'
5783 case "$usethreads" in
5785 echo "Threads selected." >&4
5787 *-thread*) echo "...and architecture name already has -thread." >&4
5789 *) archname="$archname-thread"
5790 echo "...setting architecture name to $archname." >&4
5795 case "$usemultiplicity" in
5797 echo "Multiplicity selected." >&4
5799 *-multi*) echo "...and architecture name already has -multi." >&4
5801 *) archname="$archname-multi"
5802 echo "...setting architecture name to $archname." >&4
5807 case "$use64bitint$use64bitall" in
5809 case "$archname64" in
5811 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
5814 case "$use64bitint" in
5815 "$define") echo "64 bit integers selected." >&4 ;;
5817 case "$use64bitall" in
5818 "$define") echo "Maximal 64 bitness selected." >&4 ;;
5821 *-$archname64*) echo "...and architecture name already has $archname64." >&4
5823 *) archname="$archname-$archname64"
5824 echo "...setting architecture name to $archname." >&4
5830 case "$uselongdouble" in
5832 echo "Long doubles selected." >&4
5833 case "$longdblsize" in
5835 "...but long doubles are equal to doubles, not changing architecture name." >&4
5839 *-ld*) echo "...and architecture name already has -ld." >&4
5841 *) archname="$archname-ld"
5842 echo "...setting architecture name to $archname." >&4
5849 case "$useperlio" in
5851 echo "Perlio selected." >&4
5854 echo "Perlio not selected, using stdio." >&4
5856 *-stdio*) echo "...and architecture name already has -stdio." >&4
5858 *) archname="$archname-stdio"
5859 echo "...setting architecture name to $archname." >&4
5865 : determine root of directory hierarchy where package will be installed.
5868 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
5876 By default, $package will be installed in $dflt/bin, manual pages
5877 under $dflt/man, etc..., i.e. with $dflt as prefix for all
5878 installation directories. Typically this is something like /usr/local.
5879 If you wish to have binaries under /usr/bin but other parts of the
5880 installation under /usr/local, that's ok: you will be prompted
5881 separately for each of the installation directories, the prefix being
5882 only used to set the defaults.
5886 rp='Installation prefix to use?'
5894 *) oldprefix="$prefix";;
5904 $define|true) afs=true ;;
5905 $undef|false) afs=false ;;
5906 *) if test -d /afs; then
5914 echo "AFS may be running... I'll be extra cautious then..." >&4
5916 echo "AFS does not seem to be running..." >&4
5919 : determine installation prefix for where package is to be installed.
5923 Since you are running AFS, I need to distinguish the directory in which
5924 files will reside from the directory in which they are installed (and from
5925 which they are presumably copied to the former directory by occult means).
5928 case "$installprefix" in
5929 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
5930 *) dflt="$installprefix";;
5935 In some special cases, particularly when building $package for distribution,
5936 it is convenient to distinguish between the directory in which files should
5937 be installed from the directory ($prefix) in which they
5938 will eventually reside. For most users, these two directories are the same.
5941 case "$installprefix" in
5943 *) dflt=$installprefix;;
5947 rp='What installation prefix should I use for installing files?'
5949 installprefix="$ans"
5950 installprefixexp="$ansexp"
5952 : set the prefixit variable, to compute a suitable default value
5953 prefixit='case "$3" in
5955 case "$oldprefix" in
5956 "") eval "$1=\"\$$2\"";;
5963 ""|" ") eval "$1=\"\$$2\"";;
5969 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
5971 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
5972 /*-$oldprefix/*|\~*-$oldprefix/*)
5973 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
5974 *) eval "$1=\"\$$2\"";;
5979 : get the patchlevel
5981 echo "Getting the current patchlevel..." >&4
5982 if $test -r $rsrc/patchlevel.h;then
5983 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
5984 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
5985 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5986 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
5987 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
5988 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5997 $echo "(You have $package version $patchlevel subversion $subversion.)"
6000 : XXX Should be a Configure test for double-dots in filenames.
6001 version=`echo $revision $patchlevel $subversion | \
6002 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
6003 api_versionstring=`echo $api_revision $api_version $api_subversion | \
6004 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
6007 version=`echo $revision $patchlevel $subversion | \
6008 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
6009 api_versionstring=`echo $api_revision $api_version $api_subversion | \
6010 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
6013 : Special case the 5.005_xx maintenance series, which used 5.005
6014 : without any subversion label as a subdirectory in $sitelib
6015 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
6016 api_versionstring='5.005'
6019 : determine installation style
6020 : For now, try to deduce it from prefix unless it is already set.
6021 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6022 case "$installstyle" in
6023 '') case "$prefix" in
6024 *perl*) dflt='lib';;
6025 *) dflt='lib/perl5' ;;
6028 *) dflt="$installstyle" ;;
6030 : Probably not worth prompting for this since we prompt for all
6031 : the directories individually, and the prompt would be too long and
6035 : determine where private library files go
6036 : Usual default is /usr/local/lib/perl5/$version.
6037 : Also allow things like /opt/perl/lib/$version, since
6038 : /opt/perl/lib/perl5... would be redundant.
6039 : The default "style" setting is made in installstyle.U
6040 case "$installstyle" in
6041 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6042 *) set dflt privlib lib/$version ;;
6047 There are some auxiliary files for $package that need to be put into a
6048 private library directory that is accessible by everyone.
6052 rp='Pathname where the private library files will reside?'
6055 privlibexp="$ansexp"
6056 : Change installation prefix, if necessary.
6057 if $test X"$prefix" != X"$installprefix"; then
6058 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
6060 installprivlib="$privlibexp"
6063 : set the prefixup variable, to restore leading tilda escape
6064 prefixup='case "$prefixexp" in
6066 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6069 : determine where public architecture dependent libraries go
6072 : privlib default is /usr/local/lib/$package/$version
6073 : archlib default is /usr/local/lib/$package/$version/$archname
6074 : privlib may have an optional trailing /share.
6075 tdflt=`echo $privlib | $sed 's,/share$,,'`
6076 tdflt=$tdflt/$archname
6085 $spackage contains architecture-dependent library files. If you are
6086 sharing libraries in a heterogeneous environment, you might store
6087 these files in a separate location. Otherwise, you can just include
6088 them with the rest of the public library files.
6092 rp='Where do you want to put the public architecture-dependent libraries?'
6095 archlibexp="$ansexp"
6096 if $test X"$archlib" = X"$privlib"; then
6101 : Change installation prefix, if necessary.
6102 if $test X"$prefix" != X"$installprefix"; then
6103 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
6105 installarchlib="$archlibexp"
6109 : Binary compatibility with 5.005 is not possible for builds
6110 : with advanced features
6111 case "$usethreads$usemultiplicity" in
6113 bincompat5005="$undef"
6114 d_bincompat5005="$undef"
6118 This version of Perl can be compiled for binary compatibility with 5.005.
6119 If you decide to do so, you will be able to continue using most of the
6120 extensions that were compiled for Perl 5.005.
6123 case "$bincompat5005$d_bincompat5005" in
6124 *"$undef"*) dflt=n ;;
6127 rp='Binary compatibility with Perl 5.005?'
6130 y*) val="$define" ;;
6135 case "$d_bincompat5005" in
6137 bincompat5005="$define"
6139 *) bincompat5005="$undef"
6140 d_bincompat5005="$undef"
6147 : see if setuid scripts can be secure
6150 Some kernels have a bug that prevents setuid #! scripts from being
6151 secure. Some sites have disabled setuid #! scripts because of this.
6153 First let's decide if your kernel supports secure setuid #! scripts.
6154 (If setuid #! scripts would be secure but have been disabled anyway,
6155 don't say that they are secure if asked.)
6160 if $test -d /dev/fd; then
6161 echo "#!$ls" >reflect
6162 chmod +x,u+s reflect
6163 ./reflect >flect 2>&1
6164 if $contains "/dev/fd" flect >/dev/null; then
6165 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6169 If you are not sure if they are secure, I can check but I'll need a
6170 username and password different from the one you are using right now.
6171 If you don't have such a username or don't want me to test, simply
6175 rp='Other username to test security of setuid scripts with?'
6180 case "$d_suidsafe" in
6181 '') echo "I'll assume setuid scripts are *not* secure." >&4
6184 echo "Well, the $hint value is *not* secure." >&4
6186 *) echo "Well, the $hint value *is* secure." >&4
6191 $rm -f reflect flect
6192 echo "#!$ls" >reflect
6193 chmod +x,u+s reflect
6196 echo '"su" will (probably) prompt you for '"$ans's password."
6197 su $ans -c './reflect >flect'
6198 if $contains "/dev/fd" flect >/dev/null; then
6199 echo "Okay, it looks like setuid scripts are secure." >&4
6202 echo "I don't think setuid scripts are secure." >&4
6207 rp='Does your kernel have *secure* setuid scripts?'
6210 [yY]*) val="$define";;
6215 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6216 echo "(That's for file descriptors, not floppy disks.)"
6222 $rm -f reflect flect
6224 : now see if they want to do setuid emulation
6227 case "$d_suidsafe" in
6230 echo "No need to emulate SUID scripts since they are secure here." >& 4
6234 Some systems have disabled setuid scripts, especially systems where
6235 setuid scripts cannot be secure. On systems where setuid scripts have
6236 been disabled, the setuid/setgid bits on scripts are currently
6237 useless. It is possible for $package to detect those bits and emulate
6238 setuid/setgid in a secure fashion. This emulation will only work if
6239 setuid scripts have been disabled in your kernel.
6243 "$define") dflt=y ;;
6246 rp="Do you want to do setuid/setgid emulation?"
6249 [yY]*) val="$define";;
6257 : see if this is a malloc.h system
6258 set malloc.h i_malloc
6261 : see if stdlib is available
6262 set stdlib.h i_stdlib
6265 : determine which malloc to compile in
6267 case "$usemymalloc" in
6268 ''|[yY]*|true|$define) dflt='y' ;;
6275 rp="Do you wish to attempt to use the malloc that comes with $package?"
6281 mallocsrc='malloc.c'
6282 mallocobj="malloc$_o"
6283 d_mymalloc="$define"
6286 : Remove malloc from list of libraries to use
6287 echo "Removing unneeded -lmalloc from library list" >&4
6288 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6291 echo "libs = $libs" >&4
6303 : compute the return types of malloc and free
6305 $cat >malloc.c <<END
6309 #include <sys/types.h>
6323 case "$malloctype" in
6325 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6332 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6336 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6343 echo "Your system uses $freetype free(), it would seem." >&4
6347 After $package is installed, you may wish to install various
6348 add-on modules and utilities. Typically, these add-ons will
6349 be installed under $prefix with the rest
6350 of this package. However, you may wish to install such add-ons
6351 elsewhere under a different prefix.
6353 If you do not wish to put everything under a single prefix, that's
6354 ok. You will be prompted for the individual locations; this siteprefix
6355 is only used to suggest the defaults.
6357 The default should be fine for most people.
6361 rp='Installation prefix to use for add-on modules and utilities?'
6362 : XXX Here might be another good place for an installstyle setting.
6363 case "$siteprefix" in
6365 *) dflt=$siteprefix ;;
6368 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6370 case "$siteprefix" in
6374 *) oldsiteprefix="$prefix";;
6379 siteprefixexp="$ansexp"
6381 : determine where site specific libraries go.
6382 : Usual default is /usr/local/lib/perl5/site_perl/$version
6383 : The default "style" setting is made in installstyle.U
6384 : XXX No longer works with Prefixit stuff.
6385 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6387 '') case "$installstyle" in
6388 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6389 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6397 The installation process will create a directory for
6398 site-specific extensions and modules. Most users find it convenient
6399 to place all site-specific files in this directory rather than in the
6400 main distribution directory.
6404 rp='Pathname for the site-specific library files?'
6407 sitelibexp="$ansexp"
6408 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6409 : Change installation prefix, if necessary.
6410 if $test X"$prefix" != X"$installprefix"; then
6411 installsitelib=`echo $sitelibexp | $sed "s#^$prefix#$installprefix#"`
6413 installsitelib="$sitelibexp"
6416 : determine where site specific architecture-dependent libraries go.
6417 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6418 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6419 : sitelib may have an optional trailing /share.
6421 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6422 dflt="$dflt/$archname"
6427 set sitearch sitearch none
6431 The installation process will also create a directory for
6432 architecture-dependent site-specific extensions and modules.
6436 rp='Pathname for the site-specific architecture-dependent library files?'
6439 sitearchexp="$ansexp"
6440 : Change installation prefix, if necessary.
6441 if $test X"$prefix" != X"$installprefix"; then
6442 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
6444 installsitearch="$sitearchexp"
6449 The installation process will also create a directory for
6450 vendor-supplied add-ons. Vendors who supply perl with their system
6451 may find it convenient to place all vendor-supplied files in this
6452 directory rather than in the main distribution directory. This will
6453 ease upgrades between binary-compatible maintenance versions of perl.
6455 Of course you may also use these directories in whatever way you see
6456 fit. For example, you might use them to access modules shared over a
6457 company-wide network.
6459 The default answer should be fine for most people.
6460 This causes further questions about vendor add-ons to be skipped
6461 and no vendor-specific directories will be configured for perl.
6464 rp='Do you want to configure vendor-specific add-on directories?'
6465 case "$usevendorprefix" in
6466 define|true|[yY]*) dflt=y ;;
6467 *) : User may have set vendorprefix directly on Configure command line.
6468 case "$vendorprefix" in
6477 rp='Installation prefix to use for vendor-supplied add-ons?'
6478 case "$vendorprefix" in
6480 *) dflt=$vendorprefix ;;
6483 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6485 case "$vendorprefix" in
6489 *) oldvendorprefix="$prefix";;
6493 usevendorprefix="$define"
6495 vendorprefixexp="$ansexp"
6497 *) usevendorprefix="$undef"
6503 case "$vendorprefix" in
6504 '') d_vendorlib="$undef"
6508 *) d_vendorlib="$define"
6509 : determine where vendor-supplied modules go.
6510 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6511 case "$vendorlib" in
6513 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6514 case "$installstyle" in
6515 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6516 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6519 *) dflt="$vendorlib"
6523 rp='Pathname for the vendor-supplied library files?'
6526 vendorlibexp="$ansexp"
6529 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6530 : Change installation prefix, if necessary.
6531 if $test X"$prefix" != X"$installprefix"; then
6532 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
6534 installvendorlib="$vendorlibexp"
6537 case "$vendorprefix" in
6538 '') d_vendorarch="$undef"
6542 *) d_vendorarch="$define"
6543 : determine where vendor-supplied architecture-dependent libraries go.
6544 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6545 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6546 : vendorlib may have an optional trailing /share.
6547 case "$vendorarch" in
6548 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6549 dflt="$dflt/$archname"
6551 *) dflt="$vendorarch" ;;
6554 rp='Pathname for vendor-supplied architecture-dependent files?'
6557 vendorarchexp="$ansexp"
6560 : Change installation prefix, if necessary.
6561 if $test X"$prefix" != X"$installprefix"; then
6562 installvendorarch=`echo $vendorarchexp | sed "s#^$prefix#$installprefix#"`
6564 installvendorarch="$vendorarchexp"
6567 : Final catch-all directories to search
6570 Lastly, you can have perl look in other directories for extensions and
6571 modules in addition to those already specified.
6572 These directories will be searched after
6576 test X"$vendorlib" != "X" && echo ' ' $vendorlib
6577 test X"$vendorarch" != "X" && echo ' ' $vendorarch
6579 case "$otherlibdirs" in
6580 ''|' ') dflt='none' ;;
6581 *) dflt="$otherlibdirs" ;;
6584 Enter a colon-separated set of extra paths to include in perl's @INC
6585 search path, or enter 'none' for no extra paths.
6589 rp='Colon-separated list of additional directories for perl to search?'
6592 ' '|''|none) otherlibdirs=' ' ;;
6593 *) otherlibdirs="$ans" ;;
6595 case "$otherlibdirs" in
6599 set d_perl_otherlibdirs
6602 : Cruising for prototypes
6604 echo "Checking out function prototypes..." >&4
6605 $cat >prototype.c <<'EOCP'
6606 int main(int argc, char *argv[]) {
6609 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
6610 echo "Your C compiler appears to support function prototypes."
6613 echo "Your C compiler doesn't seem to understand function prototypes."
6620 case "$prototype" in
6622 *) ansi2knr='ansi2knr'
6627 This version of $package can only be compiled by a compiler that
6628 understands function prototypes. Unfortunately, your C compiler
6630 doesn't seem to understand them. Sorry about that.
6632 If GNU cc is available for your system, perhaps you could try that instead.
6634 Eventually, we hope to support building Perl with pre-ANSI compilers.
6635 If you would like to help in that effort, please contact <perlbug@perl.org>.
6637 Aborting Configure now.
6643 : determine where public executables go
6648 rp='Pathname where the public executables will reside?'
6650 if $test "X$ansexp" != "X$binexp"; then
6655 : Change installation prefix, if necessary.
6656 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6657 if $test X"$prefix" != X"$installprefix"; then
6658 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
6660 installbin="$binexp"
6663 : Find perl5.005 or later.
6664 echo "Looking for a previously installed perl5.005 or later... "
6666 '') for tdir in `echo "$binexp:$PATH" | $sed "s/$path_sep/ /g"`; do
6667 : Check if this perl is recent and can load a simple module
6668 if $test -x $tdir/perl && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6671 elif $test -x $tdir/perl5 && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6681 '') echo "None found. That's ok.";;
6682 *) echo "Using $perl5." ;;
6685 : Determine list of previous versions to include in @INC
6686 $cat > getverlist <<EOPL
6689 \$api_versionstring = "$api_versionstring";
6690 \$version = "$version";
6691 \$stem = "$sitelib_stem";
6692 \$archname = "$archname";
6694 $cat >> getverlist <<'EOPL'
6695 # Can't have leading @ because metaconfig interprets it as a command!
6696 ;@inc_version_list=();
6697 # XXX Redo to do opendir/readdir?
6700 ;@candidates = glob("5.*");
6706 # XXX ToDo: These comparisons must be reworked when two-digit
6707 # subversions come along, so that 5.7.10 compares as greater than
6708 # 5.7.3! By that time, hope that 5.6.x is sufficiently
6709 # widespread that we can use the built-in version vectors rather
6710 # than reinventing them here. For 5.6.0, however, we must
6711 # assume this script will likely be run by 5.005_0x. --AD 1/2000.
6712 foreach $d (@candidates) {
6713 if ($d lt $version) {
6714 if ($d ge $api_versionstring) {
6715 unshift(@inc_version_list, grep { -d } "$d/$archname", $d);
6717 elsif ($d ge "5.005") {
6718 unshift(@inc_version_list, grep { -d } $d);
6722 # Skip newer version. I.e. don't look in
6723 # 5.7.0 if we're installing 5.6.1.
6727 if (@inc_version_list) {
6728 print join(' ', @inc_version_list);
6731 # Blank space to preserve value for next Configure run.
6736 case "$inc_version_list" in
6737 '') if test -x "$perl5"; then
6738 dflt=`$perl5 getverlist`
6743 $undef) dflt='none' ;;
6744 *) dflt="$inc_version_list" ;;
6747 ''|' ') dflt=none ;;
6750 5.005) case "$bincompat5005" in
6751 $define|true|[yY]*) ;;
6758 In order to ease the process of upgrading, this version of perl
6759 can be configured to use modules built and installed with earlier
6760 versions of perl that were installed under $prefix. Specify here
6761 the list of earlier versions that this version of perl should check.
6762 If Configure detected no earlier versions of perl installed under
6763 $prefix, then the list will be empty. Answer 'none' to tell perl
6764 to not search earlier versions.
6766 The default should almost always be sensible, so if you're not sure,
6767 just accept the default.
6770 rp='List of earlier versions to include in @INC?'
6773 [Nn]one|''|' ') inc_version_list=' ' ;;
6774 *) inc_version_list="$ans" ;;
6776 case "$inc_version_list" in
6778 inc_version_list_init='0';;
6779 *) inc_version_list_init=`echo $inc_version_list |
6780 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6785 : determine whether to install perl also as /usr/bin/perl
6788 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
6790 Many scripts expect perl to be installed as /usr/bin/perl.
6791 I can install the perl you are about to compile also as /usr/bin/perl
6792 (in addition to $installbin/perl).
6794 case "$installusrbinperl" in
6795 "$undef"|[nN]*) dflt='n';;
6798 rp="Do you want to install perl as /usr/bin/perl?"
6801 [yY]*) val="$define";;
6807 set installusrbinperl
6810 : see if dld is available
6814 : see if dlopen exists
6821 : determine which dynamic loading, if any, to compile in
6823 dldir="ext/DynaLoader"
6836 $define) dflt='y' ;;
6839 $define) dflt='y' ;;
6841 : Does a dl_xxx.xs file exist for this operating system
6842 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
6845 rp="Do you wish to use dynamic loading?"
6852 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
6853 dflt="$dldir/dl_${osname}.xs"
6854 elif $test "$d_dlopen" = "$define" ; then
6855 dflt="$dldir/dl_dlopen.xs"
6856 elif $test "$i_dld" = "$define" ; then
6857 dflt="$dldir/dl_dld.xs"
6862 *) dflt="$dldir/$dlsrc"
6865 echo "The following dynamic loading files are available:"
6866 : Can not go over to $dldir because getfile has path hard-coded in.
6867 tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir
6868 rp="Source file to use for dynamic loading"
6874 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
6878 Some systems may require passing special flags to $cc -c to
6879 compile modules that will be used to create a shared library.
6880 To use no flags, say "none".
6883 case "$cccdlflags" in
6884 '') case "$gccversion" in
6885 '') case "$osname" in
6887 next) dflt='none' ;;
6888 irix*) dflt='-KPIC' ;;
6889 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
6890 sunos) dflt='-pic' ;;
6894 *) case "$osname" in
6895 svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
6900 *) dflt="$cccdlflags" ;;
6902 rp="Any special flags to pass to $cc -c to compile shared library modules?"
6905 none) cccdlflags=' ' ;;
6906 *) cccdlflags="$ans" ;;
6911 Some systems use ld to create libraries that can be dynamically loaded,
6912 while other systems (such as those using ELF) use $cc.
6916 '') $cat >try.c <<'EOM'
6917 /* Test for whether ELF binaries are produced */
6922 int i = open("a.out",O_RDONLY);
6925 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
6926 exit(0); /* succeed (yes, it's ELF) */
6931 if $cc $ccflags try.c >/dev/null 2>&1 && ./a.out; then
6933 You appear to have ELF support. I'll use $cc to build dynamic libraries.
6937 echo "I'll use ld to build dynamic libraries."
6946 rp="What command should be used to create dynamic libraries?"
6952 Some systems may require passing special flags to $ld to create a
6953 library that can be dynamically loaded. If your ld flags include
6954 -L/other/path options to locate libraries outside your loader's normal
6955 search path, you may need to specify those -L options here as well. To
6956 use no flags, say "none".
6959 case "$lddlflags" in
6960 '') case "$osname" in
6961 beos) dflt='-nostart' ;;
6963 case "$gccversion" in
6964 '') dflt="$dflt +vnocompatwarnings" ;;
6967 linux|irix*) dflt='-shared' ;;
6968 next) dflt='none' ;;
6969 solaris) dflt='-G' ;;
6970 sunos) dflt='-assert nodefinitions' ;;
6971 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
6975 *) dflt="$lddlflags" ;;
6978 : Try to guess additional flags to pick up local libraries.
6979 : Be careful not to append to a plain 'none'
6983 for thisflag in $ldflags; do
6988 *) dflt="$dflt $thisflag" ;;
6995 ''|' ') dflt='none' ;;
6998 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
7001 none) lddlflags=' ' ;;
7002 *) lddlflags="$ans" ;;
7007 Some systems may require passing special flags to $cc to indicate that
7008 the resulting executable will use dynamic linking. To use no flags,
7012 case "$ccdlflags" in
7013 '') case "$osname" in
7014 hpux) dflt='-Wl,-E' ;;
7015 linux) dflt='-rdynamic' ;;
7016 next) dflt='none' ;;
7017 sunos) dflt='none' ;;
7021 *) dflt="$ccdlflags" ;;
7023 rp="Any special flags to pass to $cc to use dynamic linking?"
7026 none) ccdlflags=' ' ;;
7027 *) ccdlflags="$ans" ;;
7041 # No dynamic loading being used, so don't bother even to prompt.
7044 *) case "$useshrplib" in
7045 '') case "$osname" in
7046 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
7048 also='Building a shared libperl is required for dynamic loading to work on your system.'
7053 also='Building a shared libperl is needed for MAB support.'
7071 The perl executable is normally obtained by linking perlmain.c with
7072 libperl${_a}, any static extensions (usually just DynaLoader), and
7073 any other libraries needed on this system (such as -lm, etc.). Since
7074 your system supports dynamic loading, it is probably possible to build
7075 a shared libperl.$so. If you will have more than one executable linked
7076 to libperl.$so, this will significantly reduce the size of each
7077 executable, but it may have a noticeable affect on performance. The
7078 default is probably sensible for your system.
7082 rp="Build a shared libperl.$so (y/n)"
7086 useshrplib='true' ;;
7087 *) useshrplib='false' ;;
7092 case "$useshrplib" in
7096 # Figure out a good name for libperl.so. Since it gets stored in
7097 # a version-specific architecture-dependent library, the version
7098 # number isn't really that important, except for making cc/ld happy.
7100 # A name such as libperl.so.3.1
7101 majmin="libperl.$so.$patchlevel.$subversion"
7102 # A name such as libperl.so.301
7103 majonly=`echo $patchlevel $subversion |
7104 $awk '{printf "%d%02d", $1, $2}'`
7105 majonly=libperl.$so.$majonly
7106 # I'd prefer to keep the os-specific stuff here to a minimum, and
7107 # rely on figuring it out from the naming of libc.
7108 case "${osname}${osvers}" in
7111 # XXX How handle the --version stuff for MAB?
7113 linux*) # ld won't link with a bare -lperl otherwise.
7116 cygwin*) # include version
7117 dflt=`echo libperl$version | sed -e 's/\./_/g'`$lib_ext
7119 *) # Try to guess based on whether libc has major.minor.
7121 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
7122 *libc.$so.[0-9]*) dflt=$majonly ;;
7123 *) dflt=libperl.$so ;;
7133 I need to select a good name for the shared libperl. If your system uses
7134 library names with major and minor numbers, then you might want something
7135 like $majmin. Alternatively, if your system uses a single version
7136 number for shared libraries, then you might want to use $majonly.
7137 Or, your system might be quite happy with a simple libperl.$so.
7139 Since the shared libperl will get installed into a version-specific
7140 architecture-dependent directory, the version number of the shared perl
7141 library probably isn't important, so the default should be o.k.
7144 rp='What name do you want to give to the shared libperl?'
7147 echo "Ok, I'll use $libperl"
7150 libperl="libperl${_a}"
7154 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
7158 WARNING: Use of the shrpdir variable for the installation location of
7159 the shared $libperl is not supported. It was never documented and
7160 will not work in this version. Let me (perlbug@perl.org)
7161 know of any problems this may cause.
7167 But your current setting of $shrpdir is
7168 the default anyway, so it's harmless.
7173 Further, your current attempted setting of $shrpdir
7174 conflicts with the value of $archlibexp/CORE
7175 that installperl will use.
7182 # How will the perl executable find the installed shared $libperl?
7183 # Add $xxx to ccdlflags.
7184 # If we can't figure out a command-line option, use $shrpenv to
7185 # set env LD_RUN_PATH. The main perl makefile uses this.
7186 shrpdir=$archlibexp/CORE
7189 if "$useshrplib"; then
7192 # We'll set it in Makefile.SH...
7198 xxx="-Wl,-R$shrpdir"
7200 linux|irix*|dec_osf)
7201 xxx="-Wl,-rpath,$shrpdir"
7204 # next doesn't like the default...
7207 # beos doesn't like the default, either.
7210 # hpux doesn't like the default, either.
7211 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
7214 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
7220 # Only add $xxx if it isn't already in ccdlflags.
7221 case " $ccdlflags " in
7223 *) ccdlflags="$ccdlflags $xxx"
7226 Adding $xxx to the flags
7227 passed to $ld so that the perl executable will find the
7228 installed shared $libperl.
7236 # Fix ccdlflags in AIX for building external extensions.
7237 # (For building Perl itself bare -bE:perl.exp is needed,
7238 # Makefile.SH takes care of this.)
7240 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
7242 # Respect a hint or command-line value.
7244 '') shrpenv="$tmp_shrpenv" ;;
7246 case "$ldlibpthname" in
7247 '') ldlibpthname=LD_LIBRARY_PATH ;;
7248 none) ldlibpthname='' ;;
7251 : determine where manual pages are on this system
7255 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
7256 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
7257 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
7258 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
7259 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
7260 sysman=`./loc . /usr/man/man1 $syspath`
7263 if $test -d "$sysman"; then
7264 echo "System manual is in $sysman." >&4
7266 echo "Could not find manual pages in source form." >&4
7269 : determine where manual pages go
7270 set man1dir man1dir none
7274 $spackage has manual pages available in source form.
7278 echo "However, you don't have nroff, so they're probably useless to you."
7280 '') man1dir="none";;
7283 echo "If you don't want the manual sources installed, answer 'none'."
7288 lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
7289 lookpath="$lookpath $prefixexp/man/p_man/man1"
7290 lookpath="$lookpath $prefixexp/man/u_man/man1"
7291 lookpath="$lookpath $prefixexp/man/man.1"
7293 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
7294 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
7304 rp="Where do the main $spackage manual pages (source) go?"
7306 if $test "X$man1direxp" != "X$ansexp"; then
7310 man1direxp="$ansexp"
7316 : Change installation prefix, if necessary.
7317 if $test X"$prefix" != X"$installprefix"; then
7318 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
7320 installman1dir="$man1direxp"
7323 : What suffix to use on installed man pages
7330 rp="What suffix should be used for the main $spackage man pages?"
7332 '') case "$man1dir" in
7346 *) dflt="$man1ext";;
7353 : see if we can have long filenames
7355 first=123456789abcdef
7357 if (echo hi >$first) 2>/dev/null; then
7358 if $test -f 123456789abcde; then
7359 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
7362 echo 'You can have filenames longer than 14 characters.'>&4
7367 You can't have filenames longer than 14 chars.
7368 You can't even think about them!
7374 $rm -rf 123456789abcde*
7376 : determine where library module manual pages go
7377 set man3dir man3dir none
7381 $spackage has manual pages for many of the library modules.
7387 However, you don't have nroff, so they're probably useless to you.
7390 '') man3dir="none";;
7394 case "$d_flexfnam" in
7397 However, your system can't handle the long file names like File::Basename.3.
7400 '') man3dir="none";;
7404 echo "If you don't want the manual sources installed, answer 'none'."
7405 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7407 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
7408 if $test -d "$privlib/man/man3"; then
7411 WARNING: Previous versions of perl installed man3 pages into
7412 $privlib/man/man3. This version will suggest a
7413 new default of $dflt.
7417 rp='Do you wish to preserve the old behavior?(y/n)'
7420 y*) dflt="$privlib/man/man3" ;;
7425 *) dflt="$man3dir" ;;
7432 rp="Where do the $package library man pages (source) go?"
7435 man3direxp="$ansexp"
7441 : Change installation prefix, if necessary.
7442 if $test X"$prefix" != X"$installprefix"; then
7443 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
7445 installman3dir="$man3direxp"
7448 : What suffix to use on installed man pages
7454 rp="What suffix should be used for the $package library man pages?"
7456 '') case "$man3dir" in
7470 *) dflt="$man3ext";;
7477 : see if we have to deal with yellow pages, now NIS.
7478 if $test -d /usr/etc/yp || $test -d /etc/yp; then
7479 if $test -f /usr/etc/nibindd; then
7481 echo "I'm fairly confident you're on a NeXT."
7483 rp='Do you get the hosts file via NetInfo?'
7492 y*) hostcat='nidump hosts .';;
7493 *) case "$hostcat" in
7494 nidump*) hostcat='';;
7504 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
7512 rp='Are you getting the hosts file via yellow pages?'
7515 y*) hostcat='ypcat hosts';;
7516 *) hostcat='cat /etc/hosts';;
7522 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
7525 '') test -f /etc/group && groupcat='cat /etc/group';;
7528 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
7531 : now get the host name
7533 echo "Figuring out host name..." >&4
7534 case "$myhostname" in
7536 echo 'Maybe "hostname" will work...'
7537 if tans=`sh -c hostname 2>&1` ; then
7545 if $test "$cont"; then
7547 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
7548 if tans=`cat /etc/systemid 2>&1` ; then
7550 phostname='cat /etc/systemid'
7551 echo "Whadyaknow. Xenix always was a bit strange..."
7554 elif $test -r /etc/systemid; then
7555 echo "(What is a non-Xenix system doing with /etc/systemid?)"
7558 if $test "$cont"; then
7559 echo 'No, maybe "uuname -l" will work...'
7560 if tans=`sh -c 'uuname -l' 2>&1` ; then
7562 phostname='uuname -l'
7564 echo 'Strange. Maybe "uname -n" will work...'
7565 if tans=`sh -c 'uname -n' 2>&1` ; then
7567 phostname='uname -n'
7569 echo 'Oh well, maybe I can mine it out of whoami.h...'
7570 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
7571 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
7572 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
7574 case "$myhostname" in
7575 '') echo "Does this machine have an identity crisis or something?"
7578 echo "Well, you said $myhostname before..."
7579 phostname='echo $myhostname';;
7585 : you do not want to know about this
7590 if $test "$myhostname" ; then
7592 rp='Your host name appears to be "'$myhostname'".'" Right?"
7600 : bad guess or no guess
7601 while $test "X$myhostname" = X ; do
7603 rp="Please type the (one word) name of your host:"
7608 : translate upper to lower if necessary
7609 case "$myhostname" in
7611 echo "(Normalizing case in your host name)"
7612 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
7616 case "$myhostname" in
7618 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
7619 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
7620 echo "(Trimming domain name from host name--host name is now $myhostname)"
7622 *) case "$mydomain" in
7625 test "X$hostcat" = "Xypcat hosts" &&
7626 ypmatch "$myhostname" hosts 2>/dev/null |\
7627 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
7630 test "X$hostcat" != "X" &&
7631 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
7632 /[ ]$myhostname[ . ]/p" > hosts
7635 if $test -f hosts; then
7636 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
7637 END { print sum }" hosts` = x1 || tmp_re="[ ]"
7638 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
7639 hosts | $sort | $uniq | \
7640 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
7641 case `$echo X$dflt` in
7642 X*\ *) echo "(Several hosts in the database matched hostname)"
7645 X.) echo "(You do not have fully-qualified names in the hosts database)"
7649 echo "(I cannot locate a hosts database anywhere)"
7654 tans=`./loc resolv.conf X /etc /usr/etc`
7655 if $test -f "$tans"; then
7656 echo "(Attempting domain name extraction from $tans)"
7657 dflt=.`$sed -n -e 's/ / /g' \
7658 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
7659 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
7661 .) dflt=.`$sed -n -e 's/ / /g' \
7662 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
7663 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
7670 .) echo "(No help from resolv.conf either -- attempting clever guess)"
7671 dflt=.`sh -c domainname 2>/dev/null`
7674 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
7678 case "$dflt$osname" in
7679 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
7680 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
7684 .) echo "(Lost all hope -- silly guess then)"
7690 *) dflt="$mydomain";;
7694 rp="What is your domain name?"
7704 : translate upper to lower if necessary
7707 echo "(Normalizing case in your domain name)"
7708 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
7712 : a little sanity check here
7713 case "$phostname" in
7716 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
7717 $myhostname$mydomain|$myhostname) ;;
7719 case "$phostname" in
7721 echo "(That doesn't agree with your whoami.h file, by the way.)"
7724 echo "(That doesn't agree with your $phostname command, by the way.)"
7734 I need to get your e-mail address in Internet format if possible, i.e.
7735 something like user@host.domain. Please answer accurately since I have
7736 no easy means to double check it. The default value provided below
7737 is most probably close to reality but may not be valid from outside
7738 your organization...
7742 while test "$cont"; do
7744 '') dflt="$cf_by@$myhostname$mydomain";;
7745 *) dflt="$cf_email";;
7747 rp='What is your e-mail address?'
7753 rp='Address does not look like an Internet one. Use it anyway?'
7769 If you or somebody else will be maintaining perl at your site, please
7770 fill in the correct e-mail address here so that they may be contacted
7771 if necessary. Currently, the "perlbug" program included with perl
7772 will send mail to this address in addition to perlbug@perl.org. You may
7773 enter "none" for no administrator.
7776 case "$perladmin" in
7777 '') dflt="$cf_email";;
7778 *) dflt="$perladmin";;
7780 rp='Perl administrator e-mail address'
7784 : determine whether to only install version-specific parts.
7787 Do you want to install only the version-specific parts of the perl
7788 distribution? Usually you do *not* want to do this.
7790 case "$versiononly" in
7791 "$define"|[Yy]*|true) dflt='y' ;;
7794 rp="Do you want to install only the version-specific parts of perl?"
7797 [yY]*) val="$define";;
7803 : figure out how to guarantee perl startup
7804 case "$startperl" in
7806 case "$sharpbang" in
7810 I can use the #! construct to start perl on your system. This will
7811 make startup of perl scripts faster, but may cause problems if you
7812 want to share those scripts and perl is not in a standard place
7813 ($binexp/perl) on all your platforms. The alternative is to force
7814 a shell by starting the script with a single ':' character.
7817 case "$versiononly" in
7818 "$define") dflt="$binexp/perl$version";;
7819 *) dflt="$binexp/perl";;
7821 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
7824 none) startperl=": # use perl";;
7825 *) startperl="#!$ans"
7826 if $test 30 -lt `echo "$ans" | wc -c`; then
7829 WARNING: Some systems limit the #! command to 32 characters.
7830 If you experience difficulty running Perl scripts with #!, try
7831 installing Perl in a directory with a shorter pathname.
7837 *) startperl=": # use perl"
7842 echo "I'll use $startperl to start perl scripts."
7844 : figure best path for perl in scripts
7847 perlpath="$binexp/perl"
7848 case "$startperl" in
7853 I will use the "eval 'exec'" idiom to start Perl on your system.
7854 I can use the full path of your Perl binary for this purpose, but
7855 doing so may cause problems if you want to share those scripts and
7856 Perl is not always in a standard place ($binexp/perl).
7860 rp="What path shall I use in \"eval 'exec'\"?"
7867 case "$startperl" in
7869 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
7872 : determine where public executable scripts go
7873 set scriptdir scriptdir
7875 case "$scriptdir" in
7878 : guess some guesses
7879 $test -d /usr/share/scripts && dflt=/usr/share/scripts
7880 $test -d /usr/share/bin && dflt=/usr/share/bin
7881 $test -d /usr/local/script && dflt=/usr/local/script
7882 $test -d /usr/local/scripts && dflt=/usr/local/scripts
7883 $test -d $prefixexp/script && dflt=$prefixexp/script
7887 *) dflt="$scriptdir"
7892 Some installations have a separate directory just for executable scripts so
7893 that they can mount it across multiple architectures but keep the scripts in
7894 one spot. You might, for example, have a subdirectory of /usr/share for this.
7895 Or you might just lump your scripts in with all your other executables.
7899 rp='Where do you keep publicly executable scripts?'
7901 if $test "X$ansexp" != "X$scriptdirexp"; then
7905 scriptdirexp="$ansexp"
7906 : Change installation prefix, if necessary.
7907 if $test X"$prefix" != X"$installprefix"; then
7908 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
7910 installscript="$scriptdirexp"
7913 : determine where add-on public executables go
7915 '') dflt=$siteprefix/bin ;;
7919 rp='Pathname where the add-on public executables should be installed?'
7922 sitebinexp="$ansexp"
7923 : Change installation prefix, if necessary.
7924 if $test X"$prefix" != X"$installprefix"; then
7925 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
7927 installsitebin="$sitebinexp"
7930 case "$vendorprefix" in
7931 '') d_vendorbin="$undef"
7935 *) d_vendorbin="$define"
7936 : determine where vendor-supplied executables go.
7937 case "$vendorbin" in
7938 '') dflt=$vendorprefix/bin ;;
7939 *) dflt="$vendorbin" ;;
7942 rp='Pathname for the vendor-supplied executables directory?'
7945 vendorbinexp="$ansexp"
7948 : Change installation prefix, if necessary.
7949 if $test X"$prefix" != X"$installprefix"; then
7950 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
7952 installvendorbin="$vendorbinexp"
7955 : see if qgcvt exists
7961 if $test X"$d_longdbl" = X"$define"; then
7963 echo "Checking how to print long doubles..." >&4
7965 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
7966 $cat >try.c <<'EOCP'
7967 #include <sys/types.h>
7971 printf("%.3f\n", d);
7975 if eval $compile; then
7979 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
7980 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
7981 echo "We will use %f."
7987 if $test X"$sPRIfldbl" = X; then
7988 $cat >try.c <<'EOCP'
7989 #include <sys/types.h>
7992 long double d = 123.456;
7993 printf("%.3llf\n", d);
7997 if eval $compile; then
8001 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
8002 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
8003 echo "We will use %llf."
8009 if $test X"$sPRIfldbl" = X; then
8010 $cat >try.c <<'EOCP'
8011 #include <sys/types.h>
8014 long double d = 123.456;
8015 printf("%.3Lf\n", d);
8019 if eval $compile; then
8023 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
8024 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
8025 echo "We will use %Lf."
8031 if $test X"$sPRIfldbl" = X; then
8032 $cat >try.c <<'EOCP'
8033 #include <sys/types.h>
8036 long double d = 123.456;
8037 printf("%.3lf\n", d);
8041 if eval $compile; then
8045 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
8046 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
8047 echo "We will use %lf."
8053 if $test X"$sPRIfldbl" = X; then
8054 echo "Cannot figure out how to print long doubles." >&4
8056 sSCNfldbl=$sPRIfldbl # expect consistency
8063 case "$sPRIfldbl" in
8064 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
8065 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
8066 d_SCNfldbl="$undef";
8068 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
8069 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
8070 d_SCNfldbl="$define";
8074 : Check how to convert floats to strings.
8076 echo "Checking for an efficient way to convert floats to strings."
8078 case "$uselongdouble" in
8079 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
8081 case "$d_longdbl" in
8082 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
8084 case "$d_PRIgldbl" in
8085 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
8089 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
8090 char *myname = "gconvert";
8093 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
8094 char *myname = "gcvt";
8097 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
8098 char *myname = "qgcvt";
8099 #define DOUBLETYPE long double
8102 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE) && defined(HAS_PRIgldbl)
8103 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
8105 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
8107 char *myname = "sprintf";
8111 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
8112 #define DOUBLETYPE long double
8114 #define DOUBLETYPE double
8120 #define I_STDLIB $i_stdlib
8126 checkit(expect, got)
8130 if (strcmp(expect, got)) {
8131 printf("%s oddity: Expected %s, got %s\n",
8132 myname, expect, got);
8142 /* This must be 1st test on (which?) platform */
8143 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
8144 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
8145 checkit("0.1", buf);
8147 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
8150 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
8151 checkit("1.1", buf);
8153 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
8154 checkit("1.01", buf);
8156 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
8157 checkit("1.001", buf);
8159 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
8160 checkit("1.0001", buf);
8162 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
8163 checkit("1.00001", buf);
8165 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
8166 checkit("1.000001", buf);
8168 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
8171 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
8174 /* Some Linux gcvt's give 1.e+5 here. */
8175 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
8176 checkit("100000", buf);
8178 /* Some Linux gcvt's give -1.e+5 here. */
8179 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
8180 checkit("-100000", buf);
8182 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
8183 checkit("123.456", buf);
8188 case "$d_Gconvert" in
8189 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
8190 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
8191 sprintf*) xxx_list='sprintf gconvert gcvt' ;;
8192 *) xxx_list='gconvert gcvt sprintf' ;;
8195 case "$d_longdbl$uselongdouble$d_PRIgldbl" in
8196 "$define$define$define")
8197 # for long doubles prefer first qgcvt, then sprintf
8198 xxx_list="`echo $xxx_list|sed s/sprintf//`"
8199 xxx_list="sprintf $xxx_list"
8201 "$define") xxx_list="qgcvt $xxx_list" ;;
8206 for xxx_convert in $xxx_list; do
8207 echo "Trying $xxx_convert..."
8209 set try -DTRY_$xxx_convert
8210 if eval $compile; then
8211 echo "$xxx_convert() found." >&4
8213 echo "I'll use $xxx_convert to convert floats into a string." >&4
8216 echo "...But $xxx_convert didn't work as I expected."
8219 echo "$xxx_convert NOT found." >&4
8223 case "$xxx_convert" in
8224 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
8225 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
8226 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
8227 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
8228 "$define$define$define")
8229 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
8230 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
8235 : see if _fwalk exists
8239 : Initialize h_fcntl
8242 : Initialize h_sysfile
8245 : access call always available on UNIX
8249 : locate the flags for 'access()'
8253 $cat >access.c <<'EOCP'
8254 #include <sys/types.h>
8259 #include <sys/file.h>
8268 : check sys/file.h first, no particular reason here
8269 if $test `./findhdr sys/file.h` && \
8270 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
8272 echo "<sys/file.h> defines the *_OK access constants." >&4
8273 elif $test `./findhdr fcntl.h` && \
8274 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
8276 echo "<fcntl.h> defines the *_OK access constants." >&4
8277 elif $test `./findhdr unistd.h` && \
8278 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
8279 echo "<unistd.h> defines the *_OK access constants." >&4
8281 echo "I can't find the four *_OK access constants--I'll use mine." >&4
8287 : see if accessx exists
8288 set accessx d_accessx
8291 : see if alarm exists
8295 : see if atolf exists
8299 : see if atoll exists
8303 : Look for GNU-cc style attribute checking
8305 echo "Checking whether your compiler can handle __attribute__ ..." >&4
8306 $cat >attrib.c <<'EOCP'
8308 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
8310 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
8311 if $contains 'warning' attrib.out >/dev/null 2>&1; then
8312 echo "Your C compiler doesn't fully support __attribute__."
8315 echo "Your C compiler supports __attribute__."
8319 echo "Your C compiler doesn't seem to understand __attribute__ at all."
8326 : see if bcmp exists
8330 : see if bcopy exists
8334 : see if this is a unistd.h system
8335 set unistd.h i_unistd
8338 : see if getpgrp exists
8339 set getpgrp d_getpgrp
8342 case "$d_getpgrp" in
8345 echo "Checking to see which flavor of getpgrp is in use..."
8348 #include <sys/types.h>
8350 # include <unistd.h>
8354 if (getuid() == 0) {
8355 printf("(I see you are running Configure as super-user...)\n");
8359 if (getpgrp(1) == 0)
8368 if $cc -o set -DTRY_BSD_PGRP $ccflags $ldflags set.c $libs >/dev/null 2>&1 && ./set; then
8369 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
8371 elif $cc -o set $ccflags $ldflags set.c $libs >/dev/null 2>&1 && ./set; then
8372 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
8375 echo "I can't seem to compile and run the test program."
8377 xxx="a USG one, i.e. you use getpgrp()."
8379 # SVR4 systems can appear rather BSD-ish.
8382 xxx="a BSD one, i.e. you use getpgrp(pid)."
8386 xxx="probably a USG one, i.e. you use getpgrp()."
8391 echo "Assuming your getpgrp is $xxx" >&4
8400 : see if setpgrp exists
8401 set setpgrp d_setpgrp
8404 case "$d_setpgrp" in
8407 echo "Checking to see which flavor of setpgrp is in use..."
8410 #include <sys/types.h>
8412 # include <unistd.h>
8416 if (getuid() == 0) {
8417 printf("(I see you are running Configure as super-user...)\n");
8421 if (-1 == setpgrp(1, 1))
8424 if (setpgrp() != -1)
8430 if $cc -o set -DTRY_BSD_PGRP $ccflags $ldflags set.c $libs >/dev/null 2>&1 && ./set; then
8431 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
8433 elif $cc -o set $ccflags $ldflags set.c $libs >/dev/null 2>&1 && ./set; then
8434 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
8437 echo "(I can't seem to compile and run the test program.)"
8439 xxx="a USG one, i.e. you use setpgrp()."
8441 # SVR4 systems can appear rather BSD-ish.
8444 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
8448 xxx="probably a USG one, i.e. you use setpgrp()."
8453 echo "Assuming your setpgrp is $xxx" >&4
8461 : see if bzero exists
8465 : see if signal is declared as pointer to function returning int or void
8467 xxx=`./findhdr signal.h`
8468 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
8469 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
8470 echo "You have int (*signal())() instead of void." >&4
8472 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
8473 echo "You have void (*signal())()." >&4
8475 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
8476 echo "You have int (*signal())() instead of void." >&4
8478 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
8479 echo "You have void (*signal())()." >&4
8482 case "$d_voidsig" in
8484 echo "I can't determine whether signal handler returns void or int..." >&4
8486 rp="What type does your signal handler return?"
8493 echo "As you already told me, signal handler returns void." >&4
8496 *) echo "As you already told me, signal handler returns int." >&4
8503 case "$d_voidsig" in
8504 "$define") signal_t="void";;
8509 : check for ability to cast large floats to 32-bit ints.
8511 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
8512 if $test "$intsize" -ge 4; then
8519 #include <sys/types.h>
8521 $signal_t blech(s) int s; { exit(3); }
8528 signal(SIGFPE, blech);
8530 /* Don't let compiler optimize the test away. Store the number
8531 in a writable string for gcc to pass to sscanf under HP/UX.
8533 sprintf(str, "2147483647");
8534 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
8538 /* x86 processors will probably give 0x8000 0000, which is a
8539 sign change. We don't want that. We want to mimic SPARC
8540 behavior here, which is to preserve the sign and give
8543 if (i32 != ($xxx) f)
8549 if eval $compile_ok; then
8553 echo "(I can't seem to compile the test program--assuming it can't)"
8561 echo "Nope, it can't."
8568 : check for ability to cast negative floats to unsigned
8570 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
8573 #include <sys/types.h>
8575 $signal_t blech(s) int s; { exit(7); }
8576 $signal_t blech_in_list(s) int s; { exit(4); }
8577 unsigned long dummy_long(p) unsigned long p; { return p; }
8578 unsigned int dummy_int(p) unsigned int p; { return p; }
8579 unsigned short dummy_short(p) unsigned short p; { return p; }
8583 unsigned long along;
8585 unsigned short ashort;
8589 /* Frustrate gcc-2.7.2's optimizer which failed this test with
8590 a direct f = -123. assignment. gcc-2.8.0 reportedly
8591 optimized the whole file away
8593 /* Store the number in a writable string for gcc to pass to
8596 sprintf(str, "-123");
8597 sscanf(str, "%lf", &f); /* f = -123.; */
8599 signal(SIGFPE, blech);
8600 along = (unsigned long)f;
8601 aint = (unsigned int)f;
8602 ashort = (unsigned short)f;
8603 if (along != (unsigned long)-123)
8605 if (aint != (unsigned int)-123)
8607 if (ashort != (unsigned short)-123)
8609 sprintf(str, "1073741824.");
8610 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
8613 along = (unsigned long)f;
8614 if (along != 0x80000000)
8618 along = (unsigned long)f;
8619 if (along != 0x7fffffff)
8623 along = (unsigned long)f;
8624 if (along != 0x80000001)
8628 signal(SIGFPE, blech_in_list);
8629 sprintf(str, "123.");
8630 sscanf(str, "%lf", &f); /* f = 123.; */
8631 along = dummy_long((unsigned long)f);
8632 aint = dummy_int((unsigned int)f);
8633 ashort = dummy_short((unsigned short)f);
8634 if (along != (unsigned long)123)
8636 if (aint != (unsigned int)123)
8638 if (ashort != (unsigned short)123)
8645 if eval $compile_ok; then
8649 echo "(I can't seem to compile the test program--assuming it can't)"
8652 case "$castflags" in
8657 echo "Nope, it can't."
8664 : see if vprintf exists
8666 if set vprintf val -f d_vprintf; eval $csym; $val; then
8667 echo 'vprintf() found.' >&4
8669 $cat >vprintf.c <<'EOF'
8670 #include <varargs.h>
8672 int main() { xxx("foo"); }
8681 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
8685 if eval $compile && ./vprintf; then
8686 echo "Your vsprintf() returns (int)." >&4
8689 echo "Your vsprintf() returns (char*)." >&4
8693 echo 'vprintf() NOT found.' >&4
8703 : see if chown exists
8707 : see if chroot exists
8711 : see if chsize exists
8715 : check for const keyword
8717 echo 'Checking to see if your C compiler knows about "const"...' >&4
8718 $cat >const.c <<'EOCP'
8719 typedef struct spug { int drokk; } spug;
8726 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
8728 echo "Yup, it does."
8731 echo "Nope, it doesn't."
8736 : see if crypt exists
8738 if set crypt val -f d_crypt; eval $csym; $val; then
8739 echo 'crypt() found.' >&4
8743 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
8744 if $test -z "$cryptlib"; then
8745 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
8749 if $test -z "$cryptlib"; then
8750 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
8754 if $test -z "$cryptlib"; then
8755 cryptlib=`./loc libcrypt$_a "" $libpth`
8759 if $test -z "$cryptlib"; then
8760 echo 'crypt() NOT found.' >&4
8769 : get csh whereabouts
8771 'csh') val="$undef" ;;
8776 : Respect a hint or command line value for full_csh.
8778 '') full_csh=$csh ;;
8781 : see if cuserid exists
8782 set cuserid d_cuserid
8785 : see if this is a limits.h system
8786 set limits.h i_limits
8789 : see if this is a float.h system
8793 : See if number of significant digits in a double precision number is known
8795 $cat >dbl_dig.c <<EOM
8805 printf("Contains DBL_DIG");
8808 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
8809 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
8810 echo "DBL_DIG found." >&4
8813 echo "DBL_DIG NOT found." >&4
8820 : see if difftime exists
8821 set difftime d_difftime
8824 : see if this is a dirent system
8826 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
8828 echo "<dirent.h> found." >&4
8831 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
8832 echo "<sys/dir.h> found." >&4
8835 xinc=`./findhdr sys/ndir.h`
8837 echo "<dirent.h> NOT found." >&4
8842 : Look for type of directory structure.
8844 $cppstdin $cppflags $cppminus < "$xinc" > try.c
8846 case "$direntrytype" in
8849 $define) guess1='struct dirent' ;;
8850 *) guess1='struct direct' ;;
8853 *) guess1="$direntrytype"
8858 'struct dirent') guess2='struct direct' ;;
8859 *) guess2='struct dirent' ;;
8862 if $contains "$guess1" try.c >/dev/null 2>&1; then
8863 direntrytype="$guess1"
8864 echo "Your directory entries are $direntrytype." >&4
8865 elif $contains "$guess2" try.c >/dev/null 2>&1; then
8866 direntrytype="$guess2"
8867 echo "Your directory entries seem to be $direntrytype." >&4
8869 echo "I don't recognize your system's directory entries." >&4
8870 rp="What type is used for directory entries on this system?"
8878 : see if the directory entry stores field length
8880 $cppstdin $cppflags $cppminus < "$xinc" > try.c
8881 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
8882 echo "Good, your directory entry keeps length information in d_namlen." >&4
8885 echo "Your directory entry does not know about the d_namlen field." >&4
8892 : see if dlerror exists
8895 set dlerror d_dlerror
8899 : see if dlfcn is available
8907 On a few systems, the dynamically loaded modules that perl generates and uses
8908 will need a different extension than shared libs. The default will probably
8916 rp='What is the extension of dynamically loaded modules'
8925 : Check if dlsym need a leading underscore
8931 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
8932 $cat >dyna.c <<'EOM'
8941 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
8943 #include <sys/types.h>
8957 int mode = RTLD_LAZY ;
8959 handle = dlopen("./dyna.$dlext", mode) ;
8960 if (handle == NULL) {
8965 symbol = dlsym(handle, "fred") ;
8966 if (symbol == NULL) {
8967 /* try putting a leading underscore */
8968 symbol = dlsym(handle, "_fred") ;
8969 if (symbol == NULL) {
8982 : Call the object file tmp-dyna.o in case dlext=o.
8983 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
8984 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
8985 $ld -o dyna.$dlext $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
8986 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then
8989 1) echo "Test program failed using dlopen." >&4
8990 echo "Perhaps you should not use dynamic loading." >&4;;
8991 2) echo "Test program failed using dlsym." >&4
8992 echo "Perhaps you should not use dynamic loading." >&4;;
8993 3) echo "dlsym needs a leading underscore" >&4
8995 4) echo "dlsym doesn't need a leading underscore." >&4;;
8998 echo "I can't compile and run the test program." >&4
8999 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
9004 $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
9009 hasproto='varname=$1; func=$2; shift; shift;
9010 while $test $# -ge 2; do
9012 $define) echo "#include <$2>";;
9016 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
9017 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
9018 echo "$func() prototype found.";
9021 echo "$func() prototype NOT found.";
9026 $rm -f try.c tryout.c'
9028 : see if prototype for drand48 is available
9030 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
9033 : see if dup2 exists
9037 : see if eaccess exists
9038 set eaccess d_eaccess
9041 : see if endgrent exists
9042 set endgrent d_endgrent
9045 : see if endhostent exists
9046 set endhostent d_endhent
9049 : see if endnetent exists
9050 set endnetent d_endnent
9053 : see if endprotoent exists
9054 set endprotoent d_endpent
9057 : see if endpwent exists
9058 set endpwent d_endpwent
9061 : see if endservent exists
9062 set endservent d_endsent
9065 : Locate the flags for 'open()'
9067 $cat >open3.c <<'EOCP'
9068 #include <sys/types.h>
9073 #include <sys/file.h>
9084 : check sys/file.h first to get FREAD on Sun
9085 if $test `./findhdr sys/file.h` && \
9086 set open3 -DI_SYS_FILE && eval $compile; then
9088 echo "<sys/file.h> defines the O_* constants..." >&4
9090 echo "and you have the 3 argument form of open()." >&4
9093 echo "but not the 3 argument form of open(). Oh, well." >&4
9096 elif $test `./findhdr fcntl.h` && \
9097 set open3 -DI_FCNTL && eval $compile; then
9099 echo "<fcntl.h> defines the O_* constants..." >&4
9101 echo "and you have the 3 argument form of open()." >&4
9104 echo "but not the 3 argument form of open(). Oh, well." >&4
9109 echo "I can't find the O_* constant definitions! You got problems." >&4
9115 : see which of string.h or strings.h is needed
9117 strings=`./findhdr string.h`
9118 if $test "$strings" && $test -r "$strings"; then
9119 echo "Using <string.h> instead of <strings.h>." >&4
9123 strings=`./findhdr strings.h`
9124 if $test "$strings" && $test -r "$strings"; then
9125 echo "Using <strings.h> instead of <string.h>." >&4
9127 echo "No string header found -- You'll surely have problems." >&4
9133 "$undef") strings=`./findhdr strings.h`;;
9134 *) strings=`./findhdr string.h`;;
9137 : check for non-blocking I/O stuff
9138 case "$h_sysfile" in
9139 true) echo "#include <sys/file.h>" > head.c;;
9142 true) echo "#include <fcntl.h>" > head.c;;
9143 *) echo "#include <sys/fcntl.h>" > head.c;;
9148 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
9149 case "$o_nonblock" in
9152 $cat >>try.c <<'EOCP'
9156 printf("O_NONBLOCK\n");
9160 printf("O_NDELAY\n");
9164 printf("FNDELAY\n");
9171 if eval $compile_ok; then
9173 case "$o_nonblock" in
9174 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
9175 *) echo "Seems like we can use $o_nonblock.";;
9178 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
9181 *) echo "Using $hint value $o_nonblock.";;
9183 $rm -f try try.* .out core
9186 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
9192 #include <sys/types.h>
9195 #define MY_O_NONBLOCK $o_nonblock
9196 #ifndef errno /* XXX need better Configure test */
9207 #include <strings.h>
9209 $signal_t blech(x) int x; { exit(3); }
9211 $cat >> try.c <<'EOCP'
9219 pipe(pd); /* Down: child -> parent */
9220 pipe(pu); /* Up: parent -> child */
9223 close(pd[1]); /* Parent reads from pd[0] */
9224 close(pu[0]); /* Parent writes (blocking) to pu[1] */
9226 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
9231 signal(SIGALRM, blech);
9233 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
9235 sprintf(string, "%d\n", ret);
9236 write(2, string, strlen(string));
9239 if (errno == EAGAIN) {
9245 if (errno == EWOULDBLOCK)
9246 printf("EWOULDBLOCK\n");
9249 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
9250 sleep(2); /* Give it time to close our pipe */
9252 ret = read(pd[0], buf, 1); /* Should read EOF */
9254 sprintf(string, "%d\n", ret);
9255 write(3, string, strlen(string));
9259 close(pd[0]); /* We write to pd[1] */
9260 close(pu[1]); /* We read from pu[0] */
9261 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
9262 close(pd[1]); /* Pipe pd is now fully closed! */
9263 exit(0); /* Bye bye, thank you for playing! */
9267 if eval $compile_ok; then
9268 echo "$startsh" >mtry
9269 echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
9271 ./mtry >/dev/null 2>&1
9273 0) eagain=`$cat try.out`;;
9274 1) echo "Could not perform non-blocking setting!";;
9275 2) echo "I did a successful read() for something that was not there!";;
9276 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
9277 4) echo "Could not find F_SETFL!";;
9278 *) echo "Something terribly wrong happened during testing.";;
9280 rd_nodata=`$cat try.ret`
9281 echo "A read() system call with no data present returns $rd_nodata."
9282 case "$rd_nodata" in
9285 echo "(That's peculiar, fixing that to be -1.)"
9291 echo "Forcing errno EAGAIN on read() with no data available."
9295 echo "Your read() sets errno to $eagain when no data is available."
9298 status=`$cat try.err`
9300 0) echo "And it correctly returns 0 to signal EOF.";;
9301 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
9302 *) echo "However, your read() returns '$status' on EOF??";;
9305 if test "$status" = "$rd_nodata"; then
9306 echo "WARNING: you can't distinguish between EOF and no data!"
9310 echo "I can't compile the test program--assuming errno EAGAIN will do."
9317 echo "Using $hint value $eagain."
9318 echo "Your read() returns $rd_nodata when no data is present."
9319 case "$d_eofnblk" in
9320 "$define") echo "And you can see EOF because read() returns 0.";;
9321 "$undef") echo "But you can't see EOF status from read() returned value.";;
9323 echo "(Assuming you can't see EOF status from read anyway.)"
9329 $rm -f try try.* .out core head.c mtry
9331 : see if fchmod exists
9335 : see if fchown exists
9339 : see if this is an fcntl system
9344 : See if fcntl-based locking works.
9345 $cat >try.c <<'EOCP'
9350 #if defined(F_SETLK) && defined(F_SETLKW)
9353 fd = open("try.c", O_RDONLY);
9354 flock.l_type = F_RDLCK;
9355 flock.l_whence = SEEK_SET;
9356 flock.l_start = flock.l_len = 0;
9357 retval = fcntl(fd, F_SETLK, &flock);
9359 (retval < 0 ? exit(2) : exit(0));
9365 echo "Checking if fcntl-based file locking works... "
9369 if eval $compile_ok; then
9371 echo "Yes, it seems to work."
9374 echo "Nope, it didn't work."
9378 echo "I'm unable to compile the test program, so I'll assume not."
9383 echo "Nope, since you don't even have fcntl()."
9386 set d_fcntl_can_lock
9391 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
9392 while $test $# -ge 2; do
9394 $define) echo "#include <$2>";;
9398 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
9400 if eval $compile; then
9411 : see whether socket exists
9413 $echo $n "Hmm... $c" >&4
9414 if set socket val -f d_socket; eval $csym; $val; then
9415 echo "Looks like you have Berkeley networking support." >&4
9417 if set setsockopt val -f; eval $csym; $val; then
9420 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
9424 if $contains socklib libc.list >/dev/null 2>&1; then
9425 echo "Looks like you have Berkeley networking support." >&4
9427 : we will have to assume that it supports the 4.2 BSD interface
9430 echo "You don't have Berkeley networking in libc$_a..." >&4
9431 if test "X$d_socket" = "X$define"; then
9432 echo "...but you seem to believe that you have sockets." >&4
9434 for net in net socket
9436 if test -f /usr/lib/lib$net$_a; then
9437 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
9438 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
9439 if $contains socket libc.list >/dev/null 2>&1; then
9444 echo "...but the Wollongong group seems to have hacked it in." >&4
9445 sockethdr="-I/usr/netinclude"
9448 echo "Found Berkeley sockets interface in lib$net." >& 4
9449 if $contains setsockopt libc.list >/dev/null 2>&1; then
9452 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
9459 if test "X$d_socket" != "X$define"; then
9460 echo "or anywhere else I see." >&4
9468 : see if socketpair exists
9469 set socketpair d_sockpair
9474 echo "Checking the availability of certain socket constants..." >& 4
9475 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
9476 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
9478 #include <sys/types.h>
9479 #include <sys/socket.h>
9485 set try; if eval $compile; then
9488 set d_${enum}; eval $setvar
9492 : see if sys/select.h has to be included
9493 set sys/select.h i_sysselct
9496 : see if we should include time.h, sys/time.h, or both
9498 if test "X$timeincl" = X; then
9499 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9500 $echo $n "I'm now running the test program...$c"
9501 $cat >try.c <<'EOCP'
9502 #include <sys/types.h>
9507 #ifdef SYSTIMEKERNEL
9510 #include <sys/time.h>
9513 #include <sys/select.h>
9522 struct timezone tzp;
9524 if (foo.tm_sec == foo.tm_sec)
9527 if (bar.tv_sec == bar.tv_sec)
9534 for s_timezone in '-DS_TIMEZONE' ''; do
9536 for s_timeval in '-DS_TIMEVAL' ''; do
9537 for i_systimek in '' '-DSYSTIMEKERNEL'; do
9538 for i_time in '' '-DI_TIME'; do
9539 for i_systime in '-DI_SYSTIME' ''; do
9542 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
9543 if eval $compile; then
9544 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
9548 $echo $n "Succeeded with $flags$c"
9560 *SYSTIMEKERNEL*) i_systimek="$define"
9561 timeincl=`./findhdr sys/time.h`
9562 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
9563 *) i_systimek="$undef";;
9566 *I_TIME*) i_time="$define"
9567 timeincl=`./findhdr time.h`" $timeincl"
9568 echo "We'll include <time.h>." >&4;;
9569 *) i_time="$undef";;
9572 *I_SYSTIME*) i_systime="$define"
9573 timeincl=`./findhdr sys/time.h`" $timeincl"
9574 echo "We'll include <sys/time.h>." >&4;;
9575 *) i_systime="$undef";;
9580 : check for fd_set items
9583 Checking to see how well your C compiler handles fd_set and friends ...
9585 $cat >fd_set.c <<EOCP
9586 #$i_systime I_SYS_TIME
9587 #$i_sysselct I_SYS_SELECT
9588 #$d_socket HAS_SOCKET
9589 #include <sys/types.h>
9591 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
9594 #include <sys/time.h>
9597 #include <sys/select.h>
9606 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
9613 set fd_set -DTRYBITS
9614 if eval $compile; then
9615 d_fds_bits="$define"
9617 echo "Well, your system knows about the normal fd_set typedef..." >&4
9619 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
9620 d_fd_macros="$define"
9623 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
9625 d_fd_macros="$undef"
9629 Hmm, your compiler has some difficulty with fd_set. Checking further...
9632 if eval $compile; then
9635 echo "Well, your system has some sort of fd_set available..." >&4
9637 echo "and you have the normal fd_set macros." >&4
9638 d_fd_macros="$define"
9641 but not the normal fd_set macros! Gross! More work for me...
9643 d_fd_macros="$undef"
9646 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
9649 d_fd_macros="$undef"
9654 : see if fgetpos exists
9655 set fgetpos d_fgetpos
9658 : see if flock exists
9662 : see if fork exists
9666 : see if pathconf exists
9667 set pathconf d_pathconf
9670 : see if fpathconf exists
9671 set fpathconf d_fpathconf
9675 : check for fpos64_t
9677 echo "Checking to see if you have fpos64_t..." >&4
9680 int main() { fpos64_t x = 7; }
9683 if eval $compile; then
9685 echo "You have fpos64_t."
9688 echo "You do not have fpos64_t."
9690 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
9697 : see if frexpl exists
9701 hasstruct='varname=$1; struct=$2; shift; shift;
9702 while $test $# -ge 2; do
9704 $define) echo "#include <$2>";;
9708 echo "int main () { struct $struct foo; }" >> try.c;
9710 if eval $compile; then
9719 : see if this is a sys/param system
9720 set sys/param.h i_sysparam
9723 : see if this is a sys/mount.h system
9724 set sys/mount.h i_sysmount
9727 : see if sys/types.h has to be included
9728 set sys/types.h i_systypes
9733 echo "Checking to see if your system supports struct fs_data..." >&4
9734 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
9736 case "$d_fs_data_s" in
9737 "$define") echo "Yes, it does." ;;
9738 *) echo "No, it doesn't." ;;
9741 : see if fseeko exists
9745 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
9748 : see if fsetpos exists
9749 set fsetpos d_fsetpos
9753 : see if fstatfs exists
9754 set fstatfs d_fstatfs
9758 : see if statvfs exists
9759 set statvfs d_statvfs
9762 : see if fstatvfs exists
9763 set fstatvfs d_fstatvfs
9767 : see if fsync exists
9771 : see if ftello exists
9775 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
9778 : see if getcwd exists
9782 : see if getespwnam exists
9783 set getespwnam d_getespwnam
9787 : see if getfsstat exists
9788 set getfsstat d_getfsstat
9791 : see if getgrent exists
9792 set getgrent d_getgrent
9795 : see if gethostbyaddr exists
9796 set gethostbyaddr d_gethbyaddr
9799 : see if gethostbyname exists
9800 set gethostbyname d_gethbyname
9803 : see if gethostent exists
9804 set gethostent d_gethent
9807 : see how we will look up host name
9810 if set gethostname val -f d_gethname; eval $csym; $val; then
9811 echo 'gethostname() found.' >&4
9812 d_gethname="$define"
9815 if set uname val -f d_uname; eval $csym; $val; then
9818 uname() was found, but you're running xenix, and older versions of xenix
9819 have a broken uname(). If you don't really know whether your xenix is old
9820 enough to have a broken system call, use the default answer.
9827 rp='Is your uname() broken?'
9830 n*) d_uname="$define"; call=uname;;
9833 echo 'uname() found.' >&4
9840 case "$d_gethname" in
9841 '') d_gethname="$undef";;
9844 '') d_uname="$undef";;
9846 case "$d_uname$d_gethname" in
9851 Every now and then someone has a $call() that lies about the hostname
9852 but can't be fixed for political or economic reasons. If you wish, I can
9853 pretend $call() isn't there and maybe compute hostname at run-time
9854 thanks to the '$phostname' command.
9857 rp="Shall I ignore $call() from now on?"
9860 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
9863 case "$phostname" in
9865 *) case "$aphostname" in
9871 file=`./loc $file $file $pth`
9872 aphostname=`echo $file $*`
9877 case "$d_uname$d_gethname" in
9880 case "$phostname" in
9882 echo "There will be no way for $package to get your hostname." >&4;;
9884 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
9888 case "$d_phostname" in
9889 '') d_phostname="$undef";;
9892 : see if this is a netdb.h system
9896 : see if prototypes for various gethostxxx netdb.h functions are available
9898 set d_gethostprotos gethostent $i_netdb netdb.h
9901 : see if getlogin exists
9902 set getlogin d_getlogin
9905 : see if getmnt exists
9909 : see if getmntent exists
9910 set getmntent d_getmntent
9913 : see if getnetbyaddr exists
9914 set getnetbyaddr d_getnbyaddr
9917 : see if getnetbyname exists
9918 set getnetbyname d_getnbyname
9921 : see if getnetent exists
9922 set getnetent d_getnent
9925 : see if prototypes for various getnetxxx netdb.h functions are available
9927 set d_getnetprotos getnetent $i_netdb netdb.h
9930 : see if getpagesize exists
9931 set getpagesize d_getpagsz
9935 : see if getprotobyname exists
9936 set getprotobyname d_getpbyname
9939 : see if getprotobynumber exists
9940 set getprotobynumber d_getpbynumber
9943 : see if getprotoent exists
9944 set getprotoent d_getpent
9947 : see if getpgid exists
9948 set getpgid d_getpgid
9951 : see if getpgrp2 exists
9952 set getpgrp2 d_getpgrp2
9955 : see if getppid exists
9956 set getppid d_getppid
9959 : see if getpriority exists
9960 set getpriority d_getprior
9963 : see if prototypes for various getprotoxxx netdb.h functions are available
9965 set d_getprotoprotos getprotoent $i_netdb netdb.h
9968 : see if getprpwnam exists
9969 set getprpwnam d_getprpwnam
9972 : see if getpwent exists
9973 set getpwent d_getpwent
9977 : see if getservbyname exists
9978 set getservbyname d_getsbyname
9981 : see if getservbyport exists
9982 set getservbyport d_getsbyport
9985 : see if getservent exists
9986 set getservent d_getsent
9989 : see if prototypes for various getservxxx netdb.h functions are available
9991 set d_getservprotos getservent $i_netdb netdb.h
9994 : see if getspnam exists
9995 set getspnam d_getspnam
9998 : see if gettimeofday or ftime exists
9999 set gettimeofday d_gettimeod
10001 case "$d_gettimeod" in
10007 val="$undef"; set d_ftime; eval $setvar
10010 case "$d_gettimeod$d_ftime" in
10013 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
10017 : see if this is an grp system
10023 xxx=`./findhdr grp.h`
10024 $cppstdin $cppflags $cppminus < $xxx >$$.h
10026 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
10038 set d_grpasswd; eval $setvar
10042 : see if hasmntopt exists
10043 set hasmntopt d_hasmntopt
10046 : see if this is a netinet/in.h or sys/in.h system
10047 set netinet/in.h i_niin sys/in.h i_sysin
10050 : see if arpa/inet.h has to be included
10051 set arpa/inet.h i_arpainet
10054 : see if htonl --and friends-- exists
10059 : Maybe they are macros.
10062 $cat >htonl.c <<EOM
10064 #include <sys/types.h>
10065 #$i_niin I_NETINET_IN
10067 #$i_arpainet I_ARPA_INET
10068 #ifdef I_NETINET_IN
10069 #include <netinet/in.h>
10072 #include <sys/in.h>
10075 #include <arpa/inet.h>
10078 printf("Defined as a macro.");
10081 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
10082 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
10084 echo "But it seems to be defined as a macro." >&4
10092 : see if iconv exists
10098 if set index val -f; eval $csym; $val; then
10099 if set strchr val -f d_strchr; eval $csym; $val; then
10100 if $contains strchr "$strings" >/dev/null 2>&1 ; then
10103 echo "strchr() found." >&4
10107 echo "index() found." >&4
10112 echo "index() found." >&4
10115 if set strchr val -f d_strchr; eval $csym; $val; then
10118 echo "strchr() found." >&4
10120 echo "No index() or strchr() found!" >&4
10125 set d_strchr; eval $setvar
10127 set d_index; eval $setvar
10129 : check whether inet_aton exists
10130 set inet_aton d_inetaton
10135 $cat >isascii.c <<'EOCP'
10147 if eval $compile; then
10148 echo "isascii() found." >&4
10151 echo "isascii() NOT found." >&4
10158 : see if isnan exists
10162 : see if isnanl exists
10163 set isnanl d_isnanl
10166 : see if killpg exists
10167 set killpg d_killpg
10170 : see if lchown exists
10172 $cat > try.c <<'EOCP'
10173 /* System header to define __stub macros and hopefully few prototypes,
10174 which can conflict with char lchown(); below. */
10175 #include <assert.h>
10176 /* Override any gcc2 internal prototype to avoid an error. */
10177 /* We use char because int might match the return type of a gcc2
10178 builtin and then its argument prototype would still apply. */
10181 /* The GNU C library defines this for functions which it implements
10182 to always fail with ENOSYS. Some functions are actually named
10183 something starting with __ and the normal name is an alias. */
10184 #if defined (__stub_lchown) || defined (__stub___lchown)
10192 if eval $compile; then
10193 $echo "lchown() found." >&4
10196 $echo "lchown() NOT found." >&4
10202 : See if number of significant digits in a double precision number is known
10204 $cat >ldbl_dig.c <<EOM
10205 #$i_limits I_LIMITS
10208 #include <limits.h>
10214 printf("Contains LDBL_DIG");
10217 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
10218 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
10219 echo "LDBL_DIG found." >&4
10222 echo "LDBL_DIG NOT found." >&4
10229 : see if link exists
10233 : see if localeconv exists
10234 set localeconv d_locconv
10237 : see if lockf exists
10241 : see if prototype for lseek is available
10243 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
10246 : see if lstat exists
10250 : see if madvise exists
10251 set madvise d_madvise
10254 : see if mblen exists
10258 : see if mbstowcs exists
10259 set mbstowcs d_mbstowcs
10262 : see if mbtowc exists
10263 set mbtowc d_mbtowc
10266 : see if memchr exists
10267 set memchr d_memchr
10270 : see if memcmp exists
10271 set memcmp d_memcmp
10274 : see if memcpy exists
10275 set memcpy d_memcpy
10278 : see if memmove exists
10279 set memmove d_memmove
10282 : see if memset exists
10283 set memset d_memset
10286 : see if mkdir exists
10290 : see if mkdtemp exists
10291 set mkdtemp d_mkdtemp
10294 : see if mkfifo exists
10295 set mkfifo d_mkfifo
10298 : see if mkstemp exists
10299 set mkstemp d_mkstemp
10302 : see if mkstemps exists
10303 set mkstemps d_mkstemps
10306 : see if mktime exists
10307 set mktime d_mktime
10310 : see if this is a sys/mman.h system
10311 set sys/mman.h i_sysmman
10314 : see if mmap exists
10317 : see what shmat returns
10318 : default to something harmless
10320 case "$i_sysmman$d_mmap" in
10322 $cat >mmap.c <<'END'
10323 #include <sys/mman.h>
10326 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
10331 echo "and it returns ($mmaptype)." >&4
10337 : see if modfl exists
10341 : see if mprotect exists
10342 set mprotect d_mprotect
10345 : see if msgctl exists
10346 set msgctl d_msgctl
10349 : see if msgget exists
10350 set msgget d_msgget
10353 : see if msgsnd exists
10354 set msgsnd d_msgsnd
10357 : see if msgrcv exists
10358 set msgrcv d_msgrcv
10361 : see how much of the 'msg*(2)' library is present.
10364 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
10365 *"$undef"*) h_msg=false;;
10369 case "`ipcs 2>&1`" in
10370 "SVID messages"*"not configured"*)
10371 echo "Your $osname does not have the msg*(2) configured." >&4
10374 set msgctl d_msgctl
10376 set msgget d_msgget
10378 set msgsnd d_msgsnd
10380 set msgrcv d_msgrcv
10386 : we could also check for sys/ipc.h ...
10387 if $h_msg && $test `./findhdr sys/msg.h`; then
10388 echo "You have the full msg*(2) library." >&4
10391 echo "You don't have the full msg*(2) library." >&4
10397 : see if msync exists
10401 : see if munmap exists
10402 set munmap d_munmap
10405 : see if nice exists
10409 : check for length of character
10411 case "$charsize" in
10413 echo "Checking to see how big your characters are (hey, you never know)..." >&4
10414 $cat >try.c <<'EOCP'
10418 printf("%d\n", (int)sizeof(char));
10423 if eval $compile_ok; then
10427 echo "(I can't seem to compile the test program. Guessing...)"
10434 rp="What is the size of a character (in bytes)?"
10439 : check for volatile keyword
10441 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
10442 $cat >try.c <<'EOCP'
10445 typedef struct _goo_struct goo_struct;
10446 goo_struct * volatile goo = ((goo_struct *)0);
10447 struct _goo_struct {
10452 typedef unsigned short foo_t;
10453 char *volatile foo;
10455 volatile foo_t blech;
10459 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
10461 echo "Yup, it does."
10464 echo "Nope, it doesn't."
10472 $echo "Choosing the C types to be used for Perl's internal types..." >&4
10474 case "$use64bitint:$d_quad:$quadtype" in
10477 uvtype="$uquadtype"
10482 uvtype="unsigned long"
10488 case "$uselongdouble:$d_longdbl" in
10490 nvtype="long double"
10491 nvsize=$longdblsize
10498 $echo "(IV will be "$ivtype", $ivsize bytes)"
10499 $echo "(UV will be "$uvtype", $uvsize bytes)"
10500 $echo "(NV will be "$nvtype", $nvsize bytes)"
10503 #$i_inttypes I_INTTYPES
10505 #include <inttypes.h>
10510 int8_t i = INT8_MAX;
10511 uint8_t u = UINT8_MAX;
10512 printf("int8_t\n");
10515 int16_t i = INT16_MAX;
10516 uint16_t i = UINT16_MAX;
10517 printf("int16_t\n");
10520 int32_t i = INT32_MAX;
10521 uint32_t u = UINT32_MAX;
10522 printf("int32_t\n");
10528 '') case "$charsize" in
10530 u8type="unsigned char"
10539 if eval $compile; then
10540 case "`./try$exe_ext`" in
10541 int8_t) i8type=int8_t
10551 '') if $test $charsize -ge 1; then
10553 u8type="unsigned char"
10561 '') case "$shortsize" in
10563 u16type="unsigned short"
10571 '') set try -DINT16
10572 if eval $compile; then
10573 case "`./try$exe_ext`" in
10585 '') if $test $shortsize -ge 2; then
10587 u16type="unsigned short"
10595 '') case "$longsize" in
10597 u32type="unsigned long"
10601 *) case "$intsize" in
10603 u32type="unsigned int"
10613 '') set try -DINT32
10614 if eval $compile; then
10615 case "`./try$exe_ext`" in
10627 '') if $test $intsize -ge 4; then
10629 u32type="unsigned int"
10637 '') case "$d_quad:$quadtype" in
10639 i64type="$quadtype"
10640 u64type="$uquadtype"
10648 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
10649 : volatile so that the compiler has to store it out to memory.
10650 if test X"$d_volatile" = X"$define"; then
10655 #include <sys/types.h>
10656 #include <signal.h>
10658 $volatile int bletched = 0;
10659 $signal_t blech(s) int s; { bletched = 1; }
10664 int n = 8 * $uvsize;
10667 signal(SIGFPE, blech);
10670 for (i = 0; i < n; i++) {
10671 u = u << 1 | ($uvtype)1;
10673 if (($uvtype)d != u)
10677 d = ($nvtype)(u - 1);
10678 if (($uvtype)d != (u - 1))
10686 printf("%d\n", ((i == n) ? -n : i));
10692 d_nv_preserves_uv="$undef"
10693 if eval $compile; then
10694 d_nv_preserves_uv_bits="`./try$exe_ext`"
10696 case "$d_nv_preserves_uv_bits" in
10698 d_nv_preserves_uv_bits=`expr 0 - $d_nv_preserves_uv_bits`
10699 $echo "Your NVs can preserve all $d_nv_preserves_uv_bits bits of your UVs." 2>&1
10700 d_nv_preserves_uv="$define"
10702 [1-9]*) $echo "Your NVs can preserve only $d_nv_preserves_uv_bits bits of your UVs." 2>&1
10703 d_nv_preserves_uv="$undef" ;;
10704 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
10705 d_nv_preserves_uv_bits="$undef" ;;
10711 : check for off64_t
10713 echo "Checking to see if you have off64_t..." >&4
10715 #include <sys/types.h>
10716 #include <unistd.h>
10717 int main() { off64_t x = 7; }
10720 if eval $compile; then
10722 echo "You have off64_t."
10725 echo "You do not have off64_t."
10726 case "$lseeksize" in
10727 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
10734 : see if POSIX threads are available
10735 set pthread.h i_pthread
10741 : how to create joinable pthreads
10742 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
10744 echo "Checking what constant to use for creating joinable pthreads..." >&4
10745 $cat >try.c <<'EOCP'
10746 #include <pthread.h>
10748 int detachstate = JOINABLE;
10751 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
10752 if eval $compile; then
10753 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
10754 val="$undef" # Yes, undef.
10755 set d_old_pthread_create_joinable
10758 set old_pthread_create_joinable
10761 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
10762 if eval $compile; then
10763 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
10765 set d_old_pthread_create_joinable
10767 val=PTHREAD_CREATE_UNDETACHED
10768 set old_pthread_create_joinable
10771 set try -DJOINABLE=__UNDETACHED
10772 if eval $compile; then
10773 echo "You seem to use __UNDETACHED." >&4
10775 set d_old_pthread_create_joinable
10778 set old_pthread_create_joinable
10781 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
10783 set d_old_pthread_create_joinable
10786 set old_pthread_create_joinable
10793 d_old_pthread_create_joinable="$undef"
10794 old_pthread_create_joinable=""
10797 : see if pause exists
10801 : see if pipe exists
10805 : see if poll exists
10810 : see whether the various POSIXish _yields exist
10812 #include <pthread.h>
10818 #ifdef PTHREAD_YIELD
10821 #ifdef PTHREAD_YIELD_NULL
10822 pthread_yield(NULL);
10828 : see if sched_yield exists
10829 set try -DSCHED_YIELD
10830 if eval $compile; then
10832 sched_yield='sched_yield()'
10836 case "$usethreads" in
10839 $define) echo 'sched_yield() found.' >&4 ;;
10840 *) echo 'sched_yield() NOT found.' >&4 ;;
10846 : see if pthread_yield exists
10847 set try -DPTHREAD_YIELD
10848 if eval $compile; then
10850 case "$sched_yield" in
10851 '') sched_yield='pthread_yield()' ;;
10854 set try -DPTHREAD_YIELD_NULL
10855 if eval $compile; then
10857 case "$sched_yield" in
10858 '') sched_yield='pthread_yield(NULL)' ;;
10864 case "$usethreads" in
10867 $define) echo 'pthread_yield() found.' >&4 ;;
10868 *) echo 'pthread_yield() NOT found.' >&4 ;;
10872 set d_pthread_yield
10875 case "$sched_yield" in
10876 '') sched_yield=undef ;;
10881 : see if this is a pwd.h system
10887 xxx=`./findhdr pwd.h`
10888 $cppstdin $cppflags $cppminus < $xxx >$$.h
10890 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
10898 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
10906 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
10914 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
10922 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
10930 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
10938 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
10946 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
10958 set d_pwquota; eval $setvar
10959 set d_pwage; eval $setvar
10960 set d_pwchange; eval $setvar
10961 set d_pwclass; eval $setvar
10962 set d_pwexpire; eval $setvar
10963 set d_pwcomment; eval $setvar
10964 set d_pwgecos; eval $setvar
10965 set d_pwpasswd; eval $setvar
10969 : see if readdir and friends exist
10970 set readdir d_readdir
10972 set seekdir d_seekdir
10974 set telldir d_telldir
10976 set rewinddir d_rewinddir
10979 : see if readlink exists
10980 set readlink d_readlink
10983 : see if rename exists
10984 set rename d_rename
10987 : see if rmdir exists
10991 : see if memory.h is available.
10996 : See if it conflicts with string.h
11002 $cppstdin $cppflags $cppminus < $strings > mem.h
11003 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
11005 echo "We won't be including <memory.h>."
11015 : can bcopy handle overlapping blocks?
11020 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
11022 #$i_memory I_MEMORY
11023 #$i_stdlib I_STDLIB
11024 #$i_string I_STRING
11025 #$i_unistd I_UNISTD
11027 $cat >>try.c <<'EOCP'
11030 # include <memory.h>
11033 # include <stdlib.h>
11036 # include <string.h>
11038 # include <strings.h>
11041 # include <unistd.h> /* Needed for NetBSD */
11045 char buf[128], abc[128];
11051 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
11053 for (align = 7; align >= 0; align--) {
11054 for (len = 36; len; len--) {
11056 bcopy(abc, b, len);
11057 for (off = 1; off <= len; off++) {
11058 bcopy(b, b+off, len);
11059 bcopy(b+off, b, len);
11060 if (bcmp(b, abc, len))
11069 if eval $compile_ok; then
11070 if ./try 2>/dev/null; then
11071 echo "Yes, it can."
11074 echo "It can't, sorry."
11075 case "$d_memmove" in
11076 "$define") echo "But that's Ok since you have memmove()." ;;
11080 echo "(I can't compile the test program, so we'll assume not...)"
11081 case "$d_memmove" in
11082 "$define") echo "But that's Ok since you have memmove()." ;;
11087 $rm -f try.* try core
11091 : can memcpy handle overlapping blocks?
11093 case "$d_memcpy" in
11096 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
11098 #$i_memory I_MEMORY
11099 #$i_stdlib I_STDLIB
11100 #$i_string I_STRING
11101 #$i_unistd I_UNISTD
11103 $cat >>try.c <<'EOCP'
11106 # include <memory.h>
11109 # include <stdlib.h>
11112 # include <string.h>
11114 # include <strings.h>
11117 # include <unistd.h> /* Needed for NetBSD */
11121 char buf[128], abc[128];
11127 /* Copy "abcde..." string to char abc[] so that gcc doesn't
11128 try to store the string in read-only memory. */
11129 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
11131 for (align = 7; align >= 0; align--) {
11132 for (len = 36; len; len--) {
11134 memcpy(b, abc, len);
11135 for (off = 1; off <= len; off++) {
11136 memcpy(b+off, b, len);
11137 memcpy(b, b+off, len);
11138 if (memcmp(b, abc, len))
11147 if eval $compile_ok; then
11148 if ./try 2>/dev/null; then
11149 echo "Yes, it can."
11152 echo "It can't, sorry."
11153 case "$d_memmove" in
11154 "$define") echo "But that's Ok since you have memmove()." ;;
11158 echo "(I can't compile the test program, so we'll assume not...)"
11159 case "$d_memmove" in
11160 "$define") echo "But that's Ok since you have memmove()." ;;
11165 $rm -f try.* try core
11169 : can memcmp be trusted to compare relative magnitude?
11171 case "$d_memcmp" in
11174 echo "Checking if your memcmp() can compare relative magnitude..." >&4
11176 #$i_memory I_MEMORY
11177 #$i_stdlib I_STDLIB
11178 #$i_string I_STRING
11179 #$i_unistd I_UNISTD
11181 $cat >>try.c <<'EOCP'
11184 # include <memory.h>
11187 # include <stdlib.h>
11190 # include <string.h>
11192 # include <strings.h>
11195 # include <unistd.h> /* Needed for NetBSD */
11201 if ((a < b) && memcmp(&a, &b, 1) < 0)
11207 if eval $compile_ok; then
11208 if ./try 2>/dev/null; then
11209 echo "Yes, it can."
11212 echo "No, it can't (it uses signed chars)."
11215 echo "(I can't compile the test program, so we'll assume not...)"
11219 $rm -f try.* try core
11223 : see if prototype for sbrk is available
11225 set d_sbrkproto sbrk $i_unistd unistd.h
11228 : see if select exists
11229 set select d_select
11232 : see if semctl exists
11233 set semctl d_semctl
11236 : see if semget exists
11237 set semget d_semget
11240 : see if semop exists
11244 : see how much of the 'sem*(2)' library is present.
11247 case "$d_semctl$d_semget$d_semop" in
11248 *"$undef"*) h_sem=false;;
11252 case "`ipcs 2>&1`" in
11253 "SVID messages"*"not configured"*)
11254 echo "Your $osname does not have the sem*(2) configured." >&4
11257 set semctl d_semctl
11259 set semget d_semget
11267 : we could also check for sys/ipc.h ...
11268 if $h_sem && $test `./findhdr sys/sem.h`; then
11269 echo "You have the full sem*(2) library." >&4
11272 echo "You don't have the full sem*(2) library." >&4
11278 : see whether sys/sem.h defines union semun
11280 $cat > try.c <<'END'
11281 #include <sys/types.h>
11282 #include <sys/ipc.h>
11283 #include <sys/sem.h>
11284 int main () { union semun semun; semun.buf = 0; }
11287 if eval $compile; then
11288 echo "You have union semun in <sys/sem.h>." >&4
11291 echo "You do not have union semun in <sys/sem.h>." >&4
11294 $rm -f try try.c try.h
11298 : see how to do semctl IPC_STAT
11301 : see whether semctl IPC_STAT can use union semun
11306 # define S_IRUSR S_IREAD
11307 # define S_IWUSR S_IWRITE
11308 # define S_IXUSR S_IEXEC
11310 # define S_IRUSR 0400
11311 # define S_IWUSR 0200
11312 # define S_IXUSR 0100
11314 # define S_IRGRP (S_IRUSR>>3)
11315 # define S_IWGRP (S_IWUSR>>3)
11316 # define S_IXGRP (S_IXUSR>>3)
11317 # define S_IROTH (S_IRUSR>>6)
11318 # define S_IWOTH (S_IWUSR>>6)
11319 # define S_IXOTH (S_IXUSR>>6)
11322 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
11323 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
11324 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
11329 #include <sys/types.h>
11330 #include <sys/ipc.h>
11331 #include <sys/sem.h>
11332 #include <sys/stat.h>
11339 #$d_union_semun HAS_UNION_SEMUN
11342 #ifndef HAS_UNION_SEMUN
11345 struct semid_ds *buf;
11346 unsigned short *array;
11352 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
11353 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
11355 struct semid_ds argbuf;
11358 st = semctl(sem, 0, IPC_STAT, arg);
11362 # endif /* IPC_STAT */
11363 printf("semctl IPC_STAT failed: errno = %d\n", errno);
11365 if (semctl(sem, 0, IPC_RMID, arg) != 0)
11366 # endif /* IPC_RMID */
11367 printf("semctl IPC_RMID failed: errno = %d\n", errno);
11369 #endif /* IPC_PRIVATE && ... */
11370 printf("semget failed: errno = %d\n", errno);
11376 if eval $compile; then
11379 semun) val="$define" ;;
11385 case "$d_semctl_semun" in
11387 echo "You can use union semun for semctl IPC_STAT." >&4
11390 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
11395 : see whether semctl IPC_STAT can use struct semid_ds pointer
11396 $cat > try.c <<'END'
11397 #include <sys/types.h>
11398 #include <sys/ipc.h>
11399 #include <sys/sem.h>
11400 #include <sys/stat.h>
11408 struct semid_ds arg;
11411 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
11412 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
11415 st = semctl(sem, 0, IPC_STAT, &arg);
11417 printf("semid_ds\n");
11419 # endif /* IPC_STAT */
11420 printf("semctl IPC_STAT failed: errno = %d\n", errno);
11422 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
11423 # endif /* IPC_RMID */
11424 printf("semctl IPC_RMID failed: errno = %d\n", errno);
11426 #endif /* IPC_PRIVATE && ... */
11427 printf("semget failed: errno = %d\n", errno);
11434 if eval $compile; then
11437 semid_ds) val="$define" ;;
11441 set d_semctl_semid_ds
11443 case "$d_semctl_semid_ds" in
11445 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
11447 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
11454 # We do not have the full sem*(2) library, so assume we can not
11460 set d_semctl_semid_ds
11465 : see if setegid exists
11466 set setegid d_setegid
11469 : see if seteuid exists
11470 set seteuid d_seteuid
11473 : see if setgrent exists
11474 set setgrent d_setgrent
11477 : see if sethostent exists
11478 set sethostent d_sethent
11481 : see if setlinebuf exists
11482 set setlinebuf d_setlinebuf
11485 : see if setlocale exists
11486 set setlocale d_setlocale
11489 : see if setnetent exists
11490 set setnetent d_setnent
11493 : see if setprotoent exists
11494 set setprotoent d_setpent
11497 : see if setpgid exists
11498 set setpgid d_setpgid
11501 : see if setpgrp2 exists
11502 set setpgrp2 d_setpgrp2
11505 : see if setpriority exists
11506 set setpriority d_setprior
11509 : see if setproctitle exists
11510 set setproctitle d_setproctitle
11513 : see if setpwent exists
11514 set setpwent d_setpwent
11517 : see if setregid exists
11518 set setregid d_setregid
11520 set setresgid d_setresgid
11523 : see if setreuid exists
11524 set setreuid d_setreuid
11526 set setresuid d_setresuid
11529 : see if setrgid exists
11530 set setrgid d_setrgid
11533 : see if setruid exists
11534 set setruid d_setruid
11537 : see if setservent exists
11538 set setservent d_setsent
11541 : see if setsid exists
11542 set setsid d_setsid
11545 : see if setvbuf exists
11546 set setvbuf d_setvbuf
11549 : see if sfio.h is available
11554 : see if sfio library is available
11565 : Ok, but do we want to use it.
11569 true|$define|[yY]*) dflt='y';;
11572 echo "$package can use the sfio library, but it is experimental."
11573 case "$useperlio" in
11575 echo "For sfio also the PerlIO abstraction layer is needed."
11576 echo "Earlier you said you wouldn't want that."
11579 rp="You seem to have sfio available, do you want to try using it?"
11582 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
11583 useperlio="$define"
11586 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
11591 *) case "$usesfio" in
11592 true|$define|[yY]*)
11593 echo "Sorry, cannot find sfio on this machine." >&4
11594 echo "Ignoring your setting of usesfio=$usesfio." >&4
11603 $define) usesfio='true';;
11604 *) usesfio='false';;
11608 *) : Remove sfio from list of libraries to use
11609 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
11612 echo "libs = $libs" >&4
11617 : see if shmctl exists
11618 set shmctl d_shmctl
11621 : see if shmget exists
11622 set shmget d_shmget
11625 : see if shmat exists
11628 : see what shmat returns
11631 $cat >shmat.c <<'END'
11632 #include <sys/shm.h>
11635 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
11640 echo "and it returns ($shmattype)." >&4
11641 : see if a prototype for shmat is available
11642 xxx=`./findhdr sys/shm.h`
11643 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
11644 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
11655 set d_shmatprototype
11658 : see if shmdt exists
11662 : see how much of the 'shm*(2)' library is present.
11665 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
11666 *"$undef"*) h_shm=false;;
11670 case "`ipcs 2>&1`" in
11671 "SVID shared memory"*"not configured"*)
11672 echo "Your $osname does not have the shm*(2) configured." >&4
11675 set shmctl d_shmctl
11677 set shmget d_shmget
11687 : we could also check for sys/ipc.h ...
11688 if $h_shm && $test `./findhdr sys/shm.h`; then
11689 echo "You have the full shm*(2) library." >&4
11692 echo "You don't have the full shm*(2) library." >&4
11699 : see if we have sigaction
11700 if set sigaction val -f d_sigaction; eval $csym; $val; then
11701 echo 'sigaction() found.' >&4
11702 $cat > try.c <<'EOP'
11704 #include <sys/types.h>
11705 #include <signal.h>
11708 struct sigaction act, oact;
11710 oact.sa_handler = 0;
11711 /* so that act and oact are used */
11712 exit(act.sa_flags == 0 && oact.sa_handler == 0);
11716 if eval $compile_ok; then
11719 echo "But you don't seem to have a useable struct sigaction." >&4
11723 echo 'sigaction NOT found.' >&4
11726 set d_sigaction; eval $setvar
11727 $rm -f try try$_o try.c
11729 : see if sigprocmask exists
11730 set sigprocmask d_sigprocmask
11733 : see if sigsetjmp exists
11735 case "$d_sigsetjmp" in
11737 $cat >try.c <<'EOP'
11738 #include <setjmp.h>
11743 if (sigsetjmp(env,1))
11746 siglongjmp(env, 1);
11751 if eval $compile; then
11752 if ./try >/dev/null 2>&1; then
11753 echo "POSIX sigsetjmp found." >&4
11757 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
11763 echo "sigsetjmp not found." >&4
11767 *) val="$d_sigsetjmp"
11768 case "$d_sigsetjmp" in
11769 $define) echo "POSIX sigsetjmp found." >&4;;
11770 $undef) echo "sigsetjmp not found." >&4;;
11778 : see if sockatmark exists
11779 set sockatmark d_sockatmark
11782 : see if socks5_init exists
11783 set socks5_init d_socks5_init
11786 : see if sys/stat.h is available
11787 set sys/stat.h i_sysstat
11791 : see if stat knows about block sizes
11793 echo "Checking to see if your struct stat has st_blocks field..." >&4
11794 set d_statblks stat st_blocks $i_sysstat sys/stat.h
11798 : see if this is a sys/vfs.h system
11799 set sys/vfs.h i_sysvfs
11803 : see if this is a sys/statfs.h system
11804 set sys/statfs.h i_sysstatfs
11809 echo "Checking to see if your system supports struct statfs..." >&4
11810 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
11812 case "$d_statfs_s" in
11813 "$define") echo "Yes, it does." ;;
11814 *) echo "No, it doesn't." ;;
11819 : see if struct statfs knows about f_flags
11820 case "$d_statfs_s" in
11823 echo "Checking to see if your struct statfs has f_flags field..." >&4
11824 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
11828 set d_statfs_f_flags
11832 case "$d_statfs_f_flags" in
11833 "$define") echo "Yes, it does." ;;
11834 *) echo "No, it doesn't." ;;
11837 : see if _ptr and _cnt from stdio act std
11840 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
11841 echo "(Looks like you have stdio.h from BSD.)"
11842 case "$stdio_ptr" in
11843 '') stdio_ptr='((fp)->_p)'
11846 *) ptr_lval=$d_stdio_ptr_lval;;
11848 case "$stdio_cnt" in
11849 '') stdio_cnt='((fp)->_r)'
11852 *) cnt_lval=$d_stdio_cnt_lval;;
11854 case "$stdio_base" in
11855 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
11857 case "$stdio_bufsiz" in
11858 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
11860 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
11861 echo "(Looks like you have stdio.h from Linux.)"
11862 case "$stdio_ptr" in
11863 '') stdio_ptr='((fp)->_IO_read_ptr)'
11866 *) ptr_lval=$d_stdio_ptr_lval;;
11868 case "$stdio_cnt" in
11869 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
11872 *) cnt_lval=$d_stdio_cnt_lval;;
11874 case "$stdio_base" in
11875 '') stdio_base='((fp)->_IO_read_base)';;
11877 case "$stdio_bufsiz" in
11878 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
11881 case "$stdio_ptr" in
11882 '') stdio_ptr='((fp)->_ptr)'
11885 *) ptr_lval=$d_stdio_ptr_lval;;
11887 case "$stdio_cnt" in
11888 '') stdio_cnt='((fp)->_cnt)'
11891 *) cnt_lval=$d_stdio_cnt_lval;;
11893 case "$stdio_base" in
11894 '') stdio_base='((fp)->_base)';;
11896 case "$stdio_bufsiz" in
11897 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
11901 : test whether _ptr and _cnt really work
11902 echo "Checking how std your stdio is..." >&4
11905 #define FILE_ptr(fp) $stdio_ptr
11906 #define FILE_cnt(fp) $stdio_cnt
11908 FILE *fp = fopen("try.c", "r");
11911 18 <= FILE_cnt(fp) &&
11912 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
11920 if eval $compile; then
11922 echo "Your stdio acts pretty std."
11925 echo "Your stdio isn't very std."
11928 echo "Your stdio doesn't appear very std."
11934 : Can _ptr be used as an lvalue?
11935 case "$d_stdstdio$ptr_lval" in
11936 $define$define) val=$define ;;
11939 set d_stdio_ptr_lval
11942 : Can _cnt be used as an lvalue?
11943 case "$d_stdstdio$cnt_lval" in
11944 $define$define) val=$define ;;
11947 set d_stdio_cnt_lval
11951 : test whether setting _ptr sets _cnt as a side effect
11952 d_stdio_ptr_lval_sets_cnt="$undef"
11953 d_stdio_ptr_lval_nochange_cnt="$undef"
11954 case "$d_stdio_ptr_lval$d_stdstdio" in
11956 echo "Checking to see what happens if we set the stdio ptr..." >&4
11959 /* Can we scream? */
11960 /* Eat dust sed :-) */
11961 /* In the buffer space, no one can hear you scream. */
11962 #define FILE_ptr(fp) $stdio_ptr
11963 #define FILE_cnt(fp) $stdio_cnt
11964 #include <sys/types.h>
11966 FILE *fp = fopen("try.c", "r");
11971 puts("Fail even to read");
11974 c = getc(fp); /* Read away the first # */
11976 puts("Fail even to read");
11980 18 <= FILE_cnt(fp) &&
11981 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
11983 puts("Fail even to read");
11986 ptr = (char*) FILE_ptr(fp);
11987 cnt = (size_t)FILE_cnt(fp);
11989 FILE_ptr(fp) += 42;
11991 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
11992 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
11995 if (FILE_cnt(fp) <= 20) {
11996 printf ("Fail (<20 chars to test)");
11999 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12000 puts("Fail compare");
12003 if (cnt == FILE_cnt(fp)) {
12004 puts("Pass_unchanged");
12007 if (FILE_cnt(fp) == (cnt - 42)) {
12008 puts("Pass_changed");
12011 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12017 if eval $compile; then
12018 case `./try$exe_ext` in
12020 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12021 d_stdio_ptr_lval_sets_cnt="$define" ;;
12023 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12024 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12026 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12028 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12031 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12037 : see if _base is also standard
12039 case "$d_stdstdio" in
12043 #define FILE_base(fp) $stdio_base
12044 #define FILE_bufsiz(fp) $stdio_bufsiz
12046 FILE *fp = fopen("try.c", "r");
12049 19 <= FILE_bufsiz(fp) &&
12050 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
12057 if eval $compile; then
12059 echo "And its _base field acts std."
12062 echo "But its _base field isn't std."
12065 echo "However, it seems to be lacking the _base field."
12074 Checking how to access stdio streams by file descriptor number...
12076 case "$stdio_stream_array" in
12077 '') $cat >try.c <<EOCP
12080 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
12084 for s in _iob __iob __sF
12086 set try -DSTDIO_STREAM_ARRAY=$s
12087 if eval $compile; then
12088 case "`./try$exe_ext`" in
12089 yes) stdio_stream_array=$s; break ;;
12093 $rm -f try.* try$exe_ext
12095 case "$stdio_stream_array" in
12097 I can't figure out how to access stdio streams by file descriptor number.
12099 d_stdio_stream_array="$undef"
12102 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
12104 d_stdio_stream_array="$define"
12108 : see if strcoll exists
12109 set strcoll d_strcoll
12112 : check for structure copying
12114 echo "Checking to see if your C compiler can copy structs..." >&4
12115 $cat >try.c <<'EOCP'
12125 if $cc -c try.c >/dev/null 2>&1 ; then
12127 echo "Yup, it can."
12130 echo "Nope, it can't."
12136 : see if strerror and/or sys_errlist[] exist
12138 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
12139 if set strerror val -f d_strerror; eval $csym; $val; then
12140 echo 'strerror() found.' >&4
12141 d_strerror="$define"
12142 d_strerrm='strerror(e)'
12143 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
12144 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
12145 d_syserrlst="$define"
12147 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
12148 d_syserrlst="$undef"
12150 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
12151 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
12152 echo 'strerror() found in string header.' >&4
12153 d_strerror="$define"
12154 d_strerrm='strerror(e)'
12155 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
12156 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
12157 d_syserrlst="$define"
12159 echo "(You don't appear to have any sys_errlist[], how can this be?)"
12160 d_syserrlst="$undef"
12162 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
12163 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
12164 d_strerror="$undef"
12165 d_syserrlst="$define"
12166 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
12168 echo 'strerror() and sys_errlist[] NOT found.' >&4
12169 d_strerror="$undef"
12170 d_syserrlst="$undef"
12171 d_strerrm='"unknown"'
12175 : see if strtod exists
12176 set strtod d_strtod
12179 : see if strtol exists
12180 set strtol d_strtol
12183 : see if strtold exists
12184 set strtold d_strtold
12187 : see if strtoll exists
12188 set strtoll d_strtoll
12191 case "$d_longlong-$d_strtoll" in
12194 Checking whether your strtoll() works okay...
12196 $cat >try.c <<'EOCP'
12199 #define strtoll __strtoll
12202 #define strtoll _strtoll
12205 extern long long int strtoll(char *s, char **, int);
12206 static int bad = 0;
12207 int check(char *s, long long ell, int een) {
12210 gll = strtoll(s, 0, 10);
12211 if (!((gll == ell) && (errno == een)))
12215 check(" 1", 1LL, 0);
12216 check(" 0", 0LL, 0);
12217 check("-1", -1LL, 0);
12218 check("-9223372036854775808", -9223372036854775808LL, 0);
12219 check("-9223372036854775808", -9223372036854775808LL, 0);
12220 check(" 9223372036854775807", 9223372036854775807LL, 0);
12221 check("-9223372036854775808", -9223372036854775808LL, 0);
12222 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
12223 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
12229 if eval $compile; then
12232 ok) echo "Your strtoll() seems to be working okay." ;;
12234 Your strtoll() doesn't seem to be working okay.
12240 echo "(I can't seem to compile the test program--assuming it doesn't)"
12246 : see if strtoq exists
12247 set strtoq d_strtoq
12250 : see if strtoul exists
12251 set strtoul d_strtoul
12254 case "$d_strtoul" in
12257 Checking whether your strtoul() works okay...
12259 $cat >try.c <<'EOCP'
12262 extern unsigned long int strtoul(char *s, char **, int);
12263 static int bad = 0;
12264 void check(char *s, unsigned long eul, int een) {
12267 gul = strtoul(s, 0, 10);
12268 if (!((gul == eul) && (errno == een)))
12272 check(" 1", 1L, 0);
12273 check(" 0", 0L, 0);
12275 case "$longsize" in
12277 $cat >>try.c <<'EOCP'
12278 check("18446744073709551615", 18446744073709551615UL, 0);
12279 check("18446744073709551616", 18446744073709551615UL, ERANGE);
12280 #if 0 /* strtoul() for /^-/ strings is undefined. */
12281 check("-1", 18446744073709551615UL, 0);
12282 check("-18446744073709551614", 2, 0);
12283 check("-18446744073709551615", 1, 0);
12284 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
12285 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
12290 $cat >>try.c <<'EOCP'
12291 check("4294967295", 4294967295UL, 0);
12292 check("4294967296", 4294967295UL, ERANGE);
12293 #if 0 /* strtoul() for /^-/ strings is undefined. */
12294 check("-1", 4294967295UL, 0);
12295 check("-4294967294", 2, 0);
12296 check("-4294967295", 1, 0);
12297 check("-4294967296", 4294967295UL, ERANGE);
12298 check("-4294967297", 4294967295UL, ERANGE);
12303 : Should we write these tests to be more portable by sprintf-ing
12304 : ~0 and then manipulating that char string as input for strtol?
12307 $cat >>try.c <<'EOCP'
12314 if eval $compile; then
12316 ok) echo "Your strtoul() seems to be working okay." ;;
12318 Your strtoul() doesn't seem to be working okay.
12327 : see if strtoull exists
12328 set strtoull d_strtoull
12331 case "$d_longlong-$d_strtoull" in
12334 Checking whether your strtoull() works okay...
12336 $cat >try.c <<'EOCP'
12339 #define strtoull __strtoull
12342 extern unsigned long long int strtoull(char *s, char **, int);
12343 static int bad = 0;
12344 int check(char *s, long long eull, int een) {
12347 gull = strtoull(s, 0, 10);
12348 if (!((gull == eull) && (errno == een)))
12352 check(" 1", 1LL, 0);
12353 check(" 0", 0LL, 0);
12354 check("18446744073709551615", 18446744073709551615ULL, 0);
12355 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
12356 #if 0 /* strtoull() for /^-/ strings is undefined. */
12357 check("-1", 18446744073709551615ULL, 0);
12358 check("-18446744073709551614", 2LL, 0);
12359 check("-18446744073709551615", 1LL, 0);
12360 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
12361 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
12368 if eval $compile; then
12370 ok) echo "Your strtoull() seems to be working okay." ;;
12372 Your strtoull() doesn't seem to be working okay.
12374 d_strtoull="$undef"
12381 : see if strtouq exists
12382 set strtouq d_strtouq
12385 case "$d_strtouq" in
12388 Checking whether your strtouq() works okay...
12390 $cat >try.c <<'EOCP'
12393 extern unsigned long long int strtouq(char *s, char **, int);
12394 static int bad = 0;
12395 void check(char *s, unsigned long long eull, int een) {
12396 unsigned long long gull;
12398 gull = strtouq(s, 0, 10);
12399 if (!((gull == eull) && (errno == een)))
12403 check(" 1", 1LL, 0);
12404 check(" 0", 0LL, 0);
12405 check("18446744073709551615", 18446744073709551615ULL, 0);
12406 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
12407 #if 0 /* strtouq() for /^-/ strings is undefined. */
12408 check("-1", 18446744073709551615ULL, 0);
12409 check("-18446744073709551614", 2LL, 0);
12410 check("-18446744073709551615", 1LL, 0);
12411 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
12412 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
12420 if eval $compile; then
12422 ok) echo "Your strtouq() seems to be working okay." ;;
12424 Your strtouq() doesn't seem to be working okay.
12433 : see if strxfrm exists
12434 set strxfrm d_strxfrm
12437 : see if symlink exists
12438 set symlink d_symlink
12441 : see if syscall exists
12442 set syscall d_syscall
12445 : see if sysconf exists
12446 set sysconf d_sysconf
12449 : see if system exists
12450 set system d_system
12453 : see if tcgetpgrp exists
12454 set tcgetpgrp d_tcgetpgrp
12457 : see if tcsetpgrp exists
12458 set tcsetpgrp d_tcsetpgrp
12461 : see if prototype for telldir is available
12463 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
12466 : see if this is a sys/times.h system
12467 set sys/times.h i_systimes
12470 : see if times exists
12472 if set times val -f d_times; eval $csym; $val; then
12473 echo 'times() found.' >&4
12476 case "$i_systimes" in
12477 "$define") inc='sys/times.h';;
12479 rp="What is the type returned by times() on this system?"
12480 set clock_t clocktype long stdio.h sys/types.h $inc
12483 echo 'times() NOT found, hope that will do.' >&4
12488 : see if truncate exists
12489 set truncate d_truncate
12492 : see if tzname[] exists
12494 if set tzname val -a d_tzname; eval $csym; $val; then
12496 echo 'tzname[] found.' >&4
12499 echo 'tzname[] NOT found.' >&4
12504 : see if umask exists
12508 : see if ustat exists
12512 : backward compatibility for d_hvfork
12513 if test X$d_hvfork != X; then
12514 d_vfork="$d_hvfork"
12517 : see if there is a vfork
12522 : Ok, but do we want to use it. vfork is reportedly unreliable in
12523 : perl on Solaris 2.x, and probably elsewhere.
12527 case "$usevfork" in
12533 Perl can only use a vfork() that doesn't suffer from strict
12534 restrictions on calling functions or modifying global data in
12535 the child. For example, glibc-2.1 contains such a vfork()
12536 that is unsuitable. If your system provides a proper fork()
12537 call, chances are that you do NOT want perl to use vfork().
12540 rp="Do you still want to use vfork()?"
12545 echo "Ok, we won't use vfork()."
12554 $define) usevfork='true';;
12555 *) usevfork='false';;
12558 : see if this is an sysdir system
12559 set sys/dir.h i_sysdir
12562 : see if this is an sysndir system
12563 set sys/ndir.h i_sysndir
12566 : see if closedir exists
12567 set closedir d_closedir
12570 case "$d_closedir" in
12573 echo "Checking whether closedir() returns a status..." >&4
12574 cat > closedir.c <<EOM
12575 #$i_dirent I_DIRENT /**/
12576 #$i_sysdir I_SYS_DIR /**/
12577 #$i_sysndir I_SYS_NDIR /**/
12578 #$i_systypes I_SYS_TYPES /**/
12580 #if defined(I_SYS_TYPES)
12581 #include <sys/types.h>
12583 #if defined(I_DIRENT)
12584 #include <dirent.h>
12585 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
12586 #include <sys/dir.h>
12590 #include <sys/ndir.h>
12594 #include <ndir.h> /* may be wrong in the future */
12596 #include <sys/dir.h>
12601 int main() { return closedir(opendir(".")); }
12604 if eval $compile_ok; then
12605 if ./closedir > /dev/null 2>&1 ; then
12606 echo "Yes, it does."
12609 echo "No, it doesn't."
12613 echo "(I can't seem to compile the test program--assuming it doesn't)"
12621 set d_void_closedir
12624 : see if there is a wait4
12628 : see if waitpid exists
12629 set waitpid d_waitpid
12632 : see if wcstombs exists
12633 set wcstombs d_wcstombs
12636 : see if wctomb exists
12637 set wctomb d_wctomb
12640 : preserve RCS keywords in files with variable substitution, grrr
12645 Revision='$Revision'
12647 case "$crosscompile" in
12648 ''|[nN]*) crosscompile="$undef" ;;
12652 next|rhapsody|darwin) multiarch="$define" ;;
12654 case "$multiarch" in
12655 ''|[nN]*) multiarch="$undef" ;;
12658 : check for alignment requirements
12660 case "$crosscompile$multiarch" in
12663 You seem to be either cross-compiling or doing a multiarchitecture build,
12664 skipping the memory alignment check.
12667 case "$alignbytes" in
12668 '') alignbytes=8 ;;
12672 case "$alignbytes" in
12673 '') echo "Checking alignment constraints..." >&4
12674 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
12675 $cat >try.c <<'EOCP'
12676 typedef long double NV;
12679 $cat >try.c <<'EOCP'
12683 $cat >>try.c <<'EOCP'
12691 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
12696 if eval $compile_ok; then
12700 echo "(I can't seem to compile the test program...)"
12703 *) dflt="$alignbytes"
12706 rp="Doubles must be aligned on a how-many-byte boundary?"
12714 : set the base revision
12717 : check for ordering of bytes in a long
12719 case "$crosscompile$multiarch" in
12722 You seem to be either cross-compiling or doing a multiarchitecture build,
12723 skipping the byteorder check.
12729 case "$byteorder" in
12732 In the following, larger digits indicate more significance. A big-endian
12733 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
12734 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
12735 machines may have weird orders like 3412. A Cray will report 87654321,
12736 an Alpha will report 12345678. If the test program works the default is
12738 I'm now running the test program...
12740 $cat >try.c <<'EOCP'
12747 char c[sizeof(long)];
12750 if (sizeof(long) > 4)
12751 u.l = (0x08070605L << 32) | 0x04030201L;
12754 for (i = 0; i < sizeof(long); i++)
12755 printf("%c", u.c[i]+'0');
12762 if eval $compile && ./try > /dev/null; then
12765 [1-4][1-4][1-4][1-4]|12345678|87654321)
12766 echo "(The test program ran ok.)"
12767 echo "byteorder=$dflt"
12770 ????|????????) echo "(The test program ran ok.)" ;;
12771 *) echo "(The test program didn't run right for some reason.)" ;;
12776 (I can't seem to compile the test program. Guessing big-endian...)
12779 case "$xxx_prompt" in
12781 rp="What is the order of bytes in a long?"
12795 : how do we catenate cpp tokens here?
12797 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
12798 $cat >cpp_stuff.c <<'EOCP'
12799 #define RCAT(a,b)a/**/b
12800 #define ACAT(a,b)a ## b
12804 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
12805 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
12806 echo "Oh! Smells like ANSI's been here." >&4
12807 echo "We can catify or stringify, separately or together!"
12809 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
12810 echo "Ah, yes! The good old days!" >&4
12811 echo "However, in the good old days we don't know how to stringify and"
12812 echo "catify at the same time."
12816 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
12817 to have to edit the values of CAT[2-5] in config.h...
12819 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
12823 : see if this is a db.h system
12829 : Check db version.
12831 echo "Checking Berkeley DB version ..." >&4
12837 #include <sys/types.h>
12842 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
12843 int Major, Minor, Patch ;
12844 unsigned long Version ;
12845 (void)db_version(&Major, &Minor, &Patch) ;
12846 printf("You have Berkeley DB Version 2 or greater\n");
12848 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
12849 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
12850 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
12851 Major, Minor, Patch) ;
12853 /* check that db.h & libdb are compatible */
12854 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
12855 printf("db.h and libdb are incompatible\n") ;
12859 printf("db.h and libdb are compatible\n") ;
12861 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
12862 + DB_VERSION_PATCH ;
12864 /* needs to be >= 2.3.4 */
12865 if (Version < 2003004) {
12866 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
12867 printf("but Perl needs Berkeley DB 2.3.4 or greater\n") ;
12873 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
12874 printf("You have Berkeley DB Version 1\n");
12875 exit(0); /* DB version < 2: the coast is clear. */
12877 exit(1); /* <db.h> not Berkeley DB? */
12883 if eval $compile_ok && ./try; then
12884 echo 'Looks OK.' >&4
12886 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
12890 : Remove db from list of libraries to use
12891 echo "Removing unusable -ldb from library list" >&4
12892 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
12895 echo "libs = $libs" >&4
12905 : Check the return type needed for hash
12907 echo "Checking return type needed for hash for Berkeley DB ..." >&4
12913 #include <sys/types.h>
12916 #ifndef DB_VERSION_MAJOR
12917 u_int32_t hash_cb (ptr, size)
12925 info.hash = hash_cb;
12929 if $cc $ccflags -c try.c >try.out 2>&1 ; then
12930 if $contains warning try.out >>/dev/null 2>&1 ; then
12933 db_hashtype='u_int32_t'
12936 : XXX Maybe we should just give up here.
12937 db_hashtype=u_int32_t
12939 echo "Help: I can't seem to compile the db test program." >&4
12940 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
12943 echo "Your version of Berkeley DB uses $db_hashtype for hash."
12945 *) db_hashtype=u_int32_t
12950 : Check the return type needed for prefix
12952 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
12958 #include <sys/types.h>
12961 #ifndef DB_VERSION_MAJOR
12962 size_t prefix_cb (key1, key2)
12970 info.prefix = prefix_cb;
12974 if $cc $ccflags -c try.c >try.out 2>&1 ; then
12975 if $contains warning try.out >>/dev/null 2>&1 ; then
12976 db_prefixtype='int'
12978 db_prefixtype='size_t'
12981 db_prefixtype='size_t'
12982 : XXX Maybe we should just give up here.
12984 echo "Help: I can't seem to compile the db test program." >&4
12985 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
12988 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
12990 *) db_prefixtype='size_t'
12995 : How can we generate normalized random numbers ?
12997 echo "Looking for a random number function..." >&4
12998 case "$randfunc" in
13000 if set drand48 val -f; eval $csym; $val; then
13002 echo "Good, found drand48()." >&4
13003 elif set random val -f; eval $csym; $val; then
13005 echo "OK, found random()." >&4
13008 echo "Yick, looks like I have to use rand()." >&4
13019 *-Dmy_rand=*|*-Dmy_srand=*)
13020 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
13021 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
13022 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
13023 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
13027 while $test "$cont"; do
13028 rp="Use which function to generate random numbers?"
13030 if $test "$ans" = "$dflt"; then
13036 if set $ans val -f; eval $csym; $val; then
13040 rp="I cannot find function $ans. Use that name anyway?"
13049 case "$randfunc" in
13051 drand01="drand48()"
13057 case "$randbits" in
13059 echo "Checking to see how many bits your $randfunc() function produces..." >&4
13061 #$i_unistd I_UNISTD
13062 #$i_stdlib I_STDLIB
13065 # include <unistd.h>
13068 # include <stdlib.h>
13073 register unsigned long tmp;
13074 register unsigned long max = 0L;
13076 for (i = 1000; i; i--) {
13077 tmp = (unsigned long) $randfunc();
13078 if (tmp > max) max = tmp;
13080 for (i = 0; max; i++)
13086 if eval $compile_ok; then
13090 echo "(I can't seem to compile the test program...)"
13097 rp="How many bits does your $randfunc() function produce?"
13101 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
13102 seedfunc="s$randfunc"
13103 randseedtype=unsigned
13107 rp="How many bits does your $randfunc() function produce?"
13110 seedfunc="s$randfunc"
13111 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
13112 if set $seedfunc val -f; eval $csym; $val; then
13113 echo "(Using $seedfunc() to seed random generator)"
13115 echo "(Warning: no $seedfunc() to seed random generator)"
13118 randseedtype=unsigned
13126 echo "Determining whether or not we are on an EBCDIC system..." >&4
13127 $cat >tebcdic.c <<'EOM'
13130 if ('M'==0xd4) return 0;
13137 if eval $compile_ok; then
13139 echo "You seem to speak EBCDIC." >&4
13142 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF8." >&4
13145 echo "I'm unable to compile the test program." >&4
13146 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
13148 $rm -f tebcdic.c tebcdic
13154 Checking how to flush all pending stdio output...
13156 # I only know how to find the first 32 possibly open files on SunOS.
13157 # See also hints/sunos_4_1.sh and util.c --AD
13159 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
13161 $cat >>try.c <<EOCP
13163 #$i_unistd I_UNISTD
13165 # include <unistd.h>
13167 #$d_sysconf HAS_SYSCONF
13168 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
13169 #ifdef HAS_STDIO_STREAM_ARRAY
13170 # define STDIO_STREAM_ARRAY $stdio_stream_array
13173 FILE* p = fopen("try.out", "w");
13177 # ifdef TRY_FPRINTF
13181 #ifdef TRY_FFLUSH_NULL
13184 #ifdef TRY_FFLUSH_ALL
13186 long open_max = -1;
13187 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
13188 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
13190 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
13191 open_max = sysconf(_SC_OPEN_MAX);
13194 open_max = FOPEN_MAX;
13197 open_max = OPEN_MAX;
13206 # ifdef HAS_STDIO_STREAM_ARRAY
13207 if (open_max > 0) {
13209 for (i = 0; i < open_max; i++)
13210 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
13211 STDIO_STREAM_ARRAY[i]._file < open_max &&
13212 STDIO_STREAM_ARRAY[i]._flag)
13213 fflush(&STDIO_STREAM_ARRAY[i]);
13221 : first we have to find out how _not_ to flush
13222 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
13224 set try -DTRY_FPUTC
13225 if eval $compile; then
13227 ./try$exe_ext 2>/dev/null
13228 if $test ! -s try.out -a "X$?" = X42; then
13234 set try -DTRY_FPRINTF
13236 if eval $compile; then
13238 ./try$exe_ext 2>/dev/null
13239 if $test ! -s try.out -a "X$?" = X42; then
13240 output=-DTRY_FPRINTF
13246 : check for fflush NULL behaviour
13247 case "$fflushNULL" in
13248 '') set try -DTRY_FFLUSH_NULL $output
13249 if eval $compile; then
13251 ./try$exe_ext 2>/dev/null
13253 if $test -s try.out -a "X$code" = X42; then
13254 fflushNULL="`$cat try.out`"
13256 if $test "X$code" != X42; then
13258 (If this test failed, don't worry, we'll try another method shortly.)
13263 $rm -f core try.core core.try.*
13264 case "$fflushNULL" in
13266 Your fflush(NULL) works okay for output streams.
13267 Let's see if it clobbers input pipes...
13269 # As of mid-March 2000 all versions of Solaris appear to have a stdio
13270 # bug that improperly flushes the input end of pipes. So we avoid the
13271 # autoflush on fork/system/exec support for now. :-(
13272 $cat >tryp.c <<EOCP
13275 main(int argc, char **argv)
13281 while ((i = getc(stdin)) != -1
13282 && (*bp++ = i) != '\n'
13283 && bp < &buf[1024])
13286 fprintf(stdout, "%s", buf);
13294 fflushNULL="$define"
13296 if eval $compile; then
13298 $cat tryp.c | ./tryp$exe_ext 2>/dev/null > tryp.out
13299 if cmp tryp.c tryp.out >/dev/null 2>&1; then
13301 fflush(NULL) seems to behave okay with input streams.
13303 fflushNULL="$define"
13306 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
13308 fflushNULL="$undef"
13311 $rm -f core tryp.c tryp.core core.tryp.*
13314 Your fflush(NULL) isn't working (contrary to ANSI C).
13316 fflushNULL="$undef"
13319 Cannot figure out whether your fflush(NULL) works or not.
13320 I'm assuming it doesn't (contrary to ANSI C).
13322 fflushNULL="$undef"
13326 $define|true|[yY]*)
13327 fflushNULL="$define"
13330 fflushNULL="$undef"
13333 : check explicit looping only if NULL did not work, and if the pipe
13334 : bug does not show up on an explicit flush too
13335 case "$fflushNULL" in
13337 $cat >tryp.c <<EOCP
13340 main(int argc, char **argv)
13346 while ((i = getc(stdin)) != -1
13347 && (*bp++ = i) != '\n'
13348 && bp < &buf[1024])
13351 fprintf(stdout, "%s", buf);
13360 if eval $compile; then
13362 $cat tryp.c | ./tryp$exe_ext 2>/dev/null > tryp.out
13363 if cmp tryp.c tryp.out >/dev/null 2>&1; then
13365 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
13367 : now check for fflushall behaviour
13368 case "$fflushall" in
13369 '') set try -DTRY_FFLUSH_ALL $output
13370 if eval $compile; then
13372 (Now testing the other method--but note that this also may fail.)
13375 ./try$exe_ext 2>/dev/null
13376 if $test -s try.out -a "X$?" = X42; then
13377 fflushall="`$cat try.out`"
13380 $rm -f core try.core core.try.*
13381 case "$fflushall" in
13383 Whew. Flushing explicitly all the stdio streams works.
13385 fflushall="$define"
13388 Sigh. Flushing explicitly all the stdio streams doesn't work.
13393 Cannot figure out whether flushing stdio streams explicitly works or not.
13394 I'm assuming it doesn't.
13400 "$define"|true|[yY]*)
13401 fflushall="$define"
13409 All is futile. Even fflush(stdin) clobbers input pipes!
13416 $rm -f core tryp.c tryp.core core.tryp.*
13418 *) fflushall="$undef"
13422 case "$fflushNULL$fflushall" in
13425 OK, I give up. I cannot figure out how to flush pending stdio output.
13426 We won't be flushing handles at all before fork/exec/popen.
13430 $rm -f try.* try$exe_ext
13432 : Store the full pathname to the ar program for use in the C program
13433 : Respect a hint or command line value for full_ar.
13438 : Store the full pathname to the sed program for use in the C program
13441 : see what type gids are declared as in the kernel
13443 echo "Looking for the type for group ids returned by getgid()."
13444 set gid_t gidtype xxx stdio.h sys/types.h
13448 xxx=`./findhdr sys/user.h`
13449 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
13451 unsigned) dflt="$1 $2" ;;
13455 *) dflt="$gidtype";;
13458 gid_t) echo "gid_t found." ;;
13459 *) rp="What is the type for group ids returned by getgid()?"
13467 *_t) zzz="$gidtype" ;;
13470 echo "Checking the size of $zzz..." >&4
13472 #include <sys/types.h>
13475 printf("%d\n", (int)sizeof($gidtype));
13480 if eval $compile_ok; then
13484 echo "(I can't execute the test program--guessing $gidsize.)" >&4
13487 echo "Your $zzz is $gidsize bytes long."
13492 echo "(I can't compile the test program--guessing $gidsize.)" >&4
13498 *_t) zzz="$gidtype" ;;
13501 echo "Checking the sign of $zzz..." >&4
13503 #include <sys/types.h>
13514 if eval $compile; then
13518 echo "(I can't execute the test program--guessing unsigned.)" >&4
13522 1) echo "Your $zzz is unsigned." ;;
13523 -1) echo "Your $zzz is signed." ;;
13529 echo "(I can't compile the test program--guessing unsigned.)" >&4
13535 if $test X"$quadtype" != X; then
13537 echo "Checking how to print 64-bit integers..." >&4
13539 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
13540 $cat >try.c <<'EOCP'
13541 #include <sys/types.h>
13544 int q = 12345678901;
13545 printf("%ld\n", q);
13549 if eval $compile; then
13550 yyy=`./try$exe_ext`
13553 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
13554 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
13555 echo "We will use %d."
13561 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
13562 $cat >try.c <<'EOCP'
13563 #include <sys/types.h>
13566 long q = 12345678901;
13567 printf("%ld\n", q);
13571 if eval $compile; then
13572 yyy=`./try$exe_ext`
13575 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
13576 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
13577 echo "We will use %ld."
13583 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
13584 $cat >try.c <<'EOCP'
13585 #include <sys/types.h>
13586 #include <inttypes.h>
13589 int64_t q = 12345678901;
13590 printf("%" PRId64 "\n", q);
13594 if eval $compile; then
13595 yyy=`./try$exe_ext`
13598 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
13599 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
13600 echo "We will use the C9X style."
13606 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
13607 $cat >try.c <<'EOCP'
13608 #include <sys/types.h>
13611 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
13612 printf("%lld\n", q);
13616 if eval $compile; then
13617 yyy=`./try$exe_ext`
13620 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
13621 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
13622 echo "We will use the %lld style."
13628 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
13630 #include <sys/types.h>
13633 $quadtype q = 12345678901;
13634 printf("%Ld\n", q);
13638 if eval $compile; then
13639 yyy=`./try$exe_ext`
13642 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
13643 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
13644 echo "We will use %Ld."
13650 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
13652 #include <sys/types.h>
13655 $quadtype q = 12345678901;
13656 printf("%qd\n", q);
13660 if eval $compile; then
13661 yyy=`./try$exe_ext`
13664 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
13665 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
13666 echo "We will use %qd."
13672 if $test X"$sPRId64" = X; then
13673 echo "Cannot figure out how to print 64-bit integers." >&4
13681 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
13682 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
13684 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
13685 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
13691 $echo "Checking the format strings to be used for Perl's internal types..." >&4
13693 if $test X"$ivsize" = X8; then
13694 ivdformat="$sPRId64"
13695 uvuformat="$sPRIu64"
13696 uvoformat="$sPRIo64"
13697 uvxformat="$sPRIx64"
13698 uvXUformat="$sPRIXU64"
13700 if $test X"$ivsize" = X"$longsize"; then
13707 if $test X"$ivsize" = X"$intsize"; then
13715 if $test X"$ivsize" = X"$shortsize"; then
13726 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
13727 nveformat="$sPRIeldbl"
13728 nvfformat="$sPRIfldbl"
13729 nvgformat="$sPRIgldbl"
13730 nvEUformat="$sPRIEUldbl"
13731 nvFUformat="$sPRIFUldbl"
13732 nvGUformat="$sPRIGUldbl"
13742 case "$ivdformat" in
13743 '') echo "$0: Fatal: failed to find format strings, cannot continue." >& 4
13750 $echo "Checking the format string to be used for gids..." >&4
13753 -1) if $test X"$gidsize" = X"$ivsize"; then
13754 gidformat="$ivdformat"
13756 if $test X"$gidsize" = X"$longsize"; then
13759 if $test X"$gidsize" = X"$intsize"; then
13762 if $test X"$gidsize" = X"$shortsize"; then
13769 *) if $test X"$gidsize" = X"$uvsize"; then
13770 gidformat="$uvuformat"
13772 if $test X"$gidsize" = X"$longsize"; then
13775 if $test X"$gidsize" = X"$intsize"; then
13778 if $test X"$gidsize" = X"$shortsize"; then
13787 : see if getgroups exists
13788 set getgroups d_getgrps
13791 : see if setgroups exists
13792 set setgroups d_setgrps
13796 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
13798 case "$d_getgrps$d_setgrps" in
13800 case "$groupstype" in
13801 '') dflt="$gidtype" ;;
13802 *) dflt="$groupstype" ;;
13805 What type of pointer is the second argument to getgroups() and setgroups()?
13806 Usually this is the same as group ids, $gidtype, but not always.
13809 rp='What type pointer is the second argument to getgroups() and setgroups()?'
13813 *) groupstype="$gidtype";;
13817 echo "Checking if your $make program sets \$(MAKE)..." >&4
13818 case "$make_set_make" in
13820 $sed 's/^X //' > testmake.mak << 'EOF'
13822 X @echo 'maketemp="$(MAKE)"'
13824 case "`$make -f testmake.mak 2>/dev/null`" in
13825 *maketemp=*) make_set_make='#' ;;
13826 *) make_set_make="MAKE=$make" ;;
13828 $rm -f testmake.mak
13831 case "$make_set_make" in
13832 '#') echo "Yup, it does.";;
13833 *) echo "Nope, it doesn't.";;
13836 : see what type is used for mode_t
13837 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
13838 set mode_t modetype int stdio.h sys/types.h
13841 : see if stdarg is available
13843 if $test `./findhdr stdarg.h`; then
13844 echo "<stdarg.h> found." >&4
13847 echo "<stdarg.h> NOT found." >&4
13851 : see if varags is available
13853 if $test `./findhdr varargs.h`; then
13854 echo "<varargs.h> found." >&4
13856 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
13859 : set up the varargs testing programs
13860 $cat > varargs.c <<EOP
13862 #include <stdarg.h>
13865 #include <varargs.h>
13869 int f(char *p, ...)
13883 p = va_arg(ap, char *);
13888 $cat > varargs <<EOP
13890 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
13899 : now check which varargs header should be included
13904 if `./varargs I_STDARG`; then
13906 elif `./varargs I_VARARGS`; then
13911 if `./varargs I_VARARGS`; then
13918 echo "I could not find the definition for va_dcl... You have problems..." >&4
13919 val="$undef"; set i_stdarg; eval $setvar
13920 val="$undef"; set i_varargs; eval $setvar
13925 case "$i_varhdr" in
13927 val="$define"; set i_stdarg; eval $setvar
13928 val="$undef"; set i_varargs; eval $setvar
13931 val="$undef"; set i_stdarg; eval $setvar
13932 val="$define"; set i_varargs; eval $setvar
13935 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
13939 : see if we need va_copy
13941 case "$i_stdarg" in
13944 #include <stdarg.h>
13946 #$i_stdlib I_STDLIB
13948 #include <stdlib.h>
13950 #include <signal.h>
13953 ivfprintf(FILE *f, const char *fmt, va_list *valp)
13955 return vfprintf(f, fmt, *valp);
13959 myvfprintf(FILE *f, const char *fmt, va_list val)
13961 return ivfprintf(f, fmt, &val);
13965 myprintf(char *fmt, ...)
13968 va_start(val, fmt);
13969 return myvfprintf(stdout, fmt, val);
13973 main(int ac, char **av)
13975 signal(SIGSEGV, exit);
13977 myprintf("%s%cs all right, then\n", "that", '\'');
13982 if eval $compile && ./try 2>&1 >/dev/null; then
13984 "that's all right, then")
13990 yes) echo "It seems that you don't need va_copy()." >&4
13991 need_va_copy="$undef"
13993 *) echo "It seems that va_copy() or similar will be needed." >&4
13994 need_va_copy="$define"
13997 $rm -f try.* core core.* *.core *.core.*
13999 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
14003 : define a fucntion to check prototypes
14004 $cat > protochk <<EOSH
14007 optimize="$optimize"
14009 prototype="$prototype"
14014 $cat >> protochk <<'EOSH'
14019 while test $# -ge 2; do
14021 $define) echo "#include <$2>" >> try.c ;;
14022 literal) echo "$2" >> try.c ;;
14026 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
14027 cat >> try.c <<'EOCP'
14028 #ifdef CAN_PROTOTYPE
14029 #define _(args) args
14034 echo "$foo" >> try.c
14035 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
14036 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
14042 $eunicefix protochk
14044 : see what type is used for size_t
14045 rp="What is the type used for the length parameter for string functions?"
14046 set size_t sizetype 'unsigned int' stdio.h sys/types.h
14049 : check for type of arguments to gethostbyaddr.
14050 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
14051 case "$d_gethbyaddr" in
14055 Checking to see what type of arguments are accepted by gethostbyaddr().
14057 hdrs="$define sys/types.h
14058 $d_socket sys/socket.h
14059 $i_niin netinet/in.h
14061 $i_unistd unistd.h"
14062 : The first arg can 'char *' or 'void *'
14063 : The second arg is some of integral type
14064 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
14065 for yyy in size_t long int; do
14066 case "$netdb_host_type" in
14067 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
14068 if ./protochk "$try" $hdrs; then
14069 echo "Your system accepts $xxx for the first arg."
14070 echo "...and $yyy for the second arg."
14071 netdb_host_type="$xxx"
14072 netdb_hlen_type="$yyy"
14078 : In case none of those worked, prompt the user.
14079 case "$netdb_host_type" in
14080 '') rp='What is the type for the 1st argument to gethostbyaddr?'
14083 netdb_host_type=$ans
14084 rp='What is the type for the 2nd argument to gethostbyaddr?'
14087 netdb_hlen_type=$ans
14091 *) : no gethostbyaddr, so pick harmless defaults
14092 netdb_host_type='char *'
14093 netdb_hlen_type="$sizetype"
14096 # Remove the "const" if needed. -- but then we'll have a
14098 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
14101 : check for type of argument to gethostbyname.
14102 if test "X$netdb_name_type" = X ; then
14103 case "$d_gethbyname" in
14107 Checking to see what type of argument is accepted by gethostbyname().
14109 hdrs="$define sys/types.h
14110 $d_socket sys/socket.h
14111 $i_niin netinet/in.h
14113 $i_unistd unistd.h"
14114 for xxx in "const char *" "char *"; do
14115 case "$netdb_name_type" in
14116 '') try="extern struct hostent *gethostbyname($xxx);"
14117 if ./protochk "$try" $hdrs; then
14118 echo "Your system accepts $xxx."
14119 netdb_name_type="$xxx"
14124 : In case none of those worked, prompt the user.
14125 case "$netdb_name_type" in
14126 '') rp='What is the type for the 1st argument to gethostbyname?'
14129 netdb_name_type=$ans
14133 *) : no gethostbyname, so pick harmless default
14134 netdb_name_type='char *'
14139 : check for type of 1st argument to getnetbyaddr.
14140 if test "X$netdb_net_type" = X ; then
14141 case "$d_getnbyaddr" in
14145 Checking to see what type of 1st argument is accepted by getnetbyaddr().
14147 hdrs="$define sys/types.h
14148 $d_socket sys/socket.h
14149 $i_niin netinet/in.h
14151 $i_unistd unistd.h"
14152 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
14153 case "$netdb_net_type" in
14154 '') try="extern struct netent *getnetbyaddr($xxx, int);"
14155 if ./protochk "$try" $hdrs; then
14156 echo "Your system accepts $xxx."
14157 netdb_net_type="$xxx"
14162 : In case none of those worked, prompt the user.
14163 case "$netdb_net_type" in
14164 '') rp='What is the type for the 1st argument to getnetbyaddr?'
14167 netdb_net_type=$ans
14171 *) : no getnetbyaddr, so pick harmless default
14172 netdb_net_type='long'
14176 : locate the preferred pager for this system
14182 [a-zA-Z]:/*) dflt=$pg;;
14186 [a-zA-Z]:/*) dflt=$more;;
14190 [a-zA-Z]:/*) dflt=$less;;
14193 '') dflt=/usr/ucb/more;;
14200 rp='What pager is used on your system?'
14204 : see what type pids are declared as in the kernel
14205 rp="What is the type of process ids on this system?"
14206 set pid_t pidtype int stdio.h sys/types.h
14209 : Find earliest binary compatible site_perl subdirectory perl can use.
14210 case "$bincompat5005" in
14211 "$define") xs_apiversion='5.005' ;;
14212 *) xs_apiversion=$version ;; # The current site_perl version.
14214 : Find earliest pure perl site_perl subdirectory perl can use.
14215 : The versioned directories started at 5.005.
14216 pm_apiversion='5.005'
14218 : see if ar generates random libraries by itself
14220 echo "Checking how to generate random libraries on your machine..." >&4
14221 echo 'int bar1() { return bar2(); }' > bar1.c
14222 echo 'int bar2() { return 2; }' > bar2.c
14223 $cat > foo.c <<'EOP'
14224 int main() { printf("%d\n", bar1()); exit(0); }
14226 $cc $ccflags -c bar1.c >/dev/null 2>&1
14227 $cc $ccflags -c bar2.c >/dev/null 2>&1
14228 $cc $ccflags -c foo.c >/dev/null 2>&1
14229 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
14230 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
14231 ./foobar >/dev/null 2>&1; then
14232 echo "$ar appears to generate random libraries itself."
14235 elif $ar ts bar$_a >/dev/null 2>&1 &&
14236 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
14237 ./foobar >/dev/null 2>&1; then
14238 echo "a table of contents needs to be added with '$ar ts'."
14245 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
14246 $test -f $ranlib || ranlib=''
14249 if $test -n "$ranlib"; then
14250 echo "your system has '$ranlib'; we'll use that."
14253 echo "your system doesn't seem to support random libraries"
14254 echo "so we'll use lorder and tsort to order the libraries."
14261 : check for type of arguments to select.
14262 case "$selecttype" in
14263 '') case "$d_select" in
14267 Checking to see what type of arguments are accepted by select().
14269 hdrs="$define sys/types.h
14270 $i_systime sys/time.h
14271 $i_sysselct sys/select.h
14272 $d_socket sys/socket.h"
14273 : The first arg can be int, unsigned, or size_t
14274 : The last arg may or may not be 'const'
14276 : void pointer has been seen but using that
14277 : breaks the selectminbits test
14278 for xxx in 'fd_set *' 'int *'; do
14279 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
14280 for tmo in 'struct timeval *' 'const struct timeval *'; do
14282 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
14283 if ./protochk "$try" $hdrs; then
14284 echo "Your system accepts $xxx."
14293 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
14294 case "$d_fd_set" in
14295 $define) dflt="fd_set *" ;;
14304 *) : no select, so pick a harmless default
14311 : check for the select 'width'
14312 case "$selectminbits" in
14313 '') case "$d_select" in
14317 Checking to see on how many bits at a time your select() operates...
14320 #include <sys/types.h>
14322 #$i_systime I_SYS_TIME
14323 #$i_systimek I_SYS_TIME_KERNEL
14328 # ifdef I_SYS_TIME_KERNEL
14331 # include <sys/time.h>
14332 # ifdef I_SYS_TIME_KERNEL
14336 #$i_sysselct I_SYS_SELECT
14337 #ifdef I_SYS_SELECT
14338 #include <sys/select.h>
14340 #$d_socket HAS_SOCKET
14342 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
14346 #define S sizeof(*(b))
14348 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
14349 #define NBITS (NBYTES * 8)
14358 fp = fopen("try.c", "r");
14364 b = ($selecttype)s;
14365 for (i = 0; i < NBITS; i++)
14369 select(fd + 1, b, 0, 0, &t);
14370 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
14371 printf("%d\n", i + 1);
14376 if eval $compile_ok; then
14377 selectminbits=`./try`
14378 case "$selectminbits" in
14380 Cannot figure out on how many bits at a time your select() operates.
14381 I'll play safe and guess it is 32 bits.
14387 *) bits="$selectminbits bits" ;;
14389 echo "Your select() operates on $bits at a time." >&4
14391 rp='What is the minimum number of bits your select() operates on?'
14392 case "$byteorder" in
14393 1234|12345678) dflt=32 ;;
14398 selectminbits="$val"
14402 *) : no select, so pick a harmless default
14409 : Trace out the files included by signal.h, then look for SIGxxx names.
14410 : Remove SIGARRAYSIZE used by HPUX.
14411 : Remove SIGSTKSIZE used by Linux.
14412 : Remove SIGSTKSZ used by Posix.
14413 : Remove SIGTYP void lines used by OS2.
14414 : Some cpps, like os390, dont give the file name anywhere
14415 if [ "X$fieldn" = X ]; then
14416 : Just make some guesses. We check them later.
14417 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
14419 xxx=`echo '#include <signal.h>' |
14420 $cppstdin $cppminus $cppflags 2>/dev/null |
14421 $grep '^[ ]*#.*include' |
14422 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq`
14424 : Check this list of files to be sure we have parsed the cpp output ok.
14425 : This will also avoid potentially non-existent files, such
14428 for xx in $xxx /dev/null ; do
14429 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
14431 : If we have found no files, at least try signal.h
14432 case "$xxxfiles" in
14433 '') xxxfiles=`./findhdr signal.h` ;;
14436 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
14437 print substr($2, 4, 20)
14439 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
14440 print substr($3, 4, 20)
14442 : Append some common names just in case the awk scan failed.
14443 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
14444 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
14445 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
14446 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
14447 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
14449 : generate a few handy files for later
14450 $cat > signal.c <<'EOCP'
14451 #include <sys/types.h>
14452 #include <signal.h>
14456 /* Strange style to avoid deeply-nested #if/#else/#endif */
14459 # define NSIG (_NSIG)
14465 # define NSIG (SIGMAX+1)
14471 # define NSIG (SIG_MAX+1)
14477 # define NSIG (MAXSIG+1)
14483 # define NSIG (MAX_SIG+1)
14488 # ifdef SIGARRAYSIZE
14489 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
14495 # define NSIG (_sys_nsig) /* Solaris 2.5 */
14499 /* Default to some arbitrary number that's big enough to get most
14500 of the common signals.
14506 printf("NSIG %d\n", NSIG);
14512 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
14514 printf "#ifdef SIG"; printf $1; printf "\n"
14515 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
14516 printf $1; printf ");\n"
14520 printf "#endif /* JUST_NSIG */\n";
14521 printf "exit(0);\n}\n";
14524 $cat >signal.awk <<'EOP'
14525 BEGIN { ndups = 0 }
14526 $1 ~ /^NSIG$/ { nsig = $2 }
14527 ($1 !~ /^NSIG$/) && (NF == 2) {
14528 if ($2 > maxsig) { maxsig = $2 }
14529 if (sig_name[$2]) {
14530 dup_name[ndups] = $1
14531 dup_num[ndups] = $2
14543 printf("NSIG %d\n", nsig);
14544 for (n = 1; n < nsig; n++) {
14546 printf("%s %d\n", sig_name[n], sig_num[n])
14549 printf("NUM%d %d\n", n, n)
14552 for (n = 0; n < ndups; n++) {
14553 printf("%s %d\n", dup_name[n], dup_num[n])
14557 $cat >signal_cmd <<EOS
14559 if $test -s signal.lst; then
14560 echo "Using your existing signal.lst file"
14565 $cat >>signal_cmd <<'EOS'
14568 if eval $compile_ok; then
14569 ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
14571 echo "(I can't seem be able to compile the whole test program)" >&4
14572 echo "(I'll try it in little pieces.)" >&4
14573 set signal -DJUST_NSIG
14574 if eval $compile_ok; then
14575 ./signal$_exe > signal.nsg
14578 echo "I can't seem to figure out how many signals you have." >&4
14579 echo "Guessing 50." >&4
14580 echo 'NSIG 50' > signal.nsg
14582 : Now look at all the signal names, one at a time.
14583 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
14584 $cat > signal.c <<EOCP
14585 #include <sys/types.h>
14586 #include <signal.h>
14589 printf("$xx %d\n", SIG${xx});
14594 if eval $compile; then
14595 echo "SIG${xx} found."
14596 ./signal$_exe >> signal.ls1
14598 echo "SIG${xx} NOT found."
14601 if $test -s signal.ls1; then
14602 $cat signal.nsg signal.ls1 |
14603 $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
14607 if $test -s signal.lst; then
14610 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
14611 echo 'kill -l' >signal
14612 set X `csh -f <signal`
14616 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
14618 echo $@ | $tr ' ' $trnl | \
14619 $awk '{ printf "%s %d\n", $1, ++s; }
14620 END { printf "NSIG %d\n", ++s }' >signal.lst
14622 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
14624 chmod a+x signal_cmd
14625 $eunicefix signal_cmd
14627 : generate list of signal names
14629 case "$sig_name_init" in
14631 *) case "$sig_num_init" in
14632 ''|*,*) doinit=yes ;;
14637 echo "Generating a list of signal names and numbers..." >&4
14639 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
14640 sig_name=`$awk 'BEGIN { printf "ZERO " }
14641 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
14642 sig_num=`$awk 'BEGIN { printf "0 " }
14643 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
14644 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
14645 !/^NSIG/ { printf "\"%s\", ", $1 }
14646 END { printf "0\n" }' signal.lst`
14647 sig_num_init=`$awk 'BEGIN { printf "0, " }
14648 !/^NSIG/ { printf "%d, ", $2}
14649 END { printf "0\n"}' signal.lst`
14652 echo "The following $sig_count signals are available:"
14654 echo $sig_name | $awk \
14655 'BEGIN { linelen = 0 }
14657 for (i = 1; i <= NF; i++) {
14658 name = "SIG" $i " "
14659 linelen = linelen + length(name)
14660 if (linelen > 70) {
14662 linelen = length(name)
14668 sig_size=`echo $sig_name | awk '{print NF}'`
14669 $rm -f signal signal.c signal.awk signal.lst signal_cmd
14672 case "$sizetype" in
14673 *_t) zzz="$sizetype" ;;
14674 *) zzz="filesize" ;;
14676 echo "Checking the size of $zzz..." >&4
14678 #include <sys/types.h>
14681 printf("%d\n", (int)sizeof($sizetype));
14686 if eval $compile_ok; then
14690 echo "(I can't execute the test program--guessing $sizesize.)" >&4
14693 echo "Your $zzz size is $sizesize bytes."
14698 echo "(I can't compile the test program--guessing $sizesize.)" >&4
14702 : check for socklen_t
14704 echo "Checking to see if you have socklen_t..." >&4
14706 #include <sys/types.h>
14707 #$d_socket HAS_SOCKET
14709 #include <sys/socket.h>
14711 int main() { socklen_t x = 16; }
14714 if eval $compile; then
14716 echo "You have socklen_t."
14719 echo "You do not have socklen_t."
14720 case "$sizetype" in
14721 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
14728 : see if this is a socks.h system
14729 set socks.h i_socks
14732 : check for type of the size argument to socket calls
14733 case "$d_socket" in
14737 Checking to see what type is the last argument of accept().
14740 case "$d_socklen_t" in
14741 "$define") yyy="$yyy socklen_t"
14743 yyy="$yyy $sizetype int long unsigned"
14744 for xxx in $yyy; do
14745 case "$socksizetype" in
14746 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
14747 case "$usesocks" in
14749 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
14750 echo "Your system accepts '$xxx *' for the last argument of accept()."
14751 socksizetype="$xxx"
14754 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
14755 echo "Your system accepts '$xxx *' for the last argument of accept()."
14756 socksizetype="$xxx"
14763 : In case none of those worked, prompt the user.
14764 case "$socksizetype" in
14765 '') rp='What is the type for socket address structure sizes?'
14772 *) : no sockets, so pick relatively harmless default
14777 : see what type is used for signed size_t
14778 set ssize_t ssizetype int stdio.h sys/types.h
14781 $cat > ssize.c <<EOM
14783 #include <sys/types.h>
14784 #define Size_t $sizetype
14785 #define SSize_t $dflt
14788 if (sizeof(Size_t) == sizeof(SSize_t))
14790 else if (sizeof(Size_t) == sizeof(int))
14799 if eval $compile_ok && ./ssize > /dev/null; then
14800 ssizetype=`./ssize`
14801 echo "I'll be using $ssizetype for functions returning a byte count." >&4
14804 Help! I can't compile and run the ssize_t test program: please enlighten me!
14805 (This is probably a misconfiguration in your system or libraries, and
14806 you really ought to fix it. Still, I'll try anyway.)
14808 I need a type that is the same size as $sizetype, but is guaranteed to
14809 be signed. Common values are ssize_t, int and long.
14812 rp="What signed type is the same size as $sizetype?"
14816 $rm -f ssize ssize.*
14818 : see what type of char stdio uses.
14820 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
14821 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
14822 echo "Your stdio uses unsigned chars." >&4
14823 stdchar="unsigned char"
14825 echo "Your stdio uses signed chars." >&4
14832 : see if time exists
14834 if test "X$d_time" = X -o X"$timetype" = X; then
14835 if set time val -f d_time; eval $csym; $val; then
14836 echo 'time() found.' >&4
14838 rp="What is the type returned by time() on this system?"
14839 set time_t timetype long stdio.h sys/types.h
14842 echo 'time() not found, hope that will do.' >&4
14850 : see what type uids are declared as in the kernel
14852 echo "Looking for the type for user ids returned by getuid()."
14853 set uid_t uidtype xxx stdio.h sys/types.h
14857 xxx=`./findhdr sys/user.h`
14858 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
14860 unsigned) dflt="$1 $2" ;;
14864 *) dflt="$uidtype";;
14867 uid_t) echo "uid_t found." ;;
14868 *) rp="What is the type for user ids returned by getuid()?"
14876 *_t) zzz="$uidtype" ;;
14879 echo "Checking the size of $zzz..." >&4
14881 #include <sys/types.h>
14884 printf("%d\n", (int)sizeof($uidtype));
14889 if eval $compile_ok; then
14893 echo "(I can't execute the test program--guessing $uidsize.)" >&4
14896 echo "Your $zzz is $uidsize bytes long."
14901 echo "(I can't compile the test program--guessing $uidsize.)" >&4
14906 *_t) zzz="$uidtype" ;;
14909 echo "Checking the sign of $zzz..." >&4
14911 #include <sys/types.h>
14922 if eval $compile; then
14926 echo "(I can't execute the test program--guessing unsigned.)" >&4
14930 1) echo "Your $zzz is unsigned." ;;
14931 -1) echo "Your $zzz is signed." ;;
14937 echo "(I can't compile the test program--guessing unsigned.)" >&4
14943 $echo "Checking the format string to be used for uids..." >&4
14946 -1) if $test X"$uidsize" = X"$ivsize"; then
14947 uidformat="$ivdformat"
14949 if $test X"$uidsize" = X"$longsize"; then
14952 if $test X"$uidsize" = X"$intsize"; then
14955 if $test X"$uidsize" = X"$shortsize"; then
14962 *) if $test X"$uidsize" = X"$uvsize"; then
14963 uidformat="$uvuformat"
14965 if $test X"$uidsize" = X"$longsize"; then
14968 if $test X"$uidsize" = X"$intsize"; then
14971 if $test X"$uidsize" = X"$shortsize"; then
14980 : determine compiler compiler
14989 if $test -f "$byacc"; then
14991 comp="byacc or $comp"
14993 if $test -f "$bison"; then
14994 comp="$comp or bison -y"
14996 rp="Which compiler compiler ($comp) shall I use?"
15005 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
15011 : see if dbm.h is available
15012 : see if dbmclose exists
15013 set dbmclose d_dbmclose
15016 case "$d_dbmclose" in
15026 *) set rpcsvc/dbm.h i_rpcsvcdbm
15031 *) echo "We won't be including <dbm.h>"
15041 : see if this is a sys/file.h system
15046 : do we need to include sys/file.h ?
15050 if $h_sysfile; then
15052 echo "We'll be including <sys/file.h>." >&4
15055 echo "We won't be including <sys/file.h>." >&4
15065 : see if fcntl.h is there
15070 : see if we can include fcntl.h
15076 echo "We'll be including <fcntl.h>." >&4
15079 if $h_sysfile; then
15080 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
15082 echo "We won't be including <fcntl.h>." >&4
15094 : see if this is a iconv.h system
15095 set iconv.h i_iconv
15098 : see if this is a ieeefp.h system
15099 set ieeefp.h i_ieeefp
15102 : see if this is a libutil.h system
15103 set libutil.h i_libutil
15106 : see if locale.h is available
15107 set locale.h i_locale
15110 : see if mach cthreads are available
15111 if test "X$usethreads" = "X$define"; then
15112 set mach/cthreads.h i_machcthr
15115 i_machcthr="$undef"
15120 : see if this is a math.h system
15124 : see if this is a mntent.h system
15125 set mntent.h i_mntent
15128 : see if ndbm.h is available
15133 : see if dbm_open exists
15134 set dbm_open d_dbm_open
15136 case "$d_dbm_open" in
15139 echo "We won't be including <ndbm.h>"
15148 : see if net/errno.h is available
15150 set net/errno.h val
15153 : Unfortunately, it causes problems on some systems. Arrgh.
15156 cat > try.c <<'EOM'
15159 #include <net/errno.h>
15165 if $cc $ccflags -c try.c >/dev/null 2>&1; then
15166 echo "We'll be including <net/errno.h>." >&4
15168 echo "We won't be including <net/errno.h>." >&4
15177 : see if netinet/tcp.h is available
15178 set netinet/tcp.h i_netinettcp
15181 : see if this is a poll.h system
15185 : see if this is a prot.h system
15190 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
15191 $cat <<'EOSH' > Cppsym.know
15192 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
15193 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
15194 alliant alpha am29000 AM29000 AMD64 amiga AMIGAOS AMIX
15195 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
15196 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
15197 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
15198 bull c cadmus clipper CMU COFF COMPILER_VERSION
15199 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
15200 CYGWIN DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
15201 Dynix DynixPTX ELF encore EPI EXTENSIONS FILE_OFFSET_BITS
15202 FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
15203 GNU_SOURCE GNUC GNUC_MINOR GO32 gould GOULD_PN
15204 H3050R H3050RX hbullx20 hcx host_mips
15205 hp200 hp300 hp700 HP700 hp800 hp9000
15206 hp9000s200 hp9000s300 hp9000s400 hp9000s500
15207 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
15208 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
15209 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
15210 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
15211 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
15212 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
15213 Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
15214 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
15215 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
15216 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
15217 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
15218 MATH_HAS_NO_SIDE_EFFECTS
15219 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
15220 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
15221 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
15222 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
15223 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
15224 NetBSD news1500 news1700 news1800 news1900 news3700
15225 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
15226 ns32016 ns32332 ns32k nsc32000
15227 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
15228 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
15229 pc532 pdp11 PGC PIC plexus PORTAR posix
15230 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
15231 POSIX_C_SOURCE POSIX_SOURCE POWER
15232 PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
15233 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
15234 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
15235 sony sony_news sonyrisc sparc sparclite spectrum
15236 stardent stdc STDC_EXT stratos sun sun3 sun386
15237 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
15238 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
15239 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
15240 sysV68 sysV88 Tek4132 Tek4300 titan
15241 TM3200 TM5400 TM5600
15242 tower tower32 tower32_200 tower32_600 tower32_700
15243 tower32_800 tower32_850 tss
15244 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
15245 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
15246 unix UNIX95 UNIX99 unixpc unos USGr4 USGr4_2
15247 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms xenix Xenix286
15248 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
15249 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
15252 # Maybe put other stuff here too.
15253 cat <<EOSH >>Cppsym.know
15256 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
15257 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
15258 $cat Cppsym.know > Cppsym.c
15259 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
15260 $rm -f Cppsym.a Cppsym.b Cppsym.c
15261 cat <<EOSH > Cppsym
15263 if $test \$# -gt 0; then
15264 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
15265 if $test -s Cppsym.got; then
15272 $tr " " "$trnl" | ./Cppsym.try
15278 cat <<EOSH > Cppsym.try
15280 cat <<'EOCP' > try.c
15286 cat <<'EOSH' >> Cppsym.try
15288 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
15289 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
15290 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
15291 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
15295 cat <<EOSH >> Cppsym.try
15297 case "$osname-$gccversion" in
15298 irix-) ccflags="\$ccflags -woff 1178" ;;
15299 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
15301 $cc -o try $optimize \$ccflags $ldflags try.c $libs && ./try$exe_ext
15303 chmod +x Cppsym.try
15304 $eunicefix Cppsym.try
15305 ./Cppsym < Cppsym.know > Cppsym.true
15306 : now check the C compiler for additional symbols
15307 postprocess_cc_v=''
15309 aix) postprocess_cc_v="|$tr , ' '" ;;
15316 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
15319 -D*) echo "\$i" | $sed 's/^-D//';;
15320 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
15325 postprocess_cc_v=''
15328 ./ccsym > ccsym1.raw
15329 if $test -s ccsym1.raw; then
15330 $sort ccsym1.raw | $uniq >ccsym.raw
15332 mv ccsym1.raw ccsym.raw
15335 $awk '/\=/ { print $0; next }
15336 { print $0"=1" }' ccsym.raw >ccsym.list
15337 $awk '/\=/ { print $0; next }
15338 { print $0"=1" }' Cppsym.true >ccsym.true
15339 $comm -13 ccsym.true ccsym.list >ccsym.own
15340 $comm -12 ccsym.true ccsym.list >ccsym.com
15341 $comm -23 ccsym.true ccsym.list >ccsym.cpp
15343 if $test -z ccsym.raw; then
15344 echo "Your C compiler doesn't seem to define any symbols!" >&4
15346 echo "However, your C preprocessor defines the following symbols:"
15349 cppsymbols=`$cat Cppsym.true`
15350 cppsymbols=`echo $cppsymbols`
15351 cppccsymbols="$cppsymbols"
15353 if $test -s ccsym.com; then
15354 echo "Your C compiler and pre-processor define these symbols:"
15355 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
15358 cppccsymbols=`$cat ccsym.com`
15359 cppccsymbols=`echo $cppccsymbols`
15360 $test "$silent" || sleep 1
15362 if $test -s ccsym.cpp; then
15363 $test "$also" && echo " "
15364 echo "Your C pre-processor ${also}defines the following symbols:"
15365 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
15367 cppsymbols=`$cat ccsym.cpp`
15368 cppsymbols=`echo $cppsymbols`
15369 $test "$silent" || sleep 1
15371 if $test -s ccsym.own; then
15372 $test "$also" && echo " "
15373 echo "Your C compiler ${also}defines the following cpp symbols:"
15374 $sed -e 's/\(..*\)=1/\1/' ccsym.own
15375 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
15376 ccsymbols=`$cat ccsym.own`
15377 ccsymbols=`echo $ccsymbols`
15378 $test "$silent" || sleep 1
15381 $rm -f ccsym* Cppsym.*
15383 : see if this is a termio system
15387 if $test `./findhdr termios.h`; then
15388 set tcsetattr i_termios
15394 "$define") echo "You have POSIX termios.h... good!" >&4;;
15395 *) if ./Cppsym pyr; then
15396 case "`/bin/universe`" in
15397 ucb) if $test `./findhdr sgtty.h`; then
15399 echo "<sgtty.h> found." >&4
15401 echo "System is pyramid with BSD universe."
15402 echo "<sgtty.h> not found--you could have problems." >&4
15404 *) if $test `./findhdr termio.h`; then
15406 echo "<termio.h> found." >&4
15408 echo "System is pyramid with USG universe."
15409 echo "<termio.h> not found--you could have problems." >&4
15413 if $test `./findhdr termio.h`; then
15414 echo "<termio.h> found." >&4
15416 elif $test `./findhdr sgtty.h`; then
15417 echo "<sgtty.h> found." >&4
15420 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
15423 if $test `./findhdr sgtty.h`; then
15424 echo "<sgtty.h> found." >&4
15426 elif $test `./findhdr termio.h`; then
15427 echo "<termio.h> found." >&4
15430 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
15434 set i_termio; eval $setvar
15435 val=$val2; set i_sgtty; eval $setvar
15436 val=$val3; set i_termios; eval $setvar
15438 : see if this is a shadow.h system
15439 set shadow.h i_shadow
15442 : see if stddef is available
15443 set stddef.h i_stddef
15446 : see if this is a sunmath.h system
15447 set sunmath.h i_sunmath
15450 : see if sys/access.h is available
15451 set sys/access.h i_sysaccess
15454 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
15455 set sys/filio.h i_sysfilio
15458 if $test `./findhdr sys/ioctl.h`; then
15460 echo '<sys/ioctl.h> found.' >&4
15463 if $test $i_sysfilio = "$define"; then
15464 echo '<sys/ioctl.h> NOT found.' >&4
15466 $test $i_sgtty = "$define" && xxx="sgtty.h"
15467 $test $i_termio = "$define" && xxx="termio.h"
15468 $test $i_termios = "$define" && xxx="termios.h"
15469 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
15475 : see if socket ioctl defs are in sys/sockio.h
15477 xxx=`./findhdr sys/sockio.h`
15478 if $test "$xxx"; then
15479 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
15481 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
15484 echo "No socket ioctls found in <sys/sockio.h>." >&4
15489 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
15496 : see if this is a syslog.h system
15497 set syslog.h i_syslog
15501 : see if this is a sys/mode.h system
15502 set sys/mode.h i_sysmode
15505 : see if sys/resource.h has to be included
15506 set sys/resource.h i_sysresrc
15509 : see if sys/security.h is available
15510 set sys/security.h i_syssecrt
15513 : see if this is a sys/statvfs.h system
15514 set sys/statvfs.h i_sysstatvfs
15517 : see if this is a sys/uio.h system
15518 set sys/uio.h i_sysuio
15521 : see if this is a sys/un.h system
15522 set sys/un.h i_sysun
15526 : see if this is a sys/utsname.h system
15527 set sys/utsname.h i_sysutsname
15530 : see if this is a syswait system
15531 set sys/wait.h i_syswait
15534 : see if this is a ustat.h system
15535 set ustat.h i_ustat
15538 : see if this is an utime system
15539 set utime.h i_utime
15542 : see if this is a values.h system
15543 set values.h i_values
15546 : see if this is a vfork system
15549 set vfork.h i_vfork
15557 : see if gdbm.h is available
15562 : see if gdbm_open exists
15563 set gdbm_open d_gdbm_open
15565 case "$d_gdbm_open" in
15568 echo "We won't be including <gdbm.h>"
15578 echo "Looking for extensions..." >&4
15579 : If we are using the old config.sh, known_extensions may contain
15580 : old or inaccurate or duplicate values.
15581 known_extensions=''
15582 nonxs_extensions=''
15583 : We do not use find because it might not be available.
15584 : We do not just use MANIFEST because the user may have dropped
15585 : some additional extensions into the source tree and expect them
15588 : Function to recursively find available extensions, ignoring DynaLoader
15589 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
15593 DynaLoader|dynaload) ;;
15595 if $test -f $xxx/$xxx.xs; then
15596 known_extensions="$known_extensions $1$xxx";
15597 elif $test -f $xxx/Makefile.PL; then
15598 nonxs_extensions="$nonxs_extensions $1$xxx";
15600 if $test -d $xxx -a $# -lt 10; then
15603 eval $find_extensions;
15615 eval $find_extensions
15616 set X $nonxs_extensions
15618 nonxs_extensions="$*"
15619 set X $known_extensions
15621 known_extensions="$*"
15624 : Now see which are supported on this system.
15626 for xxx in $known_extensions ; do
15630 $define) avail_ext="$avail_ext $xxx" ;;
15633 GDBM_File|gdbm_fil)
15635 $define) avail_ext="$avail_ext $xxx" ;;
15638 NDBM_File|ndbm_fil)
15641 case "$osname-$use64bitint" in
15644 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
15647 *) avail_ext="$avail_ext $xxx" ;;
15652 ODBM_File|odbm_fil)
15653 case "${i_dbm}${i_rpcsvcdbm}" in
15655 case "$osname-$use64bitint" in
15658 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
15661 *) avail_ext="$avail_ext $xxx" ;;
15667 case "$useposix" in
15668 true|define|y) avail_ext="$avail_ext $xxx" ;;
15672 case "$useopcode" in
15673 true|define|y) avail_ext="$avail_ext $xxx" ;;
15677 case "$d_socket" in
15678 true|$define|y) avail_ext="$avail_ext $xxx" ;;
15681 Sys/Syslog|sys/syslog)
15682 : XXX syslog requires socket
15683 case "$d_socket" in
15684 true|$define|y) avail_ext="$avail_ext $xxx" ;;
15688 case "$usethreads" in
15689 true|$define|y) avail_ext="$avail_ext $xxx" ;;
15693 : XXX Do we need a useipcsysv variable here
15694 case "${d_msg}${d_sem}${d_shm}" in
15695 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
15698 *) avail_ext="$avail_ext $xxx"
15707 : Now see which nonxs extensions are supported on this system.
15708 : For now assume all are.
15710 for xxx in $nonxs_extensions ; do
15712 *) nonxs_ext="$nonxs_ext $xxx"
15724 A number of extensions are supplied with $package. You may choose to
15725 compile these extensions for dynamic loading (the default), compile
15726 them into the $package executable (static loading), or not include
15727 them at all. Answer "none" to include no extensions.
15728 Note that DynaLoader is always built and need not be mentioned here.
15731 case "$dynamic_ext" in
15732 '') dflt="$avail_ext" ;;
15733 *) dflt="$dynamic_ext"
15734 # Perhaps we are reusing an old out-of-date config.sh.
15737 if test X"$dynamic_ext" != X"$avail_ext"; then
15739 NOTICE: Your previous config.sh list may be incorrect.
15740 The extensions now available to you are
15742 but the default list from your previous config.sh is
15754 rp="What extensions do you wish to load dynamically?"
15757 none) dynamic_ext=' ' ;;
15758 *) dynamic_ext="$ans" ;;
15761 case "$static_ext" in
15763 : Exclude those already listed in dynamic linking
15765 for xxx in $avail_ext; do
15766 case " $dynamic_ext " in
15768 *) dflt="$dflt $xxx" ;;
15775 *) dflt="$static_ext"
15782 rp="What extensions do you wish to load statically?"
15785 none) static_ext=' ' ;;
15786 *) static_ext="$ans" ;;
15791 A number of extensions are supplied with $package. Answer "none"
15792 to include no extensions.
15793 Note that DynaLoader is always built and need not be mentioned here.
15796 case "$static_ext" in
15797 '') dflt="$avail_ext" ;;
15798 *) dflt="$static_ext"
15799 # Perhaps we are reusing an old out-of-date config.sh.
15802 if test X"$static_ext" != X"$avail_ext"; then
15804 NOTICE: Your previous config.sh list may be incorrect.
15805 The extensions now available to you are
15807 but the default list from your previous config.sh is
15816 : Exclude those that are not xs extensions
15820 rp="What extensions do you wish to include?"
15823 none) static_ext=' ' ;;
15824 *) static_ext="$ans" ;;
15829 set X $dynamic_ext $static_ext $nonxs_ext
15833 : Remove libraries needed only for extensions
15834 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
15835 : The exception is SunOS 4.x, which needs them.
15836 case "${osname}X${osvers}" in
15840 *) case "$usedl" in
15841 $define|true|[yY]*)
15842 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
15846 *) perllibs="$libs"
15852 : Remove build directory name from cppstdin so it can be used from
15853 : either the present location or the final installed location.
15855 : Get out of the UU directory to get correct path name.
15857 case "$cppstdin" in
15859 echo "Stripping down cppstdin path name"
15865 : end of configuration questions
15867 echo "End of configuration questions."
15870 : back to where it started
15871 if test -d ../UU; then
15875 : configuration may be patched via a 'config.over' file
15876 if $test -f config.over; then
15879 rp='I see a config.over file. Do you wish to load it?'
15882 n*) echo "OK, I'll ignore it.";;
15884 echo "Configuration override changes have been loaded."
15889 : in case they want portability, strip down executable paths
15890 case "$d_portable" in
15893 echo "Stripping down executable paths..." >&4
15894 for file in $loclist $trylist; do
15896 eval $file=`basename $temp`
15901 : create config.sh file
15903 echo "Creating config.sh..." >&4
15904 $spitshell <<EOT >config.sh
15907 # This file was produced by running the Configure script. It holds all the
15908 # definitions figured out by Configure. Should you modify one of these values,
15909 # do not forget to propagate your changes by running "Configure -der". You may
15910 # instead choose to run each of the .SH files by yourself, or "Configure -S".
15913 # Package name : $package
15914 # Source directory : $src
15915 # Configuration time: $cf_time
15916 # Configured by : $cf_by
15917 # Target system : $myuname
15927 Revision='$Revision'
15934 alignbytes='$alignbytes'
15935 ansi2knr='$ansi2knr'
15936 aphostname='$aphostname'
15937 api_revision='$api_revision'
15938 api_subversion='$api_subversion'
15939 api_version='$api_version'
15940 api_versionstring='$api_versionstring'
15943 archlibexp='$archlibexp'
15944 archname64='$archname64'
15945 archname='$archname'
15946 archobjs='$archobjs'
15951 bincompat5005='$bincompat5005'
15955 byteorder='$byteorder'
15957 castflags='$castflags'
15960 cccdlflags='$cccdlflags'
15961 ccdlflags='$ccdlflags'
15963 ccflags_uselargefiles='$ccflags_uselargefiles'
15965 ccsymbols='$ccsymbols'
15966 ccversion='$ccversion'
15968 cf_email='$cf_email'
15970 charsize='$charsize'
15974 clocktype='$clocktype'
15976 compress='$compress'
15977 contains='$contains'
15981 cpp_stuff='$cpp_stuff'
15982 cppccsymbols='$cppccsymbols'
15983 cppflags='$cppflags'
15985 cppminus='$cppminus'
15987 cppstdin='$cppstdin'
15988 cppsymbols='$cppsymbols'
15989 crosscompile='$crosscompile'
15990 cryptlib='$cryptlib'
15992 d_Gconvert='$d_Gconvert'
15993 d_PRIEUldbl='$d_PRIEUldbl'
15994 d_PRIFUldbl='$d_PRIFUldbl'
15995 d_PRIGUldbl='$d_PRIGUldbl'
15996 d_PRIXU64='$d_PRIXU64'
15997 d_PRId64='$d_PRId64'
15998 d_PRIeldbl='$d_PRIeldbl'
15999 d_PRIfldbl='$d_PRIfldbl'
16000 d_PRIgldbl='$d_PRIgldbl'
16001 d_PRIi64='$d_PRIi64'
16002 d_PRIo64='$d_PRIo64'
16003 d_PRIu64='$d_PRIu64'
16004 d_PRIx64='$d_PRIx64'
16005 d_SCNfldbl='$d_SCNfldbl'
16006 d__fwalk='$d__fwalk'
16007 d_access='$d_access'
16008 d_accessx='$d_accessx'
16010 d_archlib='$d_archlib'
16013 d_attribut='$d_attribut'
16016 d_bincompat5005='$d_bincompat5005'
16018 d_bsdgetpgrp='$d_bsdgetpgrp'
16019 d_bsdsetpgrp='$d_bsdsetpgrp'
16021 d_casti32='$d_casti32'
16022 d_castneg='$d_castneg'
16023 d_charvspr='$d_charvspr'
16025 d_chroot='$d_chroot'
16026 d_chsize='$d_chsize'
16027 d_closedir='$d_closedir'
16031 d_cuserid='$d_cuserid'
16032 d_dbl_dig='$d_dbl_dig'
16033 d_difftime='$d_difftime'
16034 d_dirnamlen='$d_dirnamlen'
16035 d_dlerror='$d_dlerror'
16036 d_dlopen='$d_dlopen'
16037 d_dlsymun='$d_dlsymun'
16038 d_dosuid='$d_dosuid'
16039 d_drand48proto='$d_drand48proto'
16041 d_eaccess='$d_eaccess'
16042 d_endgrent='$d_endgrent'
16043 d_endhent='$d_endhent'
16044 d_endnent='$d_endnent'
16045 d_endpent='$d_endpent'
16046 d_endpwent='$d_endpwent'
16047 d_endsent='$d_endsent'
16048 d_eofnblk='$d_eofnblk'
16049 d_eunice='$d_eunice'
16050 d_fchmod='$d_fchmod'
16051 d_fchown='$d_fchown'
16053 d_fcntl_can_lock='$d_fcntl_can_lock'
16054 d_fd_macros='$d_fd_macros'
16055 d_fd_set='$d_fd_set'
16056 d_fds_bits='$d_fds_bits'
16057 d_fgetpos='$d_fgetpos'
16058 d_flexfnam='$d_flexfnam'
16061 d_fpathconf='$d_fpathconf'
16062 d_fpos64_t='$d_fpos64_t'
16063 d_frexpl='$d_frexpl'
16064 d_fs_data_s='$d_fs_data_s'
16065 d_fseeko='$d_fseeko'
16066 d_fsetpos='$d_fsetpos'
16067 d_fstatfs='$d_fstatfs'
16068 d_fstatvfs='$d_fstatvfs'
16070 d_ftello='$d_ftello'
16072 d_getcwd='$d_getcwd'
16073 d_getespwnam='$d_getespwnam'
16074 d_getfsstat='$d_getfsstat'
16075 d_getgrent='$d_getgrent'
16076 d_getgrps='$d_getgrps'
16077 d_gethbyaddr='$d_gethbyaddr'
16078 d_gethbyname='$d_gethbyname'
16079 d_gethent='$d_gethent'
16080 d_gethname='$d_gethname'
16081 d_gethostprotos='$d_gethostprotos'
16082 d_getlogin='$d_getlogin'
16083 d_getmnt='$d_getmnt'
16084 d_getmntent='$d_getmntent'
16085 d_getnbyaddr='$d_getnbyaddr'
16086 d_getnbyname='$d_getnbyname'
16087 d_getnent='$d_getnent'
16088 d_getnetprotos='$d_getnetprotos'
16089 d_getpagsz='$d_getpagsz'
16090 d_getpbyname='$d_getpbyname'
16091 d_getpbynumber='$d_getpbynumber'
16092 d_getpent='$d_getpent'
16093 d_getpgid='$d_getpgid'
16094 d_getpgrp2='$d_getpgrp2'
16095 d_getpgrp='$d_getpgrp'
16096 d_getppid='$d_getppid'
16097 d_getprior='$d_getprior'
16098 d_getprotoprotos='$d_getprotoprotos'
16099 d_getprpwnam='$d_getprpwnam'
16100 d_getpwent='$d_getpwent'
16101 d_getsbyname='$d_getsbyname'
16102 d_getsbyport='$d_getsbyport'
16103 d_getsent='$d_getsent'
16104 d_getservprotos='$d_getservprotos'
16105 d_getspnam='$d_getspnam'
16106 d_gettimeod='$d_gettimeod'
16107 d_gnulibc='$d_gnulibc'
16108 d_grpasswd='$d_grpasswd'
16109 d_hasmntopt='$d_hasmntopt'
16113 d_inetaton='$d_inetaton'
16114 d_int64_t='$d_int64_t'
16115 d_isascii='$d_isascii'
16117 d_isnanl='$d_isnanl'
16118 d_killpg='$d_killpg'
16119 d_lchown='$d_lchown'
16120 d_ldbl_dig='$d_ldbl_dig'
16122 d_locconv='$d_locconv'
16124 d_longdbl='$d_longdbl'
16125 d_longlong='$d_longlong'
16126 d_lseekproto='$d_lseekproto'
16128 d_madvise='$d_madvise'
16130 d_mbstowcs='$d_mbstowcs'
16131 d_mbtowc='$d_mbtowc'
16132 d_memchr='$d_memchr'
16133 d_memcmp='$d_memcmp'
16134 d_memcpy='$d_memcpy'
16135 d_memmove='$d_memmove'
16136 d_memset='$d_memset'
16138 d_mkdtemp='$d_mkdtemp'
16139 d_mkfifo='$d_mkfifo'
16140 d_mkstemp='$d_mkstemp'
16141 d_mkstemps='$d_mkstemps'
16142 d_mktime='$d_mktime'
16145 d_mprotect='$d_mprotect'
16147 d_msg_ctrunc='$d_msg_ctrunc'
16148 d_msg_dontroute='$d_msg_dontroute'
16149 d_msg_oob='$d_msg_oob'
16150 d_msg_peek='$d_msg_peek'
16151 d_msg_proxy='$d_msg_proxy'
16152 d_msgctl='$d_msgctl'
16153 d_msgget='$d_msgget'
16154 d_msgrcv='$d_msgrcv'
16155 d_msgsnd='$d_msgsnd'
16157 d_munmap='$d_munmap'
16158 d_mymalloc='$d_mymalloc'
16160 d_nv_preserves_uv='$d_nv_preserves_uv'
16161 d_nv_preserves_uv_bits='$d_nv_preserves_uv_bits'
16162 d_off64_t='$d_off64_t'
16163 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
16164 d_oldpthreads='$d_oldpthreads'
16165 d_oldsock='$d_oldsock'
16167 d_pathconf='$d_pathconf'
16169 d_perl_otherlibdirs='$d_perl_otherlibdirs'
16170 d_phostname='$d_phostname'
16173 d_portable='$d_portable'
16174 d_pthread_yield='$d_pthread_yield'
16176 d_pwchange='$d_pwchange'
16177 d_pwclass='$d_pwclass'
16178 d_pwcomment='$d_pwcomment'
16179 d_pwexpire='$d_pwexpire'
16180 d_pwgecos='$d_pwgecos'
16181 d_pwpasswd='$d_pwpasswd'
16182 d_pwquota='$d_pwquota'
16185 d_readdir='$d_readdir'
16186 d_readlink='$d_readlink'
16187 d_rename='$d_rename'
16188 d_rewinddir='$d_rewinddir'
16190 d_safebcpy='$d_safebcpy'
16191 d_safemcpy='$d_safemcpy'
16192 d_sanemcmp='$d_sanemcmp'
16193 d_sbrkproto='$d_sbrkproto'
16194 d_sched_yield='$d_sched_yield'
16195 d_scm_rights='$d_scm_rights'
16196 d_seekdir='$d_seekdir'
16197 d_select='$d_select'
16199 d_semctl='$d_semctl'
16200 d_semctl_semid_ds='$d_semctl_semid_ds'
16201 d_semctl_semun='$d_semctl_semun'
16202 d_semget='$d_semget'
16204 d_setegid='$d_setegid'
16205 d_seteuid='$d_seteuid'
16206 d_setgrent='$d_setgrent'
16207 d_setgrps='$d_setgrps'
16208 d_sethent='$d_sethent'
16209 d_setlinebuf='$d_setlinebuf'
16210 d_setlocale='$d_setlocale'
16211 d_setnent='$d_setnent'
16212 d_setpent='$d_setpent'
16213 d_setpgid='$d_setpgid'
16214 d_setpgrp2='$d_setpgrp2'
16215 d_setpgrp='$d_setpgrp'
16216 d_setprior='$d_setprior'
16217 d_setproctitle='$d_setproctitle'
16218 d_setpwent='$d_setpwent'
16219 d_setregid='$d_setregid'
16220 d_setresgid='$d_setresgid'
16221 d_setresuid='$d_setresuid'
16222 d_setreuid='$d_setreuid'
16223 d_setrgid='$d_setrgid'
16224 d_setruid='$d_setruid'
16225 d_setsent='$d_setsent'
16226 d_setsid='$d_setsid'
16227 d_setvbuf='$d_setvbuf'
16231 d_shmatprototype='$d_shmatprototype'
16232 d_shmctl='$d_shmctl'
16234 d_shmget='$d_shmget'
16235 d_sigaction='$d_sigaction'
16236 d_sigprocmask='$d_sigprocmask'
16237 d_sigsetjmp='$d_sigsetjmp'
16238 d_sockatmark='$d_sockatmark'
16239 d_socket='$d_socket'
16240 d_socklen_t='$d_socklen_t'
16241 d_sockpair='$d_sockpair'
16242 d_socks5_init='$d_socks5_init'
16244 d_statblks='$d_statblks'
16245 d_statfs_f_flags='$d_statfs_f_flags'
16246 d_statfs_s='$d_statfs_s'
16247 d_statvfs='$d_statvfs'
16248 d_stdio_cnt_lval='$d_stdio_cnt_lval'
16249 d_stdio_ptr_lval='$d_stdio_ptr_lval'
16250 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
16251 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
16252 d_stdio_stream_array='$d_stdio_stream_array'
16253 d_stdiobase='$d_stdiobase'
16254 d_stdstdio='$d_stdstdio'
16255 d_strchr='$d_strchr'
16256 d_strcoll='$d_strcoll'
16257 d_strctcpy='$d_strctcpy'
16258 d_strerrm='$d_strerrm'
16259 d_strerror='$d_strerror'
16260 d_strtod='$d_strtod'
16261 d_strtol='$d_strtol'
16262 d_strtold='$d_strtold'
16263 d_strtoll='$d_strtoll'
16264 d_strtoq='$d_strtoq'
16265 d_strtoul='$d_strtoul'
16266 d_strtoull='$d_strtoull'
16267 d_strtouq='$d_strtouq'
16268 d_strxfrm='$d_strxfrm'
16269 d_suidsafe='$d_suidsafe'
16270 d_symlink='$d_symlink'
16271 d_syscall='$d_syscall'
16272 d_sysconf='$d_sysconf'
16273 d_sysernlst='$d_sysernlst'
16274 d_syserrlst='$d_syserrlst'
16275 d_system='$d_system'
16276 d_tcgetpgrp='$d_tcgetpgrp'
16277 d_tcsetpgrp='$d_tcsetpgrp'
16278 d_telldir='$d_telldir'
16279 d_telldirproto='$d_telldirproto'
16282 d_truncate='$d_truncate'
16283 d_tzname='$d_tzname'
16286 d_union_semun='$d_union_semun'
16288 d_vendorarch='$d_vendorarch'
16289 d_vendorbin='$d_vendorbin'
16290 d_vendorlib='$d_vendorlib'
16292 d_void_closedir='$d_void_closedir'
16293 d_voidsig='$d_voidsig'
16294 d_voidtty='$d_voidtty'
16295 d_volatile='$d_volatile'
16296 d_vprintf='$d_vprintf'
16298 d_waitpid='$d_waitpid'
16299 d_wcstombs='$d_wcstombs'
16300 d_wctomb='$d_wctomb'
16303 db_hashtype='$db_hashtype'
16304 db_prefixtype='$db_prefixtype'
16305 defvoidused='$defvoidused'
16306 direntrytype='$direntrytype'
16309 doublesize='$doublesize'
16311 dynamic_ext='$dynamic_ext'
16317 eunicefix='$eunicefix'
16320 extensions='$extensions'
16321 fflushNULL='$fflushNULL'
16322 fflushall='$fflushall'
16324 firstmakefile='$firstmakefile'
16326 fpossize='$fpossize'
16327 fpostype='$fpostype'
16328 freetype='$freetype'
16330 full_csh='$full_csh'
16331 full_sed='$full_sed'
16332 gccosandvers='$gccosandvers'
16333 gccversion='$gccversion'
16334 gidformat='$gidformat'
16340 groupcat='$groupcat'
16341 groupstype='$groupstype'
16344 h_sysfile='$h_sysfile'
16355 i_arpainet='$i_arpainet'
16356 i_bsdioctl='$i_bsdioctl'
16359 i_dirent='$i_dirent'
16367 i_ieeefp='$i_ieeefp'
16368 i_inttypes='$i_inttypes'
16369 i_libutil='$i_libutil'
16370 i_limits='$i_limits'
16371 i_locale='$i_locale'
16372 i_machcthr='$i_machcthr'
16373 i_malloc='$i_malloc'
16375 i_memory='$i_memory'
16376 i_mntent='$i_mntent'
16379 i_neterrno='$i_neterrno'
16380 i_netinettcp='$i_netinettcp'
16384 i_pthread='$i_pthread'
16386 i_rpcsvcdbm='$i_rpcsvcdbm'
16389 i_shadow='$i_shadow'
16391 i_stdarg='$i_stdarg'
16392 i_stddef='$i_stddef'
16393 i_stdlib='$i_stdlib'
16394 i_string='$i_string'
16395 i_sunmath='$i_sunmath'
16396 i_sysaccess='$i_sysaccess'
16397 i_sysdir='$i_sysdir'
16398 i_sysfile='$i_sysfile'
16399 i_sysfilio='$i_sysfilio'
16401 i_sysioctl='$i_sysioctl'
16402 i_syslog='$i_syslog'
16403 i_sysmman='$i_sysmman'
16404 i_sysmode='$i_sysmode'
16405 i_sysmount='$i_sysmount'
16406 i_sysndir='$i_sysndir'
16407 i_sysparam='$i_sysparam'
16408 i_sysresrc='$i_sysresrc'
16409 i_syssecrt='$i_syssecrt'
16410 i_sysselct='$i_sysselct'
16411 i_syssockio='$i_syssockio'
16412 i_sysstat='$i_sysstat'
16413 i_sysstatfs='$i_sysstatfs'
16414 i_sysstatvfs='$i_sysstatvfs'
16415 i_systime='$i_systime'
16416 i_systimek='$i_systimek'
16417 i_systimes='$i_systimes'
16418 i_systypes='$i_systypes'
16419 i_sysuio='$i_sysuio'
16421 i_sysutsname='$i_sysutsname'
16422 i_sysvfs='$i_sysvfs'
16423 i_syswait='$i_syswait'
16424 i_termio='$i_termio'
16425 i_termios='$i_termios'
16427 i_unistd='$i_unistd'
16430 i_values='$i_values'
16431 i_varargs='$i_varargs'
16432 i_varhdr='$i_varhdr'
16434 ignore_versioned_solibs='$ignore_versioned_solibs'
16435 inc_version_list='$inc_version_list'
16436 inc_version_list_init='$inc_version_list_init'
16439 installarchlib='$installarchlib'
16440 installbin='$installbin'
16441 installman1dir='$installman1dir'
16442 installman3dir='$installman3dir'
16443 installprefix='$installprefix'
16444 installprefixexp='$installprefixexp'
16445 installprivlib='$installprivlib'
16446 installscript='$installscript'
16447 installsitearch='$installsitearch'
16448 installsitebin='$installsitebin'
16449 installsitelib='$installsitelib'
16450 installstyle='$installstyle'
16451 installusrbinperl='$installusrbinperl'
16452 installvendorarch='$installvendorarch'
16453 installvendorbin='$installvendorbin'
16454 installvendorlib='$installvendorlib'
16456 issymlink='$issymlink'
16457 ivdformat='$ivdformat'
16460 known_extensions='$known_extensions'
16463 lddlflags='$lddlflags'
16465 ldflags_uselargefiles='$ldflags_uselargefiles'
16466 ldlibpthname='$ldlibpthname'
16473 libsdirs='$libsdirs'
16474 libsfiles='$libsfiles'
16475 libsfound='$libsfound'
16476 libspath='$libspath'
16477 libswanted='$libswanted'
16478 libswanted_uselargefiles='$libswanted_uselargefiles'
16484 locincpth='$locincpth'
16485 loclibpth='$loclibpth'
16486 longdblsize='$longdblsize'
16487 longlongsize='$longlongsize'
16488 longsize='$longsize'
16492 lseeksize='$lseeksize'
16493 lseektype='$lseektype'
16497 make_set_make='$make_set_make'
16498 mallocobj='$mallocobj'
16499 mallocsrc='$mallocsrc'
16500 malloctype='$malloctype'
16502 man1direxp='$man1direxp'
16505 man3direxp='$man3direxp'
16507 mips_type='$mips_type'
16509 mmaptype='$mmaptype'
16510 modetype='$modetype'
16512 multiarch='$multiarch'
16514 myarchname='$myarchname'
16515 mydomain='$mydomain'
16516 myhostname='$myhostname'
16519 need_va_copy='$need_va_copy'
16520 netdb_hlen_type='$netdb_hlen_type'
16521 netdb_host_type='$netdb_host_type'
16522 netdb_name_type='$netdb_name_type'
16523 netdb_net_type='$netdb_net_type'
16526 nm_so_opt='$nm_so_opt'
16527 nonxs_ext='$nonxs_ext'
16529 nvEUformat='$nvEUformat'
16530 nvFUformat='$nvFUformat'
16531 nvGUformat='$nvGUformat'
16532 nveformat='$nveformat'
16533 nvfformat='$nvfformat'
16534 nvgformat='$nvgformat'
16537 o_nonblock='$o_nonblock'
16539 old_pthread_create_joinable='$old_pthread_create_joinable'
16540 optimize='$optimize'
16541 orderlib='$orderlib'
16544 otherlibdirs='$otherlibdirs'
16548 patchlevel='$patchlevel'
16549 path_sep='$path_sep'
16552 perladmin='$perladmin'
16553 perllibs='$perllibs'
16554 perlpath='$perlpath'
16556 phostname='$phostname'
16559 pm_apiversion='$pm_apiversion'
16563 prefixexp='$prefixexp'
16565 privlibexp='$privlibexp'
16566 prototype='$prototype'
16568 quadkind='$quadkind'
16569 quadtype='$quadtype'
16570 randbits='$randbits'
16571 randfunc='$randfunc'
16572 randseedtype='$randseedtype'
16574 rd_nodata='$rd_nodata'
16575 revision='$revision'
16579 sPRIEUldbl='$sPRIEUldbl'
16580 sPRIFUldbl='$sPRIFUldbl'
16581 sPRIGUldbl='$sPRIGUldbl'
16582 sPRIXU64='$sPRIXU64'
16584 sPRIeldbl='$sPRIeldbl'
16585 sPRIfldbl='$sPRIfldbl'
16586 sPRIgldbl='$sPRIgldbl'
16591 sSCNfldbl='$sSCNfldbl'
16592 sched_yield='$sched_yield'
16593 scriptdir='$scriptdir'
16594 scriptdirexp='$scriptdirexp'
16596 seedfunc='$seedfunc'
16597 selectminbits='$selectminbits'
16598 selecttype='$selecttype'
16599 sendmail='$sendmail'
16602 sharpbang='$sharpbang'
16603 shmattype='$shmattype'
16604 shortsize='$shortsize'
16607 sig_count='$sig_count'
16608 sig_name='$sig_name'
16609 sig_name_init='$sig_name_init'
16611 sig_num_init='$sig_num_init'
16612 sig_size='$sig_size'
16613 signal_t='$signal_t'
16614 sitearch='$sitearch'
16615 sitearchexp='$sitearchexp'
16617 sitebinexp='$sitebinexp'
16619 sitelib_stem='$sitelib_stem'
16620 sitelibexp='$sitelibexp'
16621 siteprefix='$siteprefix'
16622 siteprefixexp='$siteprefixexp'
16623 sizesize='$sizesize'
16624 sizetype='$sizetype'
16628 sockethdr='$sockethdr'
16629 socketlib='$socketlib'
16630 socksizetype='$socksizetype'
16632 spackage='$spackage'
16633 spitshell='$spitshell'
16635 ssizetype='$ssizetype'
16636 startperl='$startperl'
16638 static_ext='$static_ext'
16640 stdio_base='$stdio_base'
16641 stdio_bufsiz='$stdio_bufsiz'
16642 stdio_cnt='$stdio_cnt'
16643 stdio_filbuf='$stdio_filbuf'
16644 stdio_ptr='$stdio_ptr'
16645 stdio_stream_array='$stdio_stream_array'
16648 subversion='$subversion'
16655 timeincl='$timeincl'
16656 timetype='$timetype'
16669 uidformat='$uidformat'
16675 uquadtype='$uquadtype'
16676 use5005threads='$use5005threads'
16677 use64bitall='$use64bitall'
16678 use64bitint='$use64bitint'
16680 useithreads='$useithreads'
16681 uselargefiles='$uselargefiles'
16682 uselongdouble='$uselongdouble'
16683 usemorebits='$usemorebits'
16684 usemultiplicity='$usemultiplicity'
16685 usemymalloc='$usemymalloc'
16687 useopcode='$useopcode'
16688 useperlio='$useperlio'
16689 useposix='$useposix'
16691 useshrplib='$useshrplib'
16692 usesocks='$usesocks'
16693 usethreads='$usethreads'
16694 usevendorprefix='$usevendorprefix'
16695 usevfork='$usevfork'
16698 uvXUformat='$uvXUformat'
16699 uvoformat='$uvoformat'
16702 uvuformat='$uvuformat'
16703 uvxformat='$uvxformat'
16704 vendorarch='$vendorarch'
16705 vendorarchexp='$vendorarchexp'
16706 vendorbin='$vendorbin'
16707 vendorbinexp='$vendorbinexp'
16708 vendorlib='$vendorlib'
16709 vendorlib_stem='$vendorlib_stem'
16710 vendorlibexp='$vendorlibexp'
16711 vendorprefix='$vendorprefix'
16712 vendorprefixexp='$vendorprefixexp'
16714 versiononly='$versiononly'
16716 voidflags='$voidflags'
16718 xs_apiversion='$xs_apiversion'
16720 yaccflags='$yaccflags'
16725 : Add in command line options if available
16726 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
16728 : add special variables
16729 $test -f $src/patchlevel.h && \
16730 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
16731 echo "CONFIGDOTSH=true" >>config.sh
16733 : propagate old symbols
16734 if $test -f UU/config.sh; then
16735 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
16736 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
16737 $sort | $uniq -u >UU/oldsyms
16738 set X `cat UU/oldsyms`
16744 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
16746 echo "# Variables propagated from previous config.sh file." >>config.sh
16747 for sym in `cat UU/oldsyms`; do
16748 echo " Propagating $hint variable "'$'"$sym..."
16749 eval 'tmp="$'"${sym}"'"'
16751 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
16757 : Finish up by extracting the .SH files
16771 If you'd like to make any changes to the config.sh file before I begin
16772 to configure things, do it as a shell escape now (e.g. !vi config.sh).
16775 rp="Press return or use a shell escape to edit config.sh:"
16780 *) : in case they cannot read
16781 sh 1>&4 -c "$ans";;
16786 : if this fails, just run all the .SH files by hand
16793 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
16800 Now you need to generate make dependencies by running "$make depend".
16801 You might prefer to run it in background: "$make depend > makedepend.out &"
16802 It can take a while, so you might not want to run it right now.
16807 rp="Run $make depend now?"
16811 $make depend && echo "Now you must run '$make'."
16814 echo "You must run '$make depend' then '$make'."
16817 elif test -f [Mm]akefile; then
16819 echo "Now you must run a $make."
16824 if $test -f Policy.sh; then
16827 If you compile $package on a different machine or from a different object
16828 directory, copy the Policy.sh file from this object directory to the
16829 new one before you run Configure -- this will help you with most of
16830 the policy defaults.
16834 if $test -f config.msg; then
16835 echo "Hmm. I also noted the following information while running:"
16837 $cat config.msg >&4
16840 $rm -f kit*isdone ark*isdone