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 Sun Jan 21 21:30:32 EET 2001 [metaconfig 3.0 PL70]
24 # (with additional metaconfig patches by perlbug@perl.org)
29 SCO csh still thinks true is false. Write to SCO today and tell them that next
30 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
32 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
33 we'd have to do is go in and swap the && and || tokens, wherever they are.)
35 [End of diatribe. We now return you to your regularly scheduled programming...]
39 OOPS! You naughty creature! You didn't run Configure with sh!
40 I will attempt to remedy the situation by running sh for you...
44 true || exec sh $0 $argv:q
46 (exit $?0) || cat c2$$
47 (exit $?0) || exec sh $0 $argv:q
50 : compute my invocation name
54 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
59 : Proper separator for the PATH environment variable
61 : On OS/2 this directory should exist if this is not floppy only system :-]
62 if test -d c:/. ; then
63 if test -n "$OS2_SHELL"; then
65 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
66 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
67 elif test -n "$DJGPP"; then
73 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
74 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
75 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
76 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
77 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
78 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /usr/ccs/bin"
79 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
80 paths="$paths /sbin /usr/sbin /usr/libexec"
86 *) test -d $p && PATH=$PATH$p_$p ;;
93 : shall we be using ksh?
99 if (PATH=.; alias -x) >/dev/null 2>&1; then
102 if test -f /hp-ux -a -f /bin/ksh; then
103 needksh='to avoid sh bug in "here document" expansion'
105 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
106 if test X`/usr/bin/uname -v` = X4; then
107 avoidksh="to avoid AIX 4's /bin/sh"
111 if test -f /osf_boot -a -f /usr/sbin/setld; then
112 if test X`/usr/bin/uname -s` = XOSF1; then
113 avoidksh="to avoid Digital UNIX' ksh"
115 unset BIN_SH # if this is 'xpg4' sh will start up ksh
118 case "$inksh/$needksh" in
125 case "$inksh/$avoidksh" in
131 case "$inksh/$needksh-$avoidksh-" in
134 (I see you are using the Korn shell. Some ksh's blow up on $me,
135 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
141 echo "(Feeding myself to $newsh $reason.)"
143 Configure|*/Configure) exec $newsh $0 "$@";;
144 *) exec $newsh Configure "$@";;
149 : if needed set CDPATH to a harmless value that is not chatty
150 : avoid bash 2.02 problems with empty CDPATH.
154 *bash*) CDPATH='.' ;;
159 : Configure runs within the UU subdirectory
160 test -d UU || mkdir UU
465 d_old_pthread_create_joinable=''
466 old_pthread_create_joinable=''
545 d_stdio_ptr_lval_nochange_cnt=''
546 d_stdio_ptr_lval_sets_cnt=''
718 inc_version_list_init=''
737 ignore_versioned_solibs=''
796 d_perl_otherlibdirs=''
813 d_nv_preserves_uv_bits=''
912 d_stdio_stream_array=''
913 stdio_stream_array=''
923 ccflags_uselargefiles=''
924 ldflags_uselargefiles=''
925 libswanted_uselargefiles=''
968 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
971 : We must find out about Eunice early
973 if test -f /etc/unixtovms; then
974 eunicefix=/etc/unixtovms
976 if test -f /etc/unixtovms.exe; then
977 eunicefix=/etc/unixtovms.exe
984 : set useposix=false in your hint file to disable the POSIX extension.
986 : set useopcode=false in your hint file to disable the Opcode extension.
988 : Trailing extension. Override this in a hint file, if needed.
990 : Extra object files, if any, needed on this platform.
993 : Possible local include directories to search.
994 : Set locincpth to "" in a hint file to defeat local include searches.
995 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
996 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
998 : no include file wanted by default
1002 : change the next line if compiling for Xenix/286 on Xenix/386
1003 xlibpth='/usr/lib/386 /lib/386'
1004 : Possible local library directories to search.
1005 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1006 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1008 : general looking path for locating libraries
1009 glibpth="/lib /usr/lib $xlibpth"
1010 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1011 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1012 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1014 : Private path used by Configure to find libraries. Its value
1015 : is prepended to libpth. This variable takes care of special
1016 : machines, like the mips. Usually, it should be empty.
1019 : default library list
1021 : some systems want to use only the non-versioned libso:s
1022 ignore_versioned_solibs=''
1024 ccflags_uselargefiles=''
1025 ldflags_uselargefiles=''
1026 libswanted_uselargefiles=''
1027 : set usemultiplicity on the Configure command line to enable multiplicity.
1028 : set usesocks on the Configure command line to enable socks.
1029 : set usethreads on the Configure command line to enable threads.
1030 : full support for void wanted by default
1033 : List of libraries we want.
1034 : If anyone needs -lnet, put it in a hint file.
1035 libswanted='sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl'
1036 libswanted="$libswanted dld ld sun m c cposix posix"
1037 libswanted="$libswanted ndir dir crypt sec"
1038 libswanted="$libswanted ucb bsd BSD PW x iconv util"
1039 : We probably want to search /usr/shlib before most other libraries.
1040 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1041 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1042 glibpth="/usr/shlib $glibpth"
1043 : Do not use vfork unless overridden by a hint file.
1046 : Find the basic shell for Bourne shell scripts
1050 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1053 if test -f "$xxx"; then
1056 : Build up a list and do a single loop so we can 'break' out.
1057 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1058 for xxx in sh bash ksh pdksh ash; do
1060 try="$try ${p}/${xxx}"
1064 if test -f "$xxx"; then
1067 elif test -f "$xxx.exe"; then
1078 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1080 Usually it's in /bin/sh. How did you even get this far?
1081 Please contact me (Perl Maintainers) at perlbug@perl.org and
1082 we'll try to straighten this all out.
1088 : see if sh knows # comments
1089 if `$sh -c '#' >/dev/null 2>&1`; then
1093 test -f $xcat || xcat=/usr/bin/cat
1098 if test -s today; then
1101 echo "#! $xcat" > try
1105 if test -s today; then
1113 echo "Your $sh doesn't grok # comments--I will strip them later on."
1116 echo "exec grep -v '^[ ]*#'" >spitshell
1118 $eunicefix spitshell
1119 spitshell=`pwd`/spitshell
1121 echo "I presume that if # doesn't work, #! won't work either!"
1126 : figure out how to guarantee sh startup
1128 '') startsh=${sharpbang}${sh} ;;
1140 : echo "Yup, it does."
1142 echo "Hmm... '$startsh' does not guarantee sh startup..."
1143 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1148 : Save command line options in file UU/cmdline.opt for later use in
1149 : generating config.sh.
1150 cat > cmdline.opt <<EOSH
1151 # Configure command line arguments.
1158 cat >>cmdline.opt <<EOSH
1159 config_arg$argn='$arg'
1161 argn=`expr $argn + 1`
1164 : produce awk script to parse command line options
1165 cat >options.awk <<'EOF'
1167 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1169 len = length(optstr);
1170 for (i = 1; i <= len; i++) {
1171 c = substr(optstr, i, 1);
1172 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1183 if (substr(str, 1, 1) != "-") {
1184 printf("'%s'\n", str);
1188 for (i = 2; i <= len; i++) {
1189 c = substr(str, i, 1);
1191 printf("-%s\n", substr(str, i));
1197 printf("'%s'\n", substr(str, i + 1));
1210 : process the command line options
1211 set X `for arg in "$@"; do echo "X$arg"; done |
1212 sed -e s/X// | awk -f options.awk`
1217 : set up default values
1227 rm -f optdef.sh posthint.sh
1228 cat >optdef.sh <<EOS
1234 while test $# -gt 0; do
1236 -d) shift; fastread=yes;;
1237 -e) shift; alldone=cont;;
1241 if test -r "$1"; then
1244 echo "$me: cannot read config file $1." >&2
1249 -h) shift; error=true;;
1250 -r) shift; reuseval=true;;
1251 -s) shift; silent=true; realsilent=true;;
1252 -E) shift; alldone=exit;;
1253 -K) shift; knowitall=true;;
1254 -O) shift; override=true;;
1255 -S) shift; silent=true; extractsh=true;;
1260 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1261 echo "$me: ignoring -D $1" >&2
1264 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1265 *) echo "$1='define'" >> optdef.sh;;
1272 *=) echo "$1" >> optdef.sh;;
1274 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1275 echo "$me: ignoring -U $1" >&2
1277 *) echo "$1='undef'" >> optdef.sh;;
1288 *=*) zzz=`echo $yyy|sed 's!=.*!!'`
1292 zzz=" "`echo $yyy|sed 's!^[^=]*=!!'`
1293 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1299 *:*) xxx=`echo $yyy|sed 's!:.*!!'`
1300 yyy=`echo $yyy|sed 's!^[^:]*:!!'`
1301 zzz=`echo $yyy|sed 's!^[^=]*=!!'`
1302 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1303 *) xxx=`echo $yyy|sed 's!:.*!!'`
1304 yyy=`echo $yyy|sed 's!^[^:]*:!!'` ;;
1310 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1312 echo "$yyy=''" >> posthint.sh ;;
1317 echo "$yyy='$zzz'" >> posthint.sh ;;
1319 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1321 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1326 echo "$yyy=$zzz" >> posthint.sh ;;
1327 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1331 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1334 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1342 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1343 [-U symbol] [-U symbol=] [-A command:symbol...]
1344 -d : use defaults for all answers.
1345 -e : go on without questioning past the production of config.sh.
1346 -f : specify an alternate default configuration file.
1347 -h : print this help message and exit (with an error status).
1348 -r : reuse C symbols value if possible (skips costly nm extraction).
1349 -s : silent mode, only echoes questions and essential information.
1350 -D : define symbol to have some value:
1351 -D symbol symbol gets the value 'define'
1352 -D symbol=value symbol gets the value 'value'
1353 -E : stop at the end of questions, after having produced config.sh.
1354 -K : do not use unless you know what you are doing.
1355 -O : let -D and -U override definitions from loaded configuration file.
1356 -S : perform variable substitutions on all .SH files (can mix with -f)
1357 -U : undefine symbol:
1358 -U symbol symbol gets the value 'undef'
1359 -U symbol= symbol gets completely empty
1360 -A : manipulate symbol after the platform specific hints have been applied:
1361 -A symbol=value append " "value to symbol
1362 -A append:symbol=value append value to symbol
1363 -A define:symbol=value define symbol to have value
1364 -A clear:symbol define symbol to be ''
1365 -A define:symbol define symbol to be 'define'
1366 -A eval:symbol=value define symbol to be eval of value
1367 -A prepend:symbol=value prepend value to symbol
1368 -A undef:symbol define symbol to be 'undef'
1369 -A undef:symbol= define symbol to be ''
1370 -V : print version number and exit (with a zero status).
1377 case "$fastread$alldone" in
1380 case "$extractsh" in
1383 if test ! -t 0; then
1384 echo "Say 'sh Configure', not 'sh <Configure'"
1394 true) exec 1>/dev/null;;
1397 : run the defines and the undefines, if any, but leave the file out there...
1400 : create the posthint manipulation script and leave the file out there...
1405 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1406 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1407 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1408 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1409 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1412 : Some greps do not return status, grrr.
1413 echo "grimblepritz" >grimble
1414 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1416 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1422 : the following should work in any shell
1426 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1427 cat >contains <<'EOSS'
1428 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1433 : Find the path to the source tree
1436 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1440 *) src=`cd ../$src && pwd` ;;
1453 if test -f $rsrc/Configure && \
1454 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1456 : found it, so we are ok.
1459 for src in . .. ../.. ../../.. ../../../..; do
1460 if test -f ../$src/Configure && \
1461 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1472 Sorry, I can't seem to locate the source dir for $package. Please start
1473 Configure with an explicit path -- i.e. /some/path/Configure.
1481 echo "Sources for $package found in \"$src\"." >&4
1485 : script used to extract .SH files with variable substitutions
1486 cat >extract <<'EOS'
1488 echo "Doing variable substitutions on .SH files..."
1489 if test -f $src/MANIFEST; then
1490 set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH$'`
1492 echo "(Looking for .SH files under the source directory.)"
1493 set x `(cd $src; find . -name "*.SH" -print)`
1497 0) set x `(cd $src; echo *.SH)`; shift;;
1499 if test ! -f $src/$1; then
1505 while test $name; do
1506 if test ! -d "$name"; then
1507 create="$name $create";
1508 name=`echo $name | sed -e "s|^[^/]*$||"`;
1509 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1514 for file in $create; do
1523 dir=`expr X$file : 'X\(.*\)/'`
1524 file=`expr X$file : 'X.*/\(.*\)'`
1525 (cd $dir && . ./$file)
1535 dir=`expr X$file : 'X\(.*\)/'`
1536 file=`expr X$file : 'X.*/\(.*\)'`
1537 (set x $dir; shift; eval $mkdir_p)
1547 if test -f $src/config_h.SH; then
1548 if test ! -f config.h; then
1549 : oops, they left it out of MANIFEST, probably, so do it anyway.
1555 : extract files and exit if asked to do so
1556 case "$extractsh" in
1558 case "$realsilent" in
1562 case "$config_sh" in
1563 '') config_sh='config.sh';;
1566 echo "Fetching answers from $config_sh..."
1569 test "$override" && . ./optdef.sh
1578 : Eunice requires " " instead of "", can you believe it
1581 echo "Beginning of configuration questions for $package."
1583 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1585 : first determine how to suppress newline on echo command
1587 echo "Checking echo to see how to suppress newlines..."
1588 (echo "hi there\c" ; echo " ") >.echotmp
1589 if $contains c .echotmp >/dev/null 2>&1 ; then
1600 echo $n "The star should be here-->$c"
1604 : Now test for existence of everything in MANIFEST
1606 if test -f $rsrc/MANIFEST; then
1607 echo "First let's make sure your kit is complete. Checking..." >&4
1608 awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
1611 for filelist in x??; do
1612 (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
1614 if test -s missing; then
1618 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1620 You have the option of continuing the configuration process, despite the
1621 distinct possibility that your kit is damaged, by typing 'y'es. If you
1622 do, don't blame me if something goes wrong. I advise you to type 'n'o
1623 and contact the author (perlbug@perl.org).
1626 echo $n "Continue? [n] $c" >&4
1630 echo "Continuing..." >&4
1634 echo "ABORTING..." >&4
1639 echo "Looks good..."
1642 echo "There is no MANIFEST file. I hope your kit is complete !"
1647 : Find the appropriate value for a newline for tr
1648 if test -n "$DJGPP"; then
1651 if test X"$trnl" = X; then
1652 case "`echo foo|tr '\n' x 2>/dev/null`" in
1656 if test X"$trnl" = X; then
1657 case "`echo foo|tr '\012' x 2>/dev/null`" in
1658 foox) trnl='\012' ;;
1661 if test X"$trnl" = X; then
1664 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1670 : compute the number of columns on the terminal for proper question formatting
1675 : set up the echo used in my read
1676 myecho="case \"\$xxxm\" in
1677 '') echo $n \"\$rp $c\" >&4;;
1679 '') echo $n \"[\$xxxm] $c\";;
1681 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1683 echo $n \"[\$xxxm] $c\" >&4
1685 echo $n \"\$rp [\$xxxm] $c\" >&4
1691 : now set up to do reads with possible shell escape and default assignment
1697 case "\$fastread" in
1698 yes) case "\$dflt" in
1701 case "\$silent-\$rp" in
1706 *) case "\$silent" in
1707 true) case "\$rp" in
1712 while expr "X\$ans" : "X!" >/dev/null; do
1716 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1724 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1733 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1738 echo "(OK, I'll run with -d after this question.)" >&4
1741 echo "*** Sorry, \$1 not supported yet." >&4
1751 echo "*** Substitution done -- please confirm."
1753 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1758 echo "*** Error -- try again."
1765 case "\$ans\$xxxm\$nostick" in
1777 : create .config dir to save info across Configure sessions
1778 test -d ../.config || mkdir ../.config
1779 cat >../.config/README <<EOF
1780 This directory created by Configure to save information that should
1781 persist across sessions for $package.
1783 You may safely delete it if you wish.
1786 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
1788 $define|true|[yY]*) ;;
1789 *) case "$xversion" in
1792 *** WHOA THERE!!! ***
1794 This is an UNSTABLE DEVELOPMENT release.
1795 The version of this $package distribution is $xversion, that is, odd,
1796 (as opposed to even) and that signifies a development release.
1797 If you want a maintenance release, you want an even-numbered version.
1799 Do ***NOT*** install this into production use.
1800 Data corruption and crashes are possible.
1802 It is most seriously suggested that you do not continue any further
1803 unless you want to help in developing and debugging Perl.
1806 rp='Do you really want to continue?'
1810 [yY]) echo >&4 "Okay, continuing." ;;
1811 *) echo >&4 "Okay, bye."
1820 : general instructions
1823 user=`(logname) 2>/dev/null`
1825 '') user=`whoami 2>&1`;;
1827 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1830 rp='Would you like to see the instructions?'
1841 This installation shell script will examine your system and ask you questions
1842 to determine how the perl5 package should be installed. If you get
1843 stuck on a question, you may use a ! shell escape to start a subshell or
1844 execute a command. Many of the questions will have default answers in square
1845 brackets; typing carriage return will give you the default.
1847 On some of the questions which ask for file or directory names you are allowed
1848 to use the ~name construct to specify the login directory belonging to "name",
1849 even if you don't have a shell which knows about that. Questions where this is
1850 allowed will be marked "(~name ok)".
1854 dflt='Type carriage return to continue'
1858 The prompter used in this script allows you to use shell variables and
1859 backticks in your answers. You may use $1, $2, etc... to refer to the words
1860 in the default answer, as if the default line was a set of arguments given to a
1861 script shell. This means you may also use $* to repeat the whole default line,
1862 so you do not have to re-type everything to add something to the default.
1864 Everytime there is a substitution, you will have to confirm. If there is an
1865 error (e.g. an unmatched backtick), the default answer will remain unchanged
1866 and you will be prompted again.
1868 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1869 the questions and use the computed defaults (or the previous answers if there
1870 was already a config.sh file). Type 'Configure -h' for a list of options.
1871 You may also start interactively and then answer '& -d' at any prompt to turn
1872 on the non-interactive behaviour for the remainder of the execution.
1878 Much effort has been expended to ensure that this shell script will run on any
1879 Unix system. If despite that it blows up on yours, your best bet is to edit
1880 Configure and run it again. If you can't run Configure for some reason,
1881 you'll have to generate a config.sh file by hand. Whatever problems you
1882 have, let me (perlbug@perl.org) know how I blew it.
1884 This installation script affects things in two ways:
1886 1) it may do direct variable substitutions on some of the files included
1888 2) it builds a config.h file for inclusion in C programs. You may edit
1889 any of these files as the need arises after running this script.
1891 If you make a mistake on a question, there is no easy way to back up to it
1892 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1893 files. Configure will offer to let you do this before it runs the SH files.
1896 dflt='Type carriage return to continue'
1898 case "$firsttime" in
1899 true) echo $user >>../.config/instruct;;
1903 : find out where common programs are
1905 echo "Locating common programs..." >&4
1918 if test -d \$dir/\$thing; then
1924 for thisthing in \$dir/\$thing; do
1925 : just loop through to pick last item
1927 if test -f \$thisthing; then
1930 elif test -f \$dir/\$thing.exe; then
1931 if test -n "$DJGPP"; then
1932 echo \$dir/\$thing.exe
1934 : on Eunice apparently
1984 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1985 pth="$pth /lib /usr/lib"
1986 for file in $loclist; do
1990 if test -f "$xxx"; then
1993 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1994 xxx=`./loc $file $file $pth`
1997 '') xxx=`./loc $file $file $pth`;;
1998 *) xxx=`./loc $xxx $xxx $pth`;;
2004 echo $file is in $xxx.
2007 echo $file is in $xxx.
2010 echo "I don't know where '$file' is, and my life depends on it." >&4
2011 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2017 echo "Don't worry if any of the following aren't found..."
2019 for file in $trylist; do
2023 if test -f "$xxx"; then
2026 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2027 xxx=`./loc $file $file $pth`
2030 '') xxx=`./loc $file $file $pth`;;
2031 *) xxx=`./loc $xxx $xxx $pth`;;
2037 echo $file is in $xxx.
2040 echo $file is in $xxx.
2043 echo "I don't see $file out there, $say."
2050 echo "Substituting grep for egrep."
2056 echo "Substituting cp for ln."
2062 echo "Hopefully test is built into your sh."
2065 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2066 echo "Using the test built into your sh."
2074 echo "Hopefully echo is built into your sh."
2079 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2080 $echo $n "hi there$c" >foo1
2081 echo $n "hi there$c" >foo2
2082 if cmp foo1 foo2 >/dev/null 2>&1; then
2083 echo "They are compatible. In fact, they may be identical."
2090 They are not compatible! You are probably running ksh on a non-USG system.
2091 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2092 have echo built in and we may have to run some Bourne shell scripts. That
2093 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2096 $echo $n "The star should be here-->$c"
2106 cat <<'EOSC' >>checkcc
2111 int main(int argc, char *argv[]) {
2115 if $cc -o try $ccflags try.c; then
2118 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2124 case "`$cc -v -c try.c 2>&1`" in
2127 if $test X"$trygcc" = Xyes; then
2128 if gcc -o try -c try.c; then
2130 echo "You seem to have a working gcc, though." >&4
2131 rp="Would you like to use it?"
2133 if $test -f myread; then
2136 if $test -f UU/myread; then
2139 echo "Cannot find myread, sorry. Aborting." >&2
2144 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no ;;
2148 if $test X"$despair" = Xyes; then
2150 You need to find a working C compiler.
2151 Either (purchase and) install the C compiler supplied by your OS vendor,
2152 or for a free C compiler try http://gcc.gnu.org/
2153 I cannot continue any further, aborting.
2163 : determine whether symbolic links are supported
2166 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2167 echo "Symbolic links are supported." >&4
2170 echo "Symbolic links are NOT supported." >&4
2175 : determine whether symbolic links are supported
2179 echo "Checking how to test for symbolic links..." >&4
2181 if $test "X$issymlink" = X; then
2182 sh -c "PATH= test -h sym" >/dev/null 2>&1
2183 if test $? = 0; then
2187 if $test "X$issymlink" = X; then
2188 if $test -h >/dev/null 2>&1; then
2189 issymlink="$test -h"
2190 echo "Your builtin 'test -h' may be broken, I'm using external '$test -h'." >&4
2193 if $test "X$issymlink" = X; then
2194 if $test -L sym 2>/dev/null; then
2195 issymlink="$test -L"
2198 if $test "X$issymlink" != X; then
2199 echo "You can test for symbolic links with '$issymlink'." >&4
2201 echo "I do not know how you can test for symbolic links." >&4
2205 *) echo "No symbolic links, so not testing for their testing..." >&4
2211 case "$mksymlinks" in
2214 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2217 *) case "$lns:$issymlink" in
2218 *"ln -s:"*"test -"?)
2219 echo "Creating the symbolic links..." >&4
2220 echo "(First creating the subdirectories...)" >&4
2222 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2224 test -z "$directory" && break
2228 if test ! -d t/base; then
2229 echo "Failed to create the subdirectories. Aborting." >&4
2232 echo "(Then creating the symlinks...)" >&4
2233 awk '{print $1}' $src/MANIFEST | while true; do
2235 test -z "$filename" && break
2236 if test -f $filename; then
2237 if $issymlink $filename; then
2241 if test -f $filename; then
2242 echo "$filename already exists, not symlinking."
2244 ln -s $src/$filename $filename
2248 if test ! -f t/base/commonsense.t; then
2249 echo "Failed to create the symlinks. Aborting." >&4
2254 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2262 : see whether [:lower:] and [:upper:] are supported character classes
2264 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2266 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2270 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
2271 # (0xc9 and 0xd1), therefore that is a nice testing point.
2272 if test "X$up" = X -o "X$low" = X; then
2273 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
2279 if test "X$up" = X -o "X$low" = X; then
2280 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
2286 if test "X$up" = X -o "X$low" = X; then
2287 case "`echo IJ | od -x 2>/dev/null`" in
2289 echo "Hey, this might be EBCDIC." >&4
2290 if test "X$up" = X -o "X$low" = X; then
2291 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2292 ij) up='[A-IJ-RS-Z]'
2297 if test "X$up" = X -o "X$low" = X; then
2298 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2308 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
2310 echo "Using $up and $low to convert case." >&4
2313 echo "I don't know how to translate letters from upper to lower case." >&4
2314 echo "Your tr is not acting any way I know of." >&4
2318 : set up the translation script tr, must be called with ./tr of course
2322 '[A-Z][a-z]') exec $tr '$up' '$low';;
2323 '[a-z][A-Z]') exec $tr '$low' '$up';;
2330 : Try to determine whether config.sh was made on this system
2331 case "$config_sh" in
2333 myuname=`$uname -a 2>/dev/null`
2334 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2335 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2336 # because the A-Z/a-z are not consecutive.
2337 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2338 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2339 newmyuname="$myuname"
2341 case "$knowitall" in
2343 if test -f ../config.sh; then
2344 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2345 eval "`grep myuname= ../config.sh`"
2347 if test "X$myuname" = "X$newmyuname"; then
2355 : Get old answers from old config file if Configure was run on the
2356 : same system, otherwise use the hints.
2359 if test -f config.sh; then
2361 rp="I see a config.sh file. Shall I use it to set the defaults?"
2364 n*|N*) echo "OK, I'll ignore it."
2365 mv config.sh config.sh.old
2366 myuname="$newmyuname"
2368 *) echo "Fetching default answers from your old config.sh file..." >&4
2376 : Older versions did not always set $sh. Catch re-use of such
2386 if test ! -f config.sh; then
2389 First time through, eh? I have some defaults handy for some systems
2390 that need some extra help getting the Configure answers right:
2393 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2395 : Half the following guesses are probably wrong... If you have better
2396 : tests or hints, please send them to perlbug@perl.org
2397 : The metaconfig authors would also appreciate a copy...
2398 $test -f /irix && osname=irix
2399 $test -f /xenix && osname=sco_xenix
2400 $test -f /dynix && osname=dynix
2401 $test -f /dnix && osname=dnix
2402 $test -f /lynx.os && osname=lynxos
2403 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2404 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
2405 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2406 $test -f /bin/mips && /bin/mips && osname=mips
2407 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
2408 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
2409 $test -d /usr/apollo/bin && osname=apollo
2410 $test -f /etc/saf/_sactab && osname=svr4
2411 $test -d /usr/include/minix && osname=minix
2412 if $test -d /MachTen -o -d /MachTen_Folder; then
2414 if $test -x /sbin/version; then
2415 osvers=`/sbin/version | $awk '{print $2}' |
2416 $sed -e 's/[A-Za-z]$//'`
2417 elif $test -x /usr/etc/version; then
2418 osvers=`/usr/etc/version | $awk '{print $2}' |
2419 $sed -e 's/[A-Za-z]$//'`
2425 $test -f /sys/posix.dll &&
2426 $test -f /usr/bin/what &&
2427 set X `/usr/bin/what /sys/posix.dll` &&
2428 $test "$3" = UWIN &&
2432 if $test -f $uname; then
2440 umips) osname=umips ;;
2443 [23]100) osname=mips ;;
2444 next*) osname=next ;;
2446 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
2447 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
2450 elif $test -f /etc/kconfig; then
2452 if test "$lns" = "$ln -s"; then
2454 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
2456 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
2463 if test -n "$DJGPP"; then
2472 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
2474 'not found') osvers="$4"."$3" ;;
2475 '<3240'|'<>3240') osvers=3.2.0 ;;
2476 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
2477 '=3250'|'>3250') osvers=3.2.5 ;;
2481 bsd386) osname=bsd386
2484 cygwin*) osname=cygwin
2487 *dc.osx) osname=dcosx
2493 domainos) osname=apollo
2499 dynixptx*) osname=dynixptx
2500 osvers=`echo "$4"|sed 's/^v//'`
2502 freebsd) osname=freebsd
2504 genix) osname=genix ;;
2506 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
2522 netbsd*) osname=netbsd
2525 news-os) osvers="$3"
2527 4*) osname=newsos4 ;;
2531 next*) osname=next ;;
2532 nonstop-ux) osname=nonstopux ;;
2533 POSIX-BC | posix-bc ) osname=posix-bc
2536 powerux | power_ux | powermax_os | powermaxos | \
2537 powerunix | power_unix) osname=powerux
2543 solaris) osname=solaris
2545 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2552 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2556 titanos) osname=titanos
2565 ultrix) osname=ultrix
2568 osf1|mls+) case "$5" in
2571 osvers=`sizer -v | awk '{print $3}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
2574 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
2577 hp*) osname=hp_osf1 ;;
2578 mips) osname=mips_osf1 ;;
2581 unixware) osname=svr5
2587 $2) case "$osname" in
2591 : svr4.x or possibly later
2601 if test -f /stand/boot ; then
2602 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
2603 if test -n "$INITPROG" -a -f "$INITPROG"; then
2604 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
2605 if test -n "$isesix"; then
2613 *) if test -f /etc/systemid; then
2615 set `echo $3 | $sed 's/\./ /g'` $4
2616 if $test -f $src/hints/sco_$1_$2_$3.sh; then
2618 elif $test -f $src/hints/sco_$1_$2.sh; then
2620 elif $test -f $src/hints/sco_$1.sh; then
2625 '') : Still unknown. Probably a generic Sys V.
2634 *) case "$osname" in
2635 '') : Still unknown. Probably a generic BSD.
2643 if test -f /vmunix -a -f $src/hints/news_os.sh; then
2644 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
2645 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
2648 $rm -f UU/kernel.what
2649 elif test -d c:/.; then
2656 : Now look for a hint file osname_osvers, unless one has been
2657 : specified already.
2660 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
2661 : Also try without trailing minor version numbers.
2662 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
2663 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
2664 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
2665 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
2668 *) case "$osvers" in
2671 *) if $test -f $src/hints/$file.sh ; then
2673 elif $test -f $src/hints/$xfile.sh ; then
2675 elif $test -f $src/hints/$xxfile.sh ; then
2677 elif $test -f $src/hints/$xxxfile.sh ; then
2679 elif $test -f $src/hints/$xxxxfile.sh ; then
2681 elif $test -f "$src/hints/${osname}.sh" ; then
2690 if $test -f Policy.sh ; then
2693 none) dflt="Policy" ;;
2694 *) dflt="Policy $dflt" ;;
2699 dflt=`echo $hintfile | $sed 's/\.sh$//'`
2703 if $test -f Policy.sh ; then
2706 There's also a Policy hint file available, which should make the
2707 site-specific (policy) questions easier to answer.
2714 You may give one or more space-separated answers, or "none" if appropriate.
2715 A well-behaved OS will have no hints, so answering "none" or just "Policy"
2716 is a good thing. DO NOT give a wrong version or a wrong OS.
2720 rp="Which of these apply, if any?"
2723 for file in $tans; do
2724 if $test X$file = XPolicy -a -f Policy.sh; then
2726 $cat Policy.sh >> UU/config.sh
2727 elif $test -f $src/hints/$file.sh; then
2728 . $src/hints/$file.sh
2729 $cat $src/hints/$file.sh >> UU/config.sh
2730 elif $test X$tans = X -o X$tans = Xnone ; then
2733 : Give one chance to correct a possible typo.
2734 echo "$file.sh does not exist"
2736 rp="hint to use instead?"
2738 for file in $ans; do
2739 if $test -f "$src/hints/$file.sh"; then
2740 . $src/hints/$file.sh
2741 $cat $src/hints/$file.sh >> UU/config.sh
2742 elif $test X$ans = X -o X$ans = Xnone ; then
2745 echo "$file.sh does not exist -- ignored."
2752 : Remember our hint file for later.
2753 if $test -f "$src/hints/$file.sh" ; then
2763 echo "Fetching default answers from $config_sh..." >&4
2767 cp $config_sh config.sh 2>/dev/null
2777 test "$override" && . ./optdef.sh
2779 : Restore computed paths
2780 for file in $loclist $trylist; do
2781 eval $file="\$_$file"
2786 Configure uses the operating system name and version to set some defaults.
2787 The default value is probably right if the name rings a bell. Otherwise,
2788 since spelling matters for me, either accept the default or answer "none"
2795 ''|' '|none) dflt=none ;;
2796 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
2799 *) dflt="$osname" ;;
2801 rp="Operating system name?"
2805 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
2811 ''|' '|none) dflt=none ;;
2812 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
2813 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
2815 ''|' ') dflt=none ;;
2820 *) dflt="$osvers" ;;
2822 rp="Operating system version?"
2832 : who configured the system
2833 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
2834 cf_by=`(logname) 2>/dev/null`
2837 cf_by=`(whoami) 2>/dev/null`
2839 "") cf_by=unknown ;;
2843 : set up the script used to warn in case of inconsistency
2850 echo "*** WHOA THERE!!! ***" >&4
2851 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2852 rp=" Keep the $hint value?"
2855 y) td=$was; tu=$was;;
2859 : function used to set $1 to $val
2860 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2862 $define$undef) . ./whoa; eval "$var=\$td";;
2863 $undef$define) . ./whoa; eval "$var=\$tu";;
2864 *) eval "$var=$val";;
2867 case "$usethreads" in
2868 $define|true|[yY]*) dflt='y';;
2873 Perl can be built to take advantage of threads on some systems.
2874 To do so, Configure can be run with -Dusethreads.
2876 Note that threading is a highly experimental feature, and
2877 some known race conditions still remain. If you choose to try
2878 it, be very sure to not actually deploy it for production
2879 purposes. README.threads has more details, and is required
2880 reading if you enable threads.
2882 If this doesn't make any sense to you, just accept the default '$dflt'.
2884 rp='Build a threading Perl?'
2887 y|Y) val="$define" ;;
2893 case "$usethreads" in
2897 As of 5.5.640, Perl has two different internal threading implementations,
2898 the 5.005 version (5005threads) and an interpreter-based version
2899 (ithreads) that has one interpreter per thread. Both are very
2900 experimental. This arrangement exists to help developers work out
2901 which one is better.
2903 If you're a casual user, you probably don't want interpreter-threads
2904 at this time. There doesn't yet exist a way to create threads from
2905 within Perl in this model, i.e., "use Thread;" will NOT work.
2907 : Default to ithreads unless overridden on command line or with
2910 case "$use5005threads" in
2911 $define|true|[yY]*) dflt='n';;
2913 case "$useithreads" in
2914 $undef|false|[nN]*) dflt='n';;
2916 rp='Use interpreter-based ithreads?'
2919 y|Y) val="$define" ;;
2924 : Now set use5005threads to the opposite value.
2925 case "$useithreads" in
2926 $define) val="$undef" ;;
2933 useithreads="$undef"
2934 use5005threads="$undef"
2938 case "$useithreads$use5005threads" in
2942 You cannot have both the ithreads and the 5.005 threads enabled
2943 at the same time. Disabling the 5.005 threads since they are
2944 much less stable than the ithreads.
2947 use5005threads="$undef"
2951 case "$d_oldpthreads" in
2952 '') : Configure tests would be welcome here. For now, assume undef.
2954 *) val="$d_oldpthreads" ;;
2960 case "$usethreads" in
2961 "$define"|true|[yY]*)
2962 : Look for a hint-file generated 'call-back-unit'. If the
2963 : user has specified that a threading perl is to be built,
2964 : we may need to set or change some other defaults.
2965 if $test -f usethreads.cbu; then
2966 echo "Your platform has some specific hints for threaded builds, using them..."
2970 (Your platform doesn't have any specific hints for threaded builds.
2971 Assuming POSIX threads, then.)
2979 Perl can be built so that multiple Perl interpreters can coexist
2980 within the same Perl executable.
2983 case "$useithreads" in
2986 This multiple interpreter support is required for interpreter-based threads.
2990 *) case "$usemultiplicity" in
2991 $define|true|[yY]*) dflt='y';;
2995 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
2996 rp='Build Perl for multiplicity?'
2999 y|Y) val="$define" ;;
3007 : make some quick guesses about what we are up against
3009 $echo $n "Hmm... $c"
3019 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
3020 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
3022 echo "Looks kind of like an OSF/1 system, but we'll see..."
3024 elif test `echo abc | $tr a-z A-Z` = Abc ; then
3025 xxx=`./loc addbib blurfl $pth`
3026 if $test -f $xxx; then
3027 echo "Looks kind of like a USG system with BSD features, but we'll see..."
3031 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
3032 echo "Looks kind of like an extended USG system, but we'll see..."
3034 echo "Looks kind of like a USG system, but we'll see..."
3038 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
3039 echo "Looks kind of like a BSD system, but we'll see..."
3043 echo "Looks kind of like a Version 7 system, but we'll see..."
3046 case "$eunicefix" in
3049 There is, however, a strange, musty smell in the air that reminds me of
3050 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
3054 : it so happens the Eunice I know will not run shell scripts in Unix format
3058 echo "Congratulations. You aren't running Eunice."
3062 : Detect OS2. The p_ variable is set above in the Head.U unit.
3063 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
3064 : semicolon as a patch separator
3069 I have the feeling something is not exactly right, however...don't tell me...
3070 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
3071 (Or you may be running DOS with DJGPP.)
3076 if test -f /xenix; then
3077 echo "Actually, this looks more like a XENIX system..."
3082 echo "It's not Xenix..."
3087 if test -f /venix; then
3088 echo "Actually, this looks more like a VENIX system..."
3095 echo "Nor is it Venix..."
3098 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3099 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3106 rp="Use which C compiler?"
3109 : Look for a hint-file generated 'call-back-unit'. Now that the
3110 : user has specified the compiler, we may need to set or change some
3112 if $test -f cc.cbu; then
3118 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3119 $cat >gccvers.c <<EOM
3124 printf("%s\n", __VERSION__);
3126 printf("%s\n", "1");
3132 if $cc -o gccvers $ldflags gccvers.c; then
3133 gccversion=`./gccvers`
3134 case "$gccversion" in
3135 '') echo "You are not using GNU cc." ;;
3136 *) echo "You are using GNU cc $gccversion."
3142 echo "*** WHOA THERE!!! ***" >&4
3143 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3144 case "$knowitall" in
3146 echo " You'd better start hunting for one and let me know about it." >&4
3152 case "$gccversion" in
3153 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3155 case "$gccversion" in
3156 '') gccosandvers='' ;;
3157 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
3158 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
3160 case "$gccosandvers" in
3161 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
3162 $osname$osvers) ;; # looking good
3163 $osname*) cat <<EOM >&4
3165 *** WHOA THERE!!! ***
3167 Your gcc has not been compiled for the exact release of
3168 your operating system ($gccosandvers versus $osname$osvers).
3170 In general it is a good idea to keep gcc synchronized with
3171 the operating system because otherwise serious problems
3172 may ensue when trying to compile software, like Perl.
3174 I'm trying to be optimistic here, though, and will continue.
3175 If later during the configuration and build icky compilation
3176 problems appear (headerfile conflicts being the most common
3177 manifestation), I suggest reinstalling the gcc to match
3178 your operating system release.
3182 *) gccosandvers='' ;; # failed to parse, better be silent
3190 : see how we invoke the C preprocessor
3192 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3193 cat <<'EOT' >testcpp.c
3199 if test ! -f cppstdin; then
3200 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
3201 # AIX cc -E doesn't show the absolute headerfile
3202 # locations but we'll cheat by using the -M flag.
3203 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
3205 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3208 echo "Keeping your $hint cppstdin wrapper."
3211 wrapper=`pwd`/cppstdin
3215 if $test "X$cppstdin" != "X" && \
3216 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3217 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3219 echo "You used to use $cppstdin $cppminus so we'll use that again."
3221 '') echo "But let's see if we can live without a wrapper..." ;;
3223 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3224 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3226 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3229 echo "(However, $cpprun $cpplast does not work, let's see...)"
3237 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3244 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3245 $cc -E <testcpp.c >testcpp.out 2>&1; \
3246 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3247 echo "Yup, it does."
3250 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
3251 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3252 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3253 echo "Yup, it does."
3256 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
3257 $cc -P <testcpp.c >testcpp.out 2>&1; \
3258 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3259 echo "Yipee, that works!"
3262 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
3263 $cc -P - <testcpp.c >testcpp.out 2>&1; \
3264 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3265 echo "At long last!"
3268 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
3269 $cpp <testcpp.c >testcpp.out 2>&1; \
3270 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3274 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
3275 $cpp - <testcpp.c >testcpp.out 2>&1; \
3276 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3277 echo "Hooray, it works! I was beginning to wonder."
3280 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
3281 $wrapper <testcpp.c >testcpp.out 2>&1; \
3282 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3288 rp="No dice. I can't find a C preprocessor. Name one:"
3292 $x_cpp <testcpp.c >testcpp.out 2>&1
3293 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3294 echo "OK, that will do." >&4
3296 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
3311 echo "Perhaps can we force $cc -E using a wrapper..."
3312 if $wrapper <testcpp.c >testcpp.out 2>&1; \
3313 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3319 echo "Nope, we'll have to live without it..."
3333 "$wrapper"|'cppstdin') ;;
3334 *) $rm -f $wrapper;;
3336 $rm -f testcpp.c testcpp.out
3338 : decide how portable to be. Allow command line overrides.
3339 case "$d_portable" in
3341 *) d_portable="$define" ;;
3344 : set up shell script to do ~ expansion
3350 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3353 if $test -f /bin/csh; then
3354 /bin/csh -f -c "glob \$1"
3359 name=\`$expr x\$1 : '..\([^/]*\)'\`
3360 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3361 if $test ! -d "\$dir"; then
3363 echo "\$me: can't locate home directory for: \$name" >&2
3368 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3384 : now set up to get a file name
3388 cat <<'EOSC' >>getfile
3404 expr $fn : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3405 fn=`echo $fn | sed 's/(.*)//'`
3411 loc_file=`expr $fn : '.*:\(.*\)'`
3412 fn=`expr $fn : '\(.*\):.*'`
3420 */*) fullpath=true;;
3429 *e*) exp_file=true;;
3432 *p*) nopath_ok=true;;
3437 *d*) type='Directory';;
3438 *l*) type='Locate';;
3443 Locate) what='File';;
3448 case "$d_portable" in
3456 while test "$type"; do
3461 true) rp="$rp (~name ok)";;
3464 if test -f UU/getfile.ok && \
3465 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3484 value=`UU/filexp $ans`
3487 if test "$ans" != "$value"; then
3488 echo "(That expands to $value on this system.)"
3502 /*) value="$ansexp" ;;
3503 [a-zA-Z]:/*) value="$ansexp" ;;
3508 echo "I shall only accept a full path name, as in /bin/ls." >&4
3509 echo "Use a ! shell escape if you wish to check pathnames." >&4
3512 echo "Please give a full path name, starting with slash." >&4
3515 echo "Note that using ~name is ok provided it expands well." >&4
3528 for fp in $gfpth; do
3529 if test "X$fp" = X.; then
3534 if test -f "$pf"; then
3536 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3538 echo "($value is not a plain file, but that's ok.)"
3541 if test X"$type" = X; then
3548 for fp in $gfpth; do
3549 if test "X$fp" = X.; then
3554 direxp="$fp/$ansexp"
3556 if test -d "$direxp"; then
3564 if test -d "$ansexp"; then
3565 echo "(Looking for $loc_file in directory $value.)"
3566 value="$value/$loc_file"
3567 ansexp="$ansexp/$loc_file"
3569 if test -f "$ansexp"; then
3572 case "$nopath_ok" in
3573 true) case "$value" in
3575 *) echo "Assuming $value will be in people's path."
3591 if test "$fastread" = yes; then
3596 rp="$what $value doesn't exist. Use that name anyway?"
3615 test "X$gfpthkeep" != Xy && gfpth=""
3618 : What should the include directory be ?
3620 $echo $n "Hmm... $c"
3624 if $test -f /bin/mips && /bin/mips; then
3625 echo "Looks like a MIPS system..."
3626 $cat >usr.c <<'EOCP'
3627 #ifdef SYSTYPE_BSD43
3631 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3632 dflt='/bsd43/usr/include'
3636 mips_type='System V'
3638 $rm -f usr.c usr.out
3639 echo "and you're compiling with the $mips_type compiler and libraries."
3643 echo "Doesn't look like a MIPS system."
3653 case "$xxx_prompt" in
3656 rp='Where are the include files you want to use?'
3664 : Set private lib path
3667 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
3672 '') dlist="$loclibpth $plibpth $glibpth";;
3673 *) dlist="$libpth";;
3676 : Now check and see which directories actually exist, avoiding duplicates
3680 if $test -d $xxx; then
3683 *) libpth="$libpth $xxx";;
3689 Some systems have incompatible or broken versions of libraries. Among
3690 the directories listed in the question below, please remove any you
3691 know not to be holding relevant libraries, and add any that are needed.
3692 Say "none" for none.
3703 rp="Directories to use for library searches?"
3710 : compute shared library extension
3713 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
3723 On some systems, shared libraries may be available. Answer 'none' if
3724 you want to suppress searching of shared libraries for the remainder
3725 of this configuration.
3728 rp='What is the file extension used for shared libraries?'
3732 : Define several unixisms.
3733 : Hints files or command line option can be used to override them.
3734 : The convoluted testing is in case hints files set either the old
3737 '') case "$exe_ext" in
3739 *) _exe="$exe_ext" ;;
3744 '') case "$lib_ext" in
3751 '') case "$obj_ext" in
3758 '') case "$path_sep" in
3769 : Which makefile gets called first. This is used by make depend.
3770 case "$firstmakefile" in
3771 '') firstmakefile='makefile';;
3775 $define|true|[yY]*) dflt='y';;
3780 Perl can be built to use the SOCKS proxy protocol library. To do so,
3781 Configure must be run with -Dusesocks. If you use SOCKS you also need
3782 to use the PerlIO abstraction layer, this will be implicitly selected.
3784 If this doesn't make any sense to you, just accept the default '$dflt'.
3786 rp='Build Perl for SOCKS?'
3789 y|Y) val="$define" ;;
3796 $define|true|[yY]*) useperlio="$define";;
3799 : Looking for optional libraries
3801 echo "Checking for optional libraries..." >&4
3806 case "$libswanted" in
3807 '') libswanted='c_s';;
3810 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
3816 for thisdir in $libpth $xlibpth; do
3817 test -d $thisdir && libspath="$libspath $thisdir"
3819 for thislib in $libswanted; do
3820 for thisdir in $libspath; do
3822 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
3823 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|tail -1`
3824 $test -f "$xxx" && eval $libscheck
3825 $test -f "$xxx" && libstyle=shared
3827 if test ! -f "$xxx"; then
3828 xxx=$thisdir/lib$thislib.$so
3829 $test -f "$xxx" && eval $libscheck
3830 $test -f "$xxx" && libstyle=shared
3832 if test ! -f "$xxx"; then
3833 xxx=$thisdir/lib$thislib$_a
3834 $test -f "$xxx" && eval $libscheck
3835 $test -f "$xxx" && libstyle=static
3837 if test ! -f "$xxx"; then
3838 xxx=$thisdir/$thislib$_a
3839 $test -f "$xxx" && eval $libscheck
3840 $test -f "$xxx" && libstyle=static
3842 if test ! -f "$xxx"; then
3843 xxx=$thisdir/lib${thislib}_s$_a
3844 $test -f "$xxx" && eval $libscheck
3845 $test -f "$xxx" && libstyle=static
3846 $test -f "$xxx" && thislib=${thislib}_s
3848 if test ! -f "$xxx"; then
3849 xxx=$thisdir/Slib$thislib$_a
3850 $test -f "$xxx" && eval $libscheck
3851 $test -f "$xxx" && libstyle=static
3853 if $test -f "$xxx"; then
3855 shared) echo "Found -l$thislib (shared)." ;;
3856 static) echo "Found -l$thislib." ;;
3857 *) echo "Found -l$thislib ($libstyle)." ;;
3861 *) dflt="$dflt -l$thislib"
3862 libsfound="$libsfound $xxx"
3864 libsfiles="$libsfiles $yyy"
3865 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
3866 case " $libsdirs " in
3868 *) libsdirs="$libsdirs $yyy" ;;
3875 if $test ! -f "$xxx"; then
3876 echo "No -l$thislib."
3887 ' '|'') dflt='none';;
3892 In order to compile $package on your machine, a number of libraries
3893 are usually needed. Include any other special libraries here as well.
3894 Say "none" for none. The default list is almost always right.
3898 rp="What libraries to use?"
3905 : determine optimization, if desired, or use for debug flag also
3907 ' '|$undef) dflt='none';;
3909 *) dflt="$optimize";;
3913 By default, $package compiles with the -O flag to use the optimizer.
3914 Alternately, you might want to use the symbolic debugger, which uses
3915 the -g flag (on traditional Unix systems). Either flag can be
3916 specified here. To use neither flag, specify the word "none".
3919 rp="What optimizer/debugger flag should be used?"
3923 'none') optimize=" ";;
3927 : We will not override a previous value, but we might want to
3928 : augment a hint file
3930 default|recommended)
3931 case "$gccversion" in
3932 1*) dflt='-fpcc-struct-return' ;;
3935 *-g*) dflt="$dflt -DDEBUGGING";;
3937 case "$gccversion" in
3938 2*) if test -d /etc/conf/kconfig.d &&
3939 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
3945 case "$gccversion" in
3949 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
3950 echo 'int main(void) { return 0; }' > gcctest.c
3951 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
3952 echo "Yes, it does." 2>&1
3955 echo "Leaving current flags $ccflags alone." 2>&1
3957 *) dflt="$dflt -fno-strict-aliasing" ;;
3960 echo "Nope, it doesn't, but that's ok." 2>&1
3967 case "$mips_type" in
3968 *BSD*|'') inclwanted="$locincpth $usrinc";;
3969 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
3971 for thisincl in $inclwanted; do
3972 if $test -d $thisincl; then
3973 if $test x$thisincl != x$usrinc; then
3975 *" -I$thisincl "*);;
3976 *) dflt="$dflt -I$thisincl ";;
3982 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
3984 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
3992 *) dflt="$dflt -D$2";;
3996 set signal.h LANGUAGE_C; eval $inctest
4000 ccflags="$ccflags -DSOCKS"
4005 default|recommended) dflt="$ccflags $dflt" ;;
4006 *) dflt="$ccflags";;
4015 Your C compiler may want other flags. For this question you should include
4016 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4017 but you should NOT include libraries or ld flags like -lwhatever. If you
4018 want $package to honor its debug switch, you should include -DDEBUGGING here.
4019 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4021 To use no flags, specify the word "none".
4027 rp="Any additional cc flags?"
4034 : the following weeds options from ccflags that are of no interest to cpp
4036 case "$gccversion" in
4037 1*) cppflags="$cppflags -D__GNUC__"
4039 case "$mips_type" in
4041 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4047 echo "Let me guess what the preprocessor flags are..." >&4
4061 *) ftry="$previous $flag";;
4063 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4064 >cpp1.out 2>/dev/null && \
4065 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4066 >cpp2.out 2>/dev/null && \
4067 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4068 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4070 cppflags="$cppflags $ftry"
4080 *-*) echo "They appear to be: $cppflags";;
4082 $rm -f cpp.c cpp?.out
4086 : flags used in final linking phase
4088 '') if ./venix; then
4094 *-posix*) dflt="$dflt -posix" ;;
4097 *) dflt="$ldflags";;
4100 : Try to guess additional flags to pick up local libraries.
4101 for thislibdir in $libpth; do
4102 case " $loclibpth " in
4105 *"-L$thislibdir "*) ;;
4106 *) dflt="$dflt -L$thislibdir" ;;
4118 Your C linker may need flags. For this question you should
4119 include -L/whatever and any other flags used by the C linker, but you
4120 should NOT include libraries like -lwhatever.
4122 Make sure you include the appropriate -L/path flags if your C linker
4123 does not normally search all of the directories you specified above,
4126 To use no flags, specify the word "none".
4130 rp="Any additional ld flags (NOT including libraries)?"
4136 rmlist="$rmlist pdp11"
4140 echo "Checking your choice of C compiler and flags for coherency..." >&4
4141 $cat > try.c <<'EOF'
4143 int main() { printf("Ok\n"); exit(0); }
4145 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
4147 $cat >try.msg <<'EOM'
4148 I've tried to compile and run the following simple program:
4151 $cat try.c >> try.msg
4153 $cat >> try.msg <<EOM
4160 and I got the following output:
4164 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
4165 if $sh -c './try' >>try.msg 2>&1; then
4169 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4172 cat >> try.msg <<'EOQS'
4173 If $libs contains -lsfio, and sfio is mis-configured, then it
4174 sometimes (apparently) runs and exits with a 0 status, but with no
4175 output! It may have to do with sfio's use of _exit vs. exit.
4178 rp="You have a big problem. Shall I abort Configure"
4185 echo "The program compiled OK, but exited with status $?." >>try.msg
4186 rp="You have a problem. Shall I abort Configure"
4190 echo "I can't compile the test program." >>try.msg
4191 rp="You have a BIG problem. Shall I abort Configure"
4197 case "$knowitall" in
4199 echo "(The supplied flags or libraries might be incorrect.)"
4207 *) echo "Ok. Stopping Configure." >&4
4212 n) echo "OK, that should do.";;
4214 $rm -f try try.* core
4216 : define an is-a-typedef? function
4217 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
4219 "") inclist="sys/types.h";;
4221 eval "varval=\$$var";
4225 for inc in $inclist; do
4226 echo "#include <$inc>" >>temp.c;
4228 echo "#ifdef $type" >> temp.c;
4229 echo "printf(\"We have $type\");" >> temp.c;
4230 echo "#endif" >> temp.c;
4231 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
4232 if $contains $type temp.E >/dev/null 2>&1; then
4238 *) eval "$var=\$varval";;
4241 : define an is-a-typedef? function that prompts if the type is not available.
4242 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
4244 "") inclist="sys/types.h";;
4246 eval "varval=\$$var";
4250 for inc in $inclist; do
4251 echo "#include <$inc>" >>temp.c;
4253 echo "#ifdef $type" >> temp.c;
4254 echo "printf(\"We have $type\");" >> temp.c;
4255 echo "#endif" >> temp.c;
4256 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
4258 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
4259 if $contains $type temp.E >/dev/null 2>&1; then
4260 echo "$type found." >&4;
4263 echo "$type NOT found." >&4;
4269 *) eval "$var=\$varval";;
4272 : define a shorthand compile call
4276 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
4277 : define a shorthand compile call for compilations that should be ok.
4281 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
4283 : check for lengths of integral types
4287 echo "Checking to see how big your integers are..." >&4
4288 $cat >intsize.c <<'EOCP'
4292 printf("intsize=%d;\n", (int)sizeof(int));
4293 printf("longsize=%d;\n", (int)sizeof(long));
4294 printf("shortsize=%d;\n", (int)sizeof(short));
4299 if eval $compile_ok && ./intsize > /dev/null; then
4301 echo "Your integers are $intsize bytes long."
4302 echo "Your long integers are $longsize bytes long."
4303 echo "Your short integers are $shortsize bytes long."
4307 Help! I can't compile and run the intsize test program: please enlighten me!
4308 (This is probably a misconfiguration in your system or libraries, and
4309 you really ought to fix it. Still, I'll try anyway.)
4313 rp="What is the size of an integer (in bytes)?"
4317 rp="What is the size of a long integer (in bytes)?"
4321 rp="What is the size of a short integer (in bytes)?"
4327 $rm -f intsize intsize.*
4329 : see what type lseek is declared as in the kernel
4330 rp="What is the type used for lseek's offset on this system?"
4331 set off_t lseektype long stdio.h sys/types.h
4335 echo "Checking to see how big your file offsets are..." >&4
4337 #include <sys/types.h>
4341 printf("%d\n", (int)sizeof($lseektype));
4346 if eval $compile_ok; then
4348 echo "Your file offsets are $lseeksize bytes long."
4352 echo "(I can't seem to compile the test program. Guessing...)"
4353 rp="What is the size of your file offsets (in bytes)?"
4359 : see what type file positions are declared as in the library
4360 rp="What is the type for file position used by fsetpos()?"
4361 set fpos_t fpostype long stdio.h sys/types.h
4366 *_t) zzz="$fpostype" ;;
4369 echo "Checking the size of $zzz..." >&4
4371 #include <sys/types.h>
4374 printf("%d\n", (int)sizeof($fpostype));
4379 if eval $compile_ok; then
4383 echo "(I can't execute the test program--guessing $fpossize.)" >&4
4386 echo "Your $zzz is $fpossize bytes long."
4392 echo "(I can't compile the test program. Guessing...)" >&4
4393 rp="What is the size of your file positions (in bytes)?"
4400 # Backward compatibility (uselfs is deprecated).
4402 "$define"|true|[yY]*)
4405 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
4407 uselargefiles="$define"
4411 case "$lseeksize:$fpossize" in
4414 You can have files larger than 2 gigabytes.
4417 *) case "$uselargefiles" in
4418 "$undef"|false|[nN]*) dflt='n' ;;
4423 Perl can be built to understand large files (files larger than 2 gigabytes)
4424 on some systems. To do so, Configure can be run with -Duselargefiles.
4426 If this doesn't make any sense to you, just accept the default '$dflt'.
4428 rp='Try to understand large files, if available?'
4431 y|Y) val="$define" ;;
4438 case "$uselargefiles" in
4440 : Look for a hint-file generated 'call-back-unit'. If the
4441 : user has specified that a large files perl is to be built,
4442 : we may need to set or change some other defaults.
4443 if $test -f uselargefiles.cbu; then
4444 echo "Your platform has some specific hints for large file builds, using them..."
4445 . ./uselargefiles.cbu
4447 echo "Rechecking to see how big your file offsets are..." >&4
4449 #include <sys/types.h>
4453 printf("%d\n", (int)sizeof($lseektype));
4458 if eval $compile_ok; then
4460 $echo "Your file offsets are now $lseeksize bytes long."
4464 echo "(I can't seem to compile the test program. Guessing...)"
4465 rp="What is the size of your file offsets (in bytes)?"
4470 *_t) zzz="$fpostype" ;;
4473 $echo $n "Rechecking the size of $zzz...$c" >&4
4475 #include <sys/types.h>
4478 printf("%d\n", (int)sizeof($fpostype));
4483 if eval $compile_ok; then
4488 echo "(I can't execute the test program--guessing $fpossize.)" >&4
4491 echo " $fpossize bytes." >&4
4497 echo "(I can't compile the test program. Guessing...)" >&4
4498 rp="What is the size of your file positions (in bytes)?"
4508 case "$usemorebits" in
4509 "$define"|true|[yY]*)
4510 use64bitint="$define"
4511 uselongdouble="$define"
4512 usemorebits="$define"
4514 *) usemorebits="$undef"
4519 case "$uselonglong" in
4520 "$define"|true|[yY]*)
4523 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
4525 use64bitint="$define"
4528 case "$use64bits" in
4529 "$define"|true|[yY]*)
4532 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
4534 use64bitint="$define"
4537 case "$use64bitints" in
4538 "$define"|true|[yY]*)
4541 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
4543 use64bitint="$define"
4546 case "$use64bitsint" in
4547 "$define"|true|[yY]*)
4550 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
4552 use64bitint="$define"
4555 case "$uselonglongs" in
4556 "$define"|true|[yY]*)
4559 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
4561 use64bitint="$define"
4564 case "$use64bitsall" in
4565 "$define"|true|[yY]*)
4568 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
4570 use64bitall="$define"
4575 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
4577 case "$use64bitall" in
4578 "$define"|true|[yY]*) use64bitint="$define" ;;
4584 You have natively 64-bit long integers.
4588 *) case "$use64bitint" in
4589 "$define"|true|[yY]*) dflt='y';;
4594 Perl can be built to take advantage of 64-bit integer types
4595 on some systems. To do so, Configure can be run with -Duse64bitint.
4596 Choosing this option will most probably introduce binary incompatibilities.
4598 If this doesn't make any sense to you, just accept the default '$dflt'.
4600 rp='Try to use 64-bit integers, if available?'
4603 [yY]*) val="$define" ;;
4611 case "$use64bitall" in
4612 "$define"|true|[yY]*) dflt='y' ;;
4613 *) case "$longsize" in
4621 You may also choose to try maximal 64-bitness. It means using as much
4622 64-bitness as possible on the platform. This in turn means even more
4623 binary incompatibilities. On the other hand, your platform may not
4624 have any more 64-bitness available than what you already have chosen.
4626 If this doesn't make any sense to you, just accept the default '$dflt'.
4628 rp='Try to use maximal 64-bit support, if available?'
4631 [yY]*) val="$define" ;;
4636 case "$use64bitall" in
4638 case "$use64bitint" in
4642 Since you have chosen a maximally 64-bit build, I'm also turning on
4643 the use of 64-bit integers.
4645 use64bitint="$define" ;;
4650 case "$use64bitint" in
4651 "$define"|true|[yY]*)
4652 : Look for a hint-file generated 'call-back-unit'. If the
4653 : user has specified that a 64-bit perl is to be built,
4654 : we may need to set or change some other defaults.
4655 if $test -f use64bitint.cbu; then
4656 echo "Your platform has some specific hints for 64-bit integers, using them..."
4660 4) case "$archname64" in
4661 '') archname64=64int ;;
4668 case "$use64bitall" in
4669 "$define"|true|[yY]*)
4670 : Look for a hint-file generated 'call-back-unit'. If the
4671 : user has specified that a maximally 64-bit perl is to be built,
4672 : we may need to set or change some other defaults.
4673 if $test -f use64bitall.cbu; then
4674 echo "Your platform has some specific hints for 64-bit builds, using them..."
4678 4) case "$archname64" in
4679 ''|64int) archname64=64all ;;
4687 echo "Checking for GNU C Library..." >&4
4688 cat >gnulibc.c <<EOM
4700 if eval $compile_ok && ./gnulibc; then
4702 echo "You are using the GNU C Library"
4705 echo "You are not using the GNU C Library"
4711 : see if nm is to be used to determine whether a symbol is defined or not
4715 case "$d_gnulibc" in
4718 echo "nm probably won't work on the GNU C Library." >&4
4724 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
4726 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
4727 echo "'nm' won't be sufficient on this sytem." >&4
4733 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
4734 if $test $dflt -gt 20; then
4744 true|$define) dflt=y;;
4751 I can use $nm to extract the symbols from your C libraries. This
4752 is a time consuming task which may generate huge output on the disk (up
4753 to 3 megabytes) but that should make the symbols extraction faster. The
4754 alternative is to skip the 'nm' extraction part and to compile a small
4755 test program instead to determine whether each symbol is present. If
4756 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
4757 this may be the best solution.
4759 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
4762 rp="Shall I use $nm to extract C symbols from the libraries?"
4765 [Nn]*) usenm=false;;
4774 : nm options which may be necessary
4776 '') if $test -f /mach_boot; then
4778 elif $test -d /usr/ccs/lib; then
4779 nm_opt='-p' # Solaris (and SunOS?)
4780 elif $test -f /dgux; then
4782 elif $test -f /lib64/rld; then
4783 nm_opt='-p' # 64-bit Irix
4789 : nm options which may be necessary for shared libraries but illegal
4790 : for archive libraries. Thank you, Linux.
4791 case "$nm_so_opt" in
4792 '') case "$myuname" in
4794 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
4795 nm_so_opt='--dynamic'
4804 : get list of predefined functions in a handy place
4809 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
4816 *) for thislib in $libs; do
4819 : Handle C library specially below.
4822 thislib=`echo $thislib | $sed -e 's/^-l//'`
4823 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
4825 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
4827 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
4829 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
4831 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
4833 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
4835 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
4840 libnames="$libnames $try"
4842 *) libnames="$libnames $thislib" ;;
4851 for xxx in $libpth; do
4852 $test -r $1 || set $xxx/libc.$so
4853 : The messy sed command sorts on library version numbers.
4855 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
4856 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
4858 s/[0-9][0-9]*/0000&/g
4859 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
4862 $sort | $sed -e 's/^.* //'`
4865 $test -r $1 || set /usr/ccs/lib/libc.$so
4866 $test -r $1 || set /lib/libsys_s$_a
4872 if $test -r "$1"; then
4873 echo "Your (shared) C library seems to be in $1."
4875 elif $test -r /lib/libc && $test -r /lib/clib; then
4876 echo "Your C library seems to be in both /lib/clib and /lib/libc."
4878 libc='/lib/clib /lib/libc'
4879 if $test -r /lib/syslib; then
4880 echo "(Your math library is in /lib/syslib.)"
4881 libc="$libc /lib/syslib"
4883 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
4884 echo "Your C library seems to be in $libc, as you said before."
4885 elif $test -r $incpath/usr/lib/libc$_a; then
4886 libc=$incpath/usr/lib/libc$_a;
4887 echo "Your C library seems to be in $libc. That's fine."
4888 elif $test -r /lib/libc$_a; then
4890 echo "Your C library seems to be in $libc. You're normal."
4892 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
4894 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
4895 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
4896 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
4898 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
4900 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
4903 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
4905 if $test -r "$tans"; then
4906 echo "Your C library seems to be in $tans, of all places."
4912 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
4916 If the guess above is wrong (which it might be if you're using a strange
4917 compiler, or your machine supports multiple models), you can override it here.
4922 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
4924 I can't seem to find your C library. I've looked in the following places:
4927 $sed 's/^/ /' libpath
4930 None of these seems to contain your C library. I need to get its name...
4935 rp='Where is your C library?'
4940 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
4941 set X `cat libnames`
4944 case $# in 1) xxx=file; esac
4945 echo "Extracting names from the following $xxx for later perusal:" >&4
4947 $sed 's/^/ /' libnames >&4
4949 $echo $n "This may take a while...$c" >&4
4953 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
4954 *) $nm $nm_opt $file 2>/dev/null;;
4959 $grep fprintf libc.tmp > libc.ptf
4960 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
4961 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
4963 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
4965 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4967 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
4969 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4971 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
4973 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4975 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
4977 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4979 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
4981 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4983 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
4985 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4987 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
4988 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
4990 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4992 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
4994 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4996 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
4998 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5000 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
5002 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5004 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
5006 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5008 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
5010 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5012 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
5014 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5016 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
5018 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5021 $nm -p $* 2>/dev/null >libc.tmp
5022 $grep fprintf libc.tmp > libc.ptf
5023 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
5024 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
5030 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
5032 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
5033 for thisname in $libnames $libc; do
5034 $ar t $thisname >>libc.tmp
5036 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
5038 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
5039 # Repeat libc to extract forwarders to DLL entries too
5040 for thisname in $libnames $libc; do
5041 $ar tv $thisname >>libc.tmp
5042 # Revision 50 of EMX has bug in $ar.
5043 # it will not extract forwarders to DLL entries
5044 # Use emximp which will extract exactly them.
5045 emximp -o tmp.imp $thisname \
5047 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
5048 < tmp.imp >>libc.tmp
5051 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
5054 echo "$ar didn't seem to work right." >&4
5055 echo "Maybe this is a Cray...trying bld instead..." >&4
5056 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
5058 for thisname in $libnames; do
5060 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
5061 $ar t $thisname >>libc.tmp
5065 echo "That didn't work either. Giving up." >&4
5072 if $test -f /lib/syscalls.exp; then
5074 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
5075 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*$/\1/p' /lib/syscalls.exp >>libc.list
5079 $rm -f libnames libpath
5081 : is a C symbol defined?
5084 -v) tf=libc.tmp; tc=""; tdc="";;
5085 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
5086 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
5089 case "$reuseval-$4" in
5091 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
5097 if $contains $tlook $tf >/dev/null 2>&1;
5102 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
5103 if $cc -o t $optimize $ccflags $ldflags t.c $libs >/dev/null 2>&1;
5111 $define) tval=true;;
5117 : define an is-in-libc? function
5118 inlibc='echo " "; td=$define; tu=$undef;
5119 sym=$1; var=$2; eval "was=\$$2";
5121 case "$reuseval$was" in
5131 echo "$sym() found." >&4;
5132 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
5134 echo "$sym() NOT found." >&4;
5135 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
5139 $define) echo "$sym() found." >&4;;
5140 *) echo "$sym() NOT found." >&4;;
5144 : see if sqrtl exists
5149 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
5152 case "$uselongdouble" in
5153 $define|true|[yY]*) dflt='y';;
5158 Perl can be built to take advantage of long doubles which
5159 (if available) may give more accuracy and range for floating point numbers.
5161 If this doesn't make any sense to you, just accept the default '$dflt'.
5163 rp='Try to use long doubles if available?'
5166 y|Y) val="$define" ;;
5172 case "$uselongdouble" in
5173 true|[yY]*) uselongdouble="$define" ;;
5176 case "$uselongdouble" in
5178 : Look for a hint-file generated 'call-back-unit'. If the
5179 : user has specified that long doubles should be used,
5180 : we may need to set or change some other defaults.
5181 if $test -f uselongdouble.cbu; then
5182 echo "Your platform has some specific hints for long doubles, using them..."
5183 . ./uselongdouble.cbu
5186 (Your platform doesn't have any specific hints for long doubles.)
5192 case "$uselongdouble:$d_sqrtl" in
5196 *** You requested the use of long doubles but you do not seem to have
5197 *** the mathematic functions for long doubles. I'm disabling the use
5198 *** of long doubles.
5201 uselongdouble=$undef
5205 : check for length of double
5207 case "$doublesize" in
5209 echo "Checking to see how big your double precision numbers are..." >&4
5210 $cat >try.c <<'EOCP'
5214 printf("%d\n", (int)sizeof(double));
5219 if eval $compile_ok; then
5221 echo "Your double is $doublesize bytes long."
5224 echo "(I can't seem to compile the test program. Guessing...)"
5225 rp="What is the size of a double precision number (in bytes)?"
5233 : check for long doubles
5235 echo "Checking to see if you have long double..." >&4
5236 echo 'int main() { long double x = 7.0; }' > try.c
5238 if eval $compile; then
5240 echo "You have long double."
5243 echo "You do not have long double."
5249 : check for length of long double
5250 case "${d_longdbl}${longdblsize}" in
5253 echo "Checking to see how big your long doubles are..." >&4
5254 $cat >try.c <<'EOCP'
5258 printf("%d\n", sizeof(long double));
5263 if eval $compile; then
5264 longdblsize=`./try$exe_ext`
5265 echo "Your long doubles are $longdblsize bytes long."
5269 echo "(I can't seem to compile the test program. Guessing...)" >&4
5270 rp="What is the size of a long double (in bytes)?"
5274 if $test "X$doublesize" = "X$longdblsize"; then
5275 echo "(That isn't any different from an ordinary double.)"
5281 : determine the architecture name
5283 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5284 tarch=`arch`"-$osname"
5285 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5286 if uname -m > tmparch 2>&1 ; then
5287 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5288 -e 's/$/'"-$osname/" tmparch`
5296 case "$myarchname" in
5299 echo "(Your architecture name used to be $myarchname.)"
5306 *) dflt="$archname";;
5308 rp='What is your architecture name'
5311 case "$usethreads" in
5313 echo "Threads selected." >&4
5315 *-thread*) echo "...and architecture name already has -thread." >&4
5317 *) archname="$archname-thread"
5318 echo "...setting architecture name to $archname." >&4
5323 case "$usemultiplicity" in
5325 echo "Multiplicity selected." >&4
5327 *-multi*) echo "...and architecture name already has -multi." >&4
5329 *) archname="$archname-multi"
5330 echo "...setting architecture name to $archname." >&4
5335 case "$use64bitint$use64bitall" in
5337 case "$archname64" in
5339 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
5342 case "$use64bitint" in
5343 "$define") echo "64 bit integers selected." >&4 ;;
5345 case "$use64bitall" in
5346 "$define") echo "Maximal 64 bitness selected." >&4 ;;
5349 *-$archname64*) echo "...and architecture name already has $archname64." >&4
5351 *) archname="$archname-$archname64"
5352 echo "...setting architecture name to $archname." >&4
5358 case "$uselongdouble" in
5360 echo "Long doubles selected." >&4
5361 case "$longdblsize" in
5363 "...but long doubles are equal to doubles, not changing architecture name." >&4
5367 *-ld*) echo "...and architecture name already has -ld." >&4
5369 *) archname="$archname-ld"
5370 echo "...setting architecture name to $archname." >&4
5378 : determine root of directory hierarchy where package will be installed.
5381 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
5389 By default, $package will be installed in $dflt/bin, manual pages
5390 under $dflt/man, etc..., i.e. with $dflt as prefix for all
5391 installation directories. Typically this is something like /usr/local.
5392 If you wish to have binaries under /usr/bin but other parts of the
5393 installation under /usr/local, that's ok: you will be prompted
5394 separately for each of the installation directories, the prefix being
5395 only used to set the defaults.
5399 rp='Installation prefix to use?'
5407 *) oldprefix="$prefix";;
5417 $define|true) afs=true ;;
5418 $undef|false) afs=false ;;
5419 *) if test -d /afs; then
5427 echo "AFS may be running... I'll be extra cautious then..." >&4
5429 echo "AFS does not seem to be running..." >&4
5432 : determine installation prefix for where package is to be installed.
5436 Since you are running AFS, I need to distinguish the directory in which
5437 files will reside from the directory in which they are installed (and from
5438 which they are presumably copied to the former directory by occult means).
5441 case "$installprefix" in
5442 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
5443 *) dflt="$installprefix";;
5448 In some special cases, particularly when building $package for distribution,
5449 it is convenient to distinguish between the directory in which files should
5450 be installed from the directory ($prefix) in which they
5451 will eventually reside. For most users, these two directories are the same.
5454 case "$installprefix" in
5456 *) dflt=$installprefix;;
5460 rp='What installation prefix should I use for installing files?'
5462 installprefix="$ans"
5463 installprefixexp="$ansexp"
5465 : set the prefixit variable, to compute a suitable default value
5466 prefixit='case "$3" in
5468 case "$oldprefix" in
5469 "") eval "$1=\"\$$2\"";;
5476 ""|" ") eval "$1=\"\$$2\"";;
5482 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
5484 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
5485 /*-$oldprefix/*|\~*-$oldprefix/*)
5486 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
5487 *) eval "$1=\"\$$2\"";;
5492 : get the patchlevel
5494 echo "Getting the current patchlevel..." >&4
5495 if $test -r $rsrc/patchlevel.h;then
5496 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
5497 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
5498 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5499 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
5500 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
5501 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5510 $echo "(You have $package version $patchlevel subversion $subversion.)"
5513 : XXX Should be a Configure test for double-dots in filenames.
5514 version=`echo $revision $patchlevel $subversion | \
5515 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
5516 api_versionstring=`echo $api_revision $api_version $api_subversion | \
5517 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
5520 version=`echo $revision $patchlevel $subversion | \
5521 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
5522 api_versionstring=`echo $api_revision $api_version $api_subversion | \
5523 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
5526 : Special case the 5.005_xx maintenance series, which used 5.005
5527 : without any subversion label as a subdirectory in $sitelib
5528 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
5529 api_versionstring='5.005'
5532 : determine installation style
5533 : For now, try to deduce it from prefix unless it is already set.
5534 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
5535 case "$installstyle" in
5536 '') case "$prefix" in
5537 *perl*) dflt='lib';;
5538 *) dflt='lib/perl5' ;;
5541 *) dflt="$installstyle" ;;
5543 : Probably not worth prompting for this since we prompt for all
5544 : the directories individually, and the prompt would be too long and
5548 : determine where private library files go
5549 : Usual default is /usr/local/lib/perl5/$version.
5550 : Also allow things like /opt/perl/lib/$version, since
5551 : /opt/perl/lib/perl5... would be redundant.
5552 : The default "style" setting is made in installstyle.U
5553 case "$installstyle" in
5554 *lib/perl5*) set dflt privlib lib/$package/$version ;;
5555 *) set dflt privlib lib/$version ;;
5560 There are some auxiliary files for $package that need to be put into a
5561 private library directory that is accessible by everyone.
5565 rp='Pathname where the private library files will reside?'
5568 privlibexp="$ansexp"
5569 : Change installation prefix, if necessary.
5570 if $test X"$prefix" != X"$installprefix"; then
5571 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
5573 installprivlib="$privlibexp"
5576 : set the prefixup variable, to restore leading tilda escape
5577 prefixup='case "$prefixexp" in
5579 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
5582 : determine where public architecture dependent libraries go
5585 : privlib default is /usr/local/lib/$package/$version
5586 : archlib default is /usr/local/lib/$package/$version/$archname
5587 : privlib may have an optional trailing /share.
5588 tdflt=`echo $privlib | $sed 's,/share$,,'`
5589 tdflt=$tdflt/$archname
5598 $spackage contains architecture-dependent library files. If you are
5599 sharing libraries in a heterogeneous environment, you might store
5600 these files in a separate location. Otherwise, you can just include
5601 them with the rest of the public library files.
5605 rp='Where do you want to put the public architecture-dependent libraries?'
5608 archlibexp="$ansexp"
5609 if $test X"$archlib" = X"$privlib"; then
5614 : Change installation prefix, if necessary.
5615 if $test X"$prefix" != X"$installprefix"; then
5616 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
5618 installarchlib="$archlibexp"
5622 : Binary compatibility with 5.005 is not possible for builds
5623 : with advanced features
5624 case "$usethreads$usemultiplicity" in
5626 bincompat5005="$undef"
5627 d_bincompat5005="$undef"
5631 This version of Perl can be compiled for binary compatibility with 5.005.
5632 If you decide to do so, you will be able to continue using most of the
5633 extensions that were compiled for Perl 5.005.
5636 case "$bincompat5005$d_bincompat5005" in
5637 *"$undef"*) dflt=n ;;
5640 rp='Binary compatibility with Perl 5.005?'
5643 y*) val="$define" ;;
5648 case "$d_bincompat5005" in
5650 bincompat5005="$define"
5652 *) bincompat5005="$undef"
5653 d_bincompat5005="$undef"
5660 : see if setuid scripts can be secure
5663 Some kernels have a bug that prevents setuid #! scripts from being
5664 secure. Some sites have disabled setuid #! scripts because of this.
5666 First let's decide if your kernel supports secure setuid #! scripts.
5667 (If setuid #! scripts would be secure but have been disabled anyway,
5668 don't say that they are secure if asked.)
5673 if $test -d /dev/fd; then
5674 echo "#!$ls" >reflect
5675 chmod +x,u+s reflect
5676 ./reflect >flect 2>&1
5677 if $contains "/dev/fd" flect >/dev/null; then
5678 echo "Congratulations, your kernel has secure setuid scripts!" >&4
5682 If you are not sure if they are secure, I can check but I'll need a
5683 username and password different from the one you are using right now.
5684 If you don't have such a username or don't want me to test, simply
5688 rp='Other username to test security of setuid scripts with?'
5693 case "$d_suidsafe" in
5694 '') echo "I'll assume setuid scripts are *not* secure." >&4
5697 echo "Well, the $hint value is *not* secure." >&4
5699 *) echo "Well, the $hint value *is* secure." >&4
5704 $rm -f reflect flect
5705 echo "#!$ls" >reflect
5706 chmod +x,u+s reflect
5709 echo '"su" will (probably) prompt you for '"$ans's password."
5710 su $ans -c './reflect >flect'
5711 if $contains "/dev/fd" flect >/dev/null; then
5712 echo "Okay, it looks like setuid scripts are secure." >&4
5715 echo "I don't think setuid scripts are secure." >&4
5720 rp='Does your kernel have *secure* setuid scripts?'
5723 [yY]*) val="$define";;
5728 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
5729 echo "(That's for file descriptors, not floppy disks.)"
5735 $rm -f reflect flect
5737 : now see if they want to do setuid emulation
5740 case "$d_suidsafe" in
5743 echo "No need to emulate SUID scripts since they are secure here." >& 4
5747 Some systems have disabled setuid scripts, especially systems where
5748 setuid scripts cannot be secure. On systems where setuid scripts have
5749 been disabled, the setuid/setgid bits on scripts are currently
5750 useless. It is possible for $package to detect those bits and emulate
5751 setuid/setgid in a secure fashion. This emulation will only work if
5752 setuid scripts have been disabled in your kernel.
5756 "$define") dflt=y ;;
5759 rp="Do you want to do setuid/setgid emulation?"
5762 [yY]*) val="$define";;
5770 : determine filename position in cpp output
5772 echo "Computing filename position in cpp output for #include directives..." >&4
5773 echo '#include <stdio.h>' > foo.c
5776 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5777 $grep '^[ ]*#.*stdio\.h' | \
5778 while read cline; do
5781 while $test \$# -gt 0; do
5782 if $test -r \`echo \$1 | $tr -d '"'\`; then
5787 pos=\`expr \$pos + 1\`
5799 *) pos="${fieldn}th";;
5801 echo "Your cpp writes the filename in the $pos field of the line."
5803 : locate header file
5808 for usrincdir in $usrinc
5810 if test -f \$usrincdir/\$wanted; then
5811 echo "\$usrincdir/\$wanted"
5815 awkprg='{ print \$$fieldn }'
5816 echo "#include <\$wanted>" > foo\$\$.c
5817 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5818 $grep "^[ ]*#.*\$wanted" | \
5819 while read cline; do
5820 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5822 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5823 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5828 # status = 0: grep returned 0 lines, case statement not executed
5829 # status = 1: headerfile found
5830 # status = 2: while loop executed, no headerfile found
5834 if test \$status -eq 1; then
5841 : define an alternate in-header-list? function
5842 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5843 cont=true; xxf="echo \"<\$1> found.\" >&4";
5844 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5845 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5847 case $# in 4) instead=instead;; *) instead="at last";; esac;
5848 while $test "$cont"; do
5850 var=$2; eval "was=\$$2";
5851 if $test "$xxx" && $test -r "$xxx";
5853 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5856 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5857 set $yyy; shift; shift; yyy=$@;
5858 case $# in 0) cont="";;
5859 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5860 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5861 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5862 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5866 do set $yyy; var=$2; eval "was=\$$2";
5867 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5868 set $yyy; shift; shift; yyy=$@;
5871 : see if this is a malloc.h system
5872 set malloc.h i_malloc
5875 : see if stdlib is available
5876 set stdlib.h i_stdlib
5879 : determine which malloc to compile in
5881 case "$usemymalloc" in
5882 ''|[yY]*|true|$define) dflt='y' ;;
5885 rp="Do you wish to attempt to use the malloc that comes with $package?"
5891 mallocsrc='malloc.c'
5892 mallocobj="malloc$_o"
5893 d_mymalloc="$define"
5896 : Remove malloc from list of libraries to use
5897 echo "Removing unneeded -lmalloc from library list" >&4
5898 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
5901 echo "libs = $libs" >&4
5913 : compute the return types of malloc and free
5915 $cat >malloc.c <<END
5919 #include <sys/types.h>
5933 case "$malloctype" in
5935 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
5942 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
5946 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
5953 echo "Your system uses $freetype free(), it would seem." >&4
5957 After $package is installed, you may wish to install various
5958 add-on modules and utilities. Typically, these add-ons will
5959 be installed under $prefix with the rest
5960 of this package. However, you may wish to install such add-ons
5961 elsewhere under a different prefix.
5963 If you do not wish to put everything under a single prefix, that's
5964 ok. You will be prompted for the individual locations; this siteprefix
5965 is only used to suggest the defaults.
5967 The default should be fine for most people.
5971 rp='Installation prefix to use for add-on modules and utilities?'
5972 : XXX Here might be another good place for an installstyle setting.
5973 case "$siteprefix" in
5975 *) dflt=$siteprefix ;;
5978 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
5980 case "$siteprefix" in
5984 *) oldsiteprefix="$prefix";;
5989 siteprefixexp="$ansexp"
5991 : determine where site specific libraries go.
5992 : Usual default is /usr/local/lib/perl5/site_perl/$version
5993 : The default "style" setting is made in installstyle.U
5994 : XXX No longer works with Prefixit stuff.
5995 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5997 '') case "$installstyle" in
5998 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
5999 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6007 The installation process will create a directory for
6008 site-specific extensions and modules. Most users find it convenient
6009 to place all site-specific files in this directory rather than in the
6010 main distribution directory.
6014 rp='Pathname for the site-specific library files?'
6017 sitelibexp="$ansexp"
6018 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6019 : Change installation prefix, if necessary.
6020 if $test X"$prefix" != X"$installprefix"; then
6021 installsitelib=`echo $sitelibexp | $sed "s#^$prefix#$installprefix#"`
6023 installsitelib="$sitelibexp"
6026 : determine where site specific architecture-dependent libraries go.
6027 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6028 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6029 : sitelib may have an optional trailing /share.
6031 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6032 dflt="$dflt/$archname"
6037 set sitearch sitearch none
6041 The installation process will also create a directory for
6042 architecture-dependent site-specific extensions and modules.
6046 rp='Pathname for the site-specific architecture-dependent library files?'
6049 sitearchexp="$ansexp"
6050 : Change installation prefix, if necessary.
6051 if $test X"$prefix" != X"$installprefix"; then
6052 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
6054 installsitearch="$sitearchexp"
6059 The installation process will also create a directory for
6060 vendor-supplied add-ons. Vendors who supply perl with their system
6061 may find it convenient to place all vendor-supplied files in this
6062 directory rather than in the main distribution directory. This will
6063 ease upgrades between binary-compatible maintenance versions of perl.
6065 Of course you may also use these directories in whatever way you see
6066 fit. For example, you might use them to access modules shared over a
6067 company-wide network.
6069 The default answer should be fine for most people.
6070 This causes further questions about vendor add-ons to be skipped
6071 and no vendor-specific directories will be configured for perl.
6074 rp='Do you want to configure vendor-specific add-on directories?'
6075 case "$usevendorprefix" in
6076 define|true|[yY]*) dflt=y ;;
6077 *) : User may have set vendorprefix directly on Configure command line.
6078 case "$vendorprefix" in
6087 rp='Installation prefix to use for vendor-supplied add-ons?'
6088 case "$vendorprefix" in
6090 *) dflt=$vendorprefix ;;
6093 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6095 case "$vendorprefix" in
6099 *) oldvendorprefix="$prefix";;
6103 usevendorprefix="$define"
6105 vendorprefixexp="$ansexp"
6107 *) usevendorprefix="$undef"
6113 case "$vendorprefix" in
6114 '') d_vendorlib="$undef"
6118 *) d_vendorlib="$define"
6119 : determine where vendor-supplied modules go.
6120 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6121 case "$vendorlib" in
6123 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6124 case "$installstyle" in
6125 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6126 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6129 *) dflt="$vendorlib"
6133 rp='Pathname for the vendor-supplied library files?'
6136 vendorlibexp="$ansexp"
6139 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6140 : Change installation prefix, if necessary.
6141 if $test X"$prefix" != X"$installprefix"; then
6142 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
6144 installvendorlib="$vendorlibexp"
6147 case "$vendorprefix" in
6148 '') d_vendorarch="$undef"
6152 *) d_vendorarch="$define"
6153 : determine where vendor-supplied architecture-dependent libraries go.
6154 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6155 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6156 : vendorlib may have an optional trailing /share.
6157 case "$vendorarch" in
6158 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6159 dflt="$dflt/$archname"
6161 *) dflt="$vendorarch" ;;
6164 rp='Pathname for vendor-supplied architecture-dependent files?'
6167 vendorarchexp="$ansexp"
6170 : Change installation prefix, if necessary.
6171 if $test X"$prefix" != X"$installprefix"; then
6172 installvendorarch=`echo $vendorarchexp | sed "s#^$prefix#$installprefix#"`
6174 installvendorarch="$vendorarchexp"
6177 : Final catch-all directories to search
6180 Lastly, you can have perl look in other directories for extensions and
6181 modules in addition to those already specified.
6182 These directories will be searched after
6186 test X"$vendorlib" != "X" && echo ' ' $vendorlib
6187 test X"$vendorarch" != "X" && echo ' ' $vendorarch
6189 case "$otherlibdirs" in
6190 ''|' ') dflt='none' ;;
6191 *) dflt="$otherlibdirs" ;;
6194 Enter a colon-separated set of extra paths to include in perl's @INC
6195 search path, or enter 'none' for no extra paths.
6199 rp='Colon-separated list of additional directories for perl to search?'
6202 ' '|''|none) otherlibdirs=' ' ;;
6203 *) otherlibdirs="$ans" ;;
6205 case "$otherlibdirs" in
6209 set d_perl_otherlibdirs
6212 : Cruising for prototypes
6214 echo "Checking out function prototypes..." >&4
6215 $cat >prototype.c <<'EOCP'
6216 int main(int argc, char *argv[]) {
6219 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
6220 echo "Your C compiler appears to support function prototypes."
6223 echo "Your C compiler doesn't seem to understand function prototypes."
6230 case "$prototype" in
6232 *) ansi2knr='ansi2knr'
6237 This version of $package can only be compiled by a compiler that
6238 understands function prototypes. Unfortunately, your C compiler
6240 doesn't seem to understand them. Sorry about that.
6242 If GNU cc is available for your system, perhaps you could try that instead.
6244 Eventually, we hope to support building Perl with pre-ANSI compilers.
6245 If you would like to help in that effort, please contact <perlbug@perl.org>.
6247 Aborting Configure now.
6253 : determine where public executables go
6258 rp='Pathname where the public executables will reside?'
6260 if $test "X$ansexp" != "X$binexp"; then
6265 : Change installation prefix, if necessary.
6266 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6267 if $test X"$prefix" != X"$installprefix"; then
6268 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
6270 installbin="$binexp"
6273 : Find perl5.005 or later.
6274 echo "Looking for a previously installed perl5.005 or later... "
6276 '') for tdir in `echo "$binexp:$PATH" | $sed "s/$path_sep/ /g"`; do
6277 : Check if this perl is recent and can load a simple module
6278 if $test -x $tdir/perl && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6281 elif $test -x $tdir/perl5 && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6291 '') echo "None found. That's ok.";;
6292 *) echo "Using $perl5." ;;
6295 : Determine list of previous versions to include in @INC
6296 $cat > getverlist <<EOPL
6299 \$api_versionstring = "$api_versionstring";
6300 \$version = "$version";
6301 \$stem = "$sitelib_stem";
6302 \$archname = "$archname";
6304 $cat >> getverlist <<'EOPL'
6305 # Can't have leading @ because metaconfig interprets it as a command!
6306 ;@inc_version_list=();
6307 # XXX Redo to do opendir/readdir?
6310 ;@candidates = glob("5.*");
6316 # XXX ToDo: These comparisons must be reworked when two-digit
6317 # subversions come along, so that 5.7.10 compares as greater than
6318 # 5.7.3! By that time, hope that 5.6.x is sufficiently
6319 # widespread that we can use the built-in version vectors rather
6320 # than reinventing them here. For 5.6.0, however, we must
6321 # assume this script will likely be run by 5.005_0x. --AD 1/2000.
6322 foreach $d (@candidates) {
6323 if ($d lt $version) {
6324 if ($d ge $api_versionstring) {
6325 unshift(@inc_version_list, grep { -d } "$d/$archname", $d);
6327 elsif ($d ge "5.005") {
6328 unshift(@inc_version_list, grep { -d } $d);
6332 # Skip newer version. I.e. don't look in
6333 # 5.7.0 if we're installing 5.6.1.
6337 if (@inc_version_list) {
6338 print join(' ', @inc_version_list);
6341 # Blank space to preserve value for next Configure run.
6346 case "$inc_version_list" in
6347 '') if test -x "$perl5"; then
6348 dflt=`$perl5 getverlist`
6353 $undef) dflt='none' ;;
6354 *) dflt="$inc_version_list" ;;
6357 ''|' ') dflt=none ;;
6360 5.005) case "$bincompat5005" in
6361 $define|true|[yY]*) ;;
6368 In order to ease the process of upgrading, this version of perl
6369 can be configured to use modules built and installed with earlier
6370 versions of perl that were installed under $prefix. Specify here
6371 the list of earlier versions that this version of perl should check.
6372 If Configure detected no earlier versions of perl installed under
6373 $prefix, then the list will be empty. Answer 'none' to tell perl
6374 to not search earlier versions.
6376 The default should almost always be sensible, so if you're not sure,
6377 just accept the default.
6380 rp='List of earlier versions to include in @INC?'
6383 [Nn]one|''|' ') inc_version_list=' ' ;;
6384 *) inc_version_list="$ans" ;;
6386 case "$inc_version_list" in
6388 inc_version_list_init='0';;
6389 *) inc_version_list_init=`echo $inc_version_list |
6390 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6395 : determine whether to install perl also as /usr/bin/perl
6398 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
6400 Many scripts expect perl to be installed as /usr/bin/perl.
6401 I can install the perl you are about to compile also as /usr/bin/perl
6402 (in addition to $installbin/perl).
6404 case "$installusrbinperl" in
6405 "$undef"|[nN]*) dflt='n';;
6408 rp="Do you want to install perl as /usr/bin/perl?"
6411 [yY]*) val="$define";;
6417 set installusrbinperl
6420 : see if dld is available
6424 : see if dlopen exists
6431 : determine which dynamic loading, if any, to compile in
6433 dldir="ext/DynaLoader"
6446 $define) dflt='y' ;;
6449 $define) dflt='y' ;;
6451 : Does a dl_xxx.xs file exist for this operating system
6452 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
6455 rp="Do you wish to use dynamic loading?"
6462 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
6463 dflt="$dldir/dl_${osname}.xs"
6464 elif $test "$d_dlopen" = "$define" ; then
6465 dflt="$dldir/dl_dlopen.xs"
6466 elif $test "$i_dld" = "$define" ; then
6467 dflt="$dldir/dl_dld.xs"
6472 *) dflt="$dldir/$dlsrc"
6475 echo "The following dynamic loading files are available:"
6476 : Can not go over to $dldir because getfile has path hard-coded in.
6477 tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir
6478 rp="Source file to use for dynamic loading"
6484 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
6488 Some systems may require passing special flags to $cc -c to
6489 compile modules that will be used to create a shared library.
6490 To use no flags, say "none".
6493 case "$cccdlflags" in
6494 '') case "$gccversion" in
6495 '') case "$osname" in
6497 next) dflt='none' ;;
6498 irix*) dflt='-KPIC' ;;
6499 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
6500 sunos) dflt='-pic' ;;
6504 *) case "$osname" in
6505 svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
6510 *) dflt="$cccdlflags" ;;
6512 rp="Any special flags to pass to $cc -c to compile shared library modules?"
6515 none) cccdlflags=' ' ;;
6516 *) cccdlflags="$ans" ;;
6521 Some systems use ld to create libraries that can be dynamically loaded,
6522 while other systems (such as those using ELF) use $cc.
6526 '') $cat >try.c <<'EOM'
6527 /* Test for whether ELF binaries are produced */
6532 int i = open("a.out",O_RDONLY);
6535 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
6536 exit(0); /* succeed (yes, it's ELF) */
6541 if $cc $ccflags try.c >/dev/null 2>&1 && ./a.out; then
6543 You appear to have ELF support. I'll use $cc to build dynamic libraries.
6547 echo "I'll use ld to build dynamic libraries."
6556 rp="What command should be used to create dynamic libraries?"
6562 Some systems may require passing special flags to $ld to create a
6563 library that can be dynamically loaded. If your ld flags include
6564 -L/other/path options to locate libraries outside your loader's normal
6565 search path, you may need to specify those -L options here as well. To
6566 use no flags, say "none".
6569 case "$lddlflags" in
6570 '') case "$osname" in
6571 beos) dflt='-nostart' ;;
6573 case "$gccversion" in
6574 '') dflt="$dflt +vnocompatwarnings" ;;
6577 linux|irix*) dflt='-shared' ;;
6578 next) dflt='none' ;;
6579 solaris) dflt='-G' ;;
6580 sunos) dflt='-assert nodefinitions' ;;
6581 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
6585 *) dflt="$lddlflags" ;;
6588 : Try to guess additional flags to pick up local libraries.
6589 : Be careful not to append to a plain 'none'
6593 for thisflag in $ldflags; do
6598 *) dflt="$dflt $thisflag" ;;
6605 ''|' ') dflt='none' ;;
6608 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
6611 none) lddlflags=' ' ;;
6612 *) lddlflags="$ans" ;;
6617 Some systems may require passing special flags to $cc to indicate that
6618 the resulting executable will use dynamic linking. To use no flags,
6622 case "$ccdlflags" in
6623 '') case "$osname" in
6624 hpux) dflt='-Wl,-E' ;;
6625 linux) dflt='-rdynamic' ;;
6626 next) dflt='none' ;;
6627 sunos) dflt='none' ;;
6631 *) dflt="$ccdlflags" ;;
6633 rp="Any special flags to pass to $cc to use dynamic linking?"
6636 none) ccdlflags=' ' ;;
6637 *) ccdlflags="$ans" ;;
6651 # No dynamic loading being used, so don't bother even to prompt.
6654 *) case "$useshrplib" in
6655 '') case "$osname" in
6656 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
6658 also='Building a shared libperl is required for dynamic loading to work on your system.'
6663 also='Building a shared libperl is needed for MAB support.'
6681 The perl executable is normally obtained by linking perlmain.c with
6682 libperl${_a}, any static extensions (usually just DynaLoader), and
6683 any other libraries needed on this system (such as -lm, etc.). Since
6684 your system supports dynamic loading, it is probably possible to build
6685 a shared libperl.$so. If you will have more than one executable linked
6686 to libperl.$so, this will significantly reduce the size of each
6687 executable, but it may have a noticeable affect on performance. The
6688 default is probably sensible for your system.
6692 rp="Build a shared libperl.$so (y/n)"
6696 useshrplib='true' ;;
6697 *) useshrplib='false' ;;
6702 case "$useshrplib" in
6706 # Figure out a good name for libperl.so. Since it gets stored in
6707 # a version-specific architecture-dependent library, the version
6708 # number isn't really that important, except for making cc/ld happy.
6710 # A name such as libperl.so.3.1
6711 majmin="libperl.$so.$patchlevel.$subversion"
6712 # A name such as libperl.so.301
6713 majonly=`echo $patchlevel $subversion |
6714 $awk '{printf "%d%02d", $1, $2}'`
6715 majonly=libperl.$so.$majonly
6716 # I'd prefer to keep the os-specific stuff here to a minimum, and
6717 # rely on figuring it out from the naming of libc.
6718 case "${osname}${osvers}" in
6721 # XXX How handle the --version stuff for MAB?
6723 linux*) # ld won't link with a bare -lperl otherwise.
6726 cygwin*) # include version
6727 dflt=`echo libperl$version | sed -e 's/\./_/g'`$lib_ext
6729 *) # Try to guess based on whether libc has major.minor.
6731 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
6732 *libc.$so.[0-9]*) dflt=$majonly ;;
6733 *) dflt=libperl.$so ;;
6743 I need to select a good name for the shared libperl. If your system uses
6744 library names with major and minor numbers, then you might want something
6745 like $majmin. Alternatively, if your system uses a single version
6746 number for shared libraries, then you might want to use $majonly.
6747 Or, your system might be quite happy with a simple libperl.$so.
6749 Since the shared libperl will get installed into a version-specific
6750 architecture-dependent directory, the version number of the shared perl
6751 library probably isn't important, so the default should be o.k.
6754 rp='What name do you want to give to the shared libperl?'
6757 echo "Ok, I'll use $libperl"
6760 libperl="libperl${_a}"
6764 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
6768 WARNING: Use of the shrpdir variable for the installation location of
6769 the shared $libperl is not supported. It was never documented and
6770 will not work in this version. Let me (perlbug@perl.org)
6771 know of any problems this may cause.
6777 But your current setting of $shrpdir is
6778 the default anyway, so it's harmless.
6783 Further, your current attempted setting of $shrpdir
6784 conflicts with the value of $archlibexp/CORE
6785 that installperl will use.
6792 # How will the perl executable find the installed shared $libperl?
6793 # Add $xxx to ccdlflags.
6794 # If we can't figure out a command-line option, use $shrpenv to
6795 # set env LD_RUN_PATH. The main perl makefile uses this.
6796 shrpdir=$archlibexp/CORE
6799 if "$useshrplib"; then
6802 # We'll set it in Makefile.SH...
6808 xxx="-Wl,-R$shrpdir"
6810 linux|irix*|dec_osf)
6811 xxx="-Wl,-rpath,$shrpdir"
6814 # next doesn't like the default...
6817 # beos doesn't like the default, either.
6820 # hpux doesn't like the default, either.
6821 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
6824 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
6830 # Only add $xxx if it isn't already in ccdlflags.
6831 case " $ccdlflags " in
6833 *) ccdlflags="$ccdlflags $xxx"
6836 Adding $xxx to the flags
6837 passed to $ld so that the perl executable will find the
6838 installed shared $libperl.
6846 # Fix ccdlflags in AIX for building external extensions.
6847 # (For building Perl itself bare -bE:perl.exp is needed,
6848 # Makefile.SH takes care of this.)
6850 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
6852 # Respect a hint or command-line value.
6854 '') shrpenv="$tmp_shrpenv" ;;
6856 case "$ldlibpthname" in
6857 '') ldlibpthname=LD_LIBRARY_PATH ;;
6858 none) ldlibpthname='' ;;
6861 : determine where manual pages are on this system
6865 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
6866 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
6867 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
6868 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
6869 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
6870 sysman=`./loc . /usr/man/man1 $syspath`
6873 if $test -d "$sysman"; then
6874 echo "System manual is in $sysman." >&4
6876 echo "Could not find manual pages in source form." >&4
6879 : determine where manual pages go
6880 set man1dir man1dir none
6884 $spackage has manual pages available in source form.
6888 echo "However, you don't have nroff, so they're probably useless to you."
6890 '') man1dir="none";;
6893 echo "If you don't want the manual sources installed, answer 'none'."
6898 lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
6899 lookpath="$lookpath $prefixexp/man/p_man/man1"
6900 lookpath="$lookpath $prefixexp/man/u_man/man1"
6901 lookpath="$lookpath $prefixexp/man/man.1"
6903 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
6904 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
6914 rp="Where do the main $spackage manual pages (source) go?"
6916 if $test "X$man1direxp" != "X$ansexp"; then
6920 man1direxp="$ansexp"
6926 : Change installation prefix, if necessary.
6927 if $test X"$prefix" != X"$installprefix"; then
6928 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
6930 installman1dir="$man1direxp"
6933 : What suffix to use on installed man pages
6940 rp="What suffix should be used for the main $spackage man pages?"
6942 '') case "$man1dir" in
6956 *) dflt="$man1ext";;
6963 : see if we can have long filenames
6965 first=123456789abcdef
6967 if (echo hi >$first) 2>/dev/null; then
6968 if $test -f 123456789abcde; then
6969 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
6972 echo 'You can have filenames longer than 14 characters.'>&4
6977 You can't have filenames longer than 14 chars.
6978 You can't even think about them!
6984 $rm -rf 123456789abcde*
6986 : determine where library module manual pages go
6987 set man3dir man3dir none
6991 $spackage has manual pages for many of the library modules.
6997 However, you don't have nroff, so they're probably useless to you.
7000 '') man3dir="none";;
7004 case "$d_flexfnam" in
7007 However, your system can't handle the long file names like File::Basename.3.
7010 '') man3dir="none";;
7014 echo "If you don't want the manual sources installed, answer 'none'."
7015 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7017 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
7018 if $test -d "$privlib/man/man3"; then
7021 WARNING: Previous versions of perl installed man3 pages into
7022 $privlib/man/man3. This version will suggest a
7023 new default of $dflt.
7027 rp='Do you wish to preserve the old behavior?(y/n)'
7030 y*) dflt="$privlib/man/man3" ;;
7035 *) dflt="$man3dir" ;;
7042 rp="Where do the $package library man pages (source) go?"
7045 man3direxp="$ansexp"
7051 : Change installation prefix, if necessary.
7052 if $test X"$prefix" != X"$installprefix"; then
7053 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
7055 installman3dir="$man3direxp"
7058 : What suffix to use on installed man pages
7064 rp="What suffix should be used for the $package library man pages?"
7066 '') case "$man3dir" in
7080 *) dflt="$man3ext";;
7087 : see if we have to deal with yellow pages, now NIS.
7088 if $test -d /usr/etc/yp || $test -d /etc/yp; then
7089 if $test -f /usr/etc/nibindd; then
7091 echo "I'm fairly confident you're on a NeXT."
7093 rp='Do you get the hosts file via NetInfo?'
7102 y*) hostcat='nidump hosts .';;
7103 *) case "$hostcat" in
7104 nidump*) hostcat='';;
7114 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
7122 rp='Are you getting the hosts file via yellow pages?'
7125 y*) hostcat='ypcat hosts';;
7126 *) hostcat='cat /etc/hosts';;
7132 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
7135 '') test -f /etc/group && groupcat='cat /etc/group';;
7138 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
7141 : now get the host name
7143 echo "Figuring out host name..." >&4
7144 case "$myhostname" in
7146 echo 'Maybe "hostname" will work...'
7147 if tans=`sh -c hostname 2>&1` ; then
7155 if $test "$cont"; then
7157 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
7158 if tans=`cat /etc/systemid 2>&1` ; then
7160 phostname='cat /etc/systemid'
7161 echo "Whadyaknow. Xenix always was a bit strange..."
7164 elif $test -r /etc/systemid; then
7165 echo "(What is a non-Xenix system doing with /etc/systemid?)"
7168 if $test "$cont"; then
7169 echo 'No, maybe "uuname -l" will work...'
7170 if tans=`sh -c 'uuname -l' 2>&1` ; then
7172 phostname='uuname -l'
7174 echo 'Strange. Maybe "uname -n" will work...'
7175 if tans=`sh -c 'uname -n' 2>&1` ; then
7177 phostname='uname -n'
7179 echo 'Oh well, maybe I can mine it out of whoami.h...'
7180 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
7181 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
7182 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
7184 case "$myhostname" in
7185 '') echo "Does this machine have an identity crisis or something?"
7188 echo "Well, you said $myhostname before..."
7189 phostname='echo $myhostname';;
7195 : you do not want to know about this
7200 if $test "$myhostname" ; then
7202 rp='Your host name appears to be "'$myhostname'".'" Right?"
7210 : bad guess or no guess
7211 while $test "X$myhostname" = X ; do
7213 rp="Please type the (one word) name of your host:"
7218 : translate upper to lower if necessary
7219 case "$myhostname" in
7221 echo "(Normalizing case in your host name)"
7222 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
7226 case "$myhostname" in
7228 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
7229 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
7230 echo "(Trimming domain name from host name--host name is now $myhostname)"
7232 *) case "$mydomain" in
7235 test "X$hostcat" = "Xypcat hosts" &&
7236 ypmatch "$myhostname" hosts 2>/dev/null |\
7237 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
7240 test "X$hostcat" != "X" &&
7241 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
7242 /[ ]$myhostname[ . ]/p" > hosts
7245 if $test -f hosts; then
7246 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
7247 END { print sum }" hosts` = x1 || tmp_re="[ ]"
7248 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
7249 hosts | $sort | $uniq | \
7250 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
7251 case `$echo X$dflt` in
7252 X*\ *) echo "(Several hosts in the database matched hostname)"
7255 X.) echo "(You do not have fully-qualified names in the hosts database)"
7259 echo "(I cannot locate a hosts database anywhere)"
7264 tans=`./loc resolv.conf X /etc /usr/etc`
7265 if $test -f "$tans"; then
7266 echo "(Attempting domain name extraction from $tans)"
7267 dflt=.`$sed -n -e 's/ / /g' \
7268 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
7269 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
7271 .) dflt=.`$sed -n -e 's/ / /g' \
7272 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
7273 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
7280 .) echo "(No help from resolv.conf either -- attempting clever guess)"
7281 dflt=.`sh -c domainname 2>/dev/null`
7284 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
7289 .) echo "(Lost all hope -- silly guess then)"
7295 *) dflt="$mydomain";;
7299 rp="What is your domain name?"
7309 : translate upper to lower if necessary
7312 echo "(Normalizing case in your domain name)"
7313 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
7317 : a little sanity check here
7318 case "$phostname" in
7321 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
7322 $myhostname$mydomain|$myhostname) ;;
7324 case "$phostname" in
7326 echo "(That doesn't agree with your whoami.h file, by the way.)"
7329 echo "(That doesn't agree with your $phostname command, by the way.)"
7339 I need to get your e-mail address in Internet format if possible, i.e.
7340 something like user@host.domain. Please answer accurately since I have
7341 no easy means to double check it. The default value provided below
7342 is most probably close to reality but may not be valid from outside
7343 your organization...
7347 while test "$cont"; do
7349 '') dflt="$cf_by@$myhostname$mydomain";;
7350 *) dflt="$cf_email";;
7352 rp='What is your e-mail address?'
7358 rp='Address does not look like an Internet one. Use it anyway?'
7374 If you or somebody else will be maintaining perl at your site, please
7375 fill in the correct e-mail address here so that they may be contacted
7376 if necessary. Currently, the "perlbug" program included with perl
7377 will send mail to this address in addition to perlbug@perl.org. You may
7378 enter "none" for no administrator.
7381 case "$perladmin" in
7382 '') dflt="$cf_email";;
7383 *) dflt="$perladmin";;
7385 rp='Perl administrator e-mail address'
7389 : determine whether to only install version-specific parts.
7392 Do you want to install only the version-specific parts of the perl
7393 distribution? Usually you do *not* want to do this.
7395 case "$versiononly" in
7396 "$define"|[Yy]*|true) dflt='y' ;;
7399 rp="Do you want to install only the version-specific parts of perl?"
7402 [yY]*) val="$define";;
7408 : figure out how to guarantee perl startup
7409 case "$startperl" in
7411 case "$sharpbang" in
7415 I can use the #! construct to start perl on your system. This will
7416 make startup of perl scripts faster, but may cause problems if you
7417 want to share those scripts and perl is not in a standard place
7418 ($binexp/perl) on all your platforms. The alternative is to force
7419 a shell by starting the script with a single ':' character.
7422 case "$versiononly" in
7423 "$define") dflt="$binexp/perl$version";;
7424 *) dflt="$binexp/perl";;
7426 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
7429 none) startperl=": # use perl";;
7430 *) startperl="#!$ans"
7431 if $test 30 -lt `echo "$ans" | wc -c`; then
7434 WARNING: Some systems limit the #! command to 32 characters.
7435 If you experience difficulty running Perl scripts with #!, try
7436 installing Perl in a directory with a shorter pathname.
7442 *) startperl=": # use perl"
7447 echo "I'll use $startperl to start perl scripts."
7449 : figure best path for perl in scripts
7452 perlpath="$binexp/perl"
7453 case "$startperl" in
7458 I will use the "eval 'exec'" idiom to start Perl on your system.
7459 I can use the full path of your Perl binary for this purpose, but
7460 doing so may cause problems if you want to share those scripts and
7461 Perl is not always in a standard place ($binexp/perl).
7465 rp="What path shall I use in \"eval 'exec'\"?"
7472 case "$startperl" in
7474 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
7477 : determine where public executable scripts go
7478 set scriptdir scriptdir
7480 case "$scriptdir" in
7483 : guess some guesses
7484 $test -d /usr/share/scripts && dflt=/usr/share/scripts
7485 $test -d /usr/share/bin && dflt=/usr/share/bin
7486 $test -d /usr/local/script && dflt=/usr/local/script
7487 $test -d /usr/local/scripts && dflt=/usr/local/scripts
7488 $test -d $prefixexp/script && dflt=$prefixexp/script
7492 *) dflt="$scriptdir"
7497 Some installations have a separate directory just for executable scripts so
7498 that they can mount it across multiple architectures but keep the scripts in
7499 one spot. You might, for example, have a subdirectory of /usr/share for this.
7500 Or you might just lump your scripts in with all your other executables.
7504 rp='Where do you keep publicly executable scripts?'
7506 if $test "X$ansexp" != "X$scriptdirexp"; then
7510 scriptdirexp="$ansexp"
7511 : Change installation prefix, if necessary.
7512 if $test X"$prefix" != X"$installprefix"; then
7513 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
7515 installscript="$scriptdirexp"
7518 : determine where add-on public executables go
7520 '') dflt=$siteprefix/bin ;;
7524 rp='Pathname where the add-on public executables should be installed?'
7527 sitebinexp="$ansexp"
7528 : Change installation prefix, if necessary.
7529 if $test X"$prefix" != X"$installprefix"; then
7530 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
7532 installsitebin="$sitebinexp"
7535 case "$useperlio" in
7536 $define|true|[yY]*) dflt='y';;
7541 Previous version of $package used the standard IO mechanisms as
7542 defined in <stdio.h>. Versions 5.003_02 and later of perl allow
7543 alternate IO mechanisms via the PerlIO abstraction layer, but the
7544 stdio mechanism is still the default. This abstraction layer can
7545 use AT&T's sfio (if you already have sfio installed) or regular stdio.
7546 Using PerlIO with sfio may cause problems with some extension modules.
7548 If this doesn't make any sense to you, just accept the default '$dflt'.
7550 rp='Use the experimental PerlIO abstraction layer?'
7557 echo "Ok, doing things the stdio way."
7566 case "$useperlio" in
7567 $define|true|[yY]*) ;;
7570 You are using the SOCKS proxy protocol library which means that you
7571 should also use the PerlIO layer. You may be headed for trouble.
7580 case "$vendorprefix" in
7581 '') d_vendorbin="$undef"
7585 *) d_vendorbin="$define"
7586 : determine where vendor-supplied executables go.
7587 case "$vendorbin" in
7588 '') dflt=$vendorprefix/bin ;;
7589 *) dflt="$vendorbin" ;;
7592 rp='Pathname for the vendor-supplied executables directory?'
7595 vendorbinexp="$ansexp"
7598 : Change installation prefix, if necessary.
7599 if $test X"$prefix" != X"$installprefix"; then
7600 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
7602 installvendorbin="$vendorbinexp"
7605 : see if qgcvt exists
7611 if $test X"$d_longdbl" = X"$define"; then
7613 echo "Checking how to print long doubles..." >&4
7615 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
7616 $cat >try.c <<'EOCP'
7617 #include <sys/types.h>
7621 printf("%.3f\n", d);
7625 if eval $compile; then
7629 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
7630 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
7631 echo "We will use %f."
7637 if $test X"$sPRIfldbl" = X; then
7638 $cat >try.c <<'EOCP'
7639 #include <sys/types.h>
7642 long double d = 123.456;
7643 printf("%.3llf\n", d);
7647 if eval $compile; then
7651 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
7652 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
7653 echo "We will use %llf."
7659 if $test X"$sPRIfldbl" = X; then
7660 $cat >try.c <<'EOCP'
7661 #include <sys/types.h>
7664 long double d = 123.456;
7665 printf("%.3Lf\n", d);
7669 if eval $compile; then
7673 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
7674 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
7675 echo "We will use %Lf."
7681 if $test X"$sPRIfldbl" = X; then
7682 $cat >try.c <<'EOCP'
7683 #include <sys/types.h>
7686 long double d = 123.456;
7687 printf("%.3lf\n", d);
7691 if eval $compile; then
7695 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
7696 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
7697 echo "We will use %lf."
7703 if $test X"$sPRIfldbl" = X; then
7704 echo "Cannot figure out how to print long doubles." >&4
7706 sSCNfldbl=$sPRIfldbl # expect consistency
7713 case "$sPRIfldbl" in
7714 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
7715 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
7716 d_SCNfldbl="$undef";
7718 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
7719 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
7720 d_SCNfldbl="$define";
7724 : Check how to convert floats to strings.
7726 echo "Checking for an efficient way to convert floats to strings."
7728 case "$uselongdouble" in
7729 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
7731 case "$d_longdbl" in
7732 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
7734 case "$d_PRIgldbl" in
7735 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
7739 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
7740 char *myname = "gconvert";
7743 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
7744 char *myname = "gcvt";
7747 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
7748 char *myname = "qgcvt";
7749 #define DOUBLETYPE long double
7752 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE) && defined(HAS_PRIgldbl)
7753 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
7755 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
7757 char *myname = "sprintf";
7761 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
7762 #define DOUBLETYPE long double
7764 #define DOUBLETYPE double
7770 #define I_STDLIB $i_stdlib
7776 checkit(expect, got)
7780 if (strcmp(expect, got)) {
7781 printf("%s oddity: Expected %s, got %s\n",
7782 myname, expect, got);
7792 /* This must be 1st test on (which?) platform */
7793 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
7794 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
7795 checkit("0.1", buf);
7797 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
7800 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
7801 checkit("1.1", buf);
7803 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
7804 checkit("1.01", buf);
7806 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
7807 checkit("1.001", buf);
7809 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
7810 checkit("1.0001", buf);
7812 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
7813 checkit("1.00001", buf);
7815 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
7816 checkit("1.000001", buf);
7818 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
7821 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
7824 /* Some Linux gcvt's give 1.e+5 here. */
7825 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
7826 checkit("100000", buf);
7828 /* Some Linux gcvt's give -1.e+5 here. */
7829 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
7830 checkit("-100000", buf);
7832 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
7833 checkit("123.456", buf);
7838 case "$d_Gconvert" in
7839 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
7840 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
7841 sprintf*) xxx_list='sprintf gconvert gcvt' ;;
7842 *) xxx_list='gconvert gcvt sprintf' ;;
7845 case "$d_longdbl$uselongdouble$d_PRIgldbl" in
7846 "$define$define$define")
7847 # for long doubles prefer first qgcvt, then sprintf
7848 xxx_list="`echo $xxx_list|sed s/sprintf//`"
7849 xxx_list="sprintf $xxx_list"
7851 "$define") xxx_list="qgcvt $xxx_list" ;;
7856 for xxx_convert in $xxx_list; do
7857 echo "Trying $xxx_convert..."
7859 set try -DTRY_$xxx_convert
7860 if eval $compile; then
7861 echo "$xxx_convert() found." >&4
7863 echo "I'll use $xxx_convert to convert floats into a string." >&4
7866 echo "...But $xxx_convert didn't work as I expected."
7869 echo "$xxx_convert NOT found." >&4
7873 case "$xxx_convert" in
7874 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
7875 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
7876 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
7877 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
7878 "$define$define$define")
7879 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
7880 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
7885 : see if _fwalk exists
7889 : Initialize h_fcntl
7892 : Initialize h_sysfile
7895 : access call always available on UNIX
7899 : locate the flags for 'access()'
7903 $cat >access.c <<'EOCP'
7904 #include <sys/types.h>
7909 #include <sys/file.h>
7918 : check sys/file.h first, no particular reason here
7919 if $test `./findhdr sys/file.h` && \
7920 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
7922 echo "<sys/file.h> defines the *_OK access constants." >&4
7923 elif $test `./findhdr fcntl.h` && \
7924 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
7926 echo "<fcntl.h> defines the *_OK access constants." >&4
7927 elif $test `./findhdr unistd.h` && \
7928 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
7929 echo "<unistd.h> defines the *_OK access constants." >&4
7931 echo "I can't find the four *_OK access constants--I'll use mine." >&4
7937 : see if accessx exists
7938 set accessx d_accessx
7941 : see if alarm exists
7945 : see if atolf exists
7949 : see if atoll exists
7953 : Look for GNU-cc style attribute checking
7955 echo "Checking whether your compiler can handle __attribute__ ..." >&4
7956 $cat >attrib.c <<'EOCP'
7958 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
7960 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
7961 if $contains 'warning' attrib.out >/dev/null 2>&1; then
7962 echo "Your C compiler doesn't fully support __attribute__."
7965 echo "Your C compiler supports __attribute__."
7969 echo "Your C compiler doesn't seem to understand __attribute__ at all."
7976 : see if bcmp exists
7980 : see if bcopy exists
7984 : see if this is a unistd.h system
7985 set unistd.h i_unistd
7988 : see if getpgrp exists
7989 set getpgrp d_getpgrp
7992 case "$d_getpgrp" in
7995 echo "Checking to see which flavor of getpgrp is in use..."
7998 #include <sys/types.h>
8000 # include <unistd.h>
8004 if (getuid() == 0) {
8005 printf("(I see you are running Configure as super-user...)\n");
8009 if (getpgrp(1) == 0)
8018 if $cc -o set -DTRY_BSD_PGRP $ccflags $ldflags set.c $libs >/dev/null 2>&1 && ./set; then
8019 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
8021 elif $cc -o set $ccflags $ldflags set.c $libs >/dev/null 2>&1 && ./set; then
8022 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
8025 echo "I can't seem to compile and run the test program."
8027 xxx="a USG one, i.e. you use getpgrp()."
8029 # SVR4 systems can appear rather BSD-ish.
8032 xxx="a BSD one, i.e. you use getpgrp(pid)."
8036 xxx="probably a USG one, i.e. you use getpgrp()."
8041 echo "Assuming your getpgrp is $xxx" >&4
8050 : see if setpgrp exists
8051 set setpgrp d_setpgrp
8054 case "$d_setpgrp" in
8057 echo "Checking to see which flavor of setpgrp is in use..."
8060 #include <sys/types.h>
8062 # include <unistd.h>
8066 if (getuid() == 0) {
8067 printf("(I see you are running Configure as super-user...)\n");
8071 if (-1 == setpgrp(1, 1))
8074 if (setpgrp() != -1)
8080 if $cc -o set -DTRY_BSD_PGRP $ccflags $ldflags set.c $libs >/dev/null 2>&1 && ./set; then
8081 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
8083 elif $cc -o set $ccflags $ldflags set.c $libs >/dev/null 2>&1 && ./set; then
8084 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
8087 echo "(I can't seem to compile and run the test program.)"
8089 xxx="a USG one, i.e. you use setpgrp()."
8091 # SVR4 systems can appear rather BSD-ish.
8094 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
8098 xxx="probably a USG one, i.e. you use setpgrp()."
8103 echo "Assuming your setpgrp is $xxx" >&4
8111 : see if bzero exists
8115 : see if signal is declared as pointer to function returning int or void
8117 xxx=`./findhdr signal.h`
8118 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
8119 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
8120 echo "You have int (*signal())() instead of void." >&4
8122 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
8123 echo "You have void (*signal())()." >&4
8125 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
8126 echo "You have int (*signal())() instead of void." >&4
8128 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
8129 echo "You have void (*signal())()." >&4
8132 case "$d_voidsig" in
8134 echo "I can't determine whether signal handler returns void or int..." >&4
8136 rp="What type does your signal handler return?"
8143 echo "As you already told me, signal handler returns void." >&4
8146 *) echo "As you already told me, signal handler returns int." >&4
8153 case "$d_voidsig" in
8154 "$define") signal_t="void";;
8159 : check for ability to cast large floats to 32-bit ints.
8161 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
8162 if $test "$intsize" -ge 4; then
8169 #include <sys/types.h>
8171 $signal_t blech(s) int s; { exit(3); }
8178 signal(SIGFPE, blech);
8180 /* Don't let compiler optimize the test away. Store the number
8181 in a writable string for gcc to pass to sscanf under HP/UX.
8183 sprintf(str, "2147483647");
8184 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
8188 /* x86 processors will probably give 0x8000 0000, which is a
8189 sign change. We don't want that. We want to mimic SPARC
8190 behavior here, which is to preserve the sign and give
8193 if (i32 != ($xxx) f)
8199 if eval $compile_ok; then
8203 echo "(I can't seem to compile the test program--assuming it can't)"
8211 echo "Nope, it can't."
8218 : check for ability to cast negative floats to unsigned
8220 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
8223 #include <sys/types.h>
8225 $signal_t blech(s) int s; { exit(7); }
8226 $signal_t blech_in_list(s) int s; { exit(4); }
8227 unsigned long dummy_long(p) unsigned long p; { return p; }
8228 unsigned int dummy_int(p) unsigned int p; { return p; }
8229 unsigned short dummy_short(p) unsigned short p; { return p; }
8233 unsigned long along;
8235 unsigned short ashort;
8239 /* Frustrate gcc-2.7.2's optimizer which failed this test with
8240 a direct f = -123. assignment. gcc-2.8.0 reportedly
8241 optimized the whole file away
8243 /* Store the number in a writable string for gcc to pass to
8246 sprintf(str, "-123");
8247 sscanf(str, "%lf", &f); /* f = -123.; */
8249 signal(SIGFPE, blech);
8250 along = (unsigned long)f;
8251 aint = (unsigned int)f;
8252 ashort = (unsigned short)f;
8253 if (along != (unsigned long)-123)
8255 if (aint != (unsigned int)-123)
8257 if (ashort != (unsigned short)-123)
8259 sprintf(str, "1073741824.");
8260 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
8263 along = (unsigned long)f;
8264 if (along != 0x80000000)
8268 along = (unsigned long)f;
8269 if (along != 0x7fffffff)
8273 along = (unsigned long)f;
8274 if (along != 0x80000001)
8278 signal(SIGFPE, blech_in_list);
8279 sprintf(str, "123.");
8280 sscanf(str, "%lf", &f); /* f = 123.; */
8281 along = dummy_long((unsigned long)f);
8282 aint = dummy_int((unsigned int)f);
8283 ashort = dummy_short((unsigned short)f);
8284 if (along != (unsigned long)123)
8286 if (aint != (unsigned int)123)
8288 if (ashort != (unsigned short)123)
8295 if eval $compile_ok; then
8299 echo "(I can't seem to compile the test program--assuming it can't)"
8302 case "$castflags" in
8307 echo "Nope, it can't."
8314 : see if vprintf exists
8316 if set vprintf val -f d_vprintf; eval $csym; $val; then
8317 echo 'vprintf() found.' >&4
8319 $cat >vprintf.c <<'EOF'
8320 #include <varargs.h>
8322 int main() { xxx("foo"); }
8331 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
8335 if eval $compile && ./vprintf; then
8336 echo "Your vsprintf() returns (int)." >&4
8339 echo "Your vsprintf() returns (char*)." >&4
8343 echo 'vprintf() NOT found.' >&4
8353 : see if chown exists
8357 : see if chroot exists
8361 : see if chsize exists
8365 : check for const keyword
8367 echo 'Checking to see if your C compiler knows about "const"...' >&4
8368 $cat >const.c <<'EOCP'
8369 typedef struct spug { int drokk; } spug;
8376 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
8378 echo "Yup, it does."
8381 echo "Nope, it doesn't."
8386 : see if crypt exists
8388 if set crypt val -f d_crypt; eval $csym; $val; then
8389 echo 'crypt() found.' >&4
8393 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
8394 if $test -z "$cryptlib"; then
8395 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
8399 if $test -z "$cryptlib"; then
8400 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
8404 if $test -z "$cryptlib"; then
8405 cryptlib=`./loc libcrypt$_a "" $libpth`
8409 if $test -z "$cryptlib"; then
8410 echo 'crypt() NOT found.' >&4
8419 : get csh whereabouts
8421 'csh') val="$undef" ;;
8426 : Respect a hint or command line value for full_csh.
8428 '') full_csh=$csh ;;
8431 : see if cuserid exists
8432 set cuserid d_cuserid
8435 : see if this is a limits.h system
8436 set limits.h i_limits
8439 : see if this is a float.h system
8443 : See if number of significant digits in a double precision number is known
8445 $cat >dbl_dig.c <<EOM
8455 printf("Contains DBL_DIG");
8458 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
8459 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
8460 echo "DBL_DIG found." >&4
8463 echo "DBL_DIG NOT found." >&4
8470 : see if difftime exists
8471 set difftime d_difftime
8474 : see if this is a dirent system
8476 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
8478 echo "<dirent.h> found." >&4
8481 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
8482 echo "<sys/dir.h> found." >&4
8485 xinc=`./findhdr sys/ndir.h`
8487 echo "<dirent.h> NOT found." >&4
8492 : Look for type of directory structure.
8494 $cppstdin $cppflags $cppminus < "$xinc" > try.c
8496 case "$direntrytype" in
8499 $define) guess1='struct dirent' ;;
8500 *) guess1='struct direct' ;;
8503 *) guess1="$direntrytype"
8508 'struct dirent') guess2='struct direct' ;;
8509 *) guess2='struct dirent' ;;
8512 if $contains "$guess1" try.c >/dev/null 2>&1; then
8513 direntrytype="$guess1"
8514 echo "Your directory entries are $direntrytype." >&4
8515 elif $contains "$guess2" try.c >/dev/null 2>&1; then
8516 direntrytype="$guess2"
8517 echo "Your directory entries seem to be $direntrytype." >&4
8519 echo "I don't recognize your system's directory entries." >&4
8520 rp="What type is used for directory entries on this system?"
8528 : see if the directory entry stores field length
8530 $cppstdin $cppflags $cppminus < "$xinc" > try.c
8531 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
8532 echo "Good, your directory entry keeps length information in d_namlen." >&4
8535 echo "Your directory entry does not know about the d_namlen field." >&4
8542 : see if dlerror exists
8545 set dlerror d_dlerror
8549 : see if dlfcn is available
8557 On a few systems, the dynamically loaded modules that perl generates and uses
8558 will need a different extension than shared libs. The default will probably
8566 rp='What is the extension of dynamically loaded modules'
8575 : Check if dlsym need a leading underscore
8581 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
8582 $cat >dyna.c <<'EOM'
8591 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
8593 #include <sys/types.h>
8607 int mode = RTLD_LAZY ;
8609 handle = dlopen("./dyna.$dlext", mode) ;
8610 if (handle == NULL) {
8615 symbol = dlsym(handle, "fred") ;
8616 if (symbol == NULL) {
8617 /* try putting a leading underscore */
8618 symbol = dlsym(handle, "_fred") ;
8619 if (symbol == NULL) {
8632 : Call the object file tmp-dyna.o in case dlext=o.
8633 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
8634 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
8635 $ld -o dyna.$dlext $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
8636 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then
8639 1) echo "Test program failed using dlopen." >&4
8640 echo "Perhaps you should not use dynamic loading." >&4;;
8641 2) echo "Test program failed using dlsym." >&4
8642 echo "Perhaps you should not use dynamic loading." >&4;;
8643 3) echo "dlsym needs a leading underscore" >&4
8645 4) echo "dlsym doesn't need a leading underscore." >&4;;
8648 echo "I can't compile and run the test program." >&4
8649 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
8654 $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
8659 hasproto='varname=$1; func=$2; shift; shift;
8660 while $test $# -ge 2; do
8662 $define) echo "#include <$2>";;
8666 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
8667 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
8668 echo "$func() prototype found.";
8671 echo "$func() prototype NOT found.";
8676 $rm -f try.c tryout.c'
8678 : see if prototype for drand48 is available
8680 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
8683 : see if dup2 exists
8687 : see if eaccess exists
8688 set eaccess d_eaccess
8691 : see if endgrent exists
8692 set endgrent d_endgrent
8695 : see if endhostent exists
8696 set endhostent d_endhent
8699 : see if endnetent exists
8700 set endnetent d_endnent
8703 : see if endprotoent exists
8704 set endprotoent d_endpent
8707 : see if endpwent exists
8708 set endpwent d_endpwent
8711 : see if endservent exists
8712 set endservent d_endsent
8715 : Locate the flags for 'open()'
8717 $cat >open3.c <<'EOCP'
8718 #include <sys/types.h>
8723 #include <sys/file.h>
8734 : check sys/file.h first to get FREAD on Sun
8735 if $test `./findhdr sys/file.h` && \
8736 set open3 -DI_SYS_FILE && eval $compile; then
8738 echo "<sys/file.h> defines the O_* constants..." >&4
8740 echo "and you have the 3 argument form of open()." >&4
8743 echo "but not the 3 argument form of open(). Oh, well." >&4
8746 elif $test `./findhdr fcntl.h` && \
8747 set open3 -DI_FCNTL && eval $compile; then
8749 echo "<fcntl.h> defines the O_* constants..." >&4
8751 echo "and you have the 3 argument form of open()." >&4
8754 echo "but not the 3 argument form of open(). Oh, well." >&4
8759 echo "I can't find the O_* constant definitions! You got problems." >&4
8765 : see which of string.h or strings.h is needed
8767 strings=`./findhdr string.h`
8768 if $test "$strings" && $test -r "$strings"; then
8769 echo "Using <string.h> instead of <strings.h>." >&4
8773 strings=`./findhdr strings.h`
8774 if $test "$strings" && $test -r "$strings"; then
8775 echo "Using <strings.h> instead of <string.h>." >&4
8777 echo "No string header found -- You'll surely have problems." >&4
8783 "$undef") strings=`./findhdr strings.h`;;
8784 *) strings=`./findhdr string.h`;;
8787 : check for non-blocking I/O stuff
8788 case "$h_sysfile" in
8789 true) echo "#include <sys/file.h>" > head.c;;
8792 true) echo "#include <fcntl.h>" > head.c;;
8793 *) echo "#include <sys/fcntl.h>" > head.c;;
8798 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
8799 case "$o_nonblock" in
8802 $cat >>try.c <<'EOCP'
8806 printf("O_NONBLOCK\n");
8810 printf("O_NDELAY\n");
8814 printf("FNDELAY\n");
8821 if eval $compile_ok; then
8823 case "$o_nonblock" in
8824 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
8825 *) echo "Seems like we can use $o_nonblock.";;
8828 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
8831 *) echo "Using $hint value $o_nonblock.";;
8833 $rm -f try try.* .out core
8836 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
8842 #include <sys/types.h>
8845 #define MY_O_NONBLOCK $o_nonblock
8846 #ifndef errno /* XXX need better Configure test */
8857 #include <strings.h>
8859 $signal_t blech(x) int x; { exit(3); }
8861 $cat >> try.c <<'EOCP'
8869 pipe(pd); /* Down: child -> parent */
8870 pipe(pu); /* Up: parent -> child */
8873 close(pd[1]); /* Parent reads from pd[0] */
8874 close(pu[0]); /* Parent writes (blocking) to pu[1] */
8875 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
8877 signal(SIGALRM, blech);
8879 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
8881 sprintf(string, "%d\n", ret);
8882 write(2, string, strlen(string));
8885 if (errno == EAGAIN) {
8891 if (errno == EWOULDBLOCK)
8892 printf("EWOULDBLOCK\n");
8895 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
8896 sleep(2); /* Give it time to close our pipe */
8898 ret = read(pd[0], buf, 1); /* Should read EOF */
8900 sprintf(string, "%d\n", ret);
8901 write(3, string, strlen(string));
8905 close(pd[0]); /* We write to pd[1] */
8906 close(pu[1]); /* We read from pu[0] */
8907 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
8908 close(pd[1]); /* Pipe pd is now fully closed! */
8909 exit(0); /* Bye bye, thank you for playing! */
8913 if eval $compile_ok; then
8914 echo "$startsh" >mtry
8915 echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
8917 ./mtry >/dev/null 2>&1
8919 0) eagain=`$cat try.out`;;
8920 1) echo "Could not perform non-blocking setting!";;
8921 2) echo "I did a successful read() for something that was not there!";;
8922 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
8923 *) echo "Something terribly wrong happened during testing.";;
8925 rd_nodata=`$cat try.ret`
8926 echo "A read() system call with no data present returns $rd_nodata."
8927 case "$rd_nodata" in
8930 echo "(That's peculiar, fixing that to be -1.)"
8936 echo "Forcing errno EAGAIN on read() with no data available."
8940 echo "Your read() sets errno to $eagain when no data is available."
8943 status=`$cat try.err`
8945 0) echo "And it correctly returns 0 to signal EOF.";;
8946 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
8947 *) echo "However, your read() returns '$status' on EOF??";;
8950 if test "$status" = "$rd_nodata"; then
8951 echo "WARNING: you can't distinguish between EOF and no data!"
8955 echo "I can't compile the test program--assuming errno EAGAIN will do."
8962 echo "Using $hint value $eagain."
8963 echo "Your read() returns $rd_nodata when no data is present."
8964 case "$d_eofnblk" in
8965 "$define") echo "And you can see EOF because read() returns 0.";;
8966 "$undef") echo "But you can't see EOF status from read() returned value.";;
8968 echo "(Assuming you can't see EOF status from read anyway.)"
8974 $rm -f try try.* .out core head.c mtry
8976 : see if fchmod exists
8980 : see if fchown exists
8984 : see if this is an fcntl system
8989 : See if fcntl-based locking works.
8990 $cat >try.c <<'EOCP'
8995 #if defined(F_SETLK) && defined(F_SETLKW)
8998 fd = open("try.c", O_RDONLY);
8999 flock.l_type = F_RDLCK;
9000 flock.l_whence = SEEK_SET;
9001 flock.l_start = flock.l_len = 0;
9002 retval = fcntl(fd, F_SETLK, &flock);
9004 (retval < 0 ? exit(2) : exit(0));
9010 echo "Checking if fcntl-based file locking works... "
9014 if eval $compile_ok; then
9016 echo "Yes, it seems to work."
9019 echo "Nope, it didn't work."
9023 echo "I'm unable to compile the test program, so I'll assume not."
9028 echo "Nope, since you don't even have fcntl()."
9031 set d_fcntl_can_lock
9036 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
9037 while $test $# -ge 2; do
9039 $define) echo "#include <$2>";;
9043 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
9045 if eval $compile; then
9056 : see whether socket exists
9058 $echo $n "Hmm... $c" >&4
9059 if set socket val -f d_socket; eval $csym; $val; then
9060 echo "Looks like you have Berkeley networking support." >&4
9062 if set setsockopt val -f; eval $csym; $val; then
9065 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
9069 if $contains socklib libc.list >/dev/null 2>&1; then
9070 echo "Looks like you have Berkeley networking support." >&4
9072 : we will have to assume that it supports the 4.2 BSD interface
9075 echo "You don't have Berkeley networking in libc$_a..." >&4
9076 if test "X$d_socket" = "X$define"; then
9077 echo "...but you seem to believe that you have sockets." >&4
9079 for net in net socket
9081 if test -f /usr/lib/lib$net$_a; then
9082 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
9083 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
9084 if $contains socket libc.list >/dev/null 2>&1; then
9089 echo "...but the Wollongong group seems to have hacked it in." >&4
9090 sockethdr="-I/usr/netinclude"
9093 echo "Found Berkeley sockets interface in lib$net." >& 4
9094 if $contains setsockopt libc.list >/dev/null 2>&1; then
9097 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
9104 if test "X$d_socket" != "X$define"; then
9105 echo "or anywhere else I see." >&4
9113 : see if socketpair exists
9114 set socketpair d_sockpair
9119 echo "Checking the availability of certain socket constants..." >& 4
9120 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
9121 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
9123 #include <sys/types.h>
9124 #include <sys/socket.h>
9130 set try; if eval $compile; then
9133 set d_${enum}; eval $setvar
9137 : see if sys/select.h has to be included
9138 set sys/select.h i_sysselct
9141 : see if we should include time.h, sys/time.h, or both
9143 if test "X$timeincl" = X; then
9144 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9145 $echo $n "I'm now running the test program...$c"
9146 $cat >try.c <<'EOCP'
9147 #include <sys/types.h>
9152 #ifdef SYSTIMEKERNEL
9155 #include <sys/time.h>
9158 #include <sys/select.h>
9167 struct timezone tzp;
9169 if (foo.tm_sec == foo.tm_sec)
9172 if (bar.tv_sec == bar.tv_sec)
9179 for s_timezone in '-DS_TIMEZONE' ''; do
9181 for s_timeval in '-DS_TIMEVAL' ''; do
9182 for i_systimek in '' '-DSYSTIMEKERNEL'; do
9183 for i_time in '' '-DI_TIME'; do
9184 for i_systime in '-DI_SYSTIME' ''; do
9187 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
9188 if eval $compile; then
9189 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
9193 $echo $n "Succeeded with $flags$c"
9205 *SYSTIMEKERNEL*) i_systimek="$define"
9206 timeincl=`./findhdr sys/time.h`
9207 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
9208 *) i_systimek="$undef";;
9211 *I_TIME*) i_time="$define"
9212 timeincl=`./findhdr time.h`" $timeincl"
9213 echo "We'll include <time.h>." >&4;;
9214 *) i_time="$undef";;
9217 *I_SYSTIME*) i_systime="$define"
9218 timeincl=`./findhdr sys/time.h`" $timeincl"
9219 echo "We'll include <sys/time.h>." >&4;;
9220 *) i_systime="$undef";;
9225 : check for fd_set items
9228 Checking to see how well your C compiler handles fd_set and friends ...
9230 $cat >fd_set.c <<EOCP
9231 #$i_systime I_SYS_TIME
9232 #$i_sysselct I_SYS_SELECT
9233 #$d_socket HAS_SOCKET
9234 #include <sys/types.h>
9236 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
9239 #include <sys/time.h>
9242 #include <sys/select.h>
9251 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
9258 set fd_set -DTRYBITS
9259 if eval $compile; then
9260 d_fds_bits="$define"
9262 echo "Well, your system knows about the normal fd_set typedef..." >&4
9264 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
9265 d_fd_macros="$define"
9268 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
9270 d_fd_macros="$undef"
9274 Hmm, your compiler has some difficulty with fd_set. Checking further...
9277 if eval $compile; then
9280 echo "Well, your system has some sort of fd_set available..." >&4
9282 echo "and you have the normal fd_set macros." >&4
9283 d_fd_macros="$define"
9286 but not the normal fd_set macros! Gross! More work for me...
9288 d_fd_macros="$undef"
9291 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
9294 d_fd_macros="$undef"
9299 : see if fgetpos exists
9300 set fgetpos d_fgetpos
9303 : see if flock exists
9307 : see if fork exists
9311 : see if pathconf exists
9312 set pathconf d_pathconf
9315 : see if fpathconf exists
9316 set fpathconf d_fpathconf
9320 : check for fpos64_t
9322 echo "Checking to see if you have fpos64_t..." >&4
9325 int main() { fpos64_t x = 7; }
9328 if eval $compile; then
9330 echo "You have fpos64_t."
9333 echo "You do not have fpos64_t."
9335 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
9342 : see if frexpl exists
9346 hasstruct='varname=$1; struct=$2; shift; shift;
9347 while $test $# -ge 2; do
9349 $define) echo "#include <$2>";;
9353 echo "int main () { struct $struct foo; }" >> try.c;
9355 if eval $compile; then
9364 : see if this is a sys/param system
9365 set sys/param.h i_sysparam
9368 : see if this is a sys/mount.h system
9369 set sys/mount.h i_sysmount
9372 : see if sys/types.h has to be included
9373 set sys/types.h i_systypes
9378 echo "Checking to see if your system supports struct fs_data..." >&4
9379 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
9381 case "$d_fs_data_s" in
9382 "$define") echo "Yes, it does." ;;
9383 *) echo "No, it doesn't." ;;
9386 : see if fseeko exists
9390 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
9393 : see if fsetpos exists
9394 set fsetpos d_fsetpos
9398 : see if fstatfs exists
9399 set fstatfs d_fstatfs
9403 : see if statvfs exists
9404 set statvfs d_statvfs
9407 : see if fstatvfs exists
9408 set fstatvfs d_fstatvfs
9412 : see if fsync exists
9416 : see if ftello exists
9420 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
9423 : see if getcwd exists
9427 : see if getespwnam exists
9428 set getespwnam d_getespwnam
9432 : see if getfsstat exists
9433 set getfsstat d_getfsstat
9436 : see if getgrent exists
9437 set getgrent d_getgrent
9440 : see if gethostbyaddr exists
9441 set gethostbyaddr d_gethbyaddr
9444 : see if gethostbyname exists
9445 set gethostbyname d_gethbyname
9448 : see if gethostent exists
9449 set gethostent d_gethent
9452 : see how we will look up host name
9455 if set gethostname val -f d_gethname; eval $csym; $val; then
9456 echo 'gethostname() found.' >&4
9457 d_gethname="$define"
9460 if set uname val -f d_uname; eval $csym; $val; then
9463 uname() was found, but you're running xenix, and older versions of xenix
9464 have a broken uname(). If you don't really know whether your xenix is old
9465 enough to have a broken system call, use the default answer.
9472 rp='Is your uname() broken?'
9475 n*) d_uname="$define"; call=uname;;
9478 echo 'uname() found.' >&4
9485 case "$d_gethname" in
9486 '') d_gethname="$undef";;
9489 '') d_uname="$undef";;
9491 case "$d_uname$d_gethname" in
9496 Every now and then someone has a $call() that lies about the hostname
9497 but can't be fixed for political or economic reasons. If you wish, I can
9498 pretend $call() isn't there and maybe compute hostname at run-time
9499 thanks to the '$phostname' command.
9502 rp="Shall I ignore $call() from now on?"
9505 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
9508 case "$phostname" in
9510 *) case "$aphostname" in
9516 file=`./loc $file $file $pth`
9517 aphostname=`echo $file $*`
9522 case "$d_uname$d_gethname" in
9525 case "$phostname" in
9527 echo "There will be no way for $package to get your hostname." >&4;;
9529 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
9533 case "$d_phostname" in
9534 '') d_phostname="$undef";;
9537 : see if this is a netdb.h system
9541 : see if prototypes for various gethostxxx netdb.h functions are available
9543 set d_gethostprotos gethostent $i_netdb netdb.h
9546 : see if getlogin exists
9547 set getlogin d_getlogin
9550 : see if getmnt exists
9554 : see if getmntent exists
9555 set getmntent d_getmntent
9558 : see if getnetbyaddr exists
9559 set getnetbyaddr d_getnbyaddr
9562 : see if getnetbyname exists
9563 set getnetbyname d_getnbyname
9566 : see if getnetent exists
9567 set getnetent d_getnent
9570 : see if prototypes for various getnetxxx netdb.h functions are available
9572 set d_getnetprotos getnetent $i_netdb netdb.h
9575 : see if getpagesize exists
9576 set getpagesize d_getpagsz
9580 : see if getprotobyname exists
9581 set getprotobyname d_getpbyname
9584 : see if getprotobynumber exists
9585 set getprotobynumber d_getpbynumber
9588 : see if getprotoent exists
9589 set getprotoent d_getpent
9592 : see if getpgid exists
9593 set getpgid d_getpgid
9596 : see if getpgrp2 exists
9597 set getpgrp2 d_getpgrp2
9600 : see if getppid exists
9601 set getppid d_getppid
9604 : see if getpriority exists
9605 set getpriority d_getprior
9608 : see if prototypes for various getprotoxxx netdb.h functions are available
9610 set d_getprotoprotos getprotoent $i_netdb netdb.h
9613 : see if getprpwnam exists
9614 set getprpwnam d_getprpwnam
9617 : see if getpwent exists
9618 set getpwent d_getpwent
9622 : see if getservbyname exists
9623 set getservbyname d_getsbyname
9626 : see if getservbyport exists
9627 set getservbyport d_getsbyport
9630 : see if getservent exists
9631 set getservent d_getsent
9634 : see if prototypes for various getservxxx netdb.h functions are available
9636 set d_getservprotos getservent $i_netdb netdb.h
9639 : see if getspnam exists
9640 set getspnam d_getspnam
9643 : see if gettimeofday or ftime exists
9644 set gettimeofday d_gettimeod
9646 case "$d_gettimeod" in
9652 val="$undef"; set d_ftime; eval $setvar
9655 case "$d_gettimeod$d_ftime" in
9658 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
9662 : see if this is an grp system
9668 xxx=`./findhdr grp.h`
9669 $cppstdin $cppflags $cppminus < $xxx >$$.h
9671 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
9683 set d_grpasswd; eval $setvar
9687 : see if hasmntopt exists
9688 set hasmntopt d_hasmntopt
9691 : see if this is a netinet/in.h or sys/in.h system
9692 set netinet/in.h i_niin sys/in.h i_sysin
9695 : see if arpa/inet.h has to be included
9696 set arpa/inet.h i_arpainet
9699 : see if htonl --and friends-- exists
9704 : Maybe they are macros.
9709 #include <sys/types.h>
9710 #$i_niin I_NETINET_IN
9712 #$i_arpainet I_ARPA_INET
9714 #include <netinet/in.h>
9720 #include <arpa/inet.h>
9723 printf("Defined as a macro.");
9726 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
9727 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
9729 echo "But it seems to be defined as a macro." >&4
9737 : see if iconv exists
9743 if set index val -f; eval $csym; $val; then
9744 if set strchr val -f d_strchr; eval $csym; $val; then
9745 if $contains strchr "$strings" >/dev/null 2>&1 ; then
9748 echo "strchr() found." >&4
9752 echo "index() found." >&4
9757 echo "index() found." >&4
9760 if set strchr val -f d_strchr; eval $csym; $val; then
9763 echo "strchr() found." >&4
9765 echo "No index() or strchr() found!" >&4
9770 set d_strchr; eval $setvar
9772 set d_index; eval $setvar
9774 : check whether inet_aton exists
9775 set inet_aton d_inetaton
9778 : see if inttypes.h is available
9779 : we want a real compile instead of Inhdr because some systems
9780 : have an inttypes.h which includes non-existent headers
9783 #include <inttypes.h>
9785 static int32_t foo32 = 0x12345678;
9789 if eval $compile; then
9790 echo "<inttypes.h> found." >&4
9793 echo "<inttypes.h> NOT found." >&4
9802 echo "Checking to see if you have int64_t..." >&4
9804 #include <sys/types.h>
9805 #$i_inttypes I_INTTYPES
9807 #include <inttypes.h>
9809 int main() { int64_t x = 7; }
9812 if eval $compile; then
9814 echo "You have int64_t."
9817 echo "You do not have int64_t."
9825 $cat >isascii.c <<'EOCP'
9837 if eval $compile; then
9838 echo "isascii() found." >&4
9841 echo "isascii() NOT found." >&4
9848 : see if isnan exists
9852 : see if isnanl exists
9856 : see if killpg exists
9860 : see if lchown exists
9862 $cat > try.c <<'EOCP'
9863 /* System header to define __stub macros and hopefully few prototypes,
9864 which can conflict with char lchown(); below. */
9866 /* Override any gcc2 internal prototype to avoid an error. */
9867 /* We use char because int might match the return type of a gcc2
9868 builtin and then its argument prototype would still apply. */
9871 /* The GNU C library defines this for functions which it implements
9872 to always fail with ENOSYS. Some functions are actually named
9873 something starting with __ and the normal name is an alias. */
9874 #if defined (__stub_lchown) || defined (__stub___lchown)
9882 if eval $compile; then
9883 $echo "lchown() found." >&4
9886 $echo "lchown() NOT found." >&4
9892 : See if number of significant digits in a double precision number is known
9894 $cat >ldbl_dig.c <<EOM
9904 printf("Contains LDBL_DIG");
9907 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
9908 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
9909 echo "LDBL_DIG found." >&4
9912 echo "LDBL_DIG NOT found." >&4
9919 : see if link exists
9923 : see if localeconv exists
9924 set localeconv d_locconv
9927 : see if lockf exists
9931 : check for long long
9933 echo "Checking to see if you have long long..." >&4
9934 echo 'int main() { long long x = 7; return 0; }' > try.c
9936 if eval $compile; then
9938 echo "You have long long."
9941 echo "You do not have long long."
9947 : check for length of long long
9948 case "${d_longlong}${longlongsize}" in
9951 echo "Checking to see how big your long longs are..." >&4
9952 $cat >try.c <<'EOCP'
9956 printf("%d\n", (int)sizeof(long long));
9961 if eval $compile_ok; then
9962 longlongsize=`./try$exe_ext`
9963 echo "Your long longs are $longlongsize bytes long."
9967 echo "(I can't seem to compile the test program. Guessing...)"
9968 rp="What is the size of a long long (in bytes)?"
9972 if $test "X$longsize" = "X$longlongsize"; then
9973 echo "(That isn't any different from an ordinary long.)"
9979 : see if prototype for lseek is available
9981 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
9984 : see if lstat exists
9988 : see if madvise exists
9989 set madvise d_madvise
9992 : see if mblen exists
9996 : see if mbstowcs exists
9997 set mbstowcs d_mbstowcs
10000 : see if mbtowc exists
10001 set mbtowc d_mbtowc
10004 : see if memchr exists
10005 set memchr d_memchr
10008 : see if memcmp exists
10009 set memcmp d_memcmp
10012 : see if memcpy exists
10013 set memcpy d_memcpy
10016 : see if memmove exists
10017 set memmove d_memmove
10020 : see if memset exists
10021 set memset d_memset
10024 : see if mkdir exists
10028 : see if mkdtemp exists
10029 set mkdtemp d_mkdtemp
10032 : see if mkfifo exists
10033 set mkfifo d_mkfifo
10036 : see if mkstemp exists
10037 set mkstemp d_mkstemp
10040 : see if mkstemps exists
10041 set mkstemps d_mkstemps
10044 : see if mktime exists
10045 set mktime d_mktime
10048 : see if this is a sys/mman.h system
10049 set sys/mman.h i_sysmman
10052 : see if mmap exists
10055 : see what shmat returns
10056 : default to something harmless
10058 case "$i_sysmman$d_mmap" in
10060 $cat >mmap.c <<'END'
10061 #include <sys/mman.h>
10064 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
10069 echo "and it returns ($mmaptype)." >&4
10075 : see if modfl exists
10079 : see if mprotect exists
10080 set mprotect d_mprotect
10083 : see if msgctl exists
10084 set msgctl d_msgctl
10087 : see if msgget exists
10088 set msgget d_msgget
10091 : see if msgsnd exists
10092 set msgsnd d_msgsnd
10095 : see if msgrcv exists
10096 set msgrcv d_msgrcv
10099 : see how much of the 'msg*(2)' library is present.
10102 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
10103 *"$undef"*) h_msg=false;;
10107 case "`ipcs 2>&1`" in
10108 "SVID messages"*"not configured"*)
10109 echo "Your $osname does not have the msg*(2) configured." >&4
10112 set msgctl d_msgctl
10114 set msgget d_msgget
10116 set msgsnd d_msgsnd
10118 set msgrcv d_msgrcv
10124 : we could also check for sys/ipc.h ...
10125 if $h_msg && $test `./findhdr sys/msg.h`; then
10126 echo "You have the full msg*(2) library." >&4
10129 echo "You don't have the full msg*(2) library." >&4
10135 : see if msync exists
10139 : see if munmap exists
10140 set munmap d_munmap
10143 : see if nice exists
10149 echo "Checking which 64-bit integer type we could use..." >&4
10155 val='"unsigned int"'
10160 *) case "$longsize" in
10164 val='"unsigned long"'
10169 *) case "$d_longlong:$longlongsize" in
10174 val='"unsigned long long"'
10179 *) case "$d_int64_t" in
10197 case "$quadtype" in
10198 '') echo "Alas, no 64-bit integer types in sight." >&4
10201 *) if test X"$use64bitint" = Xdefine -o X"$longsize" = X8; then
10206 echo "We $verb use '$quadtype' for 64-bit integers." >&4
10211 : check for length of character
10213 case "$charsize" in
10215 echo "Checking to see how big your characters are (hey, you never know)..." >&4
10216 $cat >try.c <<'EOCP'
10220 printf("%d\n", (int)sizeof(char));
10225 if eval $compile_ok; then
10229 echo "(I can't seem to compile the test program. Guessing...)"
10236 rp="What is the size of a character (in bytes)?"
10241 : check for volatile keyword
10243 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
10244 $cat >try.c <<'EOCP'
10247 typedef struct _goo_struct goo_struct;
10248 goo_struct * volatile goo = ((goo_struct *)0);
10249 struct _goo_struct {
10254 typedef unsigned short foo_t;
10255 char *volatile foo;
10257 volatile foo_t blech;
10261 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
10263 echo "Yup, it does."
10266 echo "Nope, it doesn't."
10274 $echo "Choosing the C types to be used for Perl's internal types..." >&4
10276 case "$use64bitint:$d_quad:$quadtype" in
10279 uvtype="$uquadtype"
10284 uvtype="unsigned long"
10290 case "$uselongdouble:$d_longdbl" in
10292 nvtype="long double"
10293 nvsize=$longdblsize
10300 $echo "(IV will be "$ivtype", $ivsize bytes)"
10301 $echo "(UV will be "$uvtype", $uvsize bytes)"
10302 $echo "(NV will be "$nvtype", $nvsize bytes)"
10305 #$i_inttypes I_INTTYPES
10307 #include <inttypes.h>
10312 int8_t i = INT8_MAX;
10313 uint8_t u = UINT8_MAX;
10314 printf("int8_t\n");
10317 int16_t i = INT16_MAX;
10318 uint16_t i = UINT16_MAX;
10319 printf("int16_t\n");
10322 int32_t i = INT32_MAX;
10323 uint32_t u = UINT32_MAX;
10324 printf("int32_t\n");
10330 '') case "$charsize" in
10332 u8type="unsigned char"
10341 if eval $compile; then
10342 case "`./try$exe_ext`" in
10343 int8_t) i8type=int8_t
10353 '') if $test $charsize -ge 1; then
10355 u8type="unsigned char"
10363 '') case "$shortsize" in
10365 u16type="unsigned short"
10373 '') set try -DINT16
10374 if eval $compile; then
10375 case "`./try$exe_ext`" in
10387 '') if $test $shortsize -ge 2; then
10389 u16type="unsigned short"
10397 '') case "$longsize" in
10399 u32type="unsigned long"
10403 *) case "$intsize" in
10405 u32type="unsigned int"
10415 '') set try -DINT32
10416 if eval $compile; then
10417 case "`./try$exe_ext`" in
10429 '') if $test $intsize -ge 4; then
10431 u32type="unsigned int"
10439 '') case "$d_quad:$quadtype" in
10441 i64type="$quadtype"
10442 u64type="$uquadtype"
10450 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
10451 : volatile so that the compiler has to store it out to memory.
10452 if test X"$d_volatile" = X"$define"; then
10457 #include <sys/types.h>
10458 #include <signal.h>
10460 $volatile int bletched = 0;
10461 $signal_t blech(s) int s; { bletched = 1; }
10466 int n = 8 * $uvsize;
10469 signal(SIGFPE, blech);
10472 for (i = 0; i < n; i++) {
10473 u = u << 1 | ($uvtype)1;
10475 if (($uvtype)d != u)
10479 d = ($nvtype)(u - 1);
10480 if (($uvtype)d != (u - 1))
10488 printf("%d\n", ((i == n) ? -n : i));
10494 d_nv_preserves_uv="$undef"
10495 if eval $compile; then
10496 d_nv_preserves_uv_bits="`./try$exe_ext`"
10498 case "$d_nv_preserves_uv_bits" in
10500 d_nv_preserves_uv_bits=`expr 0 - $d_nv_preserves_uv_bits`
10501 $echo "Your NVs can preserve all $d_nv_preserves_uv_bits bits of your UVs." 2>&1
10502 d_nv_preserves_uv="$define"
10504 [1-9]*) $echo "Your NVs can preserve only $d_nv_preserves_uv_bits bits of your UVs." 2>&1
10505 d_nv_preserves_uv="$undef" ;;
10506 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
10507 d_nv_preserves_uv_bits="$undef" ;;
10513 : check for off64_t
10515 echo "Checking to see if you have off64_t..." >&4
10517 #include <sys/types.h>
10518 #include <unistd.h>
10519 int main() { off64_t x = 7; }
10522 if eval $compile; then
10524 echo "You have off64_t."
10527 echo "You do not have off64_t."
10528 case "$lseeksize" in
10529 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
10536 : see if POSIX threads are available
10537 set pthread.h i_pthread
10543 : how to create joinable pthreads
10544 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
10546 echo "Checking what constant to use for creating joinable pthreads..." >&4
10547 $cat >try.c <<'EOCP'
10548 #include <pthread.h>
10550 int detachstate = JOINABLE;
10553 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
10554 if eval $compile; then
10555 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
10556 val="$undef" # Yes, undef.
10557 set d_old_pthread_create_joinable
10560 set old_pthread_create_joinable
10563 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
10564 if eval $compile; then
10565 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
10567 set d_old_pthread_create_joinable
10569 val=PTHREAD_CREATE_UNDETACHED
10570 set old_pthread_create_joinable
10573 set try -DJOINABLE=__UNDETACHED
10574 if eval $compile; then
10575 echo "You seem to use __UNDETACHED." >&4
10577 set d_old_pthread_create_joinable
10580 set old_pthread_create_joinable
10583 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
10585 set d_old_pthread_create_joinable
10588 set old_pthread_create_joinable
10595 d_old_pthread_create_joinable="$undef"
10596 old_pthread_create_joinable=""
10599 : see if pause exists
10603 : see if pipe exists
10607 : see if poll exists
10612 : see whether the various POSIXish _yields exist
10614 #include <pthread.h>
10620 #ifdef PTHREAD_YIELD
10623 #ifdef PTHREAD_YIELD_NULL
10624 pthread_yield(NULL);
10630 : see if sched_yield exists
10631 set try -DSCHED_YIELD
10632 if eval $compile; then
10634 sched_yield='sched_yield()'
10638 case "$usethreads" in
10641 $define) echo 'sched_yield() found.' >&4 ;;
10642 *) echo 'sched_yield() NOT found.' >&4 ;;
10648 : see if pthread_yield exists
10649 set try -DPTHREAD_YIELD
10650 if eval $compile; then
10652 case "$sched_yield" in
10653 '') sched_yield='pthread_yield()' ;;
10656 set try -DPTHREAD_YIELD_NULL
10657 if eval $compile; then
10659 case "$sched_yield" in
10660 '') sched_yield='pthread_yield(NULL)' ;;
10666 case "$usethreads" in
10669 $define) echo 'pthread_yield() found.' >&4 ;;
10670 *) echo 'pthread_yield() NOT found.' >&4 ;;
10674 set d_pthread_yield
10677 case "$sched_yield" in
10678 '') sched_yield=undef ;;
10683 : see if this is a pwd.h system
10689 xxx=`./findhdr pwd.h`
10690 $cppstdin $cppflags $cppminus < $xxx >$$.h
10692 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
10700 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
10708 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
10716 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
10724 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
10732 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
10740 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
10748 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
10760 set d_pwquota; eval $setvar
10761 set d_pwage; eval $setvar
10762 set d_pwchange; eval $setvar
10763 set d_pwclass; eval $setvar
10764 set d_pwexpire; eval $setvar
10765 set d_pwcomment; eval $setvar
10766 set d_pwgecos; eval $setvar
10767 set d_pwpasswd; eval $setvar
10771 : see if readdir and friends exist
10772 set readdir d_readdir
10774 set seekdir d_seekdir
10776 set telldir d_telldir
10778 set rewinddir d_rewinddir
10781 : see if readlink exists
10782 set readlink d_readlink
10785 : see if rename exists
10786 set rename d_rename
10789 : see if rmdir exists
10793 : see if memory.h is available.
10798 : See if it conflicts with string.h
10804 $cppstdin $cppflags $cppminus < $strings > mem.h
10805 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
10807 echo "We won't be including <memory.h>."
10817 : can bcopy handle overlapping blocks?
10822 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
10824 #$i_memory I_MEMORY
10825 #$i_stdlib I_STDLIB
10826 #$i_string I_STRING
10827 #$i_unistd I_UNISTD
10829 $cat >>try.c <<'EOCP'
10832 # include <memory.h>
10835 # include <stdlib.h>
10838 # include <string.h>
10840 # include <strings.h>
10843 # include <unistd.h> /* Needed for NetBSD */
10847 char buf[128], abc[128];
10853 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
10855 for (align = 7; align >= 0; align--) {
10856 for (len = 36; len; len--) {
10858 bcopy(abc, b, len);
10859 for (off = 1; off <= len; off++) {
10860 bcopy(b, b+off, len);
10861 bcopy(b+off, b, len);
10862 if (bcmp(b, abc, len))
10871 if eval $compile_ok; then
10872 if ./try 2>/dev/null; then
10873 echo "Yes, it can."
10876 echo "It can't, sorry."
10877 case "$d_memmove" in
10878 "$define") echo "But that's Ok since you have memmove()." ;;
10882 echo "(I can't compile the test program, so we'll assume not...)"
10883 case "$d_memmove" in
10884 "$define") echo "But that's Ok since you have memmove()." ;;
10889 $rm -f try.* try core
10893 : can memcpy handle overlapping blocks?
10895 case "$d_memcpy" in
10898 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
10900 #$i_memory I_MEMORY
10901 #$i_stdlib I_STDLIB
10902 #$i_string I_STRING
10903 #$i_unistd I_UNISTD
10905 $cat >>try.c <<'EOCP'
10908 # include <memory.h>
10911 # include <stdlib.h>
10914 # include <string.h>
10916 # include <strings.h>
10919 # include <unistd.h> /* Needed for NetBSD */
10923 char buf[128], abc[128];
10929 /* Copy "abcde..." string to char abc[] so that gcc doesn't
10930 try to store the string in read-only memory. */
10931 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
10933 for (align = 7; align >= 0; align--) {
10934 for (len = 36; len; len--) {
10936 memcpy(b, abc, len);
10937 for (off = 1; off <= len; off++) {
10938 memcpy(b+off, b, len);
10939 memcpy(b, b+off, len);
10940 if (memcmp(b, abc, len))
10949 if eval $compile_ok; then
10950 if ./try 2>/dev/null; then
10951 echo "Yes, it can."
10954 echo "It can't, sorry."
10955 case "$d_memmove" in
10956 "$define") echo "But that's Ok since you have memmove()." ;;
10960 echo "(I can't compile the test program, so we'll assume not...)"
10961 case "$d_memmove" in
10962 "$define") echo "But that's Ok since you have memmove()." ;;
10967 $rm -f try.* try core
10971 : can memcmp be trusted to compare relative magnitude?
10973 case "$d_memcmp" in
10976 echo "Checking if your memcmp() can compare relative magnitude..." >&4
10978 #$i_memory I_MEMORY
10979 #$i_stdlib I_STDLIB
10980 #$i_string I_STRING
10981 #$i_unistd I_UNISTD
10983 $cat >>try.c <<'EOCP'
10986 # include <memory.h>
10989 # include <stdlib.h>
10992 # include <string.h>
10994 # include <strings.h>
10997 # include <unistd.h> /* Needed for NetBSD */
11003 if ((a < b) && memcmp(&a, &b, 1) < 0)
11009 if eval $compile_ok; then
11010 if ./try 2>/dev/null; then
11011 echo "Yes, it can."
11014 echo "No, it can't (it uses signed chars)."
11017 echo "(I can't compile the test program, so we'll assume not...)"
11021 $rm -f try.* try core
11025 : see if prototype for sbrk is available
11027 set d_sbrkproto sbrk $i_unistd unistd.h
11030 : see if select exists
11031 set select d_select
11034 : see if semctl exists
11035 set semctl d_semctl
11038 : see if semget exists
11039 set semget d_semget
11042 : see if semop exists
11046 : see how much of the 'sem*(2)' library is present.
11049 case "$d_semctl$d_semget$d_semop" in
11050 *"$undef"*) h_sem=false;;
11054 case "`ipcs 2>&1`" in
11055 "SVID messages"*"not configured"*)
11056 echo "Your $osname does not have the sem*(2) configured." >&4
11059 set semctl d_semctl
11061 set semget d_semget
11069 : we could also check for sys/ipc.h ...
11070 if $h_sem && $test `./findhdr sys/sem.h`; then
11071 echo "You have the full sem*(2) library." >&4
11074 echo "You don't have the full sem*(2) library." >&4
11080 : see whether sys/sem.h defines union semun
11082 $cat > try.c <<'END'
11083 #include <sys/types.h>
11084 #include <sys/ipc.h>
11085 #include <sys/sem.h>
11086 int main () { union semun semun; semun.buf = 0; }
11089 if eval $compile; then
11090 echo "You have union semun in <sys/sem.h>." >&4
11093 echo "You do not have union semun in <sys/sem.h>." >&4
11096 $rm -f try try.c try.h
11100 : see how to do semctl IPC_STAT
11103 : see whether semctl IPC_STAT can use union semun
11108 # define S_IRUSR S_IREAD
11109 # define S_IWUSR S_IWRITE
11110 # define S_IXUSR S_IEXEC
11112 # define S_IRUSR 0400
11113 # define S_IWUSR 0200
11114 # define S_IXUSR 0100
11116 # define S_IRGRP (S_IRUSR>>3)
11117 # define S_IWGRP (S_IWUSR>>3)
11118 # define S_IXGRP (S_IXUSR>>3)
11119 # define S_IROTH (S_IRUSR>>6)
11120 # define S_IWOTH (S_IWUSR>>6)
11121 # define S_IXOTH (S_IXUSR>>6)
11124 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
11125 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
11126 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
11131 #include <sys/types.h>
11132 #include <sys/ipc.h>
11133 #include <sys/sem.h>
11134 #include <sys/stat.h>
11141 #$d_union_semun HAS_UNION_SEMUN
11144 #ifndef HAS_UNION_SEMUN
11147 struct semid_ds *buf;
11148 unsigned short *array;
11154 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
11155 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
11157 struct semid_ds argbuf;
11160 st = semctl(sem, 0, IPC_STAT, arg);
11164 # endif /* IPC_STAT */
11165 printf("semctl IPC_STAT failed: errno = %d\n", errno);
11167 if (semctl(sem, 0, IPC_RMID, arg) != 0)
11168 # endif /* IPC_RMID */
11169 printf("semctl IPC_RMID failed: errno = %d\n", errno);
11171 #endif /* IPC_PRIVATE && ... */
11172 printf("semget failed: errno = %d\n", errno);
11178 if eval $compile; then
11181 semun) val="$define" ;;
11187 case "$d_semctl_semun" in
11189 echo "You can use union semun for semctl IPC_STAT." >&4
11192 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
11197 : see whether semctl IPC_STAT can use struct semid_ds pointer
11198 $cat > try.c <<'END'
11199 #include <sys/types.h>
11200 #include <sys/ipc.h>
11201 #include <sys/sem.h>
11202 #include <sys/stat.h>
11210 struct semid_ds arg;
11213 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
11214 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
11217 st = semctl(sem, 0, IPC_STAT, &arg);
11219 printf("semid_ds\n");
11221 # endif /* IPC_STAT */
11222 printf("semctl IPC_STAT failed: errno = %d\n", errno);
11224 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
11225 # endif /* IPC_RMID */
11226 printf("semctl IPC_RMID failed: errno = %d\n", errno);
11228 #endif /* IPC_PRIVATE && ... */
11229 printf("semget failed: errno = %d\n", errno);
11236 if eval $compile; then
11239 semid_ds) val="$define" ;;
11243 set d_semctl_semid_ds
11245 case "$d_semctl_semid_ds" in
11247 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
11249 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
11256 # We do not have the full sem*(2) library, so assume we can not
11262 set d_semctl_semid_ds
11267 : see if setegid exists
11268 set setegid d_setegid
11271 : see if seteuid exists
11272 set seteuid d_seteuid
11275 : see if setgrent exists
11276 set setgrent d_setgrent
11279 : see if sethostent exists
11280 set sethostent d_sethent
11283 : see if setlinebuf exists
11284 set setlinebuf d_setlinebuf
11287 : see if setlocale exists
11288 set setlocale d_setlocale
11291 : see if setnetent exists
11292 set setnetent d_setnent
11295 : see if setprotoent exists
11296 set setprotoent d_setpent
11299 : see if setpgid exists
11300 set setpgid d_setpgid
11303 : see if setpgrp2 exists
11304 set setpgrp2 d_setpgrp2
11307 : see if setpriority exists
11308 set setpriority d_setprior
11311 : see if setproctitle exists
11312 set setproctitle d_setproctitle
11315 : see if setpwent exists
11316 set setpwent d_setpwent
11319 : see if setregid exists
11320 set setregid d_setregid
11322 set setresgid d_setresgid
11325 : see if setreuid exists
11326 set setreuid d_setreuid
11328 set setresuid d_setresuid
11331 : see if setrgid exists
11332 set setrgid d_setrgid
11335 : see if setruid exists
11336 set setruid d_setruid
11339 : see if setservent exists
11340 set setservent d_setsent
11343 : see if setsid exists
11344 set setsid d_setsid
11347 : see if setvbuf exists
11348 set setvbuf d_setvbuf
11351 : see if sfio.h is available
11356 : see if sfio library is available
11367 : Ok, but do we want to use it.
11371 true|$define|[yY]*) dflt='y';;
11374 echo "$package can use the sfio library, but it is experimental."
11375 case "$useperlio" in
11377 echo "For sfio also the PerlIO abstraction layer is needed."
11378 echo "Earlier you said you wouldn't want that."
11381 rp="You seem to have sfio available, do you want to try using it?"
11384 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
11385 useperlio="$define"
11388 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
11390 : Remove sfio from list of libraries to use
11391 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
11394 echo "libs = $libs" >&4
11398 *) case "$usesfio" in
11399 true|$define|[yY]*)
11400 echo "Sorry, cannot find sfio on this machine." >&4
11401 echo "Ignoring your setting of usesfio=$usesfio." >&4
11410 $define) usesfio='true';;
11411 *) usesfio='false';;
11414 : see if shmctl exists
11415 set shmctl d_shmctl
11418 : see if shmget exists
11419 set shmget d_shmget
11422 : see if shmat exists
11425 : see what shmat returns
11428 $cat >shmat.c <<'END'
11429 #include <sys/shm.h>
11432 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
11437 echo "and it returns ($shmattype)." >&4
11438 : see if a prototype for shmat is available
11439 xxx=`./findhdr sys/shm.h`
11440 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
11441 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
11452 set d_shmatprototype
11455 : see if shmdt exists
11459 : see how much of the 'shm*(2)' library is present.
11462 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
11463 *"$undef"*) h_shm=false;;
11467 case "`ipcs 2>&1`" in
11468 "SVID shared memory"*"not configured"*)
11469 echo "Your $osname does not have the shm*(2) configured." >&4
11472 set shmctl d_shmctl
11474 set shmget d_shmget
11484 : we could also check for sys/ipc.h ...
11485 if $h_shm && $test `./findhdr sys/shm.h`; then
11486 echo "You have the full shm*(2) library." >&4
11489 echo "You don't have the full shm*(2) library." >&4
11496 : see if we have sigaction
11497 if set sigaction val -f d_sigaction; eval $csym; $val; then
11498 echo 'sigaction() found.' >&4
11499 $cat > try.c <<'EOP'
11501 #include <sys/types.h>
11502 #include <signal.h>
11505 struct sigaction act, oact;
11507 oact.sa_handler = 0;
11508 /* so that act and oact are used */
11509 exit(act.sa_flags == 0 && oact.sa_handler == 0);
11513 if eval $compile_ok; then
11516 echo "But you don't seem to have a useable struct sigaction." >&4
11520 echo 'sigaction NOT found.' >&4
11523 set d_sigaction; eval $setvar
11524 $rm -f try try$_o try.c
11526 : see if sigprocmask exists
11527 set sigprocmask d_sigprocmask
11530 : see if sigsetjmp exists
11532 case "$d_sigsetjmp" in
11534 $cat >try.c <<'EOP'
11535 #include <setjmp.h>
11540 if (sigsetjmp(env,1))
11543 siglongjmp(env, 1);
11548 if eval $compile; then
11549 if ./try >/dev/null 2>&1; then
11550 echo "POSIX sigsetjmp found." >&4
11554 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
11560 echo "sigsetjmp not found." >&4
11564 *) val="$d_sigsetjmp"
11565 case "$d_sigsetjmp" in
11566 $define) echo "POSIX sigsetjmp found." >&4;;
11567 $undef) echo "sigsetjmp not found." >&4;;
11575 : see if socks5_init exists
11576 set socks5_init d_socks5_init
11579 : see if sys/stat.h is available
11580 set sys/stat.h i_sysstat
11584 : see if stat knows about block sizes
11586 echo "Checking to see if your struct stat has st_blocks field..." >&4
11587 set d_statblks stat st_blocks $i_sysstat sys/stat.h
11591 : see if this is a sys/vfs.h system
11592 set sys/vfs.h i_sysvfs
11596 : see if this is a sys/statfs.h system
11597 set sys/statfs.h i_sysstatfs
11602 echo "Checking to see if your system supports struct statfs..." >&4
11603 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
11605 case "$d_statfs_s" in
11606 "$define") echo "Yes, it does." ;;
11607 *) echo "No, it doesn't." ;;
11612 : see if struct statfs knows about f_flags
11613 case "$d_statfs_s" in
11616 echo "Checking to see if your struct statfs has f_flags field..." >&4
11617 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
11621 set d_statfs_f_flags
11625 case "$d_statfs_f_flags" in
11626 "$define") echo "Yes, it does." ;;
11627 *) echo "No, it doesn't." ;;
11630 : see if _ptr and _cnt from stdio act std
11633 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
11634 echo "(Looks like you have stdio.h from BSD.)"
11635 case "$stdio_ptr" in
11636 '') stdio_ptr='((fp)->_p)'
11639 *) ptr_lval=$d_stdio_ptr_lval;;
11641 case "$stdio_cnt" in
11642 '') stdio_cnt='((fp)->_r)'
11645 *) cnt_lval=$d_stdio_cnt_lval;;
11647 case "$stdio_base" in
11648 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
11650 case "$stdio_bufsiz" in
11651 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
11653 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
11654 echo "(Looks like you have stdio.h from Linux.)"
11655 case "$stdio_ptr" in
11656 '') stdio_ptr='((fp)->_IO_read_ptr)'
11659 *) ptr_lval=$d_stdio_ptr_lval;;
11661 case "$stdio_cnt" in
11662 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
11665 *) cnt_lval=$d_stdio_cnt_lval;;
11667 case "$stdio_base" in
11668 '') stdio_base='((fp)->_IO_read_base)';;
11670 case "$stdio_bufsiz" in
11671 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
11674 case "$stdio_ptr" in
11675 '') stdio_ptr='((fp)->_ptr)'
11678 *) ptr_lval=$d_stdio_ptr_lval;;
11680 case "$stdio_cnt" in
11681 '') stdio_cnt='((fp)->_cnt)'
11684 *) cnt_lval=$d_stdio_cnt_lval;;
11686 case "$stdio_base" in
11687 '') stdio_base='((fp)->_base)';;
11689 case "$stdio_bufsiz" in
11690 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
11694 : test whether _ptr and _cnt really work
11695 echo "Checking how std your stdio is..." >&4
11698 #define FILE_ptr(fp) $stdio_ptr
11699 #define FILE_cnt(fp) $stdio_cnt
11701 FILE *fp = fopen("try.c", "r");
11704 18 <= FILE_cnt(fp) &&
11705 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
11713 if eval $compile; then
11715 echo "Your stdio acts pretty std."
11718 echo "Your stdio isn't very std."
11721 echo "Your stdio doesn't appear very std."
11727 : Can _ptr be used as an lvalue?
11728 case "$d_stdstdio$ptr_lval" in
11729 $define$define) val=$define ;;
11732 set d_stdio_ptr_lval
11735 : Can _cnt be used as an lvalue?
11736 case "$d_stdstdio$cnt_lval" in
11737 $define$define) val=$define ;;
11740 set d_stdio_cnt_lval
11744 : test whether setting _ptr sets _cnt as a side effect
11745 d_stdio_ptr_lval_sets_cnt="$undef"
11746 d_stdio_ptr_lval_nochange_cnt="$undef"
11747 case "$d_stdio_ptr_lval$d_stdstdio" in
11749 echo "Checking to see what happens if we set the stdio ptr..." >&4
11752 /* Can we scream? */
11753 /* Eat dust sed :-) */
11754 /* In the buffer space, no one can hear you scream. */
11755 #define FILE_ptr(fp) $stdio_ptr
11756 #define FILE_cnt(fp) $stdio_cnt
11757 #include <sys/types.h>
11759 FILE *fp = fopen("try.c", "r");
11764 puts("Fail even to read");
11767 c = getc(fp); /* Read away the first # */
11769 puts("Fail even to read");
11773 18 <= FILE_cnt(fp) &&
11774 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
11776 puts("Fail even to read");
11779 ptr = (char*) FILE_ptr(fp);
11780 cnt = (size_t)FILE_cnt(fp);
11782 FILE_ptr(fp) += 42;
11784 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
11785 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
11788 if (FILE_cnt(fp) <= 20) {
11789 printf ("Fail (<20 chars to test)");
11792 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
11793 puts("Fail compare");
11796 if (cnt == FILE_cnt(fp)) {
11797 puts("Pass_unchanged");
11800 if (FILE_cnt(fp) == (cnt - 42)) {
11801 puts("Pass_changed");
11804 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
11810 if eval $compile; then
11811 case `./try$exe_ext` in
11813 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
11814 d_stdio_ptr_lval_sets_cnt="$define" ;;
11816 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
11817 d_stdio_ptr_lval_nochange_cnt="$define" ;;
11819 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
11821 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
11824 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
11830 : see if _base is also standard
11832 case "$d_stdstdio" in
11836 #define FILE_base(fp) $stdio_base
11837 #define FILE_bufsiz(fp) $stdio_bufsiz
11839 FILE *fp = fopen("try.c", "r");
11842 19 <= FILE_bufsiz(fp) &&
11843 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
11850 if eval $compile; then
11852 echo "And its _base field acts std."
11855 echo "But its _base field isn't std."
11858 echo "However, it seems to be lacking the _base field."
11867 Checking how to access stdio streams by file descriptor number...
11869 case "$stdio_stream_array" in
11870 '') $cat >try.c <<EOCP
11873 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
11877 for s in _iob __iob __sF
11879 set try -DSTDIO_STREAM_ARRAY=$s
11880 if eval $compile; then
11881 case "`./try$exe_ext`" in
11882 yes) stdio_stream_array=$s; break ;;
11886 $rm -f try.* try$exe_ext
11888 case "$stdio_stream_array" in
11890 I can't figure out how to access stdio streams by file descriptor number.
11892 d_stdio_stream_array="$undef"
11895 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
11897 d_stdio_stream_array="$define"
11901 : see if strcoll exists
11902 set strcoll d_strcoll
11905 : check for structure copying
11907 echo "Checking to see if your C compiler can copy structs..." >&4
11908 $cat >try.c <<'EOCP'
11918 if $cc -c try.c >/dev/null 2>&1 ; then
11920 echo "Yup, it can."
11923 echo "Nope, it can't."
11929 : see if strerror and/or sys_errlist[] exist
11931 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
11932 if set strerror val -f d_strerror; eval $csym; $val; then
11933 echo 'strerror() found.' >&4
11934 d_strerror="$define"
11935 d_strerrm='strerror(e)'
11936 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
11937 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
11938 d_syserrlst="$define"
11940 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
11941 d_syserrlst="$undef"
11943 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
11944 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
11945 echo 'strerror() found in string header.' >&4
11946 d_strerror="$define"
11947 d_strerrm='strerror(e)'
11948 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
11949 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
11950 d_syserrlst="$define"
11952 echo "(You don't appear to have any sys_errlist[], how can this be?)"
11953 d_syserrlst="$undef"
11955 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
11956 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
11957 d_strerror="$undef"
11958 d_syserrlst="$define"
11959 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
11961 echo 'strerror() and sys_errlist[] NOT found.' >&4
11962 d_strerror="$undef"
11963 d_syserrlst="$undef"
11964 d_strerrm='"unknown"'
11968 : see if strtod exists
11969 set strtod d_strtod
11972 : see if strtol exists
11973 set strtol d_strtol
11976 : see if strtold exists
11977 set strtold d_strtold
11980 : see if strtoll exists
11981 set strtoll d_strtoll
11984 case "$d_longlong-$d_strtoll" in
11987 Checking whether your strtoll() works okay...
11989 $cat >try.c <<'EOCP'
11992 #define strtoll __strtoll
11995 #define strtoll _strtoll
11998 extern long long int strtoll(char *s, char **, int);
11999 static int bad = 0;
12000 int check(char *s, long long ell, int een) {
12003 gll = strtoll(s, 0, 10);
12004 if (!((gll == ell) && (errno == een)))
12008 check(" 1", 1LL, 0);
12009 check(" 0", 0LL, 0);
12010 check("-1", -1LL, 0);
12011 check("-9223372036854775808", -9223372036854775808LL, 0);
12012 check("-9223372036854775808", -9223372036854775808LL, 0);
12013 check(" 9223372036854775807", 9223372036854775807LL, 0);
12014 check("-9223372036854775808", -9223372036854775808LL, 0);
12015 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
12016 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
12022 if eval $compile; then
12025 ok) echo "Your strtoll() seems to be working okay." ;;
12027 Your strtoll() doesn't seem to be working okay.
12033 echo "(I can't seem to compile the test program--assuming it doesn't)"
12039 : see if strtoq exists
12040 set strtoq d_strtoq
12043 : see if strtoul exists
12044 set strtoul d_strtoul
12047 case "$d_strtoul" in
12050 Checking whether your strtoul() works okay...
12052 $cat >try.c <<'EOCP'
12055 extern unsigned long int strtoul(char *s, char **, int);
12056 static int bad = 0;
12057 void check(char *s, unsigned long eul, int een) {
12060 gul = strtoul(s, 0, 10);
12061 if (!((gul == eul) && (errno == een)))
12065 check(" 1", 1L, 0);
12066 check(" 0", 0L, 0);
12068 case "$longsize" in
12070 $cat >>try.c <<'EOCP'
12071 check("18446744073709551615", 18446744073709551615UL, 0);
12072 check("18446744073709551616", 18446744073709551615UL, ERANGE);
12073 #if 0 /* strtoul() for /^-/ strings is undefined. */
12074 check("-1", 18446744073709551615UL, 0);
12075 check("-18446744073709551614", 2, 0);
12076 check("-18446744073709551615", 1, 0);
12077 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
12078 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
12083 $cat >>try.c <<'EOCP'
12084 check("4294967295", 4294967295UL, 0);
12085 check("4294967296", 4294967295UL, ERANGE);
12086 #if 0 /* strtoul() for /^-/ strings is undefined. */
12087 check("-1", 4294967295UL, 0);
12088 check("-4294967294", 2, 0);
12089 check("-4294967295", 1, 0);
12090 check("-4294967296", 4294967295UL, ERANGE);
12091 check("-4294967297", 4294967295UL, ERANGE);
12096 : Should we write these tests to be more portable by sprintf-ing
12097 : ~0 and then manipulating that char string as input for strtol?
12100 $cat >>try.c <<'EOCP'
12107 if eval $compile; then
12109 ok) echo "Your strtoul() seems to be working okay." ;;
12111 Your strtoul() doesn't seem to be working okay.
12120 : see if strtoull exists
12121 set strtoull d_strtoull
12124 case "$d_longlong-$d_strtoull" in
12127 Checking whether your strtoull() works okay...
12129 $cat >try.c <<'EOCP'
12132 #define strtoull __strtoull
12135 extern unsigned long long int strtoull(char *s, char **, int);
12136 static int bad = 0;
12137 int check(char *s, long long eull, int een) {
12140 gull = strtoull(s, 0, 10);
12141 if (!((gull == eull) && (errno == een)))
12145 check(" 1", 1LL, 0);
12146 check(" 0", 0LL, 0);
12147 check("18446744073709551615", 18446744073709551615ULL, 0);
12148 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
12149 #if 0 /* strtoull() for /^-/ strings is undefined. */
12150 check("-1", 18446744073709551615ULL, 0);
12151 check("-18446744073709551614", 2LL, 0);
12152 check("-18446744073709551615", 1LL, 0);
12153 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
12154 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
12161 if eval $compile; then
12163 ok) echo "Your strtoull() seems to be working okay." ;;
12165 Your strtoull() doesn't seem to be working okay.
12167 d_strtoull="$undef"
12174 : see if strtouq exists
12175 set strtouq d_strtouq
12178 case "$d_strtouq" in
12181 Checking whether your strtouq() works okay...
12183 $cat >try.c <<'EOCP'
12186 extern unsigned long long int strtouq(char *s, char **, int);
12187 static int bad = 0;
12188 void check(char *s, unsigned long long eull, int een) {
12189 unsigned long long gull;
12191 gull = strtouq(s, 0, 10);
12192 if (!((gull == eull) && (errno == een)))
12196 check(" 1", 1LL, 0);
12197 check(" 0", 0LL, 0);
12198 check("18446744073709551615", 18446744073709551615ULL, 0);
12199 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
12200 #if 0 /* strtouq() for /^-/ strings is undefined. */
12201 check("-1", 18446744073709551615ULL, 0);
12202 check("-18446744073709551614", 2LL, 0);
12203 check("-18446744073709551615", 1LL, 0);
12204 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
12205 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
12213 if eval $compile; then
12215 ok) echo "Your strtouq() seems to be working okay." ;;
12217 Your strtouq() doesn't seem to be working okay.
12226 : see if strxfrm exists
12227 set strxfrm d_strxfrm
12230 : see if symlink exists
12231 set symlink d_symlink
12234 : see if syscall exists
12235 set syscall d_syscall
12238 : see if sysconf exists
12239 set sysconf d_sysconf
12242 : see if system exists
12243 set system d_system
12246 : see if tcgetpgrp exists
12247 set tcgetpgrp d_tcgetpgrp
12250 : see if tcsetpgrp exists
12251 set tcsetpgrp d_tcsetpgrp
12254 : see if prototype for telldir is available
12256 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
12259 : see if this is a sys/times.h system
12260 set sys/times.h i_systimes
12263 : see if times exists
12265 if set times val -f d_times; eval $csym; $val; then
12266 echo 'times() found.' >&4
12269 case "$i_systimes" in
12270 "$define") inc='sys/times.h';;
12272 rp="What is the type returned by times() on this system?"
12273 set clock_t clocktype long stdio.h sys/types.h $inc
12276 echo 'times() NOT found, hope that will do.' >&4
12281 : see if truncate exists
12282 set truncate d_truncate
12285 : see if tzname[] exists
12287 if set tzname val -a d_tzname; eval $csym; $val; then
12289 echo 'tzname[] found.' >&4
12292 echo 'tzname[] NOT found.' >&4
12297 : see if umask exists
12301 : see if ustat exists
12305 : backward compatibility for d_hvfork
12306 if test X$d_hvfork != X; then
12307 d_vfork="$d_hvfork"
12310 : see if there is a vfork
12315 : Ok, but do we want to use it. vfork is reportedly unreliable in
12316 : perl on Solaris 2.x, and probably elsewhere.
12320 case "$usevfork" in
12326 Perl can only use a vfork() that doesn't suffer from strict
12327 restrictions on calling functions or modifying global data in
12328 the child. For example, glibc-2.1 contains such a vfork()
12329 that is unsuitable. If your system provides a proper fork()
12330 call, chances are that you do NOT want perl to use vfork().
12333 rp="Do you still want to use vfork()?"
12338 echo "Ok, we won't use vfork()."
12347 $define) usevfork='true';;
12348 *) usevfork='false';;
12351 : see if this is an sysdir system
12352 set sys/dir.h i_sysdir
12355 : see if this is an sysndir system
12356 set sys/ndir.h i_sysndir
12359 : see if closedir exists
12360 set closedir d_closedir
12363 case "$d_closedir" in
12366 echo "Checking whether closedir() returns a status..." >&4
12367 cat > closedir.c <<EOM
12368 #$i_dirent I_DIRENT /**/
12369 #$i_sysdir I_SYS_DIR /**/
12370 #$i_sysndir I_SYS_NDIR /**/
12371 #$i_systypes I_SYS_TYPES /**/
12373 #if defined(I_SYS_TYPES)
12374 #include <sys/types.h>
12376 #if defined(I_DIRENT)
12377 #include <dirent.h>
12378 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
12379 #include <sys/dir.h>
12383 #include <sys/ndir.h>
12387 #include <ndir.h> /* may be wrong in the future */
12389 #include <sys/dir.h>
12394 int main() { return closedir(opendir(".")); }
12397 if eval $compile_ok; then
12398 if ./closedir > /dev/null 2>&1 ; then
12399 echo "Yes, it does."
12402 echo "No, it doesn't."
12406 echo "(I can't seem to compile the test program--assuming it doesn't)"
12414 set d_void_closedir
12417 : see if there is a wait4
12421 : see if waitpid exists
12422 set waitpid d_waitpid
12425 : see if wcstombs exists
12426 set wcstombs d_wcstombs
12429 : see if wctomb exists
12430 set wctomb d_wctomb
12433 : preserve RCS keywords in files with variable substitution, grrr
12438 Revision='$Revision'
12440 case "$crosscompile" in
12441 ''|[nN]*) crosscompile="$undef" ;;
12445 next|rhapsody|darwin) multiarch="$define" ;;
12447 case "$multiarch" in
12448 ''|[nN]*) multiarch="$undef" ;;
12451 : check for alignment requirements
12453 case "$crosscompile$multiarch" in
12456 You seem to be either cross-compiling or doing a multiarchitecture build,
12457 skipping the memory alignment check.
12460 case "$alignbytes" in
12461 '') alignbytes=8 ;;
12465 case "$alignbytes" in
12466 '') echo "Checking alignment constraints..." >&4
12467 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
12468 $cat >try.c <<'EOCP'
12469 typedef long double NV;
12472 $cat >try.c <<'EOCP'
12476 $cat >>try.c <<'EOCP'
12484 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
12489 if eval $compile_ok; then
12493 echo "(I can't seem to compile the test program...)"
12496 *) dflt="$alignbytes"
12499 rp="Doubles must be aligned on a how-many-byte boundary?"
12507 : set the base revision
12510 : check for ordering of bytes in a long
12512 case "$crosscompile$multiarch" in
12515 You seem to be either cross-compiling or doing a multiarchitecture build,
12516 skipping the byteorder check.
12522 case "$byteorder" in
12525 In the following, larger digits indicate more significance. A big-endian
12526 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
12527 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
12528 machines may have weird orders like 3412. A Cray will report 87654321,
12529 an Alpha will report 12345678. If the test program works the default is
12531 I'm now running the test program...
12533 $cat >try.c <<'EOCP'
12540 char c[sizeof(long)];
12543 if (sizeof(long) > 4)
12544 u.l = (0x08070605L << 32) | 0x04030201L;
12547 for (i = 0; i < sizeof(long); i++)
12548 printf("%c", u.c[i]+'0');
12555 if eval $compile && ./try > /dev/null; then
12558 [1-4][1-4][1-4][1-4]|12345678|87654321)
12559 echo "(The test program ran ok.)"
12560 echo "byteorder=$dflt"
12563 ????|????????) echo "(The test program ran ok.)" ;;
12564 *) echo "(The test program didn't run right for some reason.)" ;;
12569 (I can't seem to compile the test program. Guessing big-endian...)
12572 case "$xxx_prompt" in
12574 rp="What is the order of bytes in a long?"
12588 : how do we catenate cpp tokens here?
12590 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
12591 $cat >cpp_stuff.c <<'EOCP'
12592 #define RCAT(a,b)a/**/b
12593 #define ACAT(a,b)a ## b
12597 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
12598 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
12599 echo "Oh! Smells like ANSI's been here." >&4
12600 echo "We can catify or stringify, separately or together!"
12602 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
12603 echo "Ah, yes! The good old days!" >&4
12604 echo "However, in the good old days we don't know how to stringify and"
12605 echo "catify at the same time."
12609 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
12610 to have to edit the values of CAT[2-5] in config.h...
12612 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
12616 : see if this is a db.h system
12622 : Check db version.
12624 echo "Checking Berkeley DB version ..." >&4
12630 #include <sys/types.h>
12635 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
12636 int Major, Minor, Patch ;
12637 unsigned long Version ;
12638 (void)db_version(&Major, &Minor, &Patch) ;
12639 printf("You have Berkeley DB Version 2 or greater\n");
12641 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
12642 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
12643 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
12644 Major, Minor, Patch) ;
12646 /* check that db.h & libdb are compatible */
12647 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
12648 printf("db.h and libdb are incompatible\n") ;
12652 printf("db.h and libdb are compatible\n") ;
12654 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
12655 + DB_VERSION_PATCH ;
12657 /* needs to be >= 2.3.4 */
12658 if (Version < 2003004) {
12659 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
12660 printf("but Perl needs Berkeley DB 2.3.4 or greater\n") ;
12666 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
12667 printf("You have Berkeley DB Version 1\n");
12668 exit(0); /* DB version < 2: the coast is clear. */
12670 exit(1); /* <db.h> not Berkeley DB? */
12676 if eval $compile_ok && ./try; then
12677 echo 'Looks OK.' >&4
12679 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
12683 : Remove db from list of libraries to use
12684 echo "Removing unusable -ldb from library list" >&4
12685 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
12688 echo "libs = $libs" >&4
12698 : Check the return type needed for hash
12700 echo "Checking return type needed for hash for Berkeley DB ..." >&4
12706 #include <sys/types.h>
12709 #ifndef DB_VERSION_MAJOR
12710 u_int32_t hash_cb (ptr, size)
12718 info.hash = hash_cb;
12722 if $cc $ccflags -c try.c >try.out 2>&1 ; then
12723 if $contains warning try.out >>/dev/null 2>&1 ; then
12726 db_hashtype='u_int32_t'
12729 : XXX Maybe we should just give up here.
12730 db_hashtype=u_int32_t
12732 echo "Help: I can't seem to compile the db test program." >&4
12733 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
12736 echo "Your version of Berkeley DB uses $db_hashtype for hash."
12738 *) db_hashtype=u_int32_t
12743 : Check the return type needed for prefix
12745 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
12751 #include <sys/types.h>
12754 #ifndef DB_VERSION_MAJOR
12755 size_t prefix_cb (key1, key2)
12763 info.prefix = prefix_cb;
12767 if $cc $ccflags -c try.c >try.out 2>&1 ; then
12768 if $contains warning try.out >>/dev/null 2>&1 ; then
12769 db_prefixtype='int'
12771 db_prefixtype='size_t'
12774 db_prefixtype='size_t'
12775 : XXX Maybe we should just give up here.
12777 echo "Help: I can't seem to compile the db test program." >&4
12778 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
12781 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
12783 *) db_prefixtype='size_t'
12787 : check for void type
12789 echo "Checking to see how well your C compiler groks the void type..." >&4
12790 case "$voidflags" in
12792 $cat >try.c <<'EOCP'
12798 extern void moo(); /* function returning void */
12799 void (*goo)(); /* ptr to func returning void */
12801 void *hue; /* generic ptr */
12814 int main() { sub(); }
12816 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
12817 voidflags=$defvoidused
12818 echo "Good. It appears to support void to the level $package wants.">&4
12819 if $contains warning .out >/dev/null 2>&1; then
12820 echo "However, you might get some warnings that look like this:"
12824 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
12825 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
12826 echo "It supports 1..."
12827 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
12828 echo "It also supports 2..."
12829 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
12831 echo "And it supports 4 but not 8 definitely."
12833 echo "It doesn't support 4..."
12834 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
12836 echo "But it supports 8."
12839 echo "Neither does it support 8."
12843 echo "It does not support 2..."
12844 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
12846 echo "But it supports 4 and 8."
12848 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
12850 echo "And it supports 4 but has not heard about 8."
12852 echo "However it supports 8 but not 4."
12857 echo "There is no support at all for void."
12862 case "$voidflags" in
12864 *) $cat >&4 <<'EOM'
12865 Support flag bits are:
12866 1: basic void declarations.
12867 2: arrays of pointers to functions returning void.
12868 4: operations between pointers to and addresses of void functions.
12869 8: generic void pointers.
12872 rp="Your void support flags add up to what?"
12880 : How can we generate normalized random numbers ?
12882 echo "Looking for a random number function..." >&4
12883 case "$randfunc" in
12885 if set drand48 val -f; eval $csym; $val; then
12887 echo "Good, found drand48()." >&4
12888 elif set random val -f; eval $csym; $val; then
12890 echo "OK, found random()." >&4
12893 echo "Yick, looks like I have to use rand()." >&4
12904 *-Dmy_rand=*|*-Dmy_srand=*)
12905 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
12906 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
12907 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
12908 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
12912 while $test "$cont"; do
12913 rp="Use which function to generate random numbers?"
12915 if $test "$ans" = "$dflt"; then
12921 if set $ans val -f; eval $csym; $val; then
12925 rp="I cannot find function $ans. Use that name anyway?"
12934 case "$randfunc" in
12936 drand01="drand48()"
12942 case "$randbits" in
12944 echo "Checking to see how many bits your $randfunc() function produces..." >&4
12946 #$i_unistd I_UNISTD
12947 #$i_stdlib I_STDLIB
12950 # include <unistd.h>
12953 # include <stdlib.h>
12958 register unsigned long tmp;
12959 register unsigned long max = 0L;
12961 for (i = 1000; i; i--) {
12962 tmp = (unsigned long) $randfunc();
12963 if (tmp > max) max = tmp;
12965 for (i = 0; max; i++)
12971 if eval $compile_ok; then
12975 echo "(I can't seem to compile the test program...)"
12982 rp="How many bits does your $randfunc() function produce?"
12986 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
12987 seedfunc="s$randfunc"
12988 randseedtype=unsigned
12992 rp="How many bits does your $randfunc() function produce?"
12995 seedfunc="s$randfunc"
12996 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
12997 if set $seedfunc val -f; eval $csym; $val; then
12998 echo "(Using $seedfunc() to seed random generator)"
13000 echo "(Warning: no $seedfunc() to seed random generator)"
13003 randseedtype=unsigned
13011 echo "Determining whether or not we are on an EBCDIC system..." >&4
13012 $cat >tebcdic.c <<'EOM'
13015 if ('M'==0xd4) return 0;
13022 if eval $compile_ok; then
13024 echo "You seem to speak EBCDIC." >&4
13027 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF8." >&4
13030 echo "I'm unable to compile the test program." >&4
13031 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
13033 $rm -f tebcdic.c tebcdic
13039 Checking how to flush all pending stdio output...
13041 # I only know how to find the first 32 possibly open files on SunOS.
13042 # See also hints/sunos_4_1.sh and util.c --AD
13044 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
13046 $cat >>try.c <<EOCP
13048 #$i_unistd I_UNISTD
13050 # include <unistd.h>
13052 #$d_sysconf HAS_SYSCONF
13053 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
13054 #ifdef HAS_STDIO_STREAM_ARRAY
13055 # define STDIO_STREAM_ARRAY $stdio_stream_array
13058 FILE* p = fopen("try.out", "w");
13062 # ifdef TRY_FPRINTF
13066 #ifdef TRY_FFLUSH_NULL
13069 #ifdef TRY_FFLUSH_ALL
13071 long open_max = -1;
13072 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
13073 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
13075 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
13076 open_max = sysconf(_SC_OPEN_MAX);
13079 open_max = FOPEN_MAX;
13082 open_max = OPEN_MAX;
13091 # ifdef HAS_STDIO_STREAM_ARRAY
13092 if (open_max > 0) {
13094 for (i = 0; i < open_max; i++)
13095 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
13096 STDIO_STREAM_ARRAY[i]._file < open_max &&
13097 STDIO_STREAM_ARRAY[i]._flag)
13098 fflush(&STDIO_STREAM_ARRAY[i]);
13106 : first we have to find out how _not_ to flush
13107 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
13109 set try -DTRY_FPUTC
13110 if eval $compile; then
13112 ./try$exe_ext 2>/dev/null
13113 if $test ! -s try.out -a "X$?" = X42; then
13119 set try -DTRY_FPRINTF
13121 if eval $compile; then
13123 ./try$exe_ext 2>/dev/null
13124 if $test ! -s try.out -a "X$?" = X42; then
13125 output=-DTRY_FPRINTF
13131 : check for fflush NULL behaviour
13132 case "$fflushNULL" in
13133 '') set try -DTRY_FFLUSH_NULL $output
13134 if eval $compile; then
13136 ./try$exe_ext 2>/dev/null
13138 if $test -s try.out -a "X$code" = X42; then
13139 fflushNULL="`$cat try.out`"
13141 if $test "X$code" != X42; then
13143 (If this test failed, don't worry, we'll try another method shortly.)
13148 $rm -f core try.core core.try.*
13149 case "$fflushNULL" in
13151 Your fflush(NULL) works okay for output streams.
13152 Let's see if it clobbers input pipes...
13154 # As of mid-March 2000 all versions of Solaris appear to have a stdio
13155 # bug that improperly flushes the input end of pipes. So we avoid the
13156 # autoflush on fork/system/exec support for now. :-(
13157 $cat >tryp.c <<EOCP
13160 main(int argc, char **argv)
13166 while ((i = getc(stdin)) != -1
13167 && (*bp++ = i) != '\n'
13168 && bp < &buf[1024])
13171 fprintf(stdout, "%s", buf);
13179 fflushNULL="$define"
13181 if eval $compile; then
13183 $cat tryp.c | ./tryp$exe_ext 2>/dev/null > tryp.out
13184 if cmp tryp.c tryp.out >/dev/null 2>&1; then
13186 fflush(NULL) seems to behave okay with input streams.
13188 fflushNULL="$define"
13191 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
13193 fflushNULL="$undef"
13196 $rm -f core tryp.c tryp.core core.tryp.*
13199 Your fflush(NULL) isn't working (contrary to ANSI C).
13201 fflushNULL="$undef"
13204 Cannot figure out whether your fflush(NULL) works or not.
13205 I'm assuming it doesn't (contrary to ANSI C).
13207 fflushNULL="$undef"
13211 $define|true|[yY]*)
13212 fflushNULL="$define"
13215 fflushNULL="$undef"
13218 : check explicit looping only if NULL did not work, and if the pipe
13219 : bug does not show up on an explicit flush too
13220 case "$fflushNULL" in
13222 $cat >tryp.c <<EOCP
13225 main(int argc, char **argv)
13231 while ((i = getc(stdin)) != -1
13232 && (*bp++ = i) != '\n'
13233 && bp < &buf[1024])
13236 fprintf(stdout, "%s", buf);
13245 if eval $compile; then
13247 $cat tryp.c | ./tryp$exe_ext 2>/dev/null > tryp.out
13248 if cmp tryp.c tryp.out >/dev/null 2>&1; then
13250 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
13252 : now check for fflushall behaviour
13253 case "$fflushall" in
13254 '') set try -DTRY_FFLUSH_ALL $output
13255 if eval $compile; then
13257 (Now testing the other method--but note that this also may fail.)
13260 ./try$exe_ext 2>/dev/null
13261 if $test -s try.out -a "X$?" = X42; then
13262 fflushall="`$cat try.out`"
13265 $rm -f core try.core core.try.*
13266 case "$fflushall" in
13268 Whew. Flushing explicitly all the stdio streams works.
13270 fflushall="$define"
13273 Sigh. Flushing explicitly all the stdio streams doesn't work.
13278 Cannot figure out whether flushing stdio streams explicitly works or not.
13279 I'm assuming it doesn't.
13285 "$define"|true|[yY]*)
13286 fflushall="$define"
13294 All is futile. Even fflush(stdin) clobbers input pipes!
13301 $rm -f core tryp.c tryp.core core.tryp.*
13303 *) fflushall="$undef"
13307 case "$fflushNULL$fflushall" in
13310 OK, I give up. I cannot figure out how to flush pending stdio output.
13311 We won't be flushing handles at all before fork/exec/popen.
13315 $rm -f try.* try$exe_ext
13317 : Store the full pathname to the ar program for use in the C program
13318 : Respect a hint or command line value for full_ar.
13323 : Store the full pathname to the sed program for use in the C program
13326 : see what type gids are declared as in the kernel
13328 echo "Looking for the type for group ids returned by getgid()."
13329 set gid_t gidtype xxx stdio.h sys/types.h
13333 xxx=`./findhdr sys/user.h`
13334 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
13336 unsigned) dflt="$1 $2" ;;
13340 *) dflt="$gidtype";;
13343 gid_t) echo "gid_t found." ;;
13344 *) rp="What is the type for group ids returned by getgid()?"
13352 *_t) zzz="$gidtype" ;;
13355 echo "Checking the size of $zzz..." >&4
13357 #include <sys/types.h>
13360 printf("%d\n", (int)sizeof($gidtype));
13365 if eval $compile_ok; then
13369 echo "(I can't execute the test program--guessing $gidsize.)" >&4
13372 echo "Your $zzz is $gidsize bytes long."
13377 echo "(I can't compile the test program--guessing $gidsize.)" >&4
13383 *_t) zzz="$gidtype" ;;
13386 echo "Checking the sign of $zzz..." >&4
13388 #include <sys/types.h>
13399 if eval $compile; then
13403 echo "(I can't execute the test program--guessing unsigned.)" >&4
13407 1) echo "Your $zzz is unsigned." ;;
13408 -1) echo "Your $zzz is signed." ;;
13414 echo "(I can't compile the test program--guessing unsigned.)" >&4
13420 if $test X"$quadtype" != X; then
13422 echo "Checking how to print 64-bit integers..." >&4
13424 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
13425 $cat >try.c <<'EOCP'
13426 #include <sys/types.h>
13429 int q = 12345678901;
13430 printf("%ld\n", q);
13434 if eval $compile; then
13435 yyy=`./try$exe_ext`
13438 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
13439 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
13440 echo "We will use %d."
13446 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
13447 $cat >try.c <<'EOCP'
13448 #include <sys/types.h>
13451 long q = 12345678901;
13452 printf("%ld\n", q);
13456 if eval $compile; then
13457 yyy=`./try$exe_ext`
13460 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
13461 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
13462 echo "We will use %ld."
13468 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
13469 $cat >try.c <<'EOCP'
13470 #include <sys/types.h>
13471 #include <inttypes.h>
13474 int64_t q = 12345678901;
13475 printf("%" PRId64 "\n", q);
13479 if eval $compile; then
13480 yyy=`./try$exe_ext`
13483 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
13484 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
13485 echo "We will use the C9X style."
13491 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
13492 $cat >try.c <<'EOCP'
13493 #include <sys/types.h>
13496 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
13497 printf("%lld\n", q);
13501 if eval $compile; then
13502 yyy=`./try$exe_ext`
13505 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
13506 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
13507 echo "We will use the %lld style."
13513 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
13515 #include <sys/types.h>
13518 $quadtype q = 12345678901;
13519 printf("%Ld\n", q);
13523 if eval $compile; then
13524 yyy=`./try$exe_ext`
13527 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
13528 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
13529 echo "We will use %Ld."
13535 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
13537 #include <sys/types.h>
13540 $quadtype q = 12345678901;
13541 printf("%qd\n", q);
13545 if eval $compile; then
13546 yyy=`./try$exe_ext`
13549 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
13550 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
13551 echo "We will use %qd."
13557 if $test X"$sPRId64" = X; then
13558 echo "Cannot figure out how to print 64-bit integers." >&4
13566 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
13567 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
13569 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
13570 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
13576 $echo "Checking the format strings to be used for Perl's internal types..." >&4
13578 if $test X"$ivsize" = X8; then
13579 ivdformat="$sPRId64"
13580 uvuformat="$sPRIu64"
13581 uvoformat="$sPRIo64"
13582 uvxformat="$sPRIx64"
13583 uvXUformat="$sPRIXU64"
13585 if $test X"$ivsize" = X"$longsize"; then
13592 if $test X"$ivsize" = X"$intsize"; then
13600 if $test X"$ivsize" = X"$shortsize"; then
13611 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
13612 nveformat="$sPRIeldbl"
13613 nvfformat="$sPRIfldbl"
13614 nvgformat="$sPRIgldbl"
13615 nvEUformat="$sPRIEUldbl"
13616 nvFUformat="$sPRIFUldbl"
13617 nvGUformat="$sPRIGUldbl"
13627 case "$ivdformat" in
13628 '') echo "$0: Fatal: failed to find format strings, cannot continue." >& 4
13635 $echo "Checking the format string to be used for gids..." >&4
13638 -1) if $test X"$gidsize" = X"$ivsize"; then
13639 gidformat="$ivdformat"
13641 if $test X"$gidsize" = X"$longsize"; then
13644 if $test X"$gidsize" = X"$intsize"; then
13647 if $test X"$gidsize" = X"$shortsize"; then
13654 *) if $test X"$gidsize" = X"$uvsize"; then
13655 gidformat="$uvuformat"
13657 if $test X"$gidsize" = X"$longsize"; then
13660 if $test X"$gidsize" = X"$intsize"; then
13663 if $test X"$gidsize" = X"$shortsize"; then
13672 : see if getgroups exists
13673 set getgroups d_getgrps
13676 : see if setgroups exists
13677 set setgroups d_setgrps
13681 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
13683 case "$d_getgrps$d_setgrps" in
13685 case "$groupstype" in
13686 '') dflt="$gidtype" ;;
13687 *) dflt="$groupstype" ;;
13690 What type of pointer is the second argument to getgroups() and setgroups()?
13691 Usually this is the same as group ids, $gidtype, but not always.
13694 rp='What type pointer is the second argument to getgroups() and setgroups()?'
13698 *) groupstype="$gidtype";;
13702 echo "Checking if your $make program sets \$(MAKE)..." >&4
13703 case "$make_set_make" in
13705 $sed 's/^X //' > testmake.mak << 'EOF'
13707 X @echo 'maketemp="$(MAKE)"'
13709 case "`$make -f testmake.mak 2>/dev/null`" in
13710 *maketemp=*) make_set_make='#' ;;
13711 *) make_set_make="MAKE=$make" ;;
13713 $rm -f testmake.mak
13716 case "$make_set_make" in
13717 '#') echo "Yup, it does.";;
13718 *) echo "Nope, it doesn't.";;
13721 : see what type is used for mode_t
13722 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
13723 set mode_t modetype int stdio.h sys/types.h
13726 : see if stdarg is available
13728 if $test `./findhdr stdarg.h`; then
13729 echo "<stdarg.h> found." >&4
13732 echo "<stdarg.h> NOT found." >&4
13736 : see if varags is available
13738 if $test `./findhdr varargs.h`; then
13739 echo "<varargs.h> found." >&4
13741 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
13744 : set up the varargs testing programs
13745 $cat > varargs.c <<EOP
13747 #include <stdarg.h>
13750 #include <varargs.h>
13754 int f(char *p, ...)
13768 p = va_arg(ap, char *);
13773 $cat > varargs <<EOP
13775 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
13784 : now check which varargs header should be included
13789 if `./varargs I_STDARG`; then
13791 elif `./varargs I_VARARGS`; then
13796 if `./varargs I_VARARGS`; then
13803 echo "I could not find the definition for va_dcl... You have problems..." >&4
13804 val="$undef"; set i_stdarg; eval $setvar
13805 val="$undef"; set i_varargs; eval $setvar
13810 case "$i_varhdr" in
13812 val="$define"; set i_stdarg; eval $setvar
13813 val="$undef"; set i_varargs; eval $setvar
13816 val="$undef"; set i_stdarg; eval $setvar
13817 val="$define"; set i_varargs; eval $setvar
13820 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
13824 : see if we need va_copy
13826 case "$i_stdarg" in
13829 #include <stdarg.h>
13831 #$i_stdlib I_STDLIB
13833 #include <stdlib.h>
13835 #include <signal.h>
13838 ivfprintf(FILE *f, const char *fmt, va_list *valp)
13840 return vfprintf(f, fmt, *valp);
13844 myvfprintf(FILE *f, const char *fmt, va_list val)
13846 return ivfprintf(f, fmt, &val);
13850 myprintf(char *fmt, ...)
13853 va_start(val, fmt);
13854 return myvfprintf(stdout, fmt, val);
13858 main(int ac, char **av)
13860 signal(SIGSEGV, exit);
13862 myprintf("%s%cs all right, then\n", "that", '\'');
13867 if eval $compile && ./try 2>&1 >/dev/null; then
13869 "that's all right, then")
13875 yes) echo "It seems that you don't need va_copy()." >&4
13876 need_va_copy="$undef"
13878 *) echo "It seems that va_copy() or similar will be needed." >&4
13879 need_va_copy="$define"
13882 $rm -f try.* core core.* *.core *.core.*
13884 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
13888 : define a fucntion to check prototypes
13889 $cat > protochk <<EOSH
13892 optimize="$optimize"
13894 prototype="$prototype"
13899 $cat >> protochk <<'EOSH'
13904 while test $# -ge 2; do
13906 $define) echo "#include <$2>" >> try.c ;;
13907 literal) echo "$2" >> try.c ;;
13911 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
13912 cat >> try.c <<'EOCP'
13913 #ifdef CAN_PROTOTYPE
13914 #define _(args) args
13919 echo "$foo" >> try.c
13920 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
13921 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
13927 $eunicefix protochk
13929 : see what type is used for size_t
13930 rp="What is the type used for the length parameter for string functions?"
13931 set size_t sizetype 'unsigned int' stdio.h sys/types.h
13934 : check for type of arguments to gethostbyaddr.
13935 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
13936 case "$d_gethbyaddr" in
13940 Checking to see what type of arguments are accepted by gethostbyaddr().
13942 hdrs="$define sys/types.h
13943 $d_socket sys/socket.h
13944 $i_niin netinet/in.h
13946 $i_unistd unistd.h"
13947 : The first arg can 'char *' or 'void *'
13948 : The second arg is some of integral type
13949 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
13950 for yyy in size_t long int; do
13951 case "$netdb_host_type" in
13952 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
13953 if ./protochk "$try" $hdrs; then
13954 echo "Your system accepts $xxx for the first arg."
13955 echo "...and $yyy for the second arg."
13956 netdb_host_type="$xxx"
13957 netdb_hlen_type="$yyy"
13963 : In case none of those worked, prompt the user.
13964 case "$netdb_host_type" in
13965 '') rp='What is the type for the 1st argument to gethostbyaddr?'
13968 netdb_host_type=$ans
13969 rp='What is the type for the 2nd argument to gethostbyaddr?'
13972 netdb_hlen_type=$ans
13976 *) : no gethostbyaddr, so pick harmless defaults
13977 netdb_host_type='char *'
13978 netdb_hlen_type="$sizetype"
13981 # Remove the "const" if needed. -- but then we'll have a
13983 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
13986 : check for type of argument to gethostbyname.
13987 if test "X$netdb_name_type" = X ; then
13988 case "$d_gethbyname" in
13992 Checking to see what type of argument is accepted by gethostbyname().
13994 hdrs="$define sys/types.h
13995 $d_socket sys/socket.h
13996 $i_niin netinet/in.h
13998 $i_unistd unistd.h"
13999 for xxx in "const char *" "char *"; do
14000 case "$netdb_name_type" in
14001 '') try="extern struct hostent *gethostbyname($xxx);"
14002 if ./protochk "$try" $hdrs; then
14003 echo "Your system accepts $xxx."
14004 netdb_name_type="$xxx"
14009 : In case none of those worked, prompt the user.
14010 case "$netdb_name_type" in
14011 '') rp='What is the type for the 1st argument to gethostbyname?'
14014 netdb_name_type=$ans
14018 *) : no gethostbyname, so pick harmless default
14019 netdb_name_type='char *'
14024 : check for type of 1st argument to getnetbyaddr.
14025 if test "X$netdb_net_type" = X ; then
14026 case "$d_getnbyaddr" in
14030 Checking to see what type of 1st argument is accepted by getnetbyaddr().
14032 hdrs="$define sys/types.h
14033 $d_socket sys/socket.h
14034 $i_niin netinet/in.h
14036 $i_unistd unistd.h"
14037 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
14038 case "$netdb_net_type" in
14039 '') try="extern struct netent *getnetbyaddr($xxx, int);"
14040 if ./protochk "$try" $hdrs; then
14041 echo "Your system accepts $xxx."
14042 netdb_net_type="$xxx"
14047 : In case none of those worked, prompt the user.
14048 case "$netdb_net_type" in
14049 '') rp='What is the type for the 1st argument to getnetbyaddr?'
14052 netdb_net_type=$ans
14056 *) : no getnetbyaddr, so pick harmless default
14057 netdb_net_type='long'
14061 : locate the preferred pager for this system
14067 [a-zA-Z]:/*) dflt=$pg;;
14071 [a-zA-Z]:/*) dflt=$more;;
14075 [a-zA-Z]:/*) dflt=$less;;
14078 '') dflt=/usr/ucb/more;;
14085 rp='What pager is used on your system?'
14089 : see what type pids are declared as in the kernel
14090 rp="What is the type of process ids on this system?"
14091 set pid_t pidtype int stdio.h sys/types.h
14094 : Find earliest binary compatible site_perl subdirectory perl can use.
14095 case "$bincompat5005" in
14096 "$define") xs_apiversion='5.005' ;;
14097 *) xs_apiversion=$version ;; # The current site_perl version.
14099 : Find earliest pure perl site_perl subdirectory perl can use.
14100 : The versioned directories started at 5.005.
14101 pm_apiversion='5.005'
14103 : check for length of pointer
14107 echo "Checking to see how big your pointers are..." >&4
14108 if test "$voidflags" -gt 7; then
14109 echo '#define VOID_PTR char *' > try.c
14111 echo '#define VOID_PTR void *' > try.c
14113 $cat >>try.c <<'EOCP'
14117 printf("%d\n", (int)sizeof(VOID_PTR));
14122 if eval $compile_ok; then
14124 echo "Your pointers are $ptrsize bytes long."
14127 echo "(I can't seem to compile the test program. Guessing...)" >&4
14128 rp="What is the size of a pointer (in bytes)?"
14136 : see if ar generates random libraries by itself
14138 echo "Checking how to generate random libraries on your machine..." >&4
14139 echo 'int bar1() { return bar2(); }' > bar1.c
14140 echo 'int bar2() { return 2; }' > bar2.c
14141 $cat > foo.c <<'EOP'
14142 int main() { printf("%d\n", bar1()); exit(0); }
14144 $cc $ccflags -c bar1.c >/dev/null 2>&1
14145 $cc $ccflags -c bar2.c >/dev/null 2>&1
14146 $cc $ccflags -c foo.c >/dev/null 2>&1
14147 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
14148 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
14149 ./foobar >/dev/null 2>&1; then
14150 echo "$ar appears to generate random libraries itself."
14153 elif $ar ts bar$_a >/dev/null 2>&1 &&
14154 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
14155 ./foobar >/dev/null 2>&1; then
14156 echo "a table of contents needs to be added with '$ar ts'."
14163 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
14164 $test -f $ranlib || ranlib=''
14167 if $test -n "$ranlib"; then
14168 echo "your system has '$ranlib'; we'll use that."
14171 echo "your system doesn't seem to support random libraries"
14172 echo "so we'll use lorder and tsort to order the libraries."
14179 : check for type of arguments to select.
14180 case "$selecttype" in
14181 '') case "$d_select" in
14185 Checking to see what type of arguments are accepted by select().
14187 hdrs="$define sys/types.h
14188 $i_systime sys/time.h
14189 $i_sysselct sys/select.h
14190 $d_socket sys/socket.h"
14191 : The first arg can be int, unsigned, or size_t
14192 : The last arg may or may not be 'const'
14194 : void pointer has been seen but using that
14195 : breaks the selectminbits test
14196 for xxx in 'fd_set *' 'int *'; do
14197 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
14198 for tmo in 'struct timeval *' 'const struct timeval *'; do
14200 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
14201 if ./protochk "$try" $hdrs; then
14202 echo "Your system accepts $xxx."
14211 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
14212 case "$d_fd_set" in
14213 $define) dflt="fd_set *" ;;
14222 *) : no select, so pick a harmless default
14229 : check for the select 'width'
14230 case "$selectminbits" in
14231 '') case "$d_select" in
14235 Checking to see on how many bits at a time your select() operates...
14238 #include <sys/types.h>
14240 #$i_systime I_SYS_TIME
14241 #$i_systimek I_SYS_TIME_KERNEL
14246 # ifdef I_SYS_TIME_KERNEL
14249 # include <sys/time.h>
14250 # ifdef I_SYS_TIME_KERNEL
14254 #$i_sysselct I_SYS_SELECT
14255 #ifdef I_SYS_SELECT
14256 #include <sys/select.h>
14258 #$d_socket HAS_SOCKET
14260 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
14264 #define S sizeof(*(b))
14266 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
14267 #define NBITS (NBYTES * 8)
14276 fp = fopen("try.c", "r");
14282 b = ($selecttype)s;
14283 for (i = 0; i < NBITS; i++)
14287 select(fd + 1, b, 0, 0, &t);
14288 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
14289 printf("%d\n", i + 1);
14294 if eval $compile_ok; then
14295 selectminbits=`./try`
14296 case "$selectminbits" in
14298 Cannot figure out on how many bits at a time your select() operates.
14299 I'll play safe and guess it is 32 bits.
14305 *) bits="$selectminbits bits" ;;
14307 echo "Your select() operates on $bits at a time." >&4
14309 rp='What is the minimum number of bits your select() operates on?'
14310 case "$byteorder" in
14311 1234|12345678) dflt=32 ;;
14316 selectminbits="$val"
14320 *) : no select, so pick a harmless default
14327 : Trace out the files included by signal.h, then look for SIGxxx names.
14328 : Remove SIGARRAYSIZE used by HPUX.
14329 : Remove SIGSTKSIZE used by Linux.
14330 : Remove SIGSTKSZ used by Posix.
14331 : Remove SIGTYP void lines used by OS2.
14332 : Some cpps, like os390, dont give the file name anywhere
14333 if [ "X$fieldn" = X ]; then
14334 : Just make some guesses. We check them later.
14335 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
14337 xxx=`echo '#include <signal.h>' |
14338 $cppstdin $cppminus $cppflags 2>/dev/null |
14339 $grep '^[ ]*#.*include' |
14340 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq`
14342 : Check this list of files to be sure we have parsed the cpp output ok.
14343 : This will also avoid potentially non-existent files, such
14346 for xx in $xxx /dev/null ; do
14347 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
14349 : If we have found no files, at least try signal.h
14350 case "$xxxfiles" in
14351 '') xxxfiles=`./findhdr signal.h` ;;
14354 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
14355 print substr($2, 4, 20)
14357 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
14358 print substr($3, 4, 20)
14360 : Append some common names just in case the awk scan failed.
14361 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
14362 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
14363 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
14364 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
14365 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
14367 : generate a few handy files for later
14368 $cat > signal.c <<'EOCP'
14369 #include <sys/types.h>
14370 #include <signal.h>
14374 /* Strange style to avoid deeply-nested #if/#else/#endif */
14377 # define NSIG (_NSIG)
14383 # define NSIG (SIGMAX+1)
14389 # define NSIG (SIG_MAX+1)
14395 # define NSIG (MAXSIG+1)
14401 # define NSIG (MAX_SIG+1)
14406 # ifdef SIGARRAYSIZE
14407 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
14413 # define NSIG (_sys_nsig) /* Solaris 2.5 */
14417 /* Default to some arbitrary number that's big enough to get most
14418 of the common signals.
14424 printf("NSIG %d\n", NSIG);
14430 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
14432 printf "#ifdef SIG"; printf $1; printf "\n"
14433 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
14434 printf $1; printf ");\n"
14438 printf "#endif /* JUST_NSIG */\n";
14439 printf "exit(0);\n}\n";
14442 $cat >signal.awk <<'EOP'
14443 BEGIN { ndups = 0 }
14444 $1 ~ /^NSIG$/ { nsig = $2 }
14445 ($1 !~ /^NSIG$/) && (NF == 2) {
14446 if ($2 > maxsig) { maxsig = $2 }
14447 if (sig_name[$2]) {
14448 dup_name[ndups] = $1
14449 dup_num[ndups] = $2
14461 printf("NSIG %d\n", nsig);
14462 for (n = 1; n < nsig; n++) {
14464 printf("%s %d\n", sig_name[n], sig_num[n])
14467 printf("NUM%d %d\n", n, n)
14470 for (n = 0; n < ndups; n++) {
14471 printf("%s %d\n", dup_name[n], dup_num[n])
14475 $cat >signal_cmd <<EOS
14477 if $test -s signal.lst; then
14478 echo "Using your existing signal.lst file"
14483 $cat >>signal_cmd <<'EOS'
14486 if eval $compile_ok; then
14487 ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
14489 echo "(I can't seem be able to compile the whole test program)" >&4
14490 echo "(I'll try it in little pieces.)" >&4
14491 set signal -DJUST_NSIG
14492 if eval $compile_ok; then
14493 ./signal$_exe > signal.nsg
14496 echo "I can't seem to figure out how many signals you have." >&4
14497 echo "Guessing 50." >&4
14498 echo 'NSIG 50' > signal.nsg
14500 : Now look at all the signal names, one at a time.
14501 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
14502 $cat > signal.c <<EOCP
14503 #include <sys/types.h>
14504 #include <signal.h>
14507 printf("$xx %d\n", SIG${xx});
14512 if eval $compile; then
14513 echo "SIG${xx} found."
14514 ./signal$_exe >> signal.ls1
14516 echo "SIG${xx} NOT found."
14519 if $test -s signal.ls1; then
14520 $cat signal.nsg signal.ls1 |
14521 $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
14525 if $test -s signal.lst; then
14528 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
14529 echo 'kill -l' >signal
14530 set X `csh -f <signal`
14534 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
14536 echo $@ | $tr ' ' $trnl | \
14537 $awk '{ printf "%s %d\n", $1, ++s; }
14538 END { printf "NSIG %d\n", ++s }' >signal.lst
14540 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
14542 chmod a+x signal_cmd
14543 $eunicefix signal_cmd
14545 : generate list of signal names
14547 case "$sig_name_init" in
14549 *) case "$sig_num_init" in
14550 ''|*,*) doinit=yes ;;
14555 echo "Generating a list of signal names and numbers..." >&4
14557 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
14558 sig_name=`$awk 'BEGIN { printf "ZERO " }
14559 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
14560 sig_num=`$awk 'BEGIN { printf "0 " }
14561 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
14562 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
14563 !/^NSIG/ { printf "\"%s\", ", $1 }
14564 END { printf "0\n" }' signal.lst`
14565 sig_num_init=`$awk 'BEGIN { printf "0, " }
14566 !/^NSIG/ { printf "%d, ", $2}
14567 END { printf "0\n"}' signal.lst`
14570 echo "The following $sig_count signals are available:"
14572 echo $sig_name | $awk \
14573 'BEGIN { linelen = 0 }
14575 for (i = 1; i <= NF; i++) {
14576 name = "SIG" $i " "
14577 linelen = linelen + length(name)
14578 if (linelen > 70) {
14580 linelen = length(name)
14586 sig_size=`echo $sig_name | awk '{print NF}'`
14587 $rm -f signal signal.c signal.awk signal.lst signal_cmd
14590 case "$sizetype" in
14591 *_t) zzz="$sizetype" ;;
14592 *) zzz="filesize" ;;
14594 echo "Checking the size of $zzz..." >&4
14596 #include <sys/types.h>
14599 printf("%d\n", (int)sizeof($sizetype));
14604 if eval $compile_ok; then
14608 echo "(I can't execute the test program--guessing $sizesize.)" >&4
14611 echo "Your $zzz size is $sizesize bytes."
14616 echo "(I can't compile the test program--guessing $sizesize.)" >&4
14620 : check for socklen_t
14622 echo "Checking to see if you have socklen_t..." >&4
14624 #include <sys/types.h>
14625 #$d_socket HAS_SOCKET
14627 #include <sys/socket.h>
14629 int main() { socklen_t x = 16; }
14632 if eval $compile; then
14634 echo "You have socklen_t."
14637 echo "You do not have socklen_t."
14638 case "$sizetype" in
14639 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
14646 : see if this is a socks.h system
14647 set socks.h i_socks
14650 : check for type of the size argument to socket calls
14651 case "$d_socket" in
14655 Checking to see what type is the last argument of accept().
14658 case "$d_socklen_t" in
14659 "$define") yyy="$yyy socklen_t"
14661 yyy="$yyy $sizetype int long unsigned"
14662 for xxx in $yyy; do
14663 case "$socksizetype" in
14664 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
14665 case "$usesocks" in
14667 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
14668 echo "Your system accepts '$xxx *' for the last argument of accept()."
14669 socksizetype="$xxx"
14672 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
14673 echo "Your system accepts '$xxx *' for the last argument of accept()."
14674 socksizetype="$xxx"
14681 : In case none of those worked, prompt the user.
14682 case "$socksizetype" in
14683 '') rp='What is the type for socket address structure sizes?'
14690 *) : no sockets, so pick relatively harmless default
14695 : see what type is used for signed size_t
14696 set ssize_t ssizetype int stdio.h sys/types.h
14699 $cat > ssize.c <<EOM
14701 #include <sys/types.h>
14702 #define Size_t $sizetype
14703 #define SSize_t $dflt
14706 if (sizeof(Size_t) == sizeof(SSize_t))
14708 else if (sizeof(Size_t) == sizeof(int))
14717 if eval $compile_ok && ./ssize > /dev/null; then
14718 ssizetype=`./ssize`
14719 echo "I'll be using $ssizetype for functions returning a byte count." >&4
14722 Help! I can't compile and run the ssize_t test program: please enlighten me!
14723 (This is probably a misconfiguration in your system or libraries, and
14724 you really ought to fix it. Still, I'll try anyway.)
14726 I need a type that is the same size as $sizetype, but is guaranteed to
14727 be signed. Common values are ssize_t, int and long.
14730 rp="What signed type is the same size as $sizetype?"
14734 $rm -f ssize ssize.*
14736 : see what type of char stdio uses.
14738 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
14739 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
14740 echo "Your stdio uses unsigned chars." >&4
14741 stdchar="unsigned char"
14743 echo "Your stdio uses signed chars." >&4
14750 : see if time exists
14752 if test "X$d_time" = X -o X"$timetype" = X; then
14753 if set time val -f d_time; eval $csym; $val; then
14754 echo 'time() found.' >&4
14756 rp="What is the type returned by time() on this system?"
14757 set time_t timetype long stdio.h sys/types.h
14760 echo 'time() not found, hope that will do.' >&4
14768 : see what type uids are declared as in the kernel
14770 echo "Looking for the type for user ids returned by getuid()."
14771 set uid_t uidtype xxx stdio.h sys/types.h
14775 xxx=`./findhdr sys/user.h`
14776 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
14778 unsigned) dflt="$1 $2" ;;
14782 *) dflt="$uidtype";;
14785 uid_t) echo "uid_t found." ;;
14786 *) rp="What is the type for user ids returned by getuid()?"
14794 *_t) zzz="$uidtype" ;;
14797 echo "Checking the size of $zzz..." >&4
14799 #include <sys/types.h>
14802 printf("%d\n", (int)sizeof($uidtype));
14807 if eval $compile_ok; then
14811 echo "(I can't execute the test program--guessing $uidsize.)" >&4
14814 echo "Your $zzz is $uidsize bytes long."
14819 echo "(I can't compile the test program--guessing $uidsize.)" >&4
14824 *_t) zzz="$uidtype" ;;
14827 echo "Checking the sign of $zzz..." >&4
14829 #include <sys/types.h>
14840 if eval $compile; then
14844 echo "(I can't execute the test program--guessing unsigned.)" >&4
14848 1) echo "Your $zzz is unsigned." ;;
14849 -1) echo "Your $zzz is signed." ;;
14855 echo "(I can't compile the test program--guessing unsigned.)" >&4
14861 $echo "Checking the format string to be used for uids..." >&4
14864 -1) if $test X"$uidsize" = X"$ivsize"; then
14865 uidformat="$ivdformat"
14867 if $test X"$uidsize" = X"$longsize"; then
14870 if $test X"$uidsize" = X"$intsize"; then
14873 if $test X"$uidsize" = X"$shortsize"; then
14880 *) if $test X"$uidsize" = X"$uvsize"; then
14881 uidformat="$uvuformat"
14883 if $test X"$uidsize" = X"$longsize"; then
14886 if $test X"$uidsize" = X"$intsize"; then
14889 if $test X"$uidsize" = X"$shortsize"; then
14898 : see if dbm.h is available
14899 : see if dbmclose exists
14900 set dbmclose d_dbmclose
14903 case "$d_dbmclose" in
14913 *) set rpcsvc/dbm.h i_rpcsvcdbm
14918 *) echo "We won't be including <dbm.h>"
14928 : see if this is a sys/file.h system
14933 : do we need to include sys/file.h ?
14937 if $h_sysfile; then
14939 echo "We'll be including <sys/file.h>." >&4
14942 echo "We won't be including <sys/file.h>." >&4
14952 : see if fcntl.h is there
14957 : see if we can include fcntl.h
14963 echo "We'll be including <fcntl.h>." >&4
14966 if $h_sysfile; then
14967 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
14969 echo "We won't be including <fcntl.h>." >&4
14981 : see if this is a iconv.h system
14982 set iconv.h i_iconv
14985 : see if this is a ieeefp.h system
14986 set ieeefp.h i_ieeefp
14989 : see if this is a libutil.h system
14990 set libutil.h i_libutil
14993 : see if locale.h is available
14994 set locale.h i_locale
14997 : see if mach cthreads are available
14998 if test "X$usethreads" = "X$define"; then
14999 set mach/cthreads.h i_machcthr
15002 i_machcthr="$undef"
15007 : see if this is a math.h system
15011 : see if this is a mntent.h system
15012 set mntent.h i_mntent
15015 : see if ndbm.h is available
15020 : see if dbm_open exists
15021 set dbm_open d_dbm_open
15023 case "$d_dbm_open" in
15026 echo "We won't be including <ndbm.h>"
15035 : see if net/errno.h is available
15037 set net/errno.h val
15040 : Unfortunately, it causes problems on some systems. Arrgh.
15043 cat > try.c <<'EOM'
15046 #include <net/errno.h>
15052 if $cc $ccflags -c try.c >/dev/null 2>&1; then
15053 echo "We'll be including <net/errno.h>." >&4
15055 echo "We won't be including <net/errno.h>." >&4
15064 : see if netinet/tcp.h is available
15065 set netinet/tcp.h i_netinettcp
15068 : see if this is a poll.h system
15072 : see if this is a prot.h system
15077 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
15078 $cat <<'EOSH' > Cppsym.know
15079 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
15080 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
15081 alliant alpha am29000 AM29000 amiga AMIGAOS AMIX
15082 ansi ANSI_C_SOURCE apollo ardent atarist att386 att3b BeOS
15083 BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
15084 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
15085 bull c cadmus clipper CMU COFF COMPILER_VERSION
15086 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
15087 CYGWIN DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
15088 Dynix DynixPTX ELF encore EPI EXTENSIONS FILE_OFFSET_BITS
15089 FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
15090 GNU_SOURCE GNUC GNUC_MINOR GO32 gould GOULD_PN
15091 H3050R H3050RX hbullx20 hcx host_mips
15092 hp200 hp300 hp700 HP700 hp800 hp9000
15093 hp9000s200 hp9000s300 hp9000s400 hp9000s500
15094 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
15095 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
15096 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
15097 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
15098 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
15099 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
15100 Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
15101 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
15102 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
15103 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
15104 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
15105 MATH_HAS_NO_SIDE_EFFECTS
15106 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
15107 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
15108 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
15109 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
15110 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
15111 NetBSD news1500 news1700 news1800 news1900 news3700
15112 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
15113 ns32016 ns32332 ns32k nsc32000
15114 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
15115 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
15116 pc532 pdp11 PGC PIC plexus PORTAR posix
15117 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
15118 POSIX_C_SOURCE POSIX_SOURCE POWER
15119 PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
15120 riscix riscos RT scs SCO sequent sgi SGI_SOURCE sinix
15121 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
15122 sony sony_news sonyrisc sparc sparclite spectrum
15123 stardent stdc STDC_EXT stratos sun sun3 sun386
15124 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
15125 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
15126 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
15127 sysV68 sysV88 Tek4132 Tek4300 titan
15128 tower tower32 tower32_200 tower32_600 tower32_700
15129 tower32_800 tower32_850 tss
15130 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
15131 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
15132 unix UNIX95 UNIX99 unixpc unos USGr4 USGr4_2
15133 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms xenix Xenix286
15134 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
15135 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
15138 # Maybe put other stuff here too.
15139 cat <<EOSH >>Cppsym.know
15142 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
15143 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
15144 $cat Cppsym.know > Cppsym.c
15145 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
15146 $rm -f Cppsym.a Cppsym.b Cppsym.c
15147 cat <<EOSH > Cppsym
15149 if $test \$# -gt 0; then
15150 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
15151 if $test -s Cppsym.got; then
15158 $tr " " "$trnl" | ./Cppsym.try
15164 cat <<EOSH > Cppsym.try
15166 cat <<'EOCP' > try.c
15172 cat <<'EOSH' >> Cppsym.try
15174 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
15175 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
15176 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
15177 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
15181 cat <<EOSH >> Cppsym.try
15183 case "$osname-$gccversion" in
15184 irix-) ccflags="\$ccflags -woff 1178" ;;
15185 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
15187 $cc -o try $optimize \$ccflags $ldflags try.c $libs && ./try$exe_ext
15189 chmod +x Cppsym.try
15190 $eunicefix Cppsym.try
15191 ./Cppsym < Cppsym.know > Cppsym.true
15192 : now check the C compiler for additional symbols
15193 postprocess_cc_v=''
15195 aix) postprocess_cc_v="|$tr , ' '" ;;
15202 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
15205 -D*) echo "\$i" | $sed 's/^-D//';;
15206 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
15211 postprocess_cc_v=''
15214 ./ccsym > ccsym1.raw
15215 if $test -s ccsym1.raw; then
15216 $sort ccsym1.raw | $uniq >ccsym.raw
15218 mv ccsym1.raw ccsym.raw
15221 $awk '/\=/ { print $0; next }
15222 { print $0"=1" }' ccsym.raw >ccsym.list
15223 $awk '/\=/ { print $0; next }
15224 { print $0"=1" }' Cppsym.true >ccsym.true
15225 $comm -13 ccsym.true ccsym.list >ccsym.own
15226 $comm -12 ccsym.true ccsym.list >ccsym.com
15227 $comm -23 ccsym.true ccsym.list >ccsym.cpp
15229 if $test -z ccsym.raw; then
15230 echo "Your C compiler doesn't seem to define any symbols!" >&4
15232 echo "However, your C preprocessor defines the following symbols:"
15235 cppsymbols=`$cat Cppsym.true`
15236 cppsymbols=`echo $cppsymbols`
15237 cppccsymbols="$cppsymbols"
15239 if $test -s ccsym.com; then
15240 echo "Your C compiler and pre-processor define these symbols:"
15241 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
15244 cppccsymbols=`$cat ccsym.com`
15245 cppccsymbols=`echo $cppccsymbols`
15246 $test "$silent" || sleep 1
15248 if $test -s ccsym.cpp; then
15249 $test "$also" && echo " "
15250 echo "Your C pre-processor ${also}defines the following symbols:"
15251 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
15253 cppsymbols=`$cat ccsym.cpp`
15254 cppsymbols=`echo $cppsymbols`
15255 $test "$silent" || sleep 1
15257 if $test -s ccsym.own; then
15258 $test "$also" && echo " "
15259 echo "Your C compiler ${also}defines the following cpp symbols:"
15260 $sed -e 's/\(..*\)=1/\1/' ccsym.own
15261 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
15262 ccsymbols=`$cat ccsym.own`
15263 ccsymbols=`echo $ccsymbols`
15264 $test "$silent" || sleep 1
15267 $rm -f ccsym* Cppsym.*
15269 : see if this is a termio system
15273 if $test `./findhdr termios.h`; then
15274 set tcsetattr i_termios
15280 "$define") echo "You have POSIX termios.h... good!" >&4;;
15281 *) if ./Cppsym pyr; then
15282 case "`/bin/universe`" in
15283 ucb) if $test `./findhdr sgtty.h`; then
15285 echo "<sgtty.h> found." >&4
15287 echo "System is pyramid with BSD universe."
15288 echo "<sgtty.h> not found--you could have problems." >&4
15290 *) if $test `./findhdr termio.h`; then
15292 echo "<termio.h> found." >&4
15294 echo "System is pyramid with USG universe."
15295 echo "<termio.h> not found--you could have problems." >&4
15299 if $test `./findhdr termio.h`; then
15300 echo "<termio.h> found." >&4
15302 elif $test `./findhdr sgtty.h`; then
15303 echo "<sgtty.h> found." >&4
15306 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
15309 if $test `./findhdr sgtty.h`; then
15310 echo "<sgtty.h> found." >&4
15312 elif $test `./findhdr termio.h`; then
15313 echo "<termio.h> found." >&4
15316 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
15320 set i_termio; eval $setvar
15321 val=$val2; set i_sgtty; eval $setvar
15322 val=$val3; set i_termios; eval $setvar
15324 : see if this is a shadow.h system
15325 set shadow.h i_shadow
15328 : see if stddef is available
15329 set stddef.h i_stddef
15332 : see if this is a sunmath.h system
15333 set sunmath.h i_sunmath
15336 : see if sys/access.h is available
15337 set sys/access.h i_sysaccess
15340 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
15341 set sys/filio.h i_sysfilio
15344 if $test `./findhdr sys/ioctl.h`; then
15346 echo '<sys/ioctl.h> found.' >&4
15349 if $test $i_sysfilio = "$define"; then
15350 echo '<sys/ioctl.h> NOT found.' >&4
15352 $test $i_sgtty = "$define" && xxx="sgtty.h"
15353 $test $i_termio = "$define" && xxx="termio.h"
15354 $test $i_termios = "$define" && xxx="termios.h"
15355 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
15362 : see if this is a syslog.h system
15363 set syslog.h i_syslog
15367 : see if this is a sys/mode.h system
15368 set sys/mode.h i_sysmode
15371 : see if sys/resource.h has to be included
15372 set sys/resource.h i_sysresrc
15375 : see if sys/security.h is available
15376 set sys/security.h i_syssecrt
15379 : see if this is a sys/statvfs.h system
15380 set sys/statvfs.h i_sysstatvfs
15383 : see if this is a sys/uio.h system
15384 set sys/uio.h i_sysuio
15387 : see if this is a sys/un.h system
15388 set sys/un.h i_sysun
15392 : see if this is a sys/utsname.h system
15393 set sys/utsname.h i_sysutsname
15396 : see if this is a syswait system
15397 set sys/wait.h i_syswait
15400 : see if this is a ustat.h system
15401 set ustat.h i_ustat
15404 : see if this is an utime system
15405 set utime.h i_utime
15408 : see if this is a values.h system
15409 set values.h i_values
15412 : see if this is a vfork system
15415 set vfork.h i_vfork
15423 : see if gdbm.h is available
15428 : see if gdbm_open exists
15429 set gdbm_open d_gdbm_open
15431 case "$d_gdbm_open" in
15434 echo "We won't be including <gdbm.h>"
15444 echo "Looking for extensions..." >&4
15445 : If we are using the old config.sh, known_extensions may contain
15446 : old or inaccurate or duplicate values.
15447 known_extensions=''
15448 nonxs_extensions=''
15449 : We do not use find because it might not be available.
15450 : We do not just use MANIFEST because the user may have dropped
15451 : some additional extensions into the source tree and expect them
15454 : Function to recursively find available extensions, ignoring DynaLoader
15455 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
15459 DynaLoader|dynaload) ;;
15461 if $test -f $xxx/$xxx.xs; then
15462 known_extensions="$known_extensions $1$xxx";
15463 elif $test -f $xxx/Makefile.PL; then
15464 nonxs_extensions="$nonxs_extensions $1$xxx";
15466 if $test -d $xxx -a $# -lt 10; then
15469 eval $find_extensions;
15481 eval $find_extensions
15482 set X $nonxs_extensions
15484 nonxs_extensions="$*"
15485 set X $known_extensions
15487 known_extensions="$*"
15490 : Now see which are supported on this system.
15492 for xxx in $known_extensions ; do
15496 $define) avail_ext="$avail_ext $xxx" ;;
15499 GDBM_File|gdbm_fil)
15501 $define) avail_ext="$avail_ext $xxx" ;;
15504 NDBM_File|ndbm_fil)
15507 case "$osname-$use64bitint" in
15510 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
15513 *) avail_ext="$avail_ext $xxx" ;;
15518 ODBM_File|odbm_fil)
15519 case "${i_dbm}${i_rpcsvcdbm}" in
15521 case "$osname-$use64bitint" in
15524 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
15527 *) avail_ext="$avail_ext $xxx" ;;
15533 case "$useposix" in
15534 true|define|y) avail_ext="$avail_ext $xxx" ;;
15538 case "$useopcode" in
15539 true|define|y) avail_ext="$avail_ext $xxx" ;;
15543 case "$d_socket" in
15544 true|$define|y) avail_ext="$avail_ext $xxx" ;;
15547 Sys/Syslog|sys/syslog)
15548 : XXX syslog requires socket
15549 case "$d_socket" in
15550 true|$define|y) avail_ext="$avail_ext $xxx" ;;
15554 case "$usethreads" in
15555 true|$define|y) avail_ext="$avail_ext $xxx" ;;
15559 : XXX Do we need a useipcsysv variable here
15560 case "${d_msg}${d_sem}${d_shm}" in
15561 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
15564 *) avail_ext="$avail_ext $xxx"
15573 : Now see which nonxs extensions are supported on this system.
15574 : For now assume all are.
15576 for xxx in $nonxs_extensions ; do
15578 *) nonxs_ext="$nonxs_ext $xxx"
15590 A number of extensions are supplied with $package. You may choose to
15591 compile these extensions for dynamic loading (the default), compile
15592 them into the $package executable (static loading), or not include
15593 them at all. Answer "none" to include no extensions.
15594 Note that DynaLoader is always built and need not be mentioned here.
15597 case "$dynamic_ext" in
15598 '') dflt="$avail_ext" ;;
15599 *) dflt="$dynamic_ext"
15600 # Perhaps we are reusing an old out-of-date config.sh.
15603 if test X"$dynamic_ext" != X"$avail_ext"; then
15605 NOTICE: Your previous config.sh list may be incorrect.
15606 The extensions now available to you are
15608 but the default list from your previous config.sh is
15620 rp="What extensions do you wish to load dynamically?"
15623 none) dynamic_ext=' ' ;;
15624 *) dynamic_ext="$ans" ;;
15627 case "$static_ext" in
15629 : Exclude those already listed in dynamic linking
15631 for xxx in $avail_ext; do
15632 case " $dynamic_ext " in
15634 *) dflt="$dflt $xxx" ;;
15641 *) dflt="$static_ext"
15648 rp="What extensions do you wish to load statically?"
15651 none) static_ext=' ' ;;
15652 *) static_ext="$ans" ;;
15657 A number of extensions are supplied with $package. Answer "none"
15658 to include no extensions.
15659 Note that DynaLoader is always built and need not be mentioned here.
15662 case "$static_ext" in
15663 '') dflt="$avail_ext" ;;
15664 *) dflt="$static_ext"
15665 # Perhaps we are reusing an old out-of-date config.sh.
15668 if test X"$static_ext" != X"$avail_ext"; then
15670 NOTICE: Your previous config.sh list may be incorrect.
15671 The extensions now available to you are
15673 but the default list from your previous config.sh is
15682 : Exclude those that are not xs extensions
15686 rp="What extensions do you wish to include?"
15689 none) static_ext=' ' ;;
15690 *) static_ext="$ans" ;;
15695 set X $dynamic_ext $static_ext $nonxs_ext
15699 : Remove libraries needed only for extensions
15700 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
15701 : The exception is SunOS 4.x, which needs them.
15702 case "${osname}X${osvers}" in
15706 *) case "$usedl" in
15707 $define|true|[yY]*)
15708 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
15712 *) perllibs="$libs"
15718 : Remove build directory name from cppstdin so it can be used from
15719 : either the present location or the final installed location.
15721 : Get out of the UU directory to get correct path name.
15723 case "$cppstdin" in
15725 echo "Stripping down cppstdin path name"
15731 : end of configuration questions
15733 echo "End of configuration questions."
15736 : back to where it started
15737 if test -d ../UU; then
15741 : configuration may be patched via a 'config.over' file
15742 if $test -f config.over; then
15745 rp='I see a config.over file. Do you wish to load it?'
15748 n*) echo "OK, I'll ignore it.";;
15750 echo "Configuration override changes have been loaded."
15755 : in case they want portability, strip down executable paths
15756 case "$d_portable" in
15759 echo "Stripping down executable paths..." >&4
15760 for file in $loclist $trylist; do
15762 eval $file=`basename $temp`
15767 : create config.sh file
15769 echo "Creating config.sh..." >&4
15770 $spitshell <<EOT >config.sh
15773 # This file was produced by running the Configure script. It holds all the
15774 # definitions figured out by Configure. Should you modify one of these values,
15775 # do not forget to propagate your changes by running "Configure -der". You may
15776 # instead choose to run each of the .SH files by yourself, or "Configure -S".
15779 # Package name : $package
15780 # Source directory : $src
15781 # Configuration time: $cf_time
15782 # Configured by : $cf_by
15783 # Target system : $myuname
15793 Revision='$Revision'
15800 alignbytes='$alignbytes'
15801 ansi2knr='$ansi2knr'
15802 aphostname='$aphostname'
15803 api_revision='$api_revision'
15804 api_subversion='$api_subversion'
15805 api_version='$api_version'
15806 api_versionstring='$api_versionstring'
15809 archlibexp='$archlibexp'
15810 archname64='$archname64'
15811 archname='$archname'
15812 archobjs='$archobjs'
15817 bincompat5005='$bincompat5005'
15821 byteorder='$byteorder'
15823 castflags='$castflags'
15826 cccdlflags='$cccdlflags'
15827 ccdlflags='$ccdlflags'
15829 ccflags_uselargefiles='$ccflags_uselargefiles'
15831 ccsymbols='$ccsymbols'
15832 ccversion='$ccversion'
15834 cf_email='$cf_email'
15836 charsize='$charsize'
15840 clocktype='$clocktype'
15842 compress='$compress'
15843 contains='$contains'
15847 cpp_stuff='$cpp_stuff'
15848 cppccsymbols='$cppccsymbols'
15849 cppflags='$cppflags'
15851 cppminus='$cppminus'
15853 cppstdin='$cppstdin'
15854 cppsymbols='$cppsymbols'
15855 crosscompile='$crosscompile'
15856 cryptlib='$cryptlib'
15858 d_Gconvert='$d_Gconvert'
15859 d_PRIEUldbl='$d_PRIEUldbl'
15860 d_PRIFUldbl='$d_PRIFUldbl'
15861 d_PRIGUldbl='$d_PRIGUldbl'
15862 d_PRIXU64='$d_PRIXU64'
15863 d_PRId64='$d_PRId64'
15864 d_PRIeldbl='$d_PRIeldbl'
15865 d_PRIfldbl='$d_PRIfldbl'
15866 d_PRIgldbl='$d_PRIgldbl'
15867 d_PRIi64='$d_PRIi64'
15868 d_PRIo64='$d_PRIo64'
15869 d_PRIu64='$d_PRIu64'
15870 d_PRIx64='$d_PRIx64'
15871 d_SCNfldbl='$d_SCNfldbl'
15872 d__fwalk='$d__fwalk'
15873 d_access='$d_access'
15874 d_accessx='$d_accessx'
15876 d_archlib='$d_archlib'
15879 d_attribut='$d_attribut'
15882 d_bincompat5005='$d_bincompat5005'
15884 d_bsdgetpgrp='$d_bsdgetpgrp'
15885 d_bsdsetpgrp='$d_bsdsetpgrp'
15887 d_casti32='$d_casti32'
15888 d_castneg='$d_castneg'
15889 d_charvspr='$d_charvspr'
15891 d_chroot='$d_chroot'
15892 d_chsize='$d_chsize'
15893 d_closedir='$d_closedir'
15897 d_cuserid='$d_cuserid'
15898 d_dbl_dig='$d_dbl_dig'
15899 d_difftime='$d_difftime'
15900 d_dirnamlen='$d_dirnamlen'
15901 d_dlerror='$d_dlerror'
15902 d_dlopen='$d_dlopen'
15903 d_dlsymun='$d_dlsymun'
15904 d_dosuid='$d_dosuid'
15905 d_drand48proto='$d_drand48proto'
15907 d_eaccess='$d_eaccess'
15908 d_endgrent='$d_endgrent'
15909 d_endhent='$d_endhent'
15910 d_endnent='$d_endnent'
15911 d_endpent='$d_endpent'
15912 d_endpwent='$d_endpwent'
15913 d_endsent='$d_endsent'
15914 d_eofnblk='$d_eofnblk'
15915 d_eunice='$d_eunice'
15916 d_fchmod='$d_fchmod'
15917 d_fchown='$d_fchown'
15919 d_fcntl_can_lock='$d_fcntl_can_lock'
15920 d_fd_macros='$d_fd_macros'
15921 d_fd_set='$d_fd_set'
15922 d_fds_bits='$d_fds_bits'
15923 d_fgetpos='$d_fgetpos'
15924 d_flexfnam='$d_flexfnam'
15927 d_fpathconf='$d_fpathconf'
15928 d_fpos64_t='$d_fpos64_t'
15929 d_frexpl='$d_frexpl'
15930 d_fs_data_s='$d_fs_data_s'
15931 d_fseeko='$d_fseeko'
15932 d_fsetpos='$d_fsetpos'
15933 d_fstatfs='$d_fstatfs'
15934 d_fstatvfs='$d_fstatvfs'
15936 d_ftello='$d_ftello'
15938 d_getcwd='$d_getcwd'
15939 d_getespwnam='$d_getespwnam'
15940 d_getfsstat='$d_getfsstat'
15941 d_getgrent='$d_getgrent'
15942 d_getgrps='$d_getgrps'
15943 d_gethbyaddr='$d_gethbyaddr'
15944 d_gethbyname='$d_gethbyname'
15945 d_gethent='$d_gethent'
15946 d_gethname='$d_gethname'
15947 d_gethostprotos='$d_gethostprotos'
15948 d_getlogin='$d_getlogin'
15949 d_getmnt='$d_getmnt'
15950 d_getmntent='$d_getmntent'
15951 d_getnbyaddr='$d_getnbyaddr'
15952 d_getnbyname='$d_getnbyname'
15953 d_getnent='$d_getnent'
15954 d_getnetprotos='$d_getnetprotos'
15955 d_getpagsz='$d_getpagsz'
15956 d_getpbyname='$d_getpbyname'
15957 d_getpbynumber='$d_getpbynumber'
15958 d_getpent='$d_getpent'
15959 d_getpgid='$d_getpgid'
15960 d_getpgrp2='$d_getpgrp2'
15961 d_getpgrp='$d_getpgrp'
15962 d_getppid='$d_getppid'
15963 d_getprior='$d_getprior'
15964 d_getprotoprotos='$d_getprotoprotos'
15965 d_getprpwnam='$d_getprpwnam'
15966 d_getpwent='$d_getpwent'
15967 d_getsbyname='$d_getsbyname'
15968 d_getsbyport='$d_getsbyport'
15969 d_getsent='$d_getsent'
15970 d_getservprotos='$d_getservprotos'
15971 d_getspnam='$d_getspnam'
15972 d_gettimeod='$d_gettimeod'
15973 d_gnulibc='$d_gnulibc'
15974 d_grpasswd='$d_grpasswd'
15975 d_hasmntopt='$d_hasmntopt'
15979 d_inetaton='$d_inetaton'
15980 d_int64_t='$d_int64_t'
15981 d_isascii='$d_isascii'
15983 d_isnanl='$d_isnanl'
15984 d_killpg='$d_killpg'
15985 d_lchown='$d_lchown'
15986 d_ldbl_dig='$d_ldbl_dig'
15988 d_locconv='$d_locconv'
15990 d_longdbl='$d_longdbl'
15991 d_longlong='$d_longlong'
15992 d_lseekproto='$d_lseekproto'
15994 d_madvise='$d_madvise'
15996 d_mbstowcs='$d_mbstowcs'
15997 d_mbtowc='$d_mbtowc'
15998 d_memchr='$d_memchr'
15999 d_memcmp='$d_memcmp'
16000 d_memcpy='$d_memcpy'
16001 d_memmove='$d_memmove'
16002 d_memset='$d_memset'
16004 d_mkdtemp='$d_mkdtemp'
16005 d_mkfifo='$d_mkfifo'
16006 d_mkstemp='$d_mkstemp'
16007 d_mkstemps='$d_mkstemps'
16008 d_mktime='$d_mktime'
16011 d_mprotect='$d_mprotect'
16013 d_msg_ctrunc='$d_msg_ctrunc'
16014 d_msg_dontroute='$d_msg_dontroute'
16015 d_msg_oob='$d_msg_oob'
16016 d_msg_peek='$d_msg_peek'
16017 d_msg_proxy='$d_msg_proxy'
16018 d_msgctl='$d_msgctl'
16019 d_msgget='$d_msgget'
16020 d_msgrcv='$d_msgrcv'
16021 d_msgsnd='$d_msgsnd'
16023 d_munmap='$d_munmap'
16024 d_mymalloc='$d_mymalloc'
16026 d_nv_preserves_uv='$d_nv_preserves_uv'
16027 d_nv_preserves_uv_bits='$d_nv_preserves_uv_bits'
16028 d_off64_t='$d_off64_t'
16029 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
16030 d_oldpthreads='$d_oldpthreads'
16031 d_oldsock='$d_oldsock'
16033 d_pathconf='$d_pathconf'
16035 d_perl_otherlibdirs='$d_perl_otherlibdirs'
16036 d_phostname='$d_phostname'
16039 d_portable='$d_portable'
16040 d_pthread_yield='$d_pthread_yield'
16042 d_pwchange='$d_pwchange'
16043 d_pwclass='$d_pwclass'
16044 d_pwcomment='$d_pwcomment'
16045 d_pwexpire='$d_pwexpire'
16046 d_pwgecos='$d_pwgecos'
16047 d_pwpasswd='$d_pwpasswd'
16048 d_pwquota='$d_pwquota'
16051 d_readdir='$d_readdir'
16052 d_readlink='$d_readlink'
16053 d_rename='$d_rename'
16054 d_rewinddir='$d_rewinddir'
16056 d_safebcpy='$d_safebcpy'
16057 d_safemcpy='$d_safemcpy'
16058 d_sanemcmp='$d_sanemcmp'
16059 d_sbrkproto='$d_sbrkproto'
16060 d_sched_yield='$d_sched_yield'
16061 d_scm_rights='$d_scm_rights'
16062 d_seekdir='$d_seekdir'
16063 d_select='$d_select'
16065 d_semctl='$d_semctl'
16066 d_semctl_semid_ds='$d_semctl_semid_ds'
16067 d_semctl_semun='$d_semctl_semun'
16068 d_semget='$d_semget'
16070 d_setegid='$d_setegid'
16071 d_seteuid='$d_seteuid'
16072 d_setgrent='$d_setgrent'
16073 d_setgrps='$d_setgrps'
16074 d_sethent='$d_sethent'
16075 d_setlinebuf='$d_setlinebuf'
16076 d_setlocale='$d_setlocale'
16077 d_setnent='$d_setnent'
16078 d_setpent='$d_setpent'
16079 d_setpgid='$d_setpgid'
16080 d_setpgrp2='$d_setpgrp2'
16081 d_setpgrp='$d_setpgrp'
16082 d_setprior='$d_setprior'
16083 d_setproctitle='$d_setproctitle'
16084 d_setpwent='$d_setpwent'
16085 d_setregid='$d_setregid'
16086 d_setresgid='$d_setresgid'
16087 d_setresuid='$d_setresuid'
16088 d_setreuid='$d_setreuid'
16089 d_setrgid='$d_setrgid'
16090 d_setruid='$d_setruid'
16091 d_setsent='$d_setsent'
16092 d_setsid='$d_setsid'
16093 d_setvbuf='$d_setvbuf'
16097 d_shmatprototype='$d_shmatprototype'
16098 d_shmctl='$d_shmctl'
16100 d_shmget='$d_shmget'
16101 d_sigaction='$d_sigaction'
16102 d_sigprocmask='$d_sigprocmask'
16103 d_sigsetjmp='$d_sigsetjmp'
16104 d_socket='$d_socket'
16105 d_socklen_t='$d_socklen_t'
16106 d_sockpair='$d_sockpair'
16107 d_socks5_init='$d_socks5_init'
16109 d_statblks='$d_statblks'
16110 d_statfs_f_flags='$d_statfs_f_flags'
16111 d_statfs_s='$d_statfs_s'
16112 d_statvfs='$d_statvfs'
16113 d_stdio_cnt_lval='$d_stdio_cnt_lval'
16114 d_stdio_ptr_lval='$d_stdio_ptr_lval'
16115 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
16116 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
16117 d_stdio_stream_array='$d_stdio_stream_array'
16118 d_stdiobase='$d_stdiobase'
16119 d_stdstdio='$d_stdstdio'
16120 d_strchr='$d_strchr'
16121 d_strcoll='$d_strcoll'
16122 d_strctcpy='$d_strctcpy'
16123 d_strerrm='$d_strerrm'
16124 d_strerror='$d_strerror'
16125 d_strtod='$d_strtod'
16126 d_strtol='$d_strtol'
16127 d_strtold='$d_strtold'
16128 d_strtoll='$d_strtoll'
16129 d_strtoq='$d_strtoq'
16130 d_strtoul='$d_strtoul'
16131 d_strtoull='$d_strtoull'
16132 d_strtouq='$d_strtouq'
16133 d_strxfrm='$d_strxfrm'
16134 d_suidsafe='$d_suidsafe'
16135 d_symlink='$d_symlink'
16136 d_syscall='$d_syscall'
16137 d_sysconf='$d_sysconf'
16138 d_sysernlst='$d_sysernlst'
16139 d_syserrlst='$d_syserrlst'
16140 d_system='$d_system'
16141 d_tcgetpgrp='$d_tcgetpgrp'
16142 d_tcsetpgrp='$d_tcsetpgrp'
16143 d_telldir='$d_telldir'
16144 d_telldirproto='$d_telldirproto'
16147 d_truncate='$d_truncate'
16148 d_tzname='$d_tzname'
16151 d_union_semun='$d_union_semun'
16153 d_vendorarch='$d_vendorarch'
16154 d_vendorbin='$d_vendorbin'
16155 d_vendorlib='$d_vendorlib'
16157 d_void_closedir='$d_void_closedir'
16158 d_voidsig='$d_voidsig'
16159 d_voidtty='$d_voidtty'
16160 d_volatile='$d_volatile'
16161 d_vprintf='$d_vprintf'
16163 d_waitpid='$d_waitpid'
16164 d_wcstombs='$d_wcstombs'
16165 d_wctomb='$d_wctomb'
16168 db_hashtype='$db_hashtype'
16169 db_prefixtype='$db_prefixtype'
16170 defvoidused='$defvoidused'
16171 direntrytype='$direntrytype'
16174 doublesize='$doublesize'
16176 dynamic_ext='$dynamic_ext'
16182 eunicefix='$eunicefix'
16185 extensions='$extensions'
16186 fflushNULL='$fflushNULL'
16187 fflushall='$fflushall'
16189 firstmakefile='$firstmakefile'
16191 fpossize='$fpossize'
16192 fpostype='$fpostype'
16193 freetype='$freetype'
16195 full_csh='$full_csh'
16196 full_sed='$full_sed'
16197 gccosandvers='$gccosandvers'
16198 gccversion='$gccversion'
16199 gidformat='$gidformat'
16205 groupcat='$groupcat'
16206 groupstype='$groupstype'
16209 h_sysfile='$h_sysfile'
16220 i_arpainet='$i_arpainet'
16221 i_bsdioctl='$i_bsdioctl'
16224 i_dirent='$i_dirent'
16232 i_ieeefp='$i_ieeefp'
16233 i_inttypes='$i_inttypes'
16234 i_libutil='$i_libutil'
16235 i_limits='$i_limits'
16236 i_locale='$i_locale'
16237 i_machcthr='$i_machcthr'
16238 i_malloc='$i_malloc'
16240 i_memory='$i_memory'
16241 i_mntent='$i_mntent'
16244 i_neterrno='$i_neterrno'
16245 i_netinettcp='$i_netinettcp'
16249 i_pthread='$i_pthread'
16251 i_rpcsvcdbm='$i_rpcsvcdbm'
16254 i_shadow='$i_shadow'
16256 i_stdarg='$i_stdarg'
16257 i_stddef='$i_stddef'
16258 i_stdlib='$i_stdlib'
16259 i_string='$i_string'
16260 i_sunmath='$i_sunmath'
16261 i_sysaccess='$i_sysaccess'
16262 i_sysdir='$i_sysdir'
16263 i_sysfile='$i_sysfile'
16264 i_sysfilio='$i_sysfilio'
16266 i_sysioctl='$i_sysioctl'
16267 i_syslog='$i_syslog'
16268 i_sysmman='$i_sysmman'
16269 i_sysmode='$i_sysmode'
16270 i_sysmount='$i_sysmount'
16271 i_sysndir='$i_sysndir'
16272 i_sysparam='$i_sysparam'
16273 i_sysresrc='$i_sysresrc'
16274 i_syssecrt='$i_syssecrt'
16275 i_sysselct='$i_sysselct'
16276 i_syssockio='$i_syssockio'
16277 i_sysstat='$i_sysstat'
16278 i_sysstatfs='$i_sysstatfs'
16279 i_sysstatvfs='$i_sysstatvfs'
16280 i_systime='$i_systime'
16281 i_systimek='$i_systimek'
16282 i_systimes='$i_systimes'
16283 i_systypes='$i_systypes'
16284 i_sysuio='$i_sysuio'
16286 i_sysutsname='$i_sysutsname'
16287 i_sysvfs='$i_sysvfs'
16288 i_syswait='$i_syswait'
16289 i_termio='$i_termio'
16290 i_termios='$i_termios'
16292 i_unistd='$i_unistd'
16295 i_values='$i_values'
16296 i_varargs='$i_varargs'
16297 i_varhdr='$i_varhdr'
16299 ignore_versioned_solibs='$ignore_versioned_solibs'
16300 inc_version_list='$inc_version_list'
16301 inc_version_list_init='$inc_version_list_init'
16304 installarchlib='$installarchlib'
16305 installbin='$installbin'
16306 installman1dir='$installman1dir'
16307 installman3dir='$installman3dir'
16308 installprefix='$installprefix'
16309 installprefixexp='$installprefixexp'
16310 installprivlib='$installprivlib'
16311 installscript='$installscript'
16312 installsitearch='$installsitearch'
16313 installsitebin='$installsitebin'
16314 installsitelib='$installsitelib'
16315 installstyle='$installstyle'
16316 installusrbinperl='$installusrbinperl'
16317 installvendorarch='$installvendorarch'
16318 installvendorbin='$installvendorbin'
16319 installvendorlib='$installvendorlib'
16321 issymlink='$issymlink'
16322 ivdformat='$ivdformat'
16325 known_extensions='$known_extensions'
16328 lddlflags='$lddlflags'
16330 ldflags_uselargefiles='$ldflags_uselargefiles'
16331 ldlibpthname='$ldlibpthname'
16338 libsdirs='$libsdirs'
16339 libsfiles='$libsfiles'
16340 libsfound='$libsfound'
16341 libspath='$libspath'
16342 libswanted='$libswanted'
16343 libswanted_uselargefiles='$libswanted_uselargefiles'
16349 locincpth='$locincpth'
16350 loclibpth='$loclibpth'
16351 longdblsize='$longdblsize'
16352 longlongsize='$longlongsize'
16353 longsize='$longsize'
16357 lseeksize='$lseeksize'
16358 lseektype='$lseektype'
16362 make_set_make='$make_set_make'
16363 mallocobj='$mallocobj'
16364 mallocsrc='$mallocsrc'
16365 malloctype='$malloctype'
16367 man1direxp='$man1direxp'
16370 man3direxp='$man3direxp'
16372 mips_type='$mips_type'
16374 mmaptype='$mmaptype'
16375 modetype='$modetype'
16377 multiarch='$multiarch'
16379 myarchname='$myarchname'
16380 mydomain='$mydomain'
16381 myhostname='$myhostname'
16384 need_va_copy='$need_va_copy'
16385 netdb_hlen_type='$netdb_hlen_type'
16386 netdb_host_type='$netdb_host_type'
16387 netdb_name_type='$netdb_name_type'
16388 netdb_net_type='$netdb_net_type'
16391 nm_so_opt='$nm_so_opt'
16392 nonxs_ext='$nonxs_ext'
16394 nvEUformat='$nvEUformat'
16395 nvFUformat='$nvFUformat'
16396 nvGUformat='$nvGUformat'
16397 nveformat='$nveformat'
16398 nvfformat='$nvfformat'
16399 nvgformat='$nvgformat'
16402 o_nonblock='$o_nonblock'
16404 old_pthread_create_joinable='$old_pthread_create_joinable'
16405 optimize='$optimize'
16406 orderlib='$orderlib'
16409 otherlibdirs='$otherlibdirs'
16413 patchlevel='$patchlevel'
16414 path_sep='$path_sep'
16417 perladmin='$perladmin'
16418 perllibs='$perllibs'
16419 perlpath='$perlpath'
16421 phostname='$phostname'
16424 pm_apiversion='$pm_apiversion'
16428 prefixexp='$prefixexp'
16430 privlibexp='$privlibexp'
16431 prototype='$prototype'
16433 quadkind='$quadkind'
16434 quadtype='$quadtype'
16435 randbits='$randbits'
16436 randfunc='$randfunc'
16437 randseedtype='$randseedtype'
16439 rd_nodata='$rd_nodata'
16440 revision='$revision'
16444 sPRIEUldbl='$sPRIEUldbl'
16445 sPRIFUldbl='$sPRIFUldbl'
16446 sPRIGUldbl='$sPRIGUldbl'
16447 sPRIXU64='$sPRIXU64'
16449 sPRIeldbl='$sPRIeldbl'
16450 sPRIfldbl='$sPRIfldbl'
16451 sPRIgldbl='$sPRIgldbl'
16456 sSCNfldbl='$sSCNfldbl'
16457 sched_yield='$sched_yield'
16458 scriptdir='$scriptdir'
16459 scriptdirexp='$scriptdirexp'
16461 seedfunc='$seedfunc'
16462 selectminbits='$selectminbits'
16463 selecttype='$selecttype'
16464 sendmail='$sendmail'
16467 sharpbang='$sharpbang'
16468 shmattype='$shmattype'
16469 shortsize='$shortsize'
16472 sig_count='$sig_count'
16473 sig_name='$sig_name'
16474 sig_name_init='$sig_name_init'
16476 sig_num_init='$sig_num_init'
16477 sig_size='$sig_size'
16478 signal_t='$signal_t'
16479 sitearch='$sitearch'
16480 sitearchexp='$sitearchexp'
16482 sitebinexp='$sitebinexp'
16484 sitelib_stem='$sitelib_stem'
16485 sitelibexp='$sitelibexp'
16486 siteprefix='$siteprefix'
16487 siteprefixexp='$siteprefixexp'
16488 sizesize='$sizesize'
16489 sizetype='$sizetype'
16493 sockethdr='$sockethdr'
16494 socketlib='$socketlib'
16495 socksizetype='$socksizetype'
16497 spackage='$spackage'
16498 spitshell='$spitshell'
16500 ssizetype='$ssizetype'
16501 startperl='$startperl'
16503 static_ext='$static_ext'
16505 stdio_base='$stdio_base'
16506 stdio_bufsiz='$stdio_bufsiz'
16507 stdio_cnt='$stdio_cnt'
16508 stdio_filbuf='$stdio_filbuf'
16509 stdio_ptr='$stdio_ptr'
16510 stdio_stream_array='$stdio_stream_array'
16513 subversion='$subversion'
16520 timeincl='$timeincl'
16521 timetype='$timetype'
16534 uidformat='$uidformat'
16540 uquadtype='$uquadtype'
16541 use5005threads='$use5005threads'
16542 use64bitall='$use64bitall'
16543 use64bitint='$use64bitint'
16545 useithreads='$useithreads'
16546 uselargefiles='$uselargefiles'
16547 uselongdouble='$uselongdouble'
16548 usemorebits='$usemorebits'
16549 usemultiplicity='$usemultiplicity'
16550 usemymalloc='$usemymalloc'
16552 useopcode='$useopcode'
16553 useperlio='$useperlio'
16554 useposix='$useposix'
16556 useshrplib='$useshrplib'
16557 usesocks='$usesocks'
16558 usethreads='$usethreads'
16559 usevendorprefix='$usevendorprefix'
16560 usevfork='$usevfork'
16563 uvXUformat='$uvXUformat'
16564 uvoformat='$uvoformat'
16567 uvuformat='$uvuformat'
16568 uvxformat='$uvxformat'
16569 vendorarch='$vendorarch'
16570 vendorarchexp='$vendorarchexp'
16571 vendorbin='$vendorbin'
16572 vendorbinexp='$vendorbinexp'
16573 vendorlib='$vendorlib'
16574 vendorlib_stem='$vendorlib_stem'
16575 vendorlibexp='$vendorlibexp'
16576 vendorprefix='$vendorprefix'
16577 vendorprefixexp='$vendorprefixexp'
16579 versiononly='$versiononly'
16581 voidflags='$voidflags'
16583 xs_apiversion='$xs_apiversion'
16588 : Add in command line options if available
16589 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
16591 : add special variables
16592 $test -f $src/patchlevel.h && \
16593 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
16594 echo "CONFIGDOTSH=true" >>config.sh
16596 : propagate old symbols
16597 if $test -f UU/config.sh; then
16598 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
16599 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
16600 $sort | $uniq -u >UU/oldsyms
16601 set X `cat UU/oldsyms`
16607 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
16609 echo "# Variables propagated from previous config.sh file." >>config.sh
16610 for sym in `cat UU/oldsyms`; do
16611 echo " Propagating $hint variable "'$'"$sym..."
16612 eval 'tmp="$'"${sym}"'"'
16614 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
16620 : Finish up by extracting the .SH files
16634 If you'd like to make any changes to the config.sh file before I begin
16635 to configure things, do it as a shell escape now (e.g. !vi config.sh).
16638 rp="Press return or use a shell escape to edit config.sh:"
16643 *) : in case they cannot read
16644 sh 1>&4 -c "$ans";;
16649 : if this fails, just run all the .SH files by hand
16656 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
16663 Now you need to generate make dependencies by running "$make depend".
16664 You might prefer to run it in background: "$make depend > makedepend.out &"
16665 It can take a while, so you might not want to run it right now.
16670 rp="Run $make depend now?"
16674 $make depend && echo "Now you must run '$make'."
16677 echo "You must run '$make depend' then '$make'."
16680 elif test -f [Mm]akefile; then
16682 echo "Now you must run a $make."
16687 if $test -f Policy.sh; then
16690 If you compile $package on a different machine or from a different object
16691 directory, copy the Policy.sh file from this object directory to the
16692 new one before you run Configure -- this will help you with most of
16693 the policy defaults.
16697 if $test -f config.msg; then
16698 echo "Hmm. I also noted the following information while running:"
16700 $cat config.msg >&4
16703 $rm -f kit*isdone ark*isdone