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 Sun Nov 12 20:50:13 EET 2000 [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...
43 true || cat /tmp/c1$$ /tmp/c2$$
44 true || exec sh $0 $argv:q
46 (exit $?0) || cat /tmp/c2$$
47 (exit $?0) || exec sh $0 $argv:q
48 rm -f /tmp/c1$$ /tmp/c2$$
50 : compute my invocation name
54 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
59 : Proper separator for the PATH environment variable
61 : On OS/2 this directory should exist if this is not floppy only system :-]
62 if test -d c:/. ; then
63 if test -n "$OS2_SHELL"; then
65 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
66 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
67 elif test -n "$DJGPP"; then
73 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
74 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
75 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
76 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
77 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
78 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /usr/ccs/bin"
79 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
80 paths="$paths /sbin /usr/sbin /usr/libexec"
86 *) test -d $p && PATH=$PATH$p_$p ;;
93 : shall we be using ksh?
99 if (PATH=.; alias -x) >/dev/null 2>&1; then
102 if test -f /hp-ux -a -f /bin/ksh; then
103 needksh='to avoid sh bug in "here document" expansion'
105 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
106 if test X`/usr/bin/uname -v` = X4; then
107 avoidksh="to avoid AIX 4's /bin/sh"
111 if test -f /osf_boot -a -f /usr/sbin/setld; then
112 if test X`/usr/bin/uname -s` = XOSF1; then
113 avoidksh="to avoid Digital UNIX' ksh"
115 unset BIN_SH # if this is 'xpg4' sh will start up ksh
118 case "$inksh/$needksh" in
125 case "$inksh/$avoidksh" in
131 case "$inksh/$needksh-$avoidksh-" in
134 (I see you are using the Korn shell. Some ksh's blow up on $me,
135 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
141 echo "(Feeding myself to $newsh $reason.)"
143 Configure|*/Configure) exec $newsh $0 "$@";;
144 *) exec $newsh Configure "$@";;
149 : if needed set CDPATH to a harmless value that is not chatty
150 : avoid bash 2.02 problems with empty CDPATH.
154 *bash*) CDPATH='.' ;;
159 : Configure runs within the UU subdirectory
160 test -d UU || mkdir UU
464 d_old_pthread_create_joinable=''
465 old_pthread_create_joinable=''
542 d_stdio_ptr_lval_nochange_cnt=''
543 d_stdio_ptr_lval_sets_cnt=''
714 inc_version_list_init=''
732 ignore_versioned_solibs=''
790 d_perl_otherlibdirs=''
807 d_nv_preserves_uv_bits=''
905 d_stdio_stream_array=''
906 stdio_stream_array=''
916 ccflags_uselargefiles=''
917 ldflags_uselargefiles=''
918 libswanted_uselargefiles=''
961 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
964 : We must find out about Eunice early
966 if test -f /etc/unixtovms; then
967 eunicefix=/etc/unixtovms
969 if test -f /etc/unixtovms.exe; then
970 eunicefix=/etc/unixtovms.exe
977 : set useposix=false in your hint file to disable the POSIX extension.
979 : set useopcode=false in your hint file to disable the Opcode extension.
981 : Trailing extension. Override this in a hint file, if needed.
983 : Extra object files, if any, needed on this platform.
986 : Possible local include directories to search.
987 : Set locincpth to "" in a hint file to defeat local include searches.
988 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
989 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
991 : no include file wanted by default
995 : change the next line if compiling for Xenix/286 on Xenix/386
996 xlibpth='/usr/lib/386 /lib/386'
997 : Possible local library directories to search.
998 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
999 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1001 : general looking path for locating libraries
1002 glibpth="/lib /usr/lib $xlibpth"
1003 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1004 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1005 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1007 : Private path used by Configure to find libraries. Its value
1008 : is prepended to libpth. This variable takes care of special
1009 : machines, like the mips. Usually, it should be empty.
1012 : default library list
1014 : some systems want to use only the non-versioned libso:s
1015 ignore_versioned_solibs=''
1017 ccflags_uselargefiles=''
1018 ldflags_uselargefiles=''
1019 libswanted_uselargefiles=''
1020 : set usemultiplicity on the Configure command line to enable multiplicity.
1021 : set usesocks on the Configure command line to enable socks.
1022 : set usethreads on the Configure command line to enable threads.
1023 : full support for void wanted by default
1026 : List of libraries we want.
1027 : If anyone needs -lnet, put it in a hint file.
1028 libswanted='sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl'
1029 libswanted="$libswanted dld ld sun m c cposix posix"
1030 libswanted="$libswanted ndir dir crypt sec"
1031 libswanted="$libswanted ucb bsd BSD PW x iconv util"
1032 : We probably want to search /usr/shlib before most other libraries.
1033 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1034 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1035 glibpth="/usr/shlib $glibpth"
1036 : Do not use vfork unless overridden by a hint file.
1039 : Find the basic shell for Bourne shell scripts
1043 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1046 if test -f "$xxx"; then
1049 : Build up a list and do a single loop so we can 'break' out.
1050 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1051 for xxx in sh bash ksh pdksh ash; do
1053 try="$try ${p}/${xxx}"
1057 if test -f "$xxx"; then
1060 elif test -f "$xxx.exe"; then
1071 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1073 Usually it's in /bin/sh. How did you even get this far?
1074 Please contact me (Perl Maintainers) at perlbug@perl.org and
1075 we'll try to straighten this all out.
1081 : see if sh knows # comments
1082 if `$sh -c '#' >/dev/null 2>&1`; then
1086 test -f $xcat || xcat=/usr/bin/cat
1091 if test -s today; then
1094 echo "#! $xcat" > try
1098 if test -s today; then
1106 echo "Your $sh doesn't grok # comments--I will strip them later on."
1109 echo "exec grep -v '^[ ]*#'" >spitshell
1111 $eunicefix spitshell
1112 spitshell=`pwd`/spitshell
1114 echo "I presume that if # doesn't work, #! won't work either!"
1119 : figure out how to guarantee sh startup
1121 '') startsh=${sharpbang}${sh} ;;
1133 : echo "Yup, it does."
1135 echo "Hmm... '$startsh' does not guarantee sh startup..."
1136 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1141 : Save command line options in file UU/cmdline.opt for later use in
1142 : generating config.sh.
1143 cat > cmdline.opt <<EOSH
1144 # Configure command line arguments.
1151 cat >>cmdline.opt <<EOSH
1152 config_arg$argn='$arg'
1154 argn=`expr $argn + 1`
1157 : produce awk script to parse command line options
1158 cat >options.awk <<'EOF'
1160 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1162 len = length(optstr);
1163 for (i = 1; i <= len; i++) {
1164 c = substr(optstr, i, 1);
1165 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1176 if (substr(str, 1, 1) != "-") {
1177 printf("'%s'\n", str);
1181 for (i = 2; i <= len; i++) {
1182 c = substr(str, i, 1);
1184 printf("-%s\n", substr(str, i));
1190 printf("'%s'\n", substr(str, i + 1));
1203 : process the command line options
1204 set X `for arg in "$@"; do echo "X$arg"; done |
1205 sed -e s/X// | awk -f options.awk`
1210 : set up default values
1220 rm -f optdef.sh posthint.sh
1221 cat >optdef.sh <<EOS
1227 while test $# -gt 0; do
1229 -d) shift; fastread=yes;;
1230 -e) shift; alldone=cont;;
1234 if test -r "$1"; then
1237 echo "$me: cannot read config file $1." >&2
1242 -h) shift; error=true;;
1243 -r) shift; reuseval=true;;
1244 -s) shift; silent=true; realsilent=true;;
1245 -E) shift; alldone=exit;;
1246 -K) shift; knowitall=true;;
1247 -O) shift; override=true;;
1248 -S) shift; silent=true; extractsh=true;;
1253 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1254 echo "$me: ignoring -D $1" >&2
1257 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1258 *) echo "$1='define'" >> optdef.sh;;
1265 *=) echo "$1" >> optdef.sh;;
1267 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1268 echo "$me: ignoring -U $1" >&2
1270 *) echo "$1='undef'" >> optdef.sh;;
1281 *=*) zzz=`echo $yyy|sed 's!=.*!!'`
1285 zzz=" "`echo $yyy|sed 's!^[^=]*=!!'`
1286 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1292 *:*) xxx=`echo $yyy|sed 's!:.*!!'`
1293 yyy=`echo $yyy|sed 's!^[^:]*:!!'`
1294 zzz=`echo $yyy|sed 's!^[^=]*=!!'`
1295 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1296 *) xxx=`echo $yyy|sed 's!:.*!!'`
1297 yyy=`echo $yyy|sed 's!^[^:]*:!!'` ;;
1303 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1305 echo "$yyy=''" >> posthint.sh ;;
1310 echo "$yyy='$zzz'" >> posthint.sh ;;
1312 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1314 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1319 echo "$yyy=$zzz" >> posthint.sh ;;
1320 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1324 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1327 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1335 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1336 [-U symbol] [-U symbol=] [-A command:symbol...]
1337 -d : use defaults for all answers.
1338 -e : go on without questioning past the production of config.sh.
1339 -f : specify an alternate default configuration file.
1340 -h : print this help message and exit (with an error status).
1341 -r : reuse C symbols value if possible (skips costly nm extraction).
1342 -s : silent mode, only echoes questions and essential information.
1343 -D : define symbol to have some value:
1344 -D symbol symbol gets the value 'define'
1345 -D symbol=value symbol gets the value 'value'
1346 -E : stop at the end of questions, after having produced config.sh.
1347 -K : do not use unless you know what you are doing.
1348 -O : let -D and -U override definitions from loaded configuration file.
1349 -S : perform variable substitutions on all .SH files (can mix with -f)
1350 -U : undefine symbol:
1351 -U symbol symbol gets the value 'undef'
1352 -U symbol= symbol gets completely empty
1353 -A : manipulate symbol after the platform specific hints have been applied:
1354 -A symbol=value append " "value to symbol
1355 -A append:symbol=value append value to symbol
1356 -A define:symbol=value define symbol to have value
1357 -A clear:symbol define symbol to be ''
1358 -A define:symbol define symbol to be 'define'
1359 -A eval:symbol=value define symbol to be eval of value
1360 -A prepend:symbol=value prepend value to symbol
1361 -A undef:symbol define symbol to be 'undef'
1362 -A undef:symbol= define symbol to be ''
1363 -V : print version number and exit (with a zero status).
1370 case "$fastread$alldone" in
1373 case "$extractsh" in
1376 if test ! -t 0; then
1377 echo "Say 'sh Configure', not 'sh <Configure'"
1387 true) exec 1>/dev/null;;
1390 : run the defines and the undefines, if any, but leave the file out there...
1393 : create the posthint manipulation script and leave the file out there...
1398 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1399 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1400 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1401 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1402 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1405 : Some greps do not return status, grrr.
1406 echo "grimblepritz" >grimble
1407 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1409 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1415 : the following should work in any shell
1419 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1420 cat >contains <<'EOSS'
1421 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1426 : Find the path to the source tree
1429 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1432 *) src=`cd ../$src && pwd` ;;
1445 if test -f $rsrc/Configure && \
1446 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1448 : found it, so we are ok.
1451 for src in . .. ../.. ../../.. ../../../..; do
1452 if test -f ../$src/Configure && \
1453 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1464 Sorry, I can't seem to locate the source dir for $package. Please start
1465 Configure with an explicit path -- i.e. /some/path/Configure.
1473 echo "Sources for $package found in \"$src\"." >&4
1477 : script used to extract .SH files with variable substitutions
1478 cat >extract <<'EOS'
1480 echo "Doing variable substitutions on .SH files..."
1481 if test -f $src/MANIFEST; then
1482 set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH$'`
1484 echo "(Looking for .SH files under the source directory.)"
1485 set x `(cd $src; find . -name "*.SH" -print)`
1489 0) set x `(cd $src; echo *.SH)`; shift;;
1491 if test ! -f $src/$1; then
1497 while test $name; do
1498 if test ! -d "$name"; then
1499 create="$name $create";
1500 name=`echo $name | sed -e "s|^[^/]*$||"`;
1501 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1506 for file in $create; do
1515 dir=`expr X$file : 'X\(.*\)/'`
1516 file=`expr X$file : 'X.*/\(.*\)'`
1517 (cd $dir && . ./$file)
1527 dir=`expr X$file : 'X\(.*\)/'`
1528 file=`expr X$file : 'X.*/\(.*\)'`
1529 (set x $dir; shift; eval $mkdir_p)
1539 if test -f $src/config_h.SH; then
1540 if test ! -f config.h; then
1541 : oops, they left it out of MANIFEST, probably, so do it anyway.
1547 : extract files and exit if asked to do so
1548 case "$extractsh" in
1550 case "$realsilent" in
1554 case "$config_sh" in
1555 '') config_sh='config.sh';;
1558 echo "Fetching answers from $config_sh..."
1561 test "$override" && . ./optdef.sh
1570 : Eunice requires " " instead of "", can you believe it
1573 echo "Beginning of configuration questions for $package."
1575 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1577 : first determine how to suppress newline on echo command
1579 echo "Checking echo to see how to suppress newlines..."
1580 (echo "hi there\c" ; echo " ") >.echotmp
1581 if $contains c .echotmp >/dev/null 2>&1 ; then
1592 echo $n "The star should be here-->$c"
1596 : Now test for existence of everything in MANIFEST
1598 if test -f $rsrc/MANIFEST; then
1599 echo "First let's make sure your kit is complete. Checking..." >&4
1600 awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
1603 for filelist in x??; do
1604 (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
1606 if test -s missing; then
1610 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1612 You have the option of continuing the configuration process, despite the
1613 distinct possibility that your kit is damaged, by typing 'y'es. If you
1614 do, don't blame me if something goes wrong. I advise you to type 'n'o
1615 and contact the author (perlbug@perl.org).
1618 echo $n "Continue? [n] $c" >&4
1622 echo "Continuing..." >&4
1626 echo "ABORTING..." >&4
1631 echo "Looks good..."
1634 echo "There is no MANIFEST file. I hope your kit is complete !"
1639 : Find the appropriate value for a newline for tr
1640 if test -n "$DJGPP"; then
1643 if test X"$trnl" = X; then
1644 case "`echo foo|tr '\n' x 2>/dev/null`" in
1648 if test X"$trnl" = X; then
1649 case "`echo foo|tr '\012' x 2>/dev/null`" in
1650 foox) trnl='\012' ;;
1653 if test X"$trnl" = X; then
1656 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1662 : compute the number of columns on the terminal for proper question formatting
1667 : set up the echo used in my read
1668 myecho="case \"\$xxxm\" in
1669 '') echo $n \"\$rp $c\" >&4;;
1671 '') echo $n \"[\$xxxm] $c\";;
1673 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1675 echo $n \"[\$xxxm] $c\" >&4
1677 echo $n \"\$rp [\$xxxm] $c\" >&4
1683 : now set up to do reads with possible shell escape and default assignment
1689 case "\$fastread" in
1690 yes) case "\$dflt" in
1693 case "\$silent-\$rp" in
1698 *) case "\$silent" in
1699 true) case "\$rp" in
1704 while expr "X\$ans" : "X!" >/dev/null; do
1708 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1716 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1725 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1730 echo "(OK, I'll run with -d after this question.)" >&4
1733 echo "*** Sorry, \$1 not supported yet." >&4
1743 echo "*** Substitution done -- please confirm."
1745 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1750 echo "*** Error -- try again."
1757 case "\$ans\$xxxm\$nostick" in
1769 : create .config dir to save info across Configure sessions
1770 test -d ../.config || mkdir ../.config
1771 cat >../.config/README <<EOF
1772 This directory created by Configure to save information that should
1773 persist across sessions for $package.
1775 You may safely delete it if you wish.
1778 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
1780 $define|true|[yY]*) ;;
1781 *) case "$xversion" in
1784 *** WHOA THERE!!! ***
1786 This is an UNSTABLE DEVELOPMENT release.
1787 The version of this $package distribution is $xversion, that is, odd,
1788 (as opposed to even) and that signifies a development release.
1789 If you want a maintenance release, you want an even-numbered version.
1791 Do ***NOT*** install this into production use.
1792 Data corruption and crashes are possible.
1794 It is most seriously suggested that you do not continue any further
1795 unless you want to help in developing and debugging Perl.
1798 rp='Do you really want to continue?'
1802 [yY]) echo >&4 "Okay, continuing." ;;
1803 *) echo >&4 "Okay, bye."
1812 : general instructions
1815 user=`(logname) 2>/dev/null`
1817 '') user=`whoami 2>&1`;;
1819 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1822 rp='Would you like to see the instructions?'
1833 This installation shell script will examine your system and ask you questions
1834 to determine how the perl5 package should be installed. If you get
1835 stuck on a question, you may use a ! shell escape to start a subshell or
1836 execute a command. Many of the questions will have default answers in square
1837 brackets; typing carriage return will give you the default.
1839 On some of the questions which ask for file or directory names you are allowed
1840 to use the ~name construct to specify the login directory belonging to "name",
1841 even if you don't have a shell which knows about that. Questions where this is
1842 allowed will be marked "(~name ok)".
1846 dflt='Type carriage return to continue'
1850 The prompter used in this script allows you to use shell variables and
1851 backticks in your answers. You may use $1, $2, etc... to refer to the words
1852 in the default answer, as if the default line was a set of arguments given to a
1853 script shell. This means you may also use $* to repeat the whole default line,
1854 so you do not have to re-type everything to add something to the default.
1856 Everytime there is a substitution, you will have to confirm. If there is an
1857 error (e.g. an unmatched backtick), the default answer will remain unchanged
1858 and you will be prompted again.
1860 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1861 the questions and use the computed defaults (or the previous answers if there
1862 was already a config.sh file). Type 'Configure -h' for a list of options.
1863 You may also start interactively and then answer '& -d' at any prompt to turn
1864 on the non-interactive behaviour for the remainder of the execution.
1870 Much effort has been expended to ensure that this shell script will run on any
1871 Unix system. If despite that it blows up on yours, your best bet is to edit
1872 Configure and run it again. If you can't run Configure for some reason,
1873 you'll have to generate a config.sh file by hand. Whatever problems you
1874 have, let me (perlbug@perl.org) know how I blew it.
1876 This installation script affects things in two ways:
1878 1) it may do direct variable substitutions on some of the files included
1880 2) it builds a config.h file for inclusion in C programs. You may edit
1881 any of these files as the need arises after running this script.
1883 If you make a mistake on a question, there is no easy way to back up to it
1884 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1885 files. Configure will offer to let you do this before it runs the SH files.
1888 dflt='Type carriage return to continue'
1890 case "$firsttime" in
1891 true) echo $user >>../.config/instruct;;
1895 : find out where common programs are
1897 echo "Locating common programs..." >&4
1910 if test -d \$dir/\$thing; then
1916 for thisthing in \$dir/\$thing; do
1917 : just loop through to pick last item
1919 if test -f \$thisthing; then
1922 elif test -f \$dir/\$thing.exe; then
1923 if test -n "$DJGPP"; then
1924 echo \$dir/\$thing.exe
1926 : on Eunice apparently
1976 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1977 pth="$pth /lib /usr/lib"
1978 for file in $loclist; do
1982 if test -f "$xxx"; then
1985 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1986 xxx=`./loc $file $file $pth`
1989 '') xxx=`./loc $file $file $pth`;;
1990 *) xxx=`./loc $xxx $xxx $pth`;;
1996 echo $file is in $xxx.
1999 echo $file is in $xxx.
2002 echo "I don't know where '$file' is, and my life depends on it." >&4
2003 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2009 echo "Don't worry if any of the following aren't found..."
2011 for file in $trylist; do
2015 if test -f "$xxx"; then
2018 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2019 xxx=`./loc $file $file $pth`
2022 '') xxx=`./loc $file $file $pth`;;
2023 *) xxx=`./loc $xxx $xxx $pth`;;
2029 echo $file is in $xxx.
2032 echo $file is in $xxx.
2035 echo "I don't see $file out there, $say."
2042 echo "Substituting grep for egrep."
2048 echo "Substituting cp for ln."
2054 echo "Hopefully test is built into your sh."
2057 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2058 echo "Using the test built into your sh."
2066 echo "Hopefully echo is built into your sh."
2071 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2072 $echo $n "hi there$c" >foo1
2073 echo $n "hi there$c" >foo2
2074 if cmp foo1 foo2 >/dev/null 2>&1; then
2075 echo "They are compatible. In fact, they may be identical."
2082 They are not compatible! You are probably running ksh on a non-USG system.
2083 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2084 have echo built in and we may have to run some Bourne shell scripts. That
2085 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2088 $echo $n "The star should be here-->$c"
2098 cat <<'EOSC' >>checkcc
2103 int main(int argc, char *argv[]) {
2107 if $cc -o try $ccflags try.c; then
2110 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2116 case "`$cc -v -c try.c 2>&1`" in
2119 if $test X"$trygcc" = Xyes; then
2120 if gcc -o try -c try.c; then
2122 echo "You seem to have a working gcc, though." >&4
2123 rp="Would you like to use it?"
2125 if $test -f myread; then
2128 if $test -f UU/myread; then
2131 echo "Cannot find myread, sorry. Aborting." >&2
2136 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no ;;
2140 if $test X"$despair" = Xyes; then
2142 You need to find a working C compiler.
2143 Either (purchase and) install the C compiler supplied by your OS vendor,
2144 or for a free C compiler try http://gcc.gnu.org/
2145 I cannot continue any further, aborting.
2155 : determine whether symbolic links are supported
2158 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2159 echo "Symbolic links are supported." >&4
2162 echo "Symbolic links are NOT supported." >&4
2167 : see whether [:lower:] and [:upper:] are supported character classes
2169 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2171 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2175 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
2176 # (0xc9 and 0xd1), therefore that is a nice testing point.
2177 if test "X$up" = X -o "X$low" = X; then
2178 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
2184 if test "X$up" = X -o "X$low" = X; then
2185 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
2191 if test "X$up" = X -o "X$low" = X; then
2192 case "`echo IJ | od -x 2>/dev/null`" in
2194 echo "Hey, this might be EBCDIC." >&4
2195 if test "X$up" = X -o "X$low" = X; then
2196 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2197 ij) up='[A-IJ-RS-Z]'
2202 if test "X$up" = X -o "X$low" = X; then
2203 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2213 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
2215 echo "Using $up and $low to convert case." >&4
2218 echo "I don't know how to translate letters from upper to lower case." >&4
2219 echo "Your tr is not acting any way I know of." >&4
2223 : set up the translation script tr, must be called with ./tr of course
2227 '[A-Z][a-z]') exec $tr '$up' '$low';;
2228 '[a-z][A-Z]') exec $tr '$low' '$up';;
2235 : Try to determine whether config.sh was made on this system
2236 case "$config_sh" in
2238 myuname=`$uname -a 2>/dev/null`
2239 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2240 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2241 # because the A-Z/a-z are not consecutive.
2242 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2243 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2244 newmyuname="$myuname"
2246 case "$knowitall" in
2248 if test -f ../config.sh; then
2249 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2250 eval "`grep myuname= ../config.sh`"
2252 if test "X$myuname" = "X$newmyuname"; then
2260 : Get old answers from old config file if Configure was run on the
2261 : same system, otherwise use the hints.
2264 if test -f config.sh; then
2266 rp="I see a config.sh file. Shall I use it to set the defaults?"
2269 n*|N*) echo "OK, I'll ignore it."
2270 mv config.sh config.sh.old
2271 myuname="$newmyuname"
2273 *) echo "Fetching default answers from your old config.sh file..." >&4
2281 : Older versions did not always set $sh. Catch re-use of such
2291 if test ! -f config.sh; then
2294 First time through, eh? I have some defaults handy for some systems
2295 that need some extra help getting the Configure answers right:
2298 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2300 : Half the following guesses are probably wrong... If you have better
2301 : tests or hints, please send them to perlbug@perl.org
2302 : The metaconfig authors would also appreciate a copy...
2303 $test -f /irix && osname=irix
2304 $test -f /xenix && osname=sco_xenix
2305 $test -f /dynix && osname=dynix
2306 $test -f /dnix && osname=dnix
2307 $test -f /lynx.os && osname=lynxos
2308 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2309 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
2310 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2311 $test -f /bin/mips && /bin/mips && osname=mips
2312 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
2313 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
2314 $test -d /usr/apollo/bin && osname=apollo
2315 $test -f /etc/saf/_sactab && osname=svr4
2316 $test -d /usr/include/minix && osname=minix
2317 if $test -d /MachTen -o -d /MachTen_Folder; then
2319 if $test -x /sbin/version; then
2320 osvers=`/sbin/version | $awk '{print $2}' |
2321 $sed -e 's/[A-Za-z]$//'`
2322 elif $test -x /usr/etc/version; then
2323 osvers=`/usr/etc/version | $awk '{print $2}' |
2324 $sed -e 's/[A-Za-z]$//'`
2330 $test -f /sys/posix.dll &&
2331 $test -f /usr/bin/what &&
2332 set X `/usr/bin/what /sys/posix.dll` &&
2333 $test "$3" = UWIN &&
2337 if $test -f $uname; then
2345 umips) osname=umips ;;
2348 [23]100) osname=mips ;;
2349 next*) osname=next ;;
2351 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
2352 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
2355 elif $test -f /etc/kconfig; then
2357 if test "$lns" = "$ln -s"; then
2359 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
2361 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
2368 if test -n "$DJGPP"; then
2377 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
2379 'not found') osvers="$4"."$3" ;;
2380 '<3240'|'<>3240') osvers=3.2.0 ;;
2381 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
2382 '=3250'|'>3250') osvers=3.2.5 ;;
2386 bsd386) osname=bsd386
2389 cygwin*) osname=cygwin
2392 *dc.osx) osname=dcosx
2398 domainos) osname=apollo
2404 dynixptx*) osname=dynixptx
2405 osvers=`echo "$4"|sed 's/^v//'`
2407 freebsd) osname=freebsd
2409 genix) osname=genix ;;
2411 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
2427 netbsd*) osname=netbsd
2430 news-os) osvers="$3"
2432 4*) osname=newsos4 ;;
2436 next*) osname=next ;;
2437 nonstop-ux) osname=nonstopux ;;
2438 POSIX-BC | posix-bc ) osname=posix-bc
2441 powerux | power_ux | powermax_os | powermaxos | \
2442 powerunix | power_unix) osname=powerux
2448 solaris) osname=solaris
2450 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2457 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2461 titanos) osname=titanos
2470 ultrix) osname=ultrix
2473 osf1|mls+) case "$5" in
2476 osvers=`sizer -v | awk '{print $3}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
2479 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
2482 hp*) osname=hp_osf1 ;;
2483 mips) osname=mips_osf1 ;;
2486 unixware) osname=svr5
2492 $2) case "$osname" in
2496 : svr4.x or possibly later
2506 if test -f /stand/boot ; then
2507 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
2508 if test -n "$INITPROG" -a -f "$INITPROG"; then
2509 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
2510 if test -n "$isesix"; then
2518 *) if test -f /etc/systemid; then
2520 set `echo $3 | $sed 's/\./ /g'` $4
2521 if $test -f $src/hints/sco_$1_$2_$3.sh; then
2523 elif $test -f $src/hints/sco_$1_$2.sh; then
2525 elif $test -f $src/hints/sco_$1.sh; then
2530 '') : Still unknown. Probably a generic Sys V.
2539 *) case "$osname" in
2540 '') : Still unknown. Probably a generic BSD.
2548 if test -f /vmunix -a -f $src/hints/news_os.sh; then
2549 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
2550 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
2553 $rm -f UU/kernel.what
2554 elif test -d c:/.; then
2561 : Now look for a hint file osname_osvers, unless one has been
2562 : specified already.
2565 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
2566 : Also try without trailing minor version numbers.
2567 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
2568 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
2569 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
2570 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
2573 *) case "$osvers" in
2576 *) if $test -f $src/hints/$file.sh ; then
2578 elif $test -f $src/hints/$xfile.sh ; then
2580 elif $test -f $src/hints/$xxfile.sh ; then
2582 elif $test -f $src/hints/$xxxfile.sh ; then
2584 elif $test -f $src/hints/$xxxxfile.sh ; then
2586 elif $test -f "$src/hints/${osname}.sh" ; then
2595 if $test -f Policy.sh ; then
2598 none) dflt="Policy" ;;
2599 *) dflt="Policy $dflt" ;;
2604 dflt=`echo $hintfile | $sed 's/\.sh$//'`
2608 if $test -f Policy.sh ; then
2611 There's also a Policy hint file available, which should make the
2612 site-specific (policy) questions easier to answer.
2619 You may give one or more space-separated answers, or "none" if appropriate.
2620 A well-behaved OS will have no hints, so answering "none" or just "Policy"
2621 is a good thing. DO NOT give a wrong version or a wrong OS.
2625 rp="Which of these apply, if any?"
2628 for file in $tans; do
2629 if $test X$file = XPolicy -a -f Policy.sh; then
2631 $cat Policy.sh >> UU/config.sh
2632 elif $test -f $src/hints/$file.sh; then
2633 . $src/hints/$file.sh
2634 $cat $src/hints/$file.sh >> UU/config.sh
2635 elif $test X$tans = X -o X$tans = Xnone ; then
2638 : Give one chance to correct a possible typo.
2639 echo "$file.sh does not exist"
2641 rp="hint to use instead?"
2643 for file in $ans; do
2644 if $test -f "$src/hints/$file.sh"; then
2645 . $src/hints/$file.sh
2646 $cat $src/hints/$file.sh >> UU/config.sh
2647 elif $test X$ans = X -o X$ans = Xnone ; then
2650 echo "$file.sh does not exist -- ignored."
2657 : Remember our hint file for later.
2658 if $test -f "$src/hints/$file.sh" ; then
2668 echo "Fetching default answers from $config_sh..." >&4
2672 cp $config_sh config.sh 2>/dev/null
2682 test "$override" && . ./optdef.sh
2684 : Restore computed paths
2685 for file in $loclist $trylist; do
2686 eval $file="\$_$file"
2691 Configure uses the operating system name and version to set some defaults.
2692 The default value is probably right if the name rings a bell. Otherwise,
2693 since spelling matters for me, either accept the default or answer "none"
2700 ''|' '|none) dflt=none ;;
2701 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
2704 *) dflt="$osname" ;;
2706 rp="Operating system name?"
2710 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
2716 ''|' '|none) dflt=none ;;
2717 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
2718 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
2720 ''|' ') dflt=none ;;
2725 *) dflt="$osvers" ;;
2727 rp="Operating system version?"
2737 : who configured the system
2738 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
2739 cf_by=`(logname) 2>/dev/null`
2742 cf_by=`(whoami) 2>/dev/null`
2744 "") cf_by=unknown ;;
2748 : set up the script used to warn in case of inconsistency
2755 echo "*** WHOA THERE!!! ***" >&4
2756 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2757 rp=" Keep the $hint value?"
2760 y) td=$was; tu=$was;;
2764 : function used to set $1 to $val
2765 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2767 $define$undef) . ./whoa; eval "$var=\$td";;
2768 $undef$define) . ./whoa; eval "$var=\$tu";;
2769 *) eval "$var=$val";;
2772 case "$usethreads" in
2773 $define|true|[yY]*) dflt='y';;
2778 Perl can be built to take advantage of threads on some systems.
2779 To do so, Configure can be run with -Dusethreads.
2781 Note that threading is a highly experimental feature, and
2782 some known race conditions still remain. If you choose to try
2783 it, be very sure to not actually deploy it for production
2784 purposes. README.threads has more details, and is required
2785 reading if you enable threads.
2787 If this doesn't make any sense to you, just accept the default '$dflt'.
2789 rp='Build a threading Perl?'
2792 y|Y) val="$define" ;;
2798 case "$usethreads" in
2802 As of 5.5.640, Perl has two different internal threading implementations,
2803 the 5.005 version (5005threads) and an interpreter-based version
2804 (ithreads) that has one interpreter per thread. Both are very
2805 experimental. This arrangement exists to help developers work out
2806 which one is better.
2808 If you're a casual user, you probably don't want interpreter-threads
2809 at this time. There doesn't yet exist a way to create threads from
2810 within Perl in this model, i.e., "use Thread;" will NOT work.
2812 : Default to ithreads unless overridden on command line or with
2815 case "$use5005threads" in
2816 $define|true|[yY]*) dflt='n';;
2818 case "$useithreads" in
2819 $undef|false|[nN]*) dflt='n';;
2821 rp='Use interpreter-based ithreads?'
2824 y|Y) val="$define" ;;
2829 : Now set use5005threads to the opposite value.
2830 case "$useithreads" in
2831 $define) val="$undef" ;;
2838 useithreads="$undef"
2839 use5005threads="$undef"
2843 case "$d_oldpthreads" in
2844 '') : Configure tests would be welcome here. For now, assume undef.
2846 *) val="$d_oldpthreads" ;;
2852 case "$usethreads" in
2853 "$define"|true|[yY]*)
2854 : Look for a hint-file generated 'call-back-unit'. If the
2855 : user has specified that a threading perl is to be built,
2856 : we may need to set or change some other defaults.
2857 if $test -f usethreads.cbu; then
2858 echo "Your platform has some specific hints for threaded builds, using them..."
2862 (Your platform doesn't have any specific hints for threaded builds.
2863 Assuming POSIX threads, then.)
2871 Perl can be built so that multiple Perl interpreters can coexist
2872 within the same Perl executable.
2875 case "$useithreads" in
2878 This multiple interpreter support is required for interpreter-based threads.
2882 *) case "$usemultiplicity" in
2883 $define|true|[yY]*) dflt='y';;
2887 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
2888 rp='Build Perl for multiplicity?'
2891 y|Y) val="$define" ;;
2899 : make some quick guesses about what we are up against
2901 $echo $n "Hmm... $c"
2911 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
2912 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
2914 echo "Looks kind of like an OSF/1 system, but we'll see..."
2916 elif test `echo abc | $tr a-z A-Z` = Abc ; then
2917 xxx=`./loc addbib blurfl $pth`
2918 if $test -f $xxx; then
2919 echo "Looks kind of like a USG system with BSD features, but we'll see..."
2923 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
2924 echo "Looks kind of like an extended USG system, but we'll see..."
2926 echo "Looks kind of like a USG system, but we'll see..."
2930 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
2931 echo "Looks kind of like a BSD system, but we'll see..."
2935 echo "Looks kind of like a Version 7 system, but we'll see..."
2938 case "$eunicefix" in
2941 There is, however, a strange, musty smell in the air that reminds me of
2942 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
2946 : it so happens the Eunice I know will not run shell scripts in Unix format
2950 echo "Congratulations. You aren't running Eunice."
2954 : Detect OS2. The p_ variable is set above in the Head.U unit.
2955 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
2956 : semicolon as a patch separator
2961 I have the feeling something is not exactly right, however...don't tell me...
2962 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
2963 (Or you may be running DOS with DJGPP.)
2968 if test -f /xenix; then
2969 echo "Actually, this looks more like a XENIX system..."
2974 echo "It's not Xenix..."
2979 if test -f /venix; then
2980 echo "Actually, this looks more like a VENIX system..."
2987 echo "Nor is it Venix..."
2990 chmod +x bsd usg v7 osf1 eunice xenix venix os2
2991 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
2998 rp="Use which C compiler?"
3001 : Look for a hint-file generated 'call-back-unit'. Now that the
3002 : user has specified the compiler, we may need to set or change some
3004 if $test -f cc.cbu; then
3010 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3011 $cat >gccvers.c <<EOM
3016 printf("%s\n", __VERSION__);
3018 printf("%s\n", "1");
3024 if $cc -o gccvers $ldflags gccvers.c; then
3025 gccversion=`./gccvers`
3026 case "$gccversion" in
3027 '') echo "You are not using GNU cc." ;;
3028 *) echo "You are using GNU cc $gccversion."
3034 echo "*** WHOA THERE!!! ***" >&4
3035 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3036 case "$knowitall" in
3038 echo " You'd better start hunting for one and let me know about it." >&4
3044 case "$gccversion" in
3045 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3047 case "$gccversion" in
3048 '') gccosandvers='' ;;
3049 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
3050 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
3052 case "$gccosandvers" in
3053 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
3054 $osname$osvers) ;; # looking good
3055 $osname*) cat <<EOM >&4
3057 *** WHOA THERE!!! ***
3059 Your gcc has not been compiled for the exact release of
3060 your operating system ($gccosandvers versus $osname$osvers).
3062 In general it is a good idea to keep gcc synchronized with
3063 the operating system because otherwise serious problems
3064 may ensue when trying to compile software, like Perl.
3066 I'm trying to be optimistic here, though, and will continue.
3067 If later during the configuration and build icky compilation
3068 problems appear (headerfile conflicts being the most common
3069 manifestation), I suggest reinstalling the gcc to match
3070 your operating system release.
3074 *) gccosandvers='' ;; # failed to parse, better be silent
3082 : see how we invoke the C preprocessor
3084 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3085 cat <<'EOT' >testcpp.c
3091 if test ! -f cppstdin; then
3092 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
3093 # AIX cc -E doesn't show the absolute headerfile
3094 # locations but we'll cheat by using the -M flag.
3095 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
3097 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3100 echo "Keeping your $hint cppstdin wrapper."
3103 wrapper=`pwd`/cppstdin
3107 if $test "X$cppstdin" != "X" && \
3108 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3109 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3111 echo "You used to use $cppstdin $cppminus so we'll use that again."
3113 '') echo "But let's see if we can live without a wrapper..." ;;
3115 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3116 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3118 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3121 echo "(However, $cpprun $cpplast does not work, let's see...)"
3129 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3136 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3137 $cc -E <testcpp.c >testcpp.out 2>&1; \
3138 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3139 echo "Yup, it does."
3142 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
3143 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3144 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3145 echo "Yup, it does."
3148 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
3149 $cc -P <testcpp.c >testcpp.out 2>&1; \
3150 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3151 echo "Yipee, that works!"
3154 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
3155 $cc -P - <testcpp.c >testcpp.out 2>&1; \
3156 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3157 echo "At long last!"
3160 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
3161 $cpp <testcpp.c >testcpp.out 2>&1; \
3162 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3166 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
3167 $cpp - <testcpp.c >testcpp.out 2>&1; \
3168 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3169 echo "Hooray, it works! I was beginning to wonder."
3172 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
3173 $wrapper <testcpp.c >testcpp.out 2>&1; \
3174 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3180 rp="No dice. I can't find a C preprocessor. Name one:"
3184 $x_cpp <testcpp.c >testcpp.out 2>&1
3185 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3186 echo "OK, that will do." >&4
3188 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
3203 echo "Perhaps can we force $cc -E using a wrapper..."
3204 if $wrapper <testcpp.c >testcpp.out 2>&1; \
3205 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3211 echo "Nope, we'll have to live without it..."
3225 "$wrapper"|'cppstdin') ;;
3226 *) $rm -f $wrapper;;
3228 $rm -f testcpp.c testcpp.out
3230 : decide how portable to be. Allow command line overrides.
3231 case "$d_portable" in
3233 *) d_portable="$define" ;;
3236 : set up shell script to do ~ expansion
3242 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3245 if $test -f /bin/csh; then
3246 /bin/csh -f -c "glob \$1"
3251 name=\`$expr x\$1 : '..\([^/]*\)'\`
3252 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3253 if $test ! -d "\$dir"; then
3255 echo "\$me: can't locate home directory for: \$name" >&2
3260 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3276 : now set up to get a file name
3280 cat <<'EOSC' >>getfile
3296 expr $fn : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3297 fn=`echo $fn | sed 's/(.*)//'`
3303 loc_file=`expr $fn : '.*:\(.*\)'`
3304 fn=`expr $fn : '\(.*\):.*'`
3312 */*) fullpath=true;;
3321 *e*) exp_file=true;;
3324 *p*) nopath_ok=true;;
3329 *d*) type='Directory';;
3330 *l*) type='Locate';;
3335 Locate) what='File';;
3340 case "$d_portable" in
3348 while test "$type"; do
3353 true) rp="$rp (~name ok)";;
3356 if test -f UU/getfile.ok && \
3357 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3376 value=`UU/filexp $ans`
3379 if test "$ans" != "$value"; then
3380 echo "(That expands to $value on this system.)"
3394 /*) value="$ansexp" ;;
3395 [a-zA-Z]:/*) value="$ansexp" ;;
3400 echo "I shall only accept a full path name, as in /bin/ls." >&4
3401 echo "Use a ! shell escape if you wish to check pathnames." >&4
3404 echo "Please give a full path name, starting with slash." >&4
3407 echo "Note that using ~name is ok provided it expands well." >&4
3420 for fp in $gfpth; do
3421 if test "X$fp" = X.; then
3426 if test -f "$pf"; then
3428 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3430 echo "($value is not a plain file, but that's ok.)"
3433 if test X"$type" = X; then
3440 for fp in $gfpth; do
3441 if test "X$fp" = X.; then
3446 direxp="$fp/$ansexp"
3448 if test -d "$direxp"; then
3456 if test -d "$ansexp"; then
3457 echo "(Looking for $loc_file in directory $value.)"
3458 value="$value/$loc_file"
3459 ansexp="$ansexp/$loc_file"
3461 if test -f "$ansexp"; then
3464 case "$nopath_ok" in
3465 true) case "$value" in
3467 *) echo "Assuming $value will be in people's path."
3483 if test "$fastread" = yes; then
3488 rp="$what $value doesn't exist. Use that name anyway?"
3507 test "X$gfpthkeep" != Xy && gfpth=""
3510 : What should the include directory be ?
3512 $echo $n "Hmm... $c"
3516 if $test -f /bin/mips && /bin/mips; then
3517 echo "Looks like a MIPS system..."
3518 $cat >usr.c <<'EOCP'
3519 #ifdef SYSTYPE_BSD43
3523 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3524 dflt='/bsd43/usr/include'
3528 mips_type='System V'
3530 $rm -f usr.c usr.out
3531 echo "and you're compiling with the $mips_type compiler and libraries."
3535 echo "Doesn't look like a MIPS system."
3545 case "$xxx_prompt" in
3548 rp='Where are the include files you want to use?'
3556 : Set private lib path
3559 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
3564 '') dlist="$loclibpth $plibpth $glibpth";;
3565 *) dlist="$libpth";;
3568 : Now check and see which directories actually exist, avoiding duplicates
3572 if $test -d $xxx; then
3575 *) libpth="$libpth $xxx";;
3581 Some systems have incompatible or broken versions of libraries. Among
3582 the directories listed in the question below, please remove any you
3583 know not to be holding relevant libraries, and add any that are needed.
3584 Say "none" for none.
3595 rp="Directories to use for library searches?"
3602 : compute shared library extension
3605 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
3615 On some systems, shared libraries may be available. Answer 'none' if
3616 you want to suppress searching of shared libraries for the remainder
3617 of this configuration.
3620 rp='What is the file extension used for shared libraries?'
3624 : Define several unixisms.
3625 : Hints files or command line option can be used to override them.
3626 : The convoluted testing is in case hints files set either the old
3629 '') case "$exe_ext" in
3631 *) _exe="$exe_ext" ;;
3636 '') case "$lib_ext" in
3643 '') case "$obj_ext" in
3650 '') case "$path_sep" in
3661 : Which makefile gets called first. This is used by make depend.
3662 case "$firstmakefile" in
3663 '') firstmakefile='makefile';;
3667 $define|true|[yY]*) dflt='y';;
3672 Perl can be built to use the SOCKS proxy protocol library. To do so,
3673 Configure must be run with -Dusesocks.
3675 If this doesn't make any sense to you, just accept the default '$dflt'.
3677 rp='Build Perl for SOCKS?'
3680 y|Y) val="$define" ;;
3686 : Looking for optional libraries
3688 echo "Checking for optional libraries..." >&4
3693 case "$libswanted" in
3694 '') libswanted='c_s';;
3697 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
3703 for thisdir in $libpth $xlibpth; do
3704 test -d $thisdir && libspath="$libspath $thisdir"
3706 for thislib in $libswanted; do
3707 for thisdir in $libspath; do
3709 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
3710 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|tail -1`
3711 $test -f "$xxx" && eval $libscheck
3712 $test -f "$xxx" && libstyle=shared
3714 if test ! -f "$xxx"; then
3715 xxx=$thisdir/lib$thislib.$so
3716 $test -f "$xxx" && eval $libscheck
3717 $test -f "$xxx" && libstyle=shared
3719 if test ! -f "$xxx"; then
3720 xxx=$thisdir/lib$thislib$_a
3721 $test -f "$xxx" && eval $libscheck
3722 $test -f "$xxx" && libstyle=static
3724 if test ! -f "$xxx"; then
3725 xxx=$thisdir/$thislib$_a
3726 $test -f "$xxx" && eval $libscheck
3727 $test -f "$xxx" && libstyle=static
3729 if test ! -f "$xxx"; then
3730 xxx=$thisdir/lib${thislib}_s$_a
3731 $test -f "$xxx" && eval $libscheck
3732 $test -f "$xxx" && libstyle=static
3733 $test -f "$xxx" && thislib=${thislib}_s
3735 if test ! -f "$xxx"; then
3736 xxx=$thisdir/Slib$thislib$_a
3737 $test -f "$xxx" && eval $libscheck
3738 $test -f "$xxx" && libstyle=static
3740 if $test -f "$xxx"; then
3742 shared) echo "Found -l$thislib (shared)." ;;
3743 static) echo "Found -l$thislib." ;;
3744 *) echo "Found -l$thislib ($libstyle)." ;;
3748 *) dflt="$dflt -l$thislib"
3749 libsfound="$libsfound $xxx"
3751 libsfiles="$libsfiles $yyy"
3752 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
3753 case " $libsdirs " in
3755 *) libsdirs="$libsdirs $yyy" ;;
3762 if $test ! -f "$xxx"; then
3763 echo "No -l$thislib."
3774 ' '|'') dflt='none';;
3779 In order to compile $package on your machine, a number of libraries
3780 are usually needed. Include any other special libraries here as well.
3781 Say "none" for none. The default list is almost always right.
3785 rp="What libraries to use?"
3792 : determine optimization, if desired, or use for debug flag also
3794 ' '|$undef) dflt='none';;
3796 *) dflt="$optimize";;
3800 By default, $package compiles with the -O flag to use the optimizer.
3801 Alternately, you might want to use the symbolic debugger, which uses
3802 the -g flag (on traditional Unix systems). Either flag can be
3803 specified here. To use neither flag, specify the word "none".
3806 rp="What optimizer/debugger flag should be used?"
3810 'none') optimize=" ";;
3814 : We will not override a previous value, but we might want to
3815 : augment a hint file
3817 default|recommended)
3818 case "$gccversion" in
3819 1*) dflt='-fpcc-struct-return' ;;
3822 *-g*) dflt="$dflt -DDEBUGGING";;
3824 case "$gccversion" in
3825 2*) if test -d /etc/conf/kconfig.d &&
3826 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
3832 case "$gccversion" in
3836 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
3837 echo 'int main(void) { return 0; }' > gcctest.c
3838 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
3839 echo "Yes, it does." 2>&1
3842 echo "Leaving current flags $ccflags alone." 2>&1
3844 *) dflt="$dflt -fno-strict-aliasing" ;;
3847 echo "Nope, it doesn't, but that's ok." 2>&1
3854 case "$mips_type" in
3855 *BSD*|'') inclwanted="$locincpth $usrinc";;
3856 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
3858 for thisincl in $inclwanted; do
3859 if $test -d $thisincl; then
3860 if $test x$thisincl != x$usrinc; then
3862 *" -I$thisincl "*);;
3863 *) dflt="$dflt -I$thisincl ";;
3869 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
3871 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
3879 *) dflt="$dflt -D$2";;
3883 set signal.h LANGUAGE_C; eval $inctest
3887 ccflags="$ccflags -DSOCKS"
3892 default|recommended) dflt="$ccflags $dflt" ;;
3893 *) dflt="$ccflags";;
3902 Your C compiler may want other flags. For this question you should include
3903 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
3904 but you should NOT include libraries or ld flags like -lwhatever. If you
3905 want $package to honor its debug switch, you should include -DDEBUGGING here.
3906 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
3908 To use no flags, specify the word "none".
3914 rp="Any additional cc flags?"
3921 : the following weeds options from ccflags that are of no interest to cpp
3923 case "$gccversion" in
3924 1*) cppflags="$cppflags -D__GNUC__"
3926 case "$mips_type" in
3928 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
3934 echo "Let me guess what the preprocessor flags are..." >&4
3948 *) ftry="$previous $flag";;
3950 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
3951 >cpp1.out 2>/dev/null && \
3952 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
3953 >cpp2.out 2>/dev/null && \
3954 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
3955 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
3957 cppflags="$cppflags $ftry"
3967 *-*) echo "They appear to be: $cppflags";;
3969 $rm -f cpp.c cpp?.out
3973 : flags used in final linking phase
3975 '') if ./venix; then
3981 *-posix*) dflt="$dflt -posix" ;;
3984 *) dflt="$ldflags";;
3987 : Try to guess additional flags to pick up local libraries.
3988 for thislibdir in $libpth; do
3989 case " $loclibpth " in
3992 *"-L$thislibdir "*) ;;
3993 *) dflt="$dflt -L$thislibdir" ;;
4005 Your C linker may need flags. For this question you should
4006 include -L/whatever and any other flags used by the C linker, but you
4007 should NOT include libraries like -lwhatever.
4009 Make sure you include the appropriate -L/path flags if your C linker
4010 does not normally search all of the directories you specified above,
4013 To use no flags, specify the word "none".
4017 rp="Any additional ld flags (NOT including libraries)?"
4023 rmlist="$rmlist pdp11"
4027 echo "Checking your choice of C compiler and flags for coherency..." >&4
4028 $cat > try.c <<'EOF'
4030 int main() { printf("Ok\n"); exit(0); }
4032 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
4034 $cat >try.msg <<'EOM'
4035 I've tried to compile and run the following simple program:
4038 $cat try.c >> try.msg
4040 $cat >> try.msg <<EOM
4047 and I got the following output:
4051 if sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
4052 if sh -c './try' >>try.msg 2>&1; then
4056 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4059 cat >> try.msg <<'EOQS'
4060 If $libs contains -lsfio, and sfio is mis-configured, then it
4061 sometimes (apparently) runs and exits with a 0 status, but with no
4062 output! It may have to do with sfio's use of _exit vs. exit.
4065 rp="You have a big problem. Shall I abort Configure"
4072 echo "The program compiled OK, but exited with status $?." >>try.msg
4073 rp="You have a problem. Shall I abort Configure"
4077 echo "I can't compile the test program." >>try.msg
4078 rp="You have a BIG problem. Shall I abort Configure"
4084 case "$knowitall" in
4086 echo "(The supplied flags or libraries might be incorrect.)"
4094 *) echo "Ok. Stopping Configure." >&4
4099 n) echo "OK, that should do.";;
4101 $rm -f try try.* core
4103 : define an is-a-typedef? function
4104 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
4106 "") inclist="sys/types.h";;
4108 eval "varval=\$$var";
4112 for inc in $inclist; do
4113 echo "#include <$inc>" >>temp.c;
4115 echo "#ifdef $type" >> temp.c;
4116 echo "printf(\"We have $type\");" >> temp.c;
4117 echo "#endif" >> temp.c;
4118 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
4119 if $contains $type temp.E >/dev/null 2>&1; then
4125 *) eval "$var=\$varval";;
4128 : define an is-a-typedef? function that prompts if the type is not available.
4129 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
4131 "") inclist="sys/types.h";;
4133 eval "varval=\$$var";
4137 for inc in $inclist; do
4138 echo "#include <$inc>" >>temp.c;
4140 echo "#ifdef $type" >> temp.c;
4141 echo "printf(\"We have $type\");" >> temp.c;
4142 echo "#endif" >> temp.c;
4143 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
4145 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
4146 if $contains $type temp.E >/dev/null 2>&1; then
4147 echo "$type found." >&4;
4150 echo "$type NOT found." >&4;
4156 *) eval "$var=\$varval";;
4159 : define a shorthand compile call
4163 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
4164 : define a shorthand compile call for compilations that should be ok.
4168 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
4170 : check for lengths of integral types
4174 echo "Checking to see how big your integers are..." >&4
4175 $cat >intsize.c <<'EOCP'
4179 printf("intsize=%d;\n", (int)sizeof(int));
4180 printf("longsize=%d;\n", (int)sizeof(long));
4181 printf("shortsize=%d;\n", (int)sizeof(short));
4186 if eval $compile_ok && ./intsize > /dev/null; then
4188 echo "Your integers are $intsize bytes long."
4189 echo "Your long integers are $longsize bytes long."
4190 echo "Your short integers are $shortsize bytes long."
4194 Help! I can't compile and run the intsize test program: please enlighten me!
4195 (This is probably a misconfiguration in your system or libraries, and
4196 you really ought to fix it. Still, I'll try anyway.)
4200 rp="What is the size of an integer (in bytes)?"
4204 rp="What is the size of a long integer (in bytes)?"
4208 rp="What is the size of a short integer (in bytes)?"
4214 $rm -f intsize intsize.*
4216 : see what type lseek is declared as in the kernel
4217 rp="What is the type used for lseek's offset on this system?"
4218 set off_t lseektype long stdio.h sys/types.h
4222 echo "Checking to see how big your file offsets are..." >&4
4224 #include <sys/types.h>
4228 printf("%d\n", (int)sizeof($lseektype));
4233 if eval $compile_ok; then
4235 echo "Your file offsets are $lseeksize bytes long."
4239 echo "(I can't seem to compile the test program. Guessing...)"
4240 rp="What is the size of your file offsets (in bytes)?"
4246 : see what type file positions are declared as in the library
4247 rp="What is the type for file position used by fsetpos()?"
4248 set fpos_t fpostype long stdio.h sys/types.h
4253 *_t) zzz="$fpostype" ;;
4256 echo "Checking the size of $zzz..." >&4
4258 #include <sys/types.h>
4261 printf("%d\n", (int)sizeof($fpostype));
4266 if eval $compile_ok; then
4270 echo "(I can't execute the test program--guessing $fpossize.)" >&4
4273 echo "Your $zzz is $fpossize bytes long."
4279 echo "(I can't compile the test program. Guessing...)" >&4
4280 rp="What is the size of your file positions (in bytes)?"
4287 # Backward compatibility (uselfs is deprecated).
4289 "$define"|true|[yY]*)
4292 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
4294 uselargefiles="$define"
4298 case "$lseeksize:$fpossize" in
4301 You can have files larger than 2 gigabytes.
4304 *) case "$uselargefiles" in
4305 "$undef"|false|[nN]*) dflt='n' ;;
4310 Perl can be built to understand large files (files larger than 2 gigabytes)
4311 on some systems. To do so, Configure can be run with -Duselargefiles.
4313 If this doesn't make any sense to you, just accept the default '$dflt'.
4315 rp='Try to understand large files, if available?'
4318 y|Y) val="$define" ;;
4325 case "$uselargefiles" in
4327 : Look for a hint-file generated 'call-back-unit'. If the
4328 : user has specified that a large files perl is to be built,
4329 : we may need to set or change some other defaults.
4330 if $test -f uselargefiles.cbu; then
4331 echo "Your platform has some specific hints for large file builds, using them..."
4332 . ./uselargefiles.cbu
4334 echo "Rechecking to see how big your file offsets are..." >&4
4336 #include <sys/types.h>
4340 printf("%d\n", (int)sizeof($lseektype));
4345 if eval $compile_ok; then
4347 $echo "Your file offsets are now $lseeksize bytes long."
4351 echo "(I can't seem to compile the test program. Guessing...)"
4352 rp="What is the size of your file offsets (in bytes)?"
4357 *_t) zzz="$fpostype" ;;
4360 $echo $n "Rechecking the size of $zzz...$c" >&4
4362 #include <sys/types.h>
4365 printf("%d\n", (int)sizeof($fpostype));
4370 if eval $compile_ok; then
4375 echo "(I can't execute the test program--guessing $fpossize.)" >&4
4378 echo " $fpossize bytes." >&4
4384 echo "(I can't compile the test program. Guessing...)" >&4
4385 rp="What is the size of your file positions (in bytes)?"
4395 case "$usemorebits" in
4396 "$define"|true|[yY]*)
4397 use64bitint="$define"
4398 uselongdouble="$define"
4399 usemorebits="$define"
4401 *) usemorebits="$undef"
4406 case "$uselonglong" in
4407 "$define"|true|[yY]*)
4410 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
4412 use64bitint="$define"
4415 case "$use64bits" in
4416 "$define"|true|[yY]*)
4419 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
4421 use64bitint="$define"
4424 case "$use64bitints" in
4425 "$define"|true|[yY]*)
4428 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
4430 use64bitint="$define"
4433 case "$use64bitsint" in
4434 "$define"|true|[yY]*)
4437 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
4439 use64bitint="$define"
4442 case "$uselonglongs" in
4443 "$define"|true|[yY]*)
4446 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
4448 use64bitint="$define"
4451 case "$use64bitsall" in
4452 "$define"|true|[yY]*)
4455 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
4457 use64bitall="$define"
4462 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
4464 case "$use64bitall" in
4465 "$define"|true|[yY]*) use64bitint="$define" ;;
4471 You have natively 64-bit long integers.
4475 *) case "$use64bitint" in
4476 "$define"|true|[yY]*) dflt='y';;
4481 Perl can be built to take advantage of 64-bit integer types
4482 on some systems. To do so, Configure can be run with -Duse64bitint.
4483 Choosing this option will most probably introduce binary incompatibilities.
4485 If this doesn't make any sense to you, just accept the default '$dflt'.
4487 rp='Try to use 64-bit integers, if available?'
4490 [yY]*) val="$define" ;;
4498 case "$use64bitall" in
4499 "$define"|true|[yY]*) dflt='y' ;;
4500 *) case "$longsize" in
4508 You may also choose to try maximal 64-bitness. It means using as much
4509 64-bitness as possible on the platform. This in turn means even more
4510 binary incompatibilities. On the other hand, your platform may not
4511 have any more 64-bitness available than what you already have chosen.
4513 If this doesn't make any sense to you, just accept the default '$dflt'.
4515 rp='Try to use maximal 64-bit support, if available?'
4518 [yY]*) val="$define" ;;
4523 case "$use64bitall" in
4525 case "$use64bitint" in
4529 Since you have chosen a maximally 64-bit build, I'm also turning on
4530 the use of 64-bit integers.
4532 use64bitint="$define" ;;
4537 case "$use64bitint" in
4538 "$define"|true|[yY]*)
4539 : Look for a hint-file generated 'call-back-unit'. If the
4540 : user has specified that a 64-bit perl is to be built,
4541 : we may need to set or change some other defaults.
4542 if $test -f use64bitint.cbu; then
4543 echo "Your platform has some specific hints for 64-bit integers, using them..."
4547 4) case "$archname64" in
4548 '') archname64=64int ;;
4555 case "$use64bitall" in
4556 "$define"|true|[yY]*)
4557 : Look for a hint-file generated 'call-back-unit'. If the
4558 : user has specified that a maximally 64-bit perl is to be built,
4559 : we may need to set or change some other defaults.
4560 if $test -f use64bitall.cbu; then
4561 echo "Your platform has some specific hints for 64-bit builds, using them..."
4565 4) case "$archname64" in
4566 ''|64int) archname64=64all ;;
4574 echo "Checking for GNU C Library..." >&4
4575 cat >gnulibc.c <<EOM
4587 if eval $compile_ok && ./gnulibc; then
4589 echo "You are using the GNU C Library"
4592 echo "You are not using the GNU C Library"
4598 : see if nm is to be used to determine whether a symbol is defined or not
4602 case "$d_gnulibc" in
4605 echo "nm probably won't work on the GNU C Library." >&4
4611 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
4613 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
4614 echo "'nm' won't be sufficient on this sytem." >&4
4620 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
4621 if $test $dflt -gt 20; then
4631 true|$define) dflt=y;;
4638 I can use $nm to extract the symbols from your C libraries. This
4639 is a time consuming task which may generate huge output on the disk (up
4640 to 3 megabytes) but that should make the symbols extraction faster. The
4641 alternative is to skip the 'nm' extraction part and to compile a small
4642 test program instead to determine whether each symbol is present. If
4643 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
4644 this may be the best solution.
4646 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
4649 rp="Shall I use $nm to extract C symbols from the libraries?"
4652 [Nn]*) usenm=false;;
4661 : nm options which may be necessary
4663 '') if $test -f /mach_boot; then
4665 elif $test -d /usr/ccs/lib; then
4666 nm_opt='-p' # Solaris (and SunOS?)
4667 elif $test -f /dgux; then
4669 elif $test -f /lib64/rld; then
4670 nm_opt='-p' # 64-bit Irix
4676 : nm options which may be necessary for shared libraries but illegal
4677 : for archive libraries. Thank you, Linux.
4678 case "$nm_so_opt" in
4679 '') case "$myuname" in
4681 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
4682 nm_so_opt='--dynamic'
4691 : get list of predefined functions in a handy place
4696 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
4703 *) for thislib in $libs; do
4706 : Handle C library specially below.
4709 thislib=`echo $thislib | $sed -e 's/^-l//'`
4710 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
4712 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
4714 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
4716 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
4718 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
4720 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
4722 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
4727 libnames="$libnames $try"
4729 *) libnames="$libnames $thislib" ;;
4738 for xxx in $libpth; do
4739 $test -r $1 || set $xxx/libc.$so
4740 : The messy sed command sorts on library version numbers.
4742 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
4743 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
4745 s/[0-9][0-9]*/0000&/g
4746 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
4749 $sort | $sed -e 's/^.* //'`
4752 $test -r $1 || set /usr/ccs/lib/libc.$so
4753 $test -r $1 || set /lib/libsys_s$_a
4759 if $test -r "$1"; then
4760 echo "Your (shared) C library seems to be in $1."
4762 elif $test -r /lib/libc && $test -r /lib/clib; then
4763 echo "Your C library seems to be in both /lib/clib and /lib/libc."
4765 libc='/lib/clib /lib/libc'
4766 if $test -r /lib/syslib; then
4767 echo "(Your math library is in /lib/syslib.)"
4768 libc="$libc /lib/syslib"
4770 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
4771 echo "Your C library seems to be in $libc, as you said before."
4772 elif $test -r $incpath/usr/lib/libc$_a; then
4773 libc=$incpath/usr/lib/libc$_a;
4774 echo "Your C library seems to be in $libc. That's fine."
4775 elif $test -r /lib/libc$_a; then
4777 echo "Your C library seems to be in $libc. You're normal."
4779 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
4781 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
4782 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
4783 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
4785 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
4787 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
4790 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
4792 if $test -r "$tans"; then
4793 echo "Your C library seems to be in $tans, of all places."
4799 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
4803 If the guess above is wrong (which it might be if you're using a strange
4804 compiler, or your machine supports multiple models), you can override it here.
4809 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
4811 I can't seem to find your C library. I've looked in the following places:
4814 $sed 's/^/ /' libpath
4817 None of these seems to contain your C library. I need to get its name...
4822 rp='Where is your C library?'
4827 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
4828 set X `cat libnames`
4831 case $# in 1) xxx=file; esac
4832 echo "Extracting names from the following $xxx for later perusal:" >&4
4834 $sed 's/^/ /' libnames >&4
4836 $echo $n "This may take a while...$c" >&4
4840 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
4841 *) $nm $nm_opt $file 2>/dev/null;;
4846 $grep fprintf libc.tmp > libc.ptf
4847 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
4848 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
4850 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
4852 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4854 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
4856 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4858 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
4860 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4862 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
4864 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4866 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
4868 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4870 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
4872 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4874 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
4875 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
4877 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4879 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
4881 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4883 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
4885 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4887 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
4889 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4891 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
4893 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4895 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
4897 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4899 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
4901 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4903 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
4905 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4908 $nm -p $* 2>/dev/null >libc.tmp
4909 $grep fprintf libc.tmp > libc.ptf
4910 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
4911 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
4917 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
4919 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
4920 for thisname in $libnames $libc; do
4921 $ar t $thisname >>libc.tmp
4923 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
4925 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
4926 # Repeat libc to extract forwarders to DLL entries too
4927 for thisname in $libnames $libc; do
4928 $ar tv $thisname >>libc.tmp
4929 # Revision 50 of EMX has bug in $ar.
4930 # it will not extract forwarders to DLL entries
4931 # Use emximp which will extract exactly them.
4932 emximp -o tmp.imp $thisname \
4934 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
4935 < tmp.imp >>libc.tmp
4938 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
4941 echo "$ar didn't seem to work right." >&4
4942 echo "Maybe this is a Cray...trying bld instead..." >&4
4943 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
4945 for thisname in $libnames; do
4947 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
4948 $ar t $thisname >>libc.tmp
4952 echo "That didn't work either. Giving up." >&4
4959 if $test -f /lib/syscalls.exp; then
4961 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
4962 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*$/\1/p' /lib/syscalls.exp >>libc.list
4966 $rm -f libnames libpath
4968 : is a C symbol defined?
4971 -v) tf=libc.tmp; tc=""; tdc="";;
4972 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
4973 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
4976 case "$reuseval-$4" in
4978 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
4984 if $contains $tlook $tf >/dev/null 2>&1;
4989 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
4990 if $cc -o t $optimize $ccflags $ldflags t.c $libs >/dev/null 2>&1;
4998 $define) tval=true;;
5004 : define an is-in-libc? function
5005 inlibc='echo " "; td=$define; tu=$undef;
5006 sym=$1; var=$2; eval "was=\$$2";
5008 case "$reuseval$was" in
5018 echo "$sym() found." >&4;
5019 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
5021 echo "$sym() NOT found." >&4;
5022 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
5026 $define) echo "$sym() found." >&4;;
5027 *) echo "$sym() NOT found." >&4;;
5031 : see if sqrtl exists
5036 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
5039 case "$uselongdouble" in
5040 $define|true|[yY]*) dflt='y';;
5045 Perl can be built to take advantage of long doubles which
5046 (if available) may give more accuracy and range for floating point numbers.
5048 If this doesn't make any sense to you, just accept the default '$dflt'.
5050 rp='Try to use long doubles if available?'
5053 y|Y) val="$define" ;;
5059 case "$uselongdouble" in
5060 true|[yY]*) uselongdouble="$define" ;;
5063 case "$uselongdouble" in
5065 : Look for a hint-file generated 'call-back-unit'. If the
5066 : user has specified that long doubles should be used,
5067 : we may need to set or change some other defaults.
5068 if $test -f uselongdouble.cbu; then
5069 echo "Your platform has some specific hints for long doubles, using them..."
5070 . ./uselongdouble.cbu
5073 (Your platform doesn't have any specific hints for long doubles.)
5079 case "$uselongdouble:$d_sqrtl" in
5083 *** You requested the use of long doubles but you do not seem to have
5084 *** the mathematic functions for long doubles. I'm disabling the use
5085 *** of long doubles.
5088 uselongdouble=$undef
5092 : check for length of double
5094 case "$doublesize" in
5096 echo "Checking to see how big your double precision numbers are..." >&4
5097 $cat >try.c <<'EOCP'
5101 printf("%d\n", (int)sizeof(double));
5106 if eval $compile_ok; then
5108 echo "Your double is $doublesize bytes long."
5111 echo "(I can't seem to compile the test program. Guessing...)"
5112 rp="What is the size of a double precision number (in bytes)?"
5120 : check for long doubles
5122 echo "Checking to see if you have long double..." >&4
5123 echo 'int main() { long double x = 7.0; }' > try.c
5125 if eval $compile; then
5127 echo "You have long double."
5130 echo "You do not have long double."
5136 : check for length of long double
5137 case "${d_longdbl}${longdblsize}" in
5140 echo "Checking to see how big your long doubles are..." >&4
5141 $cat >try.c <<'EOCP'
5145 printf("%d\n", sizeof(long double));
5150 if eval $compile; then
5151 longdblsize=`./try$exe_ext`
5152 echo "Your long doubles are $longdblsize bytes long."
5156 echo "(I can't seem to compile the test program. Guessing...)" >&4
5157 rp="What is the size of a long double (in bytes)?"
5161 if $test "X$doublesize" = "X$longdblsize"; then
5162 echo "(That isn't any different from an ordinary double.)"
5168 : determine the architecture name
5170 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5171 tarch=`arch`"-$osname"
5172 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5173 if uname -m > tmparch 2>&1 ; then
5174 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5175 -e 's/$/'"-$osname/" tmparch`
5183 case "$myarchname" in
5186 echo "(Your architecture name used to be $myarchname.)"
5193 *) dflt="$archname";;
5195 rp='What is your architecture name'
5198 case "$usethreads" in
5200 echo "Threads selected." >&4
5202 *-thread*) echo "...and architecture name already has -thread." >&4
5204 *) archname="$archname-thread"
5205 echo "...setting architecture name to $archname." >&4
5210 case "$usemultiplicity" in
5212 echo "Multiplicity selected." >&4
5214 *-multi*) echo "...and architecture name already has -multi." >&4
5216 *) archname="$archname-multi"
5217 echo "...setting architecture name to $archname." >&4
5222 case "$use64bitint$use64bitall" in
5224 case "$archname64" in
5226 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
5229 case "$use64bitint" in
5230 "$define") echo "64 bit integers selected." >&4 ;;
5232 case "$use64bitall" in
5233 "$define") echo "Maximal 64 bitness selected." >&4 ;;
5236 *-$archname64*) echo "...and architecture name already has $archname64." >&4
5238 *) archname="$archname-$archname64"
5239 echo "...setting architecture name to $archname." >&4
5245 case "$uselongdouble" in
5247 echo "Long doubles selected." >&4
5248 case "$longdblsize" in
5250 "...but long doubles are equal to doubles, not changing architecture name." >&4
5254 *-ld*) echo "...and architecture name already has -ld." >&4
5256 *) archname="$archname-ld"
5257 echo "...setting architecture name to $archname." >&4
5265 : determine root of directory hierarchy where package will be installed.
5268 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
5276 By default, $package will be installed in $dflt/bin, manual pages
5277 under $dflt/man, etc..., i.e. with $dflt as prefix for all
5278 installation directories. Typically this is something like /usr/local.
5279 If you wish to have binaries under /usr/bin but other parts of the
5280 installation under /usr/local, that's ok: you will be prompted
5281 separately for each of the installation directories, the prefix being
5282 only used to set the defaults.
5286 rp='Installation prefix to use?'
5294 *) oldprefix="$prefix";;
5304 $define|true) afs=true ;;
5305 $undef|false) afs=false ;;
5306 *) if test -d /afs; then
5314 echo "AFS may be running... I'll be extra cautious then..." >&4
5316 echo "AFS does not seem to be running..." >&4
5319 : determine installation prefix for where package is to be installed.
5323 Since you are running AFS, I need to distinguish the directory in which
5324 files will reside from the directory in which they are installed (and from
5325 which they are presumably copied to the former directory by occult means).
5328 case "$installprefix" in
5329 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
5330 *) dflt="$installprefix";;
5335 In some special cases, particularly when building $package for distribution,
5336 it is convenient to distinguish between the directory in which files should
5337 be installed from the directory ($prefix) in which they
5338 will eventually reside. For most users, these two directories are the same.
5341 case "$installprefix" in
5343 *) dflt=$installprefix;;
5347 rp='What installation prefix should I use for installing files?'
5349 installprefix="$ans"
5350 installprefixexp="$ansexp"
5352 : set the prefixit variable, to compute a suitable default value
5353 prefixit='case "$3" in
5355 case "$oldprefix" in
5356 "") eval "$1=\"\$$2\"";;
5363 ""|" ") eval "$1=\"\$$2\"";;
5369 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
5371 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
5372 /*-$oldprefix/*|\~*-$oldprefix/*)
5373 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
5374 *) eval "$1=\"\$$2\"";;
5379 : get the patchlevel
5381 echo "Getting the current patchlevel..." >&4
5382 if $test -r $rsrc/patchlevel.h;then
5383 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
5384 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
5385 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5386 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
5387 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
5388 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5397 $echo "(You have $package version $patchlevel subversion $subversion.)"
5400 : XXX Should be a Configure test for double-dots in filenames.
5401 version=`echo $revision $patchlevel $subversion | \
5402 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
5403 api_versionstring=`echo $api_revision $api_version $api_subversion | \
5404 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
5407 version=`echo $revision $patchlevel $subversion | \
5408 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
5409 api_versionstring=`echo $api_revision $api_version $api_subversion | \
5410 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
5413 : Special case the 5.005_xx maintenance series, which used 5.005
5414 : without any subversion label as a subdirectory in $sitelib
5415 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
5416 api_versionstring='5.005'
5419 : determine installation style
5420 : For now, try to deduce it from prefix unless it is already set.
5421 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
5422 case "$installstyle" in
5423 '') case "$prefix" in
5424 *perl*) dflt='lib';;
5425 *) dflt='lib/perl5' ;;
5428 *) dflt="$installstyle" ;;
5430 : Probably not worth prompting for this since we prompt for all
5431 : the directories individually, and the prompt would be too long and
5435 : determine where private library files go
5436 : Usual default is /usr/local/lib/perl5/$version.
5437 : Also allow things like /opt/perl/lib/$version, since
5438 : /opt/perl/lib/perl5... would be redundant.
5439 : The default "style" setting is made in installstyle.U
5440 case "$installstyle" in
5441 *lib/perl5*) set dflt privlib lib/$package/$version ;;
5442 *) set dflt privlib lib/$version ;;
5447 There are some auxiliary files for $package that need to be put into a
5448 private library directory that is accessible by everyone.
5452 rp='Pathname where the private library files will reside?'
5455 privlibexp="$ansexp"
5456 : Change installation prefix, if necessary.
5457 if $test X"$prefix" != X"$installprefix"; then
5458 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
5460 installprivlib="$privlibexp"
5463 : set the prefixup variable, to restore leading tilda escape
5464 prefixup='case "$prefixexp" in
5466 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
5469 : determine where public architecture dependent libraries go
5472 : privlib default is /usr/local/lib/$package/$version
5473 : archlib default is /usr/local/lib/$package/$version/$archname
5474 : privlib may have an optional trailing /share.
5475 tdflt=`echo $privlib | $sed 's,/share$,,'`
5476 tdflt=$tdflt/$archname
5485 $spackage contains architecture-dependent library files. If you are
5486 sharing libraries in a heterogeneous environment, you might store
5487 these files in a separate location. Otherwise, you can just include
5488 them with the rest of the public library files.
5492 rp='Where do you want to put the public architecture-dependent libraries?'
5495 archlibexp="$ansexp"
5496 if $test X"$archlib" = X"$privlib"; then
5501 : Change installation prefix, if necessary.
5502 if $test X"$prefix" != X"$installprefix"; then
5503 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
5505 installarchlib="$archlibexp"
5509 : Binary compatibility with 5.005 is not possible for builds
5510 : with advanced features
5511 case "$usethreads$usemultiplicity" in
5513 bincompat5005="$undef"
5514 d_bincompat5005="$undef"
5518 This version of Perl can be compiled for binary compatibility with 5.005.
5519 If you decide to do so, you will be able to continue using most of the
5520 extensions that were compiled for Perl 5.005.
5523 case "$bincompat5005$d_bincompat5005" in
5524 *"$undef"*) dflt=n ;;
5527 rp='Binary compatibility with Perl 5.005?'
5530 y*) val="$define" ;;
5535 case "$d_bincompat5005" in
5537 bincompat5005="$define"
5539 *) bincompat5005="$undef"
5540 d_bincompat5005="$undef"
5547 : see if setuid scripts can be secure
5550 Some kernels have a bug that prevents setuid #! scripts from being
5551 secure. Some sites have disabled setuid #! scripts because of this.
5553 First let's decide if your kernel supports secure setuid #! scripts.
5554 (If setuid #! scripts would be secure but have been disabled anyway,
5555 don't say that they are secure if asked.)
5560 if $test -d /dev/fd; then
5561 echo "#!$ls" >reflect
5562 chmod +x,u+s reflect
5563 ./reflect >flect 2>&1
5564 if $contains "/dev/fd" flect >/dev/null; then
5565 echo "Congratulations, your kernel has secure setuid scripts!" >&4
5569 If you are not sure if they are secure, I can check but I'll need a
5570 username and password different from the one you are using right now.
5571 If you don't have such a username or don't want me to test, simply
5575 rp='Other username to test security of setuid scripts with?'
5580 case "$d_suidsafe" in
5581 '') echo "I'll assume setuid scripts are *not* secure." >&4
5584 echo "Well, the $hint value is *not* secure." >&4
5586 *) echo "Well, the $hint value *is* secure." >&4
5591 $rm -f reflect flect
5592 echo "#!$ls" >reflect
5593 chmod +x,u+s reflect
5596 echo '"su" will (probably) prompt you for '"$ans's password."
5597 su $ans -c './reflect >flect'
5598 if $contains "/dev/fd" flect >/dev/null; then
5599 echo "Okay, it looks like setuid scripts are secure." >&4
5602 echo "I don't think setuid scripts are secure." >&4
5607 rp='Does your kernel have *secure* setuid scripts?'
5610 [yY]*) val="$define";;
5615 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
5616 echo "(That's for file descriptors, not floppy disks.)"
5622 $rm -f reflect flect
5624 : now see if they want to do setuid emulation
5627 case "$d_suidsafe" in
5630 echo "No need to emulate SUID scripts since they are secure here." >& 4
5634 Some systems have disabled setuid scripts, especially systems where
5635 setuid scripts cannot be secure. On systems where setuid scripts have
5636 been disabled, the setuid/setgid bits on scripts are currently
5637 useless. It is possible for $package to detect those bits and emulate
5638 setuid/setgid in a secure fashion. This emulation will only work if
5639 setuid scripts have been disabled in your kernel.
5643 "$define") dflt=y ;;
5646 rp="Do you want to do setuid/setgid emulation?"
5649 [yY]*) val="$define";;
5657 : determine filename position in cpp output
5659 echo "Computing filename position in cpp output for #include directives..." >&4
5660 echo '#include <stdio.h>' > foo.c
5663 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5664 $grep '^[ ]*#.*stdio\.h' | \
5665 while read cline; do
5668 while $test \$# -gt 0; do
5669 if $test -r \`echo \$1 | $tr -d '"'\`; then
5674 pos=\`expr \$pos + 1\`
5686 *) pos="${fieldn}th";;
5688 echo "Your cpp writes the filename in the $pos field of the line."
5690 : locate header file
5695 for usrincdir in $usrinc
5697 if test -f \$usrincdir/\$wanted; then
5698 echo "\$usrincdir/\$wanted"
5702 awkprg='{ print \$$fieldn }'
5703 echo "#include <\$wanted>" > foo\$\$.c
5704 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5705 $grep "^[ ]*#.*\$wanted" | \
5706 while read cline; do
5707 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5709 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5710 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5715 # status = 0: grep returned 0 lines, case statement not executed
5716 # status = 1: headerfile found
5717 # status = 2: while loop executed, no headerfile found
5721 if test \$status -eq 1; then
5728 : define an alternate in-header-list? function
5729 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5730 cont=true; xxf="echo \"<\$1> found.\" >&4";
5731 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5732 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5734 case $# in 4) instead=instead;; *) instead="at last";; esac;
5735 while $test "$cont"; do
5737 var=$2; eval "was=\$$2";
5738 if $test "$xxx" && $test -r "$xxx";
5740 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5743 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5744 set $yyy; shift; shift; yyy=$@;
5745 case $# in 0) cont="";;
5746 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5747 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5748 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5749 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5753 do set $yyy; var=$2; eval "was=\$$2";
5754 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5755 set $yyy; shift; shift; yyy=$@;
5758 : see if this is a malloc.h system
5759 set malloc.h i_malloc
5762 : see if stdlib is available
5763 set stdlib.h i_stdlib
5766 : determine which malloc to compile in
5768 case "$usemymalloc" in
5769 ''|[yY]*|true|$define) dflt='y' ;;
5772 rp="Do you wish to attempt to use the malloc that comes with $package?"
5778 mallocsrc='malloc.c'
5779 mallocobj="malloc$_o"
5780 d_mymalloc="$define"
5783 : Remove malloc from list of libraries to use
5784 echo "Removing unneeded -lmalloc from library list" >&4
5785 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
5788 echo "libs = $libs" >&4
5800 : compute the return types of malloc and free
5802 $cat >malloc.c <<END
5806 #include <sys/types.h>
5820 case "$malloctype" in
5822 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
5829 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
5833 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
5840 echo "Your system uses $freetype free(), it would seem." >&4
5844 After $package is installed, you may wish to install various
5845 add-on modules and utilities. Typically, these add-ons will
5846 be installed under $prefix with the rest
5847 of this package. However, you may wish to install such add-ons
5848 elsewhere under a different prefix.
5850 If you do not wish to put everything under a single prefix, that's
5851 ok. You will be prompted for the individual locations; this siteprefix
5852 is only used to suggest the defaults.
5854 The default should be fine for most people.
5858 rp='Installation prefix to use for add-on modules and utilities?'
5859 : XXX Here might be another good place for an installstyle setting.
5860 case "$siteprefix" in
5862 *) dflt=$siteprefix ;;
5865 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
5867 case "$siteprefix" in
5871 *) oldsiteprefix="$prefix";;
5876 siteprefixexp="$ansexp"
5878 : determine where site specific libraries go.
5879 : Usual default is /usr/local/lib/perl5/site_perl/$version
5880 : The default "style" setting is made in installstyle.U
5881 : XXX No longer works with Prefixit stuff.
5882 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5884 '') case "$installstyle" in
5885 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
5886 *) dflt=$siteprefix/lib/site_$prog/$version ;;
5894 The installation process will create a directory for
5895 site-specific extensions and modules. Most users find it convenient
5896 to place all site-specific files in this directory rather than in the
5897 main distribution directory.
5901 rp='Pathname for the site-specific library files?'
5904 sitelibexp="$ansexp"
5905 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
5906 : Change installation prefix, if necessary.
5907 if $test X"$prefix" != X"$installprefix"; then
5908 installsitelib=`echo $sitelibexp | $sed "s#^$prefix#$installprefix#"`
5910 installsitelib="$sitelibexp"
5913 : determine where site specific architecture-dependent libraries go.
5914 : sitelib default is /usr/local/lib/perl5/site_perl/$version
5915 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
5916 : sitelib may have an optional trailing /share.
5918 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
5919 dflt="$dflt/$archname"
5924 set sitearch sitearch none
5928 The installation process will also create a directory for
5929 architecture-dependent site-specific extensions and modules.
5933 rp='Pathname for the site-specific architecture-dependent library files?'
5936 sitearchexp="$ansexp"
5937 : Change installation prefix, if necessary.
5938 if $test X"$prefix" != X"$installprefix"; then
5939 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
5941 installsitearch="$sitearchexp"
5946 The installation process will also create a directory for
5947 vendor-supplied add-ons. Vendors who supply perl with their system
5948 may find it convenient to place all vendor-supplied files in this
5949 directory rather than in the main distribution directory. This will
5950 ease upgrades between binary-compatible maintenance versions of perl.
5952 Of course you may also use these directories in whatever way you see
5953 fit. For example, you might use them to access modules shared over a
5954 company-wide network.
5956 The default answer should be fine for most people.
5957 This causes further questions about vendor add-ons to be skipped
5958 and no vendor-specific directories will be configured for perl.
5961 rp='Do you want to configure vendor-specific add-on directories?'
5962 case "$usevendorprefix" in
5963 define|true|[yY]*) dflt=y ;;
5964 *) : User may have set vendorprefix directly on Configure command line.
5965 case "$vendorprefix" in
5974 rp='Installation prefix to use for vendor-supplied add-ons?'
5975 case "$vendorprefix" in
5977 *) dflt=$vendorprefix ;;
5980 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
5982 case "$vendorprefix" in
5986 *) oldvendorprefix="$prefix";;
5990 usevendorprefix="$define"
5992 vendorprefixexp="$ansexp"
5994 *) usevendorprefix="$undef"
6000 case "$vendorprefix" in
6001 '') d_vendorlib="$undef"
6005 *) d_vendorlib="$define"
6006 : determine where vendor-supplied modules go.
6007 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6008 case "$vendorlib" in
6010 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6011 case "$installstyle" in
6012 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6013 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6016 *) dflt="$vendorlib"
6020 rp='Pathname for the vendor-supplied library files?'
6023 vendorlibexp="$ansexp"
6026 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6027 : Change installation prefix, if necessary.
6028 if $test X"$prefix" != X"$installprefix"; then
6029 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
6031 installvendorlib="$vendorlibexp"
6034 case "$vendorprefix" in
6035 '') d_vendorarch="$undef"
6039 *) d_vendorarch="$define"
6040 : determine where vendor-supplied architecture-dependent libraries go.
6041 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6042 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6043 : vendorlib may have an optional trailing /share.
6044 case "$vendorarch" in
6045 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6046 dflt="$dflt/$archname"
6048 *) dflt="$vendorarch" ;;
6051 rp='Pathname for vendor-supplied architecture-dependent files?'
6054 vendorarchexp="$ansexp"
6057 : Change installation prefix, if necessary.
6058 if $test X"$prefix" != X"$installprefix"; then
6059 installvendorarch=`echo $vendorarchexp | sed "s#^$prefix#$installprefix#"`
6061 installvendorarch="$vendorarchexp"
6064 : Final catch-all directories to search
6067 Lastly, you can have perl look in other directories for extensions and
6068 modules in addition to those already specified.
6069 These directories will be searched after
6073 test X"$vendorlib" != "X" && echo ' ' $vendorlib
6074 test X"$vendorarch" != "X" && echo ' ' $vendorarch
6076 case "$otherlibdirs" in
6077 ''|' ') dflt='none' ;;
6078 *) dflt="$otherlibdirs" ;;
6081 Enter a colon-separated set of extra paths to include in perl's @INC
6082 search path, or enter 'none' for no extra paths.
6086 rp='Colon-separated list of additional directories for perl to search?'
6089 ' '|''|none) otherlibdirs=' ' ;;
6090 *) otherlibdirs="$ans" ;;
6092 case "$otherlibdirs" in
6096 set d_perl_otherlibdirs
6099 : Cruising for prototypes
6101 echo "Checking out function prototypes..." >&4
6102 $cat >prototype.c <<'EOCP'
6103 int main(int argc, char *argv[]) {
6106 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
6107 echo "Your C compiler appears to support function prototypes."
6110 echo "Your C compiler doesn't seem to understand function prototypes."
6117 case "$prototype" in
6119 *) ansi2knr='ansi2knr'
6124 This version of $package can only be compiled by a compiler that
6125 understands function prototypes. Unfortunately, your C compiler
6127 doesn't seem to understand them. Sorry about that.
6129 If GNU cc is available for your system, perhaps you could try that instead.
6131 Eventually, we hope to support building Perl with pre-ANSI compilers.
6132 If you would like to help in that effort, please contact <perlbug@perl.org>.
6134 Aborting Configure now.
6140 : determine where public executables go
6145 rp='Pathname where the public executables will reside?'
6147 if $test "X$ansexp" != "X$binexp"; then
6152 : Change installation prefix, if necessary.
6153 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6154 if $test X"$prefix" != X"$installprefix"; then
6155 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
6157 installbin="$binexp"
6160 : Find perl5.005 or later.
6161 echo "Looking for a previously installed perl5.005 or later... "
6163 '') for tdir in `echo "$binexp:$PATH" | $sed "s/$path_sep/ /g"`; do
6164 : Check if this perl is recent and can load a simple module
6165 if $test -x $tdir/perl && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6168 elif $test -x $tdir/perl5 && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6178 '') echo "None found. That's ok.";;
6179 *) echo "Using $perl5." ;;
6182 : Determine list of previous versions to include in @INC
6183 $cat > getverlist <<EOPL
6186 \$api_versionstring = "$api_versionstring";
6187 \$version = "$version";
6188 \$stem = "$sitelib_stem";
6189 \$archname = "$archname";
6191 $cat >> getverlist <<'EOPL'
6192 # Can't have leading @ because metaconfig interprets it as a command!
6193 ;@inc_version_list=();
6194 # XXX Redo to do opendir/readdir?
6197 ;@candidates = glob("5.*");
6203 # XXX ToDo: These comparisons must be reworked when two-digit
6204 # subversions come along, so that 5.7.10 compares as greater than
6205 # 5.7.3! By that time, hope that 5.6.x is sufficiently
6206 # widespread that we can use the built-in version vectors rather
6207 # than reinventing them here. For 5.6.0, however, we must
6208 # assume this script will likely be run by 5.005_0x. --AD 1/2000.
6209 foreach $d (@candidates) {
6210 if ($d lt $version) {
6211 if ($d ge $api_versionstring) {
6212 unshift(@inc_version_list, grep { -d } "$d/$archname", $d);
6214 elsif ($d ge "5.005") {
6215 unshift(@inc_version_list, grep { -d } $d);
6219 # Skip newer version. I.e. don't look in
6220 # 5.7.0 if we're installing 5.6.1.
6224 if (@inc_version_list) {
6225 print join(' ', @inc_version_list);
6228 # Blank space to preserve value for next Configure run.
6233 case "$inc_version_list" in
6234 '') if test -x "$perl5"; then
6235 dflt=`$perl5 getverlist`
6240 $undef) dflt='none' ;;
6241 *) dflt="$inc_version_list" ;;
6244 ''|' ') dflt=none ;;
6247 5.005) case "$bincompat5005" in
6248 $define|true|[yY]*) ;;
6255 In order to ease the process of upgrading, this version of perl
6256 can be configured to use modules built and installed with earlier
6257 versions of perl that were installed under $prefix. Specify here
6258 the list of earlier versions that this version of perl should check.
6259 If Configure detected no earlier versions of perl installed under
6260 $prefix, then the list will be empty. Answer 'none' to tell perl
6261 to not search earlier versions.
6263 The default should almost always be sensible, so if you're not sure,
6264 just accept the default.
6267 rp='List of earlier versions to include in @INC?'
6270 [Nn]one|''|' ') inc_version_list=' ' ;;
6271 *) inc_version_list="$ans" ;;
6273 case "$inc_version_list" in
6275 inc_version_list_init='0';;
6276 *) inc_version_list_init=`echo $inc_version_list |
6277 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6282 : determine whether to install perl also as /usr/bin/perl
6285 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
6287 Many scripts expect perl to be installed as /usr/bin/perl.
6288 I can install the perl you are about to compile also as /usr/bin/perl
6289 (in addition to $installbin/perl).
6291 case "$installusrbinperl" in
6292 "$undef"|[nN]*) dflt='n';;
6295 rp="Do you want to install perl as /usr/bin/perl?"
6298 [yY]*) val="$define";;
6304 set installusrbinperl
6307 : see if dld is available
6311 : see if dlopen exists
6318 : determine which dynamic loading, if any, to compile in
6320 dldir="ext/DynaLoader"
6333 $define) dflt='y' ;;
6336 $define) dflt='y' ;;
6338 : Does a dl_xxx.xs file exist for this operating system
6339 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
6342 rp="Do you wish to use dynamic loading?"
6349 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
6350 dflt="$dldir/dl_${osname}.xs"
6351 elif $test "$d_dlopen" = "$define" ; then
6352 dflt="$dldir/dl_dlopen.xs"
6353 elif $test "$i_dld" = "$define" ; then
6354 dflt="$dldir/dl_dld.xs"
6359 *) dflt="$dldir/$dlsrc"
6362 echo "The following dynamic loading files are available:"
6363 : Can not go over to $dldir because getfile has path hard-coded in.
6364 tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir
6365 rp="Source file to use for dynamic loading"
6371 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
6375 Some systems may require passing special flags to $cc -c to
6376 compile modules that will be used to create a shared library.
6377 To use no flags, say "none".
6380 case "$cccdlflags" in
6381 '') case "$gccversion" in
6382 '') case "$osname" in
6384 next) dflt='none' ;;
6385 irix*) dflt='-KPIC' ;;
6386 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
6387 sunos) dflt='-pic' ;;
6391 *) case "$osname" in
6392 svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
6397 *) dflt="$cccdlflags" ;;
6399 rp="Any special flags to pass to $cc -c to compile shared library modules?"
6402 none) cccdlflags=' ' ;;
6403 *) cccdlflags="$ans" ;;
6408 Some systems use ld to create libraries that can be dynamically loaded,
6409 while other systems (such as those using ELF) use $cc.
6413 '') $cat >try.c <<'EOM'
6414 /* Test for whether ELF binaries are produced */
6419 int i = open("a.out",O_RDONLY);
6422 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
6423 exit(0); /* succeed (yes, it's ELF) */
6428 if $cc $ccflags try.c >/dev/null 2>&1 && ./a.out; then
6430 You appear to have ELF support. I'll use $cc to build dynamic libraries.
6434 echo "I'll use ld to build dynamic libraries."
6443 rp="What command should be used to create dynamic libraries?"
6449 Some systems may require passing special flags to $ld to create a
6450 library that can be dynamically loaded. If your ld flags include
6451 -L/other/path options to locate libraries outside your loader's normal
6452 search path, you may need to specify those -L options here as well. To
6453 use no flags, say "none".
6456 case "$lddlflags" in
6457 '') case "$osname" in
6458 beos) dflt='-nostart' ;;
6460 case "$gccversion" in
6461 '') dflt="$dflt +vnocompatwarnings" ;;
6464 linux|irix*) dflt='-shared' ;;
6465 next) dflt='none' ;;
6466 solaris) dflt='-G' ;;
6467 sunos) dflt='-assert nodefinitions' ;;
6468 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
6472 *) dflt="$lddlflags" ;;
6475 : Try to guess additional flags to pick up local libraries.
6476 : Be careful not to append to a plain 'none'
6480 for thisflag in $ldflags; do
6485 *) dflt="$dflt $thisflag" ;;
6492 ''|' ') dflt='none' ;;
6495 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
6498 none) lddlflags=' ' ;;
6499 *) lddlflags="$ans" ;;
6504 Some systems may require passing special flags to $cc to indicate that
6505 the resulting executable will use dynamic linking. To use no flags,
6509 case "$ccdlflags" in
6510 '') case "$osname" in
6511 hpux) dflt='-Wl,-E' ;;
6512 linux) dflt='-rdynamic' ;;
6513 next) dflt='none' ;;
6514 sunos) dflt='none' ;;
6518 *) dflt="$ccdlflags" ;;
6520 rp="Any special flags to pass to $cc to use dynamic linking?"
6523 none) ccdlflags=' ' ;;
6524 *) ccdlflags="$ans" ;;
6538 # No dynamic loading being used, so don't bother even to prompt.
6541 *) case "$useshrplib" in
6542 '') case "$osname" in
6543 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
6545 also='Building a shared libperl is required for dynamic loading to work on your system.'
6550 also='Building a shared libperl is needed for MAB support.'
6568 The perl executable is normally obtained by linking perlmain.c with
6569 libperl${_a}, any static extensions (usually just DynaLoader), and
6570 any other libraries needed on this system (such as -lm, etc.). Since
6571 your system supports dynamic loading, it is probably possible to build
6572 a shared libperl.$so. If you will have more than one executable linked
6573 to libperl.$so, this will significantly reduce the size of each
6574 executable, but it may have a noticeable affect on performance. The
6575 default is probably sensible for your system.
6579 rp="Build a shared libperl.$so (y/n)"
6583 useshrplib='true' ;;
6584 *) useshrplib='false' ;;
6589 case "$useshrplib" in
6593 # Figure out a good name for libperl.so. Since it gets stored in
6594 # a version-specific architecture-dependent library, the version
6595 # number isn't really that important, except for making cc/ld happy.
6597 # A name such as libperl.so.3.1
6598 majmin="libperl.$so.$patchlevel.$subversion"
6599 # A name such as libperl.so.301
6600 majonly=`echo $patchlevel $subversion |
6601 $awk '{printf "%d%02d", $1, $2}'`
6602 majonly=libperl.$so.$majonly
6603 # I'd prefer to keep the os-specific stuff here to a minimum, and
6604 # rely on figuring it out from the naming of libc.
6605 case "${osname}${osvers}" in
6608 # XXX How handle the --version stuff for MAB?
6610 linux*) # ld won't link with a bare -lperl otherwise.
6613 cygwin*) # include version
6614 dflt=`echo libperl$version | sed -e 's/\./_/g'`$lib_ext
6616 *) # Try to guess based on whether libc has major.minor.
6618 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
6619 *libc.$so.[0-9]*) dflt=$majonly ;;
6620 *) dflt=libperl.$so ;;
6630 I need to select a good name for the shared libperl. If your system uses
6631 library names with major and minor numbers, then you might want something
6632 like $majmin. Alternatively, if your system uses a single version
6633 number for shared libraries, then you might want to use $majonly.
6634 Or, your system might be quite happy with a simple libperl.$so.
6636 Since the shared libperl will get installed into a version-specific
6637 architecture-dependent directory, the version number of the shared perl
6638 library probably isn't important, so the default should be o.k.
6641 rp='What name do you want to give to the shared libperl?'
6644 echo "Ok, I'll use $libperl"
6647 libperl="libperl${_a}"
6651 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
6655 WARNING: Use of the shrpdir variable for the installation location of
6656 the shared $libperl is not supported. It was never documented and
6657 will not work in this version. Let me (perlbug@perl.org)
6658 know of any problems this may cause.
6664 But your current setting of $shrpdir is
6665 the default anyway, so it's harmless.
6670 Further, your current attempted setting of $shrpdir
6671 conflicts with the value of $archlibexp/CORE
6672 that installperl will use.
6679 # How will the perl executable find the installed shared $libperl?
6680 # Add $xxx to ccdlflags.
6681 # If we can't figure out a command-line option, use $shrpenv to
6682 # set env LD_RUN_PATH. The main perl makefile uses this.
6683 shrpdir=$archlibexp/CORE
6686 if "$useshrplib"; then
6689 # We'll set it in Makefile.SH...
6695 xxx="-Wl,-R$shrpdir"
6697 linux|irix*|dec_osf)
6698 xxx="-Wl,-rpath,$shrpdir"
6701 # next doesn't like the default...
6704 # beos doesn't like the default, either.
6707 # hpux doesn't like the default, either.
6708 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
6711 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
6717 # Only add $xxx if it isn't already in ccdlflags.
6718 case " $ccdlflags " in
6720 *) ccdlflags="$ccdlflags $xxx"
6723 Adding $xxx to the flags
6724 passed to $ld so that the perl executable will find the
6725 installed shared $libperl.
6733 # Fix ccdlflags in AIX for building external extensions.
6734 # (For building Perl itself bare -bE:perl.exp is needed,
6735 # Makefile.SH takes care of this.)
6737 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
6739 # Respect a hint or command-line value.
6741 '') shrpenv="$tmp_shrpenv" ;;
6743 case "$ldlibpthname" in
6744 '') ldlibpthname=LD_LIBRARY_PATH ;;
6745 none) ldlibpthname='' ;;
6748 : determine where manual pages are on this system
6752 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
6753 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
6754 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
6755 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
6756 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
6757 sysman=`./loc . /usr/man/man1 $syspath`
6760 if $test -d "$sysman"; then
6761 echo "System manual is in $sysman." >&4
6763 echo "Could not find manual pages in source form." >&4
6766 : determine where manual pages go
6767 set man1dir man1dir none
6771 $spackage has manual pages available in source form.
6775 echo "However, you don't have nroff, so they're probably useless to you."
6777 '') man1dir="none";;
6780 echo "If you don't want the manual sources installed, answer 'none'."
6785 lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
6786 lookpath="$lookpath $prefixexp/man/p_man/man1"
6787 lookpath="$lookpath $prefixexp/man/u_man/man1"
6788 lookpath="$lookpath $prefixexp/man/man.1"
6790 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
6791 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
6801 rp="Where do the main $spackage manual pages (source) go?"
6803 if $test "X$man1direxp" != "X$ansexp"; then
6807 man1direxp="$ansexp"
6813 : Change installation prefix, if necessary.
6814 if $test X"$prefix" != X"$installprefix"; then
6815 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
6817 installman1dir="$man1direxp"
6820 : What suffix to use on installed man pages
6827 rp="What suffix should be used for the main $spackage man pages?"
6829 '') case "$man1dir" in
6843 *) dflt="$man1ext";;
6850 : see if we can have long filenames
6852 first=123456789abcdef
6854 if (echo hi >$first) 2>/dev/null; then
6855 if $test -f 123456789abcde; then
6856 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
6859 echo 'You can have filenames longer than 14 characters.'>&4
6864 You can't have filenames longer than 14 chars.
6865 You can't even think about them!
6871 $rm -rf 123456789abcde*
6873 : determine where library module manual pages go
6874 set man3dir man3dir none
6878 $spackage has manual pages for many of the library modules.
6884 However, you don't have nroff, so they're probably useless to you.
6887 '') man3dir="none";;
6891 case "$d_flexfnam" in
6894 However, your system can't handle the long file names like File::Basename.3.
6897 '') man3dir="none";;
6901 echo "If you don't want the manual sources installed, answer 'none'."
6902 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6904 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
6905 if $test -d "$privlib/man/man3"; then
6908 WARNING: Previous versions of perl installed man3 pages into
6909 $privlib/man/man3. This version will suggest a
6910 new default of $dflt.
6914 rp='Do you wish to preserve the old behavior?(y/n)'
6917 y*) dflt="$privlib/man/man3" ;;
6922 *) dflt="$man3dir" ;;
6929 rp="Where do the $package library man pages (source) go?"
6932 man3direxp="$ansexp"
6938 : Change installation prefix, if necessary.
6939 if $test X"$prefix" != X"$installprefix"; then
6940 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
6942 installman3dir="$man3direxp"
6945 : What suffix to use on installed man pages
6951 rp="What suffix should be used for the $package library man pages?"
6953 '') case "$man3dir" in
6967 *) dflt="$man3ext";;
6974 : see if we have to deal with yellow pages, now NIS.
6975 if $test -d /usr/etc/yp || $test -d /etc/yp; then
6976 if $test -f /usr/etc/nibindd; then
6978 echo "I'm fairly confident you're on a NeXT."
6980 rp='Do you get the hosts file via NetInfo?'
6989 y*) hostcat='nidump hosts .';;
6990 *) case "$hostcat" in
6991 nidump*) hostcat='';;
7001 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
7009 rp='Are you getting the hosts file via yellow pages?'
7012 y*) hostcat='ypcat hosts';;
7013 *) hostcat='cat /etc/hosts';;
7019 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
7022 '') test -f /etc/group && groupcat='cat /etc/group';;
7025 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
7028 : now get the host name
7030 echo "Figuring out host name..." >&4
7031 case "$myhostname" in
7033 echo 'Maybe "hostname" will work...'
7034 if tans=`sh -c hostname 2>&1` ; then
7042 if $test "$cont"; then
7044 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
7045 if tans=`cat /etc/systemid 2>&1` ; then
7047 phostname='cat /etc/systemid'
7048 echo "Whadyaknow. Xenix always was a bit strange..."
7051 elif $test -r /etc/systemid; then
7052 echo "(What is a non-Xenix system doing with /etc/systemid?)"
7055 if $test "$cont"; then
7056 echo 'No, maybe "uuname -l" will work...'
7057 if tans=`sh -c 'uuname -l' 2>&1` ; then
7059 phostname='uuname -l'
7061 echo 'Strange. Maybe "uname -n" will work...'
7062 if tans=`sh -c 'uname -n' 2>&1` ; then
7064 phostname='uname -n'
7066 echo 'Oh well, maybe I can mine it out of whoami.h...'
7067 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
7068 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
7069 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
7071 case "$myhostname" in
7072 '') echo "Does this machine have an identity crisis or something?"
7075 echo "Well, you said $myhostname before..."
7076 phostname='echo $myhostname';;
7082 : you do not want to know about this
7087 if $test "$myhostname" ; then
7089 rp='Your host name appears to be "'$myhostname'".'" Right?"
7097 : bad guess or no guess
7098 while $test "X$myhostname" = X ; do
7100 rp="Please type the (one word) name of your host:"
7105 : translate upper to lower if necessary
7106 case "$myhostname" in
7108 echo "(Normalizing case in your host name)"
7109 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
7113 case "$myhostname" in
7115 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
7116 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
7117 echo "(Trimming domain name from host name--host name is now $myhostname)"
7119 *) case "$mydomain" in
7122 test "X$hostcat" = "Xypcat hosts" &&
7123 ypmatch "$myhostname" hosts 2>/dev/null |\
7124 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
7127 test "X$hostcat" != "X" &&
7128 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
7129 /[ ]$myhostname[ . ]/p" > hosts
7132 if $test -f hosts; then
7133 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
7134 END { print sum }" hosts` = x1 || tmp_re="[ ]"
7135 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
7136 hosts | $sort | $uniq | \
7137 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
7138 case `$echo X$dflt` in
7139 X*\ *) echo "(Several hosts in the database matched hostname)"
7142 X.) echo "(You do not have fully-qualified names in the hosts database)"
7146 echo "(I cannot locate a hosts database anywhere)"
7151 tans=`./loc resolv.conf X /etc /usr/etc`
7152 if $test -f "$tans"; then
7153 echo "(Attempting domain name extraction from $tans)"
7154 dflt=.`$sed -n -e 's/ / /g' \
7155 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
7156 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
7158 .) dflt=.`$sed -n -e 's/ / /g' \
7159 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
7160 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
7167 .) echo "(No help from resolv.conf either -- attempting clever guess)"
7168 dflt=.`sh -c domainname 2>/dev/null`
7171 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
7176 .) echo "(Lost all hope -- silly guess then)"
7182 *) dflt="$mydomain";;
7186 rp="What is your domain name?"
7196 : translate upper to lower if necessary
7199 echo "(Normalizing case in your domain name)"
7200 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
7204 : a little sanity check here
7205 case "$phostname" in
7208 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
7209 $myhostname$mydomain|$myhostname) ;;
7211 case "$phostname" in
7213 echo "(That doesn't agree with your whoami.h file, by the way.)"
7216 echo "(That doesn't agree with your $phostname command, by the way.)"
7226 I need to get your e-mail address in Internet format if possible, i.e.
7227 something like user@host.domain. Please answer accurately since I have
7228 no easy means to double check it. The default value provided below
7229 is most probably close to reality but may not be valid from outside
7230 your organization...
7234 while test "$cont"; do
7236 '') dflt="$cf_by@$myhostname$mydomain";;
7237 *) dflt="$cf_email";;
7239 rp='What is your e-mail address?'
7245 rp='Address does not look like an Internet one. Use it anyway?'
7261 If you or somebody else will be maintaining perl at your site, please
7262 fill in the correct e-mail address here so that they may be contacted
7263 if necessary. Currently, the "perlbug" program included with perl
7264 will send mail to this address in addition to perlbug@perl.org. You may
7265 enter "none" for no administrator.
7268 case "$perladmin" in
7269 '') dflt="$cf_email";;
7270 *) dflt="$perladmin";;
7272 rp='Perl administrator e-mail address'
7276 : determine whether to only install version-specific parts.
7279 Do you want to install only the version-specific parts of the perl
7280 distribution? Usually you do *not* want to do this.
7282 case "$versiononly" in
7283 "$define"|[Yy]*|true) dflt='y' ;;
7286 rp="Do you want to install only the version-specific parts of perl?"
7289 [yY]*) val="$define";;
7295 : figure out how to guarantee perl startup
7296 case "$startperl" in
7298 case "$sharpbang" in
7302 I can use the #! construct to start perl on your system. This will
7303 make startup of perl scripts faster, but may cause problems if you
7304 want to share those scripts and perl is not in a standard place
7305 ($binexp/perl) on all your platforms. The alternative is to force
7306 a shell by starting the script with a single ':' character.
7309 case "$versiononly" in
7310 "$define") dflt="$binexp/perl$version";;
7311 *) dflt="$binexp/perl";;
7313 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
7316 none) startperl=": # use perl";;
7317 *) startperl="#!$ans"
7318 if $test 30 -lt `echo "$ans" | wc -c`; then
7321 WARNING: Some systems limit the #! command to 32 characters.
7322 If you experience difficulty running Perl scripts with #!, try
7323 installing Perl in a directory with a shorter pathname.
7329 *) startperl=": # use perl"
7334 echo "I'll use $startperl to start perl scripts."
7336 : figure best path for perl in scripts
7339 perlpath="$binexp/perl"
7340 case "$startperl" in
7345 I will use the "eval 'exec'" idiom to start Perl on your system.
7346 I can use the full path of your Perl binary for this purpose, but
7347 doing so may cause problems if you want to share those scripts and
7348 Perl is not always in a standard place ($binexp/perl).
7352 rp="What path shall I use in \"eval 'exec'\"?"
7359 case "$startperl" in
7361 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
7364 : determine where public executable scripts go
7365 set scriptdir scriptdir
7367 case "$scriptdir" in
7370 : guess some guesses
7371 $test -d /usr/share/scripts && dflt=/usr/share/scripts
7372 $test -d /usr/share/bin && dflt=/usr/share/bin
7373 $test -d /usr/local/script && dflt=/usr/local/script
7374 $test -d /usr/local/scripts && dflt=/usr/local/scripts
7375 $test -d $prefixexp/script && dflt=$prefixexp/script
7379 *) dflt="$scriptdir"
7384 Some installations have a separate directory just for executable scripts so
7385 that they can mount it across multiple architectures but keep the scripts in
7386 one spot. You might, for example, have a subdirectory of /usr/share for this.
7387 Or you might just lump your scripts in with all your other executables.
7391 rp='Where do you keep publicly executable scripts?'
7393 if $test "X$ansexp" != "X$scriptdirexp"; then
7397 scriptdirexp="$ansexp"
7398 : Change installation prefix, if necessary.
7399 if $test X"$prefix" != X"$installprefix"; then
7400 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
7402 installscript="$scriptdirexp"
7405 : determine where add-on public executables go
7407 '') dflt=$siteprefix/bin ;;
7411 rp='Pathname where the add-on public executables should be installed?'
7414 sitebinexp="$ansexp"
7415 : Change installation prefix, if necessary.
7416 if $test X"$prefix" != X"$installprefix"; then
7417 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
7419 installsitebin="$sitebinexp"
7422 case "$useperlio" in
7423 $define|true|[yY]*) dflt='y';;
7428 Previous version of $package used the standard IO mechanisms as defined
7429 in <stdio.h>. Versions 5.003_02 and later of perl allow alternate IO
7430 mechanisms via a "PerlIO" abstraction, but the stdio mechanism is still
7431 the default. This abstraction layer can use AT&T's sfio (if you already
7432 have sfio installed) or regular stdio. Using PerlIO with sfio may cause
7433 problems with some extension modules. Using PerlIO with stdio is safe,
7434 but it is slower than plain stdio and therefore is not the default.
7436 If this doesn't make any sense to you, just accept the default '$dflt'.
7438 rp='Use the experimental PerlIO abstraction layer?'
7445 echo "Ok, doing things the stdio way"
7452 case "$vendorprefix" in
7453 '') d_vendorbin="$undef"
7457 *) d_vendorbin="$define"
7458 : determine where vendor-supplied executables go.
7459 case "$vendorbin" in
7460 '') dflt=$vendorprefix/bin ;;
7461 *) dflt="$vendorbin" ;;
7464 rp='Pathname for the vendor-supplied executables directory?'
7467 vendorbinexp="$ansexp"
7470 : Change installation prefix, if necessary.
7471 if $test X"$prefix" != X"$installprefix"; then
7472 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
7474 installvendorbin="$vendorbinexp"
7477 : see if qgcvt exists
7483 if $test X"$d_longdbl" = X"$define"; then
7485 echo "Checking how to print long doubles..." >&4
7487 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
7488 $cat >try.c <<'EOCP'
7489 #include <sys/types.h>
7493 printf("%.3f\n", d);
7497 if eval $compile; then
7501 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
7502 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
7503 echo "We will use %f."
7509 if $test X"$sPRIfldbl" = X; then
7510 $cat >try.c <<'EOCP'
7511 #include <sys/types.h>
7514 long double d = 123.456;
7515 printf("%.3llf\n", d);
7519 if eval $compile; then
7523 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
7524 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
7525 echo "We will use %llf."
7531 if $test X"$sPRIfldbl" = X; then
7532 $cat >try.c <<'EOCP'
7533 #include <sys/types.h>
7536 long double d = 123.456;
7537 printf("%.3Lf\n", d);
7541 if eval $compile; then
7545 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
7546 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
7547 echo "We will use %Lf."
7553 if $test X"$sPRIfldbl" = X; then
7554 $cat >try.c <<'EOCP'
7555 #include <sys/types.h>
7558 long double d = 123.456;
7559 printf("%.3lf\n", d);
7563 if eval $compile; then
7567 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
7568 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
7569 echo "We will use %lf."
7575 if $test X"$sPRIfldbl" = X; then
7576 echo "Cannot figure out how to print long doubles." >&4
7578 sSCNfldbl=$sPRIfldbl # expect consistency
7585 case "$sPRIfldbl" in
7586 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
7587 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
7588 d_SCNfldbl="$undef";
7590 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
7591 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
7592 d_SCNfldbl="$define";
7596 : Check how to convert floats to strings.
7598 echo "Checking for an efficient way to convert floats to strings."
7600 case "$uselongdouble" in
7601 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
7603 case "$d_longdbl" in
7604 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
7606 case "$d_PRIgldbl" in
7607 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
7611 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
7612 char *myname = "gconvert";
7615 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
7616 char *myname = "gcvt";
7619 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
7620 char *myname = "qgcvt";
7621 #define DOUBLETYPE long double
7624 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE) && defined(HAS_PRIgldbl)
7625 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
7627 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
7629 char *myname = "sprintf";
7633 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
7634 #define DOUBLETYPE long double
7636 #define DOUBLETYPE double
7642 #define I_STDLIB $i_stdlib
7648 checkit(expect, got)
7652 if (strcmp(expect, got)) {
7653 printf("%s oddity: Expected %s, got %s\n",
7654 myname, expect, got);
7664 /* This must be 1st test on (which?) platform */
7665 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
7666 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
7667 checkit("0.1", buf);
7669 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
7672 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
7673 checkit("1.1", buf);
7675 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
7676 checkit("1.01", buf);
7678 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
7679 checkit("1.001", buf);
7681 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
7682 checkit("1.0001", buf);
7684 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
7685 checkit("1.00001", buf);
7687 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
7688 checkit("1.000001", buf);
7690 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
7693 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
7696 /* Some Linux gcvt's give 1.e+5 here. */
7697 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
7698 checkit("100000", buf);
7700 /* Some Linux gcvt's give -1.e+5 here. */
7701 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
7702 checkit("-100000", buf);
7704 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
7705 checkit("123.456", buf);
7710 case "$d_Gconvert" in
7711 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
7712 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
7713 sprintf*) xxx_list='sprintf gconvert gcvt' ;;
7714 *) xxx_list='gconvert gcvt sprintf' ;;
7717 case "$d_longdbl$uselongdouble$d_PRIgldbl" in
7718 "$define$define$define")
7719 # for long doubles prefer first qgcvt, then sprintf
7720 xxx_list="`echo $xxx_list|sed s/sprintf//`"
7721 xxx_list="sprintf $xxx_list"
7723 "$define") xxx_list="qgcvt $xxx_list" ;;
7728 for xxx_convert in $xxx_list; do
7729 echo "Trying $xxx_convert..."
7731 set try -DTRY_$xxx_convert
7732 if eval $compile; then
7733 echo "$xxx_convert() found." >&4
7735 echo "I'll use $xxx_convert to convert floats into a string." >&4
7738 echo "...But $xxx_convert didn't work as I expected."
7741 echo "$xxx_convert NOT found." >&4
7745 case "$xxx_convert" in
7746 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
7747 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
7748 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
7749 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
7750 "$define$define$define")
7751 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
7752 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
7757 : Initialize h_fcntl
7760 : Initialize h_sysfile
7763 : access call always available on UNIX
7767 : locate the flags for 'access()'
7771 $cat >access.c <<'EOCP'
7772 #include <sys/types.h>
7777 #include <sys/file.h>
7786 : check sys/file.h first, no particular reason here
7787 if $test `./findhdr sys/file.h` && \
7788 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
7790 echo "<sys/file.h> defines the *_OK access constants." >&4
7791 elif $test `./findhdr fcntl.h` && \
7792 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
7794 echo "<fcntl.h> defines the *_OK access constants." >&4
7795 elif $test `./findhdr unistd.h` && \
7796 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
7797 echo "<unistd.h> defines the *_OK access constants." >&4
7799 echo "I can't find the four *_OK access constants--I'll use mine." >&4
7805 : see if accessx exists
7806 set accessx d_accessx
7809 : see if alarm exists
7813 : see if atolf exists
7817 : see if atoll exists
7821 : Look for GNU-cc style attribute checking
7823 echo "Checking whether your compiler can handle __attribute__ ..." >&4
7824 $cat >attrib.c <<'EOCP'
7826 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
7828 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
7829 if $contains 'warning' attrib.out >/dev/null 2>&1; then
7830 echo "Your C compiler doesn't fully support __attribute__."
7833 echo "Your C compiler supports __attribute__."
7837 echo "Your C compiler doesn't seem to understand __attribute__ at all."
7844 : see if bcmp exists
7848 : see if bcopy exists
7852 : see if this is a unistd.h system
7853 set unistd.h i_unistd
7856 : see if getpgrp exists
7857 set getpgrp d_getpgrp
7860 case "$d_getpgrp" in
7863 echo "Checking to see which flavor of getpgrp is in use..."
7866 #include <sys/types.h>
7868 # include <unistd.h>
7872 if (getuid() == 0) {
7873 printf("(I see you are running Configure as super-user...)\n");
7877 if (getpgrp(1) == 0)
7886 if $cc -o set -DTRY_BSD_PGRP $ccflags $ldflags set.c $libs >/dev/null 2>&1 && ./set; then
7887 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
7889 elif $cc -o set $ccflags $ldflags set.c $libs >/dev/null 2>&1 && ./set; then
7890 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
7893 echo "I can't seem to compile and run the test program."
7895 xxx="a USG one, i.e. you use getpgrp()."
7897 # SVR4 systems can appear rather BSD-ish.
7900 xxx="a BSD one, i.e. you use getpgrp(pid)."
7904 xxx="probably a USG one, i.e. you use getpgrp()."
7909 echo "Assuming your getpgrp is $xxx" >&4
7918 : see if setpgrp exists
7919 set setpgrp d_setpgrp
7922 case "$d_setpgrp" in
7925 echo "Checking to see which flavor of setpgrp is in use..."
7928 #include <sys/types.h>
7930 # include <unistd.h>
7934 if (getuid() == 0) {
7935 printf("(I see you are running Configure as super-user...)\n");
7939 if (-1 == setpgrp(1, 1))
7942 if (setpgrp() != -1)
7948 if $cc -o set -DTRY_BSD_PGRP $ccflags $ldflags set.c $libs >/dev/null 2>&1 && ./set; then
7949 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
7951 elif $cc -o set $ccflags $ldflags set.c $libs >/dev/null 2>&1 && ./set; then
7952 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
7955 echo "(I can't seem to compile and run the test program.)"
7957 xxx="a USG one, i.e. you use setpgrp()."
7959 # SVR4 systems can appear rather BSD-ish.
7962 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
7966 xxx="probably a USG one, i.e. you use setpgrp()."
7971 echo "Assuming your setpgrp is $xxx" >&4
7979 : see if bzero exists
7983 : see if signal is declared as pointer to function returning int or void
7985 xxx=`./findhdr signal.h`
7986 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
7987 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7988 echo "You have int (*signal())() instead of void." >&4
7990 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7991 echo "You have void (*signal())()." >&4
7993 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
7994 echo "You have int (*signal())() instead of void." >&4
7996 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
7997 echo "You have void (*signal())()." >&4
8000 case "$d_voidsig" in
8002 echo "I can't determine whether signal handler returns void or int..." >&4
8004 rp="What type does your signal handler return?"
8011 echo "As you already told me, signal handler returns void." >&4
8014 *) echo "As you already told me, signal handler returns int." >&4
8021 case "$d_voidsig" in
8022 "$define") signal_t="void";;
8027 : check for ability to cast large floats to 32-bit ints.
8029 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
8030 if $test "$intsize" -ge 4; then
8037 #include <sys/types.h>
8039 $signal_t blech(s) int s; { exit(3); }
8046 signal(SIGFPE, blech);
8048 /* Don't let compiler optimize the test away. Store the number
8049 in a writable string for gcc to pass to sscanf under HP/UX.
8051 sprintf(str, "2147483647");
8052 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
8056 /* x86 processors will probably give 0x8000 0000, which is a
8057 sign change. We don't want that. We want to mimic SPARC
8058 behavior here, which is to preserve the sign and give
8061 if (i32 != ($xxx) f)
8067 if eval $compile_ok; then
8071 echo "(I can't seem to compile the test program--assuming it can't)"
8079 echo "Nope, it can't."
8086 : check for ability to cast negative floats to unsigned
8088 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
8091 #include <sys/types.h>
8093 $signal_t blech(s) int s; { exit(7); }
8094 $signal_t blech_in_list(s) int s; { exit(4); }
8095 unsigned long dummy_long(p) unsigned long p; { return p; }
8096 unsigned int dummy_int(p) unsigned int p; { return p; }
8097 unsigned short dummy_short(p) unsigned short p; { return p; }
8101 unsigned long along;
8103 unsigned short ashort;
8107 /* Frustrate gcc-2.7.2's optimizer which failed this test with
8108 a direct f = -123. assignment. gcc-2.8.0 reportedly
8109 optimized the whole file away
8111 /* Store the number in a writable string for gcc to pass to
8114 sprintf(str, "-123");
8115 sscanf(str, "%lf", &f); /* f = -123.; */
8117 signal(SIGFPE, blech);
8118 along = (unsigned long)f;
8119 aint = (unsigned int)f;
8120 ashort = (unsigned short)f;
8121 if (along != (unsigned long)-123)
8123 if (aint != (unsigned int)-123)
8125 if (ashort != (unsigned short)-123)
8127 sprintf(str, "1073741824.");
8128 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
8131 along = (unsigned long)f;
8132 if (along != 0x80000000)
8136 along = (unsigned long)f;
8137 if (along != 0x7fffffff)
8141 along = (unsigned long)f;
8142 if (along != 0x80000001)
8146 signal(SIGFPE, blech_in_list);
8147 sprintf(str, "123.");
8148 sscanf(str, "%lf", &f); /* f = 123.; */
8149 along = dummy_long((unsigned long)f);
8150 aint = dummy_int((unsigned int)f);
8151 ashort = dummy_short((unsigned short)f);
8152 if (along != (unsigned long)123)
8154 if (aint != (unsigned int)123)
8156 if (ashort != (unsigned short)123)
8163 if eval $compile_ok; then
8167 echo "(I can't seem to compile the test program--assuming it can't)"
8170 case "$castflags" in
8175 echo "Nope, it can't."
8182 : see if vprintf exists
8184 if set vprintf val -f d_vprintf; eval $csym; $val; then
8185 echo 'vprintf() found.' >&4
8187 $cat >vprintf.c <<'EOF'
8188 #include <varargs.h>
8190 int main() { xxx("foo"); }
8199 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
8203 if eval $compile && ./vprintf; then
8204 echo "Your vsprintf() returns (int)." >&4
8207 echo "Your vsprintf() returns (char*)." >&4
8211 echo 'vprintf() NOT found.' >&4
8221 : see if chown exists
8225 : see if chroot exists
8229 : see if chsize exists
8233 : check for const keyword
8235 echo 'Checking to see if your C compiler knows about "const"...' >&4
8236 $cat >const.c <<'EOCP'
8237 typedef struct spug { int drokk; } spug;
8244 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
8246 echo "Yup, it does."
8249 echo "Nope, it doesn't."
8254 : see if crypt exists
8256 if set crypt val -f d_crypt; eval $csym; $val; then
8257 echo 'crypt() found.' >&4
8261 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
8262 if $test -z "$cryptlib"; then
8263 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
8267 if $test -z "$cryptlib"; then
8268 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
8272 if $test -z "$cryptlib"; then
8273 cryptlib=`./loc libcrypt$_a "" $libpth`
8277 if $test -z "$cryptlib"; then
8278 echo 'crypt() NOT found.' >&4
8287 : get csh whereabouts
8289 'csh') val="$undef" ;;
8294 : Respect a hint or command line value for full_csh.
8296 '') full_csh=$csh ;;
8299 : see if cuserid exists
8300 set cuserid d_cuserid
8303 : see if this is a limits.h system
8304 set limits.h i_limits
8307 : see if this is a float.h system
8311 : See if number of significant digits in a double precision number is known
8313 $cat >dbl_dig.c <<EOM
8323 printf("Contains DBL_DIG");
8326 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
8327 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
8328 echo "DBL_DIG found." >&4
8331 echo "DBL_DIG NOT found." >&4
8338 : see if difftime exists
8339 set difftime d_difftime
8342 : see if this is a dirent system
8344 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
8346 echo "<dirent.h> found." >&4
8349 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
8350 echo "<sys/dir.h> found." >&4
8353 xinc=`./findhdr sys/ndir.h`
8355 echo "<dirent.h> NOT found." >&4
8360 : Look for type of directory structure.
8362 $cppstdin $cppflags $cppminus < "$xinc" > try.c
8364 case "$direntrytype" in
8367 $define) guess1='struct dirent' ;;
8368 *) guess1='struct direct' ;;
8371 *) guess1="$direntrytype"
8376 'struct dirent') guess2='struct direct' ;;
8377 *) guess2='struct dirent' ;;
8380 if $contains "$guess1" try.c >/dev/null 2>&1; then
8381 direntrytype="$guess1"
8382 echo "Your directory entries are $direntrytype." >&4
8383 elif $contains "$guess2" try.c >/dev/null 2>&1; then
8384 direntrytype="$guess2"
8385 echo "Your directory entries seem to be $direntrytype." >&4
8387 echo "I don't recognize your system's directory entries." >&4
8388 rp="What type is used for directory entries on this system?"
8396 : see if the directory entry stores field length
8398 $cppstdin $cppflags $cppminus < "$xinc" > try.c
8399 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
8400 echo "Good, your directory entry keeps length information in d_namlen." >&4
8403 echo "Your directory entry does not know about the d_namlen field." >&4
8410 : see if dlerror exists
8413 set dlerror d_dlerror
8417 : see if dlfcn is available
8425 On a few systems, the dynamically loaded modules that perl generates and uses
8426 will need a different extension than shared libs. The default will probably
8434 rp='What is the extension of dynamically loaded modules'
8443 : Check if dlsym need a leading underscore
8449 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
8450 $cat >dyna.c <<'EOM'
8459 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
8461 #include <sys/types.h>
8475 int mode = RTLD_LAZY ;
8477 handle = dlopen("./dyna.$dlext", mode) ;
8478 if (handle == NULL) {
8483 symbol = dlsym(handle, "fred") ;
8484 if (symbol == NULL) {
8485 /* try putting a leading underscore */
8486 symbol = dlsym(handle, "_fred") ;
8487 if (symbol == NULL) {
8500 : Call the object file tmp-dyna.o in case dlext=o.
8501 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
8502 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
8503 $ld -o dyna.$dlext $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
8504 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then
8507 1) echo "Test program failed using dlopen." >&4
8508 echo "Perhaps you should not use dynamic loading." >&4;;
8509 2) echo "Test program failed using dlsym." >&4
8510 echo "Perhaps you should not use dynamic loading." >&4;;
8511 3) echo "dlsym needs a leading underscore" >&4
8513 4) echo "dlsym doesn't need a leading underscore." >&4;;
8516 echo "I can't compile and run the test program." >&4
8517 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
8522 $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
8527 hasproto='varname=$1; func=$2; shift; shift;
8528 while $test $# -ge 2; do
8530 $define) echo "#include <$2>";;
8534 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
8535 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
8536 echo "$func() prototype found.";
8539 echo "$func() prototype NOT found.";
8544 $rm -f try.c tryout.c'
8546 : see if prototype for drand48 is available
8548 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
8551 : see if dup2 exists
8555 : see if eaccess exists
8556 set eaccess d_eaccess
8559 : see if endgrent exists
8560 set endgrent d_endgrent
8563 : see if endhostent exists
8564 set endhostent d_endhent
8567 : see if endnetent exists
8568 set endnetent d_endnent
8571 : see if endprotoent exists
8572 set endprotoent d_endpent
8575 : see if endpwent exists
8576 set endpwent d_endpwent
8579 : see if endservent exists
8580 set endservent d_endsent
8583 : Locate the flags for 'open()'
8585 $cat >open3.c <<'EOCP'
8586 #include <sys/types.h>
8591 #include <sys/file.h>
8602 : check sys/file.h first to get FREAD on Sun
8603 if $test `./findhdr sys/file.h` && \
8604 set open3 -DI_SYS_FILE && eval $compile; then
8606 echo "<sys/file.h> defines the O_* constants..." >&4
8608 echo "and you have the 3 argument form of open()." >&4
8611 echo "but not the 3 argument form of open(). Oh, well." >&4
8614 elif $test `./findhdr fcntl.h` && \
8615 set open3 -DI_FCNTL && eval $compile; then
8617 echo "<fcntl.h> defines the O_* constants..." >&4
8619 echo "and you have the 3 argument form of open()." >&4
8622 echo "but not the 3 argument form of open(). Oh, well." >&4
8627 echo "I can't find the O_* constant definitions! You got problems." >&4
8633 : see which of string.h or strings.h is needed
8635 strings=`./findhdr string.h`
8636 if $test "$strings" && $test -r "$strings"; then
8637 echo "Using <string.h> instead of <strings.h>." >&4
8641 strings=`./findhdr strings.h`
8642 if $test "$strings" && $test -r "$strings"; then
8643 echo "Using <strings.h> instead of <string.h>." >&4
8645 echo "No string header found -- You'll surely have problems." >&4
8651 "$undef") strings=`./findhdr strings.h`;;
8652 *) strings=`./findhdr string.h`;;
8655 : check for non-blocking I/O stuff
8656 case "$h_sysfile" in
8657 true) echo "#include <sys/file.h>" > head.c;;
8660 true) echo "#include <fcntl.h>" > head.c;;
8661 *) echo "#include <sys/fcntl.h>" > head.c;;
8666 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
8667 case "$o_nonblock" in
8670 $cat >>try.c <<'EOCP'
8674 printf("O_NONBLOCK\n");
8678 printf("O_NDELAY\n");
8682 printf("FNDELAY\n");
8689 if eval $compile_ok; then
8691 case "$o_nonblock" in
8692 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
8693 *) echo "Seems like we can use $o_nonblock.";;
8696 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
8699 *) echo "Using $hint value $o_nonblock.";;
8701 $rm -f try try.* .out core
8704 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
8710 #include <sys/types.h>
8713 #define MY_O_NONBLOCK $o_nonblock
8714 #ifndef errno /* XXX need better Configure test */
8725 #include <strings.h>
8727 $signal_t blech(x) int x; { exit(3); }
8729 $cat >> try.c <<'EOCP'
8737 pipe(pd); /* Down: child -> parent */
8738 pipe(pu); /* Up: parent -> child */
8741 close(pd[1]); /* Parent reads from pd[0] */
8742 close(pu[0]); /* Parent writes (blocking) to pu[1] */
8743 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
8745 signal(SIGALRM, blech);
8747 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
8749 sprintf(string, "%d\n", ret);
8750 write(2, string, strlen(string));
8753 if (errno == EAGAIN) {
8759 if (errno == EWOULDBLOCK)
8760 printf("EWOULDBLOCK\n");
8763 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
8764 sleep(2); /* Give it time to close our pipe */
8766 ret = read(pd[0], buf, 1); /* Should read EOF */
8768 sprintf(string, "%d\n", ret);
8769 write(3, string, strlen(string));
8773 close(pd[0]); /* We write to pd[1] */
8774 close(pu[1]); /* We read from pu[0] */
8775 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
8776 close(pd[1]); /* Pipe pd is now fully closed! */
8777 exit(0); /* Bye bye, thank you for playing! */
8781 if eval $compile_ok; then
8782 echo "$startsh" >mtry
8783 echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
8785 ./mtry >/dev/null 2>&1
8787 0) eagain=`$cat try.out`;;
8788 1) echo "Could not perform non-blocking setting!";;
8789 2) echo "I did a successful read() for something that was not there!";;
8790 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
8791 *) echo "Something terribly wrong happened during testing.";;
8793 rd_nodata=`$cat try.ret`
8794 echo "A read() system call with no data present returns $rd_nodata."
8795 case "$rd_nodata" in
8798 echo "(That's peculiar, fixing that to be -1.)"
8804 echo "Forcing errno EAGAIN on read() with no data available."
8808 echo "Your read() sets errno to $eagain when no data is available."
8811 status=`$cat try.err`
8813 0) echo "And it correctly returns 0 to signal EOF.";;
8814 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
8815 *) echo "However, your read() returns '$status' on EOF??";;
8818 if test "$status" = "$rd_nodata"; then
8819 echo "WARNING: you can't distinguish between EOF and no data!"
8823 echo "I can't compile the test program--assuming errno EAGAIN will do."
8830 echo "Using $hint value $eagain."
8831 echo "Your read() returns $rd_nodata when no data is present."
8832 case "$d_eofnblk" in
8833 "$define") echo "And you can see EOF because read() returns 0.";;
8834 "$undef") echo "But you can't see EOF status from read() returned value.";;
8836 echo "(Assuming you can't see EOF status from read anyway.)"
8842 $rm -f try try.* .out core head.c mtry
8844 : see if fchmod exists
8848 : see if fchown exists
8852 : see if this is an fcntl system
8857 : See if fcntl-based locking works.
8858 $cat >try.c <<'EOCP'
8863 #if defined(F_SETLK) && defined(F_SETLKW)
8866 fd = open("try.c", O_RDONLY);
8867 flock.l_type = F_RDLCK;
8868 flock.l_whence = SEEK_SET;
8869 flock.l_start = flock.l_len = 0;
8870 retval = fcntl(fd, F_SETLK, &flock);
8872 (retval < 0 ? exit(2) : exit(0));
8878 echo "Checking if fcntl-based file locking works... "
8882 if eval $compile_ok; then
8884 echo "Yes, it seems to work."
8887 echo "Nope, it didn't work."
8891 echo "I'm unable to compile the test program, so I'll assume not."
8896 echo "Nope, since you don't even have fcntl()."
8899 set d_fcntl_can_lock
8904 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
8905 while $test $# -ge 2; do
8907 $define) echo "#include <$2>";;
8911 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
8913 if eval $compile; then
8924 : see whether socket exists
8926 $echo $n "Hmm... $c" >&4
8927 if set socket val -f d_socket; eval $csym; $val; then
8928 echo "Looks like you have Berkeley networking support." >&4
8930 if set setsockopt val -f; eval $csym; $val; then
8933 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
8937 if $contains socklib libc.list >/dev/null 2>&1; then
8938 echo "Looks like you have Berkeley networking support." >&4
8940 : we will have to assume that it supports the 4.2 BSD interface
8943 echo "You don't have Berkeley networking in libc$_a..." >&4
8944 if test "X$d_socket" = "X$define"; then
8945 echo "...but you seem to believe that you have sockets." >&4
8947 for net in net socket
8949 if test -f /usr/lib/lib$net$_a; then
8950 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
8951 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
8952 if $contains socket libc.list >/dev/null 2>&1; then
8957 echo "...but the Wollongong group seems to have hacked it in." >&4
8958 sockethdr="-I/usr/netinclude"
8961 echo "Found Berkeley sockets interface in lib$net." >& 4
8962 if $contains setsockopt libc.list >/dev/null 2>&1; then
8965 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
8972 if test "X$d_socket" != "X$define"; then
8973 echo "or anywhere else I see." >&4
8981 : see if socketpair exists
8982 set socketpair d_sockpair
8987 echo "Checking the availability of certain socket constants..." >& 4
8988 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
8989 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
8991 #include <sys/types.h>
8992 #include <sys/socket.h>
8998 set try; if eval $compile; then
9001 set d_${enum}; eval $setvar
9005 : see if sys/select.h has to be included
9006 set sys/select.h i_sysselct
9009 : see if we should include time.h, sys/time.h, or both
9011 if test "X$timeincl" = X; then
9012 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9013 $echo $n "I'm now running the test program...$c"
9014 $cat >try.c <<'EOCP'
9015 #include <sys/types.h>
9020 #ifdef SYSTIMEKERNEL
9023 #include <sys/time.h>
9026 #include <sys/select.h>
9035 struct timezone tzp;
9037 if (foo.tm_sec == foo.tm_sec)
9040 if (bar.tv_sec == bar.tv_sec)
9047 for s_timezone in '-DS_TIMEZONE' ''; do
9049 for s_timeval in '-DS_TIMEVAL' ''; do
9050 for i_systimek in '' '-DSYSTIMEKERNEL'; do
9051 for i_time in '' '-DI_TIME'; do
9052 for i_systime in '-DI_SYSTIME' ''; do
9055 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
9056 if eval $compile; then
9057 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
9061 $echo $n "Succeeded with $flags$c"
9073 *SYSTIMEKERNEL*) i_systimek="$define"
9074 timeincl=`./findhdr sys/time.h`
9075 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
9076 *) i_systimek="$undef";;
9079 *I_TIME*) i_time="$define"
9080 timeincl=`./findhdr time.h`" $timeincl"
9081 echo "We'll include <time.h>." >&4;;
9082 *) i_time="$undef";;
9085 *I_SYSTIME*) i_systime="$define"
9086 timeincl=`./findhdr sys/time.h`" $timeincl"
9087 echo "We'll include <sys/time.h>." >&4;;
9088 *) i_systime="$undef";;
9093 : check for fd_set items
9096 Checking to see how well your C compiler handles fd_set and friends ...
9098 $cat >fd_set.c <<EOCP
9099 #$i_systime I_SYS_TIME
9100 #$i_sysselct I_SYS_SELECT
9101 #$d_socket HAS_SOCKET
9102 #include <sys/types.h>
9104 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
9107 #include <sys/time.h>
9110 #include <sys/select.h>
9119 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
9126 set fd_set -DTRYBITS
9127 if eval $compile; then
9128 d_fds_bits="$define"
9130 echo "Well, your system knows about the normal fd_set typedef..." >&4
9132 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
9133 d_fd_macros="$define"
9136 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
9138 d_fd_macros="$undef"
9142 Hmm, your compiler has some difficulty with fd_set. Checking further...
9145 if eval $compile; then
9148 echo "Well, your system has some sort of fd_set available..." >&4
9150 echo "and you have the normal fd_set macros." >&4
9151 d_fd_macros="$define"
9154 but not the normal fd_set macros! Gross! More work for me...
9156 d_fd_macros="$undef"
9159 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
9162 d_fd_macros="$undef"
9167 : see if fgetpos exists
9168 set fgetpos d_fgetpos
9171 : see if flock exists
9175 : see if fork exists
9179 : see if pathconf exists
9180 set pathconf d_pathconf
9183 : see if fpathconf exists
9184 set fpathconf d_fpathconf
9188 : check for fpos64_t
9190 echo "Checking to see if you have fpos64_t..." >&4
9193 int main() { fpos64_t x = 7; }
9196 if eval $compile; then
9198 echo "You have fpos64_t."
9201 echo "You do not have fpos64_t."
9203 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
9210 : see if frexpl exists
9214 hasstruct='varname=$1; struct=$2; shift; shift;
9215 while $test $# -ge 2; do
9217 $define) echo "#include <$2>";;
9221 echo "int main () { struct $struct foo; }" >> try.c;
9223 if eval $compile; then
9232 : see if this is a sys/param system
9233 set sys/param.h i_sysparam
9236 : see if this is a sys/mount.h system
9237 set sys/mount.h i_sysmount
9240 : see if sys/types.h has to be included
9241 set sys/types.h i_systypes
9246 echo "Checking to see if your system supports struct fs_data..." >&4
9247 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
9249 case "$d_fs_data_s" in
9250 "$define") echo "Yes, it does." ;;
9251 *) echo "No, it doesn't." ;;
9254 : see if fseeko exists
9258 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
9261 : see if fsetpos exists
9262 set fsetpos d_fsetpos
9266 : see if fstatfs exists
9267 set fstatfs d_fstatfs
9271 : see if statvfs exists
9272 set statvfs d_statvfs
9275 : see if fstatvfs exists
9276 set fstatvfs d_fstatvfs
9280 : see if fsync exists
9284 : see if ftello exists
9288 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
9291 : see if getcwd exists
9295 : see if getespwnam exists
9296 set getespwnam d_getespwnam
9300 : see if getfsstat exists
9301 set getfsstat d_getfsstat
9304 : see if getgrent exists
9305 set getgrent d_getgrent
9308 : see if gethostbyaddr exists
9309 set gethostbyaddr d_gethbyaddr
9312 : see if gethostbyname exists
9313 set gethostbyname d_gethbyname
9316 : see if gethostent exists
9317 set gethostent d_gethent
9320 : see how we will look up host name
9323 if set gethostname val -f d_gethname; eval $csym; $val; then
9324 echo 'gethostname() found.' >&4
9325 d_gethname="$define"
9328 if set uname val -f d_uname; eval $csym; $val; then
9331 uname() was found, but you're running xenix, and older versions of xenix
9332 have a broken uname(). If you don't really know whether your xenix is old
9333 enough to have a broken system call, use the default answer.
9340 rp='Is your uname() broken?'
9343 n*) d_uname="$define"; call=uname;;
9346 echo 'uname() found.' >&4
9353 case "$d_gethname" in
9354 '') d_gethname="$undef";;
9357 '') d_uname="$undef";;
9359 case "$d_uname$d_gethname" in
9364 Every now and then someone has a $call() that lies about the hostname
9365 but can't be fixed for political or economic reasons. If you wish, I can
9366 pretend $call() isn't there and maybe compute hostname at run-time
9367 thanks to the '$phostname' command.
9370 rp="Shall I ignore $call() from now on?"
9373 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
9376 case "$phostname" in
9378 *) case "$aphostname" in
9384 file=`./loc $file $file $pth`
9385 aphostname=`echo $file $*`
9390 case "$d_uname$d_gethname" in
9393 case "$phostname" in
9395 echo "There will be no way for $package to get your hostname." >&4;;
9397 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
9401 case "$d_phostname" in
9402 '') d_phostname="$undef";;
9405 : see if this is a netdb.h system
9409 : see if prototypes for various gethostxxx netdb.h functions are available
9411 set d_gethostprotos gethostent $i_netdb netdb.h
9414 : see if getlogin exists
9415 set getlogin d_getlogin
9418 : see if getmnt exists
9422 : see if getmntent exists
9423 set getmntent d_getmntent
9426 : see if getnetbyaddr exists
9427 set getnetbyaddr d_getnbyaddr
9430 : see if getnetbyname exists
9431 set getnetbyname d_getnbyname
9434 : see if getnetent exists
9435 set getnetent d_getnent
9438 : see if prototypes for various getnetxxx netdb.h functions are available
9440 set d_getnetprotos getnetent $i_netdb netdb.h
9443 : see if getpagesize exists
9444 set getpagesize d_getpagsz
9448 : see if getprotobyname exists
9449 set getprotobyname d_getpbyname
9452 : see if getprotobynumber exists
9453 set getprotobynumber d_getpbynumber
9456 : see if getprotoent exists
9457 set getprotoent d_getpent
9460 : see if getpgid exists
9461 set getpgid d_getpgid
9464 : see if getpgrp2 exists
9465 set getpgrp2 d_getpgrp2
9468 : see if getppid exists
9469 set getppid d_getppid
9472 : see if getpriority exists
9473 set getpriority d_getprior
9476 : see if prototypes for various getprotoxxx netdb.h functions are available
9478 set d_getprotoprotos getprotoent $i_netdb netdb.h
9481 : see if getprpwnam exists
9482 set getprpwnam d_getprpwnam
9485 : see if getpwent exists
9486 set getpwent d_getpwent
9490 : see if getservbyname exists
9491 set getservbyname d_getsbyname
9494 : see if getservbyport exists
9495 set getservbyport d_getsbyport
9498 : see if getservent exists
9499 set getservent d_getsent
9502 : see if prototypes for various getservxxx netdb.h functions are available
9504 set d_getservprotos getservent $i_netdb netdb.h
9507 : see if getspnam exists
9508 set getspnam d_getspnam
9511 : see if gettimeofday or ftime exists
9512 set gettimeofday d_gettimeod
9514 case "$d_gettimeod" in
9520 val="$undef"; set d_ftime; eval $setvar
9523 case "$d_gettimeod$d_ftime" in
9526 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
9530 : see if this is an grp system
9536 xxx=`./findhdr grp.h`
9537 $cppstdin $cppflags $cppminus < $xxx >$$.h
9539 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
9551 set d_grpasswd; eval $setvar
9555 : see if hasmntopt exists
9556 set hasmntopt d_hasmntopt
9559 : see if this is a netinet/in.h or sys/in.h system
9560 set netinet/in.h i_niin sys/in.h i_sysin
9563 : see if arpa/inet.h has to be included
9564 set arpa/inet.h i_arpainet
9567 : see if htonl --and friends-- exists
9572 : Maybe they are macros.
9577 #include <sys/types.h>
9578 #$i_niin I_NETINET_IN
9580 #$i_arpainet I_ARPA_INET
9582 #include <netinet/in.h>
9588 #include <arpa/inet.h>
9591 printf("Defined as a macro.");
9594 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
9595 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
9597 echo "But it seems to be defined as a macro." >&4
9605 : see if iconv exists
9611 if set index val -f; eval $csym; $val; then
9612 if set strchr val -f d_strchr; eval $csym; $val; then
9613 if $contains strchr "$strings" >/dev/null 2>&1 ; then
9616 echo "strchr() found." >&4
9620 echo "index() found." >&4
9625 echo "index() found." >&4
9628 if set strchr val -f d_strchr; eval $csym; $val; then
9631 echo "strchr() found." >&4
9633 echo "No index() or strchr() found!" >&4
9638 set d_strchr; eval $setvar
9640 set d_index; eval $setvar
9642 : check whether inet_aton exists
9643 set inet_aton d_inetaton
9646 : see if inttypes.h is available
9647 : we want a real compile instead of Inhdr because some systems
9648 : have an inttypes.h which includes non-existent headers
9651 #include <inttypes.h>
9653 static int32_t foo32 = 0x12345678;
9657 if eval $compile; then
9658 echo "<inttypes.h> found." >&4
9661 echo "<inttypes.h> NOT found." >&4
9670 echo "Checking to see if you have int64_t..." >&4
9672 #include <sys/types.h>
9673 #$i_inttypes I_INTTYPES
9675 #include <inttypes.h>
9677 int main() { int64_t x = 7; }
9680 if eval $compile; then
9682 echo "You have int64_t."
9685 echo "You do not have int64_t."
9693 $cat >isascii.c <<'EOCP'
9705 if eval $compile; then
9706 echo "isascii() found." >&4
9709 echo "isascii() NOT found." >&4
9716 : see if isnan exists
9720 : see if isnanl exists
9724 : see if killpg exists
9728 : see if lchown exists
9730 $cat > try.c <<'EOCP'
9731 /* System header to define __stub macros and hopefully few prototypes,
9732 which can conflict with char lchown(); below. */
9734 /* Override any gcc2 internal prototype to avoid an error. */
9735 /* We use char because int might match the return type of a gcc2
9736 builtin and then its argument prototype would still apply. */
9739 /* The GNU C library defines this for functions which it implements
9740 to always fail with ENOSYS. Some functions are actually named
9741 something starting with __ and the normal name is an alias. */
9742 #if defined (__stub_lchown) || defined (__stub___lchown)
9750 if eval $compile; then
9751 $echo "lchown() found." >&4
9754 $echo "lchown() NOT found." >&4
9760 : See if number of significant digits in a double precision number is known
9762 $cat >ldbl_dig.c <<EOM
9772 printf("Contains LDBL_DIG");
9775 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
9776 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
9777 echo "LDBL_DIG found." >&4
9780 echo "LDBL_DIG NOT found." >&4
9787 : see if link exists
9791 : see if localeconv exists
9792 set localeconv d_locconv
9795 : see if lockf exists
9799 : check for long long
9801 echo "Checking to see if you have long long..." >&4
9802 echo 'int main() { long long x = 7; return 0; }' > try.c
9804 if eval $compile; then
9806 echo "You have long long."
9809 echo "You do not have long long."
9815 : check for length of long long
9816 case "${d_longlong}${longlongsize}" in
9819 echo "Checking to see how big your long longs are..." >&4
9820 $cat >try.c <<'EOCP'
9824 printf("%d\n", (int)sizeof(long long));
9829 if eval $compile_ok; then
9830 longlongsize=`./try$exe_ext`
9831 echo "Your long longs are $longlongsize bytes long."
9835 echo "(I can't seem to compile the test program. Guessing...)"
9836 rp="What is the size of a long long (in bytes)?"
9840 if $test "X$longsize" = "X$longlongsize"; then
9841 echo "(That isn't any different from an ordinary long.)"
9847 : see if prototype for lseek is available
9849 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
9852 : see if lstat exists
9856 : see if madvise exists
9857 set madvise d_madvise
9860 : see if mblen exists
9864 : see if mbstowcs exists
9865 set mbstowcs d_mbstowcs
9868 : see if mbtowc exists
9872 : see if memchr exists
9876 : see if memcmp exists
9880 : see if memcpy exists
9884 : see if memmove exists
9885 set memmove d_memmove
9888 : see if memset exists
9892 : see if mkdir exists
9896 : see if mkdtemp exists
9897 set mkdtemp d_mkdtemp
9900 : see if mkfifo exists
9904 : see if mkstemp exists
9905 set mkstemp d_mkstemp
9908 : see if mkstemps exists
9909 set mkstemps d_mkstemps
9912 : see if mktime exists
9916 : see if this is a sys/mman.h system
9917 set sys/mman.h i_sysmman
9920 : see if mmap exists
9923 : see what shmat returns
9924 : default to something harmless
9926 case "$i_sysmman$d_mmap" in
9928 $cat >mmap.c <<'END'
9929 #include <sys/mman.h>
9932 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
9937 echo "and it returns ($mmaptype)." >&4
9943 : see if modfl exists
9947 : see if mprotect exists
9948 set mprotect d_mprotect
9951 : see if msgctl exists
9955 : see if msgget exists
9959 : see if msgsnd exists
9963 : see if msgrcv exists
9967 : see how much of the 'msg*(2)' library is present.
9970 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
9971 *"$undef"*) h_msg=false;;
9975 case "`ipcs 2>&1`" in
9976 "SVID messages"*"not configured"*)
9977 echo "Your $osname does not have the msg*(2) configured." >&4
9992 : we could also check for sys/ipc.h ...
9993 if $h_msg && $test `./findhdr sys/msg.h`; then
9994 echo "You have the full msg*(2) library." >&4
9997 echo "You don't have the full msg*(2) library." >&4
10003 : see if msync exists
10007 : see if munmap exists
10008 set munmap d_munmap
10011 : see if nice exists
10017 echo "Checking which 64-bit integer type we could use..." >&4
10023 val='"unsigned int"'
10028 *) case "$longsize" in
10032 val='"unsigned long"'
10037 *) case "$d_longlong:$longlongsize" in
10042 val='"unsigned long long"'
10047 *) case "$d_int64_t" in
10065 case "$quadtype" in
10066 '') echo "Alas, no 64-bit integer types in sight." >&4
10069 *) if test X"$use64bitint" = Xdefine -o X"$longsize" = X8; then
10074 echo "We $verb use '$quadtype' for 64-bit integers." >&4
10079 : check for length of character
10081 case "$charsize" in
10083 echo "Checking to see how big your characters are (hey, you never know)..." >&4
10084 $cat >try.c <<'EOCP'
10088 printf("%d\n", (int)sizeof(char));
10093 if eval $compile_ok; then
10097 echo "(I can't seem to compile the test program. Guessing...)"
10104 rp="What is the size of a character (in bytes)?"
10109 : check for volatile keyword
10111 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
10112 $cat >try.c <<'EOCP'
10115 typedef struct _goo_struct goo_struct;
10116 goo_struct * volatile goo = ((goo_struct *)0);
10117 struct _goo_struct {
10122 typedef unsigned short foo_t;
10123 char *volatile foo;
10125 volatile foo_t blech;
10129 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
10131 echo "Yup, it does."
10134 echo "Nope, it doesn't."
10142 $echo "Choosing the C types to be used for Perl's internal types..." >&4
10144 case "$use64bitint:$d_quad:$quadtype" in
10147 uvtype="$uquadtype"
10152 uvtype="unsigned long"
10158 case "$uselongdouble:$d_longdbl" in
10160 nvtype="long double"
10161 nvsize=$longdblsize
10168 $echo "(IV will be "$ivtype", $ivsize bytes)"
10169 $echo "(UV will be "$uvtype", $uvsize bytes)"
10170 $echo "(NV will be "$nvtype", $nvsize bytes)"
10173 #$i_inttypes I_INTTYPES
10175 #include <inttypes.h>
10180 int8_t i = INT8_MAX;
10181 uint8_t u = UINT8_MAX;
10182 printf("int8_t\n");
10185 int16_t i = INT16_MAX;
10186 uint16_t i = UINT16_MAX;
10187 printf("int16_t\n");
10190 int32_t i = INT32_MAX;
10191 uint32_t u = UINT32_MAX;
10192 printf("int32_t\n");
10198 '') case "$charsize" in
10200 u8type="unsigned char"
10209 if eval $compile; then
10210 case "`./try$exe_ext`" in
10211 int8_t) i8type=int8_t
10221 '') if $test $charsize -ge 1; then
10223 u8type="unsigned char"
10231 '') case "$shortsize" in
10233 u16type="unsigned short"
10241 '') set try -DINT16
10242 if eval $compile; then
10243 case "`./try$exe_ext`" in
10255 '') if $test $shortsize -ge 2; then
10257 u16type="unsigned short"
10265 '') case "$longsize" in
10267 u32type="unsigned long"
10271 *) case "$intsize" in
10273 u32type="unsigned int"
10283 '') set try -DINT32
10284 if eval $compile; then
10285 case "`./try$exe_ext`" in
10297 '') if $test $intsize -ge 4; then
10299 u32type="unsigned int"
10307 '') case "$d_quad:$quadtype" in
10309 i64type="$quadtype"
10310 u64type="$uquadtype"
10318 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
10319 : volatile so that the compiler has to store it out to memory.
10320 if test X"$d_volatile" = X"$define"; then
10325 #include <sys/types.h>
10326 #include <signal.h>
10328 $volatile int bletched = 0;
10329 $signal_t blech(s) int s; { bletched = 1; }
10334 int n = 8 * $uvsize;
10337 signal(SIGFPE, blech);
10340 for (i = 0; i < n; i++) {
10341 u = u << 1 | ($uvtype)1;
10343 if (($uvtype)d != u)
10347 d = ($nvtype)(u - 1);
10348 if (($uvtype)d != (u - 1))
10356 printf("%d\n", ((i == n) ? -n : i));
10362 d_nv_preserves_uv="$undef"
10363 if eval $compile; then
10364 d_nv_preserves_uv_bits="`./try$exe_ext`"
10366 case "$d_nv_preserves_uv_bits" in
10368 d_nv_preserves_uv_bits=`expr 0 - $d_nv_preserves_uv_bits`
10369 $echo "Your NVs can preserve all $d_nv_preserves_uv_bits bits of your UVs." 2>&1
10370 d_nv_preserves_uv="$define"
10372 [1-9]*) $echo "Your NVs can preserve only $d_nv_preserves_uv_bits bits of your UVs." 2>&1
10373 d_nv_preserves_uv="$undef" ;;
10374 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
10375 d_nv_preserves_uv_bits="$undef" ;;
10381 : check for off64_t
10383 echo "Checking to see if you have off64_t..." >&4
10385 #include <sys/types.h>
10386 #include <unistd.h>
10387 int main() { off64_t x = 7; }
10390 if eval $compile; then
10392 echo "You have off64_t."
10395 echo "You do not have off64_t."
10396 case "$lseeksize" in
10397 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
10404 : see if POSIX threads are available
10405 set pthread.h i_pthread
10411 : how to create joinable pthreads
10412 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
10414 echo "Checking what constant to use for creating joinable pthreads..." >&4
10415 $cat >try.c <<'EOCP'
10416 #include <pthread.h>
10418 int detachstate = JOINABLE;
10421 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
10422 if eval $compile; then
10423 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
10424 val="$undef" # Yes, undef.
10425 set d_old_pthread_create_joinable
10428 set old_pthread_create_joinable
10431 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
10432 if eval $compile; then
10433 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
10435 set d_old_pthread_create_joinable
10437 val=PTHREAD_CREATE_UNDETACHED
10438 set old_pthread_create_joinable
10441 set try -DJOINABLE=__UNDETACHED
10442 if eval $compile; then
10443 echo "You seem to use __UNDETACHED." >&4
10445 set d_old_pthread_create_joinable
10448 set old_pthread_create_joinable
10451 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
10453 set d_old_pthread_create_joinable
10456 set old_pthread_create_joinable
10463 d_old_pthread_create_joinable="$undef"
10464 old_pthread_create_joinable=""
10467 : see if pause exists
10471 : see if pipe exists
10475 : see if poll exists
10480 : see whether the various POSIXish _yields exist
10482 #include <pthread.h>
10488 #ifdef PTHREAD_YIELD
10491 #ifdef PTHREAD_YIELD_NULL
10492 pthread_yield(NULL);
10498 : see if sched_yield exists
10499 set try -DSCHED_YIELD
10500 if eval $compile; then
10502 sched_yield='sched_yield()'
10506 case "$usethreads" in
10509 $define) echo 'sched_yield() found.' >&4 ;;
10510 *) echo 'sched_yield() NOT found.' >&4 ;;
10516 : see if pthread_yield exists
10517 set try -DPTHREAD_YIELD
10518 if eval $compile; then
10520 case "$sched_yield" in
10521 '') sched_yield='pthread_yield()' ;;
10524 set try -DPTHREAD_YIELD_NULL
10525 if eval $compile; then
10527 case "$sched_yield" in
10528 '') sched_yield='pthread_yield(NULL)' ;;
10534 case "$usethreads" in
10537 $define) echo 'pthread_yield() found.' >&4 ;;
10538 *) echo 'pthread_yield() NOT found.' >&4 ;;
10542 set d_pthread_yield
10545 case "$sched_yield" in
10546 '') sched_yield=undef ;;
10551 : see if this is a pwd.h system
10557 xxx=`./findhdr pwd.h`
10558 $cppstdin $cppflags $cppminus < $xxx >$$.h
10560 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
10568 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
10576 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
10584 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
10592 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
10600 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
10608 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
10616 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
10628 set d_pwquota; eval $setvar
10629 set d_pwage; eval $setvar
10630 set d_pwchange; eval $setvar
10631 set d_pwclass; eval $setvar
10632 set d_pwexpire; eval $setvar
10633 set d_pwcomment; eval $setvar
10634 set d_pwgecos; eval $setvar
10635 set d_pwpasswd; eval $setvar
10639 : see if readdir and friends exist
10640 set readdir d_readdir
10642 set seekdir d_seekdir
10644 set telldir d_telldir
10646 set rewinddir d_rewinddir
10649 : see if readlink exists
10650 set readlink d_readlink
10653 : see if rename exists
10654 set rename d_rename
10657 : see if rmdir exists
10661 : see if memory.h is available.
10666 : See if it conflicts with string.h
10672 $cppstdin $cppflags $cppminus < $strings > mem.h
10673 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
10675 echo "We won't be including <memory.h>."
10685 : can bcopy handle overlapping blocks?
10690 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
10692 #$i_memory I_MEMORY
10693 #$i_stdlib I_STDLIB
10694 #$i_string I_STRING
10695 #$i_unistd I_UNISTD
10697 $cat >>try.c <<'EOCP'
10700 # include <memory.h>
10703 # include <stdlib.h>
10706 # include <string.h>
10708 # include <strings.h>
10711 # include <unistd.h> /* Needed for NetBSD */
10715 char buf[128], abc[128];
10721 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
10723 for (align = 7; align >= 0; align--) {
10724 for (len = 36; len; len--) {
10726 bcopy(abc, b, len);
10727 for (off = 1; off <= len; off++) {
10728 bcopy(b, b+off, len);
10729 bcopy(b+off, b, len);
10730 if (bcmp(b, abc, len))
10739 if eval $compile_ok; then
10740 if ./try 2>/dev/null; then
10741 echo "Yes, it can."
10744 echo "It can't, sorry."
10745 case "$d_memmove" in
10746 "$define") echo "But that's Ok since you have memmove()." ;;
10750 echo "(I can't compile the test program, so we'll assume not...)"
10751 case "$d_memmove" in
10752 "$define") echo "But that's Ok since you have memmove()." ;;
10757 $rm -f try.* try core
10761 : can memcpy handle overlapping blocks?
10763 case "$d_memcpy" in
10766 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
10768 #$i_memory I_MEMORY
10769 #$i_stdlib I_STDLIB
10770 #$i_string I_STRING
10771 #$i_unistd I_UNISTD
10773 $cat >>try.c <<'EOCP'
10776 # include <memory.h>
10779 # include <stdlib.h>
10782 # include <string.h>
10784 # include <strings.h>
10787 # include <unistd.h> /* Needed for NetBSD */
10791 char buf[128], abc[128];
10797 /* Copy "abcde..." string to char abc[] so that gcc doesn't
10798 try to store the string in read-only memory. */
10799 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
10801 for (align = 7; align >= 0; align--) {
10802 for (len = 36; len; len--) {
10804 memcpy(b, abc, len);
10805 for (off = 1; off <= len; off++) {
10806 memcpy(b+off, b, len);
10807 memcpy(b, b+off, len);
10808 if (memcmp(b, abc, len))
10817 if eval $compile_ok; then
10818 if ./try 2>/dev/null; then
10819 echo "Yes, it can."
10822 echo "It can't, sorry."
10823 case "$d_memmove" in
10824 "$define") echo "But that's Ok since you have memmove()." ;;
10828 echo "(I can't compile the test program, so we'll assume not...)"
10829 case "$d_memmove" in
10830 "$define") echo "But that's Ok since you have memmove()." ;;
10835 $rm -f try.* try core
10839 : can memcmp be trusted to compare relative magnitude?
10841 case "$d_memcmp" in
10844 echo "Checking if your memcmp() can compare relative magnitude..." >&4
10846 #$i_memory I_MEMORY
10847 #$i_stdlib I_STDLIB
10848 #$i_string I_STRING
10849 #$i_unistd I_UNISTD
10851 $cat >>try.c <<'EOCP'
10854 # include <memory.h>
10857 # include <stdlib.h>
10860 # include <string.h>
10862 # include <strings.h>
10865 # include <unistd.h> /* Needed for NetBSD */
10871 if ((a < b) && memcmp(&a, &b, 1) < 0)
10877 if eval $compile_ok; then
10878 if ./try 2>/dev/null; then
10879 echo "Yes, it can."
10882 echo "No, it can't (it uses signed chars)."
10885 echo "(I can't compile the test program, so we'll assume not...)"
10889 $rm -f try.* try core
10893 : see if select exists
10894 set select d_select
10897 : see if semctl exists
10898 set semctl d_semctl
10901 : see if semget exists
10902 set semget d_semget
10905 : see if semop exists
10909 : see how much of the 'sem*(2)' library is present.
10912 case "$d_semctl$d_semget$d_semop" in
10913 *"$undef"*) h_sem=false;;
10917 case "`ipcs 2>&1`" in
10918 "SVID messages"*"not configured"*)
10919 echo "Your $osname does not have the sem*(2) configured." >&4
10922 set semctl d_semctl
10924 set semget d_semget
10932 : we could also check for sys/ipc.h ...
10933 if $h_sem && $test `./findhdr sys/sem.h`; then
10934 echo "You have the full sem*(2) library." >&4
10937 echo "You don't have the full sem*(2) library." >&4
10943 : see whether sys/sem.h defines union semun
10945 $cat > try.c <<'END'
10946 #include <sys/types.h>
10947 #include <sys/ipc.h>
10948 #include <sys/sem.h>
10949 int main () { union semun semun; semun.buf = 0; }
10952 if eval $compile; then
10953 echo "You have union semun in <sys/sem.h>." >&4
10956 echo "You do not have union semun in <sys/sem.h>." >&4
10959 $rm -f try try.c try.h
10963 : see how to do semctl IPC_STAT
10966 : see whether semctl IPC_STAT can use union semun
10971 # define S_IRUSR S_IREAD
10972 # define S_IWUSR S_IWRITE
10973 # define S_IXUSR S_IEXEC
10975 # define S_IRUSR 0400
10976 # define S_IWUSR 0200
10977 # define S_IXUSR 0100
10979 # define S_IRGRP (S_IRUSR>>3)
10980 # define S_IWGRP (S_IWUSR>>3)
10981 # define S_IXGRP (S_IXUSR>>3)
10982 # define S_IROTH (S_IRUSR>>6)
10983 # define S_IWOTH (S_IWUSR>>6)
10984 # define S_IXOTH (S_IXUSR>>6)
10987 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
10988 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
10989 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
10994 #include <sys/types.h>
10995 #include <sys/ipc.h>
10996 #include <sys/sem.h>
10997 #include <sys/stat.h>
11004 #$d_union_semun HAS_UNION_SEMUN
11007 #ifndef HAS_UNION_SEMUN
11010 struct semid_ds *buf;
11011 unsigned short *array;
11017 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
11018 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
11020 struct semid_ds argbuf;
11023 st = semctl(sem, 0, IPC_STAT, arg);
11027 # endif /* IPC_STAT */
11028 printf("semctl IPC_STAT failed: errno = %d\n", errno);
11030 if (semctl(sem, 0, IPC_RMID, arg) != 0)
11031 # endif /* IPC_RMID */
11032 printf("semctl IPC_RMID failed: errno = %d\n", errno);
11034 #endif /* IPC_PRIVATE && ... */
11035 printf("semget failed: errno = %d\n", errno);
11041 if eval $compile; then
11044 semun) val="$define" ;;
11050 case "$d_semctl_semun" in
11052 echo "You can use union semun for semctl IPC_STAT." >&4
11055 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
11060 : see whether semctl IPC_STAT can use struct semid_ds pointer
11061 $cat > try.c <<'END'
11062 #include <sys/types.h>
11063 #include <sys/ipc.h>
11064 #include <sys/sem.h>
11065 #include <sys/stat.h>
11073 struct semid_ds arg;
11076 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
11077 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
11080 st = semctl(sem, 0, IPC_STAT, &arg);
11082 printf("semid_ds\n");
11084 # endif /* IPC_STAT */
11085 printf("semctl IPC_STAT failed: errno = %d\n", errno);
11087 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
11088 # endif /* IPC_RMID */
11089 printf("semctl IPC_RMID failed: errno = %d\n", errno);
11091 #endif /* IPC_PRIVATE && ... */
11092 printf("semget failed: errno = %d\n", errno);
11099 if eval $compile; then
11102 semid_ds) val="$define" ;;
11106 set d_semctl_semid_ds
11108 case "$d_semctl_semid_ds" in
11110 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
11112 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
11119 # We do not have the full sem*(2) library, so assume we can not
11125 set d_semctl_semid_ds
11130 : see if setegid exists
11131 set setegid d_setegid
11134 : see if seteuid exists
11135 set seteuid d_seteuid
11138 : see if setgrent exists
11139 set setgrent d_setgrent
11142 : see if sethostent exists
11143 set sethostent d_sethent
11146 : see if setlinebuf exists
11147 set setlinebuf d_setlinebuf
11150 : see if setlocale exists
11151 set setlocale d_setlocale
11154 : see if setnetent exists
11155 set setnetent d_setnent
11158 : see if setprotoent exists
11159 set setprotoent d_setpent
11162 : see if setpgid exists
11163 set setpgid d_setpgid
11166 : see if setpgrp2 exists
11167 set setpgrp2 d_setpgrp2
11170 : see if setpriority exists
11171 set setpriority d_setprior
11174 : see if setproctitle exists
11175 set setproctitle d_setproctitle
11178 : see if setpwent exists
11179 set setpwent d_setpwent
11182 : see if setregid exists
11183 set setregid d_setregid
11185 set setresgid d_setresgid
11188 : see if setreuid exists
11189 set setreuid d_setreuid
11191 set setresuid d_setresuid
11194 : see if setrgid exists
11195 set setrgid d_setrgid
11198 : see if setruid exists
11199 set setruid d_setruid
11202 : see if setservent exists
11203 set setservent d_setsent
11206 : see if setsid exists
11207 set setsid d_setsid
11210 : see if setvbuf exists
11211 set setvbuf d_setvbuf
11214 : see if sfio.h is available
11219 : see if sfio library is available
11230 : Ok, but do we want to use it.
11234 true|$define|[yY]*) dflt='y';;
11237 echo "$package can use the sfio library, but it is experimental."
11238 case "$useperlio" in
11240 echo "For sfio also the PerlIO abstraction layer is needed."
11241 echo "Earlier you said you wouldn't want that."
11244 rp="You seem to have sfio available, do you want to try using it?"
11247 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
11248 useperlio="$define"
11251 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
11253 : Remove sfio from list of libraries to use
11254 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
11257 echo "libs = $libs" >&4
11261 *) case "$usesfio" in
11262 true|$define|[yY]*)
11263 echo "Sorry, cannot find sfio on this machine." >&4
11264 echo "Ignoring your setting of usesfio=$usesfio." >&4
11273 $define) usesfio='true';;
11274 *) usesfio='false';;
11277 : see if shmctl exists
11278 set shmctl d_shmctl
11281 : see if shmget exists
11282 set shmget d_shmget
11285 : see if shmat exists
11288 : see what shmat returns
11291 $cat >shmat.c <<'END'
11292 #include <sys/shm.h>
11295 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
11300 echo "and it returns ($shmattype)." >&4
11301 : see if a prototype for shmat is available
11302 xxx=`./findhdr sys/shm.h`
11303 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
11304 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
11315 set d_shmatprototype
11318 : see if shmdt exists
11322 : see how much of the 'shm*(2)' library is present.
11325 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
11326 *"$undef"*) h_shm=false;;
11330 case "`ipcs 2>&1`" in
11331 "SVID shared memory"*"not configured"*)
11332 echo "Your $osname does not have the shm*(2) configured." >&4
11335 set shmctl d_shmctl
11337 set shmget d_shmget
11347 : we could also check for sys/ipc.h ...
11348 if $h_shm && $test `./findhdr sys/shm.h`; then
11349 echo "You have the full shm*(2) library." >&4
11352 echo "You don't have the full shm*(2) library." >&4
11359 : see if we have sigaction
11360 if set sigaction val -f d_sigaction; eval $csym; $val; then
11361 echo 'sigaction() found.' >&4
11362 $cat > try.c <<'EOP'
11364 #include <sys/types.h>
11365 #include <signal.h>
11368 struct sigaction act, oact;
11370 oact.sa_handler = 0;
11371 /* so that act and oact are used */
11372 exit(act.sa_flags == 0 && oact.sa_handler == 0);
11376 if eval $compile_ok; then
11379 echo "But you don't seem to have a useable struct sigaction." >&4
11383 echo 'sigaction NOT found.' >&4
11386 set d_sigaction; eval $setvar
11387 $rm -f try try$_o try.c
11389 : see if sigsetjmp exists
11391 case "$d_sigsetjmp" in
11393 $cat >try.c <<'EOP'
11394 #include <setjmp.h>
11399 if (sigsetjmp(env,1))
11402 siglongjmp(env, 1);
11407 if eval $compile; then
11408 if ./try >/dev/null 2>&1; then
11409 echo "POSIX sigsetjmp found." >&4
11413 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
11419 echo "sigsetjmp not found." >&4
11423 *) val="$d_sigsetjmp"
11424 case "$d_sigsetjmp" in
11425 $define) echo "POSIX sigsetjmp found." >&4;;
11426 $undef) echo "sigsetjmp not found." >&4;;
11434 : see if socks5_init exists
11435 set socks5_init d_socks5_init
11438 : see if sys/stat.h is available
11439 set sys/stat.h i_sysstat
11443 : see if stat knows about block sizes
11445 echo "Checking to see if your struct stat has st_blocks field..." >&4
11446 set d_statblks stat st_blocks $i_sysstat sys/stat.h
11450 : see if this is a sys/vfs.h system
11451 set sys/vfs.h i_sysvfs
11455 : see if this is a sys/statfs.h system
11456 set sys/statfs.h i_sysstatfs
11461 echo "Checking to see if your system supports struct statfs..." >&4
11462 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
11464 case "$d_statfs_s" in
11465 "$define") echo "Yes, it does." ;;
11466 *) echo "No, it doesn't." ;;
11471 : see if struct statfs knows about f_flags
11472 case "$d_statfs_s" in
11475 echo "Checking to see if your struct statfs has f_flags field..." >&4
11476 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
11480 set d_statfs_f_flags
11484 case "$d_statfs_f_flags" in
11485 "$define") echo "Yes, it does." ;;
11486 *) echo "No, it doesn't." ;;
11489 : see if _ptr and _cnt from stdio act std
11492 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
11493 echo "(Looks like you have stdio.h from BSD.)"
11494 case "$stdio_ptr" in
11495 '') stdio_ptr='((fp)->_p)'
11498 *) ptr_lval=$d_stdio_ptr_lval;;
11500 case "$stdio_cnt" in
11501 '') stdio_cnt='((fp)->_r)'
11504 *) cnt_lval=$d_stdio_cnt_lval;;
11506 case "$stdio_base" in
11507 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
11509 case "$stdio_bufsiz" in
11510 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
11512 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
11513 echo "(Looks like you have stdio.h from Linux.)"
11514 case "$stdio_ptr" in
11515 '') stdio_ptr='((fp)->_IO_read_ptr)'
11518 *) ptr_lval=$d_stdio_ptr_lval;;
11520 case "$stdio_cnt" in
11521 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
11524 *) cnt_lval=$d_stdio_cnt_lval;;
11526 case "$stdio_base" in
11527 '') stdio_base='((fp)->_IO_read_base)';;
11529 case "$stdio_bufsiz" in
11530 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
11533 case "$stdio_ptr" in
11534 '') stdio_ptr='((fp)->_ptr)'
11537 *) ptr_lval=$d_stdio_ptr_lval;;
11539 case "$stdio_cnt" in
11540 '') stdio_cnt='((fp)->_cnt)'
11543 *) cnt_lval=$d_stdio_cnt_lval;;
11545 case "$stdio_base" in
11546 '') stdio_base='((fp)->_base)';;
11548 case "$stdio_bufsiz" in
11549 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
11553 : test whether _ptr and _cnt really work
11554 echo "Checking how std your stdio is..." >&4
11557 #define FILE_ptr(fp) $stdio_ptr
11558 #define FILE_cnt(fp) $stdio_cnt
11560 FILE *fp = fopen("try.c", "r");
11563 18 <= FILE_cnt(fp) &&
11564 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
11572 if eval $compile; then
11574 echo "Your stdio acts pretty std."
11577 echo "Your stdio isn't very std."
11580 echo "Your stdio doesn't appear very std."
11586 : Can _ptr be used as an lvalue?
11587 case "$d_stdstdio$ptr_lval" in
11588 $define$define) val=$define ;;
11591 set d_stdio_ptr_lval
11594 : Can _cnt be used as an lvalue?
11595 case "$d_stdstdio$cnt_lval" in
11596 $define$define) val=$define ;;
11599 set d_stdio_cnt_lval
11603 : test whether setting _ptr sets _cnt as a side effect
11604 d_stdio_ptr_lval_sets_cnt="$undef"
11605 d_stdio_ptr_lval_nochange_cnt="$undef"
11606 case "$d_stdio_ptr_lval$d_stdstdio" in
11608 echo "Checking to see what happens if we set the stdio ptr..." >&4
11611 /* Can we scream? */
11612 /* Eat dust sed :-) */
11613 /* In the buffer space, no one can hear you scream. */
11614 #define FILE_ptr(fp) $stdio_ptr
11615 #define FILE_cnt(fp) $stdio_cnt
11616 #include <sys/types.h>
11618 FILE *fp = fopen("try.c", "r");
11623 puts("Fail even to read");
11626 c = getc(fp); /* Read away the first # */
11628 puts("Fail even to read");
11632 18 <= FILE_cnt(fp) &&
11633 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
11635 puts("Fail even to read");
11638 ptr = (char*) FILE_ptr(fp);
11639 cnt = (size_t)FILE_cnt(fp);
11641 FILE_ptr(fp) += 42;
11643 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
11644 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
11647 if (FILE_cnt(fp) <= 20) {
11648 printf ("Fail (<20 chars to test)");
11651 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
11652 puts("Fail compare");
11655 if (cnt == FILE_cnt(fp)) {
11656 puts("Pass_unchanged");
11659 if (FILE_cnt(fp) == (cnt - 42)) {
11660 puts("Pass_changed");
11663 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
11669 if eval $compile; then
11670 case `./try$exe_ext` in
11672 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
11673 d_stdio_ptr_lval_sets_cnt="$define" ;;
11675 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
11676 d_stdio_ptr_lval_nochange_cnt="$define" ;;
11678 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
11680 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
11683 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
11689 : see if _base is also standard
11691 case "$d_stdstdio" in
11695 #define FILE_base(fp) $stdio_base
11696 #define FILE_bufsiz(fp) $stdio_bufsiz
11698 FILE *fp = fopen("try.c", "r");
11701 19 <= FILE_bufsiz(fp) &&
11702 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
11709 if eval $compile; then
11711 echo "And its _base field acts std."
11714 echo "But its _base field isn't std."
11717 echo "However, it seems to be lacking the _base field."
11726 Checking how to access stdio streams by file descriptor number...
11728 case "$stdio_stream_array" in
11729 '') $cat >try.c <<EOCP
11732 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
11736 for s in _iob __iob __sF
11738 set try -DSTDIO_STREAM_ARRAY=$s
11739 if eval $compile; then
11740 case "`./try$exe_ext`" in
11741 yes) stdio_stream_array=$s; break ;;
11745 $rm -f try.* try$exe_ext
11747 case "$stdio_stream_array" in
11749 I can't figure out how to access stdio streams by file descriptor number.
11751 d_stdio_stream_array="$undef"
11754 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
11756 d_stdio_stream_array="$define"
11760 : see if strcoll exists
11761 set strcoll d_strcoll
11764 : check for structure copying
11766 echo "Checking to see if your C compiler can copy structs..." >&4
11767 $cat >try.c <<'EOCP'
11777 if $cc -c try.c >/dev/null 2>&1 ; then
11779 echo "Yup, it can."
11782 echo "Nope, it can't."
11788 : see if strerror and/or sys_errlist[] exist
11790 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
11791 if set strerror val -f d_strerror; eval $csym; $val; then
11792 echo 'strerror() found.' >&4
11793 d_strerror="$define"
11794 d_strerrm='strerror(e)'
11795 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
11796 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
11797 d_syserrlst="$define"
11799 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
11800 d_syserrlst="$undef"
11802 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
11803 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
11804 echo 'strerror() found in string header.' >&4
11805 d_strerror="$define"
11806 d_strerrm='strerror(e)'
11807 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
11808 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
11809 d_syserrlst="$define"
11811 echo "(You don't appear to have any sys_errlist[], how can this be?)"
11812 d_syserrlst="$undef"
11814 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
11815 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
11816 d_strerror="$undef"
11817 d_syserrlst="$define"
11818 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
11820 echo 'strerror() and sys_errlist[] NOT found.' >&4
11821 d_strerror="$undef"
11822 d_syserrlst="$undef"
11823 d_strerrm='"unknown"'
11827 : see if strtod exists
11828 set strtod d_strtod
11831 : see if strtol exists
11832 set strtol d_strtol
11835 : see if strtold exists
11836 set strtold d_strtold
11839 : see if strtoll exists
11840 set strtoll d_strtoll
11843 case "$d_longlong-$d_strtoll" in
11846 Checking whether your strtoll() works okay...
11848 $cat >try.c <<'EOCP'
11851 #define strtoll __strtoll
11854 #define strtoll _strtoll
11857 extern long long int strtoll(char *s, char **, int);
11858 static int bad = 0;
11859 int check(char *s, long long ell, int een) {
11862 gll = strtoll(s, 0, 10);
11863 if (!((gll == ell) && (errno == een)))
11867 check(" 1", 1LL, 0);
11868 check(" 0", 0LL, 0);
11869 check("-1", -1LL, 0);
11870 check("-9223372036854775808", -9223372036854775808LL, 0);
11871 check("-9223372036854775808", -9223372036854775808LL, 0);
11872 check(" 9223372036854775807", 9223372036854775807LL, 0);
11873 check("-9223372036854775808", -9223372036854775808LL, 0);
11874 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
11875 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
11881 if eval $compile; then
11884 ok) echo "Your strtoll() seems to be working okay." ;;
11886 Your strtoll() doesn't seem to be working okay.
11892 echo "(I can't seem to compile the test program--assuming it doesn't)"
11898 : see if strtoul exists
11899 set strtoul d_strtoul
11902 : see if strtoull exists
11903 set strtoull d_strtoull
11906 case "$d_longlong-$d_strtoull" in
11909 Checking whether your strtoull() works okay...
11911 $cat >try.c <<'EOCP'
11914 #define strtoull __strtoull
11917 extern unsigned long long int strtoull(char *s, char **, int);
11918 static int bad = 0;
11919 int check(char *s, long long eull, int een) {
11922 gull = strtoull(s, 0, 10);
11923 if (!((gull == eull) && (errno == een)))
11927 check(" 1", 1LL, 0);
11928 check(" 0", 0LL, 0);
11929 check("18446744073709551615", 18446744073709551615ULL, 0);
11930 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
11936 if eval $compile; then
11938 ok) echo "Your strtoull() seems to be working okay." ;;
11940 Your strtoull() doesn't seem to be working okay.
11942 d_strtoull="$undef"
11949 : see if strtouq exists
11950 set strtouq d_strtouq
11953 : see if strxfrm exists
11954 set strxfrm d_strxfrm
11957 : see if symlink exists
11958 set symlink d_symlink
11961 : see if syscall exists
11962 set syscall d_syscall
11965 : see if sysconf exists
11966 set sysconf d_sysconf
11969 : see if system exists
11970 set system d_system
11973 : see if tcgetpgrp exists
11974 set tcgetpgrp d_tcgetpgrp
11977 : see if tcsetpgrp exists
11978 set tcsetpgrp d_tcsetpgrp
11981 : see if prototype for telldir is available
11983 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
11986 : see if this is a sys/times.h system
11987 set sys/times.h i_systimes
11990 : see if times exists
11992 if set times val -f d_times; eval $csym; $val; then
11993 echo 'times() found.' >&4
11996 case "$i_systimes" in
11997 "$define") inc='sys/times.h';;
11999 rp="What is the type returned by times() on this system?"
12000 set clock_t clocktype long stdio.h sys/types.h $inc
12003 echo 'times() NOT found, hope that will do.' >&4
12008 : see if truncate exists
12009 set truncate d_truncate
12012 : see if tzname[] exists
12014 if set tzname val -a d_tzname; eval $csym; $val; then
12016 echo 'tzname[] found.' >&4
12019 echo 'tzname[] NOT found.' >&4
12024 : see if umask exists
12028 : see if ustat exists
12032 : backward compatibility for d_hvfork
12033 if test X$d_hvfork != X; then
12034 d_vfork="$d_hvfork"
12037 : see if there is a vfork
12042 : Ok, but do we want to use it. vfork is reportedly unreliable in
12043 : perl on Solaris 2.x, and probably elsewhere.
12047 case "$usevfork" in
12053 Perl can only use a vfork() that doesn't suffer from strict
12054 restrictions on calling functions or modifying global data in
12055 the child. For example, glibc-2.1 contains such a vfork()
12056 that is unsuitable. If your system provides a proper fork()
12057 call, chances are that you do NOT want perl to use vfork().
12060 rp="Do you still want to use vfork()?"
12065 echo "Ok, we won't use vfork()."
12074 $define) usevfork='true';;
12075 *) usevfork='false';;
12078 : see if this is an sysdir system
12079 set sys/dir.h i_sysdir
12082 : see if this is an sysndir system
12083 set sys/ndir.h i_sysndir
12086 : see if closedir exists
12087 set closedir d_closedir
12090 case "$d_closedir" in
12093 echo "Checking whether closedir() returns a status..." >&4
12094 cat > closedir.c <<EOM
12095 #$i_dirent I_DIRENT /**/
12096 #$i_sysdir I_SYS_DIR /**/
12097 #$i_sysndir I_SYS_NDIR /**/
12098 #$i_systypes I_SYS_TYPES /**/
12100 #if defined(I_SYS_TYPES)
12101 #include <sys/types.h>
12103 #if defined(I_DIRENT)
12104 #include <dirent.h>
12105 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
12106 #include <sys/dir.h>
12110 #include <sys/ndir.h>
12114 #include <ndir.h> /* may be wrong in the future */
12116 #include <sys/dir.h>
12121 int main() { return closedir(opendir(".")); }
12124 if eval $compile_ok; then
12125 if ./closedir > /dev/null 2>&1 ; then
12126 echo "Yes, it does."
12129 echo "No, it doesn't."
12133 echo "(I can't seem to compile the test program--assuming it doesn't)"
12141 set d_void_closedir
12144 : see if there is a wait4
12148 : see if waitpid exists
12149 set waitpid d_waitpid
12152 : see if wcstombs exists
12153 set wcstombs d_wcstombs
12156 : see if wctomb exists
12157 set wctomb d_wctomb
12160 : preserve RCS keywords in files with variable substitution, grrr
12165 Revision='$Revision'
12167 case "$crosscompile" in
12168 ''|[nN]*) crosscompile="$undef" ;;
12172 next|rhapsody|darwin) multiarch="$define" ;;
12174 case "$multiarch" in
12175 ''|[nN]*) multiarch="$undef" ;;
12178 : check for alignment requirements
12180 case "$crosscompile$multiarch" in
12183 You seem to be either cross-compiling or doing a multiarchitecture build,
12184 skipping the memory alignment check.
12187 case "$alignbytes" in
12188 '') alignbytes=8 ;;
12192 case "$alignbytes" in
12193 '') echo "Checking alignment constraints..." >&4
12194 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
12195 $cat >try.c <<'EOCP'
12196 typedef long double NV;
12199 $cat >try.c <<'EOCP'
12203 $cat >>try.c <<'EOCP'
12211 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
12216 if eval $compile_ok; then
12220 echo "(I can't seem to compile the test program...)"
12223 *) dflt="$alignbytes"
12226 rp="Doubles must be aligned on a how-many-byte boundary?"
12234 : set the base revision
12237 : check for ordering of bytes in a long
12239 case "$crosscompile$multiarch" in
12242 You seem to be either cross-compiling or doing a multiarchitecture build,
12243 skipping the byteorder check.
12249 case "$byteorder" in
12252 In the following, larger digits indicate more significance. A big-endian
12253 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
12254 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
12255 machines may have weird orders like 3412. A Cray will report 87654321,
12256 an Alpha will report 12345678. If the test program works the default is
12258 I'm now running the test program...
12260 $cat >try.c <<'EOCP'
12267 char c[sizeof(long)];
12270 if (sizeof(long) > 4)
12271 u.l = (0x08070605L << 32) | 0x04030201L;
12274 for (i = 0; i < sizeof(long); i++)
12275 printf("%c", u.c[i]+'0');
12282 if eval $compile && ./try > /dev/null; then
12285 [1-4][1-4][1-4][1-4]|12345678|87654321)
12286 echo "(The test program ran ok.)"
12287 echo "byteorder=$dflt"
12290 ????|????????) echo "(The test program ran ok.)" ;;
12291 *) echo "(The test program didn't run right for some reason.)" ;;
12296 (I can't seem to compile the test program. Guessing big-endian...)
12299 case "$xxx_prompt" in
12301 rp="What is the order of bytes in a long?"
12315 : how do we catenate cpp tokens here?
12317 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
12318 $cat >cpp_stuff.c <<'EOCP'
12319 #define RCAT(a,b)a/**/b
12320 #define ACAT(a,b)a ## b
12324 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
12325 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
12326 echo "Oh! Smells like ANSI's been here." >&4
12327 echo "We can catify or stringify, separately or together!"
12329 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
12330 echo "Ah, yes! The good old days!" >&4
12331 echo "However, in the good old days we don't know how to stringify and"
12332 echo "catify at the same time."
12336 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
12337 to have to edit the values of CAT[2-5] in config.h...
12339 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
12343 : see if this is a db.h system
12349 : Check db version.
12351 echo "Checking Berkeley DB version ..." >&4
12357 #include <sys/types.h>
12362 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
12363 int Major, Minor, Patch ;
12364 unsigned long Version ;
12365 (void)db_version(&Major, &Minor, &Patch) ;
12366 printf("You have Berkeley DB Version 2 or greater\n");
12368 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
12369 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
12370 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
12371 Major, Minor, Patch) ;
12373 /* check that db.h & libdb are compatible */
12374 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
12375 printf("db.h and libdb are incompatible\n") ;
12379 printf("db.h and libdb are compatible\n") ;
12381 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
12382 + DB_VERSION_PATCH ;
12384 /* needs to be >= 2.3.4 */
12385 if (Version < 2003004) {
12386 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
12387 printf("but Perl needs Berkeley DB 2.3.4 or greater\n") ;
12393 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
12394 printf("You have Berkeley DB Version 1\n");
12395 exit(0); /* DB version < 2: the coast is clear. */
12397 exit(1); /* <db.h> not Berkeley DB? */
12403 if eval $compile_ok && ./try; then
12404 echo 'Looks OK.' >&4
12406 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
12410 : Remove db from list of libraries to use
12411 echo "Removing unusable -ldb from library list" >&4
12412 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
12415 echo "libs = $libs" >&4
12425 : Check the return type needed for hash
12427 echo "Checking return type needed for hash for Berkeley DB ..." >&4
12433 #include <sys/types.h>
12436 #ifndef DB_VERSION_MAJOR
12437 u_int32_t hash_cb (ptr, size)
12445 info.hash = hash_cb;
12449 if $cc $ccflags -c try.c >try.out 2>&1 ; then
12450 if $contains warning try.out >>/dev/null 2>&1 ; then
12453 db_hashtype='u_int32_t'
12456 : XXX Maybe we should just give up here.
12457 db_hashtype=u_int32_t
12459 echo "Help: I can't seem to compile the db test program." >&4
12460 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
12463 echo "Your version of Berkeley DB uses $db_hashtype for hash."
12465 *) db_hashtype=u_int32_t
12470 : Check the return type needed for prefix
12472 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
12478 #include <sys/types.h>
12481 #ifndef DB_VERSION_MAJOR
12482 size_t prefix_cb (key1, key2)
12490 info.prefix = prefix_cb;
12494 if $cc $ccflags -c try.c >try.out 2>&1 ; then
12495 if $contains warning try.out >>/dev/null 2>&1 ; then
12496 db_prefixtype='int'
12498 db_prefixtype='size_t'
12501 db_prefixtype='size_t'
12502 : XXX Maybe we should just give up here.
12504 echo "Help: I can't seem to compile the db test program." >&4
12505 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
12508 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
12510 *) db_prefixtype='size_t'
12514 : check for void type
12516 echo "Checking to see how well your C compiler groks the void type..." >&4
12517 case "$voidflags" in
12519 $cat >try.c <<'EOCP'
12525 extern void moo(); /* function returning void */
12526 void (*goo)(); /* ptr to func returning void */
12528 void *hue; /* generic ptr */
12541 int main() { sub(); }
12543 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
12544 voidflags=$defvoidused
12545 echo "Good. It appears to support void to the level $package wants.">&4
12546 if $contains warning .out >/dev/null 2>&1; then
12547 echo "However, you might get some warnings that look like this:"
12551 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
12552 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
12553 echo "It supports 1..."
12554 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
12555 echo "It also supports 2..."
12556 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
12558 echo "And it supports 4 but not 8 definitely."
12560 echo "It doesn't support 4..."
12561 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
12563 echo "But it supports 8."
12566 echo "Neither does it support 8."
12570 echo "It does not support 2..."
12571 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
12573 echo "But it supports 4 and 8."
12575 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
12577 echo "And it supports 4 but has not heard about 8."
12579 echo "However it supports 8 but not 4."
12584 echo "There is no support at all for void."
12589 case "$voidflags" in
12591 *) $cat >&4 <<'EOM'
12592 Support flag bits are:
12593 1: basic void declarations.
12594 2: arrays of pointers to functions returning void.
12595 4: operations between pointers to and addresses of void functions.
12596 8: generic void pointers.
12599 rp="Your void support flags add up to what?"
12607 : How can we generate normalized random numbers ?
12609 echo "Looking for a random number function..." >&4
12610 case "$randfunc" in
12612 if set drand48 val -f; eval $csym; $val; then
12614 echo "Good, found drand48()." >&4
12615 elif set random val -f; eval $csym; $val; then
12617 echo "OK, found random()." >&4
12620 echo "Yick, looks like I have to use rand()." >&4
12631 *-Dmy_rand=*|*-Dmy_srand=*)
12632 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
12633 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
12634 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
12635 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
12639 while $test "$cont"; do
12640 rp="Use which function to generate random numbers?"
12642 if $test "$ans" = "$dflt"; then
12648 if set $ans val -f; eval $csym; $val; then
12652 rp="I cannot find function $ans. Use that name anyway?"
12661 case "$randfunc" in
12663 drand01="drand48()"
12669 case "$randbits" in
12671 echo "Checking to see how many bits your $randfunc() function produces..." >&4
12673 #$i_unistd I_UNISTD
12674 #$i_stdlib I_STDLIB
12677 # include <unistd.h>
12680 # include <stdlib.h>
12685 register unsigned long tmp;
12686 register unsigned long max = 0L;
12688 for (i = 1000; i; i--) {
12689 tmp = (unsigned long) $randfunc();
12690 if (tmp > max) max = tmp;
12692 for (i = 0; max; i++)
12698 if eval $compile_ok; then
12702 echo "(I can't seem to compile the test program...)"
12709 rp="How many bits does your $randfunc() function produce?"
12713 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
12714 seedfunc="s$randfunc"
12715 randseedtype=unsigned
12719 rp="How many bits does your $randfunc() function produce?"
12722 seedfunc="s$randfunc"
12723 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
12724 if set $seedfunc val -f; eval $csym; $val; then
12725 echo "(Using $seedfunc() to seed random generator)"
12727 echo "(Warning: no $seedfunc() to seed random generator)"
12730 randseedtype=unsigned
12738 echo "Determining whether or not we are on an EBCDIC system..." >&4
12739 $cat >tebcdic.c <<'EOM'
12742 if ('M'==0xd4) return 0;
12749 if eval $compile_ok; then
12751 echo "You seem to speak EBCDIC." >&4
12754 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF8." >&4
12757 echo "I'm unable to compile the test program." >&4
12758 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
12760 $rm -f tebcdic.c tebcdic
12766 Checking how to flush all pending stdio output...
12768 # I only know how to find the first 32 possibly open files on SunOS.
12769 # See also hints/sunos_4_1.sh and util.c --AD
12771 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
12773 $cat >>try.c <<EOCP
12775 #$i_unistd I_UNISTD
12777 # include <unistd.h>
12779 #$d_sysconf HAS_SYSCONF
12780 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
12781 #ifdef HAS_STDIO_STREAM_ARRAY
12782 # define STDIO_STREAM_ARRAY $stdio_stream_array
12785 FILE* p = fopen("try.out", "w");
12789 # ifdef TRY_FPRINTF
12793 #ifdef TRY_FFLUSH_NULL
12796 #ifdef TRY_FFLUSH_ALL
12798 long open_max = -1;
12799 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
12800 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
12802 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
12803 open_max = sysconf(_SC_OPEN_MAX);
12806 open_max = FOPEN_MAX;
12809 open_max = OPEN_MAX;
12818 # ifdef HAS_STDIO_STREAM_ARRAY
12819 if (open_max > 0) {
12821 for (i = 0; i < open_max; i++)
12822 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
12823 STDIO_STREAM_ARRAY[i]._file < open_max &&
12824 STDIO_STREAM_ARRAY[i]._flag)
12825 fflush(&STDIO_STREAM_ARRAY[i]);
12833 : first we have to find out how _not_ to flush
12834 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
12836 set try -DTRY_FPUTC
12837 if eval $compile; then
12839 ./try$exe_ext 2>/dev/null
12840 if $test ! -s try.out -a "X$?" = X42; then
12846 set try -DTRY_FPRINTF
12848 if eval $compile; then
12850 ./try$exe_ext 2>/dev/null
12851 if $test ! -s try.out -a "X$?" = X42; then
12852 output=-DTRY_FPRINTF
12858 : check for fflush NULL behaviour
12859 case "$fflushNULL" in
12860 '') set try -DTRY_FFLUSH_NULL $output
12861 if eval $compile; then
12863 ./try$exe_ext 2>/dev/null
12865 if $test -s try.out -a "X$code" = X42; then
12866 fflushNULL="`$cat try.out`"
12868 if $test "X$code" != X42; then
12870 (If this test failed, don't worry, we'll try another method shortly.)
12875 $rm -f core try.core core.try.*
12876 case "$fflushNULL" in
12878 Your fflush(NULL) works okay for output streams.
12879 Let's see if it clobbers input pipes...
12881 # As of mid-March 2000 all versions of Solaris appear to have a stdio
12882 # bug that improperly flushes the input end of pipes. So we avoid the
12883 # autoflush on fork/system/exec support for now. :-(
12884 $cat >tryp.c <<EOCP
12887 main(int argc, char **argv)
12893 while ((i = getc(stdin)) != -1
12894 && (*bp++ = i) != '\n'
12895 && bp < &buf[1024])
12898 fprintf(stdout, "%s", buf);
12906 fflushNULL="$define"
12908 if eval $compile; then
12910 $cat tryp.c | ./tryp$exe_ext 2>/dev/null > tryp.out
12911 if cmp tryp.c tryp.out >/dev/null 2>&1; then
12913 fflush(NULL) seems to behave okay with input streams.
12915 fflushNULL="$define"
12918 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
12920 fflushNULL="$undef"
12923 $rm -f core tryp.c tryp.core core.tryp.*
12926 Your fflush(NULL) isn't working (contrary to ANSI C).
12928 fflushNULL="$undef"
12931 Cannot figure out whether your fflush(NULL) works or not.
12932 I'm assuming it doesn't (contrary to ANSI C).
12934 fflushNULL="$undef"
12938 $define|true|[yY]*)
12939 fflushNULL="$define"
12942 fflushNULL="$undef"
12945 : check explicit looping only if NULL did not work, and if the pipe
12946 : bug does not show up on an explicit flush too
12947 case "$fflushNULL" in
12949 $cat >tryp.c <<EOCP
12952 main(int argc, char **argv)
12958 while ((i = getc(stdin)) != -1
12959 && (*bp++ = i) != '\n'
12960 && bp < &buf[1024])
12963 fprintf(stdout, "%s", buf);
12972 if eval $compile; then
12974 $cat tryp.c | ./tryp$exe_ext 2>/dev/null > tryp.out
12975 if cmp tryp.c tryp.out >/dev/null 2>&1; then
12977 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
12979 : now check for fflushall behaviour
12980 case "$fflushall" in
12981 '') set try -DTRY_FFLUSH_ALL $output
12982 if eval $compile; then
12984 (Now testing the other method--but note that this also may fail.)
12987 ./try$exe_ext 2>/dev/null
12988 if $test -s try.out -a "X$?" = X42; then
12989 fflushall="`$cat try.out`"
12992 $rm -f core try.core core.try.*
12993 case "$fflushall" in
12995 Whew. Flushing explicitly all the stdio streams works.
12997 fflushall="$define"
13000 Sigh. Flushing explicitly all the stdio streams doesn't work.
13005 Cannot figure out whether flushing stdio streams explicitly works or not.
13006 I'm assuming it doesn't.
13012 "$define"|true|[yY]*)
13013 fflushall="$define"
13021 All is futile. Even fflush(stdin) clobbers input pipes!
13028 $rm -f core tryp.c tryp.core core.tryp.*
13030 *) fflushall="$undef"
13034 case "$fflushNULL$fflushall" in
13037 OK, I give up. I cannot figure out how to flush pending stdio output.
13038 We won't be flushing handles at all before fork/exec/popen.
13042 $rm -f try.* try$exe_ext
13044 : Store the full pathname to the ar program for use in the C program
13045 : Respect a hint or command line value for full_ar.
13050 : Store the full pathname to the sed program for use in the C program
13053 : see what type gids are declared as in the kernel
13055 echo "Looking for the type for group ids returned by getgid()."
13056 set gid_t gidtype xxx stdio.h sys/types.h
13060 xxx=`./findhdr sys/user.h`
13061 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
13063 unsigned) dflt="$1 $2" ;;
13067 *) dflt="$gidtype";;
13070 gid_t) echo "gid_t found." ;;
13071 *) rp="What is the type for group ids returned by getgid()?"
13079 *_t) zzz="$gidtype" ;;
13082 echo "Checking the size of $zzz..." >&4
13084 #include <sys/types.h>
13087 printf("%d\n", (int)sizeof($gidtype));
13092 if eval $compile_ok; then
13096 echo "(I can't execute the test program--guessing $gidsize.)" >&4
13099 echo "Your $zzz is $gidsize bytes long."
13104 echo "(I can't compile the test program--guessing $gidsize.)" >&4
13110 *_t) zzz="$gidtype" ;;
13113 echo "Checking the sign of $zzz..." >&4
13115 #include <sys/types.h>
13126 if eval $compile; then
13130 echo "(I can't execute the test program--guessing unsigned.)" >&4
13134 1) echo "Your $zzz is unsigned." ;;
13135 -1) echo "Your $zzz is signed." ;;
13141 echo "(I can't compile the test program--guessing unsigned.)" >&4
13147 if $test X"$quadtype" != X; then
13149 echo "Checking how to print 64-bit integers..." >&4
13151 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
13152 $cat >try.c <<'EOCP'
13153 #include <sys/types.h>
13156 int q = 12345678901;
13157 printf("%ld\n", q);
13161 if eval $compile; then
13162 yyy=`./try$exe_ext`
13165 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
13166 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
13167 echo "We will use %d."
13173 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
13174 $cat >try.c <<'EOCP'
13175 #include <sys/types.h>
13178 long q = 12345678901;
13179 printf("%ld\n", q);
13183 if eval $compile; then
13184 yyy=`./try$exe_ext`
13187 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
13188 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
13189 echo "We will use %ld."
13195 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
13196 $cat >try.c <<'EOCP'
13197 #include <sys/types.h>
13198 #include <inttypes.h>
13201 int64_t q = 12345678901;
13202 printf("%" PRId64 "\n", q);
13206 if eval $compile; then
13207 yyy=`./try$exe_ext`
13210 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
13211 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
13212 echo "We will use the C9X style."
13218 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
13219 $cat >try.c <<'EOCP'
13220 #include <sys/types.h>
13223 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
13224 printf("%lld\n", q);
13228 if eval $compile; then
13229 yyy=`./try$exe_ext`
13232 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
13233 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
13234 echo "We will use the %lld style."
13240 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
13242 #include <sys/types.h>
13245 $quadtype q = 12345678901;
13246 printf("%Ld\n", q);
13250 if eval $compile; then
13251 yyy=`./try$exe_ext`
13254 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
13255 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
13256 echo "We will use %Ld."
13262 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
13264 #include <sys/types.h>
13267 $quadtype q = 12345678901;
13268 printf("%qd\n", q);
13272 if eval $compile; then
13273 yyy=`./try$exe_ext`
13276 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
13277 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
13278 echo "We will use %qd."
13284 if $test X"$sPRId64" = X; then
13285 echo "Cannot figure out how to print 64-bit integers." >&4
13293 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
13294 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
13296 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
13297 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
13303 $echo "Checking the format strings to be used for Perl's internal types..." >&4
13305 if $test X"$ivsize" = X8; then
13306 ivdformat="$sPRId64"
13307 uvuformat="$sPRIu64"
13308 uvoformat="$sPRIo64"
13309 uvxformat="$sPRIx64"
13310 uvXUformat="$sPRIXU64"
13312 if $test X"$ivsize" = X"$longsize"; then
13319 if $test X"$ivsize" = X"$intsize"; then
13327 if $test X"$ivsize" = X"$shortsize"; then
13338 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
13339 nveformat="$sPRIeldbl"
13340 nvfformat="$sPRIfldbl"
13341 nvgformat="$sPRIgldbl"
13342 nvEUformat="$sPRIEUldbl"
13343 nvFUformat="$sPRIFUldbl"
13344 nvGUformat="$sPRIGUldbl"
13354 case "$ivdformat" in
13355 '') echo "$0: Fatal: failed to find format strings, cannot continue." >& 4
13362 $echo "Checking the format string to be used for gids..." >&4
13365 -1) if $test X"$gidsize" = X"$ivsize"; then
13366 gidformat="$ivdformat"
13368 if $test X"$gidsize" = X"$longsize"; then
13371 if $test X"$gidsize" = X"$intsize"; then
13374 if $test X"$gidsize" = X"$shortsize"; then
13381 *) if $test X"$gidsize" = X"$uvsize"; then
13382 gidformat="$uvuformat"
13384 if $test X"$gidsize" = X"$longsize"; then
13387 if $test X"$gidsize" = X"$intsize"; then
13390 if $test X"$gidsize" = X"$shortsize"; then
13399 : see if getgroups exists
13400 set getgroups d_getgrps
13403 : see if setgroups exists
13404 set setgroups d_setgrps
13408 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
13410 case "$d_getgrps$d_setgrps" in
13412 case "$groupstype" in
13413 '') dflt="$gidtype" ;;
13414 *) dflt="$groupstype" ;;
13417 What type of pointer is the second argument to getgroups() and setgroups()?
13418 Usually this is the same as group ids, $gidtype, but not always.
13421 rp='What type pointer is the second argument to getgroups() and setgroups()?'
13425 *) groupstype="$gidtype";;
13429 echo "Checking if your $make program sets \$(MAKE)..." >&4
13430 case "$make_set_make" in
13432 $sed 's/^X //' > testmake.mak << 'EOF'
13434 X @echo 'maketemp="$(MAKE)"'
13436 case "`$make -f testmake.mak 2>/dev/null`" in
13437 *maketemp=*) make_set_make='#' ;;
13438 *) make_set_make="MAKE=$make" ;;
13440 $rm -f testmake.mak
13443 case "$make_set_make" in
13444 '#') echo "Yup, it does.";;
13445 *) echo "Nope, it doesn't.";;
13448 : see what type is used for mode_t
13449 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
13450 set mode_t modetype int stdio.h sys/types.h
13453 : define a fucntion to check prototypes
13454 $cat > protochk <<EOSH
13457 optimize="$optimize"
13459 prototype="$prototype"
13464 $cat >> protochk <<'EOSH'
13469 while test $# -ge 2; do
13471 $define) echo "#include <$2>" >> try.c ;;
13472 literal) echo "$2" >> try.c ;;
13476 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
13477 cat >> try.c <<'EOCP'
13478 #ifdef CAN_PROTOTYPE
13479 #define _(args) args
13484 echo "$foo" >> try.c
13485 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
13486 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
13492 $eunicefix protochk
13494 : see what type is used for size_t
13495 rp="What is the type used for the length parameter for string functions?"
13496 set size_t sizetype 'unsigned int' stdio.h sys/types.h
13499 : check for type of arguments to gethostbyaddr.
13500 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
13501 case "$d_gethbyaddr" in
13505 Checking to see what type of arguments are accepted by gethostbyaddr().
13507 hdrs="$define sys/types.h
13508 $d_socket sys/socket.h
13509 $i_niin netinet/in.h
13511 $i_unistd unistd.h"
13512 : The first arg can 'char *' or 'void *'
13513 : The second arg is some of integral type
13514 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
13515 for yyy in size_t long int; do
13516 case "$netdb_host_type" in
13517 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
13518 if ./protochk "$try" $hdrs; then
13519 echo "Your system accepts $xxx for the first arg."
13520 echo "...and $yyy for the second arg."
13521 netdb_host_type="$xxx"
13522 netdb_hlen_type="$yyy"
13528 : In case none of those worked, prompt the user.
13529 case "$netdb_host_type" in
13530 '') rp='What is the type for the 1st argument to gethostbyaddr?'
13533 netdb_host_type=$ans
13534 rp='What is the type for the 2nd argument to gethostbyaddr?'
13537 netdb_hlen_type=$ans
13541 *) : no gethostbyaddr, so pick harmless defaults
13542 netdb_host_type='char *'
13543 netdb_hlen_type="$sizetype"
13546 # Remove the "const" if needed. -- but then we'll have a
13548 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
13551 : check for type of argument to gethostbyname.
13552 if test "X$netdb_name_type" = X ; then
13553 case "$d_gethbyname" in
13557 Checking to see what type of argument is accepted by gethostbyname().
13559 hdrs="$define sys/types.h
13560 $d_socket sys/socket.h
13561 $i_niin netinet/in.h
13563 $i_unistd unistd.h"
13564 for xxx in "const char *" "char *"; do
13565 case "$netdb_name_type" in
13566 '') try="extern struct hostent *gethostbyname($xxx);"
13567 if ./protochk "$try" $hdrs; then
13568 echo "Your system accepts $xxx."
13569 netdb_name_type="$xxx"
13574 : In case none of those worked, prompt the user.
13575 case "$netdb_name_type" in
13576 '') rp='What is the type for the 1st argument to gethostbyname?'
13579 netdb_name_type=$ans
13583 *) : no gethostbyname, so pick harmless default
13584 netdb_name_type='char *'
13589 : check for type of 1st argument to getnetbyaddr.
13590 if test "X$netdb_net_type" = X ; then
13591 case "$d_getnbyaddr" in
13595 Checking to see what type of 1st argument is accepted by getnetbyaddr().
13597 hdrs="$define sys/types.h
13598 $d_socket sys/socket.h
13599 $i_niin netinet/in.h
13601 $i_unistd unistd.h"
13602 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
13603 case "$netdb_net_type" in
13604 '') try="extern struct netent *getnetbyaddr($xxx, int);"
13605 if ./protochk "$try" $hdrs; then
13606 echo "Your system accepts $xxx."
13607 netdb_net_type="$xxx"
13612 : In case none of those worked, prompt the user.
13613 case "$netdb_net_type" in
13614 '') rp='What is the type for the 1st argument to getnetbyaddr?'
13617 netdb_net_type=$ans
13621 *) : no getnetbyaddr, so pick harmless default
13622 netdb_net_type='long'
13626 : locate the preferred pager for this system
13632 [a-zA-Z]:/*) dflt=$pg;;
13636 [a-zA-Z]:/*) dflt=$more;;
13640 [a-zA-Z]:/*) dflt=$less;;
13643 '') dflt=/usr/ucb/more;;
13650 rp='What pager is used on your system?'
13654 : see what type pids are declared as in the kernel
13655 rp="What is the type of process ids on this system?"
13656 set pid_t pidtype int stdio.h sys/types.h
13659 : Find earliest binary compatible site_perl subdirectory perl can use.
13660 case "$bincompat5005" in
13661 "$define") xs_apiversion='5.005' ;;
13662 *) xs_apiversion=$version ;; # The current site_perl version.
13664 : Find earliest pure perl site_perl subdirectory perl can use.
13665 : The versioned directories started at 5.005.
13666 pm_apiversion='5.005'
13668 : check for length of pointer
13672 echo "Checking to see how big your pointers are..." >&4
13673 if test "$voidflags" -gt 7; then
13674 echo '#define VOID_PTR char *' > try.c
13676 echo '#define VOID_PTR void *' > try.c
13678 $cat >>try.c <<'EOCP'
13682 printf("%d\n", (int)sizeof(VOID_PTR));
13687 if eval $compile_ok; then
13689 echo "Your pointers are $ptrsize bytes long."
13692 echo "(I can't seem to compile the test program. Guessing...)" >&4
13693 rp="What is the size of a pointer (in bytes)?"
13701 : see if ar generates random libraries by itself
13703 echo "Checking how to generate random libraries on your machine..." >&4
13704 echo 'int bar1() { return bar2(); }' > bar1.c
13705 echo 'int bar2() { return 2; }' > bar2.c
13706 $cat > foo.c <<'EOP'
13707 int main() { printf("%d\n", bar1()); exit(0); }
13709 $cc $ccflags -c bar1.c >/dev/null 2>&1
13710 $cc $ccflags -c bar2.c >/dev/null 2>&1
13711 $cc $ccflags -c foo.c >/dev/null 2>&1
13712 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
13713 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
13714 ./foobar >/dev/null 2>&1; then
13715 echo "$ar appears to generate random libraries itself."
13718 elif $ar ts bar$_a >/dev/null 2>&1 &&
13719 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
13720 ./foobar >/dev/null 2>&1; then
13721 echo "a table of contents needs to be added with '$ar ts'."
13728 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
13729 $test -f $ranlib || ranlib=''
13732 if $test -n "$ranlib"; then
13733 echo "your system has '$ranlib'; we'll use that."
13736 echo "your system doesn't seem to support random libraries"
13737 echo "so we'll use lorder and tsort to order the libraries."
13744 : check for type of arguments to select.
13745 case "$selecttype" in
13746 '') case "$d_select" in
13750 Checking to see what type of arguments are accepted by select().
13752 hdrs="$define sys/types.h
13753 $i_systime sys/time.h
13754 $i_sysselct sys/select.h
13755 $d_socket sys/socket.h"
13756 : The first arg can be int, unsigned, or size_t
13757 : The last arg may or may not be 'const'
13759 : void pointer has been seen but using that
13760 : breaks the selectminbits test
13761 for xxx in 'fd_set *' 'int *'; do
13762 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
13763 for tmo in 'struct timeval *' 'const struct timeval *'; do
13765 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
13766 if ./protochk "$try" $hdrs; then
13767 echo "Your system accepts $xxx."
13776 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
13777 case "$d_fd_set" in
13778 $define) dflt="fd_set *" ;;
13787 *) : no select, so pick a harmless default
13794 : check for the select 'width'
13795 case "$selectminbits" in
13796 '') case "$d_select" in
13800 Checking to see on how many bits at a time your select() operates...
13803 #include <sys/types.h>
13805 #$i_systime I_SYS_TIME
13806 #$i_systimek I_SYS_TIME_KERNEL
13811 # ifdef I_SYS_TIME_KERNEL
13814 # include <sys/time.h>
13815 # ifdef I_SYS_TIME_KERNEL
13819 #$i_sysselct I_SYS_SELECT
13820 #ifdef I_SYS_SELECT
13821 #include <sys/select.h>
13823 #$d_socket HAS_SOCKET
13825 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13829 #define S sizeof(*(b))
13831 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
13832 #define NBITS (NBYTES * 8)
13841 fp = fopen("try.c", "r");
13847 b = ($selecttype)s;
13848 for (i = 0; i < NBITS; i++)
13852 select(fd + 1, b, 0, 0, &t);
13853 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
13854 printf("%d\n", i + 1);
13859 if eval $compile_ok; then
13860 selectminbits=`./try`
13861 case "$selectminbits" in
13863 Cannot figure out on how many bits at a time your select() operates.
13864 I'll play safe and guess it is 32 bits.
13870 *) bits="$selectminbits bits" ;;
13872 echo "Your select() operates on $bits at a time." >&4
13874 rp='What is the minimum number of bits your select() operates on?'
13875 case "$byteorder" in
13876 1234|12345678) dflt=32 ;;
13881 selectminbits="$val"
13885 *) : no select, so pick a harmless default
13892 : Trace out the files included by signal.h, then look for SIGxxx names.
13893 : Remove SIGARRAYSIZE used by HPUX.
13894 : Remove SIGSTKSIZE used by Linux.
13895 : Remove SIGSTKSZ used by Posix.
13896 : Remove SIGTYP void lines used by OS2.
13897 : Some cpps, like os390, dont give the file name anywhere
13898 if [ "X$fieldn" = X ]; then
13899 : Just make some guesses. We check them later.
13900 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
13902 xxx=`echo '#include <signal.h>' |
13903 $cppstdin $cppminus $cppflags 2>/dev/null |
13904 $grep '^[ ]*#.*include' |
13905 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq`
13907 : Check this list of files to be sure we have parsed the cpp output ok.
13908 : This will also avoid potentially non-existent files, such
13911 for xx in $xxx /dev/null ; do
13912 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
13914 : If we have found no files, at least try signal.h
13915 case "$xxxfiles" in
13916 '') xxxfiles=`./findhdr signal.h` ;;
13919 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
13920 print substr($2, 4, 20)
13922 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
13923 print substr($3, 4, 20)
13925 : Append some common names just in case the awk scan failed.
13926 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
13927 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
13928 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
13929 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
13930 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
13932 : generate a few handy files for later
13933 $cat > signal.c <<'EOCP'
13934 #include <sys/types.h>
13935 #include <signal.h>
13939 /* Strange style to avoid deeply-nested #if/#else/#endif */
13942 # define NSIG (_NSIG)
13948 # define NSIG (SIGMAX+1)
13954 # define NSIG (SIG_MAX+1)
13960 # define NSIG (MAXSIG+1)
13966 # define NSIG (MAX_SIG+1)
13971 # ifdef SIGARRAYSIZE
13972 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
13978 # define NSIG (_sys_nsig) /* Solaris 2.5 */
13982 /* Default to some arbitrary number that's big enough to get most
13983 of the common signals.
13989 printf("NSIG %d\n", NSIG);
13995 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
13997 printf "#ifdef SIG"; printf $1; printf "\n"
13998 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
13999 printf $1; printf ");\n"
14003 printf "#endif /* JUST_NSIG */\n";
14004 printf "exit(0);\n}\n";
14007 $cat >signal.awk <<'EOP'
14008 BEGIN { ndups = 0 }
14009 $1 ~ /^NSIG$/ { nsig = $2 }
14010 ($1 !~ /^NSIG$/) && (NF == 2) {
14011 if ($2 > maxsig) { maxsig = $2 }
14012 if (sig_name[$2]) {
14013 dup_name[ndups] = $1
14014 dup_num[ndups] = $2
14026 printf("NSIG %d\n", nsig);
14027 for (n = 1; n < nsig; n++) {
14029 printf("%s %d\n", sig_name[n], sig_num[n])
14032 printf("NUM%d %d\n", n, n)
14035 for (n = 0; n < ndups; n++) {
14036 printf("%s %d\n", dup_name[n], dup_num[n])
14040 $cat >signal_cmd <<EOS
14042 if $test -s signal.lst; then
14043 echo "Using your existing signal.lst file"
14048 $cat >>signal_cmd <<'EOS'
14051 if eval $compile_ok; then
14052 ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
14054 echo "(I can't seem be able to compile the whole test program)" >&4
14055 echo "(I'll try it in little pieces.)" >&4
14056 set signal -DJUST_NSIG
14057 if eval $compile_ok; then
14058 ./signal$_exe > signal.nsg
14061 echo "I can't seem to figure out how many signals you have." >&4
14062 echo "Guessing 50." >&4
14063 echo 'NSIG 50' > signal.nsg
14065 : Now look at all the signal names, one at a time.
14066 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
14067 $cat > signal.c <<EOCP
14068 #include <sys/types.h>
14069 #include <signal.h>
14072 printf("$xx %d\n", SIG${xx});
14077 if eval $compile; then
14078 echo "SIG${xx} found."
14079 ./signal$_exe >> signal.ls1
14081 echo "SIG${xx} NOT found."
14084 if $test -s signal.ls1; then
14085 $cat signal.nsg signal.ls1 |
14086 $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
14090 if $test -s signal.lst; then
14093 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
14094 echo 'kill -l' >signal
14095 set X `csh -f <signal`
14099 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
14101 echo $@ | $tr ' ' $trnl | \
14102 $awk '{ printf "%s %d\n", $1, ++s; }
14103 END { printf "NSIG %d\n", ++s }' >signal.lst
14105 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
14107 chmod a+x signal_cmd
14108 $eunicefix signal_cmd
14110 : generate list of signal names
14112 case "$sig_name_init" in
14114 *) case "$sig_num_init" in
14115 ''|*,*) doinit=yes ;;
14120 echo "Generating a list of signal names and numbers..." >&4
14122 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
14123 sig_name=`$awk 'BEGIN { printf "ZERO " }
14124 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
14125 sig_num=`$awk 'BEGIN { printf "0 " }
14126 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
14127 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
14128 !/^NSIG/ { printf "\"%s\", ", $1 }
14129 END { printf "0\n" }' signal.lst`
14130 sig_num_init=`$awk 'BEGIN { printf "0, " }
14131 !/^NSIG/ { printf "%d, ", $2}
14132 END { printf "0\n"}' signal.lst`
14135 echo "The following $sig_count signals are available:"
14137 echo $sig_name | $awk \
14138 'BEGIN { linelen = 0 }
14140 for (i = 1; i <= NF; i++) {
14141 name = "SIG" $i " "
14142 linelen = linelen + length(name)
14143 if (linelen > 70) {
14145 linelen = length(name)
14151 $rm -f signal signal.c signal.awk signal.lst signal_cmd
14154 case "$sizetype" in
14155 *_t) zzz="$sizetype" ;;
14156 *) zzz="filesize" ;;
14158 echo "Checking the size of $zzz..." >&4
14160 #include <sys/types.h>
14163 printf("%d\n", (int)sizeof($sizetype));
14168 if eval $compile_ok; then
14172 echo "(I can't execute the test program--guessing $sizesize.)" >&4
14175 echo "Your $zzz size is $sizesize bytes."
14180 echo "(I can't compile the test program--guessing $sizesize.)" >&4
14184 : check for socklen_t
14186 echo "Checking to see if you have socklen_t..." >&4
14188 #include <sys/types.h>
14189 #$d_socket HAS_SOCKET
14191 #include <sys/socket.h>
14193 int main() { socklen_t x = 16; }
14196 if eval $compile; then
14198 echo "You have socklen_t."
14201 echo "You do not have socklen_t."
14202 case "$sizetype" in
14203 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
14210 : check for type of the size argument to socket calls
14211 case "$d_socket" in
14215 Checking to see what type is the last argument of accept().
14217 hdrs="$define sys/types.h $d_socket sys/socket.h"
14219 case "$d_socklen_t" in
14220 "$define") yyy="$yyy socklen_t"
14222 yyy="$yyy $sizetype int long unsigned"
14223 for xxx in $yyy; do
14224 case "$socksizetype" in
14225 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
14226 if ./protochk "$try" $hdrs; then
14227 echo "Your system accepts '$xxx *' for the last argument of accept()."
14228 socksizetype="$xxx"
14233 : In case none of those worked, prompt the user.
14234 case "$socksizetype" in
14235 '') rp='What is the type for socket address structure sizes?'
14242 *) : no sockets, so pick relatively harmless default
14247 : see what type is used for signed size_t
14248 set ssize_t ssizetype int stdio.h sys/types.h
14251 $cat > ssize.c <<EOM
14253 #include <sys/types.h>
14254 #define Size_t $sizetype
14255 #define SSize_t $dflt
14258 if (sizeof(Size_t) == sizeof(SSize_t))
14260 else if (sizeof(Size_t) == sizeof(int))
14269 if eval $compile_ok && ./ssize > /dev/null; then
14270 ssizetype=`./ssize`
14271 echo "I'll be using $ssizetype for functions returning a byte count." >&4
14274 Help! I can't compile and run the ssize_t test program: please enlighten me!
14275 (This is probably a misconfiguration in your system or libraries, and
14276 you really ought to fix it. Still, I'll try anyway.)
14278 I need a type that is the same size as $sizetype, but is guaranteed to
14279 be signed. Common values are ssize_t, int and long.
14282 rp="What signed type is the same size as $sizetype?"
14286 $rm -f ssize ssize.*
14288 : see what type of char stdio uses.
14290 if $contains 'unsigned.*char.*_ptr;' `./findhdr stdio.h` >/dev/null 2>&1 ; then
14291 echo "Your stdio uses unsigned chars." >&4
14292 stdchar="unsigned char"
14294 echo "Your stdio uses signed chars." >&4
14298 : see if time exists
14300 if test "X$d_time" = X -o X"$timetype" = X; then
14301 if set time val -f d_time; eval $csym; $val; then
14302 echo 'time() found.' >&4
14304 rp="What is the type returned by time() on this system?"
14305 set time_t timetype long stdio.h sys/types.h
14308 echo 'time() not found, hope that will do.' >&4
14316 : see what type uids are declared as in the kernel
14318 echo "Looking for the type for user ids returned by getuid()."
14319 set uid_t uidtype xxx stdio.h sys/types.h
14323 xxx=`./findhdr sys/user.h`
14324 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
14326 unsigned) dflt="$1 $2" ;;
14330 *) dflt="$uidtype";;
14333 uid_t) echo "uid_t found." ;;
14334 *) rp="What is the type for user ids returned by getuid()?"
14342 *_t) zzz="$uidtype" ;;
14345 echo "Checking the size of $zzz..." >&4
14347 #include <sys/types.h>
14350 printf("%d\n", (int)sizeof($uidtype));
14355 if eval $compile_ok; then
14359 echo "(I can't execute the test program--guessing $uidsize.)" >&4
14362 echo "Your $zzz is $uidsize bytes long."
14367 echo "(I can't compile the test program--guessing $uidsize.)" >&4
14372 *_t) zzz="$uidtype" ;;
14375 echo "Checking the sign of $zzz..." >&4
14377 #include <sys/types.h>
14388 if eval $compile; then
14392 echo "(I can't execute the test program--guessing unsigned.)" >&4
14396 1) echo "Your $zzz is unsigned." ;;
14397 -1) echo "Your $zzz is signed." ;;
14403 echo "(I can't compile the test program--guessing unsigned.)" >&4
14409 $echo "Checking the format string to be used for uids..." >&4
14412 -1) if $test X"$uidsize" = X"$ivsize"; then
14413 uidformat="$ivdformat"
14415 if $test X"$uidsize" = X"$longsize"; then
14418 if $test X"$uidsize" = X"$intsize"; then
14421 if $test X"$uidsize" = X"$shortsize"; then
14428 *) if $test X"$uidsize" = X"$uvsize"; then
14429 uidformat="$uvuformat"
14431 if $test X"$uidsize" = X"$longsize"; then
14434 if $test X"$uidsize" = X"$intsize"; then
14437 if $test X"$uidsize" = X"$shortsize"; then
14446 : see if dbm.h is available
14447 : see if dbmclose exists
14448 set dbmclose d_dbmclose
14451 case "$d_dbmclose" in
14461 *) set rpcsvc/dbm.h i_rpcsvcdbm
14466 *) echo "We won't be including <dbm.h>"
14476 : see if this is a sys/file.h system
14481 : do we need to include sys/file.h ?
14485 if $h_sysfile; then
14487 echo "We'll be including <sys/file.h>." >&4
14490 echo "We won't be including <sys/file.h>." >&4
14500 : see if fcntl.h is there
14505 : see if we can include fcntl.h
14511 echo "We'll be including <fcntl.h>." >&4
14514 if $h_sysfile; then
14515 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
14517 echo "We won't be including <fcntl.h>." >&4
14529 : see if this is a iconv.h system
14530 set iconv.h i_iconv
14533 : see if this is a ieeefp.h system
14534 set ieeefp.h i_ieeefp
14537 : see if this is a libutil.h system
14538 set libutil.h i_libutil
14541 : see if locale.h is available
14542 set locale.h i_locale
14545 : see if mach cthreads are available
14546 if test "X$usethreads" = "X$define"; then
14547 set mach/cthreads.h i_machcthr
14550 i_machcthr="$undef"
14555 : see if this is a math.h system
14559 : see if this is a mntent.h system
14560 set mntent.h i_mntent
14563 : see if ndbm.h is available
14568 : see if dbm_open exists
14569 set dbm_open d_dbm_open
14571 case "$d_dbm_open" in
14574 echo "We won't be including <ndbm.h>"
14583 : see if net/errno.h is available
14585 set net/errno.h val
14588 : Unfortunately, it causes problems on some systems. Arrgh.
14591 cat > try.c <<'EOM'
14594 #include <net/errno.h>
14600 if $cc $ccflags -c try.c >/dev/null 2>&1; then
14601 echo "We'll be including <net/errno.h>." >&4
14603 echo "We won't be including <net/errno.h>." >&4
14612 : see if netinet/tcp.h is available
14613 set netinet/tcp.h i_netinettcp
14616 : see if this is a poll.h system
14620 : see if this is a prot.h system
14625 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
14626 $cat <<'EOSH' > Cppsym.know
14627 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
14628 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
14629 alliant alpha am29000 AM29000 amiga AMIGAOS AMIX
14630 ansi ANSI_C_SOURCE apollo ardent atarist att386 att3b BeOS
14631 BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
14632 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
14633 bull c cadmus clipper CMU COFF COMPILER_VERSION
14634 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
14635 CYGWIN DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
14636 Dynix DynixPTX ELF encore EPI EXTENSIONS FILE_OFFSET_BITS
14637 FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
14638 GNU_SOURCE GNUC GNUC_MINOR GO32 gould GOULD_PN
14639 H3050R H3050RX hbullx20 hcx host_mips
14640 hp200 hp300 hp700 HP700 hp800 hp9000
14641 hp9000s200 hp9000s300 hp9000s400 hp9000s500
14642 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
14643 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
14644 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
14645 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
14646 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
14647 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
14648 Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
14649 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
14650 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
14651 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
14652 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
14653 MATH_HAS_NO_SIDE_EFFECTS
14654 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
14655 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
14656 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
14657 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
14658 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
14659 NetBSD news1500 news1700 news1800 news1900 news3700
14660 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
14661 ns32016 ns32332 ns32k nsc32000
14662 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
14663 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
14664 pc532 pdp11 PGC PIC plexus PORTAR posix
14665 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
14666 POSIX_C_SOURCE POSIX_SOURCE POWER
14667 PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
14668 riscix riscos RT scs SCO sequent sgi SGI_SOURCE sinix
14669 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
14670 sony sony_news sonyrisc sparc sparclite spectrum
14671 stardent stdc STDC_EXT stratos sun sun3 sun386
14672 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
14673 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
14674 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
14675 sysV68 sysV88 Tek4132 Tek4300 titan
14676 tower tower32 tower32_200 tower32_600 tower32_700
14677 tower32_800 tower32_850 tss
14678 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
14679 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
14680 unix UNIX95 UNIX99 unixpc unos USGr4 USGr4_2
14681 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms xenix Xenix286
14682 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
14683 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
14686 # Maybe put other stuff here too.
14687 cat <<EOSH >>Cppsym.know
14690 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
14691 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
14692 $cat Cppsym.know > Cppsym.c
14693 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
14694 $rm -f Cppsym.a Cppsym.b Cppsym.c
14695 cat <<EOSH > Cppsym
14697 if $test \$# -gt 0; then
14698 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
14699 if $test -s Cppsym.got; then
14706 $tr " " "$trnl" | ./Cppsym.try
14712 cat <<EOSH > Cppsym.try
14714 cat <<'EOCP' > try.c
14720 cat <<'EOSH' >> Cppsym.try
14722 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
14723 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
14724 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
14725 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
14729 cat <<EOSH >> Cppsym.try
14731 case "$osname-$gccversion" in
14732 irix-) ccflags="\$ccflags -woff 1178" ;;
14733 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
14735 $cc -o try $optimize \$ccflags $ldflags try.c $libs && ./try$exe_ext
14737 chmod +x Cppsym.try
14738 $eunicefix Cppsym.try
14739 ./Cppsym < Cppsym.know > Cppsym.true
14740 : now check the C compiler for additional symbols
14741 postprocess_cc_v=''
14743 aix) postprocess_cc_v="|$tr , ' '" ;;
14750 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
14753 -D*) echo "\$i" | $sed 's/^-D//';;
14754 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
14759 postprocess_cc_v=''
14762 ./ccsym > ccsym1.raw
14763 if $test -s ccsym1.raw; then
14764 $sort ccsym1.raw | $uniq >ccsym.raw
14766 mv ccsym1.raw ccsym.raw
14769 $awk '/\=/ { print $0; next }
14770 { print $0"=1" }' ccsym.raw >ccsym.list
14771 $awk '/\=/ { print $0; next }
14772 { print $0"=1" }' Cppsym.true >ccsym.true
14773 $comm -13 ccsym.true ccsym.list >ccsym.own
14774 $comm -12 ccsym.true ccsym.list >ccsym.com
14775 $comm -23 ccsym.true ccsym.list >ccsym.cpp
14777 if $test -z ccsym.raw; then
14778 echo "Your C compiler doesn't seem to define any symbols!" >&4
14780 echo "However, your C preprocessor defines the following symbols:"
14783 cppsymbols=`$cat Cppsym.true`
14784 cppsymbols=`echo $cppsymbols`
14785 cppccsymbols="$cppsymbols"
14787 if $test -s ccsym.com; then
14788 echo "Your C compiler and pre-processor define these symbols:"
14789 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
14792 cppccsymbols=`$cat ccsym.com`
14793 cppccsymbols=`echo $cppccsymbols`
14794 $test "$silent" || sleep 1
14796 if $test -s ccsym.cpp; then
14797 $test "$also" && echo " "
14798 echo "Your C pre-processor ${also}defines the following symbols:"
14799 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
14801 cppsymbols=`$cat ccsym.cpp`
14802 cppsymbols=`echo $cppsymbols`
14803 $test "$silent" || sleep 1
14805 if $test -s ccsym.own; then
14806 $test "$also" && echo " "
14807 echo "Your C compiler ${also}defines the following cpp symbols:"
14808 $sed -e 's/\(..*\)=1/\1/' ccsym.own
14809 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
14810 ccsymbols=`$cat ccsym.own`
14811 ccsymbols=`echo $ccsymbols`
14812 $test "$silent" || sleep 1
14815 $rm -f ccsym* Cppsym.*
14817 : see if this is a termio system
14821 if $test `./findhdr termios.h`; then
14822 set tcsetattr i_termios
14828 "$define") echo "You have POSIX termios.h... good!" >&4;;
14829 *) if ./Cppsym pyr; then
14830 case "`/bin/universe`" in
14831 ucb) if $test `./findhdr sgtty.h`; then
14833 echo "<sgtty.h> found." >&4
14835 echo "System is pyramid with BSD universe."
14836 echo "<sgtty.h> not found--you could have problems." >&4
14838 *) if $test `./findhdr termio.h`; then
14840 echo "<termio.h> found." >&4
14842 echo "System is pyramid with USG universe."
14843 echo "<termio.h> not found--you could have problems." >&4
14847 if $test `./findhdr termio.h`; then
14848 echo "<termio.h> found." >&4
14850 elif $test `./findhdr sgtty.h`; then
14851 echo "<sgtty.h> found." >&4
14854 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
14857 if $test `./findhdr sgtty.h`; then
14858 echo "<sgtty.h> found." >&4
14860 elif $test `./findhdr termio.h`; then
14861 echo "<termio.h> found." >&4
14864 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
14868 set i_termio; eval $setvar
14869 val=$val2; set i_sgtty; eval $setvar
14870 val=$val3; set i_termios; eval $setvar
14872 : see if this is a shadow.h system
14873 set shadow.h i_shadow
14876 : see if this is a socks.h system
14877 set socks.h i_socks
14880 : see if stdarg is available
14882 if $test `./findhdr stdarg.h`; then
14883 echo "<stdarg.h> found." >&4
14886 echo "<stdarg.h> NOT found." >&4
14890 : see if varags is available
14892 if $test `./findhdr varargs.h`; then
14893 echo "<varargs.h> found." >&4
14895 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
14898 : set up the varargs testing programs
14899 $cat > varargs.c <<EOP
14901 #include <stdarg.h>
14904 #include <varargs.h>
14908 int f(char *p, ...)
14922 p = va_arg(ap, char *);
14927 $cat > varargs <<EOP
14929 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
14938 : now check which varargs header should be included
14943 if `./varargs I_STDARG`; then
14945 elif `./varargs I_VARARGS`; then
14950 if `./varargs I_VARARGS`; then
14957 echo "I could not find the definition for va_dcl... You have problems..." >&4
14958 val="$undef"; set i_stdarg; eval $setvar
14959 val="$undef"; set i_varargs; eval $setvar
14964 case "$i_varhdr" in
14966 val="$define"; set i_stdarg; eval $setvar
14967 val="$undef"; set i_varargs; eval $setvar
14970 val="$undef"; set i_stdarg; eval $setvar
14971 val="$define"; set i_varargs; eval $setvar
14974 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
14978 : see if stddef is available
14979 set stddef.h i_stddef
14982 : see if this is a sunmath.h system
14983 set sunmath.h i_sunmath
14986 : see if sys/access.h is available
14987 set sys/access.h i_sysaccess
14990 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
14991 set sys/filio.h i_sysfilio
14994 if $test `./findhdr sys/ioctl.h`; then
14996 echo '<sys/ioctl.h> found.' >&4
14999 if $test $i_sysfilio = "$define"; then
15000 echo '<sys/ioctl.h> NOT found.' >&4
15002 $test $i_sgtty = "$define" && xxx="sgtty.h"
15003 $test $i_termio = "$define" && xxx="termio.h"
15004 $test $i_termios = "$define" && xxx="termios.h"
15005 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
15012 : see if this is a syslog.h system
15013 set syslog.h i_syslog
15017 : see if this is a sys/mode.h system
15018 set sys/mode.h i_sysmode
15021 : see if sys/resource.h has to be included
15022 set sys/resource.h i_sysresrc
15025 : see if sys/security.h is available
15026 set sys/security.h i_syssecrt
15029 : see if this is a sys/statvfs.h system
15030 set sys/statvfs.h i_sysstatvfs
15033 : see if this is a sys/uio.h system
15034 set sys/uio.h i_sysuio
15037 : see if this is a sys/un.h system
15038 set sys/un.h i_sysun
15042 : see if this is a sys/utsname.h system
15043 set sys/utsname.h i_sysutsname
15046 : see if this is a syswait system
15047 set sys/wait.h i_syswait
15050 : see if this is a ustat.h system
15051 set ustat.h i_ustat
15054 : see if this is an utime system
15055 set utime.h i_utime
15058 : see if this is a values.h system
15059 set values.h i_values
15062 : see if this is a vfork system
15065 set vfork.h i_vfork
15073 : see if gdbm.h is available
15078 : see if gdbm_open exists
15079 set gdbm_open d_gdbm_open
15081 case "$d_gdbm_open" in
15084 echo "We won't be including <gdbm.h>"
15094 echo "Looking for extensions..." >&4
15095 : If we are using the old config.sh, known_extensions may contain
15096 : old or inaccurate or duplicate values.
15097 known_extensions=''
15098 nonxs_extensions=''
15099 : We do not use find because it might not be available.
15100 : We do not just use MANIFEST because the user may have dropped
15101 : some additional extensions into the source tree and expect them
15104 : Function to recursively find available extensions, ignoring DynaLoader
15105 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
15109 DynaLoader|dynaload) ;;
15111 if $test -f $xxx/$xxx.xs; then
15112 known_extensions="$known_extensions $1$xxx";
15113 elif $test -f $xxx/Makefile.PL; then
15114 nonxs_extensions="$nonxs_extensions $1$xxx";
15116 if $test -d $xxx -a $# -lt 10; then
15119 eval $find_extensions;
15131 eval $find_extensions
15132 set X $nonxs_extensions
15134 nonxs_extensions="$*"
15135 set X $known_extensions
15137 known_extensions="$*"
15140 : Now see which are supported on this system.
15142 for xxx in $known_extensions ; do
15146 $define) avail_ext="$avail_ext $xxx" ;;
15149 GDBM_File|gdbm_fil)
15151 $define) avail_ext="$avail_ext $xxx" ;;
15154 NDBM_File|ndbm_fil)
15157 case "$osname-$use64bitint" in
15160 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
15163 *) avail_ext="$avail_ext $xxx" ;;
15168 ODBM_File|odbm_fil)
15169 case "${i_dbm}${i_rpcsvcdbm}" in
15171 case "$osname-$use64bitint" in
15174 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
15177 *) avail_ext="$avail_ext $xxx" ;;
15183 case "$useposix" in
15184 true|define|y) avail_ext="$avail_ext $xxx" ;;
15188 case "$useopcode" in
15189 true|define|y) avail_ext="$avail_ext $xxx" ;;
15193 case "$d_socket" in
15194 true|$define|y) avail_ext="$avail_ext $xxx" ;;
15197 Sys/Syslog|sys/syslog)
15198 : XXX syslog requires socket
15199 case "$d_socket" in
15200 true|$define|y) avail_ext="$avail_ext $xxx" ;;
15204 case "$usethreads" in
15205 true|$define|y) avail_ext="$avail_ext $xxx" ;;
15209 : XXX Do we need a useipcsysv variable here
15210 case "${d_msg}${d_sem}${d_shm}" in
15211 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
15214 *) avail_ext="$avail_ext $xxx"
15223 : Now see which nonxs extensions are supported on this system.
15224 : For now assume all are.
15226 for xxx in $nonxs_extensions ; do
15228 *) nonxs_ext="$nonxs_ext $xxx"
15240 A number of extensions are supplied with $package. You may choose to
15241 compile these extensions for dynamic loading (the default), compile
15242 them into the $package executable (static loading), or not include
15243 them at all. Answer "none" to include no extensions.
15244 Note that DynaLoader is always built and need not be mentioned here.
15247 case "$dynamic_ext" in
15248 '') dflt="$avail_ext" ;;
15249 *) dflt="$dynamic_ext"
15250 # Perhaps we are reusing an old out-of-date config.sh.
15253 if test X"$dynamic_ext" != X"$avail_ext"; then
15255 NOTICE: Your previous config.sh list may be incorrect.
15256 The extensions now available to you are
15258 but the default list from your previous config.sh is
15270 rp="What extensions do you wish to load dynamically?"
15273 none) dynamic_ext=' ' ;;
15274 *) dynamic_ext="$ans" ;;
15277 case "$static_ext" in
15279 : Exclude those already listed in dynamic linking
15281 for xxx in $avail_ext; do
15282 case " $dynamic_ext " in
15284 *) dflt="$dflt $xxx" ;;
15291 *) dflt="$static_ext"
15298 rp="What extensions do you wish to load statically?"
15301 none) static_ext=' ' ;;
15302 *) static_ext="$ans" ;;
15307 A number of extensions are supplied with $package. Answer "none"
15308 to include no extensions.
15309 Note that DynaLoader is always built and need not be mentioned here.
15312 case "$static_ext" in
15313 '') dflt="$avail_ext" ;;
15314 *) dflt="$static_ext"
15315 # Perhaps we are reusing an old out-of-date config.sh.
15318 if test X"$static_ext" != X"$avail_ext"; then
15320 NOTICE: Your previous config.sh list may be incorrect.
15321 The extensions now available to you are
15323 but the default list from your previous config.sh is
15332 : Exclude those that are not xs extensions
15336 rp="What extensions do you wish to include?"
15339 none) static_ext=' ' ;;
15340 *) static_ext="$ans" ;;
15345 set X $dynamic_ext $static_ext $nonxs_ext
15349 : Remove libraries needed only for extensions
15350 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
15351 : The exception is SunOS 4.x, which needs them.
15352 case "${osname}X${osvers}" in
15356 *) case "$usedl" in
15357 $define|true|[yY]*)
15358 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
15362 *) perllibs="$libs"
15368 : Remove build directory name from cppstdin so it can be used from
15369 : either the present location or the final installed location.
15371 : Get out of the UU directory to get correct path name.
15373 case "$cppstdin" in
15375 echo "Stripping down cppstdin path name"
15381 : end of configuration questions
15383 echo "End of configuration questions."
15386 : back to where it started
15387 if test -d ../UU; then
15391 : configuration may be patched via a 'config.over' file
15392 if $test -f config.over; then
15395 rp='I see a config.over file. Do you wish to load it?'
15398 n*) echo "OK, I'll ignore it.";;
15400 echo "Configuration override changes have been loaded."
15405 : in case they want portability, strip down executable paths
15406 case "$d_portable" in
15409 echo "Stripping down executable paths..." >&4
15410 for file in $loclist $trylist; do
15412 eval $file=`basename $temp`
15417 : create config.sh file
15419 echo "Creating config.sh..." >&4
15420 $spitshell <<EOT >config.sh
15423 # This file was produced by running the Configure script. It holds all the
15424 # definitions figured out by Configure. Should you modify one of these values,
15425 # do not forget to propagate your changes by running "Configure -der". You may
15426 # instead choose to run each of the .SH files by yourself, or "Configure -S".
15429 # Package name : $package
15430 # Source directory : $src
15431 # Configuration time: $cf_time
15432 # Configured by : $cf_by
15433 # Target system : $myuname
15443 Revision='$Revision'
15450 alignbytes='$alignbytes'
15451 ansi2knr='$ansi2knr'
15452 aphostname='$aphostname'
15453 api_revision='$api_revision'
15454 api_subversion='$api_subversion'
15455 api_version='$api_version'
15456 api_versionstring='$api_versionstring'
15459 archlibexp='$archlibexp'
15460 archname64='$archname64'
15461 archname='$archname'
15462 archobjs='$archobjs'
15467 bincompat5005='$bincompat5005'
15471 byteorder='$byteorder'
15473 castflags='$castflags'
15476 cccdlflags='$cccdlflags'
15477 ccdlflags='$ccdlflags'
15479 ccflags_uselargefiles='$ccflags_uselargefiles'
15481 ccsymbols='$ccsymbols'
15482 ccversion='$ccversion'
15484 cf_email='$cf_email'
15486 charsize='$charsize'
15490 clocktype='$clocktype'
15492 compress='$compress'
15493 contains='$contains'
15497 cpp_stuff='$cpp_stuff'
15498 cppccsymbols='$cppccsymbols'
15499 cppflags='$cppflags'
15501 cppminus='$cppminus'
15503 cppstdin='$cppstdin'
15504 cppsymbols='$cppsymbols'
15505 crosscompile='$crosscompile'
15506 cryptlib='$cryptlib'
15508 d_Gconvert='$d_Gconvert'
15509 d_PRIEUldbl='$d_PRIEUldbl'
15510 d_PRIFUldbl='$d_PRIFUldbl'
15511 d_PRIGUldbl='$d_PRIGUldbl'
15512 d_PRIXU64='$d_PRIXU64'
15513 d_PRId64='$d_PRId64'
15514 d_PRIeldbl='$d_PRIeldbl'
15515 d_PRIfldbl='$d_PRIfldbl'
15516 d_PRIgldbl='$d_PRIgldbl'
15517 d_PRIi64='$d_PRIi64'
15518 d_PRIo64='$d_PRIo64'
15519 d_PRIu64='$d_PRIu64'
15520 d_PRIx64='$d_PRIx64'
15521 d_SCNfldbl='$d_SCNfldbl'
15522 d_access='$d_access'
15523 d_accessx='$d_accessx'
15525 d_archlib='$d_archlib'
15528 d_attribut='$d_attribut'
15531 d_bincompat5005='$d_bincompat5005'
15533 d_bsdgetpgrp='$d_bsdgetpgrp'
15534 d_bsdsetpgrp='$d_bsdsetpgrp'
15536 d_casti32='$d_casti32'
15537 d_castneg='$d_castneg'
15538 d_charvspr='$d_charvspr'
15540 d_chroot='$d_chroot'
15541 d_chsize='$d_chsize'
15542 d_closedir='$d_closedir'
15546 d_cuserid='$d_cuserid'
15547 d_dbl_dig='$d_dbl_dig'
15548 d_difftime='$d_difftime'
15549 d_dirnamlen='$d_dirnamlen'
15550 d_dlerror='$d_dlerror'
15551 d_dlopen='$d_dlopen'
15552 d_dlsymun='$d_dlsymun'
15553 d_dosuid='$d_dosuid'
15554 d_drand48proto='$d_drand48proto'
15556 d_eaccess='$d_eaccess'
15557 d_endgrent='$d_endgrent'
15558 d_endhent='$d_endhent'
15559 d_endnent='$d_endnent'
15560 d_endpent='$d_endpent'
15561 d_endpwent='$d_endpwent'
15562 d_endsent='$d_endsent'
15563 d_eofnblk='$d_eofnblk'
15564 d_eunice='$d_eunice'
15565 d_fchmod='$d_fchmod'
15566 d_fchown='$d_fchown'
15568 d_fcntl_can_lock='$d_fcntl_can_lock'
15569 d_fd_macros='$d_fd_macros'
15570 d_fd_set='$d_fd_set'
15571 d_fds_bits='$d_fds_bits'
15572 d_fgetpos='$d_fgetpos'
15573 d_flexfnam='$d_flexfnam'
15576 d_fpathconf='$d_fpathconf'
15577 d_fpos64_t='$d_fpos64_t'
15578 d_frexpl='$d_frexpl'
15579 d_fs_data_s='$d_fs_data_s'
15580 d_fseeko='$d_fseeko'
15581 d_fsetpos='$d_fsetpos'
15582 d_fstatfs='$d_fstatfs'
15583 d_fstatvfs='$d_fstatvfs'
15585 d_ftello='$d_ftello'
15587 d_getcwd='$d_getcwd'
15588 d_getespwnam='$d_getespwnam'
15589 d_getfsstat='$d_getfsstat'
15590 d_getgrent='$d_getgrent'
15591 d_getgrps='$d_getgrps'
15592 d_gethbyaddr='$d_gethbyaddr'
15593 d_gethbyname='$d_gethbyname'
15594 d_gethent='$d_gethent'
15595 d_gethname='$d_gethname'
15596 d_gethostprotos='$d_gethostprotos'
15597 d_getlogin='$d_getlogin'
15598 d_getmnt='$d_getmnt'
15599 d_getmntent='$d_getmntent'
15600 d_getnbyaddr='$d_getnbyaddr'
15601 d_getnbyname='$d_getnbyname'
15602 d_getnent='$d_getnent'
15603 d_getnetprotos='$d_getnetprotos'
15604 d_getpagsz='$d_getpagsz'
15605 d_getpbyname='$d_getpbyname'
15606 d_getpbynumber='$d_getpbynumber'
15607 d_getpent='$d_getpent'
15608 d_getpgid='$d_getpgid'
15609 d_getpgrp2='$d_getpgrp2'
15610 d_getpgrp='$d_getpgrp'
15611 d_getppid='$d_getppid'
15612 d_getprior='$d_getprior'
15613 d_getprotoprotos='$d_getprotoprotos'
15614 d_getprpwnam='$d_getprpwnam'
15615 d_getpwent='$d_getpwent'
15616 d_getsbyname='$d_getsbyname'
15617 d_getsbyport='$d_getsbyport'
15618 d_getsent='$d_getsent'
15619 d_getservprotos='$d_getservprotos'
15620 d_getspnam='$d_getspnam'
15621 d_gettimeod='$d_gettimeod'
15622 d_gnulibc='$d_gnulibc'
15623 d_grpasswd='$d_grpasswd'
15624 d_hasmntopt='$d_hasmntopt'
15628 d_inetaton='$d_inetaton'
15629 d_int64_t='$d_int64_t'
15630 d_isascii='$d_isascii'
15632 d_isnanl='$d_isnanl'
15633 d_killpg='$d_killpg'
15634 d_lchown='$d_lchown'
15635 d_ldbl_dig='$d_ldbl_dig'
15637 d_locconv='$d_locconv'
15639 d_longdbl='$d_longdbl'
15640 d_longlong='$d_longlong'
15641 d_lseekproto='$d_lseekproto'
15643 d_madvise='$d_madvise'
15645 d_mbstowcs='$d_mbstowcs'
15646 d_mbtowc='$d_mbtowc'
15647 d_memchr='$d_memchr'
15648 d_memcmp='$d_memcmp'
15649 d_memcpy='$d_memcpy'
15650 d_memmove='$d_memmove'
15651 d_memset='$d_memset'
15653 d_mkdtemp='$d_mkdtemp'
15654 d_mkfifo='$d_mkfifo'
15655 d_mkstemp='$d_mkstemp'
15656 d_mkstemps='$d_mkstemps'
15657 d_mktime='$d_mktime'
15660 d_mprotect='$d_mprotect'
15662 d_msg_ctrunc='$d_msg_ctrunc'
15663 d_msg_dontroute='$d_msg_dontroute'
15664 d_msg_oob='$d_msg_oob'
15665 d_msg_peek='$d_msg_peek'
15666 d_msg_proxy='$d_msg_proxy'
15667 d_msgctl='$d_msgctl'
15668 d_msgget='$d_msgget'
15669 d_msgrcv='$d_msgrcv'
15670 d_msgsnd='$d_msgsnd'
15672 d_munmap='$d_munmap'
15673 d_mymalloc='$d_mymalloc'
15675 d_nv_preserves_uv='$d_nv_preserves_uv'
15676 d_nv_preserves_uv_bits='$d_nv_preserves_uv_bits'
15677 d_off64_t='$d_off64_t'
15678 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
15679 d_oldpthreads='$d_oldpthreads'
15680 d_oldsock='$d_oldsock'
15682 d_pathconf='$d_pathconf'
15684 d_perl_otherlibdirs='$d_perl_otherlibdirs'
15685 d_phostname='$d_phostname'
15688 d_portable='$d_portable'
15689 d_pthread_yield='$d_pthread_yield'
15691 d_pwchange='$d_pwchange'
15692 d_pwclass='$d_pwclass'
15693 d_pwcomment='$d_pwcomment'
15694 d_pwexpire='$d_pwexpire'
15695 d_pwgecos='$d_pwgecos'
15696 d_pwpasswd='$d_pwpasswd'
15697 d_pwquota='$d_pwquota'
15700 d_readdir='$d_readdir'
15701 d_readlink='$d_readlink'
15702 d_rename='$d_rename'
15703 d_rewinddir='$d_rewinddir'
15705 d_safebcpy='$d_safebcpy'
15706 d_safemcpy='$d_safemcpy'
15707 d_sanemcmp='$d_sanemcmp'
15708 d_sched_yield='$d_sched_yield'
15709 d_scm_rights='$d_scm_rights'
15710 d_seekdir='$d_seekdir'
15711 d_select='$d_select'
15713 d_semctl='$d_semctl'
15714 d_semctl_semid_ds='$d_semctl_semid_ds'
15715 d_semctl_semun='$d_semctl_semun'
15716 d_semget='$d_semget'
15718 d_setegid='$d_setegid'
15719 d_seteuid='$d_seteuid'
15720 d_setgrent='$d_setgrent'
15721 d_setgrps='$d_setgrps'
15722 d_sethent='$d_sethent'
15723 d_setlinebuf='$d_setlinebuf'
15724 d_setlocale='$d_setlocale'
15725 d_setnent='$d_setnent'
15726 d_setpent='$d_setpent'
15727 d_setpgid='$d_setpgid'
15728 d_setpgrp2='$d_setpgrp2'
15729 d_setpgrp='$d_setpgrp'
15730 d_setprior='$d_setprior'
15731 d_setproctitle='$d_setproctitle'
15732 d_setpwent='$d_setpwent'
15733 d_setregid='$d_setregid'
15734 d_setresgid='$d_setresgid'
15735 d_setresuid='$d_setresuid'
15736 d_setreuid='$d_setreuid'
15737 d_setrgid='$d_setrgid'
15738 d_setruid='$d_setruid'
15739 d_setsent='$d_setsent'
15740 d_setsid='$d_setsid'
15741 d_setvbuf='$d_setvbuf'
15745 d_shmatprototype='$d_shmatprototype'
15746 d_shmctl='$d_shmctl'
15748 d_shmget='$d_shmget'
15749 d_sigaction='$d_sigaction'
15750 d_sigsetjmp='$d_sigsetjmp'
15751 d_socket='$d_socket'
15752 d_socklen_t='$d_socklen_t'
15753 d_sockpair='$d_sockpair'
15754 d_socks5_init='$d_socks5_init'
15756 d_statblks='$d_statblks'
15757 d_statfs_f_flags='$d_statfs_f_flags'
15758 d_statfs_s='$d_statfs_s'
15759 d_statvfs='$d_statvfs'
15760 d_stdio_cnt_lval='$d_stdio_cnt_lval'
15761 d_stdio_ptr_lval='$d_stdio_ptr_lval'
15762 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
15763 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
15764 d_stdio_stream_array='$d_stdio_stream_array'
15765 d_stdiobase='$d_stdiobase'
15766 d_stdstdio='$d_stdstdio'
15767 d_strchr='$d_strchr'
15768 d_strcoll='$d_strcoll'
15769 d_strctcpy='$d_strctcpy'
15770 d_strerrm='$d_strerrm'
15771 d_strerror='$d_strerror'
15772 d_strtod='$d_strtod'
15773 d_strtol='$d_strtol'
15774 d_strtold='$d_strtold'
15775 d_strtoll='$d_strtoll'
15776 d_strtoul='$d_strtoul'
15777 d_strtoull='$d_strtoull'
15778 d_strtouq='$d_strtouq'
15779 d_strxfrm='$d_strxfrm'
15780 d_suidsafe='$d_suidsafe'
15781 d_symlink='$d_symlink'
15782 d_syscall='$d_syscall'
15783 d_sysconf='$d_sysconf'
15784 d_sysernlst='$d_sysernlst'
15785 d_syserrlst='$d_syserrlst'
15786 d_system='$d_system'
15787 d_tcgetpgrp='$d_tcgetpgrp'
15788 d_tcsetpgrp='$d_tcsetpgrp'
15789 d_telldir='$d_telldir'
15790 d_telldirproto='$d_telldirproto'
15793 d_truncate='$d_truncate'
15794 d_tzname='$d_tzname'
15797 d_union_semun='$d_union_semun'
15799 d_vendorarch='$d_vendorarch'
15800 d_vendorbin='$d_vendorbin'
15801 d_vendorlib='$d_vendorlib'
15803 d_void_closedir='$d_void_closedir'
15804 d_voidsig='$d_voidsig'
15805 d_voidtty='$d_voidtty'
15806 d_volatile='$d_volatile'
15807 d_vprintf='$d_vprintf'
15809 d_waitpid='$d_waitpid'
15810 d_wcstombs='$d_wcstombs'
15811 d_wctomb='$d_wctomb'
15814 db_hashtype='$db_hashtype'
15815 db_prefixtype='$db_prefixtype'
15816 defvoidused='$defvoidused'
15817 direntrytype='$direntrytype'
15820 doublesize='$doublesize'
15822 dynamic_ext='$dynamic_ext'
15828 eunicefix='$eunicefix'
15831 extensions='$extensions'
15832 fflushNULL='$fflushNULL'
15833 fflushall='$fflushall'
15835 firstmakefile='$firstmakefile'
15837 fpossize='$fpossize'
15838 fpostype='$fpostype'
15839 freetype='$freetype'
15841 full_csh='$full_csh'
15842 full_sed='$full_sed'
15843 gccosandvers='$gccosandvers'
15844 gccversion='$gccversion'
15845 gidformat='$gidformat'
15851 groupcat='$groupcat'
15852 groupstype='$groupstype'
15855 h_sysfile='$h_sysfile'
15866 i_arpainet='$i_arpainet'
15867 i_bsdioctl='$i_bsdioctl'
15870 i_dirent='$i_dirent'
15878 i_ieeefp='$i_ieeefp'
15879 i_inttypes='$i_inttypes'
15880 i_libutil='$i_libutil'
15881 i_limits='$i_limits'
15882 i_locale='$i_locale'
15883 i_machcthr='$i_machcthr'
15884 i_malloc='$i_malloc'
15886 i_memory='$i_memory'
15887 i_mntent='$i_mntent'
15890 i_neterrno='$i_neterrno'
15891 i_netinettcp='$i_netinettcp'
15895 i_pthread='$i_pthread'
15897 i_rpcsvcdbm='$i_rpcsvcdbm'
15900 i_shadow='$i_shadow'
15902 i_stdarg='$i_stdarg'
15903 i_stddef='$i_stddef'
15904 i_stdlib='$i_stdlib'
15905 i_string='$i_string'
15906 i_sunmath='$i_sunmath'
15907 i_sysaccess='$i_sysaccess'
15908 i_sysdir='$i_sysdir'
15909 i_sysfile='$i_sysfile'
15910 i_sysfilio='$i_sysfilio'
15912 i_sysioctl='$i_sysioctl'
15913 i_syslog='$i_syslog'
15914 i_sysmman='$i_sysmman'
15915 i_sysmode='$i_sysmode'
15916 i_sysmount='$i_sysmount'
15917 i_sysndir='$i_sysndir'
15918 i_sysparam='$i_sysparam'
15919 i_sysresrc='$i_sysresrc'
15920 i_syssecrt='$i_syssecrt'
15921 i_sysselct='$i_sysselct'
15922 i_syssockio='$i_syssockio'
15923 i_sysstat='$i_sysstat'
15924 i_sysstatfs='$i_sysstatfs'
15925 i_sysstatvfs='$i_sysstatvfs'
15926 i_systime='$i_systime'
15927 i_systimek='$i_systimek'
15928 i_systimes='$i_systimes'
15929 i_systypes='$i_systypes'
15930 i_sysuio='$i_sysuio'
15932 i_sysutsname='$i_sysutsname'
15933 i_sysvfs='$i_sysvfs'
15934 i_syswait='$i_syswait'
15935 i_termio='$i_termio'
15936 i_termios='$i_termios'
15938 i_unistd='$i_unistd'
15941 i_values='$i_values'
15942 i_varargs='$i_varargs'
15943 i_varhdr='$i_varhdr'
15945 ignore_versioned_solibs='$ignore_versioned_solibs'
15946 inc_version_list='$inc_version_list'
15947 inc_version_list_init='$inc_version_list_init'
15950 installarchlib='$installarchlib'
15951 installbin='$installbin'
15952 installman1dir='$installman1dir'
15953 installman3dir='$installman3dir'
15954 installprefix='$installprefix'
15955 installprefixexp='$installprefixexp'
15956 installprivlib='$installprivlib'
15957 installscript='$installscript'
15958 installsitearch='$installsitearch'
15959 installsitebin='$installsitebin'
15960 installsitelib='$installsitelib'
15961 installstyle='$installstyle'
15962 installusrbinperl='$installusrbinperl'
15963 installvendorarch='$installvendorarch'
15964 installvendorbin='$installvendorbin'
15965 installvendorlib='$installvendorlib'
15967 ivdformat='$ivdformat'
15970 known_extensions='$known_extensions'
15973 lddlflags='$lddlflags'
15975 ldflags_uselargefiles='$ldflags_uselargefiles'
15976 ldlibpthname='$ldlibpthname'
15983 libsdirs='$libsdirs'
15984 libsfiles='$libsfiles'
15985 libsfound='$libsfound'
15986 libspath='$libspath'
15987 libswanted='$libswanted'
15988 libswanted_uselargefiles='$libswanted_uselargefiles'
15994 locincpth='$locincpth'
15995 loclibpth='$loclibpth'
15996 longdblsize='$longdblsize'
15997 longlongsize='$longlongsize'
15998 longsize='$longsize'
16002 lseeksize='$lseeksize'
16003 lseektype='$lseektype'
16007 make_set_make='$make_set_make'
16008 mallocobj='$mallocobj'
16009 mallocsrc='$mallocsrc'
16010 malloctype='$malloctype'
16012 man1direxp='$man1direxp'
16015 man3direxp='$man3direxp'
16017 mips_type='$mips_type'
16019 mmaptype='$mmaptype'
16020 modetype='$modetype'
16022 multiarch='$multiarch'
16024 myarchname='$myarchname'
16025 mydomain='$mydomain'
16026 myhostname='$myhostname'
16029 netdb_hlen_type='$netdb_hlen_type'
16030 netdb_host_type='$netdb_host_type'
16031 netdb_name_type='$netdb_name_type'
16032 netdb_net_type='$netdb_net_type'
16035 nm_so_opt='$nm_so_opt'
16036 nonxs_ext='$nonxs_ext'
16038 nvEUformat='$nvEUformat'
16039 nvFUformat='$nvFUformat'
16040 nvGUformat='$nvGUformat'
16041 nveformat='$nveformat'
16042 nvfformat='$nvfformat'
16043 nvgformat='$nvgformat'
16046 o_nonblock='$o_nonblock'
16048 old_pthread_create_joinable='$old_pthread_create_joinable'
16049 optimize='$optimize'
16050 orderlib='$orderlib'
16053 otherlibdirs='$otherlibdirs'
16057 patchlevel='$patchlevel'
16058 path_sep='$path_sep'
16061 perladmin='$perladmin'
16062 perllibs='$perllibs'
16063 perlpath='$perlpath'
16065 phostname='$phostname'
16068 pm_apiversion='$pm_apiversion'
16072 prefixexp='$prefixexp'
16074 privlibexp='$privlibexp'
16075 prototype='$prototype'
16077 quadkind='$quadkind'
16078 quadtype='$quadtype'
16079 randbits='$randbits'
16080 randfunc='$randfunc'
16081 randseedtype='$randseedtype'
16083 rd_nodata='$rd_nodata'
16084 revision='$revision'
16088 sPRIEUldbl='$sPRIEUldbl'
16089 sPRIFUldbl='$sPRIFUldbl'
16090 sPRIGUldbl='$sPRIGUldbl'
16091 sPRIXU64='$sPRIXU64'
16093 sPRIeldbl='$sPRIeldbl'
16094 sPRIfldbl='$sPRIfldbl'
16095 sPRIgldbl='$sPRIgldbl'
16100 sSCNfldbl='$sSCNfldbl'
16101 sched_yield='$sched_yield'
16102 scriptdir='$scriptdir'
16103 scriptdirexp='$scriptdirexp'
16105 seedfunc='$seedfunc'
16106 selectminbits='$selectminbits'
16107 selecttype='$selecttype'
16108 sendmail='$sendmail'
16111 sharpbang='$sharpbang'
16112 shmattype='$shmattype'
16113 shortsize='$shortsize'
16116 sig_count='$sig_count'
16117 sig_name='$sig_name'
16118 sig_name_init='$sig_name_init'
16120 sig_num_init='$sig_num_init'
16121 signal_t='$signal_t'
16122 sitearch='$sitearch'
16123 sitearchexp='$sitearchexp'
16125 sitebinexp='$sitebinexp'
16127 sitelib_stem='$sitelib_stem'
16128 sitelibexp='$sitelibexp'
16129 siteprefix='$siteprefix'
16130 siteprefixexp='$siteprefixexp'
16131 sizesize='$sizesize'
16132 sizetype='$sizetype'
16136 sockethdr='$sockethdr'
16137 socketlib='$socketlib'
16138 socksizetype='$socksizetype'
16140 spackage='$spackage'
16141 spitshell='$spitshell'
16143 ssizetype='$ssizetype'
16144 startperl='$startperl'
16146 static_ext='$static_ext'
16148 stdio_base='$stdio_base'
16149 stdio_bufsiz='$stdio_bufsiz'
16150 stdio_cnt='$stdio_cnt'
16151 stdio_filbuf='$stdio_filbuf'
16152 stdio_ptr='$stdio_ptr'
16153 stdio_stream_array='$stdio_stream_array'
16156 subversion='$subversion'
16163 timeincl='$timeincl'
16164 timetype='$timetype'
16177 uidformat='$uidformat'
16183 uquadtype='$uquadtype'
16184 use5005threads='$use5005threads'
16185 use64bitall='$use64bitall'
16186 use64bitint='$use64bitint'
16188 useithreads='$useithreads'
16189 uselargefiles='$uselargefiles'
16190 uselongdouble='$uselongdouble'
16191 usemorebits='$usemorebits'
16192 usemultiplicity='$usemultiplicity'
16193 usemymalloc='$usemymalloc'
16195 useopcode='$useopcode'
16196 useperlio='$useperlio'
16197 useposix='$useposix'
16199 useshrplib='$useshrplib'
16200 usesocks='$usesocks'
16201 usethreads='$usethreads'
16202 usevendorprefix='$usevendorprefix'
16203 usevfork='$usevfork'
16206 uvXUformat='$uvXUformat'
16207 uvoformat='$uvoformat'
16210 uvuformat='$uvuformat'
16211 uvxformat='$uvxformat'
16212 vendorarch='$vendorarch'
16213 vendorarchexp='$vendorarchexp'
16214 vendorbin='$vendorbin'
16215 vendorbinexp='$vendorbinexp'
16216 vendorlib='$vendorlib'
16217 vendorlib_stem='$vendorlib_stem'
16218 vendorlibexp='$vendorlibexp'
16219 vendorprefix='$vendorprefix'
16220 vendorprefixexp='$vendorprefixexp'
16222 versiononly='$versiononly'
16224 voidflags='$voidflags'
16226 xs_apiversion='$xs_apiversion'
16231 : Add in command line options if available
16232 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
16234 : add special variables
16235 $test -f $src/patchlevel.h && \
16236 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
16237 echo "CONFIGDOTSH=true" >>config.sh
16239 : propagate old symbols
16240 if $test -f UU/config.sh; then
16241 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
16242 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
16243 $sort | $uniq -u >UU/oldsyms
16244 set X `cat UU/oldsyms`
16250 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
16252 echo "# Variables propagated from previous config.sh file." >>config.sh
16253 for sym in `cat UU/oldsyms`; do
16254 echo " Propagating $hint variable "'$'"$sym..."
16255 eval 'tmp="$'"${sym}"'"'
16257 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
16263 : Finish up by extracting the .SH files
16277 If you'd like to make any changes to the config.sh file before I begin
16278 to configure things, do it as a shell escape now (e.g. !vi config.sh).
16281 rp="Press return or use a shell escape to edit config.sh:"
16286 *) : in case they cannot read
16287 sh 1>&4 -c "$ans";;
16292 : if this fails, just run all the .SH files by hand
16299 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
16306 Now you need to generate make dependencies by running "$make depend".
16307 You might prefer to run it in background: "$make depend > makedepend.out &"
16308 It can take a while, so you might not want to run it right now.
16313 rp="Run $make depend now?"
16317 $make depend && echo "Now you must run '$make'."
16320 echo "You must run '$make depend' then '$make'."
16323 elif test -f [Mm]akefile; then
16325 echo "Now you must run a $make."
16330 if $test -f Policy.sh; then
16333 If you compile $package on a different machine or from a different object
16334 directory, copy the Policy.sh file from this object directory to the
16335 new one before you run Configure -- this will help you with most of
16336 the policy defaults.
16340 if $test -f config.msg; then
16341 echo "Hmm. I also noted the following information while running:"
16343 $cat config.msg >&4
16346 $rm -f kit*isdone ark*isdone