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 Jan 4 21:51:16 EET 2001 [metaconfig 3.0 PL70]
24 # (with additional metaconfig patches by perlbug@perl.org)
29 SCO csh still thinks true is false. Write to SCO today and tell them that next
30 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
32 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
33 we'd have to do is go in and swap the && and || tokens, wherever they are.)
35 [End of diatribe. We now return you to your regularly scheduled programming...]
39 OOPS! You naughty creature! You didn't run Configure with sh!
40 I will attempt to remedy the situation by running sh for you...
44 true || exec sh $0 $argv:q
46 (exit $?0) || cat c2$$
47 (exit $?0) || exec sh $0 $argv:q
50 : compute my invocation name
54 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
59 : Proper separator for the PATH environment variable
61 : On OS/2 this directory should exist if this is not floppy only system :-]
62 if test -d c:/. ; then
63 if test -n "$OS2_SHELL"; then
65 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
66 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
67 elif test -n "$DJGPP"; then
73 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
74 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
75 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
76 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
77 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
78 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /usr/ccs/bin"
79 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
80 paths="$paths /sbin /usr/sbin /usr/libexec"
86 *) test -d $p && PATH=$PATH$p_$p ;;
93 : shall we be using ksh?
99 if (PATH=.; alias -x) >/dev/null 2>&1; then
102 if test -f /hp-ux -a -f /bin/ksh; then
103 needksh='to avoid sh bug in "here document" expansion'
105 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
106 if test X`/usr/bin/uname -v` = X4; then
107 avoidksh="to avoid AIX 4's /bin/sh"
111 if test -f /osf_boot -a -f /usr/sbin/setld; then
112 if test X`/usr/bin/uname -s` = XOSF1; then
113 avoidksh="to avoid Digital UNIX' ksh"
115 unset BIN_SH # if this is 'xpg4' sh will start up ksh
118 case "$inksh/$needksh" in
125 case "$inksh/$avoidksh" in
131 case "$inksh/$needksh-$avoidksh-" in
134 (I see you are using the Korn shell. Some ksh's blow up on $me,
135 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
141 echo "(Feeding myself to $newsh $reason.)"
143 Configure|*/Configure) exec $newsh $0 "$@";;
144 *) exec $newsh Configure "$@";;
151 *) sh_c="$newsh -c" ;;
154 : if needed set CDPATH to a harmless value that is not chatty
155 : avoid bash 2.02 problems with empty CDPATH.
159 *bash*) CDPATH='.' ;;
164 : Configure runs within the UU subdirectory
165 test -d UU || mkdir UU
471 d_old_pthread_create_joinable=''
472 old_pthread_create_joinable=''
550 d_stdio_ptr_lval_nochange_cnt=''
551 d_stdio_ptr_lval_sets_cnt=''
723 inc_version_list_init=''
742 ignore_versioned_solibs=''
801 d_perl_otherlibdirs=''
818 d_nv_preserves_uv_bits=''
916 d_stdio_stream_array=''
917 stdio_stream_array=''
927 ccflags_uselargefiles=''
928 ldflags_uselargefiles=''
929 libswanted_uselargefiles=''
972 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
975 : We must find out about Eunice early
977 if test -f /etc/unixtovms; then
978 eunicefix=/etc/unixtovms
980 if test -f /etc/unixtovms.exe; then
981 eunicefix=/etc/unixtovms.exe
988 : set useposix=false in your hint file to disable the POSIX extension.
990 : set useopcode=false in your hint file to disable the Opcode extension.
992 : Trailing extension. Override this in a hint file, if needed.
994 : Extra object files, if any, needed on this platform.
997 : Possible local include directories to search.
998 : Set locincpth to "" in a hint file to defeat local include searches.
999 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1000 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1002 : no include file wanted by default
1006 : change the next line if compiling for Xenix/286 on Xenix/386
1007 xlibpth='/usr/lib/386 /lib/386'
1008 : Possible local library directories to search.
1009 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1010 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1012 : general looking path for locating libraries
1013 glibpth="/lib /usr/lib $xlibpth"
1014 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1015 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1016 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1018 : Private path used by Configure to find libraries. Its value
1019 : is prepended to libpth. This variable takes care of special
1020 : machines, like the mips. Usually, it should be empty.
1023 : default library list
1025 : some systems want to use only the non-versioned libso:s
1026 ignore_versioned_solibs=''
1028 ccflags_uselargefiles=''
1029 ldflags_uselargefiles=''
1030 libswanted_uselargefiles=''
1031 : set usemultiplicity on the Configure command line to enable multiplicity.
1032 : set usesocks on the Configure command line to enable socks.
1033 : set usethreads on the Configure command line to enable threads.
1034 : full support for void wanted by default
1037 : List of libraries we want.
1038 : If anyone needs -lnet, put it in a hint file.
1039 libswanted='sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl'
1040 libswanted="$libswanted dld ld sun m c cposix posix"
1041 libswanted="$libswanted ndir dir crypt sec"
1042 libswanted="$libswanted ucb bsd BSD PW x iconv util"
1043 : We probably want to search /usr/shlib before most other libraries.
1044 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1045 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1046 glibpth="/usr/shlib $glibpth"
1047 : Do not use vfork unless overridden by a hint file.
1050 : Find the basic shell for Bourne shell scripts
1054 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1057 if test -f "$xxx"; then
1060 : Build up a list and do a single loop so we can 'break' out.
1061 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1062 for xxx in sh bash ksh pdksh ash; do
1064 try="$try ${p}/${xxx}"
1068 if test -f "$xxx"; then
1071 elif test -f "$xxx.exe"; then
1082 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1084 Usually it's in /bin/sh. How did you even get this far?
1085 Please contact me (Perl Maintainers) at perlbug@perl.org and
1086 we'll try to straighten this all out.
1092 : see if sh knows # comments
1093 if `$sh_c '#' >/dev/null 2>&1`; then
1097 test -f $xcat || xcat=/usr/bin/cat
1102 if test -s today; then
1105 echo "#! $xcat" > try
1109 if test -s today; then
1117 echo "Your $sh doesn't grok # comments--I will strip them later on."
1120 echo "exec grep -v '^[ ]*#'" >spitshell
1122 $eunicefix spitshell
1123 spitshell=`pwd`/spitshell
1125 echo "I presume that if # doesn't work, #! won't work either!"
1130 : figure out how to guarantee sh startup
1132 '') startsh=${sharpbang}${sh} ;;
1144 : echo "Yup, it does."
1146 echo "Hmm... '$startsh' does not guarantee sh startup..."
1147 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1152 : Save command line options in file UU/cmdline.opt for later use in
1153 : generating config.sh.
1154 cat > cmdline.opt <<EOSH
1155 # Configure command line arguments.
1162 cat >>cmdline.opt <<EOSH
1163 config_arg$argn='$arg'
1165 argn=`expr $argn + 1`
1168 : produce awk script to parse command line options
1169 cat >options.awk <<'EOF'
1171 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1173 len = length(optstr);
1174 for (i = 1; i <= len; i++) {
1175 c = substr(optstr, i, 1);
1176 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1187 if (substr(str, 1, 1) != "-") {
1188 printf("'%s'\n", str);
1192 for (i = 2; i <= len; i++) {
1193 c = substr(str, i, 1);
1195 printf("-%s\n", substr(str, i));
1201 printf("'%s'\n", substr(str, i + 1));
1214 : process the command line options
1215 set X `for arg in "$@"; do echo "X$arg"; done |
1216 sed -e s/X// | awk -f options.awk`
1221 : set up default values
1231 rm -f optdef.sh posthint.sh
1232 cat >optdef.sh <<EOS
1238 while test $# -gt 0; do
1240 -d) shift; fastread=yes;;
1241 -e) shift; alldone=cont;;
1245 if test -r "$1"; then
1248 echo "$me: cannot read config file $1." >&2
1253 -h) shift; error=true;;
1254 -r) shift; reuseval=true;;
1255 -s) shift; silent=true; realsilent=true;;
1256 -E) shift; alldone=exit;;
1257 -K) shift; knowitall=true;;
1258 -O) shift; override=true;;
1259 -S) shift; silent=true; extractsh=true;;
1264 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1265 echo "$me: ignoring -D $1" >&2
1268 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1269 *) echo "$1='define'" >> optdef.sh;;
1276 *=) echo "$1" >> optdef.sh;;
1278 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1279 echo "$me: ignoring -U $1" >&2
1281 *) echo "$1='undef'" >> optdef.sh;;
1292 *=*) zzz=`echo $yyy|sed 's!=.*!!'`
1296 zzz=" "`echo $yyy|sed 's!^[^=]*=!!'`
1297 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1303 *:*) xxx=`echo $yyy|sed 's!:.*!!'`
1304 yyy=`echo $yyy|sed 's!^[^:]*:!!'`
1305 zzz=`echo $yyy|sed 's!^[^=]*=!!'`
1306 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1307 *) xxx=`echo $yyy|sed 's!:.*!!'`
1308 yyy=`echo $yyy|sed 's!^[^:]*:!!'` ;;
1314 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1316 echo "$yyy=''" >> posthint.sh ;;
1321 echo "$yyy='$zzz'" >> posthint.sh ;;
1323 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1325 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1330 echo "$yyy=$zzz" >> posthint.sh ;;
1331 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1335 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1338 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1346 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1347 [-U symbol] [-U symbol=] [-A command:symbol...]
1348 -d : use defaults for all answers.
1349 -e : go on without questioning past the production of config.sh.
1350 -f : specify an alternate default configuration file.
1351 -h : print this help message and exit (with an error status).
1352 -r : reuse C symbols value if possible (skips costly nm extraction).
1353 -s : silent mode, only echoes questions and essential information.
1354 -D : define symbol to have some value:
1355 -D symbol symbol gets the value 'define'
1356 -D symbol=value symbol gets the value 'value'
1357 -E : stop at the end of questions, after having produced config.sh.
1358 -K : do not use unless you know what you are doing.
1359 -O : let -D and -U override definitions from loaded configuration file.
1360 -S : perform variable substitutions on all .SH files (can mix with -f)
1361 -U : undefine symbol:
1362 -U symbol symbol gets the value 'undef'
1363 -U symbol= symbol gets completely empty
1364 -A : manipulate symbol after the platform specific hints have been applied:
1365 -A symbol=value append " "value to symbol
1366 -A append:symbol=value append value to symbol
1367 -A define:symbol=value define symbol to have value
1368 -A clear:symbol define symbol to be ''
1369 -A define:symbol define symbol to be 'define'
1370 -A eval:symbol=value define symbol to be eval of value
1371 -A prepend:symbol=value prepend value to symbol
1372 -A undef:symbol define symbol to be 'undef'
1373 -A undef:symbol= define symbol to be ''
1374 -V : print version number and exit (with a zero status).
1381 case "$fastread$alldone" in
1384 case "$extractsh" in
1387 if test ! -t 0; then
1388 echo "Say 'sh Configure', not 'sh <Configure'"
1398 true) exec 1>/dev/null;;
1401 : run the defines and the undefines, if any, but leave the file out there...
1404 : create the posthint manipulation script and leave the file out there...
1409 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1410 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1411 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1412 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1413 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1416 : Some greps do not return status, grrr.
1417 echo "grimblepritz" >grimble
1418 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1420 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1426 : the following should work in any shell
1430 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1431 cat >contains <<'EOSS'
1432 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1437 : Find the path to the source tree
1440 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1443 *) src=`cd ../$src && pwd` ;;
1456 if test -f $rsrc/Configure && \
1457 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1459 : found it, so we are ok.
1462 for src in . .. ../.. ../../.. ../../../..; do
1463 if test -f ../$src/Configure && \
1464 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1475 Sorry, I can't seem to locate the source dir for $package. Please start
1476 Configure with an explicit path -- i.e. /some/path/Configure.
1484 echo "Sources for $package found in \"$src\"." >&4
1488 : script used to extract .SH files with variable substitutions
1489 cat >extract <<'EOS'
1491 echo "Doing variable substitutions on .SH files..."
1492 if test -f $src/MANIFEST; then
1493 set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH$'`
1495 echo "(Looking for .SH files under the source directory.)"
1496 set x `(cd $src; find . -name "*.SH" -print)`
1500 0) set x `(cd $src; echo *.SH)`; shift;;
1502 if test ! -f $src/$1; then
1508 while test $name; do
1509 if test ! -d "$name"; then
1510 create="$name $create";
1511 name=`echo $name | sed -e "s|^[^/]*$||"`;
1512 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1517 for file in $create; do
1526 dir=`expr X$file : 'X\(.*\)/'`
1527 file=`expr X$file : 'X.*/\(.*\)'`
1528 (cd $dir && . ./$file)
1538 dir=`expr X$file : 'X\(.*\)/'`
1539 file=`expr X$file : 'X.*/\(.*\)'`
1540 (set x $dir; shift; eval $mkdir_p)
1550 if test -f $src/config_h.SH; then
1551 if test ! -f config.h; then
1552 : oops, they left it out of MANIFEST, probably, so do it anyway.
1558 : extract files and exit if asked to do so
1559 case "$extractsh" in
1561 case "$realsilent" in
1565 case "$config_sh" in
1566 '') config_sh='config.sh';;
1569 echo "Fetching answers from $config_sh..."
1572 test "$override" && . ./optdef.sh
1581 : Eunice requires " " instead of "", can you believe it
1584 echo "Beginning of configuration questions for $package."
1586 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1588 : first determine how to suppress newline on echo command
1590 echo "Checking echo to see how to suppress newlines..."
1591 (echo "hi there\c" ; echo " ") >.echotmp
1592 if $contains c .echotmp >/dev/null 2>&1 ; then
1603 echo $n "The star should be here-->$c"
1607 : Now test for existence of everything in MANIFEST
1609 if test -f $rsrc/MANIFEST; then
1610 echo "First let's make sure your kit is complete. Checking..." >&4
1611 awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
1614 for filelist in x??; do
1615 (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
1617 if test -s missing; then
1621 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1623 You have the option of continuing the configuration process, despite the
1624 distinct possibility that your kit is damaged, by typing 'y'es. If you
1625 do, don't blame me if something goes wrong. I advise you to type 'n'o
1626 and contact the author (perlbug@perl.org).
1629 echo $n "Continue? [n] $c" >&4
1633 echo "Continuing..." >&4
1637 echo "ABORTING..." >&4
1642 echo "Looks good..."
1645 echo "There is no MANIFEST file. I hope your kit is complete !"
1650 : Find the appropriate value for a newline for tr
1651 if test -n "$DJGPP"; then
1654 if test X"$trnl" = X; then
1655 case "`echo foo|tr '\n' x 2>/dev/null`" in
1659 if test X"$trnl" = X; then
1660 case "`echo foo|tr '\012' x 2>/dev/null`" in
1661 foox) trnl='\012' ;;
1664 if test X"$trnl" = X; then
1667 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1673 : compute the number of columns on the terminal for proper question formatting
1678 : set up the echo used in my read
1679 myecho="case \"\$xxxm\" in
1680 '') echo $n \"\$rp $c\" >&4;;
1682 '') echo $n \"[\$xxxm] $c\";;
1684 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1686 echo $n \"[\$xxxm] $c\" >&4
1688 echo $n \"\$rp [\$xxxm] $c\" >&4
1694 : now set up to do reads with possible shell escape and default assignment
1700 case "\$fastread" in
1701 yes) case "\$dflt" in
1704 case "\$silent-\$rp" in
1709 *) case "\$silent" in
1710 true) case "\$rp" in
1715 while expr "X\$ans" : "X!" >/dev/null; do
1719 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1727 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1736 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1741 echo "(OK, I'll run with -d after this question.)" >&4
1744 echo "*** Sorry, \$1 not supported yet." >&4
1754 echo "*** Substitution done -- please confirm."
1756 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1761 echo "*** Error -- try again."
1768 case "\$ans\$xxxm\$nostick" in
1780 : create .config dir to save info across Configure sessions
1781 test -d ../.config || mkdir ../.config
1782 cat >../.config/README <<EOF
1783 This directory created by Configure to save information that should
1784 persist across sessions for $package.
1786 You may safely delete it if you wish.
1789 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
1791 $define|true|[yY]*) ;;
1792 *) case "$xversion" in
1795 *** WHOA THERE!!! ***
1797 This is an UNSTABLE DEVELOPMENT release.
1798 The version of this $package distribution is $xversion, that is, odd,
1799 (as opposed to even) and that signifies a development release.
1800 If you want a maintenance release, you want an even-numbered version.
1802 Do ***NOT*** install this into production use.
1803 Data corruption and crashes are possible.
1805 It is most seriously suggested that you do not continue any further
1806 unless you want to help in developing and debugging Perl.
1809 rp='Do you really want to continue?'
1813 [yY]) echo >&4 "Okay, continuing." ;;
1814 *) echo >&4 "Okay, bye."
1823 : general instructions
1826 user=`(logname) 2>/dev/null`
1828 '') user=`whoami 2>&1`;;
1830 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1833 rp='Would you like to see the instructions?'
1844 This installation shell script will examine your system and ask you questions
1845 to determine how the perl5 package should be installed. If you get
1846 stuck on a question, you may use a ! shell escape to start a subshell or
1847 execute a command. Many of the questions will have default answers in square
1848 brackets; typing carriage return will give you the default.
1850 On some of the questions which ask for file or directory names you are allowed
1851 to use the ~name construct to specify the login directory belonging to "name",
1852 even if you don't have a shell which knows about that. Questions where this is
1853 allowed will be marked "(~name ok)".
1857 dflt='Type carriage return to continue'
1861 The prompter used in this script allows you to use shell variables and
1862 backticks in your answers. You may use $1, $2, etc... to refer to the words
1863 in the default answer, as if the default line was a set of arguments given to a
1864 script shell. This means you may also use $* to repeat the whole default line,
1865 so you do not have to re-type everything to add something to the default.
1867 Everytime there is a substitution, you will have to confirm. If there is an
1868 error (e.g. an unmatched backtick), the default answer will remain unchanged
1869 and you will be prompted again.
1871 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1872 the questions and use the computed defaults (or the previous answers if there
1873 was already a config.sh file). Type 'Configure -h' for a list of options.
1874 You may also start interactively and then answer '& -d' at any prompt to turn
1875 on the non-interactive behaviour for the remainder of the execution.
1881 Much effort has been expended to ensure that this shell script will run on any
1882 Unix system. If despite that it blows up on yours, your best bet is to edit
1883 Configure and run it again. If you can't run Configure for some reason,
1884 you'll have to generate a config.sh file by hand. Whatever problems you
1885 have, let me (perlbug@perl.org) know how I blew it.
1887 This installation script affects things in two ways:
1889 1) it may do direct variable substitutions on some of the files included
1891 2) it builds a config.h file for inclusion in C programs. You may edit
1892 any of these files as the need arises after running this script.
1894 If you make a mistake on a question, there is no easy way to back up to it
1895 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1896 files. Configure will offer to let you do this before it runs the SH files.
1899 dflt='Type carriage return to continue'
1901 case "$firsttime" in
1902 true) echo $user >>../.config/instruct;;
1906 : find out where common programs are
1908 echo "Locating common programs..." >&4
1921 if test -d \$dir/\$thing; then
1927 for thisthing in \$dir/\$thing; do
1928 : just loop through to pick last item
1930 if test -f \$thisthing; then
1933 elif test -f \$dir/\$thing.exe; then
1934 if test -n "$DJGPP"; then
1935 echo \$dir/\$thing.exe
1937 : on Eunice apparently
1987 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1988 pth="$pth /lib /usr/lib"
1989 for file in $loclist; do
1993 if test -f "$xxx"; then
1996 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1997 xxx=`./loc $file $file $pth`
2000 '') xxx=`./loc $file $file $pth`;;
2001 *) xxx=`./loc $xxx $xxx $pth`;;
2007 echo $file is in $xxx.
2010 echo $file is in $xxx.
2013 echo "I don't know where '$file' is, and my life depends on it." >&4
2014 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2020 echo "Don't worry if any of the following aren't found..."
2022 for file in $trylist; do
2026 if test -f "$xxx"; then
2029 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2030 xxx=`./loc $file $file $pth`
2033 '') xxx=`./loc $file $file $pth`;;
2034 *) xxx=`./loc $xxx $xxx $pth`;;
2040 echo $file is in $xxx.
2043 echo $file is in $xxx.
2046 echo "I don't see $file out there, $say."
2053 echo "Substituting grep for egrep."
2059 echo "Substituting cp for ln."
2065 echo "Hopefully test is built into your sh."
2068 if `$sh_c "PATH= test true" >/dev/null 2>&1`; then
2069 echo "Using the test built into your sh."
2070 echo "Using the test built into your sh."
2078 echo "Hopefully echo is built into your sh."
2083 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2084 $echo $n "hi there$c" >foo1
2085 echo $n "hi there$c" >foo2
2086 if cmp foo1 foo2 >/dev/null 2>&1; then
2087 echo "They are compatible. In fact, they may be identical."
2094 They are not compatible! You are probably running ksh on a non-USG system.
2095 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2096 have echo built in and we may have to run some Bourne shell scripts. That
2097 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2100 $echo $n "The star should be here-->$c"
2110 cat <<'EOSC' >>checkcc
2115 int main(int argc, char *argv[]) {
2119 if $cc -o try $ccflags try.c; then
2122 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2128 case "`$cc -v -c try.c 2>&1`" in
2131 if $test X"$trygcc" = Xyes; then
2132 if gcc -o try -c try.c; then
2134 echo "You seem to have a working gcc, though." >&4
2135 rp="Would you like to use it?"
2137 if $test -f myread; then
2140 if $test -f UU/myread; then
2143 echo "Cannot find myread, sorry. Aborting." >&2
2148 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no ;;
2152 if $test X"$despair" = Xyes; then
2154 You need to find a working C compiler.
2155 Either (purchase and) install the C compiler supplied by your OS vendor,
2156 or for a free C compiler try http://gcc.gnu.org/
2157 I cannot continue any further, aborting.
2167 : determine whether symbolic links are supported
2170 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2171 echo "Symbolic links are supported." >&4
2174 echo "Symbolic links are NOT supported." >&4
2179 : determine whether symbolic links are supported
2183 echo "Checking how to test for symbolic links..." >&4
2185 if $test "X$issymlink" = X; then
2186 $sh_c "PATH= test -h sym" >/dev/null 2>&1
2187 if test $? = 0; then
2191 if $test "X$issymlink" = X; then
2192 $sh_c "$test -h sym" >/dev/null 2>&1
2193 if test $? = 0; then
2194 issymlink="$test -h"
2195 echo "Your builtin 'test -h' may be broken, I'm using external '$test -h'." >&4
2198 if $test "X$issymlink" = X; then
2199 if $test -L sym 2>/dev/null; then
2200 issymlink="$test -L"
2203 if $test "X$issymlink" != X; then
2204 echo "You can test for symbolic links with '$issymlink'." >&4
2206 echo "I do not know how you can test for symbolic links." >&4
2210 *) echo "No symbolic links, so not testing for their testing..." >&4
2216 case "$mksymlinks" in
2219 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2222 *) case "$lns:$issymlink" in
2224 echo "Creating the symbolic links..." >&4
2225 echo "(First creating the subdirectories...)" >&4
2227 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2229 test -z "$directory" && break
2233 if test ! -d t/base; then
2234 echo "Failed to create the subdirectories. Aborting." >&4
2237 echo "(Then creating the symlinks...)" >&4
2238 awk '{print $1}' $src/MANIFEST | while true; do
2240 test -z "$filename" && break
2241 if test -f $filename; then
2242 if $issymlink $filename; then
2246 if test -f $filename; then
2247 echo "$filename already exists, not symlinking."
2249 ln -s $src/$filename $filename
2253 if test ! -f t/base/commonsense.t; then
2254 echo "Failed to create the symlinks. Aborting." >&4
2259 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2267 : see whether [:lower:] and [:upper:] are supported character classes
2269 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2271 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2275 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
2276 # (0xc9 and 0xd1), therefore that is a nice testing point.
2277 if test "X$up" = X -o "X$low" = X; then
2278 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
2284 if test "X$up" = X -o "X$low" = X; then
2285 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
2291 if test "X$up" = X -o "X$low" = X; then
2292 case "`echo IJ | od -x 2>/dev/null`" in
2294 echo "Hey, this might be EBCDIC." >&4
2295 if test "X$up" = X -o "X$low" = X; then
2296 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2297 ij) up='[A-IJ-RS-Z]'
2302 if test "X$up" = X -o "X$low" = X; then
2303 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2313 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
2315 echo "Using $up and $low to convert case." >&4
2318 echo "I don't know how to translate letters from upper to lower case." >&4
2319 echo "Your tr is not acting any way I know of." >&4
2323 : set up the translation script tr, must be called with ./tr of course
2327 '[A-Z][a-z]') exec $tr '$up' '$low';;
2328 '[a-z][A-Z]') exec $tr '$low' '$up';;
2335 : Try to determine whether config.sh was made on this system
2336 case "$config_sh" in
2338 myuname=`$uname -a 2>/dev/null`
2339 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2340 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2341 # because the A-Z/a-z are not consecutive.
2342 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2343 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2344 newmyuname="$myuname"
2346 case "$knowitall" in
2348 if test -f ../config.sh; then
2349 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2350 eval "`grep myuname= ../config.sh`"
2352 if test "X$myuname" = "X$newmyuname"; then
2360 : Get old answers from old config file if Configure was run on the
2361 : same system, otherwise use the hints.
2364 if test -f config.sh; then
2366 rp="I see a config.sh file. Shall I use it to set the defaults?"
2369 n*|N*) echo "OK, I'll ignore it."
2370 mv config.sh config.sh.old
2371 myuname="$newmyuname"
2373 *) echo "Fetching default answers from your old config.sh file..." >&4
2381 : Older versions did not always set $sh. Catch re-use of such
2391 if test ! -f config.sh; then
2394 First time through, eh? I have some defaults handy for some systems
2395 that need some extra help getting the Configure answers right:
2398 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2400 : Half the following guesses are probably wrong... If you have better
2401 : tests or hints, please send them to perlbug@perl.org
2402 : The metaconfig authors would also appreciate a copy...
2403 $test -f /irix && osname=irix
2404 $test -f /xenix && osname=sco_xenix
2405 $test -f /dynix && osname=dynix
2406 $test -f /dnix && osname=dnix
2407 $test -f /lynx.os && osname=lynxos
2408 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2409 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
2410 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2411 $test -f /bin/mips && /bin/mips && osname=mips
2412 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
2413 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
2414 $test -d /usr/apollo/bin && osname=apollo
2415 $test -f /etc/saf/_sactab && osname=svr4
2416 $test -d /usr/include/minix && osname=minix
2417 if $test -d /MachTen -o -d /MachTen_Folder; then
2419 if $test -x /sbin/version; then
2420 osvers=`/sbin/version | $awk '{print $2}' |
2421 $sed -e 's/[A-Za-z]$//'`
2422 elif $test -x /usr/etc/version; then
2423 osvers=`/usr/etc/version | $awk '{print $2}' |
2424 $sed -e 's/[A-Za-z]$//'`
2430 $test -f /sys/posix.dll &&
2431 $test -f /usr/bin/what &&
2432 set X `/usr/bin/what /sys/posix.dll` &&
2433 $test "$3" = UWIN &&
2437 if $test -f $uname; then
2445 umips) osname=umips ;;
2448 [23]100) osname=mips ;;
2449 next*) osname=next ;;
2451 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
2452 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
2455 elif $test -f /etc/kconfig; then
2457 if test "$lns" = "$ln -s"; then
2459 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
2461 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
2468 if test -n "$DJGPP"; then
2477 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
2479 'not found') osvers="$4"."$3" ;;
2480 '<3240'|'<>3240') osvers=3.2.0 ;;
2481 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
2482 '=3250'|'>3250') osvers=3.2.5 ;;
2486 bsd386) osname=bsd386
2489 cygwin*) osname=cygwin
2492 *dc.osx) osname=dcosx
2498 domainos) osname=apollo
2504 dynixptx*) osname=dynixptx
2505 osvers=`echo "$4"|sed 's/^v//'`
2507 freebsd) osname=freebsd
2509 genix) osname=genix ;;
2511 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
2527 netbsd*) osname=netbsd
2530 news-os) osvers="$3"
2532 4*) osname=newsos4 ;;
2536 next*) osname=next ;;
2537 nonstop-ux) osname=nonstopux ;;
2538 POSIX-BC | posix-bc ) osname=posix-bc
2541 powerux | power_ux | powermax_os | powermaxos | \
2542 powerunix | power_unix) osname=powerux
2548 solaris) osname=solaris
2550 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2557 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2561 titanos) osname=titanos
2570 ultrix) osname=ultrix
2573 osf1|mls+) case "$5" in
2576 osvers=`sizer -v | awk '{print $3}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
2579 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
2582 hp*) osname=hp_osf1 ;;
2583 mips) osname=mips_osf1 ;;
2586 unixware) osname=svr5
2592 $2) case "$osname" in
2596 : svr4.x or possibly later
2606 if test -f /stand/boot ; then
2607 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
2608 if test -n "$INITPROG" -a -f "$INITPROG"; then
2609 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
2610 if test -n "$isesix"; then
2618 *) if test -f /etc/systemid; then
2620 set `echo $3 | $sed 's/\./ /g'` $4
2621 if $test -f $src/hints/sco_$1_$2_$3.sh; then
2623 elif $test -f $src/hints/sco_$1_$2.sh; then
2625 elif $test -f $src/hints/sco_$1.sh; then
2630 '') : Still unknown. Probably a generic Sys V.
2639 *) case "$osname" in
2640 '') : Still unknown. Probably a generic BSD.
2648 if test -f /vmunix -a -f $src/hints/news_os.sh; then
2649 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
2650 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
2653 $rm -f UU/kernel.what
2654 elif test -d c:/.; then
2661 : Now look for a hint file osname_osvers, unless one has been
2662 : specified already.
2665 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
2666 : Also try without trailing minor version numbers.
2667 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
2668 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
2669 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
2670 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
2673 *) case "$osvers" in
2676 *) if $test -f $src/hints/$file.sh ; then
2678 elif $test -f $src/hints/$xfile.sh ; then
2680 elif $test -f $src/hints/$xxfile.sh ; then
2682 elif $test -f $src/hints/$xxxfile.sh ; then
2684 elif $test -f $src/hints/$xxxxfile.sh ; then
2686 elif $test -f "$src/hints/${osname}.sh" ; then
2695 if $test -f Policy.sh ; then
2698 none) dflt="Policy" ;;
2699 *) dflt="Policy $dflt" ;;
2704 dflt=`echo $hintfile | $sed 's/\.sh$//'`
2708 if $test -f Policy.sh ; then
2711 There's also a Policy hint file available, which should make the
2712 site-specific (policy) questions easier to answer.
2719 You may give one or more space-separated answers, or "none" if appropriate.
2720 A well-behaved OS will have no hints, so answering "none" or just "Policy"
2721 is a good thing. DO NOT give a wrong version or a wrong OS.
2725 rp="Which of these apply, if any?"
2728 for file in $tans; do
2729 if $test X$file = XPolicy -a -f Policy.sh; then
2731 $cat Policy.sh >> UU/config.sh
2732 elif $test -f $src/hints/$file.sh; then
2733 . $src/hints/$file.sh
2734 $cat $src/hints/$file.sh >> UU/config.sh
2735 elif $test X$tans = X -o X$tans = Xnone ; then
2738 : Give one chance to correct a possible typo.
2739 echo "$file.sh does not exist"
2741 rp="hint to use instead?"
2743 for file in $ans; do
2744 if $test -f "$src/hints/$file.sh"; then
2745 . $src/hints/$file.sh
2746 $cat $src/hints/$file.sh >> UU/config.sh
2747 elif $test X$ans = X -o X$ans = Xnone ; then
2750 echo "$file.sh does not exist -- ignored."
2757 : Remember our hint file for later.
2758 if $test -f "$src/hints/$file.sh" ; then
2768 echo "Fetching default answers from $config_sh..." >&4
2772 cp $config_sh config.sh 2>/dev/null
2782 test "$override" && . ./optdef.sh
2784 : Restore computed paths
2785 for file in $loclist $trylist; do
2786 eval $file="\$_$file"
2791 Configure uses the operating system name and version to set some defaults.
2792 The default value is probably right if the name rings a bell. Otherwise,
2793 since spelling matters for me, either accept the default or answer "none"
2800 ''|' '|none) dflt=none ;;
2801 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
2804 *) dflt="$osname" ;;
2806 rp="Operating system name?"
2810 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
2816 ''|' '|none) dflt=none ;;
2817 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
2818 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
2820 ''|' ') dflt=none ;;
2825 *) dflt="$osvers" ;;
2827 rp="Operating system version?"
2837 : who configured the system
2838 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
2839 cf_by=`(logname) 2>/dev/null`
2842 cf_by=`(whoami) 2>/dev/null`
2844 "") cf_by=unknown ;;
2848 : set up the script used to warn in case of inconsistency
2855 echo "*** WHOA THERE!!! ***" >&4
2856 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2857 rp=" Keep the $hint value?"
2860 y) td=$was; tu=$was;;
2864 : function used to set $1 to $val
2865 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2867 $define$undef) . ./whoa; eval "$var=\$td";;
2868 $undef$define) . ./whoa; eval "$var=\$tu";;
2869 *) eval "$var=$val";;
2872 case "$usethreads" in
2873 $define|true|[yY]*) dflt='y';;
2878 Perl can be built to take advantage of threads on some systems.
2879 To do so, Configure can be run with -Dusethreads.
2881 Note that threading is a highly experimental feature, and
2882 some known race conditions still remain. If you choose to try
2883 it, be very sure to not actually deploy it for production
2884 purposes. README.threads has more details, and is required
2885 reading if you enable threads.
2887 If this doesn't make any sense to you, just accept the default '$dflt'.
2889 rp='Build a threading Perl?'
2892 y|Y) val="$define" ;;
2898 case "$usethreads" in
2902 As of 5.5.640, Perl has two different internal threading implementations,
2903 the 5.005 version (5005threads) and an interpreter-based version
2904 (ithreads) that has one interpreter per thread. Both are very
2905 experimental. This arrangement exists to help developers work out
2906 which one is better.
2908 If you're a casual user, you probably don't want interpreter-threads
2909 at this time. There doesn't yet exist a way to create threads from
2910 within Perl in this model, i.e., "use Thread;" will NOT work.
2912 : Default to ithreads unless overridden on command line or with
2915 case "$use5005threads" in
2916 $define|true|[yY]*) dflt='n';;
2918 case "$useithreads" in
2919 $undef|false|[nN]*) dflt='n';;
2921 rp='Use interpreter-based ithreads?'
2924 y|Y) val="$define" ;;
2929 : Now set use5005threads to the opposite value.
2930 case "$useithreads" in
2931 $define) val="$undef" ;;
2938 useithreads="$undef"
2939 use5005threads="$undef"
2943 case "$d_oldpthreads" in
2944 '') : Configure tests would be welcome here. For now, assume undef.
2946 *) val="$d_oldpthreads" ;;
2952 case "$usethreads" in
2953 "$define"|true|[yY]*)
2954 : Look for a hint-file generated 'call-back-unit'. If the
2955 : user has specified that a threading perl is to be built,
2956 : we may need to set or change some other defaults.
2957 if $test -f usethreads.cbu; then
2958 echo "Your platform has some specific hints for threaded builds, using them..."
2962 (Your platform doesn't have any specific hints for threaded builds.
2963 Assuming POSIX threads, then.)
2971 Perl can be built so that multiple Perl interpreters can coexist
2972 within the same Perl executable.
2975 case "$useithreads" in
2978 This multiple interpreter support is required for interpreter-based threads.
2982 *) case "$usemultiplicity" in
2983 $define|true|[yY]*) dflt='y';;
2987 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
2988 rp='Build Perl for multiplicity?'
2991 y|Y) val="$define" ;;
2999 : make some quick guesses about what we are up against
3001 $echo $n "Hmm... $c"
3011 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
3012 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
3014 echo "Looks kind of like an OSF/1 system, but we'll see..."
3016 elif test `echo abc | $tr a-z A-Z` = Abc ; then
3017 xxx=`./loc addbib blurfl $pth`
3018 if $test -f $xxx; then
3019 echo "Looks kind of like a USG system with BSD features, but we'll see..."
3023 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
3024 echo "Looks kind of like an extended USG system, but we'll see..."
3026 echo "Looks kind of like a USG system, but we'll see..."
3030 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
3031 echo "Looks kind of like a BSD system, but we'll see..."
3035 echo "Looks kind of like a Version 7 system, but we'll see..."
3038 case "$eunicefix" in
3041 There is, however, a strange, musty smell in the air that reminds me of
3042 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
3046 : it so happens the Eunice I know will not run shell scripts in Unix format
3050 echo "Congratulations. You aren't running Eunice."
3054 : Detect OS2. The p_ variable is set above in the Head.U unit.
3055 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
3056 : semicolon as a patch separator
3061 I have the feeling something is not exactly right, however...don't tell me...
3062 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
3063 (Or you may be running DOS with DJGPP.)
3068 if test -f /xenix; then
3069 echo "Actually, this looks more like a XENIX system..."
3074 echo "It's not Xenix..."
3079 if test -f /venix; then
3080 echo "Actually, this looks more like a VENIX system..."
3087 echo "Nor is it Venix..."
3090 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3091 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3098 rp="Use which C compiler?"
3101 : Look for a hint-file generated 'call-back-unit'. Now that the
3102 : user has specified the compiler, we may need to set or change some
3104 if $test -f cc.cbu; then
3110 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3111 $cat >gccvers.c <<EOM
3116 printf("%s\n", __VERSION__);
3118 printf("%s\n", "1");
3124 if $cc -o gccvers $ldflags gccvers.c; then
3125 gccversion=`./gccvers`
3126 case "$gccversion" in
3127 '') echo "You are not using GNU cc." ;;
3128 *) echo "You are using GNU cc $gccversion."
3134 echo "*** WHOA THERE!!! ***" >&4
3135 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3136 case "$knowitall" in
3138 echo " You'd better start hunting for one and let me know about it." >&4
3144 case "$gccversion" in
3145 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3147 case "$gccversion" in
3148 '') gccosandvers='' ;;
3149 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
3150 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
3152 case "$gccosandvers" in
3153 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
3154 $osname$osvers) ;; # looking good
3155 $osname*) cat <<EOM >&4
3157 *** WHOA THERE!!! ***
3159 Your gcc has not been compiled for the exact release of
3160 your operating system ($gccosandvers versus $osname$osvers).
3162 In general it is a good idea to keep gcc synchronized with
3163 the operating system because otherwise serious problems
3164 may ensue when trying to compile software, like Perl.
3166 I'm trying to be optimistic here, though, and will continue.
3167 If later during the configuration and build icky compilation
3168 problems appear (headerfile conflicts being the most common
3169 manifestation), I suggest reinstalling the gcc to match
3170 your operating system release.
3174 *) gccosandvers='' ;; # failed to parse, better be silent
3182 : see how we invoke the C preprocessor
3184 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3185 cat <<'EOT' >testcpp.c
3191 if test ! -f cppstdin; then
3192 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
3193 # AIX cc -E doesn't show the absolute headerfile
3194 # locations but we'll cheat by using the -M flag.
3195 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
3197 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3200 echo "Keeping your $hint cppstdin wrapper."
3203 wrapper=`pwd`/cppstdin
3207 if $test "X$cppstdin" != "X" && \
3208 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3209 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3211 echo "You used to use $cppstdin $cppminus so we'll use that again."
3213 '') echo "But let's see if we can live without a wrapper..." ;;
3215 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3216 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3218 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3221 echo "(However, $cpprun $cpplast does not work, let's see...)"
3229 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3236 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3237 $cc -E <testcpp.c >testcpp.out 2>&1; \
3238 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3239 echo "Yup, it does."
3242 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
3243 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3244 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3245 echo "Yup, it does."
3248 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
3249 $cc -P <testcpp.c >testcpp.out 2>&1; \
3250 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3251 echo "Yipee, that works!"
3254 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
3255 $cc -P - <testcpp.c >testcpp.out 2>&1; \
3256 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3257 echo "At long last!"
3260 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
3261 $cpp <testcpp.c >testcpp.out 2>&1; \
3262 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3266 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
3267 $cpp - <testcpp.c >testcpp.out 2>&1; \
3268 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3269 echo "Hooray, it works! I was beginning to wonder."
3272 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
3273 $wrapper <testcpp.c >testcpp.out 2>&1; \
3274 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3280 rp="No dice. I can't find a C preprocessor. Name one:"
3284 $x_cpp <testcpp.c >testcpp.out 2>&1
3285 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3286 echo "OK, that will do." >&4
3288 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
3303 echo "Perhaps can we force $cc -E using a wrapper..."
3304 if $wrapper <testcpp.c >testcpp.out 2>&1; \
3305 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3311 echo "Nope, we'll have to live without it..."
3325 "$wrapper"|'cppstdin') ;;
3326 *) $rm -f $wrapper;;
3328 $rm -f testcpp.c testcpp.out
3330 : decide how portable to be. Allow command line overrides.
3331 case "$d_portable" in
3333 *) d_portable="$define" ;;
3336 : set up shell script to do ~ expansion
3342 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3345 if $test -f /bin/csh; then
3346 /bin/csh -f -c "glob \$1"
3351 name=\`$expr x\$1 : '..\([^/]*\)'\`
3352 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3353 if $test ! -d "\$dir"; then
3355 echo "\$me: can't locate home directory for: \$name" >&2
3360 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3376 : now set up to get a file name
3380 cat <<'EOSC' >>getfile
3396 expr $fn : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3397 fn=`echo $fn | sed 's/(.*)//'`
3403 loc_file=`expr $fn : '.*:\(.*\)'`
3404 fn=`expr $fn : '\(.*\):.*'`
3412 */*) fullpath=true;;
3421 *e*) exp_file=true;;
3424 *p*) nopath_ok=true;;
3429 *d*) type='Directory';;
3430 *l*) type='Locate';;
3435 Locate) what='File';;
3440 case "$d_portable" in
3448 while test "$type"; do
3453 true) rp="$rp (~name ok)";;
3456 if test -f UU/getfile.ok && \
3457 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3476 value=`UU/filexp $ans`
3479 if test "$ans" != "$value"; then
3480 echo "(That expands to $value on this system.)"
3494 /*) value="$ansexp" ;;
3495 [a-zA-Z]:/*) value="$ansexp" ;;
3500 echo "I shall only accept a full path name, as in /bin/ls." >&4
3501 echo "Use a ! shell escape if you wish to check pathnames." >&4
3504 echo "Please give a full path name, starting with slash." >&4
3507 echo "Note that using ~name is ok provided it expands well." >&4
3520 for fp in $gfpth; do
3521 if test "X$fp" = X.; then
3526 if test -f "$pf"; then
3528 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3530 echo "($value is not a plain file, but that's ok.)"
3533 if test X"$type" = X; then
3540 for fp in $gfpth; do
3541 if test "X$fp" = X.; then
3546 direxp="$fp/$ansexp"
3548 if test -d "$direxp"; then
3556 if test -d "$ansexp"; then
3557 echo "(Looking for $loc_file in directory $value.)"
3558 value="$value/$loc_file"
3559 ansexp="$ansexp/$loc_file"
3561 if test -f "$ansexp"; then
3564 case "$nopath_ok" in
3565 true) case "$value" in
3567 *) echo "Assuming $value will be in people's path."
3583 if test "$fastread" = yes; then
3588 rp="$what $value doesn't exist. Use that name anyway?"
3607 test "X$gfpthkeep" != Xy && gfpth=""
3610 : What should the include directory be ?
3612 $echo $n "Hmm... $c"
3616 if $test -f /bin/mips && /bin/mips; then
3617 echo "Looks like a MIPS system..."
3618 $cat >usr.c <<'EOCP'
3619 #ifdef SYSTYPE_BSD43
3623 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3624 dflt='/bsd43/usr/include'
3628 mips_type='System V'
3630 $rm -f usr.c usr.out
3631 echo "and you're compiling with the $mips_type compiler and libraries."
3635 echo "Doesn't look like a MIPS system."
3645 case "$xxx_prompt" in
3648 rp='Where are the include files you want to use?'
3656 : Set private lib path
3659 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
3664 '') dlist="$loclibpth $plibpth $glibpth";;
3665 *) dlist="$libpth";;
3668 : Now check and see which directories actually exist, avoiding duplicates
3672 if $test -d $xxx; then
3675 *) libpth="$libpth $xxx";;
3681 Some systems have incompatible or broken versions of libraries. Among
3682 the directories listed in the question below, please remove any you
3683 know not to be holding relevant libraries, and add any that are needed.
3684 Say "none" for none.
3695 rp="Directories to use for library searches?"
3702 : compute shared library extension
3705 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
3715 On some systems, shared libraries may be available. Answer 'none' if
3716 you want to suppress searching of shared libraries for the remainder
3717 of this configuration.
3720 rp='What is the file extension used for shared libraries?'
3724 : Define several unixisms.
3725 : Hints files or command line option can be used to override them.
3726 : The convoluted testing is in case hints files set either the old
3729 '') case "$exe_ext" in
3731 *) _exe="$exe_ext" ;;
3736 '') case "$lib_ext" in
3743 '') case "$obj_ext" in
3750 '') case "$path_sep" in
3761 : Which makefile gets called first. This is used by make depend.
3762 case "$firstmakefile" in
3763 '') firstmakefile='makefile';;
3767 $define|true|[yY]*) dflt='y';;
3772 Perl can be built to use the SOCKS proxy protocol library. To do so,
3773 Configure must be run with -Dusesocks. If you use SOCKS you also need
3774 to use the PerlIO abstraction layer, this will be implicitly selected.
3776 If this doesn't make any sense to you, just accept the default '$dflt'.
3778 rp='Build Perl for SOCKS?'
3781 y|Y) val="$define" ;;
3788 $define|true|[yY]*) useperlio="$define";;
3791 : Looking for optional libraries
3793 echo "Checking for optional libraries..." >&4
3798 case "$libswanted" in
3799 '') libswanted='c_s';;
3802 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
3808 for thisdir in $libpth $xlibpth; do
3809 test -d $thisdir && libspath="$libspath $thisdir"
3811 for thislib in $libswanted; do
3812 for thisdir in $libspath; do
3814 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
3815 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|tail -1`
3816 $test -f "$xxx" && eval $libscheck
3817 $test -f "$xxx" && libstyle=shared
3819 if test ! -f "$xxx"; then
3820 xxx=$thisdir/lib$thislib.$so
3821 $test -f "$xxx" && eval $libscheck
3822 $test -f "$xxx" && libstyle=shared
3824 if test ! -f "$xxx"; then
3825 xxx=$thisdir/lib$thislib$_a
3826 $test -f "$xxx" && eval $libscheck
3827 $test -f "$xxx" && libstyle=static
3829 if test ! -f "$xxx"; then
3830 xxx=$thisdir/$thislib$_a
3831 $test -f "$xxx" && eval $libscheck
3832 $test -f "$xxx" && libstyle=static
3834 if test ! -f "$xxx"; then
3835 xxx=$thisdir/lib${thislib}_s$_a
3836 $test -f "$xxx" && eval $libscheck
3837 $test -f "$xxx" && libstyle=static
3838 $test -f "$xxx" && thislib=${thislib}_s
3840 if test ! -f "$xxx"; then
3841 xxx=$thisdir/Slib$thislib$_a
3842 $test -f "$xxx" && eval $libscheck
3843 $test -f "$xxx" && libstyle=static
3845 if $test -f "$xxx"; then
3847 shared) echo "Found -l$thislib (shared)." ;;
3848 static) echo "Found -l$thislib." ;;
3849 *) echo "Found -l$thislib ($libstyle)." ;;
3853 *) dflt="$dflt -l$thislib"
3854 libsfound="$libsfound $xxx"
3856 libsfiles="$libsfiles $yyy"
3857 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
3858 case " $libsdirs " in
3860 *) libsdirs="$libsdirs $yyy" ;;
3867 if $test ! -f "$xxx"; then
3868 echo "No -l$thislib."
3879 ' '|'') dflt='none';;
3884 In order to compile $package on your machine, a number of libraries
3885 are usually needed. Include any other special libraries here as well.
3886 Say "none" for none. The default list is almost always right.
3890 rp="What libraries to use?"
3897 : determine optimization, if desired, or use for debug flag also
3899 ' '|$undef) dflt='none';;
3901 *) dflt="$optimize";;
3905 By default, $package compiles with the -O flag to use the optimizer.
3906 Alternately, you might want to use the symbolic debugger, which uses
3907 the -g flag (on traditional Unix systems). Either flag can be
3908 specified here. To use neither flag, specify the word "none".
3911 rp="What optimizer/debugger flag should be used?"
3915 'none') optimize=" ";;
3919 : We will not override a previous value, but we might want to
3920 : augment a hint file
3922 default|recommended)
3923 case "$gccversion" in
3924 1*) dflt='-fpcc-struct-return' ;;
3927 *-g*) dflt="$dflt -DDEBUGGING";;
3929 case "$gccversion" in
3930 2*) if test -d /etc/conf/kconfig.d &&
3931 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
3937 case "$gccversion" in
3941 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
3942 echo 'int main(void) { return 0; }' > gcctest.c
3943 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
3944 echo "Yes, it does." 2>&1
3947 echo "Leaving current flags $ccflags alone." 2>&1
3949 *) dflt="$dflt -fno-strict-aliasing" ;;
3952 echo "Nope, it doesn't, but that's ok." 2>&1
3959 case "$mips_type" in
3960 *BSD*|'') inclwanted="$locincpth $usrinc";;
3961 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
3963 for thisincl in $inclwanted; do
3964 if $test -d $thisincl; then
3965 if $test x$thisincl != x$usrinc; then
3967 *" -I$thisincl "*);;
3968 *) dflt="$dflt -I$thisincl ";;
3974 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
3976 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
3984 *) dflt="$dflt -D$2";;
3988 set signal.h LANGUAGE_C; eval $inctest
3992 ccflags="$ccflags -DSOCKS"
3997 default|recommended) dflt="$ccflags $dflt" ;;
3998 *) dflt="$ccflags";;
4007 Your C compiler may want other flags. For this question you should include
4008 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4009 but you should NOT include libraries or ld flags like -lwhatever. If you
4010 want $package to honor its debug switch, you should include -DDEBUGGING here.
4011 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4013 To use no flags, specify the word "none".
4019 rp="Any additional cc flags?"
4026 : the following weeds options from ccflags that are of no interest to cpp
4028 case "$gccversion" in
4029 1*) cppflags="$cppflags -D__GNUC__"
4031 case "$mips_type" in
4033 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4039 echo "Let me guess what the preprocessor flags are..." >&4
4053 *) ftry="$previous $flag";;
4055 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4056 >cpp1.out 2>/dev/null && \
4057 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4058 >cpp2.out 2>/dev/null && \
4059 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4060 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4062 cppflags="$cppflags $ftry"
4072 *-*) echo "They appear to be: $cppflags";;
4074 $rm -f cpp.c cpp?.out
4078 : flags used in final linking phase
4080 '') if ./venix; then
4086 *-posix*) dflt="$dflt -posix" ;;
4089 *) dflt="$ldflags";;
4092 : Try to guess additional flags to pick up local libraries.
4093 for thislibdir in $libpth; do
4094 case " $loclibpth " in
4097 *"-L$thislibdir "*) ;;
4098 *) dflt="$dflt -L$thislibdir" ;;
4110 Your C linker may need flags. For this question you should
4111 include -L/whatever and any other flags used by the C linker, but you
4112 should NOT include libraries like -lwhatever.
4114 Make sure you include the appropriate -L/path flags if your C linker
4115 does not normally search all of the directories you specified above,
4118 To use no flags, specify the word "none".
4122 rp="Any additional ld flags (NOT including libraries)?"
4128 rmlist="$rmlist pdp11"
4132 echo "Checking your choice of C compiler and flags for coherency..." >&4
4133 $cat > try.c <<'EOF'
4135 int main() { printf("Ok\n"); exit(0); }
4137 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
4139 $cat >try.msg <<'EOM'
4140 I've tried to compile and run the following simple program:
4143 $cat try.c >> try.msg
4145 $cat >> try.msg <<EOM
4152 and I got the following output:
4156 if $sh_c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
4157 if $sh_c './try' >>try.msg 2>&1; then
4161 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4164 cat >> try.msg <<'EOQS'
4165 If $libs contains -lsfio, and sfio is mis-configured, then it
4166 sometimes (apparently) runs and exits with a 0 status, but with no
4167 output! It may have to do with sfio's use of _exit vs. exit.
4170 rp="You have a big problem. Shall I abort Configure"
4177 echo "The program compiled OK, but exited with status $?." >>try.msg
4178 rp="You have a problem. Shall I abort Configure"
4182 echo "I can't compile the test program." >>try.msg
4183 rp="You have a BIG problem. Shall I abort Configure"
4189 case "$knowitall" in
4191 echo "(The supplied flags or libraries might be incorrect.)"
4199 *) echo "Ok. Stopping Configure." >&4
4204 n) echo "OK, that should do.";;
4206 $rm -f try try.* core
4208 : define an is-a-typedef? function
4209 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
4211 "") inclist="sys/types.h";;
4213 eval "varval=\$$var";
4217 for inc in $inclist; do
4218 echo "#include <$inc>" >>temp.c;
4220 echo "#ifdef $type" >> temp.c;
4221 echo "printf(\"We have $type\");" >> temp.c;
4222 echo "#endif" >> temp.c;
4223 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
4224 if $contains $type temp.E >/dev/null 2>&1; then
4230 *) eval "$var=\$varval";;
4233 : define an is-a-typedef? function that prompts if the type is not available.
4234 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
4236 "") inclist="sys/types.h";;
4238 eval "varval=\$$var";
4242 for inc in $inclist; do
4243 echo "#include <$inc>" >>temp.c;
4245 echo "#ifdef $type" >> temp.c;
4246 echo "printf(\"We have $type\");" >> temp.c;
4247 echo "#endif" >> temp.c;
4248 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
4250 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
4251 if $contains $type temp.E >/dev/null 2>&1; then
4252 echo "$type found." >&4;
4255 echo "$type NOT found." >&4;
4261 *) eval "$var=\$varval";;
4264 : define a shorthand compile call
4268 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
4269 : define a shorthand compile call for compilations that should be ok.
4273 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
4275 : check for lengths of integral types
4279 echo "Checking to see how big your integers are..." >&4
4280 $cat >intsize.c <<'EOCP'
4284 printf("intsize=%d;\n", (int)sizeof(int));
4285 printf("longsize=%d;\n", (int)sizeof(long));
4286 printf("shortsize=%d;\n", (int)sizeof(short));
4291 if eval $compile_ok && ./intsize > /dev/null; then
4293 echo "Your integers are $intsize bytes long."
4294 echo "Your long integers are $longsize bytes long."
4295 echo "Your short integers are $shortsize bytes long."
4299 Help! I can't compile and run the intsize test program: please enlighten me!
4300 (This is probably a misconfiguration in your system or libraries, and
4301 you really ought to fix it. Still, I'll try anyway.)
4305 rp="What is the size of an integer (in bytes)?"
4309 rp="What is the size of a long integer (in bytes)?"
4313 rp="What is the size of a short integer (in bytes)?"
4319 $rm -f intsize intsize.*
4321 : see what type lseek is declared as in the kernel
4322 rp="What is the type used for lseek's offset on this system?"
4323 set off_t lseektype long stdio.h sys/types.h
4327 echo "Checking to see how big your file offsets are..." >&4
4329 #include <sys/types.h>
4333 printf("%d\n", (int)sizeof($lseektype));
4338 if eval $compile_ok; then
4340 echo "Your file offsets are $lseeksize bytes long."
4344 echo "(I can't seem to compile the test program. Guessing...)"
4345 rp="What is the size of your file offsets (in bytes)?"
4351 : see what type file positions are declared as in the library
4352 rp="What is the type for file position used by fsetpos()?"
4353 set fpos_t fpostype long stdio.h sys/types.h
4358 *_t) zzz="$fpostype" ;;
4361 echo "Checking the size of $zzz..." >&4
4363 #include <sys/types.h>
4366 printf("%d\n", (int)sizeof($fpostype));
4371 if eval $compile_ok; then
4375 echo "(I can't execute the test program--guessing $fpossize.)" >&4
4378 echo "Your $zzz is $fpossize bytes long."
4384 echo "(I can't compile the test program. Guessing...)" >&4
4385 rp="What is the size of your file positions (in bytes)?"
4392 # Backward compatibility (uselfs is deprecated).
4394 "$define"|true|[yY]*)
4397 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
4399 uselargefiles="$define"
4403 case "$lseeksize:$fpossize" in
4406 You can have files larger than 2 gigabytes.
4409 *) case "$uselargefiles" in
4410 "$undef"|false|[nN]*) dflt='n' ;;
4415 Perl can be built to understand large files (files larger than 2 gigabytes)
4416 on some systems. To do so, Configure can be run with -Duselargefiles.
4418 If this doesn't make any sense to you, just accept the default '$dflt'.
4420 rp='Try to understand large files, if available?'
4423 y|Y) val="$define" ;;
4430 case "$uselargefiles" in
4432 : Look for a hint-file generated 'call-back-unit'. If the
4433 : user has specified that a large files perl is to be built,
4434 : we may need to set or change some other defaults.
4435 if $test -f uselargefiles.cbu; then
4436 echo "Your platform has some specific hints for large file builds, using them..."
4437 . ./uselargefiles.cbu
4439 echo "Rechecking to see how big your file offsets are..." >&4
4441 #include <sys/types.h>
4445 printf("%d\n", (int)sizeof($lseektype));
4450 if eval $compile_ok; then
4452 $echo "Your file offsets are now $lseeksize bytes long."
4456 echo "(I can't seem to compile the test program. Guessing...)"
4457 rp="What is the size of your file offsets (in bytes)?"
4462 *_t) zzz="$fpostype" ;;
4465 $echo $n "Rechecking the size of $zzz...$c" >&4
4467 #include <sys/types.h>
4470 printf("%d\n", (int)sizeof($fpostype));
4475 if eval $compile_ok; then
4480 echo "(I can't execute the test program--guessing $fpossize.)" >&4
4483 echo " $fpossize bytes." >&4
4489 echo "(I can't compile the test program. Guessing...)" >&4
4490 rp="What is the size of your file positions (in bytes)?"
4500 case "$usemorebits" in
4501 "$define"|true|[yY]*)
4502 use64bitint="$define"
4503 uselongdouble="$define"
4504 usemorebits="$define"
4506 *) usemorebits="$undef"
4511 case "$uselonglong" in
4512 "$define"|true|[yY]*)
4515 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
4517 use64bitint="$define"
4520 case "$use64bits" in
4521 "$define"|true|[yY]*)
4524 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
4526 use64bitint="$define"
4529 case "$use64bitints" in
4530 "$define"|true|[yY]*)
4533 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
4535 use64bitint="$define"
4538 case "$use64bitsint" in
4539 "$define"|true|[yY]*)
4542 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
4544 use64bitint="$define"
4547 case "$uselonglongs" in
4548 "$define"|true|[yY]*)
4551 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
4553 use64bitint="$define"
4556 case "$use64bitsall" in
4557 "$define"|true|[yY]*)
4560 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
4562 use64bitall="$define"
4567 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
4569 case "$use64bitall" in
4570 "$define"|true|[yY]*) use64bitint="$define" ;;
4576 You have natively 64-bit long integers.
4580 *) case "$use64bitint" in
4581 "$define"|true|[yY]*) dflt='y';;
4586 Perl can be built to take advantage of 64-bit integer types
4587 on some systems. To do so, Configure can be run with -Duse64bitint.
4588 Choosing this option will most probably introduce binary incompatibilities.
4590 If this doesn't make any sense to you, just accept the default '$dflt'.
4592 rp='Try to use 64-bit integers, if available?'
4595 [yY]*) val="$define" ;;
4603 case "$use64bitall" in
4604 "$define"|true|[yY]*) dflt='y' ;;
4605 *) case "$longsize" in
4613 You may also choose to try maximal 64-bitness. It means using as much
4614 64-bitness as possible on the platform. This in turn means even more
4615 binary incompatibilities. On the other hand, your platform may not
4616 have any more 64-bitness available than what you already have chosen.
4618 If this doesn't make any sense to you, just accept the default '$dflt'.
4620 rp='Try to use maximal 64-bit support, if available?'
4623 [yY]*) val="$define" ;;
4628 case "$use64bitall" in
4630 case "$use64bitint" in
4634 Since you have chosen a maximally 64-bit build, I'm also turning on
4635 the use of 64-bit integers.
4637 use64bitint="$define" ;;
4642 case "$use64bitint" in
4643 "$define"|true|[yY]*)
4644 : Look for a hint-file generated 'call-back-unit'. If the
4645 : user has specified that a 64-bit perl is to be built,
4646 : we may need to set or change some other defaults.
4647 if $test -f use64bitint.cbu; then
4648 echo "Your platform has some specific hints for 64-bit integers, using them..."
4652 4) case "$archname64" in
4653 '') archname64=64int ;;
4660 case "$use64bitall" in
4661 "$define"|true|[yY]*)
4662 : Look for a hint-file generated 'call-back-unit'. If the
4663 : user has specified that a maximally 64-bit perl is to be built,
4664 : we may need to set or change some other defaults.
4665 if $test -f use64bitall.cbu; then
4666 echo "Your platform has some specific hints for 64-bit builds, using them..."
4670 4) case "$archname64" in
4671 ''|64int) archname64=64all ;;
4679 echo "Checking for GNU C Library..." >&4
4680 cat >gnulibc.c <<EOM
4692 if eval $compile_ok && ./gnulibc; then
4694 echo "You are using the GNU C Library"
4697 echo "You are not using the GNU C Library"
4703 : see if nm is to be used to determine whether a symbol is defined or not
4707 case "$d_gnulibc" in
4710 echo "nm probably won't work on the GNU C Library." >&4
4716 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
4718 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
4719 echo "'nm' won't be sufficient on this sytem." >&4
4725 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
4726 if $test $dflt -gt 20; then
4736 true|$define) dflt=y;;
4743 I can use $nm to extract the symbols from your C libraries. This
4744 is a time consuming task which may generate huge output on the disk (up
4745 to 3 megabytes) but that should make the symbols extraction faster. The
4746 alternative is to skip the 'nm' extraction part and to compile a small
4747 test program instead to determine whether each symbol is present. If
4748 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
4749 this may be the best solution.
4751 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
4754 rp="Shall I use $nm to extract C symbols from the libraries?"
4757 [Nn]*) usenm=false;;
4766 : nm options which may be necessary
4768 '') if $test -f /mach_boot; then
4770 elif $test -d /usr/ccs/lib; then
4771 nm_opt='-p' # Solaris (and SunOS?)
4772 elif $test -f /dgux; then
4774 elif $test -f /lib64/rld; then
4775 nm_opt='-p' # 64-bit Irix
4781 : nm options which may be necessary for shared libraries but illegal
4782 : for archive libraries. Thank you, Linux.
4783 case "$nm_so_opt" in
4784 '') case "$myuname" in
4786 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
4787 nm_so_opt='--dynamic'
4796 : get list of predefined functions in a handy place
4801 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
4808 *) for thislib in $libs; do
4811 : Handle C library specially below.
4814 thislib=`echo $thislib | $sed -e 's/^-l//'`
4815 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
4817 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
4819 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
4821 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
4823 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
4825 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
4827 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
4832 libnames="$libnames $try"
4834 *) libnames="$libnames $thislib" ;;
4843 for xxx in $libpth; do
4844 $test -r $1 || set $xxx/libc.$so
4845 : The messy sed command sorts on library version numbers.
4847 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
4848 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
4850 s/[0-9][0-9]*/0000&/g
4851 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
4854 $sort | $sed -e 's/^.* //'`
4857 $test -r $1 || set /usr/ccs/lib/libc.$so
4858 $test -r $1 || set /lib/libsys_s$_a
4864 if $test -r "$1"; then
4865 echo "Your (shared) C library seems to be in $1."
4867 elif $test -r /lib/libc && $test -r /lib/clib; then
4868 echo "Your C library seems to be in both /lib/clib and /lib/libc."
4870 libc='/lib/clib /lib/libc'
4871 if $test -r /lib/syslib; then
4872 echo "(Your math library is in /lib/syslib.)"
4873 libc="$libc /lib/syslib"
4875 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
4876 echo "Your C library seems to be in $libc, as you said before."
4877 elif $test -r $incpath/usr/lib/libc$_a; then
4878 libc=$incpath/usr/lib/libc$_a;
4879 echo "Your C library seems to be in $libc. That's fine."
4880 elif $test -r /lib/libc$_a; then
4882 echo "Your C library seems to be in $libc. You're normal."
4884 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
4886 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
4887 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
4888 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
4890 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
4892 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
4895 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
4897 if $test -r "$tans"; then
4898 echo "Your C library seems to be in $tans, of all places."
4904 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
4908 If the guess above is wrong (which it might be if you're using a strange
4909 compiler, or your machine supports multiple models), you can override it here.
4914 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
4916 I can't seem to find your C library. I've looked in the following places:
4919 $sed 's/^/ /' libpath
4922 None of these seems to contain your C library. I need to get its name...
4927 rp='Where is your C library?'
4932 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
4933 set X `cat libnames`
4936 case $# in 1) xxx=file; esac
4937 echo "Extracting names from the following $xxx for later perusal:" >&4
4939 $sed 's/^/ /' libnames >&4
4941 $echo $n "This may take a while...$c" >&4
4945 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
4946 *) $nm $nm_opt $file 2>/dev/null;;
4951 $grep fprintf libc.tmp > libc.ptf
4952 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
4953 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
4955 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
4957 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4959 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
4961 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4963 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
4965 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4967 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
4969 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4971 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
4973 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4975 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
4977 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4979 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
4980 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
4982 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4984 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
4986 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4988 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
4990 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4992 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
4994 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4996 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
4998 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5000 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
5002 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5004 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
5006 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5008 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
5010 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5013 $nm -p $* 2>/dev/null >libc.tmp
5014 $grep fprintf libc.tmp > libc.ptf
5015 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
5016 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
5022 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
5024 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
5025 for thisname in $libnames $libc; do
5026 $ar t $thisname >>libc.tmp
5028 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
5030 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
5031 # Repeat libc to extract forwarders to DLL entries too
5032 for thisname in $libnames $libc; do
5033 $ar tv $thisname >>libc.tmp
5034 # Revision 50 of EMX has bug in $ar.
5035 # it will not extract forwarders to DLL entries
5036 # Use emximp which will extract exactly them.
5037 emximp -o tmp.imp $thisname \
5039 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
5040 < tmp.imp >>libc.tmp
5043 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
5046 echo "$ar didn't seem to work right." >&4
5047 echo "Maybe this is a Cray...trying bld instead..." >&4
5048 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
5050 for thisname in $libnames; do
5052 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
5053 $ar t $thisname >>libc.tmp
5057 echo "That didn't work either. Giving up." >&4
5064 if $test -f /lib/syscalls.exp; then
5066 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
5067 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*$/\1/p' /lib/syscalls.exp >>libc.list
5071 $rm -f libnames libpath
5073 : is a C symbol defined?
5076 -v) tf=libc.tmp; tc=""; tdc="";;
5077 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
5078 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
5081 case "$reuseval-$4" in
5083 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
5089 if $contains $tlook $tf >/dev/null 2>&1;
5094 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
5095 if $cc -o t $optimize $ccflags $ldflags t.c $libs >/dev/null 2>&1;
5103 $define) tval=true;;
5109 : define an is-in-libc? function
5110 inlibc='echo " "; td=$define; tu=$undef;
5111 sym=$1; var=$2; eval "was=\$$2";
5113 case "$reuseval$was" in
5123 echo "$sym() found." >&4;
5124 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
5126 echo "$sym() NOT found." >&4;
5127 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
5131 $define) echo "$sym() found." >&4;;
5132 *) echo "$sym() NOT found." >&4;;
5136 : see if sqrtl exists
5141 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
5144 case "$uselongdouble" in
5145 $define|true|[yY]*) dflt='y';;
5150 Perl can be built to take advantage of long doubles which
5151 (if available) may give more accuracy and range for floating point numbers.
5153 If this doesn't make any sense to you, just accept the default '$dflt'.
5155 rp='Try to use long doubles if available?'
5158 y|Y) val="$define" ;;
5164 case "$uselongdouble" in
5165 true|[yY]*) uselongdouble="$define" ;;
5168 case "$uselongdouble" in
5170 : Look for a hint-file generated 'call-back-unit'. If the
5171 : user has specified that long doubles should be used,
5172 : we may need to set or change some other defaults.
5173 if $test -f uselongdouble.cbu; then
5174 echo "Your platform has some specific hints for long doubles, using them..."
5175 . ./uselongdouble.cbu
5178 (Your platform doesn't have any specific hints for long doubles.)
5184 case "$uselongdouble:$d_sqrtl" in
5188 *** You requested the use of long doubles but you do not seem to have
5189 *** the mathematic functions for long doubles. I'm disabling the use
5190 *** of long doubles.
5193 uselongdouble=$undef
5197 : check for length of double
5199 case "$doublesize" in
5201 echo "Checking to see how big your double precision numbers are..." >&4
5202 $cat >try.c <<'EOCP'
5206 printf("%d\n", (int)sizeof(double));
5211 if eval $compile_ok; then
5213 echo "Your double is $doublesize bytes long."
5216 echo "(I can't seem to compile the test program. Guessing...)"
5217 rp="What is the size of a double precision number (in bytes)?"
5225 : check for long doubles
5227 echo "Checking to see if you have long double..." >&4
5228 echo 'int main() { long double x = 7.0; }' > try.c
5230 if eval $compile; then
5232 echo "You have long double."
5235 echo "You do not have long double."
5241 : check for length of long double
5242 case "${d_longdbl}${longdblsize}" in
5245 echo "Checking to see how big your long doubles are..." >&4
5246 $cat >try.c <<'EOCP'
5250 printf("%d\n", sizeof(long double));
5255 if eval $compile; then
5256 longdblsize=`./try$exe_ext`
5257 echo "Your long doubles are $longdblsize bytes long."
5261 echo "(I can't seem to compile the test program. Guessing...)" >&4
5262 rp="What is the size of a long double (in bytes)?"
5266 if $test "X$doublesize" = "X$longdblsize"; then
5267 echo "(That isn't any different from an ordinary double.)"
5273 : determine the architecture name
5275 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5276 tarch=`arch`"-$osname"
5277 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5278 if uname -m > tmparch 2>&1 ; then
5279 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5280 -e 's/$/'"-$osname/" tmparch`
5288 case "$myarchname" in
5291 echo "(Your architecture name used to be $myarchname.)"
5298 *) dflt="$archname";;
5300 rp='What is your architecture name'
5303 case "$usethreads" in
5305 echo "Threads selected." >&4
5307 *-thread*) echo "...and architecture name already has -thread." >&4
5309 *) archname="$archname-thread"
5310 echo "...setting architecture name to $archname." >&4
5315 case "$usemultiplicity" in
5317 echo "Multiplicity selected." >&4
5319 *-multi*) echo "...and architecture name already has -multi." >&4
5321 *) archname="$archname-multi"
5322 echo "...setting architecture name to $archname." >&4
5327 case "$use64bitint$use64bitall" in
5329 case "$archname64" in
5331 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
5334 case "$use64bitint" in
5335 "$define") echo "64 bit integers selected." >&4 ;;
5337 case "$use64bitall" in
5338 "$define") echo "Maximal 64 bitness selected." >&4 ;;
5341 *-$archname64*) echo "...and architecture name already has $archname64." >&4
5343 *) archname="$archname-$archname64"
5344 echo "...setting architecture name to $archname." >&4
5350 case "$uselongdouble" in
5352 echo "Long doubles selected." >&4
5353 case "$longdblsize" in
5355 "...but long doubles are equal to doubles, not changing architecture name." >&4
5359 *-ld*) echo "...and architecture name already has -ld." >&4
5361 *) archname="$archname-ld"
5362 echo "...setting architecture name to $archname." >&4
5370 : determine root of directory hierarchy where package will be installed.
5373 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
5381 By default, $package will be installed in $dflt/bin, manual pages
5382 under $dflt/man, etc..., i.e. with $dflt as prefix for all
5383 installation directories. Typically this is something like /usr/local.
5384 If you wish to have binaries under /usr/bin but other parts of the
5385 installation under /usr/local, that's ok: you will be prompted
5386 separately for each of the installation directories, the prefix being
5387 only used to set the defaults.
5391 rp='Installation prefix to use?'
5399 *) oldprefix="$prefix";;
5409 $define|true) afs=true ;;
5410 $undef|false) afs=false ;;
5411 *) if test -d /afs; then
5419 echo "AFS may be running... I'll be extra cautious then..." >&4
5421 echo "AFS does not seem to be running..." >&4
5424 : determine installation prefix for where package is to be installed.
5428 Since you are running AFS, I need to distinguish the directory in which
5429 files will reside from the directory in which they are installed (and from
5430 which they are presumably copied to the former directory by occult means).
5433 case "$installprefix" in
5434 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
5435 *) dflt="$installprefix";;
5440 In some special cases, particularly when building $package for distribution,
5441 it is convenient to distinguish between the directory in which files should
5442 be installed from the directory ($prefix) in which they
5443 will eventually reside. For most users, these two directories are the same.
5446 case "$installprefix" in
5448 *) dflt=$installprefix;;
5452 rp='What installation prefix should I use for installing files?'
5454 installprefix="$ans"
5455 installprefixexp="$ansexp"
5457 : set the prefixit variable, to compute a suitable default value
5458 prefixit='case "$3" in
5460 case "$oldprefix" in
5461 "") eval "$1=\"\$$2\"";;
5468 ""|" ") eval "$1=\"\$$2\"";;
5474 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
5476 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
5477 /*-$oldprefix/*|\~*-$oldprefix/*)
5478 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
5479 *) eval "$1=\"\$$2\"";;
5484 : get the patchlevel
5486 echo "Getting the current patchlevel..." >&4
5487 if $test -r $rsrc/patchlevel.h;then
5488 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
5489 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
5490 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5491 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
5492 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
5493 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5502 $echo "(You have $package version $patchlevel subversion $subversion.)"
5505 : XXX Should be a Configure test for double-dots in filenames.
5506 version=`echo $revision $patchlevel $subversion | \
5507 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
5508 api_versionstring=`echo $api_revision $api_version $api_subversion | \
5509 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
5512 version=`echo $revision $patchlevel $subversion | \
5513 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
5514 api_versionstring=`echo $api_revision $api_version $api_subversion | \
5515 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
5518 : Special case the 5.005_xx maintenance series, which used 5.005
5519 : without any subversion label as a subdirectory in $sitelib
5520 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
5521 api_versionstring='5.005'
5524 : determine installation style
5525 : For now, try to deduce it from prefix unless it is already set.
5526 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
5527 case "$installstyle" in
5528 '') case "$prefix" in
5529 *perl*) dflt='lib';;
5530 *) dflt='lib/perl5' ;;
5533 *) dflt="$installstyle" ;;
5535 : Probably not worth prompting for this since we prompt for all
5536 : the directories individually, and the prompt would be too long and
5540 : determine where private library files go
5541 : Usual default is /usr/local/lib/perl5/$version.
5542 : Also allow things like /opt/perl/lib/$version, since
5543 : /opt/perl/lib/perl5... would be redundant.
5544 : The default "style" setting is made in installstyle.U
5545 case "$installstyle" in
5546 *lib/perl5*) set dflt privlib lib/$package/$version ;;
5547 *) set dflt privlib lib/$version ;;
5552 There are some auxiliary files for $package that need to be put into a
5553 private library directory that is accessible by everyone.
5557 rp='Pathname where the private library files will reside?'
5560 privlibexp="$ansexp"
5561 : Change installation prefix, if necessary.
5562 if $test X"$prefix" != X"$installprefix"; then
5563 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
5565 installprivlib="$privlibexp"
5568 : set the prefixup variable, to restore leading tilda escape
5569 prefixup='case "$prefixexp" in
5571 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
5574 : determine where public architecture dependent libraries go
5577 : privlib default is /usr/local/lib/$package/$version
5578 : archlib default is /usr/local/lib/$package/$version/$archname
5579 : privlib may have an optional trailing /share.
5580 tdflt=`echo $privlib | $sed 's,/share$,,'`
5581 tdflt=$tdflt/$archname
5590 $spackage contains architecture-dependent library files. If you are
5591 sharing libraries in a heterogeneous environment, you might store
5592 these files in a separate location. Otherwise, you can just include
5593 them with the rest of the public library files.
5597 rp='Where do you want to put the public architecture-dependent libraries?'
5600 archlibexp="$ansexp"
5601 if $test X"$archlib" = X"$privlib"; then
5606 : Change installation prefix, if necessary.
5607 if $test X"$prefix" != X"$installprefix"; then
5608 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
5610 installarchlib="$archlibexp"
5614 : Binary compatibility with 5.005 is not possible for builds
5615 : with advanced features
5616 case "$usethreads$usemultiplicity" in
5618 bincompat5005="$undef"
5619 d_bincompat5005="$undef"
5623 This version of Perl can be compiled for binary compatibility with 5.005.
5624 If you decide to do so, you will be able to continue using most of the
5625 extensions that were compiled for Perl 5.005.
5628 case "$bincompat5005$d_bincompat5005" in
5629 *"$undef"*) dflt=n ;;
5632 rp='Binary compatibility with Perl 5.005?'
5635 y*) val="$define" ;;
5640 case "$d_bincompat5005" in
5642 bincompat5005="$define"
5644 *) bincompat5005="$undef"
5645 d_bincompat5005="$undef"
5652 : see if setuid scripts can be secure
5655 Some kernels have a bug that prevents setuid #! scripts from being
5656 secure. Some sites have disabled setuid #! scripts because of this.
5658 First let's decide if your kernel supports secure setuid #! scripts.
5659 (If setuid #! scripts would be secure but have been disabled anyway,
5660 don't say that they are secure if asked.)
5665 if $test -d /dev/fd; then
5666 echo "#!$ls" >reflect
5667 chmod +x,u+s reflect
5668 ./reflect >flect 2>&1
5669 if $contains "/dev/fd" flect >/dev/null; then
5670 echo "Congratulations, your kernel has secure setuid scripts!" >&4
5674 If you are not sure if they are secure, I can check but I'll need a
5675 username and password different from the one you are using right now.
5676 If you don't have such a username or don't want me to test, simply
5680 rp='Other username to test security of setuid scripts with?'
5685 case "$d_suidsafe" in
5686 '') echo "I'll assume setuid scripts are *not* secure." >&4
5689 echo "Well, the $hint value is *not* secure." >&4
5691 *) echo "Well, the $hint value *is* secure." >&4
5696 $rm -f reflect flect
5697 echo "#!$ls" >reflect
5698 chmod +x,u+s reflect
5701 echo '"su" will (probably) prompt you for '"$ans's password."
5702 su $ans -c './reflect >flect'
5703 if $contains "/dev/fd" flect >/dev/null; then
5704 echo "Okay, it looks like setuid scripts are secure." >&4
5707 echo "I don't think setuid scripts are secure." >&4
5712 rp='Does your kernel have *secure* setuid scripts?'
5715 [yY]*) val="$define";;
5720 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
5721 echo "(That's for file descriptors, not floppy disks.)"
5727 $rm -f reflect flect
5729 : now see if they want to do setuid emulation
5732 case "$d_suidsafe" in
5735 echo "No need to emulate SUID scripts since they are secure here." >& 4
5739 Some systems have disabled setuid scripts, especially systems where
5740 setuid scripts cannot be secure. On systems where setuid scripts have
5741 been disabled, the setuid/setgid bits on scripts are currently
5742 useless. It is possible for $package to detect those bits and emulate
5743 setuid/setgid in a secure fashion. This emulation will only work if
5744 setuid scripts have been disabled in your kernel.
5748 "$define") dflt=y ;;
5751 rp="Do you want to do setuid/setgid emulation?"
5754 [yY]*) val="$define";;
5762 : determine filename position in cpp output
5764 echo "Computing filename position in cpp output for #include directives..." >&4
5765 echo '#include <stdio.h>' > foo.c
5768 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5769 $grep '^[ ]*#.*stdio\.h' | \
5770 while read cline; do
5773 while $test \$# -gt 0; do
5774 if $test -r \`echo \$1 | $tr -d '"'\`; then
5779 pos=\`expr \$pos + 1\`
5791 *) pos="${fieldn}th";;
5793 echo "Your cpp writes the filename in the $pos field of the line."
5795 : locate header file
5800 for usrincdir in $usrinc
5802 if test -f \$usrincdir/\$wanted; then
5803 echo "\$usrincdir/\$wanted"
5807 awkprg='{ print \$$fieldn }'
5808 echo "#include <\$wanted>" > foo\$\$.c
5809 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5810 $grep "^[ ]*#.*\$wanted" | \
5811 while read cline; do
5812 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5814 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5815 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5820 # status = 0: grep returned 0 lines, case statement not executed
5821 # status = 1: headerfile found
5822 # status = 2: while loop executed, no headerfile found
5826 if test \$status -eq 1; then
5833 : define an alternate in-header-list? function
5834 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5835 cont=true; xxf="echo \"<\$1> found.\" >&4";
5836 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5837 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5839 case $# in 4) instead=instead;; *) instead="at last";; esac;
5840 while $test "$cont"; do
5842 var=$2; eval "was=\$$2";
5843 if $test "$xxx" && $test -r "$xxx";
5845 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5848 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5849 set $yyy; shift; shift; yyy=$@;
5850 case $# in 0) cont="";;
5851 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5852 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5853 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5854 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5858 do set $yyy; var=$2; eval "was=\$$2";
5859 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5860 set $yyy; shift; shift; yyy=$@;
5863 : see if this is a malloc.h system
5864 set malloc.h i_malloc
5867 : see if stdlib is available
5868 set stdlib.h i_stdlib
5871 : determine which malloc to compile in
5873 case "$usemymalloc" in
5874 ''|[yY]*|true|$define) dflt='y' ;;
5877 rp="Do you wish to attempt to use the malloc that comes with $package?"
5883 mallocsrc='malloc.c'
5884 mallocobj="malloc$_o"
5885 d_mymalloc="$define"
5888 : Remove malloc from list of libraries to use
5889 echo "Removing unneeded -lmalloc from library list" >&4
5890 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
5893 echo "libs = $libs" >&4
5905 : compute the return types of malloc and free
5907 $cat >malloc.c <<END
5911 #include <sys/types.h>
5925 case "$malloctype" in
5927 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
5934 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
5938 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
5945 echo "Your system uses $freetype free(), it would seem." >&4
5949 After $package is installed, you may wish to install various
5950 add-on modules and utilities. Typically, these add-ons will
5951 be installed under $prefix with the rest
5952 of this package. However, you may wish to install such add-ons
5953 elsewhere under a different prefix.
5955 If you do not wish to put everything under a single prefix, that's
5956 ok. You will be prompted for the individual locations; this siteprefix
5957 is only used to suggest the defaults.
5959 The default should be fine for most people.
5963 rp='Installation prefix to use for add-on modules and utilities?'
5964 : XXX Here might be another good place for an installstyle setting.
5965 case "$siteprefix" in
5967 *) dflt=$siteprefix ;;
5970 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
5972 case "$siteprefix" in
5976 *) oldsiteprefix="$prefix";;
5981 siteprefixexp="$ansexp"
5983 : determine where site specific libraries go.
5984 : Usual default is /usr/local/lib/perl5/site_perl/$version
5985 : The default "style" setting is made in installstyle.U
5986 : XXX No longer works with Prefixit stuff.
5987 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5989 '') case "$installstyle" in
5990 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
5991 *) dflt=$siteprefix/lib/site_$prog/$version ;;
5999 The installation process will create a directory for
6000 site-specific extensions and modules. Most users find it convenient
6001 to place all site-specific files in this directory rather than in the
6002 main distribution directory.
6006 rp='Pathname for the site-specific library files?'
6009 sitelibexp="$ansexp"
6010 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6011 : Change installation prefix, if necessary.
6012 if $test X"$prefix" != X"$installprefix"; then
6013 installsitelib=`echo $sitelibexp | $sed "s#^$prefix#$installprefix#"`
6015 installsitelib="$sitelibexp"
6018 : determine where site specific architecture-dependent libraries go.
6019 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6020 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6021 : sitelib may have an optional trailing /share.
6023 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6024 dflt="$dflt/$archname"
6029 set sitearch sitearch none
6033 The installation process will also create a directory for
6034 architecture-dependent site-specific extensions and modules.
6038 rp='Pathname for the site-specific architecture-dependent library files?'
6041 sitearchexp="$ansexp"
6042 : Change installation prefix, if necessary.
6043 if $test X"$prefix" != X"$installprefix"; then
6044 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
6046 installsitearch="$sitearchexp"
6051 The installation process will also create a directory for
6052 vendor-supplied add-ons. Vendors who supply perl with their system
6053 may find it convenient to place all vendor-supplied files in this
6054 directory rather than in the main distribution directory. This will
6055 ease upgrades between binary-compatible maintenance versions of perl.
6057 Of course you may also use these directories in whatever way you see
6058 fit. For example, you might use them to access modules shared over a
6059 company-wide network.
6061 The default answer should be fine for most people.
6062 This causes further questions about vendor add-ons to be skipped
6063 and no vendor-specific directories will be configured for perl.
6066 rp='Do you want to configure vendor-specific add-on directories?'
6067 case "$usevendorprefix" in
6068 define|true|[yY]*) dflt=y ;;
6069 *) : User may have set vendorprefix directly on Configure command line.
6070 case "$vendorprefix" in
6079 rp='Installation prefix to use for vendor-supplied add-ons?'
6080 case "$vendorprefix" in
6082 *) dflt=$vendorprefix ;;
6085 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6087 case "$vendorprefix" in
6091 *) oldvendorprefix="$prefix";;
6095 usevendorprefix="$define"
6097 vendorprefixexp="$ansexp"
6099 *) usevendorprefix="$undef"
6105 case "$vendorprefix" in
6106 '') d_vendorlib="$undef"
6110 *) d_vendorlib="$define"
6111 : determine where vendor-supplied modules go.
6112 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6113 case "$vendorlib" in
6115 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6116 case "$installstyle" in
6117 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6118 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6121 *) dflt="$vendorlib"
6125 rp='Pathname for the vendor-supplied library files?'
6128 vendorlibexp="$ansexp"
6131 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6132 : Change installation prefix, if necessary.
6133 if $test X"$prefix" != X"$installprefix"; then
6134 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
6136 installvendorlib="$vendorlibexp"
6139 case "$vendorprefix" in
6140 '') d_vendorarch="$undef"
6144 *) d_vendorarch="$define"
6145 : determine where vendor-supplied architecture-dependent libraries go.
6146 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6147 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6148 : vendorlib may have an optional trailing /share.
6149 case "$vendorarch" in
6150 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6151 dflt="$dflt/$archname"
6153 *) dflt="$vendorarch" ;;
6156 rp='Pathname for vendor-supplied architecture-dependent files?'
6159 vendorarchexp="$ansexp"
6162 : Change installation prefix, if necessary.
6163 if $test X"$prefix" != X"$installprefix"; then
6164 installvendorarch=`echo $vendorarchexp | sed "s#^$prefix#$installprefix#"`
6166 installvendorarch="$vendorarchexp"
6169 : Final catch-all directories to search
6172 Lastly, you can have perl look in other directories for extensions and
6173 modules in addition to those already specified.
6174 These directories will be searched after
6178 test X"$vendorlib" != "X" && echo ' ' $vendorlib
6179 test X"$vendorarch" != "X" && echo ' ' $vendorarch
6181 case "$otherlibdirs" in
6182 ''|' ') dflt='none' ;;
6183 *) dflt="$otherlibdirs" ;;
6186 Enter a colon-separated set of extra paths to include in perl's @INC
6187 search path, or enter 'none' for no extra paths.
6191 rp='Colon-separated list of additional directories for perl to search?'
6194 ' '|''|none) otherlibdirs=' ' ;;
6195 *) otherlibdirs="$ans" ;;
6197 case "$otherlibdirs" in
6201 set d_perl_otherlibdirs
6204 : Cruising for prototypes
6206 echo "Checking out function prototypes..." >&4
6207 $cat >prototype.c <<'EOCP'
6208 int main(int argc, char *argv[]) {
6211 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
6212 echo "Your C compiler appears to support function prototypes."
6215 echo "Your C compiler doesn't seem to understand function prototypes."
6222 case "$prototype" in
6224 *) ansi2knr='ansi2knr'
6229 This version of $package can only be compiled by a compiler that
6230 understands function prototypes. Unfortunately, your C compiler
6232 doesn't seem to understand them. Sorry about that.
6234 If GNU cc is available for your system, perhaps you could try that instead.
6236 Eventually, we hope to support building Perl with pre-ANSI compilers.
6237 If you would like to help in that effort, please contact <perlbug@perl.org>.
6239 Aborting Configure now.
6245 : determine where public executables go
6250 rp='Pathname where the public executables will reside?'
6252 if $test "X$ansexp" != "X$binexp"; then
6257 : Change installation prefix, if necessary.
6258 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6259 if $test X"$prefix" != X"$installprefix"; then
6260 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
6262 installbin="$binexp"
6265 : Find perl5.005 or later.
6266 echo "Looking for a previously installed perl5.005 or later... "
6268 '') for tdir in `echo "$binexp:$PATH" | $sed "s/$path_sep/ /g"`; do
6269 : Check if this perl is recent and can load a simple module
6270 if $test -x $tdir/perl && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6273 elif $test -x $tdir/perl5 && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6283 '') echo "None found. That's ok.";;
6284 *) echo "Using $perl5." ;;
6287 : Determine list of previous versions to include in @INC
6288 $cat > getverlist <<EOPL
6291 \$api_versionstring = "$api_versionstring";
6292 \$version = "$version";
6293 \$stem = "$sitelib_stem";
6294 \$archname = "$archname";
6296 $cat >> getverlist <<'EOPL'
6297 # Can't have leading @ because metaconfig interprets it as a command!
6298 ;@inc_version_list=();
6299 # XXX Redo to do opendir/readdir?
6302 ;@candidates = glob("5.*");
6308 # XXX ToDo: These comparisons must be reworked when two-digit
6309 # subversions come along, so that 5.7.10 compares as greater than
6310 # 5.7.3! By that time, hope that 5.6.x is sufficiently
6311 # widespread that we can use the built-in version vectors rather
6312 # than reinventing them here. For 5.6.0, however, we must
6313 # assume this script will likely be run by 5.005_0x. --AD 1/2000.
6314 foreach $d (@candidates) {
6315 if ($d lt $version) {
6316 if ($d ge $api_versionstring) {
6317 unshift(@inc_version_list, grep { -d } "$d/$archname", $d);
6319 elsif ($d ge "5.005") {
6320 unshift(@inc_version_list, grep { -d } $d);
6324 # Skip newer version. I.e. don't look in
6325 # 5.7.0 if we're installing 5.6.1.
6329 if (@inc_version_list) {
6330 print join(' ', @inc_version_list);
6333 # Blank space to preserve value for next Configure run.
6338 case "$inc_version_list" in
6339 '') if test -x "$perl5"; then
6340 dflt=`$perl5 getverlist`
6345 $undef) dflt='none' ;;
6346 *) dflt="$inc_version_list" ;;
6349 ''|' ') dflt=none ;;
6352 5.005) case "$bincompat5005" in
6353 $define|true|[yY]*) ;;
6360 In order to ease the process of upgrading, this version of perl
6361 can be configured to use modules built and installed with earlier
6362 versions of perl that were installed under $prefix. Specify here
6363 the list of earlier versions that this version of perl should check.
6364 If Configure detected no earlier versions of perl installed under
6365 $prefix, then the list will be empty. Answer 'none' to tell perl
6366 to not search earlier versions.
6368 The default should almost always be sensible, so if you're not sure,
6369 just accept the default.
6372 rp='List of earlier versions to include in @INC?'
6375 [Nn]one|''|' ') inc_version_list=' ' ;;
6376 *) inc_version_list="$ans" ;;
6378 case "$inc_version_list" in
6380 inc_version_list_init='0';;
6381 *) inc_version_list_init=`echo $inc_version_list |
6382 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6387 : determine whether to install perl also as /usr/bin/perl
6390 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
6392 Many scripts expect perl to be installed as /usr/bin/perl.
6393 I can install the perl you are about to compile also as /usr/bin/perl
6394 (in addition to $installbin/perl).
6396 case "$installusrbinperl" in
6397 "$undef"|[nN]*) dflt='n';;
6400 rp="Do you want to install perl as /usr/bin/perl?"
6403 [yY]*) val="$define";;
6409 set installusrbinperl
6412 : see if dld is available
6416 : see if dlopen exists
6423 : determine which dynamic loading, if any, to compile in
6425 dldir="ext/DynaLoader"
6438 $define) dflt='y' ;;
6441 $define) dflt='y' ;;
6443 : Does a dl_xxx.xs file exist for this operating system
6444 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
6447 rp="Do you wish to use dynamic loading?"
6454 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
6455 dflt="$dldir/dl_${osname}.xs"
6456 elif $test "$d_dlopen" = "$define" ; then
6457 dflt="$dldir/dl_dlopen.xs"
6458 elif $test "$i_dld" = "$define" ; then
6459 dflt="$dldir/dl_dld.xs"
6464 *) dflt="$dldir/$dlsrc"
6467 echo "The following dynamic loading files are available:"
6468 : Can not go over to $dldir because getfile has path hard-coded in.
6469 tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir
6470 rp="Source file to use for dynamic loading"
6476 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
6480 Some systems may require passing special flags to $cc -c to
6481 compile modules that will be used to create a shared library.
6482 To use no flags, say "none".
6485 case "$cccdlflags" in
6486 '') case "$gccversion" in
6487 '') case "$osname" in
6489 next) dflt='none' ;;
6490 irix*) dflt='-KPIC' ;;
6491 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
6492 sunos) dflt='-pic' ;;
6496 *) case "$osname" in
6497 svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
6502 *) dflt="$cccdlflags" ;;
6504 rp="Any special flags to pass to $cc -c to compile shared library modules?"
6507 none) cccdlflags=' ' ;;
6508 *) cccdlflags="$ans" ;;
6513 Some systems use ld to create libraries that can be dynamically loaded,
6514 while other systems (such as those using ELF) use $cc.
6518 '') $cat >try.c <<'EOM'
6519 /* Test for whether ELF binaries are produced */
6524 int i = open("a.out",O_RDONLY);
6527 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
6528 exit(0); /* succeed (yes, it's ELF) */
6533 if $cc $ccflags try.c >/dev/null 2>&1 && ./a.out; then
6535 You appear to have ELF support. I'll use $cc to build dynamic libraries.
6539 echo "I'll use ld to build dynamic libraries."
6548 rp="What command should be used to create dynamic libraries?"
6554 Some systems may require passing special flags to $ld to create a
6555 library that can be dynamically loaded. If your ld flags include
6556 -L/other/path options to locate libraries outside your loader's normal
6557 search path, you may need to specify those -L options here as well. To
6558 use no flags, say "none".
6561 case "$lddlflags" in
6562 '') case "$osname" in
6563 beos) dflt='-nostart' ;;
6565 case "$gccversion" in
6566 '') dflt="$dflt +vnocompatwarnings" ;;
6569 linux|irix*) dflt='-shared' ;;
6570 next) dflt='none' ;;
6571 solaris) dflt='-G' ;;
6572 sunos) dflt='-assert nodefinitions' ;;
6573 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
6577 *) dflt="$lddlflags" ;;
6580 : Try to guess additional flags to pick up local libraries.
6581 : Be careful not to append to a plain 'none'
6585 for thisflag in $ldflags; do
6590 *) dflt="$dflt $thisflag" ;;
6597 ''|' ') dflt='none' ;;
6600 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
6603 none) lddlflags=' ' ;;
6604 *) lddlflags="$ans" ;;
6609 Some systems may require passing special flags to $cc to indicate that
6610 the resulting executable will use dynamic linking. To use no flags,
6614 case "$ccdlflags" in
6615 '') case "$osname" in
6616 hpux) dflt='-Wl,-E' ;;
6617 linux) dflt='-rdynamic' ;;
6618 next) dflt='none' ;;
6619 sunos) dflt='none' ;;
6623 *) dflt="$ccdlflags" ;;
6625 rp="Any special flags to pass to $cc to use dynamic linking?"
6628 none) ccdlflags=' ' ;;
6629 *) ccdlflags="$ans" ;;
6643 # No dynamic loading being used, so don't bother even to prompt.
6646 *) case "$useshrplib" in
6647 '') case "$osname" in
6648 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
6650 also='Building a shared libperl is required for dynamic loading to work on your system.'
6655 also='Building a shared libperl is needed for MAB support.'
6673 The perl executable is normally obtained by linking perlmain.c with
6674 libperl${_a}, any static extensions (usually just DynaLoader), and
6675 any other libraries needed on this system (such as -lm, etc.). Since
6676 your system supports dynamic loading, it is probably possible to build
6677 a shared libperl.$so. If you will have more than one executable linked
6678 to libperl.$so, this will significantly reduce the size of each
6679 executable, but it may have a noticeable affect on performance. The
6680 default is probably sensible for your system.
6684 rp="Build a shared libperl.$so (y/n)"
6688 useshrplib='true' ;;
6689 *) useshrplib='false' ;;
6694 case "$useshrplib" in
6698 # Figure out a good name for libperl.so. Since it gets stored in
6699 # a version-specific architecture-dependent library, the version
6700 # number isn't really that important, except for making cc/ld happy.
6702 # A name such as libperl.so.3.1
6703 majmin="libperl.$so.$patchlevel.$subversion"
6704 # A name such as libperl.so.301
6705 majonly=`echo $patchlevel $subversion |
6706 $awk '{printf "%d%02d", $1, $2}'`
6707 majonly=libperl.$so.$majonly
6708 # I'd prefer to keep the os-specific stuff here to a minimum, and
6709 # rely on figuring it out from the naming of libc.
6710 case "${osname}${osvers}" in
6713 # XXX How handle the --version stuff for MAB?
6715 linux*) # ld won't link with a bare -lperl otherwise.
6718 cygwin*) # include version
6719 dflt=`echo libperl$version | sed -e 's/\./_/g'`$lib_ext
6721 *) # Try to guess based on whether libc has major.minor.
6723 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
6724 *libc.$so.[0-9]*) dflt=$majonly ;;
6725 *) dflt=libperl.$so ;;
6735 I need to select a good name for the shared libperl. If your system uses
6736 library names with major and minor numbers, then you might want something
6737 like $majmin. Alternatively, if your system uses a single version
6738 number for shared libraries, then you might want to use $majonly.
6739 Or, your system might be quite happy with a simple libperl.$so.
6741 Since the shared libperl will get installed into a version-specific
6742 architecture-dependent directory, the version number of the shared perl
6743 library probably isn't important, so the default should be o.k.
6746 rp='What name do you want to give to the shared libperl?'
6749 echo "Ok, I'll use $libperl"
6752 libperl="libperl${_a}"
6756 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
6760 WARNING: Use of the shrpdir variable for the installation location of
6761 the shared $libperl is not supported. It was never documented and
6762 will not work in this version. Let me (perlbug@perl.org)
6763 know of any problems this may cause.
6769 But your current setting of $shrpdir is
6770 the default anyway, so it's harmless.
6775 Further, your current attempted setting of $shrpdir
6776 conflicts with the value of $archlibexp/CORE
6777 that installperl will use.
6784 # How will the perl executable find the installed shared $libperl?
6785 # Add $xxx to ccdlflags.
6786 # If we can't figure out a command-line option, use $shrpenv to
6787 # set env LD_RUN_PATH. The main perl makefile uses this.
6788 shrpdir=$archlibexp/CORE
6791 if "$useshrplib"; then
6794 # We'll set it in Makefile.SH...
6800 xxx="-Wl,-R$shrpdir"
6802 linux|irix*|dec_osf)
6803 xxx="-Wl,-rpath,$shrpdir"
6806 # next doesn't like the default...
6809 # beos doesn't like the default, either.
6812 # hpux doesn't like the default, either.
6813 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
6816 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
6822 # Only add $xxx if it isn't already in ccdlflags.
6823 case " $ccdlflags " in
6825 *) ccdlflags="$ccdlflags $xxx"
6828 Adding $xxx to the flags
6829 passed to $ld so that the perl executable will find the
6830 installed shared $libperl.
6838 # Fix ccdlflags in AIX for building external extensions.
6839 # (For building Perl itself bare -bE:perl.exp is needed,
6840 # Makefile.SH takes care of this.)
6842 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
6844 # Respect a hint or command-line value.
6846 '') shrpenv="$tmp_shrpenv" ;;
6848 case "$ldlibpthname" in
6849 '') ldlibpthname=LD_LIBRARY_PATH ;;
6850 none) ldlibpthname='' ;;
6853 : determine where manual pages are on this system
6857 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
6858 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
6859 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
6860 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
6861 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
6862 sysman=`./loc . /usr/man/man1 $syspath`
6865 if $test -d "$sysman"; then
6866 echo "System manual is in $sysman." >&4
6868 echo "Could not find manual pages in source form." >&4
6871 : determine where manual pages go
6872 set man1dir man1dir none
6876 $spackage has manual pages available in source form.
6880 echo "However, you don't have nroff, so they're probably useless to you."
6882 '') man1dir="none";;
6885 echo "If you don't want the manual sources installed, answer 'none'."
6890 lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
6891 lookpath="$lookpath $prefixexp/man/p_man/man1"
6892 lookpath="$lookpath $prefixexp/man/u_man/man1"
6893 lookpath="$lookpath $prefixexp/man/man.1"
6895 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
6896 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
6906 rp="Where do the main $spackage manual pages (source) go?"
6908 if $test "X$man1direxp" != "X$ansexp"; then
6912 man1direxp="$ansexp"
6918 : Change installation prefix, if necessary.
6919 if $test X"$prefix" != X"$installprefix"; then
6920 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
6922 installman1dir="$man1direxp"
6925 : What suffix to use on installed man pages
6932 rp="What suffix should be used for the main $spackage man pages?"
6934 '') case "$man1dir" in
6948 *) dflt="$man1ext";;
6955 : see if we can have long filenames
6957 first=123456789abcdef
6959 if (echo hi >$first) 2>/dev/null; then
6960 if $test -f 123456789abcde; then
6961 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
6964 echo 'You can have filenames longer than 14 characters.'>&4
6969 You can't have filenames longer than 14 chars.
6970 You can't even think about them!
6976 $rm -rf 123456789abcde*
6978 : determine where library module manual pages go
6979 set man3dir man3dir none
6983 $spackage has manual pages for many of the library modules.
6989 However, you don't have nroff, so they're probably useless to you.
6992 '') man3dir="none";;
6996 case "$d_flexfnam" in
6999 However, your system can't handle the long file names like File::Basename.3.
7002 '') man3dir="none";;
7006 echo "If you don't want the manual sources installed, answer 'none'."
7007 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7009 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
7010 if $test -d "$privlib/man/man3"; then
7013 WARNING: Previous versions of perl installed man3 pages into
7014 $privlib/man/man3. This version will suggest a
7015 new default of $dflt.
7019 rp='Do you wish to preserve the old behavior?(y/n)'
7022 y*) dflt="$privlib/man/man3" ;;
7027 *) dflt="$man3dir" ;;
7034 rp="Where do the $package library man pages (source) go?"
7037 man3direxp="$ansexp"
7043 : Change installation prefix, if necessary.
7044 if $test X"$prefix" != X"$installprefix"; then
7045 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
7047 installman3dir="$man3direxp"
7050 : What suffix to use on installed man pages
7056 rp="What suffix should be used for the $package library man pages?"
7058 '') case "$man3dir" in
7072 *) dflt="$man3ext";;
7079 : see if we have to deal with yellow pages, now NIS.
7080 if $test -d /usr/etc/yp || $test -d /etc/yp; then
7081 if $test -f /usr/etc/nibindd; then
7083 echo "I'm fairly confident you're on a NeXT."
7085 rp='Do you get the hosts file via NetInfo?'
7094 y*) hostcat='nidump hosts .';;
7095 *) case "$hostcat" in
7096 nidump*) hostcat='';;
7106 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
7114 rp='Are you getting the hosts file via yellow pages?'
7117 y*) hostcat='ypcat hosts';;
7118 *) hostcat='cat /etc/hosts';;
7124 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
7127 '') test -f /etc/group && groupcat='cat /etc/group';;
7130 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
7133 : now get the host name
7135 echo "Figuring out host name..." >&4
7136 case "$myhostname" in
7138 echo 'Maybe "hostname" will work...'
7139 if tans=`$sh_c hostname 2>&1` ; then
7147 if $test "$cont"; then
7149 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
7150 if tans=`cat /etc/systemid 2>&1` ; then
7152 phostname='cat /etc/systemid'
7153 echo "Whadyaknow. Xenix always was a bit strange..."
7156 elif $test -r /etc/systemid; then
7157 echo "(What is a non-Xenix system doing with /etc/systemid?)"
7160 if $test "$cont"; then
7161 echo 'No, maybe "uuname -l" will work...'
7162 if tans=`$sh_c 'uuname -l' 2>&1` ; then
7164 phostname='uuname -l'
7166 echo 'Strange. Maybe "uname -n" will work...'
7167 if tans=`$sh_c 'uname -n' 2>&1` ; then
7169 phostname='uname -n'
7171 echo 'Oh well, maybe I can mine it out of whoami.h...'
7172 if tans=`$sh_c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
7173 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
7174 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
7176 case "$myhostname" in
7177 '') echo "Does this machine have an identity crisis or something?"
7180 echo "Well, you said $myhostname before..."
7181 phostname='echo $myhostname';;
7187 : you do not want to know about this
7192 if $test "$myhostname" ; then
7194 rp='Your host name appears to be "'$myhostname'".'" Right?"
7202 : bad guess or no guess
7203 while $test "X$myhostname" = X ; do
7205 rp="Please type the (one word) name of your host:"
7210 : translate upper to lower if necessary
7211 case "$myhostname" in
7213 echo "(Normalizing case in your host name)"
7214 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
7218 case "$myhostname" in
7220 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
7221 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
7222 echo "(Trimming domain name from host name--host name is now $myhostname)"
7224 *) case "$mydomain" in
7227 test "X$hostcat" = "Xypcat hosts" &&
7228 ypmatch "$myhostname" hosts 2>/dev/null |\
7229 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
7232 test "X$hostcat" != "X" &&
7233 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
7234 /[ ]$myhostname[ . ]/p" > hosts
7237 if $test -f hosts; then
7238 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
7239 END { print sum }" hosts` = x1 || tmp_re="[ ]"
7240 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
7241 hosts | $sort | $uniq | \
7242 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
7243 case `$echo X$dflt` in
7244 X*\ *) echo "(Several hosts in the database matched hostname)"
7247 X.) echo "(You do not have fully-qualified names in the hosts database)"
7251 echo "(I cannot locate a hosts database anywhere)"
7256 tans=`./loc resolv.conf X /etc /usr/etc`
7257 if $test -f "$tans"; then
7258 echo "(Attempting domain name extraction from $tans)"
7259 dflt=.`$sed -n -e 's/ / /g' \
7260 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
7261 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
7263 .) dflt=.`$sed -n -e 's/ / /g' \
7264 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
7265 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
7272 .) echo "(No help from resolv.conf either -- attempting clever guess)"
7273 dflt=.`$sh_c domainname 2>/dev/null`
7276 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
7281 .) echo "(Lost all hope -- silly guess then)"
7287 *) dflt="$mydomain";;
7291 rp="What is your domain name?"
7301 : translate upper to lower if necessary
7304 echo "(Normalizing case in your domain name)"
7305 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
7309 : a little sanity check here
7310 case "$phostname" in
7313 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
7314 $myhostname$mydomain|$myhostname) ;;
7316 case "$phostname" in
7318 echo "(That doesn't agree with your whoami.h file, by the way.)"
7321 echo "(That doesn't agree with your $phostname command, by the way.)"
7331 I need to get your e-mail address in Internet format if possible, i.e.
7332 something like user@host.domain. Please answer accurately since I have
7333 no easy means to double check it. The default value provided below
7334 is most probably close to reality but may not be valid from outside
7335 your organization...
7339 while test "$cont"; do
7341 '') dflt="$cf_by@$myhostname$mydomain";;
7342 *) dflt="$cf_email";;
7344 rp='What is your e-mail address?'
7350 rp='Address does not look like an Internet one. Use it anyway?'
7366 If you or somebody else will be maintaining perl at your site, please
7367 fill in the correct e-mail address here so that they may be contacted
7368 if necessary. Currently, the "perlbug" program included with perl
7369 will send mail to this address in addition to perlbug@perl.org. You may
7370 enter "none" for no administrator.
7373 case "$perladmin" in
7374 '') dflt="$cf_email";;
7375 *) dflt="$perladmin";;
7377 rp='Perl administrator e-mail address'
7381 : determine whether to only install version-specific parts.
7384 Do you want to install only the version-specific parts of the perl
7385 distribution? Usually you do *not* want to do this.
7387 case "$versiononly" in
7388 "$define"|[Yy]*|true) dflt='y' ;;
7391 rp="Do you want to install only the version-specific parts of perl?"
7394 [yY]*) val="$define";;
7400 : figure out how to guarantee perl startup
7401 case "$startperl" in
7403 case "$sharpbang" in
7407 I can use the #! construct to start perl on your system. This will
7408 make startup of perl scripts faster, but may cause problems if you
7409 want to share those scripts and perl is not in a standard place
7410 ($binexp/perl) on all your platforms. The alternative is to force
7411 a shell by starting the script with a single ':' character.
7414 case "$versiononly" in
7415 "$define") dflt="$binexp/perl$version";;
7416 *) dflt="$binexp/perl";;
7418 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
7421 none) startperl=": # use perl";;
7422 *) startperl="#!$ans"
7423 if $test 30 -lt `echo "$ans" | wc -c`; then
7426 WARNING: Some systems limit the #! command to 32 characters.
7427 If you experience difficulty running Perl scripts with #!, try
7428 installing Perl in a directory with a shorter pathname.
7434 *) startperl=": # use perl"
7439 echo "I'll use $startperl to start perl scripts."
7441 : figure best path for perl in scripts
7444 perlpath="$binexp/perl"
7445 case "$startperl" in
7450 I will use the "eval 'exec'" idiom to start Perl on your system.
7451 I can use the full path of your Perl binary for this purpose, but
7452 doing so may cause problems if you want to share those scripts and
7453 Perl is not always in a standard place ($binexp/perl).
7457 rp="What path shall I use in \"eval 'exec'\"?"
7464 case "$startperl" in
7466 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
7469 : determine where public executable scripts go
7470 set scriptdir scriptdir
7472 case "$scriptdir" in
7475 : guess some guesses
7476 $test -d /usr/share/scripts && dflt=/usr/share/scripts
7477 $test -d /usr/share/bin && dflt=/usr/share/bin
7478 $test -d /usr/local/script && dflt=/usr/local/script
7479 $test -d /usr/local/scripts && dflt=/usr/local/scripts
7480 $test -d $prefixexp/script && dflt=$prefixexp/script
7484 *) dflt="$scriptdir"
7489 Some installations have a separate directory just for executable scripts so
7490 that they can mount it across multiple architectures but keep the scripts in
7491 one spot. You might, for example, have a subdirectory of /usr/share for this.
7492 Or you might just lump your scripts in with all your other executables.
7496 rp='Where do you keep publicly executable scripts?'
7498 if $test "X$ansexp" != "X$scriptdirexp"; then
7502 scriptdirexp="$ansexp"
7503 : Change installation prefix, if necessary.
7504 if $test X"$prefix" != X"$installprefix"; then
7505 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
7507 installscript="$scriptdirexp"
7510 : determine where add-on public executables go
7512 '') dflt=$siteprefix/bin ;;
7516 rp='Pathname where the add-on public executables should be installed?'
7519 sitebinexp="$ansexp"
7520 : Change installation prefix, if necessary.
7521 if $test X"$prefix" != X"$installprefix"; then
7522 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
7524 installsitebin="$sitebinexp"
7527 case "$useperlio" in
7528 $define|true|[yY]*) dflt='y';;
7533 Previous version of $package used the standard IO mechanisms as
7534 defined in <stdio.h>. Versions 5.003_02 and later of perl allow
7535 alternate IO mechanisms via the PerlIO abstraction layer, but the
7536 stdio mechanism is still the default. This abstraction layer can
7537 use AT&T's sfio (if you already have sfio installed) or regular stdio.
7538 Using PerlIO with sfio may cause problems with some extension modules.
7540 If this doesn't make any sense to you, just accept the default '$dflt'.
7542 rp='Use the experimental PerlIO abstraction layer?'
7549 echo "Ok, doing things the stdio way."
7558 case "$useperlio" in
7559 $define|true|[yY]*) ;;
7562 You are using the SOCKS proxy protocol library which means that you
7563 should also use the PerlIO layer. You may be headed for trouble.
7572 case "$vendorprefix" in
7573 '') d_vendorbin="$undef"
7577 *) d_vendorbin="$define"
7578 : determine where vendor-supplied executables go.
7579 case "$vendorbin" in
7580 '') dflt=$vendorprefix/bin ;;
7581 *) dflt="$vendorbin" ;;
7584 rp='Pathname for the vendor-supplied executables directory?'
7587 vendorbinexp="$ansexp"
7590 : Change installation prefix, if necessary.
7591 if $test X"$prefix" != X"$installprefix"; then
7592 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
7594 installvendorbin="$vendorbinexp"
7597 : see if qgcvt exists
7603 if $test X"$d_longdbl" = X"$define"; then
7605 echo "Checking how to print long doubles..." >&4
7607 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
7608 $cat >try.c <<'EOCP'
7609 #include <sys/types.h>
7613 printf("%.3f\n", d);
7617 if eval $compile; then
7621 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
7622 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
7623 echo "We will use %f."
7629 if $test X"$sPRIfldbl" = X; then
7630 $cat >try.c <<'EOCP'
7631 #include <sys/types.h>
7634 long double d = 123.456;
7635 printf("%.3llf\n", d);
7639 if eval $compile; then
7643 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
7644 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
7645 echo "We will use %llf."
7651 if $test X"$sPRIfldbl" = X; then
7652 $cat >try.c <<'EOCP'
7653 #include <sys/types.h>
7656 long double d = 123.456;
7657 printf("%.3Lf\n", d);
7661 if eval $compile; then
7665 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
7666 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
7667 echo "We will use %Lf."
7673 if $test X"$sPRIfldbl" = X; then
7674 $cat >try.c <<'EOCP'
7675 #include <sys/types.h>
7678 long double d = 123.456;
7679 printf("%.3lf\n", d);
7683 if eval $compile; then
7687 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
7688 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
7689 echo "We will use %lf."
7695 if $test X"$sPRIfldbl" = X; then
7696 echo "Cannot figure out how to print long doubles." >&4
7698 sSCNfldbl=$sPRIfldbl # expect consistency
7705 case "$sPRIfldbl" in
7706 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
7707 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
7708 d_SCNfldbl="$undef";
7710 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
7711 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
7712 d_SCNfldbl="$define";
7716 : Check how to convert floats to strings.
7718 echo "Checking for an efficient way to convert floats to strings."
7720 case "$uselongdouble" in
7721 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
7723 case "$d_longdbl" in
7724 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
7726 case "$d_PRIgldbl" in
7727 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
7731 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
7732 char *myname = "gconvert";
7735 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
7736 char *myname = "gcvt";
7739 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
7740 char *myname = "qgcvt";
7741 #define DOUBLETYPE long double
7744 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE) && defined(HAS_PRIgldbl)
7745 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
7747 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
7749 char *myname = "sprintf";
7753 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
7754 #define DOUBLETYPE long double
7756 #define DOUBLETYPE double
7762 #define I_STDLIB $i_stdlib
7768 checkit(expect, got)
7772 if (strcmp(expect, got)) {
7773 printf("%s oddity: Expected %s, got %s\n",
7774 myname, expect, got);
7784 /* This must be 1st test on (which?) platform */
7785 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
7786 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
7787 checkit("0.1", buf);
7789 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
7792 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
7793 checkit("1.1", buf);
7795 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
7796 checkit("1.01", buf);
7798 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
7799 checkit("1.001", buf);
7801 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
7802 checkit("1.0001", buf);
7804 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
7805 checkit("1.00001", buf);
7807 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
7808 checkit("1.000001", buf);
7810 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
7813 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
7816 /* Some Linux gcvt's give 1.e+5 here. */
7817 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
7818 checkit("100000", buf);
7820 /* Some Linux gcvt's give -1.e+5 here. */
7821 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
7822 checkit("-100000", buf);
7824 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
7825 checkit("123.456", buf);
7830 case "$d_Gconvert" in
7831 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
7832 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
7833 sprintf*) xxx_list='sprintf gconvert gcvt' ;;
7834 *) xxx_list='gconvert gcvt sprintf' ;;
7837 case "$d_longdbl$uselongdouble$d_PRIgldbl" in
7838 "$define$define$define")
7839 # for long doubles prefer first qgcvt, then sprintf
7840 xxx_list="`echo $xxx_list|sed s/sprintf//`"
7841 xxx_list="sprintf $xxx_list"
7843 "$define") xxx_list="qgcvt $xxx_list" ;;
7848 for xxx_convert in $xxx_list; do
7849 echo "Trying $xxx_convert..."
7851 set try -DTRY_$xxx_convert
7852 if eval $compile; then
7853 echo "$xxx_convert() found." >&4
7855 echo "I'll use $xxx_convert to convert floats into a string." >&4
7858 echo "...But $xxx_convert didn't work as I expected."
7861 echo "$xxx_convert NOT found." >&4
7865 case "$xxx_convert" in
7866 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
7867 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
7868 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
7869 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
7870 "$define$define$define")
7871 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
7872 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
7877 : see if _fwalk exists
7881 : Initialize h_fcntl
7884 : Initialize h_sysfile
7887 : access call always available on UNIX
7891 : locate the flags for 'access()'
7895 $cat >access.c <<'EOCP'
7896 #include <sys/types.h>
7901 #include <sys/file.h>
7910 : check sys/file.h first, no particular reason here
7911 if $test `./findhdr sys/file.h` && \
7912 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
7914 echo "<sys/file.h> defines the *_OK access constants." >&4
7915 elif $test `./findhdr fcntl.h` && \
7916 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
7918 echo "<fcntl.h> defines the *_OK access constants." >&4
7919 elif $test `./findhdr unistd.h` && \
7920 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
7921 echo "<unistd.h> defines the *_OK access constants." >&4
7923 echo "I can't find the four *_OK access constants--I'll use mine." >&4
7929 : see if accessx exists
7930 set accessx d_accessx
7933 : see if alarm exists
7937 : see if atolf exists
7941 : see if atoll exists
7945 : Look for GNU-cc style attribute checking
7947 echo "Checking whether your compiler can handle __attribute__ ..." >&4
7948 $cat >attrib.c <<'EOCP'
7950 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
7952 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
7953 if $contains 'warning' attrib.out >/dev/null 2>&1; then
7954 echo "Your C compiler doesn't fully support __attribute__."
7957 echo "Your C compiler supports __attribute__."
7961 echo "Your C compiler doesn't seem to understand __attribute__ at all."
7968 : see if bcmp exists
7972 : see if bcopy exists
7976 : see if this is a unistd.h system
7977 set unistd.h i_unistd
7980 : see if getpgrp exists
7981 set getpgrp d_getpgrp
7984 case "$d_getpgrp" in
7987 echo "Checking to see which flavor of getpgrp is in use..."
7990 #include <sys/types.h>
7992 # include <unistd.h>
7996 if (getuid() == 0) {
7997 printf("(I see you are running Configure as super-user...)\n");
8001 if (getpgrp(1) == 0)
8010 if $cc -o set -DTRY_BSD_PGRP $ccflags $ldflags set.c $libs >/dev/null 2>&1 && ./set; then
8011 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
8013 elif $cc -o set $ccflags $ldflags set.c $libs >/dev/null 2>&1 && ./set; then
8014 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
8017 echo "I can't seem to compile and run the test program."
8019 xxx="a USG one, i.e. you use getpgrp()."
8021 # SVR4 systems can appear rather BSD-ish.
8024 xxx="a BSD one, i.e. you use getpgrp(pid)."
8028 xxx="probably a USG one, i.e. you use getpgrp()."
8033 echo "Assuming your getpgrp is $xxx" >&4
8042 : see if setpgrp exists
8043 set setpgrp d_setpgrp
8046 case "$d_setpgrp" in
8049 echo "Checking to see which flavor of setpgrp is in use..."
8052 #include <sys/types.h>
8054 # include <unistd.h>
8058 if (getuid() == 0) {
8059 printf("(I see you are running Configure as super-user...)\n");
8063 if (-1 == setpgrp(1, 1))
8066 if (setpgrp() != -1)
8072 if $cc -o set -DTRY_BSD_PGRP $ccflags $ldflags set.c $libs >/dev/null 2>&1 && ./set; then
8073 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
8075 elif $cc -o set $ccflags $ldflags set.c $libs >/dev/null 2>&1 && ./set; then
8076 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
8079 echo "(I can't seem to compile and run the test program.)"
8081 xxx="a USG one, i.e. you use setpgrp()."
8083 # SVR4 systems can appear rather BSD-ish.
8086 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
8090 xxx="probably a USG one, i.e. you use setpgrp()."
8095 echo "Assuming your setpgrp is $xxx" >&4
8103 : see if bzero exists
8107 : see if signal is declared as pointer to function returning int or void
8109 xxx=`./findhdr signal.h`
8110 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
8111 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
8112 echo "You have int (*signal())() instead of void." >&4
8114 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
8115 echo "You have void (*signal())()." >&4
8117 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
8118 echo "You have int (*signal())() instead of void." >&4
8120 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
8121 echo "You have void (*signal())()." >&4
8124 case "$d_voidsig" in
8126 echo "I can't determine whether signal handler returns void or int..." >&4
8128 rp="What type does your signal handler return?"
8135 echo "As you already told me, signal handler returns void." >&4
8138 *) echo "As you already told me, signal handler returns int." >&4
8145 case "$d_voidsig" in
8146 "$define") signal_t="void";;
8151 : check for ability to cast large floats to 32-bit ints.
8153 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
8154 if $test "$intsize" -ge 4; then
8161 #include <sys/types.h>
8163 $signal_t blech(s) int s; { exit(3); }
8170 signal(SIGFPE, blech);
8172 /* Don't let compiler optimize the test away. Store the number
8173 in a writable string for gcc to pass to sscanf under HP/UX.
8175 sprintf(str, "2147483647");
8176 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
8180 /* x86 processors will probably give 0x8000 0000, which is a
8181 sign change. We don't want that. We want to mimic SPARC
8182 behavior here, which is to preserve the sign and give
8185 if (i32 != ($xxx) f)
8191 if eval $compile_ok; then
8195 echo "(I can't seem to compile the test program--assuming it can't)"
8203 echo "Nope, it can't."
8210 : check for ability to cast negative floats to unsigned
8212 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
8215 #include <sys/types.h>
8217 $signal_t blech(s) int s; { exit(7); }
8218 $signal_t blech_in_list(s) int s; { exit(4); }
8219 unsigned long dummy_long(p) unsigned long p; { return p; }
8220 unsigned int dummy_int(p) unsigned int p; { return p; }
8221 unsigned short dummy_short(p) unsigned short p; { return p; }
8225 unsigned long along;
8227 unsigned short ashort;
8231 /* Frustrate gcc-2.7.2's optimizer which failed this test with
8232 a direct f = -123. assignment. gcc-2.8.0 reportedly
8233 optimized the whole file away
8235 /* Store the number in a writable string for gcc to pass to
8238 sprintf(str, "-123");
8239 sscanf(str, "%lf", &f); /* f = -123.; */
8241 signal(SIGFPE, blech);
8242 along = (unsigned long)f;
8243 aint = (unsigned int)f;
8244 ashort = (unsigned short)f;
8245 if (along != (unsigned long)-123)
8247 if (aint != (unsigned int)-123)
8249 if (ashort != (unsigned short)-123)
8251 sprintf(str, "1073741824.");
8252 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
8255 along = (unsigned long)f;
8256 if (along != 0x80000000)
8260 along = (unsigned long)f;
8261 if (along != 0x7fffffff)
8265 along = (unsigned long)f;
8266 if (along != 0x80000001)
8270 signal(SIGFPE, blech_in_list);
8271 sprintf(str, "123.");
8272 sscanf(str, "%lf", &f); /* f = 123.; */
8273 along = dummy_long((unsigned long)f);
8274 aint = dummy_int((unsigned int)f);
8275 ashort = dummy_short((unsigned short)f);
8276 if (along != (unsigned long)123)
8278 if (aint != (unsigned int)123)
8280 if (ashort != (unsigned short)123)
8287 if eval $compile_ok; then
8291 echo "(I can't seem to compile the test program--assuming it can't)"
8294 case "$castflags" in
8299 echo "Nope, it can't."
8306 : see if vprintf exists
8308 if set vprintf val -f d_vprintf; eval $csym; $val; then
8309 echo 'vprintf() found.' >&4
8311 $cat >vprintf.c <<'EOF'
8312 #include <varargs.h>
8314 int main() { xxx("foo"); }
8323 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
8327 if eval $compile && ./vprintf; then
8328 echo "Your vsprintf() returns (int)." >&4
8331 echo "Your vsprintf() returns (char*)." >&4
8335 echo 'vprintf() NOT found.' >&4
8345 : see if chown exists
8349 : see if chroot exists
8353 : see if chsize exists
8357 : check for const keyword
8359 echo 'Checking to see if your C compiler knows about "const"...' >&4
8360 $cat >const.c <<'EOCP'
8361 typedef struct spug { int drokk; } spug;
8368 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
8370 echo "Yup, it does."
8373 echo "Nope, it doesn't."
8378 : see if crypt exists
8380 if set crypt val -f d_crypt; eval $csym; $val; then
8381 echo 'crypt() found.' >&4
8385 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
8386 if $test -z "$cryptlib"; then
8387 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
8391 if $test -z "$cryptlib"; then
8392 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
8396 if $test -z "$cryptlib"; then
8397 cryptlib=`./loc libcrypt$_a "" $libpth`
8401 if $test -z "$cryptlib"; then
8402 echo 'crypt() NOT found.' >&4
8411 : get csh whereabouts
8413 'csh') val="$undef" ;;
8418 : Respect a hint or command line value for full_csh.
8420 '') full_csh=$csh ;;
8423 : see if cuserid exists
8424 set cuserid d_cuserid
8427 : see if this is a limits.h system
8428 set limits.h i_limits
8431 : see if this is a float.h system
8435 : See if number of significant digits in a double precision number is known
8437 $cat >dbl_dig.c <<EOM
8447 printf("Contains DBL_DIG");
8450 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
8451 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
8452 echo "DBL_DIG found." >&4
8455 echo "DBL_DIG NOT found." >&4
8462 : see if difftime exists
8463 set difftime d_difftime
8466 : see if this is a dirent system
8468 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
8470 echo "<dirent.h> found." >&4
8473 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
8474 echo "<sys/dir.h> found." >&4
8477 xinc=`./findhdr sys/ndir.h`
8479 echo "<dirent.h> NOT found." >&4
8484 : Look for type of directory structure.
8486 $cppstdin $cppflags $cppminus < "$xinc" > try.c
8488 case "$direntrytype" in
8491 $define) guess1='struct dirent' ;;
8492 *) guess1='struct direct' ;;
8495 *) guess1="$direntrytype"
8500 'struct dirent') guess2='struct direct' ;;
8501 *) guess2='struct dirent' ;;
8504 if $contains "$guess1" try.c >/dev/null 2>&1; then
8505 direntrytype="$guess1"
8506 echo "Your directory entries are $direntrytype." >&4
8507 elif $contains "$guess2" try.c >/dev/null 2>&1; then
8508 direntrytype="$guess2"
8509 echo "Your directory entries seem to be $direntrytype." >&4
8511 echo "I don't recognize your system's directory entries." >&4
8512 rp="What type is used for directory entries on this system?"
8520 : see if the directory entry stores field length
8522 $cppstdin $cppflags $cppminus < "$xinc" > try.c
8523 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
8524 echo "Good, your directory entry keeps length information in d_namlen." >&4
8527 echo "Your directory entry does not know about the d_namlen field." >&4
8534 : see if dlerror exists
8537 set dlerror d_dlerror
8541 : see if dlfcn is available
8549 On a few systems, the dynamically loaded modules that perl generates and uses
8550 will need a different extension than shared libs. The default will probably
8558 rp='What is the extension of dynamically loaded modules'
8567 : Check if dlsym need a leading underscore
8573 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
8574 $cat >dyna.c <<'EOM'
8583 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
8585 #include <sys/types.h>
8599 int mode = RTLD_LAZY ;
8601 handle = dlopen("./dyna.$dlext", mode) ;
8602 if (handle == NULL) {
8607 symbol = dlsym(handle, "fred") ;
8608 if (symbol == NULL) {
8609 /* try putting a leading underscore */
8610 symbol = dlsym(handle, "_fred") ;
8611 if (symbol == NULL) {
8624 : Call the object file tmp-dyna.o in case dlext=o.
8625 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
8626 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
8627 $ld -o dyna.$dlext $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
8628 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then
8631 1) echo "Test program failed using dlopen." >&4
8632 echo "Perhaps you should not use dynamic loading." >&4;;
8633 2) echo "Test program failed using dlsym." >&4
8634 echo "Perhaps you should not use dynamic loading." >&4;;
8635 3) echo "dlsym needs a leading underscore" >&4
8637 4) echo "dlsym doesn't need a leading underscore." >&4;;
8640 echo "I can't compile and run the test program." >&4
8641 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
8646 $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
8651 hasproto='varname=$1; func=$2; shift; shift;
8652 while $test $# -ge 2; do
8654 $define) echo "#include <$2>";;
8658 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
8659 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
8660 echo "$func() prototype found.";
8663 echo "$func() prototype NOT found.";
8668 $rm -f try.c tryout.c'
8670 : see if prototype for drand48 is available
8672 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
8675 : see if dup2 exists
8679 : see if eaccess exists
8680 set eaccess d_eaccess
8683 : see if endgrent exists
8684 set endgrent d_endgrent
8687 : see if endhostent exists
8688 set endhostent d_endhent
8691 : see if endnetent exists
8692 set endnetent d_endnent
8695 : see if endprotoent exists
8696 set endprotoent d_endpent
8699 : see if endpwent exists
8700 set endpwent d_endpwent
8703 : see if endservent exists
8704 set endservent d_endsent
8707 : Locate the flags for 'open()'
8709 $cat >open3.c <<'EOCP'
8710 #include <sys/types.h>
8715 #include <sys/file.h>
8726 : check sys/file.h first to get FREAD on Sun
8727 if $test `./findhdr sys/file.h` && \
8728 set open3 -DI_SYS_FILE && eval $compile; then
8730 echo "<sys/file.h> defines the O_* constants..." >&4
8732 echo "and you have the 3 argument form of open()." >&4
8735 echo "but not the 3 argument form of open(). Oh, well." >&4
8738 elif $test `./findhdr fcntl.h` && \
8739 set open3 -DI_FCNTL && eval $compile; then
8741 echo "<fcntl.h> defines the O_* constants..." >&4
8743 echo "and you have the 3 argument form of open()." >&4
8746 echo "but not the 3 argument form of open(). Oh, well." >&4
8751 echo "I can't find the O_* constant definitions! You got problems." >&4
8757 : see which of string.h or strings.h is needed
8759 strings=`./findhdr string.h`
8760 if $test "$strings" && $test -r "$strings"; then
8761 echo "Using <string.h> instead of <strings.h>." >&4
8765 strings=`./findhdr strings.h`
8766 if $test "$strings" && $test -r "$strings"; then
8767 echo "Using <strings.h> instead of <string.h>." >&4
8769 echo "No string header found -- You'll surely have problems." >&4
8775 "$undef") strings=`./findhdr strings.h`;;
8776 *) strings=`./findhdr string.h`;;
8779 : check for non-blocking I/O stuff
8780 case "$h_sysfile" in
8781 true) echo "#include <sys/file.h>" > head.c;;
8784 true) echo "#include <fcntl.h>" > head.c;;
8785 *) echo "#include <sys/fcntl.h>" > head.c;;
8790 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
8791 case "$o_nonblock" in
8794 $cat >>try.c <<'EOCP'
8798 printf("O_NONBLOCK\n");
8802 printf("O_NDELAY\n");
8806 printf("FNDELAY\n");
8813 if eval $compile_ok; then
8815 case "$o_nonblock" in
8816 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
8817 *) echo "Seems like we can use $o_nonblock.";;
8820 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
8823 *) echo "Using $hint value $o_nonblock.";;
8825 $rm -f try try.* .out core
8828 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
8834 #include <sys/types.h>
8837 #define MY_O_NONBLOCK $o_nonblock
8838 #ifndef errno /* XXX need better Configure test */
8849 #include <strings.h>
8851 $signal_t blech(x) int x; { exit(3); }
8853 $cat >> try.c <<'EOCP'
8861 pipe(pd); /* Down: child -> parent */
8862 pipe(pu); /* Up: parent -> child */
8865 close(pd[1]); /* Parent reads from pd[0] */
8866 close(pu[0]); /* Parent writes (blocking) to pu[1] */
8867 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
8869 signal(SIGALRM, blech);
8871 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
8873 sprintf(string, "%d\n", ret);
8874 write(2, string, strlen(string));
8877 if (errno == EAGAIN) {
8883 if (errno == EWOULDBLOCK)
8884 printf("EWOULDBLOCK\n");
8887 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
8888 sleep(2); /* Give it time to close our pipe */
8890 ret = read(pd[0], buf, 1); /* Should read EOF */
8892 sprintf(string, "%d\n", ret);
8893 write(3, string, strlen(string));
8897 close(pd[0]); /* We write to pd[1] */
8898 close(pu[1]); /* We read from pu[0] */
8899 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
8900 close(pd[1]); /* Pipe pd is now fully closed! */
8901 exit(0); /* Bye bye, thank you for playing! */
8905 if eval $compile_ok; then
8906 echo "$startsh" >mtry
8907 echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
8909 ./mtry >/dev/null 2>&1
8911 0) eagain=`$cat try.out`;;
8912 1) echo "Could not perform non-blocking setting!";;
8913 2) echo "I did a successful read() for something that was not there!";;
8914 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
8915 *) echo "Something terribly wrong happened during testing.";;
8917 rd_nodata=`$cat try.ret`
8918 echo "A read() system call with no data present returns $rd_nodata."
8919 case "$rd_nodata" in
8922 echo "(That's peculiar, fixing that to be -1.)"
8928 echo "Forcing errno EAGAIN on read() with no data available."
8932 echo "Your read() sets errno to $eagain when no data is available."
8935 status=`$cat try.err`
8937 0) echo "And it correctly returns 0 to signal EOF.";;
8938 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
8939 *) echo "However, your read() returns '$status' on EOF??";;
8942 if test "$status" = "$rd_nodata"; then
8943 echo "WARNING: you can't distinguish between EOF and no data!"
8947 echo "I can't compile the test program--assuming errno EAGAIN will do."
8954 echo "Using $hint value $eagain."
8955 echo "Your read() returns $rd_nodata when no data is present."
8956 case "$d_eofnblk" in
8957 "$define") echo "And you can see EOF because read() returns 0.";;
8958 "$undef") echo "But you can't see EOF status from read() returned value.";;
8960 echo "(Assuming you can't see EOF status from read anyway.)"
8966 $rm -f try try.* .out core head.c mtry
8968 : see if fchmod exists
8972 : see if fchown exists
8976 : see if this is an fcntl system
8981 : See if fcntl-based locking works.
8982 $cat >try.c <<'EOCP'
8987 #if defined(F_SETLK) && defined(F_SETLKW)
8990 fd = open("try.c", O_RDONLY);
8991 flock.l_type = F_RDLCK;
8992 flock.l_whence = SEEK_SET;
8993 flock.l_start = flock.l_len = 0;
8994 retval = fcntl(fd, F_SETLK, &flock);
8996 (retval < 0 ? exit(2) : exit(0));
9002 echo "Checking if fcntl-based file locking works... "
9006 if eval $compile_ok; then
9008 echo "Yes, it seems to work."
9011 echo "Nope, it didn't work."
9015 echo "I'm unable to compile the test program, so I'll assume not."
9020 echo "Nope, since you don't even have fcntl()."
9023 set d_fcntl_can_lock
9028 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
9029 while $test $# -ge 2; do
9031 $define) echo "#include <$2>";;
9035 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
9037 if eval $compile; then
9048 : see whether socket exists
9050 $echo $n "Hmm... $c" >&4
9051 if set socket val -f d_socket; eval $csym; $val; then
9052 echo "Looks like you have Berkeley networking support." >&4
9054 if set setsockopt val -f; eval $csym; $val; then
9057 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
9061 if $contains socklib libc.list >/dev/null 2>&1; then
9062 echo "Looks like you have Berkeley networking support." >&4
9064 : we will have to assume that it supports the 4.2 BSD interface
9067 echo "You don't have Berkeley networking in libc$_a..." >&4
9068 if test "X$d_socket" = "X$define"; then
9069 echo "...but you seem to believe that you have sockets." >&4
9071 for net in net socket
9073 if test -f /usr/lib/lib$net$_a; then
9074 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
9075 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
9076 if $contains socket libc.list >/dev/null 2>&1; then
9081 echo "...but the Wollongong group seems to have hacked it in." >&4
9082 sockethdr="-I/usr/netinclude"
9085 echo "Found Berkeley sockets interface in lib$net." >& 4
9086 if $contains setsockopt libc.list >/dev/null 2>&1; then
9089 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
9096 if test "X$d_socket" != "X$define"; then
9097 echo "or anywhere else I see." >&4
9105 : see if socketpair exists
9106 set socketpair d_sockpair
9111 echo "Checking the availability of certain socket constants..." >& 4
9112 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
9113 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
9115 #include <sys/types.h>
9116 #include <sys/socket.h>
9122 set try; if eval $compile; then
9125 set d_${enum}; eval $setvar
9129 : see if sys/select.h has to be included
9130 set sys/select.h i_sysselct
9133 : see if we should include time.h, sys/time.h, or both
9135 if test "X$timeincl" = X; then
9136 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9137 $echo $n "I'm now running the test program...$c"
9138 $cat >try.c <<'EOCP'
9139 #include <sys/types.h>
9144 #ifdef SYSTIMEKERNEL
9147 #include <sys/time.h>
9150 #include <sys/select.h>
9159 struct timezone tzp;
9161 if (foo.tm_sec == foo.tm_sec)
9164 if (bar.tv_sec == bar.tv_sec)
9171 for s_timezone in '-DS_TIMEZONE' ''; do
9173 for s_timeval in '-DS_TIMEVAL' ''; do
9174 for i_systimek in '' '-DSYSTIMEKERNEL'; do
9175 for i_time in '' '-DI_TIME'; do
9176 for i_systime in '-DI_SYSTIME' ''; do
9179 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
9180 if eval $compile; then
9181 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
9185 $echo $n "Succeeded with $flags$c"
9197 *SYSTIMEKERNEL*) i_systimek="$define"
9198 timeincl=`./findhdr sys/time.h`
9199 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
9200 *) i_systimek="$undef";;
9203 *I_TIME*) i_time="$define"
9204 timeincl=`./findhdr time.h`" $timeincl"
9205 echo "We'll include <time.h>." >&4;;
9206 *) i_time="$undef";;
9209 *I_SYSTIME*) i_systime="$define"
9210 timeincl=`./findhdr sys/time.h`" $timeincl"
9211 echo "We'll include <sys/time.h>." >&4;;
9212 *) i_systime="$undef";;
9217 : check for fd_set items
9220 Checking to see how well your C compiler handles fd_set and friends ...
9222 $cat >fd_set.c <<EOCP
9223 #$i_systime I_SYS_TIME
9224 #$i_sysselct I_SYS_SELECT
9225 #$d_socket HAS_SOCKET
9226 #include <sys/types.h>
9228 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
9231 #include <sys/time.h>
9234 #include <sys/select.h>
9243 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
9250 set fd_set -DTRYBITS
9251 if eval $compile; then
9252 d_fds_bits="$define"
9254 echo "Well, your system knows about the normal fd_set typedef..." >&4
9256 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
9257 d_fd_macros="$define"
9260 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
9262 d_fd_macros="$undef"
9266 Hmm, your compiler has some difficulty with fd_set. Checking further...
9269 if eval $compile; then
9272 echo "Well, your system has some sort of fd_set available..." >&4
9274 echo "and you have the normal fd_set macros." >&4
9275 d_fd_macros="$define"
9278 but not the normal fd_set macros! Gross! More work for me...
9280 d_fd_macros="$undef"
9283 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
9286 d_fd_macros="$undef"
9291 : see if fgetpos exists
9292 set fgetpos d_fgetpos
9295 : see if flock exists
9299 : see if fork exists
9303 : see if pathconf exists
9304 set pathconf d_pathconf
9307 : see if fpathconf exists
9308 set fpathconf d_fpathconf
9312 : check for fpos64_t
9314 echo "Checking to see if you have fpos64_t..." >&4
9317 int main() { fpos64_t x = 7; }
9320 if eval $compile; then
9322 echo "You have fpos64_t."
9325 echo "You do not have fpos64_t."
9327 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
9334 : see if frexpl exists
9338 hasstruct='varname=$1; struct=$2; shift; shift;
9339 while $test $# -ge 2; do
9341 $define) echo "#include <$2>";;
9345 echo "int main () { struct $struct foo; }" >> try.c;
9347 if eval $compile; then
9356 : see if this is a sys/param system
9357 set sys/param.h i_sysparam
9360 : see if this is a sys/mount.h system
9361 set sys/mount.h i_sysmount
9364 : see if sys/types.h has to be included
9365 set sys/types.h i_systypes
9370 echo "Checking to see if your system supports struct fs_data..." >&4
9371 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
9373 case "$d_fs_data_s" in
9374 "$define") echo "Yes, it does." ;;
9375 *) echo "No, it doesn't." ;;
9378 : see if fseeko exists
9382 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
9385 : see if fsetpos exists
9386 set fsetpos d_fsetpos
9390 : see if fstatfs exists
9391 set fstatfs d_fstatfs
9395 : see if statvfs exists
9396 set statvfs d_statvfs
9399 : see if fstatvfs exists
9400 set fstatvfs d_fstatvfs
9404 : see if fsync exists
9408 : see if ftello exists
9412 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
9415 : see if getcwd exists
9419 : see if getespwnam exists
9420 set getespwnam d_getespwnam
9424 : see if getfsstat exists
9425 set getfsstat d_getfsstat
9428 : see if getgrent exists
9429 set getgrent d_getgrent
9432 : see if gethostbyaddr exists
9433 set gethostbyaddr d_gethbyaddr
9436 : see if gethostbyname exists
9437 set gethostbyname d_gethbyname
9440 : see if gethostent exists
9441 set gethostent d_gethent
9444 : see how we will look up host name
9447 if set gethostname val -f d_gethname; eval $csym; $val; then
9448 echo 'gethostname() found.' >&4
9449 d_gethname="$define"
9452 if set uname val -f d_uname; eval $csym; $val; then
9455 uname() was found, but you're running xenix, and older versions of xenix
9456 have a broken uname(). If you don't really know whether your xenix is old
9457 enough to have a broken system call, use the default answer.
9464 rp='Is your uname() broken?'
9467 n*) d_uname="$define"; call=uname;;
9470 echo 'uname() found.' >&4
9477 case "$d_gethname" in
9478 '') d_gethname="$undef";;
9481 '') d_uname="$undef";;
9483 case "$d_uname$d_gethname" in
9488 Every now and then someone has a $call() that lies about the hostname
9489 but can't be fixed for political or economic reasons. If you wish, I can
9490 pretend $call() isn't there and maybe compute hostname at run-time
9491 thanks to the '$phostname' command.
9494 rp="Shall I ignore $call() from now on?"
9497 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
9500 case "$phostname" in
9502 *) case "$aphostname" in
9508 file=`./loc $file $file $pth`
9509 aphostname=`echo $file $*`
9514 case "$d_uname$d_gethname" in
9517 case "$phostname" in
9519 echo "There will be no way for $package to get your hostname." >&4;;
9521 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
9525 case "$d_phostname" in
9526 '') d_phostname="$undef";;
9529 : see if this is a netdb.h system
9533 : see if prototypes for various gethostxxx netdb.h functions are available
9535 set d_gethostprotos gethostent $i_netdb netdb.h
9538 : see if getlogin exists
9539 set getlogin d_getlogin
9542 : see if getmnt exists
9546 : see if getmntent exists
9547 set getmntent d_getmntent
9550 : see if getnetbyaddr exists
9551 set getnetbyaddr d_getnbyaddr
9554 : see if getnetbyname exists
9555 set getnetbyname d_getnbyname
9558 : see if getnetent exists
9559 set getnetent d_getnent
9562 : see if prototypes for various getnetxxx netdb.h functions are available
9564 set d_getnetprotos getnetent $i_netdb netdb.h
9567 : see if getpagesize exists
9568 set getpagesize d_getpagsz
9572 : see if getprotobyname exists
9573 set getprotobyname d_getpbyname
9576 : see if getprotobynumber exists
9577 set getprotobynumber d_getpbynumber
9580 : see if getprotoent exists
9581 set getprotoent d_getpent
9584 : see if getpgid exists
9585 set getpgid d_getpgid
9588 : see if getpgrp2 exists
9589 set getpgrp2 d_getpgrp2
9592 : see if getppid exists
9593 set getppid d_getppid
9596 : see if getpriority exists
9597 set getpriority d_getprior
9600 : see if prototypes for various getprotoxxx netdb.h functions are available
9602 set d_getprotoprotos getprotoent $i_netdb netdb.h
9605 : see if getprpwnam exists
9606 set getprpwnam d_getprpwnam
9609 : see if getpwent exists
9610 set getpwent d_getpwent
9614 : see if getservbyname exists
9615 set getservbyname d_getsbyname
9618 : see if getservbyport exists
9619 set getservbyport d_getsbyport
9622 : see if getservent exists
9623 set getservent d_getsent
9626 : see if prototypes for various getservxxx netdb.h functions are available
9628 set d_getservprotos getservent $i_netdb netdb.h
9631 : see if getspnam exists
9632 set getspnam d_getspnam
9635 : see if gettimeofday or ftime exists
9636 set gettimeofday d_gettimeod
9638 case "$d_gettimeod" in
9644 val="$undef"; set d_ftime; eval $setvar
9647 case "$d_gettimeod$d_ftime" in
9650 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
9654 : see if this is an grp system
9660 xxx=`./findhdr grp.h`
9661 $cppstdin $cppflags $cppminus < $xxx >$$.h
9663 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
9675 set d_grpasswd; eval $setvar
9679 : see if hasmntopt exists
9680 set hasmntopt d_hasmntopt
9683 : see if this is a netinet/in.h or sys/in.h system
9684 set netinet/in.h i_niin sys/in.h i_sysin
9687 : see if arpa/inet.h has to be included
9688 set arpa/inet.h i_arpainet
9691 : see if htonl --and friends-- exists
9696 : Maybe they are macros.
9701 #include <sys/types.h>
9702 #$i_niin I_NETINET_IN
9704 #$i_arpainet I_ARPA_INET
9706 #include <netinet/in.h>
9712 #include <arpa/inet.h>
9715 printf("Defined as a macro.");
9718 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
9719 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
9721 echo "But it seems to be defined as a macro." >&4
9729 : see if iconv exists
9735 if set index val -f; eval $csym; $val; then
9736 if set strchr val -f d_strchr; eval $csym; $val; then
9737 if $contains strchr "$strings" >/dev/null 2>&1 ; then
9740 echo "strchr() found." >&4
9744 echo "index() found." >&4
9749 echo "index() found." >&4
9752 if set strchr val -f d_strchr; eval $csym; $val; then
9755 echo "strchr() found." >&4
9757 echo "No index() or strchr() found!" >&4
9762 set d_strchr; eval $setvar
9764 set d_index; eval $setvar
9766 : check whether inet_aton exists
9767 set inet_aton d_inetaton
9770 : see if inttypes.h is available
9771 : we want a real compile instead of Inhdr because some systems
9772 : have an inttypes.h which includes non-existent headers
9775 #include <inttypes.h>
9777 static int32_t foo32 = 0x12345678;
9781 if eval $compile; then
9782 echo "<inttypes.h> found." >&4
9785 echo "<inttypes.h> NOT found." >&4
9794 echo "Checking to see if you have int64_t..." >&4
9796 #include <sys/types.h>
9797 #$i_inttypes I_INTTYPES
9799 #include <inttypes.h>
9801 int main() { int64_t x = 7; }
9804 if eval $compile; then
9806 echo "You have int64_t."
9809 echo "You do not have int64_t."
9817 $cat >isascii.c <<'EOCP'
9829 if eval $compile; then
9830 echo "isascii() found." >&4
9833 echo "isascii() NOT found." >&4
9840 : see if isnan exists
9844 : see if isnanl exists
9848 : see if killpg exists
9852 : see if lchown exists
9854 $cat > try.c <<'EOCP'
9855 /* System header to define __stub macros and hopefully few prototypes,
9856 which can conflict with char lchown(); below. */
9858 /* Override any gcc2 internal prototype to avoid an error. */
9859 /* We use char because int might match the return type of a gcc2
9860 builtin and then its argument prototype would still apply. */
9863 /* The GNU C library defines this for functions which it implements
9864 to always fail with ENOSYS. Some functions are actually named
9865 something starting with __ and the normal name is an alias. */
9866 #if defined (__stub_lchown) || defined (__stub___lchown)
9874 if eval $compile; then
9875 $echo "lchown() found." >&4
9878 $echo "lchown() NOT found." >&4
9884 : See if number of significant digits in a double precision number is known
9886 $cat >ldbl_dig.c <<EOM
9896 printf("Contains LDBL_DIG");
9899 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
9900 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
9901 echo "LDBL_DIG found." >&4
9904 echo "LDBL_DIG NOT found." >&4
9911 : see if link exists
9915 : see if localeconv exists
9916 set localeconv d_locconv
9919 : see if lockf exists
9923 : check for long long
9925 echo "Checking to see if you have long long..." >&4
9926 echo 'int main() { long long x = 7; return 0; }' > try.c
9928 if eval $compile; then
9930 echo "You have long long."
9933 echo "You do not have long long."
9939 : check for length of long long
9940 case "${d_longlong}${longlongsize}" in
9943 echo "Checking to see how big your long longs are..." >&4
9944 $cat >try.c <<'EOCP'
9948 printf("%d\n", (int)sizeof(long long));
9953 if eval $compile_ok; then
9954 longlongsize=`./try$exe_ext`
9955 echo "Your long longs are $longlongsize bytes long."
9959 echo "(I can't seem to compile the test program. Guessing...)"
9960 rp="What is the size of a long long (in bytes)?"
9964 if $test "X$longsize" = "X$longlongsize"; then
9965 echo "(That isn't any different from an ordinary long.)"
9971 : see if prototype for lseek is available
9973 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
9976 : see if lstat exists
9980 : see if madvise exists
9981 set madvise d_madvise
9984 : see if mblen exists
9988 : see if mbstowcs exists
9989 set mbstowcs d_mbstowcs
9992 : see if mbtowc exists
9996 : see if memchr exists
10000 : see if memcmp exists
10001 set memcmp d_memcmp
10004 : see if memcpy exists
10005 set memcpy d_memcpy
10008 : see if memmove exists
10009 set memmove d_memmove
10012 : see if memset exists
10013 set memset d_memset
10016 : see if mkdir exists
10020 : see if mkdtemp exists
10021 set mkdtemp d_mkdtemp
10024 : see if mkfifo exists
10025 set mkfifo d_mkfifo
10028 : see if mkstemp exists
10029 set mkstemp d_mkstemp
10032 : see if mkstemps exists
10033 set mkstemps d_mkstemps
10036 : see if mktime exists
10037 set mktime d_mktime
10040 : see if this is a sys/mman.h system
10041 set sys/mman.h i_sysmman
10044 : see if mmap exists
10047 : see what shmat returns
10048 : default to something harmless
10050 case "$i_sysmman$d_mmap" in
10052 $cat >mmap.c <<'END'
10053 #include <sys/mman.h>
10056 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
10061 echo "and it returns ($mmaptype)." >&4
10067 : see if modfl exists
10071 : see if mprotect exists
10072 set mprotect d_mprotect
10075 : see if msgctl exists
10076 set msgctl d_msgctl
10079 : see if msgget exists
10080 set msgget d_msgget
10083 : see if msgsnd exists
10084 set msgsnd d_msgsnd
10087 : see if msgrcv exists
10088 set msgrcv d_msgrcv
10091 : see how much of the 'msg*(2)' library is present.
10094 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
10095 *"$undef"*) h_msg=false;;
10099 case "`ipcs 2>&1`" in
10100 "SVID messages"*"not configured"*)
10101 echo "Your $osname does not have the msg*(2) configured." >&4
10104 set msgctl d_msgctl
10106 set msgget d_msgget
10108 set msgsnd d_msgsnd
10110 set msgrcv d_msgrcv
10116 : we could also check for sys/ipc.h ...
10117 if $h_msg && $test `./findhdr sys/msg.h`; then
10118 echo "You have the full msg*(2) library." >&4
10121 echo "You don't have the full msg*(2) library." >&4
10127 : see if msync exists
10131 : see if munmap exists
10132 set munmap d_munmap
10135 : see if nice exists
10141 echo "Checking which 64-bit integer type we could use..." >&4
10147 val='"unsigned int"'
10152 *) case "$longsize" in
10156 val='"unsigned long"'
10161 *) case "$d_longlong:$longlongsize" in
10166 val='"unsigned long long"'
10171 *) case "$d_int64_t" in
10189 case "$quadtype" in
10190 '') echo "Alas, no 64-bit integer types in sight." >&4
10193 *) if test X"$use64bitint" = Xdefine -o X"$longsize" = X8; then
10198 echo "We $verb use '$quadtype' for 64-bit integers." >&4
10203 : check for length of character
10205 case "$charsize" in
10207 echo "Checking to see how big your characters are (hey, you never know)..." >&4
10208 $cat >try.c <<'EOCP'
10212 printf("%d\n", (int)sizeof(char));
10217 if eval $compile_ok; then
10221 echo "(I can't seem to compile the test program. Guessing...)"
10228 rp="What is the size of a character (in bytes)?"
10233 : check for volatile keyword
10235 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
10236 $cat >try.c <<'EOCP'
10239 typedef struct _goo_struct goo_struct;
10240 goo_struct * volatile goo = ((goo_struct *)0);
10241 struct _goo_struct {
10246 typedef unsigned short foo_t;
10247 char *volatile foo;
10249 volatile foo_t blech;
10253 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
10255 echo "Yup, it does."
10258 echo "Nope, it doesn't."
10266 $echo "Choosing the C types to be used for Perl's internal types..." >&4
10268 case "$use64bitint:$d_quad:$quadtype" in
10271 uvtype="$uquadtype"
10276 uvtype="unsigned long"
10282 case "$uselongdouble:$d_longdbl" in
10284 nvtype="long double"
10285 nvsize=$longdblsize
10292 $echo "(IV will be "$ivtype", $ivsize bytes)"
10293 $echo "(UV will be "$uvtype", $uvsize bytes)"
10294 $echo "(NV will be "$nvtype", $nvsize bytes)"
10297 #$i_inttypes I_INTTYPES
10299 #include <inttypes.h>
10304 int8_t i = INT8_MAX;
10305 uint8_t u = UINT8_MAX;
10306 printf("int8_t\n");
10309 int16_t i = INT16_MAX;
10310 uint16_t i = UINT16_MAX;
10311 printf("int16_t\n");
10314 int32_t i = INT32_MAX;
10315 uint32_t u = UINT32_MAX;
10316 printf("int32_t\n");
10322 '') case "$charsize" in
10324 u8type="unsigned char"
10333 if eval $compile; then
10334 case "`./try$exe_ext`" in
10335 int8_t) i8type=int8_t
10345 '') if $test $charsize -ge 1; then
10347 u8type="unsigned char"
10355 '') case "$shortsize" in
10357 u16type="unsigned short"
10365 '') set try -DINT16
10366 if eval $compile; then
10367 case "`./try$exe_ext`" in
10379 '') if $test $shortsize -ge 2; then
10381 u16type="unsigned short"
10389 '') case "$longsize" in
10391 u32type="unsigned long"
10395 *) case "$intsize" in
10397 u32type="unsigned int"
10407 '') set try -DINT32
10408 if eval $compile; then
10409 case "`./try$exe_ext`" in
10421 '') if $test $intsize -ge 4; then
10423 u32type="unsigned int"
10431 '') case "$d_quad:$quadtype" in
10433 i64type="$quadtype"
10434 u64type="$uquadtype"
10442 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
10443 : volatile so that the compiler has to store it out to memory.
10444 if test X"$d_volatile" = X"$define"; then
10449 #include <sys/types.h>
10450 #include <signal.h>
10452 $volatile int bletched = 0;
10453 $signal_t blech(s) int s; { bletched = 1; }
10458 int n = 8 * $uvsize;
10461 signal(SIGFPE, blech);
10464 for (i = 0; i < n; i++) {
10465 u = u << 1 | ($uvtype)1;
10467 if (($uvtype)d != u)
10471 d = ($nvtype)(u - 1);
10472 if (($uvtype)d != (u - 1))
10480 printf("%d\n", ((i == n) ? -n : i));
10486 d_nv_preserves_uv="$undef"
10487 if eval $compile; then
10488 d_nv_preserves_uv_bits="`./try$exe_ext`"
10490 case "$d_nv_preserves_uv_bits" in
10492 d_nv_preserves_uv_bits=`expr 0 - $d_nv_preserves_uv_bits`
10493 $echo "Your NVs can preserve all $d_nv_preserves_uv_bits bits of your UVs." 2>&1
10494 d_nv_preserves_uv="$define"
10496 [1-9]*) $echo "Your NVs can preserve only $d_nv_preserves_uv_bits bits of your UVs." 2>&1
10497 d_nv_preserves_uv="$undef" ;;
10498 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
10499 d_nv_preserves_uv_bits="$undef" ;;
10505 : check for off64_t
10507 echo "Checking to see if you have off64_t..." >&4
10509 #include <sys/types.h>
10510 #include <unistd.h>
10511 int main() { off64_t x = 7; }
10514 if eval $compile; then
10516 echo "You have off64_t."
10519 echo "You do not have off64_t."
10520 case "$lseeksize" in
10521 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
10528 : see if POSIX threads are available
10529 set pthread.h i_pthread
10535 : how to create joinable pthreads
10536 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
10538 echo "Checking what constant to use for creating joinable pthreads..." >&4
10539 $cat >try.c <<'EOCP'
10540 #include <pthread.h>
10542 int detachstate = JOINABLE;
10545 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
10546 if eval $compile; then
10547 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
10548 val="$undef" # Yes, undef.
10549 set d_old_pthread_create_joinable
10552 set old_pthread_create_joinable
10555 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
10556 if eval $compile; then
10557 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
10559 set d_old_pthread_create_joinable
10561 val=PTHREAD_CREATE_UNDETACHED
10562 set old_pthread_create_joinable
10565 set try -DJOINABLE=__UNDETACHED
10566 if eval $compile; then
10567 echo "You seem to use __UNDETACHED." >&4
10569 set d_old_pthread_create_joinable
10572 set old_pthread_create_joinable
10575 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
10577 set d_old_pthread_create_joinable
10580 set old_pthread_create_joinable
10587 d_old_pthread_create_joinable="$undef"
10588 old_pthread_create_joinable=""
10591 : see if pause exists
10595 : see if pipe exists
10599 : see if poll exists
10604 : see whether the various POSIXish _yields exist
10606 #include <pthread.h>
10612 #ifdef PTHREAD_YIELD
10615 #ifdef PTHREAD_YIELD_NULL
10616 pthread_yield(NULL);
10622 : see if sched_yield exists
10623 set try -DSCHED_YIELD
10624 if eval $compile; then
10626 sched_yield='sched_yield()'
10630 case "$usethreads" in
10633 $define) echo 'sched_yield() found.' >&4 ;;
10634 *) echo 'sched_yield() NOT found.' >&4 ;;
10640 : see if pthread_yield exists
10641 set try -DPTHREAD_YIELD
10642 if eval $compile; then
10644 case "$sched_yield" in
10645 '') sched_yield='pthread_yield()' ;;
10648 set try -DPTHREAD_YIELD_NULL
10649 if eval $compile; then
10651 case "$sched_yield" in
10652 '') sched_yield='pthread_yield(NULL)' ;;
10658 case "$usethreads" in
10661 $define) echo 'pthread_yield() found.' >&4 ;;
10662 *) echo 'pthread_yield() NOT found.' >&4 ;;
10666 set d_pthread_yield
10669 case "$sched_yield" in
10670 '') sched_yield=undef ;;
10675 : see if this is a pwd.h system
10681 xxx=`./findhdr pwd.h`
10682 $cppstdin $cppflags $cppminus < $xxx >$$.h
10684 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
10692 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
10700 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
10708 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
10716 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
10724 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
10732 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
10740 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
10752 set d_pwquota; eval $setvar
10753 set d_pwage; eval $setvar
10754 set d_pwchange; eval $setvar
10755 set d_pwclass; eval $setvar
10756 set d_pwexpire; eval $setvar
10757 set d_pwcomment; eval $setvar
10758 set d_pwgecos; eval $setvar
10759 set d_pwpasswd; eval $setvar
10763 : see if readdir and friends exist
10764 set readdir d_readdir
10766 set seekdir d_seekdir
10768 set telldir d_telldir
10770 set rewinddir d_rewinddir
10773 : see if readlink exists
10774 set readlink d_readlink
10777 : see if rename exists
10778 set rename d_rename
10781 : see if rmdir exists
10785 : see if memory.h is available.
10790 : See if it conflicts with string.h
10796 $cppstdin $cppflags $cppminus < $strings > mem.h
10797 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
10799 echo "We won't be including <memory.h>."
10809 : can bcopy handle overlapping blocks?
10814 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
10816 #$i_memory I_MEMORY
10817 #$i_stdlib I_STDLIB
10818 #$i_string I_STRING
10819 #$i_unistd I_UNISTD
10821 $cat >>try.c <<'EOCP'
10824 # include <memory.h>
10827 # include <stdlib.h>
10830 # include <string.h>
10832 # include <strings.h>
10835 # include <unistd.h> /* Needed for NetBSD */
10839 char buf[128], abc[128];
10845 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
10847 for (align = 7; align >= 0; align--) {
10848 for (len = 36; len; len--) {
10850 bcopy(abc, b, len);
10851 for (off = 1; off <= len; off++) {
10852 bcopy(b, b+off, len);
10853 bcopy(b+off, b, len);
10854 if (bcmp(b, abc, len))
10863 if eval $compile_ok; then
10864 if ./try 2>/dev/null; then
10865 echo "Yes, it can."
10868 echo "It can't, sorry."
10869 case "$d_memmove" in
10870 "$define") echo "But that's Ok since you have memmove()." ;;
10874 echo "(I can't compile the test program, so we'll assume not...)"
10875 case "$d_memmove" in
10876 "$define") echo "But that's Ok since you have memmove()." ;;
10881 $rm -f try.* try core
10885 : can memcpy handle overlapping blocks?
10887 case "$d_memcpy" in
10890 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
10892 #$i_memory I_MEMORY
10893 #$i_stdlib I_STDLIB
10894 #$i_string I_STRING
10895 #$i_unistd I_UNISTD
10897 $cat >>try.c <<'EOCP'
10900 # include <memory.h>
10903 # include <stdlib.h>
10906 # include <string.h>
10908 # include <strings.h>
10911 # include <unistd.h> /* Needed for NetBSD */
10915 char buf[128], abc[128];
10921 /* Copy "abcde..." string to char abc[] so that gcc doesn't
10922 try to store the string in read-only memory. */
10923 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
10925 for (align = 7; align >= 0; align--) {
10926 for (len = 36; len; len--) {
10928 memcpy(b, abc, len);
10929 for (off = 1; off <= len; off++) {
10930 memcpy(b+off, b, len);
10931 memcpy(b, b+off, len);
10932 if (memcmp(b, abc, len))
10941 if eval $compile_ok; then
10942 if ./try 2>/dev/null; then
10943 echo "Yes, it can."
10946 echo "It can't, sorry."
10947 case "$d_memmove" in
10948 "$define") echo "But that's Ok since you have memmove()." ;;
10952 echo "(I can't compile the test program, so we'll assume not...)"
10953 case "$d_memmove" in
10954 "$define") echo "But that's Ok since you have memmove()." ;;
10959 $rm -f try.* try core
10963 : can memcmp be trusted to compare relative magnitude?
10965 case "$d_memcmp" in
10968 echo "Checking if your memcmp() can compare relative magnitude..." >&4
10970 #$i_memory I_MEMORY
10971 #$i_stdlib I_STDLIB
10972 #$i_string I_STRING
10973 #$i_unistd I_UNISTD
10975 $cat >>try.c <<'EOCP'
10978 # include <memory.h>
10981 # include <stdlib.h>
10984 # include <string.h>
10986 # include <strings.h>
10989 # include <unistd.h> /* Needed for NetBSD */
10995 if ((a < b) && memcmp(&a, &b, 1) < 0)
11001 if eval $compile_ok; then
11002 if ./try 2>/dev/null; then
11003 echo "Yes, it can."
11006 echo "No, it can't (it uses signed chars)."
11009 echo "(I can't compile the test program, so we'll assume not...)"
11013 $rm -f try.* try core
11017 : see if prototype for sbrk is available
11019 set d_sbrkproto sbrk $i_unistd unistd.h
11022 : see if select exists
11023 set select d_select
11026 : see if semctl exists
11027 set semctl d_semctl
11030 : see if semget exists
11031 set semget d_semget
11034 : see if semop exists
11038 : see how much of the 'sem*(2)' library is present.
11041 case "$d_semctl$d_semget$d_semop" in
11042 *"$undef"*) h_sem=false;;
11046 case "`ipcs 2>&1`" in
11047 "SVID messages"*"not configured"*)
11048 echo "Your $osname does not have the sem*(2) configured." >&4
11051 set semctl d_semctl
11053 set semget d_semget
11061 : we could also check for sys/ipc.h ...
11062 if $h_sem && $test `./findhdr sys/sem.h`; then
11063 echo "You have the full sem*(2) library." >&4
11066 echo "You don't have the full sem*(2) library." >&4
11072 : see whether sys/sem.h defines union semun
11074 $cat > try.c <<'END'
11075 #include <sys/types.h>
11076 #include <sys/ipc.h>
11077 #include <sys/sem.h>
11078 int main () { union semun semun; semun.buf = 0; }
11081 if eval $compile; then
11082 echo "You have union semun in <sys/sem.h>." >&4
11085 echo "You do not have union semun in <sys/sem.h>." >&4
11088 $rm -f try try.c try.h
11092 : see how to do semctl IPC_STAT
11095 : see whether semctl IPC_STAT can use union semun
11100 # define S_IRUSR S_IREAD
11101 # define S_IWUSR S_IWRITE
11102 # define S_IXUSR S_IEXEC
11104 # define S_IRUSR 0400
11105 # define S_IWUSR 0200
11106 # define S_IXUSR 0100
11108 # define S_IRGRP (S_IRUSR>>3)
11109 # define S_IWGRP (S_IWUSR>>3)
11110 # define S_IXGRP (S_IXUSR>>3)
11111 # define S_IROTH (S_IRUSR>>6)
11112 # define S_IWOTH (S_IWUSR>>6)
11113 # define S_IXOTH (S_IXUSR>>6)
11116 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
11117 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
11118 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
11123 #include <sys/types.h>
11124 #include <sys/ipc.h>
11125 #include <sys/sem.h>
11126 #include <sys/stat.h>
11133 #$d_union_semun HAS_UNION_SEMUN
11136 #ifndef HAS_UNION_SEMUN
11139 struct semid_ds *buf;
11140 unsigned short *array;
11146 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
11147 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
11149 struct semid_ds argbuf;
11152 st = semctl(sem, 0, IPC_STAT, arg);
11156 # endif /* IPC_STAT */
11157 printf("semctl IPC_STAT failed: errno = %d\n", errno);
11159 if (semctl(sem, 0, IPC_RMID, arg) != 0)
11160 # endif /* IPC_RMID */
11161 printf("semctl IPC_RMID failed: errno = %d\n", errno);
11163 #endif /* IPC_PRIVATE && ... */
11164 printf("semget failed: errno = %d\n", errno);
11170 if eval $compile; then
11173 semun) val="$define" ;;
11179 case "$d_semctl_semun" in
11181 echo "You can use union semun for semctl IPC_STAT." >&4
11184 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
11189 : see whether semctl IPC_STAT can use struct semid_ds pointer
11190 $cat > try.c <<'END'
11191 #include <sys/types.h>
11192 #include <sys/ipc.h>
11193 #include <sys/sem.h>
11194 #include <sys/stat.h>
11202 struct semid_ds arg;
11205 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
11206 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
11209 st = semctl(sem, 0, IPC_STAT, &arg);
11211 printf("semid_ds\n");
11213 # endif /* IPC_STAT */
11214 printf("semctl IPC_STAT failed: errno = %d\n", errno);
11216 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
11217 # endif /* IPC_RMID */
11218 printf("semctl IPC_RMID failed: errno = %d\n", errno);
11220 #endif /* IPC_PRIVATE && ... */
11221 printf("semget failed: errno = %d\n", errno);
11228 if eval $compile; then
11231 semid_ds) val="$define" ;;
11235 set d_semctl_semid_ds
11237 case "$d_semctl_semid_ds" in
11239 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
11241 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
11248 # We do not have the full sem*(2) library, so assume we can not
11254 set d_semctl_semid_ds
11259 : see if setegid exists
11260 set setegid d_setegid
11263 : see if seteuid exists
11264 set seteuid d_seteuid
11267 : see if setgrent exists
11268 set setgrent d_setgrent
11271 : see if sethostent exists
11272 set sethostent d_sethent
11275 : see if setlinebuf exists
11276 set setlinebuf d_setlinebuf
11279 : see if setlocale exists
11280 set setlocale d_setlocale
11283 : see if setnetent exists
11284 set setnetent d_setnent
11287 : see if setprotoent exists
11288 set setprotoent d_setpent
11291 : see if setpgid exists
11292 set setpgid d_setpgid
11295 : see if setpgrp2 exists
11296 set setpgrp2 d_setpgrp2
11299 : see if setpriority exists
11300 set setpriority d_setprior
11303 : see if setproctitle exists
11304 set setproctitle d_setproctitle
11307 : see if setpwent exists
11308 set setpwent d_setpwent
11311 : see if setregid exists
11312 set setregid d_setregid
11314 set setresgid d_setresgid
11317 : see if setreuid exists
11318 set setreuid d_setreuid
11320 set setresuid d_setresuid
11323 : see if setrgid exists
11324 set setrgid d_setrgid
11327 : see if setruid exists
11328 set setruid d_setruid
11331 : see if setservent exists
11332 set setservent d_setsent
11335 : see if setsid exists
11336 set setsid d_setsid
11339 : see if setvbuf exists
11340 set setvbuf d_setvbuf
11343 : see if sfio.h is available
11348 : see if sfio library is available
11359 : Ok, but do we want to use it.
11363 true|$define|[yY]*) dflt='y';;
11366 echo "$package can use the sfio library, but it is experimental."
11367 case "$useperlio" in
11369 echo "For sfio also the PerlIO abstraction layer is needed."
11370 echo "Earlier you said you wouldn't want that."
11373 rp="You seem to have sfio available, do you want to try using it?"
11376 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
11377 useperlio="$define"
11380 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
11382 : Remove sfio from list of libraries to use
11383 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
11386 echo "libs = $libs" >&4
11390 *) case "$usesfio" in
11391 true|$define|[yY]*)
11392 echo "Sorry, cannot find sfio on this machine." >&4
11393 echo "Ignoring your setting of usesfio=$usesfio." >&4
11402 $define) usesfio='true';;
11403 *) usesfio='false';;
11406 : see if shmctl exists
11407 set shmctl d_shmctl
11410 : see if shmget exists
11411 set shmget d_shmget
11414 : see if shmat exists
11417 : see what shmat returns
11420 $cat >shmat.c <<'END'
11421 #include <sys/shm.h>
11424 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
11429 echo "and it returns ($shmattype)." >&4
11430 : see if a prototype for shmat is available
11431 xxx=`./findhdr sys/shm.h`
11432 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
11433 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
11444 set d_shmatprototype
11447 : see if shmdt exists
11451 : see how much of the 'shm*(2)' library is present.
11454 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
11455 *"$undef"*) h_shm=false;;
11459 case "`ipcs 2>&1`" in
11460 "SVID shared memory"*"not configured"*)
11461 echo "Your $osname does not have the shm*(2) configured." >&4
11464 set shmctl d_shmctl
11466 set shmget d_shmget
11476 : we could also check for sys/ipc.h ...
11477 if $h_shm && $test `./findhdr sys/shm.h`; then
11478 echo "You have the full shm*(2) library." >&4
11481 echo "You don't have the full shm*(2) library." >&4
11488 : see if we have sigaction
11489 if set sigaction val -f d_sigaction; eval $csym; $val; then
11490 echo 'sigaction() found.' >&4
11491 $cat > try.c <<'EOP'
11493 #include <sys/types.h>
11494 #include <signal.h>
11497 struct sigaction act, oact;
11499 oact.sa_handler = 0;
11500 /* so that act and oact are used */
11501 exit(act.sa_flags == 0 && oact.sa_handler == 0);
11505 if eval $compile_ok; then
11508 echo "But you don't seem to have a useable struct sigaction." >&4
11512 echo 'sigaction NOT found.' >&4
11515 set d_sigaction; eval $setvar
11516 $rm -f try try$_o try.c
11518 : see if sigsetjmp exists
11520 case "$d_sigsetjmp" in
11522 $cat >try.c <<'EOP'
11523 #include <setjmp.h>
11528 if (sigsetjmp(env,1))
11531 siglongjmp(env, 1);
11536 if eval $compile; then
11537 if ./try >/dev/null 2>&1; then
11538 echo "POSIX sigsetjmp found." >&4
11542 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
11548 echo "sigsetjmp not found." >&4
11552 *) val="$d_sigsetjmp"
11553 case "$d_sigsetjmp" in
11554 $define) echo "POSIX sigsetjmp found." >&4;;
11555 $undef) echo "sigsetjmp not found." >&4;;
11563 : see if socks5_init exists
11564 set socks5_init d_socks5_init
11567 : see if sys/stat.h is available
11568 set sys/stat.h i_sysstat
11572 : see if stat knows about block sizes
11574 echo "Checking to see if your struct stat has st_blocks field..." >&4
11575 set d_statblks stat st_blocks $i_sysstat sys/stat.h
11579 : see if this is a sys/vfs.h system
11580 set sys/vfs.h i_sysvfs
11584 : see if this is a sys/statfs.h system
11585 set sys/statfs.h i_sysstatfs
11590 echo "Checking to see if your system supports struct statfs..." >&4
11591 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
11593 case "$d_statfs_s" in
11594 "$define") echo "Yes, it does." ;;
11595 *) echo "No, it doesn't." ;;
11600 : see if struct statfs knows about f_flags
11601 case "$d_statfs_s" in
11604 echo "Checking to see if your struct statfs has f_flags field..." >&4
11605 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
11609 set d_statfs_f_flags
11613 case "$d_statfs_f_flags" in
11614 "$define") echo "Yes, it does." ;;
11615 *) echo "No, it doesn't." ;;
11618 : see if _ptr and _cnt from stdio act std
11621 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
11622 echo "(Looks like you have stdio.h from BSD.)"
11623 case "$stdio_ptr" in
11624 '') stdio_ptr='((fp)->_p)'
11627 *) ptr_lval=$d_stdio_ptr_lval;;
11629 case "$stdio_cnt" in
11630 '') stdio_cnt='((fp)->_r)'
11633 *) cnt_lval=$d_stdio_cnt_lval;;
11635 case "$stdio_base" in
11636 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
11638 case "$stdio_bufsiz" in
11639 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
11641 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
11642 echo "(Looks like you have stdio.h from Linux.)"
11643 case "$stdio_ptr" in
11644 '') stdio_ptr='((fp)->_IO_read_ptr)'
11647 *) ptr_lval=$d_stdio_ptr_lval;;
11649 case "$stdio_cnt" in
11650 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
11653 *) cnt_lval=$d_stdio_cnt_lval;;
11655 case "$stdio_base" in
11656 '') stdio_base='((fp)->_IO_read_base)';;
11658 case "$stdio_bufsiz" in
11659 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
11662 case "$stdio_ptr" in
11663 '') stdio_ptr='((fp)->_ptr)'
11666 *) ptr_lval=$d_stdio_ptr_lval;;
11668 case "$stdio_cnt" in
11669 '') stdio_cnt='((fp)->_cnt)'
11672 *) cnt_lval=$d_stdio_cnt_lval;;
11674 case "$stdio_base" in
11675 '') stdio_base='((fp)->_base)';;
11677 case "$stdio_bufsiz" in
11678 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
11682 : test whether _ptr and _cnt really work
11683 echo "Checking how std your stdio is..." >&4
11686 #define FILE_ptr(fp) $stdio_ptr
11687 #define FILE_cnt(fp) $stdio_cnt
11689 FILE *fp = fopen("try.c", "r");
11692 18 <= FILE_cnt(fp) &&
11693 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
11701 if eval $compile; then
11703 echo "Your stdio acts pretty std."
11706 echo "Your stdio isn't very std."
11709 echo "Your stdio doesn't appear very std."
11715 : Can _ptr be used as an lvalue?
11716 case "$d_stdstdio$ptr_lval" in
11717 $define$define) val=$define ;;
11720 set d_stdio_ptr_lval
11723 : Can _cnt be used as an lvalue?
11724 case "$d_stdstdio$cnt_lval" in
11725 $define$define) val=$define ;;
11728 set d_stdio_cnt_lval
11732 : test whether setting _ptr sets _cnt as a side effect
11733 d_stdio_ptr_lval_sets_cnt="$undef"
11734 d_stdio_ptr_lval_nochange_cnt="$undef"
11735 case "$d_stdio_ptr_lval$d_stdstdio" in
11737 echo "Checking to see what happens if we set the stdio ptr..." >&4
11740 /* Can we scream? */
11741 /* Eat dust sed :-) */
11742 /* In the buffer space, no one can hear you scream. */
11743 #define FILE_ptr(fp) $stdio_ptr
11744 #define FILE_cnt(fp) $stdio_cnt
11745 #include <sys/types.h>
11747 FILE *fp = fopen("try.c", "r");
11752 puts("Fail even to read");
11755 c = getc(fp); /* Read away the first # */
11757 puts("Fail even to read");
11761 18 <= FILE_cnt(fp) &&
11762 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
11764 puts("Fail even to read");
11767 ptr = (char*) FILE_ptr(fp);
11768 cnt = (size_t)FILE_cnt(fp);
11770 FILE_ptr(fp) += 42;
11772 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
11773 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
11776 if (FILE_cnt(fp) <= 20) {
11777 printf ("Fail (<20 chars to test)");
11780 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
11781 puts("Fail compare");
11784 if (cnt == FILE_cnt(fp)) {
11785 puts("Pass_unchanged");
11788 if (FILE_cnt(fp) == (cnt - 42)) {
11789 puts("Pass_changed");
11792 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
11798 if eval $compile; then
11799 case `./try$exe_ext` in
11801 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
11802 d_stdio_ptr_lval_sets_cnt="$define" ;;
11804 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
11805 d_stdio_ptr_lval_nochange_cnt="$define" ;;
11807 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
11809 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
11812 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
11818 : see if _base is also standard
11820 case "$d_stdstdio" in
11824 #define FILE_base(fp) $stdio_base
11825 #define FILE_bufsiz(fp) $stdio_bufsiz
11827 FILE *fp = fopen("try.c", "r");
11830 19 <= FILE_bufsiz(fp) &&
11831 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
11838 if eval $compile; then
11840 echo "And its _base field acts std."
11843 echo "But its _base field isn't std."
11846 echo "However, it seems to be lacking the _base field."
11855 Checking how to access stdio streams by file descriptor number...
11857 case "$stdio_stream_array" in
11858 '') $cat >try.c <<EOCP
11861 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
11865 for s in _iob __iob __sF
11867 set try -DSTDIO_STREAM_ARRAY=$s
11868 if eval $compile; then
11869 case "`./try$exe_ext`" in
11870 yes) stdio_stream_array=$s; break ;;
11874 $rm -f try.* try$exe_ext
11876 case "$stdio_stream_array" in
11878 I can't figure out how to access stdio streams by file descriptor number.
11880 d_stdio_stream_array="$undef"
11883 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
11885 d_stdio_stream_array="$define"
11889 : see if strcoll exists
11890 set strcoll d_strcoll
11893 : check for structure copying
11895 echo "Checking to see if your C compiler can copy structs..." >&4
11896 $cat >try.c <<'EOCP'
11906 if $cc -c try.c >/dev/null 2>&1 ; then
11908 echo "Yup, it can."
11911 echo "Nope, it can't."
11917 : see if strerror and/or sys_errlist[] exist
11919 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
11920 if set strerror val -f d_strerror; eval $csym; $val; then
11921 echo 'strerror() found.' >&4
11922 d_strerror="$define"
11923 d_strerrm='strerror(e)'
11924 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
11925 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
11926 d_syserrlst="$define"
11928 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
11929 d_syserrlst="$undef"
11931 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
11932 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
11933 echo 'strerror() found in string header.' >&4
11934 d_strerror="$define"
11935 d_strerrm='strerror(e)'
11936 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
11937 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
11938 d_syserrlst="$define"
11940 echo "(You don't appear to have any sys_errlist[], how can this be?)"
11941 d_syserrlst="$undef"
11943 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
11944 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
11945 d_strerror="$undef"
11946 d_syserrlst="$define"
11947 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
11949 echo 'strerror() and sys_errlist[] NOT found.' >&4
11950 d_strerror="$undef"
11951 d_syserrlst="$undef"
11952 d_strerrm='"unknown"'
11956 : see if strtod exists
11957 set strtod d_strtod
11960 : see if strtol exists
11961 set strtol d_strtol
11964 : see if strtold exists
11965 set strtold d_strtold
11968 : see if strtoll exists
11969 set strtoll d_strtoll
11972 case "$d_longlong-$d_strtoll" in
11975 Checking whether your strtoll() works okay...
11977 $cat >try.c <<'EOCP'
11980 #define strtoll __strtoll
11983 #define strtoll _strtoll
11986 extern long long int strtoll(char *s, char **, int);
11987 static int bad = 0;
11988 int check(char *s, long long ell, int een) {
11991 gll = strtoll(s, 0, 10);
11992 if (!((gll == ell) && (errno == een)))
11996 check(" 1", 1LL, 0);
11997 check(" 0", 0LL, 0);
11998 check("-1", -1LL, 0);
11999 check("-9223372036854775808", -9223372036854775808LL, 0);
12000 check("-9223372036854775808", -9223372036854775808LL, 0);
12001 check(" 9223372036854775807", 9223372036854775807LL, 0);
12002 check("-9223372036854775808", -9223372036854775808LL, 0);
12003 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
12004 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
12010 if eval $compile; then
12013 ok) echo "Your strtoll() seems to be working okay." ;;
12015 Your strtoll() doesn't seem to be working okay.
12021 echo "(I can't seem to compile the test program--assuming it doesn't)"
12027 : see if strtoq exists
12028 set strtoq d_strtoq
12031 : see if strtoul exists
12032 set strtoul d_strtoul
12035 case "$d_strtoul" in
12038 Checking whether your strtoul() works okay...
12040 $cat >try.c <<'EOCP'
12043 extern unsigned long int strtoul(char *s, char **, int);
12044 static int bad = 0;
12045 void check(char *s, unsigned long eul, int een) {
12048 gul = strtoul(s, 0, 10);
12049 if (!((gul == eul) && (errno == een)))
12053 check(" 1", 1L, 0);
12054 check(" 0", 0L, 0);
12056 case "$longsize" in
12058 $cat >>try.c <<'EOCP'
12059 check("18446744073709551615", 18446744073709551615UL, 0);
12060 check("18446744073709551616", 18446744073709551615UL, ERANGE);
12061 #if 0 /* strtoul() for /^-/ strings is undefined. */
12062 check("-1", 18446744073709551615UL, 0);
12063 check("-18446744073709551614", 2, 0);
12064 check("-18446744073709551615", 1, 0);
12065 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
12066 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
12071 $cat >>try.c <<'EOCP'
12072 check("4294967295", 4294967295UL, 0);
12073 check("4294967296", 4294967295UL, ERANGE);
12074 #if 0 /* strtoul() for /^-/ strings is undefined. */
12075 check("-1", 4294967295UL, 0);
12076 check("-4294967294", 2, 0);
12077 check("-4294967295", 1, 0);
12078 check("-4294967296", 4294967295UL, ERANGE);
12079 check("-4294967297", 4294967295UL, ERANGE);
12084 : Should we write these tests to be more portable by sprintf-ing
12085 : ~0 and then manipulating that char string as input for strtol?
12088 $cat >>try.c <<'EOCP'
12095 if eval $compile; then
12097 ok) echo "Your strtoul() seems to be working okay." ;;
12099 Your strtoul() doesn't seem to be working okay.
12108 : see if strtoull exists
12109 set strtoull d_strtoull
12112 case "$d_longlong-$d_strtoull" in
12115 Checking whether your strtoull() works okay...
12117 $cat >try.c <<'EOCP'
12120 #define strtoull __strtoull
12123 extern unsigned long long int strtoull(char *s, char **, int);
12124 static int bad = 0;
12125 int check(char *s, long long eull, int een) {
12128 gull = strtoull(s, 0, 10);
12129 if (!((gull == eull) && (errno == een)))
12133 check(" 1", 1LL, 0);
12134 check(" 0", 0LL, 0);
12135 check("18446744073709551615", 18446744073709551615ULL, 0);
12136 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
12137 #if 0 /* strtoull() for /^-/ strings is undefined. */
12138 check("-1", 18446744073709551615ULL, 0);
12139 check("-18446744073709551614", 2LL, 0);
12140 check("-18446744073709551615", 1LL, 0);
12141 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
12142 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
12149 if eval $compile; then
12151 ok) echo "Your strtoull() seems to be working okay." ;;
12153 Your strtoull() doesn't seem to be working okay.
12155 d_strtoull="$undef"
12162 : see if strtouq exists
12163 set strtouq d_strtouq
12166 case "$d_strtouq" in
12169 Checking whether your strtouq() works okay...
12171 $cat >try.c <<'EOCP'
12174 extern unsigned long long int strtouq(char *s, char **, int);
12175 static int bad = 0;
12176 void check(char *s, unsigned long long eull, int een) {
12177 unsigned long long gull;
12179 gull = strtouq(s, 0, 10);
12180 if (!((gull == eull) && (errno == een)))
12184 check(" 1", 1LL, 0);
12185 check(" 0", 0LL, 0);
12186 check("18446744073709551615", 18446744073709551615ULL, 0);
12187 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
12188 #if 0 /* strtouq() for /^-/ strings is undefined. */
12189 check("-1", 18446744073709551615ULL, 0);
12190 check("-18446744073709551614", 2LL, 0);
12191 check("-18446744073709551615", 1LL, 0);
12192 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
12193 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
12201 if eval $compile; then
12203 ok) echo "Your strtouq() seems to be working okay." ;;
12205 Your strtouq() doesn't seem to be working okay.
12214 : see if strxfrm exists
12215 set strxfrm d_strxfrm
12218 : see if symlink exists
12219 set symlink d_symlink
12222 : see if syscall exists
12223 set syscall d_syscall
12226 : see if sysconf exists
12227 set sysconf d_sysconf
12230 : see if system exists
12231 set system d_system
12234 : see if tcgetpgrp exists
12235 set tcgetpgrp d_tcgetpgrp
12238 : see if tcsetpgrp exists
12239 set tcsetpgrp d_tcsetpgrp
12242 : see if prototype for telldir is available
12244 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
12247 : see if this is a sys/times.h system
12248 set sys/times.h i_systimes
12251 : see if times exists
12253 if set times val -f d_times; eval $csym; $val; then
12254 echo 'times() found.' >&4
12257 case "$i_systimes" in
12258 "$define") inc='sys/times.h';;
12260 rp="What is the type returned by times() on this system?"
12261 set clock_t clocktype long stdio.h sys/types.h $inc
12264 echo 'times() NOT found, hope that will do.' >&4
12269 : see if truncate exists
12270 set truncate d_truncate
12273 : see if tzname[] exists
12275 if set tzname val -a d_tzname; eval $csym; $val; then
12277 echo 'tzname[] found.' >&4
12280 echo 'tzname[] NOT found.' >&4
12285 : see if umask exists
12289 : see if ustat exists
12293 : backward compatibility for d_hvfork
12294 if test X$d_hvfork != X; then
12295 d_vfork="$d_hvfork"
12298 : see if there is a vfork
12303 : Ok, but do we want to use it. vfork is reportedly unreliable in
12304 : perl on Solaris 2.x, and probably elsewhere.
12308 case "$usevfork" in
12314 Perl can only use a vfork() that doesn't suffer from strict
12315 restrictions on calling functions or modifying global data in
12316 the child. For example, glibc-2.1 contains such a vfork()
12317 that is unsuitable. If your system provides a proper fork()
12318 call, chances are that you do NOT want perl to use vfork().
12321 rp="Do you still want to use vfork()?"
12326 echo "Ok, we won't use vfork()."
12335 $define) usevfork='true';;
12336 *) usevfork='false';;
12339 : see if this is an sysdir system
12340 set sys/dir.h i_sysdir
12343 : see if this is an sysndir system
12344 set sys/ndir.h i_sysndir
12347 : see if closedir exists
12348 set closedir d_closedir
12351 case "$d_closedir" in
12354 echo "Checking whether closedir() returns a status..." >&4
12355 cat > closedir.c <<EOM
12356 #$i_dirent I_DIRENT /**/
12357 #$i_sysdir I_SYS_DIR /**/
12358 #$i_sysndir I_SYS_NDIR /**/
12359 #$i_systypes I_SYS_TYPES /**/
12361 #if defined(I_SYS_TYPES)
12362 #include <sys/types.h>
12364 #if defined(I_DIRENT)
12365 #include <dirent.h>
12366 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
12367 #include <sys/dir.h>
12371 #include <sys/ndir.h>
12375 #include <ndir.h> /* may be wrong in the future */
12377 #include <sys/dir.h>
12382 int main() { return closedir(opendir(".")); }
12385 if eval $compile_ok; then
12386 if ./closedir > /dev/null 2>&1 ; then
12387 echo "Yes, it does."
12390 echo "No, it doesn't."
12394 echo "(I can't seem to compile the test program--assuming it doesn't)"
12402 set d_void_closedir
12405 : see if there is a wait4
12409 : see if waitpid exists
12410 set waitpid d_waitpid
12413 : see if wcstombs exists
12414 set wcstombs d_wcstombs
12417 : see if wctomb exists
12418 set wctomb d_wctomb
12421 : preserve RCS keywords in files with variable substitution, grrr
12426 Revision='$Revision'
12428 case "$crosscompile" in
12429 ''|[nN]*) crosscompile="$undef" ;;
12433 next|rhapsody|darwin) multiarch="$define" ;;
12435 case "$multiarch" in
12436 ''|[nN]*) multiarch="$undef" ;;
12439 : check for alignment requirements
12441 case "$crosscompile$multiarch" in
12444 You seem to be either cross-compiling or doing a multiarchitecture build,
12445 skipping the memory alignment check.
12448 case "$alignbytes" in
12449 '') alignbytes=8 ;;
12453 case "$alignbytes" in
12454 '') echo "Checking alignment constraints..." >&4
12455 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
12456 $cat >try.c <<'EOCP'
12457 typedef long double NV;
12460 $cat >try.c <<'EOCP'
12464 $cat >>try.c <<'EOCP'
12472 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
12477 if eval $compile_ok; then
12481 echo "(I can't seem to compile the test program...)"
12484 *) dflt="$alignbytes"
12487 rp="Doubles must be aligned on a how-many-byte boundary?"
12495 : set the base revision
12498 : check for ordering of bytes in a long
12500 case "$crosscompile$multiarch" in
12503 You seem to be either cross-compiling or doing a multiarchitecture build,
12504 skipping the byteorder check.
12510 case "$byteorder" in
12513 In the following, larger digits indicate more significance. A big-endian
12514 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
12515 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
12516 machines may have weird orders like 3412. A Cray will report 87654321,
12517 an Alpha will report 12345678. If the test program works the default is
12519 I'm now running the test program...
12521 $cat >try.c <<'EOCP'
12528 char c[sizeof(long)];
12531 if (sizeof(long) > 4)
12532 u.l = (0x08070605L << 32) | 0x04030201L;
12535 for (i = 0; i < sizeof(long); i++)
12536 printf("%c", u.c[i]+'0');
12543 if eval $compile && ./try > /dev/null; then
12546 [1-4][1-4][1-4][1-4]|12345678|87654321)
12547 echo "(The test program ran ok.)"
12548 echo "byteorder=$dflt"
12551 ????|????????) echo "(The test program ran ok.)" ;;
12552 *) echo "(The test program didn't run right for some reason.)" ;;
12557 (I can't seem to compile the test program. Guessing big-endian...)
12560 case "$xxx_prompt" in
12562 rp="What is the order of bytes in a long?"
12576 : how do we catenate cpp tokens here?
12578 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
12579 $cat >cpp_stuff.c <<'EOCP'
12580 #define RCAT(a,b)a/**/b
12581 #define ACAT(a,b)a ## b
12585 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
12586 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
12587 echo "Oh! Smells like ANSI's been here." >&4
12588 echo "We can catify or stringify, separately or together!"
12590 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
12591 echo "Ah, yes! The good old days!" >&4
12592 echo "However, in the good old days we don't know how to stringify and"
12593 echo "catify at the same time."
12597 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
12598 to have to edit the values of CAT[2-5] in config.h...
12600 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
12604 : see if this is a db.h system
12610 : Check db version.
12612 echo "Checking Berkeley DB version ..." >&4
12618 #include <sys/types.h>
12623 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
12624 int Major, Minor, Patch ;
12625 unsigned long Version ;
12626 (void)db_version(&Major, &Minor, &Patch) ;
12627 printf("You have Berkeley DB Version 2 or greater\n");
12629 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
12630 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
12631 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
12632 Major, Minor, Patch) ;
12634 /* check that db.h & libdb are compatible */
12635 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
12636 printf("db.h and libdb are incompatible\n") ;
12640 printf("db.h and libdb are compatible\n") ;
12642 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
12643 + DB_VERSION_PATCH ;
12645 /* needs to be >= 2.3.4 */
12646 if (Version < 2003004) {
12647 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
12648 printf("but Perl needs Berkeley DB 2.3.4 or greater\n") ;
12654 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
12655 printf("You have Berkeley DB Version 1\n");
12656 exit(0); /* DB version < 2: the coast is clear. */
12658 exit(1); /* <db.h> not Berkeley DB? */
12664 if eval $compile_ok && ./try; then
12665 echo 'Looks OK.' >&4
12667 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
12671 : Remove db from list of libraries to use
12672 echo "Removing unusable -ldb from library list" >&4
12673 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
12676 echo "libs = $libs" >&4
12686 : Check the return type needed for hash
12688 echo "Checking return type needed for hash for Berkeley DB ..." >&4
12694 #include <sys/types.h>
12697 #ifndef DB_VERSION_MAJOR
12698 u_int32_t hash_cb (ptr, size)
12706 info.hash = hash_cb;
12710 if $cc $ccflags -c try.c >try.out 2>&1 ; then
12711 if $contains warning try.out >>/dev/null 2>&1 ; then
12714 db_hashtype='u_int32_t'
12717 : XXX Maybe we should just give up here.
12718 db_hashtype=u_int32_t
12720 echo "Help: I can't seem to compile the db test program." >&4
12721 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
12724 echo "Your version of Berkeley DB uses $db_hashtype for hash."
12726 *) db_hashtype=u_int32_t
12731 : Check the return type needed for prefix
12733 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
12739 #include <sys/types.h>
12742 #ifndef DB_VERSION_MAJOR
12743 size_t prefix_cb (key1, key2)
12751 info.prefix = prefix_cb;
12755 if $cc $ccflags -c try.c >try.out 2>&1 ; then
12756 if $contains warning try.out >>/dev/null 2>&1 ; then
12757 db_prefixtype='int'
12759 db_prefixtype='size_t'
12762 db_prefixtype='size_t'
12763 : XXX Maybe we should just give up here.
12765 echo "Help: I can't seem to compile the db test program." >&4
12766 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
12769 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
12771 *) db_prefixtype='size_t'
12775 : check for void type
12777 echo "Checking to see how well your C compiler groks the void type..." >&4
12778 case "$voidflags" in
12780 $cat >try.c <<'EOCP'
12786 extern void moo(); /* function returning void */
12787 void (*goo)(); /* ptr to func returning void */
12789 void *hue; /* generic ptr */
12802 int main() { sub(); }
12804 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
12805 voidflags=$defvoidused
12806 echo "Good. It appears to support void to the level $package wants.">&4
12807 if $contains warning .out >/dev/null 2>&1; then
12808 echo "However, you might get some warnings that look like this:"
12812 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
12813 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
12814 echo "It supports 1..."
12815 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
12816 echo "It also supports 2..."
12817 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
12819 echo "And it supports 4 but not 8 definitely."
12821 echo "It doesn't support 4..."
12822 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
12824 echo "But it supports 8."
12827 echo "Neither does it support 8."
12831 echo "It does not support 2..."
12832 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
12834 echo "But it supports 4 and 8."
12836 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
12838 echo "And it supports 4 but has not heard about 8."
12840 echo "However it supports 8 but not 4."
12845 echo "There is no support at all for void."
12850 case "$voidflags" in
12852 *) $cat >&4 <<'EOM'
12853 Support flag bits are:
12854 1: basic void declarations.
12855 2: arrays of pointers to functions returning void.
12856 4: operations between pointers to and addresses of void functions.
12857 8: generic void pointers.
12860 rp="Your void support flags add up to what?"
12868 : How can we generate normalized random numbers ?
12870 echo "Looking for a random number function..." >&4
12871 case "$randfunc" in
12873 if set drand48 val -f; eval $csym; $val; then
12875 echo "Good, found drand48()." >&4
12876 elif set random val -f; eval $csym; $val; then
12878 echo "OK, found random()." >&4
12881 echo "Yick, looks like I have to use rand()." >&4
12892 *-Dmy_rand=*|*-Dmy_srand=*)
12893 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
12894 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
12895 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
12896 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
12900 while $test "$cont"; do
12901 rp="Use which function to generate random numbers?"
12903 if $test "$ans" = "$dflt"; then
12909 if set $ans val -f; eval $csym; $val; then
12913 rp="I cannot find function $ans. Use that name anyway?"
12922 case "$randfunc" in
12924 drand01="drand48()"
12930 case "$randbits" in
12932 echo "Checking to see how many bits your $randfunc() function produces..." >&4
12934 #$i_unistd I_UNISTD
12935 #$i_stdlib I_STDLIB
12938 # include <unistd.h>
12941 # include <stdlib.h>
12946 register unsigned long tmp;
12947 register unsigned long max = 0L;
12949 for (i = 1000; i; i--) {
12950 tmp = (unsigned long) $randfunc();
12951 if (tmp > max) max = tmp;
12953 for (i = 0; max; i++)
12959 if eval $compile_ok; then
12963 echo "(I can't seem to compile the test program...)"
12970 rp="How many bits does your $randfunc() function produce?"
12974 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
12975 seedfunc="s$randfunc"
12976 randseedtype=unsigned
12980 rp="How many bits does your $randfunc() function produce?"
12983 seedfunc="s$randfunc"
12984 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
12985 if set $seedfunc val -f; eval $csym; $val; then
12986 echo "(Using $seedfunc() to seed random generator)"
12988 echo "(Warning: no $seedfunc() to seed random generator)"
12991 randseedtype=unsigned
12999 echo "Determining whether or not we are on an EBCDIC system..." >&4
13000 $cat >tebcdic.c <<'EOM'
13003 if ('M'==0xd4) return 0;
13010 if eval $compile_ok; then
13012 echo "You seem to speak EBCDIC." >&4
13015 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF8." >&4
13018 echo "I'm unable to compile the test program." >&4
13019 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
13021 $rm -f tebcdic.c tebcdic
13027 Checking how to flush all pending stdio output...
13029 # I only know how to find the first 32 possibly open files on SunOS.
13030 # See also hints/sunos_4_1.sh and util.c --AD
13032 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
13034 $cat >>try.c <<EOCP
13036 #$i_unistd I_UNISTD
13038 # include <unistd.h>
13040 #$d_sysconf HAS_SYSCONF
13041 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
13042 #ifdef HAS_STDIO_STREAM_ARRAY
13043 # define STDIO_STREAM_ARRAY $stdio_stream_array
13046 FILE* p = fopen("try.out", "w");
13050 # ifdef TRY_FPRINTF
13054 #ifdef TRY_FFLUSH_NULL
13057 #ifdef TRY_FFLUSH_ALL
13059 long open_max = -1;
13060 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
13061 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
13063 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
13064 open_max = sysconf(_SC_OPEN_MAX);
13067 open_max = FOPEN_MAX;
13070 open_max = OPEN_MAX;
13079 # ifdef HAS_STDIO_STREAM_ARRAY
13080 if (open_max > 0) {
13082 for (i = 0; i < open_max; i++)
13083 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
13084 STDIO_STREAM_ARRAY[i]._file < open_max &&
13085 STDIO_STREAM_ARRAY[i]._flag)
13086 fflush(&STDIO_STREAM_ARRAY[i]);
13094 : first we have to find out how _not_ to flush
13095 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
13097 set try -DTRY_FPUTC
13098 if eval $compile; then
13100 ./try$exe_ext 2>/dev/null
13101 if $test ! -s try.out -a "X$?" = X42; then
13107 set try -DTRY_FPRINTF
13109 if eval $compile; then
13111 ./try$exe_ext 2>/dev/null
13112 if $test ! -s try.out -a "X$?" = X42; then
13113 output=-DTRY_FPRINTF
13119 : check for fflush NULL behaviour
13120 case "$fflushNULL" in
13121 '') set try -DTRY_FFLUSH_NULL $output
13122 if eval $compile; then
13124 ./try$exe_ext 2>/dev/null
13126 if $test -s try.out -a "X$code" = X42; then
13127 fflushNULL="`$cat try.out`"
13129 if $test "X$code" != X42; then
13131 (If this test failed, don't worry, we'll try another method shortly.)
13136 $rm -f core try.core core.try.*
13137 case "$fflushNULL" in
13139 Your fflush(NULL) works okay for output streams.
13140 Let's see if it clobbers input pipes...
13142 # As of mid-March 2000 all versions of Solaris appear to have a stdio
13143 # bug that improperly flushes the input end of pipes. So we avoid the
13144 # autoflush on fork/system/exec support for now. :-(
13145 $cat >tryp.c <<EOCP
13148 main(int argc, char **argv)
13154 while ((i = getc(stdin)) != -1
13155 && (*bp++ = i) != '\n'
13156 && bp < &buf[1024])
13159 fprintf(stdout, "%s", buf);
13167 fflushNULL="$define"
13169 if eval $compile; then
13171 $cat tryp.c | ./tryp$exe_ext 2>/dev/null > tryp.out
13172 if cmp tryp.c tryp.out >/dev/null 2>&1; then
13174 fflush(NULL) seems to behave okay with input streams.
13176 fflushNULL="$define"
13179 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
13181 fflushNULL="$undef"
13184 $rm -f core tryp.c tryp.core core.tryp.*
13187 Your fflush(NULL) isn't working (contrary to ANSI C).
13189 fflushNULL="$undef"
13192 Cannot figure out whether your fflush(NULL) works or not.
13193 I'm assuming it doesn't (contrary to ANSI C).
13195 fflushNULL="$undef"
13199 $define|true|[yY]*)
13200 fflushNULL="$define"
13203 fflushNULL="$undef"
13206 : check explicit looping only if NULL did not work, and if the pipe
13207 : bug does not show up on an explicit flush too
13208 case "$fflushNULL" in
13210 $cat >tryp.c <<EOCP
13213 main(int argc, char **argv)
13219 while ((i = getc(stdin)) != -1
13220 && (*bp++ = i) != '\n'
13221 && bp < &buf[1024])
13224 fprintf(stdout, "%s", buf);
13233 if eval $compile; then
13235 $cat tryp.c | ./tryp$exe_ext 2>/dev/null > tryp.out
13236 if cmp tryp.c tryp.out >/dev/null 2>&1; then
13238 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
13240 : now check for fflushall behaviour
13241 case "$fflushall" in
13242 '') set try -DTRY_FFLUSH_ALL $output
13243 if eval $compile; then
13245 (Now testing the other method--but note that this also may fail.)
13248 ./try$exe_ext 2>/dev/null
13249 if $test -s try.out -a "X$?" = X42; then
13250 fflushall="`$cat try.out`"
13253 $rm -f core try.core core.try.*
13254 case "$fflushall" in
13256 Whew. Flushing explicitly all the stdio streams works.
13258 fflushall="$define"
13261 Sigh. Flushing explicitly all the stdio streams doesn't work.
13266 Cannot figure out whether flushing stdio streams explicitly works or not.
13267 I'm assuming it doesn't.
13273 "$define"|true|[yY]*)
13274 fflushall="$define"
13282 All is futile. Even fflush(stdin) clobbers input pipes!
13289 $rm -f core tryp.c tryp.core core.tryp.*
13291 *) fflushall="$undef"
13295 case "$fflushNULL$fflushall" in
13298 OK, I give up. I cannot figure out how to flush pending stdio output.
13299 We won't be flushing handles at all before fork/exec/popen.
13303 $rm -f try.* try$exe_ext
13305 : Store the full pathname to the ar program for use in the C program
13306 : Respect a hint or command line value for full_ar.
13311 : Store the full pathname to the sed program for use in the C program
13314 : see what type gids are declared as in the kernel
13316 echo "Looking for the type for group ids returned by getgid()."
13317 set gid_t gidtype xxx stdio.h sys/types.h
13321 xxx=`./findhdr sys/user.h`
13322 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
13324 unsigned) dflt="$1 $2" ;;
13328 *) dflt="$gidtype";;
13331 gid_t) echo "gid_t found." ;;
13332 *) rp="What is the type for group ids returned by getgid()?"
13340 *_t) zzz="$gidtype" ;;
13343 echo "Checking the size of $zzz..." >&4
13345 #include <sys/types.h>
13348 printf("%d\n", (int)sizeof($gidtype));
13353 if eval $compile_ok; then
13357 echo "(I can't execute the test program--guessing $gidsize.)" >&4
13360 echo "Your $zzz is $gidsize bytes long."
13365 echo "(I can't compile the test program--guessing $gidsize.)" >&4
13371 *_t) zzz="$gidtype" ;;
13374 echo "Checking the sign of $zzz..." >&4
13376 #include <sys/types.h>
13387 if eval $compile; then
13391 echo "(I can't execute the test program--guessing unsigned.)" >&4
13395 1) echo "Your $zzz is unsigned." ;;
13396 -1) echo "Your $zzz is signed." ;;
13402 echo "(I can't compile the test program--guessing unsigned.)" >&4
13408 if $test X"$quadtype" != X; then
13410 echo "Checking how to print 64-bit integers..." >&4
13412 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
13413 $cat >try.c <<'EOCP'
13414 #include <sys/types.h>
13417 int q = 12345678901;
13418 printf("%ld\n", q);
13422 if eval $compile; then
13423 yyy=`./try$exe_ext`
13426 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
13427 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
13428 echo "We will use %d."
13434 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
13435 $cat >try.c <<'EOCP'
13436 #include <sys/types.h>
13439 long q = 12345678901;
13440 printf("%ld\n", q);
13444 if eval $compile; then
13445 yyy=`./try$exe_ext`
13448 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
13449 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
13450 echo "We will use %ld."
13456 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
13457 $cat >try.c <<'EOCP'
13458 #include <sys/types.h>
13459 #include <inttypes.h>
13462 int64_t q = 12345678901;
13463 printf("%" PRId64 "\n", q);
13467 if eval $compile; then
13468 yyy=`./try$exe_ext`
13471 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
13472 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
13473 echo "We will use the C9X style."
13479 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
13480 $cat >try.c <<'EOCP'
13481 #include <sys/types.h>
13484 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
13485 printf("%lld\n", q);
13489 if eval $compile; then
13490 yyy=`./try$exe_ext`
13493 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
13494 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
13495 echo "We will use the %lld style."
13501 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
13503 #include <sys/types.h>
13506 $quadtype q = 12345678901;
13507 printf("%Ld\n", q);
13511 if eval $compile; then
13512 yyy=`./try$exe_ext`
13515 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
13516 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
13517 echo "We will use %Ld."
13523 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
13525 #include <sys/types.h>
13528 $quadtype q = 12345678901;
13529 printf("%qd\n", q);
13533 if eval $compile; then
13534 yyy=`./try$exe_ext`
13537 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
13538 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
13539 echo "We will use %qd."
13545 if $test X"$sPRId64" = X; then
13546 echo "Cannot figure out how to print 64-bit integers." >&4
13554 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
13555 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
13557 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
13558 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
13564 $echo "Checking the format strings to be used for Perl's internal types..." >&4
13566 if $test X"$ivsize" = X8; then
13567 ivdformat="$sPRId64"
13568 uvuformat="$sPRIu64"
13569 uvoformat="$sPRIo64"
13570 uvxformat="$sPRIx64"
13571 uvXUformat="$sPRIXU64"
13573 if $test X"$ivsize" = X"$longsize"; then
13580 if $test X"$ivsize" = X"$intsize"; then
13588 if $test X"$ivsize" = X"$shortsize"; then
13599 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
13600 nveformat="$sPRIeldbl"
13601 nvfformat="$sPRIfldbl"
13602 nvgformat="$sPRIgldbl"
13603 nvEUformat="$sPRIEUldbl"
13604 nvFUformat="$sPRIFUldbl"
13605 nvGUformat="$sPRIGUldbl"
13615 case "$ivdformat" in
13616 '') echo "$0: Fatal: failed to find format strings, cannot continue." >& 4
13623 $echo "Checking the format string to be used for gids..." >&4
13626 -1) if $test X"$gidsize" = X"$ivsize"; then
13627 gidformat="$ivdformat"
13629 if $test X"$gidsize" = X"$longsize"; then
13632 if $test X"$gidsize" = X"$intsize"; then
13635 if $test X"$gidsize" = X"$shortsize"; then
13642 *) if $test X"$gidsize" = X"$uvsize"; then
13643 gidformat="$uvuformat"
13645 if $test X"$gidsize" = X"$longsize"; then
13648 if $test X"$gidsize" = X"$intsize"; then
13651 if $test X"$gidsize" = X"$shortsize"; then
13660 : see if getgroups exists
13661 set getgroups d_getgrps
13664 : see if setgroups exists
13665 set setgroups d_setgrps
13669 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
13671 case "$d_getgrps$d_setgrps" in
13673 case "$groupstype" in
13674 '') dflt="$gidtype" ;;
13675 *) dflt="$groupstype" ;;
13678 What type of pointer is the second argument to getgroups() and setgroups()?
13679 Usually this is the same as group ids, $gidtype, but not always.
13682 rp='What type pointer is the second argument to getgroups() and setgroups()?'
13686 *) groupstype="$gidtype";;
13690 echo "Checking if your $make program sets \$(MAKE)..." >&4
13691 case "$make_set_make" in
13693 $sed 's/^X //' > testmake.mak << 'EOF'
13695 X @echo 'maketemp="$(MAKE)"'
13697 case "`$make -f testmake.mak 2>/dev/null`" in
13698 *maketemp=*) make_set_make='#' ;;
13699 *) make_set_make="MAKE=$make" ;;
13701 $rm -f testmake.mak
13704 case "$make_set_make" in
13705 '#') echo "Yup, it does.";;
13706 *) echo "Nope, it doesn't.";;
13709 : see what type is used for mode_t
13710 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
13711 set mode_t modetype int stdio.h sys/types.h
13714 : see if stdarg is available
13716 if $test `./findhdr stdarg.h`; then
13717 echo "<stdarg.h> found." >&4
13720 echo "<stdarg.h> NOT found." >&4
13724 : see if varags is available
13726 if $test `./findhdr varargs.h`; then
13727 echo "<varargs.h> found." >&4
13729 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
13732 : set up the varargs testing programs
13733 $cat > varargs.c <<EOP
13735 #include <stdarg.h>
13738 #include <varargs.h>
13742 int f(char *p, ...)
13756 p = va_arg(ap, char *);
13761 $cat > varargs <<EOP
13763 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
13772 : now check which varargs header should be included
13777 if `./varargs I_STDARG`; then
13779 elif `./varargs I_VARARGS`; then
13784 if `./varargs I_VARARGS`; then
13791 echo "I could not find the definition for va_dcl... You have problems..." >&4
13792 val="$undef"; set i_stdarg; eval $setvar
13793 val="$undef"; set i_varargs; eval $setvar
13798 case "$i_varhdr" in
13800 val="$define"; set i_stdarg; eval $setvar
13801 val="$undef"; set i_varargs; eval $setvar
13804 val="$undef"; set i_stdarg; eval $setvar
13805 val="$define"; set i_varargs; eval $setvar
13808 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
13812 : see if we need va_copy
13814 case "$i_stdarg" in
13817 #include <stdarg.h>
13819 #$i_stdlib I_STDLIB
13821 #include <stdlib.h>
13823 #include <signal.h>
13826 ivfprintf(FILE *f, const char *fmt, va_list *valp)
13828 return vfprintf(f, fmt, *valp);
13832 myvfprintf(FILE *f, const char *fmt, va_list val)
13834 return ivfprintf(f, fmt, &val);
13838 myprintf(char *fmt, ...)
13841 va_start(val, fmt);
13842 return myvfprintf(stdout, fmt, val);
13846 main(int ac, char **av)
13848 signal(SIGSEGV, exit);
13850 myprintf("%s%cs all right, then\n", "that", '\'');
13855 if eval $compile && ./try 2>&1 >/dev/null; then
13857 "that's all right, then")
13863 yes) echo "It seems that you don't need va_copy()." >&4
13864 need_va_copy="$undef"
13866 *) echo "It seems that va_copy() or similar will be needed." >&4
13867 need_va_copy="$define"
13870 $rm -f try.* core core.* *.core *.core.*
13872 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
13876 : define a fucntion to check prototypes
13877 $cat > protochk <<EOSH
13880 optimize="$optimize"
13882 prototype="$prototype"
13887 $cat >> protochk <<'EOSH'
13892 while test $# -ge 2; do
13894 $define) echo "#include <$2>" >> try.c ;;
13895 literal) echo "$2" >> try.c ;;
13899 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
13900 cat >> try.c <<'EOCP'
13901 #ifdef CAN_PROTOTYPE
13902 #define _(args) args
13907 echo "$foo" >> try.c
13908 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
13909 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
13915 $eunicefix protochk
13917 : see what type is used for size_t
13918 rp="What is the type used for the length parameter for string functions?"
13919 set size_t sizetype 'unsigned int' stdio.h sys/types.h
13922 : check for type of arguments to gethostbyaddr.
13923 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
13924 case "$d_gethbyaddr" in
13928 Checking to see what type of arguments are accepted by gethostbyaddr().
13930 hdrs="$define sys/types.h
13931 $d_socket sys/socket.h
13932 $i_niin netinet/in.h
13934 $i_unistd unistd.h"
13935 : The first arg can 'char *' or 'void *'
13936 : The second arg is some of integral type
13937 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
13938 for yyy in size_t long int; do
13939 case "$netdb_host_type" in
13940 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
13941 if ./protochk "$try" $hdrs; then
13942 echo "Your system accepts $xxx for the first arg."
13943 echo "...and $yyy for the second arg."
13944 netdb_host_type="$xxx"
13945 netdb_hlen_type="$yyy"
13951 : In case none of those worked, prompt the user.
13952 case "$netdb_host_type" in
13953 '') rp='What is the type for the 1st argument to gethostbyaddr?'
13956 netdb_host_type=$ans
13957 rp='What is the type for the 2nd argument to gethostbyaddr?'
13960 netdb_hlen_type=$ans
13964 *) : no gethostbyaddr, so pick harmless defaults
13965 netdb_host_type='char *'
13966 netdb_hlen_type="$sizetype"
13969 # Remove the "const" if needed. -- but then we'll have a
13971 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
13974 : check for type of argument to gethostbyname.
13975 if test "X$netdb_name_type" = X ; then
13976 case "$d_gethbyname" in
13980 Checking to see what type of argument is accepted by gethostbyname().
13982 hdrs="$define sys/types.h
13983 $d_socket sys/socket.h
13984 $i_niin netinet/in.h
13986 $i_unistd unistd.h"
13987 for xxx in "const char *" "char *"; do
13988 case "$netdb_name_type" in
13989 '') try="extern struct hostent *gethostbyname($xxx);"
13990 if ./protochk "$try" $hdrs; then
13991 echo "Your system accepts $xxx."
13992 netdb_name_type="$xxx"
13997 : In case none of those worked, prompt the user.
13998 case "$netdb_name_type" in
13999 '') rp='What is the type for the 1st argument to gethostbyname?'
14002 netdb_name_type=$ans
14006 *) : no gethostbyname, so pick harmless default
14007 netdb_name_type='char *'
14012 : check for type of 1st argument to getnetbyaddr.
14013 if test "X$netdb_net_type" = X ; then
14014 case "$d_getnbyaddr" in
14018 Checking to see what type of 1st argument is accepted by getnetbyaddr().
14020 hdrs="$define sys/types.h
14021 $d_socket sys/socket.h
14022 $i_niin netinet/in.h
14024 $i_unistd unistd.h"
14025 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
14026 case "$netdb_net_type" in
14027 '') try="extern struct netent *getnetbyaddr($xxx, int);"
14028 if ./protochk "$try" $hdrs; then
14029 echo "Your system accepts $xxx."
14030 netdb_net_type="$xxx"
14035 : In case none of those worked, prompt the user.
14036 case "$netdb_net_type" in
14037 '') rp='What is the type for the 1st argument to getnetbyaddr?'
14040 netdb_net_type=$ans
14044 *) : no getnetbyaddr, so pick harmless default
14045 netdb_net_type='long'
14049 : locate the preferred pager for this system
14055 [a-zA-Z]:/*) dflt=$pg;;
14059 [a-zA-Z]:/*) dflt=$more;;
14063 [a-zA-Z]:/*) dflt=$less;;
14066 '') dflt=/usr/ucb/more;;
14073 rp='What pager is used on your system?'
14077 : see what type pids are declared as in the kernel
14078 rp="What is the type of process ids on this system?"
14079 set pid_t pidtype int stdio.h sys/types.h
14082 : Find earliest binary compatible site_perl subdirectory perl can use.
14083 case "$bincompat5005" in
14084 "$define") xs_apiversion='5.005' ;;
14085 *) xs_apiversion=$version ;; # The current site_perl version.
14087 : Find earliest pure perl site_perl subdirectory perl can use.
14088 : The versioned directories started at 5.005.
14089 pm_apiversion='5.005'
14091 : check for length of pointer
14095 echo "Checking to see how big your pointers are..." >&4
14096 if test "$voidflags" -gt 7; then
14097 echo '#define VOID_PTR char *' > try.c
14099 echo '#define VOID_PTR void *' > try.c
14101 $cat >>try.c <<'EOCP'
14105 printf("%d\n", (int)sizeof(VOID_PTR));
14110 if eval $compile_ok; then
14112 echo "Your pointers are $ptrsize bytes long."
14115 echo "(I can't seem to compile the test program. Guessing...)" >&4
14116 rp="What is the size of a pointer (in bytes)?"
14124 : see if ar generates random libraries by itself
14126 echo "Checking how to generate random libraries on your machine..." >&4
14127 echo 'int bar1() { return bar2(); }' > bar1.c
14128 echo 'int bar2() { return 2; }' > bar2.c
14129 $cat > foo.c <<'EOP'
14130 int main() { printf("%d\n", bar1()); exit(0); }
14132 $cc $ccflags -c bar1.c >/dev/null 2>&1
14133 $cc $ccflags -c bar2.c >/dev/null 2>&1
14134 $cc $ccflags -c foo.c >/dev/null 2>&1
14135 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
14136 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
14137 ./foobar >/dev/null 2>&1; then
14138 echo "$ar appears to generate random libraries itself."
14141 elif $ar ts bar$_a >/dev/null 2>&1 &&
14142 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
14143 ./foobar >/dev/null 2>&1; then
14144 echo "a table of contents needs to be added with '$ar ts'."
14151 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
14152 $test -f $ranlib || ranlib=''
14155 if $test -n "$ranlib"; then
14156 echo "your system has '$ranlib'; we'll use that."
14159 echo "your system doesn't seem to support random libraries"
14160 echo "so we'll use lorder and tsort to order the libraries."
14167 : check for type of arguments to select.
14168 case "$selecttype" in
14169 '') case "$d_select" in
14173 Checking to see what type of arguments are accepted by select().
14175 hdrs="$define sys/types.h
14176 $i_systime sys/time.h
14177 $i_sysselct sys/select.h
14178 $d_socket sys/socket.h"
14179 : The first arg can be int, unsigned, or size_t
14180 : The last arg may or may not be 'const'
14182 : void pointer has been seen but using that
14183 : breaks the selectminbits test
14184 for xxx in 'fd_set *' 'int *'; do
14185 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
14186 for tmo in 'struct timeval *' 'const struct timeval *'; do
14188 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
14189 if ./protochk "$try" $hdrs; then
14190 echo "Your system accepts $xxx."
14199 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
14200 case "$d_fd_set" in
14201 $define) dflt="fd_set *" ;;
14210 *) : no select, so pick a harmless default
14217 : check for the select 'width'
14218 case "$selectminbits" in
14219 '') case "$d_select" in
14223 Checking to see on how many bits at a time your select() operates...
14226 #include <sys/types.h>
14228 #$i_systime I_SYS_TIME
14229 #$i_systimek I_SYS_TIME_KERNEL
14234 # ifdef I_SYS_TIME_KERNEL
14237 # include <sys/time.h>
14238 # ifdef I_SYS_TIME_KERNEL
14242 #$i_sysselct I_SYS_SELECT
14243 #ifdef I_SYS_SELECT
14244 #include <sys/select.h>
14246 #$d_socket HAS_SOCKET
14248 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
14252 #define S sizeof(*(b))
14254 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
14255 #define NBITS (NBYTES * 8)
14264 fp = fopen("try.c", "r");
14270 b = ($selecttype)s;
14271 for (i = 0; i < NBITS; i++)
14275 select(fd + 1, b, 0, 0, &t);
14276 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
14277 printf("%d\n", i + 1);
14282 if eval $compile_ok; then
14283 selectminbits=`./try`
14284 case "$selectminbits" in
14286 Cannot figure out on how many bits at a time your select() operates.
14287 I'll play safe and guess it is 32 bits.
14293 *) bits="$selectminbits bits" ;;
14295 echo "Your select() operates on $bits at a time." >&4
14297 rp='What is the minimum number of bits your select() operates on?'
14298 case "$byteorder" in
14299 1234|12345678) dflt=32 ;;
14304 selectminbits="$val"
14308 *) : no select, so pick a harmless default
14315 : Trace out the files included by signal.h, then look for SIGxxx names.
14316 : Remove SIGARRAYSIZE used by HPUX.
14317 : Remove SIGSTKSIZE used by Linux.
14318 : Remove SIGSTKSZ used by Posix.
14319 : Remove SIGTYP void lines used by OS2.
14320 : Some cpps, like os390, dont give the file name anywhere
14321 if [ "X$fieldn" = X ]; then
14322 : Just make some guesses. We check them later.
14323 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
14325 xxx=`echo '#include <signal.h>' |
14326 $cppstdin $cppminus $cppflags 2>/dev/null |
14327 $grep '^[ ]*#.*include' |
14328 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq`
14330 : Check this list of files to be sure we have parsed the cpp output ok.
14331 : This will also avoid potentially non-existent files, such
14334 for xx in $xxx /dev/null ; do
14335 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
14337 : If we have found no files, at least try signal.h
14338 case "$xxxfiles" in
14339 '') xxxfiles=`./findhdr signal.h` ;;
14342 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
14343 print substr($2, 4, 20)
14345 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
14346 print substr($3, 4, 20)
14348 : Append some common names just in case the awk scan failed.
14349 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
14350 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
14351 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
14352 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
14353 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
14355 : generate a few handy files for later
14356 $cat > signal.c <<'EOCP'
14357 #include <sys/types.h>
14358 #include <signal.h>
14362 /* Strange style to avoid deeply-nested #if/#else/#endif */
14365 # define NSIG (_NSIG)
14371 # define NSIG (SIGMAX+1)
14377 # define NSIG (SIG_MAX+1)
14383 # define NSIG (MAXSIG+1)
14389 # define NSIG (MAX_SIG+1)
14394 # ifdef SIGARRAYSIZE
14395 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
14401 # define NSIG (_sys_nsig) /* Solaris 2.5 */
14405 /* Default to some arbitrary number that's big enough to get most
14406 of the common signals.
14412 printf("NSIG %d\n", NSIG);
14418 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
14420 printf "#ifdef SIG"; printf $1; printf "\n"
14421 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
14422 printf $1; printf ");\n"
14426 printf "#endif /* JUST_NSIG */\n";
14427 printf "exit(0);\n}\n";
14430 $cat >signal.awk <<'EOP'
14431 BEGIN { ndups = 0 }
14432 $1 ~ /^NSIG$/ { nsig = $2 }
14433 ($1 !~ /^NSIG$/) && (NF == 2) {
14434 if ($2 > maxsig) { maxsig = $2 }
14435 if (sig_name[$2]) {
14436 dup_name[ndups] = $1
14437 dup_num[ndups] = $2
14449 printf("NSIG %d\n", nsig);
14450 for (n = 1; n < nsig; n++) {
14452 printf("%s %d\n", sig_name[n], sig_num[n])
14455 printf("NUM%d %d\n", n, n)
14458 for (n = 0; n < ndups; n++) {
14459 printf("%s %d\n", dup_name[n], dup_num[n])
14463 $cat >signal_cmd <<EOS
14465 if $test -s signal.lst; then
14466 echo "Using your existing signal.lst file"
14471 $cat >>signal_cmd <<'EOS'
14474 if eval $compile_ok; then
14475 ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
14477 echo "(I can't seem be able to compile the whole test program)" >&4
14478 echo "(I'll try it in little pieces.)" >&4
14479 set signal -DJUST_NSIG
14480 if eval $compile_ok; then
14481 ./signal$_exe > signal.nsg
14484 echo "I can't seem to figure out how many signals you have." >&4
14485 echo "Guessing 50." >&4
14486 echo 'NSIG 50' > signal.nsg
14488 : Now look at all the signal names, one at a time.
14489 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
14490 $cat > signal.c <<EOCP
14491 #include <sys/types.h>
14492 #include <signal.h>
14495 printf("$xx %d\n", SIG${xx});
14500 if eval $compile; then
14501 echo "SIG${xx} found."
14502 ./signal$_exe >> signal.ls1
14504 echo "SIG${xx} NOT found."
14507 if $test -s signal.ls1; then
14508 $cat signal.nsg signal.ls1 |
14509 $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
14513 if $test -s signal.lst; then
14516 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
14517 echo 'kill -l' >signal
14518 set X `csh -f <signal`
14522 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
14524 echo $@ | $tr ' ' $trnl | \
14525 $awk '{ printf "%s %d\n", $1, ++s; }
14526 END { printf "NSIG %d\n", ++s }' >signal.lst
14528 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
14530 chmod a+x signal_cmd
14531 $eunicefix signal_cmd
14533 : generate list of signal names
14535 case "$sig_name_init" in
14537 *) case "$sig_num_init" in
14538 ''|*,*) doinit=yes ;;
14543 echo "Generating a list of signal names and numbers..." >&4
14545 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
14546 sig_name=`$awk 'BEGIN { printf "ZERO " }
14547 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
14548 sig_num=`$awk 'BEGIN { printf "0 " }
14549 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
14550 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
14551 !/^NSIG/ { printf "\"%s\", ", $1 }
14552 END { printf "0\n" }' signal.lst`
14553 sig_num_init=`$awk 'BEGIN { printf "0, " }
14554 !/^NSIG/ { printf "%d, ", $2}
14555 END { printf "0\n"}' signal.lst`
14558 echo "The following $sig_count signals are available:"
14560 echo $sig_name | $awk \
14561 'BEGIN { linelen = 0 }
14563 for (i = 1; i <= NF; i++) {
14564 name = "SIG" $i " "
14565 linelen = linelen + length(name)
14566 if (linelen > 70) {
14568 linelen = length(name)
14574 $rm -f signal signal.c signal.awk signal.lst signal_cmd
14577 case "$sizetype" in
14578 *_t) zzz="$sizetype" ;;
14579 *) zzz="filesize" ;;
14581 echo "Checking the size of $zzz..." >&4
14583 #include <sys/types.h>
14586 printf("%d\n", (int)sizeof($sizetype));
14591 if eval $compile_ok; then
14595 echo "(I can't execute the test program--guessing $sizesize.)" >&4
14598 echo "Your $zzz size is $sizesize bytes."
14603 echo "(I can't compile the test program--guessing $sizesize.)" >&4
14607 : check for socklen_t
14609 echo "Checking to see if you have socklen_t..." >&4
14611 #include <sys/types.h>
14612 #$d_socket HAS_SOCKET
14614 #include <sys/socket.h>
14616 int main() { socklen_t x = 16; }
14619 if eval $compile; then
14621 echo "You have socklen_t."
14624 echo "You do not have socklen_t."
14625 case "$sizetype" in
14626 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
14633 : see if this is a socks.h system
14634 set socks.h i_socks
14637 : check for type of the size argument to socket calls
14638 case "$d_socket" in
14642 Checking to see what type is the last argument of accept().
14645 case "$d_socklen_t" in
14646 "$define") yyy="$yyy socklen_t"
14648 yyy="$yyy $sizetype int long unsigned"
14649 for xxx in $yyy; do
14650 case "$socksizetype" in
14651 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
14652 case "$usesocks" in
14654 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
14655 echo "Your system accepts '$xxx *' for the last argument of accept()."
14656 socksizetype="$xxx"
14659 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
14660 echo "Your system accepts '$xxx *' for the last argument of accept()."
14661 socksizetype="$xxx"
14668 : In case none of those worked, prompt the user.
14669 case "$socksizetype" in
14670 '') rp='What is the type for socket address structure sizes?'
14677 *) : no sockets, so pick relatively harmless default
14682 : see what type is used for signed size_t
14683 set ssize_t ssizetype int stdio.h sys/types.h
14686 $cat > ssize.c <<EOM
14688 #include <sys/types.h>
14689 #define Size_t $sizetype
14690 #define SSize_t $dflt
14693 if (sizeof(Size_t) == sizeof(SSize_t))
14695 else if (sizeof(Size_t) == sizeof(int))
14704 if eval $compile_ok && ./ssize > /dev/null; then
14705 ssizetype=`./ssize`
14706 echo "I'll be using $ssizetype for functions returning a byte count." >&4
14709 Help! I can't compile and run the ssize_t test program: please enlighten me!
14710 (This is probably a misconfiguration in your system or libraries, and
14711 you really ought to fix it. Still, I'll try anyway.)
14713 I need a type that is the same size as $sizetype, but is guaranteed to
14714 be signed. Common values are ssize_t, int and long.
14717 rp="What signed type is the same size as $sizetype?"
14721 $rm -f ssize ssize.*
14723 : see what type of char stdio uses.
14725 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
14726 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
14727 echo "Your stdio uses unsigned chars." >&4
14728 stdchar="unsigned char"
14730 echo "Your stdio uses signed chars." >&4
14737 : see if time exists
14739 if test "X$d_time" = X -o X"$timetype" = X; then
14740 if set time val -f d_time; eval $csym; $val; then
14741 echo 'time() found.' >&4
14743 rp="What is the type returned by time() on this system?"
14744 set time_t timetype long stdio.h sys/types.h
14747 echo 'time() not found, hope that will do.' >&4
14755 : see what type uids are declared as in the kernel
14757 echo "Looking for the type for user ids returned by getuid()."
14758 set uid_t uidtype xxx stdio.h sys/types.h
14762 xxx=`./findhdr sys/user.h`
14763 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
14765 unsigned) dflt="$1 $2" ;;
14769 *) dflt="$uidtype";;
14772 uid_t) echo "uid_t found." ;;
14773 *) rp="What is the type for user ids returned by getuid()?"
14781 *_t) zzz="$uidtype" ;;
14784 echo "Checking the size of $zzz..." >&4
14786 #include <sys/types.h>
14789 printf("%d\n", (int)sizeof($uidtype));
14794 if eval $compile_ok; then
14798 echo "(I can't execute the test program--guessing $uidsize.)" >&4
14801 echo "Your $zzz is $uidsize bytes long."
14806 echo "(I can't compile the test program--guessing $uidsize.)" >&4
14811 *_t) zzz="$uidtype" ;;
14814 echo "Checking the sign of $zzz..." >&4
14816 #include <sys/types.h>
14827 if eval $compile; then
14831 echo "(I can't execute the test program--guessing unsigned.)" >&4
14835 1) echo "Your $zzz is unsigned." ;;
14836 -1) echo "Your $zzz is signed." ;;
14842 echo "(I can't compile the test program--guessing unsigned.)" >&4
14848 $echo "Checking the format string to be used for uids..." >&4
14851 -1) if $test X"$uidsize" = X"$ivsize"; then
14852 uidformat="$ivdformat"
14854 if $test X"$uidsize" = X"$longsize"; then
14857 if $test X"$uidsize" = X"$intsize"; then
14860 if $test X"$uidsize" = X"$shortsize"; then
14867 *) if $test X"$uidsize" = X"$uvsize"; then
14868 uidformat="$uvuformat"
14870 if $test X"$uidsize" = X"$longsize"; then
14873 if $test X"$uidsize" = X"$intsize"; then
14876 if $test X"$uidsize" = X"$shortsize"; then
14885 : see if dbm.h is available
14886 : see if dbmclose exists
14887 set dbmclose d_dbmclose
14890 case "$d_dbmclose" in
14900 *) set rpcsvc/dbm.h i_rpcsvcdbm
14905 *) echo "We won't be including <dbm.h>"
14915 : see if this is a sys/file.h system
14920 : do we need to include sys/file.h ?
14924 if $h_sysfile; then
14926 echo "We'll be including <sys/file.h>." >&4
14929 echo "We won't be including <sys/file.h>." >&4
14939 : see if fcntl.h is there
14944 : see if we can include fcntl.h
14950 echo "We'll be including <fcntl.h>." >&4
14953 if $h_sysfile; then
14954 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
14956 echo "We won't be including <fcntl.h>." >&4
14968 : see if this is a iconv.h system
14969 set iconv.h i_iconv
14972 : see if this is a ieeefp.h system
14973 set ieeefp.h i_ieeefp
14976 : see if this is a libutil.h system
14977 set libutil.h i_libutil
14980 : see if locale.h is available
14981 set locale.h i_locale
14984 : see if mach cthreads are available
14985 if test "X$usethreads" = "X$define"; then
14986 set mach/cthreads.h i_machcthr
14989 i_machcthr="$undef"
14994 : see if this is a math.h system
14998 : see if this is a mntent.h system
14999 set mntent.h i_mntent
15002 : see if ndbm.h is available
15007 : see if dbm_open exists
15008 set dbm_open d_dbm_open
15010 case "$d_dbm_open" in
15013 echo "We won't be including <ndbm.h>"
15022 : see if net/errno.h is available
15024 set net/errno.h val
15027 : Unfortunately, it causes problems on some systems. Arrgh.
15030 cat > try.c <<'EOM'
15033 #include <net/errno.h>
15039 if $cc $ccflags -c try.c >/dev/null 2>&1; then
15040 echo "We'll be including <net/errno.h>." >&4
15042 echo "We won't be including <net/errno.h>." >&4
15051 : see if netinet/tcp.h is available
15052 set netinet/tcp.h i_netinettcp
15055 : see if this is a poll.h system
15059 : see if this is a prot.h system
15064 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
15065 $cat <<'EOSH' > Cppsym.know
15066 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
15067 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
15068 alliant alpha am29000 AM29000 amiga AMIGAOS AMIX
15069 ansi ANSI_C_SOURCE apollo ardent atarist att386 att3b BeOS
15070 BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
15071 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
15072 bull c cadmus clipper CMU COFF COMPILER_VERSION
15073 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
15074 CYGWIN DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
15075 Dynix DynixPTX ELF encore EPI EXTENSIONS FILE_OFFSET_BITS
15076 FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
15077 GNU_SOURCE GNUC GNUC_MINOR GO32 gould GOULD_PN
15078 H3050R H3050RX hbullx20 hcx host_mips
15079 hp200 hp300 hp700 HP700 hp800 hp9000
15080 hp9000s200 hp9000s300 hp9000s400 hp9000s500
15081 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
15082 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
15083 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
15084 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
15085 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
15086 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
15087 Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
15088 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
15089 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
15090 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
15091 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
15092 MATH_HAS_NO_SIDE_EFFECTS
15093 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
15094 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
15095 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
15096 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
15097 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
15098 NetBSD news1500 news1700 news1800 news1900 news3700
15099 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
15100 ns32016 ns32332 ns32k nsc32000
15101 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
15102 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
15103 pc532 pdp11 PGC PIC plexus PORTAR posix
15104 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
15105 POSIX_C_SOURCE POSIX_SOURCE POWER
15106 PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
15107 riscix riscos RT scs SCO sequent sgi SGI_SOURCE sinix
15108 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
15109 sony sony_news sonyrisc sparc sparclite spectrum
15110 stardent stdc STDC_EXT stratos sun sun3 sun386
15111 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
15112 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
15113 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
15114 sysV68 sysV88 Tek4132 Tek4300 titan
15115 tower tower32 tower32_200 tower32_600 tower32_700
15116 tower32_800 tower32_850 tss
15117 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
15118 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
15119 unix UNIX95 UNIX99 unixpc unos USGr4 USGr4_2
15120 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms xenix Xenix286
15121 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
15122 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
15125 # Maybe put other stuff here too.
15126 cat <<EOSH >>Cppsym.know
15129 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
15130 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
15131 $cat Cppsym.know > Cppsym.c
15132 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
15133 $rm -f Cppsym.a Cppsym.b Cppsym.c
15134 cat <<EOSH > Cppsym
15136 if $test \$# -gt 0; then
15137 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
15138 if $test -s Cppsym.got; then
15145 $tr " " "$trnl" | ./Cppsym.try
15151 cat <<EOSH > Cppsym.try
15153 cat <<'EOCP' > try.c
15159 cat <<'EOSH' >> Cppsym.try
15161 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
15162 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
15163 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
15164 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
15168 cat <<EOSH >> Cppsym.try
15170 case "$osname-$gccversion" in
15171 irix-) ccflags="\$ccflags -woff 1178" ;;
15172 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
15174 $cc -o try $optimize \$ccflags $ldflags try.c $libs && ./try$exe_ext
15176 chmod +x Cppsym.try
15177 $eunicefix Cppsym.try
15178 ./Cppsym < Cppsym.know > Cppsym.true
15179 : now check the C compiler for additional symbols
15180 postprocess_cc_v=''
15182 aix) postprocess_cc_v="|$tr , ' '" ;;
15189 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
15192 -D*) echo "\$i" | $sed 's/^-D//';;
15193 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
15198 postprocess_cc_v=''
15201 ./ccsym > ccsym1.raw
15202 if $test -s ccsym1.raw; then
15203 $sort ccsym1.raw | $uniq >ccsym.raw
15205 mv ccsym1.raw ccsym.raw
15208 $awk '/\=/ { print $0; next }
15209 { print $0"=1" }' ccsym.raw >ccsym.list
15210 $awk '/\=/ { print $0; next }
15211 { print $0"=1" }' Cppsym.true >ccsym.true
15212 $comm -13 ccsym.true ccsym.list >ccsym.own
15213 $comm -12 ccsym.true ccsym.list >ccsym.com
15214 $comm -23 ccsym.true ccsym.list >ccsym.cpp
15216 if $test -z ccsym.raw; then
15217 echo "Your C compiler doesn't seem to define any symbols!" >&4
15219 echo "However, your C preprocessor defines the following symbols:"
15222 cppsymbols=`$cat Cppsym.true`
15223 cppsymbols=`echo $cppsymbols`
15224 cppccsymbols="$cppsymbols"
15226 if $test -s ccsym.com; then
15227 echo "Your C compiler and pre-processor define these symbols:"
15228 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
15231 cppccsymbols=`$cat ccsym.com`
15232 cppccsymbols=`echo $cppccsymbols`
15233 $test "$silent" || sleep 1
15235 if $test -s ccsym.cpp; then
15236 $test "$also" && echo " "
15237 echo "Your C pre-processor ${also}defines the following symbols:"
15238 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
15240 cppsymbols=`$cat ccsym.cpp`
15241 cppsymbols=`echo $cppsymbols`
15242 $test "$silent" || sleep 1
15244 if $test -s ccsym.own; then
15245 $test "$also" && echo " "
15246 echo "Your C compiler ${also}defines the following cpp symbols:"
15247 $sed -e 's/\(..*\)=1/\1/' ccsym.own
15248 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
15249 ccsymbols=`$cat ccsym.own`
15250 ccsymbols=`echo $ccsymbols`
15251 $test "$silent" || sleep 1
15254 $rm -f ccsym* Cppsym.*
15256 : see if this is a termio system
15260 if $test `./findhdr termios.h`; then
15261 set tcsetattr i_termios
15267 "$define") echo "You have POSIX termios.h... good!" >&4;;
15268 *) if ./Cppsym pyr; then
15269 case "`/bin/universe`" in
15270 ucb) if $test `./findhdr sgtty.h`; then
15272 echo "<sgtty.h> found." >&4
15274 echo "System is pyramid with BSD universe."
15275 echo "<sgtty.h> not found--you could have problems." >&4
15277 *) if $test `./findhdr termio.h`; then
15279 echo "<termio.h> found." >&4
15281 echo "System is pyramid with USG universe."
15282 echo "<termio.h> not found--you could have problems." >&4
15286 if $test `./findhdr termio.h`; then
15287 echo "<termio.h> found." >&4
15289 elif $test `./findhdr sgtty.h`; then
15290 echo "<sgtty.h> found." >&4
15293 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
15296 if $test `./findhdr sgtty.h`; then
15297 echo "<sgtty.h> found." >&4
15299 elif $test `./findhdr termio.h`; then
15300 echo "<termio.h> found." >&4
15303 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
15307 set i_termio; eval $setvar
15308 val=$val2; set i_sgtty; eval $setvar
15309 val=$val3; set i_termios; eval $setvar
15311 : see if this is a shadow.h system
15312 set shadow.h i_shadow
15315 : see if stddef is available
15316 set stddef.h i_stddef
15319 : see if this is a sunmath.h system
15320 set sunmath.h i_sunmath
15323 : see if sys/access.h is available
15324 set sys/access.h i_sysaccess
15327 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
15328 set sys/filio.h i_sysfilio
15331 if $test `./findhdr sys/ioctl.h`; then
15333 echo '<sys/ioctl.h> found.' >&4
15336 if $test $i_sysfilio = "$define"; then
15337 echo '<sys/ioctl.h> NOT found.' >&4
15339 $test $i_sgtty = "$define" && xxx="sgtty.h"
15340 $test $i_termio = "$define" && xxx="termio.h"
15341 $test $i_termios = "$define" && xxx="termios.h"
15342 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
15349 : see if this is a syslog.h system
15350 set syslog.h i_syslog
15354 : see if this is a sys/mode.h system
15355 set sys/mode.h i_sysmode
15358 : see if sys/resource.h has to be included
15359 set sys/resource.h i_sysresrc
15362 : see if sys/security.h is available
15363 set sys/security.h i_syssecrt
15366 : see if this is a sys/statvfs.h system
15367 set sys/statvfs.h i_sysstatvfs
15370 : see if this is a sys/uio.h system
15371 set sys/uio.h i_sysuio
15374 : see if this is a sys/un.h system
15375 set sys/un.h i_sysun
15379 : see if this is a sys/utsname.h system
15380 set sys/utsname.h i_sysutsname
15383 : see if this is a syswait system
15384 set sys/wait.h i_syswait
15387 : see if this is a ustat.h system
15388 set ustat.h i_ustat
15391 : see if this is an utime system
15392 set utime.h i_utime
15395 : see if this is a values.h system
15396 set values.h i_values
15399 : see if this is a vfork system
15402 set vfork.h i_vfork
15410 : see if gdbm.h is available
15415 : see if gdbm_open exists
15416 set gdbm_open d_gdbm_open
15418 case "$d_gdbm_open" in
15421 echo "We won't be including <gdbm.h>"
15431 echo "Looking for extensions..." >&4
15432 : If we are using the old config.sh, known_extensions may contain
15433 : old or inaccurate or duplicate values.
15434 known_extensions=''
15435 nonxs_extensions=''
15436 : We do not use find because it might not be available.
15437 : We do not just use MANIFEST because the user may have dropped
15438 : some additional extensions into the source tree and expect them
15441 : Function to recursively find available extensions, ignoring DynaLoader
15442 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
15446 DynaLoader|dynaload) ;;
15448 if $test -f $xxx/$xxx.xs; then
15449 known_extensions="$known_extensions $1$xxx";
15450 elif $test -f $xxx/Makefile.PL; then
15451 nonxs_extensions="$nonxs_extensions $1$xxx";
15453 if $test -d $xxx -a $# -lt 10; then
15456 eval $find_extensions;
15468 eval $find_extensions
15469 set X $nonxs_extensions
15471 nonxs_extensions="$*"
15472 set X $known_extensions
15474 known_extensions="$*"
15477 : Now see which are supported on this system.
15479 for xxx in $known_extensions ; do
15483 $define) avail_ext="$avail_ext $xxx" ;;
15486 GDBM_File|gdbm_fil)
15488 $define) avail_ext="$avail_ext $xxx" ;;
15491 NDBM_File|ndbm_fil)
15494 case "$osname-$use64bitint" in
15497 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
15500 *) avail_ext="$avail_ext $xxx" ;;
15505 ODBM_File|odbm_fil)
15506 case "${i_dbm}${i_rpcsvcdbm}" in
15508 case "$osname-$use64bitint" in
15511 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
15514 *) avail_ext="$avail_ext $xxx" ;;
15520 case "$useposix" in
15521 true|define|y) avail_ext="$avail_ext $xxx" ;;
15525 case "$useopcode" in
15526 true|define|y) avail_ext="$avail_ext $xxx" ;;
15530 case "$d_socket" in
15531 true|$define|y) avail_ext="$avail_ext $xxx" ;;
15534 Sys/Syslog|sys/syslog)
15535 : XXX syslog requires socket
15536 case "$d_socket" in
15537 true|$define|y) avail_ext="$avail_ext $xxx" ;;
15541 case "$usethreads" in
15542 true|$define|y) avail_ext="$avail_ext $xxx" ;;
15546 : XXX Do we need a useipcsysv variable here
15547 case "${d_msg}${d_sem}${d_shm}" in
15548 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
15551 *) avail_ext="$avail_ext $xxx"
15560 : Now see which nonxs extensions are supported on this system.
15561 : For now assume all are.
15563 for xxx in $nonxs_extensions ; do
15565 *) nonxs_ext="$nonxs_ext $xxx"
15577 A number of extensions are supplied with $package. You may choose to
15578 compile these extensions for dynamic loading (the default), compile
15579 them into the $package executable (static loading), or not include
15580 them at all. Answer "none" to include no extensions.
15581 Note that DynaLoader is always built and need not be mentioned here.
15584 case "$dynamic_ext" in
15585 '') dflt="$avail_ext" ;;
15586 *) dflt="$dynamic_ext"
15587 # Perhaps we are reusing an old out-of-date config.sh.
15590 if test X"$dynamic_ext" != X"$avail_ext"; then
15592 NOTICE: Your previous config.sh list may be incorrect.
15593 The extensions now available to you are
15595 but the default list from your previous config.sh is
15607 rp="What extensions do you wish to load dynamically?"
15610 none) dynamic_ext=' ' ;;
15611 *) dynamic_ext="$ans" ;;
15614 case "$static_ext" in
15616 : Exclude those already listed in dynamic linking
15618 for xxx in $avail_ext; do
15619 case " $dynamic_ext " in
15621 *) dflt="$dflt $xxx" ;;
15628 *) dflt="$static_ext"
15635 rp="What extensions do you wish to load statically?"
15638 none) static_ext=' ' ;;
15639 *) static_ext="$ans" ;;
15644 A number of extensions are supplied with $package. Answer "none"
15645 to include no extensions.
15646 Note that DynaLoader is always built and need not be mentioned here.
15649 case "$static_ext" in
15650 '') dflt="$avail_ext" ;;
15651 *) dflt="$static_ext"
15652 # Perhaps we are reusing an old out-of-date config.sh.
15655 if test X"$static_ext" != X"$avail_ext"; then
15657 NOTICE: Your previous config.sh list may be incorrect.
15658 The extensions now available to you are
15660 but the default list from your previous config.sh is
15669 : Exclude those that are not xs extensions
15673 rp="What extensions do you wish to include?"
15676 none) static_ext=' ' ;;
15677 *) static_ext="$ans" ;;
15682 set X $dynamic_ext $static_ext $nonxs_ext
15686 : Remove libraries needed only for extensions
15687 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
15688 : The exception is SunOS 4.x, which needs them.
15689 case "${osname}X${osvers}" in
15693 *) case "$usedl" in
15694 $define|true|[yY]*)
15695 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
15699 *) perllibs="$libs"
15705 : Remove build directory name from cppstdin so it can be used from
15706 : either the present location or the final installed location.
15708 : Get out of the UU directory to get correct path name.
15710 case "$cppstdin" in
15712 echo "Stripping down cppstdin path name"
15718 : end of configuration questions
15720 echo "End of configuration questions."
15723 : back to where it started
15724 if test -d ../UU; then
15728 : configuration may be patched via a 'config.over' file
15729 if $test -f config.over; then
15732 rp='I see a config.over file. Do you wish to load it?'
15735 n*) echo "OK, I'll ignore it.";;
15737 echo "Configuration override changes have been loaded."
15742 : in case they want portability, strip down executable paths
15743 case "$d_portable" in
15746 echo "Stripping down executable paths..." >&4
15747 for file in $loclist $trylist; do
15749 eval $file=`basename $temp`
15754 : create config.sh file
15756 echo "Creating config.sh..." >&4
15757 $spitshell <<EOT >config.sh
15760 # This file was produced by running the Configure script. It holds all the
15761 # definitions figured out by Configure. Should you modify one of these values,
15762 # do not forget to propagate your changes by running "Configure -der". You may
15763 # instead choose to run each of the .SH files by yourself, or "Configure -S".
15766 # Package name : $package
15767 # Source directory : $src
15768 # Configuration time: $cf_time
15769 # Configured by : $cf_by
15770 # Target system : $myuname
15780 Revision='$Revision'
15787 alignbytes='$alignbytes'
15788 ansi2knr='$ansi2knr'
15789 aphostname='$aphostname'
15790 api_revision='$api_revision'
15791 api_subversion='$api_subversion'
15792 api_version='$api_version'
15793 api_versionstring='$api_versionstring'
15796 archlibexp='$archlibexp'
15797 archname64='$archname64'
15798 archname='$archname'
15799 archobjs='$archobjs'
15804 bincompat5005='$bincompat5005'
15808 byteorder='$byteorder'
15810 castflags='$castflags'
15813 cccdlflags='$cccdlflags'
15814 ccdlflags='$ccdlflags'
15816 ccflags_uselargefiles='$ccflags_uselargefiles'
15818 ccsymbols='$ccsymbols'
15819 ccversion='$ccversion'
15821 cf_email='$cf_email'
15823 charsize='$charsize'
15827 clocktype='$clocktype'
15829 compress='$compress'
15830 contains='$contains'
15834 cpp_stuff='$cpp_stuff'
15835 cppccsymbols='$cppccsymbols'
15836 cppflags='$cppflags'
15838 cppminus='$cppminus'
15840 cppstdin='$cppstdin'
15841 cppsymbols='$cppsymbols'
15842 crosscompile='$crosscompile'
15843 cryptlib='$cryptlib'
15845 d_Gconvert='$d_Gconvert'
15846 d_PRIEUldbl='$d_PRIEUldbl'
15847 d_PRIFUldbl='$d_PRIFUldbl'
15848 d_PRIGUldbl='$d_PRIGUldbl'
15849 d_PRIXU64='$d_PRIXU64'
15850 d_PRId64='$d_PRId64'
15851 d_PRIeldbl='$d_PRIeldbl'
15852 d_PRIfldbl='$d_PRIfldbl'
15853 d_PRIgldbl='$d_PRIgldbl'
15854 d_PRIi64='$d_PRIi64'
15855 d_PRIo64='$d_PRIo64'
15856 d_PRIu64='$d_PRIu64'
15857 d_PRIx64='$d_PRIx64'
15858 d_SCNfldbl='$d_SCNfldbl'
15859 d__fwalk='$d__fwalk'
15860 d_access='$d_access'
15861 d_accessx='$d_accessx'
15863 d_archlib='$d_archlib'
15866 d_attribut='$d_attribut'
15869 d_bincompat5005='$d_bincompat5005'
15871 d_bsdgetpgrp='$d_bsdgetpgrp'
15872 d_bsdsetpgrp='$d_bsdsetpgrp'
15874 d_casti32='$d_casti32'
15875 d_castneg='$d_castneg'
15876 d_charvspr='$d_charvspr'
15878 d_chroot='$d_chroot'
15879 d_chsize='$d_chsize'
15880 d_closedir='$d_closedir'
15884 d_cuserid='$d_cuserid'
15885 d_dbl_dig='$d_dbl_dig'
15886 d_difftime='$d_difftime'
15887 d_dirnamlen='$d_dirnamlen'
15888 d_dlerror='$d_dlerror'
15889 d_dlopen='$d_dlopen'
15890 d_dlsymun='$d_dlsymun'
15891 d_dosuid='$d_dosuid'
15892 d_drand48proto='$d_drand48proto'
15894 d_eaccess='$d_eaccess'
15895 d_endgrent='$d_endgrent'
15896 d_endhent='$d_endhent'
15897 d_endnent='$d_endnent'
15898 d_endpent='$d_endpent'
15899 d_endpwent='$d_endpwent'
15900 d_endsent='$d_endsent'
15901 d_eofnblk='$d_eofnblk'
15902 d_eunice='$d_eunice'
15903 d_fchmod='$d_fchmod'
15904 d_fchown='$d_fchown'
15906 d_fcntl_can_lock='$d_fcntl_can_lock'
15907 d_fd_macros='$d_fd_macros'
15908 d_fd_set='$d_fd_set'
15909 d_fds_bits='$d_fds_bits'
15910 d_fgetpos='$d_fgetpos'
15911 d_flexfnam='$d_flexfnam'
15914 d_fpathconf='$d_fpathconf'
15915 d_fpos64_t='$d_fpos64_t'
15916 d_frexpl='$d_frexpl'
15917 d_fs_data_s='$d_fs_data_s'
15918 d_fseeko='$d_fseeko'
15919 d_fsetpos='$d_fsetpos'
15920 d_fstatfs='$d_fstatfs'
15921 d_fstatvfs='$d_fstatvfs'
15923 d_ftello='$d_ftello'
15925 d_getcwd='$d_getcwd'
15926 d_getespwnam='$d_getespwnam'
15927 d_getfsstat='$d_getfsstat'
15928 d_getgrent='$d_getgrent'
15929 d_getgrps='$d_getgrps'
15930 d_gethbyaddr='$d_gethbyaddr'
15931 d_gethbyname='$d_gethbyname'
15932 d_gethent='$d_gethent'
15933 d_gethname='$d_gethname'
15934 d_gethostprotos='$d_gethostprotos'
15935 d_getlogin='$d_getlogin'
15936 d_getmnt='$d_getmnt'
15937 d_getmntent='$d_getmntent'
15938 d_getnbyaddr='$d_getnbyaddr'
15939 d_getnbyname='$d_getnbyname'
15940 d_getnent='$d_getnent'
15941 d_getnetprotos='$d_getnetprotos'
15942 d_getpagsz='$d_getpagsz'
15943 d_getpbyname='$d_getpbyname'
15944 d_getpbynumber='$d_getpbynumber'
15945 d_getpent='$d_getpent'
15946 d_getpgid='$d_getpgid'
15947 d_getpgrp2='$d_getpgrp2'
15948 d_getpgrp='$d_getpgrp'
15949 d_getppid='$d_getppid'
15950 d_getprior='$d_getprior'
15951 d_getprotoprotos='$d_getprotoprotos'
15952 d_getprpwnam='$d_getprpwnam'
15953 d_getpwent='$d_getpwent'
15954 d_getsbyname='$d_getsbyname'
15955 d_getsbyport='$d_getsbyport'
15956 d_getsent='$d_getsent'
15957 d_getservprotos='$d_getservprotos'
15958 d_getspnam='$d_getspnam'
15959 d_gettimeod='$d_gettimeod'
15960 d_gnulibc='$d_gnulibc'
15961 d_grpasswd='$d_grpasswd'
15962 d_hasmntopt='$d_hasmntopt'
15966 d_inetaton='$d_inetaton'
15967 d_int64_t='$d_int64_t'
15968 d_isascii='$d_isascii'
15970 d_isnanl='$d_isnanl'
15971 d_killpg='$d_killpg'
15972 d_lchown='$d_lchown'
15973 d_ldbl_dig='$d_ldbl_dig'
15975 d_locconv='$d_locconv'
15977 d_longdbl='$d_longdbl'
15978 d_longlong='$d_longlong'
15979 d_lseekproto='$d_lseekproto'
15981 d_madvise='$d_madvise'
15983 d_mbstowcs='$d_mbstowcs'
15984 d_mbtowc='$d_mbtowc'
15985 d_memchr='$d_memchr'
15986 d_memcmp='$d_memcmp'
15987 d_memcpy='$d_memcpy'
15988 d_memmove='$d_memmove'
15989 d_memset='$d_memset'
15991 d_mkdtemp='$d_mkdtemp'
15992 d_mkfifo='$d_mkfifo'
15993 d_mkstemp='$d_mkstemp'
15994 d_mkstemps='$d_mkstemps'
15995 d_mktime='$d_mktime'
15998 d_mprotect='$d_mprotect'
16000 d_msg_ctrunc='$d_msg_ctrunc'
16001 d_msg_dontroute='$d_msg_dontroute'
16002 d_msg_oob='$d_msg_oob'
16003 d_msg_peek='$d_msg_peek'
16004 d_msg_proxy='$d_msg_proxy'
16005 d_msgctl='$d_msgctl'
16006 d_msgget='$d_msgget'
16007 d_msgrcv='$d_msgrcv'
16008 d_msgsnd='$d_msgsnd'
16010 d_munmap='$d_munmap'
16011 d_mymalloc='$d_mymalloc'
16013 d_nv_preserves_uv='$d_nv_preserves_uv'
16014 d_nv_preserves_uv_bits='$d_nv_preserves_uv_bits'
16015 d_off64_t='$d_off64_t'
16016 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
16017 d_oldpthreads='$d_oldpthreads'
16018 d_oldsock='$d_oldsock'
16020 d_pathconf='$d_pathconf'
16022 d_perl_otherlibdirs='$d_perl_otherlibdirs'
16023 d_phostname='$d_phostname'
16026 d_portable='$d_portable'
16027 d_pthread_yield='$d_pthread_yield'
16029 d_pwchange='$d_pwchange'
16030 d_pwclass='$d_pwclass'
16031 d_pwcomment='$d_pwcomment'
16032 d_pwexpire='$d_pwexpire'
16033 d_pwgecos='$d_pwgecos'
16034 d_pwpasswd='$d_pwpasswd'
16035 d_pwquota='$d_pwquota'
16038 d_readdir='$d_readdir'
16039 d_readlink='$d_readlink'
16040 d_rename='$d_rename'
16041 d_rewinddir='$d_rewinddir'
16043 d_safebcpy='$d_safebcpy'
16044 d_safemcpy='$d_safemcpy'
16045 d_sanemcmp='$d_sanemcmp'
16046 d_sbrkproto='$d_sbrkproto'
16047 d_sched_yield='$d_sched_yield'
16048 d_scm_rights='$d_scm_rights'
16049 d_seekdir='$d_seekdir'
16050 d_select='$d_select'
16052 d_semctl='$d_semctl'
16053 d_semctl_semid_ds='$d_semctl_semid_ds'
16054 d_semctl_semun='$d_semctl_semun'
16055 d_semget='$d_semget'
16057 d_setegid='$d_setegid'
16058 d_seteuid='$d_seteuid'
16059 d_setgrent='$d_setgrent'
16060 d_setgrps='$d_setgrps'
16061 d_sethent='$d_sethent'
16062 d_setlinebuf='$d_setlinebuf'
16063 d_setlocale='$d_setlocale'
16064 d_setnent='$d_setnent'
16065 d_setpent='$d_setpent'
16066 d_setpgid='$d_setpgid'
16067 d_setpgrp2='$d_setpgrp2'
16068 d_setpgrp='$d_setpgrp'
16069 d_setprior='$d_setprior'
16070 d_setproctitle='$d_setproctitle'
16071 d_setpwent='$d_setpwent'
16072 d_setregid='$d_setregid'
16073 d_setresgid='$d_setresgid'
16074 d_setresuid='$d_setresuid'
16075 d_setreuid='$d_setreuid'
16076 d_setrgid='$d_setrgid'
16077 d_setruid='$d_setruid'
16078 d_setsent='$d_setsent'
16079 d_setsid='$d_setsid'
16080 d_setvbuf='$d_setvbuf'
16084 d_shmatprototype='$d_shmatprototype'
16085 d_shmctl='$d_shmctl'
16087 d_shmget='$d_shmget'
16088 d_sigaction='$d_sigaction'
16089 d_sigsetjmp='$d_sigsetjmp'
16090 d_socket='$d_socket'
16091 d_socklen_t='$d_socklen_t'
16092 d_sockpair='$d_sockpair'
16093 d_socks5_init='$d_socks5_init'
16095 d_statblks='$d_statblks'
16096 d_statfs_f_flags='$d_statfs_f_flags'
16097 d_statfs_s='$d_statfs_s'
16098 d_statvfs='$d_statvfs'
16099 d_stdio_cnt_lval='$d_stdio_cnt_lval'
16100 d_stdio_ptr_lval='$d_stdio_ptr_lval'
16101 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
16102 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
16103 d_stdio_stream_array='$d_stdio_stream_array'
16104 d_stdiobase='$d_stdiobase'
16105 d_stdstdio='$d_stdstdio'
16106 d_strchr='$d_strchr'
16107 d_strcoll='$d_strcoll'
16108 d_strctcpy='$d_strctcpy'
16109 d_strerrm='$d_strerrm'
16110 d_strerror='$d_strerror'
16111 d_strtod='$d_strtod'
16112 d_strtol='$d_strtol'
16113 d_strtold='$d_strtold'
16114 d_strtoll='$d_strtoll'
16115 d_strtoq='$d_strtoq'
16116 d_strtoul='$d_strtoul'
16117 d_strtoull='$d_strtoull'
16118 d_strtouq='$d_strtouq'
16119 d_strxfrm='$d_strxfrm'
16120 d_suidsafe='$d_suidsafe'
16121 d_symlink='$d_symlink'
16122 d_syscall='$d_syscall'
16123 d_sysconf='$d_sysconf'
16124 d_sysernlst='$d_sysernlst'
16125 d_syserrlst='$d_syserrlst'
16126 d_system='$d_system'
16127 d_tcgetpgrp='$d_tcgetpgrp'
16128 d_tcsetpgrp='$d_tcsetpgrp'
16129 d_telldir='$d_telldir'
16130 d_telldirproto='$d_telldirproto'
16133 d_truncate='$d_truncate'
16134 d_tzname='$d_tzname'
16137 d_union_semun='$d_union_semun'
16139 d_vendorarch='$d_vendorarch'
16140 d_vendorbin='$d_vendorbin'
16141 d_vendorlib='$d_vendorlib'
16143 d_void_closedir='$d_void_closedir'
16144 d_voidsig='$d_voidsig'
16145 d_voidtty='$d_voidtty'
16146 d_volatile='$d_volatile'
16147 d_vprintf='$d_vprintf'
16149 d_waitpid='$d_waitpid'
16150 d_wcstombs='$d_wcstombs'
16151 d_wctomb='$d_wctomb'
16154 db_hashtype='$db_hashtype'
16155 db_prefixtype='$db_prefixtype'
16156 defvoidused='$defvoidused'
16157 direntrytype='$direntrytype'
16160 doublesize='$doublesize'
16162 dynamic_ext='$dynamic_ext'
16168 eunicefix='$eunicefix'
16171 extensions='$extensions'
16172 fflushNULL='$fflushNULL'
16173 fflushall='$fflushall'
16175 firstmakefile='$firstmakefile'
16177 fpossize='$fpossize'
16178 fpostype='$fpostype'
16179 freetype='$freetype'
16181 full_csh='$full_csh'
16182 full_sed='$full_sed'
16183 gccosandvers='$gccosandvers'
16184 gccversion='$gccversion'
16185 gidformat='$gidformat'
16191 groupcat='$groupcat'
16192 groupstype='$groupstype'
16195 h_sysfile='$h_sysfile'
16206 i_arpainet='$i_arpainet'
16207 i_bsdioctl='$i_bsdioctl'
16210 i_dirent='$i_dirent'
16218 i_ieeefp='$i_ieeefp'
16219 i_inttypes='$i_inttypes'
16220 i_libutil='$i_libutil'
16221 i_limits='$i_limits'
16222 i_locale='$i_locale'
16223 i_machcthr='$i_machcthr'
16224 i_malloc='$i_malloc'
16226 i_memory='$i_memory'
16227 i_mntent='$i_mntent'
16230 i_neterrno='$i_neterrno'
16231 i_netinettcp='$i_netinettcp'
16235 i_pthread='$i_pthread'
16237 i_rpcsvcdbm='$i_rpcsvcdbm'
16240 i_shadow='$i_shadow'
16242 i_stdarg='$i_stdarg'
16243 i_stddef='$i_stddef'
16244 i_stdlib='$i_stdlib'
16245 i_string='$i_string'
16246 i_sunmath='$i_sunmath'
16247 i_sysaccess='$i_sysaccess'
16248 i_sysdir='$i_sysdir'
16249 i_sysfile='$i_sysfile'
16250 i_sysfilio='$i_sysfilio'
16252 i_sysioctl='$i_sysioctl'
16253 i_syslog='$i_syslog'
16254 i_sysmman='$i_sysmman'
16255 i_sysmode='$i_sysmode'
16256 i_sysmount='$i_sysmount'
16257 i_sysndir='$i_sysndir'
16258 i_sysparam='$i_sysparam'
16259 i_sysresrc='$i_sysresrc'
16260 i_syssecrt='$i_syssecrt'
16261 i_sysselct='$i_sysselct'
16262 i_syssockio='$i_syssockio'
16263 i_sysstat='$i_sysstat'
16264 i_sysstatfs='$i_sysstatfs'
16265 i_sysstatvfs='$i_sysstatvfs'
16266 i_systime='$i_systime'
16267 i_systimek='$i_systimek'
16268 i_systimes='$i_systimes'
16269 i_systypes='$i_systypes'
16270 i_sysuio='$i_sysuio'
16272 i_sysutsname='$i_sysutsname'
16273 i_sysvfs='$i_sysvfs'
16274 i_syswait='$i_syswait'
16275 i_termio='$i_termio'
16276 i_termios='$i_termios'
16278 i_unistd='$i_unistd'
16281 i_values='$i_values'
16282 i_varargs='$i_varargs'
16283 i_varhdr='$i_varhdr'
16285 ignore_versioned_solibs='$ignore_versioned_solibs'
16286 inc_version_list='$inc_version_list'
16287 inc_version_list_init='$inc_version_list_init'
16290 installarchlib='$installarchlib'
16291 installbin='$installbin'
16292 installman1dir='$installman1dir'
16293 installman3dir='$installman3dir'
16294 installprefix='$installprefix'
16295 installprefixexp='$installprefixexp'
16296 installprivlib='$installprivlib'
16297 installscript='$installscript'
16298 installsitearch='$installsitearch'
16299 installsitebin='$installsitebin'
16300 installsitelib='$installsitelib'
16301 installstyle='$installstyle'
16302 installusrbinperl='$installusrbinperl'
16303 installvendorarch='$installvendorarch'
16304 installvendorbin='$installvendorbin'
16305 installvendorlib='$installvendorlib'
16307 issymlink='$issymlink'
16308 ivdformat='$ivdformat'
16311 known_extensions='$known_extensions'
16314 lddlflags='$lddlflags'
16316 ldflags_uselargefiles='$ldflags_uselargefiles'
16317 ldlibpthname='$ldlibpthname'
16324 libsdirs='$libsdirs'
16325 libsfiles='$libsfiles'
16326 libsfound='$libsfound'
16327 libspath='$libspath'
16328 libswanted='$libswanted'
16329 libswanted_uselargefiles='$libswanted_uselargefiles'
16335 locincpth='$locincpth'
16336 loclibpth='$loclibpth'
16337 longdblsize='$longdblsize'
16338 longlongsize='$longlongsize'
16339 longsize='$longsize'
16343 lseeksize='$lseeksize'
16344 lseektype='$lseektype'
16348 make_set_make='$make_set_make'
16349 mallocobj='$mallocobj'
16350 mallocsrc='$mallocsrc'
16351 malloctype='$malloctype'
16353 man1direxp='$man1direxp'
16356 man3direxp='$man3direxp'
16358 mips_type='$mips_type'
16360 mmaptype='$mmaptype'
16361 modetype='$modetype'
16363 multiarch='$multiarch'
16365 myarchname='$myarchname'
16366 mydomain='$mydomain'
16367 myhostname='$myhostname'
16370 need_va_copy='$need_va_copy'
16371 netdb_hlen_type='$netdb_hlen_type'
16372 netdb_host_type='$netdb_host_type'
16373 netdb_name_type='$netdb_name_type'
16374 netdb_net_type='$netdb_net_type'
16377 nm_so_opt='$nm_so_opt'
16378 nonxs_ext='$nonxs_ext'
16380 nvEUformat='$nvEUformat'
16381 nvFUformat='$nvFUformat'
16382 nvGUformat='$nvGUformat'
16383 nveformat='$nveformat'
16384 nvfformat='$nvfformat'
16385 nvgformat='$nvgformat'
16388 o_nonblock='$o_nonblock'
16390 old_pthread_create_joinable='$old_pthread_create_joinable'
16391 optimize='$optimize'
16392 orderlib='$orderlib'
16395 otherlibdirs='$otherlibdirs'
16399 patchlevel='$patchlevel'
16400 path_sep='$path_sep'
16403 perladmin='$perladmin'
16404 perllibs='$perllibs'
16405 perlpath='$perlpath'
16407 phostname='$phostname'
16410 pm_apiversion='$pm_apiversion'
16414 prefixexp='$prefixexp'
16416 privlibexp='$privlibexp'
16417 prototype='$prototype'
16419 quadkind='$quadkind'
16420 quadtype='$quadtype'
16421 randbits='$randbits'
16422 randfunc='$randfunc'
16423 randseedtype='$randseedtype'
16425 rd_nodata='$rd_nodata'
16426 revision='$revision'
16430 sPRIEUldbl='$sPRIEUldbl'
16431 sPRIFUldbl='$sPRIFUldbl'
16432 sPRIGUldbl='$sPRIGUldbl'
16433 sPRIXU64='$sPRIXU64'
16435 sPRIeldbl='$sPRIeldbl'
16436 sPRIfldbl='$sPRIfldbl'
16437 sPRIgldbl='$sPRIgldbl'
16442 sSCNfldbl='$sSCNfldbl'
16443 sched_yield='$sched_yield'
16444 scriptdir='$scriptdir'
16445 scriptdirexp='$scriptdirexp'
16447 seedfunc='$seedfunc'
16448 selectminbits='$selectminbits'
16449 selecttype='$selecttype'
16450 sendmail='$sendmail'
16454 sharpbang='$sharpbang'
16455 shmattype='$shmattype'
16456 shortsize='$shortsize'
16459 sig_count='$sig_count'
16460 sig_name='$sig_name'
16461 sig_name_init='$sig_name_init'
16463 sig_num_init='$sig_num_init'
16464 signal_t='$signal_t'
16465 sitearch='$sitearch'
16466 sitearchexp='$sitearchexp'
16468 sitebinexp='$sitebinexp'
16470 sitelib_stem='$sitelib_stem'
16471 sitelibexp='$sitelibexp'
16472 siteprefix='$siteprefix'
16473 siteprefixexp='$siteprefixexp'
16474 sizesize='$sizesize'
16475 sizetype='$sizetype'
16479 sockethdr='$sockethdr'
16480 socketlib='$socketlib'
16481 socksizetype='$socksizetype'
16483 spackage='$spackage'
16484 spitshell='$spitshell'
16486 ssizetype='$ssizetype'
16487 startperl='$startperl'
16489 static_ext='$static_ext'
16491 stdio_base='$stdio_base'
16492 stdio_bufsiz='$stdio_bufsiz'
16493 stdio_cnt='$stdio_cnt'
16494 stdio_filbuf='$stdio_filbuf'
16495 stdio_ptr='$stdio_ptr'
16496 stdio_stream_array='$stdio_stream_array'
16499 subversion='$subversion'
16506 timeincl='$timeincl'
16507 timetype='$timetype'
16520 uidformat='$uidformat'
16526 uquadtype='$uquadtype'
16527 use5005threads='$use5005threads'
16528 use64bitall='$use64bitall'
16529 use64bitint='$use64bitint'
16531 useithreads='$useithreads'
16532 uselargefiles='$uselargefiles'
16533 uselongdouble='$uselongdouble'
16534 usemorebits='$usemorebits'
16535 usemultiplicity='$usemultiplicity'
16536 usemymalloc='$usemymalloc'
16538 useopcode='$useopcode'
16539 useperlio='$useperlio'
16540 useposix='$useposix'
16542 useshrplib='$useshrplib'
16543 usesocks='$usesocks'
16544 usethreads='$usethreads'
16545 usevendorprefix='$usevendorprefix'
16546 usevfork='$usevfork'
16549 uvXUformat='$uvXUformat'
16550 uvoformat='$uvoformat'
16553 uvuformat='$uvuformat'
16554 uvxformat='$uvxformat'
16555 vendorarch='$vendorarch'
16556 vendorarchexp='$vendorarchexp'
16557 vendorbin='$vendorbin'
16558 vendorbinexp='$vendorbinexp'
16559 vendorlib='$vendorlib'
16560 vendorlib_stem='$vendorlib_stem'
16561 vendorlibexp='$vendorlibexp'
16562 vendorprefix='$vendorprefix'
16563 vendorprefixexp='$vendorprefixexp'
16565 versiononly='$versiononly'
16567 voidflags='$voidflags'
16569 xs_apiversion='$xs_apiversion'
16574 : Add in command line options if available
16575 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
16577 : add special variables
16578 $test -f $src/patchlevel.h && \
16579 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
16580 echo "CONFIGDOTSH=true" >>config.sh
16582 : propagate old symbols
16583 if $test -f UU/config.sh; then
16584 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
16585 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
16586 $sort | $uniq -u >UU/oldsyms
16587 set X `cat UU/oldsyms`
16593 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
16595 echo "# Variables propagated from previous config.sh file." >>config.sh
16596 for sym in `cat UU/oldsyms`; do
16597 echo " Propagating $hint variable "'$'"$sym..."
16598 eval 'tmp="$'"${sym}"'"'
16600 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
16606 : Finish up by extracting the .SH files
16620 If you'd like to make any changes to the config.sh file before I begin
16621 to configure things, do it as a shell escape now (e.g. !vi config.sh).
16624 rp="Press return or use a shell escape to edit config.sh:"
16629 *) : in case they cannot read
16630 sh 1>&4 -c "$ans";;
16635 : if this fails, just run all the .SH files by hand
16642 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
16649 Now you need to generate make dependencies by running "$make depend".
16650 You might prefer to run it in background: "$make depend > makedepend.out &"
16651 It can take a while, so you might not want to run it right now.
16656 rp="Run $make depend now?"
16660 $make depend && echo "Now you must run '$make'."
16663 echo "You must run '$make depend' then '$make'."
16666 elif test -f [Mm]akefile; then
16668 echo "Now you must run a $make."
16673 if $test -f Policy.sh; then
16676 If you compile $package on a different machine or from a different object
16677 directory, copy the Policy.sh file from this object directory to the
16678 new one before you run Configure -- this will help you with most of
16679 the policy defaults.
16683 if $test -f config.msg; then
16684 echo "Hmm. I also noted the following information while running:"
16686 $cat config.msg >&4
16689 $rm -f kit*isdone ark*isdone