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 Nov 16 16:33:41 EET 2000 [metaconfig 3.0 PL70]
24 # (with additional metaconfig patches by perlbug@perl.org)
29 SCO csh still thinks true is false. Write to SCO today and tell them that next
30 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
32 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
33 we'd have to do is go in and swap the && and || tokens, wherever they are.)
35 [End of diatribe. We now return you to your regularly scheduled programming...]
39 OOPS! You naughty creature! You didn't run Configure with sh!
40 I will attempt to remedy the situation by running sh for you...
43 true || cat /tmp/c1$$ /tmp/c2$$
44 true || exec sh $0 $argv:q
46 (exit $?0) || cat /tmp/c2$$
47 (exit $?0) || exec sh $0 $argv:q
48 rm -f /tmp/c1$$ /tmp/c2$$
50 : compute my invocation name
54 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
59 : Proper separator for the PATH environment variable
61 : On OS/2 this directory should exist if this is not floppy only system :-]
62 if test -d c:/. ; then
63 if test -n "$OS2_SHELL"; then
65 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
66 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
67 elif test -n "$DJGPP"; then
73 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
74 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
75 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
76 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
77 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
78 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /usr/ccs/bin"
79 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
80 paths="$paths /sbin /usr/sbin /usr/libexec"
86 *) test -d $p && PATH=$PATH$p_$p ;;
93 : shall we be using ksh?
99 if (PATH=.; alias -x) >/dev/null 2>&1; then
102 if test -f /hp-ux -a -f /bin/ksh; then
103 needksh='to avoid sh bug in "here document" expansion'
105 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
106 if test X`/usr/bin/uname -v` = X4; then
107 avoidksh="to avoid AIX 4's /bin/sh"
111 if test -f /osf_boot -a -f /usr/sbin/setld; then
112 if test X`/usr/bin/uname -s` = XOSF1; then
113 avoidksh="to avoid Digital UNIX' ksh"
115 unset BIN_SH # if this is 'xpg4' sh will start up ksh
118 case "$inksh/$needksh" in
125 case "$inksh/$avoidksh" in
131 case "$inksh/$needksh-$avoidksh-" in
134 (I see you are using the Korn shell. Some ksh's blow up on $me,
135 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
141 echo "(Feeding myself to $newsh $reason.)"
143 Configure|*/Configure) exec $newsh $0 "$@";;
144 *) exec $newsh Configure "$@";;
149 : if needed set CDPATH to a harmless value that is not chatty
150 : avoid bash 2.02 problems with empty CDPATH.
154 *bash*) CDPATH='.' ;;
159 : Configure runs within the UU subdirectory
160 test -d UU || mkdir UU
465 d_old_pthread_create_joinable=''
466 old_pthread_create_joinable=''
544 d_stdio_ptr_lval_nochange_cnt=''
545 d_stdio_ptr_lval_sets_cnt=''
716 inc_version_list_init=''
734 ignore_versioned_solibs=''
792 d_perl_otherlibdirs=''
809 d_nv_preserves_uv_bits=''
907 d_stdio_stream_array=''
908 stdio_stream_array=''
918 ccflags_uselargefiles=''
919 ldflags_uselargefiles=''
920 libswanted_uselargefiles=''
963 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
966 : We must find out about Eunice early
968 if test -f /etc/unixtovms; then
969 eunicefix=/etc/unixtovms
971 if test -f /etc/unixtovms.exe; then
972 eunicefix=/etc/unixtovms.exe
979 : set useposix=false in your hint file to disable the POSIX extension.
981 : set useopcode=false in your hint file to disable the Opcode extension.
983 : Trailing extension. Override this in a hint file, if needed.
985 : Extra object files, if any, needed on this platform.
988 : Possible local include directories to search.
989 : Set locincpth to "" in a hint file to defeat local include searches.
990 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
991 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
993 : no include file wanted by default
997 : change the next line if compiling for Xenix/286 on Xenix/386
998 xlibpth='/usr/lib/386 /lib/386'
999 : Possible local library directories to search.
1000 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1001 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1003 : general looking path for locating libraries
1004 glibpth="/lib /usr/lib $xlibpth"
1005 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1006 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1007 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1009 : Private path used by Configure to find libraries. Its value
1010 : is prepended to libpth. This variable takes care of special
1011 : machines, like the mips. Usually, it should be empty.
1014 : default library list
1016 : some systems want to use only the non-versioned libso:s
1017 ignore_versioned_solibs=''
1019 ccflags_uselargefiles=''
1020 ldflags_uselargefiles=''
1021 libswanted_uselargefiles=''
1022 : set usemultiplicity on the Configure command line to enable multiplicity.
1023 : set usesocks on the Configure command line to enable socks.
1024 : set usethreads on the Configure command line to enable threads.
1025 : full support for void wanted by default
1028 : List of libraries we want.
1029 : If anyone needs -lnet, put it in a hint file.
1030 libswanted='sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl'
1031 libswanted="$libswanted dld ld sun m c cposix posix"
1032 libswanted="$libswanted ndir dir crypt sec"
1033 libswanted="$libswanted ucb bsd BSD PW x iconv util"
1034 : We probably want to search /usr/shlib before most other libraries.
1035 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1036 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1037 glibpth="/usr/shlib $glibpth"
1038 : Do not use vfork unless overridden by a hint file.
1041 : Find the basic shell for Bourne shell scripts
1045 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1048 if test -f "$xxx"; then
1051 : Build up a list and do a single loop so we can 'break' out.
1052 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1053 for xxx in sh bash ksh pdksh ash; do
1055 try="$try ${p}/${xxx}"
1059 if test -f "$xxx"; then
1062 elif test -f "$xxx.exe"; then
1073 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1075 Usually it's in /bin/sh. How did you even get this far?
1076 Please contact me (Perl Maintainers) at perlbug@perl.org and
1077 we'll try to straighten this all out.
1083 : see if sh knows # comments
1084 if `$sh -c '#' >/dev/null 2>&1`; then
1088 test -f $xcat || xcat=/usr/bin/cat
1093 if test -s today; then
1096 echo "#! $xcat" > try
1100 if test -s today; then
1108 echo "Your $sh doesn't grok # comments--I will strip them later on."
1111 echo "exec grep -v '^[ ]*#'" >spitshell
1113 $eunicefix spitshell
1114 spitshell=`pwd`/spitshell
1116 echo "I presume that if # doesn't work, #! won't work either!"
1121 : figure out how to guarantee sh startup
1123 '') startsh=${sharpbang}${sh} ;;
1135 : echo "Yup, it does."
1137 echo "Hmm... '$startsh' does not guarantee sh startup..."
1138 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1143 : Save command line options in file UU/cmdline.opt for later use in
1144 : generating config.sh.
1145 cat > cmdline.opt <<EOSH
1146 # Configure command line arguments.
1153 cat >>cmdline.opt <<EOSH
1154 config_arg$argn='$arg'
1156 argn=`expr $argn + 1`
1159 : produce awk script to parse command line options
1160 cat >options.awk <<'EOF'
1162 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1164 len = length(optstr);
1165 for (i = 1; i <= len; i++) {
1166 c = substr(optstr, i, 1);
1167 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1178 if (substr(str, 1, 1) != "-") {
1179 printf("'%s'\n", str);
1183 for (i = 2; i <= len; i++) {
1184 c = substr(str, i, 1);
1186 printf("-%s\n", substr(str, i));
1192 printf("'%s'\n", substr(str, i + 1));
1205 : process the command line options
1206 set X `for arg in "$@"; do echo "X$arg"; done |
1207 sed -e s/X// | awk -f options.awk`
1212 : set up default values
1222 rm -f optdef.sh posthint.sh
1223 cat >optdef.sh <<EOS
1229 while test $# -gt 0; do
1231 -d) shift; fastread=yes;;
1232 -e) shift; alldone=cont;;
1236 if test -r "$1"; then
1239 echo "$me: cannot read config file $1." >&2
1244 -h) shift; error=true;;
1245 -r) shift; reuseval=true;;
1246 -s) shift; silent=true; realsilent=true;;
1247 -E) shift; alldone=exit;;
1248 -K) shift; knowitall=true;;
1249 -O) shift; override=true;;
1250 -S) shift; silent=true; extractsh=true;;
1255 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1256 echo "$me: ignoring -D $1" >&2
1259 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1260 *) echo "$1='define'" >> optdef.sh;;
1267 *=) echo "$1" >> optdef.sh;;
1269 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1270 echo "$me: ignoring -U $1" >&2
1272 *) echo "$1='undef'" >> optdef.sh;;
1283 *=*) zzz=`echo $yyy|sed 's!=.*!!'`
1287 zzz=" "`echo $yyy|sed 's!^[^=]*=!!'`
1288 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1294 *:*) xxx=`echo $yyy|sed 's!:.*!!'`
1295 yyy=`echo $yyy|sed 's!^[^:]*:!!'`
1296 zzz=`echo $yyy|sed 's!^[^=]*=!!'`
1297 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1298 *) xxx=`echo $yyy|sed 's!:.*!!'`
1299 yyy=`echo $yyy|sed 's!^[^:]*:!!'` ;;
1305 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1307 echo "$yyy=''" >> posthint.sh ;;
1312 echo "$yyy='$zzz'" >> posthint.sh ;;
1314 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1316 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1321 echo "$yyy=$zzz" >> posthint.sh ;;
1322 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1326 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1329 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1337 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1338 [-U symbol] [-U symbol=] [-A command:symbol...]
1339 -d : use defaults for all answers.
1340 -e : go on without questioning past the production of config.sh.
1341 -f : specify an alternate default configuration file.
1342 -h : print this help message and exit (with an error status).
1343 -r : reuse C symbols value if possible (skips costly nm extraction).
1344 -s : silent mode, only echoes questions and essential information.
1345 -D : define symbol to have some value:
1346 -D symbol symbol gets the value 'define'
1347 -D symbol=value symbol gets the value 'value'
1348 -E : stop at the end of questions, after having produced config.sh.
1349 -K : do not use unless you know what you are doing.
1350 -O : let -D and -U override definitions from loaded configuration file.
1351 -S : perform variable substitutions on all .SH files (can mix with -f)
1352 -U : undefine symbol:
1353 -U symbol symbol gets the value 'undef'
1354 -U symbol= symbol gets completely empty
1355 -A : manipulate symbol after the platform specific hints have been applied:
1356 -A symbol=value append " "value to symbol
1357 -A append:symbol=value append value to symbol
1358 -A define:symbol=value define symbol to have value
1359 -A clear:symbol define symbol to be ''
1360 -A define:symbol define symbol to be 'define'
1361 -A eval:symbol=value define symbol to be eval of value
1362 -A prepend:symbol=value prepend value to symbol
1363 -A undef:symbol define symbol to be 'undef'
1364 -A undef:symbol= define symbol to be ''
1365 -V : print version number and exit (with a zero status).
1372 case "$fastread$alldone" in
1375 case "$extractsh" in
1378 if test ! -t 0; then
1379 echo "Say 'sh Configure', not 'sh <Configure'"
1389 true) exec 1>/dev/null;;
1392 : run the defines and the undefines, if any, but leave the file out there...
1395 : create the posthint manipulation script and leave the file out there...
1400 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1401 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1402 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1403 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1404 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1407 : Some greps do not return status, grrr.
1408 echo "grimblepritz" >grimble
1409 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1411 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1417 : the following should work in any shell
1421 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1422 cat >contains <<'EOSS'
1423 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1428 : Find the path to the source tree
1431 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1434 *) src=`cd ../$src && pwd` ;;
1447 if test -f $rsrc/Configure && \
1448 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1450 : found it, so we are ok.
1453 for src in . .. ../.. ../../.. ../../../..; do
1454 if test -f ../$src/Configure && \
1455 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1466 Sorry, I can't seem to locate the source dir for $package. Please start
1467 Configure with an explicit path -- i.e. /some/path/Configure.
1475 echo "Sources for $package found in \"$src\"." >&4
1479 : script used to extract .SH files with variable substitutions
1480 cat >extract <<'EOS'
1482 echo "Doing variable substitutions on .SH files..."
1483 if test -f $src/MANIFEST; then
1484 set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH$'`
1486 echo "(Looking for .SH files under the source directory.)"
1487 set x `(cd $src; find . -name "*.SH" -print)`
1491 0) set x `(cd $src; echo *.SH)`; shift;;
1493 if test ! -f $src/$1; then
1499 while test $name; do
1500 if test ! -d "$name"; then
1501 create="$name $create";
1502 name=`echo $name | sed -e "s|^[^/]*$||"`;
1503 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1508 for file in $create; do
1517 dir=`expr X$file : 'X\(.*\)/'`
1518 file=`expr X$file : 'X.*/\(.*\)'`
1519 (cd $dir && . ./$file)
1529 dir=`expr X$file : 'X\(.*\)/'`
1530 file=`expr X$file : 'X.*/\(.*\)'`
1531 (set x $dir; shift; eval $mkdir_p)
1541 if test -f $src/config_h.SH; then
1542 if test ! -f config.h; then
1543 : oops, they left it out of MANIFEST, probably, so do it anyway.
1549 : extract files and exit if asked to do so
1550 case "$extractsh" in
1552 case "$realsilent" in
1556 case "$config_sh" in
1557 '') config_sh='config.sh';;
1560 echo "Fetching answers from $config_sh..."
1563 test "$override" && . ./optdef.sh
1572 : Eunice requires " " instead of "", can you believe it
1575 echo "Beginning of configuration questions for $package."
1577 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1579 : first determine how to suppress newline on echo command
1581 echo "Checking echo to see how to suppress newlines..."
1582 (echo "hi there\c" ; echo " ") >.echotmp
1583 if $contains c .echotmp >/dev/null 2>&1 ; then
1594 echo $n "The star should be here-->$c"
1598 : Now test for existence of everything in MANIFEST
1600 if test -f $rsrc/MANIFEST; then
1601 echo "First let's make sure your kit is complete. Checking..." >&4
1602 awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
1605 for filelist in x??; do
1606 (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
1608 if test -s missing; then
1612 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1614 You have the option of continuing the configuration process, despite the
1615 distinct possibility that your kit is damaged, by typing 'y'es. If you
1616 do, don't blame me if something goes wrong. I advise you to type 'n'o
1617 and contact the author (perlbug@perl.org).
1620 echo $n "Continue? [n] $c" >&4
1624 echo "Continuing..." >&4
1628 echo "ABORTING..." >&4
1633 echo "Looks good..."
1636 echo "There is no MANIFEST file. I hope your kit is complete !"
1641 : Find the appropriate value for a newline for tr
1642 if test -n "$DJGPP"; then
1645 if test X"$trnl" = X; then
1646 case "`echo foo|tr '\n' x 2>/dev/null`" in
1650 if test X"$trnl" = X; then
1651 case "`echo foo|tr '\012' x 2>/dev/null`" in
1652 foox) trnl='\012' ;;
1655 if test X"$trnl" = X; then
1658 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1664 : compute the number of columns on the terminal for proper question formatting
1669 : set up the echo used in my read
1670 myecho="case \"\$xxxm\" in
1671 '') echo $n \"\$rp $c\" >&4;;
1673 '') echo $n \"[\$xxxm] $c\";;
1675 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1677 echo $n \"[\$xxxm] $c\" >&4
1679 echo $n \"\$rp [\$xxxm] $c\" >&4
1685 : now set up to do reads with possible shell escape and default assignment
1691 case "\$fastread" in
1692 yes) case "\$dflt" in
1695 case "\$silent-\$rp" in
1700 *) case "\$silent" in
1701 true) case "\$rp" in
1706 while expr "X\$ans" : "X!" >/dev/null; do
1710 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1718 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1727 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1732 echo "(OK, I'll run with -d after this question.)" >&4
1735 echo "*** Sorry, \$1 not supported yet." >&4
1745 echo "*** Substitution done -- please confirm."
1747 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1752 echo "*** Error -- try again."
1759 case "\$ans\$xxxm\$nostick" in
1771 : create .config dir to save info across Configure sessions
1772 test -d ../.config || mkdir ../.config
1773 cat >../.config/README <<EOF
1774 This directory created by Configure to save information that should
1775 persist across sessions for $package.
1777 You may safely delete it if you wish.
1780 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
1782 $define|true|[yY]*) ;;
1783 *) case "$xversion" in
1786 *** WHOA THERE!!! ***
1788 This is an UNSTABLE DEVELOPMENT release.
1789 The version of this $package distribution is $xversion, that is, odd,
1790 (as opposed to even) and that signifies a development release.
1791 If you want a maintenance release, you want an even-numbered version.
1793 Do ***NOT*** install this into production use.
1794 Data corruption and crashes are possible.
1796 It is most seriously suggested that you do not continue any further
1797 unless you want to help in developing and debugging Perl.
1800 rp='Do you really want to continue?'
1804 [yY]) echo >&4 "Okay, continuing." ;;
1805 *) echo >&4 "Okay, bye."
1814 : general instructions
1817 user=`(logname) 2>/dev/null`
1819 '') user=`whoami 2>&1`;;
1821 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1824 rp='Would you like to see the instructions?'
1835 This installation shell script will examine your system and ask you questions
1836 to determine how the perl5 package should be installed. If you get
1837 stuck on a question, you may use a ! shell escape to start a subshell or
1838 execute a command. Many of the questions will have default answers in square
1839 brackets; typing carriage return will give you the default.
1841 On some of the questions which ask for file or directory names you are allowed
1842 to use the ~name construct to specify the login directory belonging to "name",
1843 even if you don't have a shell which knows about that. Questions where this is
1844 allowed will be marked "(~name ok)".
1848 dflt='Type carriage return to continue'
1852 The prompter used in this script allows you to use shell variables and
1853 backticks in your answers. You may use $1, $2, etc... to refer to the words
1854 in the default answer, as if the default line was a set of arguments given to a
1855 script shell. This means you may also use $* to repeat the whole default line,
1856 so you do not have to re-type everything to add something to the default.
1858 Everytime there is a substitution, you will have to confirm. If there is an
1859 error (e.g. an unmatched backtick), the default answer will remain unchanged
1860 and you will be prompted again.
1862 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1863 the questions and use the computed defaults (or the previous answers if there
1864 was already a config.sh file). Type 'Configure -h' for a list of options.
1865 You may also start interactively and then answer '& -d' at any prompt to turn
1866 on the non-interactive behaviour for the remainder of the execution.
1872 Much effort has been expended to ensure that this shell script will run on any
1873 Unix system. If despite that it blows up on yours, your best bet is to edit
1874 Configure and run it again. If you can't run Configure for some reason,
1875 you'll have to generate a config.sh file by hand. Whatever problems you
1876 have, let me (perlbug@perl.org) know how I blew it.
1878 This installation script affects things in two ways:
1880 1) it may do direct variable substitutions on some of the files included
1882 2) it builds a config.h file for inclusion in C programs. You may edit
1883 any of these files as the need arises after running this script.
1885 If you make a mistake on a question, there is no easy way to back up to it
1886 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1887 files. Configure will offer to let you do this before it runs the SH files.
1890 dflt='Type carriage return to continue'
1892 case "$firsttime" in
1893 true) echo $user >>../.config/instruct;;
1897 : find out where common programs are
1899 echo "Locating common programs..." >&4
1912 if test -d \$dir/\$thing; then
1918 for thisthing in \$dir/\$thing; do
1919 : just loop through to pick last item
1921 if test -f \$thisthing; then
1924 elif test -f \$dir/\$thing.exe; then
1925 if test -n "$DJGPP"; then
1926 echo \$dir/\$thing.exe
1928 : on Eunice apparently
1978 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1979 pth="$pth /lib /usr/lib"
1980 for file in $loclist; do
1984 if test -f "$xxx"; then
1987 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1988 xxx=`./loc $file $file $pth`
1991 '') xxx=`./loc $file $file $pth`;;
1992 *) xxx=`./loc $xxx $xxx $pth`;;
1998 echo $file is in $xxx.
2001 echo $file is in $xxx.
2004 echo "I don't know where '$file' is, and my life depends on it." >&4
2005 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2011 echo "Don't worry if any of the following aren't found..."
2013 for file in $trylist; do
2017 if test -f "$xxx"; then
2020 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2021 xxx=`./loc $file $file $pth`
2024 '') xxx=`./loc $file $file $pth`;;
2025 *) xxx=`./loc $xxx $xxx $pth`;;
2031 echo $file is in $xxx.
2034 echo $file is in $xxx.
2037 echo "I don't see $file out there, $say."
2044 echo "Substituting grep for egrep."
2050 echo "Substituting cp for ln."
2056 echo "Hopefully test is built into your sh."
2059 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2060 echo "Using the test built into your sh."
2068 echo "Hopefully echo is built into your sh."
2073 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2074 $echo $n "hi there$c" >foo1
2075 echo $n "hi there$c" >foo2
2076 if cmp foo1 foo2 >/dev/null 2>&1; then
2077 echo "They are compatible. In fact, they may be identical."
2084 They are not compatible! You are probably running ksh on a non-USG system.
2085 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2086 have echo built in and we may have to run some Bourne shell scripts. That
2087 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2090 $echo $n "The star should be here-->$c"
2100 cat <<'EOSC' >>checkcc
2105 int main(int argc, char *argv[]) {
2109 if $cc -o try $ccflags try.c; then
2112 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2118 case "`$cc -v -c try.c 2>&1`" in
2121 if $test X"$trygcc" = Xyes; then
2122 if gcc -o try -c try.c; then
2124 echo "You seem to have a working gcc, though." >&4
2125 rp="Would you like to use it?"
2127 if $test -f myread; then
2130 if $test -f UU/myread; then
2133 echo "Cannot find myread, sorry. Aborting." >&2
2138 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no ;;
2142 if $test X"$despair" = Xyes; then
2144 You need to find a working C compiler.
2145 Either (purchase and) install the C compiler supplied by your OS vendor,
2146 or for a free C compiler try http://gcc.gnu.org/
2147 I cannot continue any further, aborting.
2157 : determine whether symbolic links are supported
2160 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2161 echo "Symbolic links are supported." >&4
2164 echo "Symbolic links are NOT supported." >&4
2169 : see whether [:lower:] and [:upper:] are supported character classes
2171 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2173 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2177 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
2178 # (0xc9 and 0xd1), therefore that is a nice testing point.
2179 if test "X$up" = X -o "X$low" = X; then
2180 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
2186 if test "X$up" = X -o "X$low" = X; then
2187 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
2193 if test "X$up" = X -o "X$low" = X; then
2194 case "`echo IJ | od -x 2>/dev/null`" in
2196 echo "Hey, this might be EBCDIC." >&4
2197 if test "X$up" = X -o "X$low" = X; then
2198 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2199 ij) up='[A-IJ-RS-Z]'
2204 if test "X$up" = X -o "X$low" = X; then
2205 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2215 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
2217 echo "Using $up and $low to convert case." >&4
2220 echo "I don't know how to translate letters from upper to lower case." >&4
2221 echo "Your tr is not acting any way I know of." >&4
2225 : set up the translation script tr, must be called with ./tr of course
2229 '[A-Z][a-z]') exec $tr '$up' '$low';;
2230 '[a-z][A-Z]') exec $tr '$low' '$up';;
2237 : Try to determine whether config.sh was made on this system
2238 case "$config_sh" in
2240 myuname=`$uname -a 2>/dev/null`
2241 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2242 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2243 # because the A-Z/a-z are not consecutive.
2244 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2245 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2246 newmyuname="$myuname"
2248 case "$knowitall" in
2250 if test -f ../config.sh; then
2251 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2252 eval "`grep myuname= ../config.sh`"
2254 if test "X$myuname" = "X$newmyuname"; then
2262 : Get old answers from old config file if Configure was run on the
2263 : same system, otherwise use the hints.
2266 if test -f config.sh; then
2268 rp="I see a config.sh file. Shall I use it to set the defaults?"
2271 n*|N*) echo "OK, I'll ignore it."
2272 mv config.sh config.sh.old
2273 myuname="$newmyuname"
2275 *) echo "Fetching default answers from your old config.sh file..." >&4
2283 : Older versions did not always set $sh. Catch re-use of such
2293 if test ! -f config.sh; then
2296 First time through, eh? I have some defaults handy for some systems
2297 that need some extra help getting the Configure answers right:
2300 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2302 : Half the following guesses are probably wrong... If you have better
2303 : tests or hints, please send them to perlbug@perl.org
2304 : The metaconfig authors would also appreciate a copy...
2305 $test -f /irix && osname=irix
2306 $test -f /xenix && osname=sco_xenix
2307 $test -f /dynix && osname=dynix
2308 $test -f /dnix && osname=dnix
2309 $test -f /lynx.os && osname=lynxos
2310 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2311 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
2312 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2313 $test -f /bin/mips && /bin/mips && osname=mips
2314 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
2315 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
2316 $test -d /usr/apollo/bin && osname=apollo
2317 $test -f /etc/saf/_sactab && osname=svr4
2318 $test -d /usr/include/minix && osname=minix
2319 if $test -d /MachTen -o -d /MachTen_Folder; then
2321 if $test -x /sbin/version; then
2322 osvers=`/sbin/version | $awk '{print $2}' |
2323 $sed -e 's/[A-Za-z]$//'`
2324 elif $test -x /usr/etc/version; then
2325 osvers=`/usr/etc/version | $awk '{print $2}' |
2326 $sed -e 's/[A-Za-z]$//'`
2332 $test -f /sys/posix.dll &&
2333 $test -f /usr/bin/what &&
2334 set X `/usr/bin/what /sys/posix.dll` &&
2335 $test "$3" = UWIN &&
2339 if $test -f $uname; then
2347 umips) osname=umips ;;
2350 [23]100) osname=mips ;;
2351 next*) osname=next ;;
2353 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
2354 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
2357 elif $test -f /etc/kconfig; then
2359 if test "$lns" = "$ln -s"; then
2361 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
2363 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
2370 if test -n "$DJGPP"; then
2379 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
2381 'not found') osvers="$4"."$3" ;;
2382 '<3240'|'<>3240') osvers=3.2.0 ;;
2383 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
2384 '=3250'|'>3250') osvers=3.2.5 ;;
2388 bsd386) osname=bsd386
2391 cygwin*) osname=cygwin
2394 *dc.osx) osname=dcosx
2400 domainos) osname=apollo
2406 dynixptx*) osname=dynixptx
2407 osvers=`echo "$4"|sed 's/^v//'`
2409 freebsd) osname=freebsd
2411 genix) osname=genix ;;
2413 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
2429 netbsd*) osname=netbsd
2432 news-os) osvers="$3"
2434 4*) osname=newsos4 ;;
2438 next*) osname=next ;;
2439 nonstop-ux) osname=nonstopux ;;
2440 POSIX-BC | posix-bc ) osname=posix-bc
2443 powerux | power_ux | powermax_os | powermaxos | \
2444 powerunix | power_unix) osname=powerux
2450 solaris) osname=solaris
2452 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2459 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2463 titanos) osname=titanos
2472 ultrix) osname=ultrix
2475 osf1|mls+) case "$5" in
2478 osvers=`sizer -v | awk '{print $3}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
2481 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
2484 hp*) osname=hp_osf1 ;;
2485 mips) osname=mips_osf1 ;;
2488 unixware) osname=svr5
2494 $2) case "$osname" in
2498 : svr4.x or possibly later
2508 if test -f /stand/boot ; then
2509 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
2510 if test -n "$INITPROG" -a -f "$INITPROG"; then
2511 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
2512 if test -n "$isesix"; then
2520 *) if test -f /etc/systemid; then
2522 set `echo $3 | $sed 's/\./ /g'` $4
2523 if $test -f $src/hints/sco_$1_$2_$3.sh; then
2525 elif $test -f $src/hints/sco_$1_$2.sh; then
2527 elif $test -f $src/hints/sco_$1.sh; then
2532 '') : Still unknown. Probably a generic Sys V.
2541 *) case "$osname" in
2542 '') : Still unknown. Probably a generic BSD.
2550 if test -f /vmunix -a -f $src/hints/news_os.sh; then
2551 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
2552 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
2555 $rm -f UU/kernel.what
2556 elif test -d c:/.; then
2563 : Now look for a hint file osname_osvers, unless one has been
2564 : specified already.
2567 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
2568 : Also try without trailing minor version numbers.
2569 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
2570 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
2571 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
2572 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
2575 *) case "$osvers" in
2578 *) if $test -f $src/hints/$file.sh ; then
2580 elif $test -f $src/hints/$xfile.sh ; then
2582 elif $test -f $src/hints/$xxfile.sh ; then
2584 elif $test -f $src/hints/$xxxfile.sh ; then
2586 elif $test -f $src/hints/$xxxxfile.sh ; then
2588 elif $test -f "$src/hints/${osname}.sh" ; then
2597 if $test -f Policy.sh ; then
2600 none) dflt="Policy" ;;
2601 *) dflt="Policy $dflt" ;;
2606 dflt=`echo $hintfile | $sed 's/\.sh$//'`
2610 if $test -f Policy.sh ; then
2613 There's also a Policy hint file available, which should make the
2614 site-specific (policy) questions easier to answer.
2621 You may give one or more space-separated answers, or "none" if appropriate.
2622 A well-behaved OS will have no hints, so answering "none" or just "Policy"
2623 is a good thing. DO NOT give a wrong version or a wrong OS.
2627 rp="Which of these apply, if any?"
2630 for file in $tans; do
2631 if $test X$file = XPolicy -a -f Policy.sh; then
2633 $cat Policy.sh >> UU/config.sh
2634 elif $test -f $src/hints/$file.sh; then
2635 . $src/hints/$file.sh
2636 $cat $src/hints/$file.sh >> UU/config.sh
2637 elif $test X$tans = X -o X$tans = Xnone ; then
2640 : Give one chance to correct a possible typo.
2641 echo "$file.sh does not exist"
2643 rp="hint to use instead?"
2645 for file in $ans; do
2646 if $test -f "$src/hints/$file.sh"; then
2647 . $src/hints/$file.sh
2648 $cat $src/hints/$file.sh >> UU/config.sh
2649 elif $test X$ans = X -o X$ans = Xnone ; then
2652 echo "$file.sh does not exist -- ignored."
2659 : Remember our hint file for later.
2660 if $test -f "$src/hints/$file.sh" ; then
2670 echo "Fetching default answers from $config_sh..." >&4
2674 cp $config_sh config.sh 2>/dev/null
2684 test "$override" && . ./optdef.sh
2686 : Restore computed paths
2687 for file in $loclist $trylist; do
2688 eval $file="\$_$file"
2693 Configure uses the operating system name and version to set some defaults.
2694 The default value is probably right if the name rings a bell. Otherwise,
2695 since spelling matters for me, either accept the default or answer "none"
2702 ''|' '|none) dflt=none ;;
2703 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
2706 *) dflt="$osname" ;;
2708 rp="Operating system name?"
2712 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
2718 ''|' '|none) dflt=none ;;
2719 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
2720 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
2722 ''|' ') dflt=none ;;
2727 *) dflt="$osvers" ;;
2729 rp="Operating system version?"
2739 : who configured the system
2740 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
2741 cf_by=`(logname) 2>/dev/null`
2744 cf_by=`(whoami) 2>/dev/null`
2746 "") cf_by=unknown ;;
2750 : set up the script used to warn in case of inconsistency
2757 echo "*** WHOA THERE!!! ***" >&4
2758 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2759 rp=" Keep the $hint value?"
2762 y) td=$was; tu=$was;;
2766 : function used to set $1 to $val
2767 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2769 $define$undef) . ./whoa; eval "$var=\$td";;
2770 $undef$define) . ./whoa; eval "$var=\$tu";;
2771 *) eval "$var=$val";;
2774 case "$usethreads" in
2775 $define|true|[yY]*) dflt='y';;
2780 Perl can be built to take advantage of threads on some systems.
2781 To do so, Configure can be run with -Dusethreads.
2783 Note that threading is a highly experimental feature, and
2784 some known race conditions still remain. If you choose to try
2785 it, be very sure to not actually deploy it for production
2786 purposes. README.threads has more details, and is required
2787 reading if you enable threads.
2789 If this doesn't make any sense to you, just accept the default '$dflt'.
2791 rp='Build a threading Perl?'
2794 y|Y) val="$define" ;;
2800 case "$usethreads" in
2804 As of 5.5.640, Perl has two different internal threading implementations,
2805 the 5.005 version (5005threads) and an interpreter-based version
2806 (ithreads) that has one interpreter per thread. Both are very
2807 experimental. This arrangement exists to help developers work out
2808 which one is better.
2810 If you're a casual user, you probably don't want interpreter-threads
2811 at this time. There doesn't yet exist a way to create threads from
2812 within Perl in this model, i.e., "use Thread;" will NOT work.
2814 : Default to ithreads unless overridden on command line or with
2817 case "$use5005threads" in
2818 $define|true|[yY]*) dflt='n';;
2820 case "$useithreads" in
2821 $undef|false|[nN]*) dflt='n';;
2823 rp='Use interpreter-based ithreads?'
2826 y|Y) val="$define" ;;
2831 : Now set use5005threads to the opposite value.
2832 case "$useithreads" in
2833 $define) val="$undef" ;;
2840 useithreads="$undef"
2841 use5005threads="$undef"
2845 case "$d_oldpthreads" in
2846 '') : Configure tests would be welcome here. For now, assume undef.
2848 *) val="$d_oldpthreads" ;;
2854 case "$usethreads" in
2855 "$define"|true|[yY]*)
2856 : Look for a hint-file generated 'call-back-unit'. If the
2857 : user has specified that a threading perl is to be built,
2858 : we may need to set or change some other defaults.
2859 if $test -f usethreads.cbu; then
2860 echo "Your platform has some specific hints for threaded builds, using them..."
2864 (Your platform doesn't have any specific hints for threaded builds.
2865 Assuming POSIX threads, then.)
2873 Perl can be built so that multiple Perl interpreters can coexist
2874 within the same Perl executable.
2877 case "$useithreads" in
2880 This multiple interpreter support is required for interpreter-based threads.
2884 *) case "$usemultiplicity" in
2885 $define|true|[yY]*) dflt='y';;
2889 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
2890 rp='Build Perl for multiplicity?'
2893 y|Y) val="$define" ;;
2901 : make some quick guesses about what we are up against
2903 $echo $n "Hmm... $c"
2913 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
2914 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
2916 echo "Looks kind of like an OSF/1 system, but we'll see..."
2918 elif test `echo abc | $tr a-z A-Z` = Abc ; then
2919 xxx=`./loc addbib blurfl $pth`
2920 if $test -f $xxx; then
2921 echo "Looks kind of like a USG system with BSD features, but we'll see..."
2925 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
2926 echo "Looks kind of like an extended USG system, but we'll see..."
2928 echo "Looks kind of like a USG system, but we'll see..."
2932 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
2933 echo "Looks kind of like a BSD system, but we'll see..."
2937 echo "Looks kind of like a Version 7 system, but we'll see..."
2940 case "$eunicefix" in
2943 There is, however, a strange, musty smell in the air that reminds me of
2944 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
2948 : it so happens the Eunice I know will not run shell scripts in Unix format
2952 echo "Congratulations. You aren't running Eunice."
2956 : Detect OS2. The p_ variable is set above in the Head.U unit.
2957 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
2958 : semicolon as a patch separator
2963 I have the feeling something is not exactly right, however...don't tell me...
2964 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
2965 (Or you may be running DOS with DJGPP.)
2970 if test -f /xenix; then
2971 echo "Actually, this looks more like a XENIX system..."
2976 echo "It's not Xenix..."
2981 if test -f /venix; then
2982 echo "Actually, this looks more like a VENIX system..."
2989 echo "Nor is it Venix..."
2992 chmod +x bsd usg v7 osf1 eunice xenix venix os2
2993 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3000 rp="Use which C compiler?"
3003 : Look for a hint-file generated 'call-back-unit'. Now that the
3004 : user has specified the compiler, we may need to set or change some
3006 if $test -f cc.cbu; then
3012 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3013 $cat >gccvers.c <<EOM
3018 printf("%s\n", __VERSION__);
3020 printf("%s\n", "1");
3026 if $cc -o gccvers $ldflags gccvers.c; then
3027 gccversion=`./gccvers`
3028 case "$gccversion" in
3029 '') echo "You are not using GNU cc." ;;
3030 *) echo "You are using GNU cc $gccversion."
3036 echo "*** WHOA THERE!!! ***" >&4
3037 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3038 case "$knowitall" in
3040 echo " You'd better start hunting for one and let me know about it." >&4
3046 case "$gccversion" in
3047 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3049 case "$gccversion" in
3050 '') gccosandvers='' ;;
3051 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
3052 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
3054 case "$gccosandvers" in
3055 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
3056 $osname$osvers) ;; # looking good
3057 $osname*) cat <<EOM >&4
3059 *** WHOA THERE!!! ***
3061 Your gcc has not been compiled for the exact release of
3062 your operating system ($gccosandvers versus $osname$osvers).
3064 In general it is a good idea to keep gcc synchronized with
3065 the operating system because otherwise serious problems
3066 may ensue when trying to compile software, like Perl.
3068 I'm trying to be optimistic here, though, and will continue.
3069 If later during the configuration and build icky compilation
3070 problems appear (headerfile conflicts being the most common
3071 manifestation), I suggest reinstalling the gcc to match
3072 your operating system release.
3076 *) gccosandvers='' ;; # failed to parse, better be silent
3084 : see how we invoke the C preprocessor
3086 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3087 cat <<'EOT' >testcpp.c
3093 if test ! -f cppstdin; then
3094 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
3095 # AIX cc -E doesn't show the absolute headerfile
3096 # locations but we'll cheat by using the -M flag.
3097 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
3099 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3102 echo "Keeping your $hint cppstdin wrapper."
3105 wrapper=`pwd`/cppstdin
3109 if $test "X$cppstdin" != "X" && \
3110 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3111 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3113 echo "You used to use $cppstdin $cppminus so we'll use that again."
3115 '') echo "But let's see if we can live without a wrapper..." ;;
3117 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3118 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3120 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3123 echo "(However, $cpprun $cpplast does not work, let's see...)"
3131 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3138 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3139 $cc -E <testcpp.c >testcpp.out 2>&1; \
3140 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3141 echo "Yup, it does."
3144 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
3145 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3146 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3147 echo "Yup, it does."
3150 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
3151 $cc -P <testcpp.c >testcpp.out 2>&1; \
3152 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3153 echo "Yipee, that works!"
3156 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
3157 $cc -P - <testcpp.c >testcpp.out 2>&1; \
3158 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3159 echo "At long last!"
3162 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
3163 $cpp <testcpp.c >testcpp.out 2>&1; \
3164 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3168 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
3169 $cpp - <testcpp.c >testcpp.out 2>&1; \
3170 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3171 echo "Hooray, it works! I was beginning to wonder."
3174 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
3175 $wrapper <testcpp.c >testcpp.out 2>&1; \
3176 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3182 rp="No dice. I can't find a C preprocessor. Name one:"
3186 $x_cpp <testcpp.c >testcpp.out 2>&1
3187 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3188 echo "OK, that will do." >&4
3190 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
3205 echo "Perhaps can we force $cc -E using a wrapper..."
3206 if $wrapper <testcpp.c >testcpp.out 2>&1; \
3207 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3213 echo "Nope, we'll have to live without it..."
3227 "$wrapper"|'cppstdin') ;;
3228 *) $rm -f $wrapper;;
3230 $rm -f testcpp.c testcpp.out
3232 : decide how portable to be. Allow command line overrides.
3233 case "$d_portable" in
3235 *) d_portable="$define" ;;
3238 : set up shell script to do ~ expansion
3244 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3247 if $test -f /bin/csh; then
3248 /bin/csh -f -c "glob \$1"
3253 name=\`$expr x\$1 : '..\([^/]*\)'\`
3254 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3255 if $test ! -d "\$dir"; then
3257 echo "\$me: can't locate home directory for: \$name" >&2
3262 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3278 : now set up to get a file name
3282 cat <<'EOSC' >>getfile
3298 expr $fn : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3299 fn=`echo $fn | sed 's/(.*)//'`
3305 loc_file=`expr $fn : '.*:\(.*\)'`
3306 fn=`expr $fn : '\(.*\):.*'`
3314 */*) fullpath=true;;
3323 *e*) exp_file=true;;
3326 *p*) nopath_ok=true;;
3331 *d*) type='Directory';;
3332 *l*) type='Locate';;
3337 Locate) what='File';;
3342 case "$d_portable" in
3350 while test "$type"; do
3355 true) rp="$rp (~name ok)";;
3358 if test -f UU/getfile.ok && \
3359 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3378 value=`UU/filexp $ans`
3381 if test "$ans" != "$value"; then
3382 echo "(That expands to $value on this system.)"
3396 /*) value="$ansexp" ;;
3397 [a-zA-Z]:/*) value="$ansexp" ;;
3402 echo "I shall only accept a full path name, as in /bin/ls." >&4
3403 echo "Use a ! shell escape if you wish to check pathnames." >&4
3406 echo "Please give a full path name, starting with slash." >&4
3409 echo "Note that using ~name is ok provided it expands well." >&4
3422 for fp in $gfpth; do
3423 if test "X$fp" = X.; then
3428 if test -f "$pf"; then
3430 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3432 echo "($value is not a plain file, but that's ok.)"
3435 if test X"$type" = X; then
3442 for fp in $gfpth; do
3443 if test "X$fp" = X.; then
3448 direxp="$fp/$ansexp"
3450 if test -d "$direxp"; then
3458 if test -d "$ansexp"; then
3459 echo "(Looking for $loc_file in directory $value.)"
3460 value="$value/$loc_file"
3461 ansexp="$ansexp/$loc_file"
3463 if test -f "$ansexp"; then
3466 case "$nopath_ok" in
3467 true) case "$value" in
3469 *) echo "Assuming $value will be in people's path."
3485 if test "$fastread" = yes; then
3490 rp="$what $value doesn't exist. Use that name anyway?"
3509 test "X$gfpthkeep" != Xy && gfpth=""
3512 : What should the include directory be ?
3514 $echo $n "Hmm... $c"
3518 if $test -f /bin/mips && /bin/mips; then
3519 echo "Looks like a MIPS system..."
3520 $cat >usr.c <<'EOCP'
3521 #ifdef SYSTYPE_BSD43
3525 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3526 dflt='/bsd43/usr/include'
3530 mips_type='System V'
3532 $rm -f usr.c usr.out
3533 echo "and you're compiling with the $mips_type compiler and libraries."
3537 echo "Doesn't look like a MIPS system."
3547 case "$xxx_prompt" in
3550 rp='Where are the include files you want to use?'
3558 : Set private lib path
3561 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
3566 '') dlist="$loclibpth $plibpth $glibpth";;
3567 *) dlist="$libpth";;
3570 : Now check and see which directories actually exist, avoiding duplicates
3574 if $test -d $xxx; then
3577 *) libpth="$libpth $xxx";;
3583 Some systems have incompatible or broken versions of libraries. Among
3584 the directories listed in the question below, please remove any you
3585 know not to be holding relevant libraries, and add any that are needed.
3586 Say "none" for none.
3597 rp="Directories to use for library searches?"
3604 : compute shared library extension
3607 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
3617 On some systems, shared libraries may be available. Answer 'none' if
3618 you want to suppress searching of shared libraries for the remainder
3619 of this configuration.
3622 rp='What is the file extension used for shared libraries?'
3626 : Define several unixisms.
3627 : Hints files or command line option can be used to override them.
3628 : The convoluted testing is in case hints files set either the old
3631 '') case "$exe_ext" in
3633 *) _exe="$exe_ext" ;;
3638 '') case "$lib_ext" in
3645 '') case "$obj_ext" in
3652 '') case "$path_sep" in
3663 : Which makefile gets called first. This is used by make depend.
3664 case "$firstmakefile" in
3665 '') firstmakefile='makefile';;
3669 $define|true|[yY]*) dflt='y';;
3674 Perl can be built to use the SOCKS proxy protocol library. To do so,
3675 Configure must be run with -Dusesocks.
3677 If this doesn't make any sense to you, just accept the default '$dflt'.
3679 rp='Build Perl for SOCKS?'
3682 y|Y) val="$define" ;;
3688 : Looking for optional libraries
3690 echo "Checking for optional libraries..." >&4
3695 case "$libswanted" in
3696 '') libswanted='c_s';;
3699 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
3705 for thisdir in $libpth $xlibpth; do
3706 test -d $thisdir && libspath="$libspath $thisdir"
3708 for thislib in $libswanted; do
3709 for thisdir in $libspath; do
3711 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
3712 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|tail -1`
3713 $test -f "$xxx" && eval $libscheck
3714 $test -f "$xxx" && libstyle=shared
3716 if test ! -f "$xxx"; then
3717 xxx=$thisdir/lib$thislib.$so
3718 $test -f "$xxx" && eval $libscheck
3719 $test -f "$xxx" && libstyle=shared
3721 if test ! -f "$xxx"; then
3722 xxx=$thisdir/lib$thislib$_a
3723 $test -f "$xxx" && eval $libscheck
3724 $test -f "$xxx" && libstyle=static
3726 if test ! -f "$xxx"; then
3727 xxx=$thisdir/$thislib$_a
3728 $test -f "$xxx" && eval $libscheck
3729 $test -f "$xxx" && libstyle=static
3731 if test ! -f "$xxx"; then
3732 xxx=$thisdir/lib${thislib}_s$_a
3733 $test -f "$xxx" && eval $libscheck
3734 $test -f "$xxx" && libstyle=static
3735 $test -f "$xxx" && thislib=${thislib}_s
3737 if test ! -f "$xxx"; then
3738 xxx=$thisdir/Slib$thislib$_a
3739 $test -f "$xxx" && eval $libscheck
3740 $test -f "$xxx" && libstyle=static
3742 if $test -f "$xxx"; then
3744 shared) echo "Found -l$thislib (shared)." ;;
3745 static) echo "Found -l$thislib." ;;
3746 *) echo "Found -l$thislib ($libstyle)." ;;
3750 *) dflt="$dflt -l$thislib"
3751 libsfound="$libsfound $xxx"
3753 libsfiles="$libsfiles $yyy"
3754 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
3755 case " $libsdirs " in
3757 *) libsdirs="$libsdirs $yyy" ;;
3764 if $test ! -f "$xxx"; then
3765 echo "No -l$thislib."
3776 ' '|'') dflt='none';;
3781 In order to compile $package on your machine, a number of libraries
3782 are usually needed. Include any other special libraries here as well.
3783 Say "none" for none. The default list is almost always right.
3787 rp="What libraries to use?"
3794 : determine optimization, if desired, or use for debug flag also
3796 ' '|$undef) dflt='none';;
3798 *) dflt="$optimize";;
3802 By default, $package compiles with the -O flag to use the optimizer.
3803 Alternately, you might want to use the symbolic debugger, which uses
3804 the -g flag (on traditional Unix systems). Either flag can be
3805 specified here. To use neither flag, specify the word "none".
3808 rp="What optimizer/debugger flag should be used?"
3812 'none') optimize=" ";;
3816 : We will not override a previous value, but we might want to
3817 : augment a hint file
3819 default|recommended)
3820 case "$gccversion" in
3821 1*) dflt='-fpcc-struct-return' ;;
3824 *-g*) dflt="$dflt -DDEBUGGING";;
3826 case "$gccversion" in
3827 2*) if test -d /etc/conf/kconfig.d &&
3828 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
3834 case "$gccversion" in
3838 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
3839 echo 'int main(void) { return 0; }' > gcctest.c
3840 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
3841 echo "Yes, it does." 2>&1
3844 echo "Leaving current flags $ccflags alone." 2>&1
3846 *) dflt="$dflt -fno-strict-aliasing" ;;
3849 echo "Nope, it doesn't, but that's ok." 2>&1
3856 case "$mips_type" in
3857 *BSD*|'') inclwanted="$locincpth $usrinc";;
3858 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
3860 for thisincl in $inclwanted; do
3861 if $test -d $thisincl; then
3862 if $test x$thisincl != x$usrinc; then
3864 *" -I$thisincl "*);;
3865 *) dflt="$dflt -I$thisincl ";;
3871 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
3873 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
3881 *) dflt="$dflt -D$2";;
3885 set signal.h LANGUAGE_C; eval $inctest
3889 ccflags="$ccflags -DSOCKS"
3894 default|recommended) dflt="$ccflags $dflt" ;;
3895 *) dflt="$ccflags";;
3904 Your C compiler may want other flags. For this question you should include
3905 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
3906 but you should NOT include libraries or ld flags like -lwhatever. If you
3907 want $package to honor its debug switch, you should include -DDEBUGGING here.
3908 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
3910 To use no flags, specify the word "none".
3916 rp="Any additional cc flags?"
3923 : the following weeds options from ccflags that are of no interest to cpp
3925 case "$gccversion" in
3926 1*) cppflags="$cppflags -D__GNUC__"
3928 case "$mips_type" in
3930 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
3936 echo "Let me guess what the preprocessor flags are..." >&4
3950 *) ftry="$previous $flag";;
3952 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
3953 >cpp1.out 2>/dev/null && \
3954 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
3955 >cpp2.out 2>/dev/null && \
3956 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
3957 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
3959 cppflags="$cppflags $ftry"
3969 *-*) echo "They appear to be: $cppflags";;
3971 $rm -f cpp.c cpp?.out
3975 : flags used in final linking phase
3977 '') if ./venix; then
3983 *-posix*) dflt="$dflt -posix" ;;
3986 *) dflt="$ldflags";;
3989 : Try to guess additional flags to pick up local libraries.
3990 for thislibdir in $libpth; do
3991 case " $loclibpth " in
3994 *"-L$thislibdir "*) ;;
3995 *) dflt="$dflt -L$thislibdir" ;;
4007 Your C linker may need flags. For this question you should
4008 include -L/whatever and any other flags used by the C linker, but you
4009 should NOT include libraries like -lwhatever.
4011 Make sure you include the appropriate -L/path flags if your C linker
4012 does not normally search all of the directories you specified above,
4015 To use no flags, specify the word "none".
4019 rp="Any additional ld flags (NOT including libraries)?"
4025 rmlist="$rmlist pdp11"
4029 echo "Checking your choice of C compiler and flags for coherency..." >&4
4030 $cat > try.c <<'EOF'
4032 int main() { printf("Ok\n"); exit(0); }
4034 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
4036 $cat >try.msg <<'EOM'
4037 I've tried to compile and run the following simple program:
4040 $cat try.c >> try.msg
4042 $cat >> try.msg <<EOM
4049 and I got the following output:
4053 if sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
4054 if sh -c './try' >>try.msg 2>&1; then
4058 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4061 cat >> try.msg <<'EOQS'
4062 If $libs contains -lsfio, and sfio is mis-configured, then it
4063 sometimes (apparently) runs and exits with a 0 status, but with no
4064 output! It may have to do with sfio's use of _exit vs. exit.
4067 rp="You have a big problem. Shall I abort Configure"
4074 echo "The program compiled OK, but exited with status $?." >>try.msg
4075 rp="You have a problem. Shall I abort Configure"
4079 echo "I can't compile the test program." >>try.msg
4080 rp="You have a BIG problem. Shall I abort Configure"
4086 case "$knowitall" in
4088 echo "(The supplied flags or libraries might be incorrect.)"
4096 *) echo "Ok. Stopping Configure." >&4
4101 n) echo "OK, that should do.";;
4103 $rm -f try try.* core
4105 : define an is-a-typedef? function
4106 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
4108 "") inclist="sys/types.h";;
4110 eval "varval=\$$var";
4114 for inc in $inclist; do
4115 echo "#include <$inc>" >>temp.c;
4117 echo "#ifdef $type" >> temp.c;
4118 echo "printf(\"We have $type\");" >> temp.c;
4119 echo "#endif" >> temp.c;
4120 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
4121 if $contains $type temp.E >/dev/null 2>&1; then
4127 *) eval "$var=\$varval";;
4130 : define an is-a-typedef? function that prompts if the type is not available.
4131 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
4133 "") inclist="sys/types.h";;
4135 eval "varval=\$$var";
4139 for inc in $inclist; do
4140 echo "#include <$inc>" >>temp.c;
4142 echo "#ifdef $type" >> temp.c;
4143 echo "printf(\"We have $type\");" >> temp.c;
4144 echo "#endif" >> temp.c;
4145 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
4147 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
4148 if $contains $type temp.E >/dev/null 2>&1; then
4149 echo "$type found." >&4;
4152 echo "$type NOT found." >&4;
4158 *) eval "$var=\$varval";;
4161 : define a shorthand compile call
4165 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
4166 : define a shorthand compile call for compilations that should be ok.
4170 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
4172 : check for lengths of integral types
4176 echo "Checking to see how big your integers are..." >&4
4177 $cat >intsize.c <<'EOCP'
4181 printf("intsize=%d;\n", (int)sizeof(int));
4182 printf("longsize=%d;\n", (int)sizeof(long));
4183 printf("shortsize=%d;\n", (int)sizeof(short));
4188 if eval $compile_ok && ./intsize > /dev/null; then
4190 echo "Your integers are $intsize bytes long."
4191 echo "Your long integers are $longsize bytes long."
4192 echo "Your short integers are $shortsize bytes long."
4196 Help! I can't compile and run the intsize test program: please enlighten me!
4197 (This is probably a misconfiguration in your system or libraries, and
4198 you really ought to fix it. Still, I'll try anyway.)
4202 rp="What is the size of an integer (in bytes)?"
4206 rp="What is the size of a long integer (in bytes)?"
4210 rp="What is the size of a short integer (in bytes)?"
4216 $rm -f intsize intsize.*
4218 : see what type lseek is declared as in the kernel
4219 rp="What is the type used for lseek's offset on this system?"
4220 set off_t lseektype long stdio.h sys/types.h
4224 echo "Checking to see how big your file offsets are..." >&4
4226 #include <sys/types.h>
4230 printf("%d\n", (int)sizeof($lseektype));
4235 if eval $compile_ok; then
4237 echo "Your file offsets are $lseeksize bytes long."
4241 echo "(I can't seem to compile the test program. Guessing...)"
4242 rp="What is the size of your file offsets (in bytes)?"
4248 : see what type file positions are declared as in the library
4249 rp="What is the type for file position used by fsetpos()?"
4250 set fpos_t fpostype long stdio.h sys/types.h
4255 *_t) zzz="$fpostype" ;;
4258 echo "Checking the size of $zzz..." >&4
4260 #include <sys/types.h>
4263 printf("%d\n", (int)sizeof($fpostype));
4268 if eval $compile_ok; then
4272 echo "(I can't execute the test program--guessing $fpossize.)" >&4
4275 echo "Your $zzz is $fpossize bytes long."
4281 echo "(I can't compile the test program. Guessing...)" >&4
4282 rp="What is the size of your file positions (in bytes)?"
4289 # Backward compatibility (uselfs is deprecated).
4291 "$define"|true|[yY]*)
4294 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
4296 uselargefiles="$define"
4300 case "$lseeksize:$fpossize" in
4303 You can have files larger than 2 gigabytes.
4306 *) case "$uselargefiles" in
4307 "$undef"|false|[nN]*) dflt='n' ;;
4312 Perl can be built to understand large files (files larger than 2 gigabytes)
4313 on some systems. To do so, Configure can be run with -Duselargefiles.
4315 If this doesn't make any sense to you, just accept the default '$dflt'.
4317 rp='Try to understand large files, if available?'
4320 y|Y) val="$define" ;;
4327 case "$uselargefiles" in
4329 : Look for a hint-file generated 'call-back-unit'. If the
4330 : user has specified that a large files perl is to be built,
4331 : we may need to set or change some other defaults.
4332 if $test -f uselargefiles.cbu; then
4333 echo "Your platform has some specific hints for large file builds, using them..."
4334 . ./uselargefiles.cbu
4336 echo "Rechecking to see how big your file offsets are..." >&4
4338 #include <sys/types.h>
4342 printf("%d\n", (int)sizeof($lseektype));
4347 if eval $compile_ok; then
4349 $echo "Your file offsets are now $lseeksize bytes long."
4353 echo "(I can't seem to compile the test program. Guessing...)"
4354 rp="What is the size of your file offsets (in bytes)?"
4359 *_t) zzz="$fpostype" ;;
4362 $echo $n "Rechecking the size of $zzz...$c" >&4
4364 #include <sys/types.h>
4367 printf("%d\n", (int)sizeof($fpostype));
4372 if eval $compile_ok; then
4377 echo "(I can't execute the test program--guessing $fpossize.)" >&4
4380 echo " $fpossize bytes." >&4
4386 echo "(I can't compile the test program. Guessing...)" >&4
4387 rp="What is the size of your file positions (in bytes)?"
4397 case "$usemorebits" in
4398 "$define"|true|[yY]*)
4399 use64bitint="$define"
4400 uselongdouble="$define"
4401 usemorebits="$define"
4403 *) usemorebits="$undef"
4408 case "$uselonglong" in
4409 "$define"|true|[yY]*)
4412 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
4414 use64bitint="$define"
4417 case "$use64bits" in
4418 "$define"|true|[yY]*)
4421 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
4423 use64bitint="$define"
4426 case "$use64bitints" in
4427 "$define"|true|[yY]*)
4430 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
4432 use64bitint="$define"
4435 case "$use64bitsint" in
4436 "$define"|true|[yY]*)
4439 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
4441 use64bitint="$define"
4444 case "$uselonglongs" in
4445 "$define"|true|[yY]*)
4448 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
4450 use64bitint="$define"
4453 case "$use64bitsall" in
4454 "$define"|true|[yY]*)
4457 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
4459 use64bitall="$define"
4464 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
4466 case "$use64bitall" in
4467 "$define"|true|[yY]*) use64bitint="$define" ;;
4473 You have natively 64-bit long integers.
4477 *) case "$use64bitint" in
4478 "$define"|true|[yY]*) dflt='y';;
4483 Perl can be built to take advantage of 64-bit integer types
4484 on some systems. To do so, Configure can be run with -Duse64bitint.
4485 Choosing this option will most probably introduce binary incompatibilities.
4487 If this doesn't make any sense to you, just accept the default '$dflt'.
4489 rp='Try to use 64-bit integers, if available?'
4492 [yY]*) val="$define" ;;
4500 case "$use64bitall" in
4501 "$define"|true|[yY]*) dflt='y' ;;
4502 *) case "$longsize" in
4510 You may also choose to try maximal 64-bitness. It means using as much
4511 64-bitness as possible on the platform. This in turn means even more
4512 binary incompatibilities. On the other hand, your platform may not
4513 have any more 64-bitness available than what you already have chosen.
4515 If this doesn't make any sense to you, just accept the default '$dflt'.
4517 rp='Try to use maximal 64-bit support, if available?'
4520 [yY]*) val="$define" ;;
4525 case "$use64bitall" in
4527 case "$use64bitint" in
4531 Since you have chosen a maximally 64-bit build, I'm also turning on
4532 the use of 64-bit integers.
4534 use64bitint="$define" ;;
4539 case "$use64bitint" in
4540 "$define"|true|[yY]*)
4541 : Look for a hint-file generated 'call-back-unit'. If the
4542 : user has specified that a 64-bit perl is to be built,
4543 : we may need to set or change some other defaults.
4544 if $test -f use64bitint.cbu; then
4545 echo "Your platform has some specific hints for 64-bit integers, using them..."
4549 4) case "$archname64" in
4550 '') archname64=64int ;;
4557 case "$use64bitall" in
4558 "$define"|true|[yY]*)
4559 : Look for a hint-file generated 'call-back-unit'. If the
4560 : user has specified that a maximally 64-bit perl is to be built,
4561 : we may need to set or change some other defaults.
4562 if $test -f use64bitall.cbu; then
4563 echo "Your platform has some specific hints for 64-bit builds, using them..."
4567 4) case "$archname64" in
4568 ''|64int) archname64=64all ;;
4576 echo "Checking for GNU C Library..." >&4
4577 cat >gnulibc.c <<EOM
4589 if eval $compile_ok && ./gnulibc; then
4591 echo "You are using the GNU C Library"
4594 echo "You are not using the GNU C Library"
4600 : see if nm is to be used to determine whether a symbol is defined or not
4604 case "$d_gnulibc" in
4607 echo "nm probably won't work on the GNU C Library." >&4
4613 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
4615 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
4616 echo "'nm' won't be sufficient on this sytem." >&4
4622 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
4623 if $test $dflt -gt 20; then
4633 true|$define) dflt=y;;
4640 I can use $nm to extract the symbols from your C libraries. This
4641 is a time consuming task which may generate huge output on the disk (up
4642 to 3 megabytes) but that should make the symbols extraction faster. The
4643 alternative is to skip the 'nm' extraction part and to compile a small
4644 test program instead to determine whether each symbol is present. If
4645 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
4646 this may be the best solution.
4648 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
4651 rp="Shall I use $nm to extract C symbols from the libraries?"
4654 [Nn]*) usenm=false;;
4663 : nm options which may be necessary
4665 '') if $test -f /mach_boot; then
4667 elif $test -d /usr/ccs/lib; then
4668 nm_opt='-p' # Solaris (and SunOS?)
4669 elif $test -f /dgux; then
4671 elif $test -f /lib64/rld; then
4672 nm_opt='-p' # 64-bit Irix
4678 : nm options which may be necessary for shared libraries but illegal
4679 : for archive libraries. Thank you, Linux.
4680 case "$nm_so_opt" in
4681 '') case "$myuname" in
4683 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
4684 nm_so_opt='--dynamic'
4693 : get list of predefined functions in a handy place
4698 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
4705 *) for thislib in $libs; do
4708 : Handle C library specially below.
4711 thislib=`echo $thislib | $sed -e 's/^-l//'`
4712 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
4714 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
4716 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
4718 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
4720 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
4722 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
4724 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
4729 libnames="$libnames $try"
4731 *) libnames="$libnames $thislib" ;;
4740 for xxx in $libpth; do
4741 $test -r $1 || set $xxx/libc.$so
4742 : The messy sed command sorts on library version numbers.
4744 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
4745 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
4747 s/[0-9][0-9]*/0000&/g
4748 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
4751 $sort | $sed -e 's/^.* //'`
4754 $test -r $1 || set /usr/ccs/lib/libc.$so
4755 $test -r $1 || set /lib/libsys_s$_a
4761 if $test -r "$1"; then
4762 echo "Your (shared) C library seems to be in $1."
4764 elif $test -r /lib/libc && $test -r /lib/clib; then
4765 echo "Your C library seems to be in both /lib/clib and /lib/libc."
4767 libc='/lib/clib /lib/libc'
4768 if $test -r /lib/syslib; then
4769 echo "(Your math library is in /lib/syslib.)"
4770 libc="$libc /lib/syslib"
4772 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
4773 echo "Your C library seems to be in $libc, as you said before."
4774 elif $test -r $incpath/usr/lib/libc$_a; then
4775 libc=$incpath/usr/lib/libc$_a;
4776 echo "Your C library seems to be in $libc. That's fine."
4777 elif $test -r /lib/libc$_a; then
4779 echo "Your C library seems to be in $libc. You're normal."
4781 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
4783 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
4784 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
4785 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
4787 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
4789 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
4792 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
4794 if $test -r "$tans"; then
4795 echo "Your C library seems to be in $tans, of all places."
4801 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
4805 If the guess above is wrong (which it might be if you're using a strange
4806 compiler, or your machine supports multiple models), you can override it here.
4811 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
4813 I can't seem to find your C library. I've looked in the following places:
4816 $sed 's/^/ /' libpath
4819 None of these seems to contain your C library. I need to get its name...
4824 rp='Where is your C library?'
4829 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
4830 set X `cat libnames`
4833 case $# in 1) xxx=file; esac
4834 echo "Extracting names from the following $xxx for later perusal:" >&4
4836 $sed 's/^/ /' libnames >&4
4838 $echo $n "This may take a while...$c" >&4
4842 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
4843 *) $nm $nm_opt $file 2>/dev/null;;
4848 $grep fprintf libc.tmp > libc.ptf
4849 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
4850 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
4852 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
4854 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4856 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
4858 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4860 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
4862 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4864 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
4866 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4868 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
4870 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4872 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
4874 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4876 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
4877 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
4879 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4881 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
4883 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4885 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
4887 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4889 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
4891 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4893 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
4895 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4897 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
4899 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4901 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
4903 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4905 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
4907 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4910 $nm -p $* 2>/dev/null >libc.tmp
4911 $grep fprintf libc.tmp > libc.ptf
4912 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
4913 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
4919 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
4921 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
4922 for thisname in $libnames $libc; do
4923 $ar t $thisname >>libc.tmp
4925 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
4927 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
4928 # Repeat libc to extract forwarders to DLL entries too
4929 for thisname in $libnames $libc; do
4930 $ar tv $thisname >>libc.tmp
4931 # Revision 50 of EMX has bug in $ar.
4932 # it will not extract forwarders to DLL entries
4933 # Use emximp which will extract exactly them.
4934 emximp -o tmp.imp $thisname \
4936 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
4937 < tmp.imp >>libc.tmp
4940 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
4943 echo "$ar didn't seem to work right." >&4
4944 echo "Maybe this is a Cray...trying bld instead..." >&4
4945 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
4947 for thisname in $libnames; do
4949 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
4950 $ar t $thisname >>libc.tmp
4954 echo "That didn't work either. Giving up." >&4
4961 if $test -f /lib/syscalls.exp; then
4963 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
4964 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*$/\1/p' /lib/syscalls.exp >>libc.list
4968 $rm -f libnames libpath
4970 : is a C symbol defined?
4973 -v) tf=libc.tmp; tc=""; tdc="";;
4974 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
4975 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
4978 case "$reuseval-$4" in
4980 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
4986 if $contains $tlook $tf >/dev/null 2>&1;
4991 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
4992 if $cc -o t $optimize $ccflags $ldflags t.c $libs >/dev/null 2>&1;
5000 $define) tval=true;;
5006 : define an is-in-libc? function
5007 inlibc='echo " "; td=$define; tu=$undef;
5008 sym=$1; var=$2; eval "was=\$$2";
5010 case "$reuseval$was" in
5020 echo "$sym() found." >&4;
5021 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
5023 echo "$sym() NOT found." >&4;
5024 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
5028 $define) echo "$sym() found." >&4;;
5029 *) echo "$sym() NOT found." >&4;;
5033 : see if sqrtl exists
5038 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
5041 case "$uselongdouble" in
5042 $define|true|[yY]*) dflt='y';;
5047 Perl can be built to take advantage of long doubles which
5048 (if available) may give more accuracy and range for floating point numbers.
5050 If this doesn't make any sense to you, just accept the default '$dflt'.
5052 rp='Try to use long doubles if available?'
5055 y|Y) val="$define" ;;
5061 case "$uselongdouble" in
5062 true|[yY]*) uselongdouble="$define" ;;
5065 case "$uselongdouble" in
5067 : Look for a hint-file generated 'call-back-unit'. If the
5068 : user has specified that long doubles should be used,
5069 : we may need to set or change some other defaults.
5070 if $test -f uselongdouble.cbu; then
5071 echo "Your platform has some specific hints for long doubles, using them..."
5072 . ./uselongdouble.cbu
5075 (Your platform doesn't have any specific hints for long doubles.)
5081 case "$uselongdouble:$d_sqrtl" in
5085 *** You requested the use of long doubles but you do not seem to have
5086 *** the mathematic functions for long doubles. I'm disabling the use
5087 *** of long doubles.
5090 uselongdouble=$undef
5094 : check for length of double
5096 case "$doublesize" in
5098 echo "Checking to see how big your double precision numbers are..." >&4
5099 $cat >try.c <<'EOCP'
5103 printf("%d\n", (int)sizeof(double));
5108 if eval $compile_ok; then
5110 echo "Your double is $doublesize bytes long."
5113 echo "(I can't seem to compile the test program. Guessing...)"
5114 rp="What is the size of a double precision number (in bytes)?"
5122 : check for long doubles
5124 echo "Checking to see if you have long double..." >&4
5125 echo 'int main() { long double x = 7.0; }' > try.c
5127 if eval $compile; then
5129 echo "You have long double."
5132 echo "You do not have long double."
5138 : check for length of long double
5139 case "${d_longdbl}${longdblsize}" in
5142 echo "Checking to see how big your long doubles are..." >&4
5143 $cat >try.c <<'EOCP'
5147 printf("%d\n", sizeof(long double));
5152 if eval $compile; then
5153 longdblsize=`./try$exe_ext`
5154 echo "Your long doubles are $longdblsize bytes long."
5158 echo "(I can't seem to compile the test program. Guessing...)" >&4
5159 rp="What is the size of a long double (in bytes)?"
5163 if $test "X$doublesize" = "X$longdblsize"; then
5164 echo "(That isn't any different from an ordinary double.)"
5170 : determine the architecture name
5172 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5173 tarch=`arch`"-$osname"
5174 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5175 if uname -m > tmparch 2>&1 ; then
5176 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5177 -e 's/$/'"-$osname/" tmparch`
5185 case "$myarchname" in
5188 echo "(Your architecture name used to be $myarchname.)"
5195 *) dflt="$archname";;
5197 rp='What is your architecture name'
5200 case "$usethreads" in
5202 echo "Threads selected." >&4
5204 *-thread*) echo "...and architecture name already has -thread." >&4
5206 *) archname="$archname-thread"
5207 echo "...setting architecture name to $archname." >&4
5212 case "$usemultiplicity" in
5214 echo "Multiplicity selected." >&4
5216 *-multi*) echo "...and architecture name already has -multi." >&4
5218 *) archname="$archname-multi"
5219 echo "...setting architecture name to $archname." >&4
5224 case "$use64bitint$use64bitall" in
5226 case "$archname64" in
5228 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
5231 case "$use64bitint" in
5232 "$define") echo "64 bit integers selected." >&4 ;;
5234 case "$use64bitall" in
5235 "$define") echo "Maximal 64 bitness selected." >&4 ;;
5238 *-$archname64*) echo "...and architecture name already has $archname64." >&4
5240 *) archname="$archname-$archname64"
5241 echo "...setting architecture name to $archname." >&4
5247 case "$uselongdouble" in
5249 echo "Long doubles selected." >&4
5250 case "$longdblsize" in
5252 "...but long doubles are equal to doubles, not changing architecture name." >&4
5256 *-ld*) echo "...and architecture name already has -ld." >&4
5258 *) archname="$archname-ld"
5259 echo "...setting architecture name to $archname." >&4
5267 : determine root of directory hierarchy where package will be installed.
5270 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
5278 By default, $package will be installed in $dflt/bin, manual pages
5279 under $dflt/man, etc..., i.e. with $dflt as prefix for all
5280 installation directories. Typically this is something like /usr/local.
5281 If you wish to have binaries under /usr/bin but other parts of the
5282 installation under /usr/local, that's ok: you will be prompted
5283 separately for each of the installation directories, the prefix being
5284 only used to set the defaults.
5288 rp='Installation prefix to use?'
5296 *) oldprefix="$prefix";;
5306 $define|true) afs=true ;;
5307 $undef|false) afs=false ;;
5308 *) if test -d /afs; then
5316 echo "AFS may be running... I'll be extra cautious then..." >&4
5318 echo "AFS does not seem to be running..." >&4
5321 : determine installation prefix for where package is to be installed.
5325 Since you are running AFS, I need to distinguish the directory in which
5326 files will reside from the directory in which they are installed (and from
5327 which they are presumably copied to the former directory by occult means).
5330 case "$installprefix" in
5331 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
5332 *) dflt="$installprefix";;
5337 In some special cases, particularly when building $package for distribution,
5338 it is convenient to distinguish between the directory in which files should
5339 be installed from the directory ($prefix) in which they
5340 will eventually reside. For most users, these two directories are the same.
5343 case "$installprefix" in
5345 *) dflt=$installprefix;;
5349 rp='What installation prefix should I use for installing files?'
5351 installprefix="$ans"
5352 installprefixexp="$ansexp"
5354 : set the prefixit variable, to compute a suitable default value
5355 prefixit='case "$3" in
5357 case "$oldprefix" in
5358 "") eval "$1=\"\$$2\"";;
5365 ""|" ") eval "$1=\"\$$2\"";;
5371 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
5373 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
5374 /*-$oldprefix/*|\~*-$oldprefix/*)
5375 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
5376 *) eval "$1=\"\$$2\"";;
5381 : get the patchlevel
5383 echo "Getting the current patchlevel..." >&4
5384 if $test -r $rsrc/patchlevel.h;then
5385 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
5386 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
5387 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5388 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
5389 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
5390 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5399 $echo "(You have $package version $patchlevel subversion $subversion.)"
5402 : XXX Should be a Configure test for double-dots in filenames.
5403 version=`echo $revision $patchlevel $subversion | \
5404 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
5405 api_versionstring=`echo $api_revision $api_version $api_subversion | \
5406 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
5409 version=`echo $revision $patchlevel $subversion | \
5410 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
5411 api_versionstring=`echo $api_revision $api_version $api_subversion | \
5412 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
5415 : Special case the 5.005_xx maintenance series, which used 5.005
5416 : without any subversion label as a subdirectory in $sitelib
5417 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
5418 api_versionstring='5.005'
5421 : determine installation style
5422 : For now, try to deduce it from prefix unless it is already set.
5423 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
5424 case "$installstyle" in
5425 '') case "$prefix" in
5426 *perl*) dflt='lib';;
5427 *) dflt='lib/perl5' ;;
5430 *) dflt="$installstyle" ;;
5432 : Probably not worth prompting for this since we prompt for all
5433 : the directories individually, and the prompt would be too long and
5437 : determine where private library files go
5438 : Usual default is /usr/local/lib/perl5/$version.
5439 : Also allow things like /opt/perl/lib/$version, since
5440 : /opt/perl/lib/perl5... would be redundant.
5441 : The default "style" setting is made in installstyle.U
5442 case "$installstyle" in
5443 *lib/perl5*) set dflt privlib lib/$package/$version ;;
5444 *) set dflt privlib lib/$version ;;
5449 There are some auxiliary files for $package that need to be put into a
5450 private library directory that is accessible by everyone.
5454 rp='Pathname where the private library files will reside?'
5457 privlibexp="$ansexp"
5458 : Change installation prefix, if necessary.
5459 if $test X"$prefix" != X"$installprefix"; then
5460 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
5462 installprivlib="$privlibexp"
5465 : set the prefixup variable, to restore leading tilda escape
5466 prefixup='case "$prefixexp" in
5468 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
5471 : determine where public architecture dependent libraries go
5474 : privlib default is /usr/local/lib/$package/$version
5475 : archlib default is /usr/local/lib/$package/$version/$archname
5476 : privlib may have an optional trailing /share.
5477 tdflt=`echo $privlib | $sed 's,/share$,,'`
5478 tdflt=$tdflt/$archname
5487 $spackage contains architecture-dependent library files. If you are
5488 sharing libraries in a heterogeneous environment, you might store
5489 these files in a separate location. Otherwise, you can just include
5490 them with the rest of the public library files.
5494 rp='Where do you want to put the public architecture-dependent libraries?'
5497 archlibexp="$ansexp"
5498 if $test X"$archlib" = X"$privlib"; then
5503 : Change installation prefix, if necessary.
5504 if $test X"$prefix" != X"$installprefix"; then
5505 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
5507 installarchlib="$archlibexp"
5511 : Binary compatibility with 5.005 is not possible for builds
5512 : with advanced features
5513 case "$usethreads$usemultiplicity" in
5515 bincompat5005="$undef"
5516 d_bincompat5005="$undef"
5520 This version of Perl can be compiled for binary compatibility with 5.005.
5521 If you decide to do so, you will be able to continue using most of the
5522 extensions that were compiled for Perl 5.005.
5525 case "$bincompat5005$d_bincompat5005" in
5526 *"$undef"*) dflt=n ;;
5529 rp='Binary compatibility with Perl 5.005?'
5532 y*) val="$define" ;;
5537 case "$d_bincompat5005" in
5539 bincompat5005="$define"
5541 *) bincompat5005="$undef"
5542 d_bincompat5005="$undef"
5549 : see if setuid scripts can be secure
5552 Some kernels have a bug that prevents setuid #! scripts from being
5553 secure. Some sites have disabled setuid #! scripts because of this.
5555 First let's decide if your kernel supports secure setuid #! scripts.
5556 (If setuid #! scripts would be secure but have been disabled anyway,
5557 don't say that they are secure if asked.)
5562 if $test -d /dev/fd; then
5563 echo "#!$ls" >reflect
5564 chmod +x,u+s reflect
5565 ./reflect >flect 2>&1
5566 if $contains "/dev/fd" flect >/dev/null; then
5567 echo "Congratulations, your kernel has secure setuid scripts!" >&4
5571 If you are not sure if they are secure, I can check but I'll need a
5572 username and password different from the one you are using right now.
5573 If you don't have such a username or don't want me to test, simply
5577 rp='Other username to test security of setuid scripts with?'
5582 case "$d_suidsafe" in
5583 '') echo "I'll assume setuid scripts are *not* secure." >&4
5586 echo "Well, the $hint value is *not* secure." >&4
5588 *) echo "Well, the $hint value *is* secure." >&4
5593 $rm -f reflect flect
5594 echo "#!$ls" >reflect
5595 chmod +x,u+s reflect
5598 echo '"su" will (probably) prompt you for '"$ans's password."
5599 su $ans -c './reflect >flect'
5600 if $contains "/dev/fd" flect >/dev/null; then
5601 echo "Okay, it looks like setuid scripts are secure." >&4
5604 echo "I don't think setuid scripts are secure." >&4
5609 rp='Does your kernel have *secure* setuid scripts?'
5612 [yY]*) val="$define";;
5617 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
5618 echo "(That's for file descriptors, not floppy disks.)"
5624 $rm -f reflect flect
5626 : now see if they want to do setuid emulation
5629 case "$d_suidsafe" in
5632 echo "No need to emulate SUID scripts since they are secure here." >& 4
5636 Some systems have disabled setuid scripts, especially systems where
5637 setuid scripts cannot be secure. On systems where setuid scripts have
5638 been disabled, the setuid/setgid bits on scripts are currently
5639 useless. It is possible for $package to detect those bits and emulate
5640 setuid/setgid in a secure fashion. This emulation will only work if
5641 setuid scripts have been disabled in your kernel.
5645 "$define") dflt=y ;;
5648 rp="Do you want to do setuid/setgid emulation?"
5651 [yY]*) val="$define";;
5659 : determine filename position in cpp output
5661 echo "Computing filename position in cpp output for #include directives..." >&4
5662 echo '#include <stdio.h>' > foo.c
5665 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5666 $grep '^[ ]*#.*stdio\.h' | \
5667 while read cline; do
5670 while $test \$# -gt 0; do
5671 if $test -r \`echo \$1 | $tr -d '"'\`; then
5676 pos=\`expr \$pos + 1\`
5688 *) pos="${fieldn}th";;
5690 echo "Your cpp writes the filename in the $pos field of the line."
5692 : locate header file
5697 for usrincdir in $usrinc
5699 if test -f \$usrincdir/\$wanted; then
5700 echo "\$usrincdir/\$wanted"
5704 awkprg='{ print \$$fieldn }'
5705 echo "#include <\$wanted>" > foo\$\$.c
5706 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5707 $grep "^[ ]*#.*\$wanted" | \
5708 while read cline; do
5709 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5711 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5712 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5717 # status = 0: grep returned 0 lines, case statement not executed
5718 # status = 1: headerfile found
5719 # status = 2: while loop executed, no headerfile found
5723 if test \$status -eq 1; then
5730 : define an alternate in-header-list? function
5731 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5732 cont=true; xxf="echo \"<\$1> found.\" >&4";
5733 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5734 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5736 case $# in 4) instead=instead;; *) instead="at last";; esac;
5737 while $test "$cont"; do
5739 var=$2; eval "was=\$$2";
5740 if $test "$xxx" && $test -r "$xxx";
5742 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5745 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5746 set $yyy; shift; shift; yyy=$@;
5747 case $# in 0) cont="";;
5748 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5749 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5750 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5751 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5755 do set $yyy; var=$2; eval "was=\$$2";
5756 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5757 set $yyy; shift; shift; yyy=$@;
5760 : see if this is a malloc.h system
5761 set malloc.h i_malloc
5764 : see if stdlib is available
5765 set stdlib.h i_stdlib
5768 : determine which malloc to compile in
5770 case "$usemymalloc" in
5771 ''|[yY]*|true|$define) dflt='y' ;;
5774 rp="Do you wish to attempt to use the malloc that comes with $package?"
5780 mallocsrc='malloc.c'
5781 mallocobj="malloc$_o"
5782 d_mymalloc="$define"
5785 : Remove malloc from list of libraries to use
5786 echo "Removing unneeded -lmalloc from library list" >&4
5787 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
5790 echo "libs = $libs" >&4
5802 : compute the return types of malloc and free
5804 $cat >malloc.c <<END
5808 #include <sys/types.h>
5822 case "$malloctype" in
5824 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
5831 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
5835 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
5842 echo "Your system uses $freetype free(), it would seem." >&4
5846 After $package is installed, you may wish to install various
5847 add-on modules and utilities. Typically, these add-ons will
5848 be installed under $prefix with the rest
5849 of this package. However, you may wish to install such add-ons
5850 elsewhere under a different prefix.
5852 If you do not wish to put everything under a single prefix, that's
5853 ok. You will be prompted for the individual locations; this siteprefix
5854 is only used to suggest the defaults.
5856 The default should be fine for most people.
5860 rp='Installation prefix to use for add-on modules and utilities?'
5861 : XXX Here might be another good place for an installstyle setting.
5862 case "$siteprefix" in
5864 *) dflt=$siteprefix ;;
5867 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
5869 case "$siteprefix" in
5873 *) oldsiteprefix="$prefix";;
5878 siteprefixexp="$ansexp"
5880 : determine where site specific libraries go.
5881 : Usual default is /usr/local/lib/perl5/site_perl/$version
5882 : The default "style" setting is made in installstyle.U
5883 : XXX No longer works with Prefixit stuff.
5884 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5886 '') case "$installstyle" in
5887 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
5888 *) dflt=$siteprefix/lib/site_$prog/$version ;;
5896 The installation process will create a directory for
5897 site-specific extensions and modules. Most users find it convenient
5898 to place all site-specific files in this directory rather than in the
5899 main distribution directory.
5903 rp='Pathname for the site-specific library files?'
5906 sitelibexp="$ansexp"
5907 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
5908 : Change installation prefix, if necessary.
5909 if $test X"$prefix" != X"$installprefix"; then
5910 installsitelib=`echo $sitelibexp | $sed "s#^$prefix#$installprefix#"`
5912 installsitelib="$sitelibexp"
5915 : determine where site specific architecture-dependent libraries go.
5916 : sitelib default is /usr/local/lib/perl5/site_perl/$version
5917 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
5918 : sitelib may have an optional trailing /share.
5920 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
5921 dflt="$dflt/$archname"
5926 set sitearch sitearch none
5930 The installation process will also create a directory for
5931 architecture-dependent site-specific extensions and modules.
5935 rp='Pathname for the site-specific architecture-dependent library files?'
5938 sitearchexp="$ansexp"
5939 : Change installation prefix, if necessary.
5940 if $test X"$prefix" != X"$installprefix"; then
5941 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
5943 installsitearch="$sitearchexp"
5948 The installation process will also create a directory for
5949 vendor-supplied add-ons. Vendors who supply perl with their system
5950 may find it convenient to place all vendor-supplied files in this
5951 directory rather than in the main distribution directory. This will
5952 ease upgrades between binary-compatible maintenance versions of perl.
5954 Of course you may also use these directories in whatever way you see
5955 fit. For example, you might use them to access modules shared over a
5956 company-wide network.
5958 The default answer should be fine for most people.
5959 This causes further questions about vendor add-ons to be skipped
5960 and no vendor-specific directories will be configured for perl.
5963 rp='Do you want to configure vendor-specific add-on directories?'
5964 case "$usevendorprefix" in
5965 define|true|[yY]*) dflt=y ;;
5966 *) : User may have set vendorprefix directly on Configure command line.
5967 case "$vendorprefix" in
5976 rp='Installation prefix to use for vendor-supplied add-ons?'
5977 case "$vendorprefix" in
5979 *) dflt=$vendorprefix ;;
5982 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
5984 case "$vendorprefix" in
5988 *) oldvendorprefix="$prefix";;
5992 usevendorprefix="$define"
5994 vendorprefixexp="$ansexp"
5996 *) usevendorprefix="$undef"
6002 case "$vendorprefix" in
6003 '') d_vendorlib="$undef"
6007 *) d_vendorlib="$define"
6008 : determine where vendor-supplied modules go.
6009 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6010 case "$vendorlib" in
6012 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6013 case "$installstyle" in
6014 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6015 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6018 *) dflt="$vendorlib"
6022 rp='Pathname for the vendor-supplied library files?'
6025 vendorlibexp="$ansexp"
6028 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6029 : Change installation prefix, if necessary.
6030 if $test X"$prefix" != X"$installprefix"; then
6031 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
6033 installvendorlib="$vendorlibexp"
6036 case "$vendorprefix" in
6037 '') d_vendorarch="$undef"
6041 *) d_vendorarch="$define"
6042 : determine where vendor-supplied architecture-dependent libraries go.
6043 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6044 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6045 : vendorlib may have an optional trailing /share.
6046 case "$vendorarch" in
6047 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6048 dflt="$dflt/$archname"
6050 *) dflt="$vendorarch" ;;
6053 rp='Pathname for vendor-supplied architecture-dependent files?'
6056 vendorarchexp="$ansexp"
6059 : Change installation prefix, if necessary.
6060 if $test X"$prefix" != X"$installprefix"; then
6061 installvendorarch=`echo $vendorarchexp | sed "s#^$prefix#$installprefix#"`
6063 installvendorarch="$vendorarchexp"
6066 : Final catch-all directories to search
6069 Lastly, you can have perl look in other directories for extensions and
6070 modules in addition to those already specified.
6071 These directories will be searched after
6075 test X"$vendorlib" != "X" && echo ' ' $vendorlib
6076 test X"$vendorarch" != "X" && echo ' ' $vendorarch
6078 case "$otherlibdirs" in
6079 ''|' ') dflt='none' ;;
6080 *) dflt="$otherlibdirs" ;;
6083 Enter a colon-separated set of extra paths to include in perl's @INC
6084 search path, or enter 'none' for no extra paths.
6088 rp='Colon-separated list of additional directories for perl to search?'
6091 ' '|''|none) otherlibdirs=' ' ;;
6092 *) otherlibdirs="$ans" ;;
6094 case "$otherlibdirs" in
6098 set d_perl_otherlibdirs
6101 : Cruising for prototypes
6103 echo "Checking out function prototypes..." >&4
6104 $cat >prototype.c <<'EOCP'
6105 int main(int argc, char *argv[]) {
6108 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
6109 echo "Your C compiler appears to support function prototypes."
6112 echo "Your C compiler doesn't seem to understand function prototypes."
6119 case "$prototype" in
6121 *) ansi2knr='ansi2knr'
6126 This version of $package can only be compiled by a compiler that
6127 understands function prototypes. Unfortunately, your C compiler
6129 doesn't seem to understand them. Sorry about that.
6131 If GNU cc is available for your system, perhaps you could try that instead.
6133 Eventually, we hope to support building Perl with pre-ANSI compilers.
6134 If you would like to help in that effort, please contact <perlbug@perl.org>.
6136 Aborting Configure now.
6142 : determine where public executables go
6147 rp='Pathname where the public executables will reside?'
6149 if $test "X$ansexp" != "X$binexp"; then
6154 : Change installation prefix, if necessary.
6155 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6156 if $test X"$prefix" != X"$installprefix"; then
6157 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
6159 installbin="$binexp"
6162 : Find perl5.005 or later.
6163 echo "Looking for a previously installed perl5.005 or later... "
6165 '') for tdir in `echo "$binexp:$PATH" | $sed "s/$path_sep/ /g"`; do
6166 : Check if this perl is recent and can load a simple module
6167 if $test -x $tdir/perl && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6170 elif $test -x $tdir/perl5 && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6180 '') echo "None found. That's ok.";;
6181 *) echo "Using $perl5." ;;
6184 : Determine list of previous versions to include in @INC
6185 $cat > getverlist <<EOPL
6188 \$api_versionstring = "$api_versionstring";
6189 \$version = "$version";
6190 \$stem = "$sitelib_stem";
6191 \$archname = "$archname";
6193 $cat >> getverlist <<'EOPL'
6194 # Can't have leading @ because metaconfig interprets it as a command!
6195 ;@inc_version_list=();
6196 # XXX Redo to do opendir/readdir?
6199 ;@candidates = glob("5.*");
6205 # XXX ToDo: These comparisons must be reworked when two-digit
6206 # subversions come along, so that 5.7.10 compares as greater than
6207 # 5.7.3! By that time, hope that 5.6.x is sufficiently
6208 # widespread that we can use the built-in version vectors rather
6209 # than reinventing them here. For 5.6.0, however, we must
6210 # assume this script will likely be run by 5.005_0x. --AD 1/2000.
6211 foreach $d (@candidates) {
6212 if ($d lt $version) {
6213 if ($d ge $api_versionstring) {
6214 unshift(@inc_version_list, grep { -d } "$d/$archname", $d);
6216 elsif ($d ge "5.005") {
6217 unshift(@inc_version_list, grep { -d } $d);
6221 # Skip newer version. I.e. don't look in
6222 # 5.7.0 if we're installing 5.6.1.
6226 if (@inc_version_list) {
6227 print join(' ', @inc_version_list);
6230 # Blank space to preserve value for next Configure run.
6235 case "$inc_version_list" in
6236 '') if test -x "$perl5"; then
6237 dflt=`$perl5 getverlist`
6242 $undef) dflt='none' ;;
6243 *) dflt="$inc_version_list" ;;
6246 ''|' ') dflt=none ;;
6249 5.005) case "$bincompat5005" in
6250 $define|true|[yY]*) ;;
6257 In order to ease the process of upgrading, this version of perl
6258 can be configured to use modules built and installed with earlier
6259 versions of perl that were installed under $prefix. Specify here
6260 the list of earlier versions that this version of perl should check.
6261 If Configure detected no earlier versions of perl installed under
6262 $prefix, then the list will be empty. Answer 'none' to tell perl
6263 to not search earlier versions.
6265 The default should almost always be sensible, so if you're not sure,
6266 just accept the default.
6269 rp='List of earlier versions to include in @INC?'
6272 [Nn]one|''|' ') inc_version_list=' ' ;;
6273 *) inc_version_list="$ans" ;;
6275 case "$inc_version_list" in
6277 inc_version_list_init='0';;
6278 *) inc_version_list_init=`echo $inc_version_list |
6279 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6284 : determine whether to install perl also as /usr/bin/perl
6287 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
6289 Many scripts expect perl to be installed as /usr/bin/perl.
6290 I can install the perl you are about to compile also as /usr/bin/perl
6291 (in addition to $installbin/perl).
6293 case "$installusrbinperl" in
6294 "$undef"|[nN]*) dflt='n';;
6297 rp="Do you want to install perl as /usr/bin/perl?"
6300 [yY]*) val="$define";;
6306 set installusrbinperl
6309 : see if dld is available
6313 : see if dlopen exists
6320 : determine which dynamic loading, if any, to compile in
6322 dldir="ext/DynaLoader"
6335 $define) dflt='y' ;;
6338 $define) dflt='y' ;;
6340 : Does a dl_xxx.xs file exist for this operating system
6341 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
6344 rp="Do you wish to use dynamic loading?"
6351 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
6352 dflt="$dldir/dl_${osname}.xs"
6353 elif $test "$d_dlopen" = "$define" ; then
6354 dflt="$dldir/dl_dlopen.xs"
6355 elif $test "$i_dld" = "$define" ; then
6356 dflt="$dldir/dl_dld.xs"
6361 *) dflt="$dldir/$dlsrc"
6364 echo "The following dynamic loading files are available:"
6365 : Can not go over to $dldir because getfile has path hard-coded in.
6366 tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir
6367 rp="Source file to use for dynamic loading"
6373 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
6377 Some systems may require passing special flags to $cc -c to
6378 compile modules that will be used to create a shared library.
6379 To use no flags, say "none".
6382 case "$cccdlflags" in
6383 '') case "$gccversion" in
6384 '') case "$osname" in
6386 next) dflt='none' ;;
6387 irix*) dflt='-KPIC' ;;
6388 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
6389 sunos) dflt='-pic' ;;
6393 *) case "$osname" in
6394 svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
6399 *) dflt="$cccdlflags" ;;
6401 rp="Any special flags to pass to $cc -c to compile shared library modules?"
6404 none) cccdlflags=' ' ;;
6405 *) cccdlflags="$ans" ;;
6410 Some systems use ld to create libraries that can be dynamically loaded,
6411 while other systems (such as those using ELF) use $cc.
6415 '') $cat >try.c <<'EOM'
6416 /* Test for whether ELF binaries are produced */
6421 int i = open("a.out",O_RDONLY);
6424 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
6425 exit(0); /* succeed (yes, it's ELF) */
6430 if $cc $ccflags try.c >/dev/null 2>&1 && ./a.out; then
6432 You appear to have ELF support. I'll use $cc to build dynamic libraries.
6436 echo "I'll use ld to build dynamic libraries."
6445 rp="What command should be used to create dynamic libraries?"
6451 Some systems may require passing special flags to $ld to create a
6452 library that can be dynamically loaded. If your ld flags include
6453 -L/other/path options to locate libraries outside your loader's normal
6454 search path, you may need to specify those -L options here as well. To
6455 use no flags, say "none".
6458 case "$lddlflags" in
6459 '') case "$osname" in
6460 beos) dflt='-nostart' ;;
6462 case "$gccversion" in
6463 '') dflt="$dflt +vnocompatwarnings" ;;
6466 linux|irix*) dflt='-shared' ;;
6467 next) dflt='none' ;;
6468 solaris) dflt='-G' ;;
6469 sunos) dflt='-assert nodefinitions' ;;
6470 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
6474 *) dflt="$lddlflags" ;;
6477 : Try to guess additional flags to pick up local libraries.
6478 : Be careful not to append to a plain 'none'
6482 for thisflag in $ldflags; do
6487 *) dflt="$dflt $thisflag" ;;
6494 ''|' ') dflt='none' ;;
6497 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
6500 none) lddlflags=' ' ;;
6501 *) lddlflags="$ans" ;;
6506 Some systems may require passing special flags to $cc to indicate that
6507 the resulting executable will use dynamic linking. To use no flags,
6511 case "$ccdlflags" in
6512 '') case "$osname" in
6513 hpux) dflt='-Wl,-E' ;;
6514 linux) dflt='-rdynamic' ;;
6515 next) dflt='none' ;;
6516 sunos) dflt='none' ;;
6520 *) dflt="$ccdlflags" ;;
6522 rp="Any special flags to pass to $cc to use dynamic linking?"
6525 none) ccdlflags=' ' ;;
6526 *) ccdlflags="$ans" ;;
6540 # No dynamic loading being used, so don't bother even to prompt.
6543 *) case "$useshrplib" in
6544 '') case "$osname" in
6545 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
6547 also='Building a shared libperl is required for dynamic loading to work on your system.'
6552 also='Building a shared libperl is needed for MAB support.'
6570 The perl executable is normally obtained by linking perlmain.c with
6571 libperl${_a}, any static extensions (usually just DynaLoader), and
6572 any other libraries needed on this system (such as -lm, etc.). Since
6573 your system supports dynamic loading, it is probably possible to build
6574 a shared libperl.$so. If you will have more than one executable linked
6575 to libperl.$so, this will significantly reduce the size of each
6576 executable, but it may have a noticeable affect on performance. The
6577 default is probably sensible for your system.
6581 rp="Build a shared libperl.$so (y/n)"
6585 useshrplib='true' ;;
6586 *) useshrplib='false' ;;
6591 case "$useshrplib" in
6595 # Figure out a good name for libperl.so. Since it gets stored in
6596 # a version-specific architecture-dependent library, the version
6597 # number isn't really that important, except for making cc/ld happy.
6599 # A name such as libperl.so.3.1
6600 majmin="libperl.$so.$patchlevel.$subversion"
6601 # A name such as libperl.so.301
6602 majonly=`echo $patchlevel $subversion |
6603 $awk '{printf "%d%02d", $1, $2}'`
6604 majonly=libperl.$so.$majonly
6605 # I'd prefer to keep the os-specific stuff here to a minimum, and
6606 # rely on figuring it out from the naming of libc.
6607 case "${osname}${osvers}" in
6610 # XXX How handle the --version stuff for MAB?
6612 linux*) # ld won't link with a bare -lperl otherwise.
6615 cygwin*) # include version
6616 dflt=`echo libperl$version | sed -e 's/\./_/g'`$lib_ext
6618 *) # Try to guess based on whether libc has major.minor.
6620 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
6621 *libc.$so.[0-9]*) dflt=$majonly ;;
6622 *) dflt=libperl.$so ;;
6632 I need to select a good name for the shared libperl. If your system uses
6633 library names with major and minor numbers, then you might want something
6634 like $majmin. Alternatively, if your system uses a single version
6635 number for shared libraries, then you might want to use $majonly.
6636 Or, your system might be quite happy with a simple libperl.$so.
6638 Since the shared libperl will get installed into a version-specific
6639 architecture-dependent directory, the version number of the shared perl
6640 library probably isn't important, so the default should be o.k.
6643 rp='What name do you want to give to the shared libperl?'
6646 echo "Ok, I'll use $libperl"
6649 libperl="libperl${_a}"
6653 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
6657 WARNING: Use of the shrpdir variable for the installation location of
6658 the shared $libperl is not supported. It was never documented and
6659 will not work in this version. Let me (perlbug@perl.org)
6660 know of any problems this may cause.
6666 But your current setting of $shrpdir is
6667 the default anyway, so it's harmless.
6672 Further, your current attempted setting of $shrpdir
6673 conflicts with the value of $archlibexp/CORE
6674 that installperl will use.
6681 # How will the perl executable find the installed shared $libperl?
6682 # Add $xxx to ccdlflags.
6683 # If we can't figure out a command-line option, use $shrpenv to
6684 # set env LD_RUN_PATH. The main perl makefile uses this.
6685 shrpdir=$archlibexp/CORE
6688 if "$useshrplib"; then
6691 # We'll set it in Makefile.SH...
6697 xxx="-Wl,-R$shrpdir"
6699 linux|irix*|dec_osf)
6700 xxx="-Wl,-rpath,$shrpdir"
6703 # next doesn't like the default...
6706 # beos doesn't like the default, either.
6709 # hpux doesn't like the default, either.
6710 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
6713 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
6719 # Only add $xxx if it isn't already in ccdlflags.
6720 case " $ccdlflags " in
6722 *) ccdlflags="$ccdlflags $xxx"
6725 Adding $xxx to the flags
6726 passed to $ld so that the perl executable will find the
6727 installed shared $libperl.
6735 # Fix ccdlflags in AIX for building external extensions.
6736 # (For building Perl itself bare -bE:perl.exp is needed,
6737 # Makefile.SH takes care of this.)
6739 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
6741 # Respect a hint or command-line value.
6743 '') shrpenv="$tmp_shrpenv" ;;
6745 case "$ldlibpthname" in
6746 '') ldlibpthname=LD_LIBRARY_PATH ;;
6747 none) ldlibpthname='' ;;
6750 : determine where manual pages are on this system
6754 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
6755 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
6756 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
6757 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
6758 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
6759 sysman=`./loc . /usr/man/man1 $syspath`
6762 if $test -d "$sysman"; then
6763 echo "System manual is in $sysman." >&4
6765 echo "Could not find manual pages in source form." >&4
6768 : determine where manual pages go
6769 set man1dir man1dir none
6773 $spackage has manual pages available in source form.
6777 echo "However, you don't have nroff, so they're probably useless to you."
6779 '') man1dir="none";;
6782 echo "If you don't want the manual sources installed, answer 'none'."
6787 lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
6788 lookpath="$lookpath $prefixexp/man/p_man/man1"
6789 lookpath="$lookpath $prefixexp/man/u_man/man1"
6790 lookpath="$lookpath $prefixexp/man/man.1"
6792 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
6793 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
6803 rp="Where do the main $spackage manual pages (source) go?"
6805 if $test "X$man1direxp" != "X$ansexp"; then
6809 man1direxp="$ansexp"
6815 : Change installation prefix, if necessary.
6816 if $test X"$prefix" != X"$installprefix"; then
6817 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
6819 installman1dir="$man1direxp"
6822 : What suffix to use on installed man pages
6829 rp="What suffix should be used for the main $spackage man pages?"
6831 '') case "$man1dir" in
6845 *) dflt="$man1ext";;
6852 : see if we can have long filenames
6854 first=123456789abcdef
6856 if (echo hi >$first) 2>/dev/null; then
6857 if $test -f 123456789abcde; then
6858 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
6861 echo 'You can have filenames longer than 14 characters.'>&4
6866 You can't have filenames longer than 14 chars.
6867 You can't even think about them!
6873 $rm -rf 123456789abcde*
6875 : determine where library module manual pages go
6876 set man3dir man3dir none
6880 $spackage has manual pages for many of the library modules.
6886 However, you don't have nroff, so they're probably useless to you.
6889 '') man3dir="none";;
6893 case "$d_flexfnam" in
6896 However, your system can't handle the long file names like File::Basename.3.
6899 '') man3dir="none";;
6903 echo "If you don't want the manual sources installed, answer 'none'."
6904 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6906 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
6907 if $test -d "$privlib/man/man3"; then
6910 WARNING: Previous versions of perl installed man3 pages into
6911 $privlib/man/man3. This version will suggest a
6912 new default of $dflt.
6916 rp='Do you wish to preserve the old behavior?(y/n)'
6919 y*) dflt="$privlib/man/man3" ;;
6924 *) dflt="$man3dir" ;;
6931 rp="Where do the $package library man pages (source) go?"
6934 man3direxp="$ansexp"
6940 : Change installation prefix, if necessary.
6941 if $test X"$prefix" != X"$installprefix"; then
6942 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
6944 installman3dir="$man3direxp"
6947 : What suffix to use on installed man pages
6953 rp="What suffix should be used for the $package library man pages?"
6955 '') case "$man3dir" in
6969 *) dflt="$man3ext";;
6976 : see if we have to deal with yellow pages, now NIS.
6977 if $test -d /usr/etc/yp || $test -d /etc/yp; then
6978 if $test -f /usr/etc/nibindd; then
6980 echo "I'm fairly confident you're on a NeXT."
6982 rp='Do you get the hosts file via NetInfo?'
6991 y*) hostcat='nidump hosts .';;
6992 *) case "$hostcat" in
6993 nidump*) hostcat='';;
7003 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
7011 rp='Are you getting the hosts file via yellow pages?'
7014 y*) hostcat='ypcat hosts';;
7015 *) hostcat='cat /etc/hosts';;
7021 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
7024 '') test -f /etc/group && groupcat='cat /etc/group';;
7027 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
7030 : now get the host name
7032 echo "Figuring out host name..." >&4
7033 case "$myhostname" in
7035 echo 'Maybe "hostname" will work...'
7036 if tans=`sh -c hostname 2>&1` ; then
7044 if $test "$cont"; then
7046 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
7047 if tans=`cat /etc/systemid 2>&1` ; then
7049 phostname='cat /etc/systemid'
7050 echo "Whadyaknow. Xenix always was a bit strange..."
7053 elif $test -r /etc/systemid; then
7054 echo "(What is a non-Xenix system doing with /etc/systemid?)"
7057 if $test "$cont"; then
7058 echo 'No, maybe "uuname -l" will work...'
7059 if tans=`sh -c 'uuname -l' 2>&1` ; then
7061 phostname='uuname -l'
7063 echo 'Strange. Maybe "uname -n" will work...'
7064 if tans=`sh -c 'uname -n' 2>&1` ; then
7066 phostname='uname -n'
7068 echo 'Oh well, maybe I can mine it out of whoami.h...'
7069 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
7070 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
7071 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
7073 case "$myhostname" in
7074 '') echo "Does this machine have an identity crisis or something?"
7077 echo "Well, you said $myhostname before..."
7078 phostname='echo $myhostname';;
7084 : you do not want to know about this
7089 if $test "$myhostname" ; then
7091 rp='Your host name appears to be "'$myhostname'".'" Right?"
7099 : bad guess or no guess
7100 while $test "X$myhostname" = X ; do
7102 rp="Please type the (one word) name of your host:"
7107 : translate upper to lower if necessary
7108 case "$myhostname" in
7110 echo "(Normalizing case in your host name)"
7111 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
7115 case "$myhostname" in
7117 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
7118 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
7119 echo "(Trimming domain name from host name--host name is now $myhostname)"
7121 *) case "$mydomain" in
7124 test "X$hostcat" = "Xypcat hosts" &&
7125 ypmatch "$myhostname" hosts 2>/dev/null |\
7126 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
7129 test "X$hostcat" != "X" &&
7130 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
7131 /[ ]$myhostname[ . ]/p" > hosts
7134 if $test -f hosts; then
7135 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
7136 END { print sum }" hosts` = x1 || tmp_re="[ ]"
7137 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
7138 hosts | $sort | $uniq | \
7139 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
7140 case `$echo X$dflt` in
7141 X*\ *) echo "(Several hosts in the database matched hostname)"
7144 X.) echo "(You do not have fully-qualified names in the hosts database)"
7148 echo "(I cannot locate a hosts database anywhere)"
7153 tans=`./loc resolv.conf X /etc /usr/etc`
7154 if $test -f "$tans"; then
7155 echo "(Attempting domain name extraction from $tans)"
7156 dflt=.`$sed -n -e 's/ / /g' \
7157 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
7158 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
7160 .) dflt=.`$sed -n -e 's/ / /g' \
7161 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
7162 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
7169 .) echo "(No help from resolv.conf either -- attempting clever guess)"
7170 dflt=.`sh -c domainname 2>/dev/null`
7173 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
7178 .) echo "(Lost all hope -- silly guess then)"
7184 *) dflt="$mydomain";;
7188 rp="What is your domain name?"
7198 : translate upper to lower if necessary
7201 echo "(Normalizing case in your domain name)"
7202 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
7206 : a little sanity check here
7207 case "$phostname" in
7210 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
7211 $myhostname$mydomain|$myhostname) ;;
7213 case "$phostname" in
7215 echo "(That doesn't agree with your whoami.h file, by the way.)"
7218 echo "(That doesn't agree with your $phostname command, by the way.)"
7228 I need to get your e-mail address in Internet format if possible, i.e.
7229 something like user@host.domain. Please answer accurately since I have
7230 no easy means to double check it. The default value provided below
7231 is most probably close to reality but may not be valid from outside
7232 your organization...
7236 while test "$cont"; do
7238 '') dflt="$cf_by@$myhostname$mydomain";;
7239 *) dflt="$cf_email";;
7241 rp='What is your e-mail address?'
7247 rp='Address does not look like an Internet one. Use it anyway?'
7263 If you or somebody else will be maintaining perl at your site, please
7264 fill in the correct e-mail address here so that they may be contacted
7265 if necessary. Currently, the "perlbug" program included with perl
7266 will send mail to this address in addition to perlbug@perl.org. You may
7267 enter "none" for no administrator.
7270 case "$perladmin" in
7271 '') dflt="$cf_email";;
7272 *) dflt="$perladmin";;
7274 rp='Perl administrator e-mail address'
7278 : determine whether to only install version-specific parts.
7281 Do you want to install only the version-specific parts of the perl
7282 distribution? Usually you do *not* want to do this.
7284 case "$versiononly" in
7285 "$define"|[Yy]*|true) dflt='y' ;;
7288 rp="Do you want to install only the version-specific parts of perl?"
7291 [yY]*) val="$define";;
7297 : figure out how to guarantee perl startup
7298 case "$startperl" in
7300 case "$sharpbang" in
7304 I can use the #! construct to start perl on your system. This will
7305 make startup of perl scripts faster, but may cause problems if you
7306 want to share those scripts and perl is not in a standard place
7307 ($binexp/perl) on all your platforms. The alternative is to force
7308 a shell by starting the script with a single ':' character.
7311 case "$versiononly" in
7312 "$define") dflt="$binexp/perl$version";;
7313 *) dflt="$binexp/perl";;
7315 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
7318 none) startperl=": # use perl";;
7319 *) startperl="#!$ans"
7320 if $test 30 -lt `echo "$ans" | wc -c`; then
7323 WARNING: Some systems limit the #! command to 32 characters.
7324 If you experience difficulty running Perl scripts with #!, try
7325 installing Perl in a directory with a shorter pathname.
7331 *) startperl=": # use perl"
7336 echo "I'll use $startperl to start perl scripts."
7338 : figure best path for perl in scripts
7341 perlpath="$binexp/perl"
7342 case "$startperl" in
7347 I will use the "eval 'exec'" idiom to start Perl on your system.
7348 I can use the full path of your Perl binary for this purpose, but
7349 doing so may cause problems if you want to share those scripts and
7350 Perl is not always in a standard place ($binexp/perl).
7354 rp="What path shall I use in \"eval 'exec'\"?"
7361 case "$startperl" in
7363 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
7366 : determine where public executable scripts go
7367 set scriptdir scriptdir
7369 case "$scriptdir" in
7372 : guess some guesses
7373 $test -d /usr/share/scripts && dflt=/usr/share/scripts
7374 $test -d /usr/share/bin && dflt=/usr/share/bin
7375 $test -d /usr/local/script && dflt=/usr/local/script
7376 $test -d /usr/local/scripts && dflt=/usr/local/scripts
7377 $test -d $prefixexp/script && dflt=$prefixexp/script
7381 *) dflt="$scriptdir"
7386 Some installations have a separate directory just for executable scripts so
7387 that they can mount it across multiple architectures but keep the scripts in
7388 one spot. You might, for example, have a subdirectory of /usr/share for this.
7389 Or you might just lump your scripts in with all your other executables.
7393 rp='Where do you keep publicly executable scripts?'
7395 if $test "X$ansexp" != "X$scriptdirexp"; then
7399 scriptdirexp="$ansexp"
7400 : Change installation prefix, if necessary.
7401 if $test X"$prefix" != X"$installprefix"; then
7402 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
7404 installscript="$scriptdirexp"
7407 : determine where add-on public executables go
7409 '') dflt=$siteprefix/bin ;;
7413 rp='Pathname where the add-on public executables should be installed?'
7416 sitebinexp="$ansexp"
7417 : Change installation prefix, if necessary.
7418 if $test X"$prefix" != X"$installprefix"; then
7419 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
7421 installsitebin="$sitebinexp"
7424 case "$useperlio" in
7425 $define|true|[yY]*) dflt='y';;
7430 Previous version of $package used the standard IO mechanisms as defined
7431 in <stdio.h>. Versions 5.003_02 and later of perl allow alternate IO
7432 mechanisms via a "PerlIO" abstraction, but the stdio mechanism is still
7433 the default. This abstraction layer can use AT&T's sfio (if you already
7434 have sfio installed) or regular stdio. Using PerlIO with sfio may cause
7435 problems with some extension modules. Using PerlIO with stdio is safe,
7436 but it is slower than plain stdio and therefore is not the default.
7438 If this doesn't make any sense to you, just accept the default '$dflt'.
7440 rp='Use the experimental PerlIO abstraction layer?'
7447 echo "Ok, doing things the stdio way"
7454 case "$vendorprefix" in
7455 '') d_vendorbin="$undef"
7459 *) d_vendorbin="$define"
7460 : determine where vendor-supplied executables go.
7461 case "$vendorbin" in
7462 '') dflt=$vendorprefix/bin ;;
7463 *) dflt="$vendorbin" ;;
7466 rp='Pathname for the vendor-supplied executables directory?'
7469 vendorbinexp="$ansexp"
7472 : Change installation prefix, if necessary.
7473 if $test X"$prefix" != X"$installprefix"; then
7474 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
7476 installvendorbin="$vendorbinexp"
7479 : see if qgcvt exists
7485 if $test X"$d_longdbl" = X"$define"; then
7487 echo "Checking how to print long doubles..." >&4
7489 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
7490 $cat >try.c <<'EOCP'
7491 #include <sys/types.h>
7495 printf("%.3f\n", d);
7499 if eval $compile; then
7503 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
7504 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
7505 echo "We will use %f."
7511 if $test X"$sPRIfldbl" = X; then
7512 $cat >try.c <<'EOCP'
7513 #include <sys/types.h>
7516 long double d = 123.456;
7517 printf("%.3llf\n", d);
7521 if eval $compile; then
7525 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
7526 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
7527 echo "We will use %llf."
7533 if $test X"$sPRIfldbl" = X; then
7534 $cat >try.c <<'EOCP'
7535 #include <sys/types.h>
7538 long double d = 123.456;
7539 printf("%.3Lf\n", d);
7543 if eval $compile; then
7547 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
7548 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
7549 echo "We will use %Lf."
7555 if $test X"$sPRIfldbl" = X; then
7556 $cat >try.c <<'EOCP'
7557 #include <sys/types.h>
7560 long double d = 123.456;
7561 printf("%.3lf\n", d);
7565 if eval $compile; then
7569 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
7570 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
7571 echo "We will use %lf."
7577 if $test X"$sPRIfldbl" = X; then
7578 echo "Cannot figure out how to print long doubles." >&4
7580 sSCNfldbl=$sPRIfldbl # expect consistency
7587 case "$sPRIfldbl" in
7588 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
7589 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
7590 d_SCNfldbl="$undef";
7592 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
7593 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
7594 d_SCNfldbl="$define";
7598 : Check how to convert floats to strings.
7600 echo "Checking for an efficient way to convert floats to strings."
7602 case "$uselongdouble" in
7603 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
7605 case "$d_longdbl" in
7606 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
7608 case "$d_PRIgldbl" in
7609 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
7613 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
7614 char *myname = "gconvert";
7617 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
7618 char *myname = "gcvt";
7621 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
7622 char *myname = "qgcvt";
7623 #define DOUBLETYPE long double
7626 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE) && defined(HAS_PRIgldbl)
7627 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
7629 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
7631 char *myname = "sprintf";
7635 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
7636 #define DOUBLETYPE long double
7638 #define DOUBLETYPE double
7644 #define I_STDLIB $i_stdlib
7650 checkit(expect, got)
7654 if (strcmp(expect, got)) {
7655 printf("%s oddity: Expected %s, got %s\n",
7656 myname, expect, got);
7666 /* This must be 1st test on (which?) platform */
7667 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
7668 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
7669 checkit("0.1", buf);
7671 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
7674 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
7675 checkit("1.1", buf);
7677 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
7678 checkit("1.01", buf);
7680 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
7681 checkit("1.001", buf);
7683 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
7684 checkit("1.0001", buf);
7686 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
7687 checkit("1.00001", buf);
7689 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
7690 checkit("1.000001", buf);
7692 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
7695 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
7698 /* Some Linux gcvt's give 1.e+5 here. */
7699 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
7700 checkit("100000", buf);
7702 /* Some Linux gcvt's give -1.e+5 here. */
7703 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
7704 checkit("-100000", buf);
7706 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
7707 checkit("123.456", buf);
7712 case "$d_Gconvert" in
7713 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
7714 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
7715 sprintf*) xxx_list='sprintf gconvert gcvt' ;;
7716 *) xxx_list='gconvert gcvt sprintf' ;;
7719 case "$d_longdbl$uselongdouble$d_PRIgldbl" in
7720 "$define$define$define")
7721 # for long doubles prefer first qgcvt, then sprintf
7722 xxx_list="`echo $xxx_list|sed s/sprintf//`"
7723 xxx_list="sprintf $xxx_list"
7725 "$define") xxx_list="qgcvt $xxx_list" ;;
7730 for xxx_convert in $xxx_list; do
7731 echo "Trying $xxx_convert..."
7733 set try -DTRY_$xxx_convert
7734 if eval $compile; then
7735 echo "$xxx_convert() found." >&4
7737 echo "I'll use $xxx_convert to convert floats into a string." >&4
7740 echo "...But $xxx_convert didn't work as I expected."
7743 echo "$xxx_convert NOT found." >&4
7747 case "$xxx_convert" in
7748 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
7749 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
7750 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
7751 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
7752 "$define$define$define")
7753 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
7754 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
7759 : see if _fwalk exists
7763 : Initialize h_fcntl
7766 : Initialize h_sysfile
7769 : access call always available on UNIX
7773 : locate the flags for 'access()'
7777 $cat >access.c <<'EOCP'
7778 #include <sys/types.h>
7783 #include <sys/file.h>
7792 : check sys/file.h first, no particular reason here
7793 if $test `./findhdr sys/file.h` && \
7794 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
7796 echo "<sys/file.h> defines the *_OK access constants." >&4
7797 elif $test `./findhdr fcntl.h` && \
7798 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
7800 echo "<fcntl.h> defines the *_OK access constants." >&4
7801 elif $test `./findhdr unistd.h` && \
7802 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
7803 echo "<unistd.h> defines the *_OK access constants." >&4
7805 echo "I can't find the four *_OK access constants--I'll use mine." >&4
7811 : see if accessx exists
7812 set accessx d_accessx
7815 : see if alarm exists
7819 : see if atolf exists
7823 : see if atoll exists
7827 : Look for GNU-cc style attribute checking
7829 echo "Checking whether your compiler can handle __attribute__ ..." >&4
7830 $cat >attrib.c <<'EOCP'
7832 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
7834 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
7835 if $contains 'warning' attrib.out >/dev/null 2>&1; then
7836 echo "Your C compiler doesn't fully support __attribute__."
7839 echo "Your C compiler supports __attribute__."
7843 echo "Your C compiler doesn't seem to understand __attribute__ at all."
7850 : see if bcmp exists
7854 : see if bcopy exists
7858 : see if this is a unistd.h system
7859 set unistd.h i_unistd
7862 : see if getpgrp exists
7863 set getpgrp d_getpgrp
7866 case "$d_getpgrp" in
7869 echo "Checking to see which flavor of getpgrp is in use..."
7872 #include <sys/types.h>
7874 # include <unistd.h>
7878 if (getuid() == 0) {
7879 printf("(I see you are running Configure as super-user...)\n");
7883 if (getpgrp(1) == 0)
7892 if $cc -o set -DTRY_BSD_PGRP $ccflags $ldflags set.c $libs >/dev/null 2>&1 && ./set; then
7893 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
7895 elif $cc -o set $ccflags $ldflags set.c $libs >/dev/null 2>&1 && ./set; then
7896 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
7899 echo "I can't seem to compile and run the test program."
7901 xxx="a USG one, i.e. you use getpgrp()."
7903 # SVR4 systems can appear rather BSD-ish.
7906 xxx="a BSD one, i.e. you use getpgrp(pid)."
7910 xxx="probably a USG one, i.e. you use getpgrp()."
7915 echo "Assuming your getpgrp is $xxx" >&4
7924 : see if setpgrp exists
7925 set setpgrp d_setpgrp
7928 case "$d_setpgrp" in
7931 echo "Checking to see which flavor of setpgrp is in use..."
7934 #include <sys/types.h>
7936 # include <unistd.h>
7940 if (getuid() == 0) {
7941 printf("(I see you are running Configure as super-user...)\n");
7945 if (-1 == setpgrp(1, 1))
7948 if (setpgrp() != -1)
7954 if $cc -o set -DTRY_BSD_PGRP $ccflags $ldflags set.c $libs >/dev/null 2>&1 && ./set; then
7955 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
7957 elif $cc -o set $ccflags $ldflags set.c $libs >/dev/null 2>&1 && ./set; then
7958 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
7961 echo "(I can't seem to compile and run the test program.)"
7963 xxx="a USG one, i.e. you use setpgrp()."
7965 # SVR4 systems can appear rather BSD-ish.
7968 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
7972 xxx="probably a USG one, i.e. you use setpgrp()."
7977 echo "Assuming your setpgrp is $xxx" >&4
7985 : see if bzero exists
7989 : see if signal is declared as pointer to function returning int or void
7991 xxx=`./findhdr signal.h`
7992 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
7993 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7994 echo "You have int (*signal())() instead of void." >&4
7996 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7997 echo "You have void (*signal())()." >&4
7999 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
8000 echo "You have int (*signal())() instead of void." >&4
8002 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
8003 echo "You have void (*signal())()." >&4
8006 case "$d_voidsig" in
8008 echo "I can't determine whether signal handler returns void or int..." >&4
8010 rp="What type does your signal handler return?"
8017 echo "As you already told me, signal handler returns void." >&4
8020 *) echo "As you already told me, signal handler returns int." >&4
8027 case "$d_voidsig" in
8028 "$define") signal_t="void";;
8033 : check for ability to cast large floats to 32-bit ints.
8035 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
8036 if $test "$intsize" -ge 4; then
8043 #include <sys/types.h>
8045 $signal_t blech(s) int s; { exit(3); }
8052 signal(SIGFPE, blech);
8054 /* Don't let compiler optimize the test away. Store the number
8055 in a writable string for gcc to pass to sscanf under HP/UX.
8057 sprintf(str, "2147483647");
8058 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
8062 /* x86 processors will probably give 0x8000 0000, which is a
8063 sign change. We don't want that. We want to mimic SPARC
8064 behavior here, which is to preserve the sign and give
8067 if (i32 != ($xxx) f)
8073 if eval $compile_ok; then
8077 echo "(I can't seem to compile the test program--assuming it can't)"
8085 echo "Nope, it can't."
8092 : check for ability to cast negative floats to unsigned
8094 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
8097 #include <sys/types.h>
8099 $signal_t blech(s) int s; { exit(7); }
8100 $signal_t blech_in_list(s) int s; { exit(4); }
8101 unsigned long dummy_long(p) unsigned long p; { return p; }
8102 unsigned int dummy_int(p) unsigned int p; { return p; }
8103 unsigned short dummy_short(p) unsigned short p; { return p; }
8107 unsigned long along;
8109 unsigned short ashort;
8113 /* Frustrate gcc-2.7.2's optimizer which failed this test with
8114 a direct f = -123. assignment. gcc-2.8.0 reportedly
8115 optimized the whole file away
8117 /* Store the number in a writable string for gcc to pass to
8120 sprintf(str, "-123");
8121 sscanf(str, "%lf", &f); /* f = -123.; */
8123 signal(SIGFPE, blech);
8124 along = (unsigned long)f;
8125 aint = (unsigned int)f;
8126 ashort = (unsigned short)f;
8127 if (along != (unsigned long)-123)
8129 if (aint != (unsigned int)-123)
8131 if (ashort != (unsigned short)-123)
8133 sprintf(str, "1073741824.");
8134 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
8137 along = (unsigned long)f;
8138 if (along != 0x80000000)
8142 along = (unsigned long)f;
8143 if (along != 0x7fffffff)
8147 along = (unsigned long)f;
8148 if (along != 0x80000001)
8152 signal(SIGFPE, blech_in_list);
8153 sprintf(str, "123.");
8154 sscanf(str, "%lf", &f); /* f = 123.; */
8155 along = dummy_long((unsigned long)f);
8156 aint = dummy_int((unsigned int)f);
8157 ashort = dummy_short((unsigned short)f);
8158 if (along != (unsigned long)123)
8160 if (aint != (unsigned int)123)
8162 if (ashort != (unsigned short)123)
8169 if eval $compile_ok; then
8173 echo "(I can't seem to compile the test program--assuming it can't)"
8176 case "$castflags" in
8181 echo "Nope, it can't."
8188 : see if vprintf exists
8190 if set vprintf val -f d_vprintf; eval $csym; $val; then
8191 echo 'vprintf() found.' >&4
8193 $cat >vprintf.c <<'EOF'
8194 #include <varargs.h>
8196 int main() { xxx("foo"); }
8205 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
8209 if eval $compile && ./vprintf; then
8210 echo "Your vsprintf() returns (int)." >&4
8213 echo "Your vsprintf() returns (char*)." >&4
8217 echo 'vprintf() NOT found.' >&4
8227 : see if chown exists
8231 : see if chroot exists
8235 : see if chsize exists
8239 : check for const keyword
8241 echo 'Checking to see if your C compiler knows about "const"...' >&4
8242 $cat >const.c <<'EOCP'
8243 typedef struct spug { int drokk; } spug;
8250 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
8252 echo "Yup, it does."
8255 echo "Nope, it doesn't."
8260 : see if crypt exists
8262 if set crypt val -f d_crypt; eval $csym; $val; then
8263 echo 'crypt() found.' >&4
8267 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
8268 if $test -z "$cryptlib"; then
8269 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
8273 if $test -z "$cryptlib"; then
8274 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
8278 if $test -z "$cryptlib"; then
8279 cryptlib=`./loc libcrypt$_a "" $libpth`
8283 if $test -z "$cryptlib"; then
8284 echo 'crypt() NOT found.' >&4
8293 : get csh whereabouts
8295 'csh') val="$undef" ;;
8300 : Respect a hint or command line value for full_csh.
8302 '') full_csh=$csh ;;
8305 : see if cuserid exists
8306 set cuserid d_cuserid
8309 : see if this is a limits.h system
8310 set limits.h i_limits
8313 : see if this is a float.h system
8317 : See if number of significant digits in a double precision number is known
8319 $cat >dbl_dig.c <<EOM
8329 printf("Contains DBL_DIG");
8332 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
8333 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
8334 echo "DBL_DIG found." >&4
8337 echo "DBL_DIG NOT found." >&4
8344 : see if difftime exists
8345 set difftime d_difftime
8348 : see if this is a dirent system
8350 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
8352 echo "<dirent.h> found." >&4
8355 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
8356 echo "<sys/dir.h> found." >&4
8359 xinc=`./findhdr sys/ndir.h`
8361 echo "<dirent.h> NOT found." >&4
8366 : Look for type of directory structure.
8368 $cppstdin $cppflags $cppminus < "$xinc" > try.c
8370 case "$direntrytype" in
8373 $define) guess1='struct dirent' ;;
8374 *) guess1='struct direct' ;;
8377 *) guess1="$direntrytype"
8382 'struct dirent') guess2='struct direct' ;;
8383 *) guess2='struct dirent' ;;
8386 if $contains "$guess1" try.c >/dev/null 2>&1; then
8387 direntrytype="$guess1"
8388 echo "Your directory entries are $direntrytype." >&4
8389 elif $contains "$guess2" try.c >/dev/null 2>&1; then
8390 direntrytype="$guess2"
8391 echo "Your directory entries seem to be $direntrytype." >&4
8393 echo "I don't recognize your system's directory entries." >&4
8394 rp="What type is used for directory entries on this system?"
8402 : see if the directory entry stores field length
8404 $cppstdin $cppflags $cppminus < "$xinc" > try.c
8405 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
8406 echo "Good, your directory entry keeps length information in d_namlen." >&4
8409 echo "Your directory entry does not know about the d_namlen field." >&4
8416 : see if dlerror exists
8419 set dlerror d_dlerror
8423 : see if dlfcn is available
8431 On a few systems, the dynamically loaded modules that perl generates and uses
8432 will need a different extension than shared libs. The default will probably
8440 rp='What is the extension of dynamically loaded modules'
8449 : Check if dlsym need a leading underscore
8455 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
8456 $cat >dyna.c <<'EOM'
8465 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
8467 #include <sys/types.h>
8481 int mode = RTLD_LAZY ;
8483 handle = dlopen("./dyna.$dlext", mode) ;
8484 if (handle == NULL) {
8489 symbol = dlsym(handle, "fred") ;
8490 if (symbol == NULL) {
8491 /* try putting a leading underscore */
8492 symbol = dlsym(handle, "_fred") ;
8493 if (symbol == NULL) {
8506 : Call the object file tmp-dyna.o in case dlext=o.
8507 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
8508 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
8509 $ld -o dyna.$dlext $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
8510 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then
8513 1) echo "Test program failed using dlopen." >&4
8514 echo "Perhaps you should not use dynamic loading." >&4;;
8515 2) echo "Test program failed using dlsym." >&4
8516 echo "Perhaps you should not use dynamic loading." >&4;;
8517 3) echo "dlsym needs a leading underscore" >&4
8519 4) echo "dlsym doesn't need a leading underscore." >&4;;
8522 echo "I can't compile and run the test program." >&4
8523 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
8528 $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
8533 hasproto='varname=$1; func=$2; shift; shift;
8534 while $test $# -ge 2; do
8536 $define) echo "#include <$2>";;
8540 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
8541 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
8542 echo "$func() prototype found.";
8545 echo "$func() prototype NOT found.";
8550 $rm -f try.c tryout.c'
8552 : see if prototype for drand48 is available
8554 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
8557 : see if dup2 exists
8561 : see if eaccess exists
8562 set eaccess d_eaccess
8565 : see if endgrent exists
8566 set endgrent d_endgrent
8569 : see if endhostent exists
8570 set endhostent d_endhent
8573 : see if endnetent exists
8574 set endnetent d_endnent
8577 : see if endprotoent exists
8578 set endprotoent d_endpent
8581 : see if endpwent exists
8582 set endpwent d_endpwent
8585 : see if endservent exists
8586 set endservent d_endsent
8589 : Locate the flags for 'open()'
8591 $cat >open3.c <<'EOCP'
8592 #include <sys/types.h>
8597 #include <sys/file.h>
8608 : check sys/file.h first to get FREAD on Sun
8609 if $test `./findhdr sys/file.h` && \
8610 set open3 -DI_SYS_FILE && eval $compile; then
8612 echo "<sys/file.h> defines the O_* constants..." >&4
8614 echo "and you have the 3 argument form of open()." >&4
8617 echo "but not the 3 argument form of open(). Oh, well." >&4
8620 elif $test `./findhdr fcntl.h` && \
8621 set open3 -DI_FCNTL && eval $compile; then
8623 echo "<fcntl.h> defines the O_* constants..." >&4
8625 echo "and you have the 3 argument form of open()." >&4
8628 echo "but not the 3 argument form of open(). Oh, well." >&4
8633 echo "I can't find the O_* constant definitions! You got problems." >&4
8639 : see which of string.h or strings.h is needed
8641 strings=`./findhdr string.h`
8642 if $test "$strings" && $test -r "$strings"; then
8643 echo "Using <string.h> instead of <strings.h>." >&4
8647 strings=`./findhdr strings.h`
8648 if $test "$strings" && $test -r "$strings"; then
8649 echo "Using <strings.h> instead of <string.h>." >&4
8651 echo "No string header found -- You'll surely have problems." >&4
8657 "$undef") strings=`./findhdr strings.h`;;
8658 *) strings=`./findhdr string.h`;;
8661 : check for non-blocking I/O stuff
8662 case "$h_sysfile" in
8663 true) echo "#include <sys/file.h>" > head.c;;
8666 true) echo "#include <fcntl.h>" > head.c;;
8667 *) echo "#include <sys/fcntl.h>" > head.c;;
8672 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
8673 case "$o_nonblock" in
8676 $cat >>try.c <<'EOCP'
8680 printf("O_NONBLOCK\n");
8684 printf("O_NDELAY\n");
8688 printf("FNDELAY\n");
8695 if eval $compile_ok; then
8697 case "$o_nonblock" in
8698 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
8699 *) echo "Seems like we can use $o_nonblock.";;
8702 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
8705 *) echo "Using $hint value $o_nonblock.";;
8707 $rm -f try try.* .out core
8710 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
8716 #include <sys/types.h>
8719 #define MY_O_NONBLOCK $o_nonblock
8720 #ifndef errno /* XXX need better Configure test */
8731 #include <strings.h>
8733 $signal_t blech(x) int x; { exit(3); }
8735 $cat >> try.c <<'EOCP'
8743 pipe(pd); /* Down: child -> parent */
8744 pipe(pu); /* Up: parent -> child */
8747 close(pd[1]); /* Parent reads from pd[0] */
8748 close(pu[0]); /* Parent writes (blocking) to pu[1] */
8749 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
8751 signal(SIGALRM, blech);
8753 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
8755 sprintf(string, "%d\n", ret);
8756 write(2, string, strlen(string));
8759 if (errno == EAGAIN) {
8765 if (errno == EWOULDBLOCK)
8766 printf("EWOULDBLOCK\n");
8769 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
8770 sleep(2); /* Give it time to close our pipe */
8772 ret = read(pd[0], buf, 1); /* Should read EOF */
8774 sprintf(string, "%d\n", ret);
8775 write(3, string, strlen(string));
8779 close(pd[0]); /* We write to pd[1] */
8780 close(pu[1]); /* We read from pu[0] */
8781 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
8782 close(pd[1]); /* Pipe pd is now fully closed! */
8783 exit(0); /* Bye bye, thank you for playing! */
8787 if eval $compile_ok; then
8788 echo "$startsh" >mtry
8789 echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
8791 ./mtry >/dev/null 2>&1
8793 0) eagain=`$cat try.out`;;
8794 1) echo "Could not perform non-blocking setting!";;
8795 2) echo "I did a successful read() for something that was not there!";;
8796 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
8797 *) echo "Something terribly wrong happened during testing.";;
8799 rd_nodata=`$cat try.ret`
8800 echo "A read() system call with no data present returns $rd_nodata."
8801 case "$rd_nodata" in
8804 echo "(That's peculiar, fixing that to be -1.)"
8810 echo "Forcing errno EAGAIN on read() with no data available."
8814 echo "Your read() sets errno to $eagain when no data is available."
8817 status=`$cat try.err`
8819 0) echo "And it correctly returns 0 to signal EOF.";;
8820 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
8821 *) echo "However, your read() returns '$status' on EOF??";;
8824 if test "$status" = "$rd_nodata"; then
8825 echo "WARNING: you can't distinguish between EOF and no data!"
8829 echo "I can't compile the test program--assuming errno EAGAIN will do."
8836 echo "Using $hint value $eagain."
8837 echo "Your read() returns $rd_nodata when no data is present."
8838 case "$d_eofnblk" in
8839 "$define") echo "And you can see EOF because read() returns 0.";;
8840 "$undef") echo "But you can't see EOF status from read() returned value.";;
8842 echo "(Assuming you can't see EOF status from read anyway.)"
8848 $rm -f try try.* .out core head.c mtry
8850 : see if fchmod exists
8854 : see if fchown exists
8858 : see if this is an fcntl system
8863 : See if fcntl-based locking works.
8864 $cat >try.c <<'EOCP'
8869 #if defined(F_SETLK) && defined(F_SETLKW)
8872 fd = open("try.c", O_RDONLY);
8873 flock.l_type = F_RDLCK;
8874 flock.l_whence = SEEK_SET;
8875 flock.l_start = flock.l_len = 0;
8876 retval = fcntl(fd, F_SETLK, &flock);
8878 (retval < 0 ? exit(2) : exit(0));
8884 echo "Checking if fcntl-based file locking works... "
8888 if eval $compile_ok; then
8890 echo "Yes, it seems to work."
8893 echo "Nope, it didn't work."
8897 echo "I'm unable to compile the test program, so I'll assume not."
8902 echo "Nope, since you don't even have fcntl()."
8905 set d_fcntl_can_lock
8910 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
8911 while $test $# -ge 2; do
8913 $define) echo "#include <$2>";;
8917 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
8919 if eval $compile; then
8930 : see whether socket exists
8932 $echo $n "Hmm... $c" >&4
8933 if set socket val -f d_socket; eval $csym; $val; then
8934 echo "Looks like you have Berkeley networking support." >&4
8936 if set setsockopt val -f; eval $csym; $val; then
8939 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
8943 if $contains socklib libc.list >/dev/null 2>&1; then
8944 echo "Looks like you have Berkeley networking support." >&4
8946 : we will have to assume that it supports the 4.2 BSD interface
8949 echo "You don't have Berkeley networking in libc$_a..." >&4
8950 if test "X$d_socket" = "X$define"; then
8951 echo "...but you seem to believe that you have sockets." >&4
8953 for net in net socket
8955 if test -f /usr/lib/lib$net$_a; then
8956 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
8957 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
8958 if $contains socket libc.list >/dev/null 2>&1; then
8963 echo "...but the Wollongong group seems to have hacked it in." >&4
8964 sockethdr="-I/usr/netinclude"
8967 echo "Found Berkeley sockets interface in lib$net." >& 4
8968 if $contains setsockopt libc.list >/dev/null 2>&1; then
8971 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
8978 if test "X$d_socket" != "X$define"; then
8979 echo "or anywhere else I see." >&4
8987 : see if socketpair exists
8988 set socketpair d_sockpair
8993 echo "Checking the availability of certain socket constants..." >& 4
8994 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
8995 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
8997 #include <sys/types.h>
8998 #include <sys/socket.h>
9004 set try; if eval $compile; then
9007 set d_${enum}; eval $setvar
9011 : see if sys/select.h has to be included
9012 set sys/select.h i_sysselct
9015 : see if we should include time.h, sys/time.h, or both
9017 if test "X$timeincl" = X; then
9018 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9019 $echo $n "I'm now running the test program...$c"
9020 $cat >try.c <<'EOCP'
9021 #include <sys/types.h>
9026 #ifdef SYSTIMEKERNEL
9029 #include <sys/time.h>
9032 #include <sys/select.h>
9041 struct timezone tzp;
9043 if (foo.tm_sec == foo.tm_sec)
9046 if (bar.tv_sec == bar.tv_sec)
9053 for s_timezone in '-DS_TIMEZONE' ''; do
9055 for s_timeval in '-DS_TIMEVAL' ''; do
9056 for i_systimek in '' '-DSYSTIMEKERNEL'; do
9057 for i_time in '' '-DI_TIME'; do
9058 for i_systime in '-DI_SYSTIME' ''; do
9061 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
9062 if eval $compile; then
9063 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
9067 $echo $n "Succeeded with $flags$c"
9079 *SYSTIMEKERNEL*) i_systimek="$define"
9080 timeincl=`./findhdr sys/time.h`
9081 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
9082 *) i_systimek="$undef";;
9085 *I_TIME*) i_time="$define"
9086 timeincl=`./findhdr time.h`" $timeincl"
9087 echo "We'll include <time.h>." >&4;;
9088 *) i_time="$undef";;
9091 *I_SYSTIME*) i_systime="$define"
9092 timeincl=`./findhdr sys/time.h`" $timeincl"
9093 echo "We'll include <sys/time.h>." >&4;;
9094 *) i_systime="$undef";;
9099 : check for fd_set items
9102 Checking to see how well your C compiler handles fd_set and friends ...
9104 $cat >fd_set.c <<EOCP
9105 #$i_systime I_SYS_TIME
9106 #$i_sysselct I_SYS_SELECT
9107 #$d_socket HAS_SOCKET
9108 #include <sys/types.h>
9110 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
9113 #include <sys/time.h>
9116 #include <sys/select.h>
9125 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
9132 set fd_set -DTRYBITS
9133 if eval $compile; then
9134 d_fds_bits="$define"
9136 echo "Well, your system knows about the normal fd_set typedef..." >&4
9138 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
9139 d_fd_macros="$define"
9142 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
9144 d_fd_macros="$undef"
9148 Hmm, your compiler has some difficulty with fd_set. Checking further...
9151 if eval $compile; then
9154 echo "Well, your system has some sort of fd_set available..." >&4
9156 echo "and you have the normal fd_set macros." >&4
9157 d_fd_macros="$define"
9160 but not the normal fd_set macros! Gross! More work for me...
9162 d_fd_macros="$undef"
9165 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
9168 d_fd_macros="$undef"
9173 : see if fgetpos exists
9174 set fgetpos d_fgetpos
9177 : see if flock exists
9181 : see if fork exists
9185 : see if pathconf exists
9186 set pathconf d_pathconf
9189 : see if fpathconf exists
9190 set fpathconf d_fpathconf
9194 : check for fpos64_t
9196 echo "Checking to see if you have fpos64_t..." >&4
9199 int main() { fpos64_t x = 7; }
9202 if eval $compile; then
9204 echo "You have fpos64_t."
9207 echo "You do not have fpos64_t."
9209 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
9216 : see if frexpl exists
9220 hasstruct='varname=$1; struct=$2; shift; shift;
9221 while $test $# -ge 2; do
9223 $define) echo "#include <$2>";;
9227 echo "int main () { struct $struct foo; }" >> try.c;
9229 if eval $compile; then
9238 : see if this is a sys/param system
9239 set sys/param.h i_sysparam
9242 : see if this is a sys/mount.h system
9243 set sys/mount.h i_sysmount
9246 : see if sys/types.h has to be included
9247 set sys/types.h i_systypes
9252 echo "Checking to see if your system supports struct fs_data..." >&4
9253 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
9255 case "$d_fs_data_s" in
9256 "$define") echo "Yes, it does." ;;
9257 *) echo "No, it doesn't." ;;
9260 : see if fseeko exists
9264 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
9267 : see if fsetpos exists
9268 set fsetpos d_fsetpos
9272 : see if fstatfs exists
9273 set fstatfs d_fstatfs
9277 : see if statvfs exists
9278 set statvfs d_statvfs
9281 : see if fstatvfs exists
9282 set fstatvfs d_fstatvfs
9286 : see if fsync exists
9290 : see if ftello exists
9294 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
9297 : see if getcwd exists
9301 : see if getespwnam exists
9302 set getespwnam d_getespwnam
9306 : see if getfsstat exists
9307 set getfsstat d_getfsstat
9310 : see if getgrent exists
9311 set getgrent d_getgrent
9314 : see if gethostbyaddr exists
9315 set gethostbyaddr d_gethbyaddr
9318 : see if gethostbyname exists
9319 set gethostbyname d_gethbyname
9322 : see if gethostent exists
9323 set gethostent d_gethent
9326 : see how we will look up host name
9329 if set gethostname val -f d_gethname; eval $csym; $val; then
9330 echo 'gethostname() found.' >&4
9331 d_gethname="$define"
9334 if set uname val -f d_uname; eval $csym; $val; then
9337 uname() was found, but you're running xenix, and older versions of xenix
9338 have a broken uname(). If you don't really know whether your xenix is old
9339 enough to have a broken system call, use the default answer.
9346 rp='Is your uname() broken?'
9349 n*) d_uname="$define"; call=uname;;
9352 echo 'uname() found.' >&4
9359 case "$d_gethname" in
9360 '') d_gethname="$undef";;
9363 '') d_uname="$undef";;
9365 case "$d_uname$d_gethname" in
9370 Every now and then someone has a $call() that lies about the hostname
9371 but can't be fixed for political or economic reasons. If you wish, I can
9372 pretend $call() isn't there and maybe compute hostname at run-time
9373 thanks to the '$phostname' command.
9376 rp="Shall I ignore $call() from now on?"
9379 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
9382 case "$phostname" in
9384 *) case "$aphostname" in
9390 file=`./loc $file $file $pth`
9391 aphostname=`echo $file $*`
9396 case "$d_uname$d_gethname" in
9399 case "$phostname" in
9401 echo "There will be no way for $package to get your hostname." >&4;;
9403 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
9407 case "$d_phostname" in
9408 '') d_phostname="$undef";;
9411 : see if this is a netdb.h system
9415 : see if prototypes for various gethostxxx netdb.h functions are available
9417 set d_gethostprotos gethostent $i_netdb netdb.h
9420 : see if getlogin exists
9421 set getlogin d_getlogin
9424 : see if getmnt exists
9428 : see if getmntent exists
9429 set getmntent d_getmntent
9432 : see if getnetbyaddr exists
9433 set getnetbyaddr d_getnbyaddr
9436 : see if getnetbyname exists
9437 set getnetbyname d_getnbyname
9440 : see if getnetent exists
9441 set getnetent d_getnent
9444 : see if prototypes for various getnetxxx netdb.h functions are available
9446 set d_getnetprotos getnetent $i_netdb netdb.h
9449 : see if getpagesize exists
9450 set getpagesize d_getpagsz
9454 : see if getprotobyname exists
9455 set getprotobyname d_getpbyname
9458 : see if getprotobynumber exists
9459 set getprotobynumber d_getpbynumber
9462 : see if getprotoent exists
9463 set getprotoent d_getpent
9466 : see if getpgid exists
9467 set getpgid d_getpgid
9470 : see if getpgrp2 exists
9471 set getpgrp2 d_getpgrp2
9474 : see if getppid exists
9475 set getppid d_getppid
9478 : see if getpriority exists
9479 set getpriority d_getprior
9482 : see if prototypes for various getprotoxxx netdb.h functions are available
9484 set d_getprotoprotos getprotoent $i_netdb netdb.h
9487 : see if getprpwnam exists
9488 set getprpwnam d_getprpwnam
9491 : see if getpwent exists
9492 set getpwent d_getpwent
9496 : see if getservbyname exists
9497 set getservbyname d_getsbyname
9500 : see if getservbyport exists
9501 set getservbyport d_getsbyport
9504 : see if getservent exists
9505 set getservent d_getsent
9508 : see if prototypes for various getservxxx netdb.h functions are available
9510 set d_getservprotos getservent $i_netdb netdb.h
9513 : see if getspnam exists
9514 set getspnam d_getspnam
9517 : see if gettimeofday or ftime exists
9518 set gettimeofday d_gettimeod
9520 case "$d_gettimeod" in
9526 val="$undef"; set d_ftime; eval $setvar
9529 case "$d_gettimeod$d_ftime" in
9532 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
9536 : see if this is an grp system
9542 xxx=`./findhdr grp.h`
9543 $cppstdin $cppflags $cppminus < $xxx >$$.h
9545 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
9557 set d_grpasswd; eval $setvar
9561 : see if hasmntopt exists
9562 set hasmntopt d_hasmntopt
9565 : see if this is a netinet/in.h or sys/in.h system
9566 set netinet/in.h i_niin sys/in.h i_sysin
9569 : see if arpa/inet.h has to be included
9570 set arpa/inet.h i_arpainet
9573 : see if htonl --and friends-- exists
9578 : Maybe they are macros.
9583 #include <sys/types.h>
9584 #$i_niin I_NETINET_IN
9586 #$i_arpainet I_ARPA_INET
9588 #include <netinet/in.h>
9594 #include <arpa/inet.h>
9597 printf("Defined as a macro.");
9600 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
9601 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
9603 echo "But it seems to be defined as a macro." >&4
9611 : see if iconv exists
9617 if set index val -f; eval $csym; $val; then
9618 if set strchr val -f d_strchr; eval $csym; $val; then
9619 if $contains strchr "$strings" >/dev/null 2>&1 ; then
9622 echo "strchr() found." >&4
9626 echo "index() found." >&4
9631 echo "index() found." >&4
9634 if set strchr val -f d_strchr; eval $csym; $val; then
9637 echo "strchr() found." >&4
9639 echo "No index() or strchr() found!" >&4
9644 set d_strchr; eval $setvar
9646 set d_index; eval $setvar
9648 : check whether inet_aton exists
9649 set inet_aton d_inetaton
9652 : see if inttypes.h is available
9653 : we want a real compile instead of Inhdr because some systems
9654 : have an inttypes.h which includes non-existent headers
9657 #include <inttypes.h>
9659 static int32_t foo32 = 0x12345678;
9663 if eval $compile; then
9664 echo "<inttypes.h> found." >&4
9667 echo "<inttypes.h> NOT found." >&4
9676 echo "Checking to see if you have int64_t..." >&4
9678 #include <sys/types.h>
9679 #$i_inttypes I_INTTYPES
9681 #include <inttypes.h>
9683 int main() { int64_t x = 7; }
9686 if eval $compile; then
9688 echo "You have int64_t."
9691 echo "You do not have int64_t."
9699 $cat >isascii.c <<'EOCP'
9711 if eval $compile; then
9712 echo "isascii() found." >&4
9715 echo "isascii() NOT found." >&4
9722 : see if isnan exists
9726 : see if isnanl exists
9730 : see if killpg exists
9734 : see if lchown exists
9736 $cat > try.c <<'EOCP'
9737 /* System header to define __stub macros and hopefully few prototypes,
9738 which can conflict with char lchown(); below. */
9740 /* Override any gcc2 internal prototype to avoid an error. */
9741 /* We use char because int might match the return type of a gcc2
9742 builtin and then its argument prototype would still apply. */
9745 /* The GNU C library defines this for functions which it implements
9746 to always fail with ENOSYS. Some functions are actually named
9747 something starting with __ and the normal name is an alias. */
9748 #if defined (__stub_lchown) || defined (__stub___lchown)
9756 if eval $compile; then
9757 $echo "lchown() found." >&4
9760 $echo "lchown() NOT found." >&4
9766 : See if number of significant digits in a double precision number is known
9768 $cat >ldbl_dig.c <<EOM
9778 printf("Contains LDBL_DIG");
9781 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
9782 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
9783 echo "LDBL_DIG found." >&4
9786 echo "LDBL_DIG NOT found." >&4
9793 : see if link exists
9797 : see if localeconv exists
9798 set localeconv d_locconv
9801 : see if lockf exists
9805 : check for long long
9807 echo "Checking to see if you have long long..." >&4
9808 echo 'int main() { long long x = 7; return 0; }' > try.c
9810 if eval $compile; then
9812 echo "You have long long."
9815 echo "You do not have long long."
9821 : check for length of long long
9822 case "${d_longlong}${longlongsize}" in
9825 echo "Checking to see how big your long longs are..." >&4
9826 $cat >try.c <<'EOCP'
9830 printf("%d\n", (int)sizeof(long long));
9835 if eval $compile_ok; then
9836 longlongsize=`./try$exe_ext`
9837 echo "Your long longs are $longlongsize bytes long."
9841 echo "(I can't seem to compile the test program. Guessing...)"
9842 rp="What is the size of a long long (in bytes)?"
9846 if $test "X$longsize" = "X$longlongsize"; then
9847 echo "(That isn't any different from an ordinary long.)"
9853 : see if prototype for lseek is available
9855 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
9858 : see if lstat exists
9862 : see if madvise exists
9863 set madvise d_madvise
9866 : see if mblen exists
9870 : see if mbstowcs exists
9871 set mbstowcs d_mbstowcs
9874 : see if mbtowc exists
9878 : see if memchr exists
9882 : see if memcmp exists
9886 : see if memcpy exists
9890 : see if memmove exists
9891 set memmove d_memmove
9894 : see if memset exists
9898 : see if mkdir exists
9902 : see if mkdtemp exists
9903 set mkdtemp d_mkdtemp
9906 : see if mkfifo exists
9910 : see if mkstemp exists
9911 set mkstemp d_mkstemp
9914 : see if mkstemps exists
9915 set mkstemps d_mkstemps
9918 : see if mktime exists
9922 : see if this is a sys/mman.h system
9923 set sys/mman.h i_sysmman
9926 : see if mmap exists
9929 : see what shmat returns
9930 : default to something harmless
9932 case "$i_sysmman$d_mmap" in
9934 $cat >mmap.c <<'END'
9935 #include <sys/mman.h>
9938 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
9943 echo "and it returns ($mmaptype)." >&4
9949 : see if modfl exists
9953 : see if mprotect exists
9954 set mprotect d_mprotect
9957 : see if msgctl exists
9961 : see if msgget exists
9965 : see if msgsnd exists
9969 : see if msgrcv exists
9973 : see how much of the 'msg*(2)' library is present.
9976 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
9977 *"$undef"*) h_msg=false;;
9981 case "`ipcs 2>&1`" in
9982 "SVID messages"*"not configured"*)
9983 echo "Your $osname does not have the msg*(2) configured." >&4
9998 : we could also check for sys/ipc.h ...
9999 if $h_msg && $test `./findhdr sys/msg.h`; then
10000 echo "You have the full msg*(2) library." >&4
10003 echo "You don't have the full msg*(2) library." >&4
10009 : see if msync exists
10013 : see if munmap exists
10014 set munmap d_munmap
10017 : see if nice exists
10023 echo "Checking which 64-bit integer type we could use..." >&4
10029 val='"unsigned int"'
10034 *) case "$longsize" in
10038 val='"unsigned long"'
10043 *) case "$d_longlong:$longlongsize" in
10048 val='"unsigned long long"'
10053 *) case "$d_int64_t" in
10071 case "$quadtype" in
10072 '') echo "Alas, no 64-bit integer types in sight." >&4
10075 *) if test X"$use64bitint" = Xdefine -o X"$longsize" = X8; then
10080 echo "We $verb use '$quadtype' for 64-bit integers." >&4
10085 : check for length of character
10087 case "$charsize" in
10089 echo "Checking to see how big your characters are (hey, you never know)..." >&4
10090 $cat >try.c <<'EOCP'
10094 printf("%d\n", (int)sizeof(char));
10099 if eval $compile_ok; then
10103 echo "(I can't seem to compile the test program. Guessing...)"
10110 rp="What is the size of a character (in bytes)?"
10115 : check for volatile keyword
10117 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
10118 $cat >try.c <<'EOCP'
10121 typedef struct _goo_struct goo_struct;
10122 goo_struct * volatile goo = ((goo_struct *)0);
10123 struct _goo_struct {
10128 typedef unsigned short foo_t;
10129 char *volatile foo;
10131 volatile foo_t blech;
10135 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
10137 echo "Yup, it does."
10140 echo "Nope, it doesn't."
10148 $echo "Choosing the C types to be used for Perl's internal types..." >&4
10150 case "$use64bitint:$d_quad:$quadtype" in
10153 uvtype="$uquadtype"
10158 uvtype="unsigned long"
10164 case "$uselongdouble:$d_longdbl" in
10166 nvtype="long double"
10167 nvsize=$longdblsize
10174 $echo "(IV will be "$ivtype", $ivsize bytes)"
10175 $echo "(UV will be "$uvtype", $uvsize bytes)"
10176 $echo "(NV will be "$nvtype", $nvsize bytes)"
10179 #$i_inttypes I_INTTYPES
10181 #include <inttypes.h>
10186 int8_t i = INT8_MAX;
10187 uint8_t u = UINT8_MAX;
10188 printf("int8_t\n");
10191 int16_t i = INT16_MAX;
10192 uint16_t i = UINT16_MAX;
10193 printf("int16_t\n");
10196 int32_t i = INT32_MAX;
10197 uint32_t u = UINT32_MAX;
10198 printf("int32_t\n");
10204 '') case "$charsize" in
10206 u8type="unsigned char"
10215 if eval $compile; then
10216 case "`./try$exe_ext`" in
10217 int8_t) i8type=int8_t
10227 '') if $test $charsize -ge 1; then
10229 u8type="unsigned char"
10237 '') case "$shortsize" in
10239 u16type="unsigned short"
10247 '') set try -DINT16
10248 if eval $compile; then
10249 case "`./try$exe_ext`" in
10261 '') if $test $shortsize -ge 2; then
10263 u16type="unsigned short"
10271 '') case "$longsize" in
10273 u32type="unsigned long"
10277 *) case "$intsize" in
10279 u32type="unsigned int"
10289 '') set try -DINT32
10290 if eval $compile; then
10291 case "`./try$exe_ext`" in
10303 '') if $test $intsize -ge 4; then
10305 u32type="unsigned int"
10313 '') case "$d_quad:$quadtype" in
10315 i64type="$quadtype"
10316 u64type="$uquadtype"
10324 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
10325 : volatile so that the compiler has to store it out to memory.
10326 if test X"$d_volatile" = X"$define"; then
10331 #include <sys/types.h>
10332 #include <signal.h>
10334 $volatile int bletched = 0;
10335 $signal_t blech(s) int s; { bletched = 1; }
10340 int n = 8 * $uvsize;
10343 signal(SIGFPE, blech);
10346 for (i = 0; i < n; i++) {
10347 u = u << 1 | ($uvtype)1;
10349 if (($uvtype)d != u)
10353 d = ($nvtype)(u - 1);
10354 if (($uvtype)d != (u - 1))
10362 printf("%d\n", ((i == n) ? -n : i));
10368 d_nv_preserves_uv="$undef"
10369 if eval $compile; then
10370 d_nv_preserves_uv_bits="`./try$exe_ext`"
10372 case "$d_nv_preserves_uv_bits" in
10374 d_nv_preserves_uv_bits=`expr 0 - $d_nv_preserves_uv_bits`
10375 $echo "Your NVs can preserve all $d_nv_preserves_uv_bits bits of your UVs." 2>&1
10376 d_nv_preserves_uv="$define"
10378 [1-9]*) $echo "Your NVs can preserve only $d_nv_preserves_uv_bits bits of your UVs." 2>&1
10379 d_nv_preserves_uv="$undef" ;;
10380 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
10381 d_nv_preserves_uv_bits="$undef" ;;
10387 : check for off64_t
10389 echo "Checking to see if you have off64_t..." >&4
10391 #include <sys/types.h>
10392 #include <unistd.h>
10393 int main() { off64_t x = 7; }
10396 if eval $compile; then
10398 echo "You have off64_t."
10401 echo "You do not have off64_t."
10402 case "$lseeksize" in
10403 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
10410 : see if POSIX threads are available
10411 set pthread.h i_pthread
10417 : how to create joinable pthreads
10418 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
10420 echo "Checking what constant to use for creating joinable pthreads..." >&4
10421 $cat >try.c <<'EOCP'
10422 #include <pthread.h>
10424 int detachstate = JOINABLE;
10427 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
10428 if eval $compile; then
10429 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
10430 val="$undef" # Yes, undef.
10431 set d_old_pthread_create_joinable
10434 set old_pthread_create_joinable
10437 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
10438 if eval $compile; then
10439 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
10441 set d_old_pthread_create_joinable
10443 val=PTHREAD_CREATE_UNDETACHED
10444 set old_pthread_create_joinable
10447 set try -DJOINABLE=__UNDETACHED
10448 if eval $compile; then
10449 echo "You seem to use __UNDETACHED." >&4
10451 set d_old_pthread_create_joinable
10454 set old_pthread_create_joinable
10457 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
10459 set d_old_pthread_create_joinable
10462 set old_pthread_create_joinable
10469 d_old_pthread_create_joinable="$undef"
10470 old_pthread_create_joinable=""
10473 : see if pause exists
10477 : see if pipe exists
10481 : see if poll exists
10486 : see whether the various POSIXish _yields exist
10488 #include <pthread.h>
10494 #ifdef PTHREAD_YIELD
10497 #ifdef PTHREAD_YIELD_NULL
10498 pthread_yield(NULL);
10504 : see if sched_yield exists
10505 set try -DSCHED_YIELD
10506 if eval $compile; then
10508 sched_yield='sched_yield()'
10512 case "$usethreads" in
10515 $define) echo 'sched_yield() found.' >&4 ;;
10516 *) echo 'sched_yield() NOT found.' >&4 ;;
10522 : see if pthread_yield exists
10523 set try -DPTHREAD_YIELD
10524 if eval $compile; then
10526 case "$sched_yield" in
10527 '') sched_yield='pthread_yield()' ;;
10530 set try -DPTHREAD_YIELD_NULL
10531 if eval $compile; then
10533 case "$sched_yield" in
10534 '') sched_yield='pthread_yield(NULL)' ;;
10540 case "$usethreads" in
10543 $define) echo 'pthread_yield() found.' >&4 ;;
10544 *) echo 'pthread_yield() NOT found.' >&4 ;;
10548 set d_pthread_yield
10551 case "$sched_yield" in
10552 '') sched_yield=undef ;;
10557 : see if this is a pwd.h system
10563 xxx=`./findhdr pwd.h`
10564 $cppstdin $cppflags $cppminus < $xxx >$$.h
10566 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
10574 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
10582 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
10590 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
10598 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
10606 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
10614 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
10622 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
10634 set d_pwquota; eval $setvar
10635 set d_pwage; eval $setvar
10636 set d_pwchange; eval $setvar
10637 set d_pwclass; eval $setvar
10638 set d_pwexpire; eval $setvar
10639 set d_pwcomment; eval $setvar
10640 set d_pwgecos; eval $setvar
10641 set d_pwpasswd; eval $setvar
10645 : see if readdir and friends exist
10646 set readdir d_readdir
10648 set seekdir d_seekdir
10650 set telldir d_telldir
10652 set rewinddir d_rewinddir
10655 : see if readlink exists
10656 set readlink d_readlink
10659 : see if rename exists
10660 set rename d_rename
10663 : see if rmdir exists
10667 : see if memory.h is available.
10672 : See if it conflicts with string.h
10678 $cppstdin $cppflags $cppminus < $strings > mem.h
10679 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
10681 echo "We won't be including <memory.h>."
10691 : can bcopy handle overlapping blocks?
10696 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
10698 #$i_memory I_MEMORY
10699 #$i_stdlib I_STDLIB
10700 #$i_string I_STRING
10701 #$i_unistd I_UNISTD
10703 $cat >>try.c <<'EOCP'
10706 # include <memory.h>
10709 # include <stdlib.h>
10712 # include <string.h>
10714 # include <strings.h>
10717 # include <unistd.h> /* Needed for NetBSD */
10721 char buf[128], abc[128];
10727 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
10729 for (align = 7; align >= 0; align--) {
10730 for (len = 36; len; len--) {
10732 bcopy(abc, b, len);
10733 for (off = 1; off <= len; off++) {
10734 bcopy(b, b+off, len);
10735 bcopy(b+off, b, len);
10736 if (bcmp(b, abc, len))
10745 if eval $compile_ok; then
10746 if ./try 2>/dev/null; then
10747 echo "Yes, it can."
10750 echo "It can't, sorry."
10751 case "$d_memmove" in
10752 "$define") echo "But that's Ok since you have memmove()." ;;
10756 echo "(I can't compile the test program, so we'll assume not...)"
10757 case "$d_memmove" in
10758 "$define") echo "But that's Ok since you have memmove()." ;;
10763 $rm -f try.* try core
10767 : can memcpy handle overlapping blocks?
10769 case "$d_memcpy" in
10772 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
10774 #$i_memory I_MEMORY
10775 #$i_stdlib I_STDLIB
10776 #$i_string I_STRING
10777 #$i_unistd I_UNISTD
10779 $cat >>try.c <<'EOCP'
10782 # include <memory.h>
10785 # include <stdlib.h>
10788 # include <string.h>
10790 # include <strings.h>
10793 # include <unistd.h> /* Needed for NetBSD */
10797 char buf[128], abc[128];
10803 /* Copy "abcde..." string to char abc[] so that gcc doesn't
10804 try to store the string in read-only memory. */
10805 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
10807 for (align = 7; align >= 0; align--) {
10808 for (len = 36; len; len--) {
10810 memcpy(b, abc, len);
10811 for (off = 1; off <= len; off++) {
10812 memcpy(b+off, b, len);
10813 memcpy(b, b+off, len);
10814 if (memcmp(b, abc, len))
10823 if eval $compile_ok; then
10824 if ./try 2>/dev/null; then
10825 echo "Yes, it can."
10828 echo "It can't, sorry."
10829 case "$d_memmove" in
10830 "$define") echo "But that's Ok since you have memmove()." ;;
10834 echo "(I can't compile the test program, so we'll assume not...)"
10835 case "$d_memmove" in
10836 "$define") echo "But that's Ok since you have memmove()." ;;
10841 $rm -f try.* try core
10845 : can memcmp be trusted to compare relative magnitude?
10847 case "$d_memcmp" in
10850 echo "Checking if your memcmp() can compare relative magnitude..." >&4
10852 #$i_memory I_MEMORY
10853 #$i_stdlib I_STDLIB
10854 #$i_string I_STRING
10855 #$i_unistd I_UNISTD
10857 $cat >>try.c <<'EOCP'
10860 # include <memory.h>
10863 # include <stdlib.h>
10866 # include <string.h>
10868 # include <strings.h>
10871 # include <unistd.h> /* Needed for NetBSD */
10877 if ((a < b) && memcmp(&a, &b, 1) < 0)
10883 if eval $compile_ok; then
10884 if ./try 2>/dev/null; then
10885 echo "Yes, it can."
10888 echo "No, it can't (it uses signed chars)."
10891 echo "(I can't compile the test program, so we'll assume not...)"
10895 $rm -f try.* try core
10899 : see if prototype for sbrk is available
10901 set d_sbrkproto sbrk $i_unistd unistd.h
10904 : see if select exists
10905 set select d_select
10908 : see if semctl exists
10909 set semctl d_semctl
10912 : see if semget exists
10913 set semget d_semget
10916 : see if semop exists
10920 : see how much of the 'sem*(2)' library is present.
10923 case "$d_semctl$d_semget$d_semop" in
10924 *"$undef"*) h_sem=false;;
10928 case "`ipcs 2>&1`" in
10929 "SVID messages"*"not configured"*)
10930 echo "Your $osname does not have the sem*(2) configured." >&4
10933 set semctl d_semctl
10935 set semget d_semget
10943 : we could also check for sys/ipc.h ...
10944 if $h_sem && $test `./findhdr sys/sem.h`; then
10945 echo "You have the full sem*(2) library." >&4
10948 echo "You don't have the full sem*(2) library." >&4
10954 : see whether sys/sem.h defines union semun
10956 $cat > try.c <<'END'
10957 #include <sys/types.h>
10958 #include <sys/ipc.h>
10959 #include <sys/sem.h>
10960 int main () { union semun semun; semun.buf = 0; }
10963 if eval $compile; then
10964 echo "You have union semun in <sys/sem.h>." >&4
10967 echo "You do not have union semun in <sys/sem.h>." >&4
10970 $rm -f try try.c try.h
10974 : see how to do semctl IPC_STAT
10977 : see whether semctl IPC_STAT can use union semun
10982 # define S_IRUSR S_IREAD
10983 # define S_IWUSR S_IWRITE
10984 # define S_IXUSR S_IEXEC
10986 # define S_IRUSR 0400
10987 # define S_IWUSR 0200
10988 # define S_IXUSR 0100
10990 # define S_IRGRP (S_IRUSR>>3)
10991 # define S_IWGRP (S_IWUSR>>3)
10992 # define S_IXGRP (S_IXUSR>>3)
10993 # define S_IROTH (S_IRUSR>>6)
10994 # define S_IWOTH (S_IWUSR>>6)
10995 # define S_IXOTH (S_IXUSR>>6)
10998 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
10999 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
11000 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
11005 #include <sys/types.h>
11006 #include <sys/ipc.h>
11007 #include <sys/sem.h>
11008 #include <sys/stat.h>
11015 #$d_union_semun HAS_UNION_SEMUN
11018 #ifndef HAS_UNION_SEMUN
11021 struct semid_ds *buf;
11022 unsigned short *array;
11028 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
11029 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
11031 struct semid_ds argbuf;
11034 st = semctl(sem, 0, IPC_STAT, arg);
11038 # endif /* IPC_STAT */
11039 printf("semctl IPC_STAT failed: errno = %d\n", errno);
11041 if (semctl(sem, 0, IPC_RMID, arg) != 0)
11042 # endif /* IPC_RMID */
11043 printf("semctl IPC_RMID failed: errno = %d\n", errno);
11045 #endif /* IPC_PRIVATE && ... */
11046 printf("semget failed: errno = %d\n", errno);
11052 if eval $compile; then
11055 semun) val="$define" ;;
11061 case "$d_semctl_semun" in
11063 echo "You can use union semun for semctl IPC_STAT." >&4
11066 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
11071 : see whether semctl IPC_STAT can use struct semid_ds pointer
11072 $cat > try.c <<'END'
11073 #include <sys/types.h>
11074 #include <sys/ipc.h>
11075 #include <sys/sem.h>
11076 #include <sys/stat.h>
11084 struct semid_ds arg;
11087 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
11088 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
11091 st = semctl(sem, 0, IPC_STAT, &arg);
11093 printf("semid_ds\n");
11095 # endif /* IPC_STAT */
11096 printf("semctl IPC_STAT failed: errno = %d\n", errno);
11098 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
11099 # endif /* IPC_RMID */
11100 printf("semctl IPC_RMID failed: errno = %d\n", errno);
11102 #endif /* IPC_PRIVATE && ... */
11103 printf("semget failed: errno = %d\n", errno);
11110 if eval $compile; then
11113 semid_ds) val="$define" ;;
11117 set d_semctl_semid_ds
11119 case "$d_semctl_semid_ds" in
11121 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
11123 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
11130 # We do not have the full sem*(2) library, so assume we can not
11136 set d_semctl_semid_ds
11141 : see if setegid exists
11142 set setegid d_setegid
11145 : see if seteuid exists
11146 set seteuid d_seteuid
11149 : see if setgrent exists
11150 set setgrent d_setgrent
11153 : see if sethostent exists
11154 set sethostent d_sethent
11157 : see if setlinebuf exists
11158 set setlinebuf d_setlinebuf
11161 : see if setlocale exists
11162 set setlocale d_setlocale
11165 : see if setnetent exists
11166 set setnetent d_setnent
11169 : see if setprotoent exists
11170 set setprotoent d_setpent
11173 : see if setpgid exists
11174 set setpgid d_setpgid
11177 : see if setpgrp2 exists
11178 set setpgrp2 d_setpgrp2
11181 : see if setpriority exists
11182 set setpriority d_setprior
11185 : see if setproctitle exists
11186 set setproctitle d_setproctitle
11189 : see if setpwent exists
11190 set setpwent d_setpwent
11193 : see if setregid exists
11194 set setregid d_setregid
11196 set setresgid d_setresgid
11199 : see if setreuid exists
11200 set setreuid d_setreuid
11202 set setresuid d_setresuid
11205 : see if setrgid exists
11206 set setrgid d_setrgid
11209 : see if setruid exists
11210 set setruid d_setruid
11213 : see if setservent exists
11214 set setservent d_setsent
11217 : see if setsid exists
11218 set setsid d_setsid
11221 : see if setvbuf exists
11222 set setvbuf d_setvbuf
11225 : see if sfio.h is available
11230 : see if sfio library is available
11241 : Ok, but do we want to use it.
11245 true|$define|[yY]*) dflt='y';;
11248 echo "$package can use the sfio library, but it is experimental."
11249 case "$useperlio" in
11251 echo "For sfio also the PerlIO abstraction layer is needed."
11252 echo "Earlier you said you wouldn't want that."
11255 rp="You seem to have sfio available, do you want to try using it?"
11258 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
11259 useperlio="$define"
11262 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
11264 : Remove sfio from list of libraries to use
11265 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
11268 echo "libs = $libs" >&4
11272 *) case "$usesfio" in
11273 true|$define|[yY]*)
11274 echo "Sorry, cannot find sfio on this machine." >&4
11275 echo "Ignoring your setting of usesfio=$usesfio." >&4
11284 $define) usesfio='true';;
11285 *) usesfio='false';;
11288 : see if shmctl exists
11289 set shmctl d_shmctl
11292 : see if shmget exists
11293 set shmget d_shmget
11296 : see if shmat exists
11299 : see what shmat returns
11302 $cat >shmat.c <<'END'
11303 #include <sys/shm.h>
11306 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
11311 echo "and it returns ($shmattype)." >&4
11312 : see if a prototype for shmat is available
11313 xxx=`./findhdr sys/shm.h`
11314 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
11315 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
11326 set d_shmatprototype
11329 : see if shmdt exists
11333 : see how much of the 'shm*(2)' library is present.
11336 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
11337 *"$undef"*) h_shm=false;;
11341 case "`ipcs 2>&1`" in
11342 "SVID shared memory"*"not configured"*)
11343 echo "Your $osname does not have the shm*(2) configured." >&4
11346 set shmctl d_shmctl
11348 set shmget d_shmget
11358 : we could also check for sys/ipc.h ...
11359 if $h_shm && $test `./findhdr sys/shm.h`; then
11360 echo "You have the full shm*(2) library." >&4
11363 echo "You don't have the full shm*(2) library." >&4
11370 : see if we have sigaction
11371 if set sigaction val -f d_sigaction; eval $csym; $val; then
11372 echo 'sigaction() found.' >&4
11373 $cat > try.c <<'EOP'
11375 #include <sys/types.h>
11376 #include <signal.h>
11379 struct sigaction act, oact;
11381 oact.sa_handler = 0;
11382 /* so that act and oact are used */
11383 exit(act.sa_flags == 0 && oact.sa_handler == 0);
11387 if eval $compile_ok; then
11390 echo "But you don't seem to have a useable struct sigaction." >&4
11394 echo 'sigaction NOT found.' >&4
11397 set d_sigaction; eval $setvar
11398 $rm -f try try$_o try.c
11400 : see if sigsetjmp exists
11402 case "$d_sigsetjmp" in
11404 $cat >try.c <<'EOP'
11405 #include <setjmp.h>
11410 if (sigsetjmp(env,1))
11413 siglongjmp(env, 1);
11418 if eval $compile; then
11419 if ./try >/dev/null 2>&1; then
11420 echo "POSIX sigsetjmp found." >&4
11424 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
11430 echo "sigsetjmp not found." >&4
11434 *) val="$d_sigsetjmp"
11435 case "$d_sigsetjmp" in
11436 $define) echo "POSIX sigsetjmp found." >&4;;
11437 $undef) echo "sigsetjmp not found." >&4;;
11445 : see if socks5_init exists
11446 set socks5_init d_socks5_init
11449 : see if sys/stat.h is available
11450 set sys/stat.h i_sysstat
11454 : see if stat knows about block sizes
11456 echo "Checking to see if your struct stat has st_blocks field..." >&4
11457 set d_statblks stat st_blocks $i_sysstat sys/stat.h
11461 : see if this is a sys/vfs.h system
11462 set sys/vfs.h i_sysvfs
11466 : see if this is a sys/statfs.h system
11467 set sys/statfs.h i_sysstatfs
11472 echo "Checking to see if your system supports struct statfs..." >&4
11473 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
11475 case "$d_statfs_s" in
11476 "$define") echo "Yes, it does." ;;
11477 *) echo "No, it doesn't." ;;
11482 : see if struct statfs knows about f_flags
11483 case "$d_statfs_s" in
11486 echo "Checking to see if your struct statfs has f_flags field..." >&4
11487 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
11491 set d_statfs_f_flags
11495 case "$d_statfs_f_flags" in
11496 "$define") echo "Yes, it does." ;;
11497 *) echo "No, it doesn't." ;;
11500 : see if _ptr and _cnt from stdio act std
11503 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
11504 echo "(Looks like you have stdio.h from BSD.)"
11505 case "$stdio_ptr" in
11506 '') stdio_ptr='((fp)->_p)'
11509 *) ptr_lval=$d_stdio_ptr_lval;;
11511 case "$stdio_cnt" in
11512 '') stdio_cnt='((fp)->_r)'
11515 *) cnt_lval=$d_stdio_cnt_lval;;
11517 case "$stdio_base" in
11518 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
11520 case "$stdio_bufsiz" in
11521 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
11523 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
11524 echo "(Looks like you have stdio.h from Linux.)"
11525 case "$stdio_ptr" in
11526 '') stdio_ptr='((fp)->_IO_read_ptr)'
11529 *) ptr_lval=$d_stdio_ptr_lval;;
11531 case "$stdio_cnt" in
11532 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
11535 *) cnt_lval=$d_stdio_cnt_lval;;
11537 case "$stdio_base" in
11538 '') stdio_base='((fp)->_IO_read_base)';;
11540 case "$stdio_bufsiz" in
11541 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
11544 case "$stdio_ptr" in
11545 '') stdio_ptr='((fp)->_ptr)'
11548 *) ptr_lval=$d_stdio_ptr_lval;;
11550 case "$stdio_cnt" in
11551 '') stdio_cnt='((fp)->_cnt)'
11554 *) cnt_lval=$d_stdio_cnt_lval;;
11556 case "$stdio_base" in
11557 '') stdio_base='((fp)->_base)';;
11559 case "$stdio_bufsiz" in
11560 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
11564 : test whether _ptr and _cnt really work
11565 echo "Checking how std your stdio is..." >&4
11568 #define FILE_ptr(fp) $stdio_ptr
11569 #define FILE_cnt(fp) $stdio_cnt
11571 FILE *fp = fopen("try.c", "r");
11574 18 <= FILE_cnt(fp) &&
11575 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
11583 if eval $compile; then
11585 echo "Your stdio acts pretty std."
11588 echo "Your stdio isn't very std."
11591 echo "Your stdio doesn't appear very std."
11597 : Can _ptr be used as an lvalue?
11598 case "$d_stdstdio$ptr_lval" in
11599 $define$define) val=$define ;;
11602 set d_stdio_ptr_lval
11605 : Can _cnt be used as an lvalue?
11606 case "$d_stdstdio$cnt_lval" in
11607 $define$define) val=$define ;;
11610 set d_stdio_cnt_lval
11614 : test whether setting _ptr sets _cnt as a side effect
11615 d_stdio_ptr_lval_sets_cnt="$undef"
11616 d_stdio_ptr_lval_nochange_cnt="$undef"
11617 case "$d_stdio_ptr_lval$d_stdstdio" in
11619 echo "Checking to see what happens if we set the stdio ptr..." >&4
11622 /* Can we scream? */
11623 /* Eat dust sed :-) */
11624 /* In the buffer space, no one can hear you scream. */
11625 #define FILE_ptr(fp) $stdio_ptr
11626 #define FILE_cnt(fp) $stdio_cnt
11627 #include <sys/types.h>
11629 FILE *fp = fopen("try.c", "r");
11634 puts("Fail even to read");
11637 c = getc(fp); /* Read away the first # */
11639 puts("Fail even to read");
11643 18 <= FILE_cnt(fp) &&
11644 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
11646 puts("Fail even to read");
11649 ptr = (char*) FILE_ptr(fp);
11650 cnt = (size_t)FILE_cnt(fp);
11652 FILE_ptr(fp) += 42;
11654 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
11655 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
11658 if (FILE_cnt(fp) <= 20) {
11659 printf ("Fail (<20 chars to test)");
11662 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
11663 puts("Fail compare");
11666 if (cnt == FILE_cnt(fp)) {
11667 puts("Pass_unchanged");
11670 if (FILE_cnt(fp) == (cnt - 42)) {
11671 puts("Pass_changed");
11674 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
11680 if eval $compile; then
11681 case `./try$exe_ext` in
11683 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
11684 d_stdio_ptr_lval_sets_cnt="$define" ;;
11686 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
11687 d_stdio_ptr_lval_nochange_cnt="$define" ;;
11689 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
11691 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
11694 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
11700 : see if _base is also standard
11702 case "$d_stdstdio" in
11706 #define FILE_base(fp) $stdio_base
11707 #define FILE_bufsiz(fp) $stdio_bufsiz
11709 FILE *fp = fopen("try.c", "r");
11712 19 <= FILE_bufsiz(fp) &&
11713 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
11720 if eval $compile; then
11722 echo "And its _base field acts std."
11725 echo "But its _base field isn't std."
11728 echo "However, it seems to be lacking the _base field."
11737 Checking how to access stdio streams by file descriptor number...
11739 case "$stdio_stream_array" in
11740 '') $cat >try.c <<EOCP
11743 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
11747 for s in _iob __iob __sF
11749 set try -DSTDIO_STREAM_ARRAY=$s
11750 if eval $compile; then
11751 case "`./try$exe_ext`" in
11752 yes) stdio_stream_array=$s; break ;;
11756 $rm -f try.* try$exe_ext
11758 case "$stdio_stream_array" in
11760 I can't figure out how to access stdio streams by file descriptor number.
11762 d_stdio_stream_array="$undef"
11765 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
11767 d_stdio_stream_array="$define"
11771 : see if strcoll exists
11772 set strcoll d_strcoll
11775 : check for structure copying
11777 echo "Checking to see if your C compiler can copy structs..." >&4
11778 $cat >try.c <<'EOCP'
11788 if $cc -c try.c >/dev/null 2>&1 ; then
11790 echo "Yup, it can."
11793 echo "Nope, it can't."
11799 : see if strerror and/or sys_errlist[] exist
11801 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
11802 if set strerror val -f d_strerror; eval $csym; $val; then
11803 echo 'strerror() found.' >&4
11804 d_strerror="$define"
11805 d_strerrm='strerror(e)'
11806 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
11807 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
11808 d_syserrlst="$define"
11810 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
11811 d_syserrlst="$undef"
11813 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
11814 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
11815 echo 'strerror() found in string header.' >&4
11816 d_strerror="$define"
11817 d_strerrm='strerror(e)'
11818 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
11819 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
11820 d_syserrlst="$define"
11822 echo "(You don't appear to have any sys_errlist[], how can this be?)"
11823 d_syserrlst="$undef"
11825 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
11826 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
11827 d_strerror="$undef"
11828 d_syserrlst="$define"
11829 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
11831 echo 'strerror() and sys_errlist[] NOT found.' >&4
11832 d_strerror="$undef"
11833 d_syserrlst="$undef"
11834 d_strerrm='"unknown"'
11838 : see if strtod exists
11839 set strtod d_strtod
11842 : see if strtol exists
11843 set strtol d_strtol
11846 : see if strtold exists
11847 set strtold d_strtold
11850 : see if strtoll exists
11851 set strtoll d_strtoll
11854 case "$d_longlong-$d_strtoll" in
11857 Checking whether your strtoll() works okay...
11859 $cat >try.c <<'EOCP'
11862 #define strtoll __strtoll
11865 #define strtoll _strtoll
11868 extern long long int strtoll(char *s, char **, int);
11869 static int bad = 0;
11870 int check(char *s, long long ell, int een) {
11873 gll = strtoll(s, 0, 10);
11874 if (!((gll == ell) && (errno == een)))
11878 check(" 1", 1LL, 0);
11879 check(" 0", 0LL, 0);
11880 check("-1", -1LL, 0);
11881 check("-9223372036854775808", -9223372036854775808LL, 0);
11882 check("-9223372036854775808", -9223372036854775808LL, 0);
11883 check(" 9223372036854775807", 9223372036854775807LL, 0);
11884 check("-9223372036854775808", -9223372036854775808LL, 0);
11885 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
11886 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
11892 if eval $compile; then
11895 ok) echo "Your strtoll() seems to be working okay." ;;
11897 Your strtoll() doesn't seem to be working okay.
11903 echo "(I can't seem to compile the test program--assuming it doesn't)"
11909 : see if strtoul exists
11910 set strtoul d_strtoul
11913 : see if strtoull exists
11914 set strtoull d_strtoull
11917 case "$d_longlong-$d_strtoull" in
11920 Checking whether your strtoull() works okay...
11922 $cat >try.c <<'EOCP'
11925 #define strtoull __strtoull
11928 extern unsigned long long int strtoull(char *s, char **, int);
11929 static int bad = 0;
11930 int check(char *s, long long eull, int een) {
11933 gull = strtoull(s, 0, 10);
11934 if (!((gull == eull) && (errno == een)))
11938 check(" 1", 1LL, 0);
11939 check(" 0", 0LL, 0);
11940 check("18446744073709551615", 18446744073709551615ULL, 0);
11941 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
11947 if eval $compile; then
11949 ok) echo "Your strtoull() seems to be working okay." ;;
11951 Your strtoull() doesn't seem to be working okay.
11953 d_strtoull="$undef"
11960 : see if strtouq exists
11961 set strtouq d_strtouq
11964 : see if strxfrm exists
11965 set strxfrm d_strxfrm
11968 : see if symlink exists
11969 set symlink d_symlink
11972 : see if syscall exists
11973 set syscall d_syscall
11976 : see if sysconf exists
11977 set sysconf d_sysconf
11980 : see if system exists
11981 set system d_system
11984 : see if tcgetpgrp exists
11985 set tcgetpgrp d_tcgetpgrp
11988 : see if tcsetpgrp exists
11989 set tcsetpgrp d_tcsetpgrp
11992 : see if prototype for telldir is available
11994 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
11997 : see if this is a sys/times.h system
11998 set sys/times.h i_systimes
12001 : see if times exists
12003 if set times val -f d_times; eval $csym; $val; then
12004 echo 'times() found.' >&4
12007 case "$i_systimes" in
12008 "$define") inc='sys/times.h';;
12010 rp="What is the type returned by times() on this system?"
12011 set clock_t clocktype long stdio.h sys/types.h $inc
12014 echo 'times() NOT found, hope that will do.' >&4
12019 : see if truncate exists
12020 set truncate d_truncate
12023 : see if tzname[] exists
12025 if set tzname val -a d_tzname; eval $csym; $val; then
12027 echo 'tzname[] found.' >&4
12030 echo 'tzname[] NOT found.' >&4
12035 : see if umask exists
12039 : see if ustat exists
12043 : backward compatibility for d_hvfork
12044 if test X$d_hvfork != X; then
12045 d_vfork="$d_hvfork"
12048 : see if there is a vfork
12053 : Ok, but do we want to use it. vfork is reportedly unreliable in
12054 : perl on Solaris 2.x, and probably elsewhere.
12058 case "$usevfork" in
12064 Perl can only use a vfork() that doesn't suffer from strict
12065 restrictions on calling functions or modifying global data in
12066 the child. For example, glibc-2.1 contains such a vfork()
12067 that is unsuitable. If your system provides a proper fork()
12068 call, chances are that you do NOT want perl to use vfork().
12071 rp="Do you still want to use vfork()?"
12076 echo "Ok, we won't use vfork()."
12085 $define) usevfork='true';;
12086 *) usevfork='false';;
12089 : see if this is an sysdir system
12090 set sys/dir.h i_sysdir
12093 : see if this is an sysndir system
12094 set sys/ndir.h i_sysndir
12097 : see if closedir exists
12098 set closedir d_closedir
12101 case "$d_closedir" in
12104 echo "Checking whether closedir() returns a status..." >&4
12105 cat > closedir.c <<EOM
12106 #$i_dirent I_DIRENT /**/
12107 #$i_sysdir I_SYS_DIR /**/
12108 #$i_sysndir I_SYS_NDIR /**/
12109 #$i_systypes I_SYS_TYPES /**/
12111 #if defined(I_SYS_TYPES)
12112 #include <sys/types.h>
12114 #if defined(I_DIRENT)
12115 #include <dirent.h>
12116 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
12117 #include <sys/dir.h>
12121 #include <sys/ndir.h>
12125 #include <ndir.h> /* may be wrong in the future */
12127 #include <sys/dir.h>
12132 int main() { return closedir(opendir(".")); }
12135 if eval $compile_ok; then
12136 if ./closedir > /dev/null 2>&1 ; then
12137 echo "Yes, it does."
12140 echo "No, it doesn't."
12144 echo "(I can't seem to compile the test program--assuming it doesn't)"
12152 set d_void_closedir
12155 : see if there is a wait4
12159 : see if waitpid exists
12160 set waitpid d_waitpid
12163 : see if wcstombs exists
12164 set wcstombs d_wcstombs
12167 : see if wctomb exists
12168 set wctomb d_wctomb
12171 : preserve RCS keywords in files with variable substitution, grrr
12176 Revision='$Revision'
12178 case "$crosscompile" in
12179 ''|[nN]*) crosscompile="$undef" ;;
12183 next|rhapsody|darwin) multiarch="$define" ;;
12185 case "$multiarch" in
12186 ''|[nN]*) multiarch="$undef" ;;
12189 : check for alignment requirements
12191 case "$crosscompile$multiarch" in
12194 You seem to be either cross-compiling or doing a multiarchitecture build,
12195 skipping the memory alignment check.
12198 case "$alignbytes" in
12199 '') alignbytes=8 ;;
12203 case "$alignbytes" in
12204 '') echo "Checking alignment constraints..." >&4
12205 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
12206 $cat >try.c <<'EOCP'
12207 typedef long double NV;
12210 $cat >try.c <<'EOCP'
12214 $cat >>try.c <<'EOCP'
12222 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
12227 if eval $compile_ok; then
12231 echo "(I can't seem to compile the test program...)"
12234 *) dflt="$alignbytes"
12237 rp="Doubles must be aligned on a how-many-byte boundary?"
12245 : set the base revision
12248 : check for ordering of bytes in a long
12250 case "$crosscompile$multiarch" in
12253 You seem to be either cross-compiling or doing a multiarchitecture build,
12254 skipping the byteorder check.
12260 case "$byteorder" in
12263 In the following, larger digits indicate more significance. A big-endian
12264 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
12265 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
12266 machines may have weird orders like 3412. A Cray will report 87654321,
12267 an Alpha will report 12345678. If the test program works the default is
12269 I'm now running the test program...
12271 $cat >try.c <<'EOCP'
12278 char c[sizeof(long)];
12281 if (sizeof(long) > 4)
12282 u.l = (0x08070605L << 32) | 0x04030201L;
12285 for (i = 0; i < sizeof(long); i++)
12286 printf("%c", u.c[i]+'0');
12293 if eval $compile && ./try > /dev/null; then
12296 [1-4][1-4][1-4][1-4]|12345678|87654321)
12297 echo "(The test program ran ok.)"
12298 echo "byteorder=$dflt"
12301 ????|????????) echo "(The test program ran ok.)" ;;
12302 *) echo "(The test program didn't run right for some reason.)" ;;
12307 (I can't seem to compile the test program. Guessing big-endian...)
12310 case "$xxx_prompt" in
12312 rp="What is the order of bytes in a long?"
12326 : how do we catenate cpp tokens here?
12328 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
12329 $cat >cpp_stuff.c <<'EOCP'
12330 #define RCAT(a,b)a/**/b
12331 #define ACAT(a,b)a ## b
12335 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
12336 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
12337 echo "Oh! Smells like ANSI's been here." >&4
12338 echo "We can catify or stringify, separately or together!"
12340 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
12341 echo "Ah, yes! The good old days!" >&4
12342 echo "However, in the good old days we don't know how to stringify and"
12343 echo "catify at the same time."
12347 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
12348 to have to edit the values of CAT[2-5] in config.h...
12350 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
12354 : see if this is a db.h system
12360 : Check db version.
12362 echo "Checking Berkeley DB version ..." >&4
12368 #include <sys/types.h>
12373 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
12374 int Major, Minor, Patch ;
12375 unsigned long Version ;
12376 (void)db_version(&Major, &Minor, &Patch) ;
12377 printf("You have Berkeley DB Version 2 or greater\n");
12379 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
12380 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
12381 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
12382 Major, Minor, Patch) ;
12384 /* check that db.h & libdb are compatible */
12385 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
12386 printf("db.h and libdb are incompatible\n") ;
12390 printf("db.h and libdb are compatible\n") ;
12392 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
12393 + DB_VERSION_PATCH ;
12395 /* needs to be >= 2.3.4 */
12396 if (Version < 2003004) {
12397 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
12398 printf("but Perl needs Berkeley DB 2.3.4 or greater\n") ;
12404 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
12405 printf("You have Berkeley DB Version 1\n");
12406 exit(0); /* DB version < 2: the coast is clear. */
12408 exit(1); /* <db.h> not Berkeley DB? */
12414 if eval $compile_ok && ./try; then
12415 echo 'Looks OK.' >&4
12417 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
12421 : Remove db from list of libraries to use
12422 echo "Removing unusable -ldb from library list" >&4
12423 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
12426 echo "libs = $libs" >&4
12436 : Check the return type needed for hash
12438 echo "Checking return type needed for hash for Berkeley DB ..." >&4
12444 #include <sys/types.h>
12447 #ifndef DB_VERSION_MAJOR
12448 u_int32_t hash_cb (ptr, size)
12456 info.hash = hash_cb;
12460 if $cc $ccflags -c try.c >try.out 2>&1 ; then
12461 if $contains warning try.out >>/dev/null 2>&1 ; then
12464 db_hashtype='u_int32_t'
12467 : XXX Maybe we should just give up here.
12468 db_hashtype=u_int32_t
12470 echo "Help: I can't seem to compile the db test program." >&4
12471 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
12474 echo "Your version of Berkeley DB uses $db_hashtype for hash."
12476 *) db_hashtype=u_int32_t
12481 : Check the return type needed for prefix
12483 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
12489 #include <sys/types.h>
12492 #ifndef DB_VERSION_MAJOR
12493 size_t prefix_cb (key1, key2)
12501 info.prefix = prefix_cb;
12505 if $cc $ccflags -c try.c >try.out 2>&1 ; then
12506 if $contains warning try.out >>/dev/null 2>&1 ; then
12507 db_prefixtype='int'
12509 db_prefixtype='size_t'
12512 db_prefixtype='size_t'
12513 : XXX Maybe we should just give up here.
12515 echo "Help: I can't seem to compile the db test program." >&4
12516 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
12519 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
12521 *) db_prefixtype='size_t'
12525 : check for void type
12527 echo "Checking to see how well your C compiler groks the void type..." >&4
12528 case "$voidflags" in
12530 $cat >try.c <<'EOCP'
12536 extern void moo(); /* function returning void */
12537 void (*goo)(); /* ptr to func returning void */
12539 void *hue; /* generic ptr */
12552 int main() { sub(); }
12554 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
12555 voidflags=$defvoidused
12556 echo "Good. It appears to support void to the level $package wants.">&4
12557 if $contains warning .out >/dev/null 2>&1; then
12558 echo "However, you might get some warnings that look like this:"
12562 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
12563 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
12564 echo "It supports 1..."
12565 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
12566 echo "It also supports 2..."
12567 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
12569 echo "And it supports 4 but not 8 definitely."
12571 echo "It doesn't support 4..."
12572 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
12574 echo "But it supports 8."
12577 echo "Neither does it support 8."
12581 echo "It does not support 2..."
12582 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
12584 echo "But it supports 4 and 8."
12586 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
12588 echo "And it supports 4 but has not heard about 8."
12590 echo "However it supports 8 but not 4."
12595 echo "There is no support at all for void."
12600 case "$voidflags" in
12602 *) $cat >&4 <<'EOM'
12603 Support flag bits are:
12604 1: basic void declarations.
12605 2: arrays of pointers to functions returning void.
12606 4: operations between pointers to and addresses of void functions.
12607 8: generic void pointers.
12610 rp="Your void support flags add up to what?"
12618 : How can we generate normalized random numbers ?
12620 echo "Looking for a random number function..." >&4
12621 case "$randfunc" in
12623 if set drand48 val -f; eval $csym; $val; then
12625 echo "Good, found drand48()." >&4
12626 elif set random val -f; eval $csym; $val; then
12628 echo "OK, found random()." >&4
12631 echo "Yick, looks like I have to use rand()." >&4
12642 *-Dmy_rand=*|*-Dmy_srand=*)
12643 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
12644 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
12645 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
12646 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
12650 while $test "$cont"; do
12651 rp="Use which function to generate random numbers?"
12653 if $test "$ans" = "$dflt"; then
12659 if set $ans val -f; eval $csym; $val; then
12663 rp="I cannot find function $ans. Use that name anyway?"
12672 case "$randfunc" in
12674 drand01="drand48()"
12680 case "$randbits" in
12682 echo "Checking to see how many bits your $randfunc() function produces..." >&4
12684 #$i_unistd I_UNISTD
12685 #$i_stdlib I_STDLIB
12688 # include <unistd.h>
12691 # include <stdlib.h>
12696 register unsigned long tmp;
12697 register unsigned long max = 0L;
12699 for (i = 1000; i; i--) {
12700 tmp = (unsigned long) $randfunc();
12701 if (tmp > max) max = tmp;
12703 for (i = 0; max; i++)
12709 if eval $compile_ok; then
12713 echo "(I can't seem to compile the test program...)"
12720 rp="How many bits does your $randfunc() function produce?"
12724 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
12725 seedfunc="s$randfunc"
12726 randseedtype=unsigned
12730 rp="How many bits does your $randfunc() function produce?"
12733 seedfunc="s$randfunc"
12734 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
12735 if set $seedfunc val -f; eval $csym; $val; then
12736 echo "(Using $seedfunc() to seed random generator)"
12738 echo "(Warning: no $seedfunc() to seed random generator)"
12741 randseedtype=unsigned
12749 echo "Determining whether or not we are on an EBCDIC system..." >&4
12750 $cat >tebcdic.c <<'EOM'
12753 if ('M'==0xd4) return 0;
12760 if eval $compile_ok; then
12762 echo "You seem to speak EBCDIC." >&4
12765 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF8." >&4
12768 echo "I'm unable to compile the test program." >&4
12769 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
12771 $rm -f tebcdic.c tebcdic
12777 Checking how to flush all pending stdio output...
12779 # I only know how to find the first 32 possibly open files on SunOS.
12780 # See also hints/sunos_4_1.sh and util.c --AD
12782 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
12784 $cat >>try.c <<EOCP
12786 #$i_unistd I_UNISTD
12788 # include <unistd.h>
12790 #$d_sysconf HAS_SYSCONF
12791 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
12792 #ifdef HAS_STDIO_STREAM_ARRAY
12793 # define STDIO_STREAM_ARRAY $stdio_stream_array
12796 FILE* p = fopen("try.out", "w");
12800 # ifdef TRY_FPRINTF
12804 #ifdef TRY_FFLUSH_NULL
12807 #ifdef TRY_FFLUSH_ALL
12809 long open_max = -1;
12810 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
12811 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
12813 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
12814 open_max = sysconf(_SC_OPEN_MAX);
12817 open_max = FOPEN_MAX;
12820 open_max = OPEN_MAX;
12829 # ifdef HAS_STDIO_STREAM_ARRAY
12830 if (open_max > 0) {
12832 for (i = 0; i < open_max; i++)
12833 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
12834 STDIO_STREAM_ARRAY[i]._file < open_max &&
12835 STDIO_STREAM_ARRAY[i]._flag)
12836 fflush(&STDIO_STREAM_ARRAY[i]);
12844 : first we have to find out how _not_ to flush
12845 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
12847 set try -DTRY_FPUTC
12848 if eval $compile; then
12850 ./try$exe_ext 2>/dev/null
12851 if $test ! -s try.out -a "X$?" = X42; then
12857 set try -DTRY_FPRINTF
12859 if eval $compile; then
12861 ./try$exe_ext 2>/dev/null
12862 if $test ! -s try.out -a "X$?" = X42; then
12863 output=-DTRY_FPRINTF
12869 : check for fflush NULL behaviour
12870 case "$fflushNULL" in
12871 '') set try -DTRY_FFLUSH_NULL $output
12872 if eval $compile; then
12874 ./try$exe_ext 2>/dev/null
12876 if $test -s try.out -a "X$code" = X42; then
12877 fflushNULL="`$cat try.out`"
12879 if $test "X$code" != X42; then
12881 (If this test failed, don't worry, we'll try another method shortly.)
12886 $rm -f core try.core core.try.*
12887 case "$fflushNULL" in
12889 Your fflush(NULL) works okay for output streams.
12890 Let's see if it clobbers input pipes...
12892 # As of mid-March 2000 all versions of Solaris appear to have a stdio
12893 # bug that improperly flushes the input end of pipes. So we avoid the
12894 # autoflush on fork/system/exec support for now. :-(
12895 $cat >tryp.c <<EOCP
12898 main(int argc, char **argv)
12904 while ((i = getc(stdin)) != -1
12905 && (*bp++ = i) != '\n'
12906 && bp < &buf[1024])
12909 fprintf(stdout, "%s", buf);
12917 fflushNULL="$define"
12919 if eval $compile; then
12921 $cat tryp.c | ./tryp$exe_ext 2>/dev/null > tryp.out
12922 if cmp tryp.c tryp.out >/dev/null 2>&1; then
12924 fflush(NULL) seems to behave okay with input streams.
12926 fflushNULL="$define"
12929 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
12931 fflushNULL="$undef"
12934 $rm -f core tryp.c tryp.core core.tryp.*
12937 Your fflush(NULL) isn't working (contrary to ANSI C).
12939 fflushNULL="$undef"
12942 Cannot figure out whether your fflush(NULL) works or not.
12943 I'm assuming it doesn't (contrary to ANSI C).
12945 fflushNULL="$undef"
12949 $define|true|[yY]*)
12950 fflushNULL="$define"
12953 fflushNULL="$undef"
12956 : check explicit looping only if NULL did not work, and if the pipe
12957 : bug does not show up on an explicit flush too
12958 case "$fflushNULL" in
12960 $cat >tryp.c <<EOCP
12963 main(int argc, char **argv)
12969 while ((i = getc(stdin)) != -1
12970 && (*bp++ = i) != '\n'
12971 && bp < &buf[1024])
12974 fprintf(stdout, "%s", buf);
12983 if eval $compile; then
12985 $cat tryp.c | ./tryp$exe_ext 2>/dev/null > tryp.out
12986 if cmp tryp.c tryp.out >/dev/null 2>&1; then
12988 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
12990 : now check for fflushall behaviour
12991 case "$fflushall" in
12992 '') set try -DTRY_FFLUSH_ALL $output
12993 if eval $compile; then
12995 (Now testing the other method--but note that this also may fail.)
12998 ./try$exe_ext 2>/dev/null
12999 if $test -s try.out -a "X$?" = X42; then
13000 fflushall="`$cat try.out`"
13003 $rm -f core try.core core.try.*
13004 case "$fflushall" in
13006 Whew. Flushing explicitly all the stdio streams works.
13008 fflushall="$define"
13011 Sigh. Flushing explicitly all the stdio streams doesn't work.
13016 Cannot figure out whether flushing stdio streams explicitly works or not.
13017 I'm assuming it doesn't.
13023 "$define"|true|[yY]*)
13024 fflushall="$define"
13032 All is futile. Even fflush(stdin) clobbers input pipes!
13039 $rm -f core tryp.c tryp.core core.tryp.*
13041 *) fflushall="$undef"
13045 case "$fflushNULL$fflushall" in
13048 OK, I give up. I cannot figure out how to flush pending stdio output.
13049 We won't be flushing handles at all before fork/exec/popen.
13053 $rm -f try.* try$exe_ext
13055 : Store the full pathname to the ar program for use in the C program
13056 : Respect a hint or command line value for full_ar.
13061 : Store the full pathname to the sed program for use in the C program
13064 : see what type gids are declared as in the kernel
13066 echo "Looking for the type for group ids returned by getgid()."
13067 set gid_t gidtype xxx stdio.h sys/types.h
13071 xxx=`./findhdr sys/user.h`
13072 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
13074 unsigned) dflt="$1 $2" ;;
13078 *) dflt="$gidtype";;
13081 gid_t) echo "gid_t found." ;;
13082 *) rp="What is the type for group ids returned by getgid()?"
13090 *_t) zzz="$gidtype" ;;
13093 echo "Checking the size of $zzz..." >&4
13095 #include <sys/types.h>
13098 printf("%d\n", (int)sizeof($gidtype));
13103 if eval $compile_ok; then
13107 echo "(I can't execute the test program--guessing $gidsize.)" >&4
13110 echo "Your $zzz is $gidsize bytes long."
13115 echo "(I can't compile the test program--guessing $gidsize.)" >&4
13121 *_t) zzz="$gidtype" ;;
13124 echo "Checking the sign of $zzz..." >&4
13126 #include <sys/types.h>
13137 if eval $compile; then
13141 echo "(I can't execute the test program--guessing unsigned.)" >&4
13145 1) echo "Your $zzz is unsigned." ;;
13146 -1) echo "Your $zzz is signed." ;;
13152 echo "(I can't compile the test program--guessing unsigned.)" >&4
13158 if $test X"$quadtype" != X; then
13160 echo "Checking how to print 64-bit integers..." >&4
13162 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
13163 $cat >try.c <<'EOCP'
13164 #include <sys/types.h>
13167 int q = 12345678901;
13168 printf("%ld\n", q);
13172 if eval $compile; then
13173 yyy=`./try$exe_ext`
13176 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
13177 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
13178 echo "We will use %d."
13184 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
13185 $cat >try.c <<'EOCP'
13186 #include <sys/types.h>
13189 long q = 12345678901;
13190 printf("%ld\n", q);
13194 if eval $compile; then
13195 yyy=`./try$exe_ext`
13198 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
13199 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
13200 echo "We will use %ld."
13206 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
13207 $cat >try.c <<'EOCP'
13208 #include <sys/types.h>
13209 #include <inttypes.h>
13212 int64_t q = 12345678901;
13213 printf("%" PRId64 "\n", q);
13217 if eval $compile; then
13218 yyy=`./try$exe_ext`
13221 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
13222 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
13223 echo "We will use the C9X style."
13229 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
13230 $cat >try.c <<'EOCP'
13231 #include <sys/types.h>
13234 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
13235 printf("%lld\n", q);
13239 if eval $compile; then
13240 yyy=`./try$exe_ext`
13243 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
13244 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
13245 echo "We will use the %lld style."
13251 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
13253 #include <sys/types.h>
13256 $quadtype q = 12345678901;
13257 printf("%Ld\n", q);
13261 if eval $compile; then
13262 yyy=`./try$exe_ext`
13265 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
13266 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
13267 echo "We will use %Ld."
13273 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
13275 #include <sys/types.h>
13278 $quadtype q = 12345678901;
13279 printf("%qd\n", q);
13283 if eval $compile; then
13284 yyy=`./try$exe_ext`
13287 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
13288 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
13289 echo "We will use %qd."
13295 if $test X"$sPRId64" = X; then
13296 echo "Cannot figure out how to print 64-bit integers." >&4
13304 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
13305 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
13307 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
13308 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
13314 $echo "Checking the format strings to be used for Perl's internal types..." >&4
13316 if $test X"$ivsize" = X8; then
13317 ivdformat="$sPRId64"
13318 uvuformat="$sPRIu64"
13319 uvoformat="$sPRIo64"
13320 uvxformat="$sPRIx64"
13321 uvXUformat="$sPRIXU64"
13323 if $test X"$ivsize" = X"$longsize"; then
13330 if $test X"$ivsize" = X"$intsize"; then
13338 if $test X"$ivsize" = X"$shortsize"; then
13349 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
13350 nveformat="$sPRIeldbl"
13351 nvfformat="$sPRIfldbl"
13352 nvgformat="$sPRIgldbl"
13353 nvEUformat="$sPRIEUldbl"
13354 nvFUformat="$sPRIFUldbl"
13355 nvGUformat="$sPRIGUldbl"
13365 case "$ivdformat" in
13366 '') echo "$0: Fatal: failed to find format strings, cannot continue." >& 4
13373 $echo "Checking the format string to be used for gids..." >&4
13376 -1) if $test X"$gidsize" = X"$ivsize"; then
13377 gidformat="$ivdformat"
13379 if $test X"$gidsize" = X"$longsize"; then
13382 if $test X"$gidsize" = X"$intsize"; then
13385 if $test X"$gidsize" = X"$shortsize"; then
13392 *) if $test X"$gidsize" = X"$uvsize"; then
13393 gidformat="$uvuformat"
13395 if $test X"$gidsize" = X"$longsize"; then
13398 if $test X"$gidsize" = X"$intsize"; then
13401 if $test X"$gidsize" = X"$shortsize"; then
13410 : see if getgroups exists
13411 set getgroups d_getgrps
13414 : see if setgroups exists
13415 set setgroups d_setgrps
13419 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
13421 case "$d_getgrps$d_setgrps" in
13423 case "$groupstype" in
13424 '') dflt="$gidtype" ;;
13425 *) dflt="$groupstype" ;;
13428 What type of pointer is the second argument to getgroups() and setgroups()?
13429 Usually this is the same as group ids, $gidtype, but not always.
13432 rp='What type pointer is the second argument to getgroups() and setgroups()?'
13436 *) groupstype="$gidtype";;
13440 echo "Checking if your $make program sets \$(MAKE)..." >&4
13441 case "$make_set_make" in
13443 $sed 's/^X //' > testmake.mak << 'EOF'
13445 X @echo 'maketemp="$(MAKE)"'
13447 case "`$make -f testmake.mak 2>/dev/null`" in
13448 *maketemp=*) make_set_make='#' ;;
13449 *) make_set_make="MAKE=$make" ;;
13451 $rm -f testmake.mak
13454 case "$make_set_make" in
13455 '#') echo "Yup, it does.";;
13456 *) echo "Nope, it doesn't.";;
13459 : see what type is used for mode_t
13460 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
13461 set mode_t modetype int stdio.h sys/types.h
13464 : define a fucntion to check prototypes
13465 $cat > protochk <<EOSH
13468 optimize="$optimize"
13470 prototype="$prototype"
13475 $cat >> protochk <<'EOSH'
13480 while test $# -ge 2; do
13482 $define) echo "#include <$2>" >> try.c ;;
13483 literal) echo "$2" >> try.c ;;
13487 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
13488 cat >> try.c <<'EOCP'
13489 #ifdef CAN_PROTOTYPE
13490 #define _(args) args
13495 echo "$foo" >> try.c
13496 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
13497 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
13503 $eunicefix protochk
13505 : see what type is used for size_t
13506 rp="What is the type used for the length parameter for string functions?"
13507 set size_t sizetype 'unsigned int' stdio.h sys/types.h
13510 : check for type of arguments to gethostbyaddr.
13511 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
13512 case "$d_gethbyaddr" in
13516 Checking to see what type of arguments are accepted by gethostbyaddr().
13518 hdrs="$define sys/types.h
13519 $d_socket sys/socket.h
13520 $i_niin netinet/in.h
13522 $i_unistd unistd.h"
13523 : The first arg can 'char *' or 'void *'
13524 : The second arg is some of integral type
13525 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
13526 for yyy in size_t long int; do
13527 case "$netdb_host_type" in
13528 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
13529 if ./protochk "$try" $hdrs; then
13530 echo "Your system accepts $xxx for the first arg."
13531 echo "...and $yyy for the second arg."
13532 netdb_host_type="$xxx"
13533 netdb_hlen_type="$yyy"
13539 : In case none of those worked, prompt the user.
13540 case "$netdb_host_type" in
13541 '') rp='What is the type for the 1st argument to gethostbyaddr?'
13544 netdb_host_type=$ans
13545 rp='What is the type for the 2nd argument to gethostbyaddr?'
13548 netdb_hlen_type=$ans
13552 *) : no gethostbyaddr, so pick harmless defaults
13553 netdb_host_type='char *'
13554 netdb_hlen_type="$sizetype"
13557 # Remove the "const" if needed. -- but then we'll have a
13559 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
13562 : check for type of argument to gethostbyname.
13563 if test "X$netdb_name_type" = X ; then
13564 case "$d_gethbyname" in
13568 Checking to see what type of argument is accepted by gethostbyname().
13570 hdrs="$define sys/types.h
13571 $d_socket sys/socket.h
13572 $i_niin netinet/in.h
13574 $i_unistd unistd.h"
13575 for xxx in "const char *" "char *"; do
13576 case "$netdb_name_type" in
13577 '') try="extern struct hostent *gethostbyname($xxx);"
13578 if ./protochk "$try" $hdrs; then
13579 echo "Your system accepts $xxx."
13580 netdb_name_type="$xxx"
13585 : In case none of those worked, prompt the user.
13586 case "$netdb_name_type" in
13587 '') rp='What is the type for the 1st argument to gethostbyname?'
13590 netdb_name_type=$ans
13594 *) : no gethostbyname, so pick harmless default
13595 netdb_name_type='char *'
13600 : check for type of 1st argument to getnetbyaddr.
13601 if test "X$netdb_net_type" = X ; then
13602 case "$d_getnbyaddr" in
13606 Checking to see what type of 1st argument is accepted by getnetbyaddr().
13608 hdrs="$define sys/types.h
13609 $d_socket sys/socket.h
13610 $i_niin netinet/in.h
13612 $i_unistd unistd.h"
13613 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
13614 case "$netdb_net_type" in
13615 '') try="extern struct netent *getnetbyaddr($xxx, int);"
13616 if ./protochk "$try" $hdrs; then
13617 echo "Your system accepts $xxx."
13618 netdb_net_type="$xxx"
13623 : In case none of those worked, prompt the user.
13624 case "$netdb_net_type" in
13625 '') rp='What is the type for the 1st argument to getnetbyaddr?'
13628 netdb_net_type=$ans
13632 *) : no getnetbyaddr, so pick harmless default
13633 netdb_net_type='long'
13637 : locate the preferred pager for this system
13643 [a-zA-Z]:/*) dflt=$pg;;
13647 [a-zA-Z]:/*) dflt=$more;;
13651 [a-zA-Z]:/*) dflt=$less;;
13654 '') dflt=/usr/ucb/more;;
13661 rp='What pager is used on your system?'
13665 : see what type pids are declared as in the kernel
13666 rp="What is the type of process ids on this system?"
13667 set pid_t pidtype int stdio.h sys/types.h
13670 : Find earliest binary compatible site_perl subdirectory perl can use.
13671 case "$bincompat5005" in
13672 "$define") xs_apiversion='5.005' ;;
13673 *) xs_apiversion=$version ;; # The current site_perl version.
13675 : Find earliest pure perl site_perl subdirectory perl can use.
13676 : The versioned directories started at 5.005.
13677 pm_apiversion='5.005'
13679 : check for length of pointer
13683 echo "Checking to see how big your pointers are..." >&4
13684 if test "$voidflags" -gt 7; then
13685 echo '#define VOID_PTR char *' > try.c
13687 echo '#define VOID_PTR void *' > try.c
13689 $cat >>try.c <<'EOCP'
13693 printf("%d\n", (int)sizeof(VOID_PTR));
13698 if eval $compile_ok; then
13700 echo "Your pointers are $ptrsize bytes long."
13703 echo "(I can't seem to compile the test program. Guessing...)" >&4
13704 rp="What is the size of a pointer (in bytes)?"
13712 : see if ar generates random libraries by itself
13714 echo "Checking how to generate random libraries on your machine..." >&4
13715 echo 'int bar1() { return bar2(); }' > bar1.c
13716 echo 'int bar2() { return 2; }' > bar2.c
13717 $cat > foo.c <<'EOP'
13718 int main() { printf("%d\n", bar1()); exit(0); }
13720 $cc $ccflags -c bar1.c >/dev/null 2>&1
13721 $cc $ccflags -c bar2.c >/dev/null 2>&1
13722 $cc $ccflags -c foo.c >/dev/null 2>&1
13723 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
13724 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
13725 ./foobar >/dev/null 2>&1; then
13726 echo "$ar appears to generate random libraries itself."
13729 elif $ar ts bar$_a >/dev/null 2>&1 &&
13730 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
13731 ./foobar >/dev/null 2>&1; then
13732 echo "a table of contents needs to be added with '$ar ts'."
13739 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
13740 $test -f $ranlib || ranlib=''
13743 if $test -n "$ranlib"; then
13744 echo "your system has '$ranlib'; we'll use that."
13747 echo "your system doesn't seem to support random libraries"
13748 echo "so we'll use lorder and tsort to order the libraries."
13755 : check for type of arguments to select.
13756 case "$selecttype" in
13757 '') case "$d_select" in
13761 Checking to see what type of arguments are accepted by select().
13763 hdrs="$define sys/types.h
13764 $i_systime sys/time.h
13765 $i_sysselct sys/select.h
13766 $d_socket sys/socket.h"
13767 : The first arg can be int, unsigned, or size_t
13768 : The last arg may or may not be 'const'
13770 : void pointer has been seen but using that
13771 : breaks the selectminbits test
13772 for xxx in 'fd_set *' 'int *'; do
13773 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
13774 for tmo in 'struct timeval *' 'const struct timeval *'; do
13776 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
13777 if ./protochk "$try" $hdrs; then
13778 echo "Your system accepts $xxx."
13787 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
13788 case "$d_fd_set" in
13789 $define) dflt="fd_set *" ;;
13798 *) : no select, so pick a harmless default
13805 : check for the select 'width'
13806 case "$selectminbits" in
13807 '') case "$d_select" in
13811 Checking to see on how many bits at a time your select() operates...
13814 #include <sys/types.h>
13816 #$i_systime I_SYS_TIME
13817 #$i_systimek I_SYS_TIME_KERNEL
13822 # ifdef I_SYS_TIME_KERNEL
13825 # include <sys/time.h>
13826 # ifdef I_SYS_TIME_KERNEL
13830 #$i_sysselct I_SYS_SELECT
13831 #ifdef I_SYS_SELECT
13832 #include <sys/select.h>
13834 #$d_socket HAS_SOCKET
13836 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13840 #define S sizeof(*(b))
13842 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
13843 #define NBITS (NBYTES * 8)
13852 fp = fopen("try.c", "r");
13858 b = ($selecttype)s;
13859 for (i = 0; i < NBITS; i++)
13863 select(fd + 1, b, 0, 0, &t);
13864 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
13865 printf("%d\n", i + 1);
13870 if eval $compile_ok; then
13871 selectminbits=`./try`
13872 case "$selectminbits" in
13874 Cannot figure out on how many bits at a time your select() operates.
13875 I'll play safe and guess it is 32 bits.
13881 *) bits="$selectminbits bits" ;;
13883 echo "Your select() operates on $bits at a time." >&4
13885 rp='What is the minimum number of bits your select() operates on?'
13886 case "$byteorder" in
13887 1234|12345678) dflt=32 ;;
13892 selectminbits="$val"
13896 *) : no select, so pick a harmless default
13903 : Trace out the files included by signal.h, then look for SIGxxx names.
13904 : Remove SIGARRAYSIZE used by HPUX.
13905 : Remove SIGSTKSIZE used by Linux.
13906 : Remove SIGSTKSZ used by Posix.
13907 : Remove SIGTYP void lines used by OS2.
13908 : Some cpps, like os390, dont give the file name anywhere
13909 if [ "X$fieldn" = X ]; then
13910 : Just make some guesses. We check them later.
13911 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
13913 xxx=`echo '#include <signal.h>' |
13914 $cppstdin $cppminus $cppflags 2>/dev/null |
13915 $grep '^[ ]*#.*include' |
13916 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq`
13918 : Check this list of files to be sure we have parsed the cpp output ok.
13919 : This will also avoid potentially non-existent files, such
13922 for xx in $xxx /dev/null ; do
13923 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
13925 : If we have found no files, at least try signal.h
13926 case "$xxxfiles" in
13927 '') xxxfiles=`./findhdr signal.h` ;;
13930 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
13931 print substr($2, 4, 20)
13933 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
13934 print substr($3, 4, 20)
13936 : Append some common names just in case the awk scan failed.
13937 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
13938 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
13939 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
13940 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
13941 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
13943 : generate a few handy files for later
13944 $cat > signal.c <<'EOCP'
13945 #include <sys/types.h>
13946 #include <signal.h>
13950 /* Strange style to avoid deeply-nested #if/#else/#endif */
13953 # define NSIG (_NSIG)
13959 # define NSIG (SIGMAX+1)
13965 # define NSIG (SIG_MAX+1)
13971 # define NSIG (MAXSIG+1)
13977 # define NSIG (MAX_SIG+1)
13982 # ifdef SIGARRAYSIZE
13983 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
13989 # define NSIG (_sys_nsig) /* Solaris 2.5 */
13993 /* Default to some arbitrary number that's big enough to get most
13994 of the common signals.
14000 printf("NSIG %d\n", NSIG);
14006 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
14008 printf "#ifdef SIG"; printf $1; printf "\n"
14009 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
14010 printf $1; printf ");\n"
14014 printf "#endif /* JUST_NSIG */\n";
14015 printf "exit(0);\n}\n";
14018 $cat >signal.awk <<'EOP'
14019 BEGIN { ndups = 0 }
14020 $1 ~ /^NSIG$/ { nsig = $2 }
14021 ($1 !~ /^NSIG$/) && (NF == 2) {
14022 if ($2 > maxsig) { maxsig = $2 }
14023 if (sig_name[$2]) {
14024 dup_name[ndups] = $1
14025 dup_num[ndups] = $2
14037 printf("NSIG %d\n", nsig);
14038 for (n = 1; n < nsig; n++) {
14040 printf("%s %d\n", sig_name[n], sig_num[n])
14043 printf("NUM%d %d\n", n, n)
14046 for (n = 0; n < ndups; n++) {
14047 printf("%s %d\n", dup_name[n], dup_num[n])
14051 $cat >signal_cmd <<EOS
14053 if $test -s signal.lst; then
14054 echo "Using your existing signal.lst file"
14059 $cat >>signal_cmd <<'EOS'
14062 if eval $compile_ok; then
14063 ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
14065 echo "(I can't seem be able to compile the whole test program)" >&4
14066 echo "(I'll try it in little pieces.)" >&4
14067 set signal -DJUST_NSIG
14068 if eval $compile_ok; then
14069 ./signal$_exe > signal.nsg
14072 echo "I can't seem to figure out how many signals you have." >&4
14073 echo "Guessing 50." >&4
14074 echo 'NSIG 50' > signal.nsg
14076 : Now look at all the signal names, one at a time.
14077 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
14078 $cat > signal.c <<EOCP
14079 #include <sys/types.h>
14080 #include <signal.h>
14083 printf("$xx %d\n", SIG${xx});
14088 if eval $compile; then
14089 echo "SIG${xx} found."
14090 ./signal$_exe >> signal.ls1
14092 echo "SIG${xx} NOT found."
14095 if $test -s signal.ls1; then
14096 $cat signal.nsg signal.ls1 |
14097 $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
14101 if $test -s signal.lst; then
14104 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
14105 echo 'kill -l' >signal
14106 set X `csh -f <signal`
14110 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
14112 echo $@ | $tr ' ' $trnl | \
14113 $awk '{ printf "%s %d\n", $1, ++s; }
14114 END { printf "NSIG %d\n", ++s }' >signal.lst
14116 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
14118 chmod a+x signal_cmd
14119 $eunicefix signal_cmd
14121 : generate list of signal names
14123 case "$sig_name_init" in
14125 *) case "$sig_num_init" in
14126 ''|*,*) doinit=yes ;;
14131 echo "Generating a list of signal names and numbers..." >&4
14133 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
14134 sig_name=`$awk 'BEGIN { printf "ZERO " }
14135 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
14136 sig_num=`$awk 'BEGIN { printf "0 " }
14137 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
14138 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
14139 !/^NSIG/ { printf "\"%s\", ", $1 }
14140 END { printf "0\n" }' signal.lst`
14141 sig_num_init=`$awk 'BEGIN { printf "0, " }
14142 !/^NSIG/ { printf "%d, ", $2}
14143 END { printf "0\n"}' signal.lst`
14146 echo "The following $sig_count signals are available:"
14148 echo $sig_name | $awk \
14149 'BEGIN { linelen = 0 }
14151 for (i = 1; i <= NF; i++) {
14152 name = "SIG" $i " "
14153 linelen = linelen + length(name)
14154 if (linelen > 70) {
14156 linelen = length(name)
14162 $rm -f signal signal.c signal.awk signal.lst signal_cmd
14165 case "$sizetype" in
14166 *_t) zzz="$sizetype" ;;
14167 *) zzz="filesize" ;;
14169 echo "Checking the size of $zzz..." >&4
14171 #include <sys/types.h>
14174 printf("%d\n", (int)sizeof($sizetype));
14179 if eval $compile_ok; then
14183 echo "(I can't execute the test program--guessing $sizesize.)" >&4
14186 echo "Your $zzz size is $sizesize bytes."
14191 echo "(I can't compile the test program--guessing $sizesize.)" >&4
14195 : check for socklen_t
14197 echo "Checking to see if you have socklen_t..." >&4
14199 #include <sys/types.h>
14200 #$d_socket HAS_SOCKET
14202 #include <sys/socket.h>
14204 int main() { socklen_t x = 16; }
14207 if eval $compile; then
14209 echo "You have socklen_t."
14212 echo "You do not have socklen_t."
14213 case "$sizetype" in
14214 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
14221 : see if this is a socks.h system
14222 set socks.h i_socks
14225 : check for type of the size argument to socket calls
14226 case "$d_socket" in
14230 Checking to see what type is the last argument of accept().
14233 case "$d_socklen_t" in
14234 "$define") yyy="$yyy socklen_t"
14236 yyy="$yyy $sizetype int long unsigned"
14237 for xxx in $yyy; do
14238 case "$socksizetype" in
14239 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
14240 case "$usesocks" in
14242 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
14243 echo "Your system accepts '$xxx *' for the last argument of accept()."
14244 socksizetype="$xxx"
14247 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
14248 echo "Your system accepts '$xxx *' for the last argument of accept()."
14249 socksizetype="$xxx"
14256 : In case none of those worked, prompt the user.
14257 case "$socksizetype" in
14258 '') rp='What is the type for socket address structure sizes?'
14265 *) : no sockets, so pick relatively harmless default
14270 : see what type is used for signed size_t
14271 set ssize_t ssizetype int stdio.h sys/types.h
14274 $cat > ssize.c <<EOM
14276 #include <sys/types.h>
14277 #define Size_t $sizetype
14278 #define SSize_t $dflt
14281 if (sizeof(Size_t) == sizeof(SSize_t))
14283 else if (sizeof(Size_t) == sizeof(int))
14292 if eval $compile_ok && ./ssize > /dev/null; then
14293 ssizetype=`./ssize`
14294 echo "I'll be using $ssizetype for functions returning a byte count." >&4
14297 Help! I can't compile and run the ssize_t test program: please enlighten me!
14298 (This is probably a misconfiguration in your system or libraries, and
14299 you really ought to fix it. Still, I'll try anyway.)
14301 I need a type that is the same size as $sizetype, but is guaranteed to
14302 be signed. Common values are ssize_t, int and long.
14305 rp="What signed type is the same size as $sizetype?"
14309 $rm -f ssize ssize.*
14311 : see what type of char stdio uses.
14313 if $contains 'unsigned.*char.*_ptr;' `./findhdr stdio.h` >/dev/null 2>&1 ; then
14314 echo "Your stdio uses unsigned chars." >&4
14315 stdchar="unsigned char"
14317 echo "Your stdio uses signed chars." >&4
14321 : see if time exists
14323 if test "X$d_time" = X -o X"$timetype" = X; then
14324 if set time val -f d_time; eval $csym; $val; then
14325 echo 'time() found.' >&4
14327 rp="What is the type returned by time() on this system?"
14328 set time_t timetype long stdio.h sys/types.h
14331 echo 'time() not found, hope that will do.' >&4
14339 : see what type uids are declared as in the kernel
14341 echo "Looking for the type for user ids returned by getuid()."
14342 set uid_t uidtype xxx stdio.h sys/types.h
14346 xxx=`./findhdr sys/user.h`
14347 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
14349 unsigned) dflt="$1 $2" ;;
14353 *) dflt="$uidtype";;
14356 uid_t) echo "uid_t found." ;;
14357 *) rp="What is the type for user ids returned by getuid()?"
14365 *_t) zzz="$uidtype" ;;
14368 echo "Checking the size of $zzz..." >&4
14370 #include <sys/types.h>
14373 printf("%d\n", (int)sizeof($uidtype));
14378 if eval $compile_ok; then
14382 echo "(I can't execute the test program--guessing $uidsize.)" >&4
14385 echo "Your $zzz is $uidsize bytes long."
14390 echo "(I can't compile the test program--guessing $uidsize.)" >&4
14395 *_t) zzz="$uidtype" ;;
14398 echo "Checking the sign of $zzz..." >&4
14400 #include <sys/types.h>
14411 if eval $compile; then
14415 echo "(I can't execute the test program--guessing unsigned.)" >&4
14419 1) echo "Your $zzz is unsigned." ;;
14420 -1) echo "Your $zzz is signed." ;;
14426 echo "(I can't compile the test program--guessing unsigned.)" >&4
14432 $echo "Checking the format string to be used for uids..." >&4
14435 -1) if $test X"$uidsize" = X"$ivsize"; then
14436 uidformat="$ivdformat"
14438 if $test X"$uidsize" = X"$longsize"; then
14441 if $test X"$uidsize" = X"$intsize"; then
14444 if $test X"$uidsize" = X"$shortsize"; then
14451 *) if $test X"$uidsize" = X"$uvsize"; then
14452 uidformat="$uvuformat"
14454 if $test X"$uidsize" = X"$longsize"; then
14457 if $test X"$uidsize" = X"$intsize"; then
14460 if $test X"$uidsize" = X"$shortsize"; then
14469 : see if dbm.h is available
14470 : see if dbmclose exists
14471 set dbmclose d_dbmclose
14474 case "$d_dbmclose" in
14484 *) set rpcsvc/dbm.h i_rpcsvcdbm
14489 *) echo "We won't be including <dbm.h>"
14499 : see if this is a sys/file.h system
14504 : do we need to include sys/file.h ?
14508 if $h_sysfile; then
14510 echo "We'll be including <sys/file.h>." >&4
14513 echo "We won't be including <sys/file.h>." >&4
14523 : see if fcntl.h is there
14528 : see if we can include fcntl.h
14534 echo "We'll be including <fcntl.h>." >&4
14537 if $h_sysfile; then
14538 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
14540 echo "We won't be including <fcntl.h>." >&4
14552 : see if this is a iconv.h system
14553 set iconv.h i_iconv
14556 : see if this is a ieeefp.h system
14557 set ieeefp.h i_ieeefp
14560 : see if this is a libutil.h system
14561 set libutil.h i_libutil
14564 : see if locale.h is available
14565 set locale.h i_locale
14568 : see if mach cthreads are available
14569 if test "X$usethreads" = "X$define"; then
14570 set mach/cthreads.h i_machcthr
14573 i_machcthr="$undef"
14578 : see if this is a math.h system
14582 : see if this is a mntent.h system
14583 set mntent.h i_mntent
14586 : see if ndbm.h is available
14591 : see if dbm_open exists
14592 set dbm_open d_dbm_open
14594 case "$d_dbm_open" in
14597 echo "We won't be including <ndbm.h>"
14606 : see if net/errno.h is available
14608 set net/errno.h val
14611 : Unfortunately, it causes problems on some systems. Arrgh.
14614 cat > try.c <<'EOM'
14617 #include <net/errno.h>
14623 if $cc $ccflags -c try.c >/dev/null 2>&1; then
14624 echo "We'll be including <net/errno.h>." >&4
14626 echo "We won't be including <net/errno.h>." >&4
14635 : see if netinet/tcp.h is available
14636 set netinet/tcp.h i_netinettcp
14639 : see if this is a poll.h system
14643 : see if this is a prot.h system
14648 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
14649 $cat <<'EOSH' > Cppsym.know
14650 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
14651 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
14652 alliant alpha am29000 AM29000 amiga AMIGAOS AMIX
14653 ansi ANSI_C_SOURCE apollo ardent atarist att386 att3b BeOS
14654 BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
14655 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
14656 bull c cadmus clipper CMU COFF COMPILER_VERSION
14657 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
14658 CYGWIN DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
14659 Dynix DynixPTX ELF encore EPI EXTENSIONS FILE_OFFSET_BITS
14660 FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
14661 GNU_SOURCE GNUC GNUC_MINOR GO32 gould GOULD_PN
14662 H3050R H3050RX hbullx20 hcx host_mips
14663 hp200 hp300 hp700 HP700 hp800 hp9000
14664 hp9000s200 hp9000s300 hp9000s400 hp9000s500
14665 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
14666 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
14667 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
14668 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
14669 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
14670 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
14671 Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
14672 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
14673 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
14674 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
14675 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
14676 MATH_HAS_NO_SIDE_EFFECTS
14677 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
14678 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
14679 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
14680 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
14681 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
14682 NetBSD news1500 news1700 news1800 news1900 news3700
14683 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
14684 ns32016 ns32332 ns32k nsc32000
14685 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
14686 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
14687 pc532 pdp11 PGC PIC plexus PORTAR posix
14688 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
14689 POSIX_C_SOURCE POSIX_SOURCE POWER
14690 PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
14691 riscix riscos RT scs SCO sequent sgi SGI_SOURCE sinix
14692 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
14693 sony sony_news sonyrisc sparc sparclite spectrum
14694 stardent stdc STDC_EXT stratos sun sun3 sun386
14695 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
14696 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
14697 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
14698 sysV68 sysV88 Tek4132 Tek4300 titan
14699 tower tower32 tower32_200 tower32_600 tower32_700
14700 tower32_800 tower32_850 tss
14701 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
14702 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
14703 unix UNIX95 UNIX99 unixpc unos USGr4 USGr4_2
14704 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms xenix Xenix286
14705 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
14706 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
14709 # Maybe put other stuff here too.
14710 cat <<EOSH >>Cppsym.know
14713 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
14714 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
14715 $cat Cppsym.know > Cppsym.c
14716 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
14717 $rm -f Cppsym.a Cppsym.b Cppsym.c
14718 cat <<EOSH > Cppsym
14720 if $test \$# -gt 0; then
14721 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
14722 if $test -s Cppsym.got; then
14729 $tr " " "$trnl" | ./Cppsym.try
14735 cat <<EOSH > Cppsym.try
14737 cat <<'EOCP' > try.c
14743 cat <<'EOSH' >> Cppsym.try
14745 printf "#ifdef %s\n#if %s+0\nprintf(\"%s=%%ld\\n\", %s);\n#else\nprintf(\"%s\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1
14746 printf "#ifdef _%s\n#if _%s+0\nprintf(\"_%s=%%ld\\n\", _%s);\n#else\nprintf(\"_%s\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1
14747 printf "#ifdef __%s\n#if __%s+0\nprintf(\"__%s=%%ld\\n\", __%s);\n#else\nprintf(\"__%s\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1
14748 printf "#ifdef __%s__\n#if __%s__+0\nprintf(\"__%s__=%%ld\\n\", __%s__);\n#else\nprintf(\"__%s__\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1
14752 cat <<EOSH >> Cppsym.try
14754 case "$osname-$gccversion" in
14755 irix-) ccflags="\$ccflags -woff 1178" ;;
14756 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
14758 $cc -o try $optimize \$ccflags $ldflags try.c $libs && ./try$exe_ext
14760 chmod +x Cppsym.try
14761 $eunicefix Cppsym.try
14762 ./Cppsym < Cppsym.know > Cppsym.true
14763 : now check the C compiler for additional symbols
14764 postprocess_cc_v=''
14766 aix) postprocess_cc_v="|$tr , ' '" ;;
14773 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
14776 -D*) echo "\$i" | $sed 's/^-D//';;
14777 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
14782 postprocess_cc_v=''
14785 ./ccsym > ccsym1.raw
14786 if $test -s ccsym1.raw; then
14787 $sort ccsym1.raw | $uniq >ccsym.raw
14789 mv ccsym1.raw ccsym.raw
14792 $awk '/\=/ { print $0; next }
14793 { print $0"=1" }' ccsym.raw >ccsym.list
14794 $awk '/\=/ { print $0; next }
14795 { print $0"=1" }' Cppsym.true >ccsym.true
14796 $comm -13 ccsym.true ccsym.list >ccsym.own
14797 $comm -12 ccsym.true ccsym.list >ccsym.com
14798 $comm -23 ccsym.true ccsym.list >ccsym.cpp
14800 if $test -z ccsym.raw; then
14801 echo "Your C compiler doesn't seem to define any symbols!" >&4
14803 echo "However, your C preprocessor defines the following symbols:"
14806 cppsymbols=`$cat Cppsym.true`
14807 cppsymbols=`echo $cppsymbols`
14808 cppccsymbols="$cppsymbols"
14810 if $test -s ccsym.com; then
14811 echo "Your C compiler and pre-processor define these symbols:"
14812 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
14815 cppccsymbols=`$cat ccsym.com`
14816 cppccsymbols=`echo $cppccsymbols`
14817 $test "$silent" || sleep 1
14819 if $test -s ccsym.cpp; then
14820 $test "$also" && echo " "
14821 echo "Your C pre-processor ${also}defines the following symbols:"
14822 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
14824 cppsymbols=`$cat ccsym.cpp`
14825 cppsymbols=`echo $cppsymbols`
14826 $test "$silent" || sleep 1
14828 if $test -s ccsym.own; then
14829 $test "$also" && echo " "
14830 echo "Your C compiler ${also}defines the following cpp symbols:"
14831 $sed -e 's/\(..*\)=1/\1/' ccsym.own
14832 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
14833 ccsymbols=`$cat ccsym.own`
14834 ccsymbols=`echo $ccsymbols`
14835 $test "$silent" || sleep 1
14838 $rm -f ccsym* Cppsym.*
14840 : see if this is a termio system
14844 if $test `./findhdr termios.h`; then
14845 set tcsetattr i_termios
14851 "$define") echo "You have POSIX termios.h... good!" >&4;;
14852 *) if ./Cppsym pyr; then
14853 case "`/bin/universe`" in
14854 ucb) if $test `./findhdr sgtty.h`; then
14856 echo "<sgtty.h> found." >&4
14858 echo "System is pyramid with BSD universe."
14859 echo "<sgtty.h> not found--you could have problems." >&4
14861 *) if $test `./findhdr termio.h`; then
14863 echo "<termio.h> found." >&4
14865 echo "System is pyramid with USG universe."
14866 echo "<termio.h> not found--you could have problems." >&4
14870 if $test `./findhdr termio.h`; then
14871 echo "<termio.h> found." >&4
14873 elif $test `./findhdr sgtty.h`; then
14874 echo "<sgtty.h> found." >&4
14877 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
14880 if $test `./findhdr sgtty.h`; then
14881 echo "<sgtty.h> found." >&4
14883 elif $test `./findhdr termio.h`; then
14884 echo "<termio.h> found." >&4
14887 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
14891 set i_termio; eval $setvar
14892 val=$val2; set i_sgtty; eval $setvar
14893 val=$val3; set i_termios; eval $setvar
14895 : see if this is a shadow.h system
14896 set shadow.h i_shadow
14899 : see if stdarg is available
14901 if $test `./findhdr stdarg.h`; then
14902 echo "<stdarg.h> found." >&4
14905 echo "<stdarg.h> NOT found." >&4
14909 : see if varags is available
14911 if $test `./findhdr varargs.h`; then
14912 echo "<varargs.h> found." >&4
14914 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
14917 : set up the varargs testing programs
14918 $cat > varargs.c <<EOP
14920 #include <stdarg.h>
14923 #include <varargs.h>
14927 int f(char *p, ...)
14941 p = va_arg(ap, char *);
14946 $cat > varargs <<EOP
14948 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
14957 : now check which varargs header should be included
14962 if `./varargs I_STDARG`; then
14964 elif `./varargs I_VARARGS`; then
14969 if `./varargs I_VARARGS`; then
14976 echo "I could not find the definition for va_dcl... You have problems..." >&4
14977 val="$undef"; set i_stdarg; eval $setvar
14978 val="$undef"; set i_varargs; eval $setvar
14983 case "$i_varhdr" in
14985 val="$define"; set i_stdarg; eval $setvar
14986 val="$undef"; set i_varargs; eval $setvar
14989 val="$undef"; set i_stdarg; eval $setvar
14990 val="$define"; set i_varargs; eval $setvar
14993 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
14997 : see if stddef is available
14998 set stddef.h i_stddef
15001 : see if this is a sunmath.h system
15002 set sunmath.h i_sunmath
15005 : see if sys/access.h is available
15006 set sys/access.h i_sysaccess
15009 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
15010 set sys/filio.h i_sysfilio
15013 if $test `./findhdr sys/ioctl.h`; then
15015 echo '<sys/ioctl.h> found.' >&4
15018 if $test $i_sysfilio = "$define"; then
15019 echo '<sys/ioctl.h> NOT found.' >&4
15021 $test $i_sgtty = "$define" && xxx="sgtty.h"
15022 $test $i_termio = "$define" && xxx="termio.h"
15023 $test $i_termios = "$define" && xxx="termios.h"
15024 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
15031 : see if this is a syslog.h system
15032 set syslog.h i_syslog
15036 : see if this is a sys/mode.h system
15037 set sys/mode.h i_sysmode
15040 : see if sys/resource.h has to be included
15041 set sys/resource.h i_sysresrc
15044 : see if sys/security.h is available
15045 set sys/security.h i_syssecrt
15048 : see if this is a sys/statvfs.h system
15049 set sys/statvfs.h i_sysstatvfs
15052 : see if this is a sys/uio.h system
15053 set sys/uio.h i_sysuio
15056 : see if this is a sys/un.h system
15057 set sys/un.h i_sysun
15061 : see if this is a sys/utsname.h system
15062 set sys/utsname.h i_sysutsname
15065 : see if this is a syswait system
15066 set sys/wait.h i_syswait
15069 : see if this is a ustat.h system
15070 set ustat.h i_ustat
15073 : see if this is an utime system
15074 set utime.h i_utime
15077 : see if this is a values.h system
15078 set values.h i_values
15081 : see if this is a vfork system
15084 set vfork.h i_vfork
15092 : see if gdbm.h is available
15097 : see if gdbm_open exists
15098 set gdbm_open d_gdbm_open
15100 case "$d_gdbm_open" in
15103 echo "We won't be including <gdbm.h>"
15113 echo "Looking for extensions..." >&4
15114 : If we are using the old config.sh, known_extensions may contain
15115 : old or inaccurate or duplicate values.
15116 known_extensions=''
15117 nonxs_extensions=''
15118 : We do not use find because it might not be available.
15119 : We do not just use MANIFEST because the user may have dropped
15120 : some additional extensions into the source tree and expect them
15123 : Function to recursively find available extensions, ignoring DynaLoader
15124 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
15128 DynaLoader|dynaload) ;;
15130 if $test -f $xxx/$xxx.xs; then
15131 known_extensions="$known_extensions $1$xxx";
15132 elif $test -f $xxx/Makefile.PL; then
15133 nonxs_extensions="$nonxs_extensions $1$xxx";
15135 if $test -d $xxx -a $# -lt 10; then
15138 eval $find_extensions;
15150 eval $find_extensions
15151 set X $nonxs_extensions
15153 nonxs_extensions="$*"
15154 set X $known_extensions
15156 known_extensions="$*"
15159 : Now see which are supported on this system.
15161 for xxx in $known_extensions ; do
15165 $define) avail_ext="$avail_ext $xxx" ;;
15168 GDBM_File|gdbm_fil)
15170 $define) avail_ext="$avail_ext $xxx" ;;
15173 NDBM_File|ndbm_fil)
15176 case "$osname-$use64bitint" in
15179 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
15182 *) avail_ext="$avail_ext $xxx" ;;
15187 ODBM_File|odbm_fil)
15188 case "${i_dbm}${i_rpcsvcdbm}" in
15190 case "$osname-$use64bitint" in
15193 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
15196 *) avail_ext="$avail_ext $xxx" ;;
15202 case "$useposix" in
15203 true|define|y) avail_ext="$avail_ext $xxx" ;;
15207 case "$useopcode" in
15208 true|define|y) avail_ext="$avail_ext $xxx" ;;
15212 case "$d_socket" in
15213 true|$define|y) avail_ext="$avail_ext $xxx" ;;
15216 Sys/Syslog|sys/syslog)
15217 : XXX syslog requires socket
15218 case "$d_socket" in
15219 true|$define|y) avail_ext="$avail_ext $xxx" ;;
15223 case "$usethreads" in
15224 true|$define|y) avail_ext="$avail_ext $xxx" ;;
15228 : XXX Do we need a useipcsysv variable here
15229 case "${d_msg}${d_sem}${d_shm}" in
15230 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
15233 *) avail_ext="$avail_ext $xxx"
15242 : Now see which nonxs extensions are supported on this system.
15243 : For now assume all are.
15245 for xxx in $nonxs_extensions ; do
15247 *) nonxs_ext="$nonxs_ext $xxx"
15259 A number of extensions are supplied with $package. You may choose to
15260 compile these extensions for dynamic loading (the default), compile
15261 them into the $package executable (static loading), or not include
15262 them at all. Answer "none" to include no extensions.
15263 Note that DynaLoader is always built and need not be mentioned here.
15266 case "$dynamic_ext" in
15267 '') dflt="$avail_ext" ;;
15268 *) dflt="$dynamic_ext"
15269 # Perhaps we are reusing an old out-of-date config.sh.
15272 if test X"$dynamic_ext" != X"$avail_ext"; then
15274 NOTICE: Your previous config.sh list may be incorrect.
15275 The extensions now available to you are
15277 but the default list from your previous config.sh is
15289 rp="What extensions do you wish to load dynamically?"
15292 none) dynamic_ext=' ' ;;
15293 *) dynamic_ext="$ans" ;;
15296 case "$static_ext" in
15298 : Exclude those already listed in dynamic linking
15300 for xxx in $avail_ext; do
15301 case " $dynamic_ext " in
15303 *) dflt="$dflt $xxx" ;;
15310 *) dflt="$static_ext"
15317 rp="What extensions do you wish to load statically?"
15320 none) static_ext=' ' ;;
15321 *) static_ext="$ans" ;;
15326 A number of extensions are supplied with $package. Answer "none"
15327 to include no extensions.
15328 Note that DynaLoader is always built and need not be mentioned here.
15331 case "$static_ext" in
15332 '') dflt="$avail_ext" ;;
15333 *) dflt="$static_ext"
15334 # Perhaps we are reusing an old out-of-date config.sh.
15337 if test X"$static_ext" != X"$avail_ext"; then
15339 NOTICE: Your previous config.sh list may be incorrect.
15340 The extensions now available to you are
15342 but the default list from your previous config.sh is
15351 : Exclude those that are not xs extensions
15355 rp="What extensions do you wish to include?"
15358 none) static_ext=' ' ;;
15359 *) static_ext="$ans" ;;
15364 set X $dynamic_ext $static_ext $nonxs_ext
15368 : Remove libraries needed only for extensions
15369 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
15370 : The exception is SunOS 4.x, which needs them.
15371 case "${osname}X${osvers}" in
15375 *) case "$usedl" in
15376 $define|true|[yY]*)
15377 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
15381 *) perllibs="$libs"
15387 : Remove build directory name from cppstdin so it can be used from
15388 : either the present location or the final installed location.
15390 : Get out of the UU directory to get correct path name.
15392 case "$cppstdin" in
15394 echo "Stripping down cppstdin path name"
15400 : end of configuration questions
15402 echo "End of configuration questions."
15405 : back to where it started
15406 if test -d ../UU; then
15410 : configuration may be patched via a 'config.over' file
15411 if $test -f config.over; then
15414 rp='I see a config.over file. Do you wish to load it?'
15417 n*) echo "OK, I'll ignore it.";;
15419 echo "Configuration override changes have been loaded."
15424 : in case they want portability, strip down executable paths
15425 case "$d_portable" in
15428 echo "Stripping down executable paths..." >&4
15429 for file in $loclist $trylist; do
15431 eval $file=`basename $temp`
15436 : create config.sh file
15438 echo "Creating config.sh..." >&4
15439 $spitshell <<EOT >config.sh
15442 # This file was produced by running the Configure script. It holds all the
15443 # definitions figured out by Configure. Should you modify one of these values,
15444 # do not forget to propagate your changes by running "Configure -der". You may
15445 # instead choose to run each of the .SH files by yourself, or "Configure -S".
15448 # Package name : $package
15449 # Source directory : $src
15450 # Configuration time: $cf_time
15451 # Configured by : $cf_by
15452 # Target system : $myuname
15462 Revision='$Revision'
15469 alignbytes='$alignbytes'
15470 ansi2knr='$ansi2knr'
15471 aphostname='$aphostname'
15472 api_revision='$api_revision'
15473 api_subversion='$api_subversion'
15474 api_version='$api_version'
15475 api_versionstring='$api_versionstring'
15478 archlibexp='$archlibexp'
15479 archname64='$archname64'
15480 archname='$archname'
15481 archobjs='$archobjs'
15486 bincompat5005='$bincompat5005'
15490 byteorder='$byteorder'
15492 castflags='$castflags'
15495 cccdlflags='$cccdlflags'
15496 ccdlflags='$ccdlflags'
15498 ccflags_uselargefiles='$ccflags_uselargefiles'
15500 ccsymbols='$ccsymbols'
15501 ccversion='$ccversion'
15503 cf_email='$cf_email'
15505 charsize='$charsize'
15509 clocktype='$clocktype'
15511 compress='$compress'
15512 contains='$contains'
15516 cpp_stuff='$cpp_stuff'
15517 cppccsymbols='$cppccsymbols'
15518 cppflags='$cppflags'
15520 cppminus='$cppminus'
15522 cppstdin='$cppstdin'
15523 cppsymbols='$cppsymbols'
15524 crosscompile='$crosscompile'
15525 cryptlib='$cryptlib'
15527 d_Gconvert='$d_Gconvert'
15528 d_PRIEUldbl='$d_PRIEUldbl'
15529 d_PRIFUldbl='$d_PRIFUldbl'
15530 d_PRIGUldbl='$d_PRIGUldbl'
15531 d_PRIXU64='$d_PRIXU64'
15532 d_PRId64='$d_PRId64'
15533 d_PRIeldbl='$d_PRIeldbl'
15534 d_PRIfldbl='$d_PRIfldbl'
15535 d_PRIgldbl='$d_PRIgldbl'
15536 d_PRIi64='$d_PRIi64'
15537 d_PRIo64='$d_PRIo64'
15538 d_PRIu64='$d_PRIu64'
15539 d_PRIx64='$d_PRIx64'
15540 d_SCNfldbl='$d_SCNfldbl'
15541 d__fwalk='$d__fwalk'
15542 d_access='$d_access'
15543 d_accessx='$d_accessx'
15545 d_archlib='$d_archlib'
15548 d_attribut='$d_attribut'
15551 d_bincompat5005='$d_bincompat5005'
15553 d_bsdgetpgrp='$d_bsdgetpgrp'
15554 d_bsdsetpgrp='$d_bsdsetpgrp'
15556 d_casti32='$d_casti32'
15557 d_castneg='$d_castneg'
15558 d_charvspr='$d_charvspr'
15560 d_chroot='$d_chroot'
15561 d_chsize='$d_chsize'
15562 d_closedir='$d_closedir'
15566 d_cuserid='$d_cuserid'
15567 d_dbl_dig='$d_dbl_dig'
15568 d_difftime='$d_difftime'
15569 d_dirnamlen='$d_dirnamlen'
15570 d_dlerror='$d_dlerror'
15571 d_dlopen='$d_dlopen'
15572 d_dlsymun='$d_dlsymun'
15573 d_dosuid='$d_dosuid'
15574 d_drand48proto='$d_drand48proto'
15576 d_eaccess='$d_eaccess'
15577 d_endgrent='$d_endgrent'
15578 d_endhent='$d_endhent'
15579 d_endnent='$d_endnent'
15580 d_endpent='$d_endpent'
15581 d_endpwent='$d_endpwent'
15582 d_endsent='$d_endsent'
15583 d_eofnblk='$d_eofnblk'
15584 d_eunice='$d_eunice'
15585 d_fchmod='$d_fchmod'
15586 d_fchown='$d_fchown'
15588 d_fcntl_can_lock='$d_fcntl_can_lock'
15589 d_fd_macros='$d_fd_macros'
15590 d_fd_set='$d_fd_set'
15591 d_fds_bits='$d_fds_bits'
15592 d_fgetpos='$d_fgetpos'
15593 d_flexfnam='$d_flexfnam'
15596 d_fpathconf='$d_fpathconf'
15597 d_fpos64_t='$d_fpos64_t'
15598 d_frexpl='$d_frexpl'
15599 d_fs_data_s='$d_fs_data_s'
15600 d_fseeko='$d_fseeko'
15601 d_fsetpos='$d_fsetpos'
15602 d_fstatfs='$d_fstatfs'
15603 d_fstatvfs='$d_fstatvfs'
15605 d_ftello='$d_ftello'
15607 d_getcwd='$d_getcwd'
15608 d_getespwnam='$d_getespwnam'
15609 d_getfsstat='$d_getfsstat'
15610 d_getgrent='$d_getgrent'
15611 d_getgrps='$d_getgrps'
15612 d_gethbyaddr='$d_gethbyaddr'
15613 d_gethbyname='$d_gethbyname'
15614 d_gethent='$d_gethent'
15615 d_gethname='$d_gethname'
15616 d_gethostprotos='$d_gethostprotos'
15617 d_getlogin='$d_getlogin'
15618 d_getmnt='$d_getmnt'
15619 d_getmntent='$d_getmntent'
15620 d_getnbyaddr='$d_getnbyaddr'
15621 d_getnbyname='$d_getnbyname'
15622 d_getnent='$d_getnent'
15623 d_getnetprotos='$d_getnetprotos'
15624 d_getpagsz='$d_getpagsz'
15625 d_getpbyname='$d_getpbyname'
15626 d_getpbynumber='$d_getpbynumber'
15627 d_getpent='$d_getpent'
15628 d_getpgid='$d_getpgid'
15629 d_getpgrp2='$d_getpgrp2'
15630 d_getpgrp='$d_getpgrp'
15631 d_getppid='$d_getppid'
15632 d_getprior='$d_getprior'
15633 d_getprotoprotos='$d_getprotoprotos'
15634 d_getprpwnam='$d_getprpwnam'
15635 d_getpwent='$d_getpwent'
15636 d_getsbyname='$d_getsbyname'
15637 d_getsbyport='$d_getsbyport'
15638 d_getsent='$d_getsent'
15639 d_getservprotos='$d_getservprotos'
15640 d_getspnam='$d_getspnam'
15641 d_gettimeod='$d_gettimeod'
15642 d_gnulibc='$d_gnulibc'
15643 d_grpasswd='$d_grpasswd'
15644 d_hasmntopt='$d_hasmntopt'
15648 d_inetaton='$d_inetaton'
15649 d_int64_t='$d_int64_t'
15650 d_isascii='$d_isascii'
15652 d_isnanl='$d_isnanl'
15653 d_killpg='$d_killpg'
15654 d_lchown='$d_lchown'
15655 d_ldbl_dig='$d_ldbl_dig'
15657 d_locconv='$d_locconv'
15659 d_longdbl='$d_longdbl'
15660 d_longlong='$d_longlong'
15661 d_lseekproto='$d_lseekproto'
15663 d_madvise='$d_madvise'
15665 d_mbstowcs='$d_mbstowcs'
15666 d_mbtowc='$d_mbtowc'
15667 d_memchr='$d_memchr'
15668 d_memcmp='$d_memcmp'
15669 d_memcpy='$d_memcpy'
15670 d_memmove='$d_memmove'
15671 d_memset='$d_memset'
15673 d_mkdtemp='$d_mkdtemp'
15674 d_mkfifo='$d_mkfifo'
15675 d_mkstemp='$d_mkstemp'
15676 d_mkstemps='$d_mkstemps'
15677 d_mktime='$d_mktime'
15680 d_mprotect='$d_mprotect'
15682 d_msg_ctrunc='$d_msg_ctrunc'
15683 d_msg_dontroute='$d_msg_dontroute'
15684 d_msg_oob='$d_msg_oob'
15685 d_msg_peek='$d_msg_peek'
15686 d_msg_proxy='$d_msg_proxy'
15687 d_msgctl='$d_msgctl'
15688 d_msgget='$d_msgget'
15689 d_msgrcv='$d_msgrcv'
15690 d_msgsnd='$d_msgsnd'
15692 d_munmap='$d_munmap'
15693 d_mymalloc='$d_mymalloc'
15695 d_nv_preserves_uv='$d_nv_preserves_uv'
15696 d_nv_preserves_uv_bits='$d_nv_preserves_uv_bits'
15697 d_off64_t='$d_off64_t'
15698 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
15699 d_oldpthreads='$d_oldpthreads'
15700 d_oldsock='$d_oldsock'
15702 d_pathconf='$d_pathconf'
15704 d_perl_otherlibdirs='$d_perl_otherlibdirs'
15705 d_phostname='$d_phostname'
15708 d_portable='$d_portable'
15709 d_pthread_yield='$d_pthread_yield'
15711 d_pwchange='$d_pwchange'
15712 d_pwclass='$d_pwclass'
15713 d_pwcomment='$d_pwcomment'
15714 d_pwexpire='$d_pwexpire'
15715 d_pwgecos='$d_pwgecos'
15716 d_pwpasswd='$d_pwpasswd'
15717 d_pwquota='$d_pwquota'
15720 d_readdir='$d_readdir'
15721 d_readlink='$d_readlink'
15722 d_rename='$d_rename'
15723 d_rewinddir='$d_rewinddir'
15725 d_safebcpy='$d_safebcpy'
15726 d_safemcpy='$d_safemcpy'
15727 d_sanemcmp='$d_sanemcmp'
15728 d_sbrkproto='$d_sbrkproto'
15729 d_sched_yield='$d_sched_yield'
15730 d_scm_rights='$d_scm_rights'
15731 d_seekdir='$d_seekdir'
15732 d_select='$d_select'
15734 d_semctl='$d_semctl'
15735 d_semctl_semid_ds='$d_semctl_semid_ds'
15736 d_semctl_semun='$d_semctl_semun'
15737 d_semget='$d_semget'
15739 d_setegid='$d_setegid'
15740 d_seteuid='$d_seteuid'
15741 d_setgrent='$d_setgrent'
15742 d_setgrps='$d_setgrps'
15743 d_sethent='$d_sethent'
15744 d_setlinebuf='$d_setlinebuf'
15745 d_setlocale='$d_setlocale'
15746 d_setnent='$d_setnent'
15747 d_setpent='$d_setpent'
15748 d_setpgid='$d_setpgid'
15749 d_setpgrp2='$d_setpgrp2'
15750 d_setpgrp='$d_setpgrp'
15751 d_setprior='$d_setprior'
15752 d_setproctitle='$d_setproctitle'
15753 d_setpwent='$d_setpwent'
15754 d_setregid='$d_setregid'
15755 d_setresgid='$d_setresgid'
15756 d_setresuid='$d_setresuid'
15757 d_setreuid='$d_setreuid'
15758 d_setrgid='$d_setrgid'
15759 d_setruid='$d_setruid'
15760 d_setsent='$d_setsent'
15761 d_setsid='$d_setsid'
15762 d_setvbuf='$d_setvbuf'
15766 d_shmatprototype='$d_shmatprototype'
15767 d_shmctl='$d_shmctl'
15769 d_shmget='$d_shmget'
15770 d_sigaction='$d_sigaction'
15771 d_sigsetjmp='$d_sigsetjmp'
15772 d_socket='$d_socket'
15773 d_socklen_t='$d_socklen_t'
15774 d_sockpair='$d_sockpair'
15775 d_socks5_init='$d_socks5_init'
15777 d_statblks='$d_statblks'
15778 d_statfs_f_flags='$d_statfs_f_flags'
15779 d_statfs_s='$d_statfs_s'
15780 d_statvfs='$d_statvfs'
15781 d_stdio_cnt_lval='$d_stdio_cnt_lval'
15782 d_stdio_ptr_lval='$d_stdio_ptr_lval'
15783 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
15784 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
15785 d_stdio_stream_array='$d_stdio_stream_array'
15786 d_stdiobase='$d_stdiobase'
15787 d_stdstdio='$d_stdstdio'
15788 d_strchr='$d_strchr'
15789 d_strcoll='$d_strcoll'
15790 d_strctcpy='$d_strctcpy'
15791 d_strerrm='$d_strerrm'
15792 d_strerror='$d_strerror'
15793 d_strtod='$d_strtod'
15794 d_strtol='$d_strtol'
15795 d_strtold='$d_strtold'
15796 d_strtoll='$d_strtoll'
15797 d_strtoul='$d_strtoul'
15798 d_strtoull='$d_strtoull'
15799 d_strtouq='$d_strtouq'
15800 d_strxfrm='$d_strxfrm'
15801 d_suidsafe='$d_suidsafe'
15802 d_symlink='$d_symlink'
15803 d_syscall='$d_syscall'
15804 d_sysconf='$d_sysconf'
15805 d_sysernlst='$d_sysernlst'
15806 d_syserrlst='$d_syserrlst'
15807 d_system='$d_system'
15808 d_tcgetpgrp='$d_tcgetpgrp'
15809 d_tcsetpgrp='$d_tcsetpgrp'
15810 d_telldir='$d_telldir'
15811 d_telldirproto='$d_telldirproto'
15814 d_truncate='$d_truncate'
15815 d_tzname='$d_tzname'
15818 d_union_semun='$d_union_semun'
15820 d_vendorarch='$d_vendorarch'
15821 d_vendorbin='$d_vendorbin'
15822 d_vendorlib='$d_vendorlib'
15824 d_void_closedir='$d_void_closedir'
15825 d_voidsig='$d_voidsig'
15826 d_voidtty='$d_voidtty'
15827 d_volatile='$d_volatile'
15828 d_vprintf='$d_vprintf'
15830 d_waitpid='$d_waitpid'
15831 d_wcstombs='$d_wcstombs'
15832 d_wctomb='$d_wctomb'
15835 db_hashtype='$db_hashtype'
15836 db_prefixtype='$db_prefixtype'
15837 defvoidused='$defvoidused'
15838 direntrytype='$direntrytype'
15841 doublesize='$doublesize'
15843 dynamic_ext='$dynamic_ext'
15849 eunicefix='$eunicefix'
15852 extensions='$extensions'
15853 fflushNULL='$fflushNULL'
15854 fflushall='$fflushall'
15856 firstmakefile='$firstmakefile'
15858 fpossize='$fpossize'
15859 fpostype='$fpostype'
15860 freetype='$freetype'
15862 full_csh='$full_csh'
15863 full_sed='$full_sed'
15864 gccosandvers='$gccosandvers'
15865 gccversion='$gccversion'
15866 gidformat='$gidformat'
15872 groupcat='$groupcat'
15873 groupstype='$groupstype'
15876 h_sysfile='$h_sysfile'
15887 i_arpainet='$i_arpainet'
15888 i_bsdioctl='$i_bsdioctl'
15891 i_dirent='$i_dirent'
15899 i_ieeefp='$i_ieeefp'
15900 i_inttypes='$i_inttypes'
15901 i_libutil='$i_libutil'
15902 i_limits='$i_limits'
15903 i_locale='$i_locale'
15904 i_machcthr='$i_machcthr'
15905 i_malloc='$i_malloc'
15907 i_memory='$i_memory'
15908 i_mntent='$i_mntent'
15911 i_neterrno='$i_neterrno'
15912 i_netinettcp='$i_netinettcp'
15916 i_pthread='$i_pthread'
15918 i_rpcsvcdbm='$i_rpcsvcdbm'
15921 i_shadow='$i_shadow'
15923 i_stdarg='$i_stdarg'
15924 i_stddef='$i_stddef'
15925 i_stdlib='$i_stdlib'
15926 i_string='$i_string'
15927 i_sunmath='$i_sunmath'
15928 i_sysaccess='$i_sysaccess'
15929 i_sysdir='$i_sysdir'
15930 i_sysfile='$i_sysfile'
15931 i_sysfilio='$i_sysfilio'
15933 i_sysioctl='$i_sysioctl'
15934 i_syslog='$i_syslog'
15935 i_sysmman='$i_sysmman'
15936 i_sysmode='$i_sysmode'
15937 i_sysmount='$i_sysmount'
15938 i_sysndir='$i_sysndir'
15939 i_sysparam='$i_sysparam'
15940 i_sysresrc='$i_sysresrc'
15941 i_syssecrt='$i_syssecrt'
15942 i_sysselct='$i_sysselct'
15943 i_syssockio='$i_syssockio'
15944 i_sysstat='$i_sysstat'
15945 i_sysstatfs='$i_sysstatfs'
15946 i_sysstatvfs='$i_sysstatvfs'
15947 i_systime='$i_systime'
15948 i_systimek='$i_systimek'
15949 i_systimes='$i_systimes'
15950 i_systypes='$i_systypes'
15951 i_sysuio='$i_sysuio'
15953 i_sysutsname='$i_sysutsname'
15954 i_sysvfs='$i_sysvfs'
15955 i_syswait='$i_syswait'
15956 i_termio='$i_termio'
15957 i_termios='$i_termios'
15959 i_unistd='$i_unistd'
15962 i_values='$i_values'
15963 i_varargs='$i_varargs'
15964 i_varhdr='$i_varhdr'
15966 ignore_versioned_solibs='$ignore_versioned_solibs'
15967 inc_version_list='$inc_version_list'
15968 inc_version_list_init='$inc_version_list_init'
15971 installarchlib='$installarchlib'
15972 installbin='$installbin'
15973 installman1dir='$installman1dir'
15974 installman3dir='$installman3dir'
15975 installprefix='$installprefix'
15976 installprefixexp='$installprefixexp'
15977 installprivlib='$installprivlib'
15978 installscript='$installscript'
15979 installsitearch='$installsitearch'
15980 installsitebin='$installsitebin'
15981 installsitelib='$installsitelib'
15982 installstyle='$installstyle'
15983 installusrbinperl='$installusrbinperl'
15984 installvendorarch='$installvendorarch'
15985 installvendorbin='$installvendorbin'
15986 installvendorlib='$installvendorlib'
15988 ivdformat='$ivdformat'
15991 known_extensions='$known_extensions'
15994 lddlflags='$lddlflags'
15996 ldflags_uselargefiles='$ldflags_uselargefiles'
15997 ldlibpthname='$ldlibpthname'
16004 libsdirs='$libsdirs'
16005 libsfiles='$libsfiles'
16006 libsfound='$libsfound'
16007 libspath='$libspath'
16008 libswanted='$libswanted'
16009 libswanted_uselargefiles='$libswanted_uselargefiles'
16015 locincpth='$locincpth'
16016 loclibpth='$loclibpth'
16017 longdblsize='$longdblsize'
16018 longlongsize='$longlongsize'
16019 longsize='$longsize'
16023 lseeksize='$lseeksize'
16024 lseektype='$lseektype'
16028 make_set_make='$make_set_make'
16029 mallocobj='$mallocobj'
16030 mallocsrc='$mallocsrc'
16031 malloctype='$malloctype'
16033 man1direxp='$man1direxp'
16036 man3direxp='$man3direxp'
16038 mips_type='$mips_type'
16040 mmaptype='$mmaptype'
16041 modetype='$modetype'
16043 multiarch='$multiarch'
16045 myarchname='$myarchname'
16046 mydomain='$mydomain'
16047 myhostname='$myhostname'
16050 netdb_hlen_type='$netdb_hlen_type'
16051 netdb_host_type='$netdb_host_type'
16052 netdb_name_type='$netdb_name_type'
16053 netdb_net_type='$netdb_net_type'
16056 nm_so_opt='$nm_so_opt'
16057 nonxs_ext='$nonxs_ext'
16059 nvEUformat='$nvEUformat'
16060 nvFUformat='$nvFUformat'
16061 nvGUformat='$nvGUformat'
16062 nveformat='$nveformat'
16063 nvfformat='$nvfformat'
16064 nvgformat='$nvgformat'
16067 o_nonblock='$o_nonblock'
16069 old_pthread_create_joinable='$old_pthread_create_joinable'
16070 optimize='$optimize'
16071 orderlib='$orderlib'
16074 otherlibdirs='$otherlibdirs'
16078 patchlevel='$patchlevel'
16079 path_sep='$path_sep'
16082 perladmin='$perladmin'
16083 perllibs='$perllibs'
16084 perlpath='$perlpath'
16086 phostname='$phostname'
16089 pm_apiversion='$pm_apiversion'
16093 prefixexp='$prefixexp'
16095 privlibexp='$privlibexp'
16096 prototype='$prototype'
16098 quadkind='$quadkind'
16099 quadtype='$quadtype'
16100 randbits='$randbits'
16101 randfunc='$randfunc'
16102 randseedtype='$randseedtype'
16104 rd_nodata='$rd_nodata'
16105 revision='$revision'
16109 sPRIEUldbl='$sPRIEUldbl'
16110 sPRIFUldbl='$sPRIFUldbl'
16111 sPRIGUldbl='$sPRIGUldbl'
16112 sPRIXU64='$sPRIXU64'
16114 sPRIeldbl='$sPRIeldbl'
16115 sPRIfldbl='$sPRIfldbl'
16116 sPRIgldbl='$sPRIgldbl'
16121 sSCNfldbl='$sSCNfldbl'
16122 sched_yield='$sched_yield'
16123 scriptdir='$scriptdir'
16124 scriptdirexp='$scriptdirexp'
16126 seedfunc='$seedfunc'
16127 selectminbits='$selectminbits'
16128 selecttype='$selecttype'
16129 sendmail='$sendmail'
16132 sharpbang='$sharpbang'
16133 shmattype='$shmattype'
16134 shortsize='$shortsize'
16137 sig_count='$sig_count'
16138 sig_name='$sig_name'
16139 sig_name_init='$sig_name_init'
16141 sig_num_init='$sig_num_init'
16142 signal_t='$signal_t'
16143 sitearch='$sitearch'
16144 sitearchexp='$sitearchexp'
16146 sitebinexp='$sitebinexp'
16148 sitelib_stem='$sitelib_stem'
16149 sitelibexp='$sitelibexp'
16150 siteprefix='$siteprefix'
16151 siteprefixexp='$siteprefixexp'
16152 sizesize='$sizesize'
16153 sizetype='$sizetype'
16157 sockethdr='$sockethdr'
16158 socketlib='$socketlib'
16159 socksizetype='$socksizetype'
16161 spackage='$spackage'
16162 spitshell='$spitshell'
16164 ssizetype='$ssizetype'
16165 startperl='$startperl'
16167 static_ext='$static_ext'
16169 stdio_base='$stdio_base'
16170 stdio_bufsiz='$stdio_bufsiz'
16171 stdio_cnt='$stdio_cnt'
16172 stdio_filbuf='$stdio_filbuf'
16173 stdio_ptr='$stdio_ptr'
16174 stdio_stream_array='$stdio_stream_array'
16177 subversion='$subversion'
16184 timeincl='$timeincl'
16185 timetype='$timetype'
16198 uidformat='$uidformat'
16204 uquadtype='$uquadtype'
16205 use5005threads='$use5005threads'
16206 use64bitall='$use64bitall'
16207 use64bitint='$use64bitint'
16209 useithreads='$useithreads'
16210 uselargefiles='$uselargefiles'
16211 uselongdouble='$uselongdouble'
16212 usemorebits='$usemorebits'
16213 usemultiplicity='$usemultiplicity'
16214 usemymalloc='$usemymalloc'
16216 useopcode='$useopcode'
16217 useperlio='$useperlio'
16218 useposix='$useposix'
16220 useshrplib='$useshrplib'
16221 usesocks='$usesocks'
16222 usethreads='$usethreads'
16223 usevendorprefix='$usevendorprefix'
16224 usevfork='$usevfork'
16227 uvXUformat='$uvXUformat'
16228 uvoformat='$uvoformat'
16231 uvuformat='$uvuformat'
16232 uvxformat='$uvxformat'
16233 vendorarch='$vendorarch'
16234 vendorarchexp='$vendorarchexp'
16235 vendorbin='$vendorbin'
16236 vendorbinexp='$vendorbinexp'
16237 vendorlib='$vendorlib'
16238 vendorlib_stem='$vendorlib_stem'
16239 vendorlibexp='$vendorlibexp'
16240 vendorprefix='$vendorprefix'
16241 vendorprefixexp='$vendorprefixexp'
16243 versiononly='$versiononly'
16245 voidflags='$voidflags'
16247 xs_apiversion='$xs_apiversion'
16252 : Add in command line options if available
16253 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
16255 : add special variables
16256 $test -f $src/patchlevel.h && \
16257 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
16258 echo "CONFIGDOTSH=true" >>config.sh
16260 : propagate old symbols
16261 if $test -f UU/config.sh; then
16262 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
16263 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
16264 $sort | $uniq -u >UU/oldsyms
16265 set X `cat UU/oldsyms`
16271 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
16273 echo "# Variables propagated from previous config.sh file." >>config.sh
16274 for sym in `cat UU/oldsyms`; do
16275 echo " Propagating $hint variable "'$'"$sym..."
16276 eval 'tmp="$'"${sym}"'"'
16278 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
16284 : Finish up by extracting the .SH files
16298 If you'd like to make any changes to the config.sh file before I begin
16299 to configure things, do it as a shell escape now (e.g. !vi config.sh).
16302 rp="Press return or use a shell escape to edit config.sh:"
16307 *) : in case they cannot read
16308 sh 1>&4 -c "$ans";;
16313 : if this fails, just run all the .SH files by hand
16320 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
16327 Now you need to generate make dependencies by running "$make depend".
16328 You might prefer to run it in background: "$make depend > makedepend.out &"
16329 It can take a while, so you might not want to run it right now.
16334 rp="Run $make depend now?"
16338 $make depend && echo "Now you must run '$make'."
16341 echo "You must run '$make depend' then '$make'."
16344 elif test -f [Mm]akefile; then
16346 echo "Now you must run a $make."
16351 if $test -f Policy.sh; then
16354 If you compile $package on a different machine or from a different object
16355 directory, copy the Policy.sh file from this object directory to the
16356 new one before you run Configure -- this will help you with most of
16357 the policy defaults.
16361 if $test -f config.msg; then
16362 echo "Hmm. I also noted the following information while running:"
16364 $cat config.msg >&4
16367 $rm -f kit*isdone ark*isdone