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 Wed May 30 17:55: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=''
554 d_stdio_ptr_lval_nochange_cnt=''
555 d_stdio_ptr_lval_sets_cnt=''
732 inc_version_list_init=''
751 ignore_versioned_solibs=''
810 d_perl_otherlibdirs=''
828 d_nv_preserves_uv_bits=''
927 d_stdio_stream_array=''
928 stdio_stream_array=''
938 ccflags_uselargefiles=''
939 ldflags_uselargefiles=''
940 libswanted_uselargefiles=''
985 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
988 : We must find out about Eunice early
990 if test -f /etc/unixtovms; then
991 eunicefix=/etc/unixtovms
993 if test -f /etc/unixtovms.exe; then
994 eunicefix=/etc/unixtovms.exe
1001 : set useposix=false in your hint file to disable the POSIX extension.
1003 : set useopcode=false in your hint file to disable the Opcode extension.
1005 : Trailing extension. Override this in a hint file, if needed.
1007 : Extra object files, if any, needed on this platform.
1010 : Possible local include directories to search.
1011 : Set locincpth to "" in a hint file to defeat local include searches.
1012 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1013 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1015 : no include file wanted by default
1019 : change the next line if compiling for Xenix/286 on Xenix/386
1020 xlibpth='/usr/lib/386 /lib/386'
1021 : Possible local library directories to search.
1022 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1023 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1025 : general looking path for locating libraries
1026 glibpth="/lib /usr/lib $xlibpth"
1027 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1028 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1029 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1031 : Private path used by Configure to find libraries. Its value
1032 : is prepended to libpth. This variable takes care of special
1033 : machines, like the mips. Usually, it should be empty.
1036 : default library list
1038 : some systems want to use only the non-versioned libso:s
1039 ignore_versioned_solibs=''
1041 ccflags_uselargefiles=''
1042 ldflags_uselargefiles=''
1043 libswanted_uselargefiles=''
1044 : set usemultiplicity on the Configure command line to enable multiplicity.
1045 : set usesocks on the Configure command line to enable socks.
1046 : set usethreads on the Configure command line to enable threads.
1047 : full support for void wanted by default
1050 : List of libraries we want.
1051 : If anyone needs -lnet, put it in a hint file.
1052 libswanted='sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl'
1053 libswanted="$libswanted dld ld sun m c cposix posix"
1054 libswanted="$libswanted ndir dir crypt sec"
1055 libswanted="$libswanted ucb bsd BSD PW x iconv util"
1056 : We probably want to search /usr/shlib before most other libraries.
1057 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1058 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1059 glibpth="/usr/shlib $glibpth"
1060 : Do not use vfork unless overridden by a hint file.
1063 : Find the basic shell for Bourne shell scripts
1067 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1070 if test -f "$xxx"; then
1073 : Build up a list and do a single loop so we can 'break' out.
1074 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1075 for xxx in sh bash ksh pdksh ash; do
1077 try="$try ${p}/${xxx}"
1081 if test -f "$xxx"; then
1084 elif test -f "$xxx.exe"; then
1095 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1097 Usually it's in /bin/sh. How did you even get this far?
1098 Please contact me (Perl Maintainers) at perlbug@perl.org and
1099 we'll try to straighten this all out.
1105 : see if sh knows # comments
1106 if `$sh -c '#' >/dev/null 2>&1`; then
1110 test -f $xcat || xcat=/usr/bin/cat
1115 if test -s today; then
1118 echo "#! $xcat" > try
1122 if test -s today; then
1130 echo "Your $sh doesn't grok # comments--I will strip them later on."
1133 echo "exec grep -v '^[ ]*#'" >spitshell
1135 $eunicefix spitshell
1136 spitshell=`pwd`/spitshell
1138 echo "I presume that if # doesn't work, #! won't work either!"
1143 : figure out how to guarantee sh startup
1145 '') startsh=${sharpbang}${sh} ;;
1157 : echo "Yup, it does."
1159 echo "Hmm... '$startsh' does not guarantee sh startup..."
1160 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1165 : Save command line options in file UU/cmdline.opt for later use in
1166 : generating config.sh.
1167 cat > cmdline.opt <<EOSH
1168 # Configure command line arguments.
1175 cat >>cmdline.opt <<EOSH
1176 config_arg$argn='$arg'
1178 argn=`expr $argn + 1`
1181 : produce awk script to parse command line options
1182 cat >options.awk <<'EOF'
1184 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1186 len = length(optstr);
1187 for (i = 1; i <= len; i++) {
1188 c = substr(optstr, i, 1);
1189 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1200 if (substr(str, 1, 1) != "-") {
1201 printf("'%s'\n", str);
1205 for (i = 2; i <= len; i++) {
1206 c = substr(str, i, 1);
1208 printf("-%s\n", substr(str, i));
1214 printf("'%s'\n", substr(str, i + 1));
1227 : process the command line options
1228 set X `for arg in "$@"; do echo "X$arg"; done |
1229 sed -e s/X// | awk -f options.awk`
1234 : set up default values
1244 rm -f optdef.sh posthint.sh
1245 cat >optdef.sh <<EOS
1251 while test $# -gt 0; do
1253 -d) shift; fastread=yes;;
1254 -e) shift; alldone=cont;;
1258 if test -r "$1"; then
1261 echo "$me: cannot read config file $1." >&2
1266 -h) shift; error=true;;
1267 -r) shift; reuseval=true;;
1268 -s) shift; silent=true; realsilent=true;;
1269 -E) shift; alldone=exit;;
1270 -K) shift; knowitall=true;;
1271 -O) shift; override=true;;
1272 -S) shift; silent=true; extractsh=true;;
1277 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1278 echo "$me: ignoring -D $1" >&2
1281 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1282 *) echo "$1='define'" >> optdef.sh;;
1289 *=) echo "$1" >> optdef.sh;;
1291 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1292 echo "$me: ignoring -U $1" >&2
1294 *) echo "$1='undef'" >> optdef.sh;;
1305 *=*) zzz=`echo $yyy|sed 's!=.*!!'`
1309 zzz=" "`echo $yyy|sed 's!^[^=]*=!!'`
1310 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1316 *:*) xxx=`echo $yyy|sed 's!:.*!!'`
1317 yyy=`echo $yyy|sed 's!^[^:]*:!!'`
1318 zzz=`echo $yyy|sed 's!^[^=]*=!!'`
1319 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1320 *) xxx=`echo $yyy|sed 's!:.*!!'`
1321 yyy=`echo $yyy|sed 's!^[^:]*:!!'` ;;
1327 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1329 echo "$yyy=''" >> posthint.sh ;;
1334 echo "$yyy='$zzz'" >> posthint.sh ;;
1336 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1338 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1343 echo "$yyy=$zzz" >> posthint.sh ;;
1344 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1348 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1351 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1359 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1360 [-U symbol] [-U symbol=] [-A command:symbol...]
1361 -d : use defaults for all answers.
1362 -e : go on without questioning past the production of config.sh.
1363 -f : specify an alternate default configuration file.
1364 -h : print this help message and exit (with an error status).
1365 -r : reuse C symbols value if possible (skips costly nm extraction).
1366 -s : silent mode, only echoes questions and essential information.
1367 -D : define symbol to have some value:
1368 -D symbol symbol gets the value 'define'
1369 -D symbol=value symbol gets the value 'value'
1370 -E : stop at the end of questions, after having produced config.sh.
1371 -K : do not use unless you know what you are doing.
1372 -O : let -D and -U override definitions from loaded configuration file.
1373 -S : perform variable substitutions on all .SH files (can mix with -f)
1374 -U : undefine symbol:
1375 -U symbol symbol gets the value 'undef'
1376 -U symbol= symbol gets completely empty
1377 -A : manipulate symbol after the platform specific hints have been applied:
1378 -A symbol=value append " "value to symbol
1379 -A append:symbol=value append value to symbol
1380 -A define:symbol=value define symbol to have value
1381 -A clear:symbol define symbol to be ''
1382 -A define:symbol define symbol to be 'define'
1383 -A eval:symbol=value define symbol to be eval of value
1384 -A prepend:symbol=value prepend value to symbol
1385 -A undef:symbol define symbol to be 'undef'
1386 -A undef:symbol= define symbol to be ''
1387 -V : print version number and exit (with a zero status).
1394 case "$fastread$alldone" in
1397 case "$extractsh" in
1400 if test ! -t 0; then
1401 echo "Say 'sh Configure', not 'sh <Configure'"
1411 true) exec 1>/dev/null;;
1414 : run the defines and the undefines, if any, but leave the file out there...
1417 : create the posthint manipulation script and leave the file out there...
1422 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1423 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1424 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1425 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1426 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1429 : Some greps do not return status, grrr.
1430 echo "grimblepritz" >grimble
1431 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1433 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1439 : the following should work in any shell
1443 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1444 cat >contains <<'EOSS'
1445 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1450 : Find the path to the source tree
1453 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1457 *) src=`cd ../$src && pwd` ;;
1470 if test -f $rsrc/Configure && \
1471 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1473 : found it, so we are ok.
1476 for src in . .. ../.. ../../.. ../../../..; do
1477 if test -f ../$src/Configure && \
1478 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1489 Sorry, I can't seem to locate the source dir for $package. Please start
1490 Configure with an explicit path -- i.e. /some/path/Configure.
1498 echo "Sources for $package found in \"$src\"." >&4
1502 : script used to extract .SH files with variable substitutions
1503 cat >extract <<'EOS'
1505 echo "Doing variable substitutions on .SH files..."
1506 if test -f $src/MANIFEST; then
1507 set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH$'`
1509 echo "(Looking for .SH files under the source directory.)"
1510 set x `(cd $src; find . -name "*.SH" -print)`
1514 0) set x `(cd $src; echo *.SH)`; shift;;
1516 if test ! -f $src/$1; then
1522 while test $name; do
1523 if test ! -d "$name"; then
1524 create="$name $create";
1525 name=`echo $name | sed -e "s|^[^/]*$||"`;
1526 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1531 for file in $create; do
1540 dir=`expr X$file : 'X\(.*\)/'`
1541 file=`expr X$file : 'X.*/\(.*\)'`
1542 (cd $dir && . ./$file)
1552 dir=`expr X$file : 'X\(.*\)/'`
1553 file=`expr X$file : 'X.*/\(.*\)'`
1554 (set x $dir; shift; eval $mkdir_p)
1564 if test -f $src/config_h.SH; then
1565 if test ! -f config.h; then
1566 : oops, they left it out of MANIFEST, probably, so do it anyway.
1572 : extract files and exit if asked to do so
1573 case "$extractsh" in
1575 case "$realsilent" in
1579 case "$config_sh" in
1580 '') config_sh='config.sh';;
1583 echo "Fetching answers from $config_sh..."
1586 test "$override" && . ./optdef.sh
1595 : Eunice requires " " instead of "", can you believe it
1598 echo "Beginning of configuration questions for $package."
1600 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1602 : first determine how to suppress newline on echo command
1604 echo "Checking echo to see how to suppress newlines..."
1605 (echo "hi there\c" ; echo " ") >.echotmp
1606 if $contains c .echotmp >/dev/null 2>&1 ; then
1617 echo $n "The star should be here-->$c"
1621 : Now test for existence of everything in MANIFEST
1623 if test -f $rsrc/MANIFEST; then
1624 echo "First let's make sure your kit is complete. Checking..." >&4
1625 awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
1628 for filelist in x??; do
1629 (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
1631 if test -s missing; then
1635 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1637 You have the option of continuing the configuration process, despite the
1638 distinct possibility that your kit is damaged, by typing 'y'es. If you
1639 do, don't blame me if something goes wrong. I advise you to type 'n'o
1640 and contact the author (perlbug@perl.org).
1643 echo $n "Continue? [n] $c" >&4
1647 echo "Continuing..." >&4
1651 echo "ABORTING..." >&4
1656 echo "Looks good..."
1659 echo "There is no MANIFEST file. I hope your kit is complete !"
1664 : Find the appropriate value for a newline for tr
1665 if test -n "$DJGPP"; then
1668 if test X"$trnl" = X; then
1669 case "`echo foo|tr '\n' x 2>/dev/null`" in
1673 if test X"$trnl" = X; then
1674 case "`echo foo|tr '\012' x 2>/dev/null`" in
1675 foox) trnl='\012' ;;
1678 if test X"$trnl" = X; then
1681 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1687 : compute the number of columns on the terminal for proper question formatting
1692 : set up the echo used in my read
1693 myecho="case \"\$xxxm\" in
1694 '') echo $n \"\$rp $c\" >&4;;
1696 '') echo $n \"[\$xxxm] $c\";;
1698 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1700 echo $n \"[\$xxxm] $c\" >&4
1702 echo $n \"\$rp [\$xxxm] $c\" >&4
1708 : now set up to do reads with possible shell escape and default assignment
1714 case "\$fastread" in
1715 yes) case "\$dflt" in
1718 case "\$silent-\$rp" in
1723 *) case "\$silent" in
1724 true) case "\$rp" in
1729 while expr "X\$ans" : "X!" >/dev/null; do
1733 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1741 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1750 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1755 echo "(OK, I'll run with -d after this question.)" >&4
1758 echo "*** Sorry, \$1 not supported yet." >&4
1768 echo "*** Substitution done -- please confirm."
1770 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1775 echo "*** Error -- try again."
1782 case "\$ans\$xxxm\$nostick" in
1794 : create .config dir to save info across Configure sessions
1795 test -d ../.config || mkdir ../.config
1796 cat >../.config/README <<EOF
1797 This directory created by Configure to save information that should
1798 persist across sessions for $package.
1800 You may safely delete it if you wish.
1803 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
1805 $define|true|[yY]*) ;;
1806 *) case "$xversion" in
1809 *** WHOA THERE!!! ***
1811 This is an UNSTABLE DEVELOPMENT release.
1812 The version of this $package distribution is $xversion, that is, odd,
1813 (as opposed to even) and that signifies a development release.
1814 If you want a maintenance release, you want an even-numbered version.
1816 Do ***NOT*** install this into production use.
1817 Data corruption and crashes are possible.
1819 It is most seriously suggested that you do not continue any further
1820 unless you want to help in developing and debugging Perl.
1822 If you *still* want to build perl, you can answer 'y' now,
1823 or pass -Dusedevel to Configure.
1826 rp='Do you really want to continue?'
1830 [yY]) echo >&4 "Okay, continuing."
1831 usedevel="$define" ;;
1832 *) echo >&4 "Okay, bye."
1842 case "$versiononly" in
1843 '') versiononly="$define" ;;
1845 case "$installusrbinperl" in
1846 '') installusrbinperl="$undef" ;;
1851 : general instructions
1854 user=`(logname) 2>/dev/null`
1856 '') user=`whoami 2>&1`;;
1858 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1861 rp='Would you like to see the instructions?'
1872 This installation shell script will examine your system and ask you questions
1873 to determine how the perl5 package should be installed. If you get
1874 stuck on a question, you may use a ! shell escape to start a subshell or
1875 execute a command. Many of the questions will have default answers in square
1876 brackets; typing carriage return will give you the default.
1878 On some of the questions which ask for file or directory names you are allowed
1879 to use the ~name construct to specify the login directory belonging to "name",
1880 even if you don't have a shell which knows about that. Questions where this is
1881 allowed will be marked "(~name ok)".
1885 dflt='Type carriage return to continue'
1889 The prompter used in this script allows you to use shell variables and
1890 backticks in your answers. You may use $1, $2, etc... to refer to the words
1891 in the default answer, as if the default line was a set of arguments given to a
1892 script shell. This means you may also use $* to repeat the whole default line,
1893 so you do not have to re-type everything to add something to the default.
1895 Everytime there is a substitution, you will have to confirm. If there is an
1896 error (e.g. an unmatched backtick), the default answer will remain unchanged
1897 and you will be prompted again.
1899 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1900 the questions and use the computed defaults (or the previous answers if there
1901 was already a config.sh file). Type 'Configure -h' for a list of options.
1902 You may also start interactively and then answer '& -d' at any prompt to turn
1903 on the non-interactive behaviour for the remainder of the execution.
1909 Much effort has been expended to ensure that this shell script will run on any
1910 Unix system. If despite that it blows up on yours, your best bet is to edit
1911 Configure and run it again. If you can't run Configure for some reason,
1912 you'll have to generate a config.sh file by hand. Whatever problems you
1913 have, let me (perlbug@perl.org) know how I blew it.
1915 This installation script affects things in two ways:
1917 1) it may do direct variable substitutions on some of the files included
1919 2) it builds a config.h file for inclusion in C programs. You may edit
1920 any of these files as the need arises after running this script.
1922 If you make a mistake on a question, there is no easy way to back up to it
1923 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1924 files. Configure will offer to let you do this before it runs the SH files.
1927 dflt='Type carriage return to continue'
1929 case "$firsttime" in
1930 true) echo $user >>../.config/instruct;;
1934 : find out where common programs are
1936 echo "Locating common programs..." >&4
1949 if test -d \$dir/\$thing; then
1955 for thisthing in \$dir/\$thing; do
1956 : just loop through to pick last item
1958 if test -f \$thisthing; then
1961 elif test -f \$dir/\$thing.exe; then
1962 if test -n "$DJGPP"; then
1963 echo \$dir/\$thing.exe
1965 : on Eunice apparently
2016 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2017 pth="$pth /lib /usr/lib"
2018 for file in $loclist; do
2022 if test -f "$xxx"; then
2025 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2026 xxx=`./loc $file $file $pth`
2029 '') xxx=`./loc $file $file $pth`;;
2030 *) xxx=`./loc $xxx $xxx $pth`;;
2036 echo $file is in $xxx.
2039 echo $file is in $xxx.
2042 echo "I don't know where '$file' is, and my life depends on it." >&4
2043 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2049 echo "Don't worry if any of the following aren't found..."
2051 for file in $trylist; do
2055 if test -f "$xxx"; then
2058 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2059 xxx=`./loc $file $file $pth`
2062 '') xxx=`./loc $file $file $pth`;;
2063 *) xxx=`./loc $xxx $xxx $pth`;;
2069 echo $file is in $xxx.
2072 echo $file is in $xxx.
2075 echo "I don't see $file out there, $say."
2082 echo "Substituting grep for egrep."
2088 echo "Substituting cp for ln."
2094 echo "Hopefully test is built into your sh."
2097 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2098 echo "Using the test built into your sh."
2106 echo "Hopefully echo is built into your sh."
2111 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2112 $echo $n "hi there$c" >foo1
2113 echo $n "hi there$c" >foo2
2114 if cmp foo1 foo2 >/dev/null 2>&1; then
2115 echo "They are compatible. In fact, they may be identical."
2122 They are not compatible! You are probably running ksh on a non-USG system.
2123 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2124 have echo built in and we may have to run some Bourne shell scripts. That
2125 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2128 $echo $n "The star should be here-->$c"
2138 cat <<'EOSC' >>checkcc
2143 int main(int argc, char *argv[]) {
2147 if $cc -o try $ccflags $ldflags try.c; then
2150 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2156 case "`$cc -v -c try.c 2>&1`" in
2159 if $test X"$trygcc" = Xyes; then
2160 if gcc -o try -c try.c; then
2162 echo "You seem to have a working gcc, though." >&4
2163 rp="Would you like to use it?"
2165 if $test -f myread; then
2168 if $test -f UU/myread; then
2171 echo "Cannot find myread, sorry. Aborting." >&2
2176 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no ;;
2180 if $test X"$despair" = Xyes; then
2182 You need to find a working C compiler.
2183 Either (purchase and) install the C compiler supplied by your OS vendor,
2184 or for a free C compiler try http://gcc.gnu.org/
2185 I cannot continue any further, aborting.
2195 : determine whether symbolic links are supported
2198 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2199 echo "Symbolic links are supported." >&4
2202 echo "Symbolic links are NOT supported." >&4
2207 : determine whether symbolic links are supported
2211 echo "Checking how to test for symbolic links..." >&4
2213 if $test "X$issymlink" = X; then
2214 sh -c "PATH= test -h sym" >/dev/null 2>&1
2215 if test $? = 0; then
2219 if $test "X$issymlink" = X; then
2220 if $test -h >/dev/null 2>&1; then
2221 issymlink="$test -h"
2222 echo "Your builtin 'test -h' may be broken, I'm using external '$test -h'." >&4
2225 if $test "X$issymlink" = X; then
2226 if $test -L sym 2>/dev/null; then
2227 issymlink="$test -L"
2230 if $test "X$issymlink" != X; then
2231 echo "You can test for symbolic links with '$issymlink'." >&4
2233 echo "I do not know how you can test for symbolic links." >&4
2237 *) echo "No symbolic links, so not testing for their testing..." >&4
2243 case "$mksymlinks" in
2246 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2249 *) case "$lns:$issymlink" in
2250 *"ln -s:"*"test -"?)
2251 echo "Creating the symbolic links..." >&4
2252 echo "(First creating the subdirectories...)" >&4
2254 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2256 test -z "$directory" && break
2260 if test ! -d t/base; then
2261 echo "Failed to create the subdirectories. Aborting." >&4
2264 echo "(Then creating the symlinks...)" >&4
2265 awk '{print $1}' $src/MANIFEST | while true; do
2267 test -z "$filename" && break
2268 if test -f $filename; then
2269 if $issymlink $filename; then
2273 if test -f $filename; then
2274 echo "$filename already exists, not symlinking."
2276 ln -s $src/$filename $filename
2280 if test ! -f t/base/commonsense.t; then
2281 echo "Failed to create the symlinks. Aborting." >&4
2286 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2294 : see whether [:lower:] and [:upper:] are supported character classes
2296 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2298 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2302 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
2303 # (0xc9 and 0xd1), therefore that is a nice testing point.
2304 if test "X$up" = X -o "X$low" = X; then
2305 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
2311 if test "X$up" = X -o "X$low" = X; then
2312 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
2318 if test "X$up" = X -o "X$low" = X; then
2319 case "`echo IJ | od -x 2>/dev/null`" in
2321 echo "Hey, this might be EBCDIC." >&4
2322 if test "X$up" = X -o "X$low" = X; then
2323 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2324 ij) up='[A-IJ-RS-Z]'
2329 if test "X$up" = X -o "X$low" = X; then
2330 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2340 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
2342 echo "Using $up and $low to convert case." >&4
2345 echo "I don't know how to translate letters from upper to lower case." >&4
2346 echo "Your tr is not acting any way I know of." >&4
2350 : set up the translation script tr, must be called with ./tr of course
2354 '[A-Z][a-z]') exec $tr '$up' '$low';;
2355 '[a-z][A-Z]') exec $tr '$low' '$up';;
2362 : Try to determine whether config.sh was made on this system
2363 case "$config_sh" in
2365 myuname=`$uname -a 2>/dev/null`
2366 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2367 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2368 # because the A-Z/a-z are not consecutive.
2369 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2370 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2371 newmyuname="$myuname"
2373 case "$knowitall" in
2375 if test -f ../config.sh; then
2376 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2377 eval "`grep myuname= ../config.sh`"
2379 if test "X$myuname" = "X$newmyuname"; then
2387 : Get old answers from old config file if Configure was run on the
2388 : same system, otherwise use the hints.
2391 if test -f config.sh; then
2393 rp="I see a config.sh file. Shall I use it to set the defaults?"
2396 n*|N*) echo "OK, I'll ignore it."
2397 mv config.sh config.sh.old
2398 myuname="$newmyuname"
2400 *) echo "Fetching default answers from your old config.sh file..." >&4
2408 : Older versions did not always set $sh. Catch re-use of such
2418 if test ! -f config.sh; then
2421 First time through, eh? I have some defaults handy for some systems
2422 that need some extra help getting the Configure answers right:
2425 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2427 : Half the following guesses are probably wrong... If you have better
2428 : tests or hints, please send them to perlbug@perl.org
2429 : The metaconfig authors would also appreciate a copy...
2430 $test -f /irix && osname=irix
2431 $test -f /xenix && osname=sco_xenix
2432 $test -f /dynix && osname=dynix
2433 $test -f /dnix && osname=dnix
2434 $test -f /lynx.os && osname=lynxos
2435 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2436 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
2437 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2438 $test -f /bin/mips && /bin/mips && osname=mips
2439 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
2440 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
2441 $test -d /usr/apollo/bin && osname=apollo
2442 $test -f /etc/saf/_sactab && osname=svr4
2443 $test -d /usr/include/minix && osname=minix
2444 if $test -d /MachTen -o -d /MachTen_Folder; then
2446 if $test -x /sbin/version; then
2447 osvers=`/sbin/version | $awk '{print $2}' |
2448 $sed -e 's/[A-Za-z]$//'`
2449 elif $test -x /usr/etc/version; then
2450 osvers=`/usr/etc/version | $awk '{print $2}' |
2451 $sed -e 's/[A-Za-z]$//'`
2457 $test -f /sys/posix.dll &&
2458 $test -f /usr/bin/what &&
2459 set X `/usr/bin/what /sys/posix.dll` &&
2460 $test "$3" = UWIN &&
2464 if $test -f $uname; then
2472 umips) osname=umips ;;
2475 [23]100) osname=mips ;;
2476 next*) osname=next ;;
2478 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
2479 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
2482 elif $test -f /etc/kconfig; then
2484 if test "$lns" = "$ln -s"; then
2486 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
2488 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
2495 if test -n "$DJGPP"; then
2504 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
2506 'not found') osvers="$4"."$3" ;;
2507 '<3240'|'<>3240') osvers=3.2.0 ;;
2508 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
2509 '=3250'|'>3250') osvers=3.2.5 ;;
2513 bsd386) osname=bsd386
2516 cygwin*) osname=cygwin
2519 *dc.osx) osname=dcosx
2525 domainos) osname=apollo
2531 dynixptx*) osname=dynixptx
2532 osvers=`echo "$4"|sed 's/^v//'`
2534 freebsd) osname=freebsd
2536 genix) osname=genix ;;
2538 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
2554 netbsd*) osname=netbsd
2557 news-os) osvers="$3"
2559 4*) osname=newsos4 ;;
2563 next*) osname=next ;;
2564 nonstop-ux) osname=nonstopux ;;
2565 POSIX-BC | posix-bc ) osname=posix-bc
2568 powerux | power_ux | powermax_os | powermaxos | \
2569 powerunix | power_unix) osname=powerux
2575 solaris) osname=solaris
2577 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2584 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2588 titanos) osname=titanos
2597 ultrix) osname=ultrix
2600 osf1|mls+) case "$5" in
2603 osvers=`sizer -v | awk '{print $3}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
2606 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
2609 hp*) osname=hp_osf1 ;;
2610 mips) osname=mips_osf1 ;;
2613 unixware) osname=svr5
2619 $2) case "$osname" in
2623 : svr4.x or possibly later
2633 if test -f /stand/boot ; then
2634 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
2635 if test -n "$INITPROG" -a -f "$INITPROG"; then
2636 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
2637 if test -n "$isesix"; then
2645 *) if test -f /etc/systemid; then
2647 set `echo $3 | $sed 's/\./ /g'` $4
2648 if $test -f $src/hints/sco_$1_$2_$3.sh; then
2650 elif $test -f $src/hints/sco_$1_$2.sh; then
2652 elif $test -f $src/hints/sco_$1.sh; then
2657 '') : Still unknown. Probably a generic Sys V.
2666 *) case "$osname" in
2667 '') : Still unknown. Probably a generic BSD.
2675 if test -f /vmunix -a -f $src/hints/news_os.sh; then
2676 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
2677 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
2680 $rm -f UU/kernel.what
2681 elif test -d c:/.; then
2688 : Now look for a hint file osname_osvers, unless one has been
2689 : specified already.
2692 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
2693 : Also try without trailing minor version numbers.
2694 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
2695 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
2696 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
2697 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
2700 *) case "$osvers" in
2703 *) if $test -f $src/hints/$file.sh ; then
2705 elif $test -f $src/hints/$xfile.sh ; then
2707 elif $test -f $src/hints/$xxfile.sh ; then
2709 elif $test -f $src/hints/$xxxfile.sh ; then
2711 elif $test -f $src/hints/$xxxxfile.sh ; then
2713 elif $test -f "$src/hints/${osname}.sh" ; then
2722 if $test -f Policy.sh ; then
2725 none) dflt="Policy" ;;
2726 *) dflt="Policy $dflt" ;;
2731 dflt=`echo $hintfile | $sed 's/\.sh$//'`
2735 if $test -f Policy.sh ; then
2738 There's also a Policy hint file available, which should make the
2739 site-specific (policy) questions easier to answer.
2746 You may give one or more space-separated answers, or "none" if appropriate.
2747 A well-behaved OS will have no hints, so answering "none" or just "Policy"
2748 is a good thing. DO NOT give a wrong version or a wrong OS.
2752 rp="Which of these apply, if any?"
2755 for file in $tans; do
2756 if $test X$file = XPolicy -a -f Policy.sh; then
2758 $cat Policy.sh >> UU/config.sh
2759 elif $test -f $src/hints/$file.sh; then
2760 . $src/hints/$file.sh
2761 $cat $src/hints/$file.sh >> UU/config.sh
2762 elif $test X$tans = X -o X$tans = Xnone ; then
2765 : Give one chance to correct a possible typo.
2766 echo "$file.sh does not exist"
2768 rp="hint to use instead?"
2770 for file in $ans; do
2771 if $test -f "$src/hints/$file.sh"; then
2772 . $src/hints/$file.sh
2773 $cat $src/hints/$file.sh >> UU/config.sh
2774 elif $test X$ans = X -o X$ans = Xnone ; then
2777 echo "$file.sh does not exist -- ignored."
2784 : Remember our hint file for later.
2785 if $test -f "$src/hints/$file.sh" ; then
2795 echo "Fetching default answers from $config_sh..." >&4
2799 cp $config_sh config.sh 2>/dev/null
2809 test "$override" && . ./optdef.sh
2811 : Restore computed paths
2812 for file in $loclist $trylist; do
2813 eval $file="\$_$file"
2818 Configure uses the operating system name and version to set some defaults.
2819 The default value is probably right if the name rings a bell. Otherwise,
2820 since spelling matters for me, either accept the default or answer "none"
2827 ''|' '|none) dflt=none ;;
2828 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
2831 *) dflt="$osname" ;;
2833 rp="Operating system name?"
2837 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
2843 ''|' '|none) dflt=none ;;
2844 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
2845 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
2847 ''|' ') dflt=none ;;
2852 *) dflt="$osvers" ;;
2854 rp="Operating system version?"
2864 : who configured the system
2865 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
2866 cf_by=`(logname) 2>/dev/null`
2869 cf_by=`(whoami) 2>/dev/null`
2871 "") cf_by=unknown ;;
2875 : set up the script used to warn in case of inconsistency
2882 echo "*** WHOA THERE!!! ***" >&4
2883 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2884 rp=" Keep the $hint value?"
2887 y) td=$was; tu=$was;;
2891 : function used to set $1 to $val
2892 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2894 $define$undef) . ./whoa; eval "$var=\$td";;
2895 $undef$define) . ./whoa; eval "$var=\$tu";;
2896 *) eval "$var=$val";;
2899 case "$usethreads" in
2900 $define|true|[yY]*) dflt='y';;
2905 Perl can be built to take advantage of threads on some systems.
2906 To do so, Configure can be run with -Dusethreads.
2908 Note that threading is a highly experimental feature, and
2909 some known race conditions still remain. If you choose to try
2910 it, be very sure to not actually deploy it for production
2911 purposes. README.threads has more details, and is required
2912 reading if you enable threads.
2914 If this doesn't make any sense to you, just accept the default '$dflt'.
2916 rp='Build a threading Perl?'
2919 y|Y) val="$define" ;;
2925 case "$usethreads" in
2929 As of 5.5.640, Perl has two different internal threading implementations,
2930 the 5.005 version (5005threads) and an interpreter-based version
2931 (ithreads) that has one interpreter per thread. Both are very
2932 experimental. This arrangement exists to help developers work out
2933 which one is better.
2935 If you're a casual user, you probably don't want interpreter-threads
2936 at this time. There doesn't yet exist a way to create threads from
2937 within Perl in this model, i.e., "use Thread;" will NOT work.
2939 : Default to ithreads unless overridden on command line or with
2942 case "$use5005threads" in
2943 $define|true|[yY]*) dflt='n';;
2945 case "$useithreads" in
2946 $undef|false|[nN]*) dflt='n';;
2948 rp='Use interpreter-based ithreads?'
2951 y|Y) val="$define" ;;
2956 : Now set use5005threads to the opposite value.
2957 case "$useithreads" in
2958 $define) val="$undef" ;;
2965 useithreads="$undef"
2966 use5005threads="$undef"
2970 case "$useithreads$use5005threads" in
2974 You cannot have both the ithreads and the 5.005 threads enabled
2975 at the same time. Disabling the 5.005 threads since they are
2976 much less stable than the ithreads.
2979 use5005threads="$undef"
2983 case "$d_oldpthreads" in
2984 '') : Configure tests would be welcome here. For now, assume undef.
2986 *) val="$d_oldpthreads" ;;
2992 case "$usethreads" in
2993 "$define"|true|[yY]*)
2994 : Look for a hint-file generated 'call-back-unit'. If the
2995 : user has specified that a threading perl is to be built,
2996 : we may need to set or change some other defaults.
2997 if $test -f usethreads.cbu; then
2998 echo "Your platform has some specific hints for threaded builds, using them..."
3002 (Your platform doesn't have any specific hints for threaded builds.
3003 Assuming POSIX threads, then.)
3011 Perl can be built so that multiple Perl interpreters can coexist
3012 within the same Perl executable.
3015 case "$useithreads" in
3018 This multiple interpreter support is required for interpreter-based threads.
3022 *) case "$usemultiplicity" in
3023 $define|true|[yY]*) dflt='y';;
3027 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
3028 rp='Build Perl for multiplicity?'
3031 y|Y) val="$define" ;;
3039 : make some quick guesses about what we are up against
3041 $echo $n "Hmm... $c"
3051 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
3052 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
3054 echo "Looks kind of like an OSF/1 system, but we'll see..."
3056 elif test `echo abc | $tr a-z A-Z` = Abc ; then
3057 xxx=`./loc addbib blurfl $pth`
3058 if $test -f $xxx; then
3059 echo "Looks kind of like a USG system with BSD features, but we'll see..."
3063 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
3064 echo "Looks kind of like an extended USG system, but we'll see..."
3066 echo "Looks kind of like a USG system, but we'll see..."
3070 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
3071 echo "Looks kind of like a BSD system, but we'll see..."
3075 echo "Looks kind of like a Version 7 system, but we'll see..."
3078 case "$eunicefix" in
3081 There is, however, a strange, musty smell in the air that reminds me of
3082 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
3086 : it so happens the Eunice I know will not run shell scripts in Unix format
3090 echo "Congratulations. You aren't running Eunice."
3094 : Detect OS2. The p_ variable is set above in the Head.U unit.
3095 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
3096 : semicolon as a patch separator
3101 I have the feeling something is not exactly right, however...don't tell me...
3102 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
3103 (Or you may be running DOS with DJGPP.)
3108 if test -f /xenix; then
3109 echo "Actually, this looks more like a XENIX system..."
3114 echo "It's not Xenix..."
3119 if test -f /venix; then
3120 echo "Actually, this looks more like a VENIX system..."
3127 echo "Nor is it Venix..."
3130 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3131 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3138 rp="Use which C compiler?"
3141 : Look for a hint-file generated 'call-back-unit'. Now that the
3142 : user has specified the compiler, we may need to set or change some
3144 if $test -f cc.cbu; then
3150 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3151 $cat >gccvers.c <<EOM
3156 printf("%s\n", __VERSION__);
3158 printf("%s\n", "1");
3164 if $cc -o gccvers $ccflags $ldflags gccvers.c; then
3165 gccversion=`./gccvers`
3166 case "$gccversion" in
3167 '') echo "You are not using GNU cc." ;;
3168 *) echo "You are using GNU cc $gccversion."
3174 echo "*** WHOA THERE!!! ***" >&4
3175 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3176 case "$knowitall" in
3178 echo " You'd better start hunting for one and let me know about it." >&4
3184 case "$gccversion" in
3185 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3187 case "$gccversion" in
3188 '') gccosandvers='' ;;
3189 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
3190 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
3192 case "$gccosandvers" in
3193 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
3194 $osname$osvers) ;; # looking good
3195 $osname*) cat <<EOM >&4
3197 *** WHOA THERE!!! ***
3199 Your gcc has not been compiled for the exact release of
3200 your operating system ($gccosandvers versus $osname$osvers).
3202 In general it is a good idea to keep gcc synchronized with
3203 the operating system because otherwise serious problems
3204 may ensue when trying to compile software, like Perl.
3206 I'm trying to be optimistic here, though, and will continue.
3207 If later during the configuration and build icky compilation
3208 problems appear (headerfile conflicts being the most common
3209 manifestation), I suggest reinstalling the gcc to match
3210 your operating system release.
3214 *) gccosandvers='' ;; # failed to parse, better be silent
3222 : see how we invoke the C preprocessor
3224 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3225 cat <<'EOT' >testcpp.c
3231 if test ! -f cppstdin; then
3232 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
3233 # AIX cc -E doesn't show the absolute headerfile
3234 # locations but we'll cheat by using the -M flag.
3235 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
3237 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3240 echo "Keeping your $hint cppstdin wrapper."
3243 wrapper=`pwd`/cppstdin
3247 if $test "X$cppstdin" != "X" && \
3248 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3249 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3251 echo "You used to use $cppstdin $cppminus so we'll use that again."
3253 '') echo "But let's see if we can live without a wrapper..." ;;
3255 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3256 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3258 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3261 echo "(However, $cpprun $cpplast does not work, let's see...)"
3269 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3276 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3277 $cc -E <testcpp.c >testcpp.out 2>&1; \
3278 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3279 echo "Yup, it does."
3282 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
3283 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3284 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3285 echo "Yup, it does."
3288 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
3289 $cc -P <testcpp.c >testcpp.out 2>&1; \
3290 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3291 echo "Yipee, that works!"
3294 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
3295 $cc -P - <testcpp.c >testcpp.out 2>&1; \
3296 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3297 echo "At long last!"
3300 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
3301 $cpp <testcpp.c >testcpp.out 2>&1; \
3302 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3306 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
3307 $cpp - <testcpp.c >testcpp.out 2>&1; \
3308 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3309 echo "Hooray, it works! I was beginning to wonder."
3312 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
3313 $wrapper <testcpp.c >testcpp.out 2>&1; \
3314 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3320 rp="No dice. I can't find a C preprocessor. Name one:"
3324 $x_cpp <testcpp.c >testcpp.out 2>&1
3325 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3326 echo "OK, that will do." >&4
3328 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
3343 echo "Perhaps can we force $cc -E using a wrapper..."
3344 if $wrapper <testcpp.c >testcpp.out 2>&1; \
3345 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3351 echo "Nope, we'll have to live without it..."
3365 "$wrapper"|'cppstdin') ;;
3366 *) $rm -f $wrapper;;
3368 $rm -f testcpp.c testcpp.out
3370 : decide how portable to be. Allow command line overrides.
3371 case "$d_portable" in
3373 *) d_portable="$define" ;;
3376 : set up shell script to do ~ expansion
3382 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3385 if $test -f /bin/csh; then
3386 /bin/csh -f -c "glob \$1"
3391 name=\`$expr x\$1 : '..\([^/]*\)'\`
3392 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3393 if $test ! -d "\$dir"; then
3395 echo "\$me: can't locate home directory for: \$name" >&2
3400 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3416 : now set up to get a file name
3420 cat <<'EOSC' >>getfile
3436 expr $fn : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3437 fn=`echo $fn | sed 's/(.*)//'`
3443 loc_file=`expr $fn : '.*:\(.*\)'`
3444 fn=`expr $fn : '\(.*\):.*'`
3452 */*) fullpath=true;;
3461 *e*) exp_file=true;;
3464 *p*) nopath_ok=true;;
3469 *d*) type='Directory';;
3470 *l*) type='Locate';;
3475 Locate) what='File';;
3480 case "$d_portable" in
3488 while test "$type"; do
3493 true) rp="$rp (~name ok)";;
3496 if test -f UU/getfile.ok && \
3497 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3516 value=`UU/filexp $ans`
3519 if test "$ans" != "$value"; then
3520 echo "(That expands to $value on this system.)"
3534 /*) value="$ansexp" ;;
3535 [a-zA-Z]:/*) value="$ansexp" ;;
3540 echo "I shall only accept a full path name, as in /bin/ls." >&4
3541 echo "Use a ! shell escape if you wish to check pathnames." >&4
3544 echo "Please give a full path name, starting with slash." >&4
3547 echo "Note that using ~name is ok provided it expands well." >&4
3560 for fp in $gfpth; do
3561 if test "X$fp" = X.; then
3566 if test -f "$pf"; then
3568 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3570 echo "($value is not a plain file, but that's ok.)"
3573 if test X"$type" = X; then
3580 for fp in $gfpth; do
3581 if test "X$fp" = X.; then
3586 direxp="$fp/$ansexp"
3588 if test -d "$direxp"; then
3596 if test -d "$ansexp"; then
3597 echo "(Looking for $loc_file in directory $value.)"
3598 value="$value/$loc_file"
3599 ansexp="$ansexp/$loc_file"
3601 if test -f "$ansexp"; then
3604 case "$nopath_ok" in
3605 true) case "$value" in
3607 *) echo "Assuming $value will be in people's path."
3623 if test "$fastread" = yes; then
3628 rp="$what $value doesn't exist. Use that name anyway?"
3647 test "X$gfpthkeep" != Xy && gfpth=""
3650 : What should the include directory be ?
3652 $echo $n "Hmm... $c"
3656 if $test -f /bin/mips && /bin/mips; then
3657 echo "Looks like a MIPS system..."
3658 $cat >usr.c <<'EOCP'
3659 #ifdef SYSTYPE_BSD43
3663 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3664 dflt='/bsd43/usr/include'
3668 mips_type='System V'
3670 $rm -f usr.c usr.out
3671 echo "and you're compiling with the $mips_type compiler and libraries."
3675 echo "Doesn't look like a MIPS system."
3685 case "$xxx_prompt" in
3688 rp='Where are the include files you want to use?'
3696 : Set private lib path
3699 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
3704 '') dlist="$loclibpth $plibpth $glibpth";;
3705 *) dlist="$libpth";;
3708 : Now check and see which directories actually exist, avoiding duplicates
3712 if $test -d $xxx; then
3715 *) libpth="$libpth $xxx";;
3721 Some systems have incompatible or broken versions of libraries. Among
3722 the directories listed in the question below, please remove any you
3723 know not to be holding relevant libraries, and add any that are needed.
3724 Say "none" for none.
3735 rp="Directories to use for library searches?"
3742 : compute shared library extension
3745 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
3755 On some systems, shared libraries may be available. Answer 'none' if
3756 you want to suppress searching of shared libraries for the remainder
3757 of this configuration.
3760 rp='What is the file extension used for shared libraries?'
3764 : Define several unixisms.
3765 : Hints files or command line option can be used to override them.
3766 : The convoluted testing is in case hints files set either the old
3769 '') case "$exe_ext" in
3771 *) _exe="$exe_ext" ;;
3776 '') case "$lib_ext" in
3783 '') case "$obj_ext" in
3790 '') case "$path_sep" in
3801 : Which makefile gets called first. This is used by make depend.
3802 case "$firstmakefile" in
3803 '') firstmakefile='makefile';;
3807 $define|true|[yY]*) dflt='y';;
3812 Perl can be built to use the SOCKS proxy protocol library. To do so,
3813 Configure must be run with -Dusesocks. If you use SOCKS you also need
3814 to use the PerlIO abstraction layer, this will be implicitly selected.
3816 If this doesn't make any sense to you, just accept the default '$dflt'.
3818 rp='Build Perl for SOCKS?'
3821 y|Y) val="$define" ;;
3828 $define|true|[yY]*) useperlio="$define";;
3831 : Looking for optional libraries
3833 echo "Checking for optional libraries..." >&4
3838 case "$libswanted" in
3839 '') libswanted='c_s';;
3842 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
3848 for thisdir in $libpth $xlibpth; do
3849 test -d $thisdir && libspath="$libspath $thisdir"
3851 for thislib in $libswanted; do
3852 for thisdir in $libspath; do
3854 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
3855 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|tail -1`
3856 $test -f "$xxx" && eval $libscheck
3857 $test -f "$xxx" && libstyle=shared
3859 if test ! -f "$xxx"; then
3860 xxx=$thisdir/lib$thislib.$so
3861 $test -f "$xxx" && eval $libscheck
3862 $test -f "$xxx" && libstyle=shared
3864 if test ! -f "$xxx"; then
3865 xxx=$thisdir/lib$thislib$_a
3866 $test -f "$xxx" && eval $libscheck
3867 $test -f "$xxx" && libstyle=static
3869 if test ! -f "$xxx"; then
3870 xxx=$thisdir/$thislib$_a
3871 $test -f "$xxx" && eval $libscheck
3872 $test -f "$xxx" && libstyle=static
3874 if test ! -f "$xxx"; then
3875 xxx=$thisdir/lib${thislib}_s$_a
3876 $test -f "$xxx" && eval $libscheck
3877 $test -f "$xxx" && libstyle=static
3878 $test -f "$xxx" && thislib=${thislib}_s
3880 if test ! -f "$xxx"; then
3881 xxx=$thisdir/Slib$thislib$_a
3882 $test -f "$xxx" && eval $libscheck
3883 $test -f "$xxx" && libstyle=static
3885 if $test -f "$xxx"; then
3887 shared) echo "Found -l$thislib (shared)." ;;
3888 static) echo "Found -l$thislib." ;;
3889 *) echo "Found -l$thislib ($libstyle)." ;;
3893 *) dflt="$dflt -l$thislib"
3894 libsfound="$libsfound $xxx"
3896 libsfiles="$libsfiles $yyy"
3897 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
3898 case " $libsdirs " in
3900 *) libsdirs="$libsdirs $yyy" ;;
3907 if $test ! -f "$xxx"; then
3908 echo "No -l$thislib."
3919 ' '|'') dflt='none';;
3924 In order to compile $package on your machine, a number of libraries
3925 are usually needed. Include any other special libraries here as well.
3926 Say "none" for none. The default list is almost always right.
3930 rp="What libraries to use?"
3937 : determine optimization, if desired, or use for debug flag also
3939 ' '|$undef) dflt='none';;
3941 *) dflt="$optimize";;
3945 By default, $package compiles with the -O flag to use the optimizer.
3946 Alternately, you might want to use the symbolic debugger, which uses
3947 the -g flag (on traditional Unix systems). Either flag can be
3948 specified here. To use neither flag, specify the word "none".
3951 rp="What optimizer/debugger flag should be used?"
3955 'none') optimize=" ";;
3959 : We will not override a previous value, but we might want to
3960 : augment a hint file
3962 default|recommended)
3963 case "$gccversion" in
3964 1*) dflt='-fpcc-struct-return' ;;
3967 *-g*) dflt="$dflt -DDEBUGGING";;
3969 case "$gccversion" in
3970 2*) if test -d /etc/conf/kconfig.d &&
3971 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
3977 case "$gccversion" in
3981 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
3982 echo 'int main(void) { return 0; }' > gcctest.c
3983 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
3984 echo "Yes, it does." 2>&1
3987 echo "Leaving current flags $ccflags alone." 2>&1
3989 *) dflt="$dflt -fno-strict-aliasing" ;;
3992 echo "Nope, it doesn't, but that's ok." 2>&1
3999 case "$mips_type" in
4000 *BSD*|'') inclwanted="$locincpth $usrinc";;
4001 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4003 for thisincl in $inclwanted; do
4004 if $test -d $thisincl; then
4005 if $test x$thisincl != x$usrinc; then
4007 *" -I$thisincl "*);;
4008 *) dflt="$dflt -I$thisincl ";;
4014 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4016 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4024 *) dflt="$dflt -D$2";;
4028 set signal.h LANGUAGE_C; eval $inctest
4032 ccflags="$ccflags -DSOCKS"
4037 default|recommended) dflt="$ccflags $dflt" ;;
4038 *) dflt="$ccflags";;
4047 Your C compiler may want other flags. For this question you should include
4048 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4049 but you should NOT include libraries or ld flags like -lwhatever. If you
4050 want $package to honor its debug switch, you should include -DDEBUGGING here.
4051 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4053 To use no flags, specify the word "none".
4059 rp="Any additional cc flags?"
4066 : the following weeds options from ccflags that are of no interest to cpp
4068 '') cppflags="$ccflags" ;;
4069 *) cppflags="$cppflags $ccflags" ;;
4071 case "$gccversion" in
4072 1*) cppflags="$cppflags -D__GNUC__"
4074 case "$mips_type" in
4076 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4082 echo "Let me guess what the preprocessor flags are..." >&4
4096 *) ftry="$previous $flag";;
4098 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4099 >cpp1.out 2>/dev/null && \
4100 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4101 >cpp2.out 2>/dev/null && \
4102 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4103 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4105 cppflags="$cppflags $ftry"
4115 *-*) echo "They appear to be: $cppflags";;
4117 $rm -f cpp.c cpp?.out
4121 : flags used in final linking phase
4123 '') if ./venix; then
4129 *-posix*) dflt="$dflt -posix" ;;
4132 *) dflt="$ldflags";;
4135 : Try to guess additional flags to pick up local libraries.
4136 for thislibdir in $libpth; do
4137 case " $loclibpth " in
4140 *"-L$thislibdir "*) ;;
4141 *) dflt="$dflt -L$thislibdir" ;;
4153 Your C linker may need flags. For this question you should
4154 include -L/whatever and any other flags used by the C linker, but you
4155 should NOT include libraries like -lwhatever.
4157 Make sure you include the appropriate -L/path flags if your C linker
4158 does not normally search all of the directories you specified above,
4161 To use no flags, specify the word "none".
4165 rp="Any additional ld flags (NOT including libraries)?"
4171 rmlist="$rmlist pdp11"
4175 echo "Checking your choice of C compiler and flags for coherency..." >&4
4176 $cat > try.c <<'EOF'
4178 int main() { printf("Ok\n"); exit(0); }
4180 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
4182 $cat >try.msg <<'EOM'
4183 I've tried to compile and run the following simple program:
4186 $cat try.c >> try.msg
4188 $cat >> try.msg <<EOM
4195 and I got the following output:
4199 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
4200 if $sh -c './try' >>try.msg 2>&1; then
4204 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4207 cat >> try.msg <<'EOQS'
4208 If $libs contains -lsfio, and sfio is mis-configured, then it
4209 sometimes (apparently) runs and exits with a 0 status, but with no
4210 output! It may have to do with sfio's use of _exit vs. exit.
4213 rp="You have a big problem. Shall I abort Configure"
4220 echo "The program compiled OK, but exited with status $?." >>try.msg
4221 rp="You have a problem. Shall I abort Configure"
4225 echo "I can't compile the test program." >>try.msg
4226 rp="You have a BIG problem. Shall I abort Configure"
4232 case "$knowitall" in
4234 echo "(The supplied flags or libraries might be incorrect.)"
4242 *) echo "Ok. Stopping Configure." >&4
4247 n) echo "OK, that should do.";;
4249 $rm -f try try.* core
4251 : define an is-a-typedef? function
4252 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
4254 "") inclist="sys/types.h";;
4256 eval "varval=\$$var";
4260 for inc in $inclist; do
4261 echo "#include <$inc>" >>temp.c;
4263 echo "#ifdef $type" >> temp.c;
4264 echo "printf(\"We have $type\");" >> temp.c;
4265 echo "#endif" >> temp.c;
4266 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
4267 if $contains $type temp.E >/dev/null 2>&1; then
4273 *) eval "$var=\$varval";;
4276 : define an is-a-typedef? function that prompts if the type is not available.
4277 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
4279 "") inclist="sys/types.h";;
4281 eval "varval=\$$var";
4285 for inc in $inclist; do
4286 echo "#include <$inc>" >>temp.c;
4288 echo "#ifdef $type" >> temp.c;
4289 echo "printf(\"We have $type\");" >> temp.c;
4290 echo "#endif" >> temp.c;
4291 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
4293 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
4294 if $contains $type temp.E >/dev/null 2>&1; then
4295 echo "$type found." >&4;
4298 echo "$type NOT found." >&4;
4304 *) eval "$var=\$varval";;
4307 : define a shorthand compile call
4311 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
4312 : define a shorthand compile call for compilations that should be ok.
4316 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
4318 : check for lengths of integral types
4322 echo "Checking to see how big your integers are..." >&4
4323 $cat >intsize.c <<'EOCP'
4327 printf("intsize=%d;\n", (int)sizeof(int));
4328 printf("longsize=%d;\n", (int)sizeof(long));
4329 printf("shortsize=%d;\n", (int)sizeof(short));
4334 if eval $compile_ok && ./intsize > /dev/null; then
4336 echo "Your integers are $intsize bytes long."
4337 echo "Your long integers are $longsize bytes long."
4338 echo "Your short integers are $shortsize bytes long."
4342 Help! I can't compile and run the intsize test program: please enlighten me!
4343 (This is probably a misconfiguration in your system or libraries, and
4344 you really ought to fix it. Still, I'll try anyway.)
4348 rp="What is the size of an integer (in bytes)?"
4352 rp="What is the size of a long integer (in bytes)?"
4356 rp="What is the size of a short integer (in bytes)?"
4362 $rm -f intsize intsize.*
4364 : see what type lseek is declared as in the kernel
4365 rp="What is the type used for lseek's offset on this system?"
4366 set off_t lseektype long stdio.h sys/types.h
4370 echo "Checking to see how big your file offsets are..." >&4
4372 #include <sys/types.h>
4376 printf("%d\n", (int)sizeof($lseektype));
4381 if eval $compile_ok; then
4383 echo "Your file offsets are $lseeksize bytes long."
4387 echo "(I can't seem to compile the test program. Guessing...)"
4388 rp="What is the size of your file offsets (in bytes)?"
4394 : see what type file positions are declared as in the library
4395 rp="What is the type for file position used by fsetpos()?"
4396 set fpos_t fpostype long stdio.h sys/types.h
4401 *_t) zzz="$fpostype" ;;
4404 echo "Checking the size of $zzz..." >&4
4406 #include <sys/types.h>
4409 printf("%d\n", (int)sizeof($fpostype));
4414 if eval $compile_ok; then
4418 echo "(I can't execute the test program--guessing $fpossize.)" >&4
4421 echo "Your $zzz is $fpossize bytes long."
4427 echo "(I can't compile the test program. Guessing...)" >&4
4428 rp="What is the size of your file positions (in bytes)?"
4435 # Backward compatibility (uselfs is deprecated).
4437 "$define"|true|[yY]*)
4440 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
4442 uselargefiles="$define"
4446 case "$lseeksize:$fpossize" in
4449 You can have files larger than 2 gigabytes.
4452 *) case "$uselargefiles" in
4453 "$undef"|false|[nN]*) dflt='n' ;;
4458 Perl can be built to understand large files (files larger than 2 gigabytes)
4459 on some systems. To do so, Configure can be run with -Duselargefiles.
4461 If this doesn't make any sense to you, just accept the default '$dflt'.
4463 rp='Try to understand large files, if available?'
4466 y|Y) val="$define" ;;
4473 case "$uselargefiles" in
4475 : Look for a hint-file generated 'call-back-unit'. If the
4476 : user has specified that a large files perl is to be built,
4477 : we may need to set or change some other defaults.
4478 if $test -f uselargefiles.cbu; then
4479 echo "Your platform has some specific hints for large file builds, using them..."
4480 . ./uselargefiles.cbu
4482 echo "Rechecking to see how big your file offsets are..." >&4
4484 #include <sys/types.h>
4488 printf("%d\n", (int)sizeof($lseektype));
4493 if eval $compile_ok; then
4495 $echo "Your file offsets are now $lseeksize bytes long."
4499 echo "(I can't seem to compile the test program. Guessing...)"
4500 rp="What is the size of your file offsets (in bytes)?"
4505 *_t) zzz="$fpostype" ;;
4508 $echo $n "Rechecking the size of $zzz...$c" >&4
4510 #include <sys/types.h>
4513 printf("%d\n", (int)sizeof($fpostype));
4518 if eval $compile_ok; then
4523 echo "(I can't execute the test program--guessing $fpossize.)" >&4
4526 echo " $fpossize bytes." >&4
4532 echo "(I can't compile the test program. Guessing...)" >&4
4533 rp="What is the size of your file positions (in bytes)?"
4543 case "$usemorebits" in
4544 "$define"|true|[yY]*)
4545 use64bitint="$define"
4546 uselongdouble="$define"
4547 usemorebits="$define"
4549 *) usemorebits="$undef"
4553 : check for void type
4555 echo "Checking to see how well your C compiler groks the void type..." >&4
4556 case "$voidflags" in
4558 $cat >try.c <<'EOCP'
4564 extern void moo(); /* function returning void */
4565 void (*goo)(); /* ptr to func returning void */
4567 void *hue; /* generic ptr */
4580 int main() { sub(); }
4582 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
4583 voidflags=$defvoidused
4584 echo "Good. It appears to support void to the level $package wants.">&4
4585 if $contains warning .out >/dev/null 2>&1; then
4586 echo "However, you might get some warnings that look like this:"
4590 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
4591 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
4592 echo "It supports 1..."
4593 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
4594 echo "It also supports 2..."
4595 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
4597 echo "And it supports 4 but not 8 definitely."
4599 echo "It doesn't support 4..."
4600 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
4602 echo "But it supports 8."
4605 echo "Neither does it support 8."
4609 echo "It does not support 2..."
4610 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
4612 echo "But it supports 4 and 8."
4614 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
4616 echo "And it supports 4 but has not heard about 8."
4618 echo "However it supports 8 but not 4."
4623 echo "There is no support at all for void."
4628 case "$voidflags" in
4631 Support flag bits are:
4632 1: basic void declarations.
4633 2: arrays of pointers to functions returning void.
4634 4: operations between pointers to and addresses of void functions.
4635 8: generic void pointers.
4638 rp="Your void support flags add up to what?"
4645 : check for length of pointer
4649 echo "Checking to see how big your pointers are..." >&4
4650 if test "$voidflags" -gt 7; then
4651 echo '#define VOID_PTR char *' > try.c
4653 echo '#define VOID_PTR void *' > try.c
4655 $cat >>try.c <<'EOCP'
4659 printf("%d\n", (int)sizeof(VOID_PTR));
4664 if eval $compile_ok; then
4666 echo "Your pointers are $ptrsize bytes long."
4669 echo "(I can't seem to compile the test program. Guessing...)" >&4
4670 rp="What is the size of a pointer (in bytes)?"
4678 : check for long long
4680 echo "Checking to see if you have long long..." >&4
4681 echo 'int main() { long long x = 7; return 0; }' > try.c
4683 if eval $compile; then
4685 echo "You have long long."
4688 echo "You do not have long long."
4694 : check for length of long long
4695 case "${d_longlong}${longlongsize}" in
4698 echo "Checking to see how big your long longs are..." >&4
4699 $cat >try.c <<'EOCP'
4703 printf("%d\n", (int)sizeof(long long));
4708 if eval $compile_ok; then
4709 longlongsize=`./try$exe_ext`
4710 echo "Your long longs are $longlongsize bytes long."
4714 echo "(I can't seem to compile the test program. Guessing...)"
4715 rp="What is the size of a long long (in bytes)?"
4719 if $test "X$longsize" = "X$longlongsize"; then
4720 echo "(That isn't any different from an ordinary long.)"
4726 : determine filename position in cpp output
4728 echo "Computing filename position in cpp output for #include directives..." >&4
4729 echo '#include <stdio.h>' > foo.c
4732 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
4733 $grep '^[ ]*#.*stdio\.h' | \
4734 while read cline; do
4737 while $test \$# -gt 0; do
4738 if $test -r \`echo \$1 | $tr -d '"'\`; then
4743 pos=\`expr \$pos + 1\`
4755 *) pos="${fieldn}th";;
4757 echo "Your cpp writes the filename in the $pos field of the line."
4759 : locate header file
4764 for usrincdir in $usrinc
4766 if test -f \$usrincdir/\$wanted; then
4767 echo "\$usrincdir/\$wanted"
4771 awkprg='{ print \$$fieldn }'
4772 echo "#include <\$wanted>" > foo\$\$.c
4773 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
4774 $grep "^[ ]*#.*\$wanted" | \
4775 while read cline; do
4776 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
4778 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
4779 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
4784 # status = 0: grep returned 0 lines, case statement not executed
4785 # status = 1: headerfile found
4786 # status = 2: while loop executed, no headerfile found
4790 if test \$status -eq 1; then
4797 : define an alternate in-header-list? function
4798 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
4799 cont=true; xxf="echo \"<\$1> found.\" >&4";
4800 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
4801 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
4803 case $# in 4) instead=instead;; *) instead="at last";; esac;
4804 while $test "$cont"; do
4806 var=$2; eval "was=\$$2";
4807 if $test "$xxx" && $test -r "$xxx";
4809 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
4812 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
4813 set $yyy; shift; shift; yyy=$@;
4814 case $# in 0) cont="";;
4815 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
4816 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
4817 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
4818 xxnf="echo \"there is no <\$1>, ...\" >&4";;
4822 do set $yyy; var=$2; eval "was=\$$2";
4823 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
4824 set $yyy; shift; shift; yyy=$@;
4827 : see if inttypes.h is available
4828 : we want a real compile instead of Inhdr because some systems
4829 : have an inttypes.h which includes non-existent headers
4832 #include <inttypes.h>
4834 static int32_t foo32 = 0x12345678;
4838 if eval $compile; then
4839 echo "<inttypes.h> found." >&4
4842 echo "<inttypes.h> NOT found." >&4
4851 echo "Checking to see if you have int64_t..." >&4
4853 #include <sys/types.h>
4854 #$i_inttypes I_INTTYPES
4856 #include <inttypes.h>
4858 int main() { int64_t x = 7; }
4861 if eval $compile; then
4863 echo "You have int64_t."
4866 echo "You do not have int64_t."
4874 echo "Checking which 64-bit integer type we could use..." >&4
4880 val='"unsigned int"'
4885 *) case "$longsize" in
4889 val='"unsigned long"'
4894 *) case "$d_longlong:$longlongsize" in
4899 val='"unsigned long long"'
4904 *) case "$d_int64_t" in
4923 '') echo "Alas, no 64-bit integer types in sight." >&4
4926 *) echo "We could use '$quadtype' for 64-bit integers." >&4
4932 case "$uselonglong" in
4933 "$define"|true|[yY]*)
4936 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
4938 use64bitint="$define"
4941 case "$use64bits" in
4942 "$define"|true|[yY]*)
4945 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
4947 use64bitint="$define"
4950 case "$use64bitints" in
4951 "$define"|true|[yY]*)
4954 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
4956 use64bitint="$define"
4959 case "$use64bitsint" in
4960 "$define"|true|[yY]*)
4963 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
4965 use64bitint="$define"
4968 case "$uselonglongs" in
4969 "$define"|true|[yY]*)
4972 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
4974 use64bitint="$define"
4977 case "$use64bitsall" in
4978 "$define"|true|[yY]*)
4981 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
4983 use64bitall="$define"
4988 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
4990 case "$use64bitall" in
4991 "$define"|true|[yY]*) use64bitint="$define" ;;
4997 You have natively 64-bit long integers.
5001 *) case "$use64bitint" in
5002 "$define"|true|[yY]*) dflt='y';;
5011 Perl can be built to take advantage of 64-bit integer types
5012 on some systems. To do so, Configure can be run with -Duse64bitint.
5013 Choosing this option will most probably introduce binary incompatibilities.
5015 If this doesn't make any sense to you, just accept the default '$dflt'.
5016 (The default has been chosen based on your configuration.)
5018 rp='Try to use 64-bit integers, if available?'
5021 [yY]*) val="$define" ;;
5029 case "$use64bitall" in
5030 "$define"|true|[yY]*) dflt='y' ;;
5031 *) case "$longsize" in
5039 You may also choose to try maximal 64-bitness. It means using as much
5040 64-bitness as possible on the platform. This in turn means even more
5041 binary incompatibilities. On the other hand, your platform may not
5042 have any more 64-bitness available than what you already have chosen.
5044 If this doesn't make any sense to you, just accept the default '$dflt'.
5045 (The default has been chosen based on your configuration.)
5047 rp='Try to use maximal 64-bit support, if available?'
5050 [yY]*) val="$define" ;;
5055 case "$use64bitall" in
5057 case "$use64bitint" in
5061 Since you have chosen a maximally 64-bit build, I'm also turning on
5062 the use of 64-bit integers.
5064 use64bitint="$define" ;;
5069 case "$use64bitall" in
5070 "$define"|true|[yY]*)
5074 *** You have chosen a maximally 64-bit build, but your pointers
5075 *** are only 4 bytes wide, disabling maximal 64-bitness.
5078 use64bitall="$undef"
5079 case "$use64bitint" in
5080 "$define"|true|[yY]*) ;;
5083 *** Downgrading from maximal 64-bitness to using 64-bit integers.
5086 use64bitint="$define"
5094 case "$use64bitint" in
5095 "$define"|true|[yY]*)
5096 : Look for a hint-file generated 'call-back-unit'. If the
5097 : user has specified that a 64-bit perl is to be built,
5098 : we may need to set or change some other defaults.
5099 if $test -f use64bitint.cbu; then
5100 echo "Your platform has some specific hints for 64-bit integers, using them..."
5104 4) case "$archname64" in
5105 '') archname64=64int ;;
5112 case "$use64bitall" in
5113 "$define"|true|[yY]*)
5114 : Look for a hint-file generated 'call-back-unit'. If the
5115 : user has specified that a maximally 64-bit perl is to be built,
5116 : we may need to set or change some other defaults.
5117 if $test -f use64bitall.cbu; then
5118 echo "Your platform has some specific hints for 64-bit builds, using them..."
5122 4) case "$archname64" in
5123 ''|64int) archname64=64all ;;
5131 echo "Checking for GNU C Library..." >&4
5132 cat >gnulibc.c <<EOM
5144 if eval $compile_ok && ./gnulibc; then
5146 echo "You are using the GNU C Library"
5149 echo "You are not using the GNU C Library"
5155 : see if nm is to be used to determine whether a symbol is defined or not
5159 case "$d_gnulibc" in
5162 echo "nm probably won't work on the GNU C Library." >&4
5168 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
5170 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
5171 echo "'nm' won't be sufficient on this sytem." >&4
5177 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
5178 if $test $dflt -gt 20; then
5188 true|$define) dflt=y;;
5195 I can use $nm to extract the symbols from your C libraries. This
5196 is a time consuming task which may generate huge output on the disk (up
5197 to 3 megabytes) but that should make the symbols extraction faster. The
5198 alternative is to skip the 'nm' extraction part and to compile a small
5199 test program instead to determine whether each symbol is present. If
5200 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
5201 this may be the best solution.
5203 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
5206 rp="Shall I use $nm to extract C symbols from the libraries?"
5209 [Nn]*) usenm=false;;
5218 : nm options which may be necessary
5220 '') if $test -f /mach_boot; then
5222 elif $test -d /usr/ccs/lib; then
5223 nm_opt='-p' # Solaris (and SunOS?)
5224 elif $test -f /dgux; then
5226 elif $test -f /lib64/rld; then
5227 nm_opt='-p' # 64-bit Irix
5233 : nm options which may be necessary for shared libraries but illegal
5234 : for archive libraries. Thank you, Linux.
5235 case "$nm_so_opt" in
5236 '') case "$myuname" in
5238 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
5239 nm_so_opt='--dynamic'
5248 : get list of predefined functions in a handy place
5253 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
5260 *) for thislib in $libs; do
5263 : Handle C library specially below.
5266 thislib=`echo $thislib | $sed -e 's/^-l//'`
5267 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
5269 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
5271 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
5273 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
5275 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
5277 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
5279 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
5284 libnames="$libnames $try"
5286 *) libnames="$libnames $thislib" ;;
5295 for xxx in $libpth; do
5296 $test -r $1 || set $xxx/libc.$so
5297 : The messy sed command sorts on library version numbers.
5299 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
5300 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
5302 s/[0-9][0-9]*/0000&/g
5303 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
5306 $sort | $sed -e 's/^.* //'`
5309 $test -r $1 || set /usr/ccs/lib/libc.$so
5310 $test -r $1 || set /lib/libsys_s$_a
5316 if $test -r "$1"; then
5317 echo "Your (shared) C library seems to be in $1."
5319 elif $test -r /lib/libc && $test -r /lib/clib; then
5320 echo "Your C library seems to be in both /lib/clib and /lib/libc."
5322 libc='/lib/clib /lib/libc'
5323 if $test -r /lib/syslib; then
5324 echo "(Your math library is in /lib/syslib.)"
5325 libc="$libc /lib/syslib"
5327 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5328 echo "Your C library seems to be in $libc, as you said before."
5329 elif $test -r $incpath/usr/lib/libc$_a; then
5330 libc=$incpath/usr/lib/libc$_a;
5331 echo "Your C library seems to be in $libc. That's fine."
5332 elif $test -r /lib/libc$_a; then
5334 echo "Your C library seems to be in $libc. You're normal."
5336 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
5338 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
5339 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
5340 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
5342 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5344 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5347 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
5349 if $test -r "$tans"; then
5350 echo "Your C library seems to be in $tans, of all places."
5356 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5360 If the guess above is wrong (which it might be if you're using a strange
5361 compiler, or your machine supports multiple models), you can override it here.
5366 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
5368 I can't seem to find your C library. I've looked in the following places:
5371 $sed 's/^/ /' libpath
5374 None of these seems to contain your C library. I need to get its name...
5379 rp='Where is your C library?'
5384 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
5385 set X `cat libnames`
5388 case $# in 1) xxx=file; esac
5389 echo "Extracting names from the following $xxx for later perusal:" >&4
5391 $sed 's/^/ /' libnames >&4
5393 $echo $n "This may take a while...$c" >&4
5397 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
5398 *) $nm $nm_opt $file 2>/dev/null;;
5403 $grep fprintf libc.tmp > libc.ptf
5404 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
5405 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
5407 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
5409 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5411 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
5413 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5415 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
5417 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5419 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
5421 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5423 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
5425 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5427 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
5429 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5431 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
5432 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
5434 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5436 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
5438 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5440 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
5442 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5444 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
5446 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5448 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
5450 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5452 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
5454 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5456 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
5458 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5460 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
5462 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5465 $nm -p $* 2>/dev/null >libc.tmp
5466 $grep fprintf libc.tmp > libc.ptf
5467 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
5468 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
5474 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
5476 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
5477 for thisname in $libnames $libc; do
5478 $ar t $thisname >>libc.tmp
5480 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
5482 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
5483 # Repeat libc to extract forwarders to DLL entries too
5484 for thisname in $libnames $libc; do
5485 $ar tv $thisname >>libc.tmp
5486 # Revision 50 of EMX has bug in $ar.
5487 # it will not extract forwarders to DLL entries
5488 # Use emximp which will extract exactly them.
5489 emximp -o tmp.imp $thisname \
5491 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
5492 < tmp.imp >>libc.tmp
5495 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
5498 echo "$ar didn't seem to work right." >&4
5499 echo "Maybe this is a Cray...trying bld instead..." >&4
5500 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
5502 for thisname in $libnames; do
5504 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
5505 $ar t $thisname >>libc.tmp
5509 echo "That didn't work either. Giving up." >&4
5516 if $test -f /lib/syscalls.exp; then
5518 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
5519 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*$/\1/p' /lib/syscalls.exp >>libc.list
5523 $rm -f libnames libpath
5525 : is a C symbol defined?
5528 -v) tf=libc.tmp; tc=""; tdc="";;
5529 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
5530 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
5533 case "$reuseval-$4" in
5535 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
5541 if $contains $tlook $tf >/dev/null 2>&1;
5546 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
5547 if $cc -o t $optimize $ccflags $ldflags t.c $libs >/dev/null 2>&1;
5555 $define) tval=true;;
5561 : define an is-in-libc? function
5562 inlibc='echo " "; td=$define; tu=$undef;
5563 sym=$1; var=$2; eval "was=\$$2";
5565 case "$reuseval$was" in
5575 echo "$sym() found." >&4;
5576 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
5578 echo "$sym() NOT found." >&4;
5579 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
5583 $define) echo "$sym() found." >&4;;
5584 *) echo "$sym() NOT found." >&4;;
5588 : see if sqrtl exists
5593 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
5596 case "$uselongdouble" in
5597 $define|true|[yY]*) dflt='y';;
5602 Perl can be built to take advantage of long doubles which
5603 (if available) may give more accuracy and range for floating point numbers.
5605 If this doesn't make any sense to you, just accept the default '$dflt'.
5607 rp='Try to use long doubles if available?'
5610 y|Y) val="$define" ;;
5616 case "$uselongdouble" in
5617 true|[yY]*) uselongdouble="$define" ;;
5620 case "$uselongdouble" in
5622 : Look for a hint-file generated 'call-back-unit'. If the
5623 : user has specified that long doubles should be used,
5624 : we may need to set or change some other defaults.
5625 if $test -f uselongdouble.cbu; then
5626 echo "Your platform has some specific hints for long doubles, using them..."
5627 . ./uselongdouble.cbu
5630 (Your platform doesn't have any specific hints for long doubles.)
5636 case "$uselongdouble:$d_sqrtl" in
5640 *** You requested the use of long doubles but you do not seem to have
5641 *** the mathematic functions for long doubles. I'm disabling the use
5642 *** of long doubles.
5645 uselongdouble=$undef
5649 : check for length of double
5651 case "$doublesize" in
5653 echo "Checking to see how big your double precision numbers are..." >&4
5654 $cat >try.c <<'EOCP'
5658 printf("%d\n", (int)sizeof(double));
5663 if eval $compile_ok; then
5665 echo "Your double is $doublesize bytes long."
5668 echo "(I can't seem to compile the test program. Guessing...)"
5669 rp="What is the size of a double precision number (in bytes)?"
5677 : check for long doubles
5679 echo "Checking to see if you have long double..." >&4
5680 echo 'int main() { long double x = 7.0; }' > try.c
5682 if eval $compile; then
5684 echo "You have long double."
5687 echo "You do not have long double."
5693 : check for length of long double
5694 case "${d_longdbl}${longdblsize}" in
5697 echo "Checking to see how big your long doubles are..." >&4
5698 $cat >try.c <<'EOCP'
5702 printf("%d\n", sizeof(long double));
5707 if eval $compile; then
5708 longdblsize=`./try$exe_ext`
5709 echo "Your long doubles are $longdblsize bytes long."
5713 echo "(I can't seem to compile the test program. Guessing...)" >&4
5714 rp="What is the size of a long double (in bytes)?"
5718 if $test "X$doublesize" = "X$longdblsize"; then
5719 echo "(That isn't any different from an ordinary double.)"
5725 case "$useperlio" in
5726 $define|true|[yY]*|'') dflt='y';;
5731 Previous version of $package used the standard IO mechanisms as
5732 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
5733 alternate IO mechanisms via the PerlIO abstraction layer, but the
5734 stdio mechanism is still available if needed. The abstraction layer
5735 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
5736 Using PerlIO with sfio may cause problems with some extension modules.
5738 If this doesn't make any sense to you, just accept the default '$dflt'.
5740 rp='Use the PerlIO abstraction layer?'
5747 echo "Ok, doing things the stdio way."
5756 case "$useperlio" in
5757 $define|true|[yY]*) ;;
5760 You are using the SOCKS proxy protocol library which means that you
5761 should also use the PerlIO layer. You may be headed for trouble.
5770 : determine the architecture name
5772 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5773 tarch=`arch`"-$osname"
5774 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5775 if uname -m > tmparch 2>&1 ; then
5776 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5777 -e 's/$/'"-$osname/" tmparch`
5785 case "$myarchname" in
5788 echo "(Your architecture name used to be $myarchname.)"
5795 *) dflt="$archname";;
5797 rp='What is your architecture name'
5800 case "$usethreads" in
5802 echo "Threads selected." >&4
5804 *-thread*) echo "...and architecture name already has -thread." >&4
5806 *) archname="$archname-thread"
5807 echo "...setting architecture name to $archname." >&4
5812 case "$usemultiplicity" in
5814 echo "Multiplicity selected." >&4
5816 *-multi*) echo "...and architecture name already has -multi." >&4
5818 *) archname="$archname-multi"
5819 echo "...setting architecture name to $archname." >&4
5824 case "$use64bitint$use64bitall" in
5826 case "$archname64" in
5828 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
5831 case "$use64bitint" in
5832 "$define") echo "64 bit integers selected." >&4 ;;
5834 case "$use64bitall" in
5835 "$define") echo "Maximal 64 bitness selected." >&4 ;;
5838 *-$archname64*) echo "...and architecture name already has $archname64." >&4
5840 *) archname="$archname-$archname64"
5841 echo "...setting architecture name to $archname." >&4
5847 case "$uselongdouble" in
5849 echo "Long doubles selected." >&4
5850 case "$longdblsize" in
5852 "...but long doubles are equal to doubles, not changing architecture name." >&4
5856 *-ld*) echo "...and architecture name already has -ld." >&4
5858 *) archname="$archname-ld"
5859 echo "...setting architecture name to $archname." >&4
5866 case "$useperlio" in
5868 echo "Perlio selected." >&4
5871 echo "Perlio not selected, using stdio." >&4
5873 *-stdio*) echo "...and architecture name already has -stdio." >&4
5875 *) archname="$archname-stdio"
5876 echo "...setting architecture name to $archname." >&4
5882 : determine root of directory hierarchy where package will be installed.
5885 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
5893 By default, $package will be installed in $dflt/bin, manual pages
5894 under $dflt/man, etc..., i.e. with $dflt as prefix for all
5895 installation directories. Typically this is something like /usr/local.
5896 If you wish to have binaries under /usr/bin but other parts of the
5897 installation under /usr/local, that's ok: you will be prompted
5898 separately for each of the installation directories, the prefix being
5899 only used to set the defaults.
5903 rp='Installation prefix to use?'
5911 *) oldprefix="$prefix";;
5920 *) afsroot=$afsroot ;;
5926 $define|true) afs=true ;;
5927 $undef|false) afs=false ;;
5928 *) if test -d $afsroot; then
5936 echo "AFS may be running... I'll be extra cautious then..." >&4
5938 echo "AFS does not seem to be running..." >&4
5941 : determine installation prefix for where package is to be installed.
5945 Since you are running AFS, I need to distinguish the directory in which
5946 files will reside from the directory in which they are installed (and from
5947 which they are presumably copied to the former directory by occult means).
5950 case "$installprefix" in
5951 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
5952 *) dflt="$installprefix";;
5957 In some special cases, particularly when building $package for distribution,
5958 it is convenient to distinguish between the directory in which files should
5959 be installed from the directory ($prefix) in which they
5960 will eventually reside. For most users, these two directories are the same.
5963 case "$installprefix" in
5965 *) dflt=$installprefix;;
5969 rp='What installation prefix should I use for installing files?'
5971 installprefix="$ans"
5972 installprefixexp="$ansexp"
5974 : set the prefixit variable, to compute a suitable default value
5975 prefixit='case "$3" in
5977 case "$oldprefix" in
5978 "") eval "$1=\"\$$2\"";;
5985 ""|" ") eval "$1=\"\$$2\"";;
5991 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
5993 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
5994 /*-$oldprefix/*|\~*-$oldprefix/*)
5995 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
5996 *) eval "$1=\"\$$2\"";;
6001 : get the patchlevel
6003 echo "Getting the current patchlevel..." >&4
6004 if $test -r $rsrc/patchlevel.h;then
6005 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
6006 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
6007 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
6008 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
6009 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
6010 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
6011 perl_patchlevel=`grep ',"DEVEL[0-9][0-9]*"' $rsrc/patchlevel.h|sed 's/[^0-9]//g'`
6020 $echo "(You do not have patchlevel.h. Eek.)"
6022 if $test -r $rsrc/.patch ; then
6023 if $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
6024 perl_patchlevel=`cat $rsrc/.patch`
6027 case "$perl_patchlevel" in
6029 '') $echo "(You have $package version $patchlevel subversion $subversion.)" ;;
6030 *) $echo "(You have $package version $patchlevel subversion $subversion patchlevel $perl_patchlevel.)" ;;
6034 : XXX Should be a Configure test for double-dots in filenames.
6035 version=`echo $revision $patchlevel $subversion | \
6036 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
6037 api_versionstring=`echo $api_revision $api_version $api_subversion | \
6038 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
6041 version=`echo $revision $patchlevel $subversion | \
6042 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
6043 api_versionstring=`echo $api_revision $api_version $api_subversion | \
6044 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
6047 : Special case the 5.005_xx maintenance series, which used 5.005
6048 : without any subversion label as a subdirectory in $sitelib
6049 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
6050 api_versionstring='5.005'
6053 : determine installation style
6054 : For now, try to deduce it from prefix unless it is already set.
6055 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6056 case "$installstyle" in
6057 '') case "$prefix" in
6058 *perl*) dflt='lib';;
6059 *) dflt='lib/perl5' ;;
6062 *) dflt="$installstyle" ;;
6064 : Probably not worth prompting for this since we prompt for all
6065 : the directories individually, and the prompt would be too long and
6069 : determine where private library files go
6070 : Usual default is /usr/local/lib/perl5/$version.
6071 : Also allow things like /opt/perl/lib/$version, since
6072 : /opt/perl/lib/perl5... would be redundant.
6073 : The default "style" setting is made in installstyle.U
6074 case "$installstyle" in
6075 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6076 *) set dflt privlib lib/$version ;;
6081 There are some auxiliary files for $package that need to be put into a
6082 private library directory that is accessible by everyone.
6086 rp='Pathname where the private library files will reside?'
6089 privlibexp="$ansexp"
6090 : Change installation prefix, if necessary.
6091 if $test X"$prefix" != X"$installprefix"; then
6092 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
6094 installprivlib="$privlibexp"
6097 : set the prefixup variable, to restore leading tilda escape
6098 prefixup='case "$prefixexp" in
6100 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6103 : determine where public architecture dependent libraries go
6106 : privlib default is /usr/local/lib/$package/$version
6107 : archlib default is /usr/local/lib/$package/$version/$archname
6108 : privlib may have an optional trailing /share.
6109 tdflt=`echo $privlib | $sed 's,/share$,,'`
6110 tdflt=$tdflt/$archname
6119 $spackage contains architecture-dependent library files. If you are
6120 sharing libraries in a heterogeneous environment, you might store
6121 these files in a separate location. Otherwise, you can just include
6122 them with the rest of the public library files.
6126 rp='Where do you want to put the public architecture-dependent libraries?'
6129 archlibexp="$ansexp"
6130 if $test X"$archlib" = X"$privlib"; then
6135 : Change installation prefix, if necessary.
6136 if $test X"$prefix" != X"$installprefix"; then
6137 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
6139 installarchlib="$archlibexp"
6143 : Binary compatibility with 5.005 is not possible for builds
6144 : with advanced features
6145 case "$usethreads$usemultiplicity" in
6147 bincompat5005="$undef"
6148 d_bincompat5005="$undef"
6152 This version of Perl can be compiled for binary compatibility with 5.005.
6153 If you decide to do so, you will be able to continue using most of the
6154 extensions that were compiled for Perl 5.005.
6157 case "$bincompat5005$d_bincompat5005" in
6158 *"$undef"*) dflt=n ;;
6161 rp='Binary compatibility with Perl 5.005?'
6164 y*) val="$define" ;;
6169 case "$d_bincompat5005" in
6171 bincompat5005="$define"
6173 *) bincompat5005="$undef"
6174 d_bincompat5005="$undef"
6181 : see if setuid scripts can be secure
6184 Some kernels have a bug that prevents setuid #! scripts from being
6185 secure. Some sites have disabled setuid #! scripts because of this.
6187 First let's decide if your kernel supports secure setuid #! scripts.
6188 (If setuid #! scripts would be secure but have been disabled anyway,
6189 don't say that they are secure if asked.)
6194 if $test -d /dev/fd; then
6195 echo "#!$ls" >reflect
6196 chmod +x,u+s reflect
6197 ./reflect >flect 2>&1
6198 if $contains "/dev/fd" flect >/dev/null; then
6199 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6203 If you are not sure if they are secure, I can check but I'll need a
6204 username and password different from the one you are using right now.
6205 If you don't have such a username or don't want me to test, simply
6209 rp='Other username to test security of setuid scripts with?'
6214 case "$d_suidsafe" in
6215 '') echo "I'll assume setuid scripts are *not* secure." >&4
6218 echo "Well, the $hint value is *not* secure." >&4
6220 *) echo "Well, the $hint value *is* secure." >&4
6225 $rm -f reflect flect
6226 echo "#!$ls" >reflect
6227 chmod +x,u+s reflect
6230 echo '"su" will (probably) prompt you for '"$ans's password."
6231 su $ans -c './reflect >flect'
6232 if $contains "/dev/fd" flect >/dev/null; then
6233 echo "Okay, it looks like setuid scripts are secure." >&4
6236 echo "I don't think setuid scripts are secure." >&4
6241 rp='Does your kernel have *secure* setuid scripts?'
6244 [yY]*) val="$define";;
6249 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6250 echo "(That's for file descriptors, not floppy disks.)"
6256 $rm -f reflect flect
6258 : now see if they want to do setuid emulation
6261 case "$d_suidsafe" in
6264 echo "No need to emulate SUID scripts since they are secure here." >& 4
6268 Some systems have disabled setuid scripts, especially systems where
6269 setuid scripts cannot be secure. On systems where setuid scripts have
6270 been disabled, the setuid/setgid bits on scripts are currently
6271 useless. It is possible for $package to detect those bits and emulate
6272 setuid/setgid in a secure fashion. This emulation will only work if
6273 setuid scripts have been disabled in your kernel.
6277 "$define") dflt=y ;;
6280 rp="Do you want to do setuid/setgid emulation?"
6283 [yY]*) val="$define";;
6291 : see if this is a malloc.h system
6292 set malloc.h i_malloc
6295 : see if stdlib is available
6296 set stdlib.h i_stdlib
6299 : determine which malloc to compile in
6301 case "$usemymalloc" in
6302 [yY]*|true|$define) dflt='y' ;;
6303 [nN]*|false|$undef) dflt='n' ;;
6304 *) case "$ptrsize" in
6310 rp="Do you wish to attempt to use the malloc that comes with $package?"
6316 mallocsrc='malloc.c'
6317 mallocobj="malloc$_o"
6318 d_mymalloc="$define"
6321 : Remove malloc from list of libraries to use
6322 echo "Removing unneeded -lmalloc from library list" >&4
6323 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6326 echo "libs = $libs" >&4
6338 : compute the return types of malloc and free
6340 $cat >malloc.c <<END
6344 #include <sys/types.h>
6358 case "$malloctype" in
6360 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6367 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6371 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6378 echo "Your system uses $freetype free(), it would seem." >&4
6382 After $package is installed, you may wish to install various
6383 add-on modules and utilities. Typically, these add-ons will
6384 be installed under $prefix with the rest
6385 of this package. However, you may wish to install such add-ons
6386 elsewhere under a different prefix.
6388 If you do not wish to put everything under a single prefix, that's
6389 ok. You will be prompted for the individual locations; this siteprefix
6390 is only used to suggest the defaults.
6392 The default should be fine for most people.
6396 rp='Installation prefix to use for add-on modules and utilities?'
6397 : XXX Here might be another good place for an installstyle setting.
6398 case "$siteprefix" in
6400 *) dflt=$siteprefix ;;
6403 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6405 case "$siteprefix" in
6409 *) oldsiteprefix="$prefix";;
6414 siteprefixexp="$ansexp"
6416 : determine where site specific libraries go.
6417 : Usual default is /usr/local/lib/perl5/site_perl/$version
6418 : The default "style" setting is made in installstyle.U
6419 : XXX No longer works with Prefixit stuff.
6420 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6422 '') case "$installstyle" in
6423 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6424 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6432 The installation process will create a directory for
6433 site-specific extensions and modules. Most users find it convenient
6434 to place all site-specific files in this directory rather than in the
6435 main distribution directory.
6439 rp='Pathname for the site-specific library files?'
6442 sitelibexp="$ansexp"
6443 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6444 : Change installation prefix, if necessary.
6445 if $test X"$prefix" != X"$installprefix"; then
6446 installsitelib=`echo $sitelibexp | $sed "s#^$prefix#$installprefix#"`
6448 installsitelib="$sitelibexp"
6451 : determine where site specific architecture-dependent libraries go.
6452 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6453 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6454 : sitelib may have an optional trailing /share.
6456 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6457 dflt="$dflt/$archname"
6462 set sitearch sitearch none
6466 The installation process will also create a directory for
6467 architecture-dependent site-specific extensions and modules.
6471 rp='Pathname for the site-specific architecture-dependent library files?'
6474 sitearchexp="$ansexp"
6475 : Change installation prefix, if necessary.
6476 if $test X"$prefix" != X"$installprefix"; then
6477 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
6479 installsitearch="$sitearchexp"
6484 The installation process will also create a directory for
6485 vendor-supplied add-ons. Vendors who supply perl with their system
6486 may find it convenient to place all vendor-supplied files in this
6487 directory rather than in the main distribution directory. This will
6488 ease upgrades between binary-compatible maintenance versions of perl.
6490 Of course you may also use these directories in whatever way you see
6491 fit. For example, you might use them to access modules shared over a
6492 company-wide network.
6494 The default answer should be fine for most people.
6495 This causes further questions about vendor add-ons to be skipped
6496 and no vendor-specific directories will be configured for perl.
6499 rp='Do you want to configure vendor-specific add-on directories?'
6500 case "$usevendorprefix" in
6501 define|true|[yY]*) dflt=y ;;
6502 *) : User may have set vendorprefix directly on Configure command line.
6503 case "$vendorprefix" in
6512 rp='Installation prefix to use for vendor-supplied add-ons?'
6513 case "$vendorprefix" in
6515 *) dflt=$vendorprefix ;;
6518 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6520 case "$vendorprefix" in
6524 *) oldvendorprefix="$prefix";;
6528 usevendorprefix="$define"
6530 vendorprefixexp="$ansexp"
6532 *) usevendorprefix="$undef"
6538 case "$vendorprefix" in
6539 '') d_vendorlib="$undef"
6543 *) d_vendorlib="$define"
6544 : determine where vendor-supplied modules go.
6545 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6546 case "$vendorlib" in
6548 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6549 case "$installstyle" in
6550 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6551 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6554 *) dflt="$vendorlib"
6558 rp='Pathname for the vendor-supplied library files?'
6561 vendorlibexp="$ansexp"
6564 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6565 : Change installation prefix, if necessary.
6566 if $test X"$prefix" != X"$installprefix"; then
6567 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
6569 installvendorlib="$vendorlibexp"
6572 case "$vendorprefix" in
6573 '') d_vendorarch="$undef"
6577 *) d_vendorarch="$define"
6578 : determine where vendor-supplied architecture-dependent libraries go.
6579 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6580 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6581 : vendorlib may have an optional trailing /share.
6582 case "$vendorarch" in
6583 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6584 dflt="$dflt/$archname"
6586 *) dflt="$vendorarch" ;;
6589 rp='Pathname for vendor-supplied architecture-dependent files?'
6592 vendorarchexp="$ansexp"
6595 : Change installation prefix, if necessary.
6596 if $test X"$prefix" != X"$installprefix"; then
6597 installvendorarch=`echo $vendorarchexp | sed "s#^$prefix#$installprefix#"`
6599 installvendorarch="$vendorarchexp"
6602 : Final catch-all directories to search
6605 Lastly, you can have perl look in other directories for extensions and
6606 modules in addition to those already specified.
6607 These directories will be searched after
6611 test X"$vendorlib" != "X" && echo ' ' $vendorlib
6612 test X"$vendorarch" != "X" && echo ' ' $vendorarch
6614 case "$otherlibdirs" in
6615 ''|' ') dflt='none' ;;
6616 *) dflt="$otherlibdirs" ;;
6619 Enter a colon-separated set of extra paths to include in perl's @INC
6620 search path, or enter 'none' for no extra paths.
6624 rp='Colon-separated list of additional directories for perl to search?'
6627 ' '|''|none) otherlibdirs=' ' ;;
6628 *) otherlibdirs="$ans" ;;
6630 case "$otherlibdirs" in
6634 set d_perl_otherlibdirs
6637 : Cruising for prototypes
6639 echo "Checking out function prototypes..." >&4
6640 $cat >prototype.c <<'EOCP'
6641 int main(int argc, char *argv[]) {
6644 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
6645 echo "Your C compiler appears to support function prototypes."
6648 echo "Your C compiler doesn't seem to understand function prototypes."
6655 case "$prototype" in
6657 *) ansi2knr='ansi2knr'
6662 This version of $package can only be compiled by a compiler that
6663 understands function prototypes. Unfortunately, your C compiler
6665 doesn't seem to understand them. Sorry about that.
6667 If GNU cc is available for your system, perhaps you could try that instead.
6669 Eventually, we hope to support building Perl with pre-ANSI compilers.
6670 If you would like to help in that effort, please contact <perlbug@perl.org>.
6672 Aborting Configure now.
6678 : determine where public executables go
6683 rp='Pathname where the public executables will reside?'
6685 if $test "X$ansexp" != "X$binexp"; then
6690 : Change installation prefix, if necessary.
6691 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6692 if $test X"$prefix" != X"$installprefix"; then
6693 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
6695 installbin="$binexp"
6698 : Find perl5.005 or later.
6699 echo "Looking for a previously installed perl5.005 or later... "
6701 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6702 : Check if this perl is recent and can load a simple module
6703 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6706 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6716 '') echo "None found. That's ok.";;
6717 *) echo "Using $perl5." ;;
6720 : Determine list of previous versions to include in @INC
6721 $cat > getverlist <<EOPL
6724 \$api_versionstring = "$api_versionstring";
6725 \$version = "$version";
6726 \$stem = "$sitelib_stem";
6727 \$archname = "$archname";
6729 $cat >> getverlist <<'EOPL'
6730 # Can't have leading @ because metaconfig interprets it as a command!
6731 ;@inc_version_list=();
6732 # XXX Redo to do opendir/readdir?
6735 ;@candidates = glob("5.*");
6741 # XXX ToDo: These comparisons must be reworked when two-digit
6742 # subversions come along, so that 5.7.10 compares as greater than
6743 # 5.7.3! By that time, hope that 5.6.x is sufficiently
6744 # widespread that we can use the built-in version vectors rather
6745 # than reinventing them here. For 5.6.0, however, we must
6746 # assume this script will likely be run by 5.005_0x. --AD 1/2000.
6747 foreach $d (@candidates) {
6748 if ($d lt $version) {
6749 if ($d ge $api_versionstring) {
6750 unshift(@inc_version_list, grep { -d } "$d/$archname", $d);
6752 elsif ($d ge "5.005") {
6753 unshift(@inc_version_list, grep { -d } $d);
6757 # Skip newer version. I.e. don't look in
6758 # 5.7.0 if we're installing 5.6.1.
6762 if (@inc_version_list) {
6763 print join(' ', @inc_version_list);
6766 # Blank space to preserve value for next Configure run.
6771 case "$inc_version_list" in
6772 '') if test -x "$perl5$exe_ext"; then
6773 dflt=`$perl5 getverlist`
6778 $undef) dflt='none' ;;
6779 *) dflt="$inc_version_list" ;;
6782 ''|' ') dflt=none ;;
6785 5.005) case "$bincompat5005" in
6786 $define|true|[yY]*) ;;
6793 In order to ease the process of upgrading, this version of perl
6794 can be configured to use modules built and installed with earlier
6795 versions of perl that were installed under $prefix. Specify here
6796 the list of earlier versions that this version of perl should check.
6797 If Configure detected no earlier versions of perl installed under
6798 $prefix, then the list will be empty. Answer 'none' to tell perl
6799 to not search earlier versions.
6801 The default should almost always be sensible, so if you're not sure,
6802 just accept the default.
6805 rp='List of earlier versions to include in @INC?'
6808 [Nn]one|''|' ') inc_version_list=' ' ;;
6809 *) inc_version_list="$ans" ;;
6811 case "$inc_version_list" in
6813 inc_version_list_init='0';;
6814 *) inc_version_list_init=`echo $inc_version_list |
6815 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6820 : determine whether to install perl also as /usr/bin/perl
6823 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
6825 Many scripts expect perl to be installed as /usr/bin/perl.
6826 I can install the perl you are about to compile also as /usr/bin/perl
6827 (in addition to $installbin/perl).
6829 case "$installusrbinperl" in
6830 "$undef"|[nN]*) dflt='n';;
6833 rp="Do you want to install perl as /usr/bin/perl?"
6836 [yY]*) val="$define";;
6842 set installusrbinperl
6845 : see if dld is available
6849 : see if dlopen exists
6856 : determine which dynamic loading, if any, to compile in
6858 dldir="ext/DynaLoader"
6871 $define) dflt='y' ;;
6874 $define) dflt='y' ;;
6876 : Does a dl_xxx.xs file exist for this operating system
6877 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
6880 rp="Do you wish to use dynamic loading?"
6887 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
6888 dflt="$dldir/dl_${osname}.xs"
6889 elif $test "$d_dlopen" = "$define" ; then
6890 dflt="$dldir/dl_dlopen.xs"
6891 elif $test "$i_dld" = "$define" ; then
6892 dflt="$dldir/dl_dld.xs"
6897 *) dflt="$dldir/$dlsrc"
6900 echo "The following dynamic loading files are available:"
6901 : Can not go over to $dldir because getfile has path hard-coded in.
6902 tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir
6903 rp="Source file to use for dynamic loading"
6909 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
6913 Some systems may require passing special flags to $cc -c to
6914 compile modules that will be used to create a shared library.
6915 To use no flags, say "none".
6918 case "$cccdlflags" in
6919 '') case "$gccversion" in
6920 '') case "$osname" in
6922 next) dflt='none' ;;
6923 irix*) dflt='-KPIC' ;;
6924 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
6925 sunos) dflt='-pic' ;;
6929 *) case "$osname" in
6930 svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
6935 *) dflt="$cccdlflags" ;;
6937 rp="Any special flags to pass to $cc -c to compile shared library modules?"
6940 none) cccdlflags=' ' ;;
6941 *) cccdlflags="$ans" ;;
6946 Some systems use ld to create libraries that can be dynamically loaded,
6947 while other systems (such as those using ELF) use $cc.
6951 '') $cat >try.c <<'EOM'
6952 /* Test for whether ELF binaries are produced */
6957 int i = open("a.out",O_RDONLY);
6960 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
6961 exit(0); /* succeed (yes, it's ELF) */
6966 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && ./a.out; then
6968 You appear to have ELF support. I'll use $cc to build dynamic libraries.
6972 echo "I'll use ld to build dynamic libraries."
6981 rp="What command should be used to create dynamic libraries?"
6987 Some systems may require passing special flags to $ld to create a
6988 library that can be dynamically loaded. If your ld flags include
6989 -L/other/path options to locate libraries outside your loader's normal
6990 search path, you may need to specify those -L options here as well. To
6991 use no flags, say "none".
6994 case "$lddlflags" in
6995 '') case "$osname" in
6996 beos) dflt='-nostart' ;;
6998 case "$gccversion" in
6999 '') dflt="$dflt +vnocompatwarnings" ;;
7002 linux|irix*) dflt='-shared' ;;
7003 next) dflt='none' ;;
7004 solaris) dflt='-G' ;;
7005 sunos) dflt='-assert nodefinitions' ;;
7006 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
7010 *) dflt="$lddlflags" ;;
7013 : Try to guess additional flags to pick up local libraries.
7014 : Be careful not to append to a plain 'none'
7018 for thisflag in $ldflags; do
7023 *) dflt="$dflt $thisflag" ;;
7030 ''|' ') dflt='none' ;;
7033 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
7036 none) lddlflags=' ' ;;
7037 *) lddlflags="$ans" ;;
7042 Some systems may require passing special flags to $cc to indicate that
7043 the resulting executable will use dynamic linking. To use no flags,
7047 case "$ccdlflags" in
7048 '') case "$osname" in
7049 hpux) dflt='-Wl,-E' ;;
7050 linux) dflt='-rdynamic' ;;
7051 next) dflt='none' ;;
7052 sunos) dflt='none' ;;
7056 *) dflt="$ccdlflags" ;;
7058 rp="Any special flags to pass to $cc to use dynamic linking?"
7061 none) ccdlflags=' ' ;;
7062 *) ccdlflags="$ans" ;;
7076 # No dynamic loading being used, so don't bother even to prompt.
7079 *) case "$useshrplib" in
7080 '') case "$osname" in
7081 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
7083 also='Building a shared libperl is required for dynamic loading to work on your system.'
7088 also='Building a shared libperl is needed for MAB support.'
7106 The perl executable is normally obtained by linking perlmain.c with
7107 libperl${_a}, any static extensions (usually just DynaLoader), and
7108 any other libraries needed on this system (such as -lm, etc.). Since
7109 your system supports dynamic loading, it is probably possible to build
7110 a shared libperl.$so. If you will have more than one executable linked
7111 to libperl.$so, this will significantly reduce the size of each
7112 executable, but it may have a noticeable affect on performance. The
7113 default is probably sensible for your system.
7117 rp="Build a shared libperl.$so (y/n)"
7121 useshrplib='true' ;;
7122 *) useshrplib='false' ;;
7127 case "$useshrplib" in
7131 # Figure out a good name for libperl.so. Since it gets stored in
7132 # a version-specific architecture-dependent library, the version
7133 # number isn't really that important, except for making cc/ld happy.
7135 # A name such as libperl.so.3.1
7136 majmin="libperl.$so.$patchlevel.$subversion"
7137 # A name such as libperl.so.301
7138 majonly=`echo $patchlevel $subversion |
7139 $awk '{printf "%d%02d", $1, $2}'`
7140 majonly=libperl.$so.$majonly
7141 # I'd prefer to keep the os-specific stuff here to a minimum, and
7142 # rely on figuring it out from the naming of libc.
7143 case "${osname}${osvers}" in
7146 # XXX How handle the --version stuff for MAB?
7148 linux*) # ld won't link with a bare -lperl otherwise.
7151 cygwin*) # include version
7152 dflt=`echo libperl$version | sed -e 's/\./_/g'`$lib_ext
7154 *) # Try to guess based on whether libc has major.minor.
7156 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
7157 *libc.$so.[0-9]*) dflt=$majonly ;;
7158 *) dflt=libperl.$so ;;
7168 I need to select a good name for the shared libperl. If your system uses
7169 library names with major and minor numbers, then you might want something
7170 like $majmin. Alternatively, if your system uses a single version
7171 number for shared libraries, then you might want to use $majonly.
7172 Or, your system might be quite happy with a simple libperl.$so.
7174 Since the shared libperl will get installed into a version-specific
7175 architecture-dependent directory, the version number of the shared perl
7176 library probably isn't important, so the default should be o.k.
7179 rp='What name do you want to give to the shared libperl?'
7182 echo "Ok, I'll use $libperl"
7185 libperl="libperl${_a}"
7189 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
7193 WARNING: Use of the shrpdir variable for the installation location of
7194 the shared $libperl is not supported. It was never documented and
7195 will not work in this version. Let me (perlbug@perl.org)
7196 know of any problems this may cause.
7202 But your current setting of $shrpdir is
7203 the default anyway, so it's harmless.
7208 Further, your current attempted setting of $shrpdir
7209 conflicts with the value of $archlibexp/CORE
7210 that installperl will use.
7217 # How will the perl executable find the installed shared $libperl?
7218 # Add $xxx to ccdlflags.
7219 # If we can't figure out a command-line option, use $shrpenv to
7220 # set env LD_RUN_PATH. The main perl makefile uses this.
7221 shrpdir=$archlibexp/CORE
7224 if "$useshrplib"; then
7227 # We'll set it in Makefile.SH...
7233 xxx="-Wl,-R$shrpdir"
7235 linux|irix*|dec_osf)
7236 xxx="-Wl,-rpath,$shrpdir"
7239 # next doesn't like the default...
7242 # beos doesn't like the default, either.
7245 # hpux doesn't like the default, either.
7246 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
7249 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
7255 # Only add $xxx if it isn't already in ccdlflags.
7256 case " $ccdlflags " in
7258 *) ccdlflags="$ccdlflags $xxx"
7261 Adding $xxx to the flags
7262 passed to $ld so that the perl executable will find the
7263 installed shared $libperl.
7271 # Fix ccdlflags in AIX for building external extensions.
7272 # (For building Perl itself bare -bE:perl.exp is needed,
7273 # Makefile.SH takes care of this.)
7275 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
7277 # Respect a hint or command-line value.
7279 '') shrpenv="$tmp_shrpenv" ;;
7281 case "$ldlibpthname" in
7282 '') ldlibpthname=LD_LIBRARY_PATH ;;
7283 none) ldlibpthname='' ;;
7286 : determine where manual pages are on this system
7290 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
7291 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
7292 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
7293 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
7294 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
7295 sysman=`./loc . /usr/man/man1 $syspath`
7298 if $test -d "$sysman"; then
7299 echo "System manual is in $sysman." >&4
7301 echo "Could not find manual pages in source form." >&4
7304 : determine where manual pages go
7305 set man1dir man1dir none
7309 $spackage has manual pages available in source form.
7313 echo "However, you don't have nroff, so they're probably useless to you."
7315 '') man1dir="none";;
7318 echo "If you don't want the manual sources installed, answer 'none'."
7323 lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
7324 lookpath="$lookpath $prefixexp/man/p_man/man1"
7325 lookpath="$lookpath $prefixexp/man/u_man/man1"
7326 lookpath="$lookpath $prefixexp/man/man.1"
7328 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
7329 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
7339 rp="Where do the main $spackage manual pages (source) go?"
7341 if $test "X$man1direxp" != "X$ansexp"; then
7345 man1direxp="$ansexp"
7351 : Change installation prefix, if necessary.
7352 if $test X"$prefix" != X"$installprefix"; then
7353 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
7355 installman1dir="$man1direxp"
7358 : What suffix to use on installed man pages
7365 rp="What suffix should be used for the main $spackage man pages?"
7367 '') case "$man1dir" in
7381 *) dflt="$man1ext";;
7388 : see if we can have long filenames
7390 first=123456789abcdef
7392 if (echo hi >$first) 2>/dev/null; then
7393 if $test -f 123456789abcde; then
7394 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
7397 echo 'You can have filenames longer than 14 characters.'>&4
7402 You can't have filenames longer than 14 chars.
7403 You can't even think about them!
7409 $rm -rf 123456789abcde*
7411 : determine where library module manual pages go
7412 set man3dir man3dir none
7416 $spackage has manual pages for many of the library modules.
7422 However, you don't have nroff, so they're probably useless to you.
7425 '') man3dir="none";;
7429 case "$d_flexfnam" in
7432 However, your system can't handle the long file names like File::Basename.3.
7435 '') man3dir="none";;
7439 echo "If you don't want the manual sources installed, answer 'none'."
7440 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7442 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
7443 if $test -d "$privlib/man/man3"; then
7446 WARNING: Previous versions of perl installed man3 pages into
7447 $privlib/man/man3. This version will suggest a
7448 new default of $dflt.
7452 rp='Do you wish to preserve the old behavior?(y/n)'
7455 y*) dflt="$privlib/man/man3" ;;
7460 *) dflt="$man3dir" ;;
7467 rp="Where do the $package library man pages (source) go?"
7470 man3direxp="$ansexp"
7476 : Change installation prefix, if necessary.
7477 if $test X"$prefix" != X"$installprefix"; then
7478 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
7480 installman3dir="$man3direxp"
7483 : What suffix to use on installed man pages
7489 rp="What suffix should be used for the $package library man pages?"
7491 '') case "$man3dir" in
7505 *) dflt="$man3ext";;
7512 : see if we have to deal with yellow pages, now NIS.
7513 if $test -d /usr/etc/yp || $test -d /etc/yp; then
7514 if $test -f /usr/etc/nibindd; then
7516 echo "I'm fairly confident you're on a NeXT."
7518 rp='Do you get the hosts file via NetInfo?'
7527 y*) hostcat='nidump hosts .';;
7528 *) case "$hostcat" in
7529 nidump*) hostcat='';;
7539 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
7547 rp='Are you getting the hosts file via yellow pages?'
7550 y*) hostcat='ypcat hosts';;
7551 *) hostcat='cat /etc/hosts';;
7557 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
7560 '') test -f /etc/group && groupcat='cat /etc/group';;
7563 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
7566 : now get the host name
7568 echo "Figuring out host name..." >&4
7569 case "$myhostname" in
7571 echo 'Maybe "hostname" will work...'
7572 if tans=`sh -c hostname 2>&1` ; then
7580 if $test "$cont"; then
7582 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
7583 if tans=`cat /etc/systemid 2>&1` ; then
7585 phostname='cat /etc/systemid'
7586 echo "Whadyaknow. Xenix always was a bit strange..."
7589 elif $test -r /etc/systemid; then
7590 echo "(What is a non-Xenix system doing with /etc/systemid?)"
7593 if $test "$cont"; then
7594 echo 'No, maybe "uuname -l" will work...'
7595 if tans=`sh -c 'uuname -l' 2>&1` ; then
7597 phostname='uuname -l'
7599 echo 'Strange. Maybe "uname -n" will work...'
7600 if tans=`sh -c 'uname -n' 2>&1` ; then
7602 phostname='uname -n'
7604 echo 'Oh well, maybe I can mine it out of whoami.h...'
7605 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
7606 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
7607 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
7609 case "$myhostname" in
7610 '') echo "Does this machine have an identity crisis or something?"
7613 echo "Well, you said $myhostname before..."
7614 phostname='echo $myhostname';;
7620 : you do not want to know about this
7625 if $test "$myhostname" ; then
7627 rp='Your host name appears to be "'$myhostname'".'" Right?"
7635 : bad guess or no guess
7636 while $test "X$myhostname" = X ; do
7638 rp="Please type the (one word) name of your host:"
7643 : translate upper to lower if necessary
7644 case "$myhostname" in
7646 echo "(Normalizing case in your host name)"
7647 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
7651 case "$myhostname" in
7653 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
7654 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
7655 echo "(Trimming domain name from host name--host name is now $myhostname)"
7657 *) case "$mydomain" in
7660 test "X$hostcat" = "Xypcat hosts" &&
7661 ypmatch "$myhostname" hosts 2>/dev/null |\
7662 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
7665 test "X$hostcat" != "X" &&
7666 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
7667 /[ ]$myhostname[ . ]/p" > hosts
7670 if $test -f hosts; then
7671 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
7672 END { print sum }" hosts` = x1 || tmp_re="[ ]"
7673 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
7674 hosts | $sort | $uniq | \
7675 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
7676 case `$echo X$dflt` in
7677 X*\ *) echo "(Several hosts in the database matched hostname)"
7680 X.) echo "(You do not have fully-qualified names in the hosts database)"
7684 echo "(I cannot locate a hosts database anywhere)"
7689 tans=`./loc resolv.conf X /etc /usr/etc`
7690 if $test -f "$tans"; then
7691 echo "(Attempting domain name extraction from $tans)"
7692 dflt=.`$sed -n -e 's/ / /g' \
7693 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
7694 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
7696 .) dflt=.`$sed -n -e 's/ / /g' \
7697 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
7698 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
7705 .) echo "(No help from resolv.conf either -- attempting clever guess)"
7706 dflt=.`sh -c domainname 2>/dev/null`
7709 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
7713 case "$dflt$osname" in
7714 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
7715 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
7719 .) echo "(Lost all hope -- silly guess then)"
7725 *) dflt="$mydomain";;
7729 rp="What is your domain name?"
7739 : translate upper to lower if necessary
7742 echo "(Normalizing case in your domain name)"
7743 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
7747 : a little sanity check here
7748 case "$phostname" in
7751 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
7752 $myhostname$mydomain|$myhostname) ;;
7754 case "$phostname" in
7756 echo "(That doesn't agree with your whoami.h file, by the way.)"
7759 echo "(That doesn't agree with your $phostname command, by the way.)"
7769 I need to get your e-mail address in Internet format if possible, i.e.
7770 something like user@host.domain. Please answer accurately since I have
7771 no easy means to double check it. The default value provided below
7772 is most probably close to reality but may not be valid from outside
7773 your organization...
7777 while test "$cont"; do
7779 '') dflt="$cf_by@$myhostname$mydomain";;
7780 *) dflt="$cf_email";;
7782 rp='What is your e-mail address?'
7788 rp='Address does not look like an Internet one. Use it anyway?'
7804 If you or somebody else will be maintaining perl at your site, please
7805 fill in the correct e-mail address here so that they may be contacted
7806 if necessary. Currently, the "perlbug" program included with perl
7807 will send mail to this address in addition to perlbug@perl.org. You may
7808 enter "none" for no administrator.
7811 case "$perladmin" in
7812 '') dflt="$cf_email";;
7813 *) dflt="$perladmin";;
7815 rp='Perl administrator e-mail address'
7819 : determine whether to only install version-specific parts.
7822 Do you want to install only the version-specific parts of the perl
7823 distribution? Usually you do *not* want to do this.
7825 case "$versiononly" in
7826 "$define"|[Yy]*|true) dflt='y' ;;
7829 rp="Do you want to install only the version-specific parts of perl?"
7832 [yY]*) val="$define";;
7838 : figure out how to guarantee perl startup
7839 case "$startperl" in
7841 case "$sharpbang" in
7845 I can use the #! construct to start perl on your system. This will
7846 make startup of perl scripts faster, but may cause problems if you
7847 want to share those scripts and perl is not in a standard place
7848 ($binexp/perl) on all your platforms. The alternative is to force
7849 a shell by starting the script with a single ':' character.
7852 case "$versiononly" in
7853 "$define") dflt="$binexp/perl$version";;
7854 *) dflt="$binexp/perl";;
7856 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
7859 none) startperl=": # use perl";;
7860 *) startperl="#!$ans"
7861 if $test 30 -lt `echo "$ans" | wc -c`; then
7864 WARNING: Some systems limit the #! command to 32 characters.
7865 If you experience difficulty running Perl scripts with #!, try
7866 installing Perl in a directory with a shorter pathname.
7872 *) startperl=": # use perl"
7877 echo "I'll use $startperl to start perl scripts."
7879 : figure best path for perl in scripts
7882 perlpath="$binexp/perl"
7883 case "$startperl" in
7888 I will use the "eval 'exec'" idiom to start Perl on your system.
7889 I can use the full path of your Perl binary for this purpose, but
7890 doing so may cause problems if you want to share those scripts and
7891 Perl is not always in a standard place ($binexp/perl).
7895 rp="What path shall I use in \"eval 'exec'\"?"
7902 case "$startperl" in
7904 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
7907 : determine where public executable scripts go
7908 set scriptdir scriptdir
7910 case "$scriptdir" in
7913 : guess some guesses
7914 $test -d /usr/share/scripts && dflt=/usr/share/scripts
7915 $test -d /usr/share/bin && dflt=/usr/share/bin
7916 $test -d /usr/local/script && dflt=/usr/local/script
7917 $test -d /usr/local/scripts && dflt=/usr/local/scripts
7918 $test -d $prefixexp/script && dflt=$prefixexp/script
7922 *) dflt="$scriptdir"
7927 Some installations have a separate directory just for executable scripts so
7928 that they can mount it across multiple architectures but keep the scripts in
7929 one spot. You might, for example, have a subdirectory of /usr/share for this.
7930 Or you might just lump your scripts in with all your other executables.
7934 rp='Where do you keep publicly executable scripts?'
7936 if $test "X$ansexp" != "X$scriptdirexp"; then
7940 scriptdirexp="$ansexp"
7941 : Change installation prefix, if necessary.
7942 if $test X"$prefix" != X"$installprefix"; then
7943 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
7945 installscript="$scriptdirexp"
7948 : determine where add-on public executables go
7950 '') dflt=$siteprefix/bin ;;
7954 rp='Pathname where the add-on public executables should be installed?'
7957 sitebinexp="$ansexp"
7958 : Change installation prefix, if necessary.
7959 if $test X"$prefix" != X"$installprefix"; then
7960 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
7962 installsitebin="$sitebinexp"
7965 case "$vendorprefix" in
7966 '') d_vendorbin="$undef"
7970 *) d_vendorbin="$define"
7971 : determine where vendor-supplied executables go.
7972 case "$vendorbin" in
7973 '') dflt=$vendorprefix/bin ;;
7974 *) dflt="$vendorbin" ;;
7977 rp='Pathname for the vendor-supplied executables directory?'
7980 vendorbinexp="$ansexp"
7983 : Change installation prefix, if necessary.
7984 if $test X"$prefix" != X"$installprefix"; then
7985 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
7987 installvendorbin="$vendorbinexp"
7990 : see if qgcvt exists
7996 if $test X"$d_longdbl" = X"$define"; then
7998 echo "Checking how to print long doubles..." >&4
8000 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
8001 $cat >try.c <<'EOCP'
8002 #include <sys/types.h>
8006 printf("%.3f\n", d);
8010 if eval $compile; then
8014 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
8015 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
8016 echo "We will use %f."
8022 if $test X"$sPRIfldbl" = X; then
8023 $cat >try.c <<'EOCP'
8024 #include <sys/types.h>
8027 long double d = 123.456;
8028 printf("%.3llf\n", d);
8032 if eval $compile; then
8036 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
8037 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
8038 echo "We will use %llf."
8044 if $test X"$sPRIfldbl" = X; then
8045 $cat >try.c <<'EOCP'
8046 #include <sys/types.h>
8049 long double d = 123.456;
8050 printf("%.3Lf\n", d);
8054 if eval $compile; then
8058 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
8059 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
8060 echo "We will use %Lf."
8066 if $test X"$sPRIfldbl" = X; then
8067 $cat >try.c <<'EOCP'
8068 #include <sys/types.h>
8071 long double d = 123.456;
8072 printf("%.3lf\n", d);
8076 if eval $compile; then
8080 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
8081 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
8082 echo "We will use %lf."
8088 if $test X"$sPRIfldbl" = X; then
8089 echo "Cannot figure out how to print long doubles." >&4
8091 sSCNfldbl=$sPRIfldbl # expect consistency
8098 case "$sPRIfldbl" in
8099 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
8100 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
8101 d_SCNfldbl="$undef";
8103 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
8104 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
8105 d_SCNfldbl="$define";
8109 : Check how to convert floats to strings.
8111 echo "Checking for an efficient way to convert floats to strings."
8113 case "$uselongdouble" in
8114 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
8116 case "$d_longdbl" in
8117 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
8119 case "$d_PRIgldbl" in
8120 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
8124 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
8125 char *myname = "gconvert";
8128 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
8129 char *myname = "gcvt";
8132 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
8133 char *myname = "qgcvt";
8134 #define DOUBLETYPE long double
8137 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE) && defined(HAS_PRIgldbl)
8138 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
8140 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
8142 char *myname = "sprintf";
8146 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
8147 #define DOUBLETYPE long double
8149 #define DOUBLETYPE double
8155 #define I_STDLIB $i_stdlib
8161 checkit(expect, got)
8165 if (strcmp(expect, got)) {
8166 printf("%s oddity: Expected %s, got %s\n",
8167 myname, expect, got);
8177 /* This must be 1st test on (which?) platform */
8178 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
8179 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
8180 checkit("0.1", buf);
8182 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
8185 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
8186 checkit("1.1", buf);
8188 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
8189 checkit("1.01", buf);
8191 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
8192 checkit("1.001", buf);
8194 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
8195 checkit("1.0001", buf);
8197 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
8198 checkit("1.00001", buf);
8200 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
8201 checkit("1.000001", buf);
8203 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
8206 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
8209 /* Some Linux gcvt's give 1.e+5 here. */
8210 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
8211 checkit("100000", buf);
8213 /* Some Linux gcvt's give -1.e+5 here. */
8214 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
8215 checkit("-100000", buf);
8217 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
8218 checkit("123.456", buf);
8223 case "$d_Gconvert" in
8224 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
8225 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
8226 sprintf*) xxx_list='sprintf gconvert gcvt' ;;
8227 *) xxx_list='gconvert gcvt sprintf' ;;
8230 case "$d_longdbl$uselongdouble$d_PRIgldbl" in
8231 "$define$define$define")
8232 # for long doubles prefer first qgcvt, then sprintf
8233 xxx_list="`echo $xxx_list|sed s/sprintf//`"
8234 xxx_list="sprintf $xxx_list"
8236 "$define") xxx_list="qgcvt $xxx_list" ;;
8241 for xxx_convert in $xxx_list; do
8242 echo "Trying $xxx_convert..."
8244 set try -DTRY_$xxx_convert
8245 if eval $compile; then
8246 echo "$xxx_convert() found." >&4
8248 echo "I'll use $xxx_convert to convert floats into a string." >&4
8251 echo "...But $xxx_convert didn't work as I expected."
8254 echo "$xxx_convert NOT found." >&4
8258 case "$xxx_convert" in
8259 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
8260 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
8261 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
8262 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
8263 "$define$define$define")
8264 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
8265 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
8270 : see if _fwalk exists
8274 : Initialize h_fcntl
8277 : Initialize h_sysfile
8280 : access call always available on UNIX
8284 : locate the flags for 'access()'
8288 $cat >access.c <<'EOCP'
8289 #include <sys/types.h>
8294 #include <sys/file.h>
8303 : check sys/file.h first, no particular reason here
8304 if $test `./findhdr sys/file.h` && \
8305 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
8307 echo "<sys/file.h> defines the *_OK access constants." >&4
8308 elif $test `./findhdr fcntl.h` && \
8309 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
8311 echo "<fcntl.h> defines the *_OK access constants." >&4
8312 elif $test `./findhdr unistd.h` && \
8313 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
8314 echo "<unistd.h> defines the *_OK access constants." >&4
8316 echo "I can't find the four *_OK access constants--I'll use mine." >&4
8322 : see if accessx exists
8323 set accessx d_accessx
8326 : see if alarm exists
8330 : see if atolf exists
8334 : see if atoll exists
8338 : Look for GNU-cc style attribute checking
8340 echo "Checking whether your compiler can handle __attribute__ ..." >&4
8341 $cat >attrib.c <<'EOCP'
8343 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
8345 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
8346 if $contains 'warning' attrib.out >/dev/null 2>&1; then
8347 echo "Your C compiler doesn't fully support __attribute__."
8350 echo "Your C compiler supports __attribute__."
8354 echo "Your C compiler doesn't seem to understand __attribute__ at all."
8361 : see if bcmp exists
8365 : see if bcopy exists
8369 : see if this is a unistd.h system
8370 set unistd.h i_unistd
8373 : see if getpgrp exists
8374 set getpgrp d_getpgrp
8377 case "$d_getpgrp" in
8380 echo "Checking to see which flavor of getpgrp is in use..."
8383 #include <sys/types.h>
8385 # include <unistd.h>
8389 if (getuid() == 0) {
8390 printf("(I see you are running Configure as super-user...)\n");
8394 if (getpgrp(1) == 0)
8403 if $cc -o set -DTRY_BSD_PGRP $ccflags $ldflags set.c $libs >/dev/null 2>&1 && ./set; then
8404 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
8406 elif $cc -o set $ccflags $ldflags set.c $libs >/dev/null 2>&1 && ./set; then
8407 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
8410 echo "I can't seem to compile and run the test program."
8412 xxx="a USG one, i.e. you use getpgrp()."
8414 # SVR4 systems can appear rather BSD-ish.
8417 xxx="a BSD one, i.e. you use getpgrp(pid)."
8421 xxx="probably a USG one, i.e. you use getpgrp()."
8426 echo "Assuming your getpgrp is $xxx" >&4
8435 : see if setpgrp exists
8436 set setpgrp d_setpgrp
8439 case "$d_setpgrp" in
8442 echo "Checking to see which flavor of setpgrp is in use..."
8445 #include <sys/types.h>
8447 # include <unistd.h>
8451 if (getuid() == 0) {
8452 printf("(I see you are running Configure as super-user...)\n");
8456 if (-1 == setpgrp(1, 1))
8459 if (setpgrp() != -1)
8465 if $cc -o set -DTRY_BSD_PGRP $ccflags $ldflags set.c $libs >/dev/null 2>&1 && ./set; then
8466 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
8468 elif $cc -o set $ccflags $ldflags set.c $libs >/dev/null 2>&1 && ./set; then
8469 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
8472 echo "(I can't seem to compile and run the test program.)"
8474 xxx="a USG one, i.e. you use setpgrp()."
8476 # SVR4 systems can appear rather BSD-ish.
8479 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
8483 xxx="probably a USG one, i.e. you use setpgrp()."
8488 echo "Assuming your setpgrp is $xxx" >&4
8496 : see if bzero exists
8500 : see if signal is declared as pointer to function returning int or void
8502 xxx=`./findhdr signal.h`
8503 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
8504 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
8505 echo "You have int (*signal())() instead of void." >&4
8507 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
8508 echo "You have void (*signal())()." >&4
8510 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
8511 echo "You have int (*signal())() instead of void." >&4
8513 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
8514 echo "You have void (*signal())()." >&4
8517 case "$d_voidsig" in
8519 echo "I can't determine whether signal handler returns void or int..." >&4
8521 rp="What type does your signal handler return?"
8528 echo "As you already told me, signal handler returns void." >&4
8531 *) echo "As you already told me, signal handler returns int." >&4
8538 case "$d_voidsig" in
8539 "$define") signal_t="void";;
8544 : check for ability to cast large floats to 32-bit ints.
8546 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
8547 if $test "$intsize" -ge 4; then
8554 #include <sys/types.h>
8556 $signal_t blech(s) int s; { exit(3); }
8563 signal(SIGFPE, blech);
8565 /* Don't let compiler optimize the test away. Store the number
8566 in a writable string for gcc to pass to sscanf under HP/UX.
8568 sprintf(str, "2147483647");
8569 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
8573 /* x86 processors will probably give 0x8000 0000, which is a
8574 sign change. We don't want that. We want to mimic SPARC
8575 behavior here, which is to preserve the sign and give
8578 if (i32 != ($xxx) f)
8584 if eval $compile_ok; then
8588 echo "(I can't seem to compile the test program--assuming it can't)"
8596 echo "Nope, it can't."
8603 : check for ability to cast negative floats to unsigned
8605 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
8608 #include <sys/types.h>
8610 $signal_t blech(s) int s; { exit(7); }
8611 $signal_t blech_in_list(s) int s; { exit(4); }
8612 unsigned long dummy_long(p) unsigned long p; { return p; }
8613 unsigned int dummy_int(p) unsigned int p; { return p; }
8614 unsigned short dummy_short(p) unsigned short p; { return p; }
8618 unsigned long along;
8620 unsigned short ashort;
8624 /* Frustrate gcc-2.7.2's optimizer which failed this test with
8625 a direct f = -123. assignment. gcc-2.8.0 reportedly
8626 optimized the whole file away
8628 /* Store the number in a writable string for gcc to pass to
8631 sprintf(str, "-123");
8632 sscanf(str, "%lf", &f); /* f = -123.; */
8634 signal(SIGFPE, blech);
8635 along = (unsigned long)f;
8636 aint = (unsigned int)f;
8637 ashort = (unsigned short)f;
8638 if (along != (unsigned long)-123)
8640 if (aint != (unsigned int)-123)
8642 if (ashort != (unsigned short)-123)
8644 sprintf(str, "1073741824.");
8645 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
8648 along = (unsigned long)f;
8649 if (along != 0x80000000)
8653 along = (unsigned long)f;
8654 if (along != 0x7fffffff)
8658 along = (unsigned long)f;
8659 if (along != 0x80000001)
8663 signal(SIGFPE, blech_in_list);
8664 sprintf(str, "123.");
8665 sscanf(str, "%lf", &f); /* f = 123.; */
8666 along = dummy_long((unsigned long)f);
8667 aint = dummy_int((unsigned int)f);
8668 ashort = dummy_short((unsigned short)f);
8669 if (along != (unsigned long)123)
8671 if (aint != (unsigned int)123)
8673 if (ashort != (unsigned short)123)
8680 if eval $compile_ok; then
8684 echo "(I can't seem to compile the test program--assuming it can't)"
8687 case "$castflags" in
8692 echo "Nope, it can't."
8699 : see if vprintf exists
8701 if set vprintf val -f d_vprintf; eval $csym; $val; then
8702 echo 'vprintf() found.' >&4
8704 $cat >vprintf.c <<'EOF'
8705 #include <varargs.h>
8707 int main() { xxx("foo"); }
8716 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
8720 if eval $compile && ./vprintf; then
8721 echo "Your vsprintf() returns (int)." >&4
8724 echo "Your vsprintf() returns (char*)." >&4
8728 echo 'vprintf() NOT found.' >&4
8738 : see if chown exists
8742 : see if chroot exists
8746 : see if chsize exists
8750 hasstruct='varname=$1; struct=$2; shift; shift;
8751 while $test $# -ge 2; do
8753 $define) echo "#include <$2>";;
8757 echo "int main () { struct $struct foo; }" >> try.c;
8759 if eval $compile; then
8768 : see if sys/types.h has to be included
8769 set sys/types.h i_systypes
8772 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
8773 while $test $# -ge 2; do
8775 $define) echo "#include <$2>";;
8779 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
8781 if eval $compile; then
8792 : see whether socket exists
8794 $echo $n "Hmm... $c" >&4
8795 if set socket val -f d_socket; eval $csym; $val; then
8796 echo "Looks like you have Berkeley networking support." >&4
8798 if set setsockopt val -f; eval $csym; $val; then
8801 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
8805 if $contains socklib libc.list >/dev/null 2>&1; then
8806 echo "Looks like you have Berkeley networking support." >&4
8808 : we will have to assume that it supports the 4.2 BSD interface
8811 echo "You don't have Berkeley networking in libc$_a..." >&4
8812 if test "X$d_socket" = "X$define"; then
8813 echo "...but you seem to believe that you have sockets." >&4
8815 for net in net socket
8817 if test -f /usr/lib/lib$net$_a; then
8818 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
8819 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
8820 if $contains socket libc.list >/dev/null 2>&1; then
8825 echo "...but the Wollongong group seems to have hacked it in." >&4
8826 sockethdr="-I/usr/netinclude"
8829 echo "Found Berkeley sockets interface in lib$net." >& 4
8830 if $contains setsockopt libc.list >/dev/null 2>&1; then
8833 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
8840 if test "X$d_socket" != "X$define"; then
8841 echo "or anywhere else I see." >&4
8849 : see if socketpair exists
8850 set socketpair d_sockpair
8855 echo "Checking the availability of certain socket constants..." >& 4
8856 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
8857 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
8859 #include <sys/types.h>
8860 #include <sys/socket.h>
8866 set try; if eval $compile; then
8869 set d_${enum}; eval $setvar
8873 : see if this is a sys/uio.h system
8874 set sys/uio.h i_sysuio
8879 echo "Checking to see if your system supports struct cmsghdr..." >&4
8880 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
8882 case "$d_cmsghdr_s" in
8883 "$define") echo "Yes, it does." ;;
8884 *) echo "No, it doesn't." ;;
8888 : check for const keyword
8890 echo 'Checking to see if your C compiler knows about "const"...' >&4
8891 $cat >const.c <<'EOCP'
8892 typedef struct spug { int drokk; } spug;
8899 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
8901 echo "Yup, it does."
8904 echo "Nope, it doesn't."
8909 : see if crypt exists
8911 if set crypt val -f d_crypt; eval $csym; $val; then
8912 echo 'crypt() found.' >&4
8916 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
8917 if $test -z "$cryptlib"; then
8918 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
8922 if $test -z "$cryptlib"; then
8923 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
8927 if $test -z "$cryptlib"; then
8928 cryptlib=`./loc libcrypt$_a "" $libpth`
8932 if $test -z "$cryptlib"; then
8933 echo 'crypt() NOT found.' >&4
8942 : get csh whereabouts
8944 'csh') val="$undef" ;;
8949 : Respect a hint or command line value for full_csh.
8951 '') full_csh=$csh ;;
8954 : see if cuserid exists
8955 set cuserid d_cuserid
8958 : see if this is a limits.h system
8959 set limits.h i_limits
8962 : see if this is a float.h system
8966 : See if number of significant digits in a double precision number is known
8968 $cat >dbl_dig.c <<EOM
8978 printf("Contains DBL_DIG");
8981 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
8982 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
8983 echo "DBL_DIG found." >&4
8986 echo "DBL_DIG NOT found." >&4
8993 : see if difftime exists
8994 set difftime d_difftime
8997 : see if this is a dirent system
8999 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
9001 echo "<dirent.h> found." >&4
9004 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
9005 echo "<sys/dir.h> found." >&4
9008 xinc=`./findhdr sys/ndir.h`
9010 echo "<dirent.h> NOT found." >&4
9015 : Look for type of directory structure.
9017 $cppstdin $cppflags $cppminus < "$xinc" > try.c
9019 case "$direntrytype" in
9022 $define) guess1='struct dirent' ;;
9023 *) guess1='struct direct' ;;
9026 *) guess1="$direntrytype"
9031 'struct dirent') guess2='struct direct' ;;
9032 *) guess2='struct dirent' ;;
9035 if $contains "$guess1" try.c >/dev/null 2>&1; then
9036 direntrytype="$guess1"
9037 echo "Your directory entries are $direntrytype." >&4
9038 elif $contains "$guess2" try.c >/dev/null 2>&1; then
9039 direntrytype="$guess2"
9040 echo "Your directory entries seem to be $direntrytype." >&4
9042 echo "I don't recognize your system's directory entries." >&4
9043 rp="What type is used for directory entries on this system?"
9051 : see if the directory entry stores field length
9053 $cppstdin $cppflags $cppminus < "$xinc" > try.c
9054 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
9055 echo "Good, your directory entry keeps length information in d_namlen." >&4
9058 echo "Your directory entry does not know about the d_namlen field." >&4
9065 : see if dlerror exists
9068 set dlerror d_dlerror
9072 : see if dlfcn is available
9080 On a few systems, the dynamically loaded modules that perl generates and uses
9081 will need a different extension than shared libs. The default will probably
9089 rp='What is the extension of dynamically loaded modules'
9098 : Check if dlsym need a leading underscore
9104 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
9105 $cat >dyna.c <<'EOM'
9114 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
9116 #include <sys/types.h>
9130 int mode = RTLD_LAZY ;
9132 handle = dlopen("./dyna.$dlext", mode) ;
9133 if (handle == NULL) {
9138 symbol = dlsym(handle, "fred") ;
9139 if (symbol == NULL) {
9140 /* try putting a leading underscore */
9141 symbol = dlsym(handle, "_fred") ;
9142 if (symbol == NULL) {
9155 : Call the object file tmp-dyna.o in case dlext=o.
9156 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
9157 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
9158 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
9159 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then
9162 1) echo "Test program failed using dlopen." >&4
9163 echo "Perhaps you should not use dynamic loading." >&4;;
9164 2) echo "Test program failed using dlsym." >&4
9165 echo "Perhaps you should not use dynamic loading." >&4;;
9166 3) echo "dlsym needs a leading underscore" >&4
9168 4) echo "dlsym doesn't need a leading underscore." >&4;;
9171 echo "I can't compile and run the test program." >&4
9172 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
9177 $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
9182 hasproto='varname=$1; func=$2; shift; shift;
9183 while $test $# -ge 2; do
9185 $define) echo "#include <$2>";;
9189 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
9190 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
9191 echo "$func() prototype found.";
9194 echo "$func() prototype NOT found.";
9199 $rm -f try.c tryout.c'
9201 : see if prototype for drand48 is available
9203 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
9206 : see if dup2 exists
9210 : see if eaccess exists
9211 set eaccess d_eaccess
9214 : see if endgrent exists
9215 set endgrent d_endgrent
9218 : see if endhostent exists
9219 set endhostent d_endhent
9222 : see if endnetent exists
9223 set endnetent d_endnent
9226 : see if endprotoent exists
9227 set endprotoent d_endpent
9230 : see if endpwent exists
9231 set endpwent d_endpwent
9234 : see if endservent exists
9235 set endservent d_endsent
9238 : Locate the flags for 'open()'
9240 $cat >open3.c <<'EOCP'
9241 #include <sys/types.h>
9246 #include <sys/file.h>
9257 : check sys/file.h first to get FREAD on Sun
9258 if $test `./findhdr sys/file.h` && \
9259 set open3 -DI_SYS_FILE && eval $compile; then
9261 echo "<sys/file.h> defines the O_* constants..." >&4
9263 echo "and you have the 3 argument form of open()." >&4
9266 echo "but not the 3 argument form of open(). Oh, well." >&4
9269 elif $test `./findhdr fcntl.h` && \
9270 set open3 -DI_FCNTL && eval $compile; then
9272 echo "<fcntl.h> defines the O_* constants..." >&4
9274 echo "and you have the 3 argument form of open()." >&4
9277 echo "but not the 3 argument form of open(). Oh, well." >&4
9282 echo "I can't find the O_* constant definitions! You got problems." >&4
9288 : see which of string.h or strings.h is needed
9290 strings=`./findhdr string.h`
9291 if $test "$strings" && $test -r "$strings"; then
9292 echo "Using <string.h> instead of <strings.h>." >&4
9296 strings=`./findhdr strings.h`
9297 if $test "$strings" && $test -r "$strings"; then
9298 echo "Using <strings.h> instead of <string.h>." >&4
9300 echo "No string header found -- You'll surely have problems." >&4
9306 "$undef") strings=`./findhdr strings.h`;;
9307 *) strings=`./findhdr string.h`;;
9310 : check for non-blocking I/O stuff
9311 case "$h_sysfile" in
9312 true) echo "#include <sys/file.h>" > head.c;;
9315 true) echo "#include <fcntl.h>" > head.c;;
9316 *) echo "#include <sys/fcntl.h>" > head.c;;
9321 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
9322 case "$o_nonblock" in
9325 $cat >>try.c <<'EOCP'
9329 printf("O_NONBLOCK\n");
9333 printf("O_NDELAY\n");
9337 printf("FNDELAY\n");
9344 if eval $compile_ok; then
9346 case "$o_nonblock" in
9347 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
9348 *) echo "Seems like we can use $o_nonblock.";;
9351 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
9354 *) echo "Using $hint value $o_nonblock.";;
9356 $rm -f try try.* .out core
9359 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
9365 #include <sys/types.h>
9368 #define MY_O_NONBLOCK $o_nonblock
9369 #ifndef errno /* XXX need better Configure test */
9380 #include <strings.h>
9382 $signal_t blech(x) int x; { exit(3); }
9384 $cat >> try.c <<'EOCP'
9392 pipe(pd); /* Down: child -> parent */
9393 pipe(pu); /* Up: parent -> child */
9396 close(pd[1]); /* Parent reads from pd[0] */
9397 close(pu[0]); /* Parent writes (blocking) to pu[1] */
9399 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
9404 signal(SIGALRM, blech);
9406 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
9408 sprintf(string, "%d\n", ret);
9409 write(2, string, strlen(string));
9412 if (errno == EAGAIN) {
9418 if (errno == EWOULDBLOCK)
9419 printf("EWOULDBLOCK\n");
9422 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
9423 sleep(2); /* Give it time to close our pipe */
9425 ret = read(pd[0], buf, 1); /* Should read EOF */
9427 sprintf(string, "%d\n", ret);
9428 write(3, string, strlen(string));
9432 close(pd[0]); /* We write to pd[1] */
9433 close(pu[1]); /* We read from pu[0] */
9434 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
9435 close(pd[1]); /* Pipe pd is now fully closed! */
9436 exit(0); /* Bye bye, thank you for playing! */
9440 if eval $compile_ok; then
9441 echo "$startsh" >mtry
9442 echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
9444 ./mtry >/dev/null 2>&1
9446 0) eagain=`$cat try.out`;;
9447 1) echo "Could not perform non-blocking setting!";;
9448 2) echo "I did a successful read() for something that was not there!";;
9449 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
9450 4) echo "Could not find F_SETFL!";;
9451 *) echo "Something terribly wrong happened during testing.";;
9453 rd_nodata=`$cat try.ret`
9454 echo "A read() system call with no data present returns $rd_nodata."
9455 case "$rd_nodata" in
9458 echo "(That's peculiar, fixing that to be -1.)"
9464 echo "Forcing errno EAGAIN on read() with no data available."
9468 echo "Your read() sets errno to $eagain when no data is available."
9471 status=`$cat try.err`
9473 0) echo "And it correctly returns 0 to signal EOF.";;
9474 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
9475 *) echo "However, your read() returns '$status' on EOF??";;
9478 if test "$status" = "$rd_nodata"; then
9479 echo "WARNING: you can't distinguish between EOF and no data!"
9483 echo "I can't compile the test program--assuming errno EAGAIN will do."
9490 echo "Using $hint value $eagain."
9491 echo "Your read() returns $rd_nodata when no data is present."
9492 case "$d_eofnblk" in
9493 "$define") echo "And you can see EOF because read() returns 0.";;
9494 "$undef") echo "But you can't see EOF status from read() returned value.";;
9496 echo "(Assuming you can't see EOF status from read anyway.)"
9502 $rm -f try try.* .out core head.c mtry
9504 : see if fchmod exists
9508 : see if fchown exists
9512 : see if this is an fcntl system
9517 : See if fcntl-based locking works.
9518 $cat >try.c <<'EOCP'
9523 #if defined(F_SETLK) && defined(F_SETLKW)
9526 fd = open("try.c", O_RDONLY);
9527 flock.l_type = F_RDLCK;
9528 flock.l_whence = SEEK_SET;
9529 flock.l_start = flock.l_len = 0;
9530 retval = fcntl(fd, F_SETLK, &flock);
9532 (retval < 0 ? exit(2) : exit(0));
9538 echo "Checking if fcntl-based file locking works... "
9542 if eval $compile_ok; then
9544 echo "Yes, it seems to work."
9547 echo "Nope, it didn't work."
9551 echo "I'm unable to compile the test program, so I'll assume not."
9556 echo "Nope, since you don't even have fcntl()."
9559 set d_fcntl_can_lock
9564 : see if sys/select.h has to be included
9565 set sys/select.h i_sysselct
9568 : see if we should include time.h, sys/time.h, or both
9570 if test "X$timeincl" = X; then
9571 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9572 $echo $n "I'm now running the test program...$c"
9573 $cat >try.c <<'EOCP'
9574 #include <sys/types.h>
9579 #ifdef SYSTIMEKERNEL
9582 #include <sys/time.h>
9585 #include <sys/select.h>
9594 struct timezone tzp;
9596 if (foo.tm_sec == foo.tm_sec)
9599 if (bar.tv_sec == bar.tv_sec)
9606 for s_timezone in '-DS_TIMEZONE' ''; do
9608 for s_timeval in '-DS_TIMEVAL' ''; do
9609 for i_systimek in '' '-DSYSTIMEKERNEL'; do
9610 for i_time in '' '-DI_TIME'; do
9611 for i_systime in '-DI_SYSTIME' ''; do
9614 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
9615 if eval $compile; then
9616 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
9620 $echo $n "Succeeded with $flags$c"
9632 *SYSTIMEKERNEL*) i_systimek="$define"
9633 timeincl=`./findhdr sys/time.h`
9634 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
9635 *) i_systimek="$undef";;
9638 *I_TIME*) i_time="$define"
9639 timeincl=`./findhdr time.h`" $timeincl"
9640 echo "We'll include <time.h>." >&4;;
9641 *) i_time="$undef";;
9644 *I_SYSTIME*) i_systime="$define"
9645 timeincl=`./findhdr sys/time.h`" $timeincl"
9646 echo "We'll include <sys/time.h>." >&4;;
9647 *) i_systime="$undef";;
9652 : check for fd_set items
9655 Checking to see how well your C compiler handles fd_set and friends ...
9657 $cat >fd_set.c <<EOCP
9658 #$i_systime I_SYS_TIME
9659 #$i_sysselct I_SYS_SELECT
9660 #$d_socket HAS_SOCKET
9661 #include <sys/types.h>
9663 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
9666 #include <sys/time.h>
9669 #include <sys/select.h>
9678 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
9685 set fd_set -DTRYBITS
9686 if eval $compile; then
9687 d_fds_bits="$define"
9689 echo "Well, your system knows about the normal fd_set typedef..." >&4
9691 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
9692 d_fd_macros="$define"
9695 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
9697 d_fd_macros="$undef"
9701 Hmm, your compiler has some difficulty with fd_set. Checking further...
9704 if eval $compile; then
9707 echo "Well, your system has some sort of fd_set available..." >&4
9709 echo "and you have the normal fd_set macros." >&4
9710 d_fd_macros="$define"
9713 but not the normal fd_set macros! Gross! More work for me...
9715 d_fd_macros="$undef"
9718 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
9721 d_fd_macros="$undef"
9726 : see if fgetpos exists
9727 set fgetpos d_fgetpos
9730 : see if flock exists
9734 : see if fork exists
9738 : see if pathconf exists
9739 set pathconf d_pathconf
9742 : see if fpathconf exists
9743 set fpathconf d_fpathconf
9747 : check for fpos64_t
9749 echo "Checking to see if you have fpos64_t..." >&4
9752 int main() { fpos64_t x = 7; }
9755 if eval $compile; then
9757 echo "You have fpos64_t."
9760 echo "You do not have fpos64_t."
9762 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
9769 : see if frexpl exists
9773 : see if this is a sys/param system
9774 set sys/param.h i_sysparam
9777 : see if this is a sys/mount.h system
9778 set sys/mount.h i_sysmount
9783 echo "Checking to see if your system supports struct fs_data..." >&4
9784 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
9786 case "$d_fs_data_s" in
9787 "$define") echo "Yes, it does." ;;
9788 *) echo "No, it doesn't." ;;
9791 : see if fseeko exists
9795 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
9798 : see if fsetpos exists
9799 set fsetpos d_fsetpos
9803 : see if fstatfs exists
9804 set fstatfs d_fstatfs
9808 : see if statvfs exists
9809 set statvfs d_statvfs
9812 : see if fstatvfs exists
9813 set fstatvfs d_fstatvfs
9817 : see if fsync exists
9821 : see if ftello exists
9825 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
9828 : see if getcwd exists
9832 : see if getespwnam exists
9833 set getespwnam d_getespwnam
9837 : see if getfsstat exists
9838 set getfsstat d_getfsstat
9841 : see if getgrent exists
9842 set getgrent d_getgrent
9845 : see if gethostbyaddr exists
9846 set gethostbyaddr d_gethbyaddr
9849 : see if gethostbyname exists
9850 set gethostbyname d_gethbyname
9853 : see if gethostent exists
9854 set gethostent d_gethent
9857 : see how we will look up host name
9860 if set gethostname val -f d_gethname; eval $csym; $val; then
9861 echo 'gethostname() found.' >&4
9862 d_gethname="$define"
9865 if set uname val -f d_uname; eval $csym; $val; then
9868 uname() was found, but you're running xenix, and older versions of xenix
9869 have a broken uname(). If you don't really know whether your xenix is old
9870 enough to have a broken system call, use the default answer.
9877 rp='Is your uname() broken?'
9880 n*) d_uname="$define"; call=uname;;
9883 echo 'uname() found.' >&4
9890 case "$d_gethname" in
9891 '') d_gethname="$undef";;
9894 '') d_uname="$undef";;
9896 case "$d_uname$d_gethname" in
9901 Every now and then someone has a $call() that lies about the hostname
9902 but can't be fixed for political or economic reasons. If you wish, I can
9903 pretend $call() isn't there and maybe compute hostname at run-time
9904 thanks to the '$phostname' command.
9907 rp="Shall I ignore $call() from now on?"
9910 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
9913 case "$phostname" in
9915 *) case "$aphostname" in
9921 file=`./loc $file $file $pth`
9922 aphostname=`echo $file $*`
9927 case "$d_uname$d_gethname" in
9930 case "$phostname" in
9932 echo "There will be no way for $package to get your hostname." >&4;;
9934 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
9938 case "$d_phostname" in
9939 '') d_phostname="$undef";;
9942 : see if this is a netdb.h system
9946 : see if prototypes for various gethostxxx netdb.h functions are available
9948 set d_gethostprotos gethostent $i_netdb netdb.h
9951 : see if getitimer exists
9952 set getitimer d_getitimer
9955 : see if getlogin exists
9956 set getlogin d_getlogin
9959 : see if getmnt exists
9963 : see if getmntent exists
9964 set getmntent d_getmntent
9967 : see if getnetbyaddr exists
9968 set getnetbyaddr d_getnbyaddr
9971 : see if getnetbyname exists
9972 set getnetbyname d_getnbyname
9975 : see if getnetent exists
9976 set getnetent d_getnent
9979 : see if prototypes for various getnetxxx netdb.h functions are available
9981 set d_getnetprotos getnetent $i_netdb netdb.h
9984 : see if getpagesize exists
9985 set getpagesize d_getpagsz
9989 : see if getprotobyname exists
9990 set getprotobyname d_getpbyname
9993 : see if getprotobynumber exists
9994 set getprotobynumber d_getpbynumber
9997 : see if getprotoent exists
9998 set getprotoent d_getpent
10001 : see if getpgid exists
10002 set getpgid d_getpgid
10005 : see if getpgrp2 exists
10006 set getpgrp2 d_getpgrp2
10009 : see if getppid exists
10010 set getppid d_getppid
10013 : see if getpriority exists
10014 set getpriority d_getprior
10017 : see if prototypes for various getprotoxxx netdb.h functions are available
10019 set d_getprotoprotos getprotoent $i_netdb netdb.h
10022 : see if getprpwnam exists
10023 set getprpwnam d_getprpwnam
10026 : see if getpwent exists
10027 set getpwent d_getpwent
10031 : see if getservbyname exists
10032 set getservbyname d_getsbyname
10035 : see if getservbyport exists
10036 set getservbyport d_getsbyport
10039 : see if getservent exists
10040 set getservent d_getsent
10043 : see if prototypes for various getservxxx netdb.h functions are available
10045 set d_getservprotos getservent $i_netdb netdb.h
10048 : see if getspnam exists
10049 set getspnam d_getspnam
10052 : see if gettimeofday or ftime exists
10053 set gettimeofday d_gettimeod
10055 case "$d_gettimeod" in
10061 val="$undef"; set d_ftime; eval $setvar
10064 case "$d_gettimeod$d_ftime" in
10067 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
10071 : see if this is an grp system
10077 xxx=`./findhdr grp.h`
10078 $cppstdin $cppflags $cppminus < $xxx >$$.h
10080 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
10092 set d_grpasswd; eval $setvar
10096 : see if hasmntopt exists
10097 set hasmntopt d_hasmntopt
10100 : see if this is a netinet/in.h or sys/in.h system
10101 set netinet/in.h i_niin sys/in.h i_sysin
10104 : see if arpa/inet.h has to be included
10105 set arpa/inet.h i_arpainet
10108 : see if htonl --and friends-- exists
10113 : Maybe they are macros.
10116 $cat >htonl.c <<EOM
10118 #include <sys/types.h>
10119 #$i_niin I_NETINET_IN
10121 #$i_arpainet I_ARPA_INET
10122 #ifdef I_NETINET_IN
10123 #include <netinet/in.h>
10126 #include <sys/in.h>
10129 #include <arpa/inet.h>
10132 printf("Defined as a macro.");
10135 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
10136 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
10138 echo "But it seems to be defined as a macro." >&4
10146 : see if iconv exists
10152 if set index val -f; eval $csym; $val; then
10153 if set strchr val -f d_strchr; eval $csym; $val; then
10154 if $contains strchr "$strings" >/dev/null 2>&1 ; then
10157 echo "strchr() found." >&4
10161 echo "index() found." >&4
10166 echo "index() found." >&4
10169 if set strchr val -f d_strchr; eval $csym; $val; then
10172 echo "strchr() found." >&4
10174 echo "No index() or strchr() found!" >&4
10179 set d_strchr; eval $setvar
10181 set d_index; eval $setvar
10183 : check whether inet_aton exists
10184 set inet_aton d_inetaton
10189 $cat >isascii.c <<'EOCP'
10201 if eval $compile; then
10202 echo "isascii() found." >&4
10205 echo "isascii() NOT found." >&4
10212 : see if isnan exists
10216 : see if isnanl exists
10217 set isnanl d_isnanl
10220 : see if killpg exists
10221 set killpg d_killpg
10224 : see if lchown exists
10226 $cat > try.c <<'EOCP'
10227 /* System header to define __stub macros and hopefully few prototypes,
10228 which can conflict with char lchown(); below. */
10229 #include <assert.h>
10230 /* Override any gcc2 internal prototype to avoid an error. */
10231 /* We use char because int might match the return type of a gcc2
10232 builtin and then its argument prototype would still apply. */
10235 /* The GNU C library defines this for functions which it implements
10236 to always fail with ENOSYS. Some functions are actually named
10237 something starting with __ and the normal name is an alias. */
10238 #if defined (__stub_lchown) || defined (__stub___lchown)
10246 if eval $compile; then
10247 $echo "lchown() found." >&4
10250 $echo "lchown() NOT found." >&4
10256 : See if number of significant digits in a double precision number is known
10258 $cat >ldbl_dig.c <<EOM
10259 #$i_limits I_LIMITS
10262 #include <limits.h>
10268 printf("Contains LDBL_DIG");
10271 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
10272 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
10273 echo "LDBL_DIG found." >&4
10276 echo "LDBL_DIG NOT found." >&4
10283 : see if link exists
10287 : see if localeconv exists
10288 set localeconv d_locconv
10291 : see if lockf exists
10295 : see if prototype for lseek is available
10297 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
10300 : see if lstat exists
10304 : see if madvise exists
10305 set madvise d_madvise
10308 : see if mblen exists
10312 : see if mbstowcs exists
10313 set mbstowcs d_mbstowcs
10316 : see if mbtowc exists
10317 set mbtowc d_mbtowc
10320 : see if memchr exists
10321 set memchr d_memchr
10324 : see if memcmp exists
10325 set memcmp d_memcmp
10328 : see if memcpy exists
10329 set memcpy d_memcpy
10332 : see if memmove exists
10333 set memmove d_memmove
10336 : see if memset exists
10337 set memset d_memset
10340 : see if mkdir exists
10344 : see if mkdtemp exists
10345 set mkdtemp d_mkdtemp
10348 : see if mkfifo exists
10349 set mkfifo d_mkfifo
10352 : see if mkstemp exists
10353 set mkstemp d_mkstemp
10356 : see if mkstemps exists
10357 set mkstemps d_mkstemps
10360 : see if mktime exists
10361 set mktime d_mktime
10364 : see if this is a sys/mman.h system
10365 set sys/mman.h i_sysmman
10368 : see if mmap exists
10371 : see what shmat returns
10372 : default to something harmless
10374 case "$i_sysmman$d_mmap" in
10376 $cat >mmap.c <<'END'
10377 #include <sys/mman.h>
10380 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
10385 echo "and it returns ($mmaptype)." >&4
10391 : see if modfl exists
10395 : see if mprotect exists
10396 set mprotect d_mprotect
10399 : see if msgctl exists
10400 set msgctl d_msgctl
10403 : see if msgget exists
10404 set msgget d_msgget
10407 : see if msgsnd exists
10408 set msgsnd d_msgsnd
10411 : see if msgrcv exists
10412 set msgrcv d_msgrcv
10415 : see how much of the 'msg*(2)' library is present.
10418 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
10419 *"$undef"*) h_msg=false;;
10423 case "`ipcs 2>&1`" in
10424 "SVID messages"*"not configured"*)
10425 echo "Your $osname does not have the msg*(2) configured." >&4
10428 set msgctl d_msgctl
10430 set msgget d_msgget
10432 set msgsnd d_msgsnd
10434 set msgrcv d_msgrcv
10440 : we could also check for sys/ipc.h ...
10441 if $h_msg && $test `./findhdr sys/msg.h`; then
10442 echo "You have the full msg*(2) library." >&4
10445 echo "You don't have the full msg*(2) library." >&4
10453 echo "Checking to see if your system supports struct msghdr..." >&4
10454 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
10456 case "$d_msghdr_s" in
10457 "$define") echo "Yes, it does." ;;
10458 *) echo "No, it doesn't." ;;
10462 : see if msync exists
10466 : see if munmap exists
10467 set munmap d_munmap
10470 : see if nice exists
10474 : check for length of character
10476 case "$charsize" in
10478 echo "Checking to see how big your characters are (hey, you never know)..." >&4
10479 $cat >try.c <<'EOCP'
10483 printf("%d\n", (int)sizeof(char));
10488 if eval $compile_ok; then
10492 echo "(I can't seem to compile the test program. Guessing...)"
10499 rp="What is the size of a character (in bytes)?"
10504 : check for volatile keyword
10506 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
10507 $cat >try.c <<'EOCP'
10510 typedef struct _goo_struct goo_struct;
10511 goo_struct * volatile goo = ((goo_struct *)0);
10512 struct _goo_struct {
10517 typedef unsigned short foo_t;
10518 char *volatile foo;
10520 volatile foo_t blech;
10524 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
10526 echo "Yup, it does."
10529 echo "Nope, it doesn't."
10537 $echo "Choosing the C types to be used for Perl's internal types..." >&4
10539 case "$use64bitint:$d_quad:$quadtype" in
10542 uvtype="$uquadtype"
10547 uvtype="unsigned long"
10553 case "$uselongdouble:$d_longdbl" in
10555 nvtype="long double"
10556 nvsize=$longdblsize
10563 $echo "(IV will be "$ivtype", $ivsize bytes)"
10564 $echo "(UV will be "$uvtype", $uvsize bytes)"
10565 $echo "(NV will be "$nvtype", $nvsize bytes)"
10568 #$i_inttypes I_INTTYPES
10570 #include <inttypes.h>
10575 int8_t i = INT8_MAX;
10576 uint8_t u = UINT8_MAX;
10577 printf("int8_t\n");
10580 int16_t i = INT16_MAX;
10581 uint16_t i = UINT16_MAX;
10582 printf("int16_t\n");
10585 int32_t i = INT32_MAX;
10586 uint32_t u = UINT32_MAX;
10587 printf("int32_t\n");
10593 '') case "$charsize" in
10595 u8type="unsigned char"
10604 if eval $compile; then
10605 case "`./try$exe_ext`" in
10606 int8_t) i8type=int8_t
10616 '') if $test $charsize -ge 1; then
10618 u8type="unsigned char"
10626 '') case "$shortsize" in
10628 u16type="unsigned short"
10636 '') set try -DINT16
10637 if eval $compile; then
10638 case "`./try$exe_ext`" in
10650 '') if $test $shortsize -ge 2; then
10652 u16type="unsigned short"
10660 '') case "$longsize" in
10662 u32type="unsigned long"
10666 *) case "$intsize" in
10668 u32type="unsigned int"
10678 '') set try -DINT32
10679 if eval $compile; then
10680 case "`./try$exe_ext`" in
10692 '') if $test $intsize -ge 4; then
10694 u32type="unsigned int"
10702 '') case "$d_quad:$quadtype" in
10704 i64type="$quadtype"
10705 u64type="$uquadtype"
10713 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
10714 : volatile so that the compiler has to store it out to memory.
10715 if test X"$d_volatile" = X"$define"; then
10720 #include <sys/types.h>
10721 #include <signal.h>
10723 $volatile int bletched = 0;
10724 $signal_t blech(s) int s; { bletched = 1; }
10729 int n = 8 * $uvsize;
10732 signal(SIGFPE, blech);
10735 for (i = 0; i < n; i++) {
10736 u = u << 1 | ($uvtype)1;
10738 if (($uvtype)d != u)
10742 d = ($nvtype)(u - 1);
10743 if (($uvtype)d != (u - 1))
10751 printf("%d\n", ((i == n) ? -n : i));
10757 d_nv_preserves_uv="$undef"
10758 if eval $compile; then
10759 d_nv_preserves_uv_bits="`./try$exe_ext`"
10761 case "$d_nv_preserves_uv_bits" in
10763 d_nv_preserves_uv_bits=`expr 0 - $d_nv_preserves_uv_bits`
10764 $echo "Your NVs can preserve all $d_nv_preserves_uv_bits bits of your UVs." 2>&1
10765 d_nv_preserves_uv="$define"
10767 [1-9]*) $echo "Your NVs can preserve only $d_nv_preserves_uv_bits bits of your UVs." 2>&1
10768 d_nv_preserves_uv="$undef" ;;
10769 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
10770 d_nv_preserves_uv_bits="$undef" ;;
10776 : check for off64_t
10778 echo "Checking to see if you have off64_t..." >&4
10780 #include <sys/types.h>
10781 #include <unistd.h>
10782 int main() { off64_t x = 7; }
10785 if eval $compile; then
10787 echo "You have off64_t."
10790 echo "You do not have off64_t."
10791 case "$lseeksize" in
10792 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
10799 : see if POSIX threads are available
10800 set pthread.h i_pthread
10806 : how to create joinable pthreads
10807 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
10809 echo "Checking what constant to use for creating joinable pthreads..." >&4
10810 $cat >try.c <<'EOCP'
10811 #include <pthread.h>
10813 int detachstate = JOINABLE;
10816 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
10817 if eval $compile; then
10818 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
10819 val="$undef" # Yes, undef.
10820 set d_old_pthread_create_joinable
10823 set old_pthread_create_joinable
10826 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
10827 if eval $compile; then
10828 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
10830 set d_old_pthread_create_joinable
10832 val=PTHREAD_CREATE_UNDETACHED
10833 set old_pthread_create_joinable
10836 set try -DJOINABLE=__UNDETACHED
10837 if eval $compile; then
10838 echo "You seem to use __UNDETACHED." >&4
10840 set d_old_pthread_create_joinable
10843 set old_pthread_create_joinable
10846 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
10848 set d_old_pthread_create_joinable
10851 set old_pthread_create_joinable
10858 d_old_pthread_create_joinable="$undef"
10859 old_pthread_create_joinable=""
10862 : see if pause exists
10866 : see if pipe exists
10870 : see if poll exists
10875 : see whether the various POSIXish _yields exist
10877 #include <pthread.h>
10883 #ifdef PTHREAD_YIELD
10886 #ifdef PTHREAD_YIELD_NULL
10887 pthread_yield(NULL);
10893 : see if sched_yield exists
10894 set try -DSCHED_YIELD
10895 if eval $compile; then
10897 sched_yield='sched_yield()'
10901 case "$usethreads" in
10904 $define) echo 'sched_yield() found.' >&4 ;;
10905 *) echo 'sched_yield() NOT found.' >&4 ;;
10911 : see if pthread_yield exists
10912 set try -DPTHREAD_YIELD
10913 if eval $compile; then
10915 case "$sched_yield" in
10916 '') sched_yield='pthread_yield()' ;;
10919 set try -DPTHREAD_YIELD_NULL
10920 if eval $compile; then
10922 case "$sched_yield" in
10923 '') sched_yield='pthread_yield(NULL)' ;;
10929 case "$usethreads" in
10932 $define) echo 'pthread_yield() found.' >&4 ;;
10933 *) echo 'pthread_yield() NOT found.' >&4 ;;
10937 set d_pthread_yield
10940 case "$sched_yield" in
10941 '') sched_yield=undef ;;
10946 : see if this is a pwd.h system
10952 xxx=`./findhdr pwd.h`
10953 $cppstdin $cppflags $cppminus < $xxx >$$.h
10955 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
10963 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
10971 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
10979 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
10987 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
10995 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
11003 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
11011 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
11023 set d_pwquota; eval $setvar
11024 set d_pwage; eval $setvar
11025 set d_pwchange; eval $setvar
11026 set d_pwclass; eval $setvar
11027 set d_pwexpire; eval $setvar
11028 set d_pwcomment; eval $setvar
11029 set d_pwgecos; eval $setvar
11030 set d_pwpasswd; eval $setvar
11034 : see if readdir and friends exist
11035 set readdir d_readdir
11037 set seekdir d_seekdir
11039 set telldir d_telldir
11041 set rewinddir d_rewinddir
11044 : see if readlink exists
11045 set readlink d_readlink
11048 : see if readv exists
11052 : see if recvmsg exists
11053 set recvmsg d_recvmsg
11056 : see if rename exists
11057 set rename d_rename
11060 : see if rmdir exists
11064 : see if memory.h is available.
11069 : See if it conflicts with string.h
11075 $cppstdin $cppflags $cppminus < $strings > mem.h
11076 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
11078 echo "We won't be including <memory.h>."
11088 : can bcopy handle overlapping blocks?
11093 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
11095 #$i_memory I_MEMORY
11096 #$i_stdlib I_STDLIB
11097 #$i_string I_STRING
11098 #$i_unistd I_UNISTD
11100 $cat >>try.c <<'EOCP'
11103 # include <memory.h>
11106 # include <stdlib.h>
11109 # include <string.h>
11111 # include <strings.h>
11114 # include <unistd.h> /* Needed for NetBSD */
11118 char buf[128], abc[128];
11124 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
11126 for (align = 7; align >= 0; align--) {
11127 for (len = 36; len; len--) {
11129 bcopy(abc, b, len);
11130 for (off = 1; off <= len; off++) {
11131 bcopy(b, b+off, len);
11132 bcopy(b+off, b, len);
11133 if (bcmp(b, abc, len))
11142 if eval $compile_ok; then
11143 if ./try 2>/dev/null; then
11144 echo "Yes, it can."
11147 echo "It can't, sorry."
11148 case "$d_memmove" in
11149 "$define") echo "But that's Ok since you have memmove()." ;;
11153 echo "(I can't compile the test program, so we'll assume not...)"
11154 case "$d_memmove" in
11155 "$define") echo "But that's Ok since you have memmove()." ;;
11160 $rm -f try.* try core
11164 : can memcpy handle overlapping blocks?
11166 case "$d_memcpy" in
11169 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
11171 #$i_memory I_MEMORY
11172 #$i_stdlib I_STDLIB
11173 #$i_string I_STRING
11174 #$i_unistd I_UNISTD
11176 $cat >>try.c <<'EOCP'
11179 # include <memory.h>
11182 # include <stdlib.h>
11185 # include <string.h>
11187 # include <strings.h>
11190 # include <unistd.h> /* Needed for NetBSD */
11194 char buf[128], abc[128];
11200 /* Copy "abcde..." string to char abc[] so that gcc doesn't
11201 try to store the string in read-only memory. */
11202 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
11204 for (align = 7; align >= 0; align--) {
11205 for (len = 36; len; len--) {
11207 memcpy(b, abc, len);
11208 for (off = 1; off <= len; off++) {
11209 memcpy(b+off, b, len);
11210 memcpy(b, b+off, len);
11211 if (memcmp(b, abc, len))
11220 if eval $compile_ok; then
11221 if ./try 2>/dev/null; then
11222 echo "Yes, it can."
11225 echo "It can't, sorry."
11226 case "$d_memmove" in
11227 "$define") echo "But that's Ok since you have memmove()." ;;
11231 echo "(I can't compile the test program, so we'll assume not...)"
11232 case "$d_memmove" in
11233 "$define") echo "But that's Ok since you have memmove()." ;;
11238 $rm -f try.* try core
11242 : can memcmp be trusted to compare relative magnitude?
11244 case "$d_memcmp" in
11247 echo "Checking if your memcmp() can compare relative magnitude..." >&4
11249 #$i_memory I_MEMORY
11250 #$i_stdlib I_STDLIB
11251 #$i_string I_STRING
11252 #$i_unistd I_UNISTD
11254 $cat >>try.c <<'EOCP'
11257 # include <memory.h>
11260 # include <stdlib.h>
11263 # include <string.h>
11265 # include <strings.h>
11268 # include <unistd.h> /* Needed for NetBSD */
11274 if ((a < b) && memcmp(&a, &b, 1) < 0)
11280 if eval $compile_ok; then
11281 if ./try 2>/dev/null; then
11282 echo "Yes, it can."
11285 echo "No, it can't (it uses signed chars)."
11288 echo "(I can't compile the test program, so we'll assume not...)"
11292 $rm -f try.* try core
11296 : see if prototype for sbrk is available
11298 set d_sbrkproto sbrk $i_unistd unistd.h
11301 : see if select exists
11302 set select d_select
11305 : see if semctl exists
11306 set semctl d_semctl
11309 : see if semget exists
11310 set semget d_semget
11313 : see if semop exists
11317 : see how much of the 'sem*(2)' library is present.
11320 case "$d_semctl$d_semget$d_semop" in
11321 *"$undef"*) h_sem=false;;
11325 case "`ipcs 2>&1`" in
11326 "SVID messages"*"not configured"*)
11327 echo "Your $osname does not have the sem*(2) configured." >&4
11330 set semctl d_semctl
11332 set semget d_semget
11340 : we could also check for sys/ipc.h ...
11341 if $h_sem && $test `./findhdr sys/sem.h`; then
11342 echo "You have the full sem*(2) library." >&4
11345 echo "You don't have the full sem*(2) library." >&4
11351 : see whether sys/sem.h defines union semun
11353 $cat > try.c <<'END'
11354 #include <sys/types.h>
11355 #include <sys/ipc.h>
11356 #include <sys/sem.h>
11357 int main () { union semun semun; semun.buf = 0; }
11360 if eval $compile; then
11361 echo "You have union semun in <sys/sem.h>." >&4
11364 echo "You do not have union semun in <sys/sem.h>." >&4
11367 $rm -f try try.c try.h
11371 : see how to do semctl IPC_STAT
11374 : see whether semctl IPC_STAT can use union semun
11379 # define S_IRUSR S_IREAD
11380 # define S_IWUSR S_IWRITE
11381 # define S_IXUSR S_IEXEC
11383 # define S_IRUSR 0400
11384 # define S_IWUSR 0200
11385 # define S_IXUSR 0100
11387 # define S_IRGRP (S_IRUSR>>3)
11388 # define S_IWGRP (S_IWUSR>>3)
11389 # define S_IXGRP (S_IXUSR>>3)
11390 # define S_IROTH (S_IRUSR>>6)
11391 # define S_IWOTH (S_IWUSR>>6)
11392 # define S_IXOTH (S_IXUSR>>6)
11395 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
11396 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
11397 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
11402 #include <sys/types.h>
11403 #include <sys/ipc.h>
11404 #include <sys/sem.h>
11405 #include <sys/stat.h>
11412 #$d_union_semun HAS_UNION_SEMUN
11415 #ifndef HAS_UNION_SEMUN
11418 struct semid_ds *buf;
11419 unsigned short *array;
11425 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
11426 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
11428 struct semid_ds argbuf;
11431 st = semctl(sem, 0, IPC_STAT, arg);
11435 # endif /* IPC_STAT */
11436 printf("semctl IPC_STAT failed: errno = %d\n", errno);
11438 if (semctl(sem, 0, IPC_RMID, arg) != 0)
11439 # endif /* IPC_RMID */
11440 printf("semctl IPC_RMID failed: errno = %d\n", errno);
11442 #endif /* IPC_PRIVATE && ... */
11443 printf("semget failed: errno = %d\n", errno);
11449 if eval $compile; then
11452 semun) val="$define" ;;
11458 case "$d_semctl_semun" in
11460 echo "You can use union semun for semctl IPC_STAT." >&4
11463 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
11468 : see whether semctl IPC_STAT can use struct semid_ds pointer
11469 $cat > try.c <<'END'
11470 #include <sys/types.h>
11471 #include <sys/ipc.h>
11472 #include <sys/sem.h>
11473 #include <sys/stat.h>
11481 struct semid_ds arg;
11484 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
11485 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
11488 st = semctl(sem, 0, IPC_STAT, &arg);
11490 printf("semid_ds\n");
11492 # endif /* IPC_STAT */
11493 printf("semctl IPC_STAT failed: errno = %d\n", errno);
11495 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
11496 # endif /* IPC_RMID */
11497 printf("semctl IPC_RMID failed: errno = %d\n", errno);
11499 #endif /* IPC_PRIVATE && ... */
11500 printf("semget failed: errno = %d\n", errno);
11507 if eval $compile; then
11510 semid_ds) val="$define" ;;
11514 set d_semctl_semid_ds
11516 case "$d_semctl_semid_ds" in
11518 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
11520 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
11527 # We do not have the full sem*(2) library, so assume we can not
11533 set d_semctl_semid_ds
11538 : see if sendmsg exists
11539 set sendmsg d_sendmsg
11542 : see if setegid exists
11543 set setegid d_setegid
11546 : see if seteuid exists
11547 set seteuid d_seteuid
11550 : see if setgrent exists
11551 set setgrent d_setgrent
11554 : see if sethostent exists
11555 set sethostent d_sethent
11558 : see if setitimer exists
11559 set setitimer d_setitimer
11562 : see if setlinebuf exists
11563 set setlinebuf d_setlinebuf
11566 : see if setlocale exists
11567 set setlocale d_setlocale
11570 : see if setnetent exists
11571 set setnetent d_setnent
11574 : see if setprotoent exists
11575 set setprotoent d_setpent
11578 : see if setpgid exists
11579 set setpgid d_setpgid
11582 : see if setpgrp2 exists
11583 set setpgrp2 d_setpgrp2
11586 : see if setpriority exists
11587 set setpriority d_setprior
11590 : see if setproctitle exists
11591 set setproctitle d_setproctitle
11594 : see if setpwent exists
11595 set setpwent d_setpwent
11598 : see if setregid exists
11599 set setregid d_setregid
11601 set setresgid d_setresgid
11604 : see if setreuid exists
11605 set setreuid d_setreuid
11607 set setresuid d_setresuid
11610 : see if setrgid exists
11611 set setrgid d_setrgid
11614 : see if setruid exists
11615 set setruid d_setruid
11618 : see if setservent exists
11619 set setservent d_setsent
11622 : see if setsid exists
11623 set setsid d_setsid
11626 : see if setvbuf exists
11627 set setvbuf d_setvbuf
11630 : see if sfio.h is available
11635 : see if sfio library is available
11646 : Ok, but do we want to use it.
11650 true|$define|[yY]*) dflt='y';;
11653 echo "$package can use the sfio library, but it is experimental."
11654 case "$useperlio" in
11656 echo "For sfio also the PerlIO abstraction layer is needed."
11657 echo "Earlier you said you wouldn't want that."
11660 rp="You seem to have sfio available, do you want to try using it?"
11663 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
11664 useperlio="$define"
11667 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
11672 *) case "$usesfio" in
11673 true|$define|[yY]*)
11674 echo "Sorry, cannot find sfio on this machine." >&4
11675 echo "Ignoring your setting of usesfio=$usesfio." >&4
11684 $define) usesfio='true';;
11685 *) usesfio='false';;
11689 *) : Remove sfio from list of libraries to use
11690 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
11693 echo "libs = $libs" >&4
11698 : see if shmctl exists
11699 set shmctl d_shmctl
11702 : see if shmget exists
11703 set shmget d_shmget
11706 : see if shmat exists
11709 : see what shmat returns
11712 $cat >shmat.c <<'END'
11713 #include <sys/shm.h>
11716 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
11721 echo "and it returns ($shmattype)." >&4
11722 : see if a prototype for shmat is available
11723 xxx=`./findhdr sys/shm.h`
11724 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
11725 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
11736 set d_shmatprototype
11739 : see if shmdt exists
11743 : see how much of the 'shm*(2)' library is present.
11746 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
11747 *"$undef"*) h_shm=false;;
11751 case "`ipcs 2>&1`" in
11752 "SVID shared memory"*"not configured"*)
11753 echo "Your $osname does not have the shm*(2) configured." >&4
11756 set shmctl d_shmctl
11758 set shmget d_shmget
11768 : we could also check for sys/ipc.h ...
11769 if $h_shm && $test `./findhdr sys/shm.h`; then
11770 echo "You have the full shm*(2) library." >&4
11773 echo "You don't have the full shm*(2) library." >&4
11780 : see if we have sigaction
11781 if set sigaction val -f d_sigaction; eval $csym; $val; then
11782 echo 'sigaction() found.' >&4
11783 $cat > try.c <<'EOP'
11785 #include <sys/types.h>
11786 #include <signal.h>
11789 struct sigaction act, oact;
11791 oact.sa_handler = 0;
11792 /* so that act and oact are used */
11793 exit(act.sa_flags == 0 && oact.sa_handler == 0);
11797 if eval $compile_ok; then
11800 echo "But you don't seem to have a useable struct sigaction." >&4
11804 echo 'sigaction NOT found.' >&4
11807 set d_sigaction; eval $setvar
11808 $rm -f try try$_o try.c
11810 : see if sigprocmask exists
11811 set sigprocmask d_sigprocmask
11814 : see if sigsetjmp exists
11816 case "$d_sigsetjmp" in
11818 $cat >try.c <<'EOP'
11819 #include <setjmp.h>
11824 if (sigsetjmp(env,1))
11827 siglongjmp(env, 1);
11832 if eval $compile; then
11833 if ./try >/dev/null 2>&1; then
11834 echo "POSIX sigsetjmp found." >&4
11838 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
11844 echo "sigsetjmp not found." >&4
11848 *) val="$d_sigsetjmp"
11849 case "$d_sigsetjmp" in
11850 $define) echo "POSIX sigsetjmp found." >&4;;
11851 $undef) echo "sigsetjmp not found." >&4;;
11859 : see if sockatmark exists
11860 set sockatmark d_sockatmark
11863 : see if socks5_init exists
11864 set socks5_init d_socks5_init
11867 : see if sys/stat.h is available
11868 set sys/stat.h i_sysstat
11872 : see if stat knows about block sizes
11874 echo "Checking to see if your struct stat has st_blocks field..." >&4
11875 set d_statblks stat st_blocks $i_sysstat sys/stat.h
11879 : see if this is a sys/vfs.h system
11880 set sys/vfs.h i_sysvfs
11884 : see if this is a sys/statfs.h system
11885 set sys/statfs.h i_sysstatfs
11890 echo "Checking to see if your system supports struct statfs..." >&4
11891 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
11893 case "$d_statfs_s" in
11894 "$define") echo "Yes, it does." ;;
11895 *) echo "No, it doesn't." ;;
11900 : see if struct statfs knows about f_flags
11901 case "$d_statfs_s" in
11904 echo "Checking to see if your struct statfs has f_flags field..." >&4
11905 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
11909 set d_statfs_f_flags
11913 case "$d_statfs_f_flags" in
11914 "$define") echo "Yes, it does." ;;
11915 *) echo "No, it doesn't." ;;
11918 : see if _ptr and _cnt from stdio act std
11921 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
11922 echo "(Looks like you have stdio.h from BSD.)"
11923 case "$stdio_ptr" in
11924 '') stdio_ptr='((fp)->_p)'
11927 *) ptr_lval=$d_stdio_ptr_lval;;
11929 case "$stdio_cnt" in
11930 '') stdio_cnt='((fp)->_r)'
11933 *) cnt_lval=$d_stdio_cnt_lval;;
11935 case "$stdio_base" in
11936 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
11938 case "$stdio_bufsiz" in
11939 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
11941 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
11942 echo "(Looks like you have stdio.h from Linux.)"
11943 case "$stdio_ptr" in
11944 '') stdio_ptr='((fp)->_IO_read_ptr)'
11947 *) ptr_lval=$d_stdio_ptr_lval;;
11949 case "$stdio_cnt" in
11950 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
11953 *) cnt_lval=$d_stdio_cnt_lval;;
11955 case "$stdio_base" in
11956 '') stdio_base='((fp)->_IO_read_base)';;
11958 case "$stdio_bufsiz" in
11959 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
11962 case "$stdio_ptr" in
11963 '') stdio_ptr='((fp)->_ptr)'
11966 *) ptr_lval=$d_stdio_ptr_lval;;
11968 case "$stdio_cnt" in
11969 '') stdio_cnt='((fp)->_cnt)'
11972 *) cnt_lval=$d_stdio_cnt_lval;;
11974 case "$stdio_base" in
11975 '') stdio_base='((fp)->_base)';;
11977 case "$stdio_bufsiz" in
11978 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
11982 : test whether _ptr and _cnt really work
11983 echo "Checking how std your stdio is..." >&4
11986 #define FILE_ptr(fp) $stdio_ptr
11987 #define FILE_cnt(fp) $stdio_cnt
11989 FILE *fp = fopen("try.c", "r");
11992 18 <= FILE_cnt(fp) &&
11993 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12001 if eval $compile; then
12003 echo "Your stdio acts pretty std."
12006 echo "Your stdio isn't very std."
12009 echo "Your stdio doesn't appear very std."
12015 : Can _ptr be used as an lvalue?
12016 case "$d_stdstdio$ptr_lval" in
12017 $define$define) val=$define ;;
12020 set d_stdio_ptr_lval
12023 : Can _cnt be used as an lvalue?
12024 case "$d_stdstdio$cnt_lval" in
12025 $define$define) val=$define ;;
12028 set d_stdio_cnt_lval
12032 : test whether setting _ptr sets _cnt as a side effect
12033 d_stdio_ptr_lval_sets_cnt="$undef"
12034 d_stdio_ptr_lval_nochange_cnt="$undef"
12035 case "$d_stdio_ptr_lval$d_stdstdio" in
12037 echo "Checking to see what happens if we set the stdio ptr..." >&4
12040 /* Can we scream? */
12041 /* Eat dust sed :-) */
12042 /* In the buffer space, no one can hear you scream. */
12043 #define FILE_ptr(fp) $stdio_ptr
12044 #define FILE_cnt(fp) $stdio_cnt
12045 #include <sys/types.h>
12047 FILE *fp = fopen("try.c", "r");
12052 puts("Fail even to read");
12055 c = getc(fp); /* Read away the first # */
12057 puts("Fail even to read");
12061 18 <= FILE_cnt(fp) &&
12062 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12064 puts("Fail even to read");
12067 ptr = (char*) FILE_ptr(fp);
12068 cnt = (size_t)FILE_cnt(fp);
12070 FILE_ptr(fp) += 42;
12072 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12073 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12076 if (FILE_cnt(fp) <= 20) {
12077 printf ("Fail (<20 chars to test)");
12080 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12081 puts("Fail compare");
12084 if (cnt == FILE_cnt(fp)) {
12085 puts("Pass_unchanged");
12088 if (FILE_cnt(fp) == (cnt - 42)) {
12089 puts("Pass_changed");
12092 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12098 if eval $compile; then
12099 case `./try$exe_ext` in
12101 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12102 d_stdio_ptr_lval_sets_cnt="$define" ;;
12104 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12105 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12107 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12109 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12112 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12118 : see if _base is also standard
12120 case "$d_stdstdio" in
12124 #define FILE_base(fp) $stdio_base
12125 #define FILE_bufsiz(fp) $stdio_bufsiz
12127 FILE *fp = fopen("try.c", "r");
12130 19 <= FILE_bufsiz(fp) &&
12131 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
12138 if eval $compile; then
12140 echo "And its _base field acts std."
12143 echo "But its _base field isn't std."
12146 echo "However, it seems to be lacking the _base field."
12155 Checking how to access stdio streams by file descriptor number...
12157 case "$stdio_stream_array" in
12158 '') $cat >try.c <<EOCP
12161 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
12165 for s in _iob __iob __sF
12167 set try -DSTDIO_STREAM_ARRAY=$s
12168 if eval $compile; then
12169 case "`./try$exe_ext`" in
12170 yes) stdio_stream_array=$s; break ;;
12174 $rm -f try.* try$exe_ext
12176 case "$stdio_stream_array" in
12178 I can't figure out how to access stdio streams by file descriptor number.
12180 d_stdio_stream_array="$undef"
12183 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
12185 d_stdio_stream_array="$define"
12189 : see if strcoll exists
12190 set strcoll d_strcoll
12193 : check for structure copying
12195 echo "Checking to see if your C compiler can copy structs..." >&4
12196 $cat >try.c <<'EOCP'
12206 if $cc -c try.c >/dev/null 2>&1 ; then
12208 echo "Yup, it can."
12211 echo "Nope, it can't."
12217 : see if strerror and/or sys_errlist[] exist
12219 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
12220 if set strerror val -f d_strerror; eval $csym; $val; then
12221 echo 'strerror() found.' >&4
12222 d_strerror="$define"
12223 d_strerrm='strerror(e)'
12224 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
12225 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
12226 d_syserrlst="$define"
12228 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
12229 d_syserrlst="$undef"
12231 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
12232 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
12233 echo 'strerror() found in string header.' >&4
12234 d_strerror="$define"
12235 d_strerrm='strerror(e)'
12236 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
12237 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
12238 d_syserrlst="$define"
12240 echo "(You don't appear to have any sys_errlist[], how can this be?)"
12241 d_syserrlst="$undef"
12243 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
12244 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
12245 d_strerror="$undef"
12246 d_syserrlst="$define"
12247 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
12249 echo 'strerror() and sys_errlist[] NOT found.' >&4
12250 d_strerror="$undef"
12251 d_syserrlst="$undef"
12252 d_strerrm='"unknown"'
12256 : see if strftime exists
12257 set strftime d_strftime
12260 : see if strtod exists
12261 set strtod d_strtod
12264 : see if strtol exists
12265 set strtol d_strtol
12268 : see if strtold exists
12269 set strtold d_strtold
12272 : see if strtoll exists
12273 set strtoll d_strtoll
12276 case "$d_longlong-$d_strtoll" in
12279 Checking whether your strtoll() works okay...
12281 $cat >try.c <<'EOCP'
12284 #define strtoll __strtoll
12287 #define strtoll _strtoll
12290 extern long long int strtoll(char *s, char **, int);
12291 static int bad = 0;
12292 int check(char *s, long long ell, int een) {
12295 gll = strtoll(s, 0, 10);
12296 if (!((gll == ell) && (errno == een)))
12300 check(" 1", 1LL, 0);
12301 check(" 0", 0LL, 0);
12302 check("-1", -1LL, 0);
12303 check("-9223372036854775808", -9223372036854775808LL, 0);
12304 check("-9223372036854775808", -9223372036854775808LL, 0);
12305 check(" 9223372036854775807", 9223372036854775807LL, 0);
12306 check("-9223372036854775808", -9223372036854775808LL, 0);
12307 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
12308 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
12314 if eval $compile; then
12317 ok) echo "Your strtoll() seems to be working okay." ;;
12319 Your strtoll() doesn't seem to be working okay.
12325 echo "(I can't seem to compile the test program--assuming it doesn't)"
12331 : see if strtoq exists
12332 set strtoq d_strtoq
12335 : see if strtoul exists
12336 set strtoul d_strtoul
12339 case "$d_strtoul" in
12342 Checking whether your strtoul() works okay...
12344 $cat >try.c <<'EOCP'
12347 extern unsigned long int strtoul(char *s, char **, int);
12348 static int bad = 0;
12349 void check(char *s, unsigned long eul, int een) {
12352 gul = strtoul(s, 0, 10);
12353 if (!((gul == eul) && (errno == een)))
12357 check(" 1", 1L, 0);
12358 check(" 0", 0L, 0);
12360 case "$longsize" in
12362 $cat >>try.c <<'EOCP'
12363 check("18446744073709551615", 18446744073709551615UL, 0);
12364 check("18446744073709551616", 18446744073709551615UL, ERANGE);
12365 #if 0 /* strtoul() for /^-/ strings is undefined. */
12366 check("-1", 18446744073709551615UL, 0);
12367 check("-18446744073709551614", 2, 0);
12368 check("-18446744073709551615", 1, 0);
12369 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
12370 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
12375 $cat >>try.c <<'EOCP'
12376 check("4294967295", 4294967295UL, 0);
12377 check("4294967296", 4294967295UL, ERANGE);
12378 #if 0 /* strtoul() for /^-/ strings is undefined. */
12379 check("-1", 4294967295UL, 0);
12380 check("-4294967294", 2, 0);
12381 check("-4294967295", 1, 0);
12382 check("-4294967296", 4294967295UL, ERANGE);
12383 check("-4294967297", 4294967295UL, ERANGE);
12388 : Should we write these tests to be more portable by sprintf-ing
12389 : ~0 and then manipulating that char string as input for strtol?
12392 $cat >>try.c <<'EOCP'
12399 if eval $compile; then
12401 ok) echo "Your strtoul() seems to be working okay." ;;
12403 Your strtoul() doesn't seem to be working okay.
12412 : see if strtoull exists
12413 set strtoull d_strtoull
12416 case "$d_longlong-$d_strtoull" in
12419 Checking whether your strtoull() works okay...
12421 $cat >try.c <<'EOCP'
12424 #define strtoull __strtoull
12427 extern unsigned long long int strtoull(char *s, char **, int);
12428 static int bad = 0;
12429 int check(char *s, long long eull, int een) {
12432 gull = strtoull(s, 0, 10);
12433 if (!((gull == eull) && (errno == een)))
12437 check(" 1", 1LL, 0);
12438 check(" 0", 0LL, 0);
12439 check("18446744073709551615", 18446744073709551615ULL, 0);
12440 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
12441 #if 0 /* strtoull() for /^-/ strings is undefined. */
12442 check("-1", 18446744073709551615ULL, 0);
12443 check("-18446744073709551614", 2LL, 0);
12444 check("-18446744073709551615", 1LL, 0);
12445 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
12446 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
12453 if eval $compile; then
12455 ok) echo "Your strtoull() seems to be working okay." ;;
12457 Your strtoull() doesn't seem to be working okay.
12459 d_strtoull="$undef"
12466 : see if strtouq exists
12467 set strtouq d_strtouq
12470 case "$d_strtouq" in
12473 Checking whether your strtouq() works okay...
12475 $cat >try.c <<'EOCP'
12478 extern unsigned long long int strtouq(char *s, char **, int);
12479 static int bad = 0;
12480 void check(char *s, unsigned long long eull, int een) {
12481 unsigned long long gull;
12483 gull = strtouq(s, 0, 10);
12484 if (!((gull == eull) && (errno == een)))
12488 check(" 1", 1LL, 0);
12489 check(" 0", 0LL, 0);
12490 check("18446744073709551615", 18446744073709551615ULL, 0);
12491 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
12492 #if 0 /* strtouq() for /^-/ strings is undefined. */
12493 check("-1", 18446744073709551615ULL, 0);
12494 check("-18446744073709551614", 2LL, 0);
12495 check("-18446744073709551615", 1LL, 0);
12496 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
12497 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
12505 if eval $compile; then
12507 ok) echo "Your strtouq() seems to be working okay." ;;
12509 Your strtouq() doesn't seem to be working okay.
12518 : see if strxfrm exists
12519 set strxfrm d_strxfrm
12522 : see if symlink exists
12523 set symlink d_symlink
12526 : see if syscall exists
12527 set syscall d_syscall
12530 : see if sysconf exists
12531 set sysconf d_sysconf
12534 : see if system exists
12535 set system d_system
12538 : see if tcgetpgrp exists
12539 set tcgetpgrp d_tcgetpgrp
12542 : see if tcsetpgrp exists
12543 set tcsetpgrp d_tcsetpgrp
12546 : see if prototype for telldir is available
12548 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
12551 : see if this is a sys/times.h system
12552 set sys/times.h i_systimes
12555 : see if times exists
12557 if set times val -f d_times; eval $csym; $val; then
12558 echo 'times() found.' >&4
12561 case "$i_systimes" in
12562 "$define") inc='sys/times.h';;
12564 rp="What is the type returned by times() on this system?"
12565 set clock_t clocktype long stdio.h sys/types.h $inc
12568 echo 'times() NOT found, hope that will do.' >&4
12573 : see if truncate exists
12574 set truncate d_truncate
12577 : see if tzname[] exists
12579 if set tzname val -a d_tzname; eval $csym; $val; then
12581 echo 'tzname[] found.' >&4
12584 echo 'tzname[] NOT found.' >&4
12589 case "$crosscompile" in
12590 ''|[nN]*) crosscompile="$undef" ;;
12594 next|rhapsody|darwin) multiarch="$define" ;;
12596 case "$multiarch" in
12597 ''|[nN]*) multiarch="$undef" ;;
12600 : check for ordering of bytes in a long
12602 case "$crosscompile$multiarch" in
12605 You seem to be either cross-compiling or doing a multiarchitecture build,
12606 skipping the byteorder check.
12612 case "$byteorder" in
12615 In the following, larger digits indicate more significance. A big-endian
12616 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
12617 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
12618 machines may have weird orders like 3412. A Cray will report 87654321,
12619 an Alpha will report 12345678. If the test program works the default is
12621 I'm now running the test program...
12623 $cat >try.c <<'EOCP'
12630 char c[sizeof(long)];
12633 if (sizeof(long) > 4)
12634 u.l = (0x08070605L << 32) | 0x04030201L;
12637 for (i = 0; i < sizeof(long); i++)
12638 printf("%c", u.c[i]+'0');
12645 if eval $compile && ./try > /dev/null; then
12648 [1-4][1-4][1-4][1-4]|12345678|87654321)
12649 echo "(The test program ran ok.)"
12650 echo "byteorder=$dflt"
12653 ????|????????) echo "(The test program ran ok.)" ;;
12654 *) echo "(The test program didn't run right for some reason.)" ;;
12659 (I can't seem to compile the test program. Guessing big-endian...)
12662 case "$xxx_prompt" in
12664 rp="What is the order of bytes in a long?"
12680 Checking to see whether you can access character data unalignedly...
12684 #define U32 $u32type
12685 #define BYTEORDER $byteorder
12687 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
12688 U8 buf[] = "\0\0\0\1\0\0\0\0";
12692 if (sizeof(U32) != 4) {
12693 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
12699 for (i = 0; i < 4; i++) {
12700 up = (U32*)(buf + i);
12701 if (! ((*up == 1 << (8*i)) || /* big-endian */
12702 (*up == 1 << (8*(3-i))) /* little-endian */
12706 printf("read failed (%x)\n", *up);
12712 for (i = 0; i < 4; i++) {
12713 up = (U32*)(buf + i);
12715 if (*up != 0xBeef) {
12716 printf("write failed (%x)\n", *up);
12730 if eval $compile_ok; then
12731 echo "(This test may dump core.)" >&4
12732 ./try >&2 >/dev/null
12735 You can access character data pretty unalignedly.
12737 d_u32align="$undef"
12740 It seems that you must access character data in an aligned manner.
12742 d_u32align="$define"
12745 $rm -f core core.try.* try.core
12747 rp='Can you access character data at unaligned addresses?'
12751 [yY]*) d_u32align="$undef" ;;
12752 *) d_u32align="$define" ;;
12756 : see if ualarm exists
12757 set ualarm d_ualarm
12760 : see if umask exists
12764 : see if usleep exists
12765 set usleep d_usleep
12768 : see if ustat exists
12772 : backward compatibility for d_hvfork
12773 if test X$d_hvfork != X; then
12774 d_vfork="$d_hvfork"
12777 : see if there is a vfork
12782 : Ok, but do we want to use it. vfork is reportedly unreliable in
12783 : perl on Solaris 2.x, and probably elsewhere.
12787 case "$usevfork" in
12793 Perl can only use a vfork() that doesn't suffer from strict
12794 restrictions on calling functions or modifying global data in
12795 the child. For example, glibc-2.1 contains such a vfork()
12796 that is unsuitable. If your system provides a proper fork()
12797 call, chances are that you do NOT want perl to use vfork().
12800 rp="Do you still want to use vfork()?"
12805 echo "Ok, we won't use vfork()."
12814 $define) usevfork='true';;
12815 *) usevfork='false';;
12818 : see if this is an sysdir system
12819 set sys/dir.h i_sysdir
12822 : see if this is an sysndir system
12823 set sys/ndir.h i_sysndir
12826 : see if closedir exists
12827 set closedir d_closedir
12830 case "$d_closedir" in
12833 echo "Checking whether closedir() returns a status..." >&4
12834 cat > closedir.c <<EOM
12835 #$i_dirent I_DIRENT /**/
12836 #$i_sysdir I_SYS_DIR /**/
12837 #$i_sysndir I_SYS_NDIR /**/
12838 #$i_systypes I_SYS_TYPES /**/
12840 #if defined(I_SYS_TYPES)
12841 #include <sys/types.h>
12843 #if defined(I_DIRENT)
12844 #include <dirent.h>
12845 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
12846 #include <sys/dir.h>
12850 #include <sys/ndir.h>
12854 #include <ndir.h> /* may be wrong in the future */
12856 #include <sys/dir.h>
12861 int main() { return closedir(opendir(".")); }
12864 if eval $compile_ok; then
12865 if ./closedir > /dev/null 2>&1 ; then
12866 echo "Yes, it does."
12869 echo "No, it doesn't."
12873 echo "(I can't seem to compile the test program--assuming it doesn't)"
12881 set d_void_closedir
12884 : see if there is a wait4
12888 : see if waitpid exists
12889 set waitpid d_waitpid
12892 : see if wcstombs exists
12893 set wcstombs d_wcstombs
12896 : see if wctomb exists
12897 set wctomb d_wctomb
12900 : see if writev exists
12901 set writev d_writev
12904 : preserve RCS keywords in files with variable substitution, grrr
12909 Revision='$Revision'
12911 : check for alignment requirements
12913 case "$crosscompile$multiarch" in
12916 You seem to be either cross-compiling or doing a multiarchitecture build,
12917 skipping the memory alignment check.
12920 case "$alignbytes" in
12921 '') alignbytes=8 ;;
12925 case "$alignbytes" in
12926 '') echo "Checking alignment constraints..." >&4
12927 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
12928 $cat >try.c <<'EOCP'
12929 typedef long double NV;
12932 $cat >try.c <<'EOCP'
12936 $cat >>try.c <<'EOCP'
12944 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
12949 if eval $compile_ok; then
12953 echo "(I can't seem to compile the test program...)"
12956 *) dflt="$alignbytes"
12959 rp="Doubles must be aligned on a how-many-byte boundary?"
12967 : set the base revision
12970 : how do we catenate cpp tokens here?
12972 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
12973 $cat >cpp_stuff.c <<'EOCP'
12974 #define RCAT(a,b)a/**/b
12975 #define ACAT(a,b)a ## b
12979 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
12980 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
12981 echo "Oh! Smells like ANSI's been here." >&4
12982 echo "We can catify or stringify, separately or together!"
12984 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
12985 echo "Ah, yes! The good old days!" >&4
12986 echo "However, in the good old days we don't know how to stringify and"
12987 echo "catify at the same time."
12991 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
12992 to have to edit the values of CAT[2-5] in config.h...
12994 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
12998 : see if this is a db.h system
13004 : Check db version.
13006 echo "Checking Berkeley DB version ..." >&4
13012 #include <sys/types.h>
13017 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
13018 int Major, Minor, Patch ;
13019 unsigned long Version ;
13020 (void)db_version(&Major, &Minor, &Patch) ;
13021 printf("You have Berkeley DB Version 2 or greater\n");
13023 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
13024 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
13025 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
13026 Major, Minor, Patch) ;
13028 /* check that db.h & libdb are compatible */
13029 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
13030 printf("db.h and libdb are incompatible\n") ;
13034 printf("db.h and libdb are compatible\n") ;
13036 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
13037 + DB_VERSION_PATCH ;
13039 /* needs to be >= 2.3.4 */
13040 if (Version < 2003004) {
13041 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
13042 printf("but Perl needs Berkeley DB 2.3.4 or greater\n") ;
13048 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
13049 printf("You have Berkeley DB Version 1\n");
13050 exit(0); /* DB version < 2: the coast is clear. */
13052 exit(1); /* <db.h> not Berkeley DB? */
13058 if eval $compile_ok && ./try; then
13059 echo 'Looks OK.' >&4
13061 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
13065 : Remove db from list of libraries to use
13066 echo "Removing unusable -ldb from library list" >&4
13067 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
13070 echo "libs = $libs" >&4
13080 : Check the return type needed for hash
13082 echo "Checking return type needed for hash for Berkeley DB ..." >&4
13088 #include <sys/types.h>
13091 #ifndef DB_VERSION_MAJOR
13092 u_int32_t hash_cb (ptr, size)
13100 info.hash = hash_cb;
13104 if $cc $ccflags -c try.c >try.out 2>&1 ; then
13105 if $contains warning try.out >>/dev/null 2>&1 ; then
13108 db_hashtype='u_int32_t'
13111 : XXX Maybe we should just give up here.
13112 db_hashtype=u_int32_t
13114 echo "Help: I can't seem to compile the db test program." >&4
13115 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
13118 echo "Your version of Berkeley DB uses $db_hashtype for hash."
13120 *) db_hashtype=u_int32_t
13125 : Check the return type needed for prefix
13127 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
13133 #include <sys/types.h>
13136 #ifndef DB_VERSION_MAJOR
13137 size_t prefix_cb (key1, key2)
13145 info.prefix = prefix_cb;
13149 if $cc $ccflags -c try.c >try.out 2>&1 ; then
13150 if $contains warning try.out >>/dev/null 2>&1 ; then
13151 db_prefixtype='int'
13153 db_prefixtype='size_t'
13156 db_prefixtype='size_t'
13157 : XXX Maybe we should just give up here.
13159 echo "Help: I can't seem to compile the db test program." >&4
13160 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
13163 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
13165 *) db_prefixtype='size_t'
13170 : How can we generate normalized random numbers ?
13172 echo "Looking for a random number function..." >&4
13173 case "$randfunc" in
13175 if set drand48 val -f; eval $csym; $val; then
13177 echo "Good, found drand48()." >&4
13178 elif set random val -f; eval $csym; $val; then
13180 echo "OK, found random()." >&4
13183 echo "Yick, looks like I have to use rand()." >&4
13194 *-Dmy_rand=*|*-Dmy_srand=*)
13195 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
13196 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
13197 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
13198 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
13202 while $test "$cont"; do
13203 rp="Use which function to generate random numbers?"
13205 if $test "$ans" = "$dflt"; then
13211 if set $ans val -f; eval $csym; $val; then
13215 rp="I cannot find function $ans. Use that name anyway?"
13224 case "$randfunc" in
13226 drand01="drand48()"
13232 case "$randbits" in
13234 echo "Checking to see how many bits your $randfunc() function produces..." >&4
13236 #$i_unistd I_UNISTD
13237 #$i_stdlib I_STDLIB
13240 # include <unistd.h>
13243 # include <stdlib.h>
13248 register unsigned long tmp;
13249 register unsigned long max = 0L;
13251 for (i = 1000; i; i--) {
13252 tmp = (unsigned long) $randfunc();
13253 if (tmp > max) max = tmp;
13255 for (i = 0; max; i++)
13261 if eval $compile_ok; then
13265 echo "(I can't seem to compile the test program...)"
13272 rp="How many bits does your $randfunc() function produce?"
13276 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
13277 seedfunc="s$randfunc"
13278 randseedtype=unsigned
13282 rp="How many bits does your $randfunc() function produce?"
13285 seedfunc="s$randfunc"
13286 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
13287 if set $seedfunc val -f; eval $csym; $val; then
13288 echo "(Using $seedfunc() to seed random generator)"
13290 echo "(Warning: no $seedfunc() to seed random generator)"
13293 randseedtype=unsigned
13301 echo "Determining whether or not we are on an EBCDIC system..." >&4
13302 $cat >tebcdic.c <<'EOM'
13305 if ('M'==0xd4) return 0;
13312 if eval $compile_ok; then
13314 echo "You seem to speak EBCDIC." >&4
13317 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF8." >&4
13320 echo "I'm unable to compile the test program." >&4
13321 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
13323 $rm -f tebcdic.c tebcdic
13329 Checking how to flush all pending stdio output...
13331 # I only know how to find the first 32 possibly open files on SunOS.
13332 # See also hints/sunos_4_1.sh and util.c --AD
13334 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
13336 $cat >>try.c <<EOCP
13338 #$i_unistd I_UNISTD
13340 # include <unistd.h>
13342 #$d_sysconf HAS_SYSCONF
13343 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
13344 #ifdef HAS_STDIO_STREAM_ARRAY
13345 # define STDIO_STREAM_ARRAY $stdio_stream_array
13348 FILE* p = fopen("try.out", "w");
13352 # ifdef TRY_FPRINTF
13356 #ifdef TRY_FFLUSH_NULL
13359 #ifdef TRY_FFLUSH_ALL
13361 long open_max = -1;
13362 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
13363 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
13365 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
13366 open_max = sysconf(_SC_OPEN_MAX);
13369 open_max = FOPEN_MAX;
13372 open_max = OPEN_MAX;
13381 # ifdef HAS_STDIO_STREAM_ARRAY
13382 if (open_max > 0) {
13384 for (i = 0; i < open_max; i++)
13385 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
13386 STDIO_STREAM_ARRAY[i]._file < open_max &&
13387 STDIO_STREAM_ARRAY[i]._flag)
13388 fflush(&STDIO_STREAM_ARRAY[i]);
13396 : first we have to find out how _not_ to flush
13397 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
13399 set try -DTRY_FPUTC
13400 if eval $compile; then
13402 ./try$exe_ext 2>/dev/null
13403 if $test ! -s try.out -a "X$?" = X42; then
13409 set try -DTRY_FPRINTF
13411 if eval $compile; then
13413 ./try$exe_ext 2>/dev/null
13414 if $test ! -s try.out -a "X$?" = X42; then
13415 output=-DTRY_FPRINTF
13421 : check for fflush NULL behaviour
13422 case "$fflushNULL" in
13423 '') set try -DTRY_FFLUSH_NULL $output
13424 if eval $compile; then
13426 ./try$exe_ext 2>/dev/null
13428 if $test -s try.out -a "X$code" = X42; then
13429 fflushNULL="`$cat try.out`"
13431 if $test "X$code" != X42; then
13433 (If this test failed, don't worry, we'll try another method shortly.)
13438 $rm -f core try.core core.try.*
13439 case "$fflushNULL" in
13441 Your fflush(NULL) works okay for output streams.
13442 Let's see if it clobbers input pipes...
13444 # As of mid-March 2000 all versions of Solaris appear to have a stdio
13445 # bug that improperly flushes the input end of pipes. So we avoid the
13446 # autoflush on fork/system/exec support for now. :-(
13447 $cat >tryp.c <<EOCP
13450 main(int argc, char **argv)
13456 while ((i = getc(stdin)) != -1
13457 && (*bp++ = i) != '\n'
13458 && bp < &buf[1024])
13461 fprintf(stdout, "%s", buf);
13469 fflushNULL="$define"
13471 if eval $compile; then
13473 $cat tryp.c | ./tryp$exe_ext 2>/dev/null > tryp.out
13474 if cmp tryp.c tryp.out >/dev/null 2>&1; then
13476 fflush(NULL) seems to behave okay with input streams.
13478 fflushNULL="$define"
13481 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
13483 fflushNULL="$undef"
13486 $rm -f core tryp.c tryp.core core.tryp.*
13489 Your fflush(NULL) isn't working (contrary to ANSI C).
13491 fflushNULL="$undef"
13494 Cannot figure out whether your fflush(NULL) works or not.
13495 I'm assuming it doesn't (contrary to ANSI C).
13497 fflushNULL="$undef"
13501 $define|true|[yY]*)
13502 fflushNULL="$define"
13505 fflushNULL="$undef"
13508 : check explicit looping only if NULL did not work, and if the pipe
13509 : bug does not show up on an explicit flush too
13510 case "$fflushNULL" in
13512 $cat >tryp.c <<EOCP
13515 main(int argc, char **argv)
13521 while ((i = getc(stdin)) != -1
13522 && (*bp++ = i) != '\n'
13523 && bp < &buf[1024])
13526 fprintf(stdout, "%s", buf);
13535 if eval $compile; then
13537 $cat tryp.c | ./tryp$exe_ext 2>/dev/null > tryp.out
13538 if cmp tryp.c tryp.out >/dev/null 2>&1; then
13540 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
13542 : now check for fflushall behaviour
13543 case "$fflushall" in
13544 '') set try -DTRY_FFLUSH_ALL $output
13545 if eval $compile; then
13547 (Now testing the other method--but note that this also may fail.)
13550 ./try$exe_ext 2>/dev/null
13551 if $test -s try.out -a "X$?" = X42; then
13552 fflushall="`$cat try.out`"
13555 $rm -f core try.core core.try.*
13556 case "$fflushall" in
13558 Whew. Flushing explicitly all the stdio streams works.
13560 fflushall="$define"
13563 Sigh. Flushing explicitly all the stdio streams doesn't work.
13568 Cannot figure out whether flushing stdio streams explicitly works or not.
13569 I'm assuming it doesn't.
13575 "$define"|true|[yY]*)
13576 fflushall="$define"
13584 All is futile. Even fflush(stdin) clobbers input pipes!
13591 $rm -f core tryp.c tryp.core core.tryp.*
13593 *) fflushall="$undef"
13597 case "$fflushNULL$fflushall" in
13600 OK, I give up. I cannot figure out how to flush pending stdio output.
13601 We won't be flushing handles at all before fork/exec/popen.
13605 $rm -f try.* try$exe_ext
13607 : Store the full pathname to the ar program for use in the C program
13608 : Respect a hint or command line value for full_ar.
13613 : Store the full pathname to the sed program for use in the C program
13616 : see what type gids are declared as in the kernel
13618 echo "Looking for the type for group ids returned by getgid()."
13619 set gid_t gidtype xxx stdio.h sys/types.h
13623 xxx=`./findhdr sys/user.h`
13624 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
13626 unsigned) dflt="$1 $2" ;;
13630 *) dflt="$gidtype";;
13633 gid_t) echo "gid_t found." ;;
13634 *) rp="What is the type for group ids returned by getgid()?"
13642 *_t) zzz="$gidtype" ;;
13645 echo "Checking the size of $zzz..." >&4
13647 #include <sys/types.h>
13650 printf("%d\n", (int)sizeof($gidtype));
13655 if eval $compile_ok; then
13659 echo "(I can't execute the test program--guessing $gidsize.)" >&4
13662 echo "Your $zzz is $gidsize bytes long."
13667 echo "(I can't compile the test program--guessing $gidsize.)" >&4
13673 *_t) zzz="$gidtype" ;;
13676 echo "Checking the sign of $zzz..." >&4
13678 #include <sys/types.h>
13689 if eval $compile; then
13693 echo "(I can't execute the test program--guessing unsigned.)" >&4
13697 1) echo "Your $zzz is unsigned." ;;
13698 -1) echo "Your $zzz is signed." ;;
13704 echo "(I can't compile the test program--guessing unsigned.)" >&4
13710 if $test X"$quadtype" != X; then
13712 echo "Checking how to print 64-bit integers..." >&4
13714 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
13715 $cat >try.c <<'EOCP'
13716 #include <sys/types.h>
13719 int q = 12345678901;
13720 printf("%ld\n", q);
13724 if eval $compile; then
13725 yyy=`./try$exe_ext`
13728 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
13729 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
13730 echo "We will use %d."
13736 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
13737 $cat >try.c <<'EOCP'
13738 #include <sys/types.h>
13741 long q = 12345678901;
13742 printf("%ld\n", q);
13746 if eval $compile; then
13747 yyy=`./try$exe_ext`
13750 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
13751 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
13752 echo "We will use %ld."
13758 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
13759 $cat >try.c <<'EOCP'
13760 #include <sys/types.h>
13761 #include <inttypes.h>
13764 int64_t q = 12345678901;
13765 printf("%" PRId64 "\n", q);
13769 if eval $compile; then
13770 yyy=`./try$exe_ext`
13773 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
13774 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
13775 echo "We will use the C9X style."
13781 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
13782 $cat >try.c <<'EOCP'
13783 #include <sys/types.h>
13786 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
13787 printf("%lld\n", q);
13791 if eval $compile; then
13792 yyy=`./try$exe_ext`
13795 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
13796 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
13797 echo "We will use the %lld style."
13803 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
13805 #include <sys/types.h>
13808 $quadtype q = 12345678901;
13809 printf("%Ld\n", q);
13813 if eval $compile; then
13814 yyy=`./try$exe_ext`
13817 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
13818 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
13819 echo "We will use %Ld."
13825 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
13827 #include <sys/types.h>
13830 $quadtype q = 12345678901;
13831 printf("%qd\n", q);
13835 if eval $compile; then
13836 yyy=`./try$exe_ext`
13839 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
13840 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
13841 echo "We will use %qd."
13847 if $test X"$sPRId64" = X; then
13848 echo "Cannot figure out how to print 64-bit integers." >&4
13856 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
13857 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
13859 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
13860 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
13866 $echo "Checking the format strings to be used for Perl's internal types..." >&4
13868 if $test X"$ivsize" = X8; then
13869 ivdformat="$sPRId64"
13870 uvuformat="$sPRIu64"
13871 uvoformat="$sPRIo64"
13872 uvxformat="$sPRIx64"
13873 uvXUformat="$sPRIXU64"
13875 if $test X"$ivsize" = X"$longsize"; then
13882 if $test X"$ivsize" = X"$intsize"; then
13890 if $test X"$ivsize" = X"$shortsize"; then
13901 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
13902 nveformat="$sPRIeldbl"
13903 nvfformat="$sPRIfldbl"
13904 nvgformat="$sPRIgldbl"
13905 nvEUformat="$sPRIEUldbl"
13906 nvFUformat="$sPRIFUldbl"
13907 nvGUformat="$sPRIGUldbl"
13917 case "$ivdformat" in
13918 '') echo "$0: Fatal: failed to find format strings, cannot continue." >& 4
13925 $echo "Checking the format string to be used for gids..." >&4
13928 -1) if $test X"$gidsize" = X"$ivsize"; then
13929 gidformat="$ivdformat"
13931 if $test X"$gidsize" = X"$longsize"; then
13934 if $test X"$gidsize" = X"$intsize"; then
13937 if $test X"$gidsize" = X"$shortsize"; then
13944 *) if $test X"$gidsize" = X"$uvsize"; then
13945 gidformat="$uvuformat"
13947 if $test X"$gidsize" = X"$longsize"; then
13950 if $test X"$gidsize" = X"$intsize"; then
13953 if $test X"$gidsize" = X"$shortsize"; then
13962 : see if getgroups exists
13963 set getgroups d_getgrps
13966 : see if setgroups exists
13967 set setgroups d_setgrps
13971 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
13973 case "$d_getgrps$d_setgrps" in
13975 case "$groupstype" in
13976 '') dflt="$gidtype" ;;
13977 *) dflt="$groupstype" ;;
13980 What type of pointer is the second argument to getgroups() and setgroups()?
13981 Usually this is the same as group ids, $gidtype, but not always.
13984 rp='What type pointer is the second argument to getgroups() and setgroups()?'
13988 *) groupstype="$gidtype";;
13992 echo "Checking if your $make program sets \$(MAKE)..." >&4
13993 case "$make_set_make" in
13995 $sed 's/^X //' > testmake.mak << 'EOF'
13997 X @echo 'maketemp="$(MAKE)"'
13999 case "`$make -f testmake.mak 2>/dev/null`" in
14000 *maketemp=*) make_set_make='#' ;;
14001 *) make_set_make="MAKE=$make" ;;
14003 $rm -f testmake.mak
14006 case "$make_set_make" in
14007 '#') echo "Yup, it does.";;
14008 *) echo "Nope, it doesn't.";;
14011 : see what type is used for mode_t
14012 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
14013 set mode_t modetype int stdio.h sys/types.h
14016 : see if stdarg is available
14018 if $test `./findhdr stdarg.h`; then
14019 echo "<stdarg.h> found." >&4
14022 echo "<stdarg.h> NOT found." >&4
14026 : see if varags is available
14028 if $test `./findhdr varargs.h`; then
14029 echo "<varargs.h> found." >&4
14031 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
14034 : set up the varargs testing programs
14035 $cat > varargs.c <<EOP
14037 #include <stdarg.h>
14040 #include <varargs.h>
14044 int f(char *p, ...)
14058 p = va_arg(ap, char *);
14063 $cat > varargs <<EOP
14065 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
14074 : now check which varargs header should be included
14079 if `./varargs I_STDARG`; then
14081 elif `./varargs I_VARARGS`; then
14086 if `./varargs I_VARARGS`; then
14093 echo "I could not find the definition for va_dcl... You have problems..." >&4
14094 val="$undef"; set i_stdarg; eval $setvar
14095 val="$undef"; set i_varargs; eval $setvar
14100 case "$i_varhdr" in
14102 val="$define"; set i_stdarg; eval $setvar
14103 val="$undef"; set i_varargs; eval $setvar
14106 val="$undef"; set i_stdarg; eval $setvar
14107 val="$define"; set i_varargs; eval $setvar
14110 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
14114 : see if we need va_copy
14116 case "$i_stdarg" in
14119 #include <stdarg.h>
14121 #$i_stdlib I_STDLIB
14123 #include <stdlib.h>
14125 #include <signal.h>
14128 ivfprintf(FILE *f, const char *fmt, va_list *valp)
14130 return vfprintf(f, fmt, *valp);
14134 myvfprintf(FILE *f, const char *fmt, va_list val)
14136 return ivfprintf(f, fmt, &val);
14140 myprintf(char *fmt, ...)
14143 va_start(val, fmt);
14144 return myvfprintf(stdout, fmt, val);
14148 main(int ac, char **av)
14150 signal(SIGSEGV, exit);
14152 myprintf("%s%cs all right, then\n", "that", '\'');
14157 if eval $compile && ./try 2>&1 >/dev/null; then
14159 "that's all right, then")
14165 yes) echo "It seems that you don't need va_copy()." >&4
14166 need_va_copy="$undef"
14168 *) echo "It seems that va_copy() or similar will be needed." >&4
14169 need_va_copy="$define"
14172 $rm -f try.* core core.* *.core *.core.*
14174 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
14178 : define a fucntion to check prototypes
14179 $cat > protochk <<EOSH
14182 optimize="$optimize"
14184 prototype="$prototype"
14189 $cat >> protochk <<'EOSH'
14194 while test $# -ge 2; do
14196 $define) echo "#include <$2>" >> try.c ;;
14197 literal) echo "$2" >> try.c ;;
14201 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
14202 cat >> try.c <<'EOCP'
14203 #ifdef CAN_PROTOTYPE
14204 #define _(args) args
14209 echo "$foo" >> try.c
14210 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
14211 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
14217 $eunicefix protochk
14219 : see what type is used for size_t
14220 rp="What is the type used for the length parameter for string functions?"
14221 set size_t sizetype 'unsigned int' stdio.h sys/types.h
14224 : check for type of arguments to gethostbyaddr.
14225 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
14226 case "$d_gethbyaddr" in
14230 Checking to see what type of arguments are accepted by gethostbyaddr().
14232 hdrs="$define sys/types.h
14233 $d_socket sys/socket.h
14234 $i_niin netinet/in.h
14236 $i_unistd unistd.h"
14237 : The first arg can 'char *' or 'void *'
14238 : The second arg is some of integral type
14239 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
14240 for yyy in size_t long int; do
14241 case "$netdb_host_type" in
14242 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
14243 if ./protochk "$try" $hdrs; then
14244 echo "Your system accepts $xxx for the first arg."
14245 echo "...and $yyy for the second arg."
14246 netdb_host_type="$xxx"
14247 netdb_hlen_type="$yyy"
14253 : In case none of those worked, prompt the user.
14254 case "$netdb_host_type" in
14255 '') rp='What is the type for the 1st argument to gethostbyaddr?'
14258 netdb_host_type=$ans
14259 rp='What is the type for the 2nd argument to gethostbyaddr?'
14262 netdb_hlen_type=$ans
14266 *) : no gethostbyaddr, so pick harmless defaults
14267 netdb_host_type='char *'
14268 netdb_hlen_type="$sizetype"
14271 # Remove the "const" if needed. -- but then we'll have a
14273 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
14276 : check for type of argument to gethostbyname.
14277 if test "X$netdb_name_type" = X ; then
14278 case "$d_gethbyname" in
14282 Checking to see what type of argument is accepted by gethostbyname().
14284 hdrs="$define sys/types.h
14285 $d_socket sys/socket.h
14286 $i_niin netinet/in.h
14288 $i_unistd unistd.h"
14289 for xxx in "const char *" "char *"; do
14290 case "$netdb_name_type" in
14291 '') try="extern struct hostent *gethostbyname($xxx);"
14292 if ./protochk "$try" $hdrs; then
14293 echo "Your system accepts $xxx."
14294 netdb_name_type="$xxx"
14299 : In case none of those worked, prompt the user.
14300 case "$netdb_name_type" in
14301 '') rp='What is the type for the 1st argument to gethostbyname?'
14304 netdb_name_type=$ans
14308 *) : no gethostbyname, so pick harmless default
14309 netdb_name_type='char *'
14314 : check for type of 1st argument to getnetbyaddr.
14315 if test "X$netdb_net_type" = X ; then
14316 case "$d_getnbyaddr" in
14320 Checking to see what type of 1st argument is accepted by getnetbyaddr().
14322 hdrs="$define sys/types.h
14323 $d_socket sys/socket.h
14324 $i_niin netinet/in.h
14326 $i_unistd unistd.h"
14327 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
14328 case "$netdb_net_type" in
14329 '') try="extern struct netent *getnetbyaddr($xxx, int);"
14330 if ./protochk "$try" $hdrs; then
14331 echo "Your system accepts $xxx."
14332 netdb_net_type="$xxx"
14337 : In case none of those worked, prompt the user.
14338 case "$netdb_net_type" in
14339 '') rp='What is the type for the 1st argument to getnetbyaddr?'
14342 netdb_net_type=$ans
14346 *) : no getnetbyaddr, so pick harmless default
14347 netdb_net_type='long'
14351 : locate the preferred pager for this system
14357 [a-zA-Z]:/*) dflt=$pg;;
14361 [a-zA-Z]:/*) dflt=$more;;
14365 [a-zA-Z]:/*) dflt=$less;;
14368 '') dflt=/usr/ucb/more;;
14375 rp='What pager is used on your system?'
14379 : see what type pids are declared as in the kernel
14380 rp="What is the type of process ids on this system?"
14381 set pid_t pidtype int stdio.h sys/types.h
14384 : Find earliest binary compatible site_perl subdirectory perl can use.
14385 case "$bincompat5005" in
14386 "$define") xs_apiversion='5.005' ;;
14387 *) xs_apiversion=$version ;; # The current site_perl version.
14389 : Find earliest pure perl site_perl subdirectory perl can use.
14390 : The versioned directories started at 5.005.
14391 pm_apiversion='5.005'
14393 : see if ar generates random libraries by itself
14395 echo "Checking how to generate random libraries on your machine..." >&4
14396 echo 'int bar1() { return bar2(); }' > bar1.c
14397 echo 'int bar2() { return 2; }' > bar2.c
14398 $cat > foo.c <<'EOP'
14399 int main() { printf("%d\n", bar1()); exit(0); }
14401 $cc $ccflags -c bar1.c >/dev/null 2>&1
14402 $cc $ccflags -c bar2.c >/dev/null 2>&1
14403 $cc $ccflags -c foo.c >/dev/null 2>&1
14404 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
14405 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
14406 ./foobar >/dev/null 2>&1; then
14407 echo "$ar appears to generate random libraries itself."
14410 elif $ar ts bar$_a >/dev/null 2>&1 &&
14411 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
14412 ./foobar >/dev/null 2>&1; then
14413 echo "a table of contents needs to be added with '$ar ts'."
14420 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
14421 $test -f $ranlib || ranlib=''
14424 if $test -n "$ranlib"; then
14425 echo "your system has '$ranlib'; we'll use that."
14428 echo "your system doesn't seem to support random libraries"
14429 echo "so we'll use lorder and tsort to order the libraries."
14436 : check for type of arguments to select.
14437 case "$selecttype" in
14438 '') case "$d_select" in
14442 Checking to see what type of arguments are accepted by select().
14444 hdrs="$define sys/types.h
14445 $i_systime sys/time.h
14446 $i_sysselct sys/select.h
14447 $d_socket sys/socket.h"
14448 : The first arg can be int, unsigned, or size_t
14449 : The last arg may or may not be 'const'
14451 : void pointer has been seen but using that
14452 : breaks the selectminbits test
14453 for xxx in 'fd_set *' 'int *'; do
14454 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
14455 for tmo in 'struct timeval *' 'const struct timeval *'; do
14457 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
14458 if ./protochk "$try" $hdrs; then
14459 echo "Your system accepts $xxx."
14468 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
14469 case "$d_fd_set" in
14470 $define) dflt="fd_set *" ;;
14479 *) : no select, so pick a harmless default
14486 : check for the select 'width'
14487 case "$selectminbits" in
14488 '') case "$d_select" in
14492 Checking to see on how many bits at a time your select() operates...
14495 #include <sys/types.h>
14497 #$i_systime I_SYS_TIME
14498 #$i_systimek I_SYS_TIME_KERNEL
14503 # ifdef I_SYS_TIME_KERNEL
14506 # include <sys/time.h>
14507 # ifdef I_SYS_TIME_KERNEL
14511 #$i_sysselct I_SYS_SELECT
14512 #ifdef I_SYS_SELECT
14513 #include <sys/select.h>
14515 #$d_socket HAS_SOCKET
14517 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
14521 #define S sizeof(*(b))
14523 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
14524 #define NBITS (NBYTES * 8)
14533 fp = fopen("try.c", "r");
14539 b = ($selecttype)s;
14540 for (i = 0; i < NBITS; i++)
14544 select(fd + 1, b, 0, 0, &t);
14545 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
14546 printf("%d\n", i + 1);
14551 if eval $compile_ok; then
14552 selectminbits=`./try`
14553 case "$selectminbits" in
14555 Cannot figure out on how many bits at a time your select() operates.
14556 I'll play safe and guess it is 32 bits.
14562 *) bits="$selectminbits bits" ;;
14564 echo "Your select() operates on $bits at a time." >&4
14566 rp='What is the minimum number of bits your select() operates on?'
14567 case "$byteorder" in
14568 1234|12345678) dflt=32 ;;
14573 selectminbits="$val"
14577 *) : no select, so pick a harmless default
14584 : Trace out the files included by signal.h, then look for SIGxxx names.
14585 : Remove SIGARRAYSIZE used by HPUX.
14586 : Remove SIGSTKSIZE used by Linux.
14587 : Remove SIGSTKSZ used by Posix.
14588 : Remove SIGTYP void lines used by OS2.
14589 : Some cpps, like os390, dont give the file name anywhere
14590 if [ "X$fieldn" = X ]; then
14591 : Just make some guesses. We check them later.
14592 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
14594 xxx=`echo '#include <signal.h>' |
14595 $cppstdin $cppminus $cppflags 2>/dev/null |
14596 $grep '^[ ]*#.*include' |
14597 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
14599 : Check this list of files to be sure we have parsed the cpp output ok.
14600 : This will also avoid potentially non-existent files, such
14603 for xx in $xxx /dev/null ; do
14604 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
14606 : If we have found no files, at least try signal.h
14607 case "$xxxfiles" in
14608 '') xxxfiles=`./findhdr signal.h` ;;
14611 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
14612 print substr($2, 4, 20)
14614 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
14615 print substr($3, 4, 20)
14617 : Append some common names just in case the awk scan failed.
14618 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
14619 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
14620 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
14621 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
14622 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
14624 : generate a few handy files for later
14625 $cat > signal.c <<'EOCP'
14626 #include <sys/types.h>
14627 #include <signal.h>
14631 /* Strange style to avoid deeply-nested #if/#else/#endif */
14634 # define NSIG (_NSIG)
14640 # define NSIG (SIGMAX+1)
14646 # define NSIG (SIG_MAX+1)
14652 # define NSIG (MAXSIG+1)
14658 # define NSIG (MAX_SIG+1)
14663 # ifdef SIGARRAYSIZE
14664 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
14670 # define NSIG (_sys_nsig) /* Solaris 2.5 */
14674 /* Default to some arbitrary number that's big enough to get most
14675 of the common signals.
14681 printf("NSIG %d\n", NSIG);
14687 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
14689 printf "#ifdef SIG"; printf $1; printf "\n"
14690 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
14691 printf $1; printf ");\n"
14695 printf "#endif /* JUST_NSIG */\n";
14696 printf "exit(0);\n}\n";
14699 $cat >signal.awk <<'EOP'
14700 BEGIN { ndups = 0 }
14701 $1 ~ /^NSIG$/ { nsig = $2 }
14702 ($1 !~ /^NSIG$/) && (NF == 2) {
14703 if ($2 > maxsig) { maxsig = $2 }
14704 if (sig_name[$2]) {
14705 dup_name[ndups] = $1
14706 dup_num[ndups] = $2
14718 printf("NSIG %d\n", nsig);
14719 for (n = 1; n < nsig; n++) {
14721 printf("%s %d\n", sig_name[n], sig_num[n])
14724 printf("NUM%d %d\n", n, n)
14727 for (n = 0; n < ndups; n++) {
14728 printf("%s %d\n", dup_name[n], dup_num[n])
14732 $cat >signal_cmd <<EOS
14734 if $test -s signal.lst; then
14735 echo "Using your existing signal.lst file"
14740 $cat >>signal_cmd <<'EOS'
14743 if eval $compile_ok; then
14744 ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
14746 echo "(I can't seem be able to compile the whole test program)" >&4
14747 echo "(I'll try it in little pieces.)" >&4
14748 set signal -DJUST_NSIG
14749 if eval $compile_ok; then
14750 ./signal$_exe > signal.nsg
14753 echo "I can't seem to figure out how many signals you have." >&4
14754 echo "Guessing 50." >&4
14755 echo 'NSIG 50' > signal.nsg
14757 : Now look at all the signal names, one at a time.
14758 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
14759 $cat > signal.c <<EOCP
14760 #include <sys/types.h>
14761 #include <signal.h>
14764 printf("$xx %d\n", SIG${xx});
14769 if eval $compile; then
14770 echo "SIG${xx} found."
14771 ./signal$_exe >> signal.ls1
14773 echo "SIG${xx} NOT found."
14776 if $test -s signal.ls1; then
14777 $cat signal.nsg signal.ls1 |
14778 $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
14782 if $test -s signal.lst; then
14785 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
14786 echo 'kill -l' >signal
14787 set X `csh -f <signal`
14791 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
14793 echo $@ | $tr ' ' $trnl | \
14794 $awk '{ printf "%s %d\n", $1, ++s; }
14795 END { printf "NSIG %d\n", ++s }' >signal.lst
14797 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
14799 chmod a+x signal_cmd
14800 $eunicefix signal_cmd
14802 : generate list of signal names
14804 case "$sig_name_init" in
14806 *) case "$sig_num_init" in
14807 ''|*,*) doinit=yes ;;
14812 echo "Generating a list of signal names and numbers..." >&4
14814 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
14815 sig_name=`$awk 'BEGIN { printf "ZERO " }
14816 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
14817 sig_num=`$awk 'BEGIN { printf "0 " }
14818 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
14819 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
14820 !/^NSIG/ { printf "\"%s\", ", $1 }
14821 END { printf "0\n" }' signal.lst`
14822 sig_num_init=`$awk 'BEGIN { printf "0, " }
14823 !/^NSIG/ { printf "%d, ", $2}
14824 END { printf "0\n"}' signal.lst`
14827 echo "The following $sig_count signals are available:"
14829 echo $sig_name | $awk \
14830 'BEGIN { linelen = 0 }
14832 for (i = 1; i <= NF; i++) {
14833 name = "SIG" $i " "
14834 linelen = linelen + length(name)
14835 if (linelen > 70) {
14837 linelen = length(name)
14843 sig_size=`echo $sig_name | awk '{print NF}'`
14844 $rm -f signal signal.c signal.awk signal.lst signal_cmd
14847 case "$sizetype" in
14848 *_t) zzz="$sizetype" ;;
14849 *) zzz="filesize" ;;
14851 echo "Checking the size of $zzz..." >&4
14853 #include <sys/types.h>
14856 printf("%d\n", (int)sizeof($sizetype));
14861 if eval $compile_ok; then
14865 echo "(I can't execute the test program--guessing $sizesize.)" >&4
14868 echo "Your $zzz size is $sizesize bytes."
14873 echo "(I can't compile the test program--guessing $sizesize.)" >&4
14877 : check for socklen_t
14879 echo "Checking to see if you have socklen_t..." >&4
14881 #include <sys/types.h>
14882 #$d_socket HAS_SOCKET
14884 #include <sys/socket.h>
14886 int main() { socklen_t x = 16; }
14889 if eval $compile; then
14891 echo "You have socklen_t."
14894 echo "You do not have socklen_t."
14895 case "$sizetype" in
14896 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
14903 : see if this is a socks.h system
14904 set socks.h i_socks
14907 : check for type of the size argument to socket calls
14908 case "$d_socket" in
14912 Checking to see what type is the last argument of accept().
14915 case "$d_socklen_t" in
14916 "$define") yyy="$yyy socklen_t"
14918 yyy="$yyy $sizetype int long unsigned"
14919 for xxx in $yyy; do
14920 case "$socksizetype" in
14921 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
14922 case "$usesocks" in
14924 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
14925 echo "Your system accepts '$xxx *' for the last argument of accept()."
14926 socksizetype="$xxx"
14929 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
14930 echo "Your system accepts '$xxx *' for the last argument of accept()."
14931 socksizetype="$xxx"
14938 : In case none of those worked, prompt the user.
14939 case "$socksizetype" in
14940 '') rp='What is the type for socket address structure sizes?'
14947 *) : no sockets, so pick relatively harmless default
14952 : see what type is used for signed size_t
14953 set ssize_t ssizetype int stdio.h sys/types.h
14956 $cat > ssize.c <<EOM
14958 #include <sys/types.h>
14959 #define Size_t $sizetype
14960 #define SSize_t $dflt
14963 if (sizeof(Size_t) == sizeof(SSize_t))
14965 else if (sizeof(Size_t) == sizeof(int))
14974 if eval $compile_ok && ./ssize > /dev/null; then
14975 ssizetype=`./ssize`
14976 echo "I'll be using $ssizetype for functions returning a byte count." >&4
14979 Help! I can't compile and run the ssize_t test program: please enlighten me!
14980 (This is probably a misconfiguration in your system or libraries, and
14981 you really ought to fix it. Still, I'll try anyway.)
14983 I need a type that is the same size as $sizetype, but is guaranteed to
14984 be signed. Common values are ssize_t, int and long.
14987 rp="What signed type is the same size as $sizetype?"
14991 $rm -f ssize ssize.*
14993 : see what type of char stdio uses.
14995 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
14996 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
14997 echo "Your stdio uses unsigned chars." >&4
14998 stdchar="unsigned char"
15000 echo "Your stdio uses signed chars." >&4
15007 : see if time exists
15009 if test "X$d_time" = X -o X"$timetype" = X; then
15010 if set time val -f d_time; eval $csym; $val; then
15011 echo 'time() found.' >&4
15013 rp="What is the type returned by time() on this system?"
15014 set time_t timetype long stdio.h sys/types.h
15017 echo 'time() not found, hope that will do.' >&4
15025 : see what type uids are declared as in the kernel
15027 echo "Looking for the type for user ids returned by getuid()."
15028 set uid_t uidtype xxx stdio.h sys/types.h
15032 xxx=`./findhdr sys/user.h`
15033 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
15035 unsigned) dflt="$1 $2" ;;
15039 *) dflt="$uidtype";;
15042 uid_t) echo "uid_t found." ;;
15043 *) rp="What is the type for user ids returned by getuid()?"
15051 *_t) zzz="$uidtype" ;;
15054 echo "Checking the size of $zzz..." >&4
15056 #include <sys/types.h>
15059 printf("%d\n", (int)sizeof($uidtype));
15064 if eval $compile_ok; then
15068 echo "(I can't execute the test program--guessing $uidsize.)" >&4
15071 echo "Your $zzz is $uidsize bytes long."
15076 echo "(I can't compile the test program--guessing $uidsize.)" >&4
15081 *_t) zzz="$uidtype" ;;
15084 echo "Checking the sign of $zzz..." >&4
15086 #include <sys/types.h>
15097 if eval $compile; then
15101 echo "(I can't execute the test program--guessing unsigned.)" >&4
15105 1) echo "Your $zzz is unsigned." ;;
15106 -1) echo "Your $zzz is signed." ;;
15112 echo "(I can't compile the test program--guessing unsigned.)" >&4
15118 $echo "Checking the format string to be used for uids..." >&4
15121 -1) if $test X"$uidsize" = X"$ivsize"; then
15122 uidformat="$ivdformat"
15124 if $test X"$uidsize" = X"$longsize"; then
15127 if $test X"$uidsize" = X"$intsize"; then
15130 if $test X"$uidsize" = X"$shortsize"; then
15137 *) if $test X"$uidsize" = X"$uvsize"; then
15138 uidformat="$uvuformat"
15140 if $test X"$uidsize" = X"$longsize"; then
15143 if $test X"$uidsize" = X"$intsize"; then
15146 if $test X"$uidsize" = X"$shortsize"; then
15155 : determine compiler compiler
15164 if $test -f "$byacc"; then
15166 comp="byacc or $comp"
15168 if $test -f "$bison"; then
15169 comp="$comp or bison -y"
15171 rp="Which compiler compiler ($comp) shall I use?"
15180 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
15186 : see if dbm.h is available
15187 : see if dbmclose exists
15188 set dbmclose d_dbmclose
15191 case "$d_dbmclose" in
15201 *) set rpcsvc/dbm.h i_rpcsvcdbm
15206 *) echo "We won't be including <dbm.h>"
15216 : see if this is a sys/file.h system
15221 : do we need to include sys/file.h ?
15225 if $h_sysfile; then
15227 echo "We'll be including <sys/file.h>." >&4
15230 echo "We won't be including <sys/file.h>." >&4
15240 : see if fcntl.h is there
15245 : see if we can include fcntl.h
15251 echo "We'll be including <fcntl.h>." >&4
15254 if $h_sysfile; then
15255 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
15257 echo "We won't be including <fcntl.h>." >&4
15269 : see if this is a iconv.h system
15270 set iconv.h i_iconv
15273 : see if this is a ieeefp.h system
15274 set ieeefp.h i_ieeefp
15277 : see if this is a libutil.h system
15278 set libutil.h i_libutil
15281 : see if locale.h is available
15282 set locale.h i_locale
15285 : see if mach cthreads are available
15286 if test "X$usethreads" = "X$define"; then
15287 set mach/cthreads.h i_machcthr
15290 i_machcthr="$undef"
15295 : see if this is a math.h system
15299 : see if this is a mntent.h system
15300 set mntent.h i_mntent
15303 : see if ndbm.h is available
15308 : see if dbm_open exists
15309 set dbm_open d_dbm_open
15311 case "$d_dbm_open" in
15314 echo "We won't be including <ndbm.h>"
15323 : see if net/errno.h is available
15325 set net/errno.h val
15328 : Unfortunately, it causes problems on some systems. Arrgh.
15331 cat > try.c <<'EOM'
15334 #include <net/errno.h>
15340 if $cc $ccflags -c try.c >/dev/null 2>&1; then
15341 echo "We'll be including <net/errno.h>." >&4
15343 echo "We won't be including <net/errno.h>." >&4
15352 : see if netinet/tcp.h is available
15353 set netinet/tcp.h i_netinettcp
15356 : see if this is a poll.h system
15360 : see if this is a prot.h system
15365 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
15366 $cat <<'EOSH' > Cppsym.know
15367 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
15368 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
15369 alliant alpha am29000 AM29000 AMD64 amiga AMIGAOS AMIX
15370 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
15371 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
15372 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
15373 bull c cadmus clipper CMU COFF COMPILER_VERSION
15374 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
15375 CYGWIN DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
15376 Dynix DynixPTX ELF encore EPI EXTENSIONS FILE_OFFSET_BITS
15377 FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
15378 GNU_SOURCE GNUC GNUC_MINOR GO32 gould GOULD_PN
15379 H3050R H3050RX hbullx20 hcx host_mips
15380 hp200 hp300 hp700 HP700 hp800 hp9000
15381 hp9000s200 hp9000s300 hp9000s400 hp9000s500
15382 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
15383 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
15384 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
15385 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
15386 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
15387 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
15388 Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
15389 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
15390 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
15391 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
15392 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
15393 MATH_HAS_NO_SIDE_EFFECTS
15394 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
15395 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
15396 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
15397 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
15398 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
15399 NetBSD news1500 news1700 news1800 news1900 news3700
15400 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
15401 ns32016 ns32332 ns32k nsc32000
15402 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
15403 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
15404 pc532 pdp11 PGC PIC plexus PORTAR posix
15405 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
15406 POSIX_C_SOURCE POSIX_SOURCE POWER
15407 PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
15408 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
15409 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
15410 sony sony_news sonyrisc sparc sparclite spectrum
15411 stardent stdc STDC_EXT stratos sun sun3 sun386
15412 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
15413 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
15414 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
15415 sysV68 sysV88 Tek4132 Tek4300 titan
15416 TM3200 TM5400 TM5600
15417 tower tower32 tower32_200 tower32_600 tower32_700
15418 tower32_800 tower32_850 tss
15419 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
15420 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
15421 unix UNIX95 UNIX99 unixpc unos USGr4 USGr4_2
15422 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms xenix Xenix286
15423 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
15424 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
15427 # Maybe put other stuff here too.
15428 cat <<EOSH >>Cppsym.know
15431 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
15432 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
15433 $cat Cppsym.know > Cppsym.c
15434 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
15435 $rm -f Cppsym.a Cppsym.b Cppsym.c
15436 cat <<EOSH > Cppsym
15438 if $test \$# -gt 0; then
15439 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
15440 if $test -s Cppsym.got; then
15447 $tr " " "$trnl" | ./Cppsym.try
15453 cat <<EOSH > Cppsym.try
15455 cat <<'EOCP' > try.c
15461 cat <<'EOSH' >> Cppsym.try
15463 printf "#ifdef %s\n#if %s+0\nprintf(\"%s=%%ld\\n\", %s);\n#else\nprintf(\"%s\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1
15464 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
15465 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
15466 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
15470 cat <<EOSH >> Cppsym.try
15472 case "$osname-$gccversion" in
15473 irix-) ccflags="\$ccflags -woff 1178" ;;
15474 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
15476 $cc -o try $optimize \$ccflags $ldflags try.c $libs && ./try$exe_ext
15478 chmod +x Cppsym.try
15479 $eunicefix Cppsym.try
15480 ./Cppsym < Cppsym.know > Cppsym.true
15481 : now check the C compiler for additional symbols
15482 postprocess_cc_v=''
15484 aix) postprocess_cc_v="|$tr , ' '" ;;
15491 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
15494 -D*) echo "\$i" | $sed 's/^-D//';;
15495 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
15500 postprocess_cc_v=''
15503 ./ccsym > ccsym1.raw
15504 if $test -s ccsym1.raw; then
15505 $sort ccsym1.raw | $uniq >ccsym.raw
15507 mv ccsym1.raw ccsym.raw
15510 $awk '/\=/ { print $0; next }
15511 { print $0"=1" }' ccsym.raw >ccsym.list
15512 $awk '/\=/ { print $0; next }
15513 { print $0"=1" }' Cppsym.true >ccsym.true
15514 $comm -13 ccsym.true ccsym.list >ccsym.own
15515 $comm -12 ccsym.true ccsym.list >ccsym.com
15516 $comm -23 ccsym.true ccsym.list >ccsym.cpp
15518 if $test -z ccsym.raw; then
15519 echo "Your C compiler doesn't seem to define any symbols!" >&4
15521 echo "However, your C preprocessor defines the following symbols:"
15524 cppsymbols=`$cat Cppsym.true`
15525 cppsymbols=`echo $cppsymbols`
15526 cppccsymbols="$cppsymbols"
15528 if $test -s ccsym.com; then
15529 echo "Your C compiler and pre-processor define these symbols:"
15530 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
15533 cppccsymbols=`$cat ccsym.com`
15534 cppccsymbols=`echo $cppccsymbols`
15535 $test "$silent" || sleep 1
15537 if $test -s ccsym.cpp; then
15538 $test "$also" && echo " "
15539 echo "Your C pre-processor ${also}defines the following symbols:"
15540 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
15542 cppsymbols=`$cat ccsym.cpp`
15543 cppsymbols=`echo $cppsymbols`
15544 $test "$silent" || sleep 1
15546 if $test -s ccsym.own; then
15547 $test "$also" && echo " "
15548 echo "Your C compiler ${also}defines the following cpp symbols:"
15549 $sed -e 's/\(..*\)=1/\1/' ccsym.own
15550 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
15551 ccsymbols=`$cat ccsym.own`
15552 ccsymbols=`echo $ccsymbols`
15553 $test "$silent" || sleep 1
15556 $rm -f ccsym* Cppsym.*
15558 : see if this is a termio system
15562 if $test `./findhdr termios.h`; then
15563 set tcsetattr i_termios
15569 "$define") echo "You have POSIX termios.h... good!" >&4;;
15570 *) if ./Cppsym pyr; then
15571 case "`/bin/universe`" in
15572 ucb) if $test `./findhdr sgtty.h`; then
15574 echo "<sgtty.h> found." >&4
15576 echo "System is pyramid with BSD universe."
15577 echo "<sgtty.h> not found--you could have problems." >&4
15579 *) if $test `./findhdr termio.h`; then
15581 echo "<termio.h> found." >&4
15583 echo "System is pyramid with USG universe."
15584 echo "<termio.h> not found--you could have problems." >&4
15588 if $test `./findhdr termio.h`; then
15589 echo "<termio.h> found." >&4
15591 elif $test `./findhdr sgtty.h`; then
15592 echo "<sgtty.h> found." >&4
15595 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
15598 if $test `./findhdr sgtty.h`; then
15599 echo "<sgtty.h> found." >&4
15601 elif $test `./findhdr termio.h`; then
15602 echo "<termio.h> found." >&4
15605 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
15609 set i_termio; eval $setvar
15610 val=$val2; set i_sgtty; eval $setvar
15611 val=$val3; set i_termios; eval $setvar
15613 : see if this is a shadow.h system
15614 set shadow.h i_shadow
15617 : see if stddef is available
15618 set stddef.h i_stddef
15621 : see if this is a sunmath.h system
15622 set sunmath.h i_sunmath
15625 : see if sys/access.h is available
15626 set sys/access.h i_sysaccess
15629 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
15630 set sys/filio.h i_sysfilio
15633 if $test `./findhdr sys/ioctl.h`; then
15635 echo '<sys/ioctl.h> found.' >&4
15638 if $test $i_sysfilio = "$define"; then
15639 echo '<sys/ioctl.h> NOT found.' >&4
15641 $test $i_sgtty = "$define" && xxx="sgtty.h"
15642 $test $i_termio = "$define" && xxx="termio.h"
15643 $test $i_termios = "$define" && xxx="termios.h"
15644 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
15650 : see if socket ioctl defs are in sys/sockio.h
15652 xxx=`./findhdr sys/sockio.h`
15653 if $test "$xxx"; then
15654 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
15656 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
15659 echo "No socket ioctls found in <sys/sockio.h>." >&4
15664 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
15671 : see if this is a syslog.h system
15672 set syslog.h i_syslog
15676 : see if this is a sys/mode.h system
15677 set sys/mode.h i_sysmode
15680 : see if sys/resource.h has to be included
15681 set sys/resource.h i_sysresrc
15684 : see if sys/security.h is available
15685 set sys/security.h i_syssecrt
15688 : see if this is a sys/statvfs.h system
15689 set sys/statvfs.h i_sysstatvfs
15692 : see if this is a sys/un.h system
15693 set sys/un.h i_sysun
15697 : see if this is a sys/utsname.h system
15698 set sys/utsname.h i_sysutsname
15701 : see if this is a syswait system
15702 set sys/wait.h i_syswait
15705 : see if this is a ustat.h system
15706 set ustat.h i_ustat
15709 : see if this is an utime system
15710 set utime.h i_utime
15713 : see if this is a values.h system
15714 set values.h i_values
15717 : see if this is a vfork system
15720 set vfork.h i_vfork
15728 : see if gdbm.h is available
15733 : see if gdbm_open exists
15734 set gdbm_open d_gdbm_open
15736 case "$d_gdbm_open" in
15739 echo "We won't be including <gdbm.h>"
15749 echo "Looking for extensions..." >&4
15750 : If we are using the old config.sh, known_extensions may contain
15751 : old or inaccurate or duplicate values.
15752 known_extensions=''
15753 nonxs_extensions=''
15754 : We do not use find because it might not be available.
15755 : We do not just use MANIFEST because the user may have dropped
15756 : some additional extensions into the source tree and expect them
15759 : Function to recursively find available extensions, ignoring DynaLoader
15760 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
15764 DynaLoader|dynaload) ;;
15766 if $test -f $xxx/$xxx.xs; then
15767 known_extensions="$known_extensions $1$xxx";
15768 elif $test -f $xxx/Makefile.PL; then
15769 nonxs_extensions="$nonxs_extensions $1$xxx";
15771 if $test -d $xxx -a $# -lt 10; then
15774 eval $find_extensions;
15786 eval $find_extensions
15787 set X $nonxs_extensions
15789 nonxs_extensions="$*"
15790 set X $known_extensions
15792 known_extensions="$*"
15795 : Now see which are supported on this system.
15797 for xxx in $known_extensions ; do
15801 $define) avail_ext="$avail_ext $xxx" ;;
15804 GDBM_File|gdbm_fil)
15806 $define) avail_ext="$avail_ext $xxx" ;;
15809 NDBM_File|ndbm_fil)
15812 case "$osname-$use64bitint" in
15815 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
15818 *) avail_ext="$avail_ext $xxx" ;;
15823 ODBM_File|odbm_fil)
15824 case "${i_dbm}${i_rpcsvcdbm}" in
15826 case "$osname-$use64bitint" in
15829 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
15832 *) avail_ext="$avail_ext $xxx" ;;
15838 case "$useposix" in
15839 true|define|y) avail_ext="$avail_ext $xxx" ;;
15843 case "$useopcode" in
15844 true|define|y) avail_ext="$avail_ext $xxx" ;;
15848 case "$d_socket" in
15849 true|$define|y) avail_ext="$avail_ext $xxx" ;;
15852 Sys/Syslog|sys/syslog)
15853 : XXX syslog requires socket
15854 case "$d_socket" in
15855 true|$define|y) avail_ext="$avail_ext $xxx" ;;
15859 case "$usethreads" in
15860 true|$define|y) avail_ext="$avail_ext $xxx" ;;
15864 : XXX Do we need a useipcsysv variable here
15865 case "${d_msg}${d_sem}${d_shm}" in
15866 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
15869 *) avail_ext="$avail_ext $xxx"
15878 : Now see which nonxs extensions are supported on this system.
15879 : For now assume all are.
15881 for xxx in $nonxs_extensions ; do
15883 *) nonxs_ext="$nonxs_ext $xxx"
15895 A number of extensions are supplied with $package. You may choose to
15896 compile these extensions for dynamic loading (the default), compile
15897 them into the $package executable (static loading), or not include
15898 them at all. Answer "none" to include no extensions.
15899 Note that DynaLoader is always built and need not be mentioned here.
15902 case "$dynamic_ext" in
15903 '') dflt="$avail_ext" ;;
15904 *) dflt="$dynamic_ext"
15905 # Perhaps we are reusing an old out-of-date config.sh.
15908 if test X"$dynamic_ext" != X"$avail_ext"; then
15910 NOTICE: Your previous config.sh list may be incorrect.
15911 The extensions now available to you are
15913 but the default list from your previous config.sh is
15925 rp="What extensions do you wish to load dynamically?"
15928 none) dynamic_ext=' ' ;;
15929 *) dynamic_ext="$ans" ;;
15932 case "$static_ext" in
15934 : Exclude those already listed in dynamic linking
15936 for xxx in $avail_ext; do
15937 case " $dynamic_ext " in
15939 *) dflt="$dflt $xxx" ;;
15946 *) dflt="$static_ext"
15953 rp="What extensions do you wish to load statically?"
15956 none) static_ext=' ' ;;
15957 *) static_ext="$ans" ;;
15962 A number of extensions are supplied with $package. Answer "none"
15963 to include no extensions.
15964 Note that DynaLoader is always built and need not be mentioned here.
15967 case "$static_ext" in
15968 '') dflt="$avail_ext" ;;
15969 *) dflt="$static_ext"
15970 # Perhaps we are reusing an old out-of-date config.sh.
15973 if test X"$static_ext" != X"$avail_ext"; then
15975 NOTICE: Your previous config.sh list may be incorrect.
15976 The extensions now available to you are
15978 but the default list from your previous config.sh is
15987 : Exclude those that are not xs extensions
15991 rp="What extensions do you wish to include?"
15994 none) static_ext=' ' ;;
15995 *) static_ext="$ans" ;;
16000 set X $dynamic_ext $static_ext $nonxs_ext
16004 : Remove libraries needed only for extensions
16005 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
16006 : The exception is SunOS 4.x, which needs them.
16007 case "${osname}X${osvers}" in
16011 *) case "$usedl" in
16012 $define|true|[yY]*)
16013 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
16017 *) perllibs="$libs"
16023 : Remove build directory name from cppstdin so it can be used from
16024 : either the present location or the final installed location.
16026 : Get out of the UU directory to get correct path name.
16028 case "$cppstdin" in
16030 echo "Stripping down cppstdin path name"
16036 : end of configuration questions
16038 echo "End of configuration questions."
16041 : back to where it started
16042 if test -d ../UU; then
16046 : configuration may be patched via a 'config.over' file
16047 if $test -f config.over; then
16050 rp='I see a config.over file. Do you wish to load it?'
16053 n*) echo "OK, I'll ignore it.";;
16055 echo "Configuration override changes have been loaded."
16060 : in case they want portability, strip down executable paths
16061 case "$d_portable" in
16064 echo "Stripping down executable paths..." >&4
16065 for file in $loclist $trylist; do
16067 eval $file=`basename $temp`
16072 : create config.sh file
16074 echo "Creating config.sh..." >&4
16075 $spitshell <<EOT >config.sh
16078 # This file was produced by running the Configure script. It holds all the
16079 # definitions figured out by Configure. Should you modify one of these values,
16080 # do not forget to propagate your changes by running "Configure -der". You may
16081 # instead choose to run each of the .SH files by yourself, or "Configure -S".
16084 # Package name : $package
16085 # Source directory : $src
16086 # Configuration time: $cf_time
16087 # Configured by : $cf_by
16088 # Target system : $myuname
16098 Revision='$Revision'
16106 alignbytes='$alignbytes'
16107 ansi2knr='$ansi2knr'
16108 aphostname='$aphostname'
16109 api_revision='$api_revision'
16110 api_subversion='$api_subversion'
16111 api_version='$api_version'
16112 api_versionstring='$api_versionstring'
16115 archlibexp='$archlibexp'
16116 archname64='$archname64'
16117 archname='$archname'
16118 archobjs='$archobjs'
16123 bincompat5005='$bincompat5005'
16127 byteorder='$byteorder'
16129 castflags='$castflags'
16132 cccdlflags='$cccdlflags'
16133 ccdlflags='$ccdlflags'
16135 ccflags_uselargefiles='$ccflags_uselargefiles'
16137 ccsymbols='$ccsymbols'
16138 ccversion='$ccversion'
16140 cf_email='$cf_email'
16142 charsize='$charsize'
16146 clocktype='$clocktype'
16148 compress='$compress'
16149 contains='$contains'
16153 cpp_stuff='$cpp_stuff'
16154 cppccsymbols='$cppccsymbols'
16155 cppflags='$cppflags'
16157 cppminus='$cppminus'
16159 cppstdin='$cppstdin'
16160 cppsymbols='$cppsymbols'
16161 crosscompile='$crosscompile'
16162 cryptlib='$cryptlib'
16164 d_Gconvert='$d_Gconvert'
16165 d_PRIEUldbl='$d_PRIEUldbl'
16166 d_PRIFUldbl='$d_PRIFUldbl'
16167 d_PRIGUldbl='$d_PRIGUldbl'
16168 d_PRIXU64='$d_PRIXU64'
16169 d_PRId64='$d_PRId64'
16170 d_PRIeldbl='$d_PRIeldbl'
16171 d_PRIfldbl='$d_PRIfldbl'
16172 d_PRIgldbl='$d_PRIgldbl'
16173 d_PRIi64='$d_PRIi64'
16174 d_PRIo64='$d_PRIo64'
16175 d_PRIu64='$d_PRIu64'
16176 d_PRIx64='$d_PRIx64'
16177 d_SCNfldbl='$d_SCNfldbl'
16178 d__fwalk='$d__fwalk'
16179 d_access='$d_access'
16180 d_accessx='$d_accessx'
16182 d_archlib='$d_archlib'
16185 d_attribut='$d_attribut'
16188 d_bincompat5005='$d_bincompat5005'
16190 d_bsdgetpgrp='$d_bsdgetpgrp'
16191 d_bsdsetpgrp='$d_bsdsetpgrp'
16193 d_casti32='$d_casti32'
16194 d_castneg='$d_castneg'
16195 d_charvspr='$d_charvspr'
16197 d_chroot='$d_chroot'
16198 d_chsize='$d_chsize'
16199 d_closedir='$d_closedir'
16200 d_cmsghdr_s='$d_cmsghdr_s'
16204 d_cuserid='$d_cuserid'
16205 d_dbl_dig='$d_dbl_dig'
16206 d_difftime='$d_difftime'
16207 d_dirnamlen='$d_dirnamlen'
16208 d_dlerror='$d_dlerror'
16209 d_dlopen='$d_dlopen'
16210 d_dlsymun='$d_dlsymun'
16211 d_dosuid='$d_dosuid'
16212 d_drand48proto='$d_drand48proto'
16214 d_eaccess='$d_eaccess'
16215 d_endgrent='$d_endgrent'
16216 d_endhent='$d_endhent'
16217 d_endnent='$d_endnent'
16218 d_endpent='$d_endpent'
16219 d_endpwent='$d_endpwent'
16220 d_endsent='$d_endsent'
16221 d_eofnblk='$d_eofnblk'
16222 d_eunice='$d_eunice'
16223 d_fchmod='$d_fchmod'
16224 d_fchown='$d_fchown'
16226 d_fcntl_can_lock='$d_fcntl_can_lock'
16227 d_fd_macros='$d_fd_macros'
16228 d_fd_set='$d_fd_set'
16229 d_fds_bits='$d_fds_bits'
16230 d_fgetpos='$d_fgetpos'
16231 d_flexfnam='$d_flexfnam'
16234 d_fpathconf='$d_fpathconf'
16235 d_fpos64_t='$d_fpos64_t'
16236 d_frexpl='$d_frexpl'
16237 d_fs_data_s='$d_fs_data_s'
16238 d_fseeko='$d_fseeko'
16239 d_fsetpos='$d_fsetpos'
16240 d_fstatfs='$d_fstatfs'
16241 d_fstatvfs='$d_fstatvfs'
16243 d_ftello='$d_ftello'
16245 d_getcwd='$d_getcwd'
16246 d_getespwnam='$d_getespwnam'
16247 d_getfsstat='$d_getfsstat'
16248 d_getgrent='$d_getgrent'
16249 d_getgrps='$d_getgrps'
16250 d_gethbyaddr='$d_gethbyaddr'
16251 d_gethbyname='$d_gethbyname'
16252 d_gethent='$d_gethent'
16253 d_gethname='$d_gethname'
16254 d_gethostprotos='$d_gethostprotos'
16255 d_getitimer='$d_getitimer'
16256 d_getlogin='$d_getlogin'
16257 d_getmnt='$d_getmnt'
16258 d_getmntent='$d_getmntent'
16259 d_getnbyaddr='$d_getnbyaddr'
16260 d_getnbyname='$d_getnbyname'
16261 d_getnent='$d_getnent'
16262 d_getnetprotos='$d_getnetprotos'
16263 d_getpagsz='$d_getpagsz'
16264 d_getpbyname='$d_getpbyname'
16265 d_getpbynumber='$d_getpbynumber'
16266 d_getpent='$d_getpent'
16267 d_getpgid='$d_getpgid'
16268 d_getpgrp2='$d_getpgrp2'
16269 d_getpgrp='$d_getpgrp'
16270 d_getppid='$d_getppid'
16271 d_getprior='$d_getprior'
16272 d_getprotoprotos='$d_getprotoprotos'
16273 d_getprpwnam='$d_getprpwnam'
16274 d_getpwent='$d_getpwent'
16275 d_getsbyname='$d_getsbyname'
16276 d_getsbyport='$d_getsbyport'
16277 d_getsent='$d_getsent'
16278 d_getservprotos='$d_getservprotos'
16279 d_getspnam='$d_getspnam'
16280 d_gettimeod='$d_gettimeod'
16281 d_gnulibc='$d_gnulibc'
16282 d_grpasswd='$d_grpasswd'
16283 d_hasmntopt='$d_hasmntopt'
16287 d_inetaton='$d_inetaton'
16288 d_int64_t='$d_int64_t'
16289 d_isascii='$d_isascii'
16291 d_isnanl='$d_isnanl'
16292 d_killpg='$d_killpg'
16293 d_lchown='$d_lchown'
16294 d_ldbl_dig='$d_ldbl_dig'
16296 d_locconv='$d_locconv'
16298 d_longdbl='$d_longdbl'
16299 d_longlong='$d_longlong'
16300 d_lseekproto='$d_lseekproto'
16302 d_madvise='$d_madvise'
16304 d_mbstowcs='$d_mbstowcs'
16305 d_mbtowc='$d_mbtowc'
16306 d_memchr='$d_memchr'
16307 d_memcmp='$d_memcmp'
16308 d_memcpy='$d_memcpy'
16309 d_memmove='$d_memmove'
16310 d_memset='$d_memset'
16312 d_mkdtemp='$d_mkdtemp'
16313 d_mkfifo='$d_mkfifo'
16314 d_mkstemp='$d_mkstemp'
16315 d_mkstemps='$d_mkstemps'
16316 d_mktime='$d_mktime'
16319 d_mprotect='$d_mprotect'
16321 d_msg_ctrunc='$d_msg_ctrunc'
16322 d_msg_dontroute='$d_msg_dontroute'
16323 d_msg_oob='$d_msg_oob'
16324 d_msg_peek='$d_msg_peek'
16325 d_msg_proxy='$d_msg_proxy'
16326 d_msgctl='$d_msgctl'
16327 d_msgget='$d_msgget'
16328 d_msghdr_s='$d_msghdr_s'
16329 d_msgrcv='$d_msgrcv'
16330 d_msgsnd='$d_msgsnd'
16332 d_munmap='$d_munmap'
16333 d_mymalloc='$d_mymalloc'
16335 d_nv_preserves_uv='$d_nv_preserves_uv'
16336 d_nv_preserves_uv_bits='$d_nv_preserves_uv_bits'
16337 d_off64_t='$d_off64_t'
16338 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
16339 d_oldpthreads='$d_oldpthreads'
16340 d_oldsock='$d_oldsock'
16342 d_pathconf='$d_pathconf'
16344 d_perl_otherlibdirs='$d_perl_otherlibdirs'
16345 d_phostname='$d_phostname'
16348 d_portable='$d_portable'
16349 d_pthread_yield='$d_pthread_yield'
16351 d_pwchange='$d_pwchange'
16352 d_pwclass='$d_pwclass'
16353 d_pwcomment='$d_pwcomment'
16354 d_pwexpire='$d_pwexpire'
16355 d_pwgecos='$d_pwgecos'
16356 d_pwpasswd='$d_pwpasswd'
16357 d_pwquota='$d_pwquota'
16360 d_readdir='$d_readdir'
16361 d_readlink='$d_readlink'
16363 d_recvmsg='$d_recvmsg'
16364 d_rename='$d_rename'
16365 d_rewinddir='$d_rewinddir'
16367 d_safebcpy='$d_safebcpy'
16368 d_safemcpy='$d_safemcpy'
16369 d_sanemcmp='$d_sanemcmp'
16370 d_sbrkproto='$d_sbrkproto'
16371 d_sched_yield='$d_sched_yield'
16372 d_scm_rights='$d_scm_rights'
16373 d_seekdir='$d_seekdir'
16374 d_select='$d_select'
16376 d_semctl='$d_semctl'
16377 d_semctl_semid_ds='$d_semctl_semid_ds'
16378 d_semctl_semun='$d_semctl_semun'
16379 d_semget='$d_semget'
16381 d_sendmsg='$d_sendmsg'
16382 d_setegid='$d_setegid'
16383 d_seteuid='$d_seteuid'
16384 d_setgrent='$d_setgrent'
16385 d_setgrps='$d_setgrps'
16386 d_sethent='$d_sethent'
16387 d_setitimer='$d_setitimer'
16388 d_setlinebuf='$d_setlinebuf'
16389 d_setlocale='$d_setlocale'
16390 d_setnent='$d_setnent'
16391 d_setpent='$d_setpent'
16392 d_setpgid='$d_setpgid'
16393 d_setpgrp2='$d_setpgrp2'
16394 d_setpgrp='$d_setpgrp'
16395 d_setprior='$d_setprior'
16396 d_setproctitle='$d_setproctitle'
16397 d_setpwent='$d_setpwent'
16398 d_setregid='$d_setregid'
16399 d_setresgid='$d_setresgid'
16400 d_setresuid='$d_setresuid'
16401 d_setreuid='$d_setreuid'
16402 d_setrgid='$d_setrgid'
16403 d_setruid='$d_setruid'
16404 d_setsent='$d_setsent'
16405 d_setsid='$d_setsid'
16406 d_setvbuf='$d_setvbuf'
16410 d_shmatprototype='$d_shmatprototype'
16411 d_shmctl='$d_shmctl'
16413 d_shmget='$d_shmget'
16414 d_sigaction='$d_sigaction'
16415 d_sigprocmask='$d_sigprocmask'
16416 d_sigsetjmp='$d_sigsetjmp'
16417 d_sockatmark='$d_sockatmark'
16418 d_socket='$d_socket'
16419 d_socklen_t='$d_socklen_t'
16420 d_sockpair='$d_sockpair'
16421 d_socks5_init='$d_socks5_init'
16423 d_statblks='$d_statblks'
16424 d_statfs_f_flags='$d_statfs_f_flags'
16425 d_statfs_s='$d_statfs_s'
16426 d_statvfs='$d_statvfs'
16427 d_stdio_cnt_lval='$d_stdio_cnt_lval'
16428 d_stdio_ptr_lval='$d_stdio_ptr_lval'
16429 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
16430 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
16431 d_stdio_stream_array='$d_stdio_stream_array'
16432 d_stdiobase='$d_stdiobase'
16433 d_stdstdio='$d_stdstdio'
16434 d_strchr='$d_strchr'
16435 d_strcoll='$d_strcoll'
16436 d_strctcpy='$d_strctcpy'
16437 d_strerrm='$d_strerrm'
16438 d_strerror='$d_strerror'
16439 d_strftime='$d_strftime'
16440 d_strtod='$d_strtod'
16441 d_strtol='$d_strtol'
16442 d_strtold='$d_strtold'
16443 d_strtoll='$d_strtoll'
16444 d_strtoq='$d_strtoq'
16445 d_strtoul='$d_strtoul'
16446 d_strtoull='$d_strtoull'
16447 d_strtouq='$d_strtouq'
16448 d_strxfrm='$d_strxfrm'
16449 d_suidsafe='$d_suidsafe'
16450 d_symlink='$d_symlink'
16451 d_syscall='$d_syscall'
16452 d_sysconf='$d_sysconf'
16453 d_sysernlst='$d_sysernlst'
16454 d_syserrlst='$d_syserrlst'
16455 d_system='$d_system'
16456 d_tcgetpgrp='$d_tcgetpgrp'
16457 d_tcsetpgrp='$d_tcsetpgrp'
16458 d_telldir='$d_telldir'
16459 d_telldirproto='$d_telldirproto'
16462 d_truncate='$d_truncate'
16463 d_tzname='$d_tzname'
16464 d_u32align='$d_u32align'
16465 d_ualarm='$d_ualarm'
16468 d_union_semun='$d_union_semun'
16469 d_usleep='$d_usleep'
16471 d_vendorarch='$d_vendorarch'
16472 d_vendorbin='$d_vendorbin'
16473 d_vendorlib='$d_vendorlib'
16475 d_void_closedir='$d_void_closedir'
16476 d_voidsig='$d_voidsig'
16477 d_voidtty='$d_voidtty'
16478 d_volatile='$d_volatile'
16479 d_vprintf='$d_vprintf'
16481 d_waitpid='$d_waitpid'
16482 d_wcstombs='$d_wcstombs'
16483 d_wctomb='$d_wctomb'
16484 d_writev='$d_writev'
16487 db_hashtype='$db_hashtype'
16488 db_prefixtype='$db_prefixtype'
16489 defvoidused='$defvoidused'
16490 direntrytype='$direntrytype'
16493 doublesize='$doublesize'
16495 dynamic_ext='$dynamic_ext'
16501 eunicefix='$eunicefix'
16504 extensions='$extensions'
16505 fflushNULL='$fflushNULL'
16506 fflushall='$fflushall'
16508 firstmakefile='$firstmakefile'
16510 fpossize='$fpossize'
16511 fpostype='$fpostype'
16512 freetype='$freetype'
16514 full_csh='$full_csh'
16515 full_sed='$full_sed'
16516 gccosandvers='$gccosandvers'
16517 gccversion='$gccversion'
16518 gidformat='$gidformat'
16524 groupcat='$groupcat'
16525 groupstype='$groupstype'
16528 h_sysfile='$h_sysfile'
16539 i_arpainet='$i_arpainet'
16540 i_bsdioctl='$i_bsdioctl'
16543 i_dirent='$i_dirent'
16551 i_ieeefp='$i_ieeefp'
16552 i_inttypes='$i_inttypes'
16553 i_libutil='$i_libutil'
16554 i_limits='$i_limits'
16555 i_locale='$i_locale'
16556 i_machcthr='$i_machcthr'
16557 i_malloc='$i_malloc'
16559 i_memory='$i_memory'
16560 i_mntent='$i_mntent'
16563 i_neterrno='$i_neterrno'
16564 i_netinettcp='$i_netinettcp'
16568 i_pthread='$i_pthread'
16570 i_rpcsvcdbm='$i_rpcsvcdbm'
16573 i_shadow='$i_shadow'
16575 i_stdarg='$i_stdarg'
16576 i_stddef='$i_stddef'
16577 i_stdlib='$i_stdlib'
16578 i_string='$i_string'
16579 i_sunmath='$i_sunmath'
16580 i_sysaccess='$i_sysaccess'
16581 i_sysdir='$i_sysdir'
16582 i_sysfile='$i_sysfile'
16583 i_sysfilio='$i_sysfilio'
16585 i_sysioctl='$i_sysioctl'
16586 i_syslog='$i_syslog'
16587 i_sysmman='$i_sysmman'
16588 i_sysmode='$i_sysmode'
16589 i_sysmount='$i_sysmount'
16590 i_sysndir='$i_sysndir'
16591 i_sysparam='$i_sysparam'
16592 i_sysresrc='$i_sysresrc'
16593 i_syssecrt='$i_syssecrt'
16594 i_sysselct='$i_sysselct'
16595 i_syssockio='$i_syssockio'
16596 i_sysstat='$i_sysstat'
16597 i_sysstatfs='$i_sysstatfs'
16598 i_sysstatvfs='$i_sysstatvfs'
16599 i_systime='$i_systime'
16600 i_systimek='$i_systimek'
16601 i_systimes='$i_systimes'
16602 i_systypes='$i_systypes'
16603 i_sysuio='$i_sysuio'
16605 i_sysutsname='$i_sysutsname'
16606 i_sysvfs='$i_sysvfs'
16607 i_syswait='$i_syswait'
16608 i_termio='$i_termio'
16609 i_termios='$i_termios'
16611 i_unistd='$i_unistd'
16614 i_values='$i_values'
16615 i_varargs='$i_varargs'
16616 i_varhdr='$i_varhdr'
16618 ignore_versioned_solibs='$ignore_versioned_solibs'
16619 inc_version_list='$inc_version_list'
16620 inc_version_list_init='$inc_version_list_init'
16623 installarchlib='$installarchlib'
16624 installbin='$installbin'
16625 installman1dir='$installman1dir'
16626 installman3dir='$installman3dir'
16627 installprefix='$installprefix'
16628 installprefixexp='$installprefixexp'
16629 installprivlib='$installprivlib'
16630 installscript='$installscript'
16631 installsitearch='$installsitearch'
16632 installsitebin='$installsitebin'
16633 installsitelib='$installsitelib'
16634 installstyle='$installstyle'
16635 installusrbinperl='$installusrbinperl'
16636 installvendorarch='$installvendorarch'
16637 installvendorbin='$installvendorbin'
16638 installvendorlib='$installvendorlib'
16640 issymlink='$issymlink'
16641 ivdformat='$ivdformat'
16644 known_extensions='$known_extensions'
16647 lddlflags='$lddlflags'
16649 ldflags_uselargefiles='$ldflags_uselargefiles'
16650 ldlibpthname='$ldlibpthname'
16657 libsdirs='$libsdirs'
16658 libsfiles='$libsfiles'
16659 libsfound='$libsfound'
16660 libspath='$libspath'
16661 libswanted='$libswanted'
16662 libswanted_uselargefiles='$libswanted_uselargefiles'
16668 locincpth='$locincpth'
16669 loclibpth='$loclibpth'
16670 longdblsize='$longdblsize'
16671 longlongsize='$longlongsize'
16672 longsize='$longsize'
16676 lseeksize='$lseeksize'
16677 lseektype='$lseektype'
16681 make_set_make='$make_set_make'
16682 mallocobj='$mallocobj'
16683 mallocsrc='$mallocsrc'
16684 malloctype='$malloctype'
16686 man1direxp='$man1direxp'
16689 man3direxp='$man3direxp'
16691 mips_type='$mips_type'
16693 mmaptype='$mmaptype'
16694 modetype='$modetype'
16696 multiarch='$multiarch'
16698 myarchname='$myarchname'
16699 mydomain='$mydomain'
16700 myhostname='$myhostname'
16703 need_va_copy='$need_va_copy'
16704 netdb_hlen_type='$netdb_hlen_type'
16705 netdb_host_type='$netdb_host_type'
16706 netdb_name_type='$netdb_name_type'
16707 netdb_net_type='$netdb_net_type'
16710 nm_so_opt='$nm_so_opt'
16711 nonxs_ext='$nonxs_ext'
16713 nvEUformat='$nvEUformat'
16714 nvFUformat='$nvFUformat'
16715 nvGUformat='$nvGUformat'
16716 nveformat='$nveformat'
16717 nvfformat='$nvfformat'
16718 nvgformat='$nvgformat'
16721 o_nonblock='$o_nonblock'
16723 old_pthread_create_joinable='$old_pthread_create_joinable'
16724 optimize='$optimize'
16725 orderlib='$orderlib'
16728 otherlibdirs='$otherlibdirs'
16732 patchlevel='$patchlevel'
16733 path_sep='$path_sep'
16736 perl_patchlevel='$perl_patchlevel'
16737 perladmin='$perladmin'
16738 perllibs='$perllibs'
16739 perlpath='$perlpath'
16741 phostname='$phostname'
16744 pm_apiversion='$pm_apiversion'
16748 prefixexp='$prefixexp'
16750 privlibexp='$privlibexp'
16751 prototype='$prototype'
16753 quadkind='$quadkind'
16754 quadtype='$quadtype'
16755 randbits='$randbits'
16756 randfunc='$randfunc'
16757 randseedtype='$randseedtype'
16759 rd_nodata='$rd_nodata'
16760 revision='$revision'
16764 sPRIEUldbl='$sPRIEUldbl'
16765 sPRIFUldbl='$sPRIFUldbl'
16766 sPRIGUldbl='$sPRIGUldbl'
16767 sPRIXU64='$sPRIXU64'
16769 sPRIeldbl='$sPRIeldbl'
16770 sPRIfldbl='$sPRIfldbl'
16771 sPRIgldbl='$sPRIgldbl'
16776 sSCNfldbl='$sSCNfldbl'
16777 sched_yield='$sched_yield'
16778 scriptdir='$scriptdir'
16779 scriptdirexp='$scriptdirexp'
16781 seedfunc='$seedfunc'
16782 selectminbits='$selectminbits'
16783 selecttype='$selecttype'
16784 sendmail='$sendmail'
16787 sharpbang='$sharpbang'
16788 shmattype='$shmattype'
16789 shortsize='$shortsize'
16792 sig_count='$sig_count'
16793 sig_name='$sig_name'
16794 sig_name_init='$sig_name_init'
16796 sig_num_init='$sig_num_init'
16797 sig_size='$sig_size'
16798 signal_t='$signal_t'
16799 sitearch='$sitearch'
16800 sitearchexp='$sitearchexp'
16802 sitebinexp='$sitebinexp'
16804 sitelib_stem='$sitelib_stem'
16805 sitelibexp='$sitelibexp'
16806 siteprefix='$siteprefix'
16807 siteprefixexp='$siteprefixexp'
16808 sizesize='$sizesize'
16809 sizetype='$sizetype'
16813 sockethdr='$sockethdr'
16814 socketlib='$socketlib'
16815 socksizetype='$socksizetype'
16817 spackage='$spackage'
16818 spitshell='$spitshell'
16820 ssizetype='$ssizetype'
16821 startperl='$startperl'
16823 static_ext='$static_ext'
16825 stdio_base='$stdio_base'
16826 stdio_bufsiz='$stdio_bufsiz'
16827 stdio_cnt='$stdio_cnt'
16828 stdio_filbuf='$stdio_filbuf'
16829 stdio_ptr='$stdio_ptr'
16830 stdio_stream_array='$stdio_stream_array'
16833 subversion='$subversion'
16840 timeincl='$timeincl'
16841 timetype='$timetype'
16854 uidformat='$uidformat'
16860 uquadtype='$uquadtype'
16861 use5005threads='$use5005threads'
16862 use64bitall='$use64bitall'
16863 use64bitint='$use64bitint'
16865 useithreads='$useithreads'
16866 uselargefiles='$uselargefiles'
16867 uselongdouble='$uselongdouble'
16868 usemorebits='$usemorebits'
16869 usemultiplicity='$usemultiplicity'
16870 usemymalloc='$usemymalloc'
16872 useopcode='$useopcode'
16873 useperlio='$useperlio'
16874 useposix='$useposix'
16876 useshrplib='$useshrplib'
16877 usesocks='$usesocks'
16878 usethreads='$usethreads'
16879 usevendorprefix='$usevendorprefix'
16880 usevfork='$usevfork'
16883 uvXUformat='$uvXUformat'
16884 uvoformat='$uvoformat'
16887 uvuformat='$uvuformat'
16888 uvxformat='$uvxformat'
16889 vendorarch='$vendorarch'
16890 vendorarchexp='$vendorarchexp'
16891 vendorbin='$vendorbin'
16892 vendorbinexp='$vendorbinexp'
16893 vendorlib='$vendorlib'
16894 vendorlib_stem='$vendorlib_stem'
16895 vendorlibexp='$vendorlibexp'
16896 vendorprefix='$vendorprefix'
16897 vendorprefixexp='$vendorprefixexp'
16899 versiononly='$versiononly'
16901 voidflags='$voidflags'
16903 xs_apiversion='$xs_apiversion'
16905 yaccflags='$yaccflags'
16910 : Add in command line options if available
16911 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
16913 : add special variables
16914 $test -f $src/patchlevel.h && \
16915 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
16916 echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
16917 echo "PERL_CONFIG_SH=true" >>config.sh
16919 : propagate old symbols
16920 if $test -f UU/config.sh; then
16921 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
16922 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
16923 $sort | $uniq -u >UU/oldsyms
16924 set X `cat UU/oldsyms`
16930 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
16932 echo "# Variables propagated from previous config.sh file." >>config.sh
16933 for sym in `cat UU/oldsyms`; do
16934 echo " Propagating $hint variable "'$'"$sym..."
16935 eval 'tmp="$'"${sym}"'"'
16937 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
16943 : Finish up by extracting the .SH files
16957 If you'd like to make any changes to the config.sh file before I begin
16958 to configure things, do it as a shell escape now (e.g. !vi config.sh).
16961 rp="Press return or use a shell escape to edit config.sh:"
16966 *) : in case they cannot read
16967 sh 1>&4 -c "$ans";;
16972 : if this fails, just run all the .SH files by hand
16979 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
16986 Now you need to generate make dependencies by running "$make depend".
16987 You might prefer to run it in background: "$make depend > makedepend.out &"
16988 It can take a while, so you might not want to run it right now.
16993 rp="Run $make depend now?"
16997 $make depend && echo "Now you must run '$make'."
17000 echo "You must run '$make depend' then '$make'."
17003 elif test -f [Mm]akefile; then
17005 echo "Now you must run a $make."
17010 if $test -f Policy.sh; then
17013 If you compile $package on a different machine or from a different object
17014 directory, copy the Policy.sh file from this object directory to the
17015 new one before you run Configure -- this will help you with most of
17016 the policy defaults.
17020 if $test -f config.msg; then
17021 echo "Hmm. I also noted the following information while running:"
17023 $cat config.msg >&4
17026 $rm -f kit*isdone ark*isdone