3 # If these # comments don't work, trim them. Don't worry about any other
4 # shell scripts, Configure will trim # comments from them for you.
6 # (If you are trying to port this package to a machine without sh,
7 # I would suggest you have a look at the prototypical config_h.SH file
8 # and edit it to reflect your system. Some packages may include samples
9 # of config.h for certain machines, so you might look for one of those.)
11 # Yes, you may rip this off to use in other distribution packages. This
12 # script belongs to the public domain and cannot be copyrighted.
14 # (Note: this Configure script was generated automatically. Rather than
15 # working with this copy of Configure, you may wish to get metaconfig.
16 # The dist-3.0 package (which contains metaconfig) was posted in
17 # comp.sources.misc and is available on CPAN under authors/id/RAM so
18 # you may fetch it yourself from your nearest archive site.)
21 # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
23 # Generated on Thu May 24 17:54:36 EET DST 2001 [metaconfig 3.0 PL70]
24 # (with additional metaconfig patches by perlbug@perl.org)
29 SCO csh still thinks true is false. Write to SCO today and tell them that next
30 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
32 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
33 we'd have to do is go in and swap the && and || tokens, wherever they are.)
35 [End of diatribe. We now return you to your regularly scheduled programming...]
39 OOPS! You naughty creature! You didn't run Configure with sh!
40 I will attempt to remedy the situation by running sh for you...
44 true || exec sh $0 $argv:q
46 (exit $?0) || cat c2$$
47 (exit $?0) || exec sh $0 $argv:q
50 : compute my invocation name
54 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
59 : Proper separator for the PATH environment variable
61 : On OS/2 this directory should exist if this is not floppy only system :-]
62 if test -d c:/. ; then
63 if test -n "$OS2_SHELL"; then
65 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
66 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
67 elif test -n "$DJGPP"; then
73 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
74 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
75 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
76 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
77 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
78 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /usr/ccs/bin"
79 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
80 paths="$paths /sbin /usr/sbin /usr/libexec"
86 *) test -d $p && PATH=$PATH$p_$p ;;
93 : shall we be using ksh?
99 if (PATH=.; alias -x) >/dev/null 2>&1; then
102 if test -f /hp-ux -a -f /bin/ksh; then
103 needksh='to avoid sh bug in "here document" expansion'
105 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
106 if test X`/usr/bin/uname -v` = X4; then
107 avoidksh="to avoid AIX 4's /bin/sh"
111 if test -f /osf_boot -a -f /usr/sbin/setld; then
112 if test X`/usr/bin/uname -s` = XOSF1; then
113 avoidksh="to avoid Digital UNIX' ksh"
115 unset BIN_SH # if this is 'xpg4' sh will start up ksh
118 case "$inksh/$needksh" in
125 case "$inksh/$avoidksh" in
131 case "$inksh/$needksh-$avoidksh-" in
134 (I see you are using the Korn shell. Some ksh's blow up on $me,
135 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
141 echo "(Feeding myself to $newsh $reason.)"
143 Configure|*/Configure) exec $newsh $0 "$@";;
144 *) exec $newsh Configure "$@";;
149 : if needed set CDPATH to a harmless value that is not chatty
150 : avoid bash 2.02 problems with empty CDPATH.
154 *bash*) CDPATH='.' ;;
159 : Configure runs within the UU subdirectory
160 test -d UU || mkdir UU
468 d_old_pthread_create_joinable=''
469 old_pthread_create_joinable=''
553 d_stdio_ptr_lval_nochange_cnt=''
554 d_stdio_ptr_lval_sets_cnt=''
731 inc_version_list_init=''
750 ignore_versioned_solibs=''
809 d_perl_otherlibdirs=''
827 d_nv_preserves_uv_bits=''
926 d_stdio_stream_array=''
927 stdio_stream_array=''
937 ccflags_uselargefiles=''
938 ldflags_uselargefiles=''
939 libswanted_uselargefiles=''
984 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
987 : We must find out about Eunice early
989 if test -f /etc/unixtovms; then
990 eunicefix=/etc/unixtovms
992 if test -f /etc/unixtovms.exe; then
993 eunicefix=/etc/unixtovms.exe
1000 : set useposix=false in your hint file to disable the POSIX extension.
1002 : set useopcode=false in your hint file to disable the Opcode extension.
1004 : Trailing extension. Override this in a hint file, if needed.
1006 : Extra object files, if any, needed on this platform.
1009 : Possible local include directories to search.
1010 : Set locincpth to "" in a hint file to defeat local include searches.
1011 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1012 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1014 : no include file wanted by default
1018 : change the next line if compiling for Xenix/286 on Xenix/386
1019 xlibpth='/usr/lib/386 /lib/386'
1020 : Possible local library directories to search.
1021 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1022 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1024 : general looking path for locating libraries
1025 glibpth="/lib /usr/lib $xlibpth"
1026 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1027 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1028 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1030 : Private path used by Configure to find libraries. Its value
1031 : is prepended to libpth. This variable takes care of special
1032 : machines, like the mips. Usually, it should be empty.
1035 : default library list
1037 : some systems want to use only the non-versioned libso:s
1038 ignore_versioned_solibs=''
1040 ccflags_uselargefiles=''
1041 ldflags_uselargefiles=''
1042 libswanted_uselargefiles=''
1043 : set usemultiplicity on the Configure command line to enable multiplicity.
1044 : set usesocks on the Configure command line to enable socks.
1045 : set usethreads on the Configure command line to enable threads.
1046 : full support for void wanted by default
1049 : List of libraries we want.
1050 : If anyone needs -lnet, put it in a hint file.
1051 libswanted='sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl'
1052 libswanted="$libswanted dld ld sun m c cposix posix"
1053 libswanted="$libswanted ndir dir crypt sec"
1054 libswanted="$libswanted ucb bsd BSD PW x iconv util"
1055 : We probably want to search /usr/shlib before most other libraries.
1056 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1057 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1058 glibpth="/usr/shlib $glibpth"
1059 : Do not use vfork unless overridden by a hint file.
1062 : Find the basic shell for Bourne shell scripts
1066 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1069 if test -f "$xxx"; then
1072 : Build up a list and do a single loop so we can 'break' out.
1073 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1074 for xxx in sh bash ksh pdksh ash; do
1076 try="$try ${p}/${xxx}"
1080 if test -f "$xxx"; then
1083 elif test -f "$xxx.exe"; then
1094 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1096 Usually it's in /bin/sh. How did you even get this far?
1097 Please contact me (Perl Maintainers) at perlbug@perl.org and
1098 we'll try to straighten this all out.
1104 : see if sh knows # comments
1105 if `$sh -c '#' >/dev/null 2>&1`; then
1109 test -f $xcat || xcat=/usr/bin/cat
1114 if test -s today; then
1117 echo "#! $xcat" > try
1121 if test -s today; then
1129 echo "Your $sh doesn't grok # comments--I will strip them later on."
1132 echo "exec grep -v '^[ ]*#'" >spitshell
1134 $eunicefix spitshell
1135 spitshell=`pwd`/spitshell
1137 echo "I presume that if # doesn't work, #! won't work either!"
1142 : figure out how to guarantee sh startup
1144 '') startsh=${sharpbang}${sh} ;;
1156 : echo "Yup, it does."
1158 echo "Hmm... '$startsh' does not guarantee sh startup..."
1159 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1164 : Save command line options in file UU/cmdline.opt for later use in
1165 : generating config.sh.
1166 cat > cmdline.opt <<EOSH
1167 # Configure command line arguments.
1174 cat >>cmdline.opt <<EOSH
1175 config_arg$argn='$arg'
1177 argn=`expr $argn + 1`
1180 : produce awk script to parse command line options
1181 cat >options.awk <<'EOF'
1183 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1185 len = length(optstr);
1186 for (i = 1; i <= len; i++) {
1187 c = substr(optstr, i, 1);
1188 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1199 if (substr(str, 1, 1) != "-") {
1200 printf("'%s'\n", str);
1204 for (i = 2; i <= len; i++) {
1205 c = substr(str, i, 1);
1207 printf("-%s\n", substr(str, i));
1213 printf("'%s'\n", substr(str, i + 1));
1226 : process the command line options
1227 set X `for arg in "$@"; do echo "X$arg"; done |
1228 sed -e s/X// | awk -f options.awk`
1233 : set up default values
1243 rm -f optdef.sh posthint.sh
1244 cat >optdef.sh <<EOS
1250 while test $# -gt 0; do
1252 -d) shift; fastread=yes;;
1253 -e) shift; alldone=cont;;
1257 if test -r "$1"; then
1260 echo "$me: cannot read config file $1." >&2
1265 -h) shift; error=true;;
1266 -r) shift; reuseval=true;;
1267 -s) shift; silent=true; realsilent=true;;
1268 -E) shift; alldone=exit;;
1269 -K) shift; knowitall=true;;
1270 -O) shift; override=true;;
1271 -S) shift; silent=true; extractsh=true;;
1276 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1277 echo "$me: ignoring -D $1" >&2
1280 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1281 *) echo "$1='define'" >> optdef.sh;;
1288 *=) echo "$1" >> optdef.sh;;
1290 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1291 echo "$me: ignoring -U $1" >&2
1293 *) echo "$1='undef'" >> optdef.sh;;
1304 *=*) zzz=`echo $yyy|sed 's!=.*!!'`
1308 zzz=" "`echo $yyy|sed 's!^[^=]*=!!'`
1309 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1315 *:*) xxx=`echo $yyy|sed 's!:.*!!'`
1316 yyy=`echo $yyy|sed 's!^[^:]*:!!'`
1317 zzz=`echo $yyy|sed 's!^[^=]*=!!'`
1318 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1319 *) xxx=`echo $yyy|sed 's!:.*!!'`
1320 yyy=`echo $yyy|sed 's!^[^:]*:!!'` ;;
1326 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1328 echo "$yyy=''" >> posthint.sh ;;
1333 echo "$yyy='$zzz'" >> posthint.sh ;;
1335 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1337 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1342 echo "$yyy=$zzz" >> posthint.sh ;;
1343 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1347 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1350 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1358 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1359 [-U symbol] [-U symbol=] [-A command:symbol...]
1360 -d : use defaults for all answers.
1361 -e : go on without questioning past the production of config.sh.
1362 -f : specify an alternate default configuration file.
1363 -h : print this help message and exit (with an error status).
1364 -r : reuse C symbols value if possible (skips costly nm extraction).
1365 -s : silent mode, only echoes questions and essential information.
1366 -D : define symbol to have some value:
1367 -D symbol symbol gets the value 'define'
1368 -D symbol=value symbol gets the value 'value'
1369 -E : stop at the end of questions, after having produced config.sh.
1370 -K : do not use unless you know what you are doing.
1371 -O : let -D and -U override definitions from loaded configuration file.
1372 -S : perform variable substitutions on all .SH files (can mix with -f)
1373 -U : undefine symbol:
1374 -U symbol symbol gets the value 'undef'
1375 -U symbol= symbol gets completely empty
1376 -A : manipulate symbol after the platform specific hints have been applied:
1377 -A symbol=value append " "value to symbol
1378 -A append:symbol=value append value to symbol
1379 -A define:symbol=value define symbol to have value
1380 -A clear:symbol define symbol to be ''
1381 -A define:symbol define symbol to be 'define'
1382 -A eval:symbol=value define symbol to be eval of value
1383 -A prepend:symbol=value prepend value to symbol
1384 -A undef:symbol define symbol to be 'undef'
1385 -A undef:symbol= define symbol to be ''
1386 -V : print version number and exit (with a zero status).
1393 case "$fastread$alldone" in
1396 case "$extractsh" in
1399 if test ! -t 0; then
1400 echo "Say 'sh Configure', not 'sh <Configure'"
1410 true) exec 1>/dev/null;;
1413 : run the defines and the undefines, if any, but leave the file out there...
1416 : create the posthint manipulation script and leave the file out there...
1421 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1422 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1423 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1424 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1425 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1428 : Some greps do not return status, grrr.
1429 echo "grimblepritz" >grimble
1430 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1432 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1438 : the following should work in any shell
1442 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1443 cat >contains <<'EOSS'
1444 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1449 : Find the path to the source tree
1452 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1456 *) src=`cd ../$src && pwd` ;;
1469 if test -f $rsrc/Configure && \
1470 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1472 : found it, so we are ok.
1475 for src in . .. ../.. ../../.. ../../../..; do
1476 if test -f ../$src/Configure && \
1477 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1488 Sorry, I can't seem to locate the source dir for $package. Please start
1489 Configure with an explicit path -- i.e. /some/path/Configure.
1497 echo "Sources for $package found in \"$src\"." >&4
1501 : script used to extract .SH files with variable substitutions
1502 cat >extract <<'EOS'
1504 echo "Doing variable substitutions on .SH files..."
1505 if test -f $src/MANIFEST; then
1506 set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH$'`
1508 echo "(Looking for .SH files under the source directory.)"
1509 set x `(cd $src; find . -name "*.SH" -print)`
1513 0) set x `(cd $src; echo *.SH)`; shift;;
1515 if test ! -f $src/$1; then
1521 while test $name; do
1522 if test ! -d "$name"; then
1523 create="$name $create";
1524 name=`echo $name | sed -e "s|^[^/]*$||"`;
1525 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1530 for file in $create; do
1539 dir=`expr X$file : 'X\(.*\)/'`
1540 file=`expr X$file : 'X.*/\(.*\)'`
1541 (cd $dir && . ./$file)
1551 dir=`expr X$file : 'X\(.*\)/'`
1552 file=`expr X$file : 'X.*/\(.*\)'`
1553 (set x $dir; shift; eval $mkdir_p)
1563 if test -f $src/config_h.SH; then
1564 if test ! -f config.h; then
1565 : oops, they left it out of MANIFEST, probably, so do it anyway.
1571 : extract files and exit if asked to do so
1572 case "$extractsh" in
1574 case "$realsilent" in
1578 case "$config_sh" in
1579 '') config_sh='config.sh';;
1582 echo "Fetching answers from $config_sh..."
1585 test "$override" && . ./optdef.sh
1594 : Eunice requires " " instead of "", can you believe it
1597 echo "Beginning of configuration questions for $package."
1599 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1601 : first determine how to suppress newline on echo command
1603 echo "Checking echo to see how to suppress newlines..."
1604 (echo "hi there\c" ; echo " ") >.echotmp
1605 if $contains c .echotmp >/dev/null 2>&1 ; then
1616 echo $n "The star should be here-->$c"
1620 : Now test for existence of everything in MANIFEST
1622 if test -f $rsrc/MANIFEST; then
1623 echo "First let's make sure your kit is complete. Checking..." >&4
1624 awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
1627 for filelist in x??; do
1628 (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
1630 if test -s missing; then
1634 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1636 You have the option of continuing the configuration process, despite the
1637 distinct possibility that your kit is damaged, by typing 'y'es. If you
1638 do, don't blame me if something goes wrong. I advise you to type 'n'o
1639 and contact the author (perlbug@perl.org).
1642 echo $n "Continue? [n] $c" >&4
1646 echo "Continuing..." >&4
1650 echo "ABORTING..." >&4
1655 echo "Looks good..."
1658 echo "There is no MANIFEST file. I hope your kit is complete !"
1663 : Find the appropriate value for a newline for tr
1664 if test -n "$DJGPP"; then
1667 if test X"$trnl" = X; then
1668 case "`echo foo|tr '\n' x 2>/dev/null`" in
1672 if test X"$trnl" = X; then
1673 case "`echo foo|tr '\012' x 2>/dev/null`" in
1674 foox) trnl='\012' ;;
1677 if test X"$trnl" = X; then
1680 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1686 : compute the number of columns on the terminal for proper question formatting
1691 : set up the echo used in my read
1692 myecho="case \"\$xxxm\" in
1693 '') echo $n \"\$rp $c\" >&4;;
1695 '') echo $n \"[\$xxxm] $c\";;
1697 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1699 echo $n \"[\$xxxm] $c\" >&4
1701 echo $n \"\$rp [\$xxxm] $c\" >&4
1707 : now set up to do reads with possible shell escape and default assignment
1713 case "\$fastread" in
1714 yes) case "\$dflt" in
1717 case "\$silent-\$rp" in
1722 *) case "\$silent" in
1723 true) case "\$rp" in
1728 while expr "X\$ans" : "X!" >/dev/null; do
1732 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1740 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1749 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1754 echo "(OK, I'll run with -d after this question.)" >&4
1757 echo "*** Sorry, \$1 not supported yet." >&4
1767 echo "*** Substitution done -- please confirm."
1769 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1774 echo "*** Error -- try again."
1781 case "\$ans\$xxxm\$nostick" in
1793 : create .config dir to save info across Configure sessions
1794 test -d ../.config || mkdir ../.config
1795 cat >../.config/README <<EOF
1796 This directory created by Configure to save information that should
1797 persist across sessions for $package.
1799 You may safely delete it if you wish.
1802 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
1804 $define|true|[yY]*) ;;
1805 *) case "$xversion" in
1808 *** WHOA THERE!!! ***
1810 This is an UNSTABLE DEVELOPMENT release.
1811 The version of this $package distribution is $xversion, that is, odd,
1812 (as opposed to even) and that signifies a development release.
1813 If you want a maintenance release, you want an even-numbered version.
1815 Do ***NOT*** install this into production use.
1816 Data corruption and crashes are possible.
1818 It is most seriously suggested that you do not continue any further
1819 unless you want to help in developing and debugging Perl.
1821 If you *still* want to build perl, you can answer 'y' now,
1822 or pass -Dusedevel to Configure.
1825 rp='Do you really want to continue?'
1829 [yY]) echo >&4 "Okay, continuing."
1830 usedevel="$define" ;;
1831 *) echo >&4 "Okay, bye."
1841 case "$versiononly" in
1842 '') versiononly="$define" ;;
1844 case "$installusrbinperl" in
1845 '') installusrbinperl="$undef" ;;
1850 : general instructions
1853 user=`(logname) 2>/dev/null`
1855 '') user=`whoami 2>&1`;;
1857 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1860 rp='Would you like to see the instructions?'
1871 This installation shell script will examine your system and ask you questions
1872 to determine how the perl5 package should be installed. If you get
1873 stuck on a question, you may use a ! shell escape to start a subshell or
1874 execute a command. Many of the questions will have default answers in square
1875 brackets; typing carriage return will give you the default.
1877 On some of the questions which ask for file or directory names you are allowed
1878 to use the ~name construct to specify the login directory belonging to "name",
1879 even if you don't have a shell which knows about that. Questions where this is
1880 allowed will be marked "(~name ok)".
1884 dflt='Type carriage return to continue'
1888 The prompter used in this script allows you to use shell variables and
1889 backticks in your answers. You may use $1, $2, etc... to refer to the words
1890 in the default answer, as if the default line was a set of arguments given to a
1891 script shell. This means you may also use $* to repeat the whole default line,
1892 so you do not have to re-type everything to add something to the default.
1894 Everytime there is a substitution, you will have to confirm. If there is an
1895 error (e.g. an unmatched backtick), the default answer will remain unchanged
1896 and you will be prompted again.
1898 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1899 the questions and use the computed defaults (or the previous answers if there
1900 was already a config.sh file). Type 'Configure -h' for a list of options.
1901 You may also start interactively and then answer '& -d' at any prompt to turn
1902 on the non-interactive behaviour for the remainder of the execution.
1908 Much effort has been expended to ensure that this shell script will run on any
1909 Unix system. If despite that it blows up on yours, your best bet is to edit
1910 Configure and run it again. If you can't run Configure for some reason,
1911 you'll have to generate a config.sh file by hand. Whatever problems you
1912 have, let me (perlbug@perl.org) know how I blew it.
1914 This installation script affects things in two ways:
1916 1) it may do direct variable substitutions on some of the files included
1918 2) it builds a config.h file for inclusion in C programs. You may edit
1919 any of these files as the need arises after running this script.
1921 If you make a mistake on a question, there is no easy way to back up to it
1922 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1923 files. Configure will offer to let you do this before it runs the SH files.
1926 dflt='Type carriage return to continue'
1928 case "$firsttime" in
1929 true) echo $user >>../.config/instruct;;
1933 : find out where common programs are
1935 echo "Locating common programs..." >&4
1948 if test -d \$dir/\$thing; then
1954 for thisthing in \$dir/\$thing; do
1955 : just loop through to pick last item
1957 if test -f \$thisthing; then
1960 elif test -f \$dir/\$thing.exe; then
1961 if test -n "$DJGPP"; then
1962 echo \$dir/\$thing.exe
1964 : on Eunice apparently
2015 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2016 pth="$pth /lib /usr/lib"
2017 for file in $loclist; do
2021 if test -f "$xxx"; then
2024 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2025 xxx=`./loc $file $file $pth`
2028 '') xxx=`./loc $file $file $pth`;;
2029 *) xxx=`./loc $xxx $xxx $pth`;;
2035 echo $file is in $xxx.
2038 echo $file is in $xxx.
2041 echo "I don't know where '$file' is, and my life depends on it." >&4
2042 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2048 echo "Don't worry if any of the following aren't found..."
2050 for file in $trylist; do
2054 if test -f "$xxx"; then
2057 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2058 xxx=`./loc $file $file $pth`
2061 '') xxx=`./loc $file $file $pth`;;
2062 *) xxx=`./loc $xxx $xxx $pth`;;
2068 echo $file is in $xxx.
2071 echo $file is in $xxx.
2074 echo "I don't see $file out there, $say."
2081 echo "Substituting grep for egrep."
2087 echo "Substituting cp for ln."
2093 echo "Hopefully test is built into your sh."
2096 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2097 echo "Using the test built into your sh."
2105 echo "Hopefully echo is built into your sh."
2110 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2111 $echo $n "hi there$c" >foo1
2112 echo $n "hi there$c" >foo2
2113 if cmp foo1 foo2 >/dev/null 2>&1; then
2114 echo "They are compatible. In fact, they may be identical."
2121 They are not compatible! You are probably running ksh on a non-USG system.
2122 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2123 have echo built in and we may have to run some Bourne shell scripts. That
2124 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2127 $echo $n "The star should be here-->$c"
2137 cat <<'EOSC' >>checkcc
2142 int main(int argc, char *argv[]) {
2146 if $cc -o try $ccflags $ldflags try.c; then
2149 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2155 case "`$cc -v -c try.c 2>&1`" in
2158 if $test X"$trygcc" = Xyes; then
2159 if gcc -o try -c try.c; then
2161 echo "You seem to have a working gcc, though." >&4
2162 rp="Would you like to use it?"
2164 if $test -f myread; then
2167 if $test -f UU/myread; then
2170 echo "Cannot find myread, sorry. Aborting." >&2
2175 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no ;;
2179 if $test X"$despair" = Xyes; then
2181 You need to find a working C compiler.
2182 Either (purchase and) install the C compiler supplied by your OS vendor,
2183 or for a free C compiler try http://gcc.gnu.org/
2184 I cannot continue any further, aborting.
2194 : determine whether symbolic links are supported
2197 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2198 echo "Symbolic links are supported." >&4
2201 echo "Symbolic links are NOT supported." >&4
2206 : determine whether symbolic links are supported
2210 echo "Checking how to test for symbolic links..." >&4
2212 if $test "X$issymlink" = X; then
2213 sh -c "PATH= test -h sym" >/dev/null 2>&1
2214 if test $? = 0; then
2218 if $test "X$issymlink" = X; then
2219 if $test -h >/dev/null 2>&1; then
2220 issymlink="$test -h"
2221 echo "Your builtin 'test -h' may be broken, I'm using external '$test -h'." >&4
2224 if $test "X$issymlink" = X; then
2225 if $test -L sym 2>/dev/null; then
2226 issymlink="$test -L"
2229 if $test "X$issymlink" != X; then
2230 echo "You can test for symbolic links with '$issymlink'." >&4
2232 echo "I do not know how you can test for symbolic links." >&4
2236 *) echo "No symbolic links, so not testing for their testing..." >&4
2242 case "$mksymlinks" in
2245 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2248 *) case "$lns:$issymlink" in
2249 *"ln -s:"*"test -"?)
2250 echo "Creating the symbolic links..." >&4
2251 echo "(First creating the subdirectories...)" >&4
2253 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2255 test -z "$directory" && break
2259 if test ! -d t/base; then
2260 echo "Failed to create the subdirectories. Aborting." >&4
2263 echo "(Then creating the symlinks...)" >&4
2264 awk '{print $1}' $src/MANIFEST | while true; do
2266 test -z "$filename" && break
2267 if test -f $filename; then
2268 if $issymlink $filename; then
2272 if test -f $filename; then
2273 echo "$filename already exists, not symlinking."
2275 ln -s $src/$filename $filename
2279 if test ! -f t/base/commonsense.t; then
2280 echo "Failed to create the symlinks. Aborting." >&4
2285 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2293 : see whether [:lower:] and [:upper:] are supported character classes
2295 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2297 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2301 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
2302 # (0xc9 and 0xd1), therefore that is a nice testing point.
2303 if test "X$up" = X -o "X$low" = X; then
2304 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
2310 if test "X$up" = X -o "X$low" = X; then
2311 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
2317 if test "X$up" = X -o "X$low" = X; then
2318 case "`echo IJ | od -x 2>/dev/null`" in
2320 echo "Hey, this might be EBCDIC." >&4
2321 if test "X$up" = X -o "X$low" = X; then
2322 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2323 ij) up='[A-IJ-RS-Z]'
2328 if test "X$up" = X -o "X$low" = X; then
2329 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2339 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
2341 echo "Using $up and $low to convert case." >&4
2344 echo "I don't know how to translate letters from upper to lower case." >&4
2345 echo "Your tr is not acting any way I know of." >&4
2349 : set up the translation script tr, must be called with ./tr of course
2353 '[A-Z][a-z]') exec $tr '$up' '$low';;
2354 '[a-z][A-Z]') exec $tr '$low' '$up';;
2361 : Try to determine whether config.sh was made on this system
2362 case "$config_sh" in
2364 myuname=`$uname -a 2>/dev/null`
2365 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2366 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2367 # because the A-Z/a-z are not consecutive.
2368 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2369 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2370 newmyuname="$myuname"
2372 case "$knowitall" in
2374 if test -f ../config.sh; then
2375 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2376 eval "`grep myuname= ../config.sh`"
2378 if test "X$myuname" = "X$newmyuname"; then
2386 : Get old answers from old config file if Configure was run on the
2387 : same system, otherwise use the hints.
2390 if test -f config.sh; then
2392 rp="I see a config.sh file. Shall I use it to set the defaults?"
2395 n*|N*) echo "OK, I'll ignore it."
2396 mv config.sh config.sh.old
2397 myuname="$newmyuname"
2399 *) echo "Fetching default answers from your old config.sh file..." >&4
2407 : Older versions did not always set $sh. Catch re-use of such
2417 if test ! -f config.sh; then
2420 First time through, eh? I have some defaults handy for some systems
2421 that need some extra help getting the Configure answers right:
2424 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2426 : Half the following guesses are probably wrong... If you have better
2427 : tests or hints, please send them to perlbug@perl.org
2428 : The metaconfig authors would also appreciate a copy...
2429 $test -f /irix && osname=irix
2430 $test -f /xenix && osname=sco_xenix
2431 $test -f /dynix && osname=dynix
2432 $test -f /dnix && osname=dnix
2433 $test -f /lynx.os && osname=lynxos
2434 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2435 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
2436 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2437 $test -f /bin/mips && /bin/mips && osname=mips
2438 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
2439 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
2440 $test -d /usr/apollo/bin && osname=apollo
2441 $test -f /etc/saf/_sactab && osname=svr4
2442 $test -d /usr/include/minix && osname=minix
2443 if $test -d /MachTen -o -d /MachTen_Folder; then
2445 if $test -x /sbin/version; then
2446 osvers=`/sbin/version | $awk '{print $2}' |
2447 $sed -e 's/[A-Za-z]$//'`
2448 elif $test -x /usr/etc/version; then
2449 osvers=`/usr/etc/version | $awk '{print $2}' |
2450 $sed -e 's/[A-Za-z]$//'`
2456 $test -f /sys/posix.dll &&
2457 $test -f /usr/bin/what &&
2458 set X `/usr/bin/what /sys/posix.dll` &&
2459 $test "$3" = UWIN &&
2463 if $test -f $uname; then
2471 umips) osname=umips ;;
2474 [23]100) osname=mips ;;
2475 next*) osname=next ;;
2477 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
2478 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
2481 elif $test -f /etc/kconfig; then
2483 if test "$lns" = "$ln -s"; then
2485 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
2487 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
2494 if test -n "$DJGPP"; then
2503 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
2505 'not found') osvers="$4"."$3" ;;
2506 '<3240'|'<>3240') osvers=3.2.0 ;;
2507 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
2508 '=3250'|'>3250') osvers=3.2.5 ;;
2512 bsd386) osname=bsd386
2515 cygwin*) osname=cygwin
2518 *dc.osx) osname=dcosx
2524 domainos) osname=apollo
2530 dynixptx*) osname=dynixptx
2531 osvers=`echo "$4"|sed 's/^v//'`
2533 freebsd) osname=freebsd
2535 genix) osname=genix ;;
2537 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
2553 netbsd*) osname=netbsd
2556 news-os) osvers="$3"
2558 4*) osname=newsos4 ;;
2562 next*) osname=next ;;
2563 nonstop-ux) osname=nonstopux ;;
2564 POSIX-BC | posix-bc ) osname=posix-bc
2567 powerux | power_ux | powermax_os | powermaxos | \
2568 powerunix | power_unix) osname=powerux
2574 solaris) osname=solaris
2576 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2583 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2587 titanos) osname=titanos
2596 ultrix) osname=ultrix
2599 osf1|mls+) case "$5" in
2602 osvers=`sizer -v | awk '{print $3}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
2605 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
2608 hp*) osname=hp_osf1 ;;
2609 mips) osname=mips_osf1 ;;
2612 unixware) osname=svr5
2618 $2) case "$osname" in
2622 : svr4.x or possibly later
2632 if test -f /stand/boot ; then
2633 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
2634 if test -n "$INITPROG" -a -f "$INITPROG"; then
2635 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
2636 if test -n "$isesix"; then
2644 *) if test -f /etc/systemid; then
2646 set `echo $3 | $sed 's/\./ /g'` $4
2647 if $test -f $src/hints/sco_$1_$2_$3.sh; then
2649 elif $test -f $src/hints/sco_$1_$2.sh; then
2651 elif $test -f $src/hints/sco_$1.sh; then
2656 '') : Still unknown. Probably a generic Sys V.
2665 *) case "$osname" in
2666 '') : Still unknown. Probably a generic BSD.
2674 if test -f /vmunix -a -f $src/hints/news_os.sh; then
2675 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
2676 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
2679 $rm -f UU/kernel.what
2680 elif test -d c:/.; then
2687 : Now look for a hint file osname_osvers, unless one has been
2688 : specified already.
2691 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
2692 : Also try without trailing minor version numbers.
2693 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
2694 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
2695 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
2696 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
2699 *) case "$osvers" in
2702 *) if $test -f $src/hints/$file.sh ; then
2704 elif $test -f $src/hints/$xfile.sh ; then
2706 elif $test -f $src/hints/$xxfile.sh ; then
2708 elif $test -f $src/hints/$xxxfile.sh ; then
2710 elif $test -f $src/hints/$xxxxfile.sh ; then
2712 elif $test -f "$src/hints/${osname}.sh" ; then
2721 if $test -f Policy.sh ; then
2724 none) dflt="Policy" ;;
2725 *) dflt="Policy $dflt" ;;
2730 dflt=`echo $hintfile | $sed 's/\.sh$//'`
2734 if $test -f Policy.sh ; then
2737 There's also a Policy hint file available, which should make the
2738 site-specific (policy) questions easier to answer.
2745 You may give one or more space-separated answers, or "none" if appropriate.
2746 A well-behaved OS will have no hints, so answering "none" or just "Policy"
2747 is a good thing. DO NOT give a wrong version or a wrong OS.
2751 rp="Which of these apply, if any?"
2754 for file in $tans; do
2755 if $test X$file = XPolicy -a -f Policy.sh; then
2757 $cat Policy.sh >> UU/config.sh
2758 elif $test -f $src/hints/$file.sh; then
2759 . $src/hints/$file.sh
2760 $cat $src/hints/$file.sh >> UU/config.sh
2761 elif $test X$tans = X -o X$tans = Xnone ; then
2764 : Give one chance to correct a possible typo.
2765 echo "$file.sh does not exist"
2767 rp="hint to use instead?"
2769 for file in $ans; do
2770 if $test -f "$src/hints/$file.sh"; then
2771 . $src/hints/$file.sh
2772 $cat $src/hints/$file.sh >> UU/config.sh
2773 elif $test X$ans = X -o X$ans = Xnone ; then
2776 echo "$file.sh does not exist -- ignored."
2783 : Remember our hint file for later.
2784 if $test -f "$src/hints/$file.sh" ; then
2794 echo "Fetching default answers from $config_sh..." >&4
2798 cp $config_sh config.sh 2>/dev/null
2808 test "$override" && . ./optdef.sh
2810 : Restore computed paths
2811 for file in $loclist $trylist; do
2812 eval $file="\$_$file"
2817 Configure uses the operating system name and version to set some defaults.
2818 The default value is probably right if the name rings a bell. Otherwise,
2819 since spelling matters for me, either accept the default or answer "none"
2826 ''|' '|none) dflt=none ;;
2827 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
2830 *) dflt="$osname" ;;
2832 rp="Operating system name?"
2836 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
2842 ''|' '|none) dflt=none ;;
2843 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
2844 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
2846 ''|' ') dflt=none ;;
2851 *) dflt="$osvers" ;;
2853 rp="Operating system version?"
2863 : who configured the system
2864 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
2865 cf_by=`(logname) 2>/dev/null`
2868 cf_by=`(whoami) 2>/dev/null`
2870 "") cf_by=unknown ;;
2874 : set up the script used to warn in case of inconsistency
2881 echo "*** WHOA THERE!!! ***" >&4
2882 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2883 rp=" Keep the $hint value?"
2886 y) td=$was; tu=$was;;
2890 : function used to set $1 to $val
2891 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2893 $define$undef) . ./whoa; eval "$var=\$td";;
2894 $undef$define) . ./whoa; eval "$var=\$tu";;
2895 *) eval "$var=$val";;
2898 case "$usethreads" in
2899 $define|true|[yY]*) dflt='y';;
2904 Perl can be built to take advantage of threads on some systems.
2905 To do so, Configure can be run with -Dusethreads.
2907 Note that threading is a highly experimental feature, and
2908 some known race conditions still remain. If you choose to try
2909 it, be very sure to not actually deploy it for production
2910 purposes. README.threads has more details, and is required
2911 reading if you enable threads.
2913 If this doesn't make any sense to you, just accept the default '$dflt'.
2915 rp='Build a threading Perl?'
2918 y|Y) val="$define" ;;
2924 case "$usethreads" in
2928 As of 5.5.640, Perl has two different internal threading implementations,
2929 the 5.005 version (5005threads) and an interpreter-based version
2930 (ithreads) that has one interpreter per thread. Both are very
2931 experimental. This arrangement exists to help developers work out
2932 which one is better.
2934 If you're a casual user, you probably don't want interpreter-threads
2935 at this time. There doesn't yet exist a way to create threads from
2936 within Perl in this model, i.e., "use Thread;" will NOT work.
2938 : Default to ithreads unless overridden on command line or with
2941 case "$use5005threads" in
2942 $define|true|[yY]*) dflt='n';;
2944 case "$useithreads" in
2945 $undef|false|[nN]*) dflt='n';;
2947 rp='Use interpreter-based ithreads?'
2950 y|Y) val="$define" ;;
2955 : Now set use5005threads to the opposite value.
2956 case "$useithreads" in
2957 $define) val="$undef" ;;
2964 useithreads="$undef"
2965 use5005threads="$undef"
2969 case "$useithreads$use5005threads" in
2973 You cannot have both the ithreads and the 5.005 threads enabled
2974 at the same time. Disabling the 5.005 threads since they are
2975 much less stable than the ithreads.
2978 use5005threads="$undef"
2982 case "$d_oldpthreads" in
2983 '') : Configure tests would be welcome here. For now, assume undef.
2985 *) val="$d_oldpthreads" ;;
2991 case "$usethreads" in
2992 "$define"|true|[yY]*)
2993 : Look for a hint-file generated 'call-back-unit'. If the
2994 : user has specified that a threading perl is to be built,
2995 : we may need to set or change some other defaults.
2996 if $test -f usethreads.cbu; then
2997 echo "Your platform has some specific hints for threaded builds, using them..."
3001 (Your platform doesn't have any specific hints for threaded builds.
3002 Assuming POSIX threads, then.)
3010 Perl can be built so that multiple Perl interpreters can coexist
3011 within the same Perl executable.
3014 case "$useithreads" in
3017 This multiple interpreter support is required for interpreter-based threads.
3021 *) case "$usemultiplicity" in
3022 $define|true|[yY]*) dflt='y';;
3026 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
3027 rp='Build Perl for multiplicity?'
3030 y|Y) val="$define" ;;
3038 : make some quick guesses about what we are up against
3040 $echo $n "Hmm... $c"
3050 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
3051 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
3053 echo "Looks kind of like an OSF/1 system, but we'll see..."
3055 elif test `echo abc | $tr a-z A-Z` = Abc ; then
3056 xxx=`./loc addbib blurfl $pth`
3057 if $test -f $xxx; then
3058 echo "Looks kind of like a USG system with BSD features, but we'll see..."
3062 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
3063 echo "Looks kind of like an extended USG system, but we'll see..."
3065 echo "Looks kind of like a USG system, but we'll see..."
3069 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
3070 echo "Looks kind of like a BSD system, but we'll see..."
3074 echo "Looks kind of like a Version 7 system, but we'll see..."
3077 case "$eunicefix" in
3080 There is, however, a strange, musty smell in the air that reminds me of
3081 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
3085 : it so happens the Eunice I know will not run shell scripts in Unix format
3089 echo "Congratulations. You aren't running Eunice."
3093 : Detect OS2. The p_ variable is set above in the Head.U unit.
3094 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
3095 : semicolon as a patch separator
3100 I have the feeling something is not exactly right, however...don't tell me...
3101 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
3102 (Or you may be running DOS with DJGPP.)
3107 if test -f /xenix; then
3108 echo "Actually, this looks more like a XENIX system..."
3113 echo "It's not Xenix..."
3118 if test -f /venix; then
3119 echo "Actually, this looks more like a VENIX system..."
3126 echo "Nor is it Venix..."
3129 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3130 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3137 rp="Use which C compiler?"
3140 : Look for a hint-file generated 'call-back-unit'. Now that the
3141 : user has specified the compiler, we may need to set or change some
3143 if $test -f cc.cbu; then
3149 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3150 $cat >gccvers.c <<EOM
3155 printf("%s\n", __VERSION__);
3157 printf("%s\n", "1");
3163 if $cc -o gccvers $ccflags $ldflags gccvers.c; then
3164 gccversion=`./gccvers`
3165 case "$gccversion" in
3166 '') echo "You are not using GNU cc." ;;
3167 *) echo "You are using GNU cc $gccversion."
3173 echo "*** WHOA THERE!!! ***" >&4
3174 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3175 case "$knowitall" in
3177 echo " You'd better start hunting for one and let me know about it." >&4
3183 case "$gccversion" in
3184 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3186 case "$gccversion" in
3187 '') gccosandvers='' ;;
3188 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
3189 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
3191 case "$gccosandvers" in
3192 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
3193 $osname$osvers) ;; # looking good
3194 $osname*) cat <<EOM >&4
3196 *** WHOA THERE!!! ***
3198 Your gcc has not been compiled for the exact release of
3199 your operating system ($gccosandvers versus $osname$osvers).
3201 In general it is a good idea to keep gcc synchronized with
3202 the operating system because otherwise serious problems
3203 may ensue when trying to compile software, like Perl.
3205 I'm trying to be optimistic here, though, and will continue.
3206 If later during the configuration and build icky compilation
3207 problems appear (headerfile conflicts being the most common
3208 manifestation), I suggest reinstalling the gcc to match
3209 your operating system release.
3213 *) gccosandvers='' ;; # failed to parse, better be silent
3221 : see how we invoke the C preprocessor
3223 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3224 cat <<'EOT' >testcpp.c
3230 if test ! -f cppstdin; then
3231 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
3232 # AIX cc -E doesn't show the absolute headerfile
3233 # locations but we'll cheat by using the -M flag.
3234 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
3236 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3239 echo "Keeping your $hint cppstdin wrapper."
3242 wrapper=`pwd`/cppstdin
3246 if $test "X$cppstdin" != "X" && \
3247 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3248 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3250 echo "You used to use $cppstdin $cppminus so we'll use that again."
3252 '') echo "But let's see if we can live without a wrapper..." ;;
3254 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3255 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3257 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3260 echo "(However, $cpprun $cpplast does not work, let's see...)"
3268 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3275 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3276 $cc -E <testcpp.c >testcpp.out 2>&1; \
3277 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3278 echo "Yup, it does."
3281 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
3282 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3283 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3284 echo "Yup, it does."
3287 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
3288 $cc -P <testcpp.c >testcpp.out 2>&1; \
3289 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3290 echo "Yipee, that works!"
3293 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
3294 $cc -P - <testcpp.c >testcpp.out 2>&1; \
3295 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3296 echo "At long last!"
3299 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
3300 $cpp <testcpp.c >testcpp.out 2>&1; \
3301 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3305 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
3306 $cpp - <testcpp.c >testcpp.out 2>&1; \
3307 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3308 echo "Hooray, it works! I was beginning to wonder."
3311 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
3312 $wrapper <testcpp.c >testcpp.out 2>&1; \
3313 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3319 rp="No dice. I can't find a C preprocessor. Name one:"
3323 $x_cpp <testcpp.c >testcpp.out 2>&1
3324 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3325 echo "OK, that will do." >&4
3327 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
3342 echo "Perhaps can we force $cc -E using a wrapper..."
3343 if $wrapper <testcpp.c >testcpp.out 2>&1; \
3344 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3350 echo "Nope, we'll have to live without it..."
3364 "$wrapper"|'cppstdin') ;;
3365 *) $rm -f $wrapper;;
3367 $rm -f testcpp.c testcpp.out
3369 : decide how portable to be. Allow command line overrides.
3370 case "$d_portable" in
3372 *) d_portable="$define" ;;
3375 : set up shell script to do ~ expansion
3381 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3384 if $test -f /bin/csh; then
3385 /bin/csh -f -c "glob \$1"
3390 name=\`$expr x\$1 : '..\([^/]*\)'\`
3391 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3392 if $test ! -d "\$dir"; then
3394 echo "\$me: can't locate home directory for: \$name" >&2
3399 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3415 : now set up to get a file name
3419 cat <<'EOSC' >>getfile
3435 expr $fn : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3436 fn=`echo $fn | sed 's/(.*)//'`
3442 loc_file=`expr $fn : '.*:\(.*\)'`
3443 fn=`expr $fn : '\(.*\):.*'`
3451 */*) fullpath=true;;
3460 *e*) exp_file=true;;
3463 *p*) nopath_ok=true;;
3468 *d*) type='Directory';;
3469 *l*) type='Locate';;
3474 Locate) what='File';;
3479 case "$d_portable" in
3487 while test "$type"; do
3492 true) rp="$rp (~name ok)";;
3495 if test -f UU/getfile.ok && \
3496 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3515 value=`UU/filexp $ans`
3518 if test "$ans" != "$value"; then
3519 echo "(That expands to $value on this system.)"
3533 /*) value="$ansexp" ;;
3534 [a-zA-Z]:/*) value="$ansexp" ;;
3539 echo "I shall only accept a full path name, as in /bin/ls." >&4
3540 echo "Use a ! shell escape if you wish to check pathnames." >&4
3543 echo "Please give a full path name, starting with slash." >&4
3546 echo "Note that using ~name is ok provided it expands well." >&4
3559 for fp in $gfpth; do
3560 if test "X$fp" = X.; then
3565 if test -f "$pf"; then
3567 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3569 echo "($value is not a plain file, but that's ok.)"
3572 if test X"$type" = X; then
3579 for fp in $gfpth; do
3580 if test "X$fp" = X.; then
3585 direxp="$fp/$ansexp"
3587 if test -d "$direxp"; then
3595 if test -d "$ansexp"; then
3596 echo "(Looking for $loc_file in directory $value.)"
3597 value="$value/$loc_file"
3598 ansexp="$ansexp/$loc_file"
3600 if test -f "$ansexp"; then
3603 case "$nopath_ok" in
3604 true) case "$value" in
3606 *) echo "Assuming $value will be in people's path."
3622 if test "$fastread" = yes; then
3627 rp="$what $value doesn't exist. Use that name anyway?"
3646 test "X$gfpthkeep" != Xy && gfpth=""
3649 : What should the include directory be ?
3651 $echo $n "Hmm... $c"
3655 if $test -f /bin/mips && /bin/mips; then
3656 echo "Looks like a MIPS system..."
3657 $cat >usr.c <<'EOCP'
3658 #ifdef SYSTYPE_BSD43
3662 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3663 dflt='/bsd43/usr/include'
3667 mips_type='System V'
3669 $rm -f usr.c usr.out
3670 echo "and you're compiling with the $mips_type compiler and libraries."
3674 echo "Doesn't look like a MIPS system."
3684 case "$xxx_prompt" in
3687 rp='Where are the include files you want to use?'
3695 : Set private lib path
3698 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
3703 '') dlist="$loclibpth $plibpth $glibpth";;
3704 *) dlist="$libpth";;
3707 : Now check and see which directories actually exist, avoiding duplicates
3711 if $test -d $xxx; then
3714 *) libpth="$libpth $xxx";;
3720 Some systems have incompatible or broken versions of libraries. Among
3721 the directories listed in the question below, please remove any you
3722 know not to be holding relevant libraries, and add any that are needed.
3723 Say "none" for none.
3734 rp="Directories to use for library searches?"
3741 : compute shared library extension
3744 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
3754 On some systems, shared libraries may be available. Answer 'none' if
3755 you want to suppress searching of shared libraries for the remainder
3756 of this configuration.
3759 rp='What is the file extension used for shared libraries?'
3763 : Define several unixisms.
3764 : Hints files or command line option can be used to override them.
3765 : The convoluted testing is in case hints files set either the old
3768 '') case "$exe_ext" in
3770 *) _exe="$exe_ext" ;;
3775 '') case "$lib_ext" in
3782 '') case "$obj_ext" in
3789 '') case "$path_sep" in
3800 : Which makefile gets called first. This is used by make depend.
3801 case "$firstmakefile" in
3802 '') firstmakefile='makefile';;
3806 $define|true|[yY]*) dflt='y';;
3811 Perl can be built to use the SOCKS proxy protocol library. To do so,
3812 Configure must be run with -Dusesocks. If you use SOCKS you also need
3813 to use the PerlIO abstraction layer, this will be implicitly selected.
3815 If this doesn't make any sense to you, just accept the default '$dflt'.
3817 rp='Build Perl for SOCKS?'
3820 y|Y) val="$define" ;;
3827 $define|true|[yY]*) useperlio="$define";;
3830 : Looking for optional libraries
3832 echo "Checking for optional libraries..." >&4
3837 case "$libswanted" in
3838 '') libswanted='c_s';;
3841 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
3847 for thisdir in $libpth $xlibpth; do
3848 test -d $thisdir && libspath="$libspath $thisdir"
3850 for thislib in $libswanted; do
3851 for thisdir in $libspath; do
3853 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
3854 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|tail -1`
3855 $test -f "$xxx" && eval $libscheck
3856 $test -f "$xxx" && libstyle=shared
3858 if test ! -f "$xxx"; then
3859 xxx=$thisdir/lib$thislib.$so
3860 $test -f "$xxx" && eval $libscheck
3861 $test -f "$xxx" && libstyle=shared
3863 if test ! -f "$xxx"; then
3864 xxx=$thisdir/lib$thislib$_a
3865 $test -f "$xxx" && eval $libscheck
3866 $test -f "$xxx" && libstyle=static
3868 if test ! -f "$xxx"; then
3869 xxx=$thisdir/$thislib$_a
3870 $test -f "$xxx" && eval $libscheck
3871 $test -f "$xxx" && libstyle=static
3873 if test ! -f "$xxx"; then
3874 xxx=$thisdir/lib${thislib}_s$_a
3875 $test -f "$xxx" && eval $libscheck
3876 $test -f "$xxx" && libstyle=static
3877 $test -f "$xxx" && thislib=${thislib}_s
3879 if test ! -f "$xxx"; then
3880 xxx=$thisdir/Slib$thislib$_a
3881 $test -f "$xxx" && eval $libscheck
3882 $test -f "$xxx" && libstyle=static
3884 if $test -f "$xxx"; then
3886 shared) echo "Found -l$thislib (shared)." ;;
3887 static) echo "Found -l$thislib." ;;
3888 *) echo "Found -l$thislib ($libstyle)." ;;
3892 *) dflt="$dflt -l$thislib"
3893 libsfound="$libsfound $xxx"
3895 libsfiles="$libsfiles $yyy"
3896 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
3897 case " $libsdirs " in
3899 *) libsdirs="$libsdirs $yyy" ;;
3906 if $test ! -f "$xxx"; then
3907 echo "No -l$thislib."
3918 ' '|'') dflt='none';;
3923 In order to compile $package on your machine, a number of libraries
3924 are usually needed. Include any other special libraries here as well.
3925 Say "none" for none. The default list is almost always right.
3929 rp="What libraries to use?"
3936 : determine optimization, if desired, or use for debug flag also
3938 ' '|$undef) dflt='none';;
3940 *) dflt="$optimize";;
3944 By default, $package compiles with the -O flag to use the optimizer.
3945 Alternately, you might want to use the symbolic debugger, which uses
3946 the -g flag (on traditional Unix systems). Either flag can be
3947 specified here. To use neither flag, specify the word "none".
3950 rp="What optimizer/debugger flag should be used?"
3954 'none') optimize=" ";;
3958 : We will not override a previous value, but we might want to
3959 : augment a hint file
3961 default|recommended)
3962 case "$gccversion" in
3963 1*) dflt='-fpcc-struct-return' ;;
3966 *-g*) dflt="$dflt -DDEBUGGING";;
3968 case "$gccversion" in
3969 2*) if test -d /etc/conf/kconfig.d &&
3970 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
3976 case "$gccversion" in
3980 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
3981 echo 'int main(void) { return 0; }' > gcctest.c
3982 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
3983 echo "Yes, it does." 2>&1
3986 echo "Leaving current flags $ccflags alone." 2>&1
3988 *) dflt="$dflt -fno-strict-aliasing" ;;
3991 echo "Nope, it doesn't, but that's ok." 2>&1
3998 case "$mips_type" in
3999 *BSD*|'') inclwanted="$locincpth $usrinc";;
4000 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4002 for thisincl in $inclwanted; do
4003 if $test -d $thisincl; then
4004 if $test x$thisincl != x$usrinc; then
4006 *" -I$thisincl "*);;
4007 *) dflt="$dflt -I$thisincl ";;
4013 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4015 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4023 *) dflt="$dflt -D$2";;
4027 set signal.h LANGUAGE_C; eval $inctest
4031 ccflags="$ccflags -DSOCKS"
4036 default|recommended) dflt="$ccflags $dflt" ;;
4037 *) dflt="$ccflags";;
4046 Your C compiler may want other flags. For this question you should include
4047 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4048 but you should NOT include libraries or ld flags like -lwhatever. If you
4049 want $package to honor its debug switch, you should include -DDEBUGGING here.
4050 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4052 To use no flags, specify the word "none".
4058 rp="Any additional cc flags?"
4065 : the following weeds options from ccflags that are of no interest to cpp
4067 '') cppflags="$ccflags" ;;
4068 *) cppflags="$cppflags $ccflags" ;;
4070 case "$gccversion" in
4071 1*) cppflags="$cppflags -D__GNUC__"
4073 case "$mips_type" in
4075 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4081 echo "Let me guess what the preprocessor flags are..." >&4
4095 *) ftry="$previous $flag";;
4097 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4098 >cpp1.out 2>/dev/null && \
4099 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4100 >cpp2.out 2>/dev/null && \
4101 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4102 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4104 cppflags="$cppflags $ftry"
4114 *-*) echo "They appear to be: $cppflags";;
4116 $rm -f cpp.c cpp?.out
4120 : flags used in final linking phase
4122 '') if ./venix; then
4128 *-posix*) dflt="$dflt -posix" ;;
4131 *) dflt="$ldflags";;
4134 : Try to guess additional flags to pick up local libraries.
4135 for thislibdir in $libpth; do
4136 case " $loclibpth " in
4139 *"-L$thislibdir "*) ;;
4140 *) dflt="$dflt -L$thislibdir" ;;
4152 Your C linker may need flags. For this question you should
4153 include -L/whatever and any other flags used by the C linker, but you
4154 should NOT include libraries like -lwhatever.
4156 Make sure you include the appropriate -L/path flags if your C linker
4157 does not normally search all of the directories you specified above,
4160 To use no flags, specify the word "none".
4164 rp="Any additional ld flags (NOT including libraries)?"
4170 rmlist="$rmlist pdp11"
4174 echo "Checking your choice of C compiler and flags for coherency..." >&4
4175 $cat > try.c <<'EOF'
4177 int main() { printf("Ok\n"); exit(0); }
4179 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
4181 $cat >try.msg <<'EOM'
4182 I've tried to compile and run the following simple program:
4185 $cat try.c >> try.msg
4187 $cat >> try.msg <<EOM
4194 and I got the following output:
4198 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
4199 if $sh -c './try' >>try.msg 2>&1; then
4203 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4206 cat >> try.msg <<'EOQS'
4207 If $libs contains -lsfio, and sfio is mis-configured, then it
4208 sometimes (apparently) runs and exits with a 0 status, but with no
4209 output! It may have to do with sfio's use of _exit vs. exit.
4212 rp="You have a big problem. Shall I abort Configure"
4219 echo "The program compiled OK, but exited with status $?." >>try.msg
4220 rp="You have a problem. Shall I abort Configure"
4224 echo "I can't compile the test program." >>try.msg
4225 rp="You have a BIG problem. Shall I abort Configure"
4231 case "$knowitall" in
4233 echo "(The supplied flags or libraries might be incorrect.)"
4241 *) echo "Ok. Stopping Configure." >&4
4246 n) echo "OK, that should do.";;
4248 $rm -f try try.* core
4250 : define an is-a-typedef? function
4251 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
4253 "") inclist="sys/types.h";;
4255 eval "varval=\$$var";
4259 for inc in $inclist; do
4260 echo "#include <$inc>" >>temp.c;
4262 echo "#ifdef $type" >> temp.c;
4263 echo "printf(\"We have $type\");" >> temp.c;
4264 echo "#endif" >> temp.c;
4265 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
4266 if $contains $type temp.E >/dev/null 2>&1; then
4272 *) eval "$var=\$varval";;
4275 : define an is-a-typedef? function that prompts if the type is not available.
4276 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
4278 "") inclist="sys/types.h";;
4280 eval "varval=\$$var";
4284 for inc in $inclist; do
4285 echo "#include <$inc>" >>temp.c;
4287 echo "#ifdef $type" >> temp.c;
4288 echo "printf(\"We have $type\");" >> temp.c;
4289 echo "#endif" >> temp.c;
4290 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
4292 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
4293 if $contains $type temp.E >/dev/null 2>&1; then
4294 echo "$type found." >&4;
4297 echo "$type NOT found." >&4;
4303 *) eval "$var=\$varval";;
4306 : define a shorthand compile call
4310 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
4311 : define a shorthand compile call for compilations that should be ok.
4315 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
4317 : check for lengths of integral types
4321 echo "Checking to see how big your integers are..." >&4
4322 $cat >intsize.c <<'EOCP'
4326 printf("intsize=%d;\n", (int)sizeof(int));
4327 printf("longsize=%d;\n", (int)sizeof(long));
4328 printf("shortsize=%d;\n", (int)sizeof(short));
4333 if eval $compile_ok && ./intsize > /dev/null; then
4335 echo "Your integers are $intsize bytes long."
4336 echo "Your long integers are $longsize bytes long."
4337 echo "Your short integers are $shortsize bytes long."
4341 Help! I can't compile and run the intsize test program: please enlighten me!
4342 (This is probably a misconfiguration in your system or libraries, and
4343 you really ought to fix it. Still, I'll try anyway.)
4347 rp="What is the size of an integer (in bytes)?"
4351 rp="What is the size of a long integer (in bytes)?"
4355 rp="What is the size of a short integer (in bytes)?"
4361 $rm -f intsize intsize.*
4363 : see what type lseek is declared as in the kernel
4364 rp="What is the type used for lseek's offset on this system?"
4365 set off_t lseektype long stdio.h sys/types.h
4369 echo "Checking to see how big your file offsets are..." >&4
4371 #include <sys/types.h>
4375 printf("%d\n", (int)sizeof($lseektype));
4380 if eval $compile_ok; then
4382 echo "Your file offsets are $lseeksize bytes long."
4386 echo "(I can't seem to compile the test program. Guessing...)"
4387 rp="What is the size of your file offsets (in bytes)?"
4393 : see what type file positions are declared as in the library
4394 rp="What is the type for file position used by fsetpos()?"
4395 set fpos_t fpostype long stdio.h sys/types.h
4400 *_t) zzz="$fpostype" ;;
4403 echo "Checking the size of $zzz..." >&4
4405 #include <sys/types.h>
4408 printf("%d\n", (int)sizeof($fpostype));
4413 if eval $compile_ok; then
4417 echo "(I can't execute the test program--guessing $fpossize.)" >&4
4420 echo "Your $zzz is $fpossize bytes long."
4426 echo "(I can't compile the test program. Guessing...)" >&4
4427 rp="What is the size of your file positions (in bytes)?"
4434 # Backward compatibility (uselfs is deprecated).
4436 "$define"|true|[yY]*)
4439 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
4441 uselargefiles="$define"
4445 case "$lseeksize:$fpossize" in
4448 You can have files larger than 2 gigabytes.
4451 *) case "$uselargefiles" in
4452 "$undef"|false|[nN]*) dflt='n' ;;
4457 Perl can be built to understand large files (files larger than 2 gigabytes)
4458 on some systems. To do so, Configure can be run with -Duselargefiles.
4460 If this doesn't make any sense to you, just accept the default '$dflt'.
4462 rp='Try to understand large files, if available?'
4465 y|Y) val="$define" ;;
4472 case "$uselargefiles" in
4474 : Look for a hint-file generated 'call-back-unit'. If the
4475 : user has specified that a large files perl is to be built,
4476 : we may need to set or change some other defaults.
4477 if $test -f uselargefiles.cbu; then
4478 echo "Your platform has some specific hints for large file builds, using them..."
4479 . ./uselargefiles.cbu
4481 echo "Rechecking to see how big your file offsets are..." >&4
4483 #include <sys/types.h>
4487 printf("%d\n", (int)sizeof($lseektype));
4492 if eval $compile_ok; then
4494 $echo "Your file offsets are now $lseeksize bytes long."
4498 echo "(I can't seem to compile the test program. Guessing...)"
4499 rp="What is the size of your file offsets (in bytes)?"
4504 *_t) zzz="$fpostype" ;;
4507 $echo $n "Rechecking the size of $zzz...$c" >&4
4509 #include <sys/types.h>
4512 printf("%d\n", (int)sizeof($fpostype));
4517 if eval $compile_ok; then
4522 echo "(I can't execute the test program--guessing $fpossize.)" >&4
4525 echo " $fpossize bytes." >&4
4531 echo "(I can't compile the test program. Guessing...)" >&4
4532 rp="What is the size of your file positions (in bytes)?"
4542 case "$usemorebits" in
4543 "$define"|true|[yY]*)
4544 use64bitint="$define"
4545 uselongdouble="$define"
4546 usemorebits="$define"
4548 *) usemorebits="$undef"
4552 : check for void type
4554 echo "Checking to see how well your C compiler groks the void type..." >&4
4555 case "$voidflags" in
4557 $cat >try.c <<'EOCP'
4563 extern void moo(); /* function returning void */
4564 void (*goo)(); /* ptr to func returning void */
4566 void *hue; /* generic ptr */
4579 int main() { sub(); }
4581 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
4582 voidflags=$defvoidused
4583 echo "Good. It appears to support void to the level $package wants.">&4
4584 if $contains warning .out >/dev/null 2>&1; then
4585 echo "However, you might get some warnings that look like this:"
4589 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
4590 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
4591 echo "It supports 1..."
4592 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
4593 echo "It also supports 2..."
4594 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
4596 echo "And it supports 4 but not 8 definitely."
4598 echo "It doesn't support 4..."
4599 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
4601 echo "But it supports 8."
4604 echo "Neither does it support 8."
4608 echo "It does not support 2..."
4609 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
4611 echo "But it supports 4 and 8."
4613 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
4615 echo "And it supports 4 but has not heard about 8."
4617 echo "However it supports 8 but not 4."
4622 echo "There is no support at all for void."
4627 case "$voidflags" in
4630 Support flag bits are:
4631 1: basic void declarations.
4632 2: arrays of pointers to functions returning void.
4633 4: operations between pointers to and addresses of void functions.
4634 8: generic void pointers.
4637 rp="Your void support flags add up to what?"
4644 : check for length of pointer
4648 echo "Checking to see how big your pointers are..." >&4
4649 if test "$voidflags" -gt 7; then
4650 echo '#define VOID_PTR char *' > try.c
4652 echo '#define VOID_PTR void *' > try.c
4654 $cat >>try.c <<'EOCP'
4658 printf("%d\n", (int)sizeof(VOID_PTR));
4663 if eval $compile_ok; then
4665 echo "Your pointers are $ptrsize bytes long."
4668 echo "(I can't seem to compile the test program. Guessing...)" >&4
4669 rp="What is the size of a pointer (in bytes)?"
4677 : check for long long
4679 echo "Checking to see if you have long long..." >&4
4680 echo 'int main() { long long x = 7; return 0; }' > try.c
4682 if eval $compile; then
4684 echo "You have long long."
4687 echo "You do not have long long."
4693 : check for length of long long
4694 case "${d_longlong}${longlongsize}" in
4697 echo "Checking to see how big your long longs are..." >&4
4698 $cat >try.c <<'EOCP'
4702 printf("%d\n", (int)sizeof(long long));
4707 if eval $compile_ok; then
4708 longlongsize=`./try$exe_ext`
4709 echo "Your long longs are $longlongsize bytes long."
4713 echo "(I can't seem to compile the test program. Guessing...)"
4714 rp="What is the size of a long long (in bytes)?"
4718 if $test "X$longsize" = "X$longlongsize"; then
4719 echo "(That isn't any different from an ordinary long.)"
4725 : determine filename position in cpp output
4727 echo "Computing filename position in cpp output for #include directives..." >&4
4728 echo '#include <stdio.h>' > foo.c
4731 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
4732 $grep '^[ ]*#.*stdio\.h' | \
4733 while read cline; do
4736 while $test \$# -gt 0; do
4737 if $test -r \`echo \$1 | $tr -d '"'\`; then
4742 pos=\`expr \$pos + 1\`
4754 *) pos="${fieldn}th";;
4756 echo "Your cpp writes the filename in the $pos field of the line."
4758 : locate header file
4763 for usrincdir in $usrinc
4765 if test -f \$usrincdir/\$wanted; then
4766 echo "\$usrincdir/\$wanted"
4770 awkprg='{ print \$$fieldn }'
4771 echo "#include <\$wanted>" > foo\$\$.c
4772 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
4773 $grep "^[ ]*#.*\$wanted" | \
4774 while read cline; do
4775 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
4777 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
4778 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
4783 # status = 0: grep returned 0 lines, case statement not executed
4784 # status = 1: headerfile found
4785 # status = 2: while loop executed, no headerfile found
4789 if test \$status -eq 1; then
4796 : define an alternate in-header-list? function
4797 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
4798 cont=true; xxf="echo \"<\$1> found.\" >&4";
4799 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
4800 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
4802 case $# in 4) instead=instead;; *) instead="at last";; esac;
4803 while $test "$cont"; do
4805 var=$2; eval "was=\$$2";
4806 if $test "$xxx" && $test -r "$xxx";
4808 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
4811 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
4812 set $yyy; shift; shift; yyy=$@;
4813 case $# in 0) cont="";;
4814 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
4815 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
4816 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
4817 xxnf="echo \"there is no <\$1>, ...\" >&4";;
4821 do set $yyy; var=$2; eval "was=\$$2";
4822 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
4823 set $yyy; shift; shift; yyy=$@;
4826 : see if inttypes.h is available
4827 : we want a real compile instead of Inhdr because some systems
4828 : have an inttypes.h which includes non-existent headers
4831 #include <inttypes.h>
4833 static int32_t foo32 = 0x12345678;
4837 if eval $compile; then
4838 echo "<inttypes.h> found." >&4
4841 echo "<inttypes.h> NOT found." >&4
4850 echo "Checking to see if you have int64_t..." >&4
4852 #include <sys/types.h>
4853 #$i_inttypes I_INTTYPES
4855 #include <inttypes.h>
4857 int main() { int64_t x = 7; }
4860 if eval $compile; then
4862 echo "You have int64_t."
4865 echo "You do not have int64_t."
4873 echo "Checking which 64-bit integer type we could use..." >&4
4879 val='"unsigned int"'
4884 *) case "$longsize" in
4888 val='"unsigned long"'
4893 *) case "$d_longlong:$longlongsize" in
4898 val='"unsigned long long"'
4903 *) case "$d_int64_t" in
4922 '') echo "Alas, no 64-bit integer types in sight." >&4
4925 *) echo "We could use '$quadtype' for 64-bit integers." >&4
4931 case "$uselonglong" in
4932 "$define"|true|[yY]*)
4935 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
4937 use64bitint="$define"
4940 case "$use64bits" in
4941 "$define"|true|[yY]*)
4944 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
4946 use64bitint="$define"
4949 case "$use64bitints" in
4950 "$define"|true|[yY]*)
4953 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
4955 use64bitint="$define"
4958 case "$use64bitsint" in
4959 "$define"|true|[yY]*)
4962 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
4964 use64bitint="$define"
4967 case "$uselonglongs" in
4968 "$define"|true|[yY]*)
4971 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
4973 use64bitint="$define"
4976 case "$use64bitsall" in
4977 "$define"|true|[yY]*)
4980 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
4982 use64bitall="$define"
4987 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
4989 case "$use64bitall" in
4990 "$define"|true|[yY]*) use64bitint="$define" ;;
4996 You have natively 64-bit long integers.
5000 *) case "$use64bitint" in
5001 "$define"|true|[yY]*) dflt='y';;
5010 Perl can be built to take advantage of 64-bit integer types
5011 on some systems. To do so, Configure can be run with -Duse64bitint.
5012 Choosing this option will most probably introduce binary incompatibilities.
5014 If this doesn't make any sense to you, just accept the default '$dflt'.
5015 (The default has been chosen based on your configuration.)
5017 rp='Try to use 64-bit integers, if available?'
5020 [yY]*) val="$define" ;;
5028 case "$use64bitall" in
5029 "$define"|true|[yY]*) dflt='y' ;;
5030 *) case "$longsize" in
5038 You may also choose to try maximal 64-bitness. It means using as much
5039 64-bitness as possible on the platform. This in turn means even more
5040 binary incompatibilities. On the other hand, your platform may not
5041 have any more 64-bitness available than what you already have chosen.
5043 If this doesn't make any sense to you, just accept the default '$dflt'.
5044 (The default has been chosen based on your configuration.)
5046 rp='Try to use maximal 64-bit support, if available?'
5049 [yY]*) val="$define" ;;
5054 case "$use64bitall" in
5056 case "$use64bitint" in
5060 Since you have chosen a maximally 64-bit build, I'm also turning on
5061 the use of 64-bit integers.
5063 use64bitint="$define" ;;
5068 case "$use64bitall" in
5069 "$define"|true|[yY]*)
5073 *** You have chosen a maximally 64-bit build, but your pointers
5074 *** are only 4 bytes wide, disabling maximal 64-bitness.
5077 use64bitall="$undef"
5078 case "$use64bitint" in
5079 "$define"|true|[yY]*) ;;
5082 *** Downgrading from maximal 64-bitness to using 64-bit integers.
5085 use64bitint="$define"
5093 case "$use64bitint" in
5094 "$define"|true|[yY]*)
5095 : Look for a hint-file generated 'call-back-unit'. If the
5096 : user has specified that a 64-bit perl is to be built,
5097 : we may need to set or change some other defaults.
5098 if $test -f use64bitint.cbu; then
5099 echo "Your platform has some specific hints for 64-bit integers, using them..."
5103 4) case "$archname64" in
5104 '') archname64=64int ;;
5111 case "$use64bitall" in
5112 "$define"|true|[yY]*)
5113 : Look for a hint-file generated 'call-back-unit'. If the
5114 : user has specified that a maximally 64-bit perl is to be built,
5115 : we may need to set or change some other defaults.
5116 if $test -f use64bitall.cbu; then
5117 echo "Your platform has some specific hints for 64-bit builds, using them..."
5121 4) case "$archname64" in
5122 ''|64int) archname64=64all ;;
5130 echo "Checking for GNU C Library..." >&4
5131 cat >gnulibc.c <<EOM
5143 if eval $compile_ok && ./gnulibc; then
5145 echo "You are using the GNU C Library"
5148 echo "You are not using the GNU C Library"
5154 : see if nm is to be used to determine whether a symbol is defined or not
5158 case "$d_gnulibc" in
5161 echo "nm probably won't work on the GNU C Library." >&4
5167 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
5169 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
5170 echo "'nm' won't be sufficient on this sytem." >&4
5176 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
5177 if $test $dflt -gt 20; then
5187 true|$define) dflt=y;;
5194 I can use $nm to extract the symbols from your C libraries. This
5195 is a time consuming task which may generate huge output on the disk (up
5196 to 3 megabytes) but that should make the symbols extraction faster. The
5197 alternative is to skip the 'nm' extraction part and to compile a small
5198 test program instead to determine whether each symbol is present. If
5199 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
5200 this may be the best solution.
5202 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
5205 rp="Shall I use $nm to extract C symbols from the libraries?"
5208 [Nn]*) usenm=false;;
5217 : nm options which may be necessary
5219 '') if $test -f /mach_boot; then
5221 elif $test -d /usr/ccs/lib; then
5222 nm_opt='-p' # Solaris (and SunOS?)
5223 elif $test -f /dgux; then
5225 elif $test -f /lib64/rld; then
5226 nm_opt='-p' # 64-bit Irix
5232 : nm options which may be necessary for shared libraries but illegal
5233 : for archive libraries. Thank you, Linux.
5234 case "$nm_so_opt" in
5235 '') case "$myuname" in
5237 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
5238 nm_so_opt='--dynamic'
5247 : get list of predefined functions in a handy place
5252 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
5259 *) for thislib in $libs; do
5262 : Handle C library specially below.
5265 thislib=`echo $thislib | $sed -e 's/^-l//'`
5266 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
5268 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
5270 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
5272 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
5274 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
5276 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
5278 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
5283 libnames="$libnames $try"
5285 *) libnames="$libnames $thislib" ;;
5294 for xxx in $libpth; do
5295 $test -r $1 || set $xxx/libc.$so
5296 : The messy sed command sorts on library version numbers.
5298 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
5299 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
5301 s/[0-9][0-9]*/0000&/g
5302 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
5305 $sort | $sed -e 's/^.* //'`
5308 $test -r $1 || set /usr/ccs/lib/libc.$so
5309 $test -r $1 || set /lib/libsys_s$_a
5315 if $test -r "$1"; then
5316 echo "Your (shared) C library seems to be in $1."
5318 elif $test -r /lib/libc && $test -r /lib/clib; then
5319 echo "Your C library seems to be in both /lib/clib and /lib/libc."
5321 libc='/lib/clib /lib/libc'
5322 if $test -r /lib/syslib; then
5323 echo "(Your math library is in /lib/syslib.)"
5324 libc="$libc /lib/syslib"
5326 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5327 echo "Your C library seems to be in $libc, as you said before."
5328 elif $test -r $incpath/usr/lib/libc$_a; then
5329 libc=$incpath/usr/lib/libc$_a;
5330 echo "Your C library seems to be in $libc. That's fine."
5331 elif $test -r /lib/libc$_a; then
5333 echo "Your C library seems to be in $libc. You're normal."
5335 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
5337 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
5338 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
5339 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
5341 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5343 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5346 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
5348 if $test -r "$tans"; then
5349 echo "Your C library seems to be in $tans, of all places."
5355 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5359 If the guess above is wrong (which it might be if you're using a strange
5360 compiler, or your machine supports multiple models), you can override it here.
5365 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
5367 I can't seem to find your C library. I've looked in the following places:
5370 $sed 's/^/ /' libpath
5373 None of these seems to contain your C library. I need to get its name...
5378 rp='Where is your C library?'
5383 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
5384 set X `cat libnames`
5387 case $# in 1) xxx=file; esac
5388 echo "Extracting names from the following $xxx for later perusal:" >&4
5390 $sed 's/^/ /' libnames >&4
5392 $echo $n "This may take a while...$c" >&4
5396 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
5397 *) $nm $nm_opt $file 2>/dev/null;;
5402 $grep fprintf libc.tmp > libc.ptf
5403 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
5404 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
5406 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
5408 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5410 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
5412 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5414 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
5416 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5418 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
5420 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5422 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
5424 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5426 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
5428 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5430 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
5431 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
5433 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5435 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
5437 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5439 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
5441 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5443 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
5445 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5447 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
5449 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5451 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
5453 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5455 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
5457 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5459 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
5461 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5464 $nm -p $* 2>/dev/null >libc.tmp
5465 $grep fprintf libc.tmp > libc.ptf
5466 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
5467 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
5473 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
5475 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
5476 for thisname in $libnames $libc; do
5477 $ar t $thisname >>libc.tmp
5479 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
5481 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
5482 # Repeat libc to extract forwarders to DLL entries too
5483 for thisname in $libnames $libc; do
5484 $ar tv $thisname >>libc.tmp
5485 # Revision 50 of EMX has bug in $ar.
5486 # it will not extract forwarders to DLL entries
5487 # Use emximp which will extract exactly them.
5488 emximp -o tmp.imp $thisname \
5490 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
5491 < tmp.imp >>libc.tmp
5494 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
5497 echo "$ar didn't seem to work right." >&4
5498 echo "Maybe this is a Cray...trying bld instead..." >&4
5499 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
5501 for thisname in $libnames; do
5503 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
5504 $ar t $thisname >>libc.tmp
5508 echo "That didn't work either. Giving up." >&4
5515 if $test -f /lib/syscalls.exp; then
5517 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
5518 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*$/\1/p' /lib/syscalls.exp >>libc.list
5522 $rm -f libnames libpath
5524 : is a C symbol defined?
5527 -v) tf=libc.tmp; tc=""; tdc="";;
5528 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
5529 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
5532 case "$reuseval-$4" in
5534 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
5540 if $contains $tlook $tf >/dev/null 2>&1;
5545 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
5546 if $cc -o t $optimize $ccflags $ldflags t.c $libs >/dev/null 2>&1;
5554 $define) tval=true;;
5560 : define an is-in-libc? function
5561 inlibc='echo " "; td=$define; tu=$undef;
5562 sym=$1; var=$2; eval "was=\$$2";
5564 case "$reuseval$was" in
5574 echo "$sym() found." >&4;
5575 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
5577 echo "$sym() NOT found." >&4;
5578 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
5582 $define) echo "$sym() found." >&4;;
5583 *) echo "$sym() NOT found." >&4;;
5587 : see if sqrtl exists
5592 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
5595 case "$uselongdouble" in
5596 $define|true|[yY]*) dflt='y';;
5601 Perl can be built to take advantage of long doubles which
5602 (if available) may give more accuracy and range for floating point numbers.
5604 If this doesn't make any sense to you, just accept the default '$dflt'.
5606 rp='Try to use long doubles if available?'
5609 y|Y) val="$define" ;;
5615 case "$uselongdouble" in
5616 true|[yY]*) uselongdouble="$define" ;;
5619 case "$uselongdouble" in
5621 : Look for a hint-file generated 'call-back-unit'. If the
5622 : user has specified that long doubles should be used,
5623 : we may need to set or change some other defaults.
5624 if $test -f uselongdouble.cbu; then
5625 echo "Your platform has some specific hints for long doubles, using them..."
5626 . ./uselongdouble.cbu
5629 (Your platform doesn't have any specific hints for long doubles.)
5635 case "$uselongdouble:$d_sqrtl" in
5639 *** You requested the use of long doubles but you do not seem to have
5640 *** the mathematic functions for long doubles. I'm disabling the use
5641 *** of long doubles.
5644 uselongdouble=$undef
5648 : check for length of double
5650 case "$doublesize" in
5652 echo "Checking to see how big your double precision numbers are..." >&4
5653 $cat >try.c <<'EOCP'
5657 printf("%d\n", (int)sizeof(double));
5662 if eval $compile_ok; then
5664 echo "Your double is $doublesize bytes long."
5667 echo "(I can't seem to compile the test program. Guessing...)"
5668 rp="What is the size of a double precision number (in bytes)?"
5676 : check for long doubles
5678 echo "Checking to see if you have long double..." >&4
5679 echo 'int main() { long double x = 7.0; }' > try.c
5681 if eval $compile; then
5683 echo "You have long double."
5686 echo "You do not have long double."
5692 : check for length of long double
5693 case "${d_longdbl}${longdblsize}" in
5696 echo "Checking to see how big your long doubles are..." >&4
5697 $cat >try.c <<'EOCP'
5701 printf("%d\n", sizeof(long double));
5706 if eval $compile; then
5707 longdblsize=`./try$exe_ext`
5708 echo "Your long doubles are $longdblsize bytes long."
5712 echo "(I can't seem to compile the test program. Guessing...)" >&4
5713 rp="What is the size of a long double (in bytes)?"
5717 if $test "X$doublesize" = "X$longdblsize"; then
5718 echo "(That isn't any different from an ordinary double.)"
5724 case "$useperlio" in
5725 $define|true|[yY]*|'') dflt='y';;
5730 Previous version of $package used the standard IO mechanisms as
5731 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
5732 alternate IO mechanisms via the PerlIO abstraction layer, but the
5733 stdio mechanism is still available if needed. The abstraction layer
5734 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
5735 Using PerlIO with sfio may cause problems with some extension modules.
5737 If this doesn't make any sense to you, just accept the default '$dflt'.
5739 rp='Use the PerlIO abstraction layer?'
5746 echo "Ok, doing things the stdio way."
5755 case "$useperlio" in
5756 $define|true|[yY]*) ;;
5759 You are using the SOCKS proxy protocol library which means that you
5760 should also use the PerlIO layer. You may be headed for trouble.
5769 : determine the architecture name
5771 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5772 tarch=`arch`"-$osname"
5773 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5774 if uname -m > tmparch 2>&1 ; then
5775 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5776 -e 's/$/'"-$osname/" tmparch`
5784 case "$myarchname" in
5787 echo "(Your architecture name used to be $myarchname.)"
5794 *) dflt="$archname";;
5796 rp='What is your architecture name'
5799 case "$usethreads" in
5801 echo "Threads selected." >&4
5803 *-thread*) echo "...and architecture name already has -thread." >&4
5805 *) archname="$archname-thread"
5806 echo "...setting architecture name to $archname." >&4
5811 case "$usemultiplicity" in
5813 echo "Multiplicity selected." >&4
5815 *-multi*) echo "...and architecture name already has -multi." >&4
5817 *) archname="$archname-multi"
5818 echo "...setting architecture name to $archname." >&4
5823 case "$use64bitint$use64bitall" in
5825 case "$archname64" in
5827 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
5830 case "$use64bitint" in
5831 "$define") echo "64 bit integers selected." >&4 ;;
5833 case "$use64bitall" in
5834 "$define") echo "Maximal 64 bitness selected." >&4 ;;
5837 *-$archname64*) echo "...and architecture name already has $archname64." >&4
5839 *) archname="$archname-$archname64"
5840 echo "...setting architecture name to $archname." >&4
5846 case "$uselongdouble" in
5848 echo "Long doubles selected." >&4
5849 case "$longdblsize" in
5851 "...but long doubles are equal to doubles, not changing architecture name." >&4
5855 *-ld*) echo "...and architecture name already has -ld." >&4
5857 *) archname="$archname-ld"
5858 echo "...setting architecture name to $archname." >&4
5865 case "$useperlio" in
5867 echo "Perlio selected." >&4
5870 echo "Perlio not selected, using stdio." >&4
5872 *-stdio*) echo "...and architecture name already has -stdio." >&4
5874 *) archname="$archname-stdio"
5875 echo "...setting architecture name to $archname." >&4
5881 : determine root of directory hierarchy where package will be installed.
5884 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
5892 By default, $package will be installed in $dflt/bin, manual pages
5893 under $dflt/man, etc..., i.e. with $dflt as prefix for all
5894 installation directories. Typically this is something like /usr/local.
5895 If you wish to have binaries under /usr/bin but other parts of the
5896 installation under /usr/local, that's ok: you will be prompted
5897 separately for each of the installation directories, the prefix being
5898 only used to set the defaults.
5902 rp='Installation prefix to use?'
5910 *) oldprefix="$prefix";;
5920 $define|true) afs=true ;;
5921 $undef|false) afs=false ;;
5922 *) if test -d /afs; then
5930 echo "AFS may be running... I'll be extra cautious then..." >&4
5932 echo "AFS does not seem to be running..." >&4
5935 : determine installation prefix for where package is to be installed.
5939 Since you are running AFS, I need to distinguish the directory in which
5940 files will reside from the directory in which they are installed (and from
5941 which they are presumably copied to the former directory by occult means).
5944 case "$installprefix" in
5945 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
5946 *) dflt="$installprefix";;
5951 In some special cases, particularly when building $package for distribution,
5952 it is convenient to distinguish between the directory in which files should
5953 be installed from the directory ($prefix) in which they
5954 will eventually reside. For most users, these two directories are the same.
5957 case "$installprefix" in
5959 *) dflt=$installprefix;;
5963 rp='What installation prefix should I use for installing files?'
5965 installprefix="$ans"
5966 installprefixexp="$ansexp"
5968 : set the prefixit variable, to compute a suitable default value
5969 prefixit='case "$3" in
5971 case "$oldprefix" in
5972 "") eval "$1=\"\$$2\"";;
5979 ""|" ") eval "$1=\"\$$2\"";;
5985 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
5987 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
5988 /*-$oldprefix/*|\~*-$oldprefix/*)
5989 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
5990 *) eval "$1=\"\$$2\"";;
5995 : get the patchlevel
5997 echo "Getting the current patchlevel..." >&4
5998 if $test -r $rsrc/patchlevel.h;then
5999 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
6000 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
6001 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
6002 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
6003 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
6004 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
6005 perl_patchlevel=`grep ',"DEVEL[0-9][0-9]*"' $rsrc/patchlevel.h|sed 's/[^0-9]//g'`
6014 $echo "(You do not have patchlevel.h. Eek.)"
6016 if $test -r $rsrc/.patch ; then
6017 if $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
6018 perl_patchlevel=`cat $rsrc/.patch`
6021 case "$perl_patchlevel" in
6023 '') $echo "(You have $package version $patchlevel subversion $subversion.)" ;;
6024 *) $echo "(You have $package version $patchlevel subversion $subversion patchlevel $perl_patchlevel.)" ;;
6028 : XXX Should be a Configure test for double-dots in filenames.
6029 version=`echo $revision $patchlevel $subversion | \
6030 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
6031 api_versionstring=`echo $api_revision $api_version $api_subversion | \
6032 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
6035 version=`echo $revision $patchlevel $subversion | \
6036 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
6037 api_versionstring=`echo $api_revision $api_version $api_subversion | \
6038 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
6041 : Special case the 5.005_xx maintenance series, which used 5.005
6042 : without any subversion label as a subdirectory in $sitelib
6043 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
6044 api_versionstring='5.005'
6047 : determine installation style
6048 : For now, try to deduce it from prefix unless it is already set.
6049 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6050 case "$installstyle" in
6051 '') case "$prefix" in
6052 *perl*) dflt='lib';;
6053 *) dflt='lib/perl5' ;;
6056 *) dflt="$installstyle" ;;
6058 : Probably not worth prompting for this since we prompt for all
6059 : the directories individually, and the prompt would be too long and
6063 : determine where private library files go
6064 : Usual default is /usr/local/lib/perl5/$version.
6065 : Also allow things like /opt/perl/lib/$version, since
6066 : /opt/perl/lib/perl5... would be redundant.
6067 : The default "style" setting is made in installstyle.U
6068 case "$installstyle" in
6069 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6070 *) set dflt privlib lib/$version ;;
6075 There are some auxiliary files for $package that need to be put into a
6076 private library directory that is accessible by everyone.
6080 rp='Pathname where the private library files will reside?'
6083 privlibexp="$ansexp"
6084 : Change installation prefix, if necessary.
6085 if $test X"$prefix" != X"$installprefix"; then
6086 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
6088 installprivlib="$privlibexp"
6091 : set the prefixup variable, to restore leading tilda escape
6092 prefixup='case "$prefixexp" in
6094 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6097 : determine where public architecture dependent libraries go
6100 : privlib default is /usr/local/lib/$package/$version
6101 : archlib default is /usr/local/lib/$package/$version/$archname
6102 : privlib may have an optional trailing /share.
6103 tdflt=`echo $privlib | $sed 's,/share$,,'`
6104 tdflt=$tdflt/$archname
6113 $spackage contains architecture-dependent library files. If you are
6114 sharing libraries in a heterogeneous environment, you might store
6115 these files in a separate location. Otherwise, you can just include
6116 them with the rest of the public library files.
6120 rp='Where do you want to put the public architecture-dependent libraries?'
6123 archlibexp="$ansexp"
6124 if $test X"$archlib" = X"$privlib"; then
6129 : Change installation prefix, if necessary.
6130 if $test X"$prefix" != X"$installprefix"; then
6131 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
6133 installarchlib="$archlibexp"
6137 : Binary compatibility with 5.005 is not possible for builds
6138 : with advanced features
6139 case "$usethreads$usemultiplicity" in
6141 bincompat5005="$undef"
6142 d_bincompat5005="$undef"
6146 This version of Perl can be compiled for binary compatibility with 5.005.
6147 If you decide to do so, you will be able to continue using most of the
6148 extensions that were compiled for Perl 5.005.
6151 case "$bincompat5005$d_bincompat5005" in
6152 *"$undef"*) dflt=n ;;
6155 rp='Binary compatibility with Perl 5.005?'
6158 y*) val="$define" ;;
6163 case "$d_bincompat5005" in
6165 bincompat5005="$define"
6167 *) bincompat5005="$undef"
6168 d_bincompat5005="$undef"
6175 : see if setuid scripts can be secure
6178 Some kernels have a bug that prevents setuid #! scripts from being
6179 secure. Some sites have disabled setuid #! scripts because of this.
6181 First let's decide if your kernel supports secure setuid #! scripts.
6182 (If setuid #! scripts would be secure but have been disabled anyway,
6183 don't say that they are secure if asked.)
6188 if $test -d /dev/fd; then
6189 echo "#!$ls" >reflect
6190 chmod +x,u+s reflect
6191 ./reflect >flect 2>&1
6192 if $contains "/dev/fd" flect >/dev/null; then
6193 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6197 If you are not sure if they are secure, I can check but I'll need a
6198 username and password different from the one you are using right now.
6199 If you don't have such a username or don't want me to test, simply
6203 rp='Other username to test security of setuid scripts with?'
6208 case "$d_suidsafe" in
6209 '') echo "I'll assume setuid scripts are *not* secure." >&4
6212 echo "Well, the $hint value is *not* secure." >&4
6214 *) echo "Well, the $hint value *is* secure." >&4
6219 $rm -f reflect flect
6220 echo "#!$ls" >reflect
6221 chmod +x,u+s reflect
6224 echo '"su" will (probably) prompt you for '"$ans's password."
6225 su $ans -c './reflect >flect'
6226 if $contains "/dev/fd" flect >/dev/null; then
6227 echo "Okay, it looks like setuid scripts are secure." >&4
6230 echo "I don't think setuid scripts are secure." >&4
6235 rp='Does your kernel have *secure* setuid scripts?'
6238 [yY]*) val="$define";;
6243 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6244 echo "(That's for file descriptors, not floppy disks.)"
6250 $rm -f reflect flect
6252 : now see if they want to do setuid emulation
6255 case "$d_suidsafe" in
6258 echo "No need to emulate SUID scripts since they are secure here." >& 4
6262 Some systems have disabled setuid scripts, especially systems where
6263 setuid scripts cannot be secure. On systems where setuid scripts have
6264 been disabled, the setuid/setgid bits on scripts are currently
6265 useless. It is possible for $package to detect those bits and emulate
6266 setuid/setgid in a secure fashion. This emulation will only work if
6267 setuid scripts have been disabled in your kernel.
6271 "$define") dflt=y ;;
6274 rp="Do you want to do setuid/setgid emulation?"
6277 [yY]*) val="$define";;
6285 : see if this is a malloc.h system
6286 set malloc.h i_malloc
6289 : see if stdlib is available
6290 set stdlib.h i_stdlib
6293 : determine which malloc to compile in
6295 case "$usemymalloc" in
6296 [yY]*|true|$define) dflt='y' ;;
6297 [nN]*|false|$undef) dflt='n' ;;
6298 *) case "$ptrsize" in
6304 rp="Do you wish to attempt to use the malloc that comes with $package?"
6310 mallocsrc='malloc.c'
6311 mallocobj="malloc$_o"
6312 d_mymalloc="$define"
6315 : Remove malloc from list of libraries to use
6316 echo "Removing unneeded -lmalloc from library list" >&4
6317 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6320 echo "libs = $libs" >&4
6332 : compute the return types of malloc and free
6334 $cat >malloc.c <<END
6338 #include <sys/types.h>
6352 case "$malloctype" in
6354 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6361 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6365 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6372 echo "Your system uses $freetype free(), it would seem." >&4
6376 After $package is installed, you may wish to install various
6377 add-on modules and utilities. Typically, these add-ons will
6378 be installed under $prefix with the rest
6379 of this package. However, you may wish to install such add-ons
6380 elsewhere under a different prefix.
6382 If you do not wish to put everything under a single prefix, that's
6383 ok. You will be prompted for the individual locations; this siteprefix
6384 is only used to suggest the defaults.
6386 The default should be fine for most people.
6390 rp='Installation prefix to use for add-on modules and utilities?'
6391 : XXX Here might be another good place for an installstyle setting.
6392 case "$siteprefix" in
6394 *) dflt=$siteprefix ;;
6397 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6399 case "$siteprefix" in
6403 *) oldsiteprefix="$prefix";;
6408 siteprefixexp="$ansexp"
6410 : determine where site specific libraries go.
6411 : Usual default is /usr/local/lib/perl5/site_perl/$version
6412 : The default "style" setting is made in installstyle.U
6413 : XXX No longer works with Prefixit stuff.
6414 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6416 '') case "$installstyle" in
6417 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6418 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6426 The installation process will create a directory for
6427 site-specific extensions and modules. Most users find it convenient
6428 to place all site-specific files in this directory rather than in the
6429 main distribution directory.
6433 rp='Pathname for the site-specific library files?'
6436 sitelibexp="$ansexp"
6437 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6438 : Change installation prefix, if necessary.
6439 if $test X"$prefix" != X"$installprefix"; then
6440 installsitelib=`echo $sitelibexp | $sed "s#^$prefix#$installprefix#"`
6442 installsitelib="$sitelibexp"
6445 : determine where site specific architecture-dependent libraries go.
6446 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6447 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6448 : sitelib may have an optional trailing /share.
6450 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6451 dflt="$dflt/$archname"
6456 set sitearch sitearch none
6460 The installation process will also create a directory for
6461 architecture-dependent site-specific extensions and modules.
6465 rp='Pathname for the site-specific architecture-dependent library files?'
6468 sitearchexp="$ansexp"
6469 : Change installation prefix, if necessary.
6470 if $test X"$prefix" != X"$installprefix"; then
6471 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
6473 installsitearch="$sitearchexp"
6478 The installation process will also create a directory for
6479 vendor-supplied add-ons. Vendors who supply perl with their system
6480 may find it convenient to place all vendor-supplied files in this
6481 directory rather than in the main distribution directory. This will
6482 ease upgrades between binary-compatible maintenance versions of perl.
6484 Of course you may also use these directories in whatever way you see
6485 fit. For example, you might use them to access modules shared over a
6486 company-wide network.
6488 The default answer should be fine for most people.
6489 This causes further questions about vendor add-ons to be skipped
6490 and no vendor-specific directories will be configured for perl.
6493 rp='Do you want to configure vendor-specific add-on directories?'
6494 case "$usevendorprefix" in
6495 define|true|[yY]*) dflt=y ;;
6496 *) : User may have set vendorprefix directly on Configure command line.
6497 case "$vendorprefix" in
6506 rp='Installation prefix to use for vendor-supplied add-ons?'
6507 case "$vendorprefix" in
6509 *) dflt=$vendorprefix ;;
6512 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6514 case "$vendorprefix" in
6518 *) oldvendorprefix="$prefix";;
6522 usevendorprefix="$define"
6524 vendorprefixexp="$ansexp"
6526 *) usevendorprefix="$undef"
6532 case "$vendorprefix" in
6533 '') d_vendorlib="$undef"
6537 *) d_vendorlib="$define"
6538 : determine where vendor-supplied modules go.
6539 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6540 case "$vendorlib" in
6542 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6543 case "$installstyle" in
6544 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6545 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6548 *) dflt="$vendorlib"
6552 rp='Pathname for the vendor-supplied library files?'
6555 vendorlibexp="$ansexp"
6558 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6559 : Change installation prefix, if necessary.
6560 if $test X"$prefix" != X"$installprefix"; then
6561 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
6563 installvendorlib="$vendorlibexp"
6566 case "$vendorprefix" in
6567 '') d_vendorarch="$undef"
6571 *) d_vendorarch="$define"
6572 : determine where vendor-supplied architecture-dependent libraries go.
6573 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6574 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6575 : vendorlib may have an optional trailing /share.
6576 case "$vendorarch" in
6577 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6578 dflt="$dflt/$archname"
6580 *) dflt="$vendorarch" ;;
6583 rp='Pathname for vendor-supplied architecture-dependent files?'
6586 vendorarchexp="$ansexp"
6589 : Change installation prefix, if necessary.
6590 if $test X"$prefix" != X"$installprefix"; then
6591 installvendorarch=`echo $vendorarchexp | sed "s#^$prefix#$installprefix#"`
6593 installvendorarch="$vendorarchexp"
6596 : Final catch-all directories to search
6599 Lastly, you can have perl look in other directories for extensions and
6600 modules in addition to those already specified.
6601 These directories will be searched after
6605 test X"$vendorlib" != "X" && echo ' ' $vendorlib
6606 test X"$vendorarch" != "X" && echo ' ' $vendorarch
6608 case "$otherlibdirs" in
6609 ''|' ') dflt='none' ;;
6610 *) dflt="$otherlibdirs" ;;
6613 Enter a colon-separated set of extra paths to include in perl's @INC
6614 search path, or enter 'none' for no extra paths.
6618 rp='Colon-separated list of additional directories for perl to search?'
6621 ' '|''|none) otherlibdirs=' ' ;;
6622 *) otherlibdirs="$ans" ;;
6624 case "$otherlibdirs" in
6628 set d_perl_otherlibdirs
6631 : Cruising for prototypes
6633 echo "Checking out function prototypes..." >&4
6634 $cat >prototype.c <<'EOCP'
6635 int main(int argc, char *argv[]) {
6638 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
6639 echo "Your C compiler appears to support function prototypes."
6642 echo "Your C compiler doesn't seem to understand function prototypes."
6649 case "$prototype" in
6651 *) ansi2knr='ansi2knr'
6656 This version of $package can only be compiled by a compiler that
6657 understands function prototypes. Unfortunately, your C compiler
6659 doesn't seem to understand them. Sorry about that.
6661 If GNU cc is available for your system, perhaps you could try that instead.
6663 Eventually, we hope to support building Perl with pre-ANSI compilers.
6664 If you would like to help in that effort, please contact <perlbug@perl.org>.
6666 Aborting Configure now.
6672 : determine where public executables go
6677 rp='Pathname where the public executables will reside?'
6679 if $test "X$ansexp" != "X$binexp"; then
6684 : Change installation prefix, if necessary.
6685 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6686 if $test X"$prefix" != X"$installprefix"; then
6687 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
6689 installbin="$binexp"
6692 : Find perl5.005 or later.
6693 echo "Looking for a previously installed perl5.005 or later... "
6695 '') for tdir in `echo "$binexp:$PATH" | $sed "s/$path_sep/ /g"`; do
6696 : Check if this perl is recent and can load a simple module
6697 if $test -x $tdir/perl && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6700 elif $test -x $tdir/perl5 && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6710 '') echo "None found. That's ok.";;
6711 *) echo "Using $perl5." ;;
6714 : Determine list of previous versions to include in @INC
6715 $cat > getverlist <<EOPL
6718 \$api_versionstring = "$api_versionstring";
6719 \$version = "$version";
6720 \$stem = "$sitelib_stem";
6721 \$archname = "$archname";
6723 $cat >> getverlist <<'EOPL'
6724 # Can't have leading @ because metaconfig interprets it as a command!
6725 ;@inc_version_list=();
6726 # XXX Redo to do opendir/readdir?
6729 ;@candidates = glob("5.*");
6735 # XXX ToDo: These comparisons must be reworked when two-digit
6736 # subversions come along, so that 5.7.10 compares as greater than
6737 # 5.7.3! By that time, hope that 5.6.x is sufficiently
6738 # widespread that we can use the built-in version vectors rather
6739 # than reinventing them here. For 5.6.0, however, we must
6740 # assume this script will likely be run by 5.005_0x. --AD 1/2000.
6741 foreach $d (@candidates) {
6742 if ($d lt $version) {
6743 if ($d ge $api_versionstring) {
6744 unshift(@inc_version_list, grep { -d } "$d/$archname", $d);
6746 elsif ($d ge "5.005") {
6747 unshift(@inc_version_list, grep { -d } $d);
6751 # Skip newer version. I.e. don't look in
6752 # 5.7.0 if we're installing 5.6.1.
6756 if (@inc_version_list) {
6757 print join(' ', @inc_version_list);
6760 # Blank space to preserve value for next Configure run.
6765 case "$inc_version_list" in
6766 '') if test -x "$perl5"; then
6767 dflt=`$perl5 getverlist`
6772 $undef) dflt='none' ;;
6773 *) dflt="$inc_version_list" ;;
6776 ''|' ') dflt=none ;;
6779 5.005) case "$bincompat5005" in
6780 $define|true|[yY]*) ;;
6787 In order to ease the process of upgrading, this version of perl
6788 can be configured to use modules built and installed with earlier
6789 versions of perl that were installed under $prefix. Specify here
6790 the list of earlier versions that this version of perl should check.
6791 If Configure detected no earlier versions of perl installed under
6792 $prefix, then the list will be empty. Answer 'none' to tell perl
6793 to not search earlier versions.
6795 The default should almost always be sensible, so if you're not sure,
6796 just accept the default.
6799 rp='List of earlier versions to include in @INC?'
6802 [Nn]one|''|' ') inc_version_list=' ' ;;
6803 *) inc_version_list="$ans" ;;
6805 case "$inc_version_list" in
6807 inc_version_list_init='0';;
6808 *) inc_version_list_init=`echo $inc_version_list |
6809 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6814 : determine whether to install perl also as /usr/bin/perl
6817 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
6819 Many scripts expect perl to be installed as /usr/bin/perl.
6820 I can install the perl you are about to compile also as /usr/bin/perl
6821 (in addition to $installbin/perl).
6823 case "$installusrbinperl" in
6824 "$undef"|[nN]*) dflt='n';;
6827 rp="Do you want to install perl as /usr/bin/perl?"
6830 [yY]*) val="$define";;
6836 set installusrbinperl
6839 : see if dld is available
6843 : see if dlopen exists
6850 : determine which dynamic loading, if any, to compile in
6852 dldir="ext/DynaLoader"
6865 $define) dflt='y' ;;
6868 $define) dflt='y' ;;
6870 : Does a dl_xxx.xs file exist for this operating system
6871 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
6874 rp="Do you wish to use dynamic loading?"
6881 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
6882 dflt="$dldir/dl_${osname}.xs"
6883 elif $test "$d_dlopen" = "$define" ; then
6884 dflt="$dldir/dl_dlopen.xs"
6885 elif $test "$i_dld" = "$define" ; then
6886 dflt="$dldir/dl_dld.xs"
6891 *) dflt="$dldir/$dlsrc"
6894 echo "The following dynamic loading files are available:"
6895 : Can not go over to $dldir because getfile has path hard-coded in.
6896 tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir
6897 rp="Source file to use for dynamic loading"
6903 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
6907 Some systems may require passing special flags to $cc -c to
6908 compile modules that will be used to create a shared library.
6909 To use no flags, say "none".
6912 case "$cccdlflags" in
6913 '') case "$gccversion" in
6914 '') case "$osname" in
6916 next) dflt='none' ;;
6917 irix*) dflt='-KPIC' ;;
6918 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
6919 sunos) dflt='-pic' ;;
6923 *) case "$osname" in
6924 svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
6929 *) dflt="$cccdlflags" ;;
6931 rp="Any special flags to pass to $cc -c to compile shared library modules?"
6934 none) cccdlflags=' ' ;;
6935 *) cccdlflags="$ans" ;;
6940 Some systems use ld to create libraries that can be dynamically loaded,
6941 while other systems (such as those using ELF) use $cc.
6945 '') $cat >try.c <<'EOM'
6946 /* Test for whether ELF binaries are produced */
6951 int i = open("a.out",O_RDONLY);
6954 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
6955 exit(0); /* succeed (yes, it's ELF) */
6960 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && ./a.out; then
6962 You appear to have ELF support. I'll use $cc to build dynamic libraries.
6966 echo "I'll use ld to build dynamic libraries."
6975 rp="What command should be used to create dynamic libraries?"
6981 Some systems may require passing special flags to $ld to create a
6982 library that can be dynamically loaded. If your ld flags include
6983 -L/other/path options to locate libraries outside your loader's normal
6984 search path, you may need to specify those -L options here as well. To
6985 use no flags, say "none".
6988 case "$lddlflags" in
6989 '') case "$osname" in
6990 beos) dflt='-nostart' ;;
6992 case "$gccversion" in
6993 '') dflt="$dflt +vnocompatwarnings" ;;
6996 linux|irix*) dflt='-shared' ;;
6997 next) dflt='none' ;;
6998 solaris) dflt='-G' ;;
6999 sunos) dflt='-assert nodefinitions' ;;
7000 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
7004 *) dflt="$lddlflags" ;;
7007 : Try to guess additional flags to pick up local libraries.
7008 : Be careful not to append to a plain 'none'
7012 for thisflag in $ldflags; do
7017 *) dflt="$dflt $thisflag" ;;
7024 ''|' ') dflt='none' ;;
7027 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
7030 none) lddlflags=' ' ;;
7031 *) lddlflags="$ans" ;;
7036 Some systems may require passing special flags to $cc to indicate that
7037 the resulting executable will use dynamic linking. To use no flags,
7041 case "$ccdlflags" in
7042 '') case "$osname" in
7043 hpux) dflt='-Wl,-E' ;;
7044 linux) dflt='-rdynamic' ;;
7045 next) dflt='none' ;;
7046 sunos) dflt='none' ;;
7050 *) dflt="$ccdlflags" ;;
7052 rp="Any special flags to pass to $cc to use dynamic linking?"
7055 none) ccdlflags=' ' ;;
7056 *) ccdlflags="$ans" ;;
7070 # No dynamic loading being used, so don't bother even to prompt.
7073 *) case "$useshrplib" in
7074 '') case "$osname" in
7075 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
7077 also='Building a shared libperl is required for dynamic loading to work on your system.'
7082 also='Building a shared libperl is needed for MAB support.'
7100 The perl executable is normally obtained by linking perlmain.c with
7101 libperl${_a}, any static extensions (usually just DynaLoader), and
7102 any other libraries needed on this system (such as -lm, etc.). Since
7103 your system supports dynamic loading, it is probably possible to build
7104 a shared libperl.$so. If you will have more than one executable linked
7105 to libperl.$so, this will significantly reduce the size of each
7106 executable, but it may have a noticeable affect on performance. The
7107 default is probably sensible for your system.
7111 rp="Build a shared libperl.$so (y/n)"
7115 useshrplib='true' ;;
7116 *) useshrplib='false' ;;
7121 case "$useshrplib" in
7125 # Figure out a good name for libperl.so. Since it gets stored in
7126 # a version-specific architecture-dependent library, the version
7127 # number isn't really that important, except for making cc/ld happy.
7129 # A name such as libperl.so.3.1
7130 majmin="libperl.$so.$patchlevel.$subversion"
7131 # A name such as libperl.so.301
7132 majonly=`echo $patchlevel $subversion |
7133 $awk '{printf "%d%02d", $1, $2}'`
7134 majonly=libperl.$so.$majonly
7135 # I'd prefer to keep the os-specific stuff here to a minimum, and
7136 # rely on figuring it out from the naming of libc.
7137 case "${osname}${osvers}" in
7140 # XXX How handle the --version stuff for MAB?
7142 linux*) # ld won't link with a bare -lperl otherwise.
7145 cygwin*) # include version
7146 dflt=`echo libperl$version | sed -e 's/\./_/g'`$lib_ext
7148 *) # Try to guess based on whether libc has major.minor.
7150 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
7151 *libc.$so.[0-9]*) dflt=$majonly ;;
7152 *) dflt=libperl.$so ;;
7162 I need to select a good name for the shared libperl. If your system uses
7163 library names with major and minor numbers, then you might want something
7164 like $majmin. Alternatively, if your system uses a single version
7165 number for shared libraries, then you might want to use $majonly.
7166 Or, your system might be quite happy with a simple libperl.$so.
7168 Since the shared libperl will get installed into a version-specific
7169 architecture-dependent directory, the version number of the shared perl
7170 library probably isn't important, so the default should be o.k.
7173 rp='What name do you want to give to the shared libperl?'
7176 echo "Ok, I'll use $libperl"
7179 libperl="libperl${_a}"
7183 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
7187 WARNING: Use of the shrpdir variable for the installation location of
7188 the shared $libperl is not supported. It was never documented and
7189 will not work in this version. Let me (perlbug@perl.org)
7190 know of any problems this may cause.
7196 But your current setting of $shrpdir is
7197 the default anyway, so it's harmless.
7202 Further, your current attempted setting of $shrpdir
7203 conflicts with the value of $archlibexp/CORE
7204 that installperl will use.
7211 # How will the perl executable find the installed shared $libperl?
7212 # Add $xxx to ccdlflags.
7213 # If we can't figure out a command-line option, use $shrpenv to
7214 # set env LD_RUN_PATH. The main perl makefile uses this.
7215 shrpdir=$archlibexp/CORE
7218 if "$useshrplib"; then
7221 # We'll set it in Makefile.SH...
7227 xxx="-Wl,-R$shrpdir"
7229 linux|irix*|dec_osf)
7230 xxx="-Wl,-rpath,$shrpdir"
7233 # next doesn't like the default...
7236 # beos doesn't like the default, either.
7239 # hpux doesn't like the default, either.
7240 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
7243 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
7249 # Only add $xxx if it isn't already in ccdlflags.
7250 case " $ccdlflags " in
7252 *) ccdlflags="$ccdlflags $xxx"
7255 Adding $xxx to the flags
7256 passed to $ld so that the perl executable will find the
7257 installed shared $libperl.
7265 # Fix ccdlflags in AIX for building external extensions.
7266 # (For building Perl itself bare -bE:perl.exp is needed,
7267 # Makefile.SH takes care of this.)
7269 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
7271 # Respect a hint or command-line value.
7273 '') shrpenv="$tmp_shrpenv" ;;
7275 case "$ldlibpthname" in
7276 '') ldlibpthname=LD_LIBRARY_PATH ;;
7277 none) ldlibpthname='' ;;
7280 : determine where manual pages are on this system
7284 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
7285 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
7286 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
7287 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
7288 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
7289 sysman=`./loc . /usr/man/man1 $syspath`
7292 if $test -d "$sysman"; then
7293 echo "System manual is in $sysman." >&4
7295 echo "Could not find manual pages in source form." >&4
7298 : determine where manual pages go
7299 set man1dir man1dir none
7303 $spackage has manual pages available in source form.
7307 echo "However, you don't have nroff, so they're probably useless to you."
7309 '') man1dir="none";;
7312 echo "If you don't want the manual sources installed, answer 'none'."
7317 lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
7318 lookpath="$lookpath $prefixexp/man/p_man/man1"
7319 lookpath="$lookpath $prefixexp/man/u_man/man1"
7320 lookpath="$lookpath $prefixexp/man/man.1"
7322 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
7323 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
7333 rp="Where do the main $spackage manual pages (source) go?"
7335 if $test "X$man1direxp" != "X$ansexp"; then
7339 man1direxp="$ansexp"
7345 : Change installation prefix, if necessary.
7346 if $test X"$prefix" != X"$installprefix"; then
7347 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
7349 installman1dir="$man1direxp"
7352 : What suffix to use on installed man pages
7359 rp="What suffix should be used for the main $spackage man pages?"
7361 '') case "$man1dir" in
7375 *) dflt="$man1ext";;
7382 : see if we can have long filenames
7384 first=123456789abcdef
7386 if (echo hi >$first) 2>/dev/null; then
7387 if $test -f 123456789abcde; then
7388 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
7391 echo 'You can have filenames longer than 14 characters.'>&4
7396 You can't have filenames longer than 14 chars.
7397 You can't even think about them!
7403 $rm -rf 123456789abcde*
7405 : determine where library module manual pages go
7406 set man3dir man3dir none
7410 $spackage has manual pages for many of the library modules.
7416 However, you don't have nroff, so they're probably useless to you.
7419 '') man3dir="none";;
7423 case "$d_flexfnam" in
7426 However, your system can't handle the long file names like File::Basename.3.
7429 '') man3dir="none";;
7433 echo "If you don't want the manual sources installed, answer 'none'."
7434 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7436 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
7437 if $test -d "$privlib/man/man3"; then
7440 WARNING: Previous versions of perl installed man3 pages into
7441 $privlib/man/man3. This version will suggest a
7442 new default of $dflt.
7446 rp='Do you wish to preserve the old behavior?(y/n)'
7449 y*) dflt="$privlib/man/man3" ;;
7454 *) dflt="$man3dir" ;;
7461 rp="Where do the $package library man pages (source) go?"
7464 man3direxp="$ansexp"
7470 : Change installation prefix, if necessary.
7471 if $test X"$prefix" != X"$installprefix"; then
7472 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
7474 installman3dir="$man3direxp"
7477 : What suffix to use on installed man pages
7483 rp="What suffix should be used for the $package library man pages?"
7485 '') case "$man3dir" in
7499 *) dflt="$man3ext";;
7506 : see if we have to deal with yellow pages, now NIS.
7507 if $test -d /usr/etc/yp || $test -d /etc/yp; then
7508 if $test -f /usr/etc/nibindd; then
7510 echo "I'm fairly confident you're on a NeXT."
7512 rp='Do you get the hosts file via NetInfo?'
7521 y*) hostcat='nidump hosts .';;
7522 *) case "$hostcat" in
7523 nidump*) hostcat='';;
7533 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
7541 rp='Are you getting the hosts file via yellow pages?'
7544 y*) hostcat='ypcat hosts';;
7545 *) hostcat='cat /etc/hosts';;
7551 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
7554 '') test -f /etc/group && groupcat='cat /etc/group';;
7557 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
7560 : now get the host name
7562 echo "Figuring out host name..." >&4
7563 case "$myhostname" in
7565 echo 'Maybe "hostname" will work...'
7566 if tans=`sh -c hostname 2>&1` ; then
7574 if $test "$cont"; then
7576 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
7577 if tans=`cat /etc/systemid 2>&1` ; then
7579 phostname='cat /etc/systemid'
7580 echo "Whadyaknow. Xenix always was a bit strange..."
7583 elif $test -r /etc/systemid; then
7584 echo "(What is a non-Xenix system doing with /etc/systemid?)"
7587 if $test "$cont"; then
7588 echo 'No, maybe "uuname -l" will work...'
7589 if tans=`sh -c 'uuname -l' 2>&1` ; then
7591 phostname='uuname -l'
7593 echo 'Strange. Maybe "uname -n" will work...'
7594 if tans=`sh -c 'uname -n' 2>&1` ; then
7596 phostname='uname -n'
7598 echo 'Oh well, maybe I can mine it out of whoami.h...'
7599 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
7600 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
7601 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
7603 case "$myhostname" in
7604 '') echo "Does this machine have an identity crisis or something?"
7607 echo "Well, you said $myhostname before..."
7608 phostname='echo $myhostname';;
7614 : you do not want to know about this
7619 if $test "$myhostname" ; then
7621 rp='Your host name appears to be "'$myhostname'".'" Right?"
7629 : bad guess or no guess
7630 while $test "X$myhostname" = X ; do
7632 rp="Please type the (one word) name of your host:"
7637 : translate upper to lower if necessary
7638 case "$myhostname" in
7640 echo "(Normalizing case in your host name)"
7641 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
7645 case "$myhostname" in
7647 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
7648 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
7649 echo "(Trimming domain name from host name--host name is now $myhostname)"
7651 *) case "$mydomain" in
7654 test "X$hostcat" = "Xypcat hosts" &&
7655 ypmatch "$myhostname" hosts 2>/dev/null |\
7656 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
7659 test "X$hostcat" != "X" &&
7660 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
7661 /[ ]$myhostname[ . ]/p" > hosts
7664 if $test -f hosts; then
7665 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
7666 END { print sum }" hosts` = x1 || tmp_re="[ ]"
7667 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
7668 hosts | $sort | $uniq | \
7669 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
7670 case `$echo X$dflt` in
7671 X*\ *) echo "(Several hosts in the database matched hostname)"
7674 X.) echo "(You do not have fully-qualified names in the hosts database)"
7678 echo "(I cannot locate a hosts database anywhere)"
7683 tans=`./loc resolv.conf X /etc /usr/etc`
7684 if $test -f "$tans"; then
7685 echo "(Attempting domain name extraction from $tans)"
7686 dflt=.`$sed -n -e 's/ / /g' \
7687 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
7688 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
7690 .) dflt=.`$sed -n -e 's/ / /g' \
7691 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
7692 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
7699 .) echo "(No help from resolv.conf either -- attempting clever guess)"
7700 dflt=.`sh -c domainname 2>/dev/null`
7703 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
7707 case "$dflt$osname" in
7708 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
7709 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
7713 .) echo "(Lost all hope -- silly guess then)"
7719 *) dflt="$mydomain";;
7723 rp="What is your domain name?"
7733 : translate upper to lower if necessary
7736 echo "(Normalizing case in your domain name)"
7737 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
7741 : a little sanity check here
7742 case "$phostname" in
7745 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
7746 $myhostname$mydomain|$myhostname) ;;
7748 case "$phostname" in
7750 echo "(That doesn't agree with your whoami.h file, by the way.)"
7753 echo "(That doesn't agree with your $phostname command, by the way.)"
7763 I need to get your e-mail address in Internet format if possible, i.e.
7764 something like user@host.domain. Please answer accurately since I have
7765 no easy means to double check it. The default value provided below
7766 is most probably close to reality but may not be valid from outside
7767 your organization...
7771 while test "$cont"; do
7773 '') dflt="$cf_by@$myhostname$mydomain";;
7774 *) dflt="$cf_email";;
7776 rp='What is your e-mail address?'
7782 rp='Address does not look like an Internet one. Use it anyway?'
7798 If you or somebody else will be maintaining perl at your site, please
7799 fill in the correct e-mail address here so that they may be contacted
7800 if necessary. Currently, the "perlbug" program included with perl
7801 will send mail to this address in addition to perlbug@perl.org. You may
7802 enter "none" for no administrator.
7805 case "$perladmin" in
7806 '') dflt="$cf_email";;
7807 *) dflt="$perladmin";;
7809 rp='Perl administrator e-mail address'
7813 : determine whether to only install version-specific parts.
7816 Do you want to install only the version-specific parts of the perl
7817 distribution? Usually you do *not* want to do this.
7819 case "$versiononly" in
7820 "$define"|[Yy]*|true) dflt='y' ;;
7823 rp="Do you want to install only the version-specific parts of perl?"
7826 [yY]*) val="$define";;
7832 : figure out how to guarantee perl startup
7833 case "$startperl" in
7835 case "$sharpbang" in
7839 I can use the #! construct to start perl on your system. This will
7840 make startup of perl scripts faster, but may cause problems if you
7841 want to share those scripts and perl is not in a standard place
7842 ($binexp/perl) on all your platforms. The alternative is to force
7843 a shell by starting the script with a single ':' character.
7846 case "$versiononly" in
7847 "$define") dflt="$binexp/perl$version";;
7848 *) dflt="$binexp/perl";;
7850 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
7853 none) startperl=": # use perl";;
7854 *) startperl="#!$ans"
7855 if $test 30 -lt `echo "$ans" | wc -c`; then
7858 WARNING: Some systems limit the #! command to 32 characters.
7859 If you experience difficulty running Perl scripts with #!, try
7860 installing Perl in a directory with a shorter pathname.
7866 *) startperl=": # use perl"
7871 echo "I'll use $startperl to start perl scripts."
7873 : figure best path for perl in scripts
7876 perlpath="$binexp/perl"
7877 case "$startperl" in
7882 I will use the "eval 'exec'" idiom to start Perl on your system.
7883 I can use the full path of your Perl binary for this purpose, but
7884 doing so may cause problems if you want to share those scripts and
7885 Perl is not always in a standard place ($binexp/perl).
7889 rp="What path shall I use in \"eval 'exec'\"?"
7896 case "$startperl" in
7898 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
7901 : determine where public executable scripts go
7902 set scriptdir scriptdir
7904 case "$scriptdir" in
7907 : guess some guesses
7908 $test -d /usr/share/scripts && dflt=/usr/share/scripts
7909 $test -d /usr/share/bin && dflt=/usr/share/bin
7910 $test -d /usr/local/script && dflt=/usr/local/script
7911 $test -d /usr/local/scripts && dflt=/usr/local/scripts
7912 $test -d $prefixexp/script && dflt=$prefixexp/script
7916 *) dflt="$scriptdir"
7921 Some installations have a separate directory just for executable scripts so
7922 that they can mount it across multiple architectures but keep the scripts in
7923 one spot. You might, for example, have a subdirectory of /usr/share for this.
7924 Or you might just lump your scripts in with all your other executables.
7928 rp='Where do you keep publicly executable scripts?'
7930 if $test "X$ansexp" != "X$scriptdirexp"; then
7934 scriptdirexp="$ansexp"
7935 : Change installation prefix, if necessary.
7936 if $test X"$prefix" != X"$installprefix"; then
7937 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
7939 installscript="$scriptdirexp"
7942 : determine where add-on public executables go
7944 '') dflt=$siteprefix/bin ;;
7948 rp='Pathname where the add-on public executables should be installed?'
7951 sitebinexp="$ansexp"
7952 : Change installation prefix, if necessary.
7953 if $test X"$prefix" != X"$installprefix"; then
7954 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
7956 installsitebin="$sitebinexp"
7959 case "$vendorprefix" in
7960 '') d_vendorbin="$undef"
7964 *) d_vendorbin="$define"
7965 : determine where vendor-supplied executables go.
7966 case "$vendorbin" in
7967 '') dflt=$vendorprefix/bin ;;
7968 *) dflt="$vendorbin" ;;
7971 rp='Pathname for the vendor-supplied executables directory?'
7974 vendorbinexp="$ansexp"
7977 : Change installation prefix, if necessary.
7978 if $test X"$prefix" != X"$installprefix"; then
7979 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
7981 installvendorbin="$vendorbinexp"
7984 : see if qgcvt exists
7990 if $test X"$d_longdbl" = X"$define"; then
7992 echo "Checking how to print long doubles..." >&4
7994 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
7995 $cat >try.c <<'EOCP'
7996 #include <sys/types.h>
8000 printf("%.3f\n", d);
8004 if eval $compile; then
8008 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
8009 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
8010 echo "We will use %f."
8016 if $test X"$sPRIfldbl" = X; then
8017 $cat >try.c <<'EOCP'
8018 #include <sys/types.h>
8021 long double d = 123.456;
8022 printf("%.3llf\n", d);
8026 if eval $compile; then
8030 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
8031 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
8032 echo "We will use %llf."
8038 if $test X"$sPRIfldbl" = X; then
8039 $cat >try.c <<'EOCP'
8040 #include <sys/types.h>
8043 long double d = 123.456;
8044 printf("%.3Lf\n", d);
8048 if eval $compile; then
8052 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
8053 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
8054 echo "We will use %Lf."
8060 if $test X"$sPRIfldbl" = X; then
8061 $cat >try.c <<'EOCP'
8062 #include <sys/types.h>
8065 long double d = 123.456;
8066 printf("%.3lf\n", d);
8070 if eval $compile; then
8074 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
8075 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
8076 echo "We will use %lf."
8082 if $test X"$sPRIfldbl" = X; then
8083 echo "Cannot figure out how to print long doubles." >&4
8085 sSCNfldbl=$sPRIfldbl # expect consistency
8092 case "$sPRIfldbl" in
8093 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
8094 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
8095 d_SCNfldbl="$undef";
8097 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
8098 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
8099 d_SCNfldbl="$define";
8103 : Check how to convert floats to strings.
8105 echo "Checking for an efficient way to convert floats to strings."
8107 case "$uselongdouble" in
8108 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
8110 case "$d_longdbl" in
8111 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
8113 case "$d_PRIgldbl" in
8114 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
8118 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
8119 char *myname = "gconvert";
8122 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
8123 char *myname = "gcvt";
8126 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
8127 char *myname = "qgcvt";
8128 #define DOUBLETYPE long double
8131 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE) && defined(HAS_PRIgldbl)
8132 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
8134 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
8136 char *myname = "sprintf";
8140 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
8141 #define DOUBLETYPE long double
8143 #define DOUBLETYPE double
8149 #define I_STDLIB $i_stdlib
8155 checkit(expect, got)
8159 if (strcmp(expect, got)) {
8160 printf("%s oddity: Expected %s, got %s\n",
8161 myname, expect, got);
8171 /* This must be 1st test on (which?) platform */
8172 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
8173 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
8174 checkit("0.1", buf);
8176 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
8179 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
8180 checkit("1.1", buf);
8182 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
8183 checkit("1.01", buf);
8185 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
8186 checkit("1.001", buf);
8188 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
8189 checkit("1.0001", buf);
8191 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
8192 checkit("1.00001", buf);
8194 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
8195 checkit("1.000001", buf);
8197 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
8200 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
8203 /* Some Linux gcvt's give 1.e+5 here. */
8204 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
8205 checkit("100000", buf);
8207 /* Some Linux gcvt's give -1.e+5 here. */
8208 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
8209 checkit("-100000", buf);
8211 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
8212 checkit("123.456", buf);
8217 case "$d_Gconvert" in
8218 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
8219 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
8220 sprintf*) xxx_list='sprintf gconvert gcvt' ;;
8221 *) xxx_list='gconvert gcvt sprintf' ;;
8224 case "$d_longdbl$uselongdouble$d_PRIgldbl" in
8225 "$define$define$define")
8226 # for long doubles prefer first qgcvt, then sprintf
8227 xxx_list="`echo $xxx_list|sed s/sprintf//`"
8228 xxx_list="sprintf $xxx_list"
8230 "$define") xxx_list="qgcvt $xxx_list" ;;
8235 for xxx_convert in $xxx_list; do
8236 echo "Trying $xxx_convert..."
8238 set try -DTRY_$xxx_convert
8239 if eval $compile; then
8240 echo "$xxx_convert() found." >&4
8242 echo "I'll use $xxx_convert to convert floats into a string." >&4
8245 echo "...But $xxx_convert didn't work as I expected."
8248 echo "$xxx_convert NOT found." >&4
8252 case "$xxx_convert" in
8253 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
8254 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
8255 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
8256 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
8257 "$define$define$define")
8258 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
8259 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
8264 : see if _fwalk exists
8268 : Initialize h_fcntl
8271 : Initialize h_sysfile
8274 : access call always available on UNIX
8278 : locate the flags for 'access()'
8282 $cat >access.c <<'EOCP'
8283 #include <sys/types.h>
8288 #include <sys/file.h>
8297 : check sys/file.h first, no particular reason here
8298 if $test `./findhdr sys/file.h` && \
8299 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
8301 echo "<sys/file.h> defines the *_OK access constants." >&4
8302 elif $test `./findhdr fcntl.h` && \
8303 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
8305 echo "<fcntl.h> defines the *_OK access constants." >&4
8306 elif $test `./findhdr unistd.h` && \
8307 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
8308 echo "<unistd.h> defines the *_OK access constants." >&4
8310 echo "I can't find the four *_OK access constants--I'll use mine." >&4
8316 : see if accessx exists
8317 set accessx d_accessx
8320 : see if alarm exists
8324 : see if atolf exists
8328 : see if atoll exists
8332 : Look for GNU-cc style attribute checking
8334 echo "Checking whether your compiler can handle __attribute__ ..." >&4
8335 $cat >attrib.c <<'EOCP'
8337 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
8339 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
8340 if $contains 'warning' attrib.out >/dev/null 2>&1; then
8341 echo "Your C compiler doesn't fully support __attribute__."
8344 echo "Your C compiler supports __attribute__."
8348 echo "Your C compiler doesn't seem to understand __attribute__ at all."
8355 : see if bcmp exists
8359 : see if bcopy exists
8363 : see if this is a unistd.h system
8364 set unistd.h i_unistd
8367 : see if getpgrp exists
8368 set getpgrp d_getpgrp
8371 case "$d_getpgrp" in
8374 echo "Checking to see which flavor of getpgrp is in use..."
8377 #include <sys/types.h>
8379 # include <unistd.h>
8383 if (getuid() == 0) {
8384 printf("(I see you are running Configure as super-user...)\n");
8388 if (getpgrp(1) == 0)
8397 if $cc -o set -DTRY_BSD_PGRP $ccflags $ldflags set.c $libs >/dev/null 2>&1 && ./set; then
8398 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
8400 elif $cc -o set $ccflags $ldflags set.c $libs >/dev/null 2>&1 && ./set; then
8401 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
8404 echo "I can't seem to compile and run the test program."
8406 xxx="a USG one, i.e. you use getpgrp()."
8408 # SVR4 systems can appear rather BSD-ish.
8411 xxx="a BSD one, i.e. you use getpgrp(pid)."
8415 xxx="probably a USG one, i.e. you use getpgrp()."
8420 echo "Assuming your getpgrp is $xxx" >&4
8429 : see if setpgrp exists
8430 set setpgrp d_setpgrp
8433 case "$d_setpgrp" in
8436 echo "Checking to see which flavor of setpgrp is in use..."
8439 #include <sys/types.h>
8441 # include <unistd.h>
8445 if (getuid() == 0) {
8446 printf("(I see you are running Configure as super-user...)\n");
8450 if (-1 == setpgrp(1, 1))
8453 if (setpgrp() != -1)
8459 if $cc -o set -DTRY_BSD_PGRP $ccflags $ldflags set.c $libs >/dev/null 2>&1 && ./set; then
8460 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
8462 elif $cc -o set $ccflags $ldflags set.c $libs >/dev/null 2>&1 && ./set; then
8463 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
8466 echo "(I can't seem to compile and run the test program.)"
8468 xxx="a USG one, i.e. you use setpgrp()."
8470 # SVR4 systems can appear rather BSD-ish.
8473 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
8477 xxx="probably a USG one, i.e. you use setpgrp()."
8482 echo "Assuming your setpgrp is $xxx" >&4
8490 : see if bzero exists
8494 : see if signal is declared as pointer to function returning int or void
8496 xxx=`./findhdr signal.h`
8497 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
8498 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
8499 echo "You have int (*signal())() instead of void." >&4
8501 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
8502 echo "You have void (*signal())()." >&4
8504 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
8505 echo "You have int (*signal())() instead of void." >&4
8507 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
8508 echo "You have void (*signal())()." >&4
8511 case "$d_voidsig" in
8513 echo "I can't determine whether signal handler returns void or int..." >&4
8515 rp="What type does your signal handler return?"
8522 echo "As you already told me, signal handler returns void." >&4
8525 *) echo "As you already told me, signal handler returns int." >&4
8532 case "$d_voidsig" in
8533 "$define") signal_t="void";;
8538 : check for ability to cast large floats to 32-bit ints.
8540 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
8541 if $test "$intsize" -ge 4; then
8548 #include <sys/types.h>
8550 $signal_t blech(s) int s; { exit(3); }
8557 signal(SIGFPE, blech);
8559 /* Don't let compiler optimize the test away. Store the number
8560 in a writable string for gcc to pass to sscanf under HP/UX.
8562 sprintf(str, "2147483647");
8563 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
8567 /* x86 processors will probably give 0x8000 0000, which is a
8568 sign change. We don't want that. We want to mimic SPARC
8569 behavior here, which is to preserve the sign and give
8572 if (i32 != ($xxx) f)
8578 if eval $compile_ok; then
8582 echo "(I can't seem to compile the test program--assuming it can't)"
8590 echo "Nope, it can't."
8597 : check for ability to cast negative floats to unsigned
8599 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
8602 #include <sys/types.h>
8604 $signal_t blech(s) int s; { exit(7); }
8605 $signal_t blech_in_list(s) int s; { exit(4); }
8606 unsigned long dummy_long(p) unsigned long p; { return p; }
8607 unsigned int dummy_int(p) unsigned int p; { return p; }
8608 unsigned short dummy_short(p) unsigned short p; { return p; }
8612 unsigned long along;
8614 unsigned short ashort;
8618 /* Frustrate gcc-2.7.2's optimizer which failed this test with
8619 a direct f = -123. assignment. gcc-2.8.0 reportedly
8620 optimized the whole file away
8622 /* Store the number in a writable string for gcc to pass to
8625 sprintf(str, "-123");
8626 sscanf(str, "%lf", &f); /* f = -123.; */
8628 signal(SIGFPE, blech);
8629 along = (unsigned long)f;
8630 aint = (unsigned int)f;
8631 ashort = (unsigned short)f;
8632 if (along != (unsigned long)-123)
8634 if (aint != (unsigned int)-123)
8636 if (ashort != (unsigned short)-123)
8638 sprintf(str, "1073741824.");
8639 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
8642 along = (unsigned long)f;
8643 if (along != 0x80000000)
8647 along = (unsigned long)f;
8648 if (along != 0x7fffffff)
8652 along = (unsigned long)f;
8653 if (along != 0x80000001)
8657 signal(SIGFPE, blech_in_list);
8658 sprintf(str, "123.");
8659 sscanf(str, "%lf", &f); /* f = 123.; */
8660 along = dummy_long((unsigned long)f);
8661 aint = dummy_int((unsigned int)f);
8662 ashort = dummy_short((unsigned short)f);
8663 if (along != (unsigned long)123)
8665 if (aint != (unsigned int)123)
8667 if (ashort != (unsigned short)123)
8674 if eval $compile_ok; then
8678 echo "(I can't seem to compile the test program--assuming it can't)"
8681 case "$castflags" in
8686 echo "Nope, it can't."
8693 : see if vprintf exists
8695 if set vprintf val -f d_vprintf; eval $csym; $val; then
8696 echo 'vprintf() found.' >&4
8698 $cat >vprintf.c <<'EOF'
8699 #include <varargs.h>
8701 int main() { xxx("foo"); }
8710 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
8714 if eval $compile && ./vprintf; then
8715 echo "Your vsprintf() returns (int)." >&4
8718 echo "Your vsprintf() returns (char*)." >&4
8722 echo 'vprintf() NOT found.' >&4
8732 : see if chown exists
8736 : see if chroot exists
8740 : see if chsize exists
8744 hasstruct='varname=$1; struct=$2; shift; shift;
8745 while $test $# -ge 2; do
8747 $define) echo "#include <$2>";;
8751 echo "int main () { struct $struct foo; }" >> try.c;
8753 if eval $compile; then
8762 : see if sys/types.h has to be included
8763 set sys/types.h i_systypes
8766 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
8767 while $test $# -ge 2; do
8769 $define) echo "#include <$2>";;
8773 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
8775 if eval $compile; then
8786 : see whether socket exists
8788 $echo $n "Hmm... $c" >&4
8789 if set socket val -f d_socket; eval $csym; $val; then
8790 echo "Looks like you have Berkeley networking support." >&4
8792 if set setsockopt val -f; eval $csym; $val; then
8795 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
8799 if $contains socklib libc.list >/dev/null 2>&1; then
8800 echo "Looks like you have Berkeley networking support." >&4
8802 : we will have to assume that it supports the 4.2 BSD interface
8805 echo "You don't have Berkeley networking in libc$_a..." >&4
8806 if test "X$d_socket" = "X$define"; then
8807 echo "...but you seem to believe that you have sockets." >&4
8809 for net in net socket
8811 if test -f /usr/lib/lib$net$_a; then
8812 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
8813 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
8814 if $contains socket libc.list >/dev/null 2>&1; then
8819 echo "...but the Wollongong group seems to have hacked it in." >&4
8820 sockethdr="-I/usr/netinclude"
8823 echo "Found Berkeley sockets interface in lib$net." >& 4
8824 if $contains setsockopt libc.list >/dev/null 2>&1; then
8827 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
8834 if test "X$d_socket" != "X$define"; then
8835 echo "or anywhere else I see." >&4
8843 : see if socketpair exists
8844 set socketpair d_sockpair
8849 echo "Checking the availability of certain socket constants..." >& 4
8850 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
8851 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
8853 #include <sys/types.h>
8854 #include <sys/socket.h>
8860 set try; if eval $compile; then
8863 set d_${enum}; eval $setvar
8867 : see if this is a sys/uio.h system
8868 set sys/uio.h i_sysuio
8873 echo "Checking to see if your system supports struct cmsghdr..." >&4
8874 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
8876 case "$d_cmsghdr_s" in
8877 "$define") echo "Yes, it does." ;;
8878 *) echo "No, it doesn't." ;;
8882 : check for const keyword
8884 echo 'Checking to see if your C compiler knows about "const"...' >&4
8885 $cat >const.c <<'EOCP'
8886 typedef struct spug { int drokk; } spug;
8893 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
8895 echo "Yup, it does."
8898 echo "Nope, it doesn't."
8903 : see if crypt exists
8905 if set crypt val -f d_crypt; eval $csym; $val; then
8906 echo 'crypt() found.' >&4
8910 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
8911 if $test -z "$cryptlib"; then
8912 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
8916 if $test -z "$cryptlib"; then
8917 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
8921 if $test -z "$cryptlib"; then
8922 cryptlib=`./loc libcrypt$_a "" $libpth`
8926 if $test -z "$cryptlib"; then
8927 echo 'crypt() NOT found.' >&4
8936 : get csh whereabouts
8938 'csh') val="$undef" ;;
8943 : Respect a hint or command line value for full_csh.
8945 '') full_csh=$csh ;;
8948 : see if cuserid exists
8949 set cuserid d_cuserid
8952 : see if this is a limits.h system
8953 set limits.h i_limits
8956 : see if this is a float.h system
8960 : See if number of significant digits in a double precision number is known
8962 $cat >dbl_dig.c <<EOM
8972 printf("Contains DBL_DIG");
8975 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
8976 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
8977 echo "DBL_DIG found." >&4
8980 echo "DBL_DIG NOT found." >&4
8987 : see if difftime exists
8988 set difftime d_difftime
8991 : see if this is a dirent system
8993 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
8995 echo "<dirent.h> found." >&4
8998 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
8999 echo "<sys/dir.h> found." >&4
9002 xinc=`./findhdr sys/ndir.h`
9004 echo "<dirent.h> NOT found." >&4
9009 : Look for type of directory structure.
9011 $cppstdin $cppflags $cppminus < "$xinc" > try.c
9013 case "$direntrytype" in
9016 $define) guess1='struct dirent' ;;
9017 *) guess1='struct direct' ;;
9020 *) guess1="$direntrytype"
9025 'struct dirent') guess2='struct direct' ;;
9026 *) guess2='struct dirent' ;;
9029 if $contains "$guess1" try.c >/dev/null 2>&1; then
9030 direntrytype="$guess1"
9031 echo "Your directory entries are $direntrytype." >&4
9032 elif $contains "$guess2" try.c >/dev/null 2>&1; then
9033 direntrytype="$guess2"
9034 echo "Your directory entries seem to be $direntrytype." >&4
9036 echo "I don't recognize your system's directory entries." >&4
9037 rp="What type is used for directory entries on this system?"
9045 : see if the directory entry stores field length
9047 $cppstdin $cppflags $cppminus < "$xinc" > try.c
9048 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
9049 echo "Good, your directory entry keeps length information in d_namlen." >&4
9052 echo "Your directory entry does not know about the d_namlen field." >&4
9059 : see if dlerror exists
9062 set dlerror d_dlerror
9066 : see if dlfcn is available
9074 On a few systems, the dynamically loaded modules that perl generates and uses
9075 will need a different extension than shared libs. The default will probably
9083 rp='What is the extension of dynamically loaded modules'
9092 : Check if dlsym need a leading underscore
9098 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
9099 $cat >dyna.c <<'EOM'
9108 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
9110 #include <sys/types.h>
9124 int mode = RTLD_LAZY ;
9126 handle = dlopen("./dyna.$dlext", mode) ;
9127 if (handle == NULL) {
9132 symbol = dlsym(handle, "fred") ;
9133 if (symbol == NULL) {
9134 /* try putting a leading underscore */
9135 symbol = dlsym(handle, "_fred") ;
9136 if (symbol == NULL) {
9149 : Call the object file tmp-dyna.o in case dlext=o.
9150 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
9151 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
9152 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
9153 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then
9156 1) echo "Test program failed using dlopen." >&4
9157 echo "Perhaps you should not use dynamic loading." >&4;;
9158 2) echo "Test program failed using dlsym." >&4
9159 echo "Perhaps you should not use dynamic loading." >&4;;
9160 3) echo "dlsym needs a leading underscore" >&4
9162 4) echo "dlsym doesn't need a leading underscore." >&4;;
9165 echo "I can't compile and run the test program." >&4
9166 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
9171 $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
9176 hasproto='varname=$1; func=$2; shift; shift;
9177 while $test $# -ge 2; do
9179 $define) echo "#include <$2>";;
9183 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
9184 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
9185 echo "$func() prototype found.";
9188 echo "$func() prototype NOT found.";
9193 $rm -f try.c tryout.c'
9195 : see if prototype for drand48 is available
9197 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
9200 : see if dup2 exists
9204 : see if eaccess exists
9205 set eaccess d_eaccess
9208 : see if endgrent exists
9209 set endgrent d_endgrent
9212 : see if endhostent exists
9213 set endhostent d_endhent
9216 : see if endnetent exists
9217 set endnetent d_endnent
9220 : see if endprotoent exists
9221 set endprotoent d_endpent
9224 : see if endpwent exists
9225 set endpwent d_endpwent
9228 : see if endservent exists
9229 set endservent d_endsent
9232 : Locate the flags for 'open()'
9234 $cat >open3.c <<'EOCP'
9235 #include <sys/types.h>
9240 #include <sys/file.h>
9251 : check sys/file.h first to get FREAD on Sun
9252 if $test `./findhdr sys/file.h` && \
9253 set open3 -DI_SYS_FILE && eval $compile; then
9255 echo "<sys/file.h> defines the O_* constants..." >&4
9257 echo "and you have the 3 argument form of open()." >&4
9260 echo "but not the 3 argument form of open(). Oh, well." >&4
9263 elif $test `./findhdr fcntl.h` && \
9264 set open3 -DI_FCNTL && eval $compile; then
9266 echo "<fcntl.h> defines the O_* constants..." >&4
9268 echo "and you have the 3 argument form of open()." >&4
9271 echo "but not the 3 argument form of open(). Oh, well." >&4
9276 echo "I can't find the O_* constant definitions! You got problems." >&4
9282 : see which of string.h or strings.h is needed
9284 strings=`./findhdr string.h`
9285 if $test "$strings" && $test -r "$strings"; then
9286 echo "Using <string.h> instead of <strings.h>." >&4
9290 strings=`./findhdr strings.h`
9291 if $test "$strings" && $test -r "$strings"; then
9292 echo "Using <strings.h> instead of <string.h>." >&4
9294 echo "No string header found -- You'll surely have problems." >&4
9300 "$undef") strings=`./findhdr strings.h`;;
9301 *) strings=`./findhdr string.h`;;
9304 : check for non-blocking I/O stuff
9305 case "$h_sysfile" in
9306 true) echo "#include <sys/file.h>" > head.c;;
9309 true) echo "#include <fcntl.h>" > head.c;;
9310 *) echo "#include <sys/fcntl.h>" > head.c;;
9315 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
9316 case "$o_nonblock" in
9319 $cat >>try.c <<'EOCP'
9323 printf("O_NONBLOCK\n");
9327 printf("O_NDELAY\n");
9331 printf("FNDELAY\n");
9338 if eval $compile_ok; then
9340 case "$o_nonblock" in
9341 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
9342 *) echo "Seems like we can use $o_nonblock.";;
9345 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
9348 *) echo "Using $hint value $o_nonblock.";;
9350 $rm -f try try.* .out core
9353 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
9359 #include <sys/types.h>
9362 #define MY_O_NONBLOCK $o_nonblock
9363 #ifndef errno /* XXX need better Configure test */
9374 #include <strings.h>
9376 $signal_t blech(x) int x; { exit(3); }
9378 $cat >> try.c <<'EOCP'
9386 pipe(pd); /* Down: child -> parent */
9387 pipe(pu); /* Up: parent -> child */
9390 close(pd[1]); /* Parent reads from pd[0] */
9391 close(pu[0]); /* Parent writes (blocking) to pu[1] */
9393 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
9398 signal(SIGALRM, blech);
9400 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
9402 sprintf(string, "%d\n", ret);
9403 write(2, string, strlen(string));
9406 if (errno == EAGAIN) {
9412 if (errno == EWOULDBLOCK)
9413 printf("EWOULDBLOCK\n");
9416 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
9417 sleep(2); /* Give it time to close our pipe */
9419 ret = read(pd[0], buf, 1); /* Should read EOF */
9421 sprintf(string, "%d\n", ret);
9422 write(3, string, strlen(string));
9426 close(pd[0]); /* We write to pd[1] */
9427 close(pu[1]); /* We read from pu[0] */
9428 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
9429 close(pd[1]); /* Pipe pd is now fully closed! */
9430 exit(0); /* Bye bye, thank you for playing! */
9434 if eval $compile_ok; then
9435 echo "$startsh" >mtry
9436 echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
9438 ./mtry >/dev/null 2>&1
9440 0) eagain=`$cat try.out`;;
9441 1) echo "Could not perform non-blocking setting!";;
9442 2) echo "I did a successful read() for something that was not there!";;
9443 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
9444 4) echo "Could not find F_SETFL!";;
9445 *) echo "Something terribly wrong happened during testing.";;
9447 rd_nodata=`$cat try.ret`
9448 echo "A read() system call with no data present returns $rd_nodata."
9449 case "$rd_nodata" in
9452 echo "(That's peculiar, fixing that to be -1.)"
9458 echo "Forcing errno EAGAIN on read() with no data available."
9462 echo "Your read() sets errno to $eagain when no data is available."
9465 status=`$cat try.err`
9467 0) echo "And it correctly returns 0 to signal EOF.";;
9468 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
9469 *) echo "However, your read() returns '$status' on EOF??";;
9472 if test "$status" = "$rd_nodata"; then
9473 echo "WARNING: you can't distinguish between EOF and no data!"
9477 echo "I can't compile the test program--assuming errno EAGAIN will do."
9484 echo "Using $hint value $eagain."
9485 echo "Your read() returns $rd_nodata when no data is present."
9486 case "$d_eofnblk" in
9487 "$define") echo "And you can see EOF because read() returns 0.";;
9488 "$undef") echo "But you can't see EOF status from read() returned value.";;
9490 echo "(Assuming you can't see EOF status from read anyway.)"
9496 $rm -f try try.* .out core head.c mtry
9498 : see if fchmod exists
9502 : see if fchown exists
9506 : see if this is an fcntl system
9511 : See if fcntl-based locking works.
9512 $cat >try.c <<'EOCP'
9517 #if defined(F_SETLK) && defined(F_SETLKW)
9520 fd = open("try.c", O_RDONLY);
9521 flock.l_type = F_RDLCK;
9522 flock.l_whence = SEEK_SET;
9523 flock.l_start = flock.l_len = 0;
9524 retval = fcntl(fd, F_SETLK, &flock);
9526 (retval < 0 ? exit(2) : exit(0));
9532 echo "Checking if fcntl-based file locking works... "
9536 if eval $compile_ok; then
9538 echo "Yes, it seems to work."
9541 echo "Nope, it didn't work."
9545 echo "I'm unable to compile the test program, so I'll assume not."
9550 echo "Nope, since you don't even have fcntl()."
9553 set d_fcntl_can_lock
9558 : see if sys/select.h has to be included
9559 set sys/select.h i_sysselct
9562 : see if we should include time.h, sys/time.h, or both
9564 if test "X$timeincl" = X; then
9565 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9566 $echo $n "I'm now running the test program...$c"
9567 $cat >try.c <<'EOCP'
9568 #include <sys/types.h>
9573 #ifdef SYSTIMEKERNEL
9576 #include <sys/time.h>
9579 #include <sys/select.h>
9588 struct timezone tzp;
9590 if (foo.tm_sec == foo.tm_sec)
9593 if (bar.tv_sec == bar.tv_sec)
9600 for s_timezone in '-DS_TIMEZONE' ''; do
9602 for s_timeval in '-DS_TIMEVAL' ''; do
9603 for i_systimek in '' '-DSYSTIMEKERNEL'; do
9604 for i_time in '' '-DI_TIME'; do
9605 for i_systime in '-DI_SYSTIME' ''; do
9608 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
9609 if eval $compile; then
9610 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
9614 $echo $n "Succeeded with $flags$c"
9626 *SYSTIMEKERNEL*) i_systimek="$define"
9627 timeincl=`./findhdr sys/time.h`
9628 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
9629 *) i_systimek="$undef";;
9632 *I_TIME*) i_time="$define"
9633 timeincl=`./findhdr time.h`" $timeincl"
9634 echo "We'll include <time.h>." >&4;;
9635 *) i_time="$undef";;
9638 *I_SYSTIME*) i_systime="$define"
9639 timeincl=`./findhdr sys/time.h`" $timeincl"
9640 echo "We'll include <sys/time.h>." >&4;;
9641 *) i_systime="$undef";;
9646 : check for fd_set items
9649 Checking to see how well your C compiler handles fd_set and friends ...
9651 $cat >fd_set.c <<EOCP
9652 #$i_systime I_SYS_TIME
9653 #$i_sysselct I_SYS_SELECT
9654 #$d_socket HAS_SOCKET
9655 #include <sys/types.h>
9657 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
9660 #include <sys/time.h>
9663 #include <sys/select.h>
9672 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
9679 set fd_set -DTRYBITS
9680 if eval $compile; then
9681 d_fds_bits="$define"
9683 echo "Well, your system knows about the normal fd_set typedef..." >&4
9685 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
9686 d_fd_macros="$define"
9689 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
9691 d_fd_macros="$undef"
9695 Hmm, your compiler has some difficulty with fd_set. Checking further...
9698 if eval $compile; then
9701 echo "Well, your system has some sort of fd_set available..." >&4
9703 echo "and you have the normal fd_set macros." >&4
9704 d_fd_macros="$define"
9707 but not the normal fd_set macros! Gross! More work for me...
9709 d_fd_macros="$undef"
9712 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
9715 d_fd_macros="$undef"
9720 : see if fgetpos exists
9721 set fgetpos d_fgetpos
9724 : see if flock exists
9728 : see if fork exists
9732 : see if pathconf exists
9733 set pathconf d_pathconf
9736 : see if fpathconf exists
9737 set fpathconf d_fpathconf
9741 : check for fpos64_t
9743 echo "Checking to see if you have fpos64_t..." >&4
9746 int main() { fpos64_t x = 7; }
9749 if eval $compile; then
9751 echo "You have fpos64_t."
9754 echo "You do not have fpos64_t."
9756 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
9763 : see if frexpl exists
9767 : see if this is a sys/param system
9768 set sys/param.h i_sysparam
9771 : see if this is a sys/mount.h system
9772 set sys/mount.h i_sysmount
9777 echo "Checking to see if your system supports struct fs_data..." >&4
9778 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
9780 case "$d_fs_data_s" in
9781 "$define") echo "Yes, it does." ;;
9782 *) echo "No, it doesn't." ;;
9785 : see if fseeko exists
9789 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
9792 : see if fsetpos exists
9793 set fsetpos d_fsetpos
9797 : see if fstatfs exists
9798 set fstatfs d_fstatfs
9802 : see if statvfs exists
9803 set statvfs d_statvfs
9806 : see if fstatvfs exists
9807 set fstatvfs d_fstatvfs
9811 : see if fsync exists
9815 : see if ftello exists
9819 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
9822 : see if getcwd exists
9826 : see if getespwnam exists
9827 set getespwnam d_getespwnam
9831 : see if getfsstat exists
9832 set getfsstat d_getfsstat
9835 : see if getgrent exists
9836 set getgrent d_getgrent
9839 : see if gethostbyaddr exists
9840 set gethostbyaddr d_gethbyaddr
9843 : see if gethostbyname exists
9844 set gethostbyname d_gethbyname
9847 : see if gethostent exists
9848 set gethostent d_gethent
9851 : see how we will look up host name
9854 if set gethostname val -f d_gethname; eval $csym; $val; then
9855 echo 'gethostname() found.' >&4
9856 d_gethname="$define"
9859 if set uname val -f d_uname; eval $csym; $val; then
9862 uname() was found, but you're running xenix, and older versions of xenix
9863 have a broken uname(). If you don't really know whether your xenix is old
9864 enough to have a broken system call, use the default answer.
9871 rp='Is your uname() broken?'
9874 n*) d_uname="$define"; call=uname;;
9877 echo 'uname() found.' >&4
9884 case "$d_gethname" in
9885 '') d_gethname="$undef";;
9888 '') d_uname="$undef";;
9890 case "$d_uname$d_gethname" in
9895 Every now and then someone has a $call() that lies about the hostname
9896 but can't be fixed for political or economic reasons. If you wish, I can
9897 pretend $call() isn't there and maybe compute hostname at run-time
9898 thanks to the '$phostname' command.
9901 rp="Shall I ignore $call() from now on?"
9904 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
9907 case "$phostname" in
9909 *) case "$aphostname" in
9915 file=`./loc $file $file $pth`
9916 aphostname=`echo $file $*`
9921 case "$d_uname$d_gethname" in
9924 case "$phostname" in
9926 echo "There will be no way for $package to get your hostname." >&4;;
9928 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
9932 case "$d_phostname" in
9933 '') d_phostname="$undef";;
9936 : see if this is a netdb.h system
9940 : see if prototypes for various gethostxxx netdb.h functions are available
9942 set d_gethostprotos gethostent $i_netdb netdb.h
9945 : see if getitimer exists
9946 set getitimer d_getitimer
9949 : see if getlogin exists
9950 set getlogin d_getlogin
9953 : see if getmnt exists
9957 : see if getmntent exists
9958 set getmntent d_getmntent
9961 : see if getnetbyaddr exists
9962 set getnetbyaddr d_getnbyaddr
9965 : see if getnetbyname exists
9966 set getnetbyname d_getnbyname
9969 : see if getnetent exists
9970 set getnetent d_getnent
9973 : see if prototypes for various getnetxxx netdb.h functions are available
9975 set d_getnetprotos getnetent $i_netdb netdb.h
9978 : see if getpagesize exists
9979 set getpagesize d_getpagsz
9983 : see if getprotobyname exists
9984 set getprotobyname d_getpbyname
9987 : see if getprotobynumber exists
9988 set getprotobynumber d_getpbynumber
9991 : see if getprotoent exists
9992 set getprotoent d_getpent
9995 : see if getpgid exists
9996 set getpgid d_getpgid
9999 : see if getpgrp2 exists
10000 set getpgrp2 d_getpgrp2
10003 : see if getppid exists
10004 set getppid d_getppid
10007 : see if getpriority exists
10008 set getpriority d_getprior
10011 : see if prototypes for various getprotoxxx netdb.h functions are available
10013 set d_getprotoprotos getprotoent $i_netdb netdb.h
10016 : see if getprpwnam exists
10017 set getprpwnam d_getprpwnam
10020 : see if getpwent exists
10021 set getpwent d_getpwent
10025 : see if getservbyname exists
10026 set getservbyname d_getsbyname
10029 : see if getservbyport exists
10030 set getservbyport d_getsbyport
10033 : see if getservent exists
10034 set getservent d_getsent
10037 : see if prototypes for various getservxxx netdb.h functions are available
10039 set d_getservprotos getservent $i_netdb netdb.h
10042 : see if getspnam exists
10043 set getspnam d_getspnam
10046 : see if gettimeofday or ftime exists
10047 set gettimeofday d_gettimeod
10049 case "$d_gettimeod" in
10055 val="$undef"; set d_ftime; eval $setvar
10058 case "$d_gettimeod$d_ftime" in
10061 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
10065 : see if this is an grp system
10071 xxx=`./findhdr grp.h`
10072 $cppstdin $cppflags $cppminus < $xxx >$$.h
10074 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
10086 set d_grpasswd; eval $setvar
10090 : see if hasmntopt exists
10091 set hasmntopt d_hasmntopt
10094 : see if this is a netinet/in.h or sys/in.h system
10095 set netinet/in.h i_niin sys/in.h i_sysin
10098 : see if arpa/inet.h has to be included
10099 set arpa/inet.h i_arpainet
10102 : see if htonl --and friends-- exists
10107 : Maybe they are macros.
10110 $cat >htonl.c <<EOM
10112 #include <sys/types.h>
10113 #$i_niin I_NETINET_IN
10115 #$i_arpainet I_ARPA_INET
10116 #ifdef I_NETINET_IN
10117 #include <netinet/in.h>
10120 #include <sys/in.h>
10123 #include <arpa/inet.h>
10126 printf("Defined as a macro.");
10129 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
10130 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
10132 echo "But it seems to be defined as a macro." >&4
10140 : see if iconv exists
10146 if set index val -f; eval $csym; $val; then
10147 if set strchr val -f d_strchr; eval $csym; $val; then
10148 if $contains strchr "$strings" >/dev/null 2>&1 ; then
10151 echo "strchr() found." >&4
10155 echo "index() found." >&4
10160 echo "index() found." >&4
10163 if set strchr val -f d_strchr; eval $csym; $val; then
10166 echo "strchr() found." >&4
10168 echo "No index() or strchr() found!" >&4
10173 set d_strchr; eval $setvar
10175 set d_index; eval $setvar
10177 : check whether inet_aton exists
10178 set inet_aton d_inetaton
10183 $cat >isascii.c <<'EOCP'
10195 if eval $compile; then
10196 echo "isascii() found." >&4
10199 echo "isascii() NOT found." >&4
10206 : see if isnan exists
10210 : see if isnanl exists
10211 set isnanl d_isnanl
10214 : see if killpg exists
10215 set killpg d_killpg
10218 : see if lchown exists
10220 $cat > try.c <<'EOCP'
10221 /* System header to define __stub macros and hopefully few prototypes,
10222 which can conflict with char lchown(); below. */
10223 #include <assert.h>
10224 /* Override any gcc2 internal prototype to avoid an error. */
10225 /* We use char because int might match the return type of a gcc2
10226 builtin and then its argument prototype would still apply. */
10229 /* The GNU C library defines this for functions which it implements
10230 to always fail with ENOSYS. Some functions are actually named
10231 something starting with __ and the normal name is an alias. */
10232 #if defined (__stub_lchown) || defined (__stub___lchown)
10240 if eval $compile; then
10241 $echo "lchown() found." >&4
10244 $echo "lchown() NOT found." >&4
10250 : See if number of significant digits in a double precision number is known
10252 $cat >ldbl_dig.c <<EOM
10253 #$i_limits I_LIMITS
10256 #include <limits.h>
10262 printf("Contains LDBL_DIG");
10265 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
10266 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
10267 echo "LDBL_DIG found." >&4
10270 echo "LDBL_DIG NOT found." >&4
10277 : see if link exists
10281 : see if localeconv exists
10282 set localeconv d_locconv
10285 : see if lockf exists
10289 : see if prototype for lseek is available
10291 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
10294 : see if lstat exists
10298 : see if madvise exists
10299 set madvise d_madvise
10302 : see if mblen exists
10306 : see if mbstowcs exists
10307 set mbstowcs d_mbstowcs
10310 : see if mbtowc exists
10311 set mbtowc d_mbtowc
10314 : see if memchr exists
10315 set memchr d_memchr
10318 : see if memcmp exists
10319 set memcmp d_memcmp
10322 : see if memcpy exists
10323 set memcpy d_memcpy
10326 : see if memmove exists
10327 set memmove d_memmove
10330 : see if memset exists
10331 set memset d_memset
10334 : see if mkdir exists
10338 : see if mkdtemp exists
10339 set mkdtemp d_mkdtemp
10342 : see if mkfifo exists
10343 set mkfifo d_mkfifo
10346 : see if mkstemp exists
10347 set mkstemp d_mkstemp
10350 : see if mkstemps exists
10351 set mkstemps d_mkstemps
10354 : see if mktime exists
10355 set mktime d_mktime
10358 : see if this is a sys/mman.h system
10359 set sys/mman.h i_sysmman
10362 : see if mmap exists
10365 : see what shmat returns
10366 : default to something harmless
10368 case "$i_sysmman$d_mmap" in
10370 $cat >mmap.c <<'END'
10371 #include <sys/mman.h>
10374 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
10379 echo "and it returns ($mmaptype)." >&4
10385 : see if modfl exists
10389 : see if mprotect exists
10390 set mprotect d_mprotect
10393 : see if msgctl exists
10394 set msgctl d_msgctl
10397 : see if msgget exists
10398 set msgget d_msgget
10401 : see if msgsnd exists
10402 set msgsnd d_msgsnd
10405 : see if msgrcv exists
10406 set msgrcv d_msgrcv
10409 : see how much of the 'msg*(2)' library is present.
10412 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
10413 *"$undef"*) h_msg=false;;
10417 case "`ipcs 2>&1`" in
10418 "SVID messages"*"not configured"*)
10419 echo "Your $osname does not have the msg*(2) configured." >&4
10422 set msgctl d_msgctl
10424 set msgget d_msgget
10426 set msgsnd d_msgsnd
10428 set msgrcv d_msgrcv
10434 : we could also check for sys/ipc.h ...
10435 if $h_msg && $test `./findhdr sys/msg.h`; then
10436 echo "You have the full msg*(2) library." >&4
10439 echo "You don't have the full msg*(2) library." >&4
10447 echo "Checking to see if your system supports struct msghdr..." >&4
10448 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
10450 case "$d_msghdr_s" in
10451 "$define") echo "Yes, it does." ;;
10452 *) echo "No, it doesn't." ;;
10456 : see if msync exists
10460 : see if munmap exists
10461 set munmap d_munmap
10464 : see if nice exists
10468 : check for length of character
10470 case "$charsize" in
10472 echo "Checking to see how big your characters are (hey, you never know)..." >&4
10473 $cat >try.c <<'EOCP'
10477 printf("%d\n", (int)sizeof(char));
10482 if eval $compile_ok; then
10486 echo "(I can't seem to compile the test program. Guessing...)"
10493 rp="What is the size of a character (in bytes)?"
10498 : check for volatile keyword
10500 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
10501 $cat >try.c <<'EOCP'
10504 typedef struct _goo_struct goo_struct;
10505 goo_struct * volatile goo = ((goo_struct *)0);
10506 struct _goo_struct {
10511 typedef unsigned short foo_t;
10512 char *volatile foo;
10514 volatile foo_t blech;
10518 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
10520 echo "Yup, it does."
10523 echo "Nope, it doesn't."
10531 $echo "Choosing the C types to be used for Perl's internal types..." >&4
10533 case "$use64bitint:$d_quad:$quadtype" in
10536 uvtype="$uquadtype"
10541 uvtype="unsigned long"
10547 case "$uselongdouble:$d_longdbl" in
10549 nvtype="long double"
10550 nvsize=$longdblsize
10557 $echo "(IV will be "$ivtype", $ivsize bytes)"
10558 $echo "(UV will be "$uvtype", $uvsize bytes)"
10559 $echo "(NV will be "$nvtype", $nvsize bytes)"
10562 #$i_inttypes I_INTTYPES
10564 #include <inttypes.h>
10569 int8_t i = INT8_MAX;
10570 uint8_t u = UINT8_MAX;
10571 printf("int8_t\n");
10574 int16_t i = INT16_MAX;
10575 uint16_t i = UINT16_MAX;
10576 printf("int16_t\n");
10579 int32_t i = INT32_MAX;
10580 uint32_t u = UINT32_MAX;
10581 printf("int32_t\n");
10587 '') case "$charsize" in
10589 u8type="unsigned char"
10598 if eval $compile; then
10599 case "`./try$exe_ext`" in
10600 int8_t) i8type=int8_t
10610 '') if $test $charsize -ge 1; then
10612 u8type="unsigned char"
10620 '') case "$shortsize" in
10622 u16type="unsigned short"
10630 '') set try -DINT16
10631 if eval $compile; then
10632 case "`./try$exe_ext`" in
10644 '') if $test $shortsize -ge 2; then
10646 u16type="unsigned short"
10654 '') case "$longsize" in
10656 u32type="unsigned long"
10660 *) case "$intsize" in
10662 u32type="unsigned int"
10672 '') set try -DINT32
10673 if eval $compile; then
10674 case "`./try$exe_ext`" in
10686 '') if $test $intsize -ge 4; then
10688 u32type="unsigned int"
10696 '') case "$d_quad:$quadtype" in
10698 i64type="$quadtype"
10699 u64type="$uquadtype"
10707 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
10708 : volatile so that the compiler has to store it out to memory.
10709 if test X"$d_volatile" = X"$define"; then
10714 #include <sys/types.h>
10715 #include <signal.h>
10717 $volatile int bletched = 0;
10718 $signal_t blech(s) int s; { bletched = 1; }
10723 int n = 8 * $uvsize;
10726 signal(SIGFPE, blech);
10729 for (i = 0; i < n; i++) {
10730 u = u << 1 | ($uvtype)1;
10732 if (($uvtype)d != u)
10736 d = ($nvtype)(u - 1);
10737 if (($uvtype)d != (u - 1))
10745 printf("%d\n", ((i == n) ? -n : i));
10751 d_nv_preserves_uv="$undef"
10752 if eval $compile; then
10753 d_nv_preserves_uv_bits="`./try$exe_ext`"
10755 case "$d_nv_preserves_uv_bits" in
10757 d_nv_preserves_uv_bits=`expr 0 - $d_nv_preserves_uv_bits`
10758 $echo "Your NVs can preserve all $d_nv_preserves_uv_bits bits of your UVs." 2>&1
10759 d_nv_preserves_uv="$define"
10761 [1-9]*) $echo "Your NVs can preserve only $d_nv_preserves_uv_bits bits of your UVs." 2>&1
10762 d_nv_preserves_uv="$undef" ;;
10763 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
10764 d_nv_preserves_uv_bits="$undef" ;;
10770 : check for off64_t
10772 echo "Checking to see if you have off64_t..." >&4
10774 #include <sys/types.h>
10775 #include <unistd.h>
10776 int main() { off64_t x = 7; }
10779 if eval $compile; then
10781 echo "You have off64_t."
10784 echo "You do not have off64_t."
10785 case "$lseeksize" in
10786 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
10793 : see if POSIX threads are available
10794 set pthread.h i_pthread
10800 : how to create joinable pthreads
10801 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
10803 echo "Checking what constant to use for creating joinable pthreads..." >&4
10804 $cat >try.c <<'EOCP'
10805 #include <pthread.h>
10807 int detachstate = JOINABLE;
10810 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
10811 if eval $compile; then
10812 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
10813 val="$undef" # Yes, undef.
10814 set d_old_pthread_create_joinable
10817 set old_pthread_create_joinable
10820 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
10821 if eval $compile; then
10822 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
10824 set d_old_pthread_create_joinable
10826 val=PTHREAD_CREATE_UNDETACHED
10827 set old_pthread_create_joinable
10830 set try -DJOINABLE=__UNDETACHED
10831 if eval $compile; then
10832 echo "You seem to use __UNDETACHED." >&4
10834 set d_old_pthread_create_joinable
10837 set old_pthread_create_joinable
10840 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
10842 set d_old_pthread_create_joinable
10845 set old_pthread_create_joinable
10852 d_old_pthread_create_joinable="$undef"
10853 old_pthread_create_joinable=""
10856 : see if pause exists
10860 : see if pipe exists
10864 : see if poll exists
10869 : see whether the various POSIXish _yields exist
10871 #include <pthread.h>
10877 #ifdef PTHREAD_YIELD
10880 #ifdef PTHREAD_YIELD_NULL
10881 pthread_yield(NULL);
10887 : see if sched_yield exists
10888 set try -DSCHED_YIELD
10889 if eval $compile; then
10891 sched_yield='sched_yield()'
10895 case "$usethreads" in
10898 $define) echo 'sched_yield() found.' >&4 ;;
10899 *) echo 'sched_yield() NOT found.' >&4 ;;
10905 : see if pthread_yield exists
10906 set try -DPTHREAD_YIELD
10907 if eval $compile; then
10909 case "$sched_yield" in
10910 '') sched_yield='pthread_yield()' ;;
10913 set try -DPTHREAD_YIELD_NULL
10914 if eval $compile; then
10916 case "$sched_yield" in
10917 '') sched_yield='pthread_yield(NULL)' ;;
10923 case "$usethreads" in
10926 $define) echo 'pthread_yield() found.' >&4 ;;
10927 *) echo 'pthread_yield() NOT found.' >&4 ;;
10931 set d_pthread_yield
10934 case "$sched_yield" in
10935 '') sched_yield=undef ;;
10940 : see if this is a pwd.h system
10946 xxx=`./findhdr pwd.h`
10947 $cppstdin $cppflags $cppminus < $xxx >$$.h
10949 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
10957 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
10965 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
10973 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
10981 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
10989 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
10997 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
11005 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
11017 set d_pwquota; eval $setvar
11018 set d_pwage; eval $setvar
11019 set d_pwchange; eval $setvar
11020 set d_pwclass; eval $setvar
11021 set d_pwexpire; eval $setvar
11022 set d_pwcomment; eval $setvar
11023 set d_pwgecos; eval $setvar
11024 set d_pwpasswd; eval $setvar
11028 : see if readdir and friends exist
11029 set readdir d_readdir
11031 set seekdir d_seekdir
11033 set telldir d_telldir
11035 set rewinddir d_rewinddir
11038 : see if readlink exists
11039 set readlink d_readlink
11042 : see if readv exists
11046 : see if recvmsg exists
11047 set recvmsg d_recvmsg
11050 : see if rename exists
11051 set rename d_rename
11054 : see if rmdir exists
11058 : see if memory.h is available.
11063 : See if it conflicts with string.h
11069 $cppstdin $cppflags $cppminus < $strings > mem.h
11070 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
11072 echo "We won't be including <memory.h>."
11082 : can bcopy handle overlapping blocks?
11087 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
11089 #$i_memory I_MEMORY
11090 #$i_stdlib I_STDLIB
11091 #$i_string I_STRING
11092 #$i_unistd I_UNISTD
11094 $cat >>try.c <<'EOCP'
11097 # include <memory.h>
11100 # include <stdlib.h>
11103 # include <string.h>
11105 # include <strings.h>
11108 # include <unistd.h> /* Needed for NetBSD */
11112 char buf[128], abc[128];
11118 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
11120 for (align = 7; align >= 0; align--) {
11121 for (len = 36; len; len--) {
11123 bcopy(abc, b, len);
11124 for (off = 1; off <= len; off++) {
11125 bcopy(b, b+off, len);
11126 bcopy(b+off, b, len);
11127 if (bcmp(b, abc, len))
11136 if eval $compile_ok; then
11137 if ./try 2>/dev/null; then
11138 echo "Yes, it can."
11141 echo "It can't, sorry."
11142 case "$d_memmove" in
11143 "$define") echo "But that's Ok since you have memmove()." ;;
11147 echo "(I can't compile the test program, so we'll assume not...)"
11148 case "$d_memmove" in
11149 "$define") echo "But that's Ok since you have memmove()." ;;
11154 $rm -f try.* try core
11158 : can memcpy handle overlapping blocks?
11160 case "$d_memcpy" in
11163 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
11165 #$i_memory I_MEMORY
11166 #$i_stdlib I_STDLIB
11167 #$i_string I_STRING
11168 #$i_unistd I_UNISTD
11170 $cat >>try.c <<'EOCP'
11173 # include <memory.h>
11176 # include <stdlib.h>
11179 # include <string.h>
11181 # include <strings.h>
11184 # include <unistd.h> /* Needed for NetBSD */
11188 char buf[128], abc[128];
11194 /* Copy "abcde..." string to char abc[] so that gcc doesn't
11195 try to store the string in read-only memory. */
11196 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
11198 for (align = 7; align >= 0; align--) {
11199 for (len = 36; len; len--) {
11201 memcpy(b, abc, len);
11202 for (off = 1; off <= len; off++) {
11203 memcpy(b+off, b, len);
11204 memcpy(b, b+off, len);
11205 if (memcmp(b, abc, len))
11214 if eval $compile_ok; then
11215 if ./try 2>/dev/null; then
11216 echo "Yes, it can."
11219 echo "It can't, sorry."
11220 case "$d_memmove" in
11221 "$define") echo "But that's Ok since you have memmove()." ;;
11225 echo "(I can't compile the test program, so we'll assume not...)"
11226 case "$d_memmove" in
11227 "$define") echo "But that's Ok since you have memmove()." ;;
11232 $rm -f try.* try core
11236 : can memcmp be trusted to compare relative magnitude?
11238 case "$d_memcmp" in
11241 echo "Checking if your memcmp() can compare relative magnitude..." >&4
11243 #$i_memory I_MEMORY
11244 #$i_stdlib I_STDLIB
11245 #$i_string I_STRING
11246 #$i_unistd I_UNISTD
11248 $cat >>try.c <<'EOCP'
11251 # include <memory.h>
11254 # include <stdlib.h>
11257 # include <string.h>
11259 # include <strings.h>
11262 # include <unistd.h> /* Needed for NetBSD */
11268 if ((a < b) && memcmp(&a, &b, 1) < 0)
11274 if eval $compile_ok; then
11275 if ./try 2>/dev/null; then
11276 echo "Yes, it can."
11279 echo "No, it can't (it uses signed chars)."
11282 echo "(I can't compile the test program, so we'll assume not...)"
11286 $rm -f try.* try core
11290 : see if prototype for sbrk is available
11292 set d_sbrkproto sbrk $i_unistd unistd.h
11295 : see if select exists
11296 set select d_select
11299 : see if semctl exists
11300 set semctl d_semctl
11303 : see if semget exists
11304 set semget d_semget
11307 : see if semop exists
11311 : see how much of the 'sem*(2)' library is present.
11314 case "$d_semctl$d_semget$d_semop" in
11315 *"$undef"*) h_sem=false;;
11319 case "`ipcs 2>&1`" in
11320 "SVID messages"*"not configured"*)
11321 echo "Your $osname does not have the sem*(2) configured." >&4
11324 set semctl d_semctl
11326 set semget d_semget
11334 : we could also check for sys/ipc.h ...
11335 if $h_sem && $test `./findhdr sys/sem.h`; then
11336 echo "You have the full sem*(2) library." >&4
11339 echo "You don't have the full sem*(2) library." >&4
11345 : see whether sys/sem.h defines union semun
11347 $cat > try.c <<'END'
11348 #include <sys/types.h>
11349 #include <sys/ipc.h>
11350 #include <sys/sem.h>
11351 int main () { union semun semun; semun.buf = 0; }
11354 if eval $compile; then
11355 echo "You have union semun in <sys/sem.h>." >&4
11358 echo "You do not have union semun in <sys/sem.h>." >&4
11361 $rm -f try try.c try.h
11365 : see how to do semctl IPC_STAT
11368 : see whether semctl IPC_STAT can use union semun
11373 # define S_IRUSR S_IREAD
11374 # define S_IWUSR S_IWRITE
11375 # define S_IXUSR S_IEXEC
11377 # define S_IRUSR 0400
11378 # define S_IWUSR 0200
11379 # define S_IXUSR 0100
11381 # define S_IRGRP (S_IRUSR>>3)
11382 # define S_IWGRP (S_IWUSR>>3)
11383 # define S_IXGRP (S_IXUSR>>3)
11384 # define S_IROTH (S_IRUSR>>6)
11385 # define S_IWOTH (S_IWUSR>>6)
11386 # define S_IXOTH (S_IXUSR>>6)
11389 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
11390 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
11391 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
11396 #include <sys/types.h>
11397 #include <sys/ipc.h>
11398 #include <sys/sem.h>
11399 #include <sys/stat.h>
11406 #$d_union_semun HAS_UNION_SEMUN
11409 #ifndef HAS_UNION_SEMUN
11412 struct semid_ds *buf;
11413 unsigned short *array;
11419 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
11420 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
11422 struct semid_ds argbuf;
11425 st = semctl(sem, 0, IPC_STAT, arg);
11429 # endif /* IPC_STAT */
11430 printf("semctl IPC_STAT failed: errno = %d\n", errno);
11432 if (semctl(sem, 0, IPC_RMID, arg) != 0)
11433 # endif /* IPC_RMID */
11434 printf("semctl IPC_RMID failed: errno = %d\n", errno);
11436 #endif /* IPC_PRIVATE && ... */
11437 printf("semget failed: errno = %d\n", errno);
11443 if eval $compile; then
11446 semun) val="$define" ;;
11452 case "$d_semctl_semun" in
11454 echo "You can use union semun for semctl IPC_STAT." >&4
11457 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
11462 : see whether semctl IPC_STAT can use struct semid_ds pointer
11463 $cat > try.c <<'END'
11464 #include <sys/types.h>
11465 #include <sys/ipc.h>
11466 #include <sys/sem.h>
11467 #include <sys/stat.h>
11475 struct semid_ds arg;
11478 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
11479 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
11482 st = semctl(sem, 0, IPC_STAT, &arg);
11484 printf("semid_ds\n");
11486 # endif /* IPC_STAT */
11487 printf("semctl IPC_STAT failed: errno = %d\n", errno);
11489 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
11490 # endif /* IPC_RMID */
11491 printf("semctl IPC_RMID failed: errno = %d\n", errno);
11493 #endif /* IPC_PRIVATE && ... */
11494 printf("semget failed: errno = %d\n", errno);
11501 if eval $compile; then
11504 semid_ds) val="$define" ;;
11508 set d_semctl_semid_ds
11510 case "$d_semctl_semid_ds" in
11512 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
11514 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
11521 # We do not have the full sem*(2) library, so assume we can not
11527 set d_semctl_semid_ds
11532 : see if sendmsg exists
11533 set sendmsg d_sendmsg
11536 : see if setegid exists
11537 set setegid d_setegid
11540 : see if seteuid exists
11541 set seteuid d_seteuid
11544 : see if setgrent exists
11545 set setgrent d_setgrent
11548 : see if sethostent exists
11549 set sethostent d_sethent
11552 : see if setitimer exists
11553 set setitimer d_setitimer
11556 : see if setlinebuf exists
11557 set setlinebuf d_setlinebuf
11560 : see if setlocale exists
11561 set setlocale d_setlocale
11564 : see if setnetent exists
11565 set setnetent d_setnent
11568 : see if setprotoent exists
11569 set setprotoent d_setpent
11572 : see if setpgid exists
11573 set setpgid d_setpgid
11576 : see if setpgrp2 exists
11577 set setpgrp2 d_setpgrp2
11580 : see if setpriority exists
11581 set setpriority d_setprior
11584 : see if setproctitle exists
11585 set setproctitle d_setproctitle
11588 : see if setpwent exists
11589 set setpwent d_setpwent
11592 : see if setregid exists
11593 set setregid d_setregid
11595 set setresgid d_setresgid
11598 : see if setreuid exists
11599 set setreuid d_setreuid
11601 set setresuid d_setresuid
11604 : see if setrgid exists
11605 set setrgid d_setrgid
11608 : see if setruid exists
11609 set setruid d_setruid
11612 : see if setservent exists
11613 set setservent d_setsent
11616 : see if setsid exists
11617 set setsid d_setsid
11620 : see if setvbuf exists
11621 set setvbuf d_setvbuf
11624 : see if sfio.h is available
11629 : see if sfio library is available
11640 : Ok, but do we want to use it.
11644 true|$define|[yY]*) dflt='y';;
11647 echo "$package can use the sfio library, but it is experimental."
11648 case "$useperlio" in
11650 echo "For sfio also the PerlIO abstraction layer is needed."
11651 echo "Earlier you said you wouldn't want that."
11654 rp="You seem to have sfio available, do you want to try using it?"
11657 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
11658 useperlio="$define"
11661 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
11666 *) case "$usesfio" in
11667 true|$define|[yY]*)
11668 echo "Sorry, cannot find sfio on this machine." >&4
11669 echo "Ignoring your setting of usesfio=$usesfio." >&4
11678 $define) usesfio='true';;
11679 *) usesfio='false';;
11683 *) : Remove sfio from list of libraries to use
11684 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
11687 echo "libs = $libs" >&4
11692 : see if shmctl exists
11693 set shmctl d_shmctl
11696 : see if shmget exists
11697 set shmget d_shmget
11700 : see if shmat exists
11703 : see what shmat returns
11706 $cat >shmat.c <<'END'
11707 #include <sys/shm.h>
11710 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
11715 echo "and it returns ($shmattype)." >&4
11716 : see if a prototype for shmat is available
11717 xxx=`./findhdr sys/shm.h`
11718 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
11719 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
11730 set d_shmatprototype
11733 : see if shmdt exists
11737 : see how much of the 'shm*(2)' library is present.
11740 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
11741 *"$undef"*) h_shm=false;;
11745 case "`ipcs 2>&1`" in
11746 "SVID shared memory"*"not configured"*)
11747 echo "Your $osname does not have the shm*(2) configured." >&4
11750 set shmctl d_shmctl
11752 set shmget d_shmget
11762 : we could also check for sys/ipc.h ...
11763 if $h_shm && $test `./findhdr sys/shm.h`; then
11764 echo "You have the full shm*(2) library." >&4
11767 echo "You don't have the full shm*(2) library." >&4
11774 : see if we have sigaction
11775 if set sigaction val -f d_sigaction; eval $csym; $val; then
11776 echo 'sigaction() found.' >&4
11777 $cat > try.c <<'EOP'
11779 #include <sys/types.h>
11780 #include <signal.h>
11783 struct sigaction act, oact;
11785 oact.sa_handler = 0;
11786 /* so that act and oact are used */
11787 exit(act.sa_flags == 0 && oact.sa_handler == 0);
11791 if eval $compile_ok; then
11794 echo "But you don't seem to have a useable struct sigaction." >&4
11798 echo 'sigaction NOT found.' >&4
11801 set d_sigaction; eval $setvar
11802 $rm -f try try$_o try.c
11804 : see if sigprocmask exists
11805 set sigprocmask d_sigprocmask
11808 : see if sigsetjmp exists
11810 case "$d_sigsetjmp" in
11812 $cat >try.c <<'EOP'
11813 #include <setjmp.h>
11818 if (sigsetjmp(env,1))
11821 siglongjmp(env, 1);
11826 if eval $compile; then
11827 if ./try >/dev/null 2>&1; then
11828 echo "POSIX sigsetjmp found." >&4
11832 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
11838 echo "sigsetjmp not found." >&4
11842 *) val="$d_sigsetjmp"
11843 case "$d_sigsetjmp" in
11844 $define) echo "POSIX sigsetjmp found." >&4;;
11845 $undef) echo "sigsetjmp not found." >&4;;
11853 : see if sockatmark exists
11854 set sockatmark d_sockatmark
11857 : see if socks5_init exists
11858 set socks5_init d_socks5_init
11861 : see if sys/stat.h is available
11862 set sys/stat.h i_sysstat
11866 : see if stat knows about block sizes
11868 echo "Checking to see if your struct stat has st_blocks field..." >&4
11869 set d_statblks stat st_blocks $i_sysstat sys/stat.h
11873 : see if this is a sys/vfs.h system
11874 set sys/vfs.h i_sysvfs
11878 : see if this is a sys/statfs.h system
11879 set sys/statfs.h i_sysstatfs
11884 echo "Checking to see if your system supports struct statfs..." >&4
11885 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
11887 case "$d_statfs_s" in
11888 "$define") echo "Yes, it does." ;;
11889 *) echo "No, it doesn't." ;;
11894 : see if struct statfs knows about f_flags
11895 case "$d_statfs_s" in
11898 echo "Checking to see if your struct statfs has f_flags field..." >&4
11899 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
11903 set d_statfs_f_flags
11907 case "$d_statfs_f_flags" in
11908 "$define") echo "Yes, it does." ;;
11909 *) echo "No, it doesn't." ;;
11912 : see if _ptr and _cnt from stdio act std
11915 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
11916 echo "(Looks like you have stdio.h from BSD.)"
11917 case "$stdio_ptr" in
11918 '') stdio_ptr='((fp)->_p)'
11921 *) ptr_lval=$d_stdio_ptr_lval;;
11923 case "$stdio_cnt" in
11924 '') stdio_cnt='((fp)->_r)'
11927 *) cnt_lval=$d_stdio_cnt_lval;;
11929 case "$stdio_base" in
11930 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
11932 case "$stdio_bufsiz" in
11933 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
11935 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
11936 echo "(Looks like you have stdio.h from Linux.)"
11937 case "$stdio_ptr" in
11938 '') stdio_ptr='((fp)->_IO_read_ptr)'
11941 *) ptr_lval=$d_stdio_ptr_lval;;
11943 case "$stdio_cnt" in
11944 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
11947 *) cnt_lval=$d_stdio_cnt_lval;;
11949 case "$stdio_base" in
11950 '') stdio_base='((fp)->_IO_read_base)';;
11952 case "$stdio_bufsiz" in
11953 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
11956 case "$stdio_ptr" in
11957 '') stdio_ptr='((fp)->_ptr)'
11960 *) ptr_lval=$d_stdio_ptr_lval;;
11962 case "$stdio_cnt" in
11963 '') stdio_cnt='((fp)->_cnt)'
11966 *) cnt_lval=$d_stdio_cnt_lval;;
11968 case "$stdio_base" in
11969 '') stdio_base='((fp)->_base)';;
11971 case "$stdio_bufsiz" in
11972 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
11976 : test whether _ptr and _cnt really work
11977 echo "Checking how std your stdio is..." >&4
11980 #define FILE_ptr(fp) $stdio_ptr
11981 #define FILE_cnt(fp) $stdio_cnt
11983 FILE *fp = fopen("try.c", "r");
11986 18 <= FILE_cnt(fp) &&
11987 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
11995 if eval $compile; then
11997 echo "Your stdio acts pretty std."
12000 echo "Your stdio isn't very std."
12003 echo "Your stdio doesn't appear very std."
12009 : Can _ptr be used as an lvalue?
12010 case "$d_stdstdio$ptr_lval" in
12011 $define$define) val=$define ;;
12014 set d_stdio_ptr_lval
12017 : Can _cnt be used as an lvalue?
12018 case "$d_stdstdio$cnt_lval" in
12019 $define$define) val=$define ;;
12022 set d_stdio_cnt_lval
12026 : test whether setting _ptr sets _cnt as a side effect
12027 d_stdio_ptr_lval_sets_cnt="$undef"
12028 d_stdio_ptr_lval_nochange_cnt="$undef"
12029 case "$d_stdio_ptr_lval$d_stdstdio" in
12031 echo "Checking to see what happens if we set the stdio ptr..." >&4
12034 /* Can we scream? */
12035 /* Eat dust sed :-) */
12036 /* In the buffer space, no one can hear you scream. */
12037 #define FILE_ptr(fp) $stdio_ptr
12038 #define FILE_cnt(fp) $stdio_cnt
12039 #include <sys/types.h>
12041 FILE *fp = fopen("try.c", "r");
12046 puts("Fail even to read");
12049 c = getc(fp); /* Read away the first # */
12051 puts("Fail even to read");
12055 18 <= FILE_cnt(fp) &&
12056 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12058 puts("Fail even to read");
12061 ptr = (char*) FILE_ptr(fp);
12062 cnt = (size_t)FILE_cnt(fp);
12064 FILE_ptr(fp) += 42;
12066 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12067 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12070 if (FILE_cnt(fp) <= 20) {
12071 printf ("Fail (<20 chars to test)");
12074 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12075 puts("Fail compare");
12078 if (cnt == FILE_cnt(fp)) {
12079 puts("Pass_unchanged");
12082 if (FILE_cnt(fp) == (cnt - 42)) {
12083 puts("Pass_changed");
12086 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12092 if eval $compile; then
12093 case `./try$exe_ext` in
12095 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12096 d_stdio_ptr_lval_sets_cnt="$define" ;;
12098 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12099 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12101 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12103 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12106 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12112 : see if _base is also standard
12114 case "$d_stdstdio" in
12118 #define FILE_base(fp) $stdio_base
12119 #define FILE_bufsiz(fp) $stdio_bufsiz
12121 FILE *fp = fopen("try.c", "r");
12124 19 <= FILE_bufsiz(fp) &&
12125 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
12132 if eval $compile; then
12134 echo "And its _base field acts std."
12137 echo "But its _base field isn't std."
12140 echo "However, it seems to be lacking the _base field."
12149 Checking how to access stdio streams by file descriptor number...
12151 case "$stdio_stream_array" in
12152 '') $cat >try.c <<EOCP
12155 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
12159 for s in _iob __iob __sF
12161 set try -DSTDIO_STREAM_ARRAY=$s
12162 if eval $compile; then
12163 case "`./try$exe_ext`" in
12164 yes) stdio_stream_array=$s; break ;;
12168 $rm -f try.* try$exe_ext
12170 case "$stdio_stream_array" in
12172 I can't figure out how to access stdio streams by file descriptor number.
12174 d_stdio_stream_array="$undef"
12177 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
12179 d_stdio_stream_array="$define"
12183 : see if strcoll exists
12184 set strcoll d_strcoll
12187 : check for structure copying
12189 echo "Checking to see if your C compiler can copy structs..." >&4
12190 $cat >try.c <<'EOCP'
12200 if $cc -c try.c >/dev/null 2>&1 ; then
12202 echo "Yup, it can."
12205 echo "Nope, it can't."
12211 : see if strerror and/or sys_errlist[] exist
12213 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
12214 if set strerror val -f d_strerror; eval $csym; $val; then
12215 echo 'strerror() found.' >&4
12216 d_strerror="$define"
12217 d_strerrm='strerror(e)'
12218 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
12219 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
12220 d_syserrlst="$define"
12222 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
12223 d_syserrlst="$undef"
12225 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
12226 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
12227 echo 'strerror() found in string header.' >&4
12228 d_strerror="$define"
12229 d_strerrm='strerror(e)'
12230 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
12231 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
12232 d_syserrlst="$define"
12234 echo "(You don't appear to have any sys_errlist[], how can this be?)"
12235 d_syserrlst="$undef"
12237 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
12238 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
12239 d_strerror="$undef"
12240 d_syserrlst="$define"
12241 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
12243 echo 'strerror() and sys_errlist[] NOT found.' >&4
12244 d_strerror="$undef"
12245 d_syserrlst="$undef"
12246 d_strerrm='"unknown"'
12250 : see if strftime exists
12251 set strftime d_strftime
12254 : see if strtod exists
12255 set strtod d_strtod
12258 : see if strtol exists
12259 set strtol d_strtol
12262 : see if strtold exists
12263 set strtold d_strtold
12266 : see if strtoll exists
12267 set strtoll d_strtoll
12270 case "$d_longlong-$d_strtoll" in
12273 Checking whether your strtoll() works okay...
12275 $cat >try.c <<'EOCP'
12278 #define strtoll __strtoll
12281 #define strtoll _strtoll
12284 extern long long int strtoll(char *s, char **, int);
12285 static int bad = 0;
12286 int check(char *s, long long ell, int een) {
12289 gll = strtoll(s, 0, 10);
12290 if (!((gll == ell) && (errno == een)))
12294 check(" 1", 1LL, 0);
12295 check(" 0", 0LL, 0);
12296 check("-1", -1LL, 0);
12297 check("-9223372036854775808", -9223372036854775808LL, 0);
12298 check("-9223372036854775808", -9223372036854775808LL, 0);
12299 check(" 9223372036854775807", 9223372036854775807LL, 0);
12300 check("-9223372036854775808", -9223372036854775808LL, 0);
12301 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
12302 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
12308 if eval $compile; then
12311 ok) echo "Your strtoll() seems to be working okay." ;;
12313 Your strtoll() doesn't seem to be working okay.
12319 echo "(I can't seem to compile the test program--assuming it doesn't)"
12325 : see if strtoq exists
12326 set strtoq d_strtoq
12329 : see if strtoul exists
12330 set strtoul d_strtoul
12333 case "$d_strtoul" in
12336 Checking whether your strtoul() works okay...
12338 $cat >try.c <<'EOCP'
12341 extern unsigned long int strtoul(char *s, char **, int);
12342 static int bad = 0;
12343 void check(char *s, unsigned long eul, int een) {
12346 gul = strtoul(s, 0, 10);
12347 if (!((gul == eul) && (errno == een)))
12351 check(" 1", 1L, 0);
12352 check(" 0", 0L, 0);
12354 case "$longsize" in
12356 $cat >>try.c <<'EOCP'
12357 check("18446744073709551615", 18446744073709551615UL, 0);
12358 check("18446744073709551616", 18446744073709551615UL, ERANGE);
12359 #if 0 /* strtoul() for /^-/ strings is undefined. */
12360 check("-1", 18446744073709551615UL, 0);
12361 check("-18446744073709551614", 2, 0);
12362 check("-18446744073709551615", 1, 0);
12363 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
12364 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
12369 $cat >>try.c <<'EOCP'
12370 check("4294967295", 4294967295UL, 0);
12371 check("4294967296", 4294967295UL, ERANGE);
12372 #if 0 /* strtoul() for /^-/ strings is undefined. */
12373 check("-1", 4294967295UL, 0);
12374 check("-4294967294", 2, 0);
12375 check("-4294967295", 1, 0);
12376 check("-4294967296", 4294967295UL, ERANGE);
12377 check("-4294967297", 4294967295UL, ERANGE);
12382 : Should we write these tests to be more portable by sprintf-ing
12383 : ~0 and then manipulating that char string as input for strtol?
12386 $cat >>try.c <<'EOCP'
12393 if eval $compile; then
12395 ok) echo "Your strtoul() seems to be working okay." ;;
12397 Your strtoul() doesn't seem to be working okay.
12406 : see if strtoull exists
12407 set strtoull d_strtoull
12410 case "$d_longlong-$d_strtoull" in
12413 Checking whether your strtoull() works okay...
12415 $cat >try.c <<'EOCP'
12418 #define strtoull __strtoull
12421 extern unsigned long long int strtoull(char *s, char **, int);
12422 static int bad = 0;
12423 int check(char *s, long long eull, int een) {
12426 gull = strtoull(s, 0, 10);
12427 if (!((gull == eull) && (errno == een)))
12431 check(" 1", 1LL, 0);
12432 check(" 0", 0LL, 0);
12433 check("18446744073709551615", 18446744073709551615ULL, 0);
12434 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
12435 #if 0 /* strtoull() for /^-/ strings is undefined. */
12436 check("-1", 18446744073709551615ULL, 0);
12437 check("-18446744073709551614", 2LL, 0);
12438 check("-18446744073709551615", 1LL, 0);
12439 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
12440 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
12447 if eval $compile; then
12449 ok) echo "Your strtoull() seems to be working okay." ;;
12451 Your strtoull() doesn't seem to be working okay.
12453 d_strtoull="$undef"
12460 : see if strtouq exists
12461 set strtouq d_strtouq
12464 case "$d_strtouq" in
12467 Checking whether your strtouq() works okay...
12469 $cat >try.c <<'EOCP'
12472 extern unsigned long long int strtouq(char *s, char **, int);
12473 static int bad = 0;
12474 void check(char *s, unsigned long long eull, int een) {
12475 unsigned long long gull;
12477 gull = strtouq(s, 0, 10);
12478 if (!((gull == eull) && (errno == een)))
12482 check(" 1", 1LL, 0);
12483 check(" 0", 0LL, 0);
12484 check("18446744073709551615", 18446744073709551615ULL, 0);
12485 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
12486 #if 0 /* strtouq() for /^-/ strings is undefined. */
12487 check("-1", 18446744073709551615ULL, 0);
12488 check("-18446744073709551614", 2LL, 0);
12489 check("-18446744073709551615", 1LL, 0);
12490 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
12491 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
12499 if eval $compile; then
12501 ok) echo "Your strtouq() seems to be working okay." ;;
12503 Your strtouq() doesn't seem to be working okay.
12512 : see if strxfrm exists
12513 set strxfrm d_strxfrm
12516 : see if symlink exists
12517 set symlink d_symlink
12520 : see if syscall exists
12521 set syscall d_syscall
12524 : see if sysconf exists
12525 set sysconf d_sysconf
12528 : see if system exists
12529 set system d_system
12532 : see if tcgetpgrp exists
12533 set tcgetpgrp d_tcgetpgrp
12536 : see if tcsetpgrp exists
12537 set tcsetpgrp d_tcsetpgrp
12540 : see if prototype for telldir is available
12542 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
12545 : see if this is a sys/times.h system
12546 set sys/times.h i_systimes
12549 : see if times exists
12551 if set times val -f d_times; eval $csym; $val; then
12552 echo 'times() found.' >&4
12555 case "$i_systimes" in
12556 "$define") inc='sys/times.h';;
12558 rp="What is the type returned by times() on this system?"
12559 set clock_t clocktype long stdio.h sys/types.h $inc
12562 echo 'times() NOT found, hope that will do.' >&4
12567 : see if truncate exists
12568 set truncate d_truncate
12571 : see if tzname[] exists
12573 if set tzname val -a d_tzname; eval $csym; $val; then
12575 echo 'tzname[] found.' >&4
12578 echo 'tzname[] NOT found.' >&4
12583 case "$crosscompile" in
12584 ''|[nN]*) crosscompile="$undef" ;;
12588 next|rhapsody|darwin) multiarch="$define" ;;
12590 case "$multiarch" in
12591 ''|[nN]*) multiarch="$undef" ;;
12594 : check for ordering of bytes in a long
12596 case "$crosscompile$multiarch" in
12599 You seem to be either cross-compiling or doing a multiarchitecture build,
12600 skipping the byteorder check.
12606 case "$byteorder" in
12609 In the following, larger digits indicate more significance. A big-endian
12610 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
12611 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
12612 machines may have weird orders like 3412. A Cray will report 87654321,
12613 an Alpha will report 12345678. If the test program works the default is
12615 I'm now running the test program...
12617 $cat >try.c <<'EOCP'
12624 char c[sizeof(long)];
12627 if (sizeof(long) > 4)
12628 u.l = (0x08070605L << 32) | 0x04030201L;
12631 for (i = 0; i < sizeof(long); i++)
12632 printf("%c", u.c[i]+'0');
12639 if eval $compile && ./try > /dev/null; then
12642 [1-4][1-4][1-4][1-4]|12345678|87654321)
12643 echo "(The test program ran ok.)"
12644 echo "byteorder=$dflt"
12647 ????|????????) echo "(The test program ran ok.)" ;;
12648 *) echo "(The test program didn't run right for some reason.)" ;;
12653 (I can't seem to compile the test program. Guessing big-endian...)
12656 case "$xxx_prompt" in
12658 rp="What is the order of bytes in a long?"
12674 Checking to see whether you can access character data unalignedly...
12678 #define U32 $u32type
12679 #define BYTEORDER $byteorder
12681 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
12682 U8 buf[] = "\0\0\0\1\0\0\0\0";
12686 if (sizeof(U32) != 4) {
12687 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
12693 for (i = 0; i < 4; i++) {
12694 up = (U32*)(buf + i);
12695 if (! ((*up == 1 << (8*i)) || /* big-endian */
12696 (*up == 1 << (8*(3-i))) /* little-endian */
12700 printf("read failed (%x)\n", *up);
12706 for (i = 0; i < 4; i++) {
12707 up = (U32*)(buf + i);
12709 if (*up != 0xBeef) {
12710 printf("write failed (%x)\n", *up);
12724 if eval $compile_ok; then
12725 echo "(This test may dump core.)" >&4
12726 ./try >&2 >/dev/null
12729 You can access character data pretty unalignedly.
12731 d_u32align="$undef"
12734 It seems that you must access character data in an aligned manner.
12736 d_u32align="$define"
12739 $rm -f core core.try.* try.core
12741 rp='Can you access character data at unaligned addresses?'
12745 [yY]*) d_u32align="$undef" ;;
12746 *) d_u32align="$define" ;;
12750 : see if ualarm exists
12751 set ualarm d_ualarm
12754 : see if umask exists
12758 : see if usleep exists
12759 set usleep d_usleep
12762 : see if ustat exists
12766 : backward compatibility for d_hvfork
12767 if test X$d_hvfork != X; then
12768 d_vfork="$d_hvfork"
12771 : see if there is a vfork
12776 : Ok, but do we want to use it. vfork is reportedly unreliable in
12777 : perl on Solaris 2.x, and probably elsewhere.
12781 case "$usevfork" in
12787 Perl can only use a vfork() that doesn't suffer from strict
12788 restrictions on calling functions or modifying global data in
12789 the child. For example, glibc-2.1 contains such a vfork()
12790 that is unsuitable. If your system provides a proper fork()
12791 call, chances are that you do NOT want perl to use vfork().
12794 rp="Do you still want to use vfork()?"
12799 echo "Ok, we won't use vfork()."
12808 $define) usevfork='true';;
12809 *) usevfork='false';;
12812 : see if this is an sysdir system
12813 set sys/dir.h i_sysdir
12816 : see if this is an sysndir system
12817 set sys/ndir.h i_sysndir
12820 : see if closedir exists
12821 set closedir d_closedir
12824 case "$d_closedir" in
12827 echo "Checking whether closedir() returns a status..." >&4
12828 cat > closedir.c <<EOM
12829 #$i_dirent I_DIRENT /**/
12830 #$i_sysdir I_SYS_DIR /**/
12831 #$i_sysndir I_SYS_NDIR /**/
12832 #$i_systypes I_SYS_TYPES /**/
12834 #if defined(I_SYS_TYPES)
12835 #include <sys/types.h>
12837 #if defined(I_DIRENT)
12838 #include <dirent.h>
12839 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
12840 #include <sys/dir.h>
12844 #include <sys/ndir.h>
12848 #include <ndir.h> /* may be wrong in the future */
12850 #include <sys/dir.h>
12855 int main() { return closedir(opendir(".")); }
12858 if eval $compile_ok; then
12859 if ./closedir > /dev/null 2>&1 ; then
12860 echo "Yes, it does."
12863 echo "No, it doesn't."
12867 echo "(I can't seem to compile the test program--assuming it doesn't)"
12875 set d_void_closedir
12878 : see if there is a wait4
12882 : see if waitpid exists
12883 set waitpid d_waitpid
12886 : see if wcstombs exists
12887 set wcstombs d_wcstombs
12890 : see if wctomb exists
12891 set wctomb d_wctomb
12894 : see if writev exists
12895 set writev d_writev
12898 : preserve RCS keywords in files with variable substitution, grrr
12903 Revision='$Revision'
12905 : check for alignment requirements
12907 case "$crosscompile$multiarch" in
12910 You seem to be either cross-compiling or doing a multiarchitecture build,
12911 skipping the memory alignment check.
12914 case "$alignbytes" in
12915 '') alignbytes=8 ;;
12919 case "$alignbytes" in
12920 '') echo "Checking alignment constraints..." >&4
12921 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
12922 $cat >try.c <<'EOCP'
12923 typedef long double NV;
12926 $cat >try.c <<'EOCP'
12930 $cat >>try.c <<'EOCP'
12938 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
12943 if eval $compile_ok; then
12947 echo "(I can't seem to compile the test program...)"
12950 *) dflt="$alignbytes"
12953 rp="Doubles must be aligned on a how-many-byte boundary?"
12961 : set the base revision
12964 : how do we catenate cpp tokens here?
12966 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
12967 $cat >cpp_stuff.c <<'EOCP'
12968 #define RCAT(a,b)a/**/b
12969 #define ACAT(a,b)a ## b
12973 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
12974 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
12975 echo "Oh! Smells like ANSI's been here." >&4
12976 echo "We can catify or stringify, separately or together!"
12978 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
12979 echo "Ah, yes! The good old days!" >&4
12980 echo "However, in the good old days we don't know how to stringify and"
12981 echo "catify at the same time."
12985 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
12986 to have to edit the values of CAT[2-5] in config.h...
12988 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
12992 : see if this is a db.h system
12998 : Check db version.
13000 echo "Checking Berkeley DB version ..." >&4
13006 #include <sys/types.h>
13011 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
13012 int Major, Minor, Patch ;
13013 unsigned long Version ;
13014 (void)db_version(&Major, &Minor, &Patch) ;
13015 printf("You have Berkeley DB Version 2 or greater\n");
13017 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
13018 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
13019 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
13020 Major, Minor, Patch) ;
13022 /* check that db.h & libdb are compatible */
13023 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
13024 printf("db.h and libdb are incompatible\n") ;
13028 printf("db.h and libdb are compatible\n") ;
13030 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
13031 + DB_VERSION_PATCH ;
13033 /* needs to be >= 2.3.4 */
13034 if (Version < 2003004) {
13035 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
13036 printf("but Perl needs Berkeley DB 2.3.4 or greater\n") ;
13042 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
13043 printf("You have Berkeley DB Version 1\n");
13044 exit(0); /* DB version < 2: the coast is clear. */
13046 exit(1); /* <db.h> not Berkeley DB? */
13052 if eval $compile_ok && ./try; then
13053 echo 'Looks OK.' >&4
13055 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
13059 : Remove db from list of libraries to use
13060 echo "Removing unusable -ldb from library list" >&4
13061 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
13064 echo "libs = $libs" >&4
13074 : Check the return type needed for hash
13076 echo "Checking return type needed for hash for Berkeley DB ..." >&4
13082 #include <sys/types.h>
13085 #ifndef DB_VERSION_MAJOR
13086 u_int32_t hash_cb (ptr, size)
13094 info.hash = hash_cb;
13098 if $cc $ccflags -c try.c >try.out 2>&1 ; then
13099 if $contains warning try.out >>/dev/null 2>&1 ; then
13102 db_hashtype='u_int32_t'
13105 : XXX Maybe we should just give up here.
13106 db_hashtype=u_int32_t
13108 echo "Help: I can't seem to compile the db test program." >&4
13109 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
13112 echo "Your version of Berkeley DB uses $db_hashtype for hash."
13114 *) db_hashtype=u_int32_t
13119 : Check the return type needed for prefix
13121 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
13127 #include <sys/types.h>
13130 #ifndef DB_VERSION_MAJOR
13131 size_t prefix_cb (key1, key2)
13139 info.prefix = prefix_cb;
13143 if $cc $ccflags -c try.c >try.out 2>&1 ; then
13144 if $contains warning try.out >>/dev/null 2>&1 ; then
13145 db_prefixtype='int'
13147 db_prefixtype='size_t'
13150 db_prefixtype='size_t'
13151 : XXX Maybe we should just give up here.
13153 echo "Help: I can't seem to compile the db test program." >&4
13154 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
13157 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
13159 *) db_prefixtype='size_t'
13164 : How can we generate normalized random numbers ?
13166 echo "Looking for a random number function..." >&4
13167 case "$randfunc" in
13169 if set drand48 val -f; eval $csym; $val; then
13171 echo "Good, found drand48()." >&4
13172 elif set random val -f; eval $csym; $val; then
13174 echo "OK, found random()." >&4
13177 echo "Yick, looks like I have to use rand()." >&4
13188 *-Dmy_rand=*|*-Dmy_srand=*)
13189 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
13190 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
13191 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
13192 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
13196 while $test "$cont"; do
13197 rp="Use which function to generate random numbers?"
13199 if $test "$ans" = "$dflt"; then
13205 if set $ans val -f; eval $csym; $val; then
13209 rp="I cannot find function $ans. Use that name anyway?"
13218 case "$randfunc" in
13220 drand01="drand48()"
13226 case "$randbits" in
13228 echo "Checking to see how many bits your $randfunc() function produces..." >&4
13230 #$i_unistd I_UNISTD
13231 #$i_stdlib I_STDLIB
13234 # include <unistd.h>
13237 # include <stdlib.h>
13242 register unsigned long tmp;
13243 register unsigned long max = 0L;
13245 for (i = 1000; i; i--) {
13246 tmp = (unsigned long) $randfunc();
13247 if (tmp > max) max = tmp;
13249 for (i = 0; max; i++)
13255 if eval $compile_ok; then
13259 echo "(I can't seem to compile the test program...)"
13266 rp="How many bits does your $randfunc() function produce?"
13270 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
13271 seedfunc="s$randfunc"
13272 randseedtype=unsigned
13276 rp="How many bits does your $randfunc() function produce?"
13279 seedfunc="s$randfunc"
13280 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
13281 if set $seedfunc val -f; eval $csym; $val; then
13282 echo "(Using $seedfunc() to seed random generator)"
13284 echo "(Warning: no $seedfunc() to seed random generator)"
13287 randseedtype=unsigned
13295 echo "Determining whether or not we are on an EBCDIC system..." >&4
13296 $cat >tebcdic.c <<'EOM'
13299 if ('M'==0xd4) return 0;
13306 if eval $compile_ok; then
13308 echo "You seem to speak EBCDIC." >&4
13311 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF8." >&4
13314 echo "I'm unable to compile the test program." >&4
13315 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
13317 $rm -f tebcdic.c tebcdic
13323 Checking how to flush all pending stdio output...
13325 # I only know how to find the first 32 possibly open files on SunOS.
13326 # See also hints/sunos_4_1.sh and util.c --AD
13328 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
13330 $cat >>try.c <<EOCP
13332 #$i_unistd I_UNISTD
13334 # include <unistd.h>
13336 #$d_sysconf HAS_SYSCONF
13337 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
13338 #ifdef HAS_STDIO_STREAM_ARRAY
13339 # define STDIO_STREAM_ARRAY $stdio_stream_array
13342 FILE* p = fopen("try.out", "w");
13346 # ifdef TRY_FPRINTF
13350 #ifdef TRY_FFLUSH_NULL
13353 #ifdef TRY_FFLUSH_ALL
13355 long open_max = -1;
13356 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
13357 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
13359 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
13360 open_max = sysconf(_SC_OPEN_MAX);
13363 open_max = FOPEN_MAX;
13366 open_max = OPEN_MAX;
13375 # ifdef HAS_STDIO_STREAM_ARRAY
13376 if (open_max > 0) {
13378 for (i = 0; i < open_max; i++)
13379 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
13380 STDIO_STREAM_ARRAY[i]._file < open_max &&
13381 STDIO_STREAM_ARRAY[i]._flag)
13382 fflush(&STDIO_STREAM_ARRAY[i]);
13390 : first we have to find out how _not_ to flush
13391 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
13393 set try -DTRY_FPUTC
13394 if eval $compile; then
13396 ./try$exe_ext 2>/dev/null
13397 if $test ! -s try.out -a "X$?" = X42; then
13403 set try -DTRY_FPRINTF
13405 if eval $compile; then
13407 ./try$exe_ext 2>/dev/null
13408 if $test ! -s try.out -a "X$?" = X42; then
13409 output=-DTRY_FPRINTF
13415 : check for fflush NULL behaviour
13416 case "$fflushNULL" in
13417 '') set try -DTRY_FFLUSH_NULL $output
13418 if eval $compile; then
13420 ./try$exe_ext 2>/dev/null
13422 if $test -s try.out -a "X$code" = X42; then
13423 fflushNULL="`$cat try.out`"
13425 if $test "X$code" != X42; then
13427 (If this test failed, don't worry, we'll try another method shortly.)
13432 $rm -f core try.core core.try.*
13433 case "$fflushNULL" in
13435 Your fflush(NULL) works okay for output streams.
13436 Let's see if it clobbers input pipes...
13438 # As of mid-March 2000 all versions of Solaris appear to have a stdio
13439 # bug that improperly flushes the input end of pipes. So we avoid the
13440 # autoflush on fork/system/exec support for now. :-(
13441 $cat >tryp.c <<EOCP
13444 main(int argc, char **argv)
13450 while ((i = getc(stdin)) != -1
13451 && (*bp++ = i) != '\n'
13452 && bp < &buf[1024])
13455 fprintf(stdout, "%s", buf);
13463 fflushNULL="$define"
13465 if eval $compile; then
13467 $cat tryp.c | ./tryp$exe_ext 2>/dev/null > tryp.out
13468 if cmp tryp.c tryp.out >/dev/null 2>&1; then
13470 fflush(NULL) seems to behave okay with input streams.
13472 fflushNULL="$define"
13475 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
13477 fflushNULL="$undef"
13480 $rm -f core tryp.c tryp.core core.tryp.*
13483 Your fflush(NULL) isn't working (contrary to ANSI C).
13485 fflushNULL="$undef"
13488 Cannot figure out whether your fflush(NULL) works or not.
13489 I'm assuming it doesn't (contrary to ANSI C).
13491 fflushNULL="$undef"
13495 $define|true|[yY]*)
13496 fflushNULL="$define"
13499 fflushNULL="$undef"
13502 : check explicit looping only if NULL did not work, and if the pipe
13503 : bug does not show up on an explicit flush too
13504 case "$fflushNULL" in
13506 $cat >tryp.c <<EOCP
13509 main(int argc, char **argv)
13515 while ((i = getc(stdin)) != -1
13516 && (*bp++ = i) != '\n'
13517 && bp < &buf[1024])
13520 fprintf(stdout, "%s", buf);
13529 if eval $compile; then
13531 $cat tryp.c | ./tryp$exe_ext 2>/dev/null > tryp.out
13532 if cmp tryp.c tryp.out >/dev/null 2>&1; then
13534 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
13536 : now check for fflushall behaviour
13537 case "$fflushall" in
13538 '') set try -DTRY_FFLUSH_ALL $output
13539 if eval $compile; then
13541 (Now testing the other method--but note that this also may fail.)
13544 ./try$exe_ext 2>/dev/null
13545 if $test -s try.out -a "X$?" = X42; then
13546 fflushall="`$cat try.out`"
13549 $rm -f core try.core core.try.*
13550 case "$fflushall" in
13552 Whew. Flushing explicitly all the stdio streams works.
13554 fflushall="$define"
13557 Sigh. Flushing explicitly all the stdio streams doesn't work.
13562 Cannot figure out whether flushing stdio streams explicitly works or not.
13563 I'm assuming it doesn't.
13569 "$define"|true|[yY]*)
13570 fflushall="$define"
13578 All is futile. Even fflush(stdin) clobbers input pipes!
13585 $rm -f core tryp.c tryp.core core.tryp.*
13587 *) fflushall="$undef"
13591 case "$fflushNULL$fflushall" in
13594 OK, I give up. I cannot figure out how to flush pending stdio output.
13595 We won't be flushing handles at all before fork/exec/popen.
13599 $rm -f try.* try$exe_ext
13601 : Store the full pathname to the ar program for use in the C program
13602 : Respect a hint or command line value for full_ar.
13607 : Store the full pathname to the sed program for use in the C program
13610 : see what type gids are declared as in the kernel
13612 echo "Looking for the type for group ids returned by getgid()."
13613 set gid_t gidtype xxx stdio.h sys/types.h
13617 xxx=`./findhdr sys/user.h`
13618 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
13620 unsigned) dflt="$1 $2" ;;
13624 *) dflt="$gidtype";;
13627 gid_t) echo "gid_t found." ;;
13628 *) rp="What is the type for group ids returned by getgid()?"
13636 *_t) zzz="$gidtype" ;;
13639 echo "Checking the size of $zzz..." >&4
13641 #include <sys/types.h>
13644 printf("%d\n", (int)sizeof($gidtype));
13649 if eval $compile_ok; then
13653 echo "(I can't execute the test program--guessing $gidsize.)" >&4
13656 echo "Your $zzz is $gidsize bytes long."
13661 echo "(I can't compile the test program--guessing $gidsize.)" >&4
13667 *_t) zzz="$gidtype" ;;
13670 echo "Checking the sign of $zzz..." >&4
13672 #include <sys/types.h>
13683 if eval $compile; then
13687 echo "(I can't execute the test program--guessing unsigned.)" >&4
13691 1) echo "Your $zzz is unsigned." ;;
13692 -1) echo "Your $zzz is signed." ;;
13698 echo "(I can't compile the test program--guessing unsigned.)" >&4
13704 if $test X"$quadtype" != X; then
13706 echo "Checking how to print 64-bit integers..." >&4
13708 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
13709 $cat >try.c <<'EOCP'
13710 #include <sys/types.h>
13713 int q = 12345678901;
13714 printf("%ld\n", q);
13718 if eval $compile; then
13719 yyy=`./try$exe_ext`
13722 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
13723 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
13724 echo "We will use %d."
13730 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
13731 $cat >try.c <<'EOCP'
13732 #include <sys/types.h>
13735 long q = 12345678901;
13736 printf("%ld\n", q);
13740 if eval $compile; then
13741 yyy=`./try$exe_ext`
13744 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
13745 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
13746 echo "We will use %ld."
13752 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
13753 $cat >try.c <<'EOCP'
13754 #include <sys/types.h>
13755 #include <inttypes.h>
13758 int64_t q = 12345678901;
13759 printf("%" PRId64 "\n", q);
13763 if eval $compile; then
13764 yyy=`./try$exe_ext`
13767 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
13768 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
13769 echo "We will use the C9X style."
13775 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
13776 $cat >try.c <<'EOCP'
13777 #include <sys/types.h>
13780 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
13781 printf("%lld\n", q);
13785 if eval $compile; then
13786 yyy=`./try$exe_ext`
13789 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
13790 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
13791 echo "We will use the %lld style."
13797 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
13799 #include <sys/types.h>
13802 $quadtype q = 12345678901;
13803 printf("%Ld\n", q);
13807 if eval $compile; then
13808 yyy=`./try$exe_ext`
13811 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
13812 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
13813 echo "We will use %Ld."
13819 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
13821 #include <sys/types.h>
13824 $quadtype q = 12345678901;
13825 printf("%qd\n", q);
13829 if eval $compile; then
13830 yyy=`./try$exe_ext`
13833 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
13834 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
13835 echo "We will use %qd."
13841 if $test X"$sPRId64" = X; then
13842 echo "Cannot figure out how to print 64-bit integers." >&4
13850 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
13851 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
13853 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
13854 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
13860 $echo "Checking the format strings to be used for Perl's internal types..." >&4
13862 if $test X"$ivsize" = X8; then
13863 ivdformat="$sPRId64"
13864 uvuformat="$sPRIu64"
13865 uvoformat="$sPRIo64"
13866 uvxformat="$sPRIx64"
13867 uvXUformat="$sPRIXU64"
13869 if $test X"$ivsize" = X"$longsize"; then
13876 if $test X"$ivsize" = X"$intsize"; then
13884 if $test X"$ivsize" = X"$shortsize"; then
13895 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
13896 nveformat="$sPRIeldbl"
13897 nvfformat="$sPRIfldbl"
13898 nvgformat="$sPRIgldbl"
13899 nvEUformat="$sPRIEUldbl"
13900 nvFUformat="$sPRIFUldbl"
13901 nvGUformat="$sPRIGUldbl"
13911 case "$ivdformat" in
13912 '') echo "$0: Fatal: failed to find format strings, cannot continue." >& 4
13919 $echo "Checking the format string to be used for gids..." >&4
13922 -1) if $test X"$gidsize" = X"$ivsize"; then
13923 gidformat="$ivdformat"
13925 if $test X"$gidsize" = X"$longsize"; then
13928 if $test X"$gidsize" = X"$intsize"; then
13931 if $test X"$gidsize" = X"$shortsize"; then
13938 *) if $test X"$gidsize" = X"$uvsize"; then
13939 gidformat="$uvuformat"
13941 if $test X"$gidsize" = X"$longsize"; then
13944 if $test X"$gidsize" = X"$intsize"; then
13947 if $test X"$gidsize" = X"$shortsize"; then
13956 : see if getgroups exists
13957 set getgroups d_getgrps
13960 : see if setgroups exists
13961 set setgroups d_setgrps
13965 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
13967 case "$d_getgrps$d_setgrps" in
13969 case "$groupstype" in
13970 '') dflt="$gidtype" ;;
13971 *) dflt="$groupstype" ;;
13974 What type of pointer is the second argument to getgroups() and setgroups()?
13975 Usually this is the same as group ids, $gidtype, but not always.
13978 rp='What type pointer is the second argument to getgroups() and setgroups()?'
13982 *) groupstype="$gidtype";;
13986 echo "Checking if your $make program sets \$(MAKE)..." >&4
13987 case "$make_set_make" in
13989 $sed 's/^X //' > testmake.mak << 'EOF'
13991 X @echo 'maketemp="$(MAKE)"'
13993 case "`$make -f testmake.mak 2>/dev/null`" in
13994 *maketemp=*) make_set_make='#' ;;
13995 *) make_set_make="MAKE=$make" ;;
13997 $rm -f testmake.mak
14000 case "$make_set_make" in
14001 '#') echo "Yup, it does.";;
14002 *) echo "Nope, it doesn't.";;
14005 : see what type is used for mode_t
14006 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
14007 set mode_t modetype int stdio.h sys/types.h
14010 : see if stdarg is available
14012 if $test `./findhdr stdarg.h`; then
14013 echo "<stdarg.h> found." >&4
14016 echo "<stdarg.h> NOT found." >&4
14020 : see if varags is available
14022 if $test `./findhdr varargs.h`; then
14023 echo "<varargs.h> found." >&4
14025 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
14028 : set up the varargs testing programs
14029 $cat > varargs.c <<EOP
14031 #include <stdarg.h>
14034 #include <varargs.h>
14038 int f(char *p, ...)
14052 p = va_arg(ap, char *);
14057 $cat > varargs <<EOP
14059 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
14068 : now check which varargs header should be included
14073 if `./varargs I_STDARG`; then
14075 elif `./varargs I_VARARGS`; then
14080 if `./varargs I_VARARGS`; then
14087 echo "I could not find the definition for va_dcl... You have problems..." >&4
14088 val="$undef"; set i_stdarg; eval $setvar
14089 val="$undef"; set i_varargs; eval $setvar
14094 case "$i_varhdr" in
14096 val="$define"; set i_stdarg; eval $setvar
14097 val="$undef"; set i_varargs; eval $setvar
14100 val="$undef"; set i_stdarg; eval $setvar
14101 val="$define"; set i_varargs; eval $setvar
14104 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
14108 : see if we need va_copy
14110 case "$i_stdarg" in
14113 #include <stdarg.h>
14115 #$i_stdlib I_STDLIB
14117 #include <stdlib.h>
14119 #include <signal.h>
14122 ivfprintf(FILE *f, const char *fmt, va_list *valp)
14124 return vfprintf(f, fmt, *valp);
14128 myvfprintf(FILE *f, const char *fmt, va_list val)
14130 return ivfprintf(f, fmt, &val);
14134 myprintf(char *fmt, ...)
14137 va_start(val, fmt);
14138 return myvfprintf(stdout, fmt, val);
14142 main(int ac, char **av)
14144 signal(SIGSEGV, exit);
14146 myprintf("%s%cs all right, then\n", "that", '\'');
14151 if eval $compile && ./try 2>&1 >/dev/null; then
14153 "that's all right, then")
14159 yes) echo "It seems that you don't need va_copy()." >&4
14160 need_va_copy="$undef"
14162 *) echo "It seems that va_copy() or similar will be needed." >&4
14163 need_va_copy="$define"
14166 $rm -f try.* core core.* *.core *.core.*
14168 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
14172 : define a fucntion to check prototypes
14173 $cat > protochk <<EOSH
14176 optimize="$optimize"
14178 prototype="$prototype"
14183 $cat >> protochk <<'EOSH'
14188 while test $# -ge 2; do
14190 $define) echo "#include <$2>" >> try.c ;;
14191 literal) echo "$2" >> try.c ;;
14195 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
14196 cat >> try.c <<'EOCP'
14197 #ifdef CAN_PROTOTYPE
14198 #define _(args) args
14203 echo "$foo" >> try.c
14204 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
14205 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
14211 $eunicefix protochk
14213 : see what type is used for size_t
14214 rp="What is the type used for the length parameter for string functions?"
14215 set size_t sizetype 'unsigned int' stdio.h sys/types.h
14218 : check for type of arguments to gethostbyaddr.
14219 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
14220 case "$d_gethbyaddr" in
14224 Checking to see what type of arguments are accepted by gethostbyaddr().
14226 hdrs="$define sys/types.h
14227 $d_socket sys/socket.h
14228 $i_niin netinet/in.h
14230 $i_unistd unistd.h"
14231 : The first arg can 'char *' or 'void *'
14232 : The second arg is some of integral type
14233 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
14234 for yyy in size_t long int; do
14235 case "$netdb_host_type" in
14236 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
14237 if ./protochk "$try" $hdrs; then
14238 echo "Your system accepts $xxx for the first arg."
14239 echo "...and $yyy for the second arg."
14240 netdb_host_type="$xxx"
14241 netdb_hlen_type="$yyy"
14247 : In case none of those worked, prompt the user.
14248 case "$netdb_host_type" in
14249 '') rp='What is the type for the 1st argument to gethostbyaddr?'
14252 netdb_host_type=$ans
14253 rp='What is the type for the 2nd argument to gethostbyaddr?'
14256 netdb_hlen_type=$ans
14260 *) : no gethostbyaddr, so pick harmless defaults
14261 netdb_host_type='char *'
14262 netdb_hlen_type="$sizetype"
14265 # Remove the "const" if needed. -- but then we'll have a
14267 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
14270 : check for type of argument to gethostbyname.
14271 if test "X$netdb_name_type" = X ; then
14272 case "$d_gethbyname" in
14276 Checking to see what type of argument is accepted by gethostbyname().
14278 hdrs="$define sys/types.h
14279 $d_socket sys/socket.h
14280 $i_niin netinet/in.h
14282 $i_unistd unistd.h"
14283 for xxx in "const char *" "char *"; do
14284 case "$netdb_name_type" in
14285 '') try="extern struct hostent *gethostbyname($xxx);"
14286 if ./protochk "$try" $hdrs; then
14287 echo "Your system accepts $xxx."
14288 netdb_name_type="$xxx"
14293 : In case none of those worked, prompt the user.
14294 case "$netdb_name_type" in
14295 '') rp='What is the type for the 1st argument to gethostbyname?'
14298 netdb_name_type=$ans
14302 *) : no gethostbyname, so pick harmless default
14303 netdb_name_type='char *'
14308 : check for type of 1st argument to getnetbyaddr.
14309 if test "X$netdb_net_type" = X ; then
14310 case "$d_getnbyaddr" in
14314 Checking to see what type of 1st argument is accepted by getnetbyaddr().
14316 hdrs="$define sys/types.h
14317 $d_socket sys/socket.h
14318 $i_niin netinet/in.h
14320 $i_unistd unistd.h"
14321 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
14322 case "$netdb_net_type" in
14323 '') try="extern struct netent *getnetbyaddr($xxx, int);"
14324 if ./protochk "$try" $hdrs; then
14325 echo "Your system accepts $xxx."
14326 netdb_net_type="$xxx"
14331 : In case none of those worked, prompt the user.
14332 case "$netdb_net_type" in
14333 '') rp='What is the type for the 1st argument to getnetbyaddr?'
14336 netdb_net_type=$ans
14340 *) : no getnetbyaddr, so pick harmless default
14341 netdb_net_type='long'
14345 : locate the preferred pager for this system
14351 [a-zA-Z]:/*) dflt=$pg;;
14355 [a-zA-Z]:/*) dflt=$more;;
14359 [a-zA-Z]:/*) dflt=$less;;
14362 '') dflt=/usr/ucb/more;;
14369 rp='What pager is used on your system?'
14373 : see what type pids are declared as in the kernel
14374 rp="What is the type of process ids on this system?"
14375 set pid_t pidtype int stdio.h sys/types.h
14378 : Find earliest binary compatible site_perl subdirectory perl can use.
14379 case "$bincompat5005" in
14380 "$define") xs_apiversion='5.005' ;;
14381 *) xs_apiversion=$version ;; # The current site_perl version.
14383 : Find earliest pure perl site_perl subdirectory perl can use.
14384 : The versioned directories started at 5.005.
14385 pm_apiversion='5.005'
14387 : see if ar generates random libraries by itself
14389 echo "Checking how to generate random libraries on your machine..." >&4
14390 echo 'int bar1() { return bar2(); }' > bar1.c
14391 echo 'int bar2() { return 2; }' > bar2.c
14392 $cat > foo.c <<'EOP'
14393 int main() { printf("%d\n", bar1()); exit(0); }
14395 $cc $ccflags -c bar1.c >/dev/null 2>&1
14396 $cc $ccflags -c bar2.c >/dev/null 2>&1
14397 $cc $ccflags -c foo.c >/dev/null 2>&1
14398 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
14399 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
14400 ./foobar >/dev/null 2>&1; then
14401 echo "$ar appears to generate random libraries itself."
14404 elif $ar ts bar$_a >/dev/null 2>&1 &&
14405 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
14406 ./foobar >/dev/null 2>&1; then
14407 echo "a table of contents needs to be added with '$ar ts'."
14414 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
14415 $test -f $ranlib || ranlib=''
14418 if $test -n "$ranlib"; then
14419 echo "your system has '$ranlib'; we'll use that."
14422 echo "your system doesn't seem to support random libraries"
14423 echo "so we'll use lorder and tsort to order the libraries."
14430 : check for type of arguments to select.
14431 case "$selecttype" in
14432 '') case "$d_select" in
14436 Checking to see what type of arguments are accepted by select().
14438 hdrs="$define sys/types.h
14439 $i_systime sys/time.h
14440 $i_sysselct sys/select.h
14441 $d_socket sys/socket.h"
14442 : The first arg can be int, unsigned, or size_t
14443 : The last arg may or may not be 'const'
14445 : void pointer has been seen but using that
14446 : breaks the selectminbits test
14447 for xxx in 'fd_set *' 'int *'; do
14448 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
14449 for tmo in 'struct timeval *' 'const struct timeval *'; do
14451 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
14452 if ./protochk "$try" $hdrs; then
14453 echo "Your system accepts $xxx."
14462 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
14463 case "$d_fd_set" in
14464 $define) dflt="fd_set *" ;;
14473 *) : no select, so pick a harmless default
14480 : check for the select 'width'
14481 case "$selectminbits" in
14482 '') case "$d_select" in
14486 Checking to see on how many bits at a time your select() operates...
14489 #include <sys/types.h>
14491 #$i_systime I_SYS_TIME
14492 #$i_systimek I_SYS_TIME_KERNEL
14497 # ifdef I_SYS_TIME_KERNEL
14500 # include <sys/time.h>
14501 # ifdef I_SYS_TIME_KERNEL
14505 #$i_sysselct I_SYS_SELECT
14506 #ifdef I_SYS_SELECT
14507 #include <sys/select.h>
14509 #$d_socket HAS_SOCKET
14511 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
14515 #define S sizeof(*(b))
14517 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
14518 #define NBITS (NBYTES * 8)
14527 fp = fopen("try.c", "r");
14533 b = ($selecttype)s;
14534 for (i = 0; i < NBITS; i++)
14538 select(fd + 1, b, 0, 0, &t);
14539 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
14540 printf("%d\n", i + 1);
14545 if eval $compile_ok; then
14546 selectminbits=`./try`
14547 case "$selectminbits" in
14549 Cannot figure out on how many bits at a time your select() operates.
14550 I'll play safe and guess it is 32 bits.
14556 *) bits="$selectminbits bits" ;;
14558 echo "Your select() operates on $bits at a time." >&4
14560 rp='What is the minimum number of bits your select() operates on?'
14561 case "$byteorder" in
14562 1234|12345678) dflt=32 ;;
14567 selectminbits="$val"
14571 *) : no select, so pick a harmless default
14578 : Trace out the files included by signal.h, then look for SIGxxx names.
14579 : Remove SIGARRAYSIZE used by HPUX.
14580 : Remove SIGSTKSIZE used by Linux.
14581 : Remove SIGSTKSZ used by Posix.
14582 : Remove SIGTYP void lines used by OS2.
14583 : Some cpps, like os390, dont give the file name anywhere
14584 if [ "X$fieldn" = X ]; then
14585 : Just make some guesses. We check them later.
14586 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
14588 xxx=`echo '#include <signal.h>' |
14589 $cppstdin $cppminus $cppflags 2>/dev/null |
14590 $grep '^[ ]*#.*include' |
14591 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq`
14593 : Check this list of files to be sure we have parsed the cpp output ok.
14594 : This will also avoid potentially non-existent files, such
14597 for xx in $xxx /dev/null ; do
14598 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
14600 : If we have found no files, at least try signal.h
14601 case "$xxxfiles" in
14602 '') xxxfiles=`./findhdr signal.h` ;;
14605 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
14606 print substr($2, 4, 20)
14608 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
14609 print substr($3, 4, 20)
14611 : Append some common names just in case the awk scan failed.
14612 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
14613 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
14614 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
14615 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
14616 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
14618 : generate a few handy files for later
14619 $cat > signal.c <<'EOCP'
14620 #include <sys/types.h>
14621 #include <signal.h>
14625 /* Strange style to avoid deeply-nested #if/#else/#endif */
14628 # define NSIG (_NSIG)
14634 # define NSIG (SIGMAX+1)
14640 # define NSIG (SIG_MAX+1)
14646 # define NSIG (MAXSIG+1)
14652 # define NSIG (MAX_SIG+1)
14657 # ifdef SIGARRAYSIZE
14658 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
14664 # define NSIG (_sys_nsig) /* Solaris 2.5 */
14668 /* Default to some arbitrary number that's big enough to get most
14669 of the common signals.
14675 printf("NSIG %d\n", NSIG);
14681 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
14683 printf "#ifdef SIG"; printf $1; printf "\n"
14684 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
14685 printf $1; printf ");\n"
14689 printf "#endif /* JUST_NSIG */\n";
14690 printf "exit(0);\n}\n";
14693 $cat >signal.awk <<'EOP'
14694 BEGIN { ndups = 0 }
14695 $1 ~ /^NSIG$/ { nsig = $2 }
14696 ($1 !~ /^NSIG$/) && (NF == 2) {
14697 if ($2 > maxsig) { maxsig = $2 }
14698 if (sig_name[$2]) {
14699 dup_name[ndups] = $1
14700 dup_num[ndups] = $2
14712 printf("NSIG %d\n", nsig);
14713 for (n = 1; n < nsig; n++) {
14715 printf("%s %d\n", sig_name[n], sig_num[n])
14718 printf("NUM%d %d\n", n, n)
14721 for (n = 0; n < ndups; n++) {
14722 printf("%s %d\n", dup_name[n], dup_num[n])
14726 $cat >signal_cmd <<EOS
14728 if $test -s signal.lst; then
14729 echo "Using your existing signal.lst file"
14734 $cat >>signal_cmd <<'EOS'
14737 if eval $compile_ok; then
14738 ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
14740 echo "(I can't seem be able to compile the whole test program)" >&4
14741 echo "(I'll try it in little pieces.)" >&4
14742 set signal -DJUST_NSIG
14743 if eval $compile_ok; then
14744 ./signal$_exe > signal.nsg
14747 echo "I can't seem to figure out how many signals you have." >&4
14748 echo "Guessing 50." >&4
14749 echo 'NSIG 50' > signal.nsg
14751 : Now look at all the signal names, one at a time.
14752 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
14753 $cat > signal.c <<EOCP
14754 #include <sys/types.h>
14755 #include <signal.h>
14758 printf("$xx %d\n", SIG${xx});
14763 if eval $compile; then
14764 echo "SIG${xx} found."
14765 ./signal$_exe >> signal.ls1
14767 echo "SIG${xx} NOT found."
14770 if $test -s signal.ls1; then
14771 $cat signal.nsg signal.ls1 |
14772 $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
14776 if $test -s signal.lst; then
14779 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
14780 echo 'kill -l' >signal
14781 set X `csh -f <signal`
14785 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
14787 echo $@ | $tr ' ' $trnl | \
14788 $awk '{ printf "%s %d\n", $1, ++s; }
14789 END { printf "NSIG %d\n", ++s }' >signal.lst
14791 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
14793 chmod a+x signal_cmd
14794 $eunicefix signal_cmd
14796 : generate list of signal names
14798 case "$sig_name_init" in
14800 *) case "$sig_num_init" in
14801 ''|*,*) doinit=yes ;;
14806 echo "Generating a list of signal names and numbers..." >&4
14808 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
14809 sig_name=`$awk 'BEGIN { printf "ZERO " }
14810 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
14811 sig_num=`$awk 'BEGIN { printf "0 " }
14812 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
14813 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
14814 !/^NSIG/ { printf "\"%s\", ", $1 }
14815 END { printf "0\n" }' signal.lst`
14816 sig_num_init=`$awk 'BEGIN { printf "0, " }
14817 !/^NSIG/ { printf "%d, ", $2}
14818 END { printf "0\n"}' signal.lst`
14821 echo "The following $sig_count signals are available:"
14823 echo $sig_name | $awk \
14824 'BEGIN { linelen = 0 }
14826 for (i = 1; i <= NF; i++) {
14827 name = "SIG" $i " "
14828 linelen = linelen + length(name)
14829 if (linelen > 70) {
14831 linelen = length(name)
14837 sig_size=`echo $sig_name | awk '{print NF}'`
14838 $rm -f signal signal.c signal.awk signal.lst signal_cmd
14841 case "$sizetype" in
14842 *_t) zzz="$sizetype" ;;
14843 *) zzz="filesize" ;;
14845 echo "Checking the size of $zzz..." >&4
14847 #include <sys/types.h>
14850 printf("%d\n", (int)sizeof($sizetype));
14855 if eval $compile_ok; then
14859 echo "(I can't execute the test program--guessing $sizesize.)" >&4
14862 echo "Your $zzz size is $sizesize bytes."
14867 echo "(I can't compile the test program--guessing $sizesize.)" >&4
14871 : check for socklen_t
14873 echo "Checking to see if you have socklen_t..." >&4
14875 #include <sys/types.h>
14876 #$d_socket HAS_SOCKET
14878 #include <sys/socket.h>
14880 int main() { socklen_t x = 16; }
14883 if eval $compile; then
14885 echo "You have socklen_t."
14888 echo "You do not have socklen_t."
14889 case "$sizetype" in
14890 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
14897 : see if this is a socks.h system
14898 set socks.h i_socks
14901 : check for type of the size argument to socket calls
14902 case "$d_socket" in
14906 Checking to see what type is the last argument of accept().
14909 case "$d_socklen_t" in
14910 "$define") yyy="$yyy socklen_t"
14912 yyy="$yyy $sizetype int long unsigned"
14913 for xxx in $yyy; do
14914 case "$socksizetype" in
14915 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
14916 case "$usesocks" in
14918 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
14919 echo "Your system accepts '$xxx *' for the last argument of accept()."
14920 socksizetype="$xxx"
14923 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
14924 echo "Your system accepts '$xxx *' for the last argument of accept()."
14925 socksizetype="$xxx"
14932 : In case none of those worked, prompt the user.
14933 case "$socksizetype" in
14934 '') rp='What is the type for socket address structure sizes?'
14941 *) : no sockets, so pick relatively harmless default
14946 : see what type is used for signed size_t
14947 set ssize_t ssizetype int stdio.h sys/types.h
14950 $cat > ssize.c <<EOM
14952 #include <sys/types.h>
14953 #define Size_t $sizetype
14954 #define SSize_t $dflt
14957 if (sizeof(Size_t) == sizeof(SSize_t))
14959 else if (sizeof(Size_t) == sizeof(int))
14968 if eval $compile_ok && ./ssize > /dev/null; then
14969 ssizetype=`./ssize`
14970 echo "I'll be using $ssizetype for functions returning a byte count." >&4
14973 Help! I can't compile and run the ssize_t test program: please enlighten me!
14974 (This is probably a misconfiguration in your system or libraries, and
14975 you really ought to fix it. Still, I'll try anyway.)
14977 I need a type that is the same size as $sizetype, but is guaranteed to
14978 be signed. Common values are ssize_t, int and long.
14981 rp="What signed type is the same size as $sizetype?"
14985 $rm -f ssize ssize.*
14987 : see what type of char stdio uses.
14989 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
14990 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
14991 echo "Your stdio uses unsigned chars." >&4
14992 stdchar="unsigned char"
14994 echo "Your stdio uses signed chars." >&4
15001 : see if time exists
15003 if test "X$d_time" = X -o X"$timetype" = X; then
15004 if set time val -f d_time; eval $csym; $val; then
15005 echo 'time() found.' >&4
15007 rp="What is the type returned by time() on this system?"
15008 set time_t timetype long stdio.h sys/types.h
15011 echo 'time() not found, hope that will do.' >&4
15019 : see what type uids are declared as in the kernel
15021 echo "Looking for the type for user ids returned by getuid()."
15022 set uid_t uidtype xxx stdio.h sys/types.h
15026 xxx=`./findhdr sys/user.h`
15027 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
15029 unsigned) dflt="$1 $2" ;;
15033 *) dflt="$uidtype";;
15036 uid_t) echo "uid_t found." ;;
15037 *) rp="What is the type for user ids returned by getuid()?"
15045 *_t) zzz="$uidtype" ;;
15048 echo "Checking the size of $zzz..." >&4
15050 #include <sys/types.h>
15053 printf("%d\n", (int)sizeof($uidtype));
15058 if eval $compile_ok; then
15062 echo "(I can't execute the test program--guessing $uidsize.)" >&4
15065 echo "Your $zzz is $uidsize bytes long."
15070 echo "(I can't compile the test program--guessing $uidsize.)" >&4
15075 *_t) zzz="$uidtype" ;;
15078 echo "Checking the sign of $zzz..." >&4
15080 #include <sys/types.h>
15091 if eval $compile; then
15095 echo "(I can't execute the test program--guessing unsigned.)" >&4
15099 1) echo "Your $zzz is unsigned." ;;
15100 -1) echo "Your $zzz is signed." ;;
15106 echo "(I can't compile the test program--guessing unsigned.)" >&4
15112 $echo "Checking the format string to be used for uids..." >&4
15115 -1) if $test X"$uidsize" = X"$ivsize"; then
15116 uidformat="$ivdformat"
15118 if $test X"$uidsize" = X"$longsize"; then
15121 if $test X"$uidsize" = X"$intsize"; then
15124 if $test X"$uidsize" = X"$shortsize"; then
15131 *) if $test X"$uidsize" = X"$uvsize"; then
15132 uidformat="$uvuformat"
15134 if $test X"$uidsize" = X"$longsize"; then
15137 if $test X"$uidsize" = X"$intsize"; then
15140 if $test X"$uidsize" = X"$shortsize"; then
15149 : determine compiler compiler
15158 if $test -f "$byacc"; then
15160 comp="byacc or $comp"
15162 if $test -f "$bison"; then
15163 comp="$comp or bison -y"
15165 rp="Which compiler compiler ($comp) shall I use?"
15174 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
15180 : see if dbm.h is available
15181 : see if dbmclose exists
15182 set dbmclose d_dbmclose
15185 case "$d_dbmclose" in
15195 *) set rpcsvc/dbm.h i_rpcsvcdbm
15200 *) echo "We won't be including <dbm.h>"
15210 : see if this is a sys/file.h system
15215 : do we need to include sys/file.h ?
15219 if $h_sysfile; then
15221 echo "We'll be including <sys/file.h>." >&4
15224 echo "We won't be including <sys/file.h>." >&4
15234 : see if fcntl.h is there
15239 : see if we can include fcntl.h
15245 echo "We'll be including <fcntl.h>." >&4
15248 if $h_sysfile; then
15249 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
15251 echo "We won't be including <fcntl.h>." >&4
15263 : see if this is a iconv.h system
15264 set iconv.h i_iconv
15267 : see if this is a ieeefp.h system
15268 set ieeefp.h i_ieeefp
15271 : see if this is a libutil.h system
15272 set libutil.h i_libutil
15275 : see if locale.h is available
15276 set locale.h i_locale
15279 : see if mach cthreads are available
15280 if test "X$usethreads" = "X$define"; then
15281 set mach/cthreads.h i_machcthr
15284 i_machcthr="$undef"
15289 : see if this is a math.h system
15293 : see if this is a mntent.h system
15294 set mntent.h i_mntent
15297 : see if ndbm.h is available
15302 : see if dbm_open exists
15303 set dbm_open d_dbm_open
15305 case "$d_dbm_open" in
15308 echo "We won't be including <ndbm.h>"
15317 : see if net/errno.h is available
15319 set net/errno.h val
15322 : Unfortunately, it causes problems on some systems. Arrgh.
15325 cat > try.c <<'EOM'
15328 #include <net/errno.h>
15334 if $cc $ccflags -c try.c >/dev/null 2>&1; then
15335 echo "We'll be including <net/errno.h>." >&4
15337 echo "We won't be including <net/errno.h>." >&4
15346 : see if netinet/tcp.h is available
15347 set netinet/tcp.h i_netinettcp
15350 : see if this is a poll.h system
15354 : see if this is a prot.h system
15359 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
15360 $cat <<'EOSH' > Cppsym.know
15361 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
15362 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
15363 alliant alpha am29000 AM29000 AMD64 amiga AMIGAOS AMIX
15364 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
15365 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
15366 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
15367 bull c cadmus clipper CMU COFF COMPILER_VERSION
15368 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
15369 CYGWIN DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
15370 Dynix DynixPTX ELF encore EPI EXTENSIONS FILE_OFFSET_BITS
15371 FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
15372 GNU_SOURCE GNUC GNUC_MINOR GO32 gould GOULD_PN
15373 H3050R H3050RX hbullx20 hcx host_mips
15374 hp200 hp300 hp700 HP700 hp800 hp9000
15375 hp9000s200 hp9000s300 hp9000s400 hp9000s500
15376 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
15377 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
15378 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
15379 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
15380 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
15381 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
15382 Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
15383 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
15384 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
15385 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
15386 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
15387 MATH_HAS_NO_SIDE_EFFECTS
15388 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
15389 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
15390 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
15391 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
15392 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
15393 NetBSD news1500 news1700 news1800 news1900 news3700
15394 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
15395 ns32016 ns32332 ns32k nsc32000
15396 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
15397 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
15398 pc532 pdp11 PGC PIC plexus PORTAR posix
15399 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
15400 POSIX_C_SOURCE POSIX_SOURCE POWER
15401 PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
15402 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
15403 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
15404 sony sony_news sonyrisc sparc sparclite spectrum
15405 stardent stdc STDC_EXT stratos sun sun3 sun386
15406 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
15407 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
15408 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
15409 sysV68 sysV88 Tek4132 Tek4300 titan
15410 TM3200 TM5400 TM5600
15411 tower tower32 tower32_200 tower32_600 tower32_700
15412 tower32_800 tower32_850 tss
15413 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
15414 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
15415 unix UNIX95 UNIX99 unixpc unos USGr4 USGr4_2
15416 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms xenix Xenix286
15417 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
15418 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
15421 # Maybe put other stuff here too.
15422 cat <<EOSH >>Cppsym.know
15425 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
15426 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
15427 $cat Cppsym.know > Cppsym.c
15428 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
15429 $rm -f Cppsym.a Cppsym.b Cppsym.c
15430 cat <<EOSH > Cppsym
15432 if $test \$# -gt 0; then
15433 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
15434 if $test -s Cppsym.got; then
15441 $tr " " "$trnl" | ./Cppsym.try
15447 cat <<EOSH > Cppsym.try
15449 cat <<'EOCP' > try.c
15455 cat <<'EOSH' >> Cppsym.try
15457 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
15458 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
15459 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
15460 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
15464 cat <<EOSH >> Cppsym.try
15466 case "$osname-$gccversion" in
15467 irix-) ccflags="\$ccflags -woff 1178" ;;
15468 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
15470 $cc -o try $optimize \$ccflags $ldflags try.c $libs && ./try$exe_ext
15472 chmod +x Cppsym.try
15473 $eunicefix Cppsym.try
15474 ./Cppsym < Cppsym.know > Cppsym.true
15475 : now check the C compiler for additional symbols
15476 postprocess_cc_v=''
15478 aix) postprocess_cc_v="|$tr , ' '" ;;
15485 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
15488 -D*) echo "\$i" | $sed 's/^-D//';;
15489 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
15494 postprocess_cc_v=''
15497 ./ccsym > ccsym1.raw
15498 if $test -s ccsym1.raw; then
15499 $sort ccsym1.raw | $uniq >ccsym.raw
15501 mv ccsym1.raw ccsym.raw
15504 $awk '/\=/ { print $0; next }
15505 { print $0"=1" }' ccsym.raw >ccsym.list
15506 $awk '/\=/ { print $0; next }
15507 { print $0"=1" }' Cppsym.true >ccsym.true
15508 $comm -13 ccsym.true ccsym.list >ccsym.own
15509 $comm -12 ccsym.true ccsym.list >ccsym.com
15510 $comm -23 ccsym.true ccsym.list >ccsym.cpp
15512 if $test -z ccsym.raw; then
15513 echo "Your C compiler doesn't seem to define any symbols!" >&4
15515 echo "However, your C preprocessor defines the following symbols:"
15518 cppsymbols=`$cat Cppsym.true`
15519 cppsymbols=`echo $cppsymbols`
15520 cppccsymbols="$cppsymbols"
15522 if $test -s ccsym.com; then
15523 echo "Your C compiler and pre-processor define these symbols:"
15524 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
15527 cppccsymbols=`$cat ccsym.com`
15528 cppccsymbols=`echo $cppccsymbols`
15529 $test "$silent" || sleep 1
15531 if $test -s ccsym.cpp; then
15532 $test "$also" && echo " "
15533 echo "Your C pre-processor ${also}defines the following symbols:"
15534 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
15536 cppsymbols=`$cat ccsym.cpp`
15537 cppsymbols=`echo $cppsymbols`
15538 $test "$silent" || sleep 1
15540 if $test -s ccsym.own; then
15541 $test "$also" && echo " "
15542 echo "Your C compiler ${also}defines the following cpp symbols:"
15543 $sed -e 's/\(..*\)=1/\1/' ccsym.own
15544 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
15545 ccsymbols=`$cat ccsym.own`
15546 ccsymbols=`echo $ccsymbols`
15547 $test "$silent" || sleep 1
15550 $rm -f ccsym* Cppsym.*
15552 : see if this is a termio system
15556 if $test `./findhdr termios.h`; then
15557 set tcsetattr i_termios
15563 "$define") echo "You have POSIX termios.h... good!" >&4;;
15564 *) if ./Cppsym pyr; then
15565 case "`/bin/universe`" in
15566 ucb) if $test `./findhdr sgtty.h`; then
15568 echo "<sgtty.h> found." >&4
15570 echo "System is pyramid with BSD universe."
15571 echo "<sgtty.h> not found--you could have problems." >&4
15573 *) if $test `./findhdr termio.h`; then
15575 echo "<termio.h> found." >&4
15577 echo "System is pyramid with USG universe."
15578 echo "<termio.h> not found--you could have problems." >&4
15582 if $test `./findhdr termio.h`; then
15583 echo "<termio.h> found." >&4
15585 elif $test `./findhdr sgtty.h`; then
15586 echo "<sgtty.h> found." >&4
15589 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
15592 if $test `./findhdr sgtty.h`; then
15593 echo "<sgtty.h> found." >&4
15595 elif $test `./findhdr termio.h`; then
15596 echo "<termio.h> found." >&4
15599 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
15603 set i_termio; eval $setvar
15604 val=$val2; set i_sgtty; eval $setvar
15605 val=$val3; set i_termios; eval $setvar
15607 : see if this is a shadow.h system
15608 set shadow.h i_shadow
15611 : see if stddef is available
15612 set stddef.h i_stddef
15615 : see if this is a sunmath.h system
15616 set sunmath.h i_sunmath
15619 : see if sys/access.h is available
15620 set sys/access.h i_sysaccess
15623 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
15624 set sys/filio.h i_sysfilio
15627 if $test `./findhdr sys/ioctl.h`; then
15629 echo '<sys/ioctl.h> found.' >&4
15632 if $test $i_sysfilio = "$define"; then
15633 echo '<sys/ioctl.h> NOT found.' >&4
15635 $test $i_sgtty = "$define" && xxx="sgtty.h"
15636 $test $i_termio = "$define" && xxx="termio.h"
15637 $test $i_termios = "$define" && xxx="termios.h"
15638 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
15644 : see if socket ioctl defs are in sys/sockio.h
15646 xxx=`./findhdr sys/sockio.h`
15647 if $test "$xxx"; then
15648 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
15650 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
15653 echo "No socket ioctls found in <sys/sockio.h>." >&4
15658 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
15665 : see if this is a syslog.h system
15666 set syslog.h i_syslog
15670 : see if this is a sys/mode.h system
15671 set sys/mode.h i_sysmode
15674 : see if sys/resource.h has to be included
15675 set sys/resource.h i_sysresrc
15678 : see if sys/security.h is available
15679 set sys/security.h i_syssecrt
15682 : see if this is a sys/statvfs.h system
15683 set sys/statvfs.h i_sysstatvfs
15686 : see if this is a sys/un.h system
15687 set sys/un.h i_sysun
15691 : see if this is a sys/utsname.h system
15692 set sys/utsname.h i_sysutsname
15695 : see if this is a syswait system
15696 set sys/wait.h i_syswait
15699 : see if this is a ustat.h system
15700 set ustat.h i_ustat
15703 : see if this is an utime system
15704 set utime.h i_utime
15707 : see if this is a values.h system
15708 set values.h i_values
15711 : see if this is a vfork system
15714 set vfork.h i_vfork
15722 : see if gdbm.h is available
15727 : see if gdbm_open exists
15728 set gdbm_open d_gdbm_open
15730 case "$d_gdbm_open" in
15733 echo "We won't be including <gdbm.h>"
15743 echo "Looking for extensions..." >&4
15744 : If we are using the old config.sh, known_extensions may contain
15745 : old or inaccurate or duplicate values.
15746 known_extensions=''
15747 nonxs_extensions=''
15748 : We do not use find because it might not be available.
15749 : We do not just use MANIFEST because the user may have dropped
15750 : some additional extensions into the source tree and expect them
15753 : Function to recursively find available extensions, ignoring DynaLoader
15754 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
15758 DynaLoader|dynaload) ;;
15760 if $test -f $xxx/$xxx.xs; then
15761 known_extensions="$known_extensions $1$xxx";
15762 elif $test -f $xxx/Makefile.PL; then
15763 nonxs_extensions="$nonxs_extensions $1$xxx";
15765 if $test -d $xxx -a $# -lt 10; then
15768 eval $find_extensions;
15780 eval $find_extensions
15781 set X $nonxs_extensions
15783 nonxs_extensions="$*"
15784 set X $known_extensions
15786 known_extensions="$*"
15789 : Now see which are supported on this system.
15791 for xxx in $known_extensions ; do
15795 $define) avail_ext="$avail_ext $xxx" ;;
15798 GDBM_File|gdbm_fil)
15800 $define) avail_ext="$avail_ext $xxx" ;;
15803 NDBM_File|ndbm_fil)
15806 case "$osname-$use64bitint" in
15809 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
15812 *) avail_ext="$avail_ext $xxx" ;;
15817 ODBM_File|odbm_fil)
15818 case "${i_dbm}${i_rpcsvcdbm}" in
15820 case "$osname-$use64bitint" in
15823 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
15826 *) avail_ext="$avail_ext $xxx" ;;
15832 case "$useposix" in
15833 true|define|y) avail_ext="$avail_ext $xxx" ;;
15837 case "$useopcode" in
15838 true|define|y) avail_ext="$avail_ext $xxx" ;;
15842 case "$d_socket" in
15843 true|$define|y) avail_ext="$avail_ext $xxx" ;;
15846 Sys/Syslog|sys/syslog)
15847 : XXX syslog requires socket
15848 case "$d_socket" in
15849 true|$define|y) avail_ext="$avail_ext $xxx" ;;
15853 case "$usethreads" in
15854 true|$define|y) avail_ext="$avail_ext $xxx" ;;
15858 : XXX Do we need a useipcsysv variable here
15859 case "${d_msg}${d_sem}${d_shm}" in
15860 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
15863 *) avail_ext="$avail_ext $xxx"
15872 : Now see which nonxs extensions are supported on this system.
15873 : For now assume all are.
15875 for xxx in $nonxs_extensions ; do
15877 *) nonxs_ext="$nonxs_ext $xxx"
15889 A number of extensions are supplied with $package. You may choose to
15890 compile these extensions for dynamic loading (the default), compile
15891 them into the $package executable (static loading), or not include
15892 them at all. Answer "none" to include no extensions.
15893 Note that DynaLoader is always built and need not be mentioned here.
15896 case "$dynamic_ext" in
15897 '') dflt="$avail_ext" ;;
15898 *) dflt="$dynamic_ext"
15899 # Perhaps we are reusing an old out-of-date config.sh.
15902 if test X"$dynamic_ext" != X"$avail_ext"; then
15904 NOTICE: Your previous config.sh list may be incorrect.
15905 The extensions now available to you are
15907 but the default list from your previous config.sh is
15919 rp="What extensions do you wish to load dynamically?"
15922 none) dynamic_ext=' ' ;;
15923 *) dynamic_ext="$ans" ;;
15926 case "$static_ext" in
15928 : Exclude those already listed in dynamic linking
15930 for xxx in $avail_ext; do
15931 case " $dynamic_ext " in
15933 *) dflt="$dflt $xxx" ;;
15940 *) dflt="$static_ext"
15947 rp="What extensions do you wish to load statically?"
15950 none) static_ext=' ' ;;
15951 *) static_ext="$ans" ;;
15956 A number of extensions are supplied with $package. Answer "none"
15957 to include no extensions.
15958 Note that DynaLoader is always built and need not be mentioned here.
15961 case "$static_ext" in
15962 '') dflt="$avail_ext" ;;
15963 *) dflt="$static_ext"
15964 # Perhaps we are reusing an old out-of-date config.sh.
15967 if test X"$static_ext" != X"$avail_ext"; then
15969 NOTICE: Your previous config.sh list may be incorrect.
15970 The extensions now available to you are
15972 but the default list from your previous config.sh is
15981 : Exclude those that are not xs extensions
15985 rp="What extensions do you wish to include?"
15988 none) static_ext=' ' ;;
15989 *) static_ext="$ans" ;;
15994 set X $dynamic_ext $static_ext $nonxs_ext
15998 : Remove libraries needed only for extensions
15999 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
16000 : The exception is SunOS 4.x, which needs them.
16001 case "${osname}X${osvers}" in
16005 *) case "$usedl" in
16006 $define|true|[yY]*)
16007 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
16011 *) perllibs="$libs"
16017 : Remove build directory name from cppstdin so it can be used from
16018 : either the present location or the final installed location.
16020 : Get out of the UU directory to get correct path name.
16022 case "$cppstdin" in
16024 echo "Stripping down cppstdin path name"
16030 : end of configuration questions
16032 echo "End of configuration questions."
16035 : back to where it started
16036 if test -d ../UU; then
16040 : configuration may be patched via a 'config.over' file
16041 if $test -f config.over; then
16044 rp='I see a config.over file. Do you wish to load it?'
16047 n*) echo "OK, I'll ignore it.";;
16049 echo "Configuration override changes have been loaded."
16054 : in case they want portability, strip down executable paths
16055 case "$d_portable" in
16058 echo "Stripping down executable paths..." >&4
16059 for file in $loclist $trylist; do
16061 eval $file=`basename $temp`
16066 : create config.sh file
16068 echo "Creating config.sh..." >&4
16069 $spitshell <<EOT >config.sh
16072 # This file was produced by running the Configure script. It holds all the
16073 # definitions figured out by Configure. Should you modify one of these values,
16074 # do not forget to propagate your changes by running "Configure -der". You may
16075 # instead choose to run each of the .SH files by yourself, or "Configure -S".
16078 # Package name : $package
16079 # Source directory : $src
16080 # Configuration time: $cf_time
16081 # Configured by : $cf_by
16082 # Target system : $myuname
16092 Revision='$Revision'
16099 alignbytes='$alignbytes'
16100 ansi2knr='$ansi2knr'
16101 aphostname='$aphostname'
16102 api_revision='$api_revision'
16103 api_subversion='$api_subversion'
16104 api_version='$api_version'
16105 api_versionstring='$api_versionstring'
16108 archlibexp='$archlibexp'
16109 archname64='$archname64'
16110 archname='$archname'
16111 archobjs='$archobjs'
16116 bincompat5005='$bincompat5005'
16120 byteorder='$byteorder'
16122 castflags='$castflags'
16125 cccdlflags='$cccdlflags'
16126 ccdlflags='$ccdlflags'
16128 ccflags_uselargefiles='$ccflags_uselargefiles'
16130 ccsymbols='$ccsymbols'
16131 ccversion='$ccversion'
16133 cf_email='$cf_email'
16135 charsize='$charsize'
16139 clocktype='$clocktype'
16141 compress='$compress'
16142 contains='$contains'
16146 cpp_stuff='$cpp_stuff'
16147 cppccsymbols='$cppccsymbols'
16148 cppflags='$cppflags'
16150 cppminus='$cppminus'
16152 cppstdin='$cppstdin'
16153 cppsymbols='$cppsymbols'
16154 crosscompile='$crosscompile'
16155 cryptlib='$cryptlib'
16157 d_Gconvert='$d_Gconvert'
16158 d_PRIEUldbl='$d_PRIEUldbl'
16159 d_PRIFUldbl='$d_PRIFUldbl'
16160 d_PRIGUldbl='$d_PRIGUldbl'
16161 d_PRIXU64='$d_PRIXU64'
16162 d_PRId64='$d_PRId64'
16163 d_PRIeldbl='$d_PRIeldbl'
16164 d_PRIfldbl='$d_PRIfldbl'
16165 d_PRIgldbl='$d_PRIgldbl'
16166 d_PRIi64='$d_PRIi64'
16167 d_PRIo64='$d_PRIo64'
16168 d_PRIu64='$d_PRIu64'
16169 d_PRIx64='$d_PRIx64'
16170 d_SCNfldbl='$d_SCNfldbl'
16171 d__fwalk='$d__fwalk'
16172 d_access='$d_access'
16173 d_accessx='$d_accessx'
16175 d_archlib='$d_archlib'
16178 d_attribut='$d_attribut'
16181 d_bincompat5005='$d_bincompat5005'
16183 d_bsdgetpgrp='$d_bsdgetpgrp'
16184 d_bsdsetpgrp='$d_bsdsetpgrp'
16186 d_casti32='$d_casti32'
16187 d_castneg='$d_castneg'
16188 d_charvspr='$d_charvspr'
16190 d_chroot='$d_chroot'
16191 d_chsize='$d_chsize'
16192 d_closedir='$d_closedir'
16193 d_cmsghdr_s='$d_cmsghdr_s'
16197 d_cuserid='$d_cuserid'
16198 d_dbl_dig='$d_dbl_dig'
16199 d_difftime='$d_difftime'
16200 d_dirnamlen='$d_dirnamlen'
16201 d_dlerror='$d_dlerror'
16202 d_dlopen='$d_dlopen'
16203 d_dlsymun='$d_dlsymun'
16204 d_dosuid='$d_dosuid'
16205 d_drand48proto='$d_drand48proto'
16207 d_eaccess='$d_eaccess'
16208 d_endgrent='$d_endgrent'
16209 d_endhent='$d_endhent'
16210 d_endnent='$d_endnent'
16211 d_endpent='$d_endpent'
16212 d_endpwent='$d_endpwent'
16213 d_endsent='$d_endsent'
16214 d_eofnblk='$d_eofnblk'
16215 d_eunice='$d_eunice'
16216 d_fchmod='$d_fchmod'
16217 d_fchown='$d_fchown'
16219 d_fcntl_can_lock='$d_fcntl_can_lock'
16220 d_fd_macros='$d_fd_macros'
16221 d_fd_set='$d_fd_set'
16222 d_fds_bits='$d_fds_bits'
16223 d_fgetpos='$d_fgetpos'
16224 d_flexfnam='$d_flexfnam'
16227 d_fpathconf='$d_fpathconf'
16228 d_fpos64_t='$d_fpos64_t'
16229 d_frexpl='$d_frexpl'
16230 d_fs_data_s='$d_fs_data_s'
16231 d_fseeko='$d_fseeko'
16232 d_fsetpos='$d_fsetpos'
16233 d_fstatfs='$d_fstatfs'
16234 d_fstatvfs='$d_fstatvfs'
16236 d_ftello='$d_ftello'
16238 d_getcwd='$d_getcwd'
16239 d_getespwnam='$d_getespwnam'
16240 d_getfsstat='$d_getfsstat'
16241 d_getgrent='$d_getgrent'
16242 d_getgrps='$d_getgrps'
16243 d_gethbyaddr='$d_gethbyaddr'
16244 d_gethbyname='$d_gethbyname'
16245 d_gethent='$d_gethent'
16246 d_gethname='$d_gethname'
16247 d_gethostprotos='$d_gethostprotos'
16248 d_getitimer='$d_getitimer'
16249 d_getlogin='$d_getlogin'
16250 d_getmnt='$d_getmnt'
16251 d_getmntent='$d_getmntent'
16252 d_getnbyaddr='$d_getnbyaddr'
16253 d_getnbyname='$d_getnbyname'
16254 d_getnent='$d_getnent'
16255 d_getnetprotos='$d_getnetprotos'
16256 d_getpagsz='$d_getpagsz'
16257 d_getpbyname='$d_getpbyname'
16258 d_getpbynumber='$d_getpbynumber'
16259 d_getpent='$d_getpent'
16260 d_getpgid='$d_getpgid'
16261 d_getpgrp2='$d_getpgrp2'
16262 d_getpgrp='$d_getpgrp'
16263 d_getppid='$d_getppid'
16264 d_getprior='$d_getprior'
16265 d_getprotoprotos='$d_getprotoprotos'
16266 d_getprpwnam='$d_getprpwnam'
16267 d_getpwent='$d_getpwent'
16268 d_getsbyname='$d_getsbyname'
16269 d_getsbyport='$d_getsbyport'
16270 d_getsent='$d_getsent'
16271 d_getservprotos='$d_getservprotos'
16272 d_getspnam='$d_getspnam'
16273 d_gettimeod='$d_gettimeod'
16274 d_gnulibc='$d_gnulibc'
16275 d_grpasswd='$d_grpasswd'
16276 d_hasmntopt='$d_hasmntopt'
16280 d_inetaton='$d_inetaton'
16281 d_int64_t='$d_int64_t'
16282 d_isascii='$d_isascii'
16284 d_isnanl='$d_isnanl'
16285 d_killpg='$d_killpg'
16286 d_lchown='$d_lchown'
16287 d_ldbl_dig='$d_ldbl_dig'
16289 d_locconv='$d_locconv'
16291 d_longdbl='$d_longdbl'
16292 d_longlong='$d_longlong'
16293 d_lseekproto='$d_lseekproto'
16295 d_madvise='$d_madvise'
16297 d_mbstowcs='$d_mbstowcs'
16298 d_mbtowc='$d_mbtowc'
16299 d_memchr='$d_memchr'
16300 d_memcmp='$d_memcmp'
16301 d_memcpy='$d_memcpy'
16302 d_memmove='$d_memmove'
16303 d_memset='$d_memset'
16305 d_mkdtemp='$d_mkdtemp'
16306 d_mkfifo='$d_mkfifo'
16307 d_mkstemp='$d_mkstemp'
16308 d_mkstemps='$d_mkstemps'
16309 d_mktime='$d_mktime'
16312 d_mprotect='$d_mprotect'
16314 d_msg_ctrunc='$d_msg_ctrunc'
16315 d_msg_dontroute='$d_msg_dontroute'
16316 d_msg_oob='$d_msg_oob'
16317 d_msg_peek='$d_msg_peek'
16318 d_msg_proxy='$d_msg_proxy'
16319 d_msgctl='$d_msgctl'
16320 d_msgget='$d_msgget'
16321 d_msghdr_s='$d_msghdr_s'
16322 d_msgrcv='$d_msgrcv'
16323 d_msgsnd='$d_msgsnd'
16325 d_munmap='$d_munmap'
16326 d_mymalloc='$d_mymalloc'
16328 d_nv_preserves_uv='$d_nv_preserves_uv'
16329 d_nv_preserves_uv_bits='$d_nv_preserves_uv_bits'
16330 d_off64_t='$d_off64_t'
16331 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
16332 d_oldpthreads='$d_oldpthreads'
16333 d_oldsock='$d_oldsock'
16335 d_pathconf='$d_pathconf'
16337 d_perl_otherlibdirs='$d_perl_otherlibdirs'
16338 d_phostname='$d_phostname'
16341 d_portable='$d_portable'
16342 d_pthread_yield='$d_pthread_yield'
16344 d_pwchange='$d_pwchange'
16345 d_pwclass='$d_pwclass'
16346 d_pwcomment='$d_pwcomment'
16347 d_pwexpire='$d_pwexpire'
16348 d_pwgecos='$d_pwgecos'
16349 d_pwpasswd='$d_pwpasswd'
16350 d_pwquota='$d_pwquota'
16353 d_readdir='$d_readdir'
16354 d_readlink='$d_readlink'
16356 d_recvmsg='$d_recvmsg'
16357 d_rename='$d_rename'
16358 d_rewinddir='$d_rewinddir'
16360 d_safebcpy='$d_safebcpy'
16361 d_safemcpy='$d_safemcpy'
16362 d_sanemcmp='$d_sanemcmp'
16363 d_sbrkproto='$d_sbrkproto'
16364 d_sched_yield='$d_sched_yield'
16365 d_scm_rights='$d_scm_rights'
16366 d_seekdir='$d_seekdir'
16367 d_select='$d_select'
16369 d_semctl='$d_semctl'
16370 d_semctl_semid_ds='$d_semctl_semid_ds'
16371 d_semctl_semun='$d_semctl_semun'
16372 d_semget='$d_semget'
16374 d_sendmsg='$d_sendmsg'
16375 d_setegid='$d_setegid'
16376 d_seteuid='$d_seteuid'
16377 d_setgrent='$d_setgrent'
16378 d_setgrps='$d_setgrps'
16379 d_sethent='$d_sethent'
16380 d_setitimer='$d_setitimer'
16381 d_setlinebuf='$d_setlinebuf'
16382 d_setlocale='$d_setlocale'
16383 d_setnent='$d_setnent'
16384 d_setpent='$d_setpent'
16385 d_setpgid='$d_setpgid'
16386 d_setpgrp2='$d_setpgrp2'
16387 d_setpgrp='$d_setpgrp'
16388 d_setprior='$d_setprior'
16389 d_setproctitle='$d_setproctitle'
16390 d_setpwent='$d_setpwent'
16391 d_setregid='$d_setregid'
16392 d_setresgid='$d_setresgid'
16393 d_setresuid='$d_setresuid'
16394 d_setreuid='$d_setreuid'
16395 d_setrgid='$d_setrgid'
16396 d_setruid='$d_setruid'
16397 d_setsent='$d_setsent'
16398 d_setsid='$d_setsid'
16399 d_setvbuf='$d_setvbuf'
16403 d_shmatprototype='$d_shmatprototype'
16404 d_shmctl='$d_shmctl'
16406 d_shmget='$d_shmget'
16407 d_sigaction='$d_sigaction'
16408 d_sigprocmask='$d_sigprocmask'
16409 d_sigsetjmp='$d_sigsetjmp'
16410 d_sockatmark='$d_sockatmark'
16411 d_socket='$d_socket'
16412 d_socklen_t='$d_socklen_t'
16413 d_sockpair='$d_sockpair'
16414 d_socks5_init='$d_socks5_init'
16416 d_statblks='$d_statblks'
16417 d_statfs_f_flags='$d_statfs_f_flags'
16418 d_statfs_s='$d_statfs_s'
16419 d_statvfs='$d_statvfs'
16420 d_stdio_cnt_lval='$d_stdio_cnt_lval'
16421 d_stdio_ptr_lval='$d_stdio_ptr_lval'
16422 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
16423 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
16424 d_stdio_stream_array='$d_stdio_stream_array'
16425 d_stdiobase='$d_stdiobase'
16426 d_stdstdio='$d_stdstdio'
16427 d_strchr='$d_strchr'
16428 d_strcoll='$d_strcoll'
16429 d_strctcpy='$d_strctcpy'
16430 d_strerrm='$d_strerrm'
16431 d_strerror='$d_strerror'
16432 d_strftime='$d_strftime'
16433 d_strtod='$d_strtod'
16434 d_strtol='$d_strtol'
16435 d_strtold='$d_strtold'
16436 d_strtoll='$d_strtoll'
16437 d_strtoq='$d_strtoq'
16438 d_strtoul='$d_strtoul'
16439 d_strtoull='$d_strtoull'
16440 d_strtouq='$d_strtouq'
16441 d_strxfrm='$d_strxfrm'
16442 d_suidsafe='$d_suidsafe'
16443 d_symlink='$d_symlink'
16444 d_syscall='$d_syscall'
16445 d_sysconf='$d_sysconf'
16446 d_sysernlst='$d_sysernlst'
16447 d_syserrlst='$d_syserrlst'
16448 d_system='$d_system'
16449 d_tcgetpgrp='$d_tcgetpgrp'
16450 d_tcsetpgrp='$d_tcsetpgrp'
16451 d_telldir='$d_telldir'
16452 d_telldirproto='$d_telldirproto'
16455 d_truncate='$d_truncate'
16456 d_tzname='$d_tzname'
16457 d_u32align='$d_u32align'
16458 d_ualarm='$d_ualarm'
16461 d_union_semun='$d_union_semun'
16462 d_usleep='$d_usleep'
16464 d_vendorarch='$d_vendorarch'
16465 d_vendorbin='$d_vendorbin'
16466 d_vendorlib='$d_vendorlib'
16468 d_void_closedir='$d_void_closedir'
16469 d_voidsig='$d_voidsig'
16470 d_voidtty='$d_voidtty'
16471 d_volatile='$d_volatile'
16472 d_vprintf='$d_vprintf'
16474 d_waitpid='$d_waitpid'
16475 d_wcstombs='$d_wcstombs'
16476 d_wctomb='$d_wctomb'
16477 d_writev='$d_writev'
16480 db_hashtype='$db_hashtype'
16481 db_prefixtype='$db_prefixtype'
16482 defvoidused='$defvoidused'
16483 direntrytype='$direntrytype'
16486 doublesize='$doublesize'
16488 dynamic_ext='$dynamic_ext'
16494 eunicefix='$eunicefix'
16497 extensions='$extensions'
16498 fflushNULL='$fflushNULL'
16499 fflushall='$fflushall'
16501 firstmakefile='$firstmakefile'
16503 fpossize='$fpossize'
16504 fpostype='$fpostype'
16505 freetype='$freetype'
16507 full_csh='$full_csh'
16508 full_sed='$full_sed'
16509 gccosandvers='$gccosandvers'
16510 gccversion='$gccversion'
16511 gidformat='$gidformat'
16517 groupcat='$groupcat'
16518 groupstype='$groupstype'
16521 h_sysfile='$h_sysfile'
16532 i_arpainet='$i_arpainet'
16533 i_bsdioctl='$i_bsdioctl'
16536 i_dirent='$i_dirent'
16544 i_ieeefp='$i_ieeefp'
16545 i_inttypes='$i_inttypes'
16546 i_libutil='$i_libutil'
16547 i_limits='$i_limits'
16548 i_locale='$i_locale'
16549 i_machcthr='$i_machcthr'
16550 i_malloc='$i_malloc'
16552 i_memory='$i_memory'
16553 i_mntent='$i_mntent'
16556 i_neterrno='$i_neterrno'
16557 i_netinettcp='$i_netinettcp'
16561 i_pthread='$i_pthread'
16563 i_rpcsvcdbm='$i_rpcsvcdbm'
16566 i_shadow='$i_shadow'
16568 i_stdarg='$i_stdarg'
16569 i_stddef='$i_stddef'
16570 i_stdlib='$i_stdlib'
16571 i_string='$i_string'
16572 i_sunmath='$i_sunmath'
16573 i_sysaccess='$i_sysaccess'
16574 i_sysdir='$i_sysdir'
16575 i_sysfile='$i_sysfile'
16576 i_sysfilio='$i_sysfilio'
16578 i_sysioctl='$i_sysioctl'
16579 i_syslog='$i_syslog'
16580 i_sysmman='$i_sysmman'
16581 i_sysmode='$i_sysmode'
16582 i_sysmount='$i_sysmount'
16583 i_sysndir='$i_sysndir'
16584 i_sysparam='$i_sysparam'
16585 i_sysresrc='$i_sysresrc'
16586 i_syssecrt='$i_syssecrt'
16587 i_sysselct='$i_sysselct'
16588 i_syssockio='$i_syssockio'
16589 i_sysstat='$i_sysstat'
16590 i_sysstatfs='$i_sysstatfs'
16591 i_sysstatvfs='$i_sysstatvfs'
16592 i_systime='$i_systime'
16593 i_systimek='$i_systimek'
16594 i_systimes='$i_systimes'
16595 i_systypes='$i_systypes'
16596 i_sysuio='$i_sysuio'
16598 i_sysutsname='$i_sysutsname'
16599 i_sysvfs='$i_sysvfs'
16600 i_syswait='$i_syswait'
16601 i_termio='$i_termio'
16602 i_termios='$i_termios'
16604 i_unistd='$i_unistd'
16607 i_values='$i_values'
16608 i_varargs='$i_varargs'
16609 i_varhdr='$i_varhdr'
16611 ignore_versioned_solibs='$ignore_versioned_solibs'
16612 inc_version_list='$inc_version_list'
16613 inc_version_list_init='$inc_version_list_init'
16616 installarchlib='$installarchlib'
16617 installbin='$installbin'
16618 installman1dir='$installman1dir'
16619 installman3dir='$installman3dir'
16620 installprefix='$installprefix'
16621 installprefixexp='$installprefixexp'
16622 installprivlib='$installprivlib'
16623 installscript='$installscript'
16624 installsitearch='$installsitearch'
16625 installsitebin='$installsitebin'
16626 installsitelib='$installsitelib'
16627 installstyle='$installstyle'
16628 installusrbinperl='$installusrbinperl'
16629 installvendorarch='$installvendorarch'
16630 installvendorbin='$installvendorbin'
16631 installvendorlib='$installvendorlib'
16633 issymlink='$issymlink'
16634 ivdformat='$ivdformat'
16637 known_extensions='$known_extensions'
16640 lddlflags='$lddlflags'
16642 ldflags_uselargefiles='$ldflags_uselargefiles'
16643 ldlibpthname='$ldlibpthname'
16650 libsdirs='$libsdirs'
16651 libsfiles='$libsfiles'
16652 libsfound='$libsfound'
16653 libspath='$libspath'
16654 libswanted='$libswanted'
16655 libswanted_uselargefiles='$libswanted_uselargefiles'
16661 locincpth='$locincpth'
16662 loclibpth='$loclibpth'
16663 longdblsize='$longdblsize'
16664 longlongsize='$longlongsize'
16665 longsize='$longsize'
16669 lseeksize='$lseeksize'
16670 lseektype='$lseektype'
16674 make_set_make='$make_set_make'
16675 mallocobj='$mallocobj'
16676 mallocsrc='$mallocsrc'
16677 malloctype='$malloctype'
16679 man1direxp='$man1direxp'
16682 man3direxp='$man3direxp'
16684 mips_type='$mips_type'
16686 mmaptype='$mmaptype'
16687 modetype='$modetype'
16689 multiarch='$multiarch'
16691 myarchname='$myarchname'
16692 mydomain='$mydomain'
16693 myhostname='$myhostname'
16696 need_va_copy='$need_va_copy'
16697 netdb_hlen_type='$netdb_hlen_type'
16698 netdb_host_type='$netdb_host_type'
16699 netdb_name_type='$netdb_name_type'
16700 netdb_net_type='$netdb_net_type'
16703 nm_so_opt='$nm_so_opt'
16704 nonxs_ext='$nonxs_ext'
16706 nvEUformat='$nvEUformat'
16707 nvFUformat='$nvFUformat'
16708 nvGUformat='$nvGUformat'
16709 nveformat='$nveformat'
16710 nvfformat='$nvfformat'
16711 nvgformat='$nvgformat'
16714 o_nonblock='$o_nonblock'
16716 old_pthread_create_joinable='$old_pthread_create_joinable'
16717 optimize='$optimize'
16718 orderlib='$orderlib'
16721 otherlibdirs='$otherlibdirs'
16725 patchlevel='$patchlevel'
16726 path_sep='$path_sep'
16729 perl_patchlevel='$perl_patchlevel'
16730 perladmin='$perladmin'
16731 perllibs='$perllibs'
16732 perlpath='$perlpath'
16734 phostname='$phostname'
16737 pm_apiversion='$pm_apiversion'
16741 prefixexp='$prefixexp'
16743 privlibexp='$privlibexp'
16744 prototype='$prototype'
16746 quadkind='$quadkind'
16747 quadtype='$quadtype'
16748 randbits='$randbits'
16749 randfunc='$randfunc'
16750 randseedtype='$randseedtype'
16752 rd_nodata='$rd_nodata'
16753 revision='$revision'
16757 sPRIEUldbl='$sPRIEUldbl'
16758 sPRIFUldbl='$sPRIFUldbl'
16759 sPRIGUldbl='$sPRIGUldbl'
16760 sPRIXU64='$sPRIXU64'
16762 sPRIeldbl='$sPRIeldbl'
16763 sPRIfldbl='$sPRIfldbl'
16764 sPRIgldbl='$sPRIgldbl'
16769 sSCNfldbl='$sSCNfldbl'
16770 sched_yield='$sched_yield'
16771 scriptdir='$scriptdir'
16772 scriptdirexp='$scriptdirexp'
16774 seedfunc='$seedfunc'
16775 selectminbits='$selectminbits'
16776 selecttype='$selecttype'
16777 sendmail='$sendmail'
16780 sharpbang='$sharpbang'
16781 shmattype='$shmattype'
16782 shortsize='$shortsize'
16785 sig_count='$sig_count'
16786 sig_name='$sig_name'
16787 sig_name_init='$sig_name_init'
16789 sig_num_init='$sig_num_init'
16790 sig_size='$sig_size'
16791 signal_t='$signal_t'
16792 sitearch='$sitearch'
16793 sitearchexp='$sitearchexp'
16795 sitebinexp='$sitebinexp'
16797 sitelib_stem='$sitelib_stem'
16798 sitelibexp='$sitelibexp'
16799 siteprefix='$siteprefix'
16800 siteprefixexp='$siteprefixexp'
16801 sizesize='$sizesize'
16802 sizetype='$sizetype'
16806 sockethdr='$sockethdr'
16807 socketlib='$socketlib'
16808 socksizetype='$socksizetype'
16810 spackage='$spackage'
16811 spitshell='$spitshell'
16813 ssizetype='$ssizetype'
16814 startperl='$startperl'
16816 static_ext='$static_ext'
16818 stdio_base='$stdio_base'
16819 stdio_bufsiz='$stdio_bufsiz'
16820 stdio_cnt='$stdio_cnt'
16821 stdio_filbuf='$stdio_filbuf'
16822 stdio_ptr='$stdio_ptr'
16823 stdio_stream_array='$stdio_stream_array'
16826 subversion='$subversion'
16833 timeincl='$timeincl'
16834 timetype='$timetype'
16847 uidformat='$uidformat'
16853 uquadtype='$uquadtype'
16854 use5005threads='$use5005threads'
16855 use64bitall='$use64bitall'
16856 use64bitint='$use64bitint'
16858 useithreads='$useithreads'
16859 uselargefiles='$uselargefiles'
16860 uselongdouble='$uselongdouble'
16861 usemorebits='$usemorebits'
16862 usemultiplicity='$usemultiplicity'
16863 usemymalloc='$usemymalloc'
16865 useopcode='$useopcode'
16866 useperlio='$useperlio'
16867 useposix='$useposix'
16869 useshrplib='$useshrplib'
16870 usesocks='$usesocks'
16871 usethreads='$usethreads'
16872 usevendorprefix='$usevendorprefix'
16873 usevfork='$usevfork'
16876 uvXUformat='$uvXUformat'
16877 uvoformat='$uvoformat'
16880 uvuformat='$uvuformat'
16881 uvxformat='$uvxformat'
16882 vendorarch='$vendorarch'
16883 vendorarchexp='$vendorarchexp'
16884 vendorbin='$vendorbin'
16885 vendorbinexp='$vendorbinexp'
16886 vendorlib='$vendorlib'
16887 vendorlib_stem='$vendorlib_stem'
16888 vendorlibexp='$vendorlibexp'
16889 vendorprefix='$vendorprefix'
16890 vendorprefixexp='$vendorprefixexp'
16892 versiononly='$versiononly'
16894 voidflags='$voidflags'
16896 xs_apiversion='$xs_apiversion'
16898 yaccflags='$yaccflags'
16903 : Add in command line options if available
16904 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
16906 : add special variables
16907 $test -f $src/patchlevel.h && \
16908 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
16909 echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
16910 echo "PERL_CONFIG_SH=true" >>config.sh
16912 : propagate old symbols
16913 if $test -f UU/config.sh; then
16914 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
16915 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
16916 $sort | $uniq -u >UU/oldsyms
16917 set X `cat UU/oldsyms`
16923 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
16925 echo "# Variables propagated from previous config.sh file." >>config.sh
16926 for sym in `cat UU/oldsyms`; do
16927 echo " Propagating $hint variable "'$'"$sym..."
16928 eval 'tmp="$'"${sym}"'"'
16930 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
16936 : Finish up by extracting the .SH files
16950 If you'd like to make any changes to the config.sh file before I begin
16951 to configure things, do it as a shell escape now (e.g. !vi config.sh).
16954 rp="Press return or use a shell escape to edit config.sh:"
16959 *) : in case they cannot read
16960 sh 1>&4 -c "$ans";;
16965 : if this fails, just run all the .SH files by hand
16972 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
16979 Now you need to generate make dependencies by running "$make depend".
16980 You might prefer to run it in background: "$make depend > makedepend.out &"
16981 It can take a while, so you might not want to run it right now.
16986 rp="Run $make depend now?"
16990 $make depend && echo "Now you must run '$make'."
16993 echo "You must run '$make depend' then '$make'."
16996 elif test -f [Mm]akefile; then
16998 echo "Now you must run a $make."
17003 if $test -f Policy.sh; then
17006 If you compile $package on a different machine or from a different object
17007 directory, copy the Policy.sh file from this object directory to the
17008 new one before you run Configure -- this will help you with most of
17009 the policy defaults.
17013 if $test -f config.msg; then
17014 echo "Hmm. I also noted the following information while running:"
17016 $cat config.msg >&4
17019 $rm -f kit*isdone ark*isdone