3 # If these # comments don't work, trim them. Don't worry about any other
4 # shell scripts, Configure will trim # comments from them for you.
6 # (If you are trying to port this package to a machine without sh,
7 # I would suggest you have a look at the prototypical config_h.SH file
8 # and edit it to reflect your system. Some packages may include samples
9 # of config.h for certain machines, so you might look for one of those.)
11 # Yes, you may rip this off to use in other distribution packages. This
12 # script belongs to the public domain and cannot be copyrighted.
14 # (Note: this Configure script was generated automatically. Rather than
15 # working with this copy of Configure, you may wish to get metaconfig.
16 # The dist-3.0 package (which contains metaconfig) was posted in
17 # comp.sources.misc and is available on CPAN under authors/id/RAM so
18 # you may fetch it yourself from your nearest archive site.)
21 # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
23 # Generated on Thu Mar 16 03:04:33 EET 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
455 d_old_pthread_create_joinable=''
456 old_pthread_create_joinable=''
698 inc_version_list_init=''
716 ignore_versioned_solibs=''
883 d_stdio_stream_array=''
884 stdio_stream_array=''
935 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
938 : We must find out about Eunice early
940 if test -f /etc/unixtovms; then
941 eunicefix=/etc/unixtovms
943 if test -f /etc/unixtovms.exe; then
944 eunicefix=/etc/unixtovms.exe
948 : set useposix=false in your hint file to disable the POSIX extension.
950 : set useopcode=false in your hint file to disable the Opcode extension.
952 : Trailing extension. Override this in a hint file, if needed.
954 : Extra object files, if any, needed on this platform.
956 : Possible local include directories to search.
957 : Set locincpth to "" in a hint file to defeat local include searches.
958 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
959 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
961 : no include file wanted by default
965 : change the next line if compiling for Xenix/286 on Xenix/386
966 xlibpth='/usr/lib/386 /lib/386'
967 : Possible local library directories to search.
968 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
969 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
971 : general looking path for locating libraries
972 glibpth="/usr/lib/large /lib /usr/lib $xlibpth"
973 glibpth="$glibpth /lib/large /usr/lib/small /lib/small"
974 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
975 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
976 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
978 : Private path used by Configure to find libraries. Its value
979 : is prepended to libpth. This variable takes care of special
980 : machines, like the mips. Usually, it should be empty.
983 : default library list
985 : some systems want to use only the non-versioned libso:s
986 ignore_versioned_solibs=''
987 : set usemultiplicity on the Configure command line to enable multiplicity.
988 : set usesocks on the Configure command line to enable socks.
989 : set usethreads on the Configure command line to enable threads.
990 : full support for void wanted by default
993 : List of libraries we want.
994 : If anyone needs -lnet, put it in a hint file.
995 libswanted='sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl'
996 libswanted="$libswanted dld ld sun m c cposix posix"
997 libswanted="$libswanted ndir dir crypt sec"
998 libswanted="$libswanted ucb bsd BSD PW x iconv"
999 : We probably want to search /usr/shlib before most other libraries.
1000 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1001 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1002 glibpth="/usr/shlib $glibpth"
1003 : Do not use vfork unless overridden by a hint file.
1006 : Find the basic shell for Bourne shell scripts
1010 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1013 if test -f "$xxx"; then
1016 : Build up a list and do a single loop so we can 'break' out.
1017 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1018 for xxx in sh bash ksh pdksh ash; do
1020 try="$try ${p}/${xxx}"
1024 if test -f "$xxx"; then
1027 elif test -f "$xxx.exe"; then
1038 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1040 Usually it's in /bin/sh. How did you even get this far?
1041 Please contact me (Perl Maintainers) at perlbug@perl.com and
1042 we'll try to straighten this all out.
1048 : see if sh knows # comments
1049 if `$sh -c '#' >/dev/null 2>&1`; then
1053 test -f $xcat || xcat=/usr/bin/cat
1058 if test -s today; then
1061 echo "#! $xcat" > try
1065 if test -s today; then
1073 echo "Your $sh doesn't grok # comments--I will strip them later on."
1076 echo "exec grep -v '^[ ]*#'" >spitshell
1078 $eunicefix spitshell
1079 spitshell=`pwd`/spitshell
1081 echo "I presume that if # doesn't work, #! won't work either!"
1086 : figure out how to guarantee sh startup
1088 '') startsh=${sharpbang}${sh} ;;
1100 : echo "Yup, it does."
1102 echo "Hmm... '$startsh' does not guarantee sh startup..."
1103 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1108 : Save command line options in file UU/cmdline.opt for later use in
1109 : generating config.sh.
1110 cat > cmdline.opt <<EOSH
1111 # Configure command line arguments.
1118 cat >>cmdline.opt <<EOSH
1119 config_arg$argn='$arg'
1121 argn=`expr $argn + 1`
1124 : produce awk script to parse command line options
1125 cat >options.awk <<'EOF'
1127 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1129 len = length(optstr);
1130 for (i = 1; i <= len; i++) {
1131 c = substr(optstr, i, 1);
1132 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1143 if (substr(str, 1, 1) != "-") {
1144 printf("'%s'\n", str);
1148 for (i = 2; i <= len; i++) {
1149 c = substr(str, i, 1);
1151 printf("-%s\n", substr(str, i));
1157 printf("'%s'\n", substr(str, i + 1));
1170 : process the command line options
1171 set X `for arg in "$@"; do echo "X$arg"; done |
1172 sed -e s/X// | awk -f options.awk`
1177 : set up default values
1187 rm -f optdef.sh posthint.sh
1188 cat >optdef.sh <<EOS
1194 while test $# -gt 0; do
1196 -d) shift; fastread=yes;;
1197 -e) shift; alldone=cont;;
1201 if test -r "$1"; then
1204 echo "$me: cannot read config file $1." >&2
1209 -h) shift; error=true;;
1210 -r) shift; reuseval=true;;
1211 -s) shift; silent=true; realsilent=true;;
1212 -E) shift; alldone=exit;;
1213 -K) shift; knowitall=true;;
1214 -O) shift; override=true;;
1215 -S) shift; silent=true; extractsh=true;;
1220 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1221 echo "$me: ignoring -D $1" >&2
1224 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1225 *) echo "$1='define'" >> optdef.sh;;
1232 *=) echo "$1" >> optdef.sh;;
1234 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1235 echo "$me: ignoring -U $1" >&2
1237 *) echo "$1='undef'" >> optdef.sh;;
1248 *=*) zzz=`echo $yyy|sed 's!=.*!!'`
1252 zzz=" "`echo $yyy|sed 's!^[^=]*=!!'`
1253 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1259 *:*) xxx=`echo $yyy|sed 's!:.*!!'`
1260 yyy=`echo $yyy|sed 's!^[^:]*:!!'`
1261 zzz=`echo $yyy|sed 's!^[^=]*=!!'`
1262 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1263 *) xxx=`echo $yyy|sed 's!:.*!!'`
1264 yyy=`echo $yyy|sed 's!^[^:]*:!!'` ;;
1270 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1272 echo "$yyy=''" >> posthint.sh ;;
1277 echo "$yyy='$zzz'" >> posthint.sh ;;
1279 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1281 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1286 echo "$yyy=$zzz" >> posthint.sh ;;
1287 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1291 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1294 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1302 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1303 [-U symbol] [-U symbol=] [-A command:symbol...]
1304 -d : use defaults for all answers.
1305 -e : go on without questioning past the production of config.sh.
1306 -f : specify an alternate default configuration file.
1307 -h : print this help message and exit (with an error status).
1308 -r : reuse C symbols value if possible (skips costly nm extraction).
1309 -s : silent mode, only echoes questions and essential information.
1310 -D : define symbol to have some value:
1311 -D symbol symbol gets the value 'define'
1312 -D symbol=value symbol gets the value 'value'
1313 -E : stop at the end of questions, after having produced config.sh.
1314 -K : do not use unless you know what you are doing.
1315 -O : let -D and -U override definitions from loaded configuration file.
1316 -S : perform variable substitutions on all .SH files (can mix with -f)
1317 -U : undefine symbol:
1318 -U symbol symbol gets the value 'undef'
1319 -U symbol= symbol gets completely empty
1320 -A : manipulate symbol after the platform specific hints have been applied:
1321 -A symbol=value append " "value to symbol
1322 -A append:symbol=value append value to symbol
1323 -A define:symbol=value define symbol to have value
1324 -A clear:symbol define symbol to be ''
1325 -A define:symbol define symbol to be 'define'
1326 -A eval:symbol=value define symbol to be eval of value
1327 -A prepend:symbol=value prepend value to symbol
1328 -A undef:symbol define symbol to be 'undef'
1329 -A undef:symbol= define symbol to be ''
1330 -V : print version number and exit (with a zero status).
1337 case "$fastread$alldone" in
1340 if test ! -t 0; then
1341 echo "Say 'sh Configure', not 'sh <Configure'"
1349 true) exec 1>/dev/null;;
1352 : run the defines and the undefines, if any, but leave the file out there...
1355 : create the posthint manipulation script and leave the file out there...
1360 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1361 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1362 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1363 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1364 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1367 : Some greps do not return status, grrr.
1368 echo "grimblepritz" >grimble
1369 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1371 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1377 : the following should work in any shell
1381 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1382 cat >contains <<'EOSS'
1383 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1388 : Find the path to the source tree
1391 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1394 *) src=`cd ../$src && pwd` ;;
1407 if test -f $rsrc/Configure && \
1408 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1410 : found it, so we are ok.
1413 for src in . .. ../.. ../../.. ../../../..; do
1414 if test -f ../$src/Configure && \
1415 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1426 Sorry, I can't seem to locate the source dir for $package. Please start
1427 Configure with an explicit path -- i.e. /some/path/Configure.
1435 echo "Sources for $package found in \"$src\"." >&4
1439 : script used to extract .SH files with variable substitutions
1440 cat >extract <<'EOS'
1442 echo "Doing variable substitutions on .SH files..."
1443 if test -f $src/MANIFEST; then
1444 set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH$'`
1446 echo "(Looking for .SH files under the source directory.)"
1447 set x `(cd $src; find . -name "*.SH" -print)`
1451 0) set x `(cd $src; echo *.SH)`; shift;;
1453 if test ! -f $src/$1; then
1459 while test $name; do
1460 if test ! -d "$name"; then
1461 create="$name $create";
1462 name=`echo $name | sed -e "s|^[^/]*$||"`;
1463 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1468 for file in $create; do
1477 dir=`expr X$file : 'X\(.*\)/'`
1478 file=`expr X$file : 'X.*/\(.*\)'`
1479 (cd $dir && . ./$file)
1489 dir=`expr X$file : 'X\(.*\)/'`
1490 file=`expr X$file : 'X.*/\(.*\)'`
1491 (set x $dir; shift; eval $mkdir_p)
1501 if test -f $src/config_h.SH; then
1502 if test ! -f config.h; then
1503 : oops, they left it out of MANIFEST, probably, so do it anyway.
1509 : extract files and exit if asked to do so
1510 case "$extractsh" in
1512 case "$realsilent" in
1516 case "$config_sh" in
1517 '') config_sh='config.sh';;
1520 echo "Fetching answers from $config_sh..."
1523 test "$override" && . ./optdef.sh
1532 : Eunice requires " " instead of "", can you believe it
1535 echo "Beginning of configuration questions for $package."
1537 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1539 : first determine how to suppress newline on echo command
1541 echo "Checking echo to see how to suppress newlines..."
1542 (echo "hi there\c" ; echo " ") >.echotmp
1543 if $contains c .echotmp >/dev/null 2>&1 ; then
1554 echo $n "The star should be here-->$c"
1558 : Now test for existence of everything in MANIFEST
1560 if test -f $rsrc/MANIFEST; then
1561 echo "First let's make sure your kit is complete. Checking..." >&4
1562 awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
1565 for filelist in x??; do
1566 (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
1568 if test -s missing; then
1572 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1574 You have the option of continuing the configuration process, despite the
1575 distinct possibility that your kit is damaged, by typing 'y'es. If you
1576 do, don't blame me if something goes wrong. I advise you to type 'n'o
1577 and contact the author (perlbug@perl.com).
1580 echo $n "Continue? [n] $c" >&4
1584 echo "Continuing..." >&4
1588 echo "ABORTING..." >&4
1593 echo "Looks good..."
1596 echo "There is no MANIFEST file. I hope your kit is complete !"
1601 : Find the appropriate value for a newline for tr
1602 if test -n "$DJGPP"; then
1605 if test X"$trnl" = X; then
1606 case "`echo foo|tr '\n' x 2>/dev/null`" in
1610 if test X"$trnl" = X; then
1611 case "`echo foo|tr '\012' x 2>/dev/null`" in
1612 foox) trnl='\012' ;;
1615 if test X"$trnl" = X; then
1618 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1624 : compute the number of columns on the terminal for proper question formatting
1629 : set up the echo used in my read
1630 myecho="case \"\$xxxm\" in
1631 '') echo $n \"\$rp $c\" >&4;;
1633 '') echo $n \"[\$xxxm] $c\";;
1635 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1637 echo $n \"[\$xxxm] $c\" >&4
1639 echo $n \"\$rp [\$xxxm] $c\" >&4
1645 : now set up to do reads with possible shell escape and default assignment
1651 case "\$fastread" in
1652 yes) case "\$dflt" in
1655 case "\$silent-\$rp" in
1660 *) case "\$silent" in
1661 true) case "\$rp" in
1666 while expr "X\$ans" : "X!" >/dev/null; do
1670 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1678 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1687 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1692 echo "(OK, I'll run with -d after this question.)" >&4
1695 echo "*** Sorry, \$1 not supported yet." >&4
1705 echo "*** Substitution done -- please confirm."
1707 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1712 echo "*** Error -- try again."
1719 case "\$ans\$xxxm\$nostick" in
1731 : create .config dir to save info across Configure sessions
1732 test -d ../.config || mkdir ../.config
1733 cat >../.config/README <<EOF
1734 This directory created by Configure to save information that should
1735 persist across sessions for $package.
1737 You may safely delete it if you wish.
1740 : general instructions
1743 user=`(logname) 2>/dev/null`
1745 '') user=`whoami 2>&1`;;
1747 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1750 rp='Would you like to see the instructions?'
1761 This installation shell script will examine your system and ask you questions
1762 to determine how the perl5 package should be installed. If you get
1763 stuck on a question, you may use a ! shell escape to start a subshell or
1764 execute a command. Many of the questions will have default answers in square
1765 brackets; typing carriage return will give you the default.
1767 On some of the questions which ask for file or directory names you are allowed
1768 to use the ~name construct to specify the login directory belonging to "name",
1769 even if you don't have a shell which knows about that. Questions where this is
1770 allowed will be marked "(~name ok)".
1774 dflt='Type carriage return to continue'
1778 The prompter used in this script allows you to use shell variables and
1779 backticks in your answers. You may use $1, $2, etc... to refer to the words
1780 in the default answer, as if the default line was a set of arguments given to a
1781 script shell. This means you may also use $* to repeat the whole default line,
1782 so you do not have to re-type everything to add something to the default.
1784 Everytime there is a substitution, you will have to confirm. If there is an
1785 error (e.g. an unmatched backtick), the default answer will remain unchanged
1786 and you will be prompted again.
1788 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1789 the questions and use the computed defaults (or the previous answers if there
1790 was already a config.sh file). Type 'Configure -h' for a list of options.
1791 You may also start interactively and then answer '& -d' at any prompt to turn
1792 on the non-interactive behaviour for the remainder of the execution.
1798 Much effort has been expended to ensure that this shell script will run on any
1799 Unix system. If despite that it blows up on yours, your best bet is to edit
1800 Configure and run it again. If you can't run Configure for some reason,
1801 you'll have to generate a config.sh file by hand. Whatever problems you
1802 have, let me (perlbug@perl.com) know how I blew it.
1804 This installation script affects things in two ways:
1806 1) it may do direct variable substitutions on some of the files included
1808 2) it builds a config.h file for inclusion in C programs. You may edit
1809 any of these files as the need arises after running this script.
1811 If you make a mistake on a question, there is no easy way to back up to it
1812 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1813 files. Configure will offer to let you do this before it runs the SH files.
1816 dflt='Type carriage return to continue'
1818 case "$firsttime" in
1819 true) echo $user >>../.config/instruct;;
1823 : find out where common programs are
1825 echo "Locating common programs..." >&4
1838 if test -d \$dir/\$thing; then
1844 for thisthing in \$dir/\$thing; do
1845 : just loop through to pick last item
1847 if test -f \$thisthing; then
1850 elif test -f \$dir/\$thing.exe; then
1851 if test -n "$DJGPP"; then
1852 echo \$dir/\$thing.exe
1854 : on Eunice apparently
1904 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1905 pth="$pth /lib /usr/lib"
1906 for file in $loclist; do
1910 if test -f "$xxx"; then
1913 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1914 xxx=`./loc $file $file $pth`
1917 '') xxx=`./loc $file $file $pth`;;
1918 *) xxx=`./loc $xxx $xxx $pth`;;
1924 echo $file is in $xxx.
1927 echo $file is in $xxx.
1930 echo "I don't know where '$file' is, and my life depends on it." >&4
1931 echo "Go find a public domain implementation or fix your PATH setting!" >&4
1937 echo "Don't worry if any of the following aren't found..."
1939 for file in $trylist; do
1943 if test -f "$xxx"; then
1946 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1947 xxx=`./loc $file $file $pth`
1950 '') xxx=`./loc $file $file $pth`;;
1951 *) xxx=`./loc $xxx $xxx $pth`;;
1957 echo $file is in $xxx.
1960 echo $file is in $xxx.
1963 echo "I don't see $file out there, $say."
1970 echo "Substituting grep for egrep."
1976 echo "Substituting cp for ln."
1982 echo "Hopefully test is built into your sh."
1985 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
1986 echo "Using the test built into your sh."
1994 echo "Hopefully echo is built into your sh."
1999 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2000 $echo $n "hi there$c" >foo1
2001 echo $n "hi there$c" >foo2
2002 if cmp foo1 foo2 >/dev/null 2>&1; then
2003 echo "They are compatible. In fact, they may be identical."
2010 They are not compatible! You are probably running ksh on a non-USG system.
2011 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2012 have echo built in and we may have to run some Bourne shell scripts. That
2013 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2016 $echo $n "The star should be here-->$c"
2023 : determine whether symbolic links are supported
2026 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2027 echo "Symbolic links are supported." >&4
2030 echo "Symbolic links are NOT supported." >&4
2035 : see whether [:lower:] and [:upper:] are supported character classes
2037 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2039 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2043 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
2044 # (0xc9 and 0xd1), therefore that is a nice testing point.
2045 if test "X$up" = X -o "X$low" = X; then
2046 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
2052 if test "X$up" = X -o "X$low" = X; then
2053 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
2059 if test "X$up" = X -o "X$low" = X; then
2060 case "`echo IJ | od -x 2>/dev/null`" in
2062 echo "Hey, this might be EBCDIC." >&4
2063 if test "X$up" = X -o "X$low" = X; then
2064 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2065 ij) up='[A-IJ-RS-Z]'
2070 if test "X$up" = X -o "X$low" = X; then
2071 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2081 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
2083 echo "Using $up and $low to convert case." >&4
2086 echo "I don't know how to translate letters from upper to lower case." >&4
2087 echo "Your tr is not acting any way I know of." >&4
2091 : set up the translation script tr, must be called with ./tr of course
2095 '[A-Z][a-z]') exec $tr '$up' '$low';;
2096 '[a-z][A-Z]') exec $tr '$low' '$up';;
2103 : Try to determine whether config.sh was made on this system
2104 case "$config_sh" in
2106 myuname=`$uname -a 2>/dev/null`
2107 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2108 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2109 # because the A-Z/a-z are not consecutive.
2110 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2111 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2112 newmyuname="$myuname"
2114 case "$knowitall" in
2116 if test -f ../config.sh; then
2117 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2118 eval "`grep myuname= ../config.sh`"
2120 if test "X$myuname" = "X$newmyuname"; then
2128 : Get old answers from old config file if Configure was run on the
2129 : same system, otherwise use the hints.
2132 if test -f config.sh; then
2134 rp="I see a config.sh file. Shall I use it to set the defaults?"
2137 n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;;
2138 *) echo "Fetching default answers from your old config.sh file..." >&4
2146 : Older versions did not always set $sh. Catch re-use of such
2155 if test ! -f config.sh; then
2158 First time through, eh? I have some defaults handy for some systems
2159 that need some extra help getting the Configure answers right:
2162 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2164 : Half the following guesses are probably wrong... If you have better
2165 : tests or hints, please send them to perlbug@perl.com
2166 : The metaconfig authors would also appreciate a copy...
2167 $test -f /irix && osname=irix
2168 $test -f /xenix && osname=sco_xenix
2169 $test -f /dynix && osname=dynix
2170 $test -f /dnix && osname=dnix
2171 $test -f /lynx.os && osname=lynxos
2172 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2173 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
2174 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2175 $test -f /bin/mips && /bin/mips && osname=mips
2176 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
2177 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
2178 $test -d /usr/apollo/bin && osname=apollo
2179 $test -f /etc/saf/_sactab && osname=svr4
2180 $test -d /usr/include/minix && osname=minix
2181 if $test -d /MachTen -o -d /MachTen_Folder; then
2183 if $test -x /sbin/version; then
2184 osvers=`/sbin/version | $awk '{print $2}' |
2185 $sed -e 's/[A-Za-z]$//'`
2186 elif $test -x /usr/etc/version; then
2187 osvers=`/usr/etc/version | $awk '{print $2}' |
2188 $sed -e 's/[A-Za-z]$//'`
2194 $test -f /sys/posix.dll &&
2195 $test -f /usr/bin/what &&
2196 set X `/usr/bin/what /sys/posix.dll` &&
2197 $test "$3" = UWIN &&
2201 if $test -f $uname; then
2209 umips) osname=umips ;;
2212 [23]100) osname=mips ;;
2213 next*) osname=next ;;
2215 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
2216 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
2219 elif $test -f /etc/kconfig; then
2221 if test "$lns" = "$ln -s"; then
2223 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
2225 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
2232 if test -n "$DJGPP"; then
2241 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
2243 'not found') osvers="$4"."$3" ;;
2244 '<3240'|'<>3240') osvers=3.2.0 ;;
2245 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
2246 '=3250'|'>3250') osvers=3.2.5 ;;
2250 bsd386) osname=bsd386
2253 cygwin*) osname=cygwin
2256 *dc.osx) osname=dcosx
2262 domainos) osname=apollo
2268 dynixptx*) osname=dynixptx
2269 osvers=`echo "$4"|sed 's/^v//'`
2271 freebsd) osname=freebsd
2273 genix) osname=genix ;;
2275 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
2291 netbsd*) osname=netbsd
2294 news-os) osvers="$3"
2296 4*) osname=newsos4 ;;
2300 next*) osname=next ;;
2301 POSIX-BC | posix-bc ) osname=posix-bc
2304 powerux | power_ux | powermax_os | powermaxos | \
2305 powerunix | power_unix) osname=powerux
2311 solaris) osname=solaris
2313 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2320 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2324 titanos) osname=titanos
2333 ultrix) osname=ultrix
2336 osf1|mls+) case "$5" in
2339 osvers=`echo "$3" | sed 's/^[xvt]//'`
2341 hp*) osname=hp_osf1 ;;
2342 mips) osname=mips_osf1 ;;
2345 unixware) osname=svr5
2351 $2) case "$osname" in
2355 : svr4.x or possibly later
2365 if test -f /stand/boot ; then
2366 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
2367 if test -n "$INITPROG" -a -f "$INITPROG"; then
2368 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
2369 if test -n "$isesix"; then
2377 *) if test -f /etc/systemid; then
2379 set `echo $3 | $sed 's/\./ /g'` $4
2380 if $test -f $src/hints/sco_$1_$2_$3.sh; then
2382 elif $test -f $src/hints/sco_$1_$2.sh; then
2384 elif $test -f $src/hints/sco_$1.sh; then
2389 '') : Still unknown. Probably a generic Sys V.
2398 *) case "$osname" in
2399 '') : Still unknown. Probably a generic BSD.
2407 if test -f /vmunix -a -f $src/hints/news_os.sh; then
2408 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
2409 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
2412 $rm -f UU/kernel.what
2413 elif test -d c:/.; then
2420 : Now look for a hint file osname_osvers, unless one has been
2421 : specified already.
2424 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
2425 : Also try without trailing minor version numbers.
2426 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
2427 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
2428 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
2429 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
2432 *) case "$osvers" in
2435 *) if $test -f $src/hints/$file.sh ; then
2437 elif $test -f $src/hints/$xfile.sh ; then
2439 elif $test -f $src/hints/$xxfile.sh ; then
2441 elif $test -f $src/hints/$xxxfile.sh ; then
2443 elif $test -f $src/hints/$xxxxfile.sh ; then
2445 elif $test -f "$src/hints/${osname}.sh" ; then
2454 if $test -f Policy.sh ; then
2457 none) dflt="Policy" ;;
2458 *) dflt="Policy $dflt" ;;
2463 dflt=`echo $hintfile | $sed 's/\.sh$//'`
2467 if $test -f Policy.sh ; then
2470 There's also a Policy hint file available, which should make the
2471 site-specific (policy) questions easier to answer.
2478 You may give one or more space-separated answers, or "none" if appropriate.
2479 A well-behaved OS will have no hints, so answering "none" or just "Policy"
2480 is a good thing. DO NOT give a wrong version or a wrong OS.
2484 rp="Which of these apply, if any?"
2487 for file in $tans; do
2488 if $test X$file = XPolicy -a -f Policy.sh; then
2490 $cat Policy.sh >> UU/config.sh
2491 elif $test -f $src/hints/$file.sh; then
2492 . $src/hints/$file.sh
2493 $cat $src/hints/$file.sh >> UU/config.sh
2494 elif $test X$tans = X -o X$tans = Xnone ; then
2497 : Give one chance to correct a possible typo.
2498 echo "$file.sh does not exist"
2500 rp="hint to use instead?"
2502 for file in $ans; do
2503 if $test -f "$src/hints/$file.sh"; then
2504 . $src/hints/$file.sh
2505 $cat $src/hints/$file.sh >> UU/config.sh
2506 elif $test X$ans = X -o X$ans = Xnone ; then
2509 echo "$file.sh does not exist -- ignored."
2516 : Remember our hint file for later.
2517 if $test -f "$src/hints/$file.sh" ; then
2527 echo "Fetching default answers from $config_sh..." >&4
2531 cp $config_sh config.sh 2>/dev/null
2541 test "$override" && . ./optdef.sh
2542 myuname="$newmyuname"
2544 : Restore computed paths
2545 for file in $loclist $trylist; do
2546 eval $file="\$_$file"
2551 Configure uses the operating system name and version to set some defaults.
2552 The default value is probably right if the name rings a bell. Otherwise,
2553 since spelling matters for me, either accept the default or answer "none"
2560 ''|' '|none) dflt=none ;;
2561 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
2564 *) dflt="$osname" ;;
2566 rp="Operating system name?"
2570 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
2576 ''|' '|none) dflt=none ;;
2577 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
2578 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
2580 ''|' ') dflt=none ;;
2585 *) dflt="$osvers" ;;
2587 rp="Operating system version?"
2597 : who configured the system
2598 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
2599 cf_by=`(logname) 2>/dev/null`
2602 cf_by=`(whoami) 2>/dev/null`
2604 "") cf_by=unknown ;;
2608 : set up the script used to warn in case of inconsistency
2615 echo "*** WHOA THERE!!! ***" >&4
2616 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2617 rp=" Keep the $hint value?"
2620 y) td=$was; tu=$was;;
2624 : function used to set $1 to $val
2625 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2627 $define$undef) . ./whoa; eval "$var=\$td";;
2628 $undef$define) . ./whoa; eval "$var=\$tu";;
2629 *) eval "$var=$val";;
2632 case "$usethreads" in
2633 $define|true|[yY]*) dflt='y';;
2638 Perl can be built to take advantage of threads on some systems.
2639 To do so, Configure can be run with -Dusethreads.
2641 Note that threading is a highly experimental feature, and
2642 some known race conditions still remain. If you choose to try
2643 it, be very sure to not actually deploy it for production
2644 purposes. README.threads has more details, and is required
2645 reading if you enable threads.
2647 If this doesn't make any sense to you, just accept the default '$dflt'.
2649 rp='Build a threading Perl?'
2652 y|Y) val="$define" ;;
2658 case "$usethreads" in
2662 As of 5.5.640, Perl has two different internal threading implementations,
2663 the 5.005 version (5005threads) and an interpreter-based version
2664 (ithreads) that has one interpreter per thread. Both are very
2665 experimental. This arrangement exists to help developers work out
2666 which one is better.
2668 If you're a casual user, you probably don't want interpreter-threads
2669 at this time. There doesn't yet exist a way to create threads from
2670 within Perl in this model, i.e., "use Thread;" will NOT work.
2672 : Default to ithreads unless overridden on command line or with
2675 case "$use5005threads" in
2676 $define|true|[yY]*) dflt='n';;
2678 case "$useithreads" in
2679 $undef|false|[nN]*) dflt='n';;
2681 rp='Use interpreter-based ithreads?'
2684 y|Y) val="$define" ;;
2689 : Now set use5005threads to the opposite value.
2690 case "$useithreads" in
2691 $define) val="$undef" ;;
2698 useithreads="$undef"
2699 use5005threads="$undef"
2703 case "$d_oldpthreads" in
2704 '') : Configure tests would be welcome here. For now, assume undef.
2706 *) val="$d_oldpthreads" ;;
2712 case "$usethreads" in
2713 "$define"|true|[yY]*)
2714 : Look for a hint-file generated 'call-back-unit'. If the
2715 : user has specified that a threading perl is to be built,
2716 : we may need to set or change some other defaults.
2717 if $test -f usethreads.cbu; then
2718 echo "Your platform has some specific hints for threaded builds, using them..."
2722 (Your platform doesn't have any specific hints for threaded builds.
2723 Assuming POSIX threads, then.)
2731 Perl can be built so that multiple Perl interpreters can coexist
2732 within the same Perl executable.
2735 case "$useithreads" in
2738 This multiple interpreter support is required for interpreter-based threads.
2742 *) case "$usemultiplicity" in
2743 $define|true|[yY]*) dflt='y';;
2747 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
2748 rp='Build Perl for multiplicity?'
2751 y|Y) val="$define" ;;
2759 : determine where manual pages are on this system
2763 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
2764 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
2765 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
2766 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
2767 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
2768 sysman=`./loc . /usr/man/man1 $syspath`
2771 if $test -d "$sysman"; then
2772 echo "System manual is in $sysman." >&4
2774 echo "Could not find manual pages in source form." >&4
2777 : see what memory models we can support
2780 $cat >pdp11.c <<'EOP'
2789 ( cc -o pdp11 pdp11.c ) >/dev/null 2>&1
2790 if $test -f pdp11 && ./pdp11 2>/dev/null; then
2791 dflt='unsplit split'
2793 tans=`./loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge`
2796 *) if $test -d /lib/small || $test -d /usr/lib/small; then
2801 if $test -d /lib/medium || $test -d /usr/lib/medium; then
2804 if $test -d /lib/large || $test -d /usr/lib/large; then
2807 if $test -d /lib/huge || $test -d /usr/lib/huge; then
2816 Some systems have different model sizes. On most systems they are called
2817 small, medium, large, and huge. On the PDP11 they are called unsplit and
2818 split. If your system doesn't support different memory models, say "none".
2819 If you wish to force everything to one memory model, say "none" here and
2820 put the appropriate flags later when it asks you for other cc and ld flags.
2821 Venix systems may wish to put "none" and let the compiler figure things out.
2822 (In the following question multiple model names should be space separated.)
2824 The default for most systems is "none".
2827 rp="Which memory models are supported?"
2842 '') if $contains '\-i' $sysman/ld.1 >/dev/null 2>&1 || \
2843 $contains '\-i' $sysman/cc.1 >/dev/null 2>&1; then
2850 rp="What flag indicates separate I and D space?"
2858 *large*|*small*|*medium*|*huge*)
2865 rp="What flag indicates large model?"
2875 *huge*) case "$huge" in
2879 rp="What flag indicates huge model?"
2889 *medium*) case "$medium" in
2893 rp="What flag indicates medium model?"
2900 *) medium="$large";;
2903 *small*) case "$small" in
2907 rp="What flag indicates small model?"
2918 echo "Unrecognized memory models--you may have to edit Makefile.SH" >&4
2921 $rm -f pdp11.* pdp11
2923 : make some quick guesses about what we are up against
2925 $echo $n "Hmm... $c"
2935 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
2936 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
2938 echo "Looks kind of like an OSF/1 system, but we'll see..."
2940 elif test `echo abc | tr a-z A-Z` = Abc ; then
2941 xxx=`./loc addbib blurfl $pth`
2942 if $test -f $xxx; then
2943 echo "Looks kind of like a USG system with BSD features, but we'll see..."
2947 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
2948 echo "Looks kind of like an extended USG system, but we'll see..."
2950 echo "Looks kind of like a USG system, but we'll see..."
2954 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
2955 echo "Looks kind of like a BSD system, but we'll see..."
2959 echo "Looks kind of like a Version 7 system, but we'll see..."
2962 case "$eunicefix" in
2965 There is, however, a strange, musty smell in the air that reminds me of
2966 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
2970 : it so happens the Eunice I know will not run shell scripts in Unix format
2974 echo "Congratulations. You aren't running Eunice."
2978 : Detect OS2. The p_ variable is set above in the Head.U unit.
2983 I have the feeling something is not exactly right, however...don't tell me...
2984 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
2989 if test -f /xenix; then
2990 echo "Actually, this looks more like a XENIX system..."
2995 echo "It's not Xenix..."
3000 if test -f /venix; then
3001 echo "Actually, this looks more like a VENIX system..."
3008 echo "Nor is it Venix..."
3011 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3012 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3015 : see if we need a special compiler
3023 *) if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then
3024 if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then
3038 On some older systems the default C compiler will not resolve multiple global
3039 references that happen to have the same name. On some such systems the "Mcc"
3040 command may be used to force these to be resolved. On other systems a "cc -M"
3041 command is required. (Note that the -M flag on other systems indicates a
3042 memory model to use!) If you have the Gnu C compiler, you might wish to use
3048 rp="Use which C compiler?"
3056 rp="Use which C compiler?"
3060 : Look for a hint-file generated 'call-back-unit'. Now that the
3061 : user has specified the compiler, we may need to set or change some
3063 if $test -f cc.cbu; then
3067 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3068 $cat >gccvers.c <<EOM
3073 printf("%s\n", __VERSION__);
3075 printf("%s\n", "1");
3081 if $cc $ldflags -o gccvers gccvers.c; then
3082 gccversion=`./gccvers`
3083 case "$gccversion" in
3084 '') echo "You are not using GNU cc." ;;
3085 *) echo "You are using GNU cc $gccversion."
3090 echo "*** WHOA THERE!!! ***" >&4
3091 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3092 case "$knowitall" in
3094 echo " You'd better start hunting for one and let me know about it." >&4
3100 case "$gccversion" in
3101 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3104 : decide how portable to be. Allow command line overrides.
3105 case "$d_portable" in
3107 *) d_portable="$define" ;;
3110 : set up shell script to do ~ expansion
3116 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3119 if $test -f /bin/csh; then
3120 /bin/csh -f -c "glob \$1"
3125 name=\`$expr x\$1 : '..\([^/]*\)'\`
3126 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3127 if $test ! -d "\$dir"; then
3129 echo "\$me: can't locate home directory for: \$name" >&2
3134 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3150 : now set up to get a file name
3154 cat <<'EOSC' >>getfile
3170 expr $fn : '.*(\(.*\)).*' | tr ',' $trnl >getfile.ok
3171 fn=`echo $fn | sed 's/(.*)//'`
3177 loc_file=`expr $fn : '.*:\(.*\)'`
3178 fn=`expr $fn : '\(.*\):.*'`
3186 */*) fullpath=true;;
3195 *e*) exp_file=true;;
3198 *p*) nopath_ok=true;;
3203 *d*) type='Directory';;
3204 *l*) type='Locate';;
3209 Locate) what='File';;
3214 case "$d_portable" in
3222 while test "$type"; do
3227 true) rp="$rp (~name ok)";;
3230 if test -f UU/getfile.ok && \
3231 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3250 value=`UU/filexp $ans`
3253 if test "$ans" != "$value"; then
3254 echo "(That expands to $value on this system.)"
3268 /*) value="$ansexp" ;;
3273 echo "I shall only accept a full path name, as in /bin/ls." >&4
3274 echo "Use a ! shell escape if you wish to check pathnames." >&4
3277 echo "Please give a full path name, starting with slash." >&4
3280 echo "Note that using ~name is ok provided it expands well." >&4
3293 for fp in $gfpth; do
3294 if test "X$fp" = X.; then
3299 if test -f "$pf"; then
3301 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3303 echo "($value is not a plain file, but that's ok.)"
3306 if test X"$type" = X; then
3313 for fp in $gfpth; do
3314 if test "X$fp" = X.; then
3319 if test -d "$pf"; then
3327 if test -d "$ansexp"; then
3328 echo "(Looking for $loc_file in directory $value.)"
3329 value="$value/$loc_file"
3330 ansexp="$ansexp/$loc_file"
3332 if test -f "$ansexp"; then
3335 case "$nopath_ok" in
3336 true) case "$value" in
3338 *) echo "Assuming $value will be in people's path."
3354 if test "$fastread" = yes; then
3359 rp="$what $value doesn't exist. Use that name anyway?"
3378 test "X$gfpthkeep" != Xy && gfpth=""
3381 : What should the include directory be ?
3383 $echo $n "Hmm... $c"
3387 if $test -f /bin/mips && /bin/mips; then
3388 echo "Looks like a MIPS system..."
3389 $cat >usr.c <<'EOCP'
3390 #ifdef SYSTYPE_BSD43
3394 if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3395 dflt='/bsd43/usr/include'
3399 mips_type='System V'
3401 $rm -f usr.c usr.out
3402 echo "and you're compiling with the $mips_type compiler and libraries."
3406 echo "Doesn't look like a MIPS system."
3416 case "$xxx_prompt" in
3419 rp='Where are the include files you want to use?'
3427 : see how we invoke the C preprocessor
3429 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3430 cat <<'EOT' >testcpp.c
3436 if test ! -f cppstdin; then
3437 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
3438 # AIX cc -E doesn't show the absolute headerfile
3439 # locations but we'll cheat by using the -M flag.
3440 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
3442 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3445 echo "Keeping your $hint cppstdin wrapper."
3448 wrapper=`pwd`/cppstdin
3452 if $test "X$cppstdin" != "X" && \
3453 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3454 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3456 echo "You used to use $cppstdin $cppminus so we'll use that again."
3458 '') echo "But let's see if we can live without a wrapper..." ;;
3460 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3461 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3463 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3466 echo "(However, $cpprun $cpplast does not work, let's see...)"
3474 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3481 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3482 $cc -E <testcpp.c >testcpp.out 2>&1; \
3483 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3484 echo "Yup, it does."
3487 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
3488 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3489 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3490 echo "Yup, it does."
3493 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
3494 $cc -P <testcpp.c >testcpp.out 2>&1; \
3495 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3496 echo "Yipee, that works!"
3499 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
3500 $cc -P - <testcpp.c >testcpp.out 2>&1; \
3501 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3502 echo "At long last!"
3505 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
3506 $cpp <testcpp.c >testcpp.out 2>&1; \
3507 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3511 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
3512 $cpp - <testcpp.c >testcpp.out 2>&1; \
3513 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3514 echo "Hooray, it works! I was beginning to wonder."
3517 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
3518 $wrapper <testcpp.c >testcpp.out 2>&1; \
3519 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3525 rp="No dice. I can't find a C preprocessor. Name one:"
3529 $x_cpp <testcpp.c >testcpp.out 2>&1
3530 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3531 echo "OK, that will do." >&4
3533 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
3548 echo "Perhaps can we force $cc -E using a wrapper..."
3549 if $wrapper <testcpp.c >testcpp.out 2>&1; \
3550 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3556 echo "Nope, we'll have to live without it..."
3570 "$wrapper"|'cppstdin') ;;
3571 *) $rm -f $wrapper;;
3573 $rm -f testcpp.c testcpp.out
3575 : Set private lib path
3578 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
3583 '') dlist="$loclibpth $plibpth $glibpth";;
3584 *) dlist="$libpth";;
3587 : Now check and see which directories actually exist, avoiding duplicates
3591 if $test -d $xxx; then
3594 *) libpth="$libpth $xxx";;
3600 Some systems have incompatible or broken versions of libraries. Among
3601 the directories listed in the question below, please remove any you
3602 know not to be holding relevant libraries, and add any that are needed.
3603 Say "none" for none.
3614 rp="Directories to use for library searches?"
3621 : compute shared library extension
3624 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
3634 On some systems, shared libraries may be available. Answer 'none' if
3635 you want to suppress searching of shared libraries for the remainder
3636 of this configuration.
3639 rp='What is the file extension used for shared libraries?'
3643 : Define several unixisms.
3644 : Hints files or command line option can be used to override them.
3645 : The convoluted testing is in case hints files set either the old
3648 '') case "$exe_ext" in
3650 *) _exe="$exe_ext" ;;
3655 '') case "$lib_ext" in
3662 '') case "$obj_ext" in
3669 '') case "$path_sep" in
3680 : Which makefile gets called first. This is used by make depend.
3681 case "$firstmakefile" in
3682 '') firstmakefile='makefile';;
3686 $define|true|[yY]*) dflt='y';;
3691 Perl can be built to use the SOCKS proxy protocol library. To do so,
3692 Configure must be run with -Dusesocks.
3694 If this doesn't make any sense to you, just accept the default '$dflt'.
3696 rp='Build Perl for SOCKS?'
3699 y|Y) val="$define" ;;
3705 : Looking for optional libraries
3707 echo "Checking for optional libraries..." >&4
3712 case "$libswanted" in
3713 '') libswanted='c_s';;
3716 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
3722 for thisdir in $libpth $xlibpth; do
3723 test -d $thisdir && libspath="$libspath $thisdir"
3725 for thislib in $libswanted; do
3726 for thisdir in $libspath; do
3728 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
3729 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|tail -1`
3730 $test -f "$xxx" && eval $libscheck
3731 $test -f "$xxx" && libstyle=shared
3733 if test ! -f "$xxx"; then
3734 xxx=$thisdir/lib$thislib.$so
3735 $test -f "$xxx" && eval $libscheck
3736 $test -f "$xxx" && libstyle=shared
3738 if test ! -f "$xxx"; then
3739 xxx=$thisdir/lib$thislib$_a
3740 $test -f "$xxx" && eval $libscheck
3741 $test -f "$xxx" && libstyle=static
3743 if test ! -f "$xxx"; then
3744 xxx=$thisdir/$thislib$_a
3745 $test -f "$xxx" && eval $libscheck
3746 $test -f "$xxx" && libstyle=static
3748 if test ! -f "$xxx"; then
3749 xxx=$thisdir/lib${thislib}_s$_a
3750 $test -f "$xxx" && eval $libscheck
3751 $test -f "$xxx" && libstyle=static
3752 $test -f "$xxx" && thislib=${thislib}_s
3754 if test ! -f "$xxx"; then
3755 xxx=$thisdir/Slib$thislib$_a
3756 $test -f "$xxx" && eval $libscheck
3757 $test -f "$xxx" && libstyle=static
3759 if $test -f "$xxx"; then
3761 shared) echo "Found -l$thislib (shared)." ;;
3762 static) echo "Found -l$thislib." ;;
3763 *) echo "Found -l$thislib ($libstyle)." ;;
3767 *) dflt="$dflt -l$thislib"
3768 libsfound="$libsfound $xxx"
3770 libsfiles="$libsfiles $yyy"
3771 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
3772 case " $libsdirs " in
3774 *) libsdirs="$libsdirs $yyy" ;;
3781 if $test ! -f "$xxx"; then
3782 echo "No -l$thislib."
3793 ' '|'') dflt='none';;
3798 In order to compile $package on your machine, a number of libraries
3799 are usually needed. Include any other special libraries here as well.
3800 Say "none" for none. The default list is almost always right.
3804 rp="What libraries to use?"
3811 : determine optimization, if desired, or use for debug flag also
3813 ' '|$undef) dflt='none';;
3815 *) dflt="$optimize";;
3819 By default, $package compiles with the -O flag to use the optimizer.
3820 Alternately, you might want to use the symbolic debugger, which uses
3821 the -g flag (on traditional Unix systems). Either flag can be
3822 specified here. To use neither flag, specify the word "none".
3825 rp="What optimizer/debugger flag should be used?"
3829 'none') optimize=" ";;
3833 : We will not override a previous value, but we might want to
3834 : augment a hint file
3836 default|recommended)
3837 case "$gccversion" in
3838 1*) dflt='-fpcc-struct-return' ;;
3841 *-g*) dflt="$dflt -DDEBUGGING";;
3843 case "$gccversion" in
3844 2*) if test -d /etc/conf/kconfig.d &&
3845 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
3851 case "$gccversion" in
3855 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
3856 echo 'int main(void) { return 0; }' > gcctest.c
3857 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
3858 echo "Yes, it does." 2>&1
3861 echo "Leaving current flags $ccflags alone." 2>&1
3863 *) dflt="$dflt -fno-strict-aliasing" ;;
3866 echo "Nope, it doesn't, but that's ok." 2>&1
3873 case "$mips_type" in
3874 *BSD*|'') inclwanted="$locincpth $usrinc";;
3875 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
3877 for thisincl in $inclwanted; do
3878 if $test -d $thisincl; then
3879 if $test x$thisincl != x$usrinc; then
3882 *) dflt="$dflt -I$thisincl";;
3888 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
3890 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
3898 *) dflt="$dflt -D$2";;
3902 set signal.h LANGUAGE_C; eval $inctest
3906 ccflags="$ccflags -DSOCKS"
3911 default|recommended) dflt="$ccflags $dflt" ;;
3912 *) dflt="$ccflags";;
3920 Your C compiler may want other flags. For this question you should include
3921 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
3922 but you should NOT include libraries or ld flags like -lwhatever. If you
3923 want $package to honor its debug switch, you should include -DDEBUGGING here.
3924 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
3926 To use no flags, specify the word "none".
3932 rp="Any additional cc flags?"
3939 : the following weeds options from ccflags that are of no interest to cpp
3941 case "$gccversion" in
3942 1*) cppflags="$cppflags -D__GNUC__"
3944 case "$mips_type" in
3946 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
3952 echo "Let me guess what the preprocessor flags are..." >&4
3966 *) ftry="$previous $flag";;
3968 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
3969 >cpp1.out 2>/dev/null && \
3970 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
3971 >cpp2.out 2>/dev/null && \
3972 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
3973 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
3975 cppflags="$cppflags $ftry"
3985 *-*) echo "They appear to be: $cppflags";;
3987 $rm -f cpp.c cpp?.out
3991 : flags used in final linking phase
3993 '') if ./venix; then
3999 *-posix*) dflt="$dflt -posix" ;;
4002 *) dflt="$ldflags";;
4005 : Try to guess additional flags to pick up local libraries.
4006 for thislibdir in $libpth; do
4007 case " $loclibpth " in
4010 *"-L$thislibdir "*) ;;
4011 *) dflt="$dflt -L$thislibdir" ;;
4023 Your C linker may need flags. For this question you should
4024 include -L/whatever and any other flags used by the C linker, but you
4025 should NOT include libraries like -lwhatever.
4027 Make sure you include the appropriate -L/path flags if your C linker
4028 does not normally search all of the directories you specified above,
4031 To use no flags, specify the word "none".
4035 rp="Any additional ld flags (NOT including libraries)?"
4041 rmlist="$rmlist pdp11"
4045 echo "Checking your choice of C compiler and flags for coherency..." >&4
4046 $cat > try.c <<'EOF'
4048 int main() { printf("Ok\n"); exit(0); }
4050 set X $cc $optimize $ccflags -o try $ldflags try.c $libs
4052 $cat >try.msg <<'EOM'
4053 I've tried to compile and run the following simple program:
4056 $cat try.c >> try.msg
4058 $cat >> try.msg <<EOM
4065 and I got the following output:
4069 if sh -c "$cc $optimize $ccflags -o try $ldflags try.c $libs" >>try.msg 2>&1; then
4070 if sh -c './try' >>try.msg 2>&1; then
4074 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4077 cat >> try.msg <<'EOQS'
4078 If $libs contains -lsfio, and sfio is mis-configured, then it
4079 sometimes (apparently) runs and exits with a 0 status, but with no
4080 output! It may have to do with sfio's use of _exit vs. exit.
4083 rp="You have a big problem. Shall I abort Configure"
4090 echo "The program compiled OK, but exited with status $?." >>try.msg
4091 rp="You have a problem. Shall I abort Configure"
4095 echo "I can't compile the test program." >>try.msg
4096 rp="You have a BIG problem. Shall I abort Configure"
4102 case "$knowitall" in
4104 echo "(The supplied flags or libraries might be incorrect.)"
4112 *) echo "Ok. Stopping Configure." >&4
4117 n) echo "OK, that should do.";;
4119 $rm -f try try.* core
4121 : define an is-a-typedef? function
4122 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
4124 "") inclist="sys/types.h";;
4126 eval "varval=\$$var";
4130 for inc in $inclist; do
4131 echo "#include <$inc>" >>temp.c;
4133 echo "#ifdef $type" >> temp.c;
4134 echo "printf(\"We have $type\");" >> temp.c;
4135 echo "#endif" >> temp.c;
4136 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
4137 if $contains $type temp.E >/dev/null 2>&1; then
4143 *) eval "$var=\$varval";;
4146 : define an is-a-typedef? function that prompts if the type is not available.
4147 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
4149 "") inclist="sys/types.h";;
4151 eval "varval=\$$var";
4155 for inc in $inclist; do
4156 echo "#include <$inc>" >>temp.c;
4158 echo "#ifdef $type" >> temp.c;
4159 echo "printf(\"We have $type\");" >> temp.c;
4160 echo "#endif" >> temp.c;
4161 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
4163 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
4164 if $contains $type temp.E >/dev/null 2>&1; then
4165 echo "$type found." >&4;
4168 echo "$type NOT found." >&4;
4174 *) eval "$var=\$varval";;
4177 : define a shorthand compile call
4181 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs > /dev/null 2>&1;'
4182 : define a shorthand compile call for compilations that should be ok.
4186 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs;'
4188 : check for lengths of integral types
4192 echo "Checking to see how big your integers are..." >&4
4193 $cat >intsize.c <<'EOCP'
4197 printf("intsize=%d;\n", (int)sizeof(int));
4198 printf("longsize=%d;\n", (int)sizeof(long));
4199 printf("shortsize=%d;\n", (int)sizeof(short));
4204 if eval $compile_ok && ./intsize > /dev/null; then
4206 echo "Your integers are $intsize bytes long."
4207 echo "Your long integers are $longsize bytes long."
4208 echo "Your short integers are $shortsize bytes long."
4212 Help! I can't compile and run the intsize test program: please enlighten me!
4213 (This is probably a misconfiguration in your system or libraries, and
4214 you really ought to fix it. Still, I'll try anyway.)
4218 rp="What is the size of an integer (in bytes)?"
4222 rp="What is the size of a long integer (in bytes)?"
4226 rp="What is the size of a short integer (in bytes)?"
4232 $rm -f intsize intsize.*
4234 : see what type lseek is declared as in the kernel
4235 rp="What is the type used for lseek's offset on this system?"
4236 set off_t lseektype long stdio.h sys/types.h
4240 echo "Checking to see how big your file offsets are..." >&4
4242 #include <sys/types.h>
4246 printf("%d\n", (int)sizeof($lseektype));
4251 if eval $compile_ok; then
4253 echo "Your file offsets are $lseeksize bytes long."
4257 echo "(I can't seem to compile the test program. Guessing...)"
4258 rp="What is the size of your file offsets (in bytes)?"
4264 : see what type file positions are declared as in the library
4265 rp="What is the type for file position used by fsetpos()?"
4266 set fpos_t fpostype long stdio.h sys/types.h
4271 *_t) zzz="$fpostype" ;;
4274 echo "Checking the size of $zzz..." >&4
4276 #include <sys/types.h>
4279 printf("%d\n", (int)sizeof($fpostype));
4284 if eval $compile_ok; then
4288 echo "(I can't execute the test program--guessing $fpossize.)" >&4
4291 echo "Your $zzz is $fpossize bytes long."
4297 echo "(I can't compile the test program. Guessing...)" >&4
4298 rp="What is the size of your file positions (in bytes)?"
4305 # Backward compatibility (uselfs is deprecated).
4307 "$define"|true|[yY]*)
4310 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
4312 uselargefiles="$define"
4316 case "$lseeksize:$fpossize" in
4319 You can have files larger than 2 gigabytes.
4322 *) case "$uselargefiles" in
4323 "$undef"|false|[nN]*) dflt='n' ;;
4328 Perl can be built to understand large files (files larger than 2 gigabytes)
4329 on some systems. To do so, Configure can be run with -Duselargefiles.
4331 If this doesn't make any sense to you, just accept the default '$dflt'.
4333 rp='Try to understand large files, if available?'
4336 y|Y) val="$define" ;;
4343 case "$uselargefiles" in
4345 : Look for a hint-file generated 'call-back-unit'. If the
4346 : user has specified that a large files perl is to be built,
4347 : we may need to set or change some other defaults.
4348 if $test -f uselargefiles.cbu; then
4349 echo "Your platform has some specific hints for large file builds, using them..."
4350 . ./uselargefiles.cbu
4352 echo "Rechecking to see how big your file offsets are..." >&4
4354 #include <sys/types.h>
4358 printf("%d\n", (int)sizeof($lseektype));
4363 if eval $compile_ok; then
4365 $echo "Your file offsets are now $lseeksize bytes long."
4369 echo "(I can't seem to compile the test program. Guessing...)"
4370 rp="What is the size of your file offsets (in bytes)?"
4375 *_t) zzz="$fpostype" ;;
4378 $echo $n "Rechecking the size of $zzz...$c" >&4
4380 #include <sys/types.h>
4383 printf("%d\n", (int)sizeof($fpostype));
4388 if eval $compile_ok; then
4393 echo "(I can't execute the test program--guessing $fpossize.)" >&4
4396 echo " $fpossize bytes." >&4
4402 echo "(I can't compile the test program. Guessing...)" >&4
4403 rp="What is the size of your file positions (in bytes)?"
4413 case "$usemorebits" in
4414 "$define"|true|[yY]*)
4415 use64bitint="$define"
4416 uselongdouble="$define"
4417 usemorebits="$define"
4419 *) usemorebits="$undef"
4424 case "$uselonglong" in
4425 "$define"|true|[yY]*)
4428 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
4430 use64bitint="$define"
4433 case "$use64bits" in
4434 "$define"|true|[yY]*)
4437 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
4439 use64bitint="$define"
4442 case "$use64bitints" in
4443 "$define"|true|[yY]*)
4446 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
4448 use64bitint="$define"
4451 case "$use64bitsint" in
4452 "$define"|true|[yY]*)
4455 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
4457 use64bitint="$define"
4460 case "$uselonglongs" in
4461 "$define"|true|[yY]*)
4464 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
4466 use64bitint="$define"
4469 case "$use64bitsall" in
4470 "$define"|true|[yY]*)
4473 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
4475 use64bitall="$define"
4480 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
4482 case "$use64bitall" in
4483 "$define"|true|[yY]*) use64bitint="$define" ;;
4489 You have natively 64-bit long integers.
4493 *) case "$use64bitint" in
4494 "$define"|true|[yY]*) dflt='y';;
4499 Perl can be built to take advantage of 64-bit integer types
4500 on some systems. To do so, Configure can be run with -Duse64bitint.
4501 Choosing this option will most probably introduce binary incompatibilities.
4503 If this doesn't make any sense to you, just accept the default '$dflt'.
4505 rp='Try to use 64-bit integers, if available?'
4508 [yY]*) val="$define" ;;
4516 case "$use64bitall" in
4517 "$define"|true|[yY]*) dflt='y' ;;
4518 *) case "$longsize" in
4526 You may also choose to try maximal 64-bitness. It means using as much
4527 64-bitness as possible on the platform. This in turn means even more
4528 binary incompatibilities. On the other hand, your platform may not
4529 have any more 64-bitness available than what you already have chosen.
4531 If this doesn't make any sense to you, just accept the default '$dflt'.
4533 rp='Try to use maximal 64-bit support, if available?'
4536 [yY]*) val="$define" ;;
4541 case "$use64bitall" in
4543 case "$use64bitint" in
4547 Since you have chosen a maximally 64-bit build, I'm also turning on
4548 the use of 64-bit integers.
4550 use64bitint="$define" ;;
4555 case "$use64bitint" in
4556 "$define"|true|[yY]*)
4557 : Look for a hint-file generated 'call-back-unit'. If the
4558 : user has specified that a 64-bit perl is to be built,
4559 : we may need to set or change some other defaults.
4560 if $test -f use64bitint.cbu; then
4561 echo "Your platform has some specific hints for 64-bit integers, using them..."
4565 4) case "$archname64" in
4566 '') archname64=64int ;;
4573 case "$use64bitall" in
4574 "$define"|true|[yY]*)
4575 : Look for a hint-file generated 'call-back-unit'. If the
4576 : user has specified that a maximally 64-bit perl is to be built,
4577 : we may need to set or change some other defaults.
4578 if $test -f use64bitall.cbu; then
4579 echo "Your platform has some specific hints for 64-bit builds, using them..."
4583 4) case "$archname64" in
4584 ''|64int) archname64=64all ;;
4591 : determine the architecture name
4593 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
4594 tarch=`arch`"-$osname"
4595 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
4596 if uname -m > tmparch 2>&1 ; then
4597 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
4598 -e 's/$/'"-$osname/" tmparch`
4606 case "$myarchname" in
4609 echo "(Your architecture name used to be $myarchname.)"
4616 *) dflt="$archname";;
4618 rp='What is your architecture name'
4621 case "$usethreads" in
4623 echo "Threads selected." >&4
4625 *-thread*) echo "...and architecture name already has -thread." >&4
4627 *) archname="$archname-thread"
4628 echo "...setting architecture name to $archname." >&4
4633 case "$usemultiplicity" in
4635 echo "Multiplicity selected." >&4
4637 *-multi*) echo "...and architecture name already has -multi." >&4
4639 *) archname="$archname-multi"
4640 echo "...setting architecture name to $archname." >&4
4645 case "$use64bitint" in
4647 case "$archname64" in
4652 *-$archname64*) echo "...and architecture name already has $archname64." >&4
4654 *) archname="$archname-$archname64"
4655 echo "...setting architecture name to $archname." >&4
4662 : determine root of directory hierarchy where package will be installed.
4665 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
4673 By default, $package will be installed in $dflt/bin, manual pages
4674 under $dflt/man, etc..., i.e. with $dflt as prefix for all
4675 installation directories. Typically this is something like /usr/local.
4676 If you wish to have binaries under /usr/bin but other parts of the
4677 installation under /usr/local, that's ok: you will be prompted
4678 separately for each of the installation directories, the prefix being
4679 only used to set the defaults.
4683 rp='Installation prefix to use?'
4691 *) oldprefix="$prefix";;
4701 $define|true) afs=true ;;
4702 $undef|false) afs=false ;;
4703 *) if test -d /afs; then
4711 echo "AFS may be running... I'll be extra cautious then..." >&4
4713 echo "AFS does not seem to be running..." >&4
4716 : determine installation prefix for where package is to be installed.
4720 Since you are running AFS, I need to distinguish the directory in which
4721 files will reside from the directory in which they are installed (and from
4722 which they are presumably copied to the former directory by occult means).
4725 case "$installprefix" in
4726 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
4727 *) dflt="$installprefix";;
4732 In some special cases, particularly when building $package for distribution,
4733 it is convenient to distinguish between the directory in which files should
4734 be installed from the directory ($prefix) in which they
4735 will eventually reside. For most users, these two directories are the same.
4738 case "$installprefix" in
4740 *) dflt=$installprefix;;
4744 rp='What installation prefix should I use for installing files?'
4746 installprefix="$ans"
4747 installprefixexp="$ansexp"
4749 : set the prefixit variable, to compute a suitable default value
4750 prefixit='case "$3" in
4752 case "$oldprefix" in
4753 "") eval "$1=\"\$$2\"";;
4760 ""|" ") eval "$1=\"\$$2\"";;
4766 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
4768 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
4769 /*-$oldprefix/*|\~*-$oldprefix/*)
4770 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
4771 *) eval "$1=\"\$$2\"";;
4776 : get the patchlevel
4778 echo "Getting the current patchlevel..." >&4
4779 if $test -r $rsrc/patchlevel.h;then
4780 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4781 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4782 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4783 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4784 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4785 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4794 $echo $n "(You have $package revision $revision" $c
4795 $echo $n " patchlevel $patchlevel" $c
4796 test 0 -eq "$subversion" || $echo $n " subversion $subversion" $c
4800 : XXX Should be a Configure test for double-dots in filenames.
4801 version=`echo $revision $patchlevel $subversion | \
4802 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4803 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4804 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4807 version=`echo $revision $patchlevel $subversion | \
4808 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4809 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4810 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4813 : Special case the 5.005_xx maintenance series, which used 5.005
4814 : without any subversion label as a subdirectory in $sitelib
4815 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4816 api_versionstring='5.005'
4819 : determine installation style
4820 : For now, try to deduce it from prefix unless it is already set.
4821 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
4822 case "$installstyle" in
4823 '') case "$prefix" in
4824 *perl*) dflt='lib';;
4825 *) dflt='lib/perl5' ;;
4828 *) dflt="$installstyle" ;;
4830 : Probably not worth prompting for this since we prompt for all
4831 : the directories individually, and the prompt would be too long and
4835 : determine where private library files go
4836 : Usual default is /usr/local/lib/perl5/$version.
4837 : Also allow things like /opt/perl/lib/$version, since
4838 : /opt/perl/lib/perl5... would be redundant.
4839 : The default "style" setting is made in installstyle.U
4840 case "$installstyle" in
4841 *lib/perl5*) set dflt privlib lib/$package/$version ;;
4842 *) set dflt privlib lib/$version ;;
4847 There are some auxiliary files for $package that need to be put into a
4848 private library directory that is accessible by everyone.
4852 rp='Pathname where the private library files will reside?'
4855 privlibexp="$ansexp"
4856 : Change installation prefix, if necessary.
4857 if $test X"$prefix" != X"$installprefix"; then
4858 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
4860 installprivlib="$privlibexp"
4863 : set the prefixup variable, to restore leading tilda escape
4864 prefixup='case "$prefixexp" in
4866 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
4869 : determine where public architecture dependent libraries go
4872 : privlib default is /usr/local/lib/$package/$version
4873 : archlib default is /usr/local/lib/$package/$version/$archname
4874 : privlib may have an optional trailing /share.
4875 tdflt=`echo $privlib | $sed 's,/share$,,'`
4876 tdflt=$tdflt/$archname
4885 $spackage contains architecture-dependent library files. If you are
4886 sharing libraries in a heterogeneous environment, you might store
4887 these files in a separate location. Otherwise, you can just include
4888 them with the rest of the public library files.
4892 rp='Where do you want to put the public architecture-dependent libraries?'
4895 archlibexp="$ansexp"
4896 if $test X"$archlib" = X"$privlib"; then
4901 : Change installation prefix, if necessary.
4902 if $test X"$prefix" != X"$installprefix"; then
4903 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
4905 installarchlib="$archlibexp"
4909 : Binary compatibility with 5.005 is not possible for builds
4910 : with advanced features
4911 case "$usethreads$usemultiplicity" in
4913 bincompat5005="$undef"
4914 d_bincompat5005="$undef"
4918 Perl 5.006 can be compiled for binary compatibility with 5.005.
4919 If you decide to do so, you will be able to continue using most
4920 of the extensions that were compiled for Perl 5.005.
4923 case "$bincompat5005$d_bincompat5005" in
4924 *"$undef"*) dflt=n ;;
4927 rp='Binary compatibility with Perl 5.005?'
4930 y*) val="$define" ;;
4935 case "$d_bincompat5005" in
4937 bincompat5005="$define"
4939 *) bincompat5005="$undef"
4940 d_bincompat5005="$undef"
4947 : see if setuid scripts can be secure
4950 Some kernels have a bug that prevents setuid #! scripts from being
4951 secure. Some sites have disabled setuid #! scripts because of this.
4953 First let's decide if your kernel supports secure setuid #! scripts.
4954 (If setuid #! scripts would be secure but have been disabled anyway,
4955 don't say that they are secure if asked.)
4960 if $test -d /dev/fd; then
4961 echo "#!$ls" >reflect
4962 chmod +x,u+s reflect
4963 ./reflect >flect 2>&1
4964 if $contains "/dev/fd" flect >/dev/null; then
4965 echo "Congratulations, your kernel has secure setuid scripts!" >&4
4969 If you are not sure if they are secure, I can check but I'll need a
4970 username and password different from the one you are using right now.
4971 If you don't have such a username or don't want me to test, simply
4975 rp='Other username to test security of setuid scripts with?'
4980 case "$d_suidsafe" in
4981 '') echo "I'll assume setuid scripts are *not* secure." >&4
4984 echo "Well, the $hint value is *not* secure." >&4
4986 *) echo "Well, the $hint value *is* secure." >&4
4991 $rm -f reflect flect
4992 echo "#!$ls" >reflect
4993 chmod +x,u+s reflect
4996 echo '"su" will (probably) prompt you for '"$ans's password."
4997 su $ans -c './reflect >flect'
4998 if $contains "/dev/fd" flect >/dev/null; then
4999 echo "Okay, it looks like setuid scripts are secure." >&4
5002 echo "I don't think setuid scripts are secure." >&4
5007 rp='Does your kernel have *secure* setuid scripts?'
5010 [yY]*) val="$define";;
5015 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
5016 echo "(That's for file descriptors, not floppy disks.)"
5022 $rm -f reflect flect
5024 : now see if they want to do setuid emulation
5027 case "$d_suidsafe" in
5030 echo "No need to emulate SUID scripts since they are secure here." >& 4
5034 Some systems have disabled setuid scripts, especially systems where
5035 setuid scripts cannot be secure. On systems where setuid scripts have
5036 been disabled, the setuid/setgid bits on scripts are currently
5037 useless. It is possible for $package to detect those bits and emulate
5038 setuid/setgid in a secure fashion. This emulation will only work if
5039 setuid scripts have been disabled in your kernel.
5043 "$define") dflt=y ;;
5046 rp="Do you want to do setuid/setgid emulation?"
5049 [yY]*) val="$define";;
5057 : determine filename position in cpp output
5059 echo "Computing filename position in cpp output for #include directives..." >&4
5060 echo '#include <stdio.h>' > foo.c
5063 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5064 $grep '^[ ]*#.*stdio\.h' | \
5065 while read cline; do
5068 while $test \$# -gt 0; do
5069 if $test -r \`echo \$1 | $tr -d '"'\`; then
5074 pos=\`expr \$pos + 1\`
5086 *) pos="${fieldn}th";;
5088 echo "Your cpp writes the filename in the $pos field of the line."
5090 : locate header file
5095 for usrincdir in $usrinc
5097 if test -f \$usrincdir/\$wanted; then
5098 echo "\$usrincdir/\$wanted"
5102 awkprg='{ print \$$fieldn }'
5103 echo "#include <\$wanted>" > foo\$\$.c
5104 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5105 $grep "^[ ]*#.*\$wanted" | \
5106 while read cline; do
5107 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5109 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5110 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5115 # status = 0: grep returned 0 lines, case statement not executed
5116 # status = 1: headerfile found
5117 # status = 2: while loop executed, no headerfile found
5121 if test \$status -eq 1; then
5128 : define an alternate in-header-list? function
5129 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5130 cont=true; xxf="echo \"<\$1> found.\" >&4";
5131 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5132 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5134 case $# in 4) instead=instead;; *) instead="at last";; esac;
5135 while $test "$cont"; do
5137 var=$2; eval "was=\$$2";
5138 if $test "$xxx" && $test -r "$xxx";
5140 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5143 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5144 set $yyy; shift; shift; yyy=$@;
5145 case $# in 0) cont="";;
5146 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5147 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5148 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5149 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5153 do set $yyy; var=$2; eval "was=\$$2";
5154 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5155 set $yyy; shift; shift; yyy=$@;
5158 : see if this is a malloc.h system
5159 set malloc.h i_malloc
5162 : see if stdlib is available
5163 set stdlib.h i_stdlib
5166 : determine which malloc to compile in
5168 case "$usemymalloc" in
5169 ''|[yY]*|true|$define) dflt='y' ;;
5172 rp="Do you wish to attempt to use the malloc that comes with $package?"
5178 mallocsrc='malloc.c'
5179 mallocobj="malloc$_o"
5180 d_mymalloc="$define"
5183 : Remove malloc from list of libraries to use
5184 echo "Removing unneeded -lmalloc from library list" >&4
5185 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
5188 echo "libs = $libs" >&4
5200 : compute the return types of malloc and free
5202 $cat >malloc.c <<END
5206 #include <sys/types.h>
5220 case "$malloctype" in
5222 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
5229 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
5233 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
5240 echo "Your system uses $freetype free(), it would seem." >&4
5244 The installation process will also create a directory for
5245 vendor-supplied add-ons. Vendors who supply perl with their system
5246 may find it convenient to place all vendor-supplied files in this
5247 directory rather than in the main distribution directory. This will
5248 ease upgrades between binary-compatible maintenance versions of perl.
5250 Of course you may also use these directories in whatever way you see
5251 fit. For example, you might use them to access modules shared over a
5252 company-wide network.
5254 The default answer should be fine for most people.
5255 This causes further questions about vendor add-ons to be skipped
5256 and no vendor-specific directories will be configured for perl.
5259 rp='Do you want to configure vendor-specific add-on directories?'
5260 case "$usevendorprefix" in
5261 define|true|[yY]*) dflt=y ;;
5262 *) : User may have set vendorprefix directly on Configure command line.
5263 case "$vendorprefix" in
5272 rp='Installation prefix to use for vendor-supplied add-ons?'
5273 case "$vendorprefix" in
5275 *) dflt=$vendorprefix ;;
5278 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
5280 case "$vendorprefix" in
5284 *) oldvendorprefix="$prefix";;
5288 usevendorprefix="$define"
5290 vendorprefixexp="$ansexp"
5292 *) usevendorprefix="$undef"
5298 case "$vendorprefix" in
5299 '') d_vendorlib="$undef"
5303 *) d_vendorlib="$define"
5304 : determine where vendor-supplied modules go.
5305 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
5306 case "$vendorlib" in
5308 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5309 case "$installstyle" in
5310 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
5311 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
5314 *) dflt="$vendorlib"
5318 rp='Pathname for the vendor-supplied library files?'
5321 vendorlibexp="$ansexp"
5324 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
5325 : Change installation prefix, if necessary.
5326 if $test X"$prefix" != X"$installprefix"; then
5327 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
5329 installvendorlib="$vendorlibexp"
5332 case "$vendorprefix" in
5333 '') d_vendorarch="$undef"
5337 *) d_vendorarch="$define"
5338 : determine where vendor-supplied architecture-dependent libraries go.
5339 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
5340 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
5341 : vendorlib may have an optional trailing /share.
5342 case "$vendorarch" in
5343 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
5344 dflt="$dflt/$archname"
5346 *) dflt="$vendorarch" ;;
5349 rp='Pathname for vendor-supplied architecture-dependent files?'
5352 vendorarchexp="$ansexp"
5355 : Change installation prefix, if necessary.
5356 if $test X"$prefix" != X"$installprefix"; then
5357 installvendorarch=`echo $vendorarchexp | sed "s#^$prefix#$installprefix#"`
5359 installvendorarch="$vendorarchexp"
5362 : Cruising for prototypes
5364 echo "Checking out function prototypes..." >&4
5365 $cat >prototype.c <<'EOCP'
5366 int main(int argc, char *argv[]) {
5369 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
5370 echo "Your C compiler appears to support function prototypes."
5373 echo "Your C compiler doesn't seem to understand function prototypes."
5380 case "$prototype" in
5382 *) ansi2knr='ansi2knr'
5387 This version of $package can only be compiled by a compiler that
5388 understands function prototypes. Unfortunately, your C compiler
5390 doesn't seem to understand them. Sorry about that.
5392 If GNU cc is available for your system, perhaps you could try that instead.
5394 Eventually, we hope to support building Perl with pre-ANSI compilers.
5395 If you would like to help in that effort, please contact <perlbug@perl.org>.
5397 Aborting Configure now.
5403 : determine where public executables go
5408 rp='Pathname where the public executables will reside?'
5410 if $test "X$ansexp" != "X$binexp"; then
5415 : Change installation prefix, if necessary.
5416 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
5417 if $test X"$prefix" != X"$installprefix"; then
5418 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
5420 installbin="$binexp"
5423 : Find perl5.005 or later.
5424 echo "Looking for a previously installed perl5.005 or later... "
5426 '') for tdir in `echo "$binexp:$PATH" | $sed "s/$path_sep/ /g"`; do
5427 : Check if this perl is recent and can load a simple module
5428 if $test -x $tdir/perl && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
5431 elif $test -x $tdir/perl5 && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
5441 '') echo "None found. That's ok.";;
5442 *) echo "Using $perl5." ;;
5447 After $package is installed, you may wish to install various
5448 add-on modules and utilities. Typically, these add-ons will
5449 be installed under $prefix with the rest
5450 of this package. However, you may wish to install such add-ons
5451 elsewhere under a different prefix.
5453 If you do not wish to put everything under a single prefix, that's
5454 ok. You will be prompted for the individual locations; this siteprefix
5455 is only used to suggest the defaults.
5457 The default should be fine for most people.
5461 rp='Installation prefix to use for add-on modules and utilities?'
5462 : XXX Here might be another good place for an installstyle setting.
5463 case "$siteprefix" in
5465 *) dflt=$siteprefix ;;
5468 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
5470 case "$siteprefix" in
5474 *) oldsiteprefix="$prefix";;
5479 siteprefixexp="$ansexp"
5481 : determine where site specific libraries go.
5482 : Usual default is /usr/local/lib/perl5/site_perl/$version
5483 : The default "style" setting is made in installstyle.U
5484 : XXX No longer works with Prefixit stuff.
5485 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5487 '') case "$installstyle" in
5488 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
5489 *) dflt=$siteprefix/lib/site_$prog/$version ;;
5497 The installation process will create a directory for
5498 site-specific extensions and modules. Most users find it convenient
5499 to place all site-specific files in this directory rather than in the
5500 main distribution directory.
5504 rp='Pathname for the site-specific library files?'
5507 sitelibexp="$ansexp"
5508 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
5509 : Change installation prefix, if necessary.
5510 if $test X"$prefix" != X"$installprefix"; then
5511 installsitelib=`echo $sitelibexp | $sed "s#^$prefix#$installprefix#"`
5513 installsitelib="$sitelibexp"
5516 : Determine list of previous versions to include in @INC
5517 $cat > getverlist <<EOPL
5520 \$api_versionstring = "$api_versionstring";
5521 \$version = "$version";
5522 \$sitelib = "$sitelib";
5523 \$archname = "$archname";
5525 $cat >> getverlist <<'EOPL'
5526 # Can't have leading @ because metaconfig interprets it as a command!
5527 ;@inc_version_list=();
5528 $stem=dirname($sitelib);
5529 # XXX Redo to do opendir/readdir?
5532 ;@candidates = glob("5.*");
5538 # XXX ToDo: These comparisons must be reworked when two-digit
5539 # subversions come along, so that 5.7.10 compares as greater than
5540 # 5.7.3! By that time, hope that 5.6.x is sufficiently
5541 # widespread that we can use the built-in version vectors rather
5542 # than reinventing them here. For 5.6.0, however, we must
5543 # assume this script will likely be run by 5.005_0x. --AD 1/2000.
5544 foreach $d (@candidates) {
5545 if ($d lt $version) {
5546 if ($d ge $api_versionstring) {
5547 unshift(@inc_version_list, "$d/$archname", $d);
5549 elsif ($d ge "5.005") {
5550 unshift(@inc_version_list, $d);
5554 # Skip newer version. I.e. don't look in
5555 # 5.7.0 if we're installing 5.6.1.
5559 if (@inc_version_list) {
5560 print join(' ', @inc_version_list);
5563 # Blank space to preserve value for next Configure run.
5568 case "$inc_version_list" in
5569 '') if test -x "$perl5"; then
5570 dflt=`$perl5 getverlist`
5575 $undef) dflt='none' ;;
5576 *) dflt="$inc_version_list" ;;
5579 ''|' ') dflt=none ;;
5583 In order to ease the process of upgrading, this version of perl
5584 can be configured to use modules built and installed with earlier
5585 versions of perl that were installed under $prefix. Specify here
5586 the list of earlier versions that this version of perl should check.
5587 If Configure detected no earlier versions of perl installed under
5588 $prefix, then the list will be empty. Answer 'none' to tell perl
5589 to not search earlier versions.
5591 The default should almost always be sensible, so if you're not sure,
5592 just accept the default.
5595 rp='List of earlier versions to include in @INC?'
5598 [Nn]one|''|' ') inc_version_list=' ' ;;
5599 *) inc_version_list="$ans" ;;
5601 case "$inc_version_list" in
5603 inc_version_list_init='0';;
5604 *) inc_version_list_init=`echo $inc_version_list |
5605 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
5610 : determine whether to install perl also as /usr/bin/perl
5613 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
5615 Many scripts expect perl to be installed as /usr/bin/perl.
5616 I can install the perl you are about to compile also as /usr/bin/perl
5617 (in addition to $installbin/perl).
5619 case "$installusrbinperl" in
5620 "$undef"|[nN]*) dflt='n';;
5623 rp="Do you want to install perl as /usr/bin/perl?"
5626 [yY]*) val="$define";;
5632 set installusrbinperl
5636 echo "Checking for GNU C Library..." >&4
5637 cat >gnulibc.c <<EOM
5649 if eval $compile_ok && ./gnulibc; then
5651 echo "You are using the GNU C Library"
5654 echo "You are not using the GNU C Library"
5660 : see if nm is to be used to determine whether a symbol is defined or not
5664 case "$d_gnulibc" in
5667 echo "nm probably won't work on the GNU C Library." >&4
5673 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
5675 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
5676 echo "'nm' won't be sufficient on this sytem." >&4
5682 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
5683 if $test $dflt -gt 20; then
5693 true|$define) dflt=y;;
5700 I can use $nm to extract the symbols from your C libraries. This
5701 is a time consuming task which may generate huge output on the disk (up
5702 to 3 megabytes) but that should make the symbols extraction faster. The
5703 alternative is to skip the 'nm' extraction part and to compile a small
5704 test program instead to determine whether each symbol is present. If
5705 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
5706 this may be the best solution.
5708 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
5711 rp="Shall I use $nm to extract C symbols from the libraries?"
5714 [Nn]*) usenm=false;;
5723 : nm options which may be necessary
5725 '') if $test -f /mach_boot; then
5727 elif $test -d /usr/ccs/lib; then
5728 nm_opt='-p' # Solaris (and SunOS?)
5729 elif $test -f /dgux; then
5731 elif $test -f /lib64/rld; then
5732 nm_opt='-p' # 64-bit Irix
5738 : nm options which may be necessary for shared libraries but illegal
5739 : for archive libraries. Thank you, Linux.
5740 case "$nm_so_opt" in
5741 '') case "$myuname" in
5743 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
5744 nm_so_opt='--dynamic'
5753 : get list of predefined functions in a handy place
5758 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
5765 *) for thislib in $libs; do
5768 : Handle C library specially below.
5771 thislib=`echo $thislib | $sed -e 's/^-l//'`
5772 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
5774 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
5776 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
5778 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
5780 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
5782 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
5784 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
5789 libnames="$libnames $try"
5791 *) libnames="$libnames $thislib" ;;
5800 for xxx in $libpth; do
5801 $test -r $1 || set $xxx/libc.$so
5802 : The messy sed command sorts on library version numbers.
5804 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
5805 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
5807 s/[0-9][0-9]*/0000&/g
5808 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
5811 sort | $sed -e 's/^.* //'`
5814 $test -r $1 || set /usr/ccs/lib/libc.$so
5815 $test -r $1 || set /lib/libsys_s$_a
5821 if $test -r "$1"; then
5822 echo "Your (shared) C library seems to be in $1."
5824 elif $test -r /lib/libc && $test -r /lib/clib; then
5825 echo "Your C library seems to be in both /lib/clib and /lib/libc."
5827 libc='/lib/clib /lib/libc'
5828 if $test -r /lib/syslib; then
5829 echo "(Your math library is in /lib/syslib.)"
5830 libc="$libc /lib/syslib"
5832 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5833 echo "Your C library seems to be in $libc, as you said before."
5834 elif $test -r $incpath/usr/lib/libc$_a; then
5835 libc=$incpath/usr/lib/libc$_a;
5836 echo "Your C library seems to be in $libc. That's fine."
5837 elif $test -r /lib/libc$_a; then
5839 echo "Your C library seems to be in $libc. You're normal."
5841 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
5843 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
5844 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
5845 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
5847 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5849 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5852 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
5854 if $test -r "$tans"; then
5855 echo "Your C library seems to be in $tans, of all places."
5861 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5865 If the guess above is wrong (which it might be if you're using a strange
5866 compiler, or your machine supports multiple models), you can override it here.
5871 echo $libpth | tr ' ' $trnl | sort | uniq > libpath
5873 I can't seem to find your C library. I've looked in the following places:
5876 $sed 's/^/ /' libpath
5879 None of these seems to contain your C library. I need to get its name...
5884 rp='Where is your C library?'
5889 echo $libc $libnames | tr ' ' $trnl | sort | uniq > libnames
5890 set X `cat libnames`
5893 case $# in 1) xxx=file; esac
5894 echo "Extracting names from the following $xxx for later perusal:" >&4
5896 $sed 's/^/ /' libnames >&4
5898 $echo $n "This may take a while...$c" >&4
5902 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
5903 *) $nm $nm_opt $file 2>/dev/null;;
5908 $grep fprintf libc.tmp > libc.ptf
5909 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
5910 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
5912 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
5914 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5916 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
5918 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5920 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
5922 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5924 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
5926 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5928 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
5930 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5932 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
5934 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5936 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
5937 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
5939 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5941 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
5943 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5945 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
5947 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5949 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
5951 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5953 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
5955 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5957 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
5959 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5961 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
5963 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5965 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
5967 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5970 $nm -p $* 2>/dev/null >libc.tmp
5971 $grep fprintf libc.tmp > libc.ptf
5972 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
5973 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
5979 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
5981 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
5982 for thisname in $libnames $libc; do
5983 $ar t $thisname >>libc.tmp
5985 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
5987 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
5988 # Repeat libc to extract forwarders to DLL entries too
5989 for thisname in $libnames $libc; do
5990 $ar tv $thisname >>libc.tmp
5991 # Revision 50 of EMX has bug in $ar.
5992 # it will not extract forwarders to DLL entries
5993 # Use emximp which will extract exactly them.
5994 emximp -o tmp.imp $thisname \
5996 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
5997 < tmp.imp >>libc.tmp
6000 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
6003 echo "$ar didn't seem to work right." >&4
6004 echo "Maybe this is a Cray...trying bld instead..." >&4
6005 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
6007 for thisname in $libnames; do
6009 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
6010 $ar t $thisname >>libc.tmp
6014 echo "That didn't work either. Giving up." >&4
6021 if $test -f /lib/syscalls.exp; then
6023 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
6024 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*$/\1/p' /lib/syscalls.exp >>libc.list
6028 $rm -f libnames libpath
6030 : see if dld is available
6034 : is a C symbol defined?
6037 -v) tf=libc.tmp; tc=""; tdc="";;
6038 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
6039 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
6042 case "$reuseval-$4" in
6044 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
6050 if $contains $tlook $tf >/dev/null 2>&1;
6055 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
6056 if $cc $optimize $ccflags $ldflags -o t t.c $libs >/dev/null 2>&1;
6064 $define) tval=true;;
6070 : define an is-in-libc? function
6071 inlibc='echo " "; td=$define; tu=$undef;
6072 sym=$1; var=$2; eval "was=\$$2";
6074 case "$reuseval$was" in
6084 echo "$sym() found." >&4;
6085 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
6087 echo "$sym() NOT found." >&4;
6088 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
6092 $define) echo "$sym() found." >&4;;
6093 *) echo "$sym() NOT found." >&4;;
6097 : see if dlopen exists
6104 : determine which dynamic loading, if any, to compile in
6106 dldir="ext/DynaLoader"
6119 $define) dflt='y' ;;
6122 $define) dflt='y' ;;
6124 : Does a dl_xxx.xs file exist for this operating system
6125 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
6128 rp="Do you wish to use dynamic loading?"
6135 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
6136 dflt="$dldir/dl_${osname}.xs"
6137 elif $test "$d_dlopen" = "$define" ; then
6138 dflt="$dldir/dl_dlopen.xs"
6139 elif $test "$i_dld" = "$define" ; then
6140 dflt="$dldir/dl_dld.xs"
6145 *) dflt="$dldir/$dlsrc"
6148 echo "The following dynamic loading files are available:"
6149 : Can not go over to $dldir because getfile has path hard-coded in.
6150 tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir
6151 rp="Source file to use for dynamic loading"
6157 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
6161 Some systems may require passing special flags to $cc -c to
6162 compile modules that will be used to create a shared library.
6163 To use no flags, say "none".
6166 case "$cccdlflags" in
6167 '') case "$gccversion" in
6168 '') case "$osname" in
6170 next) dflt='none' ;;
6171 irix*) dflt='-KPIC' ;;
6172 svr4*|esix*|solaris) dflt='-KPIC' ;;
6173 sunos) dflt='-pic' ;;
6177 *) case "$osname" in
6178 svr4*|esix*|solaris) dflt='-fPIC' ;;
6183 *) dflt="$cccdlflags" ;;
6185 rp="Any special flags to pass to $cc -c to compile shared library modules?"
6188 none) cccdlflags=' ' ;;
6189 *) cccdlflags="$ans" ;;
6194 Some systems use ld to create libraries that can be dynamically loaded,
6195 while other systems (such as those using ELF) use $cc.
6199 '') $cat >try.c <<'EOM'
6200 /* Test for whether ELF binaries are produced */
6205 int i = open("a.out",O_RDONLY);
6208 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
6209 exit(0); /* succeed (yes, it's ELF) */
6214 if $cc $ccflags try.c >/dev/null 2>&1 && ./a.out; then
6216 You appear to have ELF support. I'll use $cc to build dynamic libraries.
6220 echo "I'll use ld to build dynamic libraries."
6229 rp="What command should be used to create dynamic libraries?"
6235 Some systems may require passing special flags to $ld to create a
6236 library that can be dynamically loaded. If your ld flags include
6237 -L/other/path options to locate libraries outside your loader's normal
6238 search path, you may need to specify those -L options here as well. To
6239 use no flags, say "none".
6242 case "$lddlflags" in
6243 '') case "$osname" in
6244 beos) dflt='-nostart' ;;
6246 case "$gccversion" in
6247 '') dflt="$dflt +vnocompatwarnings" ;;
6250 linux|irix*) dflt='-shared' ;;
6251 next) dflt='none' ;;
6252 solaris) dflt='-G' ;;
6253 sunos) dflt='-assert nodefinitions' ;;
6254 svr4*|esix*) dflt="-G $ldflags" ;;
6258 *) dflt="$lddlflags" ;;
6261 : Try to guess additional flags to pick up local libraries.
6262 : Be careful not to append to a plain 'none'
6266 for thisflag in $ldflags; do
6271 *) dflt="$dflt $thisflag" ;;
6278 ''|' ') dflt='none' ;;
6281 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
6284 none) lddlflags=' ' ;;
6285 *) lddlflags="$ans" ;;
6290 Some systems may require passing special flags to $cc to indicate that
6291 the resulting executable will use dynamic linking. To use no flags,
6295 case "$ccdlflags" in
6296 '') case "$osname" in
6297 hpux) dflt='-Wl,-E' ;;
6298 linux) dflt='-rdynamic' ;;
6299 next) dflt='none' ;;
6300 sunos) dflt='none' ;;
6304 *) dflt="$ccdlflags" ;;
6306 rp="Any special flags to pass to $cc to use dynamic linking?"
6309 none) ccdlflags=' ' ;;
6310 *) ccdlflags="$ans" ;;
6324 # No dynamic loading being used, so don't bother even to prompt.
6327 *) case "$useshrplib" in
6328 '') case "$osname" in
6329 svr4*|dgux|dynixptx|esix|powerux|beos|cygwin*)
6331 also='Building a shared libperl is required for dynamic loading to work on your system.'
6336 also='Building a shared libperl is needed for MAB support.'
6354 The perl executable is normally obtained by linking perlmain.c with
6355 libperl${_a}, any static extensions (usually just DynaLoader), and
6356 any other libraries needed on this system (such as -lm, etc.). Since
6357 your system supports dynamic loading, it is probably possible to build
6358 a shared libperl.$so. If you will have more than one executable linked
6359 to libperl.$so, this will significantly reduce the size of each
6360 executable, but it may have a noticeable affect on performance. The
6361 default is probably sensible for your system.
6365 rp="Build a shared libperl.$so (y/n)"
6369 useshrplib='true' ;;
6370 *) useshrplib='false' ;;
6375 case "$useshrplib" in
6379 # Figure out a good name for libperl.so. Since it gets stored in
6380 # a version-specific architecture-dependent library, the version
6381 # number isn't really that important, except for making cc/ld happy.
6383 # A name such as libperl.so.3.1
6384 majmin="libperl.$so.$patchlevel.$subversion"
6385 # A name such as libperl.so.301
6386 majonly=`echo $patchlevel $subversion |
6387 $awk '{printf "%d%02d", $1, $2}'`
6388 majonly=libperl.$so.$majonly
6389 # I'd prefer to keep the os-specific stuff here to a minimum, and
6390 # rely on figuring it out from the naming of libc.
6391 case "${osname}${osvers}" in
6394 # XXX How handle the --version stuff for MAB?
6396 linux*) # ld won't link with a bare -lperl otherwise.
6399 cygwin*) # include version
6400 dflt=`echo libperl$version | sed -e 's/\./_/g'`$lib_ext
6402 *) # Try to guess based on whether libc has major.minor.
6404 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
6405 *libc.$so.[0-9]*) dflt=$majonly ;;
6406 *) dflt=libperl.$so ;;
6416 I need to select a good name for the shared libperl. If your system uses
6417 library names with major and minor numbers, then you might want something
6418 like $majmin. Alternatively, if your system uses a single version
6419 number for shared libraries, then you might want to use $majonly.
6420 Or, your system might be quite happy with a simple libperl.$so.
6422 Since the shared libperl will get installed into a version-specific
6423 architecture-dependent directory, the version number of the shared perl
6424 library probably isn't important, so the default should be o.k.
6427 rp='What name do you want to give to the shared libperl?'
6430 echo "Ok, I'll use $libperl"
6433 libperl="libperl${_a}"
6437 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
6441 WARNING: Use of the shrpdir variable for the installation location of
6442 the shared $libperl is not supported. It was never documented and
6443 will not work in this version. Let me (perlbug@perl.com)
6444 know of any problems this may cause.
6450 But your current setting of $shrpdir is
6451 the default anyway, so it's harmless.
6456 Further, your current attempted setting of $shrpdir
6457 conflicts with the value of $archlibexp/CORE
6458 that installperl will use.
6465 # How will the perl executable find the installed shared $libperl?
6466 # Add $xxx to ccdlflags.
6467 # If we can't figure out a command-line option, use $shrpenv to
6468 # set env LD_RUN_PATH. The main perl makefile uses this.
6469 shrpdir=$archlibexp/CORE
6472 if "$useshrplib"; then
6475 # We'll set it in Makefile.SH...
6481 xxx="-Wl,-R$shrpdir"
6483 linux|irix*|dec_osf)
6484 xxx="-Wl,-rpath,$shrpdir"
6487 # next doesn't like the default...
6490 # beos doesn't like the default, either.
6493 # hpux doesn't like the default, either.
6494 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
6497 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
6503 # Only add $xxx if it isn't already in ccdlflags.
6504 case " $ccdlflags " in
6506 *) ccdlflags="$ccdlflags $xxx"
6509 Adding $xxx to the flags
6510 passed to $ld so that the perl executable will find the
6511 installed shared $libperl.
6519 # Fix ccdlflags in AIX for building external extensions.
6520 # (For building Perl itself bare -bE:perl.exp is needed,
6521 # Makefile.SH takes care of this.)
6523 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
6525 # Respect a hint or command-line value.
6527 '') shrpenv="$tmp_shrpenv" ;;
6529 case "$ldlibpthname" in
6530 '') ldlibpthname=LD_LIBRARY_PATH ;;
6531 none) ldlibpthname='' ;;
6534 : determine where manual pages go
6535 set man1dir man1dir none
6539 $spackage has manual pages available in source form.
6543 echo "However, you don't have nroff, so they're probably useless to you."
6545 '') man1dir="none";;
6548 echo "If you don't want the manual sources installed, answer 'none'."
6553 lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
6554 lookpath="$lookpath $prefixexp/man/p_man/man1"
6555 lookpath="$lookpath $prefixexp/man/u_man/man1"
6556 lookpath="$lookpath $prefixexp/man/man.1"
6558 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
6559 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
6569 rp="Where do the main $spackage manual pages (source) go?"
6571 if $test "X$man1direxp" != "X$ansexp"; then
6575 man1direxp="$ansexp"
6581 : Change installation prefix, if necessary.
6582 if $test X"$prefix" != X"$installprefix"; then
6583 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
6585 installman1dir="$man1direxp"
6588 : What suffix to use on installed man pages
6595 rp="What suffix should be used for the main $spackage man pages?"
6597 '') case "$man1dir" in
6611 *) dflt="$man1ext";;
6618 : see if we can have long filenames
6620 first=123456789abcdef
6622 if (echo hi >$first) 2>/dev/null; then
6623 if $test -f 123456789abcde; then
6624 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
6627 echo 'You can have filenames longer than 14 characters.'>&4
6632 You can't have filenames longer than 14 chars.
6633 You can't even think about them!
6639 $rm -rf 123456789abcde*
6641 : determine where library module manual pages go
6642 set man3dir man3dir none
6646 $spackage has manual pages for many of the library modules.
6652 However, you don't have nroff, so they're probably useless to you.
6655 '') man3dir="none";;
6659 case "$d_flexfnam" in
6662 However, your system can't handle the long file names like File::Basename.3.
6665 '') man3dir="none";;
6669 echo "If you don't want the manual sources installed, answer 'none'."
6670 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6672 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
6673 if $test -d "$privlib/man/man3"; then
6676 WARNING: Previous versions of perl installed man3 pages into
6677 $privlib/man/man3. This version will suggest a
6678 new default of $dflt.
6682 rp='Do you wish to preserve the old behavior?(y/n)'
6685 y*) dflt="$privlib/man/man3" ;;
6690 *) dflt="$man3dir" ;;
6697 rp="Where do the $package library man pages (source) go?"
6700 man3direxp="$ansexp"
6706 : Change installation prefix, if necessary.
6707 if $test X"$prefix" != X"$installprefix"; then
6708 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
6710 installman3dir="$man3direxp"
6713 : What suffix to use on installed man pages
6719 rp="What suffix should be used for the $package library man pages?"
6721 '') case "$man3dir" in
6735 *) dflt="$man3ext";;
6742 : see if we have to deal with yellow pages, now NIS.
6743 if $test -d /usr/etc/yp || $test -d /etc/yp; then
6744 if $test -f /usr/etc/nibindd; then
6746 echo "I'm fairly confident you're on a NeXT."
6748 rp='Do you get the hosts file via NetInfo?'
6757 y*) hostcat='nidump hosts .';;
6758 *) case "$hostcat" in
6759 nidump*) hostcat='';;
6769 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
6777 rp='Are you getting the hosts file via yellow pages?'
6780 y*) hostcat='ypcat hosts';;
6781 *) hostcat='cat /etc/hosts';;
6787 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
6790 '') test -f /etc/group && groupcat='cat /etc/group';;
6793 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
6796 : now get the host name
6798 echo "Figuring out host name..." >&4
6799 case "$myhostname" in
6801 echo 'Maybe "hostname" will work...'
6802 if tans=`sh -c hostname 2>&1` ; then
6810 if $test "$cont"; then
6812 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
6813 if tans=`cat /etc/systemid 2>&1` ; then
6815 phostname='cat /etc/systemid'
6816 echo "Whadyaknow. Xenix always was a bit strange..."
6819 elif $test -r /etc/systemid; then
6820 echo "(What is a non-Xenix system doing with /etc/systemid?)"
6823 if $test "$cont"; then
6824 echo 'No, maybe "uuname -l" will work...'
6825 if tans=`sh -c 'uuname -l' 2>&1` ; then
6827 phostname='uuname -l'
6829 echo 'Strange. Maybe "uname -n" will work...'
6830 if tans=`sh -c 'uname -n' 2>&1` ; then
6832 phostname='uname -n'
6834 echo 'Oh well, maybe I can mine it out of whoami.h...'
6835 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
6836 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
6837 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
6839 case "$myhostname" in
6840 '') echo "Does this machine have an identity crisis or something?"
6843 echo "Well, you said $myhostname before..."
6844 phostname='echo $myhostname';;
6850 : you do not want to know about this
6855 if $test "$myhostname" ; then
6857 rp='Your host name appears to be "'$myhostname'".'" Right?"
6865 : bad guess or no guess
6866 while $test "X$myhostname" = X ; do
6868 rp="Please type the (one word) name of your host:"
6873 : translate upper to lower if necessary
6874 case "$myhostname" in
6876 echo "(Normalizing case in your host name)"
6877 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
6881 case "$myhostname" in
6883 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
6884 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
6885 echo "(Trimming domain name from host name--host name is now $myhostname)"
6887 *) case "$mydomain" in
6890 test "X$hostcat" = "Xypcat hosts" &&
6891 ypmatch "$myhostname" hosts 2>/dev/null |\
6892 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
6895 test "X$hostcat" != "X" &&
6896 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
6897 /[ ]$myhostname[ . ]/p" > hosts
6900 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
6901 END { print sum }" hosts` = x1 || tmp_re="[ ]"
6902 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
6903 hosts | $sort | $uniq | \
6904 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
6905 case `$echo X$dflt` in
6906 X*\ *) echo "(Several hosts in /etc/hosts matched hostname)"
6909 X.) echo "(You do not have fully-qualified names in /etc/hosts)"
6914 tans=`./loc resolv.conf X /etc /usr/etc`
6915 if $test -f "$tans"; then
6916 echo "(Attempting domain name extraction from $tans)"
6917 dflt=.`$sed -n -e 's/ / /g' \
6918 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
6919 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
6921 .) dflt=.`$sed -n -e 's/ / /g' \
6922 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
6923 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
6930 .) echo "(No help from resolv.conf either -- attempting clever guess)"
6931 dflt=.`sh -c domainname 2>/dev/null`
6934 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
6939 .) echo "(Lost all hope -- silly guess then)"
6945 *) dflt="$mydomain";;
6949 rp="What is your domain name?"
6959 : translate upper to lower if necessary
6962 echo "(Normalizing case in your domain name)"
6963 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
6967 : a little sanity check here
6968 case "$phostname" in
6971 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
6972 $myhostname$mydomain|$myhostname) ;;
6974 case "$phostname" in
6976 echo "(That doesn't agree with your whoami.h file, by the way.)"
6979 echo "(That doesn't agree with your $phostname command, by the way.)"
6989 I need to get your e-mail address in Internet format if possible, i.e.
6990 something like user@host.domain. Please answer accurately since I have
6991 no easy means to double check it. The default value provided below
6992 is most probably close to reality but may not be valid from outside
6993 your organization...
6997 while test "$cont"; do
6999 '') dflt="$cf_by@$myhostname$mydomain";;
7000 *) dflt="$cf_email";;
7002 rp='What is your e-mail address?'
7008 rp='Address does not look like an Internet one. Use it anyway?'
7024 If you or somebody else will be maintaining perl at your site, please
7025 fill in the correct e-mail address here so that they may be contacted
7026 if necessary. Currently, the "perlbug" program included with perl
7027 will send mail to this address in addition to perlbug@perl.com. You may
7028 enter "none" for no administrator.
7031 case "$perladmin" in
7032 '') dflt="$cf_email";;
7033 *) dflt="$perladmin";;
7035 rp='Perl administrator e-mail address'
7039 : figure out how to guarantee perl startup
7040 case "$startperl" in
7042 case "$sharpbang" in
7046 I can use the #! construct to start perl on your system. This will
7047 make startup of perl scripts faster, but may cause problems if you
7048 want to share those scripts and perl is not in a standard place
7049 ($binexp/perl) on all your platforms. The alternative is to force
7050 a shell by starting the script with a single ':' character.
7054 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
7057 none) startperl=": # use perl";;
7058 *) startperl="#!$ans"
7059 if $test 30 -lt `echo "$ans" | wc -c`; then
7062 WARNING: Some systems limit the #! command to 32 characters.
7063 If you experience difficulty running Perl scripts with #!, try
7064 installing Perl in a directory with a shorter pathname.
7070 *) startperl=": # use perl"
7075 echo "I'll use $startperl to start perl scripts."
7077 : figure best path for perl in scripts
7080 perlpath="$binexp/perl"
7081 case "$startperl" in
7086 I will use the "eval 'exec'" idiom to start Perl on your system.
7087 I can use the full path of your Perl binary for this purpose, but
7088 doing so may cause problems if you want to share those scripts and
7089 Perl is not always in a standard place ($binexp/perl).
7093 rp="What path shall I use in \"eval 'exec'\"?"
7100 case "$startperl" in
7102 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
7105 : determine where public executable scripts go
7106 set scriptdir scriptdir
7108 case "$scriptdir" in
7111 : guess some guesses
7112 $test -d /usr/share/scripts && dflt=/usr/share/scripts
7113 $test -d /usr/share/bin && dflt=/usr/share/bin
7114 $test -d /usr/local/script && dflt=/usr/local/script
7115 $test -d /usr/local/scripts && dflt=/usr/local/scripts
7116 $test -d $prefixexp/script && dflt=$prefixexp/script
7120 *) dflt="$scriptdir"
7125 Some installations have a separate directory just for executable scripts so
7126 that they can mount it across multiple architectures but keep the scripts in
7127 one spot. You might, for example, have a subdirectory of /usr/share for this.
7128 Or you might just lump your scripts in with all your other executables.
7132 rp='Where do you keep publicly executable scripts?'
7134 if $test "X$ansexp" != "X$scriptdirexp"; then
7138 scriptdirexp="$ansexp"
7139 : Change installation prefix, if necessary.
7140 if $test X"$prefix" != X"$installprefix"; then
7141 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
7143 installscript="$scriptdirexp"
7146 : determine where site specific architecture-dependent libraries go.
7147 : sitelib default is /usr/local/lib/perl5/site_perl/$version
7148 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
7149 : sitelib may have an optional trailing /share.
7151 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
7152 dflt="$dflt/$archname"
7157 set sitearch sitearch none
7161 The installation process will also create a directory for
7162 architecture-dependent site-specific extensions and modules.
7166 rp='Pathname for the site-specific architecture-dependent library files?'
7169 sitearchexp="$ansexp"
7170 : Change installation prefix, if necessary.
7171 if $test X"$prefix" != X"$installprefix"; then
7172 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
7174 installsitearch="$sitearchexp"
7177 : determine where add-on public executables go
7179 '') dflt=$siteprefix/bin ;;
7183 rp='Pathname where the add-on public executables should be installed?'
7186 sitebinexp="$ansexp"
7187 : Change installation prefix, if necessary.
7188 if $test X"$prefix" != X"$installprefix"; then
7189 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
7191 installsitebin="$sitebinexp"
7194 : see if sqrtl exists
7199 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
7202 case "$uselongdouble" in
7203 $define|true|[yY]*) dflt='y';;
7208 Perl can be built to take advantage of long doubles which
7209 (if available) may give more accuracy and range for floating point numbers.
7211 If this doesn't make any sense to you, just accept the default '$dflt'.
7213 rp='Try to use long doubles if available?'
7216 y|Y) val="$define" ;;
7222 case "$uselongdouble" in
7223 true|[yY]*) uselongdouble="$define" ;;
7226 case "$uselongdouble" in
7228 : Look for a hint-file generated 'call-back-unit'. If the
7229 : user has specified that long doubles should be used,
7230 : we may need to set or change some other defaults.
7231 if $test -f uselongdouble.cbu; then
7232 echo "Your platform has some specific hints for long doubles, using them..."
7233 . ./uselongdouble.cbu
7236 (Your platform doesn't have any specific hints for long doubles.)
7242 case "$uselongdouble:$d_sqrtl" in
7246 *** You requested the use of long doubles but you do not seem to have
7247 *** the mathematic functions for long doubles. I'm disabling the use
7248 *** of long doubles.
7251 uselongdouble=$undef
7255 case "$useperlio" in
7256 $define|true|[yY]*) dflt='y';;
7261 Previous version of $package used the standard IO mechanisms as defined
7262 in <stdio.h>. Versions 5.003_02 and later of perl allow alternate IO
7263 mechanisms via a "PerlIO" abstraction, but the stdio mechanism is still
7264 the default. This abstraction layer can use AT&T's sfio (if you already
7265 have sfio installed) or regular stdio. Using PerlIO with sfio may cause
7266 problems with some extension modules. Using PerlIO with stdio is safe,
7267 but it is slower than plain stdio and therefore is not the default.
7269 If this doesn't make any sense to you, just accept the default '$dflt'.
7271 rp='Use the experimental PerlIO abstraction layer?'
7278 echo "Ok, doing things the stdio way"
7285 case "$vendorprefix" in
7286 '') d_vendorbin="$undef"
7290 *) d_vendorbin="$define"
7291 : determine where vendor-supplied executables go.
7292 case "$vendorbin" in
7293 '') dflt=$vendorprefix/bin ;;
7294 *) dflt="$vendorbin" ;;
7297 rp='Pathname for the vendor-supplied executables directory?'
7300 vendorbinexp="$ansexp"
7303 : Change installation prefix, if necessary.
7304 if $test X"$prefix" != X"$installprefix"; then
7305 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
7307 installvendorbin="$vendorbinexp"
7310 : see if qgcvt exists
7314 : check for length of double
7316 case "$doublesize" in
7318 echo "Checking to see how big your double precision numbers are..." >&4
7319 $cat >try.c <<'EOCP'
7323 printf("%d\n", (int)sizeof(double));
7328 if eval $compile_ok; then
7330 echo "Your double is $doublesize bytes long."
7333 echo "(I can't seem to compile the test program. Guessing...)"
7334 rp="What is the size of a double precision number (in bytes)?"
7342 : check for long doubles
7344 echo "Checking to see if you have long double..." >&4
7345 echo 'int main() { long double x = 7.0; }' > try.c
7347 if eval $compile; then
7349 echo "You have long double."
7352 echo "You do not have long double."
7358 : check for length of long double
7359 case "${d_longdbl}${longdblsize}" in
7362 echo "Checking to see how big your long doubles are..." >&4
7363 $cat >try.c <<'EOCP'
7367 printf("%d\n", sizeof(long double));
7372 if eval $compile; then
7373 longdblsize=`./try$exe_ext`
7374 echo "Your long doubles are $longdblsize bytes long."
7378 echo "(I can't seem to compile the test program. Guessing...)" >&4
7379 rp="What is the size of a long double (in bytes)?"
7383 if $test "X$doublesize" = "X$longdblsize"; then
7384 echo "(That isn't any different from an ordinary double.)"
7392 if $test X"$d_longdbl" = X"$define"; then
7394 echo "Checking how to print long doubles..." >&4
7396 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
7397 $cat >try.c <<'EOCP'
7398 #include <sys/types.h>
7402 printf("%.3f\n", d);
7406 if eval $compile; then
7410 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
7411 sPRIFldbl='"F"'; sPRIGldbl='"G"'; sPRIEldbl='"E"';
7412 echo "We will use %f."
7418 if $test X"$sPRIfldbl" = X; then
7419 $cat >try.c <<'EOCP'
7420 #include <sys/types.h>
7423 long double d = 123.456;
7424 printf("%.3llf\n", d);
7428 if eval $compile; then
7432 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
7433 sPRIFldbl='"llF"'; sPRIGldbl='"llG"'; sPRIEldbl='"llE"';
7434 echo "We will use %llf."
7440 if $test X"$sPRIfldbl" = X; then
7441 $cat >try.c <<'EOCP'
7442 #include <sys/types.h>
7445 long double d = 123.456;
7446 printf("%.3Lf\n", d);
7450 if eval $compile; then
7454 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
7455 sPRIFldbl='"LF"'; sPRIGldbl='"LG"'; sPRIEldbl='"LE"';
7456 echo "We will use %Lf."
7462 if $test X"$sPRIfldbl" = X; then
7463 $cat >try.c <<'EOCP'
7464 #include <sys/types.h>
7467 long double d = 123.456;
7468 printf("%.3lf\n", d);
7472 if eval $compile; then
7476 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
7477 sPRIFldbl='"lF"'; sPRIGldbl='"lG"'; sPRIEldbl='"lE"';
7478 echo "We will use %lf."
7484 if $test X"$sPRIfldbl" = X; then
7485 echo "Cannot figure out how to print long doubles." >&4
7492 case "$sPRIfldbl" in
7493 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
7494 d_PRIFldbl="$undef"; d_PRIGldbl="$undef"; d_PRIEldbl="$undef";
7496 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
7497 d_PRIFldbl="$define"; d_PRIGldbl="$define"; d_PRIEldbl="$define";
7501 : Check how to convert floats to strings.
7502 if test "X$d_Gconvert" = X; then
7504 echo "Checking for an efficient way to convert floats to strings."
7506 case "$uselongdouble" in
7507 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
7509 case "$d_longdbl" in
7510 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
7512 case "$d_PRIgldbl" in
7513 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
7517 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
7518 char *myname = "gconvert";
7521 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
7522 char *myname = "gcvt";
7525 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
7526 char *myname = "qgcvt";
7527 #define DOUBLETYPE long double
7530 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE) && defined(HAS_PRIgldbl)
7531 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
7533 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
7535 char *myname = "sprintf";
7539 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
7540 #define DOUBLETYPE long double
7542 #define DOUBLETYPE double
7548 #define I_STDLIB $i_stdlib
7554 checkit(expect, got)
7558 if (strcmp(expect, got)) {
7559 printf("%s oddity: Expected %s, got %s\n",
7560 myname, expect, got);
7570 /* This must be 1st test on (which?) platform */
7571 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
7572 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
7573 checkit("0.1", buf);
7575 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
7578 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
7579 checkit("1.1", buf);
7581 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
7582 checkit("1.01", buf);
7584 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
7585 checkit("1.001", buf);
7587 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
7588 checkit("1.0001", buf);
7590 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
7591 checkit("1.00001", buf);
7593 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
7594 checkit("1.000001", buf);
7596 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
7599 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
7602 /* Some Linux gcvt's give 1.e+5 here. */
7603 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
7604 checkit("100000", buf);
7606 /* Some Linux gcvt's give -1.e+5 here. */
7607 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
7608 checkit("-100000", buf);
7613 case "$d_Gconvert" in
7614 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
7615 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
7616 sprintf*) xxx_list='sprintf gconvert gcvt' ;;
7617 *) xxx_list='gconvert gcvt sprintf' ;;
7620 case "$d_longdbl$uselongdouble$d_qgcvt" in
7621 "$define$define$define") xxx_list="`echo $xxx_list|sed 's/gcvt/qgcvt gcvt/'`" ;;
7624 for xxx_convert in $xxx_list; do
7625 echo "Trying $xxx_convert..."
7627 set try -DTRY_$xxx_convert
7628 if eval $compile; then
7629 echo "$xxx_convert() found." >&4
7631 echo "I'll use $xxx_convert to convert floats into a string." >&4
7634 echo "...But $xxx_convert didn't work as I expected."
7637 echo "$xxx_convert NOT found." >&4
7641 case "$xxx_convert" in
7642 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
7643 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
7644 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
7645 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
7646 "$define$define$define")
7647 d_Gconvert="sprintf((b),\"%.*$sPRIgldbl\",(n),(x))" ;;
7648 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
7654 : Initialize h_fcntl
7657 : Initialize h_sysfile
7660 : access call always available on UNIX
7664 : locate the flags for 'access()'
7668 $cat >access.c <<'EOCP'
7669 #include <sys/types.h>
7674 #include <sys/file.h>
7683 : check sys/file.h first, no particular reason here
7684 if $test `./findhdr sys/file.h` && \
7685 $cc $cppflags -DI_SYS_FILE -o access access.c >/dev/null 2>&1 ; then
7687 echo "<sys/file.h> defines the *_OK access constants." >&4
7688 elif $test `./findhdr fcntl.h` && \
7689 $cc $cppflags -DI_FCNTL -o access access.c >/dev/null 2>&1 ; then
7691 echo "<fcntl.h> defines the *_OK access constants." >&4
7692 elif $test `./findhdr unistd.h` && \
7693 $cc $cppflags -DI_UNISTD -o access access.c >/dev/null 2>&1 ; then
7694 echo "<unistd.h> defines the *_OK access constants." >&4
7696 echo "I can't find the four *_OK access constants--I'll use mine." >&4
7702 : see if accessx exists
7703 set accessx d_accessx
7706 : see if alarm exists
7710 : see if atolf exists
7714 : see if atoll exists
7718 : Look for GNU-cc style attribute checking
7720 echo "Checking whether your compiler can handle __attribute__ ..." >&4
7721 $cat >attrib.c <<'EOCP'
7723 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
7725 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
7726 if $contains 'warning' attrib.out >/dev/null 2>&1; then
7727 echo "Your C compiler doesn't fully support __attribute__."
7730 echo "Your C compiler supports __attribute__."
7734 echo "Your C compiler doesn't seem to understand __attribute__ at all."
7741 : see if bcmp exists
7745 : see if bcopy exists
7749 : see if this is a unistd.h system
7750 set unistd.h i_unistd
7753 : see if getpgrp exists
7754 set getpgrp d_getpgrp
7757 case "$d_getpgrp" in
7760 echo "Checking to see which flavor of getpgrp is in use..."
7763 #include <sys/types.h>
7765 # include <unistd.h>
7769 if (getuid() == 0) {
7770 printf("(I see you are running Configure as super-user...)\n");
7774 if (getpgrp(1) == 0)
7783 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7784 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
7786 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7787 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
7790 echo "I can't seem to compile and run the test program."
7792 xxx="a USG one, i.e. you use getpgrp()."
7794 # SVR4 systems can appear rather BSD-ish.
7797 xxx="a BSD one, i.e. you use getpgrp(pid)."
7801 xxx="probably a USG one, i.e. you use getpgrp()."
7806 echo "Assuming your getpgrp is $xxx" >&4
7815 : see if setpgrp exists
7816 set setpgrp d_setpgrp
7819 case "$d_setpgrp" in
7822 echo "Checking to see which flavor of setpgrp is in use..."
7825 #include <sys/types.h>
7827 # include <unistd.h>
7831 if (getuid() == 0) {
7832 printf("(I see you are running Configure as super-user...)\n");
7836 if (-1 == setpgrp(1, 1))
7839 if (setpgrp() != -1)
7845 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7846 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
7848 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7849 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
7852 echo "(I can't seem to compile and run the test program.)"
7854 xxx="a USG one, i.e. you use setpgrp()."
7856 # SVR4 systems can appear rather BSD-ish.
7859 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
7863 xxx="probably a USG one, i.e. you use setpgrp()."
7868 echo "Assuming your setpgrp is $xxx" >&4
7876 : see if bzero exists
7880 : see if signal is declared as pointer to function returning int or void
7882 xxx=`./findhdr signal.h`
7883 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
7884 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7885 echo "You have int (*signal())() instead of void." >&4
7887 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7888 echo "You have void (*signal())()." >&4
7890 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
7891 echo "You have int (*signal())() instead of void." >&4
7893 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
7894 echo "You have void (*signal())()." >&4
7897 case "$d_voidsig" in
7899 echo "I can't determine whether signal handler returns void or int..." >&4
7901 rp="What type does your signal handler return?"
7908 echo "As you already told me, signal handler returns void." >&4
7911 *) echo "As you already told me, signal handler returns int." >&4
7918 case "$d_voidsig" in
7919 "$define") signal_t="void";;
7924 : check for ability to cast large floats to 32-bit ints.
7926 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
7927 if $test "$intsize" -ge 4; then
7934 #include <sys/types.h>
7936 $signal_t blech(s) int s; { exit(3); }
7943 signal(SIGFPE, blech);
7945 /* Don't let compiler optimize the test away. Store the number
7946 in a writable string for gcc to pass to sscanf under HP/UX.
7948 sprintf(str, "2147483647");
7949 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
7953 /* x86 processors will probably give 0x8000 0000, which is a
7954 sign change. We don't want that. We want to mimic SPARC
7955 behavior here, which is to preserve the sign and give
7958 if (i32 != ($xxx) f)
7964 if eval $compile_ok; then
7968 echo "(I can't seem to compile the test program--assuming it can't)"
7976 echo "Nope, it can't."
7983 : check for ability to cast negative floats to unsigned
7985 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
7988 #include <sys/types.h>
7990 $signal_t blech(s) int s; { exit(7); }
7991 $signal_t blech_in_list(s) int s; { exit(4); }
7992 unsigned long dummy_long(p) unsigned long p; { return p; }
7993 unsigned int dummy_int(p) unsigned int p; { return p; }
7994 unsigned short dummy_short(p) unsigned short p; { return p; }
7998 unsigned long along;
8000 unsigned short ashort;
8004 /* Frustrate gcc-2.7.2's optimizer which failed this test with
8005 a direct f = -123. assignment. gcc-2.8.0 reportedly
8006 optimized the whole file away
8008 /* Store the number in a writable string for gcc to pass to
8011 sprintf(str, "-123");
8012 sscanf(str, "%lf", &f); /* f = -123.; */
8014 signal(SIGFPE, blech);
8015 along = (unsigned long)f;
8016 aint = (unsigned int)f;
8017 ashort = (unsigned short)f;
8018 if (along != (unsigned long)-123)
8020 if (aint != (unsigned int)-123)
8022 if (ashort != (unsigned short)-123)
8024 sprintf(str, "1073741824.");
8025 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
8028 along = (unsigned long)f;
8029 if (along != 0x80000000)
8033 along = (unsigned long)f;
8034 if (along != 0x7fffffff)
8038 along = (unsigned long)f;
8039 if (along != 0x80000001)
8043 signal(SIGFPE, blech_in_list);
8044 sprintf(str, "123.");
8045 sscanf(str, "%lf", &f); /* f = 123.; */
8046 along = dummy_long((unsigned long)f);
8047 aint = dummy_int((unsigned int)f);
8048 ashort = dummy_short((unsigned short)f);
8049 if (along != (unsigned long)123)
8051 if (aint != (unsigned int)123)
8053 if (ashort != (unsigned short)123)
8060 if eval $compile_ok; then
8064 echo "(I can't seem to compile the test program--assuming it can't)"
8067 case "$castflags" in
8072 echo "Nope, it can't."
8079 : see if vprintf exists
8081 if set vprintf val -f d_vprintf; eval $csym; $val; then
8082 echo 'vprintf() found.' >&4
8084 $cat >vprintf.c <<'EOF'
8085 #include <varargs.h>
8087 int main() { xxx("foo"); }
8096 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
8100 if eval $compile && ./vprintf; then
8101 echo "Your vsprintf() returns (int)." >&4
8104 echo "Your vsprintf() returns (char*)." >&4
8108 echo 'vprintf() NOT found.' >&4
8118 : see if chown exists
8122 : see if chroot exists
8126 : see if chsize exists
8130 : check for const keyword
8132 echo 'Checking to see if your C compiler knows about "const"...' >&4
8133 $cat >const.c <<'EOCP'
8134 typedef struct spug { int drokk; } spug;
8141 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
8143 echo "Yup, it does."
8146 echo "Nope, it doesn't."
8151 : see if crypt exists
8153 if set crypt val -f d_crypt; eval $csym; $val; then
8154 echo 'crypt() found.' >&4
8158 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
8159 if $test -z "$cryptlib"; then
8160 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
8164 if $test -z "$cryptlib"; then
8165 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
8169 if $test -z "$cryptlib"; then
8170 cryptlib=`./loc libcrypt$_a "" $libpth`
8174 if $test -z "$cryptlib"; then
8175 echo 'crypt() NOT found.' >&4
8184 : get csh whereabouts
8186 'csh') val="$undef" ;;
8191 : Respect a hint or command line value for full_csh.
8193 '') full_csh=$csh ;;
8196 : see if cuserid exists
8197 set cuserid d_cuserid
8200 : see if this is a limits.h system
8201 set limits.h i_limits
8204 : see if this is a float.h system
8208 : See if number of significant digits in a double precision number is known
8210 $cat >dbl_dig.c <<EOM
8220 printf("Contains DBL_DIG");
8223 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
8224 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
8225 echo "DBL_DIG found." >&4
8228 echo "DBL_DIG NOT found." >&4
8235 : see if difftime exists
8236 set difftime d_difftime
8239 : see if this is a dirent system
8241 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
8243 echo "<dirent.h> found." >&4
8246 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
8247 echo "<sys/dir.h> found." >&4
8250 xinc=`./findhdr sys/ndir.h`
8252 echo "<dirent.h> NOT found." >&4
8257 : Look for type of directory structure.
8259 $cppstdin $cppflags $cppminus < "$xinc" > try.c
8261 case "$direntrytype" in
8264 $define) guess1='struct dirent' ;;
8265 *) guess1='struct direct' ;;
8268 *) guess1="$direntrytype"
8273 'struct dirent') guess2='struct direct' ;;
8274 *) guess2='struct dirent' ;;
8277 if $contains "$guess1" try.c >/dev/null 2>&1; then
8278 direntrytype="$guess1"
8279 echo "Your directory entries are $direntrytype." >&4
8280 elif $contains "$guess2" try.c >/dev/null 2>&1; then
8281 direntrytype="$guess2"
8282 echo "Your directory entries seem to be $direntrytype." >&4
8284 echo "I don't recognize your system's directory entries." >&4
8285 rp="What type is used for directory entries on this system?"
8293 : see if the directory entry stores field length
8295 $cppstdin $cppflags $cppminus < "$xinc" > try.c
8296 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
8297 echo "Good, your directory entry keeps length information in d_namlen." >&4
8300 echo "Your directory entry does not know about the d_namlen field." >&4
8307 : see if dlerror exists
8310 set dlerror d_dlerror
8314 : see if dlfcn is available
8322 On a few systems, the dynamically loaded modules that perl generates and uses
8323 will need a different extension than shared libs. The default will probably
8331 rp='What is the extension of dynamically loaded modules'
8340 : Check if dlsym need a leading underscore
8346 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
8347 $cat >dyna.c <<'EOM'
8356 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
8358 #include <sys/types.h>
8372 int mode = RTLD_LAZY ;
8374 handle = dlopen("./dyna.$dlext", mode) ;
8375 if (handle == NULL) {
8380 symbol = dlsym(handle, "fred") ;
8381 if (symbol == NULL) {
8382 /* try putting a leading underscore */
8383 symbol = dlsym(handle, "_fred") ;
8384 if (symbol == NULL) {
8397 : Call the object file tmp-dyna.o in case dlext=o.
8398 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
8399 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
8400 $ld $lddlflags -o dyna.$dlext tmp-dyna${_o} > /dev/null 2>&1 &&
8401 $cc $ccflags -o fred $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then
8404 1) echo "Test program failed using dlopen." >&4
8405 echo "Perhaps you should not use dynamic loading." >&4;;
8406 2) echo "Test program failed using dlsym." >&4
8407 echo "Perhaps you should not use dynamic loading." >&4;;
8408 3) echo "dlsym needs a leading underscore" >&4
8410 4) echo "dlsym doesn't need a leading underscore." >&4;;
8413 echo "I can't compile and run the test program." >&4
8414 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
8419 $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
8424 hasproto='varname=$1; func=$2; shift; shift;
8425 while $test $# -ge 2; do
8427 $define) echo "#include <$2>";;
8431 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
8432 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
8433 echo "$func() prototype found.";
8436 echo "$func() prototype NOT found.";
8441 $rm -f try.c tryout.c'
8443 : see if prototype for drand48 is available
8445 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
8448 : see if dup2 exists
8452 : see if eaccess exists
8453 set eaccess d_eaccess
8456 : see if endgrent exists
8457 set endgrent d_endgrent
8460 : see if endhostent exists
8461 set endhostent d_endhent
8464 : see if endnetent exists
8465 set endnetent d_endnent
8468 : see if endprotoent exists
8469 set endprotoent d_endpent
8472 : see if endpwent exists
8473 set endpwent d_endpwent
8476 : see if endservent exists
8477 set endservent d_endsent
8480 : see if endspent exists
8481 set endspent d_endspent
8484 : Locate the flags for 'open()'
8486 $cat >open3.c <<'EOCP'
8487 #include <sys/types.h>
8492 #include <sys/file.h>
8503 : check sys/file.h first to get FREAD on Sun
8504 if $test `./findhdr sys/file.h` && \
8505 set open3 -DI_SYS_FILE && eval $compile; then
8507 echo "<sys/file.h> defines the O_* constants..." >&4
8509 echo "and you have the 3 argument form of open()." >&4
8512 echo "but not the 3 argument form of open(). Oh, well." >&4
8515 elif $test `./findhdr fcntl.h` && \
8516 set open3 -DI_FCNTL && eval $compile; then
8518 echo "<fcntl.h> defines the O_* constants..." >&4
8520 echo "and you have the 3 argument form of open()." >&4
8523 echo "but not the 3 argument form of open(). Oh, well." >&4
8528 echo "I can't find the O_* constant definitions! You got problems." >&4
8534 : see which of string.h or strings.h is needed
8536 strings=`./findhdr string.h`
8537 if $test "$strings" && $test -r "$strings"; then
8538 echo "Using <string.h> instead of <strings.h>." >&4
8542 strings=`./findhdr strings.h`
8543 if $test "$strings" && $test -r "$strings"; then
8544 echo "Using <strings.h> instead of <string.h>." >&4
8546 echo "No string header found -- You'll surely have problems." >&4
8552 "$undef") strings=`./findhdr strings.h`;;
8553 *) strings=`./findhdr string.h`;;
8556 : check for non-blocking I/O stuff
8557 case "$h_sysfile" in
8558 true) echo "#include <sys/file.h>" > head.c;;
8561 true) echo "#include <fcntl.h>" > head.c;;
8562 *) echo "#include <sys/fcntl.h>" > head.c;;
8567 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
8568 case "$o_nonblock" in
8571 $cat >>try.c <<'EOCP'
8575 printf("O_NONBLOCK\n");
8579 printf("O_NDELAY\n");
8583 printf("FNDELAY\n");
8590 if eval $compile_ok; then
8592 case "$o_nonblock" in
8593 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
8594 *) echo "Seems like we can use $o_nonblock.";;
8597 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
8600 *) echo "Using $hint value $o_nonblock.";;
8602 $rm -f try try.* .out core
8605 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
8611 #include <sys/types.h>
8614 #define MY_O_NONBLOCK $o_nonblock
8615 #ifndef errno /* XXX need better Configure test */
8626 #include <strings.h>
8628 $signal_t blech(x) int x; { exit(3); }
8630 $cat >> try.c <<'EOCP'
8638 pipe(pd); /* Down: child -> parent */
8639 pipe(pu); /* Up: parent -> child */
8642 close(pd[1]); /* Parent reads from pd[0] */
8643 close(pu[0]); /* Parent writes (blocking) to pu[1] */
8644 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
8646 signal(SIGALRM, blech);
8648 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
8650 sprintf(string, "%d\n", ret);
8651 write(2, string, strlen(string));
8654 if (errno == EAGAIN) {
8660 if (errno == EWOULDBLOCK)
8661 printf("EWOULDBLOCK\n");
8664 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
8665 sleep(2); /* Give it time to close our pipe */
8667 ret = read(pd[0], buf, 1); /* Should read EOF */
8669 sprintf(string, "%d\n", ret);
8670 write(3, string, strlen(string));
8674 close(pd[0]); /* We write to pd[1] */
8675 close(pu[1]); /* We read from pu[0] */
8676 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
8677 close(pd[1]); /* Pipe pd is now fully closed! */
8678 exit(0); /* Bye bye, thank you for playing! */
8682 if eval $compile_ok; then
8683 echo "$startsh" >mtry
8684 echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
8686 ./mtry >/dev/null 2>&1
8688 0) eagain=`$cat try.out`;;
8689 1) echo "Could not perform non-blocking setting!";;
8690 2) echo "I did a successful read() for something that was not there!";;
8691 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
8692 *) echo "Something terribly wrong happened during testing.";;
8694 rd_nodata=`$cat try.ret`
8695 echo "A read() system call with no data present returns $rd_nodata."
8696 case "$rd_nodata" in
8699 echo "(That's peculiar, fixing that to be -1.)"
8705 echo "Forcing errno EAGAIN on read() with no data available."
8709 echo "Your read() sets errno to $eagain when no data is available."
8712 status=`$cat try.err`
8714 0) echo "And it correctly returns 0 to signal EOF.";;
8715 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
8716 *) echo "However, your read() returns '$status' on EOF??";;
8719 if test "$status" = "$rd_nodata"; then
8720 echo "WARNING: you can't distinguish between EOF and no data!"
8724 echo "I can't compile the test program--assuming errno EAGAIN will do."
8731 echo "Using $hint value $eagain."
8732 echo "Your read() returns $rd_nodata when no data is present."
8733 case "$d_eofnblk" in
8734 "$define") echo "And you can see EOF because read() returns 0.";;
8735 "$undef") echo "But you can't see EOF status from read() returned value.";;
8737 echo "(Assuming you can't see EOF status from read anyway.)"
8743 $rm -f try try.* .out core head.c mtry
8745 : see if fchmod exists
8749 : see if fchown exists
8753 : see if this is an fcntl system
8757 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
8758 while $test $# -ge 2; do
8760 $define) echo "#include <$2>";;
8764 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
8766 if eval $compile; then
8777 : see whether socket exists
8779 $echo $n "Hmm... $c" >&4
8780 if set socket val -f d_socket; eval $csym; $val; then
8781 echo "Looks like you have Berkeley networking support." >&4
8783 if set setsockopt val -f; eval $csym; $val; then
8786 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
8790 if $contains socklib libc.list >/dev/null 2>&1; then
8791 echo "Looks like you have Berkeley networking support." >&4
8793 : we will have to assume that it supports the 4.2 BSD interface
8796 echo "You don't have Berkeley networking in libc$_a..." >&4
8797 if test "X$d_socket" = "X$define"; then
8798 echo "...but you seem to believe that you have sockets." >&4
8800 for net in net socket
8802 if test -f /usr/lib/lib$net$_a; then
8803 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
8804 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
8805 if $contains socket libc.list >/dev/null 2>&1; then
8810 echo "...but the Wollongong group seems to have hacked it in." >&4
8811 sockethdr="-I/usr/netinclude"
8814 echo "Found Berkeley sockets interface in lib$net." >& 4
8815 if $contains setsockopt libc.list >/dev/null 2>&1; then
8818 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
8825 if test "X$d_socket" != "X$define"; then
8826 echo "or anywhere else I see." >&4
8834 : see if socketpair exists
8835 set socketpair d_sockpair
8840 echo "Checking the availability of certain socket constants..." >& 4
8841 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
8842 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
8844 #include <sys/types.h>
8845 #include <sys/socket.h>
8851 set try; if eval $compile; then
8854 set d_${enum}; eval $setvar
8858 : see if sys/select.h has to be included
8859 set sys/select.h i_sysselct
8862 : see if we should include time.h, sys/time.h, or both
8864 if test "X$timeincl" = X; then
8865 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
8866 $echo $n "I'm now running the test program...$c"
8867 $cat >try.c <<'EOCP'
8868 #include <sys/types.h>
8873 #ifdef SYSTIMEKERNEL
8876 #include <sys/time.h>
8879 #include <sys/select.h>
8888 struct timezone tzp;
8890 if (foo.tm_sec == foo.tm_sec)
8893 if (bar.tv_sec == bar.tv_sec)
8900 for s_timezone in '-DS_TIMEZONE' ''; do
8902 for s_timeval in '-DS_TIMEVAL' ''; do
8903 for i_systimek in '' '-DSYSTIMEKERNEL'; do
8904 for i_time in '' '-DI_TIME'; do
8905 for i_systime in '-DI_SYSTIME' ''; do
8908 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
8909 if eval $compile; then
8910 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
8914 $echo $n "Succeeded with $flags$c"
8926 *SYSTIMEKERNEL*) i_systimek="$define"
8927 timeincl=`./findhdr sys/time.h`
8928 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
8929 *) i_systimek="$undef";;
8932 *I_TIME*) i_time="$define"
8933 timeincl=`./findhdr time.h`" $timeincl"
8934 echo "We'll include <time.h>." >&4;;
8935 *) i_time="$undef";;
8938 *I_SYSTIME*) i_systime="$define"
8939 timeincl=`./findhdr sys/time.h`" $timeincl"
8940 echo "We'll include <sys/time.h>." >&4;;
8941 *) i_systime="$undef";;
8946 : check for fd_set items
8949 Checking to see how well your C compiler handles fd_set and friends ...
8951 $cat >fd_set.c <<EOCP
8952 #$i_systime I_SYS_TIME
8953 #$i_sysselct I_SYS_SELECT
8954 #$d_socket HAS_SOCKET
8955 #include <sys/types.h>
8957 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
8960 #include <sys/time.h>
8963 #include <sys/select.h>
8972 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
8979 set fd_set -DTRYBITS
8980 if eval $compile; then
8981 d_fds_bits="$define"
8983 echo "Well, your system knows about the normal fd_set typedef..." >&4
8985 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
8986 d_fd_macros="$define"
8989 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
8991 d_fd_macros="$undef"
8995 Hmm, your compiler has some difficulty with fd_set. Checking further...
8998 if eval $compile; then
9001 echo "Well, your system has some sort of fd_set available..." >&4
9003 echo "and you have the normal fd_set macros." >&4
9004 d_fd_macros="$define"
9007 but not the normal fd_set macros! Gross! More work for me...
9009 d_fd_macros="$undef"
9012 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
9015 d_fd_macros="$undef"
9020 : see if fgetpos exists
9021 set fgetpos d_fgetpos
9024 : see if flock exists
9028 : see if fork exists
9032 : see if pathconf exists
9033 set pathconf d_pathconf
9036 : see if fpathconf exists
9037 set fpathconf d_fpathconf
9041 : check for fpos64_t
9043 echo "Checking to see if you have fpos64_t..." >&4
9046 int main() { fpos64_t x = 7; }
9049 if eval $compile; then
9051 echo "You have fpos64_t."
9054 echo "You do not have fpos64_t."
9056 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
9063 hasstruct='varname=$1; struct=$2; shift; shift;
9064 while $test $# -ge 2; do
9066 $define) echo "#include <$2>";;
9070 echo "int main () { struct $struct foo; }" >> try.c;
9072 if eval $compile; then
9081 : see if this is a sys/param system
9082 set sys/param.h i_sysparam
9085 : see if this is a sys/mount.h system
9086 set sys/mount.h i_sysmount
9089 : see if sys/types.h has to be included
9090 set sys/types.h i_systypes
9095 echo "Checking to see if your system supports struct fs_data..." >&4
9096 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
9098 case "$d_fs_data_s" in
9099 "$define") echo "Yes, it does." ;;
9100 *) echo "No, it doesn't." ;;
9103 : see if fseeko exists
9107 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
9110 : see if fsetpos exists
9111 set fsetpos d_fsetpos
9115 : see if fstatfs exists
9116 set fstatfs d_fstatfs
9120 : see if statvfs exists
9121 set statvfs d_statvfs
9124 : see if fstatvfs exists
9125 set fstatvfs d_fstatvfs
9129 : see if ftello exists
9133 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
9136 : see if getcwd exists
9141 : see if getfsstat exists
9142 set getfsstat d_getfsstat
9145 : see if getgrent exists
9146 set getgrent d_getgrent
9149 : see if gethostbyaddr exists
9150 set gethostbyaddr d_gethbyaddr
9153 : see if gethostbyname exists
9154 set gethostbyname d_gethbyname
9157 : see if gethostent exists
9158 set gethostent d_gethent
9161 : see how we will look up host name
9164 if set gethostname val -f d_gethname; eval $csym; $val; then
9165 echo 'gethostname() found.' >&4
9166 d_gethname="$define"
9169 if set uname val -f d_uname; eval $csym; $val; then
9172 uname() was found, but you're running xenix, and older versions of xenix
9173 have a broken uname(). If you don't really know whether your xenix is old
9174 enough to have a broken system call, use the default answer.
9181 rp='Is your uname() broken?'
9184 n*) d_uname="$define"; call=uname;;
9187 echo 'uname() found.' >&4
9194 case "$d_gethname" in
9195 '') d_gethname="$undef";;
9198 '') d_uname="$undef";;
9200 case "$d_uname$d_gethname" in
9205 Every now and then someone has a $call() that lies about the hostname
9206 but can't be fixed for political or economic reasons. If you wish, I can
9207 pretend $call() isn't there and maybe compute hostname at run-time
9208 thanks to the '$phostname' command.
9211 rp="Shall I ignore $call() from now on?"
9214 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
9217 case "$phostname" in
9219 *) case "$aphostname" in
9225 file=`./loc $file $file $pth`
9226 aphostname=`echo $file $*`
9231 case "$d_uname$d_gethname" in
9234 case "$phostname" in
9236 echo "There will be no way for $package to get your hostname." >&4;;
9238 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
9242 case "$d_phostname" in
9243 '') d_phostname="$undef";;
9246 : see if this is a netdb.h system
9250 : see if prototypes for various gethostxxx netdb.h functions are available
9252 set d_gethostprotos gethostent $i_netdb netdb.h
9255 : see if getlogin exists
9256 set getlogin d_getlogin
9259 : see if getmnt exists
9263 : see if getmntent exists
9264 set getmntent d_getmntent
9267 : see if getnetbyaddr exists
9268 set getnetbyaddr d_getnbyaddr
9271 : see if getnetbyname exists
9272 set getnetbyname d_getnbyname
9275 : see if getnetent exists
9276 set getnetent d_getnent
9279 : see if prototypes for various getnetxxx netdb.h functions are available
9281 set d_getnetprotos getnetent $i_netdb netdb.h
9285 : see if getprotobyname exists
9286 set getprotobyname d_getpbyname
9289 : see if getprotobynumber exists
9290 set getprotobynumber d_getpbynumber
9293 : see if getprotoent exists
9294 set getprotoent d_getpent
9297 : see if getpgid exists
9298 set getpgid d_getpgid
9301 : see if getpgrp2 exists
9302 set getpgrp2 d_getpgrp2
9305 : see if getppid exists
9306 set getppid d_getppid
9309 : see if getpriority exists
9310 set getpriority d_getprior
9313 : see if prototypes for various getprotoxxx netdb.h functions are available
9315 set d_getprotoprotos getprotoent $i_netdb netdb.h
9318 : see if getpwent exists
9319 set getpwent d_getpwent
9323 : see if getservbyname exists
9324 set getservbyname d_getsbyname
9327 : see if getservbyport exists
9328 set getservbyport d_getsbyport
9331 : see if getservent exists
9332 set getservent d_getsent
9335 : see if prototypes for various getservxxx netdb.h functions are available
9337 set d_getservprotos getservent $i_netdb netdb.h
9340 : see if getspent exists
9341 set getspent d_getspent
9344 : see if getspnam exists
9345 set getspnam d_getspnam
9348 : see if gettimeofday or ftime exists
9349 set gettimeofday d_gettimeod
9351 case "$d_gettimeod" in
9357 val="$undef"; set d_ftime; eval $setvar
9360 case "$d_gettimeod$d_ftime" in
9363 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
9367 : see if this is an grp system
9373 xxx=`./findhdr grp.h`
9374 $cppstdin $cppflags $cppminus < $xxx >$$.h
9376 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
9388 set d_grpasswd; eval $setvar
9392 : see if hasmntopt exists
9393 set hasmntopt d_hasmntopt
9396 : see if this is a netinet/in.h or sys/in.h system
9397 set netinet/in.h i_niin sys/in.h i_sysin
9400 : see if arpa/inet.h has to be included
9401 set arpa/inet.h i_arpainet
9404 : see if htonl --and friends-- exists
9409 : Maybe they are macros.
9414 #include <sys/types.h>
9415 #$i_niin I_NETINET_IN
9417 #$i_arpainet I_ARPA_INET
9419 #include <netinet/in.h>
9425 #include <arpa/inet.h>
9428 printf("Defined as a macro.");
9431 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
9432 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
9434 echo "But it seems to be defined as a macro." >&4
9442 : see if iconv exists
9448 if set index val -f; eval $csym; $val; then
9449 if set strchr val -f d_strchr; eval $csym; $val; then
9450 if $contains strchr "$strings" >/dev/null 2>&1 ; then
9453 echo "strchr() found." >&4
9457 echo "index() found." >&4
9462 echo "index() found." >&4
9465 if set strchr val -f d_strchr; eval $csym; $val; then
9468 echo "strchr() found." >&4
9470 echo "No index() or strchr() found!" >&4
9475 set d_strchr; eval $setvar
9477 set d_index; eval $setvar
9479 : check whether inet_aton exists
9480 set inet_aton d_inetaton
9483 : see if inttypes.h is available
9484 : we want a real compile instead of Inhdr because some systems
9485 : have an inttypes.h which includes non-existent headers
9488 #include <inttypes.h>
9490 static int32_t foo32 = 0x12345678;
9494 if eval $compile; then
9495 echo "<inttypes.h> found." >&4
9498 echo "<inttypes.h> NOT found." >&4
9507 echo "Checking to see if you have int64_t..." >&4
9509 #include <sys/types.h>
9510 #$i_inttypes I_INTTYPES
9512 #include <inttypes.h>
9514 int main() { int64_t x = 7; }
9517 if eval $compile; then
9519 echo "You have int64_t."
9522 echo "You do not have int64_t."
9530 $cat >isascii.c <<'EOCP'
9542 if eval $compile; then
9543 echo "isascii() found." >&4
9546 echo "isascii() NOT found." >&4
9553 : see if killpg exists
9557 : see if lchown exists
9559 $cat > try.c <<'EOCP'
9560 /* System header to define __stub macros and hopefully few prototypes,
9561 which can conflict with char lchown(); below. */
9563 /* Override any gcc2 internal prototype to avoid an error. */
9564 /* We use char because int might match the return type of a gcc2
9565 builtin and then its argument prototype would still apply. */
9568 /* The GNU C library defines this for functions which it implements
9569 to always fail with ENOSYS. Some functions are actually named
9570 something starting with __ and the normal name is an alias. */
9571 #if defined (__stub_lchown) || defined (__stub___lchown)
9579 if eval $compile; then
9580 $echo "lchown() found." >&4
9583 $echo "lchown() NOT found." >&4
9589 : See if number of significant digits in a double precision number is known
9591 $cat >ldbl_dig.c <<EOM
9601 printf("Contains LDBL_DIG");
9604 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
9605 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
9606 echo "LDBL_DIG found." >&4
9609 echo "LDBL_DIG NOT found." >&4
9616 : see if link exists
9620 : see if localeconv exists
9621 set localeconv d_locconv
9624 : see if lockf exists
9628 : check for long long
9630 echo "Checking to see if you have long long..." >&4
9631 echo 'int main() { long long x = 7; return 0; }' > try.c
9633 if eval $compile; then
9635 echo "You have have long long."
9638 echo "You do not have long long."
9644 : check for length of long long
9645 case "${d_longlong}${longlongsize}" in
9648 echo "Checking to see how big your long longs are..." >&4
9649 $cat >try.c <<'EOCP'
9653 printf("%d\n", (int)sizeof(long long));
9658 if eval $compile_ok; then
9659 longlongsize=`./try$exe_ext`
9660 echo "Your long longs are $longlongsize bytes long."
9664 echo "(I can't seem to compile the test program. Guessing...)"
9665 rp="What is the size of a long long (in bytes)?"
9669 if $test "X$longsize" = "X$longlongsize"; then
9670 echo "(That isn't any different from an ordinary long.)"
9676 : see if prototype for lseek is available
9678 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
9681 : see if lstat exists
9685 : see if madvise exists
9686 set madvise d_madvise
9689 : see if mblen exists
9693 : see if mbstowcs exists
9694 set mbstowcs d_mbstowcs
9697 : see if mbtowc exists
9701 : see if memchr exists
9705 : see if memcmp exists
9709 : see if memcpy exists
9713 : see if memmove exists
9714 set memmove d_memmove
9717 : see if memset exists
9721 : see if mkdir exists
9725 : see if mkdtemp exists
9726 set mkdtemp d_mkdtemp
9729 : see if mkfifo exists
9733 : see if mkstemp exists
9734 set mkstemp d_mkstemp
9737 : see if mkstemps exists
9738 set mkstemps d_mkstemps
9741 : see if mktime exists
9745 : see if this is a sys/mman.h system
9746 set sys/mman.h i_sysmman
9749 : see if mmap exists
9752 : see what shmat returns
9753 : default to something harmless
9755 case "$i_sysmman$d_mmap" in
9757 $cat >mmap.c <<'END'
9758 #include <sys/mman.h>
9761 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
9766 echo "and it returns ($mmaptype)." >&4
9772 : see if mprotect exists
9773 set mprotect d_mprotect
9776 : see if msgctl exists
9780 : see if msgget exists
9784 : see if msgsnd exists
9788 : see if msgrcv exists
9792 : see how much of the 'msg*(2)' library is present.
9795 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
9796 *"$undef"*) h_msg=false;;
9800 case "`ipcs 2>&1`" in
9801 "SVID messages"*"not configured"*)
9802 echo "Your $osname does not have the msg*(2) configured." >&4
9817 : we could also check for sys/ipc.h ...
9818 if $h_msg && $test `./findhdr sys/msg.h`; then
9819 echo "You have the full msg*(2) library." >&4
9822 echo "You don't have the full msg*(2) library." >&4
9828 : see if msync exists
9832 : see if munmap exists
9836 : see if nice exists
9842 echo "Checking which 64-bit integer type we could use..." >&4
9848 val='"unsigned int"'
9853 *) case "$longsize" in
9857 val='"unsigned long"'
9862 *) case "$d_longlong:$longlongsize" in
9867 val='"unsigned long long"'
9872 *) case "$d_int64_t" in
9891 '') echo "Alas, no 64-bit integer types in sight." >&4
9894 *) if test X"$use64bitint" = Xdefine -o X"$longsize" = X8; then
9899 echo "We $verb use '$quadtype' for 64-bit integers." >&4
9904 : check for length of character
9908 echo "Checking to see how big your characters are (hey, you never know)..." >&4
9909 $cat >try.c <<'EOCP'
9913 printf("%d\n", (int)sizeof(char));
9918 if eval $compile_ok; then
9922 echo "(I can't seem to compile the test program. Guessing...)"
9929 rp="What is the size of a character (in bytes)?"
9936 $echo "Choosing the C types to be used for Perl's internal types..." >&4
9938 case "$use64bitint:$d_quad:$quadtype" in
9946 uvtype="unsigned long"
9952 case "$uselongdouble:$d_longdbl" in
9954 nvtype="long double"
9962 $echo "(IV will be "$ivtype", $ivsize bytes)"
9963 $echo "(UV will be "$uvtype", $uvsize bytes)"
9964 $echo "(NV will be "$nvtype", $nvsize bytes)"
9967 #$i_inttypes I_INTTYPES
9969 #include <inttypes.h>
9974 int8_t i = INT8_MAX;
9975 uint8_t u = UINT8_MAX;
9979 int16_t i = INT16_MAX;
9980 uint16_t i = UINT16_MAX;
9981 printf("int16_t\n");
9984 int32_t i = INT32_MAX;
9985 uint32_t u = UINT32_MAX;
9986 printf("int32_t\n");
9992 '') case "$charsize" in
9994 u8type="unsigned char"
10003 if eval $compile; then
10004 case "`./try$exe_ext`" in
10005 int8_t) i8type=int8_t
10015 '') if $test $charsize -ge 1; then
10017 u8type="unsigned char"
10025 '') case "$shortsize" in
10027 u16type="unsigned short"
10035 '') set try -DINT16
10036 if eval $compile; then
10037 case "`./try$exe_ext`" in
10049 '') if $test $shortsize -ge 2; then
10051 u16type="unsigned short"
10059 '') case "$longsize" in
10061 u32type="unsigned long"
10065 *) case "$intsize" in
10067 u32type="unsigned int"
10077 '') set try -DINT32
10078 if eval $compile; then
10079 case "`./try$exe_ext`" in
10091 '') if $test $intsize -ge 4; then
10093 u32type="unsigned int"
10101 '') case "$d_quad:$quadtype" in
10103 i64type="$quadtype"
10104 u64type="$uquadtype"
10112 $echo "Checking whether your NVs can preserve your UVs..." >&4
10116 $uvtype k = ($uvtype)~0, l;
10122 printf("preserve\n");
10127 if eval $compile; then
10128 case "`./try$exe_ext`" in
10129 preserve) d_nv_preserves_uv="$define" ;;
10132 case "$d_nv_preserves_uv" in
10133 $define) $echo "Yes, they can." 2>&1 ;;
10134 *) $echo "No, they can't." 2>&1
10135 d_nv_preserves_uv="$undef"
10142 : check for off64_t
10144 echo "Checking to see if you have off64_t..." >&4
10146 #include <sys/types.h>
10147 #include <unistd.h>
10148 int main() { off64_t x = 7; }
10151 if eval $compile; then
10153 echo "You have off64_t."
10156 echo "You do not have off64_t."
10157 case "$lseeksize" in
10158 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
10165 : see if POSIX threads are available
10166 set pthread.h i_pthread
10172 : how to create joinable pthreads
10173 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
10175 echo "Checking what constant to use for creating joinable pthreads..." >&4
10176 $cat >try.c <<'EOCP'
10177 #include <pthread.h>
10179 int detachstate = JOINABLE;
10182 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
10183 if eval $compile; then
10184 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
10185 val="$undef" # Yes, undef.
10186 set d_old_pthread_create_joinable
10189 set old_pthread_create_joinable
10192 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
10193 if eval $compile; then
10194 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
10196 set d_old_pthread_create_joinable
10198 val=PTHREAD_CREATE_UNDETACHED
10199 set old_pthread_create_joinable
10202 set try -DJOINABLE=__UNDETACHED
10203 if eval $compile; then
10204 echo "You seem to use __UNDETACHED." >&4
10206 set d_old_pthread_create_joinable
10209 set old_pthread_create_joinable
10212 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
10214 set d_old_pthread_create_joinable
10217 set old_pthread_create_joinable
10224 d_old_pthread_create_joinable="$undef"
10225 old_pthread_create_joinable=""
10228 : see if pause exists
10232 : see if pipe exists
10236 : see if poll exists
10241 : see whether the various POSIXish _yields exist
10243 #include <pthread.h>
10249 #ifdef PTHREAD_YIELD
10252 #ifdef PTHREAD_YIELD_NULL
10253 pthread_yield(NULL);
10259 : see if sched_yield exists
10260 set try -DSCHED_YIELD
10261 if eval $compile; then
10263 sched_yield='sched_yield()'
10267 case "$usethreads" in
10270 $define) echo 'sched_yield() found.' >&4 ;;
10271 *) echo 'sched_yield() NOT found.' >&4 ;;
10277 : see if pthread_yield exists
10278 set try -DPTHREAD_YIELD
10279 if eval $compile; then
10281 case "$sched_yield" in
10282 '') sched_yield='pthread_yield()' ;;
10285 set try -DPTHREAD_YIELD_NULL
10286 if eval $compile; then
10288 case "$sched_yield" in
10289 '') sched_yield='pthread_yield(NULL)' ;;
10295 case "$usethreads" in
10298 $define) echo 'pthread_yield() found.' >&4 ;;
10299 *) echo 'pthread_yield() NOT found.' >&4 ;;
10303 set d_pthread_yield
10306 case "$sched_yield" in
10307 '') sched_yield=undef ;;
10312 : see if this is a pwd.h system
10318 xxx=`./findhdr pwd.h`
10319 $cppstdin $cppflags $cppminus < $xxx >$$.h
10321 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
10329 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
10337 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
10345 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
10353 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
10361 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
10369 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
10377 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
10389 set d_pwquota; eval $setvar
10390 set d_pwage; eval $setvar
10391 set d_pwchange; eval $setvar
10392 set d_pwclass; eval $setvar
10393 set d_pwexpire; eval $setvar
10394 set d_pwcomment; eval $setvar
10395 set d_pwgecos; eval $setvar
10396 set d_pwpasswd; eval $setvar
10400 : see if readdir and friends exist
10401 set readdir d_readdir
10403 set seekdir d_seekdir
10405 set telldir d_telldir
10407 set rewinddir d_rewinddir
10410 : see if readlink exists
10411 set readlink d_readlink
10414 : see if rename exists
10415 set rename d_rename
10418 : see if rmdir exists
10422 : see if memory.h is available.
10427 : See if it conflicts with string.h
10433 $cppstdin $cppflags $cppminus < $strings > mem.h
10434 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
10436 echo "We won't be including <memory.h>."
10446 : can bcopy handle overlapping blocks?
10451 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
10453 #$i_memory I_MEMORY
10454 #$i_stdlib I_STDLIB
10455 #$i_string I_STRING
10456 #$i_unistd I_UNISTD
10458 $cat >>try.c <<'EOCP'
10461 # include <memory.h>
10464 # include <stdlib.h>
10467 # include <string.h>
10469 # include <strings.h>
10472 # include <unistd.h> /* Needed for NetBSD */
10476 char buf[128], abc[128];
10482 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
10484 for (align = 7; align >= 0; align--) {
10485 for (len = 36; len; len--) {
10487 bcopy(abc, b, len);
10488 for (off = 1; off <= len; off++) {
10489 bcopy(b, b+off, len);
10490 bcopy(b+off, b, len);
10491 if (bcmp(b, abc, len))
10500 if eval $compile_ok; then
10501 if ./try 2>/dev/null; then
10502 echo "Yes, it can."
10505 echo "It can't, sorry."
10506 case "$d_memmove" in
10507 "$define") echo "But that's Ok since you have memmove()." ;;
10511 echo "(I can't compile the test program, so we'll assume not...)"
10512 case "$d_memmove" in
10513 "$define") echo "But that's Ok since you have memmove()." ;;
10518 $rm -f try.* try core
10522 : can memcpy handle overlapping blocks?
10524 case "$d_memcpy" in
10527 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
10529 #$i_memory I_MEMORY
10530 #$i_stdlib I_STDLIB
10531 #$i_string I_STRING
10532 #$i_unistd I_UNISTD
10534 $cat >>try.c <<'EOCP'
10537 # include <memory.h>
10540 # include <stdlib.h>
10543 # include <string.h>
10545 # include <strings.h>
10548 # include <unistd.h> /* Needed for NetBSD */
10552 char buf[128], abc[128];
10558 /* Copy "abcde..." string to char abc[] so that gcc doesn't
10559 try to store the string in read-only memory. */
10560 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
10562 for (align = 7; align >= 0; align--) {
10563 for (len = 36; len; len--) {
10565 memcpy(b, abc, len);
10566 for (off = 1; off <= len; off++) {
10567 memcpy(b+off, b, len);
10568 memcpy(b, b+off, len);
10569 if (memcmp(b, abc, len))
10578 if eval $compile_ok; then
10579 if ./try 2>/dev/null; then
10580 echo "Yes, it can."
10583 echo "It can't, sorry."
10584 case "$d_memmove" in
10585 "$define") echo "But that's Ok since you have memmove()." ;;
10589 echo "(I can't compile the test program, so we'll assume not...)"
10590 case "$d_memmove" in
10591 "$define") echo "But that's Ok since you have memmove()." ;;
10596 $rm -f try.* try core
10600 : can memcmp be trusted to compare relative magnitude?
10602 case "$d_memcmp" in
10605 echo "Checking if your memcmp() can compare relative magnitude..." >&4
10607 #$i_memory I_MEMORY
10608 #$i_stdlib I_STDLIB
10609 #$i_string I_STRING
10610 #$i_unistd I_UNISTD
10612 $cat >>try.c <<'EOCP'
10615 # include <memory.h>
10618 # include <stdlib.h>
10621 # include <string.h>
10623 # include <strings.h>
10626 # include <unistd.h> /* Needed for NetBSD */
10632 if ((a < b) && memcmp(&a, &b, 1) < 0)
10638 if eval $compile_ok; then
10639 if ./try 2>/dev/null; then
10640 echo "Yes, it can."
10643 echo "No, it can't (it uses signed chars)."
10646 echo "(I can't compile the test program, so we'll assume not...)"
10650 $rm -f try.* try core
10654 : see if select exists
10655 set select d_select
10658 : see if semctl exists
10659 set semctl d_semctl
10662 : see if semget exists
10663 set semget d_semget
10666 : see if semop exists
10670 : see how much of the 'sem*(2)' library is present.
10673 case "$d_semctl$d_semget$d_semop" in
10674 *"$undef"*) h_sem=false;;
10678 case "`ipcs 2>&1`" in
10679 "SVID messages"*"not configured"*)
10680 echo "Your $osname does not have the sem*(2) configured." >&4
10683 set semctl d_semctl
10685 set semget d_semget
10693 : we could also check for sys/ipc.h ...
10694 if $h_sem && $test `./findhdr sys/sem.h`; then
10695 echo "You have the full sem*(2) library." >&4
10698 echo "You don't have the full sem*(2) library." >&4
10704 : see whether sys/sem.h defines union semun
10706 $cat > try.c <<'END'
10707 #include <sys/types.h>
10708 #include <sys/ipc.h>
10709 #include <sys/sem.h>
10710 int main () { union semun semun; semun.buf = 0; }
10713 if eval $compile; then
10714 echo "You have union semun in <sys/sem.h>." >&4
10717 echo "You do not have union semun in <sys/sem.h>." >&4
10720 $rm -f try try.c try.h
10724 : see how to do semctl IPC_STAT
10727 : see whether semctl IPC_STAT can use union semun
10732 # define S_IRUSR S_IREAD
10733 # define S_IWUSR S_IWRITE
10734 # define S_IXUSR S_IEXEC
10736 # define S_IRUSR 0400
10737 # define S_IWUSR 0200
10738 # define S_IXUSR 0100
10740 # define S_IRGRP (S_IRUSR>>3)
10741 # define S_IWGRP (S_IWUSR>>3)
10742 # define S_IXGRP (S_IXUSR>>3)
10743 # define S_IROTH (S_IRUSR>>6)
10744 # define S_IWOTH (S_IWUSR>>6)
10745 # define S_IXOTH (S_IXUSR>>6)
10748 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
10749 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
10750 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
10755 #include <sys/types.h>
10756 #include <sys/ipc.h>
10757 #include <sys/sem.h>
10758 #include <sys/stat.h>
10765 #$d_union_semun HAS_UNION_SEMUN
10768 #ifndef HAS_UNION_SEMUN
10771 struct semid_ds *buf;
10772 unsigned short *array;
10778 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
10779 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
10781 struct semid_ds argbuf;
10784 st = semctl(sem, 0, IPC_STAT, arg);
10788 # endif /* IPC_STAT */
10789 printf("semctl IPC_STAT failed: errno = %d\n", errno);
10791 if (semctl(sem, 0, IPC_RMID, arg) != 0)
10792 # endif /* IPC_RMID */
10793 printf("semctl IPC_RMID failed: errno = %d\n", errno);
10795 #endif /* IPC_PRIVATE && ... */
10796 printf("semget failed: errno = %d\n", errno);
10802 if eval $compile; then
10805 semun) val="$define" ;;
10811 case "$d_semctl_semun" in
10813 echo "You can use union semun for semctl IPC_STAT." >&4
10816 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
10821 : see whether semctl IPC_STAT can use struct semid_ds pointer
10822 $cat > try.c <<'END'
10823 #include <sys/types.h>
10824 #include <sys/ipc.h>
10825 #include <sys/sem.h>
10826 #include <sys/stat.h>
10834 struct semid_ds arg;
10837 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
10838 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
10841 st = semctl(sem, 0, IPC_STAT, &arg);
10843 printf("semid_ds\n");
10845 # endif /* IPC_STAT */
10846 printf("semctl IPC_STAT failed: errno = %d\n", errno);
10848 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
10849 # endif /* IPC_RMID */
10850 printf("semctl IPC_RMID failed: errno = %d\n", errno);
10852 #endif /* IPC_PRIVATE && ... */
10853 printf("semget failed: errno = %d\n", errno);
10860 if eval $compile; then
10863 semid_ds) val="$define" ;;
10867 set d_semctl_semid_ds
10869 case "$d_semctl_semid_ds" in
10871 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
10873 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
10880 # We do not have the full sem*(2) library, so assume we can not
10886 set d_semctl_semid_ds
10891 : see if setegid exists
10892 set setegid d_setegid
10895 : see if seteuid exists
10896 set seteuid d_seteuid
10899 : see if setgrent exists
10900 set setgrent d_setgrent
10903 : see if sethostent exists
10904 set sethostent d_sethent
10907 : see if setlinebuf exists
10908 set setlinebuf d_setlinebuf
10911 : see if setlocale exists
10912 set setlocale d_setlocale
10915 : see if setnetent exists
10916 set setnetent d_setnent
10919 : see if setprotoent exists
10920 set setprotoent d_setpent
10923 : see if setpgid exists
10924 set setpgid d_setpgid
10927 : see if setpgrp2 exists
10928 set setpgrp2 d_setpgrp2
10931 : see if setpriority exists
10932 set setpriority d_setprior
10935 : see if setpwent exists
10936 set setpwent d_setpwent
10939 : see if setregid exists
10940 set setregid d_setregid
10942 set setresgid d_setresgid
10945 : see if setreuid exists
10946 set setreuid d_setreuid
10948 set setresuid d_setresuid
10951 : see if setrgid exists
10952 set setrgid d_setrgid
10955 : see if setruid exists
10956 set setruid d_setruid
10959 : see if setservent exists
10960 set setservent d_setsent
10963 : see if setsid exists
10964 set setsid d_setsid
10967 : see if setspent exists
10968 set setspent d_setspent
10971 : see if setvbuf exists
10972 set setvbuf d_setvbuf
10975 : see if sfio.h is available
10980 : see if sfio library is available
10991 : Ok, but do we want to use it.
10995 true|$define|[yY]*) dflt='y';;
10998 echo "$package can use the sfio library, but it is experimental."
10999 rp="You seem to have sfio available, do you want to try using it?"
11003 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
11005 : Remove sfio from list of libraries to use
11006 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
11009 echo "libs = $libs" >&4
11013 *) case "$usesfio" in
11014 true|$define|[yY]*)
11015 echo "Sorry, cannot find sfio on this machine" >&4
11016 echo "Ignoring your setting of usesfio=$usesfio" >&4
11024 $define) usesfio='true';;
11025 *) usesfio='false';;
11028 : see if shmctl exists
11029 set shmctl d_shmctl
11032 : see if shmget exists
11033 set shmget d_shmget
11036 : see if shmat exists
11039 : see what shmat returns
11042 $cat >shmat.c <<'END'
11043 #include <sys/shm.h>
11046 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
11051 echo "and it returns ($shmattype)." >&4
11052 : see if a prototype for shmat is available
11053 xxx=`./findhdr sys/shm.h`
11054 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
11055 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
11066 set d_shmatprototype
11069 : see if shmdt exists
11073 : see how much of the 'shm*(2)' library is present.
11076 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
11077 *"$undef"*) h_shm=false;;
11081 case "`ipcs 2>&1`" in
11082 "SVID shared memory"*"not configured"*)
11083 echo "Your $osname does not have the shm*(2) configured." >&4
11086 set shmctl d_shmctl
11088 set shmget d_shmget
11098 : we could also check for sys/ipc.h ...
11099 if $h_shm && $test `./findhdr sys/shm.h`; then
11100 echo "You have the full shm*(2) library." >&4
11103 echo "You don't have the full shm*(2) library." >&4
11110 : see if we have sigaction
11111 if set sigaction val -f d_sigaction; eval $csym; $val; then
11112 echo 'sigaction() found.' >&4
11113 $cat > try.c <<'EOP'
11115 #include <sys/types.h>
11116 #include <signal.h>
11119 struct sigaction act, oact;
11121 oact.sa_handler = 0;
11122 /* so that act and oact are used */
11123 exit(act.sa_flags == 0 && oact.sa_handler == 0);
11127 if eval $compile_ok; then
11130 echo "But you don't seem to have a useable struct sigaction." >&4
11134 echo 'sigaction NOT found.' >&4
11137 set d_sigaction; eval $setvar
11138 $rm -f try try$_o try.c
11140 : see if sigsetjmp exists
11142 case "$d_sigsetjmp" in
11144 $cat >try.c <<'EOP'
11145 #include <setjmp.h>
11150 if (sigsetjmp(env,1))
11153 siglongjmp(env, 1);
11158 if eval $compile; then
11159 if ./try >/dev/null 2>&1; then
11160 echo "POSIX sigsetjmp found." >&4
11164 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
11170 echo "sigsetjmp not found." >&4
11174 *) val="$d_sigsetjmp"
11175 case "$d_sigsetjmp" in
11176 $define) echo "POSIX sigsetjmp found." >&4;;
11177 $undef) echo "sigsetjmp not found." >&4;;
11185 : see if sys/stat.h is available
11186 set sys/stat.h i_sysstat
11190 : see if stat knows about block sizes
11192 echo "Checking to see if your struct stat has st_blocks field..." >&4
11193 set d_statblks stat st_blocks $i_sysstat sys/stat.h
11197 : see if this is a sys/vfs.h system
11198 set sys/vfs.h i_sysvfs
11202 : see if this is a sys/statfs.h system
11203 set sys/statfs.h i_sysstatfs
11208 echo "Checking to see if your system supports struct statfs..." >&4
11209 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
11211 case "$d_statfs_s" in
11212 "$define") echo "Yes, it does." ;;
11213 *) echo "No, it doesn't." ;;
11218 : see if struct statfs knows about f_flags
11219 case "$d_statfs_s" in
11222 echo "Checking to see if your struct statfs has f_flags field..." >&4
11223 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
11227 set d_statfs_f_flags
11231 case "$d_statfs_f_flags" in
11232 "$define") echo "Yes, it does." ;;
11233 *) echo "No, it doesn't." ;;
11236 : see if _ptr and _cnt from stdio act std
11238 if $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
11239 echo "(Looks like you have stdio.h from Linux.)"
11240 case "$stdio_ptr" in
11241 '') stdio_ptr='((fp)->_IO_read_ptr)'
11244 *) ptr_lval=$d_stdio_ptr_lval;;
11246 case "$stdio_cnt" in
11247 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
11250 *) cnt_lval=$d_stdio_cnt_lval;;
11252 case "$stdio_base" in
11253 '') stdio_base='((fp)->_IO_read_base)';;
11255 case "$stdio_bufsiz" in
11256 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
11259 case "$stdio_ptr" in
11260 '') stdio_ptr='((fp)->_ptr)'
11263 *) ptr_lval=$d_stdio_ptr_lval;;
11265 case "$stdio_cnt" in
11266 '') stdio_cnt='((fp)->_cnt)'
11269 *) cnt_lval=$d_stdio_cnt_lval;;
11271 case "$stdio_base" in
11272 '') stdio_base='((fp)->_base)';;
11274 case "$stdio_bufsiz" in
11275 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
11278 : test whether _ptr and _cnt really work
11279 echo "Checking how std your stdio is..." >&4
11282 #define FILE_ptr(fp) $stdio_ptr
11283 #define FILE_cnt(fp) $stdio_cnt
11285 FILE *fp = fopen("try.c", "r");
11288 18 <= FILE_cnt(fp) &&
11289 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
11297 if eval $compile; then
11299 echo "Your stdio acts pretty std."
11302 echo "Your stdio isn't very std."
11305 echo "Your stdio doesn't appear very std."
11311 : Can _ptr be used as an lvalue?
11312 case "$d_stdstdio$ptr_lval" in
11313 $define$define) val=$define ;;
11316 set d_stdio_ptr_lval
11319 : Can _cnt be used as an lvalue?
11320 case "$d_stdstdio$cnt_lval" in
11321 $define$define) val=$define ;;
11324 set d_stdio_cnt_lval
11327 : see if _base is also standard
11329 case "$d_stdstdio" in
11333 #define FILE_base(fp) $stdio_base
11334 #define FILE_bufsiz(fp) $stdio_bufsiz
11336 FILE *fp = fopen("try.c", "r");
11339 19 <= FILE_bufsiz(fp) &&
11340 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
11347 if eval $compile; then
11349 echo "And its _base field acts std."
11352 echo "But its _base field isn't std."
11355 echo "However, it seems to be lacking the _base field."
11364 Checking how to access stdio streams by file descriptor number...
11366 case "$stdio_stream_array" in
11367 '') $cat >try.c <<EOCP
11370 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
11374 for s in _iob __iob __sF
11376 set try -DSTDIO_STREAM_ARRAY=$s
11377 if eval $compile; then
11378 case "`./try$exe_ext`" in
11379 yes) stdio_stream_array=$s; break ;;
11383 $rm -f try.* try$exe_ext
11385 case "$stdio_stream_array" in
11387 I can't figure out how to access stdio streams by file descriptor number.
11389 d_stdio_stream_array="$undef"
11392 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
11394 d_stdio_stream_array="$define"
11398 : see if strcoll exists
11399 set strcoll d_strcoll
11402 : check for structure copying
11404 echo "Checking to see if your C compiler can copy structs..." >&4
11405 $cat >try.c <<'EOCP'
11415 if $cc -c try.c >/dev/null 2>&1 ; then
11417 echo "Yup, it can."
11420 echo "Nope, it can't."
11426 : see if strerror and/or sys_errlist[] exist
11428 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
11429 if set strerror val -f d_strerror; eval $csym; $val; then
11430 echo 'strerror() found.' >&4
11431 d_strerror="$define"
11432 d_strerrm='strerror(e)'
11433 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
11434 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
11435 d_syserrlst="$define"
11437 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
11438 d_syserrlst="$undef"
11440 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
11441 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
11442 echo 'strerror() found in string header.' >&4
11443 d_strerror="$define"
11444 d_strerrm='strerror(e)'
11445 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
11446 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
11447 d_syserrlst="$define"
11449 echo "(You don't appear to have any sys_errlist[], how can this be?)"
11450 d_syserrlst="$undef"
11452 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
11453 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
11454 d_strerror="$undef"
11455 d_syserrlst="$define"
11456 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
11458 echo 'strerror() and sys_errlist[] NOT found.' >&4
11459 d_strerror="$undef"
11460 d_syserrlst="$undef"
11461 d_strerrm='"unknown"'
11465 : see if strtod exists
11466 set strtod d_strtod
11469 : see if strtol exists
11470 set strtol d_strtol
11473 : see if strtold exists
11474 set strtold d_strtold
11477 : see if strtoll exists
11478 set strtoll d_strtoll
11481 case "$d_longlong-$d_strtoll" in
11484 Checking whether your strtoll() works okay...
11486 $cat >try.c <<'EOCP'
11489 #define strtoll __strtoll
11492 extern long long int strtoll(char *s, char **, int);
11493 static int bad = 0;
11494 int check(char *s, long long ell, int een) {
11497 gll = strtoll(s, 0, 10);
11498 if (!((gll == ell) && (errno == een)))
11502 check(" 1", 1LL, 0);
11503 check(" 0", 0LL, 0);
11504 check("-1", -1LL, 0);
11505 check("-9223372036854775808", -9223372036854775808LL, 0);
11506 check("-9223372036854775808", -9223372036854775808LL, 0);
11507 check(" 9223372036854775807", 9223372036854775807LL, 0);
11508 check("-9223372036854775808", -9223372036854775808LL, 0);
11509 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
11510 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
11516 if eval $compile; then
11518 ok) echo "Your strtoll() seems to be working okay." ;;
11520 Your strtoll() doesn't seem to be working okay.
11529 : see if strtoul exists
11530 set strtoul d_strtoul
11533 : see if strtoull exists
11534 set strtoull d_strtoull
11537 case "$d_longlong-$d_strtoull" in
11540 Checking whether your strtoull() works okay...
11542 $cat >try.c <<'EOCP'
11545 #define strtoull __strtoull
11548 extern unsigned long long int strtoull(char *s, char **, int);
11549 static int bad = 0;
11550 int check(char *s, long long eull, int een) {
11553 gull = strtoull(s, 0, 10);
11554 if (!((gull == eull) && (errno == een)))
11558 check(" 1", 1LL, 0);
11559 check(" 0", 0LL, 0);
11560 check("18446744073709551615", 18446744073709551615ULL, 0);
11561 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
11567 if eval $compile; then
11569 ok) echo "Your strtoull() seems to be working okay." ;;
11571 Your strtoull() doesn't seem to be working okay.
11573 d_strtoull="$undef"
11580 : see if strtouq exists
11581 set strtouq d_strtouq
11584 : see if strxfrm exists
11585 set strxfrm d_strxfrm
11588 : see if symlink exists
11589 set symlink d_symlink
11592 : see if syscall exists
11593 set syscall d_syscall
11596 : see if sysconf exists
11597 set sysconf d_sysconf
11600 : see if system exists
11601 set system d_system
11604 : see if tcgetpgrp exists
11605 set tcgetpgrp d_tcgetpgrp
11608 : see if tcsetpgrp exists
11609 set tcsetpgrp d_tcsetpgrp
11612 : see if prototype for telldir is available
11614 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
11617 : see if this is a sys/times.h system
11618 set sys/times.h i_systimes
11621 : see if times exists
11623 if set times val -f d_times; eval $csym; $val; then
11624 echo 'times() found.' >&4
11627 case "$i_systimes" in
11628 "$define") inc='sys/times.h';;
11630 rp="What is the type returned by times() on this system?"
11631 set clock_t clocktype long stdio.h sys/types.h $inc
11634 echo 'times() NOT found, hope that will do.' >&4
11639 : see if truncate exists
11640 set truncate d_truncate
11643 : see if tzname[] exists
11645 if set tzname val -a d_tzname; eval $csym; $val; then
11647 echo 'tzname[] found.' >&4
11650 echo 'tzname[] NOT found.' >&4
11655 : see if umask exists
11659 : see if ustat exists
11663 : backward compatibility for d_hvfork
11664 if test X$d_hvfork != X; then
11665 d_vfork="$d_hvfork"
11668 : see if there is a vfork
11673 : Ok, but do we want to use it. vfork is reportedly unreliable in
11674 : perl on Solaris 2.x, and probably elsewhere.
11678 case "$usevfork" in
11684 Perl can only use a vfork() that doesn't suffer from strict
11685 restrictions on calling functions or modifying global data in
11686 the child. For example, glibc-2.1 contains such a vfork()
11687 that is unsuitable. If your system provides a proper fork()
11688 call, chances are that you do NOT want perl to use vfork().
11691 rp="Do you still want to use vfork()?"
11696 echo "Ok, we won't use vfork()."
11705 $define) usevfork='true';;
11706 *) usevfork='false';;
11709 : see if this is an sysdir system
11710 set sys/dir.h i_sysdir
11713 : see if this is an sysndir system
11714 set sys/ndir.h i_sysndir
11717 : see if closedir exists
11718 set closedir d_closedir
11721 case "$d_closedir" in
11724 echo "Checking whether closedir() returns a status..." >&4
11725 cat > closedir.c <<EOM
11726 #$i_dirent I_DIRENT /**/
11727 #$i_sysdir I_SYS_DIR /**/
11728 #$i_sysndir I_SYS_NDIR /**/
11729 #$i_systypes I_SYS_TYPES /**/
11731 #if defined(I_SYS_TYPES)
11732 #include <sys/types.h>
11734 #if defined(I_DIRENT)
11735 #include <dirent.h>
11736 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11737 #include <sys/dir.h>
11741 #include <sys/ndir.h>
11745 #include <ndir.h> /* may be wrong in the future */
11747 #include <sys/dir.h>
11752 int main() { return closedir(opendir(".")); }
11755 if eval $compile_ok; then
11756 if ./closedir > /dev/null 2>&1 ; then
11757 echo "Yes, it does."
11760 echo "No, it doesn't."
11764 echo "(I can't seem to compile the test program--assuming it doesn't)"
11772 set d_void_closedir
11775 : check for volatile keyword
11777 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
11778 $cat >try.c <<'EOCP'
11781 typedef struct _goo_struct goo_struct;
11782 goo_struct * volatile goo = ((goo_struct *)0);
11783 struct _goo_struct {
11788 typedef unsigned short foo_t;
11789 char *volatile foo;
11791 volatile foo_t blech;
11795 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
11797 echo "Yup, it does."
11800 echo "Nope, it doesn't."
11806 : see if there is a wait4
11810 : see if waitpid exists
11811 set waitpid d_waitpid
11814 : see if wcstombs exists
11815 set wcstombs d_wcstombs
11818 : see if wctomb exists
11819 set wctomb d_wctomb
11822 : preserve RCS keywords in files with variable substitution, grrr
11827 Revision='$Revision'
11829 case "$crosscompile" in
11830 ''|[nN]*) crosscompile="$undef" ;;
11834 next|rhapsody|darwin) multiarch="$define" ;;
11836 case "$multiarch" in
11837 ''|[nN]*) multiarch="$undef" ;;
11840 : check for alignment requirements
11842 case "$crosscompile$multiarch" in
11845 You seem to be either cross-compiling or doing a multiarchitecture build,
11846 skipping the memory alignment check.
11849 case "$alignbytes" in
11850 '') alignbytes=8 ;;
11854 case "$alignbytes" in
11855 '') echo "Checking alignment constraints..." >&4
11856 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
11857 $cat >try.c <<'EOCP'
11858 typedef long double NV;
11861 $cat >try.c <<'EOCP'
11865 $cat >>try.c <<'EOCP'
11873 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
11878 if eval $compile_ok; then
11882 echo "(I can't seem to compile the test program...)"
11885 *) dflt="$alignbytes"
11888 rp="Doubles must be aligned on a how-many-byte boundary?"
11896 : set the base revision
11899 : check for ordering of bytes in a long
11901 case "$crosscompile$multiarch" in
11904 You seem to be either cross-compiling or doing a multiarchitecture build,
11905 skipping the byteorder check.
11911 case "$byteorder" in
11914 In the following, larger digits indicate more significance. A big-endian
11915 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
11916 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
11917 machines may have weird orders like 3412. A Cray will report 87654321,
11918 an Alpha will report 12345678. If the test program works the default is
11920 I'm now running the test program...
11922 $cat >try.c <<'EOCP'
11929 char c[sizeof(long)];
11932 if (sizeof(long) > 4)
11933 u.l = (0x08070605L << 32) | 0x04030201L;
11936 for (i = 0; i < sizeof(long); i++)
11937 printf("%c", u.c[i]+'0');
11944 if eval $compile && ./try > /dev/null; then
11947 [1-4][1-4][1-4][1-4]|12345678|87654321)
11948 echo "(The test program ran ok.)"
11949 echo "byteorder=$dflt"
11952 ????|????????) echo "(The test program ran ok.)" ;;
11953 *) echo "(The test program didn't run right for some reason.)" ;;
11958 (I can't seem to compile the test program. Guessing big-endian...)
11961 case "$xxx_prompt" in
11963 rp="What is the order of bytes in a long?"
11977 : how do we catenate cpp tokens here?
11979 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
11980 $cat >cpp_stuff.c <<'EOCP'
11981 #define RCAT(a,b)a/**/b
11982 #define ACAT(a,b)a ## b
11986 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
11987 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
11988 echo "Oh! Smells like ANSI's been here." >&4
11989 echo "We can catify or stringify, separately or together!"
11991 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
11992 echo "Ah, yes! The good old days!" >&4
11993 echo "However, in the good old days we don't know how to stringify and"
11994 echo "catify at the same time."
11998 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
11999 to have to edit the values of CAT[2-5] in config.h...
12001 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
12005 : see if this is a db.h system
12011 : Check db version.
12013 echo "Checking Berkeley DB version ..." >&4
12019 #include <sys/types.h>
12024 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
12025 int Major, Minor, Patch ;
12026 unsigned long Version ;
12027 (void)db_version(&Major, &Minor, &Patch) ;
12028 printf("You have Berkeley DB Version 2 or greater\n");
12030 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
12031 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
12032 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
12033 Major, Minor, Patch) ;
12035 /* check that db.h & libdb are compatible */
12036 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
12037 printf("db.h and libdb are incompatible\n") ;
12041 printf("db.h and libdb are compatible\n") ;
12043 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
12044 + DB_VERSION_PATCH ;
12046 /* needs to be >= 2.3.4 */
12047 if (Version < 2003004) {
12048 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
12049 printf("but Perl needs Berkeley DB 2.3.4 or greater\n") ;
12055 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
12056 printf("You have Berkeley DB Version 1\n");
12057 exit(0); /* DB version < 2: the coast is clear. */
12059 exit(1); /* <db.h> not Berkeley DB? */
12065 if eval $compile_ok && ./try; then
12066 echo 'Looks OK.' >&4
12068 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
12072 : Remove db from list of libraries to use
12073 echo "Removing unusable -ldb from library list" >&4
12074 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
12077 echo "libs = $libs" >&4
12087 : Check the return type needed for hash
12089 echo "Checking return type needed for hash for Berkeley DB ..." >&4
12095 #include <sys/types.h>
12098 #ifndef DB_VERSION_MAJOR
12099 u_int32_t hash_cb (ptr, size)
12107 info.hash = hash_cb;
12111 if $cc $ccflags -c try.c >try.out 2>&1 ; then
12112 if $contains warning try.out >>/dev/null 2>&1 ; then
12115 db_hashtype='u_int32_t'
12118 : XXX Maybe we should just give up here.
12119 db_hashtype=u_int32_t
12121 echo "Help: I can't seem to compile the db test program." >&4
12122 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
12125 echo "Your version of Berkeley DB uses $db_hashtype for hash."
12127 *) db_hashtype=u_int32_t
12132 : Check the return type needed for prefix
12134 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
12140 #include <sys/types.h>
12143 #ifndef DB_VERSION_MAJOR
12144 size_t prefix_cb (key1, key2)
12152 info.prefix = prefix_cb;
12156 if $cc $ccflags -c try.c >try.out 2>&1 ; then
12157 if $contains warning try.out >>/dev/null 2>&1 ; then
12158 db_prefixtype='int'
12160 db_prefixtype='size_t'
12163 db_prefixtype='size_t'
12164 : XXX Maybe we should just give up here.
12166 echo "Help: I can't seem to compile the db test program." >&4
12167 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
12170 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
12172 *) db_prefixtype='size_t'
12176 : check for void type
12178 echo "Checking to see how well your C compiler groks the void type..." >&4
12179 case "$voidflags" in
12181 $cat >try.c <<'EOCP'
12187 extern void moo(); /* function returning void */
12188 void (*goo)(); /* ptr to func returning void */
12190 void *hue; /* generic ptr */
12203 int main() { sub(); }
12205 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
12206 voidflags=$defvoidused
12207 echo "Good. It appears to support void to the level $package wants.">&4
12208 if $contains warning .out >/dev/null 2>&1; then
12209 echo "However, you might get some warnings that look like this:"
12213 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
12214 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
12215 echo "It supports 1..."
12216 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
12217 echo "It also supports 2..."
12218 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
12220 echo "And it supports 4 but not 8 definitely."
12222 echo "It doesn't support 4..."
12223 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
12225 echo "But it supports 8."
12228 echo "Neither does it support 8."
12232 echo "It does not support 2..."
12233 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
12235 echo "But it supports 4 and 8."
12237 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
12239 echo "And it supports 4 but has not heard about 8."
12241 echo "However it supports 8 but not 4."
12246 echo "There is no support at all for void."
12251 case "$voidflags" in
12253 *) $cat >&4 <<'EOM'
12254 Support flag bits are:
12255 1: basic void declarations.
12256 2: arrays of pointers to functions returning void.
12257 4: operations between pointers to and addresses of void functions.
12258 8: generic void pointers.
12261 rp="Your void support flags add up to what?"
12269 : How can we generate normalized random numbers ?
12271 echo "Looking for a random number function..." >&4
12272 case "$randfunc" in
12274 if set drand48 val -f; eval $csym; $val; then
12276 echo "Good, found drand48()." >&4
12277 elif set random val -f; eval $csym; $val; then
12279 echo "OK, found random()." >&4
12282 echo "Yick, looks like I have to use rand()." >&4
12293 *-Dmy_rand=*|*-Dmy_srand=*)
12294 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
12295 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
12296 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
12297 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
12301 while $test "$cont"; do
12302 rp="Use which function to generate random numbers?"
12304 if $test "$ans" = "$dflt"; then
12310 if set $ans val -f; eval $csym; $val; then
12314 rp="I cannot find function $ans. Use that name anyway?"
12323 case "$randfunc" in
12325 drand01="drand48()"
12331 case "$randbits" in
12333 echo "Checking to see how many bits your $randfunc() function produces..." >&4
12335 #$i_unistd I_UNISTD
12336 #$i_stdlib I_STDLIB
12339 # include <unistd.h>
12342 # include <stdlib.h>
12347 register unsigned long tmp;
12348 register unsigned long max = 0L;
12350 for (i = 1000; i; i--) {
12351 tmp = (unsigned long) $randfunc();
12352 if (tmp > max) max = tmp;
12354 for (i = 0; max; i++)
12360 if eval $compile_ok; then
12364 echo "(I can't seem to compile the test program...)"
12371 rp="How many bits does your $randfunc() function produce?"
12375 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
12376 seedfunc="s$randfunc"
12377 randseedtype=unsigned
12381 rp="How many bits does your $randfunc() function produce?"
12384 seedfunc="s$randfunc"
12385 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
12386 if set $seedfunc val -f; eval $csym; $val; then
12387 echo "(Using $seedfunc() to seed random generator)"
12389 echo "(Warning: no $seedfunc() to seed random generator)"
12392 randseedtype=unsigned
12400 echo "Determining whether or not we are on an EBCDIC system..." >&4
12401 $cat >tebcdic.c <<'EOM'
12404 if ('M'==0xd4) return 0;
12411 if eval $compile_ok; then
12413 echo "You have EBCDIC." >&4
12416 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin." >&4
12419 echo "I'm unable to compile the test program." >&4
12420 echo "I'll assume ASCII or some ISO Latin." >&4
12422 $rm -f tebcdic.c tebcdic
12428 Checking how to flush all pending stdio output...
12430 # I only know how to find the first 32 possibly open files on SunOS.
12431 # See also hints/sunos_4_1.sh and util.c --AD
12433 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
12435 $cat >>try.c <<EOCP
12437 #$i_unistd I_UNISTD
12439 # include <unistd.h>
12441 #$d_sysconf HAS_SYSCONF
12442 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
12443 #ifdef HAS_STDIO_STREAM_ARRAY
12444 # define STDIO_STREAM_ARRAY $stdio_stream_array
12447 FILE* p = fopen("try.out", "w");
12451 # ifdef TRY_FPRINTF
12455 #ifdef TRY_FFLUSH_NULL
12458 #ifdef TRY_FFLUSH_ALL
12460 long open_max = -1;
12461 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
12462 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
12464 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
12465 open_max = sysconf(_SC_OPEN_MAX);
12468 open_max = FOPEN_MAX;
12471 open_max = OPEN_MAX;
12480 # ifdef HAS_STDIO_STREAM_ARRAY
12481 if (open_max > 0) {
12483 for (i = 0; i < open_max; i++)
12484 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
12485 STDIO_STREAM_ARRAY[i]._file < open_max &&
12486 STDIO_STREAM_ARRAY[i]._flag)
12487 fflush(&STDIO_STREAM_ARRAY[i]);
12495 : first we have to find out how _not_ to flush
12496 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
12498 set try -DTRY_FPUTC
12499 if eval $compile; then
12501 ./try$exe_ext 2>/dev/null
12502 if $test ! -s try.out -a "X$?" = X42; then
12508 set try -DTRY_FPRINTF
12510 if eval $compile; then
12512 ./try$exe_ext 2>/dev/null
12513 if $test ! -s try.out -a "X$?" = X42; then
12514 output=-DTRY_FPRINTF
12520 : check for fflush NULL behaviour
12521 case "$fflushNULL" in
12522 '') set try -DTRY_FFLUSH_NULL $output
12523 if eval $compile; then
12525 ./try$exe_ext 2>/dev/null
12527 if $test -s try.out -a "X$code" = X42; then
12528 fflushNULL="`$cat try.out`"
12530 if $test "X$code" != X42; then
12532 (If this test failed, don't worry, we'll try another method shortly.)
12537 $rm -f core try.core core.try.*
12538 case "$fflushNULL" in
12540 Your fflush(NULL) works okay for output streams.
12541 Let's see if it clobbers input pipes...
12543 # As of mid-March 2000 all versions of Solaris appear to have a stdio
12544 # bug that improperly flushes the input end of pipes. So we avoid the
12545 # autoflush on fork/system/exec support for now. :-(
12546 $cat >tryp.c <<EOCP
12549 main(int argc, char **argv)
12555 while ((i = getc(stdin)) != -1
12556 && (*bp++ = i) != '\n'
12557 && bp < &buf[1024])
12560 fprintf(stdout, "%s", buf);
12568 fflushNULL="$define"
12570 if eval $compile; then
12572 $cat tryp.c | ./tryp$exe_ext 2>/dev/null > tryp.out
12573 if cmp tryp.c tryp.out >/dev/null 2>&1; then
12575 fflush(NULL) seems to behave okay with input streams.
12577 fflushNULL="$define"
12580 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
12582 fflushNULL="$undef"
12585 $rm -f core tryp.c tryp.core core.tryp.*
12588 Your fflush(NULL) isn't working (contrary to ANSI C).
12590 fflushNULL="$undef"
12593 Cannot figure out whether your fflush(NULL) works or not.
12594 I'm assuming it doesn't (contrary to ANSI C).
12596 fflushNULL="$undef"
12600 $define|true|[yY]*)
12601 fflushNULL="$define"
12604 fflushNULL="$undef"
12607 : check explicit looping only if NULL did not work, and if the pipe
12608 : bug does not show up on an explicit flush too
12609 case "$fflushNULL" in
12611 $cat >tryp.c <<EOCP
12614 main(int argc, char **argv)
12620 while ((i = getc(stdin)) != -1
12621 && (*bp++ = i) != '\n'
12622 && bp < &buf[1024])
12625 fprintf(stdout, "%s", buf);
12634 if eval $compile; then
12636 $cat tryp.c | ./tryp$exe_ext 2>/dev/null > tryp.out
12637 if cmp tryp.c tryp.out >/dev/null 2>&1; then
12639 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
12641 : now check for fflushall behaviour
12642 case "$fflushall" in
12643 '') set try -DTRY_FFLUSH_ALL $output
12644 if eval $compile; then
12646 (Now testing the other method--but note that this also may fail.)
12649 ./try$exe_ext 2>/dev/null
12650 if $test -s try.out -a "X$?" = X42; then
12651 fflushall="`$cat try.out`"
12654 $rm -f core try.core core.try.*
12655 case "$fflushall" in
12657 Whew. Flushing explicitly all the stdio streams works.
12659 fflushall="$define"
12662 Sigh. Flushing explicitly all the stdio streams doesn't work.
12667 Cannot figure out whether flushing stdio streams explicitly works or not.
12668 I'm assuming it doesn't.
12674 "$define"|true|[yY]*)
12675 fflushall="$define"
12683 All is futile. Even fflush(stdin) clobbers input pipes!
12690 $rm -f core tryp.c tryp.core core.tryp.*
12692 *) fflushall="$undef"
12696 case "$fflushNULL$fflushall" in
12699 OK, I give up. I cannot figure out how to flush pending stdio output.
12700 We won't be flushing handles at all before fork/exec/popen.
12704 $rm -f try.* try$exe_ext
12706 : Store the full pathname to the ar program for use in the C program
12707 : Respect a hint or command line value for full_ar.
12712 : Store the full pathname to the sed program for use in the C program
12715 : see what type gids are declared as in the kernel
12717 echo "Looking for the type for group ids returned by getgid()."
12718 set gid_t gidtype xxx stdio.h sys/types.h
12722 xxx=`./findhdr sys/user.h`
12723 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
12725 unsigned) dflt="$1 $2" ;;
12729 *) dflt="$gidtype";;
12732 gid_t) echo "gid_t found." ;;
12733 *) rp="What is the type for group ids returned by getgid()?"
12741 *_t) zzz="$gidtype" ;;
12744 echo "Checking the size of $zzz..." >&4
12746 #include <sys/types.h>
12749 printf("%d\n", (int)sizeof($gidtype));
12754 if eval $compile_ok; then
12758 echo "(I can't execute the test program--guessing $gidsize.)" >&4
12761 echo "Your $zzz is $gidsize bytes long."
12766 echo "(I can't compile the test program--guessing $gidsize.)" >&4
12772 *_t) zzz="$gidtype" ;;
12775 echo "Checking the sign of $zzz..." >&4
12777 #include <sys/types.h>
12788 if eval $compile; then
12792 echo "(I can't execute the test program--guessing unsigned.)" >&4
12796 1) echo "Your $zzz is unsigned." ;;
12797 -1) echo "Your $zzz is signed." ;;
12803 echo "(I can't compile the test program--guessing unsigned.)" >&4
12809 if $test X"$quadtype" != X; then
12811 echo "Checking how to print 64-bit integers..." >&4
12813 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
12814 $cat >try.c <<'EOCP'
12815 #include <sys/types.h>
12818 int q = 12345678901;
12819 printf("%ld\n", q);
12823 if eval $compile; then
12824 yyy=`./try$exe_ext`
12827 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
12828 sPRIo64='"o"'; sPRIx64='"x"'; sPRIX64='"X"';
12829 echo "We will use %d."
12835 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
12836 $cat >try.c <<'EOCP'
12837 #include <sys/types.h>
12840 long q = 12345678901;
12841 printf("%ld\n", q);
12845 if eval $compile; then
12846 yyy=`./try$exe_ext`
12849 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
12850 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIX64='"lX"';
12851 echo "We will use %ld."
12857 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
12858 $cat >try.c <<'EOCP'
12859 #include <sys/types.h>
12860 #include <inttypes.h>
12863 int64_t q = 12345678901;
12864 printf("%" PRId64 "\n", q);
12868 if eval $compile; then
12869 yyy=`./try$exe_ext`
12872 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
12873 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIX64=PRIX64;
12874 echo "We will use the C9X style."
12880 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
12881 $cat >try.c <<'EOCP'
12882 #include <sys/types.h>
12885 long long q = 12345678901LL; /* AIX cc requires the LL prefix. */
12886 printf("%lld\n", q);
12890 if eval $compile; then
12891 yyy=`./try$exe_ext`
12894 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
12895 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIX64='"llX"';
12896 echo "We will use the %lld style."
12902 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
12904 #include <sys/types.h>
12907 $quadtype q = 12345678901;
12908 printf("%Ld\n", q);
12912 if eval $compile; then
12913 yyy=`./try$exe_ext`
12916 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
12917 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIX64='"LX"';
12918 echo "We will use %Ld."
12924 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
12926 #include <sys/types.h>
12929 $quadtype q = 12345678901;
12930 printf("%qd\n", q);
12934 if eval $compile; then
12935 yyy=`./try$exe_ext`
12938 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
12939 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIX64='"qX"';
12940 echo "We will use %qd."
12946 if $test X"$sPRId64" = X; then
12947 echo "Cannot figure out how to print 64-bit integers." >&4
12955 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
12956 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIX64="$undef";
12958 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
12959 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIX64="$define";
12965 $echo "Checking the format strings to be used for Perl's internal types..." >&4
12967 if $test X"$ivsize" = X8; then
12968 ivdformat="$sPRId64"
12969 uvuformat="$sPRIu64"
12970 uvoformat="$sPRIo64"
12971 uvxformat="$sPRIx64"
12973 if $test X"$ivsize" = X"$longsize"; then
12979 if $test X"$ivsize" = X"$intsize"; then
12986 if $test X"$ivsize" = X"$shortsize"; then
12996 case "$ivdformat" in
12997 '') echo "$0: Fatal: failed to find format strings, cannot continue." >& 4
13004 $echo "Checking the format string to be used for gids..." >&4
13007 -1) if $test X"$gidsize" = X"$ivsize"; then
13008 gidformat="$ivdformat"
13010 if $test X"$gidsize" = X"$longsize"; then
13013 if $test X"$gidsize" = X"$intsize"; then
13016 if $test X"$gidsize" = X"$shortsize"; then
13023 *) if $test X"$gidsize" = X"$uvsize"; then
13024 gidformat="$uvuformat"
13026 if $test X"$gidsize" = X"$longsize"; then
13029 if $test X"$gidsize" = X"$intsize"; then
13032 if $test X"$gidsize" = X"$shortsize"; then
13041 : see if getgroups exists
13042 set getgroups d_getgrps
13045 : see if setgroups exists
13046 set setgroups d_setgrps
13050 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
13052 case "$d_getgrps$d_setgrps" in
13054 case "$groupstype" in
13055 '') dflt="$gidtype" ;;
13056 *) dflt="$groupstype" ;;
13059 What type of pointer is the second argument to getgroups() and setgroups()?
13060 Usually this is the same as group ids, $gidtype, but not always.
13063 rp='What type pointer is the second argument to getgroups() and setgroups()?'
13067 *) groupstype="$gidtype";;
13071 echo "Checking if your $make program sets \$(MAKE)..." >&4
13072 case "$make_set_make" in
13074 $sed 's/^X //' > testmake.mak << 'EOF'
13076 X @echo 'maketemp="$(MAKE)"'
13078 case "`$make -f testmake.mak 2>/dev/null`" in
13079 *maketemp=*) make_set_make='#' ;;
13080 *) make_set_make="MAKE=$make" ;;
13082 $rm -f testmake.mak
13085 case "$make_set_make" in
13086 '#') echo "Yup, it does.";;
13087 *) echo "Nope, it doesn't.";;
13090 : see what type is used for mode_t
13091 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
13092 set mode_t modetype int stdio.h sys/types.h
13095 : define a fucntion to check prototypes
13096 $cat > protochk <<EOSH
13099 optimize="$optimize"
13101 prototype="$prototype"
13106 $cat >> protochk <<'EOSH'
13111 while test $# -ge 2; do
13113 $define) echo "#include <$2>" >> try.c ;;
13114 literal) echo "$2" >> try.c ;;
13118 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
13119 cat >> try.c <<'EOCP'
13120 #ifdef CAN_PROTOTYPE
13121 #define _(args) args
13126 echo "$foo" >> try.c
13127 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
13128 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
13134 $eunicefix protochk
13136 : see what type is used for size_t
13137 rp="What is the type used for the length parameter for string functions?"
13138 set size_t sizetype 'unsigned int' stdio.h sys/types.h
13141 : check for type of arguments to gethostbyaddr.
13142 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
13143 case "$d_gethbyaddr" in
13147 Checking to see what type of arguments are accepted by gethostbyaddr().
13149 hdrs="$define sys/types.h
13150 $d_socket sys/socket.h
13151 $i_niin netinet/in.h
13153 $i_unistd unistd.h"
13154 : The first arg can 'char *' or 'void *'
13155 : The second arg is some of integral type
13156 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
13157 for yyy in size_t long int; do
13158 case "$netdb_host_type" in
13159 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
13160 if ./protochk "$try" $hdrs; then
13161 echo "Your system accepts $xxx for the first arg."
13162 echo "...and $yyy for the second arg."
13163 netdb_host_type="$xxx"
13164 netdb_hlen_type="$yyy"
13170 : In case none of those worked, prompt the user.
13171 case "$netdb_host_type" in
13172 '') rp='What is the type for the 1st argument to gethostbyaddr?'
13175 netdb_host_type=$ans
13176 rp='What is the type for the 2nd argument to gethostbyaddr?'
13179 netdb_hlen_type=$ans
13183 *) : no gethostbyaddr, so pick harmless defaults
13184 netdb_host_type='char *'
13185 netdb_hlen_type="$sizetype"
13188 # Remove the "const" if needed. -- but then we'll have a
13190 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
13193 : check for type of argument to gethostbyname.
13194 if test "X$netdb_name_type" = X ; then
13195 case "$d_gethbyname" in
13199 Checking to see what type of argument is accepted by gethostbyname().
13201 hdrs="$define sys/types.h
13202 $d_socket sys/socket.h
13203 $i_niin netinet/in.h
13205 $i_unistd unistd.h"
13206 for xxx in "const char *" "char *"; do
13207 case "$netdb_name_type" in
13208 '') try="extern struct hostent *gethostbyname($xxx);"
13209 if ./protochk "$try" $hdrs; then
13210 echo "Your system accepts $xxx."
13211 netdb_name_type="$xxx"
13216 : In case none of those worked, prompt the user.
13217 case "$netdb_name_type" in
13218 '') rp='What is the type for the 1st argument to gethostbyname?'
13221 netdb_name_type=$ans
13225 *) : no gethostbyname, so pick harmless default
13226 netdb_name_type='char *'
13231 : check for type of 1st argument to getnetbyaddr.
13232 if test "X$netdb_net_type" = X ; then
13233 case "$d_getnbyaddr" in
13237 Checking to see what type of 1st argument is accepted by getnetbyaddr().
13239 hdrs="$define sys/types.h
13240 $d_socket sys/socket.h
13241 $i_niin netinet/in.h
13243 $i_unistd unistd.h"
13244 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
13245 case "$netdb_net_type" in
13246 '') try="extern struct netent *getnetbyaddr($xxx, int);"
13247 if ./protochk "$try" $hdrs; then
13248 echo "Your system accepts $xxx."
13249 netdb_net_type="$xxx"
13254 : In case none of those worked, prompt the user.
13255 case "$netdb_net_type" in
13256 '') rp='What is the type for the 1st argument to getnetbyaddr?'
13259 netdb_net_type=$ans
13263 *) : no getnetbyaddr, so pick harmless default
13264 netdb_net_type='long'
13268 : locate the preferred pager for this system
13282 '') dflt=/usr/ucb/more;;
13289 rp='What pager is used on your system?'
13293 : see what type pids are declared as in the kernel
13294 rp="What is the type of process ids on this system?"
13295 set pid_t pidtype int stdio.h sys/types.h
13298 : Find earliest binary compatible site_perl subdirectory perl can use.
13299 case "$bincompat5005" in
13300 "$define") xs_apiversion='5.005' ;;
13301 *) xs_apiversion=$version ;; # The current site_perl version.
13303 : Find earliest pure perl site_perl subdirectory perl can use.
13304 : The versioned directories started at 5.005.
13305 pm_apiversion='5.005'
13307 : check for length of pointer
13311 echo "Checking to see how big your pointers are..." >&4
13312 if test "$voidflags" -gt 7; then
13313 echo '#define VOID_PTR char *' > try.c
13315 echo '#define VOID_PTR void *' > try.c
13317 $cat >>try.c <<'EOCP'
13321 printf("%d\n", (int)sizeof(VOID_PTR));
13326 if eval $compile_ok; then
13328 echo "Your pointers are $ptrsize bytes long."
13331 echo "(I can't seem to compile the test program. Guessing...)" >&4
13332 rp="What is the size of a pointer (in bytes)?"
13340 : see if ar generates random libraries by itself
13342 echo "Checking how to generate random libraries on your machine..." >&4
13343 echo 'int bar1() { return bar2(); }' > bar1.c
13344 echo 'int bar2() { return 2; }' > bar2.c
13345 $cat > foo.c <<'EOP'
13346 int main() { printf("%d\n", bar1()); exit(0); }
13348 $cc $ccflags -c bar1.c >/dev/null 2>&1
13349 $cc $ccflags -c bar2.c >/dev/null 2>&1
13350 $cc $ccflags -c foo.c >/dev/null 2>&1
13351 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
13352 if $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
13353 ./foobar >/dev/null 2>&1; then
13354 echo "$ar appears to generate random libraries itself."
13357 elif $ar ts bar$_a >/dev/null 2>&1 &&
13358 $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
13359 ./foobar >/dev/null 2>&1; then
13360 echo "a table of contents needs to be added with '$ar ts'."
13367 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
13368 $test -f $ranlib || ranlib=''
13371 if $test -n "$ranlib"; then
13372 echo "your system has '$ranlib'; we'll use that."
13375 echo "your system doesn't seem to support random libraries"
13376 echo "so we'll use lorder and tsort to order the libraries."
13383 : check for type of arguments to select.
13384 case "$selecttype" in
13385 '') case "$d_select" in
13389 Checking to see what type of arguments are accepted by select().
13391 hdrs="$define sys/types.h
13392 $i_systime sys/time.h
13393 $i_sysselct sys/select.h
13394 $d_socket sys/socket.h"
13395 : The first arg can be int, unsigned, or size_t
13396 : The last arg may or may not be 'const'
13398 : void pointer has been seen but using that
13399 : breaks the selectminbits test
13400 for xxx in 'fd_set *' 'int *'; do
13401 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
13402 for tmo in 'struct timeval *' 'const struct timeval *'; do
13404 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
13405 if ./protochk "$try" $hdrs; then
13406 echo "Your system accepts $xxx."
13415 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
13416 case "$d_fd_set" in
13417 $define) dflt="fd_set *" ;;
13426 *) : no select, so pick a harmless default
13433 : check for the select 'width'
13434 case "$selectminbits" in
13435 '') case "$d_select" in
13439 Checking to see on how many bits at a time your select() operates...
13442 #include <sys/types.h>
13444 #$i_systime I_SYS_TIME
13445 #$i_systimek I_SYS_TIME_KERNEL
13450 # ifdef I_SYS_TIME_KERNEL
13453 # include <sys/time.h>
13454 # ifdef I_SYS_TIME_KERNEL
13458 #$i_sysselct I_SYS_SELECT
13459 #ifdef I_SYS_SELECT
13460 #include <sys/select.h>
13462 #$d_socket HAS_SOCKET
13464 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13468 #define S sizeof(*(b))
13470 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
13471 #define NBITS (NBYTES * 8)
13480 fp = fopen("try.c", "r");
13486 b = ($selecttype)s;
13487 for (i = 0; i < NBITS; i++)
13491 select(fd + 1, b, 0, 0, &t);
13492 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
13493 printf("%d\n", i + 1);
13498 if eval $compile_ok; then
13499 selectminbits=`./try`
13500 case "$selectminbits" in
13502 Cannot figure out on how many bits at a time your select() operates.
13503 I'll play safe and guess it is 32 bits.
13509 *) bits="$selectminbits bits" ;;
13511 echo "Your select() operates on $bits at a time." >&4
13513 rp='What is the minimum number of bits your select() operates on?'
13514 case "$byteorder" in
13515 1234|12345678) dflt=32 ;;
13520 selectminbits="$val"
13524 *) : no select, so pick a harmless default
13531 : Trace out the files included by signal.h, then look for SIGxxx names.
13532 : Remove SIGARRAYSIZE used by HPUX.
13533 : Remove SIGSTKSIZE used by Linux.
13534 : Remove SIGSTKSZ used by Posix.
13535 : Remove SIGTYP void lines used by OS2.
13536 : Some cpps, like os390, dont give the file name anywhere
13537 if [ "X$fieldn" = X ]; then
13538 : Just make some guesses. We check them later.
13539 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
13541 xxx=`echo '#include <signal.h>' |
13542 $cppstdin $cppminus $cppflags 2>/dev/null |
13543 $grep '^[ ]*#.*include' |
13544 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq`
13546 : Check this list of files to be sure we have parsed the cpp output ok.
13547 : This will also avoid potentially non-existent files, such
13550 for xx in $xxx /dev/null ; do
13551 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
13553 : If we have found no files, at least try signal.h
13554 case "$xxxfiles" in
13555 '') xxxfiles=`./findhdr signal.h` ;;
13558 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
13559 print substr($2, 4, 20)
13561 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
13562 print substr($3, 4, 20)
13564 : Append some common names just in case the awk scan failed.
13565 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
13566 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
13567 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
13568 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
13569 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
13571 : generate a few handy files for later
13572 $cat > signal.c <<'EOCP'
13573 #include <sys/types.h>
13574 #include <signal.h>
13578 /* Strange style to avoid deeply-nested #if/#else/#endif */
13581 # define NSIG (_NSIG)
13587 # define NSIG (SIGMAX+1)
13593 # define NSIG (SIG_MAX+1)
13599 # define NSIG (MAXSIG+1)
13605 # define NSIG (MAX_SIG+1)
13610 # ifdef SIGARRAYSIZE
13611 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
13617 # define NSIG (_sys_nsig) /* Solaris 2.5 */
13621 /* Default to some arbitrary number that's big enough to get most
13622 of the common signals.
13628 printf("NSIG %d\n", NSIG);
13634 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
13636 printf "#ifdef SIG"; printf $1; printf "\n"
13637 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
13638 printf $1; printf ");\n"
13642 printf "#endif /* JUST_NSIG */\n";
13643 printf "exit(0);\n}\n";
13646 $cat >signal.awk <<'EOP'
13647 BEGIN { ndups = 0 }
13648 $1 ~ /^NSIG$/ { nsig = $2 }
13649 ($1 !~ /^NSIG$/) && (NF == 2) {
13650 if ($2 > maxsig) { maxsig = $2 }
13651 if (sig_name[$2]) {
13652 dup_name[ndups] = $1
13653 dup_num[ndups] = $2
13665 printf("NSIG %d\n", nsig);
13666 for (n = 1; n < nsig; n++) {
13668 printf("%s %d\n", sig_name[n], sig_num[n])
13671 printf("NUM%d %d\n", n, n)
13674 for (n = 0; n < ndups; n++) {
13675 printf("%s %d\n", dup_name[n], dup_num[n])
13679 $cat >signal_cmd <<EOS
13681 if $test -s signal.lst; then
13682 echo "Using your existing signal.lst file"
13687 $cat >>signal_cmd <<'EOS'
13690 if eval $compile_ok; then
13691 ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
13693 echo "(I can't seem be able to compile the whole test program)" >&4
13694 echo "(I'll try it in little pieces.)" >&4
13695 set signal -DJUST_NSIG
13696 if eval $compile_ok; then
13697 ./signal$_exe > signal.nsg
13700 echo "I can't seem to figure out how many signals you have." >&4
13701 echo "Guessing 50." >&4
13702 echo 'NSIG 50' > signal.nsg
13704 : Now look at all the signal names, one at a time.
13705 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
13706 $cat > signal.c <<EOCP
13707 #include <sys/types.h>
13708 #include <signal.h>
13711 printf("$xx %d\n", SIG${xx});
13716 if eval $compile; then
13717 echo "SIG${xx} found."
13718 ./signal$_exe >> signal.ls1
13720 echo "SIG${xx} NOT found."
13723 if $test -s signal.ls1; then
13724 $cat signal.nsg signal.ls1 |
13725 $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
13729 if $test -s signal.lst; then
13732 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
13733 echo 'kill -l' >signal
13734 set X `csh -f <signal`
13738 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
13740 echo $@ | $tr ' ' $trnl | \
13741 $awk '{ printf "%s %d\n", $1, ++s; }
13742 END { printf "NSIG %d\n", ++s }' >signal.lst
13744 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
13746 chmod a+x signal_cmd
13747 $eunicefix signal_cmd
13749 : generate list of signal names
13751 case "$sig_name_init" in
13753 *) case "$sig_num_init" in
13754 ''|*,*) doinit=yes ;;
13759 echo "Generating a list of signal names and numbers..." >&4
13761 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
13762 sig_name=`$awk 'BEGIN { printf "ZERO " }
13763 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
13764 sig_num=`$awk 'BEGIN { printf "0 " }
13765 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
13766 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
13767 !/^NSIG/ { printf "\"%s\", ", $1 }
13768 END { printf "0\n" }' signal.lst`
13769 sig_num_init=`$awk 'BEGIN { printf "0, " }
13770 !/^NSIG/ { printf "%d, ", $2}
13771 END { printf "0\n"}' signal.lst`
13774 echo "The following $sig_count signals are available:"
13776 echo $sig_name | $awk \
13777 'BEGIN { linelen = 0 }
13779 for (i = 1; i <= NF; i++) {
13780 name = "SIG" $i " "
13781 linelen = linelen + length(name)
13782 if (linelen > 70) {
13784 linelen = length(name)
13790 $rm -f signal signal.c signal.awk signal.lst signal_cmd
13793 case "$sizetype" in
13794 *_t) zzz="$sizetype" ;;
13795 *) zzz="filesize" ;;
13797 echo "Checking the size of $zzz..." >&4
13799 #include <sys/types.h>
13802 printf("%d\n", (int)sizeof($sizetype));
13807 if eval $compile_ok; then
13811 echo "(I can't execute the test program--guessing $sizesize.)" >&4
13814 echo "Your $zzz size is $sizesize bytes."
13819 echo "(I can't compile the test program--guessing $sizesize.)" >&4
13823 : check for socklen_t
13825 echo "Checking to see if you have socklen_t..." >&4
13827 #include <sys/types.h>
13828 #$d_socket HAS_SOCKET
13830 #include <sys/socket.h>
13832 int main() { socklen_t x = 16; }
13835 if eval $compile; then
13837 echo "You have socklen_t."
13840 echo "You do not have socklen_t."
13841 case "$sizetype" in
13842 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
13849 : check for type of the size argument to socket calls
13850 case "$d_socket" in
13854 Checking to see what type is the last argument of accept().
13856 hdrs="$define sys/types.h $d_socket sys/socket.h"
13858 case "$d_socklen_t" in
13859 "$define") yyy="$yyy socklen_t"
13861 yyy="$yyy $sizetype int long"
13862 for xxx in $yyy; do
13863 case "$socksizetype" in
13864 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
13865 if ./protochk "$try" $hdrs; then
13866 echo "Your system accepts '$xxx *' for the last argument of accept()."
13867 socksizetype="$xxx"
13872 : In case none of those worked, prompt the user.
13873 case "$socksizetype" in
13874 '') rp='What is the type for socket address structure sizes?'
13881 *) : no sockets, so pick relatively harmless defaults
13882 socksizetype='char *'
13886 : see what type is used for signed size_t
13887 set ssize_t ssizetype int stdio.h sys/types.h
13890 $cat > ssize.c <<EOM
13892 #include <sys/types.h>
13893 #define Size_t $sizetype
13894 #define SSize_t $dflt
13897 if (sizeof(Size_t) == sizeof(SSize_t))
13899 else if (sizeof(Size_t) == sizeof(int))
13908 if eval $compile_ok && ./ssize > /dev/null; then
13909 ssizetype=`./ssize`
13910 echo "I'll be using $ssizetype for functions returning a byte count." >&4
13913 Help! I can't compile and run the ssize_t test program: please enlighten me!
13914 (This is probably a misconfiguration in your system or libraries, and
13915 you really ought to fix it. Still, I'll try anyway.)
13917 I need a type that is the same size as $sizetype, but is guaranteed to
13918 be signed. Common values are ssize_t, int and long.
13921 rp="What signed type is the same size as $sizetype?"
13925 $rm -f ssize ssize.*
13927 : see what type of char stdio uses.
13929 if $contains 'unsigned.*char.*_ptr;' `./findhdr stdio.h` >/dev/null 2>&1 ; then
13930 echo "Your stdio uses unsigned chars." >&4
13931 stdchar="unsigned char"
13933 echo "Your stdio uses signed chars." >&4
13937 : see if time exists
13939 if test "X$d_time" = X -o X"$timetype" = X; then
13940 if set time val -f d_time; eval $csym; $val; then
13941 echo 'time() found.' >&4
13943 rp="What is the type returned by time() on this system?"
13944 set time_t timetype long stdio.h sys/types.h
13947 echo 'time() not found, hope that will do.' >&4
13955 : see what type uids are declared as in the kernel
13957 echo "Looking for the type for user ids returned by getuid()."
13958 set uid_t uidtype xxx stdio.h sys/types.h
13962 xxx=`./findhdr sys/user.h`
13963 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
13965 unsigned) dflt="$1 $2" ;;
13969 *) dflt="$uidtype";;
13972 uid_t) echo "uid_t found." ;;
13973 *) rp="What is the type for user ids returned by getuid()?"
13981 *_t) zzz="$uidtype" ;;
13984 echo "Checking the size of $zzz..." >&4
13986 #include <sys/types.h>
13989 printf("%d\n", (int)sizeof($uidtype));
13994 if eval $compile_ok; then
13998 echo "(I can't execute the test program--guessing $uidsize.)" >&4
14001 echo "Your $zzz is $uidsize bytes long."
14006 echo "(I can't compile the test program--guessing $uidsize.)" >&4
14011 *_t) zzz="$uidtype" ;;
14014 echo "Checking the sign of $zzz..." >&4
14016 #include <sys/types.h>
14027 if eval $compile; then
14031 echo "(I can't execute the test program--guessing unsigned.)" >&4
14035 1) echo "Your $zzz is unsigned." ;;
14036 -1) echo "Your $zzz is signed." ;;
14042 echo "(I can't compile the test program--guessing unsigned.)" >&4
14048 $echo "Checking the format string to be used for uids..." >&4
14051 -1) if $test X"$uidsize" = X"$ivsize"; then
14052 uidformat="$ivdformat"
14054 if $test X"$uidsize" = X"$longsize"; then
14057 if $test X"$uidsize" = X"$intsize"; then
14060 if $test X"$uidsize" = X"$shortsize"; then
14067 *) if $test X"$uidsize" = X"$uvsize"; then
14068 uidformat="$uvuformat"
14070 if $test X"$uidsize" = X"$longsize"; then
14073 if $test X"$uidsize" = X"$intsize"; then
14076 if $test X"$uidsize" = X"$shortsize"; then
14085 : see if dbm.h is available
14086 : see if dbmclose exists
14087 set dbmclose d_dbmclose
14090 case "$d_dbmclose" in
14100 *) set rpcsvc/dbm.h i_rpcsvcdbm
14105 *) echo "We won't be including <dbm.h>"
14115 : see if this is a sys/file.h system
14120 : do we need to include sys/file.h ?
14124 if $h_sysfile; then
14126 echo "We'll be including <sys/file.h>." >&4
14129 echo "We won't be including <sys/file.h>." >&4
14139 : see if fcntl.h is there
14144 : see if we can include fcntl.h
14150 echo "We'll be including <fcntl.h>." >&4
14153 if $h_sysfile; then
14154 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
14156 echo "We won't be including <fcntl.h>." >&4
14168 : see if this is a iconv.h system
14169 set iconv.h i_iconv
14172 : see if this is a ieeefp.h system
14173 set ieeefp.h i_ieeefp
14176 : see if locale.h is available
14177 set locale.h i_locale
14180 : see if mach cthreads are available
14181 if test "X$usethreads" = "X$define"; then
14182 set mach/cthreads.h i_machcthr
14185 i_machcthr="$undef"
14190 : see if this is a math.h system
14194 : see if this is a mntent.h system
14195 set mntent.h i_mntent
14198 : see if ndbm.h is available
14203 : see if dbm_open exists
14204 set dbm_open d_dbm_open
14206 case "$d_dbm_open" in
14209 echo "We won't be including <ndbm.h>"
14218 : see if net/errno.h is available
14220 set net/errno.h val
14223 : Unfortunately, it causes problems on some systems. Arrgh.
14226 cat > try.c <<'EOM'
14229 #include <net/errno.h>
14235 if $cc $ccflags -c try.c >/dev/null 2>&1; then
14236 echo "We'll be including <net/errno.h>." >&4
14238 echo "We won't be including <net/errno.h>." >&4
14247 : see if netinet/tcp.h is available
14248 set netinet/tcp.h i_netinettcp
14251 : see if this is a poll.h system
14256 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
14257 $cat <<'EOSH' > Cppsym.know
14258 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
14259 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
14260 alliant alpha am29000 AM29000 amiga AMIGAOS AMIX
14261 ansi ANSI_C_SOURCE apollo ardent atarist att386 att3b BeOS
14262 BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
14263 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
14264 bull c cadmus clipper CMU COFF COMPILER_VERSION
14265 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
14266 CYGWIN DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
14267 Dynix DynixPTX ELF encore EPI EXTENSIONS FILE_OFFSET_BITS
14268 FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
14269 GNU_SOURCE GNUC GNUC_MINOR GO32 gould GOULD_PN
14270 H3050R H3050RX hbullx20 hcx host_mips
14271 hp200 hp300 hp700 HP700 hp800 hp9000
14272 hp9000s200 hp9000s300 hp9000s400 hp9000s500
14273 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
14274 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
14275 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
14276 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
14277 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
14278 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
14279 Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
14280 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
14281 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
14282 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
14283 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
14284 MATH_HAS_NO_SIDE_EFFECTS
14285 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
14286 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
14287 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
14288 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
14289 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
14290 NetBSD news1500 news1700 news1800 news1900 news3700
14291 news700 news800 news900 NeXT NLS ns16000 ns32000
14292 ns32016 ns32332 ns32k nsc32000
14293 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
14294 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
14295 pc532 pdp11 PGC PIC plexus PORTAR posix
14296 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
14297 POSIX_C_SOURCE POSIX_SOURCE POWER
14298 PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
14299 riscix riscos RT scs SCO sequent sgi SGI_SOURCE sinix
14300 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
14301 sony sony_news sonyrisc sparc sparclite spectrum
14302 stardent stdc STDC_EXT stratos sun sun3 sun386
14303 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
14304 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
14305 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
14306 sysV68 sysV88 Tek4132 Tek4300 titan
14307 tower tower32 tower32_200 tower32_600 tower32_700
14308 tower32_800 tower32_850 tss
14309 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
14310 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
14311 unix UNIX95 UNIX99 unixpc unos USGr4 USGr4_2
14312 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms xenix Xenix286
14313 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
14314 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
14317 # Maybe put other stuff here too.
14318 cat <<EOSH >>Cppsym.know
14321 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
14322 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
14323 $cat Cppsym.a Cppsym.b | $tr ' ' $trnl | sort | uniq > Cppsym.know
14324 $rm -f Cppsym.a Cppsym.b
14325 cat <<EOSH > Cppsym
14327 if $test \$# -gt 0; then
14328 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
14329 if $test -s Cppsym.got; then
14336 $tr " " "$trnl" | ./Cppsym.try
14342 cat <<EOSH > Cppsym.try
14344 cat <<'EOCP' > try.c
14350 cat <<'EOSH' >> Cppsym.try
14352 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
14353 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
14354 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
14355 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
14359 cat <<EOSH >> Cppsym.try
14361 case "$osname-$gccversion" in
14362 irix-) ccflags="\$ccflags -woff 1178" ;;
14364 $cc $optimize \$ccflags $ldflags -o try try.c $libs && ./try$exe_ext
14366 chmod +x Cppsym.try
14367 $eunicefix Cppsym.try
14368 ./Cppsym < Cppsym.know > Cppsym.true
14369 : now check the C compiler for additional symbols
14370 postprocess_cc_v=''
14372 aix) postprocess_cc_v="|$tr , ' '" ;;
14379 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
14382 -D*) echo "\$i" | $sed 's/^-D//';;
14383 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
14388 postprocess_cc_v=''
14391 ./ccsym > ccsym1.raw
14392 if $test -s ccsym1.raw; then
14393 $sort ccsym1.raw | $uniq >ccsym.raw
14395 mv ccsym1.raw ccsym.raw
14398 $awk '/\=/ { print $0; next }
14399 { print $0"=1" }' ccsym.raw >ccsym.list
14400 $awk '/\=/ { print $0; next }
14401 { print $0"=1" }' Cppsym.true >ccsym.true
14402 $comm -13 ccsym.true ccsym.list >ccsym.own
14403 $comm -12 ccsym.true ccsym.list >ccsym.com
14404 $comm -23 ccsym.true ccsym.list >ccsym.cpp
14406 if $test -z ccsym.raw; then
14407 echo "Your C compiler doesn't seem to define any symbols!" >&4
14409 echo "However, your C preprocessor defines the following symbols:"
14412 cppsymbols=`$cat Cppsym.true`
14413 cppsymbols=`echo $cppsymbols`
14414 cppccsymbols="$cppsymbols"
14416 if $test -s ccsym.com; then
14417 echo "Your C compiler and pre-processor define these symbols:"
14418 $sed -e 's/\(.*\)=.*/\1/' ccsym.com
14421 cppccsymbols=`$cat ccsym.com`
14422 cppccsymbols=`echo $cppccsymbols`
14423 $test "$silent" || sleep 1
14425 if $test -s ccsym.cpp; then
14426 $test "$also" && echo " "
14427 echo "Your C pre-processor ${also}defines the following symbols:"
14428 $sed -e 's/\(.*\)=.*/\1/' ccsym.cpp
14430 cppsymbols=`$cat ccsym.cpp`
14431 cppsymbols=`echo $cppsymbols`
14432 $test "$silent" || sleep 1
14434 if $test -s ccsym.own; then
14435 $test "$also" && echo " "
14436 echo "Your C compiler ${also}defines the following cpp symbols:"
14437 $sed -e 's/\(.*\)=1/\1/' ccsym.own
14438 $sed -e 's/\(.*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
14439 ccsymbols=`$cat ccsym.own`
14440 ccsymbols=`echo $ccsymbols`
14441 $test "$silent" || sleep 1
14446 : see if this is a termio system
14450 if $test `./findhdr termios.h`; then
14451 set tcsetattr i_termios
14457 "$define") echo "You have POSIX termios.h... good!" >&4;;
14458 *) if ./Cppsym pyr; then
14459 case "`/bin/universe`" in
14460 ucb) if $test `./findhdr sgtty.h`; then
14462 echo "<sgtty.h> found." >&4
14464 echo "System is pyramid with BSD universe."
14465 echo "<sgtty.h> not found--you could have problems." >&4
14467 *) if $test `./findhdr termio.h`; then
14469 echo "<termio.h> found." >&4
14471 echo "System is pyramid with USG universe."
14472 echo "<termio.h> not found--you could have problems." >&4
14476 if $test `./findhdr termio.h`; then
14477 echo "<termio.h> found." >&4
14479 elif $test `./findhdr sgtty.h`; then
14480 echo "<sgtty.h> found." >&4
14483 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
14486 if $test `./findhdr sgtty.h`; then
14487 echo "<sgtty.h> found." >&4
14489 elif $test `./findhdr termio.h`; then
14490 echo "<termio.h> found." >&4
14493 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
14497 set i_termio; eval $setvar
14498 val=$val2; set i_sgtty; eval $setvar
14499 val=$val3; set i_termios; eval $setvar
14501 : see if this is a shadow.h system
14502 set shadow.h i_shadow
14505 : see if this is a socks.h system
14506 set socks.h i_socks
14509 : see if stdarg is available
14511 if $test `./findhdr stdarg.h`; then
14512 echo "<stdarg.h> found." >&4
14515 echo "<stdarg.h> NOT found." >&4
14519 : see if varags is available
14521 if $test `./findhdr varargs.h`; then
14522 echo "<varargs.h> found." >&4
14524 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
14527 : set up the varargs testing programs
14528 $cat > varargs.c <<EOP
14530 #include <stdarg.h>
14533 #include <varargs.h>
14537 int f(char *p, ...)
14551 p = va_arg(ap, char *);
14556 $cat > varargs <<EOP
14558 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
14567 : now check which varargs header should be included
14572 if `./varargs I_STDARG`; then
14574 elif `./varargs I_VARARGS`; then
14579 if `./varargs I_VARARGS`; then
14586 echo "I could not find the definition for va_dcl... You have problems..." >&4
14587 val="$undef"; set i_stdarg; eval $setvar
14588 val="$undef"; set i_varargs; eval $setvar
14593 case "$i_varhdr" in
14595 val="$define"; set i_stdarg; eval $setvar
14596 val="$undef"; set i_varargs; eval $setvar
14599 val="$undef"; set i_stdarg; eval $setvar
14600 val="$define"; set i_varargs; eval $setvar
14603 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
14607 : see if stddef is available
14608 set stddef.h i_stddef
14611 : see if this is a sunmath.h system
14612 set sunmath.h i_sunmath
14615 : see if sys/access.h is available
14616 set sys/access.h i_sysaccess
14619 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
14620 set sys/filio.h i_sysfilio
14623 if $test `./findhdr sys/ioctl.h`; then
14625 echo '<sys/ioctl.h> found.' >&4
14628 if $test $i_sysfilio = "$define"; then
14629 echo '<sys/ioctl.h> NOT found.' >&4
14631 $test $i_sgtty = "$define" && xxx="sgtty.h"
14632 $test $i_termio = "$define" && xxx="termio.h"
14633 $test $i_termios = "$define" && xxx="termios.h"
14634 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
14641 : see if this is a syslog.h system
14642 set syslog.h i_syslog
14646 : see if this is a sys/mode.h system
14647 set sys/mode.h i_sysmode
14650 : see if sys/resource.h has to be included
14651 set sys/resource.h i_sysresrc
14654 : see if sys/security.h is available
14655 set sys/security.h i_syssecrt
14658 : see if this is a sys/statvfs.h system
14659 set sys/statvfs.h i_sysstatvfs
14662 : see if this is a sys/uio.h system
14663 set sys/uio.h i_sysuio
14666 : see if this is a sys/un.h system
14667 set sys/un.h i_sysun
14671 : see if this is a sys/utsname.h system
14672 set sys/utsname.h i_sysutsname
14675 : see if this is a syswait system
14676 set sys/wait.h i_syswait
14679 : see if this is a ustat.h system
14680 set ustat.h i_ustat
14683 : see if this is an utime system
14684 set utime.h i_utime
14687 : see if this is a values.h system
14688 set values.h i_values
14691 : see if this is a vfork system
14694 set vfork.h i_vfork
14702 : see if gdbm.h is available
14707 : see if gdbm_open exists
14708 set gdbm_open d_gdbm_open
14710 case "$d_gdbm_open" in
14713 echo "We won't be including <gdbm.h>"
14723 echo "Looking for extensions..." >&4
14724 : If we are using the old config.sh, known_extensions may contain
14725 : old or inaccurate or duplicate values.
14726 known_extensions=''
14727 nonxs_extensions=''
14728 : We do not use find because it might not be available.
14729 : We do not just use MANIFEST because the user may have dropped
14730 : some additional extensions into the source tree and expect them
14733 : Function to recursively find available extensions, ignoring DynaLoader
14734 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
14738 DynaLoader|dynaload) ;;
14740 if $test -f $xxx/$xxx.xs; then
14741 known_extensions="$known_extensions $1$xxx";
14742 elif $test -f $xxx/Makefile.PL; then
14743 nonxs_extensions="$nonxs_extensions $1$xxx";
14745 if $test -d $xxx -a $# -lt 10; then
14748 eval $find_extensions;
14760 eval $find_extensions
14761 set X $nonxs_extensions
14763 nonxs_extensions="$*"
14764 set X $known_extensions
14766 known_extensions="$*"
14769 : Now see which are supported on this system.
14771 for xxx in $known_extensions ; do
14775 $define) avail_ext="$avail_ext $xxx" ;;
14778 GDBM_File|gdbm_fil)
14780 $define) avail_ext="$avail_ext $xxx" ;;
14783 NDBM_File|ndbm_fil)
14786 case "$osname-$use64bitint" in
14789 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
14792 *) avail_ext="$avail_ext $xxx" ;;
14797 ODBM_File|odbm_fil)
14798 case "${i_dbm}${i_rpcsvcdbm}" in
14800 case "$osname-$use64bitint" in
14803 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
14806 *) avail_ext="$avail_ext $xxx" ;;
14812 case "$useposix" in
14813 true|define|y) avail_ext="$avail_ext $xxx" ;;
14817 case "$useopcode" in
14818 true|define|y) avail_ext="$avail_ext $xxx" ;;
14822 case "$d_socket" in
14823 true|$define|y) avail_ext="$avail_ext $xxx" ;;
14827 case "$usethreads" in
14828 true|$define|y) avail_ext="$avail_ext $xxx" ;;
14832 : XXX Do we need a useipcsysv variable here
14833 case "${d_msg}${d_sem}${d_shm}" in
14834 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
14837 *) avail_ext="$avail_ext $xxx"
14846 : Now see which nonxs extensions are supported on this system.
14847 : For now assume all are.
14849 for xxx in $nonxs_extensions ; do
14851 *) nonxs_ext="$nonxs_ext $xxx"
14863 A number of extensions are supplied with $package. You may choose to
14864 compile these extensions for dynamic loading (the default), compile
14865 them into the $package executable (static loading), or not include
14866 them at all. Answer "none" to include no extensions.
14867 Note that DynaLoader is always built and need not be mentioned here.
14870 case "$dynamic_ext" in
14871 '') dflt="$avail_ext" ;;
14872 *) dflt="$dynamic_ext"
14873 # Perhaps we are reusing an old out-of-date config.sh.
14876 if test X"$dynamic_ext" != X"$avail_ext"; then
14878 NOTICE: Your previous config.sh list may be incorrect.
14879 The extensions now available to you are
14881 but the default list from your previous config.sh is
14893 rp="What extensions do you wish to load dynamically?"
14896 none) dynamic_ext=' ' ;;
14897 *) dynamic_ext="$ans" ;;
14900 case "$static_ext" in
14902 : Exclude those already listed in dynamic linking
14904 for xxx in $avail_ext; do
14905 case " $dynamic_ext " in
14907 *) dflt="$dflt $xxx" ;;
14914 *) dflt="$static_ext"
14921 rp="What extensions do you wish to load statically?"
14924 none) static_ext=' ' ;;
14925 *) static_ext="$ans" ;;
14930 A number of extensions are supplied with $package. Answer "none"
14931 to include no extensions.
14932 Note that DynaLoader is always built and need not be mentioned here.
14935 case "$static_ext" in
14936 '') dflt="$avail_ext" ;;
14937 *) dflt="$static_ext"
14938 # Perhaps we are reusing an old out-of-date config.sh.
14941 if test X"$static_ext" != X"$avail_ext"; then
14943 NOTICE: Your previous config.sh list may be incorrect.
14944 The extensions now available to you are
14946 but the default list from your previous config.sh is
14955 : Exclude those that are not xs extensions
14959 rp="What extensions do you wish to include?"
14962 none) static_ext=' ' ;;
14963 *) static_ext="$ans" ;;
14968 set X $dynamic_ext $static_ext $nonxs_ext
14972 : Remove build directory name from cppstdin so it can be used from
14973 : either the present location or the final installed location.
14975 : Get out of the UU directory to get correct path name.
14977 case "$cppstdin" in
14979 echo "Stripping down cppstdin path name"
14985 : end of configuration questions
14987 echo "End of configuration questions."
14990 : back to where it started
14991 if test -d ../UU; then
14995 : configuration may be patched via a 'config.over' file
14996 if $test -f config.over; then
14999 rp='I see a config.over file. Do you wish to load it?'
15002 n*) echo "OK, I'll ignore it.";;
15004 echo "Configuration override changes have been loaded."
15009 : in case they want portability, strip down executable paths
15010 case "$d_portable" in
15013 echo "Stripping down executable paths..." >&4
15014 for file in $loclist $trylist; do
15016 eval $file=`basename $temp`
15021 : create config.sh file
15023 echo "Creating config.sh..." >&4
15024 $spitshell <<EOT >config.sh
15027 # This file was produced by running the Configure script. It holds all the
15028 # definitions figured out by Configure. Should you modify one of these values,
15029 # do not forget to propagate your changes by running "Configure -der". You may
15030 # instead choose to run each of the .SH files by yourself, or "Configure -S".
15033 # Package name : $package
15034 # Source directory : $src
15035 # Configuration time: $cf_time
15036 # Configured by : $cf_by
15037 # Target system : $myuname
15047 Revision='$Revision'
15054 alignbytes='$alignbytes'
15055 ansi2knr='$ansi2knr'
15056 aphostname='$aphostname'
15057 api_revision='$api_revision'
15058 api_subversion='$api_subversion'
15059 api_version='$api_version'
15060 api_versionstring='$api_versionstring'
15063 archlibexp='$archlibexp'
15064 archname64='$archname64'
15065 archname='$archname'
15066 archobjs='$archobjs'
15071 bincompat5005='$bincompat5005'
15075 byteorder='$byteorder'
15077 castflags='$castflags'
15080 cccdlflags='$cccdlflags'
15081 ccdlflags='$ccdlflags'
15083 ccsymbols='$ccsymbols'
15085 cf_email='$cf_email'
15087 charsize='$charsize'
15091 clocktype='$clocktype'
15093 compress='$compress'
15094 contains='$contains'
15098 cpp_stuff='$cpp_stuff'
15099 cppccsymbols='$cppccsymbols'
15100 cppflags='$cppflags'
15102 cppminus='$cppminus'
15104 cppstdin='$cppstdin'
15105 cppsymbols='$cppsymbols'
15106 crosscompile='$crosscompile'
15107 cryptlib='$cryptlib'
15109 d_Gconvert='$d_Gconvert'
15110 d_PRIEldbl='$d_PRIEldbl'
15111 d_PRIFldbl='$d_PRIFldbl'
15112 d_PRIGldbl='$d_PRIGldbl'
15113 d_PRIX64='$d_PRIX64'
15114 d_PRId64='$d_PRId64'
15115 d_PRIeldbl='$d_PRIeldbl'
15116 d_PRIfldbl='$d_PRIfldbl'
15117 d_PRIgldbl='$d_PRIgldbl'
15118 d_PRIi64='$d_PRIi64'
15119 d_PRIo64='$d_PRIo64'
15120 d_PRIu64='$d_PRIu64'
15121 d_PRIx64='$d_PRIx64'
15122 d_access='$d_access'
15123 d_accessx='$d_accessx'
15125 d_archlib='$d_archlib'
15128 d_attribut='$d_attribut'
15131 d_bincompat5005='$d_bincompat5005'
15133 d_bsdgetpgrp='$d_bsdgetpgrp'
15134 d_bsdsetpgrp='$d_bsdsetpgrp'
15136 d_casti32='$d_casti32'
15137 d_castneg='$d_castneg'
15138 d_charvspr='$d_charvspr'
15140 d_chroot='$d_chroot'
15141 d_chsize='$d_chsize'
15142 d_closedir='$d_closedir'
15146 d_cuserid='$d_cuserid'
15147 d_dbl_dig='$d_dbl_dig'
15148 d_difftime='$d_difftime'
15149 d_dirnamlen='$d_dirnamlen'
15150 d_dlerror='$d_dlerror'
15151 d_dlopen='$d_dlopen'
15152 d_dlsymun='$d_dlsymun'
15153 d_dosuid='$d_dosuid'
15154 d_drand48proto='$d_drand48proto'
15156 d_eaccess='$d_eaccess'
15157 d_endgrent='$d_endgrent'
15158 d_endhent='$d_endhent'
15159 d_endnent='$d_endnent'
15160 d_endpent='$d_endpent'
15161 d_endpwent='$d_endpwent'
15162 d_endsent='$d_endsent'
15163 d_endspent='$d_endspent'
15164 d_eofnblk='$d_eofnblk'
15165 d_eunice='$d_eunice'
15166 d_fchmod='$d_fchmod'
15167 d_fchown='$d_fchown'
15169 d_fd_macros='$d_fd_macros'
15170 d_fd_set='$d_fd_set'
15171 d_fds_bits='$d_fds_bits'
15172 d_fgetpos='$d_fgetpos'
15173 d_flexfnam='$d_flexfnam'
15176 d_fpathconf='$d_fpathconf'
15177 d_fpos64_t='$d_fpos64_t'
15178 d_fs_data_s='$d_fs_data_s'
15179 d_fseeko='$d_fseeko'
15180 d_fsetpos='$d_fsetpos'
15181 d_fstatfs='$d_fstatfs'
15182 d_fstatvfs='$d_fstatvfs'
15183 d_ftello='$d_ftello'
15185 d_getcwd='$d_getcwd'
15186 d_getfsstat='$d_getfsstat'
15187 d_getgrent='$d_getgrent'
15188 d_getgrps='$d_getgrps'
15189 d_gethbyaddr='$d_gethbyaddr'
15190 d_gethbyname='$d_gethbyname'
15191 d_gethent='$d_gethent'
15192 d_gethname='$d_gethname'
15193 d_gethostprotos='$d_gethostprotos'
15194 d_getlogin='$d_getlogin'
15195 d_getmnt='$d_getmnt'
15196 d_getmntent='$d_getmntent'
15197 d_getnbyaddr='$d_getnbyaddr'
15198 d_getnbyname='$d_getnbyname'
15199 d_getnent='$d_getnent'
15200 d_getnetprotos='$d_getnetprotos'
15201 d_getpbyname='$d_getpbyname'
15202 d_getpbynumber='$d_getpbynumber'
15203 d_getpent='$d_getpent'
15204 d_getpgid='$d_getpgid'
15205 d_getpgrp2='$d_getpgrp2'
15206 d_getpgrp='$d_getpgrp'
15207 d_getppid='$d_getppid'
15208 d_getprior='$d_getprior'
15209 d_getprotoprotos='$d_getprotoprotos'
15210 d_getpwent='$d_getpwent'
15211 d_getsbyname='$d_getsbyname'
15212 d_getsbyport='$d_getsbyport'
15213 d_getsent='$d_getsent'
15214 d_getservprotos='$d_getservprotos'
15215 d_getspent='$d_getspent'
15216 d_getspnam='$d_getspnam'
15217 d_gettimeod='$d_gettimeod'
15218 d_gnulibc='$d_gnulibc'
15219 d_grpasswd='$d_grpasswd'
15220 d_hasmntopt='$d_hasmntopt'
15224 d_inetaton='$d_inetaton'
15225 d_int64_t='$d_int64_t'
15226 d_isascii='$d_isascii'
15227 d_killpg='$d_killpg'
15228 d_lchown='$d_lchown'
15229 d_ldbl_dig='$d_ldbl_dig'
15231 d_locconv='$d_locconv'
15233 d_longdbl='$d_longdbl'
15234 d_longlong='$d_longlong'
15235 d_lseekproto='$d_lseekproto'
15237 d_madvise='$d_madvise'
15239 d_mbstowcs='$d_mbstowcs'
15240 d_mbtowc='$d_mbtowc'
15241 d_memchr='$d_memchr'
15242 d_memcmp='$d_memcmp'
15243 d_memcpy='$d_memcpy'
15244 d_memmove='$d_memmove'
15245 d_memset='$d_memset'
15247 d_mkdtemp='$d_mkdtemp'
15248 d_mkfifo='$d_mkfifo'
15249 d_mkstemp='$d_mkstemp'
15250 d_mkstemps='$d_mkstemps'
15251 d_mktime='$d_mktime'
15253 d_mprotect='$d_mprotect'
15255 d_msg_ctrunc='$d_msg_ctrunc'
15256 d_msg_dontroute='$d_msg_dontroute'
15257 d_msg_oob='$d_msg_oob'
15258 d_msg_peek='$d_msg_peek'
15259 d_msg_proxy='$d_msg_proxy'
15260 d_msgctl='$d_msgctl'
15261 d_msgget='$d_msgget'
15262 d_msgrcv='$d_msgrcv'
15263 d_msgsnd='$d_msgsnd'
15265 d_munmap='$d_munmap'
15266 d_mymalloc='$d_mymalloc'
15268 d_nv_preserves_uv='$d_nv_preserves_uv'
15269 d_off64_t='$d_off64_t'
15270 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
15271 d_oldpthreads='$d_oldpthreads'
15272 d_oldsock='$d_oldsock'
15274 d_pathconf='$d_pathconf'
15276 d_phostname='$d_phostname'
15279 d_portable='$d_portable'
15280 d_pthread_yield='$d_pthread_yield'
15282 d_pwchange='$d_pwchange'
15283 d_pwclass='$d_pwclass'
15284 d_pwcomment='$d_pwcomment'
15285 d_pwexpire='$d_pwexpire'
15286 d_pwgecos='$d_pwgecos'
15287 d_pwpasswd='$d_pwpasswd'
15288 d_pwquota='$d_pwquota'
15291 d_readdir='$d_readdir'
15292 d_readlink='$d_readlink'
15293 d_rename='$d_rename'
15294 d_rewinddir='$d_rewinddir'
15296 d_safebcpy='$d_safebcpy'
15297 d_safemcpy='$d_safemcpy'
15298 d_sanemcmp='$d_sanemcmp'
15299 d_sched_yield='$d_sched_yield'
15300 d_scm_rights='$d_scm_rights'
15301 d_seekdir='$d_seekdir'
15302 d_select='$d_select'
15304 d_semctl='$d_semctl'
15305 d_semctl_semid_ds='$d_semctl_semid_ds'
15306 d_semctl_semun='$d_semctl_semun'
15307 d_semget='$d_semget'
15309 d_setegid='$d_setegid'
15310 d_seteuid='$d_seteuid'
15311 d_setgrent='$d_setgrent'
15312 d_setgrps='$d_setgrps'
15313 d_sethent='$d_sethent'
15314 d_setlinebuf='$d_setlinebuf'
15315 d_setlocale='$d_setlocale'
15316 d_setnent='$d_setnent'
15317 d_setpent='$d_setpent'
15318 d_setpgid='$d_setpgid'
15319 d_setpgrp2='$d_setpgrp2'
15320 d_setpgrp='$d_setpgrp'
15321 d_setprior='$d_setprior'
15322 d_setpwent='$d_setpwent'
15323 d_setregid='$d_setregid'
15324 d_setresgid='$d_setresgid'
15325 d_setresuid='$d_setresuid'
15326 d_setreuid='$d_setreuid'
15327 d_setrgid='$d_setrgid'
15328 d_setruid='$d_setruid'
15329 d_setsent='$d_setsent'
15330 d_setsid='$d_setsid'
15331 d_setspent='$d_setspent'
15332 d_setvbuf='$d_setvbuf'
15336 d_shmatprototype='$d_shmatprototype'
15337 d_shmctl='$d_shmctl'
15339 d_shmget='$d_shmget'
15340 d_sigaction='$d_sigaction'
15341 d_sigsetjmp='$d_sigsetjmp'
15342 d_socket='$d_socket'
15343 d_socklen_t='$d_socklen_t'
15344 d_sockpair='$d_sockpair'
15346 d_statblks='$d_statblks'
15347 d_statfs_f_flags='$d_statfs_f_flags'
15348 d_statfs_s='$d_statfs_s'
15349 d_statvfs='$d_statvfs'
15350 d_stdio_cnt_lval='$d_stdio_cnt_lval'
15351 d_stdio_ptr_lval='$d_stdio_ptr_lval'
15352 d_stdio_stream_array='$d_stdio_stream_array'
15353 d_stdiobase='$d_stdiobase'
15354 d_stdstdio='$d_stdstdio'
15355 d_strchr='$d_strchr'
15356 d_strcoll='$d_strcoll'
15357 d_strctcpy='$d_strctcpy'
15358 d_strerrm='$d_strerrm'
15359 d_strerror='$d_strerror'
15360 d_strtod='$d_strtod'
15361 d_strtol='$d_strtol'
15362 d_strtold='$d_strtold'
15363 d_strtoll='$d_strtoll'
15364 d_strtoul='$d_strtoul'
15365 d_strtoull='$d_strtoull'
15366 d_strtouq='$d_strtouq'
15367 d_strxfrm='$d_strxfrm'
15368 d_suidsafe='$d_suidsafe'
15369 d_symlink='$d_symlink'
15370 d_syscall='$d_syscall'
15371 d_sysconf='$d_sysconf'
15372 d_sysernlst='$d_sysernlst'
15373 d_syserrlst='$d_syserrlst'
15374 d_system='$d_system'
15375 d_tcgetpgrp='$d_tcgetpgrp'
15376 d_tcsetpgrp='$d_tcsetpgrp'
15377 d_telldir='$d_telldir'
15378 d_telldirproto='$d_telldirproto'
15381 d_truncate='$d_truncate'
15382 d_tzname='$d_tzname'
15385 d_union_semun='$d_union_semun'
15387 d_vendorarch='$d_vendorarch'
15388 d_vendorbin='$d_vendorbin'
15389 d_vendorlib='$d_vendorlib'
15391 d_void_closedir='$d_void_closedir'
15392 d_voidsig='$d_voidsig'
15393 d_voidtty='$d_voidtty'
15394 d_volatile='$d_volatile'
15395 d_vprintf='$d_vprintf'
15397 d_waitpid='$d_waitpid'
15398 d_wcstombs='$d_wcstombs'
15399 d_wctomb='$d_wctomb'
15402 db_hashtype='$db_hashtype'
15403 db_prefixtype='$db_prefixtype'
15404 defvoidused='$defvoidused'
15405 direntrytype='$direntrytype'
15408 doublesize='$doublesize'
15410 dynamic_ext='$dynamic_ext'
15416 eunicefix='$eunicefix'
15419 extensions='$extensions'
15420 fflushNULL='$fflushNULL'
15421 fflushall='$fflushall'
15423 firstmakefile='$firstmakefile'
15425 fpossize='$fpossize'
15426 fpostype='$fpostype'
15427 freetype='$freetype'
15429 full_csh='$full_csh'
15430 full_sed='$full_sed'
15431 gccversion='$gccversion'
15432 gidformat='$gidformat'
15438 groupcat='$groupcat'
15439 groupstype='$groupstype'
15442 h_sysfile='$h_sysfile'
15454 i_arpainet='$i_arpainet'
15455 i_bsdioctl='$i_bsdioctl'
15458 i_dirent='$i_dirent'
15466 i_ieeefp='$i_ieeefp'
15467 i_inttypes='$i_inttypes'
15468 i_limits='$i_limits'
15469 i_locale='$i_locale'
15470 i_machcthr='$i_machcthr'
15471 i_malloc='$i_malloc'
15473 i_memory='$i_memory'
15474 i_mntent='$i_mntent'
15477 i_neterrno='$i_neterrno'
15478 i_netinettcp='$i_netinettcp'
15481 i_pthread='$i_pthread'
15483 i_rpcsvcdbm='$i_rpcsvcdbm'
15486 i_shadow='$i_shadow'
15488 i_stdarg='$i_stdarg'
15489 i_stddef='$i_stddef'
15490 i_stdlib='$i_stdlib'
15491 i_string='$i_string'
15492 i_sunmath='$i_sunmath'
15493 i_sysaccess='$i_sysaccess'
15494 i_sysdir='$i_sysdir'
15495 i_sysfile='$i_sysfile'
15496 i_sysfilio='$i_sysfilio'
15498 i_sysioctl='$i_sysioctl'
15499 i_syslog='$i_syslog'
15500 i_sysmman='$i_sysmman'
15501 i_sysmode='$i_sysmode'
15502 i_sysmount='$i_sysmount'
15503 i_sysndir='$i_sysndir'
15504 i_sysparam='$i_sysparam'
15505 i_sysresrc='$i_sysresrc'
15506 i_syssecrt='$i_syssecrt'
15507 i_sysselct='$i_sysselct'
15508 i_syssockio='$i_syssockio'
15509 i_sysstat='$i_sysstat'
15510 i_sysstatfs='$i_sysstatfs'
15511 i_sysstatvfs='$i_sysstatvfs'
15512 i_systime='$i_systime'
15513 i_systimek='$i_systimek'
15514 i_systimes='$i_systimes'
15515 i_systypes='$i_systypes'
15516 i_sysuio='$i_sysuio'
15518 i_sysutsname='$i_sysutsname'
15519 i_sysvfs='$i_sysvfs'
15520 i_syswait='$i_syswait'
15521 i_termio='$i_termio'
15522 i_termios='$i_termios'
15524 i_unistd='$i_unistd'
15527 i_values='$i_values'
15528 i_varargs='$i_varargs'
15529 i_varhdr='$i_varhdr'
15531 ignore_versioned_solibs='$ignore_versioned_solibs'
15532 inc_version_list='$inc_version_list'
15533 inc_version_list_init='$inc_version_list_init'
15536 installarchlib='$installarchlib'
15537 installbin='$installbin'
15538 installman1dir='$installman1dir'
15539 installman3dir='$installman3dir'
15540 installprefix='$installprefix'
15541 installprefixexp='$installprefixexp'
15542 installprivlib='$installprivlib'
15543 installscript='$installscript'
15544 installsitearch='$installsitearch'
15545 installsitebin='$installsitebin'
15546 installsitelib='$installsitelib'
15547 installstyle='$installstyle'
15548 installusrbinperl='$installusrbinperl'
15549 installvendorarch='$installvendorarch'
15550 installvendorbin='$installvendorbin'
15551 installvendorlib='$installvendorlib'
15553 ivdformat='$ivdformat'
15556 known_extensions='$known_extensions'
15560 lddlflags='$lddlflags'
15562 ldlibpthname='$ldlibpthname'
15569 libsdirs='$libsdirs'
15570 libsfiles='$libsfiles'
15571 libsfound='$libsfound'
15572 libspath='$libspath'
15573 libswanted='$libswanted'
15579 locincpth='$locincpth'
15580 loclibpth='$loclibpth'
15581 longdblsize='$longdblsize'
15582 longlongsize='$longlongsize'
15583 longsize='$longsize'
15587 lseeksize='$lseeksize'
15588 lseektype='$lseektype'
15592 make_set_make='$make_set_make'
15593 mallocobj='$mallocobj'
15594 mallocsrc='$mallocsrc'
15595 malloctype='$malloctype'
15597 man1direxp='$man1direxp'
15600 man3direxp='$man3direxp'
15603 mips_type='$mips_type'
15605 mmaptype='$mmaptype'
15607 modetype='$modetype'
15609 multiarch='$multiarch'
15611 myarchname='$myarchname'
15612 mydomain='$mydomain'
15613 myhostname='$myhostname'
15616 netdb_hlen_type='$netdb_hlen_type'
15617 netdb_host_type='$netdb_host_type'
15618 netdb_name_type='$netdb_name_type'
15619 netdb_net_type='$netdb_net_type'
15622 nm_so_opt='$nm_so_opt'
15623 nonxs_ext='$nonxs_ext'
15627 o_nonblock='$o_nonblock'
15629 old_pthread_create_joinable='$old_pthread_create_joinable'
15630 optimize='$optimize'
15631 orderlib='$orderlib'
15637 patchlevel='$patchlevel'
15638 path_sep='$path_sep'
15641 perladmin='$perladmin'
15642 perlpath='$perlpath'
15644 phostname='$phostname'
15647 pm_apiversion='$pm_apiversion'
15651 prefixexp='$prefixexp'
15653 privlibexp='$privlibexp'
15654 prototype='$prototype'
15656 quadkind='$quadkind'
15657 quadtype='$quadtype'
15658 randbits='$randbits'
15659 randfunc='$randfunc'
15660 randseedtype='$randseedtype'
15662 rd_nodata='$rd_nodata'
15663 revision='$revision'
15667 sPRIEldbl='$sPRIEldbl'
15668 sPRIFldbl='$sPRIFldbl'
15669 sPRIGldbl='$sPRIGldbl'
15672 sPRIeldbl='$sPRIeldbl'
15673 sPRIfldbl='$sPRIfldbl'
15674 sPRIgldbl='$sPRIgldbl'
15679 sched_yield='$sched_yield'
15680 scriptdir='$scriptdir'
15681 scriptdirexp='$scriptdirexp'
15683 seedfunc='$seedfunc'
15684 selectminbits='$selectminbits'
15685 selecttype='$selecttype'
15686 sendmail='$sendmail'
15689 sharpbang='$sharpbang'
15690 shmattype='$shmattype'
15691 shortsize='$shortsize'
15694 sig_count='$sig_count'
15695 sig_name='$sig_name'
15696 sig_name_init='$sig_name_init'
15698 sig_num_init='$sig_num_init'
15699 signal_t='$signal_t'
15700 sitearch='$sitearch'
15701 sitearchexp='$sitearchexp'
15703 sitebinexp='$sitebinexp'
15705 sitelib_stem='$sitelib_stem'
15706 sitelibexp='$sitelibexp'
15707 siteprefix='$siteprefix'
15708 siteprefixexp='$siteprefixexp'
15709 sizesize='$sizesize'
15710 sizetype='$sizetype'
15715 sockethdr='$sockethdr'
15716 socketlib='$socketlib'
15717 socksizetype='$socksizetype'
15719 spackage='$spackage'
15720 spitshell='$spitshell'
15723 ssizetype='$ssizetype'
15724 startperl='$startperl'
15726 static_ext='$static_ext'
15728 stdio_base='$stdio_base'
15729 stdio_bufsiz='$stdio_bufsiz'
15730 stdio_cnt='$stdio_cnt'
15731 stdio_filbuf='$stdio_filbuf'
15732 stdio_ptr='$stdio_ptr'
15733 stdio_stream_array='$stdio_stream_array'
15736 subversion='$subversion'
15743 timeincl='$timeincl'
15744 timetype='$timetype'
15757 uidformat='$uidformat'
15763 uquadtype='$uquadtype'
15764 use5005threads='$use5005threads'
15765 use64bitall='$use64bitall'
15766 use64bitint='$use64bitint'
15768 useithreads='$useithreads'
15769 uselargefiles='$uselargefiles'
15770 uselongdouble='$uselongdouble'
15771 usemorebits='$usemorebits'
15772 usemultiplicity='$usemultiplicity'
15773 usemymalloc='$usemymalloc'
15775 useopcode='$useopcode'
15776 useperlio='$useperlio'
15777 useposix='$useposix'
15779 useshrplib='$useshrplib'
15780 usesocks='$usesocks'
15781 usethreads='$usethreads'
15782 usevendorprefix='$usevendorprefix'
15783 usevfork='$usevfork'
15786 uvoformat='$uvoformat'
15789 uvuformat='$uvuformat'
15790 uvxformat='$uvxformat'
15791 vendorarch='$vendorarch'
15792 vendorarchexp='$vendorarchexp'
15793 vendorbin='$vendorbin'
15794 vendorbinexp='$vendorbinexp'
15795 vendorlib='$vendorlib'
15796 vendorlib_stem='$vendorlib_stem'
15797 vendorlibexp='$vendorlibexp'
15798 vendorprefix='$vendorprefix'
15799 vendorprefixexp='$vendorprefixexp'
15802 voidflags='$voidflags'
15804 xs_apiversion='$xs_apiversion'
15809 : Add in command line options if available
15810 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
15812 : add special variables
15813 $test -f $src/patchlevel.h && \
15814 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
15815 echo "CONFIGDOTSH=true" >>config.sh
15817 : propagate old symbols
15818 if $test -f UU/config.sh; then
15819 <UU/config.sh sort | uniq >UU/oldconfig.sh
15820 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
15821 sort | uniq -u >UU/oldsyms
15822 set X `cat UU/oldsyms`
15828 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
15830 echo "# Variables propagated from previous config.sh file." >>config.sh
15831 for sym in `cat UU/oldsyms`; do
15832 echo " Propagating $hint variable "'$'"$sym..."
15833 eval 'tmp="$'"${sym}"'"'
15835 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
15841 : Finish up by extracting the .SH files
15855 If you'd like to make any changes to the config.sh file before I begin
15856 to configure things, do it as a shell escape now (e.g. !vi config.sh).
15859 rp="Press return or use a shell escape to edit config.sh:"
15864 *) : in case they cannot read
15865 sh 1>&4 -c "$ans";;
15870 : if this fails, just run all the .SH files by hand
15877 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
15884 Now you need to generate make dependencies by running "$make depend".
15885 You might prefer to run it in background: "$make depend > makedepend.out &"
15886 It can take a while, so you might not want to run it right now.
15891 rp="Run $make depend now?"
15895 $make depend && echo "Now you must run a $make."
15898 echo "You must run '$make depend' then '$make'."
15901 elif test -f [Mm]akefile; then
15903 echo "Now you must run a $make."
15908 if $test -f Policy.sh; then
15911 If you compile $package on a different machine or from a different object
15912 directory, copy the Policy.sh file from this object directory to the
15913 new one before you run Configure -- this will help you with most of
15914 the policy defaults.
15918 if $test -f config.msg; then
15919 echo "Hmm. I also noted the following information while running:"
15921 $cat config.msg >&4
15924 $rm -f kit*isdone ark*isdone