3 # If these # comments don't work, trim them. Don't worry about any other
4 # shell scripts, Configure will trim # comments from them for you.
6 # (If you are trying to port this package to a machine without sh,
7 # I would suggest you have a look at the prototypical config_h.SH file
8 # and edit it to reflect your system. Some packages may include samples
9 # of config.h for certain machines, so you might look for one of those.)
11 # Yes, you may rip this off to use in other distribution packages. This
12 # script belongs to the public domain and cannot be copyrighted.
14 # (Note: this Configure script was generated automatically. Rather than
15 # working with this copy of Configure, you may wish to get metaconfig.
16 # The dist-3.0 package (which contains metaconfig) was posted in
17 # comp.sources.misc and is available on CPAN under authors/id/RAM so
18 # you may fetch it yourself from your nearest archive site.)
21 # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
23 # Generated on Fri Jan 5 00:20:59 EET 2001 [metaconfig 3.0 PL70]
24 # (with additional metaconfig patches by perlbug@perl.org)
29 SCO csh still thinks true is false. Write to SCO today and tell them that next
30 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
32 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
33 we'd have to do is go in and swap the && and || tokens, wherever they are.)
35 [End of diatribe. We now return you to your regularly scheduled programming...]
39 OOPS! You naughty creature! You didn't run Configure with sh!
40 I will attempt to remedy the situation by running sh for you...
44 true || exec sh $0 $argv:q
46 (exit $?0) || cat c2$$
47 (exit $?0) || exec sh $0 $argv:q
50 : compute my invocation name
54 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
59 : Proper separator for the PATH environment variable
61 : On OS/2 this directory should exist if this is not floppy only system :-]
62 if test -d c:/. ; then
63 if test -n "$OS2_SHELL"; then
65 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
66 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
67 elif test -n "$DJGPP"; then
73 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
74 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
75 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
76 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
77 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
78 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /usr/ccs/bin"
79 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
80 paths="$paths /sbin /usr/sbin /usr/libexec"
86 *) test -d $p && PATH=$PATH$p_$p ;;
93 : shall we be using ksh?
99 if (PATH=.; alias -x) >/dev/null 2>&1; then
102 if test -f /hp-ux -a -f /bin/ksh; then
103 needksh='to avoid sh bug in "here document" expansion'
105 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
106 if test X`/usr/bin/uname -v` = X4; then
107 avoidksh="to avoid AIX 4's /bin/sh"
111 if test -f /osf_boot -a -f /usr/sbin/setld; then
112 if test X`/usr/bin/uname -s` = XOSF1; then
113 avoidksh="to avoid Digital UNIX' ksh"
115 unset BIN_SH # if this is 'xpg4' sh will start up ksh
118 case "$inksh/$needksh" in
125 case "$inksh/$avoidksh" in
131 case "$inksh/$needksh-$avoidksh-" in
134 (I see you are using the Korn shell. Some ksh's blow up on $me,
135 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
141 echo "(Feeding myself to $newsh $reason.)"
143 Configure|*/Configure) exec $newsh $0 "$@";;
144 *) exec $newsh Configure "$@";;
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
465 d_old_pthread_create_joinable=''
466 old_pthread_create_joinable=''
544 d_stdio_ptr_lval_nochange_cnt=''
545 d_stdio_ptr_lval_sets_cnt=''
717 inc_version_list_init=''
736 ignore_versioned_solibs=''
795 d_perl_otherlibdirs=''
812 d_nv_preserves_uv_bits=''
910 d_stdio_stream_array=''
911 stdio_stream_array=''
921 ccflags_uselargefiles=''
922 ldflags_uselargefiles=''
923 libswanted_uselargefiles=''
966 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
969 : We must find out about Eunice early
971 if test -f /etc/unixtovms; then
972 eunicefix=/etc/unixtovms
974 if test -f /etc/unixtovms.exe; then
975 eunicefix=/etc/unixtovms.exe
982 : set useposix=false in your hint file to disable the POSIX extension.
984 : set useopcode=false in your hint file to disable the Opcode extension.
986 : Trailing extension. Override this in a hint file, if needed.
988 : Extra object files, if any, needed on this platform.
991 : Possible local include directories to search.
992 : Set locincpth to "" in a hint file to defeat local include searches.
993 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
994 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
996 : no include file wanted by default
1000 : change the next line if compiling for Xenix/286 on Xenix/386
1001 xlibpth='/usr/lib/386 /lib/386'
1002 : Possible local library directories to search.
1003 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1004 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1006 : general looking path for locating libraries
1007 glibpth="/lib /usr/lib $xlibpth"
1008 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1009 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1010 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1012 : Private path used by Configure to find libraries. Its value
1013 : is prepended to libpth. This variable takes care of special
1014 : machines, like the mips. Usually, it should be empty.
1017 : default library list
1019 : some systems want to use only the non-versioned libso:s
1020 ignore_versioned_solibs=''
1022 ccflags_uselargefiles=''
1023 ldflags_uselargefiles=''
1024 libswanted_uselargefiles=''
1025 : set usemultiplicity on the Configure command line to enable multiplicity.
1026 : set usesocks on the Configure command line to enable socks.
1027 : set usethreads on the Configure command line to enable threads.
1028 : full support for void wanted by default
1031 : List of libraries we want.
1032 : If anyone needs -lnet, put it in a hint file.
1033 libswanted='sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl'
1034 libswanted="$libswanted dld ld sun m c cposix posix"
1035 libswanted="$libswanted ndir dir crypt sec"
1036 libswanted="$libswanted ucb bsd BSD PW x iconv util"
1037 : We probably want to search /usr/shlib before most other libraries.
1038 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1039 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1040 glibpth="/usr/shlib $glibpth"
1041 : Do not use vfork unless overridden by a hint file.
1044 : Find the basic shell for Bourne shell scripts
1048 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1051 if test -f "$xxx"; then
1054 : Build up a list and do a single loop so we can 'break' out.
1055 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1056 for xxx in sh bash ksh pdksh ash; do
1058 try="$try ${p}/${xxx}"
1062 if test -f "$xxx"; then
1065 elif test -f "$xxx.exe"; then
1076 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1078 Usually it's in /bin/sh. How did you even get this far?
1079 Please contact me (Perl Maintainers) at perlbug@perl.org and
1080 we'll try to straighten this all out.
1086 : see if sh knows # comments
1087 if `$sh -c '#' >/dev/null 2>&1`; then
1091 test -f $xcat || xcat=/usr/bin/cat
1096 if test -s today; then
1099 echo "#! $xcat" > try
1103 if test -s today; then
1111 echo "Your $sh doesn't grok # comments--I will strip them later on."
1114 echo "exec grep -v '^[ ]*#'" >spitshell
1116 $eunicefix spitshell
1117 spitshell=`pwd`/spitshell
1119 echo "I presume that if # doesn't work, #! won't work either!"
1124 : figure out how to guarantee sh startup
1126 '') startsh=${sharpbang}${sh} ;;
1138 : echo "Yup, it does."
1140 echo "Hmm... '$startsh' does not guarantee sh startup..."
1141 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1146 : Save command line options in file UU/cmdline.opt for later use in
1147 : generating config.sh.
1148 cat > cmdline.opt <<EOSH
1149 # Configure command line arguments.
1156 cat >>cmdline.opt <<EOSH
1157 config_arg$argn='$arg'
1159 argn=`expr $argn + 1`
1162 : produce awk script to parse command line options
1163 cat >options.awk <<'EOF'
1165 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1167 len = length(optstr);
1168 for (i = 1; i <= len; i++) {
1169 c = substr(optstr, i, 1);
1170 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1181 if (substr(str, 1, 1) != "-") {
1182 printf("'%s'\n", str);
1186 for (i = 2; i <= len; i++) {
1187 c = substr(str, i, 1);
1189 printf("-%s\n", substr(str, i));
1195 printf("'%s'\n", substr(str, i + 1));
1208 : process the command line options
1209 set X `for arg in "$@"; do echo "X$arg"; done |
1210 sed -e s/X// | awk -f options.awk`
1215 : set up default values
1225 rm -f optdef.sh posthint.sh
1226 cat >optdef.sh <<EOS
1232 while test $# -gt 0; do
1234 -d) shift; fastread=yes;;
1235 -e) shift; alldone=cont;;
1239 if test -r "$1"; then
1242 echo "$me: cannot read config file $1." >&2
1247 -h) shift; error=true;;
1248 -r) shift; reuseval=true;;
1249 -s) shift; silent=true; realsilent=true;;
1250 -E) shift; alldone=exit;;
1251 -K) shift; knowitall=true;;
1252 -O) shift; override=true;;
1253 -S) shift; silent=true; extractsh=true;;
1258 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1259 echo "$me: ignoring -D $1" >&2
1262 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1263 *) echo "$1='define'" >> optdef.sh;;
1270 *=) echo "$1" >> optdef.sh;;
1272 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1273 echo "$me: ignoring -U $1" >&2
1275 *) echo "$1='undef'" >> optdef.sh;;
1286 *=*) zzz=`echo $yyy|sed 's!=.*!!'`
1290 zzz=" "`echo $yyy|sed 's!^[^=]*=!!'`
1291 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1297 *:*) xxx=`echo $yyy|sed 's!:.*!!'`
1298 yyy=`echo $yyy|sed 's!^[^:]*:!!'`
1299 zzz=`echo $yyy|sed 's!^[^=]*=!!'`
1300 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1301 *) xxx=`echo $yyy|sed 's!:.*!!'`
1302 yyy=`echo $yyy|sed 's!^[^:]*:!!'` ;;
1308 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1310 echo "$yyy=''" >> posthint.sh ;;
1315 echo "$yyy='$zzz'" >> posthint.sh ;;
1317 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1319 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1324 echo "$yyy=$zzz" >> posthint.sh ;;
1325 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1329 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1332 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1340 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1341 [-U symbol] [-U symbol=] [-A command:symbol...]
1342 -d : use defaults for all answers.
1343 -e : go on without questioning past the production of config.sh.
1344 -f : specify an alternate default configuration file.
1345 -h : print this help message and exit (with an error status).
1346 -r : reuse C symbols value if possible (skips costly nm extraction).
1347 -s : silent mode, only echoes questions and essential information.
1348 -D : define symbol to have some value:
1349 -D symbol symbol gets the value 'define'
1350 -D symbol=value symbol gets the value 'value'
1351 -E : stop at the end of questions, after having produced config.sh.
1352 -K : do not use unless you know what you are doing.
1353 -O : let -D and -U override definitions from loaded configuration file.
1354 -S : perform variable substitutions on all .SH files (can mix with -f)
1355 -U : undefine symbol:
1356 -U symbol symbol gets the value 'undef'
1357 -U symbol= symbol gets completely empty
1358 -A : manipulate symbol after the platform specific hints have been applied:
1359 -A symbol=value append " "value to symbol
1360 -A append:symbol=value append value to symbol
1361 -A define:symbol=value define symbol to have value
1362 -A clear:symbol define symbol to be ''
1363 -A define:symbol define symbol to be 'define'
1364 -A eval:symbol=value define symbol to be eval of value
1365 -A prepend:symbol=value prepend value to symbol
1366 -A undef:symbol define symbol to be 'undef'
1367 -A undef:symbol= define symbol to be ''
1368 -V : print version number and exit (with a zero status).
1375 case "$fastread$alldone" in
1378 case "$extractsh" in
1381 if test ! -t 0; then
1382 echo "Say 'sh Configure', not 'sh <Configure'"
1392 true) exec 1>/dev/null;;
1395 : run the defines and the undefines, if any, but leave the file out there...
1398 : create the posthint manipulation script and leave the file out there...
1403 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1404 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1405 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1406 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1407 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1410 : Some greps do not return status, grrr.
1411 echo "grimblepritz" >grimble
1412 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1414 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1420 : the following should work in any shell
1424 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1425 cat >contains <<'EOSS'
1426 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1431 : Find the path to the source tree
1434 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1437 *) src=`cd ../$src && pwd` ;;
1450 if test -f $rsrc/Configure && \
1451 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1453 : found it, so we are ok.
1456 for src in . .. ../.. ../../.. ../../../..; do
1457 if test -f ../$src/Configure && \
1458 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1469 Sorry, I can't seem to locate the source dir for $package. Please start
1470 Configure with an explicit path -- i.e. /some/path/Configure.
1478 echo "Sources for $package found in \"$src\"." >&4
1482 : script used to extract .SH files with variable substitutions
1483 cat >extract <<'EOS'
1485 echo "Doing variable substitutions on .SH files..."
1486 if test -f $src/MANIFEST; then
1487 set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH$'`
1489 echo "(Looking for .SH files under the source directory.)"
1490 set x `(cd $src; find . -name "*.SH" -print)`
1494 0) set x `(cd $src; echo *.SH)`; shift;;
1496 if test ! -f $src/$1; then
1502 while test $name; do
1503 if test ! -d "$name"; then
1504 create="$name $create";
1505 name=`echo $name | sed -e "s|^[^/]*$||"`;
1506 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1511 for file in $create; do
1520 dir=`expr X$file : 'X\(.*\)/'`
1521 file=`expr X$file : 'X.*/\(.*\)'`
1522 (cd $dir && . ./$file)
1532 dir=`expr X$file : 'X\(.*\)/'`
1533 file=`expr X$file : 'X.*/\(.*\)'`
1534 (set x $dir; shift; eval $mkdir_p)
1544 if test -f $src/config_h.SH; then
1545 if test ! -f config.h; then
1546 : oops, they left it out of MANIFEST, probably, so do it anyway.
1552 : extract files and exit if asked to do so
1553 case "$extractsh" in
1555 case "$realsilent" in
1559 case "$config_sh" in
1560 '') config_sh='config.sh';;
1563 echo "Fetching answers from $config_sh..."
1566 test "$override" && . ./optdef.sh
1575 : Eunice requires " " instead of "", can you believe it
1578 echo "Beginning of configuration questions for $package."
1580 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1582 : first determine how to suppress newline on echo command
1584 echo "Checking echo to see how to suppress newlines..."
1585 (echo "hi there\c" ; echo " ") >.echotmp
1586 if $contains c .echotmp >/dev/null 2>&1 ; then
1597 echo $n "The star should be here-->$c"
1601 : Now test for existence of everything in MANIFEST
1603 if test -f $rsrc/MANIFEST; then
1604 echo "First let's make sure your kit is complete. Checking..." >&4
1605 awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
1608 for filelist in x??; do
1609 (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
1611 if test -s missing; then
1615 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1617 You have the option of continuing the configuration process, despite the
1618 distinct possibility that your kit is damaged, by typing 'y'es. If you
1619 do, don't blame me if something goes wrong. I advise you to type 'n'o
1620 and contact the author (perlbug@perl.org).
1623 echo $n "Continue? [n] $c" >&4
1627 echo "Continuing..." >&4
1631 echo "ABORTING..." >&4
1636 echo "Looks good..."
1639 echo "There is no MANIFEST file. I hope your kit is complete !"
1644 : Find the appropriate value for a newline for tr
1645 if test -n "$DJGPP"; then
1648 if test X"$trnl" = X; then
1649 case "`echo foo|tr '\n' x 2>/dev/null`" in
1653 if test X"$trnl" = X; then
1654 case "`echo foo|tr '\012' x 2>/dev/null`" in
1655 foox) trnl='\012' ;;
1658 if test X"$trnl" = X; then
1661 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1667 : compute the number of columns on the terminal for proper question formatting
1672 : set up the echo used in my read
1673 myecho="case \"\$xxxm\" in
1674 '') echo $n \"\$rp $c\" >&4;;
1676 '') echo $n \"[\$xxxm] $c\";;
1678 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1680 echo $n \"[\$xxxm] $c\" >&4
1682 echo $n \"\$rp [\$xxxm] $c\" >&4
1688 : now set up to do reads with possible shell escape and default assignment
1694 case "\$fastread" in
1695 yes) case "\$dflt" in
1698 case "\$silent-\$rp" in
1703 *) case "\$silent" in
1704 true) case "\$rp" in
1709 while expr "X\$ans" : "X!" >/dev/null; do
1713 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1721 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1730 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1735 echo "(OK, I'll run with -d after this question.)" >&4
1738 echo "*** Sorry, \$1 not supported yet." >&4
1748 echo "*** Substitution done -- please confirm."
1750 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1755 echo "*** Error -- try again."
1762 case "\$ans\$xxxm\$nostick" in
1774 : create .config dir to save info across Configure sessions
1775 test -d ../.config || mkdir ../.config
1776 cat >../.config/README <<EOF
1777 This directory created by Configure to save information that should
1778 persist across sessions for $package.
1780 You may safely delete it if you wish.
1783 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
1785 $define|true|[yY]*) ;;
1786 *) case "$xversion" in
1789 *** WHOA THERE!!! ***
1791 This is an UNSTABLE DEVELOPMENT release.
1792 The version of this $package distribution is $xversion, that is, odd,
1793 (as opposed to even) and that signifies a development release.
1794 If you want a maintenance release, you want an even-numbered version.
1796 Do ***NOT*** install this into production use.
1797 Data corruption and crashes are possible.
1799 It is most seriously suggested that you do not continue any further
1800 unless you want to help in developing and debugging Perl.
1803 rp='Do you really want to continue?'
1807 [yY]) echo >&4 "Okay, continuing." ;;
1808 *) echo >&4 "Okay, bye."
1817 : general instructions
1820 user=`(logname) 2>/dev/null`
1822 '') user=`whoami 2>&1`;;
1824 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1827 rp='Would you like to see the instructions?'
1838 This installation shell script will examine your system and ask you questions
1839 to determine how the perl5 package should be installed. If you get
1840 stuck on a question, you may use a ! shell escape to start a subshell or
1841 execute a command. Many of the questions will have default answers in square
1842 brackets; typing carriage return will give you the default.
1844 On some of the questions which ask for file or directory names you are allowed
1845 to use the ~name construct to specify the login directory belonging to "name",
1846 even if you don't have a shell which knows about that. Questions where this is
1847 allowed will be marked "(~name ok)".
1851 dflt='Type carriage return to continue'
1855 The prompter used in this script allows you to use shell variables and
1856 backticks in your answers. You may use $1, $2, etc... to refer to the words
1857 in the default answer, as if the default line was a set of arguments given to a
1858 script shell. This means you may also use $* to repeat the whole default line,
1859 so you do not have to re-type everything to add something to the default.
1861 Everytime there is a substitution, you will have to confirm. If there is an
1862 error (e.g. an unmatched backtick), the default answer will remain unchanged
1863 and you will be prompted again.
1865 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1866 the questions and use the computed defaults (or the previous answers if there
1867 was already a config.sh file). Type 'Configure -h' for a list of options.
1868 You may also start interactively and then answer '& -d' at any prompt to turn
1869 on the non-interactive behaviour for the remainder of the execution.
1875 Much effort has been expended to ensure that this shell script will run on any
1876 Unix system. If despite that it blows up on yours, your best bet is to edit
1877 Configure and run it again. If you can't run Configure for some reason,
1878 you'll have to generate a config.sh file by hand. Whatever problems you
1879 have, let me (perlbug@perl.org) know how I blew it.
1881 This installation script affects things in two ways:
1883 1) it may do direct variable substitutions on some of the files included
1885 2) it builds a config.h file for inclusion in C programs. You may edit
1886 any of these files as the need arises after running this script.
1888 If you make a mistake on a question, there is no easy way to back up to it
1889 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1890 files. Configure will offer to let you do this before it runs the SH files.
1893 dflt='Type carriage return to continue'
1895 case "$firsttime" in
1896 true) echo $user >>../.config/instruct;;
1900 : find out where common programs are
1902 echo "Locating common programs..." >&4
1915 if test -d \$dir/\$thing; then
1921 for thisthing in \$dir/\$thing; do
1922 : just loop through to pick last item
1924 if test -f \$thisthing; then
1927 elif test -f \$dir/\$thing.exe; then
1928 if test -n "$DJGPP"; then
1929 echo \$dir/\$thing.exe
1931 : on Eunice apparently
1981 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1982 pth="$pth /lib /usr/lib"
1983 for file in $loclist; do
1987 if test -f "$xxx"; then
1990 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1991 xxx=`./loc $file $file $pth`
1994 '') xxx=`./loc $file $file $pth`;;
1995 *) xxx=`./loc $xxx $xxx $pth`;;
2001 echo $file is in $xxx.
2004 echo $file is in $xxx.
2007 echo "I don't know where '$file' is, and my life depends on it." >&4
2008 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2014 echo "Don't worry if any of the following aren't found..."
2016 for file in $trylist; do
2020 if test -f "$xxx"; then
2023 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2024 xxx=`./loc $file $file $pth`
2027 '') xxx=`./loc $file $file $pth`;;
2028 *) xxx=`./loc $xxx $xxx $pth`;;
2034 echo $file is in $xxx.
2037 echo $file is in $xxx.
2040 echo "I don't see $file out there, $say."
2047 echo "Substituting grep for egrep."
2053 echo "Substituting cp for ln."
2059 echo "Hopefully test is built into your sh."
2062 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2063 echo "Using the test built into your sh."
2064 echo "Using the test built into your sh."
2072 echo "Hopefully echo is built into your sh."
2077 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2078 $echo $n "hi there$c" >foo1
2079 echo $n "hi there$c" >foo2
2080 if cmp foo1 foo2 >/dev/null 2>&1; then
2081 echo "They are compatible. In fact, they may be identical."
2088 They are not compatible! You are probably running ksh on a non-USG system.
2089 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2090 have echo built in and we may have to run some Bourne shell scripts. That
2091 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2094 $echo $n "The star should be here-->$c"
2104 cat <<'EOSC' >>checkcc
2109 int main(int argc, char *argv[]) {
2113 if $cc -o try $ccflags try.c; then
2116 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2122 case "`$cc -v -c try.c 2>&1`" in
2125 if $test X"$trygcc" = Xyes; then
2126 if gcc -o try -c try.c; then
2128 echo "You seem to have a working gcc, though." >&4
2129 rp="Would you like to use it?"
2131 if $test -f myread; then
2134 if $test -f UU/myread; then
2137 echo "Cannot find myread, sorry. Aborting." >&2
2142 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no ;;
2146 if $test X"$despair" = Xyes; then
2148 You need to find a working C compiler.
2149 Either (purchase and) install the C compiler supplied by your OS vendor,
2150 or for a free C compiler try http://gcc.gnu.org/
2151 I cannot continue any further, aborting.
2161 : determine whether symbolic links are supported
2164 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2165 echo "Symbolic links are supported." >&4
2168 echo "Symbolic links are NOT supported." >&4
2173 : determine whether symbolic links are supported
2177 echo "Checking how to test for symbolic links..." >&4
2179 if $test "X$issymlink" = X; then
2180 sh -c "PATH= test -h sym" >/dev/null 2>&1
2181 if test $? = 0; then
2185 if $test "X$issymlink" = X; then
2186 if $test -h >/dev/null 2>&1; then
2187 issymlink="$test -h"
2188 echo "Your builtin 'test -h' may be broken, I'm using external '$test -h'." >&4
2191 if $test "X$issymlink" = X; then
2192 if $test -L sym 2>/dev/null; then
2193 issymlink="$test -L"
2196 if $test "X$issymlink" != X; then
2197 echo "You can test for symbolic links with '$issymlink'." >&4
2199 echo "I do not know how you can test for symbolic links." >&4
2203 *) echo "No symbolic links, so not testing for their testing..." >&4
2209 case "$mksymlinks" in
2212 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2215 *) case "$lns:$issymlink" in
2216 *"ln -s:"*"test -"?)
2217 echo "Creating the symbolic links..." >&4
2218 echo "(First creating the subdirectories...)" >&4
2220 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2222 test -z "$directory" && break
2226 if test ! -d t/base; then
2227 echo "Failed to create the subdirectories. Aborting." >&4
2230 echo "(Then creating the symlinks...)" >&4
2231 awk '{print $1}' $src/MANIFEST | while true; do
2233 test -z "$filename" && break
2234 if test -f $filename; then
2235 if $issymlink $filename; then
2239 if test -f $filename; then
2240 echo "$filename already exists, not symlinking."
2242 ln -s $src/$filename $filename
2246 if test ! -f t/base/commonsense.t; then
2247 echo "Failed to create the symlinks. Aborting." >&4
2252 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2260 : see whether [:lower:] and [:upper:] are supported character classes
2262 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2264 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2268 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
2269 # (0xc9 and 0xd1), therefore that is a nice testing point.
2270 if test "X$up" = X -o "X$low" = X; then
2271 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
2277 if test "X$up" = X -o "X$low" = X; then
2278 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
2284 if test "X$up" = X -o "X$low" = X; then
2285 case "`echo IJ | od -x 2>/dev/null`" in
2287 echo "Hey, this might be EBCDIC." >&4
2288 if test "X$up" = X -o "X$low" = X; then
2289 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2290 ij) up='[A-IJ-RS-Z]'
2295 if test "X$up" = X -o "X$low" = X; then
2296 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2306 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
2308 echo "Using $up and $low to convert case." >&4
2311 echo "I don't know how to translate letters from upper to lower case." >&4
2312 echo "Your tr is not acting any way I know of." >&4
2316 : set up the translation script tr, must be called with ./tr of course
2320 '[A-Z][a-z]') exec $tr '$up' '$low';;
2321 '[a-z][A-Z]') exec $tr '$low' '$up';;
2328 : Try to determine whether config.sh was made on this system
2329 case "$config_sh" in
2331 myuname=`$uname -a 2>/dev/null`
2332 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2333 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2334 # because the A-Z/a-z are not consecutive.
2335 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2336 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2337 newmyuname="$myuname"
2339 case "$knowitall" in
2341 if test -f ../config.sh; then
2342 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2343 eval "`grep myuname= ../config.sh`"
2345 if test "X$myuname" = "X$newmyuname"; then
2353 : Get old answers from old config file if Configure was run on the
2354 : same system, otherwise use the hints.
2357 if test -f config.sh; then
2359 rp="I see a config.sh file. Shall I use it to set the defaults?"
2362 n*|N*) echo "OK, I'll ignore it."
2363 mv config.sh config.sh.old
2364 myuname="$newmyuname"
2366 *) echo "Fetching default answers from your old config.sh file..." >&4
2374 : Older versions did not always set $sh. Catch re-use of such
2384 if test ! -f config.sh; then
2387 First time through, eh? I have some defaults handy for some systems
2388 that need some extra help getting the Configure answers right:
2391 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2393 : Half the following guesses are probably wrong... If you have better
2394 : tests or hints, please send them to perlbug@perl.org
2395 : The metaconfig authors would also appreciate a copy...
2396 $test -f /irix && osname=irix
2397 $test -f /xenix && osname=sco_xenix
2398 $test -f /dynix && osname=dynix
2399 $test -f /dnix && osname=dnix
2400 $test -f /lynx.os && osname=lynxos
2401 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2402 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
2403 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2404 $test -f /bin/mips && /bin/mips && osname=mips
2405 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
2406 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
2407 $test -d /usr/apollo/bin && osname=apollo
2408 $test -f /etc/saf/_sactab && osname=svr4
2409 $test -d /usr/include/minix && osname=minix
2410 if $test -d /MachTen -o -d /MachTen_Folder; then
2412 if $test -x /sbin/version; then
2413 osvers=`/sbin/version | $awk '{print $2}' |
2414 $sed -e 's/[A-Za-z]$//'`
2415 elif $test -x /usr/etc/version; then
2416 osvers=`/usr/etc/version | $awk '{print $2}' |
2417 $sed -e 's/[A-Za-z]$//'`
2423 $test -f /sys/posix.dll &&
2424 $test -f /usr/bin/what &&
2425 set X `/usr/bin/what /sys/posix.dll` &&
2426 $test "$3" = UWIN &&
2430 if $test -f $uname; then
2438 umips) osname=umips ;;
2441 [23]100) osname=mips ;;
2442 next*) osname=next ;;
2444 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
2445 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
2448 elif $test -f /etc/kconfig; then
2450 if test "$lns" = "$ln -s"; then
2452 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
2454 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
2461 if test -n "$DJGPP"; then
2470 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
2472 'not found') osvers="$4"."$3" ;;
2473 '<3240'|'<>3240') osvers=3.2.0 ;;
2474 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
2475 '=3250'|'>3250') osvers=3.2.5 ;;
2479 bsd386) osname=bsd386
2482 cygwin*) osname=cygwin
2485 *dc.osx) osname=dcosx
2491 domainos) osname=apollo
2497 dynixptx*) osname=dynixptx
2498 osvers=`echo "$4"|sed 's/^v//'`
2500 freebsd) osname=freebsd
2502 genix) osname=genix ;;
2504 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
2520 netbsd*) osname=netbsd
2523 news-os) osvers="$3"
2525 4*) osname=newsos4 ;;
2529 next*) osname=next ;;
2530 nonstop-ux) osname=nonstopux ;;
2531 POSIX-BC | posix-bc ) osname=posix-bc
2534 powerux | power_ux | powermax_os | powermaxos | \
2535 powerunix | power_unix) osname=powerux
2541 solaris) osname=solaris
2543 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2550 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2554 titanos) osname=titanos
2563 ultrix) osname=ultrix
2566 osf1|mls+) case "$5" in
2569 osvers=`sizer -v | awk '{print $3}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
2572 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
2575 hp*) osname=hp_osf1 ;;
2576 mips) osname=mips_osf1 ;;
2579 unixware) osname=svr5
2585 $2) case "$osname" in
2589 : svr4.x or possibly later
2599 if test -f /stand/boot ; then
2600 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
2601 if test -n "$INITPROG" -a -f "$INITPROG"; then
2602 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
2603 if test -n "$isesix"; then
2611 *) if test -f /etc/systemid; then
2613 set `echo $3 | $sed 's/\./ /g'` $4
2614 if $test -f $src/hints/sco_$1_$2_$3.sh; then
2616 elif $test -f $src/hints/sco_$1_$2.sh; then
2618 elif $test -f $src/hints/sco_$1.sh; then
2623 '') : Still unknown. Probably a generic Sys V.
2632 *) case "$osname" in
2633 '') : Still unknown. Probably a generic BSD.
2641 if test -f /vmunix -a -f $src/hints/news_os.sh; then
2642 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
2643 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
2646 $rm -f UU/kernel.what
2647 elif test -d c:/.; then
2654 : Now look for a hint file osname_osvers, unless one has been
2655 : specified already.
2658 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
2659 : Also try without trailing minor version numbers.
2660 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
2661 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
2662 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
2663 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
2666 *) case "$osvers" in
2669 *) if $test -f $src/hints/$file.sh ; then
2671 elif $test -f $src/hints/$xfile.sh ; then
2673 elif $test -f $src/hints/$xxfile.sh ; then
2675 elif $test -f $src/hints/$xxxfile.sh ; then
2677 elif $test -f $src/hints/$xxxxfile.sh ; then
2679 elif $test -f "$src/hints/${osname}.sh" ; then
2688 if $test -f Policy.sh ; then
2691 none) dflt="Policy" ;;
2692 *) dflt="Policy $dflt" ;;
2697 dflt=`echo $hintfile | $sed 's/\.sh$//'`
2701 if $test -f Policy.sh ; then
2704 There's also a Policy hint file available, which should make the
2705 site-specific (policy) questions easier to answer.
2712 You may give one or more space-separated answers, or "none" if appropriate.
2713 A well-behaved OS will have no hints, so answering "none" or just "Policy"
2714 is a good thing. DO NOT give a wrong version or a wrong OS.
2718 rp="Which of these apply, if any?"
2721 for file in $tans; do
2722 if $test X$file = XPolicy -a -f Policy.sh; then
2724 $cat Policy.sh >> UU/config.sh
2725 elif $test -f $src/hints/$file.sh; then
2726 . $src/hints/$file.sh
2727 $cat $src/hints/$file.sh >> UU/config.sh
2728 elif $test X$tans = X -o X$tans = Xnone ; then
2731 : Give one chance to correct a possible typo.
2732 echo "$file.sh does not exist"
2734 rp="hint to use instead?"
2736 for file in $ans; do
2737 if $test -f "$src/hints/$file.sh"; then
2738 . $src/hints/$file.sh
2739 $cat $src/hints/$file.sh >> UU/config.sh
2740 elif $test X$ans = X -o X$ans = Xnone ; then
2743 echo "$file.sh does not exist -- ignored."
2750 : Remember our hint file for later.
2751 if $test -f "$src/hints/$file.sh" ; then
2761 echo "Fetching default answers from $config_sh..." >&4
2765 cp $config_sh config.sh 2>/dev/null
2775 test "$override" && . ./optdef.sh
2777 : Restore computed paths
2778 for file in $loclist $trylist; do
2779 eval $file="\$_$file"
2784 Configure uses the operating system name and version to set some defaults.
2785 The default value is probably right if the name rings a bell. Otherwise,
2786 since spelling matters for me, either accept the default or answer "none"
2793 ''|' '|none) dflt=none ;;
2794 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
2797 *) dflt="$osname" ;;
2799 rp="Operating system name?"
2803 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
2809 ''|' '|none) dflt=none ;;
2810 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
2811 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
2813 ''|' ') dflt=none ;;
2818 *) dflt="$osvers" ;;
2820 rp="Operating system version?"
2830 : who configured the system
2831 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
2832 cf_by=`(logname) 2>/dev/null`
2835 cf_by=`(whoami) 2>/dev/null`
2837 "") cf_by=unknown ;;
2841 : set up the script used to warn in case of inconsistency
2848 echo "*** WHOA THERE!!! ***" >&4
2849 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2850 rp=" Keep the $hint value?"
2853 y) td=$was; tu=$was;;
2857 : function used to set $1 to $val
2858 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2860 $define$undef) . ./whoa; eval "$var=\$td";;
2861 $undef$define) . ./whoa; eval "$var=\$tu";;
2862 *) eval "$var=$val";;
2865 case "$usethreads" in
2866 $define|true|[yY]*) dflt='y';;
2871 Perl can be built to take advantage of threads on some systems.
2872 To do so, Configure can be run with -Dusethreads.
2874 Note that threading is a highly experimental feature, and
2875 some known race conditions still remain. If you choose to try
2876 it, be very sure to not actually deploy it for production
2877 purposes. README.threads has more details, and is required
2878 reading if you enable threads.
2880 If this doesn't make any sense to you, just accept the default '$dflt'.
2882 rp='Build a threading Perl?'
2885 y|Y) val="$define" ;;
2891 case "$usethreads" in
2895 As of 5.5.640, Perl has two different internal threading implementations,
2896 the 5.005 version (5005threads) and an interpreter-based version
2897 (ithreads) that has one interpreter per thread. Both are very
2898 experimental. This arrangement exists to help developers work out
2899 which one is better.
2901 If you're a casual user, you probably don't want interpreter-threads
2902 at this time. There doesn't yet exist a way to create threads from
2903 within Perl in this model, i.e., "use Thread;" will NOT work.
2905 : Default to ithreads unless overridden on command line or with
2908 case "$use5005threads" in
2909 $define|true|[yY]*) dflt='n';;
2911 case "$useithreads" in
2912 $undef|false|[nN]*) dflt='n';;
2914 rp='Use interpreter-based ithreads?'
2917 y|Y) val="$define" ;;
2922 : Now set use5005threads to the opposite value.
2923 case "$useithreads" in
2924 $define) val="$undef" ;;
2931 useithreads="$undef"
2932 use5005threads="$undef"
2936 case "$d_oldpthreads" in
2937 '') : Configure tests would be welcome here. For now, assume undef.
2939 *) val="$d_oldpthreads" ;;
2945 case "$usethreads" in
2946 "$define"|true|[yY]*)
2947 : Look for a hint-file generated 'call-back-unit'. If the
2948 : user has specified that a threading perl is to be built,
2949 : we may need to set or change some other defaults.
2950 if $test -f usethreads.cbu; then
2951 echo "Your platform has some specific hints for threaded builds, using them..."
2955 (Your platform doesn't have any specific hints for threaded builds.
2956 Assuming POSIX threads, then.)
2964 Perl can be built so that multiple Perl interpreters can coexist
2965 within the same Perl executable.
2968 case "$useithreads" in
2971 This multiple interpreter support is required for interpreter-based threads.
2975 *) case "$usemultiplicity" in
2976 $define|true|[yY]*) dflt='y';;
2980 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
2981 rp='Build Perl for multiplicity?'
2984 y|Y) val="$define" ;;
2992 : make some quick guesses about what we are up against
2994 $echo $n "Hmm... $c"
3004 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
3005 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
3007 echo "Looks kind of like an OSF/1 system, but we'll see..."
3009 elif test `echo abc | $tr a-z A-Z` = Abc ; then
3010 xxx=`./loc addbib blurfl $pth`
3011 if $test -f $xxx; then
3012 echo "Looks kind of like a USG system with BSD features, but we'll see..."
3016 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
3017 echo "Looks kind of like an extended USG system, but we'll see..."
3019 echo "Looks kind of like a USG system, but we'll see..."
3023 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
3024 echo "Looks kind of like a BSD system, but we'll see..."
3028 echo "Looks kind of like a Version 7 system, but we'll see..."
3031 case "$eunicefix" in
3034 There is, however, a strange, musty smell in the air that reminds me of
3035 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
3039 : it so happens the Eunice I know will not run shell scripts in Unix format
3043 echo "Congratulations. You aren't running Eunice."
3047 : Detect OS2. The p_ variable is set above in the Head.U unit.
3048 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
3049 : semicolon as a patch separator
3054 I have the feeling something is not exactly right, however...don't tell me...
3055 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
3056 (Or you may be running DOS with DJGPP.)
3061 if test -f /xenix; then
3062 echo "Actually, this looks more like a XENIX system..."
3067 echo "It's not Xenix..."
3072 if test -f /venix; then
3073 echo "Actually, this looks more like a VENIX system..."
3080 echo "Nor is it Venix..."
3083 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3084 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3091 rp="Use which C compiler?"
3094 : Look for a hint-file generated 'call-back-unit'. Now that the
3095 : user has specified the compiler, we may need to set or change some
3097 if $test -f cc.cbu; then
3103 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3104 $cat >gccvers.c <<EOM
3109 printf("%s\n", __VERSION__);
3111 printf("%s\n", "1");
3117 if $cc -o gccvers $ldflags gccvers.c; then
3118 gccversion=`./gccvers`
3119 case "$gccversion" in
3120 '') echo "You are not using GNU cc." ;;
3121 *) echo "You are using GNU cc $gccversion."
3127 echo "*** WHOA THERE!!! ***" >&4
3128 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3129 case "$knowitall" in
3131 echo " You'd better start hunting for one and let me know about it." >&4
3137 case "$gccversion" in
3138 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3140 case "$gccversion" in
3141 '') gccosandvers='' ;;
3142 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
3143 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
3145 case "$gccosandvers" in
3146 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
3147 $osname$osvers) ;; # looking good
3148 $osname*) cat <<EOM >&4
3150 *** WHOA THERE!!! ***
3152 Your gcc has not been compiled for the exact release of
3153 your operating system ($gccosandvers versus $osname$osvers).
3155 In general it is a good idea to keep gcc synchronized with
3156 the operating system because otherwise serious problems
3157 may ensue when trying to compile software, like Perl.
3159 I'm trying to be optimistic here, though, and will continue.
3160 If later during the configuration and build icky compilation
3161 problems appear (headerfile conflicts being the most common
3162 manifestation), I suggest reinstalling the gcc to match
3163 your operating system release.
3167 *) gccosandvers='' ;; # failed to parse, better be silent
3175 : see how we invoke the C preprocessor
3177 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3178 cat <<'EOT' >testcpp.c
3184 if test ! -f cppstdin; then
3185 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
3186 # AIX cc -E doesn't show the absolute headerfile
3187 # locations but we'll cheat by using the -M flag.
3188 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
3190 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3193 echo "Keeping your $hint cppstdin wrapper."
3196 wrapper=`pwd`/cppstdin
3200 if $test "X$cppstdin" != "X" && \
3201 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3202 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3204 echo "You used to use $cppstdin $cppminus so we'll use that again."
3206 '') echo "But let's see if we can live without a wrapper..." ;;
3208 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3209 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3211 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3214 echo "(However, $cpprun $cpplast does not work, let's see...)"
3222 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3229 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3230 $cc -E <testcpp.c >testcpp.out 2>&1; \
3231 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3232 echo "Yup, it does."
3235 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
3236 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3237 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3238 echo "Yup, it does."
3241 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
3242 $cc -P <testcpp.c >testcpp.out 2>&1; \
3243 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3244 echo "Yipee, that works!"
3247 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
3248 $cc -P - <testcpp.c >testcpp.out 2>&1; \
3249 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3250 echo "At long last!"
3253 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
3254 $cpp <testcpp.c >testcpp.out 2>&1; \
3255 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3259 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
3260 $cpp - <testcpp.c >testcpp.out 2>&1; \
3261 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3262 echo "Hooray, it works! I was beginning to wonder."
3265 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
3266 $wrapper <testcpp.c >testcpp.out 2>&1; \
3267 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3273 rp="No dice. I can't find a C preprocessor. Name one:"
3277 $x_cpp <testcpp.c >testcpp.out 2>&1
3278 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3279 echo "OK, that will do." >&4
3281 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
3296 echo "Perhaps can we force $cc -E using a wrapper..."
3297 if $wrapper <testcpp.c >testcpp.out 2>&1; \
3298 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3304 echo "Nope, we'll have to live without it..."
3318 "$wrapper"|'cppstdin') ;;
3319 *) $rm -f $wrapper;;
3321 $rm -f testcpp.c testcpp.out
3323 : decide how portable to be. Allow command line overrides.
3324 case "$d_portable" in
3326 *) d_portable="$define" ;;
3329 : set up shell script to do ~ expansion
3335 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3338 if $test -f /bin/csh; then
3339 /bin/csh -f -c "glob \$1"
3344 name=\`$expr x\$1 : '..\([^/]*\)'\`
3345 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3346 if $test ! -d "\$dir"; then
3348 echo "\$me: can't locate home directory for: \$name" >&2
3353 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3369 : now set up to get a file name
3373 cat <<'EOSC' >>getfile
3389 expr $fn : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3390 fn=`echo $fn | sed 's/(.*)//'`
3396 loc_file=`expr $fn : '.*:\(.*\)'`
3397 fn=`expr $fn : '\(.*\):.*'`
3405 */*) fullpath=true;;
3414 *e*) exp_file=true;;
3417 *p*) nopath_ok=true;;
3422 *d*) type='Directory';;
3423 *l*) type='Locate';;
3428 Locate) what='File';;
3433 case "$d_portable" in
3441 while test "$type"; do
3446 true) rp="$rp (~name ok)";;
3449 if test -f UU/getfile.ok && \
3450 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3469 value=`UU/filexp $ans`
3472 if test "$ans" != "$value"; then
3473 echo "(That expands to $value on this system.)"
3487 /*) value="$ansexp" ;;
3488 [a-zA-Z]:/*) value="$ansexp" ;;
3493 echo "I shall only accept a full path name, as in /bin/ls." >&4
3494 echo "Use a ! shell escape if you wish to check pathnames." >&4
3497 echo "Please give a full path name, starting with slash." >&4
3500 echo "Note that using ~name is ok provided it expands well." >&4
3513 for fp in $gfpth; do
3514 if test "X$fp" = X.; then
3519 if test -f "$pf"; then
3521 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3523 echo "($value is not a plain file, but that's ok.)"
3526 if test X"$type" = X; then
3533 for fp in $gfpth; do
3534 if test "X$fp" = X.; then
3539 direxp="$fp/$ansexp"
3541 if test -d "$direxp"; then
3549 if test -d "$ansexp"; then
3550 echo "(Looking for $loc_file in directory $value.)"
3551 value="$value/$loc_file"
3552 ansexp="$ansexp/$loc_file"
3554 if test -f "$ansexp"; then
3557 case "$nopath_ok" in
3558 true) case "$value" in
3560 *) echo "Assuming $value will be in people's path."
3576 if test "$fastread" = yes; then
3581 rp="$what $value doesn't exist. Use that name anyway?"
3600 test "X$gfpthkeep" != Xy && gfpth=""
3603 : What should the include directory be ?
3605 $echo $n "Hmm... $c"
3609 if $test -f /bin/mips && /bin/mips; then
3610 echo "Looks like a MIPS system..."
3611 $cat >usr.c <<'EOCP'
3612 #ifdef SYSTYPE_BSD43
3616 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3617 dflt='/bsd43/usr/include'
3621 mips_type='System V'
3623 $rm -f usr.c usr.out
3624 echo "and you're compiling with the $mips_type compiler and libraries."
3628 echo "Doesn't look like a MIPS system."
3638 case "$xxx_prompt" in
3641 rp='Where are the include files you want to use?'
3649 : Set private lib path
3652 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
3657 '') dlist="$loclibpth $plibpth $glibpth";;
3658 *) dlist="$libpth";;
3661 : Now check and see which directories actually exist, avoiding duplicates
3665 if $test -d $xxx; then
3668 *) libpth="$libpth $xxx";;
3674 Some systems have incompatible or broken versions of libraries. Among
3675 the directories listed in the question below, please remove any you
3676 know not to be holding relevant libraries, and add any that are needed.
3677 Say "none" for none.
3688 rp="Directories to use for library searches?"
3695 : compute shared library extension
3698 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
3708 On some systems, shared libraries may be available. Answer 'none' if
3709 you want to suppress searching of shared libraries for the remainder
3710 of this configuration.
3713 rp='What is the file extension used for shared libraries?'
3717 : Define several unixisms.
3718 : Hints files or command line option can be used to override them.
3719 : The convoluted testing is in case hints files set either the old
3722 '') case "$exe_ext" in
3724 *) _exe="$exe_ext" ;;
3729 '') case "$lib_ext" in
3736 '') case "$obj_ext" in
3743 '') case "$path_sep" in
3754 : Which makefile gets called first. This is used by make depend.
3755 case "$firstmakefile" in
3756 '') firstmakefile='makefile';;
3760 $define|true|[yY]*) dflt='y';;
3765 Perl can be built to use the SOCKS proxy protocol library. To do so,
3766 Configure must be run with -Dusesocks. If you use SOCKS you also need
3767 to use the PerlIO abstraction layer, this will be implicitly selected.
3769 If this doesn't make any sense to you, just accept the default '$dflt'.
3771 rp='Build Perl for SOCKS?'
3774 y|Y) val="$define" ;;
3781 $define|true|[yY]*) useperlio="$define";;
3784 : Looking for optional libraries
3786 echo "Checking for optional libraries..." >&4
3791 case "$libswanted" in
3792 '') libswanted='c_s';;
3795 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
3801 for thisdir in $libpth $xlibpth; do
3802 test -d $thisdir && libspath="$libspath $thisdir"
3804 for thislib in $libswanted; do
3805 for thisdir in $libspath; do
3807 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
3808 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|tail -1`
3809 $test -f "$xxx" && eval $libscheck
3810 $test -f "$xxx" && libstyle=shared
3812 if test ! -f "$xxx"; then
3813 xxx=$thisdir/lib$thislib.$so
3814 $test -f "$xxx" && eval $libscheck
3815 $test -f "$xxx" && libstyle=shared
3817 if test ! -f "$xxx"; then
3818 xxx=$thisdir/lib$thislib$_a
3819 $test -f "$xxx" && eval $libscheck
3820 $test -f "$xxx" && libstyle=static
3822 if test ! -f "$xxx"; then
3823 xxx=$thisdir/$thislib$_a
3824 $test -f "$xxx" && eval $libscheck
3825 $test -f "$xxx" && libstyle=static
3827 if test ! -f "$xxx"; then
3828 xxx=$thisdir/lib${thislib}_s$_a
3829 $test -f "$xxx" && eval $libscheck
3830 $test -f "$xxx" && libstyle=static
3831 $test -f "$xxx" && thislib=${thislib}_s
3833 if test ! -f "$xxx"; then
3834 xxx=$thisdir/Slib$thislib$_a
3835 $test -f "$xxx" && eval $libscheck
3836 $test -f "$xxx" && libstyle=static
3838 if $test -f "$xxx"; then
3840 shared) echo "Found -l$thislib (shared)." ;;
3841 static) echo "Found -l$thislib." ;;
3842 *) echo "Found -l$thislib ($libstyle)." ;;
3846 *) dflt="$dflt -l$thislib"
3847 libsfound="$libsfound $xxx"
3849 libsfiles="$libsfiles $yyy"
3850 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
3851 case " $libsdirs " in
3853 *) libsdirs="$libsdirs $yyy" ;;
3860 if $test ! -f "$xxx"; then
3861 echo "No -l$thislib."
3872 ' '|'') dflt='none';;
3877 In order to compile $package on your machine, a number of libraries
3878 are usually needed. Include any other special libraries here as well.
3879 Say "none" for none. The default list is almost always right.
3883 rp="What libraries to use?"
3890 : determine optimization, if desired, or use for debug flag also
3892 ' '|$undef) dflt='none';;
3894 *) dflt="$optimize";;
3898 By default, $package compiles with the -O flag to use the optimizer.
3899 Alternately, you might want to use the symbolic debugger, which uses
3900 the -g flag (on traditional Unix systems). Either flag can be
3901 specified here. To use neither flag, specify the word "none".
3904 rp="What optimizer/debugger flag should be used?"
3908 'none') optimize=" ";;
3912 : We will not override a previous value, but we might want to
3913 : augment a hint file
3915 default|recommended)
3916 case "$gccversion" in
3917 1*) dflt='-fpcc-struct-return' ;;
3920 *-g*) dflt="$dflt -DDEBUGGING";;
3922 case "$gccversion" in
3923 2*) if test -d /etc/conf/kconfig.d &&
3924 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
3930 case "$gccversion" in
3934 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
3935 echo 'int main(void) { return 0; }' > gcctest.c
3936 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
3937 echo "Yes, it does." 2>&1
3940 echo "Leaving current flags $ccflags alone." 2>&1
3942 *) dflt="$dflt -fno-strict-aliasing" ;;
3945 echo "Nope, it doesn't, but that's ok." 2>&1
3952 case "$mips_type" in
3953 *BSD*|'') inclwanted="$locincpth $usrinc";;
3954 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
3956 for thisincl in $inclwanted; do
3957 if $test -d $thisincl; then
3958 if $test x$thisincl != x$usrinc; then
3960 *" -I$thisincl "*);;
3961 *) dflt="$dflt -I$thisincl ";;
3967 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
3969 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
3977 *) dflt="$dflt -D$2";;
3981 set signal.h LANGUAGE_C; eval $inctest
3985 ccflags="$ccflags -DSOCKS"
3990 default|recommended) dflt="$ccflags $dflt" ;;
3991 *) dflt="$ccflags";;
4000 Your C compiler may want other flags. For this question you should include
4001 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4002 but you should NOT include libraries or ld flags like -lwhatever. If you
4003 want $package to honor its debug switch, you should include -DDEBUGGING here.
4004 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4006 To use no flags, specify the word "none".
4012 rp="Any additional cc flags?"
4019 : the following weeds options from ccflags that are of no interest to cpp
4021 case "$gccversion" in
4022 1*) cppflags="$cppflags -D__GNUC__"
4024 case "$mips_type" in
4026 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4032 echo "Let me guess what the preprocessor flags are..." >&4
4046 *) ftry="$previous $flag";;
4048 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4049 >cpp1.out 2>/dev/null && \
4050 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4051 >cpp2.out 2>/dev/null && \
4052 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4053 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4055 cppflags="$cppflags $ftry"
4065 *-*) echo "They appear to be: $cppflags";;
4067 $rm -f cpp.c cpp?.out
4071 : flags used in final linking phase
4073 '') if ./venix; then
4079 *-posix*) dflt="$dflt -posix" ;;
4082 *) dflt="$ldflags";;
4085 : Try to guess additional flags to pick up local libraries.
4086 for thislibdir in $libpth; do
4087 case " $loclibpth " in
4090 *"-L$thislibdir "*) ;;
4091 *) dflt="$dflt -L$thislibdir" ;;
4103 Your C linker may need flags. For this question you should
4104 include -L/whatever and any other flags used by the C linker, but you
4105 should NOT include libraries like -lwhatever.
4107 Make sure you include the appropriate -L/path flags if your C linker
4108 does not normally search all of the directories you specified above,
4111 To use no flags, specify the word "none".
4115 rp="Any additional ld flags (NOT including libraries)?"
4121 rmlist="$rmlist pdp11"
4125 echo "Checking your choice of C compiler and flags for coherency..." >&4
4126 $cat > try.c <<'EOF'
4128 int main() { printf("Ok\n"); exit(0); }
4130 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
4132 $cat >try.msg <<'EOM'
4133 I've tried to compile and run the following simple program:
4136 $cat try.c >> try.msg
4138 $cat >> try.msg <<EOM
4145 and I got the following output:
4149 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
4150 if $sh -c './try' >>try.msg 2>&1; then
4154 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4157 cat >> try.msg <<'EOQS'
4158 If $libs contains -lsfio, and sfio is mis-configured, then it
4159 sometimes (apparently) runs and exits with a 0 status, but with no
4160 output! It may have to do with sfio's use of _exit vs. exit.
4163 rp="You have a big problem. Shall I abort Configure"
4170 echo "The program compiled OK, but exited with status $?." >>try.msg
4171 rp="You have a problem. Shall I abort Configure"
4175 echo "I can't compile the test program." >>try.msg
4176 rp="You have a BIG problem. Shall I abort Configure"
4182 case "$knowitall" in
4184 echo "(The supplied flags or libraries might be incorrect.)"
4192 *) echo "Ok. Stopping Configure." >&4
4197 n) echo "OK, that should do.";;
4199 $rm -f try try.* core
4201 : define an is-a-typedef? function
4202 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
4204 "") inclist="sys/types.h";;
4206 eval "varval=\$$var";
4210 for inc in $inclist; do
4211 echo "#include <$inc>" >>temp.c;
4213 echo "#ifdef $type" >> temp.c;
4214 echo "printf(\"We have $type\");" >> temp.c;
4215 echo "#endif" >> temp.c;
4216 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
4217 if $contains $type temp.E >/dev/null 2>&1; then
4223 *) eval "$var=\$varval";;
4226 : define an is-a-typedef? function that prompts if the type is not available.
4227 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
4229 "") inclist="sys/types.h";;
4231 eval "varval=\$$var";
4235 for inc in $inclist; do
4236 echo "#include <$inc>" >>temp.c;
4238 echo "#ifdef $type" >> temp.c;
4239 echo "printf(\"We have $type\");" >> temp.c;
4240 echo "#endif" >> temp.c;
4241 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
4243 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
4244 if $contains $type temp.E >/dev/null 2>&1; then
4245 echo "$type found." >&4;
4248 echo "$type NOT found." >&4;
4254 *) eval "$var=\$varval";;
4257 : define a shorthand compile call
4261 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
4262 : define a shorthand compile call for compilations that should be ok.
4266 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
4268 : check for lengths of integral types
4272 echo "Checking to see how big your integers are..." >&4
4273 $cat >intsize.c <<'EOCP'
4277 printf("intsize=%d;\n", (int)sizeof(int));
4278 printf("longsize=%d;\n", (int)sizeof(long));
4279 printf("shortsize=%d;\n", (int)sizeof(short));
4284 if eval $compile_ok && ./intsize > /dev/null; then
4286 echo "Your integers are $intsize bytes long."
4287 echo "Your long integers are $longsize bytes long."
4288 echo "Your short integers are $shortsize bytes long."
4292 Help! I can't compile and run the intsize test program: please enlighten me!
4293 (This is probably a misconfiguration in your system or libraries, and
4294 you really ought to fix it. Still, I'll try anyway.)
4298 rp="What is the size of an integer (in bytes)?"
4302 rp="What is the size of a long integer (in bytes)?"
4306 rp="What is the size of a short integer (in bytes)?"
4312 $rm -f intsize intsize.*
4314 : see what type lseek is declared as in the kernel
4315 rp="What is the type used for lseek's offset on this system?"
4316 set off_t lseektype long stdio.h sys/types.h
4320 echo "Checking to see how big your file offsets are..." >&4
4322 #include <sys/types.h>
4326 printf("%d\n", (int)sizeof($lseektype));
4331 if eval $compile_ok; then
4333 echo "Your file offsets are $lseeksize bytes long."
4337 echo "(I can't seem to compile the test program. Guessing...)"
4338 rp="What is the size of your file offsets (in bytes)?"
4344 : see what type file positions are declared as in the library
4345 rp="What is the type for file position used by fsetpos()?"
4346 set fpos_t fpostype long stdio.h sys/types.h
4351 *_t) zzz="$fpostype" ;;
4354 echo "Checking the size of $zzz..." >&4
4356 #include <sys/types.h>
4359 printf("%d\n", (int)sizeof($fpostype));
4364 if eval $compile_ok; then
4368 echo "(I can't execute the test program--guessing $fpossize.)" >&4
4371 echo "Your $zzz is $fpossize bytes long."
4377 echo "(I can't compile the test program. Guessing...)" >&4
4378 rp="What is the size of your file positions (in bytes)?"
4385 # Backward compatibility (uselfs is deprecated).
4387 "$define"|true|[yY]*)
4390 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
4392 uselargefiles="$define"
4396 case "$lseeksize:$fpossize" in
4399 You can have files larger than 2 gigabytes.
4402 *) case "$uselargefiles" in
4403 "$undef"|false|[nN]*) dflt='n' ;;
4408 Perl can be built to understand large files (files larger than 2 gigabytes)
4409 on some systems. To do so, Configure can be run with -Duselargefiles.
4411 If this doesn't make any sense to you, just accept the default '$dflt'.
4413 rp='Try to understand large files, if available?'
4416 y|Y) val="$define" ;;
4423 case "$uselargefiles" in
4425 : Look for a hint-file generated 'call-back-unit'. If the
4426 : user has specified that a large files perl is to be built,
4427 : we may need to set or change some other defaults.
4428 if $test -f uselargefiles.cbu; then
4429 echo "Your platform has some specific hints for large file builds, using them..."
4430 . ./uselargefiles.cbu
4432 echo "Rechecking to see how big your file offsets are..." >&4
4434 #include <sys/types.h>
4438 printf("%d\n", (int)sizeof($lseektype));
4443 if eval $compile_ok; then
4445 $echo "Your file offsets are now $lseeksize bytes long."
4449 echo "(I can't seem to compile the test program. Guessing...)"
4450 rp="What is the size of your file offsets (in bytes)?"
4455 *_t) zzz="$fpostype" ;;
4458 $echo $n "Rechecking the size of $zzz...$c" >&4
4460 #include <sys/types.h>
4463 printf("%d\n", (int)sizeof($fpostype));
4468 if eval $compile_ok; then
4473 echo "(I can't execute the test program--guessing $fpossize.)" >&4
4476 echo " $fpossize bytes." >&4
4482 echo "(I can't compile the test program. Guessing...)" >&4
4483 rp="What is the size of your file positions (in bytes)?"
4493 case "$usemorebits" in
4494 "$define"|true|[yY]*)
4495 use64bitint="$define"
4496 uselongdouble="$define"
4497 usemorebits="$define"
4499 *) usemorebits="$undef"
4504 case "$uselonglong" in
4505 "$define"|true|[yY]*)
4508 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
4510 use64bitint="$define"
4513 case "$use64bits" in
4514 "$define"|true|[yY]*)
4517 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
4519 use64bitint="$define"
4522 case "$use64bitints" in
4523 "$define"|true|[yY]*)
4526 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
4528 use64bitint="$define"
4531 case "$use64bitsint" in
4532 "$define"|true|[yY]*)
4535 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
4537 use64bitint="$define"
4540 case "$uselonglongs" in
4541 "$define"|true|[yY]*)
4544 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
4546 use64bitint="$define"
4549 case "$use64bitsall" in
4550 "$define"|true|[yY]*)
4553 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
4555 use64bitall="$define"
4560 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
4562 case "$use64bitall" in
4563 "$define"|true|[yY]*) use64bitint="$define" ;;
4569 You have natively 64-bit long integers.
4573 *) case "$use64bitint" in
4574 "$define"|true|[yY]*) dflt='y';;
4579 Perl can be built to take advantage of 64-bit integer types
4580 on some systems. To do so, Configure can be run with -Duse64bitint.
4581 Choosing this option will most probably introduce binary incompatibilities.
4583 If this doesn't make any sense to you, just accept the default '$dflt'.
4585 rp='Try to use 64-bit integers, if available?'
4588 [yY]*) val="$define" ;;
4596 case "$use64bitall" in
4597 "$define"|true|[yY]*) dflt='y' ;;
4598 *) case "$longsize" in
4606 You may also choose to try maximal 64-bitness. It means using as much
4607 64-bitness as possible on the platform. This in turn means even more
4608 binary incompatibilities. On the other hand, your platform may not
4609 have any more 64-bitness available than what you already have chosen.
4611 If this doesn't make any sense to you, just accept the default '$dflt'.
4613 rp='Try to use maximal 64-bit support, if available?'
4616 [yY]*) val="$define" ;;
4621 case "$use64bitall" in
4623 case "$use64bitint" in
4627 Since you have chosen a maximally 64-bit build, I'm also turning on
4628 the use of 64-bit integers.
4630 use64bitint="$define" ;;
4635 case "$use64bitint" in
4636 "$define"|true|[yY]*)
4637 : Look for a hint-file generated 'call-back-unit'. If the
4638 : user has specified that a 64-bit perl is to be built,
4639 : we may need to set or change some other defaults.
4640 if $test -f use64bitint.cbu; then
4641 echo "Your platform has some specific hints for 64-bit integers, using them..."
4645 4) case "$archname64" in
4646 '') archname64=64int ;;
4653 case "$use64bitall" in
4654 "$define"|true|[yY]*)
4655 : Look for a hint-file generated 'call-back-unit'. If the
4656 : user has specified that a maximally 64-bit perl is to be built,
4657 : we may need to set or change some other defaults.
4658 if $test -f use64bitall.cbu; then
4659 echo "Your platform has some specific hints for 64-bit builds, using them..."
4663 4) case "$archname64" in
4664 ''|64int) archname64=64all ;;
4672 echo "Checking for GNU C Library..." >&4
4673 cat >gnulibc.c <<EOM
4685 if eval $compile_ok && ./gnulibc; then
4687 echo "You are using the GNU C Library"
4690 echo "You are not using the GNU C Library"
4696 : see if nm is to be used to determine whether a symbol is defined or not
4700 case "$d_gnulibc" in
4703 echo "nm probably won't work on the GNU C Library." >&4
4709 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
4711 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
4712 echo "'nm' won't be sufficient on this sytem." >&4
4718 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
4719 if $test $dflt -gt 20; then
4729 true|$define) dflt=y;;
4736 I can use $nm to extract the symbols from your C libraries. This
4737 is a time consuming task which may generate huge output on the disk (up
4738 to 3 megabytes) but that should make the symbols extraction faster. The
4739 alternative is to skip the 'nm' extraction part and to compile a small
4740 test program instead to determine whether each symbol is present. If
4741 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
4742 this may be the best solution.
4744 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
4747 rp="Shall I use $nm to extract C symbols from the libraries?"
4750 [Nn]*) usenm=false;;
4759 : nm options which may be necessary
4761 '') if $test -f /mach_boot; then
4763 elif $test -d /usr/ccs/lib; then
4764 nm_opt='-p' # Solaris (and SunOS?)
4765 elif $test -f /dgux; then
4767 elif $test -f /lib64/rld; then
4768 nm_opt='-p' # 64-bit Irix
4774 : nm options which may be necessary for shared libraries but illegal
4775 : for archive libraries. Thank you, Linux.
4776 case "$nm_so_opt" in
4777 '') case "$myuname" in
4779 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
4780 nm_so_opt='--dynamic'
4789 : get list of predefined functions in a handy place
4794 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
4801 *) for thislib in $libs; do
4804 : Handle C library specially below.
4807 thislib=`echo $thislib | $sed -e 's/^-l//'`
4808 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
4810 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
4812 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
4814 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
4816 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
4818 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
4820 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
4825 libnames="$libnames $try"
4827 *) libnames="$libnames $thislib" ;;
4836 for xxx in $libpth; do
4837 $test -r $1 || set $xxx/libc.$so
4838 : The messy sed command sorts on library version numbers.
4840 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
4841 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
4843 s/[0-9][0-9]*/0000&/g
4844 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
4847 $sort | $sed -e 's/^.* //'`
4850 $test -r $1 || set /usr/ccs/lib/libc.$so
4851 $test -r $1 || set /lib/libsys_s$_a
4857 if $test -r "$1"; then
4858 echo "Your (shared) C library seems to be in $1."
4860 elif $test -r /lib/libc && $test -r /lib/clib; then
4861 echo "Your C library seems to be in both /lib/clib and /lib/libc."
4863 libc='/lib/clib /lib/libc'
4864 if $test -r /lib/syslib; then
4865 echo "(Your math library is in /lib/syslib.)"
4866 libc="$libc /lib/syslib"
4868 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
4869 echo "Your C library seems to be in $libc, as you said before."
4870 elif $test -r $incpath/usr/lib/libc$_a; then
4871 libc=$incpath/usr/lib/libc$_a;
4872 echo "Your C library seems to be in $libc. That's fine."
4873 elif $test -r /lib/libc$_a; then
4875 echo "Your C library seems to be in $libc. You're normal."
4877 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
4879 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
4880 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
4881 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
4883 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
4885 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
4888 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
4890 if $test -r "$tans"; then
4891 echo "Your C library seems to be in $tans, of all places."
4897 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
4901 If the guess above is wrong (which it might be if you're using a strange
4902 compiler, or your machine supports multiple models), you can override it here.
4907 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
4909 I can't seem to find your C library. I've looked in the following places:
4912 $sed 's/^/ /' libpath
4915 None of these seems to contain your C library. I need to get its name...
4920 rp='Where is your C library?'
4925 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
4926 set X `cat libnames`
4929 case $# in 1) xxx=file; esac
4930 echo "Extracting names from the following $xxx for later perusal:" >&4
4932 $sed 's/^/ /' libnames >&4
4934 $echo $n "This may take a while...$c" >&4
4938 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
4939 *) $nm $nm_opt $file 2>/dev/null;;
4944 $grep fprintf libc.tmp > libc.ptf
4945 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
4946 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
4948 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
4950 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4952 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
4954 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4956 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
4958 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4960 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
4962 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4964 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
4966 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4968 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
4970 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4972 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
4973 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
4975 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4977 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
4979 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4981 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
4983 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4985 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
4987 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4989 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
4991 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4993 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
4995 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4997 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
4999 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5001 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
5003 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5006 $nm -p $* 2>/dev/null >libc.tmp
5007 $grep fprintf libc.tmp > libc.ptf
5008 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
5009 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
5015 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
5017 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
5018 for thisname in $libnames $libc; do
5019 $ar t $thisname >>libc.tmp
5021 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
5023 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
5024 # Repeat libc to extract forwarders to DLL entries too
5025 for thisname in $libnames $libc; do
5026 $ar tv $thisname >>libc.tmp
5027 # Revision 50 of EMX has bug in $ar.
5028 # it will not extract forwarders to DLL entries
5029 # Use emximp which will extract exactly them.
5030 emximp -o tmp.imp $thisname \
5032 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
5033 < tmp.imp >>libc.tmp
5036 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
5039 echo "$ar didn't seem to work right." >&4
5040 echo "Maybe this is a Cray...trying bld instead..." >&4
5041 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
5043 for thisname in $libnames; do
5045 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
5046 $ar t $thisname >>libc.tmp
5050 echo "That didn't work either. Giving up." >&4
5057 if $test -f /lib/syscalls.exp; then
5059 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
5060 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*$/\1/p' /lib/syscalls.exp >>libc.list
5064 $rm -f libnames libpath
5066 : is a C symbol defined?
5069 -v) tf=libc.tmp; tc=""; tdc="";;
5070 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
5071 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
5074 case "$reuseval-$4" in
5076 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
5082 if $contains $tlook $tf >/dev/null 2>&1;
5087 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
5088 if $cc -o t $optimize $ccflags $ldflags t.c $libs >/dev/null 2>&1;
5096 $define) tval=true;;
5102 : define an is-in-libc? function
5103 inlibc='echo " "; td=$define; tu=$undef;
5104 sym=$1; var=$2; eval "was=\$$2";
5106 case "$reuseval$was" in
5116 echo "$sym() found." >&4;
5117 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
5119 echo "$sym() NOT found." >&4;
5120 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
5124 $define) echo "$sym() found." >&4;;
5125 *) echo "$sym() NOT found." >&4;;
5129 : see if sqrtl exists
5134 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
5137 case "$uselongdouble" in
5138 $define|true|[yY]*) dflt='y';;
5143 Perl can be built to take advantage of long doubles which
5144 (if available) may give more accuracy and range for floating point numbers.
5146 If this doesn't make any sense to you, just accept the default '$dflt'.
5148 rp='Try to use long doubles if available?'
5151 y|Y) val="$define" ;;
5157 case "$uselongdouble" in
5158 true|[yY]*) uselongdouble="$define" ;;
5161 case "$uselongdouble" in
5163 : Look for a hint-file generated 'call-back-unit'. If the
5164 : user has specified that long doubles should be used,
5165 : we may need to set or change some other defaults.
5166 if $test -f uselongdouble.cbu; then
5167 echo "Your platform has some specific hints for long doubles, using them..."
5168 . ./uselongdouble.cbu
5171 (Your platform doesn't have any specific hints for long doubles.)
5177 case "$uselongdouble:$d_sqrtl" in
5181 *** You requested the use of long doubles but you do not seem to have
5182 *** the mathematic functions for long doubles. I'm disabling the use
5183 *** of long doubles.
5186 uselongdouble=$undef
5190 : check for length of double
5192 case "$doublesize" in
5194 echo "Checking to see how big your double precision numbers are..." >&4
5195 $cat >try.c <<'EOCP'
5199 printf("%d\n", (int)sizeof(double));
5204 if eval $compile_ok; then
5206 echo "Your double is $doublesize bytes long."
5209 echo "(I can't seem to compile the test program. Guessing...)"
5210 rp="What is the size of a double precision number (in bytes)?"
5218 : check for long doubles
5220 echo "Checking to see if you have long double..." >&4
5221 echo 'int main() { long double x = 7.0; }' > try.c
5223 if eval $compile; then
5225 echo "You have long double."
5228 echo "You do not have long double."
5234 : check for length of long double
5235 case "${d_longdbl}${longdblsize}" in
5238 echo "Checking to see how big your long doubles are..." >&4
5239 $cat >try.c <<'EOCP'
5243 printf("%d\n", sizeof(long double));
5248 if eval $compile; then
5249 longdblsize=`./try$exe_ext`
5250 echo "Your long doubles are $longdblsize bytes long."
5254 echo "(I can't seem to compile the test program. Guessing...)" >&4
5255 rp="What is the size of a long double (in bytes)?"
5259 if $test "X$doublesize" = "X$longdblsize"; then
5260 echo "(That isn't any different from an ordinary double.)"
5266 : determine the architecture name
5268 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5269 tarch=`arch`"-$osname"
5270 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5271 if uname -m > tmparch 2>&1 ; then
5272 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5273 -e 's/$/'"-$osname/" tmparch`
5281 case "$myarchname" in
5284 echo "(Your architecture name used to be $myarchname.)"
5291 *) dflt="$archname";;
5293 rp='What is your architecture name'
5296 case "$usethreads" in
5298 echo "Threads selected." >&4
5300 *-thread*) echo "...and architecture name already has -thread." >&4
5302 *) archname="$archname-thread"
5303 echo "...setting architecture name to $archname." >&4
5308 case "$usemultiplicity" in
5310 echo "Multiplicity selected." >&4
5312 *-multi*) echo "...and architecture name already has -multi." >&4
5314 *) archname="$archname-multi"
5315 echo "...setting architecture name to $archname." >&4
5320 case "$use64bitint$use64bitall" in
5322 case "$archname64" in
5324 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
5327 case "$use64bitint" in
5328 "$define") echo "64 bit integers selected." >&4 ;;
5330 case "$use64bitall" in
5331 "$define") echo "Maximal 64 bitness selected." >&4 ;;
5334 *-$archname64*) echo "...and architecture name already has $archname64." >&4
5336 *) archname="$archname-$archname64"
5337 echo "...setting architecture name to $archname." >&4
5343 case "$uselongdouble" in
5345 echo "Long doubles selected." >&4
5346 case "$longdblsize" in
5348 "...but long doubles are equal to doubles, not changing architecture name." >&4
5352 *-ld*) echo "...and architecture name already has -ld." >&4
5354 *) archname="$archname-ld"
5355 echo "...setting architecture name to $archname." >&4
5363 : determine root of directory hierarchy where package will be installed.
5366 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
5374 By default, $package will be installed in $dflt/bin, manual pages
5375 under $dflt/man, etc..., i.e. with $dflt as prefix for all
5376 installation directories. Typically this is something like /usr/local.
5377 If you wish to have binaries under /usr/bin but other parts of the
5378 installation under /usr/local, that's ok: you will be prompted
5379 separately for each of the installation directories, the prefix being
5380 only used to set the defaults.
5384 rp='Installation prefix to use?'
5392 *) oldprefix="$prefix";;
5402 $define|true) afs=true ;;
5403 $undef|false) afs=false ;;
5404 *) if test -d /afs; then
5412 echo "AFS may be running... I'll be extra cautious then..." >&4
5414 echo "AFS does not seem to be running..." >&4
5417 : determine installation prefix for where package is to be installed.
5421 Since you are running AFS, I need to distinguish the directory in which
5422 files will reside from the directory in which they are installed (and from
5423 which they are presumably copied to the former directory by occult means).
5426 case "$installprefix" in
5427 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
5428 *) dflt="$installprefix";;
5433 In some special cases, particularly when building $package for distribution,
5434 it is convenient to distinguish between the directory in which files should
5435 be installed from the directory ($prefix) in which they
5436 will eventually reside. For most users, these two directories are the same.
5439 case "$installprefix" in
5441 *) dflt=$installprefix;;
5445 rp='What installation prefix should I use for installing files?'
5447 installprefix="$ans"
5448 installprefixexp="$ansexp"
5450 : set the prefixit variable, to compute a suitable default value
5451 prefixit='case "$3" in
5453 case "$oldprefix" in
5454 "") eval "$1=\"\$$2\"";;
5461 ""|" ") eval "$1=\"\$$2\"";;
5467 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
5469 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
5470 /*-$oldprefix/*|\~*-$oldprefix/*)
5471 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
5472 *) eval "$1=\"\$$2\"";;
5477 : get the patchlevel
5479 echo "Getting the current patchlevel..." >&4
5480 if $test -r $rsrc/patchlevel.h;then
5481 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
5482 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
5483 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5484 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
5485 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
5486 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5495 $echo "(You have $package version $patchlevel subversion $subversion.)"
5498 : XXX Should be a Configure test for double-dots in filenames.
5499 version=`echo $revision $patchlevel $subversion | \
5500 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
5501 api_versionstring=`echo $api_revision $api_version $api_subversion | \
5502 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
5505 version=`echo $revision $patchlevel $subversion | \
5506 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
5507 api_versionstring=`echo $api_revision $api_version $api_subversion | \
5508 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
5511 : Special case the 5.005_xx maintenance series, which used 5.005
5512 : without any subversion label as a subdirectory in $sitelib
5513 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
5514 api_versionstring='5.005'
5517 : determine installation style
5518 : For now, try to deduce it from prefix unless it is already set.
5519 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
5520 case "$installstyle" in
5521 '') case "$prefix" in
5522 *perl*) dflt='lib';;
5523 *) dflt='lib/perl5' ;;
5526 *) dflt="$installstyle" ;;
5528 : Probably not worth prompting for this since we prompt for all
5529 : the directories individually, and the prompt would be too long and
5533 : determine where private library files go
5534 : Usual default is /usr/local/lib/perl5/$version.
5535 : Also allow things like /opt/perl/lib/$version, since
5536 : /opt/perl/lib/perl5... would be redundant.
5537 : The default "style" setting is made in installstyle.U
5538 case "$installstyle" in
5539 *lib/perl5*) set dflt privlib lib/$package/$version ;;
5540 *) set dflt privlib lib/$version ;;
5545 There are some auxiliary files for $package that need to be put into a
5546 private library directory that is accessible by everyone.
5550 rp='Pathname where the private library files will reside?'
5553 privlibexp="$ansexp"
5554 : Change installation prefix, if necessary.
5555 if $test X"$prefix" != X"$installprefix"; then
5556 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
5558 installprivlib="$privlibexp"
5561 : set the prefixup variable, to restore leading tilda escape
5562 prefixup='case "$prefixexp" in
5564 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
5567 : determine where public architecture dependent libraries go
5570 : privlib default is /usr/local/lib/$package/$version
5571 : archlib default is /usr/local/lib/$package/$version/$archname
5572 : privlib may have an optional trailing /share.
5573 tdflt=`echo $privlib | $sed 's,/share$,,'`
5574 tdflt=$tdflt/$archname
5583 $spackage contains architecture-dependent library files. If you are
5584 sharing libraries in a heterogeneous environment, you might store
5585 these files in a separate location. Otherwise, you can just include
5586 them with the rest of the public library files.
5590 rp='Where do you want to put the public architecture-dependent libraries?'
5593 archlibexp="$ansexp"
5594 if $test X"$archlib" = X"$privlib"; then
5599 : Change installation prefix, if necessary.
5600 if $test X"$prefix" != X"$installprefix"; then
5601 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
5603 installarchlib="$archlibexp"
5607 : Binary compatibility with 5.005 is not possible for builds
5608 : with advanced features
5609 case "$usethreads$usemultiplicity" in
5611 bincompat5005="$undef"
5612 d_bincompat5005="$undef"
5616 This version of Perl can be compiled for binary compatibility with 5.005.
5617 If you decide to do so, you will be able to continue using most of the
5618 extensions that were compiled for Perl 5.005.
5621 case "$bincompat5005$d_bincompat5005" in
5622 *"$undef"*) dflt=n ;;
5625 rp='Binary compatibility with Perl 5.005?'
5628 y*) val="$define" ;;
5633 case "$d_bincompat5005" in
5635 bincompat5005="$define"
5637 *) bincompat5005="$undef"
5638 d_bincompat5005="$undef"
5645 : see if setuid scripts can be secure
5648 Some kernels have a bug that prevents setuid #! scripts from being
5649 secure. Some sites have disabled setuid #! scripts because of this.
5651 First let's decide if your kernel supports secure setuid #! scripts.
5652 (If setuid #! scripts would be secure but have been disabled anyway,
5653 don't say that they are secure if asked.)
5658 if $test -d /dev/fd; then
5659 echo "#!$ls" >reflect
5660 chmod +x,u+s reflect
5661 ./reflect >flect 2>&1
5662 if $contains "/dev/fd" flect >/dev/null; then
5663 echo "Congratulations, your kernel has secure setuid scripts!" >&4
5667 If you are not sure if they are secure, I can check but I'll need a
5668 username and password different from the one you are using right now.
5669 If you don't have such a username or don't want me to test, simply
5673 rp='Other username to test security of setuid scripts with?'
5678 case "$d_suidsafe" in
5679 '') echo "I'll assume setuid scripts are *not* secure." >&4
5682 echo "Well, the $hint value is *not* secure." >&4
5684 *) echo "Well, the $hint value *is* secure." >&4
5689 $rm -f reflect flect
5690 echo "#!$ls" >reflect
5691 chmod +x,u+s reflect
5694 echo '"su" will (probably) prompt you for '"$ans's password."
5695 su $ans -c './reflect >flect'
5696 if $contains "/dev/fd" flect >/dev/null; then
5697 echo "Okay, it looks like setuid scripts are secure." >&4
5700 echo "I don't think setuid scripts are secure." >&4
5705 rp='Does your kernel have *secure* setuid scripts?'
5708 [yY]*) val="$define";;
5713 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
5714 echo "(That's for file descriptors, not floppy disks.)"
5720 $rm -f reflect flect
5722 : now see if they want to do setuid emulation
5725 case "$d_suidsafe" in
5728 echo "No need to emulate SUID scripts since they are secure here." >& 4
5732 Some systems have disabled setuid scripts, especially systems where
5733 setuid scripts cannot be secure. On systems where setuid scripts have
5734 been disabled, the setuid/setgid bits on scripts are currently
5735 useless. It is possible for $package to detect those bits and emulate
5736 setuid/setgid in a secure fashion. This emulation will only work if
5737 setuid scripts have been disabled in your kernel.
5741 "$define") dflt=y ;;
5744 rp="Do you want to do setuid/setgid emulation?"
5747 [yY]*) val="$define";;
5755 : determine filename position in cpp output
5757 echo "Computing filename position in cpp output for #include directives..." >&4
5758 echo '#include <stdio.h>' > foo.c
5761 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5762 $grep '^[ ]*#.*stdio\.h' | \
5763 while read cline; do
5766 while $test \$# -gt 0; do
5767 if $test -r \`echo \$1 | $tr -d '"'\`; then
5772 pos=\`expr \$pos + 1\`
5784 *) pos="${fieldn}th";;
5786 echo "Your cpp writes the filename in the $pos field of the line."
5788 : locate header file
5793 for usrincdir in $usrinc
5795 if test -f \$usrincdir/\$wanted; then
5796 echo "\$usrincdir/\$wanted"
5800 awkprg='{ print \$$fieldn }'
5801 echo "#include <\$wanted>" > foo\$\$.c
5802 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5803 $grep "^[ ]*#.*\$wanted" | \
5804 while read cline; do
5805 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5807 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5808 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5813 # status = 0: grep returned 0 lines, case statement not executed
5814 # status = 1: headerfile found
5815 # status = 2: while loop executed, no headerfile found
5819 if test \$status -eq 1; then
5826 : define an alternate in-header-list? function
5827 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5828 cont=true; xxf="echo \"<\$1> found.\" >&4";
5829 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5830 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5832 case $# in 4) instead=instead;; *) instead="at last";; esac;
5833 while $test "$cont"; do
5835 var=$2; eval "was=\$$2";
5836 if $test "$xxx" && $test -r "$xxx";
5838 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5841 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5842 set $yyy; shift; shift; yyy=$@;
5843 case $# in 0) cont="";;
5844 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5845 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5846 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5847 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5851 do set $yyy; var=$2; eval "was=\$$2";
5852 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5853 set $yyy; shift; shift; yyy=$@;
5856 : see if this is a malloc.h system
5857 set malloc.h i_malloc
5860 : see if stdlib is available
5861 set stdlib.h i_stdlib
5864 : determine which malloc to compile in
5866 case "$usemymalloc" in
5867 ''|[yY]*|true|$define) dflt='y' ;;
5870 rp="Do you wish to attempt to use the malloc that comes with $package?"
5876 mallocsrc='malloc.c'
5877 mallocobj="malloc$_o"
5878 d_mymalloc="$define"
5881 : Remove malloc from list of libraries to use
5882 echo "Removing unneeded -lmalloc from library list" >&4
5883 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
5886 echo "libs = $libs" >&4
5898 : compute the return types of malloc and free
5900 $cat >malloc.c <<END
5904 #include <sys/types.h>
5918 case "$malloctype" in
5920 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
5927 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
5931 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
5938 echo "Your system uses $freetype free(), it would seem." >&4
5942 After $package is installed, you may wish to install various
5943 add-on modules and utilities. Typically, these add-ons will
5944 be installed under $prefix with the rest
5945 of this package. However, you may wish to install such add-ons
5946 elsewhere under a different prefix.
5948 If you do not wish to put everything under a single prefix, that's
5949 ok. You will be prompted for the individual locations; this siteprefix
5950 is only used to suggest the defaults.
5952 The default should be fine for most people.
5956 rp='Installation prefix to use for add-on modules and utilities?'
5957 : XXX Here might be another good place for an installstyle setting.
5958 case "$siteprefix" in
5960 *) dflt=$siteprefix ;;
5963 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
5965 case "$siteprefix" in
5969 *) oldsiteprefix="$prefix";;
5974 siteprefixexp="$ansexp"
5976 : determine where site specific libraries go.
5977 : Usual default is /usr/local/lib/perl5/site_perl/$version
5978 : The default "style" setting is made in installstyle.U
5979 : XXX No longer works with Prefixit stuff.
5980 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5982 '') case "$installstyle" in
5983 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
5984 *) dflt=$siteprefix/lib/site_$prog/$version ;;
5992 The installation process will create a directory for
5993 site-specific extensions and modules. Most users find it convenient
5994 to place all site-specific files in this directory rather than in the
5995 main distribution directory.
5999 rp='Pathname for the site-specific library files?'
6002 sitelibexp="$ansexp"
6003 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6004 : Change installation prefix, if necessary.
6005 if $test X"$prefix" != X"$installprefix"; then
6006 installsitelib=`echo $sitelibexp | $sed "s#^$prefix#$installprefix#"`
6008 installsitelib="$sitelibexp"
6011 : determine where site specific architecture-dependent libraries go.
6012 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6013 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6014 : sitelib may have an optional trailing /share.
6016 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6017 dflt="$dflt/$archname"
6022 set sitearch sitearch none
6026 The installation process will also create a directory for
6027 architecture-dependent site-specific extensions and modules.
6031 rp='Pathname for the site-specific architecture-dependent library files?'
6034 sitearchexp="$ansexp"
6035 : Change installation prefix, if necessary.
6036 if $test X"$prefix" != X"$installprefix"; then
6037 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
6039 installsitearch="$sitearchexp"
6044 The installation process will also create a directory for
6045 vendor-supplied add-ons. Vendors who supply perl with their system
6046 may find it convenient to place all vendor-supplied files in this
6047 directory rather than in the main distribution directory. This will
6048 ease upgrades between binary-compatible maintenance versions of perl.
6050 Of course you may also use these directories in whatever way you see
6051 fit. For example, you might use them to access modules shared over a
6052 company-wide network.
6054 The default answer should be fine for most people.
6055 This causes further questions about vendor add-ons to be skipped
6056 and no vendor-specific directories will be configured for perl.
6059 rp='Do you want to configure vendor-specific add-on directories?'
6060 case "$usevendorprefix" in
6061 define|true|[yY]*) dflt=y ;;
6062 *) : User may have set vendorprefix directly on Configure command line.
6063 case "$vendorprefix" in
6072 rp='Installation prefix to use for vendor-supplied add-ons?'
6073 case "$vendorprefix" in
6075 *) dflt=$vendorprefix ;;
6078 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6080 case "$vendorprefix" in
6084 *) oldvendorprefix="$prefix";;
6088 usevendorprefix="$define"
6090 vendorprefixexp="$ansexp"
6092 *) usevendorprefix="$undef"
6098 case "$vendorprefix" in
6099 '') d_vendorlib="$undef"
6103 *) d_vendorlib="$define"
6104 : determine where vendor-supplied modules go.
6105 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6106 case "$vendorlib" in
6108 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6109 case "$installstyle" in
6110 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6111 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6114 *) dflt="$vendorlib"
6118 rp='Pathname for the vendor-supplied library files?'
6121 vendorlibexp="$ansexp"
6124 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6125 : Change installation prefix, if necessary.
6126 if $test X"$prefix" != X"$installprefix"; then
6127 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
6129 installvendorlib="$vendorlibexp"
6132 case "$vendorprefix" in
6133 '') d_vendorarch="$undef"
6137 *) d_vendorarch="$define"
6138 : determine where vendor-supplied architecture-dependent libraries go.
6139 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6140 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6141 : vendorlib may have an optional trailing /share.
6142 case "$vendorarch" in
6143 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6144 dflt="$dflt/$archname"
6146 *) dflt="$vendorarch" ;;
6149 rp='Pathname for vendor-supplied architecture-dependent files?'
6152 vendorarchexp="$ansexp"
6155 : Change installation prefix, if necessary.
6156 if $test X"$prefix" != X"$installprefix"; then
6157 installvendorarch=`echo $vendorarchexp | sed "s#^$prefix#$installprefix#"`
6159 installvendorarch="$vendorarchexp"
6162 : Final catch-all directories to search
6165 Lastly, you can have perl look in other directories for extensions and
6166 modules in addition to those already specified.
6167 These directories will be searched after
6171 test X"$vendorlib" != "X" && echo ' ' $vendorlib
6172 test X"$vendorarch" != "X" && echo ' ' $vendorarch
6174 case "$otherlibdirs" in
6175 ''|' ') dflt='none' ;;
6176 *) dflt="$otherlibdirs" ;;
6179 Enter a colon-separated set of extra paths to include in perl's @INC
6180 search path, or enter 'none' for no extra paths.
6184 rp='Colon-separated list of additional directories for perl to search?'
6187 ' '|''|none) otherlibdirs=' ' ;;
6188 *) otherlibdirs="$ans" ;;
6190 case "$otherlibdirs" in
6194 set d_perl_otherlibdirs
6197 : Cruising for prototypes
6199 echo "Checking out function prototypes..." >&4
6200 $cat >prototype.c <<'EOCP'
6201 int main(int argc, char *argv[]) {
6204 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
6205 echo "Your C compiler appears to support function prototypes."
6208 echo "Your C compiler doesn't seem to understand function prototypes."
6215 case "$prototype" in
6217 *) ansi2knr='ansi2knr'
6222 This version of $package can only be compiled by a compiler that
6223 understands function prototypes. Unfortunately, your C compiler
6225 doesn't seem to understand them. Sorry about that.
6227 If GNU cc is available for your system, perhaps you could try that instead.
6229 Eventually, we hope to support building Perl with pre-ANSI compilers.
6230 If you would like to help in that effort, please contact <perlbug@perl.org>.
6232 Aborting Configure now.
6238 : determine where public executables go
6243 rp='Pathname where the public executables will reside?'
6245 if $test "X$ansexp" != "X$binexp"; then
6250 : Change installation prefix, if necessary.
6251 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6252 if $test X"$prefix" != X"$installprefix"; then
6253 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
6255 installbin="$binexp"
6258 : Find perl5.005 or later.
6259 echo "Looking for a previously installed perl5.005 or later... "
6261 '') for tdir in `echo "$binexp:$PATH" | $sed "s/$path_sep/ /g"`; do
6262 : Check if this perl is recent and can load a simple module
6263 if $test -x $tdir/perl && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6266 elif $test -x $tdir/perl5 && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6276 '') echo "None found. That's ok.";;
6277 *) echo "Using $perl5." ;;
6280 : Determine list of previous versions to include in @INC
6281 $cat > getverlist <<EOPL
6284 \$api_versionstring = "$api_versionstring";
6285 \$version = "$version";
6286 \$stem = "$sitelib_stem";
6287 \$archname = "$archname";
6289 $cat >> getverlist <<'EOPL'
6290 # Can't have leading @ because metaconfig interprets it as a command!
6291 ;@inc_version_list=();
6292 # XXX Redo to do opendir/readdir?
6295 ;@candidates = glob("5.*");
6301 # XXX ToDo: These comparisons must be reworked when two-digit
6302 # subversions come along, so that 5.7.10 compares as greater than
6303 # 5.7.3! By that time, hope that 5.6.x is sufficiently
6304 # widespread that we can use the built-in version vectors rather
6305 # than reinventing them here. For 5.6.0, however, we must
6306 # assume this script will likely be run by 5.005_0x. --AD 1/2000.
6307 foreach $d (@candidates) {
6308 if ($d lt $version) {
6309 if ($d ge $api_versionstring) {
6310 unshift(@inc_version_list, grep { -d } "$d/$archname", $d);
6312 elsif ($d ge "5.005") {
6313 unshift(@inc_version_list, grep { -d } $d);
6317 # Skip newer version. I.e. don't look in
6318 # 5.7.0 if we're installing 5.6.1.
6322 if (@inc_version_list) {
6323 print join(' ', @inc_version_list);
6326 # Blank space to preserve value for next Configure run.
6331 case "$inc_version_list" in
6332 '') if test -x "$perl5"; then
6333 dflt=`$perl5 getverlist`
6338 $undef) dflt='none' ;;
6339 *) dflt="$inc_version_list" ;;
6342 ''|' ') dflt=none ;;
6345 5.005) case "$bincompat5005" in
6346 $define|true|[yY]*) ;;
6353 In order to ease the process of upgrading, this version of perl
6354 can be configured to use modules built and installed with earlier
6355 versions of perl that were installed under $prefix. Specify here
6356 the list of earlier versions that this version of perl should check.
6357 If Configure detected no earlier versions of perl installed under
6358 $prefix, then the list will be empty. Answer 'none' to tell perl
6359 to not search earlier versions.
6361 The default should almost always be sensible, so if you're not sure,
6362 just accept the default.
6365 rp='List of earlier versions to include in @INC?'
6368 [Nn]one|''|' ') inc_version_list=' ' ;;
6369 *) inc_version_list="$ans" ;;
6371 case "$inc_version_list" in
6373 inc_version_list_init='0';;
6374 *) inc_version_list_init=`echo $inc_version_list |
6375 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6380 : determine whether to install perl also as /usr/bin/perl
6383 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
6385 Many scripts expect perl to be installed as /usr/bin/perl.
6386 I can install the perl you are about to compile also as /usr/bin/perl
6387 (in addition to $installbin/perl).
6389 case "$installusrbinperl" in
6390 "$undef"|[nN]*) dflt='n';;
6393 rp="Do you want to install perl as /usr/bin/perl?"
6396 [yY]*) val="$define";;
6402 set installusrbinperl
6405 : see if dld is available
6409 : see if dlopen exists
6416 : determine which dynamic loading, if any, to compile in
6418 dldir="ext/DynaLoader"
6431 $define) dflt='y' ;;
6434 $define) dflt='y' ;;
6436 : Does a dl_xxx.xs file exist for this operating system
6437 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
6440 rp="Do you wish to use dynamic loading?"
6447 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
6448 dflt="$dldir/dl_${osname}.xs"
6449 elif $test "$d_dlopen" = "$define" ; then
6450 dflt="$dldir/dl_dlopen.xs"
6451 elif $test "$i_dld" = "$define" ; then
6452 dflt="$dldir/dl_dld.xs"
6457 *) dflt="$dldir/$dlsrc"
6460 echo "The following dynamic loading files are available:"
6461 : Can not go over to $dldir because getfile has path hard-coded in.
6462 tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir
6463 rp="Source file to use for dynamic loading"
6469 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
6473 Some systems may require passing special flags to $cc -c to
6474 compile modules that will be used to create a shared library.
6475 To use no flags, say "none".
6478 case "$cccdlflags" in
6479 '') case "$gccversion" in
6480 '') case "$osname" in
6482 next) dflt='none' ;;
6483 irix*) dflt='-KPIC' ;;
6484 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
6485 sunos) dflt='-pic' ;;
6489 *) case "$osname" in
6490 svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
6495 *) dflt="$cccdlflags" ;;
6497 rp="Any special flags to pass to $cc -c to compile shared library modules?"
6500 none) cccdlflags=' ' ;;
6501 *) cccdlflags="$ans" ;;
6506 Some systems use ld to create libraries that can be dynamically loaded,
6507 while other systems (such as those using ELF) use $cc.
6511 '') $cat >try.c <<'EOM'
6512 /* Test for whether ELF binaries are produced */
6517 int i = open("a.out",O_RDONLY);
6520 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
6521 exit(0); /* succeed (yes, it's ELF) */
6526 if $cc $ccflags try.c >/dev/null 2>&1 && ./a.out; then
6528 You appear to have ELF support. I'll use $cc to build dynamic libraries.
6532 echo "I'll use ld to build dynamic libraries."
6541 rp="What command should be used to create dynamic libraries?"
6547 Some systems may require passing special flags to $ld to create a
6548 library that can be dynamically loaded. If your ld flags include
6549 -L/other/path options to locate libraries outside your loader's normal
6550 search path, you may need to specify those -L options here as well. To
6551 use no flags, say "none".
6554 case "$lddlflags" in
6555 '') case "$osname" in
6556 beos) dflt='-nostart' ;;
6558 case "$gccversion" in
6559 '') dflt="$dflt +vnocompatwarnings" ;;
6562 linux|irix*) dflt='-shared' ;;
6563 next) dflt='none' ;;
6564 solaris) dflt='-G' ;;
6565 sunos) dflt='-assert nodefinitions' ;;
6566 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
6570 *) dflt="$lddlflags" ;;
6573 : Try to guess additional flags to pick up local libraries.
6574 : Be careful not to append to a plain 'none'
6578 for thisflag in $ldflags; do
6583 *) dflt="$dflt $thisflag" ;;
6590 ''|' ') dflt='none' ;;
6593 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
6596 none) lddlflags=' ' ;;
6597 *) lddlflags="$ans" ;;
6602 Some systems may require passing special flags to $cc to indicate that
6603 the resulting executable will use dynamic linking. To use no flags,
6607 case "$ccdlflags" in
6608 '') case "$osname" in
6609 hpux) dflt='-Wl,-E' ;;
6610 linux) dflt='-rdynamic' ;;
6611 next) dflt='none' ;;
6612 sunos) dflt='none' ;;
6616 *) dflt="$ccdlflags" ;;
6618 rp="Any special flags to pass to $cc to use dynamic linking?"
6621 none) ccdlflags=' ' ;;
6622 *) ccdlflags="$ans" ;;
6636 # No dynamic loading being used, so don't bother even to prompt.
6639 *) case "$useshrplib" in
6640 '') case "$osname" in
6641 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
6643 also='Building a shared libperl is required for dynamic loading to work on your system.'
6648 also='Building a shared libperl is needed for MAB support.'
6666 The perl executable is normally obtained by linking perlmain.c with
6667 libperl${_a}, any static extensions (usually just DynaLoader), and
6668 any other libraries needed on this system (such as -lm, etc.). Since
6669 your system supports dynamic loading, it is probably possible to build
6670 a shared libperl.$so. If you will have more than one executable linked
6671 to libperl.$so, this will significantly reduce the size of each
6672 executable, but it may have a noticeable affect on performance. The
6673 default is probably sensible for your system.
6677 rp="Build a shared libperl.$so (y/n)"
6681 useshrplib='true' ;;
6682 *) useshrplib='false' ;;
6687 case "$useshrplib" in
6691 # Figure out a good name for libperl.so. Since it gets stored in
6692 # a version-specific architecture-dependent library, the version
6693 # number isn't really that important, except for making cc/ld happy.
6695 # A name such as libperl.so.3.1
6696 majmin="libperl.$so.$patchlevel.$subversion"
6697 # A name such as libperl.so.301
6698 majonly=`echo $patchlevel $subversion |
6699 $awk '{printf "%d%02d", $1, $2}'`
6700 majonly=libperl.$so.$majonly
6701 # I'd prefer to keep the os-specific stuff here to a minimum, and
6702 # rely on figuring it out from the naming of libc.
6703 case "${osname}${osvers}" in
6706 # XXX How handle the --version stuff for MAB?
6708 linux*) # ld won't link with a bare -lperl otherwise.
6711 cygwin*) # include version
6712 dflt=`echo libperl$version | sed -e 's/\./_/g'`$lib_ext
6714 *) # Try to guess based on whether libc has major.minor.
6716 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
6717 *libc.$so.[0-9]*) dflt=$majonly ;;
6718 *) dflt=libperl.$so ;;
6728 I need to select a good name for the shared libperl. If your system uses
6729 library names with major and minor numbers, then you might want something
6730 like $majmin. Alternatively, if your system uses a single version
6731 number for shared libraries, then you might want to use $majonly.
6732 Or, your system might be quite happy with a simple libperl.$so.
6734 Since the shared libperl will get installed into a version-specific
6735 architecture-dependent directory, the version number of the shared perl
6736 library probably isn't important, so the default should be o.k.
6739 rp='What name do you want to give to the shared libperl?'
6742 echo "Ok, I'll use $libperl"
6745 libperl="libperl${_a}"
6749 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
6753 WARNING: Use of the shrpdir variable for the installation location of
6754 the shared $libperl is not supported. It was never documented and
6755 will not work in this version. Let me (perlbug@perl.org)
6756 know of any problems this may cause.
6762 But your current setting of $shrpdir is
6763 the default anyway, so it's harmless.
6768 Further, your current attempted setting of $shrpdir
6769 conflicts with the value of $archlibexp/CORE
6770 that installperl will use.
6777 # How will the perl executable find the installed shared $libperl?
6778 # Add $xxx to ccdlflags.
6779 # If we can't figure out a command-line option, use $shrpenv to
6780 # set env LD_RUN_PATH. The main perl makefile uses this.
6781 shrpdir=$archlibexp/CORE
6784 if "$useshrplib"; then
6787 # We'll set it in Makefile.SH...
6793 xxx="-Wl,-R$shrpdir"
6795 linux|irix*|dec_osf)
6796 xxx="-Wl,-rpath,$shrpdir"
6799 # next doesn't like the default...
6802 # beos doesn't like the default, either.
6805 # hpux doesn't like the default, either.
6806 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
6809 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
6815 # Only add $xxx if it isn't already in ccdlflags.
6816 case " $ccdlflags " in
6818 *) ccdlflags="$ccdlflags $xxx"
6821 Adding $xxx to the flags
6822 passed to $ld so that the perl executable will find the
6823 installed shared $libperl.
6831 # Fix ccdlflags in AIX for building external extensions.
6832 # (For building Perl itself bare -bE:perl.exp is needed,
6833 # Makefile.SH takes care of this.)
6835 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
6837 # Respect a hint or command-line value.
6839 '') shrpenv="$tmp_shrpenv" ;;
6841 case "$ldlibpthname" in
6842 '') ldlibpthname=LD_LIBRARY_PATH ;;
6843 none) ldlibpthname='' ;;
6846 : determine where manual pages are on this system
6850 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
6851 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
6852 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
6853 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
6854 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
6855 sysman=`./loc . /usr/man/man1 $syspath`
6858 if $test -d "$sysman"; then
6859 echo "System manual is in $sysman." >&4
6861 echo "Could not find manual pages in source form." >&4
6864 : determine where manual pages go
6865 set man1dir man1dir none
6869 $spackage has manual pages available in source form.
6873 echo "However, you don't have nroff, so they're probably useless to you."
6875 '') man1dir="none";;
6878 echo "If you don't want the manual sources installed, answer 'none'."
6883 lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
6884 lookpath="$lookpath $prefixexp/man/p_man/man1"
6885 lookpath="$lookpath $prefixexp/man/u_man/man1"
6886 lookpath="$lookpath $prefixexp/man/man.1"
6888 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
6889 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
6899 rp="Where do the main $spackage manual pages (source) go?"
6901 if $test "X$man1direxp" != "X$ansexp"; then
6905 man1direxp="$ansexp"
6911 : Change installation prefix, if necessary.
6912 if $test X"$prefix" != X"$installprefix"; then
6913 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
6915 installman1dir="$man1direxp"
6918 : What suffix to use on installed man pages
6925 rp="What suffix should be used for the main $spackage man pages?"
6927 '') case "$man1dir" in
6941 *) dflt="$man1ext";;
6948 : see if we can have long filenames
6950 first=123456789abcdef
6952 if (echo hi >$first) 2>/dev/null; then
6953 if $test -f 123456789abcde; then
6954 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
6957 echo 'You can have filenames longer than 14 characters.'>&4
6962 You can't have filenames longer than 14 chars.
6963 You can't even think about them!
6969 $rm -rf 123456789abcde*
6971 : determine where library module manual pages go
6972 set man3dir man3dir none
6976 $spackage has manual pages for many of the library modules.
6982 However, you don't have nroff, so they're probably useless to you.
6985 '') man3dir="none";;
6989 case "$d_flexfnam" in
6992 However, your system can't handle the long file names like File::Basename.3.
6995 '') man3dir="none";;
6999 echo "If you don't want the manual sources installed, answer 'none'."
7000 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7002 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
7003 if $test -d "$privlib/man/man3"; then
7006 WARNING: Previous versions of perl installed man3 pages into
7007 $privlib/man/man3. This version will suggest a
7008 new default of $dflt.
7012 rp='Do you wish to preserve the old behavior?(y/n)'
7015 y*) dflt="$privlib/man/man3" ;;
7020 *) dflt="$man3dir" ;;
7027 rp="Where do the $package library man pages (source) go?"
7030 man3direxp="$ansexp"
7036 : Change installation prefix, if necessary.
7037 if $test X"$prefix" != X"$installprefix"; then
7038 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
7040 installman3dir="$man3direxp"
7043 : What suffix to use on installed man pages
7049 rp="What suffix should be used for the $package library man pages?"
7051 '') case "$man3dir" in
7065 *) dflt="$man3ext";;
7072 : see if we have to deal with yellow pages, now NIS.
7073 if $test -d /usr/etc/yp || $test -d /etc/yp; then
7074 if $test -f /usr/etc/nibindd; then
7076 echo "I'm fairly confident you're on a NeXT."
7078 rp='Do you get the hosts file via NetInfo?'
7087 y*) hostcat='nidump hosts .';;
7088 *) case "$hostcat" in
7089 nidump*) hostcat='';;
7099 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
7107 rp='Are you getting the hosts file via yellow pages?'
7110 y*) hostcat='ypcat hosts';;
7111 *) hostcat='cat /etc/hosts';;
7117 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
7120 '') test -f /etc/group && groupcat='cat /etc/group';;
7123 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
7126 : now get the host name
7128 echo "Figuring out host name..." >&4
7129 case "$myhostname" in
7131 echo 'Maybe "hostname" will work...'
7132 if tans=`sh -c hostname 2>&1` ; then
7140 if $test "$cont"; then
7142 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
7143 if tans=`cat /etc/systemid 2>&1` ; then
7145 phostname='cat /etc/systemid'
7146 echo "Whadyaknow. Xenix always was a bit strange..."
7149 elif $test -r /etc/systemid; then
7150 echo "(What is a non-Xenix system doing with /etc/systemid?)"
7153 if $test "$cont"; then
7154 echo 'No, maybe "uuname -l" will work...'
7155 if tans=`sh -c 'uuname -l' 2>&1` ; then
7157 phostname='uuname -l'
7159 echo 'Strange. Maybe "uname -n" will work...'
7160 if tans=`sh -c 'uname -n' 2>&1` ; then
7162 phostname='uname -n'
7164 echo 'Oh well, maybe I can mine it out of whoami.h...'
7165 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
7166 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
7167 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
7169 case "$myhostname" in
7170 '') echo "Does this machine have an identity crisis or something?"
7173 echo "Well, you said $myhostname before..."
7174 phostname='echo $myhostname';;
7180 : you do not want to know about this
7185 if $test "$myhostname" ; then
7187 rp='Your host name appears to be "'$myhostname'".'" Right?"
7195 : bad guess or no guess
7196 while $test "X$myhostname" = X ; do
7198 rp="Please type the (one word) name of your host:"
7203 : translate upper to lower if necessary
7204 case "$myhostname" in
7206 echo "(Normalizing case in your host name)"
7207 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
7211 case "$myhostname" in
7213 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
7214 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
7215 echo "(Trimming domain name from host name--host name is now $myhostname)"
7217 *) case "$mydomain" in
7220 test "X$hostcat" = "Xypcat hosts" &&
7221 ypmatch "$myhostname" hosts 2>/dev/null |\
7222 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
7225 test "X$hostcat" != "X" &&
7226 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
7227 /[ ]$myhostname[ . ]/p" > hosts
7230 if $test -f hosts; then
7231 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
7232 END { print sum }" hosts` = x1 || tmp_re="[ ]"
7233 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
7234 hosts | $sort | $uniq | \
7235 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
7236 case `$echo X$dflt` in
7237 X*\ *) echo "(Several hosts in the database matched hostname)"
7240 X.) echo "(You do not have fully-qualified names in the hosts database)"
7244 echo "(I cannot locate a hosts database anywhere)"
7249 tans=`./loc resolv.conf X /etc /usr/etc`
7250 if $test -f "$tans"; then
7251 echo "(Attempting domain name extraction from $tans)"
7252 dflt=.`$sed -n -e 's/ / /g' \
7253 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
7254 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
7256 .) dflt=.`$sed -n -e 's/ / /g' \
7257 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
7258 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
7265 .) echo "(No help from resolv.conf either -- attempting clever guess)"
7266 dflt=.`sh -c domainname 2>/dev/null`
7269 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
7274 .) echo "(Lost all hope -- silly guess then)"
7280 *) dflt="$mydomain";;
7284 rp="What is your domain name?"
7294 : translate upper to lower if necessary
7297 echo "(Normalizing case in your domain name)"
7298 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
7302 : a little sanity check here
7303 case "$phostname" in
7306 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
7307 $myhostname$mydomain|$myhostname) ;;
7309 case "$phostname" in
7311 echo "(That doesn't agree with your whoami.h file, by the way.)"
7314 echo "(That doesn't agree with your $phostname command, by the way.)"
7324 I need to get your e-mail address in Internet format if possible, i.e.
7325 something like user@host.domain. Please answer accurately since I have
7326 no easy means to double check it. The default value provided below
7327 is most probably close to reality but may not be valid from outside
7328 your organization...
7332 while test "$cont"; do
7334 '') dflt="$cf_by@$myhostname$mydomain";;
7335 *) dflt="$cf_email";;
7337 rp='What is your e-mail address?'
7343 rp='Address does not look like an Internet one. Use it anyway?'
7359 If you or somebody else will be maintaining perl at your site, please
7360 fill in the correct e-mail address here so that they may be contacted
7361 if necessary. Currently, the "perlbug" program included with perl
7362 will send mail to this address in addition to perlbug@perl.org. You may
7363 enter "none" for no administrator.
7366 case "$perladmin" in
7367 '') dflt="$cf_email";;
7368 *) dflt="$perladmin";;
7370 rp='Perl administrator e-mail address'
7374 : determine whether to only install version-specific parts.
7377 Do you want to install only the version-specific parts of the perl
7378 distribution? Usually you do *not* want to do this.
7380 case "$versiononly" in
7381 "$define"|[Yy]*|true) dflt='y' ;;
7384 rp="Do you want to install only the version-specific parts of perl?"
7387 [yY]*) val="$define";;
7393 : figure out how to guarantee perl startup
7394 case "$startperl" in
7396 case "$sharpbang" in
7400 I can use the #! construct to start perl on your system. This will
7401 make startup of perl scripts faster, but may cause problems if you
7402 want to share those scripts and perl is not in a standard place
7403 ($binexp/perl) on all your platforms. The alternative is to force
7404 a shell by starting the script with a single ':' character.
7407 case "$versiononly" in
7408 "$define") dflt="$binexp/perl$version";;
7409 *) dflt="$binexp/perl";;
7411 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
7414 none) startperl=": # use perl";;
7415 *) startperl="#!$ans"
7416 if $test 30 -lt `echo "$ans" | wc -c`; then
7419 WARNING: Some systems limit the #! command to 32 characters.
7420 If you experience difficulty running Perl scripts with #!, try
7421 installing Perl in a directory with a shorter pathname.
7427 *) startperl=": # use perl"
7432 echo "I'll use $startperl to start perl scripts."
7434 : figure best path for perl in scripts
7437 perlpath="$binexp/perl"
7438 case "$startperl" in
7443 I will use the "eval 'exec'" idiom to start Perl on your system.
7444 I can use the full path of your Perl binary for this purpose, but
7445 doing so may cause problems if you want to share those scripts and
7446 Perl is not always in a standard place ($binexp/perl).
7450 rp="What path shall I use in \"eval 'exec'\"?"
7457 case "$startperl" in
7459 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
7462 : determine where public executable scripts go
7463 set scriptdir scriptdir
7465 case "$scriptdir" in
7468 : guess some guesses
7469 $test -d /usr/share/scripts && dflt=/usr/share/scripts
7470 $test -d /usr/share/bin && dflt=/usr/share/bin
7471 $test -d /usr/local/script && dflt=/usr/local/script
7472 $test -d /usr/local/scripts && dflt=/usr/local/scripts
7473 $test -d $prefixexp/script && dflt=$prefixexp/script
7477 *) dflt="$scriptdir"
7482 Some installations have a separate directory just for executable scripts so
7483 that they can mount it across multiple architectures but keep the scripts in
7484 one spot. You might, for example, have a subdirectory of /usr/share for this.
7485 Or you might just lump your scripts in with all your other executables.
7489 rp='Where do you keep publicly executable scripts?'
7491 if $test "X$ansexp" != "X$scriptdirexp"; then
7495 scriptdirexp="$ansexp"
7496 : Change installation prefix, if necessary.
7497 if $test X"$prefix" != X"$installprefix"; then
7498 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
7500 installscript="$scriptdirexp"
7503 : determine where add-on public executables go
7505 '') dflt=$siteprefix/bin ;;
7509 rp='Pathname where the add-on public executables should be installed?'
7512 sitebinexp="$ansexp"
7513 : Change installation prefix, if necessary.
7514 if $test X"$prefix" != X"$installprefix"; then
7515 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
7517 installsitebin="$sitebinexp"
7520 case "$useperlio" in
7521 $define|true|[yY]*) dflt='y';;
7526 Previous version of $package used the standard IO mechanisms as
7527 defined in <stdio.h>. Versions 5.003_02 and later of perl allow
7528 alternate IO mechanisms via the PerlIO abstraction layer, but the
7529 stdio mechanism is still the default. This abstraction layer can
7530 use AT&T's sfio (if you already have sfio installed) or regular stdio.
7531 Using PerlIO with sfio may cause problems with some extension modules.
7533 If this doesn't make any sense to you, just accept the default '$dflt'.
7535 rp='Use the experimental PerlIO abstraction layer?'
7542 echo "Ok, doing things the stdio way."
7551 case "$useperlio" in
7552 $define|true|[yY]*) ;;
7555 You are using the SOCKS proxy protocol library which means that you
7556 should also use the PerlIO layer. You may be headed for trouble.
7565 case "$vendorprefix" in
7566 '') d_vendorbin="$undef"
7570 *) d_vendorbin="$define"
7571 : determine where vendor-supplied executables go.
7572 case "$vendorbin" in
7573 '') dflt=$vendorprefix/bin ;;
7574 *) dflt="$vendorbin" ;;
7577 rp='Pathname for the vendor-supplied executables directory?'
7580 vendorbinexp="$ansexp"
7583 : Change installation prefix, if necessary.
7584 if $test X"$prefix" != X"$installprefix"; then
7585 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
7587 installvendorbin="$vendorbinexp"
7590 : see if qgcvt exists
7596 if $test X"$d_longdbl" = X"$define"; then
7598 echo "Checking how to print long doubles..." >&4
7600 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
7601 $cat >try.c <<'EOCP'
7602 #include <sys/types.h>
7606 printf("%.3f\n", d);
7610 if eval $compile; then
7614 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
7615 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
7616 echo "We will use %f."
7622 if $test X"$sPRIfldbl" = X; then
7623 $cat >try.c <<'EOCP'
7624 #include <sys/types.h>
7627 long double d = 123.456;
7628 printf("%.3llf\n", d);
7632 if eval $compile; then
7636 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
7637 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
7638 echo "We will use %llf."
7644 if $test X"$sPRIfldbl" = X; then
7645 $cat >try.c <<'EOCP'
7646 #include <sys/types.h>
7649 long double d = 123.456;
7650 printf("%.3Lf\n", d);
7654 if eval $compile; then
7658 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
7659 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
7660 echo "We will use %Lf."
7666 if $test X"$sPRIfldbl" = X; then
7667 $cat >try.c <<'EOCP'
7668 #include <sys/types.h>
7671 long double d = 123.456;
7672 printf("%.3lf\n", d);
7676 if eval $compile; then
7680 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
7681 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
7682 echo "We will use %lf."
7688 if $test X"$sPRIfldbl" = X; then
7689 echo "Cannot figure out how to print long doubles." >&4
7691 sSCNfldbl=$sPRIfldbl # expect consistency
7698 case "$sPRIfldbl" in
7699 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
7700 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
7701 d_SCNfldbl="$undef";
7703 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
7704 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
7705 d_SCNfldbl="$define";
7709 : Check how to convert floats to strings.
7711 echo "Checking for an efficient way to convert floats to strings."
7713 case "$uselongdouble" in
7714 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
7716 case "$d_longdbl" in
7717 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
7719 case "$d_PRIgldbl" in
7720 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
7724 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
7725 char *myname = "gconvert";
7728 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
7729 char *myname = "gcvt";
7732 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
7733 char *myname = "qgcvt";
7734 #define DOUBLETYPE long double
7737 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE) && defined(HAS_PRIgldbl)
7738 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
7740 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
7742 char *myname = "sprintf";
7746 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
7747 #define DOUBLETYPE long double
7749 #define DOUBLETYPE double
7755 #define I_STDLIB $i_stdlib
7761 checkit(expect, got)
7765 if (strcmp(expect, got)) {
7766 printf("%s oddity: Expected %s, got %s\n",
7767 myname, expect, got);
7777 /* This must be 1st test on (which?) platform */
7778 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
7779 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
7780 checkit("0.1", buf);
7782 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
7785 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
7786 checkit("1.1", buf);
7788 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
7789 checkit("1.01", buf);
7791 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
7792 checkit("1.001", buf);
7794 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
7795 checkit("1.0001", buf);
7797 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
7798 checkit("1.00001", buf);
7800 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
7801 checkit("1.000001", buf);
7803 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
7806 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
7809 /* Some Linux gcvt's give 1.e+5 here. */
7810 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
7811 checkit("100000", buf);
7813 /* Some Linux gcvt's give -1.e+5 here. */
7814 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
7815 checkit("-100000", buf);
7817 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
7818 checkit("123.456", buf);
7823 case "$d_Gconvert" in
7824 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
7825 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
7826 sprintf*) xxx_list='sprintf gconvert gcvt' ;;
7827 *) xxx_list='gconvert gcvt sprintf' ;;
7830 case "$d_longdbl$uselongdouble$d_PRIgldbl" in
7831 "$define$define$define")
7832 # for long doubles prefer first qgcvt, then sprintf
7833 xxx_list="`echo $xxx_list|sed s/sprintf//`"
7834 xxx_list="sprintf $xxx_list"
7836 "$define") xxx_list="qgcvt $xxx_list" ;;
7841 for xxx_convert in $xxx_list; do
7842 echo "Trying $xxx_convert..."
7844 set try -DTRY_$xxx_convert
7845 if eval $compile; then
7846 echo "$xxx_convert() found." >&4
7848 echo "I'll use $xxx_convert to convert floats into a string." >&4
7851 echo "...But $xxx_convert didn't work as I expected."
7854 echo "$xxx_convert NOT found." >&4
7858 case "$xxx_convert" in
7859 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
7860 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
7861 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
7862 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
7863 "$define$define$define")
7864 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
7865 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
7870 : see if _fwalk exists
7874 : Initialize h_fcntl
7877 : Initialize h_sysfile
7880 : access call always available on UNIX
7884 : locate the flags for 'access()'
7888 $cat >access.c <<'EOCP'
7889 #include <sys/types.h>
7894 #include <sys/file.h>
7903 : check sys/file.h first, no particular reason here
7904 if $test `./findhdr sys/file.h` && \
7905 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
7907 echo "<sys/file.h> defines the *_OK access constants." >&4
7908 elif $test `./findhdr fcntl.h` && \
7909 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
7911 echo "<fcntl.h> defines the *_OK access constants." >&4
7912 elif $test `./findhdr unistd.h` && \
7913 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
7914 echo "<unistd.h> defines the *_OK access constants." >&4
7916 echo "I can't find the four *_OK access constants--I'll use mine." >&4
7922 : see if accessx exists
7923 set accessx d_accessx
7926 : see if alarm exists
7930 : see if atolf exists
7934 : see if atoll exists
7938 : Look for GNU-cc style attribute checking
7940 echo "Checking whether your compiler can handle __attribute__ ..." >&4
7941 $cat >attrib.c <<'EOCP'
7943 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
7945 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
7946 if $contains 'warning' attrib.out >/dev/null 2>&1; then
7947 echo "Your C compiler doesn't fully support __attribute__."
7950 echo "Your C compiler supports __attribute__."
7954 echo "Your C compiler doesn't seem to understand __attribute__ at all."
7961 : see if bcmp exists
7965 : see if bcopy exists
7969 : see if this is a unistd.h system
7970 set unistd.h i_unistd
7973 : see if getpgrp exists
7974 set getpgrp d_getpgrp
7977 case "$d_getpgrp" in
7980 echo "Checking to see which flavor of getpgrp is in use..."
7983 #include <sys/types.h>
7985 # include <unistd.h>
7989 if (getuid() == 0) {
7990 printf("(I see you are running Configure as super-user...)\n");
7994 if (getpgrp(1) == 0)
8003 if $cc -o set -DTRY_BSD_PGRP $ccflags $ldflags set.c $libs >/dev/null 2>&1 && ./set; then
8004 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
8006 elif $cc -o set $ccflags $ldflags set.c $libs >/dev/null 2>&1 && ./set; then
8007 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
8010 echo "I can't seem to compile and run the test program."
8012 xxx="a USG one, i.e. you use getpgrp()."
8014 # SVR4 systems can appear rather BSD-ish.
8017 xxx="a BSD one, i.e. you use getpgrp(pid)."
8021 xxx="probably a USG one, i.e. you use getpgrp()."
8026 echo "Assuming your getpgrp is $xxx" >&4
8035 : see if setpgrp exists
8036 set setpgrp d_setpgrp
8039 case "$d_setpgrp" in
8042 echo "Checking to see which flavor of setpgrp is in use..."
8045 #include <sys/types.h>
8047 # include <unistd.h>
8051 if (getuid() == 0) {
8052 printf("(I see you are running Configure as super-user...)\n");
8056 if (-1 == setpgrp(1, 1))
8059 if (setpgrp() != -1)
8065 if $cc -o set -DTRY_BSD_PGRP $ccflags $ldflags set.c $libs >/dev/null 2>&1 && ./set; then
8066 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
8068 elif $cc -o set $ccflags $ldflags set.c $libs >/dev/null 2>&1 && ./set; then
8069 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
8072 echo "(I can't seem to compile and run the test program.)"
8074 xxx="a USG one, i.e. you use setpgrp()."
8076 # SVR4 systems can appear rather BSD-ish.
8079 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
8083 xxx="probably a USG one, i.e. you use setpgrp()."
8088 echo "Assuming your setpgrp is $xxx" >&4
8096 : see if bzero exists
8100 : see if signal is declared as pointer to function returning int or void
8102 xxx=`./findhdr signal.h`
8103 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
8104 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
8105 echo "You have int (*signal())() instead of void." >&4
8107 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
8108 echo "You have void (*signal())()." >&4
8110 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
8111 echo "You have int (*signal())() instead of void." >&4
8113 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
8114 echo "You have void (*signal())()." >&4
8117 case "$d_voidsig" in
8119 echo "I can't determine whether signal handler returns void or int..." >&4
8121 rp="What type does your signal handler return?"
8128 echo "As you already told me, signal handler returns void." >&4
8131 *) echo "As you already told me, signal handler returns int." >&4
8138 case "$d_voidsig" in
8139 "$define") signal_t="void";;
8144 : check for ability to cast large floats to 32-bit ints.
8146 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
8147 if $test "$intsize" -ge 4; then
8154 #include <sys/types.h>
8156 $signal_t blech(s) int s; { exit(3); }
8163 signal(SIGFPE, blech);
8165 /* Don't let compiler optimize the test away. Store the number
8166 in a writable string for gcc to pass to sscanf under HP/UX.
8168 sprintf(str, "2147483647");
8169 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
8173 /* x86 processors will probably give 0x8000 0000, which is a
8174 sign change. We don't want that. We want to mimic SPARC
8175 behavior here, which is to preserve the sign and give
8178 if (i32 != ($xxx) f)
8184 if eval $compile_ok; then
8188 echo "(I can't seem to compile the test program--assuming it can't)"
8196 echo "Nope, it can't."
8203 : check for ability to cast negative floats to unsigned
8205 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
8208 #include <sys/types.h>
8210 $signal_t blech(s) int s; { exit(7); }
8211 $signal_t blech_in_list(s) int s; { exit(4); }
8212 unsigned long dummy_long(p) unsigned long p; { return p; }
8213 unsigned int dummy_int(p) unsigned int p; { return p; }
8214 unsigned short dummy_short(p) unsigned short p; { return p; }
8218 unsigned long along;
8220 unsigned short ashort;
8224 /* Frustrate gcc-2.7.2's optimizer which failed this test with
8225 a direct f = -123. assignment. gcc-2.8.0 reportedly
8226 optimized the whole file away
8228 /* Store the number in a writable string for gcc to pass to
8231 sprintf(str, "-123");
8232 sscanf(str, "%lf", &f); /* f = -123.; */
8234 signal(SIGFPE, blech);
8235 along = (unsigned long)f;
8236 aint = (unsigned int)f;
8237 ashort = (unsigned short)f;
8238 if (along != (unsigned long)-123)
8240 if (aint != (unsigned int)-123)
8242 if (ashort != (unsigned short)-123)
8244 sprintf(str, "1073741824.");
8245 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
8248 along = (unsigned long)f;
8249 if (along != 0x80000000)
8253 along = (unsigned long)f;
8254 if (along != 0x7fffffff)
8258 along = (unsigned long)f;
8259 if (along != 0x80000001)
8263 signal(SIGFPE, blech_in_list);
8264 sprintf(str, "123.");
8265 sscanf(str, "%lf", &f); /* f = 123.; */
8266 along = dummy_long((unsigned long)f);
8267 aint = dummy_int((unsigned int)f);
8268 ashort = dummy_short((unsigned short)f);
8269 if (along != (unsigned long)123)
8271 if (aint != (unsigned int)123)
8273 if (ashort != (unsigned short)123)
8280 if eval $compile_ok; then
8284 echo "(I can't seem to compile the test program--assuming it can't)"
8287 case "$castflags" in
8292 echo "Nope, it can't."
8299 : see if vprintf exists
8301 if set vprintf val -f d_vprintf; eval $csym; $val; then
8302 echo 'vprintf() found.' >&4
8304 $cat >vprintf.c <<'EOF'
8305 #include <varargs.h>
8307 int main() { xxx("foo"); }
8316 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
8320 if eval $compile && ./vprintf; then
8321 echo "Your vsprintf() returns (int)." >&4
8324 echo "Your vsprintf() returns (char*)." >&4
8328 echo 'vprintf() NOT found.' >&4
8338 : see if chown exists
8342 : see if chroot exists
8346 : see if chsize exists
8350 : check for const keyword
8352 echo 'Checking to see if your C compiler knows about "const"...' >&4
8353 $cat >const.c <<'EOCP'
8354 typedef struct spug { int drokk; } spug;
8361 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
8363 echo "Yup, it does."
8366 echo "Nope, it doesn't."
8371 : see if crypt exists
8373 if set crypt val -f d_crypt; eval $csym; $val; then
8374 echo 'crypt() found.' >&4
8378 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
8379 if $test -z "$cryptlib"; then
8380 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
8384 if $test -z "$cryptlib"; then
8385 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
8389 if $test -z "$cryptlib"; then
8390 cryptlib=`./loc libcrypt$_a "" $libpth`
8394 if $test -z "$cryptlib"; then
8395 echo 'crypt() NOT found.' >&4
8404 : get csh whereabouts
8406 'csh') val="$undef" ;;
8411 : Respect a hint or command line value for full_csh.
8413 '') full_csh=$csh ;;
8416 : see if cuserid exists
8417 set cuserid d_cuserid
8420 : see if this is a limits.h system
8421 set limits.h i_limits
8424 : see if this is a float.h system
8428 : See if number of significant digits in a double precision number is known
8430 $cat >dbl_dig.c <<EOM
8440 printf("Contains DBL_DIG");
8443 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
8444 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
8445 echo "DBL_DIG found." >&4
8448 echo "DBL_DIG NOT found." >&4
8455 : see if difftime exists
8456 set difftime d_difftime
8459 : see if this is a dirent system
8461 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
8463 echo "<dirent.h> found." >&4
8466 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
8467 echo "<sys/dir.h> found." >&4
8470 xinc=`./findhdr sys/ndir.h`
8472 echo "<dirent.h> NOT found." >&4
8477 : Look for type of directory structure.
8479 $cppstdin $cppflags $cppminus < "$xinc" > try.c
8481 case "$direntrytype" in
8484 $define) guess1='struct dirent' ;;
8485 *) guess1='struct direct' ;;
8488 *) guess1="$direntrytype"
8493 'struct dirent') guess2='struct direct' ;;
8494 *) guess2='struct dirent' ;;
8497 if $contains "$guess1" try.c >/dev/null 2>&1; then
8498 direntrytype="$guess1"
8499 echo "Your directory entries are $direntrytype." >&4
8500 elif $contains "$guess2" try.c >/dev/null 2>&1; then
8501 direntrytype="$guess2"
8502 echo "Your directory entries seem to be $direntrytype." >&4
8504 echo "I don't recognize your system's directory entries." >&4
8505 rp="What type is used for directory entries on this system?"
8513 : see if the directory entry stores field length
8515 $cppstdin $cppflags $cppminus < "$xinc" > try.c
8516 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
8517 echo "Good, your directory entry keeps length information in d_namlen." >&4
8520 echo "Your directory entry does not know about the d_namlen field." >&4
8527 : see if dlerror exists
8530 set dlerror d_dlerror
8534 : see if dlfcn is available
8542 On a few systems, the dynamically loaded modules that perl generates and uses
8543 will need a different extension than shared libs. The default will probably
8551 rp='What is the extension of dynamically loaded modules'
8560 : Check if dlsym need a leading underscore
8566 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
8567 $cat >dyna.c <<'EOM'
8576 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
8578 #include <sys/types.h>
8592 int mode = RTLD_LAZY ;
8594 handle = dlopen("./dyna.$dlext", mode) ;
8595 if (handle == NULL) {
8600 symbol = dlsym(handle, "fred") ;
8601 if (symbol == NULL) {
8602 /* try putting a leading underscore */
8603 symbol = dlsym(handle, "_fred") ;
8604 if (symbol == NULL) {
8617 : Call the object file tmp-dyna.o in case dlext=o.
8618 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
8619 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
8620 $ld -o dyna.$dlext $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
8621 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then
8624 1) echo "Test program failed using dlopen." >&4
8625 echo "Perhaps you should not use dynamic loading." >&4;;
8626 2) echo "Test program failed using dlsym." >&4
8627 echo "Perhaps you should not use dynamic loading." >&4;;
8628 3) echo "dlsym needs a leading underscore" >&4
8630 4) echo "dlsym doesn't need a leading underscore." >&4;;
8633 echo "I can't compile and run the test program." >&4
8634 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
8639 $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
8644 hasproto='varname=$1; func=$2; shift; shift;
8645 while $test $# -ge 2; do
8647 $define) echo "#include <$2>";;
8651 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
8652 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
8653 echo "$func() prototype found.";
8656 echo "$func() prototype NOT found.";
8661 $rm -f try.c tryout.c'
8663 : see if prototype for drand48 is available
8665 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
8668 : see if dup2 exists
8672 : see if eaccess exists
8673 set eaccess d_eaccess
8676 : see if endgrent exists
8677 set endgrent d_endgrent
8680 : see if endhostent exists
8681 set endhostent d_endhent
8684 : see if endnetent exists
8685 set endnetent d_endnent
8688 : see if endprotoent exists
8689 set endprotoent d_endpent
8692 : see if endpwent exists
8693 set endpwent d_endpwent
8696 : see if endservent exists
8697 set endservent d_endsent
8700 : Locate the flags for 'open()'
8702 $cat >open3.c <<'EOCP'
8703 #include <sys/types.h>
8708 #include <sys/file.h>
8719 : check sys/file.h first to get FREAD on Sun
8720 if $test `./findhdr sys/file.h` && \
8721 set open3 -DI_SYS_FILE && eval $compile; then
8723 echo "<sys/file.h> defines the O_* constants..." >&4
8725 echo "and you have the 3 argument form of open()." >&4
8728 echo "but not the 3 argument form of open(). Oh, well." >&4
8731 elif $test `./findhdr fcntl.h` && \
8732 set open3 -DI_FCNTL && eval $compile; then
8734 echo "<fcntl.h> defines the O_* constants..." >&4
8736 echo "and you have the 3 argument form of open()." >&4
8739 echo "but not the 3 argument form of open(). Oh, well." >&4
8744 echo "I can't find the O_* constant definitions! You got problems." >&4
8750 : see which of string.h or strings.h is needed
8752 strings=`./findhdr string.h`
8753 if $test "$strings" && $test -r "$strings"; then
8754 echo "Using <string.h> instead of <strings.h>." >&4
8758 strings=`./findhdr strings.h`
8759 if $test "$strings" && $test -r "$strings"; then
8760 echo "Using <strings.h> instead of <string.h>." >&4
8762 echo "No string header found -- You'll surely have problems." >&4
8768 "$undef") strings=`./findhdr strings.h`;;
8769 *) strings=`./findhdr string.h`;;
8772 : check for non-blocking I/O stuff
8773 case "$h_sysfile" in
8774 true) echo "#include <sys/file.h>" > head.c;;
8777 true) echo "#include <fcntl.h>" > head.c;;
8778 *) echo "#include <sys/fcntl.h>" > head.c;;
8783 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
8784 case "$o_nonblock" in
8787 $cat >>try.c <<'EOCP'
8791 printf("O_NONBLOCK\n");
8795 printf("O_NDELAY\n");
8799 printf("FNDELAY\n");
8806 if eval $compile_ok; then
8808 case "$o_nonblock" in
8809 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
8810 *) echo "Seems like we can use $o_nonblock.";;
8813 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
8816 *) echo "Using $hint value $o_nonblock.";;
8818 $rm -f try try.* .out core
8821 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
8827 #include <sys/types.h>
8830 #define MY_O_NONBLOCK $o_nonblock
8831 #ifndef errno /* XXX need better Configure test */
8842 #include <strings.h>
8844 $signal_t blech(x) int x; { exit(3); }
8846 $cat >> try.c <<'EOCP'
8854 pipe(pd); /* Down: child -> parent */
8855 pipe(pu); /* Up: parent -> child */
8858 close(pd[1]); /* Parent reads from pd[0] */
8859 close(pu[0]); /* Parent writes (blocking) to pu[1] */
8860 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
8862 signal(SIGALRM, blech);
8864 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
8866 sprintf(string, "%d\n", ret);
8867 write(2, string, strlen(string));
8870 if (errno == EAGAIN) {
8876 if (errno == EWOULDBLOCK)
8877 printf("EWOULDBLOCK\n");
8880 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
8881 sleep(2); /* Give it time to close our pipe */
8883 ret = read(pd[0], buf, 1); /* Should read EOF */
8885 sprintf(string, "%d\n", ret);
8886 write(3, string, strlen(string));
8890 close(pd[0]); /* We write to pd[1] */
8891 close(pu[1]); /* We read from pu[0] */
8892 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
8893 close(pd[1]); /* Pipe pd is now fully closed! */
8894 exit(0); /* Bye bye, thank you for playing! */
8898 if eval $compile_ok; then
8899 echo "$startsh" >mtry
8900 echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
8902 ./mtry >/dev/null 2>&1
8904 0) eagain=`$cat try.out`;;
8905 1) echo "Could not perform non-blocking setting!";;
8906 2) echo "I did a successful read() for something that was not there!";;
8907 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
8908 *) echo "Something terribly wrong happened during testing.";;
8910 rd_nodata=`$cat try.ret`
8911 echo "A read() system call with no data present returns $rd_nodata."
8912 case "$rd_nodata" in
8915 echo "(That's peculiar, fixing that to be -1.)"
8921 echo "Forcing errno EAGAIN on read() with no data available."
8925 echo "Your read() sets errno to $eagain when no data is available."
8928 status=`$cat try.err`
8930 0) echo "And it correctly returns 0 to signal EOF.";;
8931 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
8932 *) echo "However, your read() returns '$status' on EOF??";;
8935 if test "$status" = "$rd_nodata"; then
8936 echo "WARNING: you can't distinguish between EOF and no data!"
8940 echo "I can't compile the test program--assuming errno EAGAIN will do."
8947 echo "Using $hint value $eagain."
8948 echo "Your read() returns $rd_nodata when no data is present."
8949 case "$d_eofnblk" in
8950 "$define") echo "And you can see EOF because read() returns 0.";;
8951 "$undef") echo "But you can't see EOF status from read() returned value.";;
8953 echo "(Assuming you can't see EOF status from read anyway.)"
8959 $rm -f try try.* .out core head.c mtry
8961 : see if fchmod exists
8965 : see if fchown exists
8969 : see if this is an fcntl system
8974 : See if fcntl-based locking works.
8975 $cat >try.c <<'EOCP'
8980 #if defined(F_SETLK) && defined(F_SETLKW)
8983 fd = open("try.c", O_RDONLY);
8984 flock.l_type = F_RDLCK;
8985 flock.l_whence = SEEK_SET;
8986 flock.l_start = flock.l_len = 0;
8987 retval = fcntl(fd, F_SETLK, &flock);
8989 (retval < 0 ? exit(2) : exit(0));
8995 echo "Checking if fcntl-based file locking works... "
8999 if eval $compile_ok; then
9001 echo "Yes, it seems to work."
9004 echo "Nope, it didn't work."
9008 echo "I'm unable to compile the test program, so I'll assume not."
9013 echo "Nope, since you don't even have fcntl()."
9016 set d_fcntl_can_lock
9021 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
9022 while $test $# -ge 2; do
9024 $define) echo "#include <$2>";;
9028 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
9030 if eval $compile; then
9041 : see whether socket exists
9043 $echo $n "Hmm... $c" >&4
9044 if set socket val -f d_socket; eval $csym; $val; then
9045 echo "Looks like you have Berkeley networking support." >&4
9047 if set setsockopt val -f; eval $csym; $val; then
9050 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
9054 if $contains socklib libc.list >/dev/null 2>&1; then
9055 echo "Looks like you have Berkeley networking support." >&4
9057 : we will have to assume that it supports the 4.2 BSD interface
9060 echo "You don't have Berkeley networking in libc$_a..." >&4
9061 if test "X$d_socket" = "X$define"; then
9062 echo "...but you seem to believe that you have sockets." >&4
9064 for net in net socket
9066 if test -f /usr/lib/lib$net$_a; then
9067 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
9068 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
9069 if $contains socket libc.list >/dev/null 2>&1; then
9074 echo "...but the Wollongong group seems to have hacked it in." >&4
9075 sockethdr="-I/usr/netinclude"
9078 echo "Found Berkeley sockets interface in lib$net." >& 4
9079 if $contains setsockopt libc.list >/dev/null 2>&1; then
9082 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
9089 if test "X$d_socket" != "X$define"; then
9090 echo "or anywhere else I see." >&4
9098 : see if socketpair exists
9099 set socketpair d_sockpair
9104 echo "Checking the availability of certain socket constants..." >& 4
9105 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
9106 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
9108 #include <sys/types.h>
9109 #include <sys/socket.h>
9115 set try; if eval $compile; then
9118 set d_${enum}; eval $setvar
9122 : see if sys/select.h has to be included
9123 set sys/select.h i_sysselct
9126 : see if we should include time.h, sys/time.h, or both
9128 if test "X$timeincl" = X; then
9129 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9130 $echo $n "I'm now running the test program...$c"
9131 $cat >try.c <<'EOCP'
9132 #include <sys/types.h>
9137 #ifdef SYSTIMEKERNEL
9140 #include <sys/time.h>
9143 #include <sys/select.h>
9152 struct timezone tzp;
9154 if (foo.tm_sec == foo.tm_sec)
9157 if (bar.tv_sec == bar.tv_sec)
9164 for s_timezone in '-DS_TIMEZONE' ''; do
9166 for s_timeval in '-DS_TIMEVAL' ''; do
9167 for i_systimek in '' '-DSYSTIMEKERNEL'; do
9168 for i_time in '' '-DI_TIME'; do
9169 for i_systime in '-DI_SYSTIME' ''; do
9172 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
9173 if eval $compile; then
9174 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
9178 $echo $n "Succeeded with $flags$c"
9190 *SYSTIMEKERNEL*) i_systimek="$define"
9191 timeincl=`./findhdr sys/time.h`
9192 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
9193 *) i_systimek="$undef";;
9196 *I_TIME*) i_time="$define"
9197 timeincl=`./findhdr time.h`" $timeincl"
9198 echo "We'll include <time.h>." >&4;;
9199 *) i_time="$undef";;
9202 *I_SYSTIME*) i_systime="$define"
9203 timeincl=`./findhdr sys/time.h`" $timeincl"
9204 echo "We'll include <sys/time.h>." >&4;;
9205 *) i_systime="$undef";;
9210 : check for fd_set items
9213 Checking to see how well your C compiler handles fd_set and friends ...
9215 $cat >fd_set.c <<EOCP
9216 #$i_systime I_SYS_TIME
9217 #$i_sysselct I_SYS_SELECT
9218 #$d_socket HAS_SOCKET
9219 #include <sys/types.h>
9221 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
9224 #include <sys/time.h>
9227 #include <sys/select.h>
9236 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
9243 set fd_set -DTRYBITS
9244 if eval $compile; then
9245 d_fds_bits="$define"
9247 echo "Well, your system knows about the normal fd_set typedef..." >&4
9249 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
9250 d_fd_macros="$define"
9253 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
9255 d_fd_macros="$undef"
9259 Hmm, your compiler has some difficulty with fd_set. Checking further...
9262 if eval $compile; then
9265 echo "Well, your system has some sort of fd_set available..." >&4
9267 echo "and you have the normal fd_set macros." >&4
9268 d_fd_macros="$define"
9271 but not the normal fd_set macros! Gross! More work for me...
9273 d_fd_macros="$undef"
9276 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
9279 d_fd_macros="$undef"
9284 : see if fgetpos exists
9285 set fgetpos d_fgetpos
9288 : see if flock exists
9292 : see if fork exists
9296 : see if pathconf exists
9297 set pathconf d_pathconf
9300 : see if fpathconf exists
9301 set fpathconf d_fpathconf
9305 : check for fpos64_t
9307 echo "Checking to see if you have fpos64_t..." >&4
9310 int main() { fpos64_t x = 7; }
9313 if eval $compile; then
9315 echo "You have fpos64_t."
9318 echo "You do not have fpos64_t."
9320 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
9327 : see if frexpl exists
9331 hasstruct='varname=$1; struct=$2; shift; shift;
9332 while $test $# -ge 2; do
9334 $define) echo "#include <$2>";;
9338 echo "int main () { struct $struct foo; }" >> try.c;
9340 if eval $compile; then
9349 : see if this is a sys/param system
9350 set sys/param.h i_sysparam
9353 : see if this is a sys/mount.h system
9354 set sys/mount.h i_sysmount
9357 : see if sys/types.h has to be included
9358 set sys/types.h i_systypes
9363 echo "Checking to see if your system supports struct fs_data..." >&4
9364 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
9366 case "$d_fs_data_s" in
9367 "$define") echo "Yes, it does." ;;
9368 *) echo "No, it doesn't." ;;
9371 : see if fseeko exists
9375 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
9378 : see if fsetpos exists
9379 set fsetpos d_fsetpos
9383 : see if fstatfs exists
9384 set fstatfs d_fstatfs
9388 : see if statvfs exists
9389 set statvfs d_statvfs
9392 : see if fstatvfs exists
9393 set fstatvfs d_fstatvfs
9397 : see if fsync exists
9401 : see if ftello exists
9405 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
9408 : see if getcwd exists
9412 : see if getespwnam exists
9413 set getespwnam d_getespwnam
9417 : see if getfsstat exists
9418 set getfsstat d_getfsstat
9421 : see if getgrent exists
9422 set getgrent d_getgrent
9425 : see if gethostbyaddr exists
9426 set gethostbyaddr d_gethbyaddr
9429 : see if gethostbyname exists
9430 set gethostbyname d_gethbyname
9433 : see if gethostent exists
9434 set gethostent d_gethent
9437 : see how we will look up host name
9440 if set gethostname val -f d_gethname; eval $csym; $val; then
9441 echo 'gethostname() found.' >&4
9442 d_gethname="$define"
9445 if set uname val -f d_uname; eval $csym; $val; then
9448 uname() was found, but you're running xenix, and older versions of xenix
9449 have a broken uname(). If you don't really know whether your xenix is old
9450 enough to have a broken system call, use the default answer.
9457 rp='Is your uname() broken?'
9460 n*) d_uname="$define"; call=uname;;
9463 echo 'uname() found.' >&4
9470 case "$d_gethname" in
9471 '') d_gethname="$undef";;
9474 '') d_uname="$undef";;
9476 case "$d_uname$d_gethname" in
9481 Every now and then someone has a $call() that lies about the hostname
9482 but can't be fixed for political or economic reasons. If you wish, I can
9483 pretend $call() isn't there and maybe compute hostname at run-time
9484 thanks to the '$phostname' command.
9487 rp="Shall I ignore $call() from now on?"
9490 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
9493 case "$phostname" in
9495 *) case "$aphostname" in
9501 file=`./loc $file $file $pth`
9502 aphostname=`echo $file $*`
9507 case "$d_uname$d_gethname" in
9510 case "$phostname" in
9512 echo "There will be no way for $package to get your hostname." >&4;;
9514 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
9518 case "$d_phostname" in
9519 '') d_phostname="$undef";;
9522 : see if this is a netdb.h system
9526 : see if prototypes for various gethostxxx netdb.h functions are available
9528 set d_gethostprotos gethostent $i_netdb netdb.h
9531 : see if getlogin exists
9532 set getlogin d_getlogin
9535 : see if getmnt exists
9539 : see if getmntent exists
9540 set getmntent d_getmntent
9543 : see if getnetbyaddr exists
9544 set getnetbyaddr d_getnbyaddr
9547 : see if getnetbyname exists
9548 set getnetbyname d_getnbyname
9551 : see if getnetent exists
9552 set getnetent d_getnent
9555 : see if prototypes for various getnetxxx netdb.h functions are available
9557 set d_getnetprotos getnetent $i_netdb netdb.h
9560 : see if getpagesize exists
9561 set getpagesize d_getpagsz
9565 : see if getprotobyname exists
9566 set getprotobyname d_getpbyname
9569 : see if getprotobynumber exists
9570 set getprotobynumber d_getpbynumber
9573 : see if getprotoent exists
9574 set getprotoent d_getpent
9577 : see if getpgid exists
9578 set getpgid d_getpgid
9581 : see if getpgrp2 exists
9582 set getpgrp2 d_getpgrp2
9585 : see if getppid exists
9586 set getppid d_getppid
9589 : see if getpriority exists
9590 set getpriority d_getprior
9593 : see if prototypes for various getprotoxxx netdb.h functions are available
9595 set d_getprotoprotos getprotoent $i_netdb netdb.h
9598 : see if getprpwnam exists
9599 set getprpwnam d_getprpwnam
9602 : see if getpwent exists
9603 set getpwent d_getpwent
9607 : see if getservbyname exists
9608 set getservbyname d_getsbyname
9611 : see if getservbyport exists
9612 set getservbyport d_getsbyport
9615 : see if getservent exists
9616 set getservent d_getsent
9619 : see if prototypes for various getservxxx netdb.h functions are available
9621 set d_getservprotos getservent $i_netdb netdb.h
9624 : see if getspnam exists
9625 set getspnam d_getspnam
9628 : see if gettimeofday or ftime exists
9629 set gettimeofday d_gettimeod
9631 case "$d_gettimeod" in
9637 val="$undef"; set d_ftime; eval $setvar
9640 case "$d_gettimeod$d_ftime" in
9643 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
9647 : see if this is an grp system
9653 xxx=`./findhdr grp.h`
9654 $cppstdin $cppflags $cppminus < $xxx >$$.h
9656 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
9668 set d_grpasswd; eval $setvar
9672 : see if hasmntopt exists
9673 set hasmntopt d_hasmntopt
9676 : see if this is a netinet/in.h or sys/in.h system
9677 set netinet/in.h i_niin sys/in.h i_sysin
9680 : see if arpa/inet.h has to be included
9681 set arpa/inet.h i_arpainet
9684 : see if htonl --and friends-- exists
9689 : Maybe they are macros.
9694 #include <sys/types.h>
9695 #$i_niin I_NETINET_IN
9697 #$i_arpainet I_ARPA_INET
9699 #include <netinet/in.h>
9705 #include <arpa/inet.h>
9708 printf("Defined as a macro.");
9711 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
9712 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
9714 echo "But it seems to be defined as a macro." >&4
9722 : see if iconv exists
9728 if set index val -f; eval $csym; $val; then
9729 if set strchr val -f d_strchr; eval $csym; $val; then
9730 if $contains strchr "$strings" >/dev/null 2>&1 ; then
9733 echo "strchr() found." >&4
9737 echo "index() found." >&4
9742 echo "index() found." >&4
9745 if set strchr val -f d_strchr; eval $csym; $val; then
9748 echo "strchr() found." >&4
9750 echo "No index() or strchr() found!" >&4
9755 set d_strchr; eval $setvar
9757 set d_index; eval $setvar
9759 : check whether inet_aton exists
9760 set inet_aton d_inetaton
9763 : see if inttypes.h is available
9764 : we want a real compile instead of Inhdr because some systems
9765 : have an inttypes.h which includes non-existent headers
9768 #include <inttypes.h>
9770 static int32_t foo32 = 0x12345678;
9774 if eval $compile; then
9775 echo "<inttypes.h> found." >&4
9778 echo "<inttypes.h> NOT found." >&4
9787 echo "Checking to see if you have int64_t..." >&4
9789 #include <sys/types.h>
9790 #$i_inttypes I_INTTYPES
9792 #include <inttypes.h>
9794 int main() { int64_t x = 7; }
9797 if eval $compile; then
9799 echo "You have int64_t."
9802 echo "You do not have int64_t."
9810 $cat >isascii.c <<'EOCP'
9822 if eval $compile; then
9823 echo "isascii() found." >&4
9826 echo "isascii() NOT found." >&4
9833 : see if isnan exists
9837 : see if isnanl exists
9841 : see if killpg exists
9845 : see if lchown exists
9847 $cat > try.c <<'EOCP'
9848 /* System header to define __stub macros and hopefully few prototypes,
9849 which can conflict with char lchown(); below. */
9851 /* Override any gcc2 internal prototype to avoid an error. */
9852 /* We use char because int might match the return type of a gcc2
9853 builtin and then its argument prototype would still apply. */
9856 /* The GNU C library defines this for functions which it implements
9857 to always fail with ENOSYS. Some functions are actually named
9858 something starting with __ and the normal name is an alias. */
9859 #if defined (__stub_lchown) || defined (__stub___lchown)
9867 if eval $compile; then
9868 $echo "lchown() found." >&4
9871 $echo "lchown() NOT found." >&4
9877 : See if number of significant digits in a double precision number is known
9879 $cat >ldbl_dig.c <<EOM
9889 printf("Contains LDBL_DIG");
9892 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
9893 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
9894 echo "LDBL_DIG found." >&4
9897 echo "LDBL_DIG NOT found." >&4
9904 : see if link exists
9908 : see if localeconv exists
9909 set localeconv d_locconv
9912 : see if lockf exists
9916 : check for long long
9918 echo "Checking to see if you have long long..." >&4
9919 echo 'int main() { long long x = 7; return 0; }' > try.c
9921 if eval $compile; then
9923 echo "You have long long."
9926 echo "You do not have long long."
9932 : check for length of long long
9933 case "${d_longlong}${longlongsize}" in
9936 echo "Checking to see how big your long longs are..." >&4
9937 $cat >try.c <<'EOCP'
9941 printf("%d\n", (int)sizeof(long long));
9946 if eval $compile_ok; then
9947 longlongsize=`./try$exe_ext`
9948 echo "Your long longs are $longlongsize bytes long."
9952 echo "(I can't seem to compile the test program. Guessing...)"
9953 rp="What is the size of a long long (in bytes)?"
9957 if $test "X$longsize" = "X$longlongsize"; then
9958 echo "(That isn't any different from an ordinary long.)"
9964 : see if prototype for lseek is available
9966 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
9969 : see if lstat exists
9973 : see if madvise exists
9974 set madvise d_madvise
9977 : see if mblen exists
9981 : see if mbstowcs exists
9982 set mbstowcs d_mbstowcs
9985 : see if mbtowc exists
9989 : see if memchr exists
9993 : see if memcmp exists
9997 : see if memcpy exists
10001 : see if memmove exists
10002 set memmove d_memmove
10005 : see if memset exists
10006 set memset d_memset
10009 : see if mkdir exists
10013 : see if mkdtemp exists
10014 set mkdtemp d_mkdtemp
10017 : see if mkfifo exists
10018 set mkfifo d_mkfifo
10021 : see if mkstemp exists
10022 set mkstemp d_mkstemp
10025 : see if mkstemps exists
10026 set mkstemps d_mkstemps
10029 : see if mktime exists
10030 set mktime d_mktime
10033 : see if this is a sys/mman.h system
10034 set sys/mman.h i_sysmman
10037 : see if mmap exists
10040 : see what shmat returns
10041 : default to something harmless
10043 case "$i_sysmman$d_mmap" in
10045 $cat >mmap.c <<'END'
10046 #include <sys/mman.h>
10049 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
10054 echo "and it returns ($mmaptype)." >&4
10060 : see if modfl exists
10064 : see if mprotect exists
10065 set mprotect d_mprotect
10068 : see if msgctl exists
10069 set msgctl d_msgctl
10072 : see if msgget exists
10073 set msgget d_msgget
10076 : see if msgsnd exists
10077 set msgsnd d_msgsnd
10080 : see if msgrcv exists
10081 set msgrcv d_msgrcv
10084 : see how much of the 'msg*(2)' library is present.
10087 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
10088 *"$undef"*) h_msg=false;;
10092 case "`ipcs 2>&1`" in
10093 "SVID messages"*"not configured"*)
10094 echo "Your $osname does not have the msg*(2) configured." >&4
10097 set msgctl d_msgctl
10099 set msgget d_msgget
10101 set msgsnd d_msgsnd
10103 set msgrcv d_msgrcv
10109 : we could also check for sys/ipc.h ...
10110 if $h_msg && $test `./findhdr sys/msg.h`; then
10111 echo "You have the full msg*(2) library." >&4
10114 echo "You don't have the full msg*(2) library." >&4
10120 : see if msync exists
10124 : see if munmap exists
10125 set munmap d_munmap
10128 : see if nice exists
10134 echo "Checking which 64-bit integer type we could use..." >&4
10140 val='"unsigned int"'
10145 *) case "$longsize" in
10149 val='"unsigned long"'
10154 *) case "$d_longlong:$longlongsize" in
10159 val='"unsigned long long"'
10164 *) case "$d_int64_t" in
10182 case "$quadtype" in
10183 '') echo "Alas, no 64-bit integer types in sight." >&4
10186 *) if test X"$use64bitint" = Xdefine -o X"$longsize" = X8; then
10191 echo "We $verb use '$quadtype' for 64-bit integers." >&4
10196 : check for length of character
10198 case "$charsize" in
10200 echo "Checking to see how big your characters are (hey, you never know)..." >&4
10201 $cat >try.c <<'EOCP'
10205 printf("%d\n", (int)sizeof(char));
10210 if eval $compile_ok; then
10214 echo "(I can't seem to compile the test program. Guessing...)"
10221 rp="What is the size of a character (in bytes)?"
10226 : check for volatile keyword
10228 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
10229 $cat >try.c <<'EOCP'
10232 typedef struct _goo_struct goo_struct;
10233 goo_struct * volatile goo = ((goo_struct *)0);
10234 struct _goo_struct {
10239 typedef unsigned short foo_t;
10240 char *volatile foo;
10242 volatile foo_t blech;
10246 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
10248 echo "Yup, it does."
10251 echo "Nope, it doesn't."
10259 $echo "Choosing the C types to be used for Perl's internal types..." >&4
10261 case "$use64bitint:$d_quad:$quadtype" in
10264 uvtype="$uquadtype"
10269 uvtype="unsigned long"
10275 case "$uselongdouble:$d_longdbl" in
10277 nvtype="long double"
10278 nvsize=$longdblsize
10285 $echo "(IV will be "$ivtype", $ivsize bytes)"
10286 $echo "(UV will be "$uvtype", $uvsize bytes)"
10287 $echo "(NV will be "$nvtype", $nvsize bytes)"
10290 #$i_inttypes I_INTTYPES
10292 #include <inttypes.h>
10297 int8_t i = INT8_MAX;
10298 uint8_t u = UINT8_MAX;
10299 printf("int8_t\n");
10302 int16_t i = INT16_MAX;
10303 uint16_t i = UINT16_MAX;
10304 printf("int16_t\n");
10307 int32_t i = INT32_MAX;
10308 uint32_t u = UINT32_MAX;
10309 printf("int32_t\n");
10315 '') case "$charsize" in
10317 u8type="unsigned char"
10326 if eval $compile; then
10327 case "`./try$exe_ext`" in
10328 int8_t) i8type=int8_t
10338 '') if $test $charsize -ge 1; then
10340 u8type="unsigned char"
10348 '') case "$shortsize" in
10350 u16type="unsigned short"
10358 '') set try -DINT16
10359 if eval $compile; then
10360 case "`./try$exe_ext`" in
10372 '') if $test $shortsize -ge 2; then
10374 u16type="unsigned short"
10382 '') case "$longsize" in
10384 u32type="unsigned long"
10388 *) case "$intsize" in
10390 u32type="unsigned int"
10400 '') set try -DINT32
10401 if eval $compile; then
10402 case "`./try$exe_ext`" in
10414 '') if $test $intsize -ge 4; then
10416 u32type="unsigned int"
10424 '') case "$d_quad:$quadtype" in
10426 i64type="$quadtype"
10427 u64type="$uquadtype"
10435 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
10436 : volatile so that the compiler has to store it out to memory.
10437 if test X"$d_volatile" = X"$define"; then
10442 #include <sys/types.h>
10443 #include <signal.h>
10445 $volatile int bletched = 0;
10446 $signal_t blech(s) int s; { bletched = 1; }
10451 int n = 8 * $uvsize;
10454 signal(SIGFPE, blech);
10457 for (i = 0; i < n; i++) {
10458 u = u << 1 | ($uvtype)1;
10460 if (($uvtype)d != u)
10464 d = ($nvtype)(u - 1);
10465 if (($uvtype)d != (u - 1))
10473 printf("%d\n", ((i == n) ? -n : i));
10479 d_nv_preserves_uv="$undef"
10480 if eval $compile; then
10481 d_nv_preserves_uv_bits="`./try$exe_ext`"
10483 case "$d_nv_preserves_uv_bits" in
10485 d_nv_preserves_uv_bits=`expr 0 - $d_nv_preserves_uv_bits`
10486 $echo "Your NVs can preserve all $d_nv_preserves_uv_bits bits of your UVs." 2>&1
10487 d_nv_preserves_uv="$define"
10489 [1-9]*) $echo "Your NVs can preserve only $d_nv_preserves_uv_bits bits of your UVs." 2>&1
10490 d_nv_preserves_uv="$undef" ;;
10491 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
10492 d_nv_preserves_uv_bits="$undef" ;;
10498 : check for off64_t
10500 echo "Checking to see if you have off64_t..." >&4
10502 #include <sys/types.h>
10503 #include <unistd.h>
10504 int main() { off64_t x = 7; }
10507 if eval $compile; then
10509 echo "You have off64_t."
10512 echo "You do not have off64_t."
10513 case "$lseeksize" in
10514 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
10521 : see if POSIX threads are available
10522 set pthread.h i_pthread
10528 : how to create joinable pthreads
10529 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
10531 echo "Checking what constant to use for creating joinable pthreads..." >&4
10532 $cat >try.c <<'EOCP'
10533 #include <pthread.h>
10535 int detachstate = JOINABLE;
10538 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
10539 if eval $compile; then
10540 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
10541 val="$undef" # Yes, undef.
10542 set d_old_pthread_create_joinable
10545 set old_pthread_create_joinable
10548 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
10549 if eval $compile; then
10550 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
10552 set d_old_pthread_create_joinable
10554 val=PTHREAD_CREATE_UNDETACHED
10555 set old_pthread_create_joinable
10558 set try -DJOINABLE=__UNDETACHED
10559 if eval $compile; then
10560 echo "You seem to use __UNDETACHED." >&4
10562 set d_old_pthread_create_joinable
10565 set old_pthread_create_joinable
10568 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
10570 set d_old_pthread_create_joinable
10573 set old_pthread_create_joinable
10580 d_old_pthread_create_joinable="$undef"
10581 old_pthread_create_joinable=""
10584 : see if pause exists
10588 : see if pipe exists
10592 : see if poll exists
10597 : see whether the various POSIXish _yields exist
10599 #include <pthread.h>
10605 #ifdef PTHREAD_YIELD
10608 #ifdef PTHREAD_YIELD_NULL
10609 pthread_yield(NULL);
10615 : see if sched_yield exists
10616 set try -DSCHED_YIELD
10617 if eval $compile; then
10619 sched_yield='sched_yield()'
10623 case "$usethreads" in
10626 $define) echo 'sched_yield() found.' >&4 ;;
10627 *) echo 'sched_yield() NOT found.' >&4 ;;
10633 : see if pthread_yield exists
10634 set try -DPTHREAD_YIELD
10635 if eval $compile; then
10637 case "$sched_yield" in
10638 '') sched_yield='pthread_yield()' ;;
10641 set try -DPTHREAD_YIELD_NULL
10642 if eval $compile; then
10644 case "$sched_yield" in
10645 '') sched_yield='pthread_yield(NULL)' ;;
10651 case "$usethreads" in
10654 $define) echo 'pthread_yield() found.' >&4 ;;
10655 *) echo 'pthread_yield() NOT found.' >&4 ;;
10659 set d_pthread_yield
10662 case "$sched_yield" in
10663 '') sched_yield=undef ;;
10668 : see if this is a pwd.h system
10674 xxx=`./findhdr pwd.h`
10675 $cppstdin $cppflags $cppminus < $xxx >$$.h
10677 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
10685 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
10693 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
10701 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
10709 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
10717 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
10725 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
10733 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
10745 set d_pwquota; eval $setvar
10746 set d_pwage; eval $setvar
10747 set d_pwchange; eval $setvar
10748 set d_pwclass; eval $setvar
10749 set d_pwexpire; eval $setvar
10750 set d_pwcomment; eval $setvar
10751 set d_pwgecos; eval $setvar
10752 set d_pwpasswd; eval $setvar
10756 : see if readdir and friends exist
10757 set readdir d_readdir
10759 set seekdir d_seekdir
10761 set telldir d_telldir
10763 set rewinddir d_rewinddir
10766 : see if readlink exists
10767 set readlink d_readlink
10770 : see if rename exists
10771 set rename d_rename
10774 : see if rmdir exists
10778 : see if memory.h is available.
10783 : See if it conflicts with string.h
10789 $cppstdin $cppflags $cppminus < $strings > mem.h
10790 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
10792 echo "We won't be including <memory.h>."
10802 : can bcopy handle overlapping blocks?
10807 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
10809 #$i_memory I_MEMORY
10810 #$i_stdlib I_STDLIB
10811 #$i_string I_STRING
10812 #$i_unistd I_UNISTD
10814 $cat >>try.c <<'EOCP'
10817 # include <memory.h>
10820 # include <stdlib.h>
10823 # include <string.h>
10825 # include <strings.h>
10828 # include <unistd.h> /* Needed for NetBSD */
10832 char buf[128], abc[128];
10838 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
10840 for (align = 7; align >= 0; align--) {
10841 for (len = 36; len; len--) {
10843 bcopy(abc, b, len);
10844 for (off = 1; off <= len; off++) {
10845 bcopy(b, b+off, len);
10846 bcopy(b+off, b, len);
10847 if (bcmp(b, abc, len))
10856 if eval $compile_ok; then
10857 if ./try 2>/dev/null; then
10858 echo "Yes, it can."
10861 echo "It can't, sorry."
10862 case "$d_memmove" in
10863 "$define") echo "But that's Ok since you have memmove()." ;;
10867 echo "(I can't compile the test program, so we'll assume not...)"
10868 case "$d_memmove" in
10869 "$define") echo "But that's Ok since you have memmove()." ;;
10874 $rm -f try.* try core
10878 : can memcpy handle overlapping blocks?
10880 case "$d_memcpy" in
10883 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
10885 #$i_memory I_MEMORY
10886 #$i_stdlib I_STDLIB
10887 #$i_string I_STRING
10888 #$i_unistd I_UNISTD
10890 $cat >>try.c <<'EOCP'
10893 # include <memory.h>
10896 # include <stdlib.h>
10899 # include <string.h>
10901 # include <strings.h>
10904 # include <unistd.h> /* Needed for NetBSD */
10908 char buf[128], abc[128];
10914 /* Copy "abcde..." string to char abc[] so that gcc doesn't
10915 try to store the string in read-only memory. */
10916 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
10918 for (align = 7; align >= 0; align--) {
10919 for (len = 36; len; len--) {
10921 memcpy(b, abc, len);
10922 for (off = 1; off <= len; off++) {
10923 memcpy(b+off, b, len);
10924 memcpy(b, b+off, len);
10925 if (memcmp(b, abc, len))
10934 if eval $compile_ok; then
10935 if ./try 2>/dev/null; then
10936 echo "Yes, it can."
10939 echo "It can't, sorry."
10940 case "$d_memmove" in
10941 "$define") echo "But that's Ok since you have memmove()." ;;
10945 echo "(I can't compile the test program, so we'll assume not...)"
10946 case "$d_memmove" in
10947 "$define") echo "But that's Ok since you have memmove()." ;;
10952 $rm -f try.* try core
10956 : can memcmp be trusted to compare relative magnitude?
10958 case "$d_memcmp" in
10961 echo "Checking if your memcmp() can compare relative magnitude..." >&4
10963 #$i_memory I_MEMORY
10964 #$i_stdlib I_STDLIB
10965 #$i_string I_STRING
10966 #$i_unistd I_UNISTD
10968 $cat >>try.c <<'EOCP'
10971 # include <memory.h>
10974 # include <stdlib.h>
10977 # include <string.h>
10979 # include <strings.h>
10982 # include <unistd.h> /* Needed for NetBSD */
10988 if ((a < b) && memcmp(&a, &b, 1) < 0)
10994 if eval $compile_ok; then
10995 if ./try 2>/dev/null; then
10996 echo "Yes, it can."
10999 echo "No, it can't (it uses signed chars)."
11002 echo "(I can't compile the test program, so we'll assume not...)"
11006 $rm -f try.* try core
11010 : see if prototype for sbrk is available
11012 set d_sbrkproto sbrk $i_unistd unistd.h
11015 : see if select exists
11016 set select d_select
11019 : see if semctl exists
11020 set semctl d_semctl
11023 : see if semget exists
11024 set semget d_semget
11027 : see if semop exists
11031 : see how much of the 'sem*(2)' library is present.
11034 case "$d_semctl$d_semget$d_semop" in
11035 *"$undef"*) h_sem=false;;
11039 case "`ipcs 2>&1`" in
11040 "SVID messages"*"not configured"*)
11041 echo "Your $osname does not have the sem*(2) configured." >&4
11044 set semctl d_semctl
11046 set semget d_semget
11054 : we could also check for sys/ipc.h ...
11055 if $h_sem && $test `./findhdr sys/sem.h`; then
11056 echo "You have the full sem*(2) library." >&4
11059 echo "You don't have the full sem*(2) library." >&4
11065 : see whether sys/sem.h defines union semun
11067 $cat > try.c <<'END'
11068 #include <sys/types.h>
11069 #include <sys/ipc.h>
11070 #include <sys/sem.h>
11071 int main () { union semun semun; semun.buf = 0; }
11074 if eval $compile; then
11075 echo "You have union semun in <sys/sem.h>." >&4
11078 echo "You do not have union semun in <sys/sem.h>." >&4
11081 $rm -f try try.c try.h
11085 : see how to do semctl IPC_STAT
11088 : see whether semctl IPC_STAT can use union semun
11093 # define S_IRUSR S_IREAD
11094 # define S_IWUSR S_IWRITE
11095 # define S_IXUSR S_IEXEC
11097 # define S_IRUSR 0400
11098 # define S_IWUSR 0200
11099 # define S_IXUSR 0100
11101 # define S_IRGRP (S_IRUSR>>3)
11102 # define S_IWGRP (S_IWUSR>>3)
11103 # define S_IXGRP (S_IXUSR>>3)
11104 # define S_IROTH (S_IRUSR>>6)
11105 # define S_IWOTH (S_IWUSR>>6)
11106 # define S_IXOTH (S_IXUSR>>6)
11109 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
11110 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
11111 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
11116 #include <sys/types.h>
11117 #include <sys/ipc.h>
11118 #include <sys/sem.h>
11119 #include <sys/stat.h>
11126 #$d_union_semun HAS_UNION_SEMUN
11129 #ifndef HAS_UNION_SEMUN
11132 struct semid_ds *buf;
11133 unsigned short *array;
11139 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
11140 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
11142 struct semid_ds argbuf;
11145 st = semctl(sem, 0, IPC_STAT, arg);
11149 # endif /* IPC_STAT */
11150 printf("semctl IPC_STAT failed: errno = %d\n", errno);
11152 if (semctl(sem, 0, IPC_RMID, arg) != 0)
11153 # endif /* IPC_RMID */
11154 printf("semctl IPC_RMID failed: errno = %d\n", errno);
11156 #endif /* IPC_PRIVATE && ... */
11157 printf("semget failed: errno = %d\n", errno);
11163 if eval $compile; then
11166 semun) val="$define" ;;
11172 case "$d_semctl_semun" in
11174 echo "You can use union semun for semctl IPC_STAT." >&4
11177 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
11182 : see whether semctl IPC_STAT can use struct semid_ds pointer
11183 $cat > try.c <<'END'
11184 #include <sys/types.h>
11185 #include <sys/ipc.h>
11186 #include <sys/sem.h>
11187 #include <sys/stat.h>
11195 struct semid_ds arg;
11198 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
11199 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
11202 st = semctl(sem, 0, IPC_STAT, &arg);
11204 printf("semid_ds\n");
11206 # endif /* IPC_STAT */
11207 printf("semctl IPC_STAT failed: errno = %d\n", errno);
11209 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
11210 # endif /* IPC_RMID */
11211 printf("semctl IPC_RMID failed: errno = %d\n", errno);
11213 #endif /* IPC_PRIVATE && ... */
11214 printf("semget failed: errno = %d\n", errno);
11221 if eval $compile; then
11224 semid_ds) val="$define" ;;
11228 set d_semctl_semid_ds
11230 case "$d_semctl_semid_ds" in
11232 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
11234 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
11241 # We do not have the full sem*(2) library, so assume we can not
11247 set d_semctl_semid_ds
11252 : see if setegid exists
11253 set setegid d_setegid
11256 : see if seteuid exists
11257 set seteuid d_seteuid
11260 : see if setgrent exists
11261 set setgrent d_setgrent
11264 : see if sethostent exists
11265 set sethostent d_sethent
11268 : see if setlinebuf exists
11269 set setlinebuf d_setlinebuf
11272 : see if setlocale exists
11273 set setlocale d_setlocale
11276 : see if setnetent exists
11277 set setnetent d_setnent
11280 : see if setprotoent exists
11281 set setprotoent d_setpent
11284 : see if setpgid exists
11285 set setpgid d_setpgid
11288 : see if setpgrp2 exists
11289 set setpgrp2 d_setpgrp2
11292 : see if setpriority exists
11293 set setpriority d_setprior
11296 : see if setproctitle exists
11297 set setproctitle d_setproctitle
11300 : see if setpwent exists
11301 set setpwent d_setpwent
11304 : see if setregid exists
11305 set setregid d_setregid
11307 set setresgid d_setresgid
11310 : see if setreuid exists
11311 set setreuid d_setreuid
11313 set setresuid d_setresuid
11316 : see if setrgid exists
11317 set setrgid d_setrgid
11320 : see if setruid exists
11321 set setruid d_setruid
11324 : see if setservent exists
11325 set setservent d_setsent
11328 : see if setsid exists
11329 set setsid d_setsid
11332 : see if setvbuf exists
11333 set setvbuf d_setvbuf
11336 : see if sfio.h is available
11341 : see if sfio library is available
11352 : Ok, but do we want to use it.
11356 true|$define|[yY]*) dflt='y';;
11359 echo "$package can use the sfio library, but it is experimental."
11360 case "$useperlio" in
11362 echo "For sfio also the PerlIO abstraction layer is needed."
11363 echo "Earlier you said you wouldn't want that."
11366 rp="You seem to have sfio available, do you want to try using it?"
11369 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
11370 useperlio="$define"
11373 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
11375 : Remove sfio from list of libraries to use
11376 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
11379 echo "libs = $libs" >&4
11383 *) case "$usesfio" in
11384 true|$define|[yY]*)
11385 echo "Sorry, cannot find sfio on this machine." >&4
11386 echo "Ignoring your setting of usesfio=$usesfio." >&4
11395 $define) usesfio='true';;
11396 *) usesfio='false';;
11399 : see if shmctl exists
11400 set shmctl d_shmctl
11403 : see if shmget exists
11404 set shmget d_shmget
11407 : see if shmat exists
11410 : see what shmat returns
11413 $cat >shmat.c <<'END'
11414 #include <sys/shm.h>
11417 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
11422 echo "and it returns ($shmattype)." >&4
11423 : see if a prototype for shmat is available
11424 xxx=`./findhdr sys/shm.h`
11425 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
11426 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
11437 set d_shmatprototype
11440 : see if shmdt exists
11444 : see how much of the 'shm*(2)' library is present.
11447 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
11448 *"$undef"*) h_shm=false;;
11452 case "`ipcs 2>&1`" in
11453 "SVID shared memory"*"not configured"*)
11454 echo "Your $osname does not have the shm*(2) configured." >&4
11457 set shmctl d_shmctl
11459 set shmget d_shmget
11469 : we could also check for sys/ipc.h ...
11470 if $h_shm && $test `./findhdr sys/shm.h`; then
11471 echo "You have the full shm*(2) library." >&4
11474 echo "You don't have the full shm*(2) library." >&4
11481 : see if we have sigaction
11482 if set sigaction val -f d_sigaction; eval $csym; $val; then
11483 echo 'sigaction() found.' >&4
11484 $cat > try.c <<'EOP'
11486 #include <sys/types.h>
11487 #include <signal.h>
11490 struct sigaction act, oact;
11492 oact.sa_handler = 0;
11493 /* so that act and oact are used */
11494 exit(act.sa_flags == 0 && oact.sa_handler == 0);
11498 if eval $compile_ok; then
11501 echo "But you don't seem to have a useable struct sigaction." >&4
11505 echo 'sigaction NOT found.' >&4
11508 set d_sigaction; eval $setvar
11509 $rm -f try try$_o try.c
11511 : see if sigsetjmp exists
11513 case "$d_sigsetjmp" in
11515 $cat >try.c <<'EOP'
11516 #include <setjmp.h>
11521 if (sigsetjmp(env,1))
11524 siglongjmp(env, 1);
11529 if eval $compile; then
11530 if ./try >/dev/null 2>&1; then
11531 echo "POSIX sigsetjmp found." >&4
11535 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
11541 echo "sigsetjmp not found." >&4
11545 *) val="$d_sigsetjmp"
11546 case "$d_sigsetjmp" in
11547 $define) echo "POSIX sigsetjmp found." >&4;;
11548 $undef) echo "sigsetjmp not found." >&4;;
11556 : see if socks5_init exists
11557 set socks5_init d_socks5_init
11560 : see if sys/stat.h is available
11561 set sys/stat.h i_sysstat
11565 : see if stat knows about block sizes
11567 echo "Checking to see if your struct stat has st_blocks field..." >&4
11568 set d_statblks stat st_blocks $i_sysstat sys/stat.h
11572 : see if this is a sys/vfs.h system
11573 set sys/vfs.h i_sysvfs
11577 : see if this is a sys/statfs.h system
11578 set sys/statfs.h i_sysstatfs
11583 echo "Checking to see if your system supports struct statfs..." >&4
11584 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
11586 case "$d_statfs_s" in
11587 "$define") echo "Yes, it does." ;;
11588 *) echo "No, it doesn't." ;;
11593 : see if struct statfs knows about f_flags
11594 case "$d_statfs_s" in
11597 echo "Checking to see if your struct statfs has f_flags field..." >&4
11598 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
11602 set d_statfs_f_flags
11606 case "$d_statfs_f_flags" in
11607 "$define") echo "Yes, it does." ;;
11608 *) echo "No, it doesn't." ;;
11611 : see if _ptr and _cnt from stdio act std
11614 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
11615 echo "(Looks like you have stdio.h from BSD.)"
11616 case "$stdio_ptr" in
11617 '') stdio_ptr='((fp)->_p)'
11620 *) ptr_lval=$d_stdio_ptr_lval;;
11622 case "$stdio_cnt" in
11623 '') stdio_cnt='((fp)->_r)'
11626 *) cnt_lval=$d_stdio_cnt_lval;;
11628 case "$stdio_base" in
11629 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
11631 case "$stdio_bufsiz" in
11632 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
11634 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
11635 echo "(Looks like you have stdio.h from Linux.)"
11636 case "$stdio_ptr" in
11637 '') stdio_ptr='((fp)->_IO_read_ptr)'
11640 *) ptr_lval=$d_stdio_ptr_lval;;
11642 case "$stdio_cnt" in
11643 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
11646 *) cnt_lval=$d_stdio_cnt_lval;;
11648 case "$stdio_base" in
11649 '') stdio_base='((fp)->_IO_read_base)';;
11651 case "$stdio_bufsiz" in
11652 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
11655 case "$stdio_ptr" in
11656 '') stdio_ptr='((fp)->_ptr)'
11659 *) ptr_lval=$d_stdio_ptr_lval;;
11661 case "$stdio_cnt" in
11662 '') stdio_cnt='((fp)->_cnt)'
11665 *) cnt_lval=$d_stdio_cnt_lval;;
11667 case "$stdio_base" in
11668 '') stdio_base='((fp)->_base)';;
11670 case "$stdio_bufsiz" in
11671 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
11675 : test whether _ptr and _cnt really work
11676 echo "Checking how std your stdio is..." >&4
11679 #define FILE_ptr(fp) $stdio_ptr
11680 #define FILE_cnt(fp) $stdio_cnt
11682 FILE *fp = fopen("try.c", "r");
11685 18 <= FILE_cnt(fp) &&
11686 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
11694 if eval $compile; then
11696 echo "Your stdio acts pretty std."
11699 echo "Your stdio isn't very std."
11702 echo "Your stdio doesn't appear very std."
11708 : Can _ptr be used as an lvalue?
11709 case "$d_stdstdio$ptr_lval" in
11710 $define$define) val=$define ;;
11713 set d_stdio_ptr_lval
11716 : Can _cnt be used as an lvalue?
11717 case "$d_stdstdio$cnt_lval" in
11718 $define$define) val=$define ;;
11721 set d_stdio_cnt_lval
11725 : test whether setting _ptr sets _cnt as a side effect
11726 d_stdio_ptr_lval_sets_cnt="$undef"
11727 d_stdio_ptr_lval_nochange_cnt="$undef"
11728 case "$d_stdio_ptr_lval$d_stdstdio" in
11730 echo "Checking to see what happens if we set the stdio ptr..." >&4
11733 /* Can we scream? */
11734 /* Eat dust sed :-) */
11735 /* In the buffer space, no one can hear you scream. */
11736 #define FILE_ptr(fp) $stdio_ptr
11737 #define FILE_cnt(fp) $stdio_cnt
11738 #include <sys/types.h>
11740 FILE *fp = fopen("try.c", "r");
11745 puts("Fail even to read");
11748 c = getc(fp); /* Read away the first # */
11750 puts("Fail even to read");
11754 18 <= FILE_cnt(fp) &&
11755 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
11757 puts("Fail even to read");
11760 ptr = (char*) FILE_ptr(fp);
11761 cnt = (size_t)FILE_cnt(fp);
11763 FILE_ptr(fp) += 42;
11765 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
11766 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
11769 if (FILE_cnt(fp) <= 20) {
11770 printf ("Fail (<20 chars to test)");
11773 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
11774 puts("Fail compare");
11777 if (cnt == FILE_cnt(fp)) {
11778 puts("Pass_unchanged");
11781 if (FILE_cnt(fp) == (cnt - 42)) {
11782 puts("Pass_changed");
11785 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
11791 if eval $compile; then
11792 case `./try$exe_ext` in
11794 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
11795 d_stdio_ptr_lval_sets_cnt="$define" ;;
11797 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
11798 d_stdio_ptr_lval_nochange_cnt="$define" ;;
11800 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
11802 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
11805 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
11811 : see if _base is also standard
11813 case "$d_stdstdio" in
11817 #define FILE_base(fp) $stdio_base
11818 #define FILE_bufsiz(fp) $stdio_bufsiz
11820 FILE *fp = fopen("try.c", "r");
11823 19 <= FILE_bufsiz(fp) &&
11824 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
11831 if eval $compile; then
11833 echo "And its _base field acts std."
11836 echo "But its _base field isn't std."
11839 echo "However, it seems to be lacking the _base field."
11848 Checking how to access stdio streams by file descriptor number...
11850 case "$stdio_stream_array" in
11851 '') $cat >try.c <<EOCP
11854 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
11858 for s in _iob __iob __sF
11860 set try -DSTDIO_STREAM_ARRAY=$s
11861 if eval $compile; then
11862 case "`./try$exe_ext`" in
11863 yes) stdio_stream_array=$s; break ;;
11867 $rm -f try.* try$exe_ext
11869 case "$stdio_stream_array" in
11871 I can't figure out how to access stdio streams by file descriptor number.
11873 d_stdio_stream_array="$undef"
11876 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
11878 d_stdio_stream_array="$define"
11882 : see if strcoll exists
11883 set strcoll d_strcoll
11886 : check for structure copying
11888 echo "Checking to see if your C compiler can copy structs..." >&4
11889 $cat >try.c <<'EOCP'
11899 if $cc -c try.c >/dev/null 2>&1 ; then
11901 echo "Yup, it can."
11904 echo "Nope, it can't."
11910 : see if strerror and/or sys_errlist[] exist
11912 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
11913 if set strerror val -f d_strerror; eval $csym; $val; then
11914 echo 'strerror() found.' >&4
11915 d_strerror="$define"
11916 d_strerrm='strerror(e)'
11917 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
11918 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
11919 d_syserrlst="$define"
11921 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
11922 d_syserrlst="$undef"
11924 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
11925 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
11926 echo 'strerror() found in string header.' >&4
11927 d_strerror="$define"
11928 d_strerrm='strerror(e)'
11929 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
11930 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
11931 d_syserrlst="$define"
11933 echo "(You don't appear to have any sys_errlist[], how can this be?)"
11934 d_syserrlst="$undef"
11936 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
11937 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
11938 d_strerror="$undef"
11939 d_syserrlst="$define"
11940 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
11942 echo 'strerror() and sys_errlist[] NOT found.' >&4
11943 d_strerror="$undef"
11944 d_syserrlst="$undef"
11945 d_strerrm='"unknown"'
11949 : see if strtod exists
11950 set strtod d_strtod
11953 : see if strtol exists
11954 set strtol d_strtol
11957 : see if strtold exists
11958 set strtold d_strtold
11961 : see if strtoll exists
11962 set strtoll d_strtoll
11965 case "$d_longlong-$d_strtoll" in
11968 Checking whether your strtoll() works okay...
11970 $cat >try.c <<'EOCP'
11973 #define strtoll __strtoll
11976 #define strtoll _strtoll
11979 extern long long int strtoll(char *s, char **, int);
11980 static int bad = 0;
11981 int check(char *s, long long ell, int een) {
11984 gll = strtoll(s, 0, 10);
11985 if (!((gll == ell) && (errno == een)))
11989 check(" 1", 1LL, 0);
11990 check(" 0", 0LL, 0);
11991 check("-1", -1LL, 0);
11992 check("-9223372036854775808", -9223372036854775808LL, 0);
11993 check("-9223372036854775808", -9223372036854775808LL, 0);
11994 check(" 9223372036854775807", 9223372036854775807LL, 0);
11995 check("-9223372036854775808", -9223372036854775808LL, 0);
11996 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
11997 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
12003 if eval $compile; then
12006 ok) echo "Your strtoll() seems to be working okay." ;;
12008 Your strtoll() doesn't seem to be working okay.
12014 echo "(I can't seem to compile the test program--assuming it doesn't)"
12020 : see if strtoq exists
12021 set strtoq d_strtoq
12024 : see if strtoul exists
12025 set strtoul d_strtoul
12028 case "$d_strtoul" in
12031 Checking whether your strtoul() works okay...
12033 $cat >try.c <<'EOCP'
12036 extern unsigned long int strtoul(char *s, char **, int);
12037 static int bad = 0;
12038 void check(char *s, unsigned long eul, int een) {
12041 gul = strtoul(s, 0, 10);
12042 if (!((gul == eul) && (errno == een)))
12046 check(" 1", 1L, 0);
12047 check(" 0", 0L, 0);
12049 case "$longsize" in
12051 $cat >>try.c <<'EOCP'
12052 check("18446744073709551615", 18446744073709551615UL, 0);
12053 check("18446744073709551616", 18446744073709551615UL, ERANGE);
12054 #if 0 /* strtoul() for /^-/ strings is undefined. */
12055 check("-1", 18446744073709551615UL, 0);
12056 check("-18446744073709551614", 2, 0);
12057 check("-18446744073709551615", 1, 0);
12058 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
12059 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
12064 $cat >>try.c <<'EOCP'
12065 check("4294967295", 4294967295UL, 0);
12066 check("4294967296", 4294967295UL, ERANGE);
12067 #if 0 /* strtoul() for /^-/ strings is undefined. */
12068 check("-1", 4294967295UL, 0);
12069 check("-4294967294", 2, 0);
12070 check("-4294967295", 1, 0);
12071 check("-4294967296", 4294967295UL, ERANGE);
12072 check("-4294967297", 4294967295UL, ERANGE);
12077 : Should we write these tests to be more portable by sprintf-ing
12078 : ~0 and then manipulating that char string as input for strtol?
12081 $cat >>try.c <<'EOCP'
12088 if eval $compile; then
12090 ok) echo "Your strtoul() seems to be working okay." ;;
12092 Your strtoul() doesn't seem to be working okay.
12101 : see if strtoull exists
12102 set strtoull d_strtoull
12105 case "$d_longlong-$d_strtoull" in
12108 Checking whether your strtoull() works okay...
12110 $cat >try.c <<'EOCP'
12113 #define strtoull __strtoull
12116 extern unsigned long long int strtoull(char *s, char **, int);
12117 static int bad = 0;
12118 int check(char *s, long long eull, int een) {
12121 gull = strtoull(s, 0, 10);
12122 if (!((gull == eull) && (errno == een)))
12126 check(" 1", 1LL, 0);
12127 check(" 0", 0LL, 0);
12128 check("18446744073709551615", 18446744073709551615ULL, 0);
12129 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
12130 #if 0 /* strtoull() for /^-/ strings is undefined. */
12131 check("-1", 18446744073709551615ULL, 0);
12132 check("-18446744073709551614", 2LL, 0);
12133 check("-18446744073709551615", 1LL, 0);
12134 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
12135 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
12142 if eval $compile; then
12144 ok) echo "Your strtoull() seems to be working okay." ;;
12146 Your strtoull() doesn't seem to be working okay.
12148 d_strtoull="$undef"
12155 : see if strtouq exists
12156 set strtouq d_strtouq
12159 case "$d_strtouq" in
12162 Checking whether your strtouq() works okay...
12164 $cat >try.c <<'EOCP'
12167 extern unsigned long long int strtouq(char *s, char **, int);
12168 static int bad = 0;
12169 void check(char *s, unsigned long long eull, int een) {
12170 unsigned long long gull;
12172 gull = strtouq(s, 0, 10);
12173 if (!((gull == eull) && (errno == een)))
12177 check(" 1", 1LL, 0);
12178 check(" 0", 0LL, 0);
12179 check("18446744073709551615", 18446744073709551615ULL, 0);
12180 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
12181 #if 0 /* strtouq() for /^-/ strings is undefined. */
12182 check("-1", 18446744073709551615ULL, 0);
12183 check("-18446744073709551614", 2LL, 0);
12184 check("-18446744073709551615", 1LL, 0);
12185 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
12186 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
12194 if eval $compile; then
12196 ok) echo "Your strtouq() seems to be working okay." ;;
12198 Your strtouq() doesn't seem to be working okay.
12207 : see if strxfrm exists
12208 set strxfrm d_strxfrm
12211 : see if symlink exists
12212 set symlink d_symlink
12215 : see if syscall exists
12216 set syscall d_syscall
12219 : see if sysconf exists
12220 set sysconf d_sysconf
12223 : see if system exists
12224 set system d_system
12227 : see if tcgetpgrp exists
12228 set tcgetpgrp d_tcgetpgrp
12231 : see if tcsetpgrp exists
12232 set tcsetpgrp d_tcsetpgrp
12235 : see if prototype for telldir is available
12237 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
12240 : see if this is a sys/times.h system
12241 set sys/times.h i_systimes
12244 : see if times exists
12246 if set times val -f d_times; eval $csym; $val; then
12247 echo 'times() found.' >&4
12250 case "$i_systimes" in
12251 "$define") inc='sys/times.h';;
12253 rp="What is the type returned by times() on this system?"
12254 set clock_t clocktype long stdio.h sys/types.h $inc
12257 echo 'times() NOT found, hope that will do.' >&4
12262 : see if truncate exists
12263 set truncate d_truncate
12266 : see if tzname[] exists
12268 if set tzname val -a d_tzname; eval $csym; $val; then
12270 echo 'tzname[] found.' >&4
12273 echo 'tzname[] NOT found.' >&4
12278 : see if umask exists
12282 : see if ustat exists
12286 : backward compatibility for d_hvfork
12287 if test X$d_hvfork != X; then
12288 d_vfork="$d_hvfork"
12291 : see if there is a vfork
12296 : Ok, but do we want to use it. vfork is reportedly unreliable in
12297 : perl on Solaris 2.x, and probably elsewhere.
12301 case "$usevfork" in
12307 Perl can only use a vfork() that doesn't suffer from strict
12308 restrictions on calling functions or modifying global data in
12309 the child. For example, glibc-2.1 contains such a vfork()
12310 that is unsuitable. If your system provides a proper fork()
12311 call, chances are that you do NOT want perl to use vfork().
12314 rp="Do you still want to use vfork()?"
12319 echo "Ok, we won't use vfork()."
12328 $define) usevfork='true';;
12329 *) usevfork='false';;
12332 : see if this is an sysdir system
12333 set sys/dir.h i_sysdir
12336 : see if this is an sysndir system
12337 set sys/ndir.h i_sysndir
12340 : see if closedir exists
12341 set closedir d_closedir
12344 case "$d_closedir" in
12347 echo "Checking whether closedir() returns a status..." >&4
12348 cat > closedir.c <<EOM
12349 #$i_dirent I_DIRENT /**/
12350 #$i_sysdir I_SYS_DIR /**/
12351 #$i_sysndir I_SYS_NDIR /**/
12352 #$i_systypes I_SYS_TYPES /**/
12354 #if defined(I_SYS_TYPES)
12355 #include <sys/types.h>
12357 #if defined(I_DIRENT)
12358 #include <dirent.h>
12359 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
12360 #include <sys/dir.h>
12364 #include <sys/ndir.h>
12368 #include <ndir.h> /* may be wrong in the future */
12370 #include <sys/dir.h>
12375 int main() { return closedir(opendir(".")); }
12378 if eval $compile_ok; then
12379 if ./closedir > /dev/null 2>&1 ; then
12380 echo "Yes, it does."
12383 echo "No, it doesn't."
12387 echo "(I can't seem to compile the test program--assuming it doesn't)"
12395 set d_void_closedir
12398 : see if there is a wait4
12402 : see if waitpid exists
12403 set waitpid d_waitpid
12406 : see if wcstombs exists
12407 set wcstombs d_wcstombs
12410 : see if wctomb exists
12411 set wctomb d_wctomb
12414 : preserve RCS keywords in files with variable substitution, grrr
12419 Revision='$Revision'
12421 case "$crosscompile" in
12422 ''|[nN]*) crosscompile="$undef" ;;
12426 next|rhapsody|darwin) multiarch="$define" ;;
12428 case "$multiarch" in
12429 ''|[nN]*) multiarch="$undef" ;;
12432 : check for alignment requirements
12434 case "$crosscompile$multiarch" in
12437 You seem to be either cross-compiling or doing a multiarchitecture build,
12438 skipping the memory alignment check.
12441 case "$alignbytes" in
12442 '') alignbytes=8 ;;
12446 case "$alignbytes" in
12447 '') echo "Checking alignment constraints..." >&4
12448 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
12449 $cat >try.c <<'EOCP'
12450 typedef long double NV;
12453 $cat >try.c <<'EOCP'
12457 $cat >>try.c <<'EOCP'
12465 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
12470 if eval $compile_ok; then
12474 echo "(I can't seem to compile the test program...)"
12477 *) dflt="$alignbytes"
12480 rp="Doubles must be aligned on a how-many-byte boundary?"
12488 : set the base revision
12491 : check for ordering of bytes in a long
12493 case "$crosscompile$multiarch" in
12496 You seem to be either cross-compiling or doing a multiarchitecture build,
12497 skipping the byteorder check.
12503 case "$byteorder" in
12506 In the following, larger digits indicate more significance. A big-endian
12507 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
12508 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
12509 machines may have weird orders like 3412. A Cray will report 87654321,
12510 an Alpha will report 12345678. If the test program works the default is
12512 I'm now running the test program...
12514 $cat >try.c <<'EOCP'
12521 char c[sizeof(long)];
12524 if (sizeof(long) > 4)
12525 u.l = (0x08070605L << 32) | 0x04030201L;
12528 for (i = 0; i < sizeof(long); i++)
12529 printf("%c", u.c[i]+'0');
12536 if eval $compile && ./try > /dev/null; then
12539 [1-4][1-4][1-4][1-4]|12345678|87654321)
12540 echo "(The test program ran ok.)"
12541 echo "byteorder=$dflt"
12544 ????|????????) echo "(The test program ran ok.)" ;;
12545 *) echo "(The test program didn't run right for some reason.)" ;;
12550 (I can't seem to compile the test program. Guessing big-endian...)
12553 case "$xxx_prompt" in
12555 rp="What is the order of bytes in a long?"
12569 : how do we catenate cpp tokens here?
12571 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
12572 $cat >cpp_stuff.c <<'EOCP'
12573 #define RCAT(a,b)a/**/b
12574 #define ACAT(a,b)a ## b
12578 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
12579 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
12580 echo "Oh! Smells like ANSI's been here." >&4
12581 echo "We can catify or stringify, separately or together!"
12583 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
12584 echo "Ah, yes! The good old days!" >&4
12585 echo "However, in the good old days we don't know how to stringify and"
12586 echo "catify at the same time."
12590 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
12591 to have to edit the values of CAT[2-5] in config.h...
12593 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
12597 : see if this is a db.h system
12603 : Check db version.
12605 echo "Checking Berkeley DB version ..." >&4
12611 #include <sys/types.h>
12616 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
12617 int Major, Minor, Patch ;
12618 unsigned long Version ;
12619 (void)db_version(&Major, &Minor, &Patch) ;
12620 printf("You have Berkeley DB Version 2 or greater\n");
12622 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
12623 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
12624 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
12625 Major, Minor, Patch) ;
12627 /* check that db.h & libdb are compatible */
12628 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
12629 printf("db.h and libdb are incompatible\n") ;
12633 printf("db.h and libdb are compatible\n") ;
12635 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
12636 + DB_VERSION_PATCH ;
12638 /* needs to be >= 2.3.4 */
12639 if (Version < 2003004) {
12640 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
12641 printf("but Perl needs Berkeley DB 2.3.4 or greater\n") ;
12647 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
12648 printf("You have Berkeley DB Version 1\n");
12649 exit(0); /* DB version < 2: the coast is clear. */
12651 exit(1); /* <db.h> not Berkeley DB? */
12657 if eval $compile_ok && ./try; then
12658 echo 'Looks OK.' >&4
12660 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
12664 : Remove db from list of libraries to use
12665 echo "Removing unusable -ldb from library list" >&4
12666 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
12669 echo "libs = $libs" >&4
12679 : Check the return type needed for hash
12681 echo "Checking return type needed for hash for Berkeley DB ..." >&4
12687 #include <sys/types.h>
12690 #ifndef DB_VERSION_MAJOR
12691 u_int32_t hash_cb (ptr, size)
12699 info.hash = hash_cb;
12703 if $cc $ccflags -c try.c >try.out 2>&1 ; then
12704 if $contains warning try.out >>/dev/null 2>&1 ; then
12707 db_hashtype='u_int32_t'
12710 : XXX Maybe we should just give up here.
12711 db_hashtype=u_int32_t
12713 echo "Help: I can't seem to compile the db test program." >&4
12714 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
12717 echo "Your version of Berkeley DB uses $db_hashtype for hash."
12719 *) db_hashtype=u_int32_t
12724 : Check the return type needed for prefix
12726 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
12732 #include <sys/types.h>
12735 #ifndef DB_VERSION_MAJOR
12736 size_t prefix_cb (key1, key2)
12744 info.prefix = prefix_cb;
12748 if $cc $ccflags -c try.c >try.out 2>&1 ; then
12749 if $contains warning try.out >>/dev/null 2>&1 ; then
12750 db_prefixtype='int'
12752 db_prefixtype='size_t'
12755 db_prefixtype='size_t'
12756 : XXX Maybe we should just give up here.
12758 echo "Help: I can't seem to compile the db test program." >&4
12759 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
12762 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
12764 *) db_prefixtype='size_t'
12768 : check for void type
12770 echo "Checking to see how well your C compiler groks the void type..." >&4
12771 case "$voidflags" in
12773 $cat >try.c <<'EOCP'
12779 extern void moo(); /* function returning void */
12780 void (*goo)(); /* ptr to func returning void */
12782 void *hue; /* generic ptr */
12795 int main() { sub(); }
12797 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
12798 voidflags=$defvoidused
12799 echo "Good. It appears to support void to the level $package wants.">&4
12800 if $contains warning .out >/dev/null 2>&1; then
12801 echo "However, you might get some warnings that look like this:"
12805 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
12806 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
12807 echo "It supports 1..."
12808 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
12809 echo "It also supports 2..."
12810 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
12812 echo "And it supports 4 but not 8 definitely."
12814 echo "It doesn't support 4..."
12815 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
12817 echo "But it supports 8."
12820 echo "Neither does it support 8."
12824 echo "It does not support 2..."
12825 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
12827 echo "But it supports 4 and 8."
12829 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
12831 echo "And it supports 4 but has not heard about 8."
12833 echo "However it supports 8 but not 4."
12838 echo "There is no support at all for void."
12843 case "$voidflags" in
12845 *) $cat >&4 <<'EOM'
12846 Support flag bits are:
12847 1: basic void declarations.
12848 2: arrays of pointers to functions returning void.
12849 4: operations between pointers to and addresses of void functions.
12850 8: generic void pointers.
12853 rp="Your void support flags add up to what?"
12861 : How can we generate normalized random numbers ?
12863 echo "Looking for a random number function..." >&4
12864 case "$randfunc" in
12866 if set drand48 val -f; eval $csym; $val; then
12868 echo "Good, found drand48()." >&4
12869 elif set random val -f; eval $csym; $val; then
12871 echo "OK, found random()." >&4
12874 echo "Yick, looks like I have to use rand()." >&4
12885 *-Dmy_rand=*|*-Dmy_srand=*)
12886 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
12887 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
12888 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
12889 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
12893 while $test "$cont"; do
12894 rp="Use which function to generate random numbers?"
12896 if $test "$ans" = "$dflt"; then
12902 if set $ans val -f; eval $csym; $val; then
12906 rp="I cannot find function $ans. Use that name anyway?"
12915 case "$randfunc" in
12917 drand01="drand48()"
12923 case "$randbits" in
12925 echo "Checking to see how many bits your $randfunc() function produces..." >&4
12927 #$i_unistd I_UNISTD
12928 #$i_stdlib I_STDLIB
12931 # include <unistd.h>
12934 # include <stdlib.h>
12939 register unsigned long tmp;
12940 register unsigned long max = 0L;
12942 for (i = 1000; i; i--) {
12943 tmp = (unsigned long) $randfunc();
12944 if (tmp > max) max = tmp;
12946 for (i = 0; max; i++)
12952 if eval $compile_ok; then
12956 echo "(I can't seem to compile the test program...)"
12963 rp="How many bits does your $randfunc() function produce?"
12967 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
12968 seedfunc="s$randfunc"
12969 randseedtype=unsigned
12973 rp="How many bits does your $randfunc() function produce?"
12976 seedfunc="s$randfunc"
12977 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
12978 if set $seedfunc val -f; eval $csym; $val; then
12979 echo "(Using $seedfunc() to seed random generator)"
12981 echo "(Warning: no $seedfunc() to seed random generator)"
12984 randseedtype=unsigned
12992 echo "Determining whether or not we are on an EBCDIC system..." >&4
12993 $cat >tebcdic.c <<'EOM'
12996 if ('M'==0xd4) return 0;
13003 if eval $compile_ok; then
13005 echo "You seem to speak EBCDIC." >&4
13008 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF8." >&4
13011 echo "I'm unable to compile the test program." >&4
13012 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
13014 $rm -f tebcdic.c tebcdic
13020 Checking how to flush all pending stdio output...
13022 # I only know how to find the first 32 possibly open files on SunOS.
13023 # See also hints/sunos_4_1.sh and util.c --AD
13025 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
13027 $cat >>try.c <<EOCP
13029 #$i_unistd I_UNISTD
13031 # include <unistd.h>
13033 #$d_sysconf HAS_SYSCONF
13034 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
13035 #ifdef HAS_STDIO_STREAM_ARRAY
13036 # define STDIO_STREAM_ARRAY $stdio_stream_array
13039 FILE* p = fopen("try.out", "w");
13043 # ifdef TRY_FPRINTF
13047 #ifdef TRY_FFLUSH_NULL
13050 #ifdef TRY_FFLUSH_ALL
13052 long open_max = -1;
13053 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
13054 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
13056 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
13057 open_max = sysconf(_SC_OPEN_MAX);
13060 open_max = FOPEN_MAX;
13063 open_max = OPEN_MAX;
13072 # ifdef HAS_STDIO_STREAM_ARRAY
13073 if (open_max > 0) {
13075 for (i = 0; i < open_max; i++)
13076 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
13077 STDIO_STREAM_ARRAY[i]._file < open_max &&
13078 STDIO_STREAM_ARRAY[i]._flag)
13079 fflush(&STDIO_STREAM_ARRAY[i]);
13087 : first we have to find out how _not_ to flush
13088 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
13090 set try -DTRY_FPUTC
13091 if eval $compile; then
13093 ./try$exe_ext 2>/dev/null
13094 if $test ! -s try.out -a "X$?" = X42; then
13100 set try -DTRY_FPRINTF
13102 if eval $compile; then
13104 ./try$exe_ext 2>/dev/null
13105 if $test ! -s try.out -a "X$?" = X42; then
13106 output=-DTRY_FPRINTF
13112 : check for fflush NULL behaviour
13113 case "$fflushNULL" in
13114 '') set try -DTRY_FFLUSH_NULL $output
13115 if eval $compile; then
13117 ./try$exe_ext 2>/dev/null
13119 if $test -s try.out -a "X$code" = X42; then
13120 fflushNULL="`$cat try.out`"
13122 if $test "X$code" != X42; then
13124 (If this test failed, don't worry, we'll try another method shortly.)
13129 $rm -f core try.core core.try.*
13130 case "$fflushNULL" in
13132 Your fflush(NULL) works okay for output streams.
13133 Let's see if it clobbers input pipes...
13135 # As of mid-March 2000 all versions of Solaris appear to have a stdio
13136 # bug that improperly flushes the input end of pipes. So we avoid the
13137 # autoflush on fork/system/exec support for now. :-(
13138 $cat >tryp.c <<EOCP
13141 main(int argc, char **argv)
13147 while ((i = getc(stdin)) != -1
13148 && (*bp++ = i) != '\n'
13149 && bp < &buf[1024])
13152 fprintf(stdout, "%s", buf);
13160 fflushNULL="$define"
13162 if eval $compile; then
13164 $cat tryp.c | ./tryp$exe_ext 2>/dev/null > tryp.out
13165 if cmp tryp.c tryp.out >/dev/null 2>&1; then
13167 fflush(NULL) seems to behave okay with input streams.
13169 fflushNULL="$define"
13172 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
13174 fflushNULL="$undef"
13177 $rm -f core tryp.c tryp.core core.tryp.*
13180 Your fflush(NULL) isn't working (contrary to ANSI C).
13182 fflushNULL="$undef"
13185 Cannot figure out whether your fflush(NULL) works or not.
13186 I'm assuming it doesn't (contrary to ANSI C).
13188 fflushNULL="$undef"
13192 $define|true|[yY]*)
13193 fflushNULL="$define"
13196 fflushNULL="$undef"
13199 : check explicit looping only if NULL did not work, and if the pipe
13200 : bug does not show up on an explicit flush too
13201 case "$fflushNULL" in
13203 $cat >tryp.c <<EOCP
13206 main(int argc, char **argv)
13212 while ((i = getc(stdin)) != -1
13213 && (*bp++ = i) != '\n'
13214 && bp < &buf[1024])
13217 fprintf(stdout, "%s", buf);
13226 if eval $compile; then
13228 $cat tryp.c | ./tryp$exe_ext 2>/dev/null > tryp.out
13229 if cmp tryp.c tryp.out >/dev/null 2>&1; then
13231 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
13233 : now check for fflushall behaviour
13234 case "$fflushall" in
13235 '') set try -DTRY_FFLUSH_ALL $output
13236 if eval $compile; then
13238 (Now testing the other method--but note that this also may fail.)
13241 ./try$exe_ext 2>/dev/null
13242 if $test -s try.out -a "X$?" = X42; then
13243 fflushall="`$cat try.out`"
13246 $rm -f core try.core core.try.*
13247 case "$fflushall" in
13249 Whew. Flushing explicitly all the stdio streams works.
13251 fflushall="$define"
13254 Sigh. Flushing explicitly all the stdio streams doesn't work.
13259 Cannot figure out whether flushing stdio streams explicitly works or not.
13260 I'm assuming it doesn't.
13266 "$define"|true|[yY]*)
13267 fflushall="$define"
13275 All is futile. Even fflush(stdin) clobbers input pipes!
13282 $rm -f core tryp.c tryp.core core.tryp.*
13284 *) fflushall="$undef"
13288 case "$fflushNULL$fflushall" in
13291 OK, I give up. I cannot figure out how to flush pending stdio output.
13292 We won't be flushing handles at all before fork/exec/popen.
13296 $rm -f try.* try$exe_ext
13298 : Store the full pathname to the ar program for use in the C program
13299 : Respect a hint or command line value for full_ar.
13304 : Store the full pathname to the sed program for use in the C program
13307 : see what type gids are declared as in the kernel
13309 echo "Looking for the type for group ids returned by getgid()."
13310 set gid_t gidtype xxx stdio.h sys/types.h
13314 xxx=`./findhdr sys/user.h`
13315 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
13317 unsigned) dflt="$1 $2" ;;
13321 *) dflt="$gidtype";;
13324 gid_t) echo "gid_t found." ;;
13325 *) rp="What is the type for group ids returned by getgid()?"
13333 *_t) zzz="$gidtype" ;;
13336 echo "Checking the size of $zzz..." >&4
13338 #include <sys/types.h>
13341 printf("%d\n", (int)sizeof($gidtype));
13346 if eval $compile_ok; then
13350 echo "(I can't execute the test program--guessing $gidsize.)" >&4
13353 echo "Your $zzz is $gidsize bytes long."
13358 echo "(I can't compile the test program--guessing $gidsize.)" >&4
13364 *_t) zzz="$gidtype" ;;
13367 echo "Checking the sign of $zzz..." >&4
13369 #include <sys/types.h>
13380 if eval $compile; then
13384 echo "(I can't execute the test program--guessing unsigned.)" >&4
13388 1) echo "Your $zzz is unsigned." ;;
13389 -1) echo "Your $zzz is signed." ;;
13395 echo "(I can't compile the test program--guessing unsigned.)" >&4
13401 if $test X"$quadtype" != X; then
13403 echo "Checking how to print 64-bit integers..." >&4
13405 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
13406 $cat >try.c <<'EOCP'
13407 #include <sys/types.h>
13410 int q = 12345678901;
13411 printf("%ld\n", q);
13415 if eval $compile; then
13416 yyy=`./try$exe_ext`
13419 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
13420 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
13421 echo "We will use %d."
13427 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
13428 $cat >try.c <<'EOCP'
13429 #include <sys/types.h>
13432 long q = 12345678901;
13433 printf("%ld\n", q);
13437 if eval $compile; then
13438 yyy=`./try$exe_ext`
13441 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
13442 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
13443 echo "We will use %ld."
13449 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
13450 $cat >try.c <<'EOCP'
13451 #include <sys/types.h>
13452 #include <inttypes.h>
13455 int64_t q = 12345678901;
13456 printf("%" PRId64 "\n", q);
13460 if eval $compile; then
13461 yyy=`./try$exe_ext`
13464 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
13465 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
13466 echo "We will use the C9X style."
13472 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
13473 $cat >try.c <<'EOCP'
13474 #include <sys/types.h>
13477 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
13478 printf("%lld\n", q);
13482 if eval $compile; then
13483 yyy=`./try$exe_ext`
13486 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
13487 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
13488 echo "We will use the %lld style."
13494 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
13496 #include <sys/types.h>
13499 $quadtype q = 12345678901;
13500 printf("%Ld\n", q);
13504 if eval $compile; then
13505 yyy=`./try$exe_ext`
13508 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
13509 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
13510 echo "We will use %Ld."
13516 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
13518 #include <sys/types.h>
13521 $quadtype q = 12345678901;
13522 printf("%qd\n", q);
13526 if eval $compile; then
13527 yyy=`./try$exe_ext`
13530 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
13531 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
13532 echo "We will use %qd."
13538 if $test X"$sPRId64" = X; then
13539 echo "Cannot figure out how to print 64-bit integers." >&4
13547 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
13548 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
13550 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
13551 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
13557 $echo "Checking the format strings to be used for Perl's internal types..." >&4
13559 if $test X"$ivsize" = X8; then
13560 ivdformat="$sPRId64"
13561 uvuformat="$sPRIu64"
13562 uvoformat="$sPRIo64"
13563 uvxformat="$sPRIx64"
13564 uvXUformat="$sPRIXU64"
13566 if $test X"$ivsize" = X"$longsize"; then
13573 if $test X"$ivsize" = X"$intsize"; then
13581 if $test X"$ivsize" = X"$shortsize"; then
13592 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
13593 nveformat="$sPRIeldbl"
13594 nvfformat="$sPRIfldbl"
13595 nvgformat="$sPRIgldbl"
13596 nvEUformat="$sPRIEUldbl"
13597 nvFUformat="$sPRIFUldbl"
13598 nvGUformat="$sPRIGUldbl"
13608 case "$ivdformat" in
13609 '') echo "$0: Fatal: failed to find format strings, cannot continue." >& 4
13616 $echo "Checking the format string to be used for gids..." >&4
13619 -1) if $test X"$gidsize" = X"$ivsize"; then
13620 gidformat="$ivdformat"
13622 if $test X"$gidsize" = X"$longsize"; then
13625 if $test X"$gidsize" = X"$intsize"; then
13628 if $test X"$gidsize" = X"$shortsize"; then
13635 *) if $test X"$gidsize" = X"$uvsize"; then
13636 gidformat="$uvuformat"
13638 if $test X"$gidsize" = X"$longsize"; then
13641 if $test X"$gidsize" = X"$intsize"; then
13644 if $test X"$gidsize" = X"$shortsize"; then
13653 : see if getgroups exists
13654 set getgroups d_getgrps
13657 : see if setgroups exists
13658 set setgroups d_setgrps
13662 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
13664 case "$d_getgrps$d_setgrps" in
13666 case "$groupstype" in
13667 '') dflt="$gidtype" ;;
13668 *) dflt="$groupstype" ;;
13671 What type of pointer is the second argument to getgroups() and setgroups()?
13672 Usually this is the same as group ids, $gidtype, but not always.
13675 rp='What type pointer is the second argument to getgroups() and setgroups()?'
13679 *) groupstype="$gidtype";;
13683 echo "Checking if your $make program sets \$(MAKE)..." >&4
13684 case "$make_set_make" in
13686 $sed 's/^X //' > testmake.mak << 'EOF'
13688 X @echo 'maketemp="$(MAKE)"'
13690 case "`$make -f testmake.mak 2>/dev/null`" in
13691 *maketemp=*) make_set_make='#' ;;
13692 *) make_set_make="MAKE=$make" ;;
13694 $rm -f testmake.mak
13697 case "$make_set_make" in
13698 '#') echo "Yup, it does.";;
13699 *) echo "Nope, it doesn't.";;
13702 : see what type is used for mode_t
13703 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
13704 set mode_t modetype int stdio.h sys/types.h
13707 : see if stdarg is available
13709 if $test `./findhdr stdarg.h`; then
13710 echo "<stdarg.h> found." >&4
13713 echo "<stdarg.h> NOT found." >&4
13717 : see if varags is available
13719 if $test `./findhdr varargs.h`; then
13720 echo "<varargs.h> found." >&4
13722 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
13725 : set up the varargs testing programs
13726 $cat > varargs.c <<EOP
13728 #include <stdarg.h>
13731 #include <varargs.h>
13735 int f(char *p, ...)
13749 p = va_arg(ap, char *);
13754 $cat > varargs <<EOP
13756 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
13765 : now check which varargs header should be included
13770 if `./varargs I_STDARG`; then
13772 elif `./varargs I_VARARGS`; then
13777 if `./varargs I_VARARGS`; then
13784 echo "I could not find the definition for va_dcl... You have problems..." >&4
13785 val="$undef"; set i_stdarg; eval $setvar
13786 val="$undef"; set i_varargs; eval $setvar
13791 case "$i_varhdr" in
13793 val="$define"; set i_stdarg; eval $setvar
13794 val="$undef"; set i_varargs; eval $setvar
13797 val="$undef"; set i_stdarg; eval $setvar
13798 val="$define"; set i_varargs; eval $setvar
13801 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
13805 : see if we need va_copy
13807 case "$i_stdarg" in
13810 #include <stdarg.h>
13812 #$i_stdlib I_STDLIB
13814 #include <stdlib.h>
13816 #include <signal.h>
13819 ivfprintf(FILE *f, const char *fmt, va_list *valp)
13821 return vfprintf(f, fmt, *valp);
13825 myvfprintf(FILE *f, const char *fmt, va_list val)
13827 return ivfprintf(f, fmt, &val);
13831 myprintf(char *fmt, ...)
13834 va_start(val, fmt);
13835 return myvfprintf(stdout, fmt, val);
13839 main(int ac, char **av)
13841 signal(SIGSEGV, exit);
13843 myprintf("%s%cs all right, then\n", "that", '\'');
13848 if eval $compile && ./try 2>&1 >/dev/null; then
13850 "that's all right, then")
13856 yes) echo "It seems that you don't need va_copy()." >&4
13857 need_va_copy="$undef"
13859 *) echo "It seems that va_copy() or similar will be needed." >&4
13860 need_va_copy="$define"
13863 $rm -f try.* core core.* *.core *.core.*
13865 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
13869 : define a fucntion to check prototypes
13870 $cat > protochk <<EOSH
13873 optimize="$optimize"
13875 prototype="$prototype"
13880 $cat >> protochk <<'EOSH'
13885 while test $# -ge 2; do
13887 $define) echo "#include <$2>" >> try.c ;;
13888 literal) echo "$2" >> try.c ;;
13892 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
13893 cat >> try.c <<'EOCP'
13894 #ifdef CAN_PROTOTYPE
13895 #define _(args) args
13900 echo "$foo" >> try.c
13901 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
13902 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
13908 $eunicefix protochk
13910 : see what type is used for size_t
13911 rp="What is the type used for the length parameter for string functions?"
13912 set size_t sizetype 'unsigned int' stdio.h sys/types.h
13915 : check for type of arguments to gethostbyaddr.
13916 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
13917 case "$d_gethbyaddr" in
13921 Checking to see what type of arguments are accepted by gethostbyaddr().
13923 hdrs="$define sys/types.h
13924 $d_socket sys/socket.h
13925 $i_niin netinet/in.h
13927 $i_unistd unistd.h"
13928 : The first arg can 'char *' or 'void *'
13929 : The second arg is some of integral type
13930 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
13931 for yyy in size_t long int; do
13932 case "$netdb_host_type" in
13933 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
13934 if ./protochk "$try" $hdrs; then
13935 echo "Your system accepts $xxx for the first arg."
13936 echo "...and $yyy for the second arg."
13937 netdb_host_type="$xxx"
13938 netdb_hlen_type="$yyy"
13944 : In case none of those worked, prompt the user.
13945 case "$netdb_host_type" in
13946 '') rp='What is the type for the 1st argument to gethostbyaddr?'
13949 netdb_host_type=$ans
13950 rp='What is the type for the 2nd argument to gethostbyaddr?'
13953 netdb_hlen_type=$ans
13957 *) : no gethostbyaddr, so pick harmless defaults
13958 netdb_host_type='char *'
13959 netdb_hlen_type="$sizetype"
13962 # Remove the "const" if needed. -- but then we'll have a
13964 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
13967 : check for type of argument to gethostbyname.
13968 if test "X$netdb_name_type" = X ; then
13969 case "$d_gethbyname" in
13973 Checking to see what type of argument is accepted by gethostbyname().
13975 hdrs="$define sys/types.h
13976 $d_socket sys/socket.h
13977 $i_niin netinet/in.h
13979 $i_unistd unistd.h"
13980 for xxx in "const char *" "char *"; do
13981 case "$netdb_name_type" in
13982 '') try="extern struct hostent *gethostbyname($xxx);"
13983 if ./protochk "$try" $hdrs; then
13984 echo "Your system accepts $xxx."
13985 netdb_name_type="$xxx"
13990 : In case none of those worked, prompt the user.
13991 case "$netdb_name_type" in
13992 '') rp='What is the type for the 1st argument to gethostbyname?'
13995 netdb_name_type=$ans
13999 *) : no gethostbyname, so pick harmless default
14000 netdb_name_type='char *'
14005 : check for type of 1st argument to getnetbyaddr.
14006 if test "X$netdb_net_type" = X ; then
14007 case "$d_getnbyaddr" in
14011 Checking to see what type of 1st argument is accepted by getnetbyaddr().
14013 hdrs="$define sys/types.h
14014 $d_socket sys/socket.h
14015 $i_niin netinet/in.h
14017 $i_unistd unistd.h"
14018 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
14019 case "$netdb_net_type" in
14020 '') try="extern struct netent *getnetbyaddr($xxx, int);"
14021 if ./protochk "$try" $hdrs; then
14022 echo "Your system accepts $xxx."
14023 netdb_net_type="$xxx"
14028 : In case none of those worked, prompt the user.
14029 case "$netdb_net_type" in
14030 '') rp='What is the type for the 1st argument to getnetbyaddr?'
14033 netdb_net_type=$ans
14037 *) : no getnetbyaddr, so pick harmless default
14038 netdb_net_type='long'
14042 : locate the preferred pager for this system
14048 [a-zA-Z]:/*) dflt=$pg;;
14052 [a-zA-Z]:/*) dflt=$more;;
14056 [a-zA-Z]:/*) dflt=$less;;
14059 '') dflt=/usr/ucb/more;;
14066 rp='What pager is used on your system?'
14070 : see what type pids are declared as in the kernel
14071 rp="What is the type of process ids on this system?"
14072 set pid_t pidtype int stdio.h sys/types.h
14075 : Find earliest binary compatible site_perl subdirectory perl can use.
14076 case "$bincompat5005" in
14077 "$define") xs_apiversion='5.005' ;;
14078 *) xs_apiversion=$version ;; # The current site_perl version.
14080 : Find earliest pure perl site_perl subdirectory perl can use.
14081 : The versioned directories started at 5.005.
14082 pm_apiversion='5.005'
14084 : check for length of pointer
14088 echo "Checking to see how big your pointers are..." >&4
14089 if test "$voidflags" -gt 7; then
14090 echo '#define VOID_PTR char *' > try.c
14092 echo '#define VOID_PTR void *' > try.c
14094 $cat >>try.c <<'EOCP'
14098 printf("%d\n", (int)sizeof(VOID_PTR));
14103 if eval $compile_ok; then
14105 echo "Your pointers are $ptrsize bytes long."
14108 echo "(I can't seem to compile the test program. Guessing...)" >&4
14109 rp="What is the size of a pointer (in bytes)?"
14117 : see if ar generates random libraries by itself
14119 echo "Checking how to generate random libraries on your machine..." >&4
14120 echo 'int bar1() { return bar2(); }' > bar1.c
14121 echo 'int bar2() { return 2; }' > bar2.c
14122 $cat > foo.c <<'EOP'
14123 int main() { printf("%d\n", bar1()); exit(0); }
14125 $cc $ccflags -c bar1.c >/dev/null 2>&1
14126 $cc $ccflags -c bar2.c >/dev/null 2>&1
14127 $cc $ccflags -c foo.c >/dev/null 2>&1
14128 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
14129 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
14130 ./foobar >/dev/null 2>&1; then
14131 echo "$ar appears to generate random libraries itself."
14134 elif $ar ts bar$_a >/dev/null 2>&1 &&
14135 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
14136 ./foobar >/dev/null 2>&1; then
14137 echo "a table of contents needs to be added with '$ar ts'."
14144 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
14145 $test -f $ranlib || ranlib=''
14148 if $test -n "$ranlib"; then
14149 echo "your system has '$ranlib'; we'll use that."
14152 echo "your system doesn't seem to support random libraries"
14153 echo "so we'll use lorder and tsort to order the libraries."
14160 : check for type of arguments to select.
14161 case "$selecttype" in
14162 '') case "$d_select" in
14166 Checking to see what type of arguments are accepted by select().
14168 hdrs="$define sys/types.h
14169 $i_systime sys/time.h
14170 $i_sysselct sys/select.h
14171 $d_socket sys/socket.h"
14172 : The first arg can be int, unsigned, or size_t
14173 : The last arg may or may not be 'const'
14175 : void pointer has been seen but using that
14176 : breaks the selectminbits test
14177 for xxx in 'fd_set *' 'int *'; do
14178 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
14179 for tmo in 'struct timeval *' 'const struct timeval *'; do
14181 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
14182 if ./protochk "$try" $hdrs; then
14183 echo "Your system accepts $xxx."
14192 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
14193 case "$d_fd_set" in
14194 $define) dflt="fd_set *" ;;
14203 *) : no select, so pick a harmless default
14210 : check for the select 'width'
14211 case "$selectminbits" in
14212 '') case "$d_select" in
14216 Checking to see on how many bits at a time your select() operates...
14219 #include <sys/types.h>
14221 #$i_systime I_SYS_TIME
14222 #$i_systimek I_SYS_TIME_KERNEL
14227 # ifdef I_SYS_TIME_KERNEL
14230 # include <sys/time.h>
14231 # ifdef I_SYS_TIME_KERNEL
14235 #$i_sysselct I_SYS_SELECT
14236 #ifdef I_SYS_SELECT
14237 #include <sys/select.h>
14239 #$d_socket HAS_SOCKET
14241 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
14245 #define S sizeof(*(b))
14247 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
14248 #define NBITS (NBYTES * 8)
14257 fp = fopen("try.c", "r");
14263 b = ($selecttype)s;
14264 for (i = 0; i < NBITS; i++)
14268 select(fd + 1, b, 0, 0, &t);
14269 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
14270 printf("%d\n", i + 1);
14275 if eval $compile_ok; then
14276 selectminbits=`./try`
14277 case "$selectminbits" in
14279 Cannot figure out on how many bits at a time your select() operates.
14280 I'll play safe and guess it is 32 bits.
14286 *) bits="$selectminbits bits" ;;
14288 echo "Your select() operates on $bits at a time." >&4
14290 rp='What is the minimum number of bits your select() operates on?'
14291 case "$byteorder" in
14292 1234|12345678) dflt=32 ;;
14297 selectminbits="$val"
14301 *) : no select, so pick a harmless default
14308 : Trace out the files included by signal.h, then look for SIGxxx names.
14309 : Remove SIGARRAYSIZE used by HPUX.
14310 : Remove SIGSTKSIZE used by Linux.
14311 : Remove SIGSTKSZ used by Posix.
14312 : Remove SIGTYP void lines used by OS2.
14313 : Some cpps, like os390, dont give the file name anywhere
14314 if [ "X$fieldn" = X ]; then
14315 : Just make some guesses. We check them later.
14316 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
14318 xxx=`echo '#include <signal.h>' |
14319 $cppstdin $cppminus $cppflags 2>/dev/null |
14320 $grep '^[ ]*#.*include' |
14321 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq`
14323 : Check this list of files to be sure we have parsed the cpp output ok.
14324 : This will also avoid potentially non-existent files, such
14327 for xx in $xxx /dev/null ; do
14328 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
14330 : If we have found no files, at least try signal.h
14331 case "$xxxfiles" in
14332 '') xxxfiles=`./findhdr signal.h` ;;
14335 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
14336 print substr($2, 4, 20)
14338 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
14339 print substr($3, 4, 20)
14341 : Append some common names just in case the awk scan failed.
14342 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
14343 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
14344 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
14345 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
14346 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
14348 : generate a few handy files for later
14349 $cat > signal.c <<'EOCP'
14350 #include <sys/types.h>
14351 #include <signal.h>
14355 /* Strange style to avoid deeply-nested #if/#else/#endif */
14358 # define NSIG (_NSIG)
14364 # define NSIG (SIGMAX+1)
14370 # define NSIG (SIG_MAX+1)
14376 # define NSIG (MAXSIG+1)
14382 # define NSIG (MAX_SIG+1)
14387 # ifdef SIGARRAYSIZE
14388 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
14394 # define NSIG (_sys_nsig) /* Solaris 2.5 */
14398 /* Default to some arbitrary number that's big enough to get most
14399 of the common signals.
14405 printf("NSIG %d\n", NSIG);
14411 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
14413 printf "#ifdef SIG"; printf $1; printf "\n"
14414 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
14415 printf $1; printf ");\n"
14419 printf "#endif /* JUST_NSIG */\n";
14420 printf "exit(0);\n}\n";
14423 $cat >signal.awk <<'EOP'
14424 BEGIN { ndups = 0 }
14425 $1 ~ /^NSIG$/ { nsig = $2 }
14426 ($1 !~ /^NSIG$/) && (NF == 2) {
14427 if ($2 > maxsig) { maxsig = $2 }
14428 if (sig_name[$2]) {
14429 dup_name[ndups] = $1
14430 dup_num[ndups] = $2
14442 printf("NSIG %d\n", nsig);
14443 for (n = 1; n < nsig; n++) {
14445 printf("%s %d\n", sig_name[n], sig_num[n])
14448 printf("NUM%d %d\n", n, n)
14451 for (n = 0; n < ndups; n++) {
14452 printf("%s %d\n", dup_name[n], dup_num[n])
14456 $cat >signal_cmd <<EOS
14458 if $test -s signal.lst; then
14459 echo "Using your existing signal.lst file"
14464 $cat >>signal_cmd <<'EOS'
14467 if eval $compile_ok; then
14468 ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
14470 echo "(I can't seem be able to compile the whole test program)" >&4
14471 echo "(I'll try it in little pieces.)" >&4
14472 set signal -DJUST_NSIG
14473 if eval $compile_ok; then
14474 ./signal$_exe > signal.nsg
14477 echo "I can't seem to figure out how many signals you have." >&4
14478 echo "Guessing 50." >&4
14479 echo 'NSIG 50' > signal.nsg
14481 : Now look at all the signal names, one at a time.
14482 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
14483 $cat > signal.c <<EOCP
14484 #include <sys/types.h>
14485 #include <signal.h>
14488 printf("$xx %d\n", SIG${xx});
14493 if eval $compile; then
14494 echo "SIG${xx} found."
14495 ./signal$_exe >> signal.ls1
14497 echo "SIG${xx} NOT found."
14500 if $test -s signal.ls1; then
14501 $cat signal.nsg signal.ls1 |
14502 $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
14506 if $test -s signal.lst; then
14509 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
14510 echo 'kill -l' >signal
14511 set X `csh -f <signal`
14515 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
14517 echo $@ | $tr ' ' $trnl | \
14518 $awk '{ printf "%s %d\n", $1, ++s; }
14519 END { printf "NSIG %d\n", ++s }' >signal.lst
14521 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
14523 chmod a+x signal_cmd
14524 $eunicefix signal_cmd
14526 : generate list of signal names
14528 case "$sig_name_init" in
14530 *) case "$sig_num_init" in
14531 ''|*,*) doinit=yes ;;
14536 echo "Generating a list of signal names and numbers..." >&4
14538 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
14539 sig_name=`$awk 'BEGIN { printf "ZERO " }
14540 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
14541 sig_num=`$awk 'BEGIN { printf "0 " }
14542 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
14543 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
14544 !/^NSIG/ { printf "\"%s\", ", $1 }
14545 END { printf "0\n" }' signal.lst`
14546 sig_num_init=`$awk 'BEGIN { printf "0, " }
14547 !/^NSIG/ { printf "%d, ", $2}
14548 END { printf "0\n"}' signal.lst`
14551 echo "The following $sig_count signals are available:"
14553 echo $sig_name | $awk \
14554 'BEGIN { linelen = 0 }
14556 for (i = 1; i <= NF; i++) {
14557 name = "SIG" $i " "
14558 linelen = linelen + length(name)
14559 if (linelen > 70) {
14561 linelen = length(name)
14567 $rm -f signal signal.c signal.awk signal.lst signal_cmd
14570 case "$sizetype" in
14571 *_t) zzz="$sizetype" ;;
14572 *) zzz="filesize" ;;
14574 echo "Checking the size of $zzz..." >&4
14576 #include <sys/types.h>
14579 printf("%d\n", (int)sizeof($sizetype));
14584 if eval $compile_ok; then
14588 echo "(I can't execute the test program--guessing $sizesize.)" >&4
14591 echo "Your $zzz size is $sizesize bytes."
14596 echo "(I can't compile the test program--guessing $sizesize.)" >&4
14600 : check for socklen_t
14602 echo "Checking to see if you have socklen_t..." >&4
14604 #include <sys/types.h>
14605 #$d_socket HAS_SOCKET
14607 #include <sys/socket.h>
14609 int main() { socklen_t x = 16; }
14612 if eval $compile; then
14614 echo "You have socklen_t."
14617 echo "You do not have socklen_t."
14618 case "$sizetype" in
14619 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
14626 : see if this is a socks.h system
14627 set socks.h i_socks
14630 : check for type of the size argument to socket calls
14631 case "$d_socket" in
14635 Checking to see what type is the last argument of accept().
14638 case "$d_socklen_t" in
14639 "$define") yyy="$yyy socklen_t"
14641 yyy="$yyy $sizetype int long unsigned"
14642 for xxx in $yyy; do
14643 case "$socksizetype" in
14644 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
14645 case "$usesocks" in
14647 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
14648 echo "Your system accepts '$xxx *' for the last argument of accept()."
14649 socksizetype="$xxx"
14652 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
14653 echo "Your system accepts '$xxx *' for the last argument of accept()."
14654 socksizetype="$xxx"
14661 : In case none of those worked, prompt the user.
14662 case "$socksizetype" in
14663 '') rp='What is the type for socket address structure sizes?'
14670 *) : no sockets, so pick relatively harmless default
14675 : see what type is used for signed size_t
14676 set ssize_t ssizetype int stdio.h sys/types.h
14679 $cat > ssize.c <<EOM
14681 #include <sys/types.h>
14682 #define Size_t $sizetype
14683 #define SSize_t $dflt
14686 if (sizeof(Size_t) == sizeof(SSize_t))
14688 else if (sizeof(Size_t) == sizeof(int))
14697 if eval $compile_ok && ./ssize > /dev/null; then
14698 ssizetype=`./ssize`
14699 echo "I'll be using $ssizetype for functions returning a byte count." >&4
14702 Help! I can't compile and run the ssize_t test program: please enlighten me!
14703 (This is probably a misconfiguration in your system or libraries, and
14704 you really ought to fix it. Still, I'll try anyway.)
14706 I need a type that is the same size as $sizetype, but is guaranteed to
14707 be signed. Common values are ssize_t, int and long.
14710 rp="What signed type is the same size as $sizetype?"
14714 $rm -f ssize ssize.*
14716 : see what type of char stdio uses.
14718 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
14719 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
14720 echo "Your stdio uses unsigned chars." >&4
14721 stdchar="unsigned char"
14723 echo "Your stdio uses signed chars." >&4
14730 : see if time exists
14732 if test "X$d_time" = X -o X"$timetype" = X; then
14733 if set time val -f d_time; eval $csym; $val; then
14734 echo 'time() found.' >&4
14736 rp="What is the type returned by time() on this system?"
14737 set time_t timetype long stdio.h sys/types.h
14740 echo 'time() not found, hope that will do.' >&4
14748 : see what type uids are declared as in the kernel
14750 echo "Looking for the type for user ids returned by getuid()."
14751 set uid_t uidtype xxx stdio.h sys/types.h
14755 xxx=`./findhdr sys/user.h`
14756 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
14758 unsigned) dflt="$1 $2" ;;
14762 *) dflt="$uidtype";;
14765 uid_t) echo "uid_t found." ;;
14766 *) rp="What is the type for user ids returned by getuid()?"
14774 *_t) zzz="$uidtype" ;;
14777 echo "Checking the size of $zzz..." >&4
14779 #include <sys/types.h>
14782 printf("%d\n", (int)sizeof($uidtype));
14787 if eval $compile_ok; then
14791 echo "(I can't execute the test program--guessing $uidsize.)" >&4
14794 echo "Your $zzz is $uidsize bytes long."
14799 echo "(I can't compile the test program--guessing $uidsize.)" >&4
14804 *_t) zzz="$uidtype" ;;
14807 echo "Checking the sign of $zzz..." >&4
14809 #include <sys/types.h>
14820 if eval $compile; then
14824 echo "(I can't execute the test program--guessing unsigned.)" >&4
14828 1) echo "Your $zzz is unsigned." ;;
14829 -1) echo "Your $zzz is signed." ;;
14835 echo "(I can't compile the test program--guessing unsigned.)" >&4
14841 $echo "Checking the format string to be used for uids..." >&4
14844 -1) if $test X"$uidsize" = X"$ivsize"; then
14845 uidformat="$ivdformat"
14847 if $test X"$uidsize" = X"$longsize"; then
14850 if $test X"$uidsize" = X"$intsize"; then
14853 if $test X"$uidsize" = X"$shortsize"; then
14860 *) if $test X"$uidsize" = X"$uvsize"; then
14861 uidformat="$uvuformat"
14863 if $test X"$uidsize" = X"$longsize"; then
14866 if $test X"$uidsize" = X"$intsize"; then
14869 if $test X"$uidsize" = X"$shortsize"; then
14878 : see if dbm.h is available
14879 : see if dbmclose exists
14880 set dbmclose d_dbmclose
14883 case "$d_dbmclose" in
14893 *) set rpcsvc/dbm.h i_rpcsvcdbm
14898 *) echo "We won't be including <dbm.h>"
14908 : see if this is a sys/file.h system
14913 : do we need to include sys/file.h ?
14917 if $h_sysfile; then
14919 echo "We'll be including <sys/file.h>." >&4
14922 echo "We won't be including <sys/file.h>." >&4
14932 : see if fcntl.h is there
14937 : see if we can include fcntl.h
14943 echo "We'll be including <fcntl.h>." >&4
14946 if $h_sysfile; then
14947 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
14949 echo "We won't be including <fcntl.h>." >&4
14961 : see if this is a iconv.h system
14962 set iconv.h i_iconv
14965 : see if this is a ieeefp.h system
14966 set ieeefp.h i_ieeefp
14969 : see if this is a libutil.h system
14970 set libutil.h i_libutil
14973 : see if locale.h is available
14974 set locale.h i_locale
14977 : see if mach cthreads are available
14978 if test "X$usethreads" = "X$define"; then
14979 set mach/cthreads.h i_machcthr
14982 i_machcthr="$undef"
14987 : see if this is a math.h system
14991 : see if this is a mntent.h system
14992 set mntent.h i_mntent
14995 : see if ndbm.h is available
15000 : see if dbm_open exists
15001 set dbm_open d_dbm_open
15003 case "$d_dbm_open" in
15006 echo "We won't be including <ndbm.h>"
15015 : see if net/errno.h is available
15017 set net/errno.h val
15020 : Unfortunately, it causes problems on some systems. Arrgh.
15023 cat > try.c <<'EOM'
15026 #include <net/errno.h>
15032 if $cc $ccflags -c try.c >/dev/null 2>&1; then
15033 echo "We'll be including <net/errno.h>." >&4
15035 echo "We won't be including <net/errno.h>." >&4
15044 : see if netinet/tcp.h is available
15045 set netinet/tcp.h i_netinettcp
15048 : see if this is a poll.h system
15052 : see if this is a prot.h system
15057 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
15058 $cat <<'EOSH' > Cppsym.know
15059 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
15060 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
15061 alliant alpha am29000 AM29000 amiga AMIGAOS AMIX
15062 ansi ANSI_C_SOURCE apollo ardent atarist att386 att3b BeOS
15063 BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
15064 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
15065 bull c cadmus clipper CMU COFF COMPILER_VERSION
15066 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
15067 CYGWIN DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
15068 Dynix DynixPTX ELF encore EPI EXTENSIONS FILE_OFFSET_BITS
15069 FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
15070 GNU_SOURCE GNUC GNUC_MINOR GO32 gould GOULD_PN
15071 H3050R H3050RX hbullx20 hcx host_mips
15072 hp200 hp300 hp700 HP700 hp800 hp9000
15073 hp9000s200 hp9000s300 hp9000s400 hp9000s500
15074 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
15075 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
15076 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
15077 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
15078 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
15079 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
15080 Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
15081 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
15082 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
15083 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
15084 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
15085 MATH_HAS_NO_SIDE_EFFECTS
15086 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
15087 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
15088 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
15089 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
15090 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
15091 NetBSD news1500 news1700 news1800 news1900 news3700
15092 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
15093 ns32016 ns32332 ns32k nsc32000
15094 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
15095 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
15096 pc532 pdp11 PGC PIC plexus PORTAR posix
15097 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
15098 POSIX_C_SOURCE POSIX_SOURCE POWER
15099 PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
15100 riscix riscos RT scs SCO sequent sgi SGI_SOURCE sinix
15101 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
15102 sony sony_news sonyrisc sparc sparclite spectrum
15103 stardent stdc STDC_EXT stratos sun sun3 sun386
15104 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
15105 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
15106 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
15107 sysV68 sysV88 Tek4132 Tek4300 titan
15108 tower tower32 tower32_200 tower32_600 tower32_700
15109 tower32_800 tower32_850 tss
15110 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
15111 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
15112 unix UNIX95 UNIX99 unixpc unos USGr4 USGr4_2
15113 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms xenix Xenix286
15114 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
15115 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
15118 # Maybe put other stuff here too.
15119 cat <<EOSH >>Cppsym.know
15122 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
15123 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
15124 $cat Cppsym.know > Cppsym.c
15125 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
15126 $rm -f Cppsym.a Cppsym.b Cppsym.c
15127 cat <<EOSH > Cppsym
15129 if $test \$# -gt 0; then
15130 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
15131 if $test -s Cppsym.got; then
15138 $tr " " "$trnl" | ./Cppsym.try
15144 cat <<EOSH > Cppsym.try
15146 cat <<'EOCP' > try.c
15152 cat <<'EOSH' >> Cppsym.try
15154 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
15155 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
15156 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
15157 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
15161 cat <<EOSH >> Cppsym.try
15163 case "$osname-$gccversion" in
15164 irix-) ccflags="\$ccflags -woff 1178" ;;
15165 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
15167 $cc -o try $optimize \$ccflags $ldflags try.c $libs && ./try$exe_ext
15169 chmod +x Cppsym.try
15170 $eunicefix Cppsym.try
15171 ./Cppsym < Cppsym.know > Cppsym.true
15172 : now check the C compiler for additional symbols
15173 postprocess_cc_v=''
15175 aix) postprocess_cc_v="|$tr , ' '" ;;
15182 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
15185 -D*) echo "\$i" | $sed 's/^-D//';;
15186 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
15191 postprocess_cc_v=''
15194 ./ccsym > ccsym1.raw
15195 if $test -s ccsym1.raw; then
15196 $sort ccsym1.raw | $uniq >ccsym.raw
15198 mv ccsym1.raw ccsym.raw
15201 $awk '/\=/ { print $0; next }
15202 { print $0"=1" }' ccsym.raw >ccsym.list
15203 $awk '/\=/ { print $0; next }
15204 { print $0"=1" }' Cppsym.true >ccsym.true
15205 $comm -13 ccsym.true ccsym.list >ccsym.own
15206 $comm -12 ccsym.true ccsym.list >ccsym.com
15207 $comm -23 ccsym.true ccsym.list >ccsym.cpp
15209 if $test -z ccsym.raw; then
15210 echo "Your C compiler doesn't seem to define any symbols!" >&4
15212 echo "However, your C preprocessor defines the following symbols:"
15215 cppsymbols=`$cat Cppsym.true`
15216 cppsymbols=`echo $cppsymbols`
15217 cppccsymbols="$cppsymbols"
15219 if $test -s ccsym.com; then
15220 echo "Your C compiler and pre-processor define these symbols:"
15221 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
15224 cppccsymbols=`$cat ccsym.com`
15225 cppccsymbols=`echo $cppccsymbols`
15226 $test "$silent" || sleep 1
15228 if $test -s ccsym.cpp; then
15229 $test "$also" && echo " "
15230 echo "Your C pre-processor ${also}defines the following symbols:"
15231 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
15233 cppsymbols=`$cat ccsym.cpp`
15234 cppsymbols=`echo $cppsymbols`
15235 $test "$silent" || sleep 1
15237 if $test -s ccsym.own; then
15238 $test "$also" && echo " "
15239 echo "Your C compiler ${also}defines the following cpp symbols:"
15240 $sed -e 's/\(..*\)=1/\1/' ccsym.own
15241 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
15242 ccsymbols=`$cat ccsym.own`
15243 ccsymbols=`echo $ccsymbols`
15244 $test "$silent" || sleep 1
15247 $rm -f ccsym* Cppsym.*
15249 : see if this is a termio system
15253 if $test `./findhdr termios.h`; then
15254 set tcsetattr i_termios
15260 "$define") echo "You have POSIX termios.h... good!" >&4;;
15261 *) if ./Cppsym pyr; then
15262 case "`/bin/universe`" in
15263 ucb) if $test `./findhdr sgtty.h`; then
15265 echo "<sgtty.h> found." >&4
15267 echo "System is pyramid with BSD universe."
15268 echo "<sgtty.h> not found--you could have problems." >&4
15270 *) if $test `./findhdr termio.h`; then
15272 echo "<termio.h> found." >&4
15274 echo "System is pyramid with USG universe."
15275 echo "<termio.h> not found--you could have problems." >&4
15279 if $test `./findhdr termio.h`; then
15280 echo "<termio.h> found." >&4
15282 elif $test `./findhdr sgtty.h`; then
15283 echo "<sgtty.h> found." >&4
15286 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
15289 if $test `./findhdr sgtty.h`; then
15290 echo "<sgtty.h> found." >&4
15292 elif $test `./findhdr termio.h`; then
15293 echo "<termio.h> found." >&4
15296 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
15300 set i_termio; eval $setvar
15301 val=$val2; set i_sgtty; eval $setvar
15302 val=$val3; set i_termios; eval $setvar
15304 : see if this is a shadow.h system
15305 set shadow.h i_shadow
15308 : see if stddef is available
15309 set stddef.h i_stddef
15312 : see if this is a sunmath.h system
15313 set sunmath.h i_sunmath
15316 : see if sys/access.h is available
15317 set sys/access.h i_sysaccess
15320 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
15321 set sys/filio.h i_sysfilio
15324 if $test `./findhdr sys/ioctl.h`; then
15326 echo '<sys/ioctl.h> found.' >&4
15329 if $test $i_sysfilio = "$define"; then
15330 echo '<sys/ioctl.h> NOT found.' >&4
15332 $test $i_sgtty = "$define" && xxx="sgtty.h"
15333 $test $i_termio = "$define" && xxx="termio.h"
15334 $test $i_termios = "$define" && xxx="termios.h"
15335 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
15342 : see if this is a syslog.h system
15343 set syslog.h i_syslog
15347 : see if this is a sys/mode.h system
15348 set sys/mode.h i_sysmode
15351 : see if sys/resource.h has to be included
15352 set sys/resource.h i_sysresrc
15355 : see if sys/security.h is available
15356 set sys/security.h i_syssecrt
15359 : see if this is a sys/statvfs.h system
15360 set sys/statvfs.h i_sysstatvfs
15363 : see if this is a sys/uio.h system
15364 set sys/uio.h i_sysuio
15367 : see if this is a sys/un.h system
15368 set sys/un.h i_sysun
15372 : see if this is a sys/utsname.h system
15373 set sys/utsname.h i_sysutsname
15376 : see if this is a syswait system
15377 set sys/wait.h i_syswait
15380 : see if this is a ustat.h system
15381 set ustat.h i_ustat
15384 : see if this is an utime system
15385 set utime.h i_utime
15388 : see if this is a values.h system
15389 set values.h i_values
15392 : see if this is a vfork system
15395 set vfork.h i_vfork
15403 : see if gdbm.h is available
15408 : see if gdbm_open exists
15409 set gdbm_open d_gdbm_open
15411 case "$d_gdbm_open" in
15414 echo "We won't be including <gdbm.h>"
15424 echo "Looking for extensions..." >&4
15425 : If we are using the old config.sh, known_extensions may contain
15426 : old or inaccurate or duplicate values.
15427 known_extensions=''
15428 nonxs_extensions=''
15429 : We do not use find because it might not be available.
15430 : We do not just use MANIFEST because the user may have dropped
15431 : some additional extensions into the source tree and expect them
15434 : Function to recursively find available extensions, ignoring DynaLoader
15435 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
15439 DynaLoader|dynaload) ;;
15441 if $test -f $xxx/$xxx.xs; then
15442 known_extensions="$known_extensions $1$xxx";
15443 elif $test -f $xxx/Makefile.PL; then
15444 nonxs_extensions="$nonxs_extensions $1$xxx";
15446 if $test -d $xxx -a $# -lt 10; then
15449 eval $find_extensions;
15461 eval $find_extensions
15462 set X $nonxs_extensions
15464 nonxs_extensions="$*"
15465 set X $known_extensions
15467 known_extensions="$*"
15470 : Now see which are supported on this system.
15472 for xxx in $known_extensions ; do
15476 $define) avail_ext="$avail_ext $xxx" ;;
15479 GDBM_File|gdbm_fil)
15481 $define) avail_ext="$avail_ext $xxx" ;;
15484 NDBM_File|ndbm_fil)
15487 case "$osname-$use64bitint" in
15490 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
15493 *) avail_ext="$avail_ext $xxx" ;;
15498 ODBM_File|odbm_fil)
15499 case "${i_dbm}${i_rpcsvcdbm}" in
15501 case "$osname-$use64bitint" in
15504 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
15507 *) avail_ext="$avail_ext $xxx" ;;
15513 case "$useposix" in
15514 true|define|y) avail_ext="$avail_ext $xxx" ;;
15518 case "$useopcode" in
15519 true|define|y) avail_ext="$avail_ext $xxx" ;;
15523 case "$d_socket" in
15524 true|$define|y) avail_ext="$avail_ext $xxx" ;;
15527 Sys/Syslog|sys/syslog)
15528 : XXX syslog requires socket
15529 case "$d_socket" in
15530 true|$define|y) avail_ext="$avail_ext $xxx" ;;
15534 case "$usethreads" in
15535 true|$define|y) avail_ext="$avail_ext $xxx" ;;
15539 : XXX Do we need a useipcsysv variable here
15540 case "${d_msg}${d_sem}${d_shm}" in
15541 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
15544 *) avail_ext="$avail_ext $xxx"
15553 : Now see which nonxs extensions are supported on this system.
15554 : For now assume all are.
15556 for xxx in $nonxs_extensions ; do
15558 *) nonxs_ext="$nonxs_ext $xxx"
15570 A number of extensions are supplied with $package. You may choose to
15571 compile these extensions for dynamic loading (the default), compile
15572 them into the $package executable (static loading), or not include
15573 them at all. Answer "none" to include no extensions.
15574 Note that DynaLoader is always built and need not be mentioned here.
15577 case "$dynamic_ext" in
15578 '') dflt="$avail_ext" ;;
15579 *) dflt="$dynamic_ext"
15580 # Perhaps we are reusing an old out-of-date config.sh.
15583 if test X"$dynamic_ext" != X"$avail_ext"; then
15585 NOTICE: Your previous config.sh list may be incorrect.
15586 The extensions now available to you are
15588 but the default list from your previous config.sh is
15600 rp="What extensions do you wish to load dynamically?"
15603 none) dynamic_ext=' ' ;;
15604 *) dynamic_ext="$ans" ;;
15607 case "$static_ext" in
15609 : Exclude those already listed in dynamic linking
15611 for xxx in $avail_ext; do
15612 case " $dynamic_ext " in
15614 *) dflt="$dflt $xxx" ;;
15621 *) dflt="$static_ext"
15628 rp="What extensions do you wish to load statically?"
15631 none) static_ext=' ' ;;
15632 *) static_ext="$ans" ;;
15637 A number of extensions are supplied with $package. Answer "none"
15638 to include no extensions.
15639 Note that DynaLoader is always built and need not be mentioned here.
15642 case "$static_ext" in
15643 '') dflt="$avail_ext" ;;
15644 *) dflt="$static_ext"
15645 # Perhaps we are reusing an old out-of-date config.sh.
15648 if test X"$static_ext" != X"$avail_ext"; then
15650 NOTICE: Your previous config.sh list may be incorrect.
15651 The extensions now available to you are
15653 but the default list from your previous config.sh is
15662 : Exclude those that are not xs extensions
15666 rp="What extensions do you wish to include?"
15669 none) static_ext=' ' ;;
15670 *) static_ext="$ans" ;;
15675 set X $dynamic_ext $static_ext $nonxs_ext
15679 : Remove libraries needed only for extensions
15680 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
15681 : The exception is SunOS 4.x, which needs them.
15682 case "${osname}X${osvers}" in
15686 *) case "$usedl" in
15687 $define|true|[yY]*)
15688 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
15692 *) perllibs="$libs"
15698 : Remove build directory name from cppstdin so it can be used from
15699 : either the present location or the final installed location.
15701 : Get out of the UU directory to get correct path name.
15703 case "$cppstdin" in
15705 echo "Stripping down cppstdin path name"
15711 : end of configuration questions
15713 echo "End of configuration questions."
15716 : back to where it started
15717 if test -d ../UU; then
15721 : configuration may be patched via a 'config.over' file
15722 if $test -f config.over; then
15725 rp='I see a config.over file. Do you wish to load it?'
15728 n*) echo "OK, I'll ignore it.";;
15730 echo "Configuration override changes have been loaded."
15735 : in case they want portability, strip down executable paths
15736 case "$d_portable" in
15739 echo "Stripping down executable paths..." >&4
15740 for file in $loclist $trylist; do
15742 eval $file=`basename $temp`
15747 : create config.sh file
15749 echo "Creating config.sh..." >&4
15750 $spitshell <<EOT >config.sh
15753 # This file was produced by running the Configure script. It holds all the
15754 # definitions figured out by Configure. Should you modify one of these values,
15755 # do not forget to propagate your changes by running "Configure -der". You may
15756 # instead choose to run each of the .SH files by yourself, or "Configure -S".
15759 # Package name : $package
15760 # Source directory : $src
15761 # Configuration time: $cf_time
15762 # Configured by : $cf_by
15763 # Target system : $myuname
15773 Revision='$Revision'
15780 alignbytes='$alignbytes'
15781 ansi2knr='$ansi2knr'
15782 aphostname='$aphostname'
15783 api_revision='$api_revision'
15784 api_subversion='$api_subversion'
15785 api_version='$api_version'
15786 api_versionstring='$api_versionstring'
15789 archlibexp='$archlibexp'
15790 archname64='$archname64'
15791 archname='$archname'
15792 archobjs='$archobjs'
15797 bincompat5005='$bincompat5005'
15801 byteorder='$byteorder'
15803 castflags='$castflags'
15806 cccdlflags='$cccdlflags'
15807 ccdlflags='$ccdlflags'
15809 ccflags_uselargefiles='$ccflags_uselargefiles'
15811 ccsymbols='$ccsymbols'
15812 ccversion='$ccversion'
15814 cf_email='$cf_email'
15816 charsize='$charsize'
15820 clocktype='$clocktype'
15822 compress='$compress'
15823 contains='$contains'
15827 cpp_stuff='$cpp_stuff'
15828 cppccsymbols='$cppccsymbols'
15829 cppflags='$cppflags'
15831 cppminus='$cppminus'
15833 cppstdin='$cppstdin'
15834 cppsymbols='$cppsymbols'
15835 crosscompile='$crosscompile'
15836 cryptlib='$cryptlib'
15838 d_Gconvert='$d_Gconvert'
15839 d_PRIEUldbl='$d_PRIEUldbl'
15840 d_PRIFUldbl='$d_PRIFUldbl'
15841 d_PRIGUldbl='$d_PRIGUldbl'
15842 d_PRIXU64='$d_PRIXU64'
15843 d_PRId64='$d_PRId64'
15844 d_PRIeldbl='$d_PRIeldbl'
15845 d_PRIfldbl='$d_PRIfldbl'
15846 d_PRIgldbl='$d_PRIgldbl'
15847 d_PRIi64='$d_PRIi64'
15848 d_PRIo64='$d_PRIo64'
15849 d_PRIu64='$d_PRIu64'
15850 d_PRIx64='$d_PRIx64'
15851 d_SCNfldbl='$d_SCNfldbl'
15852 d__fwalk='$d__fwalk'
15853 d_access='$d_access'
15854 d_accessx='$d_accessx'
15856 d_archlib='$d_archlib'
15859 d_attribut='$d_attribut'
15862 d_bincompat5005='$d_bincompat5005'
15864 d_bsdgetpgrp='$d_bsdgetpgrp'
15865 d_bsdsetpgrp='$d_bsdsetpgrp'
15867 d_casti32='$d_casti32'
15868 d_castneg='$d_castneg'
15869 d_charvspr='$d_charvspr'
15871 d_chroot='$d_chroot'
15872 d_chsize='$d_chsize'
15873 d_closedir='$d_closedir'
15877 d_cuserid='$d_cuserid'
15878 d_dbl_dig='$d_dbl_dig'
15879 d_difftime='$d_difftime'
15880 d_dirnamlen='$d_dirnamlen'
15881 d_dlerror='$d_dlerror'
15882 d_dlopen='$d_dlopen'
15883 d_dlsymun='$d_dlsymun'
15884 d_dosuid='$d_dosuid'
15885 d_drand48proto='$d_drand48proto'
15887 d_eaccess='$d_eaccess'
15888 d_endgrent='$d_endgrent'
15889 d_endhent='$d_endhent'
15890 d_endnent='$d_endnent'
15891 d_endpent='$d_endpent'
15892 d_endpwent='$d_endpwent'
15893 d_endsent='$d_endsent'
15894 d_eofnblk='$d_eofnblk'
15895 d_eunice='$d_eunice'
15896 d_fchmod='$d_fchmod'
15897 d_fchown='$d_fchown'
15899 d_fcntl_can_lock='$d_fcntl_can_lock'
15900 d_fd_macros='$d_fd_macros'
15901 d_fd_set='$d_fd_set'
15902 d_fds_bits='$d_fds_bits'
15903 d_fgetpos='$d_fgetpos'
15904 d_flexfnam='$d_flexfnam'
15907 d_fpathconf='$d_fpathconf'
15908 d_fpos64_t='$d_fpos64_t'
15909 d_frexpl='$d_frexpl'
15910 d_fs_data_s='$d_fs_data_s'
15911 d_fseeko='$d_fseeko'
15912 d_fsetpos='$d_fsetpos'
15913 d_fstatfs='$d_fstatfs'
15914 d_fstatvfs='$d_fstatvfs'
15916 d_ftello='$d_ftello'
15918 d_getcwd='$d_getcwd'
15919 d_getespwnam='$d_getespwnam'
15920 d_getfsstat='$d_getfsstat'
15921 d_getgrent='$d_getgrent'
15922 d_getgrps='$d_getgrps'
15923 d_gethbyaddr='$d_gethbyaddr'
15924 d_gethbyname='$d_gethbyname'
15925 d_gethent='$d_gethent'
15926 d_gethname='$d_gethname'
15927 d_gethostprotos='$d_gethostprotos'
15928 d_getlogin='$d_getlogin'
15929 d_getmnt='$d_getmnt'
15930 d_getmntent='$d_getmntent'
15931 d_getnbyaddr='$d_getnbyaddr'
15932 d_getnbyname='$d_getnbyname'
15933 d_getnent='$d_getnent'
15934 d_getnetprotos='$d_getnetprotos'
15935 d_getpagsz='$d_getpagsz'
15936 d_getpbyname='$d_getpbyname'
15937 d_getpbynumber='$d_getpbynumber'
15938 d_getpent='$d_getpent'
15939 d_getpgid='$d_getpgid'
15940 d_getpgrp2='$d_getpgrp2'
15941 d_getpgrp='$d_getpgrp'
15942 d_getppid='$d_getppid'
15943 d_getprior='$d_getprior'
15944 d_getprotoprotos='$d_getprotoprotos'
15945 d_getprpwnam='$d_getprpwnam'
15946 d_getpwent='$d_getpwent'
15947 d_getsbyname='$d_getsbyname'
15948 d_getsbyport='$d_getsbyport'
15949 d_getsent='$d_getsent'
15950 d_getservprotos='$d_getservprotos'
15951 d_getspnam='$d_getspnam'
15952 d_gettimeod='$d_gettimeod'
15953 d_gnulibc='$d_gnulibc'
15954 d_grpasswd='$d_grpasswd'
15955 d_hasmntopt='$d_hasmntopt'
15959 d_inetaton='$d_inetaton'
15960 d_int64_t='$d_int64_t'
15961 d_isascii='$d_isascii'
15963 d_isnanl='$d_isnanl'
15964 d_killpg='$d_killpg'
15965 d_lchown='$d_lchown'
15966 d_ldbl_dig='$d_ldbl_dig'
15968 d_locconv='$d_locconv'
15970 d_longdbl='$d_longdbl'
15971 d_longlong='$d_longlong'
15972 d_lseekproto='$d_lseekproto'
15974 d_madvise='$d_madvise'
15976 d_mbstowcs='$d_mbstowcs'
15977 d_mbtowc='$d_mbtowc'
15978 d_memchr='$d_memchr'
15979 d_memcmp='$d_memcmp'
15980 d_memcpy='$d_memcpy'
15981 d_memmove='$d_memmove'
15982 d_memset='$d_memset'
15984 d_mkdtemp='$d_mkdtemp'
15985 d_mkfifo='$d_mkfifo'
15986 d_mkstemp='$d_mkstemp'
15987 d_mkstemps='$d_mkstemps'
15988 d_mktime='$d_mktime'
15991 d_mprotect='$d_mprotect'
15993 d_msg_ctrunc='$d_msg_ctrunc'
15994 d_msg_dontroute='$d_msg_dontroute'
15995 d_msg_oob='$d_msg_oob'
15996 d_msg_peek='$d_msg_peek'
15997 d_msg_proxy='$d_msg_proxy'
15998 d_msgctl='$d_msgctl'
15999 d_msgget='$d_msgget'
16000 d_msgrcv='$d_msgrcv'
16001 d_msgsnd='$d_msgsnd'
16003 d_munmap='$d_munmap'
16004 d_mymalloc='$d_mymalloc'
16006 d_nv_preserves_uv='$d_nv_preserves_uv'
16007 d_nv_preserves_uv_bits='$d_nv_preserves_uv_bits'
16008 d_off64_t='$d_off64_t'
16009 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
16010 d_oldpthreads='$d_oldpthreads'
16011 d_oldsock='$d_oldsock'
16013 d_pathconf='$d_pathconf'
16015 d_perl_otherlibdirs='$d_perl_otherlibdirs'
16016 d_phostname='$d_phostname'
16019 d_portable='$d_portable'
16020 d_pthread_yield='$d_pthread_yield'
16022 d_pwchange='$d_pwchange'
16023 d_pwclass='$d_pwclass'
16024 d_pwcomment='$d_pwcomment'
16025 d_pwexpire='$d_pwexpire'
16026 d_pwgecos='$d_pwgecos'
16027 d_pwpasswd='$d_pwpasswd'
16028 d_pwquota='$d_pwquota'
16031 d_readdir='$d_readdir'
16032 d_readlink='$d_readlink'
16033 d_rename='$d_rename'
16034 d_rewinddir='$d_rewinddir'
16036 d_safebcpy='$d_safebcpy'
16037 d_safemcpy='$d_safemcpy'
16038 d_sanemcmp='$d_sanemcmp'
16039 d_sbrkproto='$d_sbrkproto'
16040 d_sched_yield='$d_sched_yield'
16041 d_scm_rights='$d_scm_rights'
16042 d_seekdir='$d_seekdir'
16043 d_select='$d_select'
16045 d_semctl='$d_semctl'
16046 d_semctl_semid_ds='$d_semctl_semid_ds'
16047 d_semctl_semun='$d_semctl_semun'
16048 d_semget='$d_semget'
16050 d_setegid='$d_setegid'
16051 d_seteuid='$d_seteuid'
16052 d_setgrent='$d_setgrent'
16053 d_setgrps='$d_setgrps'
16054 d_sethent='$d_sethent'
16055 d_setlinebuf='$d_setlinebuf'
16056 d_setlocale='$d_setlocale'
16057 d_setnent='$d_setnent'
16058 d_setpent='$d_setpent'
16059 d_setpgid='$d_setpgid'
16060 d_setpgrp2='$d_setpgrp2'
16061 d_setpgrp='$d_setpgrp'
16062 d_setprior='$d_setprior'
16063 d_setproctitle='$d_setproctitle'
16064 d_setpwent='$d_setpwent'
16065 d_setregid='$d_setregid'
16066 d_setresgid='$d_setresgid'
16067 d_setresuid='$d_setresuid'
16068 d_setreuid='$d_setreuid'
16069 d_setrgid='$d_setrgid'
16070 d_setruid='$d_setruid'
16071 d_setsent='$d_setsent'
16072 d_setsid='$d_setsid'
16073 d_setvbuf='$d_setvbuf'
16077 d_shmatprototype='$d_shmatprototype'
16078 d_shmctl='$d_shmctl'
16080 d_shmget='$d_shmget'
16081 d_sigaction='$d_sigaction'
16082 d_sigsetjmp='$d_sigsetjmp'
16083 d_socket='$d_socket'
16084 d_socklen_t='$d_socklen_t'
16085 d_sockpair='$d_sockpair'
16086 d_socks5_init='$d_socks5_init'
16088 d_statblks='$d_statblks'
16089 d_statfs_f_flags='$d_statfs_f_flags'
16090 d_statfs_s='$d_statfs_s'
16091 d_statvfs='$d_statvfs'
16092 d_stdio_cnt_lval='$d_stdio_cnt_lval'
16093 d_stdio_ptr_lval='$d_stdio_ptr_lval'
16094 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
16095 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
16096 d_stdio_stream_array='$d_stdio_stream_array'
16097 d_stdiobase='$d_stdiobase'
16098 d_stdstdio='$d_stdstdio'
16099 d_strchr='$d_strchr'
16100 d_strcoll='$d_strcoll'
16101 d_strctcpy='$d_strctcpy'
16102 d_strerrm='$d_strerrm'
16103 d_strerror='$d_strerror'
16104 d_strtod='$d_strtod'
16105 d_strtol='$d_strtol'
16106 d_strtold='$d_strtold'
16107 d_strtoll='$d_strtoll'
16108 d_strtoq='$d_strtoq'
16109 d_strtoul='$d_strtoul'
16110 d_strtoull='$d_strtoull'
16111 d_strtouq='$d_strtouq'
16112 d_strxfrm='$d_strxfrm'
16113 d_suidsafe='$d_suidsafe'
16114 d_symlink='$d_symlink'
16115 d_syscall='$d_syscall'
16116 d_sysconf='$d_sysconf'
16117 d_sysernlst='$d_sysernlst'
16118 d_syserrlst='$d_syserrlst'
16119 d_system='$d_system'
16120 d_tcgetpgrp='$d_tcgetpgrp'
16121 d_tcsetpgrp='$d_tcsetpgrp'
16122 d_telldir='$d_telldir'
16123 d_telldirproto='$d_telldirproto'
16126 d_truncate='$d_truncate'
16127 d_tzname='$d_tzname'
16130 d_union_semun='$d_union_semun'
16132 d_vendorarch='$d_vendorarch'
16133 d_vendorbin='$d_vendorbin'
16134 d_vendorlib='$d_vendorlib'
16136 d_void_closedir='$d_void_closedir'
16137 d_voidsig='$d_voidsig'
16138 d_voidtty='$d_voidtty'
16139 d_volatile='$d_volatile'
16140 d_vprintf='$d_vprintf'
16142 d_waitpid='$d_waitpid'
16143 d_wcstombs='$d_wcstombs'
16144 d_wctomb='$d_wctomb'
16147 db_hashtype='$db_hashtype'
16148 db_prefixtype='$db_prefixtype'
16149 defvoidused='$defvoidused'
16150 direntrytype='$direntrytype'
16153 doublesize='$doublesize'
16155 dynamic_ext='$dynamic_ext'
16161 eunicefix='$eunicefix'
16164 extensions='$extensions'
16165 fflushNULL='$fflushNULL'
16166 fflushall='$fflushall'
16168 firstmakefile='$firstmakefile'
16170 fpossize='$fpossize'
16171 fpostype='$fpostype'
16172 freetype='$freetype'
16174 full_csh='$full_csh'
16175 full_sed='$full_sed'
16176 gccosandvers='$gccosandvers'
16177 gccversion='$gccversion'
16178 gidformat='$gidformat'
16184 groupcat='$groupcat'
16185 groupstype='$groupstype'
16188 h_sysfile='$h_sysfile'
16199 i_arpainet='$i_arpainet'
16200 i_bsdioctl='$i_bsdioctl'
16203 i_dirent='$i_dirent'
16211 i_ieeefp='$i_ieeefp'
16212 i_inttypes='$i_inttypes'
16213 i_libutil='$i_libutil'
16214 i_limits='$i_limits'
16215 i_locale='$i_locale'
16216 i_machcthr='$i_machcthr'
16217 i_malloc='$i_malloc'
16219 i_memory='$i_memory'
16220 i_mntent='$i_mntent'
16223 i_neterrno='$i_neterrno'
16224 i_netinettcp='$i_netinettcp'
16228 i_pthread='$i_pthread'
16230 i_rpcsvcdbm='$i_rpcsvcdbm'
16233 i_shadow='$i_shadow'
16235 i_stdarg='$i_stdarg'
16236 i_stddef='$i_stddef'
16237 i_stdlib='$i_stdlib'
16238 i_string='$i_string'
16239 i_sunmath='$i_sunmath'
16240 i_sysaccess='$i_sysaccess'
16241 i_sysdir='$i_sysdir'
16242 i_sysfile='$i_sysfile'
16243 i_sysfilio='$i_sysfilio'
16245 i_sysioctl='$i_sysioctl'
16246 i_syslog='$i_syslog'
16247 i_sysmman='$i_sysmman'
16248 i_sysmode='$i_sysmode'
16249 i_sysmount='$i_sysmount'
16250 i_sysndir='$i_sysndir'
16251 i_sysparam='$i_sysparam'
16252 i_sysresrc='$i_sysresrc'
16253 i_syssecrt='$i_syssecrt'
16254 i_sysselct='$i_sysselct'
16255 i_syssockio='$i_syssockio'
16256 i_sysstat='$i_sysstat'
16257 i_sysstatfs='$i_sysstatfs'
16258 i_sysstatvfs='$i_sysstatvfs'
16259 i_systime='$i_systime'
16260 i_systimek='$i_systimek'
16261 i_systimes='$i_systimes'
16262 i_systypes='$i_systypes'
16263 i_sysuio='$i_sysuio'
16265 i_sysutsname='$i_sysutsname'
16266 i_sysvfs='$i_sysvfs'
16267 i_syswait='$i_syswait'
16268 i_termio='$i_termio'
16269 i_termios='$i_termios'
16271 i_unistd='$i_unistd'
16274 i_values='$i_values'
16275 i_varargs='$i_varargs'
16276 i_varhdr='$i_varhdr'
16278 ignore_versioned_solibs='$ignore_versioned_solibs'
16279 inc_version_list='$inc_version_list'
16280 inc_version_list_init='$inc_version_list_init'
16283 installarchlib='$installarchlib'
16284 installbin='$installbin'
16285 installman1dir='$installman1dir'
16286 installman3dir='$installman3dir'
16287 installprefix='$installprefix'
16288 installprefixexp='$installprefixexp'
16289 installprivlib='$installprivlib'
16290 installscript='$installscript'
16291 installsitearch='$installsitearch'
16292 installsitebin='$installsitebin'
16293 installsitelib='$installsitelib'
16294 installstyle='$installstyle'
16295 installusrbinperl='$installusrbinperl'
16296 installvendorarch='$installvendorarch'
16297 installvendorbin='$installvendorbin'
16298 installvendorlib='$installvendorlib'
16300 issymlink='$issymlink'
16301 ivdformat='$ivdformat'
16304 known_extensions='$known_extensions'
16307 lddlflags='$lddlflags'
16309 ldflags_uselargefiles='$ldflags_uselargefiles'
16310 ldlibpthname='$ldlibpthname'
16317 libsdirs='$libsdirs'
16318 libsfiles='$libsfiles'
16319 libsfound='$libsfound'
16320 libspath='$libspath'
16321 libswanted='$libswanted'
16322 libswanted_uselargefiles='$libswanted_uselargefiles'
16328 locincpth='$locincpth'
16329 loclibpth='$loclibpth'
16330 longdblsize='$longdblsize'
16331 longlongsize='$longlongsize'
16332 longsize='$longsize'
16336 lseeksize='$lseeksize'
16337 lseektype='$lseektype'
16341 make_set_make='$make_set_make'
16342 mallocobj='$mallocobj'
16343 mallocsrc='$mallocsrc'
16344 malloctype='$malloctype'
16346 man1direxp='$man1direxp'
16349 man3direxp='$man3direxp'
16351 mips_type='$mips_type'
16353 mmaptype='$mmaptype'
16354 modetype='$modetype'
16356 multiarch='$multiarch'
16358 myarchname='$myarchname'
16359 mydomain='$mydomain'
16360 myhostname='$myhostname'
16363 need_va_copy='$need_va_copy'
16364 netdb_hlen_type='$netdb_hlen_type'
16365 netdb_host_type='$netdb_host_type'
16366 netdb_name_type='$netdb_name_type'
16367 netdb_net_type='$netdb_net_type'
16370 nm_so_opt='$nm_so_opt'
16371 nonxs_ext='$nonxs_ext'
16373 nvEUformat='$nvEUformat'
16374 nvFUformat='$nvFUformat'
16375 nvGUformat='$nvGUformat'
16376 nveformat='$nveformat'
16377 nvfformat='$nvfformat'
16378 nvgformat='$nvgformat'
16381 o_nonblock='$o_nonblock'
16383 old_pthread_create_joinable='$old_pthread_create_joinable'
16384 optimize='$optimize'
16385 orderlib='$orderlib'
16388 otherlibdirs='$otherlibdirs'
16392 patchlevel='$patchlevel'
16393 path_sep='$path_sep'
16396 perladmin='$perladmin'
16397 perllibs='$perllibs'
16398 perlpath='$perlpath'
16400 phostname='$phostname'
16403 pm_apiversion='$pm_apiversion'
16407 prefixexp='$prefixexp'
16409 privlibexp='$privlibexp'
16410 prototype='$prototype'
16412 quadkind='$quadkind'
16413 quadtype='$quadtype'
16414 randbits='$randbits'
16415 randfunc='$randfunc'
16416 randseedtype='$randseedtype'
16418 rd_nodata='$rd_nodata'
16419 revision='$revision'
16423 sPRIEUldbl='$sPRIEUldbl'
16424 sPRIFUldbl='$sPRIFUldbl'
16425 sPRIGUldbl='$sPRIGUldbl'
16426 sPRIXU64='$sPRIXU64'
16428 sPRIeldbl='$sPRIeldbl'
16429 sPRIfldbl='$sPRIfldbl'
16430 sPRIgldbl='$sPRIgldbl'
16435 sSCNfldbl='$sSCNfldbl'
16436 sched_yield='$sched_yield'
16437 scriptdir='$scriptdir'
16438 scriptdirexp='$scriptdirexp'
16440 seedfunc='$seedfunc'
16441 selectminbits='$selectminbits'
16442 selecttype='$selecttype'
16443 sendmail='$sendmail'
16446 sharpbang='$sharpbang'
16447 shmattype='$shmattype'
16448 shortsize='$shortsize'
16451 sig_count='$sig_count'
16452 sig_name='$sig_name'
16453 sig_name_init='$sig_name_init'
16455 sig_num_init='$sig_num_init'
16456 signal_t='$signal_t'
16457 sitearch='$sitearch'
16458 sitearchexp='$sitearchexp'
16460 sitebinexp='$sitebinexp'
16462 sitelib_stem='$sitelib_stem'
16463 sitelibexp='$sitelibexp'
16464 siteprefix='$siteprefix'
16465 siteprefixexp='$siteprefixexp'
16466 sizesize='$sizesize'
16467 sizetype='$sizetype'
16471 sockethdr='$sockethdr'
16472 socketlib='$socketlib'
16473 socksizetype='$socksizetype'
16475 spackage='$spackage'
16476 spitshell='$spitshell'
16478 ssizetype='$ssizetype'
16479 startperl='$startperl'
16481 static_ext='$static_ext'
16483 stdio_base='$stdio_base'
16484 stdio_bufsiz='$stdio_bufsiz'
16485 stdio_cnt='$stdio_cnt'
16486 stdio_filbuf='$stdio_filbuf'
16487 stdio_ptr='$stdio_ptr'
16488 stdio_stream_array='$stdio_stream_array'
16491 subversion='$subversion'
16498 timeincl='$timeincl'
16499 timetype='$timetype'
16512 uidformat='$uidformat'
16518 uquadtype='$uquadtype'
16519 use5005threads='$use5005threads'
16520 use64bitall='$use64bitall'
16521 use64bitint='$use64bitint'
16523 useithreads='$useithreads'
16524 uselargefiles='$uselargefiles'
16525 uselongdouble='$uselongdouble'
16526 usemorebits='$usemorebits'
16527 usemultiplicity='$usemultiplicity'
16528 usemymalloc='$usemymalloc'
16530 useopcode='$useopcode'
16531 useperlio='$useperlio'
16532 useposix='$useposix'
16534 useshrplib='$useshrplib'
16535 usesocks='$usesocks'
16536 usethreads='$usethreads'
16537 usevendorprefix='$usevendorprefix'
16538 usevfork='$usevfork'
16541 uvXUformat='$uvXUformat'
16542 uvoformat='$uvoformat'
16545 uvuformat='$uvuformat'
16546 uvxformat='$uvxformat'
16547 vendorarch='$vendorarch'
16548 vendorarchexp='$vendorarchexp'
16549 vendorbin='$vendorbin'
16550 vendorbinexp='$vendorbinexp'
16551 vendorlib='$vendorlib'
16552 vendorlib_stem='$vendorlib_stem'
16553 vendorlibexp='$vendorlibexp'
16554 vendorprefix='$vendorprefix'
16555 vendorprefixexp='$vendorprefixexp'
16557 versiononly='$versiononly'
16559 voidflags='$voidflags'
16561 xs_apiversion='$xs_apiversion'
16566 : Add in command line options if available
16567 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
16569 : add special variables
16570 $test -f $src/patchlevel.h && \
16571 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
16572 echo "CONFIGDOTSH=true" >>config.sh
16574 : propagate old symbols
16575 if $test -f UU/config.sh; then
16576 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
16577 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
16578 $sort | $uniq -u >UU/oldsyms
16579 set X `cat UU/oldsyms`
16585 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
16587 echo "# Variables propagated from previous config.sh file." >>config.sh
16588 for sym in `cat UU/oldsyms`; do
16589 echo " Propagating $hint variable "'$'"$sym..."
16590 eval 'tmp="$'"${sym}"'"'
16592 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
16598 : Finish up by extracting the .SH files
16612 If you'd like to make any changes to the config.sh file before I begin
16613 to configure things, do it as a shell escape now (e.g. !vi config.sh).
16616 rp="Press return or use a shell escape to edit config.sh:"
16621 *) : in case they cannot read
16622 sh 1>&4 -c "$ans";;
16627 : if this fails, just run all the .SH files by hand
16634 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
16641 Now you need to generate make dependencies by running "$make depend".
16642 You might prefer to run it in background: "$make depend > makedepend.out &"
16643 It can take a while, so you might not want to run it right now.
16648 rp="Run $make depend now?"
16652 $make depend && echo "Now you must run '$make'."
16655 echo "You must run '$make depend' then '$make'."
16658 elif test -f [Mm]akefile; then
16660 echo "Now you must run a $make."
16665 if $test -f Policy.sh; then
16668 If you compile $package on a different machine or from a different object
16669 directory, copy the Policy.sh file from this object directory to the
16670 new one before you run Configure -- this will help you with most of
16671 the policy defaults.
16675 if $test -f config.msg; then
16676 echo "Hmm. I also noted the following information while running:"
16678 $cat config.msg >&4
16681 $rm -f kit*isdone ark*isdone