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 Sat Feb 3 18:24:21 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=''
545 d_stdio_ptr_lval_nochange_cnt=''
546 d_stdio_ptr_lval_sets_cnt=''
718 inc_version_list_init=''
737 ignore_versioned_solibs=''
796 d_perl_otherlibdirs=''
813 d_nv_preserves_uv_bits=''
912 d_stdio_stream_array=''
913 stdio_stream_array=''
923 ccflags_uselargefiles=''
924 ldflags_uselargefiles=''
925 libswanted_uselargefiles=''
968 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
971 : We must find out about Eunice early
973 if test -f /etc/unixtovms; then
974 eunicefix=/etc/unixtovms
976 if test -f /etc/unixtovms.exe; then
977 eunicefix=/etc/unixtovms.exe
984 : set useposix=false in your hint file to disable the POSIX extension.
986 : set useopcode=false in your hint file to disable the Opcode extension.
988 : Trailing extension. Override this in a hint file, if needed.
990 : Extra object files, if any, needed on this platform.
993 : Possible local include directories to search.
994 : Set locincpth to "" in a hint file to defeat local include searches.
995 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
996 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
998 : no include file wanted by default
1002 : change the next line if compiling for Xenix/286 on Xenix/386
1003 xlibpth='/usr/lib/386 /lib/386'
1004 : Possible local library directories to search.
1005 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1006 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1008 : general looking path for locating libraries
1009 glibpth="/lib /usr/lib $xlibpth"
1010 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1011 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1012 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1014 : Private path used by Configure to find libraries. Its value
1015 : is prepended to libpth. This variable takes care of special
1016 : machines, like the mips. Usually, it should be empty.
1019 : default library list
1021 : some systems want to use only the non-versioned libso:s
1022 ignore_versioned_solibs=''
1024 ccflags_uselargefiles=''
1025 ldflags_uselargefiles=''
1026 libswanted_uselargefiles=''
1027 : set usemultiplicity on the Configure command line to enable multiplicity.
1028 : set usesocks on the Configure command line to enable socks.
1029 : set usethreads on the Configure command line to enable threads.
1030 : full support for void wanted by default
1033 : List of libraries we want.
1034 : If anyone needs -lnet, put it in a hint file.
1035 libswanted='sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl'
1036 libswanted="$libswanted dld ld sun m c cposix posix"
1037 libswanted="$libswanted ndir dir crypt sec"
1038 libswanted="$libswanted ucb bsd BSD PW x iconv util"
1039 : We probably want to search /usr/shlib before most other libraries.
1040 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1041 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1042 glibpth="/usr/shlib $glibpth"
1043 : Do not use vfork unless overridden by a hint file.
1046 : Find the basic shell for Bourne shell scripts
1050 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1053 if test -f "$xxx"; then
1056 : Build up a list and do a single loop so we can 'break' out.
1057 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1058 for xxx in sh bash ksh pdksh ash; do
1060 try="$try ${p}/${xxx}"
1064 if test -f "$xxx"; then
1067 elif test -f "$xxx.exe"; then
1078 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1080 Usually it's in /bin/sh. How did you even get this far?
1081 Please contact me (Perl Maintainers) at perlbug@perl.org and
1082 we'll try to straighten this all out.
1088 : see if sh knows # comments
1089 if `$sh -c '#' >/dev/null 2>&1`; then
1093 test -f $xcat || xcat=/usr/bin/cat
1098 if test -s today; then
1101 echo "#! $xcat" > try
1105 if test -s today; then
1113 echo "Your $sh doesn't grok # comments--I will strip them later on."
1116 echo "exec grep -v '^[ ]*#'" >spitshell
1118 $eunicefix spitshell
1119 spitshell=`pwd`/spitshell
1121 echo "I presume that if # doesn't work, #! won't work either!"
1126 : figure out how to guarantee sh startup
1128 '') startsh=${sharpbang}${sh} ;;
1140 : echo "Yup, it does."
1142 echo "Hmm... '$startsh' does not guarantee sh startup..."
1143 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1148 : Save command line options in file UU/cmdline.opt for later use in
1149 : generating config.sh.
1150 cat > cmdline.opt <<EOSH
1151 # Configure command line arguments.
1158 cat >>cmdline.opt <<EOSH
1159 config_arg$argn='$arg'
1161 argn=`expr $argn + 1`
1164 : produce awk script to parse command line options
1165 cat >options.awk <<'EOF'
1167 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1169 len = length(optstr);
1170 for (i = 1; i <= len; i++) {
1171 c = substr(optstr, i, 1);
1172 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1183 if (substr(str, 1, 1) != "-") {
1184 printf("'%s'\n", str);
1188 for (i = 2; i <= len; i++) {
1189 c = substr(str, i, 1);
1191 printf("-%s\n", substr(str, i));
1197 printf("'%s'\n", substr(str, i + 1));
1210 : process the command line options
1211 set X `for arg in "$@"; do echo "X$arg"; done |
1212 sed -e s/X// | awk -f options.awk`
1217 : set up default values
1227 rm -f optdef.sh posthint.sh
1228 cat >optdef.sh <<EOS
1234 while test $# -gt 0; do
1236 -d) shift; fastread=yes;;
1237 -e) shift; alldone=cont;;
1241 if test -r "$1"; then
1244 echo "$me: cannot read config file $1." >&2
1249 -h) shift; error=true;;
1250 -r) shift; reuseval=true;;
1251 -s) shift; silent=true; realsilent=true;;
1252 -E) shift; alldone=exit;;
1253 -K) shift; knowitall=true;;
1254 -O) shift; override=true;;
1255 -S) shift; silent=true; extractsh=true;;
1260 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1261 echo "$me: ignoring -D $1" >&2
1264 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1265 *) echo "$1='define'" >> optdef.sh;;
1272 *=) echo "$1" >> optdef.sh;;
1274 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1275 echo "$me: ignoring -U $1" >&2
1277 *) echo "$1='undef'" >> optdef.sh;;
1288 *=*) zzz=`echo $yyy|sed 's!=.*!!'`
1292 zzz=" "`echo $yyy|sed 's!^[^=]*=!!'`
1293 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1299 *:*) xxx=`echo $yyy|sed 's!:.*!!'`
1300 yyy=`echo $yyy|sed 's!^[^:]*:!!'`
1301 zzz=`echo $yyy|sed 's!^[^=]*=!!'`
1302 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1303 *) xxx=`echo $yyy|sed 's!:.*!!'`
1304 yyy=`echo $yyy|sed 's!^[^:]*:!!'` ;;
1310 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1312 echo "$yyy=''" >> posthint.sh ;;
1317 echo "$yyy='$zzz'" >> posthint.sh ;;
1319 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1321 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1326 echo "$yyy=$zzz" >> posthint.sh ;;
1327 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1331 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1334 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1342 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1343 [-U symbol] [-U symbol=] [-A command:symbol...]
1344 -d : use defaults for all answers.
1345 -e : go on without questioning past the production of config.sh.
1346 -f : specify an alternate default configuration file.
1347 -h : print this help message and exit (with an error status).
1348 -r : reuse C symbols value if possible (skips costly nm extraction).
1349 -s : silent mode, only echoes questions and essential information.
1350 -D : define symbol to have some value:
1351 -D symbol symbol gets the value 'define'
1352 -D symbol=value symbol gets the value 'value'
1353 -E : stop at the end of questions, after having produced config.sh.
1354 -K : do not use unless you know what you are doing.
1355 -O : let -D and -U override definitions from loaded configuration file.
1356 -S : perform variable substitutions on all .SH files (can mix with -f)
1357 -U : undefine symbol:
1358 -U symbol symbol gets the value 'undef'
1359 -U symbol= symbol gets completely empty
1360 -A : manipulate symbol after the platform specific hints have been applied:
1361 -A symbol=value append " "value to symbol
1362 -A append:symbol=value append value to symbol
1363 -A define:symbol=value define symbol to have value
1364 -A clear:symbol define symbol to be ''
1365 -A define:symbol define symbol to be 'define'
1366 -A eval:symbol=value define symbol to be eval of value
1367 -A prepend:symbol=value prepend value to symbol
1368 -A undef:symbol define symbol to be 'undef'
1369 -A undef:symbol= define symbol to be ''
1370 -V : print version number and exit (with a zero status).
1377 case "$fastread$alldone" in
1380 case "$extractsh" in
1383 if test ! -t 0; then
1384 echo "Say 'sh Configure', not 'sh <Configure'"
1394 true) exec 1>/dev/null;;
1397 : run the defines and the undefines, if any, but leave the file out there...
1400 : create the posthint manipulation script and leave the file out there...
1405 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1406 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1407 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1408 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1409 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1412 : Some greps do not return status, grrr.
1413 echo "grimblepritz" >grimble
1414 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1416 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1422 : the following should work in any shell
1426 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1427 cat >contains <<'EOSS'
1428 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1433 : Find the path to the source tree
1436 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1440 *) src=`cd ../$src && pwd` ;;
1453 if test -f $rsrc/Configure && \
1454 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1456 : found it, so we are ok.
1459 for src in . .. ../.. ../../.. ../../../..; do
1460 if test -f ../$src/Configure && \
1461 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1472 Sorry, I can't seem to locate the source dir for $package. Please start
1473 Configure with an explicit path -- i.e. /some/path/Configure.
1481 echo "Sources for $package found in \"$src\"." >&4
1485 : script used to extract .SH files with variable substitutions
1486 cat >extract <<'EOS'
1488 echo "Doing variable substitutions on .SH files..."
1489 if test -f $src/MANIFEST; then
1490 set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH$'`
1492 echo "(Looking for .SH files under the source directory.)"
1493 set x `(cd $src; find . -name "*.SH" -print)`
1497 0) set x `(cd $src; echo *.SH)`; shift;;
1499 if test ! -f $src/$1; then
1505 while test $name; do
1506 if test ! -d "$name"; then
1507 create="$name $create";
1508 name=`echo $name | sed -e "s|^[^/]*$||"`;
1509 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1514 for file in $create; do
1523 dir=`expr X$file : 'X\(.*\)/'`
1524 file=`expr X$file : 'X.*/\(.*\)'`
1525 (cd $dir && . ./$file)
1535 dir=`expr X$file : 'X\(.*\)/'`
1536 file=`expr X$file : 'X.*/\(.*\)'`
1537 (set x $dir; shift; eval $mkdir_p)
1547 if test -f $src/config_h.SH; then
1548 if test ! -f config.h; then
1549 : oops, they left it out of MANIFEST, probably, so do it anyway.
1555 : extract files and exit if asked to do so
1556 case "$extractsh" in
1558 case "$realsilent" in
1562 case "$config_sh" in
1563 '') config_sh='config.sh';;
1566 echo "Fetching answers from $config_sh..."
1569 test "$override" && . ./optdef.sh
1578 : Eunice requires " " instead of "", can you believe it
1581 echo "Beginning of configuration questions for $package."
1583 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1585 : first determine how to suppress newline on echo command
1587 echo "Checking echo to see how to suppress newlines..."
1588 (echo "hi there\c" ; echo " ") >.echotmp
1589 if $contains c .echotmp >/dev/null 2>&1 ; then
1600 echo $n "The star should be here-->$c"
1604 : Now test for existence of everything in MANIFEST
1606 if test -f $rsrc/MANIFEST; then
1607 echo "First let's make sure your kit is complete. Checking..." >&4
1608 awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
1611 for filelist in x??; do
1612 (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
1614 if test -s missing; then
1618 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1620 You have the option of continuing the configuration process, despite the
1621 distinct possibility that your kit is damaged, by typing 'y'es. If you
1622 do, don't blame me if something goes wrong. I advise you to type 'n'o
1623 and contact the author (perlbug@perl.org).
1626 echo $n "Continue? [n] $c" >&4
1630 echo "Continuing..." >&4
1634 echo "ABORTING..." >&4
1639 echo "Looks good..."
1642 echo "There is no MANIFEST file. I hope your kit is complete !"
1647 : Find the appropriate value for a newline for tr
1648 if test -n "$DJGPP"; then
1651 if test X"$trnl" = X; then
1652 case "`echo foo|tr '\n' x 2>/dev/null`" in
1656 if test X"$trnl" = X; then
1657 case "`echo foo|tr '\012' x 2>/dev/null`" in
1658 foox) trnl='\012' ;;
1661 if test X"$trnl" = X; then
1664 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1670 : compute the number of columns on the terminal for proper question formatting
1675 : set up the echo used in my read
1676 myecho="case \"\$xxxm\" in
1677 '') echo $n \"\$rp $c\" >&4;;
1679 '') echo $n \"[\$xxxm] $c\";;
1681 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1683 echo $n \"[\$xxxm] $c\" >&4
1685 echo $n \"\$rp [\$xxxm] $c\" >&4
1691 : now set up to do reads with possible shell escape and default assignment
1697 case "\$fastread" in
1698 yes) case "\$dflt" in
1701 case "\$silent-\$rp" in
1706 *) case "\$silent" in
1707 true) case "\$rp" in
1712 while expr "X\$ans" : "X!" >/dev/null; do
1716 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1724 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1733 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1738 echo "(OK, I'll run with -d after this question.)" >&4
1741 echo "*** Sorry, \$1 not supported yet." >&4
1751 echo "*** Substitution done -- please confirm."
1753 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1758 echo "*** Error -- try again."
1765 case "\$ans\$xxxm\$nostick" in
1777 : create .config dir to save info across Configure sessions
1778 test -d ../.config || mkdir ../.config
1779 cat >../.config/README <<EOF
1780 This directory created by Configure to save information that should
1781 persist across sessions for $package.
1783 You may safely delete it if you wish.
1786 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
1788 $define|true|[yY]*) ;;
1789 *) case "$xversion" in
1792 *** WHOA THERE!!! ***
1794 This is an UNSTABLE DEVELOPMENT release.
1795 The version of this $package distribution is $xversion, that is, odd,
1796 (as opposed to even) and that signifies a development release.
1797 If you want a maintenance release, you want an even-numbered version.
1799 Do ***NOT*** install this into production use.
1800 Data corruption and crashes are possible.
1802 It is most seriously suggested that you do not continue any further
1803 unless you want to help in developing and debugging Perl.
1806 rp='Do you really want to continue?'
1810 [yY]) echo >&4 "Okay, continuing."
1811 usedevel="$define" ;;
1812 *) echo >&4 "Okay, bye."
1822 case "$versiononly" in
1823 '') versiononly="$define" ;;
1825 case "$installusrbinperl" in
1826 '') installusrbinperl="$undef" ;;
1831 : general instructions
1834 user=`(logname) 2>/dev/null`
1836 '') user=`whoami 2>&1`;;
1838 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1841 rp='Would you like to see the instructions?'
1852 This installation shell script will examine your system and ask you questions
1853 to determine how the perl5 package should be installed. If you get
1854 stuck on a question, you may use a ! shell escape to start a subshell or
1855 execute a command. Many of the questions will have default answers in square
1856 brackets; typing carriage return will give you the default.
1858 On some of the questions which ask for file or directory names you are allowed
1859 to use the ~name construct to specify the login directory belonging to "name",
1860 even if you don't have a shell which knows about that. Questions where this is
1861 allowed will be marked "(~name ok)".
1865 dflt='Type carriage return to continue'
1869 The prompter used in this script allows you to use shell variables and
1870 backticks in your answers. You may use $1, $2, etc... to refer to the words
1871 in the default answer, as if the default line was a set of arguments given to a
1872 script shell. This means you may also use $* to repeat the whole default line,
1873 so you do not have to re-type everything to add something to the default.
1875 Everytime there is a substitution, you will have to confirm. If there is an
1876 error (e.g. an unmatched backtick), the default answer will remain unchanged
1877 and you will be prompted again.
1879 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1880 the questions and use the computed defaults (or the previous answers if there
1881 was already a config.sh file). Type 'Configure -h' for a list of options.
1882 You may also start interactively and then answer '& -d' at any prompt to turn
1883 on the non-interactive behaviour for the remainder of the execution.
1889 Much effort has been expended to ensure that this shell script will run on any
1890 Unix system. If despite that it blows up on yours, your best bet is to edit
1891 Configure and run it again. If you can't run Configure for some reason,
1892 you'll have to generate a config.sh file by hand. Whatever problems you
1893 have, let me (perlbug@perl.org) know how I blew it.
1895 This installation script affects things in two ways:
1897 1) it may do direct variable substitutions on some of the files included
1899 2) it builds a config.h file for inclusion in C programs. You may edit
1900 any of these files as the need arises after running this script.
1902 If you make a mistake on a question, there is no easy way to back up to it
1903 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1904 files. Configure will offer to let you do this before it runs the SH files.
1907 dflt='Type carriage return to continue'
1909 case "$firsttime" in
1910 true) echo $user >>../.config/instruct;;
1914 : find out where common programs are
1916 echo "Locating common programs..." >&4
1929 if test -d \$dir/\$thing; then
1935 for thisthing in \$dir/\$thing; do
1936 : just loop through to pick last item
1938 if test -f \$thisthing; then
1941 elif test -f \$dir/\$thing.exe; then
1942 if test -n "$DJGPP"; then
1943 echo \$dir/\$thing.exe
1945 : on Eunice apparently
1995 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1996 pth="$pth /lib /usr/lib"
1997 for file in $loclist; do
2001 if test -f "$xxx"; then
2004 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2005 xxx=`./loc $file $file $pth`
2008 '') xxx=`./loc $file $file $pth`;;
2009 *) xxx=`./loc $xxx $xxx $pth`;;
2015 echo $file is in $xxx.
2018 echo $file is in $xxx.
2021 echo "I don't know where '$file' is, and my life depends on it." >&4
2022 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2028 echo "Don't worry if any of the following aren't found..."
2030 for file in $trylist; do
2034 if test -f "$xxx"; then
2037 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2038 xxx=`./loc $file $file $pth`
2041 '') xxx=`./loc $file $file $pth`;;
2042 *) xxx=`./loc $xxx $xxx $pth`;;
2048 echo $file is in $xxx.
2051 echo $file is in $xxx.
2054 echo "I don't see $file out there, $say."
2061 echo "Substituting grep for egrep."
2067 echo "Substituting cp for ln."
2073 echo "Hopefully test is built into your sh."
2076 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2077 echo "Using the test built into your sh."
2085 echo "Hopefully echo is built into your sh."
2090 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2091 $echo $n "hi there$c" >foo1
2092 echo $n "hi there$c" >foo2
2093 if cmp foo1 foo2 >/dev/null 2>&1; then
2094 echo "They are compatible. In fact, they may be identical."
2101 They are not compatible! You are probably running ksh on a non-USG system.
2102 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2103 have echo built in and we may have to run some Bourne shell scripts. That
2104 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2107 $echo $n "The star should be here-->$c"
2117 cat <<'EOSC' >>checkcc
2122 int main(int argc, char *argv[]) {
2126 if $cc -o try $ccflags try.c; then
2129 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2135 case "`$cc -v -c try.c 2>&1`" in
2138 if $test X"$trygcc" = Xyes; then
2139 if gcc -o try -c try.c; then
2141 echo "You seem to have a working gcc, though." >&4
2142 rp="Would you like to use it?"
2144 if $test -f myread; then
2147 if $test -f UU/myread; then
2150 echo "Cannot find myread, sorry. Aborting." >&2
2155 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no ;;
2159 if $test X"$despair" = Xyes; then
2161 You need to find a working C compiler.
2162 Either (purchase and) install the C compiler supplied by your OS vendor,
2163 or for a free C compiler try http://gcc.gnu.org/
2164 I cannot continue any further, aborting.
2174 : determine whether symbolic links are supported
2177 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2178 echo "Symbolic links are supported." >&4
2181 echo "Symbolic links are NOT supported." >&4
2186 : determine whether symbolic links are supported
2190 echo "Checking how to test for symbolic links..." >&4
2192 if $test "X$issymlink" = X; then
2193 sh -c "PATH= test -h sym" >/dev/null 2>&1
2194 if test $? = 0; then
2198 if $test "X$issymlink" = X; then
2199 if $test -h >/dev/null 2>&1; then
2200 issymlink="$test -h"
2201 echo "Your builtin 'test -h' may be broken, I'm using external '$test -h'." >&4
2204 if $test "X$issymlink" = X; then
2205 if $test -L sym 2>/dev/null; then
2206 issymlink="$test -L"
2209 if $test "X$issymlink" != X; then
2210 echo "You can test for symbolic links with '$issymlink'." >&4
2212 echo "I do not know how you can test for symbolic links." >&4
2216 *) echo "No symbolic links, so not testing for their testing..." >&4
2222 case "$mksymlinks" in
2225 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2228 *) case "$lns:$issymlink" in
2229 *"ln -s:"*"test -"?)
2230 echo "Creating the symbolic links..." >&4
2231 echo "(First creating the subdirectories...)" >&4
2233 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2235 test -z "$directory" && break
2239 if test ! -d t/base; then
2240 echo "Failed to create the subdirectories. Aborting." >&4
2243 echo "(Then creating the symlinks...)" >&4
2244 awk '{print $1}' $src/MANIFEST | while true; do
2246 test -z "$filename" && break
2247 if test -f $filename; then
2248 if $issymlink $filename; then
2252 if test -f $filename; then
2253 echo "$filename already exists, not symlinking."
2255 ln -s $src/$filename $filename
2259 if test ! -f t/base/commonsense.t; then
2260 echo "Failed to create the symlinks. Aborting." >&4
2265 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2273 : see whether [:lower:] and [:upper:] are supported character classes
2275 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2277 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2281 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
2282 # (0xc9 and 0xd1), therefore that is a nice testing point.
2283 if test "X$up" = X -o "X$low" = X; then
2284 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
2290 if test "X$up" = X -o "X$low" = X; then
2291 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
2297 if test "X$up" = X -o "X$low" = X; then
2298 case "`echo IJ | od -x 2>/dev/null`" in
2300 echo "Hey, this might be EBCDIC." >&4
2301 if test "X$up" = X -o "X$low" = X; then
2302 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2303 ij) up='[A-IJ-RS-Z]'
2308 if test "X$up" = X -o "X$low" = X; then
2309 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2319 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
2321 echo "Using $up and $low to convert case." >&4
2324 echo "I don't know how to translate letters from upper to lower case." >&4
2325 echo "Your tr is not acting any way I know of." >&4
2329 : set up the translation script tr, must be called with ./tr of course
2333 '[A-Z][a-z]') exec $tr '$up' '$low';;
2334 '[a-z][A-Z]') exec $tr '$low' '$up';;
2341 : Try to determine whether config.sh was made on this system
2342 case "$config_sh" in
2344 myuname=`$uname -a 2>/dev/null`
2345 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2346 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2347 # because the A-Z/a-z are not consecutive.
2348 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2349 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2350 newmyuname="$myuname"
2352 case "$knowitall" in
2354 if test -f ../config.sh; then
2355 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2356 eval "`grep myuname= ../config.sh`"
2358 if test "X$myuname" = "X$newmyuname"; then
2366 : Get old answers from old config file if Configure was run on the
2367 : same system, otherwise use the hints.
2370 if test -f config.sh; then
2372 rp="I see a config.sh file. Shall I use it to set the defaults?"
2375 n*|N*) echo "OK, I'll ignore it."
2376 mv config.sh config.sh.old
2377 myuname="$newmyuname"
2379 *) echo "Fetching default answers from your old config.sh file..." >&4
2387 : Older versions did not always set $sh. Catch re-use of such
2397 if test ! -f config.sh; then
2400 First time through, eh? I have some defaults handy for some systems
2401 that need some extra help getting the Configure answers right:
2404 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2406 : Half the following guesses are probably wrong... If you have better
2407 : tests or hints, please send them to perlbug@perl.org
2408 : The metaconfig authors would also appreciate a copy...
2409 $test -f /irix && osname=irix
2410 $test -f /xenix && osname=sco_xenix
2411 $test -f /dynix && osname=dynix
2412 $test -f /dnix && osname=dnix
2413 $test -f /lynx.os && osname=lynxos
2414 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2415 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
2416 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2417 $test -f /bin/mips && /bin/mips && osname=mips
2418 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
2419 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
2420 $test -d /usr/apollo/bin && osname=apollo
2421 $test -f /etc/saf/_sactab && osname=svr4
2422 $test -d /usr/include/minix && osname=minix
2423 if $test -d /MachTen -o -d /MachTen_Folder; then
2425 if $test -x /sbin/version; then
2426 osvers=`/sbin/version | $awk '{print $2}' |
2427 $sed -e 's/[A-Za-z]$//'`
2428 elif $test -x /usr/etc/version; then
2429 osvers=`/usr/etc/version | $awk '{print $2}' |
2430 $sed -e 's/[A-Za-z]$//'`
2436 $test -f /sys/posix.dll &&
2437 $test -f /usr/bin/what &&
2438 set X `/usr/bin/what /sys/posix.dll` &&
2439 $test "$3" = UWIN &&
2443 if $test -f $uname; then
2451 umips) osname=umips ;;
2454 [23]100) osname=mips ;;
2455 next*) osname=next ;;
2457 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
2458 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
2461 elif $test -f /etc/kconfig; then
2463 if test "$lns" = "$ln -s"; then
2465 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
2467 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
2474 if test -n "$DJGPP"; then
2483 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
2485 'not found') osvers="$4"."$3" ;;
2486 '<3240'|'<>3240') osvers=3.2.0 ;;
2487 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
2488 '=3250'|'>3250') osvers=3.2.5 ;;
2492 bsd386) osname=bsd386
2495 cygwin*) osname=cygwin
2498 *dc.osx) osname=dcosx
2504 domainos) osname=apollo
2510 dynixptx*) osname=dynixptx
2511 osvers=`echo "$4"|sed 's/^v//'`
2513 freebsd) osname=freebsd
2515 genix) osname=genix ;;
2517 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
2533 netbsd*) osname=netbsd
2536 news-os) osvers="$3"
2538 4*) osname=newsos4 ;;
2542 next*) osname=next ;;
2543 nonstop-ux) osname=nonstopux ;;
2544 POSIX-BC | posix-bc ) osname=posix-bc
2547 powerux | power_ux | powermax_os | powermaxos | \
2548 powerunix | power_unix) osname=powerux
2554 solaris) osname=solaris
2556 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2563 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2567 titanos) osname=titanos
2576 ultrix) osname=ultrix
2579 osf1|mls+) case "$5" in
2582 osvers=`sizer -v | awk '{print $3}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
2585 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
2588 hp*) osname=hp_osf1 ;;
2589 mips) osname=mips_osf1 ;;
2592 unixware) osname=svr5
2598 $2) case "$osname" in
2602 : svr4.x or possibly later
2612 if test -f /stand/boot ; then
2613 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
2614 if test -n "$INITPROG" -a -f "$INITPROG"; then
2615 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
2616 if test -n "$isesix"; then
2624 *) if test -f /etc/systemid; then
2626 set `echo $3 | $sed 's/\./ /g'` $4
2627 if $test -f $src/hints/sco_$1_$2_$3.sh; then
2629 elif $test -f $src/hints/sco_$1_$2.sh; then
2631 elif $test -f $src/hints/sco_$1.sh; then
2636 '') : Still unknown. Probably a generic Sys V.
2645 *) case "$osname" in
2646 '') : Still unknown. Probably a generic BSD.
2654 if test -f /vmunix -a -f $src/hints/news_os.sh; then
2655 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
2656 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
2659 $rm -f UU/kernel.what
2660 elif test -d c:/.; then
2667 : Now look for a hint file osname_osvers, unless one has been
2668 : specified already.
2671 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
2672 : Also try without trailing minor version numbers.
2673 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
2674 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
2675 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
2676 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
2679 *) case "$osvers" in
2682 *) if $test -f $src/hints/$file.sh ; then
2684 elif $test -f $src/hints/$xfile.sh ; then
2686 elif $test -f $src/hints/$xxfile.sh ; then
2688 elif $test -f $src/hints/$xxxfile.sh ; then
2690 elif $test -f $src/hints/$xxxxfile.sh ; then
2692 elif $test -f "$src/hints/${osname}.sh" ; then
2701 if $test -f Policy.sh ; then
2704 none) dflt="Policy" ;;
2705 *) dflt="Policy $dflt" ;;
2710 dflt=`echo $hintfile | $sed 's/\.sh$//'`
2714 if $test -f Policy.sh ; then
2717 There's also a Policy hint file available, which should make the
2718 site-specific (policy) questions easier to answer.
2725 You may give one or more space-separated answers, or "none" if appropriate.
2726 A well-behaved OS will have no hints, so answering "none" or just "Policy"
2727 is a good thing. DO NOT give a wrong version or a wrong OS.
2731 rp="Which of these apply, if any?"
2734 for file in $tans; do
2735 if $test X$file = XPolicy -a -f Policy.sh; then
2737 $cat Policy.sh >> UU/config.sh
2738 elif $test -f $src/hints/$file.sh; then
2739 . $src/hints/$file.sh
2740 $cat $src/hints/$file.sh >> UU/config.sh
2741 elif $test X$tans = X -o X$tans = Xnone ; then
2744 : Give one chance to correct a possible typo.
2745 echo "$file.sh does not exist"
2747 rp="hint to use instead?"
2749 for file in $ans; do
2750 if $test -f "$src/hints/$file.sh"; then
2751 . $src/hints/$file.sh
2752 $cat $src/hints/$file.sh >> UU/config.sh
2753 elif $test X$ans = X -o X$ans = Xnone ; then
2756 echo "$file.sh does not exist -- ignored."
2763 : Remember our hint file for later.
2764 if $test -f "$src/hints/$file.sh" ; then
2774 echo "Fetching default answers from $config_sh..." >&4
2778 cp $config_sh config.sh 2>/dev/null
2788 test "$override" && . ./optdef.sh
2790 : Restore computed paths
2791 for file in $loclist $trylist; do
2792 eval $file="\$_$file"
2797 Configure uses the operating system name and version to set some defaults.
2798 The default value is probably right if the name rings a bell. Otherwise,
2799 since spelling matters for me, either accept the default or answer "none"
2806 ''|' '|none) dflt=none ;;
2807 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
2810 *) dflt="$osname" ;;
2812 rp="Operating system name?"
2816 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
2822 ''|' '|none) dflt=none ;;
2823 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
2824 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
2826 ''|' ') dflt=none ;;
2831 *) dflt="$osvers" ;;
2833 rp="Operating system version?"
2843 : who configured the system
2844 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
2845 cf_by=`(logname) 2>/dev/null`
2848 cf_by=`(whoami) 2>/dev/null`
2850 "") cf_by=unknown ;;
2854 : set up the script used to warn in case of inconsistency
2861 echo "*** WHOA THERE!!! ***" >&4
2862 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2863 rp=" Keep the $hint value?"
2866 y) td=$was; tu=$was;;
2870 : function used to set $1 to $val
2871 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2873 $define$undef) . ./whoa; eval "$var=\$td";;
2874 $undef$define) . ./whoa; eval "$var=\$tu";;
2875 *) eval "$var=$val";;
2878 case "$usethreads" in
2879 $define|true|[yY]*) dflt='y';;
2884 Perl can be built to take advantage of threads on some systems.
2885 To do so, Configure can be run with -Dusethreads.
2887 Note that threading is a highly experimental feature, and
2888 some known race conditions still remain. If you choose to try
2889 it, be very sure to not actually deploy it for production
2890 purposes. README.threads has more details, and is required
2891 reading if you enable threads.
2893 If this doesn't make any sense to you, just accept the default '$dflt'.
2895 rp='Build a threading Perl?'
2898 y|Y) val="$define" ;;
2904 case "$usethreads" in
2908 As of 5.5.640, Perl has two different internal threading implementations,
2909 the 5.005 version (5005threads) and an interpreter-based version
2910 (ithreads) that has one interpreter per thread. Both are very
2911 experimental. This arrangement exists to help developers work out
2912 which one is better.
2914 If you're a casual user, you probably don't want interpreter-threads
2915 at this time. There doesn't yet exist a way to create threads from
2916 within Perl in this model, i.e., "use Thread;" will NOT work.
2918 : Default to ithreads unless overridden on command line or with
2921 case "$use5005threads" in
2922 $define|true|[yY]*) dflt='n';;
2924 case "$useithreads" in
2925 $undef|false|[nN]*) dflt='n';;
2927 rp='Use interpreter-based ithreads?'
2930 y|Y) val="$define" ;;
2935 : Now set use5005threads to the opposite value.
2936 case "$useithreads" in
2937 $define) val="$undef" ;;
2944 useithreads="$undef"
2945 use5005threads="$undef"
2949 case "$useithreads$use5005threads" in
2953 You cannot have both the ithreads and the 5.005 threads enabled
2954 at the same time. Disabling the 5.005 threads since they are
2955 much less stable than the ithreads.
2958 use5005threads="$undef"
2962 case "$d_oldpthreads" in
2963 '') : Configure tests would be welcome here. For now, assume undef.
2965 *) val="$d_oldpthreads" ;;
2971 case "$usethreads" in
2972 "$define"|true|[yY]*)
2973 : Look for a hint-file generated 'call-back-unit'. If the
2974 : user has specified that a threading perl is to be built,
2975 : we may need to set or change some other defaults.
2976 if $test -f usethreads.cbu; then
2977 echo "Your platform has some specific hints for threaded builds, using them..."
2981 (Your platform doesn't have any specific hints for threaded builds.
2982 Assuming POSIX threads, then.)
2990 Perl can be built so that multiple Perl interpreters can coexist
2991 within the same Perl executable.
2994 case "$useithreads" in
2997 This multiple interpreter support is required for interpreter-based threads.
3001 *) case "$usemultiplicity" in
3002 $define|true|[yY]*) dflt='y';;
3006 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
3007 rp='Build Perl for multiplicity?'
3010 y|Y) val="$define" ;;
3018 : make some quick guesses about what we are up against
3020 $echo $n "Hmm... $c"
3030 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
3031 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
3033 echo "Looks kind of like an OSF/1 system, but we'll see..."
3035 elif test `echo abc | $tr a-z A-Z` = Abc ; then
3036 xxx=`./loc addbib blurfl $pth`
3037 if $test -f $xxx; then
3038 echo "Looks kind of like a USG system with BSD features, but we'll see..."
3042 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
3043 echo "Looks kind of like an extended USG system, but we'll see..."
3045 echo "Looks kind of like a USG system, but we'll see..."
3049 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
3050 echo "Looks kind of like a BSD system, but we'll see..."
3054 echo "Looks kind of like a Version 7 system, but we'll see..."
3057 case "$eunicefix" in
3060 There is, however, a strange, musty smell in the air that reminds me of
3061 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
3065 : it so happens the Eunice I know will not run shell scripts in Unix format
3069 echo "Congratulations. You aren't running Eunice."
3073 : Detect OS2. The p_ variable is set above in the Head.U unit.
3074 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
3075 : semicolon as a patch separator
3080 I have the feeling something is not exactly right, however...don't tell me...
3081 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
3082 (Or you may be running DOS with DJGPP.)
3087 if test -f /xenix; then
3088 echo "Actually, this looks more like a XENIX system..."
3093 echo "It's not Xenix..."
3098 if test -f /venix; then
3099 echo "Actually, this looks more like a VENIX system..."
3106 echo "Nor is it Venix..."
3109 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3110 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3117 rp="Use which C compiler?"
3120 : Look for a hint-file generated 'call-back-unit'. Now that the
3121 : user has specified the compiler, we may need to set or change some
3123 if $test -f cc.cbu; then
3129 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3130 $cat >gccvers.c <<EOM
3135 printf("%s\n", __VERSION__);
3137 printf("%s\n", "1");
3143 if $cc -o gccvers $ldflags gccvers.c; then
3144 gccversion=`./gccvers`
3145 case "$gccversion" in
3146 '') echo "You are not using GNU cc." ;;
3147 *) echo "You are using GNU cc $gccversion."
3153 echo "*** WHOA THERE!!! ***" >&4
3154 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3155 case "$knowitall" in
3157 echo " You'd better start hunting for one and let me know about it." >&4
3163 case "$gccversion" in
3164 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3166 case "$gccversion" in
3167 '') gccosandvers='' ;;
3168 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
3169 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
3171 case "$gccosandvers" in
3172 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
3173 $osname$osvers) ;; # looking good
3174 $osname*) cat <<EOM >&4
3176 *** WHOA THERE!!! ***
3178 Your gcc has not been compiled for the exact release of
3179 your operating system ($gccosandvers versus $osname$osvers).
3181 In general it is a good idea to keep gcc synchronized with
3182 the operating system because otherwise serious problems
3183 may ensue when trying to compile software, like Perl.
3185 I'm trying to be optimistic here, though, and will continue.
3186 If later during the configuration and build icky compilation
3187 problems appear (headerfile conflicts being the most common
3188 manifestation), I suggest reinstalling the gcc to match
3189 your operating system release.
3193 *) gccosandvers='' ;; # failed to parse, better be silent
3201 : see how we invoke the C preprocessor
3203 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3204 cat <<'EOT' >testcpp.c
3210 if test ! -f cppstdin; then
3211 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
3212 # AIX cc -E doesn't show the absolute headerfile
3213 # locations but we'll cheat by using the -M flag.
3214 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
3216 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3219 echo "Keeping your $hint cppstdin wrapper."
3222 wrapper=`pwd`/cppstdin
3226 if $test "X$cppstdin" != "X" && \
3227 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3228 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3230 echo "You used to use $cppstdin $cppminus so we'll use that again."
3232 '') echo "But let's see if we can live without a wrapper..." ;;
3234 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3235 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3237 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3240 echo "(However, $cpprun $cpplast does not work, let's see...)"
3248 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3255 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3256 $cc -E <testcpp.c >testcpp.out 2>&1; \
3257 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3258 echo "Yup, it does."
3261 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
3262 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3263 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3264 echo "Yup, it does."
3267 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
3268 $cc -P <testcpp.c >testcpp.out 2>&1; \
3269 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3270 echo "Yipee, that works!"
3273 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
3274 $cc -P - <testcpp.c >testcpp.out 2>&1; \
3275 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3276 echo "At long last!"
3279 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
3280 $cpp <testcpp.c >testcpp.out 2>&1; \
3281 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3285 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
3286 $cpp - <testcpp.c >testcpp.out 2>&1; \
3287 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3288 echo "Hooray, it works! I was beginning to wonder."
3291 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
3292 $wrapper <testcpp.c >testcpp.out 2>&1; \
3293 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3299 rp="No dice. I can't find a C preprocessor. Name one:"
3303 $x_cpp <testcpp.c >testcpp.out 2>&1
3304 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3305 echo "OK, that will do." >&4
3307 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
3322 echo "Perhaps can we force $cc -E using a wrapper..."
3323 if $wrapper <testcpp.c >testcpp.out 2>&1; \
3324 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3330 echo "Nope, we'll have to live without it..."
3344 "$wrapper"|'cppstdin') ;;
3345 *) $rm -f $wrapper;;
3347 $rm -f testcpp.c testcpp.out
3349 : decide how portable to be. Allow command line overrides.
3350 case "$d_portable" in
3352 *) d_portable="$define" ;;
3355 : set up shell script to do ~ expansion
3361 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3364 if $test -f /bin/csh; then
3365 /bin/csh -f -c "glob \$1"
3370 name=\`$expr x\$1 : '..\([^/]*\)'\`
3371 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3372 if $test ! -d "\$dir"; then
3374 echo "\$me: can't locate home directory for: \$name" >&2
3379 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3395 : now set up to get a file name
3399 cat <<'EOSC' >>getfile
3415 expr $fn : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3416 fn=`echo $fn | sed 's/(.*)//'`
3422 loc_file=`expr $fn : '.*:\(.*\)'`
3423 fn=`expr $fn : '\(.*\):.*'`
3431 */*) fullpath=true;;
3440 *e*) exp_file=true;;
3443 *p*) nopath_ok=true;;
3448 *d*) type='Directory';;
3449 *l*) type='Locate';;
3454 Locate) what='File';;
3459 case "$d_portable" in
3467 while test "$type"; do
3472 true) rp="$rp (~name ok)";;
3475 if test -f UU/getfile.ok && \
3476 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3495 value=`UU/filexp $ans`
3498 if test "$ans" != "$value"; then
3499 echo "(That expands to $value on this system.)"
3513 /*) value="$ansexp" ;;
3514 [a-zA-Z]:/*) value="$ansexp" ;;
3519 echo "I shall only accept a full path name, as in /bin/ls." >&4
3520 echo "Use a ! shell escape if you wish to check pathnames." >&4
3523 echo "Please give a full path name, starting with slash." >&4
3526 echo "Note that using ~name is ok provided it expands well." >&4
3539 for fp in $gfpth; do
3540 if test "X$fp" = X.; then
3545 if test -f "$pf"; then
3547 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3549 echo "($value is not a plain file, but that's ok.)"
3552 if test X"$type" = X; then
3559 for fp in $gfpth; do
3560 if test "X$fp" = X.; then
3565 direxp="$fp/$ansexp"
3567 if test -d "$direxp"; then
3575 if test -d "$ansexp"; then
3576 echo "(Looking for $loc_file in directory $value.)"
3577 value="$value/$loc_file"
3578 ansexp="$ansexp/$loc_file"
3580 if test -f "$ansexp"; then
3583 case "$nopath_ok" in
3584 true) case "$value" in
3586 *) echo "Assuming $value will be in people's path."
3602 if test "$fastread" = yes; then
3607 rp="$what $value doesn't exist. Use that name anyway?"
3626 test "X$gfpthkeep" != Xy && gfpth=""
3629 : What should the include directory be ?
3631 $echo $n "Hmm... $c"
3635 if $test -f /bin/mips && /bin/mips; then
3636 echo "Looks like a MIPS system..."
3637 $cat >usr.c <<'EOCP'
3638 #ifdef SYSTYPE_BSD43
3642 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3643 dflt='/bsd43/usr/include'
3647 mips_type='System V'
3649 $rm -f usr.c usr.out
3650 echo "and you're compiling with the $mips_type compiler and libraries."
3654 echo "Doesn't look like a MIPS system."
3664 case "$xxx_prompt" in
3667 rp='Where are the include files you want to use?'
3675 : Set private lib path
3678 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
3683 '') dlist="$loclibpth $plibpth $glibpth";;
3684 *) dlist="$libpth";;
3687 : Now check and see which directories actually exist, avoiding duplicates
3691 if $test -d $xxx; then
3694 *) libpth="$libpth $xxx";;
3700 Some systems have incompatible or broken versions of libraries. Among
3701 the directories listed in the question below, please remove any you
3702 know not to be holding relevant libraries, and add any that are needed.
3703 Say "none" for none.
3714 rp="Directories to use for library searches?"
3721 : compute shared library extension
3724 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
3734 On some systems, shared libraries may be available. Answer 'none' if
3735 you want to suppress searching of shared libraries for the remainder
3736 of this configuration.
3739 rp='What is the file extension used for shared libraries?'
3743 : Define several unixisms.
3744 : Hints files or command line option can be used to override them.
3745 : The convoluted testing is in case hints files set either the old
3748 '') case "$exe_ext" in
3750 *) _exe="$exe_ext" ;;
3755 '') case "$lib_ext" in
3762 '') case "$obj_ext" in
3769 '') case "$path_sep" in
3780 : Which makefile gets called first. This is used by make depend.
3781 case "$firstmakefile" in
3782 '') firstmakefile='makefile';;
3786 $define|true|[yY]*) dflt='y';;
3791 Perl can be built to use the SOCKS proxy protocol library. To do so,
3792 Configure must be run with -Dusesocks. If you use SOCKS you also need
3793 to use the PerlIO abstraction layer, this will be implicitly selected.
3795 If this doesn't make any sense to you, just accept the default '$dflt'.
3797 rp='Build Perl for SOCKS?'
3800 y|Y) val="$define" ;;
3807 $define|true|[yY]*) useperlio="$define";;
3810 : Looking for optional libraries
3812 echo "Checking for optional libraries..." >&4
3817 case "$libswanted" in
3818 '') libswanted='c_s';;
3821 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
3827 for thisdir in $libpth $xlibpth; do
3828 test -d $thisdir && libspath="$libspath $thisdir"
3830 for thislib in $libswanted; do
3831 for thisdir in $libspath; do
3833 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
3834 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|tail -1`
3835 $test -f "$xxx" && eval $libscheck
3836 $test -f "$xxx" && libstyle=shared
3838 if test ! -f "$xxx"; then
3839 xxx=$thisdir/lib$thislib.$so
3840 $test -f "$xxx" && eval $libscheck
3841 $test -f "$xxx" && libstyle=shared
3843 if test ! -f "$xxx"; then
3844 xxx=$thisdir/lib$thislib$_a
3845 $test -f "$xxx" && eval $libscheck
3846 $test -f "$xxx" && libstyle=static
3848 if test ! -f "$xxx"; then
3849 xxx=$thisdir/$thislib$_a
3850 $test -f "$xxx" && eval $libscheck
3851 $test -f "$xxx" && libstyle=static
3853 if test ! -f "$xxx"; then
3854 xxx=$thisdir/lib${thislib}_s$_a
3855 $test -f "$xxx" && eval $libscheck
3856 $test -f "$xxx" && libstyle=static
3857 $test -f "$xxx" && thislib=${thislib}_s
3859 if test ! -f "$xxx"; then
3860 xxx=$thisdir/Slib$thislib$_a
3861 $test -f "$xxx" && eval $libscheck
3862 $test -f "$xxx" && libstyle=static
3864 if $test -f "$xxx"; then
3866 shared) echo "Found -l$thislib (shared)." ;;
3867 static) echo "Found -l$thislib." ;;
3868 *) echo "Found -l$thislib ($libstyle)." ;;
3872 *) dflt="$dflt -l$thislib"
3873 libsfound="$libsfound $xxx"
3875 libsfiles="$libsfiles $yyy"
3876 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
3877 case " $libsdirs " in
3879 *) libsdirs="$libsdirs $yyy" ;;
3886 if $test ! -f "$xxx"; then
3887 echo "No -l$thislib."
3898 ' '|'') dflt='none';;
3903 In order to compile $package on your machine, a number of libraries
3904 are usually needed. Include any other special libraries here as well.
3905 Say "none" for none. The default list is almost always right.
3909 rp="What libraries to use?"
3916 : determine optimization, if desired, or use for debug flag also
3918 ' '|$undef) dflt='none';;
3920 *) dflt="$optimize";;
3924 By default, $package compiles with the -O flag to use the optimizer.
3925 Alternately, you might want to use the symbolic debugger, which uses
3926 the -g flag (on traditional Unix systems). Either flag can be
3927 specified here. To use neither flag, specify the word "none".
3930 rp="What optimizer/debugger flag should be used?"
3934 'none') optimize=" ";;
3938 : We will not override a previous value, but we might want to
3939 : augment a hint file
3941 default|recommended)
3942 case "$gccversion" in
3943 1*) dflt='-fpcc-struct-return' ;;
3946 *-g*) dflt="$dflt -DDEBUGGING";;
3948 case "$gccversion" in
3949 2*) if test -d /etc/conf/kconfig.d &&
3950 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
3956 case "$gccversion" in
3960 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
3961 echo 'int main(void) { return 0; }' > gcctest.c
3962 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
3963 echo "Yes, it does." 2>&1
3966 echo "Leaving current flags $ccflags alone." 2>&1
3968 *) dflt="$dflt -fno-strict-aliasing" ;;
3971 echo "Nope, it doesn't, but that's ok." 2>&1
3978 case "$mips_type" in
3979 *BSD*|'') inclwanted="$locincpth $usrinc";;
3980 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
3982 for thisincl in $inclwanted; do
3983 if $test -d $thisincl; then
3984 if $test x$thisincl != x$usrinc; then
3986 *" -I$thisincl "*);;
3987 *) dflt="$dflt -I$thisincl ";;
3993 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
3995 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4003 *) dflt="$dflt -D$2";;
4007 set signal.h LANGUAGE_C; eval $inctest
4011 ccflags="$ccflags -DSOCKS"
4016 default|recommended) dflt="$ccflags $dflt" ;;
4017 *) dflt="$ccflags";;
4026 Your C compiler may want other flags. For this question you should include
4027 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4028 but you should NOT include libraries or ld flags like -lwhatever. If you
4029 want $package to honor its debug switch, you should include -DDEBUGGING here.
4030 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4032 To use no flags, specify the word "none".
4038 rp="Any additional cc flags?"
4045 : the following weeds options from ccflags that are of no interest to cpp
4047 case "$gccversion" in
4048 1*) cppflags="$cppflags -D__GNUC__"
4050 case "$mips_type" in
4052 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4058 echo "Let me guess what the preprocessor flags are..." >&4
4072 *) ftry="$previous $flag";;
4074 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4075 >cpp1.out 2>/dev/null && \
4076 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4077 >cpp2.out 2>/dev/null && \
4078 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4079 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4081 cppflags="$cppflags $ftry"
4091 *-*) echo "They appear to be: $cppflags";;
4093 $rm -f cpp.c cpp?.out
4097 : flags used in final linking phase
4099 '') if ./venix; then
4105 *-posix*) dflt="$dflt -posix" ;;
4108 *) dflt="$ldflags";;
4111 : Try to guess additional flags to pick up local libraries.
4112 for thislibdir in $libpth; do
4113 case " $loclibpth " in
4116 *"-L$thislibdir "*) ;;
4117 *) dflt="$dflt -L$thislibdir" ;;
4129 Your C linker may need flags. For this question you should
4130 include -L/whatever and any other flags used by the C linker, but you
4131 should NOT include libraries like -lwhatever.
4133 Make sure you include the appropriate -L/path flags if your C linker
4134 does not normally search all of the directories you specified above,
4137 To use no flags, specify the word "none".
4141 rp="Any additional ld flags (NOT including libraries)?"
4147 rmlist="$rmlist pdp11"
4151 echo "Checking your choice of C compiler and flags for coherency..." >&4
4152 $cat > try.c <<'EOF'
4154 int main() { printf("Ok\n"); exit(0); }
4156 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
4158 $cat >try.msg <<'EOM'
4159 I've tried to compile and run the following simple program:
4162 $cat try.c >> try.msg
4164 $cat >> try.msg <<EOM
4171 and I got the following output:
4175 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
4176 if $sh -c './try' >>try.msg 2>&1; then
4180 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4183 cat >> try.msg <<'EOQS'
4184 If $libs contains -lsfio, and sfio is mis-configured, then it
4185 sometimes (apparently) runs and exits with a 0 status, but with no
4186 output! It may have to do with sfio's use of _exit vs. exit.
4189 rp="You have a big problem. Shall I abort Configure"
4196 echo "The program compiled OK, but exited with status $?." >>try.msg
4197 rp="You have a problem. Shall I abort Configure"
4201 echo "I can't compile the test program." >>try.msg
4202 rp="You have a BIG problem. Shall I abort Configure"
4208 case "$knowitall" in
4210 echo "(The supplied flags or libraries might be incorrect.)"
4218 *) echo "Ok. Stopping Configure." >&4
4223 n) echo "OK, that should do.";;
4225 $rm -f try try.* core
4227 : define an is-a-typedef? function
4228 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
4230 "") inclist="sys/types.h";;
4232 eval "varval=\$$var";
4236 for inc in $inclist; do
4237 echo "#include <$inc>" >>temp.c;
4239 echo "#ifdef $type" >> temp.c;
4240 echo "printf(\"We have $type\");" >> temp.c;
4241 echo "#endif" >> temp.c;
4242 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
4243 if $contains $type temp.E >/dev/null 2>&1; then
4249 *) eval "$var=\$varval";;
4252 : define an is-a-typedef? function that prompts if the type is not available.
4253 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
4255 "") inclist="sys/types.h";;
4257 eval "varval=\$$var";
4261 for inc in $inclist; do
4262 echo "#include <$inc>" >>temp.c;
4264 echo "#ifdef $type" >> temp.c;
4265 echo "printf(\"We have $type\");" >> temp.c;
4266 echo "#endif" >> temp.c;
4267 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
4269 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
4270 if $contains $type temp.E >/dev/null 2>&1; then
4271 echo "$type found." >&4;
4274 echo "$type NOT found." >&4;
4280 *) eval "$var=\$varval";;
4283 : define a shorthand compile call
4287 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
4288 : define a shorthand compile call for compilations that should be ok.
4292 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
4294 : check for lengths of integral types
4298 echo "Checking to see how big your integers are..." >&4
4299 $cat >intsize.c <<'EOCP'
4303 printf("intsize=%d;\n", (int)sizeof(int));
4304 printf("longsize=%d;\n", (int)sizeof(long));
4305 printf("shortsize=%d;\n", (int)sizeof(short));
4310 if eval $compile_ok && ./intsize > /dev/null; then
4312 echo "Your integers are $intsize bytes long."
4313 echo "Your long integers are $longsize bytes long."
4314 echo "Your short integers are $shortsize bytes long."
4318 Help! I can't compile and run the intsize test program: please enlighten me!
4319 (This is probably a misconfiguration in your system or libraries, and
4320 you really ought to fix it. Still, I'll try anyway.)
4324 rp="What is the size of an integer (in bytes)?"
4328 rp="What is the size of a long integer (in bytes)?"
4332 rp="What is the size of a short integer (in bytes)?"
4338 $rm -f intsize intsize.*
4340 : see what type lseek is declared as in the kernel
4341 rp="What is the type used for lseek's offset on this system?"
4342 set off_t lseektype long stdio.h sys/types.h
4346 echo "Checking to see how big your file offsets are..." >&4
4348 #include <sys/types.h>
4352 printf("%d\n", (int)sizeof($lseektype));
4357 if eval $compile_ok; then
4359 echo "Your file offsets are $lseeksize bytes long."
4363 echo "(I can't seem to compile the test program. Guessing...)"
4364 rp="What is the size of your file offsets (in bytes)?"
4370 : see what type file positions are declared as in the library
4371 rp="What is the type for file position used by fsetpos()?"
4372 set fpos_t fpostype long stdio.h sys/types.h
4377 *_t) zzz="$fpostype" ;;
4380 echo "Checking the size of $zzz..." >&4
4382 #include <sys/types.h>
4385 printf("%d\n", (int)sizeof($fpostype));
4390 if eval $compile_ok; then
4394 echo "(I can't execute the test program--guessing $fpossize.)" >&4
4397 echo "Your $zzz is $fpossize bytes long."
4403 echo "(I can't compile the test program. Guessing...)" >&4
4404 rp="What is the size of your file positions (in bytes)?"
4411 # Backward compatibility (uselfs is deprecated).
4413 "$define"|true|[yY]*)
4416 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
4418 uselargefiles="$define"
4422 case "$lseeksize:$fpossize" in
4425 You can have files larger than 2 gigabytes.
4428 *) case "$uselargefiles" in
4429 "$undef"|false|[nN]*) dflt='n' ;;
4434 Perl can be built to understand large files (files larger than 2 gigabytes)
4435 on some systems. To do so, Configure can be run with -Duselargefiles.
4437 If this doesn't make any sense to you, just accept the default '$dflt'.
4439 rp='Try to understand large files, if available?'
4442 y|Y) val="$define" ;;
4449 case "$uselargefiles" in
4451 : Look for a hint-file generated 'call-back-unit'. If the
4452 : user has specified that a large files perl is to be built,
4453 : we may need to set or change some other defaults.
4454 if $test -f uselargefiles.cbu; then
4455 echo "Your platform has some specific hints for large file builds, using them..."
4456 . ./uselargefiles.cbu
4458 echo "Rechecking to see how big your file offsets are..." >&4
4460 #include <sys/types.h>
4464 printf("%d\n", (int)sizeof($lseektype));
4469 if eval $compile_ok; then
4471 $echo "Your file offsets are now $lseeksize bytes long."
4475 echo "(I can't seem to compile the test program. Guessing...)"
4476 rp="What is the size of your file offsets (in bytes)?"
4481 *_t) zzz="$fpostype" ;;
4484 $echo $n "Rechecking the size of $zzz...$c" >&4
4486 #include <sys/types.h>
4489 printf("%d\n", (int)sizeof($fpostype));
4494 if eval $compile_ok; then
4499 echo "(I can't execute the test program--guessing $fpossize.)" >&4
4502 echo " $fpossize bytes." >&4
4508 echo "(I can't compile the test program. Guessing...)" >&4
4509 rp="What is the size of your file positions (in bytes)?"
4519 case "$usemorebits" in
4520 "$define"|true|[yY]*)
4521 use64bitint="$define"
4522 uselongdouble="$define"
4523 usemorebits="$define"
4525 *) usemorebits="$undef"
4530 case "$uselonglong" in
4531 "$define"|true|[yY]*)
4534 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
4536 use64bitint="$define"
4539 case "$use64bits" in
4540 "$define"|true|[yY]*)
4543 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
4545 use64bitint="$define"
4548 case "$use64bitints" in
4549 "$define"|true|[yY]*)
4552 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
4554 use64bitint="$define"
4557 case "$use64bitsint" in
4558 "$define"|true|[yY]*)
4561 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
4563 use64bitint="$define"
4566 case "$uselonglongs" in
4567 "$define"|true|[yY]*)
4570 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
4572 use64bitint="$define"
4575 case "$use64bitsall" in
4576 "$define"|true|[yY]*)
4579 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
4581 use64bitall="$define"
4586 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
4588 case "$use64bitall" in
4589 "$define"|true|[yY]*) use64bitint="$define" ;;
4595 You have natively 64-bit long integers.
4599 *) case "$use64bitint" in
4600 "$define"|true|[yY]*) dflt='y';;
4605 Perl can be built to take advantage of 64-bit integer types
4606 on some systems. To do so, Configure can be run with -Duse64bitint.
4607 Choosing this option will most probably introduce binary incompatibilities.
4609 If this doesn't make any sense to you, just accept the default '$dflt'.
4611 rp='Try to use 64-bit integers, if available?'
4614 [yY]*) val="$define" ;;
4622 case "$use64bitall" in
4623 "$define"|true|[yY]*) dflt='y' ;;
4624 *) case "$longsize" in
4632 You may also choose to try maximal 64-bitness. It means using as much
4633 64-bitness as possible on the platform. This in turn means even more
4634 binary incompatibilities. On the other hand, your platform may not
4635 have any more 64-bitness available than what you already have chosen.
4637 If this doesn't make any sense to you, just accept the default '$dflt'.
4639 rp='Try to use maximal 64-bit support, if available?'
4642 [yY]*) val="$define" ;;
4647 case "$use64bitall" in
4649 case "$use64bitint" in
4653 Since you have chosen a maximally 64-bit build, I'm also turning on
4654 the use of 64-bit integers.
4656 use64bitint="$define" ;;
4661 case "$use64bitint" in
4662 "$define"|true|[yY]*)
4663 : Look for a hint-file generated 'call-back-unit'. If the
4664 : user has specified that a 64-bit perl is to be built,
4665 : we may need to set or change some other defaults.
4666 if $test -f use64bitint.cbu; then
4667 echo "Your platform has some specific hints for 64-bit integers, using them..."
4671 4) case "$archname64" in
4672 '') archname64=64int ;;
4679 case "$use64bitall" in
4680 "$define"|true|[yY]*)
4681 : Look for a hint-file generated 'call-back-unit'. If the
4682 : user has specified that a maximally 64-bit perl is to be built,
4683 : we may need to set or change some other defaults.
4684 if $test -f use64bitall.cbu; then
4685 echo "Your platform has some specific hints for 64-bit builds, using them..."
4689 4) case "$archname64" in
4690 ''|64int) archname64=64all ;;
4698 echo "Checking for GNU C Library..." >&4
4699 cat >gnulibc.c <<EOM
4711 if eval $compile_ok && ./gnulibc; then
4713 echo "You are using the GNU C Library"
4716 echo "You are not using the GNU C Library"
4722 : see if nm is to be used to determine whether a symbol is defined or not
4726 case "$d_gnulibc" in
4729 echo "nm probably won't work on the GNU C Library." >&4
4735 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
4737 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
4738 echo "'nm' won't be sufficient on this sytem." >&4
4744 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
4745 if $test $dflt -gt 20; then
4755 true|$define) dflt=y;;
4762 I can use $nm to extract the symbols from your C libraries. This
4763 is a time consuming task which may generate huge output on the disk (up
4764 to 3 megabytes) but that should make the symbols extraction faster. The
4765 alternative is to skip the 'nm' extraction part and to compile a small
4766 test program instead to determine whether each symbol is present. If
4767 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
4768 this may be the best solution.
4770 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
4773 rp="Shall I use $nm to extract C symbols from the libraries?"
4776 [Nn]*) usenm=false;;
4785 : nm options which may be necessary
4787 '') if $test -f /mach_boot; then
4789 elif $test -d /usr/ccs/lib; then
4790 nm_opt='-p' # Solaris (and SunOS?)
4791 elif $test -f /dgux; then
4793 elif $test -f /lib64/rld; then
4794 nm_opt='-p' # 64-bit Irix
4800 : nm options which may be necessary for shared libraries but illegal
4801 : for archive libraries. Thank you, Linux.
4802 case "$nm_so_opt" in
4803 '') case "$myuname" in
4805 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
4806 nm_so_opt='--dynamic'
4815 : get list of predefined functions in a handy place
4820 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
4827 *) for thislib in $libs; do
4830 : Handle C library specially below.
4833 thislib=`echo $thislib | $sed -e 's/^-l//'`
4834 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
4836 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
4838 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
4840 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
4842 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
4844 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
4846 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
4851 libnames="$libnames $try"
4853 *) libnames="$libnames $thislib" ;;
4862 for xxx in $libpth; do
4863 $test -r $1 || set $xxx/libc.$so
4864 : The messy sed command sorts on library version numbers.
4866 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
4867 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
4869 s/[0-9][0-9]*/0000&/g
4870 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
4873 $sort | $sed -e 's/^.* //'`
4876 $test -r $1 || set /usr/ccs/lib/libc.$so
4877 $test -r $1 || set /lib/libsys_s$_a
4883 if $test -r "$1"; then
4884 echo "Your (shared) C library seems to be in $1."
4886 elif $test -r /lib/libc && $test -r /lib/clib; then
4887 echo "Your C library seems to be in both /lib/clib and /lib/libc."
4889 libc='/lib/clib /lib/libc'
4890 if $test -r /lib/syslib; then
4891 echo "(Your math library is in /lib/syslib.)"
4892 libc="$libc /lib/syslib"
4894 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
4895 echo "Your C library seems to be in $libc, as you said before."
4896 elif $test -r $incpath/usr/lib/libc$_a; then
4897 libc=$incpath/usr/lib/libc$_a;
4898 echo "Your C library seems to be in $libc. That's fine."
4899 elif $test -r /lib/libc$_a; then
4901 echo "Your C library seems to be in $libc. You're normal."
4903 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
4905 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
4906 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
4907 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
4909 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
4911 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
4914 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
4916 if $test -r "$tans"; then
4917 echo "Your C library seems to be in $tans, of all places."
4923 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
4927 If the guess above is wrong (which it might be if you're using a strange
4928 compiler, or your machine supports multiple models), you can override it here.
4933 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
4935 I can't seem to find your C library. I've looked in the following places:
4938 $sed 's/^/ /' libpath
4941 None of these seems to contain your C library. I need to get its name...
4946 rp='Where is your C library?'
4951 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
4952 set X `cat libnames`
4955 case $# in 1) xxx=file; esac
4956 echo "Extracting names from the following $xxx for later perusal:" >&4
4958 $sed 's/^/ /' libnames >&4
4960 $echo $n "This may take a while...$c" >&4
4964 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
4965 *) $nm $nm_opt $file 2>/dev/null;;
4970 $grep fprintf libc.tmp > libc.ptf
4971 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
4972 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
4974 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
4976 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4978 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
4980 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4982 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
4984 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4986 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
4988 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4990 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
4992 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4994 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
4996 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4998 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
4999 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
5001 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5003 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
5005 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5007 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
5009 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5011 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
5013 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5015 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
5017 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5019 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
5021 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5023 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
5025 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5027 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
5029 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5032 $nm -p $* 2>/dev/null >libc.tmp
5033 $grep fprintf libc.tmp > libc.ptf
5034 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
5035 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
5041 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
5043 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
5044 for thisname in $libnames $libc; do
5045 $ar t $thisname >>libc.tmp
5047 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
5049 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
5050 # Repeat libc to extract forwarders to DLL entries too
5051 for thisname in $libnames $libc; do
5052 $ar tv $thisname >>libc.tmp
5053 # Revision 50 of EMX has bug in $ar.
5054 # it will not extract forwarders to DLL entries
5055 # Use emximp which will extract exactly them.
5056 emximp -o tmp.imp $thisname \
5058 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
5059 < tmp.imp >>libc.tmp
5062 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
5065 echo "$ar didn't seem to work right." >&4
5066 echo "Maybe this is a Cray...trying bld instead..." >&4
5067 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
5069 for thisname in $libnames; do
5071 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
5072 $ar t $thisname >>libc.tmp
5076 echo "That didn't work either. Giving up." >&4
5083 if $test -f /lib/syscalls.exp; then
5085 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
5086 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*$/\1/p' /lib/syscalls.exp >>libc.list
5090 $rm -f libnames libpath
5092 : is a C symbol defined?
5095 -v) tf=libc.tmp; tc=""; tdc="";;
5096 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
5097 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
5100 case "$reuseval-$4" in
5102 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
5108 if $contains $tlook $tf >/dev/null 2>&1;
5113 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
5114 if $cc -o t $optimize $ccflags $ldflags t.c $libs >/dev/null 2>&1;
5122 $define) tval=true;;
5128 : define an is-in-libc? function
5129 inlibc='echo " "; td=$define; tu=$undef;
5130 sym=$1; var=$2; eval "was=\$$2";
5132 case "$reuseval$was" in
5142 echo "$sym() found." >&4;
5143 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
5145 echo "$sym() NOT found." >&4;
5146 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
5150 $define) echo "$sym() found." >&4;;
5151 *) echo "$sym() NOT found." >&4;;
5155 : see if sqrtl exists
5160 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
5163 case "$uselongdouble" in
5164 $define|true|[yY]*) dflt='y';;
5169 Perl can be built to take advantage of long doubles which
5170 (if available) may give more accuracy and range for floating point numbers.
5172 If this doesn't make any sense to you, just accept the default '$dflt'.
5174 rp='Try to use long doubles if available?'
5177 y|Y) val="$define" ;;
5183 case "$uselongdouble" in
5184 true|[yY]*) uselongdouble="$define" ;;
5187 case "$uselongdouble" in
5189 : Look for a hint-file generated 'call-back-unit'. If the
5190 : user has specified that long doubles should be used,
5191 : we may need to set or change some other defaults.
5192 if $test -f uselongdouble.cbu; then
5193 echo "Your platform has some specific hints for long doubles, using them..."
5194 . ./uselongdouble.cbu
5197 (Your platform doesn't have any specific hints for long doubles.)
5203 case "$uselongdouble:$d_sqrtl" in
5207 *** You requested the use of long doubles but you do not seem to have
5208 *** the mathematic functions for long doubles. I'm disabling the use
5209 *** of long doubles.
5212 uselongdouble=$undef
5216 : check for length of double
5218 case "$doublesize" in
5220 echo "Checking to see how big your double precision numbers are..." >&4
5221 $cat >try.c <<'EOCP'
5225 printf("%d\n", (int)sizeof(double));
5230 if eval $compile_ok; then
5232 echo "Your double is $doublesize bytes long."
5235 echo "(I can't seem to compile the test program. Guessing...)"
5236 rp="What is the size of a double precision number (in bytes)?"
5244 : check for long doubles
5246 echo "Checking to see if you have long double..." >&4
5247 echo 'int main() { long double x = 7.0; }' > try.c
5249 if eval $compile; then
5251 echo "You have long double."
5254 echo "You do not have long double."
5260 : check for length of long double
5261 case "${d_longdbl}${longdblsize}" in
5264 echo "Checking to see how big your long doubles are..." >&4
5265 $cat >try.c <<'EOCP'
5269 printf("%d\n", sizeof(long double));
5274 if eval $compile; then
5275 longdblsize=`./try$exe_ext`
5276 echo "Your long doubles are $longdblsize bytes long."
5280 echo "(I can't seem to compile the test program. Guessing...)" >&4
5281 rp="What is the size of a long double (in bytes)?"
5285 if $test "X$doublesize" = "X$longdblsize"; then
5286 echo "(That isn't any different from an ordinary double.)"
5292 case "$useperlio" in
5293 $define|true|[yY]*) dflt='y';;
5298 Previous version of $package used the standard IO mechanisms as
5299 defined in <stdio.h>. Versions 5.003_02 and later of perl allow
5300 alternate IO mechanisms via the PerlIO abstraction layer, but the
5301 stdio mechanism is still the default. This abstraction layer can
5302 use AT&T's sfio (if you already have sfio installed) or regular stdio.
5303 Using PerlIO with sfio may cause problems with some extension modules.
5305 If this doesn't make any sense to you, just accept the default '$dflt'.
5307 rp='Use the experimental PerlIO abstraction layer?'
5314 echo "Ok, doing things the stdio way."
5323 case "$useperlio" in
5324 $define|true|[yY]*) ;;
5327 You are using the SOCKS proxy protocol library which means that you
5328 should also use the PerlIO layer. You may be headed for trouble.
5337 : determine the architecture name
5339 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5340 tarch=`arch`"-$osname"
5341 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5342 if uname -m > tmparch 2>&1 ; then
5343 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5344 -e 's/$/'"-$osname/" tmparch`
5352 case "$myarchname" in
5355 echo "(Your architecture name used to be $myarchname.)"
5362 *) dflt="$archname";;
5364 rp='What is your architecture name'
5367 case "$usethreads" in
5369 echo "Threads selected." >&4
5371 *-thread*) echo "...and architecture name already has -thread." >&4
5373 *) archname="$archname-thread"
5374 echo "...setting architecture name to $archname." >&4
5379 case "$usemultiplicity" in
5381 echo "Multiplicity selected." >&4
5383 *-multi*) echo "...and architecture name already has -multi." >&4
5385 *) archname="$archname-multi"
5386 echo "...setting architecture name to $archname." >&4
5391 case "$use64bitint$use64bitall" in
5393 case "$archname64" in
5395 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
5398 case "$use64bitint" in
5399 "$define") echo "64 bit integers selected." >&4 ;;
5401 case "$use64bitall" in
5402 "$define") echo "Maximal 64 bitness selected." >&4 ;;
5405 *-$archname64*) echo "...and architecture name already has $archname64." >&4
5407 *) archname="$archname-$archname64"
5408 echo "...setting architecture name to $archname." >&4
5414 case "$uselongdouble" in
5416 echo "Long doubles selected." >&4
5417 case "$longdblsize" in
5419 "...but long doubles are equal to doubles, not changing architecture name." >&4
5423 *-ld*) echo "...and architecture name already has -ld." >&4
5425 *) archname="$archname-ld"
5426 echo "...setting architecture name to $archname." >&4
5433 case "$useperlio" in
5435 echo "Perlio selected." >&4
5437 *-perlio*) echo "...and architecture name already has -perlio." >&4
5439 *) archname="$archname-perlio"
5440 echo "...setting architecture name to $archname." >&4
5446 : determine root of directory hierarchy where package will be installed.
5449 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
5457 By default, $package will be installed in $dflt/bin, manual pages
5458 under $dflt/man, etc..., i.e. with $dflt as prefix for all
5459 installation directories. Typically this is something like /usr/local.
5460 If you wish to have binaries under /usr/bin but other parts of the
5461 installation under /usr/local, that's ok: you will be prompted
5462 separately for each of the installation directories, the prefix being
5463 only used to set the defaults.
5467 rp='Installation prefix to use?'
5475 *) oldprefix="$prefix";;
5485 $define|true) afs=true ;;
5486 $undef|false) afs=false ;;
5487 *) if test -d /afs; then
5495 echo "AFS may be running... I'll be extra cautious then..." >&4
5497 echo "AFS does not seem to be running..." >&4
5500 : determine installation prefix for where package is to be installed.
5504 Since you are running AFS, I need to distinguish the directory in which
5505 files will reside from the directory in which they are installed (and from
5506 which they are presumably copied to the former directory by occult means).
5509 case "$installprefix" in
5510 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
5511 *) dflt="$installprefix";;
5516 In some special cases, particularly when building $package for distribution,
5517 it is convenient to distinguish between the directory in which files should
5518 be installed from the directory ($prefix) in which they
5519 will eventually reside. For most users, these two directories are the same.
5522 case "$installprefix" in
5524 *) dflt=$installprefix;;
5528 rp='What installation prefix should I use for installing files?'
5530 installprefix="$ans"
5531 installprefixexp="$ansexp"
5533 : set the prefixit variable, to compute a suitable default value
5534 prefixit='case "$3" in
5536 case "$oldprefix" in
5537 "") eval "$1=\"\$$2\"";;
5544 ""|" ") eval "$1=\"\$$2\"";;
5550 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
5552 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
5553 /*-$oldprefix/*|\~*-$oldprefix/*)
5554 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
5555 *) eval "$1=\"\$$2\"";;
5560 : get the patchlevel
5562 echo "Getting the current patchlevel..." >&4
5563 if $test -r $rsrc/patchlevel.h;then
5564 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
5565 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
5566 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5567 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
5568 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
5569 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5578 $echo "(You have $package version $patchlevel subversion $subversion.)"
5581 : XXX Should be a Configure test for double-dots in filenames.
5582 version=`echo $revision $patchlevel $subversion | \
5583 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
5584 api_versionstring=`echo $api_revision $api_version $api_subversion | \
5585 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
5588 version=`echo $revision $patchlevel $subversion | \
5589 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
5590 api_versionstring=`echo $api_revision $api_version $api_subversion | \
5591 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
5594 : Special case the 5.005_xx maintenance series, which used 5.005
5595 : without any subversion label as a subdirectory in $sitelib
5596 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
5597 api_versionstring='5.005'
5600 : determine installation style
5601 : For now, try to deduce it from prefix unless it is already set.
5602 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
5603 case "$installstyle" in
5604 '') case "$prefix" in
5605 *perl*) dflt='lib';;
5606 *) dflt='lib/perl5' ;;
5609 *) dflt="$installstyle" ;;
5611 : Probably not worth prompting for this since we prompt for all
5612 : the directories individually, and the prompt would be too long and
5616 : determine where private library files go
5617 : Usual default is /usr/local/lib/perl5/$version.
5618 : Also allow things like /opt/perl/lib/$version, since
5619 : /opt/perl/lib/perl5... would be redundant.
5620 : The default "style" setting is made in installstyle.U
5621 case "$installstyle" in
5622 *lib/perl5*) set dflt privlib lib/$package/$version ;;
5623 *) set dflt privlib lib/$version ;;
5628 There are some auxiliary files for $package that need to be put into a
5629 private library directory that is accessible by everyone.
5633 rp='Pathname where the private library files will reside?'
5636 privlibexp="$ansexp"
5637 : Change installation prefix, if necessary.
5638 if $test X"$prefix" != X"$installprefix"; then
5639 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
5641 installprivlib="$privlibexp"
5644 : set the prefixup variable, to restore leading tilda escape
5645 prefixup='case "$prefixexp" in
5647 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
5650 : determine where public architecture dependent libraries go
5653 : privlib default is /usr/local/lib/$package/$version
5654 : archlib default is /usr/local/lib/$package/$version/$archname
5655 : privlib may have an optional trailing /share.
5656 tdflt=`echo $privlib | $sed 's,/share$,,'`
5657 tdflt=$tdflt/$archname
5666 $spackage contains architecture-dependent library files. If you are
5667 sharing libraries in a heterogeneous environment, you might store
5668 these files in a separate location. Otherwise, you can just include
5669 them with the rest of the public library files.
5673 rp='Where do you want to put the public architecture-dependent libraries?'
5676 archlibexp="$ansexp"
5677 if $test X"$archlib" = X"$privlib"; then
5682 : Change installation prefix, if necessary.
5683 if $test X"$prefix" != X"$installprefix"; then
5684 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
5686 installarchlib="$archlibexp"
5690 : Binary compatibility with 5.005 is not possible for builds
5691 : with advanced features
5692 case "$usethreads$usemultiplicity" in
5694 bincompat5005="$undef"
5695 d_bincompat5005="$undef"
5699 This version of Perl can be compiled for binary compatibility with 5.005.
5700 If you decide to do so, you will be able to continue using most of the
5701 extensions that were compiled for Perl 5.005.
5704 case "$bincompat5005$d_bincompat5005" in
5705 *"$undef"*) dflt=n ;;
5708 rp='Binary compatibility with Perl 5.005?'
5711 y*) val="$define" ;;
5716 case "$d_bincompat5005" in
5718 bincompat5005="$define"
5720 *) bincompat5005="$undef"
5721 d_bincompat5005="$undef"
5728 : see if setuid scripts can be secure
5731 Some kernels have a bug that prevents setuid #! scripts from being
5732 secure. Some sites have disabled setuid #! scripts because of this.
5734 First let's decide if your kernel supports secure setuid #! scripts.
5735 (If setuid #! scripts would be secure but have been disabled anyway,
5736 don't say that they are secure if asked.)
5741 if $test -d /dev/fd; then
5742 echo "#!$ls" >reflect
5743 chmod +x,u+s reflect
5744 ./reflect >flect 2>&1
5745 if $contains "/dev/fd" flect >/dev/null; then
5746 echo "Congratulations, your kernel has secure setuid scripts!" >&4
5750 If you are not sure if they are secure, I can check but I'll need a
5751 username and password different from the one you are using right now.
5752 If you don't have such a username or don't want me to test, simply
5756 rp='Other username to test security of setuid scripts with?'
5761 case "$d_suidsafe" in
5762 '') echo "I'll assume setuid scripts are *not* secure." >&4
5765 echo "Well, the $hint value is *not* secure." >&4
5767 *) echo "Well, the $hint value *is* secure." >&4
5772 $rm -f reflect flect
5773 echo "#!$ls" >reflect
5774 chmod +x,u+s reflect
5777 echo '"su" will (probably) prompt you for '"$ans's password."
5778 su $ans -c './reflect >flect'
5779 if $contains "/dev/fd" flect >/dev/null; then
5780 echo "Okay, it looks like setuid scripts are secure." >&4
5783 echo "I don't think setuid scripts are secure." >&4
5788 rp='Does your kernel have *secure* setuid scripts?'
5791 [yY]*) val="$define";;
5796 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
5797 echo "(That's for file descriptors, not floppy disks.)"
5803 $rm -f reflect flect
5805 : now see if they want to do setuid emulation
5808 case "$d_suidsafe" in
5811 echo "No need to emulate SUID scripts since they are secure here." >& 4
5815 Some systems have disabled setuid scripts, especially systems where
5816 setuid scripts cannot be secure. On systems where setuid scripts have
5817 been disabled, the setuid/setgid bits on scripts are currently
5818 useless. It is possible for $package to detect those bits and emulate
5819 setuid/setgid in a secure fashion. This emulation will only work if
5820 setuid scripts have been disabled in your kernel.
5824 "$define") dflt=y ;;
5827 rp="Do you want to do setuid/setgid emulation?"
5830 [yY]*) val="$define";;
5838 : determine filename position in cpp output
5840 echo "Computing filename position in cpp output for #include directives..." >&4
5841 echo '#include <stdio.h>' > foo.c
5844 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5845 $grep '^[ ]*#.*stdio\.h' | \
5846 while read cline; do
5849 while $test \$# -gt 0; do
5850 if $test -r \`echo \$1 | $tr -d '"'\`; then
5855 pos=\`expr \$pos + 1\`
5867 *) pos="${fieldn}th";;
5869 echo "Your cpp writes the filename in the $pos field of the line."
5871 : locate header file
5876 for usrincdir in $usrinc
5878 if test -f \$usrincdir/\$wanted; then
5879 echo "\$usrincdir/\$wanted"
5883 awkprg='{ print \$$fieldn }'
5884 echo "#include <\$wanted>" > foo\$\$.c
5885 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5886 $grep "^[ ]*#.*\$wanted" | \
5887 while read cline; do
5888 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5890 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5891 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5896 # status = 0: grep returned 0 lines, case statement not executed
5897 # status = 1: headerfile found
5898 # status = 2: while loop executed, no headerfile found
5902 if test \$status -eq 1; then
5909 : define an alternate in-header-list? function
5910 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5911 cont=true; xxf="echo \"<\$1> found.\" >&4";
5912 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5913 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5915 case $# in 4) instead=instead;; *) instead="at last";; esac;
5916 while $test "$cont"; do
5918 var=$2; eval "was=\$$2";
5919 if $test "$xxx" && $test -r "$xxx";
5921 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5924 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5925 set $yyy; shift; shift; yyy=$@;
5926 case $# in 0) cont="";;
5927 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5928 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5929 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5930 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5934 do set $yyy; var=$2; eval "was=\$$2";
5935 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5936 set $yyy; shift; shift; yyy=$@;
5939 : see if this is a malloc.h system
5940 set malloc.h i_malloc
5943 : see if stdlib is available
5944 set stdlib.h i_stdlib
5947 : determine which malloc to compile in
5949 case "$usemymalloc" in
5950 ''|[yY]*|true|$define) dflt='y' ;;
5953 rp="Do you wish to attempt to use the malloc that comes with $package?"
5959 mallocsrc='malloc.c'
5960 mallocobj="malloc$_o"
5961 d_mymalloc="$define"
5964 : Remove malloc from list of libraries to use
5965 echo "Removing unneeded -lmalloc from library list" >&4
5966 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
5969 echo "libs = $libs" >&4
5981 : compute the return types of malloc and free
5983 $cat >malloc.c <<END
5987 #include <sys/types.h>
6001 case "$malloctype" in
6003 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6010 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6014 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6021 echo "Your system uses $freetype free(), it would seem." >&4
6025 After $package is installed, you may wish to install various
6026 add-on modules and utilities. Typically, these add-ons will
6027 be installed under $prefix with the rest
6028 of this package. However, you may wish to install such add-ons
6029 elsewhere under a different prefix.
6031 If you do not wish to put everything under a single prefix, that's
6032 ok. You will be prompted for the individual locations; this siteprefix
6033 is only used to suggest the defaults.
6035 The default should be fine for most people.
6039 rp='Installation prefix to use for add-on modules and utilities?'
6040 : XXX Here might be another good place for an installstyle setting.
6041 case "$siteprefix" in
6043 *) dflt=$siteprefix ;;
6046 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6048 case "$siteprefix" in
6052 *) oldsiteprefix="$prefix";;
6057 siteprefixexp="$ansexp"
6059 : determine where site specific libraries go.
6060 : Usual default is /usr/local/lib/perl5/site_perl/$version
6061 : The default "style" setting is made in installstyle.U
6062 : XXX No longer works with Prefixit stuff.
6063 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6065 '') case "$installstyle" in
6066 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6067 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6075 The installation process will create a directory for
6076 site-specific extensions and modules. Most users find it convenient
6077 to place all site-specific files in this directory rather than in the
6078 main distribution directory.
6082 rp='Pathname for the site-specific library files?'
6085 sitelibexp="$ansexp"
6086 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6087 : Change installation prefix, if necessary.
6088 if $test X"$prefix" != X"$installprefix"; then
6089 installsitelib=`echo $sitelibexp | $sed "s#^$prefix#$installprefix#"`
6091 installsitelib="$sitelibexp"
6094 : determine where site specific architecture-dependent libraries go.
6095 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6096 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6097 : sitelib may have an optional trailing /share.
6099 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6100 dflt="$dflt/$archname"
6105 set sitearch sitearch none
6109 The installation process will also create a directory for
6110 architecture-dependent site-specific extensions and modules.
6114 rp='Pathname for the site-specific architecture-dependent library files?'
6117 sitearchexp="$ansexp"
6118 : Change installation prefix, if necessary.
6119 if $test X"$prefix" != X"$installprefix"; then
6120 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
6122 installsitearch="$sitearchexp"
6127 The installation process will also create a directory for
6128 vendor-supplied add-ons. Vendors who supply perl with their system
6129 may find it convenient to place all vendor-supplied files in this
6130 directory rather than in the main distribution directory. This will
6131 ease upgrades between binary-compatible maintenance versions of perl.
6133 Of course you may also use these directories in whatever way you see
6134 fit. For example, you might use them to access modules shared over a
6135 company-wide network.
6137 The default answer should be fine for most people.
6138 This causes further questions about vendor add-ons to be skipped
6139 and no vendor-specific directories will be configured for perl.
6142 rp='Do you want to configure vendor-specific add-on directories?'
6143 case "$usevendorprefix" in
6144 define|true|[yY]*) dflt=y ;;
6145 *) : User may have set vendorprefix directly on Configure command line.
6146 case "$vendorprefix" in
6155 rp='Installation prefix to use for vendor-supplied add-ons?'
6156 case "$vendorprefix" in
6158 *) dflt=$vendorprefix ;;
6161 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6163 case "$vendorprefix" in
6167 *) oldvendorprefix="$prefix";;
6171 usevendorprefix="$define"
6173 vendorprefixexp="$ansexp"
6175 *) usevendorprefix="$undef"
6181 case "$vendorprefix" in
6182 '') d_vendorlib="$undef"
6186 *) d_vendorlib="$define"
6187 : determine where vendor-supplied modules go.
6188 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6189 case "$vendorlib" in
6191 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6192 case "$installstyle" in
6193 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6194 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6197 *) dflt="$vendorlib"
6201 rp='Pathname for the vendor-supplied library files?'
6204 vendorlibexp="$ansexp"
6207 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6208 : Change installation prefix, if necessary.
6209 if $test X"$prefix" != X"$installprefix"; then
6210 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
6212 installvendorlib="$vendorlibexp"
6215 case "$vendorprefix" in
6216 '') d_vendorarch="$undef"
6220 *) d_vendorarch="$define"
6221 : determine where vendor-supplied architecture-dependent libraries go.
6222 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6223 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6224 : vendorlib may have an optional trailing /share.
6225 case "$vendorarch" in
6226 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6227 dflt="$dflt/$archname"
6229 *) dflt="$vendorarch" ;;
6232 rp='Pathname for vendor-supplied architecture-dependent files?'
6235 vendorarchexp="$ansexp"
6238 : Change installation prefix, if necessary.
6239 if $test X"$prefix" != X"$installprefix"; then
6240 installvendorarch=`echo $vendorarchexp | sed "s#^$prefix#$installprefix#"`
6242 installvendorarch="$vendorarchexp"
6245 : Final catch-all directories to search
6248 Lastly, you can have perl look in other directories for extensions and
6249 modules in addition to those already specified.
6250 These directories will be searched after
6254 test X"$vendorlib" != "X" && echo ' ' $vendorlib
6255 test X"$vendorarch" != "X" && echo ' ' $vendorarch
6257 case "$otherlibdirs" in
6258 ''|' ') dflt='none' ;;
6259 *) dflt="$otherlibdirs" ;;
6262 Enter a colon-separated set of extra paths to include in perl's @INC
6263 search path, or enter 'none' for no extra paths.
6267 rp='Colon-separated list of additional directories for perl to search?'
6270 ' '|''|none) otherlibdirs=' ' ;;
6271 *) otherlibdirs="$ans" ;;
6273 case "$otherlibdirs" in
6277 set d_perl_otherlibdirs
6280 : Cruising for prototypes
6282 echo "Checking out function prototypes..." >&4
6283 $cat >prototype.c <<'EOCP'
6284 int main(int argc, char *argv[]) {
6287 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
6288 echo "Your C compiler appears to support function prototypes."
6291 echo "Your C compiler doesn't seem to understand function prototypes."
6298 case "$prototype" in
6300 *) ansi2knr='ansi2knr'
6305 This version of $package can only be compiled by a compiler that
6306 understands function prototypes. Unfortunately, your C compiler
6308 doesn't seem to understand them. Sorry about that.
6310 If GNU cc is available for your system, perhaps you could try that instead.
6312 Eventually, we hope to support building Perl with pre-ANSI compilers.
6313 If you would like to help in that effort, please contact <perlbug@perl.org>.
6315 Aborting Configure now.
6321 : determine where public executables go
6326 rp='Pathname where the public executables will reside?'
6328 if $test "X$ansexp" != "X$binexp"; then
6333 : Change installation prefix, if necessary.
6334 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6335 if $test X"$prefix" != X"$installprefix"; then
6336 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
6338 installbin="$binexp"
6341 : Find perl5.005 or later.
6342 echo "Looking for a previously installed perl5.005 or later... "
6344 '') for tdir in `echo "$binexp:$PATH" | $sed "s/$path_sep/ /g"`; do
6345 : Check if this perl is recent and can load a simple module
6346 if $test -x $tdir/perl && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6349 elif $test -x $tdir/perl5 && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6359 '') echo "None found. That's ok.";;
6360 *) echo "Using $perl5." ;;
6363 : Determine list of previous versions to include in @INC
6364 $cat > getverlist <<EOPL
6367 \$api_versionstring = "$api_versionstring";
6368 \$version = "$version";
6369 \$stem = "$sitelib_stem";
6370 \$archname = "$archname";
6372 $cat >> getverlist <<'EOPL'
6373 # Can't have leading @ because metaconfig interprets it as a command!
6374 ;@inc_version_list=();
6375 # XXX Redo to do opendir/readdir?
6378 ;@candidates = glob("5.*");
6384 # XXX ToDo: These comparisons must be reworked when two-digit
6385 # subversions come along, so that 5.7.10 compares as greater than
6386 # 5.7.3! By that time, hope that 5.6.x is sufficiently
6387 # widespread that we can use the built-in version vectors rather
6388 # than reinventing them here. For 5.6.0, however, we must
6389 # assume this script will likely be run by 5.005_0x. --AD 1/2000.
6390 foreach $d (@candidates) {
6391 if ($d lt $version) {
6392 if ($d ge $api_versionstring) {
6393 unshift(@inc_version_list, grep { -d } "$d/$archname", $d);
6395 elsif ($d ge "5.005") {
6396 unshift(@inc_version_list, grep { -d } $d);
6400 # Skip newer version. I.e. don't look in
6401 # 5.7.0 if we're installing 5.6.1.
6405 if (@inc_version_list) {
6406 print join(' ', @inc_version_list);
6409 # Blank space to preserve value for next Configure run.
6414 case "$inc_version_list" in
6415 '') if test -x "$perl5"; then
6416 dflt=`$perl5 getverlist`
6421 $undef) dflt='none' ;;
6422 *) dflt="$inc_version_list" ;;
6425 ''|' ') dflt=none ;;
6428 5.005) case "$bincompat5005" in
6429 $define|true|[yY]*) ;;
6436 In order to ease the process of upgrading, this version of perl
6437 can be configured to use modules built and installed with earlier
6438 versions of perl that were installed under $prefix. Specify here
6439 the list of earlier versions that this version of perl should check.
6440 If Configure detected no earlier versions of perl installed under
6441 $prefix, then the list will be empty. Answer 'none' to tell perl
6442 to not search earlier versions.
6444 The default should almost always be sensible, so if you're not sure,
6445 just accept the default.
6448 rp='List of earlier versions to include in @INC?'
6451 [Nn]one|''|' ') inc_version_list=' ' ;;
6452 *) inc_version_list="$ans" ;;
6454 case "$inc_version_list" in
6456 inc_version_list_init='0';;
6457 *) inc_version_list_init=`echo $inc_version_list |
6458 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6463 : determine whether to install perl also as /usr/bin/perl
6466 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
6468 Many scripts expect perl to be installed as /usr/bin/perl.
6469 I can install the perl you are about to compile also as /usr/bin/perl
6470 (in addition to $installbin/perl).
6472 case "$installusrbinperl" in
6473 "$undef"|[nN]*) dflt='n';;
6476 rp="Do you want to install perl as /usr/bin/perl?"
6479 [yY]*) val="$define";;
6485 set installusrbinperl
6488 : see if dld is available
6492 : see if dlopen exists
6499 : determine which dynamic loading, if any, to compile in
6501 dldir="ext/DynaLoader"
6514 $define) dflt='y' ;;
6517 $define) dflt='y' ;;
6519 : Does a dl_xxx.xs file exist for this operating system
6520 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
6523 rp="Do you wish to use dynamic loading?"
6530 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
6531 dflt="$dldir/dl_${osname}.xs"
6532 elif $test "$d_dlopen" = "$define" ; then
6533 dflt="$dldir/dl_dlopen.xs"
6534 elif $test "$i_dld" = "$define" ; then
6535 dflt="$dldir/dl_dld.xs"
6540 *) dflt="$dldir/$dlsrc"
6543 echo "The following dynamic loading files are available:"
6544 : Can not go over to $dldir because getfile has path hard-coded in.
6545 tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir
6546 rp="Source file to use for dynamic loading"
6552 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
6556 Some systems may require passing special flags to $cc -c to
6557 compile modules that will be used to create a shared library.
6558 To use no flags, say "none".
6561 case "$cccdlflags" in
6562 '') case "$gccversion" in
6563 '') case "$osname" in
6565 next) dflt='none' ;;
6566 irix*) dflt='-KPIC' ;;
6567 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
6568 sunos) dflt='-pic' ;;
6572 *) case "$osname" in
6573 svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
6578 *) dflt="$cccdlflags" ;;
6580 rp="Any special flags to pass to $cc -c to compile shared library modules?"
6583 none) cccdlflags=' ' ;;
6584 *) cccdlflags="$ans" ;;
6589 Some systems use ld to create libraries that can be dynamically loaded,
6590 while other systems (such as those using ELF) use $cc.
6594 '') $cat >try.c <<'EOM'
6595 /* Test for whether ELF binaries are produced */
6600 int i = open("a.out",O_RDONLY);
6603 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
6604 exit(0); /* succeed (yes, it's ELF) */
6609 if $cc $ccflags try.c >/dev/null 2>&1 && ./a.out; then
6611 You appear to have ELF support. I'll use $cc to build dynamic libraries.
6615 echo "I'll use ld to build dynamic libraries."
6624 rp="What command should be used to create dynamic libraries?"
6630 Some systems may require passing special flags to $ld to create a
6631 library that can be dynamically loaded. If your ld flags include
6632 -L/other/path options to locate libraries outside your loader's normal
6633 search path, you may need to specify those -L options here as well. To
6634 use no flags, say "none".
6637 case "$lddlflags" in
6638 '') case "$osname" in
6639 beos) dflt='-nostart' ;;
6641 case "$gccversion" in
6642 '') dflt="$dflt +vnocompatwarnings" ;;
6645 linux|irix*) dflt='-shared' ;;
6646 next) dflt='none' ;;
6647 solaris) dflt='-G' ;;
6648 sunos) dflt='-assert nodefinitions' ;;
6649 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
6653 *) dflt="$lddlflags" ;;
6656 : Try to guess additional flags to pick up local libraries.
6657 : Be careful not to append to a plain 'none'
6661 for thisflag in $ldflags; do
6666 *) dflt="$dflt $thisflag" ;;
6673 ''|' ') dflt='none' ;;
6676 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
6679 none) lddlflags=' ' ;;
6680 *) lddlflags="$ans" ;;
6685 Some systems may require passing special flags to $cc to indicate that
6686 the resulting executable will use dynamic linking. To use no flags,
6690 case "$ccdlflags" in
6691 '') case "$osname" in
6692 hpux) dflt='-Wl,-E' ;;
6693 linux) dflt='-rdynamic' ;;
6694 next) dflt='none' ;;
6695 sunos) dflt='none' ;;
6699 *) dflt="$ccdlflags" ;;
6701 rp="Any special flags to pass to $cc to use dynamic linking?"
6704 none) ccdlflags=' ' ;;
6705 *) ccdlflags="$ans" ;;
6719 # No dynamic loading being used, so don't bother even to prompt.
6722 *) case "$useshrplib" in
6723 '') case "$osname" in
6724 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
6726 also='Building a shared libperl is required for dynamic loading to work on your system.'
6731 also='Building a shared libperl is needed for MAB support.'
6749 The perl executable is normally obtained by linking perlmain.c with
6750 libperl${_a}, any static extensions (usually just DynaLoader), and
6751 any other libraries needed on this system (such as -lm, etc.). Since
6752 your system supports dynamic loading, it is probably possible to build
6753 a shared libperl.$so. If you will have more than one executable linked
6754 to libperl.$so, this will significantly reduce the size of each
6755 executable, but it may have a noticeable affect on performance. The
6756 default is probably sensible for your system.
6760 rp="Build a shared libperl.$so (y/n)"
6764 useshrplib='true' ;;
6765 *) useshrplib='false' ;;
6770 case "$useshrplib" in
6774 # Figure out a good name for libperl.so. Since it gets stored in
6775 # a version-specific architecture-dependent library, the version
6776 # number isn't really that important, except for making cc/ld happy.
6778 # A name such as libperl.so.3.1
6779 majmin="libperl.$so.$patchlevel.$subversion"
6780 # A name such as libperl.so.301
6781 majonly=`echo $patchlevel $subversion |
6782 $awk '{printf "%d%02d", $1, $2}'`
6783 majonly=libperl.$so.$majonly
6784 # I'd prefer to keep the os-specific stuff here to a minimum, and
6785 # rely on figuring it out from the naming of libc.
6786 case "${osname}${osvers}" in
6789 # XXX How handle the --version stuff for MAB?
6791 linux*) # ld won't link with a bare -lperl otherwise.
6794 cygwin*) # include version
6795 dflt=`echo libperl$version | sed -e 's/\./_/g'`$lib_ext
6797 *) # Try to guess based on whether libc has major.minor.
6799 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
6800 *libc.$so.[0-9]*) dflt=$majonly ;;
6801 *) dflt=libperl.$so ;;
6811 I need to select a good name for the shared libperl. If your system uses
6812 library names with major and minor numbers, then you might want something
6813 like $majmin. Alternatively, if your system uses a single version
6814 number for shared libraries, then you might want to use $majonly.
6815 Or, your system might be quite happy with a simple libperl.$so.
6817 Since the shared libperl will get installed into a version-specific
6818 architecture-dependent directory, the version number of the shared perl
6819 library probably isn't important, so the default should be o.k.
6822 rp='What name do you want to give to the shared libperl?'
6825 echo "Ok, I'll use $libperl"
6828 libperl="libperl${_a}"
6832 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
6836 WARNING: Use of the shrpdir variable for the installation location of
6837 the shared $libperl is not supported. It was never documented and
6838 will not work in this version. Let me (perlbug@perl.org)
6839 know of any problems this may cause.
6845 But your current setting of $shrpdir is
6846 the default anyway, so it's harmless.
6851 Further, your current attempted setting of $shrpdir
6852 conflicts with the value of $archlibexp/CORE
6853 that installperl will use.
6860 # How will the perl executable find the installed shared $libperl?
6861 # Add $xxx to ccdlflags.
6862 # If we can't figure out a command-line option, use $shrpenv to
6863 # set env LD_RUN_PATH. The main perl makefile uses this.
6864 shrpdir=$archlibexp/CORE
6867 if "$useshrplib"; then
6870 # We'll set it in Makefile.SH...
6876 xxx="-Wl,-R$shrpdir"
6878 linux|irix*|dec_osf)
6879 xxx="-Wl,-rpath,$shrpdir"
6882 # next doesn't like the default...
6885 # beos doesn't like the default, either.
6888 # hpux doesn't like the default, either.
6889 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
6892 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
6898 # Only add $xxx if it isn't already in ccdlflags.
6899 case " $ccdlflags " in
6901 *) ccdlflags="$ccdlflags $xxx"
6904 Adding $xxx to the flags
6905 passed to $ld so that the perl executable will find the
6906 installed shared $libperl.
6914 # Fix ccdlflags in AIX for building external extensions.
6915 # (For building Perl itself bare -bE:perl.exp is needed,
6916 # Makefile.SH takes care of this.)
6918 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
6920 # Respect a hint or command-line value.
6922 '') shrpenv="$tmp_shrpenv" ;;
6924 case "$ldlibpthname" in
6925 '') ldlibpthname=LD_LIBRARY_PATH ;;
6926 none) ldlibpthname='' ;;
6929 : determine where manual pages are on this system
6933 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
6934 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
6935 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
6936 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
6937 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
6938 sysman=`./loc . /usr/man/man1 $syspath`
6941 if $test -d "$sysman"; then
6942 echo "System manual is in $sysman." >&4
6944 echo "Could not find manual pages in source form." >&4
6947 : determine where manual pages go
6948 set man1dir man1dir none
6952 $spackage has manual pages available in source form.
6956 echo "However, you don't have nroff, so they're probably useless to you."
6958 '') man1dir="none";;
6961 echo "If you don't want the manual sources installed, answer 'none'."
6966 lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
6967 lookpath="$lookpath $prefixexp/man/p_man/man1"
6968 lookpath="$lookpath $prefixexp/man/u_man/man1"
6969 lookpath="$lookpath $prefixexp/man/man.1"
6971 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
6972 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
6982 rp="Where do the main $spackage manual pages (source) go?"
6984 if $test "X$man1direxp" != "X$ansexp"; then
6988 man1direxp="$ansexp"
6994 : Change installation prefix, if necessary.
6995 if $test X"$prefix" != X"$installprefix"; then
6996 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
6998 installman1dir="$man1direxp"
7001 : What suffix to use on installed man pages
7008 rp="What suffix should be used for the main $spackage man pages?"
7010 '') case "$man1dir" in
7024 *) dflt="$man1ext";;
7031 : see if we can have long filenames
7033 first=123456789abcdef
7035 if (echo hi >$first) 2>/dev/null; then
7036 if $test -f 123456789abcde; then
7037 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
7040 echo 'You can have filenames longer than 14 characters.'>&4
7045 You can't have filenames longer than 14 chars.
7046 You can't even think about them!
7052 $rm -rf 123456789abcde*
7054 : determine where library module manual pages go
7055 set man3dir man3dir none
7059 $spackage has manual pages for many of the library modules.
7065 However, you don't have nroff, so they're probably useless to you.
7068 '') man3dir="none";;
7072 case "$d_flexfnam" in
7075 However, your system can't handle the long file names like File::Basename.3.
7078 '') man3dir="none";;
7082 echo "If you don't want the manual sources installed, answer 'none'."
7083 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7085 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
7086 if $test -d "$privlib/man/man3"; then
7089 WARNING: Previous versions of perl installed man3 pages into
7090 $privlib/man/man3. This version will suggest a
7091 new default of $dflt.
7095 rp='Do you wish to preserve the old behavior?(y/n)'
7098 y*) dflt="$privlib/man/man3" ;;
7103 *) dflt="$man3dir" ;;
7110 rp="Where do the $package library man pages (source) go?"
7113 man3direxp="$ansexp"
7119 : Change installation prefix, if necessary.
7120 if $test X"$prefix" != X"$installprefix"; then
7121 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
7123 installman3dir="$man3direxp"
7126 : What suffix to use on installed man pages
7132 rp="What suffix should be used for the $package library man pages?"
7134 '') case "$man3dir" in
7148 *) dflt="$man3ext";;
7155 : see if we have to deal with yellow pages, now NIS.
7156 if $test -d /usr/etc/yp || $test -d /etc/yp; then
7157 if $test -f /usr/etc/nibindd; then
7159 echo "I'm fairly confident you're on a NeXT."
7161 rp='Do you get the hosts file via NetInfo?'
7170 y*) hostcat='nidump hosts .';;
7171 *) case "$hostcat" in
7172 nidump*) hostcat='';;
7182 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
7190 rp='Are you getting the hosts file via yellow pages?'
7193 y*) hostcat='ypcat hosts';;
7194 *) hostcat='cat /etc/hosts';;
7200 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
7203 '') test -f /etc/group && groupcat='cat /etc/group';;
7206 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
7209 : now get the host name
7211 echo "Figuring out host name..." >&4
7212 case "$myhostname" in
7214 echo 'Maybe "hostname" will work...'
7215 if tans=`sh -c hostname 2>&1` ; then
7223 if $test "$cont"; then
7225 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
7226 if tans=`cat /etc/systemid 2>&1` ; then
7228 phostname='cat /etc/systemid'
7229 echo "Whadyaknow. Xenix always was a bit strange..."
7232 elif $test -r /etc/systemid; then
7233 echo "(What is a non-Xenix system doing with /etc/systemid?)"
7236 if $test "$cont"; then
7237 echo 'No, maybe "uuname -l" will work...'
7238 if tans=`sh -c 'uuname -l' 2>&1` ; then
7240 phostname='uuname -l'
7242 echo 'Strange. Maybe "uname -n" will work...'
7243 if tans=`sh -c 'uname -n' 2>&1` ; then
7245 phostname='uname -n'
7247 echo 'Oh well, maybe I can mine it out of whoami.h...'
7248 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
7249 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
7250 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
7252 case "$myhostname" in
7253 '') echo "Does this machine have an identity crisis or something?"
7256 echo "Well, you said $myhostname before..."
7257 phostname='echo $myhostname';;
7263 : you do not want to know about this
7268 if $test "$myhostname" ; then
7270 rp='Your host name appears to be "'$myhostname'".'" Right?"
7278 : bad guess or no guess
7279 while $test "X$myhostname" = X ; do
7281 rp="Please type the (one word) name of your host:"
7286 : translate upper to lower if necessary
7287 case "$myhostname" in
7289 echo "(Normalizing case in your host name)"
7290 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
7294 case "$myhostname" in
7296 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
7297 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
7298 echo "(Trimming domain name from host name--host name is now $myhostname)"
7300 *) case "$mydomain" in
7303 test "X$hostcat" = "Xypcat hosts" &&
7304 ypmatch "$myhostname" hosts 2>/dev/null |\
7305 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
7308 test "X$hostcat" != "X" &&
7309 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
7310 /[ ]$myhostname[ . ]/p" > hosts
7313 if $test -f hosts; then
7314 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
7315 END { print sum }" hosts` = x1 || tmp_re="[ ]"
7316 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
7317 hosts | $sort | $uniq | \
7318 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
7319 case `$echo X$dflt` in
7320 X*\ *) echo "(Several hosts in the database matched hostname)"
7323 X.) echo "(You do not have fully-qualified names in the hosts database)"
7327 echo "(I cannot locate a hosts database anywhere)"
7332 tans=`./loc resolv.conf X /etc /usr/etc`
7333 if $test -f "$tans"; then
7334 echo "(Attempting domain name extraction from $tans)"
7335 dflt=.`$sed -n -e 's/ / /g' \
7336 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
7337 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
7339 .) dflt=.`$sed -n -e 's/ / /g' \
7340 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
7341 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
7348 .) echo "(No help from resolv.conf either -- attempting clever guess)"
7349 dflt=.`sh -c domainname 2>/dev/null`
7352 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
7357 .) echo "(Lost all hope -- silly guess then)"
7363 *) dflt="$mydomain";;
7367 rp="What is your domain name?"
7377 : translate upper to lower if necessary
7380 echo "(Normalizing case in your domain name)"
7381 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
7385 : a little sanity check here
7386 case "$phostname" in
7389 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
7390 $myhostname$mydomain|$myhostname) ;;
7392 case "$phostname" in
7394 echo "(That doesn't agree with your whoami.h file, by the way.)"
7397 echo "(That doesn't agree with your $phostname command, by the way.)"
7407 I need to get your e-mail address in Internet format if possible, i.e.
7408 something like user@host.domain. Please answer accurately since I have
7409 no easy means to double check it. The default value provided below
7410 is most probably close to reality but may not be valid from outside
7411 your organization...
7415 while test "$cont"; do
7417 '') dflt="$cf_by@$myhostname$mydomain";;
7418 *) dflt="$cf_email";;
7420 rp='What is your e-mail address?'
7426 rp='Address does not look like an Internet one. Use it anyway?'
7442 If you or somebody else will be maintaining perl at your site, please
7443 fill in the correct e-mail address here so that they may be contacted
7444 if necessary. Currently, the "perlbug" program included with perl
7445 will send mail to this address in addition to perlbug@perl.org. You may
7446 enter "none" for no administrator.
7449 case "$perladmin" in
7450 '') dflt="$cf_email";;
7451 *) dflt="$perladmin";;
7453 rp='Perl administrator e-mail address'
7457 : determine whether to only install version-specific parts.
7460 Do you want to install only the version-specific parts of the perl
7461 distribution? Usually you do *not* want to do this.
7463 case "$versiononly" in
7464 "$define"|[Yy]*|true) dflt='y' ;;
7467 rp="Do you want to install only the version-specific parts of perl?"
7470 [yY]*) val="$define";;
7476 : figure out how to guarantee perl startup
7477 case "$startperl" in
7479 case "$sharpbang" in
7483 I can use the #! construct to start perl on your system. This will
7484 make startup of perl scripts faster, but may cause problems if you
7485 want to share those scripts and perl is not in a standard place
7486 ($binexp/perl) on all your platforms. The alternative is to force
7487 a shell by starting the script with a single ':' character.
7490 case "$versiononly" in
7491 "$define") dflt="$binexp/perl$version";;
7492 *) dflt="$binexp/perl";;
7494 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
7497 none) startperl=": # use perl";;
7498 *) startperl="#!$ans"
7499 if $test 30 -lt `echo "$ans" | wc -c`; then
7502 WARNING: Some systems limit the #! command to 32 characters.
7503 If you experience difficulty running Perl scripts with #!, try
7504 installing Perl in a directory with a shorter pathname.
7510 *) startperl=": # use perl"
7515 echo "I'll use $startperl to start perl scripts."
7517 : figure best path for perl in scripts
7520 perlpath="$binexp/perl"
7521 case "$startperl" in
7526 I will use the "eval 'exec'" idiom to start Perl on your system.
7527 I can use the full path of your Perl binary for this purpose, but
7528 doing so may cause problems if you want to share those scripts and
7529 Perl is not always in a standard place ($binexp/perl).
7533 rp="What path shall I use in \"eval 'exec'\"?"
7540 case "$startperl" in
7542 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
7545 : determine where public executable scripts go
7546 set scriptdir scriptdir
7548 case "$scriptdir" in
7551 : guess some guesses
7552 $test -d /usr/share/scripts && dflt=/usr/share/scripts
7553 $test -d /usr/share/bin && dflt=/usr/share/bin
7554 $test -d /usr/local/script && dflt=/usr/local/script
7555 $test -d /usr/local/scripts && dflt=/usr/local/scripts
7556 $test -d $prefixexp/script && dflt=$prefixexp/script
7560 *) dflt="$scriptdir"
7565 Some installations have a separate directory just for executable scripts so
7566 that they can mount it across multiple architectures but keep the scripts in
7567 one spot. You might, for example, have a subdirectory of /usr/share for this.
7568 Or you might just lump your scripts in with all your other executables.
7572 rp='Where do you keep publicly executable scripts?'
7574 if $test "X$ansexp" != "X$scriptdirexp"; then
7578 scriptdirexp="$ansexp"
7579 : Change installation prefix, if necessary.
7580 if $test X"$prefix" != X"$installprefix"; then
7581 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
7583 installscript="$scriptdirexp"
7586 : determine where add-on public executables go
7588 '') dflt=$siteprefix/bin ;;
7592 rp='Pathname where the add-on public executables should be installed?'
7595 sitebinexp="$ansexp"
7596 : Change installation prefix, if necessary.
7597 if $test X"$prefix" != X"$installprefix"; then
7598 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
7600 installsitebin="$sitebinexp"
7603 case "$vendorprefix" in
7604 '') d_vendorbin="$undef"
7608 *) d_vendorbin="$define"
7609 : determine where vendor-supplied executables go.
7610 case "$vendorbin" in
7611 '') dflt=$vendorprefix/bin ;;
7612 *) dflt="$vendorbin" ;;
7615 rp='Pathname for the vendor-supplied executables directory?'
7618 vendorbinexp="$ansexp"
7621 : Change installation prefix, if necessary.
7622 if $test X"$prefix" != X"$installprefix"; then
7623 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
7625 installvendorbin="$vendorbinexp"
7628 : see if qgcvt exists
7634 if $test X"$d_longdbl" = X"$define"; then
7636 echo "Checking how to print long doubles..." >&4
7638 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
7639 $cat >try.c <<'EOCP'
7640 #include <sys/types.h>
7644 printf("%.3f\n", d);
7648 if eval $compile; then
7652 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
7653 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
7654 echo "We will use %f."
7660 if $test X"$sPRIfldbl" = X; then
7661 $cat >try.c <<'EOCP'
7662 #include <sys/types.h>
7665 long double d = 123.456;
7666 printf("%.3llf\n", d);
7670 if eval $compile; then
7674 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
7675 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
7676 echo "We will use %llf."
7682 if $test X"$sPRIfldbl" = X; then
7683 $cat >try.c <<'EOCP'
7684 #include <sys/types.h>
7687 long double d = 123.456;
7688 printf("%.3Lf\n", d);
7692 if eval $compile; then
7696 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
7697 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
7698 echo "We will use %Lf."
7704 if $test X"$sPRIfldbl" = X; then
7705 $cat >try.c <<'EOCP'
7706 #include <sys/types.h>
7709 long double d = 123.456;
7710 printf("%.3lf\n", d);
7714 if eval $compile; then
7718 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
7719 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
7720 echo "We will use %lf."
7726 if $test X"$sPRIfldbl" = X; then
7727 echo "Cannot figure out how to print long doubles." >&4
7729 sSCNfldbl=$sPRIfldbl # expect consistency
7736 case "$sPRIfldbl" in
7737 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
7738 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
7739 d_SCNfldbl="$undef";
7741 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
7742 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
7743 d_SCNfldbl="$define";
7747 : Check how to convert floats to strings.
7749 echo "Checking for an efficient way to convert floats to strings."
7751 case "$uselongdouble" in
7752 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
7754 case "$d_longdbl" in
7755 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
7757 case "$d_PRIgldbl" in
7758 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
7762 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
7763 char *myname = "gconvert";
7766 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
7767 char *myname = "gcvt";
7770 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
7771 char *myname = "qgcvt";
7772 #define DOUBLETYPE long double
7775 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE) && defined(HAS_PRIgldbl)
7776 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
7778 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
7780 char *myname = "sprintf";
7784 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
7785 #define DOUBLETYPE long double
7787 #define DOUBLETYPE double
7793 #define I_STDLIB $i_stdlib
7799 checkit(expect, got)
7803 if (strcmp(expect, got)) {
7804 printf("%s oddity: Expected %s, got %s\n",
7805 myname, expect, got);
7815 /* This must be 1st test on (which?) platform */
7816 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
7817 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
7818 checkit("0.1", buf);
7820 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
7823 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
7824 checkit("1.1", buf);
7826 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
7827 checkit("1.01", buf);
7829 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
7830 checkit("1.001", buf);
7832 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
7833 checkit("1.0001", buf);
7835 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
7836 checkit("1.00001", buf);
7838 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
7839 checkit("1.000001", buf);
7841 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
7844 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
7847 /* Some Linux gcvt's give 1.e+5 here. */
7848 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
7849 checkit("100000", buf);
7851 /* Some Linux gcvt's give -1.e+5 here. */
7852 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
7853 checkit("-100000", buf);
7855 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
7856 checkit("123.456", buf);
7861 case "$d_Gconvert" in
7862 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
7863 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
7864 sprintf*) xxx_list='sprintf gconvert gcvt' ;;
7865 *) xxx_list='gconvert gcvt sprintf' ;;
7868 case "$d_longdbl$uselongdouble$d_PRIgldbl" in
7869 "$define$define$define")
7870 # for long doubles prefer first qgcvt, then sprintf
7871 xxx_list="`echo $xxx_list|sed s/sprintf//`"
7872 xxx_list="sprintf $xxx_list"
7874 "$define") xxx_list="qgcvt $xxx_list" ;;
7879 for xxx_convert in $xxx_list; do
7880 echo "Trying $xxx_convert..."
7882 set try -DTRY_$xxx_convert
7883 if eval $compile; then
7884 echo "$xxx_convert() found." >&4
7886 echo "I'll use $xxx_convert to convert floats into a string." >&4
7889 echo "...But $xxx_convert didn't work as I expected."
7892 echo "$xxx_convert NOT found." >&4
7896 case "$xxx_convert" in
7897 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
7898 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
7899 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
7900 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
7901 "$define$define$define")
7902 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
7903 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
7908 : see if _fwalk exists
7912 : Initialize h_fcntl
7915 : Initialize h_sysfile
7918 : access call always available on UNIX
7922 : locate the flags for 'access()'
7926 $cat >access.c <<'EOCP'
7927 #include <sys/types.h>
7932 #include <sys/file.h>
7941 : check sys/file.h first, no particular reason here
7942 if $test `./findhdr sys/file.h` && \
7943 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
7945 echo "<sys/file.h> defines the *_OK access constants." >&4
7946 elif $test `./findhdr fcntl.h` && \
7947 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
7949 echo "<fcntl.h> defines the *_OK access constants." >&4
7950 elif $test `./findhdr unistd.h` && \
7951 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
7952 echo "<unistd.h> defines the *_OK access constants." >&4
7954 echo "I can't find the four *_OK access constants--I'll use mine." >&4
7960 : see if accessx exists
7961 set accessx d_accessx
7964 : see if alarm exists
7968 : see if atolf exists
7972 : see if atoll exists
7976 : Look for GNU-cc style attribute checking
7978 echo "Checking whether your compiler can handle __attribute__ ..." >&4
7979 $cat >attrib.c <<'EOCP'
7981 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
7983 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
7984 if $contains 'warning' attrib.out >/dev/null 2>&1; then
7985 echo "Your C compiler doesn't fully support __attribute__."
7988 echo "Your C compiler supports __attribute__."
7992 echo "Your C compiler doesn't seem to understand __attribute__ at all."
7999 : see if bcmp exists
8003 : see if bcopy exists
8007 : see if this is a unistd.h system
8008 set unistd.h i_unistd
8011 : see if getpgrp exists
8012 set getpgrp d_getpgrp
8015 case "$d_getpgrp" in
8018 echo "Checking to see which flavor of getpgrp is in use..."
8021 #include <sys/types.h>
8023 # include <unistd.h>
8027 if (getuid() == 0) {
8028 printf("(I see you are running Configure as super-user...)\n");
8032 if (getpgrp(1) == 0)
8041 if $cc -o set -DTRY_BSD_PGRP $ccflags $ldflags set.c $libs >/dev/null 2>&1 && ./set; then
8042 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
8044 elif $cc -o set $ccflags $ldflags set.c $libs >/dev/null 2>&1 && ./set; then
8045 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
8048 echo "I can't seem to compile and run the test program."
8050 xxx="a USG one, i.e. you use getpgrp()."
8052 # SVR4 systems can appear rather BSD-ish.
8055 xxx="a BSD one, i.e. you use getpgrp(pid)."
8059 xxx="probably a USG one, i.e. you use getpgrp()."
8064 echo "Assuming your getpgrp is $xxx" >&4
8073 : see if setpgrp exists
8074 set setpgrp d_setpgrp
8077 case "$d_setpgrp" in
8080 echo "Checking to see which flavor of setpgrp is in use..."
8083 #include <sys/types.h>
8085 # include <unistd.h>
8089 if (getuid() == 0) {
8090 printf("(I see you are running Configure as super-user...)\n");
8094 if (-1 == setpgrp(1, 1))
8097 if (setpgrp() != -1)
8103 if $cc -o set -DTRY_BSD_PGRP $ccflags $ldflags set.c $libs >/dev/null 2>&1 && ./set; then
8104 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
8106 elif $cc -o set $ccflags $ldflags set.c $libs >/dev/null 2>&1 && ./set; then
8107 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
8110 echo "(I can't seem to compile and run the test program.)"
8112 xxx="a USG one, i.e. you use setpgrp()."
8114 # SVR4 systems can appear rather BSD-ish.
8117 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
8121 xxx="probably a USG one, i.e. you use setpgrp()."
8126 echo "Assuming your setpgrp is $xxx" >&4
8134 : see if bzero exists
8138 : see if signal is declared as pointer to function returning int or void
8140 xxx=`./findhdr signal.h`
8141 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
8142 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
8143 echo "You have int (*signal())() instead of void." >&4
8145 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
8146 echo "You have void (*signal())()." >&4
8148 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
8149 echo "You have int (*signal())() instead of void." >&4
8151 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
8152 echo "You have void (*signal())()." >&4
8155 case "$d_voidsig" in
8157 echo "I can't determine whether signal handler returns void or int..." >&4
8159 rp="What type does your signal handler return?"
8166 echo "As you already told me, signal handler returns void." >&4
8169 *) echo "As you already told me, signal handler returns int." >&4
8176 case "$d_voidsig" in
8177 "$define") signal_t="void";;
8182 : check for ability to cast large floats to 32-bit ints.
8184 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
8185 if $test "$intsize" -ge 4; then
8192 #include <sys/types.h>
8194 $signal_t blech(s) int s; { exit(3); }
8201 signal(SIGFPE, blech);
8203 /* Don't let compiler optimize the test away. Store the number
8204 in a writable string for gcc to pass to sscanf under HP/UX.
8206 sprintf(str, "2147483647");
8207 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
8211 /* x86 processors will probably give 0x8000 0000, which is a
8212 sign change. We don't want that. We want to mimic SPARC
8213 behavior here, which is to preserve the sign and give
8216 if (i32 != ($xxx) f)
8222 if eval $compile_ok; then
8226 echo "(I can't seem to compile the test program--assuming it can't)"
8234 echo "Nope, it can't."
8241 : check for ability to cast negative floats to unsigned
8243 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
8246 #include <sys/types.h>
8248 $signal_t blech(s) int s; { exit(7); }
8249 $signal_t blech_in_list(s) int s; { exit(4); }
8250 unsigned long dummy_long(p) unsigned long p; { return p; }
8251 unsigned int dummy_int(p) unsigned int p; { return p; }
8252 unsigned short dummy_short(p) unsigned short p; { return p; }
8256 unsigned long along;
8258 unsigned short ashort;
8262 /* Frustrate gcc-2.7.2's optimizer which failed this test with
8263 a direct f = -123. assignment. gcc-2.8.0 reportedly
8264 optimized the whole file away
8266 /* Store the number in a writable string for gcc to pass to
8269 sprintf(str, "-123");
8270 sscanf(str, "%lf", &f); /* f = -123.; */
8272 signal(SIGFPE, blech);
8273 along = (unsigned long)f;
8274 aint = (unsigned int)f;
8275 ashort = (unsigned short)f;
8276 if (along != (unsigned long)-123)
8278 if (aint != (unsigned int)-123)
8280 if (ashort != (unsigned short)-123)
8282 sprintf(str, "1073741824.");
8283 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
8286 along = (unsigned long)f;
8287 if (along != 0x80000000)
8291 along = (unsigned long)f;
8292 if (along != 0x7fffffff)
8296 along = (unsigned long)f;
8297 if (along != 0x80000001)
8301 signal(SIGFPE, blech_in_list);
8302 sprintf(str, "123.");
8303 sscanf(str, "%lf", &f); /* f = 123.; */
8304 along = dummy_long((unsigned long)f);
8305 aint = dummy_int((unsigned int)f);
8306 ashort = dummy_short((unsigned short)f);
8307 if (along != (unsigned long)123)
8309 if (aint != (unsigned int)123)
8311 if (ashort != (unsigned short)123)
8318 if eval $compile_ok; then
8322 echo "(I can't seem to compile the test program--assuming it can't)"
8325 case "$castflags" in
8330 echo "Nope, it can't."
8337 : see if vprintf exists
8339 if set vprintf val -f d_vprintf; eval $csym; $val; then
8340 echo 'vprintf() found.' >&4
8342 $cat >vprintf.c <<'EOF'
8343 #include <varargs.h>
8345 int main() { xxx("foo"); }
8354 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
8358 if eval $compile && ./vprintf; then
8359 echo "Your vsprintf() returns (int)." >&4
8362 echo "Your vsprintf() returns (char*)." >&4
8366 echo 'vprintf() NOT found.' >&4
8376 : see if chown exists
8380 : see if chroot exists
8384 : see if chsize exists
8388 : check for const keyword
8390 echo 'Checking to see if your C compiler knows about "const"...' >&4
8391 $cat >const.c <<'EOCP'
8392 typedef struct spug { int drokk; } spug;
8399 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
8401 echo "Yup, it does."
8404 echo "Nope, it doesn't."
8409 : see if crypt exists
8411 if set crypt val -f d_crypt; eval $csym; $val; then
8412 echo 'crypt() found.' >&4
8416 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
8417 if $test -z "$cryptlib"; then
8418 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
8422 if $test -z "$cryptlib"; then
8423 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
8427 if $test -z "$cryptlib"; then
8428 cryptlib=`./loc libcrypt$_a "" $libpth`
8432 if $test -z "$cryptlib"; then
8433 echo 'crypt() NOT found.' >&4
8442 : get csh whereabouts
8444 'csh') val="$undef" ;;
8449 : Respect a hint or command line value for full_csh.
8451 '') full_csh=$csh ;;
8454 : see if cuserid exists
8455 set cuserid d_cuserid
8458 : see if this is a limits.h system
8459 set limits.h i_limits
8462 : see if this is a float.h system
8466 : See if number of significant digits in a double precision number is known
8468 $cat >dbl_dig.c <<EOM
8478 printf("Contains DBL_DIG");
8481 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
8482 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
8483 echo "DBL_DIG found." >&4
8486 echo "DBL_DIG NOT found." >&4
8493 : see if difftime exists
8494 set difftime d_difftime
8497 : see if this is a dirent system
8499 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
8501 echo "<dirent.h> found." >&4
8504 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
8505 echo "<sys/dir.h> found." >&4
8508 xinc=`./findhdr sys/ndir.h`
8510 echo "<dirent.h> NOT found." >&4
8515 : Look for type of directory structure.
8517 $cppstdin $cppflags $cppminus < "$xinc" > try.c
8519 case "$direntrytype" in
8522 $define) guess1='struct dirent' ;;
8523 *) guess1='struct direct' ;;
8526 *) guess1="$direntrytype"
8531 'struct dirent') guess2='struct direct' ;;
8532 *) guess2='struct dirent' ;;
8535 if $contains "$guess1" try.c >/dev/null 2>&1; then
8536 direntrytype="$guess1"
8537 echo "Your directory entries are $direntrytype." >&4
8538 elif $contains "$guess2" try.c >/dev/null 2>&1; then
8539 direntrytype="$guess2"
8540 echo "Your directory entries seem to be $direntrytype." >&4
8542 echo "I don't recognize your system's directory entries." >&4
8543 rp="What type is used for directory entries on this system?"
8551 : see if the directory entry stores field length
8553 $cppstdin $cppflags $cppminus < "$xinc" > try.c
8554 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
8555 echo "Good, your directory entry keeps length information in d_namlen." >&4
8558 echo "Your directory entry does not know about the d_namlen field." >&4
8565 : see if dlerror exists
8568 set dlerror d_dlerror
8572 : see if dlfcn is available
8580 On a few systems, the dynamically loaded modules that perl generates and uses
8581 will need a different extension than shared libs. The default will probably
8589 rp='What is the extension of dynamically loaded modules'
8598 : Check if dlsym need a leading underscore
8604 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
8605 $cat >dyna.c <<'EOM'
8614 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
8616 #include <sys/types.h>
8630 int mode = RTLD_LAZY ;
8632 handle = dlopen("./dyna.$dlext", mode) ;
8633 if (handle == NULL) {
8638 symbol = dlsym(handle, "fred") ;
8639 if (symbol == NULL) {
8640 /* try putting a leading underscore */
8641 symbol = dlsym(handle, "_fred") ;
8642 if (symbol == NULL) {
8655 : Call the object file tmp-dyna.o in case dlext=o.
8656 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
8657 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
8658 $ld -o dyna.$dlext $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
8659 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then
8662 1) echo "Test program failed using dlopen." >&4
8663 echo "Perhaps you should not use dynamic loading." >&4;;
8664 2) echo "Test program failed using dlsym." >&4
8665 echo "Perhaps you should not use dynamic loading." >&4;;
8666 3) echo "dlsym needs a leading underscore" >&4
8668 4) echo "dlsym doesn't need a leading underscore." >&4;;
8671 echo "I can't compile and run the test program." >&4
8672 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
8677 $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
8682 hasproto='varname=$1; func=$2; shift; shift;
8683 while $test $# -ge 2; do
8685 $define) echo "#include <$2>";;
8689 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
8690 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
8691 echo "$func() prototype found.";
8694 echo "$func() prototype NOT found.";
8699 $rm -f try.c tryout.c'
8701 : see if prototype for drand48 is available
8703 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
8706 : see if dup2 exists
8710 : see if eaccess exists
8711 set eaccess d_eaccess
8714 : see if endgrent exists
8715 set endgrent d_endgrent
8718 : see if endhostent exists
8719 set endhostent d_endhent
8722 : see if endnetent exists
8723 set endnetent d_endnent
8726 : see if endprotoent exists
8727 set endprotoent d_endpent
8730 : see if endpwent exists
8731 set endpwent d_endpwent
8734 : see if endservent exists
8735 set endservent d_endsent
8738 : Locate the flags for 'open()'
8740 $cat >open3.c <<'EOCP'
8741 #include <sys/types.h>
8746 #include <sys/file.h>
8757 : check sys/file.h first to get FREAD on Sun
8758 if $test `./findhdr sys/file.h` && \
8759 set open3 -DI_SYS_FILE && eval $compile; then
8761 echo "<sys/file.h> defines the O_* constants..." >&4
8763 echo "and you have the 3 argument form of open()." >&4
8766 echo "but not the 3 argument form of open(). Oh, well." >&4
8769 elif $test `./findhdr fcntl.h` && \
8770 set open3 -DI_FCNTL && eval $compile; then
8772 echo "<fcntl.h> defines the O_* constants..." >&4
8774 echo "and you have the 3 argument form of open()." >&4
8777 echo "but not the 3 argument form of open(). Oh, well." >&4
8782 echo "I can't find the O_* constant definitions! You got problems." >&4
8788 : see which of string.h or strings.h is needed
8790 strings=`./findhdr string.h`
8791 if $test "$strings" && $test -r "$strings"; then
8792 echo "Using <string.h> instead of <strings.h>." >&4
8796 strings=`./findhdr strings.h`
8797 if $test "$strings" && $test -r "$strings"; then
8798 echo "Using <strings.h> instead of <string.h>." >&4
8800 echo "No string header found -- You'll surely have problems." >&4
8806 "$undef") strings=`./findhdr strings.h`;;
8807 *) strings=`./findhdr string.h`;;
8810 : check for non-blocking I/O stuff
8811 case "$h_sysfile" in
8812 true) echo "#include <sys/file.h>" > head.c;;
8815 true) echo "#include <fcntl.h>" >> head.c;;
8816 *) echo "#include <sys/fcntl.h>" >> head.c;;
8819 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
8820 case "$o_nonblock" in
8823 $cat >>try.c <<'EOCP'
8827 printf("O_NONBLOCK\n");
8831 printf("O_NDELAY\n");
8835 printf("FNDELAY\n");
8842 if eval $compile_ok; then
8844 case "$o_nonblock" in
8845 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
8846 *) echo "Seems like we can use $o_nonblock.";;
8849 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
8852 *) echo "Using $hint value $o_nonblock.";;
8854 $rm -f try try.* .out core
8857 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
8863 #include <sys/types.h>
8866 #define MY_O_NONBLOCK $o_nonblock
8867 #ifndef errno /* XXX need better Configure test */
8878 #include <strings.h>
8880 $signal_t blech(x) int x; { exit(3); }
8882 $cat >> try.c <<'EOCP'
8890 pipe(pd); /* Down: child -> parent */
8891 pipe(pu); /* Up: parent -> child */
8894 close(pd[1]); /* Parent reads from pd[0] */
8895 close(pu[0]); /* Parent writes (blocking) to pu[1] */
8896 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
8898 signal(SIGALRM, blech);
8900 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
8902 sprintf(string, "%d\n", ret);
8903 write(2, string, strlen(string));
8906 if (errno == EAGAIN) {
8912 if (errno == EWOULDBLOCK)
8913 printf("EWOULDBLOCK\n");
8916 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
8917 sleep(2); /* Give it time to close our pipe */
8919 ret = read(pd[0], buf, 1); /* Should read EOF */
8921 sprintf(string, "%d\n", ret);
8922 write(3, string, strlen(string));
8926 close(pd[0]); /* We write to pd[1] */
8927 close(pu[1]); /* We read from pu[0] */
8928 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
8929 close(pd[1]); /* Pipe pd is now fully closed! */
8930 exit(0); /* Bye bye, thank you for playing! */
8934 if eval $compile_ok; then
8935 echo "$startsh" >mtry
8936 echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
8938 ./mtry >/dev/null 2>&1
8940 0) eagain=`$cat try.out`;;
8941 1) echo "Could not perform non-blocking setting!";;
8942 2) echo "I did a successful read() for something that was not there!";;
8943 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
8944 *) echo "Something terribly wrong happened during testing.";;
8946 rd_nodata=`$cat try.ret`
8947 echo "A read() system call with no data present returns $rd_nodata."
8948 case "$rd_nodata" in
8951 echo "(That's peculiar, fixing that to be -1.)"
8957 echo "Forcing errno EAGAIN on read() with no data available."
8961 echo "Your read() sets errno to $eagain when no data is available."
8964 status=`$cat try.err`
8966 0) echo "And it correctly returns 0 to signal EOF.";;
8967 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
8968 *) echo "However, your read() returns '$status' on EOF??";;
8971 if test "$status" = "$rd_nodata"; then
8972 echo "WARNING: you can't distinguish between EOF and no data!"
8976 echo "I can't compile the test program--assuming errno EAGAIN will do."
8983 echo "Using $hint value $eagain."
8984 echo "Your read() returns $rd_nodata when no data is present."
8985 case "$d_eofnblk" in
8986 "$define") echo "And you can see EOF because read() returns 0.";;
8987 "$undef") echo "But you can't see EOF status from read() returned value.";;
8989 echo "(Assuming you can't see EOF status from read anyway.)"
8995 $rm -f try try.* .out core head.c mtry
8997 : see if fchmod exists
9001 : see if fchown exists
9005 : see if this is an fcntl system
9010 : See if fcntl-based locking works.
9011 $cat >try.c <<'EOCP'
9016 #if defined(F_SETLK) && defined(F_SETLKW)
9019 fd = open("try.c", O_RDONLY);
9020 flock.l_type = F_RDLCK;
9021 flock.l_whence = SEEK_SET;
9022 flock.l_start = flock.l_len = 0;
9023 retval = fcntl(fd, F_SETLK, &flock);
9025 (retval < 0 ? exit(2) : exit(0));
9031 echo "Checking if fcntl-based file locking works... "
9035 if eval $compile_ok; then
9037 echo "Yes, it seems to work."
9040 echo "Nope, it didn't work."
9044 echo "I'm unable to compile the test program, so I'll assume not."
9049 echo "Nope, since you don't even have fcntl()."
9052 set d_fcntl_can_lock
9057 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
9058 while $test $# -ge 2; do
9060 $define) echo "#include <$2>";;
9064 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
9066 if eval $compile; then
9077 : see whether socket exists
9079 $echo $n "Hmm... $c" >&4
9080 if set socket val -f d_socket; eval $csym; $val; then
9081 echo "Looks like you have Berkeley networking support." >&4
9083 if set setsockopt val -f; eval $csym; $val; then
9086 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
9090 if $contains socklib libc.list >/dev/null 2>&1; then
9091 echo "Looks like you have Berkeley networking support." >&4
9093 : we will have to assume that it supports the 4.2 BSD interface
9096 echo "You don't have Berkeley networking in libc$_a..." >&4
9097 if test "X$d_socket" = "X$define"; then
9098 echo "...but you seem to believe that you have sockets." >&4
9100 for net in net socket
9102 if test -f /usr/lib/lib$net$_a; then
9103 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
9104 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
9105 if $contains socket libc.list >/dev/null 2>&1; then
9110 echo "...but the Wollongong group seems to have hacked it in." >&4
9111 sockethdr="-I/usr/netinclude"
9114 echo "Found Berkeley sockets interface in lib$net." >& 4
9115 if $contains setsockopt libc.list >/dev/null 2>&1; then
9118 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
9125 if test "X$d_socket" != "X$define"; then
9126 echo "or anywhere else I see." >&4
9134 : see if socketpair exists
9135 set socketpair d_sockpair
9140 echo "Checking the availability of certain socket constants..." >& 4
9141 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
9142 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
9144 #include <sys/types.h>
9145 #include <sys/socket.h>
9151 set try; if eval $compile; then
9154 set d_${enum}; eval $setvar
9158 : see if sys/select.h has to be included
9159 set sys/select.h i_sysselct
9162 : see if we should include time.h, sys/time.h, or both
9164 if test "X$timeincl" = X; then
9165 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9166 $echo $n "I'm now running the test program...$c"
9167 $cat >try.c <<'EOCP'
9168 #include <sys/types.h>
9173 #ifdef SYSTIMEKERNEL
9176 #include <sys/time.h>
9179 #include <sys/select.h>
9188 struct timezone tzp;
9190 if (foo.tm_sec == foo.tm_sec)
9193 if (bar.tv_sec == bar.tv_sec)
9200 for s_timezone in '-DS_TIMEZONE' ''; do
9202 for s_timeval in '-DS_TIMEVAL' ''; do
9203 for i_systimek in '' '-DSYSTIMEKERNEL'; do
9204 for i_time in '' '-DI_TIME'; do
9205 for i_systime in '-DI_SYSTIME' ''; do
9208 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
9209 if eval $compile; then
9210 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
9214 $echo $n "Succeeded with $flags$c"
9226 *SYSTIMEKERNEL*) i_systimek="$define"
9227 timeincl=`./findhdr sys/time.h`
9228 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
9229 *) i_systimek="$undef";;
9232 *I_TIME*) i_time="$define"
9233 timeincl=`./findhdr time.h`" $timeincl"
9234 echo "We'll include <time.h>." >&4;;
9235 *) i_time="$undef";;
9238 *I_SYSTIME*) i_systime="$define"
9239 timeincl=`./findhdr sys/time.h`" $timeincl"
9240 echo "We'll include <sys/time.h>." >&4;;
9241 *) i_systime="$undef";;
9246 : check for fd_set items
9249 Checking to see how well your C compiler handles fd_set and friends ...
9251 $cat >fd_set.c <<EOCP
9252 #$i_systime I_SYS_TIME
9253 #$i_sysselct I_SYS_SELECT
9254 #$d_socket HAS_SOCKET
9255 #include <sys/types.h>
9257 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
9260 #include <sys/time.h>
9263 #include <sys/select.h>
9272 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
9279 set fd_set -DTRYBITS
9280 if eval $compile; then
9281 d_fds_bits="$define"
9283 echo "Well, your system knows about the normal fd_set typedef..." >&4
9285 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
9286 d_fd_macros="$define"
9289 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
9291 d_fd_macros="$undef"
9295 Hmm, your compiler has some difficulty with fd_set. Checking further...
9298 if eval $compile; then
9301 echo "Well, your system has some sort of fd_set available..." >&4
9303 echo "and you have the normal fd_set macros." >&4
9304 d_fd_macros="$define"
9307 but not the normal fd_set macros! Gross! More work for me...
9309 d_fd_macros="$undef"
9312 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
9315 d_fd_macros="$undef"
9320 : see if fgetpos exists
9321 set fgetpos d_fgetpos
9324 : see if flock exists
9328 : see if fork exists
9332 : see if pathconf exists
9333 set pathconf d_pathconf
9336 : see if fpathconf exists
9337 set fpathconf d_fpathconf
9341 : check for fpos64_t
9343 echo "Checking to see if you have fpos64_t..." >&4
9346 int main() { fpos64_t x = 7; }
9349 if eval $compile; then
9351 echo "You have fpos64_t."
9354 echo "You do not have fpos64_t."
9356 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
9363 : see if frexpl exists
9367 hasstruct='varname=$1; struct=$2; shift; shift;
9368 while $test $# -ge 2; do
9370 $define) echo "#include <$2>";;
9374 echo "int main () { struct $struct foo; }" >> try.c;
9376 if eval $compile; then
9385 : see if this is a sys/param system
9386 set sys/param.h i_sysparam
9389 : see if this is a sys/mount.h system
9390 set sys/mount.h i_sysmount
9393 : see if sys/types.h has to be included
9394 set sys/types.h i_systypes
9399 echo "Checking to see if your system supports struct fs_data..." >&4
9400 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
9402 case "$d_fs_data_s" in
9403 "$define") echo "Yes, it does." ;;
9404 *) echo "No, it doesn't." ;;
9407 : see if fseeko exists
9411 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
9414 : see if fsetpos exists
9415 set fsetpos d_fsetpos
9419 : see if fstatfs exists
9420 set fstatfs d_fstatfs
9424 : see if statvfs exists
9425 set statvfs d_statvfs
9428 : see if fstatvfs exists
9429 set fstatvfs d_fstatvfs
9433 : see if fsync exists
9437 : see if ftello exists
9441 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
9444 : see if getcwd exists
9448 : see if getespwnam exists
9449 set getespwnam d_getespwnam
9453 : see if getfsstat exists
9454 set getfsstat d_getfsstat
9457 : see if getgrent exists
9458 set getgrent d_getgrent
9461 : see if gethostbyaddr exists
9462 set gethostbyaddr d_gethbyaddr
9465 : see if gethostbyname exists
9466 set gethostbyname d_gethbyname
9469 : see if gethostent exists
9470 set gethostent d_gethent
9473 : see how we will look up host name
9476 if set gethostname val -f d_gethname; eval $csym; $val; then
9477 echo 'gethostname() found.' >&4
9478 d_gethname="$define"
9481 if set uname val -f d_uname; eval $csym; $val; then
9484 uname() was found, but you're running xenix, and older versions of xenix
9485 have a broken uname(). If you don't really know whether your xenix is old
9486 enough to have a broken system call, use the default answer.
9493 rp='Is your uname() broken?'
9496 n*) d_uname="$define"; call=uname;;
9499 echo 'uname() found.' >&4
9506 case "$d_gethname" in
9507 '') d_gethname="$undef";;
9510 '') d_uname="$undef";;
9512 case "$d_uname$d_gethname" in
9517 Every now and then someone has a $call() that lies about the hostname
9518 but can't be fixed for political or economic reasons. If you wish, I can
9519 pretend $call() isn't there and maybe compute hostname at run-time
9520 thanks to the '$phostname' command.
9523 rp="Shall I ignore $call() from now on?"
9526 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
9529 case "$phostname" in
9531 *) case "$aphostname" in
9537 file=`./loc $file $file $pth`
9538 aphostname=`echo $file $*`
9543 case "$d_uname$d_gethname" in
9546 case "$phostname" in
9548 echo "There will be no way for $package to get your hostname." >&4;;
9550 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
9554 case "$d_phostname" in
9555 '') d_phostname="$undef";;
9558 : see if this is a netdb.h system
9562 : see if prototypes for various gethostxxx netdb.h functions are available
9564 set d_gethostprotos gethostent $i_netdb netdb.h
9567 : see if getlogin exists
9568 set getlogin d_getlogin
9571 : see if getmnt exists
9575 : see if getmntent exists
9576 set getmntent d_getmntent
9579 : see if getnetbyaddr exists
9580 set getnetbyaddr d_getnbyaddr
9583 : see if getnetbyname exists
9584 set getnetbyname d_getnbyname
9587 : see if getnetent exists
9588 set getnetent d_getnent
9591 : see if prototypes for various getnetxxx netdb.h functions are available
9593 set d_getnetprotos getnetent $i_netdb netdb.h
9596 : see if getpagesize exists
9597 set getpagesize d_getpagsz
9601 : see if getprotobyname exists
9602 set getprotobyname d_getpbyname
9605 : see if getprotobynumber exists
9606 set getprotobynumber d_getpbynumber
9609 : see if getprotoent exists
9610 set getprotoent d_getpent
9613 : see if getpgid exists
9614 set getpgid d_getpgid
9617 : see if getpgrp2 exists
9618 set getpgrp2 d_getpgrp2
9621 : see if getppid exists
9622 set getppid d_getppid
9625 : see if getpriority exists
9626 set getpriority d_getprior
9629 : see if prototypes for various getprotoxxx netdb.h functions are available
9631 set d_getprotoprotos getprotoent $i_netdb netdb.h
9634 : see if getprpwnam exists
9635 set getprpwnam d_getprpwnam
9638 : see if getpwent exists
9639 set getpwent d_getpwent
9643 : see if getservbyname exists
9644 set getservbyname d_getsbyname
9647 : see if getservbyport exists
9648 set getservbyport d_getsbyport
9651 : see if getservent exists
9652 set getservent d_getsent
9655 : see if prototypes for various getservxxx netdb.h functions are available
9657 set d_getservprotos getservent $i_netdb netdb.h
9660 : see if getspnam exists
9661 set getspnam d_getspnam
9664 : see if gettimeofday or ftime exists
9665 set gettimeofday d_gettimeod
9667 case "$d_gettimeod" in
9673 val="$undef"; set d_ftime; eval $setvar
9676 case "$d_gettimeod$d_ftime" in
9679 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
9683 : see if this is an grp system
9689 xxx=`./findhdr grp.h`
9690 $cppstdin $cppflags $cppminus < $xxx >$$.h
9692 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
9704 set d_grpasswd; eval $setvar
9708 : see if hasmntopt exists
9709 set hasmntopt d_hasmntopt
9712 : see if this is a netinet/in.h or sys/in.h system
9713 set netinet/in.h i_niin sys/in.h i_sysin
9716 : see if arpa/inet.h has to be included
9717 set arpa/inet.h i_arpainet
9720 : see if htonl --and friends-- exists
9725 : Maybe they are macros.
9730 #include <sys/types.h>
9731 #$i_niin I_NETINET_IN
9733 #$i_arpainet I_ARPA_INET
9735 #include <netinet/in.h>
9741 #include <arpa/inet.h>
9744 printf("Defined as a macro.");
9747 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
9748 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
9750 echo "But it seems to be defined as a macro." >&4
9758 : see if iconv exists
9764 if set index val -f; eval $csym; $val; then
9765 if set strchr val -f d_strchr; eval $csym; $val; then
9766 if $contains strchr "$strings" >/dev/null 2>&1 ; then
9769 echo "strchr() found." >&4
9773 echo "index() found." >&4
9778 echo "index() found." >&4
9781 if set strchr val -f d_strchr; eval $csym; $val; then
9784 echo "strchr() found." >&4
9786 echo "No index() or strchr() found!" >&4
9791 set d_strchr; eval $setvar
9793 set d_index; eval $setvar
9795 : check whether inet_aton exists
9796 set inet_aton d_inetaton
9799 : see if inttypes.h is available
9800 : we want a real compile instead of Inhdr because some systems
9801 : have an inttypes.h which includes non-existent headers
9804 #include <inttypes.h>
9806 static int32_t foo32 = 0x12345678;
9810 if eval $compile; then
9811 echo "<inttypes.h> found." >&4
9814 echo "<inttypes.h> NOT found." >&4
9823 echo "Checking to see if you have int64_t..." >&4
9825 #include <sys/types.h>
9826 #$i_inttypes I_INTTYPES
9828 #include <inttypes.h>
9830 int main() { int64_t x = 7; }
9833 if eval $compile; then
9835 echo "You have int64_t."
9838 echo "You do not have int64_t."
9846 $cat >isascii.c <<'EOCP'
9858 if eval $compile; then
9859 echo "isascii() found." >&4
9862 echo "isascii() NOT found." >&4
9869 : see if isnan exists
9873 : see if isnanl exists
9877 : see if killpg exists
9881 : see if lchown exists
9883 $cat > try.c <<'EOCP'
9884 /* System header to define __stub macros and hopefully few prototypes,
9885 which can conflict with char lchown(); below. */
9887 /* Override any gcc2 internal prototype to avoid an error. */
9888 /* We use char because int might match the return type of a gcc2
9889 builtin and then its argument prototype would still apply. */
9892 /* The GNU C library defines this for functions which it implements
9893 to always fail with ENOSYS. Some functions are actually named
9894 something starting with __ and the normal name is an alias. */
9895 #if defined (__stub_lchown) || defined (__stub___lchown)
9903 if eval $compile; then
9904 $echo "lchown() found." >&4
9907 $echo "lchown() NOT found." >&4
9913 : See if number of significant digits in a double precision number is known
9915 $cat >ldbl_dig.c <<EOM
9925 printf("Contains LDBL_DIG");
9928 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
9929 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
9930 echo "LDBL_DIG found." >&4
9933 echo "LDBL_DIG NOT found." >&4
9940 : see if link exists
9944 : see if localeconv exists
9945 set localeconv d_locconv
9948 : see if lockf exists
9952 : check for long long
9954 echo "Checking to see if you have long long..." >&4
9955 echo 'int main() { long long x = 7; return 0; }' > try.c
9957 if eval $compile; then
9959 echo "You have long long."
9962 echo "You do not have long long."
9968 : check for length of long long
9969 case "${d_longlong}${longlongsize}" in
9972 echo "Checking to see how big your long longs are..." >&4
9973 $cat >try.c <<'EOCP'
9977 printf("%d\n", (int)sizeof(long long));
9982 if eval $compile_ok; then
9983 longlongsize=`./try$exe_ext`
9984 echo "Your long longs are $longlongsize bytes long."
9988 echo "(I can't seem to compile the test program. Guessing...)"
9989 rp="What is the size of a long long (in bytes)?"
9993 if $test "X$longsize" = "X$longlongsize"; then
9994 echo "(That isn't any different from an ordinary long.)"
10000 : see if prototype for lseek is available
10002 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
10005 : see if lstat exists
10009 : see if madvise exists
10010 set madvise d_madvise
10013 : see if mblen exists
10017 : see if mbstowcs exists
10018 set mbstowcs d_mbstowcs
10021 : see if mbtowc exists
10022 set mbtowc d_mbtowc
10025 : see if memchr exists
10026 set memchr d_memchr
10029 : see if memcmp exists
10030 set memcmp d_memcmp
10033 : see if memcpy exists
10034 set memcpy d_memcpy
10037 : see if memmove exists
10038 set memmove d_memmove
10041 : see if memset exists
10042 set memset d_memset
10045 : see if mkdir exists
10049 : see if mkdtemp exists
10050 set mkdtemp d_mkdtemp
10053 : see if mkfifo exists
10054 set mkfifo d_mkfifo
10057 : see if mkstemp exists
10058 set mkstemp d_mkstemp
10061 : see if mkstemps exists
10062 set mkstemps d_mkstemps
10065 : see if mktime exists
10066 set mktime d_mktime
10069 : see if this is a sys/mman.h system
10070 set sys/mman.h i_sysmman
10073 : see if mmap exists
10076 : see what shmat returns
10077 : default to something harmless
10079 case "$i_sysmman$d_mmap" in
10081 $cat >mmap.c <<'END'
10082 #include <sys/mman.h>
10085 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
10090 echo "and it returns ($mmaptype)." >&4
10096 : see if modfl exists
10100 : see if mprotect exists
10101 set mprotect d_mprotect
10104 : see if msgctl exists
10105 set msgctl d_msgctl
10108 : see if msgget exists
10109 set msgget d_msgget
10112 : see if msgsnd exists
10113 set msgsnd d_msgsnd
10116 : see if msgrcv exists
10117 set msgrcv d_msgrcv
10120 : see how much of the 'msg*(2)' library is present.
10123 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
10124 *"$undef"*) h_msg=false;;
10128 case "`ipcs 2>&1`" in
10129 "SVID messages"*"not configured"*)
10130 echo "Your $osname does not have the msg*(2) configured." >&4
10133 set msgctl d_msgctl
10135 set msgget d_msgget
10137 set msgsnd d_msgsnd
10139 set msgrcv d_msgrcv
10145 : we could also check for sys/ipc.h ...
10146 if $h_msg && $test `./findhdr sys/msg.h`; then
10147 echo "You have the full msg*(2) library." >&4
10150 echo "You don't have the full msg*(2) library." >&4
10156 : see if msync exists
10160 : see if munmap exists
10161 set munmap d_munmap
10164 : see if nice exists
10170 echo "Checking which 64-bit integer type we could use..." >&4
10176 val='"unsigned int"'
10181 *) case "$longsize" in
10185 val='"unsigned long"'
10190 *) case "$d_longlong:$longlongsize" in
10195 val='"unsigned long long"'
10200 *) case "$d_int64_t" in
10218 case "$quadtype" in
10219 '') echo "Alas, no 64-bit integer types in sight." >&4
10222 *) if test X"$use64bitint" = Xdefine -o X"$longsize" = X8; then
10227 echo "We $verb use '$quadtype' for 64-bit integers." >&4
10232 : check for length of character
10234 case "$charsize" in
10236 echo "Checking to see how big your characters are (hey, you never know)..." >&4
10237 $cat >try.c <<'EOCP'
10241 printf("%d\n", (int)sizeof(char));
10246 if eval $compile_ok; then
10250 echo "(I can't seem to compile the test program. Guessing...)"
10257 rp="What is the size of a character (in bytes)?"
10262 : check for volatile keyword
10264 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
10265 $cat >try.c <<'EOCP'
10268 typedef struct _goo_struct goo_struct;
10269 goo_struct * volatile goo = ((goo_struct *)0);
10270 struct _goo_struct {
10275 typedef unsigned short foo_t;
10276 char *volatile foo;
10278 volatile foo_t blech;
10282 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
10284 echo "Yup, it does."
10287 echo "Nope, it doesn't."
10295 $echo "Choosing the C types to be used for Perl's internal types..." >&4
10297 case "$use64bitint:$d_quad:$quadtype" in
10300 uvtype="$uquadtype"
10305 uvtype="unsigned long"
10311 case "$uselongdouble:$d_longdbl" in
10313 nvtype="long double"
10314 nvsize=$longdblsize
10321 $echo "(IV will be "$ivtype", $ivsize bytes)"
10322 $echo "(UV will be "$uvtype", $uvsize bytes)"
10323 $echo "(NV will be "$nvtype", $nvsize bytes)"
10326 #$i_inttypes I_INTTYPES
10328 #include <inttypes.h>
10333 int8_t i = INT8_MAX;
10334 uint8_t u = UINT8_MAX;
10335 printf("int8_t\n");
10338 int16_t i = INT16_MAX;
10339 uint16_t i = UINT16_MAX;
10340 printf("int16_t\n");
10343 int32_t i = INT32_MAX;
10344 uint32_t u = UINT32_MAX;
10345 printf("int32_t\n");
10351 '') case "$charsize" in
10353 u8type="unsigned char"
10362 if eval $compile; then
10363 case "`./try$exe_ext`" in
10364 int8_t) i8type=int8_t
10374 '') if $test $charsize -ge 1; then
10376 u8type="unsigned char"
10384 '') case "$shortsize" in
10386 u16type="unsigned short"
10394 '') set try -DINT16
10395 if eval $compile; then
10396 case "`./try$exe_ext`" in
10408 '') if $test $shortsize -ge 2; then
10410 u16type="unsigned short"
10418 '') case "$longsize" in
10420 u32type="unsigned long"
10424 *) case "$intsize" in
10426 u32type="unsigned int"
10436 '') set try -DINT32
10437 if eval $compile; then
10438 case "`./try$exe_ext`" in
10450 '') if $test $intsize -ge 4; then
10452 u32type="unsigned int"
10460 '') case "$d_quad:$quadtype" in
10462 i64type="$quadtype"
10463 u64type="$uquadtype"
10471 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
10472 : volatile so that the compiler has to store it out to memory.
10473 if test X"$d_volatile" = X"$define"; then
10478 #include <sys/types.h>
10479 #include <signal.h>
10481 $volatile int bletched = 0;
10482 $signal_t blech(s) int s; { bletched = 1; }
10487 int n = 8 * $uvsize;
10490 signal(SIGFPE, blech);
10493 for (i = 0; i < n; i++) {
10494 u = u << 1 | ($uvtype)1;
10496 if (($uvtype)d != u)
10500 d = ($nvtype)(u - 1);
10501 if (($uvtype)d != (u - 1))
10509 printf("%d\n", ((i == n) ? -n : i));
10515 d_nv_preserves_uv="$undef"
10516 if eval $compile; then
10517 d_nv_preserves_uv_bits="`./try$exe_ext`"
10519 case "$d_nv_preserves_uv_bits" in
10521 d_nv_preserves_uv_bits=`expr 0 - $d_nv_preserves_uv_bits`
10522 $echo "Your NVs can preserve all $d_nv_preserves_uv_bits bits of your UVs." 2>&1
10523 d_nv_preserves_uv="$define"
10525 [1-9]*) $echo "Your NVs can preserve only $d_nv_preserves_uv_bits bits of your UVs." 2>&1
10526 d_nv_preserves_uv="$undef" ;;
10527 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
10528 d_nv_preserves_uv_bits="$undef" ;;
10534 : check for off64_t
10536 echo "Checking to see if you have off64_t..." >&4
10538 #include <sys/types.h>
10539 #include <unistd.h>
10540 int main() { off64_t x = 7; }
10543 if eval $compile; then
10545 echo "You have off64_t."
10548 echo "You do not have off64_t."
10549 case "$lseeksize" in
10550 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
10557 : see if POSIX threads are available
10558 set pthread.h i_pthread
10564 : how to create joinable pthreads
10565 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
10567 echo "Checking what constant to use for creating joinable pthreads..." >&4
10568 $cat >try.c <<'EOCP'
10569 #include <pthread.h>
10571 int detachstate = JOINABLE;
10574 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
10575 if eval $compile; then
10576 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
10577 val="$undef" # Yes, undef.
10578 set d_old_pthread_create_joinable
10581 set old_pthread_create_joinable
10584 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
10585 if eval $compile; then
10586 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
10588 set d_old_pthread_create_joinable
10590 val=PTHREAD_CREATE_UNDETACHED
10591 set old_pthread_create_joinable
10594 set try -DJOINABLE=__UNDETACHED
10595 if eval $compile; then
10596 echo "You seem to use __UNDETACHED." >&4
10598 set d_old_pthread_create_joinable
10601 set old_pthread_create_joinable
10604 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
10606 set d_old_pthread_create_joinable
10609 set old_pthread_create_joinable
10616 d_old_pthread_create_joinable="$undef"
10617 old_pthread_create_joinable=""
10620 : see if pause exists
10624 : see if pipe exists
10628 : see if poll exists
10633 : see whether the various POSIXish _yields exist
10635 #include <pthread.h>
10641 #ifdef PTHREAD_YIELD
10644 #ifdef PTHREAD_YIELD_NULL
10645 pthread_yield(NULL);
10651 : see if sched_yield exists
10652 set try -DSCHED_YIELD
10653 if eval $compile; then
10655 sched_yield='sched_yield()'
10659 case "$usethreads" in
10662 $define) echo 'sched_yield() found.' >&4 ;;
10663 *) echo 'sched_yield() NOT found.' >&4 ;;
10669 : see if pthread_yield exists
10670 set try -DPTHREAD_YIELD
10671 if eval $compile; then
10673 case "$sched_yield" in
10674 '') sched_yield='pthread_yield()' ;;
10677 set try -DPTHREAD_YIELD_NULL
10678 if eval $compile; then
10680 case "$sched_yield" in
10681 '') sched_yield='pthread_yield(NULL)' ;;
10687 case "$usethreads" in
10690 $define) echo 'pthread_yield() found.' >&4 ;;
10691 *) echo 'pthread_yield() NOT found.' >&4 ;;
10695 set d_pthread_yield
10698 case "$sched_yield" in
10699 '') sched_yield=undef ;;
10704 : see if this is a pwd.h system
10710 xxx=`./findhdr pwd.h`
10711 $cppstdin $cppflags $cppminus < $xxx >$$.h
10713 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
10721 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
10729 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
10737 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
10745 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
10753 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
10761 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
10769 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
10781 set d_pwquota; eval $setvar
10782 set d_pwage; eval $setvar
10783 set d_pwchange; eval $setvar
10784 set d_pwclass; eval $setvar
10785 set d_pwexpire; eval $setvar
10786 set d_pwcomment; eval $setvar
10787 set d_pwgecos; eval $setvar
10788 set d_pwpasswd; eval $setvar
10792 : see if readdir and friends exist
10793 set readdir d_readdir
10795 set seekdir d_seekdir
10797 set telldir d_telldir
10799 set rewinddir d_rewinddir
10802 : see if readlink exists
10803 set readlink d_readlink
10806 : see if rename exists
10807 set rename d_rename
10810 : see if rmdir exists
10814 : see if memory.h is available.
10819 : See if it conflicts with string.h
10825 $cppstdin $cppflags $cppminus < $strings > mem.h
10826 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
10828 echo "We won't be including <memory.h>."
10838 : can bcopy handle overlapping blocks?
10843 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
10845 #$i_memory I_MEMORY
10846 #$i_stdlib I_STDLIB
10847 #$i_string I_STRING
10848 #$i_unistd I_UNISTD
10850 $cat >>try.c <<'EOCP'
10853 # include <memory.h>
10856 # include <stdlib.h>
10859 # include <string.h>
10861 # include <strings.h>
10864 # include <unistd.h> /* Needed for NetBSD */
10868 char buf[128], abc[128];
10874 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
10876 for (align = 7; align >= 0; align--) {
10877 for (len = 36; len; len--) {
10879 bcopy(abc, b, len);
10880 for (off = 1; off <= len; off++) {
10881 bcopy(b, b+off, len);
10882 bcopy(b+off, b, len);
10883 if (bcmp(b, abc, len))
10892 if eval $compile_ok; then
10893 if ./try 2>/dev/null; then
10894 echo "Yes, it can."
10897 echo "It can't, sorry."
10898 case "$d_memmove" in
10899 "$define") echo "But that's Ok since you have memmove()." ;;
10903 echo "(I can't compile the test program, so we'll assume not...)"
10904 case "$d_memmove" in
10905 "$define") echo "But that's Ok since you have memmove()." ;;
10910 $rm -f try.* try core
10914 : can memcpy handle overlapping blocks?
10916 case "$d_memcpy" in
10919 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
10921 #$i_memory I_MEMORY
10922 #$i_stdlib I_STDLIB
10923 #$i_string I_STRING
10924 #$i_unistd I_UNISTD
10926 $cat >>try.c <<'EOCP'
10929 # include <memory.h>
10932 # include <stdlib.h>
10935 # include <string.h>
10937 # include <strings.h>
10940 # include <unistd.h> /* Needed for NetBSD */
10944 char buf[128], abc[128];
10950 /* Copy "abcde..." string to char abc[] so that gcc doesn't
10951 try to store the string in read-only memory. */
10952 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
10954 for (align = 7; align >= 0; align--) {
10955 for (len = 36; len; len--) {
10957 memcpy(b, abc, len);
10958 for (off = 1; off <= len; off++) {
10959 memcpy(b+off, b, len);
10960 memcpy(b, b+off, len);
10961 if (memcmp(b, abc, len))
10970 if eval $compile_ok; then
10971 if ./try 2>/dev/null; then
10972 echo "Yes, it can."
10975 echo "It can't, sorry."
10976 case "$d_memmove" in
10977 "$define") echo "But that's Ok since you have memmove()." ;;
10981 echo "(I can't compile the test program, so we'll assume not...)"
10982 case "$d_memmove" in
10983 "$define") echo "But that's Ok since you have memmove()." ;;
10988 $rm -f try.* try core
10992 : can memcmp be trusted to compare relative magnitude?
10994 case "$d_memcmp" in
10997 echo "Checking if your memcmp() can compare relative magnitude..." >&4
10999 #$i_memory I_MEMORY
11000 #$i_stdlib I_STDLIB
11001 #$i_string I_STRING
11002 #$i_unistd I_UNISTD
11004 $cat >>try.c <<'EOCP'
11007 # include <memory.h>
11010 # include <stdlib.h>
11013 # include <string.h>
11015 # include <strings.h>
11018 # include <unistd.h> /* Needed for NetBSD */
11024 if ((a < b) && memcmp(&a, &b, 1) < 0)
11030 if eval $compile_ok; then
11031 if ./try 2>/dev/null; then
11032 echo "Yes, it can."
11035 echo "No, it can't (it uses signed chars)."
11038 echo "(I can't compile the test program, so we'll assume not...)"
11042 $rm -f try.* try core
11046 : see if prototype for sbrk is available
11048 set d_sbrkproto sbrk $i_unistd unistd.h
11051 : see if select exists
11052 set select d_select
11055 : see if semctl exists
11056 set semctl d_semctl
11059 : see if semget exists
11060 set semget d_semget
11063 : see if semop exists
11067 : see how much of the 'sem*(2)' library is present.
11070 case "$d_semctl$d_semget$d_semop" in
11071 *"$undef"*) h_sem=false;;
11075 case "`ipcs 2>&1`" in
11076 "SVID messages"*"not configured"*)
11077 echo "Your $osname does not have the sem*(2) configured." >&4
11080 set semctl d_semctl
11082 set semget d_semget
11090 : we could also check for sys/ipc.h ...
11091 if $h_sem && $test `./findhdr sys/sem.h`; then
11092 echo "You have the full sem*(2) library." >&4
11095 echo "You don't have the full sem*(2) library." >&4
11101 : see whether sys/sem.h defines union semun
11103 $cat > try.c <<'END'
11104 #include <sys/types.h>
11105 #include <sys/ipc.h>
11106 #include <sys/sem.h>
11107 int main () { union semun semun; semun.buf = 0; }
11110 if eval $compile; then
11111 echo "You have union semun in <sys/sem.h>." >&4
11114 echo "You do not have union semun in <sys/sem.h>." >&4
11117 $rm -f try try.c try.h
11121 : see how to do semctl IPC_STAT
11124 : see whether semctl IPC_STAT can use union semun
11129 # define S_IRUSR S_IREAD
11130 # define S_IWUSR S_IWRITE
11131 # define S_IXUSR S_IEXEC
11133 # define S_IRUSR 0400
11134 # define S_IWUSR 0200
11135 # define S_IXUSR 0100
11137 # define S_IRGRP (S_IRUSR>>3)
11138 # define S_IWGRP (S_IWUSR>>3)
11139 # define S_IXGRP (S_IXUSR>>3)
11140 # define S_IROTH (S_IRUSR>>6)
11141 # define S_IWOTH (S_IWUSR>>6)
11142 # define S_IXOTH (S_IXUSR>>6)
11145 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
11146 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
11147 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
11152 #include <sys/types.h>
11153 #include <sys/ipc.h>
11154 #include <sys/sem.h>
11155 #include <sys/stat.h>
11162 #$d_union_semun HAS_UNION_SEMUN
11165 #ifndef HAS_UNION_SEMUN
11168 struct semid_ds *buf;
11169 unsigned short *array;
11175 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
11176 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
11178 struct semid_ds argbuf;
11181 st = semctl(sem, 0, IPC_STAT, arg);
11185 # endif /* IPC_STAT */
11186 printf("semctl IPC_STAT failed: errno = %d\n", errno);
11188 if (semctl(sem, 0, IPC_RMID, arg) != 0)
11189 # endif /* IPC_RMID */
11190 printf("semctl IPC_RMID failed: errno = %d\n", errno);
11192 #endif /* IPC_PRIVATE && ... */
11193 printf("semget failed: errno = %d\n", errno);
11199 if eval $compile; then
11202 semun) val="$define" ;;
11208 case "$d_semctl_semun" in
11210 echo "You can use union semun for semctl IPC_STAT." >&4
11213 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
11218 : see whether semctl IPC_STAT can use struct semid_ds pointer
11219 $cat > try.c <<'END'
11220 #include <sys/types.h>
11221 #include <sys/ipc.h>
11222 #include <sys/sem.h>
11223 #include <sys/stat.h>
11231 struct semid_ds arg;
11234 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
11235 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
11238 st = semctl(sem, 0, IPC_STAT, &arg);
11240 printf("semid_ds\n");
11242 # endif /* IPC_STAT */
11243 printf("semctl IPC_STAT failed: errno = %d\n", errno);
11245 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
11246 # endif /* IPC_RMID */
11247 printf("semctl IPC_RMID failed: errno = %d\n", errno);
11249 #endif /* IPC_PRIVATE && ... */
11250 printf("semget failed: errno = %d\n", errno);
11257 if eval $compile; then
11260 semid_ds) val="$define" ;;
11264 set d_semctl_semid_ds
11266 case "$d_semctl_semid_ds" in
11268 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
11270 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
11277 # We do not have the full sem*(2) library, so assume we can not
11283 set d_semctl_semid_ds
11288 : see if setegid exists
11289 set setegid d_setegid
11292 : see if seteuid exists
11293 set seteuid d_seteuid
11296 : see if setgrent exists
11297 set setgrent d_setgrent
11300 : see if sethostent exists
11301 set sethostent d_sethent
11304 : see if setlinebuf exists
11305 set setlinebuf d_setlinebuf
11308 : see if setlocale exists
11309 set setlocale d_setlocale
11312 : see if setnetent exists
11313 set setnetent d_setnent
11316 : see if setprotoent exists
11317 set setprotoent d_setpent
11320 : see if setpgid exists
11321 set setpgid d_setpgid
11324 : see if setpgrp2 exists
11325 set setpgrp2 d_setpgrp2
11328 : see if setpriority exists
11329 set setpriority d_setprior
11332 : see if setproctitle exists
11333 set setproctitle d_setproctitle
11336 : see if setpwent exists
11337 set setpwent d_setpwent
11340 : see if setregid exists
11341 set setregid d_setregid
11343 set setresgid d_setresgid
11346 : see if setreuid exists
11347 set setreuid d_setreuid
11349 set setresuid d_setresuid
11352 : see if setrgid exists
11353 set setrgid d_setrgid
11356 : see if setruid exists
11357 set setruid d_setruid
11360 : see if setservent exists
11361 set setservent d_setsent
11364 : see if setsid exists
11365 set setsid d_setsid
11368 : see if setvbuf exists
11369 set setvbuf d_setvbuf
11372 : see if sfio.h is available
11377 : see if sfio library is available
11388 : Ok, but do we want to use it.
11392 true|$define|[yY]*) dflt='y';;
11395 echo "$package can use the sfio library, but it is experimental."
11396 case "$useperlio" in
11398 echo "For sfio also the PerlIO abstraction layer is needed."
11399 echo "Earlier you said you wouldn't want that."
11402 rp="You seem to have sfio available, do you want to try using it?"
11405 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
11406 useperlio="$define"
11409 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
11411 : Remove sfio from list of libraries to use
11412 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
11415 echo "libs = $libs" >&4
11419 *) case "$usesfio" in
11420 true|$define|[yY]*)
11421 echo "Sorry, cannot find sfio on this machine." >&4
11422 echo "Ignoring your setting of usesfio=$usesfio." >&4
11431 $define) usesfio='true';;
11432 *) usesfio='false';;
11435 : see if shmctl exists
11436 set shmctl d_shmctl
11439 : see if shmget exists
11440 set shmget d_shmget
11443 : see if shmat exists
11446 : see what shmat returns
11449 $cat >shmat.c <<'END'
11450 #include <sys/shm.h>
11453 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
11458 echo "and it returns ($shmattype)." >&4
11459 : see if a prototype for shmat is available
11460 xxx=`./findhdr sys/shm.h`
11461 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
11462 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
11473 set d_shmatprototype
11476 : see if shmdt exists
11480 : see how much of the 'shm*(2)' library is present.
11483 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
11484 *"$undef"*) h_shm=false;;
11488 case "`ipcs 2>&1`" in
11489 "SVID shared memory"*"not configured"*)
11490 echo "Your $osname does not have the shm*(2) configured." >&4
11493 set shmctl d_shmctl
11495 set shmget d_shmget
11505 : we could also check for sys/ipc.h ...
11506 if $h_shm && $test `./findhdr sys/shm.h`; then
11507 echo "You have the full shm*(2) library." >&4
11510 echo "You don't have the full shm*(2) library." >&4
11517 : see if we have sigaction
11518 if set sigaction val -f d_sigaction; eval $csym; $val; then
11519 echo 'sigaction() found.' >&4
11520 $cat > try.c <<'EOP'
11522 #include <sys/types.h>
11523 #include <signal.h>
11526 struct sigaction act, oact;
11528 oact.sa_handler = 0;
11529 /* so that act and oact are used */
11530 exit(act.sa_flags == 0 && oact.sa_handler == 0);
11534 if eval $compile_ok; then
11537 echo "But you don't seem to have a useable struct sigaction." >&4
11541 echo 'sigaction NOT found.' >&4
11544 set d_sigaction; eval $setvar
11545 $rm -f try try$_o try.c
11547 : see if sigprocmask exists
11548 set sigprocmask d_sigprocmask
11551 : see if sigsetjmp exists
11553 case "$d_sigsetjmp" in
11555 $cat >try.c <<'EOP'
11556 #include <setjmp.h>
11561 if (sigsetjmp(env,1))
11564 siglongjmp(env, 1);
11569 if eval $compile; then
11570 if ./try >/dev/null 2>&1; then
11571 echo "POSIX sigsetjmp found." >&4
11575 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
11581 echo "sigsetjmp not found." >&4
11585 *) val="$d_sigsetjmp"
11586 case "$d_sigsetjmp" in
11587 $define) echo "POSIX sigsetjmp found." >&4;;
11588 $undef) echo "sigsetjmp not found." >&4;;
11596 : see if socks5_init exists
11597 set socks5_init d_socks5_init
11600 : see if sys/stat.h is available
11601 set sys/stat.h i_sysstat
11605 : see if stat knows about block sizes
11607 echo "Checking to see if your struct stat has st_blocks field..." >&4
11608 set d_statblks stat st_blocks $i_sysstat sys/stat.h
11612 : see if this is a sys/vfs.h system
11613 set sys/vfs.h i_sysvfs
11617 : see if this is a sys/statfs.h system
11618 set sys/statfs.h i_sysstatfs
11623 echo "Checking to see if your system supports struct statfs..." >&4
11624 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
11626 case "$d_statfs_s" in
11627 "$define") echo "Yes, it does." ;;
11628 *) echo "No, it doesn't." ;;
11633 : see if struct statfs knows about f_flags
11634 case "$d_statfs_s" in
11637 echo "Checking to see if your struct statfs has f_flags field..." >&4
11638 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
11642 set d_statfs_f_flags
11646 case "$d_statfs_f_flags" in
11647 "$define") echo "Yes, it does." ;;
11648 *) echo "No, it doesn't." ;;
11651 : see if _ptr and _cnt from stdio act std
11654 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
11655 echo "(Looks like you have stdio.h from BSD.)"
11656 case "$stdio_ptr" in
11657 '') stdio_ptr='((fp)->_p)'
11660 *) ptr_lval=$d_stdio_ptr_lval;;
11662 case "$stdio_cnt" in
11663 '') stdio_cnt='((fp)->_r)'
11666 *) cnt_lval=$d_stdio_cnt_lval;;
11668 case "$stdio_base" in
11669 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
11671 case "$stdio_bufsiz" in
11672 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
11674 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
11675 echo "(Looks like you have stdio.h from Linux.)"
11676 case "$stdio_ptr" in
11677 '') stdio_ptr='((fp)->_IO_read_ptr)'
11680 *) ptr_lval=$d_stdio_ptr_lval;;
11682 case "$stdio_cnt" in
11683 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
11686 *) cnt_lval=$d_stdio_cnt_lval;;
11688 case "$stdio_base" in
11689 '') stdio_base='((fp)->_IO_read_base)';;
11691 case "$stdio_bufsiz" in
11692 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
11695 case "$stdio_ptr" in
11696 '') stdio_ptr='((fp)->_ptr)'
11699 *) ptr_lval=$d_stdio_ptr_lval;;
11701 case "$stdio_cnt" in
11702 '') stdio_cnt='((fp)->_cnt)'
11705 *) cnt_lval=$d_stdio_cnt_lval;;
11707 case "$stdio_base" in
11708 '') stdio_base='((fp)->_base)';;
11710 case "$stdio_bufsiz" in
11711 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
11715 : test whether _ptr and _cnt really work
11716 echo "Checking how std your stdio is..." >&4
11719 #define FILE_ptr(fp) $stdio_ptr
11720 #define FILE_cnt(fp) $stdio_cnt
11722 FILE *fp = fopen("try.c", "r");
11725 18 <= FILE_cnt(fp) &&
11726 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
11734 if eval $compile; then
11736 echo "Your stdio acts pretty std."
11739 echo "Your stdio isn't very std."
11742 echo "Your stdio doesn't appear very std."
11748 : Can _ptr be used as an lvalue?
11749 case "$d_stdstdio$ptr_lval" in
11750 $define$define) val=$define ;;
11753 set d_stdio_ptr_lval
11756 : Can _cnt be used as an lvalue?
11757 case "$d_stdstdio$cnt_lval" in
11758 $define$define) val=$define ;;
11761 set d_stdio_cnt_lval
11765 : test whether setting _ptr sets _cnt as a side effect
11766 d_stdio_ptr_lval_sets_cnt="$undef"
11767 d_stdio_ptr_lval_nochange_cnt="$undef"
11768 case "$d_stdio_ptr_lval$d_stdstdio" in
11770 echo "Checking to see what happens if we set the stdio ptr..." >&4
11773 /* Can we scream? */
11774 /* Eat dust sed :-) */
11775 /* In the buffer space, no one can hear you scream. */
11776 #define FILE_ptr(fp) $stdio_ptr
11777 #define FILE_cnt(fp) $stdio_cnt
11778 #include <sys/types.h>
11780 FILE *fp = fopen("try.c", "r");
11785 puts("Fail even to read");
11788 c = getc(fp); /* Read away the first # */
11790 puts("Fail even to read");
11794 18 <= FILE_cnt(fp) &&
11795 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
11797 puts("Fail even to read");
11800 ptr = (char*) FILE_ptr(fp);
11801 cnt = (size_t)FILE_cnt(fp);
11803 FILE_ptr(fp) += 42;
11805 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
11806 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
11809 if (FILE_cnt(fp) <= 20) {
11810 printf ("Fail (<20 chars to test)");
11813 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
11814 puts("Fail compare");
11817 if (cnt == FILE_cnt(fp)) {
11818 puts("Pass_unchanged");
11821 if (FILE_cnt(fp) == (cnt - 42)) {
11822 puts("Pass_changed");
11825 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
11831 if eval $compile; then
11832 case `./try$exe_ext` in
11834 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
11835 d_stdio_ptr_lval_sets_cnt="$define" ;;
11837 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
11838 d_stdio_ptr_lval_nochange_cnt="$define" ;;
11840 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
11842 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
11845 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
11851 : see if _base is also standard
11853 case "$d_stdstdio" in
11857 #define FILE_base(fp) $stdio_base
11858 #define FILE_bufsiz(fp) $stdio_bufsiz
11860 FILE *fp = fopen("try.c", "r");
11863 19 <= FILE_bufsiz(fp) &&
11864 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
11871 if eval $compile; then
11873 echo "And its _base field acts std."
11876 echo "But its _base field isn't std."
11879 echo "However, it seems to be lacking the _base field."
11888 Checking how to access stdio streams by file descriptor number...
11890 case "$stdio_stream_array" in
11891 '') $cat >try.c <<EOCP
11894 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
11898 for s in _iob __iob __sF
11900 set try -DSTDIO_STREAM_ARRAY=$s
11901 if eval $compile; then
11902 case "`./try$exe_ext`" in
11903 yes) stdio_stream_array=$s; break ;;
11907 $rm -f try.* try$exe_ext
11909 case "$stdio_stream_array" in
11911 I can't figure out how to access stdio streams by file descriptor number.
11913 d_stdio_stream_array="$undef"
11916 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
11918 d_stdio_stream_array="$define"
11922 : see if strcoll exists
11923 set strcoll d_strcoll
11926 : check for structure copying
11928 echo "Checking to see if your C compiler can copy structs..." >&4
11929 $cat >try.c <<'EOCP'
11939 if $cc -c try.c >/dev/null 2>&1 ; then
11941 echo "Yup, it can."
11944 echo "Nope, it can't."
11950 : see if strerror and/or sys_errlist[] exist
11952 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
11953 if set strerror val -f d_strerror; eval $csym; $val; then
11954 echo 'strerror() found.' >&4
11955 d_strerror="$define"
11956 d_strerrm='strerror(e)'
11957 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
11958 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
11959 d_syserrlst="$define"
11961 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
11962 d_syserrlst="$undef"
11964 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
11965 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
11966 echo 'strerror() found in string header.' >&4
11967 d_strerror="$define"
11968 d_strerrm='strerror(e)'
11969 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
11970 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
11971 d_syserrlst="$define"
11973 echo "(You don't appear to have any sys_errlist[], how can this be?)"
11974 d_syserrlst="$undef"
11976 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
11977 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
11978 d_strerror="$undef"
11979 d_syserrlst="$define"
11980 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
11982 echo 'strerror() and sys_errlist[] NOT found.' >&4
11983 d_strerror="$undef"
11984 d_syserrlst="$undef"
11985 d_strerrm='"unknown"'
11989 : see if strtod exists
11990 set strtod d_strtod
11993 : see if strtol exists
11994 set strtol d_strtol
11997 : see if strtold exists
11998 set strtold d_strtold
12001 : see if strtoll exists
12002 set strtoll d_strtoll
12005 case "$d_longlong-$d_strtoll" in
12008 Checking whether your strtoll() works okay...
12010 $cat >try.c <<'EOCP'
12013 #define strtoll __strtoll
12016 #define strtoll _strtoll
12019 extern long long int strtoll(char *s, char **, int);
12020 static int bad = 0;
12021 int check(char *s, long long ell, int een) {
12024 gll = strtoll(s, 0, 10);
12025 if (!((gll == ell) && (errno == een)))
12029 check(" 1", 1LL, 0);
12030 check(" 0", 0LL, 0);
12031 check("-1", -1LL, 0);
12032 check("-9223372036854775808", -9223372036854775808LL, 0);
12033 check("-9223372036854775808", -9223372036854775808LL, 0);
12034 check(" 9223372036854775807", 9223372036854775807LL, 0);
12035 check("-9223372036854775808", -9223372036854775808LL, 0);
12036 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
12037 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
12043 if eval $compile; then
12046 ok) echo "Your strtoll() seems to be working okay." ;;
12048 Your strtoll() doesn't seem to be working okay.
12054 echo "(I can't seem to compile the test program--assuming it doesn't)"
12060 : see if strtoq exists
12061 set strtoq d_strtoq
12064 : see if strtoul exists
12065 set strtoul d_strtoul
12068 case "$d_strtoul" in
12071 Checking whether your strtoul() works okay...
12073 $cat >try.c <<'EOCP'
12076 extern unsigned long int strtoul(char *s, char **, int);
12077 static int bad = 0;
12078 void check(char *s, unsigned long eul, int een) {
12081 gul = strtoul(s, 0, 10);
12082 if (!((gul == eul) && (errno == een)))
12086 check(" 1", 1L, 0);
12087 check(" 0", 0L, 0);
12089 case "$longsize" in
12091 $cat >>try.c <<'EOCP'
12092 check("18446744073709551615", 18446744073709551615UL, 0);
12093 check("18446744073709551616", 18446744073709551615UL, ERANGE);
12094 #if 0 /* strtoul() for /^-/ strings is undefined. */
12095 check("-1", 18446744073709551615UL, 0);
12096 check("-18446744073709551614", 2, 0);
12097 check("-18446744073709551615", 1, 0);
12098 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
12099 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
12104 $cat >>try.c <<'EOCP'
12105 check("4294967295", 4294967295UL, 0);
12106 check("4294967296", 4294967295UL, ERANGE);
12107 #if 0 /* strtoul() for /^-/ strings is undefined. */
12108 check("-1", 4294967295UL, 0);
12109 check("-4294967294", 2, 0);
12110 check("-4294967295", 1, 0);
12111 check("-4294967296", 4294967295UL, ERANGE);
12112 check("-4294967297", 4294967295UL, ERANGE);
12117 : Should we write these tests to be more portable by sprintf-ing
12118 : ~0 and then manipulating that char string as input for strtol?
12121 $cat >>try.c <<'EOCP'
12128 if eval $compile; then
12130 ok) echo "Your strtoul() seems to be working okay." ;;
12132 Your strtoul() doesn't seem to be working okay.
12141 : see if strtoull exists
12142 set strtoull d_strtoull
12145 case "$d_longlong-$d_strtoull" in
12148 Checking whether your strtoull() works okay...
12150 $cat >try.c <<'EOCP'
12153 #define strtoull __strtoull
12156 extern unsigned long long int strtoull(char *s, char **, int);
12157 static int bad = 0;
12158 int check(char *s, long long eull, int een) {
12161 gull = strtoull(s, 0, 10);
12162 if (!((gull == eull) && (errno == een)))
12166 check(" 1", 1LL, 0);
12167 check(" 0", 0LL, 0);
12168 check("18446744073709551615", 18446744073709551615ULL, 0);
12169 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
12170 #if 0 /* strtoull() for /^-/ strings is undefined. */
12171 check("-1", 18446744073709551615ULL, 0);
12172 check("-18446744073709551614", 2LL, 0);
12173 check("-18446744073709551615", 1LL, 0);
12174 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
12175 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
12182 if eval $compile; then
12184 ok) echo "Your strtoull() seems to be working okay." ;;
12186 Your strtoull() doesn't seem to be working okay.
12188 d_strtoull="$undef"
12195 : see if strtouq exists
12196 set strtouq d_strtouq
12199 case "$d_strtouq" in
12202 Checking whether your strtouq() works okay...
12204 $cat >try.c <<'EOCP'
12207 extern unsigned long long int strtouq(char *s, char **, int);
12208 static int bad = 0;
12209 void check(char *s, unsigned long long eull, int een) {
12210 unsigned long long gull;
12212 gull = strtouq(s, 0, 10);
12213 if (!((gull == eull) && (errno == een)))
12217 check(" 1", 1LL, 0);
12218 check(" 0", 0LL, 0);
12219 check("18446744073709551615", 18446744073709551615ULL, 0);
12220 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
12221 #if 0 /* strtouq() for /^-/ strings is undefined. */
12222 check("-1", 18446744073709551615ULL, 0);
12223 check("-18446744073709551614", 2LL, 0);
12224 check("-18446744073709551615", 1LL, 0);
12225 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
12226 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
12234 if eval $compile; then
12236 ok) echo "Your strtouq() seems to be working okay." ;;
12238 Your strtouq() doesn't seem to be working okay.
12247 : see if strxfrm exists
12248 set strxfrm d_strxfrm
12251 : see if symlink exists
12252 set symlink d_symlink
12255 : see if syscall exists
12256 set syscall d_syscall
12259 : see if sysconf exists
12260 set sysconf d_sysconf
12263 : see if system exists
12264 set system d_system
12267 : see if tcgetpgrp exists
12268 set tcgetpgrp d_tcgetpgrp
12271 : see if tcsetpgrp exists
12272 set tcsetpgrp d_tcsetpgrp
12275 : see if prototype for telldir is available
12277 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
12280 : see if this is a sys/times.h system
12281 set sys/times.h i_systimes
12284 : see if times exists
12286 if set times val -f d_times; eval $csym; $val; then
12287 echo 'times() found.' >&4
12290 case "$i_systimes" in
12291 "$define") inc='sys/times.h';;
12293 rp="What is the type returned by times() on this system?"
12294 set clock_t clocktype long stdio.h sys/types.h $inc
12297 echo 'times() NOT found, hope that will do.' >&4
12302 : see if truncate exists
12303 set truncate d_truncate
12306 : see if tzname[] exists
12308 if set tzname val -a d_tzname; eval $csym; $val; then
12310 echo 'tzname[] found.' >&4
12313 echo 'tzname[] NOT found.' >&4
12318 : see if umask exists
12322 : see if ustat exists
12326 : backward compatibility for d_hvfork
12327 if test X$d_hvfork != X; then
12328 d_vfork="$d_hvfork"
12331 : see if there is a vfork
12336 : Ok, but do we want to use it. vfork is reportedly unreliable in
12337 : perl on Solaris 2.x, and probably elsewhere.
12341 case "$usevfork" in
12347 Perl can only use a vfork() that doesn't suffer from strict
12348 restrictions on calling functions or modifying global data in
12349 the child. For example, glibc-2.1 contains such a vfork()
12350 that is unsuitable. If your system provides a proper fork()
12351 call, chances are that you do NOT want perl to use vfork().
12354 rp="Do you still want to use vfork()?"
12359 echo "Ok, we won't use vfork()."
12368 $define) usevfork='true';;
12369 *) usevfork='false';;
12372 : see if this is an sysdir system
12373 set sys/dir.h i_sysdir
12376 : see if this is an sysndir system
12377 set sys/ndir.h i_sysndir
12380 : see if closedir exists
12381 set closedir d_closedir
12384 case "$d_closedir" in
12387 echo "Checking whether closedir() returns a status..." >&4
12388 cat > closedir.c <<EOM
12389 #$i_dirent I_DIRENT /**/
12390 #$i_sysdir I_SYS_DIR /**/
12391 #$i_sysndir I_SYS_NDIR /**/
12392 #$i_systypes I_SYS_TYPES /**/
12394 #if defined(I_SYS_TYPES)
12395 #include <sys/types.h>
12397 #if defined(I_DIRENT)
12398 #include <dirent.h>
12399 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
12400 #include <sys/dir.h>
12404 #include <sys/ndir.h>
12408 #include <ndir.h> /* may be wrong in the future */
12410 #include <sys/dir.h>
12415 int main() { return closedir(opendir(".")); }
12418 if eval $compile_ok; then
12419 if ./closedir > /dev/null 2>&1 ; then
12420 echo "Yes, it does."
12423 echo "No, it doesn't."
12427 echo "(I can't seem to compile the test program--assuming it doesn't)"
12435 set d_void_closedir
12438 : see if there is a wait4
12442 : see if waitpid exists
12443 set waitpid d_waitpid
12446 : see if wcstombs exists
12447 set wcstombs d_wcstombs
12450 : see if wctomb exists
12451 set wctomb d_wctomb
12454 : preserve RCS keywords in files with variable substitution, grrr
12459 Revision='$Revision'
12461 case "$crosscompile" in
12462 ''|[nN]*) crosscompile="$undef" ;;
12466 next|rhapsody|darwin) multiarch="$define" ;;
12468 case "$multiarch" in
12469 ''|[nN]*) multiarch="$undef" ;;
12472 : check for alignment requirements
12474 case "$crosscompile$multiarch" in
12477 You seem to be either cross-compiling or doing a multiarchitecture build,
12478 skipping the memory alignment check.
12481 case "$alignbytes" in
12482 '') alignbytes=8 ;;
12486 case "$alignbytes" in
12487 '') echo "Checking alignment constraints..." >&4
12488 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
12489 $cat >try.c <<'EOCP'
12490 typedef long double NV;
12493 $cat >try.c <<'EOCP'
12497 $cat >>try.c <<'EOCP'
12505 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
12510 if eval $compile_ok; then
12514 echo "(I can't seem to compile the test program...)"
12517 *) dflt="$alignbytes"
12520 rp="Doubles must be aligned on a how-many-byte boundary?"
12528 : set the base revision
12531 : check for ordering of bytes in a long
12533 case "$crosscompile$multiarch" in
12536 You seem to be either cross-compiling or doing a multiarchitecture build,
12537 skipping the byteorder check.
12543 case "$byteorder" in
12546 In the following, larger digits indicate more significance. A big-endian
12547 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
12548 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
12549 machines may have weird orders like 3412. A Cray will report 87654321,
12550 an Alpha will report 12345678. If the test program works the default is
12552 I'm now running the test program...
12554 $cat >try.c <<'EOCP'
12561 char c[sizeof(long)];
12564 if (sizeof(long) > 4)
12565 u.l = (0x08070605L << 32) | 0x04030201L;
12568 for (i = 0; i < sizeof(long); i++)
12569 printf("%c", u.c[i]+'0');
12576 if eval $compile && ./try > /dev/null; then
12579 [1-4][1-4][1-4][1-4]|12345678|87654321)
12580 echo "(The test program ran ok.)"
12581 echo "byteorder=$dflt"
12584 ????|????????) echo "(The test program ran ok.)" ;;
12585 *) echo "(The test program didn't run right for some reason.)" ;;
12590 (I can't seem to compile the test program. Guessing big-endian...)
12593 case "$xxx_prompt" in
12595 rp="What is the order of bytes in a long?"
12609 : how do we catenate cpp tokens here?
12611 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
12612 $cat >cpp_stuff.c <<'EOCP'
12613 #define RCAT(a,b)a/**/b
12614 #define ACAT(a,b)a ## b
12618 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
12619 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
12620 echo "Oh! Smells like ANSI's been here." >&4
12621 echo "We can catify or stringify, separately or together!"
12623 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
12624 echo "Ah, yes! The good old days!" >&4
12625 echo "However, in the good old days we don't know how to stringify and"
12626 echo "catify at the same time."
12630 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
12631 to have to edit the values of CAT[2-5] in config.h...
12633 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
12637 : see if this is a db.h system
12643 : Check db version.
12645 echo "Checking Berkeley DB version ..." >&4
12651 #include <sys/types.h>
12656 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
12657 int Major, Minor, Patch ;
12658 unsigned long Version ;
12659 (void)db_version(&Major, &Minor, &Patch) ;
12660 printf("You have Berkeley DB Version 2 or greater\n");
12662 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
12663 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
12664 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
12665 Major, Minor, Patch) ;
12667 /* check that db.h & libdb are compatible */
12668 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
12669 printf("db.h and libdb are incompatible\n") ;
12673 printf("db.h and libdb are compatible\n") ;
12675 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
12676 + DB_VERSION_PATCH ;
12678 /* needs to be >= 2.3.4 */
12679 if (Version < 2003004) {
12680 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
12681 printf("but Perl needs Berkeley DB 2.3.4 or greater\n") ;
12687 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
12688 printf("You have Berkeley DB Version 1\n");
12689 exit(0); /* DB version < 2: the coast is clear. */
12691 exit(1); /* <db.h> not Berkeley DB? */
12697 if eval $compile_ok && ./try; then
12698 echo 'Looks OK.' >&4
12700 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
12704 : Remove db from list of libraries to use
12705 echo "Removing unusable -ldb from library list" >&4
12706 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
12709 echo "libs = $libs" >&4
12719 : Check the return type needed for hash
12721 echo "Checking return type needed for hash for Berkeley DB ..." >&4
12727 #include <sys/types.h>
12730 #ifndef DB_VERSION_MAJOR
12731 u_int32_t hash_cb (ptr, size)
12739 info.hash = hash_cb;
12743 if $cc $ccflags -c try.c >try.out 2>&1 ; then
12744 if $contains warning try.out >>/dev/null 2>&1 ; then
12747 db_hashtype='u_int32_t'
12750 : XXX Maybe we should just give up here.
12751 db_hashtype=u_int32_t
12753 echo "Help: I can't seem to compile the db test program." >&4
12754 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
12757 echo "Your version of Berkeley DB uses $db_hashtype for hash."
12759 *) db_hashtype=u_int32_t
12764 : Check the return type needed for prefix
12766 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
12772 #include <sys/types.h>
12775 #ifndef DB_VERSION_MAJOR
12776 size_t prefix_cb (key1, key2)
12784 info.prefix = prefix_cb;
12788 if $cc $ccflags -c try.c >try.out 2>&1 ; then
12789 if $contains warning try.out >>/dev/null 2>&1 ; then
12790 db_prefixtype='int'
12792 db_prefixtype='size_t'
12795 db_prefixtype='size_t'
12796 : XXX Maybe we should just give up here.
12798 echo "Help: I can't seem to compile the db test program." >&4
12799 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
12802 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
12804 *) db_prefixtype='size_t'
12808 : check for void type
12810 echo "Checking to see how well your C compiler groks the void type..." >&4
12811 case "$voidflags" in
12813 $cat >try.c <<'EOCP'
12819 extern void moo(); /* function returning void */
12820 void (*goo)(); /* ptr to func returning void */
12822 void *hue; /* generic ptr */
12835 int main() { sub(); }
12837 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
12838 voidflags=$defvoidused
12839 echo "Good. It appears to support void to the level $package wants.">&4
12840 if $contains warning .out >/dev/null 2>&1; then
12841 echo "However, you might get some warnings that look like this:"
12845 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
12846 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
12847 echo "It supports 1..."
12848 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
12849 echo "It also supports 2..."
12850 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
12852 echo "And it supports 4 but not 8 definitely."
12854 echo "It doesn't support 4..."
12855 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
12857 echo "But it supports 8."
12860 echo "Neither does it support 8."
12864 echo "It does not support 2..."
12865 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
12867 echo "But it supports 4 and 8."
12869 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
12871 echo "And it supports 4 but has not heard about 8."
12873 echo "However it supports 8 but not 4."
12878 echo "There is no support at all for void."
12883 case "$voidflags" in
12885 *) $cat >&4 <<'EOM'
12886 Support flag bits are:
12887 1: basic void declarations.
12888 2: arrays of pointers to functions returning void.
12889 4: operations between pointers to and addresses of void functions.
12890 8: generic void pointers.
12893 rp="Your void support flags add up to what?"
12901 : How can we generate normalized random numbers ?
12903 echo "Looking for a random number function..." >&4
12904 case "$randfunc" in
12906 if set drand48 val -f; eval $csym; $val; then
12908 echo "Good, found drand48()." >&4
12909 elif set random val -f; eval $csym; $val; then
12911 echo "OK, found random()." >&4
12914 echo "Yick, looks like I have to use rand()." >&4
12925 *-Dmy_rand=*|*-Dmy_srand=*)
12926 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
12927 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
12928 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
12929 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
12933 while $test "$cont"; do
12934 rp="Use which function to generate random numbers?"
12936 if $test "$ans" = "$dflt"; then
12942 if set $ans val -f; eval $csym; $val; then
12946 rp="I cannot find function $ans. Use that name anyway?"
12955 case "$randfunc" in
12957 drand01="drand48()"
12963 case "$randbits" in
12965 echo "Checking to see how many bits your $randfunc() function produces..." >&4
12967 #$i_unistd I_UNISTD
12968 #$i_stdlib I_STDLIB
12971 # include <unistd.h>
12974 # include <stdlib.h>
12979 register unsigned long tmp;
12980 register unsigned long max = 0L;
12982 for (i = 1000; i; i--) {
12983 tmp = (unsigned long) $randfunc();
12984 if (tmp > max) max = tmp;
12986 for (i = 0; max; i++)
12992 if eval $compile_ok; then
12996 echo "(I can't seem to compile the test program...)"
13003 rp="How many bits does your $randfunc() function produce?"
13007 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
13008 seedfunc="s$randfunc"
13009 randseedtype=unsigned
13013 rp="How many bits does your $randfunc() function produce?"
13016 seedfunc="s$randfunc"
13017 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
13018 if set $seedfunc val -f; eval $csym; $val; then
13019 echo "(Using $seedfunc() to seed random generator)"
13021 echo "(Warning: no $seedfunc() to seed random generator)"
13024 randseedtype=unsigned
13032 echo "Determining whether or not we are on an EBCDIC system..." >&4
13033 $cat >tebcdic.c <<'EOM'
13036 if ('M'==0xd4) return 0;
13043 if eval $compile_ok; then
13045 echo "You seem to speak EBCDIC." >&4
13048 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF8." >&4
13051 echo "I'm unable to compile the test program." >&4
13052 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
13054 $rm -f tebcdic.c tebcdic
13060 Checking how to flush all pending stdio output...
13062 # I only know how to find the first 32 possibly open files on SunOS.
13063 # See also hints/sunos_4_1.sh and util.c --AD
13065 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
13067 $cat >>try.c <<EOCP
13069 #$i_unistd I_UNISTD
13071 # include <unistd.h>
13073 #$d_sysconf HAS_SYSCONF
13074 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
13075 #ifdef HAS_STDIO_STREAM_ARRAY
13076 # define STDIO_STREAM_ARRAY $stdio_stream_array
13079 FILE* p = fopen("try.out", "w");
13083 # ifdef TRY_FPRINTF
13087 #ifdef TRY_FFLUSH_NULL
13090 #ifdef TRY_FFLUSH_ALL
13092 long open_max = -1;
13093 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
13094 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
13096 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
13097 open_max = sysconf(_SC_OPEN_MAX);
13100 open_max = FOPEN_MAX;
13103 open_max = OPEN_MAX;
13112 # ifdef HAS_STDIO_STREAM_ARRAY
13113 if (open_max > 0) {
13115 for (i = 0; i < open_max; i++)
13116 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
13117 STDIO_STREAM_ARRAY[i]._file < open_max &&
13118 STDIO_STREAM_ARRAY[i]._flag)
13119 fflush(&STDIO_STREAM_ARRAY[i]);
13127 : first we have to find out how _not_ to flush
13128 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
13130 set try -DTRY_FPUTC
13131 if eval $compile; then
13133 ./try$exe_ext 2>/dev/null
13134 if $test ! -s try.out -a "X$?" = X42; then
13140 set try -DTRY_FPRINTF
13142 if eval $compile; then
13144 ./try$exe_ext 2>/dev/null
13145 if $test ! -s try.out -a "X$?" = X42; then
13146 output=-DTRY_FPRINTF
13152 : check for fflush NULL behaviour
13153 case "$fflushNULL" in
13154 '') set try -DTRY_FFLUSH_NULL $output
13155 if eval $compile; then
13157 ./try$exe_ext 2>/dev/null
13159 if $test -s try.out -a "X$code" = X42; then
13160 fflushNULL="`$cat try.out`"
13162 if $test "X$code" != X42; then
13164 (If this test failed, don't worry, we'll try another method shortly.)
13169 $rm -f core try.core core.try.*
13170 case "$fflushNULL" in
13172 Your fflush(NULL) works okay for output streams.
13173 Let's see if it clobbers input pipes...
13175 # As of mid-March 2000 all versions of Solaris appear to have a stdio
13176 # bug that improperly flushes the input end of pipes. So we avoid the
13177 # autoflush on fork/system/exec support for now. :-(
13178 $cat >tryp.c <<EOCP
13181 main(int argc, char **argv)
13187 while ((i = getc(stdin)) != -1
13188 && (*bp++ = i) != '\n'
13189 && bp < &buf[1024])
13192 fprintf(stdout, "%s", buf);
13200 fflushNULL="$define"
13202 if eval $compile; then
13204 $cat tryp.c | ./tryp$exe_ext 2>/dev/null > tryp.out
13205 if cmp tryp.c tryp.out >/dev/null 2>&1; then
13207 fflush(NULL) seems to behave okay with input streams.
13209 fflushNULL="$define"
13212 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
13214 fflushNULL="$undef"
13217 $rm -f core tryp.c tryp.core core.tryp.*
13220 Your fflush(NULL) isn't working (contrary to ANSI C).
13222 fflushNULL="$undef"
13225 Cannot figure out whether your fflush(NULL) works or not.
13226 I'm assuming it doesn't (contrary to ANSI C).
13228 fflushNULL="$undef"
13232 $define|true|[yY]*)
13233 fflushNULL="$define"
13236 fflushNULL="$undef"
13239 : check explicit looping only if NULL did not work, and if the pipe
13240 : bug does not show up on an explicit flush too
13241 case "$fflushNULL" in
13243 $cat >tryp.c <<EOCP
13246 main(int argc, char **argv)
13252 while ((i = getc(stdin)) != -1
13253 && (*bp++ = i) != '\n'
13254 && bp < &buf[1024])
13257 fprintf(stdout, "%s", buf);
13266 if eval $compile; then
13268 $cat tryp.c | ./tryp$exe_ext 2>/dev/null > tryp.out
13269 if cmp tryp.c tryp.out >/dev/null 2>&1; then
13271 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
13273 : now check for fflushall behaviour
13274 case "$fflushall" in
13275 '') set try -DTRY_FFLUSH_ALL $output
13276 if eval $compile; then
13278 (Now testing the other method--but note that this also may fail.)
13281 ./try$exe_ext 2>/dev/null
13282 if $test -s try.out -a "X$?" = X42; then
13283 fflushall="`$cat try.out`"
13286 $rm -f core try.core core.try.*
13287 case "$fflushall" in
13289 Whew. Flushing explicitly all the stdio streams works.
13291 fflushall="$define"
13294 Sigh. Flushing explicitly all the stdio streams doesn't work.
13299 Cannot figure out whether flushing stdio streams explicitly works or not.
13300 I'm assuming it doesn't.
13306 "$define"|true|[yY]*)
13307 fflushall="$define"
13315 All is futile. Even fflush(stdin) clobbers input pipes!
13322 $rm -f core tryp.c tryp.core core.tryp.*
13324 *) fflushall="$undef"
13328 case "$fflushNULL$fflushall" in
13331 OK, I give up. I cannot figure out how to flush pending stdio output.
13332 We won't be flushing handles at all before fork/exec/popen.
13336 $rm -f try.* try$exe_ext
13338 : Store the full pathname to the ar program for use in the C program
13339 : Respect a hint or command line value for full_ar.
13344 : Store the full pathname to the sed program for use in the C program
13347 : see what type gids are declared as in the kernel
13349 echo "Looking for the type for group ids returned by getgid()."
13350 set gid_t gidtype xxx stdio.h sys/types.h
13354 xxx=`./findhdr sys/user.h`
13355 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
13357 unsigned) dflt="$1 $2" ;;
13361 *) dflt="$gidtype";;
13364 gid_t) echo "gid_t found." ;;
13365 *) rp="What is the type for group ids returned by getgid()?"
13373 *_t) zzz="$gidtype" ;;
13376 echo "Checking the size of $zzz..." >&4
13378 #include <sys/types.h>
13381 printf("%d\n", (int)sizeof($gidtype));
13386 if eval $compile_ok; then
13390 echo "(I can't execute the test program--guessing $gidsize.)" >&4
13393 echo "Your $zzz is $gidsize bytes long."
13398 echo "(I can't compile the test program--guessing $gidsize.)" >&4
13404 *_t) zzz="$gidtype" ;;
13407 echo "Checking the sign of $zzz..." >&4
13409 #include <sys/types.h>
13420 if eval $compile; then
13424 echo "(I can't execute the test program--guessing unsigned.)" >&4
13428 1) echo "Your $zzz is unsigned." ;;
13429 -1) echo "Your $zzz is signed." ;;
13435 echo "(I can't compile the test program--guessing unsigned.)" >&4
13441 if $test X"$quadtype" != X; then
13443 echo "Checking how to print 64-bit integers..." >&4
13445 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
13446 $cat >try.c <<'EOCP'
13447 #include <sys/types.h>
13450 int q = 12345678901;
13451 printf("%ld\n", q);
13455 if eval $compile; then
13456 yyy=`./try$exe_ext`
13459 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
13460 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
13461 echo "We will use %d."
13467 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
13468 $cat >try.c <<'EOCP'
13469 #include <sys/types.h>
13472 long q = 12345678901;
13473 printf("%ld\n", q);
13477 if eval $compile; then
13478 yyy=`./try$exe_ext`
13481 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
13482 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
13483 echo "We will use %ld."
13489 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
13490 $cat >try.c <<'EOCP'
13491 #include <sys/types.h>
13492 #include <inttypes.h>
13495 int64_t q = 12345678901;
13496 printf("%" PRId64 "\n", q);
13500 if eval $compile; then
13501 yyy=`./try$exe_ext`
13504 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
13505 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
13506 echo "We will use the C9X style."
13512 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
13513 $cat >try.c <<'EOCP'
13514 #include <sys/types.h>
13517 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
13518 printf("%lld\n", q);
13522 if eval $compile; then
13523 yyy=`./try$exe_ext`
13526 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
13527 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
13528 echo "We will use the %lld style."
13534 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
13536 #include <sys/types.h>
13539 $quadtype q = 12345678901;
13540 printf("%Ld\n", q);
13544 if eval $compile; then
13545 yyy=`./try$exe_ext`
13548 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
13549 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
13550 echo "We will use %Ld."
13556 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
13558 #include <sys/types.h>
13561 $quadtype q = 12345678901;
13562 printf("%qd\n", q);
13566 if eval $compile; then
13567 yyy=`./try$exe_ext`
13570 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
13571 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
13572 echo "We will use %qd."
13578 if $test X"$sPRId64" = X; then
13579 echo "Cannot figure out how to print 64-bit integers." >&4
13587 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
13588 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
13590 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
13591 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
13597 $echo "Checking the format strings to be used for Perl's internal types..." >&4
13599 if $test X"$ivsize" = X8; then
13600 ivdformat="$sPRId64"
13601 uvuformat="$sPRIu64"
13602 uvoformat="$sPRIo64"
13603 uvxformat="$sPRIx64"
13604 uvXUformat="$sPRIXU64"
13606 if $test X"$ivsize" = X"$longsize"; then
13613 if $test X"$ivsize" = X"$intsize"; then
13621 if $test X"$ivsize" = X"$shortsize"; then
13632 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
13633 nveformat="$sPRIeldbl"
13634 nvfformat="$sPRIfldbl"
13635 nvgformat="$sPRIgldbl"
13636 nvEUformat="$sPRIEUldbl"
13637 nvFUformat="$sPRIFUldbl"
13638 nvGUformat="$sPRIGUldbl"
13648 case "$ivdformat" in
13649 '') echo "$0: Fatal: failed to find format strings, cannot continue." >& 4
13656 $echo "Checking the format string to be used for gids..." >&4
13659 -1) if $test X"$gidsize" = X"$ivsize"; then
13660 gidformat="$ivdformat"
13662 if $test X"$gidsize" = X"$longsize"; then
13665 if $test X"$gidsize" = X"$intsize"; then
13668 if $test X"$gidsize" = X"$shortsize"; then
13675 *) if $test X"$gidsize" = X"$uvsize"; then
13676 gidformat="$uvuformat"
13678 if $test X"$gidsize" = X"$longsize"; then
13681 if $test X"$gidsize" = X"$intsize"; then
13684 if $test X"$gidsize" = X"$shortsize"; then
13693 : see if getgroups exists
13694 set getgroups d_getgrps
13697 : see if setgroups exists
13698 set setgroups d_setgrps
13702 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
13704 case "$d_getgrps$d_setgrps" in
13706 case "$groupstype" in
13707 '') dflt="$gidtype" ;;
13708 *) dflt="$groupstype" ;;
13711 What type of pointer is the second argument to getgroups() and setgroups()?
13712 Usually this is the same as group ids, $gidtype, but not always.
13715 rp='What type pointer is the second argument to getgroups() and setgroups()?'
13719 *) groupstype="$gidtype";;
13723 echo "Checking if your $make program sets \$(MAKE)..." >&4
13724 case "$make_set_make" in
13726 $sed 's/^X //' > testmake.mak << 'EOF'
13728 X @echo 'maketemp="$(MAKE)"'
13730 case "`$make -f testmake.mak 2>/dev/null`" in
13731 *maketemp=*) make_set_make='#' ;;
13732 *) make_set_make="MAKE=$make" ;;
13734 $rm -f testmake.mak
13737 case "$make_set_make" in
13738 '#') echo "Yup, it does.";;
13739 *) echo "Nope, it doesn't.";;
13742 : see what type is used for mode_t
13743 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
13744 set mode_t modetype int stdio.h sys/types.h
13747 : see if stdarg is available
13749 if $test `./findhdr stdarg.h`; then
13750 echo "<stdarg.h> found." >&4
13753 echo "<stdarg.h> NOT found." >&4
13757 : see if varags is available
13759 if $test `./findhdr varargs.h`; then
13760 echo "<varargs.h> found." >&4
13762 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
13765 : set up the varargs testing programs
13766 $cat > varargs.c <<EOP
13768 #include <stdarg.h>
13771 #include <varargs.h>
13775 int f(char *p, ...)
13789 p = va_arg(ap, char *);
13794 $cat > varargs <<EOP
13796 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
13805 : now check which varargs header should be included
13810 if `./varargs I_STDARG`; then
13812 elif `./varargs I_VARARGS`; then
13817 if `./varargs I_VARARGS`; then
13824 echo "I could not find the definition for va_dcl... You have problems..." >&4
13825 val="$undef"; set i_stdarg; eval $setvar
13826 val="$undef"; set i_varargs; eval $setvar
13831 case "$i_varhdr" in
13833 val="$define"; set i_stdarg; eval $setvar
13834 val="$undef"; set i_varargs; eval $setvar
13837 val="$undef"; set i_stdarg; eval $setvar
13838 val="$define"; set i_varargs; eval $setvar
13841 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
13845 : see if we need va_copy
13847 case "$i_stdarg" in
13850 #include <stdarg.h>
13852 #$i_stdlib I_STDLIB
13854 #include <stdlib.h>
13856 #include <signal.h>
13859 ivfprintf(FILE *f, const char *fmt, va_list *valp)
13861 return vfprintf(f, fmt, *valp);
13865 myvfprintf(FILE *f, const char *fmt, va_list val)
13867 return ivfprintf(f, fmt, &val);
13871 myprintf(char *fmt, ...)
13874 va_start(val, fmt);
13875 return myvfprintf(stdout, fmt, val);
13879 main(int ac, char **av)
13881 signal(SIGSEGV, exit);
13883 myprintf("%s%cs all right, then\n", "that", '\'');
13888 if eval $compile && ./try 2>&1 >/dev/null; then
13890 "that's all right, then")
13896 yes) echo "It seems that you don't need va_copy()." >&4
13897 need_va_copy="$undef"
13899 *) echo "It seems that va_copy() or similar will be needed." >&4
13900 need_va_copy="$define"
13903 $rm -f try.* core core.* *.core *.core.*
13905 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
13909 : define a fucntion to check prototypes
13910 $cat > protochk <<EOSH
13913 optimize="$optimize"
13915 prototype="$prototype"
13920 $cat >> protochk <<'EOSH'
13925 while test $# -ge 2; do
13927 $define) echo "#include <$2>" >> try.c ;;
13928 literal) echo "$2" >> try.c ;;
13932 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
13933 cat >> try.c <<'EOCP'
13934 #ifdef CAN_PROTOTYPE
13935 #define _(args) args
13940 echo "$foo" >> try.c
13941 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
13942 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
13948 $eunicefix protochk
13950 : see what type is used for size_t
13951 rp="What is the type used for the length parameter for string functions?"
13952 set size_t sizetype 'unsigned int' stdio.h sys/types.h
13955 : check for type of arguments to gethostbyaddr.
13956 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
13957 case "$d_gethbyaddr" in
13961 Checking to see what type of arguments are accepted by gethostbyaddr().
13963 hdrs="$define sys/types.h
13964 $d_socket sys/socket.h
13965 $i_niin netinet/in.h
13967 $i_unistd unistd.h"
13968 : The first arg can 'char *' or 'void *'
13969 : The second arg is some of integral type
13970 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
13971 for yyy in size_t long int; do
13972 case "$netdb_host_type" in
13973 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
13974 if ./protochk "$try" $hdrs; then
13975 echo "Your system accepts $xxx for the first arg."
13976 echo "...and $yyy for the second arg."
13977 netdb_host_type="$xxx"
13978 netdb_hlen_type="$yyy"
13984 : In case none of those worked, prompt the user.
13985 case "$netdb_host_type" in
13986 '') rp='What is the type for the 1st argument to gethostbyaddr?'
13989 netdb_host_type=$ans
13990 rp='What is the type for the 2nd argument to gethostbyaddr?'
13993 netdb_hlen_type=$ans
13997 *) : no gethostbyaddr, so pick harmless defaults
13998 netdb_host_type='char *'
13999 netdb_hlen_type="$sizetype"
14002 # Remove the "const" if needed. -- but then we'll have a
14004 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
14007 : check for type of argument to gethostbyname.
14008 if test "X$netdb_name_type" = X ; then
14009 case "$d_gethbyname" in
14013 Checking to see what type of argument is accepted by gethostbyname().
14015 hdrs="$define sys/types.h
14016 $d_socket sys/socket.h
14017 $i_niin netinet/in.h
14019 $i_unistd unistd.h"
14020 for xxx in "const char *" "char *"; do
14021 case "$netdb_name_type" in
14022 '') try="extern struct hostent *gethostbyname($xxx);"
14023 if ./protochk "$try" $hdrs; then
14024 echo "Your system accepts $xxx."
14025 netdb_name_type="$xxx"
14030 : In case none of those worked, prompt the user.
14031 case "$netdb_name_type" in
14032 '') rp='What is the type for the 1st argument to gethostbyname?'
14035 netdb_name_type=$ans
14039 *) : no gethostbyname, so pick harmless default
14040 netdb_name_type='char *'
14045 : check for type of 1st argument to getnetbyaddr.
14046 if test "X$netdb_net_type" = X ; then
14047 case "$d_getnbyaddr" in
14051 Checking to see what type of 1st argument is accepted by getnetbyaddr().
14053 hdrs="$define sys/types.h
14054 $d_socket sys/socket.h
14055 $i_niin netinet/in.h
14057 $i_unistd unistd.h"
14058 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
14059 case "$netdb_net_type" in
14060 '') try="extern struct netent *getnetbyaddr($xxx, int);"
14061 if ./protochk "$try" $hdrs; then
14062 echo "Your system accepts $xxx."
14063 netdb_net_type="$xxx"
14068 : In case none of those worked, prompt the user.
14069 case "$netdb_net_type" in
14070 '') rp='What is the type for the 1st argument to getnetbyaddr?'
14073 netdb_net_type=$ans
14077 *) : no getnetbyaddr, so pick harmless default
14078 netdb_net_type='long'
14082 : locate the preferred pager for this system
14088 [a-zA-Z]:/*) dflt=$pg;;
14092 [a-zA-Z]:/*) dflt=$more;;
14096 [a-zA-Z]:/*) dflt=$less;;
14099 '') dflt=/usr/ucb/more;;
14106 rp='What pager is used on your system?'
14110 : see what type pids are declared as in the kernel
14111 rp="What is the type of process ids on this system?"
14112 set pid_t pidtype int stdio.h sys/types.h
14115 : Find earliest binary compatible site_perl subdirectory perl can use.
14116 case "$bincompat5005" in
14117 "$define") xs_apiversion='5.005' ;;
14118 *) xs_apiversion=$version ;; # The current site_perl version.
14120 : Find earliest pure perl site_perl subdirectory perl can use.
14121 : The versioned directories started at 5.005.
14122 pm_apiversion='5.005'
14124 : check for length of pointer
14128 echo "Checking to see how big your pointers are..." >&4
14129 if test "$voidflags" -gt 7; then
14130 echo '#define VOID_PTR char *' > try.c
14132 echo '#define VOID_PTR void *' > try.c
14134 $cat >>try.c <<'EOCP'
14138 printf("%d\n", (int)sizeof(VOID_PTR));
14143 if eval $compile_ok; then
14145 echo "Your pointers are $ptrsize bytes long."
14148 echo "(I can't seem to compile the test program. Guessing...)" >&4
14149 rp="What is the size of a pointer (in bytes)?"
14157 : see if ar generates random libraries by itself
14159 echo "Checking how to generate random libraries on your machine..." >&4
14160 echo 'int bar1() { return bar2(); }' > bar1.c
14161 echo 'int bar2() { return 2; }' > bar2.c
14162 $cat > foo.c <<'EOP'
14163 int main() { printf("%d\n", bar1()); exit(0); }
14165 $cc $ccflags -c bar1.c >/dev/null 2>&1
14166 $cc $ccflags -c bar2.c >/dev/null 2>&1
14167 $cc $ccflags -c foo.c >/dev/null 2>&1
14168 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
14169 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
14170 ./foobar >/dev/null 2>&1; then
14171 echo "$ar appears to generate random libraries itself."
14174 elif $ar ts bar$_a >/dev/null 2>&1 &&
14175 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
14176 ./foobar >/dev/null 2>&1; then
14177 echo "a table of contents needs to be added with '$ar ts'."
14184 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
14185 $test -f $ranlib || ranlib=''
14188 if $test -n "$ranlib"; then
14189 echo "your system has '$ranlib'; we'll use that."
14192 echo "your system doesn't seem to support random libraries"
14193 echo "so we'll use lorder and tsort to order the libraries."
14200 : check for type of arguments to select.
14201 case "$selecttype" in
14202 '') case "$d_select" in
14206 Checking to see what type of arguments are accepted by select().
14208 hdrs="$define sys/types.h
14209 $i_systime sys/time.h
14210 $i_sysselct sys/select.h
14211 $d_socket sys/socket.h"
14212 : The first arg can be int, unsigned, or size_t
14213 : The last arg may or may not be 'const'
14215 : void pointer has been seen but using that
14216 : breaks the selectminbits test
14217 for xxx in 'fd_set *' 'int *'; do
14218 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
14219 for tmo in 'struct timeval *' 'const struct timeval *'; do
14221 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
14222 if ./protochk "$try" $hdrs; then
14223 echo "Your system accepts $xxx."
14232 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
14233 case "$d_fd_set" in
14234 $define) dflt="fd_set *" ;;
14243 *) : no select, so pick a harmless default
14250 : check for the select 'width'
14251 case "$selectminbits" in
14252 '') case "$d_select" in
14256 Checking to see on how many bits at a time your select() operates...
14259 #include <sys/types.h>
14261 #$i_systime I_SYS_TIME
14262 #$i_systimek I_SYS_TIME_KERNEL
14267 # ifdef I_SYS_TIME_KERNEL
14270 # include <sys/time.h>
14271 # ifdef I_SYS_TIME_KERNEL
14275 #$i_sysselct I_SYS_SELECT
14276 #ifdef I_SYS_SELECT
14277 #include <sys/select.h>
14279 #$d_socket HAS_SOCKET
14281 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
14285 #define S sizeof(*(b))
14287 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
14288 #define NBITS (NBYTES * 8)
14297 fp = fopen("try.c", "r");
14303 b = ($selecttype)s;
14304 for (i = 0; i < NBITS; i++)
14308 select(fd + 1, b, 0, 0, &t);
14309 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
14310 printf("%d\n", i + 1);
14315 if eval $compile_ok; then
14316 selectminbits=`./try`
14317 case "$selectminbits" in
14319 Cannot figure out on how many bits at a time your select() operates.
14320 I'll play safe and guess it is 32 bits.
14326 *) bits="$selectminbits bits" ;;
14328 echo "Your select() operates on $bits at a time." >&4
14330 rp='What is the minimum number of bits your select() operates on?'
14331 case "$byteorder" in
14332 1234|12345678) dflt=32 ;;
14337 selectminbits="$val"
14341 *) : no select, so pick a harmless default
14348 : Trace out the files included by signal.h, then look for SIGxxx names.
14349 : Remove SIGARRAYSIZE used by HPUX.
14350 : Remove SIGSTKSIZE used by Linux.
14351 : Remove SIGSTKSZ used by Posix.
14352 : Remove SIGTYP void lines used by OS2.
14353 : Some cpps, like os390, dont give the file name anywhere
14354 if [ "X$fieldn" = X ]; then
14355 : Just make some guesses. We check them later.
14356 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
14358 xxx=`echo '#include <signal.h>' |
14359 $cppstdin $cppminus $cppflags 2>/dev/null |
14360 $grep '^[ ]*#.*include' |
14361 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq`
14363 : Check this list of files to be sure we have parsed the cpp output ok.
14364 : This will also avoid potentially non-existent files, such
14367 for xx in $xxx /dev/null ; do
14368 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
14370 : If we have found no files, at least try signal.h
14371 case "$xxxfiles" in
14372 '') xxxfiles=`./findhdr signal.h` ;;
14375 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
14376 print substr($2, 4, 20)
14378 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
14379 print substr($3, 4, 20)
14381 : Append some common names just in case the awk scan failed.
14382 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
14383 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
14384 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
14385 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
14386 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
14388 : generate a few handy files for later
14389 $cat > signal.c <<'EOCP'
14390 #include <sys/types.h>
14391 #include <signal.h>
14395 /* Strange style to avoid deeply-nested #if/#else/#endif */
14398 # define NSIG (_NSIG)
14404 # define NSIG (SIGMAX+1)
14410 # define NSIG (SIG_MAX+1)
14416 # define NSIG (MAXSIG+1)
14422 # define NSIG (MAX_SIG+1)
14427 # ifdef SIGARRAYSIZE
14428 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
14434 # define NSIG (_sys_nsig) /* Solaris 2.5 */
14438 /* Default to some arbitrary number that's big enough to get most
14439 of the common signals.
14445 printf("NSIG %d\n", NSIG);
14451 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
14453 printf "#ifdef SIG"; printf $1; printf "\n"
14454 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
14455 printf $1; printf ");\n"
14459 printf "#endif /* JUST_NSIG */\n";
14460 printf "exit(0);\n}\n";
14463 $cat >signal.awk <<'EOP'
14464 BEGIN { ndups = 0 }
14465 $1 ~ /^NSIG$/ { nsig = $2 }
14466 ($1 !~ /^NSIG$/) && (NF == 2) {
14467 if ($2 > maxsig) { maxsig = $2 }
14468 if (sig_name[$2]) {
14469 dup_name[ndups] = $1
14470 dup_num[ndups] = $2
14482 printf("NSIG %d\n", nsig);
14483 for (n = 1; n < nsig; n++) {
14485 printf("%s %d\n", sig_name[n], sig_num[n])
14488 printf("NUM%d %d\n", n, n)
14491 for (n = 0; n < ndups; n++) {
14492 printf("%s %d\n", dup_name[n], dup_num[n])
14496 $cat >signal_cmd <<EOS
14498 if $test -s signal.lst; then
14499 echo "Using your existing signal.lst file"
14504 $cat >>signal_cmd <<'EOS'
14507 if eval $compile_ok; then
14508 ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
14510 echo "(I can't seem be able to compile the whole test program)" >&4
14511 echo "(I'll try it in little pieces.)" >&4
14512 set signal -DJUST_NSIG
14513 if eval $compile_ok; then
14514 ./signal$_exe > signal.nsg
14517 echo "I can't seem to figure out how many signals you have." >&4
14518 echo "Guessing 50." >&4
14519 echo 'NSIG 50' > signal.nsg
14521 : Now look at all the signal names, one at a time.
14522 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
14523 $cat > signal.c <<EOCP
14524 #include <sys/types.h>
14525 #include <signal.h>
14528 printf("$xx %d\n", SIG${xx});
14533 if eval $compile; then
14534 echo "SIG${xx} found."
14535 ./signal$_exe >> signal.ls1
14537 echo "SIG${xx} NOT found."
14540 if $test -s signal.ls1; then
14541 $cat signal.nsg signal.ls1 |
14542 $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
14546 if $test -s signal.lst; then
14549 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
14550 echo 'kill -l' >signal
14551 set X `csh -f <signal`
14555 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
14557 echo $@ | $tr ' ' $trnl | \
14558 $awk '{ printf "%s %d\n", $1, ++s; }
14559 END { printf "NSIG %d\n", ++s }' >signal.lst
14561 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
14563 chmod a+x signal_cmd
14564 $eunicefix signal_cmd
14566 : generate list of signal names
14568 case "$sig_name_init" in
14570 *) case "$sig_num_init" in
14571 ''|*,*) doinit=yes ;;
14576 echo "Generating a list of signal names and numbers..." >&4
14578 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
14579 sig_name=`$awk 'BEGIN { printf "ZERO " }
14580 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
14581 sig_num=`$awk 'BEGIN { printf "0 " }
14582 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
14583 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
14584 !/^NSIG/ { printf "\"%s\", ", $1 }
14585 END { printf "0\n" }' signal.lst`
14586 sig_num_init=`$awk 'BEGIN { printf "0, " }
14587 !/^NSIG/ { printf "%d, ", $2}
14588 END { printf "0\n"}' signal.lst`
14591 echo "The following $sig_count signals are available:"
14593 echo $sig_name | $awk \
14594 'BEGIN { linelen = 0 }
14596 for (i = 1; i <= NF; i++) {
14597 name = "SIG" $i " "
14598 linelen = linelen + length(name)
14599 if (linelen > 70) {
14601 linelen = length(name)
14607 sig_size=`echo $sig_name | awk '{print NF}'`
14608 $rm -f signal signal.c signal.awk signal.lst signal_cmd
14611 case "$sizetype" in
14612 *_t) zzz="$sizetype" ;;
14613 *) zzz="filesize" ;;
14615 echo "Checking the size of $zzz..." >&4
14617 #include <sys/types.h>
14620 printf("%d\n", (int)sizeof($sizetype));
14625 if eval $compile_ok; then
14629 echo "(I can't execute the test program--guessing $sizesize.)" >&4
14632 echo "Your $zzz size is $sizesize bytes."
14637 echo "(I can't compile the test program--guessing $sizesize.)" >&4
14641 : check for socklen_t
14643 echo "Checking to see if you have socklen_t..." >&4
14645 #include <sys/types.h>
14646 #$d_socket HAS_SOCKET
14648 #include <sys/socket.h>
14650 int main() { socklen_t x = 16; }
14653 if eval $compile; then
14655 echo "You have socklen_t."
14658 echo "You do not have socklen_t."
14659 case "$sizetype" in
14660 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
14667 : see if this is a socks.h system
14668 set socks.h i_socks
14671 : check for type of the size argument to socket calls
14672 case "$d_socket" in
14676 Checking to see what type is the last argument of accept().
14679 case "$d_socklen_t" in
14680 "$define") yyy="$yyy socklen_t"
14682 yyy="$yyy $sizetype int long unsigned"
14683 for xxx in $yyy; do
14684 case "$socksizetype" in
14685 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
14686 case "$usesocks" in
14688 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
14689 echo "Your system accepts '$xxx *' for the last argument of accept()."
14690 socksizetype="$xxx"
14693 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
14694 echo "Your system accepts '$xxx *' for the last argument of accept()."
14695 socksizetype="$xxx"
14702 : In case none of those worked, prompt the user.
14703 case "$socksizetype" in
14704 '') rp='What is the type for socket address structure sizes?'
14711 *) : no sockets, so pick relatively harmless default
14716 : see what type is used for signed size_t
14717 set ssize_t ssizetype int stdio.h sys/types.h
14720 $cat > ssize.c <<EOM
14722 #include <sys/types.h>
14723 #define Size_t $sizetype
14724 #define SSize_t $dflt
14727 if (sizeof(Size_t) == sizeof(SSize_t))
14729 else if (sizeof(Size_t) == sizeof(int))
14738 if eval $compile_ok && ./ssize > /dev/null; then
14739 ssizetype=`./ssize`
14740 echo "I'll be using $ssizetype for functions returning a byte count." >&4
14743 Help! I can't compile and run the ssize_t test program: please enlighten me!
14744 (This is probably a misconfiguration in your system or libraries, and
14745 you really ought to fix it. Still, I'll try anyway.)
14747 I need a type that is the same size as $sizetype, but is guaranteed to
14748 be signed. Common values are ssize_t, int and long.
14751 rp="What signed type is the same size as $sizetype?"
14755 $rm -f ssize ssize.*
14757 : see what type of char stdio uses.
14759 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
14760 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
14761 echo "Your stdio uses unsigned chars." >&4
14762 stdchar="unsigned char"
14764 echo "Your stdio uses signed chars." >&4
14771 : see if time exists
14773 if test "X$d_time" = X -o X"$timetype" = X; then
14774 if set time val -f d_time; eval $csym; $val; then
14775 echo 'time() found.' >&4
14777 rp="What is the type returned by time() on this system?"
14778 set time_t timetype long stdio.h sys/types.h
14781 echo 'time() not found, hope that will do.' >&4
14789 : see what type uids are declared as in the kernel
14791 echo "Looking for the type for user ids returned by getuid()."
14792 set uid_t uidtype xxx stdio.h sys/types.h
14796 xxx=`./findhdr sys/user.h`
14797 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
14799 unsigned) dflt="$1 $2" ;;
14803 *) dflt="$uidtype";;
14806 uid_t) echo "uid_t found." ;;
14807 *) rp="What is the type for user ids returned by getuid()?"
14815 *_t) zzz="$uidtype" ;;
14818 echo "Checking the size of $zzz..." >&4
14820 #include <sys/types.h>
14823 printf("%d\n", (int)sizeof($uidtype));
14828 if eval $compile_ok; then
14832 echo "(I can't execute the test program--guessing $uidsize.)" >&4
14835 echo "Your $zzz is $uidsize bytes long."
14840 echo "(I can't compile the test program--guessing $uidsize.)" >&4
14845 *_t) zzz="$uidtype" ;;
14848 echo "Checking the sign of $zzz..." >&4
14850 #include <sys/types.h>
14861 if eval $compile; then
14865 echo "(I can't execute the test program--guessing unsigned.)" >&4
14869 1) echo "Your $zzz is unsigned." ;;
14870 -1) echo "Your $zzz is signed." ;;
14876 echo "(I can't compile the test program--guessing unsigned.)" >&4
14882 $echo "Checking the format string to be used for uids..." >&4
14885 -1) if $test X"$uidsize" = X"$ivsize"; then
14886 uidformat="$ivdformat"
14888 if $test X"$uidsize" = X"$longsize"; then
14891 if $test X"$uidsize" = X"$intsize"; then
14894 if $test X"$uidsize" = X"$shortsize"; then
14901 *) if $test X"$uidsize" = X"$uvsize"; then
14902 uidformat="$uvuformat"
14904 if $test X"$uidsize" = X"$longsize"; then
14907 if $test X"$uidsize" = X"$intsize"; then
14910 if $test X"$uidsize" = X"$shortsize"; then
14919 : see if dbm.h is available
14920 : see if dbmclose exists
14921 set dbmclose d_dbmclose
14924 case "$d_dbmclose" in
14934 *) set rpcsvc/dbm.h i_rpcsvcdbm
14939 *) echo "We won't be including <dbm.h>"
14949 : see if this is a sys/file.h system
14954 : do we need to include sys/file.h ?
14958 if $h_sysfile; then
14960 echo "We'll be including <sys/file.h>." >&4
14963 echo "We won't be including <sys/file.h>." >&4
14973 : see if fcntl.h is there
14978 : see if we can include fcntl.h
14984 echo "We'll be including <fcntl.h>." >&4
14987 if $h_sysfile; then
14988 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
14990 echo "We won't be including <fcntl.h>." >&4
15002 : see if this is a iconv.h system
15003 set iconv.h i_iconv
15006 : see if this is a ieeefp.h system
15007 set ieeefp.h i_ieeefp
15010 : see if this is a libutil.h system
15011 set libutil.h i_libutil
15014 : see if locale.h is available
15015 set locale.h i_locale
15018 : see if mach cthreads are available
15019 if test "X$usethreads" = "X$define"; then
15020 set mach/cthreads.h i_machcthr
15023 i_machcthr="$undef"
15028 : see if this is a math.h system
15032 : see if this is a mntent.h system
15033 set mntent.h i_mntent
15036 : see if ndbm.h is available
15041 : see if dbm_open exists
15042 set dbm_open d_dbm_open
15044 case "$d_dbm_open" in
15047 echo "We won't be including <ndbm.h>"
15056 : see if net/errno.h is available
15058 set net/errno.h val
15061 : Unfortunately, it causes problems on some systems. Arrgh.
15064 cat > try.c <<'EOM'
15067 #include <net/errno.h>
15073 if $cc $ccflags -c try.c >/dev/null 2>&1; then
15074 echo "We'll be including <net/errno.h>." >&4
15076 echo "We won't be including <net/errno.h>." >&4
15085 : see if netinet/tcp.h is available
15086 set netinet/tcp.h i_netinettcp
15089 : see if this is a poll.h system
15093 : see if this is a prot.h system
15098 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
15099 $cat <<'EOSH' > Cppsym.know
15100 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
15101 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
15102 alliant alpha am29000 AM29000 amiga AMIGAOS AMIX
15103 ansi ANSI_C_SOURCE apollo ardent atarist att386 att3b BeOS
15104 BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
15105 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
15106 bull c cadmus clipper CMU COFF COMPILER_VERSION
15107 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
15108 CYGWIN DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
15109 Dynix DynixPTX ELF encore EPI EXTENSIONS FILE_OFFSET_BITS
15110 FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
15111 GNU_SOURCE GNUC GNUC_MINOR GO32 gould GOULD_PN
15112 H3050R H3050RX hbullx20 hcx host_mips
15113 hp200 hp300 hp700 HP700 hp800 hp9000
15114 hp9000s200 hp9000s300 hp9000s400 hp9000s500
15115 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
15116 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
15117 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
15118 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
15119 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
15120 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
15121 Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
15122 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
15123 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
15124 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
15125 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
15126 MATH_HAS_NO_SIDE_EFFECTS
15127 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
15128 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
15129 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
15130 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
15131 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
15132 NetBSD news1500 news1700 news1800 news1900 news3700
15133 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
15134 ns32016 ns32332 ns32k nsc32000
15135 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
15136 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
15137 pc532 pdp11 PGC PIC plexus PORTAR posix
15138 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
15139 POSIX_C_SOURCE POSIX_SOURCE POWER
15140 PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
15141 riscix riscos RT scs SCO sequent sgi SGI_SOURCE sinix
15142 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
15143 sony sony_news sonyrisc sparc sparclite spectrum
15144 stardent stdc STDC_EXT stratos sun sun3 sun386
15145 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
15146 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
15147 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
15148 sysV68 sysV88 Tek4132 Tek4300 titan
15149 tower tower32 tower32_200 tower32_600 tower32_700
15150 tower32_800 tower32_850 tss
15151 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
15152 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
15153 unix UNIX95 UNIX99 unixpc unos USGr4 USGr4_2
15154 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms xenix Xenix286
15155 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
15156 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
15159 # Maybe put other stuff here too.
15160 cat <<EOSH >>Cppsym.know
15163 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
15164 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
15165 $cat Cppsym.know > Cppsym.c
15166 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
15167 $rm -f Cppsym.a Cppsym.b Cppsym.c
15168 cat <<EOSH > Cppsym
15170 if $test \$# -gt 0; then
15171 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
15172 if $test -s Cppsym.got; then
15179 $tr " " "$trnl" | ./Cppsym.try
15185 cat <<EOSH > Cppsym.try
15187 cat <<'EOCP' > try.c
15193 cat <<'EOSH' >> Cppsym.try
15195 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
15196 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
15197 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
15198 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
15202 cat <<EOSH >> Cppsym.try
15204 case "$osname-$gccversion" in
15205 irix-) ccflags="\$ccflags -woff 1178" ;;
15206 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
15208 $cc -o try $optimize \$ccflags $ldflags try.c $libs && ./try$exe_ext
15210 chmod +x Cppsym.try
15211 $eunicefix Cppsym.try
15212 ./Cppsym < Cppsym.know > Cppsym.true
15213 : now check the C compiler for additional symbols
15214 postprocess_cc_v=''
15216 aix) postprocess_cc_v="|$tr , ' '" ;;
15223 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
15226 -D*) echo "\$i" | $sed 's/^-D//';;
15227 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
15232 postprocess_cc_v=''
15235 ./ccsym > ccsym1.raw
15236 if $test -s ccsym1.raw; then
15237 $sort ccsym1.raw | $uniq >ccsym.raw
15239 mv ccsym1.raw ccsym.raw
15242 $awk '/\=/ { print $0; next }
15243 { print $0"=1" }' ccsym.raw >ccsym.list
15244 $awk '/\=/ { print $0; next }
15245 { print $0"=1" }' Cppsym.true >ccsym.true
15246 $comm -13 ccsym.true ccsym.list >ccsym.own
15247 $comm -12 ccsym.true ccsym.list >ccsym.com
15248 $comm -23 ccsym.true ccsym.list >ccsym.cpp
15250 if $test -z ccsym.raw; then
15251 echo "Your C compiler doesn't seem to define any symbols!" >&4
15253 echo "However, your C preprocessor defines the following symbols:"
15256 cppsymbols=`$cat Cppsym.true`
15257 cppsymbols=`echo $cppsymbols`
15258 cppccsymbols="$cppsymbols"
15260 if $test -s ccsym.com; then
15261 echo "Your C compiler and pre-processor define these symbols:"
15262 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
15265 cppccsymbols=`$cat ccsym.com`
15266 cppccsymbols=`echo $cppccsymbols`
15267 $test "$silent" || sleep 1
15269 if $test -s ccsym.cpp; then
15270 $test "$also" && echo " "
15271 echo "Your C pre-processor ${also}defines the following symbols:"
15272 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
15274 cppsymbols=`$cat ccsym.cpp`
15275 cppsymbols=`echo $cppsymbols`
15276 $test "$silent" || sleep 1
15278 if $test -s ccsym.own; then
15279 $test "$also" && echo " "
15280 echo "Your C compiler ${also}defines the following cpp symbols:"
15281 $sed -e 's/\(..*\)=1/\1/' ccsym.own
15282 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
15283 ccsymbols=`$cat ccsym.own`
15284 ccsymbols=`echo $ccsymbols`
15285 $test "$silent" || sleep 1
15288 $rm -f ccsym* Cppsym.*
15290 : see if this is a termio system
15294 if $test `./findhdr termios.h`; then
15295 set tcsetattr i_termios
15301 "$define") echo "You have POSIX termios.h... good!" >&4;;
15302 *) if ./Cppsym pyr; then
15303 case "`/bin/universe`" in
15304 ucb) if $test `./findhdr sgtty.h`; then
15306 echo "<sgtty.h> found." >&4
15308 echo "System is pyramid with BSD universe."
15309 echo "<sgtty.h> not found--you could have problems." >&4
15311 *) if $test `./findhdr termio.h`; then
15313 echo "<termio.h> found." >&4
15315 echo "System is pyramid with USG universe."
15316 echo "<termio.h> not found--you could have problems." >&4
15320 if $test `./findhdr termio.h`; then
15321 echo "<termio.h> found." >&4
15323 elif $test `./findhdr sgtty.h`; then
15324 echo "<sgtty.h> found." >&4
15327 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
15330 if $test `./findhdr sgtty.h`; then
15331 echo "<sgtty.h> found." >&4
15333 elif $test `./findhdr termio.h`; then
15334 echo "<termio.h> found." >&4
15337 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
15341 set i_termio; eval $setvar
15342 val=$val2; set i_sgtty; eval $setvar
15343 val=$val3; set i_termios; eval $setvar
15345 : see if this is a shadow.h system
15346 set shadow.h i_shadow
15349 : see if stddef is available
15350 set stddef.h i_stddef
15353 : see if this is a sunmath.h system
15354 set sunmath.h i_sunmath
15357 : see if sys/access.h is available
15358 set sys/access.h i_sysaccess
15361 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
15362 set sys/filio.h i_sysfilio
15365 if $test `./findhdr sys/ioctl.h`; then
15367 echo '<sys/ioctl.h> found.' >&4
15370 if $test $i_sysfilio = "$define"; then
15371 echo '<sys/ioctl.h> NOT found.' >&4
15373 $test $i_sgtty = "$define" && xxx="sgtty.h"
15374 $test $i_termio = "$define" && xxx="termio.h"
15375 $test $i_termios = "$define" && xxx="termios.h"
15376 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
15383 : see if this is a syslog.h system
15384 set syslog.h i_syslog
15388 : see if this is a sys/mode.h system
15389 set sys/mode.h i_sysmode
15392 : see if sys/resource.h has to be included
15393 set sys/resource.h i_sysresrc
15396 : see if sys/security.h is available
15397 set sys/security.h i_syssecrt
15400 : see if this is a sys/statvfs.h system
15401 set sys/statvfs.h i_sysstatvfs
15404 : see if this is a sys/uio.h system
15405 set sys/uio.h i_sysuio
15408 : see if this is a sys/un.h system
15409 set sys/un.h i_sysun
15413 : see if this is a sys/utsname.h system
15414 set sys/utsname.h i_sysutsname
15417 : see if this is a syswait system
15418 set sys/wait.h i_syswait
15421 : see if this is a ustat.h system
15422 set ustat.h i_ustat
15425 : see if this is an utime system
15426 set utime.h i_utime
15429 : see if this is a values.h system
15430 set values.h i_values
15433 : see if this is a vfork system
15436 set vfork.h i_vfork
15444 : see if gdbm.h is available
15449 : see if gdbm_open exists
15450 set gdbm_open d_gdbm_open
15452 case "$d_gdbm_open" in
15455 echo "We won't be including <gdbm.h>"
15465 echo "Looking for extensions..." >&4
15466 : If we are using the old config.sh, known_extensions may contain
15467 : old or inaccurate or duplicate values.
15468 known_extensions=''
15469 nonxs_extensions=''
15470 : We do not use find because it might not be available.
15471 : We do not just use MANIFEST because the user may have dropped
15472 : some additional extensions into the source tree and expect them
15475 : Function to recursively find available extensions, ignoring DynaLoader
15476 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
15480 DynaLoader|dynaload) ;;
15482 if $test -f $xxx/$xxx.xs; then
15483 known_extensions="$known_extensions $1$xxx";
15484 elif $test -f $xxx/Makefile.PL; then
15485 nonxs_extensions="$nonxs_extensions $1$xxx";
15487 if $test -d $xxx -a $# -lt 10; then
15490 eval $find_extensions;
15502 eval $find_extensions
15503 set X $nonxs_extensions
15505 nonxs_extensions="$*"
15506 set X $known_extensions
15508 known_extensions="$*"
15511 : Now see which are supported on this system.
15513 for xxx in $known_extensions ; do
15517 $define) avail_ext="$avail_ext $xxx" ;;
15520 GDBM_File|gdbm_fil)
15522 $define) avail_ext="$avail_ext $xxx" ;;
15525 NDBM_File|ndbm_fil)
15528 case "$osname-$use64bitint" in
15531 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
15534 *) avail_ext="$avail_ext $xxx" ;;
15539 ODBM_File|odbm_fil)
15540 case "${i_dbm}${i_rpcsvcdbm}" in
15542 case "$osname-$use64bitint" in
15545 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
15548 *) avail_ext="$avail_ext $xxx" ;;
15554 case "$useposix" in
15555 true|define|y) avail_ext="$avail_ext $xxx" ;;
15559 case "$useopcode" in
15560 true|define|y) avail_ext="$avail_ext $xxx" ;;
15564 case "$d_socket" in
15565 true|$define|y) avail_ext="$avail_ext $xxx" ;;
15568 Sys/Syslog|sys/syslog)
15569 : XXX syslog requires socket
15570 case "$d_socket" in
15571 true|$define|y) avail_ext="$avail_ext $xxx" ;;
15575 case "$usethreads" in
15576 true|$define|y) avail_ext="$avail_ext $xxx" ;;
15580 : XXX Do we need a useipcsysv variable here
15581 case "${d_msg}${d_sem}${d_shm}" in
15582 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
15585 *) avail_ext="$avail_ext $xxx"
15594 : Now see which nonxs extensions are supported on this system.
15595 : For now assume all are.
15597 for xxx in $nonxs_extensions ; do
15599 *) nonxs_ext="$nonxs_ext $xxx"
15611 A number of extensions are supplied with $package. You may choose to
15612 compile these extensions for dynamic loading (the default), compile
15613 them into the $package executable (static loading), or not include
15614 them at all. Answer "none" to include no extensions.
15615 Note that DynaLoader is always built and need not be mentioned here.
15618 case "$dynamic_ext" in
15619 '') dflt="$avail_ext" ;;
15620 *) dflt="$dynamic_ext"
15621 # Perhaps we are reusing an old out-of-date config.sh.
15624 if test X"$dynamic_ext" != X"$avail_ext"; then
15626 NOTICE: Your previous config.sh list may be incorrect.
15627 The extensions now available to you are
15629 but the default list from your previous config.sh is
15641 rp="What extensions do you wish to load dynamically?"
15644 none) dynamic_ext=' ' ;;
15645 *) dynamic_ext="$ans" ;;
15648 case "$static_ext" in
15650 : Exclude those already listed in dynamic linking
15652 for xxx in $avail_ext; do
15653 case " $dynamic_ext " in
15655 *) dflt="$dflt $xxx" ;;
15662 *) dflt="$static_ext"
15669 rp="What extensions do you wish to load statically?"
15672 none) static_ext=' ' ;;
15673 *) static_ext="$ans" ;;
15678 A number of extensions are supplied with $package. Answer "none"
15679 to include no extensions.
15680 Note that DynaLoader is always built and need not be mentioned here.
15683 case "$static_ext" in
15684 '') dflt="$avail_ext" ;;
15685 *) dflt="$static_ext"
15686 # Perhaps we are reusing an old out-of-date config.sh.
15689 if test X"$static_ext" != X"$avail_ext"; then
15691 NOTICE: Your previous config.sh list may be incorrect.
15692 The extensions now available to you are
15694 but the default list from your previous config.sh is
15703 : Exclude those that are not xs extensions
15707 rp="What extensions do you wish to include?"
15710 none) static_ext=' ' ;;
15711 *) static_ext="$ans" ;;
15716 set X $dynamic_ext $static_ext $nonxs_ext
15720 : Remove libraries needed only for extensions
15721 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
15722 : The exception is SunOS 4.x, which needs them.
15723 case "${osname}X${osvers}" in
15727 *) case "$usedl" in
15728 $define|true|[yY]*)
15729 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
15733 *) perllibs="$libs"
15739 : Remove build directory name from cppstdin so it can be used from
15740 : either the present location or the final installed location.
15742 : Get out of the UU directory to get correct path name.
15744 case "$cppstdin" in
15746 echo "Stripping down cppstdin path name"
15752 : end of configuration questions
15754 echo "End of configuration questions."
15757 : back to where it started
15758 if test -d ../UU; then
15762 : configuration may be patched via a 'config.over' file
15763 if $test -f config.over; then
15766 rp='I see a config.over file. Do you wish to load it?'
15769 n*) echo "OK, I'll ignore it.";;
15771 echo "Configuration override changes have been loaded."
15776 : in case they want portability, strip down executable paths
15777 case "$d_portable" in
15780 echo "Stripping down executable paths..." >&4
15781 for file in $loclist $trylist; do
15783 eval $file=`basename $temp`
15788 : create config.sh file
15790 echo "Creating config.sh..." >&4
15791 $spitshell <<EOT >config.sh
15794 # This file was produced by running the Configure script. It holds all the
15795 # definitions figured out by Configure. Should you modify one of these values,
15796 # do not forget to propagate your changes by running "Configure -der". You may
15797 # instead choose to run each of the .SH files by yourself, or "Configure -S".
15800 # Package name : $package
15801 # Source directory : $src
15802 # Configuration time: $cf_time
15803 # Configured by : $cf_by
15804 # Target system : $myuname
15814 Revision='$Revision'
15821 alignbytes='$alignbytes'
15822 ansi2knr='$ansi2knr'
15823 aphostname='$aphostname'
15824 api_revision='$api_revision'
15825 api_subversion='$api_subversion'
15826 api_version='$api_version'
15827 api_versionstring='$api_versionstring'
15830 archlibexp='$archlibexp'
15831 archname64='$archname64'
15832 archname='$archname'
15833 archobjs='$archobjs'
15838 bincompat5005='$bincompat5005'
15842 byteorder='$byteorder'
15844 castflags='$castflags'
15847 cccdlflags='$cccdlflags'
15848 ccdlflags='$ccdlflags'
15850 ccflags_uselargefiles='$ccflags_uselargefiles'
15852 ccsymbols='$ccsymbols'
15853 ccversion='$ccversion'
15855 cf_email='$cf_email'
15857 charsize='$charsize'
15861 clocktype='$clocktype'
15863 compress='$compress'
15864 contains='$contains'
15868 cpp_stuff='$cpp_stuff'
15869 cppccsymbols='$cppccsymbols'
15870 cppflags='$cppflags'
15872 cppminus='$cppminus'
15874 cppstdin='$cppstdin'
15875 cppsymbols='$cppsymbols'
15876 crosscompile='$crosscompile'
15877 cryptlib='$cryptlib'
15879 d_Gconvert='$d_Gconvert'
15880 d_PRIEUldbl='$d_PRIEUldbl'
15881 d_PRIFUldbl='$d_PRIFUldbl'
15882 d_PRIGUldbl='$d_PRIGUldbl'
15883 d_PRIXU64='$d_PRIXU64'
15884 d_PRId64='$d_PRId64'
15885 d_PRIeldbl='$d_PRIeldbl'
15886 d_PRIfldbl='$d_PRIfldbl'
15887 d_PRIgldbl='$d_PRIgldbl'
15888 d_PRIi64='$d_PRIi64'
15889 d_PRIo64='$d_PRIo64'
15890 d_PRIu64='$d_PRIu64'
15891 d_PRIx64='$d_PRIx64'
15892 d_SCNfldbl='$d_SCNfldbl'
15893 d__fwalk='$d__fwalk'
15894 d_access='$d_access'
15895 d_accessx='$d_accessx'
15897 d_archlib='$d_archlib'
15900 d_attribut='$d_attribut'
15903 d_bincompat5005='$d_bincompat5005'
15905 d_bsdgetpgrp='$d_bsdgetpgrp'
15906 d_bsdsetpgrp='$d_bsdsetpgrp'
15908 d_casti32='$d_casti32'
15909 d_castneg='$d_castneg'
15910 d_charvspr='$d_charvspr'
15912 d_chroot='$d_chroot'
15913 d_chsize='$d_chsize'
15914 d_closedir='$d_closedir'
15918 d_cuserid='$d_cuserid'
15919 d_dbl_dig='$d_dbl_dig'
15920 d_difftime='$d_difftime'
15921 d_dirnamlen='$d_dirnamlen'
15922 d_dlerror='$d_dlerror'
15923 d_dlopen='$d_dlopen'
15924 d_dlsymun='$d_dlsymun'
15925 d_dosuid='$d_dosuid'
15926 d_drand48proto='$d_drand48proto'
15928 d_eaccess='$d_eaccess'
15929 d_endgrent='$d_endgrent'
15930 d_endhent='$d_endhent'
15931 d_endnent='$d_endnent'
15932 d_endpent='$d_endpent'
15933 d_endpwent='$d_endpwent'
15934 d_endsent='$d_endsent'
15935 d_eofnblk='$d_eofnblk'
15936 d_eunice='$d_eunice'
15937 d_fchmod='$d_fchmod'
15938 d_fchown='$d_fchown'
15940 d_fcntl_can_lock='$d_fcntl_can_lock'
15941 d_fd_macros='$d_fd_macros'
15942 d_fd_set='$d_fd_set'
15943 d_fds_bits='$d_fds_bits'
15944 d_fgetpos='$d_fgetpos'
15945 d_flexfnam='$d_flexfnam'
15948 d_fpathconf='$d_fpathconf'
15949 d_fpos64_t='$d_fpos64_t'
15950 d_frexpl='$d_frexpl'
15951 d_fs_data_s='$d_fs_data_s'
15952 d_fseeko='$d_fseeko'
15953 d_fsetpos='$d_fsetpos'
15954 d_fstatfs='$d_fstatfs'
15955 d_fstatvfs='$d_fstatvfs'
15957 d_ftello='$d_ftello'
15959 d_getcwd='$d_getcwd'
15960 d_getespwnam='$d_getespwnam'
15961 d_getfsstat='$d_getfsstat'
15962 d_getgrent='$d_getgrent'
15963 d_getgrps='$d_getgrps'
15964 d_gethbyaddr='$d_gethbyaddr'
15965 d_gethbyname='$d_gethbyname'
15966 d_gethent='$d_gethent'
15967 d_gethname='$d_gethname'
15968 d_gethostprotos='$d_gethostprotos'
15969 d_getlogin='$d_getlogin'
15970 d_getmnt='$d_getmnt'
15971 d_getmntent='$d_getmntent'
15972 d_getnbyaddr='$d_getnbyaddr'
15973 d_getnbyname='$d_getnbyname'
15974 d_getnent='$d_getnent'
15975 d_getnetprotos='$d_getnetprotos'
15976 d_getpagsz='$d_getpagsz'
15977 d_getpbyname='$d_getpbyname'
15978 d_getpbynumber='$d_getpbynumber'
15979 d_getpent='$d_getpent'
15980 d_getpgid='$d_getpgid'
15981 d_getpgrp2='$d_getpgrp2'
15982 d_getpgrp='$d_getpgrp'
15983 d_getppid='$d_getppid'
15984 d_getprior='$d_getprior'
15985 d_getprotoprotos='$d_getprotoprotos'
15986 d_getprpwnam='$d_getprpwnam'
15987 d_getpwent='$d_getpwent'
15988 d_getsbyname='$d_getsbyname'
15989 d_getsbyport='$d_getsbyport'
15990 d_getsent='$d_getsent'
15991 d_getservprotos='$d_getservprotos'
15992 d_getspnam='$d_getspnam'
15993 d_gettimeod='$d_gettimeod'
15994 d_gnulibc='$d_gnulibc'
15995 d_grpasswd='$d_grpasswd'
15996 d_hasmntopt='$d_hasmntopt'
16000 d_inetaton='$d_inetaton'
16001 d_int64_t='$d_int64_t'
16002 d_isascii='$d_isascii'
16004 d_isnanl='$d_isnanl'
16005 d_killpg='$d_killpg'
16006 d_lchown='$d_lchown'
16007 d_ldbl_dig='$d_ldbl_dig'
16009 d_locconv='$d_locconv'
16011 d_longdbl='$d_longdbl'
16012 d_longlong='$d_longlong'
16013 d_lseekproto='$d_lseekproto'
16015 d_madvise='$d_madvise'
16017 d_mbstowcs='$d_mbstowcs'
16018 d_mbtowc='$d_mbtowc'
16019 d_memchr='$d_memchr'
16020 d_memcmp='$d_memcmp'
16021 d_memcpy='$d_memcpy'
16022 d_memmove='$d_memmove'
16023 d_memset='$d_memset'
16025 d_mkdtemp='$d_mkdtemp'
16026 d_mkfifo='$d_mkfifo'
16027 d_mkstemp='$d_mkstemp'
16028 d_mkstemps='$d_mkstemps'
16029 d_mktime='$d_mktime'
16032 d_mprotect='$d_mprotect'
16034 d_msg_ctrunc='$d_msg_ctrunc'
16035 d_msg_dontroute='$d_msg_dontroute'
16036 d_msg_oob='$d_msg_oob'
16037 d_msg_peek='$d_msg_peek'
16038 d_msg_proxy='$d_msg_proxy'
16039 d_msgctl='$d_msgctl'
16040 d_msgget='$d_msgget'
16041 d_msgrcv='$d_msgrcv'
16042 d_msgsnd='$d_msgsnd'
16044 d_munmap='$d_munmap'
16045 d_mymalloc='$d_mymalloc'
16047 d_nv_preserves_uv='$d_nv_preserves_uv'
16048 d_nv_preserves_uv_bits='$d_nv_preserves_uv_bits'
16049 d_off64_t='$d_off64_t'
16050 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
16051 d_oldpthreads='$d_oldpthreads'
16052 d_oldsock='$d_oldsock'
16054 d_pathconf='$d_pathconf'
16056 d_perl_otherlibdirs='$d_perl_otherlibdirs'
16057 d_phostname='$d_phostname'
16060 d_portable='$d_portable'
16061 d_pthread_yield='$d_pthread_yield'
16063 d_pwchange='$d_pwchange'
16064 d_pwclass='$d_pwclass'
16065 d_pwcomment='$d_pwcomment'
16066 d_pwexpire='$d_pwexpire'
16067 d_pwgecos='$d_pwgecos'
16068 d_pwpasswd='$d_pwpasswd'
16069 d_pwquota='$d_pwquota'
16072 d_readdir='$d_readdir'
16073 d_readlink='$d_readlink'
16074 d_rename='$d_rename'
16075 d_rewinddir='$d_rewinddir'
16077 d_safebcpy='$d_safebcpy'
16078 d_safemcpy='$d_safemcpy'
16079 d_sanemcmp='$d_sanemcmp'
16080 d_sbrkproto='$d_sbrkproto'
16081 d_sched_yield='$d_sched_yield'
16082 d_scm_rights='$d_scm_rights'
16083 d_seekdir='$d_seekdir'
16084 d_select='$d_select'
16086 d_semctl='$d_semctl'
16087 d_semctl_semid_ds='$d_semctl_semid_ds'
16088 d_semctl_semun='$d_semctl_semun'
16089 d_semget='$d_semget'
16091 d_setegid='$d_setegid'
16092 d_seteuid='$d_seteuid'
16093 d_setgrent='$d_setgrent'
16094 d_setgrps='$d_setgrps'
16095 d_sethent='$d_sethent'
16096 d_setlinebuf='$d_setlinebuf'
16097 d_setlocale='$d_setlocale'
16098 d_setnent='$d_setnent'
16099 d_setpent='$d_setpent'
16100 d_setpgid='$d_setpgid'
16101 d_setpgrp2='$d_setpgrp2'
16102 d_setpgrp='$d_setpgrp'
16103 d_setprior='$d_setprior'
16104 d_setproctitle='$d_setproctitle'
16105 d_setpwent='$d_setpwent'
16106 d_setregid='$d_setregid'
16107 d_setresgid='$d_setresgid'
16108 d_setresuid='$d_setresuid'
16109 d_setreuid='$d_setreuid'
16110 d_setrgid='$d_setrgid'
16111 d_setruid='$d_setruid'
16112 d_setsent='$d_setsent'
16113 d_setsid='$d_setsid'
16114 d_setvbuf='$d_setvbuf'
16118 d_shmatprototype='$d_shmatprototype'
16119 d_shmctl='$d_shmctl'
16121 d_shmget='$d_shmget'
16122 d_sigaction='$d_sigaction'
16123 d_sigprocmask='$d_sigprocmask'
16124 d_sigsetjmp='$d_sigsetjmp'
16125 d_socket='$d_socket'
16126 d_socklen_t='$d_socklen_t'
16127 d_sockpair='$d_sockpair'
16128 d_socks5_init='$d_socks5_init'
16130 d_statblks='$d_statblks'
16131 d_statfs_f_flags='$d_statfs_f_flags'
16132 d_statfs_s='$d_statfs_s'
16133 d_statvfs='$d_statvfs'
16134 d_stdio_cnt_lval='$d_stdio_cnt_lval'
16135 d_stdio_ptr_lval='$d_stdio_ptr_lval'
16136 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
16137 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
16138 d_stdio_stream_array='$d_stdio_stream_array'
16139 d_stdiobase='$d_stdiobase'
16140 d_stdstdio='$d_stdstdio'
16141 d_strchr='$d_strchr'
16142 d_strcoll='$d_strcoll'
16143 d_strctcpy='$d_strctcpy'
16144 d_strerrm='$d_strerrm'
16145 d_strerror='$d_strerror'
16146 d_strtod='$d_strtod'
16147 d_strtol='$d_strtol'
16148 d_strtold='$d_strtold'
16149 d_strtoll='$d_strtoll'
16150 d_strtoq='$d_strtoq'
16151 d_strtoul='$d_strtoul'
16152 d_strtoull='$d_strtoull'
16153 d_strtouq='$d_strtouq'
16154 d_strxfrm='$d_strxfrm'
16155 d_suidsafe='$d_suidsafe'
16156 d_symlink='$d_symlink'
16157 d_syscall='$d_syscall'
16158 d_sysconf='$d_sysconf'
16159 d_sysernlst='$d_sysernlst'
16160 d_syserrlst='$d_syserrlst'
16161 d_system='$d_system'
16162 d_tcgetpgrp='$d_tcgetpgrp'
16163 d_tcsetpgrp='$d_tcsetpgrp'
16164 d_telldir='$d_telldir'
16165 d_telldirproto='$d_telldirproto'
16168 d_truncate='$d_truncate'
16169 d_tzname='$d_tzname'
16172 d_union_semun='$d_union_semun'
16174 d_vendorarch='$d_vendorarch'
16175 d_vendorbin='$d_vendorbin'
16176 d_vendorlib='$d_vendorlib'
16178 d_void_closedir='$d_void_closedir'
16179 d_voidsig='$d_voidsig'
16180 d_voidtty='$d_voidtty'
16181 d_volatile='$d_volatile'
16182 d_vprintf='$d_vprintf'
16184 d_waitpid='$d_waitpid'
16185 d_wcstombs='$d_wcstombs'
16186 d_wctomb='$d_wctomb'
16189 db_hashtype='$db_hashtype'
16190 db_prefixtype='$db_prefixtype'
16191 defvoidused='$defvoidused'
16192 direntrytype='$direntrytype'
16195 doublesize='$doublesize'
16197 dynamic_ext='$dynamic_ext'
16203 eunicefix='$eunicefix'
16206 extensions='$extensions'
16207 fflushNULL='$fflushNULL'
16208 fflushall='$fflushall'
16210 firstmakefile='$firstmakefile'
16212 fpossize='$fpossize'
16213 fpostype='$fpostype'
16214 freetype='$freetype'
16216 full_csh='$full_csh'
16217 full_sed='$full_sed'
16218 gccosandvers='$gccosandvers'
16219 gccversion='$gccversion'
16220 gidformat='$gidformat'
16226 groupcat='$groupcat'
16227 groupstype='$groupstype'
16230 h_sysfile='$h_sysfile'
16241 i_arpainet='$i_arpainet'
16242 i_bsdioctl='$i_bsdioctl'
16245 i_dirent='$i_dirent'
16253 i_ieeefp='$i_ieeefp'
16254 i_inttypes='$i_inttypes'
16255 i_libutil='$i_libutil'
16256 i_limits='$i_limits'
16257 i_locale='$i_locale'
16258 i_machcthr='$i_machcthr'
16259 i_malloc='$i_malloc'
16261 i_memory='$i_memory'
16262 i_mntent='$i_mntent'
16265 i_neterrno='$i_neterrno'
16266 i_netinettcp='$i_netinettcp'
16270 i_pthread='$i_pthread'
16272 i_rpcsvcdbm='$i_rpcsvcdbm'
16275 i_shadow='$i_shadow'
16277 i_stdarg='$i_stdarg'
16278 i_stddef='$i_stddef'
16279 i_stdlib='$i_stdlib'
16280 i_string='$i_string'
16281 i_sunmath='$i_sunmath'
16282 i_sysaccess='$i_sysaccess'
16283 i_sysdir='$i_sysdir'
16284 i_sysfile='$i_sysfile'
16285 i_sysfilio='$i_sysfilio'
16287 i_sysioctl='$i_sysioctl'
16288 i_syslog='$i_syslog'
16289 i_sysmman='$i_sysmman'
16290 i_sysmode='$i_sysmode'
16291 i_sysmount='$i_sysmount'
16292 i_sysndir='$i_sysndir'
16293 i_sysparam='$i_sysparam'
16294 i_sysresrc='$i_sysresrc'
16295 i_syssecrt='$i_syssecrt'
16296 i_sysselct='$i_sysselct'
16297 i_syssockio='$i_syssockio'
16298 i_sysstat='$i_sysstat'
16299 i_sysstatfs='$i_sysstatfs'
16300 i_sysstatvfs='$i_sysstatvfs'
16301 i_systime='$i_systime'
16302 i_systimek='$i_systimek'
16303 i_systimes='$i_systimes'
16304 i_systypes='$i_systypes'
16305 i_sysuio='$i_sysuio'
16307 i_sysutsname='$i_sysutsname'
16308 i_sysvfs='$i_sysvfs'
16309 i_syswait='$i_syswait'
16310 i_termio='$i_termio'
16311 i_termios='$i_termios'
16313 i_unistd='$i_unistd'
16316 i_values='$i_values'
16317 i_varargs='$i_varargs'
16318 i_varhdr='$i_varhdr'
16320 ignore_versioned_solibs='$ignore_versioned_solibs'
16321 inc_version_list='$inc_version_list'
16322 inc_version_list_init='$inc_version_list_init'
16325 installarchlib='$installarchlib'
16326 installbin='$installbin'
16327 installman1dir='$installman1dir'
16328 installman3dir='$installman3dir'
16329 installprefix='$installprefix'
16330 installprefixexp='$installprefixexp'
16331 installprivlib='$installprivlib'
16332 installscript='$installscript'
16333 installsitearch='$installsitearch'
16334 installsitebin='$installsitebin'
16335 installsitelib='$installsitelib'
16336 installstyle='$installstyle'
16337 installusrbinperl='$installusrbinperl'
16338 installvendorarch='$installvendorarch'
16339 installvendorbin='$installvendorbin'
16340 installvendorlib='$installvendorlib'
16342 issymlink='$issymlink'
16343 ivdformat='$ivdformat'
16346 known_extensions='$known_extensions'
16349 lddlflags='$lddlflags'
16351 ldflags_uselargefiles='$ldflags_uselargefiles'
16352 ldlibpthname='$ldlibpthname'
16359 libsdirs='$libsdirs'
16360 libsfiles='$libsfiles'
16361 libsfound='$libsfound'
16362 libspath='$libspath'
16363 libswanted='$libswanted'
16364 libswanted_uselargefiles='$libswanted_uselargefiles'
16370 locincpth='$locincpth'
16371 loclibpth='$loclibpth'
16372 longdblsize='$longdblsize'
16373 longlongsize='$longlongsize'
16374 longsize='$longsize'
16378 lseeksize='$lseeksize'
16379 lseektype='$lseektype'
16383 make_set_make='$make_set_make'
16384 mallocobj='$mallocobj'
16385 mallocsrc='$mallocsrc'
16386 malloctype='$malloctype'
16388 man1direxp='$man1direxp'
16391 man3direxp='$man3direxp'
16393 mips_type='$mips_type'
16395 mmaptype='$mmaptype'
16396 modetype='$modetype'
16398 multiarch='$multiarch'
16400 myarchname='$myarchname'
16401 mydomain='$mydomain'
16402 myhostname='$myhostname'
16405 need_va_copy='$need_va_copy'
16406 netdb_hlen_type='$netdb_hlen_type'
16407 netdb_host_type='$netdb_host_type'
16408 netdb_name_type='$netdb_name_type'
16409 netdb_net_type='$netdb_net_type'
16412 nm_so_opt='$nm_so_opt'
16413 nonxs_ext='$nonxs_ext'
16415 nvEUformat='$nvEUformat'
16416 nvFUformat='$nvFUformat'
16417 nvGUformat='$nvGUformat'
16418 nveformat='$nveformat'
16419 nvfformat='$nvfformat'
16420 nvgformat='$nvgformat'
16423 o_nonblock='$o_nonblock'
16425 old_pthread_create_joinable='$old_pthread_create_joinable'
16426 optimize='$optimize'
16427 orderlib='$orderlib'
16430 otherlibdirs='$otherlibdirs'
16434 patchlevel='$patchlevel'
16435 path_sep='$path_sep'
16438 perladmin='$perladmin'
16439 perllibs='$perllibs'
16440 perlpath='$perlpath'
16442 phostname='$phostname'
16445 pm_apiversion='$pm_apiversion'
16449 prefixexp='$prefixexp'
16451 privlibexp='$privlibexp'
16452 prototype='$prototype'
16454 quadkind='$quadkind'
16455 quadtype='$quadtype'
16456 randbits='$randbits'
16457 randfunc='$randfunc'
16458 randseedtype='$randseedtype'
16460 rd_nodata='$rd_nodata'
16461 revision='$revision'
16465 sPRIEUldbl='$sPRIEUldbl'
16466 sPRIFUldbl='$sPRIFUldbl'
16467 sPRIGUldbl='$sPRIGUldbl'
16468 sPRIXU64='$sPRIXU64'
16470 sPRIeldbl='$sPRIeldbl'
16471 sPRIfldbl='$sPRIfldbl'
16472 sPRIgldbl='$sPRIgldbl'
16477 sSCNfldbl='$sSCNfldbl'
16478 sched_yield='$sched_yield'
16479 scriptdir='$scriptdir'
16480 scriptdirexp='$scriptdirexp'
16482 seedfunc='$seedfunc'
16483 selectminbits='$selectminbits'
16484 selecttype='$selecttype'
16485 sendmail='$sendmail'
16488 sharpbang='$sharpbang'
16489 shmattype='$shmattype'
16490 shortsize='$shortsize'
16493 sig_count='$sig_count'
16494 sig_name='$sig_name'
16495 sig_name_init='$sig_name_init'
16497 sig_num_init='$sig_num_init'
16498 sig_size='$sig_size'
16499 signal_t='$signal_t'
16500 sitearch='$sitearch'
16501 sitearchexp='$sitearchexp'
16503 sitebinexp='$sitebinexp'
16505 sitelib_stem='$sitelib_stem'
16506 sitelibexp='$sitelibexp'
16507 siteprefix='$siteprefix'
16508 siteprefixexp='$siteprefixexp'
16509 sizesize='$sizesize'
16510 sizetype='$sizetype'
16514 sockethdr='$sockethdr'
16515 socketlib='$socketlib'
16516 socksizetype='$socksizetype'
16518 spackage='$spackage'
16519 spitshell='$spitshell'
16521 ssizetype='$ssizetype'
16522 startperl='$startperl'
16524 static_ext='$static_ext'
16526 stdio_base='$stdio_base'
16527 stdio_bufsiz='$stdio_bufsiz'
16528 stdio_cnt='$stdio_cnt'
16529 stdio_filbuf='$stdio_filbuf'
16530 stdio_ptr='$stdio_ptr'
16531 stdio_stream_array='$stdio_stream_array'
16534 subversion='$subversion'
16541 timeincl='$timeincl'
16542 timetype='$timetype'
16555 uidformat='$uidformat'
16561 uquadtype='$uquadtype'
16562 use5005threads='$use5005threads'
16563 use64bitall='$use64bitall'
16564 use64bitint='$use64bitint'
16566 useithreads='$useithreads'
16567 uselargefiles='$uselargefiles'
16568 uselongdouble='$uselongdouble'
16569 usemorebits='$usemorebits'
16570 usemultiplicity='$usemultiplicity'
16571 usemymalloc='$usemymalloc'
16573 useopcode='$useopcode'
16574 useperlio='$useperlio'
16575 useposix='$useposix'
16577 useshrplib='$useshrplib'
16578 usesocks='$usesocks'
16579 usethreads='$usethreads'
16580 usevendorprefix='$usevendorprefix'
16581 usevfork='$usevfork'
16584 uvXUformat='$uvXUformat'
16585 uvoformat='$uvoformat'
16588 uvuformat='$uvuformat'
16589 uvxformat='$uvxformat'
16590 vendorarch='$vendorarch'
16591 vendorarchexp='$vendorarchexp'
16592 vendorbin='$vendorbin'
16593 vendorbinexp='$vendorbinexp'
16594 vendorlib='$vendorlib'
16595 vendorlib_stem='$vendorlib_stem'
16596 vendorlibexp='$vendorlibexp'
16597 vendorprefix='$vendorprefix'
16598 vendorprefixexp='$vendorprefixexp'
16600 versiononly='$versiononly'
16602 voidflags='$voidflags'
16604 xs_apiversion='$xs_apiversion'
16609 : Add in command line options if available
16610 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
16612 : add special variables
16613 $test -f $src/patchlevel.h && \
16614 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
16615 echo "CONFIGDOTSH=true" >>config.sh
16617 : propagate old symbols
16618 if $test -f UU/config.sh; then
16619 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
16620 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
16621 $sort | $uniq -u >UU/oldsyms
16622 set X `cat UU/oldsyms`
16628 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
16630 echo "# Variables propagated from previous config.sh file." >>config.sh
16631 for sym in `cat UU/oldsyms`; do
16632 echo " Propagating $hint variable "'$'"$sym..."
16633 eval 'tmp="$'"${sym}"'"'
16635 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
16641 : Finish up by extracting the .SH files
16655 If you'd like to make any changes to the config.sh file before I begin
16656 to configure things, do it as a shell escape now (e.g. !vi config.sh).
16659 rp="Press return or use a shell escape to edit config.sh:"
16664 *) : in case they cannot read
16665 sh 1>&4 -c "$ans";;
16670 : if this fails, just run all the .SH files by hand
16677 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
16684 Now you need to generate make dependencies by running "$make depend".
16685 You might prefer to run it in background: "$make depend > makedepend.out &"
16686 It can take a while, so you might not want to run it right now.
16691 rp="Run $make depend now?"
16695 $make depend && echo "Now you must run '$make'."
16698 echo "You must run '$make depend' then '$make'."
16701 elif test -f [Mm]akefile; then
16703 echo "Now you must run a $make."
16708 if $test -f Policy.sh; then
16711 If you compile $package on a different machine or from a different object
16712 directory, copy the Policy.sh file from this object directory to the
16713 new one before you run Configure -- this will help you with most of
16714 the policy defaults.
16718 if $test -f config.msg; then
16719 echo "Hmm. I also noted the following information while running:"
16721 $cat config.msg >&4
16724 $rm -f kit*isdone ark*isdone