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 # Though this script was generated by metaconfig, it is OK to send
22 # patches against it. It's up to the Configure pumpkin to backport
23 # the patch to the metaunits if it is accepted.
24 # See Porting/pumpkin.pod for more information on metaconfig.
27 # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
29 # Generated on Tue Jul 19 13:22:25 CEST 2005 [metaconfig 3.0 PL70]
30 # (with additional metaconfig patches by perlbug@perl.org)
35 SCO csh still thinks true is false. Write to SCO today and tell them that next
36 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
38 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
39 we'd have to do is go in and swap the && and || tokens, wherever they are.)
41 [End of diatribe. We now return you to your regularly scheduled programming...]
45 OOPS! You naughty creature! You didn't run Configure with sh!
46 I will attempt to remedy the situation by running sh for you...
50 true || exec sh $0 $argv:q
52 (exit $?0) || cat c2$$
53 (exit $?0) || exec sh $0 $argv:q
56 if test -f /dev/cputype -a -f /dev/drivers -a -f /dev/osversion; then
59 *** I'm sorry but this system looks like Plan 9 and Plan 9 doesn't do
60 *** Configure that well. (Plan 9 is close to UNIX but not close enough.)
61 *** Please read the README.plan9 for further instructions.
62 *** Cannot continue, aborting.
68 : compute my invocation name
72 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
77 : Proper separator for the PATH environment variable
79 : On OS/2 this directory should exist if this is not floppy only system :-]
80 if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' ) 2>&1 >/dev/null ; then
81 if test -n "$OS2_SHELL"; then
83 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
84 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
86 elif test -n "$DJGPP"; then
87 case "X${MACHTYPE:-nonesuchmach}" in
95 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
96 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
97 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
98 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
99 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
100 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
101 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
102 paths="$paths /sbin /usr/sbin /usr/libexec"
103 paths="$paths /system/gnu_library/bin"
107 case "$p_$PATH$p_" in
109 *) test -d $p && PATH=$PATH$p_$p ;;
116 : shall we be using ksh?
122 if (PATH=.; alias -x) >/dev/null 2>&1; then
125 if test -f /hp-ux -a -f /bin/ksh; then
126 needksh='to avoid sh bug in "here document" expansion'
128 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
129 if test X`/usr/bin/uname -v` = X4; then
130 avoidksh="to avoid AIX 4's /bin/sh"
134 if test -f /osf_boot -a -f /usr/sbin/setld; then
135 if test X`/usr/bin/uname -s` = XOSF1; then
136 avoidksh="to avoid Digital UNIX' ksh"
138 unset BIN_SH # if this is 'xpg4' sh will start up ksh
141 case "$inksh/$needksh" in
148 case "$inksh/$avoidksh" in
154 case "$inksh/$needksh-$avoidksh-" in
157 (I see you are using the Korn shell. Some ksh's blow up on $me,
158 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
165 echo "(Feeding myself to $newsh $reason.)"
167 Configure|*/Configure) exec $newsh $0 "$@";;
168 *) exec $newsh Configure "$@";;
173 : if needed set CDPATH to a harmless value that is not chatty
174 : avoid bash 2.02 problems with empty CDPATH.
178 *bash*) CDPATH='.' ;;
183 : Configure runs within the UU subdirectory
184 test -d UU || mkdir UU
348 d_attribute_format=''
349 d_attribute_malloc=''
350 d_attribute_nonnull=''
351 d_attribute_noreturn=''
353 d_attribute_unused=''
354 d_attribute_warn_unused_result=''
400 endhostent_r_proto=''
406 endprotoent_r_proto=''
412 endservent_r_proto=''
463 gethostbyaddr_r_proto=''
465 gethostbyname_r_proto=''
467 gethostent_r_proto=''
479 getnetbyaddr_r_proto=''
481 getnetbyname_r_proto=''
495 d_getprotobyname_r=''
496 getprotobyname_r_proto=''
497 d_getprotobynumber_r=''
498 getprotobynumber_r_proto=''
500 getprotoent_r_proto=''
512 getservbyname_r_proto=''
514 getservbyport_r_proto=''
516 getservent_r_proto=''
540 d_libm_lib_version=''
593 d_old_pthread_create_joinable=''
594 old_pthread_create_joinable=''
596 d_pthread_attr_setscope=''
635 sethostent_r_proto=''
652 setprotoent_r_proto=''
664 setservent_r_proto=''
709 d_stdio_ptr_lval_nochange_cnt=''
710 d_stdio_ptr_lval_sets_cnt=''
913 inc_version_list_init=''
932 ignore_versioned_solibs=''
992 d_perl_otherlibdirs=''
1000 api_versionstring=''
1006 version_patchlevel_string=''
1010 d_nv_preserves_uv=''
1011 d_nv_zero_is_allbits_zero=''
1022 nv_preserves_uv_bits=''
1093 installsitehtml1dir=''
1096 installsitehtml3dir=''
1103 installsiteman1dir=''
1106 installsiteman3dir=''
1111 installsitescript=''
1126 d_stdio_stream_array=''
1127 stdio_stream_array=''
1138 ccflags_uselargefiles=''
1139 ldflags_uselargefiles=''
1140 libswanted_uselargefiles=''
1150 userelocatableinc=''
1161 installvendorarch=''
1168 installvendorhtml1dir=''
1170 vendorhtml1direxp=''
1171 installvendorhtml3dir=''
1173 vendorhtml3direxp=''
1179 installvendorman1dir=''
1182 installvendorman3dir=''
1189 installvendorscript=''
1201 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1204 : We must find out about Eunice early
1206 if test -f /etc/unixtovms; then
1207 eunicefix=/etc/unixtovms
1209 if test -f /etc/unixtovms.exe; then
1210 eunicefix=/etc/unixtovms.exe
1213 : Set executable suffix now -- needed before hints available
1214 if test -f "/libs/version.library"; then
1217 elif test -f "/system/gnu_library/bin/ar.pm"; then
1220 elif test -n "$DJGPP"; then
1223 elif test -d c:/. -o -n "$is_os2" ; then
1232 : set useposix=false in your hint file to disable the POSIX extension.
1234 : set useopcode=false in your hint file to disable the Opcode extension.
1236 : Trailing extension. Override this in a hint file, if needed.
1237 : Extra object files, if any, needed on this platform.
1240 : Possible local include directories to search.
1241 : Set locincpth to "" in a hint file to defeat local include searches.
1242 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1243 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1245 : no include file wanted by default
1250 : change the next line if compiling for Xenix/286 on Xenix/386
1251 xlibpth='/usr/lib/386 /lib/386'
1252 : Possible local library directories to search.
1253 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1254 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1256 : general looking path for locating libraries
1257 glibpth="/lib /usr/lib $xlibpth"
1258 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1259 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1260 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1262 : Private path used by Configure to find libraries. Its value
1263 : is prepended to libpth. This variable takes care of special
1264 : machines, like the mips. Usually, it should be empty.
1267 : default library list
1269 : some systems want to use only the non-versioned libso:s
1270 ignore_versioned_solibs=''
1275 ccflags_uselargefiles=''
1276 ldflags_uselargefiles=''
1277 libswanted_uselargefiles=''
1278 : set usemultiplicity on the Configure command line to enable multiplicity.
1279 : set usesocks on the Configure command line to enable socks.
1280 : set usethreads on the Configure command line to enable threads.
1281 usereentrant='undef'
1282 : full support for void wanted by default
1285 : List of libraries we want.
1286 : If anyone needs extra -lxxx, put those in a hint file.
1287 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1288 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1289 : We probably want to search /usr/shlib before most other libraries.
1290 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1291 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1292 glibpth="/usr/shlib $glibpth"
1293 : Do not use vfork unless overridden by a hint file.
1296 : Find the basic shell for Bourne shell scripts
1300 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1303 if test -f "$xxx"; then
1306 : Build up a list and do a single loop so we can 'break' out.
1307 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1308 for xxx in sh bash ksh pdksh ash; do
1310 try="$try ${p}/${xxx}"
1314 if test -f "$xxx"; then
1317 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1320 elif test -f "$xxx.exe"; then
1331 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1333 Usually it's in /bin/sh. How did you even get this far?
1334 Please contact me (Perl Maintainers) at perlbug@perl.org and
1335 we'll try to straighten this all out.
1341 : see if sh knows # comments
1342 if `$sh -c '#' >/dev/null 2>&1`; then
1346 test -f $xcat$_exe || xcat=/usr/bin/cat
1347 if test ! -f $xcat$_exe; then
1348 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1349 if test -f $p/cat$_exe; then
1354 if test ! -f $xcat$_exe; then
1355 echo "Can't find cat anywhere!"
1359 echo "#!$xcat" >sharp
1363 if test -s today; then
1366 echo "#! $xcat" > sharp
1370 if test -s today; then
1378 echo "Your $sh doesn't grok # comments--I will strip them later on."
1381 echo "exec grep -v '^[ ]*#'" >spitshell
1383 $eunicefix spitshell
1384 spitshell=`pwd`/spitshell
1386 echo "I presume that if # doesn't work, #! won't work either!"
1391 : figure out how to guarantee sh startup
1393 '') startsh=${sharpbang}${sh} ;;
1405 : echo "Yup, it does."
1407 echo "Hmm... '$startsh' does not guarantee sh startup..."
1408 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1413 : Save command line options in file UU/cmdline.opt for later use in
1414 : generating config.sh.
1415 cat > cmdline.opt <<EOSH
1416 # Configure command line arguments.
1425 cat >>cmdline.opt <<EOSH
1426 config_arg$argn='$arg'
1428 # Extreme backslashitis: replace each ' by '"'"'
1429 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1432 arg_exp=`cat cmdl.opt`
1433 args_exp="$args_exp$args_sep'$arg_exp'"
1434 argn=`expr $argn + 1`
1437 # args_exp is good for restarting self: eval "set X $args_exp"; shift; $0 "$@"
1438 # used by ./hints/os2.sh
1441 : produce awk script to parse command line options
1442 cat >options.awk <<'EOF'
1444 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1446 len = length(optstr);
1447 for (i = 1; i <= len; i++) {
1448 c = substr(optstr, i, 1);
1449 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1460 if (substr(str, 1, 1) != "-") {
1461 printf("'%s'\n", str);
1465 for (i = 2; i <= len; i++) {
1466 c = substr(str, i, 1);
1468 printf("-%s\n", substr(str, i));
1474 printf("'%s'\n", substr(str, i + 1));
1487 : process the command line options
1488 set X `for arg in "$@"; do echo "X$arg"; done |
1489 sed -e s/X// | awk -f options.awk`
1494 : set up default values
1504 rm -f optdef.sh posthint.sh
1505 cat >optdef.sh <<EOS
1511 while test $# -gt 0; do
1513 -d) shift; fastread=yes;;
1514 -e) shift; alldone=cont;;
1518 if test -r "$1"; then
1521 echo "$me: cannot read config file $1." >&2
1526 -h) shift; error=true;;
1527 -r) shift; reuseval=true;;
1528 -s) shift; silent=true; realsilent=true;;
1529 -E) shift; alldone=exit;;
1530 -K) shift; knowitall=true;;
1531 -O) shift; override=true;;
1532 -S) shift; silent=true; extractsh=true;;
1537 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1538 echo "$me: ignoring -D $1" >&2
1541 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1542 *) echo "$1='define'" >> optdef.sh;;
1549 *=) echo "$1" >> optdef.sh;;
1551 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1552 echo "$me: ignoring -U $1" >&2
1554 *) echo "$1='undef'" >> optdef.sh;;
1565 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1569 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1570 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1576 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1577 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1578 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1579 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1580 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1581 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1587 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1589 echo "$yyy=''" >> posthint.sh ;;
1594 echo "$yyy='$zzz'" >> posthint.sh ;;
1596 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1598 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1603 echo "$yyy=$zzz" >> posthint.sh ;;
1604 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1608 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1611 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1619 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1620 [-U symbol] [-U symbol=] [-A command:symbol...]
1621 -d : use defaults for all answers.
1622 -e : go on without questioning past the production of config.sh.
1623 -f : specify an alternate default configuration file.
1624 -h : print this help message and exit (with an error status).
1625 -r : reuse C symbols value if possible (skips costly nm extraction).
1626 -s : silent mode, only echoes questions and essential information.
1627 -D : define symbol to have some value:
1628 -D symbol symbol gets the value 'define'
1629 -D symbol=value symbol gets the value 'value'
1630 -E : stop at the end of questions, after having produced config.sh.
1631 -K : do not use unless you know what you are doing.
1632 -O : let -D and -U override definitions from loaded configuration file.
1633 -S : perform variable substitutions on all .SH files (can mix with -f)
1634 -U : undefine symbol:
1635 -U symbol symbol gets the value 'undef'
1636 -U symbol= symbol gets completely empty
1637 -A : manipulate symbol after the platform specific hints have been applied:
1638 -A symbol=value append " "value to symbol
1639 -A append:symbol=value append value to symbol
1640 -A define:symbol=value define symbol to have value
1641 -A clear:symbol define symbol to be ''
1642 -A define:symbol define symbol to be 'define'
1643 -A eval:symbol=value define symbol to be eval of value
1644 -A prepend:symbol=value prepend value to symbol
1645 -A undef:symbol define symbol to be 'undef'
1646 -A undef:symbol= define symbol to be ''
1647 -V : print version number and exit (with a zero status).
1654 case "$fastread$alldone" in
1657 case "$extractsh" in
1660 if test ! -t 0; then
1661 echo "Say 'sh Configure', not 'sh <Configure'"
1671 true) exec 1>/dev/null;;
1674 : run the defines and the undefines, if any, but leave the file out there...
1677 : create the posthint manipulation script and leave the file out there...
1682 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1683 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1684 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1685 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1686 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1689 : Some greps do not return status, grrr.
1690 echo "grimblepritz" >grimble
1691 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1693 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1699 : the following should work in any shell
1703 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1704 cat >contains <<'EOSS'
1705 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1710 : Find the path to the source tree
1713 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1717 *) src=`cd ../$src && pwd` ;;
1730 if test -f $rsrc/Configure && \
1731 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1733 : found it, so we are ok.
1736 for src in . .. ../.. ../../.. ../../../..; do
1737 if test -f ../$src/Configure && \
1738 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1749 Sorry, I can't seem to locate the source dir for $package. Please start
1750 Configure with an explicit path -- i.e. /some/path/Configure.
1758 echo "Sources for $package found in \"$src\"." >&4
1762 : script used to extract .SH files with variable substitutions
1763 cat >extract <<'EOS'
1765 echo "Doing variable substitutions on .SH files..."
1766 if test -f MANIFEST; then
1767 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1769 echo "(Looking for .SH files under the source directory.)"
1770 set x `(cd "$src"; find . -name "*.SH" -print)`
1774 0) set x `(cd "$src"; echo *.SH)`; shift;;
1776 if test ! -f "$src/$1"; then
1782 while test $name; do
1783 if test ! -d "$name"; then
1784 create="$name $create";
1785 name=`echo $name | sed -e "s|^[^/]*$||"`;
1786 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1791 for file in $create; do
1800 dir=`expr X$file : 'X\(.*\)/'`
1801 file=`expr X$file : 'X.*/\(.*\)'`
1802 (cd "$dir" && . ./$file)
1812 dir=`expr X$file : 'X\(.*\)/'`
1813 file=`expr X$file : 'X.*/\(.*\)'`
1814 (set x $dir; shift; eval $mkdir_p)
1815 sh <"$src/$dir/$file"
1824 if test -f "$src/config_h.SH"; then
1825 if test ! -f config.h; then
1826 : oops, they left it out of MANIFEST, probably, so do it anyway.
1827 . "$src/config_h.SH"
1832 : extract files and exit if asked to do so
1833 case "$extractsh" in
1835 case "$realsilent" in
1839 case "$config_sh" in
1840 '') config_sh='config.sh';;
1843 echo "Fetching answers from $config_sh..."
1846 test "$override" && . ./optdef.sh
1850 echo "Extraction done."
1855 : Eunice requires " " instead of "", can you believe it
1858 echo "Beginning of configuration questions for $package."
1860 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1862 : first determine how to suppress newline on echo command
1864 echo "Checking echo to see how to suppress newlines..."
1865 (echo "hi there\c" ; echo " ") >.echotmp
1866 if $contains c .echotmp >/dev/null 2>&1 ; then
1877 echo $n "The star should be here-->$c"
1881 : Now test for existence of everything in MANIFEST
1883 if test -f "$rsrc/MANIFEST"; then
1884 echo "First let's make sure your kit is complete. Checking..." >&4
1885 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | (split -l 50 2>/dev/null || split -50)
1888 for filelist in x??; do
1889 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` >/dev/null 2>>"$tmppwd/missing")
1891 if test -s missing; then
1895 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1897 You have the option of continuing the configuration process, despite the
1898 distinct possibility that your kit is damaged, by typing 'y'es. If you
1899 do, don't blame me if something goes wrong. I advise you to type 'n'o
1900 and contact the author (perlbug@perl.org).
1903 echo $n "Continue? [n] $c" >&4
1907 echo "Continuing..." >&4
1911 echo "ABORTING..." >&4
1916 echo "Looks good..."
1919 echo "There is no MANIFEST file. I hope your kit is complete !"
1924 : Find the appropriate value for a newline for tr
1925 if test -n "$DJGPP"; then
1928 if test X"$trnl" = X; then
1929 case "`echo foo|tr '\n' x 2>/dev/null`" in
1933 if test X"$trnl" = X; then
1934 case "`echo foo|tr '\012' x 2>/dev/null`" in
1935 foox) trnl='\012' ;;
1938 if test X"$trnl" = X; then
1939 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
1940 fooxy) trnl='\n\r' ;;
1943 if test X"$trnl" = X; then
1946 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1952 : compute the number of columns on the terminal for proper question formatting
1957 : set up the echo used in my read
1958 myecho="case \"\$xxxm\" in
1959 '') echo $n \"\$rp $c\" >&4;;
1961 '') echo $n \"[\$xxxm] $c\";;
1963 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1965 echo $n \"[\$xxxm] $c\" >&4
1967 echo $n \"\$rp [\$xxxm] $c\" >&4
1973 : now set up to do reads with possible shell escape and default assignment
1979 case "\$fastread" in
1980 yes) case "\$dflt" in
1983 case "\$silent-\$rp" in
1988 *) case "\$silent" in
1989 true) case "\$rp" in
1994 while expr "X\$ans" : "X!" >/dev/null; do
1998 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2006 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2015 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2020 echo "(OK, I'll run with -d after this question.)" >&4
2023 echo "*** Sorry, \$1 not supported yet." >&4
2033 echo "*** Substitution done -- please confirm."
2035 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2040 echo "*** Error -- try again."
2047 case "\$ans\$xxxm\$nostick" in
2059 : create .config dir to save info across Configure sessions
2060 test -d ../.config || mkdir ../.config
2061 cat >../.config/README <<EOF
2062 This directory created by Configure to save information that should
2063 persist across sessions for $package.
2065 You may safely delete it if you wish.
2068 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2070 $define|true|[yY]*) ;;
2071 *) case "$xversion" in
2074 *** WHOA THERE!!! ***
2076 This is an UNSTABLE DEVELOPMENT release.
2077 The version of this $package distribution is $xversion, that is, odd,
2078 (as opposed to even) and that signifies a development release.
2079 If you want a maintenance release, you want an even-numbered version.
2081 Do ***NOT*** install this into production use.
2082 Data corruption and crashes are possible.
2084 It is most seriously suggested that you do not continue any further
2085 unless you want to help in developing and debugging Perl.
2087 If you *still* want to build perl, you can answer 'y' now,
2088 or pass -Dusedevel to Configure.
2091 rp='Do you really want to continue?'
2095 [yY]) echo >&4 "Okay, continuing."
2096 usedevel="$define" ;;
2097 *) echo >&4 "Okay, bye."
2107 case "$versiononly" in
2108 '') versiononly="$define" ;;
2110 case "$installusrbinperl" in
2111 '') installusrbinperl="$undef" ;;
2116 : general instructions
2119 user=`(logname) 2>/dev/null`
2121 '') user=`whoami 2>&1`;;
2123 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2126 rp='Would you like to see the instructions?'
2137 This installation shell script will examine your system and ask you questions
2138 to determine how the perl5 package should be installed. If you get
2139 stuck on a question, you may use a ! shell escape to start a subshell or
2140 execute a command. Many of the questions will have default answers in square
2141 brackets; typing carriage return will give you the default.
2143 On some of the questions which ask for file or directory names you are allowed
2144 to use the ~name construct to specify the login directory belonging to "name",
2145 even if you don't have a shell which knows about that. Questions where this is
2146 allowed will be marked "(~name ok)".
2150 dflt='Type carriage return to continue'
2154 The prompter used in this script allows you to use shell variables and
2155 backticks in your answers. You may use $1, $2, etc... to refer to the words
2156 in the default answer, as if the default line was a set of arguments given to a
2157 script shell. This means you may also use $* to repeat the whole default line,
2158 so you do not have to re-type everything to add something to the default.
2160 Everytime there is a substitution, you will have to confirm. If there is an
2161 error (e.g. an unmatched backtick), the default answer will remain unchanged
2162 and you will be prompted again.
2164 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2165 the questions and use the computed defaults (or the previous answers if there
2166 was already a config.sh file). Type 'Configure -h' for a list of options.
2167 You may also start interactively and then answer '& -d' at any prompt to turn
2168 on the non-interactive behaviour for the remainder of the execution.
2174 Much effort has been expended to ensure that this shell script will run on any
2175 Unix system. If despite that it blows up on yours, your best bet is to edit
2176 Configure and run it again. If you can't run Configure for some reason,
2177 you'll have to generate a config.sh file by hand. Whatever problems you
2178 have, let me (perlbug@perl.org) know how I blew it.
2180 This installation script affects things in two ways:
2182 1) it may do direct variable substitutions on some of the files included
2184 2) it builds a config.h file for inclusion in C programs. You may edit
2185 any of these files as the need arises after running this script.
2187 If you make a mistake on a question, there is no easy way to back up to it
2188 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2189 files. Configure will offer to let you do this before it runs the SH files.
2192 dflt='Type carriage return to continue'
2194 case "$firsttime" in
2195 true) echo $user >>../.config/instruct;;
2199 : find out where common programs are
2201 echo "Locating common programs..." >&4
2214 if test -d \$dir/\$thing; then
2220 for thisthing in \$dir/\$thing; do
2221 : just loop through to pick last item
2223 if test -f \$thisthing; then
2226 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2229 elif test -f \$dir/\$thing.exe; then
2230 if test -n "$DJGPP"; then
2231 echo \$dir/\$thing.exe
2232 elif test "$eunicefix" != ":"; then
2233 : on Eunice apparently
2287 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2288 pth="$pth /lib /usr/lib"
2289 for file in $loclist; do
2293 if test -f "$xxx"; then
2296 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2297 xxx=`./loc $file $file $pth`
2300 '') xxx=`./loc $file $file $pth`;;
2301 *) xxx=`./loc $xxx $xxx $pth`;;
2303 eval $file=$xxx$_exe
2307 echo $file is in $xxx.
2310 echo $file is in $xxx.
2313 echo "I don't know where '$file' is, and my life depends on it." >&4
2314 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2320 echo "Don't worry if any of the following aren't found..."
2322 for file in $trylist; do
2326 if test -f "$xxx"; then
2329 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2330 xxx=`./loc $file $file $pth`
2333 '') xxx=`./loc $file $file $pth`;;
2334 *) xxx=`./loc $xxx $xxx $pth`;;
2336 eval $file=$xxx$_exe
2340 echo $file is in $xxx.
2343 echo $file is in $xxx.
2346 echo "I don't see $file out there, $say."
2353 echo "Substituting grep for egrep."
2360 echo "Substituting cp for ln."
2369 echo "I can't find make or gmake, and my life depends on it." >&4
2370 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2378 *) # We can't have osname yet.
2379 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2380 # Assume that gmake, if found, is definitely GNU make
2381 # and prefer it over the system make.
2382 echo "Substituting gmake for make."
2390 echo "Hopefully test is built into your sh."
2393 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2394 echo "Using the test built into your sh."
2402 echo "Hopefully echo is built into your sh."
2407 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2408 $echo $n "hi there$c" >foo1
2409 echo $n "hi there$c" >foo2
2410 if cmp foo1 foo2 >/dev/null 2>&1; then
2411 echo "They are compatible. In fact, they may be identical."
2418 They are not compatible! You are probably running ksh on a non-USG system.
2419 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2420 have echo built in and we may have to run some Bourne shell scripts. That
2421 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2424 $echo $n "The star should be here-->$c"
2434 cat <<'EOSC' >>trygcc
2439 int main(int argc, char *argv[]) {
2443 if $cc -o try $ccflags $ldflags try.c; then
2446 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2452 case "`$cc -v -c try.c 2>&1`" in
2455 if $test X"$trygcc" = Xyes; then
2456 if gcc -o try -c try.c; then
2458 echo "You seem to have a working gcc, though." >&4
2459 rp="Would you like to use it?"
2461 if $test -f myread; then
2464 if $test -f UU/myread; then
2467 echo "Cannot find myread, sorry. Aborting." >&2
2472 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2473 if $test -f usethreads.cbu; then
2476 *** However, any setting of the C compiler flags (e.g. for thread support)
2477 *** has been lost. It may be necessary to pass -Dcc=gcc to Configure
2478 *** (together with e.g. -Dusethreads).
2494 cat <<'EOSC' >>checkcc
2499 int main(int argc, char *argv[]) {
2503 if $cc -o try $ccflags $ldflags try.c; then
2506 if $test X"$despair" = Xyes; then
2507 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2510 You need to find a working C compiler.
2511 Either (purchase and) install the C compiler supplied by your OS vendor,
2512 or for a free C compiler try http://gcc.gnu.org/
2513 I cannot continue any further, aborting.
2522 : determine whether symbolic links are supported
2525 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2526 echo "Symbolic links are supported." >&4
2529 echo "Symbolic links are NOT supported." >&4
2534 : determine whether symbolic links are supported
2538 echo "Checking how to test for symbolic links..." >&4
2540 if $test "X$issymlink" = X; then
2542 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2543 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2545 if test $? = 0; then
2548 echo "Your builtin 'test -h' may be broken." >&4
2551 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2554 if test -f "$p/$test"; then
2563 echo "Trying external '$test -h'." >&4
2564 issymlink="$test -h"
2565 if $test ! -h sym >/dev/null 2>&1; then
2566 echo "External '$test -h' is broken, too." >&4
2574 if $test "X$issymlink" = X; then
2575 if $test -L sym 2>/dev/null; then
2576 issymlink="$test -L"
2577 echo "The builtin '$test -L' worked." >&4
2580 if $test "X$issymlink" != X; then
2581 echo "You can test for symbolic links with '$issymlink'." >&4
2583 echo "I do not know how you can test for symbolic links." >&4
2587 *) echo "No symbolic links, so not testing for their testing..." >&4
2593 case "$mksymlinks" in
2596 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2599 *) case "$lns:$issymlink" in
2600 *"ln"*" -s:"*"test -"?)
2601 echo "Creating the symbolic links..." >&4
2602 echo "(First creating the subdirectories...)" >&4
2604 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2606 test -z "$directory" && break
2610 if test ! -d t/base; then
2611 echo "Failed to create the subdirectories. Aborting." >&4
2614 echo "(Then creating the symlinks...)" >&4
2615 awk '{print $1}' $src/MANIFEST | while true; do
2617 test -z "$filename" && break
2618 if test -f $filename; then
2619 if $issymlink $filename; then
2623 if test -f $filename; then
2624 echo "$filename already exists, not symlinking."
2626 ln -s $src/$filename $filename
2630 if test ! -f t/base/lex.t; then
2631 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2636 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2645 case "$usecrosscompile" in
2647 $echo "Cross-compiling..."
2650 *-*-gcc) # A cross-compiling gcc, probably.
2651 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2653 # leave out ld, choosing it is more complex
2655 ranlib=$targetarch-ranlib
2656 $echo 'extern int foo;' > try.c
2657 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2659 if $test $# -gt 0; then
2661 incpth="`$echo $incpth|$sed 's/^ //'`"
2662 echo "Guessing incpth '$incpth'." >&4
2664 j="`$echo $i|$sed 's,/include$,/lib,'`"
2665 if $test -d $j; then
2669 libpth="`$echo $libpth|$sed 's/^ //'`"
2670 echo "Guessing libpth '$libpth'." >&4
2675 case "$targetarch" in
2676 '') echo "Targetarch not defined." >&4; croak=y ;;
2677 *) echo "Using targetarch $targetarch." >&4 ;;
2680 '') echo "Incpth not defined." >&4; croak=y ;;
2681 *) echo "Using incpth '$incpth'." >&4 ;;
2684 '') echo "Libpth not defined." >&4; croak=y ;;
2685 *) echo "Using libpth '$libpth'." >&4 ;;
2688 '') for i in $incpth; do
2689 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2691 echo "Guessing usrinc $usrinc." >&4
2696 '') echo "Usrinc not defined." >&4; croak=y ;;
2699 *) echo "Using usrinc $usrinc." >&4 ;;
2701 case "$targethost" in
2702 '') echo "Targethost not defined." >&4; croak=y ;;
2703 *) echo "Using targethost $targethost." >&4
2708 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2711 /*) run=$src/Cross/run
2712 targetmkdir=$src/Cross/mkdir
2714 from=$src/Cross/from
2716 *) pwd=`$test -f ../Configure & cd ..; pwd`
2718 targetmkdir=$pwd/Cross/mkdir
2720 from=$pwd/Cross/from
2723 case "$targetrun" in
2724 '') targetrun=ssh ;;
2729 case "$targetfrom" in
2730 '') targetfrom=scp ;;
2734 from=$from-$targetfrom
2735 case "$targetdir" in
2737 echo "Guessing targetdir $targetdir." >&4
2740 case "$targetuser" in
2742 echo "Guessing targetuser $targetuser." >&4
2745 case "$targetfrom" in
2749 case "$targetrun" in
2761 '') cwd=$targetdir ;;
2765 if $test ! -f \$exe.xok; then
2769 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2772 *) echo "Unknown targetrun '$targetrun'" >&4
2776 case "$targetmkdir" in
2778 cat >$targetmkdir <<EOF
2780 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2782 $chmod a+rx $targetmkdir
2784 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2796 $targetmkdir \`dirname \$f\`
2797 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2800 $targetmkdir $targetdir/\`dirname \$f\`
2801 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2814 $mkdir -p $targetdir/\`dirname \$f\`
2815 $cp \$f $targetdir/\$f || exit 1
2818 $targetmkdir $targetdir/\`dirname \$f\`
2819 $cp \$f $targetdir/\$f || exit 1
2826 *) echo "Unknown targetto '$targetto'" >&4
2830 case "$targetfrom" in
2837 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2842 cp) cat >$from <<EOF
2847 cp $targetdir/\$f . || exit 1
2852 *) echo "Unknown targetfrom '$targetfrom'" >&4
2856 if $test ! -f $run; then
2857 echo "Target 'run' script '$run' not found." >&4
2861 if $test ! -f $to; then
2862 echo "Target 'to' script '$to' not found." >&4
2866 if $test ! -f $from; then
2867 echo "Target 'from' script '$from' not found." >&4
2871 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2875 Using '$run' for remote execution,
2876 and '$from' and '$to'
2877 for remote file transfer.
2883 usecrosscompile='undef'
2888 : see whether [:lower:] and [:upper:] are supported character classes
2890 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2892 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2896 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
2897 # (0xd9 and 0xe2), therefore that is a nice testing point.
2898 if test "X$up" = X -o "X$low" = X; then
2899 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
2905 if test "X$up" = X -o "X$low" = X; then
2906 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
2912 if test "X$up" = X -o "X$low" = X; then
2913 case "`echo RS | od -x 2>/dev/null`" in
2915 echo "Hey, this might be EBCDIC." >&4
2916 if test "X$up" = X -o "X$low" = X; then
2917 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2918 rs) up='[A-IJ-RS-Z]'
2923 if test "X$up" = X -o "X$low" = X; then
2924 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2934 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
2936 echo "Using $up and $low to convert case." >&4
2939 echo "I don't know how to translate letters from upper to lower case." >&4
2940 echo "Your tr is not acting any way I know of." >&4
2944 : set up the translation script tr, must be called with ./tr of course
2948 '[A-Z][a-z]') exec $tr '$up' '$low';;
2949 '[a-z][A-Z]') exec $tr '$low' '$up';;
2956 : Try to determine whether config.sh was made on this system
2957 case "$config_sh" in
2959 myuname=`$uname -a 2>/dev/null`
2960 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2961 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2962 # because the A-Z/a-z are not consecutive.
2963 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2964 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2965 newmyuname="$myuname"
2967 case "$knowitall" in
2969 if test -f ../config.sh; then
2970 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2971 eval "`grep myuname= ../config.sh`"
2973 if test "X$myuname" = "X$newmyuname"; then
2981 : Get old answers from old config file if Configure was run on the
2982 : same system, otherwise use the hints.
2985 if test -f config.sh; then
2987 rp="I see a config.sh file. Shall I use it to set the defaults?"
2990 n*|N*) echo "OK, I'll ignore it."
2991 mv config.sh config.sh.old
2992 myuname="$newmyuname"
2994 *) echo "Fetching default answers from your old config.sh file..." >&4
3002 : Older versions did not always set $sh. Catch re-use of such
3012 if test ! -f config.sh; then
3015 First time through, eh? I have some defaults handy for some systems
3016 that need some extra help getting the Configure answers right:
3019 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3021 : Half the following guesses are probably wrong... If you have better
3022 : tests or hints, please send them to perlbug@perl.org
3023 : The metaconfig authors would also appreciate a copy...
3024 $test -f /irix && osname=irix
3025 $test -f /xenix && osname=sco_xenix
3026 $test -f /dynix && osname=dynix
3027 $test -f /dnix && osname=dnix
3028 $test -f /lynx.os && osname=lynxos
3029 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3030 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3031 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3032 $test -f /bin/mips && /bin/mips && osname=mips
3033 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3034 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3035 $test -d /usr/apollo/bin && osname=apollo
3036 $test -f /etc/saf/_sactab && osname=svr4
3037 $test -d /usr/include/minix && osname=minix
3038 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3039 if $test -d /MachTen -o -d /MachTen_Folder; then
3041 if $test -x /sbin/version; then
3042 osvers=`/sbin/version | $awk '{print $2}' |
3043 $sed -e 's/[A-Za-z]$//'`
3044 elif $test -x /usr/etc/version; then
3045 osvers=`/usr/etc/version | $awk '{print $2}' |
3046 $sed -e 's/[A-Za-z]$//'`
3052 $test -f /sys/posix.dll &&
3053 $test -f /usr/bin/what &&
3054 set X `/usr/bin/what /sys/posix.dll` &&
3055 $test "$3" = UWIN &&
3059 if $test -f $uname; then
3067 umips) osname=umips ;;
3070 [23]100) osname=mips ;;
3071 next*) osname=next ;;
3073 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3074 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3077 elif $test -f /etc/kconfig; then
3079 if test "$lns" = "$ln -s"; then
3081 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3083 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3090 if test -n "$DJGPP"; then
3099 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3101 # oslevel can fail with:
3102 # oslevel: Unable to acquire lock.
3103 *not\ found) osvers="$4"."$3" ;;
3104 '<3240'|'<>3240') osvers=3.2.0 ;;
3105 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3106 '=3250'|'>3250') osvers=3.2.5 ;;
3110 bsd386) osname=bsd386
3113 cygwin*) osname=cygwin
3116 *dc.osx) osname=dcosx
3122 domainos) osname=apollo
3128 dynixptx*) osname=dynixptx
3129 osvers=`echo "$4"|sed 's/^v//'`
3131 freebsd) osname=freebsd
3133 genix) osname=genix ;;
3137 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3153 netbsd*) osname=netbsd
3156 news-os) osvers="$3"
3158 4*) osname=newsos4 ;;
3162 next*) osname=next ;;
3163 nonstop-ux) osname=nonstopux ;;
3164 openbsd) osname=openbsd
3170 POSIX-BC | posix-bc ) osname=posix-bc
3173 powerux | power_ux | powermax_os | powermaxos | \
3174 powerunix | power_unix) osname=powerux
3180 solaris) osname=solaris
3182 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3189 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3193 titanos) osname=titanos
3202 ultrix) osname=ultrix
3205 osf1|mls+) case "$5" in
3208 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3211 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3214 hp*) osname=hp_osf1 ;;
3215 mips) osname=mips_osf1 ;;
3218 # UnixWare 7.1.2 is known as Open UNIX 8
3219 openunix|unixware) osname=svr5
3227 $2) case "$osname" in
3231 : svr4.x or possibly later
3241 if test -f /stand/boot ; then
3242 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3243 if test -n "$INITPROG" -a -f "$INITPROG"; then
3244 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3245 if test -n "$isesix"; then
3253 *) if test -f /etc/systemid; then
3255 set `echo $3 | $sed 's/\./ /g'` $4
3256 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3258 elif $test -f $src/hints/sco_$1_$2.sh; then
3260 elif $test -f $src/hints/sco_$1.sh; then
3265 '') : Still unknown. Probably a generic Sys V.
3274 *) case "$osname" in
3275 '') : Still unknown. Probably a generic BSD.
3283 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3284 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3285 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3288 $rm -f UU/kernel.what
3289 elif test -d c:/. -o -n "$is_os2" ; then
3296 case "$targetarch" in
3299 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3304 : Now look for a hint file osname_osvers, unless one has been
3305 : specified already.
3308 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3309 : Also try without trailing minor version numbers.
3310 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3311 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3312 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3313 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3316 *) case "$osvers" in
3319 *) if $test -f $src/hints/$file.sh ; then
3321 elif $test -f $src/hints/$xfile.sh ; then
3323 elif $test -f $src/hints/$xxfile.sh ; then
3325 elif $test -f $src/hints/$xxxfile.sh ; then
3327 elif $test -f $src/hints/$xxxxfile.sh ; then
3329 elif $test -f "$src/hints/${osname}.sh" ; then
3338 if $test -f Policy.sh ; then
3341 none) dflt="Policy" ;;
3342 *) dflt="Policy $dflt" ;;
3347 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3351 if $test -f Policy.sh ; then
3354 There's also a Policy hint file available, which should make the
3355 site-specific (policy) questions easier to answer.
3362 You may give one or more space-separated answers, or "none" if appropriate.
3363 A well-behaved OS will have no hints, so answering "none" or just "Policy"
3364 is a good thing. DO NOT give a wrong version or a wrong OS.
3368 rp="Which of these apply, if any?"
3371 for file in $tans; do
3372 if $test X$file = XPolicy -a -f Policy.sh; then
3374 $cat Policy.sh >> UU/config.sh
3375 elif $test -f $src/hints/$file.sh; then
3376 . $src/hints/$file.sh
3377 $cat $src/hints/$file.sh >> UU/config.sh
3378 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3381 : Give one chance to correct a possible typo.
3382 echo "$file.sh does not exist"
3384 rp="hint to use instead?"
3386 for file in $ans; do
3387 if $test -f "$src/hints/$file.sh"; then
3388 . $src/hints/$file.sh
3389 $cat $src/hints/$file.sh >> UU/config.sh
3390 elif $test X$ans = X -o X$ans = Xnone ; then
3393 echo "$file.sh does not exist -- ignored."
3400 : Remember our hint file for later.
3401 if $test -f "$src/hints/$file.sh" ; then
3411 echo "Fetching default answers from $config_sh..." >&4
3415 cp $config_sh config.sh 2>/dev/null
3425 test "$override" && . ./optdef.sh
3427 : Restore computed paths
3428 for file in $loclist $trylist; do
3429 eval $file="\$_$file"
3434 Configure uses the operating system name and version to set some defaults.
3435 The default value is probably right if the name rings a bell. Otherwise,
3436 since spelling matters for me, either accept the default or answer "none"
3443 ''|' '|none) dflt=none ;;
3444 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3447 *) dflt="$osname" ;;
3449 rp="Operating system name?"
3453 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3459 ''|' '|none) dflt=none ;;
3460 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3461 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3463 ''|' ') dflt=none ;;
3468 *) dflt="$osvers" ;;
3470 rp="Operating system version?"
3480 : who configured the system
3481 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3484 cf_by=`(logname) 2>/dev/null`
3487 cf_by=`(whoami) 2>/dev/null`
3489 "") cf_by=unknown ;;
3494 : set up the script used to warn in case of inconsistency
3501 echo "*** WHOA THERE!!! ***" >&4
3502 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
3503 rp=" Keep the $hint value?"
3506 y) td=$was; tu=$was;;
3510 : function used to set $1 to $val
3511 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
3513 $define$undef) . ./whoa; eval "$var=\$td";;
3514 $undef$define) . ./whoa; eval "$var=\$tu";;
3515 *) eval "$var=$val";;
3519 $define|true|[yY]*) dflt='y';;
3524 Perl can be built to use the SOCKS proxy protocol library. To do so,
3525 Configure must be run with -Dusesocks. If you use SOCKS you also need
3526 to use the PerlIO abstraction layer, this will be implicitly selected.
3528 If this doesn't make any sense to you, just accept the default '$dflt'.
3530 rp='Build Perl for SOCKS?'
3533 y|Y) val="$define" ;;
3540 $define|true|[yY]*) useperlio="$define";;
3543 case "$useperlio" in
3544 $define|true|[yY]*|'') dflt='y';;
3549 Previous version of $package used the standard IO mechanisms as
3550 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
3551 alternate IO mechanisms via the PerlIO abstraction layer, but the
3552 stdio mechanism is still available if needed. The abstraction layer
3553 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
3554 Using PerlIO with sfio may cause problems with some extension modules.
3556 If this doesn't make any sense to you, just accept the default '$dflt'.
3558 rp='Use the PerlIO abstraction layer?'
3565 echo "Ok, doing things the stdio way."
3574 case "$useperlio" in
3575 $define|true|[yY]*) ;;
3578 You are using the SOCKS proxy protocol library which means that you
3579 should also use the PerlIO layer. You may be headed for trouble.
3588 case "$usethreads" in
3589 $define|true|[yY]*) dflt='y';;
3590 *) # Catch case where user specified ithreads or 5005threads but
3591 # forgot -Dusethreads (A.D. 4/2002)
3592 case "$useithreads$use5005threads" in
3594 case "$useperlio" in
3595 "$define") dflt='y' ;;
3605 Perl can be built to take advantage of threads on some systems.
3606 To do so, Configure can be run with -Dusethreads.
3608 Note that Perl built with threading support runs slightly slower
3609 and uses more memory than plain Perl. The current implementation
3610 is believed to be stable, but it is fairly new, and so should be
3611 treated with caution.
3613 If this doesn't make any sense to you, just accept the default '$dflt'.
3615 rp='Build a threading Perl?'
3618 y|Y) val="$define" ;;
3624 case "$usethreads" in
3628 Since release 5.6, Perl has had two different threading implementations,
3629 the newer interpreter-based version (ithreads) with one interpreter per
3630 thread, and the older 5.005 version (5005threads).
3631 The 5005threads version is effectively unmaintained and will probably be
3632 removed in Perl 5.10, so there should be no need to build a Perl using it
3633 unless needed for backwards compatibility with some existing 5.005threads
3637 : Default to ithreads unless overridden on command line or with
3640 case "$use5005threads" in
3641 $define|true|[yY]*) dflt='n';;
3643 case "$useithreads" in
3644 $undef|false|[nN]*) dflt='n';;
3646 rp='Use the newer interpreter-based ithreads?'
3649 y|Y) val="$define" ;;
3654 : Now set use5005threads to the opposite value.
3655 case "$useithreads" in
3656 $define) val="$undef" ;;
3663 useithreads="$undef"
3664 use5005threads="$undef"
3668 case "$useithreads$use5005threads" in
3672 You cannot have both the ithreads and the 5.005 threads enabled
3673 at the same time. Disabling the 5.005 threads since they are
3674 much less stable than the ithreads.
3677 use5005threads="$undef"
3681 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
3684 *** To build with ithreads you must also use the PerlIO layer.
3685 *** Cannot continue, aborting.
3691 case "$d_oldpthreads" in
3692 '') : Configure tests would be welcome here. For now, assume undef.
3694 *) val="$d_oldpthreads" ;;
3700 : Look for a hint-file generated 'call-back-unit'. If the
3701 : user has specified that a threading perl is to be built,
3702 : we may need to set or change some other defaults.
3703 if $test -f usethreads.cbu; then
3704 echo "Your platform has some specific hints regarding threaded builds, using them..."
3707 case "$usethreads" in
3708 "$define"|true|[yY]*)
3710 (Your platform does not have any specific hints for threaded builds.
3711 Assuming POSIX threads, then.)
3719 Perl can be built so that multiple Perl interpreters can coexist
3720 within the same Perl executable.
3723 case "$useithreads" in
3726 This multiple interpreter support is required for interpreter-based threads.
3730 *) case "$usemultiplicity" in
3731 $define|true|[yY]*) dflt='y';;
3735 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
3736 rp='Build Perl for multiplicity?'
3739 y|Y) val="$define" ;;
3748 case "$usemorebits" in
3749 "$define"|true|[yY]*)
3750 use64bitint="$define"
3751 uselongdouble="$define"
3752 usemorebits="$define"
3754 *) usemorebits="$undef"
3758 : make some quick guesses about what we are up against
3760 $echo $n "Hmm... $c"
3770 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
3771 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
3773 echo "Looks kind of like an OSF/1 system, but we'll see..."
3775 elif test `echo abc | $tr a-z A-Z` = Abc ; then
3776 xxx=`./loc addbib blurfl $pth`
3777 if $test -f $xxx; then
3778 echo "Looks kind of like a USG system with BSD features, but we'll see..."
3782 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
3783 echo "Looks kind of like an extended USG system, but we'll see..."
3785 echo "Looks kind of like a USG system, but we'll see..."
3789 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
3790 echo "Looks kind of like a BSD system, but we'll see..."
3794 echo "Looks kind of like a Version 7 system, but we'll see..."
3797 case "$eunicefix" in
3800 There is, however, a strange, musty smell in the air that reminds me of
3801 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
3805 : it so happens the Eunice I know will not run shell scripts in Unix format
3809 echo "Congratulations. You aren't running Eunice."
3813 : Detect OS2. The p_ variable is set above in the Head.U unit.
3814 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
3815 : semicolon as a patch separator
3820 I have the feeling something is not exactly right, however...don't tell me...
3821 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
3822 (Or you may be running DOS with DJGPP.)
3827 if test -f /xenix; then
3828 echo "Actually, this looks more like a XENIX system..."
3833 echo "It's not Xenix..."
3838 if test -f /venix; then
3839 echo "Actually, this looks more like a VENIX system..."
3846 echo "Nor is it Venix..."
3849 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3850 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3857 rp="Use which C compiler?"
3861 : See if they have not cc but they do have gcc
3863 : Look for a hint-file generated 'call-back-unit'. Now that the
3864 : user has specified the compiler, we may need to set or change some
3866 if $test -f cc.cbu; then
3872 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3878 printf("%s\n", __VERSION__);
3880 printf("%s\n", "1");
3886 if $cc -o try $ccflags $ldflags try.c; then
3887 gccversion=`$run ./try`
3888 case "$gccversion" in
3889 '') echo "You are not using GNU cc." ;;
3890 *) echo "You are using GNU cc $gccversion."
3896 echo "*** WHOA THERE!!! ***" >&4
3897 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3898 case "$knowitall" in
3900 echo " You'd better start hunting for one and let me know about it." >&4
3906 case "$gccversion" in
3907 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3909 case "$gccversion" in
3910 '') gccosandvers='' ;;
3911 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
3912 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
3914 case "$gccosandvers" in
3915 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
3916 $osname$osvers) ;; # looking good
3917 $osname*) cat <<EOM >&4
3919 *** WHOA THERE!!! ***
3921 Your gcc has not been compiled for the exact release of
3922 your operating system ($gccosandvers versus $osname$osvers).
3924 In general it is a good idea to keep gcc synchronized with
3925 the operating system because otherwise serious problems
3926 may ensue when trying to compile software, like Perl.
3928 I'm trying to be optimistic here, though, and will continue.
3929 If later during the configuration and build icky compilation
3930 problems appear (headerfile conflicts being the most common
3931 manifestation), I suggest reinstalling the gcc to match
3932 your operating system release.
3936 *) gccosandvers='' ;; # failed to parse, better be silent
3944 # gcc 3.* complain about adding -Idirectories that they already know about,
3945 # so we will take those off from locincpth.
3946 case "$gccversion" in
3948 echo "main(){}">try.c
3949 for incdir in $locincpth; do
3950 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
3951 grep '^c[cp]p*[01]: warning: changing search order '`
3952 if test "X$warn" != X; then
3953 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
3959 : decide how portable to be. Allow command line overrides.
3960 case "$d_portable" in
3962 *) d_portable="$define" ;;
3965 : set up shell script to do ~ expansion
3971 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3974 if $test -f /bin/csh; then
3975 /bin/csh -f -c "glob \$1"
3980 name=\`$expr x\$1 : '..\([^/]*\)'\`
3981 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3982 if $test ! -d "\$dir"; then
3984 echo "\$me: can't locate home directory for: \$name" >&2
3989 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
4005 : now set up to get a file name
4009 cat <<'EOSC' >>getfile
4025 : getfile will accept an answer from the comma-separated list
4026 : enclosed in parentheses even if it does not meet other criteria.
4027 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
4028 fn=`echo $fn | sed 's/(.*)//'`
4034 loc_file=`expr $fn : '.*:\(.*\)'`
4035 fn=`expr $fn : '\(.*\):.*'`
4043 */*) fullpath=true;;
4052 *e*) exp_file=true;;
4055 *p*) nopath_ok=true;;
4060 *d*) type='Directory';;
4061 *l*) type='Locate';;
4066 Locate) what='File';;
4071 case "$d_portable" in
4079 while test "$type"; do
4084 true) rp="$rp (~name ok)";;
4087 if test -f UU/getfile.ok && \
4088 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
4107 value=`UU/filexp $ans`
4110 if test "$ans" != "$value"; then
4111 echo "(That expands to $value on this system.)"
4125 /*) value="$ansexp" ;;
4126 [a-zA-Z]:/*) value="$ansexp" ;;
4131 echo "I shall only accept a full path name, as in /bin/ls." >&4
4132 echo "Use a ! shell escape if you wish to check pathnames." >&4
4135 echo "Please give a full path name, starting with slash." >&4
4138 echo "Note that using ~name is ok provided it expands well." >&4
4151 for fp in $gfpth; do
4152 if test "X$fp" = X.; then
4157 if test -f "$pf"; then
4159 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
4161 echo "($value is not a plain file, but that's ok.)"
4164 if test X"$type" = X; then
4171 for fp in $gfpth; do
4172 if test "X$fp" = X.; then
4177 direxp="$fp/$ansexp"
4179 if test -d "$direxp"; then
4187 if test -d "$ansexp"; then
4188 echo "(Looking for $loc_file in directory $value.)"
4189 value="$value/$loc_file"
4190 ansexp="$ansexp/$loc_file"
4192 if test -f "$ansexp"; then
4195 case "$nopath_ok" in
4196 true) case "$value" in
4198 *) echo "Assuming $value will be in people's path."
4214 if test "$fastread" = yes; then
4219 rp="$what $value doesn't exist. Use that name anyway?"
4238 test "X$gfpthkeep" != Xy && gfpth=""
4241 : What should the include directory be ?
4243 $echo $n "Hmm... $c"
4247 if $test -f /bin/mips && /bin/mips; then
4248 echo "Looks like a MIPS system..."
4249 $cat >usr.c <<'EOCP'
4250 #ifdef SYSTYPE_BSD43
4254 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4255 dflt='/bsd43/usr/include'
4259 mips_type='System V'
4261 $rm -f usr.c usr.out
4262 echo "and you're compiling with the $mips_type compiler and libraries."
4266 echo "Doesn't look like a MIPS system."
4276 case "$xxx_prompt" in
4279 rp='Where are the include files you want to use?'
4287 : see how we invoke the C preprocessor
4289 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4290 cat <<'EOT' >testcpp.c
4296 if test ! -f cppstdin; then
4297 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4298 # AIX cc -E doesn't show the absolute headerfile
4299 # locations but we'll cheat by using the -M flag.
4300 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
4302 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4305 echo "Keeping your $hint cppstdin wrapper."
4308 wrapper=`pwd`/cppstdin
4312 if $test "X$cppstdin" != "X" && \
4313 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4314 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4316 echo "You used to use $cppstdin $cppminus so we'll use that again."
4318 '') echo "But let's see if we can live without a wrapper..." ;;
4320 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4321 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4323 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4326 echo "(However, $cpprun $cpplast does not work, let's see...)"
4334 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4341 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4342 $cc -E <testcpp.c >testcpp.out 2>&1; \
4343 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4344 echo "Yup, it does."
4347 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4348 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4349 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4350 echo "Yup, it does."
4353 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4354 $cc -P <testcpp.c >testcpp.out 2>&1; \
4355 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4356 echo "Yipee, that works!"
4359 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4360 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4361 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4362 echo "At long last!"
4365 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4366 $cpp <testcpp.c >testcpp.out 2>&1; \
4367 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4371 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4372 $cpp - <testcpp.c >testcpp.out 2>&1; \
4373 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4374 echo "Hooray, it works! I was beginning to wonder."
4377 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4378 $wrapper <testcpp.c >testcpp.out 2>&1; \
4379 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4385 rp="No dice. I can't find a C preprocessor. Name one:"
4389 $x_cpp <testcpp.c >testcpp.out 2>&1
4390 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4391 echo "OK, that will do." >&4
4393 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4408 echo "Perhaps can we force $cc -E using a wrapper..."
4409 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4410 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4416 echo "Nope, we'll have to live without it..."
4430 "$wrapper"|'cppstdin') ;;
4431 *) $rm -f $wrapper;;
4433 $rm -f testcpp.c testcpp.out
4435 : Set private lib path
4438 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4443 '') dlist="$loclibpth $plibpth $glibpth";;
4444 *) dlist="$libpth";;
4447 : Now check and see which directories actually exist, avoiding duplicates
4451 if $test -d $xxx; then
4454 *) libpth="$libpth $xxx";;
4460 Some systems have incompatible or broken versions of libraries. Among
4461 the directories listed in the question below, please remove any you
4462 know not to be holding relevant libraries, and add any that are needed.
4463 Say "none" for none.
4474 rp="Directories to use for library searches?"
4481 : compute shared library extension
4484 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4494 On some systems, shared libraries may be available. Answer 'none' if
4495 you want to suppress searching of shared libraries for the remainder
4496 of this configuration.
4499 rp='What is the file extension used for shared libraries?'
4503 : Define several unixisms.
4504 : Hints files or command line option can be used to override them.
4505 : The convoluted testing is in case hints files set either the old
4508 '') case "$exe_ext" in
4510 *) _exe="$exe_ext" ;;
4515 '') case "$lib_ext" in
4522 '') case "$obj_ext" in
4529 '') case "$path_sep" in
4540 : Which makefile gets called first. This is used by make depend.
4541 case "$firstmakefile" in
4542 '') firstmakefile='makefile';;
4546 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4549 case "$uselongdouble" in
4550 $define|true|[yY]*) dflt='y';;
4555 Perl can be built to take advantage of long doubles which
4556 (if available) may give more accuracy and range for floating point numbers.
4558 If this doesn't make any sense to you, just accept the default '$dflt'.
4560 rp='Try to use long doubles if available?'
4563 y|Y) val="$define" ;;
4569 case "$uselongdouble" in
4570 true|[yY]*) uselongdouble="$define" ;;
4573 : Look for a hint-file generated 'call-back-unit'. If the
4574 : user has specified that long doubles should be used,
4575 : we may need to set or change some other defaults.
4576 if $test -f uselongdouble.cbu; then
4577 echo "Your platform has some specific hints regarding long doubles, using them..."
4578 . ./uselongdouble.cbu
4580 case "$uselongdouble" in
4583 (Your platform does not have any specific hints for long doubles.)
4589 : Looking for optional libraries
4591 echo "Checking for optional libraries..." >&4
4596 case "$libswanted" in
4597 '') libswanted='c_s';;
4600 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4606 for thisdir in $libpth $xlibpth; do
4607 test -d $thisdir && libspath="$libspath $thisdir"
4609 for thislib in $libswanted; do
4610 for thisdir in $libspath; do
4612 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4613 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4614 $test -f "$xxx" && eval $libscheck
4615 $test -f "$xxx" && libstyle=shared
4617 if test ! -f "$xxx"; then
4618 xxx=$thisdir/lib$thislib.$so
4619 $test -f "$xxx" && eval $libscheck
4620 $test -f "$xxx" && libstyle=shared
4622 if test ! -f "$xxx"; then
4623 xxx=$thisdir/lib$thislib$_a
4624 $test -f "$xxx" && eval $libscheck
4625 $test -f "$xxx" && libstyle=static
4627 if test ! -f "$xxx"; then
4628 xxx=$thisdir/$thislib$_a
4629 $test -f "$xxx" && eval $libscheck
4630 $test -f "$xxx" && libstyle=static
4632 if test ! -f "$xxx"; then
4633 xxx=$thisdir/lib${thislib}_s$_a
4634 $test -f "$xxx" && eval $libscheck
4635 $test -f "$xxx" && libstyle=static
4636 $test -f "$xxx" && thislib=${thislib}_s
4638 if test ! -f "$xxx"; then
4639 xxx=$thisdir/Slib$thislib$_a
4640 $test -f "$xxx" && eval $libscheck
4641 $test -f "$xxx" && libstyle=static
4643 if $test -f "$xxx"; then
4645 shared) echo "Found -l$thislib (shared)." ;;
4646 static) echo "Found -l$thislib." ;;
4647 *) echo "Found -l$thislib ($libstyle)." ;;
4651 *) dflt="$dflt -l$thislib"
4652 libsfound="$libsfound $xxx"
4654 libsfiles="$libsfiles $yyy"
4655 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4656 case " $libsdirs " in
4658 *) libsdirs="$libsdirs $yyy" ;;
4665 if $test ! -f "$xxx"; then
4666 echo "No -l$thislib."
4677 ' '|'') dflt='none';;
4682 In order to compile $package on your machine, a number of libraries
4683 are usually needed. Include any other special libraries here as well.
4684 Say "none" for none. The default list is almost always right.
4688 rp="What libraries to use?"
4695 : determine optimization, if desired, or use for debug flag also
4697 ' '|$undef) dflt='none';;
4699 *) dflt="$optimize";;
4703 By default, $package compiles with the -O flag to use the optimizer.
4704 Alternately, you might want to use the symbolic debugger, which uses
4705 the -g flag (on traditional Unix systems). Either flag can be
4706 specified here. To use neither flag, specify the word "none".
4709 rp="What optimizer/debugger flag should be used?"
4713 'none') optimize=" ";;
4717 : We will not override a previous value, but we might want to
4718 : augment a hint file
4720 default|recommended)
4721 case "$gccversion" in
4722 1*) dflt='-fpcc-struct-return' ;;
4725 *-g*) dflt="$dflt -DDEBUGGING";;
4727 case "$gccversion" in
4728 2*) if test -d /etc/conf/kconfig.d &&
4729 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4731 # Interactive Systems (ISC) POSIX mode.
4736 case "$gccversion" in
4740 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
4741 echo 'int main(void) { return 0; }' > gcctest.c
4742 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
4743 echo "Yes, it does." 2>&1
4746 echo "Leaving current flags $ccflags alone." 2>&1
4748 *) dflt="$dflt -fno-strict-aliasing" ;;
4751 echo "Nope, it doesn't, but that's ok." 2>&1
4755 # For gcc, adding -pipe speeds up compilations for some, but apparently
4756 # some assemblers can't read from stdin. (It also slows down compilations
4757 # in other cases, but those are apparently rarer these days.) AD 5/2004.
4758 case "$gccversion" in
4760 echo "Checking if your compiler accepts -pipe" 2>&1
4761 echo 'int main(void) { return 0; }' > gcctest.c
4762 if $cc -pipe -o gcctest gcctest.c; then
4763 echo "Yes, it does." 2>&1
4766 echo "Leaving current flags $ccflags alone." 2>&1
4768 *) dflt="$dflt -pipe" ;;
4771 echo "Nope, it doesn't, but that's ok." 2>&1
4774 echo "Checking if your compiler accepts -Wdeclaration-after-statement" 2>&1
4775 echo 'int main(void) { return 0; }' > gcctest.c
4776 if $cc -Wdeclaration-after-statement -o gcctest gcctest.c; then
4777 echo "Yes, it does." 2>&1
4779 *-Wdeclaration-after-statement*)
4780 echo "Leaving current flags $ccflags alone." 2>&1
4782 *) dflt="$dflt -Wdeclaration-after-statement" ;;
4785 echo "Nope, it doesn't, but that's ok." 2>&1
4792 case "$mips_type" in
4793 *BSD*|'') inclwanted="$locincpth $usrinc";;
4794 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4796 for thisincl in $inclwanted; do
4797 if $test -d $thisincl; then
4798 if $test x$thisincl != x$usrinc; then
4800 *" -I$thisincl "*);;
4801 *) dflt="$dflt -I$thisincl ";;
4807 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4809 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4817 *) dflt="$dflt -D$2";;
4821 set signal.h LANGUAGE_C; eval $inctest
4825 ccflags="$ccflags -DSOCKS"
4830 default|recommended) dflt="$ccflags $dflt" ;;
4831 *) dflt="$ccflags";;
4840 Your C compiler may want other flags. For this question you should include
4841 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4842 but you should NOT include libraries or ld flags like -lwhatever. If you
4843 want $package to honor its debug switch, you should include -DDEBUGGING here.
4844 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4846 To use no flags, specify the word "none".
4852 rp="Any additional cc flags?"
4859 : the following weeds options from ccflags that are of no interest to cpp
4861 '') cppflags="$ccflags" ;;
4862 *) cppflags="$cppflags $ccflags" ;;
4864 case "$gccversion" in
4865 1*) cppflags="$cppflags -D__GNUC__"
4867 case "$mips_type" in
4869 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4875 echo "Let me guess what the preprocessor flags are..." >&4
4889 *) ftry="$previous $flag";;
4891 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4892 >cpp1.out 2>/dev/null && \
4893 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4894 >cpp2.out 2>/dev/null && \
4895 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4896 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4898 cppflags="$cppflags $ftry"
4908 *-*) echo "They appear to be: $cppflags";;
4910 $rm -f cpp.c cpp?.out
4914 : flags used in final linking phase
4916 '') if ./venix; then
4922 *-posix*) dflt="$dflt -posix" ;;
4925 *) dflt="$ldflags";;
4928 : Try to guess additional flags to pick up local libraries.
4929 for thislibdir in $libpth; do
4930 case " $loclibpth " in
4933 *"-L$thislibdir "*) ;;
4934 *) dflt="$dflt -L$thislibdir" ;;
4946 Your C linker may need flags. For this question you should
4947 include -L/whatever and any other flags used by the C linker, but you
4948 should NOT include libraries like -lwhatever.
4950 Make sure you include the appropriate -L/path flags if your C linker
4951 does not normally search all of the directories you specified above,
4954 To use no flags, specify the word "none".
4958 rp="Any additional ld flags (NOT including libraries)?"
4964 rmlist="$rmlist pdp11"
4968 echo "Checking your choice of C compiler and flags for coherency..." >&4
4969 $cat > try.c <<'EOF'
4971 int main() { printf("Ok\n"); return(0); }
4973 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
4975 $cat >try.msg <<'EOM'
4976 I've tried to compile and run the following simple program:
4979 $cat try.c >> try.msg
4981 $cat >> try.msg <<EOM
4988 and I got the following output:
4992 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
4993 if $sh -c "$run ./try" >>try.msg 2>&1; then
4997 *) echo 'The program compiled OK, but produced no output.' >> try.msg
5000 cat >> try.msg <<'EOQS'
5001 If $libs contains -lsfio, and sfio is mis-configured, then it
5002 sometimes (apparently) runs and exits with a 0 status, but with no
5003 output! It may have to do with sfio's use of _exit vs. exit.
5006 rp="You have a big problem. Shall I abort Configure"
5013 echo "The program compiled OK, but exited with status $?." >>try.msg
5014 rp="You have a problem. Shall I abort Configure"
5018 echo "I can't compile the test program." >>try.msg
5019 rp="You have a BIG problem. Shall I abort Configure"
5025 case "$knowitall" in
5027 echo "(The supplied flags or libraries might be incorrect.)"
5035 *) echo "Ok. Stopping Configure." >&4
5040 n) echo "OK, that should do.";;
5042 $rm -f try try.* core
5044 : define a shorthand compile call
5048 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5049 : define a shorthand compile call for compilations that should be ok.
5053 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5055 : determine filename position in cpp output
5057 echo "Computing filename position in cpp output for #include directives..." >&4
5059 vos) testaccess=-e ;;
5062 echo '#include <stdio.h>' > foo.c
5065 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5066 $grep '^[ ]*#.*stdio\.h' | \
5067 while read cline; do
5070 while $test \$# -gt 0; do
5071 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5076 pos=\`expr \$pos + 1\`
5088 *) pos="${fieldn}th";;
5090 echo "Your cpp writes the filename in the $pos field of the line."
5093 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5094 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5097 : locate header file
5102 for usrincdir in $usrinc
5104 if test -f \$usrincdir/\$wanted; then
5105 echo "\$usrincdir/\$wanted"
5109 awkprg='{ print \$$fieldn }'
5110 echo "#include <\$wanted>" > foo\$\$.c
5111 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5112 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5113 while read cline; do
5114 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5116 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5117 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5122 # status = 0: grep returned 0 lines, case statement not executed
5123 # status = 1: headerfile found
5124 # status = 2: while loop executed, no headerfile found
5128 if test \$status -eq 1; then
5135 : define an alternate in-header-list? function
5136 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5137 cont=true; xxf="echo \"<\$1> found.\" >&4";
5138 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5139 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5141 case $# in 4) instead=instead;; *) instead="at last";; esac;
5142 while $test "$cont"; do
5144 var=$2; eval "was=\$$2";
5145 if $test "$xxx" && $test -r "$xxx";
5147 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5150 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5151 set $yyy; shift; shift; yyy=$@;
5152 case $# in 0) cont="";;
5153 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5154 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5155 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5156 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5160 do set $yyy; var=$2; eval "was=\$$2";
5161 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5162 set $yyy; shift; shift; yyy=$@;
5165 : see if stdlib is available
5166 set stdlib.h i_stdlib
5169 : check for lengths of integral types
5173 echo "Checking to see how big your integers are..." >&4
5182 printf("intsize=%d;\n", (int)sizeof(int));
5183 printf("longsize=%d;\n", (int)sizeof(long));
5184 printf("shortsize=%d;\n", (int)sizeof(short));
5189 if eval $compile_ok && $run ./try > /dev/null; then
5191 echo "Your integers are $intsize bytes long."
5192 echo "Your long integers are $longsize bytes long."
5193 echo "Your short integers are $shortsize bytes long."
5197 Help! I can't compile and run the intsize test program: please enlighten me!
5198 (This is probably a misconfiguration in your system or libraries, and
5199 you really ought to fix it. Still, I'll try anyway.)
5203 rp="What is the size of an integer (in bytes)?"
5207 rp="What is the size of a long integer (in bytes)?"
5211 rp="What is the size of a short integer (in bytes)?"
5219 : check for long long
5221 echo "Checking to see if you have long long..." >&4
5222 echo 'int main() { long long x = 7; return 0; }' > try.c
5224 if eval $compile; then
5226 echo "You have long long."
5229 echo "You do not have long long."
5235 : check for length of long long
5236 case "${d_longlong}${longlongsize}" in
5239 echo "Checking to see how big your long longs are..." >&4
5240 $cat >try.c <<'EOCP'
5244 printf("%d\n", (int)sizeof(long long));
5249 if eval $compile_ok; then
5250 longlongsize=`$run ./try`
5251 echo "Your long longs are $longlongsize bytes long."
5255 echo "(I can't seem to compile the test program. Guessing...)"
5256 rp="What is the size of a long long (in bytes)?"
5260 if $test "X$longsize" = "X$longlongsize"; then
5261 echo "(That isn't any different from an ordinary long.)"
5267 : see if inttypes.h is available
5268 : we want a real compile instead of Inhdr because some systems
5269 : have an inttypes.h which includes non-existent headers
5272 #include <inttypes.h>
5274 static int32_t foo32 = 0x12345678;
5278 if eval $compile; then
5279 echo "<inttypes.h> found." >&4
5282 echo "<inttypes.h> NOT found." >&4
5291 echo "Checking to see if you have int64_t..." >&4
5293 #include <sys/types.h>
5294 #$i_inttypes I_INTTYPES
5296 #include <inttypes.h>
5298 int main() { int64_t x = 7; }
5301 if eval $compile; then
5303 echo "You have int64_t."
5306 echo "You do not have int64_t."
5314 echo "Checking which 64-bit integer type we could use..." >&4
5320 val='"unsigned int"'
5325 *) case "$longsize" in
5329 val='"unsigned long"'
5334 *) case "$d_longlong:$longlongsize" in
5339 val='"unsigned long long"'
5344 *) case "$d_int64_t" in
5363 '') echo "Alas, no 64-bit integer types in sight." >&4
5366 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5372 case "$uselonglong" in
5373 "$define"|true|[yY]*)
5376 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5378 use64bitint="$define"
5381 case "$use64bits" in
5382 "$define"|true|[yY]*)
5385 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5387 use64bitint="$define"
5390 case "$use64bitints" in
5391 "$define"|true|[yY]*)
5394 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5396 use64bitint="$define"
5399 case "$use64bitsint" in
5400 "$define"|true|[yY]*)
5403 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5405 use64bitint="$define"
5408 case "$uselonglongs" in
5409 "$define"|true|[yY]*)
5412 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5414 use64bitint="$define"
5417 case "$use64bitsall" in
5418 "$define"|true|[yY]*)
5421 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5423 use64bitall="$define"
5428 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5430 case "$use64bitall" in
5431 "$define"|true|[yY]*) use64bitint="$define" ;;
5437 You have natively 64-bit long integers.
5441 *) case "$use64bitint" in
5442 "$define"|true|[yY]*) dflt='y';;
5451 Perl can be built to take advantage of 64-bit integer types
5452 on some systems. To do so, Configure can be run with -Duse64bitint.
5453 Choosing this option will most probably introduce binary incompatibilities.
5455 If this doesn't make any sense to you, just accept the default '$dflt'.
5456 (The default has been chosen based on your configuration.)
5458 rp='Try to use 64-bit integers, if available?'
5461 [yY]*) val="$define" ;;
5469 case "$use64bitall" in
5470 "$define"|true|[yY]*) dflt='y' ;;
5471 *) case "$longsize" in
5479 You may also choose to try maximal 64-bitness. It means using as much
5480 64-bitness as possible on the platform. This in turn means even more
5481 binary incompatibilities. On the other hand, your platform may not
5482 have any more 64-bitness available than what you already have chosen.
5484 If this doesn't make any sense to you, just accept the default '$dflt'.
5485 (The default has been chosen based on your configuration.)
5487 rp='Try to use maximal 64-bit support, if available?'
5490 [yY]*) val="$define" ;;
5495 case "$use64bitall" in
5497 case "$use64bitint" in
5501 Since you have chosen a maximally 64-bit build, I'm also turning on
5502 the use of 64-bit integers.
5504 use64bitint="$define" ;;
5509 : Look for a hint-file generated 'call-back-unit'. If the
5510 : user has specified that a 64-bit perl is to be built,
5511 : we may need to set or change some other defaults.
5512 if $test -f use64bitint.cbu; then
5513 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5516 case "$use64bitint" in
5517 "$define"|true|[yY]*)
5519 4) case "$archname64" in
5520 '') archname64=64int ;;
5527 : Look for a hint-file generated 'call-back-unit'. If the
5528 : user has specified that a maximally 64-bit perl is to be built,
5529 : we may need to set or change some other defaults.
5530 if $test -f use64bitall.cbu; then
5531 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5534 case "$use64bitall" in
5535 "$define"|true|[yY]*)
5537 4) case "$archname64" in
5538 ''|64int) archname64=64all ;;
5545 case "$d_quad:$use64bitint" in
5549 *** You have chosen to use 64-bit integers,
5550 *** but none can be found.
5551 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5552 *** Cannot continue, aborting.
5559 : check for length of double
5561 case "$doublesize" in
5563 echo "Checking to see how big your double precision numbers are..." >&4
5572 printf("%d\n", (int)sizeof(double));
5577 if eval $compile_ok; then
5578 doublesize=`$run ./try`
5579 echo "Your double is $doublesize bytes long."
5582 echo "(I can't seem to compile the test program. Guessing...)"
5583 rp="What is the size of a double precision number (in bytes)?"
5591 : check for long doubles
5593 echo "Checking to see if you have long double..." >&4
5594 echo 'int main() { long double x = 7.0; }' > try.c
5596 if eval $compile; then
5598 echo "You have long double."
5601 echo "You do not have long double."
5607 : check for length of long double
5608 case "${d_longdbl}${longdblsize}" in
5611 echo "Checking to see how big your long doubles are..." >&4
5612 $cat >try.c <<'EOCP'
5616 printf("%d\n", sizeof(long double));
5621 if eval $compile; then
5622 longdblsize=`$run ./try`
5623 echo "Your long doubles are $longdblsize bytes long."
5627 echo "(I can't seem to compile the test program. Guessing...)" >&4
5628 rp="What is the size of a long double (in bytes)?"
5632 if $test "X$doublesize" = "X$longdblsize"; then
5633 echo "That isn't any different from an ordinary double."
5634 echo "I'll keep your setting anyway, but you may see some"
5635 echo "harmless compilation warnings."
5641 : determine the architecture name
5643 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5644 tarch=`arch`"-$osname"
5645 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5646 if uname -m > tmparch 2>&1 ; then
5647 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5648 -e 's/$/'"-$osname/" tmparch`
5656 case "$myarchname" in
5659 echo "(Your architecture name used to be $myarchname.)"
5663 case "$targetarch" in
5665 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
5670 *) dflt="$archname";;
5672 rp='What is your architecture name'
5675 case "$usethreads" in
5677 echo "Threads selected." >&4
5679 *-thread*) echo "...and architecture name already has -thread." >&4
5681 *) archname="$archname-thread"
5682 echo "...setting architecture name to $archname." >&4
5687 case "$usemultiplicity" in
5689 echo "Multiplicity selected." >&4
5691 *-multi*) echo "...and architecture name already has -multi." >&4
5693 *) archname="$archname-multi"
5694 echo "...setting architecture name to $archname." >&4
5699 case "$use64bitint$use64bitall" in
5701 case "$archname64" in
5703 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
5706 case "$use64bitint" in
5707 "$define") echo "64 bit integers selected." >&4 ;;
5709 case "$use64bitall" in
5710 "$define") echo "Maximal 64 bitness selected." >&4 ;;
5713 *-$archname64*) echo "...and architecture name already has $archname64." >&4
5715 *) archname="$archname-$archname64"
5716 echo "...setting architecture name to $archname." >&4
5722 case "$uselongdouble" in
5724 echo "Long doubles selected." >&4
5725 case "$longdblsize" in
5727 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
5731 *-ld*) echo "...and architecture name already has -ld." >&4
5733 *) archname="$archname-ld"
5734 echo "...setting architecture name to $archname." >&4
5741 case "$useperlio" in
5743 echo "Perlio selected." >&4
5746 echo "Perlio not selected, using stdio." >&4
5748 *-stdio*) echo "...and architecture name already has -stdio." >&4
5750 *) archname="$archname-stdio"
5751 echo "...setting architecture name to $archname." >&4
5756 if $test -f archname.cbu; then
5757 echo "Your platform has some specific hints for architecture name, using them..."
5761 : determine root of directory hierarchy where package will be installed.
5764 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
5767 dflt=`echo "$prefix" | sed 's/.$//'`
5775 By default, $package will be installed in $dflt/bin, manual pages
5776 under $dflt/man, etc..., i.e. with $dflt as prefix for all
5777 installation directories. Typically this is something like /usr/local.
5778 If you wish to have binaries under /usr/bin but other parts of the
5779 installation under /usr/local, that's ok: you will be prompted
5780 separately for each of the installation directories, the prefix being
5781 only used to set the defaults.
5785 rp='Installation prefix to use?'
5793 *) oldprefix="$prefix";;
5802 *) afsroot=$afsroot ;;
5808 $define|true) afs=true ;;
5809 $undef|false) afs=false ;;
5810 *) if test -d $afsroot; then
5818 echo "AFS may be running... I'll be extra cautious then..." >&4
5820 echo "AFS does not seem to be running..." >&4
5823 : determine installation prefix for where package is to be installed.
5827 Since you are running AFS, I need to distinguish the directory in which
5828 files will reside from the directory in which they are installed (and from
5829 which they are presumably copied to the former directory by occult means).
5832 case "$installprefix" in
5833 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
5834 *) dflt="$installprefix";;
5839 In some special cases, particularly when building $package for distribution,
5840 it is convenient to distinguish the directory in which files should be
5841 installed from the directory ($prefix) in which they will
5842 eventually reside. For most users, these two directories are the same.
5845 case "$installprefix" in
5847 *) dflt=$installprefix;;
5851 rp='What installation prefix should I use for installing files?'
5853 installprefix="$ans"
5854 installprefixexp="$ansexp"
5856 : set the prefixit variable, to compute a suitable default value
5857 prefixit='case "$3" in
5859 case "$oldprefix" in
5860 "") eval "$1=\"\$$2\"";;
5867 ""|" ") eval "$1=\"\$$2\"";;
5873 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
5875 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
5876 /*-$oldprefix/*|\~*-$oldprefix/*)
5877 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
5878 *) eval "$1=\"\$$2\"";;
5882 : get the patchlevel
5884 echo "Getting the current patchlevel..." >&4
5885 if $test -r $rsrc/patchlevel.h;then
5886 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
5887 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
5888 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5889 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
5890 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
5891 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5892 perl_patchlevel=`grep ',"DEVEL[0-9][0-9]*"' $rsrc/patchlevel.h|sed 's/[^0-9]//g'`
5901 $echo "(You do not have patchlevel.h. Eek.)"
5903 if $test -r $rsrc/.patch ; then
5904 if $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
5905 perl_patchlevel=`cat $rsrc/.patch`
5908 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
5909 version_patchlevel_string="version $patchlevel subversion $subversion"
5910 case "$perl_patchlevel" in
5912 *) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;;
5915 $echo "(You have $package $version_patchlevel_string.)"
5919 : XXX Should be a Configure test for double-dots in filenames.
5920 version=`echo $revision $patchlevel $subversion | \
5921 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
5922 api_versionstring=`echo $api_revision $api_version $api_subversion | \
5923 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
5926 version=`echo $revision $patchlevel $subversion | \
5927 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
5928 api_versionstring=`echo $api_revision $api_version $api_subversion | \
5929 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
5932 : Special case the 5.005_xx maintenance series, which used 5.005
5933 : without any subversion label as a subdirectory in $sitelib
5934 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
5935 api_versionstring='5.005'
5938 : determine installation style
5939 : For now, try to deduce it from prefix unless it is already set.
5940 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
5941 case "$installstyle" in
5942 '') case "$prefix" in
5943 *perl*) dflt='lib';;
5944 *) dflt='lib/perl5' ;;
5947 *) dflt="$installstyle" ;;
5949 : Probably not worth prompting for this since we prompt for all
5950 : the directories individually, and the prompt would be too long and
5954 : determine where private library files go
5955 : Usual default is /usr/local/lib/perl5/$version.
5956 : Also allow things like /opt/perl/lib/$version, since
5957 : /opt/perl/lib/perl5... would be redundant.
5958 : The default "style" setting is made in installstyle.U
5959 case "$installstyle" in
5960 *lib/perl5*) set dflt privlib lib/$package/$version ;;
5961 *) set dflt privlib lib/$version ;;
5966 There are some auxiliary files for $package that need to be put into a
5967 private library directory that is accessible by everyone.
5971 rp='Pathname where the private library files will reside?'
5974 privlibexp="$ansexp"
5975 : Change installation prefix, if necessary.
5976 if $test X"$prefix" != X"$installprefix"; then
5977 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
5979 installprivlib="$privlibexp"
5982 : set the prefixup variable, to restore leading tilda escape
5983 prefixup='case "$prefixexp" in
5985 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
5988 : determine where public architecture dependent libraries go
5991 : privlib default is /usr/local/lib/$package/$version
5992 : archlib default is /usr/local/lib/$package/$version/$archname
5993 : privlib may have an optional trailing /share.
5994 tdflt=`echo $privlib | $sed 's,/share$,,'`
5995 tdflt=$tdflt/$archname
6004 $spackage contains architecture-dependent library files. If you are
6005 sharing libraries in a heterogeneous environment, you might store
6006 these files in a separate location. Otherwise, you can just include
6007 them with the rest of the public library files.
6011 rp='Where do you want to put the public architecture-dependent libraries?'
6014 archlibexp="$ansexp"
6015 if $test X"$archlib" = X"$privlib"; then
6020 : Change installation prefix, if necessary.
6021 if $test X"$prefix" != X"$installprefix"; then
6022 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
6024 installarchlib="$archlibexp"
6027 : see if setuid scripts can be secure
6030 Some kernels have a bug that prevents setuid #! scripts from being
6031 secure. Some sites have disabled setuid #! scripts because of this.
6033 First let's decide if your kernel supports secure setuid #! scripts.
6034 (If setuid #! scripts would be secure but have been disabled anyway,
6035 don't say that they are secure if asked.)
6040 if $test -d /dev/fd; then
6041 echo "#!$ls" >reflect
6042 chmod +x,u+s reflect
6043 ./reflect >flect 2>&1
6044 if $contains "/dev/fd" flect >/dev/null; then
6045 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6049 If you are not sure if they are secure, I can check but I'll need a
6050 username and password different from the one you are using right now.
6051 If you don't have such a username or don't want me to test, simply
6055 rp='Other username to test security of setuid scripts with?'
6060 case "$d_suidsafe" in
6061 '') echo "I'll assume setuid scripts are *not* secure." >&4
6064 echo "Well, the $hint value is *not* secure." >&4
6066 *) echo "Well, the $hint value *is* secure." >&4
6071 $rm -f reflect flect
6072 echo "#!$ls" >reflect
6073 chmod +x,u+s reflect
6076 echo '"su" will (probably) prompt you for '"$ans's password."
6077 su $ans -c './reflect >flect'
6078 if $contains "/dev/fd" flect >/dev/null; then
6079 echo "Okay, it looks like setuid scripts are secure." >&4
6082 echo "I don't think setuid scripts are secure." >&4
6087 rp='Does your kernel have *secure* setuid scripts?'
6090 [yY]*) val="$define";;
6095 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6096 echo "(That's for file descriptors, not floppy disks.)"
6102 $rm -f reflect flect
6104 : now see if they want to do setuid emulation
6107 case "$d_suidsafe" in
6110 echo "No need to emulate SUID scripts since they are secure here." >&4
6114 Some systems have disabled setuid scripts, especially systems where
6115 setuid scripts cannot be secure. On systems where setuid scripts have
6116 been disabled, the setuid/setgid bits on scripts are currently
6117 useless. It is possible for $package to detect those bits and emulate
6118 setuid/setgid in a secure fashion. This emulation will only work if
6119 setuid scripts have been disabled in your kernel.
6123 "$define") dflt=y ;;
6126 rp="Do you want to do setuid/setgid emulation?"
6129 [yY]*) val="$define";;
6137 : see if this is a malloc.h system
6138 : we want a real compile instead of Inhdr because some systems have a
6139 : malloc.h that just gives a compile error saying to use stdlib.h instead
6144 int main () { return 0; }
6147 if eval $compile; then
6148 echo "<malloc.h> found." >&4
6151 echo "<malloc.h> NOT found." >&4
6158 : check for void type
6160 echo "Checking to see how well your C compiler groks the void type..." >&4
6161 case "$voidflags" in
6173 extern void moo(); /* function returning void */
6174 void (*goo)(); /* ptr to func returning void */
6176 void *hue; /* generic ptr */
6189 int main() { sub(); }
6191 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6192 voidflags=$defvoidused
6193 echo "Good. It appears to support void to the level $package wants.">&4
6194 if $contains warning .out >/dev/null 2>&1; then
6195 echo "However, you might get some warnings that look like this:"
6199 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6200 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6201 echo "It supports 1..."
6202 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6203 echo "It also supports 2..."
6204 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6206 echo "And it supports 4 but not 8 definitely."
6208 echo "It doesn't support 4..."
6209 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6211 echo "But it supports 8."
6214 echo "Neither does it support 8."
6218 echo "It does not support 2..."
6219 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6221 echo "But it supports 4 and 8."
6223 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6225 echo "And it supports 4 but has not heard about 8."
6227 echo "However it supports 8 but not 4."
6232 echo "There is no support at all for void."
6237 case "$voidflags" in
6240 Support flag bits are:
6241 1: basic void declarations.
6242 2: arrays of pointers to functions returning void.
6243 4: operations between pointers to and addresses of void functions.
6244 8: generic void pointers.
6247 rp="Your void support flags add up to what?"
6254 : check for length of pointer
6258 echo "Checking to see how big your pointers are..." >&4
6259 if test "$voidflags" -gt 7; then
6260 echo '#define VOID_PTR char *' > try.c
6262 echo '#define VOID_PTR void *' > try.c
6272 printf("%d\n", (int)sizeof(VOID_PTR));
6277 if eval $compile_ok; then
6278 ptrsize=`$run ./try`
6279 echo "Your pointers are $ptrsize bytes long."
6282 echo "(I can't seem to compile the test program. Guessing...)" >&4
6283 rp="What is the size of a pointer (in bytes)?"
6290 case "$use64bitall" in
6291 "$define"|true|[yY]*)
6295 *** You have chosen a maximally 64-bit build,
6296 *** but your pointers are only 4 bytes wide.
6297 *** Please rerun Configure without -Duse64bitall.
6302 *** Since you have quads, you could possibly try with -Duse64bitint.
6307 *** Cannot continue, aborting.
6318 : determine whether to use malloc wrapping
6320 case "$usemallocwrap" in
6321 [yY]*|true|$define) dflt='y' ;;
6322 [nN]*|false|$undef) dflt='n' ;;
6323 *) case "$usedevel" in
6324 [yY]*|true|$define) dflt='y' ;;
6329 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6331 usemallocwrap="$ans"
6334 usemallocwrap="$define" ;;
6336 usemallocwrap="$undef" ;;
6339 : determine which malloc to compile in
6341 case "$usemymalloc" in
6342 [yY]*|true|$define) dflt='y' ;;
6343 [nN]*|false|$undef) dflt='n' ;;
6344 *) case "$ptrsize" in
6350 rp="Do you wish to attempt to use the malloc that comes with $package?"
6356 mallocsrc='malloc.c'
6357 mallocobj="malloc$_o"
6358 d_mymalloc="$define"
6361 : Remove malloc from list of libraries to use
6362 echo "Removing unneeded -lmalloc from library list" >&4
6363 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6366 echo "libs = $libs" >&4
6378 : compute the return types of malloc and free
6380 $cat >malloc.c <<END
6384 #include <sys/types.h>
6398 case "$malloctype" in
6400 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6407 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6411 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6418 echo "Your system uses $freetype free(), it would seem." >&4
6422 After $package is installed, you may wish to install various
6423 add-on modules and utilities. Typically, these add-ons will
6424 be installed under $prefix with the rest
6425 of this package. However, you may wish to install such add-ons
6426 elsewhere under a different prefix.
6428 If you do not wish to put everything under a single prefix, that's
6429 ok. You will be prompted for the individual locations; this siteprefix
6430 is only used to suggest the defaults.
6432 The default should be fine for most people.
6436 rp='Installation prefix to use for add-on modules and utilities?'
6437 : XXX Here might be another good place for an installstyle setting.
6438 case "$siteprefix" in
6440 *) dflt=$siteprefix ;;
6443 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6445 case "$siteprefix" in
6449 *) oldsiteprefix="$prefix";;
6454 siteprefixexp="$ansexp"
6456 : determine where site specific libraries go.
6457 : Usual default is /usr/local/lib/perl5/site_perl/$version
6458 : The default "style" setting is made in installstyle.U
6459 : XXX No longer works with Prefixit stuff.
6460 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6462 '') case "$installstyle" in
6463 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6464 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6472 The installation process will create a directory for
6473 site-specific extensions and modules. Most users find it convenient
6474 to place all site-specific files in this directory rather than in the
6475 main distribution directory.
6479 rp='Pathname for the site-specific library files?'
6482 sitelibexp="$ansexp"
6483 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6484 : Change installation prefix, if necessary.
6485 if $test X"$prefix" != X"$installprefix"; then
6486 installsitelib=`echo $sitelibexp | $sed "s#^$prefix#$installprefix#"`
6488 installsitelib="$sitelibexp"
6491 : determine where site specific architecture-dependent libraries go.
6492 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6493 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6494 : sitelib may have an optional trailing /share.
6496 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6497 dflt="$dflt/$archname"
6502 set sitearch sitearch none
6506 The installation process will also create a directory for
6507 architecture-dependent site-specific extensions and modules.
6511 rp='Pathname for the site-specific architecture-dependent library files?'
6514 sitearchexp="$ansexp"
6515 : Change installation prefix, if necessary.
6516 if $test X"$prefix" != X"$installprefix"; then
6517 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
6519 installsitearch="$sitearchexp"
6524 The installation process will also create a directory for
6525 vendor-supplied add-ons. Vendors who supply perl with their system
6526 may find it convenient to place all vendor-supplied files in this
6527 directory rather than in the main distribution directory. This will
6528 ease upgrades between binary-compatible maintenance versions of perl.
6530 Of course you may also use these directories in whatever way you see
6531 fit. For example, you might use them to access modules shared over a
6532 company-wide network.
6534 The default answer should be fine for most people.
6535 This causes further questions about vendor add-ons to be skipped
6536 and no vendor-specific directories will be configured for perl.
6539 rp='Do you want to configure vendor-specific add-on directories?'
6540 case "$usevendorprefix" in
6541 define|true|[yY]*) dflt=y ;;
6542 *) : User may have set vendorprefix directly on Configure command line.
6543 case "$vendorprefix" in
6552 rp='Installation prefix to use for vendor-supplied add-ons?'
6553 case "$vendorprefix" in
6555 *) dflt=$vendorprefix ;;
6558 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6560 case "$vendorprefix" in
6564 *) oldvendorprefix="$prefix";;
6568 usevendorprefix="$define"
6570 vendorprefixexp="$ansexp"
6572 *) usevendorprefix="$undef"
6578 case "$vendorprefix" in
6579 '') d_vendorlib="$undef"
6583 *) d_vendorlib="$define"
6584 : determine where vendor-supplied modules go.
6585 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6586 case "$vendorlib" in
6588 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6589 case "$installstyle" in
6590 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6591 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6594 *) dflt="$vendorlib"
6598 rp='Pathname for the vendor-supplied library files?'
6601 vendorlibexp="$ansexp"
6604 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6605 : Change installation prefix, if necessary.
6606 if $test X"$prefix" != X"$installprefix"; then
6607 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
6609 installvendorlib="$vendorlibexp"
6612 case "$vendorprefix" in
6613 '') d_vendorarch="$undef"
6617 *) d_vendorarch="$define"
6618 : determine where vendor-supplied architecture-dependent libraries go.
6619 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6620 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6621 : vendorlib may have an optional trailing /share.
6622 case "$vendorarch" in
6623 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6624 dflt="$dflt/$archname"
6626 *) dflt="$vendorarch" ;;
6629 rp='Pathname for vendor-supplied architecture-dependent files?'
6632 vendorarchexp="$ansexp"
6635 : Change installation prefix, if necessary.
6636 if $test X"$prefix" != X"$installprefix"; then
6637 installvendorarch=`echo $vendorarchexp | sed "s#^$prefix#$installprefix#"`
6639 installvendorarch="$vendorarchexp"
6642 : Final catch-all directories to search
6645 Lastly, you can have perl look in other directories for extensions and
6646 modules in addition to those already specified.
6647 These directories will be searched after
6651 test X"$vendorlib" != "X" && echo ' ' $vendorlib
6652 test X"$vendorarch" != "X" && echo ' ' $vendorarch
6654 case "$otherlibdirs" in
6655 ''|' ') dflt='none' ;;
6656 *) dflt="$otherlibdirs" ;;
6659 Enter a colon-separated set of extra paths to include in perl's @INC
6660 search path, or enter 'none' for no extra paths.
6664 rp='Colon-separated list of additional directories for perl to search?'
6667 ' '|''|none) otherlibdirs=' ' ;;
6668 *) otherlibdirs="$ans" ;;
6670 case "$otherlibdirs" in
6674 set d_perl_otherlibdirs
6677 : Cruising for prototypes
6679 echo "Checking out function prototypes..." >&4
6680 $cat >prototype.c <<EOCP
6685 int main(int argc, char *argv[]) {
6688 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
6689 echo "Your C compiler appears to support function prototypes."
6692 echo "Your C compiler doesn't seem to understand function prototypes."
6699 case "$prototype" in
6701 *) ansi2knr='ansi2knr'
6706 This version of $package can only be compiled by a compiler that
6707 understands function prototypes. Unfortunately, your C compiler
6709 doesn't seem to understand them. Sorry about that.
6711 If GNU cc is available for your system, perhaps you could try that instead.
6713 Eventually, we hope to support building Perl with pre-ANSI compilers.
6714 If you would like to help in that effort, please contact <perlbug@perl.org>.
6716 Aborting Configure now.
6722 : determine where public executables go
6727 rp='Pathname where the public executables will reside?'
6729 if $test "X$ansexp" != "X$binexp"; then
6734 : Change installation prefix, if necessary.
6735 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6736 if $test X"$prefix" != X"$installprefix"; then
6737 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
6739 installbin="$binexp"
6748 Perl can be built with extra modules or bundles of modules which
6749 will be fetched from the CPAN and installed alongside Perl.
6751 Notice that you will need access to the CPAN; either via the Internet,
6752 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
6753 be asked later to configure the CPAN.pm module which will in turn do
6754 the installation of the rest of the extra modules or bundles.)
6756 Notice also that if the modules require any external software such as
6757 libraries and headers (the libz library and the zlib.h header for the
6758 Compress::Zlib module, for example) you MUST have any such software
6759 already installed, this configuration process will NOT install such
6762 If this doesn't make any sense to you, just accept the default '$dflt'.
6764 rp='Install any extra modules (y or n)?'
6770 Please list any extra modules or bundles to be installed from CPAN,
6771 with spaces between the names. The names can be in any format the
6772 'install' command of CPAN.pm will understand. (Answer 'none',
6773 without the quotes, to install no extra modules or bundles.)
6783 $rm -f ../extras.lst
6785 *) echo "(Saving the list of extras for later...)"
6786 echo "$extras" > ../extras.lst
6794 : determine where html pages for programs go
6795 set html1dir html1dir none
6799 If you wish to install html files for programs in $spackage, indicate
6800 the appropriate directory here. To skip installing html files,
6804 ''|none|$undef|' ') dflt=none ;;
6805 *) dflt=$html1dir ;;
6808 rp="Directory for the main $spackage html pages?"
6811 html1direxp="$ansexp"
6812 : Use ' ' for none so value is preserved next time through Configure
6813 $test X"$html1dir" = "X" && html1dir=' '
6814 : Change installation prefix, if necessary.
6815 if $test X"$prefix" != X"$installprefix"; then
6816 installhtml1dir=`echo $html1direxp | sed "s#^$prefix#$installprefix#"`
6818 installhtml1dir="$html1direxp"
6821 : determine where html pages for libraries and modules go
6822 set html3dir html3dir none
6826 If you wish to install html files for modules associated with $spackage,
6827 indicate the appropriate directory here. To skip installing html files,
6830 : There is no obvious default. If they have specified html1dir, then
6831 : try to key off that, possibly changing .../html1 into .../html3.
6833 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
6834 *) dflt=$html3dir ;;
6837 rp="Directory for the $spackage module html pages?"
6840 html3direxp="$ansexp"
6841 : Use ' ' for none so value is preserved next time through Configure
6842 $test X"$html3dir" = "X" && html3dir=' '
6843 : Change installation prefix, if necessary.
6844 if $test X"$prefix" != X"$installprefix"; then
6845 installhtml3dir=`echo $html3direxp | sed "s#^$prefix#$installprefix#"`
6847 installhtml3dir="$html3direxp"
6850 : Find perl5.005 or later.
6851 echo "Looking for a previously installed perl5.005 or later... "
6853 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6854 : Check if this perl is recent and can load a simple module
6855 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6858 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6868 '') echo "None found. That's ok.";;
6869 *) echo "Using $perl5." ;;
6872 : Determine list of previous versions to include in @INC
6873 $cat > getverlist <<EOPL
6876 \$api_versionstring = "$api_versionstring";
6877 \$version = "$version";
6878 \$stem = "$sitelib_stem";
6879 \$archname = "$archname";
6881 $cat >> getverlist <<'EOPL'
6882 # Can't have leading @ because metaconfig interprets it as a command!
6883 ;@inc_version_list=();
6884 # XXX Redo to do opendir/readdir?
6887 ;@candidates = glob("5.*");
6893 # XXX ToDo: These comparisons must be reworked when two-digit
6894 # subversions come along, so that 5.7.10 compares as greater than
6895 # 5.7.3! By that time, hope that 5.6.x is sufficiently
6896 # widespread that we can use the built-in version vectors rather
6897 # than reinventing them here. For 5.6.0, however, we must
6898 # assume this script will likely be run by 5.005_0x. --AD 1/2000.
6899 foreach $d (@candidates) {
6900 if ($d lt $version) {
6901 if ($d ge $api_versionstring) {
6902 unshift(@inc_version_list, grep { -d } "$d/$archname", $d);
6904 elsif ($d ge "5.005") {
6905 unshift(@inc_version_list, grep { -d } $d);
6909 # Skip newer version. I.e. don't look in
6910 # 5.7.0 if we're installing 5.6.1.
6914 if (@inc_version_list) {
6915 print join(' ', @inc_version_list);
6918 # Blank space to preserve value for next Configure run.
6923 case "$inc_version_list" in
6924 '') if test -x "$perl5$exe_ext"; then
6925 dflt=`$perl5 getverlist`
6930 $undef) dflt='none' ;;
6931 *) eval dflt=\"$inc_version_list\" ;;
6934 ''|' ') dflt=none ;;
6941 In order to ease the process of upgrading, this version of perl
6942 can be configured to use modules built and installed with earlier
6943 versions of perl that were installed under $prefix. Specify here
6944 the list of earlier versions that this version of perl should check.
6945 If Configure detected no earlier versions of perl installed under
6946 $prefix, then the list will be empty. Answer 'none' to tell perl
6947 to not search earlier versions.
6949 The default should almost always be sensible, so if you're not sure,
6950 just accept the default.
6953 rp='List of earlier versions to include in @INC?'
6956 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6957 *) inc_version_list="$ans" ;;
6959 case "$inc_version_list" in
6961 inc_version_list_init='0';;
6962 *) inc_version_list_init=`echo $inc_version_list |
6963 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6968 : determine whether to install perl also as /usr/bin/perl
6971 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
6973 Many scripts expect perl to be installed as /usr/bin/perl.
6975 If you want to, I can install the perl you are about to compile
6976 as /usr/bin/perl (in addition to $bin/perl).
6978 if test -f /usr/bin/perl; then
6981 However, please note that because you already have a /usr/bin/perl,
6982 overwriting that with a new Perl would very probably cause problems.
6983 Therefore I'm assuming you don't want to do that (unless you insist).
6986 case "$installusrbinperl" in
6987 "$define"|[yY]*) dflt='y';;
6993 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
6996 case "$installusrbinperl" in
6997 "$undef"|[nN]*) dflt='n';;
7001 rp="Do you want to install perl as /usr/bin/perl?"
7004 [yY]*) val="$define";;
7010 set installusrbinperl
7014 echo "Checking for GNU C Library..." >&4
7016 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7017 alone are insufficient to distinguish different versions, such as
7018 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7019 libc version 2.1.0. A. Dougherty, June 3, 2002.
7025 # ifdef __GLIBC_MINOR__
7026 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
7027 # include <gnu/libc-version.h>
7028 printf("%s\n", gnu_get_libc_version());
7030 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7033 printf("%d\n", __GLIBC__);
7042 if eval $compile_ok && $run ./try > glibc.ver; then
7044 gnulibc_version=`$cat glibc.ver`
7045 echo "You are using the GNU C Library version $gnulibc_version"
7049 echo "You are not using the GNU C Library"
7051 $rm -f try try.* glibc.ver
7055 : see if nm is to be used to determine whether a symbol is defined or not
7059 case "$d_gnulibc" in
7062 echo "nm probably won't work on the GNU C Library." >&4
7068 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7070 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7071 echo "'nm' won't be sufficient on this sytem." >&4
7077 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7078 if $test $dflt -gt 20; then
7088 true|$define) dflt=y;;
7095 I can use $nm to extract the symbols from your C libraries. This
7096 is a time consuming task which may generate huge output on the disk (up
7097 to 3 megabytes) but that should make the symbols extraction faster. The
7098 alternative is to skip the 'nm' extraction part and to compile a small
7099 test program instead to determine whether each symbol is present. If
7100 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7101 this may be the best solution.
7103 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7106 rp="Shall I use $nm to extract C symbols from the libraries?"
7109 [Nn]*) usenm=false;;
7118 : nm options which may be necessary
7120 '') if $test -f /mach_boot; then
7122 elif $test -d /usr/ccs/lib; then
7123 nm_opt='-p' # Solaris (and SunOS?)
7124 elif $test -f /dgux; then
7126 elif $test -f /lib64/rld; then
7127 nm_opt='-p' # 64-bit Irix
7133 : nm options which may be necessary for shared libraries but illegal
7134 : for archive libraries. Thank you, Linux.
7135 case "$nm_so_opt" in
7136 '') case "$myuname" in
7138 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7139 nm_so_opt='--dynamic'
7148 : get list of predefined functions in a handy place
7153 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7159 *) for thislib in $libs; do
7162 : Handle C library specially below.
7165 thislib=`echo $thislib | $sed -e 's/^-l//'`
7166 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7168 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7170 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7172 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7174 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7176 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7178 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7183 libnames="$libnames $try"
7185 *) libnames="$libnames $thislib" ;;
7194 for xxx in $libpth; do
7195 $test -r $1 || set $xxx/libc.$so
7196 : The messy sed command sorts on library version numbers.
7198 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7199 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7201 s/[0-9][0-9]*/0000&/g
7202 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7205 $sort | $sed -e 's/^.* //'`
7208 $test -r $1 || set /usr/ccs/lib/libc.$so
7209 $test -r $1 || set /lib/libsys_s$_a
7215 if $test -r "$1"; then
7216 echo "Your (shared) C library seems to be in $1."
7218 elif $test -r /lib/libc && $test -r /lib/clib; then
7219 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7221 libc='/lib/clib /lib/libc'
7222 if $test -r /lib/syslib; then
7223 echo "(Your math library is in /lib/syslib.)"
7224 libc="$libc /lib/syslib"
7226 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7227 echo "Your C library seems to be in $libc, as you said before."
7228 elif $test -r $incpath/usr/lib/libc$_a; then
7229 libc=$incpath/usr/lib/libc$_a;
7230 echo "Your C library seems to be in $libc. That's fine."
7231 elif $test -r /lib/libc$_a; then
7233 echo "Your C library seems to be in $libc. You're normal."
7235 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7237 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7238 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7239 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7241 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7243 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7246 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7248 if $test -r "$tans"; then
7249 echo "Your C library seems to be in $tans, of all places."
7255 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7259 If the guess above is wrong (which it might be if you're using a strange
7260 compiler, or your machine supports multiple models), you can override it here.
7265 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7267 I can't seem to find your C library. I've looked in the following places:
7270 $sed 's/^/ /' libpath
7273 None of these seems to contain your C library. I need to get its name...
7278 rp='Where is your C library?'
7283 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7284 set X `cat libnames`
7287 case $# in 1) xxx=file; esac
7288 echo "Extracting names from the following $xxx for later perusal:" >&4
7290 $sed 's/^/ /' libnames >&4
7292 $echo $n "This may take a while...$c" >&4
7296 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7297 *) $nm $nm_opt $file 2>/dev/null;;
7302 $grep fprintf libc.tmp > libc.ptf
7303 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7304 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7306 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7308 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7310 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7312 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7314 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7316 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7318 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7320 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7322 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7324 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7326 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7328 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7330 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7331 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7333 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7335 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7337 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7339 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7341 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7343 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7345 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7347 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7349 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7351 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7353 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7355 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7357 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7359 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7361 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7364 $nm -p $* 2>/dev/null >libc.tmp
7365 $grep fprintf libc.tmp > libc.ptf
7366 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7367 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7373 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7375 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
7376 for thisname in $libnames $libc; do
7377 $ar t $thisname >>libc.tmp
7379 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7381 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7382 # Repeat libc to extract forwarders to DLL entries too
7383 for thisname in $libnames $libc; do
7384 $ar tv $thisname >>libc.tmp
7385 # Revision 50 of EMX has bug in $ar.
7386 # it will not extract forwarders to DLL entries
7387 # Use emximp which will extract exactly them.
7388 emximp -o tmp.imp $thisname \
7390 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7391 < tmp.imp >>libc.tmp
7394 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7397 echo "$ar didn't seem to work right." >&4
7398 echo "Maybe this is a Cray...trying bld instead..." >&4
7399 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
7401 for thisname in $libnames; do
7403 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7404 $ar t $thisname >>libc.tmp
7408 echo "That didn't work either. Giving up." >&4
7418 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7419 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7421 *) if $test -f /lib/syscalls.exp; then
7423 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7424 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' /lib/syscalls.exp >>libc.list
7430 $rm -f libnames libpath
7432 : see if dld is available
7436 : is a C symbol defined?
7439 -v) tf=libc.tmp; tdc="";;
7440 -a) tf=libc.tmp; tdc="[]";;
7441 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7444 case "$reuseval-$4" in
7446 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7451 if $test "$runnm" = true; then
7452 if $contains $tlook $tf >/dev/null 2>&1; then
7454 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7455 echo "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7456 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7457 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7458 $rm -f try$_exe try.c core core.* try.core;
7461 echo "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7462 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7463 $rm -f try$_exe try.c;
7468 $define) tval=true;;
7475 : define an is-in-libc? function
7476 inlibc='echo " "; td=$define; tu=$undef;
7477 sym=$1; var=$2; eval "was=\$$2";
7479 case "$reuseval$was" in
7489 echo "$sym() found." >&4;
7490 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7492 echo "$sym() NOT found." >&4;
7493 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7497 $define) echo "$sym() found." >&4;;
7498 *) echo "$sym() NOT found." >&4;;
7502 : see if dlopen exists
7509 : determine which dynamic loading, if any, to compile in
7511 dldir="ext/DynaLoader"
7524 $define) dflt='y' ;;
7527 $define) dflt='y' ;;
7529 : Does a dl_xxx.xs file exist for this operating system
7530 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7533 rp="Do you wish to use dynamic loading?"
7540 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7541 dflt="$dldir/dl_${osname}.xs"
7542 elif $test "$d_dlopen" = "$define" ; then
7543 dflt="$dldir/dl_dlopen.xs"
7544 elif $test "$i_dld" = "$define" ; then
7545 dflt="$dldir/dl_dld.xs"
7550 *) dflt="$dldir/$dlsrc"
7553 echo "The following dynamic loading files are available:"
7554 : Can not go over to $dldir because getfile has path hard-coded in.
7555 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7556 rp="Source file to use for dynamic loading"
7562 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7566 Some systems may require passing special flags to $cc -c to
7567 compile modules that will be used to create a shared library.
7568 To use no flags, say "none".
7571 case "$cccdlflags" in
7572 '') case "$gccversion" in
7573 '') case "$osname" in
7575 next) dflt='none' ;;
7576 irix*) dflt='-KPIC' ;;
7577 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7578 sunos) dflt='-pic' ;;
7582 *) case "$osname" in
7583 darwin) dflt='none' ;;
7584 svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7589 *) dflt="$cccdlflags" ;;
7591 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7594 none) cccdlflags=' ' ;;
7595 *) cccdlflags="$ans" ;;
7600 Some systems use ld to create libraries that can be dynamically loaded,
7601 while other systems (such as those using ELF) use $cc.
7605 '') $cat >try.c <<EOM
7606 /* Test for whether ELF binaries are produced */
7614 int i = open("a.out",O_RDONLY);
7617 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7618 exit(0); /* succeed (yes, it's ELF) */
7623 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7625 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7629 echo "I'll use ld to build dynamic libraries."
7638 rp="What command should be used to create dynamic libraries?"
7644 Some systems may require passing special flags to $ld to create a
7645 library that can be dynamically loaded. If your ld flags include
7646 -L/other/path options to locate libraries outside your loader's normal
7647 search path, you may need to specify those -L options here as well. To
7648 use no flags, say "none".
7651 case "$lddlflags" in
7652 '') case "$osname" in
7653 beos) dflt='-nostart' ;;
7655 case "$gccversion" in
7656 '') dflt="$dflt +vnocompatwarnings" ;;
7659 linux|irix*|gnu*) dflt='-shared' ;;
7660 next) dflt='none' ;;
7661 solaris) dflt='-G' ;;
7662 sunos) dflt='-assert nodefinitions' ;;
7663 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
7667 *) dflt="$lddlflags" ;;
7670 : Try to guess additional flags to pick up local libraries.
7671 : Be careful not to append to a plain 'none'
7675 for thisflag in $ldflags; do
7680 *) dflt="$dflt $thisflag" ;;
7687 ''|' ') dflt='none' ;;
7690 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
7693 none) lddlflags=' ' ;;
7694 *) lddlflags="$ans" ;;
7699 Some systems may require passing special flags to $cc to indicate that
7700 the resulting executable will use dynamic linking. To use no flags,
7704 case "$ccdlflags" in
7705 '') case "$osname" in
7706 linux|hpux|gnu*) dflt='-Wl,-E' ;;
7707 next|sunos) dflt='none' ;;
7711 *) dflt="$ccdlflags" ;;
7713 rp="Any special flags to pass to $cc to use dynamic linking?"
7716 none) ccdlflags=' ' ;;
7717 *) ccdlflags="$ans" ;;
7731 # No dynamic loading being used, so don't bother even to prompt.
7734 *) case "$useshrplib" in
7735 '') case "$osname" in
7736 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
7738 also='Building a shared libperl is required for dynamic loading to work on your system.'
7743 also='Building a shared libperl is needed for MAB support.'
7761 The perl executable is normally obtained by linking perlmain.c with
7762 libperl${_a}, any static extensions (usually just DynaLoader), and
7763 any other libraries needed on this system (such as -lm, etc.). Since
7764 your system supports dynamic loading, it is probably possible to build
7765 a shared libperl.$so. If you will have more than one executable linked
7766 to libperl.$so, this will significantly reduce the size of each
7767 executable, but it may have a noticeable effect on performance. The
7768 default is probably sensible for your system.
7772 rp="Build a shared libperl.$so (y/n)"
7776 useshrplib='true' ;;
7777 *) useshrplib='false' ;;
7782 case "$useshrplib" in
7786 # Figure out a good name for libperl.so. Since it gets stored in
7787 # a version-specific architecture-dependent library, the version
7788 # number isn't really that important, except for making cc/ld happy.
7790 # A name such as libperl.so.3.1
7791 majmin="libperl.$so.$patchlevel.$subversion"
7792 # A name such as libperl.so.301
7793 majonly=`echo $patchlevel $subversion |
7794 $awk '{printf "%d%02d", $1, $2}'`
7795 majonly=libperl.$so.$majonly
7796 # I'd prefer to keep the os-specific stuff here to a minimum, and
7797 # rely on figuring it out from the naming of libc.
7798 case "${osname}${osvers}" in
7801 # XXX How handle the --version stuff for MAB?
7803 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
7806 cygwin*) # ld links against an importlib
7807 dflt=libperl$lib_ext
7809 *) # Try to guess based on whether libc has major.minor.
7811 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
7812 *libc.$so.[0-9]*) dflt=$majonly ;;
7813 *) dflt=libperl.$so ;;
7823 I need to select a good name for the shared libperl. If your system uses
7824 library names with major and minor numbers, then you might want something
7825 like $majmin. Alternatively, if your system uses a single version
7826 number for shared libraries, then you might want to use $majonly.
7827 Or, your system might be quite happy with a simple libperl.$so.
7829 Since the shared libperl will get installed into a version-specific
7830 architecture-dependent directory, the version number of the shared perl
7831 library probably isn't important, so the default should be o.k.
7834 rp='What name do you want to give to the shared libperl?'
7837 echo "Ok, I'll use $libperl"
7840 libperl="libperl${_a}"
7844 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
7848 WARNING: Use of the shrpdir variable for the installation location of
7849 the shared $libperl is not supported. It was never documented and
7850 will not work in this version. Let me (perlbug@perl.org)
7851 know of any problems this may cause.
7857 But your current setting of $shrpdir is
7858 the default anyway, so it's harmless.
7863 Further, your current attempted setting of $shrpdir
7864 conflicts with the value of $archlibexp/CORE
7865 that installperl will use.
7872 # How will the perl executable find the installed shared $libperl?
7873 # Add $xxx to ccdlflags.
7874 # If we can't figure out a command-line option, use $shrpenv to
7875 # set env LD_RUN_PATH. The main perl makefile uses this.
7876 shrpdir=$archlibexp/CORE
7879 if "$useshrplib"; then
7882 # We'll set it in Makefile.SH...
7887 freebsd|netbsd|openbsd|interix)
7888 xxx="-Wl,-R$shrpdir"
7890 bsdos|linux|irix*|dec_osf|gnu*)
7891 xxx="-Wl,-rpath,$shrpdir"
7894 # next doesn't like the default...
7897 # beos doesn't like the default, either.
7900 # hpux doesn't like the default, either.
7901 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
7904 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
7910 # Only add $xxx if it isn't already in ccdlflags.
7911 case " $ccdlflags " in
7913 *) ccdlflags="$ccdlflags $xxx"
7916 Adding $xxx to the flags
7917 passed to $ld so that the perl executable will find the
7918 installed shared $libperl.
7926 # Fix ccdlflags in AIX for building external extensions.
7927 # (For building Perl itself bare -bE:perl.exp is needed,
7928 # Makefile.SH takes care of this.)
7930 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
7932 # Respect a hint or command-line value.
7934 '') shrpenv="$tmp_shrpenv" ;;
7936 case "$ldlibpthname" in
7937 '') ldlibpthname=LD_LIBRARY_PATH ;;
7938 none) ldlibpthname='' ;;
7941 : determine where manual pages are on this system
7945 syspath='/usr/share/man/man1 /usr/man/man1'
7946 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
7947 syspath="$syspath /usr/man/u_man/man1"
7948 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
7949 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
7950 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
7951 sysman=`./loc . /usr/man/man1 $syspath`
7954 if $test -d "$sysman"; then
7955 echo "System manual is in $sysman." >&4
7957 echo "Could not find manual pages in source form." >&4
7960 : determine where manual pages go
7961 set man1dir man1dir none
7965 $spackage has manual pages available in source form.
7969 echo "However, you don't have nroff, so they're probably useless to you."
7971 '') man1dir="none";;
7974 echo "If you don't want the manual sources installed, answer 'none'."
7979 lookpath="$prefixexp/share/man/man1"
7980 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
7981 lookpath="$lookpath $prefixexp/man/p_man/man1"
7982 lookpath="$lookpath $prefixexp/man/u_man/man1"
7983 lookpath="$lookpath $prefixexp/man/man.1"
7985 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
7986 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
7996 rp="Where do the main $spackage manual pages (source) go?"
7998 if $test "X$man1direxp" != "X$ansexp"; then
8002 man1direxp="$ansexp"
8008 : Change installation prefix, if necessary.
8009 if $test X"$prefix" != X"$installprefix"; then
8010 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
8012 installman1dir="$man1direxp"
8015 : What suffix to use on installed man pages
8022 rp="What suffix should be used for the main $spackage man pages?"
8024 '') case "$man1dir" in
8038 *) dflt="$man1ext";;
8045 : see if we can have long filenames
8047 first=123456789abcdef
8049 if (echo hi >$first) 2>/dev/null; then
8050 if $test -f 123456789abcde; then
8051 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8054 echo 'You can have filenames longer than 14 characters.'>&4
8059 You can't have filenames longer than 14 chars.
8060 You can't even think about them!
8066 $rm -rf 123456789abcde*
8068 : determine where library module manual pages go
8069 set man3dir man3dir none
8073 $spackage has manual pages for many of the library modules.
8079 However, you don't have nroff, so they're probably useless to you.
8082 '') man3dir="none";;
8086 case "$d_flexfnam" in
8089 However, your system can't handle the long file names like File::Basename.3.
8092 '') man3dir="none";;
8096 echo "If you don't want the manual sources installed, answer 'none'."
8097 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8099 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8100 if $test -d "$privlib/man/man3"; then
8103 WARNING: Previous versions of perl installed man3 pages into
8104 $privlib/man/man3. This version will suggest a
8105 new default of $dflt.
8109 rp='Do you wish to preserve the old behavior?(y/n)'
8112 y*) dflt="$privlib/man/man3" ;;
8117 *) dflt="$man3dir" ;;
8124 rp="Where do the $package library man pages (source) go?"
8127 man3direxp="$ansexp"
8133 : Change installation prefix, if necessary.
8134 if $test X"$prefix" != X"$installprefix"; then
8135 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
8137 installman3dir="$man3direxp"
8140 : What suffix to use on installed man pages
8146 rp="What suffix should be used for the $package library man pages?"
8148 '') case "$man3dir" in
8162 *) dflt="$man3ext";;
8169 : see if we have to deal with yellow pages, now NIS.
8170 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8171 if $test -f /usr/etc/nibindd; then
8173 echo "I'm fairly confident you're on a NeXT."
8175 rp='Do you get the hosts file via NetInfo?'
8184 y*) hostcat='nidump hosts .';;
8185 *) case "$hostcat" in
8186 nidump*) hostcat='';;
8196 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8204 rp='Are you getting the hosts file via yellow pages?'
8207 y*) hostcat='ypcat hosts';;
8208 *) hostcat='cat /etc/hosts';;
8214 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8217 '') test -f /etc/group && groupcat='cat /etc/group';;
8220 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8223 : now get the host name
8225 echo "Figuring out host name..." >&4
8226 case "$myhostname" in
8228 echo 'Maybe "hostname" will work...'
8229 if tans=`sh -c hostname 2>&1` ; then
8237 if $test "$cont"; then
8239 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8240 if tans=`cat /etc/systemid 2>&1` ; then
8242 phostname='cat /etc/systemid'
8243 echo "Whadyaknow. Xenix always was a bit strange..."
8246 elif $test -r /etc/systemid; then
8247 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8250 if $test "$cont"; then
8251 echo 'No, maybe "uuname -l" will work...'
8252 if tans=`sh -c 'uuname -l' 2>&1` ; then
8254 phostname='uuname -l'
8256 echo 'Strange. Maybe "uname -n" will work...'
8257 if tans=`sh -c 'uname -n' 2>&1` ; then
8259 phostname='uname -n'
8261 echo 'Oh well, maybe I can mine it out of whoami.h...'
8262 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8263 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8264 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8266 case "$myhostname" in
8267 '') echo "Does this machine have an identity crisis or something?"
8270 echo "Well, you said $myhostname before..."
8271 phostname='echo $myhostname';;
8277 case "$myhostname" in
8278 '') myhostname=noname ;;
8280 : you do not want to know about this
8285 if $test "$myhostname" ; then
8287 rp='Your host name appears to be "'$myhostname'".'" Right?"
8295 : bad guess or no guess
8296 while $test "X$myhostname" = X ; do
8298 rp="Please type the (one word) name of your host:"
8303 : translate upper to lower if necessary
8304 case "$myhostname" in
8306 echo "(Normalizing case in your host name)"
8307 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8311 case "$myhostname" in
8313 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8314 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8315 echo "(Trimming domain name from host name--host name is now $myhostname)"
8317 *) case "$mydomain" in
8320 test "X$hostcat" = "Xypcat hosts" &&
8321 ypmatch "$myhostname" hosts 2>/dev/null |\
8322 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8325 test "X$hostcat" != "X" &&
8326 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8327 /[ ]$myhostname[ . ]/p" > hosts
8330 if $test -f hosts; then
8331 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8332 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8333 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8334 hosts | $sort | $uniq | \
8335 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8336 case `$echo X$dflt` in
8337 X*\ *) echo "(Several hosts in the database matched hostname)"
8340 X.) echo "(You do not have fully-qualified names in the hosts database)"
8344 echo "(I cannot locate a hosts database anywhere)"
8349 tans=`./loc resolv.conf X /etc /usr/etc`
8350 if $test -f "$tans"; then
8351 echo "(Attempting domain name extraction from $tans)"
8352 dflt=.`$sed -n -e 's/ / /g' \
8353 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8354 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8356 .) dflt=.`$sed -n -e 's/ / /g' \
8357 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8358 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8365 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8366 dflt=.`sh -c domainname 2>/dev/null`
8369 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8373 case "$dflt$osname" in
8374 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8375 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8379 .) echo "(Lost all hope -- silly guess then)"
8385 *) dflt="$mydomain";;
8389 rp="What is your domain name?"
8399 : translate upper to lower if necessary
8402 echo "(Normalizing case in your domain name)"
8403 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8407 : a little sanity check here
8408 case "$phostname" in
8411 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8412 $myhostname$mydomain|$myhostname) ;;
8414 case "$phostname" in
8416 echo "(That doesn't agree with your whoami.h file, by the way.)"
8419 echo "(That doesn't agree with your $phostname command, by the way.)"
8429 I need to get your e-mail address in Internet format if possible, i.e.
8430 something like user@host.domain. Please answer accurately since I have
8431 no easy means to double check it. The default value provided below
8432 is most probably close to reality but may not be valid from outside
8433 your organization...
8437 while test "$cont"; do
8439 '') dflt="$cf_by@$myhostname$mydomain";;
8440 *) dflt="$cf_email";;
8442 rp='What is your e-mail address?'
8448 rp='Address does not look like an Internet one. Use it anyway?'
8464 If you or somebody else will be maintaining perl at your site, please
8465 fill in the correct e-mail address here so that they may be contacted
8466 if necessary. Currently, the "perlbug" program included with perl
8467 will send mail to this address in addition to perlbug@perl.org. You may
8468 enter "none" for no administrator.
8471 case "$perladmin" in
8472 '') dflt="$cf_email";;
8473 *) dflt="$perladmin";;
8475 rp='Perl administrator e-mail address'
8479 : determine whether to only install version-specific parts.
8482 Do you want to install only the version-specific parts of the perl
8483 distribution? Usually you do *not* want to do this.
8485 case "$versiononly" in
8486 "$define"|[Yy]*|true) dflt='y' ;;
8489 rp="Do you want to install only the version-specific parts of perl?"
8492 [yY]*) val="$define";;
8498 case "$versiononly" in
8499 "$define") inc_version_list=''
8500 inc_version_list_init=0
8504 : figure out how to guarantee perl startup
8505 case "$startperl" in
8507 case "$sharpbang" in
8511 I can use the #! construct to start perl on your system. This will
8512 make startup of perl scripts faster, but may cause problems if you
8513 want to share those scripts and perl is not in a standard place
8514 ($binexp/perl) on all your platforms. The alternative is to force
8515 a shell by starting the script with a single ':' character.
8518 case "$versiononly" in
8519 "$define") dflt="$binexp/perl$version";;
8520 *) dflt="$binexp/perl";;
8522 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8525 none) startperl=": # use perl";;
8526 *) startperl="#!$ans"
8527 if $test 30 -lt `echo "$ans" | wc -c`; then
8530 WARNING: Some systems limit the #! command to 32 characters.
8531 If you experience difficulty running Perl scripts with #!, try
8532 installing Perl in a directory with a shorter pathname.
8538 *) startperl=": # use perl"
8543 echo "I'll use $startperl to start perl scripts."
8545 : figure best path for perl in scripts
8548 case "$versiononly" in
8549 "$define") perlpath="$binexp/perl$version";;
8550 *) perlpath="$binexp/perl";;
8552 case "$startperl" in
8557 I will use the "eval 'exec'" idiom to start Perl on your system.
8558 I can use the full path of your Perl binary for this purpose, but
8559 doing so may cause problems if you want to share those scripts and
8560 Perl is not always in a standard place ($binexp/perl).
8564 rp="What path shall I use in \"eval 'exec'\"?"
8571 case "$startperl" in
8573 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8576 : determine where public executable scripts go
8577 set scriptdir scriptdir
8579 case "$scriptdir" in
8582 : guess some guesses
8583 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8584 $test -d /usr/share/bin && dflt=/usr/share/bin
8585 $test -d /usr/local/script && dflt=/usr/local/script
8586 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8587 $test -d $prefixexp/script && dflt=$prefixexp/script
8591 *) dflt="$scriptdir"
8596 Some installations have a separate directory just for executable scripts so
8597 that they can mount it across multiple architectures but keep the scripts in
8598 one spot. You might, for example, have a subdirectory of /usr/share for this.
8599 Or you might just lump your scripts in with all your other executables.
8603 rp='Where do you keep publicly executable scripts?'
8605 if $test "X$ansexp" != "X$scriptdirexp"; then
8609 scriptdirexp="$ansexp"
8610 : Change installation prefix, if necessary.
8611 if $test X"$prefix" != X"$installprefix"; then
8612 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
8614 installscript="$scriptdirexp"
8617 : determine where add-on public executables go
8619 '') dflt=$siteprefix/bin ;;
8623 rp='Pathname where the add-on public executables should be installed?'
8626 sitebinexp="$ansexp"
8627 : Change installation prefix, if necessary.
8628 if $test X"$prefix" != X"$installprefix"; then
8629 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
8631 installsitebin="$sitebinexp"
8634 : determine where add-on html pages go
8635 : There is no standard location, so try to copy the previously-selected
8636 : directory structure for the core html pages.
8637 case "$sitehtml1dir" in
8638 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8639 *) dflt=$sitehtml1dir ;;
8642 ''|' ') dflt=none ;;
8645 rp='Pathname where the site-specific html pages should be installed?'
8648 sitehtml1direxp="$ansexp"
8649 : Change installation prefix, if necessary.
8650 if $test X"$prefix" != X"$installprefix"; then
8651 installsitehtml1dir=`echo $sitehtml1direxp | $sed "s#^$prefix#$installprefix#"`
8653 installsitehtml1dir="$sitehtml1direxp"
8656 : determine where add-on library html pages go
8657 : There is no standard location, so try to copy the previously-selected
8658 : directory structure for the core html pages.
8659 case "$sitehtml3dir" in
8660 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8661 *) dflt=$sitehtml3dir ;;
8664 ''|' ') dflt=none ;;
8667 rp='Pathname where the site-specific library html pages should be installed?'
8670 sitehtml3direxp="$ansexp"
8671 : Change installation prefix, if necessary.
8672 if $test X"$prefix" != X"$installprefix"; then
8673 installsitehtml3dir=`echo $sitehtml3direxp | $sed "s#^$prefix#$installprefix#"`
8675 installsitehtml3dir="$sitehtml3direxp"
8678 : determine where add-on manual pages go
8679 case "$siteman1dir" in
8680 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
8681 *) dflt=$siteman1dir ;;
8684 ''|' ') dflt=none ;;
8687 rp='Pathname where the site-specific manual pages should be installed?'
8690 siteman1direxp="$ansexp"
8691 : Change installation prefix, if necessary.
8692 if $test X"$prefix" != X"$installprefix"; then
8693 installsiteman1dir=`echo $siteman1direxp | $sed "s#^$prefix#$installprefix#"`
8695 installsiteman1dir="$siteman1direxp"
8698 : determine where add-on library man pages go
8699 case "$siteman3dir" in
8700 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
8701 *) dflt=$siteman3dir ;;
8704 ''|' ') dflt=none ;;
8707 rp='Pathname where the site-specific library manual pages should be installed?'
8710 siteman3direxp="$ansexp"
8711 : Change installation prefix, if necessary.
8712 if $test X"$prefix" != X"$installprefix"; then
8713 installsiteman3dir=`echo $siteman3direxp | $sed "s#^$prefix#$installprefix#"`
8715 installsiteman3dir="$siteman3direxp"
8718 : determine where add-on public executable scripts go
8719 case "$sitescript" in
8720 '') dflt=$siteprefix/script
8721 $test -d $dflt || dflt=$sitebin ;;
8722 *) dflt="$sitescript" ;;
8725 rp='Pathname where add-on public executable scripts should be installed?'
8728 sitescriptexp="$ansexp"
8729 : Change installation prefix, if necessary.
8730 if $test X"$prefix" != X"$installprefix"; then
8731 installsitescript=`echo $sitescriptexp | sed "s#^$prefix#$installprefix#"`
8733 installsitescript="$sitescriptexp"
8736 case "$usefaststdio" in
8737 $define|true|[yY]*|'')
8738 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
8748 Perl can be built to use 'fast stdio', which means using the stdio
8749 library but also directly manipulating the stdio buffers to enable
8750 faster I/O. Using stdio is better for backward compatibility (especially
8751 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
8752 interface has been preferred instead of stdio.
8754 If this doesn't make any sense to you, just accept the default '$dflt'.
8756 rp='Use the "fast stdio" if available?'
8759 y|Y) val="$define" ;;
8766 : define an is-a-typedef? function
8767 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8769 "") inclist="sys/types.h";;
8771 eval "varval=\$$var";
8775 for inc in $inclist; do
8776 echo "#include <$inc>" >>temp.c;
8778 echo "#ifdef $type" >> temp.c;
8779 echo "printf(\"We have $type\");" >> temp.c;
8780 echo "#endif" >> temp.c;
8781 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8782 if $contains $type temp.E >/dev/null 2>&1; then
8788 *) eval "$var=\$varval";;
8791 : define an is-a-typedef? function that prompts if the type is not available.
8792 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8794 "") inclist="sys/types.h";;
8796 eval "varval=\$$var";
8800 for inc in $inclist; do
8801 echo "#include <$inc>" >>temp.c;
8803 echo "#ifdef $type" >> temp.c;
8804 echo "printf(\"We have $type\");" >> temp.c;
8805 echo "#endif" >> temp.c;
8806 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8808 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
8809 if $contains $type temp.E >/dev/null 2>&1; then
8810 echo "$type found." >&4;
8813 echo "$type NOT found." >&4;
8819 *) eval "$var=\$varval";;
8822 : see what type lseek is declared as in the kernel
8823 rp="What is the type used for lseek's offset on this system?"
8824 set off_t lseektype long stdio.h sys/types.h
8828 echo "Checking to see how big your file offsets are..." >&4
8830 #include <sys/types.h>
8834 printf("%d\n", (int)sizeof($lseektype));
8839 if eval $compile_ok; then
8840 lseeksize=`$run ./try`
8841 echo "Your file offsets are $lseeksize bytes long."
8845 echo "(I can't seem to compile the test program. Guessing...)"
8846 rp="What is the size of your file offsets (in bytes)?"
8852 : see what type file positions are declared as in the library
8853 rp="What is the type for file position used by fsetpos()?"
8854 set fpos_t fpostype long stdio.h sys/types.h
8859 *_t) zzz="$fpostype" ;;
8862 echo "Checking the size of $zzz..." >&4
8864 #include <sys/types.h>
8871 printf("%d\n", (int)sizeof($fpostype));
8876 if eval $compile_ok; then
8880 echo "(I can't execute the test program--guessing $fpossize.)" >&4
8883 echo "Your $zzz is $fpossize bytes long."
8889 echo "(I can't compile the test program. Guessing...)" >&4
8890 rp="What is the size of your file positions (in bytes)?"
8895 # Backward compatibility (uselfs is deprecated).
8897 "$define"|true|[yY]*)
8900 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
8902 uselargefiles="$define"
8906 case "$lseeksize:$fpossize" in
8909 You can have files larger than 2 gigabytes.
8912 *) case "$uselargefiles" in
8913 "$undef"|false|[nN]*) dflt='n' ;;
8918 Perl can be built to understand large files (files larger than 2 gigabytes)
8919 on some systems. To do so, Configure can be run with -Duselargefiles.
8921 If this doesn't make any sense to you, just accept the default '$dflt'.
8923 rp='Try to understand large files, if available?'
8926 y|Y) val="$define" ;;
8933 : Look for a hint-file generated 'call-back-unit'. If the
8934 : user has specified that a large files perl is to be built,
8935 : we may need to set or change some other defaults.
8936 if $test -f uselargefiles.cbu; then
8937 echo "Your platform has some specific hints regarding large file builds, using them..."
8938 . ./uselargefiles.cbu
8940 case "$uselargefiles" in
8942 if $test -f uselargefiles.cbu; then
8944 echo "Rechecking to see how big your file offsets are..." >&4
8946 #include <sys/types.h>
8950 printf("%d\n", (int)sizeof($lseektype));
8955 if eval $compile_ok; then
8956 lseeksize=`$run ./try`
8957 $echo "Your file offsets are now $lseeksize bytes long."
8961 echo "(I can't seem to compile the test program. Guessing...)"
8962 rp="What is the size of your file offsets (in bytes)?"
8967 *_t) zzz="$fpostype" ;;
8970 $echo $n "Rechecking the size of $zzz...$c" >&4
8972 #include <sys/types.h>
8979 printf("%d\n", (int)sizeof($fpostype));
8984 if eval $compile_ok; then
8989 echo "(I can't execute the test program--guessing $fpossize.)" >&4
8992 echo " $fpossize bytes." >&4
8998 echo "(I can't compile the test program. Guessing...)" >&4
8999 rp="What is the size of your file positions (in bytes)?"
9008 # probably will refer to
9009 # $archlib $privlib $sitearch $sitelib $vendorarch $vendorlib
9011 userelocatableinc=undef
9013 case "$vendorprefix" in
9014 '') d_vendorbin="$undef"
9018 *) d_vendorbin="$define"
9019 : determine where vendor-supplied executables go.
9020 case "$vendorbin" in
9021 '') dflt=$vendorprefix/bin ;;
9022 *) dflt="$vendorbin" ;;
9025 rp='Pathname for the vendor-supplied executables directory?'
9028 vendorbinexp="$ansexp"
9031 : Change installation prefix, if necessary.
9032 if $test X"$prefix" != X"$installprefix"; then
9033 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
9035 installvendorbin="$vendorbinexp"
9038 case "$vendorprefix" in
9039 '') vendorhtml1dir=''
9040 vendorhtml1direxp=''
9042 *) : determine where vendor-supplied html pages go.
9043 : There is no standard location, so try to copy the previously-selected
9044 : directory structure for the core html pages.
9045 : XXX Better default suggestions would be welcome.
9046 case "$vendorhtml1dir" in
9047 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9048 *) dflt=$vendorhtml1dir ;;
9051 ''|' ') dflt=none ;;
9054 rp='Pathname for the vendor-supplied html pages?'
9056 vendorhtml1dir="$ans"
9057 vendorhtml1direxp="$ansexp"
9060 : Use ' ' for none so value is preserved next time through Configure
9061 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9062 : Change installation prefix, if necessary.
9063 if $test X"$prefix" != X"$installprefix"; then
9064 installvendorhtml1dir=`echo $vendorhtml1direxp | $sed "s#^$prefix#$installprefix#"`
9066 installvendorhtml1dir="$vendorhtml1direxp"
9069 case "$vendorprefix" in
9070 '') vendorhtml3dir=''
9071 vendorhtml3direxp=''
9073 *) : determine where vendor-supplied module html pages go.
9074 : There is no standard location, so try to copy the previously-selected
9075 : directory structure for the core html pages.
9076 : XXX Better default suggestions would be welcome.
9077 case "$vendorhtml3dir" in
9078 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9079 *) dflt=$vendorhtml3dir ;;
9082 ''|' ') dflt=none ;;
9085 rp='Pathname for the vendor-supplied html pages?'
9087 vendorhtml3dir="$ans"
9088 vendorhtml3direxp="$ansexp"
9091 : Use ' ' for none so value is preserved next time through Configure
9092 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9093 : Change installation prefix, if necessary.
9094 if $test X"$prefix" != X"$installprefix"; then
9095 installvendorhtml3dir=`echo $vendorhtml3direxp | $sed "s#^$prefix#$installprefix#"`
9097 installvendorhtml3dir="$vendorhtml3direxp"
9100 case "$vendorprefix" in
9101 '') vendorman1dir=''
9104 *) : determine where vendor-supplied manual pages go.
9105 case "$vendorman1dir" in
9106 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9107 *) dflt=$vendorman1dir ;;
9110 ''|' ') dflt=none ;;
9113 rp='Pathname for the vendor-supplied manual section 1 pages?'
9115 vendorman1dir="$ans"
9116 vendorman1direxp="$ansexp"
9119 : Use ' ' for none so value is preserved next time through Configure
9120 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9121 : Change installation prefix, if necessary.
9122 if $test X"$prefix" != X"$installprefix"; then
9123 installvendorman1dir=`echo "$vendorman1direxp" | $sed "s#^$prefix#$installprefix#"`
9125 installvendorman1dir="$vendorman1direxp"
9128 case "$vendorprefix" in
9129 '') vendorman3dir=''
9132 *) : determine where vendor-supplied module manual pages go.
9133 case "$vendorman3dir" in
9134 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9135 *) dflt=$vendorman3dir ;;
9138 ''|' ') dflt=none ;;
9141 rp='Pathname for the vendor-supplied manual section 3 pages?'
9143 vendorman3dir="$ans"
9144 vendorman3direxp="$ansexp"
9147 : Use ' ' for none so value is preserved next time through Configure
9148 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9149 : Change installation prefix, if necessary.
9150 if $test X"$prefix" != X"$installprefix"; then
9151 installvendorman3dir=`echo "$vendorman3direxp" | $sed "s#^$prefix#$installprefix#"`
9153 installvendorman3dir="$vendorman3direxp"
9156 case "$vendorprefix" in
9157 '') d_vendorscript="$undef"
9161 *) d_vendorscript="$define"
9162 : determine where vendor-supplied scripts go.
9163 case "$vendorscript" in
9164 '') dflt=$vendorprefix/script
9165 $test -d $dflt || dflt=$vendorbin ;;
9166 *) dflt="$vendorscript" ;;
9170 The installation process will create a directory for
9171 vendor-supplied scripts.
9175 rp='Pathname for the vendor-supplied scripts directory?'
9178 vendorscriptexp="$ansexp"
9181 : Change installation prefix, if necessary.
9182 if $test X"$prefix" != X"$installprefix"; then
9183 installvendorscript=`echo $vendorscriptexp | $sed "s#^$prefix#$installprefix#"`
9185 installvendorscript="$vendorscriptexp"
9188 : see if qgcvt exists
9194 if $test X"$d_longdbl" = X"$define"; then
9196 echo "Checking how to print long doubles..." >&4
9198 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9199 $cat >try.c <<'EOCP'
9200 #include <sys/types.h>
9204 printf("%.3f\n", d);
9208 if eval $compile; then
9212 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9213 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9214 echo "We will use %f."
9220 if $test X"$sPRIfldbl" = X; then
9221 $cat >try.c <<'EOCP'
9222 #include <sys/types.h>
9225 long double d = 123.456;
9226 printf("%.3Lf\n", d);
9230 if eval $compile; then
9234 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9235 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9236 echo "We will use %Lf."
9242 if $test X"$sPRIfldbl" = X; then
9243 $cat >try.c <<'EOCP'
9244 #include <sys/types.h>
9247 long double d = 123.456;
9248 printf("%.3llf\n", d);
9252 if eval $compile; then
9256 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9257 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9258 echo "We will use %llf."
9264 if $test X"$sPRIfldbl" = X; then
9265 $cat >try.c <<'EOCP'
9266 #include <sys/types.h>
9269 long double d = 123.456;
9270 printf("%.3lf\n", d);
9274 if eval $compile; then
9278 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9279 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9280 echo "We will use %lf."
9286 if $test X"$sPRIfldbl" = X; then
9287 echo "Cannot figure out how to print long doubles." >&4
9289 sSCNfldbl=$sPRIfldbl # expect consistency
9296 case "$sPRIfldbl" in
9297 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9298 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9299 d_SCNfldbl="$undef";
9301 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9302 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9303 d_SCNfldbl="$define";
9307 : Check how to convert floats to strings.
9309 if test "X$d_Gconvert" = X; then
9312 echo "Checking for an efficient way to convert floats to strings."
9314 case "$uselongdouble" in
9315 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9317 case "$d_longdbl" in
9318 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9320 case "$d_PRIgldbl" in
9321 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9325 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9326 char *myname = "gconvert";
9329 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9330 char *myname = "gcvt";
9333 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9334 char *myname = "qgcvt";
9335 #define DOUBLETYPE long double
9338 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9340 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9342 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9345 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9347 char *myname = "sprintf";
9351 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9352 #define DOUBLETYPE long double
9354 #define DOUBLETYPE double
9360 #define I_STDLIB $i_stdlib
9366 checkit(expect, got)
9370 if (strcmp(expect, got)) {
9371 printf("%s oddity: Expected %s, got %s\n",
9372 myname, expect, got);
9382 /* This must be 1st test on (which?) platform */
9383 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9384 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9385 checkit("0.1", buf);
9387 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9388 checkit("0.01", buf);
9390 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9391 checkit("0.001", buf);
9393 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9394 checkit("0.0001", buf);
9396 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9397 if (strlen(buf) > 5)
9398 checkit("9e-005", buf); /* for Microsoft ?? */
9400 checkit("9e-05", buf);
9402 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9405 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9406 checkit("1.1", buf);
9408 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9409 checkit("1.01", buf);
9411 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9412 checkit("1.001", buf);
9414 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9415 checkit("1.0001", buf);
9417 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9418 checkit("1.00001", buf);
9420 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9421 checkit("1.000001", buf);
9423 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9426 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9429 /* Some Linux gcvt's give 1.e+5 here. */
9430 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9431 checkit("100000", buf);
9433 /* Some Linux gcvt's give -1.e+5 here. */
9434 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9435 checkit("-100000", buf);
9437 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9438 checkit("123.456", buf);
9440 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9441 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9442 /* 34 should be enough to scare even long double
9443 * places into using the e notation. */
9444 if (strlen(buf) > 5)
9445 checkit("1e+034", buf); /* for Microsoft */
9447 checkit("1e+34", buf);
9449 /* For Perl, if you add additional tests here, also add them to
9450 * t/base/num.t for benefit of platforms not using Configure or
9451 * overriding d_Gconvert */
9456 : first add preferred functions to our list
9458 for xxx_convert in $gconvert_preference; do
9459 case $xxx_convert in
9460 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9461 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9464 : then add any others
9465 for xxx_convert in gconvert gcvt sprintf; do
9468 *) xxx_list="$xxx_list $xxx_convert" ;;
9472 case "$d_longdbl$uselongdouble" in
9474 : again, add prefered functions to our list first
9476 for xxx_convert in $gconvert_ld_preference; do
9477 case $xxx_convert in
9478 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9479 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9482 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9483 for xxx_convert in qgcvt sprintf $xxx_list; do
9484 case "$xxx_ld_list" in
9485 $xxx_convert*|*" $xxx_convert"*) ;;
9486 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9489 : if sprintf cannot do long doubles, move it to the end
9490 if test "$d_PRIgldbl" != "$define"; then
9491 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9493 : if no qgcvt, remove it
9494 if test "$d_qgcvt" != "$define"; then
9495 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9498 xxx_list="$xxx_ld_list"
9502 for xxx_convert in $xxx_list; do
9503 echo "Trying $xxx_convert..."
9505 set try -DTRY_$xxx_convert
9506 if eval $compile; then
9507 echo "$xxx_convert() found." >&4
9509 echo "I'll use $xxx_convert to convert floats into a string." >&4
9512 echo "...But $xxx_convert didn't work as I expected."
9516 echo "$xxx_convert NOT found." >&4
9520 if test X$xxx_convert = X; then
9521 echo "*** WHOA THERE!!! ***" >&4
9522 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9526 case "$xxx_convert" in
9527 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9528 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9529 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9530 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9531 "$define$define$define")
9532 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9533 "$define$define$undef")
9534 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9535 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9542 : see if _fwalk exists
9546 : Initialize h_fcntl
9549 : Initialize h_sysfile
9552 : access call always available on UNIX
9556 : locate the flags for 'access()'
9560 $cat >access.c <<EOCP
9561 #include <sys/types.h>
9566 #include <sys/file.h>
9579 : check sys/file.h first, no particular reason here
9580 if $test `./findhdr sys/file.h` && \
9581 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9583 echo "<sys/file.h> defines the *_OK access constants." >&4
9584 elif $test `./findhdr fcntl.h` && \
9585 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9587 echo "<fcntl.h> defines the *_OK access constants." >&4
9588 elif $test `./findhdr unistd.h` && \
9589 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9590 echo "<unistd.h> defines the *_OK access constants." >&4
9592 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9598 : see if accessx exists
9599 set accessx d_accessx
9602 : see if aintl exists
9606 : see if alarm exists
9610 : see if POSIX threads are available
9611 set pthread.h i_pthread
9614 : define a fucntion to check prototypes
9615 $cat > protochk <<EOSH
9618 optimize="$optimize"
9620 prototype="$prototype"
9623 usethreads=$usethreads
9624 i_pthread=$i_pthread
9625 pthread_h_first=$pthread_h_first
9628 $cat >> protochk <<'EOSH'
9633 while test $# -ge 2; do
9635 $define) echo "#include <$2>" >> try.c ;;
9636 literal) echo "$2" >> try.c ;;
9638 # Extra magic for the benefit of systems that need pthread.h
9639 # to be included early to correctly detect threadsafe functions.
9640 # Such functions must guarantee themselves, though, that the usethreads
9641 # and i_pthread have been defined, before calling protochk.
9642 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
9643 echo "#include <pthread.h>" >> try.c
9648 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
9649 cat >> try.c <<'EOCP'
9650 #ifdef CAN_PROTOTYPE
9651 #define _(args) args
9656 echo "$foo" >> try.c
9657 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
9658 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
9666 hasproto='varname=$1; func=$2; shift; shift;
9667 while $test $# -ge 2; do
9669 $define) echo "#include <$2>";;
9673 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
9674 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
9675 echo "$func() prototype found.";
9678 echo "$func() prototype NOT found.";
9683 $rm -f try.c tryout.c'
9685 : see if sys/types.h has to be included
9686 set sys/types.h i_systypes
9689 : see if sys/select.h has to be included
9690 set sys/select.h i_sysselct
9693 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
9694 while $test $# -ge 2; do
9696 $define) echo "#include <$2>";;
9700 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
9702 if eval $compile; then
9711 : see if we should include time.h, sys/time.h, or both
9713 if test "X$timeincl" = X; then
9714 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9715 $echo $n "I'm now running the test program...$c"
9717 #include <sys/types.h>
9722 #ifdef SYSTIMEKERNEL
9725 #include <sys/time.h>
9728 #include <sys/select.h>
9741 struct timezone tzp;
9743 if (foo.tm_sec == foo.tm_sec)
9746 if (bar.tv_sec == bar.tv_sec)
9753 for s_timezone in '-DS_TIMEZONE' ''; do
9755 for s_timeval in '-DS_TIMEVAL' ''; do
9756 for i_systimek in '' '-DSYSTIMEKERNEL'; do
9757 for i_time in '' '-DI_TIME'; do
9758 for i_systime in '-DI_SYSTIME' ''; do
9761 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
9762 if eval $compile; then
9763 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
9767 $echo $n "Succeeded with $flags$c"
9779 *SYSTIMEKERNEL*) i_systimek="$define"
9780 timeincl=`./findhdr sys/time.h`
9781 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
9782 *) i_systimek="$undef";;
9785 *I_TIME*) i_time="$define"
9786 timeincl=`./findhdr time.h`" $timeincl"
9787 echo "We'll include <time.h>." >&4;;
9788 *) i_time="$undef";;
9791 *I_SYSTIME*) i_systime="$define"
9792 timeincl=`./findhdr sys/time.h`" $timeincl"
9793 echo "We'll include <sys/time.h>." >&4;;
9794 *) i_systime="$undef";;
9798 : see if struct tm knows about tm_zone
9799 case "$i_systime$i_time" in
9802 echo "Checking to see if your struct tm has tm_zone field..." >&4
9803 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
9811 case "$d_tm_tm_zone" in
9812 "$define") echo "Yes, it does." ;;
9813 *) echo "No, it doesn't." ;;
9815 : see if struct tm knows about tm_gmtoff
9816 case "$i_systime$i_time" in
9819 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
9820 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
9828 case "$d_tm_tm_gmtoff" in
9829 "$define") echo "Yes, it does." ;;
9830 *) echo "No, it doesn't." ;;
9833 : see if asctime_r exists
9834 set asctime_r d_asctime_r
9836 case "$d_asctime_r" in
9838 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
9839 case "$d_asctime_r_proto:$usethreads" in
9840 ":define") d_asctime_r_proto=define
9841 set d_asctime_r_proto asctime_r $hdrs
9845 case "$d_asctime_r_proto" in
9847 case "$asctime_r_proto" in
9848 ''|0) try='char* asctime_r(const struct tm*, char*);'
9849 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SB ;;
9851 case "$asctime_r_proto" in
9852 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
9853 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SBI ;;
9855 case "$asctime_r_proto" in
9856 ''|0) try='int asctime_r(const struct tm*, char*);'
9857 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SB ;;
9859 case "$asctime_r_proto" in
9860 ''|0) try='int asctime_r(const struct tm*, char*, int);'
9861 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SBI ;;
9863 case "$asctime_r_proto" in
9864 ''|0) d_asctime_r=undef
9866 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
9867 * ) case "$asctime_r_proto" in
9868 REENTRANT_PROTO*) ;;
9869 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
9871 echo "Prototype: $try" ;;
9874 *) case "$usethreads" in
9875 define) echo "asctime_r has no prototype, not using it." >&4 ;;
9882 *) asctime_r_proto=0
9886 : see if atolf exists
9890 : see if atoll exists
9894 : Look for GCC-style attribute format
9895 case "$d_attribute_format" in
9898 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
9899 $cat >attrib.c <<'EOCP'
9901 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
9903 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9904 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9905 echo "Your C compiler doesn't support __attribute__((format))."
9908 echo "Your C compiler supports __attribute__((format))."
9912 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9916 *) val="$d_attribute_format" ;;
9918 set d_attribute_format
9922 : Look for GCC-style attribute malloc
9923 case "$d_attribute_malloc" in
9926 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
9927 $cat >attrib.c <<'EOCP'
9929 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
9931 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9932 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9933 echo "Your C compiler doesn't support __attribute__((malloc))."
9936 echo "Your C compiler supports __attribute__((malloc))."
9940 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9944 *) val="$d_attribute_malloc" ;;
9946 set d_attribute_malloc
9950 : Look for GCC-style attribute nonnull
9951 case "$d_attribute_nonnull" in
9954 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
9955 $cat >attrib.c <<'EOCP'
9957 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
9959 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9960 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9961 echo "Your C compiler doesn't support __attribute__((nonnull))."
9964 echo "Your C compiler supports __attribute__((nonnull))."
9968 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9972 *) val="$d_attribute_nonnull" ;;
9974 set d_attribute_nonnull
9978 : Look for GCC-style attribute noreturn
9979 case "$d_attribute_noreturn" in
9982 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
9983 $cat >attrib.c <<'EOCP'
9985 void fall_over_dead( void ) __attribute__((noreturn));
9987 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9988 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9989 echo "Your C compiler doesn't support __attribute__((noreturn))."
9992 echo "Your C compiler supports __attribute__((noreturn))."
9996 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10000 *) val="$d_attribute_noreturn" ;;
10002 set d_attribute_noreturn
10006 : Look for GCC-style attribute pure
10007 case "$d_attribute_pure" in
10010 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10011 $cat >attrib.c <<'EOCP'
10013 int square( int n ) __attribute__((pure));
10015 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10016 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10017 echo "Your C compiler doesn't support __attribute__((pure))."
10020 echo "Your C compiler supports __attribute__((pure))."
10024 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10028 *) val="$d_attribute_pure" ;;
10030 set d_attribute_pure
10034 : Look for GCC-style attribute unused
10035 case "$d_attribute_unused" in
10038 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10039 $cat >attrib.c <<'EOCP'
10041 int do_something( int dummy __attribute__((unused)), int n );
10043 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10044 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10045 echo "Your C compiler doesn't support __attribute__((unused))."
10048 echo "Your C compiler supports __attribute__((unused))."
10052 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10056 *) val="$d_attribute_unused" ;;
10058 set d_attribute_unused
10062 : Look for GCC-style attribute warn_unused_result
10063 case "$d_attribute_warn_unused_result" in
10066 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10067 $cat >attrib.c <<'EOCP'
10069 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10071 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10072 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10073 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10076 echo "Your C compiler supports __attribute__((warn_unused_result))."
10080 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10084 *) val="$d_attribute_warn_unused_result" ;;
10086 set d_attribute_warn_unused_result
10090 : see if bcmp exists
10094 : see if bcopy exists
10098 : see if this is a unistd.h system
10099 set unistd.h i_unistd
10102 : see if getpgrp exists
10103 set getpgrp d_getpgrp
10106 case "$d_getpgrp" in
10109 echo "Checking to see which flavor of getpgrp is in use..."
10111 #$i_unistd I_UNISTD
10112 #include <sys/types.h>
10114 # include <unistd.h>
10116 #$i_stdlib I_STDLIB
10118 #include <stdlib.h>
10122 if (getuid() == 0) {
10123 printf("(I see you are running Configure as super-user...)\n");
10126 #ifdef TRY_BSD_PGRP
10127 if (getpgrp(1) == 0)
10136 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10137 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10139 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10140 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10143 echo "I can't seem to compile and run the test program."
10145 xxx="a USG one, i.e. you use getpgrp()."
10147 # SVR4 systems can appear rather BSD-ish.
10148 case "$i_unistd" in
10150 xxx="a BSD one, i.e. you use getpgrp(pid)."
10154 xxx="probably a USG one, i.e. you use getpgrp()."
10159 echo "Assuming your getpgrp is $xxx" >&4
10168 : see if setpgrp exists
10169 set setpgrp d_setpgrp
10172 case "$d_setpgrp" in
10175 echo "Checking to see which flavor of setpgrp is in use..."
10177 #$i_unistd I_UNISTD
10178 #include <sys/types.h>
10180 # include <unistd.h>
10182 #$i_stdlib I_STDLIB
10184 #include <stdlib.h>
10188 if (getuid() == 0) {
10189 printf("(I see you are running Configure as super-user...)\n");
10192 #ifdef TRY_BSD_PGRP
10193 if (-1 == setpgrp(1, 1))
10196 if (setpgrp() != -1)
10202 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10203 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10205 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10206 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10209 echo "(I can't seem to compile and run the test program.)"
10211 xxx="a USG one, i.e. you use setpgrp()."
10213 # SVR4 systems can appear rather BSD-ish.
10214 case "$i_unistd" in
10216 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10220 xxx="probably a USG one, i.e. you use setpgrp()."
10225 echo "Assuming your setpgrp is $xxx" >&4
10233 : see if bzero exists
10237 : see if signal is declared as pointer to function returning int or void
10239 xxx=`./findhdr signal.h`
10240 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10241 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10242 echo "You have int (*signal())() instead of void." >&4
10244 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10245 echo "You have void (*signal())()." >&4
10247 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10248 echo "You have int (*signal())() instead of void." >&4
10250 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10251 echo "You have void (*signal())()." >&4
10254 case "$d_voidsig" in
10256 echo "I can't determine whether signal handler returns void or int..." >&4
10258 rp="What type does your signal handler return?"
10261 v*) val="$define";;
10265 echo "As you already told me, signal handler returns void." >&4
10268 *) echo "As you already told me, signal handler returns int." >&4
10275 case "$d_voidsig" in
10276 "$define") signal_t="void";;
10277 *) signal_t="int";;
10281 : check for ability to cast large floats to 32-bit ints.
10283 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10284 if $test "$intsize" -ge 4; then
10291 #$i_stdlib I_STDLIB
10293 #include <stdlib.h>
10295 #include <sys/types.h>
10296 #include <signal.h>
10297 $signal_t blech(s) int s; { exit(3); }
10304 signal(SIGFPE, blech);
10306 /* Don't let compiler optimize the test away. Store the number
10307 in a writable string for gcc to pass to sscanf under HP/UX.
10309 sprintf(str, "2147483647");
10310 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
10314 /* x86 processors will probably give 0x8000 0000, which is a
10315 sign change. We don't want that. We want to mimic SPARC
10316 behavior here, which is to preserve the sign and give
10319 if (i32 != ($xxx) f)
10325 if eval $compile_ok; then
10329 echo "(I can't seem to compile the test program--assuming it can't)"
10334 echo "Yup, it can."
10337 echo "Nope, it can't."
10344 : check for ability to cast negative floats to unsigned
10346 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
10349 #$i_stdlib I_STDLIB
10351 #include <stdlib.h>
10353 #include <sys/types.h>
10354 #include <signal.h>
10355 $signal_t blech(s) int s; { exit(7); }
10356 $signal_t blech_in_list(s) int s; { exit(4); }
10357 unsigned long dummy_long(p) unsigned long p; { return p; }
10358 unsigned int dummy_int(p) unsigned int p; { return p; }
10359 unsigned short dummy_short(p) unsigned short p; { return p; }
10363 unsigned long along;
10365 unsigned short ashort;
10369 /* Frustrate gcc-2.7.2's optimizer which failed this test with
10370 a direct f = -123. assignment. gcc-2.8.0 reportedly
10371 optimized the whole file away
10373 /* Store the number in a writable string for gcc to pass to
10374 sscanf under HP/UX.
10376 sprintf(str, "-123");
10377 sscanf(str, "%lf", &f); /* f = -123.; */
10379 signal(SIGFPE, blech);
10380 along = (unsigned long)f;
10381 aint = (unsigned int)f;
10382 ashort = (unsigned short)f;
10383 if (along != (unsigned long)-123)
10385 if (aint != (unsigned int)-123)
10387 if (ashort != (unsigned short)-123)
10389 sprintf(str, "1073741824.");
10390 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
10393 along = (unsigned long)f;
10394 if (along != 0x80000000)
10398 along = (unsigned long)f;
10399 if (along != 0x7fffffff)
10403 along = (unsigned long)f;
10404 if (along != 0x80000001)
10408 signal(SIGFPE, blech_in_list);
10409 sprintf(str, "123.");
10410 sscanf(str, "%lf", &f); /* f = 123.; */
10411 along = dummy_long((unsigned long)f);
10412 aint = dummy_int((unsigned int)f);
10413 ashort = dummy_short((unsigned short)f);
10414 if (along != (unsigned long)123)
10416 if (aint != (unsigned int)123)
10418 if (ashort != (unsigned short)123)
10425 if eval $compile_ok; then
10429 echo "(I can't seem to compile the test program--assuming it can't)"
10432 case "$castflags" in
10434 echo "Yup, it can."
10437 echo "Nope, it can't."
10444 : see if vprintf exists
10446 if set vprintf val -f d_vprintf; eval $csym; $val; then
10447 echo 'vprintf() found.' >&4
10450 #include <varargs.h>
10451 #$i_stdlib I_STDLIB
10453 #include <stdlib.h>
10456 int main() { xxx("foo"); }
10465 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
10469 if eval $compile && $run ./try; then
10470 echo "Your vsprintf() returns (int)." >&4
10473 echo "Your vsprintf() returns (char*)." >&4
10477 echo 'vprintf() NOT found.' >&4
10488 : see if chown exists
10492 : see if chroot exists
10493 set chroot d_chroot
10496 : see if chsize exists
10497 set chsize d_chsize
10500 : see if class exists
10504 hasstruct='varname=$1; struct=$2; shift; shift;
10505 while $test $# -ge 2; do
10507 $define) echo "#include <$2>";;
10511 echo "int main () { struct $struct foo; }" >> try.c;
10513 if eval $compile; then
10520 $rm -f try.c try.o'
10524 : see whether socket exists
10526 $echo $n "Hmm... $c" >&4
10527 if set socket val -f d_socket; eval $csym; $val; then
10528 echo "Looks like you have Berkeley networking support." >&4
10530 if set setsockopt val -f; eval $csym; $val; then
10533 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
10534 d_oldsock="$define"
10537 if $contains socklib libc.list >/dev/null 2>&1; then
10538 echo "Looks like you have Berkeley networking support." >&4
10540 : we will have to assume that it supports the 4.2 BSD interface
10543 echo "You don't have Berkeley networking in libc$_a..." >&4
10544 if test "X$d_socket" = "X$define"; then
10545 echo "...but you seem to believe that you have sockets." >&4
10547 for net in net socket
10549 if test -f /usr/lib/lib$net$_a; then
10550 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
10551 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
10552 if $contains socket libc.list >/dev/null 2>&1; then
10557 echo "...but the Wollongong group seems to have hacked it in." >&4
10558 sockethdr="-I/usr/netinclude"
10561 echo "Found Berkeley sockets interface in lib$net." >&4
10562 if $contains setsockopt libc.list >/dev/null 2>&1; then
10565 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
10566 d_oldsock="$define"
10572 if test "X$d_socket" != "X$define"; then
10573 echo "or anywhere else I see." >&4
10581 : see if socketpair exists
10582 set socketpair d_sockpair
10587 echo "Checking the availability of certain socket constants..." >&4
10588 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
10589 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
10591 #include <sys/types.h>
10592 #include <sys/socket.h>
10598 set try; if eval $compile; then
10601 set d_${enum}; eval $setvar
10605 : see if this is a sys/uio.h system
10606 set sys/uio.h i_sysuio
10611 echo "Checking to see if your system supports struct cmsghdr..." >&4
10612 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
10614 case "$d_cmsghdr_s" in
10615 "$define") echo "Yes, it does." ;;
10616 *) echo "No, it doesn't." ;;
10620 : check for const keyword
10622 echo 'Checking to see if your C compiler knows about "const"...' >&4
10623 $cat >const.c <<'EOCP'
10624 typedef struct spug { int drokk; } spug;
10631 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
10633 echo "Yup, it does."
10636 echo "Nope, it doesn't."
10641 : see if copysignl exists
10642 set copysignl d_copysignl
10645 : see if crypt exists
10650 $define) cryptlib='' ;;
10651 *) if set crypt val -f d_crypt; eval $csym; $val; then
10652 echo 'crypt() found.' >&4
10656 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
10657 if $test -z "$cryptlib"; then
10658 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
10662 if $test -z "$cryptlib"; then
10663 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
10667 if $test -z "$cryptlib"; then
10668 cryptlib=`./loc libcrypt$_a "" $libpth`
10672 if $test -z "$cryptlib"; then
10673 echo 'crypt() NOT found.' >&4
10684 : see if this is a crypt.h system
10685 set crypt.h i_crypt
10688 : see if crypt_r exists
10689 set crypt_r d_crypt_r
10691 case "$d_crypt_r" in
10693 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
10694 case "$d_crypt_r_proto:$usethreads" in
10695 ":define") d_crypt_r_proto=define
10696 set d_crypt_r_proto crypt_r $hdrs
10700 case "$d_crypt_r_proto" in
10702 case "$crypt_r_proto" in
10703 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
10704 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCS ;;
10706 case "$crypt_r_proto" in
10707 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
10708 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCD ;;
10710 case "$crypt_r_proto" in
10711 ''|0) d_crypt_r=undef
10713 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
10714 * ) case "$crypt_r_proto" in
10715 REENTRANT_PROTO*) ;;
10716 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
10718 echo "Prototype: $try" ;;
10721 *) case "$usethreads" in
10722 define) echo "crypt_r has no prototype, not using it." >&4 ;;
10733 : get csh whereabouts
10735 'csh') val="$undef" ;;
10736 *) val="$define" ;;
10740 : Respect a hint or command line value for full_csh.
10741 case "$full_csh" in
10742 '') full_csh=$csh ;;
10745 : see if ctermid_r exists
10746 set ctermid_r d_ctermid_r
10748 case "$d_ctermid_r" in
10750 hdrs="$i_systypes sys/types.h define stdio.h "
10751 case "$d_ctermid_r_proto:$usethreads" in
10752 ":define") d_ctermid_r_proto=define
10753 set d_ctermid_r_proto ctermid_r $hdrs
10757 case "$d_ctermid_r_proto" in
10759 case "$ctermid_r_proto" in
10760 ''|0) try='char* ctermid_r(char*);'
10761 ./protochk "extern $try" $hdrs && ctermid_r_proto=B_B ;;
10763 case "$ctermid_r_proto" in
10764 ''|0) d_ctermid_r=undef
10766 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
10767 * ) case "$ctermid_r_proto" in
10768 REENTRANT_PROTO*) ;;
10769 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
10771 echo "Prototype: $try" ;;
10774 *) case "$usethreads" in
10775 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
10782 *) ctermid_r_proto=0
10786 : see if ctime_r exists
10787 set ctime_r d_ctime_r
10789 case "$d_ctime_r" in
10791 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10792 case "$d_ctime_r_proto:$usethreads" in
10793 ":define") d_ctime_r_proto=define
10794 set d_ctime_r_proto ctime_r $hdrs
10798 case "$d_ctime_r_proto" in
10800 case "$ctime_r_proto" in
10801 ''|0) try='char* ctime_r(const time_t*, char*);'
10802 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SB ;;
10804 case "$ctime_r_proto" in
10805 ''|0) try='char* ctime_r(const time_t*, char*, int);'
10806 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SBI ;;
10808 case "$ctime_r_proto" in
10809 ''|0) try='int ctime_r(const time_t*, char*);'
10810 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SB ;;
10812 case "$ctime_r_proto" in
10813 ''|0) try='int ctime_r(const time_t*, char*, int);'
10814 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SBI ;;
10816 case "$ctime_r_proto" in
10817 ''|0) d_ctime_r=undef
10819 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
10820 * ) case "$ctime_r_proto" in
10821 REENTRANT_PROTO*) ;;
10822 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
10824 echo "Prototype: $try" ;;
10827 *) case "$usethreads" in
10828 define) echo "ctime_r has no prototype, not using it." >&4 ;;
10839 : see if cuserid exists
10840 set cuserid d_cuserid
10843 : see if this is a limits.h system
10844 set limits.h i_limits
10847 : see if this is a float.h system
10848 set float.h i_float
10851 : See if number of significant digits in a double precision number is known
10853 $cat >dbl_dig.c <<EOM
10854 #$i_limits I_LIMITS
10857 #include <limits.h>
10863 printf("Contains DBL_DIG");
10866 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
10867 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
10868 echo "DBL_DIG found." >&4
10871 echo "DBL_DIG NOT found." >&4
10878 : see if dbm.h is available
10879 : see if dbmclose exists
10880 set dbmclose d_dbmclose
10883 case "$d_dbmclose" in
10893 *) set rpcsvc/dbm.h i_rpcsvcdbm
10898 *) echo "We won't be including <dbm.h>"
10908 : see if prototype for dbminit is available
10910 set d_dbminitproto dbminit $i_dbm dbm.h
10913 : see if difftime exists
10914 set difftime d_difftime
10917 : see if this is a dirent system
10919 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
10921 echo "<dirent.h> found." >&4
10924 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
10925 echo "<sys/dir.h> found." >&4
10928 xinc=`./findhdr sys/ndir.h`
10930 echo "<dirent.h> NOT found." >&4
10935 : Look for type of directory structure.
10937 $cppstdin $cppflags $cppminus < "$xinc" > try.c
10939 case "$direntrytype" in
10941 case "$i_dirent" in
10942 $define) guess1='struct dirent' ;;
10943 *) guess1='struct direct' ;;
10946 *) guess1="$direntrytype"
10951 'struct dirent') guess2='struct direct' ;;
10952 *) guess2='struct dirent' ;;
10955 if $contains "$guess1" try.c >/dev/null 2>&1; then
10956 direntrytype="$guess1"
10957 echo "Your directory entries are $direntrytype." >&4
10958 elif $contains "$guess2" try.c >/dev/null 2>&1; then
10959 direntrytype="$guess2"
10960 echo "Your directory entries seem to be $direntrytype." >&4
10962 echo "I don't recognize your system's directory entries." >&4
10963 rp="What type is used for directory entries on this system?"
10966 direntrytype="$ans"
10971 : see if the directory entry stores field length
10973 $cppstdin $cppflags $cppminus < "$xinc" > try.c
10974 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
10975 echo "Good, your directory entry keeps length information in d_namlen." >&4
10978 echo "Your directory entry does not know about the d_namlen field." >&4
10985 : see if this is an sysdir system
10986 set sys/dir.h i_sysdir
10989 : see if this is an sysndir system
10990 set sys/ndir.h i_sysndir
10995 $cat >dirfd.c <<EOM
10997 #$i_stdlib I_STDLIB
10999 #include <stdlib.h>
11001 #$i_dirent I_DIRENT /**/
11002 #$i_sysdir I_SYS_DIR /**/
11003 #$i_sysndir I_SYS_NDIR /**/
11004 #$i_systypes I_SYS_TYPES /**/
11005 #if defined(I_SYS_TYPES)
11006 #include <sys/types.h>
11008 #if defined(I_DIRENT)
11009 #include <dirent.h>
11010 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11011 #include <sys/dir.h>
11015 #include <sys/ndir.h>
11019 #include <ndir.h> /* may be wrong in the future */
11021 #include <sys/dir.h>
11027 DIR *dirp = opendir(".");
11028 if (dirfd(dirp) >= 0)
11036 if eval $compile; then
11040 $define) echo "dirfd() found." >&4 ;;
11041 *) echo "dirfd() NOT found." >&4 ;;
11047 : see if dlerror exists
11050 set dlerror d_dlerror
11054 : see if dlfcn is available
11055 set dlfcn.h i_dlfcn
11062 On a few systems, the dynamically loaded modules that perl generates and uses
11063 will need a different extension than shared libs. The default will probably
11069 *) dflt="$dlext" ;;
11071 rp='What is the extension of dynamically loaded modules'
11080 : Check if dlsym need a leading underscore
11086 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11087 $cat >dyna.c <<'EOM'
11094 #$i_stdlib I_STDLIB
11096 #include <stdlib.h>
11100 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
11102 #include <sys/types.h>
11107 extern int fred() ;
11116 int mode = RTLD_LAZY ;
11118 handle = dlopen("./dyna.$dlext", mode) ;
11119 if (handle == NULL) {
11124 symbol = dlsym(handle, "fred") ;
11125 if (symbol == NULL) {
11126 /* try putting a leading underscore */
11127 symbol = dlsym(handle, "_fred") ;
11128 if (symbol == NULL) {
11141 : Call the object file tmp-dyna.o in case dlext=o.
11142 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
11143 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
11144 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
11145 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
11148 1) echo "Test program failed using dlopen." >&4
11149 echo "Perhaps you should not use dynamic loading." >&4;;
11150 2) echo "Test program failed using dlsym." >&4
11151 echo "Perhaps you should not use dynamic loading." >&4;;
11152 3) echo "dlsym needs a leading underscore" >&4
11154 4) echo "dlsym doesn't need a leading underscore." >&4;;
11157 echo "I can't compile and run the test program." >&4
11158 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
11163 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
11168 : see if drand48_r exists
11169 set drand48_r d_drand48_r
11171 case "$d_drand48_r" in
11173 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
11174 case "$d_drand48_r_proto:$usethreads" in
11175 ":define") d_drand48_r_proto=define
11176 set d_drand48_r_proto drand48_r $hdrs
11180 case "$d_drand48_r_proto" in
11182 case "$drand48_r_proto" in
11183 ''|0) try='int drand48_r(struct drand48_data*, double*);'
11184 ./protochk "extern $try" $hdrs && drand48_r_proto=I_ST ;;
11186 case "$drand48_r_proto" in
11187 ''|0) d_drand48_r=undef
11189 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
11190 * ) case "$drand48_r_proto" in
11191 REENTRANT_PROTO*) ;;
11192 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
11194 echo "Prototype: $try" ;;
11197 *) case "$usethreads" in
11198 define) echo "drand48_r has no prototype, not using it." >&4 ;;
11205 *) drand48_r_proto=0
11209 : see if prototype for drand48 is available
11211 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
11214 : see if dup2 exists
11218 : see if eaccess exists
11219 set eaccess d_eaccess
11222 : see if endgrent exists
11223 set endgrent d_endgrent
11226 : see if this is an grp system
11232 xxx=`./findhdr grp.h`
11233 $cppstdin $cppflags $cppminus < $xxx >$$.h
11235 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
11247 set d_grpasswd; eval $setvar
11251 : see if endgrent_r exists
11252 set endgrent_r d_endgrent_r
11254 case "$d_endgrent_r" in
11256 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11257 case "$d_endgrent_r_proto:$usethreads" in
11258 ":define") d_endgrent_r_proto=define
11259 set d_endgrent_r_proto endgrent_r $hdrs
11263 case "$d_endgrent_r_proto" in
11265 case "$endgrent_r_proto" in
11266 ''|0) try='int endgrent_r(FILE**);'
11267 ./protochk "extern $try" $hdrs && endgrent_r_proto=I_H ;;
11269 case "$endgrent_r_proto" in
11270 ''|0) try='void endgrent_r(FILE**);'
11271 ./protochk "extern $try" $hdrs && endgrent_r_proto=V_H ;;
11273 case "$endgrent_r_proto" in
11274 ''|0) d_endgrent_r=undef
11276 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
11277 * ) case "$endgrent_r_proto" in
11278 REENTRANT_PROTO*) ;;
11279 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
11281 echo "Prototype: $try" ;;
11284 *) case "$usethreads" in
11285 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
11292 *) endgrent_r_proto=0
11296 : see if endhostent exists
11297 set endhostent d_endhent
11300 : see if this is a netdb.h system
11301 set netdb.h i_netdb
11304 : see if endhostent_r exists
11305 set endhostent_r d_endhostent_r
11307 case "$d_endhostent_r" in
11309 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11310 case "$d_endhostent_r_proto:$usethreads" in
11311 ":define") d_endhostent_r_proto=define
11312 set d_endhostent_r_proto endhostent_r $hdrs
11316 case "$d_endhostent_r_proto" in
11318 case "$endhostent_r_proto" in
11319 ''|0) try='int endhostent_r(struct hostent_data*);'
11320 ./protochk "extern $try" $hdrs && endhostent_r_proto=I_D ;;
11322 case "$endhostent_r_proto" in
11323 ''|0) try='void endhostent_r(struct hostent_data*);'
11324 ./protochk "extern $try" $hdrs && endhostent_r_proto=V_D ;;
11326 case "$endhostent_r_proto" in
11327 ''|0) d_endhostent_r=undef
11328 endhostent_r_proto=0
11329 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
11330 * ) case "$endhostent_r_proto" in
11331 REENTRANT_PROTO*) ;;
11332 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
11334 echo "Prototype: $try" ;;
11337 *) case "$usethreads" in
11338 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
11340 d_endhostent_r=undef
11341 endhostent_r_proto=0
11345 *) endhostent_r_proto=0
11349 : see if endnetent exists
11350 set endnetent d_endnent
11353 : see if endnetent_r exists
11354 set endnetent_r d_endnetent_r
11356 case "$d_endnetent_r" in
11358 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11359 case "$d_endnetent_r_proto:$usethreads" in
11360 ":define") d_endnetent_r_proto=define
11361 set d_endnetent_r_proto endnetent_r $hdrs
11365 case "$d_endnetent_r_proto" in
11367 case "$endnetent_r_proto" in
11368 ''|0) try='int endnetent_r(struct netent_data*);'
11369 ./protochk "extern $try" $hdrs && endnetent_r_proto=I_D ;;
11371 case "$endnetent_r_proto" in
11372 ''|0) try='void endnetent_r(struct netent_data*);'
11373 ./protochk "extern $try" $hdrs && endnetent_r_proto=V_D ;;
11375 case "$endnetent_r_proto" in
11376 ''|0) d_endnetent_r=undef
11377 endnetent_r_proto=0
11378 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
11379 * ) case "$endnetent_r_proto" in
11380 REENTRANT_PROTO*) ;;
11381 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
11383 echo "Prototype: $try" ;;
11386 *) case "$usethreads" in
11387 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
11389 d_endnetent_r=undef
11390 endnetent_r_proto=0
11394 *) endnetent_r_proto=0
11398 : see if endprotoent exists
11399 set endprotoent d_endpent
11402 : see if endprotoent_r exists
11403 set endprotoent_r d_endprotoent_r
11405 case "$d_endprotoent_r" in
11407 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11408 case "$d_endprotoent_r_proto:$usethreads" in
11409 ":define") d_endprotoent_r_proto=define
11410 set d_endprotoent_r_proto endprotoent_r $hdrs
11414 case "$d_endprotoent_r_proto" in
11416 case "$endprotoent_r_proto" in
11417 ''|0) try='int endprotoent_r(struct protoent_data*);'
11418 ./protochk "extern $try" $hdrs && endprotoent_r_proto=I_D ;;
11420 case "$endprotoent_r_proto" in
11421 ''|0) try='void endprotoent_r(struct protoent_data*);'
11422 ./protochk "extern $try" $hdrs && endprotoent_r_proto=V_D ;;
11424 case "$endprotoent_r_proto" in
11425 ''|0) d_endprotoent_r=undef
11426 endprotoent_r_proto=0
11427 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
11428 * ) case "$endprotoent_r_proto" in
11429 REENTRANT_PROTO*) ;;
11430 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
11432 echo "Prototype: $try" ;;
11435 *) case "$usethreads" in
11436 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
11438 d_endprotoent_r=undef
11439 endprotoent_r_proto=0
11443 *) endprotoent_r_proto=0
11447 : see if endpwent exists
11448 set endpwent d_endpwent
11451 : see if this is a pwd.h system
11457 xxx=`./findhdr pwd.h`
11458 $cppstdin $cppflags $cppminus < $xxx >$$.h
11460 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
11468 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
11476 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
11484 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
11492 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
11500 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
11508 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
11516 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
11528 set d_pwquota; eval $setvar
11529 set d_pwage; eval $setvar
11530 set d_pwchange; eval $setvar
11531 set d_pwclass; eval $setvar
11532 set d_pwexpire; eval $setvar
11533 set d_pwcomment; eval $setvar
11534 set d_pwgecos; eval $setvar
11535 set d_pwpasswd; eval $setvar
11539 : see if endpwent_r exists
11540 set endpwent_r d_endpwent_r
11542 case "$d_endpwent_r" in
11544 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
11545 case "$d_endpwent_r_proto:$usethreads" in
11546 ":define") d_endpwent_r_proto=define
11547 set d_endpwent_r_proto endpwent_r $hdrs
11551 case "$d_endpwent_r_proto" in
11553 case "$endpwent_r_proto" in
11554 ''|0) try='int endpwent_r(FILE**);'
11555 ./protochk "extern $try" $hdrs && endpwent_r_proto=I_H ;;
11557 case "$endpwent_r_proto" in
11558 ''|0) try='void endpwent_r(FILE**);'
11559 ./protochk "extern $try" $hdrs && endpwent_r_proto=V_H ;;
11561 case "$endpwent_r_proto" in
11562 ''|0) d_endpwent_r=undef
11564 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
11565 * ) case "$endpwent_r_proto" in
11566 REENTRANT_PROTO*) ;;
11567 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
11569 echo "Prototype: $try" ;;
11572 *) case "$usethreads" in
11573 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
11580 *) endpwent_r_proto=0
11584 : see if endservent exists
11585 set endservent d_endsent
11588 : see if endservent_r exists
11589 set endservent_r d_endservent_r
11591 case "$d_endservent_r" in
11593 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11594 case "$d_endservent_r_proto:$usethreads" in
11595 ":define") d_endservent_r_proto=define
11596 set d_endservent_r_proto endservent_r $hdrs
11600 case "$d_endservent_r_proto" in
11602 case "$endservent_r_proto" in
11603 ''|0) try='int endservent_r(struct servent_data*);'
11604 ./protochk "extern $try" $hdrs && endservent_r_proto=I_D ;;
11606 case "$endservent_r_proto" in
11607 ''|0) try='void endservent_r(struct servent_data*);'
11608 ./protochk "extern $try" $hdrs && endservent_r_proto=V_D ;;
11610 case "$endservent_r_proto" in
11611 ''|0) d_endservent_r=undef
11612 endservent_r_proto=0
11613 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
11614 * ) case "$endservent_r_proto" in
11615 REENTRANT_PROTO*) ;;
11616 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
11618 echo "Prototype: $try" ;;
11621 *) case "$usethreads" in
11622 define) echo "endservent_r has no prototype, not using it." >&4 ;;
11624 d_endservent_r=undef
11625 endservent_r_proto=0
11629 *) endservent_r_proto=0
11633 : Locate the flags for 'open()'
11636 #include <sys/types.h>
11641 #include <sys/file.h>
11643 #$i_stdlib I_STDLIB
11645 #include <stdlib.h>
11656 : check sys/file.h first to get FREAD on Sun
11657 if $test `./findhdr sys/file.h` && \
11658 set try -DI_SYS_FILE && eval $compile; then
11660 echo "<sys/file.h> defines the O_* constants..." >&4
11661 if $run ./try; then
11662 echo "and you have the 3 argument form of open()." >&4
11665 echo "but not the 3 argument form of open(). Oh, well." >&4
11668 elif $test `./findhdr fcntl.h` && \
11669 set try -DI_FCNTL && eval $compile; then
11671 echo "<fcntl.h> defines the O_* constants..." >&4
11672 if $run ./try; then
11673 echo "and you have the 3 argument form of open()." >&4
11676 echo "but not the 3 argument form of open(). Oh, well." >&4
11681 echo "I can't find the O_* constant definitions! You got problems." >&4
11687 : see which of string.h or strings.h is needed
11689 strings=`./findhdr string.h`
11690 if $test "$strings" && $test -r "$strings"; then
11691 echo "Using <string.h> instead of <strings.h>." >&4
11695 strings=`./findhdr strings.h`
11696 if $test "$strings" && $test -r "$strings"; then
11697 echo "Using <strings.h> instead of <string.h>." >&4
11699 echo "No string header found -- You'll surely have problems." >&4
11704 case "$i_string" in
11705 "$undef") strings=`./findhdr strings.h`;;
11706 *) strings=`./findhdr string.h`;;
11709 : see if this is a sys/file.h system
11714 : do we need to include sys/file.h ?
11718 if $h_sysfile; then
11720 echo "We'll be including <sys/file.h>." >&4
11723 echo "We won't be including <sys/file.h>." >&4
11733 : see if fcntl.h is there
11738 : see if we can include fcntl.h
11744 echo "We'll be including <fcntl.h>." >&4
11747 if $h_sysfile; then
11748 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
11750 echo "We won't be including <fcntl.h>." >&4
11762 : check for non-blocking I/O stuff
11763 case "$h_sysfile" in
11764 true) echo "#include <sys/file.h>" > head.c;;
11767 true) echo "#include <fcntl.h>" > head.c;;
11768 *) echo "#include <sys/fcntl.h>" > head.c;;
11773 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
11774 case "$o_nonblock" in
11776 $cat head.c > try.c
11777 $cat >>try.c <<EOCP
11779 #$i_stdlib I_STDLIB
11781 #include <stdlib.h>
11789 printf("O_NONBLOCK\n");
11793 printf("O_NDELAY\n");
11797 printf("FNDELAY\n");
11804 if eval $compile_ok; then
11805 o_nonblock=`$run ./try`
11806 case "$o_nonblock" in
11807 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
11808 *) echo "Seems like we can use $o_nonblock.";;
11811 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
11814 *) echo "Using $hint value $o_nonblock.";;
11816 $rm -f try try.* .out core
11819 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
11822 $cat head.c > try.c
11823 $cat >>try.c <<EOCP
11825 #include <sys/types.h>
11826 #include <signal.h>
11828 #$i_stdlib I_STDLIB
11830 #include <stdlib.h>
11836 #define MY_O_NONBLOCK $o_nonblock
11837 #ifndef errno /* XXX need better Configure test */
11840 #$i_unistd I_UNISTD
11842 #include <unistd.h>
11844 #$i_string I_STRING
11846 #include <string.h>
11848 #include <strings.h>
11850 $signal_t blech(x) int x; { exit(3); }
11852 $cat >> try.c <<'EOCP'
11860 pipe(pd); /* Down: child -> parent */
11861 pipe(pu); /* Up: parent -> child */
11864 close(pd[1]); /* Parent reads from pd[0] */
11865 close(pu[0]); /* Parent writes (blocking) to pu[1] */
11867 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
11872 signal(SIGALRM, blech);
11874 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
11876 sprintf(string, "%d\n", ret);
11877 write(2, string, strlen(string));
11880 if (errno == EAGAIN) {
11881 printf("EAGAIN\n");
11886 if (errno == EWOULDBLOCK)
11887 printf("EWOULDBLOCK\n");
11890 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
11891 sleep(2); /* Give it time to close our pipe */
11893 ret = read(pd[0], buf, 1); /* Should read EOF */
11895 sprintf(string, "%d\n", ret);
11896 write(4, string, strlen(string));
11900 close(pd[0]); /* We write to pd[1] */
11901 close(pu[1]); /* We read from pu[0] */
11902 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
11903 close(pd[1]); /* Pipe pd is now fully closed! */
11904 exit(0); /* Bye bye, thank you for playing! */
11908 if eval $compile_ok; then
11909 echo "$startsh" >mtry
11910 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
11912 ./mtry >/dev/null 2>&1
11914 0) eagain=`$cat try.out`;;
11915 1) echo "Could not perform non-blocking setting!";;
11916 2) echo "I did a successful read() for something that was not there!";;
11917 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
11918 4) echo "Could not find F_SETFL!";;
11919 *) echo "Something terribly wrong happened during testing.";;
11921 rd_nodata=`$cat try.ret`
11922 echo "A read() system call with no data present returns $rd_nodata."
11923 case "$rd_nodata" in
11926 echo "(That's peculiar, fixing that to be -1.)"
11932 echo "Forcing errno EAGAIN on read() with no data available."
11936 echo "Your read() sets errno to $eagain when no data is available."
11939 status=`$cat try.err`
11941 0) echo "And it correctly returns 0 to signal EOF.";;
11942 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
11943 *) echo "However, your read() returns '$status' on EOF??";;
11946 if test "$status" = "$rd_nodata"; then
11947 echo "WARNING: you can't distinguish between EOF and no data!"
11951 echo "I can't compile the test program--assuming errno EAGAIN will do."
11958 echo "Using $hint value $eagain."
11959 echo "Your read() returns $rd_nodata when no data is present."
11960 case "$d_eofnblk" in
11961 "$define") echo "And you can see EOF because read() returns 0.";;
11962 "$undef") echo "But you can't see EOF status from read() returned value.";;
11964 echo "(Assuming you can't see EOF status from read anyway.)"
11970 $rm -f try try.* .out core head.c mtry
11972 : see if _ptr and _cnt from stdio act std
11975 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
11976 echo "(Looks like you have stdio.h from BSD.)"
11977 case "$stdio_ptr" in
11978 '') stdio_ptr='((fp)->_p)'
11981 *) ptr_lval=$d_stdio_ptr_lval;;
11983 case "$stdio_cnt" in
11984 '') stdio_cnt='((fp)->_r)'
11987 *) cnt_lval=$d_stdio_cnt_lval;;
11989 case "$stdio_base" in
11990 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
11992 case "$stdio_bufsiz" in
11993 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
11995 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
11996 echo "(Looks like you have stdio.h from Linux.)"
11997 case "$stdio_ptr" in
11998 '') stdio_ptr='((fp)->_IO_read_ptr)'
12001 *) ptr_lval=$d_stdio_ptr_lval;;
12003 case "$stdio_cnt" in
12004 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12007 *) cnt_lval=$d_stdio_cnt_lval;;
12009 case "$stdio_base" in
12010 '') stdio_base='((fp)->_IO_read_base)';;
12012 case "$stdio_bufsiz" in
12013 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12016 case "$stdio_ptr" in
12017 '') stdio_ptr='((fp)->_ptr)'
12020 *) ptr_lval=$d_stdio_ptr_lval;;
12022 case "$stdio_cnt" in
12023 '') stdio_cnt='((fp)->_cnt)'
12026 *) cnt_lval=$d_stdio_cnt_lval;;
12028 case "$stdio_base" in
12029 '') stdio_base='((fp)->_base)';;
12031 case "$stdio_bufsiz" in
12032 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12036 : test whether _ptr and _cnt really work
12037 echo "Checking how std your stdio is..." >&4
12040 #$i_stdlib I_STDLIB
12042 #include <stdlib.h>
12044 #define FILE_ptr(fp) $stdio_ptr
12045 #define FILE_cnt(fp) $stdio_cnt
12047 FILE *fp = fopen("try.c", "r");
12050 18 <= FILE_cnt(fp) &&
12051 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12059 if eval $compile && $to try.c; then
12060 if $run ./try; then
12061 echo "Your stdio acts pretty std."
12064 echo "Your stdio isn't very std."
12067 echo "Your stdio doesn't appear very std."
12071 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12072 # direct buffer manipulation no longer works. The Configure tests
12073 # should be changed to correctly detect this, but until then,
12074 # the following check should at least let perl compile and run.
12075 # (This quick fix should be updated before 5.8.1.)
12076 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12077 # A. Dougherty, June 3, 2002.
12078 case "$d_gnulibc" in
12080 case "$gnulibc_version" in
12084 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12093 : Can _ptr be used as an lvalue?
12094 case "$d_stdstdio$ptr_lval" in
12095 $define$define) val=$define ;;
12098 set d_stdio_ptr_lval
12101 : Can _cnt be used as an lvalue?
12102 case "$d_stdstdio$cnt_lval" in
12103 $define$define) val=$define ;;
12106 set d_stdio_cnt_lval
12110 : test whether setting _ptr sets _cnt as a side effect
12111 d_stdio_ptr_lval_sets_cnt="$undef"
12112 d_stdio_ptr_lval_nochange_cnt="$undef"
12113 case "$d_stdio_ptr_lval$d_stdstdio" in
12115 echo "Checking to see what happens if we set the stdio ptr..." >&4
12118 /* Can we scream? */
12119 /* Eat dust sed :-) */
12120 /* In the buffer space, no one can hear you scream. */
12121 #$i_stdlib I_STDLIB
12123 #include <stdlib.h>
12125 #define FILE_ptr(fp) $stdio_ptr
12126 #define FILE_cnt(fp) $stdio_cnt
12127 #include <sys/types.h>
12129 FILE *fp = fopen("try.c", "r");
12134 puts("Fail even to read");
12137 c = getc(fp); /* Read away the first # */
12139 puts("Fail even to read");
12143 18 <= FILE_cnt(fp) &&
12144 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12146 puts("Fail even to read");
12149 ptr = (char*) FILE_ptr(fp);
12150 cnt = (size_t)FILE_cnt(fp);
12152 FILE_ptr(fp) += 42;
12154 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12155 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12158 if (FILE_cnt(fp) <= 20) {
12159 printf ("Fail (<20 chars to test)");
12162 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12163 puts("Fail compare");
12166 if (cnt == FILE_cnt(fp)) {
12167 puts("Pass_unchanged");
12170 if (FILE_cnt(fp) == (cnt - 42)) {
12171 puts("Pass_changed");
12174 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12180 if eval $compile && $to try.c; then
12181 case `$run ./try` in
12183 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12184 d_stdio_ptr_lval_sets_cnt="$define" ;;
12186 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12187 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12189 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12191 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12194 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12200 : see if _base is also standard
12202 case "$d_stdstdio" in
12206 #$i_stdlib I_STDLIB
12208 #include <stdlib.h>
12210 #define FILE_base(fp) $stdio_base
12211 #define FILE_bufsiz(fp) $stdio_bufsiz
12213 FILE *fp = fopen("try.c", "r");
12216 19 <= FILE_bufsiz(fp) &&
12217 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
12224 if eval $compile && $to try.c; then
12225 if $run ./try; then
12226 echo "And its _base field acts std."
12229 echo "But its _base field isn't std."
12232 echo "However, it seems to be lacking the _base field."
12240 : see if fast_stdio exists
12242 case "$d_stdstdio:$d_stdio_ptr_lval" in
12244 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
12246 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
12257 : see if fchdir exists
12258 set fchdir d_fchdir
12261 : see if fchmod exists
12262 set fchmod d_fchmod
12265 : see if fchown exists
12266 set fchown d_fchown
12269 : see if this is an fcntl system
12274 : See if fcntl-based locking works.
12276 #$i_stdlib I_STDLIB
12278 #include <stdlib.h>
12280 #include <unistd.h>
12282 #include <signal.h>
12283 $signal_t blech(x) int x; { exit(3); }
12285 #if defined(F_SETLK) && defined(F_SETLKW)
12286 struct flock flock;
12288 fd = open("try.c", O_RDONLY);
12289 flock.l_type = F_RDLCK;
12290 flock.l_whence = SEEK_SET;
12291 flock.l_start = flock.l_len = 0;
12292 signal(SIGALRM, blech);
12294 retval = fcntl(fd, F_SETLK, &flock);
12296 (retval < 0 ? exit(2) : exit(0));
12302 echo "Checking if fcntl-based file locking works... "
12306 if eval $compile_ok; then
12307 if $run ./try; then
12308 echo "Yes, it seems to work."
12311 echo "Nope, it didn't work."
12316 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
12317 *** This is (almost) impossible.
12318 *** If your NFS lock daemons are not feeling well, something like
12319 *** this may happen, please investigate. Cannot continue, aborting.
12327 echo "I'm unable to compile the test program, so I'll assume not."
12332 echo "Nope, since you don't even have fcntl()."
12335 set d_fcntl_can_lock
12340 : check for fd_set items
12343 Checking to see how well your C compiler handles fd_set and friends ...
12346 #$i_stdlib I_STDLIB
12348 #include <stdlib.h>
12350 #$i_systime I_SYS_TIME
12351 #$i_sysselct I_SYS_SELECT
12352 #$d_socket HAS_SOCKET
12353 #include <sys/types.h>
12355 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
12358 #include <sys/time.h>
12360 #ifdef I_SYS_SELECT
12361 #include <sys/select.h>
12370 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
12378 if eval $compile; then
12379 d_fds_bits="$define"
12381 echo "Well, your system knows about the normal fd_set typedef..." >&4
12382 if $run ./try; then
12383 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
12384 d_fd_macros="$define"
12387 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
12389 d_fd_macros="$undef"
12393 Hmm, your compiler has some difficulty with fd_set. Checking further...
12396 if eval $compile; then
12397 d_fds_bits="$undef"
12399 echo "Well, your system has some sort of fd_set available..." >&4
12400 if $run ./try; then
12401 echo "and you have the normal fd_set macros." >&4
12402 d_fd_macros="$define"
12405 but not the normal fd_set macros! Gross! More work for me...
12407 d_fd_macros="$undef"
12410 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
12412 d_fds_bits="$undef"
12413 d_fd_macros="$undef"
12418 : see if fgetpos exists
12419 set fgetpos d_fgetpos
12422 : see if finite exists
12423 set finite d_finite
12426 : see if finitel exists
12427 set finitel d_finitel
12430 : see if flock exists
12434 : see if prototype for flock is available
12436 set d_flockproto flock $i_sysfile sys/file.h
12439 : see if fork exists
12443 : see if fp_class exists
12444 set fp_class d_fp_class
12447 : see if pathconf exists
12448 set pathconf d_pathconf
12451 : see if fpathconf exists
12452 set fpathconf d_fpathconf
12455 : see if fpclass exists
12456 set fpclass d_fpclass
12459 : see if fpclassify exists
12460 set fpclassify d_fpclassify
12463 : see if fpclassl exists
12464 set fpclassl d_fpclassl
12468 : check for fpos64_t
12470 echo "Checking to see if you have fpos64_t..." >&4
12473 int main() { fpos64_t x = 7; }
12476 if eval $compile; then
12478 echo "You have fpos64_t."
12481 echo "You do not have fpos64_t."
12482 case "$fpossize" in
12483 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
12490 : see if frexpl exists
12491 set frexpl d_frexpl
12494 : see if this is a sys/param system
12495 set sys/param.h i_sysparam
12498 : see if this is a sys/mount.h system
12499 set sys/mount.h i_sysmount
12504 echo "Checking to see if your system supports struct fs_data..." >&4
12505 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
12507 case "$d_fs_data_s" in
12508 "$define") echo "Yes, it does." ;;
12509 *) echo "No, it doesn't." ;;
12512 : see if fseeko exists
12513 set fseeko d_fseeko
12515 case "$longsize" in
12516 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
12519 : see if fsetpos exists
12520 set fsetpos d_fsetpos
12524 : see if fstatfs exists
12525 set fstatfs d_fstatfs
12529 : see if statvfs exists
12530 set statvfs d_statvfs
12533 : see if fstatvfs exists
12534 set fstatvfs d_fstatvfs
12538 : see if fsync exists
12542 : see if ftello exists
12543 set ftello d_ftello
12545 case "$longsize" in
12546 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
12549 : see if getcwd exists
12550 set getcwd d_getcwd
12553 : see if getespwnam exists
12554 set getespwnam d_getespwnam
12558 : see if getfsstat exists
12559 set getfsstat d_getfsstat
12562 : see if getgrent exists
12563 set getgrent d_getgrent
12566 : see if getgrent_r exists
12567 set getgrent_r d_getgrent_r
12569 case "$d_getgrent_r" in
12571 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12572 case "$d_getgrent_r_proto:$usethreads" in
12573 ":define") d_getgrent_r_proto=define
12574 set d_getgrent_r_proto getgrent_r $hdrs
12578 case "$d_getgrent_r_proto" in
12580 case "$getgrent_r_proto" in
12581 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
12582 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBWR ;;
12584 case "$getgrent_r_proto" in
12585 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
12586 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIR ;;
12588 case "$getgrent_r_proto" in
12589 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
12590 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBW ;;
12592 case "$getgrent_r_proto" in
12593 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
12594 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBI ;;
12596 case "$getgrent_r_proto" in
12597 ''|0) try='int getgrent_r(struct group*, char*, int);'
12598 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBI ;;
12600 case "$getgrent_r_proto" in
12601 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
12602 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIH ;;
12604 case "$getgrent_r_proto" in
12605 ''|0) d_getgrent_r=undef
12607 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
12608 * ) case "$getgrent_r_proto" in
12609 REENTRANT_PROTO*) ;;
12610 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
12612 echo "Prototype: $try" ;;
12615 *) case "$usethreads" in
12616 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
12623 *) getgrent_r_proto=0
12627 : see if getgrgid_r exists
12628 set getgrgid_r d_getgrgid_r
12630 case "$d_getgrgid_r" in
12632 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12633 case "$d_getgrgid_r_proto:$usethreads" in
12634 ":define") d_getgrgid_r_proto=define
12635 set d_getgrgid_r_proto getgrgid_r $hdrs
12639 case "$d_getgrgid_r_proto" in
12641 case "$getgrgid_r_proto" in
12642 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
12643 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
12645 case "$getgrgid_r_proto" in
12646 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
12647 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
12649 case "$getgrgid_r_proto" in
12650 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
12651 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
12653 case "$getgrgid_r_proto" in
12654 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
12655 ./protochk "extern $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
12657 case "$getgrgid_r_proto" in
12658 ''|0) d_getgrgid_r=undef
12660 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
12661 * ) case "$getgrgid_r_proto" in
12662 REENTRANT_PROTO*) ;;
12663 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
12665 echo "Prototype: $try" ;;
12668 *) case "$usethreads" in
12669 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
12676 *) getgrgid_r_proto=0
12680 : see if getgrnam_r exists
12681 set getgrnam_r d_getgrnam_r
12683 case "$d_getgrnam_r" in
12685 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12686 case "$d_getgrnam_r_proto:$usethreads" in
12687 ":define") d_getgrnam_r_proto=define
12688 set d_getgrnam_r_proto getgrnam_r $hdrs
12692 case "$d_getgrnam_r_proto" in
12694 case "$getgrnam_r_proto" in
12695 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
12696 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
12698 case "$getgrnam_r_proto" in
12699 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
12700 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
12702 case "$getgrnam_r_proto" in
12703 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
12704 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CBI ;;
12706 case "$getgrnam_r_proto" in
12707 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
12708 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
12710 case "$getgrnam_r_proto" in
12711 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
12712 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
12714 case "$getgrnam_r_proto" in
12715 ''|0) d_getgrnam_r=undef
12717 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
12718 * ) case "$getgrnam_r_proto" in
12719 REENTRANT_PROTO*) ;;
12720 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
12722 echo "Prototype: $try" ;;
12725 *) case "$usethreads" in
12726 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
12733 *) getgrnam_r_proto=0
12737 : see if gethostbyaddr exists
12738 set gethostbyaddr d_gethbyaddr
12741 : see if gethostbyname exists
12742 set gethostbyname d_gethbyname
12745 : see if gethostent exists
12746 set gethostent d_gethent
12749 : see how we will look up host name
12752 if set gethostname val -f d_gethname; eval $csym; $val; then
12753 echo 'gethostname() found.' >&4
12754 d_gethname="$define"
12757 if set uname val -f d_uname; eval $csym; $val; then
12760 uname() was found, but you're running xenix, and older versions of xenix
12761 have a broken uname(). If you don't really know whether your xenix is old
12762 enough to have a broken system call, use the default answer.
12767 "$define") dflt=n;;
12769 rp='Is your uname() broken?'
12772 n*) d_uname="$define"; call=uname;;
12775 echo 'uname() found.' >&4
12782 case "$d_gethname" in
12783 '') d_gethname="$undef";;
12786 '') d_uname="$undef";;
12788 case "$d_uname$d_gethname" in
12793 Every now and then someone has a $call() that lies about the hostname
12794 but can't be fixed for political or economic reasons. If you wish, I can
12795 pretend $call() isn't there and maybe compute hostname at run-time
12796 thanks to the '$phostname' command.
12799 rp="Shall I ignore $call() from now on?"
12802 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
12805 case "$phostname" in
12806 '') aphostname='';;
12807 *) case "$aphostname" in
12809 *) set X $phostname
12813 file=`./loc $file $file $pth`
12814 aphostname=`echo $file $*`
12819 case "$d_uname$d_gethname" in
12822 case "$phostname" in
12824 echo "There will be no way for $package to get your hostname." >&4;;
12826 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
12830 case "$d_phostname" in
12831 '') d_phostname="$undef";;
12834 : see if gethostbyaddr_r exists
12835 set gethostbyaddr_r d_gethostbyaddr_r
12837 case "$d_gethostbyaddr_r" in
12839 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12840 case "$d_gethostbyaddr_r_proto:$usethreads" in
12841 ":define") d_gethostbyaddr_r_proto=define
12842 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
12846 case "$d_gethostbyaddr_r_proto" in
12848 case "$gethostbyaddr_r_proto" in
12849 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
12850 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
12852 case "$gethostbyaddr_r_proto" in
12853 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
12854 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
12856 case "$gethostbyaddr_r_proto" in
12857 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
12858 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
12860 case "$gethostbyaddr_r_proto" in
12861 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
12862 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
12864 case "$gethostbyaddr_r_proto" in
12865 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
12866 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
12868 case "$gethostbyaddr_r_proto" in
12869 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
12870 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
12872 case "$gethostbyaddr_r_proto" in
12873 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
12874 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
12876 case "$gethostbyaddr_r_proto" in
12877 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
12878 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
12880 case "$gethostbyaddr_r_proto" in
12881 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
12882 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
12884 case "$gethostbyaddr_r_proto" in
12885 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
12886 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
12888 case "$gethostbyaddr_r_proto" in
12889 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
12890 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
12892 case "$gethostbyaddr_r_proto" in
12893 ''|0) d_gethostbyaddr_r=undef
12894 gethostbyaddr_r_proto=0
12895 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
12896 * ) case "$gethostbyaddr_r_proto" in
12897 REENTRANT_PROTO*) ;;
12898 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
12900 echo "Prototype: $try" ;;
12903 *) case "$usethreads" in
12904 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
12906 d_gethostbyaddr_r=undef
12907 gethostbyaddr_r_proto=0
12911 *) gethostbyaddr_r_proto=0
12915 : see if gethostbyname_r exists
12916 set gethostbyname_r d_gethostbyname_r
12918 case "$d_gethostbyname_r" in
12920 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12921 case "$d_gethostbyname_r_proto:$usethreads" in
12922 ":define") d_gethostbyname_r_proto=define
12923 set d_gethostbyname_r_proto gethostbyname_r $hdrs
12927 case "$d_gethostbyname_r_proto" in
12929 case "$gethostbyname_r_proto" in
12930 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
12931 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
12933 case "$gethostbyname_r_proto" in
12934 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
12935 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
12937 case "$gethostbyname_r_proto" in
12938 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
12939 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
12941 case "$gethostbyname_r_proto" in
12942 ''|0) d_gethostbyname_r=undef
12943 gethostbyname_r_proto=0
12944 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
12945 * ) case "$gethostbyname_r_proto" in
12946 REENTRANT_PROTO*) ;;
12947 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
12949 echo "Prototype: $try" ;;
12952 *) case "$usethreads" in
12953 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
12955 d_gethostbyname_r=undef
12956 gethostbyname_r_proto=0
12960 *) gethostbyname_r_proto=0
12964 : see if gethostent_r exists
12965 set gethostent_r d_gethostent_r
12967 case "$d_gethostent_r" in
12969 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12970 case "$d_gethostent_r_proto:$usethreads" in
12971 ":define") d_gethostent_r_proto=define
12972 set d_gethostent_r_proto gethostent_r $hdrs
12976 case "$d_gethostent_r_proto" in
12978 case "$gethostent_r_proto" in
12979 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
12980 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
12982 case "$gethostent_r_proto" in
12983 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
12984 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBIE ;;
12986 case "$gethostent_r_proto" in
12987 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
12988 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBIE ;;
12990 case "$gethostent_r_proto" in
12991 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
12992 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBI ;;
12994 case "$gethostent_r_proto" in
12995 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
12996 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBI ;;
12998 case "$gethostent_r_proto" in
12999 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13000 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SD ;;
13002 case "$gethostent_r_proto" in
13003 ''|0) d_gethostent_r=undef
13004 gethostent_r_proto=0
13005 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13006 * ) case "$gethostent_r_proto" in
13007 REENTRANT_PROTO*) ;;
13008 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13010 echo "Prototype: $try" ;;
13013 *) case "$usethreads" in
13014 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13016 d_gethostent_r=undef
13017 gethostent_r_proto=0
13021 *) gethostent_r_proto=0
13025 : see if prototypes for various gethostxxx netdb.h functions are available
13027 set d_gethostprotos gethostent $i_netdb netdb.h
13030 : see if getitimer exists
13031 set getitimer d_getitimer
13034 : see if getlogin exists
13035 set getlogin d_getlogin
13038 : see if getlogin_r exists
13039 set getlogin_r d_getlogin_r
13041 case "$d_getlogin_r" in
13043 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
13044 case "$d_getlogin_r_proto:$usethreads" in
13045 ":define") d_getlogin_r_proto=define
13046 set d_getlogin_r_proto getlogin_r $hdrs
13050 case "$d_getlogin_r_proto" in
13052 case "$getlogin_r_proto" in
13053 ''|0) try='int getlogin_r(char*, size_t);'
13054 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BW ;;
13056 case "$getlogin_r_proto" in
13057 ''|0) try='int getlogin_r(char*, int);'
13058 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BI ;;
13060 case "$getlogin_r_proto" in
13061 ''|0) try='char* getlogin_r(char*, size_t);'
13062 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BW ;;
13064 case "$getlogin_r_proto" in
13065 ''|0) try='char* getlogin_r(char*, int);'
13066 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BI ;;
13068 case "$getlogin_r_proto" in
13069 ''|0) d_getlogin_r=undef
13071 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
13072 * ) case "$getlogin_r_proto" in
13073 REENTRANT_PROTO*) ;;
13074 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
13076 echo "Prototype: $try" ;;
13079 *) case "$usethreads" in
13080 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
13087 *) getlogin_r_proto=0
13091 : see if getmnt exists
13092 set getmnt d_getmnt
13095 : see if getmntent exists
13096 set getmntent d_getmntent
13099 : see if getnetbyaddr exists
13100 set getnetbyaddr d_getnbyaddr
13103 : see if getnetbyname exists
13104 set getnetbyname d_getnbyname
13107 : see if getnetent exists
13108 set getnetent d_getnent
13111 : see if getnetbyaddr_r exists
13112 set getnetbyaddr_r d_getnetbyaddr_r
13114 case "$d_getnetbyaddr_r" in
13116 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13117 case "$d_getnetbyaddr_r_proto:$usethreads" in
13118 ":define") d_getnetbyaddr_r_proto=define
13119 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
13123 case "$d_getnetbyaddr_r_proto" in
13125 case "$getnetbyaddr_r_proto" in
13126 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
13127 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
13129 case "$getnetbyaddr_r_proto" in
13130 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
13131 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
13133 case "$getnetbyaddr_r_proto" in
13134 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
13135 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
13137 case "$getnetbyaddr_r_proto" in
13138 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
13139 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
13141 case "$getnetbyaddr_r_proto" in
13142 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
13143 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
13145 case "$getnetbyaddr_r_proto" in
13146 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
13147 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
13149 case "$getnetbyaddr_r_proto" in
13150 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
13151 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
13153 case "$getnetbyaddr_r_proto" in
13154 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
13155 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
13157 case "$getnetbyaddr_r_proto" in
13158 ''|0) d_getnetbyaddr_r=undef
13159 getnetbyaddr_r_proto=0
13160 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
13161 * ) case "$getnetbyaddr_r_proto" in
13162 REENTRANT_PROTO*) ;;
13163 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
13165 echo "Prototype: $try" ;;
13168 *) case "$usethreads" in
13169 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
13171 d_getnetbyaddr_r=undef
13172 getnetbyaddr_r_proto=0
13176 *) getnetbyaddr_r_proto=0
13180 : see if getnetbyname_r exists
13181 set getnetbyname_r d_getnetbyname_r
13183 case "$d_getnetbyname_r" in
13185 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13186 case "$d_getnetbyname_r_proto:$usethreads" in
13187 ":define") d_getnetbyname_r_proto=define
13188 set d_getnetbyname_r_proto getnetbyname_r $hdrs
13192 case "$d_getnetbyname_r_proto" in
13194 case "$getnetbyname_r_proto" in
13195 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
13196 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
13198 case "$getnetbyname_r_proto" in
13199 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
13200 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
13202 case "$getnetbyname_r_proto" in
13203 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
13204 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
13206 case "$getnetbyname_r_proto" in
13207 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
13208 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
13210 case "$getnetbyname_r_proto" in
13211 ''|0) d_getnetbyname_r=undef
13212 getnetbyname_r_proto=0
13213 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
13214 * ) case "$getnetbyname_r_proto" in
13215 REENTRANT_PROTO*) ;;
13216 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
13218 echo "Prototype: $try" ;;
13221 *) case "$usethreads" in
13222 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
13224 d_getnetbyname_r=undef
13225 getnetbyname_r_proto=0
13229 *) getnetbyname_r_proto=0
13233 : see if getnetent_r exists
13234 set getnetent_r d_getnetent_r
13236 case "$d_getnetent_r" in
13238 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13239 case "$d_getnetent_r_proto:$usethreads" in
13240 ":define") d_getnetent_r_proto=define
13241 set d_getnetent_r_proto getnetent_r $hdrs
13245 case "$d_getnetent_r_proto" in
13247 case "$getnetent_r_proto" in
13248 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
13249 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
13251 case "$getnetent_r_proto" in
13252 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
13253 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBIE ;;
13255 case "$getnetent_r_proto" in
13256 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
13257 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBIE ;;
13259 case "$getnetent_r_proto" in
13260 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
13261 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBI ;;
13263 case "$getnetent_r_proto" in
13264 ''|0) try='int getnetent_r(struct netent*, char*, int);'
13265 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBI ;;
13267 case "$getnetent_r_proto" in
13268 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
13269 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SD ;;
13271 case "$getnetent_r_proto" in
13272 ''|0) d_getnetent_r=undef
13273 getnetent_r_proto=0
13274 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
13275 * ) case "$getnetent_r_proto" in
13276 REENTRANT_PROTO*) ;;
13277 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
13279 echo "Prototype: $try" ;;
13282 *) case "$usethreads" in
13283 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
13285 d_getnetent_r=undef
13286 getnetent_r_proto=0
13290 *) getnetent_r_proto=0
13294 : see if prototypes for various getnetxxx netdb.h functions are available
13296 set d_getnetprotos getnetent $i_netdb netdb.h
13299 : see if getpagesize exists
13300 set getpagesize d_getpagsz
13304 : see if getprotobyname exists
13305 set getprotobyname d_getpbyname
13308 : see if getprotobynumber exists
13309 set getprotobynumber d_getpbynumber
13312 : see if getprotoent exists
13313 set getprotoent d_getpent
13316 : see if getpgid exists
13317 set getpgid d_getpgid
13320 : see if getpgrp2 exists
13321 set getpgrp2 d_getpgrp2
13324 : see if getppid exists
13325 set getppid d_getppid
13328 : see if getpriority exists
13329 set getpriority d_getprior
13332 : see if getprotobyname_r exists
13333 set getprotobyname_r d_getprotobyname_r
13335 case "$d_getprotobyname_r" in
13337 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13338 case "$d_getprotobyname_r_proto:$usethreads" in
13339 ":define") d_getprotobyname_r_proto=define
13340 set d_getprotobyname_r_proto getprotobyname_r $hdrs
13344 case "$d_getprotobyname_r_proto" in
13346 case "$getprotobyname_r_proto" in
13347 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
13348 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
13350 case "$getprotobyname_r_proto" in
13351 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
13352 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
13354 case "$getprotobyname_r_proto" in
13355 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
13356 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
13358 case "$getprotobyname_r_proto" in
13359 ''|0) d_getprotobyname_r=undef
13360 getprotobyname_r_proto=0
13361 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
13362 * ) case "$getprotobyname_r_proto" in
13363 REENTRANT_PROTO*) ;;
13364 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
13366 echo "Prototype: $try" ;;
13369 *) case "$usethreads" in
13370 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
13372 d_getprotobyname_r=undef
13373 getprotobyname_r_proto=0
13377 *) getprotobyname_r_proto=0
13381 : see if getprotobynumber_r exists
13382 set getprotobynumber_r d_getprotobynumber_r
13384 case "$d_getprotobynumber_r" in
13386 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13387 case "$d_getprotobynumber_r_proto:$usethreads" in
13388 ":define") d_getprotobynumber_r_proto=define
13389 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
13393 case "$d_getprotobynumber_r_proto" in
13395 case "$getprotobynumber_r_proto" in
13396 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
13397 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
13399 case "$getprotobynumber_r_proto" in
13400 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
13401 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
13403 case "$getprotobynumber_r_proto" in
13404 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
13405 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
13407 case "$getprotobynumber_r_proto" in
13408 ''|0) d_getprotobynumber_r=undef
13409 getprotobynumber_r_proto=0
13410 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
13411 * ) case "$getprotobynumber_r_proto" in
13412 REENTRANT_PROTO*) ;;
13413 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
13415 echo "Prototype: $try" ;;
13418 *) case "$usethreads" in
13419 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
13421 d_getprotobynumber_r=undef
13422 getprotobynumber_r_proto=0
13426 *) getprotobynumber_r_proto=0
13430 : see if getprotoent_r exists
13431 set getprotoent_r d_getprotoent_r
13433 case "$d_getprotoent_r" in
13435 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13436 case "$d_getprotoent_r_proto:$usethreads" in
13437 ":define") d_getprotoent_r_proto=define
13438 set d_getprotoent_r_proto getprotoent_r $hdrs
13442 case "$d_getprotoent_r_proto" in
13444 case "$getprotoent_r_proto" in
13445 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
13446 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
13448 case "$getprotoent_r_proto" in
13449 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
13450 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBI ;;
13452 case "$getprotoent_r_proto" in
13453 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
13454 ./protochk "extern $try" $hdrs && getprotoent_r_proto=S_SBI ;;
13456 case "$getprotoent_r_proto" in
13457 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
13458 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SD ;;
13460 case "$getprotoent_r_proto" in
13461 ''|0) d_getprotoent_r=undef
13462 getprotoent_r_proto=0
13463 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
13464 * ) case "$getprotoent_r_proto" in
13465 REENTRANT_PROTO*) ;;
13466 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
13468 echo "Prototype: $try" ;;
13471 *) case "$usethreads" in
13472 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
13474 d_getprotoent_r=undef
13475 getprotoent_r_proto=0
13479 *) getprotoent_r_proto=0
13483 : see if prototypes for various getprotoxxx netdb.h functions are available
13485 set d_getprotoprotos getprotoent $i_netdb netdb.h
13488 : see if getprpwnam exists
13489 set getprpwnam d_getprpwnam
13492 : see if getpwent exists
13493 set getpwent d_getpwent
13496 : see if getpwent_r exists
13497 set getpwent_r d_getpwent_r
13499 case "$d_getpwent_r" in
13501 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13502 case "$d_getpwent_r_proto:$usethreads" in
13503 ":define") d_getpwent_r_proto=define
13504 set d_getpwent_r_proto getpwent_r $hdrs
13508 case "$d_getpwent_r_proto" in
13510 case "$getpwent_r_proto" in
13511 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
13512 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBWR ;;
13514 case "$getpwent_r_proto" in
13515 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
13516 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIR ;;
13518 case "$getpwent_r_proto" in
13519 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
13520 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBW ;;
13522 case "$getpwent_r_proto" in
13523 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
13524 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBI ;;
13526 case "$getpwent_r_proto" in
13527 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
13528 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBI ;;
13530 case "$getpwent_r_proto" in
13531 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
13532 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIH ;;
13534 case "$getpwent_r_proto" in
13535 ''|0) d_getpwent_r=undef
13537 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
13538 * ) case "$getpwent_r_proto" in
13539 REENTRANT_PROTO*) ;;
13540 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
13542 echo "Prototype: $try" ;;
13545 *) case "$usethreads" in
13546 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
13553 *) getpwent_r_proto=0
13557 : see if getpwnam_r exists
13558 set getpwnam_r d_getpwnam_r
13560 case "$d_getpwnam_r" in
13562 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13563 case "$d_getpwnam_r_proto:$usethreads" in
13564 ":define") d_getpwnam_r_proto=define
13565 set d_getpwnam_r_proto getpwnam_r $hdrs
13569 case "$d_getpwnam_r_proto" in
13571 case "$getpwnam_r_proto" in
13572 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
13573 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
13575 case "$getpwnam_r_proto" in
13576 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
13577 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
13579 case "$getpwnam_r_proto" in
13580 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
13581 ./protochk "extern $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
13583 case "$getpwnam_r_proto" in
13584 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
13585 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
13587 case "$getpwnam_r_proto" in
13588 ''|0) d_getpwnam_r=undef
13590 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
13591 * ) case "$getpwnam_r_proto" in
13592 REENTRANT_PROTO*) ;;
13593 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
13595 echo "Prototype: $try" ;;
13598 *) case "$usethreads" in
13599 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
13606 *) getpwnam_r_proto=0
13610 : see if getpwuid_r exists
13611 set getpwuid_r d_getpwuid_r
13613 case "$d_getpwuid_r" in
13615 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13616 case "$d_getpwuid_r_proto:$usethreads" in
13617 ":define") d_getpwuid_r_proto=define
13618 set d_getpwuid_r_proto getpwuid_r $hdrs
13622 case "$d_getpwuid_r_proto" in
13624 case "$getpwuid_r_proto" in
13625 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
13626 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
13628 case "$getpwuid_r_proto" in
13629 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
13630 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
13632 case "$getpwuid_r_proto" in
13633 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
13634 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
13636 case "$getpwuid_r_proto" in
13637 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
13638 ./protochk "extern $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
13640 case "$getpwuid_r_proto" in
13641 ''|0) d_getpwuid_r=undef
13643 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
13644 * ) case "$getpwuid_r_proto" in
13645 REENTRANT_PROTO*) ;;
13646 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
13648 echo "Prototype: $try" ;;
13651 *) case "$usethreads" in
13652 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
13659 *) getpwuid_r_proto=0
13664 : see if getservbyname exists
13665 set getservbyname d_getsbyname
13668 : see if getservbyport exists
13669 set getservbyport d_getsbyport
13672 : see if getservent exists
13673 set getservent d_getsent
13676 : see if getservbyname_r exists
13677 set getservbyname_r d_getservbyname_r
13679 case "$d_getservbyname_r" in
13681 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13682 case "$d_getservbyname_r_proto:$usethreads" in
13683 ":define") d_getservbyname_r_proto=define
13684 set d_getservbyname_r_proto getservbyname_r $hdrs
13688 case "$d_getservbyname_r_proto" in
13690 case "$getservbyname_r_proto" in
13691 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
13692 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
13694 case "$getservbyname_r_proto" in
13695 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
13696 ./protochk "extern $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
13698 case "$getservbyname_r_proto" in
13699 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
13700 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
13702 case "$getservbyname_r_proto" in
13703 ''|0) d_getservbyname_r=undef
13704 getservbyname_r_proto=0
13705 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
13706 * ) case "$getservbyname_r_proto" in
13707 REENTRANT_PROTO*) ;;
13708 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
13710 echo "Prototype: $try" ;;
13713 *) case "$usethreads" in
13714 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
13716 d_getservbyname_r=undef
13717 getservbyname_r_proto=0
13721 *) getservbyname_r_proto=0
13725 : see if getservbyport_r exists
13726 set getservbyport_r d_getservbyport_r
13728 case "$d_getservbyport_r" in
13730 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13731 case "$d_getservbyport_r_proto:$usethreads" in
13732 ":define") d_getservbyport_r_proto=define
13733 set d_getservbyport_r_proto getservbyport_r $hdrs
13737 case "$d_getservbyport_r_proto" in
13739 case "$getservbyport_r_proto" in
13740 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
13741 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
13743 case "$getservbyport_r_proto" in
13744 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
13745 ./protochk "extern $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
13747 case "$getservbyport_r_proto" in
13748 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
13749 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
13751 case "$getservbyport_r_proto" in
13752 ''|0) d_getservbyport_r=undef
13753 getservbyport_r_proto=0
13754 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
13755 * ) case "$getservbyport_r_proto" in
13756 REENTRANT_PROTO*) ;;
13757 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
13759 echo "Prototype: $try" ;;
13762 *) case "$usethreads" in
13763 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
13765 d_getservbyport_r=undef
13766 getservbyport_r_proto=0
13770 *) getservbyport_r_proto=0
13774 : see if getservent_r exists
13775 set getservent_r d_getservent_r
13777 case "$d_getservent_r" in
13779 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13780 case "$d_getservent_r_proto:$usethreads" in
13781 ":define") d_getservent_r_proto=define
13782 set d_getservent_r_proto getservent_r $hdrs
13786 case "$d_getservent_r_proto" in
13788 case "$getservent_r_proto" in
13789 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
13790 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBWR ;;
13792 case "$getservent_r_proto" in
13793 ''|0) try='int getservent_r(struct servent*, char*, int);'
13794 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBI ;;
13796 case "$getservent_r_proto" in
13797 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
13798 ./protochk "extern $try" $hdrs && getservent_r_proto=S_SBI ;;
13800 case "$getservent_r_proto" in
13801 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
13802 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SD ;;
13804 case "$getservent_r_proto" in
13805 ''|0) d_getservent_r=undef
13806 getservent_r_proto=0
13807 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
13808 * ) case "$getservent_r_proto" in
13809 REENTRANT_PROTO*) ;;
13810 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
13812 echo "Prototype: $try" ;;
13815 *) case "$usethreads" in
13816 define) echo "getservent_r has no prototype, not using it." >&4 ;;
13818 d_getservent_r=undef
13819 getservent_r_proto=0
13823 *) getservent_r_proto=0
13827 : see if prototypes for various getservxxx netdb.h functions are available
13829 set d_getservprotos getservent $i_netdb netdb.h
13832 : see if getspnam exists
13833 set getspnam d_getspnam
13836 : see if this is a shadow.h system
13837 set shadow.h i_shadow
13840 : see if getspnam_r exists
13841 set getspnam_r d_getspnam_r
13843 case "$d_getspnam_r" in
13845 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
13846 case "$d_getspnam_r_proto:$usethreads" in
13847 ":define") d_getspnam_r_proto=define
13848 set d_getspnam_r_proto getspnam_r $hdrs
13852 case "$d_getspnam_r_proto" in
13854 case "$getspnam_r_proto" in
13855 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
13856 ./protochk "extern $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
13858 case "$getspnam_r_proto" in
13859 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
13860 ./protochk "extern $try" $hdrs && getspnam_r_proto=S_CSBI ;;
13862 case "$getspnam_r_proto" in
13863 ''|0) d_getspnam_r=undef
13865 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
13866 * ) case "$getspnam_r_proto" in
13867 REENTRANT_PROTO*) ;;
13868 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
13870 echo "Prototype: $try" ;;
13873 *) case "$usethreads" in
13874 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
13881 *) getspnam_r_proto=0
13885 : see if gettimeofday or ftime exists
13886 set gettimeofday d_gettimeod
13888 case "$d_gettimeod" in
13894 val="$undef"; set d_ftime; eval $setvar
13897 case "$d_gettimeod$d_ftime" in
13900 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
13904 : see if gmtime_r exists
13905 set gmtime_r d_gmtime_r
13907 case "$d_gmtime_r" in
13909 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
13910 case "$d_gmtime_r_proto:$usethreads" in
13911 ":define") d_gmtime_r_proto=define
13912 set d_gmtime_r_proto gmtime_r $hdrs
13916 case "$d_gmtime_r_proto" in
13918 case "$gmtime_r_proto" in
13919 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
13920 ./protochk "extern $try" $hdrs && gmtime_r_proto=S_TS ;;
13922 case "$gmtime_r_proto" in
13923 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
13924 ./protochk "extern $try" $hdrs && gmtime_r_proto=I_TS ;;
13926 case "$gmtime_r_proto" in
13927 ''|0) d_gmtime_r=undef
13929 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
13930 * ) case "$gmtime_r_proto" in
13931 REENTRANT_PROTO*) ;;
13932 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
13934 echo "Prototype: $try" ;;
13937 *) case "$usethreads" in
13938 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
13945 *) gmtime_r_proto=0
13949 : see if hasmntopt exists
13950 set hasmntopt d_hasmntopt
13953 : see if this is a netinet/in.h or sys/in.h system
13954 set netinet/in.h i_niin sys/in.h i_sysin
13957 : see if arpa/inet.h has to be included
13958 set arpa/inet.h i_arpainet
13961 : see if htonl --and friends-- exists
13966 : Maybe they are macros.
13969 $cat >htonl.c <<EOM
13971 #include <sys/types.h>
13972 #$i_niin I_NETINET_IN
13974 #$i_arpainet I_ARPA_INET
13975 #ifdef I_NETINET_IN
13976 #include <netinet/in.h>
13979 #include <sys/in.h>
13982 #include <arpa/inet.h>
13985 printf("Defined as a macro.");
13988 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
13989 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
13991 echo "But it seems to be defined as a macro." >&4
13999 : see if ilogbl exists
14000 set ilogbl d_ilogbl
14005 if set index val -f; eval $csym; $val; then
14006 if set strchr val -f d_strchr; eval $csym; $val; then
14007 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14010 echo "strchr() found." >&4
14014 echo "index() found." >&4
14019 echo "index() found." >&4
14022 if set strchr val -f d_strchr; eval $csym; $val; then
14025 echo "strchr() found." >&4
14027 echo "No index() or strchr() found!" >&4
14032 set d_strchr; eval $setvar
14034 set d_index; eval $setvar
14036 : check whether inet_aton exists
14037 set inet_aton d_inetaton
14042 $cat >isascii.c <<EOCP
14045 #$i_stdlib I_STDLIB
14047 #include <stdlib.h>
14058 if eval $compile; then
14059 echo "isascii() found." >&4
14062 echo "isascii() NOT found." >&4
14069 : see if isfinite exists
14070 set isfinite d_isfinite
14073 : see if isinf exists
14077 : see if isnan exists
14081 : see if isnanl exists
14082 set isnanl d_isnanl
14085 : see if killpg exists
14086 set killpg d_killpg
14089 : see if lchown exists
14091 $cat > try.c <<'EOCP'
14092 /* System header to define __stub macros and hopefully few prototypes,
14093 which can conflict with char lchown(); below. */
14094 #include <assert.h>
14095 /* Override any gcc2 internal prototype to avoid an error. */
14096 /* We use char because int might match the return type of a gcc2
14097 builtin and then its argument prototype would still apply. */
14100 /* The GNU C library defines this for functions which it implements
14101 to always fail with ENOSYS. Some functions are actually named
14102 something starting with __ and the normal name is an alias. */
14103 #if defined (__stub_lchown) || defined (__stub___lchown)
14111 if eval $compile; then
14112 $echo "lchown() found." >&4
14115 $echo "lchown() NOT found." >&4
14121 : See if number of significant digits in a double precision number is known
14123 $cat >ldbl_dig.c <<EOM
14124 #$i_limits I_LIMITS
14127 #include <limits.h>
14133 printf("Contains LDBL_DIG");
14136 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
14137 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
14138 echo "LDBL_DIG found." >&4
14141 echo "LDBL_DIG NOT found." >&4
14148 : see if this is a math.h system
14152 d_libm_lib_version="$undef"
14155 : check to see if math.h defines _LIB_VERSION
14157 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
14159 #include <unistd.h>
14161 int main (int argc, char *argv[])
14163 printf ("%d\n", _LIB_VERSION);
14168 if eval $compile; then
14170 echo "Yes, it does ($foo)" >&4
14171 d_libm_lib_version="$define"
14173 echo "No, it does not (probably harmless)\n" >&4
14175 $rm -f try.* try core core.try.*
14180 : see if link exists
14184 : see if localtime_r exists
14185 set localtime_r d_localtime_r
14187 case "$d_localtime_r" in
14189 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14190 case "$d_localtime_r_proto:$usethreads" in
14191 ":define") d_localtime_r_proto=define
14192 set d_localtime_r_proto localtime_r $hdrs
14196 case "$d_localtime_r_proto" in
14198 case "$localtime_r_proto" in
14199 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
14200 ./protochk "extern $try" $hdrs && localtime_r_proto=S_TS ;;
14202 case "$localtime_r_proto" in
14203 ''|0) try='int localtime_r(const time_t*, struct tm*);'
14204 ./protochk "extern $try" $hdrs && localtime_r_proto=I_TS ;;
14206 case "$localtime_r_proto" in
14207 ''|0) d_localtime_r=undef
14208 localtime_r_proto=0
14209 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
14210 * ) case "$localtime_r_proto" in
14211 REENTRANT_PROTO*) ;;
14212 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
14214 echo "Prototype: $try" ;;
14217 *) case "$usethreads" in
14218 define) echo "localtime_r has no prototype, not using it." >&4 ;;
14220 d_localtime_r=undef
14221 localtime_r_proto=0
14225 *) localtime_r_proto=0
14229 : see if localeconv exists
14230 set localeconv d_locconv
14233 : see if lockf exists
14237 : see if prototype for lseek is available
14239 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
14242 : see if lstat exists
14246 : see if madvise exists
14247 set madvise d_madvise
14250 : see if mblen exists
14254 : see if mbstowcs exists
14255 set mbstowcs d_mbstowcs
14258 : see if mbtowc exists
14259 set mbtowc d_mbtowc
14262 : see if memchr exists
14263 set memchr d_memchr
14266 : see if memcmp exists
14267 set memcmp d_memcmp
14270 : see if memcpy exists
14271 set memcpy d_memcpy
14274 : see if memmove exists
14275 set memmove d_memmove
14278 : see if memset exists
14279 set memset d_memset
14282 : see if mkdir exists
14286 : see if mkdtemp exists
14287 set mkdtemp d_mkdtemp
14290 : see if mkfifo exists
14291 set mkfifo d_mkfifo
14294 : see if mkstemp exists
14295 set mkstemp d_mkstemp
14298 : see if mkstemps exists
14299 set mkstemps d_mkstemps
14302 : see if mktime exists
14303 set mktime d_mktime
14306 : see if this is a sys/mman.h system
14307 set sys/mman.h i_sysmman
14310 : see if mmap exists
14313 : see what shmat returns
14314 : default to something harmless
14316 case "$i_sysmman$d_mmap" in
14318 $cat >mmap.c <<'END'
14319 #include <sys/mman.h>
14322 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
14327 echo "and it returns ($mmaptype)." >&4
14333 : see if sqrtl exists
14337 : see if scalbnl exists
14338 set scalbnl d_scalbnl
14341 : see if modfl exists
14345 : see if prototype for modfl is available
14347 set d_modflproto modfl $i_math math.h
14350 d_modfl_pow32_bug="$undef"
14352 case "$d_longdbl$d_modfl" in
14355 Checking to see whether your modfl() is okay for large values...
14361 if $test "X$d_modflproto" != "X$define"; then
14362 $cat >>try.c <<EOCP
14363 /* Sigh. many current glibcs provide the function, but do not prototype it. */
14364 long double modfl (long double, long double *);
14367 $cat >>try.c <<EOCP
14369 long double nv = 4294967303.15;
14375 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
14379 case "$osname:$gccversion" in
14380 aix:) saveccflags="$ccflags"
14381 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
14384 if eval $compile; then
14387 *" 4294967303.150000 1.150000 4294967302.000000")
14388 echo >&4 "Your modfl() is broken for large values."
14389 d_modfl_pow32_bug="$define"
14391 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
14395 *" 4294967303.150000 0.150000 4294967303.000000")
14396 echo >&4 "Your modfl() seems okay for large values."
14398 *) echo >&4 "I don't understand your modfl() at all."
14402 $rm -f try.* try core core.try.*
14404 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
14407 case "$osname:$gccversion" in
14408 aix:) ccflags="$saveccflags" ;; # restore
14413 if $test "$uselongdouble" = "$define"; then
14415 if $test "$d_sqrtl" != "$define"; then
14416 message="$message sqrtl"
14418 if $test "$d_modfl" != "$define"; then
14419 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
14420 echo "You have both aintl and copysignl, so I can emulate modfl."
14422 message="$message modfl"
14425 if $test "$d_frexpl" != "$define"; then
14426 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
14427 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
14429 message="$message frexpl"
14433 if $test "$message" != ""; then
14436 *** You requested the use of long doubles but you do not seem to have
14437 *** the following mathematical functions needed for long double support:
14439 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
14440 *** Cannot continue, aborting.
14448 : see if mprotect exists
14449 set mprotect d_mprotect
14452 : see if msgctl exists
14453 set msgctl d_msgctl
14456 : see if msgget exists
14457 set msgget d_msgget
14460 : see if msgsnd exists
14461 set msgsnd d_msgsnd
14464 : see if msgrcv exists
14465 set msgrcv d_msgrcv
14468 : see how much of the 'msg*(2)' library is present.
14471 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
14472 *"$undef"*) h_msg=false;;
14476 case "`ipcs 2>&1`" in
14477 "SVID messages"*"not configured"*)
14478 echo "Your $osname does not have the msg*(2) configured." >&4
14481 set msgctl d_msgctl
14483 set msgget d_msgget
14485 set msgsnd d_msgsnd
14487 set msgrcv d_msgrcv
14493 : we could also check for sys/ipc.h ...
14494 if $h_msg && $test `./findhdr sys/msg.h`; then
14495 echo "You have the full msg*(2) library." >&4
14498 echo "You don't have the full msg*(2) library." >&4
14506 echo "Checking to see if your system supports struct msghdr..." >&4
14507 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
14509 case "$d_msghdr_s" in
14510 "$define") echo "Yes, it does." ;;
14511 *) echo "No, it doesn't." ;;
14515 : see if msync exists
14519 : see if munmap exists
14520 set munmap d_munmap
14523 : see if nice exists
14527 : see if this is a langinfo.h system
14528 set langinfo.h i_langinfo
14531 : see if nl_langinfo exists
14532 set nl_langinfo d_nl_langinfo
14535 : check for length of character
14537 case "$charsize" in
14539 echo "Checking to see how big your characters are (hey, you never know)..." >&4
14542 #$i_stdlib I_STDLIB
14544 #include <stdlib.h>
14548 printf("%d\n", (int)sizeof(char));
14553 if eval $compile_ok; then
14557 echo "(I can't seem to compile the test program. Guessing...)"
14564 rp="What is the size of a character (in bytes)?"
14569 : check for volatile keyword
14571 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
14572 $cat >try.c <<'EOCP'
14575 typedef struct _goo_struct goo_struct;
14576 goo_struct * volatile goo = ((goo_struct *)0);
14577 struct _goo_struct {
14582 typedef unsigned short foo_t;
14583 char *volatile foo;
14585 volatile foo_t blech;
14589 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
14591 echo "Yup, it does."
14594 echo "Nope, it doesn't."
14602 $echo "Choosing the C types to be used for Perl's internal types..." >&4
14604 case "$use64bitint:$d_quad:$quadtype" in
14607 uvtype="$uquadtype"
14612 uvtype="unsigned long"
14618 case "$uselongdouble:$d_longdbl" in
14620 nvtype="long double"
14621 nvsize=$longdblsize
14628 $echo "(IV will be "$ivtype", $ivsize bytes)"
14629 $echo "(UV will be "$uvtype", $uvsize bytes)"
14630 $echo "(NV will be "$nvtype", $nvsize bytes)"
14633 #$i_inttypes I_INTTYPES
14635 #include <inttypes.h>
14640 int8_t i = INT8_MAX;
14641 uint8_t u = UINT8_MAX;
14642 printf("int8_t\n");
14645 int16_t i = INT16_MAX;
14646 uint16_t i = UINT16_MAX;
14647 printf("int16_t\n");
14650 int32_t i = INT32_MAX;
14651 uint32_t u = UINT32_MAX;
14652 printf("int32_t\n");
14658 '') case "$charsize" in
14660 u8type="unsigned char"
14669 if eval $compile; then
14670 case "`$run ./try`" in
14671 int8_t) i8type=int8_t
14681 '') if $test $charsize -ge 1; then
14683 u8type="unsigned char"
14691 '') case "$shortsize" in
14693 u16type="unsigned short"
14701 '') set try -DINT16
14702 if eval $compile; then
14703 case "`$run ./try`" in
14715 '') if $test $shortsize -ge 2; then
14717 u16type="unsigned short"
14725 '') case "$longsize" in
14727 u32type="unsigned long"
14731 *) case "$intsize" in
14733 u32type="unsigned int"
14743 '') set try -DINT32
14744 if eval $compile; then
14745 case "`$run ./try`" in
14757 '') if $test $intsize -ge 4; then
14759 u32type="unsigned int"
14767 '') case "$d_quad:$quadtype" in
14769 i64type="$quadtype"
14770 u64type="$uquadtype"
14778 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
14779 : volatile so that the compiler has to store it out to memory.
14780 if test X"$d_volatile" = X"$define"; then
14785 #$i_stdlib I_STDLIB
14787 #include <stdlib.h>
14789 #include <sys/types.h>
14790 #include <signal.h>
14792 $volatile int bletched = 0;
14793 $signal_t blech(s) int s; { bletched = 1; }
14798 int n = 8 * $uvsize;
14801 signal(SIGFPE, blech);
14804 for (i = 0; i < n; i++) {
14805 u = u << 1 | ($uvtype)1;
14807 if (($uvtype)d != u)
14811 d = ($nvtype)(u - 1);
14812 if (($uvtype)d != (u - 1))
14820 printf("%d\n", ((i == n) ? -n : i));
14826 d_nv_preserves_uv="$undef"
14827 if eval $compile; then
14828 nv_preserves_uv_bits="`$run ./try`"
14830 case "$nv_preserves_uv_bits" in
14832 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
14833 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
14834 d_nv_preserves_uv="$define"
14836 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
14837 d_nv_preserves_uv="$undef" ;;
14838 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
14839 nv_preserves_uv_bits="$undef" ;;
14844 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
14845 : volatile so that the compiler has to store it out to memory.
14846 if test X"$d_volatile" = X"$define"; then
14851 #$i_stdlib I_STDLIB
14853 #include <stdlib.h>
14855 #$i_string I_STRING
14857 # include <string.h>
14859 # include <strings.h>
14861 #include <sys/types.h>
14862 #include <signal.h>
14864 $volatile int bletched = 0;
14865 $signal_t blech(s) int s; { bletched = 1; }
14868 int checkit($nvtype d, char *where) {
14869 unsigned char *p = (char *)&d;
14870 unsigned char *end = p + sizeof(d);
14880 printf("No - %s: 0x", where);
14882 printf ("%02X", *p++);
14887 int main(int argc, char **argv) {
14890 fail += checkit(d, "0.0");
14892 /* The compiler shouldn't be assuming that bletched is 0 */
14895 fail += checkit(d, "bleched");
14898 signal(SIGFPE, blech);
14901 /* Paranoia - the compiler should have no way of knowing that ANSI says
14902 that argv[argc] will always be NULL. Actually, if it did assume this it
14903 would be buggy, as this is C and main() can be called from elsewhere in
14905 d = argv[argc] ? 1 : 0;
14908 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
14911 fail += checkit(d, "ternary");
14913 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
14916 printf("No - memset doesn't give 0.0\n");
14917 /* This might just blow up: */
14918 printf("(gives %g)\n", d);
14924 printf("No - something bleched\n");
14929 printf("No - %d fail(s)\n", fail);
14938 d_nv_zero_is_allbits_zero="$undef"
14939 if eval $compile; then
14945 0.0 is represented as all bits zero in memory
14947 d_nv_zero_is_allbits_zero="$define"
14950 0.0 is not represented as all bits zero in memory
14952 d_nv_zero_is_allbits_zero="$undef"
14957 0.0 is not represented as all bits zero in memory
14959 d_nv_zero_is_allbits_zero="$undef"
14967 : check for off64_t
14969 echo "Checking to see if you have off64_t..." >&4
14971 #include <sys/types.h>
14972 #include <unistd.h>
14973 int main() { off64_t x = 7; }
14976 if eval $compile; then
14978 echo "You have off64_t."
14981 echo "You do not have off64_t."
14982 case "$lseeksize" in
14983 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
14990 : how to create joinable pthreads
14991 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
14993 echo "Checking what constant to use for creating joinable pthreads..." >&4
14994 $cat >try.c <<'EOCP'
14995 #include <pthread.h>
14997 int detachstate = JOINABLE;
15000 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
15001 if eval $compile; then
15002 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
15003 val="$undef" # Yes, undef.
15004 set d_old_pthread_create_joinable
15007 set old_pthread_create_joinable
15010 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
15011 if eval $compile; then
15012 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
15014 set d_old_pthread_create_joinable
15016 val=PTHREAD_CREATE_UNDETACHED
15017 set old_pthread_create_joinable
15020 set try -DJOINABLE=__UNDETACHED
15021 if eval $compile; then
15022 echo "You seem to use __UNDETACHED." >&4
15024 set d_old_pthread_create_joinable
15027 set old_pthread_create_joinable
15030 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
15032 set d_old_pthread_create_joinable
15035 set old_pthread_create_joinable
15042 d_old_pthread_create_joinable="$undef"
15043 old_pthread_create_joinable=""
15046 : see if pause exists
15050 : see if pipe exists
15054 : see if poll exists
15058 : see if readlink exists
15059 set readlink d_readlink
15065 case "$d_readlink" in
15067 if $issymlink /proc/self/exe ; then
15068 $ls -l /proc/self/exe > reflect
15069 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15070 echo "You have Linux-like /proc/self/exe."
15071 procselfexe='"/proc/self/exe"'
15075 if $issymlink /proc/curproc/file ; then
15076 $ls -l /proc/curproc/file > reflect
15077 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15078 echo "You have BSD-like /proc/curproc/file."
15079 procselfexe='"/proc/curproc/file"'
15089 : see whether the pthread_atfork exists
15091 #include <pthread.h>
15094 #ifdef PTHREAD_ATFORK
15095 pthread_atfork(NULL,NULL,NULL);
15100 : see if pthread_atfork exists
15101 set try -DPTHREAD_ATFORK
15102 if eval $compile; then
15107 case "$usethreads" in
15110 $define) echo 'pthread_atfork found.' >&4 ;;
15111 *) echo 'pthread_atfork NOT found.' >&4 ;;
15114 set d_pthread_atfork
15117 : see if pthread_attr_setscope exists
15118 set pthread_attr_setscope d_pthread_attr_setscope
15122 : see whether the various POSIXish _yields exist
15124 #include <pthread.h>
15130 #ifdef PTHREAD_YIELD
15133 #ifdef PTHREAD_YIELD_NULL
15134 pthread_yield(NULL);
15140 : see if sched_yield exists
15141 set try -DSCHED_YIELD
15142 if eval $compile; then
15144 sched_yield='sched_yield()'
15148 case "$usethreads" in
15151 $define) echo 'sched_yield() found.' >&4 ;;
15152 *) echo 'sched_yield() NOT found.' >&4 ;;
15158 : see if pthread_yield exists
15159 set try -DPTHREAD_YIELD
15160 if eval $compile; then
15162 case "$sched_yield" in
15163 '') sched_yield='pthread_yield()' ;;
15166 set try -DPTHREAD_YIELD_NULL
15167 if eval $compile; then
15169 case "$sched_yield" in
15170 '') sched_yield='pthread_yield(NULL)' ;;
15176 case "$usethreads" in
15179 $define) echo 'pthread_yield() found.' >&4 ;;
15180 *) echo 'pthread_yield() NOT found.' >&4 ;;
15184 set d_pthread_yield
15187 case "$sched_yield" in
15188 '') sched_yield=undef ;;
15193 : see if random_r exists
15194 set random_r d_random_r
15196 case "$d_random_r" in
15198 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
15199 case "$d_random_r_proto:$usethreads" in
15200 ":define") d_random_r_proto=define
15201 set d_random_r_proto random_r $hdrs
15205 case "$d_random_r_proto" in
15207 case "$random_r_proto" in
15208 ''|0) try='int random_r(int*, struct random_data*);'
15209 ./protochk "extern $try" $hdrs && random_r_proto=I_iS ;;
15211 case "$random_r_proto" in
15212 ''|0) try='int random_r(long*, struct random_data*);'
15213 ./protochk "extern $try" $hdrs && random_r_proto=I_lS ;;
15215 case "$random_r_proto" in
15216 ''|0) try='int random_r(struct random_data*, int32_t*);'
15217 ./protochk "extern $try" $hdrs && random_r_proto=I_St ;;
15219 case "$random_r_proto" in
15220 ''|0) d_random_r=undef
15222 echo "Disabling random_r, cannot determine prototype." >&4 ;;
15223 * ) case "$random_r_proto" in
15224 REENTRANT_PROTO*) ;;
15225 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
15227 echo "Prototype: $try" ;;
15230 *) case "$usethreads" in
15231 define) echo "random_r has no prototype, not using it." >&4 ;;
15238 *) random_r_proto=0
15242 : see if readdir and friends exist
15243 set readdir d_readdir
15245 set seekdir d_seekdir
15247 set telldir d_telldir
15249 set rewinddir d_rewinddir
15252 : see if readdir64_r exists
15253 set readdir64_r d_readdir64_r
15255 case "$d_readdir64_r" in
15257 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15258 case "$d_readdir64_r_proto:$usethreads" in
15259 ":define") d_readdir64_r_proto=define
15260 set d_readdir64_r_proto readdir64_r $hdrs
15264 case "$d_readdir64_r_proto" in
15266 case "$readdir64_r_proto" in
15267 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
15268 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TSR ;;
15270 case "$readdir64_r_proto" in
15271 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
15272 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TS ;;
15274 case "$readdir64_r_proto" in
15275 ''|0) d_readdir64_r=undef
15276 readdir64_r_proto=0
15277 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
15278 * ) case "$readdir64_r_proto" in
15279 REENTRANT_PROTO*) ;;
15280 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
15282 echo "Prototype: $try" ;;
15285 *) case "$usethreads" in
15286 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
15288 d_readdir64_r=undef
15289 readdir64_r_proto=0
15293 *) readdir64_r_proto=0
15297 : see if readdir_r exists
15298 set readdir_r d_readdir_r
15300 case "$d_readdir_r" in
15302 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15303 case "$d_readdir_r_proto:$usethreads" in
15304 ":define") d_readdir_r_proto=define
15305 set d_readdir_r_proto readdir_r $hdrs
15309 case "$d_readdir_r_proto" in
15311 case "$readdir_r_proto" in
15312 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
15313 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TSR ;;
15315 case "$readdir_r_proto" in
15316 ''|0) try='int readdir_r(DIR*, struct dirent*);'
15317 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TS ;;
15319 case "$readdir_r_proto" in
15320 ''|0) d_readdir_r=undef
15322 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
15323 * ) case "$readdir_r_proto" in
15324 REENTRANT_PROTO*) ;;
15325 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
15327 echo "Prototype: $try" ;;
15330 *) case "$usethreads" in
15331 define) echo "readdir_r has no prototype, not using it." >&4 ;;
15338 *) readdir_r_proto=0
15342 : see if readv exists
15346 : see if recvmsg exists
15347 set recvmsg d_recvmsg
15350 : see if rename exists
15351 set rename d_rename
15354 : see if rmdir exists
15358 : see if memory.h is available.
15363 : See if it conflicts with string.h
15369 $cppstdin $cppflags $cppminus < $strings > mem.h
15370 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
15372 echo "We won't be including <memory.h>."
15382 : can bcopy handle overlapping blocks?
15385 case "$d_memmove" in
15386 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
15387 *) case "$d_bcopy" in
15389 echo "Checking to see if bcopy() can do overlapping copies..." >&4
15391 #$i_memory I_MEMORY
15392 #$i_stdlib I_STDLIB
15393 #$i_string I_STRING
15394 #$i_unistd I_UNISTD
15396 $cat >>try.c <<'EOCP'
15399 # include <memory.h>
15402 # include <stdlib.h>
15405 # include <string.h>
15407 # include <strings.h>
15410 # include <unistd.h> /* Needed for NetBSD */
15414 char buf[128], abc[128];
15420 /* Copy "abcde..." string to char abc[] so that gcc doesn't
15421 try to store the string in read-only memory. */
15422 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
15424 for (align = 7; align >= 0; align--) {
15425 for (len = 36; len; len--) {
15427 bcopy(abc, b, len);
15428 for (off = 1; off <= len; off++) {
15429 bcopy(b, b+off, len);
15430 bcopy(b+off, b, len);
15431 if (bcmp(b, abc, len))
15440 if eval $compile_ok; then
15441 if ./try 2>/dev/null; then
15442 echo "Yes, it can."
15445 echo "It can't, sorry."
15448 echo "(I can't compile the test program, so we'll assume not...)"
15452 $rm -f try.* try core
15458 : can memcpy handle overlapping blocks?
15461 case "$d_memmove" in
15462 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
15463 *) case "$d_memcpy" in
15465 echo "Checking to see if memcpy() can do overlapping copies..." >&4
15467 #$i_memory I_MEMORY
15468 #$i_stdlib I_STDLIB
15469 #$i_string I_STRING
15470 #$i_unistd I_UNISTD
15472 $cat >>try.c <<'EOCP'
15475 # include <memory.h>
15478 # include <stdlib.h>
15481 # include <string.h>
15483 # include <strings.h>
15486 # include <unistd.h> /* Needed for NetBSD */
15490 char buf[128], abc[128];
15496 /* Copy "abcde..." string to char abc[] so that gcc doesn't
15497 try to store the string in read-only memory. */
15498 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
15500 for (align = 7; align >= 0; align--) {
15501 for (len = 36; len; len--) {
15503 memcpy(b, abc, len);
15504 for (off = 1; off <= len; off++) {
15505 memcpy(b+off, b, len);
15506 memcpy(b, b+off, len);
15507 if (memcmp(b, abc, len))
15516 if eval $compile_ok; then
15517 if ./try 2>/dev/null; then
15518 echo "Yes, it can."
15521 echo "It can't, sorry."
15524 echo "(I can't compile the test program, so we'll assume not...)"
15528 $rm -f try.* try core
15534 : can memcmp be trusted to compare relative magnitude?
15536 case "$d_memcmp" in
15539 echo "Checking if your memcmp() can compare relative magnitude..." >&4
15541 #$i_memory I_MEMORY
15542 #$i_stdlib I_STDLIB
15543 #$i_string I_STRING
15544 #$i_unistd I_UNISTD
15546 $cat >>try.c <<'EOCP'
15549 # include <memory.h>
15552 # include <stdlib.h>
15555 # include <string.h>
15557 # include <strings.h>
15560 # include <unistd.h> /* Needed for NetBSD */
15566 if ((a < b) && memcmp(&a, &b, 1) < 0)
15572 if eval $compile_ok; then
15573 if $run ./try 2>/dev/null; then
15574 echo "Yes, it can."
15577 echo "No, it can't (it uses signed chars)."
15580 echo "(I can't compile the test program, so we'll assume not...)"
15584 $rm -f try.* try core
15588 : see if prototype for sbrk is available
15590 set d_sbrkproto sbrk $i_unistd unistd.h
15593 : see if select exists
15594 set select d_select
15597 : see if semctl exists
15598 set semctl d_semctl
15601 : see if semget exists
15602 set semget d_semget
15605 : see if semop exists
15609 : see how much of the 'sem*(2)' library is present.
15612 case "$d_semctl$d_semget$d_semop" in
15613 *"$undef"*) h_sem=false;;
15617 case "`ipcs 2>&1`" in
15618 "SVID messages"*"not configured"*)
15619 echo "Your $osname does not have the sem*(2) configured." >&4
15622 set semctl d_semctl
15624 set semget d_semget
15632 : we could also check for sys/ipc.h ...
15633 if $h_sem && $test `./findhdr sys/sem.h`; then
15634 echo "You have the full sem*(2) library." >&4
15637 echo "You don't have the full sem*(2) library." >&4
15643 : see whether sys/sem.h defines union semun
15645 $cat > try.c <<'END'
15646 #include <sys/types.h>
15647 #include <sys/ipc.h>
15648 #include <sys/sem.h>
15649 int main () { union semun semun; semun.buf = 0; }
15652 if eval $compile; then
15653 echo "You have union semun in <sys/sem.h>." >&4
15656 echo "You do not have union semun in <sys/sem.h>." >&4
15663 : see how to do semctl IPC_STAT
15670 # define S_IRUSR S_IREAD
15671 # define S_IWUSR S_IWRITE
15672 # define S_IXUSR S_IEXEC
15674 # define S_IRUSR 0400
15675 # define S_IWUSR 0200
15676 # define S_IXUSR 0100
15678 # define S_IRGRP (S_IRUSR>>3)
15679 # define S_IWGRP (S_IWUSR>>3)
15680 # define S_IXGRP (S_IXUSR>>3)
15681 # define S_IROTH (S_IRUSR>>6)
15682 # define S_IWOTH (S_IWUSR>>6)
15683 # define S_IXOTH (S_IXUSR>>6)
15686 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
15687 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
15688 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
15691 : see whether semctl IPC_STAT can use union semun
15693 case "$d_semctl_semun" in
15696 #include <sys/types.h>
15697 #include <sys/ipc.h>
15698 #include <sys/sem.h>
15699 #include <sys/stat.h>
15706 #$d_union_semun HAS_UNION_SEMUN
15709 #ifndef HAS_UNION_SEMUN
15712 struct semid_ds *buf;
15713 unsigned short *array;
15719 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
15720 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
15722 struct semid_ds argbuf;
15725 st = semctl(sem, 0, IPC_STAT, arg);
15729 # endif /* IPC_STAT */
15730 printf("semctl IPC_STAT failed: errno = %d\n", errno);
15732 if (semctl(sem, 0, IPC_RMID, arg) != 0)
15733 # endif /* IPC_RMID */
15734 printf("semctl IPC_RMID failed: errno = %d\n", errno);
15736 #endif /* IPC_PRIVATE && ... */
15737 printf("semget failed: errno = %d\n", errno);
15742 if eval $compile; then
15745 semun) val="$define" ;;
15753 case "$d_semctl_semun" in
15755 echo "You can use union semun for semctl IPC_STAT." >&4
15758 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
15763 : see whether semctl IPC_STAT can use struct semid_ds pointer
15765 case "$d_semctl_semid_ds" in
15767 $cat > try.c <<'END'
15768 #include <sys/types.h>
15769 #include <sys/ipc.h>
15770 #include <sys/sem.h>
15771 #include <sys/stat.h>
15779 struct semid_ds arg;
15782 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
15783 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
15786 st = semctl(sem, 0, IPC_STAT, &arg);
15788 printf("semid_ds\n");
15790 # endif /* IPC_STAT */
15791 printf("semctl IPC_STAT failed: errno = %d\n", errno);
15793 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
15794 # endif /* IPC_RMID */
15795 printf("semctl IPC_RMID failed: errno = %d\n", errno);
15797 #endif /* IPC_PRIVATE && ... */
15798 printf("semget failed: errno = %d\n", errno);
15804 if eval $compile; then
15807 semid_ds) val="$define" ;;
15813 set d_semctl_semid_ds
15815 case "$d_semctl_semid_ds" in
15817 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
15819 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
15826 # We do not have the full sem*(2) library, so assume we can not
15832 set d_semctl_semid_ds
15837 : see if sendmsg exists
15838 set sendmsg d_sendmsg
15841 : see if setegid exists
15842 set setegid d_setegid
15845 : see if seteuid exists
15846 set seteuid d_seteuid
15849 : see if setgrent exists
15850 set setgrent d_setgrent
15853 : see if setgrent_r exists
15854 set setgrent_r d_setgrent_r
15856 case "$d_setgrent_r" in
15858 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
15859 case "$d_setgrent_r_proto:$usethreads" in
15860 ":define") d_setgrent_r_proto=define
15861 set d_setgrent_r_proto setgrent_r $hdrs
15865 case "$d_setgrent_r_proto" in
15867 case "$setgrent_r_proto" in
15868 ''|0) try='int setgrent_r(FILE**);'
15869 ./protochk "extern $try" $hdrs && setgrent_r_proto=I_H ;;
15871 case "$setgrent_r_proto" in
15872 ''|0) try='void setgrent_r(FILE**);'
15873 ./protochk "extern $try" $hdrs && setgrent_r_proto=V_H ;;
15875 case "$setgrent_r_proto" in
15876 ''|0) d_setgrent_r=undef
15878 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
15879 * ) case "$setgrent_r_proto" in
15880 REENTRANT_PROTO*) ;;
15881 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
15883 echo "Prototype: $try" ;;
15886 *) case "$usethreads" in
15887 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
15894 *) setgrent_r_proto=0
15898 : see if sethostent exists
15899 set sethostent d_sethent
15902 : see if sethostent_r exists
15903 set sethostent_r d_sethostent_r
15905 case "$d_sethostent_r" in
15907 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15908 case "$d_sethostent_r_proto:$usethreads" in
15909 ":define") d_sethostent_r_proto=define
15910 set d_sethostent_r_proto sethostent_r $hdrs
15914 case "$d_sethostent_r_proto" in
15916 case "$sethostent_r_proto" in
15917 ''|0) try='int sethostent_r(int, struct hostent_data*);'
15918 ./protochk "extern $try" $hdrs && sethostent_r_proto=I_ID ;;
15920 case "$sethostent_r_proto" in
15921 ''|0) try='void sethostent_r(int, struct hostent_data*);'
15922 ./protochk "extern $try" $hdrs && sethostent_r_proto=V_ID ;;
15924 case "$sethostent_r_proto" in
15925 ''|0) d_sethostent_r=undef
15926 sethostent_r_proto=0
15927 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
15928 * ) case "$sethostent_r_proto" in
15929 REENTRANT_PROTO*) ;;
15930 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
15932 echo "Prototype: $try" ;;
15935 *) case "$usethreads" in
15936 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
15938 d_sethostent_r=undef
15939 sethostent_r_proto=0
15943 *) sethostent_r_proto=0
15947 : see if setitimer exists
15948 set setitimer d_setitimer
15951 : see if setlinebuf exists
15952 set setlinebuf d_setlinebuf
15955 : see if setlocale exists
15956 set setlocale d_setlocale
15959 : see if locale.h is available
15960 set locale.h i_locale
15963 : see if setlocale_r exists
15964 set setlocale_r d_setlocale_r
15966 case "$d_setlocale_r" in
15968 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
15969 case "$d_setlocale_r_proto:$usethreads" in
15970 ":define") d_setlocale_r_proto=define
15971 set d_setlocale_r_proto setlocale_r $hdrs
15975 case "$d_setlocale_r_proto" in
15977 case "$setlocale_r_proto" in
15978 ''|0) try='int setlocale_r(int, const char*, char*, int);'
15979 ./protochk "extern $try" $hdrs && setlocale_r_proto=I_ICBI ;;
15981 case "$setlocale_r_proto" in
15982 ''|0) d_setlocale_r=undef
15983 setlocale_r_proto=0
15984 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
15985 * ) case "$setlocale_r_proto" in
15986 REENTRANT_PROTO*) ;;
15987 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
15989 echo "Prototype: $try" ;;
15992 *) case "$usethreads" in
15993 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
15995 d_setlocale_r=undef
15996 setlocale_r_proto=0
16000 *) setlocale_r_proto=0
16004 : see if setnetent exists
16005 set setnetent d_setnent
16008 : see if setnetent_r exists
16009 set setnetent_r d_setnetent_r
16011 case "$d_setnetent_r" in
16013 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16014 case "$d_setnetent_r_proto:$usethreads" in
16015 ":define") d_setnetent_r_proto=define
16016 set d_setnetent_r_proto setnetent_r $hdrs
16020 case "$d_setnetent_r_proto" in
16022 case "$setnetent_r_proto" in
16023 ''|0) try='int setnetent_r(int, struct netent_data*);'
16024 ./protochk "extern $try" $hdrs && setnetent_r_proto=I_ID ;;
16026 case "$setnetent_r_proto" in
16027 ''|0) try='void setnetent_r(int, struct netent_data*);'
16028 ./protochk "extern $try" $hdrs && setnetent_r_proto=V_ID ;;
16030 case "$setnetent_r_proto" in
16031 ''|0) d_setnetent_r=undef
16032 setnetent_r_proto=0
16033 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
16034 * ) case "$setnetent_r_proto" in
16035 REENTRANT_PROTO*) ;;
16036 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
16038 echo "Prototype: $try" ;;
16041 *) case "$usethreads" in
16042 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
16044 d_setnetent_r=undef
16045 setnetent_r_proto=0
16049 *) setnetent_r_proto=0
16053 : see if setprotoent exists
16054 set setprotoent d_setpent
16057 : see if setpgid exists
16058 set setpgid d_setpgid
16061 : see if setpgrp2 exists
16062 set setpgrp2 d_setpgrp2
16065 : see if setpriority exists
16066 set setpriority d_setprior
16069 : see if setproctitle exists
16070 set setproctitle d_setproctitle
16073 : see if setprotoent_r exists
16074 set setprotoent_r d_setprotoent_r
16076 case "$d_setprotoent_r" in
16078 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16079 case "$d_setprotoent_r_proto:$usethreads" in
16080 ":define") d_setprotoent_r_proto=define
16081 set d_setprotoent_r_proto setprotoent_r $hdrs
16085 case "$d_setprotoent_r_proto" in
16087 case "$setprotoent_r_proto" in
16088 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
16089 ./protochk "extern $try" $hdrs && setprotoent_r_proto=I_ID ;;
16091 case "$setprotoent_r_proto" in
16092 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
16093 ./protochk "extern $try" $hdrs && setprotoent_r_proto=V_ID ;;
16095 case "$setprotoent_r_proto" in
16096 ''|0) d_setprotoent_r=undef
16097 setprotoent_r_proto=0
16098 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
16099 * ) case "$setprotoent_r_proto" in
16100 REENTRANT_PROTO*) ;;
16101 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
16103 echo "Prototype: $try" ;;
16106 *) case "$usethreads" in
16107 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
16109 d_setprotoent_r=undef
16110 setprotoent_r_proto=0
16114 *) setprotoent_r_proto=0
16118 : see if setpwent exists
16119 set setpwent d_setpwent
16122 : see if setpwent_r exists
16123 set setpwent_r d_setpwent_r
16125 case "$d_setpwent_r" in
16127 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
16128 case "$d_setpwent_r_proto:$usethreads" in
16129 ":define") d_setpwent_r_proto=define
16130 set d_setpwent_r_proto setpwent_r $hdrs
16134 case "$d_setpwent_r_proto" in
16136 case "$setpwent_r_proto" in
16137 ''|0) try='int setpwent_r(FILE**);'
16138 ./protochk "extern $try" $hdrs && setpwent_r_proto=I_H ;;
16140 case "$setpwent_r_proto" in
16141 ''|0) try='void setpwent_r(FILE**);'
16142 ./protochk "extern $try" $hdrs && setpwent_r_proto=V_H ;;
16144 case "$setpwent_r_proto" in
16145 ''|0) d_setpwent_r=undef
16147 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
16148 * ) case "$setpwent_r_proto" in
16149 REENTRANT_PROTO*) ;;
16150 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
16152 echo "Prototype: $try" ;;
16155 *) case "$usethreads" in
16156 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
16163 *) setpwent_r_proto=0
16167 : see if setregid exists
16168 set setregid d_setregid
16170 set setresgid d_setresgid
16173 : see if setreuid exists
16174 set setreuid d_setreuid
16176 set setresuid d_setresuid
16179 : see if setrgid exists
16180 set setrgid d_setrgid
16183 : see if setruid exists
16184 set setruid d_setruid
16187 : see if setservent exists
16188 set setservent d_setsent
16191 : see if setservent_r exists
16192 set setservent_r d_setservent_r
16194 case "$d_setservent_r" in
16196 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16197 case "$d_setservent_r_proto:$usethreads" in
16198 ":define") d_setservent_r_proto=define
16199 set d_setservent_r_proto setservent_r $hdrs
16203 case "$d_setservent_r_proto" in
16205 case "$setservent_r_proto" in
16206 ''|0) try='int setservent_r(int, struct servent_data*);'
16207 ./protochk "extern $try" $hdrs && setservent_r_proto=I_ID ;;
16209 case "$setservent_r_proto" in
16210 ''|0) try='void setservent_r(int, struct servent_data*);'
16211 ./protochk "extern $try" $hdrs && setservent_r_proto=V_ID ;;
16213 case "$setservent_r_proto" in
16214 ''|0) d_setservent_r=undef
16215 setservent_r_proto=0
16216 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
16217 * ) case "$setservent_r_proto" in
16218 REENTRANT_PROTO*) ;;
16219 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
16221 echo "Prototype: $try" ;;
16224 *) case "$usethreads" in
16225 define) echo "setservent_r has no prototype, not using it." >&4 ;;
16227 d_setservent_r=undef
16228 setservent_r_proto=0
16232 *) setservent_r_proto=0
16236 : see if setsid exists
16237 set setsid d_setsid
16240 : see if setvbuf exists
16241 set setvbuf d_setvbuf
16244 : see if sfio.h is available
16249 : see if sfio library is available
16260 : Ok, but do we want to use it.
16264 true|$define|[yY]*) dflt='y';;
16267 echo "$package can use the sfio library, but it is experimental."
16268 case "$useperlio" in
16270 echo "For sfio also the PerlIO abstraction layer is needed."
16271 echo "Earlier you said you wouldn't want that."
16274 rp="You seem to have sfio available, do you want to try using it?"
16277 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
16278 useperlio="$define"
16281 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
16286 *) case "$usesfio" in
16287 true|$define|[yY]*)
16288 echo "Sorry, cannot find sfio on this machine." >&4
16289 echo "Ignoring your setting of usesfio=$usesfio." >&4
16298 $define) usesfio='true';;
16299 *) usesfio='false';;
16303 *) : Remove sfio from list of libraries to use
16306 echo "Removing unneeded -lsfio from library list" >&4
16307 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
16310 echo "libs = $libs" >&4
16317 : see if shmctl exists
16318 set shmctl d_shmctl
16321 : see if shmget exists
16322 set shmget d_shmget
16325 : see if shmat exists
16328 : see what shmat returns
16331 $cat >shmat.c <<'END'
16332 #include <sys/shm.h>
16335 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
16340 echo "and it returns ($shmattype)." >&4
16341 : see if a prototype for shmat is available
16342 xxx=`./findhdr sys/shm.h`
16343 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
16344 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
16355 set d_shmatprototype
16358 : see if shmdt exists
16362 : see how much of the 'shm*(2)' library is present.
16365 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
16366 *"$undef"*) h_shm=false;;
16370 case "`ipcs 2>&1`" in
16371 "SVID shared memory"*"not configured"*)
16372 echo "Your $osname does not have the shm*(2) configured." >&4
16375 set shmctl d_shmctl
16377 set shmget d_shmget
16387 : we could also check for sys/ipc.h ...
16388 if $h_shm && $test `./findhdr sys/shm.h`; then
16389 echo "You have the full shm*(2) library." >&4
16392 echo "You don't have the full shm*(2) library." >&4
16399 : see if we have sigaction
16400 if set sigaction val -f d_sigaction; eval $csym; $val; then
16401 echo 'sigaction() found.' >&4
16404 #include <sys/types.h>
16405 #include <signal.h>
16406 #$i_stdlib I_STDLIB
16408 #include <stdlib.h>
16412 struct sigaction act, oact;
16414 oact.sa_handler = 0;
16415 /* so that act and oact are used */
16416 exit(act.sa_flags == 0 && oact.sa_handler == 0);
16420 if eval $compile_ok; then
16423 echo "But you don't seem to have a useable struct sigaction." >&4
16427 echo 'sigaction NOT found.' >&4
16430 set d_sigaction; eval $setvar
16431 $rm -f try try$_o try.c
16433 : see if sigprocmask exists
16434 set sigprocmask d_sigprocmask
16437 : see if sigsetjmp exists
16439 case "$d_sigsetjmp" in
16442 #include <setjmp.h>
16443 #$i_stdlib I_STDLIB
16445 #include <stdlib.h>
16451 if (sigsetjmp(env,1))
16454 siglongjmp(env, 1);
16459 if eval $compile; then
16460 if $run ./try >/dev/null 2>&1; then
16461 echo "POSIX sigsetjmp found." >&4
16465 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
16471 echo "sigsetjmp not found." >&4
16475 *) val="$d_sigsetjmp"
16476 case "$d_sigsetjmp" in
16477 $define) echo "POSIX sigsetjmp found." >&4;;
16478 $undef) echo "sigsetjmp not found." >&4;;
16486 : see if sockatmark exists
16487 set sockatmark d_sockatmark
16490 : see if prototype for sockatmark is available
16492 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
16495 : see if socks5_init exists
16496 set socks5_init d_socks5_init
16499 : see if srand48_r exists
16500 set srand48_r d_srand48_r
16502 case "$d_srand48_r" in
16504 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16505 case "$d_srand48_r_proto:$usethreads" in
16506 ":define") d_srand48_r_proto=define
16507 set d_srand48_r_proto srand48_r $hdrs
16511 case "$d_srand48_r_proto" in
16513 case "$srand48_r_proto" in
16514 ''|0) try='int srand48_r(long, struct drand48_data*);'
16515 ./protochk "extern $try" $hdrs && srand48_r_proto=I_LS ;;
16517 case "$srand48_r_proto" in
16518 ''|0) d_srand48_r=undef
16520 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
16521 * ) case "$srand48_r_proto" in
16522 REENTRANT_PROTO*) ;;
16523 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
16525 echo "Prototype: $try" ;;
16528 *) case "$usethreads" in
16529 define) echo "srand48_r has no prototype, not using it." >&4 ;;
16536 *) srand48_r_proto=0
16540 : see if srandom_r exists
16541 set srandom_r d_srandom_r
16543 case "$d_srandom_r" in
16545 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16546 case "$d_srandom_r_proto:$usethreads" in
16547 ":define") d_srandom_r_proto=define
16548 set d_srandom_r_proto srandom_r $hdrs
16552 case "$d_srandom_r_proto" in
16554 case "$srandom_r_proto" in
16555 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
16556 ./protochk "extern $try" $hdrs && srandom_r_proto=I_TS ;;
16558 case "$srandom_r_proto" in
16559 ''|0) d_srandom_r=undef
16561 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
16562 * ) case "$srandom_r_proto" in
16563 REENTRANT_PROTO*) ;;
16564 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
16566 echo "Prototype: $try" ;;
16569 *) case "$usethreads" in
16570 define) echo "srandom_r has no prototype, not using it." >&4 ;;
16577 *) srandom_r_proto=0
16581 : see if prototype for setresgid is available
16583 set d_sresgproto setresgid $i_unistd unistd.h
16586 : see if prototype for setresuid is available
16588 set d_sresuproto setresuid $i_unistd unistd.h
16591 : see if sys/stat.h is available
16592 set sys/stat.h i_sysstat
16596 : see if stat knows about block sizes
16598 echo "Checking to see if your struct stat has st_blocks field..." >&4
16599 set d_statblks stat st_blocks $i_sysstat sys/stat.h
16603 : see if this is a sys/vfs.h system
16604 set sys/vfs.h i_sysvfs
16608 : see if this is a sys/statfs.h system
16609 set sys/statfs.h i_sysstatfs
16614 echo "Checking to see if your system supports struct statfs..." >&4
16615 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
16617 case "$d_statfs_s" in
16618 "$define") echo "Yes, it does." ;;
16619 *) echo "No, it doesn't." ;;
16624 : see if struct statfs knows about f_flags
16625 case "$d_statfs_s" in
16628 echo "Checking to see if your struct statfs has f_flags field..." >&4
16629 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
16633 set d_statfs_f_flags
16637 case "$d_statfs_f_flags" in
16638 "$define") echo "Yes, it does." ;;
16639 *) echo "No, it doesn't." ;;
16643 Checking how to access stdio streams by file descriptor number...
16645 case "$stdio_stream_array" in
16646 '') $cat >try.c <<EOCP
16649 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
16653 for s in _iob __iob __sF
16655 set try -DSTDIO_STREAM_ARRAY=$s
16656 if eval $compile; then
16657 case "`$run ./try`" in
16658 yes) stdio_stream_array=$s; break ;;
16662 $rm -f try.* try$exe_ext
16664 case "$stdio_stream_array" in
16666 I can't figure out how to access stdio streams by file descriptor number.
16668 d_stdio_stream_array="$undef"
16671 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
16673 d_stdio_stream_array="$define"
16677 : see if strcoll exists
16678 set strcoll d_strcoll
16681 : check for structure copying
16683 echo "Checking to see if your C compiler can copy structs..." >&4
16684 $cat >try.c <<'EOCP'
16694 if $cc -c try.c >/dev/null 2>&1 ; then
16696 echo "Yup, it can."
16699 echo "Nope, it can't."
16705 : see if strerror and/or sys_errlist[] exist
16707 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
16708 if set strerror val -f d_strerror; eval $csym; $val; then
16709 echo 'strerror() found.' >&4
16710 d_strerror="$define"
16711 d_strerrm='strerror(e)'
16712 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
16713 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
16714 d_syserrlst="$define"
16716 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
16717 d_syserrlst="$undef"
16719 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
16720 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
16721 echo 'strerror() found in string header.' >&4
16722 d_strerror="$define"
16723 d_strerrm='strerror(e)'
16724 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
16725 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
16726 d_syserrlst="$define"
16728 echo "(You don't appear to have any sys_errlist[], how can this be?)"
16729 d_syserrlst="$undef"
16731 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
16732 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
16733 d_strerror="$undef"
16734 d_syserrlst="$define"
16735 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
16737 echo 'strerror() and sys_errlist[] NOT found.' >&4
16738 d_strerror="$undef"
16739 d_syserrlst="$undef"
16740 d_strerrm='"unknown"'
16744 : see if strerror_r exists
16745 set strerror_r d_strerror_r
16747 case "$d_strerror_r" in
16749 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
16750 case "$d_strerror_r_proto:$usethreads" in
16751 ":define") d_strerror_r_proto=define
16752 set d_strerror_r_proto strerror_r $hdrs
16756 case "$d_strerror_r_proto" in
16758 case "$strerror_r_proto" in
16759 ''|0) try='int strerror_r(int, char*, size_t);'
16760 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBW ;;
16762 case "$strerror_r_proto" in
16763 ''|0) try='int strerror_r(int, char*, int);'
16764 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBI ;;
16766 case "$strerror_r_proto" in
16767 ''|0) try='char* strerror_r(int, char*, size_t);'
16768 ./protochk "extern $try" $hdrs && strerror_r_proto=B_IBW ;;
16770 case "$strerror_r_proto" in
16771 ''|0) d_strerror_r=undef
16773 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
16774 * ) case "$strerror_r_proto" in
16775 REENTRANT_PROTO*) ;;
16776 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
16778 echo "Prototype: $try" ;;
16781 *) case "$usethreads" in
16782 define) echo "strerror_r has no prototype, not using it." >&4 ;;
16789 *) strerror_r_proto=0
16793 : see if strftime exists
16794 set strftime d_strftime
16797 : see if strlcat exists
16798 set strlcat d_strlcat
16801 : see if strlcpy exists
16802 set strlcpy d_strlcpy
16805 : see if strtod exists
16806 set strtod d_strtod
16809 : see if strtol exists
16810 set strtol d_strtol
16813 : see if strtold exists
16814 set strtold d_strtold
16817 : see if strtoll exists
16818 set strtoll d_strtoll
16821 case "$d_longlong-$d_strtoll" in
16824 Checking whether your strtoll() works okay...
16826 $cat >try.c <<'EOCP'
16829 #define strtoll __strtoll
16832 #define strtoll _strtoll
16835 extern long long int strtoll(char *s, char **, int);
16836 static int bad = 0;
16837 int check(char *s, long long ell, int een) {
16840 gll = strtoll(s, 0, 10);
16841 if (!((gll == ell) && (errno == een)))
16845 check(" 1", 1LL, 0);
16846 check(" 0", 0LL, 0);
16847 check("-1", -1LL, 0);
16848 check("-9223372036854775808", -9223372036854775808LL, 0);
16849 check("-9223372036854775808", -9223372036854775808LL, 0);
16850 check(" 9223372036854775807", 9223372036854775807LL, 0);
16851 check("-9223372036854775808", -9223372036854775808LL, 0);
16852 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
16853 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
16859 if eval $compile; then
16862 ok) echo "Your strtoll() seems to be working okay." ;;
16864 Your strtoll() doesn't seem to be working okay.
16870 echo "(I can't seem to compile the test program--assuming it doesn't)"
16876 : see if strtoq exists
16877 set strtoq d_strtoq
16880 : see if strtoul exists
16881 set strtoul d_strtoul
16884 case "$d_strtoul" in
16887 Checking whether your strtoul() works okay...
16889 $cat >try.c <<'EOCP'
16892 extern unsigned long int strtoul(char *s, char **, int);
16893 static int bad = 0;
16894 void check(char *s, unsigned long eul, int een) {
16897 gul = strtoul(s, 0, 10);
16898 if (!((gul == eul) && (errno == een)))
16902 check(" 1", 1L, 0);
16903 check(" 0", 0L, 0);
16905 case "$longsize" in
16907 $cat >>try.c <<'EOCP'
16908 check("18446744073709551615", 18446744073709551615UL, 0);
16909 check("18446744073709551616", 18446744073709551615UL, ERANGE);
16910 #if 0 /* strtoul() for /^-/ strings is undefined. */
16911 check("-1", 18446744073709551615UL, 0);
16912 check("-18446744073709551614", 2, 0);
16913 check("-18446744073709551615", 1, 0);
16914 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
16915 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
16920 $cat >>try.c <<'EOCP'
16921 check("4294967295", 4294967295UL, 0);
16922 check("4294967296", 4294967295UL, ERANGE);
16923 #if 0 /* strtoul() for /^-/ strings is undefined. */
16924 check("-1", 4294967295UL, 0);
16925 check("-4294967294", 2, 0);
16926 check("-4294967295", 1, 0);
16927 check("-4294967296", 4294967295UL, ERANGE);
16928 check("-4294967297", 4294967295UL, ERANGE);
16933 : Should we write these tests to be more portable by sprintf-ing
16934 : ~0 and then manipulating that char string as input for strtol?
16937 $cat >>try.c <<'EOCP'
16944 if eval $compile; then
16945 case "`$run ./try`" in
16946 ok) echo "Your strtoul() seems to be working okay." ;;
16948 Your strtoul() doesn't seem to be working okay.
16957 : see if strtoull exists
16958 set strtoull d_strtoull
16961 case "$d_longlong-$d_strtoull" in
16964 Checking whether your strtoull() works okay...
16966 $cat >try.c <<'EOCP'
16969 #define strtoull __strtoull
16972 extern unsigned long long int strtoull(char *s, char **, int);
16973 static int bad = 0;
16974 int check(char *s, long long eull, int een) {
16977 gull = strtoull(s, 0, 10);
16978 if (!((gull == eull) && (errno == een)))
16982 check(" 1", 1LL, 0);
16983 check(" 0", 0LL, 0);
16984 check("18446744073709551615", 18446744073709551615ULL, 0);
16985 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
16986 #if 0 /* strtoull() for /^-/ strings is undefined. */
16987 check("-1", 18446744073709551615ULL, 0);
16988 check("-18446744073709551614", 2LL, 0);
16989 check("-18446744073709551615", 1LL, 0);
16990 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
16991 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
16998 if eval $compile; then
16999 case "`$run ./try`" in
17000 ok) echo "Your strtoull() seems to be working okay." ;;
17002 Your strtoull() doesn't seem to be working okay.
17004 d_strtoull="$undef"
17011 : see if strtouq exists
17012 set strtouq d_strtouq
17015 case "$d_strtouq" in
17018 Checking whether your strtouq() works okay...
17020 $cat >try.c <<'EOCP'
17023 extern unsigned long long int strtouq(char *s, char **, int);
17024 static int bad = 0;
17025 void check(char *s, unsigned long long eull, int een) {
17026 unsigned long long gull;
17028 gull = strtouq(s, 0, 10);
17029 if (!((gull == eull) && (errno == een)))
17033 check(" 1", 1LL, 0);
17034 check(" 0", 0LL, 0);
17035 check("18446744073709551615", 18446744073709551615ULL, 0);
17036 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17037 #if 0 /* strtouq() for /^-/ strings is undefined. */
17038 check("-1", 18446744073709551615ULL, 0);
17039 check("-18446744073709551614", 2LL, 0);
17040 check("-18446744073709551615", 1LL, 0);
17041 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17042 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17050 if eval $compile; then
17051 case "`$run ./try`" in
17052 ok) echo "Your strtouq() seems to be working okay." ;;
17054 Your strtouq() doesn't seem to be working okay.
17063 : see if strxfrm exists
17064 set strxfrm d_strxfrm
17067 : see if symlink exists
17068 set symlink d_symlink
17071 : see if syscall exists
17072 set syscall d_syscall
17075 : see if prototype for syscall is available
17077 set d_syscallproto syscall $i_unistd unistd.h
17080 : see if sysconf exists
17081 set sysconf d_sysconf
17084 : see if system exists
17085 set system d_system
17088 : see if tcgetpgrp exists
17089 set tcgetpgrp d_tcgetpgrp
17092 : see if tcsetpgrp exists
17093 set tcsetpgrp d_tcsetpgrp
17096 : see if prototype for telldir is available
17098 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
17101 : see if time exists
17103 if test "X$d_time" = X -o X"$timetype" = X; then
17104 if set time val -f d_time; eval $csym; $val; then
17105 echo 'time() found.' >&4
17107 rp="What is the type returned by time() on this system?"
17108 set time_t timetype long stdio.h sys/types.h
17111 echo 'time() not found, hope that will do.' >&4
17119 : see if this is a sys/times.h system
17120 set sys/times.h i_systimes
17123 : see if times exists
17125 if set times val -f d_times; eval $csym; $val; then
17126 echo 'times() found.' >&4
17129 case "$i_systimes" in
17130 "$define") inc='sys/times.h';;
17132 rp="What is the type returned by times() on this system?"
17133 set clock_t clocktype long stdio.h sys/types.h $inc
17136 echo 'times() NOT found, hope that will do.' >&4
17141 : see if tmpnam_r exists
17142 set tmpnam_r d_tmpnam_r
17144 case "$d_tmpnam_r" in
17146 hdrs="$i_systypes sys/types.h define stdio.h "
17147 case "$d_tmpnam_r_proto:$usethreads" in
17148 ":define") d_tmpnam_r_proto=define
17149 set d_tmpnam_r_proto tmpnam_r $hdrs
17153 case "$d_tmpnam_r_proto" in
17155 case "$tmpnam_r_proto" in
17156 ''|0) try='char* tmpnam_r(char*);'
17157 ./protochk "extern $try" $hdrs && tmpnam_r_proto=B_B ;;
17159 case "$tmpnam_r_proto" in
17160 ''|0) d_tmpnam_r=undef
17162 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
17163 * ) case "$tmpnam_r_proto" in
17164 REENTRANT_PROTO*) ;;
17165 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
17167 echo "Prototype: $try" ;;
17170 *) case "$usethreads" in
17171 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
17178 *) tmpnam_r_proto=0
17182 : see if truncate exists
17183 set truncate d_truncate
17186 : see if ttyname_r exists
17187 set ttyname_r d_ttyname_r
17189 case "$d_ttyname_r" in
17191 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
17192 case "$d_ttyname_r_proto:$usethreads" in
17193 ":define") d_ttyname_r_proto=define
17194 set d_ttyname_r_proto ttyname_r $hdrs
17198 case "$d_ttyname_r_proto" in
17200 case "$ttyname_r_proto" in
17201 ''|0) try='int ttyname_r(int, char*, size_t);'
17202 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBW ;;
17204 case "$ttyname_r_proto" in
17205 ''|0) try='int ttyname_r(int, char*, int);'
17206 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBI ;;
17208 case "$ttyname_r_proto" in
17209 ''|0) try='char* ttyname_r(int, char*, int);'
17210 ./protochk "extern $try" $hdrs && ttyname_r_proto=B_IBI ;;
17212 case "$ttyname_r_proto" in
17213 ''|0) d_ttyname_r=undef
17215 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
17216 * ) case "$ttyname_r_proto" in
17217 REENTRANT_PROTO*) ;;
17218 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
17220 echo "Prototype: $try" ;;
17223 *) case "$usethreads" in
17224 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
17231 *) ttyname_r_proto=0
17235 : see if tzname[] exists
17237 if set tzname val -a d_tzname; eval $csym; $val; then
17239 echo 'tzname[] found.' >&4
17242 echo 'tzname[] NOT found.' >&4
17248 next|rhapsody|darwin) multiarch="$define" ;;
17250 case "$multiarch" in
17251 ''|[nN]*) multiarch="$undef" ;;
17254 : check for ordering of bytes in a UV
17256 case "$usecrosscompile$multiarch" in
17259 You seem to be either cross-compiling or doing a multiarchitecture build,
17260 skipping the byteorder check.
17266 case "$byteorder" in
17269 In the following, larger digits indicate more significance. A big-endian
17270 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
17271 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
17272 machines may have weird orders like 3412. A Cray will report 87654321,
17273 an Alpha will report 12345678. If the test program works the default is
17275 I'm now running the test program...
17279 #$i_stdlib I_STDLIB
17281 #include <stdlib.h>
17283 #include <sys/types.h>
17284 typedef $uvtype UV;
17294 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
17296 u.l = (UV)0x04030201;
17297 for (i = 0; i < $uvsize; i++)
17298 printf("%c", u.c[i]+'0');
17305 if eval $compile && ./try > /dev/null; then
17308 [1-4][1-4][1-4][1-4]|12345678|87654321)
17309 echo "(The test program ran ok.)"
17310 echo "byteorder=$dflt"
17313 ????|????????) echo "(The test program ran ok.)" ;;
17314 *) echo "(The test program didn't run right for some reason.)" ;;
17319 (I can't seem to compile the test program. Guessing big-endian...)
17322 case "$xxx_prompt" in
17324 rp="What is the order of bytes in $uvtype?"
17340 Checking to see whether you can access character data unalignedly...
17342 case "$d_u32align" in
17343 '') $cat >try.c <<EOCP
17345 #$i_stdlib I_STDLIB
17347 #include <stdlib.h>
17349 #define U32 $u32type
17350 #define BYTEORDER 0x$byteorder
17352 #include <signal.h>
17354 $signal_t bletch(s) int s; { exit(4); }
17357 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
17362 if (sizeof(U32) != 4) {
17363 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
17370 signal(SIGBUS, bletch);
17382 for (i = 0; i < 4; i++) {
17383 up = (U32*)(buf + i);
17384 if (! ((*up == 1 << (8*i)) || /* big-endian */
17385 (*up == 1 << (8*(3-i))) /* little-endian */
17389 printf("read failed (%x)\n", *up);
17395 for (i = 0; i < 4; i++) {
17396 up = (U32*)(buf + i);
17398 if (*up != 0xBeef) {
17399 printf("write failed (%x)\n", *up);
17413 if eval $compile_ok; then
17414 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
17415 $run ./try 2>&1 >/dev/null
17418 You can access character data pretty unalignedly.
17420 d_u32align="$undef"
17423 It seems that you must access character data in an aligned manner.
17425 d_u32align="$define"
17429 rp='Can you access character data at unaligned addresses?'
17433 [yY]*) d_u32align="$undef" ;;
17434 *) d_u32align="$define" ;;
17437 $rm -f core core.try.* try.core
17441 : see if ualarm exists
17442 set ualarm d_ualarm
17445 : see if umask exists
17449 : see if unordered exists
17450 set unordered d_unordered
17453 : see if usleep exists
17454 set usleep d_usleep
17457 : see if prototype for usleep is available
17459 set d_usleepproto usleep $i_unistd unistd.h
17462 : see if ustat exists
17466 : backward compatibility for d_hvfork
17467 if test X$d_hvfork != X; then
17468 d_vfork="$d_hvfork"
17471 : see if there is a vfork
17476 : Ok, but do we want to use it. vfork is reportedly unreliable in
17477 : perl on Solaris 2.x, and probably elsewhere.
17481 case "$usevfork" in
17487 Perl can only use a vfork() that doesn't suffer from strict
17488 restrictions on calling functions or modifying global data in
17489 the child. For example, glibc-2.1 contains such a vfork()
17490 that is unsuitable. If your system provides a proper fork()
17491 call, chances are that you do NOT want perl to use vfork().
17494 rp="Do you still want to use vfork()?"
17499 echo "Ok, we won't use vfork()."
17508 $define) usevfork='true';;
17509 *) usevfork='false';;
17512 : see if closedir exists
17513 set closedir d_closedir
17516 case "$d_closedir" in
17519 echo "Checking whether closedir() returns a status..." >&4
17521 #$i_dirent I_DIRENT /**/
17522 #$i_sysdir I_SYS_DIR /**/
17523 #$i_sysndir I_SYS_NDIR /**/
17524 #$i_systypes I_SYS_TYPES /**/
17526 #if defined(I_SYS_TYPES)
17527 #include <sys/types.h>
17529 #if defined(I_DIRENT)
17530 #include <dirent.h>
17531 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
17532 #include <sys/dir.h>
17536 #include <sys/ndir.h>
17540 #include <ndir.h> /* may be wrong in the future */
17542 #include <sys/dir.h>
17547 int main() { return closedir(opendir(".")); }
17550 if eval $compile_ok; then
17551 if $run ./try > /dev/null 2>&1 ; then
17552 echo "Yes, it does."
17555 echo "No, it doesn't."
17559 echo "(I can't seem to compile the test program--assuming it doesn't)"
17567 set d_void_closedir
17570 : see if there is a wait4
17574 : see if waitpid exists
17575 set waitpid d_waitpid
17578 : see if wcstombs exists
17579 set wcstombs d_wcstombs
17582 : see if wctomb exists
17583 set wctomb d_wctomb
17586 : see if writev exists
17587 set writev d_writev
17590 : preserve RCS keywords in files with variable substitution, grrr
17595 Revision='$Revision'
17597 : check for alignment requirements
17599 case "$usecrosscompile$multiarch" in
17602 You seem to be either cross-compiling or doing a multiarchitecture build,
17603 skipping the memory alignment check.
17606 case "$alignbytes" in
17607 '') alignbytes=8 ;;
17611 case "$alignbytes" in
17612 '') echo "Checking alignment constraints..." >&4
17613 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
17614 $cat >try.c <<'EOCP'
17615 typedef long double NV;
17618 $cat >try.c <<'EOCP'
17622 $cat >>try.c <<'EOCP'
17630 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
17635 if eval $compile_ok; then
17639 echo "(I can't seem to compile the test program...)"
17642 *) dflt="$alignbytes"
17645 rp="Doubles must be aligned on a how-many-byte boundary?"
17653 : set the base revision
17656 : how do we concatenate cpp tokens here?
17658 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
17659 $cat >cpp_stuff.c <<'EOCP'
17660 #define RCAT(a,b)a/**/b
17661 #define ACAT(a,b)a ## b
17665 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
17666 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
17667 echo "Oh! Smells like ANSI's been here." >&4
17668 echo "We can catify or stringify, separately or together!"
17670 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
17671 echo "Ah, yes! The good old days!" >&4
17672 echo "However, in the good old days we don't know how to stringify and"
17673 echo "catify at the same time."
17677 Hmm, I don't seem to be able to concatenate tokens with your cpp.
17678 You're going to have to edit the values of CAT[2-5] in config.h...
17680 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
17684 : see if this is a db.h system
17690 : Check db version.
17692 echo "Checking Berkeley DB version ..." >&4
17698 #include <sys/types.h>
17700 #$i_stdlib I_STDLIB
17702 #include <stdlib.h>
17705 int main(int argc, char *argv[])
17707 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
17708 int Major, Minor, Patch ;
17709 unsigned long Version ;
17710 (void)db_version(&Major, &Minor, &Patch) ;
17712 printf("%d %d %d %d %d %d\n",
17713 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
17714 Major, Minor, Patch);
17717 printf("You have Berkeley DB Version 2 or greater.\n");
17719 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
17720 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
17721 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
17722 Major, Minor, Patch) ;
17724 /* check that db.h & libdb are compatible */
17725 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
17726 printf("db.h and libdb are incompatible.\n") ;
17730 printf("db.h and libdb are compatible.\n") ;
17732 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
17733 + DB_VERSION_PATCH ;
17735 /* needs to be >= 2.3.4 */
17736 if (Version < 2003004) {
17737 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
17738 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
17744 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
17749 printf("You have Berkeley DB Version 1.\n");
17750 exit(0); /* DB version < 2: the coast is clear. */
17752 exit(1); /* <db.h> not Berkeley DB? */
17758 if eval $compile_ok && $run ./try; then
17759 echo 'Looks OK.' >&4
17761 db_version_major=$1
17762 db_version_minor=$2
17763 db_version_patch=$3
17765 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
17769 : Remove db from list of libraries to use
17770 echo "Removing unusable -ldb from library list" >&4
17771 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
17774 echo "libs = $libs" >&4
17784 : Check the return type needed for hash
17786 echo "Checking return type needed for hash for Berkeley DB ..." >&4
17792 #include <sys/types.h>
17795 #ifndef DB_VERSION_MAJOR
17796 u_int32_t hash_cb (ptr, size)
17804 info.hash = hash_cb;
17808 if $cc $ccflags -c try.c >try.out 2>&1 ; then
17809 if $contains warning try.out >>/dev/null 2>&1 ; then
17812 db_hashtype='u_int32_t'
17815 : XXX Maybe we should just give up here.
17816 db_hashtype=u_int32_t
17818 echo "Help: I can't seem to compile the db test program." >&4
17819 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
17822 echo "Your version of Berkeley DB uses $db_hashtype for hash."
17824 *) db_hashtype=u_int32_t
17829 : Check the return type needed for prefix
17831 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
17837 #include <sys/types.h>
17840 #ifndef DB_VERSION_MAJOR
17841 size_t prefix_cb (key1, key2)
17849 info.prefix = prefix_cb;
17853 if $cc $ccflags -c try.c >try.out 2>&1 ; then
17854 if $contains warning try.out >>/dev/null 2>&1 ; then
17855 db_prefixtype='int'
17857 db_prefixtype='size_t'
17860 db_prefixtype='size_t'
17861 : XXX Maybe we should just give up here.
17863 echo "Help: I can't seem to compile the db test program." >&4
17864 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
17867 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
17869 *) db_prefixtype='size_t'
17874 : How can we generate normalized random numbers ?
17876 echo "Looking for a random number function..." >&4
17877 case "$randfunc" in
17879 if set drand48 val -f; eval $csym; $val; then
17881 echo "Good, found drand48()." >&4
17882 elif set random val -f; eval $csym; $val; then
17884 echo "OK, found random()." >&4
17887 echo "Yick, looks like I have to use rand()." >&4
17898 *-Dmy_rand=*|*-Dmy_srand=*)
17899 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
17900 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
17901 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
17902 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
17906 while $test "$cont"; do
17907 rp="Use which function to generate random numbers?"
17909 if $test "$ans" = "$dflt"; then
17915 if set $ans val -f; eval $csym; $val; then
17919 rp="I cannot find function $ans. Use that name anyway?"
17928 case "$randfunc" in
17930 drand01="drand48()"
17936 case "$randbits" in
17938 echo "Checking to see how many bits your $randfunc() function produces..." >&4
17940 #$i_unistd I_UNISTD
17941 #$i_stdlib I_STDLIB
17944 # include <unistd.h>
17947 # include <stdlib.h>
17952 register unsigned long tmp;
17953 register unsigned long max = 0L;
17955 for (i = 1000; i; i--) {
17956 tmp = (unsigned long) $randfunc();
17957 if (tmp > max) max = tmp;
17959 for (i = 0; max; i++)
17965 if eval $compile_ok; then
17969 echo "(I can't seem to compile the test program...)"
17976 rp="How many bits does your $randfunc() function produce?"
17980 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
17981 seedfunc="s$randfunc"
17982 randseedtype=unsigned
17986 rp="How many bits does your $randfunc() function produce?"
17989 seedfunc="s$randfunc"
17990 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
17991 if set $seedfunc val -f; eval $csym; $val; then
17992 echo "(Using $seedfunc() to seed random generator)"
17994 echo "(Warning: no $seedfunc() to seed random generator)"
17997 randseedtype=unsigned
18005 echo "Determining whether or not we are on an EBCDIC system..." >&4
18006 $cat >try.c <<'EOM'
18009 if ('M'==0xd4) return 0;
18016 if eval $compile_ok; then
18017 if $run ./try; then
18018 echo "You seem to speak EBCDIC." >&4
18021 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
18024 echo "I'm unable to compile the test program." >&4
18025 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
18033 Checking how to flush all pending stdio output...
18035 # I only know how to find the first 32 possibly open files on SunOS.
18036 # See also hints/sunos_4_1.sh and util.c --AD
18038 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
18040 $cat >>try.c <<EOCP
18042 #$i_stdlib I_STDLIB
18044 #include <stdlib.h>
18046 #$i_unistd I_UNISTD
18048 # include <unistd.h>
18050 #$d_sysconf HAS_SYSCONF
18051 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
18052 #ifdef HAS_STDIO_STREAM_ARRAY
18053 # define STDIO_STREAM_ARRAY $stdio_stream_array
18058 p = fopen("try.out", "w");
18062 # ifdef TRY_FPRINTF
18066 #ifdef TRY_FFLUSH_NULL
18069 #ifdef TRY_FFLUSH_ALL
18071 long open_max = -1;
18072 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
18073 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
18075 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
18076 open_max = sysconf(_SC_OPEN_MAX);
18079 open_max = FOPEN_MAX;
18082 open_max = OPEN_MAX;
18091 # ifdef HAS_STDIO_STREAM_ARRAY
18092 if (open_max > 0) {
18094 for (i = 0; i < open_max; i++)
18095 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
18096 STDIO_STREAM_ARRAY[i]._file < open_max &&
18097 STDIO_STREAM_ARRAY[i]._flag)
18098 fflush(&STDIO_STREAM_ARRAY[i]);
18106 : first we have to find out how _not_ to flush
18108 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
18110 set try -DTRY_FPUTC
18111 if eval $compile; then
18112 $run ./try 2>/dev/null
18115 if $test ! -s try.out -a "X$code" = X42; then
18121 set try -DTRY_FPRINTF
18122 if eval $compile; then
18123 $run ./try 2>/dev/null
18126 if $test ! -s try.out -a "X$code" = X42; then
18127 output=-DTRY_FPRINTF
18133 : check for fflush NULL behaviour
18134 case "$fflushNULL" in
18135 '') set try -DTRY_FFLUSH_NULL $output
18136 if eval $compile; then
18137 $run ./try 2>/dev/null
18140 if $test -s try.out -a "X$code" = X42; then
18141 fflushNULL="`$cat try.out`"
18143 if $test "X$code" != X42; then
18145 (If this test failed, don't worry, we'll try another method shortly.)
18150 $rm -f core try.core core.try.*
18151 case "$fflushNULL" in
18153 Your fflush(NULL) works okay for output streams.
18154 Let's see if it clobbers input pipes...
18156 # As of mid-March 2000 all versions of Solaris appear to have a stdio
18157 # bug that improperly flushes the input end of pipes. So we avoid the
18158 # autoflush on fork/system/exec support for now. :-(
18159 $cat >tryp.c <<EOCP
18162 main(int argc, char **argv)
18168 while ((i = getc(stdin)) != -1
18169 && (*bp++ = i) != '\n'
18170 && bp < &buf[1024])
18173 fprintf(stdout, "%s", buf);
18181 fflushNULL="$define"
18183 if eval $compile; then
18185 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
18186 if cmp tryp.c tryp.out >/dev/null 2>&1; then
18188 fflush(NULL) seems to behave okay with input streams.
18190 fflushNULL="$define"
18193 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
18195 fflushNULL="$undef"
18198 $rm -f core tryp.c tryp.core core.tryp.*
18201 Your fflush(NULL) isn't working (contrary to ANSI C).
18203 fflushNULL="$undef"
18206 Cannot figure out whether your fflush(NULL) works or not.
18207 I'm assuming it doesn't (contrary to ANSI C).
18209 fflushNULL="$undef"
18213 $define|true|[yY]*)
18214 fflushNULL="$define"
18217 fflushNULL="$undef"
18220 : check explicit looping only if NULL did not work, and if the pipe
18221 : bug does not show up on an explicit flush too
18222 case "$fflushNULL" in
18224 $cat >tryp.c <<EOCP
18227 main(int argc, char **argv)
18233 while ((i = getc(stdin)) != -1
18234 && (*bp++ = i) != '\n'
18235 && bp < &buf[1024])
18238 fprintf(stdout, "%s", buf);
18247 if eval $compile; then
18249 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
18250 if cmp tryp.c tryp.out >/dev/null 2>&1; then
18252 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
18254 : now check for fflushall behaviour
18255 case "$fflushall" in
18256 '') set try -DTRY_FFLUSH_ALL $output
18257 if eval $compile; then
18259 (Now testing the other method--but note that this also may fail.)
18261 $run ./try 2>/dev/null
18264 if $test -s try.out -a "X$code" = X42; then
18265 fflushall="`$cat try.out`"
18268 $rm -f core try.core core.try.*
18269 case "$fflushall" in
18271 Whew. Flushing explicitly all the stdio streams works.
18273 fflushall="$define"
18276 Sigh. Flushing explicitly all the stdio streams doesn't work.
18281 Cannot figure out whether flushing stdio streams explicitly works or not.
18282 I'm assuming it doesn't.
18288 "$define"|true|[yY]*)
18289 fflushall="$define"
18297 All is futile. Even fflush(stdin) clobbers input pipes!
18304 $rm -f core tryp.c tryp.core core.tryp.*
18306 *) fflushall="$undef"
18310 case "$fflushNULL$fflushall" in
18313 OK, I give up. I cannot figure out how to flush pending stdio output.
18314 We won't be flushing handles at all before fork/exec/popen.
18318 $rm -f try.* try$exe_ext
18320 : Store the full pathname to the ar program for use in the C program
18321 : Respect a hint or command line value for full_ar.
18326 : Store the full pathname to the sed program for use in the C program
18329 : see what type gids are declared as in the kernel
18331 echo "Looking for the type for group ids returned by getgid()."
18332 set gid_t gidtype xxx stdio.h sys/types.h
18336 xxx=`./findhdr sys/user.h`
18337 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
18339 unsigned) dflt="$1 $2" ;;
18343 *) dflt="$gidtype";;
18346 gid_t) echo "gid_t found." ;;
18347 *) rp="What is the type for group ids returned by getgid()?"
18355 *_t) zzz="$gidtype" ;;
18358 echo "Checking the size of $zzz..." >&4
18360 #include <sys/types.h>
18362 #$i_stdlib I_STDLIB
18364 #include <stdlib.h>
18367 printf("%d\n", (int)sizeof($gidtype));
18372 if eval $compile_ok; then
18376 echo "(I can't execute the test program--guessing $gidsize.)" >&4
18379 echo "Your $zzz is $gidsize bytes long."
18384 echo "(I can't compile the test program--guessing $gidsize.)" >&4
18390 *_t) zzz="$gidtype" ;;
18393 echo "Checking the sign of $zzz..." >&4
18395 #include <sys/types.h>
18406 if eval $compile; then
18410 echo "(I can't execute the test program--guessing unsigned.)" >&4
18414 1) echo "Your $zzz is unsigned." ;;
18415 -1) echo "Your $zzz is signed." ;;
18421 echo "(I can't compile the test program--guessing unsigned.)" >&4
18427 if $test X"$quadtype" != X; then
18429 echo "Checking how to print 64-bit integers..." >&4
18431 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
18432 $cat >try.c <<'EOCP'
18433 #include <sys/types.h>
18436 int q = 12345678901;
18437 printf("%ld\n", q);
18441 if eval $compile; then
18445 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
18446 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
18447 echo "We will use %d."
18453 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
18454 $cat >try.c <<'EOCP'
18455 #include <sys/types.h>
18458 long q = 12345678901;
18459 printf("%ld\n", q);
18463 if eval $compile; then
18467 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
18468 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
18469 echo "We will use %ld."
18475 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
18476 $cat >try.c <<'EOCP'
18477 #include <sys/types.h>
18478 #include <inttypes.h>
18481 int64_t q = 12345678901;
18482 printf("%" PRId64 "\n", q);
18486 if eval $compile; then
18490 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
18491 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
18492 echo "We will use the C9X style."
18498 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
18500 #include <sys/types.h>
18503 $quadtype q = 12345678901;
18504 printf("%Ld\n", q);
18508 if eval $compile; then
18512 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
18513 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
18514 echo "We will use %Ld."
18520 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
18521 $cat >try.c <<'EOCP'
18522 #include <sys/types.h>
18525 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
18526 printf("%lld\n", q);
18530 if eval $compile; then
18534 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
18535 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
18536 echo "We will use the %lld style."
18542 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
18544 #include <sys/types.h>
18547 $quadtype q = 12345678901;
18548 printf("%qd\n", q);
18552 if eval $compile; then
18556 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
18557 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
18558 echo "We will use %qd."
18564 if $test X"$sPRId64" = X; then
18565 echo "Cannot figure out how to print 64-bit integers." >&4
18573 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
18574 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
18576 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
18577 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
18583 $echo "Checking the format strings to be used for Perl's internal types..." >&4
18585 if $test X"$ivsize" = X8; then
18586 ivdformat="$sPRId64"
18587 uvuformat="$sPRIu64"
18588 uvoformat="$sPRIo64"
18589 uvxformat="$sPRIx64"
18590 uvXUformat="$sPRIXU64"
18592 if $test X"$ivsize" = X"$longsize"; then
18599 if $test X"$ivsize" = X"$intsize"; then
18607 if $test X"$ivsize" = X"$shortsize"; then
18618 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
18619 nveformat="$sPRIeldbl"
18620 nvfformat="$sPRIfldbl"
18621 nvgformat="$sPRIgldbl"
18622 nvEUformat="$sPRIEUldbl"
18623 nvFUformat="$sPRIFUldbl"
18624 nvGUformat="$sPRIGUldbl"
18634 case "$ivdformat" in
18635 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
18642 $echo "Checking the format string to be used for gids..." >&4
18645 -1) if $test X"$gidsize" = X"$ivsize"; then
18646 gidformat="$ivdformat"
18648 if $test X"$gidsize" = X"$longsize"; then
18651 if $test X"$gidsize" = X"$intsize"; then
18654 if $test X"$gidsize" = X"$shortsize"; then
18661 *) if $test X"$gidsize" = X"$uvsize"; then
18662 gidformat="$uvuformat"
18664 if $test X"$gidsize" = X"$longsize"; then
18667 if $test X"$gidsize" = X"$intsize"; then
18670 if $test X"$gidsize" = X"$shortsize"; then
18679 : see if getgroups exists
18680 set getgroups d_getgrps
18683 : see if setgroups exists
18684 set setgroups d_setgrps
18688 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
18690 case "$d_getgrps$d_setgrps" in
18692 case "$groupstype" in
18693 '') dflt="$gidtype" ;;
18694 *) dflt="$groupstype" ;;
18697 What type of pointer is the second argument to getgroups() and setgroups()?
18698 Usually this is the same as group ids, $gidtype, but not always.
18701 rp='What type pointer is the second argument to getgroups() and setgroups()?'
18705 *) groupstype="$gidtype";;
18709 echo "Checking if your $make program sets \$(MAKE)..." >&4
18710 case "$make_set_make" in
18712 $sed 's/^X //' > testmake.mak << 'EOF'
18714 X @echo 'maketemp="$(MAKE)"'
18716 case "`$make -f testmake.mak 2>/dev/null`" in
18717 *maketemp=*) make_set_make='#' ;;
18718 *) make_set_make="MAKE=$make" ;;
18720 $rm -f testmake.mak
18723 case "$make_set_make" in
18724 '#') echo "Yup, it does.";;
18725 *) echo "Nope, it doesn't.";;
18728 : see what type is used for mode_t
18729 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
18730 set mode_t modetype int stdio.h sys/types.h
18733 : see if stdarg is available
18735 if $test `./findhdr stdarg.h`; then
18736 echo "<stdarg.h> found." >&4
18739 echo "<stdarg.h> NOT found." >&4
18743 : see if varags is available
18745 if $test `./findhdr varargs.h`; then
18746 echo "<varargs.h> found." >&4
18748 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
18751 : set up the varargs testing programs
18752 $cat > varargs.c <<EOP
18754 #include <stdarg.h>
18757 #include <varargs.h>
18761 int f(char *p, ...)
18775 p = va_arg(ap, char *);
18780 $cat > varargs <<EOP
18782 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
18791 : now check which varargs header should be included
18796 if `./varargs I_STDARG`; then
18798 elif `./varargs I_VARARGS`; then
18803 if `./varargs I_VARARGS`; then
18810 echo "I could not find the definition for va_dcl... You have problems..." >&4
18811 val="$undef"; set i_stdarg; eval $setvar
18812 val="$undef"; set i_varargs; eval $setvar
18817 case "$i_varhdr" in
18819 val="$define"; set i_stdarg; eval $setvar
18820 val="$undef"; set i_varargs; eval $setvar
18823 val="$undef"; set i_stdarg; eval $setvar
18824 val="$define"; set i_varargs; eval $setvar
18827 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
18831 : see if we need va_copy
18833 case "$i_stdarg" in
18836 #include <stdarg.h>
18838 #$i_stdlib I_STDLIB
18840 #include <stdlib.h>
18842 #include <signal.h>
18845 ivfprintf(FILE *f, const char *fmt, va_list *valp)
18847 return vfprintf(f, fmt, *valp);
18851 myvfprintf(FILE *f, const char *fmt, va_list val)
18853 return ivfprintf(f, fmt, &val);
18857 myprintf(char *fmt, ...)
18860 va_start(val, fmt);
18861 return myvfprintf(stdout, fmt, val);
18865 main(int ac, char **av)
18867 signal(SIGSEGV, exit);
18869 myprintf("%s%cs all right, then\n", "that", '\'');
18874 if eval $compile && $run ./try 2>&1 >/dev/null; then
18875 case "`$run ./try`" in
18876 "that's all right, then")
18882 yes) echo "It seems that you don't need va_copy()." >&4
18883 need_va_copy="$undef"
18885 *) echo "It seems that va_copy() or similar will be needed." >&4
18886 need_va_copy="$define"
18889 $rm -f try.* core core.* *.core *.core.*
18891 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
18895 : see what type is used for size_t
18896 rp="What is the type used for the length parameter for string functions?"
18897 set size_t sizetype 'unsigned int' stdio.h sys/types.h
18900 : check for type of arguments to gethostbyaddr.
18901 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
18902 case "$d_gethbyaddr" in
18906 Checking to see what type of arguments are accepted by gethostbyaddr().
18908 hdrs="$define sys/types.h
18909 $d_socket sys/socket.h
18910 $i_niin netinet/in.h
18912 $i_unistd unistd.h"
18913 : The first arg can 'char *' or 'void *'
18914 : The second arg is some of integral type
18915 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
18916 for yyy in size_t long int; do
18917 case "$netdb_host_type" in
18918 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
18919 if ./protochk "$try" $hdrs; then
18920 echo "Your system accepts $xxx for the first arg."
18921 echo "...and $yyy for the second arg."
18922 netdb_host_type="$xxx"
18923 netdb_hlen_type="$yyy"
18929 : In case none of those worked, prompt the user.
18930 case "$netdb_host_type" in
18931 '') rp='What is the type for the 1st argument to gethostbyaddr?'
18934 netdb_host_type=$ans
18935 rp='What is the type for the 2nd argument to gethostbyaddr?'
18938 netdb_hlen_type=$ans
18942 *) : no gethostbyaddr, so pick harmless defaults
18943 netdb_host_type='char *'
18944 netdb_hlen_type="$sizetype"
18947 # Remove the "const" if needed. -- but then we'll have a
18949 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
18952 : check for type of argument to gethostbyname.
18953 if test "X$netdb_name_type" = X ; then
18954 case "$d_gethbyname" in
18958 Checking to see what type of argument is accepted by gethostbyname().
18960 hdrs="$define sys/types.h
18961 $d_socket sys/socket.h
18962 $i_niin netinet/in.h
18964 $i_unistd unistd.h"
18965 for xxx in "const char *" "char *"; do
18966 case "$netdb_name_type" in
18967 '') try="extern struct hostent *gethostbyname($xxx);"
18968 if ./protochk "$try" $hdrs; then
18969 echo "Your system accepts $xxx."
18970 netdb_name_type="$xxx"
18975 : In case none of those worked, prompt the user.
18976 case "$netdb_name_type" in
18977 '') rp='What is the type for the 1st argument to gethostbyname?'
18980 netdb_name_type=$ans
18984 *) : no gethostbyname, so pick harmless default
18985 netdb_name_type='char *'
18990 : check for type of 1st argument to getnetbyaddr.
18991 if test "X$netdb_net_type" = X ; then
18992 case "$d_getnbyaddr" in
18996 Checking to see what type of 1st argument is accepted by getnetbyaddr().
18998 hdrs="$define sys/types.h
18999 $d_socket sys/socket.h
19000 $i_niin netinet/in.h
19002 $i_unistd unistd.h"
19003 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
19004 case "$netdb_net_type" in
19005 '') try="extern struct netent *getnetbyaddr($xxx, int);"
19006 if ./protochk "$try" $hdrs; then
19007 echo "Your system accepts $xxx."
19008 netdb_net_type="$xxx"
19013 : In case none of those worked, prompt the user.
19014 case "$netdb_net_type" in
19015 '') rp='What is the type for the 1st argument to getnetbyaddr?'
19018 netdb_net_type=$ans
19022 *) : no getnetbyaddr, so pick harmless default
19023 netdb_net_type='long'
19027 : locate the preferred pager for this system
19034 [a-zA-Z]:/*) dflt=$pg;;
19038 [a-zA-Z]:/*) dflt=$more;;
19042 [a-zA-Z]:/*) dflt=$less;;
19045 '') dflt=/usr/ucb/more;;
19049 : Instruct ./getfile to trust the hinted or previous pager value,
19050 : even if it does not begin with a slash. For example, on os2,
19051 : pager might be cmd /c more. See comments in UU/getfile.
19056 rp='What pager is used on your system?'
19060 : see what type pids are declared as in the kernel
19061 rp="What is the type of process ids on this system?"
19062 set pid_t pidtype int stdio.h sys/types.h
19065 : see if ar generates random libraries by itself
19067 echo "Checking how to generate random libraries on your machine..." >&4
19068 echo 'int bar1() { return bar2(); }' > bar1.c
19069 echo 'int bar2() { return 2; }' > bar2.c
19071 #$i_stdlib I_STDLIB
19073 #include <stdlib.h>
19075 int main() { printf("%d\n", bar1()); exit(0); }
19077 $cc $ccflags -c bar1.c >/dev/null 2>&1
19078 $cc $ccflags -c bar2.c >/dev/null 2>&1
19079 $cc $ccflags -c foo.c >/dev/null 2>&1
19080 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
19081 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19082 $run ./foobar >/dev/null 2>&1; then
19083 echo "$ar appears to generate random libraries itself."
19086 elif $ar ts bar$_a >/dev/null 2>&1 &&
19087 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19088 $run ./foobar >/dev/null 2>&1; then
19089 echo "a table of contents needs to be added with '$ar ts'."
19096 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
19097 $test -f $ranlib || ranlib=''
19100 if $test -n "$ranlib"; then
19101 echo "your system has '$ranlib'; we'll use that."
19104 echo "your system doesn't seem to support random libraries"
19105 echo "so we'll use lorder and tsort to order the libraries."
19112 : check for type of arguments to select.
19113 case "$selecttype" in
19114 '') case "$d_select" in
19118 Checking to see what type of arguments are accepted by select().
19120 hdrs="$define sys/types.h
19121 $i_systime sys/time.h
19122 $i_sysselct sys/select.h
19123 $d_socket sys/socket.h"
19124 : The first arg can be int, unsigned, or size_t
19125 : The last arg may or may not be 'const'
19127 : void pointer has been seen but using that
19128 : breaks the selectminbits test
19129 for xxx in 'fd_set *' 'int *'; do
19130 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
19131 for tmo in 'struct timeval *' 'const struct timeval *'; do
19133 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
19134 if ./protochk "$try" $hdrs; then
19135 echo "Your system accepts $xxx."
19144 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
19145 case "$d_fd_set" in
19146 $define) dflt="fd_set *" ;;
19155 *) : no select, so pick a harmless default
19162 : check for the select 'width'
19163 case "$selectminbits" in
19164 '') safebits=`expr $ptrsize \* 8`
19165 case "$d_select" in
19169 Checking to see on how many bits at a time your select() operates...
19172 #include <sys/types.h>
19174 #$i_systime I_SYS_TIME
19175 #$i_systimek I_SYS_TIME_KERNEL
19180 # ifdef I_SYS_TIME_KERNEL
19183 # include <sys/time.h>
19184 # ifdef I_SYS_TIME_KERNEL
19188 #$i_sysselct I_SYS_SELECT
19189 #ifdef I_SYS_SELECT
19190 #include <sys/select.h>
19192 #$d_socket HAS_SOCKET
19194 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
19197 #$i_stdlib I_STDLIB
19199 #include <stdlib.h>
19202 #define S sizeof(*(b))
19204 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
19205 #define NBITS (NBYTES * 8)
19207 char *s = malloc(NBYTES);
19216 fp = fopen("try.c", "r");
19222 b = ($selecttype)s;
19223 for (i = 0; i < NBITS; i++)
19227 select(fd + 1, b, 0, 0, &t);
19228 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
19230 printf("%d\n", i + 1);
19235 if eval $compile_ok; then
19236 selectminbits=`$run ./try`
19237 case "$selectminbits" in
19239 Cannot figure out on how many bits at a time your select() operates.
19240 I'll play safe and guess it is $safebits bits.
19242 selectminbits=$safebits
19243 bits="$safebits bits"
19246 *) bits="$selectminbits bits" ;;
19248 echo "Your select() operates on $bits at a time." >&4
19250 rp='What is the minimum number of bits your select() operates on?'
19251 case "$byteorder" in
19252 12345678) dflt=64 ;;
19258 selectminbits="$val"
19262 *) : no select, so pick a harmless default
19263 selectminbits=$safebits
19269 : Trace out the files included by signal.h, then look for SIGxxx names.
19270 : Remove SIGARRAYSIZE used by HPUX.
19271 : Remove SIGSTKSIZE used by Linux.
19272 : Remove SIGSTKSZ used by Posix.
19273 : Remove SIGTYP void lines used by OS2.
19274 : Some cpps, like os390, dont give the file name anywhere
19275 if [ "X$fieldn" = X ]; then
19276 : Just make some guesses. We check them later.
19277 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
19279 xxx=`echo '#include <signal.h>' |
19280 $cppstdin $cppminus $cppflags 2>/dev/null |
19281 $grep '^[ ]*#.*include' |
19282 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
19284 : Check this list of files to be sure we have parsed the cpp output ok.
19285 : This will also avoid potentially non-existent files, such
19288 for xx in $xxx /dev/null ; do
19289 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
19291 : If we have found no files, at least try signal.h
19292 case "$xxxfiles" in
19293 '') xxxfiles=`./findhdr signal.h` ;;
19296 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
19297 print substr($2, 4, 20)
19299 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
19300 print substr($3, 4, 20)
19302 : Append some common names just in case the awk scan failed.
19303 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
19304 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
19305 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
19306 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
19307 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
19309 : generate a few handy files for later
19310 $cat > signal.c <<EOCP
19311 #include <sys/types.h>
19312 #include <signal.h>
19313 #$i_stdlib I_STDLIB
19315 #include <stdlib.h>
19320 /* Strange style to avoid deeply-nested #if/#else/#endif */
19323 # define NSIG (_NSIG)
19329 # define NSIG (SIGMAX+1)
19335 # define NSIG (SIG_MAX+1)
19341 # define NSIG (_SIG_MAX+1)
19347 # define NSIG (MAXSIG+1)
19353 # define NSIG (MAX_SIG+1)
19358 # ifdef SIGARRAYSIZE
19359 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
19365 # define NSIG (_sys_nsig) /* Solaris 2.5 */
19369 /* Default to some arbitrary number that's big enough to get most
19370 of the common signals.
19376 printf("NSIG %d\n", NSIG);
19382 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
19384 printf "#ifdef SIG"; printf $1; printf "\n"
19385 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
19386 printf $1; printf ");\n"
19390 printf "#endif /* JUST_NSIG */\n";
19391 printf "exit(0);\n}\n";
19394 $cat >signal.awk <<'EOP'
19395 BEGIN { ndups = 0 }
19396 $1 ~ /^NSIG$/ { nsig = $2 }
19397 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
19398 if ($2 > maxsig) { maxsig = $2 }
19399 if (sig_name[$2]) {
19400 dup_name[ndups] = $1
19401 dup_num[ndups] = $2
19413 printf("NSIG %d\n", nsig);
19414 for (n = 1; n < nsig; n++) {
19416 printf("%s %d\n", sig_name[n], sig_num[n])
19419 printf("NUM%d %d\n", n, n)
19422 for (n = 0; n < ndups; n++) {
19423 printf("%s %d\n", dup_name[n], dup_num[n])
19427 $cat >signal_cmd <<EOS
19429 if $test -s signal.lst; then
19430 echo "Using your existing signal.lst file"
19435 $cat >>signal_cmd <<'EOS'
19438 if eval $compile_ok; then
19439 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) | $uniq | $awk -f signal.awk >signal.lst
19441 echo "(I can't seem be able to compile the whole test program)" >&4
19442 echo "(I'll try it in little pieces.)" >&4
19443 set signal -DJUST_NSIG
19444 if eval $compile_ok; then
19445 $run ./signal$_exe > signal.nsg
19448 echo "I can't seem to figure out how many signals you have." >&4
19449 echo "Guessing 50." >&4
19450 echo 'NSIG 50' > signal.nsg
19452 : Now look at all the signal names, one at a time.
19453 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
19454 $cat > signal.c <<EOCP
19455 #include <sys/types.h>
19456 #include <signal.h>
19459 printf("$xx %d\n", SIG${xx});
19464 if eval $compile; then
19465 echo "SIG${xx} found."
19466 $run ./signal$_exe >> signal.ls1
19468 echo "SIG${xx} NOT found."
19471 if $test -s signal.ls1; then
19472 $cat signal.nsg signal.ls1 |
19473 $sort -n | $uniq | $awk -f signal.awk >signal.lst
19477 if $test -s signal.lst; then
19480 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
19481 echo 'kill -l' >signal
19482 set X `csh -f <signal`
19486 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
19488 echo $@ | $tr ' ' $trnl | \
19489 $awk '{ printf "%s %d\n", $1, ++s; }
19490 END { printf "NSIG %d\n", ++s }' >signal.lst
19492 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
19494 chmod a+x signal_cmd
19495 $eunicefix signal_cmd
19497 : generate list of signal names
19499 case "$sig_name_init" in
19501 *) case "$sig_num_init" in
19502 ''|*,*) doinit=yes ;;
19507 echo "Generating a list of signal names and numbers..." >&4
19509 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
19510 sig_name=`$awk 'BEGIN { printf "ZERO " }
19511 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
19512 sig_num=`$awk 'BEGIN { printf "0 " }
19513 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
19514 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
19515 !/^NSIG/ { printf "\"%s\", ", $1 }
19516 END { printf "0\n" }' signal.lst`
19517 sig_num_init=`$awk 'BEGIN { printf "0, " }
19518 !/^NSIG/ { printf "%d, ", $2}
19519 END { printf "0\n"}' signal.lst`
19522 echo "The following $sig_count signals are available:"
19524 echo $sig_name | $awk \
19525 'BEGIN { linelen = 0 }
19527 for (i = 1; i <= NF; i++) {
19528 name = "SIG" $i " "
19529 linelen = linelen + length(name)
19530 if (linelen > 70) {
19532 linelen = length(name)
19538 sig_size=`echo $sig_name | awk '{print NF}'`
19539 $rm -f signal signal.c signal.awk signal.lst signal_cmd
19542 case "$sizetype" in
19543 *_t) zzz="$sizetype" ;;
19544 *) zzz="filesize" ;;
19546 echo "Checking the size of $zzz..." >&4
19548 #include <sys/types.h>
19550 #$i_stdlib I_STDLIB
19552 #include <stdlib.h>
19555 printf("%d\n", (int)sizeof($sizetype));
19560 if eval $compile_ok; then
19564 echo "(I can't execute the test program--guessing $sizesize.)" >&4
19567 echo "Your $zzz size is $sizesize bytes."
19572 echo "(I can't compile the test program--guessing $sizesize.)" >&4
19576 : check for socklen_t
19578 echo "Checking to see if you have socklen_t..." >&4
19580 #include <sys/types.h>
19581 #$d_socket HAS_SOCKET
19583 #include <sys/socket.h>
19585 int main() { socklen_t x = 16; }
19588 if eval $compile; then
19590 echo "You have socklen_t."
19593 echo "You do not have socklen_t."
19594 case "$sizetype" in
19595 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
19602 : see if this is a socks.h system
19603 set socks.h i_socks
19606 : check for type of the size argument to socket calls
19607 case "$d_socket" in
19611 Checking to see what type is the last argument of accept().
19614 case "$d_socklen_t" in
19615 "$define") yyy="$yyy socklen_t"
19617 yyy="$yyy $sizetype int long unsigned"
19618 for xxx in $yyy; do
19619 case "$socksizetype" in
19620 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
19621 case "$usesocks" in
19623 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
19624 echo "Your system accepts '$xxx *' for the last argument of accept()."
19625 socksizetype="$xxx"
19628 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
19629 echo "Your system accepts '$xxx *' for the last argument of accept()."
19630 socksizetype="$xxx"
19637 : In case none of those worked, prompt the user.
19638 case "$socksizetype" in
19639 '') rp='What is the type for socket address structure sizes?'
19646 *) : no sockets, so pick relatively harmless default
19651 : see what type is used for signed size_t
19652 set ssize_t ssizetype int stdio.h sys/types.h
19657 #$i_stdlib I_STDLIB
19659 #include <stdlib.h>
19661 #include <sys/types.h>
19662 #define Size_t $sizetype
19663 #define SSize_t $dflt
19666 if (sizeof(Size_t) == sizeof(SSize_t))
19668 else if (sizeof(Size_t) == sizeof(int))
19677 if eval $compile_ok && $run ./try > /dev/null; then
19678 ssizetype=`$run ./try`
19679 echo "I'll be using $ssizetype for functions returning a byte count." >&4
19682 Help! I can't compile and run the ssize_t test program: please enlighten me!
19683 (This is probably a misconfiguration in your system or libraries, and
19684 you really ought to fix it. Still, I'll try anyway.)
19686 I need a type that is the same size as $sizetype, but is guaranteed to
19687 be signed. Common values are ssize_t, int and long.
19690 rp="What signed type is the same size as $sizetype?"
19696 : see what type of char stdio uses.
19698 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
19699 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
19700 echo "Your stdio uses unsigned chars." >&4
19701 stdchar="unsigned char"
19703 echo "Your stdio uses signed chars." >&4
19710 : see what type uids are declared as in the kernel
19712 echo "Looking for the type for user ids returned by getuid()."
19713 set uid_t uidtype xxx stdio.h sys/types.h
19717 xxx=`./findhdr sys/user.h`
19718 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
19720 unsigned) dflt="$1 $2" ;;
19724 *) dflt="$uidtype";;
19727 uid_t) echo "uid_t found." ;;
19728 *) rp="What is the type for user ids returned by getuid()?"
19736 *_t) zzz="$uidtype" ;;
19739 echo "Checking the size of $zzz..." >&4
19741 #include <sys/types.h>
19743 #$i_stdlib I_STDLIB
19745 #include <stdlib.h>
19748 printf("%d\n", (int)sizeof($uidtype));
19753 if eval $compile_ok; then
19757 echo "(I can't execute the test program--guessing $uidsize.)" >&4
19760 echo "Your $zzz is $uidsize bytes long."
19765 echo "(I can't compile the test program--guessing $uidsize.)" >&4
19770 *_t) zzz="$uidtype" ;;
19773 echo "Checking the sign of $zzz..." >&4
19775 #include <sys/types.h>
19786 if eval $compile; then
19790 echo "(I can't execute the test program--guessing unsigned.)" >&4
19794 1) echo "Your $zzz is unsigned." ;;
19795 -1) echo "Your $zzz is signed." ;;
19801 echo "(I can't compile the test program--guessing unsigned.)" >&4
19807 $echo "Checking the format string to be used for uids..." >&4
19810 -1) if $test X"$uidsize" = X"$ivsize"; then
19811 uidformat="$ivdformat"
19813 if $test X"$uidsize" = X"$longsize"; then
19816 if $test X"$uidsize" = X"$intsize"; then
19819 if $test X"$uidsize" = X"$shortsize"; then
19826 *) if $test X"$uidsize" = X"$uvsize"; then
19827 uidformat="$uvuformat"
19829 if $test X"$uidsize" = X"$longsize"; then
19832 if $test X"$uidsize" = X"$intsize"; then
19835 if $test X"$uidsize" = X"$shortsize"; then
19845 case "$usesitecustomize" in
19846 $define|true|[Yy]*)
19847 usesitecustomize="$define"
19850 usesitecustomize="$undef"
19854 : determine compiler compiler
19863 if $test -f "$byacc$_exe"; then
19865 comp="byacc or $comp"
19867 if $test -f "$bison$_exe"; then
19868 comp="$comp or bison -y"
19870 rp="Which compiler compiler ($comp) shall I use?"
19879 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
19885 : see if this is a fp.h system
19889 : see if this is a fp_class.h system
19890 set fp_class.h i_fp_class
19893 : see if this is a ieeefp.h system
19894 case "$i_ieeefp" in
19895 '' ) set ieeefp.h i_ieeefp
19900 : see if this is a libutil.h system
19901 set libutil.h i_libutil
19904 : see if mach cthreads are available
19905 if test "X$usethreads" = "X$define"; then
19906 set mach/cthreads.h i_machcthr
19909 i_machcthr="$undef"
19914 : see if this is a mntent.h system
19915 set mntent.h i_mntent
19918 : see if ndbm.h is available
19924 # Some Linux distributions such as RedHat 7.1 put the
19925 # ndbm.h header in /usr/include/gdbm/ndbm.h.
19926 if $test -f /usr/include/gdbm/ndbm.h; then
19927 echo '<gdbm/ndbm.h> found.'
19928 ccflags="$ccflags -I/usr/include/gdbm"
19929 cppflags="$cppflags -I/usr/include/gdbm"
19937 : see if dbm_open exists
19938 set dbm_open d_dbm_open
19940 case "$d_dbm_open" in
19943 echo "We won't be including <ndbm.h>"
19952 : see if net/errno.h is available
19954 set net/errno.h val
19957 : Unfortunately, it causes problems on some systems. Arrgh.
19960 cat > try.c <<'EOM'
19963 #include <net/errno.h>
19969 if $cc $ccflags -c try.c >/dev/null 2>&1; then
19970 echo "We'll be including <net/errno.h>." >&4
19972 echo "We won't be including <net/errno.h>." >&4
19981 : see if netinet/tcp.h is available
19982 set netinet/tcp.h i_netinettcp
19985 : see if this is a poll.h system
19989 : see if this is a prot.h system
19994 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
19995 $cat <<'EOSH' > Cppsym.know
19996 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
19997 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
19998 alliant alpha am29000 AM29000 AMD64 amiga AMIGAOS AMIX
19999 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
20000 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
20001 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
20002 bull c cadmus clipper CMU COFF COMPILER_VERSION
20003 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
20004 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
20005 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
20006 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
20008 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
20009 H3050R H3050RX hbullx20 hcx host_mips
20010 hp200 hp300 hp700 HP700 hp800 hp9000
20011 hp9000s200 hp9000s300 hp9000s400 hp9000s500
20012 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
20013 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
20014 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
20015 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
20016 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
20017 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
20018 Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
20019 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
20020 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
20021 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
20022 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
20023 MATH_HAS_NO_SIDE_EFFECTS
20024 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
20025 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
20026 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
20027 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
20028 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
20029 NetBSD news1500 news1700 news1800 news1900 news3700
20030 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
20031 ns32016 ns32332 ns32k nsc32000
20032 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
20033 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
20034 pc532 pdp11 PGC PIC plexus PORTAR posix
20035 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
20036 POSIX_C_SOURCE POSIX_SOURCE POWER
20037 PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
20038 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
20039 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
20040 sony sony_news sonyrisc sparc sparclite spectrum
20041 stardent stdc STDC_EXT stratos sun sun3 sun386
20042 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
20043 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
20044 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
20045 sysV68 sysV88 Tek4132 Tek4300 titan
20046 TM3200 TM5400 TM5600
20047 tower tower32 tower32_200 tower32_600 tower32_700
20048 tower32_800 tower32_850 tss
20049 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
20050 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
20051 unix UNIX95 UNIX99 unixpc unos
20052 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
20053 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
20054 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
20056 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms xenix Xenix286
20057 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
20058 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
20061 # Maybe put other stuff here too.
20062 cat <<EOSH >>Cppsym.know
20065 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
20066 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
20067 $cat Cppsym.know > Cppsym.c
20068 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
20069 $rm -f Cppsym.a Cppsym.b Cppsym.c
20070 cat <<EOSH > Cppsym
20072 if $test \$# -gt 0; then
20073 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
20074 if $test -s Cppsym.got; then
20081 $tr " " "$trnl" | ./Cppsym.try
20087 cat <<EOSH > Cppsym.try
20089 cat <<'EOCP' > try.c
20095 cat <<'EOSH' >> Cppsym.try
20097 printf "#ifdef %s\n#if %s+0\nprintf(\"%s=%%ld\\n\", (long)%s);\n#else\nprintf(\"%s\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1
20098 printf "#ifdef _%s\n#if _%s+0\nprintf(\"_%s=%%ld\\n\", (long)_%s);\n#else\nprintf(\"_%s\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1
20099 printf "#ifdef __%s\n#if __%s+0\nprintf(\"__%s=%%ld\\n\", (long)__%s);\n#else\nprintf(\"__%s\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1
20100 printf "#ifdef __%s__\n#if __%s__+0\nprintf(\"__%s__=%%ld\\n\", (long)__%s__);\n#else\nprintf(\"__%s__\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1
20102 echo 'return 0;}' >> try.c
20104 cat <<EOSH >> Cppsym.try
20106 case "$osname-$gccversion" in
20107 irix-) ccflags="\$ccflags -woff 1178" ;;
20108 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
20110 $cc -o try $optimize \$ccflags $ldflags try.c $libs && $run ./try
20112 chmod +x Cppsym.try
20113 $eunicefix Cppsym.try
20114 ./Cppsym < Cppsym.know > Cppsym.true
20115 : now check the C compiler for additional symbols
20116 postprocess_cc_v=''
20118 aix) postprocess_cc_v="|$tr , ' '" ;;
20125 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
20128 -D*) echo "\$i" | $sed 's/^-D//';;
20129 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
20134 postprocess_cc_v=''
20137 ./ccsym > ccsym1.raw
20138 if $test -s ccsym1.raw; then
20139 $sort ccsym1.raw | $uniq >ccsym.raw
20141 mv ccsym1.raw ccsym.raw
20144 $awk '/\=/ { print $0; next }
20145 { print $0"=1" }' ccsym.raw >ccsym.list
20146 $awk '/\=/ { print $0; next }
20147 { print $0"=1" }' Cppsym.true >ccsym.true
20148 $comm -13 ccsym.true ccsym.list >ccsym.own
20149 $comm -12 ccsym.true ccsym.list >ccsym.com
20150 $comm -23 ccsym.true ccsym.list >ccsym.cpp
20152 if $test -z ccsym.raw; then
20153 echo "Your C compiler doesn't seem to define any symbols!" >&4
20155 echo "However, your C preprocessor defines the following symbols:"
20158 cppsymbols=`$cat Cppsym.true`
20159 cppsymbols=`echo $cppsymbols`
20160 cppccsymbols="$cppsymbols"
20162 if $test -s ccsym.com; then
20163 echo "Your C compiler and pre-processor define these symbols:"
20164 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
20167 cppccsymbols=`$cat ccsym.com`
20168 cppccsymbols=`echo $cppccsymbols`
20169 $test "$silent" || sleep 1
20171 if $test -s ccsym.cpp; then
20172 $test "$also" && echo " "
20173 echo "Your C pre-processor ${also}defines the following symbols:"
20174 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
20176 cppsymbols=`$cat ccsym.cpp`
20177 cppsymbols=`echo $cppsymbols`
20178 $test "$silent" || sleep 1
20180 if $test -s ccsym.own; then
20181 $test "$also" && echo " "
20182 echo "Your C compiler ${also}defines the following cpp symbols:"
20183 $sed -e 's/\(..*\)=1/\1/' ccsym.own
20184 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
20185 ccsymbols=`$cat ccsym.own`
20186 ccsymbols=`echo $ccsymbols`
20187 $test "$silent" || sleep 1
20191 : see if this is a termio system
20195 if $test `./findhdr termios.h`; then
20196 set tcsetattr i_termios
20202 "$define") echo "You have POSIX termios.h... good!" >&4;;
20203 *) if ./Cppsym pyr; then
20204 case "`/bin/universe`" in
20205 ucb) if $test `./findhdr sgtty.h`; then
20207 echo "<sgtty.h> found." >&4
20209 echo "System is pyramid with BSD universe."
20210 echo "<sgtty.h> not found--you could have problems." >&4
20212 *) if $test `./findhdr termio.h`; then
20214 echo "<termio.h> found." >&4
20216 echo "System is pyramid with USG universe."
20217 echo "<termio.h> not found--you could have problems." >&4
20221 if $test `./findhdr termio.h`; then
20222 echo "<termio.h> found." >&4
20224 elif $test `./findhdr sgtty.h`; then
20225 echo "<sgtty.h> found." >&4
20228 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
20231 if $test `./findhdr sgtty.h`; then
20232 echo "<sgtty.h> found." >&4
20234 elif $test `./findhdr termio.h`; then
20235 echo "<termio.h> found." >&4
20238 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
20242 set i_termio; eval $setvar
20243 val=$val2; set i_sgtty; eval $setvar
20244 val=$val3; set i_termios; eval $setvar
20246 : see if stddef is available
20247 set stddef.h i_stddef
20250 : see if this is a sunmath.h system
20251 set sunmath.h i_sunmath
20254 : see if sys/access.h is available
20255 set sys/access.h i_sysaccess
20258 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
20259 set sys/filio.h i_sysfilio
20262 if $test `./findhdr sys/ioctl.h`; then
20264 echo '<sys/ioctl.h> found.' >&4
20267 if $test $i_sysfilio = "$define"; then
20268 echo '<sys/ioctl.h> NOT found.' >&4
20270 $test $i_sgtty = "$define" && xxx="sgtty.h"
20271 $test $i_termio = "$define" && xxx="termio.h"
20272 $test $i_termios = "$define" && xxx="termios.h"
20273 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
20279 : see if socket ioctl defs are in sys/sockio.h
20281 xxx=`./findhdr sys/sockio.h`
20282 if $test "$xxx"; then
20283 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
20285 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
20288 echo "No socket ioctls found in <sys/sockio.h>." >&4
20293 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
20300 : see if this is a syslog.h system
20301 set syslog.h i_syslog
20305 : see if this is a sys/mode.h system
20306 set sys/mode.h i_sysmode
20309 : see if sys/resource.h has to be included
20310 set sys/resource.h i_sysresrc
20313 : see if sys/security.h is available
20314 set sys/security.h i_syssecrt
20317 : see if this is a sys/statvfs.h system
20318 set sys/statvfs.h i_sysstatvfs
20321 : see if this is a sys/un.h system
20322 set sys/un.h i_sysun
20326 : see if this is a sys/utsname.h system
20327 set sys/utsname.h i_sysutsname
20330 : see if this is a syswait system
20331 set sys/wait.h i_syswait
20334 : see if this is a ustat.h system
20335 set ustat.h i_ustat
20338 : see if this is an utime system
20339 set utime.h i_utime
20342 : see if this is a values.h system
20343 set values.h i_values
20346 : see if this is a vfork system
20349 set vfork.h i_vfork
20357 : see if gdbm.h is available
20362 : see if gdbm_open exists
20363 set gdbm_open d_gdbm_open
20365 case "$d_gdbm_open" in
20368 echo "We won't be including <gdbm.h>"
20378 echo "Looking for extensions..." >&4
20379 : If we are using the old config.sh, known_extensions may contain
20380 : old or inaccurate or duplicate values.
20381 known_extensions=''
20382 nonxs_extensions=''
20383 : We do not use find because it might not be available.
20384 : We do not just use MANIFEST because the user may have dropped
20385 : some additional extensions into the source tree and expect them
20388 : Function to recursively find available extensions, ignoring DynaLoader
20389 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
20393 DynaLoader|dynaload) ;;
20395 if $test -f $xxx/$xxx.xs; then
20396 known_extensions="$known_extensions $1$xxx";
20397 elif $test -f $xxx/Makefile.PL; then
20398 nonxs_extensions="$nonxs_extensions $1$xxx";
20400 if $test -d $xxx -a $# -lt 10; then
20403 eval $find_extensions;
20415 eval $find_extensions
20416 # Special case: Add in threads/shared since it is not picked up by the
20417 # recursive find above (and adding in general recursive finding breaks
20418 # SDBM_File/sdbm). A.D. 10/25/2001.
20419 known_extensions="$known_extensions threads/shared"
20420 set X $nonxs_extensions
20422 nonxs_extensions="$*"
20423 set X $known_extensions
20425 known_extensions="$*"
20428 : Now see which are supported on this system.
20430 for xxx in $known_extensions ; do
20434 $define) avail_ext="$avail_ext $xxx" ;;
20437 GDBM_File|gdbm_fil)
20439 $define) avail_ext="$avail_ext $xxx" ;;
20442 I18N/Langinfo|i18n_lan)
20443 case "$i_langinfo$d_nl_langinfo" in
20444 $define$define) avail_ext="$avail_ext $xxx" ;;
20447 NDBM_File|ndbm_fil)
20450 case "$osname-$use64bitint" in
20453 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
20456 *) avail_ext="$avail_ext $xxx" ;;
20461 ODBM_File|odbm_fil)
20462 case "${i_dbm}${i_rpcsvcdbm}" in
20464 case "$osname-$use64bitint" in
20467 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
20470 *) avail_ext="$avail_ext $xxx" ;;
20476 case "$useposix" in
20477 true|define|y) avail_ext="$avail_ext $xxx" ;;
20481 case "$useopcode" in
20482 true|define|y) avail_ext="$avail_ext $xxx" ;;
20486 case "$d_socket" in
20489 beos) ;; # not unless BONE
20490 *) avail_ext="$avail_ext $xxx" ;;
20495 Sys/Syslog|sys/syslog)
20496 : XXX syslog requires socket
20497 case "$d_socket" in
20498 true|$define|y) avail_ext="$avail_ext $xxx" ;;
20502 case "$usethreads" in
20504 case "$useithreads" in
20505 $undef|false|[nN]*) avail_ext="$avail_ext $xxx" ;;
20509 XS/APItest|xs/apitest)
20510 # This is just for testing. Skip it unless we have dynamic loading.
20513 $define) avail_ext="$avail_ext $xxx" ;;
20516 XS/Typemap|xs/typemap)
20517 # This is just for testing. Skip it unless we have dynamic loading.
20519 $define) avail_ext="$avail_ext $xxx" ;;
20522 threads|threads/shared)
20523 # threads and threads::shared are special cases.
20524 # To stop people from asking "Perl 5.8.0 was supposed
20525 # to have this new fancy threads implementation but my
20526 # perl doesn't have it" and from people trying to
20527 # (re)install the threads module using CPAN.pm and
20528 # CPAN.pm then offering to reinstall Perl 5.8.0,
20529 # the threads.pm and threads/shared.pm will always be
20530 # there, croaking informatively ("you need to rebuild
20531 # all of Perl with threads, sorry") when threads haven't
20532 # been compiled in.
20534 avail_ext="$avail_ext $xxx"
20537 : XXX Do we need a useipcsysv variable here
20538 case "${d_msg}${d_sem}${d_shm}" in
20539 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
20542 *) avail_ext="$avail_ext $xxx"
20551 case "$onlyextensions" in
20553 *) keepextensions=''
20554 echo "You have requested that only certains extensions be included..." >&4
20555 for i in $onlyextensions; do
20556 case " $avail_ext " in
20558 echo "Keeping extension $i."
20559 keepextensions="$keepextensions $i"
20561 *) echo "Ignoring extension $i." ;;
20564 avail_ext="$keepextensions"
20568 case "$noextensions" in
20570 *) keepextensions=''
20571 echo "You have requested that certain extensions be ignored..." >&4
20572 for i in $avail_ext; do
20573 case " $noextensions " in
20574 *" $i "*) echo "Ignoring extension $i." ;;
20575 *) echo "Keeping extension $i.";
20576 keepextensions="$keepextensions $i"
20580 avail_ext="$keepextensions"
20584 : Now see which nonxs extensions are supported on this system.
20585 : For now assume all are.
20587 for xxx in $nonxs_extensions ; do
20589 *) nonxs_ext="$nonxs_ext $xxx"
20601 A number of extensions are supplied with $package. You may choose to
20602 compile these extensions for dynamic loading (the default), compile
20603 them into the $package executable (static loading), or not include
20604 them at all. Answer "none" to include no extensions.
20605 Note that DynaLoader is always built and need not be mentioned here.
20608 case "$dynamic_ext" in
20610 : Exclude those listed in static_ext
20612 for xxx in $avail_ext; do
20613 case " $static_ext " in
20615 *) dflt="$dflt $xxx" ;;
20622 *) dflt="$dynamic_ext"
20623 # Perhaps we are reusing an old out-of-date config.sh.
20626 if test X"$dynamic_ext" != X"$avail_ext"; then
20628 NOTICE: Your previous config.sh list may be incorrect.
20629 The extensions now available to you are
20631 but the default list from your previous config.sh is
20643 rp="What extensions do you wish to load dynamically?"
20646 none) dynamic_ext=' ' ;;
20647 *) dynamic_ext="$ans" ;;
20650 case "$static_ext" in
20652 : Exclude those already listed in dynamic linking
20654 for xxx in $avail_ext; do
20655 case " $dynamic_ext " in
20657 *) dflt="$dflt $xxx" ;;
20664 *) dflt="$static_ext"
20671 rp="What extensions do you wish to load statically?"
20674 none) static_ext=' ' ;;
20675 *) static_ext="$ans" ;;
20680 A number of extensions are supplied with $package. Answer "none"
20681 to include no extensions.
20682 Note that DynaLoader is always built and need not be mentioned here.
20685 case "$static_ext" in
20686 '') dflt="$avail_ext" ;;
20687 *) dflt="$static_ext"
20688 # Perhaps we are reusing an old out-of-date config.sh.
20691 if test X"$static_ext" != X"$avail_ext"; then
20693 NOTICE: Your previous config.sh list may be incorrect.
20694 The extensions now available to you are
20696 but the default list from your previous config.sh is
20705 : Exclude those that are not xs extensions
20709 rp="What extensions do you wish to include?"
20712 none) static_ext=' ' ;;
20713 *) static_ext="$ans" ;;
20718 # Encode is a special case. If we are building Encode as a static
20719 # extension, we need to explicitly list its subextensions as well.
20720 # For other nested extensions, this is handled automatically by
20721 # the appropriate Makefile.PL.
20722 case " $static_ext " in
20723 *" Encode "*) # Add the subextensions of Encode
20725 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
20726 static_ext="$static_ext Encode/$xxx"
20732 set X $dynamic_ext $static_ext $nonxs_ext
20736 # Sanity check: We require an extension suitable for use with
20737 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
20738 # should show up as failures in the test suite, but it's helpful to
20739 # catch them now.) The 'extensions' list is normally sorted
20740 # alphabetically, so we need to accept either
20741 # DB_File ... Fcntl ... IO ....
20742 # or something like
20743 # Fcntl ... NDBM_File ... IO ....
20744 case " $extensions" in
20745 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
20746 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
20747 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
20748 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
20749 echo "WARNING: The Perl you are building will be quite crippled." >& 4
20753 : Remove libraries needed only for extensions
20754 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
20755 : The exception is SunOS 4.x, which needs them.
20756 case "${osname}X${osvers}" in
20760 *) case "$usedl" in
20761 $define|true|[yY]*)
20762 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
20766 *) perllibs="$libs"
20772 : Remove build directory name from cppstdin so it can be used from
20773 : either the present location or the final installed location.
20775 : Get out of the UU directory to get correct path name.
20777 case "$cppstdin" in
20779 echo "Stripping down cppstdin path name"
20785 : end of configuration questions
20787 echo "End of configuration questions."
20790 : back to where it started
20791 if test -d ../UU; then
20795 : configuration may be patched via a 'config.arch' file
20796 if $test -f config.arch; then
20797 echo "I see a config.arch file, loading it."
20801 : configuration may be patched via a 'config.over' file
20802 if $test -f config.over; then
20805 rp='I see a config.over file. Do you wish to load it?'
20808 n*) echo "OK, I'll ignore it.";;
20810 echo "Configuration override changes have been loaded."
20815 : in case they want portability, strip down executable paths
20816 case "$d_portable" in
20819 echo "Stripping down executable paths..." >&4
20820 for file in $loclist $trylist; do
20822 eval $file=`basename $temp`
20827 : create config.sh file
20829 echo "Creating config.sh..." >&4
20830 $spitshell <<EOT >config.sh
20833 # This file was produced by running the Configure script. It holds all the
20834 # definitions figured out by Configure. Should you modify one of these values,
20835 # do not forget to propagate your changes by running "Configure -der". You may
20836 # instead choose to run each of the .SH files by yourself, or "Configure -S".
20839 # Package name : $package
20840 # Source directory : $src
20841 # Configuration time: $cf_time
20842 # Configured by : $cf_by
20843 # Target system : $myuname
20853 Revision='$Revision'
20861 alignbytes='$alignbytes'
20862 ansi2knr='$ansi2knr'
20863 aphostname='$aphostname'
20864 api_revision='$api_revision'
20865 api_subversion='$api_subversion'
20866 api_version='$api_version'
20867 api_versionstring='$api_versionstring'
20870 archlibexp='$archlibexp'
20871 archname64='$archname64'
20872 archname='$archname'
20873 archobjs='$archobjs'
20874 asctime_r_proto='$asctime_r_proto'
20882 byteorder='$byteorder'
20884 castflags='$castflags'
20887 cccdlflags='$cccdlflags'
20888 ccdlflags='$ccdlflags'
20890 ccflags_uselargefiles='$ccflags_uselargefiles'
20892 ccsymbols='$ccsymbols'
20893 ccversion='$ccversion'
20895 cf_email='$cf_email'
20897 charsize='$charsize'
20901 clocktype='$clocktype'
20903 compress='$compress'
20904 contains='$contains'
20908 cpp_stuff='$cpp_stuff'
20909 cppccsymbols='$cppccsymbols'
20910 cppflags='$cppflags'
20912 cppminus='$cppminus'
20914 cppstdin='$cppstdin'
20915 cppsymbols='$cppsymbols'
20916 crypt_r_proto='$crypt_r_proto'
20917 cryptlib='$cryptlib'
20919 ctermid_r_proto='$ctermid_r_proto'
20920 ctime_r_proto='$ctime_r_proto'
20921 d_Gconvert='$d_Gconvert'
20922 d_PRIEUldbl='$d_PRIEUldbl'
20923 d_PRIFUldbl='$d_PRIFUldbl'
20924 d_PRIGUldbl='$d_PRIGUldbl'
20925 d_PRIXU64='$d_PRIXU64'
20926 d_PRId64='$d_PRId64'
20927 d_PRIeldbl='$d_PRIeldbl'
20928 d_PRIfldbl='$d_PRIfldbl'
20929 d_PRIgldbl='$d_PRIgldbl'
20930 d_PRIi64='$d_PRIi64'
20931 d_PRIo64='$d_PRIo64'
20932 d_PRIu64='$d_PRIu64'
20933 d_PRIx64='$d_PRIx64'
20934 d_SCNfldbl='$d_SCNfldbl'
20935 d__fwalk='$d__fwalk'
20936 d_access='$d_access'
20937 d_accessx='$d_accessx'
20940 d_archlib='$d_archlib'
20941 d_asctime_r='$d_asctime_r'
20944 d_attribute_format='$d_attribute_format'
20945 d_attribute_malloc='$d_attribute_malloc'
20946 d_attribute_nonnull='$d_attribute_nonnull'
20947 d_attribute_noreturn='$d_attribute_noreturn'
20948 d_attribute_pure='$d_attribute_pure'
20949 d_attribute_unused='$d_attribute_unused'
20950 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
20954 d_bsdgetpgrp='$d_bsdgetpgrp'
20955 d_bsdsetpgrp='$d_bsdsetpgrp'
20957 d_casti32='$d_casti32'
20958 d_castneg='$d_castneg'
20959 d_charvspr='$d_charvspr'
20961 d_chroot='$d_chroot'
20962 d_chsize='$d_chsize'
20964 d_closedir='$d_closedir'
20965 d_cmsghdr_s='$d_cmsghdr_s'
20967 d_copysignl='$d_copysignl'
20969 d_crypt_r='$d_crypt_r'
20971 d_ctermid_r='$d_ctermid_r'
20972 d_ctime_r='$d_ctime_r'
20973 d_cuserid='$d_cuserid'
20974 d_dbl_dig='$d_dbl_dig'
20975 d_dbminitproto='$d_dbminitproto'
20976 d_difftime='$d_difftime'
20978 d_dirnamlen='$d_dirnamlen'
20979 d_dlerror='$d_dlerror'
20980 d_dlopen='$d_dlopen'
20981 d_dlsymun='$d_dlsymun'
20982 d_dosuid='$d_dosuid'
20983 d_drand48_r='$d_drand48_r'
20984 d_drand48proto='$d_drand48proto'
20986 d_eaccess='$d_eaccess'
20987 d_endgrent='$d_endgrent'
20988 d_endgrent_r='$d_endgrent_r'
20989 d_endhent='$d_endhent'
20990 d_endhostent_r='$d_endhostent_r'
20991 d_endnent='$d_endnent'
20992 d_endnetent_r='$d_endnetent_r'
20993 d_endpent='$d_endpent'
20994 d_endprotoent_r='$d_endprotoent_r'
20995 d_endpwent='$d_endpwent'
20996 d_endpwent_r='$d_endpwent_r'
20997 d_endsent='$d_endsent'
20998 d_endservent_r='$d_endservent_r'
20999 d_eofnblk='$d_eofnblk'
21000 d_eunice='$d_eunice'
21001 d_faststdio='$d_faststdio'
21002 d_fchdir='$d_fchdir'
21003 d_fchmod='$d_fchmod'
21004 d_fchown='$d_fchown'
21006 d_fcntl_can_lock='$d_fcntl_can_lock'
21007 d_fd_macros='$d_fd_macros'
21008 d_fd_set='$d_fd_set'
21009 d_fds_bits='$d_fds_bits'
21010 d_fgetpos='$d_fgetpos'
21011 d_finite='$d_finite'
21012 d_finitel='$d_finitel'
21013 d_flexfnam='$d_flexfnam'
21015 d_flockproto='$d_flockproto'
21017 d_fp_class='$d_fp_class'
21018 d_fpathconf='$d_fpathconf'
21019 d_fpclass='$d_fpclass'
21020 d_fpclassify='$d_fpclassify'
21021 d_fpclassl='$d_fpclassl'
21022 d_fpos64_t='$d_fpos64_t'
21023 d_frexpl='$d_frexpl'
21024 d_fs_data_s='$d_fs_data_s'
21025 d_fseeko='$d_fseeko'
21026 d_fsetpos='$d_fsetpos'
21027 d_fstatfs='$d_fstatfs'
21028 d_fstatvfs='$d_fstatvfs'
21030 d_ftello='$d_ftello'
21032 d_getcwd='$d_getcwd'
21033 d_getespwnam='$d_getespwnam'
21034 d_getfsstat='$d_getfsstat'
21035 d_getgrent='$d_getgrent'
21036 d_getgrent_r='$d_getgrent_r'
21037 d_getgrgid_r='$d_getgrgid_r'
21038 d_getgrnam_r='$d_getgrnam_r'
21039 d_getgrps='$d_getgrps'
21040 d_gethbyaddr='$d_gethbyaddr'
21041 d_gethbyname='$d_gethbyname'
21042 d_gethent='$d_gethent'
21043 d_gethname='$d_gethname'
21044 d_gethostbyaddr_r='$d_gethostbyaddr_r'
21045 d_gethostbyname_r='$d_gethostbyname_r'
21046 d_gethostent_r='$d_gethostent_r'
21047 d_gethostprotos='$d_gethostprotos'
21048 d_getitimer='$d_getitimer'
21049 d_getlogin='$d_getlogin'
21050 d_getlogin_r='$d_getlogin_r'
21051 d_getmnt='$d_getmnt'
21052 d_getmntent='$d_getmntent'
21053 d_getnbyaddr='$d_getnbyaddr'
21054 d_getnbyname='$d_getnbyname'
21055 d_getnent='$d_getnent'
21056 d_getnetbyaddr_r='$d_getnetbyaddr_r'
21057 d_getnetbyname_r='$d_getnetbyname_r'
21058 d_getnetent_r='$d_getnetent_r'
21059 d_getnetprotos='$d_getnetprotos'
21060 d_getpagsz='$d_getpagsz'
21061 d_getpbyname='$d_getpbyname'
21062 d_getpbynumber='$d_getpbynumber'
21063 d_getpent='$d_getpent'
21064 d_getpgid='$d_getpgid'
21065 d_getpgrp2='$d_getpgrp2'
21066 d_getpgrp='$d_getpgrp'
21067 d_getppid='$d_getppid'
21068 d_getprior='$d_getprior'
21069 d_getprotobyname_r='$d_getprotobyname_r'
21070 d_getprotobynumber_r='$d_getprotobynumber_r'
21071 d_getprotoent_r='$d_getprotoent_r'
21072 d_getprotoprotos='$d_getprotoprotos'
21073 d_getprpwnam='$d_getprpwnam'
21074 d_getpwent='$d_getpwent'
21075 d_getpwent_r='$d_getpwent_r'
21076 d_getpwnam_r='$d_getpwnam_r'
21077 d_getpwuid_r='$d_getpwuid_r'
21078 d_getsbyname='$d_getsbyname'
21079 d_getsbyport='$d_getsbyport'
21080 d_getsent='$d_getsent'
21081 d_getservbyname_r='$d_getservbyname_r'
21082 d_getservbyport_r='$d_getservbyport_r'
21083 d_getservent_r='$d_getservent_r'
21084 d_getservprotos='$d_getservprotos'
21085 d_getspnam='$d_getspnam'
21086 d_getspnam_r='$d_getspnam_r'
21087 d_gettimeod='$d_gettimeod'
21088 d_gmtime_r='$d_gmtime_r'
21089 d_gnulibc='$d_gnulibc'
21090 d_grpasswd='$d_grpasswd'
21091 d_hasmntopt='$d_hasmntopt'
21093 d_ilogbl='$d_ilogbl'
21095 d_inetaton='$d_inetaton'
21096 d_int64_t='$d_int64_t'
21097 d_isascii='$d_isascii'
21098 d_isfinite='$d_isfinite'
21101 d_isnanl='$d_isnanl'
21102 d_killpg='$d_killpg'
21103 d_lchown='$d_lchown'
21104 d_ldbl_dig='$d_ldbl_dig'
21105 d_libm_lib_version='$d_libm_lib_version'
21107 d_localtime_r='$d_localtime_r'
21108 d_locconv='$d_locconv'
21110 d_longdbl='$d_longdbl'
21111 d_longlong='$d_longlong'
21112 d_lseekproto='$d_lseekproto'
21114 d_madvise='$d_madvise'
21116 d_mbstowcs='$d_mbstowcs'
21117 d_mbtowc='$d_mbtowc'
21118 d_memchr='$d_memchr'
21119 d_memcmp='$d_memcmp'
21120 d_memcpy='$d_memcpy'
21121 d_memmove='$d_memmove'
21122 d_memset='$d_memset'
21124 d_mkdtemp='$d_mkdtemp'
21125 d_mkfifo='$d_mkfifo'
21126 d_mkstemp='$d_mkstemp'
21127 d_mkstemps='$d_mkstemps'
21128 d_mktime='$d_mktime'
21131 d_modfl_pow32_bug='$d_modfl_pow32_bug'
21132 d_modflproto='$d_modflproto'
21133 d_mprotect='$d_mprotect'
21135 d_msg_ctrunc='$d_msg_ctrunc'
21136 d_msg_dontroute='$d_msg_dontroute'
21137 d_msg_oob='$d_msg_oob'
21138 d_msg_peek='$d_msg_peek'
21139 d_msg_proxy='$d_msg_proxy'
21140 d_msgctl='$d_msgctl'
21141 d_msgget='$d_msgget'
21142 d_msghdr_s='$d_msghdr_s'
21143 d_msgrcv='$d_msgrcv'
21144 d_msgsnd='$d_msgsnd'
21146 d_munmap='$d_munmap'
21147 d_mymalloc='$d_mymalloc'
21149 d_nl_langinfo='$d_nl_langinfo'
21150 d_nv_preserves_uv='$d_nv_preserves_uv'
21151 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
21152 d_off64_t='$d_off64_t'
21153 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
21154 d_oldpthreads='$d_oldpthreads'
21155 d_oldsock='$d_oldsock'
21157 d_pathconf='$d_pathconf'
21159 d_perl_otherlibdirs='$d_perl_otherlibdirs'
21160 d_phostname='$d_phostname'
21163 d_portable='$d_portable'
21164 d_procselfexe='$d_procselfexe'
21165 d_pthread_atfork='$d_pthread_atfork'
21166 d_pthread_attr_setscope='$d_pthread_attr_setscope'
21167 d_pthread_yield='$d_pthread_yield'
21169 d_pwchange='$d_pwchange'
21170 d_pwclass='$d_pwclass'
21171 d_pwcomment='$d_pwcomment'
21172 d_pwexpire='$d_pwexpire'
21173 d_pwgecos='$d_pwgecos'
21174 d_pwpasswd='$d_pwpasswd'
21175 d_pwquota='$d_pwquota'
21178 d_random_r='$d_random_r'
21179 d_readdir64_r='$d_readdir64_r'
21180 d_readdir='$d_readdir'
21181 d_readdir_r='$d_readdir_r'
21182 d_readlink='$d_readlink'
21184 d_recvmsg='$d_recvmsg'
21185 d_rename='$d_rename'
21186 d_rewinddir='$d_rewinddir'
21188 d_safebcpy='$d_safebcpy'
21189 d_safemcpy='$d_safemcpy'
21190 d_sanemcmp='$d_sanemcmp'
21191 d_sbrkproto='$d_sbrkproto'
21192 d_scalbnl='$d_scalbnl'
21193 d_sched_yield='$d_sched_yield'
21194 d_scm_rights='$d_scm_rights'
21195 d_seekdir='$d_seekdir'
21196 d_select='$d_select'
21198 d_semctl='$d_semctl'
21199 d_semctl_semid_ds='$d_semctl_semid_ds'
21200 d_semctl_semun='$d_semctl_semun'
21201 d_semget='$d_semget'
21203 d_sendmsg='$d_sendmsg'
21204 d_setegid='$d_setegid'
21205 d_seteuid='$d_seteuid'
21206 d_setgrent='$d_setgrent'
21207 d_setgrent_r='$d_setgrent_r'
21208 d_setgrps='$d_setgrps'
21209 d_sethent='$d_sethent'
21210 d_sethostent_r='$d_sethostent_r'
21211 d_setitimer='$d_setitimer'
21212 d_setlinebuf='$d_setlinebuf'
21213 d_setlocale='$d_setlocale'
21214 d_setlocale_r='$d_setlocale_r'
21215 d_setnent='$d_setnent'
21216 d_setnetent_r='$d_setnetent_r'
21217 d_setpent='$d_setpent'
21218 d_setpgid='$d_setpgid'
21219 d_setpgrp2='$d_setpgrp2'
21220 d_setpgrp='$d_setpgrp'
21221 d_setprior='$d_setprior'
21222 d_setproctitle='$d_setproctitle'
21223 d_setprotoent_r='$d_setprotoent_r'
21224 d_setpwent='$d_setpwent'
21225 d_setpwent_r='$d_setpwent_r'
21226 d_setregid='$d_setregid'
21227 d_setresgid='$d_setresgid'
21228 d_setresuid='$d_setresuid'
21229 d_setreuid='$d_setreuid'
21230 d_setrgid='$d_setrgid'
21231 d_setruid='$d_setruid'
21232 d_setsent='$d_setsent'
21233 d_setservent_r='$d_setservent_r'
21234 d_setsid='$d_setsid'
21235 d_setvbuf='$d_setvbuf'
21239 d_shmatprototype='$d_shmatprototype'
21240 d_shmctl='$d_shmctl'
21242 d_shmget='$d_shmget'
21243 d_sigaction='$d_sigaction'
21244 d_sigprocmask='$d_sigprocmask'
21245 d_sigsetjmp='$d_sigsetjmp'
21246 d_sockatmark='$d_sockatmark'
21247 d_sockatmarkproto='$d_sockatmarkproto'
21248 d_socket='$d_socket'
21249 d_socklen_t='$d_socklen_t'
21250 d_sockpair='$d_sockpair'
21251 d_socks5_init='$d_socks5_init'
21253 d_srand48_r='$d_srand48_r'
21254 d_srandom_r='$d_srandom_r'
21255 d_sresgproto='$d_sresgproto'
21256 d_sresuproto='$d_sresuproto'
21257 d_statblks='$d_statblks'
21258 d_statfs_f_flags='$d_statfs_f_flags'
21259 d_statfs_s='$d_statfs_s'
21260 d_statvfs='$d_statvfs'
21261 d_stdio_cnt_lval='$d_stdio_cnt_lval'
21262 d_stdio_ptr_lval='$d_stdio_ptr_lval'
21263 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
21264 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
21265 d_stdio_stream_array='$d_stdio_stream_array'
21266 d_stdiobase='$d_stdiobase'
21267 d_stdstdio='$d_stdstdio'
21268 d_strchr='$d_strchr'
21269 d_strcoll='$d_strcoll'
21270 d_strctcpy='$d_strctcpy'
21271 d_strerrm='$d_strerrm'
21272 d_strerror='$d_strerror'
21273 d_strerror_r='$d_strerror_r'
21274 d_strftime='$d_strftime'
21275 d_strlcat='$d_strlcat'
21276 d_strlcpy='$d_strlcpy'
21277 d_strtod='$d_strtod'
21278 d_strtol='$d_strtol'
21279 d_strtold='$d_strtold'
21280 d_strtoll='$d_strtoll'
21281 d_strtoq='$d_strtoq'
21282 d_strtoul='$d_strtoul'
21283 d_strtoull='$d_strtoull'
21284 d_strtouq='$d_strtouq'
21285 d_strxfrm='$d_strxfrm'
21286 d_suidsafe='$d_suidsafe'
21287 d_symlink='$d_symlink'
21288 d_syscall='$d_syscall'
21289 d_syscallproto='$d_syscallproto'
21290 d_sysconf='$d_sysconf'
21291 d_sysernlst='$d_sysernlst'
21292 d_syserrlst='$d_syserrlst'
21293 d_system='$d_system'
21294 d_tcgetpgrp='$d_tcgetpgrp'
21295 d_tcsetpgrp='$d_tcsetpgrp'
21296 d_telldir='$d_telldir'
21297 d_telldirproto='$d_telldirproto'
21300 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
21301 d_tm_tm_zone='$d_tm_tm_zone'
21302 d_tmpnam_r='$d_tmpnam_r'
21303 d_truncate='$d_truncate'
21304 d_ttyname_r='$d_ttyname_r'
21305 d_tzname='$d_tzname'
21306 d_u32align='$d_u32align'
21307 d_ualarm='$d_ualarm'
21310 d_union_semun='$d_union_semun'
21311 d_unordered='$d_unordered'
21312 d_usleep='$d_usleep'
21313 d_usleepproto='$d_usleepproto'
21315 d_vendorarch='$d_vendorarch'
21316 d_vendorbin='$d_vendorbin'
21317 d_vendorlib='$d_vendorlib'
21318 d_vendorscript='$d_vendorscript'
21320 d_void_closedir='$d_void_closedir'
21321 d_voidsig='$d_voidsig'
21322 d_voidtty='$d_voidtty'
21323 d_volatile='$d_volatile'
21324 d_vprintf='$d_vprintf'
21326 d_waitpid='$d_waitpid'
21327 d_wcstombs='$d_wcstombs'
21328 d_wctomb='$d_wctomb'
21329 d_writev='$d_writev'
21332 db_hashtype='$db_hashtype'
21333 db_prefixtype='$db_prefixtype'
21334 db_version_major='$db_version_major'
21335 db_version_minor='$db_version_minor'
21336 db_version_patch='$db_version_patch'
21337 defvoidused='$defvoidused'
21338 direntrytype='$direntrytype'
21341 doublesize='$doublesize'
21343 drand48_r_proto='$drand48_r_proto'
21344 dynamic_ext='$dynamic_ext'
21350 endgrent_r_proto='$endgrent_r_proto'
21351 endhostent_r_proto='$endhostent_r_proto'
21352 endnetent_r_proto='$endnetent_r_proto'
21353 endprotoent_r_proto='$endprotoent_r_proto'
21354 endpwent_r_proto='$endpwent_r_proto'
21355 endservent_r_proto='$endservent_r_proto'
21356 eunicefix='$eunicefix'
21359 extensions='$extensions'
21361 fflushNULL='$fflushNULL'
21362 fflushall='$fflushall'
21364 firstmakefile='$firstmakefile'
21366 fpossize='$fpossize'
21367 fpostype='$fpostype'
21368 freetype='$freetype'
21371 full_csh='$full_csh'
21372 full_sed='$full_sed'
21373 gccansipedantic='$gccansipedantic'
21374 gccosandvers='$gccosandvers'
21375 gccversion='$gccversion'
21376 getgrent_r_proto='$getgrent_r_proto'
21377 getgrgid_r_proto='$getgrgid_r_proto'
21378 getgrnam_r_proto='$getgrnam_r_proto'
21379 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
21380 gethostbyname_r_proto='$gethostbyname_r_proto'
21381 gethostent_r_proto='$gethostent_r_proto'
21382 getlogin_r_proto='$getlogin_r_proto'
21383 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
21384 getnetbyname_r_proto='$getnetbyname_r_proto'
21385 getnetent_r_proto='$getnetent_r_proto'
21386 getprotobyname_r_proto='$getprotobyname_r_proto'
21387 getprotobynumber_r_proto='$getprotobynumber_r_proto'
21388 getprotoent_r_proto='$getprotoent_r_proto'
21389 getpwent_r_proto='$getpwent_r_proto'
21390 getpwnam_r_proto='$getpwnam_r_proto'
21391 getpwuid_r_proto='$getpwuid_r_proto'
21392 getservbyname_r_proto='$getservbyname_r_proto'
21393 getservbyport_r_proto='$getservbyport_r_proto'
21394 getservent_r_proto='$getservent_r_proto'
21395 getspnam_r_proto='$getspnam_r_proto'
21396 gidformat='$gidformat'
21402 gmtime_r_proto='$gmtime_r_proto'
21403 gnulibc_version='$gnulibc_version'
21405 groupcat='$groupcat'
21406 groupstype='$groupstype'
21409 h_sysfile='$h_sysfile'
21412 html1dir='$html1dir'
21413 html1direxp='$html1direxp'
21414 html3dir='$html3dir'
21415 html3direxp='$html3direxp'
21424 i_arpainet='$i_arpainet'
21425 i_bsdioctl='$i_bsdioctl'
21429 i_dirent='$i_dirent'
21435 i_fp_class='$i_fp_class'
21438 i_ieeefp='$i_ieeefp'
21439 i_inttypes='$i_inttypes'
21440 i_langinfo='$i_langinfo'
21441 i_libutil='$i_libutil'
21442 i_limits='$i_limits'
21443 i_locale='$i_locale'
21444 i_machcthr='$i_machcthr'
21445 i_malloc='$i_malloc'
21447 i_memory='$i_memory'
21448 i_mntent='$i_mntent'
21451 i_neterrno='$i_neterrno'
21452 i_netinettcp='$i_netinettcp'
21456 i_pthread='$i_pthread'
21458 i_rpcsvcdbm='$i_rpcsvcdbm'
21461 i_shadow='$i_shadow'
21463 i_stdarg='$i_stdarg'
21464 i_stddef='$i_stddef'
21465 i_stdlib='$i_stdlib'
21466 i_string='$i_string'
21467 i_sunmath='$i_sunmath'
21468 i_sysaccess='$i_sysaccess'
21469 i_sysdir='$i_sysdir'
21470 i_sysfile='$i_sysfile'
21471 i_sysfilio='$i_sysfilio'
21473 i_sysioctl='$i_sysioctl'
21474 i_syslog='$i_syslog'
21475 i_sysmman='$i_sysmman'
21476 i_sysmode='$i_sysmode'
21477 i_sysmount='$i_sysmount'
21478 i_sysndir='$i_sysndir'
21479 i_sysparam='$i_sysparam'
21480 i_sysresrc='$i_sysresrc'
21481 i_syssecrt='$i_syssecrt'
21482 i_sysselct='$i_sysselct'
21483 i_syssockio='$i_syssockio'
21484 i_sysstat='$i_sysstat'
21485 i_sysstatfs='$i_sysstatfs'
21486 i_sysstatvfs='$i_sysstatvfs'
21487 i_systime='$i_systime'
21488 i_systimek='$i_systimek'
21489 i_systimes='$i_systimes'
21490 i_systypes='$i_systypes'
21491 i_sysuio='$i_sysuio'
21493 i_sysutsname='$i_sysutsname'
21494 i_sysvfs='$i_sysvfs'
21495 i_syswait='$i_syswait'
21496 i_termio='$i_termio'
21497 i_termios='$i_termios'
21499 i_unistd='$i_unistd'
21502 i_values='$i_values'
21503 i_varargs='$i_varargs'
21504 i_varhdr='$i_varhdr'
21506 ignore_versioned_solibs='$ignore_versioned_solibs'
21507 inc_version_list='$inc_version_list'
21508 inc_version_list_init='$inc_version_list_init'
21511 installarchlib='$installarchlib'
21512 installbin='$installbin'
21513 installhtml1dir='$installhtml1dir'
21514 installhtml3dir='$installhtml3dir'
21515 installman1dir='$installman1dir'
21516 installman3dir='$installman3dir'
21517 installprefix='$installprefix'
21518 installprefixexp='$installprefixexp'
21519 installprivlib='$installprivlib'
21520 installscript='$installscript'
21521 installsitearch='$installsitearch'
21522 installsitebin='$installsitebin'
21523 installsitehtml1dir='$installsitehtml1dir'
21524 installsitehtml3dir='$installsitehtml3dir'
21525 installsitelib='$installsitelib'
21526 installsiteman1dir='$installsiteman1dir'
21527 installsiteman3dir='$installsiteman3dir'
21528 installsitescript='$installsitescript'
21529 installstyle='$installstyle'
21530 installusrbinperl='$installusrbinperl'
21531 installvendorarch='$installvendorarch'
21532 installvendorbin='$installvendorbin'
21533 installvendorhtml1dir='$installvendorhtml1dir'
21534 installvendorhtml3dir='$installvendorhtml3dir'
21535 installvendorlib='$installvendorlib'
21536 installvendorman1dir='$installvendorman1dir'
21537 installvendorman3dir='$installvendorman3dir'
21538 installvendorscript='$installvendorscript'
21540 issymlink='$issymlink'
21541 ivdformat='$ivdformat'
21544 known_extensions='$known_extensions'
21547 lddlflags='$lddlflags'
21549 ldflags_uselargefiles='$ldflags_uselargefiles'
21550 ldlibpthname='$ldlibpthname'
21557 libsdirs='$libsdirs'
21558 libsfiles='$libsfiles'
21559 libsfound='$libsfound'
21560 libspath='$libspath'
21561 libswanted='$libswanted'
21562 libswanted_uselargefiles='$libswanted_uselargefiles'
21568 localtime_r_proto='$localtime_r_proto'
21569 locincpth='$locincpth'
21570 loclibpth='$loclibpth'
21571 longdblsize='$longdblsize'
21572 longlongsize='$longlongsize'
21573 longsize='$longsize'
21577 lseeksize='$lseeksize'
21578 lseektype='$lseektype'
21582 make_set_make='$make_set_make'
21583 mallocobj='$mallocobj'
21584 mallocsrc='$mallocsrc'
21585 malloctype='$malloctype'
21587 man1direxp='$man1direxp'
21590 man3direxp='$man3direxp'
21592 mips_type='$mips_type'
21593 mistrustnm='$mistrustnm'
21595 mmaptype='$mmaptype'
21596 modetype='$modetype'
21598 multiarch='$multiarch'
21600 myarchname='$myarchname'
21601 mydomain='$mydomain'
21602 myhostname='$myhostname'
21605 need_va_copy='$need_va_copy'
21606 netdb_hlen_type='$netdb_hlen_type'
21607 netdb_host_type='$netdb_host_type'
21608 netdb_name_type='$netdb_name_type'
21609 netdb_net_type='$netdb_net_type'
21612 nm_so_opt='$nm_so_opt'
21613 nonxs_ext='$nonxs_ext'
21615 nvEUformat='$nvEUformat'
21616 nvFUformat='$nvFUformat'
21617 nvGUformat='$nvGUformat'
21618 nv_preserves_uv_bits='$nv_preserves_uv_bits'
21619 nveformat='$nveformat'
21620 nvfformat='$nvfformat'
21621 nvgformat='$nvgformat'
21624 o_nonblock='$o_nonblock'
21626 old_pthread_create_joinable='$old_pthread_create_joinable'
21627 optimize='$optimize'
21628 orderlib='$orderlib'
21631 otherlibdirs='$otherlibdirs'
21635 patchlevel='$patchlevel'
21636 path_sep='$path_sep'
21639 perl_patchlevel='$perl_patchlevel'
21640 perladmin='$perladmin'
21641 perllibs='$perllibs'
21642 perlpath='$perlpath'
21644 phostname='$phostname'
21650 prefixexp='$prefixexp'
21652 privlibexp='$privlibexp'
21653 procselfexe='$procselfexe'
21654 prototype='$prototype'
21656 quadkind='$quadkind'
21657 quadtype='$quadtype'
21658 randbits='$randbits'
21659 randfunc='$randfunc'
21660 random_r_proto='$random_r_proto'
21661 randseedtype='$randseedtype'
21663 rd_nodata='$rd_nodata'
21664 readdir64_r_proto='$readdir64_r_proto'
21665 readdir_r_proto='$readdir_r_proto'
21666 revision='$revision'
21671 sPRIEUldbl='$sPRIEUldbl'
21672 sPRIFUldbl='$sPRIFUldbl'
21673 sPRIGUldbl='$sPRIGUldbl'
21674 sPRIXU64='$sPRIXU64'
21676 sPRIeldbl='$sPRIeldbl'
21677 sPRIfldbl='$sPRIfldbl'
21678 sPRIgldbl='$sPRIgldbl'
21683 sSCNfldbl='$sSCNfldbl'
21684 sched_yield='$sched_yield'
21685 scriptdir='$scriptdir'
21686 scriptdirexp='$scriptdirexp'
21688 seedfunc='$seedfunc'
21689 selectminbits='$selectminbits'
21690 selecttype='$selecttype'
21691 sendmail='$sendmail'
21692 setgrent_r_proto='$setgrent_r_proto'
21693 sethostent_r_proto='$sethostent_r_proto'
21694 setlocale_r_proto='$setlocale_r_proto'
21695 setnetent_r_proto='$setnetent_r_proto'
21696 setprotoent_r_proto='$setprotoent_r_proto'
21697 setpwent_r_proto='$setpwent_r_proto'
21698 setservent_r_proto='$setservent_r_proto'
21701 sharpbang='$sharpbang'
21702 shmattype='$shmattype'
21703 shortsize='$shortsize'
21706 sig_count='$sig_count'
21707 sig_name='$sig_name'
21708 sig_name_init='$sig_name_init'
21710 sig_num_init='$sig_num_init'
21711 sig_size='$sig_size'
21712 signal_t='$signal_t'
21713 sitearch='$sitearch'
21714 sitearchexp='$sitearchexp'
21716 sitebinexp='$sitebinexp'
21717 sitehtml1dir='$sitehtml1dir'
21718 sitehtml1direxp='$sitehtml1direxp'
21719 sitehtml3dir='$sitehtml3dir'
21720 sitehtml3direxp='$sitehtml3direxp'
21722 sitelib_stem='$sitelib_stem'
21723 sitelibexp='$sitelibexp'
21724 siteman1dir='$siteman1dir'
21725 siteman1direxp='$siteman1direxp'
21726 siteman3dir='$siteman3dir'
21727 siteman3direxp='$siteman3direxp'
21728 siteprefix='$siteprefix'
21729 siteprefixexp='$siteprefixexp'
21730 sitescript='$sitescript'
21731 sitescriptexp='$sitescriptexp'
21732 sizesize='$sizesize'
21733 sizetype='$sizetype'
21737 sockethdr='$sockethdr'
21738 socketlib='$socketlib'
21739 socksizetype='$socksizetype'
21741 spackage='$spackage'
21742 spitshell='$spitshell'
21743 srand48_r_proto='$srand48_r_proto'
21744 srandom_r_proto='$srandom_r_proto'
21746 ssizetype='$ssizetype'
21747 startperl='$startperl'
21749 static_ext='$static_ext'
21751 stdio_base='$stdio_base'
21752 stdio_bufsiz='$stdio_bufsiz'
21753 stdio_cnt='$stdio_cnt'
21754 stdio_filbuf='$stdio_filbuf'
21755 stdio_ptr='$stdio_ptr'
21756 stdio_stream_array='$stdio_stream_array'
21757 strerror_r_proto='$strerror_r_proto'
21760 subversion='$subversion'
21764 targetarch='$targetarch'
21768 timeincl='$timeincl'
21769 timetype='$timetype'
21770 tmpnam_r_proto='$tmpnam_r_proto'
21776 ttyname_r_proto='$ttyname_r_proto'
21785 uidformat='$uidformat'
21791 uquadtype='$uquadtype'
21792 use5005threads='$use5005threads'
21793 use64bitall='$use64bitall'
21794 use64bitint='$use64bitint'
21795 usecrosscompile='$usecrosscompile'
21797 usefaststdio='$usefaststdio'
21798 useithreads='$useithreads'
21799 uselargefiles='$uselargefiles'
21800 uselongdouble='$uselongdouble'
21801 usemallocwrap='$usemallocwrap'
21802 usemorebits='$usemorebits'
21803 usemultiplicity='$usemultiplicity'
21804 usemymalloc='$usemymalloc'
21806 useopcode='$useopcode'
21807 useperlio='$useperlio'
21808 useposix='$useposix'
21809 usereentrant='$usereentrant'
21810 userelocatableinc='$userelocatableinc'
21812 useshrplib='$useshrplib'
21813 usesitecustomize='$usesitecustomize'
21814 usesocks='$usesocks'
21815 usethreads='$usethreads'
21816 usevendorprefix='$usevendorprefix'
21817 usevfork='$usevfork'
21820 uvXUformat='$uvXUformat'
21821 uvoformat='$uvoformat'
21824 uvuformat='$uvuformat'
21825 uvxformat='$uvxformat'
21826 vendorarch='$vendorarch'
21827 vendorarchexp='$vendorarchexp'
21828 vendorbin='$vendorbin'
21829 vendorbinexp='$vendorbinexp'
21830 vendorhtml1dir='$vendorhtml1dir'
21831 vendorhtml1direxp='$vendorhtml1direxp'
21832 vendorhtml3dir='$vendorhtml3dir'
21833 vendorhtml3direxp='$vendorhtml3direxp'
21834 vendorlib='$vendorlib'
21835 vendorlib_stem='$vendorlib_stem'
21836 vendorlibexp='$vendorlibexp'
21837 vendorman1dir='$vendorman1dir'
21838 vendorman1direxp='$vendorman1direxp'
21839 vendorman3dir='$vendorman3dir'
21840 vendorman3direxp='$vendorman3direxp'
21841 vendorprefix='$vendorprefix'
21842 vendorprefixexp='$vendorprefixexp'
21843 vendorscript='$vendorscript'
21844 vendorscriptexp='$vendorscriptexp'
21846 version_patchlevel_string='$version_patchlevel_string'
21847 versiononly='$versiononly'
21849 voidflags='$voidflags'
21852 yaccflags='$yaccflags'
21857 : Add in command line options if available
21858 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
21860 : add special variables
21861 $test -f $src/patchlevel.h && \
21862 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
21863 echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
21864 echo "PERL_CONFIG_SH=true" >>config.sh
21866 : propagate old symbols
21867 if $test -f UU/config.sh; then
21868 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
21869 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
21870 $sort | $uniq -u >UU/oldsyms
21871 set X `cat UU/oldsyms`
21877 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
21879 echo "# Variables propagated from previous config.sh file." >>config.sh
21880 for sym in `cat UU/oldsyms`; do
21881 echo " Propagating $hint variable "'$'"$sym..."
21882 eval 'tmp="$'"${sym}"'"'
21884 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
21890 : Finish up by extracting the .SH files
21894 echo "Extraction done."
21904 If you'd like to make any changes to the config.sh file before I begin
21905 to configure things, do it as a shell escape now (e.g. !vi config.sh).
21908 rp="Press return or use a shell escape to edit config.sh:"
21913 *) : in case they cannot read
21914 sh 1>&4 -c "$ans";;
21919 : if this fails, just run all the .SH files by hand
21928 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
21935 Now you need to generate make dependencies by running "$make depend".
21936 You might prefer to run it in background: "$make depend > makedepend.out &"
21937 It can take a while, so you might not want to run it right now.
21942 rp="Run $make depend now?"
21946 $make depend && echo "Now you must run '$make'."
21949 echo "You must run '$make depend' then '$make'."
21952 elif test -f [Mm]akefile; then
21954 echo "Now you must run a $make."
21956 echo "Configure done."
21959 if $test -f Policy.sh; then
21962 If you compile $package on a different machine or from a different object
21963 directory, copy the Policy.sh file from this object directory to the
21964 new one before you run Configure -- this will help you with most of
21965 the policy defaults.
21969 if $test -f config.msg; then
21970 echo "Hmm. I also noted the following information while running:"
21972 $cat config.msg >&4
21975 $rm -f kit*isdone ark*isdone