3 # If these # comments don't work, trim them. Don't worry about any other
4 # shell scripts, Configure will trim # comments from them for you.
6 # (If you are trying to port this package to a machine without sh,
7 # I would suggest you have a look at the prototypical config_h.SH file
8 # and edit it to reflect your system. Some packages may include samples
9 # of config.h for certain machines, so you might look for one of those.)
11 # Yes, you may rip this off to use in other distribution packages. This
12 # script belongs to the public domain and cannot be copyrighted.
14 # (Note: this Configure script was generated automatically. Rather than
15 # working with this copy of Configure, you may wish to get metaconfig.
16 # The dist-3.0 package (which contains metaconfig) was posted in
17 # comp.sources.misc and is available on CPAN under authors/id/RAM so
18 # you may fetch it yourself from your nearest archive site.)
21 # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
23 # Generated on Fri Apr 28 23:33:15 EET DST 2000 [metaconfig 3.0 PL70]
24 # (with additional metaconfig patches by perlbug@perl.com)
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...
43 true || cat /tmp/c1$$ /tmp/c2$$
44 true || exec sh $0 $argv:q
46 (exit $?0) || cat /tmp/c2$$
47 (exit $?0) || exec sh $0 $argv:q
48 rm -f /tmp/c1$$ /tmp/c2$$
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
459 d_old_pthread_create_joinable=''
460 old_pthread_create_joinable=''
702 inc_version_list_init=''
720 ignore_versioned_solibs=''
782 d_perl_otherlibdirs=''
889 d_stdio_stream_array=''
890 stdio_stream_array=''
941 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
944 : We must find out about Eunice early
946 if test -f /etc/unixtovms; then
947 eunicefix=/etc/unixtovms
949 if test -f /etc/unixtovms.exe; then
950 eunicefix=/etc/unixtovms.exe
954 : set useposix=false in your hint file to disable the POSIX extension.
956 : set useopcode=false in your hint file to disable the Opcode extension.
958 : Trailing extension. Override this in a hint file, if needed.
960 : Extra object files, if any, needed on this platform.
962 : Possible local include directories to search.
963 : Set locincpth to "" in a hint file to defeat local include searches.
964 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
965 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
967 : no include file wanted by default
971 : change the next line if compiling for Xenix/286 on Xenix/386
972 xlibpth='/usr/lib/386 /lib/386'
973 : Possible local library directories to search.
974 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
975 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
977 : general looking path for locating libraries
978 glibpth="/usr/lib/large /lib /usr/lib $xlibpth"
979 glibpth="$glibpth /lib/large /usr/lib/small /lib/small"
980 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
981 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
982 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
984 : Private path used by Configure to find libraries. Its value
985 : is prepended to libpth. This variable takes care of special
986 : machines, like the mips. Usually, it should be empty.
989 : default library list
991 : some systems want to use only the non-versioned libso:s
992 ignore_versioned_solibs=''
993 : set usemultiplicity on the Configure command line to enable multiplicity.
994 : set usesocks on the Configure command line to enable socks.
995 : set usethreads on the Configure command line to enable threads.
996 : full support for void wanted by default
999 : List of libraries we want.
1000 : If anyone needs -lnet, put it in a hint file.
1001 libswanted='sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl'
1002 libswanted="$libswanted dld ld sun m c cposix posix"
1003 libswanted="$libswanted ndir dir crypt sec"
1004 libswanted="$libswanted ucb bsd BSD PW x iconv"
1005 : We probably want to search /usr/shlib before most other libraries.
1006 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1007 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1008 glibpth="/usr/shlib $glibpth"
1009 : Do not use vfork unless overridden by a hint file.
1012 : Find the basic shell for Bourne shell scripts
1016 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1019 if test -f "$xxx"; then
1022 : Build up a list and do a single loop so we can 'break' out.
1023 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1024 for xxx in sh bash ksh pdksh ash; do
1026 try="$try ${p}/${xxx}"
1030 if test -f "$xxx"; then
1033 elif test -f "$xxx.exe"; then
1044 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1046 Usually it's in /bin/sh. How did you even get this far?
1047 Please contact me (Perl Maintainers) at perlbug@perl.com and
1048 we'll try to straighten this all out.
1054 : see if sh knows # comments
1055 if `$sh -c '#' >/dev/null 2>&1`; then
1059 test -f $xcat || xcat=/usr/bin/cat
1064 if test -s today; then
1067 echo "#! $xcat" > try
1071 if test -s today; then
1079 echo "Your $sh doesn't grok # comments--I will strip them later on."
1082 echo "exec grep -v '^[ ]*#'" >spitshell
1084 $eunicefix spitshell
1085 spitshell=`pwd`/spitshell
1087 echo "I presume that if # doesn't work, #! won't work either!"
1092 : figure out how to guarantee sh startup
1094 '') startsh=${sharpbang}${sh} ;;
1106 : echo "Yup, it does."
1108 echo "Hmm... '$startsh' does not guarantee sh startup..."
1109 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1114 : Save command line options in file UU/cmdline.opt for later use in
1115 : generating config.sh.
1116 cat > cmdline.opt <<EOSH
1117 # Configure command line arguments.
1124 cat >>cmdline.opt <<EOSH
1125 config_arg$argn='$arg'
1127 argn=`expr $argn + 1`
1130 : produce awk script to parse command line options
1131 cat >options.awk <<'EOF'
1133 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1135 len = length(optstr);
1136 for (i = 1; i <= len; i++) {
1137 c = substr(optstr, i, 1);
1138 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1149 if (substr(str, 1, 1) != "-") {
1150 printf("'%s'\n", str);
1154 for (i = 2; i <= len; i++) {
1155 c = substr(str, i, 1);
1157 printf("-%s\n", substr(str, i));
1163 printf("'%s'\n", substr(str, i + 1));
1176 : process the command line options
1177 set X `for arg in "$@"; do echo "X$arg"; done |
1178 sed -e s/X// | awk -f options.awk`
1183 : set up default values
1193 rm -f optdef.sh posthint.sh
1194 cat >optdef.sh <<EOS
1200 while test $# -gt 0; do
1202 -d) shift; fastread=yes;;
1203 -e) shift; alldone=cont;;
1207 if test -r "$1"; then
1210 echo "$me: cannot read config file $1." >&2
1215 -h) shift; error=true;;
1216 -r) shift; reuseval=true;;
1217 -s) shift; silent=true; realsilent=true;;
1218 -E) shift; alldone=exit;;
1219 -K) shift; knowitall=true;;
1220 -O) shift; override=true;;
1221 -S) shift; silent=true; extractsh=true;;
1226 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1227 echo "$me: ignoring -D $1" >&2
1230 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1231 *) echo "$1='define'" >> optdef.sh;;
1238 *=) echo "$1" >> optdef.sh;;
1240 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1241 echo "$me: ignoring -U $1" >&2
1243 *) echo "$1='undef'" >> optdef.sh;;
1254 *=*) zzz=`echo $yyy|sed 's!=.*!!'`
1258 zzz=" "`echo $yyy|sed 's!^[^=]*=!!'`
1259 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1265 *:*) xxx=`echo $yyy|sed 's!:.*!!'`
1266 yyy=`echo $yyy|sed 's!^[^:]*:!!'`
1267 zzz=`echo $yyy|sed 's!^[^=]*=!!'`
1268 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1269 *) xxx=`echo $yyy|sed 's!:.*!!'`
1270 yyy=`echo $yyy|sed 's!^[^:]*:!!'` ;;
1276 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1278 echo "$yyy=''" >> posthint.sh ;;
1283 echo "$yyy='$zzz'" >> posthint.sh ;;
1285 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1287 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1292 echo "$yyy=$zzz" >> posthint.sh ;;
1293 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1297 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1300 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1308 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1309 [-U symbol] [-U symbol=] [-A command:symbol...]
1310 -d : use defaults for all answers.
1311 -e : go on without questioning past the production of config.sh.
1312 -f : specify an alternate default configuration file.
1313 -h : print this help message and exit (with an error status).
1314 -r : reuse C symbols value if possible (skips costly nm extraction).
1315 -s : silent mode, only echoes questions and essential information.
1316 -D : define symbol to have some value:
1317 -D symbol symbol gets the value 'define'
1318 -D symbol=value symbol gets the value 'value'
1319 -E : stop at the end of questions, after having produced config.sh.
1320 -K : do not use unless you know what you are doing.
1321 -O : let -D and -U override definitions from loaded configuration file.
1322 -S : perform variable substitutions on all .SH files (can mix with -f)
1323 -U : undefine symbol:
1324 -U symbol symbol gets the value 'undef'
1325 -U symbol= symbol gets completely empty
1326 -A : manipulate symbol after the platform specific hints have been applied:
1327 -A symbol=value append " "value to symbol
1328 -A append:symbol=value append value to symbol
1329 -A define:symbol=value define symbol to have value
1330 -A clear:symbol define symbol to be ''
1331 -A define:symbol define symbol to be 'define'
1332 -A eval:symbol=value define symbol to be eval of value
1333 -A prepend:symbol=value prepend value to symbol
1334 -A undef:symbol define symbol to be 'undef'
1335 -A undef:symbol= define symbol to be ''
1336 -V : print version number and exit (with a zero status).
1343 case "$fastread$alldone" in
1346 case "$extractsh" in
1349 if test ! -t 0; then
1350 echo "Say 'sh Configure', not 'sh <Configure'"
1360 true) exec 1>/dev/null;;
1363 : run the defines and the undefines, if any, but leave the file out there...
1366 : create the posthint manipulation script and leave the file out there...
1371 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1372 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1373 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1374 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1375 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1378 : Some greps do not return status, grrr.
1379 echo "grimblepritz" >grimble
1380 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1382 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1388 : the following should work in any shell
1392 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1393 cat >contains <<'EOSS'
1394 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1399 : Find the path to the source tree
1402 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1405 *) src=`cd ../$src && pwd` ;;
1418 if test -f $rsrc/Configure && \
1419 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1421 : found it, so we are ok.
1424 for src in . .. ../.. ../../.. ../../../..; do
1425 if test -f ../$src/Configure && \
1426 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1437 Sorry, I can't seem to locate the source dir for $package. Please start
1438 Configure with an explicit path -- i.e. /some/path/Configure.
1446 echo "Sources for $package found in \"$src\"." >&4
1450 : script used to extract .SH files with variable substitutions
1451 cat >extract <<'EOS'
1453 echo "Doing variable substitutions on .SH files..."
1454 if test -f $src/MANIFEST; then
1455 set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH$'`
1457 echo "(Looking for .SH files under the source directory.)"
1458 set x `(cd $src; find . -name "*.SH" -print)`
1462 0) set x `(cd $src; echo *.SH)`; shift;;
1464 if test ! -f $src/$1; then
1470 while test $name; do
1471 if test ! -d "$name"; then
1472 create="$name $create";
1473 name=`echo $name | sed -e "s|^[^/]*$||"`;
1474 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1479 for file in $create; do
1488 dir=`expr X$file : 'X\(.*\)/'`
1489 file=`expr X$file : 'X.*/\(.*\)'`
1490 (cd $dir && . ./$file)
1500 dir=`expr X$file : 'X\(.*\)/'`
1501 file=`expr X$file : 'X.*/\(.*\)'`
1502 (set x $dir; shift; eval $mkdir_p)
1512 if test -f $src/config_h.SH; then
1513 if test ! -f config.h; then
1514 : oops, they left it out of MANIFEST, probably, so do it anyway.
1520 : extract files and exit if asked to do so
1521 case "$extractsh" in
1523 case "$realsilent" in
1527 case "$config_sh" in
1528 '') config_sh='config.sh';;
1531 echo "Fetching answers from $config_sh..."
1534 test "$override" && . ./optdef.sh
1543 : Eunice requires " " instead of "", can you believe it
1546 echo "Beginning of configuration questions for $package."
1548 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1550 : first determine how to suppress newline on echo command
1552 echo "Checking echo to see how to suppress newlines..."
1553 (echo "hi there\c" ; echo " ") >.echotmp
1554 if $contains c .echotmp >/dev/null 2>&1 ; then
1565 echo $n "The star should be here-->$c"
1569 : Now test for existence of everything in MANIFEST
1571 if test -f $rsrc/MANIFEST; then
1572 echo "First let's make sure your kit is complete. Checking..." >&4
1573 awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
1576 for filelist in x??; do
1577 (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
1579 if test -s missing; then
1583 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1585 You have the option of continuing the configuration process, despite the
1586 distinct possibility that your kit is damaged, by typing 'y'es. If you
1587 do, don't blame me if something goes wrong. I advise you to type 'n'o
1588 and contact the author (perlbug@perl.com).
1591 echo $n "Continue? [n] $c" >&4
1595 echo "Continuing..." >&4
1599 echo "ABORTING..." >&4
1604 echo "Looks good..."
1607 echo "There is no MANIFEST file. I hope your kit is complete !"
1612 : Find the appropriate value for a newline for tr
1613 if test -n "$DJGPP"; then
1616 if test X"$trnl" = X; then
1617 case "`echo foo|tr '\n' x 2>/dev/null`" in
1621 if test X"$trnl" = X; then
1622 case "`echo foo|tr '\012' x 2>/dev/null`" in
1623 foox) trnl='\012' ;;
1626 if test X"$trnl" = X; then
1629 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1635 : compute the number of columns on the terminal for proper question formatting
1640 : set up the echo used in my read
1641 myecho="case \"\$xxxm\" in
1642 '') echo $n \"\$rp $c\" >&4;;
1644 '') echo $n \"[\$xxxm] $c\";;
1646 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1648 echo $n \"[\$xxxm] $c\" >&4
1650 echo $n \"\$rp [\$xxxm] $c\" >&4
1656 : now set up to do reads with possible shell escape and default assignment
1662 case "\$fastread" in
1663 yes) case "\$dflt" in
1666 case "\$silent-\$rp" in
1671 *) case "\$silent" in
1672 true) case "\$rp" in
1677 while expr "X\$ans" : "X!" >/dev/null; do
1681 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1689 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1698 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1703 echo "(OK, I'll run with -d after this question.)" >&4
1706 echo "*** Sorry, \$1 not supported yet." >&4
1716 echo "*** Substitution done -- please confirm."
1718 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1723 echo "*** Error -- try again."
1730 case "\$ans\$xxxm\$nostick" in
1742 : create .config dir to save info across Configure sessions
1743 test -d ../.config || mkdir ../.config
1744 cat >../.config/README <<EOF
1745 This directory created by Configure to save information that should
1746 persist across sessions for $package.
1748 You may safely delete it if you wish.
1751 : general instructions
1754 user=`(logname) 2>/dev/null`
1756 '') user=`whoami 2>&1`;;
1758 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1761 rp='Would you like to see the instructions?'
1772 This installation shell script will examine your system and ask you questions
1773 to determine how the perl5 package should be installed. If you get
1774 stuck on a question, you may use a ! shell escape to start a subshell or
1775 execute a command. Many of the questions will have default answers in square
1776 brackets; typing carriage return will give you the default.
1778 On some of the questions which ask for file or directory names you are allowed
1779 to use the ~name construct to specify the login directory belonging to "name",
1780 even if you don't have a shell which knows about that. Questions where this is
1781 allowed will be marked "(~name ok)".
1785 dflt='Type carriage return to continue'
1789 The prompter used in this script allows you to use shell variables and
1790 backticks in your answers. You may use $1, $2, etc... to refer to the words
1791 in the default answer, as if the default line was a set of arguments given to a
1792 script shell. This means you may also use $* to repeat the whole default line,
1793 so you do not have to re-type everything to add something to the default.
1795 Everytime there is a substitution, you will have to confirm. If there is an
1796 error (e.g. an unmatched backtick), the default answer will remain unchanged
1797 and you will be prompted again.
1799 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1800 the questions and use the computed defaults (or the previous answers if there
1801 was already a config.sh file). Type 'Configure -h' for a list of options.
1802 You may also start interactively and then answer '& -d' at any prompt to turn
1803 on the non-interactive behaviour for the remainder of the execution.
1809 Much effort has been expended to ensure that this shell script will run on any
1810 Unix system. If despite that it blows up on yours, your best bet is to edit
1811 Configure and run it again. If you can't run Configure for some reason,
1812 you'll have to generate a config.sh file by hand. Whatever problems you
1813 have, let me (perlbug@perl.com) know how I blew it.
1815 This installation script affects things in two ways:
1817 1) it may do direct variable substitutions on some of the files included
1819 2) it builds a config.h file for inclusion in C programs. You may edit
1820 any of these files as the need arises after running this script.
1822 If you make a mistake on a question, there is no easy way to back up to it
1823 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1824 files. Configure will offer to let you do this before it runs the SH files.
1827 dflt='Type carriage return to continue'
1829 case "$firsttime" in
1830 true) echo $user >>../.config/instruct;;
1834 : find out where common programs are
1836 echo "Locating common programs..." >&4
1849 if test -d \$dir/\$thing; then
1855 for thisthing in \$dir/\$thing; do
1856 : just loop through to pick last item
1858 if test -f \$thisthing; then
1861 elif test -f \$dir/\$thing.exe; then
1862 if test -n "$DJGPP"; then
1863 echo \$dir/\$thing.exe
1865 : on Eunice apparently
1915 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1916 pth="$pth /lib /usr/lib"
1917 for file in $loclist; do
1921 if test -f "$xxx"; then
1924 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1925 xxx=`./loc $file $file $pth`
1928 '') xxx=`./loc $file $file $pth`;;
1929 *) xxx=`./loc $xxx $xxx $pth`;;
1935 echo $file is in $xxx.
1938 echo $file is in $xxx.
1941 echo "I don't know where '$file' is, and my life depends on it." >&4
1942 echo "Go find a public domain implementation or fix your PATH setting!" >&4
1948 echo "Don't worry if any of the following aren't found..."
1950 for file in $trylist; do
1954 if test -f "$xxx"; then
1957 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1958 xxx=`./loc $file $file $pth`
1961 '') xxx=`./loc $file $file $pth`;;
1962 *) xxx=`./loc $xxx $xxx $pth`;;
1968 echo $file is in $xxx.
1971 echo $file is in $xxx.
1974 echo "I don't see $file out there, $say."
1981 echo "Substituting grep for egrep."
1987 echo "Substituting cp for ln."
1993 echo "Hopefully test is built into your sh."
1996 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
1997 echo "Using the test built into your sh."
2005 echo "Hopefully echo is built into your sh."
2010 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2011 $echo $n "hi there$c" >foo1
2012 echo $n "hi there$c" >foo2
2013 if cmp foo1 foo2 >/dev/null 2>&1; then
2014 echo "They are compatible. In fact, they may be identical."
2021 They are not compatible! You are probably running ksh on a non-USG system.
2022 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2023 have echo built in and we may have to run some Bourne shell scripts. That
2024 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2027 $echo $n "The star should be here-->$c"
2034 : determine whether symbolic links are supported
2037 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2038 echo "Symbolic links are supported." >&4
2041 echo "Symbolic links are NOT supported." >&4
2046 : see whether [:lower:] and [:upper:] are supported character classes
2048 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2050 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2054 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
2055 # (0xc9 and 0xd1), therefore that is a nice testing point.
2056 if test "X$up" = X -o "X$low" = X; then
2057 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
2063 if test "X$up" = X -o "X$low" = X; then
2064 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
2070 if test "X$up" = X -o "X$low" = X; then
2071 case "`echo IJ | od -x 2>/dev/null`" in
2073 echo "Hey, this might be EBCDIC." >&4
2074 if test "X$up" = X -o "X$low" = X; then
2075 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2076 ij) up='[A-IJ-RS-Z]'
2081 if test "X$up" = X -o "X$low" = X; then
2082 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2092 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
2094 echo "Using $up and $low to convert case." >&4
2097 echo "I don't know how to translate letters from upper to lower case." >&4
2098 echo "Your tr is not acting any way I know of." >&4
2102 : set up the translation script tr, must be called with ./tr of course
2106 '[A-Z][a-z]') exec $tr '$up' '$low';;
2107 '[a-z][A-Z]') exec $tr '$low' '$up';;
2114 : Try to determine whether config.sh was made on this system
2115 case "$config_sh" in
2117 myuname=`$uname -a 2>/dev/null`
2118 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2119 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2120 # because the A-Z/a-z are not consecutive.
2121 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2122 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2123 newmyuname="$myuname"
2125 case "$knowitall" in
2127 if test -f ../config.sh; then
2128 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2129 eval "`grep myuname= ../config.sh`"
2131 if test "X$myuname" = "X$newmyuname"; then
2139 : Get old answers from old config file if Configure was run on the
2140 : same system, otherwise use the hints.
2143 if test -f config.sh; then
2145 rp="I see a config.sh file. Shall I use it to set the defaults?"
2148 n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;;
2149 *) echo "Fetching default answers from your old config.sh file..." >&4
2157 : Older versions did not always set $sh. Catch re-use of such
2166 if test ! -f config.sh; then
2169 First time through, eh? I have some defaults handy for some systems
2170 that need some extra help getting the Configure answers right:
2173 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2175 : Half the following guesses are probably wrong... If you have better
2176 : tests or hints, please send them to perlbug@perl.com
2177 : The metaconfig authors would also appreciate a copy...
2178 $test -f /irix && osname=irix
2179 $test -f /xenix && osname=sco_xenix
2180 $test -f /dynix && osname=dynix
2181 $test -f /dnix && osname=dnix
2182 $test -f /lynx.os && osname=lynxos
2183 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2184 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
2185 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2186 $test -f /bin/mips && /bin/mips && osname=mips
2187 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
2188 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
2189 $test -d /usr/apollo/bin && osname=apollo
2190 $test -f /etc/saf/_sactab && osname=svr4
2191 $test -d /usr/include/minix && osname=minix
2192 if $test -d /MachTen -o -d /MachTen_Folder; then
2194 if $test -x /sbin/version; then
2195 osvers=`/sbin/version | $awk '{print $2}' |
2196 $sed -e 's/[A-Za-z]$//'`
2197 elif $test -x /usr/etc/version; then
2198 osvers=`/usr/etc/version | $awk '{print $2}' |
2199 $sed -e 's/[A-Za-z]$//'`
2205 $test -f /sys/posix.dll &&
2206 $test -f /usr/bin/what &&
2207 set X `/usr/bin/what /sys/posix.dll` &&
2208 $test "$3" = UWIN &&
2212 if $test -f $uname; then
2220 umips) osname=umips ;;
2223 [23]100) osname=mips ;;
2224 next*) osname=next ;;
2226 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
2227 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
2230 elif $test -f /etc/kconfig; then
2232 if test "$lns" = "$ln -s"; then
2234 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
2236 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
2243 if test -n "$DJGPP"; then
2252 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
2254 'not found') osvers="$4"."$3" ;;
2255 '<3240'|'<>3240') osvers=3.2.0 ;;
2256 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
2257 '=3250'|'>3250') osvers=3.2.5 ;;
2261 bsd386) osname=bsd386
2264 cygwin*) osname=cygwin
2267 *dc.osx) osname=dcosx
2273 domainos) osname=apollo
2279 dynixptx*) osname=dynixptx
2280 osvers=`echo "$4"|sed 's/^v//'`
2282 freebsd) osname=freebsd
2284 genix) osname=genix ;;
2286 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
2302 netbsd*) osname=netbsd
2305 news-os) osvers="$3"
2307 4*) osname=newsos4 ;;
2311 next*) osname=next ;;
2312 POSIX-BC | posix-bc ) osname=posix-bc
2315 powerux | power_ux | powermax_os | powermaxos | \
2316 powerunix | power_unix) osname=powerux
2322 solaris) osname=solaris
2324 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2331 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2335 titanos) osname=titanos
2344 ultrix) osname=ultrix
2347 osf1|mls+) case "$5" in
2350 osvers=`echo "$3" | sed 's/^[xvt]//'`
2352 hp*) osname=hp_osf1 ;;
2353 mips) osname=mips_osf1 ;;
2356 unixware) osname=svr5
2362 $2) case "$osname" in
2366 : svr4.x or possibly later
2376 if test -f /stand/boot ; then
2377 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
2378 if test -n "$INITPROG" -a -f "$INITPROG"; then
2379 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
2380 if test -n "$isesix"; then
2388 *) if test -f /etc/systemid; then
2390 set `echo $3 | $sed 's/\./ /g'` $4
2391 if $test -f $src/hints/sco_$1_$2_$3.sh; then
2393 elif $test -f $src/hints/sco_$1_$2.sh; then
2395 elif $test -f $src/hints/sco_$1.sh; then
2400 '') : Still unknown. Probably a generic Sys V.
2409 *) case "$osname" in
2410 '') : Still unknown. Probably a generic BSD.
2418 if test -f /vmunix -a -f $src/hints/news_os.sh; then
2419 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
2420 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
2423 $rm -f UU/kernel.what
2424 elif test -d c:/.; then
2431 : Now look for a hint file osname_osvers, unless one has been
2432 : specified already.
2435 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
2436 : Also try without trailing minor version numbers.
2437 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
2438 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
2439 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
2440 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
2443 *) case "$osvers" in
2446 *) if $test -f $src/hints/$file.sh ; then
2448 elif $test -f $src/hints/$xfile.sh ; then
2450 elif $test -f $src/hints/$xxfile.sh ; then
2452 elif $test -f $src/hints/$xxxfile.sh ; then
2454 elif $test -f $src/hints/$xxxxfile.sh ; then
2456 elif $test -f "$src/hints/${osname}.sh" ; then
2465 if $test -f Policy.sh ; then
2468 none) dflt="Policy" ;;
2469 *) dflt="Policy $dflt" ;;
2474 dflt=`echo $hintfile | $sed 's/\.sh$//'`
2478 if $test -f Policy.sh ; then
2481 There's also a Policy hint file available, which should make the
2482 site-specific (policy) questions easier to answer.
2489 You may give one or more space-separated answers, or "none" if appropriate.
2490 A well-behaved OS will have no hints, so answering "none" or just "Policy"
2491 is a good thing. DO NOT give a wrong version or a wrong OS.
2495 rp="Which of these apply, if any?"
2498 for file in $tans; do
2499 if $test X$file = XPolicy -a -f Policy.sh; then
2501 $cat Policy.sh >> UU/config.sh
2502 elif $test -f $src/hints/$file.sh; then
2503 . $src/hints/$file.sh
2504 $cat $src/hints/$file.sh >> UU/config.sh
2505 elif $test X$tans = X -o X$tans = Xnone ; then
2508 : Give one chance to correct a possible typo.
2509 echo "$file.sh does not exist"
2511 rp="hint to use instead?"
2513 for file in $ans; do
2514 if $test -f "$src/hints/$file.sh"; then
2515 . $src/hints/$file.sh
2516 $cat $src/hints/$file.sh >> UU/config.sh
2517 elif $test X$ans = X -o X$ans = Xnone ; then
2520 echo "$file.sh does not exist -- ignored."
2527 : Remember our hint file for later.
2528 if $test -f "$src/hints/$file.sh" ; then
2538 echo "Fetching default answers from $config_sh..." >&4
2542 cp $config_sh config.sh 2>/dev/null
2552 test "$override" && . ./optdef.sh
2553 myuname="$newmyuname"
2555 : Restore computed paths
2556 for file in $loclist $trylist; do
2557 eval $file="\$_$file"
2562 Configure uses the operating system name and version to set some defaults.
2563 The default value is probably right if the name rings a bell. Otherwise,
2564 since spelling matters for me, either accept the default or answer "none"
2571 ''|' '|none) dflt=none ;;
2572 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
2575 *) dflt="$osname" ;;
2577 rp="Operating system name?"
2581 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
2587 ''|' '|none) dflt=none ;;
2588 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
2589 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
2591 ''|' ') dflt=none ;;
2596 *) dflt="$osvers" ;;
2598 rp="Operating system version?"
2608 : who configured the system
2609 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
2610 cf_by=`(logname) 2>/dev/null`
2613 cf_by=`(whoami) 2>/dev/null`
2615 "") cf_by=unknown ;;
2619 : set up the script used to warn in case of inconsistency
2626 echo "*** WHOA THERE!!! ***" >&4
2627 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2628 rp=" Keep the $hint value?"
2631 y) td=$was; tu=$was;;
2635 : function used to set $1 to $val
2636 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2638 $define$undef) . ./whoa; eval "$var=\$td";;
2639 $undef$define) . ./whoa; eval "$var=\$tu";;
2640 *) eval "$var=$val";;
2643 case "$usethreads" in
2644 $define|true|[yY]*) dflt='y';;
2649 Perl can be built to take advantage of threads on some systems.
2650 To do so, Configure can be run with -Dusethreads.
2652 Note that threading is a highly experimental feature, and
2653 some known race conditions still remain. If you choose to try
2654 it, be very sure to not actually deploy it for production
2655 purposes. README.threads has more details, and is required
2656 reading if you enable threads.
2658 If this doesn't make any sense to you, just accept the default '$dflt'.
2660 rp='Build a threading Perl?'
2663 y|Y) val="$define" ;;
2669 case "$usethreads" in
2673 As of 5.5.640, Perl has two different internal threading implementations,
2674 the 5.005 version (5005threads) and an interpreter-based version
2675 (ithreads) that has one interpreter per thread. Both are very
2676 experimental. This arrangement exists to help developers work out
2677 which one is better.
2679 If you're a casual user, you probably don't want interpreter-threads
2680 at this time. There doesn't yet exist a way to create threads from
2681 within Perl in this model, i.e., "use Thread;" will NOT work.
2683 : Default to ithreads unless overridden on command line or with
2686 case "$use5005threads" in
2687 $define|true|[yY]*) dflt='n';;
2689 case "$useithreads" in
2690 $undef|false|[nN]*) dflt='n';;
2692 rp='Use interpreter-based ithreads?'
2695 y|Y) val="$define" ;;
2700 : Now set use5005threads to the opposite value.
2701 case "$useithreads" in
2702 $define) val="$undef" ;;
2709 useithreads="$undef"
2710 use5005threads="$undef"
2714 case "$d_oldpthreads" in
2715 '') : Configure tests would be welcome here. For now, assume undef.
2717 *) val="$d_oldpthreads" ;;
2723 case "$usethreads" in
2724 "$define"|true|[yY]*)
2725 : Look for a hint-file generated 'call-back-unit'. If the
2726 : user has specified that a threading perl is to be built,
2727 : we may need to set or change some other defaults.
2728 if $test -f usethreads.cbu; then
2729 echo "Your platform has some specific hints for threaded builds, using them..."
2733 (Your platform doesn't have any specific hints for threaded builds.
2734 Assuming POSIX threads, then.)
2742 Perl can be built so that multiple Perl interpreters can coexist
2743 within the same Perl executable.
2746 case "$useithreads" in
2749 This multiple interpreter support is required for interpreter-based threads.
2753 *) case "$usemultiplicity" in
2754 $define|true|[yY]*) dflt='y';;
2758 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
2759 rp='Build Perl for multiplicity?'
2762 y|Y) val="$define" ;;
2770 : determine where manual pages are on this system
2774 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
2775 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
2776 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
2777 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
2778 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
2779 sysman=`./loc . /usr/man/man1 $syspath`
2782 if $test -d "$sysman"; then
2783 echo "System manual is in $sysman." >&4
2785 echo "Could not find manual pages in source form." >&4
2788 : see what memory models we can support
2791 $cat >pdp11.c <<'EOP'
2800 ( cc -o pdp11 pdp11.c ) >/dev/null 2>&1
2801 if $test -f pdp11 && ./pdp11 2>/dev/null; then
2802 dflt='unsplit split'
2804 tans=`./loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge`
2807 *) if $test -d /lib/small || $test -d /usr/lib/small; then
2812 if $test -d /lib/medium || $test -d /usr/lib/medium; then
2815 if $test -d /lib/large || $test -d /usr/lib/large; then
2818 if $test -d /lib/huge || $test -d /usr/lib/huge; then
2827 Some systems have different model sizes. On most systems they are called
2828 small, medium, large, and huge. On the PDP11 they are called unsplit and
2829 split. If your system doesn't support different memory models, say "none".
2830 If you wish to force everything to one memory model, say "none" here and
2831 put the appropriate flags later when it asks you for other cc and ld flags.
2832 Venix systems may wish to put "none" and let the compiler figure things out.
2833 (In the following question multiple model names should be space separated.)
2835 The default for most systems is "none".
2838 rp="Which memory models are supported?"
2853 '') if $contains '\-i' $sysman/ld.1 >/dev/null 2>&1 || \
2854 $contains '\-i' $sysman/cc.1 >/dev/null 2>&1; then
2861 rp="What flag indicates separate I and D space?"
2869 *large*|*small*|*medium*|*huge*)
2876 rp="What flag indicates large model?"
2886 *huge*) case "$huge" in
2890 rp="What flag indicates huge model?"
2900 *medium*) case "$medium" in
2904 rp="What flag indicates medium model?"
2911 *) medium="$large";;
2914 *small*) case "$small" in
2918 rp="What flag indicates small model?"
2929 echo "Unrecognized memory models--you may have to edit Makefile.SH" >&4
2932 $rm -f pdp11.* pdp11
2934 : make some quick guesses about what we are up against
2936 $echo $n "Hmm... $c"
2946 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
2947 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
2949 echo "Looks kind of like an OSF/1 system, but we'll see..."
2951 elif test `echo abc | tr a-z A-Z` = Abc ; then
2952 xxx=`./loc addbib blurfl $pth`
2953 if $test -f $xxx; then
2954 echo "Looks kind of like a USG system with BSD features, but we'll see..."
2958 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
2959 echo "Looks kind of like an extended USG system, but we'll see..."
2961 echo "Looks kind of like a USG system, but we'll see..."
2965 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
2966 echo "Looks kind of like a BSD system, but we'll see..."
2970 echo "Looks kind of like a Version 7 system, but we'll see..."
2973 case "$eunicefix" in
2976 There is, however, a strange, musty smell in the air that reminds me of
2977 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
2981 : it so happens the Eunice I know will not run shell scripts in Unix format
2985 echo "Congratulations. You aren't running Eunice."
2989 : Detect OS2. The p_ variable is set above in the Head.U unit.
2994 I have the feeling something is not exactly right, however...don't tell me...
2995 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
3000 if test -f /xenix; then
3001 echo "Actually, this looks more like a XENIX system..."
3006 echo "It's not Xenix..."
3011 if test -f /venix; then
3012 echo "Actually, this looks more like a VENIX system..."
3019 echo "Nor is it Venix..."
3022 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3023 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3026 : see if we need a special compiler
3034 *) if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then
3035 if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then
3049 On some older systems the default C compiler will not resolve multiple global
3050 references that happen to have the same name. On some such systems the "Mcc"
3051 command may be used to force these to be resolved. On other systems a "cc -M"
3052 command is required. (Note that the -M flag on other systems indicates a
3053 memory model to use!) If you have the Gnu C compiler, you might wish to use
3059 rp="Use which C compiler?"
3067 rp="Use which C compiler?"
3071 : Look for a hint-file generated 'call-back-unit'. Now that the
3072 : user has specified the compiler, we may need to set or change some
3074 if $test -f cc.cbu; then
3078 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3079 $cat >gccvers.c <<EOM
3084 printf("%s\n", __VERSION__);
3086 printf("%s\n", "1");
3092 if $cc $ldflags -o gccvers gccvers.c; then
3093 gccversion=`./gccvers`
3094 case "$gccversion" in
3095 '') echo "You are not using GNU cc." ;;
3096 *) echo "You are using GNU cc $gccversion."
3101 echo "*** WHOA THERE!!! ***" >&4
3102 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3103 case "$knowitall" in
3105 echo " You'd better start hunting for one and let me know about it." >&4
3111 case "$gccversion" in
3112 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3115 : decide how portable to be. Allow command line overrides.
3116 case "$d_portable" in
3118 *) d_portable="$define" ;;
3121 : set up shell script to do ~ expansion
3127 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3130 if $test -f /bin/csh; then
3131 /bin/csh -f -c "glob \$1"
3136 name=\`$expr x\$1 : '..\([^/]*\)'\`
3137 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3138 if $test ! -d "\$dir"; then
3140 echo "\$me: can't locate home directory for: \$name" >&2
3145 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3161 : now set up to get a file name
3165 cat <<'EOSC' >>getfile
3181 expr $fn : '.*(\(.*\)).*' | tr ',' $trnl >getfile.ok
3182 fn=`echo $fn | sed 's/(.*)//'`
3188 loc_file=`expr $fn : '.*:\(.*\)'`
3189 fn=`expr $fn : '\(.*\):.*'`
3197 */*) fullpath=true;;
3206 *e*) exp_file=true;;
3209 *p*) nopath_ok=true;;
3214 *d*) type='Directory';;
3215 *l*) type='Locate';;
3220 Locate) what='File';;
3225 case "$d_portable" in
3233 while test "$type"; do
3238 true) rp="$rp (~name ok)";;
3241 if test -f UU/getfile.ok && \
3242 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3261 value=`UU/filexp $ans`
3264 if test "$ans" != "$value"; then
3265 echo "(That expands to $value on this system.)"
3279 /*) value="$ansexp" ;;
3284 echo "I shall only accept a full path name, as in /bin/ls." >&4
3285 echo "Use a ! shell escape if you wish to check pathnames." >&4
3288 echo "Please give a full path name, starting with slash." >&4
3291 echo "Note that using ~name is ok provided it expands well." >&4
3304 for fp in $gfpth; do
3305 if test "X$fp" = X.; then
3310 if test -f "$pf"; then
3312 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3314 echo "($value is not a plain file, but that's ok.)"
3317 if test X"$type" = X; then
3324 for fp in $gfpth; do
3325 if test "X$fp" = X.; then
3330 direxp="$fp/$ansexp"
3332 if test -d "$direxp"; then
3340 if test -d "$ansexp"; then
3341 echo "(Looking for $loc_file in directory $value.)"
3342 value="$value/$loc_file"
3343 ansexp="$ansexp/$loc_file"
3345 if test -f "$ansexp"; then
3348 case "$nopath_ok" in
3349 true) case "$value" in
3351 *) echo "Assuming $value will be in people's path."
3367 if test "$fastread" = yes; then
3372 rp="$what $value doesn't exist. Use that name anyway?"
3391 test "X$gfpthkeep" != Xy && gfpth=""
3394 : What should the include directory be ?
3396 $echo $n "Hmm... $c"
3400 if $test -f /bin/mips && /bin/mips; then
3401 echo "Looks like a MIPS system..."
3402 $cat >usr.c <<'EOCP'
3403 #ifdef SYSTYPE_BSD43
3407 if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3408 dflt='/bsd43/usr/include'
3412 mips_type='System V'
3414 $rm -f usr.c usr.out
3415 echo "and you're compiling with the $mips_type compiler and libraries."
3419 echo "Doesn't look like a MIPS system."
3429 case "$xxx_prompt" in
3432 rp='Where are the include files you want to use?'
3440 : see how we invoke the C preprocessor
3442 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3443 cat <<'EOT' >testcpp.c
3449 if test ! -f cppstdin; then
3450 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
3451 # AIX cc -E doesn't show the absolute headerfile
3452 # locations but we'll cheat by using the -M flag.
3453 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
3455 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3458 echo "Keeping your $hint cppstdin wrapper."
3461 wrapper=`pwd`/cppstdin
3465 if $test "X$cppstdin" != "X" && \
3466 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3467 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3469 echo "You used to use $cppstdin $cppminus so we'll use that again."
3471 '') echo "But let's see if we can live without a wrapper..." ;;
3473 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3474 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3476 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3479 echo "(However, $cpprun $cpplast does not work, let's see...)"
3487 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3494 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3495 $cc -E <testcpp.c >testcpp.out 2>&1; \
3496 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3497 echo "Yup, it does."
3500 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
3501 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3502 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3503 echo "Yup, it does."
3506 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
3507 $cc -P <testcpp.c >testcpp.out 2>&1; \
3508 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3509 echo "Yipee, that works!"
3512 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
3513 $cc -P - <testcpp.c >testcpp.out 2>&1; \
3514 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3515 echo "At long last!"
3518 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
3519 $cpp <testcpp.c >testcpp.out 2>&1; \
3520 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3524 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
3525 $cpp - <testcpp.c >testcpp.out 2>&1; \
3526 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3527 echo "Hooray, it works! I was beginning to wonder."
3530 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
3531 $wrapper <testcpp.c >testcpp.out 2>&1; \
3532 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3538 rp="No dice. I can't find a C preprocessor. Name one:"
3542 $x_cpp <testcpp.c >testcpp.out 2>&1
3543 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3544 echo "OK, that will do." >&4
3546 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
3561 echo "Perhaps can we force $cc -E using a wrapper..."
3562 if $wrapper <testcpp.c >testcpp.out 2>&1; \
3563 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3569 echo "Nope, we'll have to live without it..."
3583 "$wrapper"|'cppstdin') ;;
3584 *) $rm -f $wrapper;;
3586 $rm -f testcpp.c testcpp.out
3588 : Set private lib path
3591 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
3596 '') dlist="$loclibpth $plibpth $glibpth";;
3597 *) dlist="$libpth";;
3600 : Now check and see which directories actually exist, avoiding duplicates
3604 if $test -d $xxx; then
3607 *) libpth="$libpth $xxx";;
3613 Some systems have incompatible or broken versions of libraries. Among
3614 the directories listed in the question below, please remove any you
3615 know not to be holding relevant libraries, and add any that are needed.
3616 Say "none" for none.
3627 rp="Directories to use for library searches?"
3634 : compute shared library extension
3637 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
3647 On some systems, shared libraries may be available. Answer 'none' if
3648 you want to suppress searching of shared libraries for the remainder
3649 of this configuration.
3652 rp='What is the file extension used for shared libraries?'
3656 : Define several unixisms.
3657 : Hints files or command line option can be used to override them.
3658 : The convoluted testing is in case hints files set either the old
3661 '') case "$exe_ext" in
3663 *) _exe="$exe_ext" ;;
3668 '') case "$lib_ext" in
3675 '') case "$obj_ext" in
3682 '') case "$path_sep" in
3693 : Which makefile gets called first. This is used by make depend.
3694 case "$firstmakefile" in
3695 '') firstmakefile='makefile';;
3699 $define|true|[yY]*) dflt='y';;
3704 Perl can be built to use the SOCKS proxy protocol library. To do so,
3705 Configure must be run with -Dusesocks.
3707 If this doesn't make any sense to you, just accept the default '$dflt'.
3709 rp='Build Perl for SOCKS?'
3712 y|Y) val="$define" ;;
3718 : Looking for optional libraries
3720 echo "Checking for optional libraries..." >&4
3725 case "$libswanted" in
3726 '') libswanted='c_s';;
3729 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
3735 for thisdir in $libpth $xlibpth; do
3736 test -d $thisdir && libspath="$libspath $thisdir"
3738 for thislib in $libswanted; do
3739 for thisdir in $libspath; do
3741 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
3742 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|tail -1`
3743 $test -f "$xxx" && eval $libscheck
3744 $test -f "$xxx" && libstyle=shared
3746 if test ! -f "$xxx"; then
3747 xxx=$thisdir/lib$thislib.$so
3748 $test -f "$xxx" && eval $libscheck
3749 $test -f "$xxx" && libstyle=shared
3751 if test ! -f "$xxx"; then
3752 xxx=$thisdir/lib$thislib$_a
3753 $test -f "$xxx" && eval $libscheck
3754 $test -f "$xxx" && libstyle=static
3756 if test ! -f "$xxx"; then
3757 xxx=$thisdir/$thislib$_a
3758 $test -f "$xxx" && eval $libscheck
3759 $test -f "$xxx" && libstyle=static
3761 if test ! -f "$xxx"; then
3762 xxx=$thisdir/lib${thislib}_s$_a
3763 $test -f "$xxx" && eval $libscheck
3764 $test -f "$xxx" && libstyle=static
3765 $test -f "$xxx" && thislib=${thislib}_s
3767 if test ! -f "$xxx"; then
3768 xxx=$thisdir/Slib$thislib$_a
3769 $test -f "$xxx" && eval $libscheck
3770 $test -f "$xxx" && libstyle=static
3772 if $test -f "$xxx"; then
3774 shared) echo "Found -l$thislib (shared)." ;;
3775 static) echo "Found -l$thislib." ;;
3776 *) echo "Found -l$thislib ($libstyle)." ;;
3780 *) dflt="$dflt -l$thislib"
3781 libsfound="$libsfound $xxx"
3783 libsfiles="$libsfiles $yyy"
3784 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
3785 case " $libsdirs " in
3787 *) libsdirs="$libsdirs $yyy" ;;
3794 if $test ! -f "$xxx"; then
3795 echo "No -l$thislib."
3806 ' '|'') dflt='none';;
3811 In order to compile $package on your machine, a number of libraries
3812 are usually needed. Include any other special libraries here as well.
3813 Say "none" for none. The default list is almost always right.
3817 rp="What libraries to use?"
3824 : determine optimization, if desired, or use for debug flag also
3826 ' '|$undef) dflt='none';;
3828 *) dflt="$optimize";;
3832 By default, $package compiles with the -O flag to use the optimizer.
3833 Alternately, you might want to use the symbolic debugger, which uses
3834 the -g flag (on traditional Unix systems). Either flag can be
3835 specified here. To use neither flag, specify the word "none".
3838 rp="What optimizer/debugger flag should be used?"
3842 'none') optimize=" ";;
3846 : We will not override a previous value, but we might want to
3847 : augment a hint file
3849 default|recommended)
3850 case "$gccversion" in
3851 1*) dflt='-fpcc-struct-return' ;;
3854 *-g*) dflt="$dflt -DDEBUGGING";;
3856 case "$gccversion" in
3857 2*) if test -d /etc/conf/kconfig.d &&
3858 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
3864 case "$gccversion" in
3868 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
3869 echo 'int main(void) { return 0; }' > gcctest.c
3870 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
3871 echo "Yes, it does." 2>&1
3874 echo "Leaving current flags $ccflags alone." 2>&1
3876 *) dflt="$dflt -fno-strict-aliasing" ;;
3879 echo "Nope, it doesn't, but that's ok." 2>&1
3886 case "$mips_type" in
3887 *BSD*|'') inclwanted="$locincpth $usrinc";;
3888 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
3890 for thisincl in $inclwanted; do
3891 if $test -d $thisincl; then
3892 if $test x$thisincl != x$usrinc; then
3895 *) dflt="$dflt -I$thisincl";;
3901 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
3903 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
3911 *) dflt="$dflt -D$2";;
3915 set signal.h LANGUAGE_C; eval $inctest
3919 ccflags="$ccflags -DSOCKS"
3924 default|recommended) dflt="$ccflags $dflt" ;;
3925 *) dflt="$ccflags";;
3933 Your C compiler may want other flags. For this question you should include
3934 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
3935 but you should NOT include libraries or ld flags like -lwhatever. If you
3936 want $package to honor its debug switch, you should include -DDEBUGGING here.
3937 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
3939 To use no flags, specify the word "none".
3945 rp="Any additional cc flags?"
3952 : the following weeds options from ccflags that are of no interest to cpp
3954 case "$gccversion" in
3955 1*) cppflags="$cppflags -D__GNUC__"
3957 case "$mips_type" in
3959 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
3965 echo "Let me guess what the preprocessor flags are..." >&4
3979 *) ftry="$previous $flag";;
3981 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
3982 >cpp1.out 2>/dev/null && \
3983 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
3984 >cpp2.out 2>/dev/null && \
3985 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
3986 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
3988 cppflags="$cppflags $ftry"
3998 *-*) echo "They appear to be: $cppflags";;
4000 $rm -f cpp.c cpp?.out
4004 : flags used in final linking phase
4006 '') if ./venix; then
4012 *-posix*) dflt="$dflt -posix" ;;
4015 *) dflt="$ldflags";;
4018 : Try to guess additional flags to pick up local libraries.
4019 for thislibdir in $libpth; do
4020 case " $loclibpth " in
4023 *"-L$thislibdir "*) ;;
4024 *) dflt="$dflt -L$thislibdir" ;;
4036 Your C linker may need flags. For this question you should
4037 include -L/whatever and any other flags used by the C linker, but you
4038 should NOT include libraries like -lwhatever.
4040 Make sure you include the appropriate -L/path flags if your C linker
4041 does not normally search all of the directories you specified above,
4044 To use no flags, specify the word "none".
4048 rp="Any additional ld flags (NOT including libraries)?"
4054 rmlist="$rmlist pdp11"
4058 echo "Checking your choice of C compiler and flags for coherency..." >&4
4059 $cat > try.c <<'EOF'
4061 int main() { printf("Ok\n"); exit(0); }
4063 set X $cc $optimize $ccflags -o try $ldflags try.c $libs
4065 $cat >try.msg <<'EOM'
4066 I've tried to compile and run the following simple program:
4069 $cat try.c >> try.msg
4071 $cat >> try.msg <<EOM
4078 and I got the following output:
4082 if sh -c "$cc $optimize $ccflags -o try $ldflags try.c $libs" >>try.msg 2>&1; then
4083 if sh -c './try' >>try.msg 2>&1; then
4087 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4090 cat >> try.msg <<'EOQS'
4091 If $libs contains -lsfio, and sfio is mis-configured, then it
4092 sometimes (apparently) runs and exits with a 0 status, but with no
4093 output! It may have to do with sfio's use of _exit vs. exit.
4096 rp="You have a big problem. Shall I abort Configure"
4103 echo "The program compiled OK, but exited with status $?." >>try.msg
4104 rp="You have a problem. Shall I abort Configure"
4108 echo "I can't compile the test program." >>try.msg
4109 rp="You have a BIG problem. Shall I abort Configure"
4115 case "$knowitall" in
4117 echo "(The supplied flags or libraries might be incorrect.)"
4125 *) echo "Ok. Stopping Configure." >&4
4130 n) echo "OK, that should do.";;
4132 $rm -f try try.* core
4134 : define an is-a-typedef? function
4135 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
4137 "") inclist="sys/types.h";;
4139 eval "varval=\$$var";
4143 for inc in $inclist; do
4144 echo "#include <$inc>" >>temp.c;
4146 echo "#ifdef $type" >> temp.c;
4147 echo "printf(\"We have $type\");" >> temp.c;
4148 echo "#endif" >> temp.c;
4149 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
4150 if $contains $type temp.E >/dev/null 2>&1; then
4156 *) eval "$var=\$varval";;
4159 : define an is-a-typedef? function that prompts if the type is not available.
4160 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
4162 "") inclist="sys/types.h";;
4164 eval "varval=\$$var";
4168 for inc in $inclist; do
4169 echo "#include <$inc>" >>temp.c;
4171 echo "#ifdef $type" >> temp.c;
4172 echo "printf(\"We have $type\");" >> temp.c;
4173 echo "#endif" >> temp.c;
4174 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
4176 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
4177 if $contains $type temp.E >/dev/null 2>&1; then
4178 echo "$type found." >&4;
4181 echo "$type NOT found." >&4;
4187 *) eval "$var=\$varval";;
4190 : define a shorthand compile call
4194 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs > /dev/null 2>&1;'
4195 : define a shorthand compile call for compilations that should be ok.
4199 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs;'
4201 : check for lengths of integral types
4205 echo "Checking to see how big your integers are..." >&4
4206 $cat >intsize.c <<'EOCP'
4210 printf("intsize=%d;\n", (int)sizeof(int));
4211 printf("longsize=%d;\n", (int)sizeof(long));
4212 printf("shortsize=%d;\n", (int)sizeof(short));
4217 if eval $compile_ok && ./intsize > /dev/null; then
4219 echo "Your integers are $intsize bytes long."
4220 echo "Your long integers are $longsize bytes long."
4221 echo "Your short integers are $shortsize bytes long."
4225 Help! I can't compile and run the intsize test program: please enlighten me!
4226 (This is probably a misconfiguration in your system or libraries, and
4227 you really ought to fix it. Still, I'll try anyway.)
4231 rp="What is the size of an integer (in bytes)?"
4235 rp="What is the size of a long integer (in bytes)?"
4239 rp="What is the size of a short integer (in bytes)?"
4245 $rm -f intsize intsize.*
4247 : see what type lseek is declared as in the kernel
4248 rp="What is the type used for lseek's offset on this system?"
4249 set off_t lseektype long stdio.h sys/types.h
4253 echo "Checking to see how big your file offsets are..." >&4
4255 #include <sys/types.h>
4259 printf("%d\n", (int)sizeof($lseektype));
4264 if eval $compile_ok; then
4266 echo "Your file offsets are $lseeksize bytes long."
4270 echo "(I can't seem to compile the test program. Guessing...)"
4271 rp="What is the size of your file offsets (in bytes)?"
4277 : see what type file positions are declared as in the library
4278 rp="What is the type for file position used by fsetpos()?"
4279 set fpos_t fpostype long stdio.h sys/types.h
4284 *_t) zzz="$fpostype" ;;
4287 echo "Checking the size of $zzz..." >&4
4289 #include <sys/types.h>
4292 printf("%d\n", (int)sizeof($fpostype));
4297 if eval $compile_ok; then
4301 echo "(I can't execute the test program--guessing $fpossize.)" >&4
4304 echo "Your $zzz is $fpossize bytes long."
4310 echo "(I can't compile the test program. Guessing...)" >&4
4311 rp="What is the size of your file positions (in bytes)?"
4318 # Backward compatibility (uselfs is deprecated).
4320 "$define"|true|[yY]*)
4323 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
4325 uselargefiles="$define"
4329 case "$lseeksize:$fpossize" in
4332 You can have files larger than 2 gigabytes.
4335 *) case "$uselargefiles" in
4336 "$undef"|false|[nN]*) dflt='n' ;;
4341 Perl can be built to understand large files (files larger than 2 gigabytes)
4342 on some systems. To do so, Configure can be run with -Duselargefiles.
4344 If this doesn't make any sense to you, just accept the default '$dflt'.
4346 rp='Try to understand large files, if available?'
4349 y|Y) val="$define" ;;
4356 case "$uselargefiles" in
4358 : Look for a hint-file generated 'call-back-unit'. If the
4359 : user has specified that a large files perl is to be built,
4360 : we may need to set or change some other defaults.
4361 if $test -f uselargefiles.cbu; then
4362 echo "Your platform has some specific hints for large file builds, using them..."
4363 . ./uselargefiles.cbu
4365 echo "Rechecking to see how big your file offsets are..." >&4
4367 #include <sys/types.h>
4371 printf("%d\n", (int)sizeof($lseektype));
4376 if eval $compile_ok; then
4378 $echo "Your file offsets are now $lseeksize bytes long."
4382 echo "(I can't seem to compile the test program. Guessing...)"
4383 rp="What is the size of your file offsets (in bytes)?"
4388 *_t) zzz="$fpostype" ;;
4391 $echo $n "Rechecking the size of $zzz...$c" >&4
4393 #include <sys/types.h>
4396 printf("%d\n", (int)sizeof($fpostype));
4401 if eval $compile_ok; then
4406 echo "(I can't execute the test program--guessing $fpossize.)" >&4
4409 echo " $fpossize bytes." >&4
4415 echo "(I can't compile the test program. Guessing...)" >&4
4416 rp="What is the size of your file positions (in bytes)?"
4426 case "$usemorebits" in
4427 "$define"|true|[yY]*)
4428 use64bitint="$define"
4429 uselongdouble="$define"
4430 usemorebits="$define"
4432 *) usemorebits="$undef"
4437 case "$uselonglong" in
4438 "$define"|true|[yY]*)
4441 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
4443 use64bitint="$define"
4446 case "$use64bits" in
4447 "$define"|true|[yY]*)
4450 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
4452 use64bitint="$define"
4455 case "$use64bitints" in
4456 "$define"|true|[yY]*)
4459 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
4461 use64bitint="$define"
4464 case "$use64bitsint" in
4465 "$define"|true|[yY]*)
4468 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
4470 use64bitint="$define"
4473 case "$uselonglongs" in
4474 "$define"|true|[yY]*)
4477 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
4479 use64bitint="$define"
4482 case "$use64bitsall" in
4483 "$define"|true|[yY]*)
4486 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
4488 use64bitall="$define"
4493 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
4495 case "$use64bitall" in
4496 "$define"|true|[yY]*) use64bitint="$define" ;;
4502 You have natively 64-bit long integers.
4506 *) case "$use64bitint" in
4507 "$define"|true|[yY]*) dflt='y';;
4512 Perl can be built to take advantage of 64-bit integer types
4513 on some systems. To do so, Configure can be run with -Duse64bitint.
4514 Choosing this option will most probably introduce binary incompatibilities.
4516 If this doesn't make any sense to you, just accept the default '$dflt'.
4518 rp='Try to use 64-bit integers, if available?'
4521 [yY]*) val="$define" ;;
4529 case "$use64bitall" in
4530 "$define"|true|[yY]*) dflt='y' ;;
4531 *) case "$longsize" in
4539 You may also choose to try maximal 64-bitness. It means using as much
4540 64-bitness as possible on the platform. This in turn means even more
4541 binary incompatibilities. On the other hand, your platform may not
4542 have any more 64-bitness available than what you already have chosen.
4544 If this doesn't make any sense to you, just accept the default '$dflt'.
4546 rp='Try to use maximal 64-bit support, if available?'
4549 [yY]*) val="$define" ;;
4554 case "$use64bitall" in
4556 case "$use64bitint" in
4560 Since you have chosen a maximally 64-bit build, I'm also turning on
4561 the use of 64-bit integers.
4563 use64bitint="$define" ;;
4568 case "$use64bitint" in
4569 "$define"|true|[yY]*)
4570 : Look for a hint-file generated 'call-back-unit'. If the
4571 : user has specified that a 64-bit perl is to be built,
4572 : we may need to set or change some other defaults.
4573 if $test -f use64bitint.cbu; then
4574 echo "Your platform has some specific hints for 64-bit integers, using them..."
4578 4) case "$archname64" in
4579 '') archname64=64int ;;
4586 case "$use64bitall" in
4587 "$define"|true|[yY]*)
4588 : Look for a hint-file generated 'call-back-unit'. If the
4589 : user has specified that a maximally 64-bit perl is to be built,
4590 : we may need to set or change some other defaults.
4591 if $test -f use64bitall.cbu; then
4592 echo "Your platform has some specific hints for 64-bit builds, using them..."
4596 4) case "$archname64" in
4597 ''|64int) archname64=64all ;;
4604 : determine the architecture name
4606 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
4607 tarch=`arch`"-$osname"
4608 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
4609 if uname -m > tmparch 2>&1 ; then
4610 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
4611 -e 's/$/'"-$osname/" tmparch`
4619 case "$myarchname" in
4622 echo "(Your architecture name used to be $myarchname.)"
4629 *) dflt="$archname";;
4631 rp='What is your architecture name'
4634 case "$usethreads" in
4636 echo "Threads selected." >&4
4638 *-thread*) echo "...and architecture name already has -thread." >&4
4640 *) archname="$archname-thread"
4641 echo "...setting architecture name to $archname." >&4
4646 case "$usemultiplicity" in
4648 echo "Multiplicity selected." >&4
4650 *-multi*) echo "...and architecture name already has -multi." >&4
4652 *) archname="$archname-multi"
4653 echo "...setting architecture name to $archname." >&4
4658 case "$use64bitint" in
4660 case "$archname64" in
4665 *-$archname64*) echo "...and architecture name already has $archname64." >&4
4667 *) archname="$archname-$archname64"
4668 echo "...setting architecture name to $archname." >&4
4675 : determine root of directory hierarchy where package will be installed.
4678 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
4686 By default, $package will be installed in $dflt/bin, manual pages
4687 under $dflt/man, etc..., i.e. with $dflt as prefix for all
4688 installation directories. Typically this is something like /usr/local.
4689 If you wish to have binaries under /usr/bin but other parts of the
4690 installation under /usr/local, that's ok: you will be prompted
4691 separately for each of the installation directories, the prefix being
4692 only used to set the defaults.
4696 rp='Installation prefix to use?'
4704 *) oldprefix="$prefix";;
4714 $define|true) afs=true ;;
4715 $undef|false) afs=false ;;
4716 *) if test -d /afs; then
4724 echo "AFS may be running... I'll be extra cautious then..." >&4
4726 echo "AFS does not seem to be running..." >&4
4729 : determine installation prefix for where package is to be installed.
4733 Since you are running AFS, I need to distinguish the directory in which
4734 files will reside from the directory in which they are installed (and from
4735 which they are presumably copied to the former directory by occult means).
4738 case "$installprefix" in
4739 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
4740 *) dflt="$installprefix";;
4745 In some special cases, particularly when building $package for distribution,
4746 it is convenient to distinguish between the directory in which files should
4747 be installed from the directory ($prefix) in which they
4748 will eventually reside. For most users, these two directories are the same.
4751 case "$installprefix" in
4753 *) dflt=$installprefix;;
4757 rp='What installation prefix should I use for installing files?'
4759 installprefix="$ans"
4760 installprefixexp="$ansexp"
4762 : set the prefixit variable, to compute a suitable default value
4763 prefixit='case "$3" in
4765 case "$oldprefix" in
4766 "") eval "$1=\"\$$2\"";;
4773 ""|" ") eval "$1=\"\$$2\"";;
4779 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
4781 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
4782 /*-$oldprefix/*|\~*-$oldprefix/*)
4783 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
4784 *) eval "$1=\"\$$2\"";;
4789 : get the patchlevel
4791 echo "Getting the current patchlevel..." >&4
4792 if $test -r $rsrc/patchlevel.h;then
4793 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4794 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4795 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4796 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4797 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4798 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4807 $echo $n "(You have $package revision $revision" $c
4808 $echo $n " patchlevel $patchlevel" $c
4809 test 0 -eq "$subversion" || $echo $n " subversion $subversion" $c
4813 : XXX Should be a Configure test for double-dots in filenames.
4814 version=`echo $revision $patchlevel $subversion | \
4815 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4816 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4817 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4820 version=`echo $revision $patchlevel $subversion | \
4821 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4822 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4823 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4826 : Special case the 5.005_xx maintenance series, which used 5.005
4827 : without any subversion label as a subdirectory in $sitelib
4828 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4829 api_versionstring='5.005'
4832 : determine installation style
4833 : For now, try to deduce it from prefix unless it is already set.
4834 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
4835 case "$installstyle" in
4836 '') case "$prefix" in
4837 *perl*) dflt='lib';;
4838 *) dflt='lib/perl5' ;;
4841 *) dflt="$installstyle" ;;
4843 : Probably not worth prompting for this since we prompt for all
4844 : the directories individually, and the prompt would be too long and
4848 : determine where private library files go
4849 : Usual default is /usr/local/lib/perl5/$version.
4850 : Also allow things like /opt/perl/lib/$version, since
4851 : /opt/perl/lib/perl5... would be redundant.
4852 : The default "style" setting is made in installstyle.U
4853 case "$installstyle" in
4854 *lib/perl5*) set dflt privlib lib/$package/$version ;;
4855 *) set dflt privlib lib/$version ;;
4860 There are some auxiliary files for $package that need to be put into a
4861 private library directory that is accessible by everyone.
4865 rp='Pathname where the private library files will reside?'
4868 privlibexp="$ansexp"
4869 : Change installation prefix, if necessary.
4870 if $test X"$prefix" != X"$installprefix"; then
4871 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
4873 installprivlib="$privlibexp"
4876 : set the prefixup variable, to restore leading tilda escape
4877 prefixup='case "$prefixexp" in
4879 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
4882 : determine where public architecture dependent libraries go
4885 : privlib default is /usr/local/lib/$package/$version
4886 : archlib default is /usr/local/lib/$package/$version/$archname
4887 : privlib may have an optional trailing /share.
4888 tdflt=`echo $privlib | $sed 's,/share$,,'`
4889 tdflt=$tdflt/$archname
4898 $spackage contains architecture-dependent library files. If you are
4899 sharing libraries in a heterogeneous environment, you might store
4900 these files in a separate location. Otherwise, you can just include
4901 them with the rest of the public library files.
4905 rp='Where do you want to put the public architecture-dependent libraries?'
4908 archlibexp="$ansexp"
4909 if $test X"$archlib" = X"$privlib"; then
4914 : Change installation prefix, if necessary.
4915 if $test X"$prefix" != X"$installprefix"; then
4916 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
4918 installarchlib="$archlibexp"
4922 : Binary compatibility with 5.005 is not possible for builds
4923 : with advanced features
4924 case "$usethreads$usemultiplicity" in
4926 bincompat5005="$undef"
4927 d_bincompat5005="$undef"
4931 This version of Perl can be compiled for binary compatibility with 5.005.
4932 If you decide to do so, you will be able to continue using most of the
4933 extensions that were compiled for Perl 5.005.
4936 case "$bincompat5005$d_bincompat5005" in
4937 *"$undef"*) dflt=n ;;
4940 rp='Binary compatibility with Perl 5.005?'
4943 y*) val="$define" ;;
4948 case "$d_bincompat5005" in
4950 bincompat5005="$define"
4952 *) bincompat5005="$undef"
4953 d_bincompat5005="$undef"
4960 : see if setuid scripts can be secure
4963 Some kernels have a bug that prevents setuid #! scripts from being
4964 secure. Some sites have disabled setuid #! scripts because of this.
4966 First let's decide if your kernel supports secure setuid #! scripts.
4967 (If setuid #! scripts would be secure but have been disabled anyway,
4968 don't say that they are secure if asked.)
4973 if $test -d /dev/fd; then
4974 echo "#!$ls" >reflect
4975 chmod +x,u+s reflect
4976 ./reflect >flect 2>&1
4977 if $contains "/dev/fd" flect >/dev/null; then
4978 echo "Congratulations, your kernel has secure setuid scripts!" >&4
4982 If you are not sure if they are secure, I can check but I'll need a
4983 username and password different from the one you are using right now.
4984 If you don't have such a username or don't want me to test, simply
4988 rp='Other username to test security of setuid scripts with?'
4993 case "$d_suidsafe" in
4994 '') echo "I'll assume setuid scripts are *not* secure." >&4
4997 echo "Well, the $hint value is *not* secure." >&4
4999 *) echo "Well, the $hint value *is* secure." >&4
5004 $rm -f reflect flect
5005 echo "#!$ls" >reflect
5006 chmod +x,u+s reflect
5009 echo '"su" will (probably) prompt you for '"$ans's password."
5010 su $ans -c './reflect >flect'
5011 if $contains "/dev/fd" flect >/dev/null; then
5012 echo "Okay, it looks like setuid scripts are secure." >&4
5015 echo "I don't think setuid scripts are secure." >&4
5020 rp='Does your kernel have *secure* setuid scripts?'
5023 [yY]*) val="$define";;
5028 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
5029 echo "(That's for file descriptors, not floppy disks.)"
5035 $rm -f reflect flect
5037 : now see if they want to do setuid emulation
5040 case "$d_suidsafe" in
5043 echo "No need to emulate SUID scripts since they are secure here." >& 4
5047 Some systems have disabled setuid scripts, especially systems where
5048 setuid scripts cannot be secure. On systems where setuid scripts have
5049 been disabled, the setuid/setgid bits on scripts are currently
5050 useless. It is possible for $package to detect those bits and emulate
5051 setuid/setgid in a secure fashion. This emulation will only work if
5052 setuid scripts have been disabled in your kernel.
5056 "$define") dflt=y ;;
5059 rp="Do you want to do setuid/setgid emulation?"
5062 [yY]*) val="$define";;
5070 : determine filename position in cpp output
5072 echo "Computing filename position in cpp output for #include directives..." >&4
5073 echo '#include <stdio.h>' > foo.c
5076 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5077 $grep '^[ ]*#.*stdio\.h' | \
5078 while read cline; do
5081 while $test \$# -gt 0; do
5082 if $test -r \`echo \$1 | $tr -d '"'\`; then
5087 pos=\`expr \$pos + 1\`
5099 *) pos="${fieldn}th";;
5101 echo "Your cpp writes the filename in the $pos field of the line."
5103 : locate header file
5108 for usrincdir in $usrinc
5110 if test -f \$usrincdir/\$wanted; then
5111 echo "\$usrincdir/\$wanted"
5115 awkprg='{ print \$$fieldn }'
5116 echo "#include <\$wanted>" > foo\$\$.c
5117 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5118 $grep "^[ ]*#.*\$wanted" | \
5119 while read cline; do
5120 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5122 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5123 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5128 # status = 0: grep returned 0 lines, case statement not executed
5129 # status = 1: headerfile found
5130 # status = 2: while loop executed, no headerfile found
5134 if test \$status -eq 1; then
5141 : define an alternate in-header-list? function
5142 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5143 cont=true; xxf="echo \"<\$1> found.\" >&4";
5144 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5145 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5147 case $# in 4) instead=instead;; *) instead="at last";; esac;
5148 while $test "$cont"; do
5150 var=$2; eval "was=\$$2";
5151 if $test "$xxx" && $test -r "$xxx";
5153 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5156 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5157 set $yyy; shift; shift; yyy=$@;
5158 case $# in 0) cont="";;
5159 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5160 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5161 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5162 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5166 do set $yyy; var=$2; eval "was=\$$2";
5167 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5168 set $yyy; shift; shift; yyy=$@;
5171 : see if this is a malloc.h system
5172 set malloc.h i_malloc
5175 : see if stdlib is available
5176 set stdlib.h i_stdlib
5179 : determine which malloc to compile in
5181 case "$usemymalloc" in
5182 ''|[yY]*|true|$define) dflt='y' ;;
5185 rp="Do you wish to attempt to use the malloc that comes with $package?"
5191 mallocsrc='malloc.c'
5192 mallocobj="malloc$_o"
5193 d_mymalloc="$define"
5196 : Remove malloc from list of libraries to use
5197 echo "Removing unneeded -lmalloc from library list" >&4
5198 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
5201 echo "libs = $libs" >&4
5213 : compute the return types of malloc and free
5215 $cat >malloc.c <<END
5219 #include <sys/types.h>
5233 case "$malloctype" in
5235 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
5242 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
5246 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
5253 echo "Your system uses $freetype free(), it would seem." >&4
5257 After $package is installed, you may wish to install various
5258 add-on modules and utilities. Typically, these add-ons will
5259 be installed under $prefix with the rest
5260 of this package. However, you may wish to install such add-ons
5261 elsewhere under a different prefix.
5263 If you do not wish to put everything under a single prefix, that's
5264 ok. You will be prompted for the individual locations; this siteprefix
5265 is only used to suggest the defaults.
5267 The default should be fine for most people.
5271 rp='Installation prefix to use for add-on modules and utilities?'
5272 : XXX Here might be another good place for an installstyle setting.
5273 case "$siteprefix" in
5275 *) dflt=$siteprefix ;;
5278 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
5280 case "$siteprefix" in
5284 *) oldsiteprefix="$prefix";;
5289 siteprefixexp="$ansexp"
5291 : determine where site specific libraries go.
5292 : Usual default is /usr/local/lib/perl5/site_perl/$version
5293 : The default "style" setting is made in installstyle.U
5294 : XXX No longer works with Prefixit stuff.
5295 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5297 '') case "$installstyle" in
5298 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
5299 *) dflt=$siteprefix/lib/site_$prog/$version ;;
5307 The installation process will create a directory for
5308 site-specific extensions and modules. Most users find it convenient
5309 to place all site-specific files in this directory rather than in the
5310 main distribution directory.
5314 rp='Pathname for the site-specific library files?'
5317 sitelibexp="$ansexp"
5318 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
5319 : Change installation prefix, if necessary.
5320 if $test X"$prefix" != X"$installprefix"; then
5321 installsitelib=`echo $sitelibexp | $sed "s#^$prefix#$installprefix#"`
5323 installsitelib="$sitelibexp"
5326 : determine where site specific architecture-dependent libraries go.
5327 : sitelib default is /usr/local/lib/perl5/site_perl/$version
5328 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
5329 : sitelib may have an optional trailing /share.
5331 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
5332 dflt="$dflt/$archname"
5337 set sitearch sitearch none
5341 The installation process will also create a directory for
5342 architecture-dependent site-specific extensions and modules.
5346 rp='Pathname for the site-specific architecture-dependent library files?'
5349 sitearchexp="$ansexp"
5350 : Change installation prefix, if necessary.
5351 if $test X"$prefix" != X"$installprefix"; then
5352 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
5354 installsitearch="$sitearchexp"
5359 The installation process will also create a directory for
5360 vendor-supplied add-ons. Vendors who supply perl with their system
5361 may find it convenient to place all vendor-supplied files in this
5362 directory rather than in the main distribution directory. This will
5363 ease upgrades between binary-compatible maintenance versions of perl.
5365 Of course you may also use these directories in whatever way you see
5366 fit. For example, you might use them to access modules shared over a
5367 company-wide network.
5369 The default answer should be fine for most people.
5370 This causes further questions about vendor add-ons to be skipped
5371 and no vendor-specific directories will be configured for perl.
5374 rp='Do you want to configure vendor-specific add-on directories?'
5375 case "$usevendorprefix" in
5376 define|true|[yY]*) dflt=y ;;
5377 *) : User may have set vendorprefix directly on Configure command line.
5378 case "$vendorprefix" in
5387 rp='Installation prefix to use for vendor-supplied add-ons?'
5388 case "$vendorprefix" in
5390 *) dflt=$vendorprefix ;;
5393 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
5395 case "$vendorprefix" in
5399 *) oldvendorprefix="$prefix";;
5403 usevendorprefix="$define"
5405 vendorprefixexp="$ansexp"
5407 *) usevendorprefix="$undef"
5413 case "$vendorprefix" in
5414 '') d_vendorlib="$undef"
5418 *) d_vendorlib="$define"
5419 : determine where vendor-supplied modules go.
5420 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
5421 case "$vendorlib" in
5423 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5424 case "$installstyle" in
5425 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
5426 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
5429 *) dflt="$vendorlib"
5433 rp='Pathname for the vendor-supplied library files?'
5436 vendorlibexp="$ansexp"
5439 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
5440 : Change installation prefix, if necessary.
5441 if $test X"$prefix" != X"$installprefix"; then
5442 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
5444 installvendorlib="$vendorlibexp"
5447 case "$vendorprefix" in
5448 '') d_vendorarch="$undef"
5452 *) d_vendorarch="$define"
5453 : determine where vendor-supplied architecture-dependent libraries go.
5454 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
5455 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
5456 : vendorlib may have an optional trailing /share.
5457 case "$vendorarch" in
5458 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
5459 dflt="$dflt/$archname"
5461 *) dflt="$vendorarch" ;;
5464 rp='Pathname for vendor-supplied architecture-dependent files?'
5467 vendorarchexp="$ansexp"
5470 : Change installation prefix, if necessary.
5471 if $test X"$prefix" != X"$installprefix"; then
5472 installvendorarch=`echo $vendorarchexp | sed "s#^$prefix#$installprefix#"`
5474 installvendorarch="$vendorarchexp"
5477 : Final catch-all directories to search
5480 Lastly, you can have perl look in other directories for extensions and
5481 modules in addition to those already specified.
5482 These directories will be searched after
5486 test X"$vendorlib" != "X" && echo ' ' $vendorlib
5487 test X"$vendorarch" != "X" && echo ' ' $vendorarch
5489 case "$otherlibdirs" in
5490 ''|' ') dflt='none' ;;
5491 *) dflt="$otherlibdirs" ;;
5494 Enter a colon-separated set of extra paths to include in perl's @INC
5495 search path, or enter 'none' for no extra paths.
5499 rp='Colon-separated list of additional directories for perl to search?'
5502 ' '|''|none) otherlibdirs=' ' ;;
5503 *) otherlibdirs="$ans" ;;
5505 case "$otherlibdirs" in
5509 set d_perl_otherlibdirs
5512 : Cruising for prototypes
5514 echo "Checking out function prototypes..." >&4
5515 $cat >prototype.c <<'EOCP'
5516 int main(int argc, char *argv[]) {
5519 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
5520 echo "Your C compiler appears to support function prototypes."
5523 echo "Your C compiler doesn't seem to understand function prototypes."
5530 case "$prototype" in
5532 *) ansi2knr='ansi2knr'
5537 This version of $package can only be compiled by a compiler that
5538 understands function prototypes. Unfortunately, your C compiler
5540 doesn't seem to understand them. Sorry about that.
5542 If GNU cc is available for your system, perhaps you could try that instead.
5544 Eventually, we hope to support building Perl with pre-ANSI compilers.
5545 If you would like to help in that effort, please contact <perlbug@perl.org>.
5547 Aborting Configure now.
5553 : determine where public executables go
5558 rp='Pathname where the public executables will reside?'
5560 if $test "X$ansexp" != "X$binexp"; then
5565 : Change installation prefix, if necessary.
5566 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
5567 if $test X"$prefix" != X"$installprefix"; then
5568 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
5570 installbin="$binexp"
5573 : Find perl5.005 or later.
5574 echo "Looking for a previously installed perl5.005 or later... "
5576 '') for tdir in `echo "$binexp:$PATH" | $sed "s/$path_sep/ /g"`; do
5577 : Check if this perl is recent and can load a simple module
5578 if $test -x $tdir/perl && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
5581 elif $test -x $tdir/perl5 && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
5591 '') echo "None found. That's ok.";;
5592 *) echo "Using $perl5." ;;
5595 : Determine list of previous versions to include in @INC
5596 $cat > getverlist <<EOPL
5599 \$api_versionstring = "$api_versionstring";
5600 \$version = "$version";
5601 \$stem = "$sitelib_stem";
5602 \$archname = "$archname";
5604 $cat >> getverlist <<'EOPL'
5605 # Can't have leading @ because metaconfig interprets it as a command!
5606 ;@inc_version_list=();
5607 # XXX Redo to do opendir/readdir?
5610 ;@candidates = glob("5.*");
5616 # XXX ToDo: These comparisons must be reworked when two-digit
5617 # subversions come along, so that 5.7.10 compares as greater than
5618 # 5.7.3! By that time, hope that 5.6.x is sufficiently
5619 # widespread that we can use the built-in version vectors rather
5620 # than reinventing them here. For 5.6.0, however, we must
5621 # assume this script will likely be run by 5.005_0x. --AD 1/2000.
5622 foreach $d (@candidates) {
5623 if ($d lt $version) {
5624 if ($d ge $api_versionstring) {
5625 unshift(@inc_version_list, grep { -d } "$d/$archname", $d);
5627 elsif ($d ge "5.005") {
5628 unshift(@inc_version_list, grep { -d } $d);
5632 # Skip newer version. I.e. don't look in
5633 # 5.7.0 if we're installing 5.6.1.
5637 if (@inc_version_list) {
5638 print join(' ', @inc_version_list);
5641 # Blank space to preserve value for next Configure run.
5646 case "$inc_version_list" in
5647 '') if test -x "$perl5"; then
5648 dflt=`$perl5 getverlist`
5653 $undef) dflt='none' ;;
5654 *) dflt="$inc_version_list" ;;
5657 ''|' ') dflt=none ;;
5661 In order to ease the process of upgrading, this version of perl
5662 can be configured to use modules built and installed with earlier
5663 versions of perl that were installed under $prefix. Specify here
5664 the list of earlier versions that this version of perl should check.
5665 If Configure detected no earlier versions of perl installed under
5666 $prefix, then the list will be empty. Answer 'none' to tell perl
5667 to not search earlier versions.
5669 The default should almost always be sensible, so if you're not sure,
5670 just accept the default.
5673 rp='List of earlier versions to include in @INC?'
5676 [Nn]one|''|' ') inc_version_list=' ' ;;
5677 *) inc_version_list="$ans" ;;
5679 case "$inc_version_list" in
5681 inc_version_list_init='0';;
5682 *) inc_version_list_init=`echo $inc_version_list |
5683 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
5688 : determine whether to install perl also as /usr/bin/perl
5691 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
5693 Many scripts expect perl to be installed as /usr/bin/perl.
5694 I can install the perl you are about to compile also as /usr/bin/perl
5695 (in addition to $installbin/perl).
5697 case "$installusrbinperl" in
5698 "$undef"|[nN]*) dflt='n';;
5701 rp="Do you want to install perl as /usr/bin/perl?"
5704 [yY]*) val="$define";;
5710 set installusrbinperl
5714 echo "Checking for GNU C Library..." >&4
5715 cat >gnulibc.c <<EOM
5727 if eval $compile_ok && ./gnulibc; then
5729 echo "You are using the GNU C Library"
5732 echo "You are not using the GNU C Library"
5738 : see if nm is to be used to determine whether a symbol is defined or not
5742 case "$d_gnulibc" in
5745 echo "nm probably won't work on the GNU C Library." >&4
5751 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
5753 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
5754 echo "'nm' won't be sufficient on this sytem." >&4
5760 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
5761 if $test $dflt -gt 20; then
5771 true|$define) dflt=y;;
5778 I can use $nm to extract the symbols from your C libraries. This
5779 is a time consuming task which may generate huge output on the disk (up
5780 to 3 megabytes) but that should make the symbols extraction faster. The
5781 alternative is to skip the 'nm' extraction part and to compile a small
5782 test program instead to determine whether each symbol is present. If
5783 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
5784 this may be the best solution.
5786 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
5789 rp="Shall I use $nm to extract C symbols from the libraries?"
5792 [Nn]*) usenm=false;;
5801 : nm options which may be necessary
5803 '') if $test -f /mach_boot; then
5805 elif $test -d /usr/ccs/lib; then
5806 nm_opt='-p' # Solaris (and SunOS?)
5807 elif $test -f /dgux; then
5809 elif $test -f /lib64/rld; then
5810 nm_opt='-p' # 64-bit Irix
5816 : nm options which may be necessary for shared libraries but illegal
5817 : for archive libraries. Thank you, Linux.
5818 case "$nm_so_opt" in
5819 '') case "$myuname" in
5821 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
5822 nm_so_opt='--dynamic'
5831 : get list of predefined functions in a handy place
5836 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
5843 *) for thislib in $libs; do
5846 : Handle C library specially below.
5849 thislib=`echo $thislib | $sed -e 's/^-l//'`
5850 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
5852 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
5854 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
5856 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
5858 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
5860 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
5862 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
5867 libnames="$libnames $try"
5869 *) libnames="$libnames $thislib" ;;
5878 for xxx in $libpth; do
5879 $test -r $1 || set $xxx/libc.$so
5880 : The messy sed command sorts on library version numbers.
5882 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
5883 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
5885 s/[0-9][0-9]*/0000&/g
5886 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
5889 sort | $sed -e 's/^.* //'`
5892 $test -r $1 || set /usr/ccs/lib/libc.$so
5893 $test -r $1 || set /lib/libsys_s$_a
5899 if $test -r "$1"; then
5900 echo "Your (shared) C library seems to be in $1."
5902 elif $test -r /lib/libc && $test -r /lib/clib; then
5903 echo "Your C library seems to be in both /lib/clib and /lib/libc."
5905 libc='/lib/clib /lib/libc'
5906 if $test -r /lib/syslib; then
5907 echo "(Your math library is in /lib/syslib.)"
5908 libc="$libc /lib/syslib"
5910 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5911 echo "Your C library seems to be in $libc, as you said before."
5912 elif $test -r $incpath/usr/lib/libc$_a; then
5913 libc=$incpath/usr/lib/libc$_a;
5914 echo "Your C library seems to be in $libc. That's fine."
5915 elif $test -r /lib/libc$_a; then
5917 echo "Your C library seems to be in $libc. You're normal."
5919 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
5921 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
5922 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
5923 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
5925 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5927 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5930 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
5932 if $test -r "$tans"; then
5933 echo "Your C library seems to be in $tans, of all places."
5939 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5943 If the guess above is wrong (which it might be if you're using a strange
5944 compiler, or your machine supports multiple models), you can override it here.
5949 echo $libpth | tr ' ' $trnl | sort | uniq > libpath
5951 I can't seem to find your C library. I've looked in the following places:
5954 $sed 's/^/ /' libpath
5957 None of these seems to contain your C library. I need to get its name...
5962 rp='Where is your C library?'
5967 echo $libc $libnames | tr ' ' $trnl | sort | uniq > libnames
5968 set X `cat libnames`
5971 case $# in 1) xxx=file; esac
5972 echo "Extracting names from the following $xxx for later perusal:" >&4
5974 $sed 's/^/ /' libnames >&4
5976 $echo $n "This may take a while...$c" >&4
5980 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
5981 *) $nm $nm_opt $file 2>/dev/null;;
5986 $grep fprintf libc.tmp > libc.ptf
5987 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
5988 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
5990 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
5992 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5994 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
5996 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5998 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
6000 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6002 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
6004 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6006 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
6008 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6010 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
6012 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6014 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
6015 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
6017 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6019 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
6021 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6023 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
6025 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6027 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
6029 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6031 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
6033 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6035 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
6037 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6039 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
6041 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6043 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
6045 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6048 $nm -p $* 2>/dev/null >libc.tmp
6049 $grep fprintf libc.tmp > libc.ptf
6050 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
6051 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
6057 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
6059 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
6060 for thisname in $libnames $libc; do
6061 $ar t $thisname >>libc.tmp
6063 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
6065 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
6066 # Repeat libc to extract forwarders to DLL entries too
6067 for thisname in $libnames $libc; do
6068 $ar tv $thisname >>libc.tmp
6069 # Revision 50 of EMX has bug in $ar.
6070 # it will not extract forwarders to DLL entries
6071 # Use emximp which will extract exactly them.
6072 emximp -o tmp.imp $thisname \
6074 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
6075 < tmp.imp >>libc.tmp
6078 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
6081 echo "$ar didn't seem to work right." >&4
6082 echo "Maybe this is a Cray...trying bld instead..." >&4
6083 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
6085 for thisname in $libnames; do
6087 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
6088 $ar t $thisname >>libc.tmp
6092 echo "That didn't work either. Giving up." >&4
6099 if $test -f /lib/syscalls.exp; then
6101 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
6102 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*$/\1/p' /lib/syscalls.exp >>libc.list
6106 $rm -f libnames libpath
6108 : see if dld is available
6112 : is a C symbol defined?
6115 -v) tf=libc.tmp; tc=""; tdc="";;
6116 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
6117 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
6120 case "$reuseval-$4" in
6122 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
6128 if $contains $tlook $tf >/dev/null 2>&1;
6133 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
6134 if $cc $optimize $ccflags $ldflags -o t t.c $libs >/dev/null 2>&1;
6142 $define) tval=true;;
6148 : define an is-in-libc? function
6149 inlibc='echo " "; td=$define; tu=$undef;
6150 sym=$1; var=$2; eval "was=\$$2";
6152 case "$reuseval$was" in
6162 echo "$sym() found." >&4;
6163 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
6165 echo "$sym() NOT found." >&4;
6166 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
6170 $define) echo "$sym() found." >&4;;
6171 *) echo "$sym() NOT found." >&4;;
6175 : see if dlopen exists
6182 : determine which dynamic loading, if any, to compile in
6184 dldir="ext/DynaLoader"
6197 $define) dflt='y' ;;
6200 $define) dflt='y' ;;
6202 : Does a dl_xxx.xs file exist for this operating system
6203 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
6206 rp="Do you wish to use dynamic loading?"
6213 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
6214 dflt="$dldir/dl_${osname}.xs"
6215 elif $test "$d_dlopen" = "$define" ; then
6216 dflt="$dldir/dl_dlopen.xs"
6217 elif $test "$i_dld" = "$define" ; then
6218 dflt="$dldir/dl_dld.xs"
6223 *) dflt="$dldir/$dlsrc"
6226 echo "The following dynamic loading files are available:"
6227 : Can not go over to $dldir because getfile has path hard-coded in.
6228 tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir
6229 rp="Source file to use for dynamic loading"
6235 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
6239 Some systems may require passing special flags to $cc -c to
6240 compile modules that will be used to create a shared library.
6241 To use no flags, say "none".
6244 case "$cccdlflags" in
6245 '') case "$gccversion" in
6246 '') case "$osname" in
6248 next) dflt='none' ;;
6249 irix*) dflt='-KPIC' ;;
6250 svr4*|esix*|solaris) dflt='-KPIC' ;;
6251 sunos) dflt='-pic' ;;
6255 *) case "$osname" in
6256 svr4*|esix*|solaris) dflt='-fPIC' ;;
6261 *) dflt="$cccdlflags" ;;
6263 rp="Any special flags to pass to $cc -c to compile shared library modules?"
6266 none) cccdlflags=' ' ;;
6267 *) cccdlflags="$ans" ;;
6272 Some systems use ld to create libraries that can be dynamically loaded,
6273 while other systems (such as those using ELF) use $cc.
6277 '') $cat >try.c <<'EOM'
6278 /* Test for whether ELF binaries are produced */
6283 int i = open("a.out",O_RDONLY);
6286 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
6287 exit(0); /* succeed (yes, it's ELF) */
6292 if $cc $ccflags try.c >/dev/null 2>&1 && ./a.out; then
6294 You appear to have ELF support. I'll use $cc to build dynamic libraries.
6298 echo "I'll use ld to build dynamic libraries."
6307 rp="What command should be used to create dynamic libraries?"
6313 Some systems may require passing special flags to $ld to create a
6314 library that can be dynamically loaded. If your ld flags include
6315 -L/other/path options to locate libraries outside your loader's normal
6316 search path, you may need to specify those -L options here as well. To
6317 use no flags, say "none".
6320 case "$lddlflags" in
6321 '') case "$osname" in
6322 beos) dflt='-nostart' ;;
6324 case "$gccversion" in
6325 '') dflt="$dflt +vnocompatwarnings" ;;
6328 linux|irix*) dflt='-shared' ;;
6329 next) dflt='none' ;;
6330 solaris) dflt='-G' ;;
6331 sunos) dflt='-assert nodefinitions' ;;
6332 svr4*|esix*) dflt="-G $ldflags" ;;
6336 *) dflt="$lddlflags" ;;
6339 : Try to guess additional flags to pick up local libraries.
6340 : Be careful not to append to a plain 'none'
6344 for thisflag in $ldflags; do
6349 *) dflt="$dflt $thisflag" ;;
6356 ''|' ') dflt='none' ;;
6359 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
6362 none) lddlflags=' ' ;;
6363 *) lddlflags="$ans" ;;
6368 Some systems may require passing special flags to $cc to indicate that
6369 the resulting executable will use dynamic linking. To use no flags,
6373 case "$ccdlflags" in
6374 '') case "$osname" in
6375 hpux) dflt='-Wl,-E' ;;
6376 linux) dflt='-rdynamic' ;;
6377 next) dflt='none' ;;
6378 sunos) dflt='none' ;;
6382 *) dflt="$ccdlflags" ;;
6384 rp="Any special flags to pass to $cc to use dynamic linking?"
6387 none) ccdlflags=' ' ;;
6388 *) ccdlflags="$ans" ;;
6402 # No dynamic loading being used, so don't bother even to prompt.
6405 *) case "$useshrplib" in
6406 '') case "$osname" in
6407 svr4*|dgux|dynixptx|esix|powerux|beos|cygwin*)
6409 also='Building a shared libperl is required for dynamic loading to work on your system.'
6414 also='Building a shared libperl is needed for MAB support.'
6432 The perl executable is normally obtained by linking perlmain.c with
6433 libperl${_a}, any static extensions (usually just DynaLoader), and
6434 any other libraries needed on this system (such as -lm, etc.). Since
6435 your system supports dynamic loading, it is probably possible to build
6436 a shared libperl.$so. If you will have more than one executable linked
6437 to libperl.$so, this will significantly reduce the size of each
6438 executable, but it may have a noticeable affect on performance. The
6439 default is probably sensible for your system.
6443 rp="Build a shared libperl.$so (y/n)"
6447 useshrplib='true' ;;
6448 *) useshrplib='false' ;;
6453 case "$useshrplib" in
6457 # Figure out a good name for libperl.so. Since it gets stored in
6458 # a version-specific architecture-dependent library, the version
6459 # number isn't really that important, except for making cc/ld happy.
6461 # A name such as libperl.so.3.1
6462 majmin="libperl.$so.$patchlevel.$subversion"
6463 # A name such as libperl.so.301
6464 majonly=`echo $patchlevel $subversion |
6465 $awk '{printf "%d%02d", $1, $2}'`
6466 majonly=libperl.$so.$majonly
6467 # I'd prefer to keep the os-specific stuff here to a minimum, and
6468 # rely on figuring it out from the naming of libc.
6469 case "${osname}${osvers}" in
6472 # XXX How handle the --version stuff for MAB?
6474 linux*) # ld won't link with a bare -lperl otherwise.
6477 cygwin*) # include version
6478 dflt=`echo libperl$version | sed -e 's/\./_/g'`$lib_ext
6480 *) # Try to guess based on whether libc has major.minor.
6482 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
6483 *libc.$so.[0-9]*) dflt=$majonly ;;
6484 *) dflt=libperl.$so ;;
6494 I need to select a good name for the shared libperl. If your system uses
6495 library names with major and minor numbers, then you might want something
6496 like $majmin. Alternatively, if your system uses a single version
6497 number for shared libraries, then you might want to use $majonly.
6498 Or, your system might be quite happy with a simple libperl.$so.
6500 Since the shared libperl will get installed into a version-specific
6501 architecture-dependent directory, the version number of the shared perl
6502 library probably isn't important, so the default should be o.k.
6505 rp='What name do you want to give to the shared libperl?'
6508 echo "Ok, I'll use $libperl"
6511 libperl="libperl${_a}"
6515 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
6519 WARNING: Use of the shrpdir variable for the installation location of
6520 the shared $libperl is not supported. It was never documented and
6521 will not work in this version. Let me (perlbug@perl.com)
6522 know of any problems this may cause.
6528 But your current setting of $shrpdir is
6529 the default anyway, so it's harmless.
6534 Further, your current attempted setting of $shrpdir
6535 conflicts with the value of $archlibexp/CORE
6536 that installperl will use.
6543 # How will the perl executable find the installed shared $libperl?
6544 # Add $xxx to ccdlflags.
6545 # If we can't figure out a command-line option, use $shrpenv to
6546 # set env LD_RUN_PATH. The main perl makefile uses this.
6547 shrpdir=$archlibexp/CORE
6550 if "$useshrplib"; then
6553 # We'll set it in Makefile.SH...
6559 xxx="-Wl,-R$shrpdir"
6561 linux|irix*|dec_osf)
6562 xxx="-Wl,-rpath,$shrpdir"
6565 # next doesn't like the default...
6568 # beos doesn't like the default, either.
6571 # hpux doesn't like the default, either.
6572 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
6575 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
6581 # Only add $xxx if it isn't already in ccdlflags.
6582 case " $ccdlflags " in
6584 *) ccdlflags="$ccdlflags $xxx"
6587 Adding $xxx to the flags
6588 passed to $ld so that the perl executable will find the
6589 installed shared $libperl.
6597 # Fix ccdlflags in AIX for building external extensions.
6598 # (For building Perl itself bare -bE:perl.exp is needed,
6599 # Makefile.SH takes care of this.)
6601 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
6603 # Respect a hint or command-line value.
6605 '') shrpenv="$tmp_shrpenv" ;;
6607 case "$ldlibpthname" in
6608 '') ldlibpthname=LD_LIBRARY_PATH ;;
6609 none) ldlibpthname='' ;;
6612 : determine where manual pages go
6613 set man1dir man1dir none
6617 $spackage has manual pages available in source form.
6621 echo "However, you don't have nroff, so they're probably useless to you."
6623 '') man1dir="none";;
6626 echo "If you don't want the manual sources installed, answer 'none'."
6631 lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
6632 lookpath="$lookpath $prefixexp/man/p_man/man1"
6633 lookpath="$lookpath $prefixexp/man/u_man/man1"
6634 lookpath="$lookpath $prefixexp/man/man.1"
6636 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
6637 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
6647 rp="Where do the main $spackage manual pages (source) go?"
6649 if $test "X$man1direxp" != "X$ansexp"; then
6653 man1direxp="$ansexp"
6659 : Change installation prefix, if necessary.
6660 if $test X"$prefix" != X"$installprefix"; then
6661 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
6663 installman1dir="$man1direxp"
6666 : What suffix to use on installed man pages
6673 rp="What suffix should be used for the main $spackage man pages?"
6675 '') case "$man1dir" in
6689 *) dflt="$man1ext";;
6696 : see if we can have long filenames
6698 first=123456789abcdef
6700 if (echo hi >$first) 2>/dev/null; then
6701 if $test -f 123456789abcde; then
6702 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
6705 echo 'You can have filenames longer than 14 characters.'>&4
6710 You can't have filenames longer than 14 chars.
6711 You can't even think about them!
6717 $rm -rf 123456789abcde*
6719 : determine where library module manual pages go
6720 set man3dir man3dir none
6724 $spackage has manual pages for many of the library modules.
6730 However, you don't have nroff, so they're probably useless to you.
6733 '') man3dir="none";;
6737 case "$d_flexfnam" in
6740 However, your system can't handle the long file names like File::Basename.3.
6743 '') man3dir="none";;
6747 echo "If you don't want the manual sources installed, answer 'none'."
6748 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6750 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
6751 if $test -d "$privlib/man/man3"; then
6754 WARNING: Previous versions of perl installed man3 pages into
6755 $privlib/man/man3. This version will suggest a
6756 new default of $dflt.
6760 rp='Do you wish to preserve the old behavior?(y/n)'
6763 y*) dflt="$privlib/man/man3" ;;
6768 *) dflt="$man3dir" ;;
6775 rp="Where do the $package library man pages (source) go?"
6778 man3direxp="$ansexp"
6784 : Change installation prefix, if necessary.
6785 if $test X"$prefix" != X"$installprefix"; then
6786 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
6788 installman3dir="$man3direxp"
6791 : What suffix to use on installed man pages
6797 rp="What suffix should be used for the $package library man pages?"
6799 '') case "$man3dir" in
6813 *) dflt="$man3ext";;
6820 : see if we have to deal with yellow pages, now NIS.
6821 if $test -d /usr/etc/yp || $test -d /etc/yp; then
6822 if $test -f /usr/etc/nibindd; then
6824 echo "I'm fairly confident you're on a NeXT."
6826 rp='Do you get the hosts file via NetInfo?'
6835 y*) hostcat='nidump hosts .';;
6836 *) case "$hostcat" in
6837 nidump*) hostcat='';;
6847 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
6855 rp='Are you getting the hosts file via yellow pages?'
6858 y*) hostcat='ypcat hosts';;
6859 *) hostcat='cat /etc/hosts';;
6865 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
6868 '') test -f /etc/group && groupcat='cat /etc/group';;
6871 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
6874 : now get the host name
6876 echo "Figuring out host name..." >&4
6877 case "$myhostname" in
6879 echo 'Maybe "hostname" will work...'
6880 if tans=`sh -c hostname 2>&1` ; then
6888 if $test "$cont"; then
6890 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
6891 if tans=`cat /etc/systemid 2>&1` ; then
6893 phostname='cat /etc/systemid'
6894 echo "Whadyaknow. Xenix always was a bit strange..."
6897 elif $test -r /etc/systemid; then
6898 echo "(What is a non-Xenix system doing with /etc/systemid?)"
6901 if $test "$cont"; then
6902 echo 'No, maybe "uuname -l" will work...'
6903 if tans=`sh -c 'uuname -l' 2>&1` ; then
6905 phostname='uuname -l'
6907 echo 'Strange. Maybe "uname -n" will work...'
6908 if tans=`sh -c 'uname -n' 2>&1` ; then
6910 phostname='uname -n'
6912 echo 'Oh well, maybe I can mine it out of whoami.h...'
6913 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
6914 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
6915 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
6917 case "$myhostname" in
6918 '') echo "Does this machine have an identity crisis or something?"
6921 echo "Well, you said $myhostname before..."
6922 phostname='echo $myhostname';;
6928 : you do not want to know about this
6933 if $test "$myhostname" ; then
6935 rp='Your host name appears to be "'$myhostname'".'" Right?"
6943 : bad guess or no guess
6944 while $test "X$myhostname" = X ; do
6946 rp="Please type the (one word) name of your host:"
6951 : translate upper to lower if necessary
6952 case "$myhostname" in
6954 echo "(Normalizing case in your host name)"
6955 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
6959 case "$myhostname" in
6961 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
6962 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
6963 echo "(Trimming domain name from host name--host name is now $myhostname)"
6965 *) case "$mydomain" in
6968 test "X$hostcat" = "Xypcat hosts" &&
6969 ypmatch "$myhostname" hosts 2>/dev/null |\
6970 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
6973 test "X$hostcat" != "X" &&
6974 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
6975 /[ ]$myhostname[ . ]/p" > hosts
6978 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
6979 END { print sum }" hosts` = x1 || tmp_re="[ ]"
6980 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
6981 hosts | $sort | $uniq | \
6982 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
6983 case `$echo X$dflt` in
6984 X*\ *) echo "(Several hosts in /etc/hosts matched hostname)"
6987 X.) echo "(You do not have fully-qualified names in /etc/hosts)"
6992 tans=`./loc resolv.conf X /etc /usr/etc`
6993 if $test -f "$tans"; then
6994 echo "(Attempting domain name extraction from $tans)"
6995 dflt=.`$sed -n -e 's/ / /g' \
6996 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
6997 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
6999 .) dflt=.`$sed -n -e 's/ / /g' \
7000 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
7001 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
7008 .) echo "(No help from resolv.conf either -- attempting clever guess)"
7009 dflt=.`sh -c domainname 2>/dev/null`
7012 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
7017 .) echo "(Lost all hope -- silly guess then)"
7023 *) dflt="$mydomain";;
7027 rp="What is your domain name?"
7037 : translate upper to lower if necessary
7040 echo "(Normalizing case in your domain name)"
7041 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
7045 : a little sanity check here
7046 case "$phostname" in
7049 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
7050 $myhostname$mydomain|$myhostname) ;;
7052 case "$phostname" in
7054 echo "(That doesn't agree with your whoami.h file, by the way.)"
7057 echo "(That doesn't agree with your $phostname command, by the way.)"
7067 I need to get your e-mail address in Internet format if possible, i.e.
7068 something like user@host.domain. Please answer accurately since I have
7069 no easy means to double check it. The default value provided below
7070 is most probably close to reality but may not be valid from outside
7071 your organization...
7075 while test "$cont"; do
7077 '') dflt="$cf_by@$myhostname$mydomain";;
7078 *) dflt="$cf_email";;
7080 rp='What is your e-mail address?'
7086 rp='Address does not look like an Internet one. Use it anyway?'
7102 If you or somebody else will be maintaining perl at your site, please
7103 fill in the correct e-mail address here so that they may be contacted
7104 if necessary. Currently, the "perlbug" program included with perl
7105 will send mail to this address in addition to perlbug@perl.com. You may
7106 enter "none" for no administrator.
7109 case "$perladmin" in
7110 '') dflt="$cf_email";;
7111 *) dflt="$perladmin";;
7113 rp='Perl administrator e-mail address'
7117 : figure out how to guarantee perl startup
7118 case "$startperl" in
7120 case "$sharpbang" in
7124 I can use the #! construct to start perl on your system. This will
7125 make startup of perl scripts faster, but may cause problems if you
7126 want to share those scripts and perl is not in a standard place
7127 ($binexp/perl) on all your platforms. The alternative is to force
7128 a shell by starting the script with a single ':' character.
7132 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
7135 none) startperl=": # use perl";;
7136 *) startperl="#!$ans"
7137 if $test 30 -lt `echo "$ans" | wc -c`; then
7140 WARNING: Some systems limit the #! command to 32 characters.
7141 If you experience difficulty running Perl scripts with #!, try
7142 installing Perl in a directory with a shorter pathname.
7148 *) startperl=": # use perl"
7153 echo "I'll use $startperl to start perl scripts."
7155 : figure best path for perl in scripts
7158 perlpath="$binexp/perl"
7159 case "$startperl" in
7164 I will use the "eval 'exec'" idiom to start Perl on your system.
7165 I can use the full path of your Perl binary for this purpose, but
7166 doing so may cause problems if you want to share those scripts and
7167 Perl is not always in a standard place ($binexp/perl).
7171 rp="What path shall I use in \"eval 'exec'\"?"
7178 case "$startperl" in
7180 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
7183 : determine where public executable scripts go
7184 set scriptdir scriptdir
7186 case "$scriptdir" in
7189 : guess some guesses
7190 $test -d /usr/share/scripts && dflt=/usr/share/scripts
7191 $test -d /usr/share/bin && dflt=/usr/share/bin
7192 $test -d /usr/local/script && dflt=/usr/local/script
7193 $test -d /usr/local/scripts && dflt=/usr/local/scripts
7194 $test -d $prefixexp/script && dflt=$prefixexp/script
7198 *) dflt="$scriptdir"
7203 Some installations have a separate directory just for executable scripts so
7204 that they can mount it across multiple architectures but keep the scripts in
7205 one spot. You might, for example, have a subdirectory of /usr/share for this.
7206 Or you might just lump your scripts in with all your other executables.
7210 rp='Where do you keep publicly executable scripts?'
7212 if $test "X$ansexp" != "X$scriptdirexp"; then
7216 scriptdirexp="$ansexp"
7217 : Change installation prefix, if necessary.
7218 if $test X"$prefix" != X"$installprefix"; then
7219 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
7221 installscript="$scriptdirexp"
7224 : determine where add-on public executables go
7226 '') dflt=$siteprefix/bin ;;
7230 rp='Pathname where the add-on public executables should be installed?'
7233 sitebinexp="$ansexp"
7234 : Change installation prefix, if necessary.
7235 if $test X"$prefix" != X"$installprefix"; then
7236 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
7238 installsitebin="$sitebinexp"
7241 : see if sqrtl exists
7246 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
7249 case "$uselongdouble" in
7250 $define|true|[yY]*) dflt='y';;
7255 Perl can be built to take advantage of long doubles which
7256 (if available) may give more accuracy and range for floating point numbers.
7258 If this doesn't make any sense to you, just accept the default '$dflt'.
7260 rp='Try to use long doubles if available?'
7263 y|Y) val="$define" ;;
7269 case "$uselongdouble" in
7270 true|[yY]*) uselongdouble="$define" ;;
7273 case "$uselongdouble" in
7275 : Look for a hint-file generated 'call-back-unit'. If the
7276 : user has specified that long doubles should be used,
7277 : we may need to set or change some other defaults.
7278 if $test -f uselongdouble.cbu; then
7279 echo "Your platform has some specific hints for long doubles, using them..."
7280 . ./uselongdouble.cbu
7283 (Your platform doesn't have any specific hints for long doubles.)
7289 case "$uselongdouble:$d_sqrtl" in
7293 *** You requested the use of long doubles but you do not seem to have
7294 *** the mathematic functions for long doubles. I'm disabling the use
7295 *** of long doubles.
7298 uselongdouble=$undef
7302 case "$useperlio" in
7303 $define|true|[yY]*) dflt='y';;
7308 Previous version of $package used the standard IO mechanisms as defined
7309 in <stdio.h>. Versions 5.003_02 and later of perl allow alternate IO
7310 mechanisms via a "PerlIO" abstraction, but the stdio mechanism is still
7311 the default. This abstraction layer can use AT&T's sfio (if you already
7312 have sfio installed) or regular stdio. Using PerlIO with sfio may cause
7313 problems with some extension modules. Using PerlIO with stdio is safe,
7314 but it is slower than plain stdio and therefore is not the default.
7316 If this doesn't make any sense to you, just accept the default '$dflt'.
7318 rp='Use the experimental PerlIO abstraction layer?'
7325 echo "Ok, doing things the stdio way"
7332 case "$vendorprefix" in
7333 '') d_vendorbin="$undef"
7337 *) d_vendorbin="$define"
7338 : determine where vendor-supplied executables go.
7339 case "$vendorbin" in
7340 '') dflt=$vendorprefix/bin ;;
7341 *) dflt="$vendorbin" ;;
7344 rp='Pathname for the vendor-supplied executables directory?'
7347 vendorbinexp="$ansexp"
7350 : Change installation prefix, if necessary.
7351 if $test X"$prefix" != X"$installprefix"; then
7352 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
7354 installvendorbin="$vendorbinexp"
7357 : see if qgcvt exists
7361 : check for length of double
7363 case "$doublesize" in
7365 echo "Checking to see how big your double precision numbers are..." >&4
7366 $cat >try.c <<'EOCP'
7370 printf("%d\n", (int)sizeof(double));
7375 if eval $compile_ok; then
7377 echo "Your double is $doublesize bytes long."
7380 echo "(I can't seem to compile the test program. Guessing...)"
7381 rp="What is the size of a double precision number (in bytes)?"
7389 : check for long doubles
7391 echo "Checking to see if you have long double..." >&4
7392 echo 'int main() { long double x = 7.0; }' > try.c
7394 if eval $compile; then
7396 echo "You have long double."
7399 echo "You do not have long double."
7405 : check for length of long double
7406 case "${d_longdbl}${longdblsize}" in
7409 echo "Checking to see how big your long doubles are..." >&4
7410 $cat >try.c <<'EOCP'
7414 printf("%d\n", sizeof(long double));
7419 if eval $compile; then
7420 longdblsize=`./try$exe_ext`
7421 echo "Your long doubles are $longdblsize bytes long."
7425 echo "(I can't seem to compile the test program. Guessing...)" >&4
7426 rp="What is the size of a long double (in bytes)?"
7430 if $test "X$doublesize" = "X$longdblsize"; then
7431 echo "(That isn't any different from an ordinary double.)"
7439 if $test X"$d_longdbl" = X"$define"; then
7441 echo "Checking how to print long doubles..." >&4
7443 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
7444 $cat >try.c <<'EOCP'
7445 #include <sys/types.h>
7449 printf("%.3f\n", d);
7453 if eval $compile; then
7457 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
7458 sPRIFldbl='"F"'; sPRIGldbl='"G"'; sPRIEldbl='"E"';
7459 echo "We will use %f."
7465 if $test X"$sPRIfldbl" = X; then
7466 $cat >try.c <<'EOCP'
7467 #include <sys/types.h>
7470 long double d = 123.456;
7471 printf("%.3llf\n", d);
7475 if eval $compile; then
7479 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
7480 sPRIFldbl='"llF"'; sPRIGldbl='"llG"'; sPRIEldbl='"llE"';
7481 echo "We will use %llf."
7487 if $test X"$sPRIfldbl" = X; then
7488 $cat >try.c <<'EOCP'
7489 #include <sys/types.h>
7492 long double d = 123.456;
7493 printf("%.3Lf\n", d);
7497 if eval $compile; then
7501 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
7502 sPRIFldbl='"LF"'; sPRIGldbl='"LG"'; sPRIEldbl='"LE"';
7503 echo "We will use %Lf."
7509 if $test X"$sPRIfldbl" = X; then
7510 $cat >try.c <<'EOCP'
7511 #include <sys/types.h>
7514 long double d = 123.456;
7515 printf("%.3lf\n", d);
7519 if eval $compile; then
7523 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
7524 sPRIFldbl='"lF"'; sPRIGldbl='"lG"'; sPRIEldbl='"lE"';
7525 echo "We will use %lf."
7531 if $test X"$sPRIfldbl" = X; then
7532 echo "Cannot figure out how to print long doubles." >&4
7539 case "$sPRIfldbl" in
7540 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
7541 d_PRIFldbl="$undef"; d_PRIGldbl="$undef"; d_PRIEldbl="$undef";
7543 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
7544 d_PRIFldbl="$define"; d_PRIGldbl="$define"; d_PRIEldbl="$define";
7548 : Check how to convert floats to strings.
7549 if test "X$d_Gconvert" = X; then
7551 echo "Checking for an efficient way to convert floats to strings."
7553 case "$uselongdouble" in
7554 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
7556 case "$d_longdbl" in
7557 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
7559 case "$d_PRIgldbl" in
7560 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
7564 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
7565 char *myname = "gconvert";
7568 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
7569 char *myname = "gcvt";
7572 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
7573 char *myname = "qgcvt";
7574 #define DOUBLETYPE long double
7577 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE) && defined(HAS_PRIgldbl)
7578 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
7580 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
7582 char *myname = "sprintf";
7586 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
7587 #define DOUBLETYPE long double
7589 #define DOUBLETYPE double
7595 #define I_STDLIB $i_stdlib
7601 checkit(expect, got)
7605 if (strcmp(expect, got)) {
7606 printf("%s oddity: Expected %s, got %s\n",
7607 myname, expect, got);
7617 /* This must be 1st test on (which?) platform */
7618 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
7619 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
7620 checkit("0.1", buf);
7622 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
7625 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
7626 checkit("1.1", buf);
7628 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
7629 checkit("1.01", buf);
7631 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
7632 checkit("1.001", buf);
7634 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
7635 checkit("1.0001", buf);
7637 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
7638 checkit("1.00001", buf);
7640 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
7641 checkit("1.000001", buf);
7643 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
7646 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
7649 /* Some Linux gcvt's give 1.e+5 here. */
7650 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
7651 checkit("100000", buf);
7653 /* Some Linux gcvt's give -1.e+5 here. */
7654 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
7655 checkit("-100000", buf);
7660 case "$d_Gconvert" in
7661 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
7662 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
7663 sprintf*) xxx_list='sprintf gconvert gcvt' ;;
7664 *) xxx_list='gconvert gcvt sprintf' ;;
7667 case "$d_longdbl$uselongdouble$d_qgcvt" in
7668 "$define$define$define") xxx_list="`echo $xxx_list|sed 's/gcvt/qgcvt gcvt/'`" ;;
7671 for xxx_convert in $xxx_list; do
7672 echo "Trying $xxx_convert..."
7674 set try -DTRY_$xxx_convert
7675 if eval $compile; then
7676 echo "$xxx_convert() found." >&4
7678 echo "I'll use $xxx_convert to convert floats into a string." >&4
7681 echo "...But $xxx_convert didn't work as I expected."
7684 echo "$xxx_convert NOT found." >&4
7688 case "$xxx_convert" in
7689 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
7690 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
7691 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
7692 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
7693 "$define$define$define")
7694 d_Gconvert="sprintf((b),\"%.*$sPRIgldbl\",(n),(x))" ;;
7695 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
7701 : Initialize h_fcntl
7704 : Initialize h_sysfile
7707 : access call always available on UNIX
7711 : locate the flags for 'access()'
7715 $cat >access.c <<'EOCP'
7716 #include <sys/types.h>
7721 #include <sys/file.h>
7730 : check sys/file.h first, no particular reason here
7731 if $test `./findhdr sys/file.h` && \
7732 $cc $cppflags -DI_SYS_FILE -o access access.c >/dev/null 2>&1 ; then
7734 echo "<sys/file.h> defines the *_OK access constants." >&4
7735 elif $test `./findhdr fcntl.h` && \
7736 $cc $cppflags -DI_FCNTL -o access access.c >/dev/null 2>&1 ; then
7738 echo "<fcntl.h> defines the *_OK access constants." >&4
7739 elif $test `./findhdr unistd.h` && \
7740 $cc $cppflags -DI_UNISTD -o access access.c >/dev/null 2>&1 ; then
7741 echo "<unistd.h> defines the *_OK access constants." >&4
7743 echo "I can't find the four *_OK access constants--I'll use mine." >&4
7749 : see if accessx exists
7750 set accessx d_accessx
7753 : see if alarm exists
7757 : see if atolf exists
7761 : see if atoll exists
7765 : Look for GNU-cc style attribute checking
7767 echo "Checking whether your compiler can handle __attribute__ ..." >&4
7768 $cat >attrib.c <<'EOCP'
7770 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
7772 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
7773 if $contains 'warning' attrib.out >/dev/null 2>&1; then
7774 echo "Your C compiler doesn't fully support __attribute__."
7777 echo "Your C compiler supports __attribute__."
7781 echo "Your C compiler doesn't seem to understand __attribute__ at all."
7788 : see if bcmp exists
7792 : see if bcopy exists
7796 : see if this is a unistd.h system
7797 set unistd.h i_unistd
7800 : see if getpgrp exists
7801 set getpgrp d_getpgrp
7804 case "$d_getpgrp" in
7807 echo "Checking to see which flavor of getpgrp is in use..."
7810 #include <sys/types.h>
7812 # include <unistd.h>
7816 if (getuid() == 0) {
7817 printf("(I see you are running Configure as super-user...)\n");
7821 if (getpgrp(1) == 0)
7830 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7831 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
7833 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7834 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
7837 echo "I can't seem to compile and run the test program."
7839 xxx="a USG one, i.e. you use getpgrp()."
7841 # SVR4 systems can appear rather BSD-ish.
7844 xxx="a BSD one, i.e. you use getpgrp(pid)."
7848 xxx="probably a USG one, i.e. you use getpgrp()."
7853 echo "Assuming your getpgrp is $xxx" >&4
7862 : see if setpgrp exists
7863 set setpgrp d_setpgrp
7866 case "$d_setpgrp" in
7869 echo "Checking to see which flavor of setpgrp is in use..."
7872 #include <sys/types.h>
7874 # include <unistd.h>
7878 if (getuid() == 0) {
7879 printf("(I see you are running Configure as super-user...)\n");
7883 if (-1 == setpgrp(1, 1))
7886 if (setpgrp() != -1)
7892 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7893 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
7895 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7896 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
7899 echo "(I can't seem to compile and run the test program.)"
7901 xxx="a USG one, i.e. you use setpgrp()."
7903 # SVR4 systems can appear rather BSD-ish.
7906 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
7910 xxx="probably a USG one, i.e. you use setpgrp()."
7915 echo "Assuming your setpgrp is $xxx" >&4
7923 : see if bzero exists
7927 : see if signal is declared as pointer to function returning int or void
7929 xxx=`./findhdr signal.h`
7930 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
7931 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7932 echo "You have int (*signal())() instead of void." >&4
7934 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7935 echo "You have void (*signal())()." >&4
7937 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
7938 echo "You have int (*signal())() instead of void." >&4
7940 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
7941 echo "You have void (*signal())()." >&4
7944 case "$d_voidsig" in
7946 echo "I can't determine whether signal handler returns void or int..." >&4
7948 rp="What type does your signal handler return?"
7955 echo "As you already told me, signal handler returns void." >&4
7958 *) echo "As you already told me, signal handler returns int." >&4
7965 case "$d_voidsig" in
7966 "$define") signal_t="void";;
7971 : check for ability to cast large floats to 32-bit ints.
7973 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
7974 if $test "$intsize" -ge 4; then
7981 #include <sys/types.h>
7983 $signal_t blech(s) int s; { exit(3); }
7990 signal(SIGFPE, blech);
7992 /* Don't let compiler optimize the test away. Store the number
7993 in a writable string for gcc to pass to sscanf under HP/UX.
7995 sprintf(str, "2147483647");
7996 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
8000 /* x86 processors will probably give 0x8000 0000, which is a
8001 sign change. We don't want that. We want to mimic SPARC
8002 behavior here, which is to preserve the sign and give
8005 if (i32 != ($xxx) f)
8011 if eval $compile_ok; then
8015 echo "(I can't seem to compile the test program--assuming it can't)"
8023 echo "Nope, it can't."
8030 : check for ability to cast negative floats to unsigned
8032 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
8035 #include <sys/types.h>
8037 $signal_t blech(s) int s; { exit(7); }
8038 $signal_t blech_in_list(s) int s; { exit(4); }
8039 unsigned long dummy_long(p) unsigned long p; { return p; }
8040 unsigned int dummy_int(p) unsigned int p; { return p; }
8041 unsigned short dummy_short(p) unsigned short p; { return p; }
8045 unsigned long along;
8047 unsigned short ashort;
8051 /* Frustrate gcc-2.7.2's optimizer which failed this test with
8052 a direct f = -123. assignment. gcc-2.8.0 reportedly
8053 optimized the whole file away
8055 /* Store the number in a writable string for gcc to pass to
8058 sprintf(str, "-123");
8059 sscanf(str, "%lf", &f); /* f = -123.; */
8061 signal(SIGFPE, blech);
8062 along = (unsigned long)f;
8063 aint = (unsigned int)f;
8064 ashort = (unsigned short)f;
8065 if (along != (unsigned long)-123)
8067 if (aint != (unsigned int)-123)
8069 if (ashort != (unsigned short)-123)
8071 sprintf(str, "1073741824.");
8072 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
8075 along = (unsigned long)f;
8076 if (along != 0x80000000)
8080 along = (unsigned long)f;
8081 if (along != 0x7fffffff)
8085 along = (unsigned long)f;
8086 if (along != 0x80000001)
8090 signal(SIGFPE, blech_in_list);
8091 sprintf(str, "123.");
8092 sscanf(str, "%lf", &f); /* f = 123.; */
8093 along = dummy_long((unsigned long)f);
8094 aint = dummy_int((unsigned int)f);
8095 ashort = dummy_short((unsigned short)f);
8096 if (along != (unsigned long)123)
8098 if (aint != (unsigned int)123)
8100 if (ashort != (unsigned short)123)
8107 if eval $compile_ok; then
8111 echo "(I can't seem to compile the test program--assuming it can't)"
8114 case "$castflags" in
8119 echo "Nope, it can't."
8126 : see if vprintf exists
8128 if set vprintf val -f d_vprintf; eval $csym; $val; then
8129 echo 'vprintf() found.' >&4
8131 $cat >vprintf.c <<'EOF'
8132 #include <varargs.h>
8134 int main() { xxx("foo"); }
8143 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
8147 if eval $compile && ./vprintf; then
8148 echo "Your vsprintf() returns (int)." >&4
8151 echo "Your vsprintf() returns (char*)." >&4
8155 echo 'vprintf() NOT found.' >&4
8165 : see if chown exists
8169 : see if chroot exists
8173 : see if chsize exists
8177 : check for const keyword
8179 echo 'Checking to see if your C compiler knows about "const"...' >&4
8180 $cat >const.c <<'EOCP'
8181 typedef struct spug { int drokk; } spug;
8188 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
8190 echo "Yup, it does."
8193 echo "Nope, it doesn't."
8198 : see if crypt exists
8200 if set crypt val -f d_crypt; eval $csym; $val; then
8201 echo 'crypt() found.' >&4
8205 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
8206 if $test -z "$cryptlib"; then
8207 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
8211 if $test -z "$cryptlib"; then
8212 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
8216 if $test -z "$cryptlib"; then
8217 cryptlib=`./loc libcrypt$_a "" $libpth`
8221 if $test -z "$cryptlib"; then
8222 echo 'crypt() NOT found.' >&4
8231 : get csh whereabouts
8233 'csh') val="$undef" ;;
8238 : Respect a hint or command line value for full_csh.
8240 '') full_csh=$csh ;;
8243 : see if cuserid exists
8244 set cuserid d_cuserid
8247 : see if this is a limits.h system
8248 set limits.h i_limits
8251 : see if this is a float.h system
8255 : See if number of significant digits in a double precision number is known
8257 $cat >dbl_dig.c <<EOM
8267 printf("Contains DBL_DIG");
8270 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
8271 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
8272 echo "DBL_DIG found." >&4
8275 echo "DBL_DIG NOT found." >&4
8282 : see if difftime exists
8283 set difftime d_difftime
8286 : see if this is a dirent system
8288 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
8290 echo "<dirent.h> found." >&4
8293 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
8294 echo "<sys/dir.h> found." >&4
8297 xinc=`./findhdr sys/ndir.h`
8299 echo "<dirent.h> NOT found." >&4
8304 : Look for type of directory structure.
8306 $cppstdin $cppflags $cppminus < "$xinc" > try.c
8308 case "$direntrytype" in
8311 $define) guess1='struct dirent' ;;
8312 *) guess1='struct direct' ;;
8315 *) guess1="$direntrytype"
8320 'struct dirent') guess2='struct direct' ;;
8321 *) guess2='struct dirent' ;;
8324 if $contains "$guess1" try.c >/dev/null 2>&1; then
8325 direntrytype="$guess1"
8326 echo "Your directory entries are $direntrytype." >&4
8327 elif $contains "$guess2" try.c >/dev/null 2>&1; then
8328 direntrytype="$guess2"
8329 echo "Your directory entries seem to be $direntrytype." >&4
8331 echo "I don't recognize your system's directory entries." >&4
8332 rp="What type is used for directory entries on this system?"
8340 : see if the directory entry stores field length
8342 $cppstdin $cppflags $cppminus < "$xinc" > try.c
8343 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
8344 echo "Good, your directory entry keeps length information in d_namlen." >&4
8347 echo "Your directory entry does not know about the d_namlen field." >&4
8354 : see if dlerror exists
8357 set dlerror d_dlerror
8361 : see if dlfcn is available
8369 On a few systems, the dynamically loaded modules that perl generates and uses
8370 will need a different extension than shared libs. The default will probably
8378 rp='What is the extension of dynamically loaded modules'
8387 : Check if dlsym need a leading underscore
8393 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
8394 $cat >dyna.c <<'EOM'
8403 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
8405 #include <sys/types.h>
8419 int mode = RTLD_LAZY ;
8421 handle = dlopen("./dyna.$dlext", mode) ;
8422 if (handle == NULL) {
8427 symbol = dlsym(handle, "fred") ;
8428 if (symbol == NULL) {
8429 /* try putting a leading underscore */
8430 symbol = dlsym(handle, "_fred") ;
8431 if (symbol == NULL) {
8444 : Call the object file tmp-dyna.o in case dlext=o.
8445 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
8446 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
8447 $ld $lddlflags -o dyna.$dlext tmp-dyna${_o} > /dev/null 2>&1 &&
8448 $cc $ccflags -o fred $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then
8451 1) echo "Test program failed using dlopen." >&4
8452 echo "Perhaps you should not use dynamic loading." >&4;;
8453 2) echo "Test program failed using dlsym." >&4
8454 echo "Perhaps you should not use dynamic loading." >&4;;
8455 3) echo "dlsym needs a leading underscore" >&4
8457 4) echo "dlsym doesn't need a leading underscore." >&4;;
8460 echo "I can't compile and run the test program." >&4
8461 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
8466 $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
8471 hasproto='varname=$1; func=$2; shift; shift;
8472 while $test $# -ge 2; do
8474 $define) echo "#include <$2>";;
8478 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
8479 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
8480 echo "$func() prototype found.";
8483 echo "$func() prototype NOT found.";
8488 $rm -f try.c tryout.c'
8490 : see if prototype for drand48 is available
8492 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
8495 : see if dup2 exists
8499 : see if eaccess exists
8500 set eaccess d_eaccess
8503 : see if endgrent exists
8504 set endgrent d_endgrent
8507 : see if endhostent exists
8508 set endhostent d_endhent
8511 : see if endnetent exists
8512 set endnetent d_endnent
8515 : see if endprotoent exists
8516 set endprotoent d_endpent
8519 : see if endpwent exists
8520 set endpwent d_endpwent
8523 : see if endservent exists
8524 set endservent d_endsent
8527 : see if endspent exists
8528 set endspent d_endspent
8531 : Locate the flags for 'open()'
8533 $cat >open3.c <<'EOCP'
8534 #include <sys/types.h>
8539 #include <sys/file.h>
8550 : check sys/file.h first to get FREAD on Sun
8551 if $test `./findhdr sys/file.h` && \
8552 set open3 -DI_SYS_FILE && eval $compile; then
8554 echo "<sys/file.h> defines the O_* constants..." >&4
8556 echo "and you have the 3 argument form of open()." >&4
8559 echo "but not the 3 argument form of open(). Oh, well." >&4
8562 elif $test `./findhdr fcntl.h` && \
8563 set open3 -DI_FCNTL && eval $compile; then
8565 echo "<fcntl.h> defines the O_* constants..." >&4
8567 echo "and you have the 3 argument form of open()." >&4
8570 echo "but not the 3 argument form of open(). Oh, well." >&4
8575 echo "I can't find the O_* constant definitions! You got problems." >&4
8581 : see which of string.h or strings.h is needed
8583 strings=`./findhdr string.h`
8584 if $test "$strings" && $test -r "$strings"; then
8585 echo "Using <string.h> instead of <strings.h>." >&4
8589 strings=`./findhdr strings.h`
8590 if $test "$strings" && $test -r "$strings"; then
8591 echo "Using <strings.h> instead of <string.h>." >&4
8593 echo "No string header found -- You'll surely have problems." >&4
8599 "$undef") strings=`./findhdr strings.h`;;
8600 *) strings=`./findhdr string.h`;;
8603 : check for non-blocking I/O stuff
8604 case "$h_sysfile" in
8605 true) echo "#include <sys/file.h>" > head.c;;
8608 true) echo "#include <fcntl.h>" > head.c;;
8609 *) echo "#include <sys/fcntl.h>" > head.c;;
8614 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
8615 case "$o_nonblock" in
8618 $cat >>try.c <<'EOCP'
8622 printf("O_NONBLOCK\n");
8626 printf("O_NDELAY\n");
8630 printf("FNDELAY\n");
8637 if eval $compile_ok; then
8639 case "$o_nonblock" in
8640 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
8641 *) echo "Seems like we can use $o_nonblock.";;
8644 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
8647 *) echo "Using $hint value $o_nonblock.";;
8649 $rm -f try try.* .out core
8652 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
8658 #include <sys/types.h>
8661 #define MY_O_NONBLOCK $o_nonblock
8662 #ifndef errno /* XXX need better Configure test */
8673 #include <strings.h>
8675 $signal_t blech(x) int x; { exit(3); }
8677 $cat >> try.c <<'EOCP'
8685 pipe(pd); /* Down: child -> parent */
8686 pipe(pu); /* Up: parent -> child */
8689 close(pd[1]); /* Parent reads from pd[0] */
8690 close(pu[0]); /* Parent writes (blocking) to pu[1] */
8691 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
8693 signal(SIGALRM, blech);
8695 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
8697 sprintf(string, "%d\n", ret);
8698 write(2, string, strlen(string));
8701 if (errno == EAGAIN) {
8707 if (errno == EWOULDBLOCK)
8708 printf("EWOULDBLOCK\n");
8711 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
8712 sleep(2); /* Give it time to close our pipe */
8714 ret = read(pd[0], buf, 1); /* Should read EOF */
8716 sprintf(string, "%d\n", ret);
8717 write(3, string, strlen(string));
8721 close(pd[0]); /* We write to pd[1] */
8722 close(pu[1]); /* We read from pu[0] */
8723 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
8724 close(pd[1]); /* Pipe pd is now fully closed! */
8725 exit(0); /* Bye bye, thank you for playing! */
8729 if eval $compile_ok; then
8730 echo "$startsh" >mtry
8731 echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
8733 ./mtry >/dev/null 2>&1
8735 0) eagain=`$cat try.out`;;
8736 1) echo "Could not perform non-blocking setting!";;
8737 2) echo "I did a successful read() for something that was not there!";;
8738 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
8739 *) echo "Something terribly wrong happened during testing.";;
8741 rd_nodata=`$cat try.ret`
8742 echo "A read() system call with no data present returns $rd_nodata."
8743 case "$rd_nodata" in
8746 echo "(That's peculiar, fixing that to be -1.)"
8752 echo "Forcing errno EAGAIN on read() with no data available."
8756 echo "Your read() sets errno to $eagain when no data is available."
8759 status=`$cat try.err`
8761 0) echo "And it correctly returns 0 to signal EOF.";;
8762 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
8763 *) echo "However, your read() returns '$status' on EOF??";;
8766 if test "$status" = "$rd_nodata"; then
8767 echo "WARNING: you can't distinguish between EOF and no data!"
8771 echo "I can't compile the test program--assuming errno EAGAIN will do."
8778 echo "Using $hint value $eagain."
8779 echo "Your read() returns $rd_nodata when no data is present."
8780 case "$d_eofnblk" in
8781 "$define") echo "And you can see EOF because read() returns 0.";;
8782 "$undef") echo "But you can't see EOF status from read() returned value.";;
8784 echo "(Assuming you can't see EOF status from read anyway.)"
8790 $rm -f try try.* .out core head.c mtry
8792 : see if fchmod exists
8796 : see if fchown exists
8800 : see if this is an fcntl system
8804 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
8805 while $test $# -ge 2; do
8807 $define) echo "#include <$2>";;
8811 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
8813 if eval $compile; then
8824 : see whether socket exists
8826 $echo $n "Hmm... $c" >&4
8827 if set socket val -f d_socket; eval $csym; $val; then
8828 echo "Looks like you have Berkeley networking support." >&4
8830 if set setsockopt val -f; eval $csym; $val; then
8833 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
8837 if $contains socklib libc.list >/dev/null 2>&1; then
8838 echo "Looks like you have Berkeley networking support." >&4
8840 : we will have to assume that it supports the 4.2 BSD interface
8843 echo "You don't have Berkeley networking in libc$_a..." >&4
8844 if test "X$d_socket" = "X$define"; then
8845 echo "...but you seem to believe that you have sockets." >&4
8847 for net in net socket
8849 if test -f /usr/lib/lib$net$_a; then
8850 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
8851 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
8852 if $contains socket libc.list >/dev/null 2>&1; then
8857 echo "...but the Wollongong group seems to have hacked it in." >&4
8858 sockethdr="-I/usr/netinclude"
8861 echo "Found Berkeley sockets interface in lib$net." >& 4
8862 if $contains setsockopt libc.list >/dev/null 2>&1; then
8865 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
8872 if test "X$d_socket" != "X$define"; then
8873 echo "or anywhere else I see." >&4
8881 : see if socketpair exists
8882 set socketpair d_sockpair
8887 echo "Checking the availability of certain socket constants..." >& 4
8888 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
8889 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
8891 #include <sys/types.h>
8892 #include <sys/socket.h>
8898 set try; if eval $compile; then
8901 set d_${enum}; eval $setvar
8905 : see if sys/select.h has to be included
8906 set sys/select.h i_sysselct
8909 : see if we should include time.h, sys/time.h, or both
8911 if test "X$timeincl" = X; then
8912 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
8913 $echo $n "I'm now running the test program...$c"
8914 $cat >try.c <<'EOCP'
8915 #include <sys/types.h>
8920 #ifdef SYSTIMEKERNEL
8923 #include <sys/time.h>
8926 #include <sys/select.h>
8935 struct timezone tzp;
8937 if (foo.tm_sec == foo.tm_sec)
8940 if (bar.tv_sec == bar.tv_sec)
8947 for s_timezone in '-DS_TIMEZONE' ''; do
8949 for s_timeval in '-DS_TIMEVAL' ''; do
8950 for i_systimek in '' '-DSYSTIMEKERNEL'; do
8951 for i_time in '' '-DI_TIME'; do
8952 for i_systime in '-DI_SYSTIME' ''; do
8955 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
8956 if eval $compile; then
8957 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
8961 $echo $n "Succeeded with $flags$c"
8973 *SYSTIMEKERNEL*) i_systimek="$define"
8974 timeincl=`./findhdr sys/time.h`
8975 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
8976 *) i_systimek="$undef";;
8979 *I_TIME*) i_time="$define"
8980 timeincl=`./findhdr time.h`" $timeincl"
8981 echo "We'll include <time.h>." >&4;;
8982 *) i_time="$undef";;
8985 *I_SYSTIME*) i_systime="$define"
8986 timeincl=`./findhdr sys/time.h`" $timeincl"
8987 echo "We'll include <sys/time.h>." >&4;;
8988 *) i_systime="$undef";;
8993 : check for fd_set items
8996 Checking to see how well your C compiler handles fd_set and friends ...
8998 $cat >fd_set.c <<EOCP
8999 #$i_systime I_SYS_TIME
9000 #$i_sysselct I_SYS_SELECT
9001 #$d_socket HAS_SOCKET
9002 #include <sys/types.h>
9004 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
9007 #include <sys/time.h>
9010 #include <sys/select.h>
9019 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
9026 set fd_set -DTRYBITS
9027 if eval $compile; then
9028 d_fds_bits="$define"
9030 echo "Well, your system knows about the normal fd_set typedef..." >&4
9032 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
9033 d_fd_macros="$define"
9036 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
9038 d_fd_macros="$undef"
9042 Hmm, your compiler has some difficulty with fd_set. Checking further...
9045 if eval $compile; then
9048 echo "Well, your system has some sort of fd_set available..." >&4
9050 echo "and you have the normal fd_set macros." >&4
9051 d_fd_macros="$define"
9054 but not the normal fd_set macros! Gross! More work for me...
9056 d_fd_macros="$undef"
9059 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
9062 d_fd_macros="$undef"
9067 : see if fgetpos exists
9068 set fgetpos d_fgetpos
9071 : see if flock exists
9075 : see if fork exists
9079 : see if pathconf exists
9080 set pathconf d_pathconf
9083 : see if fpathconf exists
9084 set fpathconf d_fpathconf
9088 : check for fpos64_t
9090 echo "Checking to see if you have fpos64_t..." >&4
9093 int main() { fpos64_t x = 7; }
9096 if eval $compile; then
9098 echo "You have fpos64_t."
9101 echo "You do not have fpos64_t."
9103 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
9110 : see if frexpl exists
9114 hasstruct='varname=$1; struct=$2; shift; shift;
9115 while $test $# -ge 2; do
9117 $define) echo "#include <$2>";;
9121 echo "int main () { struct $struct foo; }" >> try.c;
9123 if eval $compile; then
9132 : see if this is a sys/param system
9133 set sys/param.h i_sysparam
9136 : see if this is a sys/mount.h system
9137 set sys/mount.h i_sysmount
9140 : see if sys/types.h has to be included
9141 set sys/types.h i_systypes
9146 echo "Checking to see if your system supports struct fs_data..." >&4
9147 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
9149 case "$d_fs_data_s" in
9150 "$define") echo "Yes, it does." ;;
9151 *) echo "No, it doesn't." ;;
9154 : see if fseeko exists
9158 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
9161 : see if fsetpos exists
9162 set fsetpos d_fsetpos
9166 : see if fstatfs exists
9167 set fstatfs d_fstatfs
9171 : see if statvfs exists
9172 set statvfs d_statvfs
9175 : see if fstatvfs exists
9176 set fstatvfs d_fstatvfs
9180 : see if ftello exists
9184 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
9187 : see if getcwd exists
9192 : see if getfsstat exists
9193 set getfsstat d_getfsstat
9196 : see if getgrent exists
9197 set getgrent d_getgrent
9200 : see if gethostbyaddr exists
9201 set gethostbyaddr d_gethbyaddr
9204 : see if gethostbyname exists
9205 set gethostbyname d_gethbyname
9208 : see if gethostent exists
9209 set gethostent d_gethent
9212 : see how we will look up host name
9215 if set gethostname val -f d_gethname; eval $csym; $val; then
9216 echo 'gethostname() found.' >&4
9217 d_gethname="$define"
9220 if set uname val -f d_uname; eval $csym; $val; then
9223 uname() was found, but you're running xenix, and older versions of xenix
9224 have a broken uname(). If you don't really know whether your xenix is old
9225 enough to have a broken system call, use the default answer.
9232 rp='Is your uname() broken?'
9235 n*) d_uname="$define"; call=uname;;
9238 echo 'uname() found.' >&4
9245 case "$d_gethname" in
9246 '') d_gethname="$undef";;
9249 '') d_uname="$undef";;
9251 case "$d_uname$d_gethname" in
9256 Every now and then someone has a $call() that lies about the hostname
9257 but can't be fixed for political or economic reasons. If you wish, I can
9258 pretend $call() isn't there and maybe compute hostname at run-time
9259 thanks to the '$phostname' command.
9262 rp="Shall I ignore $call() from now on?"
9265 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
9268 case "$phostname" in
9270 *) case "$aphostname" in
9276 file=`./loc $file $file $pth`
9277 aphostname=`echo $file $*`
9282 case "$d_uname$d_gethname" in
9285 case "$phostname" in
9287 echo "There will be no way for $package to get your hostname." >&4;;
9289 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
9293 case "$d_phostname" in
9294 '') d_phostname="$undef";;
9297 : see if this is a netdb.h system
9301 : see if prototypes for various gethostxxx netdb.h functions are available
9303 set d_gethostprotos gethostent $i_netdb netdb.h
9306 : see if getlogin exists
9307 set getlogin d_getlogin
9310 : see if getmnt exists
9314 : see if getmntent exists
9315 set getmntent d_getmntent
9318 : see if getnetbyaddr exists
9319 set getnetbyaddr d_getnbyaddr
9322 : see if getnetbyname exists
9323 set getnetbyname d_getnbyname
9326 : see if getnetent exists
9327 set getnetent d_getnent
9330 : see if prototypes for various getnetxxx netdb.h functions are available
9332 set d_getnetprotos getnetent $i_netdb netdb.h
9336 : see if getprotobyname exists
9337 set getprotobyname d_getpbyname
9340 : see if getprotobynumber exists
9341 set getprotobynumber d_getpbynumber
9344 : see if getprotoent exists
9345 set getprotoent d_getpent
9348 : see if getpgid exists
9349 set getpgid d_getpgid
9352 : see if getpgrp2 exists
9353 set getpgrp2 d_getpgrp2
9356 : see if getppid exists
9357 set getppid d_getppid
9360 : see if getpriority exists
9361 set getpriority d_getprior
9364 : see if prototypes for various getprotoxxx netdb.h functions are available
9366 set d_getprotoprotos getprotoent $i_netdb netdb.h
9369 : see if getpwent exists
9370 set getpwent d_getpwent
9374 : see if getservbyname exists
9375 set getservbyname d_getsbyname
9378 : see if getservbyport exists
9379 set getservbyport d_getsbyport
9382 : see if getservent exists
9383 set getservent d_getsent
9386 : see if prototypes for various getservxxx netdb.h functions are available
9388 set d_getservprotos getservent $i_netdb netdb.h
9391 : see if getspent exists
9392 set getspent d_getspent
9395 : see if getspnam exists
9396 set getspnam d_getspnam
9399 : see if gettimeofday or ftime exists
9400 set gettimeofday d_gettimeod
9402 case "$d_gettimeod" in
9408 val="$undef"; set d_ftime; eval $setvar
9411 case "$d_gettimeod$d_ftime" in
9414 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
9418 : see if this is an grp system
9424 xxx=`./findhdr grp.h`
9425 $cppstdin $cppflags $cppminus < $xxx >$$.h
9427 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
9439 set d_grpasswd; eval $setvar
9443 : see if hasmntopt exists
9444 set hasmntopt d_hasmntopt
9447 : see if this is a netinet/in.h or sys/in.h system
9448 set netinet/in.h i_niin sys/in.h i_sysin
9451 : see if arpa/inet.h has to be included
9452 set arpa/inet.h i_arpainet
9455 : see if htonl --and friends-- exists
9460 : Maybe they are macros.
9465 #include <sys/types.h>
9466 #$i_niin I_NETINET_IN
9468 #$i_arpainet I_ARPA_INET
9470 #include <netinet/in.h>
9476 #include <arpa/inet.h>
9479 printf("Defined as a macro.");
9482 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
9483 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
9485 echo "But it seems to be defined as a macro." >&4
9493 : see if iconv exists
9499 if set index val -f; eval $csym; $val; then
9500 if set strchr val -f d_strchr; eval $csym; $val; then
9501 if $contains strchr "$strings" >/dev/null 2>&1 ; then
9504 echo "strchr() found." >&4
9508 echo "index() found." >&4
9513 echo "index() found." >&4
9516 if set strchr val -f d_strchr; eval $csym; $val; then
9519 echo "strchr() found." >&4
9521 echo "No index() or strchr() found!" >&4
9526 set d_strchr; eval $setvar
9528 set d_index; eval $setvar
9530 : check whether inet_aton exists
9531 set inet_aton d_inetaton
9534 : see if inttypes.h is available
9535 : we want a real compile instead of Inhdr because some systems
9536 : have an inttypes.h which includes non-existent headers
9539 #include <inttypes.h>
9541 static int32_t foo32 = 0x12345678;
9545 if eval $compile; then
9546 echo "<inttypes.h> found." >&4
9549 echo "<inttypes.h> NOT found." >&4
9558 echo "Checking to see if you have int64_t..." >&4
9560 #include <sys/types.h>
9561 #$i_inttypes I_INTTYPES
9563 #include <inttypes.h>
9565 int main() { int64_t x = 7; }
9568 if eval $compile; then
9570 echo "You have int64_t."
9573 echo "You do not have int64_t."
9581 $cat >isascii.c <<'EOCP'
9593 if eval $compile; then
9594 echo "isascii() found." >&4
9597 echo "isascii() NOT found." >&4
9604 : see if isnan exists
9608 : see if isnanl exists
9612 : see if killpg exists
9616 : see if lchown exists
9618 $cat > try.c <<'EOCP'
9619 /* System header to define __stub macros and hopefully few prototypes,
9620 which can conflict with char lchown(); below. */
9622 /* Override any gcc2 internal prototype to avoid an error. */
9623 /* We use char because int might match the return type of a gcc2
9624 builtin and then its argument prototype would still apply. */
9627 /* The GNU C library defines this for functions which it implements
9628 to always fail with ENOSYS. Some functions are actually named
9629 something starting with __ and the normal name is an alias. */
9630 #if defined (__stub_lchown) || defined (__stub___lchown)
9638 if eval $compile; then
9639 $echo "lchown() found." >&4
9642 $echo "lchown() NOT found." >&4
9648 : See if number of significant digits in a double precision number is known
9650 $cat >ldbl_dig.c <<EOM
9660 printf("Contains LDBL_DIG");
9663 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
9664 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
9665 echo "LDBL_DIG found." >&4
9668 echo "LDBL_DIG NOT found." >&4
9675 : see if link exists
9679 : see if localeconv exists
9680 set localeconv d_locconv
9683 : see if lockf exists
9687 : check for long long
9689 echo "Checking to see if you have long long..." >&4
9690 echo 'int main() { long long x = 7; return 0; }' > try.c
9692 if eval $compile; then
9694 echo "You have have long long."
9697 echo "You do not have long long."
9703 : check for length of long long
9704 case "${d_longlong}${longlongsize}" in
9707 echo "Checking to see how big your long longs are..." >&4
9708 $cat >try.c <<'EOCP'
9712 printf("%d\n", (int)sizeof(long long));
9717 if eval $compile_ok; then
9718 longlongsize=`./try$exe_ext`
9719 echo "Your long longs are $longlongsize bytes long."
9723 echo "(I can't seem to compile the test program. Guessing...)"
9724 rp="What is the size of a long long (in bytes)?"
9728 if $test "X$longsize" = "X$longlongsize"; then
9729 echo "(That isn't any different from an ordinary long.)"
9735 : see if prototype for lseek is available
9737 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
9740 : see if lstat exists
9744 : see if madvise exists
9745 set madvise d_madvise
9748 : see if mblen exists
9752 : see if mbstowcs exists
9753 set mbstowcs d_mbstowcs
9756 : see if mbtowc exists
9760 : see if memchr exists
9764 : see if memcmp exists
9768 : see if memcpy exists
9772 : see if memmove exists
9773 set memmove d_memmove
9776 : see if memset exists
9780 : see if mkdir exists
9784 : see if mkdtemp exists
9785 set mkdtemp d_mkdtemp
9788 : see if mkfifo exists
9792 : see if mkstemp exists
9793 set mkstemp d_mkstemp
9796 : see if mkstemps exists
9797 set mkstemps d_mkstemps
9800 : see if mktime exists
9804 : see if this is a sys/mman.h system
9805 set sys/mman.h i_sysmman
9808 : see if mmap exists
9811 : see what shmat returns
9812 : default to something harmless
9814 case "$i_sysmman$d_mmap" in
9816 $cat >mmap.c <<'END'
9817 #include <sys/mman.h>
9820 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
9825 echo "and it returns ($mmaptype)." >&4
9831 : see if modfl exists
9835 : see if mprotect exists
9836 set mprotect d_mprotect
9839 : see if msgctl exists
9843 : see if msgget exists
9847 : see if msgsnd exists
9851 : see if msgrcv exists
9855 : see how much of the 'msg*(2)' library is present.
9858 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
9859 *"$undef"*) h_msg=false;;
9863 case "`ipcs 2>&1`" in
9864 "SVID messages"*"not configured"*)
9865 echo "Your $osname does not have the msg*(2) configured." >&4
9880 : we could also check for sys/ipc.h ...
9881 if $h_msg && $test `./findhdr sys/msg.h`; then
9882 echo "You have the full msg*(2) library." >&4
9885 echo "You don't have the full msg*(2) library." >&4
9891 : see if msync exists
9895 : see if munmap exists
9899 : see if nice exists
9905 echo "Checking which 64-bit integer type we could use..." >&4
9911 val='"unsigned int"'
9916 *) case "$longsize" in
9920 val='"unsigned long"'
9925 *) case "$d_longlong:$longlongsize" in
9930 val='"unsigned long long"'
9935 *) case "$d_int64_t" in
9954 '') echo "Alas, no 64-bit integer types in sight." >&4
9957 *) if test X"$use64bitint" = Xdefine -o X"$longsize" = X8; then
9962 echo "We $verb use '$quadtype' for 64-bit integers." >&4
9967 : check for length of character
9971 echo "Checking to see how big your characters are (hey, you never know)..." >&4
9972 $cat >try.c <<'EOCP'
9976 printf("%d\n", (int)sizeof(char));
9981 if eval $compile_ok; then
9985 echo "(I can't seem to compile the test program. Guessing...)"
9992 rp="What is the size of a character (in bytes)?"
9999 $echo "Choosing the C types to be used for Perl's internal types..." >&4
10001 case "$use64bitint:$d_quad:$quadtype" in
10004 uvtype="$uquadtype"
10009 uvtype="unsigned long"
10015 case "$uselongdouble:$d_longdbl" in
10017 nvtype="long double"
10018 nvsize=$longdblsize
10025 $echo "(IV will be "$ivtype", $ivsize bytes)"
10026 $echo "(UV will be "$uvtype", $uvsize bytes)"
10027 $echo "(NV will be "$nvtype", $nvsize bytes)"
10030 #$i_inttypes I_INTTYPES
10032 #include <inttypes.h>
10037 int8_t i = INT8_MAX;
10038 uint8_t u = UINT8_MAX;
10039 printf("int8_t\n");
10042 int16_t i = INT16_MAX;
10043 uint16_t i = UINT16_MAX;
10044 printf("int16_t\n");
10047 int32_t i = INT32_MAX;
10048 uint32_t u = UINT32_MAX;
10049 printf("int32_t\n");
10055 '') case "$charsize" in
10057 u8type="unsigned char"
10066 if eval $compile; then
10067 case "`./try$exe_ext`" in
10068 int8_t) i8type=int8_t
10078 '') if $test $charsize -ge 1; then
10080 u8type="unsigned char"
10088 '') case "$shortsize" in
10090 u16type="unsigned short"
10098 '') set try -DINT16
10099 if eval $compile; then
10100 case "`./try$exe_ext`" in
10112 '') if $test $shortsize -ge 2; then
10114 u16type="unsigned short"
10122 '') case "$longsize" in
10124 u32type="unsigned long"
10128 *) case "$intsize" in
10130 u32type="unsigned int"
10140 '') set try -DINT32
10141 if eval $compile; then
10142 case "`./try$exe_ext`" in
10154 '') if $test $intsize -ge 4; then
10156 u32type="unsigned int"
10164 '') case "$d_quad:$quadtype" in
10166 i64type="$quadtype"
10167 u64type="$uquadtype"
10175 $echo "Checking whether your NVs can preserve your UVs..." >&4
10179 $uvtype k = ($uvtype)~0, l;
10185 printf("preserve\n");
10190 if eval $compile; then
10191 case "`./try$exe_ext`" in
10192 preserve) d_nv_preserves_uv="$define" ;;
10195 case "$d_nv_preserves_uv" in
10196 $define) $echo "Yes, they can." 2>&1 ;;
10197 *) $echo "No, they can't." 2>&1
10198 d_nv_preserves_uv="$undef"
10205 : check for off64_t
10207 echo "Checking to see if you have off64_t..." >&4
10209 #include <sys/types.h>
10210 #include <unistd.h>
10211 int main() { off64_t x = 7; }
10214 if eval $compile; then
10216 echo "You have off64_t."
10219 echo "You do not have off64_t."
10220 case "$lseeksize" in
10221 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
10228 : see if POSIX threads are available
10229 set pthread.h i_pthread
10235 : how to create joinable pthreads
10236 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
10238 echo "Checking what constant to use for creating joinable pthreads..." >&4
10239 $cat >try.c <<'EOCP'
10240 #include <pthread.h>
10242 int detachstate = JOINABLE;
10245 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
10246 if eval $compile; then
10247 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
10248 val="$undef" # Yes, undef.
10249 set d_old_pthread_create_joinable
10252 set old_pthread_create_joinable
10255 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
10256 if eval $compile; then
10257 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
10259 set d_old_pthread_create_joinable
10261 val=PTHREAD_CREATE_UNDETACHED
10262 set old_pthread_create_joinable
10265 set try -DJOINABLE=__UNDETACHED
10266 if eval $compile; then
10267 echo "You seem to use __UNDETACHED." >&4
10269 set d_old_pthread_create_joinable
10272 set old_pthread_create_joinable
10275 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
10277 set d_old_pthread_create_joinable
10280 set old_pthread_create_joinable
10287 d_old_pthread_create_joinable="$undef"
10288 old_pthread_create_joinable=""
10291 : see if pause exists
10295 : see if pipe exists
10299 : see if poll exists
10304 : see whether the various POSIXish _yields exist
10306 #include <pthread.h>
10312 #ifdef PTHREAD_YIELD
10315 #ifdef PTHREAD_YIELD_NULL
10316 pthread_yield(NULL);
10322 : see if sched_yield exists
10323 set try -DSCHED_YIELD
10324 if eval $compile; then
10326 sched_yield='sched_yield()'
10330 case "$usethreads" in
10333 $define) echo 'sched_yield() found.' >&4 ;;
10334 *) echo 'sched_yield() NOT found.' >&4 ;;
10340 : see if pthread_yield exists
10341 set try -DPTHREAD_YIELD
10342 if eval $compile; then
10344 case "$sched_yield" in
10345 '') sched_yield='pthread_yield()' ;;
10348 set try -DPTHREAD_YIELD_NULL
10349 if eval $compile; then
10351 case "$sched_yield" in
10352 '') sched_yield='pthread_yield(NULL)' ;;
10358 case "$usethreads" in
10361 $define) echo 'pthread_yield() found.' >&4 ;;
10362 *) echo 'pthread_yield() NOT found.' >&4 ;;
10366 set d_pthread_yield
10369 case "$sched_yield" in
10370 '') sched_yield=undef ;;
10375 : see if this is a pwd.h system
10381 xxx=`./findhdr pwd.h`
10382 $cppstdin $cppflags $cppminus < $xxx >$$.h
10384 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
10392 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
10400 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
10408 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
10416 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
10424 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
10432 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
10440 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
10452 set d_pwquota; eval $setvar
10453 set d_pwage; eval $setvar
10454 set d_pwchange; eval $setvar
10455 set d_pwclass; eval $setvar
10456 set d_pwexpire; eval $setvar
10457 set d_pwcomment; eval $setvar
10458 set d_pwgecos; eval $setvar
10459 set d_pwpasswd; eval $setvar
10463 : see if readdir and friends exist
10464 set readdir d_readdir
10466 set seekdir d_seekdir
10468 set telldir d_telldir
10470 set rewinddir d_rewinddir
10473 : see if readlink exists
10474 set readlink d_readlink
10477 : see if rename exists
10478 set rename d_rename
10481 : see if rmdir exists
10485 : see if memory.h is available.
10490 : See if it conflicts with string.h
10496 $cppstdin $cppflags $cppminus < $strings > mem.h
10497 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
10499 echo "We won't be including <memory.h>."
10509 : can bcopy handle overlapping blocks?
10514 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
10516 #$i_memory I_MEMORY
10517 #$i_stdlib I_STDLIB
10518 #$i_string I_STRING
10519 #$i_unistd I_UNISTD
10521 $cat >>try.c <<'EOCP'
10524 # include <memory.h>
10527 # include <stdlib.h>
10530 # include <string.h>
10532 # include <strings.h>
10535 # include <unistd.h> /* Needed for NetBSD */
10539 char buf[128], abc[128];
10545 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
10547 for (align = 7; align >= 0; align--) {
10548 for (len = 36; len; len--) {
10550 bcopy(abc, b, len);
10551 for (off = 1; off <= len; off++) {
10552 bcopy(b, b+off, len);
10553 bcopy(b+off, b, len);
10554 if (bcmp(b, abc, len))
10563 if eval $compile_ok; then
10564 if ./try 2>/dev/null; then
10565 echo "Yes, it can."
10568 echo "It can't, sorry."
10569 case "$d_memmove" in
10570 "$define") echo "But that's Ok since you have memmove()." ;;
10574 echo "(I can't compile the test program, so we'll assume not...)"
10575 case "$d_memmove" in
10576 "$define") echo "But that's Ok since you have memmove()." ;;
10581 $rm -f try.* try core
10585 : can memcpy handle overlapping blocks?
10587 case "$d_memcpy" in
10590 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
10592 #$i_memory I_MEMORY
10593 #$i_stdlib I_STDLIB
10594 #$i_string I_STRING
10595 #$i_unistd I_UNISTD
10597 $cat >>try.c <<'EOCP'
10600 # include <memory.h>
10603 # include <stdlib.h>
10606 # include <string.h>
10608 # include <strings.h>
10611 # include <unistd.h> /* Needed for NetBSD */
10615 char buf[128], abc[128];
10621 /* Copy "abcde..." string to char abc[] so that gcc doesn't
10622 try to store the string in read-only memory. */
10623 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
10625 for (align = 7; align >= 0; align--) {
10626 for (len = 36; len; len--) {
10628 memcpy(b, abc, len);
10629 for (off = 1; off <= len; off++) {
10630 memcpy(b+off, b, len);
10631 memcpy(b, b+off, len);
10632 if (memcmp(b, abc, len))
10641 if eval $compile_ok; then
10642 if ./try 2>/dev/null; then
10643 echo "Yes, it can."
10646 echo "It can't, sorry."
10647 case "$d_memmove" in
10648 "$define") echo "But that's Ok since you have memmove()." ;;
10652 echo "(I can't compile the test program, so we'll assume not...)"
10653 case "$d_memmove" in
10654 "$define") echo "But that's Ok since you have memmove()." ;;
10659 $rm -f try.* try core
10663 : can memcmp be trusted to compare relative magnitude?
10665 case "$d_memcmp" in
10668 echo "Checking if your memcmp() can compare relative magnitude..." >&4
10670 #$i_memory I_MEMORY
10671 #$i_stdlib I_STDLIB
10672 #$i_string I_STRING
10673 #$i_unistd I_UNISTD
10675 $cat >>try.c <<'EOCP'
10678 # include <memory.h>
10681 # include <stdlib.h>
10684 # include <string.h>
10686 # include <strings.h>
10689 # include <unistd.h> /* Needed for NetBSD */
10695 if ((a < b) && memcmp(&a, &b, 1) < 0)
10701 if eval $compile_ok; then
10702 if ./try 2>/dev/null; then
10703 echo "Yes, it can."
10706 echo "No, it can't (it uses signed chars)."
10709 echo "(I can't compile the test program, so we'll assume not...)"
10713 $rm -f try.* try core
10717 : see if select exists
10718 set select d_select
10721 : see if semctl exists
10722 set semctl d_semctl
10725 : see if semget exists
10726 set semget d_semget
10729 : see if semop exists
10733 : see how much of the 'sem*(2)' library is present.
10736 case "$d_semctl$d_semget$d_semop" in
10737 *"$undef"*) h_sem=false;;
10741 case "`ipcs 2>&1`" in
10742 "SVID messages"*"not configured"*)
10743 echo "Your $osname does not have the sem*(2) configured." >&4
10746 set semctl d_semctl
10748 set semget d_semget
10756 : we could also check for sys/ipc.h ...
10757 if $h_sem && $test `./findhdr sys/sem.h`; then
10758 echo "You have the full sem*(2) library." >&4
10761 echo "You don't have the full sem*(2) library." >&4
10767 : see whether sys/sem.h defines union semun
10769 $cat > try.c <<'END'
10770 #include <sys/types.h>
10771 #include <sys/ipc.h>
10772 #include <sys/sem.h>
10773 int main () { union semun semun; semun.buf = 0; }
10776 if eval $compile; then
10777 echo "You have union semun in <sys/sem.h>." >&4
10780 echo "You do not have union semun in <sys/sem.h>." >&4
10783 $rm -f try try.c try.h
10787 : see how to do semctl IPC_STAT
10790 : see whether semctl IPC_STAT can use union semun
10795 # define S_IRUSR S_IREAD
10796 # define S_IWUSR S_IWRITE
10797 # define S_IXUSR S_IEXEC
10799 # define S_IRUSR 0400
10800 # define S_IWUSR 0200
10801 # define S_IXUSR 0100
10803 # define S_IRGRP (S_IRUSR>>3)
10804 # define S_IWGRP (S_IWUSR>>3)
10805 # define S_IXGRP (S_IXUSR>>3)
10806 # define S_IROTH (S_IRUSR>>6)
10807 # define S_IWOTH (S_IWUSR>>6)
10808 # define S_IXOTH (S_IXUSR>>6)
10811 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
10812 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
10813 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
10818 #include <sys/types.h>
10819 #include <sys/ipc.h>
10820 #include <sys/sem.h>
10821 #include <sys/stat.h>
10828 #$d_union_semun HAS_UNION_SEMUN
10831 #ifndef HAS_UNION_SEMUN
10834 struct semid_ds *buf;
10835 unsigned short *array;
10841 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
10842 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
10844 struct semid_ds argbuf;
10847 st = semctl(sem, 0, IPC_STAT, arg);
10851 # endif /* IPC_STAT */
10852 printf("semctl IPC_STAT failed: errno = %d\n", errno);
10854 if (semctl(sem, 0, IPC_RMID, arg) != 0)
10855 # endif /* IPC_RMID */
10856 printf("semctl IPC_RMID failed: errno = %d\n", errno);
10858 #endif /* IPC_PRIVATE && ... */
10859 printf("semget failed: errno = %d\n", errno);
10865 if eval $compile; then
10868 semun) val="$define" ;;
10874 case "$d_semctl_semun" in
10876 echo "You can use union semun for semctl IPC_STAT." >&4
10879 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
10884 : see whether semctl IPC_STAT can use struct semid_ds pointer
10885 $cat > try.c <<'END'
10886 #include <sys/types.h>
10887 #include <sys/ipc.h>
10888 #include <sys/sem.h>
10889 #include <sys/stat.h>
10897 struct semid_ds arg;
10900 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
10901 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
10904 st = semctl(sem, 0, IPC_STAT, &arg);
10906 printf("semid_ds\n");
10908 # endif /* IPC_STAT */
10909 printf("semctl IPC_STAT failed: errno = %d\n", errno);
10911 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
10912 # endif /* IPC_RMID */
10913 printf("semctl IPC_RMID failed: errno = %d\n", errno);
10915 #endif /* IPC_PRIVATE && ... */
10916 printf("semget failed: errno = %d\n", errno);
10923 if eval $compile; then
10926 semid_ds) val="$define" ;;
10930 set d_semctl_semid_ds
10932 case "$d_semctl_semid_ds" in
10934 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
10936 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
10943 # We do not have the full sem*(2) library, so assume we can not
10949 set d_semctl_semid_ds
10954 : see if setegid exists
10955 set setegid d_setegid
10958 : see if seteuid exists
10959 set seteuid d_seteuid
10962 : see if setgrent exists
10963 set setgrent d_setgrent
10966 : see if sethostent exists
10967 set sethostent d_sethent
10970 : see if setlinebuf exists
10971 set setlinebuf d_setlinebuf
10974 : see if setlocale exists
10975 set setlocale d_setlocale
10978 : see if setnetent exists
10979 set setnetent d_setnent
10982 : see if setprotoent exists
10983 set setprotoent d_setpent
10986 : see if setpgid exists
10987 set setpgid d_setpgid
10990 : see if setpgrp2 exists
10991 set setpgrp2 d_setpgrp2
10994 : see if setpriority exists
10995 set setpriority d_setprior
10998 : see if setpwent exists
10999 set setpwent d_setpwent
11002 : see if setregid exists
11003 set setregid d_setregid
11005 set setresgid d_setresgid
11008 : see if setreuid exists
11009 set setreuid d_setreuid
11011 set setresuid d_setresuid
11014 : see if setrgid exists
11015 set setrgid d_setrgid
11018 : see if setruid exists
11019 set setruid d_setruid
11022 : see if setservent exists
11023 set setservent d_setsent
11026 : see if setsid exists
11027 set setsid d_setsid
11030 : see if setspent exists
11031 set setspent d_setspent
11034 : see if setvbuf exists
11035 set setvbuf d_setvbuf
11038 : see if sfio.h is available
11043 : see if sfio library is available
11054 : Ok, but do we want to use it.
11058 true|$define|[yY]*) dflt='y';;
11061 echo "$package can use the sfio library, but it is experimental."
11062 rp="You seem to have sfio available, do you want to try using it?"
11066 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
11068 : Remove sfio from list of libraries to use
11069 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
11072 echo "libs = $libs" >&4
11076 *) case "$usesfio" in
11077 true|$define|[yY]*)
11078 echo "Sorry, cannot find sfio on this machine" >&4
11079 echo "Ignoring your setting of usesfio=$usesfio" >&4
11087 $define) usesfio='true';;
11088 *) usesfio='false';;
11091 : see if shmctl exists
11092 set shmctl d_shmctl
11095 : see if shmget exists
11096 set shmget d_shmget
11099 : see if shmat exists
11102 : see what shmat returns
11105 $cat >shmat.c <<'END'
11106 #include <sys/shm.h>
11109 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
11114 echo "and it returns ($shmattype)." >&4
11115 : see if a prototype for shmat is available
11116 xxx=`./findhdr sys/shm.h`
11117 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
11118 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
11129 set d_shmatprototype
11132 : see if shmdt exists
11136 : see how much of the 'shm*(2)' library is present.
11139 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
11140 *"$undef"*) h_shm=false;;
11144 case "`ipcs 2>&1`" in
11145 "SVID shared memory"*"not configured"*)
11146 echo "Your $osname does not have the shm*(2) configured." >&4
11149 set shmctl d_shmctl
11151 set shmget d_shmget
11161 : we could also check for sys/ipc.h ...
11162 if $h_shm && $test `./findhdr sys/shm.h`; then
11163 echo "You have the full shm*(2) library." >&4
11166 echo "You don't have the full shm*(2) library." >&4
11173 : see if we have sigaction
11174 if set sigaction val -f d_sigaction; eval $csym; $val; then
11175 echo 'sigaction() found.' >&4
11176 $cat > try.c <<'EOP'
11178 #include <sys/types.h>
11179 #include <signal.h>
11182 struct sigaction act, oact;
11184 oact.sa_handler = 0;
11185 /* so that act and oact are used */
11186 exit(act.sa_flags == 0 && oact.sa_handler == 0);
11190 if eval $compile_ok; then
11193 echo "But you don't seem to have a useable struct sigaction." >&4
11197 echo 'sigaction NOT found.' >&4
11200 set d_sigaction; eval $setvar
11201 $rm -f try try$_o try.c
11203 : see if sigsetjmp exists
11205 case "$d_sigsetjmp" in
11207 $cat >try.c <<'EOP'
11208 #include <setjmp.h>
11213 if (sigsetjmp(env,1))
11216 siglongjmp(env, 1);
11221 if eval $compile; then
11222 if ./try >/dev/null 2>&1; then
11223 echo "POSIX sigsetjmp found." >&4
11227 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
11233 echo "sigsetjmp not found." >&4
11237 *) val="$d_sigsetjmp"
11238 case "$d_sigsetjmp" in
11239 $define) echo "POSIX sigsetjmp found." >&4;;
11240 $undef) echo "sigsetjmp not found." >&4;;
11248 : see if sys/stat.h is available
11249 set sys/stat.h i_sysstat
11253 : see if stat knows about block sizes
11255 echo "Checking to see if your struct stat has st_blocks field..." >&4
11256 set d_statblks stat st_blocks $i_sysstat sys/stat.h
11260 : see if this is a sys/vfs.h system
11261 set sys/vfs.h i_sysvfs
11265 : see if this is a sys/statfs.h system
11266 set sys/statfs.h i_sysstatfs
11271 echo "Checking to see if your system supports struct statfs..." >&4
11272 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
11274 case "$d_statfs_s" in
11275 "$define") echo "Yes, it does." ;;
11276 *) echo "No, it doesn't." ;;
11281 : see if struct statfs knows about f_flags
11282 case "$d_statfs_s" in
11285 echo "Checking to see if your struct statfs has f_flags field..." >&4
11286 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
11290 set d_statfs_f_flags
11294 case "$d_statfs_f_flags" in
11295 "$define") echo "Yes, it does." ;;
11296 *) echo "No, it doesn't." ;;
11299 : see if _ptr and _cnt from stdio act std
11301 if $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
11302 echo "(Looks like you have stdio.h from Linux.)"
11303 case "$stdio_ptr" in
11304 '') stdio_ptr='((fp)->_IO_read_ptr)'
11307 *) ptr_lval=$d_stdio_ptr_lval;;
11309 case "$stdio_cnt" in
11310 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
11313 *) cnt_lval=$d_stdio_cnt_lval;;
11315 case "$stdio_base" in
11316 '') stdio_base='((fp)->_IO_read_base)';;
11318 case "$stdio_bufsiz" in
11319 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
11322 case "$stdio_ptr" in
11323 '') stdio_ptr='((fp)->_ptr)'
11326 *) ptr_lval=$d_stdio_ptr_lval;;
11328 case "$stdio_cnt" in
11329 '') stdio_cnt='((fp)->_cnt)'
11332 *) cnt_lval=$d_stdio_cnt_lval;;
11334 case "$stdio_base" in
11335 '') stdio_base='((fp)->_base)';;
11337 case "$stdio_bufsiz" in
11338 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
11341 : test whether _ptr and _cnt really work
11342 echo "Checking how std your stdio is..." >&4
11345 #define FILE_ptr(fp) $stdio_ptr
11346 #define FILE_cnt(fp) $stdio_cnt
11348 FILE *fp = fopen("try.c", "r");
11351 18 <= FILE_cnt(fp) &&
11352 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
11360 if eval $compile; then
11362 echo "Your stdio acts pretty std."
11365 echo "Your stdio isn't very std."
11368 echo "Your stdio doesn't appear very std."
11374 : Can _ptr be used as an lvalue?
11375 case "$d_stdstdio$ptr_lval" in
11376 $define$define) val=$define ;;
11379 set d_stdio_ptr_lval
11382 : Can _cnt be used as an lvalue?
11383 case "$d_stdstdio$cnt_lval" in
11384 $define$define) val=$define ;;
11387 set d_stdio_cnt_lval
11390 : see if _base is also standard
11392 case "$d_stdstdio" in
11396 #define FILE_base(fp) $stdio_base
11397 #define FILE_bufsiz(fp) $stdio_bufsiz
11399 FILE *fp = fopen("try.c", "r");
11402 19 <= FILE_bufsiz(fp) &&
11403 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
11410 if eval $compile; then
11412 echo "And its _base field acts std."
11415 echo "But its _base field isn't std."
11418 echo "However, it seems to be lacking the _base field."
11427 Checking how to access stdio streams by file descriptor number...
11429 case "$stdio_stream_array" in
11430 '') $cat >try.c <<EOCP
11433 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
11437 for s in _iob __iob __sF
11439 set try -DSTDIO_STREAM_ARRAY=$s
11440 if eval $compile; then
11441 case "`./try$exe_ext`" in
11442 yes) stdio_stream_array=$s; break ;;
11446 $rm -f try.* try$exe_ext
11448 case "$stdio_stream_array" in
11450 I can't figure out how to access stdio streams by file descriptor number.
11452 d_stdio_stream_array="$undef"
11455 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
11457 d_stdio_stream_array="$define"
11461 : see if strcoll exists
11462 set strcoll d_strcoll
11465 : check for structure copying
11467 echo "Checking to see if your C compiler can copy structs..." >&4
11468 $cat >try.c <<'EOCP'
11478 if $cc -c try.c >/dev/null 2>&1 ; then
11480 echo "Yup, it can."
11483 echo "Nope, it can't."
11489 : see if strerror and/or sys_errlist[] exist
11491 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
11492 if set strerror val -f d_strerror; eval $csym; $val; then
11493 echo 'strerror() found.' >&4
11494 d_strerror="$define"
11495 d_strerrm='strerror(e)'
11496 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
11497 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
11498 d_syserrlst="$define"
11500 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
11501 d_syserrlst="$undef"
11503 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
11504 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
11505 echo 'strerror() found in string header.' >&4
11506 d_strerror="$define"
11507 d_strerrm='strerror(e)'
11508 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
11509 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
11510 d_syserrlst="$define"
11512 echo "(You don't appear to have any sys_errlist[], how can this be?)"
11513 d_syserrlst="$undef"
11515 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
11516 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
11517 d_strerror="$undef"
11518 d_syserrlst="$define"
11519 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
11521 echo 'strerror() and sys_errlist[] NOT found.' >&4
11522 d_strerror="$undef"
11523 d_syserrlst="$undef"
11524 d_strerrm='"unknown"'
11528 : see if strtod exists
11529 set strtod d_strtod
11532 : see if strtol exists
11533 set strtol d_strtol
11536 : see if strtold exists
11537 set strtold d_strtold
11540 : see if strtoll exists
11541 set strtoll d_strtoll
11544 case "$d_longlong-$d_strtoll" in
11547 Checking whether your strtoll() works okay...
11549 $cat >try.c <<'EOCP'
11552 #define strtoll __strtoll
11555 extern long long int strtoll(char *s, char **, int);
11556 static int bad = 0;
11557 int check(char *s, long long ell, int een) {
11560 gll = strtoll(s, 0, 10);
11561 if (!((gll == ell) && (errno == een)))
11565 check(" 1", 1LL, 0);
11566 check(" 0", 0LL, 0);
11567 check("-1", -1LL, 0);
11568 check("-9223372036854775808", -9223372036854775808LL, 0);
11569 check("-9223372036854775808", -9223372036854775808LL, 0);
11570 check(" 9223372036854775807", 9223372036854775807LL, 0);
11571 check("-9223372036854775808", -9223372036854775808LL, 0);
11572 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
11573 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
11579 if eval $compile; then
11581 ok) echo "Your strtoll() seems to be working okay." ;;
11583 Your strtoll() doesn't seem to be working okay.
11592 : see if strtoul exists
11593 set strtoul d_strtoul
11596 : see if strtoull exists
11597 set strtoull d_strtoull
11600 case "$d_longlong-$d_strtoull" in
11603 Checking whether your strtoull() works okay...
11605 $cat >try.c <<'EOCP'
11608 #define strtoull __strtoull
11611 extern unsigned long long int strtoull(char *s, char **, int);
11612 static int bad = 0;
11613 int check(char *s, long long eull, int een) {
11616 gull = strtoull(s, 0, 10);
11617 if (!((gull == eull) && (errno == een)))
11621 check(" 1", 1LL, 0);
11622 check(" 0", 0LL, 0);
11623 check("18446744073709551615", 18446744073709551615ULL, 0);
11624 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
11630 if eval $compile; then
11632 ok) echo "Your strtoull() seems to be working okay." ;;
11634 Your strtoull() doesn't seem to be working okay.
11636 d_strtoull="$undef"
11643 : see if strtouq exists
11644 set strtouq d_strtouq
11647 : see if strxfrm exists
11648 set strxfrm d_strxfrm
11651 : see if symlink exists
11652 set symlink d_symlink
11655 : see if syscall exists
11656 set syscall d_syscall
11659 : see if sysconf exists
11660 set sysconf d_sysconf
11663 : see if system exists
11664 set system d_system
11667 : see if tcgetpgrp exists
11668 set tcgetpgrp d_tcgetpgrp
11671 : see if tcsetpgrp exists
11672 set tcsetpgrp d_tcsetpgrp
11675 : see if prototype for telldir is available
11677 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
11680 : see if this is a sys/times.h system
11681 set sys/times.h i_systimes
11684 : see if times exists
11686 if set times val -f d_times; eval $csym; $val; then
11687 echo 'times() found.' >&4
11690 case "$i_systimes" in
11691 "$define") inc='sys/times.h';;
11693 rp="What is the type returned by times() on this system?"
11694 set clock_t clocktype long stdio.h sys/types.h $inc
11697 echo 'times() NOT found, hope that will do.' >&4
11702 : see if truncate exists
11703 set truncate d_truncate
11706 : see if tzname[] exists
11708 if set tzname val -a d_tzname; eval $csym; $val; then
11710 echo 'tzname[] found.' >&4
11713 echo 'tzname[] NOT found.' >&4
11718 : see if umask exists
11722 : see if ustat exists
11726 : backward compatibility for d_hvfork
11727 if test X$d_hvfork != X; then
11728 d_vfork="$d_hvfork"
11731 : see if there is a vfork
11736 : Ok, but do we want to use it. vfork is reportedly unreliable in
11737 : perl on Solaris 2.x, and probably elsewhere.
11741 case "$usevfork" in
11747 Perl can only use a vfork() that doesn't suffer from strict
11748 restrictions on calling functions or modifying global data in
11749 the child. For example, glibc-2.1 contains such a vfork()
11750 that is unsuitable. If your system provides a proper fork()
11751 call, chances are that you do NOT want perl to use vfork().
11754 rp="Do you still want to use vfork()?"
11759 echo "Ok, we won't use vfork()."
11768 $define) usevfork='true';;
11769 *) usevfork='false';;
11772 : see if this is an sysdir system
11773 set sys/dir.h i_sysdir
11776 : see if this is an sysndir system
11777 set sys/ndir.h i_sysndir
11780 : see if closedir exists
11781 set closedir d_closedir
11784 case "$d_closedir" in
11787 echo "Checking whether closedir() returns a status..." >&4
11788 cat > closedir.c <<EOM
11789 #$i_dirent I_DIRENT /**/
11790 #$i_sysdir I_SYS_DIR /**/
11791 #$i_sysndir I_SYS_NDIR /**/
11792 #$i_systypes I_SYS_TYPES /**/
11794 #if defined(I_SYS_TYPES)
11795 #include <sys/types.h>
11797 #if defined(I_DIRENT)
11798 #include <dirent.h>
11799 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11800 #include <sys/dir.h>
11804 #include <sys/ndir.h>
11808 #include <ndir.h> /* may be wrong in the future */
11810 #include <sys/dir.h>
11815 int main() { return closedir(opendir(".")); }
11818 if eval $compile_ok; then
11819 if ./closedir > /dev/null 2>&1 ; then
11820 echo "Yes, it does."
11823 echo "No, it doesn't."
11827 echo "(I can't seem to compile the test program--assuming it doesn't)"
11835 set d_void_closedir
11838 : check for volatile keyword
11840 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
11841 $cat >try.c <<'EOCP'
11844 typedef struct _goo_struct goo_struct;
11845 goo_struct * volatile goo = ((goo_struct *)0);
11846 struct _goo_struct {
11851 typedef unsigned short foo_t;
11852 char *volatile foo;
11854 volatile foo_t blech;
11858 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
11860 echo "Yup, it does."
11863 echo "Nope, it doesn't."
11869 : see if there is a wait4
11873 : see if waitpid exists
11874 set waitpid d_waitpid
11877 : see if wcstombs exists
11878 set wcstombs d_wcstombs
11881 : see if wctomb exists
11882 set wctomb d_wctomb
11885 : preserve RCS keywords in files with variable substitution, grrr
11890 Revision='$Revision'
11892 case "$crosscompile" in
11893 ''|[nN]*) crosscompile="$undef" ;;
11897 next|rhapsody|darwin) multiarch="$define" ;;
11899 case "$multiarch" in
11900 ''|[nN]*) multiarch="$undef" ;;
11903 : check for alignment requirements
11905 case "$crosscompile$multiarch" in
11908 You seem to be either cross-compiling or doing a multiarchitecture build,
11909 skipping the memory alignment check.
11912 case "$alignbytes" in
11913 '') alignbytes=8 ;;
11917 case "$alignbytes" in
11918 '') echo "Checking alignment constraints..." >&4
11919 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
11920 $cat >try.c <<'EOCP'
11921 typedef long double NV;
11924 $cat >try.c <<'EOCP'
11928 $cat >>try.c <<'EOCP'
11936 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
11941 if eval $compile_ok; then
11945 echo "(I can't seem to compile the test program...)"
11948 *) dflt="$alignbytes"
11951 rp="Doubles must be aligned on a how-many-byte boundary?"
11959 : set the base revision
11962 : check for ordering of bytes in a long
11964 case "$crosscompile$multiarch" in
11967 You seem to be either cross-compiling or doing a multiarchitecture build,
11968 skipping the byteorder check.
11974 case "$byteorder" in
11977 In the following, larger digits indicate more significance. A big-endian
11978 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
11979 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
11980 machines may have weird orders like 3412. A Cray will report 87654321,
11981 an Alpha will report 12345678. If the test program works the default is
11983 I'm now running the test program...
11985 $cat >try.c <<'EOCP'
11992 char c[sizeof(long)];
11995 if (sizeof(long) > 4)
11996 u.l = (0x08070605L << 32) | 0x04030201L;
11999 for (i = 0; i < sizeof(long); i++)
12000 printf("%c", u.c[i]+'0');
12007 if eval $compile && ./try > /dev/null; then
12010 [1-4][1-4][1-4][1-4]|12345678|87654321)
12011 echo "(The test program ran ok.)"
12012 echo "byteorder=$dflt"
12015 ????|????????) echo "(The test program ran ok.)" ;;
12016 *) echo "(The test program didn't run right for some reason.)" ;;
12021 (I can't seem to compile the test program. Guessing big-endian...)
12024 case "$xxx_prompt" in
12026 rp="What is the order of bytes in a long?"
12040 : how do we catenate cpp tokens here?
12042 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
12043 $cat >cpp_stuff.c <<'EOCP'
12044 #define RCAT(a,b)a/**/b
12045 #define ACAT(a,b)a ## b
12049 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
12050 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
12051 echo "Oh! Smells like ANSI's been here." >&4
12052 echo "We can catify or stringify, separately or together!"
12054 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
12055 echo "Ah, yes! The good old days!" >&4
12056 echo "However, in the good old days we don't know how to stringify and"
12057 echo "catify at the same time."
12061 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
12062 to have to edit the values of CAT[2-5] in config.h...
12064 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
12068 : see if this is a db.h system
12074 : Check db version.
12076 echo "Checking Berkeley DB version ..." >&4
12082 #include <sys/types.h>
12087 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
12088 int Major, Minor, Patch ;
12089 unsigned long Version ;
12090 (void)db_version(&Major, &Minor, &Patch) ;
12091 printf("You have Berkeley DB Version 2 or greater\n");
12093 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
12094 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
12095 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
12096 Major, Minor, Patch) ;
12098 /* check that db.h & libdb are compatible */
12099 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
12100 printf("db.h and libdb are incompatible\n") ;
12104 printf("db.h and libdb are compatible\n") ;
12106 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
12107 + DB_VERSION_PATCH ;
12109 /* needs to be >= 2.3.4 */
12110 if (Version < 2003004) {
12111 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
12112 printf("but Perl needs Berkeley DB 2.3.4 or greater\n") ;
12118 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
12119 printf("You have Berkeley DB Version 1\n");
12120 exit(0); /* DB version < 2: the coast is clear. */
12122 exit(1); /* <db.h> not Berkeley DB? */
12128 if eval $compile_ok && ./try; then
12129 echo 'Looks OK.' >&4
12131 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
12135 : Remove db from list of libraries to use
12136 echo "Removing unusable -ldb from library list" >&4
12137 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
12140 echo "libs = $libs" >&4
12150 : Check the return type needed for hash
12152 echo "Checking return type needed for hash for Berkeley DB ..." >&4
12158 #include <sys/types.h>
12161 #ifndef DB_VERSION_MAJOR
12162 u_int32_t hash_cb (ptr, size)
12170 info.hash = hash_cb;
12174 if $cc $ccflags -c try.c >try.out 2>&1 ; then
12175 if $contains warning try.out >>/dev/null 2>&1 ; then
12178 db_hashtype='u_int32_t'
12181 : XXX Maybe we should just give up here.
12182 db_hashtype=u_int32_t
12184 echo "Help: I can't seem to compile the db test program." >&4
12185 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
12188 echo "Your version of Berkeley DB uses $db_hashtype for hash."
12190 *) db_hashtype=u_int32_t
12195 : Check the return type needed for prefix
12197 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
12203 #include <sys/types.h>
12206 #ifndef DB_VERSION_MAJOR
12207 size_t prefix_cb (key1, key2)
12215 info.prefix = prefix_cb;
12219 if $cc $ccflags -c try.c >try.out 2>&1 ; then
12220 if $contains warning try.out >>/dev/null 2>&1 ; then
12221 db_prefixtype='int'
12223 db_prefixtype='size_t'
12226 db_prefixtype='size_t'
12227 : XXX Maybe we should just give up here.
12229 echo "Help: I can't seem to compile the db test program." >&4
12230 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
12233 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
12235 *) db_prefixtype='size_t'
12239 : check for void type
12241 echo "Checking to see how well your C compiler groks the void type..." >&4
12242 case "$voidflags" in
12244 $cat >try.c <<'EOCP'
12250 extern void moo(); /* function returning void */
12251 void (*goo)(); /* ptr to func returning void */
12253 void *hue; /* generic ptr */
12266 int main() { sub(); }
12268 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
12269 voidflags=$defvoidused
12270 echo "Good. It appears to support void to the level $package wants.">&4
12271 if $contains warning .out >/dev/null 2>&1; then
12272 echo "However, you might get some warnings that look like this:"
12276 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
12277 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
12278 echo "It supports 1..."
12279 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
12280 echo "It also supports 2..."
12281 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
12283 echo "And it supports 4 but not 8 definitely."
12285 echo "It doesn't support 4..."
12286 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
12288 echo "But it supports 8."
12291 echo "Neither does it support 8."
12295 echo "It does not support 2..."
12296 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
12298 echo "But it supports 4 and 8."
12300 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
12302 echo "And it supports 4 but has not heard about 8."
12304 echo "However it supports 8 but not 4."
12309 echo "There is no support at all for void."
12314 case "$voidflags" in
12316 *) $cat >&4 <<'EOM'
12317 Support flag bits are:
12318 1: basic void declarations.
12319 2: arrays of pointers to functions returning void.
12320 4: operations between pointers to and addresses of void functions.
12321 8: generic void pointers.
12324 rp="Your void support flags add up to what?"
12332 : How can we generate normalized random numbers ?
12334 echo "Looking for a random number function..." >&4
12335 case "$randfunc" in
12337 if set drand48 val -f; eval $csym; $val; then
12339 echo "Good, found drand48()." >&4
12340 elif set random val -f; eval $csym; $val; then
12342 echo "OK, found random()." >&4
12345 echo "Yick, looks like I have to use rand()." >&4
12356 *-Dmy_rand=*|*-Dmy_srand=*)
12357 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
12358 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
12359 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
12360 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
12364 while $test "$cont"; do
12365 rp="Use which function to generate random numbers?"
12367 if $test "$ans" = "$dflt"; then
12373 if set $ans val -f; eval $csym; $val; then
12377 rp="I cannot find function $ans. Use that name anyway?"
12386 case "$randfunc" in
12388 drand01="drand48()"
12394 case "$randbits" in
12396 echo "Checking to see how many bits your $randfunc() function produces..." >&4
12398 #$i_unistd I_UNISTD
12399 #$i_stdlib I_STDLIB
12402 # include <unistd.h>
12405 # include <stdlib.h>
12410 register unsigned long tmp;
12411 register unsigned long max = 0L;
12413 for (i = 1000; i; i--) {
12414 tmp = (unsigned long) $randfunc();
12415 if (tmp > max) max = tmp;
12417 for (i = 0; max; i++)
12423 if eval $compile_ok; then
12427 echo "(I can't seem to compile the test program...)"
12434 rp="How many bits does your $randfunc() function produce?"
12438 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
12439 seedfunc="s$randfunc"
12440 randseedtype=unsigned
12444 rp="How many bits does your $randfunc() function produce?"
12447 seedfunc="s$randfunc"
12448 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
12449 if set $seedfunc val -f; eval $csym; $val; then
12450 echo "(Using $seedfunc() to seed random generator)"
12452 echo "(Warning: no $seedfunc() to seed random generator)"
12455 randseedtype=unsigned
12463 echo "Determining whether or not we are on an EBCDIC system..." >&4
12464 $cat >tebcdic.c <<'EOM'
12467 if ('M'==0xd4) return 0;
12474 if eval $compile_ok; then
12476 echo "You have EBCDIC." >&4
12479 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin." >&4
12482 echo "I'm unable to compile the test program." >&4
12483 echo "I'll assume ASCII or some ISO Latin." >&4
12485 $rm -f tebcdic.c tebcdic
12491 Checking how to flush all pending stdio output...
12493 # I only know how to find the first 32 possibly open files on SunOS.
12494 # See also hints/sunos_4_1.sh and util.c --AD
12496 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
12498 $cat >>try.c <<EOCP
12500 #$i_unistd I_UNISTD
12502 # include <unistd.h>
12504 #$d_sysconf HAS_SYSCONF
12505 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
12506 #ifdef HAS_STDIO_STREAM_ARRAY
12507 # define STDIO_STREAM_ARRAY $stdio_stream_array
12510 FILE* p = fopen("try.out", "w");
12514 # ifdef TRY_FPRINTF
12518 #ifdef TRY_FFLUSH_NULL
12521 #ifdef TRY_FFLUSH_ALL
12523 long open_max = -1;
12524 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
12525 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
12527 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
12528 open_max = sysconf(_SC_OPEN_MAX);
12531 open_max = FOPEN_MAX;
12534 open_max = OPEN_MAX;
12543 # ifdef HAS_STDIO_STREAM_ARRAY
12544 if (open_max > 0) {
12546 for (i = 0; i < open_max; i++)
12547 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
12548 STDIO_STREAM_ARRAY[i]._file < open_max &&
12549 STDIO_STREAM_ARRAY[i]._flag)
12550 fflush(&STDIO_STREAM_ARRAY[i]);
12558 : first we have to find out how _not_ to flush
12559 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
12561 set try -DTRY_FPUTC
12562 if eval $compile; then
12564 ./try$exe_ext 2>/dev/null
12565 if $test ! -s try.out -a "X$?" = X42; then
12571 set try -DTRY_FPRINTF
12573 if eval $compile; then
12575 ./try$exe_ext 2>/dev/null
12576 if $test ! -s try.out -a "X$?" = X42; then
12577 output=-DTRY_FPRINTF
12583 : check for fflush NULL behaviour
12584 case "$fflushNULL" in
12585 '') set try -DTRY_FFLUSH_NULL $output
12586 if eval $compile; then
12588 ./try$exe_ext 2>/dev/null
12590 if $test -s try.out -a "X$code" = X42; then
12591 fflushNULL="`$cat try.out`"
12593 if $test "X$code" != X42; then
12595 (If this test failed, don't worry, we'll try another method shortly.)
12600 $rm -f core try.core core.try.*
12601 case "$fflushNULL" in
12603 Your fflush(NULL) works okay for output streams.
12604 Let's see if it clobbers input pipes...
12606 # As of mid-March 2000 all versions of Solaris appear to have a stdio
12607 # bug that improperly flushes the input end of pipes. So we avoid the
12608 # autoflush on fork/system/exec support for now. :-(
12609 $cat >tryp.c <<EOCP
12612 main(int argc, char **argv)
12618 while ((i = getc(stdin)) != -1
12619 && (*bp++ = i) != '\n'
12620 && bp < &buf[1024])
12623 fprintf(stdout, "%s", buf);
12631 fflushNULL="$define"
12633 if eval $compile; then
12635 $cat tryp.c | ./tryp$exe_ext 2>/dev/null > tryp.out
12636 if cmp tryp.c tryp.out >/dev/null 2>&1; then
12638 fflush(NULL) seems to behave okay with input streams.
12640 fflushNULL="$define"
12643 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
12645 fflushNULL="$undef"
12648 $rm -f core tryp.c tryp.core core.tryp.*
12651 Your fflush(NULL) isn't working (contrary to ANSI C).
12653 fflushNULL="$undef"
12656 Cannot figure out whether your fflush(NULL) works or not.
12657 I'm assuming it doesn't (contrary to ANSI C).
12659 fflushNULL="$undef"
12663 $define|true|[yY]*)
12664 fflushNULL="$define"
12667 fflushNULL="$undef"
12670 : check explicit looping only if NULL did not work, and if the pipe
12671 : bug does not show up on an explicit flush too
12672 case "$fflushNULL" in
12674 $cat >tryp.c <<EOCP
12677 main(int argc, char **argv)
12683 while ((i = getc(stdin)) != -1
12684 && (*bp++ = i) != '\n'
12685 && bp < &buf[1024])
12688 fprintf(stdout, "%s", buf);
12697 if eval $compile; then
12699 $cat tryp.c | ./tryp$exe_ext 2>/dev/null > tryp.out
12700 if cmp tryp.c tryp.out >/dev/null 2>&1; then
12702 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
12704 : now check for fflushall behaviour
12705 case "$fflushall" in
12706 '') set try -DTRY_FFLUSH_ALL $output
12707 if eval $compile; then
12709 (Now testing the other method--but note that this also may fail.)
12712 ./try$exe_ext 2>/dev/null
12713 if $test -s try.out -a "X$?" = X42; then
12714 fflushall="`$cat try.out`"
12717 $rm -f core try.core core.try.*
12718 case "$fflushall" in
12720 Whew. Flushing explicitly all the stdio streams works.
12722 fflushall="$define"
12725 Sigh. Flushing explicitly all the stdio streams doesn't work.
12730 Cannot figure out whether flushing stdio streams explicitly works or not.
12731 I'm assuming it doesn't.
12737 "$define"|true|[yY]*)
12738 fflushall="$define"
12746 All is futile. Even fflush(stdin) clobbers input pipes!
12753 $rm -f core tryp.c tryp.core core.tryp.*
12755 *) fflushall="$undef"
12759 case "$fflushNULL$fflushall" in
12762 OK, I give up. I cannot figure out how to flush pending stdio output.
12763 We won't be flushing handles at all before fork/exec/popen.
12767 $rm -f try.* try$exe_ext
12769 : Store the full pathname to the ar program for use in the C program
12770 : Respect a hint or command line value for full_ar.
12775 : Store the full pathname to the sed program for use in the C program
12778 : see what type gids are declared as in the kernel
12780 echo "Looking for the type for group ids returned by getgid()."
12781 set gid_t gidtype xxx stdio.h sys/types.h
12785 xxx=`./findhdr sys/user.h`
12786 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
12788 unsigned) dflt="$1 $2" ;;
12792 *) dflt="$gidtype";;
12795 gid_t) echo "gid_t found." ;;
12796 *) rp="What is the type for group ids returned by getgid()?"
12804 *_t) zzz="$gidtype" ;;
12807 echo "Checking the size of $zzz..." >&4
12809 #include <sys/types.h>
12812 printf("%d\n", (int)sizeof($gidtype));
12817 if eval $compile_ok; then
12821 echo "(I can't execute the test program--guessing $gidsize.)" >&4
12824 echo "Your $zzz is $gidsize bytes long."
12829 echo "(I can't compile the test program--guessing $gidsize.)" >&4
12835 *_t) zzz="$gidtype" ;;
12838 echo "Checking the sign of $zzz..." >&4
12840 #include <sys/types.h>
12851 if eval $compile; then
12855 echo "(I can't execute the test program--guessing unsigned.)" >&4
12859 1) echo "Your $zzz is unsigned." ;;
12860 -1) echo "Your $zzz is signed." ;;
12866 echo "(I can't compile the test program--guessing unsigned.)" >&4
12872 if $test X"$quadtype" != X; then
12874 echo "Checking how to print 64-bit integers..." >&4
12876 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
12877 $cat >try.c <<'EOCP'
12878 #include <sys/types.h>
12881 int q = 12345678901;
12882 printf("%ld\n", q);
12886 if eval $compile; then
12887 yyy=`./try$exe_ext`
12890 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
12891 sPRIo64='"o"'; sPRIx64='"x"'; sPRIX64='"X"';
12892 echo "We will use %d."
12898 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
12899 $cat >try.c <<'EOCP'
12900 #include <sys/types.h>
12903 long q = 12345678901;
12904 printf("%ld\n", q);
12908 if eval $compile; then
12909 yyy=`./try$exe_ext`
12912 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
12913 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIX64='"lX"';
12914 echo "We will use %ld."
12920 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
12921 $cat >try.c <<'EOCP'
12922 #include <sys/types.h>
12923 #include <inttypes.h>
12926 int64_t q = 12345678901;
12927 printf("%" PRId64 "\n", q);
12931 if eval $compile; then
12932 yyy=`./try$exe_ext`
12935 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
12936 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIX64=PRIX64;
12937 echo "We will use the C9X style."
12943 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
12944 $cat >try.c <<'EOCP'
12945 #include <sys/types.h>
12948 long long q = 12345678901LL; /* AIX cc requires the LL prefix. */
12949 printf("%lld\n", q);
12953 if eval $compile; then
12954 yyy=`./try$exe_ext`
12957 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
12958 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIX64='"llX"';
12959 echo "We will use the %lld style."
12965 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
12967 #include <sys/types.h>
12970 $quadtype q = 12345678901;
12971 printf("%Ld\n", q);
12975 if eval $compile; then
12976 yyy=`./try$exe_ext`
12979 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
12980 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIX64='"LX"';
12981 echo "We will use %Ld."
12987 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
12989 #include <sys/types.h>
12992 $quadtype q = 12345678901;
12993 printf("%qd\n", q);
12997 if eval $compile; then
12998 yyy=`./try$exe_ext`
13001 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
13002 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIX64='"qX"';
13003 echo "We will use %qd."
13009 if $test X"$sPRId64" = X; then
13010 echo "Cannot figure out how to print 64-bit integers." >&4
13018 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
13019 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIX64="$undef";
13021 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
13022 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIX64="$define";
13028 $echo "Checking the format strings to be used for Perl's internal types..." >&4
13030 if $test X"$ivsize" = X8; then
13031 ivdformat="$sPRId64"
13032 uvuformat="$sPRIu64"
13033 uvoformat="$sPRIo64"
13034 uvxformat="$sPRIx64"
13036 if $test X"$ivsize" = X"$longsize"; then
13042 if $test X"$ivsize" = X"$intsize"; then
13049 if $test X"$ivsize" = X"$shortsize"; then
13059 case "$ivdformat" in
13060 '') echo "$0: Fatal: failed to find format strings, cannot continue." >& 4
13067 $echo "Checking the format string to be used for gids..." >&4
13070 -1) if $test X"$gidsize" = X"$ivsize"; then
13071 gidformat="$ivdformat"
13073 if $test X"$gidsize" = X"$longsize"; then
13076 if $test X"$gidsize" = X"$intsize"; then
13079 if $test X"$gidsize" = X"$shortsize"; then
13086 *) if $test X"$gidsize" = X"$uvsize"; then
13087 gidformat="$uvuformat"
13089 if $test X"$gidsize" = X"$longsize"; then
13092 if $test X"$gidsize" = X"$intsize"; then
13095 if $test X"$gidsize" = X"$shortsize"; then
13104 : see if getgroups exists
13105 set getgroups d_getgrps
13108 : see if setgroups exists
13109 set setgroups d_setgrps
13113 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
13115 case "$d_getgrps$d_setgrps" in
13117 case "$groupstype" in
13118 '') dflt="$gidtype" ;;
13119 *) dflt="$groupstype" ;;
13122 What type of pointer is the second argument to getgroups() and setgroups()?
13123 Usually this is the same as group ids, $gidtype, but not always.
13126 rp='What type pointer is the second argument to getgroups() and setgroups()?'
13130 *) groupstype="$gidtype";;
13134 echo "Checking if your $make program sets \$(MAKE)..." >&4
13135 case "$make_set_make" in
13137 $sed 's/^X //' > testmake.mak << 'EOF'
13139 X @echo 'maketemp="$(MAKE)"'
13141 case "`$make -f testmake.mak 2>/dev/null`" in
13142 *maketemp=*) make_set_make='#' ;;
13143 *) make_set_make="MAKE=$make" ;;
13145 $rm -f testmake.mak
13148 case "$make_set_make" in
13149 '#') echo "Yup, it does.";;
13150 *) echo "Nope, it doesn't.";;
13153 : see what type is used for mode_t
13154 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
13155 set mode_t modetype int stdio.h sys/types.h
13158 : define a fucntion to check prototypes
13159 $cat > protochk <<EOSH
13162 optimize="$optimize"
13164 prototype="$prototype"
13169 $cat >> protochk <<'EOSH'
13174 while test $# -ge 2; do
13176 $define) echo "#include <$2>" >> try.c ;;
13177 literal) echo "$2" >> try.c ;;
13181 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
13182 cat >> try.c <<'EOCP'
13183 #ifdef CAN_PROTOTYPE
13184 #define _(args) args
13189 echo "$foo" >> try.c
13190 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
13191 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
13197 $eunicefix protochk
13199 : see what type is used for size_t
13200 rp="What is the type used for the length parameter for string functions?"
13201 set size_t sizetype 'unsigned int' stdio.h sys/types.h
13204 : check for type of arguments to gethostbyaddr.
13205 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
13206 case "$d_gethbyaddr" in
13210 Checking to see what type of arguments are accepted by gethostbyaddr().
13212 hdrs="$define sys/types.h
13213 $d_socket sys/socket.h
13214 $i_niin netinet/in.h
13216 $i_unistd unistd.h"
13217 : The first arg can 'char *' or 'void *'
13218 : The second arg is some of integral type
13219 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
13220 for yyy in size_t long int; do
13221 case "$netdb_host_type" in
13222 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
13223 if ./protochk "$try" $hdrs; then
13224 echo "Your system accepts $xxx for the first arg."
13225 echo "...and $yyy for the second arg."
13226 netdb_host_type="$xxx"
13227 netdb_hlen_type="$yyy"
13233 : In case none of those worked, prompt the user.
13234 case "$netdb_host_type" in
13235 '') rp='What is the type for the 1st argument to gethostbyaddr?'
13238 netdb_host_type=$ans
13239 rp='What is the type for the 2nd argument to gethostbyaddr?'
13242 netdb_hlen_type=$ans
13246 *) : no gethostbyaddr, so pick harmless defaults
13247 netdb_host_type='char *'
13248 netdb_hlen_type="$sizetype"
13251 # Remove the "const" if needed. -- but then we'll have a
13253 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
13256 : check for type of argument to gethostbyname.
13257 if test "X$netdb_name_type" = X ; then
13258 case "$d_gethbyname" in
13262 Checking to see what type of argument is accepted by gethostbyname().
13264 hdrs="$define sys/types.h
13265 $d_socket sys/socket.h
13266 $i_niin netinet/in.h
13268 $i_unistd unistd.h"
13269 for xxx in "const char *" "char *"; do
13270 case "$netdb_name_type" in
13271 '') try="extern struct hostent *gethostbyname($xxx);"
13272 if ./protochk "$try" $hdrs; then
13273 echo "Your system accepts $xxx."
13274 netdb_name_type="$xxx"
13279 : In case none of those worked, prompt the user.
13280 case "$netdb_name_type" in
13281 '') rp='What is the type for the 1st argument to gethostbyname?'
13284 netdb_name_type=$ans
13288 *) : no gethostbyname, so pick harmless default
13289 netdb_name_type='char *'
13294 : check for type of 1st argument to getnetbyaddr.
13295 if test "X$netdb_net_type" = X ; then
13296 case "$d_getnbyaddr" in
13300 Checking to see what type of 1st argument is accepted by getnetbyaddr().
13302 hdrs="$define sys/types.h
13303 $d_socket sys/socket.h
13304 $i_niin netinet/in.h
13306 $i_unistd unistd.h"
13307 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
13308 case "$netdb_net_type" in
13309 '') try="extern struct netent *getnetbyaddr($xxx, int);"
13310 if ./protochk "$try" $hdrs; then
13311 echo "Your system accepts $xxx."
13312 netdb_net_type="$xxx"
13317 : In case none of those worked, prompt the user.
13318 case "$netdb_net_type" in
13319 '') rp='What is the type for the 1st argument to getnetbyaddr?'
13322 netdb_net_type=$ans
13326 *) : no getnetbyaddr, so pick harmless default
13327 netdb_net_type='long'
13331 : locate the preferred pager for this system
13345 '') dflt=/usr/ucb/more;;
13352 rp='What pager is used on your system?'
13356 : see what type pids are declared as in the kernel
13357 rp="What is the type of process ids on this system?"
13358 set pid_t pidtype int stdio.h sys/types.h
13361 : Find earliest binary compatible site_perl subdirectory perl can use.
13362 case "$bincompat5005" in
13363 "$define") xs_apiversion='5.005' ;;
13364 *) xs_apiversion=$version ;; # The current site_perl version.
13366 : Find earliest pure perl site_perl subdirectory perl can use.
13367 : The versioned directories started at 5.005.
13368 pm_apiversion='5.005'
13370 : check for length of pointer
13374 echo "Checking to see how big your pointers are..." >&4
13375 if test "$voidflags" -gt 7; then
13376 echo '#define VOID_PTR char *' > try.c
13378 echo '#define VOID_PTR void *' > try.c
13380 $cat >>try.c <<'EOCP'
13384 printf("%d\n", (int)sizeof(VOID_PTR));
13389 if eval $compile_ok; then
13391 echo "Your pointers are $ptrsize bytes long."
13394 echo "(I can't seem to compile the test program. Guessing...)" >&4
13395 rp="What is the size of a pointer (in bytes)?"
13403 : see if ar generates random libraries by itself
13405 echo "Checking how to generate random libraries on your machine..." >&4
13406 echo 'int bar1() { return bar2(); }' > bar1.c
13407 echo 'int bar2() { return 2; }' > bar2.c
13408 $cat > foo.c <<'EOP'
13409 int main() { printf("%d\n", bar1()); exit(0); }
13411 $cc $ccflags -c bar1.c >/dev/null 2>&1
13412 $cc $ccflags -c bar2.c >/dev/null 2>&1
13413 $cc $ccflags -c foo.c >/dev/null 2>&1
13414 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
13415 if $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
13416 ./foobar >/dev/null 2>&1; then
13417 echo "$ar appears to generate random libraries itself."
13420 elif $ar ts bar$_a >/dev/null 2>&1 &&
13421 $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
13422 ./foobar >/dev/null 2>&1; then
13423 echo "a table of contents needs to be added with '$ar ts'."
13430 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
13431 $test -f $ranlib || ranlib=''
13434 if $test -n "$ranlib"; then
13435 echo "your system has '$ranlib'; we'll use that."
13438 echo "your system doesn't seem to support random libraries"
13439 echo "so we'll use lorder and tsort to order the libraries."
13446 : check for type of arguments to select.
13447 case "$selecttype" in
13448 '') case "$d_select" in
13452 Checking to see what type of arguments are accepted by select().
13454 hdrs="$define sys/types.h
13455 $i_systime sys/time.h
13456 $i_sysselct sys/select.h
13457 $d_socket sys/socket.h"
13458 : The first arg can be int, unsigned, or size_t
13459 : The last arg may or may not be 'const'
13461 : void pointer has been seen but using that
13462 : breaks the selectminbits test
13463 for xxx in 'fd_set *' 'int *'; do
13464 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
13465 for tmo in 'struct timeval *' 'const struct timeval *'; do
13467 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
13468 if ./protochk "$try" $hdrs; then
13469 echo "Your system accepts $xxx."
13478 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
13479 case "$d_fd_set" in
13480 $define) dflt="fd_set *" ;;
13489 *) : no select, so pick a harmless default
13496 : check for the select 'width'
13497 case "$selectminbits" in
13498 '') case "$d_select" in
13502 Checking to see on how many bits at a time your select() operates...
13505 #include <sys/types.h>
13507 #$i_systime I_SYS_TIME
13508 #$i_systimek I_SYS_TIME_KERNEL
13513 # ifdef I_SYS_TIME_KERNEL
13516 # include <sys/time.h>
13517 # ifdef I_SYS_TIME_KERNEL
13521 #$i_sysselct I_SYS_SELECT
13522 #ifdef I_SYS_SELECT
13523 #include <sys/select.h>
13525 #$d_socket HAS_SOCKET
13527 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13531 #define S sizeof(*(b))
13533 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
13534 #define NBITS (NBYTES * 8)
13543 fp = fopen("try.c", "r");
13549 b = ($selecttype)s;
13550 for (i = 0; i < NBITS; i++)
13554 select(fd + 1, b, 0, 0, &t);
13555 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
13556 printf("%d\n", i + 1);
13561 if eval $compile_ok; then
13562 selectminbits=`./try`
13563 case "$selectminbits" in
13565 Cannot figure out on how many bits at a time your select() operates.
13566 I'll play safe and guess it is 32 bits.
13572 *) bits="$selectminbits bits" ;;
13574 echo "Your select() operates on $bits at a time." >&4
13576 rp='What is the minimum number of bits your select() operates on?'
13577 case "$byteorder" in
13578 1234|12345678) dflt=32 ;;
13583 selectminbits="$val"
13587 *) : no select, so pick a harmless default
13594 : Trace out the files included by signal.h, then look for SIGxxx names.
13595 : Remove SIGARRAYSIZE used by HPUX.
13596 : Remove SIGSTKSIZE used by Linux.
13597 : Remove SIGSTKSZ used by Posix.
13598 : Remove SIGTYP void lines used by OS2.
13599 : Some cpps, like os390, dont give the file name anywhere
13600 if [ "X$fieldn" = X ]; then
13601 : Just make some guesses. We check them later.
13602 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
13604 xxx=`echo '#include <signal.h>' |
13605 $cppstdin $cppminus $cppflags 2>/dev/null |
13606 $grep '^[ ]*#.*include' |
13607 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq`
13609 : Check this list of files to be sure we have parsed the cpp output ok.
13610 : This will also avoid potentially non-existent files, such
13613 for xx in $xxx /dev/null ; do
13614 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
13616 : If we have found no files, at least try signal.h
13617 case "$xxxfiles" in
13618 '') xxxfiles=`./findhdr signal.h` ;;
13621 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
13622 print substr($2, 4, 20)
13624 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
13625 print substr($3, 4, 20)
13627 : Append some common names just in case the awk scan failed.
13628 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
13629 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
13630 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
13631 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
13632 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
13634 : generate a few handy files for later
13635 $cat > signal.c <<'EOCP'
13636 #include <sys/types.h>
13637 #include <signal.h>
13641 /* Strange style to avoid deeply-nested #if/#else/#endif */
13644 # define NSIG (_NSIG)
13650 # define NSIG (SIGMAX+1)
13656 # define NSIG (SIG_MAX+1)
13662 # define NSIG (MAXSIG+1)
13668 # define NSIG (MAX_SIG+1)
13673 # ifdef SIGARRAYSIZE
13674 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
13680 # define NSIG (_sys_nsig) /* Solaris 2.5 */
13684 /* Default to some arbitrary number that's big enough to get most
13685 of the common signals.
13691 printf("NSIG %d\n", NSIG);
13697 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
13699 printf "#ifdef SIG"; printf $1; printf "\n"
13700 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
13701 printf $1; printf ");\n"
13705 printf "#endif /* JUST_NSIG */\n";
13706 printf "exit(0);\n}\n";
13709 $cat >signal.awk <<'EOP'
13710 BEGIN { ndups = 0 }
13711 $1 ~ /^NSIG$/ { nsig = $2 }
13712 ($1 !~ /^NSIG$/) && (NF == 2) {
13713 if ($2 > maxsig) { maxsig = $2 }
13714 if (sig_name[$2]) {
13715 dup_name[ndups] = $1
13716 dup_num[ndups] = $2
13728 printf("NSIG %d\n", nsig);
13729 for (n = 1; n < nsig; n++) {
13731 printf("%s %d\n", sig_name[n], sig_num[n])
13734 printf("NUM%d %d\n", n, n)
13737 for (n = 0; n < ndups; n++) {
13738 printf("%s %d\n", dup_name[n], dup_num[n])
13742 $cat >signal_cmd <<EOS
13744 if $test -s signal.lst; then
13745 echo "Using your existing signal.lst file"
13750 $cat >>signal_cmd <<'EOS'
13753 if eval $compile_ok; then
13754 ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
13756 echo "(I can't seem be able to compile the whole test program)" >&4
13757 echo "(I'll try it in little pieces.)" >&4
13758 set signal -DJUST_NSIG
13759 if eval $compile_ok; then
13760 ./signal$_exe > signal.nsg
13763 echo "I can't seem to figure out how many signals you have." >&4
13764 echo "Guessing 50." >&4
13765 echo 'NSIG 50' > signal.nsg
13767 : Now look at all the signal names, one at a time.
13768 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
13769 $cat > signal.c <<EOCP
13770 #include <sys/types.h>
13771 #include <signal.h>
13774 printf("$xx %d\n", SIG${xx});
13779 if eval $compile; then
13780 echo "SIG${xx} found."
13781 ./signal$_exe >> signal.ls1
13783 echo "SIG${xx} NOT found."
13786 if $test -s signal.ls1; then
13787 $cat signal.nsg signal.ls1 |
13788 $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
13792 if $test -s signal.lst; then
13795 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
13796 echo 'kill -l' >signal
13797 set X `csh -f <signal`
13801 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
13803 echo $@ | $tr ' ' $trnl | \
13804 $awk '{ printf "%s %d\n", $1, ++s; }
13805 END { printf "NSIG %d\n", ++s }' >signal.lst
13807 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
13809 chmod a+x signal_cmd
13810 $eunicefix signal_cmd
13812 : generate list of signal names
13814 case "$sig_name_init" in
13816 *) case "$sig_num_init" in
13817 ''|*,*) doinit=yes ;;
13822 echo "Generating a list of signal names and numbers..." >&4
13824 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
13825 sig_name=`$awk 'BEGIN { printf "ZERO " }
13826 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
13827 sig_num=`$awk 'BEGIN { printf "0 " }
13828 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
13829 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
13830 !/^NSIG/ { printf "\"%s\", ", $1 }
13831 END { printf "0\n" }' signal.lst`
13832 sig_num_init=`$awk 'BEGIN { printf "0, " }
13833 !/^NSIG/ { printf "%d, ", $2}
13834 END { printf "0\n"}' signal.lst`
13837 echo "The following $sig_count signals are available:"
13839 echo $sig_name | $awk \
13840 'BEGIN { linelen = 0 }
13842 for (i = 1; i <= NF; i++) {
13843 name = "SIG" $i " "
13844 linelen = linelen + length(name)
13845 if (linelen > 70) {
13847 linelen = length(name)
13853 $rm -f signal signal.c signal.awk signal.lst signal_cmd
13856 case "$sizetype" in
13857 *_t) zzz="$sizetype" ;;
13858 *) zzz="filesize" ;;
13860 echo "Checking the size of $zzz..." >&4
13862 #include <sys/types.h>
13865 printf("%d\n", (int)sizeof($sizetype));
13870 if eval $compile_ok; then
13874 echo "(I can't execute the test program--guessing $sizesize.)" >&4
13877 echo "Your $zzz size is $sizesize bytes."
13882 echo "(I can't compile the test program--guessing $sizesize.)" >&4
13886 : check for socklen_t
13888 echo "Checking to see if you have socklen_t..." >&4
13890 #include <sys/types.h>
13891 #$d_socket HAS_SOCKET
13893 #include <sys/socket.h>
13895 int main() { socklen_t x = 16; }
13898 if eval $compile; then
13900 echo "You have socklen_t."
13903 echo "You do not have socklen_t."
13904 case "$sizetype" in
13905 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
13912 : check for type of the size argument to socket calls
13913 case "$d_socket" in
13917 Checking to see what type is the last argument of accept().
13919 hdrs="$define sys/types.h $d_socket sys/socket.h"
13921 case "$d_socklen_t" in
13922 "$define") yyy="$yyy socklen_t"
13924 yyy="$yyy $sizetype int long unsigned"
13925 for xxx in $yyy; do
13926 case "$socksizetype" in
13927 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
13928 if ./protochk "$try" $hdrs; then
13929 echo "Your system accepts '$xxx *' for the last argument of accept()."
13930 socksizetype="$xxx"
13935 : In case none of those worked, prompt the user.
13936 case "$socksizetype" in
13937 '') rp='What is the type for socket address structure sizes?'
13944 *) : no sockets, so pick relatively harmless default
13949 : see what type is used for signed size_t
13950 set ssize_t ssizetype int stdio.h sys/types.h
13953 $cat > ssize.c <<EOM
13955 #include <sys/types.h>
13956 #define Size_t $sizetype
13957 #define SSize_t $dflt
13960 if (sizeof(Size_t) == sizeof(SSize_t))
13962 else if (sizeof(Size_t) == sizeof(int))
13971 if eval $compile_ok && ./ssize > /dev/null; then
13972 ssizetype=`./ssize`
13973 echo "I'll be using $ssizetype for functions returning a byte count." >&4
13976 Help! I can't compile and run the ssize_t test program: please enlighten me!
13977 (This is probably a misconfiguration in your system or libraries, and
13978 you really ought to fix it. Still, I'll try anyway.)
13980 I need a type that is the same size as $sizetype, but is guaranteed to
13981 be signed. Common values are ssize_t, int and long.
13984 rp="What signed type is the same size as $sizetype?"
13988 $rm -f ssize ssize.*
13990 : see what type of char stdio uses.
13992 if $contains 'unsigned.*char.*_ptr;' `./findhdr stdio.h` >/dev/null 2>&1 ; then
13993 echo "Your stdio uses unsigned chars." >&4
13994 stdchar="unsigned char"
13996 echo "Your stdio uses signed chars." >&4
14000 : see if time exists
14002 if test "X$d_time" = X -o X"$timetype" = X; then
14003 if set time val -f d_time; eval $csym; $val; then
14004 echo 'time() found.' >&4
14006 rp="What is the type returned by time() on this system?"
14007 set time_t timetype long stdio.h sys/types.h
14010 echo 'time() not found, hope that will do.' >&4
14018 : see what type uids are declared as in the kernel
14020 echo "Looking for the type for user ids returned by getuid()."
14021 set uid_t uidtype xxx stdio.h sys/types.h
14025 xxx=`./findhdr sys/user.h`
14026 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
14028 unsigned) dflt="$1 $2" ;;
14032 *) dflt="$uidtype";;
14035 uid_t) echo "uid_t found." ;;
14036 *) rp="What is the type for user ids returned by getuid()?"
14044 *_t) zzz="$uidtype" ;;
14047 echo "Checking the size of $zzz..." >&4
14049 #include <sys/types.h>
14052 printf("%d\n", (int)sizeof($uidtype));
14057 if eval $compile_ok; then
14061 echo "(I can't execute the test program--guessing $uidsize.)" >&4
14064 echo "Your $zzz is $uidsize bytes long."
14069 echo "(I can't compile the test program--guessing $uidsize.)" >&4
14074 *_t) zzz="$uidtype" ;;
14077 echo "Checking the sign of $zzz..." >&4
14079 #include <sys/types.h>
14090 if eval $compile; then
14094 echo "(I can't execute the test program--guessing unsigned.)" >&4
14098 1) echo "Your $zzz is unsigned." ;;
14099 -1) echo "Your $zzz is signed." ;;
14105 echo "(I can't compile the test program--guessing unsigned.)" >&4
14111 $echo "Checking the format string to be used for uids..." >&4
14114 -1) if $test X"$uidsize" = X"$ivsize"; then
14115 uidformat="$ivdformat"
14117 if $test X"$uidsize" = X"$longsize"; then
14120 if $test X"$uidsize" = X"$intsize"; then
14123 if $test X"$uidsize" = X"$shortsize"; then
14130 *) if $test X"$uidsize" = X"$uvsize"; then
14131 uidformat="$uvuformat"
14133 if $test X"$uidsize" = X"$longsize"; then
14136 if $test X"$uidsize" = X"$intsize"; then
14139 if $test X"$uidsize" = X"$shortsize"; then
14148 : see if dbm.h is available
14149 : see if dbmclose exists
14150 set dbmclose d_dbmclose
14153 case "$d_dbmclose" in
14163 *) set rpcsvc/dbm.h i_rpcsvcdbm
14168 *) echo "We won't be including <dbm.h>"
14178 : see if this is a sys/file.h system
14183 : do we need to include sys/file.h ?
14187 if $h_sysfile; then
14189 echo "We'll be including <sys/file.h>." >&4
14192 echo "We won't be including <sys/file.h>." >&4
14202 : see if fcntl.h is there
14207 : see if we can include fcntl.h
14213 echo "We'll be including <fcntl.h>." >&4
14216 if $h_sysfile; then
14217 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
14219 echo "We won't be including <fcntl.h>." >&4
14231 : see if this is a iconv.h system
14232 set iconv.h i_iconv
14235 : see if this is a ieeefp.h system
14236 set ieeefp.h i_ieeefp
14239 : see if locale.h is available
14240 set locale.h i_locale
14243 : see if mach cthreads are available
14244 if test "X$usethreads" = "X$define"; then
14245 set mach/cthreads.h i_machcthr
14248 i_machcthr="$undef"
14253 : see if this is a math.h system
14257 : see if this is a mntent.h system
14258 set mntent.h i_mntent
14261 : see if ndbm.h is available
14266 : see if dbm_open exists
14267 set dbm_open d_dbm_open
14269 case "$d_dbm_open" in
14272 echo "We won't be including <ndbm.h>"
14281 : see if net/errno.h is available
14283 set net/errno.h val
14286 : Unfortunately, it causes problems on some systems. Arrgh.
14289 cat > try.c <<'EOM'
14292 #include <net/errno.h>
14298 if $cc $ccflags -c try.c >/dev/null 2>&1; then
14299 echo "We'll be including <net/errno.h>." >&4
14301 echo "We won't be including <net/errno.h>." >&4
14310 : see if netinet/tcp.h is available
14311 set netinet/tcp.h i_netinettcp
14314 : see if this is a poll.h system
14319 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
14320 $cat <<'EOSH' > Cppsym.know
14321 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
14322 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
14323 alliant alpha am29000 AM29000 amiga AMIGAOS AMIX
14324 ansi ANSI_C_SOURCE apollo ardent atarist att386 att3b BeOS
14325 BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
14326 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
14327 bull c cadmus clipper CMU COFF COMPILER_VERSION
14328 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
14329 CYGWIN DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
14330 Dynix DynixPTX ELF encore EPI EXTENSIONS FILE_OFFSET_BITS
14331 FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
14332 GNU_SOURCE GNUC GNUC_MINOR GO32 gould GOULD_PN
14333 H3050R H3050RX hbullx20 hcx host_mips
14334 hp200 hp300 hp700 HP700 hp800 hp9000
14335 hp9000s200 hp9000s300 hp9000s400 hp9000s500
14336 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
14337 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
14338 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
14339 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
14340 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
14341 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
14342 Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
14343 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
14344 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
14345 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
14346 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
14347 MATH_HAS_NO_SIDE_EFFECTS
14348 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
14349 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
14350 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
14351 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
14352 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
14353 NetBSD news1500 news1700 news1800 news1900 news3700
14354 news700 news800 news900 NeXT NLS ns16000 ns32000
14355 ns32016 ns32332 ns32k nsc32000
14356 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
14357 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
14358 pc532 pdp11 PGC PIC plexus PORTAR posix
14359 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
14360 POSIX_C_SOURCE POSIX_SOURCE POWER
14361 PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
14362 riscix riscos RT scs SCO sequent sgi SGI_SOURCE sinix
14363 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
14364 sony sony_news sonyrisc sparc sparclite spectrum
14365 stardent stdc STDC_EXT stratos sun sun3 sun386
14366 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
14367 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
14368 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
14369 sysV68 sysV88 Tek4132 Tek4300 titan
14370 tower tower32 tower32_200 tower32_600 tower32_700
14371 tower32_800 tower32_850 tss
14372 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
14373 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
14374 unix UNIX95 UNIX99 unixpc unos USGr4 USGr4_2
14375 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms xenix Xenix286
14376 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
14377 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
14380 # Maybe put other stuff here too.
14381 cat <<EOSH >>Cppsym.know
14384 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
14385 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
14386 $cat Cppsym.a Cppsym.b | $tr ' ' $trnl | sort | uniq > Cppsym.know
14387 $rm -f Cppsym.a Cppsym.b
14388 cat <<EOSH > Cppsym
14390 if $test \$# -gt 0; then
14391 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
14392 if $test -s Cppsym.got; then
14399 $tr " " "$trnl" | ./Cppsym.try
14405 cat <<EOSH > Cppsym.try
14407 cat <<'EOCP' > try.c
14413 cat <<'EOSH' >> Cppsym.try
14415 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
14416 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
14417 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
14418 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
14422 cat <<EOSH >> Cppsym.try
14424 case "$osname-$gccversion" in
14425 irix-) ccflags="\$ccflags -woff 1178" ;;
14427 $cc $optimize \$ccflags $ldflags -o try try.c $libs && ./try$exe_ext
14429 chmod +x Cppsym.try
14430 $eunicefix Cppsym.try
14431 ./Cppsym < Cppsym.know > Cppsym.true
14432 : now check the C compiler for additional symbols
14433 postprocess_cc_v=''
14435 aix) postprocess_cc_v="|$tr , ' '" ;;
14442 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
14445 -D*) echo "\$i" | $sed 's/^-D//';;
14446 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
14451 postprocess_cc_v=''
14454 ./ccsym > ccsym1.raw
14455 if $test -s ccsym1.raw; then
14456 $sort ccsym1.raw | $uniq >ccsym.raw
14458 mv ccsym1.raw ccsym.raw
14461 $awk '/\=/ { print $0; next }
14462 { print $0"=1" }' ccsym.raw >ccsym.list
14463 $awk '/\=/ { print $0; next }
14464 { print $0"=1" }' Cppsym.true >ccsym.true
14465 $comm -13 ccsym.true ccsym.list >ccsym.own
14466 $comm -12 ccsym.true ccsym.list >ccsym.com
14467 $comm -23 ccsym.true ccsym.list >ccsym.cpp
14469 if $test -z ccsym.raw; then
14470 echo "Your C compiler doesn't seem to define any symbols!" >&4
14472 echo "However, your C preprocessor defines the following symbols:"
14475 cppsymbols=`$cat Cppsym.true`
14476 cppsymbols=`echo $cppsymbols`
14477 cppccsymbols="$cppsymbols"
14479 if $test -s ccsym.com; then
14480 echo "Your C compiler and pre-processor define these symbols:"
14481 $sed -e 's/\(.*\)=.*/\1/' ccsym.com
14484 cppccsymbols=`$cat ccsym.com`
14485 cppccsymbols=`echo $cppccsymbols`
14486 $test "$silent" || sleep 1
14488 if $test -s ccsym.cpp; then
14489 $test "$also" && echo " "
14490 echo "Your C pre-processor ${also}defines the following symbols:"
14491 $sed -e 's/\(.*\)=.*/\1/' ccsym.cpp
14493 cppsymbols=`$cat ccsym.cpp`
14494 cppsymbols=`echo $cppsymbols`
14495 $test "$silent" || sleep 1
14497 if $test -s ccsym.own; then
14498 $test "$also" && echo " "
14499 echo "Your C compiler ${also}defines the following cpp symbols:"
14500 $sed -e 's/\(.*\)=1/\1/' ccsym.own
14501 $sed -e 's/\(.*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
14502 ccsymbols=`$cat ccsym.own`
14503 ccsymbols=`echo $ccsymbols`
14504 $test "$silent" || sleep 1
14509 : see if this is a termio system
14513 if $test `./findhdr termios.h`; then
14514 set tcsetattr i_termios
14520 "$define") echo "You have POSIX termios.h... good!" >&4;;
14521 *) if ./Cppsym pyr; then
14522 case "`/bin/universe`" in
14523 ucb) if $test `./findhdr sgtty.h`; then
14525 echo "<sgtty.h> found." >&4
14527 echo "System is pyramid with BSD universe."
14528 echo "<sgtty.h> not found--you could have problems." >&4
14530 *) if $test `./findhdr termio.h`; then
14532 echo "<termio.h> found." >&4
14534 echo "System is pyramid with USG universe."
14535 echo "<termio.h> not found--you could have problems." >&4
14539 if $test `./findhdr termio.h`; then
14540 echo "<termio.h> found." >&4
14542 elif $test `./findhdr sgtty.h`; then
14543 echo "<sgtty.h> found." >&4
14546 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
14549 if $test `./findhdr sgtty.h`; then
14550 echo "<sgtty.h> found." >&4
14552 elif $test `./findhdr termio.h`; then
14553 echo "<termio.h> found." >&4
14556 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
14560 set i_termio; eval $setvar
14561 val=$val2; set i_sgtty; eval $setvar
14562 val=$val3; set i_termios; eval $setvar
14564 : see if this is a shadow.h system
14565 set shadow.h i_shadow
14568 : see if this is a socks.h system
14569 set socks.h i_socks
14572 : see if stdarg is available
14574 if $test `./findhdr stdarg.h`; then
14575 echo "<stdarg.h> found." >&4
14578 echo "<stdarg.h> NOT found." >&4
14582 : see if varags is available
14584 if $test `./findhdr varargs.h`; then
14585 echo "<varargs.h> found." >&4
14587 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
14590 : set up the varargs testing programs
14591 $cat > varargs.c <<EOP
14593 #include <stdarg.h>
14596 #include <varargs.h>
14600 int f(char *p, ...)
14614 p = va_arg(ap, char *);
14619 $cat > varargs <<EOP
14621 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
14630 : now check which varargs header should be included
14635 if `./varargs I_STDARG`; then
14637 elif `./varargs I_VARARGS`; then
14642 if `./varargs I_VARARGS`; then
14649 echo "I could not find the definition for va_dcl... You have problems..." >&4
14650 val="$undef"; set i_stdarg; eval $setvar
14651 val="$undef"; set i_varargs; eval $setvar
14656 case "$i_varhdr" in
14658 val="$define"; set i_stdarg; eval $setvar
14659 val="$undef"; set i_varargs; eval $setvar
14662 val="$undef"; set i_stdarg; eval $setvar
14663 val="$define"; set i_varargs; eval $setvar
14666 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
14670 : see if stddef is available
14671 set stddef.h i_stddef
14674 : see if this is a sunmath.h system
14675 set sunmath.h i_sunmath
14678 : see if sys/access.h is available
14679 set sys/access.h i_sysaccess
14682 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
14683 set sys/filio.h i_sysfilio
14686 if $test `./findhdr sys/ioctl.h`; then
14688 echo '<sys/ioctl.h> found.' >&4
14691 if $test $i_sysfilio = "$define"; then
14692 echo '<sys/ioctl.h> NOT found.' >&4
14694 $test $i_sgtty = "$define" && xxx="sgtty.h"
14695 $test $i_termio = "$define" && xxx="termio.h"
14696 $test $i_termios = "$define" && xxx="termios.h"
14697 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
14704 : see if this is a syslog.h system
14705 set syslog.h i_syslog
14709 : see if this is a sys/mode.h system
14710 set sys/mode.h i_sysmode
14713 : see if sys/resource.h has to be included
14714 set sys/resource.h i_sysresrc
14717 : see if sys/security.h is available
14718 set sys/security.h i_syssecrt
14721 : see if this is a sys/statvfs.h system
14722 set sys/statvfs.h i_sysstatvfs
14725 : see if this is a sys/uio.h system
14726 set sys/uio.h i_sysuio
14729 : see if this is a sys/un.h system
14730 set sys/un.h i_sysun
14734 : see if this is a sys/utsname.h system
14735 set sys/utsname.h i_sysutsname
14738 : see if this is a syswait system
14739 set sys/wait.h i_syswait
14742 : see if this is a ustat.h system
14743 set ustat.h i_ustat
14746 : see if this is an utime system
14747 set utime.h i_utime
14750 : see if this is a values.h system
14751 set values.h i_values
14754 : see if this is a vfork system
14757 set vfork.h i_vfork
14765 : see if gdbm.h is available
14770 : see if gdbm_open exists
14771 set gdbm_open d_gdbm_open
14773 case "$d_gdbm_open" in
14776 echo "We won't be including <gdbm.h>"
14786 echo "Looking for extensions..." >&4
14787 : If we are using the old config.sh, known_extensions may contain
14788 : old or inaccurate or duplicate values.
14789 known_extensions=''
14790 nonxs_extensions=''
14791 : We do not use find because it might not be available.
14792 : We do not just use MANIFEST because the user may have dropped
14793 : some additional extensions into the source tree and expect them
14796 : Function to recursively find available extensions, ignoring DynaLoader
14797 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
14801 DynaLoader|dynaload) ;;
14803 if $test -f $xxx/$xxx.xs; then
14804 known_extensions="$known_extensions $1$xxx";
14805 elif $test -f $xxx/Makefile.PL; then
14806 nonxs_extensions="$nonxs_extensions $1$xxx";
14808 if $test -d $xxx -a $# -lt 10; then
14811 eval $find_extensions;
14823 eval $find_extensions
14824 set X $nonxs_extensions
14826 nonxs_extensions="$*"
14827 set X $known_extensions
14829 known_extensions="$*"
14832 : Now see which are supported on this system.
14834 for xxx in $known_extensions ; do
14838 $define) avail_ext="$avail_ext $xxx" ;;
14841 GDBM_File|gdbm_fil)
14843 $define) avail_ext="$avail_ext $xxx" ;;
14846 NDBM_File|ndbm_fil)
14849 case "$osname-$use64bitint" in
14852 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
14855 *) avail_ext="$avail_ext $xxx" ;;
14860 ODBM_File|odbm_fil)
14861 case "${i_dbm}${i_rpcsvcdbm}" in
14863 case "$osname-$use64bitint" in
14866 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
14869 *) avail_ext="$avail_ext $xxx" ;;
14875 case "$useposix" in
14876 true|define|y) avail_ext="$avail_ext $xxx" ;;
14880 case "$useopcode" in
14881 true|define|y) avail_ext="$avail_ext $xxx" ;;
14885 case "$d_socket" in
14886 true|$define|y) avail_ext="$avail_ext $xxx" ;;
14890 case "$usethreads" in
14891 true|$define|y) avail_ext="$avail_ext $xxx" ;;
14895 : XXX Do we need a useipcsysv variable here
14896 case "${d_msg}${d_sem}${d_shm}" in
14897 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
14900 *) avail_ext="$avail_ext $xxx"
14909 : Now see which nonxs extensions are supported on this system.
14910 : For now assume all are.
14912 for xxx in $nonxs_extensions ; do
14914 *) nonxs_ext="$nonxs_ext $xxx"
14926 A number of extensions are supplied with $package. You may choose to
14927 compile these extensions for dynamic loading (the default), compile
14928 them into the $package executable (static loading), or not include
14929 them at all. Answer "none" to include no extensions.
14930 Note that DynaLoader is always built and need not be mentioned here.
14933 case "$dynamic_ext" in
14934 '') dflt="$avail_ext" ;;
14935 *) dflt="$dynamic_ext"
14936 # Perhaps we are reusing an old out-of-date config.sh.
14939 if test X"$dynamic_ext" != X"$avail_ext"; then
14941 NOTICE: Your previous config.sh list may be incorrect.
14942 The extensions now available to you are
14944 but the default list from your previous config.sh is
14956 rp="What extensions do you wish to load dynamically?"
14959 none) dynamic_ext=' ' ;;
14960 *) dynamic_ext="$ans" ;;
14963 case "$static_ext" in
14965 : Exclude those already listed in dynamic linking
14967 for xxx in $avail_ext; do
14968 case " $dynamic_ext " in
14970 *) dflt="$dflt $xxx" ;;
14977 *) dflt="$static_ext"
14984 rp="What extensions do you wish to load statically?"
14987 none) static_ext=' ' ;;
14988 *) static_ext="$ans" ;;
14993 A number of extensions are supplied with $package. Answer "none"
14994 to include no extensions.
14995 Note that DynaLoader is always built and need not be mentioned here.
14998 case "$static_ext" in
14999 '') dflt="$avail_ext" ;;
15000 *) dflt="$static_ext"
15001 # Perhaps we are reusing an old out-of-date config.sh.
15004 if test X"$static_ext" != X"$avail_ext"; then
15006 NOTICE: Your previous config.sh list may be incorrect.
15007 The extensions now available to you are
15009 but the default list from your previous config.sh is
15018 : Exclude those that are not xs extensions
15022 rp="What extensions do you wish to include?"
15025 none) static_ext=' ' ;;
15026 *) static_ext="$ans" ;;
15031 set X $dynamic_ext $static_ext $nonxs_ext
15035 : Remove build directory name from cppstdin so it can be used from
15036 : either the present location or the final installed location.
15038 : Get out of the UU directory to get correct path name.
15040 case "$cppstdin" in
15042 echo "Stripping down cppstdin path name"
15048 : end of configuration questions
15050 echo "End of configuration questions."
15053 : back to where it started
15054 if test -d ../UU; then
15058 : configuration may be patched via a 'config.over' file
15059 if $test -f config.over; then
15062 rp='I see a config.over file. Do you wish to load it?'
15065 n*) echo "OK, I'll ignore it.";;
15067 echo "Configuration override changes have been loaded."
15072 : in case they want portability, strip down executable paths
15073 case "$d_portable" in
15076 echo "Stripping down executable paths..." >&4
15077 for file in $loclist $trylist; do
15079 eval $file=`basename $temp`
15084 : create config.sh file
15086 echo "Creating config.sh..." >&4
15087 $spitshell <<EOT >config.sh
15090 # This file was produced by running the Configure script. It holds all the
15091 # definitions figured out by Configure. Should you modify one of these values,
15092 # do not forget to propagate your changes by running "Configure -der". You may
15093 # instead choose to run each of the .SH files by yourself, or "Configure -S".
15096 # Package name : $package
15097 # Source directory : $src
15098 # Configuration time: $cf_time
15099 # Configured by : $cf_by
15100 # Target system : $myuname
15110 Revision='$Revision'
15117 alignbytes='$alignbytes'
15118 ansi2knr='$ansi2knr'
15119 aphostname='$aphostname'
15120 api_revision='$api_revision'
15121 api_subversion='$api_subversion'
15122 api_version='$api_version'
15123 api_versionstring='$api_versionstring'
15126 archlibexp='$archlibexp'
15127 archname64='$archname64'
15128 archname='$archname'
15129 archobjs='$archobjs'
15134 bincompat5005='$bincompat5005'
15138 byteorder='$byteorder'
15140 castflags='$castflags'
15143 cccdlflags='$cccdlflags'
15144 ccdlflags='$ccdlflags'
15146 ccsymbols='$ccsymbols'
15148 cf_email='$cf_email'
15150 charsize='$charsize'
15154 clocktype='$clocktype'
15156 compress='$compress'
15157 contains='$contains'
15161 cpp_stuff='$cpp_stuff'
15162 cppccsymbols='$cppccsymbols'
15163 cppflags='$cppflags'
15165 cppminus='$cppminus'
15167 cppstdin='$cppstdin'
15168 cppsymbols='$cppsymbols'
15169 crosscompile='$crosscompile'
15170 cryptlib='$cryptlib'
15172 d_Gconvert='$d_Gconvert'
15173 d_PRIEldbl='$d_PRIEldbl'
15174 d_PRIFldbl='$d_PRIFldbl'
15175 d_PRIGldbl='$d_PRIGldbl'
15176 d_PRIX64='$d_PRIX64'
15177 d_PRId64='$d_PRId64'
15178 d_PRIeldbl='$d_PRIeldbl'
15179 d_PRIfldbl='$d_PRIfldbl'
15180 d_PRIgldbl='$d_PRIgldbl'
15181 d_PRIi64='$d_PRIi64'
15182 d_PRIo64='$d_PRIo64'
15183 d_PRIu64='$d_PRIu64'
15184 d_PRIx64='$d_PRIx64'
15185 d_access='$d_access'
15186 d_accessx='$d_accessx'
15188 d_archlib='$d_archlib'
15191 d_attribut='$d_attribut'
15194 d_bincompat5005='$d_bincompat5005'
15196 d_bsdgetpgrp='$d_bsdgetpgrp'
15197 d_bsdsetpgrp='$d_bsdsetpgrp'
15199 d_casti32='$d_casti32'
15200 d_castneg='$d_castneg'
15201 d_charvspr='$d_charvspr'
15203 d_chroot='$d_chroot'
15204 d_chsize='$d_chsize'
15205 d_closedir='$d_closedir'
15209 d_cuserid='$d_cuserid'
15210 d_dbl_dig='$d_dbl_dig'
15211 d_difftime='$d_difftime'
15212 d_dirnamlen='$d_dirnamlen'
15213 d_dlerror='$d_dlerror'
15214 d_dlopen='$d_dlopen'
15215 d_dlsymun='$d_dlsymun'
15216 d_dosuid='$d_dosuid'
15217 d_drand48proto='$d_drand48proto'
15219 d_eaccess='$d_eaccess'
15220 d_endgrent='$d_endgrent'
15221 d_endhent='$d_endhent'
15222 d_endnent='$d_endnent'
15223 d_endpent='$d_endpent'
15224 d_endpwent='$d_endpwent'
15225 d_endsent='$d_endsent'
15226 d_endspent='$d_endspent'
15227 d_eofnblk='$d_eofnblk'
15228 d_eunice='$d_eunice'
15229 d_fchmod='$d_fchmod'
15230 d_fchown='$d_fchown'
15232 d_fd_macros='$d_fd_macros'
15233 d_fd_set='$d_fd_set'
15234 d_fds_bits='$d_fds_bits'
15235 d_fgetpos='$d_fgetpos'
15236 d_flexfnam='$d_flexfnam'
15239 d_fpathconf='$d_fpathconf'
15240 d_fpos64_t='$d_fpos64_t'
15241 d_frexpl='$d_frexpl'
15242 d_fs_data_s='$d_fs_data_s'
15243 d_fseeko='$d_fseeko'
15244 d_fsetpos='$d_fsetpos'
15245 d_fstatfs='$d_fstatfs'
15246 d_fstatvfs='$d_fstatvfs'
15247 d_ftello='$d_ftello'
15249 d_getcwd='$d_getcwd'
15250 d_getfsstat='$d_getfsstat'
15251 d_getgrent='$d_getgrent'
15252 d_getgrps='$d_getgrps'
15253 d_gethbyaddr='$d_gethbyaddr'
15254 d_gethbyname='$d_gethbyname'
15255 d_gethent='$d_gethent'
15256 d_gethname='$d_gethname'
15257 d_gethostprotos='$d_gethostprotos'
15258 d_getlogin='$d_getlogin'
15259 d_getmnt='$d_getmnt'
15260 d_getmntent='$d_getmntent'
15261 d_getnbyaddr='$d_getnbyaddr'
15262 d_getnbyname='$d_getnbyname'
15263 d_getnent='$d_getnent'
15264 d_getnetprotos='$d_getnetprotos'
15265 d_getpbyname='$d_getpbyname'
15266 d_getpbynumber='$d_getpbynumber'
15267 d_getpent='$d_getpent'
15268 d_getpgid='$d_getpgid'
15269 d_getpgrp2='$d_getpgrp2'
15270 d_getpgrp='$d_getpgrp'
15271 d_getppid='$d_getppid'
15272 d_getprior='$d_getprior'
15273 d_getprotoprotos='$d_getprotoprotos'
15274 d_getpwent='$d_getpwent'
15275 d_getsbyname='$d_getsbyname'
15276 d_getsbyport='$d_getsbyport'
15277 d_getsent='$d_getsent'
15278 d_getservprotos='$d_getservprotos'
15279 d_getspent='$d_getspent'
15280 d_getspnam='$d_getspnam'
15281 d_gettimeod='$d_gettimeod'
15282 d_gnulibc='$d_gnulibc'
15283 d_grpasswd='$d_grpasswd'
15284 d_hasmntopt='$d_hasmntopt'
15288 d_inetaton='$d_inetaton'
15289 d_int64_t='$d_int64_t'
15290 d_isascii='$d_isascii'
15292 d_isnanl='$d_isnanl'
15293 d_killpg='$d_killpg'
15294 d_lchown='$d_lchown'
15295 d_ldbl_dig='$d_ldbl_dig'
15297 d_locconv='$d_locconv'
15299 d_longdbl='$d_longdbl'
15300 d_longlong='$d_longlong'
15301 d_lseekproto='$d_lseekproto'
15303 d_madvise='$d_madvise'
15305 d_mbstowcs='$d_mbstowcs'
15306 d_mbtowc='$d_mbtowc'
15307 d_memchr='$d_memchr'
15308 d_memcmp='$d_memcmp'
15309 d_memcpy='$d_memcpy'
15310 d_memmove='$d_memmove'
15311 d_memset='$d_memset'
15313 d_mkdtemp='$d_mkdtemp'
15314 d_mkfifo='$d_mkfifo'
15315 d_mkstemp='$d_mkstemp'
15316 d_mkstemps='$d_mkstemps'
15317 d_mktime='$d_mktime'
15320 d_mprotect='$d_mprotect'
15322 d_msg_ctrunc='$d_msg_ctrunc'
15323 d_msg_dontroute='$d_msg_dontroute'
15324 d_msg_oob='$d_msg_oob'
15325 d_msg_peek='$d_msg_peek'
15326 d_msg_proxy='$d_msg_proxy'
15327 d_msgctl='$d_msgctl'
15328 d_msgget='$d_msgget'
15329 d_msgrcv='$d_msgrcv'
15330 d_msgsnd='$d_msgsnd'
15332 d_munmap='$d_munmap'
15333 d_mymalloc='$d_mymalloc'
15335 d_nv_preserves_uv='$d_nv_preserves_uv'
15336 d_off64_t='$d_off64_t'
15337 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
15338 d_oldpthreads='$d_oldpthreads'
15339 d_oldsock='$d_oldsock'
15341 d_pathconf='$d_pathconf'
15343 d_perl_otherlibdirs='$d_perl_otherlibdirs'
15344 d_phostname='$d_phostname'
15347 d_portable='$d_portable'
15348 d_pthread_yield='$d_pthread_yield'
15350 d_pwchange='$d_pwchange'
15351 d_pwclass='$d_pwclass'
15352 d_pwcomment='$d_pwcomment'
15353 d_pwexpire='$d_pwexpire'
15354 d_pwgecos='$d_pwgecos'
15355 d_pwpasswd='$d_pwpasswd'
15356 d_pwquota='$d_pwquota'
15359 d_readdir='$d_readdir'
15360 d_readlink='$d_readlink'
15361 d_rename='$d_rename'
15362 d_rewinddir='$d_rewinddir'
15364 d_safebcpy='$d_safebcpy'
15365 d_safemcpy='$d_safemcpy'
15366 d_sanemcmp='$d_sanemcmp'
15367 d_sched_yield='$d_sched_yield'
15368 d_scm_rights='$d_scm_rights'
15369 d_seekdir='$d_seekdir'
15370 d_select='$d_select'
15372 d_semctl='$d_semctl'
15373 d_semctl_semid_ds='$d_semctl_semid_ds'
15374 d_semctl_semun='$d_semctl_semun'
15375 d_semget='$d_semget'
15377 d_setegid='$d_setegid'
15378 d_seteuid='$d_seteuid'
15379 d_setgrent='$d_setgrent'
15380 d_setgrps='$d_setgrps'
15381 d_sethent='$d_sethent'
15382 d_setlinebuf='$d_setlinebuf'
15383 d_setlocale='$d_setlocale'
15384 d_setnent='$d_setnent'
15385 d_setpent='$d_setpent'
15386 d_setpgid='$d_setpgid'
15387 d_setpgrp2='$d_setpgrp2'
15388 d_setpgrp='$d_setpgrp'
15389 d_setprior='$d_setprior'
15390 d_setpwent='$d_setpwent'
15391 d_setregid='$d_setregid'
15392 d_setresgid='$d_setresgid'
15393 d_setresuid='$d_setresuid'
15394 d_setreuid='$d_setreuid'
15395 d_setrgid='$d_setrgid'
15396 d_setruid='$d_setruid'
15397 d_setsent='$d_setsent'
15398 d_setsid='$d_setsid'
15399 d_setspent='$d_setspent'
15400 d_setvbuf='$d_setvbuf'
15404 d_shmatprototype='$d_shmatprototype'
15405 d_shmctl='$d_shmctl'
15407 d_shmget='$d_shmget'
15408 d_sigaction='$d_sigaction'
15409 d_sigsetjmp='$d_sigsetjmp'
15410 d_socket='$d_socket'
15411 d_socklen_t='$d_socklen_t'
15412 d_sockpair='$d_sockpair'
15414 d_statblks='$d_statblks'
15415 d_statfs_f_flags='$d_statfs_f_flags'
15416 d_statfs_s='$d_statfs_s'
15417 d_statvfs='$d_statvfs'
15418 d_stdio_cnt_lval='$d_stdio_cnt_lval'
15419 d_stdio_ptr_lval='$d_stdio_ptr_lval'
15420 d_stdio_stream_array='$d_stdio_stream_array'
15421 d_stdiobase='$d_stdiobase'
15422 d_stdstdio='$d_stdstdio'
15423 d_strchr='$d_strchr'
15424 d_strcoll='$d_strcoll'
15425 d_strctcpy='$d_strctcpy'
15426 d_strerrm='$d_strerrm'
15427 d_strerror='$d_strerror'
15428 d_strtod='$d_strtod'
15429 d_strtol='$d_strtol'
15430 d_strtold='$d_strtold'
15431 d_strtoll='$d_strtoll'
15432 d_strtoul='$d_strtoul'
15433 d_strtoull='$d_strtoull'
15434 d_strtouq='$d_strtouq'
15435 d_strxfrm='$d_strxfrm'
15436 d_suidsafe='$d_suidsafe'
15437 d_symlink='$d_symlink'
15438 d_syscall='$d_syscall'
15439 d_sysconf='$d_sysconf'
15440 d_sysernlst='$d_sysernlst'
15441 d_syserrlst='$d_syserrlst'
15442 d_system='$d_system'
15443 d_tcgetpgrp='$d_tcgetpgrp'
15444 d_tcsetpgrp='$d_tcsetpgrp'
15445 d_telldir='$d_telldir'
15446 d_telldirproto='$d_telldirproto'
15449 d_truncate='$d_truncate'
15450 d_tzname='$d_tzname'
15453 d_union_semun='$d_union_semun'
15455 d_vendorarch='$d_vendorarch'
15456 d_vendorbin='$d_vendorbin'
15457 d_vendorlib='$d_vendorlib'
15459 d_void_closedir='$d_void_closedir'
15460 d_voidsig='$d_voidsig'
15461 d_voidtty='$d_voidtty'
15462 d_volatile='$d_volatile'
15463 d_vprintf='$d_vprintf'
15465 d_waitpid='$d_waitpid'
15466 d_wcstombs='$d_wcstombs'
15467 d_wctomb='$d_wctomb'
15470 db_hashtype='$db_hashtype'
15471 db_prefixtype='$db_prefixtype'
15472 defvoidused='$defvoidused'
15473 direntrytype='$direntrytype'
15476 doublesize='$doublesize'
15478 dynamic_ext='$dynamic_ext'
15484 eunicefix='$eunicefix'
15487 extensions='$extensions'
15488 fflushNULL='$fflushNULL'
15489 fflushall='$fflushall'
15491 firstmakefile='$firstmakefile'
15493 fpossize='$fpossize'
15494 fpostype='$fpostype'
15495 freetype='$freetype'
15497 full_csh='$full_csh'
15498 full_sed='$full_sed'
15499 gccversion='$gccversion'
15500 gidformat='$gidformat'
15506 groupcat='$groupcat'
15507 groupstype='$groupstype'
15510 h_sysfile='$h_sysfile'
15522 i_arpainet='$i_arpainet'
15523 i_bsdioctl='$i_bsdioctl'
15526 i_dirent='$i_dirent'
15534 i_ieeefp='$i_ieeefp'
15535 i_inttypes='$i_inttypes'
15536 i_limits='$i_limits'
15537 i_locale='$i_locale'
15538 i_machcthr='$i_machcthr'
15539 i_malloc='$i_malloc'
15541 i_memory='$i_memory'
15542 i_mntent='$i_mntent'
15545 i_neterrno='$i_neterrno'
15546 i_netinettcp='$i_netinettcp'
15549 i_pthread='$i_pthread'
15551 i_rpcsvcdbm='$i_rpcsvcdbm'
15554 i_shadow='$i_shadow'
15556 i_stdarg='$i_stdarg'
15557 i_stddef='$i_stddef'
15558 i_stdlib='$i_stdlib'
15559 i_string='$i_string'
15560 i_sunmath='$i_sunmath'
15561 i_sysaccess='$i_sysaccess'
15562 i_sysdir='$i_sysdir'
15563 i_sysfile='$i_sysfile'
15564 i_sysfilio='$i_sysfilio'
15566 i_sysioctl='$i_sysioctl'
15567 i_syslog='$i_syslog'
15568 i_sysmman='$i_sysmman'
15569 i_sysmode='$i_sysmode'
15570 i_sysmount='$i_sysmount'
15571 i_sysndir='$i_sysndir'
15572 i_sysparam='$i_sysparam'
15573 i_sysresrc='$i_sysresrc'
15574 i_syssecrt='$i_syssecrt'
15575 i_sysselct='$i_sysselct'
15576 i_syssockio='$i_syssockio'
15577 i_sysstat='$i_sysstat'
15578 i_sysstatfs='$i_sysstatfs'
15579 i_sysstatvfs='$i_sysstatvfs'
15580 i_systime='$i_systime'
15581 i_systimek='$i_systimek'
15582 i_systimes='$i_systimes'
15583 i_systypes='$i_systypes'
15584 i_sysuio='$i_sysuio'
15586 i_sysutsname='$i_sysutsname'
15587 i_sysvfs='$i_sysvfs'
15588 i_syswait='$i_syswait'
15589 i_termio='$i_termio'
15590 i_termios='$i_termios'
15592 i_unistd='$i_unistd'
15595 i_values='$i_values'
15596 i_varargs='$i_varargs'
15597 i_varhdr='$i_varhdr'
15599 ignore_versioned_solibs='$ignore_versioned_solibs'
15600 inc_version_list='$inc_version_list'
15601 inc_version_list_init='$inc_version_list_init'
15604 installarchlib='$installarchlib'
15605 installbin='$installbin'
15606 installman1dir='$installman1dir'
15607 installman3dir='$installman3dir'
15608 installprefix='$installprefix'
15609 installprefixexp='$installprefixexp'
15610 installprivlib='$installprivlib'
15611 installscript='$installscript'
15612 installsitearch='$installsitearch'
15613 installsitebin='$installsitebin'
15614 installsitelib='$installsitelib'
15615 installstyle='$installstyle'
15616 installusrbinperl='$installusrbinperl'
15617 installvendorarch='$installvendorarch'
15618 installvendorbin='$installvendorbin'
15619 installvendorlib='$installvendorlib'
15621 ivdformat='$ivdformat'
15624 known_extensions='$known_extensions'
15628 lddlflags='$lddlflags'
15630 ldlibpthname='$ldlibpthname'
15637 libsdirs='$libsdirs'
15638 libsfiles='$libsfiles'
15639 libsfound='$libsfound'
15640 libspath='$libspath'
15641 libswanted='$libswanted'
15647 locincpth='$locincpth'
15648 loclibpth='$loclibpth'
15649 longdblsize='$longdblsize'
15650 longlongsize='$longlongsize'
15651 longsize='$longsize'
15655 lseeksize='$lseeksize'
15656 lseektype='$lseektype'
15660 make_set_make='$make_set_make'
15661 mallocobj='$mallocobj'
15662 mallocsrc='$mallocsrc'
15663 malloctype='$malloctype'
15665 man1direxp='$man1direxp'
15668 man3direxp='$man3direxp'
15671 mips_type='$mips_type'
15673 mmaptype='$mmaptype'
15675 modetype='$modetype'
15677 multiarch='$multiarch'
15679 myarchname='$myarchname'
15680 mydomain='$mydomain'
15681 myhostname='$myhostname'
15684 netdb_hlen_type='$netdb_hlen_type'
15685 netdb_host_type='$netdb_host_type'
15686 netdb_name_type='$netdb_name_type'
15687 netdb_net_type='$netdb_net_type'
15690 nm_so_opt='$nm_so_opt'
15691 nonxs_ext='$nonxs_ext'
15695 o_nonblock='$o_nonblock'
15697 old_pthread_create_joinable='$old_pthread_create_joinable'
15698 optimize='$optimize'
15699 orderlib='$orderlib'
15702 otherlibdirs='$otherlibdirs'
15706 patchlevel='$patchlevel'
15707 path_sep='$path_sep'
15710 perladmin='$perladmin'
15711 perlpath='$perlpath'
15713 phostname='$phostname'
15716 pm_apiversion='$pm_apiversion'
15720 prefixexp='$prefixexp'
15722 privlibexp='$privlibexp'
15723 prototype='$prototype'
15725 quadkind='$quadkind'
15726 quadtype='$quadtype'
15727 randbits='$randbits'
15728 randfunc='$randfunc'
15729 randseedtype='$randseedtype'
15731 rd_nodata='$rd_nodata'
15732 revision='$revision'
15736 sPRIEldbl='$sPRIEldbl'
15737 sPRIFldbl='$sPRIFldbl'
15738 sPRIGldbl='$sPRIGldbl'
15741 sPRIeldbl='$sPRIeldbl'
15742 sPRIfldbl='$sPRIfldbl'
15743 sPRIgldbl='$sPRIgldbl'
15748 sched_yield='$sched_yield'
15749 scriptdir='$scriptdir'
15750 scriptdirexp='$scriptdirexp'
15752 seedfunc='$seedfunc'
15753 selectminbits='$selectminbits'
15754 selecttype='$selecttype'
15755 sendmail='$sendmail'
15758 sharpbang='$sharpbang'
15759 shmattype='$shmattype'
15760 shortsize='$shortsize'
15763 sig_count='$sig_count'
15764 sig_name='$sig_name'
15765 sig_name_init='$sig_name_init'
15767 sig_num_init='$sig_num_init'
15768 signal_t='$signal_t'
15769 sitearch='$sitearch'
15770 sitearchexp='$sitearchexp'
15772 sitebinexp='$sitebinexp'
15774 sitelib_stem='$sitelib_stem'
15775 sitelibexp='$sitelibexp'
15776 siteprefix='$siteprefix'
15777 siteprefixexp='$siteprefixexp'
15778 sizesize='$sizesize'
15779 sizetype='$sizetype'
15784 sockethdr='$sockethdr'
15785 socketlib='$socketlib'
15786 socksizetype='$socksizetype'
15788 spackage='$spackage'
15789 spitshell='$spitshell'
15792 ssizetype='$ssizetype'
15793 startperl='$startperl'
15795 static_ext='$static_ext'
15797 stdio_base='$stdio_base'
15798 stdio_bufsiz='$stdio_bufsiz'
15799 stdio_cnt='$stdio_cnt'
15800 stdio_filbuf='$stdio_filbuf'
15801 stdio_ptr='$stdio_ptr'
15802 stdio_stream_array='$stdio_stream_array'
15805 subversion='$subversion'
15812 timeincl='$timeincl'
15813 timetype='$timetype'
15826 uidformat='$uidformat'
15832 uquadtype='$uquadtype'
15833 use5005threads='$use5005threads'
15834 use64bitall='$use64bitall'
15835 use64bitint='$use64bitint'
15837 useithreads='$useithreads'
15838 uselargefiles='$uselargefiles'
15839 uselongdouble='$uselongdouble'
15840 usemorebits='$usemorebits'
15841 usemultiplicity='$usemultiplicity'
15842 usemymalloc='$usemymalloc'
15844 useopcode='$useopcode'
15845 useperlio='$useperlio'
15846 useposix='$useposix'
15848 useshrplib='$useshrplib'
15849 usesocks='$usesocks'
15850 usethreads='$usethreads'
15851 usevendorprefix='$usevendorprefix'
15852 usevfork='$usevfork'
15855 uvoformat='$uvoformat'
15858 uvuformat='$uvuformat'
15859 uvxformat='$uvxformat'
15860 vendorarch='$vendorarch'
15861 vendorarchexp='$vendorarchexp'
15862 vendorbin='$vendorbin'
15863 vendorbinexp='$vendorbinexp'
15864 vendorlib='$vendorlib'
15865 vendorlib_stem='$vendorlib_stem'
15866 vendorlibexp='$vendorlibexp'
15867 vendorprefix='$vendorprefix'
15868 vendorprefixexp='$vendorprefixexp'
15871 voidflags='$voidflags'
15873 xs_apiversion='$xs_apiversion'
15878 : Add in command line options if available
15879 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
15881 : add special variables
15882 $test -f $src/patchlevel.h && \
15883 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
15884 echo "CONFIGDOTSH=true" >>config.sh
15886 : propagate old symbols
15887 if $test -f UU/config.sh; then
15888 <UU/config.sh sort | uniq >UU/oldconfig.sh
15889 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
15890 sort | uniq -u >UU/oldsyms
15891 set X `cat UU/oldsyms`
15897 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
15899 echo "# Variables propagated from previous config.sh file." >>config.sh
15900 for sym in `cat UU/oldsyms`; do
15901 echo " Propagating $hint variable "'$'"$sym..."
15902 eval 'tmp="$'"${sym}"'"'
15904 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
15910 : Finish up by extracting the .SH files
15924 If you'd like to make any changes to the config.sh file before I begin
15925 to configure things, do it as a shell escape now (e.g. !vi config.sh).
15928 rp="Press return or use a shell escape to edit config.sh:"
15933 *) : in case they cannot read
15934 sh 1>&4 -c "$ans";;
15939 : if this fails, just run all the .SH files by hand
15946 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
15953 Now you need to generate make dependencies by running "$make depend".
15954 You might prefer to run it in background: "$make depend > makedepend.out &"
15955 It can take a while, so you might not want to run it right now.
15960 rp="Run $make depend now?"
15964 $make depend && echo "Now you must run a $make."
15967 echo "You must run '$make depend' then '$make'."
15970 elif test -f [Mm]akefile; then
15972 echo "Now you must run a $make."
15977 if $test -f Policy.sh; then
15980 If you compile $package on a different machine or from a different object
15981 directory, copy the Policy.sh file from this object directory to the
15982 new one before you run Configure -- this will help you with most of
15983 the policy defaults.
15987 if $test -f config.msg; then
15988 echo "Hmm. I also noted the following information while running:"
15990 $cat config.msg >&4
15993 $rm -f kit*isdone ark*isdone