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 Wed Apr 25 03:57:52 EET DST 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
468 d_old_pthread_create_joinable=''
469 old_pthread_create_joinable=''
553 d_stdio_ptr_lval_nochange_cnt=''
554 d_stdio_ptr_lval_sets_cnt=''
731 inc_version_list_init=''
750 ignore_versioned_solibs=''
809 d_perl_otherlibdirs=''
826 d_nv_preserves_uv_bits=''
925 d_stdio_stream_array=''
926 stdio_stream_array=''
936 ccflags_uselargefiles=''
937 ldflags_uselargefiles=''
938 libswanted_uselargefiles=''
983 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
986 : We must find out about Eunice early
988 if test -f /etc/unixtovms; then
989 eunicefix=/etc/unixtovms
991 if test -f /etc/unixtovms.exe; then
992 eunicefix=/etc/unixtovms.exe
999 : set useposix=false in your hint file to disable the POSIX extension.
1001 : set useopcode=false in your hint file to disable the Opcode extension.
1003 : Trailing extension. Override this in a hint file, if needed.
1005 : Extra object files, if any, needed on this platform.
1008 : Possible local include directories to search.
1009 : Set locincpth to "" in a hint file to defeat local include searches.
1010 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1011 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1013 : no include file wanted by default
1017 : change the next line if compiling for Xenix/286 on Xenix/386
1018 xlibpth='/usr/lib/386 /lib/386'
1019 : Possible local library directories to search.
1020 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1021 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1023 : general looking path for locating libraries
1024 glibpth="/lib /usr/lib $xlibpth"
1025 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1026 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1027 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1029 : Private path used by Configure to find libraries. Its value
1030 : is prepended to libpth. This variable takes care of special
1031 : machines, like the mips. Usually, it should be empty.
1034 : default library list
1036 : some systems want to use only the non-versioned libso:s
1037 ignore_versioned_solibs=''
1039 ccflags_uselargefiles=''
1040 ldflags_uselargefiles=''
1041 libswanted_uselargefiles=''
1042 : set usemultiplicity on the Configure command line to enable multiplicity.
1043 : set usesocks on the Configure command line to enable socks.
1044 : set usethreads on the Configure command line to enable threads.
1045 : full support for void wanted by default
1048 : List of libraries we want.
1049 : If anyone needs -lnet, put it in a hint file.
1050 libswanted='sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl'
1051 libswanted="$libswanted dld ld sun m c cposix posix"
1052 libswanted="$libswanted ndir dir crypt sec"
1053 libswanted="$libswanted ucb bsd BSD PW x iconv util"
1054 : We probably want to search /usr/shlib before most other libraries.
1055 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1056 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1057 glibpth="/usr/shlib $glibpth"
1058 : Do not use vfork unless overridden by a hint file.
1061 : Find the basic shell for Bourne shell scripts
1065 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1068 if test -f "$xxx"; then
1071 : Build up a list and do a single loop so we can 'break' out.
1072 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1073 for xxx in sh bash ksh pdksh ash; do
1075 try="$try ${p}/${xxx}"
1079 if test -f "$xxx"; then
1082 elif test -f "$xxx.exe"; then
1093 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1095 Usually it's in /bin/sh. How did you even get this far?
1096 Please contact me (Perl Maintainers) at perlbug@perl.org and
1097 we'll try to straighten this all out.
1103 : see if sh knows # comments
1104 if `$sh -c '#' >/dev/null 2>&1`; then
1108 test -f $xcat || xcat=/usr/bin/cat
1113 if test -s today; then
1116 echo "#! $xcat" > try
1120 if test -s today; then
1128 echo "Your $sh doesn't grok # comments--I will strip them later on."
1131 echo "exec grep -v '^[ ]*#'" >spitshell
1133 $eunicefix spitshell
1134 spitshell=`pwd`/spitshell
1136 echo "I presume that if # doesn't work, #! won't work either!"
1141 : figure out how to guarantee sh startup
1143 '') startsh=${sharpbang}${sh} ;;
1155 : echo "Yup, it does."
1157 echo "Hmm... '$startsh' does not guarantee sh startup..."
1158 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1163 : Save command line options in file UU/cmdline.opt for later use in
1164 : generating config.sh.
1165 cat > cmdline.opt <<EOSH
1166 # Configure command line arguments.
1173 cat >>cmdline.opt <<EOSH
1174 config_arg$argn='$arg'
1176 argn=`expr $argn + 1`
1179 : produce awk script to parse command line options
1180 cat >options.awk <<'EOF'
1182 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1184 len = length(optstr);
1185 for (i = 1; i <= len; i++) {
1186 c = substr(optstr, i, 1);
1187 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1198 if (substr(str, 1, 1) != "-") {
1199 printf("'%s'\n", str);
1203 for (i = 2; i <= len; i++) {
1204 c = substr(str, i, 1);
1206 printf("-%s\n", substr(str, i));
1212 printf("'%s'\n", substr(str, i + 1));
1225 : process the command line options
1226 set X `for arg in "$@"; do echo "X$arg"; done |
1227 sed -e s/X// | awk -f options.awk`
1232 : set up default values
1242 rm -f optdef.sh posthint.sh
1243 cat >optdef.sh <<EOS
1249 while test $# -gt 0; do
1251 -d) shift; fastread=yes;;
1252 -e) shift; alldone=cont;;
1256 if test -r "$1"; then
1259 echo "$me: cannot read config file $1." >&2
1264 -h) shift; error=true;;
1265 -r) shift; reuseval=true;;
1266 -s) shift; silent=true; realsilent=true;;
1267 -E) shift; alldone=exit;;
1268 -K) shift; knowitall=true;;
1269 -O) shift; override=true;;
1270 -S) shift; silent=true; extractsh=true;;
1275 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1276 echo "$me: ignoring -D $1" >&2
1279 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1280 *) echo "$1='define'" >> optdef.sh;;
1287 *=) echo "$1" >> optdef.sh;;
1289 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1290 echo "$me: ignoring -U $1" >&2
1292 *) echo "$1='undef'" >> optdef.sh;;
1303 *=*) zzz=`echo $yyy|sed 's!=.*!!'`
1307 zzz=" "`echo $yyy|sed 's!^[^=]*=!!'`
1308 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1314 *:*) xxx=`echo $yyy|sed 's!:.*!!'`
1315 yyy=`echo $yyy|sed 's!^[^:]*:!!'`
1316 zzz=`echo $yyy|sed 's!^[^=]*=!!'`
1317 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1318 *) xxx=`echo $yyy|sed 's!:.*!!'`
1319 yyy=`echo $yyy|sed 's!^[^:]*:!!'` ;;
1325 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1327 echo "$yyy=''" >> posthint.sh ;;
1332 echo "$yyy='$zzz'" >> posthint.sh ;;
1334 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1336 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1341 echo "$yyy=$zzz" >> posthint.sh ;;
1342 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1346 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1349 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1357 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1358 [-U symbol] [-U symbol=] [-A command:symbol...]
1359 -d : use defaults for all answers.
1360 -e : go on without questioning past the production of config.sh.
1361 -f : specify an alternate default configuration file.
1362 -h : print this help message and exit (with an error status).
1363 -r : reuse C symbols value if possible (skips costly nm extraction).
1364 -s : silent mode, only echoes questions and essential information.
1365 -D : define symbol to have some value:
1366 -D symbol symbol gets the value 'define'
1367 -D symbol=value symbol gets the value 'value'
1368 -E : stop at the end of questions, after having produced config.sh.
1369 -K : do not use unless you know what you are doing.
1370 -O : let -D and -U override definitions from loaded configuration file.
1371 -S : perform variable substitutions on all .SH files (can mix with -f)
1372 -U : undefine symbol:
1373 -U symbol symbol gets the value 'undef'
1374 -U symbol= symbol gets completely empty
1375 -A : manipulate symbol after the platform specific hints have been applied:
1376 -A symbol=value append " "value to symbol
1377 -A append:symbol=value append value to symbol
1378 -A define:symbol=value define symbol to have value
1379 -A clear:symbol define symbol to be ''
1380 -A define:symbol define symbol to be 'define'
1381 -A eval:symbol=value define symbol to be eval of value
1382 -A prepend:symbol=value prepend value to symbol
1383 -A undef:symbol define symbol to be 'undef'
1384 -A undef:symbol= define symbol to be ''
1385 -V : print version number and exit (with a zero status).
1392 case "$fastread$alldone" in
1395 case "$extractsh" in
1398 if test ! -t 0; then
1399 echo "Say 'sh Configure', not 'sh <Configure'"
1409 true) exec 1>/dev/null;;
1412 : run the defines and the undefines, if any, but leave the file out there...
1415 : create the posthint manipulation script and leave the file out there...
1420 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1421 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1422 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1423 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1424 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1427 : Some greps do not return status, grrr.
1428 echo "grimblepritz" >grimble
1429 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1431 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1437 : the following should work in any shell
1441 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1442 cat >contains <<'EOSS'
1443 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1448 : Find the path to the source tree
1451 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1455 *) src=`cd ../$src && pwd` ;;
1468 if test -f $rsrc/Configure && \
1469 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1471 : found it, so we are ok.
1474 for src in . .. ../.. ../../.. ../../../..; do
1475 if test -f ../$src/Configure && \
1476 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1487 Sorry, I can't seem to locate the source dir for $package. Please start
1488 Configure with an explicit path -- i.e. /some/path/Configure.
1496 echo "Sources for $package found in \"$src\"." >&4
1500 : script used to extract .SH files with variable substitutions
1501 cat >extract <<'EOS'
1503 echo "Doing variable substitutions on .SH files..."
1504 if test -f $src/MANIFEST; then
1505 set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH$'`
1507 echo "(Looking for .SH files under the source directory.)"
1508 set x `(cd $src; find . -name "*.SH" -print)`
1512 0) set x `(cd $src; echo *.SH)`; shift;;
1514 if test ! -f $src/$1; then
1520 while test $name; do
1521 if test ! -d "$name"; then
1522 create="$name $create";
1523 name=`echo $name | sed -e "s|^[^/]*$||"`;
1524 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1529 for file in $create; do
1538 dir=`expr X$file : 'X\(.*\)/'`
1539 file=`expr X$file : 'X.*/\(.*\)'`
1540 (cd $dir && . ./$file)
1550 dir=`expr X$file : 'X\(.*\)/'`
1551 file=`expr X$file : 'X.*/\(.*\)'`
1552 (set x $dir; shift; eval $mkdir_p)
1562 if test -f $src/config_h.SH; then
1563 if test ! -f config.h; then
1564 : oops, they left it out of MANIFEST, probably, so do it anyway.
1570 : extract files and exit if asked to do so
1571 case "$extractsh" in
1573 case "$realsilent" in
1577 case "$config_sh" in
1578 '') config_sh='config.sh';;
1581 echo "Fetching answers from $config_sh..."
1584 test "$override" && . ./optdef.sh
1593 : Eunice requires " " instead of "", can you believe it
1596 echo "Beginning of configuration questions for $package."
1598 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1600 : first determine how to suppress newline on echo command
1602 echo "Checking echo to see how to suppress newlines..."
1603 (echo "hi there\c" ; echo " ") >.echotmp
1604 if $contains c .echotmp >/dev/null 2>&1 ; then
1615 echo $n "The star should be here-->$c"
1619 : Now test for existence of everything in MANIFEST
1621 if test -f $rsrc/MANIFEST; then
1622 echo "First let's make sure your kit is complete. Checking..." >&4
1623 awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
1626 for filelist in x??; do
1627 (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
1629 if test -s missing; then
1633 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1635 You have the option of continuing the configuration process, despite the
1636 distinct possibility that your kit is damaged, by typing 'y'es. If you
1637 do, don't blame me if something goes wrong. I advise you to type 'n'o
1638 and contact the author (perlbug@perl.org).
1641 echo $n "Continue? [n] $c" >&4
1645 echo "Continuing..." >&4
1649 echo "ABORTING..." >&4
1654 echo "Looks good..."
1657 echo "There is no MANIFEST file. I hope your kit is complete !"
1662 : Find the appropriate value for a newline for tr
1663 if test -n "$DJGPP"; then
1666 if test X"$trnl" = X; then
1667 case "`echo foo|tr '\n' x 2>/dev/null`" in
1671 if test X"$trnl" = X; then
1672 case "`echo foo|tr '\012' x 2>/dev/null`" in
1673 foox) trnl='\012' ;;
1676 if test X"$trnl" = X; then
1679 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1685 : compute the number of columns on the terminal for proper question formatting
1690 : set up the echo used in my read
1691 myecho="case \"\$xxxm\" in
1692 '') echo $n \"\$rp $c\" >&4;;
1694 '') echo $n \"[\$xxxm] $c\";;
1696 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1698 echo $n \"[\$xxxm] $c\" >&4
1700 echo $n \"\$rp [\$xxxm] $c\" >&4
1706 : now set up to do reads with possible shell escape and default assignment
1712 case "\$fastread" in
1713 yes) case "\$dflt" in
1716 case "\$silent-\$rp" in
1721 *) case "\$silent" in
1722 true) case "\$rp" in
1727 while expr "X\$ans" : "X!" >/dev/null; do
1731 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1739 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1748 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1753 echo "(OK, I'll run with -d after this question.)" >&4
1756 echo "*** Sorry, \$1 not supported yet." >&4
1766 echo "*** Substitution done -- please confirm."
1768 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1773 echo "*** Error -- try again."
1780 case "\$ans\$xxxm\$nostick" in
1792 : create .config dir to save info across Configure sessions
1793 test -d ../.config || mkdir ../.config
1794 cat >../.config/README <<EOF
1795 This directory created by Configure to save information that should
1796 persist across sessions for $package.
1798 You may safely delete it if you wish.
1801 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
1803 $define|true|[yY]*) ;;
1804 *) case "$xversion" in
1807 *** WHOA THERE!!! ***
1809 This is an UNSTABLE DEVELOPMENT release.
1810 The version of this $package distribution is $xversion, that is, odd,
1811 (as opposed to even) and that signifies a development release.
1812 If you want a maintenance release, you want an even-numbered version.
1814 Do ***NOT*** install this into production use.
1815 Data corruption and crashes are possible.
1817 It is most seriously suggested that you do not continue any further
1818 unless you want to help in developing and debugging Perl.
1820 If you *still* want to build perl, you can answer 'y' now,
1821 or pass -Dusedevel to Configure.
1824 rp='Do you really want to continue?'
1828 [yY]) echo >&4 "Okay, continuing."
1829 usedevel="$define" ;;
1830 *) echo >&4 "Okay, bye."
1840 case "$versiononly" in
1841 '') versiononly="$define" ;;
1843 case "$installusrbinperl" in
1844 '') installusrbinperl="$undef" ;;
1849 : general instructions
1852 user=`(logname) 2>/dev/null`
1854 '') user=`whoami 2>&1`;;
1856 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1859 rp='Would you like to see the instructions?'
1870 This installation shell script will examine your system and ask you questions
1871 to determine how the perl5 package should be installed. If you get
1872 stuck on a question, you may use a ! shell escape to start a subshell or
1873 execute a command. Many of the questions will have default answers in square
1874 brackets; typing carriage return will give you the default.
1876 On some of the questions which ask for file or directory names you are allowed
1877 to use the ~name construct to specify the login directory belonging to "name",
1878 even if you don't have a shell which knows about that. Questions where this is
1879 allowed will be marked "(~name ok)".
1883 dflt='Type carriage return to continue'
1887 The prompter used in this script allows you to use shell variables and
1888 backticks in your answers. You may use $1, $2, etc... to refer to the words
1889 in the default answer, as if the default line was a set of arguments given to a
1890 script shell. This means you may also use $* to repeat the whole default line,
1891 so you do not have to re-type everything to add something to the default.
1893 Everytime there is a substitution, you will have to confirm. If there is an
1894 error (e.g. an unmatched backtick), the default answer will remain unchanged
1895 and you will be prompted again.
1897 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1898 the questions and use the computed defaults (or the previous answers if there
1899 was already a config.sh file). Type 'Configure -h' for a list of options.
1900 You may also start interactively and then answer '& -d' at any prompt to turn
1901 on the non-interactive behaviour for the remainder of the execution.
1907 Much effort has been expended to ensure that this shell script will run on any
1908 Unix system. If despite that it blows up on yours, your best bet is to edit
1909 Configure and run it again. If you can't run Configure for some reason,
1910 you'll have to generate a config.sh file by hand. Whatever problems you
1911 have, let me (perlbug@perl.org) know how I blew it.
1913 This installation script affects things in two ways:
1915 1) it may do direct variable substitutions on some of the files included
1917 2) it builds a config.h file for inclusion in C programs. You may edit
1918 any of these files as the need arises after running this script.
1920 If you make a mistake on a question, there is no easy way to back up to it
1921 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1922 files. Configure will offer to let you do this before it runs the SH files.
1925 dflt='Type carriage return to continue'
1927 case "$firsttime" in
1928 true) echo $user >>../.config/instruct;;
1932 : find out where common programs are
1934 echo "Locating common programs..." >&4
1947 if test -d \$dir/\$thing; then
1953 for thisthing in \$dir/\$thing; do
1954 : just loop through to pick last item
1956 if test -f \$thisthing; then
1959 elif test -f \$dir/\$thing.exe; then
1960 if test -n "$DJGPP"; then
1961 echo \$dir/\$thing.exe
1963 : on Eunice apparently
2014 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2015 pth="$pth /lib /usr/lib"
2016 for file in $loclist; do
2020 if test -f "$xxx"; then
2023 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2024 xxx=`./loc $file $file $pth`
2027 '') xxx=`./loc $file $file $pth`;;
2028 *) xxx=`./loc $xxx $xxx $pth`;;
2034 echo $file is in $xxx.
2037 echo $file is in $xxx.
2040 echo "I don't know where '$file' is, and my life depends on it." >&4
2041 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2047 echo "Don't worry if any of the following aren't found..."
2049 for file in $trylist; do
2053 if test -f "$xxx"; then
2056 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2057 xxx=`./loc $file $file $pth`
2060 '') xxx=`./loc $file $file $pth`;;
2061 *) xxx=`./loc $xxx $xxx $pth`;;
2067 echo $file is in $xxx.
2070 echo $file is in $xxx.
2073 echo "I don't see $file out there, $say."
2080 echo "Substituting grep for egrep."
2086 echo "Substituting cp for ln."
2092 echo "Hopefully test is built into your sh."
2095 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2096 echo "Using the test built into your sh."
2104 echo "Hopefully echo is built into your sh."
2109 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2110 $echo $n "hi there$c" >foo1
2111 echo $n "hi there$c" >foo2
2112 if cmp foo1 foo2 >/dev/null 2>&1; then
2113 echo "They are compatible. In fact, they may be identical."
2120 They are not compatible! You are probably running ksh on a non-USG system.
2121 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2122 have echo built in and we may have to run some Bourne shell scripts. That
2123 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2126 $echo $n "The star should be here-->$c"
2136 cat <<'EOSC' >>checkcc
2141 int main(int argc, char *argv[]) {
2145 if $cc -o try $ccflags try.c; then
2148 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2154 case "`$cc -v -c try.c 2>&1`" in
2157 if $test X"$trygcc" = Xyes; then
2158 if gcc -o try -c try.c; then
2160 echo "You seem to have a working gcc, though." >&4
2161 rp="Would you like to use it?"
2163 if $test -f myread; then
2166 if $test -f UU/myread; then
2169 echo "Cannot find myread, sorry. Aborting." >&2
2174 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no ;;
2178 if $test X"$despair" = Xyes; then
2180 You need to find a working C compiler.
2181 Either (purchase and) install the C compiler supplied by your OS vendor,
2182 or for a free C compiler try http://gcc.gnu.org/
2183 I cannot continue any further, aborting.
2193 : determine whether symbolic links are supported
2196 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2197 echo "Symbolic links are supported." >&4
2200 echo "Symbolic links are NOT supported." >&4
2205 : determine whether symbolic links are supported
2209 echo "Checking how to test for symbolic links..." >&4
2211 if $test "X$issymlink" = X; then
2212 sh -c "PATH= test -h sym" >/dev/null 2>&1
2213 if test $? = 0; then
2217 if $test "X$issymlink" = X; then
2218 if $test -h >/dev/null 2>&1; then
2219 issymlink="$test -h"
2220 echo "Your builtin 'test -h' may be broken, I'm using external '$test -h'." >&4
2223 if $test "X$issymlink" = X; then
2224 if $test -L sym 2>/dev/null; then
2225 issymlink="$test -L"
2228 if $test "X$issymlink" != X; then
2229 echo "You can test for symbolic links with '$issymlink'." >&4
2231 echo "I do not know how you can test for symbolic links." >&4
2235 *) echo "No symbolic links, so not testing for their testing..." >&4
2241 case "$mksymlinks" in
2244 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2247 *) case "$lns:$issymlink" in
2248 *"ln -s:"*"test -"?)
2249 echo "Creating the symbolic links..." >&4
2250 echo "(First creating the subdirectories...)" >&4
2252 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2254 test -z "$directory" && break
2258 if test ! -d t/base; then
2259 echo "Failed to create the subdirectories. Aborting." >&4
2262 echo "(Then creating the symlinks...)" >&4
2263 awk '{print $1}' $src/MANIFEST | while true; do
2265 test -z "$filename" && break
2266 if test -f $filename; then
2267 if $issymlink $filename; then
2271 if test -f $filename; then
2272 echo "$filename already exists, not symlinking."
2274 ln -s $src/$filename $filename
2278 if test ! -f t/base/commonsense.t; then
2279 echo "Failed to create the symlinks. Aborting." >&4
2284 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2292 : see whether [:lower:] and [:upper:] are supported character classes
2294 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2296 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2300 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
2301 # (0xc9 and 0xd1), therefore that is a nice testing point.
2302 if test "X$up" = X -o "X$low" = X; then
2303 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
2309 if test "X$up" = X -o "X$low" = X; then
2310 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
2316 if test "X$up" = X -o "X$low" = X; then
2317 case "`echo IJ | od -x 2>/dev/null`" in
2319 echo "Hey, this might be EBCDIC." >&4
2320 if test "X$up" = X -o "X$low" = X; then
2321 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2322 ij) up='[A-IJ-RS-Z]'
2327 if test "X$up" = X -o "X$low" = X; then
2328 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2338 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
2340 echo "Using $up and $low to convert case." >&4
2343 echo "I don't know how to translate letters from upper to lower case." >&4
2344 echo "Your tr is not acting any way I know of." >&4
2348 : set up the translation script tr, must be called with ./tr of course
2352 '[A-Z][a-z]') exec $tr '$up' '$low';;
2353 '[a-z][A-Z]') exec $tr '$low' '$up';;
2360 : Try to determine whether config.sh was made on this system
2361 case "$config_sh" in
2363 myuname=`$uname -a 2>/dev/null`
2364 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2365 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2366 # because the A-Z/a-z are not consecutive.
2367 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2368 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2369 newmyuname="$myuname"
2371 case "$knowitall" in
2373 if test -f ../config.sh; then
2374 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2375 eval "`grep myuname= ../config.sh`"
2377 if test "X$myuname" = "X$newmyuname"; then
2385 : Get old answers from old config file if Configure was run on the
2386 : same system, otherwise use the hints.
2389 if test -f config.sh; then
2391 rp="I see a config.sh file. Shall I use it to set the defaults?"
2394 n*|N*) echo "OK, I'll ignore it."
2395 mv config.sh config.sh.old
2396 myuname="$newmyuname"
2398 *) echo "Fetching default answers from your old config.sh file..." >&4
2406 : Older versions did not always set $sh. Catch re-use of such
2416 if test ! -f config.sh; then
2419 First time through, eh? I have some defaults handy for some systems
2420 that need some extra help getting the Configure answers right:
2423 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2425 : Half the following guesses are probably wrong... If you have better
2426 : tests or hints, please send them to perlbug@perl.org
2427 : The metaconfig authors would also appreciate a copy...
2428 $test -f /irix && osname=irix
2429 $test -f /xenix && osname=sco_xenix
2430 $test -f /dynix && osname=dynix
2431 $test -f /dnix && osname=dnix
2432 $test -f /lynx.os && osname=lynxos
2433 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2434 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
2435 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2436 $test -f /bin/mips && /bin/mips && osname=mips
2437 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
2438 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
2439 $test -d /usr/apollo/bin && osname=apollo
2440 $test -f /etc/saf/_sactab && osname=svr4
2441 $test -d /usr/include/minix && osname=minix
2442 if $test -d /MachTen -o -d /MachTen_Folder; then
2444 if $test -x /sbin/version; then
2445 osvers=`/sbin/version | $awk '{print $2}' |
2446 $sed -e 's/[A-Za-z]$//'`
2447 elif $test -x /usr/etc/version; then
2448 osvers=`/usr/etc/version | $awk '{print $2}' |
2449 $sed -e 's/[A-Za-z]$//'`
2455 $test -f /sys/posix.dll &&
2456 $test -f /usr/bin/what &&
2457 set X `/usr/bin/what /sys/posix.dll` &&
2458 $test "$3" = UWIN &&
2462 if $test -f $uname; then
2470 umips) osname=umips ;;
2473 [23]100) osname=mips ;;
2474 next*) osname=next ;;
2476 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
2477 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
2480 elif $test -f /etc/kconfig; then
2482 if test "$lns" = "$ln -s"; then
2484 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
2486 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
2493 if test -n "$DJGPP"; then
2502 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
2504 'not found') osvers="$4"."$3" ;;
2505 '<3240'|'<>3240') osvers=3.2.0 ;;
2506 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
2507 '=3250'|'>3250') osvers=3.2.5 ;;
2511 bsd386) osname=bsd386
2514 cygwin*) osname=cygwin
2517 *dc.osx) osname=dcosx
2523 domainos) osname=apollo
2529 dynixptx*) osname=dynixptx
2530 osvers=`echo "$4"|sed 's/^v//'`
2532 freebsd) osname=freebsd
2534 genix) osname=genix ;;
2536 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
2552 netbsd*) osname=netbsd
2555 news-os) osvers="$3"
2557 4*) osname=newsos4 ;;
2561 next*) osname=next ;;
2562 nonstop-ux) osname=nonstopux ;;
2563 POSIX-BC | posix-bc ) osname=posix-bc
2566 powerux | power_ux | powermax_os | powermaxos | \
2567 powerunix | power_unix) osname=powerux
2573 solaris) osname=solaris
2575 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2582 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2586 titanos) osname=titanos
2595 ultrix) osname=ultrix
2598 osf1|mls+) case "$5" in
2601 osvers=`sizer -v | awk '{print $3}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
2604 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
2607 hp*) osname=hp_osf1 ;;
2608 mips) osname=mips_osf1 ;;
2611 unixware) osname=svr5
2617 $2) case "$osname" in
2621 : svr4.x or possibly later
2631 if test -f /stand/boot ; then
2632 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
2633 if test -n "$INITPROG" -a -f "$INITPROG"; then
2634 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
2635 if test -n "$isesix"; then
2643 *) if test -f /etc/systemid; then
2645 set `echo $3 | $sed 's/\./ /g'` $4
2646 if $test -f $src/hints/sco_$1_$2_$3.sh; then
2648 elif $test -f $src/hints/sco_$1_$2.sh; then
2650 elif $test -f $src/hints/sco_$1.sh; then
2655 '') : Still unknown. Probably a generic Sys V.
2664 *) case "$osname" in
2665 '') : Still unknown. Probably a generic BSD.
2673 if test -f /vmunix -a -f $src/hints/news_os.sh; then
2674 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
2675 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
2678 $rm -f UU/kernel.what
2679 elif test -d c:/.; then
2686 : Now look for a hint file osname_osvers, unless one has been
2687 : specified already.
2690 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
2691 : Also try without trailing minor version numbers.
2692 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
2693 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
2694 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
2695 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
2698 *) case "$osvers" in
2701 *) if $test -f $src/hints/$file.sh ; then
2703 elif $test -f $src/hints/$xfile.sh ; then
2705 elif $test -f $src/hints/$xxfile.sh ; then
2707 elif $test -f $src/hints/$xxxfile.sh ; then
2709 elif $test -f $src/hints/$xxxxfile.sh ; then
2711 elif $test -f "$src/hints/${osname}.sh" ; then
2720 if $test -f Policy.sh ; then
2723 none) dflt="Policy" ;;
2724 *) dflt="Policy $dflt" ;;
2729 dflt=`echo $hintfile | $sed 's/\.sh$//'`
2733 if $test -f Policy.sh ; then
2736 There's also a Policy hint file available, which should make the
2737 site-specific (policy) questions easier to answer.
2744 You may give one or more space-separated answers, or "none" if appropriate.
2745 A well-behaved OS will have no hints, so answering "none" or just "Policy"
2746 is a good thing. DO NOT give a wrong version or a wrong OS.
2750 rp="Which of these apply, if any?"
2753 for file in $tans; do
2754 if $test X$file = XPolicy -a -f Policy.sh; then
2756 $cat Policy.sh >> UU/config.sh
2757 elif $test -f $src/hints/$file.sh; then
2758 . $src/hints/$file.sh
2759 $cat $src/hints/$file.sh >> UU/config.sh
2760 elif $test X$tans = X -o X$tans = Xnone ; then
2763 : Give one chance to correct a possible typo.
2764 echo "$file.sh does not exist"
2766 rp="hint to use instead?"
2768 for file in $ans; do
2769 if $test -f "$src/hints/$file.sh"; then
2770 . $src/hints/$file.sh
2771 $cat $src/hints/$file.sh >> UU/config.sh
2772 elif $test X$ans = X -o X$ans = Xnone ; then
2775 echo "$file.sh does not exist -- ignored."
2782 : Remember our hint file for later.
2783 if $test -f "$src/hints/$file.sh" ; then
2793 echo "Fetching default answers from $config_sh..." >&4
2797 cp $config_sh config.sh 2>/dev/null
2807 test "$override" && . ./optdef.sh
2809 : Restore computed paths
2810 for file in $loclist $trylist; do
2811 eval $file="\$_$file"
2816 Configure uses the operating system name and version to set some defaults.
2817 The default value is probably right if the name rings a bell. Otherwise,
2818 since spelling matters for me, either accept the default or answer "none"
2825 ''|' '|none) dflt=none ;;
2826 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
2829 *) dflt="$osname" ;;
2831 rp="Operating system name?"
2835 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
2841 ''|' '|none) dflt=none ;;
2842 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
2843 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
2845 ''|' ') dflt=none ;;
2850 *) dflt="$osvers" ;;
2852 rp="Operating system version?"
2862 : who configured the system
2863 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
2864 cf_by=`(logname) 2>/dev/null`
2867 cf_by=`(whoami) 2>/dev/null`
2869 "") cf_by=unknown ;;
2873 : set up the script used to warn in case of inconsistency
2880 echo "*** WHOA THERE!!! ***" >&4
2881 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2882 rp=" Keep the $hint value?"
2885 y) td=$was; tu=$was;;
2889 : function used to set $1 to $val
2890 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2892 $define$undef) . ./whoa; eval "$var=\$td";;
2893 $undef$define) . ./whoa; eval "$var=\$tu";;
2894 *) eval "$var=$val";;
2897 case "$usethreads" in
2898 $define|true|[yY]*) dflt='y';;
2903 Perl can be built to take advantage of threads on some systems.
2904 To do so, Configure can be run with -Dusethreads.
2906 Note that threading is a highly experimental feature, and
2907 some known race conditions still remain. If you choose to try
2908 it, be very sure to not actually deploy it for production
2909 purposes. README.threads has more details, and is required
2910 reading if you enable threads.
2912 If this doesn't make any sense to you, just accept the default '$dflt'.
2914 rp='Build a threading Perl?'
2917 y|Y) val="$define" ;;
2923 case "$usethreads" in
2927 As of 5.5.640, Perl has two different internal threading implementations,
2928 the 5.005 version (5005threads) and an interpreter-based version
2929 (ithreads) that has one interpreter per thread. Both are very
2930 experimental. This arrangement exists to help developers work out
2931 which one is better.
2933 If you're a casual user, you probably don't want interpreter-threads
2934 at this time. There doesn't yet exist a way to create threads from
2935 within Perl in this model, i.e., "use Thread;" will NOT work.
2937 : Default to ithreads unless overridden on command line or with
2940 case "$use5005threads" in
2941 $define|true|[yY]*) dflt='n';;
2943 case "$useithreads" in
2944 $undef|false|[nN]*) dflt='n';;
2946 rp='Use interpreter-based ithreads?'
2949 y|Y) val="$define" ;;
2954 : Now set use5005threads to the opposite value.
2955 case "$useithreads" in
2956 $define) val="$undef" ;;
2963 useithreads="$undef"
2964 use5005threads="$undef"
2968 case "$useithreads$use5005threads" in
2972 You cannot have both the ithreads and the 5.005 threads enabled
2973 at the same time. Disabling the 5.005 threads since they are
2974 much less stable than the ithreads.
2977 use5005threads="$undef"
2981 case "$d_oldpthreads" in
2982 '') : Configure tests would be welcome here. For now, assume undef.
2984 *) val="$d_oldpthreads" ;;
2990 case "$usethreads" in
2991 "$define"|true|[yY]*)
2992 : Look for a hint-file generated 'call-back-unit'. If the
2993 : user has specified that a threading perl is to be built,
2994 : we may need to set or change some other defaults.
2995 if $test -f usethreads.cbu; then
2996 echo "Your platform has some specific hints for threaded builds, using them..."
3000 (Your platform doesn't have any specific hints for threaded builds.
3001 Assuming POSIX threads, then.)
3009 Perl can be built so that multiple Perl interpreters can coexist
3010 within the same Perl executable.
3013 case "$useithreads" in
3016 This multiple interpreter support is required for interpreter-based threads.
3020 *) case "$usemultiplicity" in
3021 $define|true|[yY]*) dflt='y';;
3025 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
3026 rp='Build Perl for multiplicity?'
3029 y|Y) val="$define" ;;
3037 : make some quick guesses about what we are up against
3039 $echo $n "Hmm... $c"
3049 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
3050 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
3052 echo "Looks kind of like an OSF/1 system, but we'll see..."
3054 elif test `echo abc | $tr a-z A-Z` = Abc ; then
3055 xxx=`./loc addbib blurfl $pth`
3056 if $test -f $xxx; then
3057 echo "Looks kind of like a USG system with BSD features, but we'll see..."
3061 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
3062 echo "Looks kind of like an extended USG system, but we'll see..."
3064 echo "Looks kind of like a USG system, but we'll see..."
3068 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
3069 echo "Looks kind of like a BSD system, but we'll see..."
3073 echo "Looks kind of like a Version 7 system, but we'll see..."
3076 case "$eunicefix" in
3079 There is, however, a strange, musty smell in the air that reminds me of
3080 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
3084 : it so happens the Eunice I know will not run shell scripts in Unix format
3088 echo "Congratulations. You aren't running Eunice."
3092 : Detect OS2. The p_ variable is set above in the Head.U unit.
3093 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
3094 : semicolon as a patch separator
3099 I have the feeling something is not exactly right, however...don't tell me...
3100 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
3101 (Or you may be running DOS with DJGPP.)
3106 if test -f /xenix; then
3107 echo "Actually, this looks more like a XENIX system..."
3112 echo "It's not Xenix..."
3117 if test -f /venix; then
3118 echo "Actually, this looks more like a VENIX system..."
3125 echo "Nor is it Venix..."
3128 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3129 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3136 rp="Use which C compiler?"
3139 : Look for a hint-file generated 'call-back-unit'. Now that the
3140 : user has specified the compiler, we may need to set or change some
3142 if $test -f cc.cbu; then
3148 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3149 $cat >gccvers.c <<EOM
3154 printf("%s\n", __VERSION__);
3156 printf("%s\n", "1");
3162 if $cc -o gccvers $ccflags $ldflags gccvers.c; then
3163 gccversion=`./gccvers`
3164 case "$gccversion" in
3165 '') echo "You are not using GNU cc." ;;
3166 *) echo "You are using GNU cc $gccversion."
3172 echo "*** WHOA THERE!!! ***" >&4
3173 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3174 case "$knowitall" in
3176 echo " You'd better start hunting for one and let me know about it." >&4
3182 case "$gccversion" in
3183 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3185 case "$gccversion" in
3186 '') gccosandvers='' ;;
3187 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
3188 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
3190 case "$gccosandvers" in
3191 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
3192 $osname$osvers) ;; # looking good
3193 $osname*) cat <<EOM >&4
3195 *** WHOA THERE!!! ***
3197 Your gcc has not been compiled for the exact release of
3198 your operating system ($gccosandvers versus $osname$osvers).
3200 In general it is a good idea to keep gcc synchronized with
3201 the operating system because otherwise serious problems
3202 may ensue when trying to compile software, like Perl.
3204 I'm trying to be optimistic here, though, and will continue.
3205 If later during the configuration and build icky compilation
3206 problems appear (headerfile conflicts being the most common
3207 manifestation), I suggest reinstalling the gcc to match
3208 your operating system release.
3212 *) gccosandvers='' ;; # failed to parse, better be silent
3220 : see how we invoke the C preprocessor
3222 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3223 cat <<'EOT' >testcpp.c
3229 if test ! -f cppstdin; then
3230 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
3231 # AIX cc -E doesn't show the absolute headerfile
3232 # locations but we'll cheat by using the -M flag.
3233 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
3235 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3238 echo "Keeping your $hint cppstdin wrapper."
3241 wrapper=`pwd`/cppstdin
3245 if $test "X$cppstdin" != "X" && \
3246 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3247 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3249 echo "You used to use $cppstdin $cppminus so we'll use that again."
3251 '') echo "But let's see if we can live without a wrapper..." ;;
3253 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3254 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3256 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3259 echo "(However, $cpprun $cpplast does not work, let's see...)"
3267 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3274 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3275 $cc -E <testcpp.c >testcpp.out 2>&1; \
3276 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3277 echo "Yup, it does."
3280 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
3281 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3282 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3283 echo "Yup, it does."
3286 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
3287 $cc -P <testcpp.c >testcpp.out 2>&1; \
3288 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3289 echo "Yipee, that works!"
3292 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
3293 $cc -P - <testcpp.c >testcpp.out 2>&1; \
3294 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3295 echo "At long last!"
3298 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
3299 $cpp <testcpp.c >testcpp.out 2>&1; \
3300 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3304 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
3305 $cpp - <testcpp.c >testcpp.out 2>&1; \
3306 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3307 echo "Hooray, it works! I was beginning to wonder."
3310 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
3311 $wrapper <testcpp.c >testcpp.out 2>&1; \
3312 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3318 rp="No dice. I can't find a C preprocessor. Name one:"
3322 $x_cpp <testcpp.c >testcpp.out 2>&1
3323 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3324 echo "OK, that will do." >&4
3326 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
3341 echo "Perhaps can we force $cc -E using a wrapper..."
3342 if $wrapper <testcpp.c >testcpp.out 2>&1; \
3343 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3349 echo "Nope, we'll have to live without it..."
3363 "$wrapper"|'cppstdin') ;;
3364 *) $rm -f $wrapper;;
3366 $rm -f testcpp.c testcpp.out
3368 : decide how portable to be. Allow command line overrides.
3369 case "$d_portable" in
3371 *) d_portable="$define" ;;
3374 : set up shell script to do ~ expansion
3380 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3383 if $test -f /bin/csh; then
3384 /bin/csh -f -c "glob \$1"
3389 name=\`$expr x\$1 : '..\([^/]*\)'\`
3390 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3391 if $test ! -d "\$dir"; then
3393 echo "\$me: can't locate home directory for: \$name" >&2
3398 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3414 : now set up to get a file name
3418 cat <<'EOSC' >>getfile
3434 expr $fn : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3435 fn=`echo $fn | sed 's/(.*)//'`
3441 loc_file=`expr $fn : '.*:\(.*\)'`
3442 fn=`expr $fn : '\(.*\):.*'`
3450 */*) fullpath=true;;
3459 *e*) exp_file=true;;
3462 *p*) nopath_ok=true;;
3467 *d*) type='Directory';;
3468 *l*) type='Locate';;
3473 Locate) what='File';;
3478 case "$d_portable" in
3486 while test "$type"; do
3491 true) rp="$rp (~name ok)";;
3494 if test -f UU/getfile.ok && \
3495 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3514 value=`UU/filexp $ans`
3517 if test "$ans" != "$value"; then
3518 echo "(That expands to $value on this system.)"
3532 /*) value="$ansexp" ;;
3533 [a-zA-Z]:/*) value="$ansexp" ;;
3538 echo "I shall only accept a full path name, as in /bin/ls." >&4
3539 echo "Use a ! shell escape if you wish to check pathnames." >&4
3542 echo "Please give a full path name, starting with slash." >&4
3545 echo "Note that using ~name is ok provided it expands well." >&4
3558 for fp in $gfpth; do
3559 if test "X$fp" = X.; then
3564 if test -f "$pf"; then
3566 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3568 echo "($value is not a plain file, but that's ok.)"
3571 if test X"$type" = X; then
3578 for fp in $gfpth; do
3579 if test "X$fp" = X.; then
3584 direxp="$fp/$ansexp"
3586 if test -d "$direxp"; then
3594 if test -d "$ansexp"; then
3595 echo "(Looking for $loc_file in directory $value.)"
3596 value="$value/$loc_file"
3597 ansexp="$ansexp/$loc_file"
3599 if test -f "$ansexp"; then
3602 case "$nopath_ok" in
3603 true) case "$value" in
3605 *) echo "Assuming $value will be in people's path."
3621 if test "$fastread" = yes; then
3626 rp="$what $value doesn't exist. Use that name anyway?"
3645 test "X$gfpthkeep" != Xy && gfpth=""
3648 : What should the include directory be ?
3650 $echo $n "Hmm... $c"
3654 if $test -f /bin/mips && /bin/mips; then
3655 echo "Looks like a MIPS system..."
3656 $cat >usr.c <<'EOCP'
3657 #ifdef SYSTYPE_BSD43
3661 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3662 dflt='/bsd43/usr/include'
3666 mips_type='System V'
3668 $rm -f usr.c usr.out
3669 echo "and you're compiling with the $mips_type compiler and libraries."
3673 echo "Doesn't look like a MIPS system."
3683 case "$xxx_prompt" in
3686 rp='Where are the include files you want to use?'
3694 : Set private lib path
3697 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
3702 '') dlist="$loclibpth $plibpth $glibpth";;
3703 *) dlist="$libpth";;
3706 : Now check and see which directories actually exist, avoiding duplicates
3710 if $test -d $xxx; then
3713 *) libpth="$libpth $xxx";;
3719 Some systems have incompatible or broken versions of libraries. Among
3720 the directories listed in the question below, please remove any you
3721 know not to be holding relevant libraries, and add any that are needed.
3722 Say "none" for none.
3733 rp="Directories to use for library searches?"
3740 : compute shared library extension
3743 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
3753 On some systems, shared libraries may be available. Answer 'none' if
3754 you want to suppress searching of shared libraries for the remainder
3755 of this configuration.
3758 rp='What is the file extension used for shared libraries?'
3762 : Define several unixisms.
3763 : Hints files or command line option can be used to override them.
3764 : The convoluted testing is in case hints files set either the old
3767 '') case "$exe_ext" in
3769 *) _exe="$exe_ext" ;;
3774 '') case "$lib_ext" in
3781 '') case "$obj_ext" in
3788 '') case "$path_sep" in
3799 : Which makefile gets called first. This is used by make depend.
3800 case "$firstmakefile" in
3801 '') firstmakefile='makefile';;
3805 $define|true|[yY]*) dflt='y';;
3810 Perl can be built to use the SOCKS proxy protocol library. To do so,
3811 Configure must be run with -Dusesocks. If you use SOCKS you also need
3812 to use the PerlIO abstraction layer, this will be implicitly selected.
3814 If this doesn't make any sense to you, just accept the default '$dflt'.
3816 rp='Build Perl for SOCKS?'
3819 y|Y) val="$define" ;;
3826 $define|true|[yY]*) useperlio="$define";;
3829 : Looking for optional libraries
3831 echo "Checking for optional libraries..." >&4
3836 case "$libswanted" in
3837 '') libswanted='c_s';;
3840 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
3846 for thisdir in $libpth $xlibpth; do
3847 test -d $thisdir && libspath="$libspath $thisdir"
3849 for thislib in $libswanted; do
3850 for thisdir in $libspath; do
3852 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
3853 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|tail -1`
3854 $test -f "$xxx" && eval $libscheck
3855 $test -f "$xxx" && libstyle=shared
3857 if test ! -f "$xxx"; then
3858 xxx=$thisdir/lib$thislib.$so
3859 $test -f "$xxx" && eval $libscheck
3860 $test -f "$xxx" && libstyle=shared
3862 if test ! -f "$xxx"; then
3863 xxx=$thisdir/lib$thislib$_a
3864 $test -f "$xxx" && eval $libscheck
3865 $test -f "$xxx" && libstyle=static
3867 if test ! -f "$xxx"; then
3868 xxx=$thisdir/$thislib$_a
3869 $test -f "$xxx" && eval $libscheck
3870 $test -f "$xxx" && libstyle=static
3872 if test ! -f "$xxx"; then
3873 xxx=$thisdir/lib${thislib}_s$_a
3874 $test -f "$xxx" && eval $libscheck
3875 $test -f "$xxx" && libstyle=static
3876 $test -f "$xxx" && thislib=${thislib}_s
3878 if test ! -f "$xxx"; then
3879 xxx=$thisdir/Slib$thislib$_a
3880 $test -f "$xxx" && eval $libscheck
3881 $test -f "$xxx" && libstyle=static
3883 if $test -f "$xxx"; then
3885 shared) echo "Found -l$thislib (shared)." ;;
3886 static) echo "Found -l$thislib." ;;
3887 *) echo "Found -l$thislib ($libstyle)." ;;
3891 *) dflt="$dflt -l$thislib"
3892 libsfound="$libsfound $xxx"
3894 libsfiles="$libsfiles $yyy"
3895 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
3896 case " $libsdirs " in
3898 *) libsdirs="$libsdirs $yyy" ;;
3905 if $test ! -f "$xxx"; then
3906 echo "No -l$thislib."
3917 ' '|'') dflt='none';;
3922 In order to compile $package on your machine, a number of libraries
3923 are usually needed. Include any other special libraries here as well.
3924 Say "none" for none. The default list is almost always right.
3928 rp="What libraries to use?"
3935 : determine optimization, if desired, or use for debug flag also
3937 ' '|$undef) dflt='none';;
3939 *) dflt="$optimize";;
3943 By default, $package compiles with the -O flag to use the optimizer.
3944 Alternately, you might want to use the symbolic debugger, which uses
3945 the -g flag (on traditional Unix systems). Either flag can be
3946 specified here. To use neither flag, specify the word "none".
3949 rp="What optimizer/debugger flag should be used?"
3953 'none') optimize=" ";;
3957 : We will not override a previous value, but we might want to
3958 : augment a hint file
3960 default|recommended)
3961 case "$gccversion" in
3962 1*) dflt='-fpcc-struct-return' ;;
3965 *-g*) dflt="$dflt -DDEBUGGING";;
3967 case "$gccversion" in
3968 2*) if test -d /etc/conf/kconfig.d &&
3969 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
3975 case "$gccversion" in
3979 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
3980 echo 'int main(void) { return 0; }' > gcctest.c
3981 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
3982 echo "Yes, it does." 2>&1
3985 echo "Leaving current flags $ccflags alone." 2>&1
3987 *) dflt="$dflt -fno-strict-aliasing" ;;
3990 echo "Nope, it doesn't, but that's ok." 2>&1
3997 case "$mips_type" in
3998 *BSD*|'') inclwanted="$locincpth $usrinc";;
3999 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4001 for thisincl in $inclwanted; do
4002 if $test -d $thisincl; then
4003 if $test x$thisincl != x$usrinc; then
4005 *" -I$thisincl "*);;
4006 *) dflt="$dflt -I$thisincl ";;
4012 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4014 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4022 *) dflt="$dflt -D$2";;
4026 set signal.h LANGUAGE_C; eval $inctest
4030 ccflags="$ccflags -DSOCKS"
4035 default|recommended) dflt="$ccflags $dflt" ;;
4036 *) dflt="$ccflags";;
4045 Your C compiler may want other flags. For this question you should include
4046 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4047 but you should NOT include libraries or ld flags like -lwhatever. If you
4048 want $package to honor its debug switch, you should include -DDEBUGGING here.
4049 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4051 To use no flags, specify the word "none".
4057 rp="Any additional cc flags?"
4064 : the following weeds options from ccflags that are of no interest to cpp
4066 '') cppflags="$ccflags" ;;
4067 *) cppflags="$cppflags $ccflags" ;;
4069 case "$gccversion" in
4070 1*) cppflags="$cppflags -D__GNUC__"
4072 case "$mips_type" in
4074 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4080 echo "Let me guess what the preprocessor flags are..." >&4
4094 *) ftry="$previous $flag";;
4096 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4097 >cpp1.out 2>/dev/null && \
4098 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4099 >cpp2.out 2>/dev/null && \
4100 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4101 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4103 cppflags="$cppflags $ftry"
4113 *-*) echo "They appear to be: $cppflags";;
4115 $rm -f cpp.c cpp?.out
4119 : flags used in final linking phase
4121 '') if ./venix; then
4127 *-posix*) dflt="$dflt -posix" ;;
4130 *) dflt="$ldflags";;
4133 : Try to guess additional flags to pick up local libraries.
4134 for thislibdir in $libpth; do
4135 case " $loclibpth " in
4138 *"-L$thislibdir "*) ;;
4139 *) dflt="$dflt -L$thislibdir" ;;
4151 Your C linker may need flags. For this question you should
4152 include -L/whatever and any other flags used by the C linker, but you
4153 should NOT include libraries like -lwhatever.
4155 Make sure you include the appropriate -L/path flags if your C linker
4156 does not normally search all of the directories you specified above,
4159 To use no flags, specify the word "none".
4163 rp="Any additional ld flags (NOT including libraries)?"
4169 rmlist="$rmlist pdp11"
4173 echo "Checking your choice of C compiler and flags for coherency..." >&4
4174 $cat > try.c <<'EOF'
4176 int main() { printf("Ok\n"); exit(0); }
4178 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
4180 $cat >try.msg <<'EOM'
4181 I've tried to compile and run the following simple program:
4184 $cat try.c >> try.msg
4186 $cat >> try.msg <<EOM
4193 and I got the following output:
4197 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
4198 if $sh -c './try' >>try.msg 2>&1; then
4202 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4205 cat >> try.msg <<'EOQS'
4206 If $libs contains -lsfio, and sfio is mis-configured, then it
4207 sometimes (apparently) runs and exits with a 0 status, but with no
4208 output! It may have to do with sfio's use of _exit vs. exit.
4211 rp="You have a big problem. Shall I abort Configure"
4218 echo "The program compiled OK, but exited with status $?." >>try.msg
4219 rp="You have a problem. Shall I abort Configure"
4223 echo "I can't compile the test program." >>try.msg
4224 rp="You have a BIG problem. Shall I abort Configure"
4230 case "$knowitall" in
4232 echo "(The supplied flags or libraries might be incorrect.)"
4240 *) echo "Ok. Stopping Configure." >&4
4245 n) echo "OK, that should do.";;
4247 $rm -f try try.* core
4249 : define an is-a-typedef? function
4250 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
4252 "") inclist="sys/types.h";;
4254 eval "varval=\$$var";
4258 for inc in $inclist; do
4259 echo "#include <$inc>" >>temp.c;
4261 echo "#ifdef $type" >> temp.c;
4262 echo "printf(\"We have $type\");" >> temp.c;
4263 echo "#endif" >> temp.c;
4264 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
4265 if $contains $type temp.E >/dev/null 2>&1; then
4271 *) eval "$var=\$varval";;
4274 : define an is-a-typedef? function that prompts if the type is not available.
4275 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
4277 "") inclist="sys/types.h";;
4279 eval "varval=\$$var";
4283 for inc in $inclist; do
4284 echo "#include <$inc>" >>temp.c;
4286 echo "#ifdef $type" >> temp.c;
4287 echo "printf(\"We have $type\");" >> temp.c;
4288 echo "#endif" >> temp.c;
4289 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
4291 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
4292 if $contains $type temp.E >/dev/null 2>&1; then
4293 echo "$type found." >&4;
4296 echo "$type NOT found." >&4;
4302 *) eval "$var=\$varval";;
4305 : define a shorthand compile call
4309 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
4310 : define a shorthand compile call for compilations that should be ok.
4314 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
4316 : check for lengths of integral types
4320 echo "Checking to see how big your integers are..." >&4
4321 $cat >intsize.c <<'EOCP'
4325 printf("intsize=%d;\n", (int)sizeof(int));
4326 printf("longsize=%d;\n", (int)sizeof(long));
4327 printf("shortsize=%d;\n", (int)sizeof(short));
4332 if eval $compile_ok && ./intsize > /dev/null; then
4334 echo "Your integers are $intsize bytes long."
4335 echo "Your long integers are $longsize bytes long."
4336 echo "Your short integers are $shortsize bytes long."
4340 Help! I can't compile and run the intsize test program: please enlighten me!
4341 (This is probably a misconfiguration in your system or libraries, and
4342 you really ought to fix it. Still, I'll try anyway.)
4346 rp="What is the size of an integer (in bytes)?"
4350 rp="What is the size of a long integer (in bytes)?"
4354 rp="What is the size of a short integer (in bytes)?"
4360 $rm -f intsize intsize.*
4362 : see what type lseek is declared as in the kernel
4363 rp="What is the type used for lseek's offset on this system?"
4364 set off_t lseektype long stdio.h sys/types.h
4368 echo "Checking to see how big your file offsets are..." >&4
4370 #include <sys/types.h>
4374 printf("%d\n", (int)sizeof($lseektype));
4379 if eval $compile_ok; then
4381 echo "Your file offsets are $lseeksize bytes long."
4385 echo "(I can't seem to compile the test program. Guessing...)"
4386 rp="What is the size of your file offsets (in bytes)?"
4392 : see what type file positions are declared as in the library
4393 rp="What is the type for file position used by fsetpos()?"
4394 set fpos_t fpostype long stdio.h sys/types.h
4399 *_t) zzz="$fpostype" ;;
4402 echo "Checking the size of $zzz..." >&4
4404 #include <sys/types.h>
4407 printf("%d\n", (int)sizeof($fpostype));
4412 if eval $compile_ok; then
4416 echo "(I can't execute the test program--guessing $fpossize.)" >&4
4419 echo "Your $zzz is $fpossize bytes long."
4425 echo "(I can't compile the test program. Guessing...)" >&4
4426 rp="What is the size of your file positions (in bytes)?"
4433 # Backward compatibility (uselfs is deprecated).
4435 "$define"|true|[yY]*)
4438 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
4440 uselargefiles="$define"
4444 case "$lseeksize:$fpossize" in
4447 You can have files larger than 2 gigabytes.
4450 *) case "$uselargefiles" in
4451 "$undef"|false|[nN]*) dflt='n' ;;
4456 Perl can be built to understand large files (files larger than 2 gigabytes)
4457 on some systems. To do so, Configure can be run with -Duselargefiles.
4459 If this doesn't make any sense to you, just accept the default '$dflt'.
4461 rp='Try to understand large files, if available?'
4464 y|Y) val="$define" ;;
4471 case "$uselargefiles" in
4473 : Look for a hint-file generated 'call-back-unit'. If the
4474 : user has specified that a large files perl is to be built,
4475 : we may need to set or change some other defaults.
4476 if $test -f uselargefiles.cbu; then
4477 echo "Your platform has some specific hints for large file builds, using them..."
4478 . ./uselargefiles.cbu
4480 echo "Rechecking to see how big your file offsets are..." >&4
4482 #include <sys/types.h>
4486 printf("%d\n", (int)sizeof($lseektype));
4491 if eval $compile_ok; then
4493 $echo "Your file offsets are now $lseeksize bytes long."
4497 echo "(I can't seem to compile the test program. Guessing...)"
4498 rp="What is the size of your file offsets (in bytes)?"
4503 *_t) zzz="$fpostype" ;;
4506 $echo $n "Rechecking the size of $zzz...$c" >&4
4508 #include <sys/types.h>
4511 printf("%d\n", (int)sizeof($fpostype));
4516 if eval $compile_ok; then
4521 echo "(I can't execute the test program--guessing $fpossize.)" >&4
4524 echo " $fpossize bytes." >&4
4530 echo "(I can't compile the test program. Guessing...)" >&4
4531 rp="What is the size of your file positions (in bytes)?"
4541 case "$usemorebits" in
4542 "$define"|true|[yY]*)
4543 use64bitint="$define"
4544 uselongdouble="$define"
4545 usemorebits="$define"
4547 *) usemorebits="$undef"
4551 : check for void type
4553 echo "Checking to see how well your C compiler groks the void type..." >&4
4554 case "$voidflags" in
4556 $cat >try.c <<'EOCP'
4562 extern void moo(); /* function returning void */
4563 void (*goo)(); /* ptr to func returning void */
4565 void *hue; /* generic ptr */
4578 int main() { sub(); }
4580 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
4581 voidflags=$defvoidused
4582 echo "Good. It appears to support void to the level $package wants.">&4
4583 if $contains warning .out >/dev/null 2>&1; then
4584 echo "However, you might get some warnings that look like this:"
4588 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
4589 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
4590 echo "It supports 1..."
4591 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
4592 echo "It also supports 2..."
4593 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
4595 echo "And it supports 4 but not 8 definitely."
4597 echo "It doesn't support 4..."
4598 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
4600 echo "But it supports 8."
4603 echo "Neither does it support 8."
4607 echo "It does not support 2..."
4608 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
4610 echo "But it supports 4 and 8."
4612 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
4614 echo "And it supports 4 but has not heard about 8."
4616 echo "However it supports 8 but not 4."
4621 echo "There is no support at all for void."
4626 case "$voidflags" in
4629 Support flag bits are:
4630 1: basic void declarations.
4631 2: arrays of pointers to functions returning void.
4632 4: operations between pointers to and addresses of void functions.
4633 8: generic void pointers.
4636 rp="Your void support flags add up to what?"
4643 : check for length of pointer
4647 echo "Checking to see how big your pointers are..." >&4
4648 if test "$voidflags" -gt 7; then
4649 echo '#define VOID_PTR char *' > try.c
4651 echo '#define VOID_PTR void *' > try.c
4653 $cat >>try.c <<'EOCP'
4657 printf("%d\n", (int)sizeof(VOID_PTR));
4662 if eval $compile_ok; then
4664 echo "Your pointers are $ptrsize bytes long."
4667 echo "(I can't seem to compile the test program. Guessing...)" >&4
4668 rp="What is the size of a pointer (in bytes)?"
4676 : check for long long
4678 echo "Checking to see if you have long long..." >&4
4679 echo 'int main() { long long x = 7; return 0; }' > try.c
4681 if eval $compile; then
4683 echo "You have long long."
4686 echo "You do not have long long."
4692 : check for length of long long
4693 case "${d_longlong}${longlongsize}" in
4696 echo "Checking to see how big your long longs are..." >&4
4697 $cat >try.c <<'EOCP'
4701 printf("%d\n", (int)sizeof(long long));
4706 if eval $compile_ok; then
4707 longlongsize=`./try$exe_ext`
4708 echo "Your long longs are $longlongsize bytes long."
4712 echo "(I can't seem to compile the test program. Guessing...)"
4713 rp="What is the size of a long long (in bytes)?"
4717 if $test "X$longsize" = "X$longlongsize"; then
4718 echo "(That isn't any different from an ordinary long.)"
4724 : determine filename position in cpp output
4726 echo "Computing filename position in cpp output for #include directives..." >&4
4727 echo '#include <stdio.h>' > foo.c
4730 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
4731 $grep '^[ ]*#.*stdio\.h' | \
4732 while read cline; do
4735 while $test \$# -gt 0; do
4736 if $test -r \`echo \$1 | $tr -d '"'\`; then
4741 pos=\`expr \$pos + 1\`
4753 *) pos="${fieldn}th";;
4755 echo "Your cpp writes the filename in the $pos field of the line."
4757 : locate header file
4762 for usrincdir in $usrinc
4764 if test -f \$usrincdir/\$wanted; then
4765 echo "\$usrincdir/\$wanted"
4769 awkprg='{ print \$$fieldn }'
4770 echo "#include <\$wanted>" > foo\$\$.c
4771 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
4772 $grep "^[ ]*#.*\$wanted" | \
4773 while read cline; do
4774 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
4776 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
4777 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
4782 # status = 0: grep returned 0 lines, case statement not executed
4783 # status = 1: headerfile found
4784 # status = 2: while loop executed, no headerfile found
4788 if test \$status -eq 1; then
4795 : define an alternate in-header-list? function
4796 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
4797 cont=true; xxf="echo \"<\$1> found.\" >&4";
4798 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
4799 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
4801 case $# in 4) instead=instead;; *) instead="at last";; esac;
4802 while $test "$cont"; do
4804 var=$2; eval "was=\$$2";
4805 if $test "$xxx" && $test -r "$xxx";
4807 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
4810 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
4811 set $yyy; shift; shift; yyy=$@;
4812 case $# in 0) cont="";;
4813 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
4814 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
4815 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
4816 xxnf="echo \"there is no <\$1>, ...\" >&4";;
4820 do set $yyy; var=$2; eval "was=\$$2";
4821 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
4822 set $yyy; shift; shift; yyy=$@;
4825 : see if inttypes.h is available
4826 : we want a real compile instead of Inhdr because some systems
4827 : have an inttypes.h which includes non-existent headers
4830 #include <inttypes.h>
4832 static int32_t foo32 = 0x12345678;
4836 if eval $compile; then
4837 echo "<inttypes.h> found." >&4
4840 echo "<inttypes.h> NOT found." >&4
4849 echo "Checking to see if you have int64_t..." >&4
4851 #include <sys/types.h>
4852 #$i_inttypes I_INTTYPES
4854 #include <inttypes.h>
4856 int main() { int64_t x = 7; }
4859 if eval $compile; then
4861 echo "You have int64_t."
4864 echo "You do not have int64_t."
4872 echo "Checking which 64-bit integer type we could use..." >&4
4878 val='"unsigned int"'
4883 *) case "$longsize" in
4887 val='"unsigned long"'
4892 *) case "$d_longlong:$longlongsize" in
4897 val='"unsigned long long"'
4902 *) case "$d_int64_t" in
4921 '') echo "Alas, no 64-bit integer types in sight." >&4
4924 *) echo "We could use '$quadtype' for 64-bit integers." >&4
4930 case "$uselonglong" in
4931 "$define"|true|[yY]*)
4934 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
4936 use64bitint="$define"
4939 case "$use64bits" in
4940 "$define"|true|[yY]*)
4943 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
4945 use64bitint="$define"
4948 case "$use64bitints" in
4949 "$define"|true|[yY]*)
4952 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
4954 use64bitint="$define"
4957 case "$use64bitsint" in
4958 "$define"|true|[yY]*)
4961 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
4963 use64bitint="$define"
4966 case "$uselonglongs" in
4967 "$define"|true|[yY]*)
4970 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
4972 use64bitint="$define"
4975 case "$use64bitsall" in
4976 "$define"|true|[yY]*)
4979 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
4981 use64bitall="$define"
4986 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
4988 case "$use64bitall" in
4989 "$define"|true|[yY]*) use64bitint="$define" ;;
4995 You have natively 64-bit long integers.
4999 *) case "$use64bitint" in
5000 "$define"|true|[yY]*) dflt='y';;
5009 Perl can be built to take advantage of 64-bit integer types
5010 on some systems. To do so, Configure can be run with -Duse64bitint.
5011 Choosing this option will most probably introduce binary incompatibilities.
5013 If this doesn't make any sense to you, just accept the default '$dflt'.
5014 (The default has been chosen based on your configuration.)
5016 rp='Try to use 64-bit integers, if available?'
5019 [yY]*) val="$define" ;;
5027 case "$use64bitall" in
5028 "$define"|true|[yY]*) dflt='y' ;;
5029 *) case "$longsize" in
5037 You may also choose to try maximal 64-bitness. It means using as much
5038 64-bitness as possible on the platform. This in turn means even more
5039 binary incompatibilities. On the other hand, your platform may not
5040 have any more 64-bitness available than what you already have chosen.
5042 If this doesn't make any sense to you, just accept the default '$dflt'.
5043 (The default has been chosen based on your configuration.)
5045 rp='Try to use maximal 64-bit support, if available?'
5048 [yY]*) val="$define" ;;
5053 case "$use64bitall" in
5055 case "$use64bitint" in
5059 Since you have chosen a maximally 64-bit build, I'm also turning on
5060 the use of 64-bit integers.
5062 use64bitint="$define" ;;
5067 case "$use64bitall" in
5068 "$define"|true|[yY]*)
5072 *** You have chosen a maximally 64-bit build, but your pointers
5073 *** are only 4 bytes wide, disabling maximal 64-bitness.
5076 use64bitall="$undef"
5077 case "$use64bitint" in
5078 "$define"|true|[yY]*) ;;
5081 *** Downgrading from maximal 64-bitness to using 64-bit integers.
5084 use64bitint="$define"
5092 case "$use64bitint" in
5093 "$define"|true|[yY]*)
5094 : Look for a hint-file generated 'call-back-unit'. If the
5095 : user has specified that a 64-bit perl is to be built,
5096 : we may need to set or change some other defaults.
5097 if $test -f use64bitint.cbu; then
5098 echo "Your platform has some specific hints for 64-bit integers, using them..."
5102 4) case "$archname64" in
5103 '') archname64=64int ;;
5110 case "$use64bitall" in
5111 "$define"|true|[yY]*)
5112 : Look for a hint-file generated 'call-back-unit'. If the
5113 : user has specified that a maximally 64-bit perl is to be built,
5114 : we may need to set or change some other defaults.
5115 if $test -f use64bitall.cbu; then
5116 echo "Your platform has some specific hints for 64-bit builds, using them..."
5120 4) case "$archname64" in
5121 ''|64int) archname64=64all ;;
5129 echo "Checking for GNU C Library..." >&4
5130 cat >gnulibc.c <<EOM
5142 if eval $compile_ok && ./gnulibc; then
5144 echo "You are using the GNU C Library"
5147 echo "You are not using the GNU C Library"
5153 : see if nm is to be used to determine whether a symbol is defined or not
5157 case "$d_gnulibc" in
5160 echo "nm probably won't work on the GNU C Library." >&4
5166 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
5168 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
5169 echo "'nm' won't be sufficient on this sytem." >&4
5175 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
5176 if $test $dflt -gt 20; then
5186 true|$define) dflt=y;;
5193 I can use $nm to extract the symbols from your C libraries. This
5194 is a time consuming task which may generate huge output on the disk (up
5195 to 3 megabytes) but that should make the symbols extraction faster. The
5196 alternative is to skip the 'nm' extraction part and to compile a small
5197 test program instead to determine whether each symbol is present. If
5198 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
5199 this may be the best solution.
5201 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
5204 rp="Shall I use $nm to extract C symbols from the libraries?"
5207 [Nn]*) usenm=false;;
5216 : nm options which may be necessary
5218 '') if $test -f /mach_boot; then
5220 elif $test -d /usr/ccs/lib; then
5221 nm_opt='-p' # Solaris (and SunOS?)
5222 elif $test -f /dgux; then
5224 elif $test -f /lib64/rld; then
5225 nm_opt='-p' # 64-bit Irix
5231 : nm options which may be necessary for shared libraries but illegal
5232 : for archive libraries. Thank you, Linux.
5233 case "$nm_so_opt" in
5234 '') case "$myuname" in
5236 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
5237 nm_so_opt='--dynamic'
5246 : get list of predefined functions in a handy place
5251 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
5258 *) for thislib in $libs; do
5261 : Handle C library specially below.
5264 thislib=`echo $thislib | $sed -e 's/^-l//'`
5265 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
5267 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
5269 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
5271 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
5273 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
5275 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
5277 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
5282 libnames="$libnames $try"
5284 *) libnames="$libnames $thislib" ;;
5293 for xxx in $libpth; do
5294 $test -r $1 || set $xxx/libc.$so
5295 : The messy sed command sorts on library version numbers.
5297 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
5298 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
5300 s/[0-9][0-9]*/0000&/g
5301 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
5304 $sort | $sed -e 's/^.* //'`
5307 $test -r $1 || set /usr/ccs/lib/libc.$so
5308 $test -r $1 || set /lib/libsys_s$_a
5314 if $test -r "$1"; then
5315 echo "Your (shared) C library seems to be in $1."
5317 elif $test -r /lib/libc && $test -r /lib/clib; then
5318 echo "Your C library seems to be in both /lib/clib and /lib/libc."
5320 libc='/lib/clib /lib/libc'
5321 if $test -r /lib/syslib; then
5322 echo "(Your math library is in /lib/syslib.)"
5323 libc="$libc /lib/syslib"
5325 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5326 echo "Your C library seems to be in $libc, as you said before."
5327 elif $test -r $incpath/usr/lib/libc$_a; then
5328 libc=$incpath/usr/lib/libc$_a;
5329 echo "Your C library seems to be in $libc. That's fine."
5330 elif $test -r /lib/libc$_a; then
5332 echo "Your C library seems to be in $libc. You're normal."
5334 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
5336 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
5337 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
5338 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
5340 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5342 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5345 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
5347 if $test -r "$tans"; then
5348 echo "Your C library seems to be in $tans, of all places."
5354 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5358 If the guess above is wrong (which it might be if you're using a strange
5359 compiler, or your machine supports multiple models), you can override it here.
5364 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
5366 I can't seem to find your C library. I've looked in the following places:
5369 $sed 's/^/ /' libpath
5372 None of these seems to contain your C library. I need to get its name...
5377 rp='Where is your C library?'
5382 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
5383 set X `cat libnames`
5386 case $# in 1) xxx=file; esac
5387 echo "Extracting names from the following $xxx for later perusal:" >&4
5389 $sed 's/^/ /' libnames >&4
5391 $echo $n "This may take a while...$c" >&4
5395 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
5396 *) $nm $nm_opt $file 2>/dev/null;;
5401 $grep fprintf libc.tmp > libc.ptf
5402 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
5403 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
5405 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
5407 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5409 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
5411 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5413 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
5415 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5417 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
5419 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5421 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
5423 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5425 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
5427 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5429 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
5430 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
5432 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5434 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
5436 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5438 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
5440 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5442 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
5444 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5446 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
5448 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5450 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
5452 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5454 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
5456 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5458 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
5460 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5463 $nm -p $* 2>/dev/null >libc.tmp
5464 $grep fprintf libc.tmp > libc.ptf
5465 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
5466 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
5472 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
5474 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
5475 for thisname in $libnames $libc; do
5476 $ar t $thisname >>libc.tmp
5478 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
5480 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
5481 # Repeat libc to extract forwarders to DLL entries too
5482 for thisname in $libnames $libc; do
5483 $ar tv $thisname >>libc.tmp
5484 # Revision 50 of EMX has bug in $ar.
5485 # it will not extract forwarders to DLL entries
5486 # Use emximp which will extract exactly them.
5487 emximp -o tmp.imp $thisname \
5489 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
5490 < tmp.imp >>libc.tmp
5493 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
5496 echo "$ar didn't seem to work right." >&4
5497 echo "Maybe this is a Cray...trying bld instead..." >&4
5498 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
5500 for thisname in $libnames; do
5502 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
5503 $ar t $thisname >>libc.tmp
5507 echo "That didn't work either. Giving up." >&4
5514 if $test -f /lib/syscalls.exp; then
5516 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
5517 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*$/\1/p' /lib/syscalls.exp >>libc.list
5521 $rm -f libnames libpath
5523 : is a C symbol defined?
5526 -v) tf=libc.tmp; tc=""; tdc="";;
5527 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
5528 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
5531 case "$reuseval-$4" in
5533 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
5539 if $contains $tlook $tf >/dev/null 2>&1;
5544 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
5545 if $cc -o t $optimize $ccflags $ldflags t.c $libs >/dev/null 2>&1;
5553 $define) tval=true;;
5559 : define an is-in-libc? function
5560 inlibc='echo " "; td=$define; tu=$undef;
5561 sym=$1; var=$2; eval "was=\$$2";
5563 case "$reuseval$was" in
5573 echo "$sym() found." >&4;
5574 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
5576 echo "$sym() NOT found." >&4;
5577 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
5581 $define) echo "$sym() found." >&4;;
5582 *) echo "$sym() NOT found." >&4;;
5586 : see if sqrtl exists
5591 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
5594 case "$uselongdouble" in
5595 $define|true|[yY]*) dflt='y';;
5600 Perl can be built to take advantage of long doubles which
5601 (if available) may give more accuracy and range for floating point numbers.
5603 If this doesn't make any sense to you, just accept the default '$dflt'.
5605 rp='Try to use long doubles if available?'
5608 y|Y) val="$define" ;;
5614 case "$uselongdouble" in
5615 true|[yY]*) uselongdouble="$define" ;;
5618 case "$uselongdouble" in
5620 : Look for a hint-file generated 'call-back-unit'. If the
5621 : user has specified that long doubles should be used,
5622 : we may need to set or change some other defaults.
5623 if $test -f uselongdouble.cbu; then
5624 echo "Your platform has some specific hints for long doubles, using them..."
5625 . ./uselongdouble.cbu
5628 (Your platform doesn't have any specific hints for long doubles.)
5634 case "$uselongdouble:$d_sqrtl" in
5638 *** You requested the use of long doubles but you do not seem to have
5639 *** the mathematic functions for long doubles. I'm disabling the use
5640 *** of long doubles.
5643 uselongdouble=$undef
5647 : check for length of double
5649 case "$doublesize" in
5651 echo "Checking to see how big your double precision numbers are..." >&4
5652 $cat >try.c <<'EOCP'
5656 printf("%d\n", (int)sizeof(double));
5661 if eval $compile_ok; then
5663 echo "Your double is $doublesize bytes long."
5666 echo "(I can't seem to compile the test program. Guessing...)"
5667 rp="What is the size of a double precision number (in bytes)?"
5675 : check for long doubles
5677 echo "Checking to see if you have long double..." >&4
5678 echo 'int main() { long double x = 7.0; }' > try.c
5680 if eval $compile; then
5682 echo "You have long double."
5685 echo "You do not have long double."
5691 : check for length of long double
5692 case "${d_longdbl}${longdblsize}" in
5695 echo "Checking to see how big your long doubles are..." >&4
5696 $cat >try.c <<'EOCP'
5700 printf("%d\n", sizeof(long double));
5705 if eval $compile; then
5706 longdblsize=`./try$exe_ext`
5707 echo "Your long doubles are $longdblsize bytes long."
5711 echo "(I can't seem to compile the test program. Guessing...)" >&4
5712 rp="What is the size of a long double (in bytes)?"
5716 if $test "X$doublesize" = "X$longdblsize"; then
5717 echo "(That isn't any different from an ordinary double.)"
5723 case "$useperlio" in
5724 $define|true|[yY]*|'') dflt='y';;
5729 Previous version of $package used the standard IO mechanisms as
5730 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
5731 alternate IO mechanisms via the PerlIO abstraction layer, but the
5732 stdio mechanism is still available if needed. The abstraction layer
5733 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
5734 Using PerlIO with sfio may cause problems with some extension modules.
5736 If this doesn't make any sense to you, just accept the default '$dflt'.
5738 rp='Use the PerlIO abstraction layer?'
5745 echo "Ok, doing things the stdio way."
5754 case "$useperlio" in
5755 $define|true|[yY]*) ;;
5758 You are using the SOCKS proxy protocol library which means that you
5759 should also use the PerlIO layer. You may be headed for trouble.
5768 : determine the architecture name
5770 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5771 tarch=`arch`"-$osname"
5772 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5773 if uname -m > tmparch 2>&1 ; then
5774 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5775 -e 's/$/'"-$osname/" tmparch`
5783 case "$myarchname" in
5786 echo "(Your architecture name used to be $myarchname.)"
5793 *) dflt="$archname";;
5795 rp='What is your architecture name'
5798 case "$usethreads" in
5800 echo "Threads selected." >&4
5802 *-thread*) echo "...and architecture name already has -thread." >&4
5804 *) archname="$archname-thread"
5805 echo "...setting architecture name to $archname." >&4
5810 case "$usemultiplicity" in
5812 echo "Multiplicity selected." >&4
5814 *-multi*) echo "...and architecture name already has -multi." >&4
5816 *) archname="$archname-multi"
5817 echo "...setting architecture name to $archname." >&4
5822 case "$use64bitint$use64bitall" in
5824 case "$archname64" in
5826 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
5829 case "$use64bitint" in
5830 "$define") echo "64 bit integers selected." >&4 ;;
5832 case "$use64bitall" in
5833 "$define") echo "Maximal 64 bitness selected." >&4 ;;
5836 *-$archname64*) echo "...and architecture name already has $archname64." >&4
5838 *) archname="$archname-$archname64"
5839 echo "...setting architecture name to $archname." >&4
5845 case "$uselongdouble" in
5847 echo "Long doubles selected." >&4
5848 case "$longdblsize" in
5850 "...but long doubles are equal to doubles, not changing architecture name." >&4
5854 *-ld*) echo "...and architecture name already has -ld." >&4
5856 *) archname="$archname-ld"
5857 echo "...setting architecture name to $archname." >&4
5864 case "$useperlio" in
5866 echo "Perlio selected." >&4
5869 echo "Perlio not selected, using stdio." >&4
5871 *-stdio*) echo "...and architecture name already has -stdio." >&4
5873 *) archname="$archname-stdio"
5874 echo "...setting architecture name to $archname." >&4
5880 : determine root of directory hierarchy where package will be installed.
5883 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
5891 By default, $package will be installed in $dflt/bin, manual pages
5892 under $dflt/man, etc..., i.e. with $dflt as prefix for all
5893 installation directories. Typically this is something like /usr/local.
5894 If you wish to have binaries under /usr/bin but other parts of the
5895 installation under /usr/local, that's ok: you will be prompted
5896 separately for each of the installation directories, the prefix being
5897 only used to set the defaults.
5901 rp='Installation prefix to use?'
5909 *) oldprefix="$prefix";;
5919 $define|true) afs=true ;;
5920 $undef|false) afs=false ;;
5921 *) if test -d /afs; then
5929 echo "AFS may be running... I'll be extra cautious then..." >&4
5931 echo "AFS does not seem to be running..." >&4
5934 : determine installation prefix for where package is to be installed.
5938 Since you are running AFS, I need to distinguish the directory in which
5939 files will reside from the directory in which they are installed (and from
5940 which they are presumably copied to the former directory by occult means).
5943 case "$installprefix" in
5944 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
5945 *) dflt="$installprefix";;
5950 In some special cases, particularly when building $package for distribution,
5951 it is convenient to distinguish between the directory in which files should
5952 be installed from the directory ($prefix) in which they
5953 will eventually reside. For most users, these two directories are the same.
5956 case "$installprefix" in
5958 *) dflt=$installprefix;;
5962 rp='What installation prefix should I use for installing files?'
5964 installprefix="$ans"
5965 installprefixexp="$ansexp"
5967 : set the prefixit variable, to compute a suitable default value
5968 prefixit='case "$3" in
5970 case "$oldprefix" in
5971 "") eval "$1=\"\$$2\"";;
5978 ""|" ") eval "$1=\"\$$2\"";;
5984 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
5986 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
5987 /*-$oldprefix/*|\~*-$oldprefix/*)
5988 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
5989 *) eval "$1=\"\$$2\"";;
5994 : get the patchlevel
5996 echo "Getting the current patchlevel..." >&4
5997 if $test -r $rsrc/patchlevel.h;then
5998 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
5999 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
6000 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
6001 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
6002 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
6003 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
6012 $echo "(You have $package version $patchlevel subversion $subversion.)"
6015 : XXX Should be a Configure test for double-dots in filenames.
6016 version=`echo $revision $patchlevel $subversion | \
6017 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
6018 api_versionstring=`echo $api_revision $api_version $api_subversion | \
6019 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
6022 version=`echo $revision $patchlevel $subversion | \
6023 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
6024 api_versionstring=`echo $api_revision $api_version $api_subversion | \
6025 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
6028 : Special case the 5.005_xx maintenance series, which used 5.005
6029 : without any subversion label as a subdirectory in $sitelib
6030 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
6031 api_versionstring='5.005'
6034 : determine installation style
6035 : For now, try to deduce it from prefix unless it is already set.
6036 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6037 case "$installstyle" in
6038 '') case "$prefix" in
6039 *perl*) dflt='lib';;
6040 *) dflt='lib/perl5' ;;
6043 *) dflt="$installstyle" ;;
6045 : Probably not worth prompting for this since we prompt for all
6046 : the directories individually, and the prompt would be too long and
6050 : determine where private library files go
6051 : Usual default is /usr/local/lib/perl5/$version.
6052 : Also allow things like /opt/perl/lib/$version, since
6053 : /opt/perl/lib/perl5... would be redundant.
6054 : The default "style" setting is made in installstyle.U
6055 case "$installstyle" in
6056 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6057 *) set dflt privlib lib/$version ;;
6062 There are some auxiliary files for $package that need to be put into a
6063 private library directory that is accessible by everyone.
6067 rp='Pathname where the private library files will reside?'
6070 privlibexp="$ansexp"
6071 : Change installation prefix, if necessary.
6072 if $test X"$prefix" != X"$installprefix"; then
6073 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
6075 installprivlib="$privlibexp"
6078 : set the prefixup variable, to restore leading tilda escape
6079 prefixup='case "$prefixexp" in
6081 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6084 : determine where public architecture dependent libraries go
6087 : privlib default is /usr/local/lib/$package/$version
6088 : archlib default is /usr/local/lib/$package/$version/$archname
6089 : privlib may have an optional trailing /share.
6090 tdflt=`echo $privlib | $sed 's,/share$,,'`
6091 tdflt=$tdflt/$archname
6100 $spackage contains architecture-dependent library files. If you are
6101 sharing libraries in a heterogeneous environment, you might store
6102 these files in a separate location. Otherwise, you can just include
6103 them with the rest of the public library files.
6107 rp='Where do you want to put the public architecture-dependent libraries?'
6110 archlibexp="$ansexp"
6111 if $test X"$archlib" = X"$privlib"; then
6116 : Change installation prefix, if necessary.
6117 if $test X"$prefix" != X"$installprefix"; then
6118 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
6120 installarchlib="$archlibexp"
6124 : Binary compatibility with 5.005 is not possible for builds
6125 : with advanced features
6126 case "$usethreads$usemultiplicity" in
6128 bincompat5005="$undef"
6129 d_bincompat5005="$undef"
6133 This version of Perl can be compiled for binary compatibility with 5.005.
6134 If you decide to do so, you will be able to continue using most of the
6135 extensions that were compiled for Perl 5.005.
6138 case "$bincompat5005$d_bincompat5005" in
6139 *"$undef"*) dflt=n ;;
6142 rp='Binary compatibility with Perl 5.005?'
6145 y*) val="$define" ;;
6150 case "$d_bincompat5005" in
6152 bincompat5005="$define"
6154 *) bincompat5005="$undef"
6155 d_bincompat5005="$undef"
6162 : see if setuid scripts can be secure
6165 Some kernels have a bug that prevents setuid #! scripts from being
6166 secure. Some sites have disabled setuid #! scripts because of this.
6168 First let's decide if your kernel supports secure setuid #! scripts.
6169 (If setuid #! scripts would be secure but have been disabled anyway,
6170 don't say that they are secure if asked.)
6175 if $test -d /dev/fd; then
6176 echo "#!$ls" >reflect
6177 chmod +x,u+s reflect
6178 ./reflect >flect 2>&1
6179 if $contains "/dev/fd" flect >/dev/null; then
6180 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6184 If you are not sure if they are secure, I can check but I'll need a
6185 username and password different from the one you are using right now.
6186 If you don't have such a username or don't want me to test, simply
6190 rp='Other username to test security of setuid scripts with?'
6195 case "$d_suidsafe" in
6196 '') echo "I'll assume setuid scripts are *not* secure." >&4
6199 echo "Well, the $hint value is *not* secure." >&4
6201 *) echo "Well, the $hint value *is* secure." >&4
6206 $rm -f reflect flect
6207 echo "#!$ls" >reflect
6208 chmod +x,u+s reflect
6211 echo '"su" will (probably) prompt you for '"$ans's password."
6212 su $ans -c './reflect >flect'
6213 if $contains "/dev/fd" flect >/dev/null; then
6214 echo "Okay, it looks like setuid scripts are secure." >&4
6217 echo "I don't think setuid scripts are secure." >&4
6222 rp='Does your kernel have *secure* setuid scripts?'
6225 [yY]*) val="$define";;
6230 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6231 echo "(That's for file descriptors, not floppy disks.)"
6237 $rm -f reflect flect
6239 : now see if they want to do setuid emulation
6242 case "$d_suidsafe" in
6245 echo "No need to emulate SUID scripts since they are secure here." >& 4
6249 Some systems have disabled setuid scripts, especially systems where
6250 setuid scripts cannot be secure. On systems where setuid scripts have
6251 been disabled, the setuid/setgid bits on scripts are currently
6252 useless. It is possible for $package to detect those bits and emulate
6253 setuid/setgid in a secure fashion. This emulation will only work if
6254 setuid scripts have been disabled in your kernel.
6258 "$define") dflt=y ;;
6261 rp="Do you want to do setuid/setgid emulation?"
6264 [yY]*) val="$define";;
6272 : see if this is a malloc.h system
6273 set malloc.h i_malloc
6276 : see if stdlib is available
6277 set stdlib.h i_stdlib
6280 : determine which malloc to compile in
6282 case "$usemymalloc" in
6283 ''|[yY]*|true|$define) dflt='y' ;;
6290 rp="Do you wish to attempt to use the malloc that comes with $package?"
6296 mallocsrc='malloc.c'
6297 mallocobj="malloc$_o"
6298 d_mymalloc="$define"
6301 : Remove malloc from list of libraries to use
6302 echo "Removing unneeded -lmalloc from library list" >&4
6303 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6306 echo "libs = $libs" >&4
6318 : compute the return types of malloc and free
6320 $cat >malloc.c <<END
6324 #include <sys/types.h>
6338 case "$malloctype" in
6340 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6347 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6351 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6358 echo "Your system uses $freetype free(), it would seem." >&4
6362 After $package is installed, you may wish to install various
6363 add-on modules and utilities. Typically, these add-ons will
6364 be installed under $prefix with the rest
6365 of this package. However, you may wish to install such add-ons
6366 elsewhere under a different prefix.
6368 If you do not wish to put everything under a single prefix, that's
6369 ok. You will be prompted for the individual locations; this siteprefix
6370 is only used to suggest the defaults.
6372 The default should be fine for most people.
6376 rp='Installation prefix to use for add-on modules and utilities?'
6377 : XXX Here might be another good place for an installstyle setting.
6378 case "$siteprefix" in
6380 *) dflt=$siteprefix ;;
6383 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6385 case "$siteprefix" in
6389 *) oldsiteprefix="$prefix";;
6394 siteprefixexp="$ansexp"
6396 : determine where site specific libraries go.
6397 : Usual default is /usr/local/lib/perl5/site_perl/$version
6398 : The default "style" setting is made in installstyle.U
6399 : XXX No longer works with Prefixit stuff.
6400 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6402 '') case "$installstyle" in
6403 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6404 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6412 The installation process will create a directory for
6413 site-specific extensions and modules. Most users find it convenient
6414 to place all site-specific files in this directory rather than in the
6415 main distribution directory.
6419 rp='Pathname for the site-specific library files?'
6422 sitelibexp="$ansexp"
6423 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6424 : Change installation prefix, if necessary.
6425 if $test X"$prefix" != X"$installprefix"; then
6426 installsitelib=`echo $sitelibexp | $sed "s#^$prefix#$installprefix#"`
6428 installsitelib="$sitelibexp"
6431 : determine where site specific architecture-dependent libraries go.
6432 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6433 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6434 : sitelib may have an optional trailing /share.
6436 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6437 dflt="$dflt/$archname"
6442 set sitearch sitearch none
6446 The installation process will also create a directory for
6447 architecture-dependent site-specific extensions and modules.
6451 rp='Pathname for the site-specific architecture-dependent library files?'
6454 sitearchexp="$ansexp"
6455 : Change installation prefix, if necessary.
6456 if $test X"$prefix" != X"$installprefix"; then
6457 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
6459 installsitearch="$sitearchexp"
6464 The installation process will also create a directory for
6465 vendor-supplied add-ons. Vendors who supply perl with their system
6466 may find it convenient to place all vendor-supplied files in this
6467 directory rather than in the main distribution directory. This will
6468 ease upgrades between binary-compatible maintenance versions of perl.
6470 Of course you may also use these directories in whatever way you see
6471 fit. For example, you might use them to access modules shared over a
6472 company-wide network.
6474 The default answer should be fine for most people.
6475 This causes further questions about vendor add-ons to be skipped
6476 and no vendor-specific directories will be configured for perl.
6479 rp='Do you want to configure vendor-specific add-on directories?'
6480 case "$usevendorprefix" in
6481 define|true|[yY]*) dflt=y ;;
6482 *) : User may have set vendorprefix directly on Configure command line.
6483 case "$vendorprefix" in
6492 rp='Installation prefix to use for vendor-supplied add-ons?'
6493 case "$vendorprefix" in
6495 *) dflt=$vendorprefix ;;
6498 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6500 case "$vendorprefix" in
6504 *) oldvendorprefix="$prefix";;
6508 usevendorprefix="$define"
6510 vendorprefixexp="$ansexp"
6512 *) usevendorprefix="$undef"
6518 case "$vendorprefix" in
6519 '') d_vendorlib="$undef"
6523 *) d_vendorlib="$define"
6524 : determine where vendor-supplied modules go.
6525 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6526 case "$vendorlib" in
6528 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6529 case "$installstyle" in
6530 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6531 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6534 *) dflt="$vendorlib"
6538 rp='Pathname for the vendor-supplied library files?'
6541 vendorlibexp="$ansexp"
6544 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6545 : Change installation prefix, if necessary.
6546 if $test X"$prefix" != X"$installprefix"; then
6547 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
6549 installvendorlib="$vendorlibexp"
6552 case "$vendorprefix" in
6553 '') d_vendorarch="$undef"
6557 *) d_vendorarch="$define"
6558 : determine where vendor-supplied architecture-dependent libraries go.
6559 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6560 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6561 : vendorlib may have an optional trailing /share.
6562 case "$vendorarch" in
6563 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6564 dflt="$dflt/$archname"
6566 *) dflt="$vendorarch" ;;
6569 rp='Pathname for vendor-supplied architecture-dependent files?'
6572 vendorarchexp="$ansexp"
6575 : Change installation prefix, if necessary.
6576 if $test X"$prefix" != X"$installprefix"; then
6577 installvendorarch=`echo $vendorarchexp | sed "s#^$prefix#$installprefix#"`
6579 installvendorarch="$vendorarchexp"
6582 : Final catch-all directories to search
6585 Lastly, you can have perl look in other directories for extensions and
6586 modules in addition to those already specified.
6587 These directories will be searched after
6591 test X"$vendorlib" != "X" && echo ' ' $vendorlib
6592 test X"$vendorarch" != "X" && echo ' ' $vendorarch
6594 case "$otherlibdirs" in
6595 ''|' ') dflt='none' ;;
6596 *) dflt="$otherlibdirs" ;;
6599 Enter a colon-separated set of extra paths to include in perl's @INC
6600 search path, or enter 'none' for no extra paths.
6604 rp='Colon-separated list of additional directories for perl to search?'
6607 ' '|''|none) otherlibdirs=' ' ;;
6608 *) otherlibdirs="$ans" ;;
6610 case "$otherlibdirs" in
6614 set d_perl_otherlibdirs
6617 : Cruising for prototypes
6619 echo "Checking out function prototypes..." >&4
6620 $cat >prototype.c <<'EOCP'
6621 int main(int argc, char *argv[]) {
6624 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
6625 echo "Your C compiler appears to support function prototypes."
6628 echo "Your C compiler doesn't seem to understand function prototypes."
6635 case "$prototype" in
6637 *) ansi2knr='ansi2knr'
6642 This version of $package can only be compiled by a compiler that
6643 understands function prototypes. Unfortunately, your C compiler
6645 doesn't seem to understand them. Sorry about that.
6647 If GNU cc is available for your system, perhaps you could try that instead.
6649 Eventually, we hope to support building Perl with pre-ANSI compilers.
6650 If you would like to help in that effort, please contact <perlbug@perl.org>.
6652 Aborting Configure now.
6658 : determine where public executables go
6663 rp='Pathname where the public executables will reside?'
6665 if $test "X$ansexp" != "X$binexp"; then
6670 : Change installation prefix, if necessary.
6671 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6672 if $test X"$prefix" != X"$installprefix"; then
6673 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
6675 installbin="$binexp"
6678 : Find perl5.005 or later.
6679 echo "Looking for a previously installed perl5.005 or later... "
6681 '') for tdir in `echo "$binexp:$PATH" | $sed "s/$path_sep/ /g"`; do
6682 : Check if this perl is recent and can load a simple module
6683 if $test -x $tdir/perl && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6686 elif $test -x $tdir/perl5 && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6696 '') echo "None found. That's ok.";;
6697 *) echo "Using $perl5." ;;
6700 : Determine list of previous versions to include in @INC
6701 $cat > getverlist <<EOPL
6704 \$api_versionstring = "$api_versionstring";
6705 \$version = "$version";
6706 \$stem = "$sitelib_stem";
6707 \$archname = "$archname";
6709 $cat >> getverlist <<'EOPL'
6710 # Can't have leading @ because metaconfig interprets it as a command!
6711 ;@inc_version_list=();
6712 # XXX Redo to do opendir/readdir?
6715 ;@candidates = glob("5.*");
6721 # XXX ToDo: These comparisons must be reworked when two-digit
6722 # subversions come along, so that 5.7.10 compares as greater than
6723 # 5.7.3! By that time, hope that 5.6.x is sufficiently
6724 # widespread that we can use the built-in version vectors rather
6725 # than reinventing them here. For 5.6.0, however, we must
6726 # assume this script will likely be run by 5.005_0x. --AD 1/2000.
6727 foreach $d (@candidates) {
6728 if ($d lt $version) {
6729 if ($d ge $api_versionstring) {
6730 unshift(@inc_version_list, grep { -d } "$d/$archname", $d);
6732 elsif ($d ge "5.005") {
6733 unshift(@inc_version_list, grep { -d } $d);
6737 # Skip newer version. I.e. don't look in
6738 # 5.7.0 if we're installing 5.6.1.
6742 if (@inc_version_list) {
6743 print join(' ', @inc_version_list);
6746 # Blank space to preserve value for next Configure run.
6751 case "$inc_version_list" in
6752 '') if test -x "$perl5"; then
6753 dflt=`$perl5 getverlist`
6758 $undef) dflt='none' ;;
6759 *) dflt="$inc_version_list" ;;
6762 ''|' ') dflt=none ;;
6765 5.005) case "$bincompat5005" in
6766 $define|true|[yY]*) ;;
6773 In order to ease the process of upgrading, this version of perl
6774 can be configured to use modules built and installed with earlier
6775 versions of perl that were installed under $prefix. Specify here
6776 the list of earlier versions that this version of perl should check.
6777 If Configure detected no earlier versions of perl installed under
6778 $prefix, then the list will be empty. Answer 'none' to tell perl
6779 to not search earlier versions.
6781 The default should almost always be sensible, so if you're not sure,
6782 just accept the default.
6785 rp='List of earlier versions to include in @INC?'
6788 [Nn]one|''|' ') inc_version_list=' ' ;;
6789 *) inc_version_list="$ans" ;;
6791 case "$inc_version_list" in
6793 inc_version_list_init='0';;
6794 *) inc_version_list_init=`echo $inc_version_list |
6795 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6800 : determine whether to install perl also as /usr/bin/perl
6803 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
6805 Many scripts expect perl to be installed as /usr/bin/perl.
6806 I can install the perl you are about to compile also as /usr/bin/perl
6807 (in addition to $installbin/perl).
6809 case "$installusrbinperl" in
6810 "$undef"|[nN]*) dflt='n';;
6813 rp="Do you want to install perl as /usr/bin/perl?"
6816 [yY]*) val="$define";;
6822 set installusrbinperl
6825 : see if dld is available
6829 : see if dlopen exists
6836 : determine which dynamic loading, if any, to compile in
6838 dldir="ext/DynaLoader"
6851 $define) dflt='y' ;;
6854 $define) dflt='y' ;;
6856 : Does a dl_xxx.xs file exist for this operating system
6857 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
6860 rp="Do you wish to use dynamic loading?"
6867 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
6868 dflt="$dldir/dl_${osname}.xs"
6869 elif $test "$d_dlopen" = "$define" ; then
6870 dflt="$dldir/dl_dlopen.xs"
6871 elif $test "$i_dld" = "$define" ; then
6872 dflt="$dldir/dl_dld.xs"
6877 *) dflt="$dldir/$dlsrc"
6880 echo "The following dynamic loading files are available:"
6881 : Can not go over to $dldir because getfile has path hard-coded in.
6882 tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir
6883 rp="Source file to use for dynamic loading"
6889 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
6893 Some systems may require passing special flags to $cc -c to
6894 compile modules that will be used to create a shared library.
6895 To use no flags, say "none".
6898 case "$cccdlflags" in
6899 '') case "$gccversion" in
6900 '') case "$osname" in
6902 next) dflt='none' ;;
6903 irix*) dflt='-KPIC' ;;
6904 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
6905 sunos) dflt='-pic' ;;
6909 *) case "$osname" in
6910 svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
6915 *) dflt="$cccdlflags" ;;
6917 rp="Any special flags to pass to $cc -c to compile shared library modules?"
6920 none) cccdlflags=' ' ;;
6921 *) cccdlflags="$ans" ;;
6926 Some systems use ld to create libraries that can be dynamically loaded,
6927 while other systems (such as those using ELF) use $cc.
6931 '') $cat >try.c <<'EOM'
6932 /* Test for whether ELF binaries are produced */
6937 int i = open("a.out",O_RDONLY);
6940 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
6941 exit(0); /* succeed (yes, it's ELF) */
6946 if $cc $ccflags try.c >/dev/null 2>&1 && ./a.out; then
6948 You appear to have ELF support. I'll use $cc to build dynamic libraries.
6952 echo "I'll use ld to build dynamic libraries."
6961 rp="What command should be used to create dynamic libraries?"
6967 Some systems may require passing special flags to $ld to create a
6968 library that can be dynamically loaded. If your ld flags include
6969 -L/other/path options to locate libraries outside your loader's normal
6970 search path, you may need to specify those -L options here as well. To
6971 use no flags, say "none".
6974 case "$lddlflags" in
6975 '') case "$osname" in
6976 beos) dflt='-nostart' ;;
6978 case "$gccversion" in
6979 '') dflt="$dflt +vnocompatwarnings" ;;
6982 linux|irix*) dflt='-shared' ;;
6983 next) dflt='none' ;;
6984 solaris) dflt='-G' ;;
6985 sunos) dflt='-assert nodefinitions' ;;
6986 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
6990 *) dflt="$lddlflags" ;;
6993 : Try to guess additional flags to pick up local libraries.
6994 : Be careful not to append to a plain 'none'
6998 for thisflag in $ldflags; do
7003 *) dflt="$dflt $thisflag" ;;
7010 ''|' ') dflt='none' ;;
7013 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
7016 none) lddlflags=' ' ;;
7017 *) lddlflags="$ans" ;;
7022 Some systems may require passing special flags to $cc to indicate that
7023 the resulting executable will use dynamic linking. To use no flags,
7027 case "$ccdlflags" in
7028 '') case "$osname" in
7029 hpux) dflt='-Wl,-E' ;;
7030 linux) dflt='-rdynamic' ;;
7031 next) dflt='none' ;;
7032 sunos) dflt='none' ;;
7036 *) dflt="$ccdlflags" ;;
7038 rp="Any special flags to pass to $cc to use dynamic linking?"
7041 none) ccdlflags=' ' ;;
7042 *) ccdlflags="$ans" ;;
7056 # No dynamic loading being used, so don't bother even to prompt.
7059 *) case "$useshrplib" in
7060 '') case "$osname" in
7061 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
7063 also='Building a shared libperl is required for dynamic loading to work on your system.'
7068 also='Building a shared libperl is needed for MAB support.'
7086 The perl executable is normally obtained by linking perlmain.c with
7087 libperl${_a}, any static extensions (usually just DynaLoader), and
7088 any other libraries needed on this system (such as -lm, etc.). Since
7089 your system supports dynamic loading, it is probably possible to build
7090 a shared libperl.$so. If you will have more than one executable linked
7091 to libperl.$so, this will significantly reduce the size of each
7092 executable, but it may have a noticeable affect on performance. The
7093 default is probably sensible for your system.
7097 rp="Build a shared libperl.$so (y/n)"
7101 useshrplib='true' ;;
7102 *) useshrplib='false' ;;
7107 case "$useshrplib" in
7111 # Figure out a good name for libperl.so. Since it gets stored in
7112 # a version-specific architecture-dependent library, the version
7113 # number isn't really that important, except for making cc/ld happy.
7115 # A name such as libperl.so.3.1
7116 majmin="libperl.$so.$patchlevel.$subversion"
7117 # A name such as libperl.so.301
7118 majonly=`echo $patchlevel $subversion |
7119 $awk '{printf "%d%02d", $1, $2}'`
7120 majonly=libperl.$so.$majonly
7121 # I'd prefer to keep the os-specific stuff here to a minimum, and
7122 # rely on figuring it out from the naming of libc.
7123 case "${osname}${osvers}" in
7126 # XXX How handle the --version stuff for MAB?
7128 linux*) # ld won't link with a bare -lperl otherwise.
7131 cygwin*) # include version
7132 dflt=`echo libperl$version | sed -e 's/\./_/g'`$lib_ext
7134 *) # Try to guess based on whether libc has major.minor.
7136 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
7137 *libc.$so.[0-9]*) dflt=$majonly ;;
7138 *) dflt=libperl.$so ;;
7148 I need to select a good name for the shared libperl. If your system uses
7149 library names with major and minor numbers, then you might want something
7150 like $majmin. Alternatively, if your system uses a single version
7151 number for shared libraries, then you might want to use $majonly.
7152 Or, your system might be quite happy with a simple libperl.$so.
7154 Since the shared libperl will get installed into a version-specific
7155 architecture-dependent directory, the version number of the shared perl
7156 library probably isn't important, so the default should be o.k.
7159 rp='What name do you want to give to the shared libperl?'
7162 echo "Ok, I'll use $libperl"
7165 libperl="libperl${_a}"
7169 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
7173 WARNING: Use of the shrpdir variable for the installation location of
7174 the shared $libperl is not supported. It was never documented and
7175 will not work in this version. Let me (perlbug@perl.org)
7176 know of any problems this may cause.
7182 But your current setting of $shrpdir is
7183 the default anyway, so it's harmless.
7188 Further, your current attempted setting of $shrpdir
7189 conflicts with the value of $archlibexp/CORE
7190 that installperl will use.
7197 # How will the perl executable find the installed shared $libperl?
7198 # Add $xxx to ccdlflags.
7199 # If we can't figure out a command-line option, use $shrpenv to
7200 # set env LD_RUN_PATH. The main perl makefile uses this.
7201 shrpdir=$archlibexp/CORE
7204 if "$useshrplib"; then
7207 # We'll set it in Makefile.SH...
7213 xxx="-Wl,-R$shrpdir"
7215 linux|irix*|dec_osf)
7216 xxx="-Wl,-rpath,$shrpdir"
7219 # next doesn't like the default...
7222 # beos doesn't like the default, either.
7225 # hpux doesn't like the default, either.
7226 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
7229 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
7235 # Only add $xxx if it isn't already in ccdlflags.
7236 case " $ccdlflags " in
7238 *) ccdlflags="$ccdlflags $xxx"
7241 Adding $xxx to the flags
7242 passed to $ld so that the perl executable will find the
7243 installed shared $libperl.
7251 # Fix ccdlflags in AIX for building external extensions.
7252 # (For building Perl itself bare -bE:perl.exp is needed,
7253 # Makefile.SH takes care of this.)
7255 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
7257 # Respect a hint or command-line value.
7259 '') shrpenv="$tmp_shrpenv" ;;
7261 case "$ldlibpthname" in
7262 '') ldlibpthname=LD_LIBRARY_PATH ;;
7263 none) ldlibpthname='' ;;
7266 : determine where manual pages are on this system
7270 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
7271 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
7272 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
7273 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
7274 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
7275 sysman=`./loc . /usr/man/man1 $syspath`
7278 if $test -d "$sysman"; then
7279 echo "System manual is in $sysman." >&4
7281 echo "Could not find manual pages in source form." >&4
7284 : determine where manual pages go
7285 set man1dir man1dir none
7289 $spackage has manual pages available in source form.
7293 echo "However, you don't have nroff, so they're probably useless to you."
7295 '') man1dir="none";;
7298 echo "If you don't want the manual sources installed, answer 'none'."
7303 lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
7304 lookpath="$lookpath $prefixexp/man/p_man/man1"
7305 lookpath="$lookpath $prefixexp/man/u_man/man1"
7306 lookpath="$lookpath $prefixexp/man/man.1"
7308 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
7309 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
7319 rp="Where do the main $spackage manual pages (source) go?"
7321 if $test "X$man1direxp" != "X$ansexp"; then
7325 man1direxp="$ansexp"
7331 : Change installation prefix, if necessary.
7332 if $test X"$prefix" != X"$installprefix"; then
7333 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
7335 installman1dir="$man1direxp"
7338 : What suffix to use on installed man pages
7345 rp="What suffix should be used for the main $spackage man pages?"
7347 '') case "$man1dir" in
7361 *) dflt="$man1ext";;
7368 : see if we can have long filenames
7370 first=123456789abcdef
7372 if (echo hi >$first) 2>/dev/null; then
7373 if $test -f 123456789abcde; then
7374 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
7377 echo 'You can have filenames longer than 14 characters.'>&4
7382 You can't have filenames longer than 14 chars.
7383 You can't even think about them!
7389 $rm -rf 123456789abcde*
7391 : determine where library module manual pages go
7392 set man3dir man3dir none
7396 $spackage has manual pages for many of the library modules.
7402 However, you don't have nroff, so they're probably useless to you.
7405 '') man3dir="none";;
7409 case "$d_flexfnam" in
7412 However, your system can't handle the long file names like File::Basename.3.
7415 '') man3dir="none";;
7419 echo "If you don't want the manual sources installed, answer 'none'."
7420 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7422 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
7423 if $test -d "$privlib/man/man3"; then
7426 WARNING: Previous versions of perl installed man3 pages into
7427 $privlib/man/man3. This version will suggest a
7428 new default of $dflt.
7432 rp='Do you wish to preserve the old behavior?(y/n)'
7435 y*) dflt="$privlib/man/man3" ;;
7440 *) dflt="$man3dir" ;;
7447 rp="Where do the $package library man pages (source) go?"
7450 man3direxp="$ansexp"
7456 : Change installation prefix, if necessary.
7457 if $test X"$prefix" != X"$installprefix"; then
7458 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
7460 installman3dir="$man3direxp"
7463 : What suffix to use on installed man pages
7469 rp="What suffix should be used for the $package library man pages?"
7471 '') case "$man3dir" in
7485 *) dflt="$man3ext";;
7492 : see if we have to deal with yellow pages, now NIS.
7493 if $test -d /usr/etc/yp || $test -d /etc/yp; then
7494 if $test -f /usr/etc/nibindd; then
7496 echo "I'm fairly confident you're on a NeXT."
7498 rp='Do you get the hosts file via NetInfo?'
7507 y*) hostcat='nidump hosts .';;
7508 *) case "$hostcat" in
7509 nidump*) hostcat='';;
7519 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
7527 rp='Are you getting the hosts file via yellow pages?'
7530 y*) hostcat='ypcat hosts';;
7531 *) hostcat='cat /etc/hosts';;
7537 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
7540 '') test -f /etc/group && groupcat='cat /etc/group';;
7543 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
7546 : now get the host name
7548 echo "Figuring out host name..." >&4
7549 case "$myhostname" in
7551 echo 'Maybe "hostname" will work...'
7552 if tans=`sh -c hostname 2>&1` ; then
7560 if $test "$cont"; then
7562 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
7563 if tans=`cat /etc/systemid 2>&1` ; then
7565 phostname='cat /etc/systemid'
7566 echo "Whadyaknow. Xenix always was a bit strange..."
7569 elif $test -r /etc/systemid; then
7570 echo "(What is a non-Xenix system doing with /etc/systemid?)"
7573 if $test "$cont"; then
7574 echo 'No, maybe "uuname -l" will work...'
7575 if tans=`sh -c 'uuname -l' 2>&1` ; then
7577 phostname='uuname -l'
7579 echo 'Strange. Maybe "uname -n" will work...'
7580 if tans=`sh -c 'uname -n' 2>&1` ; then
7582 phostname='uname -n'
7584 echo 'Oh well, maybe I can mine it out of whoami.h...'
7585 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
7586 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
7587 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
7589 case "$myhostname" in
7590 '') echo "Does this machine have an identity crisis or something?"
7593 echo "Well, you said $myhostname before..."
7594 phostname='echo $myhostname';;
7600 : you do not want to know about this
7605 if $test "$myhostname" ; then
7607 rp='Your host name appears to be "'$myhostname'".'" Right?"
7615 : bad guess or no guess
7616 while $test "X$myhostname" = X ; do
7618 rp="Please type the (one word) name of your host:"
7623 : translate upper to lower if necessary
7624 case "$myhostname" in
7626 echo "(Normalizing case in your host name)"
7627 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
7631 case "$myhostname" in
7633 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
7634 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
7635 echo "(Trimming domain name from host name--host name is now $myhostname)"
7637 *) case "$mydomain" in
7640 test "X$hostcat" = "Xypcat hosts" &&
7641 ypmatch "$myhostname" hosts 2>/dev/null |\
7642 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
7645 test "X$hostcat" != "X" &&
7646 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
7647 /[ ]$myhostname[ . ]/p" > hosts
7650 if $test -f hosts; then
7651 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
7652 END { print sum }" hosts` = x1 || tmp_re="[ ]"
7653 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
7654 hosts | $sort | $uniq | \
7655 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
7656 case `$echo X$dflt` in
7657 X*\ *) echo "(Several hosts in the database matched hostname)"
7660 X.) echo "(You do not have fully-qualified names in the hosts database)"
7664 echo "(I cannot locate a hosts database anywhere)"
7669 tans=`./loc resolv.conf X /etc /usr/etc`
7670 if $test -f "$tans"; then
7671 echo "(Attempting domain name extraction from $tans)"
7672 dflt=.`$sed -n -e 's/ / /g' \
7673 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
7674 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
7676 .) dflt=.`$sed -n -e 's/ / /g' \
7677 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
7678 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
7685 .) echo "(No help from resolv.conf either -- attempting clever guess)"
7686 dflt=.`sh -c domainname 2>/dev/null`
7689 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
7693 case "$dflt$osname" in
7694 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
7695 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
7699 .) echo "(Lost all hope -- silly guess then)"
7705 *) dflt="$mydomain";;
7709 rp="What is your domain name?"
7719 : translate upper to lower if necessary
7722 echo "(Normalizing case in your domain name)"
7723 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
7727 : a little sanity check here
7728 case "$phostname" in
7731 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
7732 $myhostname$mydomain|$myhostname) ;;
7734 case "$phostname" in
7736 echo "(That doesn't agree with your whoami.h file, by the way.)"
7739 echo "(That doesn't agree with your $phostname command, by the way.)"
7749 I need to get your e-mail address in Internet format if possible, i.e.
7750 something like user@host.domain. Please answer accurately since I have
7751 no easy means to double check it. The default value provided below
7752 is most probably close to reality but may not be valid from outside
7753 your organization...
7757 while test "$cont"; do
7759 '') dflt="$cf_by@$myhostname$mydomain";;
7760 *) dflt="$cf_email";;
7762 rp='What is your e-mail address?'
7768 rp='Address does not look like an Internet one. Use it anyway?'
7784 If you or somebody else will be maintaining perl at your site, please
7785 fill in the correct e-mail address here so that they may be contacted
7786 if necessary. Currently, the "perlbug" program included with perl
7787 will send mail to this address in addition to perlbug@perl.org. You may
7788 enter "none" for no administrator.
7791 case "$perladmin" in
7792 '') dflt="$cf_email";;
7793 *) dflt="$perladmin";;
7795 rp='Perl administrator e-mail address'
7799 : determine whether to only install version-specific parts.
7802 Do you want to install only the version-specific parts of the perl
7803 distribution? Usually you do *not* want to do this.
7805 case "$versiononly" in
7806 "$define"|[Yy]*|true) dflt='y' ;;
7809 rp="Do you want to install only the version-specific parts of perl?"
7812 [yY]*) val="$define";;
7818 : figure out how to guarantee perl startup
7819 case "$startperl" in
7821 case "$sharpbang" in
7825 I can use the #! construct to start perl on your system. This will
7826 make startup of perl scripts faster, but may cause problems if you
7827 want to share those scripts and perl is not in a standard place
7828 ($binexp/perl) on all your platforms. The alternative is to force
7829 a shell by starting the script with a single ':' character.
7832 case "$versiononly" in
7833 "$define") dflt="$binexp/perl$version";;
7834 *) dflt="$binexp/perl";;
7836 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
7839 none) startperl=": # use perl";;
7840 *) startperl="#!$ans"
7841 if $test 30 -lt `echo "$ans" | wc -c`; then
7844 WARNING: Some systems limit the #! command to 32 characters.
7845 If you experience difficulty running Perl scripts with #!, try
7846 installing Perl in a directory with a shorter pathname.
7852 *) startperl=": # use perl"
7857 echo "I'll use $startperl to start perl scripts."
7859 : figure best path for perl in scripts
7862 perlpath="$binexp/perl"
7863 case "$startperl" in
7868 I will use the "eval 'exec'" idiom to start Perl on your system.
7869 I can use the full path of your Perl binary for this purpose, but
7870 doing so may cause problems if you want to share those scripts and
7871 Perl is not always in a standard place ($binexp/perl).
7875 rp="What path shall I use in \"eval 'exec'\"?"
7882 case "$startperl" in
7884 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
7887 : determine where public executable scripts go
7888 set scriptdir scriptdir
7890 case "$scriptdir" in
7893 : guess some guesses
7894 $test -d /usr/share/scripts && dflt=/usr/share/scripts
7895 $test -d /usr/share/bin && dflt=/usr/share/bin
7896 $test -d /usr/local/script && dflt=/usr/local/script
7897 $test -d /usr/local/scripts && dflt=/usr/local/scripts
7898 $test -d $prefixexp/script && dflt=$prefixexp/script
7902 *) dflt="$scriptdir"
7907 Some installations have a separate directory just for executable scripts so
7908 that they can mount it across multiple architectures but keep the scripts in
7909 one spot. You might, for example, have a subdirectory of /usr/share for this.
7910 Or you might just lump your scripts in with all your other executables.
7914 rp='Where do you keep publicly executable scripts?'
7916 if $test "X$ansexp" != "X$scriptdirexp"; then
7920 scriptdirexp="$ansexp"
7921 : Change installation prefix, if necessary.
7922 if $test X"$prefix" != X"$installprefix"; then
7923 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
7925 installscript="$scriptdirexp"
7928 : determine where add-on public executables go
7930 '') dflt=$siteprefix/bin ;;
7934 rp='Pathname where the add-on public executables should be installed?'
7937 sitebinexp="$ansexp"
7938 : Change installation prefix, if necessary.
7939 if $test X"$prefix" != X"$installprefix"; then
7940 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
7942 installsitebin="$sitebinexp"
7945 case "$vendorprefix" in
7946 '') d_vendorbin="$undef"
7950 *) d_vendorbin="$define"
7951 : determine where vendor-supplied executables go.
7952 case "$vendorbin" in
7953 '') dflt=$vendorprefix/bin ;;
7954 *) dflt="$vendorbin" ;;
7957 rp='Pathname for the vendor-supplied executables directory?'
7960 vendorbinexp="$ansexp"
7963 : Change installation prefix, if necessary.
7964 if $test X"$prefix" != X"$installprefix"; then
7965 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
7967 installvendorbin="$vendorbinexp"
7970 : see if qgcvt exists
7976 if $test X"$d_longdbl" = X"$define"; then
7978 echo "Checking how to print long doubles..." >&4
7980 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
7981 $cat >try.c <<'EOCP'
7982 #include <sys/types.h>
7986 printf("%.3f\n", d);
7990 if eval $compile; then
7994 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
7995 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
7996 echo "We will use %f."
8002 if $test X"$sPRIfldbl" = X; then
8003 $cat >try.c <<'EOCP'
8004 #include <sys/types.h>
8007 long double d = 123.456;
8008 printf("%.3llf\n", d);
8012 if eval $compile; then
8016 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
8017 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
8018 echo "We will use %llf."
8024 if $test X"$sPRIfldbl" = X; then
8025 $cat >try.c <<'EOCP'
8026 #include <sys/types.h>
8029 long double d = 123.456;
8030 printf("%.3Lf\n", d);
8034 if eval $compile; then
8038 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
8039 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
8040 echo "We will use %Lf."
8046 if $test X"$sPRIfldbl" = X; then
8047 $cat >try.c <<'EOCP'
8048 #include <sys/types.h>
8051 long double d = 123.456;
8052 printf("%.3lf\n", d);
8056 if eval $compile; then
8060 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
8061 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
8062 echo "We will use %lf."
8068 if $test X"$sPRIfldbl" = X; then
8069 echo "Cannot figure out how to print long doubles." >&4
8071 sSCNfldbl=$sPRIfldbl # expect consistency
8078 case "$sPRIfldbl" in
8079 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
8080 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
8081 d_SCNfldbl="$undef";
8083 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
8084 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
8085 d_SCNfldbl="$define";
8089 : Check how to convert floats to strings.
8091 echo "Checking for an efficient way to convert floats to strings."
8093 case "$uselongdouble" in
8094 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
8096 case "$d_longdbl" in
8097 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
8099 case "$d_PRIgldbl" in
8100 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
8104 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
8105 char *myname = "gconvert";
8108 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
8109 char *myname = "gcvt";
8112 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
8113 char *myname = "qgcvt";
8114 #define DOUBLETYPE long double
8117 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE) && defined(HAS_PRIgldbl)
8118 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
8120 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
8122 char *myname = "sprintf";
8126 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
8127 #define DOUBLETYPE long double
8129 #define DOUBLETYPE double
8135 #define I_STDLIB $i_stdlib
8141 checkit(expect, got)
8145 if (strcmp(expect, got)) {
8146 printf("%s oddity: Expected %s, got %s\n",
8147 myname, expect, got);
8157 /* This must be 1st test on (which?) platform */
8158 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
8159 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
8160 checkit("0.1", buf);
8162 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
8165 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
8166 checkit("1.1", buf);
8168 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
8169 checkit("1.01", buf);
8171 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
8172 checkit("1.001", buf);
8174 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
8175 checkit("1.0001", buf);
8177 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
8178 checkit("1.00001", buf);
8180 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
8181 checkit("1.000001", buf);
8183 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
8186 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
8189 /* Some Linux gcvt's give 1.e+5 here. */
8190 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
8191 checkit("100000", buf);
8193 /* Some Linux gcvt's give -1.e+5 here. */
8194 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
8195 checkit("-100000", buf);
8197 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
8198 checkit("123.456", buf);
8203 case "$d_Gconvert" in
8204 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
8205 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
8206 sprintf*) xxx_list='sprintf gconvert gcvt' ;;
8207 *) xxx_list='gconvert gcvt sprintf' ;;
8210 case "$d_longdbl$uselongdouble$d_PRIgldbl" in
8211 "$define$define$define")
8212 # for long doubles prefer first qgcvt, then sprintf
8213 xxx_list="`echo $xxx_list|sed s/sprintf//`"
8214 xxx_list="sprintf $xxx_list"
8216 "$define") xxx_list="qgcvt $xxx_list" ;;
8221 for xxx_convert in $xxx_list; do
8222 echo "Trying $xxx_convert..."
8224 set try -DTRY_$xxx_convert
8225 if eval $compile; then
8226 echo "$xxx_convert() found." >&4
8228 echo "I'll use $xxx_convert to convert floats into a string." >&4
8231 echo "...But $xxx_convert didn't work as I expected."
8234 echo "$xxx_convert NOT found." >&4
8238 case "$xxx_convert" in
8239 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
8240 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
8241 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
8242 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
8243 "$define$define$define")
8244 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
8245 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
8250 : see if _fwalk exists
8254 : Initialize h_fcntl
8257 : Initialize h_sysfile
8260 : access call always available on UNIX
8264 : locate the flags for 'access()'
8268 $cat >access.c <<'EOCP'
8269 #include <sys/types.h>
8274 #include <sys/file.h>
8283 : check sys/file.h first, no particular reason here
8284 if $test `./findhdr sys/file.h` && \
8285 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
8287 echo "<sys/file.h> defines the *_OK access constants." >&4
8288 elif $test `./findhdr fcntl.h` && \
8289 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
8291 echo "<fcntl.h> defines the *_OK access constants." >&4
8292 elif $test `./findhdr unistd.h` && \
8293 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
8294 echo "<unistd.h> defines the *_OK access constants." >&4
8296 echo "I can't find the four *_OK access constants--I'll use mine." >&4
8302 : see if accessx exists
8303 set accessx d_accessx
8306 : see if alarm exists
8310 : see if atolf exists
8314 : see if atoll exists
8318 : Look for GNU-cc style attribute checking
8320 echo "Checking whether your compiler can handle __attribute__ ..." >&4
8321 $cat >attrib.c <<'EOCP'
8323 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
8325 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
8326 if $contains 'warning' attrib.out >/dev/null 2>&1; then
8327 echo "Your C compiler doesn't fully support __attribute__."
8330 echo "Your C compiler supports __attribute__."
8334 echo "Your C compiler doesn't seem to understand __attribute__ at all."
8341 : see if bcmp exists
8345 : see if bcopy exists
8349 : see if this is a unistd.h system
8350 set unistd.h i_unistd
8353 : see if getpgrp exists
8354 set getpgrp d_getpgrp
8357 case "$d_getpgrp" in
8360 echo "Checking to see which flavor of getpgrp is in use..."
8363 #include <sys/types.h>
8365 # include <unistd.h>
8369 if (getuid() == 0) {
8370 printf("(I see you are running Configure as super-user...)\n");
8374 if (getpgrp(1) == 0)
8383 if $cc -o set -DTRY_BSD_PGRP $ccflags $ldflags set.c $libs >/dev/null 2>&1 && ./set; then
8384 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
8386 elif $cc -o set $ccflags $ldflags set.c $libs >/dev/null 2>&1 && ./set; then
8387 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
8390 echo "I can't seem to compile and run the test program."
8392 xxx="a USG one, i.e. you use getpgrp()."
8394 # SVR4 systems can appear rather BSD-ish.
8397 xxx="a BSD one, i.e. you use getpgrp(pid)."
8401 xxx="probably a USG one, i.e. you use getpgrp()."
8406 echo "Assuming your getpgrp is $xxx" >&4
8415 : see if setpgrp exists
8416 set setpgrp d_setpgrp
8419 case "$d_setpgrp" in
8422 echo "Checking to see which flavor of setpgrp is in use..."
8425 #include <sys/types.h>
8427 # include <unistd.h>
8431 if (getuid() == 0) {
8432 printf("(I see you are running Configure as super-user...)\n");
8436 if (-1 == setpgrp(1, 1))
8439 if (setpgrp() != -1)
8445 if $cc -o set -DTRY_BSD_PGRP $ccflags $ldflags set.c $libs >/dev/null 2>&1 && ./set; then
8446 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
8448 elif $cc -o set $ccflags $ldflags set.c $libs >/dev/null 2>&1 && ./set; then
8449 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
8452 echo "(I can't seem to compile and run the test program.)"
8454 xxx="a USG one, i.e. you use setpgrp()."
8456 # SVR4 systems can appear rather BSD-ish.
8459 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
8463 xxx="probably a USG one, i.e. you use setpgrp()."
8468 echo "Assuming your setpgrp is $xxx" >&4
8476 : see if bzero exists
8480 : see if signal is declared as pointer to function returning int or void
8482 xxx=`./findhdr signal.h`
8483 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
8484 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
8485 echo "You have int (*signal())() instead of void." >&4
8487 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
8488 echo "You have void (*signal())()." >&4
8490 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
8491 echo "You have int (*signal())() instead of void." >&4
8493 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
8494 echo "You have void (*signal())()." >&4
8497 case "$d_voidsig" in
8499 echo "I can't determine whether signal handler returns void or int..." >&4
8501 rp="What type does your signal handler return?"
8508 echo "As you already told me, signal handler returns void." >&4
8511 *) echo "As you already told me, signal handler returns int." >&4
8518 case "$d_voidsig" in
8519 "$define") signal_t="void";;
8524 : check for ability to cast large floats to 32-bit ints.
8526 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
8527 if $test "$intsize" -ge 4; then
8534 #include <sys/types.h>
8536 $signal_t blech(s) int s; { exit(3); }
8543 signal(SIGFPE, blech);
8545 /* Don't let compiler optimize the test away. Store the number
8546 in a writable string for gcc to pass to sscanf under HP/UX.
8548 sprintf(str, "2147483647");
8549 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
8553 /* x86 processors will probably give 0x8000 0000, which is a
8554 sign change. We don't want that. We want to mimic SPARC
8555 behavior here, which is to preserve the sign and give
8558 if (i32 != ($xxx) f)
8564 if eval $compile_ok; then
8568 echo "(I can't seem to compile the test program--assuming it can't)"
8576 echo "Nope, it can't."
8583 : check for ability to cast negative floats to unsigned
8585 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
8588 #include <sys/types.h>
8590 $signal_t blech(s) int s; { exit(7); }
8591 $signal_t blech_in_list(s) int s; { exit(4); }
8592 unsigned long dummy_long(p) unsigned long p; { return p; }
8593 unsigned int dummy_int(p) unsigned int p; { return p; }
8594 unsigned short dummy_short(p) unsigned short p; { return p; }
8598 unsigned long along;
8600 unsigned short ashort;
8604 /* Frustrate gcc-2.7.2's optimizer which failed this test with
8605 a direct f = -123. assignment. gcc-2.8.0 reportedly
8606 optimized the whole file away
8608 /* Store the number in a writable string for gcc to pass to
8611 sprintf(str, "-123");
8612 sscanf(str, "%lf", &f); /* f = -123.; */
8614 signal(SIGFPE, blech);
8615 along = (unsigned long)f;
8616 aint = (unsigned int)f;
8617 ashort = (unsigned short)f;
8618 if (along != (unsigned long)-123)
8620 if (aint != (unsigned int)-123)
8622 if (ashort != (unsigned short)-123)
8624 sprintf(str, "1073741824.");
8625 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
8628 along = (unsigned long)f;
8629 if (along != 0x80000000)
8633 along = (unsigned long)f;
8634 if (along != 0x7fffffff)
8638 along = (unsigned long)f;
8639 if (along != 0x80000001)
8643 signal(SIGFPE, blech_in_list);
8644 sprintf(str, "123.");
8645 sscanf(str, "%lf", &f); /* f = 123.; */
8646 along = dummy_long((unsigned long)f);
8647 aint = dummy_int((unsigned int)f);
8648 ashort = dummy_short((unsigned short)f);
8649 if (along != (unsigned long)123)
8651 if (aint != (unsigned int)123)
8653 if (ashort != (unsigned short)123)
8660 if eval $compile_ok; then
8664 echo "(I can't seem to compile the test program--assuming it can't)"
8667 case "$castflags" in
8672 echo "Nope, it can't."
8679 : see if vprintf exists
8681 if set vprintf val -f d_vprintf; eval $csym; $val; then
8682 echo 'vprintf() found.' >&4
8684 $cat >vprintf.c <<'EOF'
8685 #include <varargs.h>
8687 int main() { xxx("foo"); }
8696 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
8700 if eval $compile && ./vprintf; then
8701 echo "Your vsprintf() returns (int)." >&4
8704 echo "Your vsprintf() returns (char*)." >&4
8708 echo 'vprintf() NOT found.' >&4
8718 : see if chown exists
8722 : see if chroot exists
8726 : see if chsize exists
8730 hasstruct='varname=$1; struct=$2; shift; shift;
8731 while $test $# -ge 2; do
8733 $define) echo "#include <$2>";;
8737 echo "int main () { struct $struct foo; }" >> try.c;
8739 if eval $compile; then
8748 : see if sys/types.h has to be included
8749 set sys/types.h i_systypes
8752 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
8753 while $test $# -ge 2; do
8755 $define) echo "#include <$2>";;
8759 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
8761 if eval $compile; then
8772 : see whether socket exists
8774 $echo $n "Hmm... $c" >&4
8775 if set socket val -f d_socket; eval $csym; $val; then
8776 echo "Looks like you have Berkeley networking support." >&4
8778 if set setsockopt val -f; eval $csym; $val; then
8781 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
8785 if $contains socklib libc.list >/dev/null 2>&1; then
8786 echo "Looks like you have Berkeley networking support." >&4
8788 : we will have to assume that it supports the 4.2 BSD interface
8791 echo "You don't have Berkeley networking in libc$_a..." >&4
8792 if test "X$d_socket" = "X$define"; then
8793 echo "...but you seem to believe that you have sockets." >&4
8795 for net in net socket
8797 if test -f /usr/lib/lib$net$_a; then
8798 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
8799 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
8800 if $contains socket libc.list >/dev/null 2>&1; then
8805 echo "...but the Wollongong group seems to have hacked it in." >&4
8806 sockethdr="-I/usr/netinclude"
8809 echo "Found Berkeley sockets interface in lib$net." >& 4
8810 if $contains setsockopt libc.list >/dev/null 2>&1; then
8813 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
8820 if test "X$d_socket" != "X$define"; then
8821 echo "or anywhere else I see." >&4
8829 : see if socketpair exists
8830 set socketpair d_sockpair
8835 echo "Checking the availability of certain socket constants..." >& 4
8836 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
8837 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
8839 #include <sys/types.h>
8840 #include <sys/socket.h>
8846 set try; if eval $compile; then
8849 set d_${enum}; eval $setvar
8853 : see if this is a sys/uio.h system
8854 set sys/uio.h i_sysuio
8859 echo "Checking to see if your system supports struct cmsghdr..." >&4
8860 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
8862 case "$d_cmsghdr_s" in
8863 "$define") echo "Yes, it does." ;;
8864 *) echo "No, it doesn't." ;;
8868 : check for const keyword
8870 echo 'Checking to see if your C compiler knows about "const"...' >&4
8871 $cat >const.c <<'EOCP'
8872 typedef struct spug { int drokk; } spug;
8879 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
8881 echo "Yup, it does."
8884 echo "Nope, it doesn't."
8889 : see if crypt exists
8891 if set crypt val -f d_crypt; eval $csym; $val; then
8892 echo 'crypt() found.' >&4
8896 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
8897 if $test -z "$cryptlib"; then
8898 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
8902 if $test -z "$cryptlib"; then
8903 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
8907 if $test -z "$cryptlib"; then
8908 cryptlib=`./loc libcrypt$_a "" $libpth`
8912 if $test -z "$cryptlib"; then
8913 echo 'crypt() NOT found.' >&4
8922 : get csh whereabouts
8924 'csh') val="$undef" ;;
8929 : Respect a hint or command line value for full_csh.
8931 '') full_csh=$csh ;;
8934 : see if cuserid exists
8935 set cuserid d_cuserid
8938 : see if this is a limits.h system
8939 set limits.h i_limits
8942 : see if this is a float.h system
8946 : See if number of significant digits in a double precision number is known
8948 $cat >dbl_dig.c <<EOM
8958 printf("Contains DBL_DIG");
8961 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
8962 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
8963 echo "DBL_DIG found." >&4
8966 echo "DBL_DIG NOT found." >&4
8973 : see if difftime exists
8974 set difftime d_difftime
8977 : see if this is a dirent system
8979 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
8981 echo "<dirent.h> found." >&4
8984 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
8985 echo "<sys/dir.h> found." >&4
8988 xinc=`./findhdr sys/ndir.h`
8990 echo "<dirent.h> NOT found." >&4
8995 : Look for type of directory structure.
8997 $cppstdin $cppflags $cppminus < "$xinc" > try.c
8999 case "$direntrytype" in
9002 $define) guess1='struct dirent' ;;
9003 *) guess1='struct direct' ;;
9006 *) guess1="$direntrytype"
9011 'struct dirent') guess2='struct direct' ;;
9012 *) guess2='struct dirent' ;;
9015 if $contains "$guess1" try.c >/dev/null 2>&1; then
9016 direntrytype="$guess1"
9017 echo "Your directory entries are $direntrytype." >&4
9018 elif $contains "$guess2" try.c >/dev/null 2>&1; then
9019 direntrytype="$guess2"
9020 echo "Your directory entries seem to be $direntrytype." >&4
9022 echo "I don't recognize your system's directory entries." >&4
9023 rp="What type is used for directory entries on this system?"
9031 : see if the directory entry stores field length
9033 $cppstdin $cppflags $cppminus < "$xinc" > try.c
9034 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
9035 echo "Good, your directory entry keeps length information in d_namlen." >&4
9038 echo "Your directory entry does not know about the d_namlen field." >&4
9045 : see if dlerror exists
9048 set dlerror d_dlerror
9052 : see if dlfcn is available
9060 On a few systems, the dynamically loaded modules that perl generates and uses
9061 will need a different extension than shared libs. The default will probably
9069 rp='What is the extension of dynamically loaded modules'
9078 : Check if dlsym need a leading underscore
9084 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
9085 $cat >dyna.c <<'EOM'
9094 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
9096 #include <sys/types.h>
9110 int mode = RTLD_LAZY ;
9112 handle = dlopen("./dyna.$dlext", mode) ;
9113 if (handle == NULL) {
9118 symbol = dlsym(handle, "fred") ;
9119 if (symbol == NULL) {
9120 /* try putting a leading underscore */
9121 symbol = dlsym(handle, "_fred") ;
9122 if (symbol == NULL) {
9135 : Call the object file tmp-dyna.o in case dlext=o.
9136 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
9137 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
9138 $ld -o dyna.$dlext $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
9139 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then
9142 1) echo "Test program failed using dlopen." >&4
9143 echo "Perhaps you should not use dynamic loading." >&4;;
9144 2) echo "Test program failed using dlsym." >&4
9145 echo "Perhaps you should not use dynamic loading." >&4;;
9146 3) echo "dlsym needs a leading underscore" >&4
9148 4) echo "dlsym doesn't need a leading underscore." >&4;;
9151 echo "I can't compile and run the test program." >&4
9152 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
9157 $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
9162 hasproto='varname=$1; func=$2; shift; shift;
9163 while $test $# -ge 2; do
9165 $define) echo "#include <$2>";;
9169 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
9170 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
9171 echo "$func() prototype found.";
9174 echo "$func() prototype NOT found.";
9179 $rm -f try.c tryout.c'
9181 : see if prototype for drand48 is available
9183 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
9186 : see if dup2 exists
9190 : see if eaccess exists
9191 set eaccess d_eaccess
9194 : see if endgrent exists
9195 set endgrent d_endgrent
9198 : see if endhostent exists
9199 set endhostent d_endhent
9202 : see if endnetent exists
9203 set endnetent d_endnent
9206 : see if endprotoent exists
9207 set endprotoent d_endpent
9210 : see if endpwent exists
9211 set endpwent d_endpwent
9214 : see if endservent exists
9215 set endservent d_endsent
9218 : Locate the flags for 'open()'
9220 $cat >open3.c <<'EOCP'
9221 #include <sys/types.h>
9226 #include <sys/file.h>
9237 : check sys/file.h first to get FREAD on Sun
9238 if $test `./findhdr sys/file.h` && \
9239 set open3 -DI_SYS_FILE && eval $compile; then
9241 echo "<sys/file.h> defines the O_* constants..." >&4
9243 echo "and you have the 3 argument form of open()." >&4
9246 echo "but not the 3 argument form of open(). Oh, well." >&4
9249 elif $test `./findhdr fcntl.h` && \
9250 set open3 -DI_FCNTL && eval $compile; then
9252 echo "<fcntl.h> defines the O_* constants..." >&4
9254 echo "and you have the 3 argument form of open()." >&4
9257 echo "but not the 3 argument form of open(). Oh, well." >&4
9262 echo "I can't find the O_* constant definitions! You got problems." >&4
9268 : see which of string.h or strings.h is needed
9270 strings=`./findhdr string.h`
9271 if $test "$strings" && $test -r "$strings"; then
9272 echo "Using <string.h> instead of <strings.h>." >&4
9276 strings=`./findhdr strings.h`
9277 if $test "$strings" && $test -r "$strings"; then
9278 echo "Using <strings.h> instead of <string.h>." >&4
9280 echo "No string header found -- You'll surely have problems." >&4
9286 "$undef") strings=`./findhdr strings.h`;;
9287 *) strings=`./findhdr string.h`;;
9290 : check for non-blocking I/O stuff
9291 case "$h_sysfile" in
9292 true) echo "#include <sys/file.h>" > head.c;;
9295 true) echo "#include <fcntl.h>" > head.c;;
9296 *) echo "#include <sys/fcntl.h>" > head.c;;
9301 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
9302 case "$o_nonblock" in
9305 $cat >>try.c <<'EOCP'
9309 printf("O_NONBLOCK\n");
9313 printf("O_NDELAY\n");
9317 printf("FNDELAY\n");
9324 if eval $compile_ok; then
9326 case "$o_nonblock" in
9327 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
9328 *) echo "Seems like we can use $o_nonblock.";;
9331 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
9334 *) echo "Using $hint value $o_nonblock.";;
9336 $rm -f try try.* .out core
9339 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
9345 #include <sys/types.h>
9348 #define MY_O_NONBLOCK $o_nonblock
9349 #ifndef errno /* XXX need better Configure test */
9360 #include <strings.h>
9362 $signal_t blech(x) int x; { exit(3); }
9364 $cat >> try.c <<'EOCP'
9372 pipe(pd); /* Down: child -> parent */
9373 pipe(pu); /* Up: parent -> child */
9376 close(pd[1]); /* Parent reads from pd[0] */
9377 close(pu[0]); /* Parent writes (blocking) to pu[1] */
9379 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
9384 signal(SIGALRM, blech);
9386 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
9388 sprintf(string, "%d\n", ret);
9389 write(2, string, strlen(string));
9392 if (errno == EAGAIN) {
9398 if (errno == EWOULDBLOCK)
9399 printf("EWOULDBLOCK\n");
9402 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
9403 sleep(2); /* Give it time to close our pipe */
9405 ret = read(pd[0], buf, 1); /* Should read EOF */
9407 sprintf(string, "%d\n", ret);
9408 write(3, string, strlen(string));
9412 close(pd[0]); /* We write to pd[1] */
9413 close(pu[1]); /* We read from pu[0] */
9414 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
9415 close(pd[1]); /* Pipe pd is now fully closed! */
9416 exit(0); /* Bye bye, thank you for playing! */
9420 if eval $compile_ok; then
9421 echo "$startsh" >mtry
9422 echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
9424 ./mtry >/dev/null 2>&1
9426 0) eagain=`$cat try.out`;;
9427 1) echo "Could not perform non-blocking setting!";;
9428 2) echo "I did a successful read() for something that was not there!";;
9429 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
9430 4) echo "Could not find F_SETFL!";;
9431 *) echo "Something terribly wrong happened during testing.";;
9433 rd_nodata=`$cat try.ret`
9434 echo "A read() system call with no data present returns $rd_nodata."
9435 case "$rd_nodata" in
9438 echo "(That's peculiar, fixing that to be -1.)"
9444 echo "Forcing errno EAGAIN on read() with no data available."
9448 echo "Your read() sets errno to $eagain when no data is available."
9451 status=`$cat try.err`
9453 0) echo "And it correctly returns 0 to signal EOF.";;
9454 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
9455 *) echo "However, your read() returns '$status' on EOF??";;
9458 if test "$status" = "$rd_nodata"; then
9459 echo "WARNING: you can't distinguish between EOF and no data!"
9463 echo "I can't compile the test program--assuming errno EAGAIN will do."
9470 echo "Using $hint value $eagain."
9471 echo "Your read() returns $rd_nodata when no data is present."
9472 case "$d_eofnblk" in
9473 "$define") echo "And you can see EOF because read() returns 0.";;
9474 "$undef") echo "But you can't see EOF status from read() returned value.";;
9476 echo "(Assuming you can't see EOF status from read anyway.)"
9482 $rm -f try try.* .out core head.c mtry
9484 : see if fchmod exists
9488 : see if fchown exists
9492 : see if this is an fcntl system
9497 : See if fcntl-based locking works.
9498 $cat >try.c <<'EOCP'
9503 #if defined(F_SETLK) && defined(F_SETLKW)
9506 fd = open("try.c", O_RDONLY);
9507 flock.l_type = F_RDLCK;
9508 flock.l_whence = SEEK_SET;
9509 flock.l_start = flock.l_len = 0;
9510 retval = fcntl(fd, F_SETLK, &flock);
9512 (retval < 0 ? exit(2) : exit(0));
9518 echo "Checking if fcntl-based file locking works... "
9522 if eval $compile_ok; then
9524 echo "Yes, it seems to work."
9527 echo "Nope, it didn't work."
9531 echo "I'm unable to compile the test program, so I'll assume not."
9536 echo "Nope, since you don't even have fcntl()."
9539 set d_fcntl_can_lock
9544 : see if sys/select.h has to be included
9545 set sys/select.h i_sysselct
9548 : see if we should include time.h, sys/time.h, or both
9550 if test "X$timeincl" = X; then
9551 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9552 $echo $n "I'm now running the test program...$c"
9553 $cat >try.c <<'EOCP'
9554 #include <sys/types.h>
9559 #ifdef SYSTIMEKERNEL
9562 #include <sys/time.h>
9565 #include <sys/select.h>
9574 struct timezone tzp;
9576 if (foo.tm_sec == foo.tm_sec)
9579 if (bar.tv_sec == bar.tv_sec)
9586 for s_timezone in '-DS_TIMEZONE' ''; do
9588 for s_timeval in '-DS_TIMEVAL' ''; do
9589 for i_systimek in '' '-DSYSTIMEKERNEL'; do
9590 for i_time in '' '-DI_TIME'; do
9591 for i_systime in '-DI_SYSTIME' ''; do
9594 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
9595 if eval $compile; then
9596 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
9600 $echo $n "Succeeded with $flags$c"
9612 *SYSTIMEKERNEL*) i_systimek="$define"
9613 timeincl=`./findhdr sys/time.h`
9614 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
9615 *) i_systimek="$undef";;
9618 *I_TIME*) i_time="$define"
9619 timeincl=`./findhdr time.h`" $timeincl"
9620 echo "We'll include <time.h>." >&4;;
9621 *) i_time="$undef";;
9624 *I_SYSTIME*) i_systime="$define"
9625 timeincl=`./findhdr sys/time.h`" $timeincl"
9626 echo "We'll include <sys/time.h>." >&4;;
9627 *) i_systime="$undef";;
9632 : check for fd_set items
9635 Checking to see how well your C compiler handles fd_set and friends ...
9637 $cat >fd_set.c <<EOCP
9638 #$i_systime I_SYS_TIME
9639 #$i_sysselct I_SYS_SELECT
9640 #$d_socket HAS_SOCKET
9641 #include <sys/types.h>
9643 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
9646 #include <sys/time.h>
9649 #include <sys/select.h>
9658 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
9665 set fd_set -DTRYBITS
9666 if eval $compile; then
9667 d_fds_bits="$define"
9669 echo "Well, your system knows about the normal fd_set typedef..." >&4
9671 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
9672 d_fd_macros="$define"
9675 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
9677 d_fd_macros="$undef"
9681 Hmm, your compiler has some difficulty with fd_set. Checking further...
9684 if eval $compile; then
9687 echo "Well, your system has some sort of fd_set available..." >&4
9689 echo "and you have the normal fd_set macros." >&4
9690 d_fd_macros="$define"
9693 but not the normal fd_set macros! Gross! More work for me...
9695 d_fd_macros="$undef"
9698 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
9701 d_fd_macros="$undef"
9706 : see if fgetpos exists
9707 set fgetpos d_fgetpos
9710 : see if flock exists
9714 : see if fork exists
9718 : see if pathconf exists
9719 set pathconf d_pathconf
9722 : see if fpathconf exists
9723 set fpathconf d_fpathconf
9727 : check for fpos64_t
9729 echo "Checking to see if you have fpos64_t..." >&4
9732 int main() { fpos64_t x = 7; }
9735 if eval $compile; then
9737 echo "You have fpos64_t."
9740 echo "You do not have fpos64_t."
9742 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
9749 : see if frexpl exists
9753 : see if this is a sys/param system
9754 set sys/param.h i_sysparam
9757 : see if this is a sys/mount.h system
9758 set sys/mount.h i_sysmount
9763 echo "Checking to see if your system supports struct fs_data..." >&4
9764 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
9766 case "$d_fs_data_s" in
9767 "$define") echo "Yes, it does." ;;
9768 *) echo "No, it doesn't." ;;
9771 : see if fseeko exists
9775 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
9778 : see if fsetpos exists
9779 set fsetpos d_fsetpos
9783 : see if fstatfs exists
9784 set fstatfs d_fstatfs
9788 : see if statvfs exists
9789 set statvfs d_statvfs
9792 : see if fstatvfs exists
9793 set fstatvfs d_fstatvfs
9797 : see if fsync exists
9801 : see if ftello exists
9805 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
9808 : see if getcwd exists
9812 : see if getespwnam exists
9813 set getespwnam d_getespwnam
9817 : see if getfsstat exists
9818 set getfsstat d_getfsstat
9821 : see if getgrent exists
9822 set getgrent d_getgrent
9825 : see if gethostbyaddr exists
9826 set gethostbyaddr d_gethbyaddr
9829 : see if gethostbyname exists
9830 set gethostbyname d_gethbyname
9833 : see if gethostent exists
9834 set gethostent d_gethent
9837 : see how we will look up host name
9840 if set gethostname val -f d_gethname; eval $csym; $val; then
9841 echo 'gethostname() found.' >&4
9842 d_gethname="$define"
9845 if set uname val -f d_uname; eval $csym; $val; then
9848 uname() was found, but you're running xenix, and older versions of xenix
9849 have a broken uname(). If you don't really know whether your xenix is old
9850 enough to have a broken system call, use the default answer.
9857 rp='Is your uname() broken?'
9860 n*) d_uname="$define"; call=uname;;
9863 echo 'uname() found.' >&4
9870 case "$d_gethname" in
9871 '') d_gethname="$undef";;
9874 '') d_uname="$undef";;
9876 case "$d_uname$d_gethname" in
9881 Every now and then someone has a $call() that lies about the hostname
9882 but can't be fixed for political or economic reasons. If you wish, I can
9883 pretend $call() isn't there and maybe compute hostname at run-time
9884 thanks to the '$phostname' command.
9887 rp="Shall I ignore $call() from now on?"
9890 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
9893 case "$phostname" in
9895 *) case "$aphostname" in
9901 file=`./loc $file $file $pth`
9902 aphostname=`echo $file $*`
9907 case "$d_uname$d_gethname" in
9910 case "$phostname" in
9912 echo "There will be no way for $package to get your hostname." >&4;;
9914 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
9918 case "$d_phostname" in
9919 '') d_phostname="$undef";;
9922 : see if this is a netdb.h system
9926 : see if prototypes for various gethostxxx netdb.h functions are available
9928 set d_gethostprotos gethostent $i_netdb netdb.h
9931 : see if getitimer exists
9932 set getitimer d_getitimer
9935 : see if getlogin exists
9936 set getlogin d_getlogin
9939 : see if getmnt exists
9943 : see if getmntent exists
9944 set getmntent d_getmntent
9947 : see if getnetbyaddr exists
9948 set getnetbyaddr d_getnbyaddr
9951 : see if getnetbyname exists
9952 set getnetbyname d_getnbyname
9955 : see if getnetent exists
9956 set getnetent d_getnent
9959 : see if prototypes for various getnetxxx netdb.h functions are available
9961 set d_getnetprotos getnetent $i_netdb netdb.h
9964 : see if getpagesize exists
9965 set getpagesize d_getpagsz
9969 : see if getprotobyname exists
9970 set getprotobyname d_getpbyname
9973 : see if getprotobynumber exists
9974 set getprotobynumber d_getpbynumber
9977 : see if getprotoent exists
9978 set getprotoent d_getpent
9981 : see if getpgid exists
9982 set getpgid d_getpgid
9985 : see if getpgrp2 exists
9986 set getpgrp2 d_getpgrp2
9989 : see if getppid exists
9990 set getppid d_getppid
9993 : see if getpriority exists
9994 set getpriority d_getprior
9997 : see if prototypes for various getprotoxxx netdb.h functions are available
9999 set d_getprotoprotos getprotoent $i_netdb netdb.h
10002 : see if getprpwnam exists
10003 set getprpwnam d_getprpwnam
10006 : see if getpwent exists
10007 set getpwent d_getpwent
10011 : see if getservbyname exists
10012 set getservbyname d_getsbyname
10015 : see if getservbyport exists
10016 set getservbyport d_getsbyport
10019 : see if getservent exists
10020 set getservent d_getsent
10023 : see if prototypes for various getservxxx netdb.h functions are available
10025 set d_getservprotos getservent $i_netdb netdb.h
10028 : see if getspnam exists
10029 set getspnam d_getspnam
10032 : see if gettimeofday or ftime exists
10033 set gettimeofday d_gettimeod
10035 case "$d_gettimeod" in
10041 val="$undef"; set d_ftime; eval $setvar
10044 case "$d_gettimeod$d_ftime" in
10047 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
10051 : see if this is an grp system
10057 xxx=`./findhdr grp.h`
10058 $cppstdin $cppflags $cppminus < $xxx >$$.h
10060 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
10072 set d_grpasswd; eval $setvar
10076 : see if hasmntopt exists
10077 set hasmntopt d_hasmntopt
10080 : see if this is a netinet/in.h or sys/in.h system
10081 set netinet/in.h i_niin sys/in.h i_sysin
10084 : see if arpa/inet.h has to be included
10085 set arpa/inet.h i_arpainet
10088 : see if htonl --and friends-- exists
10093 : Maybe they are macros.
10096 $cat >htonl.c <<EOM
10098 #include <sys/types.h>
10099 #$i_niin I_NETINET_IN
10101 #$i_arpainet I_ARPA_INET
10102 #ifdef I_NETINET_IN
10103 #include <netinet/in.h>
10106 #include <sys/in.h>
10109 #include <arpa/inet.h>
10112 printf("Defined as a macro.");
10115 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
10116 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
10118 echo "But it seems to be defined as a macro." >&4
10126 : see if iconv exists
10132 if set index val -f; eval $csym; $val; then
10133 if set strchr val -f d_strchr; eval $csym; $val; then
10134 if $contains strchr "$strings" >/dev/null 2>&1 ; then
10137 echo "strchr() found." >&4
10141 echo "index() found." >&4
10146 echo "index() found." >&4
10149 if set strchr val -f d_strchr; eval $csym; $val; then
10152 echo "strchr() found." >&4
10154 echo "No index() or strchr() found!" >&4
10159 set d_strchr; eval $setvar
10161 set d_index; eval $setvar
10163 : check whether inet_aton exists
10164 set inet_aton d_inetaton
10169 $cat >isascii.c <<'EOCP'
10181 if eval $compile; then
10182 echo "isascii() found." >&4
10185 echo "isascii() NOT found." >&4
10192 : see if isnan exists
10196 : see if isnanl exists
10197 set isnanl d_isnanl
10200 : see if killpg exists
10201 set killpg d_killpg
10204 : see if lchown exists
10206 $cat > try.c <<'EOCP'
10207 /* System header to define __stub macros and hopefully few prototypes,
10208 which can conflict with char lchown(); below. */
10209 #include <assert.h>
10210 /* Override any gcc2 internal prototype to avoid an error. */
10211 /* We use char because int might match the return type of a gcc2
10212 builtin and then its argument prototype would still apply. */
10215 /* The GNU C library defines this for functions which it implements
10216 to always fail with ENOSYS. Some functions are actually named
10217 something starting with __ and the normal name is an alias. */
10218 #if defined (__stub_lchown) || defined (__stub___lchown)
10226 if eval $compile; then
10227 $echo "lchown() found." >&4
10230 $echo "lchown() NOT found." >&4
10236 : See if number of significant digits in a double precision number is known
10238 $cat >ldbl_dig.c <<EOM
10239 #$i_limits I_LIMITS
10242 #include <limits.h>
10248 printf("Contains LDBL_DIG");
10251 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
10252 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
10253 echo "LDBL_DIG found." >&4
10256 echo "LDBL_DIG NOT found." >&4
10263 : see if link exists
10267 : see if localeconv exists
10268 set localeconv d_locconv
10271 : see if lockf exists
10275 : see if prototype for lseek is available
10277 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
10280 : see if lstat exists
10284 : see if madvise exists
10285 set madvise d_madvise
10288 : see if mblen exists
10292 : see if mbstowcs exists
10293 set mbstowcs d_mbstowcs
10296 : see if mbtowc exists
10297 set mbtowc d_mbtowc
10300 : see if memchr exists
10301 set memchr d_memchr
10304 : see if memcmp exists
10305 set memcmp d_memcmp
10308 : see if memcpy exists
10309 set memcpy d_memcpy
10312 : see if memmove exists
10313 set memmove d_memmove
10316 : see if memset exists
10317 set memset d_memset
10320 : see if mkdir exists
10324 : see if mkdtemp exists
10325 set mkdtemp d_mkdtemp
10328 : see if mkfifo exists
10329 set mkfifo d_mkfifo
10332 : see if mkstemp exists
10333 set mkstemp d_mkstemp
10336 : see if mkstemps exists
10337 set mkstemps d_mkstemps
10340 : see if mktime exists
10341 set mktime d_mktime
10344 : see if this is a sys/mman.h system
10345 set sys/mman.h i_sysmman
10348 : see if mmap exists
10351 : see what shmat returns
10352 : default to something harmless
10354 case "$i_sysmman$d_mmap" in
10356 $cat >mmap.c <<'END'
10357 #include <sys/mman.h>
10360 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
10365 echo "and it returns ($mmaptype)." >&4
10371 : see if modfl exists
10375 : see if mprotect exists
10376 set mprotect d_mprotect
10379 : see if msgctl exists
10380 set msgctl d_msgctl
10383 : see if msgget exists
10384 set msgget d_msgget
10387 : see if msgsnd exists
10388 set msgsnd d_msgsnd
10391 : see if msgrcv exists
10392 set msgrcv d_msgrcv
10395 : see how much of the 'msg*(2)' library is present.
10398 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
10399 *"$undef"*) h_msg=false;;
10403 case "`ipcs 2>&1`" in
10404 "SVID messages"*"not configured"*)
10405 echo "Your $osname does not have the msg*(2) configured." >&4
10408 set msgctl d_msgctl
10410 set msgget d_msgget
10412 set msgsnd d_msgsnd
10414 set msgrcv d_msgrcv
10420 : we could also check for sys/ipc.h ...
10421 if $h_msg && $test `./findhdr sys/msg.h`; then
10422 echo "You have the full msg*(2) library." >&4
10425 echo "You don't have the full msg*(2) library." >&4
10433 echo "Checking to see if your system supports struct msghdr..." >&4
10434 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
10436 case "$d_msghdr_s" in
10437 "$define") echo "Yes, it does." ;;
10438 *) echo "No, it doesn't." ;;
10442 : see if msync exists
10446 : see if munmap exists
10447 set munmap d_munmap
10450 : see if nice exists
10454 : check for length of character
10456 case "$charsize" in
10458 echo "Checking to see how big your characters are (hey, you never know)..." >&4
10459 $cat >try.c <<'EOCP'
10463 printf("%d\n", (int)sizeof(char));
10468 if eval $compile_ok; then
10472 echo "(I can't seem to compile the test program. Guessing...)"
10479 rp="What is the size of a character (in bytes)?"
10484 : check for volatile keyword
10486 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
10487 $cat >try.c <<'EOCP'
10490 typedef struct _goo_struct goo_struct;
10491 goo_struct * volatile goo = ((goo_struct *)0);
10492 struct _goo_struct {
10497 typedef unsigned short foo_t;
10498 char *volatile foo;
10500 volatile foo_t blech;
10504 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
10506 echo "Yup, it does."
10509 echo "Nope, it doesn't."
10517 $echo "Choosing the C types to be used for Perl's internal types..." >&4
10519 case "$use64bitint:$d_quad:$quadtype" in
10522 uvtype="$uquadtype"
10527 uvtype="unsigned long"
10533 case "$uselongdouble:$d_longdbl" in
10535 nvtype="long double"
10536 nvsize=$longdblsize
10543 $echo "(IV will be "$ivtype", $ivsize bytes)"
10544 $echo "(UV will be "$uvtype", $uvsize bytes)"
10545 $echo "(NV will be "$nvtype", $nvsize bytes)"
10548 #$i_inttypes I_INTTYPES
10550 #include <inttypes.h>
10555 int8_t i = INT8_MAX;
10556 uint8_t u = UINT8_MAX;
10557 printf("int8_t\n");
10560 int16_t i = INT16_MAX;
10561 uint16_t i = UINT16_MAX;
10562 printf("int16_t\n");
10565 int32_t i = INT32_MAX;
10566 uint32_t u = UINT32_MAX;
10567 printf("int32_t\n");
10573 '') case "$charsize" in
10575 u8type="unsigned char"
10584 if eval $compile; then
10585 case "`./try$exe_ext`" in
10586 int8_t) i8type=int8_t
10596 '') if $test $charsize -ge 1; then
10598 u8type="unsigned char"
10606 '') case "$shortsize" in
10608 u16type="unsigned short"
10616 '') set try -DINT16
10617 if eval $compile; then
10618 case "`./try$exe_ext`" in
10630 '') if $test $shortsize -ge 2; then
10632 u16type="unsigned short"
10640 '') case "$longsize" in
10642 u32type="unsigned long"
10646 *) case "$intsize" in
10648 u32type="unsigned int"
10658 '') set try -DINT32
10659 if eval $compile; then
10660 case "`./try$exe_ext`" in
10672 '') if $test $intsize -ge 4; then
10674 u32type="unsigned int"
10682 '') case "$d_quad:$quadtype" in
10684 i64type="$quadtype"
10685 u64type="$uquadtype"
10693 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
10694 : volatile so that the compiler has to store it out to memory.
10695 if test X"$d_volatile" = X"$define"; then
10700 #include <sys/types.h>
10701 #include <signal.h>
10703 $volatile int bletched = 0;
10704 $signal_t blech(s) int s; { bletched = 1; }
10709 int n = 8 * $uvsize;
10712 signal(SIGFPE, blech);
10715 for (i = 0; i < n; i++) {
10716 u = u << 1 | ($uvtype)1;
10718 if (($uvtype)d != u)
10722 d = ($nvtype)(u - 1);
10723 if (($uvtype)d != (u - 1))
10731 printf("%d\n", ((i == n) ? -n : i));
10737 d_nv_preserves_uv="$undef"
10738 if eval $compile; then
10739 d_nv_preserves_uv_bits="`./try$exe_ext`"
10741 case "$d_nv_preserves_uv_bits" in
10743 d_nv_preserves_uv_bits=`expr 0 - $d_nv_preserves_uv_bits`
10744 $echo "Your NVs can preserve all $d_nv_preserves_uv_bits bits of your UVs." 2>&1
10745 d_nv_preserves_uv="$define"
10747 [1-9]*) $echo "Your NVs can preserve only $d_nv_preserves_uv_bits bits of your UVs." 2>&1
10748 d_nv_preserves_uv="$undef" ;;
10749 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
10750 d_nv_preserves_uv_bits="$undef" ;;
10756 : check for off64_t
10758 echo "Checking to see if you have off64_t..." >&4
10760 #include <sys/types.h>
10761 #include <unistd.h>
10762 int main() { off64_t x = 7; }
10765 if eval $compile; then
10767 echo "You have off64_t."
10770 echo "You do not have off64_t."
10771 case "$lseeksize" in
10772 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
10779 : see if POSIX threads are available
10780 set pthread.h i_pthread
10786 : how to create joinable pthreads
10787 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
10789 echo "Checking what constant to use for creating joinable pthreads..." >&4
10790 $cat >try.c <<'EOCP'
10791 #include <pthread.h>
10793 int detachstate = JOINABLE;
10796 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
10797 if eval $compile; then
10798 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
10799 val="$undef" # Yes, undef.
10800 set d_old_pthread_create_joinable
10803 set old_pthread_create_joinable
10806 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
10807 if eval $compile; then
10808 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
10810 set d_old_pthread_create_joinable
10812 val=PTHREAD_CREATE_UNDETACHED
10813 set old_pthread_create_joinable
10816 set try -DJOINABLE=__UNDETACHED
10817 if eval $compile; then
10818 echo "You seem to use __UNDETACHED." >&4
10820 set d_old_pthread_create_joinable
10823 set old_pthread_create_joinable
10826 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
10828 set d_old_pthread_create_joinable
10831 set old_pthread_create_joinable
10838 d_old_pthread_create_joinable="$undef"
10839 old_pthread_create_joinable=""
10842 : see if pause exists
10846 : see if pipe exists
10850 : see if poll exists
10855 : see whether the various POSIXish _yields exist
10857 #include <pthread.h>
10863 #ifdef PTHREAD_YIELD
10866 #ifdef PTHREAD_YIELD_NULL
10867 pthread_yield(NULL);
10873 : see if sched_yield exists
10874 set try -DSCHED_YIELD
10875 if eval $compile; then
10877 sched_yield='sched_yield()'
10881 case "$usethreads" in
10884 $define) echo 'sched_yield() found.' >&4 ;;
10885 *) echo 'sched_yield() NOT found.' >&4 ;;
10891 : see if pthread_yield exists
10892 set try -DPTHREAD_YIELD
10893 if eval $compile; then
10895 case "$sched_yield" in
10896 '') sched_yield='pthread_yield()' ;;
10899 set try -DPTHREAD_YIELD_NULL
10900 if eval $compile; then
10902 case "$sched_yield" in
10903 '') sched_yield='pthread_yield(NULL)' ;;
10909 case "$usethreads" in
10912 $define) echo 'pthread_yield() found.' >&4 ;;
10913 *) echo 'pthread_yield() NOT found.' >&4 ;;
10917 set d_pthread_yield
10920 case "$sched_yield" in
10921 '') sched_yield=undef ;;
10926 : see if this is a pwd.h system
10932 xxx=`./findhdr pwd.h`
10933 $cppstdin $cppflags $cppminus < $xxx >$$.h
10935 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
10943 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
10951 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
10959 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
10967 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
10975 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
10983 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
10991 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
11003 set d_pwquota; eval $setvar
11004 set d_pwage; eval $setvar
11005 set d_pwchange; eval $setvar
11006 set d_pwclass; eval $setvar
11007 set d_pwexpire; eval $setvar
11008 set d_pwcomment; eval $setvar
11009 set d_pwgecos; eval $setvar
11010 set d_pwpasswd; eval $setvar
11014 : see if readdir and friends exist
11015 set readdir d_readdir
11017 set seekdir d_seekdir
11019 set telldir d_telldir
11021 set rewinddir d_rewinddir
11024 : see if readlink exists
11025 set readlink d_readlink
11028 : see if readv exists
11032 : see if recvmsg exists
11033 set recvmsg d_recvmsg
11036 : see if rename exists
11037 set rename d_rename
11040 : see if rmdir exists
11044 : see if memory.h is available.
11049 : See if it conflicts with string.h
11055 $cppstdin $cppflags $cppminus < $strings > mem.h
11056 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
11058 echo "We won't be including <memory.h>."
11068 : can bcopy handle overlapping blocks?
11073 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
11075 #$i_memory I_MEMORY
11076 #$i_stdlib I_STDLIB
11077 #$i_string I_STRING
11078 #$i_unistd I_UNISTD
11080 $cat >>try.c <<'EOCP'
11083 # include <memory.h>
11086 # include <stdlib.h>
11089 # include <string.h>
11091 # include <strings.h>
11094 # include <unistd.h> /* Needed for NetBSD */
11098 char buf[128], abc[128];
11104 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
11106 for (align = 7; align >= 0; align--) {
11107 for (len = 36; len; len--) {
11109 bcopy(abc, b, len);
11110 for (off = 1; off <= len; off++) {
11111 bcopy(b, b+off, len);
11112 bcopy(b+off, b, len);
11113 if (bcmp(b, abc, len))
11122 if eval $compile_ok; then
11123 if ./try 2>/dev/null; then
11124 echo "Yes, it can."
11127 echo "It can't, sorry."
11128 case "$d_memmove" in
11129 "$define") echo "But that's Ok since you have memmove()." ;;
11133 echo "(I can't compile the test program, so we'll assume not...)"
11134 case "$d_memmove" in
11135 "$define") echo "But that's Ok since you have memmove()." ;;
11140 $rm -f try.* try core
11144 : can memcpy handle overlapping blocks?
11146 case "$d_memcpy" in
11149 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
11151 #$i_memory I_MEMORY
11152 #$i_stdlib I_STDLIB
11153 #$i_string I_STRING
11154 #$i_unistd I_UNISTD
11156 $cat >>try.c <<'EOCP'
11159 # include <memory.h>
11162 # include <stdlib.h>
11165 # include <string.h>
11167 # include <strings.h>
11170 # include <unistd.h> /* Needed for NetBSD */
11174 char buf[128], abc[128];
11180 /* Copy "abcde..." string to char abc[] so that gcc doesn't
11181 try to store the string in read-only memory. */
11182 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
11184 for (align = 7; align >= 0; align--) {
11185 for (len = 36; len; len--) {
11187 memcpy(b, abc, len);
11188 for (off = 1; off <= len; off++) {
11189 memcpy(b+off, b, len);
11190 memcpy(b, b+off, len);
11191 if (memcmp(b, abc, len))
11200 if eval $compile_ok; then
11201 if ./try 2>/dev/null; then
11202 echo "Yes, it can."
11205 echo "It can't, sorry."
11206 case "$d_memmove" in
11207 "$define") echo "But that's Ok since you have memmove()." ;;
11211 echo "(I can't compile the test program, so we'll assume not...)"
11212 case "$d_memmove" in
11213 "$define") echo "But that's Ok since you have memmove()." ;;
11218 $rm -f try.* try core
11222 : can memcmp be trusted to compare relative magnitude?
11224 case "$d_memcmp" in
11227 echo "Checking if your memcmp() can compare relative magnitude..." >&4
11229 #$i_memory I_MEMORY
11230 #$i_stdlib I_STDLIB
11231 #$i_string I_STRING
11232 #$i_unistd I_UNISTD
11234 $cat >>try.c <<'EOCP'
11237 # include <memory.h>
11240 # include <stdlib.h>
11243 # include <string.h>
11245 # include <strings.h>
11248 # include <unistd.h> /* Needed for NetBSD */
11254 if ((a < b) && memcmp(&a, &b, 1) < 0)
11260 if eval $compile_ok; then
11261 if ./try 2>/dev/null; then
11262 echo "Yes, it can."
11265 echo "No, it can't (it uses signed chars)."
11268 echo "(I can't compile the test program, so we'll assume not...)"
11272 $rm -f try.* try core
11276 : see if prototype for sbrk is available
11278 set d_sbrkproto sbrk $i_unistd unistd.h
11281 : see if select exists
11282 set select d_select
11285 : see if semctl exists
11286 set semctl d_semctl
11289 : see if semget exists
11290 set semget d_semget
11293 : see if semop exists
11297 : see how much of the 'sem*(2)' library is present.
11300 case "$d_semctl$d_semget$d_semop" in
11301 *"$undef"*) h_sem=false;;
11305 case "`ipcs 2>&1`" in
11306 "SVID messages"*"not configured"*)
11307 echo "Your $osname does not have the sem*(2) configured." >&4
11310 set semctl d_semctl
11312 set semget d_semget
11320 : we could also check for sys/ipc.h ...
11321 if $h_sem && $test `./findhdr sys/sem.h`; then
11322 echo "You have the full sem*(2) library." >&4
11325 echo "You don't have the full sem*(2) library." >&4
11331 : see whether sys/sem.h defines union semun
11333 $cat > try.c <<'END'
11334 #include <sys/types.h>
11335 #include <sys/ipc.h>
11336 #include <sys/sem.h>
11337 int main () { union semun semun; semun.buf = 0; }
11340 if eval $compile; then
11341 echo "You have union semun in <sys/sem.h>." >&4
11344 echo "You do not have union semun in <sys/sem.h>." >&4
11347 $rm -f try try.c try.h
11351 : see how to do semctl IPC_STAT
11354 : see whether semctl IPC_STAT can use union semun
11359 # define S_IRUSR S_IREAD
11360 # define S_IWUSR S_IWRITE
11361 # define S_IXUSR S_IEXEC
11363 # define S_IRUSR 0400
11364 # define S_IWUSR 0200
11365 # define S_IXUSR 0100
11367 # define S_IRGRP (S_IRUSR>>3)
11368 # define S_IWGRP (S_IWUSR>>3)
11369 # define S_IXGRP (S_IXUSR>>3)
11370 # define S_IROTH (S_IRUSR>>6)
11371 # define S_IWOTH (S_IWUSR>>6)
11372 # define S_IXOTH (S_IXUSR>>6)
11375 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
11376 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
11377 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
11382 #include <sys/types.h>
11383 #include <sys/ipc.h>
11384 #include <sys/sem.h>
11385 #include <sys/stat.h>
11392 #$d_union_semun HAS_UNION_SEMUN
11395 #ifndef HAS_UNION_SEMUN
11398 struct semid_ds *buf;
11399 unsigned short *array;
11405 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
11406 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
11408 struct semid_ds argbuf;
11411 st = semctl(sem, 0, IPC_STAT, arg);
11415 # endif /* IPC_STAT */
11416 printf("semctl IPC_STAT failed: errno = %d\n", errno);
11418 if (semctl(sem, 0, IPC_RMID, arg) != 0)
11419 # endif /* IPC_RMID */
11420 printf("semctl IPC_RMID failed: errno = %d\n", errno);
11422 #endif /* IPC_PRIVATE && ... */
11423 printf("semget failed: errno = %d\n", errno);
11429 if eval $compile; then
11432 semun) val="$define" ;;
11438 case "$d_semctl_semun" in
11440 echo "You can use union semun for semctl IPC_STAT." >&4
11443 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
11448 : see whether semctl IPC_STAT can use struct semid_ds pointer
11449 $cat > try.c <<'END'
11450 #include <sys/types.h>
11451 #include <sys/ipc.h>
11452 #include <sys/sem.h>
11453 #include <sys/stat.h>
11461 struct semid_ds arg;
11464 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
11465 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
11468 st = semctl(sem, 0, IPC_STAT, &arg);
11470 printf("semid_ds\n");
11472 # endif /* IPC_STAT */
11473 printf("semctl IPC_STAT failed: errno = %d\n", errno);
11475 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
11476 # endif /* IPC_RMID */
11477 printf("semctl IPC_RMID failed: errno = %d\n", errno);
11479 #endif /* IPC_PRIVATE && ... */
11480 printf("semget failed: errno = %d\n", errno);
11487 if eval $compile; then
11490 semid_ds) val="$define" ;;
11494 set d_semctl_semid_ds
11496 case "$d_semctl_semid_ds" in
11498 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
11500 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
11507 # We do not have the full sem*(2) library, so assume we can not
11513 set d_semctl_semid_ds
11518 : see if sendmsg exists
11519 set sendmsg d_sendmsg
11522 : see if setegid exists
11523 set setegid d_setegid
11526 : see if seteuid exists
11527 set seteuid d_seteuid
11530 : see if setgrent exists
11531 set setgrent d_setgrent
11534 : see if sethostent exists
11535 set sethostent d_sethent
11538 : see if setitimer exists
11539 set setitimer d_setitimer
11542 : see if setlinebuf exists
11543 set setlinebuf d_setlinebuf
11546 : see if setlocale exists
11547 set setlocale d_setlocale
11550 : see if setnetent exists
11551 set setnetent d_setnent
11554 : see if setprotoent exists
11555 set setprotoent d_setpent
11558 : see if setpgid exists
11559 set setpgid d_setpgid
11562 : see if setpgrp2 exists
11563 set setpgrp2 d_setpgrp2
11566 : see if setpriority exists
11567 set setpriority d_setprior
11570 : see if setproctitle exists
11571 set setproctitle d_setproctitle
11574 : see if setpwent exists
11575 set setpwent d_setpwent
11578 : see if setregid exists
11579 set setregid d_setregid
11581 set setresgid d_setresgid
11584 : see if setreuid exists
11585 set setreuid d_setreuid
11587 set setresuid d_setresuid
11590 : see if setrgid exists
11591 set setrgid d_setrgid
11594 : see if setruid exists
11595 set setruid d_setruid
11598 : see if setservent exists
11599 set setservent d_setsent
11602 : see if setsid exists
11603 set setsid d_setsid
11606 : see if setvbuf exists
11607 set setvbuf d_setvbuf
11610 : see if sfio.h is available
11615 : see if sfio library is available
11626 : Ok, but do we want to use it.
11630 true|$define|[yY]*) dflt='y';;
11633 echo "$package can use the sfio library, but it is experimental."
11634 case "$useperlio" in
11636 echo "For sfio also the PerlIO abstraction layer is needed."
11637 echo "Earlier you said you wouldn't want that."
11640 rp="You seem to have sfio available, do you want to try using it?"
11643 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
11644 useperlio="$define"
11647 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
11652 *) case "$usesfio" in
11653 true|$define|[yY]*)
11654 echo "Sorry, cannot find sfio on this machine." >&4
11655 echo "Ignoring your setting of usesfio=$usesfio." >&4
11664 $define) usesfio='true';;
11665 *) usesfio='false';;
11669 *) : Remove sfio from list of libraries to use
11670 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
11673 echo "libs = $libs" >&4
11678 : see if shmctl exists
11679 set shmctl d_shmctl
11682 : see if shmget exists
11683 set shmget d_shmget
11686 : see if shmat exists
11689 : see what shmat returns
11692 $cat >shmat.c <<'END'
11693 #include <sys/shm.h>
11696 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
11701 echo "and it returns ($shmattype)." >&4
11702 : see if a prototype for shmat is available
11703 xxx=`./findhdr sys/shm.h`
11704 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
11705 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
11716 set d_shmatprototype
11719 : see if shmdt exists
11723 : see how much of the 'shm*(2)' library is present.
11726 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
11727 *"$undef"*) h_shm=false;;
11731 case "`ipcs 2>&1`" in
11732 "SVID shared memory"*"not configured"*)
11733 echo "Your $osname does not have the shm*(2) configured." >&4
11736 set shmctl d_shmctl
11738 set shmget d_shmget
11748 : we could also check for sys/ipc.h ...
11749 if $h_shm && $test `./findhdr sys/shm.h`; then
11750 echo "You have the full shm*(2) library." >&4
11753 echo "You don't have the full shm*(2) library." >&4
11760 : see if we have sigaction
11761 if set sigaction val -f d_sigaction; eval $csym; $val; then
11762 echo 'sigaction() found.' >&4
11763 $cat > try.c <<'EOP'
11765 #include <sys/types.h>
11766 #include <signal.h>
11769 struct sigaction act, oact;
11771 oact.sa_handler = 0;
11772 /* so that act and oact are used */
11773 exit(act.sa_flags == 0 && oact.sa_handler == 0);
11777 if eval $compile_ok; then
11780 echo "But you don't seem to have a useable struct sigaction." >&4
11784 echo 'sigaction NOT found.' >&4
11787 set d_sigaction; eval $setvar
11788 $rm -f try try$_o try.c
11790 : see if sigprocmask exists
11791 set sigprocmask d_sigprocmask
11794 : see if sigsetjmp exists
11796 case "$d_sigsetjmp" in
11798 $cat >try.c <<'EOP'
11799 #include <setjmp.h>
11804 if (sigsetjmp(env,1))
11807 siglongjmp(env, 1);
11812 if eval $compile; then
11813 if ./try >/dev/null 2>&1; then
11814 echo "POSIX sigsetjmp found." >&4
11818 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
11824 echo "sigsetjmp not found." >&4
11828 *) val="$d_sigsetjmp"
11829 case "$d_sigsetjmp" in
11830 $define) echo "POSIX sigsetjmp found." >&4;;
11831 $undef) echo "sigsetjmp not found." >&4;;
11839 : see if sockatmark exists
11840 set sockatmark d_sockatmark
11843 : see if socks5_init exists
11844 set socks5_init d_socks5_init
11847 : see if sys/stat.h is available
11848 set sys/stat.h i_sysstat
11852 : see if stat knows about block sizes
11854 echo "Checking to see if your struct stat has st_blocks field..." >&4
11855 set d_statblks stat st_blocks $i_sysstat sys/stat.h
11859 : see if this is a sys/vfs.h system
11860 set sys/vfs.h i_sysvfs
11864 : see if this is a sys/statfs.h system
11865 set sys/statfs.h i_sysstatfs
11870 echo "Checking to see if your system supports struct statfs..." >&4
11871 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
11873 case "$d_statfs_s" in
11874 "$define") echo "Yes, it does." ;;
11875 *) echo "No, it doesn't." ;;
11880 : see if struct statfs knows about f_flags
11881 case "$d_statfs_s" in
11884 echo "Checking to see if your struct statfs has f_flags field..." >&4
11885 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
11889 set d_statfs_f_flags
11893 case "$d_statfs_f_flags" in
11894 "$define") echo "Yes, it does." ;;
11895 *) echo "No, it doesn't." ;;
11898 : see if _ptr and _cnt from stdio act std
11901 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
11902 echo "(Looks like you have stdio.h from BSD.)"
11903 case "$stdio_ptr" in
11904 '') stdio_ptr='((fp)->_p)'
11907 *) ptr_lval=$d_stdio_ptr_lval;;
11909 case "$stdio_cnt" in
11910 '') stdio_cnt='((fp)->_r)'
11913 *) cnt_lval=$d_stdio_cnt_lval;;
11915 case "$stdio_base" in
11916 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
11918 case "$stdio_bufsiz" in
11919 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
11921 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
11922 echo "(Looks like you have stdio.h from Linux.)"
11923 case "$stdio_ptr" in
11924 '') stdio_ptr='((fp)->_IO_read_ptr)'
11927 *) ptr_lval=$d_stdio_ptr_lval;;
11929 case "$stdio_cnt" in
11930 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
11933 *) cnt_lval=$d_stdio_cnt_lval;;
11935 case "$stdio_base" in
11936 '') stdio_base='((fp)->_IO_read_base)';;
11938 case "$stdio_bufsiz" in
11939 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
11942 case "$stdio_ptr" in
11943 '') stdio_ptr='((fp)->_ptr)'
11946 *) ptr_lval=$d_stdio_ptr_lval;;
11948 case "$stdio_cnt" in
11949 '') stdio_cnt='((fp)->_cnt)'
11952 *) cnt_lval=$d_stdio_cnt_lval;;
11954 case "$stdio_base" in
11955 '') stdio_base='((fp)->_base)';;
11957 case "$stdio_bufsiz" in
11958 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
11962 : test whether _ptr and _cnt really work
11963 echo "Checking how std your stdio is..." >&4
11966 #define FILE_ptr(fp) $stdio_ptr
11967 #define FILE_cnt(fp) $stdio_cnt
11969 FILE *fp = fopen("try.c", "r");
11972 18 <= FILE_cnt(fp) &&
11973 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
11981 if eval $compile; then
11983 echo "Your stdio acts pretty std."
11986 echo "Your stdio isn't very std."
11989 echo "Your stdio doesn't appear very std."
11995 : Can _ptr be used as an lvalue?
11996 case "$d_stdstdio$ptr_lval" in
11997 $define$define) val=$define ;;
12000 set d_stdio_ptr_lval
12003 : Can _cnt be used as an lvalue?
12004 case "$d_stdstdio$cnt_lval" in
12005 $define$define) val=$define ;;
12008 set d_stdio_cnt_lval
12012 : test whether setting _ptr sets _cnt as a side effect
12013 d_stdio_ptr_lval_sets_cnt="$undef"
12014 d_stdio_ptr_lval_nochange_cnt="$undef"
12015 case "$d_stdio_ptr_lval$d_stdstdio" in
12017 echo "Checking to see what happens if we set the stdio ptr..." >&4
12020 /* Can we scream? */
12021 /* Eat dust sed :-) */
12022 /* In the buffer space, no one can hear you scream. */
12023 #define FILE_ptr(fp) $stdio_ptr
12024 #define FILE_cnt(fp) $stdio_cnt
12025 #include <sys/types.h>
12027 FILE *fp = fopen("try.c", "r");
12032 puts("Fail even to read");
12035 c = getc(fp); /* Read away the first # */
12037 puts("Fail even to read");
12041 18 <= FILE_cnt(fp) &&
12042 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12044 puts("Fail even to read");
12047 ptr = (char*) FILE_ptr(fp);
12048 cnt = (size_t)FILE_cnt(fp);
12050 FILE_ptr(fp) += 42;
12052 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12053 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12056 if (FILE_cnt(fp) <= 20) {
12057 printf ("Fail (<20 chars to test)");
12060 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12061 puts("Fail compare");
12064 if (cnt == FILE_cnt(fp)) {
12065 puts("Pass_unchanged");
12068 if (FILE_cnt(fp) == (cnt - 42)) {
12069 puts("Pass_changed");
12072 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12078 if eval $compile; then
12079 case `./try$exe_ext` in
12081 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12082 d_stdio_ptr_lval_sets_cnt="$define" ;;
12084 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12085 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12087 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12089 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12092 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12098 : see if _base is also standard
12100 case "$d_stdstdio" in
12104 #define FILE_base(fp) $stdio_base
12105 #define FILE_bufsiz(fp) $stdio_bufsiz
12107 FILE *fp = fopen("try.c", "r");
12110 19 <= FILE_bufsiz(fp) &&
12111 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
12118 if eval $compile; then
12120 echo "And its _base field acts std."
12123 echo "But its _base field isn't std."
12126 echo "However, it seems to be lacking the _base field."
12135 Checking how to access stdio streams by file descriptor number...
12137 case "$stdio_stream_array" in
12138 '') $cat >try.c <<EOCP
12141 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
12145 for s in _iob __iob __sF
12147 set try -DSTDIO_STREAM_ARRAY=$s
12148 if eval $compile; then
12149 case "`./try$exe_ext`" in
12150 yes) stdio_stream_array=$s; break ;;
12154 $rm -f try.* try$exe_ext
12156 case "$stdio_stream_array" in
12158 I can't figure out how to access stdio streams by file descriptor number.
12160 d_stdio_stream_array="$undef"
12163 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
12165 d_stdio_stream_array="$define"
12169 : see if strcoll exists
12170 set strcoll d_strcoll
12173 : check for structure copying
12175 echo "Checking to see if your C compiler can copy structs..." >&4
12176 $cat >try.c <<'EOCP'
12186 if $cc -c try.c >/dev/null 2>&1 ; then
12188 echo "Yup, it can."
12191 echo "Nope, it can't."
12197 : see if strerror and/or sys_errlist[] exist
12199 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
12200 if set strerror val -f d_strerror; eval $csym; $val; then
12201 echo 'strerror() found.' >&4
12202 d_strerror="$define"
12203 d_strerrm='strerror(e)'
12204 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
12205 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
12206 d_syserrlst="$define"
12208 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
12209 d_syserrlst="$undef"
12211 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
12212 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
12213 echo 'strerror() found in string header.' >&4
12214 d_strerror="$define"
12215 d_strerrm='strerror(e)'
12216 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
12217 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
12218 d_syserrlst="$define"
12220 echo "(You don't appear to have any sys_errlist[], how can this be?)"
12221 d_syserrlst="$undef"
12223 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
12224 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
12225 d_strerror="$undef"
12226 d_syserrlst="$define"
12227 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
12229 echo 'strerror() and sys_errlist[] NOT found.' >&4
12230 d_strerror="$undef"
12231 d_syserrlst="$undef"
12232 d_strerrm='"unknown"'
12236 : see if strftime exists
12237 set strftime d_strftime
12240 : see if strtod exists
12241 set strtod d_strtod
12244 : see if strtol exists
12245 set strtol d_strtol
12248 : see if strtold exists
12249 set strtold d_strtold
12252 : see if strtoll exists
12253 set strtoll d_strtoll
12256 case "$d_longlong-$d_strtoll" in
12259 Checking whether your strtoll() works okay...
12261 $cat >try.c <<'EOCP'
12264 #define strtoll __strtoll
12267 #define strtoll _strtoll
12270 extern long long int strtoll(char *s, char **, int);
12271 static int bad = 0;
12272 int check(char *s, long long ell, int een) {
12275 gll = strtoll(s, 0, 10);
12276 if (!((gll == ell) && (errno == een)))
12280 check(" 1", 1LL, 0);
12281 check(" 0", 0LL, 0);
12282 check("-1", -1LL, 0);
12283 check("-9223372036854775808", -9223372036854775808LL, 0);
12284 check("-9223372036854775808", -9223372036854775808LL, 0);
12285 check(" 9223372036854775807", 9223372036854775807LL, 0);
12286 check("-9223372036854775808", -9223372036854775808LL, 0);
12287 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
12288 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
12294 if eval $compile; then
12297 ok) echo "Your strtoll() seems to be working okay." ;;
12299 Your strtoll() doesn't seem to be working okay.
12305 echo "(I can't seem to compile the test program--assuming it doesn't)"
12311 : see if strtoq exists
12312 set strtoq d_strtoq
12315 : see if strtoul exists
12316 set strtoul d_strtoul
12319 case "$d_strtoul" in
12322 Checking whether your strtoul() works okay...
12324 $cat >try.c <<'EOCP'
12327 extern unsigned long int strtoul(char *s, char **, int);
12328 static int bad = 0;
12329 void check(char *s, unsigned long eul, int een) {
12332 gul = strtoul(s, 0, 10);
12333 if (!((gul == eul) && (errno == een)))
12337 check(" 1", 1L, 0);
12338 check(" 0", 0L, 0);
12340 case "$longsize" in
12342 $cat >>try.c <<'EOCP'
12343 check("18446744073709551615", 18446744073709551615UL, 0);
12344 check("18446744073709551616", 18446744073709551615UL, ERANGE);
12345 #if 0 /* strtoul() for /^-/ strings is undefined. */
12346 check("-1", 18446744073709551615UL, 0);
12347 check("-18446744073709551614", 2, 0);
12348 check("-18446744073709551615", 1, 0);
12349 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
12350 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
12355 $cat >>try.c <<'EOCP'
12356 check("4294967295", 4294967295UL, 0);
12357 check("4294967296", 4294967295UL, ERANGE);
12358 #if 0 /* strtoul() for /^-/ strings is undefined. */
12359 check("-1", 4294967295UL, 0);
12360 check("-4294967294", 2, 0);
12361 check("-4294967295", 1, 0);
12362 check("-4294967296", 4294967295UL, ERANGE);
12363 check("-4294967297", 4294967295UL, ERANGE);
12368 : Should we write these tests to be more portable by sprintf-ing
12369 : ~0 and then manipulating that char string as input for strtol?
12372 $cat >>try.c <<'EOCP'
12379 if eval $compile; then
12381 ok) echo "Your strtoul() seems to be working okay." ;;
12383 Your strtoul() doesn't seem to be working okay.
12392 : see if strtoull exists
12393 set strtoull d_strtoull
12396 case "$d_longlong-$d_strtoull" in
12399 Checking whether your strtoull() works okay...
12401 $cat >try.c <<'EOCP'
12404 #define strtoull __strtoull
12407 extern unsigned long long int strtoull(char *s, char **, int);
12408 static int bad = 0;
12409 int check(char *s, long long eull, int een) {
12412 gull = strtoull(s, 0, 10);
12413 if (!((gull == eull) && (errno == een)))
12417 check(" 1", 1LL, 0);
12418 check(" 0", 0LL, 0);
12419 check("18446744073709551615", 18446744073709551615ULL, 0);
12420 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
12421 #if 0 /* strtoull() for /^-/ strings is undefined. */
12422 check("-1", 18446744073709551615ULL, 0);
12423 check("-18446744073709551614", 2LL, 0);
12424 check("-18446744073709551615", 1LL, 0);
12425 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
12426 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
12433 if eval $compile; then
12435 ok) echo "Your strtoull() seems to be working okay." ;;
12437 Your strtoull() doesn't seem to be working okay.
12439 d_strtoull="$undef"
12446 : see if strtouq exists
12447 set strtouq d_strtouq
12450 case "$d_strtouq" in
12453 Checking whether your strtouq() works okay...
12455 $cat >try.c <<'EOCP'
12458 extern unsigned long long int strtouq(char *s, char **, int);
12459 static int bad = 0;
12460 void check(char *s, unsigned long long eull, int een) {
12461 unsigned long long gull;
12463 gull = strtouq(s, 0, 10);
12464 if (!((gull == eull) && (errno == een)))
12468 check(" 1", 1LL, 0);
12469 check(" 0", 0LL, 0);
12470 check("18446744073709551615", 18446744073709551615ULL, 0);
12471 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
12472 #if 0 /* strtouq() for /^-/ strings is undefined. */
12473 check("-1", 18446744073709551615ULL, 0);
12474 check("-18446744073709551614", 2LL, 0);
12475 check("-18446744073709551615", 1LL, 0);
12476 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
12477 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
12485 if eval $compile; then
12487 ok) echo "Your strtouq() seems to be working okay." ;;
12489 Your strtouq() doesn't seem to be working okay.
12498 : see if strxfrm exists
12499 set strxfrm d_strxfrm
12502 : see if symlink exists
12503 set symlink d_symlink
12506 : see if syscall exists
12507 set syscall d_syscall
12510 : see if sysconf exists
12511 set sysconf d_sysconf
12514 : see if system exists
12515 set system d_system
12518 : see if tcgetpgrp exists
12519 set tcgetpgrp d_tcgetpgrp
12522 : see if tcsetpgrp exists
12523 set tcsetpgrp d_tcsetpgrp
12526 : see if prototype for telldir is available
12528 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
12531 : see if this is a sys/times.h system
12532 set sys/times.h i_systimes
12535 : see if times exists
12537 if set times val -f d_times; eval $csym; $val; then
12538 echo 'times() found.' >&4
12541 case "$i_systimes" in
12542 "$define") inc='sys/times.h';;
12544 rp="What is the type returned by times() on this system?"
12545 set clock_t clocktype long stdio.h sys/types.h $inc
12548 echo 'times() NOT found, hope that will do.' >&4
12553 : see if truncate exists
12554 set truncate d_truncate
12557 : see if tzname[] exists
12559 if set tzname val -a d_tzname; eval $csym; $val; then
12561 echo 'tzname[] found.' >&4
12564 echo 'tzname[] NOT found.' >&4
12569 case "$crosscompile" in
12570 ''|[nN]*) crosscompile="$undef" ;;
12574 next|rhapsody|darwin) multiarch="$define" ;;
12576 case "$multiarch" in
12577 ''|[nN]*) multiarch="$undef" ;;
12580 : check for ordering of bytes in a long
12582 case "$crosscompile$multiarch" in
12585 You seem to be either cross-compiling or doing a multiarchitecture build,
12586 skipping the byteorder check.
12592 case "$byteorder" in
12595 In the following, larger digits indicate more significance. A big-endian
12596 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
12597 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
12598 machines may have weird orders like 3412. A Cray will report 87654321,
12599 an Alpha will report 12345678. If the test program works the default is
12601 I'm now running the test program...
12603 $cat >try.c <<'EOCP'
12610 char c[sizeof(long)];
12613 if (sizeof(long) > 4)
12614 u.l = (0x08070605L << 32) | 0x04030201L;
12617 for (i = 0; i < sizeof(long); i++)
12618 printf("%c", u.c[i]+'0');
12625 if eval $compile && ./try > /dev/null; then
12628 [1-4][1-4][1-4][1-4]|12345678|87654321)
12629 echo "(The test program ran ok.)"
12630 echo "byteorder=$dflt"
12633 ????|????????) echo "(The test program ran ok.)" ;;
12634 *) echo "(The test program didn't run right for some reason.)" ;;
12639 (I can't seem to compile the test program. Guessing big-endian...)
12642 case "$xxx_prompt" in
12644 rp="What is the order of bytes in a long?"
12660 Checking to see whether you can access character data unalignedly...
12664 #define U32 $u32type
12665 #define BYTEORDER $byteorder
12667 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
12668 U8 buf[] = "\0\0\0\1\0\0\0\0";
12672 if (sizeof(U32) != 4) {
12673 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
12679 for (i = 0; i < 4; i++) {
12680 up = (U32*)(buf + i);
12681 if (! ((*up == 1 << (8*i)) || /* big-endian */
12682 (*up == 1 << (8*(3-i))) /* little-endian */
12686 printf("read failed (%x)\n", *up);
12692 for (i = 0; i < 4; i++) {
12693 up = (U32*)(buf + i);
12695 if (*up != 0xBeef) {
12696 printf("write failed (%x)\n", *up);
12710 if eval $compile_ok; then
12711 echo "(This test may dump core.)" >&4
12712 ./try >&2 >/dev/null
12715 You can access character data pretty unalignedly.
12717 d_u32align="$undef"
12720 It seems that you must access character data in an aligned manner.
12722 d_u32align="$define"
12725 $rm -f core core.try.* try.core
12727 rp='Can you access character data at unaligned addresses?'
12731 [yY]*) d_u32align="$undef" ;;
12732 *) d_u32align="$define" ;;
12736 : see if ualarm exists
12737 set ualarm d_ualarm
12740 : see if umask exists
12744 : see if usleep exists
12745 set usleep d_usleep
12748 : see if ustat exists
12752 : backward compatibility for d_hvfork
12753 if test X$d_hvfork != X; then
12754 d_vfork="$d_hvfork"
12757 : see if there is a vfork
12762 : Ok, but do we want to use it. vfork is reportedly unreliable in
12763 : perl on Solaris 2.x, and probably elsewhere.
12767 case "$usevfork" in
12773 Perl can only use a vfork() that doesn't suffer from strict
12774 restrictions on calling functions or modifying global data in
12775 the child. For example, glibc-2.1 contains such a vfork()
12776 that is unsuitable. If your system provides a proper fork()
12777 call, chances are that you do NOT want perl to use vfork().
12780 rp="Do you still want to use vfork()?"
12785 echo "Ok, we won't use vfork()."
12794 $define) usevfork='true';;
12795 *) usevfork='false';;
12798 : see if this is an sysdir system
12799 set sys/dir.h i_sysdir
12802 : see if this is an sysndir system
12803 set sys/ndir.h i_sysndir
12806 : see if closedir exists
12807 set closedir d_closedir
12810 case "$d_closedir" in
12813 echo "Checking whether closedir() returns a status..." >&4
12814 cat > closedir.c <<EOM
12815 #$i_dirent I_DIRENT /**/
12816 #$i_sysdir I_SYS_DIR /**/
12817 #$i_sysndir I_SYS_NDIR /**/
12818 #$i_systypes I_SYS_TYPES /**/
12820 #if defined(I_SYS_TYPES)
12821 #include <sys/types.h>
12823 #if defined(I_DIRENT)
12824 #include <dirent.h>
12825 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
12826 #include <sys/dir.h>
12830 #include <sys/ndir.h>
12834 #include <ndir.h> /* may be wrong in the future */
12836 #include <sys/dir.h>
12841 int main() { return closedir(opendir(".")); }
12844 if eval $compile_ok; then
12845 if ./closedir > /dev/null 2>&1 ; then
12846 echo "Yes, it does."
12849 echo "No, it doesn't."
12853 echo "(I can't seem to compile the test program--assuming it doesn't)"
12861 set d_void_closedir
12864 : see if there is a wait4
12868 : see if waitpid exists
12869 set waitpid d_waitpid
12872 : see if wcstombs exists
12873 set wcstombs d_wcstombs
12876 : see if wctomb exists
12877 set wctomb d_wctomb
12880 : see if writev exists
12881 set writev d_writev
12884 : preserve RCS keywords in files with variable substitution, grrr
12889 Revision='$Revision'
12891 : check for alignment requirements
12893 case "$crosscompile$multiarch" in
12896 You seem to be either cross-compiling or doing a multiarchitecture build,
12897 skipping the memory alignment check.
12900 case "$alignbytes" in
12901 '') alignbytes=8 ;;
12905 case "$alignbytes" in
12906 '') echo "Checking alignment constraints..." >&4
12907 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
12908 $cat >try.c <<'EOCP'
12909 typedef long double NV;
12912 $cat >try.c <<'EOCP'
12916 $cat >>try.c <<'EOCP'
12924 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
12929 if eval $compile_ok; then
12933 echo "(I can't seem to compile the test program...)"
12936 *) dflt="$alignbytes"
12939 rp="Doubles must be aligned on a how-many-byte boundary?"
12947 : set the base revision
12950 : how do we catenate cpp tokens here?
12952 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
12953 $cat >cpp_stuff.c <<'EOCP'
12954 #define RCAT(a,b)a/**/b
12955 #define ACAT(a,b)a ## b
12959 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
12960 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
12961 echo "Oh! Smells like ANSI's been here." >&4
12962 echo "We can catify or stringify, separately or together!"
12964 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
12965 echo "Ah, yes! The good old days!" >&4
12966 echo "However, in the good old days we don't know how to stringify and"
12967 echo "catify at the same time."
12971 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
12972 to have to edit the values of CAT[2-5] in config.h...
12974 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
12978 : see if this is a db.h system
12984 : Check db version.
12986 echo "Checking Berkeley DB version ..." >&4
12992 #include <sys/types.h>
12997 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
12998 int Major, Minor, Patch ;
12999 unsigned long Version ;
13000 (void)db_version(&Major, &Minor, &Patch) ;
13001 printf("You have Berkeley DB Version 2 or greater\n");
13003 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
13004 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
13005 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
13006 Major, Minor, Patch) ;
13008 /* check that db.h & libdb are compatible */
13009 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
13010 printf("db.h and libdb are incompatible\n") ;
13014 printf("db.h and libdb are compatible\n") ;
13016 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
13017 + DB_VERSION_PATCH ;
13019 /* needs to be >= 2.3.4 */
13020 if (Version < 2003004) {
13021 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
13022 printf("but Perl needs Berkeley DB 2.3.4 or greater\n") ;
13028 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
13029 printf("You have Berkeley DB Version 1\n");
13030 exit(0); /* DB version < 2: the coast is clear. */
13032 exit(1); /* <db.h> not Berkeley DB? */
13038 if eval $compile_ok && ./try; then
13039 echo 'Looks OK.' >&4
13041 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
13045 : Remove db from list of libraries to use
13046 echo "Removing unusable -ldb from library list" >&4
13047 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
13050 echo "libs = $libs" >&4
13060 : Check the return type needed for hash
13062 echo "Checking return type needed for hash for Berkeley DB ..." >&4
13068 #include <sys/types.h>
13071 #ifndef DB_VERSION_MAJOR
13072 u_int32_t hash_cb (ptr, size)
13080 info.hash = hash_cb;
13084 if $cc $ccflags -c try.c >try.out 2>&1 ; then
13085 if $contains warning try.out >>/dev/null 2>&1 ; then
13088 db_hashtype='u_int32_t'
13091 : XXX Maybe we should just give up here.
13092 db_hashtype=u_int32_t
13094 echo "Help: I can't seem to compile the db test program." >&4
13095 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
13098 echo "Your version of Berkeley DB uses $db_hashtype for hash."
13100 *) db_hashtype=u_int32_t
13105 : Check the return type needed for prefix
13107 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
13113 #include <sys/types.h>
13116 #ifndef DB_VERSION_MAJOR
13117 size_t prefix_cb (key1, key2)
13125 info.prefix = prefix_cb;
13129 if $cc $ccflags -c try.c >try.out 2>&1 ; then
13130 if $contains warning try.out >>/dev/null 2>&1 ; then
13131 db_prefixtype='int'
13133 db_prefixtype='size_t'
13136 db_prefixtype='size_t'
13137 : XXX Maybe we should just give up here.
13139 echo "Help: I can't seem to compile the db test program." >&4
13140 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
13143 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
13145 *) db_prefixtype='size_t'
13150 : How can we generate normalized random numbers ?
13152 echo "Looking for a random number function..." >&4
13153 case "$randfunc" in
13155 if set drand48 val -f; eval $csym; $val; then
13157 echo "Good, found drand48()." >&4
13158 elif set random val -f; eval $csym; $val; then
13160 echo "OK, found random()." >&4
13163 echo "Yick, looks like I have to use rand()." >&4
13174 *-Dmy_rand=*|*-Dmy_srand=*)
13175 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
13176 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
13177 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
13178 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
13182 while $test "$cont"; do
13183 rp="Use which function to generate random numbers?"
13185 if $test "$ans" = "$dflt"; then
13191 if set $ans val -f; eval $csym; $val; then
13195 rp="I cannot find function $ans. Use that name anyway?"
13204 case "$randfunc" in
13206 drand01="drand48()"
13212 case "$randbits" in
13214 echo "Checking to see how many bits your $randfunc() function produces..." >&4
13216 #$i_unistd I_UNISTD
13217 #$i_stdlib I_STDLIB
13220 # include <unistd.h>
13223 # include <stdlib.h>
13228 register unsigned long tmp;
13229 register unsigned long max = 0L;
13231 for (i = 1000; i; i--) {
13232 tmp = (unsigned long) $randfunc();
13233 if (tmp > max) max = tmp;
13235 for (i = 0; max; i++)
13241 if eval $compile_ok; then
13245 echo "(I can't seem to compile the test program...)"
13252 rp="How many bits does your $randfunc() function produce?"
13256 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
13257 seedfunc="s$randfunc"
13258 randseedtype=unsigned
13262 rp="How many bits does your $randfunc() function produce?"
13265 seedfunc="s$randfunc"
13266 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
13267 if set $seedfunc val -f; eval $csym; $val; then
13268 echo "(Using $seedfunc() to seed random generator)"
13270 echo "(Warning: no $seedfunc() to seed random generator)"
13273 randseedtype=unsigned
13281 echo "Determining whether or not we are on an EBCDIC system..." >&4
13282 $cat >tebcdic.c <<'EOM'
13285 if ('M'==0xd4) return 0;
13292 if eval $compile_ok; then
13294 echo "You seem to speak EBCDIC." >&4
13297 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF8." >&4
13300 echo "I'm unable to compile the test program." >&4
13301 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
13303 $rm -f tebcdic.c tebcdic
13309 Checking how to flush all pending stdio output...
13311 # I only know how to find the first 32 possibly open files on SunOS.
13312 # See also hints/sunos_4_1.sh and util.c --AD
13314 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
13316 $cat >>try.c <<EOCP
13318 #$i_unistd I_UNISTD
13320 # include <unistd.h>
13322 #$d_sysconf HAS_SYSCONF
13323 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
13324 #ifdef HAS_STDIO_STREAM_ARRAY
13325 # define STDIO_STREAM_ARRAY $stdio_stream_array
13328 FILE* p = fopen("try.out", "w");
13332 # ifdef TRY_FPRINTF
13336 #ifdef TRY_FFLUSH_NULL
13339 #ifdef TRY_FFLUSH_ALL
13341 long open_max = -1;
13342 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
13343 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
13345 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
13346 open_max = sysconf(_SC_OPEN_MAX);
13349 open_max = FOPEN_MAX;
13352 open_max = OPEN_MAX;
13361 # ifdef HAS_STDIO_STREAM_ARRAY
13362 if (open_max > 0) {
13364 for (i = 0; i < open_max; i++)
13365 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
13366 STDIO_STREAM_ARRAY[i]._file < open_max &&
13367 STDIO_STREAM_ARRAY[i]._flag)
13368 fflush(&STDIO_STREAM_ARRAY[i]);
13376 : first we have to find out how _not_ to flush
13377 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
13379 set try -DTRY_FPUTC
13380 if eval $compile; then
13382 ./try$exe_ext 2>/dev/null
13383 if $test ! -s try.out -a "X$?" = X42; then
13389 set try -DTRY_FPRINTF
13391 if eval $compile; then
13393 ./try$exe_ext 2>/dev/null
13394 if $test ! -s try.out -a "X$?" = X42; then
13395 output=-DTRY_FPRINTF
13401 : check for fflush NULL behaviour
13402 case "$fflushNULL" in
13403 '') set try -DTRY_FFLUSH_NULL $output
13404 if eval $compile; then
13406 ./try$exe_ext 2>/dev/null
13408 if $test -s try.out -a "X$code" = X42; then
13409 fflushNULL="`$cat try.out`"
13411 if $test "X$code" != X42; then
13413 (If this test failed, don't worry, we'll try another method shortly.)
13418 $rm -f core try.core core.try.*
13419 case "$fflushNULL" in
13421 Your fflush(NULL) works okay for output streams.
13422 Let's see if it clobbers input pipes...
13424 # As of mid-March 2000 all versions of Solaris appear to have a stdio
13425 # bug that improperly flushes the input end of pipes. So we avoid the
13426 # autoflush on fork/system/exec support for now. :-(
13427 $cat >tryp.c <<EOCP
13430 main(int argc, char **argv)
13436 while ((i = getc(stdin)) != -1
13437 && (*bp++ = i) != '\n'
13438 && bp < &buf[1024])
13441 fprintf(stdout, "%s", buf);
13449 fflushNULL="$define"
13451 if eval $compile; then
13453 $cat tryp.c | ./tryp$exe_ext 2>/dev/null > tryp.out
13454 if cmp tryp.c tryp.out >/dev/null 2>&1; then
13456 fflush(NULL) seems to behave okay with input streams.
13458 fflushNULL="$define"
13461 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
13463 fflushNULL="$undef"
13466 $rm -f core tryp.c tryp.core core.tryp.*
13469 Your fflush(NULL) isn't working (contrary to ANSI C).
13471 fflushNULL="$undef"
13474 Cannot figure out whether your fflush(NULL) works or not.
13475 I'm assuming it doesn't (contrary to ANSI C).
13477 fflushNULL="$undef"
13481 $define|true|[yY]*)
13482 fflushNULL="$define"
13485 fflushNULL="$undef"
13488 : check explicit looping only if NULL did not work, and if the pipe
13489 : bug does not show up on an explicit flush too
13490 case "$fflushNULL" in
13492 $cat >tryp.c <<EOCP
13495 main(int argc, char **argv)
13501 while ((i = getc(stdin)) != -1
13502 && (*bp++ = i) != '\n'
13503 && bp < &buf[1024])
13506 fprintf(stdout, "%s", buf);
13515 if eval $compile; then
13517 $cat tryp.c | ./tryp$exe_ext 2>/dev/null > tryp.out
13518 if cmp tryp.c tryp.out >/dev/null 2>&1; then
13520 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
13522 : now check for fflushall behaviour
13523 case "$fflushall" in
13524 '') set try -DTRY_FFLUSH_ALL $output
13525 if eval $compile; then
13527 (Now testing the other method--but note that this also may fail.)
13530 ./try$exe_ext 2>/dev/null
13531 if $test -s try.out -a "X$?" = X42; then
13532 fflushall="`$cat try.out`"
13535 $rm -f core try.core core.try.*
13536 case "$fflushall" in
13538 Whew. Flushing explicitly all the stdio streams works.
13540 fflushall="$define"
13543 Sigh. Flushing explicitly all the stdio streams doesn't work.
13548 Cannot figure out whether flushing stdio streams explicitly works or not.
13549 I'm assuming it doesn't.
13555 "$define"|true|[yY]*)
13556 fflushall="$define"
13564 All is futile. Even fflush(stdin) clobbers input pipes!
13571 $rm -f core tryp.c tryp.core core.tryp.*
13573 *) fflushall="$undef"
13577 case "$fflushNULL$fflushall" in
13580 OK, I give up. I cannot figure out how to flush pending stdio output.
13581 We won't be flushing handles at all before fork/exec/popen.
13585 $rm -f try.* try$exe_ext
13587 : Store the full pathname to the ar program for use in the C program
13588 : Respect a hint or command line value for full_ar.
13593 : Store the full pathname to the sed program for use in the C program
13596 : see what type gids are declared as in the kernel
13598 echo "Looking for the type for group ids returned by getgid()."
13599 set gid_t gidtype xxx stdio.h sys/types.h
13603 xxx=`./findhdr sys/user.h`
13604 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
13606 unsigned) dflt="$1 $2" ;;
13610 *) dflt="$gidtype";;
13613 gid_t) echo "gid_t found." ;;
13614 *) rp="What is the type for group ids returned by getgid()?"
13622 *_t) zzz="$gidtype" ;;
13625 echo "Checking the size of $zzz..." >&4
13627 #include <sys/types.h>
13630 printf("%d\n", (int)sizeof($gidtype));
13635 if eval $compile_ok; then
13639 echo "(I can't execute the test program--guessing $gidsize.)" >&4
13642 echo "Your $zzz is $gidsize bytes long."
13647 echo "(I can't compile the test program--guessing $gidsize.)" >&4
13653 *_t) zzz="$gidtype" ;;
13656 echo "Checking the sign of $zzz..." >&4
13658 #include <sys/types.h>
13669 if eval $compile; then
13673 echo "(I can't execute the test program--guessing unsigned.)" >&4
13677 1) echo "Your $zzz is unsigned." ;;
13678 -1) echo "Your $zzz is signed." ;;
13684 echo "(I can't compile the test program--guessing unsigned.)" >&4
13690 if $test X"$quadtype" != X; then
13692 echo "Checking how to print 64-bit integers..." >&4
13694 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
13695 $cat >try.c <<'EOCP'
13696 #include <sys/types.h>
13699 int q = 12345678901;
13700 printf("%ld\n", q);
13704 if eval $compile; then
13705 yyy=`./try$exe_ext`
13708 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
13709 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
13710 echo "We will use %d."
13716 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
13717 $cat >try.c <<'EOCP'
13718 #include <sys/types.h>
13721 long q = 12345678901;
13722 printf("%ld\n", q);
13726 if eval $compile; then
13727 yyy=`./try$exe_ext`
13730 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
13731 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
13732 echo "We will use %ld."
13738 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
13739 $cat >try.c <<'EOCP'
13740 #include <sys/types.h>
13741 #include <inttypes.h>
13744 int64_t q = 12345678901;
13745 printf("%" PRId64 "\n", q);
13749 if eval $compile; then
13750 yyy=`./try$exe_ext`
13753 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
13754 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
13755 echo "We will use the C9X style."
13761 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
13762 $cat >try.c <<'EOCP'
13763 #include <sys/types.h>
13766 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
13767 printf("%lld\n", q);
13771 if eval $compile; then
13772 yyy=`./try$exe_ext`
13775 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
13776 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
13777 echo "We will use the %lld style."
13783 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
13785 #include <sys/types.h>
13788 $quadtype q = 12345678901;
13789 printf("%Ld\n", q);
13793 if eval $compile; then
13794 yyy=`./try$exe_ext`
13797 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
13798 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
13799 echo "We will use %Ld."
13805 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
13807 #include <sys/types.h>
13810 $quadtype q = 12345678901;
13811 printf("%qd\n", q);
13815 if eval $compile; then
13816 yyy=`./try$exe_ext`
13819 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
13820 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
13821 echo "We will use %qd."
13827 if $test X"$sPRId64" = X; then
13828 echo "Cannot figure out how to print 64-bit integers." >&4
13836 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
13837 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
13839 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
13840 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
13846 $echo "Checking the format strings to be used for Perl's internal types..." >&4
13848 if $test X"$ivsize" = X8; then
13849 ivdformat="$sPRId64"
13850 uvuformat="$sPRIu64"
13851 uvoformat="$sPRIo64"
13852 uvxformat="$sPRIx64"
13853 uvXUformat="$sPRIXU64"
13855 if $test X"$ivsize" = X"$longsize"; then
13862 if $test X"$ivsize" = X"$intsize"; then
13870 if $test X"$ivsize" = X"$shortsize"; then
13881 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
13882 nveformat="$sPRIeldbl"
13883 nvfformat="$sPRIfldbl"
13884 nvgformat="$sPRIgldbl"
13885 nvEUformat="$sPRIEUldbl"
13886 nvFUformat="$sPRIFUldbl"
13887 nvGUformat="$sPRIGUldbl"
13897 case "$ivdformat" in
13898 '') echo "$0: Fatal: failed to find format strings, cannot continue." >& 4
13905 $echo "Checking the format string to be used for gids..." >&4
13908 -1) if $test X"$gidsize" = X"$ivsize"; then
13909 gidformat="$ivdformat"
13911 if $test X"$gidsize" = X"$longsize"; then
13914 if $test X"$gidsize" = X"$intsize"; then
13917 if $test X"$gidsize" = X"$shortsize"; then
13924 *) if $test X"$gidsize" = X"$uvsize"; then
13925 gidformat="$uvuformat"
13927 if $test X"$gidsize" = X"$longsize"; then
13930 if $test X"$gidsize" = X"$intsize"; then
13933 if $test X"$gidsize" = X"$shortsize"; then
13942 : see if getgroups exists
13943 set getgroups d_getgrps
13946 : see if setgroups exists
13947 set setgroups d_setgrps
13951 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
13953 case "$d_getgrps$d_setgrps" in
13955 case "$groupstype" in
13956 '') dflt="$gidtype" ;;
13957 *) dflt="$groupstype" ;;
13960 What type of pointer is the second argument to getgroups() and setgroups()?
13961 Usually this is the same as group ids, $gidtype, but not always.
13964 rp='What type pointer is the second argument to getgroups() and setgroups()?'
13968 *) groupstype="$gidtype";;
13972 echo "Checking if your $make program sets \$(MAKE)..." >&4
13973 case "$make_set_make" in
13975 $sed 's/^X //' > testmake.mak << 'EOF'
13977 X @echo 'maketemp="$(MAKE)"'
13979 case "`$make -f testmake.mak 2>/dev/null`" in
13980 *maketemp=*) make_set_make='#' ;;
13981 *) make_set_make="MAKE=$make" ;;
13983 $rm -f testmake.mak
13986 case "$make_set_make" in
13987 '#') echo "Yup, it does.";;
13988 *) echo "Nope, it doesn't.";;
13991 : see what type is used for mode_t
13992 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
13993 set mode_t modetype int stdio.h sys/types.h
13996 : see if stdarg is available
13998 if $test `./findhdr stdarg.h`; then
13999 echo "<stdarg.h> found." >&4
14002 echo "<stdarg.h> NOT found." >&4
14006 : see if varags is available
14008 if $test `./findhdr varargs.h`; then
14009 echo "<varargs.h> found." >&4
14011 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
14014 : set up the varargs testing programs
14015 $cat > varargs.c <<EOP
14017 #include <stdarg.h>
14020 #include <varargs.h>
14024 int f(char *p, ...)
14038 p = va_arg(ap, char *);
14043 $cat > varargs <<EOP
14045 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
14054 : now check which varargs header should be included
14059 if `./varargs I_STDARG`; then
14061 elif `./varargs I_VARARGS`; then
14066 if `./varargs I_VARARGS`; then
14073 echo "I could not find the definition for va_dcl... You have problems..." >&4
14074 val="$undef"; set i_stdarg; eval $setvar
14075 val="$undef"; set i_varargs; eval $setvar
14080 case "$i_varhdr" in
14082 val="$define"; set i_stdarg; eval $setvar
14083 val="$undef"; set i_varargs; eval $setvar
14086 val="$undef"; set i_stdarg; eval $setvar
14087 val="$define"; set i_varargs; eval $setvar
14090 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
14094 : see if we need va_copy
14096 case "$i_stdarg" in
14099 #include <stdarg.h>
14101 #$i_stdlib I_STDLIB
14103 #include <stdlib.h>
14105 #include <signal.h>
14108 ivfprintf(FILE *f, const char *fmt, va_list *valp)
14110 return vfprintf(f, fmt, *valp);
14114 myvfprintf(FILE *f, const char *fmt, va_list val)
14116 return ivfprintf(f, fmt, &val);
14120 myprintf(char *fmt, ...)
14123 va_start(val, fmt);
14124 return myvfprintf(stdout, fmt, val);
14128 main(int ac, char **av)
14130 signal(SIGSEGV, exit);
14132 myprintf("%s%cs all right, then\n", "that", '\'');
14137 if eval $compile && ./try 2>&1 >/dev/null; then
14139 "that's all right, then")
14145 yes) echo "It seems that you don't need va_copy()." >&4
14146 need_va_copy="$undef"
14148 *) echo "It seems that va_copy() or similar will be needed." >&4
14149 need_va_copy="$define"
14152 $rm -f try.* core core.* *.core *.core.*
14154 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
14158 : define a fucntion to check prototypes
14159 $cat > protochk <<EOSH
14162 optimize="$optimize"
14164 prototype="$prototype"
14169 $cat >> protochk <<'EOSH'
14174 while test $# -ge 2; do
14176 $define) echo "#include <$2>" >> try.c ;;
14177 literal) echo "$2" >> try.c ;;
14181 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
14182 cat >> try.c <<'EOCP'
14183 #ifdef CAN_PROTOTYPE
14184 #define _(args) args
14189 echo "$foo" >> try.c
14190 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
14191 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
14197 $eunicefix protochk
14199 : see what type is used for size_t
14200 rp="What is the type used for the length parameter for string functions?"
14201 set size_t sizetype 'unsigned int' stdio.h sys/types.h
14204 : check for type of arguments to gethostbyaddr.
14205 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
14206 case "$d_gethbyaddr" in
14210 Checking to see what type of arguments are accepted by gethostbyaddr().
14212 hdrs="$define sys/types.h
14213 $d_socket sys/socket.h
14214 $i_niin netinet/in.h
14216 $i_unistd unistd.h"
14217 : The first arg can 'char *' or 'void *'
14218 : The second arg is some of integral type
14219 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
14220 for yyy in size_t long int; do
14221 case "$netdb_host_type" in
14222 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
14223 if ./protochk "$try" $hdrs; then
14224 echo "Your system accepts $xxx for the first arg."
14225 echo "...and $yyy for the second arg."
14226 netdb_host_type="$xxx"
14227 netdb_hlen_type="$yyy"
14233 : In case none of those worked, prompt the user.
14234 case "$netdb_host_type" in
14235 '') rp='What is the type for the 1st argument to gethostbyaddr?'
14238 netdb_host_type=$ans
14239 rp='What is the type for the 2nd argument to gethostbyaddr?'
14242 netdb_hlen_type=$ans
14246 *) : no gethostbyaddr, so pick harmless defaults
14247 netdb_host_type='char *'
14248 netdb_hlen_type="$sizetype"
14251 # Remove the "const" if needed. -- but then we'll have a
14253 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
14256 : check for type of argument to gethostbyname.
14257 if test "X$netdb_name_type" = X ; then
14258 case "$d_gethbyname" in
14262 Checking to see what type of argument is accepted by gethostbyname().
14264 hdrs="$define sys/types.h
14265 $d_socket sys/socket.h
14266 $i_niin netinet/in.h
14268 $i_unistd unistd.h"
14269 for xxx in "const char *" "char *"; do
14270 case "$netdb_name_type" in
14271 '') try="extern struct hostent *gethostbyname($xxx);"
14272 if ./protochk "$try" $hdrs; then
14273 echo "Your system accepts $xxx."
14274 netdb_name_type="$xxx"
14279 : In case none of those worked, prompt the user.
14280 case "$netdb_name_type" in
14281 '') rp='What is the type for the 1st argument to gethostbyname?'
14284 netdb_name_type=$ans
14288 *) : no gethostbyname, so pick harmless default
14289 netdb_name_type='char *'
14294 : check for type of 1st argument to getnetbyaddr.
14295 if test "X$netdb_net_type" = X ; then
14296 case "$d_getnbyaddr" in
14300 Checking to see what type of 1st argument is accepted by getnetbyaddr().
14302 hdrs="$define sys/types.h
14303 $d_socket sys/socket.h
14304 $i_niin netinet/in.h
14306 $i_unistd unistd.h"
14307 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
14308 case "$netdb_net_type" in
14309 '') try="extern struct netent *getnetbyaddr($xxx, int);"
14310 if ./protochk "$try" $hdrs; then
14311 echo "Your system accepts $xxx."
14312 netdb_net_type="$xxx"
14317 : In case none of those worked, prompt the user.
14318 case "$netdb_net_type" in
14319 '') rp='What is the type for the 1st argument to getnetbyaddr?'
14322 netdb_net_type=$ans
14326 *) : no getnetbyaddr, so pick harmless default
14327 netdb_net_type='long'
14331 : locate the preferred pager for this system
14337 [a-zA-Z]:/*) dflt=$pg;;
14341 [a-zA-Z]:/*) dflt=$more;;
14345 [a-zA-Z]:/*) dflt=$less;;
14348 '') dflt=/usr/ucb/more;;
14355 rp='What pager is used on your system?'
14359 : see what type pids are declared as in the kernel
14360 rp="What is the type of process ids on this system?"
14361 set pid_t pidtype int stdio.h sys/types.h
14364 : Find earliest binary compatible site_perl subdirectory perl can use.
14365 case "$bincompat5005" in
14366 "$define") xs_apiversion='5.005' ;;
14367 *) xs_apiversion=$version ;; # The current site_perl version.
14369 : Find earliest pure perl site_perl subdirectory perl can use.
14370 : The versioned directories started at 5.005.
14371 pm_apiversion='5.005'
14373 : see if ar generates random libraries by itself
14375 echo "Checking how to generate random libraries on your machine..." >&4
14376 echo 'int bar1() { return bar2(); }' > bar1.c
14377 echo 'int bar2() { return 2; }' > bar2.c
14378 $cat > foo.c <<'EOP'
14379 int main() { printf("%d\n", bar1()); exit(0); }
14381 $cc $ccflags -c bar1.c >/dev/null 2>&1
14382 $cc $ccflags -c bar2.c >/dev/null 2>&1
14383 $cc $ccflags -c foo.c >/dev/null 2>&1
14384 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
14385 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
14386 ./foobar >/dev/null 2>&1; then
14387 echo "$ar appears to generate random libraries itself."
14390 elif $ar ts bar$_a >/dev/null 2>&1 &&
14391 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
14392 ./foobar >/dev/null 2>&1; then
14393 echo "a table of contents needs to be added with '$ar ts'."
14400 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
14401 $test -f $ranlib || ranlib=''
14404 if $test -n "$ranlib"; then
14405 echo "your system has '$ranlib'; we'll use that."
14408 echo "your system doesn't seem to support random libraries"
14409 echo "so we'll use lorder and tsort to order the libraries."
14416 : check for type of arguments to select.
14417 case "$selecttype" in
14418 '') case "$d_select" in
14422 Checking to see what type of arguments are accepted by select().
14424 hdrs="$define sys/types.h
14425 $i_systime sys/time.h
14426 $i_sysselct sys/select.h
14427 $d_socket sys/socket.h"
14428 : The first arg can be int, unsigned, or size_t
14429 : The last arg may or may not be 'const'
14431 : void pointer has been seen but using that
14432 : breaks the selectminbits test
14433 for xxx in 'fd_set *' 'int *'; do
14434 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
14435 for tmo in 'struct timeval *' 'const struct timeval *'; do
14437 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
14438 if ./protochk "$try" $hdrs; then
14439 echo "Your system accepts $xxx."
14448 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
14449 case "$d_fd_set" in
14450 $define) dflt="fd_set *" ;;
14459 *) : no select, so pick a harmless default
14466 : check for the select 'width'
14467 case "$selectminbits" in
14468 '') case "$d_select" in
14472 Checking to see on how many bits at a time your select() operates...
14475 #include <sys/types.h>
14477 #$i_systime I_SYS_TIME
14478 #$i_systimek I_SYS_TIME_KERNEL
14483 # ifdef I_SYS_TIME_KERNEL
14486 # include <sys/time.h>
14487 # ifdef I_SYS_TIME_KERNEL
14491 #$i_sysselct I_SYS_SELECT
14492 #ifdef I_SYS_SELECT
14493 #include <sys/select.h>
14495 #$d_socket HAS_SOCKET
14497 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
14501 #define S sizeof(*(b))
14503 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
14504 #define NBITS (NBYTES * 8)
14513 fp = fopen("try.c", "r");
14519 b = ($selecttype)s;
14520 for (i = 0; i < NBITS; i++)
14524 select(fd + 1, b, 0, 0, &t);
14525 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
14526 printf("%d\n", i + 1);
14531 if eval $compile_ok; then
14532 selectminbits=`./try`
14533 case "$selectminbits" in
14535 Cannot figure out on how many bits at a time your select() operates.
14536 I'll play safe and guess it is 32 bits.
14542 *) bits="$selectminbits bits" ;;
14544 echo "Your select() operates on $bits at a time." >&4
14546 rp='What is the minimum number of bits your select() operates on?'
14547 case "$byteorder" in
14548 1234|12345678) dflt=32 ;;
14553 selectminbits="$val"
14557 *) : no select, so pick a harmless default
14564 : Trace out the files included by signal.h, then look for SIGxxx names.
14565 : Remove SIGARRAYSIZE used by HPUX.
14566 : Remove SIGSTKSIZE used by Linux.
14567 : Remove SIGSTKSZ used by Posix.
14568 : Remove SIGTYP void lines used by OS2.
14569 : Some cpps, like os390, dont give the file name anywhere
14570 if [ "X$fieldn" = X ]; then
14571 : Just make some guesses. We check them later.
14572 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
14574 xxx=`echo '#include <signal.h>' |
14575 $cppstdin $cppminus $cppflags 2>/dev/null |
14576 $grep '^[ ]*#.*include' |
14577 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq`
14579 : Check this list of files to be sure we have parsed the cpp output ok.
14580 : This will also avoid potentially non-existent files, such
14583 for xx in $xxx /dev/null ; do
14584 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
14586 : If we have found no files, at least try signal.h
14587 case "$xxxfiles" in
14588 '') xxxfiles=`./findhdr signal.h` ;;
14591 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
14592 print substr($2, 4, 20)
14594 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
14595 print substr($3, 4, 20)
14597 : Append some common names just in case the awk scan failed.
14598 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
14599 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
14600 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
14601 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
14602 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
14604 : generate a few handy files for later
14605 $cat > signal.c <<'EOCP'
14606 #include <sys/types.h>
14607 #include <signal.h>
14611 /* Strange style to avoid deeply-nested #if/#else/#endif */
14614 # define NSIG (_NSIG)
14620 # define NSIG (SIGMAX+1)
14626 # define NSIG (SIG_MAX+1)
14632 # define NSIG (MAXSIG+1)
14638 # define NSIG (MAX_SIG+1)
14643 # ifdef SIGARRAYSIZE
14644 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
14650 # define NSIG (_sys_nsig) /* Solaris 2.5 */
14654 /* Default to some arbitrary number that's big enough to get most
14655 of the common signals.
14661 printf("NSIG %d\n", NSIG);
14667 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
14669 printf "#ifdef SIG"; printf $1; printf "\n"
14670 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
14671 printf $1; printf ");\n"
14675 printf "#endif /* JUST_NSIG */\n";
14676 printf "exit(0);\n}\n";
14679 $cat >signal.awk <<'EOP'
14680 BEGIN { ndups = 0 }
14681 $1 ~ /^NSIG$/ { nsig = $2 }
14682 ($1 !~ /^NSIG$/) && (NF == 2) {
14683 if ($2 > maxsig) { maxsig = $2 }
14684 if (sig_name[$2]) {
14685 dup_name[ndups] = $1
14686 dup_num[ndups] = $2
14698 printf("NSIG %d\n", nsig);
14699 for (n = 1; n < nsig; n++) {
14701 printf("%s %d\n", sig_name[n], sig_num[n])
14704 printf("NUM%d %d\n", n, n)
14707 for (n = 0; n < ndups; n++) {
14708 printf("%s %d\n", dup_name[n], dup_num[n])
14712 $cat >signal_cmd <<EOS
14714 if $test -s signal.lst; then
14715 echo "Using your existing signal.lst file"
14720 $cat >>signal_cmd <<'EOS'
14723 if eval $compile_ok; then
14724 ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
14726 echo "(I can't seem be able to compile the whole test program)" >&4
14727 echo "(I'll try it in little pieces.)" >&4
14728 set signal -DJUST_NSIG
14729 if eval $compile_ok; then
14730 ./signal$_exe > signal.nsg
14733 echo "I can't seem to figure out how many signals you have." >&4
14734 echo "Guessing 50." >&4
14735 echo 'NSIG 50' > signal.nsg
14737 : Now look at all the signal names, one at a time.
14738 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
14739 $cat > signal.c <<EOCP
14740 #include <sys/types.h>
14741 #include <signal.h>
14744 printf("$xx %d\n", SIG${xx});
14749 if eval $compile; then
14750 echo "SIG${xx} found."
14751 ./signal$_exe >> signal.ls1
14753 echo "SIG${xx} NOT found."
14756 if $test -s signal.ls1; then
14757 $cat signal.nsg signal.ls1 |
14758 $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
14762 if $test -s signal.lst; then
14765 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
14766 echo 'kill -l' >signal
14767 set X `csh -f <signal`
14771 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
14773 echo $@ | $tr ' ' $trnl | \
14774 $awk '{ printf "%s %d\n", $1, ++s; }
14775 END { printf "NSIG %d\n", ++s }' >signal.lst
14777 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
14779 chmod a+x signal_cmd
14780 $eunicefix signal_cmd
14782 : generate list of signal names
14784 case "$sig_name_init" in
14786 *) case "$sig_num_init" in
14787 ''|*,*) doinit=yes ;;
14792 echo "Generating a list of signal names and numbers..." >&4
14794 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
14795 sig_name=`$awk 'BEGIN { printf "ZERO " }
14796 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
14797 sig_num=`$awk 'BEGIN { printf "0 " }
14798 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
14799 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
14800 !/^NSIG/ { printf "\"%s\", ", $1 }
14801 END { printf "0\n" }' signal.lst`
14802 sig_num_init=`$awk 'BEGIN { printf "0, " }
14803 !/^NSIG/ { printf "%d, ", $2}
14804 END { printf "0\n"}' signal.lst`
14807 echo "The following $sig_count signals are available:"
14809 echo $sig_name | $awk \
14810 'BEGIN { linelen = 0 }
14812 for (i = 1; i <= NF; i++) {
14813 name = "SIG" $i " "
14814 linelen = linelen + length(name)
14815 if (linelen > 70) {
14817 linelen = length(name)
14823 sig_size=`echo $sig_name | awk '{print NF}'`
14824 $rm -f signal signal.c signal.awk signal.lst signal_cmd
14827 case "$sizetype" in
14828 *_t) zzz="$sizetype" ;;
14829 *) zzz="filesize" ;;
14831 echo "Checking the size of $zzz..." >&4
14833 #include <sys/types.h>
14836 printf("%d\n", (int)sizeof($sizetype));
14841 if eval $compile_ok; then
14845 echo "(I can't execute the test program--guessing $sizesize.)" >&4
14848 echo "Your $zzz size is $sizesize bytes."
14853 echo "(I can't compile the test program--guessing $sizesize.)" >&4
14857 : check for socklen_t
14859 echo "Checking to see if you have socklen_t..." >&4
14861 #include <sys/types.h>
14862 #$d_socket HAS_SOCKET
14864 #include <sys/socket.h>
14866 int main() { socklen_t x = 16; }
14869 if eval $compile; then
14871 echo "You have socklen_t."
14874 echo "You do not have socklen_t."
14875 case "$sizetype" in
14876 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
14883 : see if this is a socks.h system
14884 set socks.h i_socks
14887 : check for type of the size argument to socket calls
14888 case "$d_socket" in
14892 Checking to see what type is the last argument of accept().
14895 case "$d_socklen_t" in
14896 "$define") yyy="$yyy socklen_t"
14898 yyy="$yyy $sizetype int long unsigned"
14899 for xxx in $yyy; do
14900 case "$socksizetype" in
14901 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
14902 case "$usesocks" in
14904 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
14905 echo "Your system accepts '$xxx *' for the last argument of accept()."
14906 socksizetype="$xxx"
14909 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
14910 echo "Your system accepts '$xxx *' for the last argument of accept()."
14911 socksizetype="$xxx"
14918 : In case none of those worked, prompt the user.
14919 case "$socksizetype" in
14920 '') rp='What is the type for socket address structure sizes?'
14927 *) : no sockets, so pick relatively harmless default
14932 : see what type is used for signed size_t
14933 set ssize_t ssizetype int stdio.h sys/types.h
14936 $cat > ssize.c <<EOM
14938 #include <sys/types.h>
14939 #define Size_t $sizetype
14940 #define SSize_t $dflt
14943 if (sizeof(Size_t) == sizeof(SSize_t))
14945 else if (sizeof(Size_t) == sizeof(int))
14954 if eval $compile_ok && ./ssize > /dev/null; then
14955 ssizetype=`./ssize`
14956 echo "I'll be using $ssizetype for functions returning a byte count." >&4
14959 Help! I can't compile and run the ssize_t test program: please enlighten me!
14960 (This is probably a misconfiguration in your system or libraries, and
14961 you really ought to fix it. Still, I'll try anyway.)
14963 I need a type that is the same size as $sizetype, but is guaranteed to
14964 be signed. Common values are ssize_t, int and long.
14967 rp="What signed type is the same size as $sizetype?"
14971 $rm -f ssize ssize.*
14973 : see what type of char stdio uses.
14975 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
14976 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
14977 echo "Your stdio uses unsigned chars." >&4
14978 stdchar="unsigned char"
14980 echo "Your stdio uses signed chars." >&4
14987 : see if time exists
14989 if test "X$d_time" = X -o X"$timetype" = X; then
14990 if set time val -f d_time; eval $csym; $val; then
14991 echo 'time() found.' >&4
14993 rp="What is the type returned by time() on this system?"
14994 set time_t timetype long stdio.h sys/types.h
14997 echo 'time() not found, hope that will do.' >&4
15005 : see what type uids are declared as in the kernel
15007 echo "Looking for the type for user ids returned by getuid()."
15008 set uid_t uidtype xxx stdio.h sys/types.h
15012 xxx=`./findhdr sys/user.h`
15013 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
15015 unsigned) dflt="$1 $2" ;;
15019 *) dflt="$uidtype";;
15022 uid_t) echo "uid_t found." ;;
15023 *) rp="What is the type for user ids returned by getuid()?"
15031 *_t) zzz="$uidtype" ;;
15034 echo "Checking the size of $zzz..." >&4
15036 #include <sys/types.h>
15039 printf("%d\n", (int)sizeof($uidtype));
15044 if eval $compile_ok; then
15048 echo "(I can't execute the test program--guessing $uidsize.)" >&4
15051 echo "Your $zzz is $uidsize bytes long."
15056 echo "(I can't compile the test program--guessing $uidsize.)" >&4
15061 *_t) zzz="$uidtype" ;;
15064 echo "Checking the sign of $zzz..." >&4
15066 #include <sys/types.h>
15077 if eval $compile; then
15081 echo "(I can't execute the test program--guessing unsigned.)" >&4
15085 1) echo "Your $zzz is unsigned." ;;
15086 -1) echo "Your $zzz is signed." ;;
15092 echo "(I can't compile the test program--guessing unsigned.)" >&4
15098 $echo "Checking the format string to be used for uids..." >&4
15101 -1) if $test X"$uidsize" = X"$ivsize"; then
15102 uidformat="$ivdformat"
15104 if $test X"$uidsize" = X"$longsize"; then
15107 if $test X"$uidsize" = X"$intsize"; then
15110 if $test X"$uidsize" = X"$shortsize"; then
15117 *) if $test X"$uidsize" = X"$uvsize"; then
15118 uidformat="$uvuformat"
15120 if $test X"$uidsize" = X"$longsize"; then
15123 if $test X"$uidsize" = X"$intsize"; then
15126 if $test X"$uidsize" = X"$shortsize"; then
15135 : determine compiler compiler
15144 if $test -f "$byacc"; then
15146 comp="byacc or $comp"
15148 if $test -f "$bison"; then
15149 comp="$comp or bison -y"
15151 rp="Which compiler compiler ($comp) shall I use?"
15160 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
15166 : see if dbm.h is available
15167 : see if dbmclose exists
15168 set dbmclose d_dbmclose
15171 case "$d_dbmclose" in
15181 *) set rpcsvc/dbm.h i_rpcsvcdbm
15186 *) echo "We won't be including <dbm.h>"
15196 : see if this is a sys/file.h system
15201 : do we need to include sys/file.h ?
15205 if $h_sysfile; then
15207 echo "We'll be including <sys/file.h>." >&4
15210 echo "We won't be including <sys/file.h>." >&4
15220 : see if fcntl.h is there
15225 : see if we can include fcntl.h
15231 echo "We'll be including <fcntl.h>." >&4
15234 if $h_sysfile; then
15235 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
15237 echo "We won't be including <fcntl.h>." >&4
15249 : see if this is a iconv.h system
15250 set iconv.h i_iconv
15253 : see if this is a ieeefp.h system
15254 set ieeefp.h i_ieeefp
15257 : see if this is a libutil.h system
15258 set libutil.h i_libutil
15261 : see if locale.h is available
15262 set locale.h i_locale
15265 : see if mach cthreads are available
15266 if test "X$usethreads" = "X$define"; then
15267 set mach/cthreads.h i_machcthr
15270 i_machcthr="$undef"
15275 : see if this is a math.h system
15279 : see if this is a mntent.h system
15280 set mntent.h i_mntent
15283 : see if ndbm.h is available
15288 : see if dbm_open exists
15289 set dbm_open d_dbm_open
15291 case "$d_dbm_open" in
15294 echo "We won't be including <ndbm.h>"
15303 : see if net/errno.h is available
15305 set net/errno.h val
15308 : Unfortunately, it causes problems on some systems. Arrgh.
15311 cat > try.c <<'EOM'
15314 #include <net/errno.h>
15320 if $cc $ccflags -c try.c >/dev/null 2>&1; then
15321 echo "We'll be including <net/errno.h>." >&4
15323 echo "We won't be including <net/errno.h>." >&4
15332 : see if netinet/tcp.h is available
15333 set netinet/tcp.h i_netinettcp
15336 : see if this is a poll.h system
15340 : see if this is a prot.h system
15345 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
15346 $cat <<'EOSH' > Cppsym.know
15347 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
15348 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
15349 alliant alpha am29000 AM29000 AMD64 amiga AMIGAOS AMIX
15350 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
15351 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
15352 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
15353 bull c cadmus clipper CMU COFF COMPILER_VERSION
15354 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
15355 CYGWIN DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
15356 Dynix DynixPTX ELF encore EPI EXTENSIONS FILE_OFFSET_BITS
15357 FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
15358 GNU_SOURCE GNUC GNUC_MINOR GO32 gould GOULD_PN
15359 H3050R H3050RX hbullx20 hcx host_mips
15360 hp200 hp300 hp700 HP700 hp800 hp9000
15361 hp9000s200 hp9000s300 hp9000s400 hp9000s500
15362 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
15363 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
15364 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
15365 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
15366 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
15367 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
15368 Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
15369 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
15370 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
15371 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
15372 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
15373 MATH_HAS_NO_SIDE_EFFECTS
15374 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
15375 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
15376 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
15377 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
15378 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
15379 NetBSD news1500 news1700 news1800 news1900 news3700
15380 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
15381 ns32016 ns32332 ns32k nsc32000
15382 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
15383 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
15384 pc532 pdp11 PGC PIC plexus PORTAR posix
15385 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
15386 POSIX_C_SOURCE POSIX_SOURCE POWER
15387 PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
15388 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
15389 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
15390 sony sony_news sonyrisc sparc sparclite spectrum
15391 stardent stdc STDC_EXT stratos sun sun3 sun386
15392 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
15393 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
15394 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
15395 sysV68 sysV88 Tek4132 Tek4300 titan
15396 TM3200 TM5400 TM5600
15397 tower tower32 tower32_200 tower32_600 tower32_700
15398 tower32_800 tower32_850 tss
15399 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
15400 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
15401 unix UNIX95 UNIX99 unixpc unos USGr4 USGr4_2
15402 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms xenix Xenix286
15403 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
15404 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
15407 # Maybe put other stuff here too.
15408 cat <<EOSH >>Cppsym.know
15411 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
15412 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
15413 $cat Cppsym.know > Cppsym.c
15414 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
15415 $rm -f Cppsym.a Cppsym.b Cppsym.c
15416 cat <<EOSH > Cppsym
15418 if $test \$# -gt 0; then
15419 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
15420 if $test -s Cppsym.got; then
15427 $tr " " "$trnl" | ./Cppsym.try
15433 cat <<EOSH > Cppsym.try
15435 cat <<'EOCP' > try.c
15441 cat <<'EOSH' >> Cppsym.try
15443 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
15444 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
15445 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
15446 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
15450 cat <<EOSH >> Cppsym.try
15452 case "$osname-$gccversion" in
15453 irix-) ccflags="\$ccflags -woff 1178" ;;
15454 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
15456 $cc -o try $optimize \$ccflags $ldflags try.c $libs && ./try$exe_ext
15458 chmod +x Cppsym.try
15459 $eunicefix Cppsym.try
15460 ./Cppsym < Cppsym.know > Cppsym.true
15461 : now check the C compiler for additional symbols
15462 postprocess_cc_v=''
15464 aix) postprocess_cc_v="|$tr , ' '" ;;
15471 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
15474 -D*) echo "\$i" | $sed 's/^-D//';;
15475 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
15480 postprocess_cc_v=''
15483 ./ccsym > ccsym1.raw
15484 if $test -s ccsym1.raw; then
15485 $sort ccsym1.raw | $uniq >ccsym.raw
15487 mv ccsym1.raw ccsym.raw
15490 $awk '/\=/ { print $0; next }
15491 { print $0"=1" }' ccsym.raw >ccsym.list
15492 $awk '/\=/ { print $0; next }
15493 { print $0"=1" }' Cppsym.true >ccsym.true
15494 $comm -13 ccsym.true ccsym.list >ccsym.own
15495 $comm -12 ccsym.true ccsym.list >ccsym.com
15496 $comm -23 ccsym.true ccsym.list >ccsym.cpp
15498 if $test -z ccsym.raw; then
15499 echo "Your C compiler doesn't seem to define any symbols!" >&4
15501 echo "However, your C preprocessor defines the following symbols:"
15504 cppsymbols=`$cat Cppsym.true`
15505 cppsymbols=`echo $cppsymbols`
15506 cppccsymbols="$cppsymbols"
15508 if $test -s ccsym.com; then
15509 echo "Your C compiler and pre-processor define these symbols:"
15510 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
15513 cppccsymbols=`$cat ccsym.com`
15514 cppccsymbols=`echo $cppccsymbols`
15515 $test "$silent" || sleep 1
15517 if $test -s ccsym.cpp; then
15518 $test "$also" && echo " "
15519 echo "Your C pre-processor ${also}defines the following symbols:"
15520 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
15522 cppsymbols=`$cat ccsym.cpp`
15523 cppsymbols=`echo $cppsymbols`
15524 $test "$silent" || sleep 1
15526 if $test -s ccsym.own; then
15527 $test "$also" && echo " "
15528 echo "Your C compiler ${also}defines the following cpp symbols:"
15529 $sed -e 's/\(..*\)=1/\1/' ccsym.own
15530 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
15531 ccsymbols=`$cat ccsym.own`
15532 ccsymbols=`echo $ccsymbols`
15533 $test "$silent" || sleep 1
15536 $rm -f ccsym* Cppsym.*
15538 : see if this is a termio system
15542 if $test `./findhdr termios.h`; then
15543 set tcsetattr i_termios
15549 "$define") echo "You have POSIX termios.h... good!" >&4;;
15550 *) if ./Cppsym pyr; then
15551 case "`/bin/universe`" in
15552 ucb) if $test `./findhdr sgtty.h`; then
15554 echo "<sgtty.h> found." >&4
15556 echo "System is pyramid with BSD universe."
15557 echo "<sgtty.h> not found--you could have problems." >&4
15559 *) if $test `./findhdr termio.h`; then
15561 echo "<termio.h> found." >&4
15563 echo "System is pyramid with USG universe."
15564 echo "<termio.h> not found--you could have problems." >&4
15568 if $test `./findhdr termio.h`; then
15569 echo "<termio.h> found." >&4
15571 elif $test `./findhdr sgtty.h`; then
15572 echo "<sgtty.h> found." >&4
15575 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
15578 if $test `./findhdr sgtty.h`; then
15579 echo "<sgtty.h> found." >&4
15581 elif $test `./findhdr termio.h`; then
15582 echo "<termio.h> found." >&4
15585 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
15589 set i_termio; eval $setvar
15590 val=$val2; set i_sgtty; eval $setvar
15591 val=$val3; set i_termios; eval $setvar
15593 : see if this is a shadow.h system
15594 set shadow.h i_shadow
15597 : see if stddef is available
15598 set stddef.h i_stddef
15601 : see if this is a sunmath.h system
15602 set sunmath.h i_sunmath
15605 : see if sys/access.h is available
15606 set sys/access.h i_sysaccess
15609 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
15610 set sys/filio.h i_sysfilio
15613 if $test `./findhdr sys/ioctl.h`; then
15615 echo '<sys/ioctl.h> found.' >&4
15618 if $test $i_sysfilio = "$define"; then
15619 echo '<sys/ioctl.h> NOT found.' >&4
15621 $test $i_sgtty = "$define" && xxx="sgtty.h"
15622 $test $i_termio = "$define" && xxx="termio.h"
15623 $test $i_termios = "$define" && xxx="termios.h"
15624 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
15630 : see if socket ioctl defs are in sys/sockio.h
15632 xxx=`./findhdr sys/sockio.h`
15633 if $test "$xxx"; then
15634 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
15636 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
15639 echo "No socket ioctls found in <sys/sockio.h>." >&4
15644 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
15651 : see if this is a syslog.h system
15652 set syslog.h i_syslog
15656 : see if this is a sys/mode.h system
15657 set sys/mode.h i_sysmode
15660 : see if sys/resource.h has to be included
15661 set sys/resource.h i_sysresrc
15664 : see if sys/security.h is available
15665 set sys/security.h i_syssecrt
15668 : see if this is a sys/statvfs.h system
15669 set sys/statvfs.h i_sysstatvfs
15672 : see if this is a sys/un.h system
15673 set sys/un.h i_sysun
15677 : see if this is a sys/utsname.h system
15678 set sys/utsname.h i_sysutsname
15681 : see if this is a syswait system
15682 set sys/wait.h i_syswait
15685 : see if this is a ustat.h system
15686 set ustat.h i_ustat
15689 : see if this is an utime system
15690 set utime.h i_utime
15693 : see if this is a values.h system
15694 set values.h i_values
15697 : see if this is a vfork system
15700 set vfork.h i_vfork
15708 : see if gdbm.h is available
15713 : see if gdbm_open exists
15714 set gdbm_open d_gdbm_open
15716 case "$d_gdbm_open" in
15719 echo "We won't be including <gdbm.h>"
15729 echo "Looking for extensions..." >&4
15730 : If we are using the old config.sh, known_extensions may contain
15731 : old or inaccurate or duplicate values.
15732 known_extensions=''
15733 nonxs_extensions=''
15734 : We do not use find because it might not be available.
15735 : We do not just use MANIFEST because the user may have dropped
15736 : some additional extensions into the source tree and expect them
15739 : Function to recursively find available extensions, ignoring DynaLoader
15740 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
15744 DynaLoader|dynaload) ;;
15746 if $test -f $xxx/$xxx.xs; then
15747 known_extensions="$known_extensions $1$xxx";
15748 elif $test -f $xxx/Makefile.PL; then
15749 nonxs_extensions="$nonxs_extensions $1$xxx";
15751 if $test -d $xxx -a $# -lt 10; then
15754 eval $find_extensions;
15766 eval $find_extensions
15767 set X $nonxs_extensions
15769 nonxs_extensions="$*"
15770 set X $known_extensions
15772 known_extensions="$*"
15775 : Now see which are supported on this system.
15777 for xxx in $known_extensions ; do
15781 $define) avail_ext="$avail_ext $xxx" ;;
15784 GDBM_File|gdbm_fil)
15786 $define) avail_ext="$avail_ext $xxx" ;;
15789 NDBM_File|ndbm_fil)
15792 case "$osname-$use64bitint" in
15795 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
15798 *) avail_ext="$avail_ext $xxx" ;;
15803 ODBM_File|odbm_fil)
15804 case "${i_dbm}${i_rpcsvcdbm}" in
15806 case "$osname-$use64bitint" in
15809 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
15812 *) avail_ext="$avail_ext $xxx" ;;
15818 case "$useposix" in
15819 true|define|y) avail_ext="$avail_ext $xxx" ;;
15823 case "$useopcode" in
15824 true|define|y) avail_ext="$avail_ext $xxx" ;;
15828 case "$d_socket" in
15829 true|$define|y) avail_ext="$avail_ext $xxx" ;;
15832 Sys/Syslog|sys/syslog)
15833 : XXX syslog requires socket
15834 case "$d_socket" in
15835 true|$define|y) avail_ext="$avail_ext $xxx" ;;
15839 case "$usethreads" in
15840 true|$define|y) avail_ext="$avail_ext $xxx" ;;
15844 : XXX Do we need a useipcsysv variable here
15845 case "${d_msg}${d_sem}${d_shm}" in
15846 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
15849 *) avail_ext="$avail_ext $xxx"
15858 : Now see which nonxs extensions are supported on this system.
15859 : For now assume all are.
15861 for xxx in $nonxs_extensions ; do
15863 *) nonxs_ext="$nonxs_ext $xxx"
15875 A number of extensions are supplied with $package. You may choose to
15876 compile these extensions for dynamic loading (the default), compile
15877 them into the $package executable (static loading), or not include
15878 them at all. Answer "none" to include no extensions.
15879 Note that DynaLoader is always built and need not be mentioned here.
15882 case "$dynamic_ext" in
15883 '') dflt="$avail_ext" ;;
15884 *) dflt="$dynamic_ext"
15885 # Perhaps we are reusing an old out-of-date config.sh.
15888 if test X"$dynamic_ext" != X"$avail_ext"; then
15890 NOTICE: Your previous config.sh list may be incorrect.
15891 The extensions now available to you are
15893 but the default list from your previous config.sh is
15905 rp="What extensions do you wish to load dynamically?"
15908 none) dynamic_ext=' ' ;;
15909 *) dynamic_ext="$ans" ;;
15912 case "$static_ext" in
15914 : Exclude those already listed in dynamic linking
15916 for xxx in $avail_ext; do
15917 case " $dynamic_ext " in
15919 *) dflt="$dflt $xxx" ;;
15926 *) dflt="$static_ext"
15933 rp="What extensions do you wish to load statically?"
15936 none) static_ext=' ' ;;
15937 *) static_ext="$ans" ;;
15942 A number of extensions are supplied with $package. Answer "none"
15943 to include no extensions.
15944 Note that DynaLoader is always built and need not be mentioned here.
15947 case "$static_ext" in
15948 '') dflt="$avail_ext" ;;
15949 *) dflt="$static_ext"
15950 # Perhaps we are reusing an old out-of-date config.sh.
15953 if test X"$static_ext" != X"$avail_ext"; then
15955 NOTICE: Your previous config.sh list may be incorrect.
15956 The extensions now available to you are
15958 but the default list from your previous config.sh is
15967 : Exclude those that are not xs extensions
15971 rp="What extensions do you wish to include?"
15974 none) static_ext=' ' ;;
15975 *) static_ext="$ans" ;;
15980 set X $dynamic_ext $static_ext $nonxs_ext
15984 : Remove libraries needed only for extensions
15985 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
15986 : The exception is SunOS 4.x, which needs them.
15987 case "${osname}X${osvers}" in
15991 *) case "$usedl" in
15992 $define|true|[yY]*)
15993 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
15997 *) perllibs="$libs"
16003 : Remove build directory name from cppstdin so it can be used from
16004 : either the present location or the final installed location.
16006 : Get out of the UU directory to get correct path name.
16008 case "$cppstdin" in
16010 echo "Stripping down cppstdin path name"
16016 : end of configuration questions
16018 echo "End of configuration questions."
16021 : back to where it started
16022 if test -d ../UU; then
16026 : configuration may be patched via a 'config.over' file
16027 if $test -f config.over; then
16030 rp='I see a config.over file. Do you wish to load it?'
16033 n*) echo "OK, I'll ignore it.";;
16035 echo "Configuration override changes have been loaded."
16040 : in case they want portability, strip down executable paths
16041 case "$d_portable" in
16044 echo "Stripping down executable paths..." >&4
16045 for file in $loclist $trylist; do
16047 eval $file=`basename $temp`
16052 : create config.sh file
16054 echo "Creating config.sh..." >&4
16055 $spitshell <<EOT >config.sh
16058 # This file was produced by running the Configure script. It holds all the
16059 # definitions figured out by Configure. Should you modify one of these values,
16060 # do not forget to propagate your changes by running "Configure -der". You may
16061 # instead choose to run each of the .SH files by yourself, or "Configure -S".
16064 # Package name : $package
16065 # Source directory : $src
16066 # Configuration time: $cf_time
16067 # Configured by : $cf_by
16068 # Target system : $myuname
16078 Revision='$Revision'
16085 alignbytes='$alignbytes'
16086 ansi2knr='$ansi2knr'
16087 aphostname='$aphostname'
16088 api_revision='$api_revision'
16089 api_subversion='$api_subversion'
16090 api_version='$api_version'
16091 api_versionstring='$api_versionstring'
16094 archlibexp='$archlibexp'
16095 archname64='$archname64'
16096 archname='$archname'
16097 archobjs='$archobjs'
16102 bincompat5005='$bincompat5005'
16106 byteorder='$byteorder'
16108 castflags='$castflags'
16111 cccdlflags='$cccdlflags'
16112 ccdlflags='$ccdlflags'
16114 ccflags_uselargefiles='$ccflags_uselargefiles'
16116 ccsymbols='$ccsymbols'
16117 ccversion='$ccversion'
16119 cf_email='$cf_email'
16121 charsize='$charsize'
16125 clocktype='$clocktype'
16127 compress='$compress'
16128 contains='$contains'
16132 cpp_stuff='$cpp_stuff'
16133 cppccsymbols='$cppccsymbols'
16134 cppflags='$cppflags'
16136 cppminus='$cppminus'
16138 cppstdin='$cppstdin'
16139 cppsymbols='$cppsymbols'
16140 crosscompile='$crosscompile'
16141 cryptlib='$cryptlib'
16143 d_Gconvert='$d_Gconvert'
16144 d_PRIEUldbl='$d_PRIEUldbl'
16145 d_PRIFUldbl='$d_PRIFUldbl'
16146 d_PRIGUldbl='$d_PRIGUldbl'
16147 d_PRIXU64='$d_PRIXU64'
16148 d_PRId64='$d_PRId64'
16149 d_PRIeldbl='$d_PRIeldbl'
16150 d_PRIfldbl='$d_PRIfldbl'
16151 d_PRIgldbl='$d_PRIgldbl'
16152 d_PRIi64='$d_PRIi64'
16153 d_PRIo64='$d_PRIo64'
16154 d_PRIu64='$d_PRIu64'
16155 d_PRIx64='$d_PRIx64'
16156 d_SCNfldbl='$d_SCNfldbl'
16157 d__fwalk='$d__fwalk'
16158 d_access='$d_access'
16159 d_accessx='$d_accessx'
16161 d_archlib='$d_archlib'
16164 d_attribut='$d_attribut'
16167 d_bincompat5005='$d_bincompat5005'
16169 d_bsdgetpgrp='$d_bsdgetpgrp'
16170 d_bsdsetpgrp='$d_bsdsetpgrp'
16172 d_casti32='$d_casti32'
16173 d_castneg='$d_castneg'
16174 d_charvspr='$d_charvspr'
16176 d_chroot='$d_chroot'
16177 d_chsize='$d_chsize'
16178 d_closedir='$d_closedir'
16179 d_cmsghdr_s='$d_cmsghdr_s'
16183 d_cuserid='$d_cuserid'
16184 d_dbl_dig='$d_dbl_dig'
16185 d_difftime='$d_difftime'
16186 d_dirnamlen='$d_dirnamlen'
16187 d_dlerror='$d_dlerror'
16188 d_dlopen='$d_dlopen'
16189 d_dlsymun='$d_dlsymun'
16190 d_dosuid='$d_dosuid'
16191 d_drand48proto='$d_drand48proto'
16193 d_eaccess='$d_eaccess'
16194 d_endgrent='$d_endgrent'
16195 d_endhent='$d_endhent'
16196 d_endnent='$d_endnent'
16197 d_endpent='$d_endpent'
16198 d_endpwent='$d_endpwent'
16199 d_endsent='$d_endsent'
16200 d_eofnblk='$d_eofnblk'
16201 d_eunice='$d_eunice'
16202 d_fchmod='$d_fchmod'
16203 d_fchown='$d_fchown'
16205 d_fcntl_can_lock='$d_fcntl_can_lock'
16206 d_fd_macros='$d_fd_macros'
16207 d_fd_set='$d_fd_set'
16208 d_fds_bits='$d_fds_bits'
16209 d_fgetpos='$d_fgetpos'
16210 d_flexfnam='$d_flexfnam'
16213 d_fpathconf='$d_fpathconf'
16214 d_fpos64_t='$d_fpos64_t'
16215 d_frexpl='$d_frexpl'
16216 d_fs_data_s='$d_fs_data_s'
16217 d_fseeko='$d_fseeko'
16218 d_fsetpos='$d_fsetpos'
16219 d_fstatfs='$d_fstatfs'
16220 d_fstatvfs='$d_fstatvfs'
16222 d_ftello='$d_ftello'
16224 d_getcwd='$d_getcwd'
16225 d_getespwnam='$d_getespwnam'
16226 d_getfsstat='$d_getfsstat'
16227 d_getgrent='$d_getgrent'
16228 d_getgrps='$d_getgrps'
16229 d_gethbyaddr='$d_gethbyaddr'
16230 d_gethbyname='$d_gethbyname'
16231 d_gethent='$d_gethent'
16232 d_gethname='$d_gethname'
16233 d_gethostprotos='$d_gethostprotos'
16234 d_getitimer='$d_getitimer'
16235 d_getlogin='$d_getlogin'
16236 d_getmnt='$d_getmnt'
16237 d_getmntent='$d_getmntent'
16238 d_getnbyaddr='$d_getnbyaddr'
16239 d_getnbyname='$d_getnbyname'
16240 d_getnent='$d_getnent'
16241 d_getnetprotos='$d_getnetprotos'
16242 d_getpagsz='$d_getpagsz'
16243 d_getpbyname='$d_getpbyname'
16244 d_getpbynumber='$d_getpbynumber'
16245 d_getpent='$d_getpent'
16246 d_getpgid='$d_getpgid'
16247 d_getpgrp2='$d_getpgrp2'
16248 d_getpgrp='$d_getpgrp'
16249 d_getppid='$d_getppid'
16250 d_getprior='$d_getprior'
16251 d_getprotoprotos='$d_getprotoprotos'
16252 d_getprpwnam='$d_getprpwnam'
16253 d_getpwent='$d_getpwent'
16254 d_getsbyname='$d_getsbyname'
16255 d_getsbyport='$d_getsbyport'
16256 d_getsent='$d_getsent'
16257 d_getservprotos='$d_getservprotos'
16258 d_getspnam='$d_getspnam'
16259 d_gettimeod='$d_gettimeod'
16260 d_gnulibc='$d_gnulibc'
16261 d_grpasswd='$d_grpasswd'
16262 d_hasmntopt='$d_hasmntopt'
16266 d_inetaton='$d_inetaton'
16267 d_int64_t='$d_int64_t'
16268 d_isascii='$d_isascii'
16270 d_isnanl='$d_isnanl'
16271 d_killpg='$d_killpg'
16272 d_lchown='$d_lchown'
16273 d_ldbl_dig='$d_ldbl_dig'
16275 d_locconv='$d_locconv'
16277 d_longdbl='$d_longdbl'
16278 d_longlong='$d_longlong'
16279 d_lseekproto='$d_lseekproto'
16281 d_madvise='$d_madvise'
16283 d_mbstowcs='$d_mbstowcs'
16284 d_mbtowc='$d_mbtowc'
16285 d_memchr='$d_memchr'
16286 d_memcmp='$d_memcmp'
16287 d_memcpy='$d_memcpy'
16288 d_memmove='$d_memmove'
16289 d_memset='$d_memset'
16291 d_mkdtemp='$d_mkdtemp'
16292 d_mkfifo='$d_mkfifo'
16293 d_mkstemp='$d_mkstemp'
16294 d_mkstemps='$d_mkstemps'
16295 d_mktime='$d_mktime'
16298 d_mprotect='$d_mprotect'
16300 d_msg_ctrunc='$d_msg_ctrunc'
16301 d_msg_dontroute='$d_msg_dontroute'
16302 d_msg_oob='$d_msg_oob'
16303 d_msg_peek='$d_msg_peek'
16304 d_msg_proxy='$d_msg_proxy'
16305 d_msgctl='$d_msgctl'
16306 d_msgget='$d_msgget'
16307 d_msghdr_s='$d_msghdr_s'
16308 d_msgrcv='$d_msgrcv'
16309 d_msgsnd='$d_msgsnd'
16311 d_munmap='$d_munmap'
16312 d_mymalloc='$d_mymalloc'
16314 d_nv_preserves_uv='$d_nv_preserves_uv'
16315 d_nv_preserves_uv_bits='$d_nv_preserves_uv_bits'
16316 d_off64_t='$d_off64_t'
16317 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
16318 d_oldpthreads='$d_oldpthreads'
16319 d_oldsock='$d_oldsock'
16321 d_pathconf='$d_pathconf'
16323 d_perl_otherlibdirs='$d_perl_otherlibdirs'
16324 d_phostname='$d_phostname'
16327 d_portable='$d_portable'
16328 d_pthread_yield='$d_pthread_yield'
16330 d_pwchange='$d_pwchange'
16331 d_pwclass='$d_pwclass'
16332 d_pwcomment='$d_pwcomment'
16333 d_pwexpire='$d_pwexpire'
16334 d_pwgecos='$d_pwgecos'
16335 d_pwpasswd='$d_pwpasswd'
16336 d_pwquota='$d_pwquota'
16339 d_readdir='$d_readdir'
16340 d_readlink='$d_readlink'
16342 d_recvmsg='$d_recvmsg'
16343 d_rename='$d_rename'
16344 d_rewinddir='$d_rewinddir'
16346 d_safebcpy='$d_safebcpy'
16347 d_safemcpy='$d_safemcpy'
16348 d_sanemcmp='$d_sanemcmp'
16349 d_sbrkproto='$d_sbrkproto'
16350 d_sched_yield='$d_sched_yield'
16351 d_scm_rights='$d_scm_rights'
16352 d_seekdir='$d_seekdir'
16353 d_select='$d_select'
16355 d_semctl='$d_semctl'
16356 d_semctl_semid_ds='$d_semctl_semid_ds'
16357 d_semctl_semun='$d_semctl_semun'
16358 d_semget='$d_semget'
16360 d_sendmsg='$d_sendmsg'
16361 d_setegid='$d_setegid'
16362 d_seteuid='$d_seteuid'
16363 d_setgrent='$d_setgrent'
16364 d_setgrps='$d_setgrps'
16365 d_sethent='$d_sethent'
16366 d_setitimer='$d_setitimer'
16367 d_setlinebuf='$d_setlinebuf'
16368 d_setlocale='$d_setlocale'
16369 d_setnent='$d_setnent'
16370 d_setpent='$d_setpent'
16371 d_setpgid='$d_setpgid'
16372 d_setpgrp2='$d_setpgrp2'
16373 d_setpgrp='$d_setpgrp'
16374 d_setprior='$d_setprior'
16375 d_setproctitle='$d_setproctitle'
16376 d_setpwent='$d_setpwent'
16377 d_setregid='$d_setregid'
16378 d_setresgid='$d_setresgid'
16379 d_setresuid='$d_setresuid'
16380 d_setreuid='$d_setreuid'
16381 d_setrgid='$d_setrgid'
16382 d_setruid='$d_setruid'
16383 d_setsent='$d_setsent'
16384 d_setsid='$d_setsid'
16385 d_setvbuf='$d_setvbuf'
16389 d_shmatprototype='$d_shmatprototype'
16390 d_shmctl='$d_shmctl'
16392 d_shmget='$d_shmget'
16393 d_sigaction='$d_sigaction'
16394 d_sigprocmask='$d_sigprocmask'
16395 d_sigsetjmp='$d_sigsetjmp'
16396 d_sockatmark='$d_sockatmark'
16397 d_socket='$d_socket'
16398 d_socklen_t='$d_socklen_t'
16399 d_sockpair='$d_sockpair'
16400 d_socks5_init='$d_socks5_init'
16402 d_statblks='$d_statblks'
16403 d_statfs_f_flags='$d_statfs_f_flags'
16404 d_statfs_s='$d_statfs_s'
16405 d_statvfs='$d_statvfs'
16406 d_stdio_cnt_lval='$d_stdio_cnt_lval'
16407 d_stdio_ptr_lval='$d_stdio_ptr_lval'
16408 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
16409 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
16410 d_stdio_stream_array='$d_stdio_stream_array'
16411 d_stdiobase='$d_stdiobase'
16412 d_stdstdio='$d_stdstdio'
16413 d_strchr='$d_strchr'
16414 d_strcoll='$d_strcoll'
16415 d_strctcpy='$d_strctcpy'
16416 d_strerrm='$d_strerrm'
16417 d_strerror='$d_strerror'
16418 d_strftime='$d_strftime'
16419 d_strtod='$d_strtod'
16420 d_strtol='$d_strtol'
16421 d_strtold='$d_strtold'
16422 d_strtoll='$d_strtoll'
16423 d_strtoq='$d_strtoq'
16424 d_strtoul='$d_strtoul'
16425 d_strtoull='$d_strtoull'
16426 d_strtouq='$d_strtouq'
16427 d_strxfrm='$d_strxfrm'
16428 d_suidsafe='$d_suidsafe'
16429 d_symlink='$d_symlink'
16430 d_syscall='$d_syscall'
16431 d_sysconf='$d_sysconf'
16432 d_sysernlst='$d_sysernlst'
16433 d_syserrlst='$d_syserrlst'
16434 d_system='$d_system'
16435 d_tcgetpgrp='$d_tcgetpgrp'
16436 d_tcsetpgrp='$d_tcsetpgrp'
16437 d_telldir='$d_telldir'
16438 d_telldirproto='$d_telldirproto'
16441 d_truncate='$d_truncate'
16442 d_tzname='$d_tzname'
16443 d_u32align='$d_u32align'
16444 d_ualarm='$d_ualarm'
16447 d_union_semun='$d_union_semun'
16448 d_usleep='$d_usleep'
16450 d_vendorarch='$d_vendorarch'
16451 d_vendorbin='$d_vendorbin'
16452 d_vendorlib='$d_vendorlib'
16454 d_void_closedir='$d_void_closedir'
16455 d_voidsig='$d_voidsig'
16456 d_voidtty='$d_voidtty'
16457 d_volatile='$d_volatile'
16458 d_vprintf='$d_vprintf'
16460 d_waitpid='$d_waitpid'
16461 d_wcstombs='$d_wcstombs'
16462 d_wctomb='$d_wctomb'
16463 d_writev='$d_writev'
16466 db_hashtype='$db_hashtype'
16467 db_prefixtype='$db_prefixtype'
16468 defvoidused='$defvoidused'
16469 direntrytype='$direntrytype'
16472 doublesize='$doublesize'
16474 dynamic_ext='$dynamic_ext'
16480 eunicefix='$eunicefix'
16483 extensions='$extensions'
16484 fflushNULL='$fflushNULL'
16485 fflushall='$fflushall'
16487 firstmakefile='$firstmakefile'
16489 fpossize='$fpossize'
16490 fpostype='$fpostype'
16491 freetype='$freetype'
16493 full_csh='$full_csh'
16494 full_sed='$full_sed'
16495 gccosandvers='$gccosandvers'
16496 gccversion='$gccversion'
16497 gidformat='$gidformat'
16503 groupcat='$groupcat'
16504 groupstype='$groupstype'
16507 h_sysfile='$h_sysfile'
16518 i_arpainet='$i_arpainet'
16519 i_bsdioctl='$i_bsdioctl'
16522 i_dirent='$i_dirent'
16530 i_ieeefp='$i_ieeefp'
16531 i_inttypes='$i_inttypes'
16532 i_libutil='$i_libutil'
16533 i_limits='$i_limits'
16534 i_locale='$i_locale'
16535 i_machcthr='$i_machcthr'
16536 i_malloc='$i_malloc'
16538 i_memory='$i_memory'
16539 i_mntent='$i_mntent'
16542 i_neterrno='$i_neterrno'
16543 i_netinettcp='$i_netinettcp'
16547 i_pthread='$i_pthread'
16549 i_rpcsvcdbm='$i_rpcsvcdbm'
16552 i_shadow='$i_shadow'
16554 i_stdarg='$i_stdarg'
16555 i_stddef='$i_stddef'
16556 i_stdlib='$i_stdlib'
16557 i_string='$i_string'
16558 i_sunmath='$i_sunmath'
16559 i_sysaccess='$i_sysaccess'
16560 i_sysdir='$i_sysdir'
16561 i_sysfile='$i_sysfile'
16562 i_sysfilio='$i_sysfilio'
16564 i_sysioctl='$i_sysioctl'
16565 i_syslog='$i_syslog'
16566 i_sysmman='$i_sysmman'
16567 i_sysmode='$i_sysmode'
16568 i_sysmount='$i_sysmount'
16569 i_sysndir='$i_sysndir'
16570 i_sysparam='$i_sysparam'
16571 i_sysresrc='$i_sysresrc'
16572 i_syssecrt='$i_syssecrt'
16573 i_sysselct='$i_sysselct'
16574 i_syssockio='$i_syssockio'
16575 i_sysstat='$i_sysstat'
16576 i_sysstatfs='$i_sysstatfs'
16577 i_sysstatvfs='$i_sysstatvfs'
16578 i_systime='$i_systime'
16579 i_systimek='$i_systimek'
16580 i_systimes='$i_systimes'
16581 i_systypes='$i_systypes'
16582 i_sysuio='$i_sysuio'
16584 i_sysutsname='$i_sysutsname'
16585 i_sysvfs='$i_sysvfs'
16586 i_syswait='$i_syswait'
16587 i_termio='$i_termio'
16588 i_termios='$i_termios'
16590 i_unistd='$i_unistd'
16593 i_values='$i_values'
16594 i_varargs='$i_varargs'
16595 i_varhdr='$i_varhdr'
16597 ignore_versioned_solibs='$ignore_versioned_solibs'
16598 inc_version_list='$inc_version_list'
16599 inc_version_list_init='$inc_version_list_init'
16602 installarchlib='$installarchlib'
16603 installbin='$installbin'
16604 installman1dir='$installman1dir'
16605 installman3dir='$installman3dir'
16606 installprefix='$installprefix'
16607 installprefixexp='$installprefixexp'
16608 installprivlib='$installprivlib'
16609 installscript='$installscript'
16610 installsitearch='$installsitearch'
16611 installsitebin='$installsitebin'
16612 installsitelib='$installsitelib'
16613 installstyle='$installstyle'
16614 installusrbinperl='$installusrbinperl'
16615 installvendorarch='$installvendorarch'
16616 installvendorbin='$installvendorbin'
16617 installvendorlib='$installvendorlib'
16619 issymlink='$issymlink'
16620 ivdformat='$ivdformat'
16623 known_extensions='$known_extensions'
16626 lddlflags='$lddlflags'
16628 ldflags_uselargefiles='$ldflags_uselargefiles'
16629 ldlibpthname='$ldlibpthname'
16636 libsdirs='$libsdirs'
16637 libsfiles='$libsfiles'
16638 libsfound='$libsfound'
16639 libspath='$libspath'
16640 libswanted='$libswanted'
16641 libswanted_uselargefiles='$libswanted_uselargefiles'
16647 locincpth='$locincpth'
16648 loclibpth='$loclibpth'
16649 longdblsize='$longdblsize'
16650 longlongsize='$longlongsize'
16651 longsize='$longsize'
16655 lseeksize='$lseeksize'
16656 lseektype='$lseektype'
16660 make_set_make='$make_set_make'
16661 mallocobj='$mallocobj'
16662 mallocsrc='$mallocsrc'
16663 malloctype='$malloctype'
16665 man1direxp='$man1direxp'
16668 man3direxp='$man3direxp'
16670 mips_type='$mips_type'
16672 mmaptype='$mmaptype'
16673 modetype='$modetype'
16675 multiarch='$multiarch'
16677 myarchname='$myarchname'
16678 mydomain='$mydomain'
16679 myhostname='$myhostname'
16682 need_va_copy='$need_va_copy'
16683 netdb_hlen_type='$netdb_hlen_type'
16684 netdb_host_type='$netdb_host_type'
16685 netdb_name_type='$netdb_name_type'
16686 netdb_net_type='$netdb_net_type'
16689 nm_so_opt='$nm_so_opt'
16690 nonxs_ext='$nonxs_ext'
16692 nvEUformat='$nvEUformat'
16693 nvFUformat='$nvFUformat'
16694 nvGUformat='$nvGUformat'
16695 nveformat='$nveformat'
16696 nvfformat='$nvfformat'
16697 nvgformat='$nvgformat'
16700 o_nonblock='$o_nonblock'
16702 old_pthread_create_joinable='$old_pthread_create_joinable'
16703 optimize='$optimize'
16704 orderlib='$orderlib'
16707 otherlibdirs='$otherlibdirs'
16711 patchlevel='$patchlevel'
16712 path_sep='$path_sep'
16715 perladmin='$perladmin'
16716 perllibs='$perllibs'
16717 perlpath='$perlpath'
16719 phostname='$phostname'
16722 pm_apiversion='$pm_apiversion'
16726 prefixexp='$prefixexp'
16728 privlibexp='$privlibexp'
16729 prototype='$prototype'
16731 quadkind='$quadkind'
16732 quadtype='$quadtype'
16733 randbits='$randbits'
16734 randfunc='$randfunc'
16735 randseedtype='$randseedtype'
16737 rd_nodata='$rd_nodata'
16738 revision='$revision'
16742 sPRIEUldbl='$sPRIEUldbl'
16743 sPRIFUldbl='$sPRIFUldbl'
16744 sPRIGUldbl='$sPRIGUldbl'
16745 sPRIXU64='$sPRIXU64'
16747 sPRIeldbl='$sPRIeldbl'
16748 sPRIfldbl='$sPRIfldbl'
16749 sPRIgldbl='$sPRIgldbl'
16754 sSCNfldbl='$sSCNfldbl'
16755 sched_yield='$sched_yield'
16756 scriptdir='$scriptdir'
16757 scriptdirexp='$scriptdirexp'
16759 seedfunc='$seedfunc'
16760 selectminbits='$selectminbits'
16761 selecttype='$selecttype'
16762 sendmail='$sendmail'
16765 sharpbang='$sharpbang'
16766 shmattype='$shmattype'
16767 shortsize='$shortsize'
16770 sig_count='$sig_count'
16771 sig_name='$sig_name'
16772 sig_name_init='$sig_name_init'
16774 sig_num_init='$sig_num_init'
16775 sig_size='$sig_size'
16776 signal_t='$signal_t'
16777 sitearch='$sitearch'
16778 sitearchexp='$sitearchexp'
16780 sitebinexp='$sitebinexp'
16782 sitelib_stem='$sitelib_stem'
16783 sitelibexp='$sitelibexp'
16784 siteprefix='$siteprefix'
16785 siteprefixexp='$siteprefixexp'
16786 sizesize='$sizesize'
16787 sizetype='$sizetype'
16791 sockethdr='$sockethdr'
16792 socketlib='$socketlib'
16793 socksizetype='$socksizetype'
16795 spackage='$spackage'
16796 spitshell='$spitshell'
16798 ssizetype='$ssizetype'
16799 startperl='$startperl'
16801 static_ext='$static_ext'
16803 stdio_base='$stdio_base'
16804 stdio_bufsiz='$stdio_bufsiz'
16805 stdio_cnt='$stdio_cnt'
16806 stdio_filbuf='$stdio_filbuf'
16807 stdio_ptr='$stdio_ptr'
16808 stdio_stream_array='$stdio_stream_array'
16811 subversion='$subversion'
16818 timeincl='$timeincl'
16819 timetype='$timetype'
16832 uidformat='$uidformat'
16838 uquadtype='$uquadtype'
16839 use5005threads='$use5005threads'
16840 use64bitall='$use64bitall'
16841 use64bitint='$use64bitint'
16843 useithreads='$useithreads'
16844 uselargefiles='$uselargefiles'
16845 uselongdouble='$uselongdouble'
16846 usemorebits='$usemorebits'
16847 usemultiplicity='$usemultiplicity'
16848 usemymalloc='$usemymalloc'
16850 useopcode='$useopcode'
16851 useperlio='$useperlio'
16852 useposix='$useposix'
16854 useshrplib='$useshrplib'
16855 usesocks='$usesocks'
16856 usethreads='$usethreads'
16857 usevendorprefix='$usevendorprefix'
16858 usevfork='$usevfork'
16861 uvXUformat='$uvXUformat'
16862 uvoformat='$uvoformat'
16865 uvuformat='$uvuformat'
16866 uvxformat='$uvxformat'
16867 vendorarch='$vendorarch'
16868 vendorarchexp='$vendorarchexp'
16869 vendorbin='$vendorbin'
16870 vendorbinexp='$vendorbinexp'
16871 vendorlib='$vendorlib'
16872 vendorlib_stem='$vendorlib_stem'
16873 vendorlibexp='$vendorlibexp'
16874 vendorprefix='$vendorprefix'
16875 vendorprefixexp='$vendorprefixexp'
16877 versiononly='$versiononly'
16879 voidflags='$voidflags'
16881 xs_apiversion='$xs_apiversion'
16883 yaccflags='$yaccflags'
16888 : Add in command line options if available
16889 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
16891 : add special variables
16892 $test -f $src/patchlevel.h && \
16893 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
16894 echo "CONFIGDOTSH=true" >>config.sh
16896 : propagate old symbols
16897 if $test -f UU/config.sh; then
16898 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
16899 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
16900 $sort | $uniq -u >UU/oldsyms
16901 set X `cat UU/oldsyms`
16907 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
16909 echo "# Variables propagated from previous config.sh file." >>config.sh
16910 for sym in `cat UU/oldsyms`; do
16911 echo " Propagating $hint variable "'$'"$sym..."
16912 eval 'tmp="$'"${sym}"'"'
16914 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
16920 : Finish up by extracting the .SH files
16934 If you'd like to make any changes to the config.sh file before I begin
16935 to configure things, do it as a shell escape now (e.g. !vi config.sh).
16938 rp="Press return or use a shell escape to edit config.sh:"
16943 *) : in case they cannot read
16944 sh 1>&4 -c "$ans";;
16949 : if this fails, just run all the .SH files by hand
16956 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
16963 Now you need to generate make dependencies by running "$make depend".
16964 You might prefer to run it in background: "$make depend > makedepend.out &"
16965 It can take a while, so you might not want to run it right now.
16970 rp="Run $make depend now?"
16974 $make depend && echo "Now you must run '$make'."
16977 echo "You must run '$make depend' then '$make'."
16980 elif test -f [Mm]akefile; then
16982 echo "Now you must run a $make."
16987 if $test -f Policy.sh; then
16990 If you compile $package on a different machine or from a different object
16991 directory, copy the Policy.sh file from this object directory to the
16992 new one before you run Configure -- this will help you with most of
16993 the policy defaults.
16997 if $test -f config.msg; then
16998 echo "Hmm. I also noted the following information while running:"
17000 $cat config.msg >&4
17003 $rm -f kit*isdone ark*isdone