3 # If these # comments don't work, trim them. Don't worry about any other
4 # shell scripts, Configure will trim # comments from them for you.
6 # (If you are trying to port this package to a machine without sh,
7 # I would suggest you have a look at the prototypical config_h.SH file
8 # and edit it to reflect your system. Some packages may include samples
9 # of config.h for certain machines, so you might look for one of those.)
11 # Yes, you may rip this off to use in other distribution packages. This
12 # script belongs to the public domain and cannot be copyrighted.
14 # (Note: this Configure script was generated automatically. Rather than
15 # working with this copy of Configure, you may wish to get metaconfig.
16 # The dist-3.0 package (which contains metaconfig) was posted in
17 # comp.sources.misc and is available on CPAN under authors/id/RAM so
18 # you may fetch it yourself from your nearest archive site.)
21 # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
23 # Generated on Thu Jul 12 07:32:38 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
478 d_old_pthread_create_joinable=''
479 old_pthread_create_joinable=''
566 d_stdio_ptr_lval_nochange_cnt=''
567 d_stdio_ptr_lval_sets_cnt=''
750 inc_version_list_init=''
769 ignore_versioned_solibs=''
828 d_perl_otherlibdirs=''
842 version_patchlevel_string=''
847 d_nv_preserves_uv_bits=''
946 d_stdio_stream_array=''
947 stdio_stream_array=''
957 ccflags_uselargefiles=''
958 ldflags_uselargefiles=''
959 libswanted_uselargefiles=''
1005 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1008 : We must find out about Eunice early
1010 if test -f /etc/unixtovms; then
1011 eunicefix=/etc/unixtovms
1013 if test -f /etc/unixtovms.exe; then
1014 eunicefix=/etc/unixtovms.exe
1021 : set useposix=false in your hint file to disable the POSIX extension.
1023 : set useopcode=false in your hint file to disable the Opcode extension.
1025 : Trailing extension. Override this in a hint file, if needed.
1027 : Extra object files, if any, needed on this platform.
1030 : Possible local include directories to search.
1031 : Set locincpth to "" in a hint file to defeat local include searches.
1032 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1033 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1035 : no include file wanted by default
1040 : change the next line if compiling for Xenix/286 on Xenix/386
1041 xlibpth='/usr/lib/386 /lib/386'
1042 : Possible local library directories to search.
1043 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1044 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1046 : general looking path for locating libraries
1047 glibpth="/lib /usr/lib $xlibpth"
1048 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1049 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1050 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1052 : Private path used by Configure to find libraries. Its value
1053 : is prepended to libpth. This variable takes care of special
1054 : machines, like the mips. Usually, it should be empty.
1057 : default library list
1059 : some systems want to use only the non-versioned libso:s
1060 ignore_versioned_solibs=''
1062 ccflags_uselargefiles=''
1063 ldflags_uselargefiles=''
1064 libswanted_uselargefiles=''
1065 : set usemultiplicity on the Configure command line to enable multiplicity.
1066 : set usesocks on the Configure command line to enable socks.
1067 : set usethreads on the Configure command line to enable threads.
1068 usereentrant='undef'
1069 : full support for void wanted by default
1072 : List of libraries we want.
1073 : If anyone needs -lnet, put it in a hint file.
1074 libswanted='sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl'
1075 libswanted="$libswanted dld ld sun m c cposix posix"
1076 libswanted="$libswanted ndir dir crypt sec"
1077 libswanted="$libswanted ucb bsd BSD PW x iconv util"
1078 : We probably want to search /usr/shlib before most other libraries.
1079 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1080 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1081 glibpth="/usr/shlib $glibpth"
1082 : Do not use vfork unless overridden by a hint file.
1085 : Find the basic shell for Bourne shell scripts
1089 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1092 if test -f "$xxx"; then
1095 : Build up a list and do a single loop so we can 'break' out.
1096 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1097 for xxx in sh bash ksh pdksh ash; do
1099 try="$try ${p}/${xxx}"
1103 if test -f "$xxx"; then
1106 elif test -f "$xxx.exe"; then
1117 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1119 Usually it's in /bin/sh. How did you even get this far?
1120 Please contact me (Perl Maintainers) at perlbug@perl.org and
1121 we'll try to straighten this all out.
1127 : see if sh knows # comments
1128 if `$sh -c '#' >/dev/null 2>&1`; then
1132 test -f $xcat || xcat=/usr/bin/cat
1133 echo "#!$xcat" >sharp
1137 if test -s today; then
1140 echo "#! $xcat" > sharp
1144 if test -s today; then
1152 echo "Your $sh doesn't grok # comments--I will strip them later on."
1155 echo "exec grep -v '^[ ]*#'" >spitshell
1157 $eunicefix spitshell
1158 spitshell=`pwd`/spitshell
1160 echo "I presume that if # doesn't work, #! won't work either!"
1165 : figure out how to guarantee sh startup
1167 '') startsh=${sharpbang}${sh} ;;
1179 : echo "Yup, it does."
1181 echo "Hmm... '$startsh' does not guarantee sh startup..."
1182 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1187 : Save command line options in file UU/cmdline.opt for later use in
1188 : generating config.sh.
1189 cat > cmdline.opt <<EOSH
1190 # Configure command line arguments.
1199 cat >>cmdline.opt <<EOSH
1200 config_arg$argn='$arg'
1202 # Extreme backslashitis: replace each ' by '"'"'
1203 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1206 arg_exp=`cat cmdl.opt`
1207 args_exp="$args_exp$args_sep'$arg_exp'"
1208 argn=`expr $argn + 1`
1211 # args_exp is good for restarting self: eval "set X $args_exp"; shift; $0 "$@"
1212 # used by ./hints/os2.sh
1215 : produce awk script to parse command line options
1216 cat >options.awk <<'EOF'
1218 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1220 len = length(optstr);
1221 for (i = 1; i <= len; i++) {
1222 c = substr(optstr, i, 1);
1223 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1234 if (substr(str, 1, 1) != "-") {
1235 printf("'%s'\n", str);
1239 for (i = 2; i <= len; i++) {
1240 c = substr(str, i, 1);
1242 printf("-%s\n", substr(str, i));
1248 printf("'%s'\n", substr(str, i + 1));
1261 : process the command line options
1262 set X `for arg in "$@"; do echo "X$arg"; done |
1263 sed -e s/X// | awk -f options.awk`
1268 : set up default values
1278 rm -f optdef.sh posthint.sh
1279 cat >optdef.sh <<EOS
1285 while test $# -gt 0; do
1287 -d) shift; fastread=yes;;
1288 -e) shift; alldone=cont;;
1292 if test -r "$1"; then
1295 echo "$me: cannot read config file $1." >&2
1300 -h) shift; error=true;;
1301 -r) shift; reuseval=true;;
1302 -s) shift; silent=true; realsilent=true;;
1303 -E) shift; alldone=exit;;
1304 -K) shift; knowitall=true;;
1305 -O) shift; override=true;;
1306 -S) shift; silent=true; extractsh=true;;
1311 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1312 echo "$me: ignoring -D $1" >&2
1315 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1316 *) echo "$1='define'" >> optdef.sh;;
1323 *=) echo "$1" >> optdef.sh;;
1325 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1326 echo "$me: ignoring -U $1" >&2
1328 *) echo "$1='undef'" >> optdef.sh;;
1339 *=*) zzz=`echo $yyy|sed 's!=.*!!'`
1343 zzz=" "`echo $yyy|sed 's!^[^=]*=!!'`
1344 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1350 *:*) xxx=`echo $yyy|sed 's!:.*!!'`
1351 yyy=`echo $yyy|sed 's!^[^:]*:!!'`
1352 zzz=`echo $yyy|sed 's!^[^=]*=!!'`
1353 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1354 *) xxx=`echo $yyy|sed 's!:.*!!'`
1355 yyy=`echo $yyy|sed 's!^[^:]*:!!'` ;;
1361 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1363 echo "$yyy=''" >> posthint.sh ;;
1368 echo "$yyy='$zzz'" >> posthint.sh ;;
1370 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1372 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1377 echo "$yyy=$zzz" >> posthint.sh ;;
1378 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1382 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1385 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1393 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1394 [-U symbol] [-U symbol=] [-A command:symbol...]
1395 -d : use defaults for all answers.
1396 -e : go on without questioning past the production of config.sh.
1397 -f : specify an alternate default configuration file.
1398 -h : print this help message and exit (with an error status).
1399 -r : reuse C symbols value if possible (skips costly nm extraction).
1400 -s : silent mode, only echoes questions and essential information.
1401 -D : define symbol to have some value:
1402 -D symbol symbol gets the value 'define'
1403 -D symbol=value symbol gets the value 'value'
1404 -E : stop at the end of questions, after having produced config.sh.
1405 -K : do not use unless you know what you are doing.
1406 -O : let -D and -U override definitions from loaded configuration file.
1407 -S : perform variable substitutions on all .SH files (can mix with -f)
1408 -U : undefine symbol:
1409 -U symbol symbol gets the value 'undef'
1410 -U symbol= symbol gets completely empty
1411 -A : manipulate symbol after the platform specific hints have been applied:
1412 -A symbol=value append " "value to symbol
1413 -A append:symbol=value append value to symbol
1414 -A define:symbol=value define symbol to have value
1415 -A clear:symbol define symbol to be ''
1416 -A define:symbol define symbol to be 'define'
1417 -A eval:symbol=value define symbol to be eval of value
1418 -A prepend:symbol=value prepend value to symbol
1419 -A undef:symbol define symbol to be 'undef'
1420 -A undef:symbol= define symbol to be ''
1421 -V : print version number and exit (with a zero status).
1428 case "$fastread$alldone" in
1431 case "$extractsh" in
1434 if test ! -t 0; then
1435 echo "Say 'sh Configure', not 'sh <Configure'"
1445 true) exec 1>/dev/null;;
1448 : run the defines and the undefines, if any, but leave the file out there...
1451 : create the posthint manipulation script and leave the file out there...
1456 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1457 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1458 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1459 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1460 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1463 : Some greps do not return status, grrr.
1464 echo "grimblepritz" >grimble
1465 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1467 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1473 : the following should work in any shell
1477 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1478 cat >contains <<'EOSS'
1479 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1484 : Find the path to the source tree
1487 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1491 *) src=`cd ../$src && pwd` ;;
1504 if test -f $rsrc/Configure && \
1505 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1507 : found it, so we are ok.
1510 for src in . .. ../.. ../../.. ../../../..; do
1511 if test -f ../$src/Configure && \
1512 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1523 Sorry, I can't seem to locate the source dir for $package. Please start
1524 Configure with an explicit path -- i.e. /some/path/Configure.
1532 echo "Sources for $package found in \"$src\"." >&4
1536 : script used to extract .SH files with variable substitutions
1537 cat >extract <<'EOS'
1539 echo "Doing variable substitutions on .SH files..."
1540 if test -f MANIFEST; then
1541 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1543 echo "(Looking for .SH files under the source directory.)"
1544 set x `(cd $src; find . -name "*.SH" -print)`
1548 0) set x `(cd $src; echo *.SH)`; shift;;
1550 if test ! -f $src/$1; then
1556 while test $name; do
1557 if test ! -d "$name"; then
1558 create="$name $create";
1559 name=`echo $name | sed -e "s|^[^/]*$||"`;
1560 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1565 for file in $create; do
1574 dir=`expr X$file : 'X\(.*\)/'`
1575 file=`expr X$file : 'X.*/\(.*\)'`
1576 (cd $dir && . ./$file)
1586 dir=`expr X$file : 'X\(.*\)/'`
1587 file=`expr X$file : 'X.*/\(.*\)'`
1588 (set x $dir; shift; eval $mkdir_p)
1598 if test -f $src/config_h.SH; then
1599 if test ! -f config.h; then
1600 : oops, they left it out of MANIFEST, probably, so do it anyway.
1606 : extract files and exit if asked to do so
1607 case "$extractsh" in
1609 case "$realsilent" in
1613 case "$config_sh" in
1614 '') config_sh='config.sh';;
1617 echo "Fetching answers from $config_sh..."
1620 test "$override" && . ./optdef.sh
1624 echo "Extraction done."
1629 : Eunice requires " " instead of "", can you believe it
1632 echo "Beginning of configuration questions for $package."
1634 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1636 : first determine how to suppress newline on echo command
1638 echo "Checking echo to see how to suppress newlines..."
1639 (echo "hi there\c" ; echo " ") >.echotmp
1640 if $contains c .echotmp >/dev/null 2>&1 ; then
1651 echo $n "The star should be here-->$c"
1655 : Now test for existence of everything in MANIFEST
1657 if test -f $rsrc/MANIFEST; then
1658 echo "First let's make sure your kit is complete. Checking..." >&4
1659 awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
1662 for filelist in x??; do
1663 (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
1665 if test -s missing; then
1669 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1671 You have the option of continuing the configuration process, despite the
1672 distinct possibility that your kit is damaged, by typing 'y'es. If you
1673 do, don't blame me if something goes wrong. I advise you to type 'n'o
1674 and contact the author (perlbug@perl.org).
1677 echo $n "Continue? [n] $c" >&4
1681 echo "Continuing..." >&4
1685 echo "ABORTING..." >&4
1690 echo "Looks good..."
1693 echo "There is no MANIFEST file. I hope your kit is complete !"
1698 : Find the appropriate value for a newline for tr
1699 if test -n "$DJGPP"; then
1702 if test X"$trnl" = X; then
1703 case "`echo foo|tr '\n' x 2>/dev/null`" in
1707 if test X"$trnl" = X; then
1708 case "`echo foo|tr '\012' x 2>/dev/null`" in
1709 foox) trnl='\012' ;;
1712 if test X"$trnl" = X; then
1715 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1721 : compute the number of columns on the terminal for proper question formatting
1726 : set up the echo used in my read
1727 myecho="case \"\$xxxm\" in
1728 '') echo $n \"\$rp $c\" >&4;;
1730 '') echo $n \"[\$xxxm] $c\";;
1732 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1734 echo $n \"[\$xxxm] $c\" >&4
1736 echo $n \"\$rp [\$xxxm] $c\" >&4
1742 : now set up to do reads with possible shell escape and default assignment
1748 case "\$fastread" in
1749 yes) case "\$dflt" in
1752 case "\$silent-\$rp" in
1757 *) case "\$silent" in
1758 true) case "\$rp" in
1763 while expr "X\$ans" : "X!" >/dev/null; do
1767 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1775 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1784 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1789 echo "(OK, I'll run with -d after this question.)" >&4
1792 echo "*** Sorry, \$1 not supported yet." >&4
1802 echo "*** Substitution done -- please confirm."
1804 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1809 echo "*** Error -- try again."
1816 case "\$ans\$xxxm\$nostick" in
1828 : create .config dir to save info across Configure sessions
1829 test -d ../.config || mkdir ../.config
1830 cat >../.config/README <<EOF
1831 This directory created by Configure to save information that should
1832 persist across sessions for $package.
1834 You may safely delete it if you wish.
1837 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
1839 $define|true|[yY]*) ;;
1840 *) case "$xversion" in
1843 *** WHOA THERE!!! ***
1845 This is an UNSTABLE DEVELOPMENT release.
1846 The version of this $package distribution is $xversion, that is, odd,
1847 (as opposed to even) and that signifies a development release.
1848 If you want a maintenance release, you want an even-numbered version.
1850 Do ***NOT*** install this into production use.
1851 Data corruption and crashes are possible.
1853 It is most seriously suggested that you do not continue any further
1854 unless you want to help in developing and debugging Perl.
1856 If you *still* want to build perl, you can answer 'y' now,
1857 or pass -Dusedevel to Configure.
1860 rp='Do you really want to continue?'
1864 [yY]) echo >&4 "Okay, continuing."
1865 usedevel="$define" ;;
1866 *) echo >&4 "Okay, bye."
1876 case "$versiononly" in
1877 '') versiononly="$define" ;;
1879 case "$installusrbinperl" in
1880 '') installusrbinperl="$undef" ;;
1885 : general instructions
1888 user=`(logname) 2>/dev/null`
1890 '') user=`whoami 2>&1`;;
1892 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1895 rp='Would you like to see the instructions?'
1906 This installation shell script will examine your system and ask you questions
1907 to determine how the perl5 package should be installed. If you get
1908 stuck on a question, you may use a ! shell escape to start a subshell or
1909 execute a command. Many of the questions will have default answers in square
1910 brackets; typing carriage return will give you the default.
1912 On some of the questions which ask for file or directory names you are allowed
1913 to use the ~name construct to specify the login directory belonging to "name",
1914 even if you don't have a shell which knows about that. Questions where this is
1915 allowed will be marked "(~name ok)".
1919 dflt='Type carriage return to continue'
1923 The prompter used in this script allows you to use shell variables and
1924 backticks in your answers. You may use $1, $2, etc... to refer to the words
1925 in the default answer, as if the default line was a set of arguments given to a
1926 script shell. This means you may also use $* to repeat the whole default line,
1927 so you do not have to re-type everything to add something to the default.
1929 Everytime there is a substitution, you will have to confirm. If there is an
1930 error (e.g. an unmatched backtick), the default answer will remain unchanged
1931 and you will be prompted again.
1933 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1934 the questions and use the computed defaults (or the previous answers if there
1935 was already a config.sh file). Type 'Configure -h' for a list of options.
1936 You may also start interactively and then answer '& -d' at any prompt to turn
1937 on the non-interactive behaviour for the remainder of the execution.
1943 Much effort has been expended to ensure that this shell script will run on any
1944 Unix system. If despite that it blows up on yours, your best bet is to edit
1945 Configure and run it again. If you can't run Configure for some reason,
1946 you'll have to generate a config.sh file by hand. Whatever problems you
1947 have, let me (perlbug@perl.org) know how I blew it.
1949 This installation script affects things in two ways:
1951 1) it may do direct variable substitutions on some of the files included
1953 2) it builds a config.h file for inclusion in C programs. You may edit
1954 any of these files as the need arises after running this script.
1956 If you make a mistake on a question, there is no easy way to back up to it
1957 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1958 files. Configure will offer to let you do this before it runs the SH files.
1961 dflt='Type carriage return to continue'
1963 case "$firsttime" in
1964 true) echo $user >>../.config/instruct;;
1968 : find out where common programs are
1970 echo "Locating common programs..." >&4
1983 if test -d \$dir/\$thing; then
1989 for thisthing in \$dir/\$thing; do
1990 : just loop through to pick last item
1992 if test -f \$thisthing; then
1995 elif test -f \$dir/\$thing.exe; then
1996 if test -n "$DJGPP"; then
1997 echo \$dir/\$thing.exe
1999 : on Eunice apparently
2051 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2052 pth="$pth /lib /usr/lib"
2053 for file in $loclist; do
2057 if test -f "$xxx"; then
2060 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2061 xxx=`./loc $file $file $pth`
2064 '') xxx=`./loc $file $file $pth`;;
2065 *) xxx=`./loc $xxx $xxx $pth`;;
2071 echo $file is in $xxx.
2074 echo $file is in $xxx.
2077 echo "I don't know where '$file' is, and my life depends on it." >&4
2078 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2084 echo "Don't worry if any of the following aren't found..."
2086 for file in $trylist; do
2090 if test -f "$xxx"; then
2093 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2094 xxx=`./loc $file $file $pth`
2097 '') xxx=`./loc $file $file $pth`;;
2098 *) xxx=`./loc $xxx $xxx $pth`;;
2104 echo $file is in $xxx.
2107 echo $file is in $xxx.
2110 echo "I don't see $file out there, $say."
2117 echo "Substituting grep for egrep."
2123 echo "Substituting cp for ln."
2129 echo "Hopefully test is built into your sh."
2132 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2133 echo "Using the test built into your sh."
2141 echo "Hopefully echo is built into your sh."
2146 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2147 $echo $n "hi there$c" >foo1
2148 echo $n "hi there$c" >foo2
2149 if cmp foo1 foo2 >/dev/null 2>&1; then
2150 echo "They are compatible. In fact, they may be identical."
2157 They are not compatible! You are probably running ksh on a non-USG system.
2158 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2159 have echo built in and we may have to run some Bourne shell scripts. That
2160 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2163 $echo $n "The star should be here-->$c"
2173 cat <<'EOSC' >>checkcc
2178 int main(int argc, char *argv[]) {
2182 if $cc -o try $ccflags $ldflags try.c; then
2185 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2191 case "`$cc -v -c try.c 2>&1`" in
2194 if $test X"$trygcc" = Xyes; then
2195 if gcc -o try -c try.c; then
2197 echo "You seem to have a working gcc, though." >&4
2198 rp="Would you like to use it?"
2200 if $test -f myread; then
2203 if $test -f UU/myread; then
2206 echo "Cannot find myread, sorry. Aborting." >&2
2211 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no ;;
2215 if $test X"$despair" = Xyes; then
2217 You need to find a working C compiler.
2218 Either (purchase and) install the C compiler supplied by your OS vendor,
2219 or for a free C compiler try http://gcc.gnu.org/
2220 I cannot continue any further, aborting.
2230 : determine whether symbolic links are supported
2233 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2234 echo "Symbolic links are supported." >&4
2237 echo "Symbolic links are NOT supported." >&4
2242 : determine whether symbolic links are supported
2246 echo "Checking how to test for symbolic links..." >&4
2248 if $test "X$issymlink" = X; then
2249 sh -c "PATH= test -h sym" >/dev/null 2>&1
2250 if test $? = 0; then
2254 if $test "X$issymlink" = X; then
2255 if $test -h >/dev/null 2>&1; then
2256 issymlink="$test -h"
2257 echo "Your builtin 'test -h' may be broken, I'm using external '$test -h'." >&4
2260 if $test "X$issymlink" = X; then
2261 if $test -L sym 2>/dev/null; then
2262 issymlink="$test -L"
2265 if $test "X$issymlink" != X; then
2266 echo "You can test for symbolic links with '$issymlink'." >&4
2268 echo "I do not know how you can test for symbolic links." >&4
2272 *) echo "No symbolic links, so not testing for their testing..." >&4
2278 case "$mksymlinks" in
2281 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2284 *) case "$lns:$issymlink" in
2285 *"ln -s:"*"test -"?)
2286 echo "Creating the symbolic links..." >&4
2287 echo "(First creating the subdirectories...)" >&4
2289 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2291 test -z "$directory" && break
2295 if test ! -d t/base; then
2296 echo "Failed to create the subdirectories. Aborting." >&4
2299 echo "(Then creating the symlinks...)" >&4
2300 awk '{print $1}' $src/MANIFEST | while true; do
2302 test -z "$filename" && break
2303 if test -f $filename; then
2304 if $issymlink $filename; then
2308 if test -f $filename; then
2309 echo "$filename already exists, not symlinking."
2311 ln -s $src/$filename $filename
2315 if test ! -f t/base/commonsense.t; then
2316 echo "Failed to create the symlinks. Aborting." >&4
2321 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2330 case "$usecrosscompile" in
2332 $echo "Cross-compiling..."
2335 *-*-gcc) # A cross-compiling gcc, probably.
2336 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2338 # leave out ld, choosing it is more complex
2340 ranlib=$targetarch-ranlib
2341 $echo 'extern int foo;' > try.c
2342 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2344 if $test $# -gt 0; then
2346 incpth="`$echo $incpth|$sed 's/^ //'`"
2347 echo "Guessing incpth '$incpth'." >&4
2349 j="`$echo $i|$sed 's,/include$,/lib,'`"
2350 if $test -d $j; then
2354 libpth="`$echo $libpth|$sed 's/^ //'`"
2355 echo "Guessing libpth '$libpth'." >&4
2360 case "$targetarch" in
2361 '') echo "Targetarch not defined." >&4; croak=y ;;
2362 *) echo "Using targetarch $targetarch." >&4 ;;
2365 '') echo "Incpth not defined." >&4; croak=y ;;
2366 *) echo "Using incpth '$incpth'." >&4 ;;
2369 '') echo "Libpth not defined." >&4; croak=y ;;
2370 *) echo "Using libpth '$libpth'." >&4 ;;
2373 '') for i in $incpth; do
2374 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2376 echo "Guessing usrinc $usrinc." >&4
2381 '') echo "Usrinc not defined." >&4; croak=y ;;
2384 *) echo "Using usrinc $usrinc." >&4 ;;
2386 case "$targethost" in
2387 '') echo "Targethost not defined." >&4; croak=y ;;
2388 *) echo "Using targethost $targethost." >&4
2393 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2396 /*) run=$src/Cross/run
2397 targetmkdir=$src/Cross/mkdir
2399 from=$src/Cross/from
2401 *) pwd=`$test -f ../Configure & cd ..; pwd`
2403 targetmkdir=$pwd/Cross/mkdir
2405 from=$pwd/Cross/from
2408 case "$targetrun" in
2409 '') targetrun=ssh ;;
2414 case "$targetfrom" in
2415 '') targetfrom=scp ;;
2419 from=$from-$targetfrom
2420 case "$targetdir" in
2422 echo "Guessing targetdir $targetdir." >&4
2425 case "$targetuser" in
2427 echo "Guessing targetuser $targetuser." >&4
2430 case "$targetfrom" in
2434 case "$targetrun" in
2446 '') cwd=$targetdir ;;
2450 if $test ! -f \$exe.xok; then
2454 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2457 *) echo "Unknown targetrun '$targetrun'" >&4
2461 case "$targetmkdir" in
2463 cat >$targetmkdir <<EOF
2465 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2467 $chmod a+rx $targetmkdir
2469 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2481 $targetmkdir \`dirname \$f\`
2482 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2485 $targetmkdir $targetdir/\`dirname \$f\`
2486 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2499 $mkdir -p $targetdir/\`dirname \$f\`
2500 $cp \$f $targetdir/\$f || exit 1
2503 $targetmkdir $targetdir/\`dirname \$f\`
2504 $cp \$f $targetdir/\$f || exit 1
2511 *) echo "Unknown targetto '$targetto'" >&4
2515 case "$targetfrom" in
2522 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2527 cp) cat >$from <<EOF
2532 cp $targetdir/\$f . || exit 1
2537 *) echo "Unknown targetfrom '$targetfrom'" >&4
2541 if $test ! -f $run; then
2542 echo "Target 'run' script '$run' not found." >&4
2546 if $test ! -f $to; then
2547 echo "Target 'to' script '$to' not found." >&4
2551 if $test ! -f $from; then
2552 echo "Target 'from' script '$from' not found." >&4
2556 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2560 Using '$run' for remote execution,
2561 and '$from' and '$to'
2562 for remote file transfer.
2568 usecrosscompile='undef'
2573 : see whether [:lower:] and [:upper:] are supported character classes
2575 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2577 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2581 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
2582 # (0xc9 and 0xd1), therefore that is a nice testing point.
2583 if test "X$up" = X -o "X$low" = X; then
2584 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
2590 if test "X$up" = X -o "X$low" = X; then
2591 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
2597 if test "X$up" = X -o "X$low" = X; then
2598 case "`echo IJ | od -x 2>/dev/null`" in
2600 echo "Hey, this might be EBCDIC." >&4
2601 if test "X$up" = X -o "X$low" = X; then
2602 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2603 ij) up='[A-IJ-RS-Z]'
2608 if test "X$up" = X -o "X$low" = X; then
2609 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2619 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
2621 echo "Using $up and $low to convert case." >&4
2624 echo "I don't know how to translate letters from upper to lower case." >&4
2625 echo "Your tr is not acting any way I know of." >&4
2629 : set up the translation script tr, must be called with ./tr of course
2633 '[A-Z][a-z]') exec $tr '$up' '$low';;
2634 '[a-z][A-Z]') exec $tr '$low' '$up';;
2641 : Try to determine whether config.sh was made on this system
2642 case "$config_sh" in
2644 myuname=`$uname -a 2>/dev/null`
2645 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2646 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2647 # because the A-Z/a-z are not consecutive.
2648 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2649 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2650 newmyuname="$myuname"
2652 case "$knowitall" in
2654 if test -f ../config.sh; then
2655 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2656 eval "`grep myuname= ../config.sh`"
2658 if test "X$myuname" = "X$newmyuname"; then
2666 : Get old answers from old config file if Configure was run on the
2667 : same system, otherwise use the hints.
2670 if test -f config.sh; then
2672 rp="I see a config.sh file. Shall I use it to set the defaults?"
2675 n*|N*) echo "OK, I'll ignore it."
2676 mv config.sh config.sh.old
2677 myuname="$newmyuname"
2679 *) echo "Fetching default answers from your old config.sh file..." >&4
2687 : Older versions did not always set $sh. Catch re-use of such
2697 if test ! -f config.sh; then
2700 First time through, eh? I have some defaults handy for some systems
2701 that need some extra help getting the Configure answers right:
2704 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2706 : Half the following guesses are probably wrong... If you have better
2707 : tests or hints, please send them to perlbug@perl.org
2708 : The metaconfig authors would also appreciate a copy...
2709 $test -f /irix && osname=irix
2710 $test -f /xenix && osname=sco_xenix
2711 $test -f /dynix && osname=dynix
2712 $test -f /dnix && osname=dnix
2713 $test -f /lynx.os && osname=lynxos
2714 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2715 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
2716 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2717 $test -f /bin/mips && /bin/mips && osname=mips
2718 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
2719 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
2720 $test -d /usr/apollo/bin && osname=apollo
2721 $test -f /etc/saf/_sactab && osname=svr4
2722 $test -d /usr/include/minix && osname=minix
2723 if $test -d /MachTen -o -d /MachTen_Folder; then
2725 if $test -x /sbin/version; then
2726 osvers=`/sbin/version | $awk '{print $2}' |
2727 $sed -e 's/[A-Za-z]$//'`
2728 elif $test -x /usr/etc/version; then
2729 osvers=`/usr/etc/version | $awk '{print $2}' |
2730 $sed -e 's/[A-Za-z]$//'`
2736 $test -f /sys/posix.dll &&
2737 $test -f /usr/bin/what &&
2738 set X `/usr/bin/what /sys/posix.dll` &&
2739 $test "$3" = UWIN &&
2743 if $test -f $uname; then
2751 umips) osname=umips ;;
2754 [23]100) osname=mips ;;
2755 next*) osname=next ;;
2757 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
2758 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
2761 elif $test -f /etc/kconfig; then
2763 if test "$lns" = "$ln -s"; then
2765 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
2767 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
2774 if test -n "$DJGPP"; then
2783 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
2785 'not found') osvers="$4"."$3" ;;
2786 '<3240'|'<>3240') osvers=3.2.0 ;;
2787 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
2788 '=3250'|'>3250') osvers=3.2.5 ;;
2792 bsd386) osname=bsd386
2795 cygwin*) osname=cygwin
2798 *dc.osx) osname=dcosx
2804 domainos) osname=apollo
2810 dynixptx*) osname=dynixptx
2811 osvers=`echo "$4"|sed 's/^v//'`
2813 freebsd) osname=freebsd
2815 genix) osname=genix ;;
2817 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
2833 netbsd*) osname=netbsd
2836 news-os) osvers="$3"
2838 4*) osname=newsos4 ;;
2842 next*) osname=next ;;
2843 nonstop-ux) osname=nonstopux ;;
2844 POSIX-BC | posix-bc ) osname=posix-bc
2847 powerux | power_ux | powermax_os | powermaxos | \
2848 powerunix | power_unix) osname=powerux
2854 solaris) osname=solaris
2856 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2863 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2867 titanos) osname=titanos
2876 ultrix) osname=ultrix
2879 osf1|mls+) case "$5" in
2882 osvers=`sizer -v | awk '{print $3}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
2885 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
2888 hp*) osname=hp_osf1 ;;
2889 mips) osname=mips_osf1 ;;
2892 unixware) osname=svr5
2898 $2) case "$osname" in
2902 : svr4.x or possibly later
2912 if test -f /stand/boot ; then
2913 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
2914 if test -n "$INITPROG" -a -f "$INITPROG"; then
2915 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
2916 if test -n "$isesix"; then
2924 *) if test -f /etc/systemid; then
2926 set `echo $3 | $sed 's/\./ /g'` $4
2927 if $test -f $src/hints/sco_$1_$2_$3.sh; then
2929 elif $test -f $src/hints/sco_$1_$2.sh; then
2931 elif $test -f $src/hints/sco_$1.sh; then
2936 '') : Still unknown. Probably a generic Sys V.
2945 *) case "$osname" in
2946 '') : Still unknown. Probably a generic BSD.
2954 if test -f /vmunix -a -f $src/hints/news_os.sh; then
2955 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
2956 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
2959 $rm -f UU/kernel.what
2960 elif test -d c:/.; then
2967 case "$targetarch" in
2970 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
2975 : Now look for a hint file osname_osvers, unless one has been
2976 : specified already.
2979 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
2980 : Also try without trailing minor version numbers.
2981 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
2982 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
2983 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
2984 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
2987 *) case "$osvers" in
2990 *) if $test -f $src/hints/$file.sh ; then
2992 elif $test -f $src/hints/$xfile.sh ; then
2994 elif $test -f $src/hints/$xxfile.sh ; then
2996 elif $test -f $src/hints/$xxxfile.sh ; then
2998 elif $test -f $src/hints/$xxxxfile.sh ; then
3000 elif $test -f "$src/hints/${osname}.sh" ; then
3009 if $test -f Policy.sh ; then
3012 none) dflt="Policy" ;;
3013 *) dflt="Policy $dflt" ;;
3018 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3022 if $test -f Policy.sh ; then
3025 There's also a Policy hint file available, which should make the
3026 site-specific (policy) questions easier to answer.
3033 You may give one or more space-separated answers, or "none" if appropriate.
3034 A well-behaved OS will have no hints, so answering "none" or just "Policy"
3035 is a good thing. DO NOT give a wrong version or a wrong OS.
3039 rp="Which of these apply, if any?"
3042 for file in $tans; do
3043 if $test X$file = XPolicy -a -f Policy.sh; then
3045 $cat Policy.sh >> UU/config.sh
3046 elif $test -f $src/hints/$file.sh; then
3047 . $src/hints/$file.sh
3048 $cat $src/hints/$file.sh >> UU/config.sh
3049 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3052 : Give one chance to correct a possible typo.
3053 echo "$file.sh does not exist"
3055 rp="hint to use instead?"
3057 for file in $ans; do
3058 if $test -f "$src/hints/$file.sh"; then
3059 . $src/hints/$file.sh
3060 $cat $src/hints/$file.sh >> UU/config.sh
3061 elif $test X$ans = X -o X$ans = Xnone ; then
3064 echo "$file.sh does not exist -- ignored."
3071 : Remember our hint file for later.
3072 if $test -f "$src/hints/$file.sh" ; then
3082 echo "Fetching default answers from $config_sh..." >&4
3086 cp $config_sh config.sh 2>/dev/null
3096 test "$override" && . ./optdef.sh
3098 : Restore computed paths
3099 for file in $loclist $trylist; do
3100 eval $file="\$_$file"
3105 Configure uses the operating system name and version to set some defaults.
3106 The default value is probably right if the name rings a bell. Otherwise,
3107 since spelling matters for me, either accept the default or answer "none"
3114 ''|' '|none) dflt=none ;;
3115 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3118 *) dflt="$osname" ;;
3120 rp="Operating system name?"
3124 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3130 ''|' '|none) dflt=none ;;
3131 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3132 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3134 ''|' ') dflt=none ;;
3139 *) dflt="$osvers" ;;
3141 rp="Operating system version?"
3151 : who configured the system
3152 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3153 cf_by=`(logname) 2>/dev/null`
3156 cf_by=`(whoami) 2>/dev/null`
3158 "") cf_by=unknown ;;
3162 : set up the script used to warn in case of inconsistency
3169 echo "*** WHOA THERE!!! ***" >&4
3170 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
3171 rp=" Keep the $hint value?"
3174 y) td=$was; tu=$was;;
3178 : function used to set $1 to $val
3179 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
3181 $define$undef) . ./whoa; eval "$var=\$td";;
3182 $undef$define) . ./whoa; eval "$var=\$tu";;
3183 *) eval "$var=$val";;
3186 case "$usethreads" in
3187 $define|true|[yY]*) dflt='y';;
3192 Perl can be built to take advantage of threads on some systems.
3193 To do so, Configure can be run with -Dusethreads.
3195 Note that threading is a highly experimental feature, and
3196 some known race conditions still remain. If you choose to try
3197 it, be very sure to not actually deploy it for production
3198 purposes. README.threads has more details, and is required
3199 reading if you enable threads.
3201 If this doesn't make any sense to you, just accept the default '$dflt'.
3203 rp='Build a threading Perl?'
3206 y|Y) val="$define" ;;
3212 case "$usethreads" in
3216 As of 5.5.640, Perl has two different internal threading implementations,
3217 the 5.005 version (5005threads) and an interpreter-based version
3218 (ithreads) that has one interpreter per thread. Both are very
3219 experimental. This arrangement exists to help developers work out
3220 which one is better.
3222 If you're a casual user, you probably don't want interpreter-threads
3223 at this time. There doesn't yet exist a way to create threads from
3224 within Perl in this model, i.e., "use Thread;" will NOT work.
3226 : Default to ithreads unless overridden on command line or with
3229 case "$use5005threads" in
3230 $define|true|[yY]*) dflt='n';;
3232 case "$useithreads" in
3233 $undef|false|[nN]*) dflt='n';;
3235 rp='Use interpreter-based ithreads?'
3238 y|Y) val="$define" ;;
3243 : Now set use5005threads to the opposite value.
3244 case "$useithreads" in
3245 $define) val="$undef" ;;
3252 useithreads="$undef"
3253 use5005threads="$undef"
3257 case "$useithreads$use5005threads" in
3261 You cannot have both the ithreads and the 5.005 threads enabled
3262 at the same time. Disabling the 5.005 threads since they are
3263 much less stable than the ithreads.
3266 use5005threads="$undef"
3270 case "$d_oldpthreads" in
3271 '') : Configure tests would be welcome here. For now, assume undef.
3273 *) val="$d_oldpthreads" ;;
3279 case "$usethreads" in
3280 "$define"|true|[yY]*)
3281 : Look for a hint-file generated 'call-back-unit'. If the
3282 : user has specified that a threading perl is to be built,
3283 : we may need to set or change some other defaults.
3284 if $test -f usethreads.cbu; then
3285 echo "Your platform has some specific hints for threaded builds, using them..."
3289 (Your platform doesn't have any specific hints for threaded builds.
3290 Assuming POSIX threads, then.)
3298 Perl can be built so that multiple Perl interpreters can coexist
3299 within the same Perl executable.
3302 case "$useithreads" in
3305 This multiple interpreter support is required for interpreter-based threads.
3309 *) case "$usemultiplicity" in
3310 $define|true|[yY]*) dflt='y';;
3314 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
3315 rp='Build Perl for multiplicity?'
3318 y|Y) val="$define" ;;
3327 case "$usemorebits" in
3328 "$define"|true|[yY]*)
3329 use64bitint="$define"
3330 uselongdouble="$define"
3331 usemorebits="$define"
3333 *) usemorebits="$undef"
3337 : make some quick guesses about what we are up against
3339 $echo $n "Hmm... $c"
3349 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
3350 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
3352 echo "Looks kind of like an OSF/1 system, but we'll see..."
3354 elif test `echo abc | $tr a-z A-Z` = Abc ; then
3355 xxx=`./loc addbib blurfl $pth`
3356 if $test -f $xxx; then
3357 echo "Looks kind of like a USG system with BSD features, but we'll see..."
3361 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
3362 echo "Looks kind of like an extended USG system, but we'll see..."
3364 echo "Looks kind of like a USG system, but we'll see..."
3368 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
3369 echo "Looks kind of like a BSD system, but we'll see..."
3373 echo "Looks kind of like a Version 7 system, but we'll see..."
3376 case "$eunicefix" in
3379 There is, however, a strange, musty smell in the air that reminds me of
3380 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
3384 : it so happens the Eunice I know will not run shell scripts in Unix format
3388 echo "Congratulations. You aren't running Eunice."
3392 : Detect OS2. The p_ variable is set above in the Head.U unit.
3393 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
3394 : semicolon as a patch separator
3399 I have the feeling something is not exactly right, however...don't tell me...
3400 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
3401 (Or you may be running DOS with DJGPP.)
3406 if test -f /xenix; then
3407 echo "Actually, this looks more like a XENIX system..."
3412 echo "It's not Xenix..."
3417 if test -f /venix; then
3418 echo "Actually, this looks more like a VENIX system..."
3425 echo "Nor is it Venix..."
3428 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3429 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3436 rp="Use which C compiler?"
3439 : Look for a hint-file generated 'call-back-unit'. Now that the
3440 : user has specified the compiler, we may need to set or change some
3442 if $test -f cc.cbu; then
3448 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3454 printf("%s\n", __VERSION__);
3456 printf("%s\n", "1");
3462 if $cc -o try $ccflags $ldflags try.c; then
3463 gccversion=`$run ./try`
3464 case "$gccversion" in
3465 '') echo "You are not using GNU cc." ;;
3466 *) echo "You are using GNU cc $gccversion."
3472 echo "*** WHOA THERE!!! ***" >&4
3473 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3474 case "$knowitall" in
3476 echo " You'd better start hunting for one and let me know about it." >&4
3482 case "$gccversion" in
3483 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3485 case "$gccversion" in
3486 '') gccosandvers='' ;;
3487 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
3488 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
3490 case "$gccosandvers" in
3491 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
3492 $osname$osvers) ;; # looking good
3493 $osname*) cat <<EOM >&4
3495 *** WHOA THERE!!! ***
3497 Your gcc has not been compiled for the exact release of
3498 your operating system ($gccosandvers versus $osname$osvers).
3500 In general it is a good idea to keep gcc synchronized with
3501 the operating system because otherwise serious problems
3502 may ensue when trying to compile software, like Perl.
3504 I'm trying to be optimistic here, though, and will continue.
3505 If later during the configuration and build icky compilation
3506 problems appear (headerfile conflicts being the most common
3507 manifestation), I suggest reinstalling the gcc to match
3508 your operating system release.
3512 *) gccosandvers='' ;; # failed to parse, better be silent
3520 case "$gccversion" in
3522 *) case "$ccflags" in
3524 *) ccflags="$ccflags -Wall" ;;
3529 : decide how portable to be. Allow command line overrides.
3530 case "$d_portable" in
3532 *) d_portable="$define" ;;
3535 : set up shell script to do ~ expansion
3541 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3544 if $test -f /bin/csh; then
3545 /bin/csh -f -c "glob \$1"
3550 name=\`$expr x\$1 : '..\([^/]*\)'\`
3551 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3552 if $test ! -d "\$dir"; then
3554 echo "\$me: can't locate home directory for: \$name" >&2
3559 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3575 : now set up to get a file name
3579 cat <<'EOSC' >>getfile
3595 expr $fn : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3596 fn=`echo $fn | sed 's/(.*)//'`
3602 loc_file=`expr $fn : '.*:\(.*\)'`
3603 fn=`expr $fn : '\(.*\):.*'`
3611 */*) fullpath=true;;
3620 *e*) exp_file=true;;
3623 *p*) nopath_ok=true;;
3628 *d*) type='Directory';;
3629 *l*) type='Locate';;
3634 Locate) what='File';;
3639 case "$d_portable" in
3647 while test "$type"; do
3652 true) rp="$rp (~name ok)";;
3655 if test -f UU/getfile.ok && \
3656 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3675 value=`UU/filexp $ans`
3678 if test "$ans" != "$value"; then
3679 echo "(That expands to $value on this system.)"
3693 /*) value="$ansexp" ;;
3694 [a-zA-Z]:/*) value="$ansexp" ;;
3699 echo "I shall only accept a full path name, as in /bin/ls." >&4
3700 echo "Use a ! shell escape if you wish to check pathnames." >&4
3703 echo "Please give a full path name, starting with slash." >&4
3706 echo "Note that using ~name is ok provided it expands well." >&4
3719 for fp in $gfpth; do
3720 if test "X$fp" = X.; then
3725 if test -f "$pf"; then
3727 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3729 echo "($value is not a plain file, but that's ok.)"
3732 if test X"$type" = X; then
3739 for fp in $gfpth; do
3740 if test "X$fp" = X.; then
3745 direxp="$fp/$ansexp"
3747 if test -d "$direxp"; then
3755 if test -d "$ansexp"; then
3756 echo "(Looking for $loc_file in directory $value.)"
3757 value="$value/$loc_file"
3758 ansexp="$ansexp/$loc_file"
3760 if test -f "$ansexp"; then
3763 case "$nopath_ok" in
3764 true) case "$value" in
3766 *) echo "Assuming $value will be in people's path."
3782 if test "$fastread" = yes; then
3787 rp="$what $value doesn't exist. Use that name anyway?"
3806 test "X$gfpthkeep" != Xy && gfpth=""
3809 : What should the include directory be ?
3811 $echo $n "Hmm... $c"
3815 if $test -f /bin/mips && /bin/mips; then
3816 echo "Looks like a MIPS system..."
3817 $cat >usr.c <<'EOCP'
3818 #ifdef SYSTYPE_BSD43
3822 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3823 dflt='/bsd43/usr/include'
3827 mips_type='System V'
3829 $rm -f usr.c usr.out
3830 echo "and you're compiling with the $mips_type compiler and libraries."
3834 echo "Doesn't look like a MIPS system."
3844 case "$xxx_prompt" in
3847 rp='Where are the include files you want to use?'
3855 : see how we invoke the C preprocessor
3857 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3858 cat <<'EOT' >testcpp.c
3864 if test ! -f cppstdin; then
3865 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
3866 # AIX cc -E doesn't show the absolute headerfile
3867 # locations but we'll cheat by using the -M flag.
3868 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
3870 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3873 echo "Keeping your $hint cppstdin wrapper."
3876 wrapper=`pwd`/cppstdin
3880 if $test "X$cppstdin" != "X" && \
3881 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3882 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3884 echo "You used to use $cppstdin $cppminus so we'll use that again."
3886 '') echo "But let's see if we can live without a wrapper..." ;;
3888 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3889 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3891 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3894 echo "(However, $cpprun $cpplast does not work, let's see...)"
3902 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3909 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3910 $cc -E <testcpp.c >testcpp.out 2>&1; \
3911 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3912 echo "Yup, it does."
3915 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
3916 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3917 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3918 echo "Yup, it does."
3921 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
3922 $cc -P <testcpp.c >testcpp.out 2>&1; \
3923 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3924 echo "Yipee, that works!"
3927 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
3928 $cc -P - <testcpp.c >testcpp.out 2>&1; \
3929 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3930 echo "At long last!"
3933 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
3934 $cpp <testcpp.c >testcpp.out 2>&1; \
3935 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3939 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
3940 $cpp - <testcpp.c >testcpp.out 2>&1; \
3941 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3942 echo "Hooray, it works! I was beginning to wonder."
3945 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
3946 $wrapper <testcpp.c >testcpp.out 2>&1; \
3947 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3953 rp="No dice. I can't find a C preprocessor. Name one:"
3957 $x_cpp <testcpp.c >testcpp.out 2>&1
3958 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3959 echo "OK, that will do." >&4
3961 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
3976 echo "Perhaps can we force $cc -E using a wrapper..."
3977 if $wrapper <testcpp.c >testcpp.out 2>&1; \
3978 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3984 echo "Nope, we'll have to live without it..."
3998 "$wrapper"|'cppstdin') ;;
3999 *) $rm -f $wrapper;;
4001 $rm -f testcpp.c testcpp.out
4003 : Set private lib path
4006 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4011 '') dlist="$loclibpth $plibpth $glibpth";;
4012 *) dlist="$libpth";;
4015 : Now check and see which directories actually exist, avoiding duplicates
4019 if $test -d $xxx; then
4022 *) libpth="$libpth $xxx";;
4028 Some systems have incompatible or broken versions of libraries. Among
4029 the directories listed in the question below, please remove any you
4030 know not to be holding relevant libraries, and add any that are needed.
4031 Say "none" for none.
4042 rp="Directories to use for library searches?"
4049 : compute shared library extension
4052 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4062 On some systems, shared libraries may be available. Answer 'none' if
4063 you want to suppress searching of shared libraries for the remainder
4064 of this configuration.
4067 rp='What is the file extension used for shared libraries?'
4071 : Define several unixisms.
4072 : Hints files or command line option can be used to override them.
4073 : The convoluted testing is in case hints files set either the old
4076 '') case "$exe_ext" in
4078 *) _exe="$exe_ext" ;;
4083 '') case "$lib_ext" in
4090 '') case "$obj_ext" in
4097 '') case "$path_sep" in
4108 : Which makefile gets called first. This is used by make depend.
4109 case "$firstmakefile" in
4110 '') firstmakefile='makefile';;
4114 $define|true|[yY]*) dflt='y';;
4119 Perl can be built to use the SOCKS proxy protocol library. To do so,
4120 Configure must be run with -Dusesocks. If you use SOCKS you also need
4121 to use the PerlIO abstraction layer, this will be implicitly selected.
4123 If this doesn't make any sense to you, just accept the default '$dflt'.
4125 rp='Build Perl for SOCKS?'
4128 y|Y) val="$define" ;;
4135 $define|true|[yY]*) useperlio="$define";;
4138 : Looking for optional libraries
4140 echo "Checking for optional libraries..." >&4
4145 case "$libswanted" in
4146 '') libswanted='c_s';;
4149 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4155 for thisdir in $libpth $xlibpth; do
4156 test -d $thisdir && libspath="$libspath $thisdir"
4158 for thislib in $libswanted; do
4159 for thisdir in $libspath; do
4161 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4162 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|tail -1`
4163 $test -f "$xxx" && eval $libscheck
4164 $test -f "$xxx" && libstyle=shared
4166 if test ! -f "$xxx"; then
4167 xxx=$thisdir/lib$thislib.$so
4168 $test -f "$xxx" && eval $libscheck
4169 $test -f "$xxx" && libstyle=shared
4171 if test ! -f "$xxx"; then
4172 xxx=$thisdir/lib$thislib$_a
4173 $test -f "$xxx" && eval $libscheck
4174 $test -f "$xxx" && libstyle=static
4176 if test ! -f "$xxx"; then
4177 xxx=$thisdir/$thislib$_a
4178 $test -f "$xxx" && eval $libscheck
4179 $test -f "$xxx" && libstyle=static
4181 if test ! -f "$xxx"; then
4182 xxx=$thisdir/lib${thislib}_s$_a
4183 $test -f "$xxx" && eval $libscheck
4184 $test -f "$xxx" && libstyle=static
4185 $test -f "$xxx" && thislib=${thislib}_s
4187 if test ! -f "$xxx"; then
4188 xxx=$thisdir/Slib$thislib$_a
4189 $test -f "$xxx" && eval $libscheck
4190 $test -f "$xxx" && libstyle=static
4192 if $test -f "$xxx"; then
4194 shared) echo "Found -l$thislib (shared)." ;;
4195 static) echo "Found -l$thislib." ;;
4196 *) echo "Found -l$thislib ($libstyle)." ;;
4200 *) dflt="$dflt -l$thislib"
4201 libsfound="$libsfound $xxx"
4203 libsfiles="$libsfiles $yyy"
4204 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4205 case " $libsdirs " in
4207 *) libsdirs="$libsdirs $yyy" ;;
4214 if $test ! -f "$xxx"; then
4215 echo "No -l$thislib."
4226 ' '|'') dflt='none';;
4231 In order to compile $package on your machine, a number of libraries
4232 are usually needed. Include any other special libraries here as well.
4233 Say "none" for none. The default list is almost always right.
4237 rp="What libraries to use?"
4244 : determine optimization, if desired, or use for debug flag also
4246 ' '|$undef) dflt='none';;
4248 *) dflt="$optimize";;
4252 By default, $package compiles with the -O flag to use the optimizer.
4253 Alternately, you might want to use the symbolic debugger, which uses
4254 the -g flag (on traditional Unix systems). Either flag can be
4255 specified here. To use neither flag, specify the word "none".
4258 rp="What optimizer/debugger flag should be used?"
4262 'none') optimize=" ";;
4266 : We will not override a previous value, but we might want to
4267 : augment a hint file
4269 default|recommended)
4270 case "$gccversion" in
4271 1*) dflt='-fpcc-struct-return' ;;
4274 *-g*) dflt="$dflt -DDEBUGGING";;
4276 case "$gccversion" in
4277 2*) if test -d /etc/conf/kconfig.d &&
4278 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4284 case "$gccversion" in
4288 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
4289 echo 'int main(void) { return 0; }' > gcctest.c
4290 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
4291 echo "Yes, it does." 2>&1
4294 echo "Leaving current flags $ccflags alone." 2>&1
4296 *) dflt="$dflt -fno-strict-aliasing" ;;
4299 echo "Nope, it doesn't, but that's ok." 2>&1
4306 case "$mips_type" in
4307 *BSD*|'') inclwanted="$locincpth $usrinc";;
4308 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4310 for thisincl in $inclwanted; do
4311 if $test -d $thisincl; then
4312 if $test x$thisincl != x$usrinc; then
4314 *" -I$thisincl "*);;
4315 *) dflt="$dflt -I$thisincl ";;
4321 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4323 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4331 *) dflt="$dflt -D$2";;
4335 set signal.h LANGUAGE_C; eval $inctest
4339 ccflags="$ccflags -DSOCKS"
4344 default|recommended) dflt="$ccflags $dflt" ;;
4345 *) dflt="$ccflags";;
4354 Your C compiler may want other flags. For this question you should include
4355 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4356 but you should NOT include libraries or ld flags like -lwhatever. If you
4357 want $package to honor its debug switch, you should include -DDEBUGGING here.
4358 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4360 To use no flags, specify the word "none".
4366 rp="Any additional cc flags?"
4373 : the following weeds options from ccflags that are of no interest to cpp
4375 '') cppflags="$ccflags" ;;
4376 *) cppflags="$cppflags $ccflags" ;;
4378 case "$gccversion" in
4379 1*) cppflags="$cppflags -D__GNUC__"
4381 case "$mips_type" in
4383 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4389 echo "Let me guess what the preprocessor flags are..." >&4
4403 *) ftry="$previous $flag";;
4405 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4406 >cpp1.out 2>/dev/null && \
4407 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4408 >cpp2.out 2>/dev/null && \
4409 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4410 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4412 cppflags="$cppflags $ftry"
4422 *-*) echo "They appear to be: $cppflags";;
4424 $rm -f cpp.c cpp?.out
4428 : flags used in final linking phase
4430 '') if ./venix; then
4436 *-posix*) dflt="$dflt -posix" ;;
4439 *) dflt="$ldflags";;
4442 : Try to guess additional flags to pick up local libraries.
4443 for thislibdir in $libpth; do
4444 case " $loclibpth " in
4447 *"-L$thislibdir "*) ;;
4448 *) dflt="$dflt -L$thislibdir" ;;
4460 Your C linker may need flags. For this question you should
4461 include -L/whatever and any other flags used by the C linker, but you
4462 should NOT include libraries like -lwhatever.
4464 Make sure you include the appropriate -L/path flags if your C linker
4465 does not normally search all of the directories you specified above,
4468 To use no flags, specify the word "none".
4472 rp="Any additional ld flags (NOT including libraries)?"
4478 rmlist="$rmlist pdp11"
4482 echo "Checking your choice of C compiler and flags for coherency..." >&4
4483 $cat > try.c <<'EOF'
4485 int main() { printf("Ok\n"); exit(0); }
4487 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
4489 $cat >try.msg <<'EOM'
4490 I've tried to compile and run the following simple program:
4493 $cat try.c >> try.msg
4495 $cat >> try.msg <<EOM
4502 and I got the following output:
4506 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
4507 if $sh -c "$run ./try" >>try.msg 2>&1; then
4511 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4514 cat >> try.msg <<'EOQS'
4515 If $libs contains -lsfio, and sfio is mis-configured, then it
4516 sometimes (apparently) runs and exits with a 0 status, but with no
4517 output! It may have to do with sfio's use of _exit vs. exit.
4520 rp="You have a big problem. Shall I abort Configure"
4527 echo "The program compiled OK, but exited with status $?." >>try.msg
4528 rp="You have a problem. Shall I abort Configure"
4532 echo "I can't compile the test program." >>try.msg
4533 rp="You have a BIG problem. Shall I abort Configure"
4539 case "$knowitall" in
4541 echo "(The supplied flags or libraries might be incorrect.)"
4549 *) echo "Ok. Stopping Configure." >&4
4554 n) echo "OK, that should do.";;
4556 $rm -f try try.* core
4558 : define a shorthand compile call
4562 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
4563 : define a shorthand compile call for compilations that should be ok.
4567 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
4569 : check for lengths of integral types
4573 echo "Checking to see how big your integers are..." >&4
4574 $cat >try.c <<'EOCP'
4578 printf("intsize=%d;\n", (int)sizeof(int));
4579 printf("longsize=%d;\n", (int)sizeof(long));
4580 printf("shortsize=%d;\n", (int)sizeof(short));
4585 if eval $compile_ok && $run ./try > /dev/null; then
4587 echo "Your integers are $intsize bytes long."
4588 echo "Your long integers are $longsize bytes long."
4589 echo "Your short integers are $shortsize bytes long."
4593 Help! I can't compile and run the intsize test program: please enlighten me!
4594 (This is probably a misconfiguration in your system or libraries, and
4595 you really ought to fix it. Still, I'll try anyway.)
4599 rp="What is the size of an integer (in bytes)?"
4603 rp="What is the size of a long integer (in bytes)?"
4607 rp="What is the size of a short integer (in bytes)?"
4615 : check for void type
4617 echo "Checking to see how well your C compiler groks the void type..." >&4
4618 case "$voidflags" in
4620 $cat >try.c <<'EOCP'
4626 extern void moo(); /* function returning void */
4627 void (*goo)(); /* ptr to func returning void */
4629 void *hue; /* generic ptr */
4642 int main() { sub(); }
4644 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
4645 voidflags=$defvoidused
4646 echo "Good. It appears to support void to the level $package wants.">&4
4647 if $contains warning .out >/dev/null 2>&1; then
4648 echo "However, you might get some warnings that look like this:"
4652 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
4653 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
4654 echo "It supports 1..."
4655 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
4656 echo "It also supports 2..."
4657 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
4659 echo "And it supports 4 but not 8 definitely."
4661 echo "It doesn't support 4..."
4662 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
4664 echo "But it supports 8."
4667 echo "Neither does it support 8."
4671 echo "It does not support 2..."
4672 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
4674 echo "But it supports 4 and 8."
4676 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
4678 echo "And it supports 4 but has not heard about 8."
4680 echo "However it supports 8 but not 4."
4685 echo "There is no support at all for void."
4690 case "$voidflags" in
4693 Support flag bits are:
4694 1: basic void declarations.
4695 2: arrays of pointers to functions returning void.
4696 4: operations between pointers to and addresses of void functions.
4697 8: generic void pointers.
4700 rp="Your void support flags add up to what?"
4707 : check for length of pointer
4711 echo "Checking to see how big your pointers are..." >&4
4712 if test "$voidflags" -gt 7; then
4713 echo '#define VOID_PTR char *' > try.c
4715 echo '#define VOID_PTR void *' > try.c
4717 $cat >>try.c <<'EOCP'
4721 printf("%d\n", (int)sizeof(VOID_PTR));
4726 if eval $compile_ok; then
4727 ptrsize=`$run ./try`
4728 echo "Your pointers are $ptrsize bytes long."
4731 echo "(I can't seem to compile the test program. Guessing...)" >&4
4732 rp="What is the size of a pointer (in bytes)?"
4740 : check for long long
4742 echo "Checking to see if you have long long..." >&4
4743 echo 'int main() { long long x = 7; return 0; }' > try.c
4745 if eval $compile; then
4747 echo "You have long long."
4750 echo "You do not have long long."
4756 : check for length of long long
4757 case "${d_longlong}${longlongsize}" in
4760 echo "Checking to see how big your long longs are..." >&4
4761 $cat >try.c <<'EOCP'
4765 printf("%d\n", (int)sizeof(long long));
4770 if eval $compile_ok; then
4771 longlongsize=`$run ./try`
4772 echo "Your long longs are $longlongsize bytes long."
4776 echo "(I can't seem to compile the test program. Guessing...)"
4777 rp="What is the size of a long long (in bytes)?"
4781 if $test "X$longsize" = "X$longlongsize"; then
4782 echo "(That isn't any different from an ordinary long.)"
4788 : determine filename position in cpp output
4790 echo "Computing filename position in cpp output for #include directives..." >&4
4791 echo '#include <stdio.h>' > foo.c
4794 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
4795 $grep '^[ ]*#.*stdio\.h' | \
4796 while read cline; do
4799 while $test \$# -gt 0; do
4800 if $test -r \`echo \$1 | $tr -d '"'\`; then
4805 pos=\`expr \$pos + 1\`
4817 *) pos="${fieldn}th";;
4819 echo "Your cpp writes the filename in the $pos field of the line."
4821 : locate header file
4826 for usrincdir in $usrinc
4828 if test -f \$usrincdir/\$wanted; then
4829 echo "\$usrincdir/\$wanted"
4833 awkprg='{ print \$$fieldn }'
4834 echo "#include <\$wanted>" > foo\$\$.c
4835 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
4836 $grep "^[ ]*#.*\$wanted" | \
4837 while read cline; do
4838 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
4840 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
4841 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
4846 # status = 0: grep returned 0 lines, case statement not executed
4847 # status = 1: headerfile found
4848 # status = 2: while loop executed, no headerfile found
4852 if test \$status -eq 1; then
4859 : define an alternate in-header-list? function
4860 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
4861 cont=true; xxf="echo \"<\$1> found.\" >&4";
4862 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
4863 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
4865 case $# in 4) instead=instead;; *) instead="at last";; esac;
4866 while $test "$cont"; do
4868 var=$2; eval "was=\$$2";
4869 if $test "$xxx" && $test -r "$xxx";
4871 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
4874 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
4875 set $yyy; shift; shift; yyy=$@;
4876 case $# in 0) cont="";;
4877 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
4878 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
4879 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
4880 xxnf="echo \"there is no <\$1>, ...\" >&4";;
4884 do set $yyy; var=$2; eval "was=\$$2";
4885 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
4886 set $yyy; shift; shift; yyy=$@;
4889 : see if inttypes.h is available
4890 : we want a real compile instead of Inhdr because some systems
4891 : have an inttypes.h which includes non-existent headers
4894 #include <inttypes.h>
4896 static int32_t foo32 = 0x12345678;
4900 if eval $compile; then
4901 echo "<inttypes.h> found." >&4
4904 echo "<inttypes.h> NOT found." >&4
4913 echo "Checking to see if you have int64_t..." >&4
4915 #include <sys/types.h>
4916 #$i_inttypes I_INTTYPES
4918 #include <inttypes.h>
4920 int main() { int64_t x = 7; }
4923 if eval $compile; then
4925 echo "You have int64_t."
4928 echo "You do not have int64_t."
4936 echo "Checking which 64-bit integer type we could use..." >&4
4942 val='"unsigned int"'
4947 *) case "$longsize" in
4951 val='"unsigned long"'
4956 *) case "$d_longlong:$longlongsize" in
4961 val='"unsigned long long"'
4966 *) case "$d_int64_t" in
4985 '') echo "Alas, no 64-bit integer types in sight." >&4
4988 *) echo "We could use '$quadtype' for 64-bit integers." >&4
4994 case "$uselonglong" in
4995 "$define"|true|[yY]*)
4998 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5000 use64bitint="$define"
5003 case "$use64bits" in
5004 "$define"|true|[yY]*)
5007 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5009 use64bitint="$define"
5012 case "$use64bitints" in
5013 "$define"|true|[yY]*)
5016 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5018 use64bitint="$define"
5021 case "$use64bitsint" in
5022 "$define"|true|[yY]*)
5025 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5027 use64bitint="$define"
5030 case "$uselonglongs" in
5031 "$define"|true|[yY]*)
5034 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5036 use64bitint="$define"
5039 case "$use64bitsall" in
5040 "$define"|true|[yY]*)
5043 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5045 use64bitall="$define"
5050 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5052 case "$use64bitall" in
5053 "$define"|true|[yY]*) use64bitint="$define" ;;
5059 You have natively 64-bit long integers.
5063 *) case "$use64bitint" in
5064 "$define"|true|[yY]*) dflt='y';;
5073 Perl can be built to take advantage of 64-bit integer types
5074 on some systems. To do so, Configure can be run with -Duse64bitint.
5075 Choosing this option will most probably introduce binary incompatibilities.
5077 If this doesn't make any sense to you, just accept the default '$dflt'.
5078 (The default has been chosen based on your configuration.)
5080 rp='Try to use 64-bit integers, if available?'
5083 [yY]*) val="$define" ;;
5091 case "$use64bitall" in
5092 "$define"|true|[yY]*) dflt='y' ;;
5093 *) case "$longsize" in
5101 You may also choose to try maximal 64-bitness. It means using as much
5102 64-bitness as possible on the platform. This in turn means even more
5103 binary incompatibilities. On the other hand, your platform may not
5104 have any more 64-bitness available than what you already have chosen.
5106 If this doesn't make any sense to you, just accept the default '$dflt'.
5107 (The default has been chosen based on your configuration.)
5109 rp='Try to use maximal 64-bit support, if available?'
5112 [yY]*) val="$define" ;;
5117 case "$use64bitall" in
5119 case "$use64bitint" in
5123 Since you have chosen a maximally 64-bit build, I'm also turning on
5124 the use of 64-bit integers.
5126 use64bitint="$define" ;;
5131 case "$use64bitall" in
5132 "$define"|true|[yY]*)
5136 *** You have chosen a maximally 64-bit build, but your pointers
5137 *** are only 4 bytes wide, disabling maximal 64-bitness.
5140 use64bitall="$undef"
5141 case "$use64bitint" in
5142 "$define"|true|[yY]*) ;;
5145 *** Downgrading from maximal 64-bitness to using 64-bit integers.
5148 use64bitint="$define"
5156 case "$use64bitint" in
5157 "$define"|true|[yY]*)
5158 : Look for a hint-file generated 'call-back-unit'. If the
5159 : user has specified that a 64-bit perl is to be built,
5160 : we may need to set or change some other defaults.
5161 if $test -f use64bitint.cbu; then
5162 echo "Your platform has some specific hints for 64-bit integers, using them..."
5166 4) case "$archname64" in
5167 '') archname64=64int ;;
5174 case "$use64bitall" in
5175 "$define"|true|[yY]*)
5176 : Look for a hint-file generated 'call-back-unit'. If the
5177 : user has specified that a maximally 64-bit perl is to be built,
5178 : we may need to set or change some other defaults.
5179 if $test -f use64bitall.cbu; then
5180 echo "Your platform has some specific hints for 64-bit builds, using them..."
5184 4) case "$archname64" in
5185 ''|64int) archname64=64all ;;
5193 echo "Checking for GNU C Library..." >&4
5206 if eval $compile_ok && $run ./try; then
5208 echo "You are using the GNU C Library"
5211 echo "You are not using the GNU C Library"
5217 : see if nm is to be used to determine whether a symbol is defined or not
5221 case "$d_gnulibc" in
5224 echo "nm probably won't work on the GNU C Library." >&4
5230 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
5232 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
5233 echo "'nm' won't be sufficient on this sytem." >&4
5239 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
5240 if $test $dflt -gt 20; then
5250 true|$define) dflt=y;;
5257 I can use $nm to extract the symbols from your C libraries. This
5258 is a time consuming task which may generate huge output on the disk (up
5259 to 3 megabytes) but that should make the symbols extraction faster. The
5260 alternative is to skip the 'nm' extraction part and to compile a small
5261 test program instead to determine whether each symbol is present. If
5262 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
5263 this may be the best solution.
5265 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
5268 rp="Shall I use $nm to extract C symbols from the libraries?"
5271 [Nn]*) usenm=false;;
5280 : nm options which may be necessary
5282 '') if $test -f /mach_boot; then
5284 elif $test -d /usr/ccs/lib; then
5285 nm_opt='-p' # Solaris (and SunOS?)
5286 elif $test -f /dgux; then
5288 elif $test -f /lib64/rld; then
5289 nm_opt='-p' # 64-bit Irix
5295 : nm options which may be necessary for shared libraries but illegal
5296 : for archive libraries. Thank you, Linux.
5297 case "$nm_so_opt" in
5298 '') case "$myuname" in
5300 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
5301 nm_so_opt='--dynamic'
5310 : get list of predefined functions in a handy place
5315 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
5321 *) for thislib in $libs; do
5324 : Handle C library specially below.
5327 thislib=`echo $thislib | $sed -e 's/^-l//'`
5328 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
5330 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
5332 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
5334 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
5336 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
5338 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
5340 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
5345 libnames="$libnames $try"
5347 *) libnames="$libnames $thislib" ;;
5356 for xxx in $libpth; do
5357 $test -r $1 || set $xxx/libc.$so
5358 : The messy sed command sorts on library version numbers.
5360 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
5361 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
5363 s/[0-9][0-9]*/0000&/g
5364 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
5367 $sort | $sed -e 's/^.* //'`
5370 $test -r $1 || set /usr/ccs/lib/libc.$so
5371 $test -r $1 || set /lib/libsys_s$_a
5377 if $test -r "$1"; then
5378 echo "Your (shared) C library seems to be in $1."
5380 elif $test -r /lib/libc && $test -r /lib/clib; then
5381 echo "Your C library seems to be in both /lib/clib and /lib/libc."
5383 libc='/lib/clib /lib/libc'
5384 if $test -r /lib/syslib; then
5385 echo "(Your math library is in /lib/syslib.)"
5386 libc="$libc /lib/syslib"
5388 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5389 echo "Your C library seems to be in $libc, as you said before."
5390 elif $test -r $incpath/usr/lib/libc$_a; then
5391 libc=$incpath/usr/lib/libc$_a;
5392 echo "Your C library seems to be in $libc. That's fine."
5393 elif $test -r /lib/libc$_a; then
5395 echo "Your C library seems to be in $libc. You're normal."
5397 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
5399 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
5400 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
5401 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
5403 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5405 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5408 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
5410 if $test -r "$tans"; then
5411 echo "Your C library seems to be in $tans, of all places."
5417 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5421 If the guess above is wrong (which it might be if you're using a strange
5422 compiler, or your machine supports multiple models), you can override it here.
5427 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
5429 I can't seem to find your C library. I've looked in the following places:
5432 $sed 's/^/ /' libpath
5435 None of these seems to contain your C library. I need to get its name...
5440 rp='Where is your C library?'
5445 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
5446 set X `cat libnames`
5449 case $# in 1) xxx=file; esac
5450 echo "Extracting names from the following $xxx for later perusal:" >&4
5452 $sed 's/^/ /' libnames >&4
5454 $echo $n "This may take a while...$c" >&4
5458 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
5459 *) $nm $nm_opt $file 2>/dev/null;;
5464 $grep fprintf libc.tmp > libc.ptf
5465 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
5466 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
5468 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
5470 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5472 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
5474 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5476 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
5478 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5480 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
5482 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5484 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
5486 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5488 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
5490 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5492 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
5493 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
5495 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5497 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
5499 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5501 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
5503 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5505 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
5507 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5509 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
5511 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5513 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
5515 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5517 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
5519 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5521 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
5523 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5526 $nm -p $* 2>/dev/null >libc.tmp
5527 $grep fprintf libc.tmp > libc.ptf
5528 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
5529 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
5535 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
5537 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
5538 for thisname in $libnames $libc; do
5539 $ar t $thisname >>libc.tmp
5541 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
5543 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
5544 # Repeat libc to extract forwarders to DLL entries too
5545 for thisname in $libnames $libc; do
5546 $ar tv $thisname >>libc.tmp
5547 # Revision 50 of EMX has bug in $ar.
5548 # it will not extract forwarders to DLL entries
5549 # Use emximp which will extract exactly them.
5550 emximp -o tmp.imp $thisname \
5552 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
5553 < tmp.imp >>libc.tmp
5556 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
5559 echo "$ar didn't seem to work right." >&4
5560 echo "Maybe this is a Cray...trying bld instead..." >&4
5561 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
5563 for thisname in $libnames; do
5565 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
5566 $ar t $thisname >>libc.tmp
5570 echo "That didn't work either. Giving up." >&4
5577 if $test -f /lib/syscalls.exp; then
5579 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
5580 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' /lib/syscalls.exp >>libc.list
5584 $rm -f libnames libpath
5586 : is a C symbol defined?
5589 -v) tf=libc.tmp; tc=""; tdc="";;
5590 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
5591 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
5594 case "$reuseval-$4" in
5596 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
5602 if $contains $tlook $tf >/dev/null 2>&1;
5607 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
5608 if $cc -o t $optimize $ccflags $ldflags t.c $libs >/dev/null 2>&1;
5616 $define) tval=true;;
5622 : define an is-in-libc? function
5623 inlibc='echo " "; td=$define; tu=$undef;
5624 sym=$1; var=$2; eval "was=\$$2";
5626 case "$reuseval$was" in
5636 echo "$sym() found." >&4;
5637 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
5639 echo "$sym() NOT found." >&4;
5640 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
5644 $define) echo "$sym() found." >&4;;
5645 *) echo "$sym() NOT found." >&4;;
5649 : see if sqrtl exists
5654 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
5657 case "$uselongdouble" in
5658 $define|true|[yY]*) dflt='y';;
5663 Perl can be built to take advantage of long doubles which
5664 (if available) may give more accuracy and range for floating point numbers.
5666 If this doesn't make any sense to you, just accept the default '$dflt'.
5668 rp='Try to use long doubles if available?'
5671 y|Y) val="$define" ;;
5677 case "$uselongdouble" in
5678 true|[yY]*) uselongdouble="$define" ;;
5681 case "$uselongdouble" in
5683 : Look for a hint-file generated 'call-back-unit'. If the
5684 : user has specified that long doubles should be used,
5685 : we may need to set or change some other defaults.
5686 if $test -f uselongdouble.cbu; then
5687 echo "Your platform has some specific hints for long doubles, using them..."
5688 . ./uselongdouble.cbu
5691 (Your platform doesn't have any specific hints for long doubles.)
5697 case "$uselongdouble:$d_sqrtl" in
5701 *** You requested the use of long doubles but you do not seem to have
5702 *** the mathematic functions for long doubles. I'm disabling the use
5703 *** of long doubles.
5706 uselongdouble=$undef
5710 : check for length of double
5712 case "$doublesize" in
5714 echo "Checking to see how big your double precision numbers are..." >&4
5715 $cat >try.c <<'EOCP'
5719 printf("%d\n", (int)sizeof(double));
5724 if eval $compile_ok; then
5725 doublesize=`$run ./try`
5726 echo "Your double is $doublesize bytes long."
5729 echo "(I can't seem to compile the test program. Guessing...)"
5730 rp="What is the size of a double precision number (in bytes)?"
5738 : check for long doubles
5740 echo "Checking to see if you have long double..." >&4
5741 echo 'int main() { long double x = 7.0; }' > try.c
5743 if eval $compile; then
5745 echo "You have long double."
5748 echo "You do not have long double."
5754 : check for length of long double
5755 case "${d_longdbl}${longdblsize}" in
5758 echo "Checking to see how big your long doubles are..." >&4
5759 $cat >try.c <<'EOCP'
5763 printf("%d\n", sizeof(long double));
5768 if eval $compile; then
5769 longdblsize=`$run ./try`
5770 echo "Your long doubles are $longdblsize bytes long."
5774 echo "(I can't seem to compile the test program. Guessing...)" >&4
5775 rp="What is the size of a long double (in bytes)?"
5779 if $test "X$doublesize" = "X$longdblsize"; then
5780 echo "(That isn't any different from an ordinary double.)"
5786 case "$useperlio" in
5787 $define|true|[yY]*|'') dflt='y';;
5792 Previous version of $package used the standard IO mechanisms as
5793 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
5794 alternate IO mechanisms via the PerlIO abstraction layer, but the
5795 stdio mechanism is still available if needed. The abstraction layer
5796 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
5797 Using PerlIO with sfio may cause problems with some extension modules.
5799 If this doesn't make any sense to you, just accept the default '$dflt'.
5801 rp='Use the PerlIO abstraction layer?'
5808 echo "Ok, doing things the stdio way."
5817 case "$useperlio" in
5818 $define|true|[yY]*) ;;
5821 You are using the SOCKS proxy protocol library which means that you
5822 should also use the PerlIO layer. You may be headed for trouble.
5831 : determine the architecture name
5833 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5834 tarch=`arch`"-$osname"
5835 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5836 if uname -m > tmparch 2>&1 ; then
5837 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5838 -e 's/$/'"-$osname/" tmparch`
5846 case "$myarchname" in
5849 echo "(Your architecture name used to be $myarchname.)"
5853 case "$targetarch" in
5855 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
5860 *) dflt="$archname";;
5862 rp='What is your architecture name'
5865 case "$usethreads" in
5867 echo "Threads selected." >&4
5869 *-thread*) echo "...and architecture name already has -thread." >&4
5871 *) archname="$archname-thread"
5872 echo "...setting architecture name to $archname." >&4
5877 case "$usemultiplicity" in
5879 echo "Multiplicity selected." >&4
5881 *-multi*) echo "...and architecture name already has -multi." >&4
5883 *) archname="$archname-multi"
5884 echo "...setting architecture name to $archname." >&4
5889 case "$use64bitint$use64bitall" in
5891 case "$archname64" in
5893 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
5896 case "$use64bitint" in
5897 "$define") echo "64 bit integers selected." >&4 ;;
5899 case "$use64bitall" in
5900 "$define") echo "Maximal 64 bitness selected." >&4 ;;
5903 *-$archname64*) echo "...and architecture name already has $archname64." >&4
5905 *) archname="$archname-$archname64"
5906 echo "...setting architecture name to $archname." >&4
5912 case "$uselongdouble" in
5914 echo "Long doubles selected." >&4
5915 case "$longdblsize" in
5917 "...but long doubles are equal to doubles, not changing architecture name." >&4
5921 *-ld*) echo "...and architecture name already has -ld." >&4
5923 *) archname="$archname-ld"
5924 echo "...setting architecture name to $archname." >&4
5931 case "$useperlio" in
5933 echo "Perlio selected." >&4
5936 echo "Perlio not selected, using stdio." >&4
5938 *-stdio*) echo "...and architecture name already has -stdio." >&4
5940 *) archname="$archname-stdio"
5941 echo "...setting architecture name to $archname." >&4
5947 : determine root of directory hierarchy where package will be installed.
5950 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
5958 By default, $package will be installed in $dflt/bin, manual pages
5959 under $dflt/man, etc..., i.e. with $dflt as prefix for all
5960 installation directories. Typically this is something like /usr/local.
5961 If you wish to have binaries under /usr/bin but other parts of the
5962 installation under /usr/local, that's ok: you will be prompted
5963 separately for each of the installation directories, the prefix being
5964 only used to set the defaults.
5968 rp='Installation prefix to use?'
5976 *) oldprefix="$prefix";;
5985 *) afsroot=$afsroot ;;
5991 $define|true) afs=true ;;
5992 $undef|false) afs=false ;;
5993 *) if test -d $afsroot; then
6001 echo "AFS may be running... I'll be extra cautious then..." >&4
6003 echo "AFS does not seem to be running..." >&4
6006 : determine installation prefix for where package is to be installed.
6010 Since you are running AFS, I need to distinguish the directory in which
6011 files will reside from the directory in which they are installed (and from
6012 which they are presumably copied to the former directory by occult means).
6015 case "$installprefix" in
6016 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
6017 *) dflt="$installprefix";;
6022 In some special cases, particularly when building $package for distribution,
6023 it is convenient to distinguish between the directory in which files should
6024 be installed from the directory ($prefix) in which they
6025 will eventually reside. For most users, these two directories are the same.
6028 case "$installprefix" in
6030 *) dflt=$installprefix;;
6034 rp='What installation prefix should I use for installing files?'
6036 installprefix="$ans"
6037 installprefixexp="$ansexp"
6039 : set the prefixit variable, to compute a suitable default value
6040 prefixit='case "$3" in
6042 case "$oldprefix" in
6043 "") eval "$1=\"\$$2\"";;
6050 ""|" ") eval "$1=\"\$$2\"";;
6056 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6058 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6059 /*-$oldprefix/*|\~*-$oldprefix/*)
6060 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6061 *) eval "$1=\"\$$2\"";;
6065 : get the patchlevel
6067 echo "Getting the current patchlevel..." >&4
6068 if $test -r $rsrc/patchlevel.h;then
6069 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
6070 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
6071 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
6072 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
6073 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
6074 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
6075 perl_patchlevel=`grep ',"DEVEL[0-9][0-9]*"' $rsrc/patchlevel.h|sed 's/[^0-9]//g'`
6084 $echo "(You do not have patchlevel.h. Eek.)"
6086 if $test -r $rsrc/.patch ; then
6087 if $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
6088 perl_patchlevel=`cat $rsrc/.patch`
6091 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
6092 version_patchlevel_string="version $patchlevel subversion $subversion"
6093 case "$perl_patchlevel" in
6095 *) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;;
6098 $echo "(You have $package $version_patchlevel_string.)"
6102 : XXX Should be a Configure test for double-dots in filenames.
6103 version=`echo $revision $patchlevel $subversion | \
6104 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
6105 api_versionstring=`echo $api_revision $api_version $api_subversion | \
6106 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
6109 version=`echo $revision $patchlevel $subversion | \
6110 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
6111 api_versionstring=`echo $api_revision $api_version $api_subversion | \
6112 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
6115 : Special case the 5.005_xx maintenance series, which used 5.005
6116 : without any subversion label as a subdirectory in $sitelib
6117 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
6118 api_versionstring='5.005'
6121 : determine installation style
6122 : For now, try to deduce it from prefix unless it is already set.
6123 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6124 case "$installstyle" in
6125 '') case "$prefix" in
6126 *perl*) dflt='lib';;
6127 *) dflt='lib/perl5' ;;
6130 *) dflt="$installstyle" ;;
6132 : Probably not worth prompting for this since we prompt for all
6133 : the directories individually, and the prompt would be too long and
6137 : determine where private library files go
6138 : Usual default is /usr/local/lib/perl5/$version.
6139 : Also allow things like /opt/perl/lib/$version, since
6140 : /opt/perl/lib/perl5... would be redundant.
6141 : The default "style" setting is made in installstyle.U
6142 case "$installstyle" in
6143 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6144 *) set dflt privlib lib/$version ;;
6149 There are some auxiliary files for $package that need to be put into a
6150 private library directory that is accessible by everyone.
6154 rp='Pathname where the private library files will reside?'
6157 privlibexp="$ansexp"
6158 : Change installation prefix, if necessary.
6159 if $test X"$prefix" != X"$installprefix"; then
6160 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
6162 installprivlib="$privlibexp"
6165 : set the prefixup variable, to restore leading tilda escape
6166 prefixup='case "$prefixexp" in
6168 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6171 : determine where public architecture dependent libraries go
6174 : privlib default is /usr/local/lib/$package/$version
6175 : archlib default is /usr/local/lib/$package/$version/$archname
6176 : privlib may have an optional trailing /share.
6177 tdflt=`echo $privlib | $sed 's,/share$,,'`
6178 tdflt=$tdflt/$archname
6187 $spackage contains architecture-dependent library files. If you are
6188 sharing libraries in a heterogeneous environment, you might store
6189 these files in a separate location. Otherwise, you can just include
6190 them with the rest of the public library files.
6194 rp='Where do you want to put the public architecture-dependent libraries?'
6197 archlibexp="$ansexp"
6198 if $test X"$archlib" = X"$privlib"; then
6203 : Change installation prefix, if necessary.
6204 if $test X"$prefix" != X"$installprefix"; then
6205 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
6207 installarchlib="$archlibexp"
6211 : Binary compatibility with 5.005 is not possible for builds
6212 : with advanced features
6213 case "$usethreads$usemultiplicity" in
6215 bincompat5005="$undef"
6216 d_bincompat5005="$undef"
6220 This version of Perl can be compiled for binary compatibility with 5.005.
6221 If you decide to do so, you will be able to continue using most of the
6222 extensions that were compiled for Perl 5.005.
6225 case "$bincompat5005$d_bincompat5005" in
6226 *"$undef"*) dflt=n ;;
6229 rp='Binary compatibility with Perl 5.005?'
6232 y*) val="$define" ;;
6237 case "$d_bincompat5005" in
6239 bincompat5005="$define"
6241 *) bincompat5005="$undef"
6242 d_bincompat5005="$undef"
6249 : see if setuid scripts can be secure
6252 Some kernels have a bug that prevents setuid #! scripts from being
6253 secure. Some sites have disabled setuid #! scripts because of this.
6255 First let's decide if your kernel supports secure setuid #! scripts.
6256 (If setuid #! scripts would be secure but have been disabled anyway,
6257 don't say that they are secure if asked.)
6262 if $test -d /dev/fd; then
6263 echo "#!$ls" >reflect
6264 chmod +x,u+s reflect
6265 ./reflect >flect 2>&1
6266 if $contains "/dev/fd" flect >/dev/null; then
6267 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6271 If you are not sure if they are secure, I can check but I'll need a
6272 username and password different from the one you are using right now.
6273 If you don't have such a username or don't want me to test, simply
6277 rp='Other username to test security of setuid scripts with?'
6282 case "$d_suidsafe" in
6283 '') echo "I'll assume setuid scripts are *not* secure." >&4
6286 echo "Well, the $hint value is *not* secure." >&4
6288 *) echo "Well, the $hint value *is* secure." >&4
6293 $rm -f reflect flect
6294 echo "#!$ls" >reflect
6295 chmod +x,u+s reflect
6298 echo '"su" will (probably) prompt you for '"$ans's password."
6299 su $ans -c './reflect >flect'
6300 if $contains "/dev/fd" flect >/dev/null; then
6301 echo "Okay, it looks like setuid scripts are secure." >&4
6304 echo "I don't think setuid scripts are secure." >&4
6309 rp='Does your kernel have *secure* setuid scripts?'
6312 [yY]*) val="$define";;
6317 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6318 echo "(That's for file descriptors, not floppy disks.)"
6324 $rm -f reflect flect
6326 : now see if they want to do setuid emulation
6329 case "$d_suidsafe" in
6332 echo "No need to emulate SUID scripts since they are secure here." >& 4
6336 Some systems have disabled setuid scripts, especially systems where
6337 setuid scripts cannot be secure. On systems where setuid scripts have
6338 been disabled, the setuid/setgid bits on scripts are currently
6339 useless. It is possible for $package to detect those bits and emulate
6340 setuid/setgid in a secure fashion. This emulation will only work if
6341 setuid scripts have been disabled in your kernel.
6345 "$define") dflt=y ;;
6348 rp="Do you want to do setuid/setgid emulation?"
6351 [yY]*) val="$define";;
6359 : see if this is a malloc.h system
6360 set malloc.h i_malloc
6363 : see if stdlib is available
6364 set stdlib.h i_stdlib
6367 : determine which malloc to compile in
6369 case "$usemymalloc" in
6370 [yY]*|true|$define) dflt='y' ;;
6371 [nN]*|false|$undef) dflt='n' ;;
6372 *) case "$ptrsize" in
6378 rp="Do you wish to attempt to use the malloc that comes with $package?"
6384 mallocsrc='malloc.c'
6385 mallocobj="malloc$_o"
6386 d_mymalloc="$define"
6389 : Remove malloc from list of libraries to use
6390 echo "Removing unneeded -lmalloc from library list" >&4
6391 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6394 echo "libs = $libs" >&4
6406 : compute the return types of malloc and free
6408 $cat >malloc.c <<END
6412 #include <sys/types.h>
6426 case "$malloctype" in
6428 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6435 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6439 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6446 echo "Your system uses $freetype free(), it would seem." >&4
6450 After $package is installed, you may wish to install various
6451 add-on modules and utilities. Typically, these add-ons will
6452 be installed under $prefix with the rest
6453 of this package. However, you may wish to install such add-ons
6454 elsewhere under a different prefix.
6456 If you do not wish to put everything under a single prefix, that's
6457 ok. You will be prompted for the individual locations; this siteprefix
6458 is only used to suggest the defaults.
6460 The default should be fine for most people.
6464 rp='Installation prefix to use for add-on modules and utilities?'
6465 : XXX Here might be another good place for an installstyle setting.
6466 case "$siteprefix" in
6468 *) dflt=$siteprefix ;;
6471 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6473 case "$siteprefix" in
6477 *) oldsiteprefix="$prefix";;
6482 siteprefixexp="$ansexp"
6484 : determine where site specific libraries go.
6485 : Usual default is /usr/local/lib/perl5/site_perl/$version
6486 : The default "style" setting is made in installstyle.U
6487 : XXX No longer works with Prefixit stuff.
6488 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6490 '') case "$installstyle" in
6491 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6492 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6500 The installation process will create a directory for
6501 site-specific extensions and modules. Most users find it convenient
6502 to place all site-specific files in this directory rather than in the
6503 main distribution directory.
6507 rp='Pathname for the site-specific library files?'
6510 sitelibexp="$ansexp"
6511 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6512 : Change installation prefix, if necessary.
6513 if $test X"$prefix" != X"$installprefix"; then
6514 installsitelib=`echo $sitelibexp | $sed "s#^$prefix#$installprefix#"`
6516 installsitelib="$sitelibexp"
6519 : determine where site specific architecture-dependent libraries go.
6520 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6521 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6522 : sitelib may have an optional trailing /share.
6524 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6525 dflt="$dflt/$archname"
6530 set sitearch sitearch none
6534 The installation process will also create a directory for
6535 architecture-dependent site-specific extensions and modules.
6539 rp='Pathname for the site-specific architecture-dependent library files?'
6542 sitearchexp="$ansexp"
6543 : Change installation prefix, if necessary.
6544 if $test X"$prefix" != X"$installprefix"; then
6545 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
6547 installsitearch="$sitearchexp"
6552 The installation process will also create a directory for
6553 vendor-supplied add-ons. Vendors who supply perl with their system
6554 may find it convenient to place all vendor-supplied files in this
6555 directory rather than in the main distribution directory. This will
6556 ease upgrades between binary-compatible maintenance versions of perl.
6558 Of course you may also use these directories in whatever way you see
6559 fit. For example, you might use them to access modules shared over a
6560 company-wide network.
6562 The default answer should be fine for most people.
6563 This causes further questions about vendor add-ons to be skipped
6564 and no vendor-specific directories will be configured for perl.
6567 rp='Do you want to configure vendor-specific add-on directories?'
6568 case "$usevendorprefix" in
6569 define|true|[yY]*) dflt=y ;;
6570 *) : User may have set vendorprefix directly on Configure command line.
6571 case "$vendorprefix" in
6580 rp='Installation prefix to use for vendor-supplied add-ons?'
6581 case "$vendorprefix" in
6583 *) dflt=$vendorprefix ;;
6586 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6588 case "$vendorprefix" in
6592 *) oldvendorprefix="$prefix";;
6596 usevendorprefix="$define"
6598 vendorprefixexp="$ansexp"
6600 *) usevendorprefix="$undef"
6606 case "$vendorprefix" in
6607 '') d_vendorlib="$undef"
6611 *) d_vendorlib="$define"
6612 : determine where vendor-supplied modules go.
6613 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6614 case "$vendorlib" in
6616 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6617 case "$installstyle" in
6618 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6619 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6622 *) dflt="$vendorlib"
6626 rp='Pathname for the vendor-supplied library files?'
6629 vendorlibexp="$ansexp"
6632 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6633 : Change installation prefix, if necessary.
6634 if $test X"$prefix" != X"$installprefix"; then
6635 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
6637 installvendorlib="$vendorlibexp"
6640 case "$vendorprefix" in
6641 '') d_vendorarch="$undef"
6645 *) d_vendorarch="$define"
6646 : determine where vendor-supplied architecture-dependent libraries go.
6647 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6648 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6649 : vendorlib may have an optional trailing /share.
6650 case "$vendorarch" in
6651 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6652 dflt="$dflt/$archname"
6654 *) dflt="$vendorarch" ;;
6657 rp='Pathname for vendor-supplied architecture-dependent files?'
6660 vendorarchexp="$ansexp"
6663 : Change installation prefix, if necessary.
6664 if $test X"$prefix" != X"$installprefix"; then
6665 installvendorarch=`echo $vendorarchexp | sed "s#^$prefix#$installprefix#"`
6667 installvendorarch="$vendorarchexp"
6670 : Final catch-all directories to search
6673 Lastly, you can have perl look in other directories for extensions and
6674 modules in addition to those already specified.
6675 These directories will be searched after
6679 test X"$vendorlib" != "X" && echo ' ' $vendorlib
6680 test X"$vendorarch" != "X" && echo ' ' $vendorarch
6682 case "$otherlibdirs" in
6683 ''|' ') dflt='none' ;;
6684 *) dflt="$otherlibdirs" ;;
6687 Enter a colon-separated set of extra paths to include in perl's @INC
6688 search path, or enter 'none' for no extra paths.
6692 rp='Colon-separated list of additional directories for perl to search?'
6695 ' '|''|none) otherlibdirs=' ' ;;
6696 *) otherlibdirs="$ans" ;;
6698 case "$otherlibdirs" in
6702 set d_perl_otherlibdirs
6705 : Cruising for prototypes
6707 echo "Checking out function prototypes..." >&4
6708 $cat >prototype.c <<'EOCP'
6709 int main(int argc, char *argv[]) {
6712 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
6713 echo "Your C compiler appears to support function prototypes."
6716 echo "Your C compiler doesn't seem to understand function prototypes."
6723 case "$prototype" in
6725 *) ansi2knr='ansi2knr'
6730 This version of $package can only be compiled by a compiler that
6731 understands function prototypes. Unfortunately, your C compiler
6733 doesn't seem to understand them. Sorry about that.
6735 If GNU cc is available for your system, perhaps you could try that instead.
6737 Eventually, we hope to support building Perl with pre-ANSI compilers.
6738 If you would like to help in that effort, please contact <perlbug@perl.org>.
6740 Aborting Configure now.
6746 : determine where public executables go
6751 rp='Pathname where the public executables will reside?'
6753 if $test "X$ansexp" != "X$binexp"; then
6758 : Change installation prefix, if necessary.
6759 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6760 if $test X"$prefix" != X"$installprefix"; then
6761 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
6763 installbin="$binexp"
6766 : Find perl5.005 or later.
6767 echo "Looking for a previously installed perl5.005 or later... "
6769 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6770 : Check if this perl is recent and can load a simple module
6771 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6774 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6784 '') echo "None found. That's ok.";;
6785 *) echo "Using $perl5." ;;
6788 : Determine list of previous versions to include in @INC
6789 $cat > getverlist <<EOPL
6792 \$api_versionstring = "$api_versionstring";
6793 \$version = "$version";
6794 \$stem = "$sitelib_stem";
6795 \$archname = "$archname";
6797 $cat >> getverlist <<'EOPL'
6798 # Can't have leading @ because metaconfig interprets it as a command!
6799 ;@inc_version_list=();
6800 # XXX Redo to do opendir/readdir?
6803 ;@candidates = glob("5.*");
6809 # XXX ToDo: These comparisons must be reworked when two-digit
6810 # subversions come along, so that 5.7.10 compares as greater than
6811 # 5.7.3! By that time, hope that 5.6.x is sufficiently
6812 # widespread that we can use the built-in version vectors rather
6813 # than reinventing them here. For 5.6.0, however, we must
6814 # assume this script will likely be run by 5.005_0x. --AD 1/2000.
6815 foreach $d (@candidates) {
6816 if ($d lt $version) {
6817 if ($d ge $api_versionstring) {
6818 unshift(@inc_version_list, grep { -d } "$d/$archname", $d);
6820 elsif ($d ge "5.005") {
6821 unshift(@inc_version_list, grep { -d } $d);
6825 # Skip newer version. I.e. don't look in
6826 # 5.7.0 if we're installing 5.6.1.
6830 if (@inc_version_list) {
6831 print join(' ', @inc_version_list);
6834 # Blank space to preserve value for next Configure run.
6839 case "$inc_version_list" in
6840 '') if test -x "$perl5$exe_ext"; then
6841 dflt=`$perl5 getverlist`
6846 $undef) dflt='none' ;;
6847 *) eval dflt=\"$inc_version_list\" ;;
6850 ''|' ') dflt=none ;;
6853 5.005) case "$bincompat5005" in
6854 $define|true|[yY]*) ;;
6861 In order to ease the process of upgrading, this version of perl
6862 can be configured to use modules built and installed with earlier
6863 versions of perl that were installed under $prefix. Specify here
6864 the list of earlier versions that this version of perl should check.
6865 If Configure detected no earlier versions of perl installed under
6866 $prefix, then the list will be empty. Answer 'none' to tell perl
6867 to not search earlier versions.
6869 The default should almost always be sensible, so if you're not sure,
6870 just accept the default.
6873 rp='List of earlier versions to include in @INC?'
6876 [Nn]one|''|' ') inc_version_list=' ' ;;
6877 *) inc_version_list="$ans" ;;
6879 case "$inc_version_list" in
6881 inc_version_list_init='0';;
6882 *) inc_version_list_init=`echo $inc_version_list |
6883 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6888 : determine whether to install perl also as /usr/bin/perl
6891 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
6893 Many scripts expect perl to be installed as /usr/bin/perl.
6894 I can install the perl you are about to compile also as /usr/bin/perl
6895 (in addition to $installbin/perl).
6897 case "$installusrbinperl" in
6898 "$undef"|[nN]*) dflt='n';;
6901 rp="Do you want to install perl as /usr/bin/perl?"
6904 [yY]*) val="$define";;
6910 set installusrbinperl
6913 : see if dld is available
6917 : see if dlopen exists
6924 : determine which dynamic loading, if any, to compile in
6926 dldir="ext/DynaLoader"
6939 $define) dflt='y' ;;
6942 $define) dflt='y' ;;
6944 : Does a dl_xxx.xs file exist for this operating system
6945 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
6948 rp="Do you wish to use dynamic loading?"
6955 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
6956 dflt="$dldir/dl_${osname}.xs"
6957 elif $test "$d_dlopen" = "$define" ; then
6958 dflt="$dldir/dl_dlopen.xs"
6959 elif $test "$i_dld" = "$define" ; then
6960 dflt="$dldir/dl_dld.xs"
6965 *) dflt="$dldir/$dlsrc"
6968 echo "The following dynamic loading files are available:"
6969 : Can not go over to $dldir because getfile has path hard-coded in.
6970 tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir
6971 rp="Source file to use for dynamic loading"
6977 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
6981 Some systems may require passing special flags to $cc -c to
6982 compile modules that will be used to create a shared library.
6983 To use no flags, say "none".
6986 case "$cccdlflags" in
6987 '') case "$gccversion" in
6988 '') case "$osname" in
6990 next) dflt='none' ;;
6991 irix*) dflt='-KPIC' ;;
6992 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
6993 sunos) dflt='-pic' ;;
6997 *) case "$osname" in
6998 svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7003 *) dflt="$cccdlflags" ;;
7005 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7008 none) cccdlflags=' ' ;;
7009 *) cccdlflags="$ans" ;;
7014 Some systems use ld to create libraries that can be dynamically loaded,
7015 while other systems (such as those using ELF) use $cc.
7019 '') $cat >try.c <<'EOM'
7020 /* Test for whether ELF binaries are produced */
7025 int i = open("a.out",O_RDONLY);
7028 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7029 exit(0); /* succeed (yes, it's ELF) */
7034 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7036 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7040 echo "I'll use ld to build dynamic libraries."
7049 rp="What command should be used to create dynamic libraries?"
7055 Some systems may require passing special flags to $ld to create a
7056 library that can be dynamically loaded. If your ld flags include
7057 -L/other/path options to locate libraries outside your loader's normal
7058 search path, you may need to specify those -L options here as well. To
7059 use no flags, say "none".
7062 case "$lddlflags" in
7063 '') case "$osname" in
7064 beos) dflt='-nostart' ;;
7066 case "$gccversion" in
7067 '') dflt="$dflt +vnocompatwarnings" ;;
7070 linux|irix*) dflt='-shared' ;;
7071 next) dflt='none' ;;
7072 solaris) dflt='-G' ;;
7073 sunos) dflt='-assert nodefinitions' ;;
7074 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
7078 *) dflt="$lddlflags" ;;
7081 : Try to guess additional flags to pick up local libraries.
7082 : Be careful not to append to a plain 'none'
7086 for thisflag in $ldflags; do
7091 *) dflt="$dflt $thisflag" ;;
7098 ''|' ') dflt='none' ;;
7101 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
7104 none) lddlflags=' ' ;;
7105 *) lddlflags="$ans" ;;
7110 Some systems may require passing special flags to $cc to indicate that
7111 the resulting executable will use dynamic linking. To use no flags,
7115 case "$ccdlflags" in
7116 '') case "$osname" in
7117 hpux) dflt='-Wl,-E' ;;
7118 linux) dflt='-rdynamic' ;;
7119 next) dflt='none' ;;
7120 sunos) dflt='none' ;;
7124 *) dflt="$ccdlflags" ;;
7126 rp="Any special flags to pass to $cc to use dynamic linking?"
7129 none) ccdlflags=' ' ;;
7130 *) ccdlflags="$ans" ;;
7144 # No dynamic loading being used, so don't bother even to prompt.
7147 *) case "$useshrplib" in
7148 '') case "$osname" in
7149 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
7151 also='Building a shared libperl is required for dynamic loading to work on your system.'
7156 also='Building a shared libperl is needed for MAB support.'
7174 The perl executable is normally obtained by linking perlmain.c with
7175 libperl${_a}, any static extensions (usually just DynaLoader), and
7176 any other libraries needed on this system (such as -lm, etc.). Since
7177 your system supports dynamic loading, it is probably possible to build
7178 a shared libperl.$so. If you will have more than one executable linked
7179 to libperl.$so, this will significantly reduce the size of each
7180 executable, but it may have a noticeable affect on performance. The
7181 default is probably sensible for your system.
7185 rp="Build a shared libperl.$so (y/n)"
7189 useshrplib='true' ;;
7190 *) useshrplib='false' ;;
7195 case "$useshrplib" in
7199 # Figure out a good name for libperl.so. Since it gets stored in
7200 # a version-specific architecture-dependent library, the version
7201 # number isn't really that important, except for making cc/ld happy.
7203 # A name such as libperl.so.3.1
7204 majmin="libperl.$so.$patchlevel.$subversion"
7205 # A name such as libperl.so.301
7206 majonly=`echo $patchlevel $subversion |
7207 $awk '{printf "%d%02d", $1, $2}'`
7208 majonly=libperl.$so.$majonly
7209 # I'd prefer to keep the os-specific stuff here to a minimum, and
7210 # rely on figuring it out from the naming of libc.
7211 case "${osname}${osvers}" in
7214 # XXX How handle the --version stuff for MAB?
7216 linux*) # ld won't link with a bare -lperl otherwise.
7219 cygwin*) # include version
7220 dflt=`echo libperl$version | sed -e 's/\./_/g'`$lib_ext
7222 *) # Try to guess based on whether libc has major.minor.
7224 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
7225 *libc.$so.[0-9]*) dflt=$majonly ;;
7226 *) dflt=libperl.$so ;;
7236 I need to select a good name for the shared libperl. If your system uses
7237 library names with major and minor numbers, then you might want something
7238 like $majmin. Alternatively, if your system uses a single version
7239 number for shared libraries, then you might want to use $majonly.
7240 Or, your system might be quite happy with a simple libperl.$so.
7242 Since the shared libperl will get installed into a version-specific
7243 architecture-dependent directory, the version number of the shared perl
7244 library probably isn't important, so the default should be o.k.
7247 rp='What name do you want to give to the shared libperl?'
7250 echo "Ok, I'll use $libperl"
7253 libperl="libperl${_a}"
7257 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
7261 WARNING: Use of the shrpdir variable for the installation location of
7262 the shared $libperl is not supported. It was never documented and
7263 will not work in this version. Let me (perlbug@perl.org)
7264 know of any problems this may cause.
7270 But your current setting of $shrpdir is
7271 the default anyway, so it's harmless.
7276 Further, your current attempted setting of $shrpdir
7277 conflicts with the value of $archlibexp/CORE
7278 that installperl will use.
7285 # How will the perl executable find the installed shared $libperl?
7286 # Add $xxx to ccdlflags.
7287 # If we can't figure out a command-line option, use $shrpenv to
7288 # set env LD_RUN_PATH. The main perl makefile uses this.
7289 shrpdir=$archlibexp/CORE
7292 if "$useshrplib"; then
7295 # We'll set it in Makefile.SH...
7301 xxx="-Wl,-R$shrpdir"
7303 linux|irix*|dec_osf)
7304 xxx="-Wl,-rpath,$shrpdir"
7307 # next doesn't like the default...
7310 # beos doesn't like the default, either.
7313 # hpux doesn't like the default, either.
7314 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
7317 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
7323 # Only add $xxx if it isn't already in ccdlflags.
7324 case " $ccdlflags " in
7326 *) ccdlflags="$ccdlflags $xxx"
7329 Adding $xxx to the flags
7330 passed to $ld so that the perl executable will find the
7331 installed shared $libperl.
7339 # Fix ccdlflags in AIX for building external extensions.
7340 # (For building Perl itself bare -bE:perl.exp is needed,
7341 # Makefile.SH takes care of this.)
7343 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
7345 # Respect a hint or command-line value.
7347 '') shrpenv="$tmp_shrpenv" ;;
7349 case "$ldlibpthname" in
7350 '') ldlibpthname=LD_LIBRARY_PATH ;;
7351 none) ldlibpthname='' ;;
7354 : determine where manual pages are on this system
7358 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
7359 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
7360 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
7361 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
7362 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
7363 sysman=`./loc . /usr/man/man1 $syspath`
7366 if $test -d "$sysman"; then
7367 echo "System manual is in $sysman." >&4
7369 echo "Could not find manual pages in source form." >&4
7372 : determine where manual pages go
7373 set man1dir man1dir none
7377 $spackage has manual pages available in source form.
7381 echo "However, you don't have nroff, so they're probably useless to you."
7383 '') man1dir="none";;
7386 echo "If you don't want the manual sources installed, answer 'none'."
7391 lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
7392 lookpath="$lookpath $prefixexp/man/p_man/man1"
7393 lookpath="$lookpath $prefixexp/man/u_man/man1"
7394 lookpath="$lookpath $prefixexp/man/man.1"
7396 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
7397 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
7407 rp="Where do the main $spackage manual pages (source) go?"
7409 if $test "X$man1direxp" != "X$ansexp"; then
7413 man1direxp="$ansexp"
7419 : Change installation prefix, if necessary.
7420 if $test X"$prefix" != X"$installprefix"; then
7421 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
7423 installman1dir="$man1direxp"
7426 : What suffix to use on installed man pages
7433 rp="What suffix should be used for the main $spackage man pages?"
7435 '') case "$man1dir" in
7449 *) dflt="$man1ext";;
7456 : see if we can have long filenames
7458 first=123456789abcdef
7460 if (echo hi >$first) 2>/dev/null; then
7461 if $test -f 123456789abcde; then
7462 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
7465 echo 'You can have filenames longer than 14 characters.'>&4
7470 You can't have filenames longer than 14 chars.
7471 You can't even think about them!
7477 $rm -rf 123456789abcde*
7479 : determine where library module manual pages go
7480 set man3dir man3dir none
7484 $spackage has manual pages for many of the library modules.
7490 However, you don't have nroff, so they're probably useless to you.
7493 '') man3dir="none";;
7497 case "$d_flexfnam" in
7500 However, your system can't handle the long file names like File::Basename.3.
7503 '') man3dir="none";;
7507 echo "If you don't want the manual sources installed, answer 'none'."
7508 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7510 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
7511 if $test -d "$privlib/man/man3"; then
7514 WARNING: Previous versions of perl installed man3 pages into
7515 $privlib/man/man3. This version will suggest a
7516 new default of $dflt.
7520 rp='Do you wish to preserve the old behavior?(y/n)'
7523 y*) dflt="$privlib/man/man3" ;;
7528 *) dflt="$man3dir" ;;
7535 rp="Where do the $package library man pages (source) go?"
7538 man3direxp="$ansexp"
7544 : Change installation prefix, if necessary.
7545 if $test X"$prefix" != X"$installprefix"; then
7546 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
7548 installman3dir="$man3direxp"
7551 : What suffix to use on installed man pages
7557 rp="What suffix should be used for the $package library man pages?"
7559 '') case "$man3dir" in
7573 *) dflt="$man3ext";;
7580 : see if we have to deal with yellow pages, now NIS.
7581 if $test -d /usr/etc/yp || $test -d /etc/yp; then
7582 if $test -f /usr/etc/nibindd; then
7584 echo "I'm fairly confident you're on a NeXT."
7586 rp='Do you get the hosts file via NetInfo?'
7595 y*) hostcat='nidump hosts .';;
7596 *) case "$hostcat" in
7597 nidump*) hostcat='';;
7607 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
7615 rp='Are you getting the hosts file via yellow pages?'
7618 y*) hostcat='ypcat hosts';;
7619 *) hostcat='cat /etc/hosts';;
7625 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
7628 '') test -f /etc/group && groupcat='cat /etc/group';;
7631 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
7634 : now get the host name
7636 echo "Figuring out host name..." >&4
7637 case "$myhostname" in
7639 echo 'Maybe "hostname" will work...'
7640 if tans=`sh -c hostname 2>&1` ; then
7648 if $test "$cont"; then
7650 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
7651 if tans=`cat /etc/systemid 2>&1` ; then
7653 phostname='cat /etc/systemid'
7654 echo "Whadyaknow. Xenix always was a bit strange..."
7657 elif $test -r /etc/systemid; then
7658 echo "(What is a non-Xenix system doing with /etc/systemid?)"
7661 if $test "$cont"; then
7662 echo 'No, maybe "uuname -l" will work...'
7663 if tans=`sh -c 'uuname -l' 2>&1` ; then
7665 phostname='uuname -l'
7667 echo 'Strange. Maybe "uname -n" will work...'
7668 if tans=`sh -c 'uname -n' 2>&1` ; then
7670 phostname='uname -n'
7672 echo 'Oh well, maybe I can mine it out of whoami.h...'
7673 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
7674 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
7675 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
7677 case "$myhostname" in
7678 '') echo "Does this machine have an identity crisis or something?"
7681 echo "Well, you said $myhostname before..."
7682 phostname='echo $myhostname';;
7688 : you do not want to know about this
7693 if $test "$myhostname" ; then
7695 rp='Your host name appears to be "'$myhostname'".'" Right?"
7703 : bad guess or no guess
7704 while $test "X$myhostname" = X ; do
7706 rp="Please type the (one word) name of your host:"
7711 : translate upper to lower if necessary
7712 case "$myhostname" in
7714 echo "(Normalizing case in your host name)"
7715 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
7719 case "$myhostname" in
7721 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
7722 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
7723 echo "(Trimming domain name from host name--host name is now $myhostname)"
7725 *) case "$mydomain" in
7728 test "X$hostcat" = "Xypcat hosts" &&
7729 ypmatch "$myhostname" hosts 2>/dev/null |\
7730 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
7733 test "X$hostcat" != "X" &&
7734 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
7735 /[ ]$myhostname[ . ]/p" > hosts
7738 if $test -f hosts; then
7739 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
7740 END { print sum }" hosts` = x1 || tmp_re="[ ]"
7741 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
7742 hosts | $sort | $uniq | \
7743 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
7744 case `$echo X$dflt` in
7745 X*\ *) echo "(Several hosts in the database matched hostname)"
7748 X.) echo "(You do not have fully-qualified names in the hosts database)"
7752 echo "(I cannot locate a hosts database anywhere)"
7757 tans=`./loc resolv.conf X /etc /usr/etc`
7758 if $test -f "$tans"; then
7759 echo "(Attempting domain name extraction from $tans)"
7760 dflt=.`$sed -n -e 's/ / /g' \
7761 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
7762 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
7764 .) dflt=.`$sed -n -e 's/ / /g' \
7765 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
7766 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
7773 .) echo "(No help from resolv.conf either -- attempting clever guess)"
7774 dflt=.`sh -c domainname 2>/dev/null`
7777 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
7781 case "$dflt$osname" in
7782 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
7783 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
7787 .) echo "(Lost all hope -- silly guess then)"
7793 *) dflt="$mydomain";;
7797 rp="What is your domain name?"
7807 : translate upper to lower if necessary
7810 echo "(Normalizing case in your domain name)"
7811 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
7815 : a little sanity check here
7816 case "$phostname" in
7819 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
7820 $myhostname$mydomain|$myhostname) ;;
7822 case "$phostname" in
7824 echo "(That doesn't agree with your whoami.h file, by the way.)"
7827 echo "(That doesn't agree with your $phostname command, by the way.)"
7837 I need to get your e-mail address in Internet format if possible, i.e.
7838 something like user@host.domain. Please answer accurately since I have
7839 no easy means to double check it. The default value provided below
7840 is most probably close to reality but may not be valid from outside
7841 your organization...
7845 while test "$cont"; do
7847 '') dflt="$cf_by@$myhostname$mydomain";;
7848 *) dflt="$cf_email";;
7850 rp='What is your e-mail address?'
7856 rp='Address does not look like an Internet one. Use it anyway?'
7872 If you or somebody else will be maintaining perl at your site, please
7873 fill in the correct e-mail address here so that they may be contacted
7874 if necessary. Currently, the "perlbug" program included with perl
7875 will send mail to this address in addition to perlbug@perl.org. You may
7876 enter "none" for no administrator.
7879 case "$perladmin" in
7880 '') dflt="$cf_email";;
7881 *) dflt="$perladmin";;
7883 rp='Perl administrator e-mail address'
7887 : determine whether to only install version-specific parts.
7890 Do you want to install only the version-specific parts of the perl
7891 distribution? Usually you do *not* want to do this.
7893 case "$versiononly" in
7894 "$define"|[Yy]*|true) dflt='y' ;;
7897 rp="Do you want to install only the version-specific parts of perl?"
7900 [yY]*) val="$define";;
7906 : figure out how to guarantee perl startup
7907 case "$startperl" in
7909 case "$sharpbang" in
7913 I can use the #! construct to start perl on your system. This will
7914 make startup of perl scripts faster, but may cause problems if you
7915 want to share those scripts and perl is not in a standard place
7916 ($binexp/perl) on all your platforms. The alternative is to force
7917 a shell by starting the script with a single ':' character.
7920 case "$versiononly" in
7921 "$define") dflt="$binexp/perl$version";;
7922 *) dflt="$binexp/perl";;
7924 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
7927 none) startperl=": # use perl";;
7928 *) startperl="#!$ans"
7929 if $test 30 -lt `echo "$ans" | wc -c`; then
7932 WARNING: Some systems limit the #! command to 32 characters.
7933 If you experience difficulty running Perl scripts with #!, try
7934 installing Perl in a directory with a shorter pathname.
7940 *) startperl=": # use perl"
7945 echo "I'll use $startperl to start perl scripts."
7947 : figure best path for perl in scripts
7950 perlpath="$binexp/perl"
7951 case "$startperl" in
7956 I will use the "eval 'exec'" idiom to start Perl on your system.
7957 I can use the full path of your Perl binary for this purpose, but
7958 doing so may cause problems if you want to share those scripts and
7959 Perl is not always in a standard place ($binexp/perl).
7963 rp="What path shall I use in \"eval 'exec'\"?"
7970 case "$startperl" in
7972 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
7975 : determine where public executable scripts go
7976 set scriptdir scriptdir
7978 case "$scriptdir" in
7981 : guess some guesses
7982 $test -d /usr/share/scripts && dflt=/usr/share/scripts
7983 $test -d /usr/share/bin && dflt=/usr/share/bin
7984 $test -d /usr/local/script && dflt=/usr/local/script
7985 $test -d /usr/local/scripts && dflt=/usr/local/scripts
7986 $test -d $prefixexp/script && dflt=$prefixexp/script
7990 *) dflt="$scriptdir"
7995 Some installations have a separate directory just for executable scripts so
7996 that they can mount it across multiple architectures but keep the scripts in
7997 one spot. You might, for example, have a subdirectory of /usr/share for this.
7998 Or you might just lump your scripts in with all your other executables.
8002 rp='Where do you keep publicly executable scripts?'
8004 if $test "X$ansexp" != "X$scriptdirexp"; then
8008 scriptdirexp="$ansexp"
8009 : Change installation prefix, if necessary.
8010 if $test X"$prefix" != X"$installprefix"; then
8011 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
8013 installscript="$scriptdirexp"
8016 : determine where add-on public executables go
8018 '') dflt=$siteprefix/bin ;;
8022 rp='Pathname where the add-on public executables should be installed?'
8025 sitebinexp="$ansexp"
8026 : Change installation prefix, if necessary.
8027 if $test X"$prefix" != X"$installprefix"; then
8028 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
8030 installsitebin="$sitebinexp"
8033 : define an is-a-typedef? function
8034 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8036 "") inclist="sys/types.h";;
8038 eval "varval=\$$var";
8042 for inc in $inclist; do
8043 echo "#include <$inc>" >>temp.c;
8045 echo "#ifdef $type" >> temp.c;
8046 echo "printf(\"We have $type\");" >> temp.c;
8047 echo "#endif" >> temp.c;
8048 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8049 if $contains $type temp.E >/dev/null 2>&1; then
8055 *) eval "$var=\$varval";;
8058 : define an is-a-typedef? function that prompts if the type is not available.
8059 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8061 "") inclist="sys/types.h";;
8063 eval "varval=\$$var";
8067 for inc in $inclist; do
8068 echo "#include <$inc>" >>temp.c;
8070 echo "#ifdef $type" >> temp.c;
8071 echo "printf(\"We have $type\");" >> temp.c;
8072 echo "#endif" >> temp.c;
8073 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8075 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
8076 if $contains $type temp.E >/dev/null 2>&1; then
8077 echo "$type found." >&4;
8080 echo "$type NOT found." >&4;
8086 *) eval "$var=\$varval";;
8089 : see what type lseek is declared as in the kernel
8090 rp="What is the type used for lseek's offset on this system?"
8091 set off_t lseektype long stdio.h sys/types.h
8095 echo "Checking to see how big your file offsets are..." >&4
8097 #include <sys/types.h>
8101 printf("%d\n", (int)sizeof($lseektype));
8106 if eval $compile_ok; then
8107 lseeksize=`$run ./try`
8108 echo "Your file offsets are $lseeksize bytes long."
8112 echo "(I can't seem to compile the test program. Guessing...)"
8113 rp="What is the size of your file offsets (in bytes)?"
8119 : see what type file positions are declared as in the library
8120 rp="What is the type for file position used by fsetpos()?"
8121 set fpos_t fpostype long stdio.h sys/types.h
8126 *_t) zzz="$fpostype" ;;
8129 echo "Checking the size of $zzz..." >&4
8131 #include <sys/types.h>
8134 printf("%d\n", (int)sizeof($fpostype));
8139 if eval $compile_ok; then
8143 echo "(I can't execute the test program--guessing $fpossize.)" >&4
8146 echo "Your $zzz is $fpossize bytes long."
8152 echo "(I can't compile the test program. Guessing...)" >&4
8153 rp="What is the size of your file positions (in bytes)?"
8160 # Backward compatibility (uselfs is deprecated).
8162 "$define"|true|[yY]*)
8165 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
8167 uselargefiles="$define"
8171 case "$lseeksize:$fpossize" in
8174 You can have files larger than 2 gigabytes.
8177 *) case "$uselargefiles" in
8178 "$undef"|false|[nN]*) dflt='n' ;;
8183 Perl can be built to understand large files (files larger than 2 gigabytes)
8184 on some systems. To do so, Configure can be run with -Duselargefiles.
8186 If this doesn't make any sense to you, just accept the default '$dflt'.
8188 rp='Try to understand large files, if available?'
8191 y|Y) val="$define" ;;
8198 case "$uselargefiles" in
8200 : Look for a hint-file generated 'call-back-unit'. If the
8201 : user has specified that a large files perl is to be built,
8202 : we may need to set or change some other defaults.
8203 if $test -f uselargefiles.cbu; then
8204 echo "Your platform has some specific hints for large file builds, using them..."
8205 . ./uselargefiles.cbu
8207 echo "Rechecking to see how big your file offsets are..." >&4
8209 #include <sys/types.h>
8213 printf("%d\n", (int)sizeof($lseektype));
8218 if eval $compile_ok; then
8219 lseeksize=`$run ./try`
8220 $echo "Your file offsets are now $lseeksize bytes long."
8224 echo "(I can't seem to compile the test program. Guessing...)"
8225 rp="What is the size of your file offsets (in bytes)?"
8230 *_t) zzz="$fpostype" ;;
8233 $echo $n "Rechecking the size of $zzz...$c" >&4
8235 #include <sys/types.h>
8238 printf("%d\n", (int)sizeof($fpostype));
8243 if eval $compile_ok; then
8248 echo "(I can't execute the test program--guessing $fpossize.)" >&4
8251 echo " $fpossize bytes." >&4
8257 echo "(I can't compile the test program. Guessing...)" >&4
8258 rp="What is the size of your file positions (in bytes)?"
8267 case "$vendorprefix" in
8268 '') d_vendorbin="$undef"
8272 *) d_vendorbin="$define"
8273 : determine where vendor-supplied executables go.
8274 case "$vendorbin" in
8275 '') dflt=$vendorprefix/bin ;;
8276 *) dflt="$vendorbin" ;;
8279 rp='Pathname for the vendor-supplied executables directory?'
8282 vendorbinexp="$ansexp"
8285 : Change installation prefix, if necessary.
8286 if $test X"$prefix" != X"$installprefix"; then
8287 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
8289 installvendorbin="$vendorbinexp"
8292 : see if qgcvt exists
8298 if $test X"$d_longdbl" = X"$define"; then
8300 echo "Checking how to print long doubles..." >&4
8302 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
8303 $cat >try.c <<'EOCP'
8304 #include <sys/types.h>
8308 printf("%.3f\n", d);
8312 if eval $compile; then
8316 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
8317 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
8318 echo "We will use %f."
8324 if $test X"$sPRIfldbl" = X; then
8325 $cat >try.c <<'EOCP'
8326 #include <sys/types.h>
8329 long double d = 123.456;
8330 printf("%.3Lf\n", d);
8334 if eval $compile; then
8338 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
8339 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
8340 echo "We will use %Lf."
8346 if $test X"$sPRIfldbl" = X; then
8347 $cat >try.c <<'EOCP'
8348 #include <sys/types.h>
8351 long double d = 123.456;
8352 printf("%.3llf\n", d);
8356 if eval $compile; then
8360 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
8361 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
8362 echo "We will use %llf."
8368 if $test X"$sPRIfldbl" = X; then
8369 $cat >try.c <<'EOCP'
8370 #include <sys/types.h>
8373 long double d = 123.456;
8374 printf("%.3lf\n", d);
8378 if eval $compile; then
8382 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
8383 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
8384 echo "We will use %lf."
8390 if $test X"$sPRIfldbl" = X; then
8391 echo "Cannot figure out how to print long doubles." >&4
8393 sSCNfldbl=$sPRIfldbl # expect consistency
8400 case "$sPRIfldbl" in
8401 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
8402 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
8403 d_SCNfldbl="$undef";
8405 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
8406 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
8407 d_SCNfldbl="$define";
8411 : Check how to convert floats to strings.
8413 echo "Checking for an efficient way to convert floats to strings."
8415 case "$uselongdouble" in
8416 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
8418 case "$d_longdbl" in
8419 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
8421 case "$d_PRIgldbl" in
8422 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
8426 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
8427 char *myname = "gconvert";
8430 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
8431 char *myname = "gcvt";
8434 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
8435 char *myname = "qgcvt";
8436 #define DOUBLETYPE long double
8439 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE) && defined(HAS_PRIgldbl)
8440 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
8442 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
8444 char *myname = "sprintf";
8448 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
8449 #define DOUBLETYPE long double
8451 #define DOUBLETYPE double
8457 #define I_STDLIB $i_stdlib
8463 checkit(expect, got)
8467 if (strcmp(expect, got)) {
8468 printf("%s oddity: Expected %s, got %s\n",
8469 myname, expect, got);
8479 /* This must be 1st test on (which?) platform */
8480 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
8481 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
8482 checkit("0.1", buf);
8484 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
8487 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
8488 checkit("1.1", buf);
8490 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
8491 checkit("1.01", buf);
8493 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
8494 checkit("1.001", buf);
8496 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
8497 checkit("1.0001", buf);
8499 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
8500 checkit("1.00001", buf);
8502 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
8503 checkit("1.000001", buf);
8505 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
8508 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
8511 /* Some Linux gcvt's give 1.e+5 here. */
8512 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
8513 checkit("100000", buf);
8515 /* Some Linux gcvt's give -1.e+5 here. */
8516 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
8517 checkit("-100000", buf);
8519 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
8520 checkit("123.456", buf);
8522 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
8523 Gconvert((DOUBLETYPE)1e30, 8, 0, buf);
8524 if (strlen(buf) > 5)
8525 checkit("1e+030", buf); /* for Microsoft */
8527 checkit("1e+30", buf);
8532 case "$d_Gconvert" in
8533 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
8534 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
8535 sprintf*) xxx_list='sprintf gconvert gcvt' ;;
8536 *) xxx_list='gconvert gcvt sprintf' ;;
8539 case "$d_longdbl$uselongdouble$d_PRIgldbl" in
8540 "$define$define$define")
8541 # for long doubles prefer first qgcvt, then sprintf
8542 xxx_list="`echo $xxx_list|sed s/sprintf//`"
8543 xxx_list="sprintf $xxx_list"
8545 "$define") xxx_list="qgcvt $xxx_list" ;;
8550 for xxx_convert in $xxx_list; do
8551 echo "Trying $xxx_convert..."
8553 set try -DTRY_$xxx_convert
8554 if eval $compile; then
8555 echo "$xxx_convert() found." >&4
8557 echo "I'll use $xxx_convert to convert floats into a string." >&4
8560 echo "...But $xxx_convert didn't work as I expected."
8563 echo "$xxx_convert NOT found." >&4
8567 case "$xxx_convert" in
8568 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
8569 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
8570 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
8571 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
8572 "$define$define$define")
8573 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
8574 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
8579 : see if _fwalk exists
8583 : Initialize h_fcntl
8586 : Initialize h_sysfile
8589 : access call always available on UNIX
8593 : locate the flags for 'access()'
8597 $cat >access.c <<'EOCP'
8598 #include <sys/types.h>
8603 #include <sys/file.h>
8612 : check sys/file.h first, no particular reason here
8613 if $test `./findhdr sys/file.h` && \
8614 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
8616 echo "<sys/file.h> defines the *_OK access constants." >&4
8617 elif $test `./findhdr fcntl.h` && \
8618 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
8620 echo "<fcntl.h> defines the *_OK access constants." >&4
8621 elif $test `./findhdr unistd.h` && \
8622 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
8623 echo "<unistd.h> defines the *_OK access constants." >&4
8625 echo "I can't find the four *_OK access constants--I'll use mine." >&4
8631 : see if accessx exists
8632 set accessx d_accessx
8635 : see if alarm exists
8639 : see if atolf exists
8643 : see if atoll exists
8647 : Look for GNU-cc style attribute checking
8649 echo "Checking whether your compiler can handle __attribute__ ..." >&4
8650 $cat >attrib.c <<'EOCP'
8652 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
8654 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
8655 if $contains 'warning' attrib.out >/dev/null 2>&1; then
8656 echo "Your C compiler doesn't fully support __attribute__."
8659 echo "Your C compiler supports __attribute__."
8663 echo "Your C compiler doesn't seem to understand __attribute__ at all."
8670 : see if bcmp exists
8674 : see if bcopy exists
8678 : see if this is a unistd.h system
8679 set unistd.h i_unistd
8682 : see if getpgrp exists
8683 set getpgrp d_getpgrp
8686 case "$d_getpgrp" in
8689 echo "Checking to see which flavor of getpgrp is in use..."
8692 #include <sys/types.h>
8694 # include <unistd.h>
8698 if (getuid() == 0) {
8699 printf("(I see you are running Configure as super-user...)\n");
8703 if (getpgrp(1) == 0)
8712 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
8713 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
8715 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
8716 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
8719 echo "I can't seem to compile and run the test program."
8721 xxx="a USG one, i.e. you use getpgrp()."
8723 # SVR4 systems can appear rather BSD-ish.
8726 xxx="a BSD one, i.e. you use getpgrp(pid)."
8730 xxx="probably a USG one, i.e. you use getpgrp()."
8735 echo "Assuming your getpgrp is $xxx" >&4
8744 : see if setpgrp exists
8745 set setpgrp d_setpgrp
8748 case "$d_setpgrp" in
8751 echo "Checking to see which flavor of setpgrp is in use..."
8754 #include <sys/types.h>
8756 # include <unistd.h>
8760 if (getuid() == 0) {
8761 printf("(I see you are running Configure as super-user...)\n");
8765 if (-1 == setpgrp(1, 1))
8768 if (setpgrp() != -1)
8774 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
8775 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
8777 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
8778 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
8781 echo "(I can't seem to compile and run the test program.)"
8783 xxx="a USG one, i.e. you use setpgrp()."
8785 # SVR4 systems can appear rather BSD-ish.
8788 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
8792 xxx="probably a USG one, i.e. you use setpgrp()."
8797 echo "Assuming your setpgrp is $xxx" >&4
8805 : see if bzero exists
8809 : see if signal is declared as pointer to function returning int or void
8811 xxx=`./findhdr signal.h`
8812 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
8813 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
8814 echo "You have int (*signal())() instead of void." >&4
8816 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
8817 echo "You have void (*signal())()." >&4
8819 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
8820 echo "You have int (*signal())() instead of void." >&4
8822 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
8823 echo "You have void (*signal())()." >&4
8826 case "$d_voidsig" in
8828 echo "I can't determine whether signal handler returns void or int..." >&4
8830 rp="What type does your signal handler return?"
8837 echo "As you already told me, signal handler returns void." >&4
8840 *) echo "As you already told me, signal handler returns int." >&4
8847 case "$d_voidsig" in
8848 "$define") signal_t="void";;
8853 : check for ability to cast large floats to 32-bit ints.
8855 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
8856 if $test "$intsize" -ge 4; then
8863 #include <sys/types.h>
8865 $signal_t blech(s) int s; { exit(3); }
8872 signal(SIGFPE, blech);
8874 /* Don't let compiler optimize the test away. Store the number
8875 in a writable string for gcc to pass to sscanf under HP/UX.
8877 sprintf(str, "2147483647");
8878 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
8882 /* x86 processors will probably give 0x8000 0000, which is a
8883 sign change. We don't want that. We want to mimic SPARC
8884 behavior here, which is to preserve the sign and give
8887 if (i32 != ($xxx) f)
8893 if eval $compile_ok; then
8897 echo "(I can't seem to compile the test program--assuming it can't)"
8905 echo "Nope, it can't."
8912 : check for ability to cast negative floats to unsigned
8914 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
8917 #include <sys/types.h>
8919 $signal_t blech(s) int s; { exit(7); }
8920 $signal_t blech_in_list(s) int s; { exit(4); }
8921 unsigned long dummy_long(p) unsigned long p; { return p; }
8922 unsigned int dummy_int(p) unsigned int p; { return p; }
8923 unsigned short dummy_short(p) unsigned short p; { return p; }
8927 unsigned long along;
8929 unsigned short ashort;
8933 /* Frustrate gcc-2.7.2's optimizer which failed this test with
8934 a direct f = -123. assignment. gcc-2.8.0 reportedly
8935 optimized the whole file away
8937 /* Store the number in a writable string for gcc to pass to
8940 sprintf(str, "-123");
8941 sscanf(str, "%lf", &f); /* f = -123.; */
8943 signal(SIGFPE, blech);
8944 along = (unsigned long)f;
8945 aint = (unsigned int)f;
8946 ashort = (unsigned short)f;
8947 if (along != (unsigned long)-123)
8949 if (aint != (unsigned int)-123)
8951 if (ashort != (unsigned short)-123)
8953 sprintf(str, "1073741824.");
8954 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
8957 along = (unsigned long)f;
8958 if (along != 0x80000000)
8962 along = (unsigned long)f;
8963 if (along != 0x7fffffff)
8967 along = (unsigned long)f;
8968 if (along != 0x80000001)
8972 signal(SIGFPE, blech_in_list);
8973 sprintf(str, "123.");
8974 sscanf(str, "%lf", &f); /* f = 123.; */
8975 along = dummy_long((unsigned long)f);
8976 aint = dummy_int((unsigned int)f);
8977 ashort = dummy_short((unsigned short)f);
8978 if (along != (unsigned long)123)
8980 if (aint != (unsigned int)123)
8982 if (ashort != (unsigned short)123)
8989 if eval $compile_ok; then
8993 echo "(I can't seem to compile the test program--assuming it can't)"
8996 case "$castflags" in
9001 echo "Nope, it can't."
9008 : see if vprintf exists
9010 if set vprintf val -f d_vprintf; eval $csym; $val; then
9011 echo 'vprintf() found.' >&4
9014 #include <varargs.h>
9016 int main() { xxx("foo"); }
9025 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
9029 if eval $compile && $run ./try; then
9030 echo "Your vsprintf() returns (int)." >&4
9033 echo "Your vsprintf() returns (char*)." >&4
9037 echo 'vprintf() NOT found.' >&4
9048 : see if chown exists
9052 : see if chroot exists
9056 : see if chsize exists
9060 hasstruct='varname=$1; struct=$2; shift; shift;
9061 while $test $# -ge 2; do
9063 $define) echo "#include <$2>";;
9067 echo "int main () { struct $struct foo; }" >> try.c;
9069 if eval $compile; then
9078 : see if sys/types.h has to be included
9079 set sys/types.h i_systypes
9082 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
9083 while $test $# -ge 2; do
9085 $define) echo "#include <$2>";;
9089 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
9091 if eval $compile; then
9102 : see whether socket exists
9104 $echo $n "Hmm... $c" >&4
9105 if set socket val -f d_socket; eval $csym; $val; then
9106 echo "Looks like you have Berkeley networking support." >&4
9108 if set setsockopt val -f; eval $csym; $val; then
9111 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
9115 if $contains socklib libc.list >/dev/null 2>&1; then
9116 echo "Looks like you have Berkeley networking support." >&4
9118 : we will have to assume that it supports the 4.2 BSD interface
9121 echo "You don't have Berkeley networking in libc$_a..." >&4
9122 if test "X$d_socket" = "X$define"; then
9123 echo "...but you seem to believe that you have sockets." >&4
9125 for net in net socket
9127 if test -f /usr/lib/lib$net$_a; then
9128 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
9129 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
9130 if $contains socket libc.list >/dev/null 2>&1; then
9135 echo "...but the Wollongong group seems to have hacked it in." >&4
9136 sockethdr="-I/usr/netinclude"
9139 echo "Found Berkeley sockets interface in lib$net." >& 4
9140 if $contains setsockopt libc.list >/dev/null 2>&1; then
9143 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
9150 if test "X$d_socket" != "X$define"; then
9151 echo "or anywhere else I see." >&4
9159 : see if socketpair exists
9160 set socketpair d_sockpair
9165 echo "Checking the availability of certain socket constants..." >& 4
9166 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
9167 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
9169 #include <sys/types.h>
9170 #include <sys/socket.h>
9176 set try; if eval $compile; then
9179 set d_${enum}; eval $setvar
9183 : see if this is a sys/uio.h system
9184 set sys/uio.h i_sysuio
9189 echo "Checking to see if your system supports struct cmsghdr..." >&4
9190 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
9192 case "$d_cmsghdr_s" in
9193 "$define") echo "Yes, it does." ;;
9194 *) echo "No, it doesn't." ;;
9198 : check for const keyword
9200 echo 'Checking to see if your C compiler knows about "const"...' >&4
9201 $cat >const.c <<'EOCP'
9202 typedef struct spug { int drokk; } spug;
9209 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
9211 echo "Yup, it does."
9214 echo "Nope, it doesn't."
9219 : see if crypt exists
9221 if set crypt val -f d_crypt; eval $csym; $val; then
9222 echo 'crypt() found.' >&4
9226 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
9227 if $test -z "$cryptlib"; then
9228 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
9232 if $test -z "$cryptlib"; then
9233 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
9237 if $test -z "$cryptlib"; then
9238 cryptlib=`./loc libcrypt$_a "" $libpth`
9242 if $test -z "$cryptlib"; then
9243 echo 'crypt() NOT found.' >&4
9252 : get csh whereabouts
9254 'csh') val="$undef" ;;
9259 : Respect a hint or command line value for full_csh.
9261 '') full_csh=$csh ;;
9264 : see if cuserid exists
9265 set cuserid d_cuserid
9268 : see if this is a limits.h system
9269 set limits.h i_limits
9272 : see if this is a float.h system
9276 : See if number of significant digits in a double precision number is known
9278 $cat >dbl_dig.c <<EOM
9288 printf("Contains DBL_DIG");
9291 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
9292 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
9293 echo "DBL_DIG found." >&4
9296 echo "DBL_DIG NOT found." >&4
9303 hasproto='varname=$1; func=$2; shift; shift;
9304 while $test $# -ge 2; do
9306 $define) echo "#include <$2>";;
9310 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
9311 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
9312 echo "$func() prototype found.";
9315 echo "$func() prototype NOT found.";
9320 $rm -f try.c tryout.c'
9322 : see if dbm.h is available
9323 : see if dbmclose exists
9324 set dbmclose d_dbmclose
9327 case "$d_dbmclose" in
9337 *) set rpcsvc/dbm.h i_rpcsvcdbm
9342 *) echo "We won't be including <dbm.h>"
9352 : see if prototype for dbminit is available
9354 set d_dbminitproto dbminit $i_dbm dbm.h
9357 : see if difftime exists
9358 set difftime d_difftime
9361 : see if this is a dirent system
9363 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
9365 echo "<dirent.h> found." >&4
9368 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
9369 echo "<sys/dir.h> found." >&4
9372 xinc=`./findhdr sys/ndir.h`
9374 echo "<dirent.h> NOT found." >&4
9379 : Look for type of directory structure.
9381 $cppstdin $cppflags $cppminus < "$xinc" > try.c
9383 case "$direntrytype" in
9386 $define) guess1='struct dirent' ;;
9387 *) guess1='struct direct' ;;
9390 *) guess1="$direntrytype"
9395 'struct dirent') guess2='struct direct' ;;
9396 *) guess2='struct dirent' ;;
9399 if $contains "$guess1" try.c >/dev/null 2>&1; then
9400 direntrytype="$guess1"
9401 echo "Your directory entries are $direntrytype." >&4
9402 elif $contains "$guess2" try.c >/dev/null 2>&1; then
9403 direntrytype="$guess2"
9404 echo "Your directory entries seem to be $direntrytype." >&4
9406 echo "I don't recognize your system's directory entries." >&4
9407 rp="What type is used for directory entries on this system?"
9415 : see if the directory entry stores field length
9417 $cppstdin $cppflags $cppminus < "$xinc" > try.c
9418 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
9419 echo "Good, your directory entry keeps length information in d_namlen." >&4
9422 echo "Your directory entry does not know about the d_namlen field." >&4
9429 : see if dlerror exists
9432 set dlerror d_dlerror
9436 : see if dlfcn is available
9444 On a few systems, the dynamically loaded modules that perl generates and uses
9445 will need a different extension than shared libs. The default will probably
9453 rp='What is the extension of dynamically loaded modules'
9462 : Check if dlsym need a leading underscore
9468 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
9469 $cat >dyna.c <<'EOM'
9478 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
9480 #include <sys/types.h>
9494 int mode = RTLD_LAZY ;
9496 handle = dlopen("./dyna.$dlext", mode) ;
9497 if (handle == NULL) {
9502 symbol = dlsym(handle, "fred") ;
9503 if (symbol == NULL) {
9504 /* try putting a leading underscore */
9505 symbol = dlsym(handle, "_fred") ;
9506 if (symbol == NULL) {
9519 : Call the object file tmp-dyna.o in case dlext=o.
9520 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
9521 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
9522 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
9523 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
9526 1) echo "Test program failed using dlopen." >&4
9527 echo "Perhaps you should not use dynamic loading." >&4;;
9528 2) echo "Test program failed using dlsym." >&4
9529 echo "Perhaps you should not use dynamic loading." >&4;;
9530 3) echo "dlsym needs a leading underscore" >&4
9532 4) echo "dlsym doesn't need a leading underscore." >&4;;
9535 echo "I can't compile and run the test program." >&4
9536 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
9541 $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
9546 : see if prototype for drand48 is available
9548 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
9551 : see if dup2 exists
9555 : see if eaccess exists
9556 set eaccess d_eaccess
9559 : see if endgrent exists
9560 set endgrent d_endgrent
9563 : see if endhostent exists
9564 set endhostent d_endhent
9567 : see if endnetent exists
9568 set endnetent d_endnent
9571 : see if endprotoent exists
9572 set endprotoent d_endpent
9575 : see if endpwent exists
9576 set endpwent d_endpwent
9579 : see if endservent exists
9580 set endservent d_endsent
9583 : Locate the flags for 'open()'
9585 $cat >try.c <<'EOCP'
9586 #include <sys/types.h>
9591 #include <sys/file.h>
9602 : check sys/file.h first to get FREAD on Sun
9603 if $test `./findhdr sys/file.h` && \
9604 set try -DI_SYS_FILE && eval $compile; then
9606 echo "<sys/file.h> defines the O_* constants..." >&4
9608 echo "and you have the 3 argument form of open()." >&4
9611 echo "but not the 3 argument form of open(). Oh, well." >&4
9614 elif $test `./findhdr fcntl.h` && \
9615 set try -DI_FCNTL && eval $compile; then
9617 echo "<fcntl.h> defines the O_* constants..." >&4
9619 echo "and you have the 3 argument form of open()." >&4
9622 echo "but not the 3 argument form of open(). Oh, well." >&4
9627 echo "I can't find the O_* constant definitions! You got problems." >&4
9633 : see which of string.h or strings.h is needed
9635 strings=`./findhdr string.h`
9636 if $test "$strings" && $test -r "$strings"; then
9637 echo "Using <string.h> instead of <strings.h>." >&4
9641 strings=`./findhdr strings.h`
9642 if $test "$strings" && $test -r "$strings"; then
9643 echo "Using <strings.h> instead of <string.h>." >&4
9645 echo "No string header found -- You'll surely have problems." >&4
9651 "$undef") strings=`./findhdr strings.h`;;
9652 *) strings=`./findhdr string.h`;;
9655 : check for non-blocking I/O stuff
9656 case "$h_sysfile" in
9657 true) echo "#include <sys/file.h>" > head.c;;
9660 true) echo "#include <fcntl.h>" > head.c;;
9661 *) echo "#include <sys/fcntl.h>" > head.c;;
9666 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
9667 case "$o_nonblock" in
9670 $cat >>try.c <<'EOCP'
9674 printf("O_NONBLOCK\n");
9678 printf("O_NDELAY\n");
9682 printf("FNDELAY\n");
9689 if eval $compile_ok; then
9690 o_nonblock=`$run ./try`
9691 case "$o_nonblock" in
9692 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
9693 *) echo "Seems like we can use $o_nonblock.";;
9696 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
9699 *) echo "Using $hint value $o_nonblock.";;
9701 $rm -f try try.* .out core
9704 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
9710 #include <sys/types.h>
9713 #define MY_O_NONBLOCK $o_nonblock
9714 #ifndef errno /* XXX need better Configure test */
9725 #include <strings.h>
9727 $signal_t blech(x) int x; { exit(3); }
9729 $cat >> try.c <<'EOCP'
9737 pipe(pd); /* Down: child -> parent */
9738 pipe(pu); /* Up: parent -> child */
9741 close(pd[1]); /* Parent reads from pd[0] */
9742 close(pu[0]); /* Parent writes (blocking) to pu[1] */
9744 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
9749 signal(SIGALRM, blech);
9751 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
9753 sprintf(string, "%d\n", ret);
9754 write(2, string, strlen(string));
9757 if (errno == EAGAIN) {
9763 if (errno == EWOULDBLOCK)
9764 printf("EWOULDBLOCK\n");
9767 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
9768 sleep(2); /* Give it time to close our pipe */
9770 ret = read(pd[0], buf, 1); /* Should read EOF */
9772 sprintf(string, "%d\n", ret);
9773 write(3, string, strlen(string));
9777 close(pd[0]); /* We write to pd[1] */
9778 close(pu[1]); /* We read from pu[0] */
9779 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
9780 close(pd[1]); /* Pipe pd is now fully closed! */
9781 exit(0); /* Bye bye, thank you for playing! */
9785 if eval $compile_ok; then
9786 echo "$startsh" >mtry
9787 echo "$run ./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
9789 ./mtry >/dev/null 2>&1
9791 0) eagain=`$cat try.out`;;
9792 1) echo "Could not perform non-blocking setting!";;
9793 2) echo "I did a successful read() for something that was not there!";;
9794 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
9795 4) echo "Could not find F_SETFL!";;
9796 *) echo "Something terribly wrong happened during testing.";;
9798 rd_nodata=`$cat try.ret`
9799 echo "A read() system call with no data present returns $rd_nodata."
9800 case "$rd_nodata" in
9803 echo "(That's peculiar, fixing that to be -1.)"
9809 echo "Forcing errno EAGAIN on read() with no data available."
9813 echo "Your read() sets errno to $eagain when no data is available."
9816 status=`$cat try.err`
9818 0) echo "And it correctly returns 0 to signal EOF.";;
9819 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
9820 *) echo "However, your read() returns '$status' on EOF??";;
9823 if test "$status" = "$rd_nodata"; then
9824 echo "WARNING: you can't distinguish between EOF and no data!"
9828 echo "I can't compile the test program--assuming errno EAGAIN will do."
9835 echo "Using $hint value $eagain."
9836 echo "Your read() returns $rd_nodata when no data is present."
9837 case "$d_eofnblk" in
9838 "$define") echo "And you can see EOF because read() returns 0.";;
9839 "$undef") echo "But you can't see EOF status from read() returned value.";;
9841 echo "(Assuming you can't see EOF status from read anyway.)"
9847 $rm -f try try.* .out core head.c mtry
9849 : see if fchdir exists
9853 : see if fchmod exists
9857 : see if fchown exists
9861 : see if this is an fcntl system
9866 : See if fcntl-based locking works.
9872 $signal_t blech(x) int x; { exit(3); }
9874 #if defined(F_SETLK) && defined(F_SETLKW)
9877 fd = open("try.c", O_RDONLY);
9878 flock.l_type = F_RDLCK;
9879 flock.l_whence = SEEK_SET;
9880 flock.l_start = flock.l_len = 0;
9881 signal(SIGALRM, blech);
9883 retval = fcntl(fd, F_SETLK, &flock);
9885 (retval < 0 ? exit(2) : exit(0));
9891 echo "Checking if fcntl-based file locking works... "
9895 if eval $compile_ok; then
9897 echo "Yes, it seems to work."
9900 echo "Nope, it didn't work."
9905 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
9906 *** This is (almost) impossible.
9907 *** If your NFS lock daemons are not feeling well, something like
9908 *** this may happen, please investigate. Cannot continue, aborting.
9916 echo "I'm unable to compile the test program, so I'll assume not."
9921 echo "Nope, since you don't even have fcntl()."
9924 set d_fcntl_can_lock
9929 : see if sys/select.h has to be included
9930 set sys/select.h i_sysselct
9933 : see if we should include time.h, sys/time.h, or both
9935 if test "X$timeincl" = X; then
9936 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9937 $echo $n "I'm now running the test program...$c"
9938 $cat >try.c <<'EOCP'
9939 #include <sys/types.h>
9944 #ifdef SYSTIMEKERNEL
9947 #include <sys/time.h>
9950 #include <sys/select.h>
9959 struct timezone tzp;
9961 if (foo.tm_sec == foo.tm_sec)
9964 if (bar.tv_sec == bar.tv_sec)
9971 for s_timezone in '-DS_TIMEZONE' ''; do
9973 for s_timeval in '-DS_TIMEVAL' ''; do
9974 for i_systimek in '' '-DSYSTIMEKERNEL'; do
9975 for i_time in '' '-DI_TIME'; do
9976 for i_systime in '-DI_SYSTIME' ''; do
9979 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
9980 if eval $compile; then
9981 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
9985 $echo $n "Succeeded with $flags$c"
9997 *SYSTIMEKERNEL*) i_systimek="$define"
9998 timeincl=`./findhdr sys/time.h`
9999 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10000 *) i_systimek="$undef";;
10003 *I_TIME*) i_time="$define"
10004 timeincl=`./findhdr time.h`" $timeincl"
10005 echo "We'll include <time.h>." >&4;;
10006 *) i_time="$undef";;
10009 *I_SYSTIME*) i_systime="$define"
10010 timeincl=`./findhdr sys/time.h`" $timeincl"
10011 echo "We'll include <sys/time.h>." >&4;;
10012 *) i_systime="$undef";;
10017 : check for fd_set items
10020 Checking to see how well your C compiler handles fd_set and friends ...
10023 #$i_systime I_SYS_TIME
10024 #$i_sysselct I_SYS_SELECT
10025 #$d_socket HAS_SOCKET
10026 #include <sys/types.h>
10028 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
10031 #include <sys/time.h>
10033 #ifdef I_SYS_SELECT
10034 #include <sys/select.h>
10043 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
10051 if eval $compile; then
10052 d_fds_bits="$define"
10054 echo "Well, your system knows about the normal fd_set typedef..." >&4
10055 if $run ./try; then
10056 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
10057 d_fd_macros="$define"
10060 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
10062 d_fd_macros="$undef"
10066 Hmm, your compiler has some difficulty with fd_set. Checking further...
10069 if eval $compile; then
10070 d_fds_bits="$undef"
10072 echo "Well, your system has some sort of fd_set available..." >&4
10073 if $run ./try; then
10074 echo "and you have the normal fd_set macros." >&4
10075 d_fd_macros="$define"
10078 but not the normal fd_set macros! Gross! More work for me...
10080 d_fd_macros="$undef"
10083 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
10085 d_fds_bits="$undef"
10086 d_fd_macros="$undef"
10091 : see if fgetpos exists
10092 set fgetpos d_fgetpos
10095 : see if flock exists
10099 : see if this is a sys/file.h system
10104 : do we need to include sys/file.h ?
10108 if $h_sysfile; then
10110 echo "We'll be including <sys/file.h>." >&4
10113 echo "We won't be including <sys/file.h>." >&4
10123 : see if prototype for flock is available
10125 set d_flockproto flock $i_sysfile sys/file.h
10128 : see if fork exists
10132 : see if pathconf exists
10133 set pathconf d_pathconf
10136 : see if fpathconf exists
10137 set fpathconf d_fpathconf
10141 : check for fpos64_t
10143 echo "Checking to see if you have fpos64_t..." >&4
10146 int main() { fpos64_t x = 7; }
10149 if eval $compile; then
10151 echo "You have fpos64_t."
10154 echo "You do not have fpos64_t."
10155 case "$fpossize" in
10156 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
10163 : see if frexpl exists
10164 set frexpl d_frexpl
10167 : see if this is a sys/param system
10168 set sys/param.h i_sysparam
10171 : see if this is a sys/mount.h system
10172 set sys/mount.h i_sysmount
10177 echo "Checking to see if your system supports struct fs_data..." >&4
10178 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
10180 case "$d_fs_data_s" in
10181 "$define") echo "Yes, it does." ;;
10182 *) echo "No, it doesn't." ;;
10185 : see if fseeko exists
10186 set fseeko d_fseeko
10188 case "$longsize" in
10189 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
10192 : see if fsetpos exists
10193 set fsetpos d_fsetpos
10197 : see if fstatfs exists
10198 set fstatfs d_fstatfs
10202 : see if statvfs exists
10203 set statvfs d_statvfs
10206 : see if fstatvfs exists
10207 set fstatvfs d_fstatvfs
10211 : see if fsync exists
10215 : see if ftello exists
10216 set ftello d_ftello
10218 case "$longsize" in
10219 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
10222 : see if getcwd exists
10223 set getcwd d_getcwd
10226 : see if getespwnam exists
10227 set getespwnam d_getespwnam
10231 : see if getfsstat exists
10232 set getfsstat d_getfsstat
10235 : see if getgrent exists
10236 set getgrent d_getgrent
10239 : see if gethostbyaddr exists
10240 set gethostbyaddr d_gethbyaddr
10243 : see if gethostbyname exists
10244 set gethostbyname d_gethbyname
10247 : see if gethostent exists
10248 set gethostent d_gethent
10251 : see how we will look up host name
10254 if set gethostname val -f d_gethname; eval $csym; $val; then
10255 echo 'gethostname() found.' >&4
10256 d_gethname="$define"
10259 if set uname val -f d_uname; eval $csym; $val; then
10262 uname() was found, but you're running xenix, and older versions of xenix
10263 have a broken uname(). If you don't really know whether your xenix is old
10264 enough to have a broken system call, use the default answer.
10269 "$define") dflt=n;;
10271 rp='Is your uname() broken?'
10274 n*) d_uname="$define"; call=uname;;
10277 echo 'uname() found.' >&4
10284 case "$d_gethname" in
10285 '') d_gethname="$undef";;
10288 '') d_uname="$undef";;
10290 case "$d_uname$d_gethname" in
10295 Every now and then someone has a $call() that lies about the hostname
10296 but can't be fixed for political or economic reasons. If you wish, I can
10297 pretend $call() isn't there and maybe compute hostname at run-time
10298 thanks to the '$phostname' command.
10301 rp="Shall I ignore $call() from now on?"
10304 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
10307 case "$phostname" in
10308 '') aphostname='';;
10309 *) case "$aphostname" in
10311 *) set X $phostname
10315 file=`./loc $file $file $pth`
10316 aphostname=`echo $file $*`
10321 case "$d_uname$d_gethname" in
10324 case "$phostname" in
10326 echo "There will be no way for $package to get your hostname." >&4;;
10328 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
10332 case "$d_phostname" in
10333 '') d_phostname="$undef";;
10336 : see if this is a netdb.h system
10337 set netdb.h i_netdb
10340 : see if prototypes for various gethostxxx netdb.h functions are available
10342 set d_gethostprotos gethostent $i_netdb netdb.h
10345 : see if getitimer exists
10346 set getitimer d_getitimer
10349 : see if getlogin exists
10350 set getlogin d_getlogin
10353 : see if getmnt exists
10354 set getmnt d_getmnt
10357 : see if getmntent exists
10358 set getmntent d_getmntent
10361 : see if getnetbyaddr exists
10362 set getnetbyaddr d_getnbyaddr
10365 : see if getnetbyname exists
10366 set getnetbyname d_getnbyname
10369 : see if getnetent exists
10370 set getnetent d_getnent
10373 : see if prototypes for various getnetxxx netdb.h functions are available
10375 set d_getnetprotos getnetent $i_netdb netdb.h
10378 : see if getpagesize exists
10379 set getpagesize d_getpagsz
10383 : see if getprotobyname exists
10384 set getprotobyname d_getpbyname
10387 : see if getprotobynumber exists
10388 set getprotobynumber d_getpbynumber
10391 : see if getprotoent exists
10392 set getprotoent d_getpent
10395 : see if getpgid exists
10396 set getpgid d_getpgid
10399 : see if getpgrp2 exists
10400 set getpgrp2 d_getpgrp2
10403 : see if getppid exists
10404 set getppid d_getppid
10407 : see if getpriority exists
10408 set getpriority d_getprior
10411 : see if prototypes for various getprotoxxx netdb.h functions are available
10413 set d_getprotoprotos getprotoent $i_netdb netdb.h
10416 : see if getprpwnam exists
10417 set getprpwnam d_getprpwnam
10420 : see if getpwent exists
10421 set getpwent d_getpwent
10425 : see if getservbyname exists
10426 set getservbyname d_getsbyname
10429 : see if getservbyport exists
10430 set getservbyport d_getsbyport
10433 : see if getservent exists
10434 set getservent d_getsent
10437 : see if prototypes for various getservxxx netdb.h functions are available
10439 set d_getservprotos getservent $i_netdb netdb.h
10442 : see if getspnam exists
10443 set getspnam d_getspnam
10446 : see if gettimeofday or ftime exists
10447 set gettimeofday d_gettimeod
10449 case "$d_gettimeod" in
10455 val="$undef"; set d_ftime; eval $setvar
10458 case "$d_gettimeod$d_ftime" in
10461 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
10465 : see if this is an grp system
10471 xxx=`./findhdr grp.h`
10472 $cppstdin $cppflags $cppminus < $xxx >$$.h
10474 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
10486 set d_grpasswd; eval $setvar
10490 : see if hasmntopt exists
10491 set hasmntopt d_hasmntopt
10494 : see if this is a netinet/in.h or sys/in.h system
10495 set netinet/in.h i_niin sys/in.h i_sysin
10498 : see if arpa/inet.h has to be included
10499 set arpa/inet.h i_arpainet
10502 : see if htonl --and friends-- exists
10507 : Maybe they are macros.
10510 $cat >htonl.c <<EOM
10512 #include <sys/types.h>
10513 #$i_niin I_NETINET_IN
10515 #$i_arpainet I_ARPA_INET
10516 #ifdef I_NETINET_IN
10517 #include <netinet/in.h>
10520 #include <sys/in.h>
10523 #include <arpa/inet.h>
10526 printf("Defined as a macro.");
10529 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
10530 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
10532 echo "But it seems to be defined as a macro." >&4
10540 : see if iconv exists
10546 if set index val -f; eval $csym; $val; then
10547 if set strchr val -f d_strchr; eval $csym; $val; then
10548 if $contains strchr "$strings" >/dev/null 2>&1 ; then
10551 echo "strchr() found." >&4
10555 echo "index() found." >&4
10560 echo "index() found." >&4
10563 if set strchr val -f d_strchr; eval $csym; $val; then
10566 echo "strchr() found." >&4
10568 echo "No index() or strchr() found!" >&4
10573 set d_strchr; eval $setvar
10575 set d_index; eval $setvar
10577 : check whether inet_aton exists
10578 set inet_aton d_inetaton
10583 $cat >isascii.c <<'EOCP'
10595 if eval $compile; then
10596 echo "isascii() found." >&4
10599 echo "isascii() NOT found." >&4
10606 : see if isnan exists
10610 : see if isnanl exists
10611 set isnanl d_isnanl
10614 : see if killpg exists
10615 set killpg d_killpg
10618 : see if lchown exists
10620 $cat > try.c <<'EOCP'
10621 /* System header to define __stub macros and hopefully few prototypes,
10622 which can conflict with char lchown(); below. */
10623 #include <assert.h>
10624 /* Override any gcc2 internal prototype to avoid an error. */
10625 /* We use char because int might match the return type of a gcc2
10626 builtin and then its argument prototype would still apply. */
10629 /* The GNU C library defines this for functions which it implements
10630 to always fail with ENOSYS. Some functions are actually named
10631 something starting with __ and the normal name is an alias. */
10632 #if defined (__stub_lchown) || defined (__stub___lchown)
10640 if eval $compile; then
10641 $echo "lchown() found." >&4
10644 $echo "lchown() NOT found." >&4
10650 : See if number of significant digits in a double precision number is known
10652 $cat >ldbl_dig.c <<EOM
10653 #$i_limits I_LIMITS
10656 #include <limits.h>
10662 printf("Contains LDBL_DIG");
10665 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
10666 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
10667 echo "LDBL_DIG found." >&4
10670 echo "LDBL_DIG NOT found." >&4
10677 : see if link exists
10681 : see if localeconv exists
10682 set localeconv d_locconv
10685 : see if lockf exists
10689 : see if prototype for lseek is available
10691 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
10694 : see if lstat exists
10698 : see if madvise exists
10699 set madvise d_madvise
10702 : see if mblen exists
10706 : see if mbstowcs exists
10707 set mbstowcs d_mbstowcs
10710 : see if mbtowc exists
10711 set mbtowc d_mbtowc
10714 : see if memchr exists
10715 set memchr d_memchr
10718 : see if memcmp exists
10719 set memcmp d_memcmp
10722 : see if memcpy exists
10723 set memcpy d_memcpy
10726 : see if memmove exists
10727 set memmove d_memmove
10730 : see if memset exists
10731 set memset d_memset
10734 : see if mkdir exists
10738 : see if mkdtemp exists
10739 set mkdtemp d_mkdtemp
10742 : see if mkfifo exists
10743 set mkfifo d_mkfifo
10746 : see if mkstemp exists
10747 set mkstemp d_mkstemp
10750 : see if mkstemps exists
10751 set mkstemps d_mkstemps
10754 : see if mktime exists
10755 set mktime d_mktime
10758 : see if this is a sys/mman.h system
10759 set sys/mman.h i_sysmman
10762 : see if mmap exists
10765 : see what shmat returns
10766 : default to something harmless
10768 case "$i_sysmman$d_mmap" in
10770 $cat >mmap.c <<'END'
10771 #include <sys/mman.h>
10774 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
10779 echo "and it returns ($mmaptype)." >&4
10785 : see if modfl exists
10789 d_modfl_pow32_bug="$undef"
10791 case "$d_longdbl$d_modfl" in
10794 Checking to see whether your modfl() is okay for large values...
10800 long double nv = 4294967303.15;
10806 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
10810 case "$osname:$gccversion" in
10811 aix:) saveccflags="$ccflags"
10812 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
10815 if eval $compile; then
10818 *" 4294967303.150000 1.150000 4294967302.000000")
10819 echo >&4 "Your modfl() is broken for large values."
10820 d_modfl_pow32_bug="$define"
10822 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
10826 *" 4294967303.150000 0.150000 4294967303.000000")
10827 echo >&4 "Your modfl() seems okay for large values."
10829 *) echo >&4 "I don't understand your modfl() at all."
10833 $rm -f try.* try core core.try.*
10835 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
10838 case "$osname:$gccversion" in
10839 aix:) ccflags="$saveccflags" ;; # restore
10844 : see if mprotect exists
10845 set mprotect d_mprotect
10848 : see if msgctl exists
10849 set msgctl d_msgctl
10852 : see if msgget exists
10853 set msgget d_msgget
10856 : see if msgsnd exists
10857 set msgsnd d_msgsnd
10860 : see if msgrcv exists
10861 set msgrcv d_msgrcv
10864 : see how much of the 'msg*(2)' library is present.
10867 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
10868 *"$undef"*) h_msg=false;;
10872 case "`ipcs 2>&1`" in
10873 "SVID messages"*"not configured"*)
10874 echo "Your $osname does not have the msg*(2) configured." >&4
10877 set msgctl d_msgctl
10879 set msgget d_msgget
10881 set msgsnd d_msgsnd
10883 set msgrcv d_msgrcv
10889 : we could also check for sys/ipc.h ...
10890 if $h_msg && $test `./findhdr sys/msg.h`; then
10891 echo "You have the full msg*(2) library." >&4
10894 echo "You don't have the full msg*(2) library." >&4
10902 echo "Checking to see if your system supports struct msghdr..." >&4
10903 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
10905 case "$d_msghdr_s" in
10906 "$define") echo "Yes, it does." ;;
10907 *) echo "No, it doesn't." ;;
10911 : see if msync exists
10915 : see if munmap exists
10916 set munmap d_munmap
10919 : see if nice exists
10923 : see if this is a langinfo.h system
10924 set langinfo.h i_langinfo
10927 : see if nl_langinfo exists
10928 set nl_langinfo d_nl_langinfo
10931 : check for length of character
10933 case "$charsize" in
10935 echo "Checking to see how big your characters are (hey, you never know)..." >&4
10936 $cat >try.c <<'EOCP'
10940 printf("%d\n", (int)sizeof(char));
10945 if eval $compile_ok; then
10949 echo "(I can't seem to compile the test program. Guessing...)"
10956 rp="What is the size of a character (in bytes)?"
10961 : check for volatile keyword
10963 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
10964 $cat >try.c <<'EOCP'
10967 typedef struct _goo_struct goo_struct;
10968 goo_struct * volatile goo = ((goo_struct *)0);
10969 struct _goo_struct {
10974 typedef unsigned short foo_t;
10975 char *volatile foo;
10977 volatile foo_t blech;
10981 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
10983 echo "Yup, it does."
10986 echo "Nope, it doesn't."
10994 $echo "Choosing the C types to be used for Perl's internal types..." >&4
10996 case "$use64bitint:$d_quad:$quadtype" in
10999 uvtype="$uquadtype"
11004 uvtype="unsigned long"
11010 case "$uselongdouble:$d_longdbl" in
11012 nvtype="long double"
11013 nvsize=$longdblsize
11020 $echo "(IV will be "$ivtype", $ivsize bytes)"
11021 $echo "(UV will be "$uvtype", $uvsize bytes)"
11022 $echo "(NV will be "$nvtype", $nvsize bytes)"
11025 #$i_inttypes I_INTTYPES
11027 #include <inttypes.h>
11032 int8_t i = INT8_MAX;
11033 uint8_t u = UINT8_MAX;
11034 printf("int8_t\n");
11037 int16_t i = INT16_MAX;
11038 uint16_t i = UINT16_MAX;
11039 printf("int16_t\n");
11042 int32_t i = INT32_MAX;
11043 uint32_t u = UINT32_MAX;
11044 printf("int32_t\n");
11050 '') case "$charsize" in
11052 u8type="unsigned char"
11061 if eval $compile; then
11062 case "`$run ./try`" in
11063 int8_t) i8type=int8_t
11073 '') if $test $charsize -ge 1; then
11075 u8type="unsigned char"
11083 '') case "$shortsize" in
11085 u16type="unsigned short"
11093 '') set try -DINT16
11094 if eval $compile; then
11095 case "`$run ./try`" in
11107 '') if $test $shortsize -ge 2; then
11109 u16type="unsigned short"
11117 '') case "$longsize" in
11119 u32type="unsigned long"
11123 *) case "$intsize" in
11125 u32type="unsigned int"
11135 '') set try -DINT32
11136 if eval $compile; then
11137 case "`$run ./try`" in
11149 '') if $test $intsize -ge 4; then
11151 u32type="unsigned int"
11159 '') case "$d_quad:$quadtype" in
11161 i64type="$quadtype"
11162 u64type="$uquadtype"
11170 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
11171 : volatile so that the compiler has to store it out to memory.
11172 if test X"$d_volatile" = X"$define"; then
11177 #include <sys/types.h>
11178 #include <signal.h>
11180 $volatile int bletched = 0;
11181 $signal_t blech(s) int s; { bletched = 1; }
11186 int n = 8 * $uvsize;
11189 signal(SIGFPE, blech);
11192 for (i = 0; i < n; i++) {
11193 u = u << 1 | ($uvtype)1;
11195 if (($uvtype)d != u)
11199 d = ($nvtype)(u - 1);
11200 if (($uvtype)d != (u - 1))
11208 printf("%d\n", ((i == n) ? -n : i));
11214 d_nv_preserves_uv="$undef"
11215 if eval $compile; then
11216 d_nv_preserves_uv_bits="`$run ./try`"
11218 case "$d_nv_preserves_uv_bits" in
11220 d_nv_preserves_uv_bits=`expr 0 - $d_nv_preserves_uv_bits`
11221 $echo "Your NVs can preserve all $d_nv_preserves_uv_bits bits of your UVs." 2>&1
11222 d_nv_preserves_uv="$define"
11224 [1-9]*) $echo "Your NVs can preserve only $d_nv_preserves_uv_bits bits of your UVs." 2>&1
11225 d_nv_preserves_uv="$undef" ;;
11226 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
11227 d_nv_preserves_uv_bits="$undef" ;;
11233 : check for off64_t
11235 echo "Checking to see if you have off64_t..." >&4
11237 #include <sys/types.h>
11238 #include <unistd.h>
11239 int main() { off64_t x = 7; }
11242 if eval $compile; then
11244 echo "You have off64_t."
11247 echo "You do not have off64_t."
11248 case "$lseeksize" in
11249 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
11256 : see if POSIX threads are available
11257 set pthread.h i_pthread
11263 : how to create joinable pthreads
11264 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
11266 echo "Checking what constant to use for creating joinable pthreads..." >&4
11267 $cat >try.c <<'EOCP'
11268 #include <pthread.h>
11270 int detachstate = JOINABLE;
11273 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
11274 if eval $compile; then
11275 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
11276 val="$undef" # Yes, undef.
11277 set d_old_pthread_create_joinable
11280 set old_pthread_create_joinable
11283 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
11284 if eval $compile; then
11285 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
11287 set d_old_pthread_create_joinable
11289 val=PTHREAD_CREATE_UNDETACHED
11290 set old_pthread_create_joinable
11293 set try -DJOINABLE=__UNDETACHED
11294 if eval $compile; then
11295 echo "You seem to use __UNDETACHED." >&4
11297 set d_old_pthread_create_joinable
11300 set old_pthread_create_joinable
11303 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
11305 set d_old_pthread_create_joinable
11308 set old_pthread_create_joinable
11315 d_old_pthread_create_joinable="$undef"
11316 old_pthread_create_joinable=""
11319 : see if pause exists
11323 : see if pipe exists
11327 : see if poll exists
11332 : see whether the various POSIXish _yields exist
11334 #include <pthread.h>
11340 #ifdef PTHREAD_YIELD
11343 #ifdef PTHREAD_YIELD_NULL
11344 pthread_yield(NULL);
11350 : see if sched_yield exists
11351 set try -DSCHED_YIELD
11352 if eval $compile; then
11354 sched_yield='sched_yield()'
11358 case "$usethreads" in
11361 $define) echo 'sched_yield() found.' >&4 ;;
11362 *) echo 'sched_yield() NOT found.' >&4 ;;
11368 : see if pthread_yield exists
11369 set try -DPTHREAD_YIELD
11370 if eval $compile; then
11372 case "$sched_yield" in
11373 '') sched_yield='pthread_yield()' ;;
11376 set try -DPTHREAD_YIELD_NULL
11377 if eval $compile; then
11379 case "$sched_yield" in
11380 '') sched_yield='pthread_yield(NULL)' ;;
11386 case "$usethreads" in
11389 $define) echo 'pthread_yield() found.' >&4 ;;
11390 *) echo 'pthread_yield() NOT found.' >&4 ;;
11394 set d_pthread_yield
11397 case "$sched_yield" in
11398 '') sched_yield=undef ;;
11403 : see if this is a pwd.h system
11409 xxx=`./findhdr pwd.h`
11410 $cppstdin $cppflags $cppminus < $xxx >$$.h
11412 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
11420 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
11428 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
11436 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
11444 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
11452 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
11460 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
11468 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
11480 set d_pwquota; eval $setvar
11481 set d_pwage; eval $setvar
11482 set d_pwchange; eval $setvar
11483 set d_pwclass; eval $setvar
11484 set d_pwexpire; eval $setvar
11485 set d_pwcomment; eval $setvar
11486 set d_pwgecos; eval $setvar
11487 set d_pwpasswd; eval $setvar
11491 : see if readdir and friends exist
11492 set readdir d_readdir
11494 set seekdir d_seekdir
11496 set telldir d_telldir
11498 set rewinddir d_rewinddir
11501 : see if readlink exists
11502 set readlink d_readlink
11505 : see if readv exists
11509 : see if recvmsg exists
11510 set recvmsg d_recvmsg
11513 : see if rename exists
11514 set rename d_rename
11517 : see if rmdir exists
11521 : see if memory.h is available.
11526 : See if it conflicts with string.h
11532 $cppstdin $cppflags $cppminus < $strings > mem.h
11533 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
11535 echo "We won't be including <memory.h>."
11545 : can bcopy handle overlapping blocks?
11548 case "$d_memmove" in
11549 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
11550 *) case "$d_bcopy" in
11552 echo "Checking to see if bcopy() can do overlapping copies..." >&4
11554 #$i_memory I_MEMORY
11555 #$i_stdlib I_STDLIB
11556 #$i_string I_STRING
11557 #$i_unistd I_UNISTD
11559 $cat >>try.c <<'EOCP'
11562 # include <memory.h>
11565 # include <stdlib.h>
11568 # include <string.h>
11570 # include <strings.h>
11573 # include <unistd.h> /* Needed for NetBSD */
11577 char buf[128], abc[128];
11583 /* Copy "abcde..." string to char abc[] so that gcc doesn't
11584 try to store the string in read-only memory. */
11585 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
11587 for (align = 7; align >= 0; align--) {
11588 for (len = 36; len; len--) {
11590 bcopy(abc, b, len);
11591 for (off = 1; off <= len; off++) {
11592 bcopy(b, b+off, len);
11593 bcopy(b+off, b, len);
11594 if (bcmp(b, abc, len))
11603 if eval $compile_ok; then
11604 if ./try 2>/dev/null; then
11605 echo "Yes, it can."
11608 echo "It can't, sorry."
11611 echo "(I can't compile the test program, so we'll assume not...)"
11615 $rm -f try.* try core
11621 : can memcpy handle overlapping blocks?
11624 case "$d_memmove" in
11625 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
11626 *) case "$d_memcpy" in
11628 echo "Checking to see if memcpy() can do overlapping copies..." >&4
11630 #$i_memory I_MEMORY
11631 #$i_stdlib I_STDLIB
11632 #$i_string I_STRING
11633 #$i_unistd I_UNISTD
11635 $cat >>try.c <<'EOCP'
11638 # include <memory.h>
11641 # include <stdlib.h>
11644 # include <string.h>
11646 # include <strings.h>
11649 # include <unistd.h> /* Needed for NetBSD */
11653 char buf[128], abc[128];
11659 /* Copy "abcde..." string to char abc[] so that gcc doesn't
11660 try to store the string in read-only memory. */
11661 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
11663 for (align = 7; align >= 0; align--) {
11664 for (len = 36; len; len--) {
11666 memcpy(b, abc, len);
11667 for (off = 1; off <= len; off++) {
11668 memcpy(b+off, b, len);
11669 memcpy(b, b+off, len);
11670 if (memcmp(b, abc, len))
11679 if eval $compile_ok; then
11680 if ./try 2>/dev/null; then
11681 echo "Yes, it can."
11684 echo "It can't, sorry."
11687 echo "(I can't compile the test program, so we'll assume not...)"
11691 $rm -f try.* try core
11697 : can memcmp be trusted to compare relative magnitude?
11699 case "$d_memcmp" in
11702 echo "Checking if your memcmp() can compare relative magnitude..." >&4
11704 #$i_memory I_MEMORY
11705 #$i_stdlib I_STDLIB
11706 #$i_string I_STRING
11707 #$i_unistd I_UNISTD
11709 $cat >>try.c <<'EOCP'
11712 # include <memory.h>
11715 # include <stdlib.h>
11718 # include <string.h>
11720 # include <strings.h>
11723 # include <unistd.h> /* Needed for NetBSD */
11729 if ((a < b) && memcmp(&a, &b, 1) < 0)
11735 if eval $compile_ok; then
11736 if $run ./try 2>/dev/null; then
11737 echo "Yes, it can."
11740 echo "No, it can't (it uses signed chars)."
11743 echo "(I can't compile the test program, so we'll assume not...)"
11747 $rm -f try.* try core
11751 : see if prototype for sbrk is available
11753 set d_sbrkproto sbrk $i_unistd unistd.h
11756 : see if select exists
11757 set select d_select
11760 : see if semctl exists
11761 set semctl d_semctl
11764 : see if semget exists
11765 set semget d_semget
11768 : see if semop exists
11772 : see how much of the 'sem*(2)' library is present.
11775 case "$d_semctl$d_semget$d_semop" in
11776 *"$undef"*) h_sem=false;;
11780 case "`ipcs 2>&1`" in
11781 "SVID messages"*"not configured"*)
11782 echo "Your $osname does not have the sem*(2) configured." >&4
11785 set semctl d_semctl
11787 set semget d_semget
11795 : we could also check for sys/ipc.h ...
11796 if $h_sem && $test `./findhdr sys/sem.h`; then
11797 echo "You have the full sem*(2) library." >&4
11800 echo "You don't have the full sem*(2) library." >&4
11806 : see whether sys/sem.h defines union semun
11808 $cat > try.c <<'END'
11809 #include <sys/types.h>
11810 #include <sys/ipc.h>
11811 #include <sys/sem.h>
11812 int main () { union semun semun; semun.buf = 0; }
11815 if eval $compile; then
11816 echo "You have union semun in <sys/sem.h>." >&4
11819 echo "You do not have union semun in <sys/sem.h>." >&4
11822 $rm -f try try.c try.h
11826 : see how to do semctl IPC_STAT
11829 : see whether semctl IPC_STAT can use union semun
11834 # define S_IRUSR S_IREAD
11835 # define S_IWUSR S_IWRITE
11836 # define S_IXUSR S_IEXEC
11838 # define S_IRUSR 0400
11839 # define S_IWUSR 0200
11840 # define S_IXUSR 0100
11842 # define S_IRGRP (S_IRUSR>>3)
11843 # define S_IWGRP (S_IWUSR>>3)
11844 # define S_IXGRP (S_IXUSR>>3)
11845 # define S_IROTH (S_IRUSR>>6)
11846 # define S_IWOTH (S_IWUSR>>6)
11847 # define S_IXOTH (S_IXUSR>>6)
11850 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
11851 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
11852 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
11857 #include <sys/types.h>
11858 #include <sys/ipc.h>
11859 #include <sys/sem.h>
11860 #include <sys/stat.h>
11867 #$d_union_semun HAS_UNION_SEMUN
11870 #ifndef HAS_UNION_SEMUN
11873 struct semid_ds *buf;
11874 unsigned short *array;
11880 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
11881 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
11883 struct semid_ds argbuf;
11886 st = semctl(sem, 0, IPC_STAT, arg);
11890 # endif /* IPC_STAT */
11891 printf("semctl IPC_STAT failed: errno = %d\n", errno);
11893 if (semctl(sem, 0, IPC_RMID, arg) != 0)
11894 # endif /* IPC_RMID */
11895 printf("semctl IPC_RMID failed: errno = %d\n", errno);
11897 #endif /* IPC_PRIVATE && ... */
11898 printf("semget failed: errno = %d\n", errno);
11904 if eval $compile; then
11907 semun) val="$define" ;;
11913 case "$d_semctl_semun" in
11915 echo "You can use union semun for semctl IPC_STAT." >&4
11918 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
11923 : see whether semctl IPC_STAT can use struct semid_ds pointer
11924 $cat > try.c <<'END'
11925 #include <sys/types.h>
11926 #include <sys/ipc.h>
11927 #include <sys/sem.h>
11928 #include <sys/stat.h>
11936 struct semid_ds arg;
11939 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
11940 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
11943 st = semctl(sem, 0, IPC_STAT, &arg);
11945 printf("semid_ds\n");
11947 # endif /* IPC_STAT */
11948 printf("semctl IPC_STAT failed: errno = %d\n", errno);
11950 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
11951 # endif /* IPC_RMID */
11952 printf("semctl IPC_RMID failed: errno = %d\n", errno);
11954 #endif /* IPC_PRIVATE && ... */
11955 printf("semget failed: errno = %d\n", errno);
11962 if eval $compile; then
11965 semid_ds) val="$define" ;;
11969 set d_semctl_semid_ds
11971 case "$d_semctl_semid_ds" in
11973 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
11975 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
11982 # We do not have the full sem*(2) library, so assume we can not
11988 set d_semctl_semid_ds
11993 : see if sendmsg exists
11994 set sendmsg d_sendmsg
11997 : see if setegid exists
11998 set setegid d_setegid
12001 : see if seteuid exists
12002 set seteuid d_seteuid
12005 : see if setgrent exists
12006 set setgrent d_setgrent
12009 : see if sethostent exists
12010 set sethostent d_sethent
12013 : see if setitimer exists
12014 set setitimer d_setitimer
12017 : see if setlinebuf exists
12018 set setlinebuf d_setlinebuf
12021 : see if setlocale exists
12022 set setlocale d_setlocale
12025 : see if setnetent exists
12026 set setnetent d_setnent
12029 : see if setprotoent exists
12030 set setprotoent d_setpent
12033 : see if setpgid exists
12034 set setpgid d_setpgid
12037 : see if setpgrp2 exists
12038 set setpgrp2 d_setpgrp2
12041 : see if setpriority exists
12042 set setpriority d_setprior
12045 : see if setproctitle exists
12046 set setproctitle d_setproctitle
12049 : see if setpwent exists
12050 set setpwent d_setpwent
12053 : see if setregid exists
12054 set setregid d_setregid
12056 set setresgid d_setresgid
12059 : see if setreuid exists
12060 set setreuid d_setreuid
12062 set setresuid d_setresuid
12065 : see if setrgid exists
12066 set setrgid d_setrgid
12069 : see if setruid exists
12070 set setruid d_setruid
12073 : see if setservent exists
12074 set setservent d_setsent
12077 : see if setsid exists
12078 set setsid d_setsid
12081 : see if setvbuf exists
12082 set setvbuf d_setvbuf
12085 : see if sfio.h is available
12090 : see if sfio library is available
12101 : Ok, but do we want to use it.
12105 true|$define|[yY]*) dflt='y';;
12108 echo "$package can use the sfio library, but it is experimental."
12109 case "$useperlio" in
12111 echo "For sfio also the PerlIO abstraction layer is needed."
12112 echo "Earlier you said you wouldn't want that."
12115 rp="You seem to have sfio available, do you want to try using it?"
12118 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
12119 useperlio="$define"
12122 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
12127 *) case "$usesfio" in
12128 true|$define|[yY]*)
12129 echo "Sorry, cannot find sfio on this machine." >&4
12130 echo "Ignoring your setting of usesfio=$usesfio." >&4
12139 $define) usesfio='true';;
12140 *) usesfio='false';;
12144 *) : Remove sfio from list of libraries to use
12147 echo "Removing unneeded -lsfio from library list" >&4
12148 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
12151 echo "libs = $libs" >&4
12158 : see if shmctl exists
12159 set shmctl d_shmctl
12162 : see if shmget exists
12163 set shmget d_shmget
12166 : see if shmat exists
12169 : see what shmat returns
12172 $cat >shmat.c <<'END'
12173 #include <sys/shm.h>
12176 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
12181 echo "and it returns ($shmattype)." >&4
12182 : see if a prototype for shmat is available
12183 xxx=`./findhdr sys/shm.h`
12184 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
12185 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
12196 set d_shmatprototype
12199 : see if shmdt exists
12203 : see how much of the 'shm*(2)' library is present.
12206 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
12207 *"$undef"*) h_shm=false;;
12211 case "`ipcs 2>&1`" in
12212 "SVID shared memory"*"not configured"*)
12213 echo "Your $osname does not have the shm*(2) configured." >&4
12216 set shmctl d_shmctl
12218 set shmget d_shmget
12228 : we could also check for sys/ipc.h ...
12229 if $h_shm && $test `./findhdr sys/shm.h`; then
12230 echo "You have the full shm*(2) library." >&4
12233 echo "You don't have the full shm*(2) library." >&4
12240 : see if we have sigaction
12241 if set sigaction val -f d_sigaction; eval $csym; $val; then
12242 echo 'sigaction() found.' >&4
12243 $cat > try.c <<'EOP'
12245 #include <sys/types.h>
12246 #include <signal.h>
12249 struct sigaction act, oact;
12251 oact.sa_handler = 0;
12252 /* so that act and oact are used */
12253 exit(act.sa_flags == 0 && oact.sa_handler == 0);
12257 if eval $compile_ok; then
12260 echo "But you don't seem to have a useable struct sigaction." >&4
12264 echo 'sigaction NOT found.' >&4
12267 set d_sigaction; eval $setvar
12268 $rm -f try try$_o try.c
12270 : see if sigprocmask exists
12271 set sigprocmask d_sigprocmask
12274 : see if sigsetjmp exists
12276 case "$d_sigsetjmp" in
12278 $cat >try.c <<'EOP'
12279 #include <setjmp.h>
12284 if (sigsetjmp(env,1))
12287 siglongjmp(env, 1);
12292 if eval $compile; then
12293 if $run ./try >/dev/null 2>&1; then
12294 echo "POSIX sigsetjmp found." >&4
12298 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
12304 echo "sigsetjmp not found." >&4
12308 *) val="$d_sigsetjmp"
12309 case "$d_sigsetjmp" in
12310 $define) echo "POSIX sigsetjmp found." >&4;;
12311 $undef) echo "sigsetjmp not found." >&4;;
12319 : see if sockatmark exists
12320 set sockatmark d_sockatmark
12323 : see if prototype for sockatmark is available
12325 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
12328 : see if socks5_init exists
12329 set socks5_init d_socks5_init
12332 : see if prototype for setresgid is available
12334 set d_sresgproto setresgid $i_unistd unistd.h
12337 : see if prototype for setresuid is available
12339 set d_sresuproto setresuid $i_unistd unistd.h
12342 : see if sys/stat.h is available
12343 set sys/stat.h i_sysstat
12347 : see if stat knows about block sizes
12349 echo "Checking to see if your struct stat has st_blocks field..." >&4
12350 set d_statblks stat st_blocks $i_sysstat sys/stat.h
12354 : see if this is a sys/vfs.h system
12355 set sys/vfs.h i_sysvfs
12359 : see if this is a sys/statfs.h system
12360 set sys/statfs.h i_sysstatfs
12365 echo "Checking to see if your system supports struct statfs..." >&4
12366 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
12368 case "$d_statfs_s" in
12369 "$define") echo "Yes, it does." ;;
12370 *) echo "No, it doesn't." ;;
12375 : see if struct statfs knows about f_flags
12376 case "$d_statfs_s" in
12379 echo "Checking to see if your struct statfs has f_flags field..." >&4
12380 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
12384 set d_statfs_f_flags
12388 case "$d_statfs_f_flags" in
12389 "$define") echo "Yes, it does." ;;
12390 *) echo "No, it doesn't." ;;
12393 : see if _ptr and _cnt from stdio act std
12396 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12397 echo "(Looks like you have stdio.h from BSD.)"
12398 case "$stdio_ptr" in
12399 '') stdio_ptr='((fp)->_p)'
12402 *) ptr_lval=$d_stdio_ptr_lval;;
12404 case "$stdio_cnt" in
12405 '') stdio_cnt='((fp)->_r)'
12408 *) cnt_lval=$d_stdio_cnt_lval;;
12410 case "$stdio_base" in
12411 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12413 case "$stdio_bufsiz" in
12414 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12416 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12417 echo "(Looks like you have stdio.h from Linux.)"
12418 case "$stdio_ptr" in
12419 '') stdio_ptr='((fp)->_IO_read_ptr)'
12422 *) ptr_lval=$d_stdio_ptr_lval;;
12424 case "$stdio_cnt" in
12425 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12428 *) cnt_lval=$d_stdio_cnt_lval;;
12430 case "$stdio_base" in
12431 '') stdio_base='((fp)->_IO_read_base)';;
12433 case "$stdio_bufsiz" in
12434 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12437 case "$stdio_ptr" in
12438 '') stdio_ptr='((fp)->_ptr)'
12441 *) ptr_lval=$d_stdio_ptr_lval;;
12443 case "$stdio_cnt" in
12444 '') stdio_cnt='((fp)->_cnt)'
12447 *) cnt_lval=$d_stdio_cnt_lval;;
12449 case "$stdio_base" in
12450 '') stdio_base='((fp)->_base)';;
12452 case "$stdio_bufsiz" in
12453 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12457 : test whether _ptr and _cnt really work
12458 echo "Checking how std your stdio is..." >&4
12461 #define FILE_ptr(fp) $stdio_ptr
12462 #define FILE_cnt(fp) $stdio_cnt
12464 FILE *fp = fopen("try.c", "r");
12467 18 <= FILE_cnt(fp) &&
12468 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12476 if eval $compile && $to try.c; then
12477 if $run ./try; then
12478 echo "Your stdio acts pretty std."
12481 echo "Your stdio isn't very std."
12484 echo "Your stdio doesn't appear very std."
12490 : Can _ptr be used as an lvalue?
12491 case "$d_stdstdio$ptr_lval" in
12492 $define$define) val=$define ;;
12495 set d_stdio_ptr_lval
12498 : Can _cnt be used as an lvalue?
12499 case "$d_stdstdio$cnt_lval" in
12500 $define$define) val=$define ;;
12503 set d_stdio_cnt_lval
12507 : test whether setting _ptr sets _cnt as a side effect
12508 d_stdio_ptr_lval_sets_cnt="$undef"
12509 d_stdio_ptr_lval_nochange_cnt="$undef"
12510 case "$d_stdio_ptr_lval$d_stdstdio" in
12512 echo "Checking to see what happens if we set the stdio ptr..." >&4
12515 /* Can we scream? */
12516 /* Eat dust sed :-) */
12517 /* In the buffer space, no one can hear you scream. */
12518 #define FILE_ptr(fp) $stdio_ptr
12519 #define FILE_cnt(fp) $stdio_cnt
12520 #include <sys/types.h>
12522 FILE *fp = fopen("try.c", "r");
12527 puts("Fail even to read");
12530 c = getc(fp); /* Read away the first # */
12532 puts("Fail even to read");
12536 18 <= FILE_cnt(fp) &&
12537 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12539 puts("Fail even to read");
12542 ptr = (char*) FILE_ptr(fp);
12543 cnt = (size_t)FILE_cnt(fp);
12545 FILE_ptr(fp) += 42;
12547 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12548 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12551 if (FILE_cnt(fp) <= 20) {
12552 printf ("Fail (<20 chars to test)");
12555 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12556 puts("Fail compare");
12559 if (cnt == FILE_cnt(fp)) {
12560 puts("Pass_unchanged");
12563 if (FILE_cnt(fp) == (cnt - 42)) {
12564 puts("Pass_changed");
12567 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12573 if eval $compile && $to try.c; then
12574 case `$run ./try` in
12576 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12577 d_stdio_ptr_lval_sets_cnt="$define" ;;
12579 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12580 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12582 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12584 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12587 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12593 : see if _base is also standard
12595 case "$d_stdstdio" in
12599 #define FILE_base(fp) $stdio_base
12600 #define FILE_bufsiz(fp) $stdio_bufsiz
12602 FILE *fp = fopen("try.c", "r");
12605 19 <= FILE_bufsiz(fp) &&
12606 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
12613 if eval $compile && $to try.c; then
12614 if $run ./try; then
12615 echo "And its _base field acts std."
12618 echo "But its _base field isn't std."
12621 echo "However, it seems to be lacking the _base field."
12630 Checking how to access stdio streams by file descriptor number...
12632 case "$stdio_stream_array" in
12633 '') $cat >try.c <<EOCP
12636 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
12640 for s in _iob __iob __sF
12642 set try -DSTDIO_STREAM_ARRAY=$s
12643 if eval $compile; then
12644 case "`$run ./try`" in
12645 yes) stdio_stream_array=$s; break ;;
12649 $rm -f try.* try$exe_ext
12651 case "$stdio_stream_array" in
12653 I can't figure out how to access stdio streams by file descriptor number.
12655 d_stdio_stream_array="$undef"
12658 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
12660 d_stdio_stream_array="$define"
12664 : see if strcoll exists
12665 set strcoll d_strcoll
12668 : check for structure copying
12670 echo "Checking to see if your C compiler can copy structs..." >&4
12671 $cat >try.c <<'EOCP'
12681 if $cc -c try.c >/dev/null 2>&1 ; then
12683 echo "Yup, it can."
12686 echo "Nope, it can't."
12692 : see if strerror and/or sys_errlist[] exist
12694 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
12695 if set strerror val -f d_strerror; eval $csym; $val; then
12696 echo 'strerror() found.' >&4
12697 d_strerror="$define"
12698 d_strerrm='strerror(e)'
12699 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
12700 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
12701 d_syserrlst="$define"
12703 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
12704 d_syserrlst="$undef"
12706 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
12707 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
12708 echo 'strerror() found in string header.' >&4
12709 d_strerror="$define"
12710 d_strerrm='strerror(e)'
12711 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
12712 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
12713 d_syserrlst="$define"
12715 echo "(You don't appear to have any sys_errlist[], how can this be?)"
12716 d_syserrlst="$undef"
12718 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
12719 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
12720 d_strerror="$undef"
12721 d_syserrlst="$define"
12722 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
12724 echo 'strerror() and sys_errlist[] NOT found.' >&4
12725 d_strerror="$undef"
12726 d_syserrlst="$undef"
12727 d_strerrm='"unknown"'
12731 : see if strftime exists
12732 set strftime d_strftime
12735 : see if strtod exists
12736 set strtod d_strtod
12739 : see if strtol exists
12740 set strtol d_strtol
12743 : see if strtold exists
12744 set strtold d_strtold
12747 : see if strtoll exists
12748 set strtoll d_strtoll
12751 case "$d_longlong-$d_strtoll" in
12754 Checking whether your strtoll() works okay...
12756 $cat >try.c <<'EOCP'
12759 #define strtoll __strtoll
12762 #define strtoll _strtoll
12765 extern long long int strtoll(char *s, char **, int);
12766 static int bad = 0;
12767 int check(char *s, long long ell, int een) {
12770 gll = strtoll(s, 0, 10);
12771 if (!((gll == ell) && (errno == een)))
12775 check(" 1", 1LL, 0);
12776 check(" 0", 0LL, 0);
12777 check("-1", -1LL, 0);
12778 check("-9223372036854775808", -9223372036854775808LL, 0);
12779 check("-9223372036854775808", -9223372036854775808LL, 0);
12780 check(" 9223372036854775807", 9223372036854775807LL, 0);
12781 check("-9223372036854775808", -9223372036854775808LL, 0);
12782 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
12783 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
12789 if eval $compile; then
12792 ok) echo "Your strtoll() seems to be working okay." ;;
12794 Your strtoll() doesn't seem to be working okay.
12800 echo "(I can't seem to compile the test program--assuming it doesn't)"
12806 : see if strtoq exists
12807 set strtoq d_strtoq
12810 : see if strtoul exists
12811 set strtoul d_strtoul
12814 case "$d_strtoul" in
12817 Checking whether your strtoul() works okay...
12819 $cat >try.c <<'EOCP'
12822 extern unsigned long int strtoul(char *s, char **, int);
12823 static int bad = 0;
12824 void check(char *s, unsigned long eul, int een) {
12827 gul = strtoul(s, 0, 10);
12828 if (!((gul == eul) && (errno == een)))
12832 check(" 1", 1L, 0);
12833 check(" 0", 0L, 0);
12835 case "$longsize" in
12837 $cat >>try.c <<'EOCP'
12838 check("18446744073709551615", 18446744073709551615UL, 0);
12839 check("18446744073709551616", 18446744073709551615UL, ERANGE);
12840 #if 0 /* strtoul() for /^-/ strings is undefined. */
12841 check("-1", 18446744073709551615UL, 0);
12842 check("-18446744073709551614", 2, 0);
12843 check("-18446744073709551615", 1, 0);
12844 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
12845 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
12850 $cat >>try.c <<'EOCP'
12851 check("4294967295", 4294967295UL, 0);
12852 check("4294967296", 4294967295UL, ERANGE);
12853 #if 0 /* strtoul() for /^-/ strings is undefined. */
12854 check("-1", 4294967295UL, 0);
12855 check("-4294967294", 2, 0);
12856 check("-4294967295", 1, 0);
12857 check("-4294967296", 4294967295UL, ERANGE);
12858 check("-4294967297", 4294967295UL, ERANGE);
12863 : Should we write these tests to be more portable by sprintf-ing
12864 : ~0 and then manipulating that char string as input for strtol?
12867 $cat >>try.c <<'EOCP'
12874 if eval $compile; then
12875 case "`$run ./try`" in
12876 ok) echo "Your strtoul() seems to be working okay." ;;
12878 Your strtoul() doesn't seem to be working okay.
12887 : see if strtoull exists
12888 set strtoull d_strtoull
12891 case "$d_longlong-$d_strtoull" in
12894 Checking whether your strtoull() works okay...
12896 $cat >try.c <<'EOCP'
12899 #define strtoull __strtoull
12902 extern unsigned long long int strtoull(char *s, char **, int);
12903 static int bad = 0;
12904 int check(char *s, long long eull, int een) {
12907 gull = strtoull(s, 0, 10);
12908 if (!((gull == eull) && (errno == een)))
12912 check(" 1", 1LL, 0);
12913 check(" 0", 0LL, 0);
12914 check("18446744073709551615", 18446744073709551615ULL, 0);
12915 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
12916 #if 0 /* strtoull() for /^-/ strings is undefined. */
12917 check("-1", 18446744073709551615ULL, 0);
12918 check("-18446744073709551614", 2LL, 0);
12919 check("-18446744073709551615", 1LL, 0);
12920 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
12921 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
12928 if eval $compile; then
12929 case "`$run ./try`" in
12930 ok) echo "Your strtoull() seems to be working okay." ;;
12932 Your strtoull() doesn't seem to be working okay.
12934 d_strtoull="$undef"
12941 : see if strtouq exists
12942 set strtouq d_strtouq
12945 case "$d_strtouq" in
12948 Checking whether your strtouq() works okay...
12950 $cat >try.c <<'EOCP'
12953 extern unsigned long long int strtouq(char *s, char **, int);
12954 static int bad = 0;
12955 void check(char *s, unsigned long long eull, int een) {
12956 unsigned long long gull;
12958 gull = strtouq(s, 0, 10);
12959 if (!((gull == eull) && (errno == een)))
12963 check(" 1", 1LL, 0);
12964 check(" 0", 0LL, 0);
12965 check("18446744073709551615", 18446744073709551615ULL, 0);
12966 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
12967 #if 0 /* strtouq() for /^-/ strings is undefined. */
12968 check("-1", 18446744073709551615ULL, 0);
12969 check("-18446744073709551614", 2LL, 0);
12970 check("-18446744073709551615", 1LL, 0);
12971 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
12972 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
12980 if eval $compile; then
12981 case "`$run ./try`" in
12982 ok) echo "Your strtouq() seems to be working okay." ;;
12984 Your strtouq() doesn't seem to be working okay.
12993 : see if strxfrm exists
12994 set strxfrm d_strxfrm
12997 : see if symlink exists
12998 set symlink d_symlink
13001 : see if syscall exists
13002 set syscall d_syscall
13005 : see if prototype for syscall is available
13007 set d_syscallproto syscall $i_unistd unistd.h
13010 : see if sysconf exists
13011 set sysconf d_sysconf
13014 : see if system exists
13015 set system d_system
13018 : see if tcgetpgrp exists
13019 set tcgetpgrp d_tcgetpgrp
13022 : see if tcsetpgrp exists
13023 set tcsetpgrp d_tcsetpgrp
13026 : see if prototype for telldir is available
13028 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
13031 : see if this is a sys/times.h system
13032 set sys/times.h i_systimes
13035 : see if times exists
13037 if set times val -f d_times; eval $csym; $val; then
13038 echo 'times() found.' >&4
13041 case "$i_systimes" in
13042 "$define") inc='sys/times.h';;
13044 rp="What is the type returned by times() on this system?"
13045 set clock_t clocktype long stdio.h sys/types.h $inc
13048 echo 'times() NOT found, hope that will do.' >&4
13053 : see if truncate exists
13054 set truncate d_truncate
13057 : see if tzname[] exists
13059 if set tzname val -a d_tzname; eval $csym; $val; then
13061 echo 'tzname[] found.' >&4
13064 echo 'tzname[] NOT found.' >&4
13070 next|rhapsody|darwin) multiarch="$define" ;;
13072 case "$multiarch" in
13073 ''|[nN]*) multiarch="$undef" ;;
13076 : check for ordering of bytes in a long
13078 case "$usecrosscompile$multiarch" in
13081 You seem to be either cross-compiling or doing a multiarchitecture build,
13082 skipping the byteorder check.
13088 case "$byteorder" in
13091 In the following, larger digits indicate more significance. A big-endian
13092 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
13093 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
13094 machines may have weird orders like 3412. A Cray will report 87654321,
13095 an Alpha will report 12345678. If the test program works the default is
13097 I'm now running the test program...
13099 $cat >try.c <<'EOCP'
13106 char c[sizeof(long)];
13109 if (sizeof(long) > 4)
13110 u.l = (0x08070605L << 32) | 0x04030201L;
13113 for (i = 0; i < sizeof(long); i++)
13114 printf("%c", u.c[i]+'0');
13121 if eval $compile && ./try > /dev/null; then
13124 [1-4][1-4][1-4][1-4]|12345678|87654321)
13125 echo "(The test program ran ok.)"
13126 echo "byteorder=$dflt"
13129 ????|????????) echo "(The test program ran ok.)" ;;
13130 *) echo "(The test program didn't run right for some reason.)" ;;
13135 (I can't seem to compile the test program. Guessing big-endian...)
13138 case "$xxx_prompt" in
13140 rp="What is the order of bytes in a long?"
13156 Checking to see whether you can access character data unalignedly...
13160 #define U32 $u32type
13161 #define BYTEORDER $byteorder
13163 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
13164 U8 buf[] = "\0\0\0\1\0\0\0\0";
13168 if (sizeof(U32) != 4) {
13169 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
13175 for (i = 0; i < 4; i++) {
13176 up = (U32*)(buf + i);
13177 if (! ((*up == 1 << (8*i)) || /* big-endian */
13178 (*up == 1 << (8*(3-i))) /* little-endian */
13182 printf("read failed (%x)\n", *up);
13188 for (i = 0; i < 4; i++) {
13189 up = (U32*)(buf + i);
13191 if (*up != 0xBeef) {
13192 printf("write failed (%x)\n", *up);
13206 if eval $compile_ok; then
13207 echo "(Testing for character data alignment may dump core.)" >&4
13208 $run ./try 2>&1 >/dev/null
13211 You can access character data pretty unalignedly.
13213 d_u32align="$undef"
13216 It seems that you must access character data in an aligned manner.
13218 d_u32align="$define"
13221 $rm -f core core.try.* try.core
13223 rp='Can you access character data at unaligned addresses?'
13227 [yY]*) d_u32align="$undef" ;;
13228 *) d_u32align="$define" ;;
13232 : see if ualarm exists
13233 set ualarm d_ualarm
13236 : see if umask exists
13240 : see if usleep exists
13241 set usleep d_usleep
13244 : see if prototype for usleep is available
13246 set d_usleepproto usleep $i_unistd unistd.h
13249 : see if ustat exists
13253 : backward compatibility for d_hvfork
13254 if test X$d_hvfork != X; then
13255 d_vfork="$d_hvfork"
13258 : see if there is a vfork
13263 : Ok, but do we want to use it. vfork is reportedly unreliable in
13264 : perl on Solaris 2.x, and probably elsewhere.
13268 case "$usevfork" in
13274 Perl can only use a vfork() that doesn't suffer from strict
13275 restrictions on calling functions or modifying global data in
13276 the child. For example, glibc-2.1 contains such a vfork()
13277 that is unsuitable. If your system provides a proper fork()
13278 call, chances are that you do NOT want perl to use vfork().
13281 rp="Do you still want to use vfork()?"
13286 echo "Ok, we won't use vfork()."
13295 $define) usevfork='true';;
13296 *) usevfork='false';;
13299 : see if this is an sysdir system
13300 set sys/dir.h i_sysdir
13303 : see if this is an sysndir system
13304 set sys/ndir.h i_sysndir
13307 : see if closedir exists
13308 set closedir d_closedir
13311 case "$d_closedir" in
13314 echo "Checking whether closedir() returns a status..." >&4
13316 #$i_dirent I_DIRENT /**/
13317 #$i_sysdir I_SYS_DIR /**/
13318 #$i_sysndir I_SYS_NDIR /**/
13319 #$i_systypes I_SYS_TYPES /**/
13321 #if defined(I_SYS_TYPES)
13322 #include <sys/types.h>
13324 #if defined(I_DIRENT)
13325 #include <dirent.h>
13326 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
13327 #include <sys/dir.h>
13331 #include <sys/ndir.h>
13335 #include <ndir.h> /* may be wrong in the future */
13337 #include <sys/dir.h>
13342 int main() { return closedir(opendir(".")); }
13345 if eval $compile_ok; then
13346 if $run ./try > /dev/null 2>&1 ; then
13347 echo "Yes, it does."
13350 echo "No, it doesn't."
13354 echo "(I can't seem to compile the test program--assuming it doesn't)"
13362 set d_void_closedir
13365 : see if there is a wait4
13369 : see if waitpid exists
13370 set waitpid d_waitpid
13373 : see if wcstombs exists
13374 set wcstombs d_wcstombs
13377 : see if wctomb exists
13378 set wctomb d_wctomb
13381 : see if writev exists
13382 set writev d_writev
13385 : preserve RCS keywords in files with variable substitution, grrr
13390 Revision='$Revision'
13392 : check for alignment requirements
13394 case "$usecrosscompile$multiarch" in
13397 You seem to be either cross-compiling or doing a multiarchitecture build,
13398 skipping the memory alignment check.
13401 case "$alignbytes" in
13402 '') alignbytes=8 ;;
13406 case "$alignbytes" in
13407 '') echo "Checking alignment constraints..." >&4
13408 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
13409 $cat >try.c <<'EOCP'
13410 typedef long double NV;
13413 $cat >try.c <<'EOCP'
13417 $cat >>try.c <<'EOCP'
13425 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
13430 if eval $compile_ok; then
13434 echo "(I can't seem to compile the test program...)"
13437 *) dflt="$alignbytes"
13440 rp="Doubles must be aligned on a how-many-byte boundary?"
13448 : set the base revision
13451 : how do we catenate cpp tokens here?
13453 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
13454 $cat >cpp_stuff.c <<'EOCP'
13455 #define RCAT(a,b)a/**/b
13456 #define ACAT(a,b)a ## b
13460 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
13461 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
13462 echo "Oh! Smells like ANSI's been here." >&4
13463 echo "We can catify or stringify, separately or together!"
13465 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
13466 echo "Ah, yes! The good old days!" >&4
13467 echo "However, in the good old days we don't know how to stringify and"
13468 echo "catify at the same time."
13472 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
13473 to have to edit the values of CAT[2-5] in config.h...
13475 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
13479 : see if this is a db.h system
13485 : Check db version.
13487 echo "Checking Berkeley DB version ..." >&4
13493 #include <sys/types.h>
13496 int main(int argc, char *argv[])
13498 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
13499 int Major, Minor, Patch ;
13500 unsigned long Version ;
13501 (void)db_version(&Major, &Minor, &Patch) ;
13503 printf("%d %d %d %d %d %d\n",
13504 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
13505 Major, Minor, Patch);
13508 printf("You have Berkeley DB Version 2 or greater.\n");
13510 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
13511 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
13512 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
13513 Major, Minor, Patch) ;
13515 /* check that db.h & libdb are compatible */
13516 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
13517 printf("db.h and libdb are incompatible.\n") ;
13521 printf("db.h and libdb are compatible.\n") ;
13523 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
13524 + DB_VERSION_PATCH ;
13526 /* needs to be >= 2.3.4 */
13527 if (Version < 2003004) {
13528 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
13529 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
13535 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
13540 printf("You have Berkeley DB Version 1.\n");
13541 exit(0); /* DB version < 2: the coast is clear. */
13543 exit(1); /* <db.h> not Berkeley DB? */
13549 if eval $compile_ok && $run ./try; then
13550 echo 'Looks OK.' >&4
13552 db_version_major=$1
13553 db_version_minor=$2
13554 db_version_patch=$3
13556 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
13560 : Remove db from list of libraries to use
13561 echo "Removing unusable -ldb from library list" >&4
13562 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
13565 echo "libs = $libs" >&4
13575 : Check the return type needed for hash
13577 echo "Checking return type needed for hash for Berkeley DB ..." >&4
13583 #include <sys/types.h>
13586 #ifndef DB_VERSION_MAJOR
13587 u_int32_t hash_cb (ptr, size)
13595 info.hash = hash_cb;
13599 if $cc $ccflags -c try.c >try.out 2>&1 ; then
13600 if $contains warning try.out >>/dev/null 2>&1 ; then
13603 db_hashtype='u_int32_t'
13606 : XXX Maybe we should just give up here.
13607 db_hashtype=u_int32_t
13609 echo "Help: I can't seem to compile the db test program." >&4
13610 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
13613 echo "Your version of Berkeley DB uses $db_hashtype for hash."
13615 *) db_hashtype=u_int32_t
13620 : Check the return type needed for prefix
13622 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
13628 #include <sys/types.h>
13631 #ifndef DB_VERSION_MAJOR
13632 size_t prefix_cb (key1, key2)
13640 info.prefix = prefix_cb;
13644 if $cc $ccflags -c try.c >try.out 2>&1 ; then
13645 if $contains warning try.out >>/dev/null 2>&1 ; then
13646 db_prefixtype='int'
13648 db_prefixtype='size_t'
13651 db_prefixtype='size_t'
13652 : XXX Maybe we should just give up here.
13654 echo "Help: I can't seem to compile the db test program." >&4
13655 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
13658 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
13660 *) db_prefixtype='size_t'
13665 : How can we generate normalized random numbers ?
13667 echo "Looking for a random number function..." >&4
13668 case "$randfunc" in
13670 if set drand48 val -f; eval $csym; $val; then
13672 echo "Good, found drand48()." >&4
13673 elif set random val -f; eval $csym; $val; then
13675 echo "OK, found random()." >&4
13678 echo "Yick, looks like I have to use rand()." >&4
13689 *-Dmy_rand=*|*-Dmy_srand=*)
13690 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
13691 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
13692 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
13693 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
13697 while $test "$cont"; do
13698 rp="Use which function to generate random numbers?"
13700 if $test "$ans" = "$dflt"; then
13706 if set $ans val -f; eval $csym; $val; then
13710 rp="I cannot find function $ans. Use that name anyway?"
13719 case "$randfunc" in
13721 drand01="drand48()"
13727 case "$randbits" in
13729 echo "Checking to see how many bits your $randfunc() function produces..." >&4
13731 #$i_unistd I_UNISTD
13732 #$i_stdlib I_STDLIB
13735 # include <unistd.h>
13738 # include <stdlib.h>
13743 register unsigned long tmp;
13744 register unsigned long max = 0L;
13746 for (i = 1000; i; i--) {
13747 tmp = (unsigned long) $randfunc();
13748 if (tmp > max) max = tmp;
13750 for (i = 0; max; i++)
13756 if eval $compile_ok; then
13760 echo "(I can't seem to compile the test program...)"
13767 rp="How many bits does your $randfunc() function produce?"
13771 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
13772 seedfunc="s$randfunc"
13773 randseedtype=unsigned
13777 rp="How many bits does your $randfunc() function produce?"
13780 seedfunc="s$randfunc"
13781 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
13782 if set $seedfunc val -f; eval $csym; $val; then
13783 echo "(Using $seedfunc() to seed random generator)"
13785 echo "(Warning: no $seedfunc() to seed random generator)"
13788 randseedtype=unsigned
13796 echo "Determining whether or not we are on an EBCDIC system..." >&4
13797 $cat >try.c <<'EOM'
13800 if ('M'==0xd4) return 0;
13807 if eval $compile_ok; then
13808 if $run ./try; then
13809 echo "You seem to speak EBCDIC." >&4
13812 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
13815 echo "I'm unable to compile the test program." >&4
13816 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
13824 Checking how to flush all pending stdio output...
13826 # I only know how to find the first 32 possibly open files on SunOS.
13827 # See also hints/sunos_4_1.sh and util.c --AD
13829 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
13831 $cat >>try.c <<EOCP
13833 #$i_unistd I_UNISTD
13835 # include <unistd.h>
13837 #$d_sysconf HAS_SYSCONF
13838 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
13839 #ifdef HAS_STDIO_STREAM_ARRAY
13840 # define STDIO_STREAM_ARRAY $stdio_stream_array
13845 p = fopen("try.out", "w");
13849 # ifdef TRY_FPRINTF
13853 #ifdef TRY_FFLUSH_NULL
13856 #ifdef TRY_FFLUSH_ALL
13858 long open_max = -1;
13859 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
13860 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
13862 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
13863 open_max = sysconf(_SC_OPEN_MAX);
13866 open_max = FOPEN_MAX;
13869 open_max = OPEN_MAX;
13878 # ifdef HAS_STDIO_STREAM_ARRAY
13879 if (open_max > 0) {
13881 for (i = 0; i < open_max; i++)
13882 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
13883 STDIO_STREAM_ARRAY[i]._file < open_max &&
13884 STDIO_STREAM_ARRAY[i]._flag)
13885 fflush(&STDIO_STREAM_ARRAY[i]);
13893 : first we have to find out how _not_ to flush
13895 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
13897 set try -DTRY_FPUTC
13898 if eval $compile; then
13899 $run ./try 2>/dev/null
13902 if $test ! -s try.out -a "X$code" = X42; then
13908 set try -DTRY_FPRINTF
13909 if eval $compile; then
13910 $run ./try 2>/dev/null
13913 if $test ! -s try.out -a "X$code" = X42; then
13914 output=-DTRY_FPRINTF
13920 : check for fflush NULL behaviour
13921 case "$fflushNULL" in
13922 '') set try -DTRY_FFLUSH_NULL $output
13923 if eval $compile; then
13924 $run ./try 2>/dev/null
13927 if $test -s try.out -a "X$code" = X42; then
13928 fflushNULL="`$cat try.out`"
13930 if $test "X$code" != X42; then
13932 (If this test failed, don't worry, we'll try another method shortly.)
13937 $rm -f core try.core core.try.*
13938 case "$fflushNULL" in
13940 Your fflush(NULL) works okay for output streams.
13941 Let's see if it clobbers input pipes...
13943 # As of mid-March 2000 all versions of Solaris appear to have a stdio
13944 # bug that improperly flushes the input end of pipes. So we avoid the
13945 # autoflush on fork/system/exec support for now. :-(
13946 $cat >tryp.c <<EOCP
13949 main(int argc, char **argv)
13955 while ((i = getc(stdin)) != -1
13956 && (*bp++ = i) != '\n'
13957 && bp < &buf[1024])
13960 fprintf(stdout, "%s", buf);
13968 fflushNULL="$define"
13970 if eval $compile; then
13972 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
13973 if cmp tryp.c tryp.out >/dev/null 2>&1; then
13975 fflush(NULL) seems to behave okay with input streams.
13977 fflushNULL="$define"
13980 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
13982 fflushNULL="$undef"
13985 $rm -f core tryp.c tryp.core core.tryp.*
13988 Your fflush(NULL) isn't working (contrary to ANSI C).
13990 fflushNULL="$undef"
13993 Cannot figure out whether your fflush(NULL) works or not.
13994 I'm assuming it doesn't (contrary to ANSI C).
13996 fflushNULL="$undef"
14000 $define|true|[yY]*)
14001 fflushNULL="$define"
14004 fflushNULL="$undef"
14007 : check explicit looping only if NULL did not work, and if the pipe
14008 : bug does not show up on an explicit flush too
14009 case "$fflushNULL" in
14011 $cat >tryp.c <<EOCP
14014 main(int argc, char **argv)
14020 while ((i = getc(stdin)) != -1
14021 && (*bp++ = i) != '\n'
14022 && bp < &buf[1024])
14025 fprintf(stdout, "%s", buf);
14034 if eval $compile; then
14036 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
14037 if cmp tryp.c tryp.out >/dev/null 2>&1; then
14039 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
14041 : now check for fflushall behaviour
14042 case "$fflushall" in
14043 '') set try -DTRY_FFLUSH_ALL $output
14044 if eval $compile; then
14046 (Now testing the other method--but note that this also may fail.)
14048 $run ./try 2>/dev/null
14051 if $test -s try.out -a "X$code" = X42; then
14052 fflushall="`$cat try.out`"
14055 $rm -f core try.core core.try.*
14056 case "$fflushall" in
14058 Whew. Flushing explicitly all the stdio streams works.
14060 fflushall="$define"
14063 Sigh. Flushing explicitly all the stdio streams doesn't work.
14068 Cannot figure out whether flushing stdio streams explicitly works or not.
14069 I'm assuming it doesn't.
14075 "$define"|true|[yY]*)
14076 fflushall="$define"
14084 All is futile. Even fflush(stdin) clobbers input pipes!
14091 $rm -f core tryp.c tryp.core core.tryp.*
14093 *) fflushall="$undef"
14097 case "$fflushNULL$fflushall" in
14100 OK, I give up. I cannot figure out how to flush pending stdio output.
14101 We won't be flushing handles at all before fork/exec/popen.
14105 $rm -f try.* try$exe_ext
14107 : Store the full pathname to the ar program for use in the C program
14108 : Respect a hint or command line value for full_ar.
14113 : Store the full pathname to the sed program for use in the C program
14116 : see what type gids are declared as in the kernel
14118 echo "Looking for the type for group ids returned by getgid()."
14119 set gid_t gidtype xxx stdio.h sys/types.h
14123 xxx=`./findhdr sys/user.h`
14124 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
14126 unsigned) dflt="$1 $2" ;;
14130 *) dflt="$gidtype";;
14133 gid_t) echo "gid_t found." ;;
14134 *) rp="What is the type for group ids returned by getgid()?"
14142 *_t) zzz="$gidtype" ;;
14145 echo "Checking the size of $zzz..." >&4
14147 #include <sys/types.h>
14150 printf("%d\n", (int)sizeof($gidtype));
14155 if eval $compile_ok; then
14159 echo "(I can't execute the test program--guessing $gidsize.)" >&4
14162 echo "Your $zzz is $gidsize bytes long."
14167 echo "(I can't compile the test program--guessing $gidsize.)" >&4
14173 *_t) zzz="$gidtype" ;;
14176 echo "Checking the sign of $zzz..." >&4
14178 #include <sys/types.h>
14189 if eval $compile; then
14193 echo "(I can't execute the test program--guessing unsigned.)" >&4
14197 1) echo "Your $zzz is unsigned." ;;
14198 -1) echo "Your $zzz is signed." ;;
14204 echo "(I can't compile the test program--guessing unsigned.)" >&4
14210 if $test X"$quadtype" != X; then
14212 echo "Checking how to print 64-bit integers..." >&4
14214 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
14215 $cat >try.c <<'EOCP'
14216 #include <sys/types.h>
14219 int q = 12345678901;
14220 printf("%ld\n", q);
14224 if eval $compile; then
14228 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
14229 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
14230 echo "We will use %d."
14236 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
14237 $cat >try.c <<'EOCP'
14238 #include <sys/types.h>
14241 long q = 12345678901;
14242 printf("%ld\n", q);
14246 if eval $compile; then
14250 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
14251 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
14252 echo "We will use %ld."
14258 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
14259 $cat >try.c <<'EOCP'
14260 #include <sys/types.h>
14261 #include <inttypes.h>
14264 int64_t q = 12345678901;
14265 printf("%" PRId64 "\n", q);
14269 if eval $compile; then
14273 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
14274 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
14275 echo "We will use the C9X style."
14281 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
14283 #include <sys/types.h>
14286 $quadtype q = 12345678901;
14287 printf("%Ld\n", q);
14291 if eval $compile; then
14295 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
14296 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
14297 echo "We will use %Ld."
14303 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
14304 $cat >try.c <<'EOCP'
14305 #include <sys/types.h>
14308 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
14309 printf("%lld\n", q);
14313 if eval $compile; then
14317 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
14318 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
14319 echo "We will use the %lld style."
14325 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
14327 #include <sys/types.h>
14330 $quadtype q = 12345678901;
14331 printf("%qd\n", q);
14335 if eval $compile; then
14339 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
14340 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
14341 echo "We will use %qd."
14347 if $test X"$sPRId64" = X; then
14348 echo "Cannot figure out how to print 64-bit integers." >&4
14356 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
14357 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
14359 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
14360 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
14366 $echo "Checking the format strings to be used for Perl's internal types..." >&4
14368 if $test X"$ivsize" = X8; then
14369 ivdformat="$sPRId64"
14370 uvuformat="$sPRIu64"
14371 uvoformat="$sPRIo64"
14372 uvxformat="$sPRIx64"
14373 uvXUformat="$sPRIXU64"
14375 if $test X"$ivsize" = X"$longsize"; then
14382 if $test X"$ivsize" = X"$intsize"; then
14390 if $test X"$ivsize" = X"$shortsize"; then
14401 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
14402 nveformat="$sPRIeldbl"
14403 nvfformat="$sPRIfldbl"
14404 nvgformat="$sPRIgldbl"
14405 nvEUformat="$sPRIEUldbl"
14406 nvFUformat="$sPRIFUldbl"
14407 nvGUformat="$sPRIGUldbl"
14417 case "$ivdformat" in
14418 '') echo "$0: Fatal: failed to find format strings, cannot continue." >& 4
14425 $echo "Checking the format string to be used for gids..." >&4
14428 -1) if $test X"$gidsize" = X"$ivsize"; then
14429 gidformat="$ivdformat"
14431 if $test X"$gidsize" = X"$longsize"; then
14434 if $test X"$gidsize" = X"$intsize"; then
14437 if $test X"$gidsize" = X"$shortsize"; then
14444 *) if $test X"$gidsize" = X"$uvsize"; then
14445 gidformat="$uvuformat"
14447 if $test X"$gidsize" = X"$longsize"; then
14450 if $test X"$gidsize" = X"$intsize"; then
14453 if $test X"$gidsize" = X"$shortsize"; then
14462 : see if getgroups exists
14463 set getgroups d_getgrps
14466 : see if setgroups exists
14467 set setgroups d_setgrps
14471 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
14473 case "$d_getgrps$d_setgrps" in
14475 case "$groupstype" in
14476 '') dflt="$gidtype" ;;
14477 *) dflt="$groupstype" ;;
14480 What type of pointer is the second argument to getgroups() and setgroups()?
14481 Usually this is the same as group ids, $gidtype, but not always.
14484 rp='What type pointer is the second argument to getgroups() and setgroups()?'
14488 *) groupstype="$gidtype";;
14492 echo "Checking if your $make program sets \$(MAKE)..." >&4
14493 case "$make_set_make" in
14495 $sed 's/^X //' > testmake.mak << 'EOF'
14497 X @echo 'maketemp="$(MAKE)"'
14499 case "`$make -f testmake.mak 2>/dev/null`" in
14500 *maketemp=*) make_set_make='#' ;;
14501 *) make_set_make="MAKE=$make" ;;
14503 $rm -f testmake.mak
14506 case "$make_set_make" in
14507 '#') echo "Yup, it does.";;
14508 *) echo "Nope, it doesn't.";;
14511 : see what type is used for mode_t
14512 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
14513 set mode_t modetype int stdio.h sys/types.h
14516 : see if stdarg is available
14518 if $test `./findhdr stdarg.h`; then
14519 echo "<stdarg.h> found." >&4
14522 echo "<stdarg.h> NOT found." >&4
14526 : see if varags is available
14528 if $test `./findhdr varargs.h`; then
14529 echo "<varargs.h> found." >&4
14531 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
14534 : set up the varargs testing programs
14535 $cat > varargs.c <<EOP
14537 #include <stdarg.h>
14540 #include <varargs.h>
14544 int f(char *p, ...)
14558 p = va_arg(ap, char *);
14563 $cat > varargs <<EOP
14565 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
14574 : now check which varargs header should be included
14579 if `./varargs I_STDARG`; then
14581 elif `./varargs I_VARARGS`; then
14586 if `./varargs I_VARARGS`; then
14593 echo "I could not find the definition for va_dcl... You have problems..." >&4
14594 val="$undef"; set i_stdarg; eval $setvar
14595 val="$undef"; set i_varargs; eval $setvar
14600 case "$i_varhdr" in
14602 val="$define"; set i_stdarg; eval $setvar
14603 val="$undef"; set i_varargs; eval $setvar
14606 val="$undef"; set i_stdarg; eval $setvar
14607 val="$define"; set i_varargs; eval $setvar
14610 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
14614 : see if we need va_copy
14616 case "$i_stdarg" in
14619 #include <stdarg.h>
14621 #$i_stdlib I_STDLIB
14623 #include <stdlib.h>
14625 #include <signal.h>
14628 ivfprintf(FILE *f, const char *fmt, va_list *valp)
14630 return vfprintf(f, fmt, *valp);
14634 myvfprintf(FILE *f, const char *fmt, va_list val)
14636 return ivfprintf(f, fmt, &val);
14640 myprintf(char *fmt, ...)
14643 va_start(val, fmt);
14644 return myvfprintf(stdout, fmt, val);
14648 main(int ac, char **av)
14650 signal(SIGSEGV, exit);
14652 myprintf("%s%cs all right, then\n", "that", '\'');
14657 if eval $compile && $run ./try 2>&1 >/dev/null; then
14658 case "`$run ./try`" in
14659 "that's all right, then")
14665 yes) echo "It seems that you don't need va_copy()." >&4
14666 need_va_copy="$undef"
14668 *) echo "It seems that va_copy() or similar will be needed." >&4
14669 need_va_copy="$define"
14672 $rm -f try.* core core.* *.core *.core.*
14674 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
14678 : define a fucntion to check prototypes
14679 $cat > protochk <<EOSH
14682 optimize="$optimize"
14684 prototype="$prototype"
14689 $cat >> protochk <<'EOSH'
14694 while test $# -ge 2; do
14696 $define) echo "#include <$2>" >> try.c ;;
14697 literal) echo "$2" >> try.c ;;
14701 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
14702 cat >> try.c <<'EOCP'
14703 #ifdef CAN_PROTOTYPE
14704 #define _(args) args
14709 echo "$foo" >> try.c
14710 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
14711 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
14717 $eunicefix protochk
14719 : see what type is used for size_t
14720 rp="What is the type used for the length parameter for string functions?"
14721 set size_t sizetype 'unsigned int' stdio.h sys/types.h
14724 : check for type of arguments to gethostbyaddr.
14725 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
14726 case "$d_gethbyaddr" in
14730 Checking to see what type of arguments are accepted by gethostbyaddr().
14732 hdrs="$define sys/types.h
14733 $d_socket sys/socket.h
14734 $i_niin netinet/in.h
14736 $i_unistd unistd.h"
14737 : The first arg can 'char *' or 'void *'
14738 : The second arg is some of integral type
14739 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
14740 for yyy in size_t long int; do
14741 case "$netdb_host_type" in
14742 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
14743 if ./protochk "$try" $hdrs; then
14744 echo "Your system accepts $xxx for the first arg."
14745 echo "...and $yyy for the second arg."
14746 netdb_host_type="$xxx"
14747 netdb_hlen_type="$yyy"
14753 : In case none of those worked, prompt the user.
14754 case "$netdb_host_type" in
14755 '') rp='What is the type for the 1st argument to gethostbyaddr?'
14758 netdb_host_type=$ans
14759 rp='What is the type for the 2nd argument to gethostbyaddr?'
14762 netdb_hlen_type=$ans
14766 *) : no gethostbyaddr, so pick harmless defaults
14767 netdb_host_type='char *'
14768 netdb_hlen_type="$sizetype"
14771 # Remove the "const" if needed. -- but then we'll have a
14773 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
14776 : check for type of argument to gethostbyname.
14777 if test "X$netdb_name_type" = X ; then
14778 case "$d_gethbyname" in
14782 Checking to see what type of argument is accepted by gethostbyname().
14784 hdrs="$define sys/types.h
14785 $d_socket sys/socket.h
14786 $i_niin netinet/in.h
14788 $i_unistd unistd.h"
14789 for xxx in "const char *" "char *"; do
14790 case "$netdb_name_type" in
14791 '') try="extern struct hostent *gethostbyname($xxx);"
14792 if ./protochk "$try" $hdrs; then
14793 echo "Your system accepts $xxx."
14794 netdb_name_type="$xxx"
14799 : In case none of those worked, prompt the user.
14800 case "$netdb_name_type" in
14801 '') rp='What is the type for the 1st argument to gethostbyname?'
14804 netdb_name_type=$ans
14808 *) : no gethostbyname, so pick harmless default
14809 netdb_name_type='char *'
14814 : check for type of 1st argument to getnetbyaddr.
14815 if test "X$netdb_net_type" = X ; then
14816 case "$d_getnbyaddr" in
14820 Checking to see what type of 1st argument is accepted by getnetbyaddr().
14822 hdrs="$define sys/types.h
14823 $d_socket sys/socket.h
14824 $i_niin netinet/in.h
14826 $i_unistd unistd.h"
14827 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
14828 case "$netdb_net_type" in
14829 '') try="extern struct netent *getnetbyaddr($xxx, int);"
14830 if ./protochk "$try" $hdrs; then
14831 echo "Your system accepts $xxx."
14832 netdb_net_type="$xxx"
14837 : In case none of those worked, prompt the user.
14838 case "$netdb_net_type" in
14839 '') rp='What is the type for the 1st argument to getnetbyaddr?'
14842 netdb_net_type=$ans
14846 *) : no getnetbyaddr, so pick harmless default
14847 netdb_net_type='long'
14851 : locate the preferred pager for this system
14857 [a-zA-Z]:/*) dflt=$pg;;
14861 [a-zA-Z]:/*) dflt=$more;;
14865 [a-zA-Z]:/*) dflt=$less;;
14868 '') dflt=/usr/ucb/more;;
14875 rp='What pager is used on your system?'
14879 : see what type pids are declared as in the kernel
14880 rp="What is the type of process ids on this system?"
14881 set pid_t pidtype int stdio.h sys/types.h
14884 : Find earliest binary compatible site_perl subdirectory perl can use.
14885 case "$bincompat5005" in
14886 "$define") xs_apiversion='5.005' ;;
14887 *) xs_apiversion=$version ;; # The current site_perl version.
14889 : Find earliest pure perl site_perl subdirectory perl can use.
14890 : The versioned directories started at 5.005.
14891 pm_apiversion='5.005'
14893 : see if ar generates random libraries by itself
14895 echo "Checking how to generate random libraries on your machine..." >&4
14896 echo 'int bar1() { return bar2(); }' > bar1.c
14897 echo 'int bar2() { return 2; }' > bar2.c
14898 $cat > foo.c <<'EOP'
14899 int main() { printf("%d\n", bar1()); exit(0); }
14901 $cc $ccflags -c bar1.c >/dev/null 2>&1
14902 $cc $ccflags -c bar2.c >/dev/null 2>&1
14903 $cc $ccflags -c foo.c >/dev/null 2>&1
14904 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
14905 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
14906 $run ./foobar >/dev/null 2>&1; then
14907 echo "$ar appears to generate random libraries itself."
14910 elif $ar ts bar$_a >/dev/null 2>&1 &&
14911 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
14912 $run ./foobar >/dev/null 2>&1; then
14913 echo "a table of contents needs to be added with '$ar ts'."
14920 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
14921 $test -f $ranlib || ranlib=''
14924 if $test -n "$ranlib"; then
14925 echo "your system has '$ranlib'; we'll use that."
14928 echo "your system doesn't seem to support random libraries"
14929 echo "so we'll use lorder and tsort to order the libraries."
14936 : check for type of arguments to select.
14937 case "$selecttype" in
14938 '') case "$d_select" in
14942 Checking to see what type of arguments are accepted by select().
14944 hdrs="$define sys/types.h
14945 $i_systime sys/time.h
14946 $i_sysselct sys/select.h
14947 $d_socket sys/socket.h"
14948 : The first arg can be int, unsigned, or size_t
14949 : The last arg may or may not be 'const'
14951 : void pointer has been seen but using that
14952 : breaks the selectminbits test
14953 for xxx in 'fd_set *' 'int *'; do
14954 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
14955 for tmo in 'struct timeval *' 'const struct timeval *'; do
14957 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
14958 if ./protochk "$try" $hdrs; then
14959 echo "Your system accepts $xxx."
14968 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
14969 case "$d_fd_set" in
14970 $define) dflt="fd_set *" ;;
14979 *) : no select, so pick a harmless default
14986 : check for the select 'width'
14987 case "$selectminbits" in
14988 '') case "$d_select" in
14992 Checking to see on how many bits at a time your select() operates...
14995 #include <sys/types.h>
14997 #$i_systime I_SYS_TIME
14998 #$i_systimek I_SYS_TIME_KERNEL
15003 # ifdef I_SYS_TIME_KERNEL
15006 # include <sys/time.h>
15007 # ifdef I_SYS_TIME_KERNEL
15011 #$i_sysselct I_SYS_SELECT
15012 #ifdef I_SYS_SELECT
15013 #include <sys/select.h>
15015 #$d_socket HAS_SOCKET
15017 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
15021 #define S sizeof(*(b))
15023 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
15024 #define NBITS (NBYTES * 8)
15033 fp = fopen("try.c", "r");
15039 b = ($selecttype)s;
15040 for (i = 0; i < NBITS; i++)
15044 select(fd + 1, b, 0, 0, &t);
15045 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
15046 printf("%d\n", i + 1);
15051 if eval $compile_ok; then
15052 selectminbits=`$run ./try`
15053 case "$selectminbits" in
15055 Cannot figure out on how many bits at a time your select() operates.
15056 I'll play safe and guess it is 32 bits.
15062 *) bits="$selectminbits bits" ;;
15064 echo "Your select() operates on $bits at a time." >&4
15066 rp='What is the minimum number of bits your select() operates on?'
15067 case "$byteorder" in
15068 1234|12345678) dflt=32 ;;
15073 selectminbits="$val"
15077 *) : no select, so pick a harmless default
15084 : Trace out the files included by signal.h, then look for SIGxxx names.
15085 : Remove SIGARRAYSIZE used by HPUX.
15086 : Remove SIGSTKSIZE used by Linux.
15087 : Remove SIGSTKSZ used by Posix.
15088 : Remove SIGTYP void lines used by OS2.
15089 : Some cpps, like os390, dont give the file name anywhere
15090 if [ "X$fieldn" = X ]; then
15091 : Just make some guesses. We check them later.
15092 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
15094 xxx=`echo '#include <signal.h>' |
15095 $cppstdin $cppminus $cppflags 2>/dev/null |
15096 $grep '^[ ]*#.*include' |
15097 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
15099 : Check this list of files to be sure we have parsed the cpp output ok.
15100 : This will also avoid potentially non-existent files, such
15103 for xx in $xxx /dev/null ; do
15104 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
15106 : If we have found no files, at least try signal.h
15107 case "$xxxfiles" in
15108 '') xxxfiles=`./findhdr signal.h` ;;
15111 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
15112 print substr($2, 4, 20)
15114 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
15115 print substr($3, 4, 20)
15117 : Append some common names just in case the awk scan failed.
15118 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
15119 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
15120 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
15121 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
15122 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
15124 : generate a few handy files for later
15125 $cat > signal.c <<'EOCP'
15126 #include <sys/types.h>
15127 #include <signal.h>
15131 /* Strange style to avoid deeply-nested #if/#else/#endif */
15134 # define NSIG (_NSIG)
15140 # define NSIG (SIGMAX+1)
15146 # define NSIG (SIG_MAX+1)
15152 # define NSIG (MAXSIG+1)
15158 # define NSIG (MAX_SIG+1)
15163 # ifdef SIGARRAYSIZE
15164 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
15170 # define NSIG (_sys_nsig) /* Solaris 2.5 */
15174 /* Default to some arbitrary number that's big enough to get most
15175 of the common signals.
15181 printf("NSIG %d\n", NSIG);
15187 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
15189 printf "#ifdef SIG"; printf $1; printf "\n"
15190 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
15191 printf $1; printf ");\n"
15195 printf "#endif /* JUST_NSIG */\n";
15196 printf "exit(0);\n}\n";
15199 $cat >signal.awk <<'EOP'
15200 BEGIN { ndups = 0 }
15201 $1 ~ /^NSIG$/ { nsig = $2 }
15202 ($1 !~ /^NSIG$/) && (NF == 2) {
15203 if ($2 > maxsig) { maxsig = $2 }
15204 if (sig_name[$2]) {
15205 dup_name[ndups] = $1
15206 dup_num[ndups] = $2
15218 printf("NSIG %d\n", nsig);
15219 for (n = 1; n < nsig; n++) {
15221 printf("%s %d\n", sig_name[n], sig_num[n])
15224 printf("NUM%d %d\n", n, n)
15227 for (n = 0; n < ndups; n++) {
15228 printf("%s %d\n", dup_name[n], dup_num[n])
15232 $cat >signal_cmd <<EOS
15234 if $test -s signal.lst; then
15235 echo "Using your existing signal.lst file"
15240 $cat >>signal_cmd <<'EOS'
15243 if eval $compile_ok; then
15244 $run ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
15246 echo "(I can't seem be able to compile the whole test program)" >&4
15247 echo "(I'll try it in little pieces.)" >&4
15248 set signal -DJUST_NSIG
15249 if eval $compile_ok; then
15250 $run ./signal$_exe > signal.nsg
15253 echo "I can't seem to figure out how many signals you have." >&4
15254 echo "Guessing 50." >&4
15255 echo 'NSIG 50' > signal.nsg
15257 : Now look at all the signal names, one at a time.
15258 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
15259 $cat > signal.c <<EOCP
15260 #include <sys/types.h>
15261 #include <signal.h>
15264 printf("$xx %d\n", SIG${xx});
15269 if eval $compile; then
15270 echo "SIG${xx} found."
15271 $run ./signal$_exe >> signal.ls1
15273 echo "SIG${xx} NOT found."
15276 if $test -s signal.ls1; then
15277 $cat signal.nsg signal.ls1 |
15278 $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
15282 if $test -s signal.lst; then
15285 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
15286 echo 'kill -l' >signal
15287 set X `csh -f <signal`
15291 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
15293 echo $@ | $tr ' ' $trnl | \
15294 $awk '{ printf "%s %d\n", $1, ++s; }
15295 END { printf "NSIG %d\n", ++s }' >signal.lst
15297 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
15299 chmod a+x signal_cmd
15300 $eunicefix signal_cmd
15302 : generate list of signal names
15304 case "$sig_name_init" in
15306 *) case "$sig_num_init" in
15307 ''|*,*) doinit=yes ;;
15312 echo "Generating a list of signal names and numbers..." >&4
15314 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
15315 sig_name=`$awk 'BEGIN { printf "ZERO " }
15316 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
15317 sig_num=`$awk 'BEGIN { printf "0 " }
15318 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
15319 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
15320 !/^NSIG/ { printf "\"%s\", ", $1 }
15321 END { printf "0\n" }' signal.lst`
15322 sig_num_init=`$awk 'BEGIN { printf "0, " }
15323 !/^NSIG/ { printf "%d, ", $2}
15324 END { printf "0\n"}' signal.lst`
15327 echo "The following $sig_count signals are available:"
15329 echo $sig_name | $awk \
15330 'BEGIN { linelen = 0 }
15332 for (i = 1; i <= NF; i++) {
15333 name = "SIG" $i " "
15334 linelen = linelen + length(name)
15335 if (linelen > 70) {
15337 linelen = length(name)
15343 sig_size=`echo $sig_name | awk '{print NF}'`
15344 $rm -f signal signal.c signal.awk signal.lst signal_cmd
15347 case "$sizetype" in
15348 *_t) zzz="$sizetype" ;;
15349 *) zzz="filesize" ;;
15351 echo "Checking the size of $zzz..." >&4
15353 #include <sys/types.h>
15356 printf("%d\n", (int)sizeof($sizetype));
15361 if eval $compile_ok; then
15365 echo "(I can't execute the test program--guessing $sizesize.)" >&4
15368 echo "Your $zzz size is $sizesize bytes."
15373 echo "(I can't compile the test program--guessing $sizesize.)" >&4
15377 : check for socklen_t
15379 echo "Checking to see if you have socklen_t..." >&4
15381 #include <sys/types.h>
15382 #$d_socket HAS_SOCKET
15384 #include <sys/socket.h>
15386 int main() { socklen_t x = 16; }
15389 if eval $compile; then
15391 echo "You have socklen_t."
15394 echo "You do not have socklen_t."
15395 case "$sizetype" in
15396 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
15403 : see if this is a socks.h system
15404 set socks.h i_socks
15407 : check for type of the size argument to socket calls
15408 case "$d_socket" in
15412 Checking to see what type is the last argument of accept().
15415 case "$d_socklen_t" in
15416 "$define") yyy="$yyy socklen_t"
15418 yyy="$yyy $sizetype int long unsigned"
15419 for xxx in $yyy; do
15420 case "$socksizetype" in
15421 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
15422 case "$usesocks" in
15424 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
15425 echo "Your system accepts '$xxx *' for the last argument of accept()."
15426 socksizetype="$xxx"
15429 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
15430 echo "Your system accepts '$xxx *' for the last argument of accept()."
15431 socksizetype="$xxx"
15438 : In case none of those worked, prompt the user.
15439 case "$socksizetype" in
15440 '') rp='What is the type for socket address structure sizes?'
15447 *) : no sockets, so pick relatively harmless default
15452 : see what type is used for signed size_t
15453 set ssize_t ssizetype int stdio.h sys/types.h
15458 #include <sys/types.h>
15459 #define Size_t $sizetype
15460 #define SSize_t $dflt
15463 if (sizeof(Size_t) == sizeof(SSize_t))
15465 else if (sizeof(Size_t) == sizeof(int))
15474 if eval $compile_ok && $run ./try > /dev/null; then
15475 ssizetype=`$run ./try`
15476 echo "I'll be using $ssizetype for functions returning a byte count." >&4
15479 Help! I can't compile and run the ssize_t test program: please enlighten me!
15480 (This is probably a misconfiguration in your system or libraries, and
15481 you really ought to fix it. Still, I'll try anyway.)
15483 I need a type that is the same size as $sizetype, but is guaranteed to
15484 be signed. Common values are ssize_t, int and long.
15487 rp="What signed type is the same size as $sizetype?"
15493 : see what type of char stdio uses.
15495 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
15496 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
15497 echo "Your stdio uses unsigned chars." >&4
15498 stdchar="unsigned char"
15500 echo "Your stdio uses signed chars." >&4
15507 : see if time exists
15509 if test "X$d_time" = X -o X"$timetype" = X; then
15510 if set time val -f d_time; eval $csym; $val; then
15511 echo 'time() found.' >&4
15513 rp="What is the type returned by time() on this system?"
15514 set time_t timetype long stdio.h sys/types.h
15517 echo 'time() not found, hope that will do.' >&4
15525 : see what type uids are declared as in the kernel
15527 echo "Looking for the type for user ids returned by getuid()."
15528 set uid_t uidtype xxx stdio.h sys/types.h
15532 xxx=`./findhdr sys/user.h`
15533 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
15535 unsigned) dflt="$1 $2" ;;
15539 *) dflt="$uidtype";;
15542 uid_t) echo "uid_t found." ;;
15543 *) rp="What is the type for user ids returned by getuid()?"
15551 *_t) zzz="$uidtype" ;;
15554 echo "Checking the size of $zzz..." >&4
15556 #include <sys/types.h>
15559 printf("%d\n", (int)sizeof($uidtype));
15564 if eval $compile_ok; then
15568 echo "(I can't execute the test program--guessing $uidsize.)" >&4
15571 echo "Your $zzz is $uidsize bytes long."
15576 echo "(I can't compile the test program--guessing $uidsize.)" >&4
15581 *_t) zzz="$uidtype" ;;
15584 echo "Checking the sign of $zzz..." >&4
15586 #include <sys/types.h>
15597 if eval $compile; then
15601 echo "(I can't execute the test program--guessing unsigned.)" >&4
15605 1) echo "Your $zzz is unsigned." ;;
15606 -1) echo "Your $zzz is signed." ;;
15612 echo "(I can't compile the test program--guessing unsigned.)" >&4
15618 $echo "Checking the format string to be used for uids..." >&4
15621 -1) if $test X"$uidsize" = X"$ivsize"; then
15622 uidformat="$ivdformat"
15624 if $test X"$uidsize" = X"$longsize"; then
15627 if $test X"$uidsize" = X"$intsize"; then
15630 if $test X"$uidsize" = X"$shortsize"; then
15637 *) if $test X"$uidsize" = X"$uvsize"; then
15638 uidformat="$uvuformat"
15640 if $test X"$uidsize" = X"$longsize"; then
15643 if $test X"$uidsize" = X"$intsize"; then
15646 if $test X"$uidsize" = X"$shortsize"; then
15655 : determine compiler compiler
15664 if $test -f "$byacc"; then
15666 comp="byacc or $comp"
15668 if $test -f "$bison"; then
15669 comp="$comp or bison -y"
15671 rp="Which compiler compiler ($comp) shall I use?"
15680 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
15686 : see if fcntl.h is there
15691 : see if we can include fcntl.h
15697 echo "We'll be including <fcntl.h>." >&4
15700 if $h_sysfile; then
15701 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
15703 echo "We won't be including <fcntl.h>." >&4
15715 : see if this is a iconv.h system
15716 set iconv.h i_iconv
15719 : see if this is a ieeefp.h system
15720 set ieeefp.h i_ieeefp
15723 : see if this is a libutil.h system
15724 set libutil.h i_libutil
15727 : see if locale.h is available
15728 set locale.h i_locale
15731 : see if mach cthreads are available
15732 if test "X$usethreads" = "X$define"; then
15733 set mach/cthreads.h i_machcthr
15736 i_machcthr="$undef"
15741 : see if this is a math.h system
15745 : see if this is a mntent.h system
15746 set mntent.h i_mntent
15749 : see if ndbm.h is available
15754 : see if dbm_open exists
15755 set dbm_open d_dbm_open
15757 case "$d_dbm_open" in
15760 echo "We won't be including <ndbm.h>"
15769 : see if net/errno.h is available
15771 set net/errno.h val
15774 : Unfortunately, it causes problems on some systems. Arrgh.
15777 cat > try.c <<'EOM'
15780 #include <net/errno.h>
15786 if $cc $ccflags -c try.c >/dev/null 2>&1; then
15787 echo "We'll be including <net/errno.h>." >&4
15789 echo "We won't be including <net/errno.h>." >&4
15798 : see if netinet/tcp.h is available
15799 set netinet/tcp.h i_netinettcp
15802 : see if this is a poll.h system
15806 : see if this is a prot.h system
15811 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
15812 $cat <<'EOSH' > Cppsym.know
15813 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
15814 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
15815 alliant alpha am29000 AM29000 AMD64 amiga AMIGAOS AMIX
15816 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
15817 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
15818 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
15819 bull c cadmus clipper CMU COFF COMPILER_VERSION
15820 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
15821 CYGWIN DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
15822 Dynix DynixPTX ELF encore EPI EXTENSIONS FILE_OFFSET_BITS
15823 FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
15824 GNU_SOURCE GNUC GNUC_MINOR GO32 gould GOULD_PN
15825 H3050R H3050RX hbullx20 hcx host_mips
15826 hp200 hp300 hp700 HP700 hp800 hp9000
15827 hp9000s200 hp9000s300 hp9000s400 hp9000s500
15828 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
15829 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
15830 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
15831 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
15832 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
15833 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
15834 Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
15835 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
15836 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
15837 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
15838 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
15839 MATH_HAS_NO_SIDE_EFFECTS
15840 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
15841 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
15842 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
15843 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
15844 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
15845 NetBSD news1500 news1700 news1800 news1900 news3700
15846 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
15847 ns32016 ns32332 ns32k nsc32000
15848 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
15849 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
15850 pc532 pdp11 PGC PIC plexus PORTAR posix
15851 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
15852 POSIX_C_SOURCE POSIX_SOURCE POWER
15853 PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
15854 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
15855 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
15856 sony sony_news sonyrisc sparc sparclite spectrum
15857 stardent stdc STDC_EXT stratos sun sun3 sun386
15858 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
15859 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
15860 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
15861 sysV68 sysV88 Tek4132 Tek4300 titan
15862 TM3200 TM5400 TM5600
15863 tower tower32 tower32_200 tower32_600 tower32_700
15864 tower32_800 tower32_850 tss
15865 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
15866 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
15867 unix UNIX95 UNIX99 unixpc unos USGr4 USGr4_2
15868 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms xenix Xenix286
15869 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
15870 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
15873 # Maybe put other stuff here too.
15874 cat <<EOSH >>Cppsym.know
15877 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
15878 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
15879 $cat Cppsym.know > Cppsym.c
15880 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
15881 $rm -f Cppsym.a Cppsym.b Cppsym.c
15882 cat <<EOSH > Cppsym
15884 if $test \$# -gt 0; then
15885 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
15886 if $test -s Cppsym.got; then
15893 $tr " " "$trnl" | ./Cppsym.try
15899 cat <<EOSH > Cppsym.try
15901 cat <<'EOCP' > try.c
15907 cat <<'EOSH' >> Cppsym.try
15909 printf "#ifdef %s\n#if %s+0\nprintf(\"%s=%%ld\\n\", (long)%s);\n#else\nprintf(\"%s\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1
15910 printf "#ifdef _%s\n#if _%s+0\nprintf(\"_%s=%%ld\\n\", (long)_%s);\n#else\nprintf(\"_%s\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1
15911 printf "#ifdef __%s\n#if __%s+0\nprintf(\"__%s=%%ld\\n\", (long)__%s);\n#else\nprintf(\"__%s\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1
15912 printf "#ifdef __%s__\n#if __%s__+0\nprintf(\"__%s__=%%ld\\n\", (long)__%s__);\n#else\nprintf(\"__%s__\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1
15914 echo 'return 0;}' >> try.c
15916 cat <<EOSH >> Cppsym.try
15918 case "$osname-$gccversion" in
15919 irix-) ccflags="\$ccflags -woff 1178" ;;
15920 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
15922 $cc -o try $optimize \$ccflags $ldflags try.c $libs && $run ./try
15924 chmod +x Cppsym.try
15925 $eunicefix Cppsym.try
15926 ./Cppsym < Cppsym.know > Cppsym.true
15927 : now check the C compiler for additional symbols
15928 postprocess_cc_v=''
15930 aix) postprocess_cc_v="|$tr , ' '" ;;
15937 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
15940 -D*) echo "\$i" | $sed 's/^-D//';;
15941 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
15946 postprocess_cc_v=''
15949 ./ccsym > ccsym1.raw
15950 if $test -s ccsym1.raw; then
15951 $sort ccsym1.raw | $uniq >ccsym.raw
15953 mv ccsym1.raw ccsym.raw
15956 $awk '/\=/ { print $0; next }
15957 { print $0"=1" }' ccsym.raw >ccsym.list
15958 $awk '/\=/ { print $0; next }
15959 { print $0"=1" }' Cppsym.true >ccsym.true
15960 $comm -13 ccsym.true ccsym.list >ccsym.own
15961 $comm -12 ccsym.true ccsym.list >ccsym.com
15962 $comm -23 ccsym.true ccsym.list >ccsym.cpp
15964 if $test -z ccsym.raw; then
15965 echo "Your C compiler doesn't seem to define any symbols!" >&4
15967 echo "However, your C preprocessor defines the following symbols:"
15970 cppsymbols=`$cat Cppsym.true`
15971 cppsymbols=`echo $cppsymbols`
15972 cppccsymbols="$cppsymbols"
15974 if $test -s ccsym.com; then
15975 echo "Your C compiler and pre-processor define these symbols:"
15976 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
15979 cppccsymbols=`$cat ccsym.com`
15980 cppccsymbols=`echo $cppccsymbols`
15981 $test "$silent" || sleep 1
15983 if $test -s ccsym.cpp; then
15984 $test "$also" && echo " "
15985 echo "Your C pre-processor ${also}defines the following symbols:"
15986 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
15988 cppsymbols=`$cat ccsym.cpp`
15989 cppsymbols=`echo $cppsymbols`
15990 $test "$silent" || sleep 1
15992 if $test -s ccsym.own; then
15993 $test "$also" && echo " "
15994 echo "Your C compiler ${also}defines the following cpp symbols:"
15995 $sed -e 's/\(..*\)=1/\1/' ccsym.own
15996 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
15997 ccsymbols=`$cat ccsym.own`
15998 ccsymbols=`echo $ccsymbols`
15999 $test "$silent" || sleep 1
16003 : see if this is a termio system
16007 if $test `./findhdr termios.h`; then
16008 set tcsetattr i_termios
16014 "$define") echo "You have POSIX termios.h... good!" >&4;;
16015 *) if ./Cppsym pyr; then
16016 case "`/bin/universe`" in
16017 ucb) if $test `./findhdr sgtty.h`; then
16019 echo "<sgtty.h> found." >&4
16021 echo "System is pyramid with BSD universe."
16022 echo "<sgtty.h> not found--you could have problems." >&4
16024 *) if $test `./findhdr termio.h`; then
16026 echo "<termio.h> found." >&4
16028 echo "System is pyramid with USG universe."
16029 echo "<termio.h> not found--you could have problems." >&4
16033 if $test `./findhdr termio.h`; then
16034 echo "<termio.h> found." >&4
16036 elif $test `./findhdr sgtty.h`; then
16037 echo "<sgtty.h> found." >&4
16040 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
16043 if $test `./findhdr sgtty.h`; then
16044 echo "<sgtty.h> found." >&4
16046 elif $test `./findhdr termio.h`; then
16047 echo "<termio.h> found." >&4
16050 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
16054 set i_termio; eval $setvar
16055 val=$val2; set i_sgtty; eval $setvar
16056 val=$val3; set i_termios; eval $setvar
16058 : see if this is a shadow.h system
16059 set shadow.h i_shadow
16062 : see if stddef is available
16063 set stddef.h i_stddef
16066 : see if this is a sunmath.h system
16067 set sunmath.h i_sunmath
16070 : see if sys/access.h is available
16071 set sys/access.h i_sysaccess
16074 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
16075 set sys/filio.h i_sysfilio
16078 if $test `./findhdr sys/ioctl.h`; then
16080 echo '<sys/ioctl.h> found.' >&4
16083 if $test $i_sysfilio = "$define"; then
16084 echo '<sys/ioctl.h> NOT found.' >&4
16086 $test $i_sgtty = "$define" && xxx="sgtty.h"
16087 $test $i_termio = "$define" && xxx="termio.h"
16088 $test $i_termios = "$define" && xxx="termios.h"
16089 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
16095 : see if socket ioctl defs are in sys/sockio.h
16097 xxx=`./findhdr sys/sockio.h`
16098 if $test "$xxx"; then
16099 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
16101 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
16104 echo "No socket ioctls found in <sys/sockio.h>." >&4
16109 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
16116 : see if this is a syslog.h system
16117 set syslog.h i_syslog
16121 : see if this is a sys/mode.h system
16122 set sys/mode.h i_sysmode
16125 : see if sys/resource.h has to be included
16126 set sys/resource.h i_sysresrc
16129 : see if sys/security.h is available
16130 set sys/security.h i_syssecrt
16133 : see if this is a sys/statvfs.h system
16134 set sys/statvfs.h i_sysstatvfs
16137 : see if this is a sys/un.h system
16138 set sys/un.h i_sysun
16142 : see if this is a sys/utsname.h system
16143 set sys/utsname.h i_sysutsname
16146 : see if this is a syswait system
16147 set sys/wait.h i_syswait
16150 : see if this is a ustat.h system
16151 set ustat.h i_ustat
16154 : see if this is an utime system
16155 set utime.h i_utime
16158 : see if this is a values.h system
16159 set values.h i_values
16162 : see if this is a vfork system
16165 set vfork.h i_vfork
16173 : see if gdbm.h is available
16178 : see if gdbm_open exists
16179 set gdbm_open d_gdbm_open
16181 case "$d_gdbm_open" in
16184 echo "We won't be including <gdbm.h>"
16194 echo "Looking for extensions..." >&4
16195 : If we are using the old config.sh, known_extensions may contain
16196 : old or inaccurate or duplicate values.
16197 known_extensions=''
16198 nonxs_extensions=''
16199 : We do not use find because it might not be available.
16200 : We do not just use MANIFEST because the user may have dropped
16201 : some additional extensions into the source tree and expect them
16204 : Function to recursively find available extensions, ignoring DynaLoader
16205 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
16209 DynaLoader|dynaload) ;;
16211 if $test -f $xxx/$xxx.xs; then
16212 known_extensions="$known_extensions $1$xxx";
16213 elif $test -f $xxx/Makefile.PL; then
16214 nonxs_extensions="$nonxs_extensions $1$xxx";
16216 if $test -d $xxx -a $# -lt 10; then
16219 eval $find_extensions;
16231 eval $find_extensions
16232 set X $nonxs_extensions
16234 nonxs_extensions="$*"
16235 set X $known_extensions
16237 known_extensions="$*"
16240 : Now see which are supported on this system.
16242 for xxx in $known_extensions ; do
16246 $define) avail_ext="$avail_ext $xxx" ;;
16249 GDBM_File|gdbm_fil)
16251 $define) avail_ext="$avail_ext $xxx" ;;
16254 I18N/Langinfo|i18n_lan)
16255 case "$i_langinfo$d_nl_langinfo" in
16256 $define$define) avail_ext="$avail_ext $xxx" ;;
16259 NDBM_File|ndbm_fil)
16262 case "$osname-$use64bitint" in
16263 cygwin-*|hpux-define)
16265 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
16268 *) avail_ext="$avail_ext $xxx" ;;
16273 ODBM_File|odbm_fil)
16274 case "${i_dbm}${i_rpcsvcdbm}" in
16276 case "$osname-$use64bitint" in
16277 cygwin-*|hpux-define)
16279 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
16282 *) avail_ext="$avail_ext $xxx" ;;
16288 case "$useposix" in
16289 true|define|y) avail_ext="$avail_ext $xxx" ;;
16293 case "$useopcode" in
16294 true|define|y) avail_ext="$avail_ext $xxx" ;;
16298 case "$d_socket" in
16299 true|$define|y) avail_ext="$avail_ext $xxx" ;;
16302 Sys/Syslog|sys/syslog)
16303 : XXX syslog requires socket
16304 case "$d_socket" in
16305 true|$define|y) avail_ext="$avail_ext $xxx" ;;
16309 case "$usethreads" in
16311 case "$useithreads" in
16312 $undef|false|[nN]*) avail_ext="$avail_ext $xxx" ;;
16317 : XXX Do we need a useipcsysv variable here
16318 case "${d_msg}${d_sem}${d_shm}" in
16319 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
16322 *) avail_ext="$avail_ext $xxx"
16331 : Now see which nonxs extensions are supported on this system.
16332 : For now assume all are.
16334 for xxx in $nonxs_extensions ; do
16336 *) nonxs_ext="$nonxs_ext $xxx"
16348 A number of extensions are supplied with $package. You may choose to
16349 compile these extensions for dynamic loading (the default), compile
16350 them into the $package executable (static loading), or not include
16351 them at all. Answer "none" to include no extensions.
16352 Note that DynaLoader is always built and need not be mentioned here.
16355 case "$dynamic_ext" in
16356 '') dflt="$avail_ext" ;;
16357 *) dflt="$dynamic_ext"
16358 # Perhaps we are reusing an old out-of-date config.sh.
16361 if test X"$dynamic_ext" != X"$avail_ext"; then
16363 NOTICE: Your previous config.sh list may be incorrect.
16364 The extensions now available to you are
16366 but the default list from your previous config.sh is
16378 rp="What extensions do you wish to load dynamically?"
16381 none) dynamic_ext=' ' ;;
16382 *) dynamic_ext="$ans" ;;
16385 case "$static_ext" in
16387 : Exclude those already listed in dynamic linking
16389 for xxx in $avail_ext; do
16390 case " $dynamic_ext " in
16392 *) dflt="$dflt $xxx" ;;
16399 *) dflt="$static_ext"
16406 rp="What extensions do you wish to load statically?"
16409 none) static_ext=' ' ;;
16410 *) static_ext="$ans" ;;
16415 A number of extensions are supplied with $package. Answer "none"
16416 to include no extensions.
16417 Note that DynaLoader is always built and need not be mentioned here.
16420 case "$static_ext" in
16421 '') dflt="$avail_ext" ;;
16422 *) dflt="$static_ext"
16423 # Perhaps we are reusing an old out-of-date config.sh.
16426 if test X"$static_ext" != X"$avail_ext"; then
16428 NOTICE: Your previous config.sh list may be incorrect.
16429 The extensions now available to you are
16431 but the default list from your previous config.sh is
16440 : Exclude those that are not xs extensions
16444 rp="What extensions do you wish to include?"
16447 none) static_ext=' ' ;;
16448 *) static_ext="$ans" ;;
16453 set X $dynamic_ext $static_ext $nonxs_ext
16457 : Remove libraries needed only for extensions
16458 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
16459 : The exception is SunOS 4.x, which needs them.
16460 case "${osname}X${osvers}" in
16464 *) case "$usedl" in
16465 $define|true|[yY]*)
16466 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
16470 *) perllibs="$libs"
16476 : Remove build directory name from cppstdin so it can be used from
16477 : either the present location or the final installed location.
16479 : Get out of the UU directory to get correct path name.
16481 case "$cppstdin" in
16483 echo "Stripping down cppstdin path name"
16489 : end of configuration questions
16491 echo "End of configuration questions."
16494 : back to where it started
16495 if test -d ../UU; then
16499 : configuration may be patched via a 'config.over' file
16500 if $test -f config.over; then
16503 rp='I see a config.over file. Do you wish to load it?'
16506 n*) echo "OK, I'll ignore it.";;
16508 echo "Configuration override changes have been loaded."
16513 : in case they want portability, strip down executable paths
16514 case "$d_portable" in
16517 echo "Stripping down executable paths..." >&4
16518 for file in $loclist $trylist; do
16520 eval $file=`basename $temp`
16525 : create config.sh file
16527 echo "Creating config.sh..." >&4
16528 $spitshell <<EOT >config.sh
16531 # This file was produced by running the Configure script. It holds all the
16532 # definitions figured out by Configure. Should you modify one of these values,
16533 # do not forget to propagate your changes by running "Configure -der". You may
16534 # instead choose to run each of the .SH files by yourself, or "Configure -S".
16537 # Package name : $package
16538 # Source directory : $src
16539 # Configuration time: $cf_time
16540 # Configured by : $cf_by
16541 # Target system : $myuname
16551 Revision='$Revision'
16559 alignbytes='$alignbytes'
16560 ansi2knr='$ansi2knr'
16561 aphostname='$aphostname'
16562 api_revision='$api_revision'
16563 api_subversion='$api_subversion'
16564 api_version='$api_version'
16565 api_versionstring='$api_versionstring'
16568 archlibexp='$archlibexp'
16569 archname64='$archname64'
16570 archname='$archname'
16571 archobjs='$archobjs'
16576 bincompat5005='$bincompat5005'
16580 byteorder='$byteorder'
16582 castflags='$castflags'
16585 cccdlflags='$cccdlflags'
16586 ccdlflags='$ccdlflags'
16588 ccflags_uselargefiles='$ccflags_uselargefiles'
16590 ccsymbols='$ccsymbols'
16591 ccversion='$ccversion'
16593 cf_email='$cf_email'
16595 charsize='$charsize'
16599 clocktype='$clocktype'
16601 compress='$compress'
16602 contains='$contains'
16606 cpp_stuff='$cpp_stuff'
16607 cppccsymbols='$cppccsymbols'
16608 cppflags='$cppflags'
16610 cppminus='$cppminus'
16612 cppstdin='$cppstdin'
16613 cppsymbols='$cppsymbols'
16614 cryptlib='$cryptlib'
16616 d_Gconvert='$d_Gconvert'
16617 d_PRIEUldbl='$d_PRIEUldbl'
16618 d_PRIFUldbl='$d_PRIFUldbl'
16619 d_PRIGUldbl='$d_PRIGUldbl'
16620 d_PRIXU64='$d_PRIXU64'
16621 d_PRId64='$d_PRId64'
16622 d_PRIeldbl='$d_PRIeldbl'
16623 d_PRIfldbl='$d_PRIfldbl'
16624 d_PRIgldbl='$d_PRIgldbl'
16625 d_PRIi64='$d_PRIi64'
16626 d_PRIo64='$d_PRIo64'
16627 d_PRIu64='$d_PRIu64'
16628 d_PRIx64='$d_PRIx64'
16629 d_SCNfldbl='$d_SCNfldbl'
16630 d__fwalk='$d__fwalk'
16631 d_access='$d_access'
16632 d_accessx='$d_accessx'
16634 d_archlib='$d_archlib'
16637 d_attribut='$d_attribut'
16640 d_bincompat5005='$d_bincompat5005'
16642 d_bsdgetpgrp='$d_bsdgetpgrp'
16643 d_bsdsetpgrp='$d_bsdsetpgrp'
16645 d_casti32='$d_casti32'
16646 d_castneg='$d_castneg'
16647 d_charvspr='$d_charvspr'
16649 d_chroot='$d_chroot'
16650 d_chsize='$d_chsize'
16651 d_closedir='$d_closedir'
16652 d_cmsghdr_s='$d_cmsghdr_s'
16656 d_cuserid='$d_cuserid'
16657 d_dbl_dig='$d_dbl_dig'
16658 d_dbminitproto='$d_dbminitproto'
16659 d_difftime='$d_difftime'
16660 d_dirnamlen='$d_dirnamlen'
16661 d_dlerror='$d_dlerror'
16662 d_dlopen='$d_dlopen'
16663 d_dlsymun='$d_dlsymun'
16664 d_dosuid='$d_dosuid'
16665 d_drand48proto='$d_drand48proto'
16667 d_eaccess='$d_eaccess'
16668 d_endgrent='$d_endgrent'
16669 d_endhent='$d_endhent'
16670 d_endnent='$d_endnent'
16671 d_endpent='$d_endpent'
16672 d_endpwent='$d_endpwent'
16673 d_endsent='$d_endsent'
16674 d_eofnblk='$d_eofnblk'
16675 d_eunice='$d_eunice'
16676 d_fchdir='$d_fchdir'
16677 d_fchmod='$d_fchmod'
16678 d_fchown='$d_fchown'
16680 d_fcntl_can_lock='$d_fcntl_can_lock'
16681 d_fd_macros='$d_fd_macros'
16682 d_fd_set='$d_fd_set'
16683 d_fds_bits='$d_fds_bits'
16684 d_fgetpos='$d_fgetpos'
16685 d_flexfnam='$d_flexfnam'
16687 d_flockproto='$d_flockproto'
16689 d_fpathconf='$d_fpathconf'
16690 d_fpos64_t='$d_fpos64_t'
16691 d_frexpl='$d_frexpl'
16692 d_fs_data_s='$d_fs_data_s'
16693 d_fseeko='$d_fseeko'
16694 d_fsetpos='$d_fsetpos'
16695 d_fstatfs='$d_fstatfs'
16696 d_fstatvfs='$d_fstatvfs'
16698 d_ftello='$d_ftello'
16700 d_getcwd='$d_getcwd'
16701 d_getespwnam='$d_getespwnam'
16702 d_getfsstat='$d_getfsstat'
16703 d_getgrent='$d_getgrent'
16704 d_getgrps='$d_getgrps'
16705 d_gethbyaddr='$d_gethbyaddr'
16706 d_gethbyname='$d_gethbyname'
16707 d_gethent='$d_gethent'
16708 d_gethname='$d_gethname'
16709 d_gethostprotos='$d_gethostprotos'
16710 d_getitimer='$d_getitimer'
16711 d_getlogin='$d_getlogin'
16712 d_getmnt='$d_getmnt'
16713 d_getmntent='$d_getmntent'
16714 d_getnbyaddr='$d_getnbyaddr'
16715 d_getnbyname='$d_getnbyname'
16716 d_getnent='$d_getnent'
16717 d_getnetprotos='$d_getnetprotos'
16718 d_getpagsz='$d_getpagsz'
16719 d_getpbyname='$d_getpbyname'
16720 d_getpbynumber='$d_getpbynumber'
16721 d_getpent='$d_getpent'
16722 d_getpgid='$d_getpgid'
16723 d_getpgrp2='$d_getpgrp2'
16724 d_getpgrp='$d_getpgrp'
16725 d_getppid='$d_getppid'
16726 d_getprior='$d_getprior'
16727 d_getprotoprotos='$d_getprotoprotos'
16728 d_getprpwnam='$d_getprpwnam'
16729 d_getpwent='$d_getpwent'
16730 d_getsbyname='$d_getsbyname'
16731 d_getsbyport='$d_getsbyport'
16732 d_getsent='$d_getsent'
16733 d_getservprotos='$d_getservprotos'
16734 d_getspnam='$d_getspnam'
16735 d_gettimeod='$d_gettimeod'
16736 d_gnulibc='$d_gnulibc'
16737 d_grpasswd='$d_grpasswd'
16738 d_hasmntopt='$d_hasmntopt'
16742 d_inetaton='$d_inetaton'
16743 d_int64_t='$d_int64_t'
16744 d_isascii='$d_isascii'
16746 d_isnanl='$d_isnanl'
16747 d_killpg='$d_killpg'
16748 d_lchown='$d_lchown'
16749 d_ldbl_dig='$d_ldbl_dig'
16751 d_locconv='$d_locconv'
16753 d_longdbl='$d_longdbl'
16754 d_longlong='$d_longlong'
16755 d_lseekproto='$d_lseekproto'
16757 d_madvise='$d_madvise'
16759 d_mbstowcs='$d_mbstowcs'
16760 d_mbtowc='$d_mbtowc'
16761 d_memchr='$d_memchr'
16762 d_memcmp='$d_memcmp'
16763 d_memcpy='$d_memcpy'
16764 d_memmove='$d_memmove'
16765 d_memset='$d_memset'
16767 d_mkdtemp='$d_mkdtemp'
16768 d_mkfifo='$d_mkfifo'
16769 d_mkstemp='$d_mkstemp'
16770 d_mkstemps='$d_mkstemps'
16771 d_mktime='$d_mktime'
16774 d_modfl_pow32_bug='$d_modfl_pow32_bug'
16775 d_mprotect='$d_mprotect'
16777 d_msg_ctrunc='$d_msg_ctrunc'
16778 d_msg_dontroute='$d_msg_dontroute'
16779 d_msg_oob='$d_msg_oob'
16780 d_msg_peek='$d_msg_peek'
16781 d_msg_proxy='$d_msg_proxy'
16782 d_msgctl='$d_msgctl'
16783 d_msgget='$d_msgget'
16784 d_msghdr_s='$d_msghdr_s'
16785 d_msgrcv='$d_msgrcv'
16786 d_msgsnd='$d_msgsnd'
16788 d_munmap='$d_munmap'
16789 d_mymalloc='$d_mymalloc'
16791 d_nl_langinfo='$d_nl_langinfo'
16792 d_nv_preserves_uv='$d_nv_preserves_uv'
16793 d_nv_preserves_uv_bits='$d_nv_preserves_uv_bits'
16794 d_off64_t='$d_off64_t'
16795 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
16796 d_oldpthreads='$d_oldpthreads'
16797 d_oldsock='$d_oldsock'
16799 d_pathconf='$d_pathconf'
16801 d_perl_otherlibdirs='$d_perl_otherlibdirs'
16802 d_phostname='$d_phostname'
16805 d_portable='$d_portable'
16806 d_pthread_yield='$d_pthread_yield'
16808 d_pwchange='$d_pwchange'
16809 d_pwclass='$d_pwclass'
16810 d_pwcomment='$d_pwcomment'
16811 d_pwexpire='$d_pwexpire'
16812 d_pwgecos='$d_pwgecos'
16813 d_pwpasswd='$d_pwpasswd'
16814 d_pwquota='$d_pwquota'
16817 d_readdir='$d_readdir'
16818 d_readlink='$d_readlink'
16820 d_recvmsg='$d_recvmsg'
16821 d_rename='$d_rename'
16822 d_rewinddir='$d_rewinddir'
16824 d_safebcpy='$d_safebcpy'
16825 d_safemcpy='$d_safemcpy'
16826 d_sanemcmp='$d_sanemcmp'
16827 d_sbrkproto='$d_sbrkproto'
16828 d_sched_yield='$d_sched_yield'
16829 d_scm_rights='$d_scm_rights'
16830 d_seekdir='$d_seekdir'
16831 d_select='$d_select'
16833 d_semctl='$d_semctl'
16834 d_semctl_semid_ds='$d_semctl_semid_ds'
16835 d_semctl_semun='$d_semctl_semun'
16836 d_semget='$d_semget'
16838 d_sendmsg='$d_sendmsg'
16839 d_setegid='$d_setegid'
16840 d_seteuid='$d_seteuid'
16841 d_setgrent='$d_setgrent'
16842 d_setgrps='$d_setgrps'
16843 d_sethent='$d_sethent'
16844 d_setitimer='$d_setitimer'
16845 d_setlinebuf='$d_setlinebuf'
16846 d_setlocale='$d_setlocale'
16847 d_setnent='$d_setnent'
16848 d_setpent='$d_setpent'
16849 d_setpgid='$d_setpgid'
16850 d_setpgrp2='$d_setpgrp2'
16851 d_setpgrp='$d_setpgrp'
16852 d_setprior='$d_setprior'
16853 d_setproctitle='$d_setproctitle'
16854 d_setpwent='$d_setpwent'
16855 d_setregid='$d_setregid'
16856 d_setresgid='$d_setresgid'
16857 d_setresuid='$d_setresuid'
16858 d_setreuid='$d_setreuid'
16859 d_setrgid='$d_setrgid'
16860 d_setruid='$d_setruid'
16861 d_setsent='$d_setsent'
16862 d_setsid='$d_setsid'
16863 d_setvbuf='$d_setvbuf'
16867 d_shmatprototype='$d_shmatprototype'
16868 d_shmctl='$d_shmctl'
16870 d_shmget='$d_shmget'
16871 d_sigaction='$d_sigaction'
16872 d_sigprocmask='$d_sigprocmask'
16873 d_sigsetjmp='$d_sigsetjmp'
16874 d_sockatmark='$d_sockatmark'
16875 d_sockatmarkproto='$d_sockatmarkproto'
16876 d_socket='$d_socket'
16877 d_socklen_t='$d_socklen_t'
16878 d_sockpair='$d_sockpair'
16879 d_socks5_init='$d_socks5_init'
16881 d_sresgproto='$d_sresgproto'
16882 d_sresuproto='$d_sresuproto'
16883 d_statblks='$d_statblks'
16884 d_statfs_f_flags='$d_statfs_f_flags'
16885 d_statfs_s='$d_statfs_s'
16886 d_statvfs='$d_statvfs'
16887 d_stdio_cnt_lval='$d_stdio_cnt_lval'
16888 d_stdio_ptr_lval='$d_stdio_ptr_lval'
16889 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
16890 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
16891 d_stdio_stream_array='$d_stdio_stream_array'
16892 d_stdiobase='$d_stdiobase'
16893 d_stdstdio='$d_stdstdio'
16894 d_strchr='$d_strchr'
16895 d_strcoll='$d_strcoll'
16896 d_strctcpy='$d_strctcpy'
16897 d_strerrm='$d_strerrm'
16898 d_strerror='$d_strerror'
16899 d_strftime='$d_strftime'
16900 d_strtod='$d_strtod'
16901 d_strtol='$d_strtol'
16902 d_strtold='$d_strtold'
16903 d_strtoll='$d_strtoll'
16904 d_strtoq='$d_strtoq'
16905 d_strtoul='$d_strtoul'
16906 d_strtoull='$d_strtoull'
16907 d_strtouq='$d_strtouq'
16908 d_strxfrm='$d_strxfrm'
16909 d_suidsafe='$d_suidsafe'
16910 d_symlink='$d_symlink'
16911 d_syscall='$d_syscall'
16912 d_syscallproto='$d_syscallproto'
16913 d_sysconf='$d_sysconf'
16914 d_sysernlst='$d_sysernlst'
16915 d_syserrlst='$d_syserrlst'
16916 d_system='$d_system'
16917 d_tcgetpgrp='$d_tcgetpgrp'
16918 d_tcsetpgrp='$d_tcsetpgrp'
16919 d_telldir='$d_telldir'
16920 d_telldirproto='$d_telldirproto'
16923 d_truncate='$d_truncate'
16924 d_tzname='$d_tzname'
16925 d_u32align='$d_u32align'
16926 d_ualarm='$d_ualarm'
16929 d_union_semun='$d_union_semun'
16930 d_usleep='$d_usleep'
16931 d_usleepproto='$d_usleepproto'
16933 d_vendorarch='$d_vendorarch'
16934 d_vendorbin='$d_vendorbin'
16935 d_vendorlib='$d_vendorlib'
16937 d_void_closedir='$d_void_closedir'
16938 d_voidsig='$d_voidsig'
16939 d_voidtty='$d_voidtty'
16940 d_volatile='$d_volatile'
16941 d_vprintf='$d_vprintf'
16943 d_waitpid='$d_waitpid'
16944 d_wcstombs='$d_wcstombs'
16945 d_wctomb='$d_wctomb'
16946 d_writev='$d_writev'
16949 db_hashtype='$db_hashtype'
16950 db_prefixtype='$db_prefixtype'
16951 db_version_major='$db_version_major'
16952 db_version_minor='$db_version_minor'
16953 db_version_patch='$db_version_patch'
16954 defvoidused='$defvoidused'
16955 direntrytype='$direntrytype'
16958 doublesize='$doublesize'
16960 dynamic_ext='$dynamic_ext'
16966 eunicefix='$eunicefix'
16969 extensions='$extensions'
16970 fflushNULL='$fflushNULL'
16971 fflushall='$fflushall'
16973 firstmakefile='$firstmakefile'
16975 fpossize='$fpossize'
16976 fpostype='$fpostype'
16977 freetype='$freetype'
16980 full_csh='$full_csh'
16981 full_sed='$full_sed'
16982 gccosandvers='$gccosandvers'
16983 gccversion='$gccversion'
16984 gidformat='$gidformat'
16990 groupcat='$groupcat'
16991 groupstype='$groupstype'
16994 h_sysfile='$h_sysfile'
17005 i_arpainet='$i_arpainet'
17006 i_bsdioctl='$i_bsdioctl'
17009 i_dirent='$i_dirent'
17017 i_ieeefp='$i_ieeefp'
17018 i_inttypes='$i_inttypes'
17019 i_langinfo='$i_langinfo'
17020 i_libutil='$i_libutil'
17021 i_limits='$i_limits'
17022 i_locale='$i_locale'
17023 i_machcthr='$i_machcthr'
17024 i_malloc='$i_malloc'
17026 i_memory='$i_memory'
17027 i_mntent='$i_mntent'
17030 i_neterrno='$i_neterrno'
17031 i_netinettcp='$i_netinettcp'
17035 i_pthread='$i_pthread'
17037 i_rpcsvcdbm='$i_rpcsvcdbm'
17040 i_shadow='$i_shadow'
17042 i_stdarg='$i_stdarg'
17043 i_stddef='$i_stddef'
17044 i_stdlib='$i_stdlib'
17045 i_string='$i_string'
17046 i_sunmath='$i_sunmath'
17047 i_sysaccess='$i_sysaccess'
17048 i_sysdir='$i_sysdir'
17049 i_sysfile='$i_sysfile'
17050 i_sysfilio='$i_sysfilio'
17052 i_sysioctl='$i_sysioctl'
17053 i_syslog='$i_syslog'
17054 i_sysmman='$i_sysmman'
17055 i_sysmode='$i_sysmode'
17056 i_sysmount='$i_sysmount'
17057 i_sysndir='$i_sysndir'
17058 i_sysparam='$i_sysparam'
17059 i_sysresrc='$i_sysresrc'
17060 i_syssecrt='$i_syssecrt'
17061 i_sysselct='$i_sysselct'
17062 i_syssockio='$i_syssockio'
17063 i_sysstat='$i_sysstat'
17064 i_sysstatfs='$i_sysstatfs'
17065 i_sysstatvfs='$i_sysstatvfs'
17066 i_systime='$i_systime'
17067 i_systimek='$i_systimek'
17068 i_systimes='$i_systimes'
17069 i_systypes='$i_systypes'
17070 i_sysuio='$i_sysuio'
17072 i_sysutsname='$i_sysutsname'
17073 i_sysvfs='$i_sysvfs'
17074 i_syswait='$i_syswait'
17075 i_termio='$i_termio'
17076 i_termios='$i_termios'
17078 i_unistd='$i_unistd'
17081 i_values='$i_values'
17082 i_varargs='$i_varargs'
17083 i_varhdr='$i_varhdr'
17085 ignore_versioned_solibs='$ignore_versioned_solibs'
17086 inc_version_list='$inc_version_list'
17087 inc_version_list_init='$inc_version_list_init'
17090 installarchlib='$installarchlib'
17091 installbin='$installbin'
17092 installman1dir='$installman1dir'
17093 installman3dir='$installman3dir'
17094 installprefix='$installprefix'
17095 installprefixexp='$installprefixexp'
17096 installprivlib='$installprivlib'
17097 installscript='$installscript'
17098 installsitearch='$installsitearch'
17099 installsitebin='$installsitebin'
17100 installsitelib='$installsitelib'
17101 installstyle='$installstyle'
17102 installusrbinperl='$installusrbinperl'
17103 installvendorarch='$installvendorarch'
17104 installvendorbin='$installvendorbin'
17105 installvendorlib='$installvendorlib'
17107 issymlink='$issymlink'
17108 ivdformat='$ivdformat'
17111 known_extensions='$known_extensions'
17114 lddlflags='$lddlflags'
17116 ldflags_uselargefiles='$ldflags_uselargefiles'
17117 ldlibpthname='$ldlibpthname'
17124 libsdirs='$libsdirs'
17125 libsfiles='$libsfiles'
17126 libsfound='$libsfound'
17127 libspath='$libspath'
17128 libswanted='$libswanted'
17129 libswanted_uselargefiles='$libswanted_uselargefiles'
17135 locincpth='$locincpth'
17136 loclibpth='$loclibpth'
17137 longdblsize='$longdblsize'
17138 longlongsize='$longlongsize'
17139 longsize='$longsize'
17143 lseeksize='$lseeksize'
17144 lseektype='$lseektype'
17148 make_set_make='$make_set_make'
17149 mallocobj='$mallocobj'
17150 mallocsrc='$mallocsrc'
17151 malloctype='$malloctype'
17153 man1direxp='$man1direxp'
17156 man3direxp='$man3direxp'
17158 mips_type='$mips_type'
17160 mmaptype='$mmaptype'
17161 modetype='$modetype'
17163 multiarch='$multiarch'
17165 myarchname='$myarchname'
17166 mydomain='$mydomain'
17167 myhostname='$myhostname'
17170 need_va_copy='$need_va_copy'
17171 netdb_hlen_type='$netdb_hlen_type'
17172 netdb_host_type='$netdb_host_type'
17173 netdb_name_type='$netdb_name_type'
17174 netdb_net_type='$netdb_net_type'
17177 nm_so_opt='$nm_so_opt'
17178 nonxs_ext='$nonxs_ext'
17180 nvEUformat='$nvEUformat'
17181 nvFUformat='$nvFUformat'
17182 nvGUformat='$nvGUformat'
17183 nveformat='$nveformat'
17184 nvfformat='$nvfformat'
17185 nvgformat='$nvgformat'
17188 o_nonblock='$o_nonblock'
17190 old_pthread_create_joinable='$old_pthread_create_joinable'
17191 optimize='$optimize'
17192 orderlib='$orderlib'
17195 otherlibdirs='$otherlibdirs'
17199 patchlevel='$patchlevel'
17200 path_sep='$path_sep'
17203 perl_patchlevel='$perl_patchlevel'
17204 perladmin='$perladmin'
17205 perllibs='$perllibs'
17206 perlpath='$perlpath'
17208 phostname='$phostname'
17211 pm_apiversion='$pm_apiversion'
17215 prefixexp='$prefixexp'
17217 privlibexp='$privlibexp'
17218 prototype='$prototype'
17220 quadkind='$quadkind'
17221 quadtype='$quadtype'
17222 randbits='$randbits'
17223 randfunc='$randfunc'
17224 randseedtype='$randseedtype'
17226 rd_nodata='$rd_nodata'
17227 revision='$revision'
17232 sPRIEUldbl='$sPRIEUldbl'
17233 sPRIFUldbl='$sPRIFUldbl'
17234 sPRIGUldbl='$sPRIGUldbl'
17235 sPRIXU64='$sPRIXU64'
17237 sPRIeldbl='$sPRIeldbl'
17238 sPRIfldbl='$sPRIfldbl'
17239 sPRIgldbl='$sPRIgldbl'
17244 sSCNfldbl='$sSCNfldbl'
17245 sched_yield='$sched_yield'
17246 scriptdir='$scriptdir'
17247 scriptdirexp='$scriptdirexp'
17249 seedfunc='$seedfunc'
17250 selectminbits='$selectminbits'
17251 selecttype='$selecttype'
17252 sendmail='$sendmail'
17255 sharpbang='$sharpbang'
17256 shmattype='$shmattype'
17257 shortsize='$shortsize'
17260 sig_count='$sig_count'
17261 sig_name='$sig_name'
17262 sig_name_init='$sig_name_init'
17264 sig_num_init='$sig_num_init'
17265 sig_size='$sig_size'
17266 signal_t='$signal_t'
17267 sitearch='$sitearch'
17268 sitearchexp='$sitearchexp'
17270 sitebinexp='$sitebinexp'
17272 sitelib_stem='$sitelib_stem'
17273 sitelibexp='$sitelibexp'
17274 siteprefix='$siteprefix'
17275 siteprefixexp='$siteprefixexp'
17276 sizesize='$sizesize'
17277 sizetype='$sizetype'
17281 sockethdr='$sockethdr'
17282 socketlib='$socketlib'
17283 socksizetype='$socksizetype'
17285 spackage='$spackage'
17286 spitshell='$spitshell'
17288 ssizetype='$ssizetype'
17289 startperl='$startperl'
17291 static_ext='$static_ext'
17293 stdio_base='$stdio_base'
17294 stdio_bufsiz='$stdio_bufsiz'
17295 stdio_cnt='$stdio_cnt'
17296 stdio_filbuf='$stdio_filbuf'
17297 stdio_ptr='$stdio_ptr'
17298 stdio_stream_array='$stdio_stream_array'
17301 subversion='$subversion'
17305 targetarch='$targetarch'
17309 timeincl='$timeincl'
17310 timetype='$timetype'
17324 uidformat='$uidformat'
17330 uquadtype='$uquadtype'
17331 use5005threads='$use5005threads'
17332 use64bitall='$use64bitall'
17333 use64bitint='$use64bitint'
17334 usecrosscompile='$usecrosscompile'
17336 useithreads='$useithreads'
17337 uselargefiles='$uselargefiles'
17338 uselongdouble='$uselongdouble'
17339 usemorebits='$usemorebits'
17340 usemultiplicity='$usemultiplicity'
17341 usemymalloc='$usemymalloc'
17343 useopcode='$useopcode'
17344 useperlio='$useperlio'
17345 useposix='$useposix'
17346 usereentrant='$usereentrant'
17348 useshrplib='$useshrplib'
17349 usesocks='$usesocks'
17350 usethreads='$usethreads'
17351 usevendorprefix='$usevendorprefix'
17352 usevfork='$usevfork'
17355 uvXUformat='$uvXUformat'
17356 uvoformat='$uvoformat'
17359 uvuformat='$uvuformat'
17360 uvxformat='$uvxformat'
17361 vendorarch='$vendorarch'
17362 vendorarchexp='$vendorarchexp'
17363 vendorbin='$vendorbin'
17364 vendorbinexp='$vendorbinexp'
17365 vendorlib='$vendorlib'
17366 vendorlib_stem='$vendorlib_stem'
17367 vendorlibexp='$vendorlibexp'
17368 vendorprefix='$vendorprefix'
17369 vendorprefixexp='$vendorprefixexp'
17371 version_patchlevel_string='$version_patchlevel_string'
17372 versiononly='$versiononly'
17374 voidflags='$voidflags'
17376 xs_apiversion='$xs_apiversion'
17378 yaccflags='$yaccflags'
17383 : Add in command line options if available
17384 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
17386 : add special variables
17387 $test -f $src/patchlevel.h && \
17388 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
17389 echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
17390 echo "PERL_CONFIG_SH=true" >>config.sh
17392 : propagate old symbols
17393 if $test -f UU/config.sh; then
17394 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
17395 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
17396 $sort | $uniq -u >UU/oldsyms
17397 set X `cat UU/oldsyms`
17403 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
17405 echo "# Variables propagated from previous config.sh file." >>config.sh
17406 for sym in `cat UU/oldsyms`; do
17407 echo " Propagating $hint variable "'$'"$sym..."
17408 eval 'tmp="$'"${sym}"'"'
17410 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
17416 : Finish up by extracting the .SH files
17420 echo "Extraction done."
17430 If you'd like to make any changes to the config.sh file before I begin
17431 to configure things, do it as a shell escape now (e.g. !vi config.sh).
17434 rp="Press return or use a shell escape to edit config.sh:"
17439 *) : in case they cannot read
17440 sh 1>&4 -c "$ans";;
17445 : if this fails, just run all the .SH files by hand
17454 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
17461 Now you need to generate make dependencies by running "$make depend".
17462 You might prefer to run it in background: "$make depend > makedepend.out &"
17463 It can take a while, so you might not want to run it right now.
17468 rp="Run $make depend now?"
17472 $make depend && echo "Now you must run '$make'."
17475 echo "You must run '$make depend' then '$make'."
17478 elif test -f [Mm]akefile; then
17480 echo "Now you must run a $make."
17482 echo "Configure done."
17485 if $test -f Policy.sh; then
17488 If you compile $package on a different machine or from a different object
17489 directory, copy the Policy.sh file from this object directory to the
17490 new one before you run Configure -- this will help you with most of
17491 the policy defaults.
17495 if $test -f config.msg; then
17496 echo "Hmm. I also noted the following information while running:"
17498 $cat config.msg >&4
17501 $rm -f kit*isdone ark*isdone