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 Fri Jun 1 19:20:32 EET DST 2001 [metaconfig 3.0 PL70]
24 # (with additional metaconfig patches by perlbug@perl.org)
29 SCO csh still thinks true is false. Write to SCO today and tell them that next
30 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
32 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
33 we'd have to do is go in and swap the && and || tokens, wherever they are.)
35 [End of diatribe. We now return you to your regularly scheduled programming...]
39 OOPS! You naughty creature! You didn't run Configure with sh!
40 I will attempt to remedy the situation by running sh for you...
44 true || exec sh $0 $argv:q
46 (exit $?0) || cat c2$$
47 (exit $?0) || exec sh $0 $argv:q
50 : compute my invocation name
54 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
59 : Proper separator for the PATH environment variable
61 : On OS/2 this directory should exist if this is not floppy only system :-]
62 if test -d c:/. ; then
63 if test -n "$OS2_SHELL"; then
65 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
66 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
67 elif test -n "$DJGPP"; then
73 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
74 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
75 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
76 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
77 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
78 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /usr/ccs/bin"
79 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
80 paths="$paths /sbin /usr/sbin /usr/libexec"
86 *) test -d $p && PATH=$PATH$p_$p ;;
93 : shall we be using ksh?
99 if (PATH=.; alias -x) >/dev/null 2>&1; then
102 if test -f /hp-ux -a -f /bin/ksh; then
103 needksh='to avoid sh bug in "here document" expansion'
105 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
106 if test X`/usr/bin/uname -v` = X4; then
107 avoidksh="to avoid AIX 4's /bin/sh"
111 if test -f /osf_boot -a -f /usr/sbin/setld; then
112 if test X`/usr/bin/uname -s` = XOSF1; then
113 avoidksh="to avoid Digital UNIX' ksh"
115 unset BIN_SH # if this is 'xpg4' sh will start up ksh
118 case "$inksh/$needksh" in
125 case "$inksh/$avoidksh" in
131 case "$inksh/$needksh-$avoidksh-" in
134 (I see you are using the Korn shell. Some ksh's blow up on $me,
135 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
141 echo "(Feeding myself to $newsh $reason.)"
143 Configure|*/Configure) exec $newsh $0 "$@";;
144 *) exec $newsh Configure "$@";;
149 : if needed set CDPATH to a harmless value that is not chatty
150 : avoid bash 2.02 problems with empty CDPATH.
154 *bash*) CDPATH='.' ;;
159 : Configure runs within the UU subdirectory
160 test -d UU || mkdir UU
469 d_old_pthread_create_joinable=''
470 old_pthread_create_joinable=''
556 d_stdio_ptr_lval_nochange_cnt=''
557 d_stdio_ptr_lval_sets_cnt=''
737 inc_version_list_init=''
756 ignore_versioned_solibs=''
815 d_perl_otherlibdirs=''
833 d_nv_preserves_uv_bits=''
932 d_stdio_stream_array=''
933 stdio_stream_array=''
943 ccflags_uselargefiles=''
944 ldflags_uselargefiles=''
945 libswanted_uselargefiles=''
990 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
993 : We must find out about Eunice early
995 if test -f /etc/unixtovms; then
996 eunicefix=/etc/unixtovms
998 if test -f /etc/unixtovms.exe; then
999 eunicefix=/etc/unixtovms.exe
1006 : set useposix=false in your hint file to disable the POSIX extension.
1008 : set useopcode=false in your hint file to disable the Opcode extension.
1010 : Trailing extension. Override this in a hint file, if needed.
1012 : Extra object files, if any, needed on this platform.
1015 : Possible local include directories to search.
1016 : Set locincpth to "" in a hint file to defeat local include searches.
1017 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1018 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1020 : no include file wanted by default
1024 : change the next line if compiling for Xenix/286 on Xenix/386
1025 xlibpth='/usr/lib/386 /lib/386'
1026 : Possible local library directories to search.
1027 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1028 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1030 : general looking path for locating libraries
1031 glibpth="/lib /usr/lib $xlibpth"
1032 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1033 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1034 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1036 : Private path used by Configure to find libraries. Its value
1037 : is prepended to libpth. This variable takes care of special
1038 : machines, like the mips. Usually, it should be empty.
1041 : default library list
1043 : some systems want to use only the non-versioned libso:s
1044 ignore_versioned_solibs=''
1046 ccflags_uselargefiles=''
1047 ldflags_uselargefiles=''
1048 libswanted_uselargefiles=''
1049 : set usemultiplicity on the Configure command line to enable multiplicity.
1050 : set usesocks on the Configure command line to enable socks.
1051 : set usethreads on the Configure command line to enable threads.
1052 : full support for void wanted by default
1055 : List of libraries we want.
1056 : If anyone needs -lnet, put it in a hint file.
1057 libswanted='sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl'
1058 libswanted="$libswanted dld ld sun m c cposix posix"
1059 libswanted="$libswanted ndir dir crypt sec"
1060 libswanted="$libswanted ucb bsd BSD PW x iconv util"
1061 : We probably want to search /usr/shlib before most other libraries.
1062 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1063 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1064 glibpth="/usr/shlib $glibpth"
1065 : Do not use vfork unless overridden by a hint file.
1068 : Find the basic shell for Bourne shell scripts
1072 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1075 if test -f "$xxx"; then
1078 : Build up a list and do a single loop so we can 'break' out.
1079 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1080 for xxx in sh bash ksh pdksh ash; do
1082 try="$try ${p}/${xxx}"
1086 if test -f "$xxx"; then
1089 elif test -f "$xxx.exe"; then
1100 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1102 Usually it's in /bin/sh. How did you even get this far?
1103 Please contact me (Perl Maintainers) at perlbug@perl.org and
1104 we'll try to straighten this all out.
1110 : see if sh knows # comments
1111 if `$sh -c '#' >/dev/null 2>&1`; then
1115 test -f $xcat || xcat=/usr/bin/cat
1120 if test -s today; then
1123 echo "#! $xcat" > try
1127 if test -s today; then
1135 echo "Your $sh doesn't grok # comments--I will strip them later on."
1138 echo "exec grep -v '^[ ]*#'" >spitshell
1140 $eunicefix spitshell
1141 spitshell=`pwd`/spitshell
1143 echo "I presume that if # doesn't work, #! won't work either!"
1148 : figure out how to guarantee sh startup
1150 '') startsh=${sharpbang}${sh} ;;
1162 : echo "Yup, it does."
1164 echo "Hmm... '$startsh' does not guarantee sh startup..."
1165 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1170 : Save command line options in file UU/cmdline.opt for later use in
1171 : generating config.sh.
1172 cat > cmdline.opt <<EOSH
1173 # Configure command line arguments.
1180 cat >>cmdline.opt <<EOSH
1181 config_arg$argn='$arg'
1183 argn=`expr $argn + 1`
1186 : produce awk script to parse command line options
1187 cat >options.awk <<'EOF'
1189 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1191 len = length(optstr);
1192 for (i = 1; i <= len; i++) {
1193 c = substr(optstr, i, 1);
1194 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1205 if (substr(str, 1, 1) != "-") {
1206 printf("'%s'\n", str);
1210 for (i = 2; i <= len; i++) {
1211 c = substr(str, i, 1);
1213 printf("-%s\n", substr(str, i));
1219 printf("'%s'\n", substr(str, i + 1));
1232 : process the command line options
1233 set X `for arg in "$@"; do echo "X$arg"; done |
1234 sed -e s/X// | awk -f options.awk`
1239 : set up default values
1249 rm -f optdef.sh posthint.sh
1250 cat >optdef.sh <<EOS
1256 while test $# -gt 0; do
1258 -d) shift; fastread=yes;;
1259 -e) shift; alldone=cont;;
1263 if test -r "$1"; then
1266 echo "$me: cannot read config file $1." >&2
1271 -h) shift; error=true;;
1272 -r) shift; reuseval=true;;
1273 -s) shift; silent=true; realsilent=true;;
1274 -E) shift; alldone=exit;;
1275 -K) shift; knowitall=true;;
1276 -O) shift; override=true;;
1277 -S) shift; silent=true; extractsh=true;;
1282 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1283 echo "$me: ignoring -D $1" >&2
1286 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1287 *) echo "$1='define'" >> optdef.sh;;
1294 *=) echo "$1" >> optdef.sh;;
1296 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1297 echo "$me: ignoring -U $1" >&2
1299 *) echo "$1='undef'" >> optdef.sh;;
1310 *=*) zzz=`echo $yyy|sed 's!=.*!!'`
1314 zzz=" "`echo $yyy|sed 's!^[^=]*=!!'`
1315 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1321 *:*) xxx=`echo $yyy|sed 's!:.*!!'`
1322 yyy=`echo $yyy|sed 's!^[^:]*:!!'`
1323 zzz=`echo $yyy|sed 's!^[^=]*=!!'`
1324 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1325 *) xxx=`echo $yyy|sed 's!:.*!!'`
1326 yyy=`echo $yyy|sed 's!^[^:]*:!!'` ;;
1332 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1334 echo "$yyy=''" >> posthint.sh ;;
1339 echo "$yyy='$zzz'" >> posthint.sh ;;
1341 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1343 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1348 echo "$yyy=$zzz" >> posthint.sh ;;
1349 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1353 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1356 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1364 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1365 [-U symbol] [-U symbol=] [-A command:symbol...]
1366 -d : use defaults for all answers.
1367 -e : go on without questioning past the production of config.sh.
1368 -f : specify an alternate default configuration file.
1369 -h : print this help message and exit (with an error status).
1370 -r : reuse C symbols value if possible (skips costly nm extraction).
1371 -s : silent mode, only echoes questions and essential information.
1372 -D : define symbol to have some value:
1373 -D symbol symbol gets the value 'define'
1374 -D symbol=value symbol gets the value 'value'
1375 -E : stop at the end of questions, after having produced config.sh.
1376 -K : do not use unless you know what you are doing.
1377 -O : let -D and -U override definitions from loaded configuration file.
1378 -S : perform variable substitutions on all .SH files (can mix with -f)
1379 -U : undefine symbol:
1380 -U symbol symbol gets the value 'undef'
1381 -U symbol= symbol gets completely empty
1382 -A : manipulate symbol after the platform specific hints have been applied:
1383 -A symbol=value append " "value to symbol
1384 -A append:symbol=value append value to symbol
1385 -A define:symbol=value define symbol to have value
1386 -A clear:symbol define symbol to be ''
1387 -A define:symbol define symbol to be 'define'
1388 -A eval:symbol=value define symbol to be eval of value
1389 -A prepend:symbol=value prepend value to symbol
1390 -A undef:symbol define symbol to be 'undef'
1391 -A undef:symbol= define symbol to be ''
1392 -V : print version number and exit (with a zero status).
1399 case "$fastread$alldone" in
1402 case "$extractsh" in
1405 if test ! -t 0; then
1406 echo "Say 'sh Configure', not 'sh <Configure'"
1416 true) exec 1>/dev/null;;
1419 : run the defines and the undefines, if any, but leave the file out there...
1422 : create the posthint manipulation script and leave the file out there...
1427 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1428 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1429 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1430 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1431 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1434 : Some greps do not return status, grrr.
1435 echo "grimblepritz" >grimble
1436 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1438 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1444 : the following should work in any shell
1448 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1449 cat >contains <<'EOSS'
1450 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1455 : Find the path to the source tree
1458 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1462 *) src=`cd ../$src && pwd` ;;
1475 if test -f $rsrc/Configure && \
1476 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1478 : found it, so we are ok.
1481 for src in . .. ../.. ../../.. ../../../..; do
1482 if test -f ../$src/Configure && \
1483 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1494 Sorry, I can't seem to locate the source dir for $package. Please start
1495 Configure with an explicit path -- i.e. /some/path/Configure.
1503 echo "Sources for $package found in \"$src\"." >&4
1507 : script used to extract .SH files with variable substitutions
1508 cat >extract <<'EOS'
1510 echo "Doing variable substitutions on .SH files..."
1511 if test -f $src/MANIFEST; then
1512 set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH$'`
1514 echo "(Looking for .SH files under the source directory.)"
1515 set x `(cd $src; find . -name "*.SH" -print)`
1519 0) set x `(cd $src; echo *.SH)`; shift;;
1521 if test ! -f $src/$1; then
1527 while test $name; do
1528 if test ! -d "$name"; then
1529 create="$name $create";
1530 name=`echo $name | sed -e "s|^[^/]*$||"`;
1531 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1536 for file in $create; do
1545 dir=`expr X$file : 'X\(.*\)/'`
1546 file=`expr X$file : 'X.*/\(.*\)'`
1547 (cd $dir && . ./$file)
1557 dir=`expr X$file : 'X\(.*\)/'`
1558 file=`expr X$file : 'X.*/\(.*\)'`
1559 (set x $dir; shift; eval $mkdir_p)
1569 if test -f $src/config_h.SH; then
1570 if test ! -f config.h; then
1571 : oops, they left it out of MANIFEST, probably, so do it anyway.
1577 : extract files and exit if asked to do so
1578 case "$extractsh" in
1580 case "$realsilent" in
1584 case "$config_sh" in
1585 '') config_sh='config.sh';;
1588 echo "Fetching answers from $config_sh..."
1591 test "$override" && . ./optdef.sh
1600 : Eunice requires " " instead of "", can you believe it
1603 echo "Beginning of configuration questions for $package."
1605 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1607 : first determine how to suppress newline on echo command
1609 echo "Checking echo to see how to suppress newlines..."
1610 (echo "hi there\c" ; echo " ") >.echotmp
1611 if $contains c .echotmp >/dev/null 2>&1 ; then
1622 echo $n "The star should be here-->$c"
1626 : Now test for existence of everything in MANIFEST
1628 if test -f $rsrc/MANIFEST; then
1629 echo "First let's make sure your kit is complete. Checking..." >&4
1630 awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
1633 for filelist in x??; do
1634 (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
1636 if test -s missing; then
1640 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1642 You have the option of continuing the configuration process, despite the
1643 distinct possibility that your kit is damaged, by typing 'y'es. If you
1644 do, don't blame me if something goes wrong. I advise you to type 'n'o
1645 and contact the author (perlbug@perl.org).
1648 echo $n "Continue? [n] $c" >&4
1652 echo "Continuing..." >&4
1656 echo "ABORTING..." >&4
1661 echo "Looks good..."
1664 echo "There is no MANIFEST file. I hope your kit is complete !"
1669 : Find the appropriate value for a newline for tr
1670 if test -n "$DJGPP"; then
1673 if test X"$trnl" = X; then
1674 case "`echo foo|tr '\n' x 2>/dev/null`" in
1678 if test X"$trnl" = X; then
1679 case "`echo foo|tr '\012' x 2>/dev/null`" in
1680 foox) trnl='\012' ;;
1683 if test X"$trnl" = X; then
1686 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1692 : compute the number of columns on the terminal for proper question formatting
1697 : set up the echo used in my read
1698 myecho="case \"\$xxxm\" in
1699 '') echo $n \"\$rp $c\" >&4;;
1701 '') echo $n \"[\$xxxm] $c\";;
1703 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1705 echo $n \"[\$xxxm] $c\" >&4
1707 echo $n \"\$rp [\$xxxm] $c\" >&4
1713 : now set up to do reads with possible shell escape and default assignment
1719 case "\$fastread" in
1720 yes) case "\$dflt" in
1723 case "\$silent-\$rp" in
1728 *) case "\$silent" in
1729 true) case "\$rp" in
1734 while expr "X\$ans" : "X!" >/dev/null; do
1738 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1746 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1755 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1760 echo "(OK, I'll run with -d after this question.)" >&4
1763 echo "*** Sorry, \$1 not supported yet." >&4
1773 echo "*** Substitution done -- please confirm."
1775 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1780 echo "*** Error -- try again."
1787 case "\$ans\$xxxm\$nostick" in
1799 : create .config dir to save info across Configure sessions
1800 test -d ../.config || mkdir ../.config
1801 cat >../.config/README <<EOF
1802 This directory created by Configure to save information that should
1803 persist across sessions for $package.
1805 You may safely delete it if you wish.
1808 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
1810 $define|true|[yY]*) ;;
1811 *) case "$xversion" in
1814 *** WHOA THERE!!! ***
1816 This is an UNSTABLE DEVELOPMENT release.
1817 The version of this $package distribution is $xversion, that is, odd,
1818 (as opposed to even) and that signifies a development release.
1819 If you want a maintenance release, you want an even-numbered version.
1821 Do ***NOT*** install this into production use.
1822 Data corruption and crashes are possible.
1824 It is most seriously suggested that you do not continue any further
1825 unless you want to help in developing and debugging Perl.
1827 If you *still* want to build perl, you can answer 'y' now,
1828 or pass -Dusedevel to Configure.
1831 rp='Do you really want to continue?'
1835 [yY]) echo >&4 "Okay, continuing."
1836 usedevel="$define" ;;
1837 *) echo >&4 "Okay, bye."
1847 case "$versiononly" in
1848 '') versiononly="$define" ;;
1850 case "$installusrbinperl" in
1851 '') installusrbinperl="$undef" ;;
1856 : general instructions
1859 user=`(logname) 2>/dev/null`
1861 '') user=`whoami 2>&1`;;
1863 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1866 rp='Would you like to see the instructions?'
1877 This installation shell script will examine your system and ask you questions
1878 to determine how the perl5 package should be installed. If you get
1879 stuck on a question, you may use a ! shell escape to start a subshell or
1880 execute a command. Many of the questions will have default answers in square
1881 brackets; typing carriage return will give you the default.
1883 On some of the questions which ask for file or directory names you are allowed
1884 to use the ~name construct to specify the login directory belonging to "name",
1885 even if you don't have a shell which knows about that. Questions where this is
1886 allowed will be marked "(~name ok)".
1890 dflt='Type carriage return to continue'
1894 The prompter used in this script allows you to use shell variables and
1895 backticks in your answers. You may use $1, $2, etc... to refer to the words
1896 in the default answer, as if the default line was a set of arguments given to a
1897 script shell. This means you may also use $* to repeat the whole default line,
1898 so you do not have to re-type everything to add something to the default.
1900 Everytime there is a substitution, you will have to confirm. If there is an
1901 error (e.g. an unmatched backtick), the default answer will remain unchanged
1902 and you will be prompted again.
1904 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1905 the questions and use the computed defaults (or the previous answers if there
1906 was already a config.sh file). Type 'Configure -h' for a list of options.
1907 You may also start interactively and then answer '& -d' at any prompt to turn
1908 on the non-interactive behaviour for the remainder of the execution.
1914 Much effort has been expended to ensure that this shell script will run on any
1915 Unix system. If despite that it blows up on yours, your best bet is to edit
1916 Configure and run it again. If you can't run Configure for some reason,
1917 you'll have to generate a config.sh file by hand. Whatever problems you
1918 have, let me (perlbug@perl.org) know how I blew it.
1920 This installation script affects things in two ways:
1922 1) it may do direct variable substitutions on some of the files included
1924 2) it builds a config.h file for inclusion in C programs. You may edit
1925 any of these files as the need arises after running this script.
1927 If you make a mistake on a question, there is no easy way to back up to it
1928 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1929 files. Configure will offer to let you do this before it runs the SH files.
1932 dflt='Type carriage return to continue'
1934 case "$firsttime" in
1935 true) echo $user >>../.config/instruct;;
1939 : find out where common programs are
1941 echo "Locating common programs..." >&4
1954 if test -d \$dir/\$thing; then
1960 for thisthing in \$dir/\$thing; do
1961 : just loop through to pick last item
1963 if test -f \$thisthing; then
1966 elif test -f \$dir/\$thing.exe; then
1967 if test -n "$DJGPP"; then
1968 echo \$dir/\$thing.exe
1970 : on Eunice apparently
2021 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2022 pth="$pth /lib /usr/lib"
2023 for file in $loclist; do
2027 if test -f "$xxx"; then
2030 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2031 xxx=`./loc $file $file $pth`
2034 '') xxx=`./loc $file $file $pth`;;
2035 *) xxx=`./loc $xxx $xxx $pth`;;
2041 echo $file is in $xxx.
2044 echo $file is in $xxx.
2047 echo "I don't know where '$file' is, and my life depends on it." >&4
2048 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2054 echo "Don't worry if any of the following aren't found..."
2056 for file in $trylist; do
2060 if test -f "$xxx"; then
2063 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2064 xxx=`./loc $file $file $pth`
2067 '') xxx=`./loc $file $file $pth`;;
2068 *) xxx=`./loc $xxx $xxx $pth`;;
2074 echo $file is in $xxx.
2077 echo $file is in $xxx.
2080 echo "I don't see $file out there, $say."
2087 echo "Substituting grep for egrep."
2093 echo "Substituting cp for ln."
2099 echo "Hopefully test is built into your sh."
2102 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2103 echo "Using the test built into your sh."
2111 echo "Hopefully echo is built into your sh."
2116 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2117 $echo $n "hi there$c" >foo1
2118 echo $n "hi there$c" >foo2
2119 if cmp foo1 foo2 >/dev/null 2>&1; then
2120 echo "They are compatible. In fact, they may be identical."
2127 They are not compatible! You are probably running ksh on a non-USG system.
2128 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2129 have echo built in and we may have to run some Bourne shell scripts. That
2130 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2133 $echo $n "The star should be here-->$c"
2143 cat <<'EOSC' >>checkcc
2148 int main(int argc, char *argv[]) {
2152 if $cc -o try $ccflags $ldflags try.c; then
2155 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2161 case "`$cc -v -c try.c 2>&1`" in
2164 if $test X"$trygcc" = Xyes; then
2165 if gcc -o try -c try.c; then
2167 echo "You seem to have a working gcc, though." >&4
2168 rp="Would you like to use it?"
2170 if $test -f myread; then
2173 if $test -f UU/myread; then
2176 echo "Cannot find myread, sorry. Aborting." >&2
2181 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no ;;
2185 if $test X"$despair" = Xyes; then
2187 You need to find a working C compiler.
2188 Either (purchase and) install the C compiler supplied by your OS vendor,
2189 or for a free C compiler try http://gcc.gnu.org/
2190 I cannot continue any further, aborting.
2200 : determine whether symbolic links are supported
2203 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2204 echo "Symbolic links are supported." >&4
2207 echo "Symbolic links are NOT supported." >&4
2212 : determine whether symbolic links are supported
2216 echo "Checking how to test for symbolic links..." >&4
2218 if $test "X$issymlink" = X; then
2219 sh -c "PATH= test -h sym" >/dev/null 2>&1
2220 if test $? = 0; then
2224 if $test "X$issymlink" = X; then
2225 if $test -h >/dev/null 2>&1; then
2226 issymlink="$test -h"
2227 echo "Your builtin 'test -h' may be broken, I'm using external '$test -h'." >&4
2230 if $test "X$issymlink" = X; then
2231 if $test -L sym 2>/dev/null; then
2232 issymlink="$test -L"
2235 if $test "X$issymlink" != X; then
2236 echo "You can test for symbolic links with '$issymlink'." >&4
2238 echo "I do not know how you can test for symbolic links." >&4
2242 *) echo "No symbolic links, so not testing for their testing..." >&4
2248 case "$mksymlinks" in
2251 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2254 *) case "$lns:$issymlink" in
2255 *"ln -s:"*"test -"?)
2256 echo "Creating the symbolic links..." >&4
2257 echo "(First creating the subdirectories...)" >&4
2259 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2261 test -z "$directory" && break
2265 if test ! -d t/base; then
2266 echo "Failed to create the subdirectories. Aborting." >&4
2269 echo "(Then creating the symlinks...)" >&4
2270 awk '{print $1}' $src/MANIFEST | while true; do
2272 test -z "$filename" && break
2273 if test -f $filename; then
2274 if $issymlink $filename; then
2278 if test -f $filename; then
2279 echo "$filename already exists, not symlinking."
2281 ln -s $src/$filename $filename
2285 if test ! -f t/base/commonsense.t; then
2286 echo "Failed to create the symlinks. Aborting." >&4
2291 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2299 : see whether [:lower:] and [:upper:] are supported character classes
2301 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2303 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2307 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
2308 # (0xc9 and 0xd1), therefore that is a nice testing point.
2309 if test "X$up" = X -o "X$low" = X; then
2310 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
2316 if test "X$up" = X -o "X$low" = X; then
2317 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
2323 if test "X$up" = X -o "X$low" = X; then
2324 case "`echo IJ | od -x 2>/dev/null`" in
2326 echo "Hey, this might be EBCDIC." >&4
2327 if test "X$up" = X -o "X$low" = X; then
2328 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2329 ij) up='[A-IJ-RS-Z]'
2334 if test "X$up" = X -o "X$low" = X; then
2335 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2345 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
2347 echo "Using $up and $low to convert case." >&4
2350 echo "I don't know how to translate letters from upper to lower case." >&4
2351 echo "Your tr is not acting any way I know of." >&4
2355 : set up the translation script tr, must be called with ./tr of course
2359 '[A-Z][a-z]') exec $tr '$up' '$low';;
2360 '[a-z][A-Z]') exec $tr '$low' '$up';;
2367 : Try to determine whether config.sh was made on this system
2368 case "$config_sh" in
2370 myuname=`$uname -a 2>/dev/null`
2371 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2372 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2373 # because the A-Z/a-z are not consecutive.
2374 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2375 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2376 newmyuname="$myuname"
2378 case "$knowitall" in
2380 if test -f ../config.sh; then
2381 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2382 eval "`grep myuname= ../config.sh`"
2384 if test "X$myuname" = "X$newmyuname"; then
2392 : Get old answers from old config file if Configure was run on the
2393 : same system, otherwise use the hints.
2396 if test -f config.sh; then
2398 rp="I see a config.sh file. Shall I use it to set the defaults?"
2401 n*|N*) echo "OK, I'll ignore it."
2402 mv config.sh config.sh.old
2403 myuname="$newmyuname"
2405 *) echo "Fetching default answers from your old config.sh file..." >&4
2413 : Older versions did not always set $sh. Catch re-use of such
2423 if test ! -f config.sh; then
2426 First time through, eh? I have some defaults handy for some systems
2427 that need some extra help getting the Configure answers right:
2430 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2432 : Half the following guesses are probably wrong... If you have better
2433 : tests or hints, please send them to perlbug@perl.org
2434 : The metaconfig authors would also appreciate a copy...
2435 $test -f /irix && osname=irix
2436 $test -f /xenix && osname=sco_xenix
2437 $test -f /dynix && osname=dynix
2438 $test -f /dnix && osname=dnix
2439 $test -f /lynx.os && osname=lynxos
2440 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2441 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
2442 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2443 $test -f /bin/mips && /bin/mips && osname=mips
2444 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
2445 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
2446 $test -d /usr/apollo/bin && osname=apollo
2447 $test -f /etc/saf/_sactab && osname=svr4
2448 $test -d /usr/include/minix && osname=minix
2449 if $test -d /MachTen -o -d /MachTen_Folder; then
2451 if $test -x /sbin/version; then
2452 osvers=`/sbin/version | $awk '{print $2}' |
2453 $sed -e 's/[A-Za-z]$//'`
2454 elif $test -x /usr/etc/version; then
2455 osvers=`/usr/etc/version | $awk '{print $2}' |
2456 $sed -e 's/[A-Za-z]$//'`
2462 $test -f /sys/posix.dll &&
2463 $test -f /usr/bin/what &&
2464 set X `/usr/bin/what /sys/posix.dll` &&
2465 $test "$3" = UWIN &&
2469 if $test -f $uname; then
2477 umips) osname=umips ;;
2480 [23]100) osname=mips ;;
2481 next*) osname=next ;;
2483 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
2484 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
2487 elif $test -f /etc/kconfig; then
2489 if test "$lns" = "$ln -s"; then
2491 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
2493 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
2500 if test -n "$DJGPP"; then
2509 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
2511 'not found') osvers="$4"."$3" ;;
2512 '<3240'|'<>3240') osvers=3.2.0 ;;
2513 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
2514 '=3250'|'>3250') osvers=3.2.5 ;;
2518 bsd386) osname=bsd386
2521 cygwin*) osname=cygwin
2524 *dc.osx) osname=dcosx
2530 domainos) osname=apollo
2536 dynixptx*) osname=dynixptx
2537 osvers=`echo "$4"|sed 's/^v//'`
2539 freebsd) osname=freebsd
2541 genix) osname=genix ;;
2543 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
2559 netbsd*) osname=netbsd
2562 news-os) osvers="$3"
2564 4*) osname=newsos4 ;;
2568 next*) osname=next ;;
2569 nonstop-ux) osname=nonstopux ;;
2570 POSIX-BC | posix-bc ) osname=posix-bc
2573 powerux | power_ux | powermax_os | powermaxos | \
2574 powerunix | power_unix) osname=powerux
2580 solaris) osname=solaris
2582 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2589 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2593 titanos) osname=titanos
2602 ultrix) osname=ultrix
2605 osf1|mls+) case "$5" in
2608 osvers=`sizer -v | awk '{print $3}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
2611 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
2614 hp*) osname=hp_osf1 ;;
2615 mips) osname=mips_osf1 ;;
2618 unixware) osname=svr5
2624 $2) case "$osname" in
2628 : svr4.x or possibly later
2638 if test -f /stand/boot ; then
2639 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
2640 if test -n "$INITPROG" -a -f "$INITPROG"; then
2641 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
2642 if test -n "$isesix"; then
2650 *) if test -f /etc/systemid; then
2652 set `echo $3 | $sed 's/\./ /g'` $4
2653 if $test -f $src/hints/sco_$1_$2_$3.sh; then
2655 elif $test -f $src/hints/sco_$1_$2.sh; then
2657 elif $test -f $src/hints/sco_$1.sh; then
2662 '') : Still unknown. Probably a generic Sys V.
2671 *) case "$osname" in
2672 '') : Still unknown. Probably a generic BSD.
2680 if test -f /vmunix -a -f $src/hints/news_os.sh; then
2681 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
2682 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
2685 $rm -f UU/kernel.what
2686 elif test -d c:/.; then
2693 : Now look for a hint file osname_osvers, unless one has been
2694 : specified already.
2697 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
2698 : Also try without trailing minor version numbers.
2699 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
2700 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
2701 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
2702 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
2705 *) case "$osvers" in
2708 *) if $test -f $src/hints/$file.sh ; then
2710 elif $test -f $src/hints/$xfile.sh ; then
2712 elif $test -f $src/hints/$xxfile.sh ; then
2714 elif $test -f $src/hints/$xxxfile.sh ; then
2716 elif $test -f $src/hints/$xxxxfile.sh ; then
2718 elif $test -f "$src/hints/${osname}.sh" ; then
2727 if $test -f Policy.sh ; then
2730 none) dflt="Policy" ;;
2731 *) dflt="Policy $dflt" ;;
2736 dflt=`echo $hintfile | $sed 's/\.sh$//'`
2740 if $test -f Policy.sh ; then
2743 There's also a Policy hint file available, which should make the
2744 site-specific (policy) questions easier to answer.
2751 You may give one or more space-separated answers, or "none" if appropriate.
2752 A well-behaved OS will have no hints, so answering "none" or just "Policy"
2753 is a good thing. DO NOT give a wrong version or a wrong OS.
2757 rp="Which of these apply, if any?"
2760 for file in $tans; do
2761 if $test X$file = XPolicy -a -f Policy.sh; then
2763 $cat Policy.sh >> UU/config.sh
2764 elif $test -f $src/hints/$file.sh; then
2765 . $src/hints/$file.sh
2766 $cat $src/hints/$file.sh >> UU/config.sh
2767 elif $test X$tans = X -o X$tans = Xnone ; then
2770 : Give one chance to correct a possible typo.
2771 echo "$file.sh does not exist"
2773 rp="hint to use instead?"
2775 for file in $ans; do
2776 if $test -f "$src/hints/$file.sh"; then
2777 . $src/hints/$file.sh
2778 $cat $src/hints/$file.sh >> UU/config.sh
2779 elif $test X$ans = X -o X$ans = Xnone ; then
2782 echo "$file.sh does not exist -- ignored."
2789 : Remember our hint file for later.
2790 if $test -f "$src/hints/$file.sh" ; then
2800 echo "Fetching default answers from $config_sh..." >&4
2804 cp $config_sh config.sh 2>/dev/null
2814 test "$override" && . ./optdef.sh
2816 : Restore computed paths
2817 for file in $loclist $trylist; do
2818 eval $file="\$_$file"
2823 Configure uses the operating system name and version to set some defaults.
2824 The default value is probably right if the name rings a bell. Otherwise,
2825 since spelling matters for me, either accept the default or answer "none"
2832 ''|' '|none) dflt=none ;;
2833 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
2836 *) dflt="$osname" ;;
2838 rp="Operating system name?"
2842 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
2848 ''|' '|none) dflt=none ;;
2849 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
2850 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
2852 ''|' ') dflt=none ;;
2857 *) dflt="$osvers" ;;
2859 rp="Operating system version?"
2869 : who configured the system
2870 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
2871 cf_by=`(logname) 2>/dev/null`
2874 cf_by=`(whoami) 2>/dev/null`
2876 "") cf_by=unknown ;;
2880 : set up the script used to warn in case of inconsistency
2887 echo "*** WHOA THERE!!! ***" >&4
2888 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2889 rp=" Keep the $hint value?"
2892 y) td=$was; tu=$was;;
2896 : function used to set $1 to $val
2897 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2899 $define$undef) . ./whoa; eval "$var=\$td";;
2900 $undef$define) . ./whoa; eval "$var=\$tu";;
2901 *) eval "$var=$val";;
2904 case "$usethreads" in
2905 $define|true|[yY]*) dflt='y';;
2910 Perl can be built to take advantage of threads on some systems.
2911 To do so, Configure can be run with -Dusethreads.
2913 Note that threading is a highly experimental feature, and
2914 some known race conditions still remain. If you choose to try
2915 it, be very sure to not actually deploy it for production
2916 purposes. README.threads has more details, and is required
2917 reading if you enable threads.
2919 If this doesn't make any sense to you, just accept the default '$dflt'.
2921 rp='Build a threading Perl?'
2924 y|Y) val="$define" ;;
2930 case "$usethreads" in
2934 As of 5.5.640, Perl has two different internal threading implementations,
2935 the 5.005 version (5005threads) and an interpreter-based version
2936 (ithreads) that has one interpreter per thread. Both are very
2937 experimental. This arrangement exists to help developers work out
2938 which one is better.
2940 If you're a casual user, you probably don't want interpreter-threads
2941 at this time. There doesn't yet exist a way to create threads from
2942 within Perl in this model, i.e., "use Thread;" will NOT work.
2944 : Default to ithreads unless overridden on command line or with
2947 case "$use5005threads" in
2948 $define|true|[yY]*) dflt='n';;
2950 case "$useithreads" in
2951 $undef|false|[nN]*) dflt='n';;
2953 rp='Use interpreter-based ithreads?'
2956 y|Y) val="$define" ;;
2961 : Now set use5005threads to the opposite value.
2962 case "$useithreads" in
2963 $define) val="$undef" ;;
2970 useithreads="$undef"
2971 use5005threads="$undef"
2975 case "$useithreads$use5005threads" in
2979 You cannot have both the ithreads and the 5.005 threads enabled
2980 at the same time. Disabling the 5.005 threads since they are
2981 much less stable than the ithreads.
2984 use5005threads="$undef"
2988 case "$d_oldpthreads" in
2989 '') : Configure tests would be welcome here. For now, assume undef.
2991 *) val="$d_oldpthreads" ;;
2997 case "$usethreads" in
2998 "$define"|true|[yY]*)
2999 : Look for a hint-file generated 'call-back-unit'. If the
3000 : user has specified that a threading perl is to be built,
3001 : we may need to set or change some other defaults.
3002 if $test -f usethreads.cbu; then
3003 echo "Your platform has some specific hints for threaded builds, using them..."
3007 (Your platform doesn't have any specific hints for threaded builds.
3008 Assuming POSIX threads, then.)
3016 Perl can be built so that multiple Perl interpreters can coexist
3017 within the same Perl executable.
3020 case "$useithreads" in
3023 This multiple interpreter support is required for interpreter-based threads.
3027 *) case "$usemultiplicity" in
3028 $define|true|[yY]*) dflt='y';;
3032 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
3033 rp='Build Perl for multiplicity?'
3036 y|Y) val="$define" ;;
3044 : make some quick guesses about what we are up against
3046 $echo $n "Hmm... $c"
3056 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
3057 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
3059 echo "Looks kind of like an OSF/1 system, but we'll see..."
3061 elif test `echo abc | $tr a-z A-Z` = Abc ; then
3062 xxx=`./loc addbib blurfl $pth`
3063 if $test -f $xxx; then
3064 echo "Looks kind of like a USG system with BSD features, but we'll see..."
3068 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
3069 echo "Looks kind of like an extended USG system, but we'll see..."
3071 echo "Looks kind of like a USG system, but we'll see..."
3075 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
3076 echo "Looks kind of like a BSD system, but we'll see..."
3080 echo "Looks kind of like a Version 7 system, but we'll see..."
3083 case "$eunicefix" in
3086 There is, however, a strange, musty smell in the air that reminds me of
3087 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
3091 : it so happens the Eunice I know will not run shell scripts in Unix format
3095 echo "Congratulations. You aren't running Eunice."
3099 : Detect OS2. The p_ variable is set above in the Head.U unit.
3100 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
3101 : semicolon as a patch separator
3106 I have the feeling something is not exactly right, however...don't tell me...
3107 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
3108 (Or you may be running DOS with DJGPP.)
3113 if test -f /xenix; then
3114 echo "Actually, this looks more like a XENIX system..."
3119 echo "It's not Xenix..."
3124 if test -f /venix; then
3125 echo "Actually, this looks more like a VENIX system..."
3132 echo "Nor is it Venix..."
3135 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3136 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3143 rp="Use which C compiler?"
3146 : Look for a hint-file generated 'call-back-unit'. Now that the
3147 : user has specified the compiler, we may need to set or change some
3149 if $test -f cc.cbu; then
3155 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3156 $cat >gccvers.c <<EOM
3161 printf("%s\n", __VERSION__);
3163 printf("%s\n", "1");
3169 if $cc -o gccvers $ccflags $ldflags gccvers.c; then
3170 gccversion=`./gccvers`
3171 case "$gccversion" in
3172 '') echo "You are not using GNU cc." ;;
3173 *) echo "You are using GNU cc $gccversion."
3179 echo "*** WHOA THERE!!! ***" >&4
3180 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3181 case "$knowitall" in
3183 echo " You'd better start hunting for one and let me know about it." >&4
3189 case "$gccversion" in
3190 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3192 case "$gccversion" in
3193 '') gccosandvers='' ;;
3194 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
3195 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
3197 case "$gccosandvers" in
3198 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
3199 $osname$osvers) ;; # looking good
3200 $osname*) cat <<EOM >&4
3202 *** WHOA THERE!!! ***
3204 Your gcc has not been compiled for the exact release of
3205 your operating system ($gccosandvers versus $osname$osvers).
3207 In general it is a good idea to keep gcc synchronized with
3208 the operating system because otherwise serious problems
3209 may ensue when trying to compile software, like Perl.
3211 I'm trying to be optimistic here, though, and will continue.
3212 If later during the configuration and build icky compilation
3213 problems appear (headerfile conflicts being the most common
3214 manifestation), I suggest reinstalling the gcc to match
3215 your operating system release.
3219 *) gccosandvers='' ;; # failed to parse, better be silent
3227 case "$gccversion" in
3229 *) case "$ccflags" in
3231 *) ccflags="$ccflags -Wall -ansi" ;;
3236 : see how we invoke the C preprocessor
3238 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3239 cat <<'EOT' >testcpp.c
3245 if test ! -f cppstdin; then
3246 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
3247 # AIX cc -E doesn't show the absolute headerfile
3248 # locations but we'll cheat by using the -M flag.
3249 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
3251 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3254 echo "Keeping your $hint cppstdin wrapper."
3257 wrapper=`pwd`/cppstdin
3261 if $test "X$cppstdin" != "X" && \
3262 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3263 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3265 echo "You used to use $cppstdin $cppminus so we'll use that again."
3267 '') echo "But let's see if we can live without a wrapper..." ;;
3269 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3270 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3272 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3275 echo "(However, $cpprun $cpplast does not work, let's see...)"
3283 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3290 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3291 $cc -E <testcpp.c >testcpp.out 2>&1; \
3292 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3293 echo "Yup, it does."
3296 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
3297 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3298 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3299 echo "Yup, it does."
3302 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
3303 $cc -P <testcpp.c >testcpp.out 2>&1; \
3304 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3305 echo "Yipee, that works!"
3308 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
3309 $cc -P - <testcpp.c >testcpp.out 2>&1; \
3310 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3311 echo "At long last!"
3314 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
3315 $cpp <testcpp.c >testcpp.out 2>&1; \
3316 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3320 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
3321 $cpp - <testcpp.c >testcpp.out 2>&1; \
3322 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3323 echo "Hooray, it works! I was beginning to wonder."
3326 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
3327 $wrapper <testcpp.c >testcpp.out 2>&1; \
3328 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3334 rp="No dice. I can't find a C preprocessor. Name one:"
3338 $x_cpp <testcpp.c >testcpp.out 2>&1
3339 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3340 echo "OK, that will do." >&4
3342 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
3357 echo "Perhaps can we force $cc -E using a wrapper..."
3358 if $wrapper <testcpp.c >testcpp.out 2>&1; \
3359 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3365 echo "Nope, we'll have to live without it..."
3379 "$wrapper"|'cppstdin') ;;
3380 *) $rm -f $wrapper;;
3382 $rm -f testcpp.c testcpp.out
3384 : decide how portable to be. Allow command line overrides.
3385 case "$d_portable" in
3387 *) d_portable="$define" ;;
3390 : set up shell script to do ~ expansion
3396 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3399 if $test -f /bin/csh; then
3400 /bin/csh -f -c "glob \$1"
3405 name=\`$expr x\$1 : '..\([^/]*\)'\`
3406 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3407 if $test ! -d "\$dir"; then
3409 echo "\$me: can't locate home directory for: \$name" >&2
3414 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3430 : now set up to get a file name
3434 cat <<'EOSC' >>getfile
3450 expr $fn : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3451 fn=`echo $fn | sed 's/(.*)//'`
3457 loc_file=`expr $fn : '.*:\(.*\)'`
3458 fn=`expr $fn : '\(.*\):.*'`
3466 */*) fullpath=true;;
3475 *e*) exp_file=true;;
3478 *p*) nopath_ok=true;;
3483 *d*) type='Directory';;
3484 *l*) type='Locate';;
3489 Locate) what='File';;
3494 case "$d_portable" in
3502 while test "$type"; do
3507 true) rp="$rp (~name ok)";;
3510 if test -f UU/getfile.ok && \
3511 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3530 value=`UU/filexp $ans`
3533 if test "$ans" != "$value"; then
3534 echo "(That expands to $value on this system.)"
3548 /*) value="$ansexp" ;;
3549 [a-zA-Z]:/*) value="$ansexp" ;;
3554 echo "I shall only accept a full path name, as in /bin/ls." >&4
3555 echo "Use a ! shell escape if you wish to check pathnames." >&4
3558 echo "Please give a full path name, starting with slash." >&4
3561 echo "Note that using ~name is ok provided it expands well." >&4
3574 for fp in $gfpth; do
3575 if test "X$fp" = X.; then
3580 if test -f "$pf"; then
3582 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3584 echo "($value is not a plain file, but that's ok.)"
3587 if test X"$type" = X; then
3594 for fp in $gfpth; do
3595 if test "X$fp" = X.; then
3600 direxp="$fp/$ansexp"
3602 if test -d "$direxp"; then
3610 if test -d "$ansexp"; then
3611 echo "(Looking for $loc_file in directory $value.)"
3612 value="$value/$loc_file"
3613 ansexp="$ansexp/$loc_file"
3615 if test -f "$ansexp"; then
3618 case "$nopath_ok" in
3619 true) case "$value" in
3621 *) echo "Assuming $value will be in people's path."
3637 if test "$fastread" = yes; then
3642 rp="$what $value doesn't exist. Use that name anyway?"
3661 test "X$gfpthkeep" != Xy && gfpth=""
3664 : What should the include directory be ?
3666 $echo $n "Hmm... $c"
3670 if $test -f /bin/mips && /bin/mips; then
3671 echo "Looks like a MIPS system..."
3672 $cat >usr.c <<'EOCP'
3673 #ifdef SYSTYPE_BSD43
3677 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3678 dflt='/bsd43/usr/include'
3682 mips_type='System V'
3684 $rm -f usr.c usr.out
3685 echo "and you're compiling with the $mips_type compiler and libraries."
3689 echo "Doesn't look like a MIPS system."
3699 case "$xxx_prompt" in
3702 rp='Where are the include files you want to use?'
3710 : Set private lib path
3713 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
3718 '') dlist="$loclibpth $plibpth $glibpth";;
3719 *) dlist="$libpth";;
3722 : Now check and see which directories actually exist, avoiding duplicates
3726 if $test -d $xxx; then
3729 *) libpth="$libpth $xxx";;
3735 Some systems have incompatible or broken versions of libraries. Among
3736 the directories listed in the question below, please remove any you
3737 know not to be holding relevant libraries, and add any that are needed.
3738 Say "none" for none.
3749 rp="Directories to use for library searches?"
3756 : compute shared library extension
3759 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
3769 On some systems, shared libraries may be available. Answer 'none' if
3770 you want to suppress searching of shared libraries for the remainder
3771 of this configuration.
3774 rp='What is the file extension used for shared libraries?'
3778 : Define several unixisms.
3779 : Hints files or command line option can be used to override them.
3780 : The convoluted testing is in case hints files set either the old
3783 '') case "$exe_ext" in
3785 *) _exe="$exe_ext" ;;
3790 '') case "$lib_ext" in
3797 '') case "$obj_ext" in
3804 '') case "$path_sep" in
3815 : Which makefile gets called first. This is used by make depend.
3816 case "$firstmakefile" in
3817 '') firstmakefile='makefile';;
3821 $define|true|[yY]*) dflt='y';;
3826 Perl can be built to use the SOCKS proxy protocol library. To do so,
3827 Configure must be run with -Dusesocks. If you use SOCKS you also need
3828 to use the PerlIO abstraction layer, this will be implicitly selected.
3830 If this doesn't make any sense to you, just accept the default '$dflt'.
3832 rp='Build Perl for SOCKS?'
3835 y|Y) val="$define" ;;
3842 $define|true|[yY]*) useperlio="$define";;
3845 : Looking for optional libraries
3847 echo "Checking for optional libraries..." >&4
3852 case "$libswanted" in
3853 '') libswanted='c_s';;
3856 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
3862 for thisdir in $libpth $xlibpth; do
3863 test -d $thisdir && libspath="$libspath $thisdir"
3865 for thislib in $libswanted; do
3866 for thisdir in $libspath; do
3868 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
3869 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|tail -1`
3870 $test -f "$xxx" && eval $libscheck
3871 $test -f "$xxx" && libstyle=shared
3873 if test ! -f "$xxx"; then
3874 xxx=$thisdir/lib$thislib.$so
3875 $test -f "$xxx" && eval $libscheck
3876 $test -f "$xxx" && libstyle=shared
3878 if test ! -f "$xxx"; then
3879 xxx=$thisdir/lib$thislib$_a
3880 $test -f "$xxx" && eval $libscheck
3881 $test -f "$xxx" && libstyle=static
3883 if test ! -f "$xxx"; then
3884 xxx=$thisdir/$thislib$_a
3885 $test -f "$xxx" && eval $libscheck
3886 $test -f "$xxx" && libstyle=static
3888 if test ! -f "$xxx"; then
3889 xxx=$thisdir/lib${thislib}_s$_a
3890 $test -f "$xxx" && eval $libscheck
3891 $test -f "$xxx" && libstyle=static
3892 $test -f "$xxx" && thislib=${thislib}_s
3894 if test ! -f "$xxx"; then
3895 xxx=$thisdir/Slib$thislib$_a
3896 $test -f "$xxx" && eval $libscheck
3897 $test -f "$xxx" && libstyle=static
3899 if $test -f "$xxx"; then
3901 shared) echo "Found -l$thislib (shared)." ;;
3902 static) echo "Found -l$thislib." ;;
3903 *) echo "Found -l$thislib ($libstyle)." ;;
3907 *) dflt="$dflt -l$thislib"
3908 libsfound="$libsfound $xxx"
3910 libsfiles="$libsfiles $yyy"
3911 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
3912 case " $libsdirs " in
3914 *) libsdirs="$libsdirs $yyy" ;;
3921 if $test ! -f "$xxx"; then
3922 echo "No -l$thislib."
3933 ' '|'') dflt='none';;
3938 In order to compile $package on your machine, a number of libraries
3939 are usually needed. Include any other special libraries here as well.
3940 Say "none" for none. The default list is almost always right.
3944 rp="What libraries to use?"
3951 : determine optimization, if desired, or use for debug flag also
3953 ' '|$undef) dflt='none';;
3955 *) dflt="$optimize";;
3959 By default, $package compiles with the -O flag to use the optimizer.
3960 Alternately, you might want to use the symbolic debugger, which uses
3961 the -g flag (on traditional Unix systems). Either flag can be
3962 specified here. To use neither flag, specify the word "none".
3965 rp="What optimizer/debugger flag should be used?"
3969 'none') optimize=" ";;
3973 : We will not override a previous value, but we might want to
3974 : augment a hint file
3976 default|recommended)
3977 case "$gccversion" in
3978 1*) dflt='-fpcc-struct-return' ;;
3981 *-g*) dflt="$dflt -DDEBUGGING";;
3983 case "$gccversion" in
3984 2*) if test -d /etc/conf/kconfig.d &&
3985 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
3991 case "$gccversion" in
3995 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
3996 echo 'int main(void) { return 0; }' > gcctest.c
3997 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
3998 echo "Yes, it does." 2>&1
4001 echo "Leaving current flags $ccflags alone." 2>&1
4003 *) dflt="$dflt -fno-strict-aliasing" ;;
4006 echo "Nope, it doesn't, but that's ok." 2>&1
4013 case "$mips_type" in
4014 *BSD*|'') inclwanted="$locincpth $usrinc";;
4015 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4017 for thisincl in $inclwanted; do
4018 if $test -d $thisincl; then
4019 if $test x$thisincl != x$usrinc; then
4021 *" -I$thisincl "*);;
4022 *) dflt="$dflt -I$thisincl ";;
4028 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4030 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4038 *) dflt="$dflt -D$2";;
4042 set signal.h LANGUAGE_C; eval $inctest
4046 ccflags="$ccflags -DSOCKS"
4051 default|recommended) dflt="$ccflags $dflt" ;;
4052 *) dflt="$ccflags";;
4061 Your C compiler may want other flags. For this question you should include
4062 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4063 but you should NOT include libraries or ld flags like -lwhatever. If you
4064 want $package to honor its debug switch, you should include -DDEBUGGING here.
4065 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4067 To use no flags, specify the word "none".
4073 rp="Any additional cc flags?"
4080 : the following weeds options from ccflags that are of no interest to cpp
4082 '') cppflags="$ccflags" ;;
4083 *) cppflags="$cppflags $ccflags" ;;
4085 case "$gccversion" in
4086 1*) cppflags="$cppflags -D__GNUC__"
4088 case "$mips_type" in
4090 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4096 echo "Let me guess what the preprocessor flags are..." >&4
4110 *) ftry="$previous $flag";;
4112 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4113 >cpp1.out 2>/dev/null && \
4114 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4115 >cpp2.out 2>/dev/null && \
4116 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4117 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4119 cppflags="$cppflags $ftry"
4129 *-*) echo "They appear to be: $cppflags";;
4131 $rm -f cpp.c cpp?.out
4135 : flags used in final linking phase
4137 '') if ./venix; then
4143 *-posix*) dflt="$dflt -posix" ;;
4146 *) dflt="$ldflags";;
4149 : Try to guess additional flags to pick up local libraries.
4150 for thislibdir in $libpth; do
4151 case " $loclibpth " in
4154 *"-L$thislibdir "*) ;;
4155 *) dflt="$dflt -L$thislibdir" ;;
4167 Your C linker may need flags. For this question you should
4168 include -L/whatever and any other flags used by the C linker, but you
4169 should NOT include libraries like -lwhatever.
4171 Make sure you include the appropriate -L/path flags if your C linker
4172 does not normally search all of the directories you specified above,
4175 To use no flags, specify the word "none".
4179 rp="Any additional ld flags (NOT including libraries)?"
4185 rmlist="$rmlist pdp11"
4189 echo "Checking your choice of C compiler and flags for coherency..." >&4
4190 $cat > try.c <<'EOF'
4192 int main() { printf("Ok\n"); exit(0); }
4194 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
4196 $cat >try.msg <<'EOM'
4197 I've tried to compile and run the following simple program:
4200 $cat try.c >> try.msg
4202 $cat >> try.msg <<EOM
4209 and I got the following output:
4213 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
4214 if $sh -c './try' >>try.msg 2>&1; then
4218 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4221 cat >> try.msg <<'EOQS'
4222 If $libs contains -lsfio, and sfio is mis-configured, then it
4223 sometimes (apparently) runs and exits with a 0 status, but with no
4224 output! It may have to do with sfio's use of _exit vs. exit.
4227 rp="You have a big problem. Shall I abort Configure"
4234 echo "The program compiled OK, but exited with status $?." >>try.msg
4235 rp="You have a problem. Shall I abort Configure"
4239 echo "I can't compile the test program." >>try.msg
4240 rp="You have a BIG problem. Shall I abort Configure"
4246 case "$knowitall" in
4248 echo "(The supplied flags or libraries might be incorrect.)"
4256 *) echo "Ok. Stopping Configure." >&4
4261 n) echo "OK, that should do.";;
4263 $rm -f try try.* core
4265 : define an is-a-typedef? function
4266 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
4268 "") inclist="sys/types.h";;
4270 eval "varval=\$$var";
4274 for inc in $inclist; do
4275 echo "#include <$inc>" >>temp.c;
4277 echo "#ifdef $type" >> temp.c;
4278 echo "printf(\"We have $type\");" >> temp.c;
4279 echo "#endif" >> temp.c;
4280 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
4281 if $contains $type temp.E >/dev/null 2>&1; then
4287 *) eval "$var=\$varval";;
4290 : define an is-a-typedef? function that prompts if the type is not available.
4291 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
4293 "") inclist="sys/types.h";;
4295 eval "varval=\$$var";
4299 for inc in $inclist; do
4300 echo "#include <$inc>" >>temp.c;
4302 echo "#ifdef $type" >> temp.c;
4303 echo "printf(\"We have $type\");" >> temp.c;
4304 echo "#endif" >> temp.c;
4305 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
4307 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
4308 if $contains $type temp.E >/dev/null 2>&1; then
4309 echo "$type found." >&4;
4312 echo "$type NOT found." >&4;
4318 *) eval "$var=\$varval";;
4321 : define a shorthand compile call
4325 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
4326 : define a shorthand compile call for compilations that should be ok.
4330 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
4332 : check for lengths of integral types
4336 echo "Checking to see how big your integers are..." >&4
4337 $cat >intsize.c <<'EOCP'
4341 printf("intsize=%d;\n", (int)sizeof(int));
4342 printf("longsize=%d;\n", (int)sizeof(long));
4343 printf("shortsize=%d;\n", (int)sizeof(short));
4348 if eval $compile_ok && ./intsize > /dev/null; then
4350 echo "Your integers are $intsize bytes long."
4351 echo "Your long integers are $longsize bytes long."
4352 echo "Your short integers are $shortsize bytes long."
4356 Help! I can't compile and run the intsize test program: please enlighten me!
4357 (This is probably a misconfiguration in your system or libraries, and
4358 you really ought to fix it. Still, I'll try anyway.)
4362 rp="What is the size of an integer (in bytes)?"
4366 rp="What is the size of a long integer (in bytes)?"
4370 rp="What is the size of a short integer (in bytes)?"
4376 $rm -f intsize intsize.*
4378 : see what type lseek is declared as in the kernel
4379 rp="What is the type used for lseek's offset on this system?"
4380 set off_t lseektype long stdio.h sys/types.h
4384 echo "Checking to see how big your file offsets are..." >&4
4386 #include <sys/types.h>
4390 printf("%d\n", (int)sizeof($lseektype));
4395 if eval $compile_ok; then
4397 echo "Your file offsets are $lseeksize bytes long."
4401 echo "(I can't seem to compile the test program. Guessing...)"
4402 rp="What is the size of your file offsets (in bytes)?"
4408 : see what type file positions are declared as in the library
4409 rp="What is the type for file position used by fsetpos()?"
4410 set fpos_t fpostype long stdio.h sys/types.h
4415 *_t) zzz="$fpostype" ;;
4418 echo "Checking the size of $zzz..." >&4
4420 #include <sys/types.h>
4423 printf("%d\n", (int)sizeof($fpostype));
4428 if eval $compile_ok; then
4432 echo "(I can't execute the test program--guessing $fpossize.)" >&4
4435 echo "Your $zzz is $fpossize bytes long."
4441 echo "(I can't compile the test program. Guessing...)" >&4
4442 rp="What is the size of your file positions (in bytes)?"
4449 # Backward compatibility (uselfs is deprecated).
4451 "$define"|true|[yY]*)
4454 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
4456 uselargefiles="$define"
4460 case "$lseeksize:$fpossize" in
4463 You can have files larger than 2 gigabytes.
4466 *) case "$uselargefiles" in
4467 "$undef"|false|[nN]*) dflt='n' ;;
4472 Perl can be built to understand large files (files larger than 2 gigabytes)
4473 on some systems. To do so, Configure can be run with -Duselargefiles.
4475 If this doesn't make any sense to you, just accept the default '$dflt'.
4477 rp='Try to understand large files, if available?'
4480 y|Y) val="$define" ;;
4487 case "$uselargefiles" in
4489 : Look for a hint-file generated 'call-back-unit'. If the
4490 : user has specified that a large files perl is to be built,
4491 : we may need to set or change some other defaults.
4492 if $test -f uselargefiles.cbu; then
4493 echo "Your platform has some specific hints for large file builds, using them..."
4494 . ./uselargefiles.cbu
4496 echo "Rechecking to see how big your file offsets are..." >&4
4498 #include <sys/types.h>
4502 printf("%d\n", (int)sizeof($lseektype));
4507 if eval $compile_ok; then
4509 $echo "Your file offsets are now $lseeksize bytes long."
4513 echo "(I can't seem to compile the test program. Guessing...)"
4514 rp="What is the size of your file offsets (in bytes)?"
4519 *_t) zzz="$fpostype" ;;
4522 $echo $n "Rechecking the size of $zzz...$c" >&4
4524 #include <sys/types.h>
4527 printf("%d\n", (int)sizeof($fpostype));
4532 if eval $compile_ok; then
4537 echo "(I can't execute the test program--guessing $fpossize.)" >&4
4540 echo " $fpossize bytes." >&4
4546 echo "(I can't compile the test program. Guessing...)" >&4
4547 rp="What is the size of your file positions (in bytes)?"
4557 case "$usemorebits" in
4558 "$define"|true|[yY]*)
4559 use64bitint="$define"
4560 uselongdouble="$define"
4561 usemorebits="$define"
4563 *) usemorebits="$undef"
4567 : check for void type
4569 echo "Checking to see how well your C compiler groks the void type..." >&4
4570 case "$voidflags" in
4572 $cat >try.c <<'EOCP'
4578 extern void moo(); /* function returning void */
4579 void (*goo)(); /* ptr to func returning void */
4581 void *hue; /* generic ptr */
4594 int main() { sub(); }
4596 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
4597 voidflags=$defvoidused
4598 echo "Good. It appears to support void to the level $package wants.">&4
4599 if $contains warning .out >/dev/null 2>&1; then
4600 echo "However, you might get some warnings that look like this:"
4604 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
4605 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
4606 echo "It supports 1..."
4607 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
4608 echo "It also supports 2..."
4609 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
4611 echo "And it supports 4 but not 8 definitely."
4613 echo "It doesn't support 4..."
4614 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
4616 echo "But it supports 8."
4619 echo "Neither does it support 8."
4623 echo "It does not support 2..."
4624 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
4626 echo "But it supports 4 and 8."
4628 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
4630 echo "And it supports 4 but has not heard about 8."
4632 echo "However it supports 8 but not 4."
4637 echo "There is no support at all for void."
4642 case "$voidflags" in
4645 Support flag bits are:
4646 1: basic void declarations.
4647 2: arrays of pointers to functions returning void.
4648 4: operations between pointers to and addresses of void functions.
4649 8: generic void pointers.
4652 rp="Your void support flags add up to what?"
4659 : check for length of pointer
4663 echo "Checking to see how big your pointers are..." >&4
4664 if test "$voidflags" -gt 7; then
4665 echo '#define VOID_PTR char *' > try.c
4667 echo '#define VOID_PTR void *' > try.c
4669 $cat >>try.c <<'EOCP'
4673 printf("%d\n", (int)sizeof(VOID_PTR));
4678 if eval $compile_ok; then
4680 echo "Your pointers are $ptrsize bytes long."
4683 echo "(I can't seem to compile the test program. Guessing...)" >&4
4684 rp="What is the size of a pointer (in bytes)?"
4692 : check for long long
4694 echo "Checking to see if you have long long..." >&4
4695 echo 'int main() { long long x = 7; return 0; }' > try.c
4697 if eval $compile; then
4699 echo "You have long long."
4702 echo "You do not have long long."
4708 : check for length of long long
4709 case "${d_longlong}${longlongsize}" in
4712 echo "Checking to see how big your long longs are..." >&4
4713 $cat >try.c <<'EOCP'
4717 printf("%d\n", (int)sizeof(long long));
4722 if eval $compile_ok; then
4723 longlongsize=`./try$exe_ext`
4724 echo "Your long longs are $longlongsize bytes long."
4728 echo "(I can't seem to compile the test program. Guessing...)"
4729 rp="What is the size of a long long (in bytes)?"
4733 if $test "X$longsize" = "X$longlongsize"; then
4734 echo "(That isn't any different from an ordinary long.)"
4740 : determine filename position in cpp output
4742 echo "Computing filename position in cpp output for #include directives..." >&4
4743 echo '#include <stdio.h>' > foo.c
4746 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
4747 $grep '^[ ]*#.*stdio\.h' | \
4748 while read cline; do
4751 while $test \$# -gt 0; do
4752 if $test -r \`echo \$1 | $tr -d '"'\`; then
4757 pos=\`expr \$pos + 1\`
4769 *) pos="${fieldn}th";;
4771 echo "Your cpp writes the filename in the $pos field of the line."
4773 : locate header file
4778 for usrincdir in $usrinc
4780 if test -f \$usrincdir/\$wanted; then
4781 echo "\$usrincdir/\$wanted"
4785 awkprg='{ print \$$fieldn }'
4786 echo "#include <\$wanted>" > foo\$\$.c
4787 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
4788 $grep "^[ ]*#.*\$wanted" | \
4789 while read cline; do
4790 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
4792 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
4793 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
4798 # status = 0: grep returned 0 lines, case statement not executed
4799 # status = 1: headerfile found
4800 # status = 2: while loop executed, no headerfile found
4804 if test \$status -eq 1; then
4811 : define an alternate in-header-list? function
4812 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
4813 cont=true; xxf="echo \"<\$1> found.\" >&4";
4814 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
4815 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
4817 case $# in 4) instead=instead;; *) instead="at last";; esac;
4818 while $test "$cont"; do
4820 var=$2; eval "was=\$$2";
4821 if $test "$xxx" && $test -r "$xxx";
4823 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
4826 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
4827 set $yyy; shift; shift; yyy=$@;
4828 case $# in 0) cont="";;
4829 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
4830 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
4831 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
4832 xxnf="echo \"there is no <\$1>, ...\" >&4";;
4836 do set $yyy; var=$2; eval "was=\$$2";
4837 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
4838 set $yyy; shift; shift; yyy=$@;
4841 : see if inttypes.h is available
4842 : we want a real compile instead of Inhdr because some systems
4843 : have an inttypes.h which includes non-existent headers
4846 #include <inttypes.h>
4848 static int32_t foo32 = 0x12345678;
4852 if eval $compile; then
4853 echo "<inttypes.h> found." >&4
4856 echo "<inttypes.h> NOT found." >&4
4865 echo "Checking to see if you have int64_t..." >&4
4867 #include <sys/types.h>
4868 #$i_inttypes I_INTTYPES
4870 #include <inttypes.h>
4872 int main() { int64_t x = 7; }
4875 if eval $compile; then
4877 echo "You have int64_t."
4880 echo "You do not have int64_t."
4888 echo "Checking which 64-bit integer type we could use..." >&4
4894 val='"unsigned int"'
4899 *) case "$longsize" in
4903 val='"unsigned long"'
4908 *) case "$d_longlong:$longlongsize" in
4913 val='"unsigned long long"'
4918 *) case "$d_int64_t" in
4937 '') echo "Alas, no 64-bit integer types in sight." >&4
4940 *) echo "We could use '$quadtype' for 64-bit integers." >&4
4946 case "$uselonglong" in
4947 "$define"|true|[yY]*)
4950 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
4952 use64bitint="$define"
4955 case "$use64bits" in
4956 "$define"|true|[yY]*)
4959 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
4961 use64bitint="$define"
4964 case "$use64bitints" in
4965 "$define"|true|[yY]*)
4968 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
4970 use64bitint="$define"
4973 case "$use64bitsint" in
4974 "$define"|true|[yY]*)
4977 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
4979 use64bitint="$define"
4982 case "$uselonglongs" in
4983 "$define"|true|[yY]*)
4986 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
4988 use64bitint="$define"
4991 case "$use64bitsall" in
4992 "$define"|true|[yY]*)
4995 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
4997 use64bitall="$define"
5002 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5004 case "$use64bitall" in
5005 "$define"|true|[yY]*) use64bitint="$define" ;;
5011 You have natively 64-bit long integers.
5015 *) case "$use64bitint" in
5016 "$define"|true|[yY]*) dflt='y';;
5025 Perl can be built to take advantage of 64-bit integer types
5026 on some systems. To do so, Configure can be run with -Duse64bitint.
5027 Choosing this option will most probably introduce binary incompatibilities.
5029 If this doesn't make any sense to you, just accept the default '$dflt'.
5030 (The default has been chosen based on your configuration.)
5032 rp='Try to use 64-bit integers, if available?'
5035 [yY]*) val="$define" ;;
5043 case "$use64bitall" in
5044 "$define"|true|[yY]*) dflt='y' ;;
5045 *) case "$longsize" in
5053 You may also choose to try maximal 64-bitness. It means using as much
5054 64-bitness as possible on the platform. This in turn means even more
5055 binary incompatibilities. On the other hand, your platform may not
5056 have any more 64-bitness available than what you already have chosen.
5058 If this doesn't make any sense to you, just accept the default '$dflt'.
5059 (The default has been chosen based on your configuration.)
5061 rp='Try to use maximal 64-bit support, if available?'
5064 [yY]*) val="$define" ;;
5069 case "$use64bitall" in
5071 case "$use64bitint" in
5075 Since you have chosen a maximally 64-bit build, I'm also turning on
5076 the use of 64-bit integers.
5078 use64bitint="$define" ;;
5083 case "$use64bitall" in
5084 "$define"|true|[yY]*)
5088 *** You have chosen a maximally 64-bit build, but your pointers
5089 *** are only 4 bytes wide, disabling maximal 64-bitness.
5092 use64bitall="$undef"
5093 case "$use64bitint" in
5094 "$define"|true|[yY]*) ;;
5097 *** Downgrading from maximal 64-bitness to using 64-bit integers.
5100 use64bitint="$define"
5108 case "$use64bitint" in
5109 "$define"|true|[yY]*)
5110 : Look for a hint-file generated 'call-back-unit'. If the
5111 : user has specified that a 64-bit perl is to be built,
5112 : we may need to set or change some other defaults.
5113 if $test -f use64bitint.cbu; then
5114 echo "Your platform has some specific hints for 64-bit integers, using them..."
5118 4) case "$archname64" in
5119 '') archname64=64int ;;
5126 case "$use64bitall" in
5127 "$define"|true|[yY]*)
5128 : Look for a hint-file generated 'call-back-unit'. If the
5129 : user has specified that a maximally 64-bit perl is to be built,
5130 : we may need to set or change some other defaults.
5131 if $test -f use64bitall.cbu; then
5132 echo "Your platform has some specific hints for 64-bit builds, using them..."
5136 4) case "$archname64" in
5137 ''|64int) archname64=64all ;;
5145 echo "Checking for GNU C Library..." >&4
5146 cat >gnulibc.c <<EOM
5158 if eval $compile_ok && ./gnulibc; then
5160 echo "You are using the GNU C Library"
5163 echo "You are not using the GNU C Library"
5169 : see if nm is to be used to determine whether a symbol is defined or not
5173 case "$d_gnulibc" in
5176 echo "nm probably won't work on the GNU C Library." >&4
5182 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
5184 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
5185 echo "'nm' won't be sufficient on this sytem." >&4
5191 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
5192 if $test $dflt -gt 20; then
5202 true|$define) dflt=y;;
5209 I can use $nm to extract the symbols from your C libraries. This
5210 is a time consuming task which may generate huge output on the disk (up
5211 to 3 megabytes) but that should make the symbols extraction faster. The
5212 alternative is to skip the 'nm' extraction part and to compile a small
5213 test program instead to determine whether each symbol is present. If
5214 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
5215 this may be the best solution.
5217 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
5220 rp="Shall I use $nm to extract C symbols from the libraries?"
5223 [Nn]*) usenm=false;;
5232 : nm options which may be necessary
5234 '') if $test -f /mach_boot; then
5236 elif $test -d /usr/ccs/lib; then
5237 nm_opt='-p' # Solaris (and SunOS?)
5238 elif $test -f /dgux; then
5240 elif $test -f /lib64/rld; then
5241 nm_opt='-p' # 64-bit Irix
5247 : nm options which may be necessary for shared libraries but illegal
5248 : for archive libraries. Thank you, Linux.
5249 case "$nm_so_opt" in
5250 '') case "$myuname" in
5252 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
5253 nm_so_opt='--dynamic'
5262 : get list of predefined functions in a handy place
5267 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
5274 *) for thislib in $libs; do
5277 : Handle C library specially below.
5280 thislib=`echo $thislib | $sed -e 's/^-l//'`
5281 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
5283 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
5285 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
5287 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
5289 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
5291 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
5293 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
5298 libnames="$libnames $try"
5300 *) libnames="$libnames $thislib" ;;
5309 for xxx in $libpth; do
5310 $test -r $1 || set $xxx/libc.$so
5311 : The messy sed command sorts on library version numbers.
5313 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
5314 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
5316 s/[0-9][0-9]*/0000&/g
5317 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
5320 $sort | $sed -e 's/^.* //'`
5323 $test -r $1 || set /usr/ccs/lib/libc.$so
5324 $test -r $1 || set /lib/libsys_s$_a
5330 if $test -r "$1"; then
5331 echo "Your (shared) C library seems to be in $1."
5333 elif $test -r /lib/libc && $test -r /lib/clib; then
5334 echo "Your C library seems to be in both /lib/clib and /lib/libc."
5336 libc='/lib/clib /lib/libc'
5337 if $test -r /lib/syslib; then
5338 echo "(Your math library is in /lib/syslib.)"
5339 libc="$libc /lib/syslib"
5341 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5342 echo "Your C library seems to be in $libc, as you said before."
5343 elif $test -r $incpath/usr/lib/libc$_a; then
5344 libc=$incpath/usr/lib/libc$_a;
5345 echo "Your C library seems to be in $libc. That's fine."
5346 elif $test -r /lib/libc$_a; then
5348 echo "Your C library seems to be in $libc. You're normal."
5350 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
5352 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
5353 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
5354 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
5356 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5358 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5361 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
5363 if $test -r "$tans"; then
5364 echo "Your C library seems to be in $tans, of all places."
5370 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5374 If the guess above is wrong (which it might be if you're using a strange
5375 compiler, or your machine supports multiple models), you can override it here.
5380 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
5382 I can't seem to find your C library. I've looked in the following places:
5385 $sed 's/^/ /' libpath
5388 None of these seems to contain your C library. I need to get its name...
5393 rp='Where is your C library?'
5398 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
5399 set X `cat libnames`
5402 case $# in 1) xxx=file; esac
5403 echo "Extracting names from the following $xxx for later perusal:" >&4
5405 $sed 's/^/ /' libnames >&4
5407 $echo $n "This may take a while...$c" >&4
5411 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
5412 *) $nm $nm_opt $file 2>/dev/null;;
5417 $grep fprintf libc.tmp > libc.ptf
5418 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
5419 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
5421 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
5423 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5425 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
5427 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5429 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
5431 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5433 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
5435 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5437 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
5439 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5441 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
5443 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5445 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
5446 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
5448 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5450 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
5452 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5454 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
5456 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5458 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
5460 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5462 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
5464 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5466 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
5468 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5470 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
5472 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5474 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
5476 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5479 $nm -p $* 2>/dev/null >libc.tmp
5480 $grep fprintf libc.tmp > libc.ptf
5481 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
5482 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
5488 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
5490 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
5491 for thisname in $libnames $libc; do
5492 $ar t $thisname >>libc.tmp
5494 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
5496 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
5497 # Repeat libc to extract forwarders to DLL entries too
5498 for thisname in $libnames $libc; do
5499 $ar tv $thisname >>libc.tmp
5500 # Revision 50 of EMX has bug in $ar.
5501 # it will not extract forwarders to DLL entries
5502 # Use emximp which will extract exactly them.
5503 emximp -o tmp.imp $thisname \
5505 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
5506 < tmp.imp >>libc.tmp
5509 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
5512 echo "$ar didn't seem to work right." >&4
5513 echo "Maybe this is a Cray...trying bld instead..." >&4
5514 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
5516 for thisname in $libnames; do
5518 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
5519 $ar t $thisname >>libc.tmp
5523 echo "That didn't work either. Giving up." >&4
5530 if $test -f /lib/syscalls.exp; then
5532 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
5533 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*$/\1/p' /lib/syscalls.exp >>libc.list
5537 $rm -f libnames libpath
5539 : is a C symbol defined?
5542 -v) tf=libc.tmp; tc=""; tdc="";;
5543 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
5544 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
5547 case "$reuseval-$4" in
5549 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
5555 if $contains $tlook $tf >/dev/null 2>&1;
5560 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
5561 if $cc -o t $optimize $ccflags $ldflags t.c $libs >/dev/null 2>&1;
5569 $define) tval=true;;
5575 : define an is-in-libc? function
5576 inlibc='echo " "; td=$define; tu=$undef;
5577 sym=$1; var=$2; eval "was=\$$2";
5579 case "$reuseval$was" in
5589 echo "$sym() found." >&4;
5590 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
5592 echo "$sym() NOT found." >&4;
5593 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
5597 $define) echo "$sym() found." >&4;;
5598 *) echo "$sym() NOT found." >&4;;
5602 : see if sqrtl exists
5607 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
5610 case "$uselongdouble" in
5611 $define|true|[yY]*) dflt='y';;
5616 Perl can be built to take advantage of long doubles which
5617 (if available) may give more accuracy and range for floating point numbers.
5619 If this doesn't make any sense to you, just accept the default '$dflt'.
5621 rp='Try to use long doubles if available?'
5624 y|Y) val="$define" ;;
5630 case "$uselongdouble" in
5631 true|[yY]*) uselongdouble="$define" ;;
5634 case "$uselongdouble" in
5636 : Look for a hint-file generated 'call-back-unit'. If the
5637 : user has specified that long doubles should be used,
5638 : we may need to set or change some other defaults.
5639 if $test -f uselongdouble.cbu; then
5640 echo "Your platform has some specific hints for long doubles, using them..."
5641 . ./uselongdouble.cbu
5644 (Your platform doesn't have any specific hints for long doubles.)
5650 case "$uselongdouble:$d_sqrtl" in
5654 *** You requested the use of long doubles but you do not seem to have
5655 *** the mathematic functions for long doubles. I'm disabling the use
5656 *** of long doubles.
5659 uselongdouble=$undef
5663 : check for length of double
5665 case "$doublesize" in
5667 echo "Checking to see how big your double precision numbers are..." >&4
5668 $cat >try.c <<'EOCP'
5672 printf("%d\n", (int)sizeof(double));
5677 if eval $compile_ok; then
5679 echo "Your double is $doublesize bytes long."
5682 echo "(I can't seem to compile the test program. Guessing...)"
5683 rp="What is the size of a double precision number (in bytes)?"
5691 : check for long doubles
5693 echo "Checking to see if you have long double..." >&4
5694 echo 'int main() { long double x = 7.0; }' > try.c
5696 if eval $compile; then
5698 echo "You have long double."
5701 echo "You do not have long double."
5707 : check for length of long double
5708 case "${d_longdbl}${longdblsize}" in
5711 echo "Checking to see how big your long doubles are..." >&4
5712 $cat >try.c <<'EOCP'
5716 printf("%d\n", sizeof(long double));
5721 if eval $compile; then
5722 longdblsize=`./try$exe_ext`
5723 echo "Your long doubles are $longdblsize bytes long."
5727 echo "(I can't seem to compile the test program. Guessing...)" >&4
5728 rp="What is the size of a long double (in bytes)?"
5732 if $test "X$doublesize" = "X$longdblsize"; then
5733 echo "(That isn't any different from an ordinary double.)"
5739 case "$useperlio" in
5740 $define|true|[yY]*|'') dflt='y';;
5745 Previous version of $package used the standard IO mechanisms as
5746 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
5747 alternate IO mechanisms via the PerlIO abstraction layer, but the
5748 stdio mechanism is still available if needed. The abstraction layer
5749 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
5750 Using PerlIO with sfio may cause problems with some extension modules.
5752 If this doesn't make any sense to you, just accept the default '$dflt'.
5754 rp='Use the PerlIO abstraction layer?'
5761 echo "Ok, doing things the stdio way."
5770 case "$useperlio" in
5771 $define|true|[yY]*) ;;
5774 You are using the SOCKS proxy protocol library which means that you
5775 should also use the PerlIO layer. You may be headed for trouble.
5784 : determine the architecture name
5786 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5787 tarch=`arch`"-$osname"
5788 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5789 if uname -m > tmparch 2>&1 ; then
5790 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5791 -e 's/$/'"-$osname/" tmparch`
5799 case "$myarchname" in
5802 echo "(Your architecture name used to be $myarchname.)"
5809 *) dflt="$archname";;
5811 rp='What is your architecture name'
5814 case "$usethreads" in
5816 echo "Threads selected." >&4
5818 *-thread*) echo "...and architecture name already has -thread." >&4
5820 *) archname="$archname-thread"
5821 echo "...setting architecture name to $archname." >&4
5826 case "$usemultiplicity" in
5828 echo "Multiplicity selected." >&4
5830 *-multi*) echo "...and architecture name already has -multi." >&4
5832 *) archname="$archname-multi"
5833 echo "...setting architecture name to $archname." >&4
5838 case "$use64bitint$use64bitall" in
5840 case "$archname64" in
5842 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
5845 case "$use64bitint" in
5846 "$define") echo "64 bit integers selected." >&4 ;;
5848 case "$use64bitall" in
5849 "$define") echo "Maximal 64 bitness selected." >&4 ;;
5852 *-$archname64*) echo "...and architecture name already has $archname64." >&4
5854 *) archname="$archname-$archname64"
5855 echo "...setting architecture name to $archname." >&4
5861 case "$uselongdouble" in
5863 echo "Long doubles selected." >&4
5864 case "$longdblsize" in
5866 "...but long doubles are equal to doubles, not changing architecture name." >&4
5870 *-ld*) echo "...and architecture name already has -ld." >&4
5872 *) archname="$archname-ld"
5873 echo "...setting architecture name to $archname." >&4
5880 case "$useperlio" in
5882 echo "Perlio selected." >&4
5885 echo "Perlio not selected, using stdio." >&4
5887 *-stdio*) echo "...and architecture name already has -stdio." >&4
5889 *) archname="$archname-stdio"
5890 echo "...setting architecture name to $archname." >&4
5896 : determine root of directory hierarchy where package will be installed.
5899 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
5907 By default, $package will be installed in $dflt/bin, manual pages
5908 under $dflt/man, etc..., i.e. with $dflt as prefix for all
5909 installation directories. Typically this is something like /usr/local.
5910 If you wish to have binaries under /usr/bin but other parts of the
5911 installation under /usr/local, that's ok: you will be prompted
5912 separately for each of the installation directories, the prefix being
5913 only used to set the defaults.
5917 rp='Installation prefix to use?'
5925 *) oldprefix="$prefix";;
5934 *) afsroot=$afsroot ;;
5940 $define|true) afs=true ;;
5941 $undef|false) afs=false ;;
5942 *) if test -d $afsroot; then
5950 echo "AFS may be running... I'll be extra cautious then..." >&4
5952 echo "AFS does not seem to be running..." >&4
5955 : determine installation prefix for where package is to be installed.
5959 Since you are running AFS, I need to distinguish the directory in which
5960 files will reside from the directory in which they are installed (and from
5961 which they are presumably copied to the former directory by occult means).
5964 case "$installprefix" in
5965 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
5966 *) dflt="$installprefix";;
5971 In some special cases, particularly when building $package for distribution,
5972 it is convenient to distinguish between the directory in which files should
5973 be installed from the directory ($prefix) in which they
5974 will eventually reside. For most users, these two directories are the same.
5977 case "$installprefix" in
5979 *) dflt=$installprefix;;
5983 rp='What installation prefix should I use for installing files?'
5985 installprefix="$ans"
5986 installprefixexp="$ansexp"
5988 : set the prefixit variable, to compute a suitable default value
5989 prefixit='case "$3" in
5991 case "$oldprefix" in
5992 "") eval "$1=\"\$$2\"";;
5999 ""|" ") eval "$1=\"\$$2\"";;
6005 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6007 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6008 /*-$oldprefix/*|\~*-$oldprefix/*)
6009 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6010 *) eval "$1=\"\$$2\"";;
6015 : get the patchlevel
6017 echo "Getting the current patchlevel..." >&4
6018 if $test -r $rsrc/patchlevel.h;then
6019 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
6020 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
6021 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
6022 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
6023 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
6024 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
6025 perl_patchlevel=`grep ',"DEVEL[0-9][0-9]*"' $rsrc/patchlevel.h|sed 's/[^0-9]//g'`
6034 $echo "(You do not have patchlevel.h. Eek.)"
6036 if $test -r $rsrc/.patch ; then
6037 if $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
6038 perl_patchlevel=`cat $rsrc/.patch`
6041 case "$perl_patchlevel" in
6043 '') $echo "(You have $package version $patchlevel subversion $subversion.)" ;;
6044 *) $echo "(You have $package version $patchlevel subversion $subversion patchlevel $perl_patchlevel.)" ;;
6048 : XXX Should be a Configure test for double-dots in filenames.
6049 version=`echo $revision $patchlevel $subversion | \
6050 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
6051 api_versionstring=`echo $api_revision $api_version $api_subversion | \
6052 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
6055 version=`echo $revision $patchlevel $subversion | \
6056 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
6057 api_versionstring=`echo $api_revision $api_version $api_subversion | \
6058 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
6061 : Special case the 5.005_xx maintenance series, which used 5.005
6062 : without any subversion label as a subdirectory in $sitelib
6063 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
6064 api_versionstring='5.005'
6067 : determine installation style
6068 : For now, try to deduce it from prefix unless it is already set.
6069 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6070 case "$installstyle" in
6071 '') case "$prefix" in
6072 *perl*) dflt='lib';;
6073 *) dflt='lib/perl5' ;;
6076 *) dflt="$installstyle" ;;
6078 : Probably not worth prompting for this since we prompt for all
6079 : the directories individually, and the prompt would be too long and
6083 : determine where private library files go
6084 : Usual default is /usr/local/lib/perl5/$version.
6085 : Also allow things like /opt/perl/lib/$version, since
6086 : /opt/perl/lib/perl5... would be redundant.
6087 : The default "style" setting is made in installstyle.U
6088 case "$installstyle" in
6089 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6090 *) set dflt privlib lib/$version ;;
6095 There are some auxiliary files for $package that need to be put into a
6096 private library directory that is accessible by everyone.
6100 rp='Pathname where the private library files will reside?'
6103 privlibexp="$ansexp"
6104 : Change installation prefix, if necessary.
6105 if $test X"$prefix" != X"$installprefix"; then
6106 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
6108 installprivlib="$privlibexp"
6111 : set the prefixup variable, to restore leading tilda escape
6112 prefixup='case "$prefixexp" in
6114 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6117 : determine where public architecture dependent libraries go
6120 : privlib default is /usr/local/lib/$package/$version
6121 : archlib default is /usr/local/lib/$package/$version/$archname
6122 : privlib may have an optional trailing /share.
6123 tdflt=`echo $privlib | $sed 's,/share$,,'`
6124 tdflt=$tdflt/$archname
6133 $spackage contains architecture-dependent library files. If you are
6134 sharing libraries in a heterogeneous environment, you might store
6135 these files in a separate location. Otherwise, you can just include
6136 them with the rest of the public library files.
6140 rp='Where do you want to put the public architecture-dependent libraries?'
6143 archlibexp="$ansexp"
6144 if $test X"$archlib" = X"$privlib"; then
6149 : Change installation prefix, if necessary.
6150 if $test X"$prefix" != X"$installprefix"; then
6151 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
6153 installarchlib="$archlibexp"
6157 : Binary compatibility with 5.005 is not possible for builds
6158 : with advanced features
6159 case "$usethreads$usemultiplicity" in
6161 bincompat5005="$undef"
6162 d_bincompat5005="$undef"
6166 This version of Perl can be compiled for binary compatibility with 5.005.
6167 If you decide to do so, you will be able to continue using most of the
6168 extensions that were compiled for Perl 5.005.
6171 case "$bincompat5005$d_bincompat5005" in
6172 *"$undef"*) dflt=n ;;
6175 rp='Binary compatibility with Perl 5.005?'
6178 y*) val="$define" ;;
6183 case "$d_bincompat5005" in
6185 bincompat5005="$define"
6187 *) bincompat5005="$undef"
6188 d_bincompat5005="$undef"
6195 : see if setuid scripts can be secure
6198 Some kernels have a bug that prevents setuid #! scripts from being
6199 secure. Some sites have disabled setuid #! scripts because of this.
6201 First let's decide if your kernel supports secure setuid #! scripts.
6202 (If setuid #! scripts would be secure but have been disabled anyway,
6203 don't say that they are secure if asked.)
6208 if $test -d /dev/fd; then
6209 echo "#!$ls" >reflect
6210 chmod +x,u+s reflect
6211 ./reflect >flect 2>&1
6212 if $contains "/dev/fd" flect >/dev/null; then
6213 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6217 If you are not sure if they are secure, I can check but I'll need a
6218 username and password different from the one you are using right now.
6219 If you don't have such a username or don't want me to test, simply
6223 rp='Other username to test security of setuid scripts with?'
6228 case "$d_suidsafe" in
6229 '') echo "I'll assume setuid scripts are *not* secure." >&4
6232 echo "Well, the $hint value is *not* secure." >&4
6234 *) echo "Well, the $hint value *is* secure." >&4
6239 $rm -f reflect flect
6240 echo "#!$ls" >reflect
6241 chmod +x,u+s reflect
6244 echo '"su" will (probably) prompt you for '"$ans's password."
6245 su $ans -c './reflect >flect'
6246 if $contains "/dev/fd" flect >/dev/null; then
6247 echo "Okay, it looks like setuid scripts are secure." >&4
6250 echo "I don't think setuid scripts are secure." >&4
6255 rp='Does your kernel have *secure* setuid scripts?'
6258 [yY]*) val="$define";;
6263 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6264 echo "(That's for file descriptors, not floppy disks.)"
6270 $rm -f reflect flect
6272 : now see if they want to do setuid emulation
6275 case "$d_suidsafe" in
6278 echo "No need to emulate SUID scripts since they are secure here." >& 4
6282 Some systems have disabled setuid scripts, especially systems where
6283 setuid scripts cannot be secure. On systems where setuid scripts have
6284 been disabled, the setuid/setgid bits on scripts are currently
6285 useless. It is possible for $package to detect those bits and emulate
6286 setuid/setgid in a secure fashion. This emulation will only work if
6287 setuid scripts have been disabled in your kernel.
6291 "$define") dflt=y ;;
6294 rp="Do you want to do setuid/setgid emulation?"
6297 [yY]*) val="$define";;
6305 : see if this is a malloc.h system
6306 set malloc.h i_malloc
6309 : see if stdlib is available
6310 set stdlib.h i_stdlib
6313 : determine which malloc to compile in
6315 case "$usemymalloc" in
6316 [yY]*|true|$define) dflt='y' ;;
6317 [nN]*|false|$undef) dflt='n' ;;
6318 *) case "$ptrsize" in
6324 rp="Do you wish to attempt to use the malloc that comes with $package?"
6330 mallocsrc='malloc.c'
6331 mallocobj="malloc$_o"
6332 d_mymalloc="$define"
6335 : Remove malloc from list of libraries to use
6336 echo "Removing unneeded -lmalloc from library list" >&4
6337 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6340 echo "libs = $libs" >&4
6352 : compute the return types of malloc and free
6354 $cat >malloc.c <<END
6358 #include <sys/types.h>
6372 case "$malloctype" in
6374 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6381 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6385 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6392 echo "Your system uses $freetype free(), it would seem." >&4
6396 After $package is installed, you may wish to install various
6397 add-on modules and utilities. Typically, these add-ons will
6398 be installed under $prefix with the rest
6399 of this package. However, you may wish to install such add-ons
6400 elsewhere under a different prefix.
6402 If you do not wish to put everything under a single prefix, that's
6403 ok. You will be prompted for the individual locations; this siteprefix
6404 is only used to suggest the defaults.
6406 The default should be fine for most people.
6410 rp='Installation prefix to use for add-on modules and utilities?'
6411 : XXX Here might be another good place for an installstyle setting.
6412 case "$siteprefix" in
6414 *) dflt=$siteprefix ;;
6417 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6419 case "$siteprefix" in
6423 *) oldsiteprefix="$prefix";;
6428 siteprefixexp="$ansexp"
6430 : determine where site specific libraries go.
6431 : Usual default is /usr/local/lib/perl5/site_perl/$version
6432 : The default "style" setting is made in installstyle.U
6433 : XXX No longer works with Prefixit stuff.
6434 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6436 '') case "$installstyle" in
6437 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6438 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6446 The installation process will create a directory for
6447 site-specific extensions and modules. Most users find it convenient
6448 to place all site-specific files in this directory rather than in the
6449 main distribution directory.
6453 rp='Pathname for the site-specific library files?'
6456 sitelibexp="$ansexp"
6457 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6458 : Change installation prefix, if necessary.
6459 if $test X"$prefix" != X"$installprefix"; then
6460 installsitelib=`echo $sitelibexp | $sed "s#^$prefix#$installprefix#"`
6462 installsitelib="$sitelibexp"
6465 : determine where site specific architecture-dependent libraries go.
6466 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6467 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6468 : sitelib may have an optional trailing /share.
6470 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6471 dflt="$dflt/$archname"
6476 set sitearch sitearch none
6480 The installation process will also create a directory for
6481 architecture-dependent site-specific extensions and modules.
6485 rp='Pathname for the site-specific architecture-dependent library files?'
6488 sitearchexp="$ansexp"
6489 : Change installation prefix, if necessary.
6490 if $test X"$prefix" != X"$installprefix"; then
6491 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
6493 installsitearch="$sitearchexp"
6498 The installation process will also create a directory for
6499 vendor-supplied add-ons. Vendors who supply perl with their system
6500 may find it convenient to place all vendor-supplied files in this
6501 directory rather than in the main distribution directory. This will
6502 ease upgrades between binary-compatible maintenance versions of perl.
6504 Of course you may also use these directories in whatever way you see
6505 fit. For example, you might use them to access modules shared over a
6506 company-wide network.
6508 The default answer should be fine for most people.
6509 This causes further questions about vendor add-ons to be skipped
6510 and no vendor-specific directories will be configured for perl.
6513 rp='Do you want to configure vendor-specific add-on directories?'
6514 case "$usevendorprefix" in
6515 define|true|[yY]*) dflt=y ;;
6516 *) : User may have set vendorprefix directly on Configure command line.
6517 case "$vendorprefix" in
6526 rp='Installation prefix to use for vendor-supplied add-ons?'
6527 case "$vendorprefix" in
6529 *) dflt=$vendorprefix ;;
6532 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6534 case "$vendorprefix" in
6538 *) oldvendorprefix="$prefix";;
6542 usevendorprefix="$define"
6544 vendorprefixexp="$ansexp"
6546 *) usevendorprefix="$undef"
6552 case "$vendorprefix" in
6553 '') d_vendorlib="$undef"
6557 *) d_vendorlib="$define"
6558 : determine where vendor-supplied modules go.
6559 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6560 case "$vendorlib" in
6562 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6563 case "$installstyle" in
6564 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6565 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6568 *) dflt="$vendorlib"
6572 rp='Pathname for the vendor-supplied library files?'
6575 vendorlibexp="$ansexp"
6578 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6579 : Change installation prefix, if necessary.
6580 if $test X"$prefix" != X"$installprefix"; then
6581 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
6583 installvendorlib="$vendorlibexp"
6586 case "$vendorprefix" in
6587 '') d_vendorarch="$undef"
6591 *) d_vendorarch="$define"
6592 : determine where vendor-supplied architecture-dependent libraries go.
6593 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6594 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6595 : vendorlib may have an optional trailing /share.
6596 case "$vendorarch" in
6597 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6598 dflt="$dflt/$archname"
6600 *) dflt="$vendorarch" ;;
6603 rp='Pathname for vendor-supplied architecture-dependent files?'
6606 vendorarchexp="$ansexp"
6609 : Change installation prefix, if necessary.
6610 if $test X"$prefix" != X"$installprefix"; then
6611 installvendorarch=`echo $vendorarchexp | sed "s#^$prefix#$installprefix#"`
6613 installvendorarch="$vendorarchexp"
6616 : Final catch-all directories to search
6619 Lastly, you can have perl look in other directories for extensions and
6620 modules in addition to those already specified.
6621 These directories will be searched after
6625 test X"$vendorlib" != "X" && echo ' ' $vendorlib
6626 test X"$vendorarch" != "X" && echo ' ' $vendorarch
6628 case "$otherlibdirs" in
6629 ''|' ') dflt='none' ;;
6630 *) dflt="$otherlibdirs" ;;
6633 Enter a colon-separated set of extra paths to include in perl's @INC
6634 search path, or enter 'none' for no extra paths.
6638 rp='Colon-separated list of additional directories for perl to search?'
6641 ' '|''|none) otherlibdirs=' ' ;;
6642 *) otherlibdirs="$ans" ;;
6644 case "$otherlibdirs" in
6648 set d_perl_otherlibdirs
6651 : Cruising for prototypes
6653 echo "Checking out function prototypes..." >&4
6654 $cat >prototype.c <<'EOCP'
6655 int main(int argc, char *argv[]) {
6658 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
6659 echo "Your C compiler appears to support function prototypes."
6662 echo "Your C compiler doesn't seem to understand function prototypes."
6669 case "$prototype" in
6671 *) ansi2knr='ansi2knr'
6676 This version of $package can only be compiled by a compiler that
6677 understands function prototypes. Unfortunately, your C compiler
6679 doesn't seem to understand them. Sorry about that.
6681 If GNU cc is available for your system, perhaps you could try that instead.
6683 Eventually, we hope to support building Perl with pre-ANSI compilers.
6684 If you would like to help in that effort, please contact <perlbug@perl.org>.
6686 Aborting Configure now.
6692 : determine where public executables go
6697 rp='Pathname where the public executables will reside?'
6699 if $test "X$ansexp" != "X$binexp"; then
6704 : Change installation prefix, if necessary.
6705 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6706 if $test X"$prefix" != X"$installprefix"; then
6707 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
6709 installbin="$binexp"
6712 : Find perl5.005 or later.
6713 echo "Looking for a previously installed perl5.005 or later... "
6715 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6716 : Check if this perl is recent and can load a simple module
6717 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6720 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6730 '') echo "None found. That's ok.";;
6731 *) echo "Using $perl5." ;;
6734 : Determine list of previous versions to include in @INC
6735 $cat > getverlist <<EOPL
6738 \$api_versionstring = "$api_versionstring";
6739 \$version = "$version";
6740 \$stem = "$sitelib_stem";
6741 \$archname = "$archname";
6743 $cat >> getverlist <<'EOPL'
6744 # Can't have leading @ because metaconfig interprets it as a command!
6745 ;@inc_version_list=();
6746 # XXX Redo to do opendir/readdir?
6749 ;@candidates = glob("5.*");
6755 # XXX ToDo: These comparisons must be reworked when two-digit
6756 # subversions come along, so that 5.7.10 compares as greater than
6757 # 5.7.3! By that time, hope that 5.6.x is sufficiently
6758 # widespread that we can use the built-in version vectors rather
6759 # than reinventing them here. For 5.6.0, however, we must
6760 # assume this script will likely be run by 5.005_0x. --AD 1/2000.
6761 foreach $d (@candidates) {
6762 if ($d lt $version) {
6763 if ($d ge $api_versionstring) {
6764 unshift(@inc_version_list, grep { -d } "$d/$archname", $d);
6766 elsif ($d ge "5.005") {
6767 unshift(@inc_version_list, grep { -d } $d);
6771 # Skip newer version. I.e. don't look in
6772 # 5.7.0 if we're installing 5.6.1.
6776 if (@inc_version_list) {
6777 print join(' ', @inc_version_list);
6780 # Blank space to preserve value for next Configure run.
6785 case "$inc_version_list" in
6786 '') if test -x "$perl5$exe_ext"; then
6787 dflt=`$perl5 getverlist`
6792 $undef) dflt='none' ;;
6793 *) eval dflt=\"$inc_version_list\" ;;
6796 ''|' ') dflt=none ;;
6799 5.005) case "$bincompat5005" in
6800 $define|true|[yY]*) ;;
6807 In order to ease the process of upgrading, this version of perl
6808 can be configured to use modules built and installed with earlier
6809 versions of perl that were installed under $prefix. Specify here
6810 the list of earlier versions that this version of perl should check.
6811 If Configure detected no earlier versions of perl installed under
6812 $prefix, then the list will be empty. Answer 'none' to tell perl
6813 to not search earlier versions.
6815 The default should almost always be sensible, so if you're not sure,
6816 just accept the default.
6819 rp='List of earlier versions to include in @INC?'
6822 [Nn]one|''|' ') inc_version_list=' ' ;;
6823 *) inc_version_list="$ans" ;;
6825 case "$inc_version_list" in
6827 inc_version_list_init='0';;
6828 *) inc_version_list_init=`echo $inc_version_list |
6829 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6834 : determine whether to install perl also as /usr/bin/perl
6837 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
6839 Many scripts expect perl to be installed as /usr/bin/perl.
6840 I can install the perl you are about to compile also as /usr/bin/perl
6841 (in addition to $installbin/perl).
6843 case "$installusrbinperl" in
6844 "$undef"|[nN]*) dflt='n';;
6847 rp="Do you want to install perl as /usr/bin/perl?"
6850 [yY]*) val="$define";;
6856 set installusrbinperl
6859 : see if dld is available
6863 : see if dlopen exists
6870 : determine which dynamic loading, if any, to compile in
6872 dldir="ext/DynaLoader"
6885 $define) dflt='y' ;;
6888 $define) dflt='y' ;;
6890 : Does a dl_xxx.xs file exist for this operating system
6891 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
6894 rp="Do you wish to use dynamic loading?"
6901 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
6902 dflt="$dldir/dl_${osname}.xs"
6903 elif $test "$d_dlopen" = "$define" ; then
6904 dflt="$dldir/dl_dlopen.xs"
6905 elif $test "$i_dld" = "$define" ; then
6906 dflt="$dldir/dl_dld.xs"
6911 *) dflt="$dldir/$dlsrc"
6914 echo "The following dynamic loading files are available:"
6915 : Can not go over to $dldir because getfile has path hard-coded in.
6916 tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir
6917 rp="Source file to use for dynamic loading"
6923 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
6927 Some systems may require passing special flags to $cc -c to
6928 compile modules that will be used to create a shared library.
6929 To use no flags, say "none".
6932 case "$cccdlflags" in
6933 '') case "$gccversion" in
6934 '') case "$osname" in
6936 next) dflt='none' ;;
6937 irix*) dflt='-KPIC' ;;
6938 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
6939 sunos) dflt='-pic' ;;
6943 *) case "$osname" in
6944 svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
6949 *) dflt="$cccdlflags" ;;
6951 rp="Any special flags to pass to $cc -c to compile shared library modules?"
6954 none) cccdlflags=' ' ;;
6955 *) cccdlflags="$ans" ;;
6960 Some systems use ld to create libraries that can be dynamically loaded,
6961 while other systems (such as those using ELF) use $cc.
6965 '') $cat >try.c <<'EOM'
6966 /* Test for whether ELF binaries are produced */
6971 int i = open("a.out",O_RDONLY);
6974 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
6975 exit(0); /* succeed (yes, it's ELF) */
6980 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && ./a.out; then
6982 You appear to have ELF support. I'll use $cc to build dynamic libraries.
6986 echo "I'll use ld to build dynamic libraries."
6995 rp="What command should be used to create dynamic libraries?"
7001 Some systems may require passing special flags to $ld to create a
7002 library that can be dynamically loaded. If your ld flags include
7003 -L/other/path options to locate libraries outside your loader's normal
7004 search path, you may need to specify those -L options here as well. To
7005 use no flags, say "none".
7008 case "$lddlflags" in
7009 '') case "$osname" in
7010 beos) dflt='-nostart' ;;
7012 case "$gccversion" in
7013 '') dflt="$dflt +vnocompatwarnings" ;;
7016 linux|irix*) dflt='-shared' ;;
7017 next) dflt='none' ;;
7018 solaris) dflt='-G' ;;
7019 sunos) dflt='-assert nodefinitions' ;;
7020 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
7024 *) dflt="$lddlflags" ;;
7027 : Try to guess additional flags to pick up local libraries.
7028 : Be careful not to append to a plain 'none'
7032 for thisflag in $ldflags; do
7037 *) dflt="$dflt $thisflag" ;;
7044 ''|' ') dflt='none' ;;
7047 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
7050 none) lddlflags=' ' ;;
7051 *) lddlflags="$ans" ;;
7056 Some systems may require passing special flags to $cc to indicate that
7057 the resulting executable will use dynamic linking. To use no flags,
7061 case "$ccdlflags" in
7062 '') case "$osname" in
7063 hpux) dflt='-Wl,-E' ;;
7064 linux) dflt='-rdynamic' ;;
7065 next) dflt='none' ;;
7066 sunos) dflt='none' ;;
7070 *) dflt="$ccdlflags" ;;
7072 rp="Any special flags to pass to $cc to use dynamic linking?"
7075 none) ccdlflags=' ' ;;
7076 *) ccdlflags="$ans" ;;
7090 # No dynamic loading being used, so don't bother even to prompt.
7093 *) case "$useshrplib" in
7094 '') case "$osname" in
7095 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
7097 also='Building a shared libperl is required for dynamic loading to work on your system.'
7102 also='Building a shared libperl is needed for MAB support.'
7120 The perl executable is normally obtained by linking perlmain.c with
7121 libperl${_a}, any static extensions (usually just DynaLoader), and
7122 any other libraries needed on this system (such as -lm, etc.). Since
7123 your system supports dynamic loading, it is probably possible to build
7124 a shared libperl.$so. If you will have more than one executable linked
7125 to libperl.$so, this will significantly reduce the size of each
7126 executable, but it may have a noticeable affect on performance. The
7127 default is probably sensible for your system.
7131 rp="Build a shared libperl.$so (y/n)"
7135 useshrplib='true' ;;
7136 *) useshrplib='false' ;;
7141 case "$useshrplib" in
7145 # Figure out a good name for libperl.so. Since it gets stored in
7146 # a version-specific architecture-dependent library, the version
7147 # number isn't really that important, except for making cc/ld happy.
7149 # A name such as libperl.so.3.1
7150 majmin="libperl.$so.$patchlevel.$subversion"
7151 # A name such as libperl.so.301
7152 majonly=`echo $patchlevel $subversion |
7153 $awk '{printf "%d%02d", $1, $2}'`
7154 majonly=libperl.$so.$majonly
7155 # I'd prefer to keep the os-specific stuff here to a minimum, and
7156 # rely on figuring it out from the naming of libc.
7157 case "${osname}${osvers}" in
7160 # XXX How handle the --version stuff for MAB?
7162 linux*) # ld won't link with a bare -lperl otherwise.
7165 cygwin*) # include version
7166 dflt=`echo libperl$version | sed -e 's/\./_/g'`$lib_ext
7168 *) # Try to guess based on whether libc has major.minor.
7170 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
7171 *libc.$so.[0-9]*) dflt=$majonly ;;
7172 *) dflt=libperl.$so ;;
7182 I need to select a good name for the shared libperl. If your system uses
7183 library names with major and minor numbers, then you might want something
7184 like $majmin. Alternatively, if your system uses a single version
7185 number for shared libraries, then you might want to use $majonly.
7186 Or, your system might be quite happy with a simple libperl.$so.
7188 Since the shared libperl will get installed into a version-specific
7189 architecture-dependent directory, the version number of the shared perl
7190 library probably isn't important, so the default should be o.k.
7193 rp='What name do you want to give to the shared libperl?'
7196 echo "Ok, I'll use $libperl"
7199 libperl="libperl${_a}"
7203 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
7207 WARNING: Use of the shrpdir variable for the installation location of
7208 the shared $libperl is not supported. It was never documented and
7209 will not work in this version. Let me (perlbug@perl.org)
7210 know of any problems this may cause.
7216 But your current setting of $shrpdir is
7217 the default anyway, so it's harmless.
7222 Further, your current attempted setting of $shrpdir
7223 conflicts with the value of $archlibexp/CORE
7224 that installperl will use.
7231 # How will the perl executable find the installed shared $libperl?
7232 # Add $xxx to ccdlflags.
7233 # If we can't figure out a command-line option, use $shrpenv to
7234 # set env LD_RUN_PATH. The main perl makefile uses this.
7235 shrpdir=$archlibexp/CORE
7238 if "$useshrplib"; then
7241 # We'll set it in Makefile.SH...
7247 xxx="-Wl,-R$shrpdir"
7249 linux|irix*|dec_osf)
7250 xxx="-Wl,-rpath,$shrpdir"
7253 # next doesn't like the default...
7256 # beos doesn't like the default, either.
7259 # hpux doesn't like the default, either.
7260 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
7263 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
7269 # Only add $xxx if it isn't already in ccdlflags.
7270 case " $ccdlflags " in
7272 *) ccdlflags="$ccdlflags $xxx"
7275 Adding $xxx to the flags
7276 passed to $ld so that the perl executable will find the
7277 installed shared $libperl.
7285 # Fix ccdlflags in AIX for building external extensions.
7286 # (For building Perl itself bare -bE:perl.exp is needed,
7287 # Makefile.SH takes care of this.)
7289 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
7291 # Respect a hint or command-line value.
7293 '') shrpenv="$tmp_shrpenv" ;;
7295 case "$ldlibpthname" in
7296 '') ldlibpthname=LD_LIBRARY_PATH ;;
7297 none) ldlibpthname='' ;;
7300 : determine where manual pages are on this system
7304 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
7305 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
7306 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
7307 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
7308 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
7309 sysman=`./loc . /usr/man/man1 $syspath`
7312 if $test -d "$sysman"; then
7313 echo "System manual is in $sysman." >&4
7315 echo "Could not find manual pages in source form." >&4
7318 : determine where manual pages go
7319 set man1dir man1dir none
7323 $spackage has manual pages available in source form.
7327 echo "However, you don't have nroff, so they're probably useless to you."
7329 '') man1dir="none";;
7332 echo "If you don't want the manual sources installed, answer 'none'."
7337 lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
7338 lookpath="$lookpath $prefixexp/man/p_man/man1"
7339 lookpath="$lookpath $prefixexp/man/u_man/man1"
7340 lookpath="$lookpath $prefixexp/man/man.1"
7342 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
7343 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
7353 rp="Where do the main $spackage manual pages (source) go?"
7355 if $test "X$man1direxp" != "X$ansexp"; then
7359 man1direxp="$ansexp"
7365 : Change installation prefix, if necessary.
7366 if $test X"$prefix" != X"$installprefix"; then
7367 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
7369 installman1dir="$man1direxp"
7372 : What suffix to use on installed man pages
7379 rp="What suffix should be used for the main $spackage man pages?"
7381 '') case "$man1dir" in
7395 *) dflt="$man1ext";;
7402 : see if we can have long filenames
7404 first=123456789abcdef
7406 if (echo hi >$first) 2>/dev/null; then
7407 if $test -f 123456789abcde; then
7408 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
7411 echo 'You can have filenames longer than 14 characters.'>&4
7416 You can't have filenames longer than 14 chars.
7417 You can't even think about them!
7423 $rm -rf 123456789abcde*
7425 : determine where library module manual pages go
7426 set man3dir man3dir none
7430 $spackage has manual pages for many of the library modules.
7436 However, you don't have nroff, so they're probably useless to you.
7439 '') man3dir="none";;
7443 case "$d_flexfnam" in
7446 However, your system can't handle the long file names like File::Basename.3.
7449 '') man3dir="none";;
7453 echo "If you don't want the manual sources installed, answer 'none'."
7454 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7456 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
7457 if $test -d "$privlib/man/man3"; then
7460 WARNING: Previous versions of perl installed man3 pages into
7461 $privlib/man/man3. This version will suggest a
7462 new default of $dflt.
7466 rp='Do you wish to preserve the old behavior?(y/n)'
7469 y*) dflt="$privlib/man/man3" ;;
7474 *) dflt="$man3dir" ;;
7481 rp="Where do the $package library man pages (source) go?"
7484 man3direxp="$ansexp"
7490 : Change installation prefix, if necessary.
7491 if $test X"$prefix" != X"$installprefix"; then
7492 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
7494 installman3dir="$man3direxp"
7497 : What suffix to use on installed man pages
7503 rp="What suffix should be used for the $package library man pages?"
7505 '') case "$man3dir" in
7519 *) dflt="$man3ext";;
7526 : see if we have to deal with yellow pages, now NIS.
7527 if $test -d /usr/etc/yp || $test -d /etc/yp; then
7528 if $test -f /usr/etc/nibindd; then
7530 echo "I'm fairly confident you're on a NeXT."
7532 rp='Do you get the hosts file via NetInfo?'
7541 y*) hostcat='nidump hosts .';;
7542 *) case "$hostcat" in
7543 nidump*) hostcat='';;
7553 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
7561 rp='Are you getting the hosts file via yellow pages?'
7564 y*) hostcat='ypcat hosts';;
7565 *) hostcat='cat /etc/hosts';;
7571 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
7574 '') test -f /etc/group && groupcat='cat /etc/group';;
7577 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
7580 : now get the host name
7582 echo "Figuring out host name..." >&4
7583 case "$myhostname" in
7585 echo 'Maybe "hostname" will work...'
7586 if tans=`sh -c hostname 2>&1` ; then
7594 if $test "$cont"; then
7596 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
7597 if tans=`cat /etc/systemid 2>&1` ; then
7599 phostname='cat /etc/systemid'
7600 echo "Whadyaknow. Xenix always was a bit strange..."
7603 elif $test -r /etc/systemid; then
7604 echo "(What is a non-Xenix system doing with /etc/systemid?)"
7607 if $test "$cont"; then
7608 echo 'No, maybe "uuname -l" will work...'
7609 if tans=`sh -c 'uuname -l' 2>&1` ; then
7611 phostname='uuname -l'
7613 echo 'Strange. Maybe "uname -n" will work...'
7614 if tans=`sh -c 'uname -n' 2>&1` ; then
7616 phostname='uname -n'
7618 echo 'Oh well, maybe I can mine it out of whoami.h...'
7619 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
7620 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
7621 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
7623 case "$myhostname" in
7624 '') echo "Does this machine have an identity crisis or something?"
7627 echo "Well, you said $myhostname before..."
7628 phostname='echo $myhostname';;
7634 : you do not want to know about this
7639 if $test "$myhostname" ; then
7641 rp='Your host name appears to be "'$myhostname'".'" Right?"
7649 : bad guess or no guess
7650 while $test "X$myhostname" = X ; do
7652 rp="Please type the (one word) name of your host:"
7657 : translate upper to lower if necessary
7658 case "$myhostname" in
7660 echo "(Normalizing case in your host name)"
7661 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
7665 case "$myhostname" in
7667 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
7668 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
7669 echo "(Trimming domain name from host name--host name is now $myhostname)"
7671 *) case "$mydomain" in
7674 test "X$hostcat" = "Xypcat hosts" &&
7675 ypmatch "$myhostname" hosts 2>/dev/null |\
7676 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
7679 test "X$hostcat" != "X" &&
7680 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
7681 /[ ]$myhostname[ . ]/p" > hosts
7684 if $test -f hosts; then
7685 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
7686 END { print sum }" hosts` = x1 || tmp_re="[ ]"
7687 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
7688 hosts | $sort | $uniq | \
7689 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
7690 case `$echo X$dflt` in
7691 X*\ *) echo "(Several hosts in the database matched hostname)"
7694 X.) echo "(You do not have fully-qualified names in the hosts database)"
7698 echo "(I cannot locate a hosts database anywhere)"
7703 tans=`./loc resolv.conf X /etc /usr/etc`
7704 if $test -f "$tans"; then
7705 echo "(Attempting domain name extraction from $tans)"
7706 dflt=.`$sed -n -e 's/ / /g' \
7707 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
7708 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
7710 .) dflt=.`$sed -n -e 's/ / /g' \
7711 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
7712 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
7719 .) echo "(No help from resolv.conf either -- attempting clever guess)"
7720 dflt=.`sh -c domainname 2>/dev/null`
7723 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
7727 case "$dflt$osname" in
7728 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
7729 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
7733 .) echo "(Lost all hope -- silly guess then)"
7739 *) dflt="$mydomain";;
7743 rp="What is your domain name?"
7753 : translate upper to lower if necessary
7756 echo "(Normalizing case in your domain name)"
7757 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
7761 : a little sanity check here
7762 case "$phostname" in
7765 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
7766 $myhostname$mydomain|$myhostname) ;;
7768 case "$phostname" in
7770 echo "(That doesn't agree with your whoami.h file, by the way.)"
7773 echo "(That doesn't agree with your $phostname command, by the way.)"
7783 I need to get your e-mail address in Internet format if possible, i.e.
7784 something like user@host.domain. Please answer accurately since I have
7785 no easy means to double check it. The default value provided below
7786 is most probably close to reality but may not be valid from outside
7787 your organization...
7791 while test "$cont"; do
7793 '') dflt="$cf_by@$myhostname$mydomain";;
7794 *) dflt="$cf_email";;
7796 rp='What is your e-mail address?'
7802 rp='Address does not look like an Internet one. Use it anyway?'
7818 If you or somebody else will be maintaining perl at your site, please
7819 fill in the correct e-mail address here so that they may be contacted
7820 if necessary. Currently, the "perlbug" program included with perl
7821 will send mail to this address in addition to perlbug@perl.org. You may
7822 enter "none" for no administrator.
7825 case "$perladmin" in
7826 '') dflt="$cf_email";;
7827 *) dflt="$perladmin";;
7829 rp='Perl administrator e-mail address'
7833 : determine whether to only install version-specific parts.
7836 Do you want to install only the version-specific parts of the perl
7837 distribution? Usually you do *not* want to do this.
7839 case "$versiononly" in
7840 "$define"|[Yy]*|true) dflt='y' ;;
7843 rp="Do you want to install only the version-specific parts of perl?"
7846 [yY]*) val="$define";;
7852 : figure out how to guarantee perl startup
7853 case "$startperl" in
7855 case "$sharpbang" in
7859 I can use the #! construct to start perl on your system. This will
7860 make startup of perl scripts faster, but may cause problems if you
7861 want to share those scripts and perl is not in a standard place
7862 ($binexp/perl) on all your platforms. The alternative is to force
7863 a shell by starting the script with a single ':' character.
7866 case "$versiononly" in
7867 "$define") dflt="$binexp/perl$version";;
7868 *) dflt="$binexp/perl";;
7870 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
7873 none) startperl=": # use perl";;
7874 *) startperl="#!$ans"
7875 if $test 30 -lt `echo "$ans" | wc -c`; then
7878 WARNING: Some systems limit the #! command to 32 characters.
7879 If you experience difficulty running Perl scripts with #!, try
7880 installing Perl in a directory with a shorter pathname.
7886 *) startperl=": # use perl"
7891 echo "I'll use $startperl to start perl scripts."
7893 : figure best path for perl in scripts
7896 perlpath="$binexp/perl"
7897 case "$startperl" in
7902 I will use the "eval 'exec'" idiom to start Perl on your system.
7903 I can use the full path of your Perl binary for this purpose, but
7904 doing so may cause problems if you want to share those scripts and
7905 Perl is not always in a standard place ($binexp/perl).
7909 rp="What path shall I use in \"eval 'exec'\"?"
7916 case "$startperl" in
7918 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
7921 : determine where public executable scripts go
7922 set scriptdir scriptdir
7924 case "$scriptdir" in
7927 : guess some guesses
7928 $test -d /usr/share/scripts && dflt=/usr/share/scripts
7929 $test -d /usr/share/bin && dflt=/usr/share/bin
7930 $test -d /usr/local/script && dflt=/usr/local/script
7931 $test -d /usr/local/scripts && dflt=/usr/local/scripts
7932 $test -d $prefixexp/script && dflt=$prefixexp/script
7936 *) dflt="$scriptdir"
7941 Some installations have a separate directory just for executable scripts so
7942 that they can mount it across multiple architectures but keep the scripts in
7943 one spot. You might, for example, have a subdirectory of /usr/share for this.
7944 Or you might just lump your scripts in with all your other executables.
7948 rp='Where do you keep publicly executable scripts?'
7950 if $test "X$ansexp" != "X$scriptdirexp"; then
7954 scriptdirexp="$ansexp"
7955 : Change installation prefix, if necessary.
7956 if $test X"$prefix" != X"$installprefix"; then
7957 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
7959 installscript="$scriptdirexp"
7962 : determine where add-on public executables go
7964 '') dflt=$siteprefix/bin ;;
7968 rp='Pathname where the add-on public executables should be installed?'
7971 sitebinexp="$ansexp"
7972 : Change installation prefix, if necessary.
7973 if $test X"$prefix" != X"$installprefix"; then
7974 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
7976 installsitebin="$sitebinexp"
7979 case "$vendorprefix" in
7980 '') d_vendorbin="$undef"
7984 *) d_vendorbin="$define"
7985 : determine where vendor-supplied executables go.
7986 case "$vendorbin" in
7987 '') dflt=$vendorprefix/bin ;;
7988 *) dflt="$vendorbin" ;;
7991 rp='Pathname for the vendor-supplied executables directory?'
7994 vendorbinexp="$ansexp"
7997 : Change installation prefix, if necessary.
7998 if $test X"$prefix" != X"$installprefix"; then
7999 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
8001 installvendorbin="$vendorbinexp"
8004 : see if qgcvt exists
8010 if $test X"$d_longdbl" = X"$define"; then
8012 echo "Checking how to print long doubles..." >&4
8014 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
8015 $cat >try.c <<'EOCP'
8016 #include <sys/types.h>
8020 printf("%.3f\n", d);
8024 if eval $compile; then
8028 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
8029 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
8030 echo "We will use %f."
8036 if $test X"$sPRIfldbl" = X; then
8037 $cat >try.c <<'EOCP'
8038 #include <sys/types.h>
8041 long double d = 123.456;
8042 printf("%.3llf\n", d);
8046 if eval $compile; then
8050 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
8051 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
8052 echo "We will use %llf."
8058 if $test X"$sPRIfldbl" = X; then
8059 $cat >try.c <<'EOCP'
8060 #include <sys/types.h>
8063 long double d = 123.456;
8064 printf("%.3Lf\n", d);
8068 if eval $compile; then
8072 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
8073 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
8074 echo "We will use %Lf."
8080 if $test X"$sPRIfldbl" = X; then
8081 $cat >try.c <<'EOCP'
8082 #include <sys/types.h>
8085 long double d = 123.456;
8086 printf("%.3lf\n", d);
8090 if eval $compile; then
8094 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
8095 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
8096 echo "We will use %lf."
8102 if $test X"$sPRIfldbl" = X; then
8103 echo "Cannot figure out how to print long doubles." >&4
8105 sSCNfldbl=$sPRIfldbl # expect consistency
8112 case "$sPRIfldbl" in
8113 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
8114 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
8115 d_SCNfldbl="$undef";
8117 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
8118 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
8119 d_SCNfldbl="$define";
8123 : Check how to convert floats to strings.
8125 echo "Checking for an efficient way to convert floats to strings."
8127 case "$uselongdouble" in
8128 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
8130 case "$d_longdbl" in
8131 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
8133 case "$d_PRIgldbl" in
8134 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
8138 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
8139 char *myname = "gconvert";
8142 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
8143 char *myname = "gcvt";
8146 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
8147 char *myname = "qgcvt";
8148 #define DOUBLETYPE long double
8151 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE) && defined(HAS_PRIgldbl)
8152 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
8154 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
8156 char *myname = "sprintf";
8160 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
8161 #define DOUBLETYPE long double
8163 #define DOUBLETYPE double
8169 #define I_STDLIB $i_stdlib
8175 checkit(expect, got)
8179 if (strcmp(expect, got)) {
8180 printf("%s oddity: Expected %s, got %s\n",
8181 myname, expect, got);
8191 /* This must be 1st test on (which?) platform */
8192 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
8193 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
8194 checkit("0.1", buf);
8196 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
8199 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
8200 checkit("1.1", buf);
8202 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
8203 checkit("1.01", buf);
8205 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
8206 checkit("1.001", buf);
8208 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
8209 checkit("1.0001", buf);
8211 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
8212 checkit("1.00001", buf);
8214 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
8215 checkit("1.000001", buf);
8217 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
8220 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
8223 /* Some Linux gcvt's give 1.e+5 here. */
8224 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
8225 checkit("100000", buf);
8227 /* Some Linux gcvt's give -1.e+5 here. */
8228 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
8229 checkit("-100000", buf);
8231 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
8232 checkit("123.456", buf);
8237 case "$d_Gconvert" in
8238 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
8239 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
8240 sprintf*) xxx_list='sprintf gconvert gcvt' ;;
8241 *) xxx_list='gconvert gcvt sprintf' ;;
8244 case "$d_longdbl$uselongdouble$d_PRIgldbl" in
8245 "$define$define$define")
8246 # for long doubles prefer first qgcvt, then sprintf
8247 xxx_list="`echo $xxx_list|sed s/sprintf//`"
8248 xxx_list="sprintf $xxx_list"
8250 "$define") xxx_list="qgcvt $xxx_list" ;;
8255 for xxx_convert in $xxx_list; do
8256 echo "Trying $xxx_convert..."
8258 set try -DTRY_$xxx_convert
8259 if eval $compile; then
8260 echo "$xxx_convert() found." >&4
8262 echo "I'll use $xxx_convert to convert floats into a string." >&4
8265 echo "...But $xxx_convert didn't work as I expected."
8268 echo "$xxx_convert NOT found." >&4
8272 case "$xxx_convert" in
8273 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
8274 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
8275 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
8276 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
8277 "$define$define$define")
8278 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
8279 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
8284 : see if _fwalk exists
8288 : Initialize h_fcntl
8291 : Initialize h_sysfile
8294 : access call always available on UNIX
8298 : locate the flags for 'access()'
8302 $cat >access.c <<'EOCP'
8303 #include <sys/types.h>
8308 #include <sys/file.h>
8317 : check sys/file.h first, no particular reason here
8318 if $test `./findhdr sys/file.h` && \
8319 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
8321 echo "<sys/file.h> defines the *_OK access constants." >&4
8322 elif $test `./findhdr fcntl.h` && \
8323 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
8325 echo "<fcntl.h> defines the *_OK access constants." >&4
8326 elif $test `./findhdr unistd.h` && \
8327 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
8328 echo "<unistd.h> defines the *_OK access constants." >&4
8330 echo "I can't find the four *_OK access constants--I'll use mine." >&4
8336 : see if accessx exists
8337 set accessx d_accessx
8340 : see if alarm exists
8344 : see if atolf exists
8348 : see if atoll exists
8352 : Look for GNU-cc style attribute checking
8354 echo "Checking whether your compiler can handle __attribute__ ..." >&4
8355 $cat >attrib.c <<'EOCP'
8357 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
8359 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
8360 if $contains 'warning' attrib.out >/dev/null 2>&1; then
8361 echo "Your C compiler doesn't fully support __attribute__."
8364 echo "Your C compiler supports __attribute__."
8368 echo "Your C compiler doesn't seem to understand __attribute__ at all."
8375 : see if bcmp exists
8379 : see if bcopy exists
8383 : see if this is a unistd.h system
8384 set unistd.h i_unistd
8387 : see if getpgrp exists
8388 set getpgrp d_getpgrp
8391 case "$d_getpgrp" in
8394 echo "Checking to see which flavor of getpgrp is in use..."
8397 #include <sys/types.h>
8399 # include <unistd.h>
8403 if (getuid() == 0) {
8404 printf("(I see you are running Configure as super-user...)\n");
8408 if (getpgrp(1) == 0)
8417 if $cc -o set -DTRY_BSD_PGRP $ccflags $ldflags set.c $libs >/dev/null 2>&1 && ./set; then
8418 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
8420 elif $cc -o set $ccflags $ldflags set.c $libs >/dev/null 2>&1 && ./set; then
8421 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
8424 echo "I can't seem to compile and run the test program."
8426 xxx="a USG one, i.e. you use getpgrp()."
8428 # SVR4 systems can appear rather BSD-ish.
8431 xxx="a BSD one, i.e. you use getpgrp(pid)."
8435 xxx="probably a USG one, i.e. you use getpgrp()."
8440 echo "Assuming your getpgrp is $xxx" >&4
8449 : see if setpgrp exists
8450 set setpgrp d_setpgrp
8453 case "$d_setpgrp" in
8456 echo "Checking to see which flavor of setpgrp is in use..."
8459 #include <sys/types.h>
8461 # include <unistd.h>
8465 if (getuid() == 0) {
8466 printf("(I see you are running Configure as super-user...)\n");
8470 if (-1 == setpgrp(1, 1))
8473 if (setpgrp() != -1)
8479 if $cc -o set -DTRY_BSD_PGRP $ccflags $ldflags set.c $libs >/dev/null 2>&1 && ./set; then
8480 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
8482 elif $cc -o set $ccflags $ldflags set.c $libs >/dev/null 2>&1 && ./set; then
8483 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
8486 echo "(I can't seem to compile and run the test program.)"
8488 xxx="a USG one, i.e. you use setpgrp()."
8490 # SVR4 systems can appear rather BSD-ish.
8493 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
8497 xxx="probably a USG one, i.e. you use setpgrp()."
8502 echo "Assuming your setpgrp is $xxx" >&4
8510 : see if bzero exists
8514 : see if signal is declared as pointer to function returning int or void
8516 xxx=`./findhdr signal.h`
8517 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
8518 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
8519 echo "You have int (*signal())() instead of void." >&4
8521 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
8522 echo "You have void (*signal())()." >&4
8524 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
8525 echo "You have int (*signal())() instead of void." >&4
8527 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
8528 echo "You have void (*signal())()." >&4
8531 case "$d_voidsig" in
8533 echo "I can't determine whether signal handler returns void or int..." >&4
8535 rp="What type does your signal handler return?"
8542 echo "As you already told me, signal handler returns void." >&4
8545 *) echo "As you already told me, signal handler returns int." >&4
8552 case "$d_voidsig" in
8553 "$define") signal_t="void";;
8558 : check for ability to cast large floats to 32-bit ints.
8560 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
8561 if $test "$intsize" -ge 4; then
8568 #include <sys/types.h>
8570 $signal_t blech(s) int s; { exit(3); }
8577 signal(SIGFPE, blech);
8579 /* Don't let compiler optimize the test away. Store the number
8580 in a writable string for gcc to pass to sscanf under HP/UX.
8582 sprintf(str, "2147483647");
8583 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
8587 /* x86 processors will probably give 0x8000 0000, which is a
8588 sign change. We don't want that. We want to mimic SPARC
8589 behavior here, which is to preserve the sign and give
8592 if (i32 != ($xxx) f)
8598 if eval $compile_ok; then
8602 echo "(I can't seem to compile the test program--assuming it can't)"
8610 echo "Nope, it can't."
8617 : check for ability to cast negative floats to unsigned
8619 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
8622 #include <sys/types.h>
8624 $signal_t blech(s) int s; { exit(7); }
8625 $signal_t blech_in_list(s) int s; { exit(4); }
8626 unsigned long dummy_long(p) unsigned long p; { return p; }
8627 unsigned int dummy_int(p) unsigned int p; { return p; }
8628 unsigned short dummy_short(p) unsigned short p; { return p; }
8632 unsigned long along;
8634 unsigned short ashort;
8638 /* Frustrate gcc-2.7.2's optimizer which failed this test with
8639 a direct f = -123. assignment. gcc-2.8.0 reportedly
8640 optimized the whole file away
8642 /* Store the number in a writable string for gcc to pass to
8645 sprintf(str, "-123");
8646 sscanf(str, "%lf", &f); /* f = -123.; */
8648 signal(SIGFPE, blech);
8649 along = (unsigned long)f;
8650 aint = (unsigned int)f;
8651 ashort = (unsigned short)f;
8652 if (along != (unsigned long)-123)
8654 if (aint != (unsigned int)-123)
8656 if (ashort != (unsigned short)-123)
8658 sprintf(str, "1073741824.");
8659 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
8662 along = (unsigned long)f;
8663 if (along != 0x80000000)
8667 along = (unsigned long)f;
8668 if (along != 0x7fffffff)
8672 along = (unsigned long)f;
8673 if (along != 0x80000001)
8677 signal(SIGFPE, blech_in_list);
8678 sprintf(str, "123.");
8679 sscanf(str, "%lf", &f); /* f = 123.; */
8680 along = dummy_long((unsigned long)f);
8681 aint = dummy_int((unsigned int)f);
8682 ashort = dummy_short((unsigned short)f);
8683 if (along != (unsigned long)123)
8685 if (aint != (unsigned int)123)
8687 if (ashort != (unsigned short)123)
8694 if eval $compile_ok; then
8698 echo "(I can't seem to compile the test program--assuming it can't)"
8701 case "$castflags" in
8706 echo "Nope, it can't."
8713 : see if vprintf exists
8715 if set vprintf val -f d_vprintf; eval $csym; $val; then
8716 echo 'vprintf() found.' >&4
8718 $cat >vprintf.c <<'EOF'
8719 #include <varargs.h>
8721 int main() { xxx("foo"); }
8730 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
8734 if eval $compile && ./vprintf; then
8735 echo "Your vsprintf() returns (int)." >&4
8738 echo "Your vsprintf() returns (char*)." >&4
8742 echo 'vprintf() NOT found.' >&4
8752 : see if chown exists
8756 : see if chroot exists
8760 : see if chsize exists
8764 hasstruct='varname=$1; struct=$2; shift; shift;
8765 while $test $# -ge 2; do
8767 $define) echo "#include <$2>";;
8771 echo "int main () { struct $struct foo; }" >> try.c;
8773 if eval $compile; then
8782 : see if sys/types.h has to be included
8783 set sys/types.h i_systypes
8786 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
8787 while $test $# -ge 2; do
8789 $define) echo "#include <$2>";;
8793 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
8795 if eval $compile; then
8806 : see whether socket exists
8808 $echo $n "Hmm... $c" >&4
8809 if set socket val -f d_socket; eval $csym; $val; then
8810 echo "Looks like you have Berkeley networking support." >&4
8812 if set setsockopt val -f; eval $csym; $val; then
8815 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
8819 if $contains socklib libc.list >/dev/null 2>&1; then
8820 echo "Looks like you have Berkeley networking support." >&4
8822 : we will have to assume that it supports the 4.2 BSD interface
8825 echo "You don't have Berkeley networking in libc$_a..." >&4
8826 if test "X$d_socket" = "X$define"; then
8827 echo "...but you seem to believe that you have sockets." >&4
8829 for net in net socket
8831 if test -f /usr/lib/lib$net$_a; then
8832 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
8833 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
8834 if $contains socket libc.list >/dev/null 2>&1; then
8839 echo "...but the Wollongong group seems to have hacked it in." >&4
8840 sockethdr="-I/usr/netinclude"
8843 echo "Found Berkeley sockets interface in lib$net." >& 4
8844 if $contains setsockopt libc.list >/dev/null 2>&1; then
8847 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
8854 if test "X$d_socket" != "X$define"; then
8855 echo "or anywhere else I see." >&4
8863 : see if socketpair exists
8864 set socketpair d_sockpair
8869 echo "Checking the availability of certain socket constants..." >& 4
8870 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
8871 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
8873 #include <sys/types.h>
8874 #include <sys/socket.h>
8880 set try; if eval $compile; then
8883 set d_${enum}; eval $setvar
8887 : see if this is a sys/uio.h system
8888 set sys/uio.h i_sysuio
8893 echo "Checking to see if your system supports struct cmsghdr..." >&4
8894 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
8896 case "$d_cmsghdr_s" in
8897 "$define") echo "Yes, it does." ;;
8898 *) echo "No, it doesn't." ;;
8902 : check for const keyword
8904 echo 'Checking to see if your C compiler knows about "const"...' >&4
8905 $cat >const.c <<'EOCP'
8906 typedef struct spug { int drokk; } spug;
8913 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
8915 echo "Yup, it does."
8918 echo "Nope, it doesn't."
8923 : see if crypt exists
8925 if set crypt val -f d_crypt; eval $csym; $val; then
8926 echo 'crypt() found.' >&4
8930 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
8931 if $test -z "$cryptlib"; then
8932 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
8936 if $test -z "$cryptlib"; then
8937 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
8941 if $test -z "$cryptlib"; then
8942 cryptlib=`./loc libcrypt$_a "" $libpth`
8946 if $test -z "$cryptlib"; then
8947 echo 'crypt() NOT found.' >&4
8956 : get csh whereabouts
8958 'csh') val="$undef" ;;
8963 : Respect a hint or command line value for full_csh.
8965 '') full_csh=$csh ;;
8968 : see if cuserid exists
8969 set cuserid d_cuserid
8972 : see if this is a limits.h system
8973 set limits.h i_limits
8976 : see if this is a float.h system
8980 : See if number of significant digits in a double precision number is known
8982 $cat >dbl_dig.c <<EOM
8992 printf("Contains DBL_DIG");
8995 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
8996 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
8997 echo "DBL_DIG found." >&4
9000 echo "DBL_DIG NOT found." >&4
9007 : see if difftime exists
9008 set difftime d_difftime
9011 : see if this is a dirent system
9013 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
9015 echo "<dirent.h> found." >&4
9018 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
9019 echo "<sys/dir.h> found." >&4
9022 xinc=`./findhdr sys/ndir.h`
9024 echo "<dirent.h> NOT found." >&4
9029 : Look for type of directory structure.
9031 $cppstdin $cppflags $cppminus < "$xinc" > try.c
9033 case "$direntrytype" in
9036 $define) guess1='struct dirent' ;;
9037 *) guess1='struct direct' ;;
9040 *) guess1="$direntrytype"
9045 'struct dirent') guess2='struct direct' ;;
9046 *) guess2='struct dirent' ;;
9049 if $contains "$guess1" try.c >/dev/null 2>&1; then
9050 direntrytype="$guess1"
9051 echo "Your directory entries are $direntrytype." >&4
9052 elif $contains "$guess2" try.c >/dev/null 2>&1; then
9053 direntrytype="$guess2"
9054 echo "Your directory entries seem to be $direntrytype." >&4
9056 echo "I don't recognize your system's directory entries." >&4
9057 rp="What type is used for directory entries on this system?"
9065 : see if the directory entry stores field length
9067 $cppstdin $cppflags $cppminus < "$xinc" > try.c
9068 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
9069 echo "Good, your directory entry keeps length information in d_namlen." >&4
9072 echo "Your directory entry does not know about the d_namlen field." >&4
9079 : see if dlerror exists
9082 set dlerror d_dlerror
9086 : see if dlfcn is available
9094 On a few systems, the dynamically loaded modules that perl generates and uses
9095 will need a different extension than shared libs. The default will probably
9103 rp='What is the extension of dynamically loaded modules'
9112 : Check if dlsym need a leading underscore
9118 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
9119 $cat >dyna.c <<'EOM'
9128 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
9130 #include <sys/types.h>
9144 int mode = RTLD_LAZY ;
9146 handle = dlopen("./dyna.$dlext", mode) ;
9147 if (handle == NULL) {
9152 symbol = dlsym(handle, "fred") ;
9153 if (symbol == NULL) {
9154 /* try putting a leading underscore */
9155 symbol = dlsym(handle, "_fred") ;
9156 if (symbol == NULL) {
9169 : Call the object file tmp-dyna.o in case dlext=o.
9170 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
9171 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
9172 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
9173 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then
9176 1) echo "Test program failed using dlopen." >&4
9177 echo "Perhaps you should not use dynamic loading." >&4;;
9178 2) echo "Test program failed using dlsym." >&4
9179 echo "Perhaps you should not use dynamic loading." >&4;;
9180 3) echo "dlsym needs a leading underscore" >&4
9182 4) echo "dlsym doesn't need a leading underscore." >&4;;
9185 echo "I can't compile and run the test program." >&4
9186 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
9191 $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
9196 hasproto='varname=$1; func=$2; shift; shift;
9197 while $test $# -ge 2; do
9199 $define) echo "#include <$2>";;
9203 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
9204 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
9205 echo "$func() prototype found.";
9208 echo "$func() prototype NOT found.";
9213 $rm -f try.c tryout.c'
9215 : see if prototype for drand48 is available
9217 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
9220 : see if dup2 exists
9224 : see if eaccess exists
9225 set eaccess d_eaccess
9228 : see if endgrent exists
9229 set endgrent d_endgrent
9232 : see if endhostent exists
9233 set endhostent d_endhent
9236 : see if endnetent exists
9237 set endnetent d_endnent
9240 : see if endprotoent exists
9241 set endprotoent d_endpent
9244 : see if endpwent exists
9245 set endpwent d_endpwent
9248 : see if endservent exists
9249 set endservent d_endsent
9252 : Locate the flags for 'open()'
9254 $cat >open3.c <<'EOCP'
9255 #include <sys/types.h>
9260 #include <sys/file.h>
9271 : check sys/file.h first to get FREAD on Sun
9272 if $test `./findhdr sys/file.h` && \
9273 set open3 -DI_SYS_FILE && eval $compile; then
9275 echo "<sys/file.h> defines the O_* constants..." >&4
9277 echo "and you have the 3 argument form of open()." >&4
9280 echo "but not the 3 argument form of open(). Oh, well." >&4
9283 elif $test `./findhdr fcntl.h` && \
9284 set open3 -DI_FCNTL && eval $compile; then
9286 echo "<fcntl.h> defines the O_* constants..." >&4
9288 echo "and you have the 3 argument form of open()." >&4
9291 echo "but not the 3 argument form of open(). Oh, well." >&4
9296 echo "I can't find the O_* constant definitions! You got problems." >&4
9302 : see which of string.h or strings.h is needed
9304 strings=`./findhdr string.h`
9305 if $test "$strings" && $test -r "$strings"; then
9306 echo "Using <string.h> instead of <strings.h>." >&4
9310 strings=`./findhdr strings.h`
9311 if $test "$strings" && $test -r "$strings"; then
9312 echo "Using <strings.h> instead of <string.h>." >&4
9314 echo "No string header found -- You'll surely have problems." >&4
9320 "$undef") strings=`./findhdr strings.h`;;
9321 *) strings=`./findhdr string.h`;;
9324 : check for non-blocking I/O stuff
9325 case "$h_sysfile" in
9326 true) echo "#include <sys/file.h>" > head.c;;
9329 true) echo "#include <fcntl.h>" > head.c;;
9330 *) echo "#include <sys/fcntl.h>" > head.c;;
9335 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
9336 case "$o_nonblock" in
9339 $cat >>try.c <<'EOCP'
9343 printf("O_NONBLOCK\n");
9347 printf("O_NDELAY\n");
9351 printf("FNDELAY\n");
9358 if eval $compile_ok; then
9360 case "$o_nonblock" in
9361 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
9362 *) echo "Seems like we can use $o_nonblock.";;
9365 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
9368 *) echo "Using $hint value $o_nonblock.";;
9370 $rm -f try try.* .out core
9373 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
9379 #include <sys/types.h>
9382 #define MY_O_NONBLOCK $o_nonblock
9383 #ifndef errno /* XXX need better Configure test */
9394 #include <strings.h>
9396 $signal_t blech(x) int x; { exit(3); }
9398 $cat >> try.c <<'EOCP'
9406 pipe(pd); /* Down: child -> parent */
9407 pipe(pu); /* Up: parent -> child */
9410 close(pd[1]); /* Parent reads from pd[0] */
9411 close(pu[0]); /* Parent writes (blocking) to pu[1] */
9413 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
9418 signal(SIGALRM, blech);
9420 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
9422 sprintf(string, "%d\n", ret);
9423 write(2, string, strlen(string));
9426 if (errno == EAGAIN) {
9432 if (errno == EWOULDBLOCK)
9433 printf("EWOULDBLOCK\n");
9436 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
9437 sleep(2); /* Give it time to close our pipe */
9439 ret = read(pd[0], buf, 1); /* Should read EOF */
9441 sprintf(string, "%d\n", ret);
9442 write(3, string, strlen(string));
9446 close(pd[0]); /* We write to pd[1] */
9447 close(pu[1]); /* We read from pu[0] */
9448 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
9449 close(pd[1]); /* Pipe pd is now fully closed! */
9450 exit(0); /* Bye bye, thank you for playing! */
9454 if eval $compile_ok; then
9455 echo "$startsh" >mtry
9456 echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
9458 ./mtry >/dev/null 2>&1
9460 0) eagain=`$cat try.out`;;
9461 1) echo "Could not perform non-blocking setting!";;
9462 2) echo "I did a successful read() for something that was not there!";;
9463 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
9464 4) echo "Could not find F_SETFL!";;
9465 *) echo "Something terribly wrong happened during testing.";;
9467 rd_nodata=`$cat try.ret`
9468 echo "A read() system call with no data present returns $rd_nodata."
9469 case "$rd_nodata" in
9472 echo "(That's peculiar, fixing that to be -1.)"
9478 echo "Forcing errno EAGAIN on read() with no data available."
9482 echo "Your read() sets errno to $eagain when no data is available."
9485 status=`$cat try.err`
9487 0) echo "And it correctly returns 0 to signal EOF.";;
9488 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
9489 *) echo "However, your read() returns '$status' on EOF??";;
9492 if test "$status" = "$rd_nodata"; then
9493 echo "WARNING: you can't distinguish between EOF and no data!"
9497 echo "I can't compile the test program--assuming errno EAGAIN will do."
9504 echo "Using $hint value $eagain."
9505 echo "Your read() returns $rd_nodata when no data is present."
9506 case "$d_eofnblk" in
9507 "$define") echo "And you can see EOF because read() returns 0.";;
9508 "$undef") echo "But you can't see EOF status from read() returned value.";;
9510 echo "(Assuming you can't see EOF status from read anyway.)"
9516 $rm -f try try.* .out core head.c mtry
9518 : see if fchmod exists
9522 : see if fchown exists
9526 : see if this is an fcntl system
9531 : See if fcntl-based locking works.
9532 $cat >try.c <<'EOCP'
9537 #if defined(F_SETLK) && defined(F_SETLKW)
9540 fd = open("try.c", O_RDONLY);
9541 flock.l_type = F_RDLCK;
9542 flock.l_whence = SEEK_SET;
9543 flock.l_start = flock.l_len = 0;
9544 retval = fcntl(fd, F_SETLK, &flock);
9546 (retval < 0 ? exit(2) : exit(0));
9552 echo "Checking if fcntl-based file locking works... "
9556 if eval $compile_ok; then
9558 echo "Yes, it seems to work."
9561 echo "Nope, it didn't work."
9565 echo "I'm unable to compile the test program, so I'll assume not."
9570 echo "Nope, since you don't even have fcntl()."
9573 set d_fcntl_can_lock
9578 : see if sys/select.h has to be included
9579 set sys/select.h i_sysselct
9582 : see if we should include time.h, sys/time.h, or both
9584 if test "X$timeincl" = X; then
9585 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9586 $echo $n "I'm now running the test program...$c"
9587 $cat >try.c <<'EOCP'
9588 #include <sys/types.h>
9593 #ifdef SYSTIMEKERNEL
9596 #include <sys/time.h>
9599 #include <sys/select.h>
9608 struct timezone tzp;
9610 if (foo.tm_sec == foo.tm_sec)
9613 if (bar.tv_sec == bar.tv_sec)
9620 for s_timezone in '-DS_TIMEZONE' ''; do
9622 for s_timeval in '-DS_TIMEVAL' ''; do
9623 for i_systimek in '' '-DSYSTIMEKERNEL'; do
9624 for i_time in '' '-DI_TIME'; do
9625 for i_systime in '-DI_SYSTIME' ''; do
9628 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
9629 if eval $compile; then
9630 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
9634 $echo $n "Succeeded with $flags$c"
9646 *SYSTIMEKERNEL*) i_systimek="$define"
9647 timeincl=`./findhdr sys/time.h`
9648 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
9649 *) i_systimek="$undef";;
9652 *I_TIME*) i_time="$define"
9653 timeincl=`./findhdr time.h`" $timeincl"
9654 echo "We'll include <time.h>." >&4;;
9655 *) i_time="$undef";;
9658 *I_SYSTIME*) i_systime="$define"
9659 timeincl=`./findhdr sys/time.h`" $timeincl"
9660 echo "We'll include <sys/time.h>." >&4;;
9661 *) i_systime="$undef";;
9666 : check for fd_set items
9669 Checking to see how well your C compiler handles fd_set and friends ...
9671 $cat >fd_set.c <<EOCP
9672 #$i_systime I_SYS_TIME
9673 #$i_sysselct I_SYS_SELECT
9674 #$d_socket HAS_SOCKET
9675 #include <sys/types.h>
9677 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
9680 #include <sys/time.h>
9683 #include <sys/select.h>
9692 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
9699 set fd_set -DTRYBITS
9700 if eval $compile; then
9701 d_fds_bits="$define"
9703 echo "Well, your system knows about the normal fd_set typedef..." >&4
9705 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
9706 d_fd_macros="$define"
9709 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
9711 d_fd_macros="$undef"
9715 Hmm, your compiler has some difficulty with fd_set. Checking further...
9718 if eval $compile; then
9721 echo "Well, your system has some sort of fd_set available..." >&4
9723 echo "and you have the normal fd_set macros." >&4
9724 d_fd_macros="$define"
9727 but not the normal fd_set macros! Gross! More work for me...
9729 d_fd_macros="$undef"
9732 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
9735 d_fd_macros="$undef"
9740 : see if fgetpos exists
9741 set fgetpos d_fgetpos
9744 : see if flock exists
9748 : see if fork exists
9752 : see if pathconf exists
9753 set pathconf d_pathconf
9756 : see if fpathconf exists
9757 set fpathconf d_fpathconf
9761 : check for fpos64_t
9763 echo "Checking to see if you have fpos64_t..." >&4
9766 int main() { fpos64_t x = 7; }
9769 if eval $compile; then
9771 echo "You have fpos64_t."
9774 echo "You do not have fpos64_t."
9776 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
9783 : see if frexpl exists
9787 : see if this is a sys/param system
9788 set sys/param.h i_sysparam
9791 : see if this is a sys/mount.h system
9792 set sys/mount.h i_sysmount
9797 echo "Checking to see if your system supports struct fs_data..." >&4
9798 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
9800 case "$d_fs_data_s" in
9801 "$define") echo "Yes, it does." ;;
9802 *) echo "No, it doesn't." ;;
9805 : see if fseeko exists
9809 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
9812 : see if fsetpos exists
9813 set fsetpos d_fsetpos
9817 : see if fstatfs exists
9818 set fstatfs d_fstatfs
9822 : see if statvfs exists
9823 set statvfs d_statvfs
9826 : see if fstatvfs exists
9827 set fstatvfs d_fstatvfs
9831 : see if fsync exists
9835 : see if ftello exists
9839 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
9842 : see if getcwd exists
9846 : see if getespwnam exists
9847 set getespwnam d_getespwnam
9851 : see if getfsstat exists
9852 set getfsstat d_getfsstat
9855 : see if getgrent exists
9856 set getgrent d_getgrent
9859 : see if gethostbyaddr exists
9860 set gethostbyaddr d_gethbyaddr
9863 : see if gethostbyname exists
9864 set gethostbyname d_gethbyname
9867 : see if gethostent exists
9868 set gethostent d_gethent
9871 : see how we will look up host name
9874 if set gethostname val -f d_gethname; eval $csym; $val; then
9875 echo 'gethostname() found.' >&4
9876 d_gethname="$define"
9879 if set uname val -f d_uname; eval $csym; $val; then
9882 uname() was found, but you're running xenix, and older versions of xenix
9883 have a broken uname(). If you don't really know whether your xenix is old
9884 enough to have a broken system call, use the default answer.
9891 rp='Is your uname() broken?'
9894 n*) d_uname="$define"; call=uname;;
9897 echo 'uname() found.' >&4
9904 case "$d_gethname" in
9905 '') d_gethname="$undef";;
9908 '') d_uname="$undef";;
9910 case "$d_uname$d_gethname" in
9915 Every now and then someone has a $call() that lies about the hostname
9916 but can't be fixed for political or economic reasons. If you wish, I can
9917 pretend $call() isn't there and maybe compute hostname at run-time
9918 thanks to the '$phostname' command.
9921 rp="Shall I ignore $call() from now on?"
9924 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
9927 case "$phostname" in
9929 *) case "$aphostname" in
9935 file=`./loc $file $file $pth`
9936 aphostname=`echo $file $*`
9941 case "$d_uname$d_gethname" in
9944 case "$phostname" in
9946 echo "There will be no way for $package to get your hostname." >&4;;
9948 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
9952 case "$d_phostname" in
9953 '') d_phostname="$undef";;
9956 : see if this is a netdb.h system
9960 : see if prototypes for various gethostxxx netdb.h functions are available
9962 set d_gethostprotos gethostent $i_netdb netdb.h
9965 : see if getitimer exists
9966 set getitimer d_getitimer
9969 : see if getlogin exists
9970 set getlogin d_getlogin
9973 : see if getmnt exists
9977 : see if getmntent exists
9978 set getmntent d_getmntent
9981 : see if getnetbyaddr exists
9982 set getnetbyaddr d_getnbyaddr
9985 : see if getnetbyname exists
9986 set getnetbyname d_getnbyname
9989 : see if getnetent exists
9990 set getnetent d_getnent
9993 : see if prototypes for various getnetxxx netdb.h functions are available
9995 set d_getnetprotos getnetent $i_netdb netdb.h
9998 : see if getpagesize exists
9999 set getpagesize d_getpagsz
10003 : see if getprotobyname exists
10004 set getprotobyname d_getpbyname
10007 : see if getprotobynumber exists
10008 set getprotobynumber d_getpbynumber
10011 : see if getprotoent exists
10012 set getprotoent d_getpent
10015 : see if getpgid exists
10016 set getpgid d_getpgid
10019 : see if getpgrp2 exists
10020 set getpgrp2 d_getpgrp2
10023 : see if getppid exists
10024 set getppid d_getppid
10027 : see if getpriority exists
10028 set getpriority d_getprior
10031 : see if prototypes for various getprotoxxx netdb.h functions are available
10033 set d_getprotoprotos getprotoent $i_netdb netdb.h
10036 : see if getprpwnam exists
10037 set getprpwnam d_getprpwnam
10040 : see if getpwent exists
10041 set getpwent d_getpwent
10045 : see if getservbyname exists
10046 set getservbyname d_getsbyname
10049 : see if getservbyport exists
10050 set getservbyport d_getsbyport
10053 : see if getservent exists
10054 set getservent d_getsent
10057 : see if prototypes for various getservxxx netdb.h functions are available
10059 set d_getservprotos getservent $i_netdb netdb.h
10062 : see if getspnam exists
10063 set getspnam d_getspnam
10066 : see if gettimeofday or ftime exists
10067 set gettimeofday d_gettimeod
10069 case "$d_gettimeod" in
10075 val="$undef"; set d_ftime; eval $setvar
10078 case "$d_gettimeod$d_ftime" in
10081 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
10085 : see if this is an grp system
10091 xxx=`./findhdr grp.h`
10092 $cppstdin $cppflags $cppminus < $xxx >$$.h
10094 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
10106 set d_grpasswd; eval $setvar
10110 : see if hasmntopt exists
10111 set hasmntopt d_hasmntopt
10114 : see if this is a netinet/in.h or sys/in.h system
10115 set netinet/in.h i_niin sys/in.h i_sysin
10118 : see if arpa/inet.h has to be included
10119 set arpa/inet.h i_arpainet
10122 : see if htonl --and friends-- exists
10127 : Maybe they are macros.
10130 $cat >htonl.c <<EOM
10132 #include <sys/types.h>
10133 #$i_niin I_NETINET_IN
10135 #$i_arpainet I_ARPA_INET
10136 #ifdef I_NETINET_IN
10137 #include <netinet/in.h>
10140 #include <sys/in.h>
10143 #include <arpa/inet.h>
10146 printf("Defined as a macro.");
10149 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
10150 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
10152 echo "But it seems to be defined as a macro." >&4
10160 : see if iconv exists
10166 if set index val -f; eval $csym; $val; then
10167 if set strchr val -f d_strchr; eval $csym; $val; then
10168 if $contains strchr "$strings" >/dev/null 2>&1 ; then
10171 echo "strchr() found." >&4
10175 echo "index() found." >&4
10180 echo "index() found." >&4
10183 if set strchr val -f d_strchr; eval $csym; $val; then
10186 echo "strchr() found." >&4
10188 echo "No index() or strchr() found!" >&4
10193 set d_strchr; eval $setvar
10195 set d_index; eval $setvar
10197 : check whether inet_aton exists
10198 set inet_aton d_inetaton
10203 $cat >isascii.c <<'EOCP'
10215 if eval $compile; then
10216 echo "isascii() found." >&4
10219 echo "isascii() NOT found." >&4
10226 : see if isnan exists
10230 : see if isnanl exists
10231 set isnanl d_isnanl
10234 : see if killpg exists
10235 set killpg d_killpg
10238 : see if lchown exists
10240 $cat > try.c <<'EOCP'
10241 /* System header to define __stub macros and hopefully few prototypes,
10242 which can conflict with char lchown(); below. */
10243 #include <assert.h>
10244 /* Override any gcc2 internal prototype to avoid an error. */
10245 /* We use char because int might match the return type of a gcc2
10246 builtin and then its argument prototype would still apply. */
10249 /* The GNU C library defines this for functions which it implements
10250 to always fail with ENOSYS. Some functions are actually named
10251 something starting with __ and the normal name is an alias. */
10252 #if defined (__stub_lchown) || defined (__stub___lchown)
10260 if eval $compile; then
10261 $echo "lchown() found." >&4
10264 $echo "lchown() NOT found." >&4
10270 : See if number of significant digits in a double precision number is known
10272 $cat >ldbl_dig.c <<EOM
10273 #$i_limits I_LIMITS
10276 #include <limits.h>
10282 printf("Contains LDBL_DIG");
10285 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
10286 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
10287 echo "LDBL_DIG found." >&4
10290 echo "LDBL_DIG NOT found." >&4
10297 : see if link exists
10301 : see if localeconv exists
10302 set localeconv d_locconv
10305 : see if lockf exists
10309 : see if prototype for lseek is available
10311 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
10314 : see if lstat exists
10318 : see if madvise exists
10319 set madvise d_madvise
10322 : see if mblen exists
10326 : see if mbstowcs exists
10327 set mbstowcs d_mbstowcs
10330 : see if mbtowc exists
10331 set mbtowc d_mbtowc
10334 : see if memchr exists
10335 set memchr d_memchr
10338 : see if memcmp exists
10339 set memcmp d_memcmp
10342 : see if memcpy exists
10343 set memcpy d_memcpy
10346 : see if memmove exists
10347 set memmove d_memmove
10350 : see if memset exists
10351 set memset d_memset
10354 : see if mkdir exists
10358 : see if mkdtemp exists
10359 set mkdtemp d_mkdtemp
10362 : see if mkfifo exists
10363 set mkfifo d_mkfifo
10366 : see if mkstemp exists
10367 set mkstemp d_mkstemp
10370 : see if mkstemps exists
10371 set mkstemps d_mkstemps
10374 : see if mktime exists
10375 set mktime d_mktime
10378 : see if this is a sys/mman.h system
10379 set sys/mman.h i_sysmman
10382 : see if mmap exists
10385 : see what shmat returns
10386 : default to something harmless
10388 case "$i_sysmman$d_mmap" in
10390 $cat >mmap.c <<'END'
10391 #include <sys/mman.h>
10394 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
10399 echo "and it returns ($mmaptype)." >&4
10405 : see if modfl exists
10409 : see if mprotect exists
10410 set mprotect d_mprotect
10413 : see if msgctl exists
10414 set msgctl d_msgctl
10417 : see if msgget exists
10418 set msgget d_msgget
10421 : see if msgsnd exists
10422 set msgsnd d_msgsnd
10425 : see if msgrcv exists
10426 set msgrcv d_msgrcv
10429 : see how much of the 'msg*(2)' library is present.
10432 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
10433 *"$undef"*) h_msg=false;;
10437 case "`ipcs 2>&1`" in
10438 "SVID messages"*"not configured"*)
10439 echo "Your $osname does not have the msg*(2) configured." >&4
10442 set msgctl d_msgctl
10444 set msgget d_msgget
10446 set msgsnd d_msgsnd
10448 set msgrcv d_msgrcv
10454 : we could also check for sys/ipc.h ...
10455 if $h_msg && $test `./findhdr sys/msg.h`; then
10456 echo "You have the full msg*(2) library." >&4
10459 echo "You don't have the full msg*(2) library." >&4
10467 echo "Checking to see if your system supports struct msghdr..." >&4
10468 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
10470 case "$d_msghdr_s" in
10471 "$define") echo "Yes, it does." ;;
10472 *) echo "No, it doesn't." ;;
10476 : see if msync exists
10480 : see if munmap exists
10481 set munmap d_munmap
10484 : see if nice exists
10488 : check for length of character
10490 case "$charsize" in
10492 echo "Checking to see how big your characters are (hey, you never know)..." >&4
10493 $cat >try.c <<'EOCP'
10497 printf("%d\n", (int)sizeof(char));
10502 if eval $compile_ok; then
10506 echo "(I can't seem to compile the test program. Guessing...)"
10513 rp="What is the size of a character (in bytes)?"
10518 : check for volatile keyword
10520 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
10521 $cat >try.c <<'EOCP'
10524 typedef struct _goo_struct goo_struct;
10525 goo_struct * volatile goo = ((goo_struct *)0);
10526 struct _goo_struct {
10531 typedef unsigned short foo_t;
10532 char *volatile foo;
10534 volatile foo_t blech;
10538 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
10540 echo "Yup, it does."
10543 echo "Nope, it doesn't."
10551 $echo "Choosing the C types to be used for Perl's internal types..." >&4
10553 case "$use64bitint:$d_quad:$quadtype" in
10556 uvtype="$uquadtype"
10561 uvtype="unsigned long"
10567 case "$uselongdouble:$d_longdbl" in
10569 nvtype="long double"
10570 nvsize=$longdblsize
10577 $echo "(IV will be "$ivtype", $ivsize bytes)"
10578 $echo "(UV will be "$uvtype", $uvsize bytes)"
10579 $echo "(NV will be "$nvtype", $nvsize bytes)"
10582 #$i_inttypes I_INTTYPES
10584 #include <inttypes.h>
10589 int8_t i = INT8_MAX;
10590 uint8_t u = UINT8_MAX;
10591 printf("int8_t\n");
10594 int16_t i = INT16_MAX;
10595 uint16_t i = UINT16_MAX;
10596 printf("int16_t\n");
10599 int32_t i = INT32_MAX;
10600 uint32_t u = UINT32_MAX;
10601 printf("int32_t\n");
10607 '') case "$charsize" in
10609 u8type="unsigned char"
10618 if eval $compile; then
10619 case "`./try$exe_ext`" in
10620 int8_t) i8type=int8_t
10630 '') if $test $charsize -ge 1; then
10632 u8type="unsigned char"
10640 '') case "$shortsize" in
10642 u16type="unsigned short"
10650 '') set try -DINT16
10651 if eval $compile; then
10652 case "`./try$exe_ext`" in
10664 '') if $test $shortsize -ge 2; then
10666 u16type="unsigned short"
10674 '') case "$longsize" in
10676 u32type="unsigned long"
10680 *) case "$intsize" in
10682 u32type="unsigned int"
10692 '') set try -DINT32
10693 if eval $compile; then
10694 case "`./try$exe_ext`" in
10706 '') if $test $intsize -ge 4; then
10708 u32type="unsigned int"
10716 '') case "$d_quad:$quadtype" in
10718 i64type="$quadtype"
10719 u64type="$uquadtype"
10727 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
10728 : volatile so that the compiler has to store it out to memory.
10729 if test X"$d_volatile" = X"$define"; then
10734 #include <sys/types.h>
10735 #include <signal.h>
10737 $volatile int bletched = 0;
10738 $signal_t blech(s) int s; { bletched = 1; }
10743 int n = 8 * $uvsize;
10746 signal(SIGFPE, blech);
10749 for (i = 0; i < n; i++) {
10750 u = u << 1 | ($uvtype)1;
10752 if (($uvtype)d != u)
10756 d = ($nvtype)(u - 1);
10757 if (($uvtype)d != (u - 1))
10765 printf("%d\n", ((i == n) ? -n : i));
10771 d_nv_preserves_uv="$undef"
10772 if eval $compile; then
10773 d_nv_preserves_uv_bits="`./try$exe_ext`"
10775 case "$d_nv_preserves_uv_bits" in
10777 d_nv_preserves_uv_bits=`expr 0 - $d_nv_preserves_uv_bits`
10778 $echo "Your NVs can preserve all $d_nv_preserves_uv_bits bits of your UVs." 2>&1
10779 d_nv_preserves_uv="$define"
10781 [1-9]*) $echo "Your NVs can preserve only $d_nv_preserves_uv_bits bits of your UVs." 2>&1
10782 d_nv_preserves_uv="$undef" ;;
10783 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
10784 d_nv_preserves_uv_bits="$undef" ;;
10790 : check for off64_t
10792 echo "Checking to see if you have off64_t..." >&4
10794 #include <sys/types.h>
10795 #include <unistd.h>
10796 int main() { off64_t x = 7; }
10799 if eval $compile; then
10801 echo "You have off64_t."
10804 echo "You do not have off64_t."
10805 case "$lseeksize" in
10806 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
10813 : see if POSIX threads are available
10814 set pthread.h i_pthread
10820 : how to create joinable pthreads
10821 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
10823 echo "Checking what constant to use for creating joinable pthreads..." >&4
10824 $cat >try.c <<'EOCP'
10825 #include <pthread.h>
10827 int detachstate = JOINABLE;
10830 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
10831 if eval $compile; then
10832 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
10833 val="$undef" # Yes, undef.
10834 set d_old_pthread_create_joinable
10837 set old_pthread_create_joinable
10840 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
10841 if eval $compile; then
10842 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
10844 set d_old_pthread_create_joinable
10846 val=PTHREAD_CREATE_UNDETACHED
10847 set old_pthread_create_joinable
10850 set try -DJOINABLE=__UNDETACHED
10851 if eval $compile; then
10852 echo "You seem to use __UNDETACHED." >&4
10854 set d_old_pthread_create_joinable
10857 set old_pthread_create_joinable
10860 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
10862 set d_old_pthread_create_joinable
10865 set old_pthread_create_joinable
10872 d_old_pthread_create_joinable="$undef"
10873 old_pthread_create_joinable=""
10876 : see if pause exists
10880 : see if pipe exists
10884 : see if poll exists
10889 : see whether the various POSIXish _yields exist
10891 #include <pthread.h>
10897 #ifdef PTHREAD_YIELD
10900 #ifdef PTHREAD_YIELD_NULL
10901 pthread_yield(NULL);
10907 : see if sched_yield exists
10908 set try -DSCHED_YIELD
10909 if eval $compile; then
10911 sched_yield='sched_yield()'
10915 case "$usethreads" in
10918 $define) echo 'sched_yield() found.' >&4 ;;
10919 *) echo 'sched_yield() NOT found.' >&4 ;;
10925 : see if pthread_yield exists
10926 set try -DPTHREAD_YIELD
10927 if eval $compile; then
10929 case "$sched_yield" in
10930 '') sched_yield='pthread_yield()' ;;
10933 set try -DPTHREAD_YIELD_NULL
10934 if eval $compile; then
10936 case "$sched_yield" in
10937 '') sched_yield='pthread_yield(NULL)' ;;
10943 case "$usethreads" in
10946 $define) echo 'pthread_yield() found.' >&4 ;;
10947 *) echo 'pthread_yield() NOT found.' >&4 ;;
10951 set d_pthread_yield
10954 case "$sched_yield" in
10955 '') sched_yield=undef ;;
10960 : see if this is a pwd.h system
10966 xxx=`./findhdr pwd.h`
10967 $cppstdin $cppflags $cppminus < $xxx >$$.h
10969 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
10977 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
10985 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
10993 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
11001 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
11009 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
11017 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
11025 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
11037 set d_pwquota; eval $setvar
11038 set d_pwage; eval $setvar
11039 set d_pwchange; eval $setvar
11040 set d_pwclass; eval $setvar
11041 set d_pwexpire; eval $setvar
11042 set d_pwcomment; eval $setvar
11043 set d_pwgecos; eval $setvar
11044 set d_pwpasswd; eval $setvar
11048 : see if readdir and friends exist
11049 set readdir d_readdir
11051 set seekdir d_seekdir
11053 set telldir d_telldir
11055 set rewinddir d_rewinddir
11058 : see if readlink exists
11059 set readlink d_readlink
11062 : see if readv exists
11066 : see if realpath exists
11067 set realpath d_realpath
11070 : see if recvmsg exists
11071 set recvmsg d_recvmsg
11074 : see if rename exists
11075 set rename d_rename
11078 : see if rmdir exists
11082 : see if memory.h is available.
11087 : See if it conflicts with string.h
11093 $cppstdin $cppflags $cppminus < $strings > mem.h
11094 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
11096 echo "We won't be including <memory.h>."
11106 : can bcopy handle overlapping blocks?
11111 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
11113 #$i_memory I_MEMORY
11114 #$i_stdlib I_STDLIB
11115 #$i_string I_STRING
11116 #$i_unistd I_UNISTD
11118 $cat >>try.c <<'EOCP'
11121 # include <memory.h>
11124 # include <stdlib.h>
11127 # include <string.h>
11129 # include <strings.h>
11132 # include <unistd.h> /* Needed for NetBSD */
11136 char buf[128], abc[128];
11142 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
11144 for (align = 7; align >= 0; align--) {
11145 for (len = 36; len; len--) {
11147 bcopy(abc, b, len);
11148 for (off = 1; off <= len; off++) {
11149 bcopy(b, b+off, len);
11150 bcopy(b+off, b, len);
11151 if (bcmp(b, abc, len))
11160 if eval $compile_ok; then
11161 if ./try 2>/dev/null; then
11162 echo "Yes, it can."
11165 echo "It can't, sorry."
11166 case "$d_memmove" in
11167 "$define") echo "But that's Ok since you have memmove()." ;;
11171 echo "(I can't compile the test program, so we'll assume not...)"
11172 case "$d_memmove" in
11173 "$define") echo "But that's Ok since you have memmove()." ;;
11178 $rm -f try.* try core
11182 : can memcpy handle overlapping blocks?
11184 case "$d_memcpy" in
11187 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
11189 #$i_memory I_MEMORY
11190 #$i_stdlib I_STDLIB
11191 #$i_string I_STRING
11192 #$i_unistd I_UNISTD
11194 $cat >>try.c <<'EOCP'
11197 # include <memory.h>
11200 # include <stdlib.h>
11203 # include <string.h>
11205 # include <strings.h>
11208 # include <unistd.h> /* Needed for NetBSD */
11212 char buf[128], abc[128];
11218 /* Copy "abcde..." string to char abc[] so that gcc doesn't
11219 try to store the string in read-only memory. */
11220 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
11222 for (align = 7; align >= 0; align--) {
11223 for (len = 36; len; len--) {
11225 memcpy(b, abc, len);
11226 for (off = 1; off <= len; off++) {
11227 memcpy(b+off, b, len);
11228 memcpy(b, b+off, len);
11229 if (memcmp(b, abc, len))
11238 if eval $compile_ok; then
11239 if ./try 2>/dev/null; then
11240 echo "Yes, it can."
11243 echo "It can't, sorry."
11244 case "$d_memmove" in
11245 "$define") echo "But that's Ok since you have memmove()." ;;
11249 echo "(I can't compile the test program, so we'll assume not...)"
11250 case "$d_memmove" in
11251 "$define") echo "But that's Ok since you have memmove()." ;;
11256 $rm -f try.* try core
11260 : can memcmp be trusted to compare relative magnitude?
11262 case "$d_memcmp" in
11265 echo "Checking if your memcmp() can compare relative magnitude..." >&4
11267 #$i_memory I_MEMORY
11268 #$i_stdlib I_STDLIB
11269 #$i_string I_STRING
11270 #$i_unistd I_UNISTD
11272 $cat >>try.c <<'EOCP'
11275 # include <memory.h>
11278 # include <stdlib.h>
11281 # include <string.h>
11283 # include <strings.h>
11286 # include <unistd.h> /* Needed for NetBSD */
11292 if ((a < b) && memcmp(&a, &b, 1) < 0)
11298 if eval $compile_ok; then
11299 if ./try 2>/dev/null; then
11300 echo "Yes, it can."
11303 echo "No, it can't (it uses signed chars)."
11306 echo "(I can't compile the test program, so we'll assume not...)"
11310 $rm -f try.* try core
11314 : see if prototype for sbrk is available
11316 set d_sbrkproto sbrk $i_unistd unistd.h
11319 : see if select exists
11320 set select d_select
11323 : see if semctl exists
11324 set semctl d_semctl
11327 : see if semget exists
11328 set semget d_semget
11331 : see if semop exists
11335 : see how much of the 'sem*(2)' library is present.
11338 case "$d_semctl$d_semget$d_semop" in
11339 *"$undef"*) h_sem=false;;
11343 case "`ipcs 2>&1`" in
11344 "SVID messages"*"not configured"*)
11345 echo "Your $osname does not have the sem*(2) configured." >&4
11348 set semctl d_semctl
11350 set semget d_semget
11358 : we could also check for sys/ipc.h ...
11359 if $h_sem && $test `./findhdr sys/sem.h`; then
11360 echo "You have the full sem*(2) library." >&4
11363 echo "You don't have the full sem*(2) library." >&4
11369 : see whether sys/sem.h defines union semun
11371 $cat > try.c <<'END'
11372 #include <sys/types.h>
11373 #include <sys/ipc.h>
11374 #include <sys/sem.h>
11375 int main () { union semun semun; semun.buf = 0; }
11378 if eval $compile; then
11379 echo "You have union semun in <sys/sem.h>." >&4
11382 echo "You do not have union semun in <sys/sem.h>." >&4
11385 $rm -f try try.c try.h
11389 : see how to do semctl IPC_STAT
11392 : see whether semctl IPC_STAT can use union semun
11397 # define S_IRUSR S_IREAD
11398 # define S_IWUSR S_IWRITE
11399 # define S_IXUSR S_IEXEC
11401 # define S_IRUSR 0400
11402 # define S_IWUSR 0200
11403 # define S_IXUSR 0100
11405 # define S_IRGRP (S_IRUSR>>3)
11406 # define S_IWGRP (S_IWUSR>>3)
11407 # define S_IXGRP (S_IXUSR>>3)
11408 # define S_IROTH (S_IRUSR>>6)
11409 # define S_IWOTH (S_IWUSR>>6)
11410 # define S_IXOTH (S_IXUSR>>6)
11413 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
11414 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
11415 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
11420 #include <sys/types.h>
11421 #include <sys/ipc.h>
11422 #include <sys/sem.h>
11423 #include <sys/stat.h>
11430 #$d_union_semun HAS_UNION_SEMUN
11433 #ifndef HAS_UNION_SEMUN
11436 struct semid_ds *buf;
11437 unsigned short *array;
11443 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
11444 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
11446 struct semid_ds argbuf;
11449 st = semctl(sem, 0, IPC_STAT, arg);
11453 # endif /* IPC_STAT */
11454 printf("semctl IPC_STAT failed: errno = %d\n", errno);
11456 if (semctl(sem, 0, IPC_RMID, arg) != 0)
11457 # endif /* IPC_RMID */
11458 printf("semctl IPC_RMID failed: errno = %d\n", errno);
11460 #endif /* IPC_PRIVATE && ... */
11461 printf("semget failed: errno = %d\n", errno);
11467 if eval $compile; then
11470 semun) val="$define" ;;
11476 case "$d_semctl_semun" in
11478 echo "You can use union semun for semctl IPC_STAT." >&4
11481 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
11486 : see whether semctl IPC_STAT can use struct semid_ds pointer
11487 $cat > try.c <<'END'
11488 #include <sys/types.h>
11489 #include <sys/ipc.h>
11490 #include <sys/sem.h>
11491 #include <sys/stat.h>
11499 struct semid_ds arg;
11502 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
11503 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
11506 st = semctl(sem, 0, IPC_STAT, &arg);
11508 printf("semid_ds\n");
11510 # endif /* IPC_STAT */
11511 printf("semctl IPC_STAT failed: errno = %d\n", errno);
11513 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
11514 # endif /* IPC_RMID */
11515 printf("semctl IPC_RMID failed: errno = %d\n", errno);
11517 #endif /* IPC_PRIVATE && ... */
11518 printf("semget failed: errno = %d\n", errno);
11525 if eval $compile; then
11528 semid_ds) val="$define" ;;
11532 set d_semctl_semid_ds
11534 case "$d_semctl_semid_ds" in
11536 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
11538 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
11545 # We do not have the full sem*(2) library, so assume we can not
11551 set d_semctl_semid_ds
11556 : see if sendmsg exists
11557 set sendmsg d_sendmsg
11560 : see if setegid exists
11561 set setegid d_setegid
11564 : see if seteuid exists
11565 set seteuid d_seteuid
11568 : see if setgrent exists
11569 set setgrent d_setgrent
11572 : see if sethostent exists
11573 set sethostent d_sethent
11576 : see if setitimer exists
11577 set setitimer d_setitimer
11580 : see if setlinebuf exists
11581 set setlinebuf d_setlinebuf
11584 : see if setlocale exists
11585 set setlocale d_setlocale
11588 : see if setnetent exists
11589 set setnetent d_setnent
11592 : see if setprotoent exists
11593 set setprotoent d_setpent
11596 : see if setpgid exists
11597 set setpgid d_setpgid
11600 : see if setpgrp2 exists
11601 set setpgrp2 d_setpgrp2
11604 : see if setpriority exists
11605 set setpriority d_setprior
11608 : see if setproctitle exists
11609 set setproctitle d_setproctitle
11612 : see if setpwent exists
11613 set setpwent d_setpwent
11616 : see if setregid exists
11617 set setregid d_setregid
11619 set setresgid d_setresgid
11622 : see if setreuid exists
11623 set setreuid d_setreuid
11625 set setresuid d_setresuid
11628 : see if setrgid exists
11629 set setrgid d_setrgid
11632 : see if setruid exists
11633 set setruid d_setruid
11636 : see if setservent exists
11637 set setservent d_setsent
11640 : see if setsid exists
11641 set setsid d_setsid
11644 : see if setvbuf exists
11645 set setvbuf d_setvbuf
11648 : see if sfio.h is available
11653 : see if sfio library is available
11664 : Ok, but do we want to use it.
11668 true|$define|[yY]*) dflt='y';;
11671 echo "$package can use the sfio library, but it is experimental."
11672 case "$useperlio" in
11674 echo "For sfio also the PerlIO abstraction layer is needed."
11675 echo "Earlier you said you wouldn't want that."
11678 rp="You seem to have sfio available, do you want to try using it?"
11681 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
11682 useperlio="$define"
11685 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
11690 *) case "$usesfio" in
11691 true|$define|[yY]*)
11692 echo "Sorry, cannot find sfio on this machine." >&4
11693 echo "Ignoring your setting of usesfio=$usesfio." >&4
11702 $define) usesfio='true';;
11703 *) usesfio='false';;
11707 *) : Remove sfio from list of libraries to use
11708 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
11711 echo "libs = $libs" >&4
11716 : see if shmctl exists
11717 set shmctl d_shmctl
11720 : see if shmget exists
11721 set shmget d_shmget
11724 : see if shmat exists
11727 : see what shmat returns
11730 $cat >shmat.c <<'END'
11731 #include <sys/shm.h>
11734 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
11739 echo "and it returns ($shmattype)." >&4
11740 : see if a prototype for shmat is available
11741 xxx=`./findhdr sys/shm.h`
11742 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
11743 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
11754 set d_shmatprototype
11757 : see if shmdt exists
11761 : see how much of the 'shm*(2)' library is present.
11764 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
11765 *"$undef"*) h_shm=false;;
11769 case "`ipcs 2>&1`" in
11770 "SVID shared memory"*"not configured"*)
11771 echo "Your $osname does not have the shm*(2) configured." >&4
11774 set shmctl d_shmctl
11776 set shmget d_shmget
11786 : we could also check for sys/ipc.h ...
11787 if $h_shm && $test `./findhdr sys/shm.h`; then
11788 echo "You have the full shm*(2) library." >&4
11791 echo "You don't have the full shm*(2) library." >&4
11798 : see if we have sigaction
11799 if set sigaction val -f d_sigaction; eval $csym; $val; then
11800 echo 'sigaction() found.' >&4
11801 $cat > try.c <<'EOP'
11803 #include <sys/types.h>
11804 #include <signal.h>
11807 struct sigaction act, oact;
11809 oact.sa_handler = 0;
11810 /* so that act and oact are used */
11811 exit(act.sa_flags == 0 && oact.sa_handler == 0);
11815 if eval $compile_ok; then
11818 echo "But you don't seem to have a useable struct sigaction." >&4
11822 echo 'sigaction NOT found.' >&4
11825 set d_sigaction; eval $setvar
11826 $rm -f try try$_o try.c
11828 : see if sigprocmask exists
11829 set sigprocmask d_sigprocmask
11832 : see if sigsetjmp exists
11834 case "$d_sigsetjmp" in
11836 $cat >try.c <<'EOP'
11837 #include <setjmp.h>
11842 if (sigsetjmp(env,1))
11845 siglongjmp(env, 1);
11850 if eval $compile; then
11851 if ./try >/dev/null 2>&1; then
11852 echo "POSIX sigsetjmp found." >&4
11856 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
11862 echo "sigsetjmp not found." >&4
11866 *) val="$d_sigsetjmp"
11867 case "$d_sigsetjmp" in
11868 $define) echo "POSIX sigsetjmp found." >&4;;
11869 $undef) echo "sigsetjmp not found." >&4;;
11877 : see if sockatmark exists
11878 set sockatmark d_sockatmark
11881 : see if socks5_init exists
11882 set socks5_init d_socks5_init
11885 : see if prototype for setresuid is available
11887 set d_sresuproto setresuid $i_unistd unistd.h
11890 : see if sys/stat.h is available
11891 set sys/stat.h i_sysstat
11895 : see if stat knows about block sizes
11897 echo "Checking to see if your struct stat has st_blocks field..." >&4
11898 set d_statblks stat st_blocks $i_sysstat sys/stat.h
11902 : see if this is a sys/vfs.h system
11903 set sys/vfs.h i_sysvfs
11907 : see if this is a sys/statfs.h system
11908 set sys/statfs.h i_sysstatfs
11913 echo "Checking to see if your system supports struct statfs..." >&4
11914 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
11916 case "$d_statfs_s" in
11917 "$define") echo "Yes, it does." ;;
11918 *) echo "No, it doesn't." ;;
11923 : see if struct statfs knows about f_flags
11924 case "$d_statfs_s" in
11927 echo "Checking to see if your struct statfs has f_flags field..." >&4
11928 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
11932 set d_statfs_f_flags
11936 case "$d_statfs_f_flags" in
11937 "$define") echo "Yes, it does." ;;
11938 *) echo "No, it doesn't." ;;
11941 : see if _ptr and _cnt from stdio act std
11944 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
11945 echo "(Looks like you have stdio.h from BSD.)"
11946 case "$stdio_ptr" in
11947 '') stdio_ptr='((fp)->_p)'
11950 *) ptr_lval=$d_stdio_ptr_lval;;
11952 case "$stdio_cnt" in
11953 '') stdio_cnt='((fp)->_r)'
11956 *) cnt_lval=$d_stdio_cnt_lval;;
11958 case "$stdio_base" in
11959 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
11961 case "$stdio_bufsiz" in
11962 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
11964 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
11965 echo "(Looks like you have stdio.h from Linux.)"
11966 case "$stdio_ptr" in
11967 '') stdio_ptr='((fp)->_IO_read_ptr)'
11970 *) ptr_lval=$d_stdio_ptr_lval;;
11972 case "$stdio_cnt" in
11973 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
11976 *) cnt_lval=$d_stdio_cnt_lval;;
11978 case "$stdio_base" in
11979 '') stdio_base='((fp)->_IO_read_base)';;
11981 case "$stdio_bufsiz" in
11982 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
11985 case "$stdio_ptr" in
11986 '') stdio_ptr='((fp)->_ptr)'
11989 *) ptr_lval=$d_stdio_ptr_lval;;
11991 case "$stdio_cnt" in
11992 '') stdio_cnt='((fp)->_cnt)'
11995 *) cnt_lval=$d_stdio_cnt_lval;;
11997 case "$stdio_base" in
11998 '') stdio_base='((fp)->_base)';;
12000 case "$stdio_bufsiz" in
12001 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12005 : test whether _ptr and _cnt really work
12006 echo "Checking how std your stdio is..." >&4
12009 #define FILE_ptr(fp) $stdio_ptr
12010 #define FILE_cnt(fp) $stdio_cnt
12012 FILE *fp = fopen("try.c", "r");
12015 18 <= FILE_cnt(fp) &&
12016 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12024 if eval $compile; then
12026 echo "Your stdio acts pretty std."
12029 echo "Your stdio isn't very std."
12032 echo "Your stdio doesn't appear very std."
12038 : Can _ptr be used as an lvalue?
12039 case "$d_stdstdio$ptr_lval" in
12040 $define$define) val=$define ;;
12043 set d_stdio_ptr_lval
12046 : Can _cnt be used as an lvalue?
12047 case "$d_stdstdio$cnt_lval" in
12048 $define$define) val=$define ;;
12051 set d_stdio_cnt_lval
12055 : test whether setting _ptr sets _cnt as a side effect
12056 d_stdio_ptr_lval_sets_cnt="$undef"
12057 d_stdio_ptr_lval_nochange_cnt="$undef"
12058 case "$d_stdio_ptr_lval$d_stdstdio" in
12060 echo "Checking to see what happens if we set the stdio ptr..." >&4
12063 /* Can we scream? */
12064 /* Eat dust sed :-) */
12065 /* In the buffer space, no one can hear you scream. */
12066 #define FILE_ptr(fp) $stdio_ptr
12067 #define FILE_cnt(fp) $stdio_cnt
12068 #include <sys/types.h>
12070 FILE *fp = fopen("try.c", "r");
12075 puts("Fail even to read");
12078 c = getc(fp); /* Read away the first # */
12080 puts("Fail even to read");
12084 18 <= FILE_cnt(fp) &&
12085 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12087 puts("Fail even to read");
12090 ptr = (char*) FILE_ptr(fp);
12091 cnt = (size_t)FILE_cnt(fp);
12093 FILE_ptr(fp) += 42;
12095 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12096 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12099 if (FILE_cnt(fp) <= 20) {
12100 printf ("Fail (<20 chars to test)");
12103 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12104 puts("Fail compare");
12107 if (cnt == FILE_cnt(fp)) {
12108 puts("Pass_unchanged");
12111 if (FILE_cnt(fp) == (cnt - 42)) {
12112 puts("Pass_changed");
12115 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12121 if eval $compile; then
12122 case `./try$exe_ext` in
12124 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12125 d_stdio_ptr_lval_sets_cnt="$define" ;;
12127 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12128 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12130 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12132 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12135 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12141 : see if _base is also standard
12143 case "$d_stdstdio" in
12147 #define FILE_base(fp) $stdio_base
12148 #define FILE_bufsiz(fp) $stdio_bufsiz
12150 FILE *fp = fopen("try.c", "r");
12153 19 <= FILE_bufsiz(fp) &&
12154 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
12161 if eval $compile; then
12163 echo "And its _base field acts std."
12166 echo "But its _base field isn't std."
12169 echo "However, it seems to be lacking the _base field."
12178 Checking how to access stdio streams by file descriptor number...
12180 case "$stdio_stream_array" in
12181 '') $cat >try.c <<EOCP
12184 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
12188 for s in _iob __iob __sF
12190 set try -DSTDIO_STREAM_ARRAY=$s
12191 if eval $compile; then
12192 case "`./try$exe_ext`" in
12193 yes) stdio_stream_array=$s; break ;;
12197 $rm -f try.* try$exe_ext
12199 case "$stdio_stream_array" in
12201 I can't figure out how to access stdio streams by file descriptor number.
12203 d_stdio_stream_array="$undef"
12206 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
12208 d_stdio_stream_array="$define"
12212 : see if strcoll exists
12213 set strcoll d_strcoll
12216 : check for structure copying
12218 echo "Checking to see if your C compiler can copy structs..." >&4
12219 $cat >try.c <<'EOCP'
12229 if $cc -c try.c >/dev/null 2>&1 ; then
12231 echo "Yup, it can."
12234 echo "Nope, it can't."
12240 : see if strerror and/or sys_errlist[] exist
12242 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
12243 if set strerror val -f d_strerror; eval $csym; $val; then
12244 echo 'strerror() found.' >&4
12245 d_strerror="$define"
12246 d_strerrm='strerror(e)'
12247 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
12248 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
12249 d_syserrlst="$define"
12251 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
12252 d_syserrlst="$undef"
12254 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
12255 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
12256 echo 'strerror() found in string header.' >&4
12257 d_strerror="$define"
12258 d_strerrm='strerror(e)'
12259 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
12260 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
12261 d_syserrlst="$define"
12263 echo "(You don't appear to have any sys_errlist[], how can this be?)"
12264 d_syserrlst="$undef"
12266 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
12267 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
12268 d_strerror="$undef"
12269 d_syserrlst="$define"
12270 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
12272 echo 'strerror() and sys_errlist[] NOT found.' >&4
12273 d_strerror="$undef"
12274 d_syserrlst="$undef"
12275 d_strerrm='"unknown"'
12279 : see if strftime exists
12280 set strftime d_strftime
12283 : see if strtod exists
12284 set strtod d_strtod
12287 : see if strtol exists
12288 set strtol d_strtol
12291 : see if strtold exists
12292 set strtold d_strtold
12295 : see if strtoll exists
12296 set strtoll d_strtoll
12299 case "$d_longlong-$d_strtoll" in
12302 Checking whether your strtoll() works okay...
12304 $cat >try.c <<'EOCP'
12307 #define strtoll __strtoll
12310 #define strtoll _strtoll
12313 extern long long int strtoll(char *s, char **, int);
12314 static int bad = 0;
12315 int check(char *s, long long ell, int een) {
12318 gll = strtoll(s, 0, 10);
12319 if (!((gll == ell) && (errno == een)))
12323 check(" 1", 1LL, 0);
12324 check(" 0", 0LL, 0);
12325 check("-1", -1LL, 0);
12326 check("-9223372036854775808", -9223372036854775808LL, 0);
12327 check("-9223372036854775808", -9223372036854775808LL, 0);
12328 check(" 9223372036854775807", 9223372036854775807LL, 0);
12329 check("-9223372036854775808", -9223372036854775808LL, 0);
12330 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
12331 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
12337 if eval $compile; then
12340 ok) echo "Your strtoll() seems to be working okay." ;;
12342 Your strtoll() doesn't seem to be working okay.
12348 echo "(I can't seem to compile the test program--assuming it doesn't)"
12354 : see if strtoq exists
12355 set strtoq d_strtoq
12358 : see if strtoul exists
12359 set strtoul d_strtoul
12362 case "$d_strtoul" in
12365 Checking whether your strtoul() works okay...
12367 $cat >try.c <<'EOCP'
12370 extern unsigned long int strtoul(char *s, char **, int);
12371 static int bad = 0;
12372 void check(char *s, unsigned long eul, int een) {
12375 gul = strtoul(s, 0, 10);
12376 if (!((gul == eul) && (errno == een)))
12380 check(" 1", 1L, 0);
12381 check(" 0", 0L, 0);
12383 case "$longsize" in
12385 $cat >>try.c <<'EOCP'
12386 check("18446744073709551615", 18446744073709551615UL, 0);
12387 check("18446744073709551616", 18446744073709551615UL, ERANGE);
12388 #if 0 /* strtoul() for /^-/ strings is undefined. */
12389 check("-1", 18446744073709551615UL, 0);
12390 check("-18446744073709551614", 2, 0);
12391 check("-18446744073709551615", 1, 0);
12392 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
12393 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
12398 $cat >>try.c <<'EOCP'
12399 check("4294967295", 4294967295UL, 0);
12400 check("4294967296", 4294967295UL, ERANGE);
12401 #if 0 /* strtoul() for /^-/ strings is undefined. */
12402 check("-1", 4294967295UL, 0);
12403 check("-4294967294", 2, 0);
12404 check("-4294967295", 1, 0);
12405 check("-4294967296", 4294967295UL, ERANGE);
12406 check("-4294967297", 4294967295UL, ERANGE);
12411 : Should we write these tests to be more portable by sprintf-ing
12412 : ~0 and then manipulating that char string as input for strtol?
12415 $cat >>try.c <<'EOCP'
12422 if eval $compile; then
12424 ok) echo "Your strtoul() seems to be working okay." ;;
12426 Your strtoul() doesn't seem to be working okay.
12435 : see if strtoull exists
12436 set strtoull d_strtoull
12439 case "$d_longlong-$d_strtoull" in
12442 Checking whether your strtoull() works okay...
12444 $cat >try.c <<'EOCP'
12447 #define strtoull __strtoull
12450 extern unsigned long long int strtoull(char *s, char **, int);
12451 static int bad = 0;
12452 int check(char *s, long long eull, int een) {
12455 gull = strtoull(s, 0, 10);
12456 if (!((gull == eull) && (errno == een)))
12460 check(" 1", 1LL, 0);
12461 check(" 0", 0LL, 0);
12462 check("18446744073709551615", 18446744073709551615ULL, 0);
12463 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
12464 #if 0 /* strtoull() for /^-/ strings is undefined. */
12465 check("-1", 18446744073709551615ULL, 0);
12466 check("-18446744073709551614", 2LL, 0);
12467 check("-18446744073709551615", 1LL, 0);
12468 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
12469 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
12476 if eval $compile; then
12478 ok) echo "Your strtoull() seems to be working okay." ;;
12480 Your strtoull() doesn't seem to be working okay.
12482 d_strtoull="$undef"
12489 : see if strtouq exists
12490 set strtouq d_strtouq
12493 case "$d_strtouq" in
12496 Checking whether your strtouq() works okay...
12498 $cat >try.c <<'EOCP'
12501 extern unsigned long long int strtouq(char *s, char **, int);
12502 static int bad = 0;
12503 void check(char *s, unsigned long long eull, int een) {
12504 unsigned long long gull;
12506 gull = strtouq(s, 0, 10);
12507 if (!((gull == eull) && (errno == een)))
12511 check(" 1", 1LL, 0);
12512 check(" 0", 0LL, 0);
12513 check("18446744073709551615", 18446744073709551615ULL, 0);
12514 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
12515 #if 0 /* strtouq() for /^-/ strings is undefined. */
12516 check("-1", 18446744073709551615ULL, 0);
12517 check("-18446744073709551614", 2LL, 0);
12518 check("-18446744073709551615", 1LL, 0);
12519 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
12520 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
12528 if eval $compile; then
12530 ok) echo "Your strtouq() seems to be working okay." ;;
12532 Your strtouq() doesn't seem to be working okay.
12541 : see if strxfrm exists
12542 set strxfrm d_strxfrm
12545 : see if symlink exists
12546 set symlink d_symlink
12549 : see if syscall exists
12550 set syscall d_syscall
12553 : see if sysconf exists
12554 set sysconf d_sysconf
12557 : see if system exists
12558 set system d_system
12561 : see if tcgetpgrp exists
12562 set tcgetpgrp d_tcgetpgrp
12565 : see if tcsetpgrp exists
12566 set tcsetpgrp d_tcsetpgrp
12569 : see if prototype for telldir is available
12571 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
12574 : see if this is a sys/times.h system
12575 set sys/times.h i_systimes
12578 : see if times exists
12580 if set times val -f d_times; eval $csym; $val; then
12581 echo 'times() found.' >&4
12584 case "$i_systimes" in
12585 "$define") inc='sys/times.h';;
12587 rp="What is the type returned by times() on this system?"
12588 set clock_t clocktype long stdio.h sys/types.h $inc
12591 echo 'times() NOT found, hope that will do.' >&4
12596 : see if truncate exists
12597 set truncate d_truncate
12600 : see if tzname[] exists
12602 if set tzname val -a d_tzname; eval $csym; $val; then
12604 echo 'tzname[] found.' >&4
12607 echo 'tzname[] NOT found.' >&4
12612 case "$crosscompile" in
12613 ''|[nN]*) crosscompile="$undef" ;;
12617 next|rhapsody|darwin) multiarch="$define" ;;
12619 case "$multiarch" in
12620 ''|[nN]*) multiarch="$undef" ;;
12623 : check for ordering of bytes in a long
12625 case "$crosscompile$multiarch" in
12628 You seem to be either cross-compiling or doing a multiarchitecture build,
12629 skipping the byteorder check.
12635 case "$byteorder" in
12638 In the following, larger digits indicate more significance. A big-endian
12639 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
12640 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
12641 machines may have weird orders like 3412. A Cray will report 87654321,
12642 an Alpha will report 12345678. If the test program works the default is
12644 I'm now running the test program...
12646 $cat >try.c <<'EOCP'
12653 char c[sizeof(long)];
12656 if (sizeof(long) > 4)
12657 u.l = (0x08070605L << 32) | 0x04030201L;
12660 for (i = 0; i < sizeof(long); i++)
12661 printf("%c", u.c[i]+'0');
12668 if eval $compile && ./try > /dev/null; then
12671 [1-4][1-4][1-4][1-4]|12345678|87654321)
12672 echo "(The test program ran ok.)"
12673 echo "byteorder=$dflt"
12676 ????|????????) echo "(The test program ran ok.)" ;;
12677 *) echo "(The test program didn't run right for some reason.)" ;;
12682 (I can't seem to compile the test program. Guessing big-endian...)
12685 case "$xxx_prompt" in
12687 rp="What is the order of bytes in a long?"
12703 Checking to see whether you can access character data unalignedly...
12707 #define U32 $u32type
12708 #define BYTEORDER $byteorder
12710 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
12711 U8 buf[] = "\0\0\0\1\0\0\0\0";
12715 if (sizeof(U32) != 4) {
12716 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
12722 for (i = 0; i < 4; i++) {
12723 up = (U32*)(buf + i);
12724 if (! ((*up == 1 << (8*i)) || /* big-endian */
12725 (*up == 1 << (8*(3-i))) /* little-endian */
12729 printf("read failed (%x)\n", *up);
12735 for (i = 0; i < 4; i++) {
12736 up = (U32*)(buf + i);
12738 if (*up != 0xBeef) {
12739 printf("write failed (%x)\n", *up);
12753 if eval $compile_ok; then
12754 echo "(This test may dump core.)" >&4
12755 ./try >&2 >/dev/null
12758 You can access character data pretty unalignedly.
12760 d_u32align="$undef"
12763 It seems that you must access character data in an aligned manner.
12765 d_u32align="$define"
12768 $rm -f core core.try.* try.core
12770 rp='Can you access character data at unaligned addresses?'
12774 [yY]*) d_u32align="$undef" ;;
12775 *) d_u32align="$define" ;;
12779 : see if ualarm exists
12780 set ualarm d_ualarm
12783 : see if umask exists
12787 : see if usleep exists
12788 set usleep d_usleep
12791 : see if ustat exists
12795 : backward compatibility for d_hvfork
12796 if test X$d_hvfork != X; then
12797 d_vfork="$d_hvfork"
12800 : see if there is a vfork
12805 : Ok, but do we want to use it. vfork is reportedly unreliable in
12806 : perl on Solaris 2.x, and probably elsewhere.
12810 case "$usevfork" in
12816 Perl can only use a vfork() that doesn't suffer from strict
12817 restrictions on calling functions or modifying global data in
12818 the child. For example, glibc-2.1 contains such a vfork()
12819 that is unsuitable. If your system provides a proper fork()
12820 call, chances are that you do NOT want perl to use vfork().
12823 rp="Do you still want to use vfork()?"
12828 echo "Ok, we won't use vfork()."
12837 $define) usevfork='true';;
12838 *) usevfork='false';;
12841 : see if this is an sysdir system
12842 set sys/dir.h i_sysdir
12845 : see if this is an sysndir system
12846 set sys/ndir.h i_sysndir
12849 : see if closedir exists
12850 set closedir d_closedir
12853 case "$d_closedir" in
12856 echo "Checking whether closedir() returns a status..." >&4
12857 cat > closedir.c <<EOM
12858 #$i_dirent I_DIRENT /**/
12859 #$i_sysdir I_SYS_DIR /**/
12860 #$i_sysndir I_SYS_NDIR /**/
12861 #$i_systypes I_SYS_TYPES /**/
12863 #if defined(I_SYS_TYPES)
12864 #include <sys/types.h>
12866 #if defined(I_DIRENT)
12867 #include <dirent.h>
12868 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
12869 #include <sys/dir.h>
12873 #include <sys/ndir.h>
12877 #include <ndir.h> /* may be wrong in the future */
12879 #include <sys/dir.h>
12884 int main() { return closedir(opendir(".")); }
12887 if eval $compile_ok; then
12888 if ./closedir > /dev/null 2>&1 ; then
12889 echo "Yes, it does."
12892 echo "No, it doesn't."
12896 echo "(I can't seem to compile the test program--assuming it doesn't)"
12904 set d_void_closedir
12907 : see if there is a wait4
12911 : see if waitpid exists
12912 set waitpid d_waitpid
12915 : see if wcstombs exists
12916 set wcstombs d_wcstombs
12919 : see if wctomb exists
12920 set wctomb d_wctomb
12923 : see if writev exists
12924 set writev d_writev
12927 : preserve RCS keywords in files with variable substitution, grrr
12932 Revision='$Revision'
12934 : check for alignment requirements
12936 case "$crosscompile$multiarch" in
12939 You seem to be either cross-compiling or doing a multiarchitecture build,
12940 skipping the memory alignment check.
12943 case "$alignbytes" in
12944 '') alignbytes=8 ;;
12948 case "$alignbytes" in
12949 '') echo "Checking alignment constraints..." >&4
12950 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
12951 $cat >try.c <<'EOCP'
12952 typedef long double NV;
12955 $cat >try.c <<'EOCP'
12959 $cat >>try.c <<'EOCP'
12967 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
12972 if eval $compile_ok; then
12976 echo "(I can't seem to compile the test program...)"
12979 *) dflt="$alignbytes"
12982 rp="Doubles must be aligned on a how-many-byte boundary?"
12990 : set the base revision
12993 : how do we catenate cpp tokens here?
12995 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
12996 $cat >cpp_stuff.c <<'EOCP'
12997 #define RCAT(a,b)a/**/b
12998 #define ACAT(a,b)a ## b
13002 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
13003 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
13004 echo "Oh! Smells like ANSI's been here." >&4
13005 echo "We can catify or stringify, separately or together!"
13007 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
13008 echo "Ah, yes! The good old days!" >&4
13009 echo "However, in the good old days we don't know how to stringify and"
13010 echo "catify at the same time."
13014 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
13015 to have to edit the values of CAT[2-5] in config.h...
13017 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
13021 : see if this is a db.h system
13027 : Check db version.
13029 echo "Checking Berkeley DB version ..." >&4
13035 #include <sys/types.h>
13038 int main(int argc, char *argv[])
13040 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
13041 int Major, Minor, Patch ;
13042 unsigned long Version ;
13043 (void)db_version(&Major, &Minor, &Patch) ;
13045 printf("%d %d %d %d %d %d\n",
13046 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
13047 Major, Minor, Patch);
13050 printf("You have Berkeley DB Version 2 or greater.\n");
13052 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
13053 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
13054 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
13055 Major, Minor, Patch) ;
13057 /* check that db.h & libdb are compatible */
13058 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
13059 printf("db.h and libdb are incompatible.\n") ;
13063 printf("db.h and libdb are compatible.\n") ;
13065 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
13066 + DB_VERSION_PATCH ;
13068 /* needs to be >= 2.3.4 */
13069 if (Version < 2003004) {
13070 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
13071 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
13077 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
13082 printf("You have Berkeley DB Version 1.\n");
13083 exit(0); /* DB version < 2: the coast is clear. */
13085 exit(1); /* <db.h> not Berkeley DB? */
13091 if eval $compile_ok && ./try; then
13092 echo 'Looks OK.' >&4
13094 db_version_major=$1
13095 db_version_minor=$2
13096 db_version_patch=$3
13098 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
13102 : Remove db from list of libraries to use
13103 echo "Removing unusable -ldb from library list" >&4
13104 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
13107 echo "libs = $libs" >&4
13117 : Check the return type needed for hash
13119 echo "Checking return type needed for hash for Berkeley DB ..." >&4
13125 #include <sys/types.h>
13128 #ifndef DB_VERSION_MAJOR
13129 u_int32_t hash_cb (ptr, size)
13137 info.hash = hash_cb;
13141 if $cc $ccflags -c try.c >try.out 2>&1 ; then
13142 if $contains warning try.out >>/dev/null 2>&1 ; then
13145 db_hashtype='u_int32_t'
13148 : XXX Maybe we should just give up here.
13149 db_hashtype=u_int32_t
13151 echo "Help: I can't seem to compile the db test program." >&4
13152 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
13155 echo "Your version of Berkeley DB uses $db_hashtype for hash."
13157 *) db_hashtype=u_int32_t
13162 : Check the return type needed for prefix
13164 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
13170 #include <sys/types.h>
13173 #ifndef DB_VERSION_MAJOR
13174 size_t prefix_cb (key1, key2)
13182 info.prefix = prefix_cb;
13186 if $cc $ccflags -c try.c >try.out 2>&1 ; then
13187 if $contains warning try.out >>/dev/null 2>&1 ; then
13188 db_prefixtype='int'
13190 db_prefixtype='size_t'
13193 db_prefixtype='size_t'
13194 : XXX Maybe we should just give up here.
13196 echo "Help: I can't seem to compile the db test program." >&4
13197 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
13200 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
13202 *) db_prefixtype='size_t'
13207 : How can we generate normalized random numbers ?
13209 echo "Looking for a random number function..." >&4
13210 case "$randfunc" in
13212 if set drand48 val -f; eval $csym; $val; then
13214 echo "Good, found drand48()." >&4
13215 elif set random val -f; eval $csym; $val; then
13217 echo "OK, found random()." >&4
13220 echo "Yick, looks like I have to use rand()." >&4
13231 *-Dmy_rand=*|*-Dmy_srand=*)
13232 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
13233 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
13234 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
13235 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
13239 while $test "$cont"; do
13240 rp="Use which function to generate random numbers?"
13242 if $test "$ans" = "$dflt"; then
13248 if set $ans val -f; eval $csym; $val; then
13252 rp="I cannot find function $ans. Use that name anyway?"
13261 case "$randfunc" in
13263 drand01="drand48()"
13269 case "$randbits" in
13271 echo "Checking to see how many bits your $randfunc() function produces..." >&4
13273 #$i_unistd I_UNISTD
13274 #$i_stdlib I_STDLIB
13277 # include <unistd.h>
13280 # include <stdlib.h>
13285 register unsigned long tmp;
13286 register unsigned long max = 0L;
13288 for (i = 1000; i; i--) {
13289 tmp = (unsigned long) $randfunc();
13290 if (tmp > max) max = tmp;
13292 for (i = 0; max; i++)
13298 if eval $compile_ok; then
13302 echo "(I can't seem to compile the test program...)"
13309 rp="How many bits does your $randfunc() function produce?"
13313 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
13314 seedfunc="s$randfunc"
13315 randseedtype=unsigned
13319 rp="How many bits does your $randfunc() function produce?"
13322 seedfunc="s$randfunc"
13323 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
13324 if set $seedfunc val -f; eval $csym; $val; then
13325 echo "(Using $seedfunc() to seed random generator)"
13327 echo "(Warning: no $seedfunc() to seed random generator)"
13330 randseedtype=unsigned
13338 echo "Determining whether or not we are on an EBCDIC system..." >&4
13339 $cat >tebcdic.c <<'EOM'
13342 if ('M'==0xd4) return 0;
13349 if eval $compile_ok; then
13351 echo "You seem to speak EBCDIC." >&4
13354 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF8." >&4
13357 echo "I'm unable to compile the test program." >&4
13358 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
13360 $rm -f tebcdic.c tebcdic
13366 Checking how to flush all pending stdio output...
13368 # I only know how to find the first 32 possibly open files on SunOS.
13369 # See also hints/sunos_4_1.sh and util.c --AD
13371 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
13373 $cat >>try.c <<EOCP
13375 #$i_unistd I_UNISTD
13377 # include <unistd.h>
13379 #$d_sysconf HAS_SYSCONF
13380 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
13381 #ifdef HAS_STDIO_STREAM_ARRAY
13382 # define STDIO_STREAM_ARRAY $stdio_stream_array
13385 FILE* p = fopen("try.out", "w");
13389 # ifdef TRY_FPRINTF
13393 #ifdef TRY_FFLUSH_NULL
13396 #ifdef TRY_FFLUSH_ALL
13398 long open_max = -1;
13399 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
13400 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
13402 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
13403 open_max = sysconf(_SC_OPEN_MAX);
13406 open_max = FOPEN_MAX;
13409 open_max = OPEN_MAX;
13418 # ifdef HAS_STDIO_STREAM_ARRAY
13419 if (open_max > 0) {
13421 for (i = 0; i < open_max; i++)
13422 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
13423 STDIO_STREAM_ARRAY[i]._file < open_max &&
13424 STDIO_STREAM_ARRAY[i]._flag)
13425 fflush(&STDIO_STREAM_ARRAY[i]);
13433 : first we have to find out how _not_ to flush
13434 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
13436 set try -DTRY_FPUTC
13437 if eval $compile; then
13439 ./try$exe_ext 2>/dev/null
13440 if $test ! -s try.out -a "X$?" = X42; then
13446 set try -DTRY_FPRINTF
13448 if eval $compile; then
13450 ./try$exe_ext 2>/dev/null
13451 if $test ! -s try.out -a "X$?" = X42; then
13452 output=-DTRY_FPRINTF
13458 : check for fflush NULL behaviour
13459 case "$fflushNULL" in
13460 '') set try -DTRY_FFLUSH_NULL $output
13461 if eval $compile; then
13463 ./try$exe_ext 2>/dev/null
13465 if $test -s try.out -a "X$code" = X42; then
13466 fflushNULL="`$cat try.out`"
13468 if $test "X$code" != X42; then
13470 (If this test failed, don't worry, we'll try another method shortly.)
13475 $rm -f core try.core core.try.*
13476 case "$fflushNULL" in
13478 Your fflush(NULL) works okay for output streams.
13479 Let's see if it clobbers input pipes...
13481 # As of mid-March 2000 all versions of Solaris appear to have a stdio
13482 # bug that improperly flushes the input end of pipes. So we avoid the
13483 # autoflush on fork/system/exec support for now. :-(
13484 $cat >tryp.c <<EOCP
13487 main(int argc, char **argv)
13493 while ((i = getc(stdin)) != -1
13494 && (*bp++ = i) != '\n'
13495 && bp < &buf[1024])
13498 fprintf(stdout, "%s", buf);
13506 fflushNULL="$define"
13508 if eval $compile; then
13510 $cat tryp.c | ./tryp$exe_ext 2>/dev/null > tryp.out
13511 if cmp tryp.c tryp.out >/dev/null 2>&1; then
13513 fflush(NULL) seems to behave okay with input streams.
13515 fflushNULL="$define"
13518 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
13520 fflushNULL="$undef"
13523 $rm -f core tryp.c tryp.core core.tryp.*
13526 Your fflush(NULL) isn't working (contrary to ANSI C).
13528 fflushNULL="$undef"
13531 Cannot figure out whether your fflush(NULL) works or not.
13532 I'm assuming it doesn't (contrary to ANSI C).
13534 fflushNULL="$undef"
13538 $define|true|[yY]*)
13539 fflushNULL="$define"
13542 fflushNULL="$undef"
13545 : check explicit looping only if NULL did not work, and if the pipe
13546 : bug does not show up on an explicit flush too
13547 case "$fflushNULL" in
13549 $cat >tryp.c <<EOCP
13552 main(int argc, char **argv)
13558 while ((i = getc(stdin)) != -1
13559 && (*bp++ = i) != '\n'
13560 && bp < &buf[1024])
13563 fprintf(stdout, "%s", buf);
13572 if eval $compile; then
13574 $cat tryp.c | ./tryp$exe_ext 2>/dev/null > tryp.out
13575 if cmp tryp.c tryp.out >/dev/null 2>&1; then
13577 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
13579 : now check for fflushall behaviour
13580 case "$fflushall" in
13581 '') set try -DTRY_FFLUSH_ALL $output
13582 if eval $compile; then
13584 (Now testing the other method--but note that this also may fail.)
13587 ./try$exe_ext 2>/dev/null
13588 if $test -s try.out -a "X$?" = X42; then
13589 fflushall="`$cat try.out`"
13592 $rm -f core try.core core.try.*
13593 case "$fflushall" in
13595 Whew. Flushing explicitly all the stdio streams works.
13597 fflushall="$define"
13600 Sigh. Flushing explicitly all the stdio streams doesn't work.
13605 Cannot figure out whether flushing stdio streams explicitly works or not.
13606 I'm assuming it doesn't.
13612 "$define"|true|[yY]*)
13613 fflushall="$define"
13621 All is futile. Even fflush(stdin) clobbers input pipes!
13628 $rm -f core tryp.c tryp.core core.tryp.*
13630 *) fflushall="$undef"
13634 case "$fflushNULL$fflushall" in
13637 OK, I give up. I cannot figure out how to flush pending stdio output.
13638 We won't be flushing handles at all before fork/exec/popen.
13642 $rm -f try.* try$exe_ext
13644 : Store the full pathname to the ar program for use in the C program
13645 : Respect a hint or command line value for full_ar.
13650 : Store the full pathname to the sed program for use in the C program
13653 : see what type gids are declared as in the kernel
13655 echo "Looking for the type for group ids returned by getgid()."
13656 set gid_t gidtype xxx stdio.h sys/types.h
13660 xxx=`./findhdr sys/user.h`
13661 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
13663 unsigned) dflt="$1 $2" ;;
13667 *) dflt="$gidtype";;
13670 gid_t) echo "gid_t found." ;;
13671 *) rp="What is the type for group ids returned by getgid()?"
13679 *_t) zzz="$gidtype" ;;
13682 echo "Checking the size of $zzz..." >&4
13684 #include <sys/types.h>
13687 printf("%d\n", (int)sizeof($gidtype));
13692 if eval $compile_ok; then
13696 echo "(I can't execute the test program--guessing $gidsize.)" >&4
13699 echo "Your $zzz is $gidsize bytes long."
13704 echo "(I can't compile the test program--guessing $gidsize.)" >&4
13710 *_t) zzz="$gidtype" ;;
13713 echo "Checking the sign of $zzz..." >&4
13715 #include <sys/types.h>
13726 if eval $compile; then
13730 echo "(I can't execute the test program--guessing unsigned.)" >&4
13734 1) echo "Your $zzz is unsigned." ;;
13735 -1) echo "Your $zzz is signed." ;;
13741 echo "(I can't compile the test program--guessing unsigned.)" >&4
13747 if $test X"$quadtype" != X; then
13749 echo "Checking how to print 64-bit integers..." >&4
13751 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
13752 $cat >try.c <<'EOCP'
13753 #include <sys/types.h>
13756 int q = 12345678901;
13757 printf("%ld\n", q);
13761 if eval $compile; then
13762 yyy=`./try$exe_ext`
13765 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
13766 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
13767 echo "We will use %d."
13773 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
13774 $cat >try.c <<'EOCP'
13775 #include <sys/types.h>
13778 long q = 12345678901;
13779 printf("%ld\n", q);
13783 if eval $compile; then
13784 yyy=`./try$exe_ext`
13787 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
13788 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
13789 echo "We will use %ld."
13795 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
13796 $cat >try.c <<'EOCP'
13797 #include <sys/types.h>
13798 #include <inttypes.h>
13801 int64_t q = 12345678901;
13802 printf("%" PRId64 "\n", q);
13806 if eval $compile; then
13807 yyy=`./try$exe_ext`
13810 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
13811 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
13812 echo "We will use the C9X style."
13818 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
13819 $cat >try.c <<'EOCP'
13820 #include <sys/types.h>
13823 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
13824 printf("%lld\n", q);
13828 if eval $compile; then
13829 yyy=`./try$exe_ext`
13832 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
13833 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
13834 echo "We will use the %lld style."
13840 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
13842 #include <sys/types.h>
13845 $quadtype q = 12345678901;
13846 printf("%Ld\n", q);
13850 if eval $compile; then
13851 yyy=`./try$exe_ext`
13854 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
13855 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
13856 echo "We will use %Ld."
13862 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
13864 #include <sys/types.h>
13867 $quadtype q = 12345678901;
13868 printf("%qd\n", q);
13872 if eval $compile; then
13873 yyy=`./try$exe_ext`
13876 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
13877 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
13878 echo "We will use %qd."
13884 if $test X"$sPRId64" = X; then
13885 echo "Cannot figure out how to print 64-bit integers." >&4
13893 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
13894 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
13896 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
13897 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
13903 $echo "Checking the format strings to be used for Perl's internal types..." >&4
13905 if $test X"$ivsize" = X8; then
13906 ivdformat="$sPRId64"
13907 uvuformat="$sPRIu64"
13908 uvoformat="$sPRIo64"
13909 uvxformat="$sPRIx64"
13910 uvXUformat="$sPRIXU64"
13912 if $test X"$ivsize" = X"$longsize"; then
13919 if $test X"$ivsize" = X"$intsize"; then
13927 if $test X"$ivsize" = X"$shortsize"; then
13938 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
13939 nveformat="$sPRIeldbl"
13940 nvfformat="$sPRIfldbl"
13941 nvgformat="$sPRIgldbl"
13942 nvEUformat="$sPRIEUldbl"
13943 nvFUformat="$sPRIFUldbl"
13944 nvGUformat="$sPRIGUldbl"
13954 case "$ivdformat" in
13955 '') echo "$0: Fatal: failed to find format strings, cannot continue." >& 4
13962 $echo "Checking the format string to be used for gids..." >&4
13965 -1) if $test X"$gidsize" = X"$ivsize"; then
13966 gidformat="$ivdformat"
13968 if $test X"$gidsize" = X"$longsize"; then
13971 if $test X"$gidsize" = X"$intsize"; then
13974 if $test X"$gidsize" = X"$shortsize"; then
13981 *) if $test X"$gidsize" = X"$uvsize"; then
13982 gidformat="$uvuformat"
13984 if $test X"$gidsize" = X"$longsize"; then
13987 if $test X"$gidsize" = X"$intsize"; then
13990 if $test X"$gidsize" = X"$shortsize"; then
13999 : see if getgroups exists
14000 set getgroups d_getgrps
14003 : see if setgroups exists
14004 set setgroups d_setgrps
14008 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
14010 case "$d_getgrps$d_setgrps" in
14012 case "$groupstype" in
14013 '') dflt="$gidtype" ;;
14014 *) dflt="$groupstype" ;;
14017 What type of pointer is the second argument to getgroups() and setgroups()?
14018 Usually this is the same as group ids, $gidtype, but not always.
14021 rp='What type pointer is the second argument to getgroups() and setgroups()?'
14025 *) groupstype="$gidtype";;
14029 echo "Checking if your $make program sets \$(MAKE)..." >&4
14030 case "$make_set_make" in
14032 $sed 's/^X //' > testmake.mak << 'EOF'
14034 X @echo 'maketemp="$(MAKE)"'
14036 case "`$make -f testmake.mak 2>/dev/null`" in
14037 *maketemp=*) make_set_make='#' ;;
14038 *) make_set_make="MAKE=$make" ;;
14040 $rm -f testmake.mak
14043 case "$make_set_make" in
14044 '#') echo "Yup, it does.";;
14045 *) echo "Nope, it doesn't.";;
14048 : see what type is used for mode_t
14049 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
14050 set mode_t modetype int stdio.h sys/types.h
14053 : see if stdarg is available
14055 if $test `./findhdr stdarg.h`; then
14056 echo "<stdarg.h> found." >&4
14059 echo "<stdarg.h> NOT found." >&4
14063 : see if varags is available
14065 if $test `./findhdr varargs.h`; then
14066 echo "<varargs.h> found." >&4
14068 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
14071 : set up the varargs testing programs
14072 $cat > varargs.c <<EOP
14074 #include <stdarg.h>
14077 #include <varargs.h>
14081 int f(char *p, ...)
14095 p = va_arg(ap, char *);
14100 $cat > varargs <<EOP
14102 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
14111 : now check which varargs header should be included
14116 if `./varargs I_STDARG`; then
14118 elif `./varargs I_VARARGS`; then
14123 if `./varargs I_VARARGS`; then
14130 echo "I could not find the definition for va_dcl... You have problems..." >&4
14131 val="$undef"; set i_stdarg; eval $setvar
14132 val="$undef"; set i_varargs; eval $setvar
14137 case "$i_varhdr" in
14139 val="$define"; set i_stdarg; eval $setvar
14140 val="$undef"; set i_varargs; eval $setvar
14143 val="$undef"; set i_stdarg; eval $setvar
14144 val="$define"; set i_varargs; eval $setvar
14147 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
14151 : see if we need va_copy
14153 case "$i_stdarg" in
14156 #include <stdarg.h>
14158 #$i_stdlib I_STDLIB
14160 #include <stdlib.h>
14162 #include <signal.h>
14165 ivfprintf(FILE *f, const char *fmt, va_list *valp)
14167 return vfprintf(f, fmt, *valp);
14171 myvfprintf(FILE *f, const char *fmt, va_list val)
14173 return ivfprintf(f, fmt, &val);
14177 myprintf(char *fmt, ...)
14180 va_start(val, fmt);
14181 return myvfprintf(stdout, fmt, val);
14185 main(int ac, char **av)
14187 signal(SIGSEGV, exit);
14189 myprintf("%s%cs all right, then\n", "that", '\'');
14194 if eval $compile && ./try 2>&1 >/dev/null; then
14196 "that's all right, then")
14202 yes) echo "It seems that you don't need va_copy()." >&4
14203 need_va_copy="$undef"
14205 *) echo "It seems that va_copy() or similar will be needed." >&4
14206 need_va_copy="$define"
14209 $rm -f try.* core core.* *.core *.core.*
14211 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
14215 : define a fucntion to check prototypes
14216 $cat > protochk <<EOSH
14219 optimize="$optimize"
14221 prototype="$prototype"
14226 $cat >> protochk <<'EOSH'
14231 while test $# -ge 2; do
14233 $define) echo "#include <$2>" >> try.c ;;
14234 literal) echo "$2" >> try.c ;;
14238 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
14239 cat >> try.c <<'EOCP'
14240 #ifdef CAN_PROTOTYPE
14241 #define _(args) args
14246 echo "$foo" >> try.c
14247 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
14248 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
14254 $eunicefix protochk
14256 : see what type is used for size_t
14257 rp="What is the type used for the length parameter for string functions?"
14258 set size_t sizetype 'unsigned int' stdio.h sys/types.h
14261 : check for type of arguments to gethostbyaddr.
14262 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
14263 case "$d_gethbyaddr" in
14267 Checking to see what type of arguments are accepted by gethostbyaddr().
14269 hdrs="$define sys/types.h
14270 $d_socket sys/socket.h
14271 $i_niin netinet/in.h
14273 $i_unistd unistd.h"
14274 : The first arg can 'char *' or 'void *'
14275 : The second arg is some of integral type
14276 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
14277 for yyy in size_t long int; do
14278 case "$netdb_host_type" in
14279 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
14280 if ./protochk "$try" $hdrs; then
14281 echo "Your system accepts $xxx for the first arg."
14282 echo "...and $yyy for the second arg."
14283 netdb_host_type="$xxx"
14284 netdb_hlen_type="$yyy"
14290 : In case none of those worked, prompt the user.
14291 case "$netdb_host_type" in
14292 '') rp='What is the type for the 1st argument to gethostbyaddr?'
14295 netdb_host_type=$ans
14296 rp='What is the type for the 2nd argument to gethostbyaddr?'
14299 netdb_hlen_type=$ans
14303 *) : no gethostbyaddr, so pick harmless defaults
14304 netdb_host_type='char *'
14305 netdb_hlen_type="$sizetype"
14308 # Remove the "const" if needed. -- but then we'll have a
14310 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
14313 : check for type of argument to gethostbyname.
14314 if test "X$netdb_name_type" = X ; then
14315 case "$d_gethbyname" in
14319 Checking to see what type of argument is accepted by gethostbyname().
14321 hdrs="$define sys/types.h
14322 $d_socket sys/socket.h
14323 $i_niin netinet/in.h
14325 $i_unistd unistd.h"
14326 for xxx in "const char *" "char *"; do
14327 case "$netdb_name_type" in
14328 '') try="extern struct hostent *gethostbyname($xxx);"
14329 if ./protochk "$try" $hdrs; then
14330 echo "Your system accepts $xxx."
14331 netdb_name_type="$xxx"
14336 : In case none of those worked, prompt the user.
14337 case "$netdb_name_type" in
14338 '') rp='What is the type for the 1st argument to gethostbyname?'
14341 netdb_name_type=$ans
14345 *) : no gethostbyname, so pick harmless default
14346 netdb_name_type='char *'
14351 : check for type of 1st argument to getnetbyaddr.
14352 if test "X$netdb_net_type" = X ; then
14353 case "$d_getnbyaddr" in
14357 Checking to see what type of 1st argument is accepted by getnetbyaddr().
14359 hdrs="$define sys/types.h
14360 $d_socket sys/socket.h
14361 $i_niin netinet/in.h
14363 $i_unistd unistd.h"
14364 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
14365 case "$netdb_net_type" in
14366 '') try="extern struct netent *getnetbyaddr($xxx, int);"
14367 if ./protochk "$try" $hdrs; then
14368 echo "Your system accepts $xxx."
14369 netdb_net_type="$xxx"
14374 : In case none of those worked, prompt the user.
14375 case "$netdb_net_type" in
14376 '') rp='What is the type for the 1st argument to getnetbyaddr?'
14379 netdb_net_type=$ans
14383 *) : no getnetbyaddr, so pick harmless default
14384 netdb_net_type='long'
14388 : locate the preferred pager for this system
14394 [a-zA-Z]:/*) dflt=$pg;;
14398 [a-zA-Z]:/*) dflt=$more;;
14402 [a-zA-Z]:/*) dflt=$less;;
14405 '') dflt=/usr/ucb/more;;
14412 rp='What pager is used on your system?'
14416 : see what type pids are declared as in the kernel
14417 rp="What is the type of process ids on this system?"
14418 set pid_t pidtype int stdio.h sys/types.h
14421 : Find earliest binary compatible site_perl subdirectory perl can use.
14422 case "$bincompat5005" in
14423 "$define") xs_apiversion='5.005' ;;
14424 *) xs_apiversion=$version ;; # The current site_perl version.
14426 : Find earliest pure perl site_perl subdirectory perl can use.
14427 : The versioned directories started at 5.005.
14428 pm_apiversion='5.005'
14430 : see if ar generates random libraries by itself
14432 echo "Checking how to generate random libraries on your machine..." >&4
14433 echo 'int bar1() { return bar2(); }' > bar1.c
14434 echo 'int bar2() { return 2; }' > bar2.c
14435 $cat > foo.c <<'EOP'
14436 int main() { printf("%d\n", bar1()); exit(0); }
14438 $cc $ccflags -c bar1.c >/dev/null 2>&1
14439 $cc $ccflags -c bar2.c >/dev/null 2>&1
14440 $cc $ccflags -c foo.c >/dev/null 2>&1
14441 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
14442 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
14443 ./foobar >/dev/null 2>&1; then
14444 echo "$ar appears to generate random libraries itself."
14447 elif $ar ts bar$_a >/dev/null 2>&1 &&
14448 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
14449 ./foobar >/dev/null 2>&1; then
14450 echo "a table of contents needs to be added with '$ar ts'."
14457 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
14458 $test -f $ranlib || ranlib=''
14461 if $test -n "$ranlib"; then
14462 echo "your system has '$ranlib'; we'll use that."
14465 echo "your system doesn't seem to support random libraries"
14466 echo "so we'll use lorder and tsort to order the libraries."
14473 : check for type of arguments to select.
14474 case "$selecttype" in
14475 '') case "$d_select" in
14479 Checking to see what type of arguments are accepted by select().
14481 hdrs="$define sys/types.h
14482 $i_systime sys/time.h
14483 $i_sysselct sys/select.h
14484 $d_socket sys/socket.h"
14485 : The first arg can be int, unsigned, or size_t
14486 : The last arg may or may not be 'const'
14488 : void pointer has been seen but using that
14489 : breaks the selectminbits test
14490 for xxx in 'fd_set *' 'int *'; do
14491 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
14492 for tmo in 'struct timeval *' 'const struct timeval *'; do
14494 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
14495 if ./protochk "$try" $hdrs; then
14496 echo "Your system accepts $xxx."
14505 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
14506 case "$d_fd_set" in
14507 $define) dflt="fd_set *" ;;
14516 *) : no select, so pick a harmless default
14523 : check for the select 'width'
14524 case "$selectminbits" in
14525 '') case "$d_select" in
14529 Checking to see on how many bits at a time your select() operates...
14532 #include <sys/types.h>
14534 #$i_systime I_SYS_TIME
14535 #$i_systimek I_SYS_TIME_KERNEL
14540 # ifdef I_SYS_TIME_KERNEL
14543 # include <sys/time.h>
14544 # ifdef I_SYS_TIME_KERNEL
14548 #$i_sysselct I_SYS_SELECT
14549 #ifdef I_SYS_SELECT
14550 #include <sys/select.h>
14552 #$d_socket HAS_SOCKET
14554 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
14558 #define S sizeof(*(b))
14560 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
14561 #define NBITS (NBYTES * 8)
14570 fp = fopen("try.c", "r");
14576 b = ($selecttype)s;
14577 for (i = 0; i < NBITS; i++)
14581 select(fd + 1, b, 0, 0, &t);
14582 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
14583 printf("%d\n", i + 1);
14588 if eval $compile_ok; then
14589 selectminbits=`./try`
14590 case "$selectminbits" in
14592 Cannot figure out on how many bits at a time your select() operates.
14593 I'll play safe and guess it is 32 bits.
14599 *) bits="$selectminbits bits" ;;
14601 echo "Your select() operates on $bits at a time." >&4
14603 rp='What is the minimum number of bits your select() operates on?'
14604 case "$byteorder" in
14605 1234|12345678) dflt=32 ;;
14610 selectminbits="$val"
14614 *) : no select, so pick a harmless default
14621 : Trace out the files included by signal.h, then look for SIGxxx names.
14622 : Remove SIGARRAYSIZE used by HPUX.
14623 : Remove SIGSTKSIZE used by Linux.
14624 : Remove SIGSTKSZ used by Posix.
14625 : Remove SIGTYP void lines used by OS2.
14626 : Some cpps, like os390, dont give the file name anywhere
14627 if [ "X$fieldn" = X ]; then
14628 : Just make some guesses. We check them later.
14629 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
14631 xxx=`echo '#include <signal.h>' |
14632 $cppstdin $cppminus $cppflags 2>/dev/null |
14633 $grep '^[ ]*#.*include' |
14634 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
14636 : Check this list of files to be sure we have parsed the cpp output ok.
14637 : This will also avoid potentially non-existent files, such
14640 for xx in $xxx /dev/null ; do
14641 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
14643 : If we have found no files, at least try signal.h
14644 case "$xxxfiles" in
14645 '') xxxfiles=`./findhdr signal.h` ;;
14648 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
14649 print substr($2, 4, 20)
14651 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
14652 print substr($3, 4, 20)
14654 : Append some common names just in case the awk scan failed.
14655 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
14656 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
14657 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
14658 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
14659 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
14661 : generate a few handy files for later
14662 $cat > signal.c <<'EOCP'
14663 #include <sys/types.h>
14664 #include <signal.h>
14668 /* Strange style to avoid deeply-nested #if/#else/#endif */
14671 # define NSIG (_NSIG)
14677 # define NSIG (SIGMAX+1)
14683 # define NSIG (SIG_MAX+1)
14689 # define NSIG (MAXSIG+1)
14695 # define NSIG (MAX_SIG+1)
14700 # ifdef SIGARRAYSIZE
14701 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
14707 # define NSIG (_sys_nsig) /* Solaris 2.5 */
14711 /* Default to some arbitrary number that's big enough to get most
14712 of the common signals.
14718 printf("NSIG %d\n", NSIG);
14724 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
14726 printf "#ifdef SIG"; printf $1; printf "\n"
14727 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
14728 printf $1; printf ");\n"
14732 printf "#endif /* JUST_NSIG */\n";
14733 printf "exit(0);\n}\n";
14736 $cat >signal.awk <<'EOP'
14737 BEGIN { ndups = 0 }
14738 $1 ~ /^NSIG$/ { nsig = $2 }
14739 ($1 !~ /^NSIG$/) && (NF == 2) {
14740 if ($2 > maxsig) { maxsig = $2 }
14741 if (sig_name[$2]) {
14742 dup_name[ndups] = $1
14743 dup_num[ndups] = $2
14755 printf("NSIG %d\n", nsig);
14756 for (n = 1; n < nsig; n++) {
14758 printf("%s %d\n", sig_name[n], sig_num[n])
14761 printf("NUM%d %d\n", n, n)
14764 for (n = 0; n < ndups; n++) {
14765 printf("%s %d\n", dup_name[n], dup_num[n])
14769 $cat >signal_cmd <<EOS
14771 if $test -s signal.lst; then
14772 echo "Using your existing signal.lst file"
14777 $cat >>signal_cmd <<'EOS'
14780 if eval $compile_ok; then
14781 ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
14783 echo "(I can't seem be able to compile the whole test program)" >&4
14784 echo "(I'll try it in little pieces.)" >&4
14785 set signal -DJUST_NSIG
14786 if eval $compile_ok; then
14787 ./signal$_exe > signal.nsg
14790 echo "I can't seem to figure out how many signals you have." >&4
14791 echo "Guessing 50." >&4
14792 echo 'NSIG 50' > signal.nsg
14794 : Now look at all the signal names, one at a time.
14795 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
14796 $cat > signal.c <<EOCP
14797 #include <sys/types.h>
14798 #include <signal.h>
14801 printf("$xx %d\n", SIG${xx});
14806 if eval $compile; then
14807 echo "SIG${xx} found."
14808 ./signal$_exe >> signal.ls1
14810 echo "SIG${xx} NOT found."
14813 if $test -s signal.ls1; then
14814 $cat signal.nsg signal.ls1 |
14815 $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
14819 if $test -s signal.lst; then
14822 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
14823 echo 'kill -l' >signal
14824 set X `csh -f <signal`
14828 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
14830 echo $@ | $tr ' ' $trnl | \
14831 $awk '{ printf "%s %d\n", $1, ++s; }
14832 END { printf "NSIG %d\n", ++s }' >signal.lst
14834 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
14836 chmod a+x signal_cmd
14837 $eunicefix signal_cmd
14839 : generate list of signal names
14841 case "$sig_name_init" in
14843 *) case "$sig_num_init" in
14844 ''|*,*) doinit=yes ;;
14849 echo "Generating a list of signal names and numbers..." >&4
14851 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
14852 sig_name=`$awk 'BEGIN { printf "ZERO " }
14853 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
14854 sig_num=`$awk 'BEGIN { printf "0 " }
14855 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
14856 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
14857 !/^NSIG/ { printf "\"%s\", ", $1 }
14858 END { printf "0\n" }' signal.lst`
14859 sig_num_init=`$awk 'BEGIN { printf "0, " }
14860 !/^NSIG/ { printf "%d, ", $2}
14861 END { printf "0\n"}' signal.lst`
14864 echo "The following $sig_count signals are available:"
14866 echo $sig_name | $awk \
14867 'BEGIN { linelen = 0 }
14869 for (i = 1; i <= NF; i++) {
14870 name = "SIG" $i " "
14871 linelen = linelen + length(name)
14872 if (linelen > 70) {
14874 linelen = length(name)
14880 sig_size=`echo $sig_name | awk '{print NF}'`
14881 $rm -f signal signal.c signal.awk signal.lst signal_cmd
14884 case "$sizetype" in
14885 *_t) zzz="$sizetype" ;;
14886 *) zzz="filesize" ;;
14888 echo "Checking the size of $zzz..." >&4
14890 #include <sys/types.h>
14893 printf("%d\n", (int)sizeof($sizetype));
14898 if eval $compile_ok; then
14902 echo "(I can't execute the test program--guessing $sizesize.)" >&4
14905 echo "Your $zzz size is $sizesize bytes."
14910 echo "(I can't compile the test program--guessing $sizesize.)" >&4
14914 : check for socklen_t
14916 echo "Checking to see if you have socklen_t..." >&4
14918 #include <sys/types.h>
14919 #$d_socket HAS_SOCKET
14921 #include <sys/socket.h>
14923 int main() { socklen_t x = 16; }
14926 if eval $compile; then
14928 echo "You have socklen_t."
14931 echo "You do not have socklen_t."
14932 case "$sizetype" in
14933 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
14940 : see if this is a socks.h system
14941 set socks.h i_socks
14944 : check for type of the size argument to socket calls
14945 case "$d_socket" in
14949 Checking to see what type is the last argument of accept().
14952 case "$d_socklen_t" in
14953 "$define") yyy="$yyy socklen_t"
14955 yyy="$yyy $sizetype int long unsigned"
14956 for xxx in $yyy; do
14957 case "$socksizetype" in
14958 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
14959 case "$usesocks" in
14961 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
14962 echo "Your system accepts '$xxx *' for the last argument of accept()."
14963 socksizetype="$xxx"
14966 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
14967 echo "Your system accepts '$xxx *' for the last argument of accept()."
14968 socksizetype="$xxx"
14975 : In case none of those worked, prompt the user.
14976 case "$socksizetype" in
14977 '') rp='What is the type for socket address structure sizes?'
14984 *) : no sockets, so pick relatively harmless default
14989 : see what type is used for signed size_t
14990 set ssize_t ssizetype int stdio.h sys/types.h
14993 $cat > ssize.c <<EOM
14995 #include <sys/types.h>
14996 #define Size_t $sizetype
14997 #define SSize_t $dflt
15000 if (sizeof(Size_t) == sizeof(SSize_t))
15002 else if (sizeof(Size_t) == sizeof(int))
15011 if eval $compile_ok && ./ssize > /dev/null; then
15012 ssizetype=`./ssize`
15013 echo "I'll be using $ssizetype for functions returning a byte count." >&4
15016 Help! I can't compile and run the ssize_t test program: please enlighten me!
15017 (This is probably a misconfiguration in your system or libraries, and
15018 you really ought to fix it. Still, I'll try anyway.)
15020 I need a type that is the same size as $sizetype, but is guaranteed to
15021 be signed. Common values are ssize_t, int and long.
15024 rp="What signed type is the same size as $sizetype?"
15028 $rm -f ssize ssize.*
15030 : see what type of char stdio uses.
15032 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
15033 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
15034 echo "Your stdio uses unsigned chars." >&4
15035 stdchar="unsigned char"
15037 echo "Your stdio uses signed chars." >&4
15044 : see if time exists
15046 if test "X$d_time" = X -o X"$timetype" = X; then
15047 if set time val -f d_time; eval $csym; $val; then
15048 echo 'time() found.' >&4
15050 rp="What is the type returned by time() on this system?"
15051 set time_t timetype long stdio.h sys/types.h
15054 echo 'time() not found, hope that will do.' >&4
15062 : see what type uids are declared as in the kernel
15064 echo "Looking for the type for user ids returned by getuid()."
15065 set uid_t uidtype xxx stdio.h sys/types.h
15069 xxx=`./findhdr sys/user.h`
15070 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
15072 unsigned) dflt="$1 $2" ;;
15076 *) dflt="$uidtype";;
15079 uid_t) echo "uid_t found." ;;
15080 *) rp="What is the type for user ids returned by getuid()?"
15088 *_t) zzz="$uidtype" ;;
15091 echo "Checking the size of $zzz..." >&4
15093 #include <sys/types.h>
15096 printf("%d\n", (int)sizeof($uidtype));
15101 if eval $compile_ok; then
15105 echo "(I can't execute the test program--guessing $uidsize.)" >&4
15108 echo "Your $zzz is $uidsize bytes long."
15113 echo "(I can't compile the test program--guessing $uidsize.)" >&4
15118 *_t) zzz="$uidtype" ;;
15121 echo "Checking the sign of $zzz..." >&4
15123 #include <sys/types.h>
15134 if eval $compile; then
15138 echo "(I can't execute the test program--guessing unsigned.)" >&4
15142 1) echo "Your $zzz is unsigned." ;;
15143 -1) echo "Your $zzz is signed." ;;
15149 echo "(I can't compile the test program--guessing unsigned.)" >&4
15155 $echo "Checking the format string to be used for uids..." >&4
15158 -1) if $test X"$uidsize" = X"$ivsize"; then
15159 uidformat="$ivdformat"
15161 if $test X"$uidsize" = X"$longsize"; then
15164 if $test X"$uidsize" = X"$intsize"; then
15167 if $test X"$uidsize" = X"$shortsize"; then
15174 *) if $test X"$uidsize" = X"$uvsize"; then
15175 uidformat="$uvuformat"
15177 if $test X"$uidsize" = X"$longsize"; then
15180 if $test X"$uidsize" = X"$intsize"; then
15183 if $test X"$uidsize" = X"$shortsize"; then
15192 : determine compiler compiler
15201 if $test -f "$byacc"; then
15203 comp="byacc or $comp"
15205 if $test -f "$bison"; then
15206 comp="$comp or bison -y"
15208 rp="Which compiler compiler ($comp) shall I use?"
15217 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
15223 : see if dbm.h is available
15224 : see if dbmclose exists
15225 set dbmclose d_dbmclose
15228 case "$d_dbmclose" in
15238 *) set rpcsvc/dbm.h i_rpcsvcdbm
15243 *) echo "We won't be including <dbm.h>"
15253 : see if this is a sys/file.h system
15258 : do we need to include sys/file.h ?
15262 if $h_sysfile; then
15264 echo "We'll be including <sys/file.h>." >&4
15267 echo "We won't be including <sys/file.h>." >&4
15277 : see if fcntl.h is there
15282 : see if we can include fcntl.h
15288 echo "We'll be including <fcntl.h>." >&4
15291 if $h_sysfile; then
15292 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
15294 echo "We won't be including <fcntl.h>." >&4
15306 : see if this is a iconv.h system
15307 set iconv.h i_iconv
15310 : see if this is a ieeefp.h system
15311 set ieeefp.h i_ieeefp
15314 : see if this is a libutil.h system
15315 set libutil.h i_libutil
15318 : see if locale.h is available
15319 set locale.h i_locale
15322 : see if mach cthreads are available
15323 if test "X$usethreads" = "X$define"; then
15324 set mach/cthreads.h i_machcthr
15327 i_machcthr="$undef"
15332 : see if this is a math.h system
15336 : see if this is a mntent.h system
15337 set mntent.h i_mntent
15340 : see if ndbm.h is available
15345 : see if dbm_open exists
15346 set dbm_open d_dbm_open
15348 case "$d_dbm_open" in
15351 echo "We won't be including <ndbm.h>"
15360 : see if net/errno.h is available
15362 set net/errno.h val
15365 : Unfortunately, it causes problems on some systems. Arrgh.
15368 cat > try.c <<'EOM'
15371 #include <net/errno.h>
15377 if $cc $ccflags -c try.c >/dev/null 2>&1; then
15378 echo "We'll be including <net/errno.h>." >&4
15380 echo "We won't be including <net/errno.h>." >&4
15389 : see if netinet/tcp.h is available
15390 set netinet/tcp.h i_netinettcp
15393 : see if this is a poll.h system
15397 : see if this is a prot.h system
15402 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
15403 $cat <<'EOSH' > Cppsym.know
15404 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
15405 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
15406 alliant alpha am29000 AM29000 AMD64 amiga AMIGAOS AMIX
15407 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
15408 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
15409 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
15410 bull c cadmus clipper CMU COFF COMPILER_VERSION
15411 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
15412 CYGWIN DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
15413 Dynix DynixPTX ELF encore EPI EXTENSIONS FILE_OFFSET_BITS
15414 FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
15415 GNU_SOURCE GNUC GNUC_MINOR GO32 gould GOULD_PN
15416 H3050R H3050RX hbullx20 hcx host_mips
15417 hp200 hp300 hp700 HP700 hp800 hp9000
15418 hp9000s200 hp9000s300 hp9000s400 hp9000s500
15419 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
15420 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
15421 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
15422 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
15423 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
15424 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
15425 Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
15426 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
15427 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
15428 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
15429 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
15430 MATH_HAS_NO_SIDE_EFFECTS
15431 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
15432 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
15433 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
15434 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
15435 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
15436 NetBSD news1500 news1700 news1800 news1900 news3700
15437 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
15438 ns32016 ns32332 ns32k nsc32000
15439 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
15440 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
15441 pc532 pdp11 PGC PIC plexus PORTAR posix
15442 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
15443 POSIX_C_SOURCE POSIX_SOURCE POWER
15444 PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
15445 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
15446 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
15447 sony sony_news sonyrisc sparc sparclite spectrum
15448 stardent stdc STDC_EXT stratos sun sun3 sun386
15449 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
15450 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
15451 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
15452 sysV68 sysV88 Tek4132 Tek4300 titan
15453 TM3200 TM5400 TM5600
15454 tower tower32 tower32_200 tower32_600 tower32_700
15455 tower32_800 tower32_850 tss
15456 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
15457 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
15458 unix UNIX95 UNIX99 unixpc unos USGr4 USGr4_2
15459 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms xenix Xenix286
15460 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
15461 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
15464 # Maybe put other stuff here too.
15465 cat <<EOSH >>Cppsym.know
15468 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
15469 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
15470 $cat Cppsym.know > Cppsym.c
15471 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
15472 $rm -f Cppsym.a Cppsym.b Cppsym.c
15473 cat <<EOSH > Cppsym
15475 if $test \$# -gt 0; then
15476 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
15477 if $test -s Cppsym.got; then
15484 $tr " " "$trnl" | ./Cppsym.try
15490 cat <<EOSH > Cppsym.try
15492 cat <<'EOCP' > try.c
15498 cat <<'EOSH' >> Cppsym.try
15500 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
15501 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
15502 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
15503 printf "#ifdef __%s__\n#if __%s__+0\nprintf(\"__%s__=%%ld\\n\", __%s__);\n#else\nprintf(\"__%s__\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1
15507 cat <<EOSH >> Cppsym.try
15509 case "$osname-$gccversion" in
15510 irix-) ccflags="\$ccflags -woff 1178" ;;
15511 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
15513 $cc -o try $optimize \$ccflags $ldflags try.c $libs && ./try$exe_ext
15515 chmod +x Cppsym.try
15516 $eunicefix Cppsym.try
15517 ./Cppsym < Cppsym.know > Cppsym.true
15518 : now check the C compiler for additional symbols
15519 postprocess_cc_v=''
15521 aix) postprocess_cc_v="|$tr , ' '" ;;
15528 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
15531 -D*) echo "\$i" | $sed 's/^-D//';;
15532 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
15537 postprocess_cc_v=''
15540 ./ccsym > ccsym1.raw
15541 if $test -s ccsym1.raw; then
15542 $sort ccsym1.raw | $uniq >ccsym.raw
15544 mv ccsym1.raw ccsym.raw
15547 $awk '/\=/ { print $0; next }
15548 { print $0"=1" }' ccsym.raw >ccsym.list
15549 $awk '/\=/ { print $0; next }
15550 { print $0"=1" }' Cppsym.true >ccsym.true
15551 $comm -13 ccsym.true ccsym.list >ccsym.own
15552 $comm -12 ccsym.true ccsym.list >ccsym.com
15553 $comm -23 ccsym.true ccsym.list >ccsym.cpp
15555 if $test -z ccsym.raw; then
15556 echo "Your C compiler doesn't seem to define any symbols!" >&4
15558 echo "However, your C preprocessor defines the following symbols:"
15561 cppsymbols=`$cat Cppsym.true`
15562 cppsymbols=`echo $cppsymbols`
15563 cppccsymbols="$cppsymbols"
15565 if $test -s ccsym.com; then
15566 echo "Your C compiler and pre-processor define these symbols:"
15567 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
15570 cppccsymbols=`$cat ccsym.com`
15571 cppccsymbols=`echo $cppccsymbols`
15572 $test "$silent" || sleep 1
15574 if $test -s ccsym.cpp; then
15575 $test "$also" && echo " "
15576 echo "Your C pre-processor ${also}defines the following symbols:"
15577 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
15579 cppsymbols=`$cat ccsym.cpp`
15580 cppsymbols=`echo $cppsymbols`
15581 $test "$silent" || sleep 1
15583 if $test -s ccsym.own; then
15584 $test "$also" && echo " "
15585 echo "Your C compiler ${also}defines the following cpp symbols:"
15586 $sed -e 's/\(..*\)=1/\1/' ccsym.own
15587 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
15588 ccsymbols=`$cat ccsym.own`
15589 ccsymbols=`echo $ccsymbols`
15590 $test "$silent" || sleep 1
15593 $rm -f ccsym* Cppsym.*
15595 : see if this is a termio system
15599 if $test `./findhdr termios.h`; then
15600 set tcsetattr i_termios
15606 "$define") echo "You have POSIX termios.h... good!" >&4;;
15607 *) if ./Cppsym pyr; then
15608 case "`/bin/universe`" in
15609 ucb) if $test `./findhdr sgtty.h`; then
15611 echo "<sgtty.h> found." >&4
15613 echo "System is pyramid with BSD universe."
15614 echo "<sgtty.h> not found--you could have problems." >&4
15616 *) if $test `./findhdr termio.h`; then
15618 echo "<termio.h> found." >&4
15620 echo "System is pyramid with USG universe."
15621 echo "<termio.h> not found--you could have problems." >&4
15625 if $test `./findhdr termio.h`; then
15626 echo "<termio.h> found." >&4
15628 elif $test `./findhdr sgtty.h`; then
15629 echo "<sgtty.h> found." >&4
15632 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
15635 if $test `./findhdr sgtty.h`; then
15636 echo "<sgtty.h> found." >&4
15638 elif $test `./findhdr termio.h`; then
15639 echo "<termio.h> found." >&4
15642 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
15646 set i_termio; eval $setvar
15647 val=$val2; set i_sgtty; eval $setvar
15648 val=$val3; set i_termios; eval $setvar
15650 : see if this is a shadow.h system
15651 set shadow.h i_shadow
15654 : see if stddef is available
15655 set stddef.h i_stddef
15658 : see if this is a sunmath.h system
15659 set sunmath.h i_sunmath
15662 : see if sys/access.h is available
15663 set sys/access.h i_sysaccess
15666 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
15667 set sys/filio.h i_sysfilio
15670 if $test `./findhdr sys/ioctl.h`; then
15672 echo '<sys/ioctl.h> found.' >&4
15675 if $test $i_sysfilio = "$define"; then
15676 echo '<sys/ioctl.h> NOT found.' >&4
15678 $test $i_sgtty = "$define" && xxx="sgtty.h"
15679 $test $i_termio = "$define" && xxx="termio.h"
15680 $test $i_termios = "$define" && xxx="termios.h"
15681 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
15687 : see if socket ioctl defs are in sys/sockio.h
15689 xxx=`./findhdr sys/sockio.h`
15690 if $test "$xxx"; then
15691 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
15693 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
15696 echo "No socket ioctls found in <sys/sockio.h>." >&4
15701 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
15708 : see if this is a syslog.h system
15709 set syslog.h i_syslog
15713 : see if this is a sys/mode.h system
15714 set sys/mode.h i_sysmode
15717 : see if sys/resource.h has to be included
15718 set sys/resource.h i_sysresrc
15721 : see if sys/security.h is available
15722 set sys/security.h i_syssecrt
15725 : see if this is a sys/statvfs.h system
15726 set sys/statvfs.h i_sysstatvfs
15729 : see if this is a sys/un.h system
15730 set sys/un.h i_sysun
15734 : see if this is a sys/utsname.h system
15735 set sys/utsname.h i_sysutsname
15738 : see if this is a syswait system
15739 set sys/wait.h i_syswait
15742 : see if this is a ustat.h system
15743 set ustat.h i_ustat
15746 : see if this is an utime system
15747 set utime.h i_utime
15750 : see if this is a values.h system
15751 set values.h i_values
15754 : see if this is a vfork system
15757 set vfork.h i_vfork
15765 : see if gdbm.h is available
15770 : see if gdbm_open exists
15771 set gdbm_open d_gdbm_open
15773 case "$d_gdbm_open" in
15776 echo "We won't be including <gdbm.h>"
15786 echo "Looking for extensions..." >&4
15787 : If we are using the old config.sh, known_extensions may contain
15788 : old or inaccurate or duplicate values.
15789 known_extensions=''
15790 nonxs_extensions=''
15791 : We do not use find because it might not be available.
15792 : We do not just use MANIFEST because the user may have dropped
15793 : some additional extensions into the source tree and expect them
15796 : Function to recursively find available extensions, ignoring DynaLoader
15797 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
15801 DynaLoader|dynaload) ;;
15803 if $test -f $xxx/$xxx.xs; then
15804 known_extensions="$known_extensions $1$xxx";
15805 elif $test -f $xxx/Makefile.PL; then
15806 nonxs_extensions="$nonxs_extensions $1$xxx";
15808 if $test -d $xxx -a $# -lt 10; then
15811 eval $find_extensions;
15823 eval $find_extensions
15824 set X $nonxs_extensions
15826 nonxs_extensions="$*"
15827 set X $known_extensions
15829 known_extensions="$*"
15832 : Now see which are supported on this system.
15834 for xxx in $known_extensions ; do
15838 $define) avail_ext="$avail_ext $xxx" ;;
15841 GDBM_File|gdbm_fil)
15843 $define) avail_ext="$avail_ext $xxx" ;;
15846 NDBM_File|ndbm_fil)
15849 case "$osname-$use64bitint" in
15852 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
15855 *) avail_ext="$avail_ext $xxx" ;;
15860 ODBM_File|odbm_fil)
15861 case "${i_dbm}${i_rpcsvcdbm}" in
15863 case "$osname-$use64bitint" in
15866 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
15869 *) avail_ext="$avail_ext $xxx" ;;
15875 case "$useposix" in
15876 true|define|y) avail_ext="$avail_ext $xxx" ;;
15880 case "$useopcode" in
15881 true|define|y) avail_ext="$avail_ext $xxx" ;;
15885 case "$d_socket" in
15886 true|$define|y) avail_ext="$avail_ext $xxx" ;;
15889 Sys/Syslog|sys/syslog)
15890 : XXX syslog requires socket
15891 case "$d_socket" in
15892 true|$define|y) avail_ext="$avail_ext $xxx" ;;
15896 case "$usethreads" in
15897 true|$define|y) avail_ext="$avail_ext $xxx" ;;
15901 : XXX Do we need a useipcsysv variable here
15902 case "${d_msg}${d_sem}${d_shm}" in
15903 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
15906 *) avail_ext="$avail_ext $xxx"
15915 : Now see which nonxs extensions are supported on this system.
15916 : For now assume all are.
15918 for xxx in $nonxs_extensions ; do
15920 *) nonxs_ext="$nonxs_ext $xxx"
15932 A number of extensions are supplied with $package. You may choose to
15933 compile these extensions for dynamic loading (the default), compile
15934 them into the $package executable (static loading), or not include
15935 them at all. Answer "none" to include no extensions.
15936 Note that DynaLoader is always built and need not be mentioned here.
15939 case "$dynamic_ext" in
15940 '') dflt="$avail_ext" ;;
15941 *) dflt="$dynamic_ext"
15942 # Perhaps we are reusing an old out-of-date config.sh.
15945 if test X"$dynamic_ext" != X"$avail_ext"; then
15947 NOTICE: Your previous config.sh list may be incorrect.
15948 The extensions now available to you are
15950 but the default list from your previous config.sh is
15962 rp="What extensions do you wish to load dynamically?"
15965 none) dynamic_ext=' ' ;;
15966 *) dynamic_ext="$ans" ;;
15969 case "$static_ext" in
15971 : Exclude those already listed in dynamic linking
15973 for xxx in $avail_ext; do
15974 case " $dynamic_ext " in
15976 *) dflt="$dflt $xxx" ;;
15983 *) dflt="$static_ext"
15990 rp="What extensions do you wish to load statically?"
15993 none) static_ext=' ' ;;
15994 *) static_ext="$ans" ;;
15999 A number of extensions are supplied with $package. Answer "none"
16000 to include no extensions.
16001 Note that DynaLoader is always built and need not be mentioned here.
16004 case "$static_ext" in
16005 '') dflt="$avail_ext" ;;
16006 *) dflt="$static_ext"
16007 # Perhaps we are reusing an old out-of-date config.sh.
16010 if test X"$static_ext" != X"$avail_ext"; then
16012 NOTICE: Your previous config.sh list may be incorrect.
16013 The extensions now available to you are
16015 but the default list from your previous config.sh is
16024 : Exclude those that are not xs extensions
16028 rp="What extensions do you wish to include?"
16031 none) static_ext=' ' ;;
16032 *) static_ext="$ans" ;;
16037 set X $dynamic_ext $static_ext $nonxs_ext
16041 : Remove libraries needed only for extensions
16042 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
16043 : The exception is SunOS 4.x, which needs them.
16044 case "${osname}X${osvers}" in
16048 *) case "$usedl" in
16049 $define|true|[yY]*)
16050 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
16054 *) perllibs="$libs"
16060 : Remove build directory name from cppstdin so it can be used from
16061 : either the present location or the final installed location.
16063 : Get out of the UU directory to get correct path name.
16065 case "$cppstdin" in
16067 echo "Stripping down cppstdin path name"
16073 : end of configuration questions
16075 echo "End of configuration questions."
16078 : back to where it started
16079 if test -d ../UU; then
16083 : configuration may be patched via a 'config.over' file
16084 if $test -f config.over; then
16087 rp='I see a config.over file. Do you wish to load it?'
16090 n*) echo "OK, I'll ignore it.";;
16092 echo "Configuration override changes have been loaded."
16097 : in case they want portability, strip down executable paths
16098 case "$d_portable" in
16101 echo "Stripping down executable paths..." >&4
16102 for file in $loclist $trylist; do
16104 eval $file=`basename $temp`
16109 : create config.sh file
16111 echo "Creating config.sh..." >&4
16112 $spitshell <<EOT >config.sh
16115 # This file was produced by running the Configure script. It holds all the
16116 # definitions figured out by Configure. Should you modify one of these values,
16117 # do not forget to propagate your changes by running "Configure -der". You may
16118 # instead choose to run each of the .SH files by yourself, or "Configure -S".
16121 # Package name : $package
16122 # Source directory : $src
16123 # Configuration time: $cf_time
16124 # Configured by : $cf_by
16125 # Target system : $myuname
16135 Revision='$Revision'
16143 alignbytes='$alignbytes'
16144 ansi2knr='$ansi2knr'
16145 aphostname='$aphostname'
16146 api_revision='$api_revision'
16147 api_subversion='$api_subversion'
16148 api_version='$api_version'
16149 api_versionstring='$api_versionstring'
16152 archlibexp='$archlibexp'
16153 archname64='$archname64'
16154 archname='$archname'
16155 archobjs='$archobjs'
16160 bincompat5005='$bincompat5005'
16164 byteorder='$byteorder'
16166 castflags='$castflags'
16169 cccdlflags='$cccdlflags'
16170 ccdlflags='$ccdlflags'
16172 ccflags_uselargefiles='$ccflags_uselargefiles'
16174 ccsymbols='$ccsymbols'
16175 ccversion='$ccversion'
16177 cf_email='$cf_email'
16179 charsize='$charsize'
16183 clocktype='$clocktype'
16185 compress='$compress'
16186 contains='$contains'
16190 cpp_stuff='$cpp_stuff'
16191 cppccsymbols='$cppccsymbols'
16192 cppflags='$cppflags'
16194 cppminus='$cppminus'
16196 cppstdin='$cppstdin'
16197 cppsymbols='$cppsymbols'
16198 crosscompile='$crosscompile'
16199 cryptlib='$cryptlib'
16201 d_Gconvert='$d_Gconvert'
16202 d_PRIEUldbl='$d_PRIEUldbl'
16203 d_PRIFUldbl='$d_PRIFUldbl'
16204 d_PRIGUldbl='$d_PRIGUldbl'
16205 d_PRIXU64='$d_PRIXU64'
16206 d_PRId64='$d_PRId64'
16207 d_PRIeldbl='$d_PRIeldbl'
16208 d_PRIfldbl='$d_PRIfldbl'
16209 d_PRIgldbl='$d_PRIgldbl'
16210 d_PRIi64='$d_PRIi64'
16211 d_PRIo64='$d_PRIo64'
16212 d_PRIu64='$d_PRIu64'
16213 d_PRIx64='$d_PRIx64'
16214 d_SCNfldbl='$d_SCNfldbl'
16215 d__fwalk='$d__fwalk'
16216 d_access='$d_access'
16217 d_accessx='$d_accessx'
16219 d_archlib='$d_archlib'
16222 d_attribut='$d_attribut'
16225 d_bincompat5005='$d_bincompat5005'
16227 d_bsdgetpgrp='$d_bsdgetpgrp'
16228 d_bsdsetpgrp='$d_bsdsetpgrp'
16230 d_casti32='$d_casti32'
16231 d_castneg='$d_castneg'
16232 d_charvspr='$d_charvspr'
16234 d_chroot='$d_chroot'
16235 d_chsize='$d_chsize'
16236 d_closedir='$d_closedir'
16237 d_cmsghdr_s='$d_cmsghdr_s'
16241 d_cuserid='$d_cuserid'
16242 d_dbl_dig='$d_dbl_dig'
16243 d_difftime='$d_difftime'
16244 d_dirnamlen='$d_dirnamlen'
16245 d_dlerror='$d_dlerror'
16246 d_dlopen='$d_dlopen'
16247 d_dlsymun='$d_dlsymun'
16248 d_dosuid='$d_dosuid'
16249 d_drand48proto='$d_drand48proto'
16251 d_eaccess='$d_eaccess'
16252 d_endgrent='$d_endgrent'
16253 d_endhent='$d_endhent'
16254 d_endnent='$d_endnent'
16255 d_endpent='$d_endpent'
16256 d_endpwent='$d_endpwent'
16257 d_endsent='$d_endsent'
16258 d_eofnblk='$d_eofnblk'
16259 d_eunice='$d_eunice'
16260 d_fchmod='$d_fchmod'
16261 d_fchown='$d_fchown'
16263 d_fcntl_can_lock='$d_fcntl_can_lock'
16264 d_fd_macros='$d_fd_macros'
16265 d_fd_set='$d_fd_set'
16266 d_fds_bits='$d_fds_bits'
16267 d_fgetpos='$d_fgetpos'
16268 d_flexfnam='$d_flexfnam'
16271 d_fpathconf='$d_fpathconf'
16272 d_fpos64_t='$d_fpos64_t'
16273 d_frexpl='$d_frexpl'
16274 d_fs_data_s='$d_fs_data_s'
16275 d_fseeko='$d_fseeko'
16276 d_fsetpos='$d_fsetpos'
16277 d_fstatfs='$d_fstatfs'
16278 d_fstatvfs='$d_fstatvfs'
16280 d_ftello='$d_ftello'
16282 d_getcwd='$d_getcwd'
16283 d_getespwnam='$d_getespwnam'
16284 d_getfsstat='$d_getfsstat'
16285 d_getgrent='$d_getgrent'
16286 d_getgrps='$d_getgrps'
16287 d_gethbyaddr='$d_gethbyaddr'
16288 d_gethbyname='$d_gethbyname'
16289 d_gethent='$d_gethent'
16290 d_gethname='$d_gethname'
16291 d_gethostprotos='$d_gethostprotos'
16292 d_getitimer='$d_getitimer'
16293 d_getlogin='$d_getlogin'
16294 d_getmnt='$d_getmnt'
16295 d_getmntent='$d_getmntent'
16296 d_getnbyaddr='$d_getnbyaddr'
16297 d_getnbyname='$d_getnbyname'
16298 d_getnent='$d_getnent'
16299 d_getnetprotos='$d_getnetprotos'
16300 d_getpagsz='$d_getpagsz'
16301 d_getpbyname='$d_getpbyname'
16302 d_getpbynumber='$d_getpbynumber'
16303 d_getpent='$d_getpent'
16304 d_getpgid='$d_getpgid'
16305 d_getpgrp2='$d_getpgrp2'
16306 d_getpgrp='$d_getpgrp'
16307 d_getppid='$d_getppid'
16308 d_getprior='$d_getprior'
16309 d_getprotoprotos='$d_getprotoprotos'
16310 d_getprpwnam='$d_getprpwnam'
16311 d_getpwent='$d_getpwent'
16312 d_getsbyname='$d_getsbyname'
16313 d_getsbyport='$d_getsbyport'
16314 d_getsent='$d_getsent'
16315 d_getservprotos='$d_getservprotos'
16316 d_getspnam='$d_getspnam'
16317 d_gettimeod='$d_gettimeod'
16318 d_gnulibc='$d_gnulibc'
16319 d_grpasswd='$d_grpasswd'
16320 d_hasmntopt='$d_hasmntopt'
16324 d_inetaton='$d_inetaton'
16325 d_int64_t='$d_int64_t'
16326 d_isascii='$d_isascii'
16328 d_isnanl='$d_isnanl'
16329 d_killpg='$d_killpg'
16330 d_lchown='$d_lchown'
16331 d_ldbl_dig='$d_ldbl_dig'
16333 d_locconv='$d_locconv'
16335 d_longdbl='$d_longdbl'
16336 d_longlong='$d_longlong'
16337 d_lseekproto='$d_lseekproto'
16339 d_madvise='$d_madvise'
16341 d_mbstowcs='$d_mbstowcs'
16342 d_mbtowc='$d_mbtowc'
16343 d_memchr='$d_memchr'
16344 d_memcmp='$d_memcmp'
16345 d_memcpy='$d_memcpy'
16346 d_memmove='$d_memmove'
16347 d_memset='$d_memset'
16349 d_mkdtemp='$d_mkdtemp'
16350 d_mkfifo='$d_mkfifo'
16351 d_mkstemp='$d_mkstemp'
16352 d_mkstemps='$d_mkstemps'
16353 d_mktime='$d_mktime'
16356 d_mprotect='$d_mprotect'
16358 d_msg_ctrunc='$d_msg_ctrunc'
16359 d_msg_dontroute='$d_msg_dontroute'
16360 d_msg_oob='$d_msg_oob'
16361 d_msg_peek='$d_msg_peek'
16362 d_msg_proxy='$d_msg_proxy'
16363 d_msgctl='$d_msgctl'
16364 d_msgget='$d_msgget'
16365 d_msghdr_s='$d_msghdr_s'
16366 d_msgrcv='$d_msgrcv'
16367 d_msgsnd='$d_msgsnd'
16369 d_munmap='$d_munmap'
16370 d_mymalloc='$d_mymalloc'
16372 d_nv_preserves_uv='$d_nv_preserves_uv'
16373 d_nv_preserves_uv_bits='$d_nv_preserves_uv_bits'
16374 d_off64_t='$d_off64_t'
16375 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
16376 d_oldpthreads='$d_oldpthreads'
16377 d_oldsock='$d_oldsock'
16379 d_pathconf='$d_pathconf'
16381 d_perl_otherlibdirs='$d_perl_otherlibdirs'
16382 d_phostname='$d_phostname'
16385 d_portable='$d_portable'
16386 d_pthread_yield='$d_pthread_yield'
16388 d_pwchange='$d_pwchange'
16389 d_pwclass='$d_pwclass'
16390 d_pwcomment='$d_pwcomment'
16391 d_pwexpire='$d_pwexpire'
16392 d_pwgecos='$d_pwgecos'
16393 d_pwpasswd='$d_pwpasswd'
16394 d_pwquota='$d_pwquota'
16397 d_readdir='$d_readdir'
16398 d_readlink='$d_readlink'
16400 d_realpath='$d_realpath'
16401 d_recvmsg='$d_recvmsg'
16402 d_rename='$d_rename'
16403 d_rewinddir='$d_rewinddir'
16405 d_safebcpy='$d_safebcpy'
16406 d_safemcpy='$d_safemcpy'
16407 d_sanemcmp='$d_sanemcmp'
16408 d_sbrkproto='$d_sbrkproto'
16409 d_sched_yield='$d_sched_yield'
16410 d_scm_rights='$d_scm_rights'
16411 d_seekdir='$d_seekdir'
16412 d_select='$d_select'
16414 d_semctl='$d_semctl'
16415 d_semctl_semid_ds='$d_semctl_semid_ds'
16416 d_semctl_semun='$d_semctl_semun'
16417 d_semget='$d_semget'
16419 d_sendmsg='$d_sendmsg'
16420 d_setegid='$d_setegid'
16421 d_seteuid='$d_seteuid'
16422 d_setgrent='$d_setgrent'
16423 d_setgrps='$d_setgrps'
16424 d_sethent='$d_sethent'
16425 d_setitimer='$d_setitimer'
16426 d_setlinebuf='$d_setlinebuf'
16427 d_setlocale='$d_setlocale'
16428 d_setnent='$d_setnent'
16429 d_setpent='$d_setpent'
16430 d_setpgid='$d_setpgid'
16431 d_setpgrp2='$d_setpgrp2'
16432 d_setpgrp='$d_setpgrp'
16433 d_setprior='$d_setprior'
16434 d_setproctitle='$d_setproctitle'
16435 d_setpwent='$d_setpwent'
16436 d_setregid='$d_setregid'
16437 d_setresgid='$d_setresgid'
16438 d_setresuid='$d_setresuid'
16439 d_setreuid='$d_setreuid'
16440 d_setrgid='$d_setrgid'
16441 d_setruid='$d_setruid'
16442 d_setsent='$d_setsent'
16443 d_setsid='$d_setsid'
16444 d_setvbuf='$d_setvbuf'
16448 d_shmatprototype='$d_shmatprototype'
16449 d_shmctl='$d_shmctl'
16451 d_shmget='$d_shmget'
16452 d_sigaction='$d_sigaction'
16453 d_sigprocmask='$d_sigprocmask'
16454 d_sigsetjmp='$d_sigsetjmp'
16455 d_sockatmark='$d_sockatmark'
16456 d_socket='$d_socket'
16457 d_socklen_t='$d_socklen_t'
16458 d_sockpair='$d_sockpair'
16459 d_socks5_init='$d_socks5_init'
16461 d_sresuproto='$d_sresuproto'
16462 d_statblks='$d_statblks'
16463 d_statfs_f_flags='$d_statfs_f_flags'
16464 d_statfs_s='$d_statfs_s'
16465 d_statvfs='$d_statvfs'
16466 d_stdio_cnt_lval='$d_stdio_cnt_lval'
16467 d_stdio_ptr_lval='$d_stdio_ptr_lval'
16468 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
16469 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
16470 d_stdio_stream_array='$d_stdio_stream_array'
16471 d_stdiobase='$d_stdiobase'
16472 d_stdstdio='$d_stdstdio'
16473 d_strchr='$d_strchr'
16474 d_strcoll='$d_strcoll'
16475 d_strctcpy='$d_strctcpy'
16476 d_strerrm='$d_strerrm'
16477 d_strerror='$d_strerror'
16478 d_strftime='$d_strftime'
16479 d_strtod='$d_strtod'
16480 d_strtol='$d_strtol'
16481 d_strtold='$d_strtold'
16482 d_strtoll='$d_strtoll'
16483 d_strtoq='$d_strtoq'
16484 d_strtoul='$d_strtoul'
16485 d_strtoull='$d_strtoull'
16486 d_strtouq='$d_strtouq'
16487 d_strxfrm='$d_strxfrm'
16488 d_suidsafe='$d_suidsafe'
16489 d_symlink='$d_symlink'
16490 d_syscall='$d_syscall'
16491 d_sysconf='$d_sysconf'
16492 d_sysernlst='$d_sysernlst'
16493 d_syserrlst='$d_syserrlst'
16494 d_system='$d_system'
16495 d_tcgetpgrp='$d_tcgetpgrp'
16496 d_tcsetpgrp='$d_tcsetpgrp'
16497 d_telldir='$d_telldir'
16498 d_telldirproto='$d_telldirproto'
16501 d_truncate='$d_truncate'
16502 d_tzname='$d_tzname'
16503 d_u32align='$d_u32align'
16504 d_ualarm='$d_ualarm'
16507 d_union_semun='$d_union_semun'
16508 d_usleep='$d_usleep'
16510 d_vendorarch='$d_vendorarch'
16511 d_vendorbin='$d_vendorbin'
16512 d_vendorlib='$d_vendorlib'
16514 d_void_closedir='$d_void_closedir'
16515 d_voidsig='$d_voidsig'
16516 d_voidtty='$d_voidtty'
16517 d_volatile='$d_volatile'
16518 d_vprintf='$d_vprintf'
16520 d_waitpid='$d_waitpid'
16521 d_wcstombs='$d_wcstombs'
16522 d_wctomb='$d_wctomb'
16523 d_writev='$d_writev'
16526 db_hashtype='$db_hashtype'
16527 db_prefixtype='$db_prefixtype'
16528 db_version_major='$db_version_major'
16529 db_version_minor='$db_version_minor'
16530 db_version_patch='$db_version_patch'
16531 defvoidused='$defvoidused'
16532 direntrytype='$direntrytype'
16535 doublesize='$doublesize'
16537 dynamic_ext='$dynamic_ext'
16543 eunicefix='$eunicefix'
16546 extensions='$extensions'
16547 fflushNULL='$fflushNULL'
16548 fflushall='$fflushall'
16550 firstmakefile='$firstmakefile'
16552 fpossize='$fpossize'
16553 fpostype='$fpostype'
16554 freetype='$freetype'
16556 full_csh='$full_csh'
16557 full_sed='$full_sed'
16558 gccosandvers='$gccosandvers'
16559 gccversion='$gccversion'
16560 gidformat='$gidformat'
16566 groupcat='$groupcat'
16567 groupstype='$groupstype'
16570 h_sysfile='$h_sysfile'
16581 i_arpainet='$i_arpainet'
16582 i_bsdioctl='$i_bsdioctl'
16585 i_dirent='$i_dirent'
16593 i_ieeefp='$i_ieeefp'
16594 i_inttypes='$i_inttypes'
16595 i_libutil='$i_libutil'
16596 i_limits='$i_limits'
16597 i_locale='$i_locale'
16598 i_machcthr='$i_machcthr'
16599 i_malloc='$i_malloc'
16601 i_memory='$i_memory'
16602 i_mntent='$i_mntent'
16605 i_neterrno='$i_neterrno'
16606 i_netinettcp='$i_netinettcp'
16610 i_pthread='$i_pthread'
16612 i_rpcsvcdbm='$i_rpcsvcdbm'
16615 i_shadow='$i_shadow'
16617 i_stdarg='$i_stdarg'
16618 i_stddef='$i_stddef'
16619 i_stdlib='$i_stdlib'
16620 i_string='$i_string'
16621 i_sunmath='$i_sunmath'
16622 i_sysaccess='$i_sysaccess'
16623 i_sysdir='$i_sysdir'
16624 i_sysfile='$i_sysfile'
16625 i_sysfilio='$i_sysfilio'
16627 i_sysioctl='$i_sysioctl'
16628 i_syslog='$i_syslog'
16629 i_sysmman='$i_sysmman'
16630 i_sysmode='$i_sysmode'
16631 i_sysmount='$i_sysmount'
16632 i_sysndir='$i_sysndir'
16633 i_sysparam='$i_sysparam'
16634 i_sysresrc='$i_sysresrc'
16635 i_syssecrt='$i_syssecrt'
16636 i_sysselct='$i_sysselct'
16637 i_syssockio='$i_syssockio'
16638 i_sysstat='$i_sysstat'
16639 i_sysstatfs='$i_sysstatfs'
16640 i_sysstatvfs='$i_sysstatvfs'
16641 i_systime='$i_systime'
16642 i_systimek='$i_systimek'
16643 i_systimes='$i_systimes'
16644 i_systypes='$i_systypes'
16645 i_sysuio='$i_sysuio'
16647 i_sysutsname='$i_sysutsname'
16648 i_sysvfs='$i_sysvfs'
16649 i_syswait='$i_syswait'
16650 i_termio='$i_termio'
16651 i_termios='$i_termios'
16653 i_unistd='$i_unistd'
16656 i_values='$i_values'
16657 i_varargs='$i_varargs'
16658 i_varhdr='$i_varhdr'
16660 ignore_versioned_solibs='$ignore_versioned_solibs'
16661 inc_version_list='$inc_version_list'
16662 inc_version_list_init='$inc_version_list_init'
16665 installarchlib='$installarchlib'
16666 installbin='$installbin'
16667 installman1dir='$installman1dir'
16668 installman3dir='$installman3dir'
16669 installprefix='$installprefix'
16670 installprefixexp='$installprefixexp'
16671 installprivlib='$installprivlib'
16672 installscript='$installscript'
16673 installsitearch='$installsitearch'
16674 installsitebin='$installsitebin'
16675 installsitelib='$installsitelib'
16676 installstyle='$installstyle'
16677 installusrbinperl='$installusrbinperl'
16678 installvendorarch='$installvendorarch'
16679 installvendorbin='$installvendorbin'
16680 installvendorlib='$installvendorlib'
16682 issymlink='$issymlink'
16683 ivdformat='$ivdformat'
16686 known_extensions='$known_extensions'
16689 lddlflags='$lddlflags'
16691 ldflags_uselargefiles='$ldflags_uselargefiles'
16692 ldlibpthname='$ldlibpthname'
16699 libsdirs='$libsdirs'
16700 libsfiles='$libsfiles'
16701 libsfound='$libsfound'
16702 libspath='$libspath'
16703 libswanted='$libswanted'
16704 libswanted_uselargefiles='$libswanted_uselargefiles'
16710 locincpth='$locincpth'
16711 loclibpth='$loclibpth'
16712 longdblsize='$longdblsize'
16713 longlongsize='$longlongsize'
16714 longsize='$longsize'
16718 lseeksize='$lseeksize'
16719 lseektype='$lseektype'
16723 make_set_make='$make_set_make'
16724 mallocobj='$mallocobj'
16725 mallocsrc='$mallocsrc'
16726 malloctype='$malloctype'
16728 man1direxp='$man1direxp'
16731 man3direxp='$man3direxp'
16733 mips_type='$mips_type'
16735 mmaptype='$mmaptype'
16736 modetype='$modetype'
16738 multiarch='$multiarch'
16740 myarchname='$myarchname'
16741 mydomain='$mydomain'
16742 myhostname='$myhostname'
16745 need_va_copy='$need_va_copy'
16746 netdb_hlen_type='$netdb_hlen_type'
16747 netdb_host_type='$netdb_host_type'
16748 netdb_name_type='$netdb_name_type'
16749 netdb_net_type='$netdb_net_type'
16752 nm_so_opt='$nm_so_opt'
16753 nonxs_ext='$nonxs_ext'
16755 nvEUformat='$nvEUformat'
16756 nvFUformat='$nvFUformat'
16757 nvGUformat='$nvGUformat'
16758 nveformat='$nveformat'
16759 nvfformat='$nvfformat'
16760 nvgformat='$nvgformat'
16763 o_nonblock='$o_nonblock'
16765 old_pthread_create_joinable='$old_pthread_create_joinable'
16766 optimize='$optimize'
16767 orderlib='$orderlib'
16770 otherlibdirs='$otherlibdirs'
16774 patchlevel='$patchlevel'
16775 path_sep='$path_sep'
16778 perl_patchlevel='$perl_patchlevel'
16779 perladmin='$perladmin'
16780 perllibs='$perllibs'
16781 perlpath='$perlpath'
16783 phostname='$phostname'
16786 pm_apiversion='$pm_apiversion'
16790 prefixexp='$prefixexp'
16792 privlibexp='$privlibexp'
16793 prototype='$prototype'
16795 quadkind='$quadkind'
16796 quadtype='$quadtype'
16797 randbits='$randbits'
16798 randfunc='$randfunc'
16799 randseedtype='$randseedtype'
16801 rd_nodata='$rd_nodata'
16802 revision='$revision'
16806 sPRIEUldbl='$sPRIEUldbl'
16807 sPRIFUldbl='$sPRIFUldbl'
16808 sPRIGUldbl='$sPRIGUldbl'
16809 sPRIXU64='$sPRIXU64'
16811 sPRIeldbl='$sPRIeldbl'
16812 sPRIfldbl='$sPRIfldbl'
16813 sPRIgldbl='$sPRIgldbl'
16818 sSCNfldbl='$sSCNfldbl'
16819 sched_yield='$sched_yield'
16820 scriptdir='$scriptdir'
16821 scriptdirexp='$scriptdirexp'
16823 seedfunc='$seedfunc'
16824 selectminbits='$selectminbits'
16825 selecttype='$selecttype'
16826 sendmail='$sendmail'
16829 sharpbang='$sharpbang'
16830 shmattype='$shmattype'
16831 shortsize='$shortsize'
16834 sig_count='$sig_count'
16835 sig_name='$sig_name'
16836 sig_name_init='$sig_name_init'
16838 sig_num_init='$sig_num_init'
16839 sig_size='$sig_size'
16840 signal_t='$signal_t'
16841 sitearch='$sitearch'
16842 sitearchexp='$sitearchexp'
16844 sitebinexp='$sitebinexp'
16846 sitelib_stem='$sitelib_stem'
16847 sitelibexp='$sitelibexp'
16848 siteprefix='$siteprefix'
16849 siteprefixexp='$siteprefixexp'
16850 sizesize='$sizesize'
16851 sizetype='$sizetype'
16855 sockethdr='$sockethdr'
16856 socketlib='$socketlib'
16857 socksizetype='$socksizetype'
16859 spackage='$spackage'
16860 spitshell='$spitshell'
16862 ssizetype='$ssizetype'
16863 startperl='$startperl'
16865 static_ext='$static_ext'
16867 stdio_base='$stdio_base'
16868 stdio_bufsiz='$stdio_bufsiz'
16869 stdio_cnt='$stdio_cnt'
16870 stdio_filbuf='$stdio_filbuf'
16871 stdio_ptr='$stdio_ptr'
16872 stdio_stream_array='$stdio_stream_array'
16875 subversion='$subversion'
16882 timeincl='$timeincl'
16883 timetype='$timetype'
16896 uidformat='$uidformat'
16902 uquadtype='$uquadtype'
16903 use5005threads='$use5005threads'
16904 use64bitall='$use64bitall'
16905 use64bitint='$use64bitint'
16907 useithreads='$useithreads'
16908 uselargefiles='$uselargefiles'
16909 uselongdouble='$uselongdouble'
16910 usemorebits='$usemorebits'
16911 usemultiplicity='$usemultiplicity'
16912 usemymalloc='$usemymalloc'
16914 useopcode='$useopcode'
16915 useperlio='$useperlio'
16916 useposix='$useposix'
16918 useshrplib='$useshrplib'
16919 usesocks='$usesocks'
16920 usethreads='$usethreads'
16921 usevendorprefix='$usevendorprefix'
16922 usevfork='$usevfork'
16925 uvXUformat='$uvXUformat'
16926 uvoformat='$uvoformat'
16929 uvuformat='$uvuformat'
16930 uvxformat='$uvxformat'
16931 vendorarch='$vendorarch'
16932 vendorarchexp='$vendorarchexp'
16933 vendorbin='$vendorbin'
16934 vendorbinexp='$vendorbinexp'
16935 vendorlib='$vendorlib'
16936 vendorlib_stem='$vendorlib_stem'
16937 vendorlibexp='$vendorlibexp'
16938 vendorprefix='$vendorprefix'
16939 vendorprefixexp='$vendorprefixexp'
16941 versiononly='$versiononly'
16943 voidflags='$voidflags'
16945 xs_apiversion='$xs_apiversion'
16947 yaccflags='$yaccflags'
16952 : Add in command line options if available
16953 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
16955 : add special variables
16956 $test -f $src/patchlevel.h && \
16957 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
16958 echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
16959 echo "PERL_CONFIG_SH=true" >>config.sh
16961 : propagate old symbols
16962 if $test -f UU/config.sh; then
16963 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
16964 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
16965 $sort | $uniq -u >UU/oldsyms
16966 set X `cat UU/oldsyms`
16972 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
16974 echo "# Variables propagated from previous config.sh file." >>config.sh
16975 for sym in `cat UU/oldsyms`; do
16976 echo " Propagating $hint variable "'$'"$sym..."
16977 eval 'tmp="$'"${sym}"'"'
16979 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
16985 : Finish up by extracting the .SH files
16999 If you'd like to make any changes to the config.sh file before I begin
17000 to configure things, do it as a shell escape now (e.g. !vi config.sh).
17003 rp="Press return or use a shell escape to edit config.sh:"
17008 *) : in case they cannot read
17009 sh 1>&4 -c "$ans";;
17014 : if this fails, just run all the .SH files by hand
17021 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
17028 Now you need to generate make dependencies by running "$make depend".
17029 You might prefer to run it in background: "$make depend > makedepend.out &"
17030 It can take a while, so you might not want to run it right now.
17035 rp="Run $make depend now?"
17039 $make depend && echo "Now you must run '$make'."
17042 echo "You must run '$make depend' then '$make'."
17045 elif test -f [Mm]akefile; then
17047 echo "Now you must run a $make."
17052 if $test -f Policy.sh; then
17055 If you compile $package on a different machine or from a different object
17056 directory, copy the Policy.sh file from this object directory to the
17057 new one before you run Configure -- this will help you with most of
17058 the policy defaults.
17062 if $test -f config.msg; then
17063 echo "Hmm. I also noted the following information while running:"
17065 $cat config.msg >&4
17068 $rm -f kit*isdone ark*isdone