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 Wed May 16 19:31:47 CEST 2007 [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 if test ! -c /dev/null ; then
71 *** I'm sorry, but /dev/null appears to be a file rather than a device.
72 *** Please consult your operating sytem's notes for making a device
74 *** Cannot continue, aborting.
80 : compute my invocation name
84 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
89 : Proper separator for the PATH environment variable
91 : On OS/2 this directory should exist if this is not floppy only system :-]
92 if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' ) 2>&1 >/dev/null ; then
93 if test -n "$OS2_SHELL"; then
95 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
96 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
98 elif test -n "$DJGPP"; then
99 case "X${MACHTYPE:-nonesuchmach}" in
106 : Proper PATH setting
107 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
108 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
109 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
110 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
111 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
112 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
113 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
114 paths="$paths /sbin /usr/sbin /usr/libexec"
115 paths="$paths /system/gnu_library/bin"
119 case "$p_$PATH$p_" in
121 *) test -d $p && PATH=$PATH$p_$p ;;
128 : shall we be using ksh?
134 if (PATH=.; alias -x) >/dev/null 2>&1; then
137 if test -f /hp-ux -a -f /bin/ksh; then
138 needksh='to avoid sh bug in "here document" expansion'
140 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
141 if test X`/usr/bin/uname -v` = X4; then
142 avoidksh="to avoid AIX 4's /bin/sh"
146 if test -f /osf_boot -a -f /usr/sbin/setld; then
147 if test X`/usr/bin/uname -s` = XOSF1; then
148 avoidksh="to avoid Digital UNIX' ksh"
150 unset BIN_SH # if this is 'xpg4' sh will start up ksh
153 case "$inksh/$needksh" in
160 case "$inksh/$avoidksh" in
166 case "$inksh/$needksh-$avoidksh-" in
169 (I see you are using the Korn shell. Some ksh's blow up on $me,
170 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
177 echo "(Feeding myself to $newsh $reason.)"
179 Configure|*/Configure) exec $newsh $0 "$@";;
180 *) exec $newsh Configure "$@";;
185 : if needed set CDPATH to a harmless value that is not chatty
186 : avoid bash 2.02 problems with empty CDPATH.
190 *bash*) CDPATH='.' ;;
195 : Configure runs within the UU subdirectory
196 test -d UU || mkdir UU
335 initialinstalllocation=''
363 d_attribute_format=''
364 d_attribute_malloc=''
365 d_attribute_nonnull=''
366 d_attribute_noreturn=''
368 d_attribute_unused=''
369 d_attribute_warn_unused_result=''
370 d_printf_format_null=''
373 d_builtin_choose_expr=''
376 d_c99_variadic_macros=''
423 endhostent_r_proto=''
429 endprotoent_r_proto=''
435 endservent_r_proto=''
487 gethostbyaddr_r_proto=''
489 gethostbyname_r_proto=''
491 gethostent_r_proto=''
503 getnetbyaddr_r_proto=''
505 getnetbyname_r_proto=''
519 d_getprotobyname_r=''
520 getprotobyname_r_proto=''
521 d_getprotobynumber_r=''
522 getprotobynumber_r_proto=''
524 getprotoent_r_proto=''
536 getservbyname_r_proto=''
538 getservbyport_r_proto=''
540 getservent_r_proto=''
564 d_libm_lib_version=''
567 d_localtime_r_needs_tzset=''
578 d_malloc_good_size=''
620 d_old_pthread_create_joinable=''
621 old_pthread_create_joinable=''
623 d_pthread_attr_setscope=''
662 sethostent_r_proto=''
679 setprotoent_r_proto=''
691 setservent_r_proto=''
725 d_sprintf_returns_strlen=''
740 d_stdio_ptr_lval_nochange_cnt=''
741 d_stdio_ptr_lval_sets_cnt=''
945 d_inc_version_list=''
947 inc_version_list_init=''
966 ignore_versioned_solibs=''
1030 d_perl_otherlibdirs=''
1038 api_versionstring=''
1044 version_patchlevel_string=''
1048 d_nv_preserves_uv=''
1049 d_nv_zero_is_allbits_zero=''
1060 nv_preserves_uv_bits=''
1132 installsitehtml1dir=''
1135 installsitehtml3dir=''
1142 installsiteman1dir=''
1145 installsiteman3dir=''
1150 installsitescript=''
1165 d_stdio_stream_array=''
1166 stdio_stream_array=''
1177 ccflags_uselargefiles=''
1178 ldflags_uselargefiles=''
1179 libswanted_uselargefiles=''
1199 installvendorarch=''
1206 installvendorhtml1dir=''
1208 vendorhtml1direxp=''
1209 installvendorhtml3dir=''
1211 vendorhtml3direxp=''
1217 installvendorman1dir=''
1220 installvendorman3dir=''
1227 installvendorscript=''
1239 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1242 : We must find out about Eunice early
1244 if test -f /etc/unixtovms; then
1245 eunicefix=/etc/unixtovms
1247 if test -f /etc/unixtovms.exe; then
1248 eunicefix=/etc/unixtovms.exe
1251 : Set executable suffix now -- needed before hints available
1252 if test -f "/libs/version.library"; then
1255 elif test -f "/system/gnu_library/bin/ar.pm"; then
1258 elif test -n "$DJGPP"; then
1261 elif test -d c:/. -o -n "$is_os2" ; then
1267 : Trailing extension. Override this in a hint file, if needed.
1268 : Extra object files, if any, needed on this platform.
1273 : change the next line if compiling for Xenix/286 on Xenix/386
1274 xlibpth='/usr/lib/386 /lib/386'
1275 : Possible local library directories to search.
1276 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1277 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1279 : general looking path for locating libraries
1280 glibpth="/lib /usr/lib $xlibpth"
1281 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1282 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1283 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1284 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1286 : Private path used by Configure to find libraries. Its value
1287 : is prepended to libpth. This variable takes care of special
1288 : machines, like the mips. Usually, it should be empty.
1291 : default library list
1293 : some systems want to use only the non-versioned libso:s
1294 ignore_versioned_solibs=''
1298 : set usethreads on the Configure command line to enable threads.
1299 usereentrant='undef'
1300 : full support for void wanted by default
1303 : Possible local include directories to search.
1304 : Set locincpth to "" in a hint file to defeat local include searches.
1305 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1306 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1308 : no include file wanted by default
1311 : Enable -DEBUGGING and -DDEBUGGING from the command line
1318 : set useposix=false in your hint file to disable the POSIX extension.
1320 : set useopcode=false in your hint file to disable the Opcode extension.
1323 ccflags_uselargefiles=''
1324 ldflags_uselargefiles=''
1325 libswanted_uselargefiles=''
1326 : set usemultiplicity on the Configure command line to enable multiplicity.
1327 : set usesocks on the Configure command line to enable socks.
1328 : List of libraries we want.
1329 : If anyone needs extra -lxxx, put those in a hint file.
1330 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1331 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1332 : We probably want to search /usr/shlib before most other libraries.
1333 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1334 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1335 glibpth="/usr/shlib $glibpth"
1336 : Do not use vfork unless overridden by a hint file.
1339 : Find the basic shell for Bourne shell scripts
1343 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1346 if test -f "$xxx"; then
1349 : Build up a list and do a single loop so we can 'break' out.
1350 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1351 for xxx in sh bash ksh pdksh ash; do
1353 try="$try ${p}/${xxx}"
1357 if test -f "$xxx"; then
1360 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1363 elif test -f "$xxx.exe"; then
1374 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1376 Usually it's in /bin/sh. How did you even get this far?
1377 Please contact me (Perl Maintainers) at perlbug@perl.org and
1378 we'll try to straighten this all out.
1384 : see if sh knows # comments
1385 if `$sh -c '#' >/dev/null 2>&1`; then
1389 test -f $xcat$_exe || xcat=/usr/bin/cat
1390 if test ! -f $xcat$_exe; then
1391 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1392 if test -f $p/cat$_exe; then
1397 if test ! -f $xcat$_exe; then
1398 echo "Can't find cat anywhere!"
1402 echo "#!$xcat" >sharp
1406 if test -s today; then
1409 echo "#! $xcat" > sharp
1413 if test -s today; then
1421 echo "Your $sh doesn't grok # comments--I will strip them later on."
1424 echo "exec grep -v '^[ ]*#'" >spitshell
1426 $eunicefix spitshell
1427 spitshell=`pwd`/spitshell
1429 echo "I presume that if # doesn't work, #! won't work either!"
1434 : figure out how to guarantee sh startup
1436 '') startsh=${sharpbang}${sh} ;;
1448 : echo "Yup, it does."
1450 echo "Hmm... '$startsh' does not guarantee sh startup..."
1451 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1456 : Save command line options in file UU/cmdline.opt for later use in
1457 : generating config.sh.
1458 cat > cmdline.opt <<EOSH
1459 # Configure command line arguments.
1468 cat >>cmdline.opt <<EOSH
1469 config_arg$argn='$arg'
1471 # Extreme backslashitis: replace each ' by '"'"'
1472 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1475 arg_exp=`cat cmdl.opt`
1476 args_exp="$args_exp$args_sep'$arg_exp'"
1477 argn=`expr $argn + 1`
1480 # args_exp is good for restarting self: eval "set X $args_exp"; shift; $0 "$@"
1481 # used by ./hints/os2.sh
1484 : produce awk script to parse command line options
1485 cat >options.awk <<'EOF'
1487 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1489 len = length(optstr);
1490 for (i = 1; i <= len; i++) {
1491 c = substr(optstr, i, 1);
1492 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1503 if (substr(str, 1, 1) != "-") {
1504 printf("'%s'\n", str);
1508 for (i = 2; i <= len; i++) {
1509 c = substr(str, i, 1);
1511 printf("-%s\n", substr(str, i));
1517 printf("'%s'\n", substr(str, i + 1));
1530 : process the command line options
1531 set X `for arg in "$@"; do echo "X$arg"; done |
1532 sed -e s/X// | awk -f options.awk`
1537 : set up default values
1547 rm -f optdef.sh posthint.sh
1548 cat >optdef.sh <<EOS
1554 while test $# -gt 0; do
1556 -d) shift; fastread=yes;;
1557 -e) shift; alldone=cont;;
1561 if test -r "$1"; then
1564 echo "$me: cannot read config file $1." >&2
1570 -h) shift; error=true;;
1571 -r) shift; reuseval=true;;
1572 -s) shift; silent=true; realsilent=true;;
1573 -E) shift; alldone=exit;;
1574 -K) shift; knowitall=true;;
1575 -O) shift; override=true;;
1576 -S) shift; silent=true; extractsh=true;;
1581 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1582 echo "$me: ignoring -D $1" >&2
1585 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1586 *) echo "$1='define'" >> optdef.sh;;
1593 *=) echo "$1" >> optdef.sh;;
1595 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1596 echo "$me: ignoring -U $1" >&2
1598 *) echo "$1='undef'" >> optdef.sh;;
1609 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1613 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1614 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1620 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1621 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1622 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1623 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1624 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1625 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1631 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1633 echo "$yyy=''" >> posthint.sh ;;
1638 echo "$yyy='$zzz'" >> posthint.sh ;;
1640 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1642 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1647 echo "$yyy=$zzz" >> posthint.sh ;;
1648 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1652 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1655 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1663 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1664 [-U symbol] [-U symbol=] [-A command:symbol...]
1665 -d : use defaults for all answers.
1666 -e : go on without questioning past the production of config.sh.
1667 -f : specify an alternate default configuration file.
1668 -h : print this help message and exit (with an error status).
1669 -r : reuse C symbols value if possible (skips costly nm extraction).
1670 -s : silent mode, only echoes questions and essential information.
1671 -D : define symbol to have some value:
1672 -D symbol symbol gets the value 'define'
1673 -D symbol=value symbol gets the value 'value'
1674 common used examples (see INSTALL for more info):
1675 -Duse64bitint use 64bit integers
1676 -Duse64bitall use 64bit integers and pointers
1677 -Dusethreads use thread support
1678 -Dinc_version_list=none do not include older perl trees in @INC
1679 -DEBUGGING=none DEBUGGING options
1680 -Dcc=gcc choose your compiler
1681 -Dprefix=/opt/perl5 choose your destination
1682 -E : stop at the end of questions, after having produced config.sh.
1683 -K : do not use unless you know what you are doing.
1684 -O : let -D and -U override definitions from loaded configuration file.
1685 -S : perform variable substitutions on all .SH files (can mix with -f)
1686 -U : undefine symbol:
1687 -U symbol symbol gets the value 'undef'
1688 -U symbol= symbol gets completely empty
1690 -A : manipulate symbol after the platform specific hints have been applied:
1691 -A symbol=value append " "value to symbol
1692 -A append:symbol=value append value to symbol
1693 -A define:symbol=value define symbol to have value
1694 -A clear:symbol define symbol to be ''
1695 -A define:symbol define symbol to be 'define'
1696 -A eval:symbol=value define symbol to be eval of value
1697 -A prepend:symbol=value prepend value to symbol
1698 -A undef:symbol define symbol to be 'undef'
1699 -A undef:symbol= define symbol to be ''
1700 e.g.: -A prepend:libswanted='cl pthread '
1701 -V : print version number and exit (with a zero status).
1708 case "$fastread$alldone" in
1711 case "$extractsh" in
1714 if test ! -t 0; then
1715 echo "Say 'sh Configure', not 'sh <Configure'"
1725 true) exec 1>/dev/null;;
1728 : run the defines and the undefines, if any, but leave the file out there...
1731 : create the posthint manipulation script and leave the file out there...
1736 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1737 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1738 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1739 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1740 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1743 : Some greps do not return status, grrr.
1744 echo "grimblepritz" >grimble
1745 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1747 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1753 : the following should work in any shell
1757 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1758 cat >contains <<'EOSS'
1759 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1764 : Find the path to the source tree
1767 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1771 *) src=`cd ../$src && pwd` ;;
1784 if test -f $rsrc/Configure && \
1785 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1787 : found it, so we are ok.
1790 for src in . .. ../.. ../../.. ../../../..; do
1791 if test -f ../$src/Configure && \
1792 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1803 Sorry, I can't seem to locate the source dir for $package. Please start
1804 Configure with an explicit path -- i.e. /some/path/Configure.
1812 echo "Sources for $package found in \"$src\"." >&4
1816 : script used to extract .SH files with variable substitutions
1817 cat >extract <<'EOS'
1819 echo "Doing variable substitutions on .SH files..."
1820 if test -f MANIFEST; then
1821 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1823 echo "(Looking for .SH files under the source directory.)"
1824 set x `(cd "$src"; find . -name "*.SH" -print)`
1828 0) set x `(cd "$src"; echo *.SH)`; shift;;
1830 if test ! -f "$src/$1"; then
1836 while test $name; do
1837 if test ! -d "$name"; then
1838 create="$name $create";
1839 name=`echo $name | sed -e "s|^[^/]*$||"`;
1840 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1845 for file in $create; do
1854 dir=`expr X$file : 'X\(.*\)/'`
1855 file=`expr X$file : 'X.*/\(.*\)'`
1856 (cd "$dir" && . ./$file)
1866 dir=`expr X$file : 'X\(.*\)/'`
1867 file=`expr X$file : 'X.*/\(.*\)'`
1868 (set x $dir; shift; eval $mkdir_p)
1869 sh <"$src/$dir/$file"
1878 if test -f "$src/config_h.SH"; then
1879 if test ! -f config.h; then
1880 : oops, they left it out of MANIFEST, probably, so do it anyway.
1881 . "$src/config_h.SH"
1886 : extract files and exit if asked to do so
1887 case "$extractsh" in
1889 case "$realsilent" in
1893 case "$config_sh" in
1894 '') config_sh='config.sh';;
1897 echo "Fetching answers from $config_sh..."
1900 test "$override" && . ./optdef.sh
1904 echo "Extraction done."
1909 : Eunice requires " " instead of "", can you believe it
1912 echo "Beginning of configuration questions for $package."
1914 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1916 : first determine how to suppress newline on echo command
1918 echo "Checking echo to see how to suppress newlines..."
1919 (echo "hi there\c" ; echo " ") >.echotmp
1920 if $contains c .echotmp >/dev/null 2>&1 ; then
1931 echo $n "The star should be here-->$c"
1935 : Now test for existence of everything in MANIFEST
1937 if test -f "$rsrc/MANIFEST"; then
1938 echo "First let's make sure your kit is complete. Checking..." >&4
1939 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | (split -l 50 2>/dev/null || split -50)
1942 for filelist in x??; do
1943 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` >/dev/null 2>>"$tmppwd/missing")
1945 if test -s missing; then
1949 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1951 You have the option of continuing the configuration process, despite the
1952 distinct possibility that your kit is damaged, by typing 'y'es. If you
1953 do, don't blame me if something goes wrong. I advise you to type 'n'o
1954 and contact the author (perlbug@perl.org).
1957 echo $n "Continue? [n] $c" >&4
1961 echo "Continuing..." >&4
1965 echo "ABORTING..." >&4
1970 echo "Looks good..."
1973 echo "There is no MANIFEST file. I hope your kit is complete !"
1978 : Find the appropriate value for a newline for tr
1979 if test -n "$DJGPP"; then
1982 if test X"$trnl" = X; then
1983 case "`echo foo|tr '\n' x 2>/dev/null`" in
1987 if test X"$trnl" = X; then
1988 case "`echo foo|tr '\012' x 2>/dev/null`" in
1989 foox) trnl='\012' ;;
1992 if test X"$trnl" = X; then
1993 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
1994 fooxy) trnl='\n\r' ;;
1997 if test X"$trnl" = X; then
2000 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2006 : compute the number of columns on the terminal for proper question formatting
2011 : set up the echo used in my read
2012 myecho="case \"\$xxxm\" in
2013 '') echo $n \"\$rp $c\" >&4;;
2015 '') echo $n \"[\$xxxm] $c\";;
2017 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2019 echo $n \"[\$xxxm] $c\" >&4
2021 echo $n \"\$rp [\$xxxm] $c\" >&4
2027 : now set up to do reads with possible shell escape and default assignment
2033 case "\$fastread" in
2034 yes) case "\$dflt" in
2037 case "\$silent-\$rp" in
2042 *) case "\$silent" in
2043 true) case "\$rp" in
2048 while expr "X\$ans" : "X!" >/dev/null; do
2052 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2060 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2069 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2074 echo "(OK, I'll run with -d after this question.)" >&4
2077 echo "*** Sorry, \$1 not supported yet." >&4
2087 echo "*** Substitution done -- please confirm."
2089 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2094 echo "*** Error -- try again."
2101 case "\$ans\$xxxm\$nostick" in
2113 : create .config dir to save info across Configure sessions
2114 test -d ../.config || mkdir ../.config
2115 cat >../.config/README <<EOF
2116 This directory created by Configure to save information that should
2117 persist across sessions for $package.
2119 You may safely delete it if you wish.
2122 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2124 $define|true|[yY]*) ;;
2125 *) case "$xversion" in
2128 *** WHOA THERE!!! ***
2130 This is an UNSTABLE DEVELOPMENT release.
2131 The version of this $package distribution is $xversion, that is, odd,
2132 (as opposed to even) and that signifies a development release.
2133 If you want a maintenance release, you want an even-numbered version.
2135 Do ***NOT*** install this into production use.
2136 Data corruption and crashes are possible.
2138 It is most seriously suggested that you do not continue any further
2139 unless you want to help in developing and debugging Perl.
2141 If you *still* want to build perl, you can answer 'y' now,
2142 or pass -Dusedevel to Configure.
2145 rp='Do you really want to continue?'
2149 [yY]) echo >&4 "Okay, continuing."
2150 usedevel="$define" ;;
2151 *) echo >&4 "Okay, bye."
2161 case "$versiononly" in
2162 '') versiononly="$define" ;;
2164 case "$installusrbinperl" in
2165 '') installusrbinperl="$undef" ;;
2170 : general instructions
2173 user=`(logname) 2>/dev/null`
2175 '') user=`whoami 2>&1`;;
2177 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2180 rp='Would you like to see the instructions?'
2191 This installation shell script will examine your system and ask you questions
2192 to determine how the perl5 package should be installed. If you get
2193 stuck on a question, you may use a ! shell escape to start a subshell or
2194 execute a command. Many of the questions will have default answers in square
2195 brackets; typing carriage return will give you the default.
2197 On some of the questions which ask for file or directory names you are allowed
2198 to use the ~name construct to specify the login directory belonging to "name",
2199 even if you don't have a shell which knows about that. Questions where this is
2200 allowed will be marked "(~name ok)".
2204 dflt='Type carriage return to continue'
2208 The prompter used in this script allows you to use shell variables and
2209 backticks in your answers. You may use $1, $2, etc... to refer to the words
2210 in the default answer, as if the default line was a set of arguments given to a
2211 script shell. This means you may also use $* to repeat the whole default line,
2212 so you do not have to re-type everything to add something to the default.
2214 Everytime there is a substitution, you will have to confirm. If there is an
2215 error (e.g. an unmatched backtick), the default answer will remain unchanged
2216 and you will be prompted again.
2218 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2219 the questions and use the computed defaults (or the previous answers if there
2220 was already a config.sh file). Type 'Configure -h' for a list of options.
2221 You may also start interactively and then answer '& -d' at any prompt to turn
2222 on the non-interactive behaviour for the remainder of the execution.
2228 Much effort has been expended to ensure that this shell script will run on any
2229 Unix system. If despite that it blows up on yours, your best bet is to edit
2230 Configure and run it again. If you can't run Configure for some reason,
2231 you'll have to generate a config.sh file by hand. Whatever problems you
2232 have, let me (perlbug@perl.org) know how I blew it.
2234 This installation script affects things in two ways:
2236 1) it may do direct variable substitutions on some of the files included
2238 2) it builds a config.h file for inclusion in C programs. You may edit
2239 any of these files as the need arises after running this script.
2241 If you make a mistake on a question, there is no easy way to back up to it
2242 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2243 files. Configure will offer to let you do this before it runs the SH files.
2246 dflt='Type carriage return to continue'
2248 case "$firsttime" in
2249 true) echo $user >>../.config/instruct;;
2253 : find out where common programs are
2255 echo "Locating common programs..." >&4
2268 if test -d \$dir/\$thing; then
2274 for thisthing in \$dir/\$thing; do
2275 : just loop through to pick last item
2277 if test -f \$thisthing; then
2280 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2283 elif test -f \$dir/\$thing.exe; then
2284 if test -n "$DJGPP"; then
2285 echo \$dir/\$thing.exe
2286 elif test "$eunicefix" != ":"; then
2287 : on Eunice apparently
2341 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2342 pth="$pth /lib /usr/lib"
2343 for file in $loclist; do
2347 if test -f "$xxx"; then
2350 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2351 xxx=`./loc $file $file $pth`
2354 '') xxx=`./loc $file $file $pth`;;
2355 *) xxx=`./loc $xxx $xxx $pth`;;
2357 eval $file=$xxx$_exe
2361 echo $file is in $xxx.
2364 echo $file is in $xxx.
2367 echo "I don't know where '$file' is, and my life depends on it." >&4
2368 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2374 echo "Don't worry if any of the following aren't found..."
2376 for file in $trylist; do
2380 if test -f "$xxx"; then
2383 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2384 xxx=`./loc $file $file $pth`
2387 '') xxx=`./loc $file $file $pth`;;
2388 *) xxx=`./loc $xxx $xxx $pth`;;
2390 eval $file=$xxx$_exe
2394 echo $file is in $xxx.
2397 echo $file is in $xxx.
2400 echo "I don't see $file out there, $say."
2407 echo "Substituting grep for egrep."
2414 echo "Substituting cp for ln."
2423 echo "I can't find make or gmake, and my life depends on it." >&4
2424 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2432 *) # We can't have osname yet.
2433 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2434 # Assume that gmake, if found, is definitely GNU make
2435 # and prefer it over the system make.
2436 echo "Substituting gmake for make."
2444 echo "Hopefully test is built into your sh."
2447 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2448 echo "Using the test built into your sh."
2456 echo "Hopefully echo is built into your sh."
2461 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2462 $echo $n "hi there$c" >foo1
2463 echo $n "hi there$c" >foo2
2464 if cmp foo1 foo2 >/dev/null 2>&1; then
2465 echo "They are compatible. In fact, they may be identical."
2472 They are not compatible! You are probably running ksh on a non-USG system.
2473 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2474 have echo built in and we may have to run some Bourne shell scripts. That
2475 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2478 $echo $n "The star should be here-->$c"
2488 cat <<'EOSC' >>trygcc
2493 int main(int argc, char *argv[]) {
2497 if $cc -o try $ccflags $ldflags try.c; then
2500 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2506 case "`$cc -v -c try.c 2>&1`" in
2509 if $test X"$trygcc" = Xyes; then
2510 if gcc -o try -c try.c; then
2512 echo "You seem to have a working gcc, though." >&4
2513 rp="Would you like to use it?"
2515 if $test -f myread; then
2518 if $test -f UU/myread; then
2521 echo "Cannot find myread, sorry. Aborting." >&2
2526 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2527 if $test -f usethreads.cbu; then
2530 *** However, any setting of the C compiler flags (e.g. for thread support)
2531 *** has been lost. It may be necessary to pass -Dcc=gcc to Configure
2532 *** (together with e.g. -Dusethreads).
2548 cat <<'EOSC' >>checkcc
2553 int main(int argc, char *argv[]) {
2557 if $cc -o try $ccflags $ldflags try.c; then
2560 if $test X"$despair" = Xyes; then
2561 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2564 You need to find a working C compiler.
2565 Either (purchase and) install the C compiler supplied by your OS vendor,
2566 or for a free C compiler try http://gcc.gnu.org/
2567 I cannot continue any further, aborting.
2576 : determine whether symbolic links are supported
2579 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2580 echo "Symbolic links are supported." >&4
2583 echo "Symbolic links are NOT supported." >&4
2588 : determine whether symbolic links are supported
2592 echo "Checking how to test for symbolic links..." >&4
2594 if $test "X$issymlink" = X; then
2596 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2597 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2599 if test $? = 0; then
2602 echo "Your builtin 'test -h' may be broken." >&4
2605 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2608 if test -f "$p/$test"; then
2617 echo "Trying external '$test -h'." >&4
2618 issymlink="$test -h"
2619 if $test ! -h sym >/dev/null 2>&1; then
2620 echo "External '$test -h' is broken, too." >&4
2628 if $test "X$issymlink" = X; then
2629 if $test -L sym 2>/dev/null; then
2630 issymlink="$test -L"
2631 echo "The builtin '$test -L' worked." >&4
2634 if $test "X$issymlink" != X; then
2635 echo "You can test for symbolic links with '$issymlink'." >&4
2637 echo "I do not know how you can test for symbolic links." >&4
2641 *) echo "No symbolic links, so not testing for their testing..." >&4
2647 case "$mksymlinks" in
2650 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2653 *) case "$lns:$issymlink" in
2654 *"ln"*" -s:"*"test -"?)
2655 echo "Creating the symbolic links..." >&4
2656 echo "(First creating the subdirectories...)" >&4
2658 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2660 test -z "$directory" && break
2664 if test ! -d t/base; then
2665 echo "Failed to create the subdirectories. Aborting." >&4
2668 echo "(Then creating the symlinks...)" >&4
2669 awk '{print $1}' $src/MANIFEST | while true; do
2671 test -z "$filename" && break
2672 if test -f $filename; then
2673 if $issymlink $filename; then
2677 if test -f $filename; then
2678 echo "$filename already exists, not symlinking."
2680 ln -s $src/$filename $filename
2684 if test ! -f t/base/lex.t; then
2685 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2690 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2699 case "$usecrosscompile" in
2701 $echo "Cross-compiling..."
2704 *-*-gcc) # A cross-compiling gcc, probably.
2705 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2707 # leave out ld, choosing it is more complex
2709 ranlib=$targetarch-ranlib
2710 $echo 'extern int foo;' > try.c
2711 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2713 if $test $# -gt 0; then
2715 incpth="`$echo $incpth|$sed 's/^ //'`"
2716 echo "Guessing incpth '$incpth'." >&4
2718 j="`$echo $i|$sed 's,/include$,/lib,'`"
2719 if $test -d $j; then
2723 libpth="`$echo $libpth|$sed 's/^ //'`"
2724 echo "Guessing libpth '$libpth'." >&4
2729 case "$targetarch" in
2730 '') echo "Targetarch not defined." >&4; croak=y ;;
2731 *) echo "Using targetarch $targetarch." >&4 ;;
2734 '') echo "Incpth not defined." >&4; croak=y ;;
2735 *) echo "Using incpth '$incpth'." >&4 ;;
2738 '') echo "Libpth not defined." >&4; croak=y ;;
2739 *) echo "Using libpth '$libpth'." >&4 ;;
2742 '') for i in $incpth; do
2743 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2745 echo "Guessing usrinc $usrinc." >&4
2750 '') echo "Usrinc not defined." >&4; croak=y ;;
2753 *) echo "Using usrinc $usrinc." >&4 ;;
2755 case "$targethost" in
2756 '') echo "Targethost not defined." >&4; croak=y ;;
2757 *) echo "Using targethost $targethost." >&4
2762 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2765 /*) run=$src/Cross/run
2766 targetmkdir=$src/Cross/mkdir
2768 from=$src/Cross/from
2770 *) pwd=`$test -f ../Configure & cd ..; pwd`
2772 targetmkdir=$pwd/Cross/mkdir
2774 from=$pwd/Cross/from
2777 case "$targetrun" in
2778 '') targetrun=ssh ;;
2783 case "$targetfrom" in
2784 '') targetfrom=scp ;;
2788 from=$from-$targetfrom
2789 case "$targetdir" in
2791 echo "Guessing targetdir $targetdir." >&4
2794 case "$targetuser" in
2796 echo "Guessing targetuser $targetuser." >&4
2799 case "$targetfrom" in
2803 case "$targetrun" in
2815 '') cwd=$targetdir ;;
2819 if $test ! -f \$exe.xok; then
2823 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2826 *) echo "Unknown targetrun '$targetrun'" >&4
2830 case "$targetmkdir" in
2832 cat >$targetmkdir <<EOF
2834 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2836 $chmod a+rx $targetmkdir
2838 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2850 $targetmkdir \`dirname \$f\`
2851 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2854 $targetmkdir $targetdir/\`dirname \$f\`
2855 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2868 $mkdir -p $targetdir/\`dirname \$f\`
2869 $cp \$f $targetdir/\$f || exit 1
2872 $targetmkdir $targetdir/\`dirname \$f\`
2873 $cp \$f $targetdir/\$f || exit 1
2880 *) echo "Unknown targetto '$targetto'" >&4
2884 case "$targetfrom" in
2891 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2896 cp) cat >$from <<EOF
2901 cp $targetdir/\$f . || exit 1
2906 *) echo "Unknown targetfrom '$targetfrom'" >&4
2910 if $test ! -f $run; then
2911 echo "Target 'run' script '$run' not found." >&4
2915 if $test ! -f $to; then
2916 echo "Target 'to' script '$to' not found." >&4
2920 if $test ! -f $from; then
2921 echo "Target 'from' script '$from' not found." >&4
2925 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2929 Using '$run' for remote execution,
2930 and '$from' and '$to'
2931 for remote file transfer.
2937 usecrosscompile='undef'
2942 : see whether [:lower:] and [:upper:] are supported character classes
2944 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2946 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2950 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
2951 # (0xd9 and 0xe2), therefore that is a nice testing point.
2952 if test "X$up" = X -o "X$low" = X; then
2953 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
2959 if test "X$up" = X -o "X$low" = X; then
2960 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
2966 if test "X$up" = X -o "X$low" = X; then
2967 case "`echo RS | od -x 2>/dev/null`" in
2969 echo "Hey, this might be EBCDIC." >&4
2970 if test "X$up" = X -o "X$low" = X; then
2971 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2972 rs) up='[A-IJ-RS-Z]'
2977 if test "X$up" = X -o "X$low" = X; then
2978 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2988 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
2990 echo "Using $up and $low to convert case." >&4
2993 echo "I don't know how to translate letters from upper to lower case." >&4
2994 echo "Your tr is not acting any way I know of." >&4
2998 : set up the translation script tr, must be called with ./tr of course
3002 '[A-Z][a-z]') exec $tr '$up' '$low';;
3003 '[a-z][A-Z]') exec $tr '$low' '$up';;
3010 : Try to determine whether config.sh was made on this system
3011 case "$config_sh" in
3013 myuname=`$uname -a 2>/dev/null`
3014 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3015 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3016 # because the A-Z/a-z are not consecutive.
3017 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e "s,['/],,g" | \
3018 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3019 newmyuname="$myuname"
3021 case "$knowitall" in
3023 if test -f ../config.sh; then
3024 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3025 eval "`grep myuname= ../config.sh`"
3027 if test "X$myuname" = "X$newmyuname"; then
3035 : Get old answers from old config file if Configure was run on the
3036 : same system, otherwise use the hints.
3039 if test -f config.sh; then
3041 rp="I see a config.sh file. Shall I use it to set the defaults?"
3044 n*|N*) echo "OK, I'll ignore it."
3045 mv config.sh config.sh.old
3046 myuname="$newmyuname"
3048 *) echo "Fetching default answers from your old config.sh file..." >&4
3056 : Older versions did not always set $sh. Catch re-use of such
3066 if test ! -f config.sh; then
3069 First time through, eh? I have some defaults handy for some systems
3070 that need some extra help getting the Configure answers right:
3073 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3075 : Half the following guesses are probably wrong... If you have better
3076 : tests or hints, please send them to perlbug@perl.org
3077 : The metaconfig authors would also appreciate a copy...
3078 $test -f /irix && osname=irix
3079 $test -f /xenix && osname=sco_xenix
3080 $test -f /dynix && osname=dynix
3081 $test -f /dnix && osname=dnix
3082 $test -f /lynx.os && osname=lynxos
3083 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3084 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3085 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3086 $test -f /bin/mips && /bin/mips && osname=mips
3087 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3088 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3089 $test -d /usr/apollo/bin && osname=apollo
3090 $test -f /etc/saf/_sactab && osname=svr4
3091 $test -d /usr/include/minix && osname=minix
3092 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3093 if $test -d /MachTen -o -d /MachTen_Folder; then
3095 if $test -x /sbin/version; then
3096 osvers=`/sbin/version | $awk '{print $2}' |
3097 $sed -e 's/[A-Za-z]$//'`
3098 elif $test -x /usr/etc/version; then
3099 osvers=`/usr/etc/version | $awk '{print $2}' |
3100 $sed -e 's/[A-Za-z]$//'`
3106 $test -f /sys/posix.dll &&
3107 $test -f /usr/bin/what &&
3108 set X `/usr/bin/what /sys/posix.dll` &&
3109 $test "$3" = UWIN &&
3113 if $test -f $uname; then
3121 umips) osname=umips ;;
3124 [23]100) osname=mips ;;
3125 next*) osname=next ;;
3127 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3128 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3131 elif $test -f /etc/kconfig; then
3133 if test "$lns" = "$ln -s"; then
3135 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3137 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3144 if test -n "$DJGPP"; then
3153 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3155 # oslevel can fail with:
3156 # oslevel: Unable to acquire lock.
3157 *not\ found) osvers="$4"."$3" ;;
3158 '<3240'|'<>3240') osvers=3.2.0 ;;
3159 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3160 '=3250'|'>3250') osvers=3.2.5 ;;
3164 bsd386) osname=bsd386
3167 cygwin*) osname=cygwin
3170 *dc.osx) osname=dcosx
3176 domainos) osname=apollo
3182 dragonfly) osname=dragonfly
3185 dynixptx*) osname=dynixptx
3186 osvers=`echo "$4"|sed 's/^v//'`
3188 freebsd) osname=freebsd
3190 genix) osname=genix ;;
3194 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3210 netbsd*) osname=netbsd
3213 news-os) osvers="$3"
3215 4*) osname=newsos4 ;;
3219 next*) osname=next ;;
3220 nonstop-ux) osname=nonstopux ;;
3221 openbsd) osname=openbsd
3227 POSIX-BC | posix-bc ) osname=posix-bc
3230 powerux | power_ux | powermax_os | powermaxos | \
3231 powerunix | power_unix) osname=powerux
3237 solaris) osname=solaris
3239 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3246 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3250 titanos) osname=titanos
3259 ultrix) osname=ultrix
3262 osf1|mls+) case "$5" in
3265 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3268 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3271 hp*) osname=hp_osf1 ;;
3272 mips) osname=mips_osf1 ;;
3275 # UnixWare 7.1.2 is known as Open UNIX 8
3276 openunix|unixware) osname=svr5
3284 $2) case "$osname" in
3288 : svr4.x or possibly later
3298 if test -f /stand/boot ; then
3299 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3300 if test -n "$INITPROG" -a -f "$INITPROG"; then
3301 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3302 if test -n "$isesix"; then
3310 *) if test -f /etc/systemid; then
3312 set `echo $3 | $sed 's/\./ /g'` $4
3313 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3315 elif $test -f $src/hints/sco_$1_$2.sh; then
3317 elif $test -f $src/hints/sco_$1.sh; then
3322 '') : Still unknown. Probably a generic Sys V.
3331 *) case "$osname" in
3332 '') : Still unknown. Probably a generic BSD.
3340 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3341 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3342 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3345 $rm -f UU/kernel.what
3346 elif test -d c:/. -o -n "$is_os2" ; then
3353 case "$targetarch" in
3356 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3361 : Now look for a hint file osname_osvers, unless one has been
3362 : specified already.
3365 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3366 : Also try without trailing minor version numbers.
3367 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3368 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3369 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3370 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3373 *) case "$osvers" in
3376 *) if $test -f $src/hints/$file.sh ; then
3378 elif $test -f $src/hints/$xfile.sh ; then
3380 elif $test -f $src/hints/$xxfile.sh ; then
3382 elif $test -f $src/hints/$xxxfile.sh ; then
3384 elif $test -f $src/hints/$xxxxfile.sh ; then
3386 elif $test -f "$src/hints/${osname}.sh" ; then
3395 if $test -f Policy.sh ; then
3398 none) dflt="Policy" ;;
3399 *) dflt="Policy $dflt" ;;
3404 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3408 if $test -f Policy.sh ; then
3411 There's also a Policy hint file available, which should make the
3412 site-specific (policy) questions easier to answer.
3419 You may give one or more space-separated answers, or "none" if appropriate.
3420 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3421 previous run of Configure, you may specify it as well as or instead of
3422 OS-specific hints. If hints are provided for your OS, you should use them:
3423 although Perl can probably be built without hints on many platforms, using
3424 hints often improve performance and may enable features that Configure can't
3425 set up on its own. If there are no hints that match your OS, specify "none";
3426 DO NOT give a wrong version or a wrong OS.
3430 rp="Which of these apply, if any?"
3433 for file in $tans; do
3434 if $test X$file = XPolicy -a -f Policy.sh; then
3436 $cat Policy.sh >> UU/config.sh
3437 elif $test -f $src/hints/$file.sh; then
3438 . $src/hints/$file.sh
3439 $cat $src/hints/$file.sh >> UU/config.sh
3440 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3443 : Give one chance to correct a possible typo.
3444 echo "$file.sh does not exist"
3446 rp="hint to use instead?"
3448 for file in $ans; do
3449 if $test -f "$src/hints/$file.sh"; then
3450 . $src/hints/$file.sh
3451 $cat $src/hints/$file.sh >> UU/config.sh
3452 elif $test X$ans = X -o X$ans = Xnone ; then
3455 echo "$file.sh does not exist -- ignored."
3462 : Remember our hint file for later.
3463 if $test -f "$src/hints/$file.sh" ; then
3473 echo "Fetching default answers from $config_sh..." >&4
3477 cp $config_sh config.sh 2>/dev/null
3487 test "$override" && . ./optdef.sh
3489 : Restore computed paths
3490 for file in $loclist $trylist; do
3491 eval $file="\$_$file"
3496 Configure uses the operating system name and version to set some defaults.
3497 The default value is probably right if the name rings a bell. Otherwise,
3498 since spelling matters for me, either accept the default or answer "none"
3505 ''|' '|none) dflt=none ;;
3506 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3509 *) dflt="$osname" ;;
3511 rp="Operating system name?"
3515 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3521 ''|' '|none) dflt=none ;;
3522 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3523 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3525 ''|' ') dflt=none ;;
3530 *) dflt="$osvers" ;;
3532 rp="Operating system version?"
3542 : who configured the system
3543 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3546 cf_by=`(logname) 2>/dev/null`
3549 cf_by=`(whoami) 2>/dev/null`
3551 "") cf_by=unknown ;;
3556 : decide how portable to be. Allow command line overrides.
3557 case "$d_portable" in
3559 *) d_portable="$define" ;;
3562 : set up shell script to do ~ expansion
3568 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3571 if $test -f /bin/csh; then
3572 /bin/csh -f -c "glob \$1"
3577 name=\`$expr x\$1 : '..\([^/]*\)'\`
3578 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3579 if $test ! -d "\$dir"; then
3581 echo "\$me: can't locate home directory for: \$name" >&2
3586 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3602 : now set up to get a file name
3606 cat <<'EOSC' >>getfile
3622 : getfile will accept an answer from the comma-separated list
3623 : enclosed in parentheses even if it does not meet other criteria.
3624 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3625 fn=`echo $fn | sed 's/(.*)//'`
3631 loc_file=`expr $fn : '.*:\(.*\)'`
3632 fn=`expr $fn : '\(.*\):.*'`
3640 */*) fullpath=true;;
3649 *e*) exp_file=true;;
3652 *p*) nopath_ok=true;;
3657 *d*) type='Directory';;
3658 *l*) type='Locate';;
3663 Locate) what='File';;
3668 case "$d_portable" in
3676 while test "$type"; do
3681 true) rp="$rp (~name ok)";;
3684 if test -f UU/getfile.ok && \
3685 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3704 value=`UU/filexp $ans`
3707 if test "$ans" != "$value"; then
3708 echo "(That expands to $value on this system.)"
3722 /*) value="$ansexp" ;;
3723 [a-zA-Z]:/*) value="$ansexp" ;;
3728 echo "I shall only accept a full path name, as in /bin/ls." >&4
3729 echo "Use a ! shell escape if you wish to check pathnames." >&4
3732 echo "Please give a full path name, starting with slash." >&4
3735 echo "Note that using ~name is ok provided it expands well." >&4
3748 for fp in $gfpth; do
3749 if test "X$fp" = X.; then
3754 if test -f "$pf"; then
3756 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3758 echo "($value is not a plain file, but that's ok.)"
3761 if test X"$type" = X; then
3768 for fp in $gfpth; do
3769 if test "X$fp" = X.; then
3774 direxp="$fp/$ansexp"
3776 if test -d "$direxp"; then
3784 if test -d "$ansexp"; then
3785 echo "(Looking for $loc_file in directory $value.)"
3786 value="$value/$loc_file"
3787 ansexp="$ansexp/$loc_file"
3789 if test -f "$ansexp"; then
3792 case "$nopath_ok" in
3793 true) case "$value" in
3795 *) echo "Assuming $value will be in people's path."
3811 if test "$fastread" = yes; then
3816 rp="$what $value doesn't exist. Use that name anyway?"
3835 test "X$gfpthkeep" != Xy && gfpth=""
3838 : determine root of directory hierarchy where package will be installed.
3841 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3844 dflt=`echo "$prefix" | sed 's/.$//'`
3852 By default, $package will be installed in $dflt/bin, manual pages
3853 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3854 installation directories. Typically this is something like /usr/local.
3855 If you wish to have binaries under /usr/bin but other parts of the
3856 installation under /usr/local, that's ok: you will be prompted
3857 separately for each of the installation directories, the prefix being
3858 only used to set the defaults.
3862 rp='Installation prefix to use?'
3870 *) oldprefix="$prefix";;
3879 *) afsroot=$afsroot ;;
3885 $define|true) afs=true ;;
3886 $undef|false) afs=false ;;
3887 *) if test -d $afsroot; then
3895 echo "AFS may be running... I'll be extra cautious then..." >&4
3897 echo "AFS does not seem to be running..." >&4
3900 : determine installation prefix for where package is to be installed.
3904 Since you are running AFS, I need to distinguish the directory in which
3905 files will reside from the directory in which they are installed (and from
3906 which they are presumably copied to the former directory by occult means).
3909 case "$installprefix" in
3910 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
3911 *) dflt="$installprefix";;
3916 In some special cases, particularly when building $package for distribution,
3917 it is convenient to distinguish the directory in which files should be
3918 installed from the directory ($prefix) in which they will
3919 eventually reside. For most users, these two directories are the same.
3922 case "$installprefix" in
3924 *) dflt=$installprefix;;
3928 rp='What installation prefix should I use for installing files?'
3930 installprefix="$ans"
3931 installprefixexp="$ansexp"
3933 : Perform the prefixexp/installprefixexp correction if necessary
3934 cat <<EOS >installprefix
3937 cat <<'EOSC' >>installprefix
3938 : Change installation prefix, if necessary.
3939 if $test X"$prefix" != X"$installprefix"; then
3940 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
3942 eval "install${prefixvar}=\"\$${prefixvar}exp\""
3945 chmod +x installprefix
3946 $eunicefix installprefix
3948 : Set variables such as privlib and privlibexp from the output of ./getfile
3949 : performing the prefixexp/installprefixexp correction if necessary.
3950 cat <<EOS >setprefixvar
3953 cat <<'EOSC' >>setprefixvar
3954 eval "${prefixvar}=\"\$ans\""
3955 eval "${prefixvar}exp=\"\$ansexp\""
3958 chmod +x setprefixvar
3959 $eunicefix setprefixvar
3961 : set up the script used to warn in case of inconsistency
3970 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
3972 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
3973 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
3978 echo "*** WHOA THERE!!! ***" >&4
3979 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
3982 rp=" Keep the $hint value?"
3985 y) td=$was; tu=$was;;
3989 : function used to set $1 to $val
3990 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
3992 $define$undef) . ./whoa; eval "$var=\$td";;
3993 $undef$define) . ./whoa; eval "$var=\$tu";;
3994 *) eval "$var=$val";;
3998 $define|true|[yY]*) dflt='y';;
4003 Perl can be built to use the SOCKS proxy protocol library. To do so,
4004 Configure must be run with -Dusesocks. If you use SOCKS you also need
4005 to use the PerlIO abstraction layer, this will be implicitly selected.
4007 If this doesn't make any sense to you, just accept the default '$dflt'.
4009 rp='Build Perl for SOCKS?'
4012 y|Y) val="$define" ;;
4019 $define|true|[yY]*) useperlio="$define";;
4022 case "$useperlio" in
4023 $define|true|[yY]*|'') dflt='y';;
4028 Previous version of $package used the standard IO mechanisms as
4029 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
4030 alternate IO mechanisms via the PerlIO abstraction layer, but the
4031 stdio mechanism is still available if needed. The abstraction layer
4032 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
4033 Using PerlIO with sfio may cause problems with some extension modules.
4035 If this doesn't make any sense to you, just accept the default '$dflt'.
4037 rp='Use the PerlIO abstraction layer?'
4044 echo "Ok, doing things the stdio way."
4053 case "$useperlio" in
4054 $define|true|[yY]*) ;;
4057 You are using the SOCKS proxy protocol library which means that you
4058 should also use the PerlIO layer. You may be headed for trouble.
4067 : get the patchlevel
4069 echo "Getting the current patchlevel..." >&4
4070 if $test -r $rsrc/patchlevel.h;then
4071 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4072 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4073 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4074 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4075 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4076 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4077 perl_patchlevel=`egrep 'define PERL_PATCHNUM [0-9][0-9]|,"MAINT[0-9][0-9]*"' $rsrc/patchlevel.h|sed 's/[^0-9]//g'`
4086 $echo "(You do not have patchlevel.h. Eek.)"
4088 if $test -r $rsrc/.patch ; then
4089 if $test "X$perl_patchlevel" = "X" || $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
4090 perl_patchlevel=`cat $rsrc/.patch`
4093 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4094 version_patchlevel_string="version $patchlevel subversion $subversion"
4095 case "$perl_patchlevel" in
4097 *) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;;
4100 $echo "(You have $package $version_patchlevel_string.)"
4104 : XXX Should be a Configure test for double-dots in filenames.
4105 version=`echo $revision $patchlevel $subversion | \
4106 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4107 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4108 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4111 version=`echo $revision $patchlevel $subversion | \
4112 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4113 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4114 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4117 : Special case the 5.005_xx maintenance series, which used 5.005
4118 : without any subversion label as a subdirectory in $sitelib
4119 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4120 api_versionstring='5.005'
4123 case "$usethreads" in
4124 $define|true|[yY]*) dflt='y';;
4125 *) # Catch case where user specified ithreads or 5005threads but
4126 # forgot -Dusethreads (A.D. 4/2002)
4127 case "$useithreads$use5005threads" in
4129 case "$useperlio" in
4130 "$define") dflt='y' ;;
4140 Perl can be built to take advantage of threads on some systems.
4141 To do so, Configure can be run with -Dusethreads.
4143 Note that Perl built with threading support runs slightly slower
4144 and uses more memory than plain Perl. The current implementation
4145 is believed to be stable, but it is fairly new, and so should be
4146 treated with caution.
4148 If this doesn't make any sense to you, just accept the default '$dflt'.
4150 rp='Build a threading Perl?'
4153 y|Y) val="$define" ;;
4159 if $test $patchlevel -lt 9; then
4160 case "$usethreads" in
4164 Since release 5.6, Perl has had two different threading implementations,
4165 the newer interpreter-based version (ithreads) with one interpreter per
4166 thread, and the older 5.005 version (5005threads).
4167 The 5005threads version is effectively unmaintained and will probably be
4168 removed in Perl 5.10, so there should be no need to build a Perl using it
4169 unless needed for backwards compatibility with some existing 5.005threads
4173 : Default to ithreads unless overridden on command line or with
4176 case "$use5005threads" in
4177 $define|true|[yY]*) dflt='n';;
4179 case "$useithreads" in
4180 $undef|false|[nN]*) dflt='n';;
4182 rp='Use the newer interpreter-based ithreads?'
4185 y|Y) val="$define" ;;
4190 : Now set use5005threads to the opposite value.
4191 case "$useithreads" in
4192 $define) val="$undef" ;;
4199 useithreads="$undef"
4200 use5005threads="$undef"
4204 case "$useithreads$use5005threads" in
4208 You cannot have both the ithreads and the 5.005 threads enabled
4209 at the same time. Disabling the 5.005 threads since they are
4210 much less stable than the ithreads.
4213 use5005threads="$undef"
4218 : perl-5.9.x and later
4220 if test X"$usethreads" = "X$define"; then
4221 case "$use5005threads" in
4225 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4232 use5005threads="$undef"
4233 useithreads="$usethreads"
4236 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
4239 *** To build with ithreads you must also use the PerlIO layer.
4240 *** Cannot continue, aborting.
4246 case "$d_oldpthreads" in
4247 '') : Configure tests would be welcome here. For now, assume undef.
4249 *) val="$d_oldpthreads" ;;
4255 : Look for a hint-file generated 'call-back-unit'. If the
4256 : user has specified that a threading perl is to be built,
4257 : we may need to set or change some other defaults.
4258 if $test -f usethreads.cbu; then
4259 echo "Your platform has some specific hints regarding threaded builds, using them..."
4262 case "$usethreads" in
4263 "$define"|true|[yY]*)
4265 (Your platform does not have any specific hints for threaded builds.
4266 Assuming POSIX threads, then.)
4274 Perl can be built so that multiple Perl interpreters can coexist
4275 within the same Perl executable.
4278 case "$useithreads" in
4281 This multiple interpreter support is required for interpreter-based threads.
4285 *) case "$usemultiplicity" in
4286 $define|true|[yY]*) dflt='y';;
4290 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4291 rp='Build Perl for multiplicity?'
4294 y|Y) val="$define" ;;
4303 case "$usemorebits" in
4304 "$define"|true|[yY]*)
4305 use64bitint="$define"
4306 uselongdouble="$define"
4307 usemorebits="$define"
4309 *) usemorebits="$undef"
4313 : make some quick guesses about what we are up against
4315 $echo $n "Hmm... $c"
4325 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
4326 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
4328 echo "Looks kind of like an OSF/1 system, but we'll see..."
4330 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4331 xxx=`./loc addbib blurfl $pth`
4332 if $test -f $xxx; then
4333 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4337 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4338 echo "Looks kind of like an extended USG system, but we'll see..."
4340 echo "Looks kind of like a USG system, but we'll see..."
4344 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4345 echo "Looks kind of like a BSD system, but we'll see..."
4349 echo "Looks kind of like a Version 7 system, but we'll see..."
4352 case "$eunicefix" in
4355 There is, however, a strange, musty smell in the air that reminds me of
4356 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4360 : it so happens the Eunice I know will not run shell scripts in Unix format
4364 echo "Congratulations. You aren't running Eunice."
4368 : Detect OS2. The p_ variable is set above in the Head.U unit.
4369 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4370 : semicolon as a patch separator
4375 I have the feeling something is not exactly right, however...don't tell me...
4376 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4377 (Or you may be running DOS with DJGPP.)
4382 if test -f /xenix; then
4383 echo "Actually, this looks more like a XENIX system..."
4388 echo "It's not Xenix..."
4393 if test -f /venix; then
4394 echo "Actually, this looks more like a VENIX system..."
4401 echo "Nor is it Venix..."
4404 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4405 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4412 rp="Use which C compiler?"
4416 : See if they have not cc but they do have gcc
4418 : Look for a hint-file generated 'call-back-unit'. Now that the
4419 : user has specified the compiler, we may need to set or change some
4421 if $test -f cc.cbu; then
4427 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4431 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4433 printf("%s\n", __VERSION__);
4435 printf("%s\n", "1");
4441 if $cc -o try $ccflags $ldflags try.c; then
4442 gccversion=`$run ./try`
4443 case "$gccversion" in
4444 '') echo "You are not using GNU cc." ;;
4445 *) echo "You are using GNU cc $gccversion."
4451 echo "*** WHOA THERE!!! ***" >&4
4452 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4453 case "$knowitall" in
4455 echo " You'd better start hunting for one and let me know about it." >&4
4461 case "$gccversion" in
4462 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4464 case "$gccversion" in
4465 '') gccosandvers='' ;;
4466 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4467 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4469 case "$gccosandvers" in
4470 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4471 $osname$osvers) ;; # looking good
4472 $osname*) cat <<EOM >&4
4474 *** WHOA THERE!!! ***
4476 Your gcc has not been compiled for the exact release of
4477 your operating system ($gccosandvers versus $osname$osvers).
4479 In general it is a good idea to keep gcc synchronized with
4480 the operating system because otherwise serious problems
4481 may ensue when trying to compile software, like Perl.
4483 I'm trying to be optimistic here, though, and will continue.
4484 If later during the configuration and build icky compilation
4485 problems appear (headerfile conflicts being the most common
4486 manifestation), I suggest reinstalling the gcc to match
4487 your operating system release.
4491 *) gccosandvers='' ;; # failed to parse, better be silent
4499 # gcc 3.* complain about adding -Idirectories that they already know about,
4500 # so we will take those off from locincpth.
4501 case "$gccversion" in
4503 echo "main(){}">try.c
4504 for incdir in $locincpth; do
4505 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4506 grep '^c[cp]p*[01]: warning: changing search order '`
4507 if test "X$warn" != X; then
4508 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4514 : What should the include directory be ?
4516 $echo $n "Hmm... $c"
4520 if $test -f /bin/mips && /bin/mips; then
4521 echo "Looks like a MIPS system..."
4522 $cat >usr.c <<'EOCP'
4523 #ifdef SYSTYPE_BSD43
4527 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4528 dflt='/bsd43/usr/include'
4532 mips_type='System V'
4534 $rm -f usr.c usr.out
4535 echo "and you're compiling with the $mips_type compiler and libraries."
4539 echo "Doesn't look like a MIPS system."
4549 case "$xxx_prompt" in
4552 rp='Where are the include files you want to use?'
4560 : see how we invoke the C preprocessor
4562 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4563 cat <<'EOT' >testcpp.c
4569 if test ! -f cppstdin; then
4570 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4571 # AIX cc -E doesn't show the absolute headerfile
4572 # locations but we'll cheat by using the -M flag.
4573 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
4575 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4578 echo "Keeping your $hint cppstdin wrapper."
4581 wrapper=`pwd`/cppstdin
4585 if $test "X$cppstdin" != "X" && \
4586 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4587 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4589 echo "You used to use $cppstdin $cppminus so we'll use that again."
4591 '') echo "But let's see if we can live without a wrapper..." ;;
4593 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4594 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4596 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4599 echo "(However, $cpprun $cpplast does not work, let's see...)"
4607 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4614 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4615 $cc -E <testcpp.c >testcpp.out 2>&1; \
4616 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4617 echo "Yup, it does."
4620 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4621 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4622 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4623 echo "Yup, it does."
4626 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4627 $cc -P <testcpp.c >testcpp.out 2>&1; \
4628 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4629 echo "Yipee, that works!"
4632 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4633 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4634 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4635 echo "At long last!"
4638 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4639 $cpp <testcpp.c >testcpp.out 2>&1; \
4640 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4644 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4645 $cpp - <testcpp.c >testcpp.out 2>&1; \
4646 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4647 echo "Hooray, it works! I was beginning to wonder."
4650 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4651 $wrapper <testcpp.c >testcpp.out 2>&1; \
4652 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4658 rp="No dice. I can't find a C preprocessor. Name one:"
4662 $x_cpp <testcpp.c >testcpp.out 2>&1
4663 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4664 echo "OK, that will do." >&4
4666 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4681 echo "Perhaps can we force $cc -E using a wrapper..."
4682 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4683 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4689 echo "Nope, we'll have to live without it..."
4703 "$wrapper"|'cppstdin') ;;
4704 *) $rm -f $wrapper;;
4706 $rm -f testcpp.c testcpp.out
4708 : Set private lib path
4711 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4716 '') dlist="$loclibpth $plibpth $glibpth";;
4717 *) dlist="$libpth";;
4720 : Now check and see which directories actually exist, avoiding duplicates
4724 if $test -d $xxx; then
4727 *) libpth="$libpth $xxx";;
4733 Some systems have incompatible or broken versions of libraries. Among
4734 the directories listed in the question below, please remove any you
4735 know not to be holding relevant libraries, and add any that are needed.
4736 Say "none" for none.
4747 rp="Directories to use for library searches?"
4754 : compute shared library extension
4757 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4767 On some systems, shared libraries may be available. Answer 'none' if
4768 you want to suppress searching of shared libraries for the remainder
4769 of this configuration.
4772 rp='What is the file extension used for shared libraries?'
4776 : Define several unixisms.
4777 : Hints files or command line option can be used to override them.
4778 : The convoluted testing is in case hints files set either the old
4781 '') case "$exe_ext" in
4783 *) _exe="$exe_ext" ;;
4788 '') case "$lib_ext" in
4795 '') case "$obj_ext" in
4802 '') case "$path_sep" in
4813 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
4815 : Which makefile gets called first. This is used by make depend.
4816 case "$firstmakefile" in
4817 '') firstmakefile='makefile';;
4821 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4824 case "$uselongdouble" in
4825 $define|true|[yY]*) dflt='y';;
4830 Perl can be built to take advantage of long doubles which
4831 (if available) may give more accuracy and range for floating point numbers.
4833 If this doesn't make any sense to you, just accept the default '$dflt'.
4835 rp='Try to use long doubles if available?'
4838 y|Y) val="$define" ;;
4844 case "$uselongdouble" in
4845 true|[yY]*) uselongdouble="$define" ;;
4848 : Look for a hint-file generated 'call-back-unit'. If the
4849 : user has specified that long doubles should be used,
4850 : we may need to set or change some other defaults.
4851 if $test -f uselongdouble.cbu; then
4852 echo "Your platform has some specific hints regarding long doubles, using them..."
4853 . ./uselongdouble.cbu
4855 case "$uselongdouble" in
4858 (Your platform does not have any specific hints for long doubles.)
4864 : Looking for optional libraries
4866 echo "Checking for optional libraries..." >&4
4871 case "$libswanted" in
4872 '') libswanted='c_s';;
4875 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4881 for thisdir in $libpth $xlibpth; do
4882 test -d $thisdir && libspath="$libspath $thisdir"
4884 for thislib in $libswanted; do
4885 for thisdir in $libspath; do
4887 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4888 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4889 $test -f "$xxx" && eval $libscheck
4890 $test -f "$xxx" && libstyle=shared
4892 if test ! -f "$xxx"; then
4893 xxx=$thisdir/lib$thislib.$so
4894 $test -f "$xxx" && eval $libscheck
4895 $test -f "$xxx" && libstyle=shared
4897 if test ! -f "$xxx"; then
4898 xxx=$thisdir/lib$thislib$_a
4899 $test -f "$xxx" && eval $libscheck
4900 $test -f "$xxx" && libstyle=static
4902 if test ! -f "$xxx"; then
4903 xxx=$thisdir/$thislib$_a
4904 $test -f "$xxx" && eval $libscheck
4905 $test -f "$xxx" && libstyle=static
4907 if test ! -f "$xxx"; then
4908 xxx=$thisdir/lib${thislib}_s$_a
4909 $test -f "$xxx" && eval $libscheck
4910 $test -f "$xxx" && libstyle=static
4911 $test -f "$xxx" && thislib=${thislib}_s
4913 if test ! -f "$xxx"; then
4914 xxx=$thisdir/Slib$thislib$_a
4915 $test -f "$xxx" && eval $libscheck
4916 $test -f "$xxx" && libstyle=static
4918 if $test -f "$xxx"; then
4920 shared) echo "Found -l$thislib (shared)." ;;
4921 static) echo "Found -l$thislib." ;;
4922 *) echo "Found -l$thislib ($libstyle)." ;;
4926 *) dflt="$dflt -l$thislib"
4927 libsfound="$libsfound $xxx"
4929 libsfiles="$libsfiles $yyy"
4930 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4931 case " $libsdirs " in
4933 *) libsdirs="$libsdirs $yyy" ;;
4940 if $test ! -f "$xxx"; then
4941 echo "No -l$thislib."
4952 ' '|'') dflt='none';;
4957 In order to compile $package on your machine, a number of libraries
4958 are usually needed. Include any other special libraries here as well.
4959 Say "none" for none. The default list is almost always right.
4963 rp="What libraries to use?"
4970 : determine optimization, if desired, or use for debug flag also
4972 ' '|$undef) dflt='none';;
4974 *) dflt="$optimize";;
4978 By default, $package compiles with the -O flag to use the optimizer.
4979 Alternately, you might want to use the symbolic debugger, which uses
4980 the -g flag (on traditional Unix systems). Either flag can be
4981 specified here. To use neither flag, specify the word "none".
4984 rp="What optimizer/debugger flag should be used?"
4988 'none') optimize=" ";;
4991 : Check what DEBUGGING is required from the command line
4992 : -DEBUGGING or -DDEBUGGING or
4993 : -DEBUGGING=both = -g + -DDEBUGGING
4994 : -DEBUGGING=-g or -Doptimize=-g = -g
4995 : -DEBUGGING=none or -UDEBUGGING =
4996 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
4999 *) DEBUGGING=$EBUGGING ;;
5002 case "$DEBUGGING" in
5006 *) optimize="$optimize -g" ;;
5010 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5018 case "$DEBUGGING" in
5019 both|$define) dflt='-DDEBUGGING'
5022 : We will not override a previous value, but we might want to
5023 : augment a hint file
5025 default|recommended)
5026 case "$gccversion" in
5027 1*) dflt="$dflt -fpcc-struct-return" ;;
5029 case "$optimize:$DEBUGGING" in
5030 *-g*:old) dflt="$dflt -DDEBUGGING";;
5032 case "$gccversion" in
5033 2*) if test -d /etc/conf/kconfig.d &&
5034 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5036 # Interactive Systems (ISC) POSIX mode.
5041 case "$gccversion" in
5045 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
5046 echo 'int main(void) { return 0; }' > gcctest.c
5047 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
5048 echo "Yes, it does." 2>&1
5051 echo "Leaving current flags $ccflags alone." 2>&1
5053 *) dflt="$dflt -fno-strict-aliasing" ;;
5056 echo "Nope, it doesn't, but that's ok." 2>&1
5060 # For gcc, adding -pipe speeds up compilations for some, but apparently
5061 # some assemblers can't read from stdin. (It also slows down compilations
5062 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5063 case "$gccversion" in
5065 echo "Checking if your compiler accepts -pipe" 2>&1
5066 echo 'int main(void) { return 0; }' > gcctest.c
5067 if $cc -pipe -o gcctest gcctest.c; then
5068 echo "Yes, it does." 2>&1
5071 echo "Leaving current flags $ccflags alone." 2>&1
5073 *) dflt="$dflt -pipe" ;;
5076 echo "Nope, it doesn't, but that's ok." 2>&1
5083 case "$mips_type" in
5084 *BSD*|'') inclwanted="$locincpth $usrinc";;
5085 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5087 for thisincl in $inclwanted; do
5088 if $test -d $thisincl; then
5089 if $test x$thisincl != x$usrinc; then
5091 *" -I$thisincl "*);;
5092 *) dflt="$dflt -I$thisincl ";;
5098 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5100 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5108 *) dflt="$dflt -D$2";;
5112 set signal.h LANGUAGE_C; eval $inctest
5116 ccflags="$ccflags -DSOCKS"
5121 default|recommended) dflt="$ccflags $dflt" ;;
5122 *) dflt="$ccflags";;
5131 Your C compiler may want other flags. For this question you should include
5132 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5133 but you should NOT include libraries or ld flags like -lwhatever. If you
5134 want $package to honor its debug switch, you should include -DDEBUGGING here.
5135 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5137 To use no flags, specify the word "none".
5143 rp="Any additional cc flags?"
5150 : the following weeds options from ccflags that are of no interest to cpp
5152 '') cppflags="$ccflags" ;;
5153 *) cppflags="$cppflags $ccflags" ;;
5155 case "$gccversion" in
5156 1*) cppflags="$cppflags -D__GNUC__"
5158 case "$mips_type" in
5160 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5166 echo "Let me guess what the preprocessor flags are..." >&4
5180 *) ftry="$previous $flag";;
5182 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5183 >cpp1.out 2>/dev/null && \
5184 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5185 >cpp2.out 2>/dev/null && \
5186 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5187 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5189 cppflags="$cppflags $ftry"
5199 *-*) echo "They appear to be: $cppflags";;
5201 $rm -f cpp.c cpp?.out
5205 : flags used in final linking phase
5207 '') if ./venix; then
5213 *-posix*) dflt="$dflt -posix" ;;
5216 *) dflt="$ldflags";;
5219 : Try to guess additional flags to pick up local libraries.
5220 for thislibdir in $libpth; do
5221 case " $loclibpth " in
5224 *"-L$thislibdir "*) ;;
5225 *) dflt="$dflt -L$thislibdir" ;;
5237 Your C linker may need flags. For this question you should
5238 include -L/whatever and any other flags used by the C linker, but you
5239 should NOT include libraries like -lwhatever.
5241 Make sure you include the appropriate -L/path flags if your C linker
5242 does not normally search all of the directories you specified above,
5245 To use no flags, specify the word "none".
5249 rp="Any additional ld flags (NOT including libraries)?"
5255 rmlist="$rmlist pdp11"
5259 echo "Checking your choice of C compiler and flags for coherency..." >&4
5260 $cat > try.c <<'EOF'
5262 int main() { printf("Ok\n"); return(0); }
5264 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5266 $cat >try.msg <<'EOM'
5267 I've tried to compile and run the following simple program:
5270 $cat try.c >> try.msg
5272 $cat >> try.msg <<EOM
5279 and I got the following output:
5283 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5284 if $sh -c "$run ./try" >>try.msg 2>&1; then
5288 *) echo 'The program compiled OK, but produced no output.' >> try.msg
5291 cat >> try.msg <<'EOQS'
5292 If $libs contains -lsfio, and sfio is mis-configured, then it
5293 sometimes (apparently) runs and exits with a 0 status, but with no
5294 output! It may have to do with sfio's use of _exit vs. exit.
5297 rp="You have a big problem. Shall I abort Configure"
5304 echo "The program compiled OK, but exited with status $?." >>try.msg
5305 rp="You have a problem. Shall I abort Configure"
5309 echo "I can't compile the test program." >>try.msg
5310 rp="You have a BIG problem. Shall I abort Configure"
5316 case "$knowitall" in
5318 echo "(The supplied flags or libraries might be incorrect.)"
5326 *) echo "Ok. Stopping Configure." >&4
5331 n) echo "OK, that should do.";;
5335 : define a shorthand compile call
5339 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5340 : define a shorthand compile call for compilations that should be ok.
5344 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5346 : determine filename position in cpp output
5348 echo "Computing filename position in cpp output for #include directives..." >&4
5350 vos) testaccess=-e ;;
5353 echo '#include <stdio.h>' > foo.c
5356 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5357 $grep '^[ ]*#.*stdio\.h' | \
5358 while read cline; do
5361 while $test \$# -gt 0; do
5362 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5367 pos=\`expr \$pos + 1\`
5379 *) pos="${fieldn}th";;
5381 echo "Your cpp writes the filename in the $pos field of the line."
5384 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5385 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5388 : locate header file
5393 for usrincdir in $usrinc
5395 if test -f \$usrincdir/\$wanted; then
5396 echo "\$usrincdir/\$wanted"
5400 awkprg='{ print \$$fieldn }'
5401 echo "#include <\$wanted>" > foo\$\$.c
5402 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5403 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5404 while read cline; do
5405 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5407 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5408 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5413 # status = 0: grep returned 0 lines, case statement not executed
5414 # status = 1: headerfile found
5415 # status = 2: while loop executed, no headerfile found
5419 if test \$status -eq 1; then
5426 : define an alternate in-header-list? function
5427 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5428 cont=true; xxf="echo \"<\$1> found.\" >&4";
5429 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5430 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5432 case $# in 4) instead=instead;; *) instead="at last";; esac;
5433 while $test "$cont"; do
5435 var=$2; eval "was=\$$2";
5436 if $test "$xxx" && $test -r "$xxx";
5438 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5441 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5442 set $yyy; shift; shift; yyy=$@;
5443 case $# in 0) cont="";;
5444 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5445 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5446 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5447 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5451 do set $yyy; var=$2; eval "was=\$$2";
5452 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5453 set $yyy; shift; shift; yyy=$@;
5456 : see if stdlib is available
5457 set stdlib.h i_stdlib
5460 : check for lengths of integral types
5464 echo "Checking to see how big your integers are..." >&4
5473 printf("intsize=%d;\n", (int)sizeof(int));
5474 printf("longsize=%d;\n", (int)sizeof(long));
5475 printf("shortsize=%d;\n", (int)sizeof(short));
5480 if eval $compile_ok && $run ./try > /dev/null; then
5482 echo "Your integers are $intsize bytes long."
5483 echo "Your long integers are $longsize bytes long."
5484 echo "Your short integers are $shortsize bytes long."
5488 Help! I can't compile and run the intsize test program: please enlighten me!
5489 (This is probably a misconfiguration in your system or libraries, and
5490 you really ought to fix it. Still, I'll try anyway.)
5494 rp="What is the size of an integer (in bytes)?"
5498 rp="What is the size of a long integer (in bytes)?"
5502 rp="What is the size of a short integer (in bytes)?"
5510 : check for long long
5512 echo "Checking to see if you have long long..." >&4
5513 echo 'int main() { long long x = 7; return 0; }' > try.c
5515 if eval $compile; then
5517 echo "You have long long."
5520 echo "You do not have long long."
5526 : check for length of long long
5527 case "${d_longlong}${longlongsize}" in
5530 echo "Checking to see how big your long longs are..." >&4
5531 $cat >try.c <<'EOCP'
5535 printf("%d\n", (int)sizeof(long long));
5540 if eval $compile_ok; then
5541 longlongsize=`$run ./try`
5542 echo "Your long longs are $longlongsize bytes long."
5546 echo "(I can't seem to compile the test program. Guessing...)"
5547 rp="What is the size of a long long (in bytes)?"
5551 if $test "X$longsize" = "X$longlongsize"; then
5552 echo "(That isn't any different from an ordinary long.)"
5558 : see if inttypes.h is available
5559 : we want a real compile instead of Inhdr because some systems
5560 : have an inttypes.h which includes non-existent headers
5563 #include <inttypes.h>
5565 static int32_t foo32 = 0x12345678;
5569 if eval $compile; then
5570 echo "<inttypes.h> found." >&4
5573 echo "<inttypes.h> NOT found." >&4
5582 echo "Checking to see if you have int64_t..." >&4
5584 #include <sys/types.h>
5585 #$i_inttypes I_INTTYPES
5587 #include <inttypes.h>
5589 int main() { int64_t x = 7; }
5592 if eval $compile; then
5594 echo "You have int64_t."
5597 echo "You do not have int64_t."
5605 echo "Checking which 64-bit integer type we could use..." >&4
5611 val='"unsigned int"'
5616 *) case "$longsize" in
5620 val='"unsigned long"'
5625 *) case "$d_longlong:$longlongsize" in
5630 val='"unsigned long long"'
5635 *) case "$d_int64_t" in
5654 '') echo "Alas, no 64-bit integer types in sight." >&4
5657 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5663 case "$uselonglong" in
5664 "$define"|true|[yY]*)
5667 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5669 use64bitint="$define"
5672 case "$use64bits" in
5673 "$define"|true|[yY]*)
5676 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5678 use64bitint="$define"
5681 case "$use64bitints" in
5682 "$define"|true|[yY]*)
5685 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5687 use64bitint="$define"
5690 case "$use64bitsint" in
5691 "$define"|true|[yY]*)
5694 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5696 use64bitint="$define"
5699 case "$uselonglongs" in
5700 "$define"|true|[yY]*)
5703 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5705 use64bitint="$define"
5708 case "$use64bitsall" in
5709 "$define"|true|[yY]*)
5712 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5714 use64bitall="$define"
5719 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5721 case "$use64bitall" in
5722 "$define"|true|[yY]*) use64bitint="$define" ;;
5728 You have natively 64-bit long integers.
5732 *) case "$use64bitint" in
5733 "$define"|true|[yY]*) dflt='y';;
5742 Perl can be built to take advantage of 64-bit integer types
5743 on some systems. To do so, Configure can be run with -Duse64bitint.
5744 Choosing this option will most probably introduce binary incompatibilities.
5746 If this doesn't make any sense to you, just accept the default '$dflt'.
5747 (The default has been chosen based on your configuration.)
5749 rp='Try to use 64-bit integers, if available?'
5752 [yY]*) val="$define" ;;
5760 case "$use64bitall" in
5761 "$define"|true|[yY]*) dflt='y' ;;
5762 *) case "$longsize" in
5770 You may also choose to try maximal 64-bitness. It means using as much
5771 64-bitness as possible on the platform. This in turn means even more
5772 binary incompatibilities. On the other hand, your platform may not
5773 have any more 64-bitness available than what you already have chosen.
5775 If this doesn't make any sense to you, just accept the default '$dflt'.
5776 (The default has been chosen based on your configuration.)
5778 rp='Try to use maximal 64-bit support, if available?'
5781 [yY]*) val="$define" ;;
5786 case "$use64bitall" in
5788 case "$use64bitint" in
5792 Since you have chosen a maximally 64-bit build, I'm also turning on
5793 the use of 64-bit integers.
5795 use64bitint="$define" ;;
5800 : Look for a hint-file generated 'call-back-unit'. If the
5801 : user has specified that a 64-bit perl is to be built,
5802 : we may need to set or change some other defaults.
5803 if $test -f use64bitint.cbu; then
5804 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5807 case "$use64bitint" in
5808 "$define"|true|[yY]*)
5810 4) case "$archname64" in
5811 '') archname64=64int ;;
5818 : Look for a hint-file generated 'call-back-unit'. If the
5819 : user has specified that a maximally 64-bit perl is to be built,
5820 : we may need to set or change some other defaults.
5821 if $test -f use64bitall.cbu; then
5822 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5825 case "$use64bitall" in
5826 "$define"|true|[yY]*)
5828 4) case "$archname64" in
5829 ''|64int) archname64=64all ;;
5836 case "$d_quad:$use64bitint" in
5840 *** You have chosen to use 64-bit integers,
5841 *** but none can be found.
5842 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5843 *** Cannot continue, aborting.
5850 : check for length of double
5852 case "$doublesize" in
5854 echo "Checking to see how big your double precision numbers are..." >&4
5863 printf("%d\n", (int)sizeof(double));
5868 if eval $compile_ok; then
5869 doublesize=`$run ./try`
5870 echo "Your double is $doublesize bytes long."
5873 echo "(I can't seem to compile the test program. Guessing...)"
5874 rp="What is the size of a double precision number (in bytes)?"
5882 : check for long doubles
5884 echo "Checking to see if you have long double..." >&4
5885 echo 'int main() { long double x = 7.0; }' > try.c
5887 if eval $compile; then
5889 echo "You have long double."
5892 echo "You do not have long double."
5898 : check for length of long double
5899 case "${d_longdbl}${longdblsize}" in
5902 echo "Checking to see how big your long doubles are..." >&4
5903 $cat >try.c <<'EOCP'
5907 printf("%d\n", sizeof(long double));
5912 if eval $compile; then
5913 longdblsize=`$run ./try`
5914 echo "Your long doubles are $longdblsize bytes long."
5918 echo "(I can't seem to compile the test program. Guessing...)" >&4
5919 rp="What is the size of a long double (in bytes)?"
5923 if $test "X$doublesize" = "X$longdblsize"; then
5924 echo "That isn't any different from an ordinary double."
5925 echo "I'll keep your setting anyway, but you may see some"
5926 echo "harmless compilation warnings."
5932 : determine the architecture name
5934 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5935 tarch=`arch`"-$osname"
5936 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5937 if uname -m > tmparch 2>&1 ; then
5938 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5939 -e 's/$/'"-$osname/" tmparch`
5947 case "$myarchname" in
5950 echo "(Your architecture name used to be $myarchname.)"
5954 case "$targetarch" in
5956 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
5961 *) dflt="$archname";;
5963 rp='What is your architecture name'
5966 case "$usethreads" in
5968 echo "Threads selected." >&4
5970 *-thread*) echo "...and architecture name already has -thread." >&4
5972 *) archname="$archname-thread"
5973 echo "...setting architecture name to $archname." >&4
5978 case "$usemultiplicity" in
5980 echo "Multiplicity selected." >&4
5982 *-multi*) echo "...and architecture name already has -multi." >&4
5984 *) archname="$archname-multi"
5985 echo "...setting architecture name to $archname." >&4
5990 case "$use64bitint$use64bitall" in
5992 case "$archname64" in
5994 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
5997 case "$use64bitint" in
5998 "$define") echo "64 bit integers selected." >&4 ;;
6000 case "$use64bitall" in
6001 "$define") echo "Maximal 64 bitness selected." >&4 ;;
6004 *-$archname64*) echo "...and architecture name already has $archname64." >&4
6006 *) archname="$archname-$archname64"
6007 echo "...setting architecture name to $archname." >&4
6013 case "$uselongdouble" in
6015 echo "Long doubles selected." >&4
6016 case "$longdblsize" in
6018 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
6022 *-ld*) echo "...and architecture name already has -ld." >&4
6024 *) archname="$archname-ld"
6025 echo "...setting architecture name to $archname." >&4
6032 case "$useperlio" in
6034 echo "Perlio selected." >&4
6037 echo "Perlio not selected, using stdio." >&4
6039 *-stdio*) echo "...and architecture name already has -stdio." >&4
6041 *) archname="$archname-stdio"
6042 echo "...setting architecture name to $archname." >&4
6047 if $test -f archname.cbu; then
6048 echo "Your platform has some specific hints for architecture name, using them..."
6052 : set the prefixit variable, to compute a suitable default value
6053 prefixit='case "$3" in
6055 case "$oldprefix" in
6056 "") eval "$1=\"\$$2\"";;
6063 ""|" ") eval "$1=\"\$$2\"";;
6069 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6071 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6072 /*-$oldprefix/*|\~*-$oldprefix/*)
6073 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6074 *) eval "$1=\"\$$2\"";;
6078 : determine installation style
6079 : For now, try to deduce it from prefix unless it is already set.
6080 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6081 case "$installstyle" in
6082 '') case "$prefix" in
6083 *perl*) dflt='lib';;
6084 *) dflt='lib/perl5' ;;
6087 *) dflt="$installstyle" ;;
6089 : Probably not worth prompting for this since we prompt for all
6090 : the directories individually, and the prompt would be too long and
6094 : determine where public executables go
6099 rp='Pathname where the public executables will reside?'
6101 if $test "X$ansexp" != "X$binexp"; then
6105 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6106 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
6107 : this via initialinstalllocation
6110 case "$userelocatableinc" in
6111 $define|true|[yY]*) dflt='y' ;;
6116 Would you like to build Perl so that the installation is relocatable, so that
6117 library paths in @INC are determined relative to the path of the perl binary?
6118 This is not advised for system Perl installs, or if you need to run setid
6119 scripts or scripts under taint mode.
6121 If this doesn't make any sense to you, just accept the default '$dflt'.
6123 rp='Use relocatable @INC?'
6126 y|Y) val="$define" ;;
6129 set userelocatableinc
6132 initialinstalllocation="$binexp"
6133 : Default prefix is now "up one level from where the binaries are"
6134 case "$userelocatableinc" in
6140 installprefixexp=".../.."
6144 : determine where private library files go
6145 : Usual default is /usr/local/lib/perl5/$version.
6146 : Also allow things like /opt/perl/lib/$version, since
6147 : /opt/perl/lib/perl5... would be redundant.
6148 : The default "style" setting is made in installstyle.U
6149 case "$installstyle" in
6150 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6151 *) set dflt privlib lib/$version ;;
6156 There are some auxiliary files for $package that need to be put into a
6157 private library directory that is accessible by everyone.
6162 rp='Pathname where the private library files will reside?'
6167 : set the prefixup variable, to restore leading tilda escape
6168 prefixup='case "$prefixexp" in
6170 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6173 : determine where public architecture dependent libraries go
6176 : privlib default is /usr/local/lib/$package/$version
6177 : archlib default is /usr/local/lib/$package/$version/$archname
6178 : privlib may have an optional trailing /share.
6179 tdflt=`echo $privlib | $sed 's,/share$,,'`
6180 tdflt=$tdflt/$archname
6189 $spackage contains architecture-dependent library files. If you are
6190 sharing libraries in a heterogeneous environment, you might store
6191 these files in a separate location. Otherwise, you can just include
6192 them with the rest of the public library files.
6197 rp='Where do you want to put the public architecture-dependent libraries?'
6201 if $test X"$archlib" = X"$privlib"; then
6207 : see if setuid scripts can be secure
6210 Some kernels have a bug that prevents setuid #! scripts from being
6211 secure. Some sites have disabled setuid #! scripts because of this.
6213 First let's decide if your kernel supports secure setuid #! scripts.
6214 (If setuid #! scripts would be secure but have been disabled anyway,
6215 don't say that they are secure if asked.)
6220 if $test -d /dev/fd; then
6221 echo "#!$ls" >reflect
6222 chmod +x,u+s reflect
6223 ./reflect >flect 2>&1
6224 if $contains "/dev/fd" flect >/dev/null; then
6225 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6229 If you are not sure if they are secure, I can check but I'll need a
6230 username and password different from the one you are using right now.
6231 If you don't have such a username or don't want me to test, simply
6235 rp='Other username to test security of setuid scripts with?'
6240 case "$d_suidsafe" in
6241 '') echo "I'll assume setuid scripts are *not* secure." >&4
6244 echo "Well, the $hint value is *not* secure." >&4
6246 *) echo "Well, the $hint value *is* secure." >&4
6251 $rm -f reflect flect
6252 echo "#!$ls" >reflect
6253 chmod +x,u+s reflect
6256 echo '"su" will (probably) prompt you for '"$ans's password."
6257 su $ans -c './reflect >flect'
6258 if $contains "/dev/fd" flect >/dev/null; then
6259 echo "Okay, it looks like setuid scripts are secure." >&4
6262 echo "I don't think setuid scripts are secure." >&4
6267 rp='Does your kernel have *secure* setuid scripts?'
6270 [yY]*) val="$define";;
6275 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6276 echo "(That's for file descriptors, not floppy disks.)"
6282 $rm -f reflect flect
6284 : now see if they want to do setuid emulation
6287 case "$d_suidsafe" in
6290 echo "No need to emulate SUID scripts since they are secure here." >&4
6294 Some systems have disabled setuid scripts, especially systems where
6295 setuid scripts cannot be secure. On systems where setuid scripts have
6296 been disabled, the setuid/setgid bits on scripts are currently
6297 useless. It is possible for $package to detect those bits and emulate
6298 setuid/setgid in a secure fashion. This emulation will only work if
6299 setuid scripts have been disabled in your kernel.
6303 "$define") dflt=y ;;
6306 rp="Do you want to do setuid/setgid emulation?"
6309 [yY]*) val="$define";;
6317 : Find perl5.005 or later.
6318 echo "Looking for a previously installed perl5.005 or later... "
6320 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6321 : Check if this perl is recent and can load a simple module
6322 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6325 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6335 '') echo "None found. That's ok.";;
6336 *) echo "Using $perl5." ;;
6341 After $package is installed, you may wish to install various
6342 add-on modules and utilities. Typically, these add-ons will
6343 be installed under $prefix with the rest
6344 of this package. However, you may wish to install such add-ons
6345 elsewhere under a different prefix.
6347 If you do not wish to put everything under a single prefix, that's
6348 ok. You will be prompted for the individual locations; this siteprefix
6349 is only used to suggest the defaults.
6351 The default should be fine for most people.
6355 rp='Installation prefix to use for add-on modules and utilities?'
6356 : XXX Here might be another good place for an installstyle setting.
6357 case "$siteprefix" in
6359 *) dflt=$siteprefix ;;
6362 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6364 case "$siteprefix" in
6368 *) oldsiteprefix="$prefix";;
6373 siteprefixexp="$ansexp"
6375 : determine where site specific libraries go.
6376 : Usual default is /usr/local/lib/perl5/site_perl/$version
6377 : The default "style" setting is made in installstyle.U
6378 : XXX No longer works with Prefixit stuff.
6379 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6381 '') case "$installstyle" in
6382 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6383 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6391 The installation process will create a directory for
6392 site-specific extensions and modules. Most users find it convenient
6393 to place all site-specific files in this directory rather than in the
6394 main distribution directory.
6398 rp='Pathname for the site-specific library files?'
6402 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6404 : Determine list of previous versions to include in @INC
6405 $cat > getverlist <<EOPL
6408 \$api_versionstring = "$api_versionstring";
6409 \$version = "$version";
6410 \$stem = "$sitelib_stem";
6411 \$archname = "$archname";
6413 $cat >> getverlist <<'EOPL'
6414 # The list found is store twice for each entry: the original name, and
6415 # the binary broken down version as pack "sss", so sorting is easy and
6416 # unambiguous. This will work for all versions that have a maximum of
6417 # three digit groups, separate by '.'s or '_'s. Names are extended with
6418 # ".0.0" to ensure at least three elements for the pack.
6419 # -- H.Merijn Brand (m)'06 23-10-2006
6421 # Can't have leading @ because metaconfig interprets it as a command!
6422 ;@inc_version_list=();
6423 # XXX Redo to do opendir/readdir?
6426 ;@candidates = map {
6427 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
6433 ($pversion, $aversion, $vsn5005) = map {
6434 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
6435 foreach $d (@candidates) {
6436 if ($d->[1] lt $pversion) {
6437 if ($d->[1] ge $aversion) {
6438 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
6440 elsif ($d->[1] ge $vsn5005) {
6441 unshift(@inc_version_list, grep { -d } $d->[0]);
6445 # Skip newer version. I.e. don't look in
6446 # 5.7.0 if we're installing 5.6.1.
6450 if (@inc_version_list) {
6451 print join(' ', @inc_version_list);
6454 # Blank space to preserve value for next Configure run.
6459 case "$inc_version_list" in
6460 '') if test -x "$perl5$exe_ext"; then
6461 dflt=`$perl5 getverlist`
6466 $undef) dflt='none' ;;
6467 *) eval dflt=\"$inc_version_list\" ;;
6470 ''|' ') dflt=none ;;
6477 In order to ease the process of upgrading, this version of perl
6478 can be configured to use modules built and installed with earlier
6479 versions of perl that were installed under $prefix. Specify here
6480 the list of earlier versions that this version of perl should check.
6481 If Configure detected no earlier versions of perl installed under
6482 $prefix, then the list will be empty. Answer 'none' to tell perl
6483 to not search earlier versions.
6485 The default should almost always be sensible, so if you're not sure,
6486 just accept the default.
6489 rp='List of earlier versions to include in @INC?'
6492 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6493 *) inc_version_list="$ans" ;;
6495 case "$inc_version_list" in
6497 inc_version_list_init='0'
6498 d_inc_version_list="$undef"
6500 *) inc_version_list_init=`echo $inc_version_list |
6501 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6502 d_inc_version_list="$define"
6507 : see if this is a malloc.h system
6508 : we want a real compile instead of Inhdr because some systems have a
6509 : malloc.h that just gives a compile error saying to use stdlib.h instead
6514 int main () { return 0; }
6517 if eval $compile; then
6518 echo "<malloc.h> found." >&4
6521 echo "<malloc.h> NOT found." >&4
6528 : check for void type
6530 echo "Checking to see how well your C compiler groks the void type..." >&4
6531 case "$voidflags" in
6543 extern void moo(); /* function returning void */
6544 void (*goo)(); /* ptr to func returning void */
6546 void *hue; /* generic ptr */
6559 int main() { sub(); }
6561 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6562 voidflags=$defvoidused
6563 echo "Good. It appears to support void to the level $package wants.">&4
6564 if $contains warning .out >/dev/null 2>&1; then
6565 echo "However, you might get some warnings that look like this:"
6569 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6570 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6571 echo "It supports 1..."
6572 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6573 echo "It also supports 2..."
6574 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6576 echo "And it supports 4 but not 8 definitely."
6578 echo "It doesn't support 4..."
6579 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6581 echo "But it supports 8."
6584 echo "Neither does it support 8."
6588 echo "It does not support 2..."
6589 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6591 echo "But it supports 4 and 8."
6593 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6595 echo "And it supports 4 but has not heard about 8."
6597 echo "However it supports 8 but not 4."
6602 echo "There is no support at all for void."
6607 case "$voidflags" in
6610 Support flag bits are:
6611 1: basic void declarations.
6612 2: arrays of pointers to functions returning void.
6613 4: operations between pointers to and addresses of void functions.
6614 8: generic void pointers.
6617 rp="Your void support flags add up to what?"
6624 : check for length of pointer
6628 echo "Checking to see how big your pointers are..." >&4
6629 if test "$voidflags" -gt 7; then
6630 echo '#define VOID_PTR char *' > try.c
6632 echo '#define VOID_PTR void *' > try.c
6642 printf("%d\n", (int)sizeof(VOID_PTR));
6647 if eval $compile_ok; then
6648 ptrsize=`$run ./try`
6649 echo "Your pointers are $ptrsize bytes long."
6652 echo "(I can't seem to compile the test program. Guessing...)" >&4
6653 rp="What is the size of a pointer (in bytes)?"
6660 case "$use64bitall" in
6661 "$define"|true|[yY]*)
6665 *** You have chosen a maximally 64-bit build,
6666 *** but your pointers are only 4 bytes wide.
6667 *** Please rerun Configure without -Duse64bitall.
6672 *** Since you have quads, you could possibly try with -Duse64bitint.
6677 *** Cannot continue, aborting.
6688 : determine whether to use malloc wrapping
6690 case "$usemallocwrap" in
6691 [yY]*|true|$define) dflt='y' ;;
6692 [nN]*|false|$undef) dflt='n' ;;
6693 *) case "$usedevel" in
6694 [yY]*|true|$define) dflt='y' ;;
6699 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6701 usemallocwrap="$ans"
6704 usemallocwrap="$define" ;;
6706 usemallocwrap="$undef" ;;
6709 : determine which malloc to compile in
6711 case "$usemymalloc" in
6712 [yY]*|true|$define) dflt='y' ;;
6713 [nN]*|false|$undef) dflt='n' ;;
6714 *) case "$ptrsize" in
6720 rp="Do you wish to attempt to use the malloc that comes with $package?"
6726 mallocsrc='malloc.c'
6727 mallocobj="malloc$_o"
6728 d_mymalloc="$define"
6731 : Remove malloc from list of libraries to use
6732 echo "Removing unneeded -lmalloc from library list" >&4
6733 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6736 echo "libs = $libs" >&4
6748 : compute the return types of malloc and free
6750 $cat >malloc.c <<END
6754 #include <sys/types.h>
6768 case "$malloctype" in
6770 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6777 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6781 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6788 echo "Your system uses $freetype free(), it would seem." >&4
6790 : determine where site specific architecture-dependent libraries go.
6791 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6792 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6793 : sitelib may have an optional trailing /share.
6795 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6796 dflt="$dflt/$archname"
6801 set sitearch sitearch none
6805 The installation process will also create a directory for
6806 architecture-dependent site-specific extensions and modules.
6810 rp='Pathname for the site-specific architecture-dependent library files?'
6814 if $test X"$sitearch" = X"$sitelib"; then
6817 d_sitearch="$define"
6822 The installation process will also create a directory for
6823 vendor-supplied add-ons. Vendors who supply perl with their system
6824 may find it convenient to place all vendor-supplied files in this
6825 directory rather than in the main distribution directory. This will
6826 ease upgrades between binary-compatible maintenance versions of perl.
6828 Of course you may also use these directories in whatever way you see
6829 fit. For example, you might use them to access modules shared over a
6830 company-wide network.
6832 The default answer should be fine for most people.
6833 This causes further questions about vendor add-ons to be skipped
6834 and no vendor-specific directories will be configured for perl.
6837 rp='Do you want to configure vendor-specific add-on directories?'
6838 case "$usevendorprefix" in
6839 define|true|[yY]*) dflt=y ;;
6840 *) : User may have set vendorprefix directly on Configure command line.
6841 case "$vendorprefix" in
6850 rp='Installation prefix to use for vendor-supplied add-ons?'
6851 case "$vendorprefix" in
6853 *) dflt=$vendorprefix ;;
6856 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6858 case "$vendorprefix" in
6862 *) oldvendorprefix="$prefix";;
6866 usevendorprefix="$define"
6868 vendorprefixexp="$ansexp"
6870 *) usevendorprefix="$undef"
6876 case "$vendorprefix" in
6877 '') d_vendorlib="$undef"
6881 *) d_vendorlib="$define"
6882 : determine where vendor-supplied modules go.
6883 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6884 case "$vendorlib" in
6886 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6887 case "$installstyle" in
6888 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6889 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6892 *) dflt="$vendorlib"
6896 rp='Pathname for the vendor-supplied library files?'
6899 vendorlibexp="$ansexp"
6902 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6906 case "$vendorprefix" in
6907 '') d_vendorarch="$undef"
6911 *) d_vendorarch="$define"
6912 : determine where vendor-supplied architecture-dependent libraries go.
6913 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6914 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6915 : vendorlib may have an optional trailing /share.
6916 case "$vendorarch" in
6917 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6918 dflt="$dflt/$archname"
6920 *) dflt="$vendorarch" ;;
6923 rp='Pathname for vendor-supplied architecture-dependent files?'
6926 vendorarchexp="$ansexp"
6929 prefixvar=vendorarch
6932 : Final catch-all directories to search
6935 Lastly, you can have perl look in other directories for extensions and
6936 modules in addition to those already specified.
6937 These directories will be searched after
6941 test X"$vendorlib" != "X" && echo ' ' $vendorlib
6942 test X"$vendorarch" != "X" && echo ' ' $vendorarch
6944 case "$otherlibdirs" in
6945 ''|' ') dflt='none' ;;
6946 *) dflt="$otherlibdirs" ;;
6949 Enter a colon-separated set of extra paths to include in perl's @INC
6950 search path, or enter 'none' for no extra paths.
6954 rp='Colon-separated list of additional directories for perl to search?'
6957 ' '|''|none) otherlibdirs=' ' ;;
6958 *) otherlibdirs="$ans" ;;
6960 case "$otherlibdirs" in
6964 set d_perl_otherlibdirs
6967 : Cruising for prototypes
6969 echo "Checking out function prototypes..." >&4
6970 $cat >prototype.c <<EOCP
6975 int main(int argc, char *argv[]) {
6978 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
6979 echo "Your C compiler appears to support function prototypes."
6982 echo "Your C compiler doesn't seem to understand function prototypes."
6989 case "$prototype" in
6991 *) ansi2knr='ansi2knr'
6996 This version of $package can only be compiled by a compiler that
6997 understands function prototypes. Unfortunately, your C compiler
6999 doesn't seem to understand them. Sorry about that.
7001 If GNU cc is available for your system, perhaps you could try that instead.
7003 Eventually, we hope to support building Perl with pre-ANSI compilers.
7004 If you would like to help in that effort, please contact <perlbug@perl.org>.
7006 Aborting Configure now.
7018 Perl can be built with extra modules or bundles of modules which
7019 will be fetched from the CPAN and installed alongside Perl.
7021 Notice that you will need access to the CPAN; either via the Internet,
7022 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
7023 be asked later to configure the CPAN.pm module which will in turn do
7024 the installation of the rest of the extra modules or bundles.)
7026 Notice also that if the modules require any external software such as
7027 libraries and headers (the libz library and the zlib.h header for the
7028 Compress::Zlib module, for example) you MUST have any such software
7029 already installed, this configuration process will NOT install such
7032 If this doesn't make any sense to you, just accept the default '$dflt'.
7034 rp='Install any extra modules (y or n)?'
7040 Please list any extra modules or bundles to be installed from CPAN,
7041 with spaces between the names. The names can be in any format the
7042 'install' command of CPAN.pm will understand. (Answer 'none',
7043 without the quotes, to install no extra modules or bundles.)
7053 $rm -f ../extras.lst
7055 *) echo "(Saving the list of extras for later...)"
7056 echo "$extras" > ../extras.lst
7064 : determine where html pages for programs go
7065 set html1dir html1dir none
7069 If you wish to install html files for programs in $spackage, indicate
7070 the appropriate directory here. To skip installing html files,
7074 ''|none|$undef|' ') dflt=none ;;
7075 *) dflt=$html1dir ;;
7078 rp="Directory for the main $spackage html pages?"
7082 : Use ' ' for none so value is preserved next time through Configure
7083 $test X"$html1dir" = "X" && html1dir=' '
7085 : determine where html pages for libraries and modules go
7086 set html3dir html3dir none
7090 If you wish to install html files for modules associated with $spackage,
7091 indicate the appropriate directory here. To skip installing html files,
7094 : There is no obvious default. If they have specified html1dir, then
7095 : try to key off that, possibly changing .../html1 into .../html3.
7097 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7098 *) dflt=$html3dir ;;
7101 rp="Directory for the $spackage module html pages?"
7105 : Use ' ' for none so value is preserved next time through Configure
7106 $test X"$html3dir" = "X" && html3dir=' '
7108 : determine whether to install perl also as /usr/bin/perl
7111 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7113 Many scripts expect perl to be installed as /usr/bin/perl.
7115 If you want to, I can install the perl you are about to compile
7116 as /usr/bin/perl (in addition to $bin/perl).
7118 if test -f /usr/bin/perl; then
7121 However, please note that because you already have a /usr/bin/perl,
7122 overwriting that with a new Perl would very probably cause problems.
7123 Therefore I'm assuming you don't want to do that (unless you insist).
7126 case "$installusrbinperl" in
7127 "$define"|[yY]*) dflt='y';;
7133 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7136 case "$installusrbinperl" in
7137 "$undef"|[nN]*) dflt='n';;
7141 rp="Do you want to install perl as /usr/bin/perl?"
7144 [yY]*) val="$define";;
7150 set installusrbinperl
7154 echo "Checking for GNU C Library..." >&4
7156 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7157 alone are insufficient to distinguish different versions, such as
7158 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7159 libc version 2.1.0. A. Dougherty, June 3, 2002.
7165 # ifdef __GLIBC_MINOR__
7166 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
7167 # include <gnu/libc-version.h>
7168 printf("%s\n", gnu_get_libc_version());
7170 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7173 printf("%d\n", __GLIBC__);
7182 if eval $compile_ok && $run ./try > glibc.ver; then
7184 gnulibc_version=`$cat glibc.ver`
7185 echo "You are using the GNU C Library version $gnulibc_version"
7189 echo "You are not using the GNU C Library"
7195 : see if nm is to be used to determine whether a symbol is defined or not
7199 case "$d_gnulibc" in
7202 echo "nm probably won't work on the GNU C Library." >&4
7208 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7210 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7211 echo "'nm' won't be sufficient on this sytem." >&4
7217 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7218 if $test $dflt -gt 20; then
7228 true|$define) dflt=y;;
7235 I can use $nm to extract the symbols from your C libraries. This
7236 is a time consuming task which may generate huge output on the disk (up
7237 to 3 megabytes) but that should make the symbols extraction faster. The
7238 alternative is to skip the 'nm' extraction part and to compile a small
7239 test program instead to determine whether each symbol is present. If
7240 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7241 this may be the best solution.
7243 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7246 rp="Shall I use $nm to extract C symbols from the libraries?"
7249 [Nn]*) usenm=false;;
7258 : nm options which may be necessary
7260 '') if $test -f /mach_boot; then
7262 elif $test -d /usr/ccs/lib; then
7263 nm_opt='-p' # Solaris (and SunOS?)
7264 elif $test -f /dgux; then
7266 elif $test -f /lib64/rld; then
7267 nm_opt='-p' # 64-bit Irix
7273 : nm options which may be necessary for shared libraries but illegal
7274 : for archive libraries. Thank you, Linux.
7275 case "$nm_so_opt" in
7276 '') case "$myuname" in
7278 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7279 nm_so_opt='--dynamic'
7288 : get list of predefined functions in a handy place
7293 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7299 *) for thislib in $libs; do
7302 : Handle C library specially below.
7305 thislib=`echo $thislib | $sed -e 's/^-l//'`
7306 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7308 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7310 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7312 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7314 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7316 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7318 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7323 libnames="$libnames $try"
7325 *) libnames="$libnames $thislib" ;;
7334 for xxx in $libpth; do
7335 $test -r $1 || set $xxx/libc.$so
7336 : The messy sed command sorts on library version numbers.
7338 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7339 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7341 s/[0-9][0-9]*/0000&/g
7342 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7345 $sort | $sed -e 's/^.* //'`
7348 $test -r $1 || set /usr/ccs/lib/libc.$so
7349 $test -r $1 || set /lib/libsys_s$_a
7355 if $test -r "$1"; then
7356 echo "Your (shared) C library seems to be in $1."
7358 elif $test -r /lib/libc && $test -r /lib/clib; then
7359 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7361 libc='/lib/clib /lib/libc'
7362 if $test -r /lib/syslib; then
7363 echo "(Your math library is in /lib/syslib.)"
7364 libc="$libc /lib/syslib"
7366 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7367 echo "Your C library seems to be in $libc, as you said before."
7368 elif $test -r $incpath/usr/lib/libc$_a; then
7369 libc=$incpath/usr/lib/libc$_a;
7370 echo "Your C library seems to be in $libc. That's fine."
7371 elif $test -r /lib/libc$_a; then
7373 echo "Your C library seems to be in $libc. You're normal."
7375 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7377 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7378 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7379 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7381 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7383 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7386 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7388 if $test -r "$tans"; then
7389 echo "Your C library seems to be in $tans, of all places."
7395 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7399 If the guess above is wrong (which it might be if you're using a strange
7400 compiler, or your machine supports multiple models), you can override it here.
7405 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7407 I can't seem to find your C library. I've looked in the following places:
7410 $sed 's/^/ /' libpath
7413 None of these seems to contain your C library. I need to get its name...
7418 rp='Where is your C library?'
7423 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7424 set X `cat libnames`
7427 case $# in 1) xxx=file; esac
7428 echo "Extracting names from the following $xxx for later perusal:" >&4
7430 $sed 's/^/ /' libnames >&4
7432 $echo $n "This may take a while...$c" >&4
7436 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7437 *) $nm $nm_opt $file 2>/dev/null;;
7442 $grep fprintf libc.tmp > libc.ptf
7443 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7444 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7446 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7448 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7450 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7452 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7454 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7456 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7458 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7460 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7462 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7464 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7466 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7468 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7470 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7471 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7473 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7475 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7477 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7479 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7481 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7483 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7485 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7487 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7489 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7491 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7493 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7495 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7497 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7499 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7501 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7504 $nm -p $* 2>/dev/null >libc.tmp
7505 $grep fprintf libc.tmp > libc.ptf
7506 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7507 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7513 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7515 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
7516 for thisname in $libnames $libc; do
7517 $ar t $thisname >>libc.tmp
7519 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7521 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7522 # Repeat libc to extract forwarders to DLL entries too
7523 for thisname in $libnames $libc; do
7524 $ar tv $thisname >>libc.tmp
7525 # Revision 50 of EMX has bug in $ar.
7526 # it will not extract forwarders to DLL entries
7527 # Use emximp which will extract exactly them.
7528 emximp -o tmp.imp $thisname \
7530 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7531 < tmp.imp >>libc.tmp
7534 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7537 echo "$ar didn't seem to work right." >&4
7538 echo "Maybe this is a Cray...trying bld instead..." >&4
7539 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
7541 for thisname in $libnames; do
7543 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7544 $ar t $thisname >>libc.tmp
7548 echo "That didn't work either. Giving up." >&4
7558 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7559 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7561 *) if $test -f /lib/syscalls.exp; then
7563 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7564 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' /lib/syscalls.exp >>libc.list
7570 $rm -f libnames libpath
7572 : see if dld is available
7578 echo "Checking for C++..." >&4
7592 if eval $compile_ok && $run ./try >cplusplus$$; then
7593 val=`$cat cplusplus$$`
7594 echo "You are using a C++ compiler."
7597 echo "You are not using a C++ compiler."
7603 : is a C symbol defined?
7606 -v) tf=libc.tmp; tdc="";;
7607 -a) tf=libc.tmp; tdc="[]";;
7608 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7611 case "$reuseval-$4" in
7613 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7618 case "$d_cplusplus" in
7619 $define) extern_C=\"C\";;
7621 if $test "$runnm" = true; then
7622 if $contains $tlook $tf >/dev/null 2>&1; then
7624 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7625 echo "extern $extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7626 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7627 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7631 echo "extern $extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7632 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7638 $define) tval=true;;
7645 : define an is-in-libc? function
7646 inlibc='echo " "; td=$define; tu=$undef;
7647 sym=$1; var=$2; eval "was=\$$2";
7649 case "$reuseval$was" in
7659 echo "$sym() found." >&4;
7660 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7662 echo "$sym() NOT found." >&4;
7663 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7667 $define) echo "$sym() found." >&4;;
7668 *) echo "$sym() NOT found." >&4;;
7672 : see if dlopen exists
7674 xxx_ccflags="$ccflags"
7676 : with g++ one needs -shared to get is-in-libc to work for dlopen
7677 case "$gccversion" in
7679 *) case "$d_cplusplus" in
7680 "$define") ccflags="$ccflags -shared" ;;
7687 ccflags="$xxx_ccflags"
7689 : see if this is a unistd.h system
7690 set unistd.h i_unistd
7693 : determine which dynamic loading, if any, to compile in
7695 dldir="ext/DynaLoader"
7708 $define) dflt='y' ;;
7711 $define) dflt='y' ;;
7713 : Does a dl_xxx.xs file exist for this operating system
7714 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7717 rp="Do you wish to use dynamic loading?"
7724 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7725 dflt="$dldir/dl_${osname}.xs"
7726 elif $test "$d_dlopen" = "$define" ; then
7727 dflt="$dldir/dl_dlopen.xs"
7728 elif $test "$i_dld" = "$define" ; then
7729 dflt="$dldir/dl_dld.xs"
7734 *) dflt="$dldir/$dlsrc"
7737 echo "The following dynamic loading files are available:"
7738 : Can not go over to $dldir because getfile has path hard-coded in.
7739 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7740 rp="Source file to use for dynamic loading"
7746 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7750 Some systems may require passing special flags to $cc -c to
7751 compile modules that will be used to create a shared library.
7752 To use no flags, say "none".
7755 case "$cccdlflags" in
7756 '') case "$gccversion" in
7757 '') case "$osname" in
7759 next) dflt='none' ;;
7760 irix*) dflt='-KPIC' ;;
7761 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7762 sunos) dflt='-pic' ;;
7766 *) case "$osname" in
7767 darwin) dflt='none' ;;
7768 linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7773 *) dflt="$cccdlflags" ;;
7775 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7778 none) cccdlflags=' ' ;;
7779 *) cccdlflags="$ans" ;;
7784 Some systems use ld to create libraries that can be dynamically loaded,
7785 while other systems (such as those using ELF) use $cc.
7789 '') $cat >try.c <<EOM
7790 /* Test for whether ELF binaries are produced */
7802 int i = open("a.out",O_RDONLY);
7805 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7806 exit(0); /* succeed (yes, it's ELF) */
7811 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7813 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7817 echo "I'll use ld to build dynamic libraries."
7826 rp="What command should be used to create dynamic libraries?"
7832 Some systems may require passing special flags to $ld to create a
7833 library that can be dynamically loaded. If your ld flags include
7834 -L/other/path options to locate libraries outside your loader's normal
7835 search path, you may need to specify those -L options here as well. To
7836 use no flags, say "none".
7839 case "$lddlflags" in
7840 '') case "$osname" in
7841 beos) dflt='-nostart' ;;
7843 case "$gccversion" in
7844 '') dflt="$dflt +vnocompatwarnings" ;;
7847 linux|irix*|gnu*) dflt="-shared $optimize" ;;
7848 next) dflt='none' ;;
7849 solaris) dflt='-G' ;;
7850 sunos) dflt='-assert nodefinitions' ;;
7851 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
7855 *) dflt="$lddlflags" ;;
7858 : Try to guess additional flags to pick up local libraries.
7859 : Be careful not to append to a plain 'none'
7863 for thisflag in $ldflags; do
7868 *) dflt="$dflt $thisflag" ;;
7875 ''|' ') dflt='none' ;;
7878 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
7881 none) lddlflags=' ' ;;
7882 *) lddlflags="$ans" ;;
7887 Some systems may require passing special flags to $cc to indicate that
7888 the resulting executable will use dynamic linking. To use no flags,
7892 case "$ccdlflags" in
7893 '') case "$osname" in
7894 linux|hpux|gnu*) dflt='-Wl,-E' ;;
7895 next|sunos) dflt='none' ;;
7899 *) dflt="$ccdlflags" ;;
7901 rp="Any special flags to pass to $cc to use dynamic linking?"
7904 none) ccdlflags=' ' ;;
7905 *) ccdlflags="$ans" ;;
7919 # No dynamic loading being used, so don't bother even to prompt.
7922 *) case "$useshrplib" in
7923 '') case "$osname" in
7924 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
7926 also='Building a shared libperl is required for dynamic loading to work on your system.'
7931 also='Building a shared libperl is needed for MAB support.'
7949 The perl executable is normally obtained by linking perlmain.c with
7950 libperl${_a}, any static extensions (usually just DynaLoader), and
7951 any other libraries needed on this system (such as -lm, etc.). Since
7952 your system supports dynamic loading, it is probably possible to build
7953 a shared libperl.$so. If you will have more than one executable linked
7954 to libperl.$so, this will significantly reduce the size of each
7955 executable, but it may have a noticeable effect on performance. The
7956 default is probably sensible for your system.
7960 rp="Build a shared libperl.$so (y/n)"
7964 useshrplib='true' ;;
7965 *) useshrplib='false' ;;
7970 case "$useshrplib" in
7974 # Figure out a good name for libperl.so. Since it gets stored in
7975 # a version-specific architecture-dependent library, the version
7976 # number isn't really that important, except for making cc/ld happy.
7978 # A name such as libperl.so.3.1
7979 majmin="libperl.$so.$patchlevel.$subversion"
7980 # A name such as libperl.so.301
7981 majonly=`echo $patchlevel $subversion |
7982 $awk '{printf "%d%02d", $1, $2}'`
7983 majonly=libperl.$so.$majonly
7984 # I'd prefer to keep the os-specific stuff here to a minimum, and
7985 # rely on figuring it out from the naming of libc.
7986 case "${osname}${osvers}" in
7989 # XXX How handle the --version stuff for MAB?
7991 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
7994 cygwin*) # ld links against an importlib
7995 dflt=libperl$lib_ext
7997 *) # Try to guess based on whether libc has major.minor.
7999 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8000 *libc.$so.[0-9]*) dflt=$majonly ;;
8001 *) dflt=libperl.$so ;;
8011 I need to select a good name for the shared libperl. If your system uses
8012 library names with major and minor numbers, then you might want something
8013 like $majmin. Alternatively, if your system uses a single version
8014 number for shared libraries, then you might want to use $majonly.
8015 Or, your system might be quite happy with a simple libperl.$so.
8017 Since the shared libperl will get installed into a version-specific
8018 architecture-dependent directory, the version number of the shared perl
8019 library probably isn't important, so the default should be o.k.
8022 rp='What name do you want to give to the shared libperl?'
8025 echo "Ok, I'll use $libperl"
8028 libperl="libperl${_a}"
8032 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8036 WARNING: Use of the shrpdir variable for the installation location of
8037 the shared $libperl is not supported. It was never documented and
8038 will not work in this version. Let me (perlbug@perl.org)
8039 know of any problems this may cause.
8045 But your current setting of $shrpdir is
8046 the default anyway, so it's harmless.
8051 Further, your current attempted setting of $shrpdir
8052 conflicts with the value of $archlibexp/CORE
8053 that installperl will use.
8060 # How will the perl executable find the installed shared $libperl?
8061 # Add $xxx to ccdlflags.
8062 # If we can't figure out a command-line option, use $shrpenv to
8063 # set env LD_RUN_PATH. The main perl makefile uses this.
8064 shrpdir=$archlibexp/CORE
8067 if "$useshrplib"; then
8070 # We'll set it in Makefile.SH...
8075 freebsd|netbsd|openbsd|interix|dragonfly)
8076 xxx="-Wl,-R$shrpdir"
8078 bsdos|linux|irix*|dec_osf|gnu*)
8079 xxx="-Wl,-rpath,$shrpdir"
8082 # next doesn't like the default...
8085 # beos doesn't like the default, either.
8088 # hpux doesn't like the default, either.
8089 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8092 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8098 # Only add $xxx if it isn't already in ccdlflags.
8099 case " $ccdlflags " in
8101 *) ccdlflags="$ccdlflags $xxx"
8104 Adding $xxx to the flags
8105 passed to $ld so that the perl executable will find the
8106 installed shared $libperl.
8114 # Fix ccdlflags in AIX for building external extensions.
8115 # (For building Perl itself bare -bE:perl.exp is needed,
8116 # Makefile.SH takes care of this.)
8118 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8120 # Respect a hint or command-line value.
8122 '') shrpenv="$tmp_shrpenv" ;;
8124 case "$ldlibpthname" in
8125 '') ldlibpthname=LD_LIBRARY_PATH ;;
8126 none) ldlibpthname='' ;;
8129 : determine where manual pages are on this system
8133 syspath='/usr/share/man/man1 /usr/man/man1'
8134 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8135 syspath="$syspath /usr/man/u_man/man1"
8136 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8137 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8138 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8139 sysman=`./loc . /usr/man/man1 $syspath`
8142 if $test -d "$sysman"; then
8143 echo "System manual is in $sysman." >&4
8145 echo "Could not find manual pages in source form." >&4
8148 : determine where manual pages go
8149 set man1dir man1dir none
8153 $spackage has manual pages available in source form.
8157 echo "However, you don't have nroff, so they're probably useless to you."
8159 '') man1dir="none";;
8162 echo "If you don't want the manual sources installed, answer 'none'."
8167 lookpath="$prefixexp/share/man/man1"
8168 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8169 lookpath="$lookpath $prefixexp/man/p_man/man1"
8170 lookpath="$lookpath $prefixexp/man/u_man/man1"
8171 lookpath="$lookpath $prefixexp/man/man.1"
8173 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8174 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8184 rp="Where do the main $spackage manual pages (source) go?"
8186 if $test "X$man1direxp" != "X$ansexp"; then
8197 : What suffix to use on installed man pages
8204 rp="What suffix should be used for the main $spackage man pages?"
8206 '') case "$man1dir" in
8220 *) dflt="$man1ext";;
8227 : see if we can have long filenames
8229 first=123456789abcdef
8231 if (echo hi >$first) 2>/dev/null; then
8232 if $test -f 123456789abcde; then
8233 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8236 echo 'You can have filenames longer than 14 characters.'>&4
8241 You can't have filenames longer than 14 chars.
8242 You can't even think about them!
8248 $rm -rf 123456789abcde*
8250 : determine where library module manual pages go
8251 set man3dir man3dir none
8255 $spackage has manual pages for many of the library modules.
8261 However, you don't have nroff, so they're probably useless to you.
8264 '') man3dir="none";;
8268 case "$d_flexfnam" in
8271 However, your system can't handle the long file names like File::Basename.3.
8274 '') man3dir="none";;
8278 echo "If you don't want the manual sources installed, answer 'none'."
8279 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8281 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8282 if $test -d "$privlib/man/man3"; then
8285 WARNING: Previous versions of perl installed man3 pages into
8286 $privlib/man/man3. This version will suggest a
8287 new default of $dflt.
8291 rp='Do you wish to preserve the old behavior?(y/n)'
8294 y*) dflt="$privlib/man/man3" ;;
8299 *) dflt="$man3dir" ;;
8306 rp="Where do the $package library man pages (source) go?"
8316 : What suffix to use on installed man pages
8322 rp="What suffix should be used for the $package library man pages?"
8324 '') case "$man3dir" in
8338 *) dflt="$man3ext";;
8345 : see if we have to deal with yellow pages, now NIS.
8346 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8347 if $test -f /usr/etc/nibindd; then
8349 echo "I'm fairly confident you're on a NeXT."
8351 rp='Do you get the hosts file via NetInfo?'
8360 y*) hostcat='nidump hosts .';;
8361 *) case "$hostcat" in
8362 nidump*) hostcat='';;
8372 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8380 rp='Are you getting the hosts file via yellow pages?'
8383 y*) hostcat='ypcat hosts';;
8384 *) hostcat='cat /etc/hosts';;
8390 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8393 '') test -f /etc/group && groupcat='cat /etc/group';;
8396 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8399 : now get the host name
8401 echo "Figuring out host name..." >&4
8402 case "$myhostname" in
8404 echo 'Maybe "hostname" will work...'
8405 if tans=`sh -c hostname 2>&1` ; then
8413 if $test "$cont"; then
8415 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8416 if tans=`cat /etc/systemid 2>&1` ; then
8418 phostname='cat /etc/systemid'
8419 echo "Whadyaknow. Xenix always was a bit strange..."
8422 elif $test -r /etc/systemid; then
8423 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8426 if $test "$cont"; then
8427 echo 'No, maybe "uuname -l" will work...'
8428 if tans=`sh -c 'uuname -l' 2>&1` ; then
8430 phostname='uuname -l'
8432 echo 'Strange. Maybe "uname -n" will work...'
8433 if tans=`sh -c 'uname -n' 2>&1` ; then
8435 phostname='uname -n'
8437 echo 'Oh well, maybe I can mine it out of whoami.h...'
8438 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8439 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8440 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8442 case "$myhostname" in
8443 '') echo "Does this machine have an identity crisis or something?"
8446 echo "Well, you said $myhostname before..."
8447 phostname='echo $myhostname';;
8453 case "$myhostname" in
8454 '') myhostname=noname ;;
8456 : you do not want to know about this
8461 if $test "$myhostname" ; then
8463 rp='Your host name appears to be "'$myhostname'".'" Right?"
8471 : bad guess or no guess
8472 while $test "X$myhostname" = X ; do
8474 rp="Please type the (one word) name of your host:"
8479 : translate upper to lower if necessary
8480 case "$myhostname" in
8482 echo "(Normalizing case in your host name)"
8483 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8487 case "$myhostname" in
8489 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8490 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8491 echo "(Trimming domain name from host name--host name is now $myhostname)"
8493 *) case "$mydomain" in
8496 test "X$hostcat" = "Xypcat hosts" &&
8497 ypmatch "$myhostname" hosts 2>/dev/null |\
8498 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8501 test "X$hostcat" != "X" &&
8502 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8503 /[ ]$myhostname[ . ]/p" > hosts
8506 if $test -f hosts; then
8507 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8508 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8509 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8510 hosts | $sort | $uniq | \
8511 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8512 case `$echo X$dflt` in
8513 X*\ *) echo "(Several hosts in the database matched hostname)"
8516 X.) echo "(You do not have fully-qualified names in the hosts database)"
8520 echo "(I cannot locate a hosts database anywhere)"
8525 tans=`./loc resolv.conf X /etc /usr/etc`
8526 if $test -f "$tans"; then
8527 echo "(Attempting domain name extraction from $tans)"
8528 dflt=.`$sed -n -e 's/ / /g' \
8529 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8530 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8532 .) dflt=.`$sed -n -e 's/ / /g' \
8533 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8534 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8541 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8542 dflt=.`sh -c domainname 2>/dev/null`
8545 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8549 case "$dflt$osname" in
8550 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8551 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8555 .) echo "(Lost all hope -- silly guess then)"
8561 *) dflt="$mydomain";;
8565 rp="What is your domain name?"
8575 : translate upper to lower if necessary
8578 echo "(Normalizing case in your domain name)"
8579 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8583 : a little sanity check here
8584 case "$phostname" in
8587 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8588 $myhostname$mydomain|$myhostname) ;;
8590 case "$phostname" in
8592 echo "(That doesn't agree with your whoami.h file, by the way.)"
8595 echo "(That doesn't agree with your $phostname command, by the way.)"
8605 I need to get your e-mail address in Internet format if possible, i.e.
8606 something like user@host.domain. Please answer accurately since I have
8607 no easy means to double check it. The default value provided below
8608 is most probably close to reality but may not be valid from outside
8609 your organization...
8613 while test "$cont"; do
8615 '') dflt="$cf_by@$myhostname$mydomain";;
8616 *) dflt="$cf_email";;
8618 rp='What is your e-mail address?'
8624 rp='Address does not look like an Internet one. Use it anyway?'
8640 If you or somebody else will be maintaining perl at your site, please
8641 fill in the correct e-mail address here so that they may be contacted
8642 if necessary. Currently, the "perlbug" program included with perl
8643 will send mail to this address in addition to perlbug@perl.org. You may
8644 enter "none" for no administrator.
8647 case "$perladmin" in
8648 '') dflt="$cf_email";;
8649 *) dflt="$perladmin";;
8651 rp='Perl administrator e-mail address'
8655 : determine whether to only install version-specific parts.
8658 Do you want to install only the version-specific parts of the perl
8659 distribution? Usually you do *not* want to do this.
8661 case "$versiononly" in
8662 "$define"|[Yy]*|true) dflt='y' ;;
8665 rp="Do you want to install only the version-specific parts of perl?"
8668 [yY]*) val="$define";;
8674 case "$versiononly" in
8675 "$define") inc_version_list=''
8676 inc_version_list_init=0
8680 : figure out how to guarantee perl startup
8681 : XXX Note that this currently takes advantage of the bug that binexp ignores
8682 : the Configure -Dinstallprefix setting, which in turn means that under
8683 : relocatable @INC, initialinstalllocation is what binexp started as.
8684 case "$startperl" in
8686 case "$sharpbang" in
8690 I can use the #! construct to start perl on your system. This will
8691 make startup of perl scripts faster, but may cause problems if you
8692 want to share those scripts and perl is not in a standard place
8693 ($initialinstalllocation/perl) on all your platforms. The alternative
8694 is to force a shell by starting the script with a single ':' character.
8697 case "$versiononly" in
8698 "$define") dflt="$initialinstalllocation/perl$version";;
8699 *) dflt="$initialinstalllocation/perl";;
8701 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8704 none) startperl=": # use perl";;
8705 *) startperl="#!$ans"
8706 if $test 30 -lt `echo "$ans" | wc -c`; then
8709 WARNING: Some systems limit the #! command to 32 characters.
8710 If you experience difficulty running Perl scripts with #!, try
8711 installing Perl in a directory with a shorter pathname.
8717 *) startperl=": # use perl"
8722 echo "I'll use $startperl to start perl scripts."
8724 : figure best path for perl in scripts
8727 case "$versiononly" in
8728 "$define") perlpath="$initialinstalllocation/perl$version";;
8729 *) perlpath="$initialinstalllocation/perl";;
8731 case "$startperl" in
8736 I will use the "eval 'exec'" idiom to start Perl on your system.
8737 I can use the full path of your Perl binary for this purpose, but
8738 doing so may cause problems if you want to share those scripts and
8739 Perl is not always in a standard place ($initialinstalllocation/perl).
8742 dflt="$initialinstalllocation/perl"
8743 rp="What path shall I use in \"eval 'exec'\"?"
8750 case "$startperl" in
8752 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8755 : determine where public executable scripts go
8756 set scriptdir scriptdir
8758 case "$scriptdir" in
8761 : guess some guesses
8762 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8763 $test -d /usr/share/bin && dflt=/usr/share/bin
8764 $test -d /usr/local/script && dflt=/usr/local/script
8765 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8766 $test -d $prefixexp/script && dflt=$prefixexp/script
8770 *) dflt="$scriptdir"
8775 Some installations have a separate directory just for executable scripts so
8776 that they can mount it across multiple architectures but keep the scripts in
8777 one spot. You might, for example, have a subdirectory of /usr/share for this.
8778 Or you might just lump your scripts in with all your other executables.
8782 rp='Where do you keep publicly executable scripts?'
8784 if $test "X$ansexp" != "X$scriptdirexp"; then
8790 : A little fix up for an irregularly named variable.
8791 installscript="$installscriptdir"
8793 : determine where add-on public executables go
8795 '') dflt=$siteprefix/bin ;;
8799 rp='Pathname where the add-on public executables should be installed?'
8804 : determine where add-on html pages go
8805 : There is no standard location, so try to copy the previously-selected
8806 : directory structure for the core html pages.
8807 case "$sitehtml1dir" in
8808 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8809 *) dflt=$sitehtml1dir ;;
8812 ''|' ') dflt=none ;;
8815 rp='Pathname where the site-specific html pages should be installed?'
8817 prefixvar=sitehtml1dir
8820 : determine where add-on library html pages go
8821 : There is no standard location, so try to copy the previously-selected
8822 : directory structure for the core html pages.
8823 case "$sitehtml3dir" in
8824 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8825 *) dflt=$sitehtml3dir ;;
8828 ''|' ') dflt=none ;;
8831 rp='Pathname where the site-specific library html pages should be installed?'
8833 prefixvar=sitehtml3dir
8836 : determine where add-on manual pages go
8837 case "$siteman1dir" in
8838 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
8839 *) dflt=$siteman1dir ;;
8842 ''|' ') dflt=none ;;
8845 rp='Pathname where the site-specific manual pages should be installed?'
8847 prefixvar=siteman1dir
8850 : determine where add-on library man pages go
8851 case "$siteman3dir" in
8852 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
8853 *) dflt=$siteman3dir ;;
8856 ''|' ') dflt=none ;;
8859 rp='Pathname where the site-specific library manual pages should be installed?'
8861 prefixvar=siteman3dir
8864 : determine where add-on public executable scripts go
8865 case "$sitescript" in
8866 '') dflt=$siteprefix/script
8867 $test -d $dflt || dflt=$sitebin ;;
8868 *) dflt="$sitescript" ;;
8871 rp='Pathname where add-on public executable scripts should be installed?'
8873 prefixvar=sitescript
8876 case "$usefaststdio" in
8877 $define|true|[yY]*|'')
8878 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
8888 Perl can be built to use 'fast stdio', which means using the stdio
8889 library but also directly manipulating the stdio buffers to enable
8890 faster I/O. Using stdio is better for backward compatibility (especially
8891 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
8892 interface has been preferred instead of stdio.
8894 If this doesn't make any sense to you, just accept the default '$dflt'.
8896 rp='Use the "fast stdio" if available?'
8899 y|Y) val="$define" ;;
8906 : define an is-a-typedef? function
8907 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8909 "") inclist="sys/types.h";;
8911 eval "varval=\$$var";
8915 for inc in $inclist; do
8916 echo "#include <$inc>" >>temp.c;
8918 echo "#ifdef $type" >> temp.c;
8919 echo "printf(\"We have $type\");" >> temp.c;
8920 echo "#endif" >> temp.c;
8921 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8922 if $contains $type temp.E >/dev/null 2>&1; then
8928 *) eval "$var=\$varval";;
8931 : define an is-a-typedef? function that prompts if the type is not available.
8932 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8934 "") inclist="sys/types.h";;
8936 eval "varval=\$$var";
8940 for inc in $inclist; do
8941 echo "#include <$inc>" >>temp.c;
8943 echo "#ifdef $type" >> temp.c;
8944 echo "printf(\"We have $type\");" >> temp.c;
8945 echo "#endif" >> temp.c;
8946 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8948 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
8949 if $contains $type temp.E >/dev/null 2>&1; then
8950 echo "$type found." >&4;
8953 echo "$type NOT found." >&4;
8959 *) eval "$var=\$varval";;
8962 : see what type lseek is declared as in the kernel
8963 rp="What is the type used for lseek's offset on this system?"
8964 set off_t lseektype long stdio.h sys/types.h
8968 echo "Checking to see how big your file offsets are..." >&4
8970 #include <sys/types.h>
8974 printf("%d\n", (int)sizeof($lseektype));
8979 if eval $compile_ok; then
8980 lseeksize=`$run ./try`
8981 echo "Your file offsets are $lseeksize bytes long."
8985 echo "(I can't seem to compile the test program. Guessing...)"
8986 rp="What is the size of your file offsets (in bytes)?"
8992 : see what type file positions are declared as in the library
8993 rp="What is the type for file position used by fsetpos()?"
8994 set fpos_t fpostype long stdio.h sys/types.h
8999 *_t) zzz="$fpostype" ;;
9002 echo "Checking the size of $zzz..." >&4
9004 #include <sys/types.h>
9011 printf("%d\n", (int)sizeof($fpostype));
9016 if eval $compile_ok; then
9020 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9023 echo "Your $zzz is $fpossize bytes long."
9029 echo "(I can't compile the test program. Guessing...)" >&4
9030 rp="What is the size of your file positions (in bytes)?"
9035 # Backward compatibility (uselfs is deprecated).
9037 "$define"|true|[yY]*)
9040 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9042 uselargefiles="$define"
9046 case "$lseeksize:$fpossize" in
9049 You can have files larger than 2 gigabytes.
9052 *) case "$uselargefiles" in
9053 "$undef"|false|[nN]*) dflt='n' ;;
9058 Perl can be built to understand large files (files larger than 2 gigabytes)
9059 on some systems. To do so, Configure can be run with -Duselargefiles.
9061 If this doesn't make any sense to you, just accept the default '$dflt'.
9063 rp='Try to understand large files, if available?'
9066 y|Y) val="$define" ;;
9073 : Look for a hint-file generated 'call-back-unit'. If the
9074 : user has specified that a large files perl is to be built,
9075 : we may need to set or change some other defaults.
9076 if $test -f uselargefiles.cbu; then
9077 echo "Your platform has some specific hints regarding large file builds, using them..."
9078 . ./uselargefiles.cbu
9080 case "$uselargefiles" in
9082 if $test -f uselargefiles.cbu; then
9084 echo "Rechecking to see how big your file offsets are..." >&4
9086 #include <sys/types.h>
9090 printf("%d\n", (int)sizeof($lseektype));
9095 if eval $compile_ok; then
9096 lseeksize=`$run ./try`
9097 $echo "Your file offsets are now $lseeksize bytes long."
9101 echo "(I can't seem to compile the test program. Guessing...)"
9102 rp="What is the size of your file offsets (in bytes)?"
9107 *_t) zzz="$fpostype" ;;
9110 $echo $n "Rechecking the size of $zzz...$c" >&4
9112 #include <sys/types.h>
9119 printf("%d\n", (int)sizeof($fpostype));
9124 if eval $compile_ok; then
9129 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9132 echo " $fpossize bytes." >&4
9138 echo "(I can't compile the test program. Guessing...)" >&4
9139 rp="What is the size of your file positions (in bytes)?"
9148 case "$vendorprefix" in
9149 '') d_vendorbin="$undef"
9153 *) d_vendorbin="$define"
9154 : determine where vendor-supplied executables go.
9155 case "$vendorbin" in
9156 '') dflt=$vendorprefix/bin ;;
9157 *) dflt="$vendorbin" ;;
9160 rp='Pathname for the vendor-supplied executables directory?'
9163 vendorbinexp="$ansexp"
9169 case "$vendorprefix" in
9170 '') vendorhtml1dir=''
9171 vendorhtml1direxp=''
9173 *) : determine where vendor-supplied html pages go.
9174 : There is no standard location, so try to copy the previously-selected
9175 : directory structure for the core html pages.
9176 : XXX Better default suggestions would be welcome.
9177 case "$vendorhtml1dir" in
9178 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9179 *) dflt=$vendorhtml1dir ;;
9182 ''|' ') dflt=none ;;
9185 rp='Pathname for the vendor-supplied html pages?'
9187 vendorhtml1dir="$ans"
9188 vendorhtml1direxp="$ansexp"
9191 : Use ' ' for none so value is preserved next time through Configure
9192 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9193 prefixvar=vendorhtml1dir
9196 case "$vendorprefix" in
9197 '') vendorhtml3dir=''
9198 vendorhtml3direxp=''
9200 *) : determine where vendor-supplied module html pages go.
9201 : There is no standard location, so try to copy the previously-selected
9202 : directory structure for the core html pages.
9203 : XXX Better default suggestions would be welcome.
9204 case "$vendorhtml3dir" in
9205 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9206 *) dflt=$vendorhtml3dir ;;
9209 ''|' ') dflt=none ;;
9212 rp='Pathname for the vendor-supplied html pages?'
9214 vendorhtml3dir="$ans"
9215 vendorhtml3direxp="$ansexp"
9218 : Use ' ' for none so value is preserved next time through Configure
9219 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9220 prefixvar=vendorhtml3dir
9223 case "$vendorprefix" in
9224 '') vendorman1dir=''
9227 *) : determine where vendor-supplied manual pages go.
9228 case "$vendorman1dir" in
9229 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9230 *) dflt=$vendorman1dir ;;
9233 ''|' ') dflt=none ;;
9236 rp='Pathname for the vendor-supplied manual section 1 pages?'
9238 vendorman1dir="$ans"
9239 vendorman1direxp="$ansexp"
9242 : Use ' ' for none so value is preserved next time through Configure
9243 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9244 prefixvar=vendorman1dir
9247 case "$vendorprefix" in
9248 '') vendorman3dir=''
9251 *) : determine where vendor-supplied module manual pages go.
9252 case "$vendorman3dir" in
9253 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9254 *) dflt=$vendorman3dir ;;
9257 ''|' ') dflt=none ;;
9260 rp='Pathname for the vendor-supplied manual section 3 pages?'
9262 vendorman3dir="$ans"
9263 vendorman3direxp="$ansexp"
9266 : Use ' ' for none so value is preserved next time through Configure
9267 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9268 prefixvar=vendorman3dir
9271 case "$vendorprefix" in
9272 '') d_vendorscript="$undef"
9276 *) d_vendorscript="$define"
9277 : determine where vendor-supplied scripts go.
9278 case "$vendorscript" in
9279 '') dflt=$vendorprefix/script
9280 $test -d $dflt || dflt=$vendorbin ;;
9281 *) dflt="$vendorscript" ;;
9285 The installation process will create a directory for
9286 vendor-supplied scripts.
9290 rp='Pathname for the vendor-supplied scripts directory?'
9293 vendorscriptexp="$ansexp"
9296 prefixvar=vendorscript
9299 : see if qgcvt exists
9305 if $test X"$d_longdbl" = X"$define"; then
9307 echo "Checking how to print long doubles..." >&4
9309 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9310 $cat >try.c <<'EOCP'
9311 #include <sys/types.h>
9315 printf("%.3f\n", d);
9319 if eval $compile; then
9323 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9324 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9325 echo "We will use %f."
9331 if $test X"$sPRIfldbl" = X; then
9332 $cat >try.c <<'EOCP'
9333 #include <sys/types.h>
9336 long double d = 123.456;
9337 printf("%.3Lf\n", d);
9341 if eval $compile; then
9345 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9346 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9347 echo "We will use %Lf."
9353 if $test X"$sPRIfldbl" = X; then
9354 $cat >try.c <<'EOCP'
9355 #include <sys/types.h>
9358 long double d = 123.456;
9359 printf("%.3llf\n", d);
9363 if eval $compile; then
9367 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9368 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9369 echo "We will use %llf."
9375 if $test X"$sPRIfldbl" = X; then
9376 $cat >try.c <<'EOCP'
9377 #include <sys/types.h>
9380 long double d = 123.456;
9381 printf("%.3lf\n", d);
9385 if eval $compile; then
9389 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9390 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9391 echo "We will use %lf."
9397 if $test X"$sPRIfldbl" = X; then
9398 echo "Cannot figure out how to print long doubles." >&4
9400 sSCNfldbl=$sPRIfldbl # expect consistency
9407 case "$sPRIfldbl" in
9408 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9409 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9410 d_SCNfldbl="$undef";
9412 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9413 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9414 d_SCNfldbl="$define";
9418 : Check how to convert floats to strings.
9420 if test "X$d_Gconvert" = X; then
9423 echo "Checking for an efficient way to convert floats to strings."
9425 case "$uselongdouble" in
9426 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9428 case "$d_longdbl" in
9429 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9431 case "$d_PRIgldbl" in
9432 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9436 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9437 char *myname = "gconvert";
9440 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9441 char *myname = "gcvt";
9444 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9445 char *myname = "qgcvt";
9446 #define DOUBLETYPE long double
9449 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9451 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9453 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9456 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9458 char *myname = "sprintf";
9462 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9463 #define DOUBLETYPE long double
9465 #define DOUBLETYPE double
9471 #define I_STDLIB $i_stdlib
9477 checkit(expect, got)
9481 if (strcmp(expect, got)) {
9482 printf("%s oddity: Expected %s, got %s\n",
9483 myname, expect, got);
9493 /* This must be 1st test on (which?) platform */
9494 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9495 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9496 checkit("0.1", buf);
9498 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9499 checkit("0.01", buf);
9501 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9502 checkit("0.001", buf);
9504 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9505 checkit("0.0001", buf);
9507 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9508 if (strlen(buf) > 5)
9509 checkit("9e-005", buf); /* for Microsoft ?? */
9511 checkit("9e-05", buf);
9513 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9516 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9517 checkit("1.1", buf);
9519 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9520 checkit("1.01", buf);
9522 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9523 checkit("1.001", buf);
9525 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9526 checkit("1.0001", buf);
9528 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9529 checkit("1.00001", buf);
9531 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9532 checkit("1.000001", buf);
9534 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9537 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9540 /* Some Linux gcvt's give 1.e+5 here. */
9541 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9542 checkit("100000", buf);
9544 /* Some Linux gcvt's give -1.e+5 here. */
9545 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9546 checkit("-100000", buf);
9548 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9549 checkit("123.456", buf);
9551 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9552 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9553 /* 34 should be enough to scare even long double
9554 * places into using the e notation. */
9555 if (strlen(buf) > 5)
9556 checkit("1e+034", buf); /* for Microsoft */
9558 checkit("1e+34", buf);
9560 /* For Perl, if you add additional tests here, also add them to
9561 * t/base/num.t for benefit of platforms not using Configure or
9562 * overriding d_Gconvert */
9567 : first add preferred functions to our list
9569 for xxx_convert in $gconvert_preference; do
9570 case $xxx_convert in
9571 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9572 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9575 : then add any others
9576 for xxx_convert in gconvert gcvt sprintf; do
9579 *) xxx_list="$xxx_list $xxx_convert" ;;
9583 case "$d_longdbl$uselongdouble" in
9585 : again, add prefered functions to our list first
9587 for xxx_convert in $gconvert_ld_preference; do
9588 case $xxx_convert in
9589 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9590 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9593 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9594 for xxx_convert in qgcvt sprintf $xxx_list; do
9595 case "$xxx_ld_list" in
9596 $xxx_convert*|*" $xxx_convert"*) ;;
9597 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9600 : if sprintf cannot do long doubles, move it to the end
9601 if test "$d_PRIgldbl" != "$define"; then
9602 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9604 : if no qgcvt, remove it
9605 if test "$d_qgcvt" != "$define"; then
9606 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9609 xxx_list="$xxx_ld_list"
9613 for xxx_convert in $xxx_list; do
9614 echo "Trying $xxx_convert..."
9615 $rm -f try try$_o core
9616 set try -DTRY_$xxx_convert
9617 if eval $compile; then
9618 echo "$xxx_convert() found." >&4
9620 echo "I'll use $xxx_convert to convert floats into a string." >&4
9623 echo "...But $xxx_convert didn't work as I expected."
9627 echo "$xxx_convert NOT found." >&4
9631 if test X$xxx_convert = X; then
9632 echo "*** WHOA THERE!!! ***" >&4
9633 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9637 case "$xxx_convert" in
9638 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9639 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9640 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9641 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9642 "$define$define$define")
9643 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9644 "$define$define$undef")
9645 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9646 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9654 : see if _fwalk exists
9658 : Initialize h_fcntl
9661 : Initialize h_sysfile
9664 : access call always available on UNIX
9668 : locate the flags for 'access()'
9672 $cat >access.c <<EOCP
9673 #include <sys/types.h>
9678 #include <sys/file.h>
9691 : check sys/file.h first, no particular reason here
9692 if $test `./findhdr sys/file.h` && \
9693 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9695 echo "<sys/file.h> defines the *_OK access constants." >&4
9696 elif $test `./findhdr fcntl.h` && \
9697 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9699 echo "<fcntl.h> defines the *_OK access constants." >&4
9700 elif $test `./findhdr unistd.h` && \
9701 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9702 echo "<unistd.h> defines the *_OK access constants." >&4
9704 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9710 : see if accessx exists
9711 set accessx d_accessx
9714 : see if aintl exists
9718 : see if alarm exists
9722 : see if POSIX threads are available
9723 set pthread.h i_pthread
9726 : define a fucntion to check prototypes
9727 $cat > protochk <<EOSH
9730 optimize="$optimize"
9732 prototype="$prototype"
9735 usethreads=$usethreads
9736 i_pthread=$i_pthread
9737 pthread_h_first=$pthread_h_first
9740 $cat >> protochk <<'EOSH'
9745 while test $# -ge 2; do
9747 $define) echo "#include <$2>" >> try.c ;;
9748 literal) echo "$2" >> try.c ;;
9750 # Extra magic for the benefit of systems that need pthread.h
9751 # to be included early to correctly detect threadsafe functions.
9752 # Such functions must guarantee themselves, though, that the usethreads
9753 # and i_pthread have been defined, before calling protochk.
9754 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
9755 echo "#include <pthread.h>" >> try.c
9760 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
9761 cat >> try.c <<'EOCP'
9762 #ifdef CAN_PROTOTYPE
9763 #define _(args) args
9768 echo "$foo" >> try.c
9769 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
9770 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
9778 hasproto='varname=$1; func=$2; shift; shift;
9779 while $test $# -ge 2; do
9781 $define) echo "#include <$2>";;
9785 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
9786 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
9787 echo "$func() prototype found.";
9790 echo "$func() prototype NOT found.";
9797 : see if sys/types.h has to be included
9798 set sys/types.h i_systypes
9801 : see if sys/select.h has to be included
9802 set sys/select.h i_sysselct
9805 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
9806 while $test $# -ge 2; do
9808 $define) echo "#include <$2>";;
9812 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
9814 if eval $compile; then
9823 : see if we should include time.h, sys/time.h, or both
9825 if test "X$timeincl" = X; then
9826 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9827 $echo $n "I'm now running the test program...$c"
9829 #include <sys/types.h>
9834 #ifdef SYSTIMEKERNEL
9837 #include <sys/time.h>
9840 #include <sys/select.h>
9853 struct timezone tzp;
9855 if (foo.tm_sec == foo.tm_sec)
9858 if (bar.tv_sec == bar.tv_sec)
9865 for s_timezone in '-DS_TIMEZONE' ''; do
9867 for s_timeval in '-DS_TIMEVAL' ''; do
9868 for i_systimek in '' '-DSYSTIMEKERNEL'; do
9869 for i_time in '' '-DI_TIME'; do
9870 for i_systime in '-DI_SYSTIME' ''; do
9873 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
9874 if eval $compile; then
9875 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
9879 $echo $n "Succeeded with $flags$c"
9891 *SYSTIMEKERNEL*) i_systimek="$define"
9892 timeincl=`./findhdr sys/time.h`
9893 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
9894 *) i_systimek="$undef";;
9897 *I_TIME*) i_time="$define"
9898 timeincl=`./findhdr time.h`" $timeincl"
9899 echo "We'll include <time.h>." >&4;;
9900 *) i_time="$undef";;
9903 *I_SYSTIME*) i_systime="$define"
9904 timeincl=`./findhdr sys/time.h`" $timeincl"
9905 echo "We'll include <sys/time.h>." >&4;;
9906 *) i_systime="$undef";;
9910 : see if struct tm knows about tm_zone
9911 case "$i_systime$i_time" in
9914 echo "Checking to see if your struct tm has tm_zone field..." >&4
9915 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
9923 case "$d_tm_tm_zone" in
9924 "$define") echo "Yes, it does." ;;
9925 *) echo "No, it doesn't." ;;
9927 : see if struct tm knows about tm_gmtoff
9928 case "$i_systime$i_time" in
9931 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
9932 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
9940 case "$d_tm_tm_gmtoff" in
9941 "$define") echo "Yes, it does." ;;
9942 *) echo "No, it doesn't." ;;
9945 : see if asctime_r exists
9946 set asctime_r d_asctime_r
9948 case "$d_asctime_r" in
9950 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
9951 case "$d_asctime_r_proto:$usethreads" in
9952 ":define") d_asctime_r_proto=define
9953 set d_asctime_r_proto asctime_r $hdrs
9957 case "$d_asctime_r_proto" in
9959 case "$asctime_r_proto" in
9960 ''|0) try='char* asctime_r(const struct tm*, char*);'
9961 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SB ;;
9963 case "$asctime_r_proto" in
9964 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
9965 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SBI ;;
9967 case "$asctime_r_proto" in
9968 ''|0) try='int asctime_r(const struct tm*, char*);'
9969 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SB ;;
9971 case "$asctime_r_proto" in
9972 ''|0) try='int asctime_r(const struct tm*, char*, int);'
9973 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SBI ;;
9975 case "$asctime_r_proto" in
9976 ''|0) d_asctime_r=undef
9978 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
9979 * ) case "$asctime_r_proto" in
9980 REENTRANT_PROTO*) ;;
9981 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
9983 echo "Prototype: $try" ;;
9986 *) case "$usethreads" in
9987 define) echo "asctime_r has no prototype, not using it." >&4 ;;
9994 *) asctime_r_proto=0
9998 : see if atolf exists
10002 : see if atoll exists
10006 : Look for GCC-style attribute format
10007 case "$d_attribute_format" in
10010 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10011 $cat >attrib.c <<'EOCP'
10013 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
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__((format))."
10020 echo "Your C compiler supports __attribute__((format))."
10024 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10028 *) val="$d_attribute_format" ;;
10030 set d_attribute_format
10034 : Look for GCC-style attribute format with null format allowed
10035 case "$d_printf_format_null" in
10036 '') case "$d_attribute_format" in
10039 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10040 $cat >attrib.c <<EOCP
10042 #$i_stdlib I_STDLIB
10044 #include <stdlib.h>
10046 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10047 int null_printf (char* pat,...) { return (int)pat; }
10048 int main () { exit(null_printf(NULL)); }
10050 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10051 : run the executable in case it produces a run-time warning
10052 if $run ./attrib >>attrib.out 2>&1; then
10053 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10054 echo "Your C compiler doesn't allow __printf__ format to be null."
10057 echo "Your C compiler allows __printf__ format to be null."
10061 echo "Your C compiler executable failed with __printf__ format null."
10065 echo "Your C compiler fails with __printf__ format null."
10072 *) val="$d_printf_format_null" ;;
10074 set d_printf_format_null
10078 : Look for GCC-style attribute malloc
10079 case "$d_attribute_malloc" in
10082 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10083 $cat >attrib.c <<'EOCP'
10085 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10087 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10088 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10089 echo "Your C compiler doesn't support __attribute__((malloc))."
10092 echo "Your C compiler supports __attribute__((malloc))."
10096 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10100 *) val="$d_attribute_malloc" ;;
10102 set d_attribute_malloc
10106 : Look for GCC-style attribute nonnull
10107 case "$d_attribute_nonnull" in
10110 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10111 $cat >attrib.c <<'EOCP'
10113 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10115 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10116 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10117 echo "Your C compiler doesn't support __attribute__((nonnull))."
10120 echo "Your C compiler supports __attribute__((nonnull))."
10124 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10128 *) val="$d_attribute_nonnull" ;;
10130 set d_attribute_nonnull
10134 : Look for GCC-style attribute noreturn
10135 case "$d_attribute_noreturn" in
10138 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10139 $cat >attrib.c <<'EOCP'
10141 void fall_over_dead( void ) __attribute__((noreturn));
10143 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10144 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10145 echo "Your C compiler doesn't support __attribute__((noreturn))."
10148 echo "Your C compiler supports __attribute__((noreturn))."
10152 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10156 *) val="$d_attribute_noreturn" ;;
10158 set d_attribute_noreturn
10162 : Look for GCC-style attribute pure
10163 case "$d_attribute_pure" in
10166 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10167 $cat >attrib.c <<'EOCP'
10169 int square( int n ) __attribute__((pure));
10171 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10172 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10173 echo "Your C compiler doesn't support __attribute__((pure))."
10176 echo "Your C compiler supports __attribute__((pure))."
10180 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10184 *) val="$d_attribute_pure" ;;
10186 set d_attribute_pure
10190 : Look for GCC-style attribute unused
10191 case "$d_attribute_unused" in
10194 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10195 $cat >attrib.c <<'EOCP'
10197 int do_something( int dummy __attribute__((unused)), int n );
10199 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10200 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10201 echo "Your C compiler doesn't support __attribute__((unused))."
10204 echo "Your C compiler supports __attribute__((unused))."
10208 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10212 *) val="$d_attribute_unused" ;;
10214 set d_attribute_unused
10218 : Look for GCC-style attribute warn_unused_result
10219 case "$d_attribute_warn_unused_result" in
10222 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10223 $cat >attrib.c <<'EOCP'
10225 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10227 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10228 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10229 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10232 echo "Your C compiler supports __attribute__((warn_unused_result))."
10236 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10240 *) val="$d_attribute_warn_unused_result" ;;
10242 set d_attribute_warn_unused_result
10246 : see if bcmp exists
10250 : see if bcopy exists
10254 : see if getpgrp exists
10255 set getpgrp d_getpgrp
10258 case "$d_getpgrp" in
10261 echo "Checking to see which flavor of getpgrp is in use..."
10263 #$i_unistd I_UNISTD
10264 #include <sys/types.h>
10266 # include <unistd.h>
10268 #$i_stdlib I_STDLIB
10270 #include <stdlib.h>
10274 if (getuid() == 0) {
10275 printf("(I see you are running Configure as super-user...)\n");
10278 #ifdef TRY_BSD_PGRP
10279 if (getpgrp(1) == 0)
10288 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10289 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10291 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10292 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10295 echo "I can't seem to compile and run the test program."
10297 xxx="a USG one, i.e. you use getpgrp()."
10299 # SVR4 systems can appear rather BSD-ish.
10300 case "$i_unistd" in
10302 xxx="a BSD one, i.e. you use getpgrp(pid)."
10306 xxx="probably a USG one, i.e. you use getpgrp()."
10311 echo "Assuming your getpgrp is $xxx" >&4
10320 : see if setpgrp exists
10321 set setpgrp d_setpgrp
10324 case "$d_setpgrp" in
10327 echo "Checking to see which flavor of setpgrp is in use..."
10329 #$i_unistd I_UNISTD
10330 #include <sys/types.h>
10332 # include <unistd.h>
10334 #$i_stdlib I_STDLIB
10336 #include <stdlib.h>
10340 if (getuid() == 0) {
10341 printf("(I see you are running Configure as super-user...)\n");
10344 #ifdef TRY_BSD_PGRP
10345 if (-1 == setpgrp(1, 1))
10348 if (setpgrp() != -1)
10354 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10355 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10357 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10358 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10361 echo "(I can't seem to compile and run the test program.)"
10363 xxx="a USG one, i.e. you use setpgrp()."
10365 # SVR4 systems can appear rather BSD-ish.
10366 case "$i_unistd" in
10368 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10372 xxx="probably a USG one, i.e. you use setpgrp()."
10377 echo "Assuming your setpgrp is $xxx" >&4
10386 : Look for GCC-style __builtin_choose_expr
10387 case "$d_builtin_choose_expr" in
10390 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10391 $cat >try.c <<'EOCP'
10392 #include <assert.h>
10393 #include <stdlib.h>
10396 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10399 assert( SYRINX(1) == 2112 );
10400 assert( SYRINX(1) != 5150 );
10401 assert( SYRINX(0) == 5150 );
10402 assert( SYRINX(0) != 2112 );
10403 puts( "All good!" );
10409 if eval $compile; then
10410 echo "Your C compiler supports __builtin_choose_expr."
10413 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10417 *) val="$d_builtin_choose_expr" ;;
10420 set d_builtin_choose_expr
10424 : Look for GCC-style __builtin_expect
10425 case "$d_builtin_expect" in
10428 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10429 $cat >builtin.c <<'EOCP'
10432 if ( __builtin_expect(n, 0) ) n = 1;
10436 if eval $compile; then
10437 echo "Your C compiler supports __builtin_choose_expr."
10440 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10444 *) val="$d_builtin_expect" ;;
10447 set d_builtin_expect
10451 : see if bzero exists
10455 : see if stdarg is available
10457 if $test `./findhdr stdarg.h`; then
10458 echo "<stdarg.h> found." >&4
10461 echo "<stdarg.h> NOT found." >&4
10465 : see if varags is available
10467 if $test `./findhdr varargs.h`; then
10468 echo "<varargs.h> found." >&4
10470 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
10473 : set up the varargs testing programs
10474 $cat > varargs.c <<EOP
10476 #include <stdarg.h>
10479 #include <varargs.h>
10483 int f(char *p, ...)
10497 p = va_arg(ap, char *);
10503 $cat > varargs <<EOP
10505 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
10514 : now check which varargs header should be included
10519 if `./varargs I_STDARG`; then
10521 elif `./varargs I_VARARGS`; then
10526 if `./varargs I_VARARGS`; then
10533 echo "I could not find the definition for va_dcl... You have problems..." >&4
10534 val="$undef"; set i_stdarg; eval $setvar
10535 val="$undef"; set i_varargs; eval $setvar
10540 case "$i_varhdr" in
10542 val="$define"; set i_stdarg; eval $setvar
10543 val="$undef"; set i_varargs; eval $setvar
10546 val="$undef"; set i_stdarg; eval $setvar
10547 val="$define"; set i_varargs; eval $setvar
10550 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
10554 : see if the Compiler supports C99 variadic macros
10555 case "$i_stdarg$i_stdlib" in
10557 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
10560 #include <stdarg.h>
10562 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
10566 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
10572 if eval $compile && $run ./try 2>&1 >/dev/null; then
10573 case "`$run ./try`" in
10575 echo "You have C99 variadic macros." >&4
10576 d_c99_variadic_macros="$define"
10579 echo "You don't have functional C99 variadic macros." >&4
10580 d_c99_variadic_macros="$undef"
10584 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
10585 d_c99_variadic_macros="$undef"
10590 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
10591 d_c99_variadic_macros="$undef"
10595 : see if signal is declared as pointer to function returning int or void
10597 xxx=`./findhdr signal.h`
10598 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10599 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10600 echo "You have int (*signal())() instead of void." >&4
10602 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10603 echo "You have void (*signal())()." >&4
10605 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10606 echo "You have int (*signal())() instead of void." >&4
10608 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10609 echo "You have void (*signal())()." >&4
10612 case "$d_voidsig" in
10614 echo "I can't determine whether signal handler returns void or int..." >&4
10616 rp="What type does your signal handler return?"
10619 v*) val="$define";;
10623 echo "As you already told me, signal handler returns void." >&4
10626 *) echo "As you already told me, signal handler returns int." >&4
10633 case "$d_voidsig" in
10634 "$define") signal_t="void";;
10635 *) signal_t="int";;
10639 : check for ability to cast large floats to 32-bit ints.
10641 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10642 if $test "$intsize" -ge 4; then
10649 #$i_stdlib I_STDLIB
10651 #include <stdlib.h>
10653 #include <sys/types.h>
10654 #include <signal.h>
10655 $signal_t blech(int s) { exit(3); }
10662 signal(SIGFPE, blech);
10664 /* Don't let compiler optimize the test away. Store the number
10665 in a writable string for gcc to pass to sscanf under HP/UX.
10667 sprintf(str, "2147483647");
10668 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
10672 /* x86 processors will probably give 0x8000 0000, which is a
10673 sign change. We don't want that. We want to mimic SPARC
10674 behavior here, which is to preserve the sign and give
10677 if (i32 != ($xxx) f)
10683 if eval $compile_ok; then
10687 echo "(I can't seem to compile the test program--assuming it can't)"
10692 echo "Yup, it can."
10695 echo "Nope, it can't."
10702 : check for ability to cast negative floats to unsigned
10704 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
10707 #$i_stdlib I_STDLIB
10709 #include <stdlib.h>
10711 #include <sys/types.h>
10712 #include <signal.h>
10713 $signal_t blech(int s) { exit(7); }
10714 $signal_t blech_in_list(int s) { exit(4); }
10715 unsigned long dummy_long(unsigned long p) { return p; }
10716 unsigned int dummy_int(unsigned int p) { return p; }
10717 unsigned short dummy_short(unsigned short p) { return p; }
10721 unsigned long along;
10723 unsigned short ashort;
10727 /* Frustrate gcc-2.7.2's optimizer which failed this test with
10728 a direct f = -123. assignment. gcc-2.8.0 reportedly
10729 optimized the whole file away
10731 /* Store the number in a writable string for gcc to pass to
10732 sscanf under HP/UX.
10734 sprintf(str, "-123");
10735 sscanf(str, "%lf", &f); /* f = -123.; */
10737 signal(SIGFPE, blech);
10738 along = (unsigned long)f;
10739 aint = (unsigned int)f;
10740 ashort = (unsigned short)f;
10741 if (along != (unsigned long)-123)
10743 if (aint != (unsigned int)-123)
10745 if (ashort != (unsigned short)-123)
10747 sprintf(str, "1073741824.");
10748 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
10751 along = (unsigned long)f;
10752 if (along != 0x80000000)
10756 along = (unsigned long)f;
10757 if (along != 0x7fffffff)
10761 along = (unsigned long)f;
10762 if (along != 0x80000001)
10766 signal(SIGFPE, blech_in_list);
10767 sprintf(str, "123.");
10768 sscanf(str, "%lf", &f); /* f = 123.; */
10769 along = dummy_long((unsigned long)f);
10770 aint = dummy_int((unsigned int)f);
10771 ashort = dummy_short((unsigned short)f);
10772 if (along != (unsigned long)123)
10774 if (aint != (unsigned int)123)
10776 if (ashort != (unsigned short)123)
10783 if eval $compile_ok; then
10787 echo "(I can't seem to compile the test program--assuming it can't)"
10790 case "$castflags" in
10792 echo "Yup, it can."
10795 echo "Nope, it can't."
10802 : see if vprintf exists
10804 if set vprintf val -f d_vprintf; eval $csym; $val; then
10805 echo 'vprintf() found.' >&4
10808 #include <varargs.h>
10809 #$i_stdlib I_STDLIB
10811 #include <stdlib.h>
10814 int main() { xxx("foo"); }
10823 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
10827 if eval $compile && $run ./try; then
10828 echo "Your vsprintf() returns (int)." >&4
10831 echo "Your vsprintf() returns (char*)." >&4
10835 echo 'vprintf() NOT found.' >&4
10846 : see if chown exists
10850 : see if chroot exists
10851 set chroot d_chroot
10854 : see if chsize exists
10855 set chsize d_chsize
10858 : see if class exists
10862 : see if clearenv exists
10863 set clearenv d_clearenv
10866 hasstruct='varname=$1; struct=$2; shift; shift;
10867 while $test $# -ge 2; do
10869 $define) echo "#include <$2>";;
10873 echo "int main () { struct $struct foo; }" >> try.c;
10875 if eval $compile; then
10886 : see whether socket exists
10888 $echo $n "Hmm... $c" >&4
10889 if set socket val -f d_socket; eval $csym; $val; then
10890 echo "Looks like you have Berkeley networking support." >&4
10892 if set setsockopt val -f; eval $csym; $val; then
10895 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
10896 d_oldsock="$define"
10899 if $contains socklib libc.list >/dev/null 2>&1; then
10900 echo "Looks like you have Berkeley networking support." >&4
10902 : we will have to assume that it supports the 4.2 BSD interface
10905 echo "You don't have Berkeley networking in libc$_a..." >&4
10906 if test "X$d_socket" = "X$define"; then
10907 echo "...but you seem to believe that you have sockets." >&4
10909 for net in net socket
10911 if test -f /usr/lib/lib$net$_a; then
10912 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
10913 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
10914 if $contains socket libc.list >/dev/null 2>&1; then
10919 echo "...but the Wollongong group seems to have hacked it in." >&4
10920 sockethdr="-I/usr/netinclude"
10923 echo "Found Berkeley sockets interface in lib$net." >&4
10924 if $contains setsockopt libc.list >/dev/null 2>&1; then
10927 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
10928 d_oldsock="$define"
10934 if test "X$d_socket" != "X$define"; then
10935 echo "or anywhere else I see." >&4
10943 : see if socketpair exists
10944 set socketpair d_sockpair
10949 echo "Checking the availability of certain socket constants..." >&4
10950 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
10951 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
10953 #include <sys/types.h>
10954 #include <sys/socket.h>
10960 set try; if eval $compile; then
10963 set d_${enum}; eval $setvar
10967 : see if this is a sys/uio.h system
10968 set sys/uio.h i_sysuio
10973 echo "Checking to see if your system supports struct cmsghdr..." >&4
10974 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
10976 case "$d_cmsghdr_s" in
10977 "$define") echo "Yes, it does." ;;
10978 *) echo "No, it doesn't." ;;
10982 : check for const keyword
10984 echo 'Checking to see if your C compiler knows about "const"...' >&4
10985 $cat >const.c <<'EOCP'
10986 typedef struct spug { int drokk; } spug;
10990 const spug y = { 0 };
10993 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
10995 echo "Yup, it does."
10998 echo "Nope, it doesn't."
11003 : see if copysignl exists
11004 set copysignl d_copysignl
11007 : see if crypt exists
11012 $define) cryptlib='' ;;
11013 *) if set crypt val -f d_crypt; eval $csym; $val; then
11014 echo 'crypt() found.' >&4
11018 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
11019 if $test -z "$cryptlib"; then
11020 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
11024 if $test -z "$cryptlib"; then
11025 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
11029 if $test -z "$cryptlib"; then
11030 cryptlib=`./loc libcrypt$_a "" $libpth`
11034 if $test -z "$cryptlib"; then
11035 echo 'crypt() NOT found.' >&4
11046 : see if this is a crypt.h system
11047 set crypt.h i_crypt
11050 : see if crypt_r exists
11051 set crypt_r d_crypt_r
11053 case "$d_crypt_r" in
11055 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
11056 case "$d_crypt_r_proto:$usethreads" in
11057 ":define") d_crypt_r_proto=define
11058 set d_crypt_r_proto crypt_r $hdrs
11062 case "$d_crypt_r_proto" in
11064 case "$crypt_r_proto" in
11065 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
11066 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCS ;;
11068 case "$crypt_r_proto" in
11069 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
11070 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCD ;;
11072 case "$crypt_r_proto" in
11073 ''|0) d_crypt_r=undef
11075 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
11076 * ) case "$crypt_r_proto" in
11077 REENTRANT_PROTO*) ;;
11078 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
11080 echo "Prototype: $try" ;;
11083 *) case "$usethreads" in
11084 define) echo "crypt_r has no prototype, not using it." >&4 ;;
11095 : get csh whereabouts
11097 'csh') val="$undef" ;;
11098 *) val="$define" ;;
11102 : Respect a hint or command line value for full_csh.
11103 case "$full_csh" in
11104 '') full_csh=$csh ;;
11107 : see if ctermid exists
11108 set ctermid d_ctermid
11111 : see if ctermid_r exists
11112 set ctermid_r d_ctermid_r
11114 case "$d_ctermid_r" in
11116 hdrs="$i_systypes sys/types.h define stdio.h "
11117 case "$d_ctermid_r_proto:$usethreads" in
11118 ":define") d_ctermid_r_proto=define
11119 set d_ctermid_r_proto ctermid_r $hdrs
11123 case "$d_ctermid_r_proto" in
11125 case "$ctermid_r_proto" in
11126 ''|0) try='char* ctermid_r(char*);'
11127 ./protochk "extern $try" $hdrs && ctermid_r_proto=B_B ;;
11129 case "$ctermid_r_proto" in
11130 ''|0) d_ctermid_r=undef
11132 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
11133 * ) case "$ctermid_r_proto" in
11134 REENTRANT_PROTO*) ;;
11135 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
11137 echo "Prototype: $try" ;;
11140 *) case "$usethreads" in
11141 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
11148 *) ctermid_r_proto=0
11152 : see if ctime_r exists
11153 set ctime_r d_ctime_r
11155 case "$d_ctime_r" in
11157 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11158 case "$d_ctime_r_proto:$usethreads" in
11159 ":define") d_ctime_r_proto=define
11160 set d_ctime_r_proto ctime_r $hdrs
11164 case "$d_ctime_r_proto" in
11166 case "$ctime_r_proto" in
11167 ''|0) try='char* ctime_r(const time_t*, char*);'
11168 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SB ;;
11170 case "$ctime_r_proto" in
11171 ''|0) try='char* ctime_r(const time_t*, char*, int);'
11172 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SBI ;;
11174 case "$ctime_r_proto" in
11175 ''|0) try='int ctime_r(const time_t*, char*);'
11176 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SB ;;
11178 case "$ctime_r_proto" in
11179 ''|0) try='int ctime_r(const time_t*, char*, int);'
11180 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SBI ;;
11182 case "$ctime_r_proto" in
11183 ''|0) d_ctime_r=undef
11185 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
11186 * ) case "$ctime_r_proto" in
11187 REENTRANT_PROTO*) ;;
11188 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
11190 echo "Prototype: $try" ;;
11193 *) case "$usethreads" in
11194 define) echo "ctime_r has no prototype, not using it." >&4 ;;
11205 : see if cuserid exists
11206 set cuserid d_cuserid
11209 : see if this is a limits.h system
11210 set limits.h i_limits
11213 : see if this is a float.h system
11214 set float.h i_float
11217 : See if number of significant digits in a double precision number is known
11219 $cat >dbl_dig.c <<EOM
11220 #$i_limits I_LIMITS
11223 #include <limits.h>
11229 printf("Contains DBL_DIG");
11232 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
11233 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
11234 echo "DBL_DIG found." >&4
11237 echo "DBL_DIG NOT found." >&4
11244 : see if dbm.h is available
11245 : see if dbmclose exists
11246 set dbmclose d_dbmclose
11249 case "$d_dbmclose" in
11259 *) set rpcsvc/dbm.h i_rpcsvcdbm
11264 *) echo "We won't be including <dbm.h>"
11274 : see if prototype for dbminit is available
11276 set d_dbminitproto dbminit $i_dbm dbm.h
11279 : see if difftime exists
11280 set difftime d_difftime
11283 : see if this is a dirent system
11285 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
11287 echo "<dirent.h> found." >&4
11290 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
11291 echo "<sys/dir.h> found." >&4
11294 xinc=`./findhdr sys/ndir.h`
11296 echo "<dirent.h> NOT found." >&4
11301 : Look for type of directory structure.
11303 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11305 case "$direntrytype" in
11307 case "$i_dirent" in
11308 $define) guess1='struct dirent' ;;
11309 *) guess1='struct direct' ;;
11312 *) guess1="$direntrytype"
11317 'struct dirent') guess2='struct direct' ;;
11318 *) guess2='struct dirent' ;;
11321 if $contains "$guess1" try.c >/dev/null 2>&1; then
11322 direntrytype="$guess1"
11323 echo "Your directory entries are $direntrytype." >&4
11324 elif $contains "$guess2" try.c >/dev/null 2>&1; then
11325 direntrytype="$guess2"
11326 echo "Your directory entries seem to be $direntrytype." >&4
11328 echo "I don't recognize your system's directory entries." >&4
11329 rp="What type is used for directory entries on this system?"
11332 direntrytype="$ans"
11336 : see if the directory entry stores field length
11338 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11339 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
11340 echo "Good, your directory entry keeps length information in d_namlen." >&4
11343 echo "Your directory entry does not know about the d_namlen field." >&4
11350 : Look for DIR.dd_fd
11351 case "$i_dirent" in
11353 echo "Checking to see if DIR has a dd_fd member variable" >&4
11355 #$i_stdlib I_STDLIB
11357 #include <stdlib.h>
11359 #include <dirent.h>
11369 if eval $compile; then
11370 echo "Yes, it does."
11373 echo "No, it does not."
11378 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
11386 : see if this is an sysdir system
11387 set sys/dir.h i_sysdir
11390 : see if this is an sysndir system
11391 set sys/ndir.h i_sysndir
11396 $cat >dirfd.c <<EOM
11398 #$i_stdlib I_STDLIB
11400 #include <stdlib.h>
11402 #$i_dirent I_DIRENT /**/
11403 #$i_sysdir I_SYS_DIR /**/
11404 #$i_sysndir I_SYS_NDIR /**/
11405 #$i_systypes I_SYS_TYPES /**/
11406 #if defined(I_SYS_TYPES)
11407 #include <sys/types.h>
11409 #if defined(I_DIRENT)
11410 #include <dirent.h>
11411 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11412 #include <sys/dir.h>
11416 #include <sys/ndir.h>
11420 #include <ndir.h> /* may be wrong in the future */
11422 #include <sys/dir.h>
11428 DIR *dirp = opendir(".");
11429 if (dirfd(dirp) >= 0)
11437 if eval $compile; then
11441 $define) echo "dirfd() found." >&4 ;;
11442 *) echo "dirfd() NOT found." >&4 ;;
11448 : see if dlerror exists
11451 set dlerror d_dlerror
11455 : see if dlfcn is available
11456 set dlfcn.h i_dlfcn
11463 On a few systems, the dynamically loaded modules that perl generates and uses
11464 will need a different extension than shared libs. The default will probably
11470 *) dflt="$dlext" ;;
11472 rp='What is the extension of dynamically loaded modules'
11481 : Check if dlsym need a leading underscore
11487 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11488 $cat >dyna.c <<'EOM'
11495 #$i_stdlib I_STDLIB
11497 #include <stdlib.h>
11501 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
11503 #include <sys/types.h>
11508 extern int fred() ;
11517 int mode = RTLD_LAZY ;
11519 handle = dlopen("./dyna.$dlext", mode) ;
11520 if (handle == NULL) {
11525 symbol = dlsym(handle, "fred") ;
11526 if (symbol == NULL) {
11527 /* try putting a leading underscore */
11528 symbol = dlsym(handle, "_fred") ;
11529 if (symbol == NULL) {
11542 : Call the object file tmp-dyna.o in case dlext=o.
11543 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
11544 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
11545 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
11546 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
11549 1) echo "Test program failed using dlopen." >&4
11550 echo "Perhaps you should not use dynamic loading." >&4;;
11551 2) echo "Test program failed using dlsym." >&4
11552 echo "Perhaps you should not use dynamic loading." >&4;;
11553 3) echo "dlsym needs a leading underscore" >&4
11555 4) echo "dlsym doesn't need a leading underscore." >&4;;
11558 echo "I can't compile and run the test program." >&4
11559 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
11564 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
11569 : see if drand48_r exists
11570 set drand48_r d_drand48_r
11572 case "$d_drand48_r" in
11574 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
11575 case "$d_drand48_r_proto:$usethreads" in
11576 ":define") d_drand48_r_proto=define
11577 set d_drand48_r_proto drand48_r $hdrs
11581 case "$d_drand48_r_proto" in
11583 case "$drand48_r_proto" in
11584 ''|0) try='int drand48_r(struct drand48_data*, double*);'
11585 ./protochk "extern $try" $hdrs && drand48_r_proto=I_ST ;;
11587 case "$drand48_r_proto" in
11588 ''|0) d_drand48_r=undef
11590 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
11591 * ) case "$drand48_r_proto" in
11592 REENTRANT_PROTO*) ;;
11593 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
11595 echo "Prototype: $try" ;;
11598 *) case "$usethreads" in
11599 define) echo "drand48_r has no prototype, not using it." >&4 ;;
11606 *) drand48_r_proto=0
11610 : see if prototype for drand48 is available
11612 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
11615 : see if dup2 exists
11619 : see if eaccess exists
11620 set eaccess d_eaccess
11623 : see if endgrent exists
11624 set endgrent d_endgrent
11627 : see if this is an grp system
11633 xxx=`./findhdr grp.h`
11634 $cppstdin $cppflags $cppminus < $xxx >$$.h
11636 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
11648 set d_grpasswd; eval $setvar
11652 : see if endgrent_r exists
11653 set endgrent_r d_endgrent_r
11655 case "$d_endgrent_r" in
11657 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11658 case "$d_endgrent_r_proto:$usethreads" in
11659 ":define") d_endgrent_r_proto=define
11660 set d_endgrent_r_proto endgrent_r $hdrs
11664 case "$d_endgrent_r_proto" in
11666 case "$endgrent_r_proto" in
11667 ''|0) try='int endgrent_r(FILE**);'
11668 ./protochk "extern $try" $hdrs && endgrent_r_proto=I_H ;;
11670 case "$endgrent_r_proto" in
11671 ''|0) try='void endgrent_r(FILE**);'
11672 ./protochk "extern $try" $hdrs && endgrent_r_proto=V_H ;;
11674 case "$endgrent_r_proto" in
11675 ''|0) d_endgrent_r=undef
11677 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
11678 * ) case "$endgrent_r_proto" in
11679 REENTRANT_PROTO*) ;;
11680 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
11682 echo "Prototype: $try" ;;
11685 *) case "$usethreads" in
11686 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
11693 *) endgrent_r_proto=0
11697 : see if endhostent exists
11698 set endhostent d_endhent
11701 : see if this is a netdb.h system
11702 set netdb.h i_netdb
11705 : see if endhostent_r exists
11706 set endhostent_r d_endhostent_r
11708 case "$d_endhostent_r" in
11710 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11711 case "$d_endhostent_r_proto:$usethreads" in
11712 ":define") d_endhostent_r_proto=define
11713 set d_endhostent_r_proto endhostent_r $hdrs
11717 case "$d_endhostent_r_proto" in
11719 case "$endhostent_r_proto" in
11720 ''|0) try='int endhostent_r(struct hostent_data*);'
11721 ./protochk "extern $try" $hdrs && endhostent_r_proto=I_D ;;
11723 case "$endhostent_r_proto" in
11724 ''|0) try='void endhostent_r(struct hostent_data*);'
11725 ./protochk "extern $try" $hdrs && endhostent_r_proto=V_D ;;
11727 case "$endhostent_r_proto" in
11728 ''|0) d_endhostent_r=undef
11729 endhostent_r_proto=0
11730 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
11731 * ) case "$endhostent_r_proto" in
11732 REENTRANT_PROTO*) ;;
11733 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
11735 echo "Prototype: $try" ;;
11738 *) case "$usethreads" in
11739 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
11741 d_endhostent_r=undef
11742 endhostent_r_proto=0
11746 *) endhostent_r_proto=0
11750 : see if endnetent exists
11751 set endnetent d_endnent
11754 : see if endnetent_r exists
11755 set endnetent_r d_endnetent_r
11757 case "$d_endnetent_r" in
11759 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11760 case "$d_endnetent_r_proto:$usethreads" in
11761 ":define") d_endnetent_r_proto=define
11762 set d_endnetent_r_proto endnetent_r $hdrs
11766 case "$d_endnetent_r_proto" in
11768 case "$endnetent_r_proto" in
11769 ''|0) try='int endnetent_r(struct netent_data*);'
11770 ./protochk "extern $try" $hdrs && endnetent_r_proto=I_D ;;
11772 case "$endnetent_r_proto" in
11773 ''|0) try='void endnetent_r(struct netent_data*);'
11774 ./protochk "extern $try" $hdrs && endnetent_r_proto=V_D ;;
11776 case "$endnetent_r_proto" in
11777 ''|0) d_endnetent_r=undef
11778 endnetent_r_proto=0
11779 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
11780 * ) case "$endnetent_r_proto" in
11781 REENTRANT_PROTO*) ;;
11782 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
11784 echo "Prototype: $try" ;;
11787 *) case "$usethreads" in
11788 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
11790 d_endnetent_r=undef
11791 endnetent_r_proto=0
11795 *) endnetent_r_proto=0
11799 : see if endprotoent exists
11800 set endprotoent d_endpent
11803 : see if endprotoent_r exists
11804 set endprotoent_r d_endprotoent_r
11806 case "$d_endprotoent_r" in
11808 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11809 case "$d_endprotoent_r_proto:$usethreads" in
11810 ":define") d_endprotoent_r_proto=define
11811 set d_endprotoent_r_proto endprotoent_r $hdrs
11815 case "$d_endprotoent_r_proto" in
11817 case "$endprotoent_r_proto" in
11818 ''|0) try='int endprotoent_r(struct protoent_data*);'
11819 ./protochk "extern $try" $hdrs && endprotoent_r_proto=I_D ;;
11821 case "$endprotoent_r_proto" in
11822 ''|0) try='void endprotoent_r(struct protoent_data*);'
11823 ./protochk "extern $try" $hdrs && endprotoent_r_proto=V_D ;;
11825 case "$endprotoent_r_proto" in
11826 ''|0) d_endprotoent_r=undef
11827 endprotoent_r_proto=0
11828 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
11829 * ) case "$endprotoent_r_proto" in
11830 REENTRANT_PROTO*) ;;
11831 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
11833 echo "Prototype: $try" ;;
11836 *) case "$usethreads" in
11837 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
11839 d_endprotoent_r=undef
11840 endprotoent_r_proto=0
11844 *) endprotoent_r_proto=0
11848 : see if endpwent exists
11849 set endpwent d_endpwent
11852 : see if this is a pwd.h system
11858 xxx=`./findhdr pwd.h`
11859 $cppstdin $cppflags $cppminus < $xxx >$$.h
11861 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
11869 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
11877 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
11885 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
11893 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
11901 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
11909 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
11917 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
11929 set d_pwquota; eval $setvar
11930 set d_pwage; eval $setvar
11931 set d_pwchange; eval $setvar
11932 set d_pwclass; eval $setvar
11933 set d_pwexpire; eval $setvar
11934 set d_pwcomment; eval $setvar
11935 set d_pwgecos; eval $setvar
11936 set d_pwpasswd; eval $setvar
11940 : see if endpwent_r exists
11941 set endpwent_r d_endpwent_r
11943 case "$d_endpwent_r" in
11945 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
11946 case "$d_endpwent_r_proto:$usethreads" in
11947 ":define") d_endpwent_r_proto=define
11948 set d_endpwent_r_proto endpwent_r $hdrs
11952 case "$d_endpwent_r_proto" in
11954 case "$endpwent_r_proto" in
11955 ''|0) try='int endpwent_r(FILE**);'
11956 ./protochk "extern $try" $hdrs && endpwent_r_proto=I_H ;;
11958 case "$endpwent_r_proto" in
11959 ''|0) try='void endpwent_r(FILE**);'
11960 ./protochk "extern $try" $hdrs && endpwent_r_proto=V_H ;;
11962 case "$endpwent_r_proto" in
11963 ''|0) d_endpwent_r=undef
11965 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
11966 * ) case "$endpwent_r_proto" in
11967 REENTRANT_PROTO*) ;;
11968 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
11970 echo "Prototype: $try" ;;
11973 *) case "$usethreads" in
11974 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
11981 *) endpwent_r_proto=0
11985 : see if endservent exists
11986 set endservent d_endsent
11989 : see if endservent_r exists
11990 set endservent_r d_endservent_r
11992 case "$d_endservent_r" in
11994 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11995 case "$d_endservent_r_proto:$usethreads" in
11996 ":define") d_endservent_r_proto=define
11997 set d_endservent_r_proto endservent_r $hdrs
12001 case "$d_endservent_r_proto" in
12003 case "$endservent_r_proto" in
12004 ''|0) try='int endservent_r(struct servent_data*);'
12005 ./protochk "extern $try" $hdrs && endservent_r_proto=I_D ;;
12007 case "$endservent_r_proto" in
12008 ''|0) try='void endservent_r(struct servent_data*);'
12009 ./protochk "extern $try" $hdrs && endservent_r_proto=V_D ;;
12011 case "$endservent_r_proto" in
12012 ''|0) d_endservent_r=undef
12013 endservent_r_proto=0
12014 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
12015 * ) case "$endservent_r_proto" in
12016 REENTRANT_PROTO*) ;;
12017 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
12019 echo "Prototype: $try" ;;
12022 *) case "$usethreads" in
12023 define) echo "endservent_r has no prototype, not using it." >&4 ;;
12025 d_endservent_r=undef
12026 endservent_r_proto=0
12030 *) endservent_r_proto=0
12034 : Locate the flags for 'open()'
12037 #include <sys/types.h>
12042 #include <sys/file.h>
12044 #$i_stdlib I_STDLIB
12046 #include <stdlib.h>
12057 : check sys/file.h first to get FREAD on Sun
12058 if $test `./findhdr sys/file.h` && \
12059 set try -DI_SYS_FILE && eval $compile; then
12061 echo "<sys/file.h> defines the O_* constants..." >&4
12062 if $run ./try; then
12063 echo "and you have the 3 argument form of open()." >&4
12066 echo "but not the 3 argument form of open(). Oh, well." >&4
12069 elif $test `./findhdr fcntl.h` && \
12070 set try -DI_FCNTL && eval $compile; then
12072 echo "<fcntl.h> defines the O_* constants..." >&4
12073 if $run ./try; then
12074 echo "and you have the 3 argument form of open()." >&4
12077 echo "but not the 3 argument form of open(). Oh, well." >&4
12082 echo "I can't find the O_* constant definitions! You got problems." >&4
12088 : see which of string.h or strings.h is needed
12090 strings=`./findhdr string.h`
12091 if $test "$strings" && $test -r "$strings"; then
12092 echo "Using <string.h> instead of <strings.h>." >&4
12096 strings=`./findhdr strings.h`
12097 if $test "$strings" && $test -r "$strings"; then
12098 echo "Using <strings.h> instead of <string.h>." >&4
12100 echo "No string header found -- You'll surely have problems." >&4
12105 case "$i_string" in
12106 "$undef") strings=`./findhdr strings.h`;;
12107 *) strings=`./findhdr string.h`;;
12110 : see if this is a sys/file.h system
12115 : do we need to include sys/file.h ?
12119 if $h_sysfile; then
12121 echo "We'll be including <sys/file.h>." >&4
12124 echo "We won't be including <sys/file.h>." >&4
12134 : see if fcntl.h is there
12139 : see if we can include fcntl.h
12145 echo "We'll be including <fcntl.h>." >&4
12148 if $h_sysfile; then
12149 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12151 echo "We won't be including <fcntl.h>." >&4
12163 : check for non-blocking I/O stuff
12164 case "$h_sysfile" in
12165 true) echo "#include <sys/file.h>" > head.c;;
12168 true) echo "#include <fcntl.h>" > head.c;;
12169 *) echo "#include <sys/fcntl.h>" > head.c;;
12174 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
12175 case "$o_nonblock" in
12177 $cat head.c > try.c
12178 $cat >>try.c <<EOCP
12180 #$i_stdlib I_STDLIB
12182 #include <stdlib.h>
12190 printf("O_NONBLOCK\n");
12194 printf("O_NDELAY\n");
12198 printf("FNDELAY\n");
12205 if eval $compile_ok; then
12206 o_nonblock=`$run ./try`
12207 case "$o_nonblock" in
12208 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
12209 *) echo "Seems like we can use $o_nonblock.";;
12212 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
12215 *) echo "Using $hint value $o_nonblock.";;
12220 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
12223 $cat head.c > try.c
12224 $cat >>try.c <<EOCP
12226 #include <sys/types.h>
12227 #include <signal.h>
12229 #$i_stdlib I_STDLIB
12231 #include <stdlib.h>
12237 #define MY_O_NONBLOCK $o_nonblock
12238 #ifndef errno /* XXX need better Configure test */
12241 #$i_unistd I_UNISTD
12243 #include <unistd.h>
12245 #$i_string I_STRING
12247 #include <string.h>
12249 #include <strings.h>
12251 $signal_t blech(int x) { exit(3); }
12253 $cat >> try.c <<'EOCP'
12261 pipe(pd); /* Down: child -> parent */
12262 pipe(pu); /* Up: parent -> child */
12265 close(pd[1]); /* Parent reads from pd[0] */
12266 close(pu[0]); /* Parent writes (blocking) to pu[1] */
12268 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
12273 signal(SIGALRM, blech);
12275 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
12277 sprintf(string, "%d\n", ret);
12278 write(2, string, strlen(string));
12281 if (errno == EAGAIN) {
12282 printf("EAGAIN\n");
12287 if (errno == EWOULDBLOCK)
12288 printf("EWOULDBLOCK\n");
12291 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
12292 sleep(2); /* Give it time to close our pipe */
12294 ret = read(pd[0], buf, 1); /* Should read EOF */
12296 sprintf(string, "%d\n", ret);
12297 write(4, string, strlen(string));
12301 close(pd[0]); /* We write to pd[1] */
12302 close(pu[1]); /* We read from pu[0] */
12303 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
12304 close(pd[1]); /* Pipe pd is now fully closed! */
12305 exit(0); /* Bye bye, thank you for playing! */
12309 if eval $compile_ok; then
12310 echo "$startsh" >mtry
12311 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
12313 ./mtry >/dev/null 2>&1
12315 0) eagain=`$cat try.out`;;
12316 1) echo "Could not perform non-blocking setting!";;
12317 2) echo "I did a successful read() for something that was not there!";;
12318 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
12319 4) echo "Could not find F_SETFL!";;
12320 *) echo "Something terribly wrong happened during testing.";;
12322 rd_nodata=`$cat try.ret`
12323 echo "A read() system call with no data present returns $rd_nodata."
12324 case "$rd_nodata" in
12327 echo "(That's peculiar, fixing that to be -1.)"
12333 echo "Forcing errno EAGAIN on read() with no data available."
12337 echo "Your read() sets errno to $eagain when no data is available."
12340 status=`$cat try.err`
12342 0) echo "And it correctly returns 0 to signal EOF.";;
12343 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
12344 *) echo "However, your read() returns '$status' on EOF??";;
12347 if test "$status" = "$rd_nodata"; then
12348 echo "WARNING: you can't distinguish between EOF and no data!"
12352 echo "I can't compile the test program--assuming errno EAGAIN will do."
12359 echo "Using $hint value $eagain."
12360 echo "Your read() returns $rd_nodata when no data is present."
12361 case "$d_eofnblk" in
12362 "$define") echo "And you can see EOF because read() returns 0.";;
12363 "$undef") echo "But you can't see EOF status from read() returned value.";;
12365 echo "(Assuming you can't see EOF status from read anyway.)"
12371 $rm_try head.c mtry
12373 : see if _ptr and _cnt from stdio act std
12376 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12377 echo "(Looks like you have stdio.h from BSD.)"
12378 case "$stdio_ptr" in
12379 '') stdio_ptr='((fp)->_p)'
12382 *) ptr_lval=$d_stdio_ptr_lval;;
12384 case "$stdio_cnt" in
12385 '') stdio_cnt='((fp)->_r)'
12388 *) cnt_lval=$d_stdio_cnt_lval;;
12390 case "$stdio_base" in
12391 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12393 case "$stdio_bufsiz" in
12394 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12396 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12397 echo "(Looks like you have stdio.h from Linux.)"
12398 case "$stdio_ptr" in
12399 '') stdio_ptr='((fp)->_IO_read_ptr)'
12402 *) ptr_lval=$d_stdio_ptr_lval;;
12404 case "$stdio_cnt" in
12405 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12408 *) cnt_lval=$d_stdio_cnt_lval;;
12410 case "$stdio_base" in
12411 '') stdio_base='((fp)->_IO_read_base)';;
12413 case "$stdio_bufsiz" in
12414 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12417 case "$stdio_ptr" in
12418 '') stdio_ptr='((fp)->_ptr)'
12421 *) ptr_lval=$d_stdio_ptr_lval;;
12423 case "$stdio_cnt" in
12424 '') stdio_cnt='((fp)->_cnt)'
12427 *) cnt_lval=$d_stdio_cnt_lval;;
12429 case "$stdio_base" in
12430 '') stdio_base='((fp)->_base)';;
12432 case "$stdio_bufsiz" in
12433 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12437 : test whether _ptr and _cnt really work
12438 echo "Checking how std your stdio is..." >&4
12441 #$i_stdlib I_STDLIB
12443 #include <stdlib.h>
12445 #define FILE_ptr(fp) $stdio_ptr
12446 #define FILE_cnt(fp) $stdio_cnt
12448 FILE *fp = fopen("try.c", "r");
12451 18 <= FILE_cnt(fp) &&
12452 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12460 if eval $compile && $to try.c; then
12461 if $run ./try; then
12462 echo "Your stdio acts pretty std."
12465 echo "Your stdio isn't very std."
12468 echo "Your stdio doesn't appear very std."
12472 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12473 # direct buffer manipulation no longer works. The Configure tests
12474 # should be changed to correctly detect this, but until then,
12475 # the following check should at least let perl compile and run.
12476 # (This quick fix should be updated before 5.8.1.)
12477 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12478 # A. Dougherty, June 3, 2002.
12479 case "$d_gnulibc" in
12481 case "$gnulibc_version" in
12485 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12494 : Can _ptr be used as an lvalue?
12495 case "$d_stdstdio$ptr_lval" in
12496 $define$define) val=$define ;;
12499 set d_stdio_ptr_lval
12502 : Can _cnt be used as an lvalue?
12503 case "$d_stdstdio$cnt_lval" in
12504 $define$define) val=$define ;;
12507 set d_stdio_cnt_lval
12511 : test whether setting _ptr sets _cnt as a side effect
12512 d_stdio_ptr_lval_sets_cnt="$undef"
12513 d_stdio_ptr_lval_nochange_cnt="$undef"
12514 case "$d_stdio_ptr_lval$d_stdstdio" in
12516 echo "Checking to see what happens if we set the stdio ptr..." >&4
12519 /* Can we scream? */
12520 /* Eat dust sed :-) */
12521 /* In the buffer space, no one can hear you scream. */
12522 #$i_stdlib I_STDLIB
12524 #include <stdlib.h>
12526 #define FILE_ptr(fp) $stdio_ptr
12527 #define FILE_cnt(fp) $stdio_cnt
12528 #include <sys/types.h>
12530 FILE *fp = fopen("try.c", "r");
12535 puts("Fail even to read");
12538 c = getc(fp); /* Read away the first # */
12540 puts("Fail even to read");
12544 18 <= FILE_cnt(fp) &&
12545 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12547 puts("Fail even to read");
12550 ptr = (char*) FILE_ptr(fp);
12551 cnt = (size_t)FILE_cnt(fp);
12553 FILE_ptr(fp) += 42;
12555 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12556 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12559 if (FILE_cnt(fp) <= 20) {
12560 printf ("Fail (<20 chars to test)");
12563 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12564 puts("Fail compare");
12567 if (cnt == FILE_cnt(fp)) {
12568 puts("Pass_unchanged");
12571 if (FILE_cnt(fp) == (cnt - 42)) {
12572 puts("Pass_changed");
12575 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12581 if eval $compile && $to try.c; then
12582 case `$run ./try` in
12584 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12585 d_stdio_ptr_lval_sets_cnt="$define" ;;
12587 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12588 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12590 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12592 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12595 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12601 : see if _base is also standard
12603 case "$d_stdstdio" in
12607 #$i_stdlib I_STDLIB
12609 #include <stdlib.h>
12611 #define FILE_base(fp) $stdio_base
12612 #define FILE_bufsiz(fp) $stdio_bufsiz
12614 FILE *fp = fopen("try.c", "r");
12617 19 <= FILE_bufsiz(fp) &&
12618 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
12625 if eval $compile && $to try.c; then
12626 if $run ./try; then
12627 echo "And its _base field acts std."
12630 echo "But its _base field isn't std."
12633 echo "However, it seems to be lacking the _base field."
12641 : see if fast_stdio exists
12643 case "$d_stdstdio:$d_stdio_ptr_lval" in
12645 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
12647 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
12658 : see if fchdir exists
12659 set fchdir d_fchdir
12662 : see if fchmod exists
12663 set fchmod d_fchmod
12666 : see if fchown exists
12667 set fchown d_fchown
12670 : see if this is an fcntl system
12675 : See if fcntl-based locking works.
12677 #$i_stdlib I_STDLIB
12679 #include <stdlib.h>
12681 #include <unistd.h>
12683 #include <signal.h>
12684 $signal_t blech(int x) { exit(3); }
12686 #if defined(F_SETLK) && defined(F_SETLKW)
12687 struct flock flock;
12689 fd = open("try.c", O_RDONLY);
12690 flock.l_type = F_RDLCK;
12691 flock.l_whence = SEEK_SET;
12692 flock.l_start = flock.l_len = 0;
12693 signal(SIGALRM, blech);
12695 retval = fcntl(fd, F_SETLK, &flock);
12697 (retval < 0 ? exit(2) : exit(0));
12703 echo "Checking if fcntl-based file locking works... "
12707 if eval $compile_ok; then
12708 if $run ./try; then
12709 echo "Yes, it seems to work."
12712 echo "Nope, it didn't work."
12717 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
12718 *** This is (almost) impossible.
12719 *** If your NFS lock daemons are not feeling well, something like
12720 *** this may happen, please investigate. Cannot continue, aborting.
12728 echo "I'm unable to compile the test program, so I'll assume not."
12733 echo "Nope, since you don't even have fcntl()."
12736 set d_fcntl_can_lock
12740 : check for fd_set items
12743 Checking to see how well your C compiler handles fd_set and friends ...
12746 #$i_stdlib I_STDLIB
12748 #include <stdlib.h>
12750 #$i_systime I_SYS_TIME
12751 #$i_sysselct I_SYS_SELECT
12752 #$d_socket HAS_SOCKET
12753 #include <sys/types.h>
12755 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
12758 #include <sys/time.h>
12760 #ifdef I_SYS_SELECT
12761 #include <sys/select.h>
12770 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
12778 if eval $compile; then
12779 d_fds_bits="$define"
12781 echo "Well, your system knows about the normal fd_set typedef..." >&4
12782 if $run ./try; then
12783 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
12784 d_fd_macros="$define"
12787 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
12789 d_fd_macros="$undef"
12793 Hmm, your compiler has some difficulty with fd_set. Checking further...
12796 if eval $compile; then
12797 d_fds_bits="$undef"
12799 echo "Well, your system has some sort of fd_set available..." >&4
12800 if $run ./try; then
12801 echo "and you have the normal fd_set macros." >&4
12802 d_fd_macros="$define"
12805 but not the normal fd_set macros! Gross! More work for me...
12807 d_fd_macros="$undef"
12810 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
12812 d_fds_bits="$undef"
12813 d_fd_macros="$undef"
12818 : see if fgetpos exists
12819 set fgetpos d_fgetpos
12822 : see if finite exists
12823 set finite d_finite
12826 : see if finitel exists
12827 set finitel d_finitel
12830 : see if flock exists
12834 : see if prototype for flock is available
12836 set d_flockproto flock $i_sysfile sys/file.h
12839 : see if fork exists
12843 : see if fp_class exists
12844 set fp_class d_fp_class
12847 : see if pathconf exists
12848 set pathconf d_pathconf
12851 : see if fpathconf exists
12852 set fpathconf d_fpathconf
12855 : see if fpclass exists
12856 set fpclass d_fpclass
12859 : see if fpclassify exists
12860 set fpclassify d_fpclassify
12863 : see if fpclassl exists
12864 set fpclassl d_fpclassl
12868 : check for fpos64_t
12870 echo "Checking to see if you have fpos64_t..." >&4
12873 int main() { fpos64_t x = 7; }
12876 if eval $compile; then
12878 echo "You have fpos64_t."
12881 echo "You do not have fpos64_t."
12882 case "$fpossize" in
12883 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
12890 : see if frexpl exists
12891 set frexpl d_frexpl
12894 : see if this is a sys/param system
12895 set sys/param.h i_sysparam
12898 : see if this is a sys/mount.h system
12899 set sys/mount.h i_sysmount
12904 echo "Checking to see if your system supports struct fs_data..." >&4
12905 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
12907 case "$d_fs_data_s" in
12908 "$define") echo "Yes, it does." ;;
12909 *) echo "No, it doesn't." ;;
12912 : see if fseeko exists
12913 set fseeko d_fseeko
12915 case "$longsize" in
12916 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
12919 : see if fsetpos exists
12920 set fsetpos d_fsetpos
12924 : see if fstatfs exists
12925 set fstatfs d_fstatfs
12929 : see if statvfs exists
12930 set statvfs d_statvfs
12933 : see if fstatvfs exists
12934 set fstatvfs d_fstatvfs
12938 : see if fsync exists
12942 : see if ftello exists
12943 set ftello d_ftello
12945 case "$longsize" in
12946 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
12950 : check for a working futimes
12952 echo "Checking if you have a working futimes()" >&4
12955 #include <sys/time.h>
12962 fd = open ("try.c", O_RDWR);
12963 if (-1 == fd) exit (1);
12964 rv = futimes (fd, NULL);
12965 exit (rv == -1 ? errno : 0);
12969 if eval $compile; then
12973 0) echo "Yes, you have" >&4
12974 d_futimes="$define"
12976 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
12980 echo "No, it does not (probably harmless)" >&4
12984 : see if getcwd exists
12985 set getcwd d_getcwd
12988 : see if getespwnam exists
12989 set getespwnam d_getespwnam
12993 : see if getfsstat exists
12994 set getfsstat d_getfsstat
12997 : see if getgrent exists
12998 set getgrent d_getgrent
13001 : see if getgrent_r exists
13002 set getgrent_r d_getgrent_r
13004 case "$d_getgrent_r" in
13006 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13007 case "$d_getgrent_r_proto:$usethreads" in
13008 ":define") d_getgrent_r_proto=define
13009 set d_getgrent_r_proto getgrent_r $hdrs
13013 case "$d_getgrent_r_proto" in
13015 case "$getgrent_r_proto" in
13016 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
13017 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBWR ;;
13019 case "$getgrent_r_proto" in
13020 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
13021 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIR ;;
13023 case "$getgrent_r_proto" in
13024 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
13025 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBW ;;
13027 case "$getgrent_r_proto" in
13028 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
13029 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBI ;;
13031 case "$getgrent_r_proto" in
13032 ''|0) try='int getgrent_r(struct group*, char*, int);'
13033 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBI ;;
13035 case "$getgrent_r_proto" in
13036 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
13037 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIH ;;
13039 case "$getgrent_r_proto" in
13040 ''|0) d_getgrent_r=undef
13042 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
13043 * ) case "$getgrent_r_proto" in
13044 REENTRANT_PROTO*) ;;
13045 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
13047 echo "Prototype: $try" ;;
13050 *) case "$usethreads" in
13051 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
13058 *) getgrent_r_proto=0
13062 : see if getgrgid_r exists
13063 set getgrgid_r d_getgrgid_r
13065 case "$d_getgrgid_r" in
13067 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13068 case "$d_getgrgid_r_proto:$usethreads" in
13069 ":define") d_getgrgid_r_proto=define
13070 set d_getgrgid_r_proto getgrgid_r $hdrs
13074 case "$d_getgrgid_r_proto" in
13076 case "$getgrgid_r_proto" in
13077 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
13078 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
13080 case "$getgrgid_r_proto" in
13081 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
13082 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
13084 case "$getgrgid_r_proto" in
13085 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
13086 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
13088 case "$getgrgid_r_proto" in
13089 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
13090 ./protochk "extern $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
13092 case "$getgrgid_r_proto" in
13093 ''|0) d_getgrgid_r=undef
13095 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
13096 * ) case "$getgrgid_r_proto" in
13097 REENTRANT_PROTO*) ;;
13098 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
13100 echo "Prototype: $try" ;;
13103 *) case "$usethreads" in
13104 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
13111 *) getgrgid_r_proto=0
13115 : see if getgrnam_r exists
13116 set getgrnam_r d_getgrnam_r
13118 case "$d_getgrnam_r" in
13120 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13121 case "$d_getgrnam_r_proto:$usethreads" in
13122 ":define") d_getgrnam_r_proto=define
13123 set d_getgrnam_r_proto getgrnam_r $hdrs
13127 case "$d_getgrnam_r_proto" in
13129 case "$getgrnam_r_proto" in
13130 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
13131 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
13133 case "$getgrnam_r_proto" in
13134 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
13135 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
13137 case "$getgrnam_r_proto" in
13138 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
13139 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CBI ;;
13141 case "$getgrnam_r_proto" in
13142 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
13143 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
13145 case "$getgrnam_r_proto" in
13146 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
13147 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
13149 case "$getgrnam_r_proto" in
13150 ''|0) d_getgrnam_r=undef
13152 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
13153 * ) case "$getgrnam_r_proto" in
13154 REENTRANT_PROTO*) ;;
13155 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
13157 echo "Prototype: $try" ;;
13160 *) case "$usethreads" in
13161 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
13168 *) getgrnam_r_proto=0
13172 : see if gethostbyaddr exists
13173 set gethostbyaddr d_gethbyaddr
13176 : see if gethostbyname exists
13177 set gethostbyname d_gethbyname
13180 : see if gethostent exists
13181 set gethostent d_gethent
13184 : see how we will look up host name
13187 if set gethostname val -f d_gethname; eval $csym; $val; then
13188 echo 'gethostname() found.' >&4
13189 d_gethname="$define"
13192 if set uname val -f d_uname; eval $csym; $val; then
13195 uname() was found, but you're running xenix, and older versions of xenix
13196 have a broken uname(). If you don't really know whether your xenix is old
13197 enough to have a broken system call, use the default answer.
13202 "$define") dflt=n;;
13204 rp='Is your uname() broken?'
13207 n*) d_uname="$define"; call=uname;;
13210 echo 'uname() found.' >&4
13217 case "$d_gethname" in
13218 '') d_gethname="$undef";;
13221 '') d_uname="$undef";;
13223 case "$d_uname$d_gethname" in
13228 Every now and then someone has a $call() that lies about the hostname
13229 but can't be fixed for political or economic reasons. If you wish, I can
13230 pretend $call() isn't there and maybe compute hostname at run-time
13231 thanks to the '$phostname' command.
13234 rp="Shall I ignore $call() from now on?"
13237 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
13240 case "$phostname" in
13241 '') aphostname='';;
13242 *) case "$aphostname" in
13244 *) set X $phostname
13248 file=`./loc $file $file $pth`
13249 aphostname=`echo $file $*`
13254 case "$d_uname$d_gethname" in
13257 case "$phostname" in
13259 echo "There will be no way for $package to get your hostname." >&4;;
13261 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
13265 case "$d_phostname" in
13266 '') d_phostname="$undef";;
13269 : see if gethostbyaddr_r exists
13270 set gethostbyaddr_r d_gethostbyaddr_r
13272 case "$d_gethostbyaddr_r" in
13274 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13275 case "$d_gethostbyaddr_r_proto:$usethreads" in
13276 ":define") d_gethostbyaddr_r_proto=define
13277 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
13281 case "$d_gethostbyaddr_r_proto" in
13283 case "$gethostbyaddr_r_proto" in
13284 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13285 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
13287 case "$gethostbyaddr_r_proto" in
13288 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
13289 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
13291 case "$gethostbyaddr_r_proto" in
13292 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
13293 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
13295 case "$gethostbyaddr_r_proto" in
13296 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
13297 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
13299 case "$gethostbyaddr_r_proto" in
13300 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
13301 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
13303 case "$gethostbyaddr_r_proto" in
13304 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
13305 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
13307 case "$gethostbyaddr_r_proto" in
13308 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
13309 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
13311 case "$gethostbyaddr_r_proto" in
13312 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
13313 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
13315 case "$gethostbyaddr_r_proto" in
13316 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
13317 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
13319 case "$gethostbyaddr_r_proto" in
13320 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
13321 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
13323 case "$gethostbyaddr_r_proto" in
13324 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13325 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
13327 case "$gethostbyaddr_r_proto" in
13328 ''|0) d_gethostbyaddr_r=undef
13329 gethostbyaddr_r_proto=0
13330 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
13331 * ) case "$gethostbyaddr_r_proto" in
13332 REENTRANT_PROTO*) ;;
13333 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
13335 echo "Prototype: $try" ;;
13338 *) case "$usethreads" in
13339 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
13341 d_gethostbyaddr_r=undef
13342 gethostbyaddr_r_proto=0
13346 *) gethostbyaddr_r_proto=0
13350 : see if gethostbyname_r exists
13351 set gethostbyname_r d_gethostbyname_r
13353 case "$d_gethostbyname_r" in
13355 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13356 case "$d_gethostbyname_r_proto:$usethreads" in
13357 ":define") d_gethostbyname_r_proto=define
13358 set d_gethostbyname_r_proto gethostbyname_r $hdrs
13362 case "$d_gethostbyname_r_proto" in
13364 case "$gethostbyname_r_proto" in
13365 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
13366 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
13368 case "$gethostbyname_r_proto" in
13369 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
13370 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
13372 case "$gethostbyname_r_proto" in
13373 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
13374 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
13376 case "$gethostbyname_r_proto" in
13377 ''|0) d_gethostbyname_r=undef
13378 gethostbyname_r_proto=0
13379 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
13380 * ) case "$gethostbyname_r_proto" in
13381 REENTRANT_PROTO*) ;;
13382 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
13384 echo "Prototype: $try" ;;
13387 *) case "$usethreads" in
13388 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13390 d_gethostbyname_r=undef
13391 gethostbyname_r_proto=0
13395 *) gethostbyname_r_proto=0
13399 : see if gethostent_r exists
13400 set gethostent_r d_gethostent_r
13402 case "$d_gethostent_r" in
13404 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13405 case "$d_gethostent_r_proto:$usethreads" in
13406 ":define") d_gethostent_r_proto=define
13407 set d_gethostent_r_proto gethostent_r $hdrs
13411 case "$d_gethostent_r_proto" in
13413 case "$gethostent_r_proto" in
13414 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
13415 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
13417 case "$gethostent_r_proto" in
13418 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
13419 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBIE ;;
13421 case "$gethostent_r_proto" in
13422 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
13423 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBIE ;;
13425 case "$gethostent_r_proto" in
13426 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
13427 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBI ;;
13429 case "$gethostent_r_proto" in
13430 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
13431 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBI ;;
13433 case "$gethostent_r_proto" in
13434 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13435 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SD ;;
13437 case "$gethostent_r_proto" in
13438 ''|0) d_gethostent_r=undef
13439 gethostent_r_proto=0
13440 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13441 * ) case "$gethostent_r_proto" in
13442 REENTRANT_PROTO*) ;;
13443 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13445 echo "Prototype: $try" ;;
13448 *) case "$usethreads" in
13449 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13451 d_gethostent_r=undef
13452 gethostent_r_proto=0
13456 *) gethostent_r_proto=0
13460 : see if prototypes for various gethostxxx netdb.h functions are available
13462 set d_gethostprotos gethostent $i_netdb netdb.h
13465 : see if getitimer exists
13466 set getitimer d_getitimer
13469 : see if getlogin exists
13470 set getlogin d_getlogin
13473 : see if getlogin_r exists
13474 set getlogin_r d_getlogin_r
13476 case "$d_getlogin_r" in
13478 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
13479 case "$d_getlogin_r_proto:$usethreads" in
13480 ":define") d_getlogin_r_proto=define
13481 set d_getlogin_r_proto getlogin_r $hdrs
13485 case "$d_getlogin_r_proto" in
13487 case "$getlogin_r_proto" in
13488 ''|0) try='int getlogin_r(char*, size_t);'
13489 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BW ;;
13491 case "$getlogin_r_proto" in
13492 ''|0) try='int getlogin_r(char*, int);'
13493 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BI ;;
13495 case "$getlogin_r_proto" in
13496 ''|0) try='char* getlogin_r(char*, size_t);'
13497 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BW ;;
13499 case "$getlogin_r_proto" in
13500 ''|0) try='char* getlogin_r(char*, int);'
13501 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BI ;;
13503 case "$getlogin_r_proto" in
13504 ''|0) d_getlogin_r=undef
13506 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
13507 * ) case "$getlogin_r_proto" in
13508 REENTRANT_PROTO*) ;;
13509 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
13511 echo "Prototype: $try" ;;
13514 *) case "$usethreads" in
13515 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
13522 *) getlogin_r_proto=0
13526 : see if getmnt exists
13527 set getmnt d_getmnt
13530 : see if getmntent exists
13531 set getmntent d_getmntent
13534 : see if getnetbyaddr exists
13535 set getnetbyaddr d_getnbyaddr
13538 : see if getnetbyname exists
13539 set getnetbyname d_getnbyname
13542 : see if getnetent exists
13543 set getnetent d_getnent
13546 : see if getnetbyaddr_r exists
13547 set getnetbyaddr_r d_getnetbyaddr_r
13549 case "$d_getnetbyaddr_r" in
13551 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13552 case "$d_getnetbyaddr_r_proto:$usethreads" in
13553 ":define") d_getnetbyaddr_r_proto=define
13554 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
13558 case "$d_getnetbyaddr_r_proto" in
13560 case "$getnetbyaddr_r_proto" in
13561 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
13562 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
13564 case "$getnetbyaddr_r_proto" in
13565 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
13566 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
13568 case "$getnetbyaddr_r_proto" in
13569 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
13570 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
13572 case "$getnetbyaddr_r_proto" in
13573 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
13574 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
13576 case "$getnetbyaddr_r_proto" in
13577 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
13578 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
13580 case "$getnetbyaddr_r_proto" in
13581 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
13582 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
13584 case "$getnetbyaddr_r_proto" in
13585 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
13586 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
13588 case "$getnetbyaddr_r_proto" in
13589 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
13590 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
13592 case "$getnetbyaddr_r_proto" in
13593 ''|0) d_getnetbyaddr_r=undef
13594 getnetbyaddr_r_proto=0
13595 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
13596 * ) case "$getnetbyaddr_r_proto" in
13597 REENTRANT_PROTO*) ;;
13598 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
13600 echo "Prototype: $try" ;;
13603 *) case "$usethreads" in
13604 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
13606 d_getnetbyaddr_r=undef
13607 getnetbyaddr_r_proto=0
13611 *) getnetbyaddr_r_proto=0
13615 : see if getnetbyname_r exists
13616 set getnetbyname_r d_getnetbyname_r
13618 case "$d_getnetbyname_r" in
13620 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13621 case "$d_getnetbyname_r_proto:$usethreads" in
13622 ":define") d_getnetbyname_r_proto=define
13623 set d_getnetbyname_r_proto getnetbyname_r $hdrs
13627 case "$d_getnetbyname_r_proto" in
13629 case "$getnetbyname_r_proto" in
13630 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
13631 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
13633 case "$getnetbyname_r_proto" in
13634 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
13635 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
13637 case "$getnetbyname_r_proto" in
13638 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
13639 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
13641 case "$getnetbyname_r_proto" in
13642 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
13643 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
13645 case "$getnetbyname_r_proto" in
13646 ''|0) d_getnetbyname_r=undef
13647 getnetbyname_r_proto=0
13648 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
13649 * ) case "$getnetbyname_r_proto" in
13650 REENTRANT_PROTO*) ;;
13651 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
13653 echo "Prototype: $try" ;;
13656 *) case "$usethreads" in
13657 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
13659 d_getnetbyname_r=undef
13660 getnetbyname_r_proto=0
13664 *) getnetbyname_r_proto=0
13668 : see if getnetent_r exists
13669 set getnetent_r d_getnetent_r
13671 case "$d_getnetent_r" in
13673 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13674 case "$d_getnetent_r_proto:$usethreads" in
13675 ":define") d_getnetent_r_proto=define
13676 set d_getnetent_r_proto getnetent_r $hdrs
13680 case "$d_getnetent_r_proto" in
13682 case "$getnetent_r_proto" in
13683 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
13684 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
13686 case "$getnetent_r_proto" in
13687 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
13688 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBIE ;;
13690 case "$getnetent_r_proto" in
13691 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
13692 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBIE ;;
13694 case "$getnetent_r_proto" in
13695 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
13696 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBI ;;
13698 case "$getnetent_r_proto" in
13699 ''|0) try='int getnetent_r(struct netent*, char*, int);'
13700 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBI ;;
13702 case "$getnetent_r_proto" in
13703 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
13704 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SD ;;
13706 case "$getnetent_r_proto" in
13707 ''|0) d_getnetent_r=undef
13708 getnetent_r_proto=0
13709 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
13710 * ) case "$getnetent_r_proto" in
13711 REENTRANT_PROTO*) ;;
13712 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
13714 echo "Prototype: $try" ;;
13717 *) case "$usethreads" in
13718 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
13720 d_getnetent_r=undef
13721 getnetent_r_proto=0
13725 *) getnetent_r_proto=0
13729 : see if prototypes for various getnetxxx netdb.h functions are available
13731 set d_getnetprotos getnetent $i_netdb netdb.h
13734 : see if getpagesize exists
13735 set getpagesize d_getpagsz
13739 : see if getprotobyname exists
13740 set getprotobyname d_getpbyname
13743 : see if getprotobynumber exists
13744 set getprotobynumber d_getpbynumber
13747 : see if getprotoent exists
13748 set getprotoent d_getpent
13751 : see if getpgid exists
13752 set getpgid d_getpgid
13755 : see if getpgrp2 exists
13756 set getpgrp2 d_getpgrp2
13759 : see if getppid exists
13760 set getppid d_getppid
13763 : see if getpriority exists
13764 set getpriority d_getprior
13767 : see if getprotobyname_r exists
13768 set getprotobyname_r d_getprotobyname_r
13770 case "$d_getprotobyname_r" in
13772 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13773 case "$d_getprotobyname_r_proto:$usethreads" in
13774 ":define") d_getprotobyname_r_proto=define
13775 set d_getprotobyname_r_proto getprotobyname_r $hdrs
13779 case "$d_getprotobyname_r_proto" in
13781 case "$getprotobyname_r_proto" in
13782 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
13783 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
13785 case "$getprotobyname_r_proto" in
13786 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
13787 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
13789 case "$getprotobyname_r_proto" in
13790 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
13791 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
13793 case "$getprotobyname_r_proto" in
13794 ''|0) d_getprotobyname_r=undef
13795 getprotobyname_r_proto=0
13796 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
13797 * ) case "$getprotobyname_r_proto" in
13798 REENTRANT_PROTO*) ;;
13799 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
13801 echo "Prototype: $try" ;;
13804 *) case "$usethreads" in
13805 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
13807 d_getprotobyname_r=undef
13808 getprotobyname_r_proto=0
13812 *) getprotobyname_r_proto=0
13816 : see if getprotobynumber_r exists
13817 set getprotobynumber_r d_getprotobynumber_r
13819 case "$d_getprotobynumber_r" in
13821 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13822 case "$d_getprotobynumber_r_proto:$usethreads" in
13823 ":define") d_getprotobynumber_r_proto=define
13824 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
13828 case "$d_getprotobynumber_r_proto" in
13830 case "$getprotobynumber_r_proto" in
13831 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
13832 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
13834 case "$getprotobynumber_r_proto" in
13835 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
13836 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
13838 case "$getprotobynumber_r_proto" in
13839 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
13840 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
13842 case "$getprotobynumber_r_proto" in
13843 ''|0) d_getprotobynumber_r=undef
13844 getprotobynumber_r_proto=0
13845 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
13846 * ) case "$getprotobynumber_r_proto" in
13847 REENTRANT_PROTO*) ;;
13848 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
13850 echo "Prototype: $try" ;;
13853 *) case "$usethreads" in
13854 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
13856 d_getprotobynumber_r=undef
13857 getprotobynumber_r_proto=0
13861 *) getprotobynumber_r_proto=0
13865 : see if getprotoent_r exists
13866 set getprotoent_r d_getprotoent_r
13868 case "$d_getprotoent_r" in
13870 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13871 case "$d_getprotoent_r_proto:$usethreads" in
13872 ":define") d_getprotoent_r_proto=define
13873 set d_getprotoent_r_proto getprotoent_r $hdrs
13877 case "$d_getprotoent_r_proto" in
13879 case "$getprotoent_r_proto" in
13880 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
13881 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
13883 case "$getprotoent_r_proto" in
13884 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
13885 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBI ;;
13887 case "$getprotoent_r_proto" in
13888 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
13889 ./protochk "extern $try" $hdrs && getprotoent_r_proto=S_SBI ;;
13891 case "$getprotoent_r_proto" in
13892 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
13893 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SD ;;
13895 case "$getprotoent_r_proto" in
13896 ''|0) d_getprotoent_r=undef
13897 getprotoent_r_proto=0
13898 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
13899 * ) case "$getprotoent_r_proto" in
13900 REENTRANT_PROTO*) ;;
13901 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
13903 echo "Prototype: $try" ;;
13906 *) case "$usethreads" in
13907 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
13909 d_getprotoent_r=undef
13910 getprotoent_r_proto=0
13914 *) getprotoent_r_proto=0
13918 : see if prototypes for various getprotoxxx netdb.h functions are available
13920 set d_getprotoprotos getprotoent $i_netdb netdb.h
13923 : see if getprpwnam exists
13924 set getprpwnam d_getprpwnam
13927 : see if getpwent exists
13928 set getpwent d_getpwent
13931 : see if getpwent_r exists
13932 set getpwent_r d_getpwent_r
13934 case "$d_getpwent_r" in
13936 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13937 case "$d_getpwent_r_proto:$usethreads" in
13938 ":define") d_getpwent_r_proto=define
13939 set d_getpwent_r_proto getpwent_r $hdrs
13943 case "$d_getpwent_r_proto" in
13945 case "$getpwent_r_proto" in
13946 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
13947 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBWR ;;
13949 case "$getpwent_r_proto" in
13950 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
13951 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIR ;;
13953 case "$getpwent_r_proto" in
13954 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
13955 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBW ;;
13957 case "$getpwent_r_proto" in
13958 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
13959 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBI ;;
13961 case "$getpwent_r_proto" in
13962 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
13963 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBI ;;
13965 case "$getpwent_r_proto" in
13966 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
13967 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIH ;;
13969 case "$getpwent_r_proto" in
13970 ''|0) d_getpwent_r=undef
13972 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
13973 * ) case "$getpwent_r_proto" in
13974 REENTRANT_PROTO*) ;;
13975 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
13977 echo "Prototype: $try" ;;
13980 *) case "$usethreads" in
13981 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
13988 *) getpwent_r_proto=0
13992 : see if getpwnam_r exists
13993 set getpwnam_r d_getpwnam_r
13995 case "$d_getpwnam_r" in
13997 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13998 case "$d_getpwnam_r_proto:$usethreads" in
13999 ":define") d_getpwnam_r_proto=define
14000 set d_getpwnam_r_proto getpwnam_r $hdrs
14004 case "$d_getpwnam_r_proto" in
14006 case "$getpwnam_r_proto" in
14007 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
14008 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
14010 case "$getpwnam_r_proto" in
14011 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
14012 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
14014 case "$getpwnam_r_proto" in
14015 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
14016 ./protochk "extern $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
14018 case "$getpwnam_r_proto" in
14019 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
14020 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
14022 case "$getpwnam_r_proto" in
14023 ''|0) d_getpwnam_r=undef
14025 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
14026 * ) case "$getpwnam_r_proto" in
14027 REENTRANT_PROTO*) ;;
14028 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
14030 echo "Prototype: $try" ;;
14033 *) case "$usethreads" in
14034 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
14041 *) getpwnam_r_proto=0
14045 : see if getpwuid_r exists
14046 set getpwuid_r d_getpwuid_r
14048 case "$d_getpwuid_r" in
14050 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14051 case "$d_getpwuid_r_proto:$usethreads" in
14052 ":define") d_getpwuid_r_proto=define
14053 set d_getpwuid_r_proto getpwuid_r $hdrs
14057 case "$d_getpwuid_r_proto" in
14059 case "$getpwuid_r_proto" in
14060 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
14061 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
14063 case "$getpwuid_r_proto" in
14064 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
14065 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
14067 case "$getpwuid_r_proto" in
14068 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
14069 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
14071 case "$getpwuid_r_proto" in
14072 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
14073 ./protochk "extern $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
14075 case "$getpwuid_r_proto" in
14076 ''|0) d_getpwuid_r=undef
14078 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
14079 * ) case "$getpwuid_r_proto" in
14080 REENTRANT_PROTO*) ;;
14081 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
14083 echo "Prototype: $try" ;;
14086 *) case "$usethreads" in
14087 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
14094 *) getpwuid_r_proto=0
14099 : see if getservbyname exists
14100 set getservbyname d_getsbyname
14103 : see if getservbyport exists
14104 set getservbyport d_getsbyport
14107 : see if getservent exists
14108 set getservent d_getsent
14111 : see if getservbyname_r exists
14112 set getservbyname_r d_getservbyname_r
14114 case "$d_getservbyname_r" in
14116 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14117 case "$d_getservbyname_r_proto:$usethreads" in
14118 ":define") d_getservbyname_r_proto=define
14119 set d_getservbyname_r_proto getservbyname_r $hdrs
14123 case "$d_getservbyname_r_proto" in
14125 case "$getservbyname_r_proto" in
14126 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
14127 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
14129 case "$getservbyname_r_proto" in
14130 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
14131 ./protochk "extern $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
14133 case "$getservbyname_r_proto" in
14134 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
14135 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
14137 case "$getservbyname_r_proto" in
14138 ''|0) d_getservbyname_r=undef
14139 getservbyname_r_proto=0
14140 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
14141 * ) case "$getservbyname_r_proto" in
14142 REENTRANT_PROTO*) ;;
14143 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
14145 echo "Prototype: $try" ;;
14148 *) case "$usethreads" in
14149 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
14151 d_getservbyname_r=undef
14152 getservbyname_r_proto=0
14156 *) getservbyname_r_proto=0
14160 : see if getservbyport_r exists
14161 set getservbyport_r d_getservbyport_r
14163 case "$d_getservbyport_r" in
14165 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14166 case "$d_getservbyport_r_proto:$usethreads" in
14167 ":define") d_getservbyport_r_proto=define
14168 set d_getservbyport_r_proto getservbyport_r $hdrs
14172 case "$d_getservbyport_r_proto" in
14174 case "$getservbyport_r_proto" in
14175 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
14176 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
14178 case "$getservbyport_r_proto" in
14179 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
14180 ./protochk "extern $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
14182 case "$getservbyport_r_proto" in
14183 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
14184 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
14186 case "$getservbyport_r_proto" in
14187 ''|0) d_getservbyport_r=undef
14188 getservbyport_r_proto=0
14189 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
14190 * ) case "$getservbyport_r_proto" in
14191 REENTRANT_PROTO*) ;;
14192 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
14194 echo "Prototype: $try" ;;
14197 *) case "$usethreads" in
14198 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
14200 d_getservbyport_r=undef
14201 getservbyport_r_proto=0
14205 *) getservbyport_r_proto=0
14209 : see if getservent_r exists
14210 set getservent_r d_getservent_r
14212 case "$d_getservent_r" in
14214 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14215 case "$d_getservent_r_proto:$usethreads" in
14216 ":define") d_getservent_r_proto=define
14217 set d_getservent_r_proto getservent_r $hdrs
14221 case "$d_getservent_r_proto" in
14223 case "$getservent_r_proto" in
14224 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
14225 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBWR ;;
14227 case "$getservent_r_proto" in
14228 ''|0) try='int getservent_r(struct servent*, char*, int);'
14229 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBI ;;
14231 case "$getservent_r_proto" in
14232 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
14233 ./protochk "extern $try" $hdrs && getservent_r_proto=S_SBI ;;
14235 case "$getservent_r_proto" in
14236 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
14237 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SD ;;
14239 case "$getservent_r_proto" in
14240 ''|0) d_getservent_r=undef
14241 getservent_r_proto=0
14242 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
14243 * ) case "$getservent_r_proto" in
14244 REENTRANT_PROTO*) ;;
14245 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
14247 echo "Prototype: $try" ;;
14250 *) case "$usethreads" in
14251 define) echo "getservent_r has no prototype, not using it." >&4 ;;
14253 d_getservent_r=undef
14254 getservent_r_proto=0
14258 *) getservent_r_proto=0
14262 : see if prototypes for various getservxxx netdb.h functions are available
14264 set d_getservprotos getservent $i_netdb netdb.h
14267 : see if getspnam exists
14268 set getspnam d_getspnam
14271 : see if this is a shadow.h system
14272 set shadow.h i_shadow
14275 : see if getspnam_r exists
14276 set getspnam_r d_getspnam_r
14278 case "$d_getspnam_r" in
14280 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
14281 case "$d_getspnam_r_proto:$usethreads" in
14282 ":define") d_getspnam_r_proto=define
14283 set d_getspnam_r_proto getspnam_r $hdrs
14287 case "$d_getspnam_r_proto" in
14289 case "$getspnam_r_proto" in
14290 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
14291 ./protochk "extern $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
14293 case "$getspnam_r_proto" in
14294 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
14295 ./protochk "extern $try" $hdrs && getspnam_r_proto=S_CSBI ;;
14297 case "$getspnam_r_proto" in
14298 ''|0) d_getspnam_r=undef
14300 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
14301 * ) case "$getspnam_r_proto" in
14302 REENTRANT_PROTO*) ;;
14303 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
14305 echo "Prototype: $try" ;;
14308 *) case "$usethreads" in
14309 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
14316 *) getspnam_r_proto=0
14320 : see if gettimeofday or ftime exists
14321 set gettimeofday d_gettimeod
14323 case "$d_gettimeod" in
14329 val="$undef"; set d_ftime; eval $setvar
14332 case "$d_gettimeod$d_ftime" in
14335 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
14339 : see if gmtime_r exists
14340 set gmtime_r d_gmtime_r
14342 case "$d_gmtime_r" in
14344 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14345 case "$d_gmtime_r_proto:$usethreads" in
14346 ":define") d_gmtime_r_proto=define
14347 set d_gmtime_r_proto gmtime_r $hdrs
14351 case "$d_gmtime_r_proto" in
14353 case "$gmtime_r_proto" in
14354 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
14355 ./protochk "extern $try" $hdrs && gmtime_r_proto=S_TS ;;
14357 case "$gmtime_r_proto" in
14358 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
14359 ./protochk "extern $try" $hdrs && gmtime_r_proto=I_TS ;;
14361 case "$gmtime_r_proto" in
14362 ''|0) d_gmtime_r=undef
14364 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
14365 * ) case "$gmtime_r_proto" in
14366 REENTRANT_PROTO*) ;;
14367 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
14369 echo "Prototype: $try" ;;
14372 *) case "$usethreads" in
14373 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
14380 *) gmtime_r_proto=0
14384 : see if hasmntopt exists
14385 set hasmntopt d_hasmntopt
14388 : see if this is a netinet/in.h or sys/in.h system
14389 set netinet/in.h i_niin sys/in.h i_sysin
14392 : see if arpa/inet.h has to be included
14393 set arpa/inet.h i_arpainet
14396 : see if htonl --and friends-- exists
14401 : Maybe they are macros.
14404 $cat >htonl.c <<EOM
14406 #include <sys/types.h>
14407 #$i_niin I_NETINET_IN
14409 #$i_arpainet I_ARPA_INET
14410 #ifdef I_NETINET_IN
14411 #include <netinet/in.h>
14414 #include <sys/in.h>
14417 #include <arpa/inet.h>
14420 printf("Defined as a macro.");
14423 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
14424 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
14426 echo "But it seems to be defined as a macro." >&4
14434 : see if ilogbl exists
14435 set ilogbl d_ilogbl
14440 if set index val -f; eval $csym; $val; then
14441 if set strchr val -f d_strchr; eval $csym; $val; then
14442 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14445 echo "strchr() found." >&4
14449 echo "index() found." >&4
14454 echo "index() found." >&4
14457 if set strchr val -f d_strchr; eval $csym; $val; then
14460 echo "strchr() found." >&4
14462 echo "No index() or strchr() found!" >&4
14467 set d_strchr; eval $setvar
14469 set d_index; eval $setvar
14471 : check whether inet_aton exists
14472 set inet_aton d_inetaton
14477 $cat >isascii.c <<EOCP
14480 #$i_stdlib I_STDLIB
14482 #include <stdlib.h>
14493 if eval $compile; then
14494 echo "isascii() found." >&4
14497 echo "isascii() NOT found." >&4
14504 : see if isfinite exists
14505 set isfinite d_isfinite
14508 : see if isinf exists
14512 : see if isnan exists
14516 : see if isnanl exists
14517 set isnanl d_isnanl
14520 : see if killpg exists
14521 set killpg d_killpg
14524 : see if lchown exists
14526 $cat > try.c <<'EOCP'
14527 /* System header to define __stub macros and hopefully few prototypes,
14528 which can conflict with char lchown(); below. */
14529 #include <assert.h>
14530 /* Override any gcc2 internal prototype to avoid an error. */
14531 /* We use char because int might match the return type of a gcc2
14532 builtin and then its argument prototype would still apply. */
14535 /* The GNU C library defines this for functions which it implements
14536 to always fail with ENOSYS. Some functions are actually named
14537 something starting with __ and the normal name is an alias. */
14538 #if defined (__stub_lchown) || defined (__stub___lchown)
14546 if eval $compile; then
14547 $echo "lchown() found." >&4
14550 $echo "lchown() NOT found." >&4
14556 : See if number of significant digits in a double precision number is known
14558 $cat >ldbl_dig.c <<EOM
14559 #$i_limits I_LIMITS
14562 #include <limits.h>
14568 printf("Contains LDBL_DIG");
14571 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
14572 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
14573 echo "LDBL_DIG found." >&4
14576 echo "LDBL_DIG NOT found." >&4
14583 : see if this is a math.h system
14587 d_libm_lib_version="$undef"
14590 : check to see if math.h defines _LIB_VERSION
14592 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
14594 #include <unistd.h>
14596 int main (int argc, char *argv[])
14598 printf ("%d\n", _LIB_VERSION);
14603 if eval $compile; then
14605 echo "Yes, it does ($foo)" >&4
14606 d_libm_lib_version="$define"
14608 echo "No, it does not (probably harmless)\n" >&4
14615 : see if link exists
14619 : see if localtime_r exists
14620 set localtime_r d_localtime_r
14622 case "$d_localtime_r" in
14624 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14625 case "$d_localtime_r_proto:$usethreads" in
14626 ":define") d_localtime_r_proto=define
14627 set d_localtime_r_proto localtime_r $hdrs
14631 case "$d_localtime_r_proto" in
14633 case "$localtime_r_proto" in
14634 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
14635 ./protochk "extern $try" $hdrs && localtime_r_proto=S_TS ;;
14637 case "$localtime_r_proto" in
14638 ''|0) try='int localtime_r(const time_t*, struct tm*);'
14639 ./protochk "extern $try" $hdrs && localtime_r_proto=I_TS ;;
14641 case "$localtime_r_proto" in
14642 ''|0) d_localtime_r=undef
14643 localtime_r_proto=0
14644 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
14645 * ) case "$localtime_r_proto" in
14646 REENTRANT_PROTO*) ;;
14647 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
14649 echo "Prototype: $try" ;;
14652 *) case "$usethreads" in
14653 define) echo "localtime_r has no prototype, not using it." >&4 ;;
14655 d_localtime_r=undef
14656 localtime_r_proto=0
14660 *) localtime_r_proto=0
14664 : see if localtime_r calls tzset
14665 case "$localtime_r_proto" in
14668 /* Does our libc's localtime_r call tzset ?
14669 * return 0 if so, 1 otherwise.
14671 #include <sys/types.h>
14672 #include <unistd.h>
14674 #include <string.h>
14675 #include <malloc.h>
14678 time_t t = time(0L);
14679 char w_tz[]="TZ" "=GMT+5",
14680 e_tz[]="TZ" "=GMT-5",
14681 *tz_e = (char*)malloc(16),
14682 *tz_w = (char*)malloc(16);
14683 struct tm tm_e, tm_w;
14684 memset(&tm_e,'\0',sizeof(struct tm));
14685 memset(&tm_w,'\0',sizeof(struct tm));
14690 localtime_r(&t, &tm_e);
14693 localtime_r(&t, &tm_w);
14695 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
14701 if eval $compile; then
14702 if $run ./try; then
14703 d_localtime_r_needs_tzset=undef;
14705 d_localtime_r_needs_tzset=define;
14708 d_localtime_r_needs_tzset=undef;
14712 d_localtime_r_needs_tzset=undef;
14717 : see if localeconv exists
14718 set localeconv d_locconv
14721 : see if lockf exists
14725 : see if prototype for lseek is available
14727 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
14730 : see if lstat exists
14734 : see if madvise exists
14735 set madvise d_madvise
14738 : see if malloc_size exists
14739 set malloc_size d_malloc_size
14742 : see if malloc_size_good exists
14743 set malloc_good_size d_malloc_good_size
14746 : see if mblen exists
14750 : see if mbstowcs exists
14751 set mbstowcs d_mbstowcs
14754 : see if mbtowc exists
14755 set mbtowc d_mbtowc
14758 : see if memchr exists
14759 set memchr d_memchr
14762 : see if memcmp exists
14763 set memcmp d_memcmp
14766 : see if memcpy exists
14767 set memcpy d_memcpy
14770 : see if memmove exists
14771 set memmove d_memmove
14774 : see if memset exists
14775 set memset d_memset
14778 : see if mkdir exists
14782 : see if mkdtemp exists
14783 set mkdtemp d_mkdtemp
14786 : see if mkfifo exists
14787 set mkfifo d_mkfifo
14790 : see if mkstemp exists
14791 set mkstemp d_mkstemp
14794 : see if mkstemps exists
14795 set mkstemps d_mkstemps
14798 : see if mktime exists
14799 set mktime d_mktime
14802 : see if this is a sys/mman.h system
14803 set sys/mman.h i_sysmman
14806 : see if mmap exists
14809 : see what shmat returns
14810 : default to something harmless
14812 case "$i_sysmman$d_mmap" in
14814 $cat >mmap.c <<'END'
14815 #include <sys/mman.h>
14818 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
14823 echo "and it returns ($mmaptype)." >&4
14829 : see if sqrtl exists
14833 : see if scalbnl exists
14834 set scalbnl d_scalbnl
14837 : see if modfl exists
14841 : see if prototype for modfl is available
14843 set d_modflproto modfl $i_math math.h
14846 d_modfl_pow32_bug="$undef"
14848 case "$d_longdbl$d_modfl" in
14851 Checking to see whether your modfl() is okay for large values...
14857 if $test "X$d_modflproto" != "X$define"; then
14858 $cat >>try.c <<EOCP
14859 /* Sigh. many current glibcs provide the function, but do not prototype it. */
14860 long double modfl (long double, long double *);
14863 $cat >>try.c <<EOCP
14865 long double nv = 4294967303.15;
14871 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
14875 case "$osname:$gccversion" in
14876 aix:) saveccflags="$ccflags"
14877 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
14880 if eval $compile; then
14883 *" 4294967303.150000 1.150000 4294967302.000000")
14884 echo >&4 "Your modfl() is broken for large values."
14885 d_modfl_pow32_bug="$define"
14887 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
14891 *" 4294967303.150000 0.150000 4294967303.000000")
14892 echo >&4 "Your modfl() seems okay for large values."
14894 *) echo >&4 "I don't understand your modfl() at all."
14900 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
14903 case "$osname:$gccversion" in
14904 aix:) ccflags="$saveccflags" ;; # restore
14909 if $test "$uselongdouble" = "$define"; then
14911 if $test "$d_sqrtl" != "$define"; then
14912 message="$message sqrtl"
14914 if $test "$d_modfl" != "$define"; then
14915 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
14916 echo "You have both aintl and copysignl, so I can emulate modfl."
14918 message="$message modfl"
14921 if $test "$d_frexpl" != "$define"; then
14922 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
14923 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
14925 message="$message frexpl"
14929 if $test "$message" != ""; then
14932 *** You requested the use of long doubles but you do not seem to have
14933 *** the following mathematical functions needed for long double support:
14935 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
14936 *** Cannot continue, aborting.
14944 : see if mprotect exists
14945 set mprotect d_mprotect
14948 : see if msgctl exists
14949 set msgctl d_msgctl
14952 : see if msgget exists
14953 set msgget d_msgget
14956 : see if msgsnd exists
14957 set msgsnd d_msgsnd
14960 : see if msgrcv exists
14961 set msgrcv d_msgrcv
14964 : see how much of the 'msg*(2)' library is present.
14967 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
14968 *"$undef"*) h_msg=false;;
14972 case "`ipcs 2>&1`" in
14973 "SVID messages"*"not configured"*)
14974 echo "Your $osname does not have the msg*(2) configured." >&4
14977 set msgctl d_msgctl
14979 set msgget d_msgget
14981 set msgsnd d_msgsnd
14983 set msgrcv d_msgrcv
14989 : we could also check for sys/ipc.h ...
14990 if $h_msg && $test `./findhdr sys/msg.h`; then
14991 echo "You have the full msg*(2) library." >&4
14994 echo "You don't have the full msg*(2) library." >&4
15002 echo "Checking to see if your system supports struct msghdr..." >&4
15003 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
15005 case "$d_msghdr_s" in
15006 "$define") echo "Yes, it does." ;;
15007 *) echo "No, it doesn't." ;;
15011 : see if msync exists
15015 : see if munmap exists
15016 set munmap d_munmap
15019 : see if nice exists
15023 : see if this is a langinfo.h system
15024 set langinfo.h i_langinfo
15027 : see if nl_langinfo exists
15028 set nl_langinfo d_nl_langinfo
15031 : check for length of character
15033 case "$charsize" in
15035 echo "Checking to see how big your characters are (hey, you never know)..." >&4
15038 #$i_stdlib I_STDLIB
15040 #include <stdlib.h>
15044 printf("%d\n", (int)sizeof(char));
15049 if eval $compile_ok; then
15053 echo "(I can't seem to compile the test program. Guessing...)"
15060 rp="What is the size of a character (in bytes)?"
15065 : check for volatile keyword
15067 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
15068 $cat >try.c <<'EOCP'
15071 typedef struct _goo_struct goo_struct;
15072 goo_struct * volatile goo = ((goo_struct *)0);
15073 struct _goo_struct {
15078 typedef unsigned short foo_t;
15079 char *volatile foo;
15081 volatile foo_t blech;
15085 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
15087 echo "Yup, it does."
15090 echo "Nope, it doesn't."
15098 $echo "Choosing the C types to be used for Perl's internal types..." >&4
15100 case "$use64bitint:$d_quad:$quadtype" in
15103 uvtype="$uquadtype"
15108 uvtype="unsigned long"
15114 case "$uselongdouble:$d_longdbl" in
15116 nvtype="long double"
15117 nvsize=$longdblsize
15124 $echo "(IV will be "$ivtype", $ivsize bytes)"
15125 $echo "(UV will be "$uvtype", $uvsize bytes)"
15126 $echo "(NV will be "$nvtype", $nvsize bytes)"
15129 #$i_inttypes I_INTTYPES
15131 #include <inttypes.h>
15136 int8_t i = INT8_MAX;
15137 uint8_t u = UINT8_MAX;
15138 printf("int8_t\n");
15141 int16_t i = INT16_MAX;
15142 uint16_t i = UINT16_MAX;
15143 printf("int16_t\n");
15146 int32_t i = INT32_MAX;
15147 uint32_t u = UINT32_MAX;
15148 printf("int32_t\n");
15154 '') case "$charsize" in
15156 u8type="unsigned char"
15165 if eval $compile; then
15166 case "`$run ./try`" in
15167 int8_t) i8type=int8_t
15177 '') if $test $charsize -ge 1; then
15179 u8type="unsigned char"
15187 '') case "$shortsize" in
15189 u16type="unsigned short"
15197 '') set try -DINT16
15198 if eval $compile; then
15199 case "`$run ./try`" in
15211 '') if $test $shortsize -ge 2; then
15213 u16type="unsigned short"
15221 '') case "$longsize" in
15223 u32type="unsigned long"
15227 *) case "$intsize" in
15229 u32type="unsigned int"
15239 '') set try -DINT32
15240 if eval $compile; then
15241 case "`$run ./try`" in
15253 '') if $test $intsize -ge 4; then
15255 u32type="unsigned int"
15263 '') case "$d_quad:$quadtype" in
15265 i64type="$quadtype"
15266 u64type="$uquadtype"
15274 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
15275 : volatile so that the compiler has to store it out to memory.
15276 if test X"$d_volatile" = X"$define"; then
15281 #$i_stdlib I_STDLIB
15283 #include <stdlib.h>
15285 #include <sys/types.h>
15286 #include <signal.h>
15288 $volatile int bletched = 0;
15289 $signal_t blech(int s) { bletched = 1; }
15294 int n = 8 * $uvsize;
15297 signal(SIGFPE, blech);
15300 for (i = 0; i < n; i++) {
15301 u = u << 1 | ($uvtype)1;
15303 if (($uvtype)d != u)
15307 d = ($nvtype)(u - 1);
15308 if (($uvtype)d != (u - 1))
15315 printf("%d\n", ((i == n) ? -n : i));
15321 d_nv_preserves_uv="$undef"
15322 if eval $compile; then
15323 nv_preserves_uv_bits="`$run ./try`"
15325 case "$nv_preserves_uv_bits" in
15327 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
15328 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
15329 d_nv_preserves_uv="$define"
15331 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
15332 d_nv_preserves_uv="$undef" ;;
15333 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
15334 nv_preserves_uv_bits="0" ;;
15338 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
15339 : volatile so that the compiler has to store it out to memory.
15340 if test X"$d_volatile" = X"$define"; then
15345 #$i_stdlib I_STDLIB
15347 #include <stdlib.h>
15349 #$i_string I_STRING
15351 # include <string.h>
15353 # include <strings.h>
15355 #include <sys/types.h>
15356 #include <signal.h>
15358 $volatile int bletched = 0;
15359 $signal_t blech(int s) { bletched = 1; }
15362 int checkit($nvtype d, char *where) {
15363 unsigned char *p = (char *)&d;
15364 unsigned char *end = p + sizeof(d);
15374 printf("No - %s: 0x", where);
15376 printf ("%02X", *p++);
15381 int main(int argc, char **argv) {
15384 fail += checkit(d, "0.0");
15386 /* The compiler shouldn't be assuming that bletched is 0 */
15389 fail += checkit(d, "bleched");
15392 signal(SIGFPE, blech);
15395 /* Paranoia - the compiler should have no way of knowing that ANSI says
15396 that argv[argc] will always be NULL. Actually, if it did assume this it
15397 would be buggy, as this is C and main() can be called from elsewhere in
15399 d = argv[argc] ? 1 : 0;
15402 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
15405 fail += checkit(d, "ternary");
15407 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
15410 printf("No - memset doesn't give 0.0\n");
15411 /* This might just blow up: */
15412 printf("(gives %g)\n", d);
15418 printf("No - something bleched\n");
15423 printf("No - %d fail(s)\n", fail);
15432 d_nv_zero_is_allbits_zero="$undef"
15433 if eval $compile; then
15439 0.0 is represented as all bits zero in memory
15441 d_nv_zero_is_allbits_zero="$define"
15444 0.0 is not represented as all bits zero in memory
15446 d_nv_zero_is_allbits_zero="$undef"
15451 0.0 is not represented as all bits zero in memory
15453 d_nv_zero_is_allbits_zero="$undef"
15459 : check for off64_t
15461 echo "Checking to see if you have off64_t..." >&4
15463 #include <sys/types.h>
15464 #include <unistd.h>
15465 int main() { off64_t x = 7; }
15468 if eval $compile; then
15470 echo "You have off64_t."
15473 echo "You do not have off64_t."
15474 case "$lseeksize" in
15475 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
15482 : how to create joinable pthreads
15483 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
15485 echo "Checking what constant to use for creating joinable pthreads..." >&4
15486 $cat >try.c <<'EOCP'
15487 #include <pthread.h>
15489 int detachstate = JOINABLE;
15492 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
15493 if eval $compile; then
15494 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
15495 val="$undef" # Yes, undef.
15496 set d_old_pthread_create_joinable
15499 set old_pthread_create_joinable
15502 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
15503 if eval $compile; then
15504 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
15506 set d_old_pthread_create_joinable
15508 val=PTHREAD_CREATE_UNDETACHED
15509 set old_pthread_create_joinable
15512 set try -DJOINABLE=__UNDETACHED
15513 if eval $compile; then
15514 echo "You seem to use __UNDETACHED." >&4
15516 set d_old_pthread_create_joinable
15519 set old_pthread_create_joinable
15522 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
15524 set d_old_pthread_create_joinable
15527 set old_pthread_create_joinable
15534 d_old_pthread_create_joinable="$undef"
15535 old_pthread_create_joinable=""
15538 : see if pause exists
15542 : see if pipe exists
15546 : see if poll exists
15550 : see if readlink exists
15551 set readlink d_readlink
15557 case "$d_readlink" in
15559 if $issymlink /proc/self/exe ; then
15560 $ls -l /proc/self/exe > reflect
15561 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15562 echo "You have Linux-like /proc/self/exe."
15563 procselfexe='"/proc/self/exe"'
15567 if $issymlink /proc/curproc/file ; then
15568 $ls -l /proc/curproc/file > reflect
15569 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15570 echo "You have BSD-like /proc/curproc/file."
15571 procselfexe='"/proc/curproc/file"'
15581 : backward compatibility for d_hvfork
15582 if test X$d_hvfork != X; then
15583 d_vfork="$d_hvfork"
15586 : see if there is a vfork
15591 d_pseudofork=$undef
15593 : Ok, but do we want to use it. vfork is reportedly unreliable in
15594 : perl on Solaris 2.x, and probably elsewhere.
15598 case "$usevfork" in
15604 Perl can only use a vfork() that doesn't suffer from strict
15605 restrictions on calling functions or modifying global data in
15606 the child. For example, glibc-2.1 contains such a vfork()
15607 that is unsuitable. If your system provides a proper fork()
15608 call, chances are that you do NOT want perl to use vfork().
15611 rp="Do you still want to use vfork()?"
15616 echo "Ok, we won't use vfork()."
15625 $define) usevfork='true';;
15626 *) usevfork='false';;
15629 : see whether the pthread_atfork exists
15631 #include <pthread.h>
15634 #ifdef PTHREAD_ATFORK
15635 pthread_atfork(NULL,NULL,NULL);
15640 : see if pthread_atfork exists
15641 set try -DPTHREAD_ATFORK
15642 if eval $compile; then
15647 case "$usethreads" in
15650 $define) echo 'pthread_atfork found.' >&4 ;;
15651 *) echo 'pthread_atfork NOT found.' >&4 ;;
15654 set d_pthread_atfork
15657 : see if pthread_attr_setscope exists
15658 set pthread_attr_setscope d_pthread_attr_setscope
15662 : see whether the various POSIXish _yields exist
15664 #include <pthread.h>
15670 #ifdef PTHREAD_YIELD
15673 #ifdef PTHREAD_YIELD_NULL
15674 pthread_yield(NULL);
15680 : see if sched_yield exists
15681 set try -DSCHED_YIELD
15682 if eval $compile; then
15684 sched_yield='sched_yield()'
15688 case "$usethreads" in
15691 $define) echo 'sched_yield() found.' >&4 ;;
15692 *) echo 'sched_yield() NOT found.' >&4 ;;
15698 : see if pthread_yield exists
15699 set try -DPTHREAD_YIELD
15700 if eval $compile; then
15702 case "$sched_yield" in
15703 '') sched_yield='pthread_yield()' ;;
15706 set try -DPTHREAD_YIELD_NULL
15707 if eval $compile; then
15709 case "$sched_yield" in
15710 '') sched_yield='pthread_yield(NULL)' ;;
15716 case "$usethreads" in
15719 $define) echo 'pthread_yield() found.' >&4 ;;
15720 *) echo 'pthread_yield() NOT found.' >&4 ;;
15724 set d_pthread_yield
15726 case "$sched_yield" in
15727 '') sched_yield=undef ;;
15731 : see if random_r exists
15732 set random_r d_random_r
15734 case "$d_random_r" in
15736 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
15737 case "$d_random_r_proto:$usethreads" in
15738 ":define") d_random_r_proto=define
15739 set d_random_r_proto random_r $hdrs
15743 case "$d_random_r_proto" in
15745 case "$random_r_proto" in
15746 ''|0) try='int random_r(int*, struct random_data*);'
15747 ./protochk "extern $try" $hdrs && random_r_proto=I_iS ;;
15749 case "$random_r_proto" in
15750 ''|0) try='int random_r(long*, struct random_data*);'
15751 ./protochk "extern $try" $hdrs && random_r_proto=I_lS ;;
15753 case "$random_r_proto" in
15754 ''|0) try='int random_r(struct random_data*, int32_t*);'
15755 ./protochk "extern $try" $hdrs && random_r_proto=I_St ;;
15757 case "$random_r_proto" in
15758 ''|0) d_random_r=undef
15760 echo "Disabling random_r, cannot determine prototype." >&4 ;;
15761 * ) case "$random_r_proto" in
15762 REENTRANT_PROTO*) ;;
15763 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
15765 echo "Prototype: $try" ;;
15768 *) case "$usethreads" in
15769 define) echo "random_r has no prototype, not using it." >&4 ;;
15776 *) random_r_proto=0
15780 : see if readdir and friends exist
15781 set readdir d_readdir
15783 set seekdir d_seekdir
15785 set telldir d_telldir
15787 set rewinddir d_rewinddir
15790 : see if readdir64_r exists
15791 set readdir64_r d_readdir64_r
15793 case "$d_readdir64_r" in
15795 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15796 case "$d_readdir64_r_proto:$usethreads" in
15797 ":define") d_readdir64_r_proto=define
15798 set d_readdir64_r_proto readdir64_r $hdrs
15802 case "$d_readdir64_r_proto" in
15804 case "$readdir64_r_proto" in
15805 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
15806 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TSR ;;
15808 case "$readdir64_r_proto" in
15809 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
15810 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TS ;;
15812 case "$readdir64_r_proto" in
15813 ''|0) d_readdir64_r=undef
15814 readdir64_r_proto=0
15815 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
15816 * ) case "$readdir64_r_proto" in
15817 REENTRANT_PROTO*) ;;
15818 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
15820 echo "Prototype: $try" ;;
15823 *) case "$usethreads" in
15824 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
15826 d_readdir64_r=undef
15827 readdir64_r_proto=0
15831 *) readdir64_r_proto=0
15835 : see if readdir_r exists
15836 set readdir_r d_readdir_r
15838 case "$d_readdir_r" in
15840 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15841 case "$d_readdir_r_proto:$usethreads" in
15842 ":define") d_readdir_r_proto=define
15843 set d_readdir_r_proto readdir_r $hdrs
15847 case "$d_readdir_r_proto" in
15849 case "$readdir_r_proto" in
15850 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
15851 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TSR ;;
15853 case "$readdir_r_proto" in
15854 ''|0) try='int readdir_r(DIR*, struct dirent*);'
15855 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TS ;;
15857 case "$readdir_r_proto" in
15858 ''|0) d_readdir_r=undef
15860 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
15861 * ) case "$readdir_r_proto" in
15862 REENTRANT_PROTO*) ;;
15863 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
15865 echo "Prototype: $try" ;;
15868 *) case "$usethreads" in
15869 define) echo "readdir_r has no prototype, not using it." >&4 ;;
15876 *) readdir_r_proto=0
15880 : see if readv exists
15884 : see if recvmsg exists
15885 set recvmsg d_recvmsg
15888 : see if rename exists
15889 set rename d_rename
15892 : see if rmdir exists
15896 : see if memory.h is available.
15901 : See if it conflicts with string.h
15907 $cppstdin $cppflags $cppminus < $strings > mem.h
15908 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
15910 echo "We won't be including <memory.h>."
15920 : can bcopy handle overlapping blocks?
15923 case "$d_memmove" in
15924 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
15925 *) case "$d_bcopy" in
15927 echo "Checking to see if bcopy() can do overlapping copies..." >&4
15929 #$i_memory I_MEMORY
15930 #$i_stdlib I_STDLIB
15931 #$i_string I_STRING
15932 #$i_unistd I_UNISTD
15934 $cat >>try.c <<'EOCP'
15937 # include <memory.h>
15940 # include <stdlib.h>
15943 # include <string.h>
15945 # include <strings.h>
15948 # include <unistd.h> /* Needed for NetBSD */
15952 char buf[128], abc[128];
15958 /* Copy "abcde..." string to char abc[] so that gcc doesn't
15959 try to store the string in read-only memory. */
15960 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
15962 for (align = 7; align >= 0; align--) {
15963 for (len = 36; len; len--) {
15965 bcopy(abc, b, len);
15966 for (off = 1; off <= len; off++) {
15967 bcopy(b, b+off, len);
15968 bcopy(b+off, b, len);
15969 if (bcmp(b, abc, len))
15978 if eval $compile_ok; then
15979 if $run ./try 2>/dev/null; then
15980 echo "Yes, it can."
15983 echo "It can't, sorry."
15986 echo "(I can't compile the test program, so we'll assume not...)"
15996 : can memcpy handle overlapping blocks?
15999 case "$d_memmove" in
16000 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
16001 *) case "$d_memcpy" in
16003 echo "Checking to see if memcpy() can do overlapping copies..." >&4
16005 #$i_memory I_MEMORY
16006 #$i_stdlib I_STDLIB
16007 #$i_string I_STRING
16008 #$i_unistd I_UNISTD
16010 $cat >>try.c <<'EOCP'
16013 # include <memory.h>
16016 # include <stdlib.h>
16019 # include <string.h>
16021 # include <strings.h>
16024 # include <unistd.h> /* Needed for NetBSD */
16028 char buf[128], abc[128];
16034 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16035 try to store the string in read-only memory. */
16036 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
16038 for (align = 7; align >= 0; align--) {
16039 for (len = 36; len; len--) {
16041 memcpy(b, abc, len);
16042 for (off = 1; off <= len; off++) {
16043 memcpy(b+off, b, len);
16044 memcpy(b, b+off, len);
16045 if (memcmp(b, abc, len))
16054 if eval $compile_ok; then
16055 if $run ./try 2>/dev/null; then
16056 echo "Yes, it can."
16059 echo "It can't, sorry."
16062 echo "(I can't compile the test program, so we'll assume not...)"
16072 : can memcmp be trusted to compare relative magnitude?
16074 case "$d_memcmp" in
16077 echo "Checking if your memcmp() can compare relative magnitude..." >&4
16079 #$i_memory I_MEMORY
16080 #$i_stdlib I_STDLIB
16081 #$i_string I_STRING
16082 #$i_unistd I_UNISTD
16084 $cat >>try.c <<'EOCP'
16087 # include <memory.h>
16090 # include <stdlib.h>
16093 # include <string.h>
16095 # include <strings.h>
16098 # include <unistd.h> /* Needed for NetBSD */
16104 if ((a < b) && memcmp(&a, &b, 1) < 0)
16110 if eval $compile_ok; then
16111 if $run ./try 2>/dev/null; then
16112 echo "Yes, it can."
16115 echo "No, it can't (it uses signed chars)."
16118 echo "(I can't compile the test program, so we'll assume not...)"
16126 : see if prototype for sbrk is available
16128 set d_sbrkproto sbrk $i_unistd unistd.h
16131 : see if select exists
16132 set select d_select
16135 : see if semctl exists
16136 set semctl d_semctl
16139 : see if semget exists
16140 set semget d_semget
16143 : see if semop exists
16147 : see how much of the 'sem*(2)' library is present.
16150 case "$d_semctl$d_semget$d_semop" in
16151 *"$undef"*) h_sem=false;;
16155 case "`ipcs 2>&1`" in
16156 "SVID messages"*"not configured"*)
16157 echo "Your $osname does not have the sem*(2) configured." >&4
16160 set semctl d_semctl
16162 set semget d_semget
16170 : we could also check for sys/ipc.h ...
16171 if $h_sem && $test `./findhdr sys/sem.h`; then
16172 echo "You have the full sem*(2) library." >&4
16175 echo "You don't have the full sem*(2) library." >&4
16181 : see whether sys/sem.h defines union semun
16183 $cat > try.c <<'END'
16184 #include <sys/types.h>
16185 #include <sys/ipc.h>
16186 #include <sys/sem.h>
16187 int main () { union semun semun; semun.buf = 0; }
16190 if eval $compile; then
16191 echo "You have union semun in <sys/sem.h>." >&4
16194 echo "You do not have union semun in <sys/sem.h>." >&4
16201 : see how to do semctl IPC_STAT
16205 $cat > tryh.h <<END
16208 # define S_IRUSR S_IREAD
16209 # define S_IWUSR S_IWRITE
16210 # define S_IXUSR S_IEXEC
16212 # define S_IRUSR 0400
16213 # define S_IWUSR 0200
16214 # define S_IXUSR 0100
16216 # define S_IRGRP (S_IRUSR>>3)
16217 # define S_IWGRP (S_IWUSR>>3)
16218 # define S_IXGRP (S_IXUSR>>3)
16219 # define S_IROTH (S_IRUSR>>6)
16220 # define S_IWOTH (S_IWUSR>>6)
16221 # define S_IXOTH (S_IXUSR>>6)
16224 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
16225 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
16226 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
16229 : see whether semctl IPC_STAT can use union semun
16230 case "$d_semctl_semun" in
16234 #include <sys/types.h>
16235 #include <sys/ipc.h>
16236 #include <sys/sem.h>
16237 #include <sys/stat.h>
16244 #$d_union_semun HAS_UNION_SEMUN
16247 #ifndef HAS_UNION_SEMUN
16250 struct semid_ds *buf;
16251 unsigned short *array;
16257 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16258 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16260 struct semid_ds argbuf;
16263 st = semctl(sem, 0, IPC_STAT, arg);
16267 # endif /* IPC_STAT */
16268 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16270 if (semctl(sem, 0, IPC_RMID, arg) != 0)
16271 # endif /* IPC_RMID */
16272 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16274 #endif /* IPC_PRIVATE && ... */
16275 printf("semget failed: errno = %d\n", errno);
16280 if eval $compile; then
16283 semun) val="$define" ;;
16291 case "$d_semctl_semun" in
16293 echo "You can use union semun for semctl IPC_STAT." >&4
16296 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
16301 : see whether semctl IPC_STAT can use struct semid_ds pointer
16302 case "$d_semctl_semid_ds" in
16305 $cat > try.c <<'END'
16306 #include <sys/types.h>
16307 #include <sys/ipc.h>
16308 #include <sys/sem.h>
16309 #include <sys/stat.h>
16317 struct semid_ds arg;
16320 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16321 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16324 st = semctl(sem, 0, IPC_STAT, &arg);
16326 printf("semid_ds\n");
16328 # endif /* IPC_STAT */
16329 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16331 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
16332 # endif /* IPC_RMID */
16333 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16335 #endif /* IPC_PRIVATE && ... */
16336 printf("semget failed: errno = %d\n", errno);
16342 if eval $compile; then
16345 semid_ds) val="$define" ;;
16349 set d_semctl_semid_ds
16353 case "$d_semctl_semid_ds" in
16355 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
16357 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
16363 # We do not have the full sem*(2) library, so assume we can not
16369 set d_semctl_semid_ds
16375 : see if sendmsg exists
16376 set sendmsg d_sendmsg
16379 : see if setegid exists
16380 set setegid d_setegid
16383 : see if seteuid exists
16384 set seteuid d_seteuid
16387 : see if setgrent exists
16388 set setgrent d_setgrent
16391 : see if setgrent_r exists
16392 set setgrent_r d_setgrent_r
16394 case "$d_setgrent_r" in
16396 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
16397 case "$d_setgrent_r_proto:$usethreads" in
16398 ":define") d_setgrent_r_proto=define
16399 set d_setgrent_r_proto setgrent_r $hdrs
16403 case "$d_setgrent_r_proto" in
16405 case "$setgrent_r_proto" in
16406 ''|0) try='int setgrent_r(FILE**);'
16407 ./protochk "extern $try" $hdrs && setgrent_r_proto=I_H ;;
16409 case "$setgrent_r_proto" in
16410 ''|0) try='void setgrent_r(FILE**);'
16411 ./protochk "extern $try" $hdrs && setgrent_r_proto=V_H ;;
16413 case "$setgrent_r_proto" in
16414 ''|0) d_setgrent_r=undef
16416 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
16417 * ) case "$setgrent_r_proto" in
16418 REENTRANT_PROTO*) ;;
16419 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
16421 echo "Prototype: $try" ;;
16424 *) case "$usethreads" in
16425 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
16432 *) setgrent_r_proto=0
16436 : see if sethostent exists
16437 set sethostent d_sethent
16440 : see if sethostent_r exists
16441 set sethostent_r d_sethostent_r
16443 case "$d_sethostent_r" in
16445 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16446 case "$d_sethostent_r_proto:$usethreads" in
16447 ":define") d_sethostent_r_proto=define
16448 set d_sethostent_r_proto sethostent_r $hdrs
16452 case "$d_sethostent_r_proto" in
16454 case "$sethostent_r_proto" in
16455 ''|0) try='int sethostent_r(int, struct hostent_data*);'
16456 ./protochk "extern $try" $hdrs && sethostent_r_proto=I_ID ;;
16458 case "$sethostent_r_proto" in
16459 ''|0) try='void sethostent_r(int, struct hostent_data*);'
16460 ./protochk "extern $try" $hdrs && sethostent_r_proto=V_ID ;;
16462 case "$sethostent_r_proto" in
16463 ''|0) d_sethostent_r=undef
16464 sethostent_r_proto=0
16465 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
16466 * ) case "$sethostent_r_proto" in
16467 REENTRANT_PROTO*) ;;
16468 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
16470 echo "Prototype: $try" ;;
16473 *) case "$usethreads" in
16474 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
16476 d_sethostent_r=undef
16477 sethostent_r_proto=0
16481 *) sethostent_r_proto=0
16485 : see if setitimer exists
16486 set setitimer d_setitimer
16489 : see if setlinebuf exists
16490 set setlinebuf d_setlinebuf
16493 : see if setlocale exists
16494 set setlocale d_setlocale
16497 : see if locale.h is available
16498 set locale.h i_locale
16501 : see if setlocale_r exists
16502 set setlocale_r d_setlocale_r
16504 case "$d_setlocale_r" in
16506 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
16507 case "$d_setlocale_r_proto:$usethreads" in
16508 ":define") d_setlocale_r_proto=define
16509 set d_setlocale_r_proto setlocale_r $hdrs
16513 case "$d_setlocale_r_proto" in
16515 case "$setlocale_r_proto" in
16516 ''|0) try='int setlocale_r(int, const char*, char*, int);'
16517 ./protochk "extern $try" $hdrs && setlocale_r_proto=I_ICBI ;;
16519 case "$setlocale_r_proto" in
16520 ''|0) d_setlocale_r=undef
16521 setlocale_r_proto=0
16522 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
16523 * ) case "$setlocale_r_proto" in
16524 REENTRANT_PROTO*) ;;
16525 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
16527 echo "Prototype: $try" ;;
16530 *) case "$usethreads" in
16531 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
16533 d_setlocale_r=undef
16534 setlocale_r_proto=0
16538 *) setlocale_r_proto=0
16542 : see if setnetent exists
16543 set setnetent d_setnent
16546 : see if setnetent_r exists
16547 set setnetent_r d_setnetent_r
16549 case "$d_setnetent_r" in
16551 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16552 case "$d_setnetent_r_proto:$usethreads" in
16553 ":define") d_setnetent_r_proto=define
16554 set d_setnetent_r_proto setnetent_r $hdrs
16558 case "$d_setnetent_r_proto" in
16560 case "$setnetent_r_proto" in
16561 ''|0) try='int setnetent_r(int, struct netent_data*);'
16562 ./protochk "extern $try" $hdrs && setnetent_r_proto=I_ID ;;
16564 case "$setnetent_r_proto" in
16565 ''|0) try='void setnetent_r(int, struct netent_data*);'
16566 ./protochk "extern $try" $hdrs && setnetent_r_proto=V_ID ;;
16568 case "$setnetent_r_proto" in
16569 ''|0) d_setnetent_r=undef
16570 setnetent_r_proto=0
16571 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
16572 * ) case "$setnetent_r_proto" in
16573 REENTRANT_PROTO*) ;;
16574 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
16576 echo "Prototype: $try" ;;
16579 *) case "$usethreads" in
16580 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
16582 d_setnetent_r=undef
16583 setnetent_r_proto=0
16587 *) setnetent_r_proto=0
16591 : see if setprotoent exists
16592 set setprotoent d_setpent
16595 : see if setpgid exists
16596 set setpgid d_setpgid
16599 : see if setpgrp2 exists
16600 set setpgrp2 d_setpgrp2
16603 : see if setpriority exists
16604 set setpriority d_setprior
16607 : see if setproctitle exists
16608 set setproctitle d_setproctitle
16611 : see if setprotoent_r exists
16612 set setprotoent_r d_setprotoent_r
16614 case "$d_setprotoent_r" in
16616 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16617 case "$d_setprotoent_r_proto:$usethreads" in
16618 ":define") d_setprotoent_r_proto=define
16619 set d_setprotoent_r_proto setprotoent_r $hdrs
16623 case "$d_setprotoent_r_proto" in
16625 case "$setprotoent_r_proto" in
16626 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
16627 ./protochk "extern $try" $hdrs && setprotoent_r_proto=I_ID ;;
16629 case "$setprotoent_r_proto" in
16630 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
16631 ./protochk "extern $try" $hdrs && setprotoent_r_proto=V_ID ;;
16633 case "$setprotoent_r_proto" in
16634 ''|0) d_setprotoent_r=undef
16635 setprotoent_r_proto=0
16636 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
16637 * ) case "$setprotoent_r_proto" in
16638 REENTRANT_PROTO*) ;;
16639 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
16641 echo "Prototype: $try" ;;
16644 *) case "$usethreads" in
16645 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
16647 d_setprotoent_r=undef
16648 setprotoent_r_proto=0
16652 *) setprotoent_r_proto=0
16656 : see if setpwent exists
16657 set setpwent d_setpwent
16660 : see if setpwent_r exists
16661 set setpwent_r d_setpwent_r
16663 case "$d_setpwent_r" in
16665 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
16666 case "$d_setpwent_r_proto:$usethreads" in
16667 ":define") d_setpwent_r_proto=define
16668 set d_setpwent_r_proto setpwent_r $hdrs
16672 case "$d_setpwent_r_proto" in
16674 case "$setpwent_r_proto" in
16675 ''|0) try='int setpwent_r(FILE**);'
16676 ./protochk "extern $try" $hdrs && setpwent_r_proto=I_H ;;
16678 case "$setpwent_r_proto" in
16679 ''|0) try='void setpwent_r(FILE**);'
16680 ./protochk "extern $try" $hdrs && setpwent_r_proto=V_H ;;
16682 case "$setpwent_r_proto" in
16683 ''|0) d_setpwent_r=undef
16685 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
16686 * ) case "$setpwent_r_proto" in
16687 REENTRANT_PROTO*) ;;
16688 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
16690 echo "Prototype: $try" ;;
16693 *) case "$usethreads" in
16694 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
16701 *) setpwent_r_proto=0
16705 : see if setregid exists
16706 set setregid d_setregid
16708 set setresgid d_setresgid
16711 : see if setreuid exists
16712 set setreuid d_setreuid
16714 set setresuid d_setresuid
16717 : see if setrgid exists
16718 set setrgid d_setrgid
16721 : see if setruid exists
16722 set setruid d_setruid
16725 : see if setservent exists
16726 set setservent d_setsent
16729 : see if setservent_r exists
16730 set setservent_r d_setservent_r
16732 case "$d_setservent_r" in
16734 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16735 case "$d_setservent_r_proto:$usethreads" in
16736 ":define") d_setservent_r_proto=define
16737 set d_setservent_r_proto setservent_r $hdrs
16741 case "$d_setservent_r_proto" in
16743 case "$setservent_r_proto" in
16744 ''|0) try='int setservent_r(int, struct servent_data*);'
16745 ./protochk "extern $try" $hdrs && setservent_r_proto=I_ID ;;
16747 case "$setservent_r_proto" in
16748 ''|0) try='void setservent_r(int, struct servent_data*);'
16749 ./protochk "extern $try" $hdrs && setservent_r_proto=V_ID ;;
16751 case "$setservent_r_proto" in
16752 ''|0) d_setservent_r=undef
16753 setservent_r_proto=0
16754 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
16755 * ) case "$setservent_r_proto" in
16756 REENTRANT_PROTO*) ;;
16757 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
16759 echo "Prototype: $try" ;;
16762 *) case "$usethreads" in
16763 define) echo "setservent_r has no prototype, not using it." >&4 ;;
16765 d_setservent_r=undef
16766 setservent_r_proto=0
16770 *) setservent_r_proto=0
16774 : see if setsid exists
16775 set setsid d_setsid
16778 : see if setvbuf exists
16779 set setvbuf d_setvbuf
16782 : see if sfio.h is available
16787 : see if sfio library is available
16798 : Ok, but do we want to use it.
16802 true|$define|[yY]*) dflt='y';;
16805 echo "$package can use the sfio library, but it is experimental."
16806 case "$useperlio" in
16808 echo "For sfio also the PerlIO abstraction layer is needed."
16809 echo "Earlier you said you wouldn't want that."
16812 rp="You seem to have sfio available, do you want to try using it?"
16815 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
16816 useperlio="$define"
16819 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
16824 *) case "$usesfio" in
16825 true|$define|[yY]*)
16826 echo "Sorry, cannot find sfio on this machine." >&4
16827 echo "Ignoring your setting of usesfio=$usesfio." >&4
16836 $define) usesfio='true';;
16837 *) usesfio='false';;
16841 *) : Remove sfio from list of libraries to use
16844 echo "Removing unneeded -lsfio from library list" >&4
16845 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
16848 echo "libs = $libs" >&4
16855 : see if shmctl exists
16856 set shmctl d_shmctl
16859 : see if shmget exists
16860 set shmget d_shmget
16863 : see if shmat exists
16866 : see what shmat returns
16869 $cat >shmat.c <<'END'
16870 #include <sys/shm.h>
16873 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
16878 echo "and it returns ($shmattype)." >&4
16879 : see if a prototype for shmat is available
16880 xxx=`./findhdr sys/shm.h`
16881 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
16882 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
16893 set d_shmatprototype
16896 : see if shmdt exists
16900 : see how much of the 'shm*(2)' library is present.
16903 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
16904 *"$undef"*) h_shm=false;;
16908 case "`ipcs 2>&1`" in
16909 "SVID shared memory"*"not configured"*)
16910 echo "Your $osname does not have the shm*(2) configured." >&4
16913 set shmctl d_shmctl
16915 set shmget d_shmget
16925 : we could also check for sys/ipc.h ...
16926 if $h_shm && $test `./findhdr sys/shm.h`; then
16927 echo "You have the full shm*(2) library." >&4
16930 echo "You don't have the full shm*(2) library." >&4
16937 : see if we have sigaction
16938 if set sigaction val -f d_sigaction; eval $csym; $val; then
16939 echo 'sigaction() found.' >&4
16942 #include <sys/types.h>
16943 #include <signal.h>
16944 #$i_stdlib I_STDLIB
16946 #include <stdlib.h>
16950 struct sigaction act, oact;
16952 oact.sa_handler = 0;
16953 /* so that act and oact are used */
16954 exit(act.sa_flags == 0 && oact.sa_handler == 0);
16958 if eval $compile_ok; then
16961 echo "But you don't seem to have a useable struct sigaction." >&4
16965 echo 'sigaction NOT found.' >&4
16968 set d_sigaction; eval $setvar
16971 : see if this is a sunmath.h system
16972 set sunmath.h i_sunmath
16975 : see if signbit exists
16976 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
16979 #$i_sunmath I_SUNMATH
16983 #ifdef I_SUNMATH /* Solaris special math library */
16984 # include <sunmath.h>
16987 int main(int argc, char **argv)
16991 if ((signbit(x) == 0) && (signbit(y) != 0))
16999 if eval $compile; then
17000 if $run ./try; then
17004 $echo "Signbit seems to be available, but doesn't work as I expected."
17005 $echo "I won't use it." >&4
17016 : see if sigprocmask exists
17017 set sigprocmask d_sigprocmask
17020 : see if sigsetjmp exists
17022 case "$d_sigsetjmp" in
17025 #include <setjmp.h>
17026 #$i_stdlib I_STDLIB
17028 #include <stdlib.h>
17034 if (sigsetjmp(env,1))
17037 siglongjmp(env, 1);
17042 if eval $compile; then
17043 if $run ./try >/dev/null 2>&1; then
17044 echo "POSIX sigsetjmp found." >&4
17048 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
17054 echo "sigsetjmp not found." >&4
17058 *) val="$d_sigsetjmp"
17059 case "$d_sigsetjmp" in
17060 $define) echo "POSIX sigsetjmp found." >&4;;
17061 $undef) echo "sigsetjmp not found." >&4;;
17069 : see if snprintf exists
17070 set snprintf d_snprintf
17073 : see if vsnprintf exists
17074 set vsnprintf d_vsnprintf
17077 case "$d_snprintf-$d_vsnprintf" in
17080 Checking whether your snprintf() and vsnprintf() work okay...
17082 $cat >try.c <<'EOCP'
17083 /* v?snprintf testing logic courtesy of Russ Allbery.
17084 * According to C99:
17085 * - if the buffer is too short it still must be \0-terminated
17086 * - if the buffer is too short the potentially required length
17087 * must be returned and not -1
17088 * - if the buffer is NULL the potentially required length
17089 * must be returned and not -1 or core dump
17092 #include <stdarg.h>
17096 int test (char *format, ...)
17101 va_start (args, format);
17102 count = vsnprintf (buf, sizeof buf, format, args);
17109 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
17110 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
17114 if eval $compile; then
17117 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
17119 Your snprintf() and snprintf() don't seem to be working okay.
17121 d_snprintf="$undef"
17122 d_vsnprintf="$undef"
17126 echo "(I can't seem to compile the test program--assuming they don't)"
17127 d_snprintf="$undef"
17128 d_vsnprintf="$undef"
17134 : see if sockatmark exists
17135 set sockatmark d_sockatmark
17138 : see if prototype for sockatmark is available
17140 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
17143 : see if socks5_init exists
17144 set socks5_init d_socks5_init
17147 : see if sprintf returns the length of the string in the buffer as per ANSI
17148 $echo "Checking whether sprintf returns the length of the string..." >&4
17151 #$i_stdlib I_STDLIB
17153 #include <stdlib.h>
17155 #$i_string I_STRING
17157 # include <string.h>
17159 # include <strings.h>
17168 int check (size_t expect, int test) {
17169 size_t got = strlen(buffer);
17173 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
17178 int main(int argc, char **argv) {
17181 check(sprintf(buffer, ""), ++test);
17182 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
17183 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
17190 d_sprintf_returns_strlen="$undef"
17191 if eval $compile; then
17195 sprintf returns the length of the string (as ANSI says it should)
17197 d_sprintf_returns_strlen="$define"
17200 sprintf does not return the length of the string (how old is this system?)
17202 d_sprintf_returns_strlen="$undef"
17208 : see if srand48_r exists
17209 set srand48_r d_srand48_r
17211 case "$d_srand48_r" in
17213 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17214 case "$d_srand48_r_proto:$usethreads" in
17215 ":define") d_srand48_r_proto=define
17216 set d_srand48_r_proto srand48_r $hdrs
17220 case "$d_srand48_r_proto" in
17222 case "$srand48_r_proto" in
17223 ''|0) try='int srand48_r(long, struct drand48_data*);'
17224 ./protochk "extern $try" $hdrs && srand48_r_proto=I_LS ;;
17226 case "$srand48_r_proto" in
17227 ''|0) d_srand48_r=undef
17229 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
17230 * ) case "$srand48_r_proto" in
17231 REENTRANT_PROTO*) ;;
17232 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
17234 echo "Prototype: $try" ;;
17237 *) case "$usethreads" in
17238 define) echo "srand48_r has no prototype, not using it." >&4 ;;
17245 *) srand48_r_proto=0
17249 : see if srandom_r exists
17250 set srandom_r d_srandom_r
17252 case "$d_srandom_r" in
17254 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17255 case "$d_srandom_r_proto:$usethreads" in
17256 ":define") d_srandom_r_proto=define
17257 set d_srandom_r_proto srandom_r $hdrs
17261 case "$d_srandom_r_proto" in
17263 case "$srandom_r_proto" in
17264 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
17265 ./protochk "extern $try" $hdrs && srandom_r_proto=I_TS ;;
17267 case "$srandom_r_proto" in
17268 ''|0) d_srandom_r=undef
17270 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
17271 * ) case "$srandom_r_proto" in
17272 REENTRANT_PROTO*) ;;
17273 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
17275 echo "Prototype: $try" ;;
17278 *) case "$usethreads" in
17279 define) echo "srandom_r has no prototype, not using it." >&4 ;;
17286 *) srandom_r_proto=0
17290 : see if prototype for setresgid is available
17292 set d_sresgproto setresgid $i_unistd unistd.h
17295 : see if prototype for setresuid is available
17297 set d_sresuproto setresuid $i_unistd unistd.h
17300 : see if sys/stat.h is available
17301 set sys/stat.h i_sysstat
17305 : see if stat knows about block sizes
17307 echo "Checking to see if your struct stat has st_blocks field..." >&4
17308 set d_statblks stat st_blocks $i_sysstat sys/stat.h
17312 : see if this is a sys/vfs.h system
17313 set sys/vfs.h i_sysvfs
17317 : see if this is a sys/statfs.h system
17318 set sys/statfs.h i_sysstatfs
17323 echo "Checking to see if your system supports struct statfs..." >&4
17324 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
17326 case "$d_statfs_s" in
17327 "$define") echo "Yes, it does." ;;
17328 *) echo "No, it doesn't." ;;
17333 : see if struct statfs knows about f_flags
17334 case "$d_statfs_s" in
17337 echo "Checking to see if your struct statfs has f_flags field..." >&4
17338 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
17342 set d_statfs_f_flags
17346 case "$d_statfs_f_flags" in
17347 "$define") echo "Yes, it does." ;;
17348 *) echo "No, it doesn't." ;;
17352 Checking how to access stdio streams by file descriptor number...
17354 case "$stdio_stream_array" in
17355 '') $cat >try.c <<EOCP
17358 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
17362 for s in _iob __iob __sF
17364 set try -DSTDIO_STREAM_ARRAY=$s
17365 if eval $compile; then
17366 case "`$run ./try`" in
17367 yes) stdio_stream_array=$s; break ;;
17373 case "$stdio_stream_array" in
17375 I can't figure out how to access stdio streams by file descriptor number.
17377 d_stdio_stream_array="$undef"
17380 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
17382 d_stdio_stream_array="$define"
17386 : see if strcoll exists
17387 set strcoll d_strcoll
17390 : check for structure copying
17392 echo "Checking to see if your C compiler can copy structs..." >&4
17393 $cat >try.c <<'EOCP'
17403 if $cc -c try.c >/dev/null 2>&1 ; then
17405 echo "Yup, it can."
17408 echo "Nope, it can't."
17414 : see if strerror and/or sys_errlist[] exist
17416 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
17417 if set strerror val -f d_strerror; eval $csym; $val; then
17418 echo 'strerror() found.' >&4
17419 d_strerror="$define"
17420 d_strerrm='strerror(e)'
17421 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17422 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
17423 d_syserrlst="$define"
17425 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
17426 d_syserrlst="$undef"
17428 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
17429 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
17430 echo 'strerror() found in string header.' >&4
17431 d_strerror="$define"
17432 d_strerrm='strerror(e)'
17433 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17434 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
17435 d_syserrlst="$define"
17437 echo "(You don't appear to have any sys_errlist[], how can this be?)"
17438 d_syserrlst="$undef"
17440 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17441 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
17442 d_strerror="$undef"
17443 d_syserrlst="$define"
17444 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
17446 echo 'strerror() and sys_errlist[] NOT found.' >&4
17447 d_strerror="$undef"
17448 d_syserrlst="$undef"
17449 d_strerrm='"unknown"'
17453 : see if strerror_r exists
17454 set strerror_r d_strerror_r
17456 case "$d_strerror_r" in
17458 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
17459 case "$d_strerror_r_proto:$usethreads" in
17460 ":define") d_strerror_r_proto=define
17461 set d_strerror_r_proto strerror_r $hdrs
17465 case "$d_strerror_r_proto" in
17467 case "$strerror_r_proto" in
17468 ''|0) try='int strerror_r(int, char*, size_t);'
17469 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBW ;;
17471 case "$strerror_r_proto" in
17472 ''|0) try='int strerror_r(int, char*, int);'
17473 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBI ;;
17475 case "$strerror_r_proto" in
17476 ''|0) try='char* strerror_r(int, char*, size_t);'
17477 ./protochk "extern $try" $hdrs && strerror_r_proto=B_IBW ;;
17479 case "$strerror_r_proto" in
17480 ''|0) d_strerror_r=undef
17482 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
17483 * ) case "$strerror_r_proto" in
17484 REENTRANT_PROTO*) ;;
17485 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
17487 echo "Prototype: $try" ;;
17490 *) case "$usethreads" in
17491 define) echo "strerror_r has no prototype, not using it." >&4 ;;
17498 *) strerror_r_proto=0
17502 : see if strftime exists
17503 set strftime d_strftime
17506 : see if strlcat exists
17507 set strlcat d_strlcat
17510 : see if strlcpy exists
17511 set strlcpy d_strlcpy
17514 : see if strtod exists
17515 set strtod d_strtod
17518 : see if strtol exists
17519 set strtol d_strtol
17522 : see if strtold exists
17523 set strtold d_strtold
17526 : see if strtoll exists
17527 set strtoll d_strtoll
17530 case "$d_longlong-$d_strtoll" in
17533 Checking whether your strtoll() works okay...
17535 $cat >try.c <<'EOCP'
17538 #define strtoll __strtoll
17541 #define strtoll _strtoll
17544 extern long long int strtoll(char *s, char **, int);
17545 static int bad = 0;
17546 int check(char *s, long long ell, int een) {
17549 gll = strtoll(s, 0, 10);
17550 if (!((gll == ell) && (errno == een)))
17554 check(" 1", 1LL, 0);
17555 check(" 0", 0LL, 0);
17556 check("-1", -1LL, 0);
17557 check("-9223372036854775808", -9223372036854775808LL, 0);
17558 check("-9223372036854775808", -9223372036854775808LL, 0);
17559 check(" 9223372036854775807", 9223372036854775807LL, 0);
17560 check("-9223372036854775808", -9223372036854775808LL, 0);
17561 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
17562 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
17568 if eval $compile; then
17571 ok) echo "Your strtoll() seems to be working okay." ;;
17573 Your strtoll() doesn't seem to be working okay.
17579 echo "(I can't seem to compile the test program--assuming it doesn't)"
17585 : see if strtoq exists
17586 set strtoq d_strtoq
17589 : see if strtoul exists
17590 set strtoul d_strtoul
17593 case "$d_strtoul" in
17596 Checking whether your strtoul() works okay...
17598 $cat >try.c <<'EOCP'
17601 extern unsigned long int strtoul(char *s, char **, int);
17602 static int bad = 0;
17603 void check(char *s, unsigned long eul, int een) {
17606 gul = strtoul(s, 0, 10);
17607 if (!((gul == eul) && (errno == een)))
17611 check(" 1", 1L, 0);
17612 check(" 0", 0L, 0);
17614 case "$longsize" in
17616 $cat >>try.c <<'EOCP'
17617 check("18446744073709551615", 18446744073709551615UL, 0);
17618 check("18446744073709551616", 18446744073709551615UL, ERANGE);
17619 #if 0 /* strtoul() for /^-/ strings is undefined. */
17620 check("-1", 18446744073709551615UL, 0);
17621 check("-18446744073709551614", 2, 0);
17622 check("-18446744073709551615", 1, 0);
17623 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
17624 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
17629 $cat >>try.c <<'EOCP'
17630 check("4294967295", 4294967295UL, 0);
17631 check("4294967296", 4294967295UL, ERANGE);
17632 #if 0 /* strtoul() for /^-/ strings is undefined. */
17633 check("-1", 4294967295UL, 0);
17634 check("-4294967294", 2, 0);
17635 check("-4294967295", 1, 0);
17636 check("-4294967296", 4294967295UL, ERANGE);
17637 check("-4294967297", 4294967295UL, ERANGE);
17642 : Should we write these tests to be more portable by sprintf-ing
17643 : ~0 and then manipulating that char string as input for strtol?
17646 $cat >>try.c <<'EOCP'
17653 if eval $compile; then
17654 case "`$run ./try`" in
17655 ok) echo "Your strtoul() seems to be working okay." ;;
17657 Your strtoul() doesn't seem to be working okay.
17663 echo "(I can't seem to compile the test program--assuming it doesn't)"
17669 : see if strtoull exists
17670 set strtoull d_strtoull
17673 case "$d_longlong-$d_strtoull" in
17676 Checking whether your strtoull() works okay...
17678 $cat >try.c <<'EOCP'
17681 #define strtoull __strtoull
17684 extern unsigned long long int strtoull(char *s, char **, int);
17685 static int bad = 0;
17686 int check(char *s, long long eull, int een) {
17689 gull = strtoull(s, 0, 10);
17690 if (!((gull == eull) && (errno == een)))
17694 check(" 1", 1LL, 0);
17695 check(" 0", 0LL, 0);
17696 check("18446744073709551615", 18446744073709551615ULL, 0);
17697 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17698 #if 0 /* strtoull() for /^-/ strings is undefined. */
17699 check("-1", 18446744073709551615ULL, 0);
17700 check("-18446744073709551614", 2LL, 0);
17701 check("-18446744073709551615", 1LL, 0);
17702 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17703 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17710 if eval $compile; then
17711 case "`$run ./try`" in
17712 ok) echo "Your strtoull() seems to be working okay." ;;
17714 Your strtoull() doesn't seem to be working okay.
17716 d_strtoull="$undef"
17720 echo "(I can't seem to compile the test program--assuming it doesn't)"
17721 d_strtoull="$undef"
17726 : see if strtouq exists
17727 set strtouq d_strtouq
17730 case "$d_strtouq" in
17733 Checking whether your strtouq() works okay...
17735 $cat >try.c <<'EOCP'
17738 extern unsigned long long int strtouq(char *s, char **, int);
17739 static int bad = 0;
17740 void check(char *s, unsigned long long eull, int een) {
17741 unsigned long long gull;
17743 gull = strtouq(s, 0, 10);
17744 if (!((gull == eull) && (errno == een)))
17748 check(" 1", 1LL, 0);
17749 check(" 0", 0LL, 0);
17750 check("18446744073709551615", 18446744073709551615ULL, 0);
17751 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17752 #if 0 /* strtouq() for /^-/ strings is undefined. */
17753 check("-1", 18446744073709551615ULL, 0);
17754 check("-18446744073709551614", 2LL, 0);
17755 check("-18446744073709551615", 1LL, 0);
17756 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17757 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17765 if eval $compile; then
17766 case "`$run ./try`" in
17767 ok) echo "Your strtouq() seems to be working okay." ;;
17769 Your strtouq() doesn't seem to be working okay.
17775 echo "(I can't seem to compile the test program--assuming it doesn't)"
17781 : see if strxfrm exists
17782 set strxfrm d_strxfrm
17785 : see if symlink exists
17786 set symlink d_symlink
17789 : see if syscall exists
17790 set syscall d_syscall
17793 : see if prototype for syscall is available
17795 set d_syscallproto syscall $i_unistd unistd.h
17798 : see if sysconf exists
17799 set sysconf d_sysconf
17802 : see if system exists
17803 set system d_system
17806 : see if tcgetpgrp exists
17807 set tcgetpgrp d_tcgetpgrp
17810 : see if tcsetpgrp exists
17811 set tcsetpgrp d_tcsetpgrp
17814 : see if prototype for telldir is available
17816 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
17819 : see if time exists
17821 if test "X$d_time" = X -o X"$timetype" = X; then
17822 if set time val -f d_time; eval $csym; $val; then
17823 echo 'time() found.' >&4
17825 rp="What is the type returned by time() on this system?"
17826 set time_t timetype long stdio.h sys/types.h
17829 echo 'time() not found, hope that will do.' >&4
17837 : see if this is a sys/times.h system
17838 set sys/times.h i_systimes
17841 : see if times exists
17843 if set times val -f d_times; eval $csym; $val; then
17844 echo 'times() found.' >&4
17847 case "$i_systimes" in
17848 "$define") inc='sys/times.h';;
17850 rp="What is the type returned by times() on this system?"
17851 set clock_t clocktype long stdio.h sys/types.h $inc
17854 echo 'times() NOT found, hope that will do.' >&4
17859 : see if tmpnam_r exists
17860 set tmpnam_r d_tmpnam_r
17862 case "$d_tmpnam_r" in
17864 hdrs="$i_systypes sys/types.h define stdio.h "
17865 case "$d_tmpnam_r_proto:$usethreads" in
17866 ":define") d_tmpnam_r_proto=define
17867 set d_tmpnam_r_proto tmpnam_r $hdrs
17871 case "$d_tmpnam_r_proto" in
17873 case "$tmpnam_r_proto" in
17874 ''|0) try='char* tmpnam_r(char*);'
17875 ./protochk "extern $try" $hdrs && tmpnam_r_proto=B_B ;;
17877 case "$tmpnam_r_proto" in
17878 ''|0) d_tmpnam_r=undef
17880 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
17881 * ) case "$tmpnam_r_proto" in
17882 REENTRANT_PROTO*) ;;
17883 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
17885 echo "Prototype: $try" ;;
17888 *) case "$usethreads" in
17889 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
17896 *) tmpnam_r_proto=0
17900 : see if truncate exists
17901 set truncate d_truncate
17904 : see if ttyname_r exists
17905 set ttyname_r d_ttyname_r
17907 case "$d_ttyname_r" in
17909 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
17910 case "$d_ttyname_r_proto:$usethreads" in
17911 ":define") d_ttyname_r_proto=define
17912 set d_ttyname_r_proto ttyname_r $hdrs
17916 case "$d_ttyname_r_proto" in
17918 case "$ttyname_r_proto" in
17919 ''|0) try='int ttyname_r(int, char*, size_t);'
17920 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBW ;;
17922 case "$ttyname_r_proto" in
17923 ''|0) try='int ttyname_r(int, char*, int);'
17924 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBI ;;
17926 case "$ttyname_r_proto" in
17927 ''|0) try='char* ttyname_r(int, char*, int);'
17928 ./protochk "extern $try" $hdrs && ttyname_r_proto=B_IBI ;;
17930 case "$ttyname_r_proto" in
17931 ''|0) d_ttyname_r=undef
17933 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
17934 * ) case "$ttyname_r_proto" in
17935 REENTRANT_PROTO*) ;;
17936 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
17938 echo "Prototype: $try" ;;
17941 *) case "$usethreads" in
17942 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
17949 *) ttyname_r_proto=0
17953 : see if tzname[] exists
17955 if set tzname val -a d_tzname; eval $csym; $val; then
17957 echo 'tzname[] found.' >&4
17960 echo 'tzname[] NOT found.' >&4
17966 next|rhapsody|darwin) multiarch="$define" ;;
17968 case "$multiarch" in
17969 ''|[nN]*) multiarch="$undef" ;;
17972 : check for ordering of bytes in a UV
17974 case "$usecrosscompile$multiarch" in
17977 You seem to be either cross-compiling or doing a multiarchitecture build,
17978 skipping the byteorder check.
17984 case "$byteorder" in
17987 In the following, larger digits indicate more significance. A big-endian
17988 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
17989 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
17990 machines may have weird orders like 3412. A Cray will report 87654321,
17991 an Alpha will report 12345678. If the test program works the default is
17993 I'm now running the test program...
17997 #$i_stdlib I_STDLIB
17999 #include <stdlib.h>
18001 #include <sys/types.h>
18002 typedef $uvtype UV;
18012 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
18014 u.l = (UV)0x04030201;
18015 for (i = 0; i < $uvsize; i++)
18016 printf("%c", u.c[i]+'0');
18023 if eval $compile && $run ./try > /dev/null; then
18026 [1-4][1-4][1-4][1-4]|12345678|87654321)
18027 echo "(The test program ran ok.)"
18028 echo "byteorder=$dflt"
18031 ????|????????) echo "(The test program ran ok.)" ;;
18032 *) echo "(The test program didn't run right for some reason.)" ;;
18037 (I can't seem to compile the test program. Guessing big-endian...)
18040 case "$xxx_prompt" in
18042 rp="What is the order of bytes in $uvtype?"
18057 Checking to see whether you can access character data unalignedly...
18059 case "$d_u32align" in
18060 '') $cat >try.c <<EOCP
18062 #$i_stdlib I_STDLIB
18064 #include <stdlib.h>
18066 #define U32 $u32type
18067 #define BYTEORDER 0x$byteorder
18069 #include <signal.h>
18071 $signal_t bletch(int s) { exit(4); }
18074 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
18079 if (sizeof(U32) != 4) {
18080 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
18087 signal(SIGBUS, bletch);
18099 for (i = 0; i < 4; i++) {
18100 up = (U32*)(buf + i);
18101 if (! ((*up == 1 << (8*i)) || /* big-endian */
18102 (*up == 1 << (8*(3-i))) /* little-endian */
18106 printf("read failed (%x)\n", *up);
18112 for (i = 0; i < 4; i++) {
18113 up = (U32*)(buf + i);
18115 if (*up != 0xBeef) {
18116 printf("write failed (%x)\n", *up);
18130 if eval $compile_ok; then
18131 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
18132 $run ./try 2>&1 >/dev/null
18135 You can access character data pretty unalignedly.
18137 d_u32align="$undef"
18140 It seems that you must access character data in an aligned manner.
18142 d_u32align="$define"
18146 rp='Can you access character data at unaligned addresses?'
18150 [yY]*) d_u32align="$undef" ;;
18151 *) d_u32align="$define" ;;
18158 : see if ualarm exists
18159 set ualarm d_ualarm
18162 : see if umask exists
18166 : see if unordered exists
18167 set unordered d_unordered
18170 : see if unsetenv exists
18171 set unsetenv d_unsetenv
18174 : see if usleep exists
18175 set usleep d_usleep
18178 : see if prototype for usleep is available
18180 set d_usleepproto usleep $i_unistd unistd.h
18183 : see if ustat exists
18187 : see if closedir exists
18188 set closedir d_closedir
18191 case "$d_closedir" in
18194 echo "Checking whether closedir() returns a status..." >&4
18196 #$i_dirent I_DIRENT /**/
18197 #$i_sysdir I_SYS_DIR /**/
18198 #$i_sysndir I_SYS_NDIR /**/
18199 #$i_systypes I_SYS_TYPES /**/
18201 #if defined(I_SYS_TYPES)
18202 #include <sys/types.h>
18204 #if defined(I_DIRENT)
18205 #include <dirent.h>
18206 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
18207 #include <sys/dir.h>
18211 #include <sys/ndir.h>
18215 #include <ndir.h> /* may be wrong in the future */
18217 #include <sys/dir.h>
18222 int main() { return closedir(opendir(".")); }
18225 if eval $compile_ok; then
18226 if $run ./try > /dev/null 2>&1 ; then
18227 echo "Yes, it does."
18230 echo "No, it doesn't."
18234 echo "(I can't seem to compile the test program--assuming it doesn't)"
18242 set d_void_closedir
18246 : see if there is a wait4
18250 : see if waitpid exists
18251 set waitpid d_waitpid
18254 : see if wcstombs exists
18255 set wcstombs d_wcstombs
18258 : see if wctomb exists
18259 set wctomb d_wctomb
18262 : see if writev exists
18263 set writev d_writev
18266 : preserve RCS keywords in files with variable substitution, grrr
18271 Revision='$Revision'
18273 : check for alignment requirements
18275 case "$usecrosscompile$multiarch" in
18278 You seem to be either cross-compiling or doing a multiarchitecture build,
18279 skipping the memory alignment check.
18282 case "$alignbytes" in
18283 '') alignbytes=8 ;;
18287 case "$alignbytes" in
18288 '') echo "Checking alignment constraints..." >&4
18289 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
18290 $cat >try.c <<'EOCP'
18291 typedef long double NV;
18294 $cat >try.c <<'EOCP'
18298 $cat >>try.c <<'EOCP'
18306 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
18311 if eval $compile_ok; then
18315 echo "(I can't seem to compile the test program...)"
18318 *) dflt="$alignbytes"
18321 rp="Doubles must be aligned on a how-many-byte boundary?"
18329 : set the base revision
18332 : how do we concatenate cpp tokens here?
18334 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
18335 $cat >cpp_stuff.c <<'EOCP'
18336 #define RCAT(a,b)a/**/b
18337 #define ACAT(a,b)a ## b
18341 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
18342 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
18343 echo "Oh! Smells like ANSI's been here." >&4
18344 echo "We can catify or stringify, separately or together!"
18346 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
18347 echo "Ah, yes! The good old days!" >&4
18348 echo "However, in the good old days we don't know how to stringify and"
18349 echo "catify at the same time."
18353 Hmm, I don't seem to be able to concatenate tokens with your cpp.
18354 You're going to have to edit the values of CAT[2-5] in config.h...
18356 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
18360 : see if this is a db.h system
18366 : Check db version.
18368 echo "Checking Berkeley DB version ..." >&4
18374 #include <sys/types.h>
18376 #$i_stdlib I_STDLIB
18378 #include <stdlib.h>
18381 int main(int argc, char *argv[])
18383 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
18384 int Major, Minor, Patch ;
18385 unsigned long Version ;
18386 (void)db_version(&Major, &Minor, &Patch) ;
18388 printf("%d %d %d %d %d %d\n",
18389 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
18390 Major, Minor, Patch);
18393 printf("You have Berkeley DB Version 2 or greater.\n");
18395 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
18396 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
18397 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
18398 Major, Minor, Patch) ;
18400 /* check that db.h & libdb are compatible */
18401 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
18402 printf("db.h and libdb are incompatible.\n") ;
18406 printf("db.h and libdb are compatible.\n") ;
18408 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
18409 + DB_VERSION_PATCH ;
18411 /* needs to be >= 2.3.4 */
18412 if (Version < 2003004) {
18413 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
18414 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
18420 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
18425 printf("You have Berkeley DB Version 1.\n");
18426 exit(0); /* DB version < 2: the coast is clear. */
18428 exit(1); /* <db.h> not Berkeley DB? */
18434 if eval $compile_ok && $run ./try; then
18435 echo 'Looks OK.' >&4
18437 db_version_major=$1
18438 db_version_minor=$2
18439 db_version_patch=$3
18441 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
18445 : Remove db from list of libraries to use
18446 echo "Removing unusable -ldb from library list" >&4
18447 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
18450 echo "libs = $libs" >&4
18460 : Check the return type needed for hash
18462 echo "Checking return type needed for hash for Berkeley DB ..." >&4
18468 #include <sys/types.h>
18471 #ifndef DB_VERSION_MAJOR
18472 u_int32_t hash_cb (ptr, size)
18480 info.hash = hash_cb;
18484 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18485 if $contains warning try.out >>/dev/null 2>&1 ; then
18488 db_hashtype='u_int32_t'
18491 : XXX Maybe we should just give up here.
18492 db_hashtype=u_int32_t
18494 echo "Help: I can't seem to compile the db test program." >&4
18495 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
18498 echo "Your version of Berkeley DB uses $db_hashtype for hash."
18500 *) db_hashtype=u_int32_t
18505 : Check the return type needed for prefix
18507 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
18513 #include <sys/types.h>
18516 #ifndef DB_VERSION_MAJOR
18517 size_t prefix_cb (key1, key2)
18525 info.prefix = prefix_cb;
18529 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18530 if $contains warning try.out >>/dev/null 2>&1 ; then
18531 db_prefixtype='int'
18533 db_prefixtype='size_t'
18536 db_prefixtype='size_t'
18537 : XXX Maybe we should just give up here.
18539 echo "Help: I can't seem to compile the db test program." >&4
18540 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
18543 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
18545 *) db_prefixtype='size_t'
18549 : How can we generate normalized random numbers ?
18551 echo "Looking for a random number function..." >&4
18552 case "$randfunc" in
18554 if set drand48 val -f; eval $csym; $val; then
18556 echo "Good, found drand48()." >&4
18557 elif set random val -f; eval $csym; $val; then
18559 echo "OK, found random()." >&4
18562 echo "Yick, looks like I have to use rand()." >&4
18573 *-Dmy_rand=*|*-Dmy_srand=*)
18574 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
18575 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
18576 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
18577 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
18581 while $test "$cont"; do
18582 rp="Use which function to generate random numbers?"
18584 if $test "$ans" = "$dflt"; then
18590 if set $ans val -f; eval $csym; $val; then
18594 rp="I cannot find function $ans. Use that name anyway?"
18603 case "$randfunc" in
18605 drand01="drand48()"
18611 case "$randbits" in
18613 echo "Checking to see how many bits your $randfunc() function produces..." >&4
18615 #$i_unistd I_UNISTD
18616 #$i_stdlib I_STDLIB
18619 # include <unistd.h>
18622 # include <stdlib.h>
18627 register unsigned long tmp;
18628 register unsigned long max = 0L;
18630 for (i = 1000; i; i--) {
18631 tmp = (unsigned long) $randfunc();
18632 if (tmp > max) max = tmp;
18634 for (i = 0; max; i++)
18640 if eval $compile_ok; then
18644 echo "(I can't seem to compile the test program...)"
18651 rp="How many bits does your $randfunc() function produce?"
18655 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18656 seedfunc="s$randfunc"
18657 randseedtype=unsigned
18661 rp="How many bits does your $randfunc() function produce?"
18664 seedfunc="s$randfunc"
18665 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18666 if set $seedfunc val -f; eval $csym; $val; then
18667 echo "(Using $seedfunc() to seed random generator)"
18669 echo "(Warning: no $seedfunc() to seed random generator)"
18672 randseedtype=unsigned
18680 echo "Determining whether or not we are on an EBCDIC system..." >&4
18681 $cat >try.c <<'EOM'
18684 if ('M'==0xd4) return 0;
18691 if eval $compile_ok; then
18692 if $run ./try; then
18693 echo "You seem to speak EBCDIC." >&4
18696 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
18699 echo "I'm unable to compile the test program." >&4
18700 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
18708 Checking how to flush all pending stdio output...
18710 # I only know how to find the first 32 possibly open files on SunOS.
18711 # See also hints/sunos_4_1.sh and util.c --AD
18713 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
18715 $cat >>try.c <<EOCP
18717 #$i_stdlib I_STDLIB
18719 #include <stdlib.h>
18721 #$i_unistd I_UNISTD
18723 # include <unistd.h>
18725 #$d_sysconf HAS_SYSCONF
18726 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
18727 #ifdef HAS_STDIO_STREAM_ARRAY
18728 # define STDIO_STREAM_ARRAY $stdio_stream_array
18733 p = fopen("try.out", "w");
18737 # ifdef TRY_FPRINTF
18741 #ifdef TRY_FFLUSH_NULL
18744 #ifdef TRY_FFLUSH_ALL
18746 long open_max = -1;
18747 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
18748 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
18750 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
18751 open_max = sysconf(_SC_OPEN_MAX);
18754 open_max = FOPEN_MAX;
18757 open_max = OPEN_MAX;
18766 # ifdef HAS_STDIO_STREAM_ARRAY
18767 if (open_max > 0) {
18769 for (i = 0; i < open_max; i++)
18770 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
18771 STDIO_STREAM_ARRAY[i]._file < open_max &&
18772 STDIO_STREAM_ARRAY[i]._flag)
18773 fflush(&STDIO_STREAM_ARRAY[i]);
18781 : first we have to find out how _not_ to flush
18783 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
18785 set try -DTRY_FPUTC
18786 if eval $compile; then
18787 $run ./try 2>/dev/null
18790 if $test ! -s try.out -a "X$code" = X42; then
18796 set try -DTRY_FPRINTF
18797 if eval $compile; then
18798 $run ./try 2>/dev/null
18801 if $test ! -s try.out -a "X$code" = X42; then
18802 output=-DTRY_FPRINTF
18808 : check for fflush NULL behaviour
18809 case "$fflushNULL" in
18810 '') set try -DTRY_FFLUSH_NULL $output
18811 if eval $compile; then
18812 $run ./try 2>/dev/null
18815 if $test -s try.out -a "X$code" = X42; then
18816 fflushNULL="`$cat try.out`"
18818 if $test "X$code" != X42; then
18820 (If this test failed, don't worry, we'll try another method shortly.)
18826 case "$fflushNULL" in
18828 Your fflush(NULL) works okay for output streams.
18829 Let's see if it clobbers input pipes...
18831 # As of mid-March 2000 all versions of Solaris appear to have a stdio
18832 # bug that improperly flushes the input end of pipes. So we avoid the
18833 # autoflush on fork/system/exec support for now. :-(
18834 $cat >tryp.c <<EOCP
18837 main(int argc, char **argv)
18843 while ((i = getc(stdin)) != -1
18844 && (*bp++ = i) != '\n'
18845 && bp < &buf[1024])
18848 fprintf(stdout, "%s", buf);
18856 fflushNULL="$define"
18858 if eval $compile; then
18860 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
18861 if cmp tryp.c tryp.out >/dev/null 2>&1; then
18863 fflush(NULL) seems to behave okay with input streams.
18865 fflushNULL="$define"
18868 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
18870 fflushNULL="$undef"
18873 $rm -f core tryp.c tryp.core core.tryp.*
18876 Your fflush(NULL) isn't working (contrary to ANSI C).
18878 fflushNULL="$undef"
18881 Cannot figure out whether your fflush(NULL) works or not.
18882 I'm assuming it doesn't (contrary to ANSI C).
18884 fflushNULL="$undef"
18888 $define|true|[yY]*)
18889 fflushNULL="$define"
18892 fflushNULL="$undef"
18895 : check explicit looping only if NULL did not work, and if the pipe
18896 : bug does not show up on an explicit flush too
18897 case "$fflushNULL" in
18899 $cat >tryp.c <<EOCP
18902 main(int argc, char **argv)
18908 while ((i = getc(stdin)) != -1
18909 && (*bp++ = i) != '\n'
18910 && bp < &buf[1024])
18913 fprintf(stdout, "%s", buf);
18922 if eval $compile; then
18924 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
18925 if cmp tryp.c tryp.out >/dev/null 2>&1; then
18927 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
18929 : now check for fflushall behaviour
18930 case "$fflushall" in
18931 '') set try -DTRY_FFLUSH_ALL $output
18932 if eval $compile; then
18934 (Now testing the other method--but note that this also may fail.)
18936 $run ./try 2>/dev/null
18939 if $test -s try.out -a "X$code" = X42; then
18940 fflushall="`$cat try.out`"
18944 case "$fflushall" in
18946 Whew. Flushing explicitly all the stdio streams works.
18948 fflushall="$define"
18951 Sigh. Flushing explicitly all the stdio streams doesn't work.
18956 Cannot figure out whether flushing stdio streams explicitly works or not.
18957 I'm assuming it doesn't.
18963 "$define"|true|[yY]*)
18964 fflushall="$define"
18972 All is futile. Even fflush(stdin) clobbers input pipes!
18979 $rm -f core tryp.c tryp.core core.tryp.*
18981 *) fflushall="$undef"
18985 case "$fflushNULL$fflushall" in
18988 OK, I give up. I cannot figure out how to flush pending stdio output.
18989 We won't be flushing handles at all before fork/exec/popen.
18995 : Store the full pathname to the ar program for use in the C program
18996 : Respect a hint or command line value for full_ar.
19001 : Store the full pathname to the sed program for use in the C program
19004 : see what type gids are declared as in the kernel
19006 echo "Looking for the type for group ids returned by getgid()."
19007 set gid_t gidtype xxx stdio.h sys/types.h
19011 xxx=`./findhdr sys/user.h`
19012 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
19014 unsigned) dflt="$1 $2" ;;
19018 *) dflt="$gidtype";;
19021 gid_t) echo "gid_t found." ;;
19022 *) rp="What is the type for group ids returned by getgid()?"
19030 *_t) zzz="$gidtype" ;;
19033 echo "Checking the size of $zzz..." >&4
19035 #include <sys/types.h>
19037 #$i_stdlib I_STDLIB
19039 #include <stdlib.h>
19042 printf("%d\n", (int)sizeof($gidtype));
19047 if eval $compile_ok; then
19051 echo "(I can't execute the test program--guessing $gidsize.)" >&4
19054 echo "Your $zzz is $gidsize bytes long."
19059 echo "(I can't compile the test program--guessing $gidsize.)" >&4
19065 *_t) zzz="$gidtype" ;;
19068 echo "Checking the sign of $zzz..." >&4
19070 #include <sys/types.h>
19081 if eval $compile; then
19085 echo "(I can't execute the test program--guessing unsigned.)" >&4
19089 1) echo "Your $zzz is unsigned." ;;
19090 -1) echo "Your $zzz is signed." ;;
19096 echo "(I can't compile the test program--guessing unsigned.)" >&4
19102 if $test X"$quadtype" != X; then
19104 echo "Checking how to print 64-bit integers..." >&4
19106 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
19107 $cat >try.c <<'EOCP'
19108 #include <sys/types.h>
19111 int q = 12345678901;
19112 printf("%ld\n", q);
19116 if eval $compile; then
19120 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
19121 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
19122 echo "We will use %d."
19128 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
19129 $cat >try.c <<'EOCP'
19130 #include <sys/types.h>
19133 long q = 12345678901;
19134 printf("%ld\n", q);
19138 if eval $compile; then
19142 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
19143 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
19144 echo "We will use %ld."
19150 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
19151 $cat >try.c <<'EOCP'
19152 #include <sys/types.h>
19153 #include <inttypes.h>
19156 int64_t q = 12345678901;
19157 printf("%" PRId64 "\n", q);
19161 if eval $compile; then
19165 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
19166 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
19167 echo "We will use the C9X style."
19173 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19175 #include <sys/types.h>
19178 $quadtype q = 12345678901;
19179 printf("%Ld\n", q);
19183 if eval $compile; then
19187 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
19188 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
19189 echo "We will use %Ld."
19195 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
19196 $cat >try.c <<'EOCP'
19197 #include <sys/types.h>
19200 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
19201 printf("%lld\n", q);
19205 if eval $compile; then
19209 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
19210 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
19211 echo "We will use the %lld style."
19217 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19219 #include <sys/types.h>
19222 $quadtype q = 12345678901;
19223 printf("%qd\n", q);
19227 if eval $compile; then
19231 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
19232 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
19233 echo "We will use %qd."
19239 if $test X"$sPRId64" = X; then
19240 echo "Cannot figure out how to print 64-bit integers." >&4
19247 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
19248 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
19250 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
19251 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
19257 $echo "Checking the format strings to be used for Perl's internal types..." >&4
19259 if $test X"$ivsize" = X8; then
19260 ivdformat="$sPRId64"
19261 uvuformat="$sPRIu64"
19262 uvoformat="$sPRIo64"
19263 uvxformat="$sPRIx64"
19264 uvXUformat="$sPRIXU64"
19266 if $test X"$ivsize" = X"$longsize"; then
19273 if $test X"$ivsize" = X"$intsize"; then
19281 if $test X"$ivsize" = X"$shortsize"; then
19292 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
19293 nveformat="$sPRIeldbl"
19294 nvfformat="$sPRIfldbl"
19295 nvgformat="$sPRIgldbl"
19296 nvEUformat="$sPRIEUldbl"
19297 nvFUformat="$sPRIFUldbl"
19298 nvGUformat="$sPRIGUldbl"
19308 case "$ivdformat" in
19309 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
19316 $echo "Checking the format string to be used for gids..." >&4
19319 -1) if $test X"$gidsize" = X"$ivsize"; then
19320 gidformat="$ivdformat"
19322 if $test X"$gidsize" = X"$longsize"; then
19325 if $test X"$gidsize" = X"$intsize"; then
19328 if $test X"$gidsize" = X"$shortsize"; then
19335 *) if $test X"$gidsize" = X"$uvsize"; then
19336 gidformat="$uvuformat"
19338 if $test X"$gidsize" = X"$longsize"; then
19341 if $test X"$gidsize" = X"$intsize"; then
19344 if $test X"$gidsize" = X"$shortsize"; then
19353 : see if getgroups exists
19354 set getgroups d_getgrps
19357 : see if setgroups exists
19358 set setgroups d_setgrps
19362 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
19364 case "$d_getgrps$d_setgrps" in
19366 case "$groupstype" in
19367 '') dflt="$gidtype" ;;
19368 *) dflt="$groupstype" ;;
19371 What type of pointer is the second argument to getgroups() and setgroups()?
19372 Usually this is the same as group ids, $gidtype, but not always.
19375 rp='What type pointer is the second argument to getgroups() and setgroups()?'
19379 *) groupstype="$gidtype";;
19383 if $test $patchlevel -lt 9; then
19384 : MAD is not available in 5.8.x or earlier.
19388 $define|true|[yY]*) dflt='y' ;;
19393 Would you like to build with Misc Attribute Decoration? This is development
19394 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
19395 overhead on the interpreter.
19397 If this doesn't make any sense to you, just accept the default '$dflt'.
19399 rp='Build Perl with MAD?'
19404 madlyh='madly.h madly.act madly.tab'
19406 madlyobj="madly$_o" ;;
19416 echo "Checking if your $make program sets \$(MAKE)..." >&4
19417 case "$make_set_make" in
19419 $sed 's/^X //' > testmake.mak << 'EOF'
19421 X @echo 'maketemp="$(MAKE)"'
19423 case "`$make -f testmake.mak 2>/dev/null`" in
19424 *maketemp=*) make_set_make='#' ;;
19425 *) make_set_make="MAKE=$make" ;;
19427 $rm -f testmake.mak
19430 case "$make_set_make" in
19431 '#') echo "Yup, it does.";;
19432 *) echo "Nope, it doesn't.";;
19435 : see what type is used for mode_t
19436 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
19437 set mode_t modetype int stdio.h sys/types.h
19440 : see if we need va_copy
19442 case "$i_stdarg" in
19445 #include <stdarg.h>
19447 #$i_stdlib I_STDLIB
19449 #include <stdlib.h>
19451 #include <signal.h>
19454 ivfprintf(FILE *f, const char *fmt, va_list *valp)
19456 return vfprintf(f, fmt, *valp);
19460 myvfprintf(FILE *f, const char *fmt, va_list val)
19462 return ivfprintf(f, fmt, &val);
19466 myprintf(char *fmt, ...)
19469 va_start(val, fmt);
19470 return myvfprintf(stdout, fmt, val);
19474 main(int ac, char **av)
19476 signal(SIGSEGV, exit);
19478 myprintf("%s%cs all right, then\n", "that", '\'');
19483 if eval $compile && $run ./try 2>&1 >/dev/null; then
19484 case "`$run ./try`" in
19485 "that's all right, then")
19491 yes) echo "It seems that you don't need va_copy()." >&4
19492 need_va_copy="$undef"
19494 *) echo "It seems that va_copy() or similar will be needed." >&4
19495 need_va_copy="$define"
19500 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
19504 : see what type is used for size_t
19505 rp="What is the type used for the length parameter for string functions?"
19506 set size_t sizetype 'unsigned int' stdio.h sys/types.h
19509 : check for type of arguments to gethostbyaddr.
19510 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
19511 case "$d_gethbyaddr" in
19515 Checking to see what type of arguments are accepted by gethostbyaddr().
19517 hdrs="$define sys/types.h
19518 $d_socket sys/socket.h
19519 $i_niin netinet/in.h
19521 $i_unistd unistd.h"
19522 : The first arg can 'char *' or 'void *'
19523 : The second arg is some of integral type
19524 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
19525 for yyy in size_t long int; do
19526 case "$netdb_host_type" in
19527 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
19528 if ./protochk "$try" $hdrs; then
19529 echo "Your system accepts $xxx for the first arg."
19530 echo "...and $yyy for the second arg."
19531 netdb_host_type="$xxx"
19532 netdb_hlen_type="$yyy"
19538 : In case none of those worked, prompt the user.
19539 case "$netdb_host_type" in
19540 '') rp='What is the type for the 1st argument to gethostbyaddr?'
19543 netdb_host_type=$ans
19544 rp='What is the type for the 2nd argument to gethostbyaddr?'
19547 netdb_hlen_type=$ans
19551 *) : no gethostbyaddr, so pick harmless defaults
19552 netdb_host_type='char *'
19553 netdb_hlen_type="$sizetype"
19556 # Remove the "const" if needed. -- but then we'll have a
19558 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
19561 : check for type of argument to gethostbyname.
19562 if test "X$netdb_name_type" = X ; then
19563 case "$d_gethbyname" in
19567 Checking to see what type of argument is accepted by gethostbyname().
19569 hdrs="$define sys/types.h
19570 $d_socket sys/socket.h
19571 $i_niin netinet/in.h
19573 $i_unistd unistd.h"
19574 for xxx in "const char *" "char *"; do
19575 case "$netdb_name_type" in
19576 '') try="extern struct hostent *gethostbyname($xxx);"
19577 if ./protochk "$try" $hdrs; then
19578 echo "Your system accepts $xxx."
19579 netdb_name_type="$xxx"
19584 : In case none of those worked, prompt the user.
19585 case "$netdb_name_type" in
19586 '') rp='What is the type for the 1st argument to gethostbyname?'
19589 netdb_name_type=$ans
19593 *) : no gethostbyname, so pick harmless default
19594 netdb_name_type='char *'
19599 : check for type of 1st argument to getnetbyaddr.
19600 if test "X$netdb_net_type" = X ; then
19601 case "$d_getnbyaddr" in
19605 Checking to see what type of 1st argument is accepted by getnetbyaddr().
19607 hdrs="$define sys/types.h
19608 $d_socket sys/socket.h
19609 $i_niin netinet/in.h
19611 $i_unistd unistd.h"
19612 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
19613 case "$netdb_net_type" in
19614 '') try="extern struct netent *getnetbyaddr($xxx, int);"
19615 if ./protochk "$try" $hdrs; then
19616 echo "Your system accepts $xxx."
19617 netdb_net_type="$xxx"
19622 : In case none of those worked, prompt the user.
19623 case "$netdb_net_type" in
19624 '') rp='What is the type for the 1st argument to getnetbyaddr?'
19627 netdb_net_type=$ans
19631 *) : no getnetbyaddr, so pick harmless default
19632 netdb_net_type='long'
19636 : locate the preferred pager for this system
19643 [a-zA-Z]:/*) dflt=$pg;;
19647 [a-zA-Z]:/*) dflt=$more;;
19651 [a-zA-Z]:/*) dflt=$less;;
19654 '') dflt=/usr/ucb/more;;
19658 : Instruct ./getfile to trust the hinted or previous pager value,
19659 : even if it does not begin with a slash. For example, on os2,
19660 : pager might be cmd /c more. See comments in UU/getfile.
19665 rp='What pager is used on your system?'
19669 : see what type pids are declared as in the kernel
19670 rp="What is the type of process ids on this system?"
19671 set pid_t pidtype int stdio.h sys/types.h
19674 : see if ar generates random libraries by itself
19676 echo "Checking how to generate random libraries on your machine..." >&4
19677 echo 'int bar1() { return bar2(); }' > bar1.c
19678 echo 'int bar2() { return 2; }' > bar2.c
19680 #$i_stdlib I_STDLIB
19682 #include <stdlib.h>
19684 int main() { printf("%d\n", bar1()); exit(0); }
19686 $cc $ccflags -c bar1.c >/dev/null 2>&1
19687 $cc $ccflags -c bar2.c >/dev/null 2>&1
19688 $cc $ccflags -c foo.c >/dev/null 2>&1
19689 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
19690 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19691 $run ./foobar >/dev/null 2>&1; then
19692 echo "$ar appears to generate random libraries itself."
19694 if [ "X$ranlib" = "X" ]; then
19697 elif $ar s bar$_a >/dev/null 2>&1 &&
19698 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19699 $run ./foobar >/dev/null 2>&1; then
19700 echo "a table of contents needs to be added with '$ar s'."
19703 elif $ar ts bar$_a >/dev/null 2>&1 &&
19704 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19705 $run ./foobar >/dev/null 2>&1; then
19706 echo "a table of contents needs to be added with '$ar ts'."
19713 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
19714 $test -f $ranlib || ranlib=''
19717 if $test -n "$ranlib"; then
19718 echo "your system has '$ranlib'; we'll use that."
19721 echo "your system doesn't seem to support random libraries"
19722 echo "so we'll use lorder and tsort to order the libraries."
19729 : check for type of arguments to select.
19730 case "$selecttype" in
19731 '') case "$d_select" in
19735 Checking to see what type of arguments are accepted by select().
19737 hdrs="$define sys/types.h
19738 $i_systime sys/time.h
19739 $i_sysselct sys/select.h
19740 $d_socket sys/socket.h"
19741 : The first arg can be int, unsigned, or size_t
19742 : The last arg may or may not be 'const'
19744 : void pointer has been seen but using that
19745 : breaks the selectminbits test
19746 for xxx in 'fd_set *' 'int *'; do
19747 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
19748 for tmo in 'struct timeval *' 'const struct timeval *'; do
19750 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
19751 if ./protochk "$try" $hdrs; then
19752 echo "Your system accepts $xxx."
19761 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
19762 case "$d_fd_set" in
19763 $define) dflt="fd_set *" ;;
19772 *) : no select, so pick a harmless default
19779 : check for the select 'width'
19780 case "$selectminbits" in
19781 '') safebits=`expr $ptrsize \* 8`
19782 case "$d_select" in
19786 Checking to see on how many bits at a time your select() operates...
19789 #include <sys/types.h>
19791 #$i_systime I_SYS_TIME
19792 #$i_systimek I_SYS_TIME_KERNEL
19797 # ifdef I_SYS_TIME_KERNEL
19800 # include <sys/time.h>
19801 # ifdef I_SYS_TIME_KERNEL
19805 #$i_sysselct I_SYS_SELECT
19806 #ifdef I_SYS_SELECT
19807 #include <sys/select.h>
19809 #$d_socket HAS_SOCKET
19811 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
19814 #$i_stdlib I_STDLIB
19816 #include <stdlib.h>
19819 #define S sizeof(*(b))
19821 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
19822 #define NBITS (NBYTES * 8)
19824 char *s = (char *)malloc(NBYTES);
19833 fp = fopen("try.c", "r");
19839 b = ($selecttype)s;
19840 for (i = 0; i < NBITS; i++)
19844 select(fd + 1, b, 0, 0, &t);
19845 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
19847 printf("%d\n", i + 1);
19852 if eval $compile_ok; then
19853 selectminbits=`$run ./try`
19854 case "$selectminbits" in
19856 Cannot figure out on how many bits at a time your select() operates.
19857 I'll play safe and guess it is $safebits bits.
19859 selectminbits=$safebits
19860 bits="$safebits bits"
19863 *) bits="$selectminbits bits" ;;
19865 echo "Your select() operates on $bits at a time." >&4
19867 rp='What is the minimum number of bits your select() operates on?'
19868 case "$byteorder" in
19869 12345678) dflt=64 ;;
19875 selectminbits="$val"
19879 *) : no select, so pick a harmless default
19880 selectminbits=$safebits
19886 : Trace out the files included by signal.h, then look for SIGxxx names.
19887 : Remove SIGARRAYSIZE used by HPUX.
19888 : Remove SIGSTKSIZE used by Linux.
19889 : Remove SIGSTKSZ used by Posix.
19890 : Remove SIGTYP void lines used by OS2.
19891 : Some cpps, like os390, dont give the file name anywhere
19892 if [ "X$fieldn" = X ]; then
19893 : Just make some guesses. We check them later.
19894 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
19896 xxx=`echo '#include <signal.h>' |
19897 $cppstdin $cppminus $cppflags 2>/dev/null |
19898 $grep '^[ ]*#.*include' |
19899 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
19901 : Check this list of files to be sure we have parsed the cpp output ok.
19902 : This will also avoid potentially non-existent files, such
19905 for xx in $xxx /dev/null ; do
19906 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
19908 : If we have found no files, at least try signal.h
19909 case "$xxxfiles" in
19910 '') xxxfiles=`./findhdr signal.h` ;;
19913 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
19914 print substr($2, 4, 20)
19916 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
19917 print substr($3, 4, 20)
19919 : Append some common names just in case the awk scan failed.
19920 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
19921 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
19922 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
19923 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
19924 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
19926 : generate a few handy files for later
19927 $cat > signal.c <<EOCP
19928 #include <sys/types.h>
19929 #include <signal.h>
19930 #$i_stdlib I_STDLIB
19932 #include <stdlib.h>
19937 /* Strange style to avoid deeply-nested #if/#else/#endif */
19940 # define NSIG (_NSIG)
19946 # define NSIG (SIGMAX+1)
19952 # define NSIG (SIG_MAX+1)
19958 # define NSIG (_SIG_MAX+1)
19964 # define NSIG (MAXSIG+1)
19970 # define NSIG (MAX_SIG+1)
19975 # ifdef SIGARRAYSIZE
19976 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
19982 # define NSIG (_sys_nsig) /* Solaris 2.5 */
19986 /* Default to some arbitrary number that's big enough to get most
19987 of the common signals.
19993 printf("NSIG %d\n", NSIG);
19999 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
20001 printf "#ifdef SIG"; printf $1; printf "\n"
20002 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
20003 printf $1; printf ");\n"
20007 printf "#endif /* JUST_NSIG */\n";
20008 printf "exit(0);\n}\n";
20011 $cat >signal.awk <<'EOP'
20012 BEGIN { ndups = 0 }
20013 $1 ~ /^NSIG$/ { nsig = $2 }
20014 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
20015 if ($2 > maxsig) { maxsig = $2 }
20016 if (sig_name[$2]) {
20017 dup_name[ndups] = $1
20018 dup_num[ndups] = $2
20030 printf("NSIG %d\n", nsig);
20031 for (n = 1; n < nsig; n++) {
20033 printf("%s %d\n", sig_name[n], sig_num[n])
20036 printf("NUM%d %d\n", n, n)
20039 for (n = 0; n < ndups; n++) {
20040 printf("%s %d\n", dup_name[n], dup_num[n])
20044 $cat >signal_cmd <<EOS
20046 if $test -s signal.lst; then
20047 echo "Using your existing signal.lst file"
20052 $cat >>signal_cmd <<'EOS'
20055 if eval $compile_ok; then
20056 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) | $uniq | $awk -f signal.awk >signal.lst
20058 echo "(I can't seem be able to compile the whole test program)" >&4
20059 echo "(I'll try it in little pieces.)" >&4
20060 set signal -DJUST_NSIG
20061 if eval $compile_ok; then
20062 $run ./signal$_exe > signal.nsg
20065 echo "I can't seem to figure out how many signals you have." >&4
20066 echo "Guessing 50." >&4
20067 echo 'NSIG 50' > signal.nsg
20069 : Now look at all the signal names, one at a time.
20070 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
20071 $cat > signal.c <<EOCP
20072 #include <sys/types.h>
20073 #include <signal.h>
20076 printf("$xx %d\n", SIG${xx});
20081 if eval $compile; then
20082 echo "SIG${xx} found."
20083 $run ./signal$_exe >> signal.ls1
20085 echo "SIG${xx} NOT found."
20088 if $test -s signal.ls1; then
20089 $cat signal.nsg signal.ls1 |
20090 $sort -n | $uniq | $awk -f signal.awk >signal.lst
20094 if $test -s signal.lst; then
20097 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
20098 echo 'kill -l' >signal
20099 set X `csh -f <signal`
20103 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
20105 echo $@ | $tr ' ' $trnl | \
20106 $awk '{ printf "%s %d\n", $1, ++s; }
20107 END { printf "NSIG %d\n", ++s }' >signal.lst
20109 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
20111 chmod a+x signal_cmd
20112 $eunicefix signal_cmd
20114 : generate list of signal names
20116 case "$sig_name_init" in
20118 *) case "$sig_num_init" in
20119 ''|*,*) doinit=yes ;;
20124 echo "Generating a list of signal names and numbers..." >&4
20126 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
20127 sig_name=`$awk 'BEGIN { printf "ZERO " }
20128 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
20129 sig_num=`$awk 'BEGIN { printf "0 " }
20130 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
20131 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
20132 !/^NSIG/ { printf "\"%s\", ", $1 }
20133 END { printf "0\n" }' signal.lst`
20134 sig_num_init=`$awk 'BEGIN { printf "0, " }
20135 !/^NSIG/ { printf "%d, ", $2}
20136 END { printf "0\n"}' signal.lst`
20139 echo "The following $sig_count signals are available:"
20141 echo $sig_name | $awk \
20142 'BEGIN { linelen = 0 }
20144 for (i = 1; i <= NF; i++) {
20145 name = "SIG" $i " "
20146 linelen = linelen + length(name)
20147 if (linelen > 70) {
20149 linelen = length(name)
20155 sig_size=`echo $sig_name | awk '{print NF}'`
20156 $rm -f signal signal.c signal.awk signal.lst signal_cmd
20159 case "$sizetype" in
20160 *_t) zzz="$sizetype" ;;
20161 *) zzz="filesize" ;;
20163 echo "Checking the size of $zzz..." >&4
20165 #include <sys/types.h>
20167 #$i_stdlib I_STDLIB
20169 #include <stdlib.h>
20172 printf("%d\n", (int)sizeof($sizetype));
20177 if eval $compile_ok; then
20181 echo "(I can't execute the test program--guessing $sizesize.)" >&4
20184 echo "Your $zzz size is $sizesize bytes."
20189 echo "(I can't compile the test program--guessing $sizesize.)" >&4
20193 : check for socklen_t
20195 echo "Checking to see if you have socklen_t..." >&4
20197 #include <sys/types.h>
20198 #$d_socket HAS_SOCKET
20200 #include <sys/socket.h>
20202 int main() { socklen_t x = 16; }
20205 if eval $compile; then
20207 echo "You have socklen_t."
20210 echo "You do not have socklen_t."
20211 case "$sizetype" in
20212 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
20219 : see if this is a socks.h system
20220 set socks.h i_socks
20223 : check for type of the size argument to socket calls
20224 case "$d_socket" in
20228 Checking to see what type is the last argument of accept().
20231 case "$d_socklen_t" in
20232 "$define") yyy="$yyy socklen_t"
20234 yyy="$yyy $sizetype int long unsigned"
20235 for xxx in $yyy; do
20236 case "$socksizetype" in
20237 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
20238 case "$usesocks" in
20240 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
20241 echo "Your system accepts '$xxx *' for the last argument of accept()."
20242 socksizetype="$xxx"
20245 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
20246 echo "Your system accepts '$xxx *' for the last argument of accept()."
20247 socksizetype="$xxx"
20254 : In case none of those worked, prompt the user.
20255 case "$socksizetype" in
20256 '') rp='What is the type for socket address structure sizes?'
20263 *) : no sockets, so pick relatively harmless default
20268 : see what type is used for signed size_t
20269 set ssize_t ssizetype int stdio.h sys/types.h
20274 #$i_stdlib I_STDLIB
20276 #include <stdlib.h>
20278 #include <sys/types.h>
20279 #define Size_t $sizetype
20280 #define SSize_t $dflt
20283 if (sizeof(Size_t) == sizeof(SSize_t))
20285 else if (sizeof(Size_t) == sizeof(int))
20294 if eval $compile_ok && $run ./try > /dev/null; then
20295 ssizetype=`$run ./try`
20296 echo "I'll be using $ssizetype for functions returning a byte count." >&4
20299 Help! I can't compile and run the ssize_t test program: please enlighten me!
20300 (This is probably a misconfiguration in your system or libraries, and
20301 you really ought to fix it. Still, I'll try anyway.)
20303 I need a type that is the same size as $sizetype, but is guaranteed to
20304 be signed. Common values are ssize_t, int and long.
20307 rp="What signed type is the same size as $sizetype?"
20313 : see what type of char stdio uses.
20315 echo '#include <stdio.h>' > stdio.c
20316 $cppstdin $cppminus < stdio.c > stdioh
20317 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
20318 echo "Your stdio uses unsigned chars." >&4
20319 stdchar="unsigned char"
20321 echo "Your stdio uses signed chars." >&4
20324 $rm -f stdio.* stdioh
20326 : see what type uids are declared as in the kernel
20328 echo "Looking for the type for user ids returned by getuid()."
20329 set uid_t uidtype xxx stdio.h sys/types.h
20333 xxx=`./findhdr sys/user.h`
20334 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
20336 unsigned) dflt="$1 $2" ;;
20340 *) dflt="$uidtype";;
20343 uid_t) echo "uid_t found." ;;
20344 *) rp="What is the type for user ids returned by getuid()?"
20352 *_t) zzz="$uidtype" ;;
20355 echo "Checking the size of $zzz..." >&4
20357 #include <sys/types.h>
20359 #$i_stdlib I_STDLIB
20361 #include <stdlib.h>
20364 printf("%d\n", (int)sizeof($uidtype));
20369 if eval $compile_ok; then
20373 echo "(I can't execute the test program--guessing $uidsize.)" >&4
20376 echo "Your $zzz is $uidsize bytes long."
20381 echo "(I can't compile the test program--guessing $uidsize.)" >&4
20386 *_t) zzz="$uidtype" ;;
20389 echo "Checking the sign of $zzz..." >&4
20391 #include <sys/types.h>
20402 if eval $compile; then
20406 echo "(I can't execute the test program--guessing unsigned.)" >&4
20410 1) echo "Your $zzz is unsigned." ;;
20411 -1) echo "Your $zzz is signed." ;;
20417 echo "(I can't compile the test program--guessing unsigned.)" >&4
20423 $echo "Checking the format string to be used for uids..." >&4
20426 -1) if $test X"$uidsize" = X"$ivsize"; then
20427 uidformat="$ivdformat"
20429 if $test X"$uidsize" = X"$longsize"; then
20432 if $test X"$uidsize" = X"$intsize"; then
20435 if $test X"$uidsize" = X"$shortsize"; then
20442 *) if $test X"$uidsize" = X"$uvsize"; then
20443 uidformat="$uvuformat"
20445 if $test X"$uidsize" = X"$longsize"; then
20448 if $test X"$uidsize" = X"$intsize"; then
20451 if $test X"$uidsize" = X"$shortsize"; then
20461 case "$usesitecustomize" in
20462 $define|true|[Yy]*)
20463 usesitecustomize="$define"
20466 usesitecustomize="$undef"
20470 : determine compiler compiler
20479 if $test -f "$byacc$_exe"; then
20481 comp="byacc or $comp"
20483 if $test -f "$bison$_exe"; then
20484 comp="$comp or bison -y"
20486 rp="Which compiler compiler ($comp) shall I use?"
20495 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
20501 : see if this is a fp.h system
20505 : see if this is a fp_class.h system
20506 set fp_class.h i_fp_class
20509 : see if gdbm.h is available
20514 : see if gdbm_open exists
20515 set gdbm_open d_gdbm_open
20517 case "$d_gdbm_open" in
20520 echo "We won't be including <gdbm.h>"
20529 : see if this is a ieeefp.h system
20530 case "$i_ieeefp" in
20531 '' ) set ieeefp.h i_ieeefp
20536 : see if this is a libutil.h system
20537 set libutil.h i_libutil
20540 : see if mach cthreads are available
20541 if test "X$usethreads" = "X$define"; then
20542 set mach/cthreads.h i_machcthr
20545 i_machcthr="$undef"
20550 : see if this is a mntent.h system
20551 set mntent.h i_mntent
20554 : see if ndbm.h is available
20560 # Some Linux distributions such as RedHat 7.1 put the
20561 # ndbm.h header in /usr/include/gdbm/ndbm.h.
20562 if $test -f /usr/include/gdbm/ndbm.h; then
20563 echo '<gdbm/ndbm.h> found.'
20564 ccflags="$ccflags -I/usr/include/gdbm"
20565 cppflags="$cppflags -I/usr/include/gdbm"
20573 : see if dbm_open exists
20574 set dbm_open d_dbm_open
20576 case "$d_dbm_open" in
20579 echo "We won't be including <ndbm.h>"
20588 : see if net/errno.h is available
20590 set net/errno.h val
20593 : Unfortunately, it causes problems on some systems. Arrgh.
20596 cat > try.c <<'EOM'
20599 #include <net/errno.h>
20605 if $cc $ccflags -c try.c >/dev/null 2>&1; then
20606 echo "We'll be including <net/errno.h>." >&4
20608 echo "We won't be including <net/errno.h>." >&4
20617 : see if netinet/tcp.h is available
20618 set netinet/tcp.h i_netinettcp
20621 : see if this is a poll.h system
20625 : see if this is a prot.h system
20630 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
20631 $cat <<'EOSH' > Cppsym.know
20632 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
20633 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
20634 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
20635 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
20636 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
20637 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
20638 bull c cadmus clipper CMU COFF COMPILER_VERSION
20639 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
20640 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
20641 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
20642 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
20644 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
20645 H3050R H3050RX hbullx20 hcx host_mips
20646 hp200 hp300 hp700 HP700 hp800 hp9000
20647 hp9000s200 hp9000s300 hp9000s400 hp9000s500
20648 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
20649 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
20650 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
20651 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
20652 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
20653 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
20654 Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
20655 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
20656 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
20657 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
20658 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
20659 MATH_HAS_NO_SIDE_EFFECTS
20660 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
20661 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
20662 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
20663 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
20664 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
20665 NetBSD news1500 news1700 news1800 news1900 news3700
20666 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
20667 ns32016 ns32332 ns32k nsc32000
20668 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
20669 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
20670 pc532 pdp11 PGC PIC plexus PORTAR posix
20671 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
20672 POSIX_C_SOURCE POSIX_SOURCE POWER
20673 PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
20674 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
20675 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
20676 sony sony_news sonyrisc sparc sparclite spectrum
20677 stardent stdc STDC_EXT stratos sun sun3 sun386
20678 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
20679 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
20680 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
20681 sysV68 sysV88 Tek4132 Tek4300 titan
20682 TM3200 TM5400 TM5600
20683 tower tower32 tower32_200 tower32_600 tower32_700
20684 tower32_800 tower32_850 tss
20685 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
20686 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
20687 unix UNIX95 UNIX99 unixpc unos
20688 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
20689 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
20690 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
20692 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
20693 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
20694 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
20697 # Maybe put other stuff here too.
20698 cat <<EOSH >>Cppsym.know
20701 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
20702 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
20703 $cat Cppsym.know > Cppsym.c
20704 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
20705 $rm -f Cppsym.a Cppsym.b Cppsym.c
20706 cat <<EOSH > Cppsym
20708 if $test \$# -gt 0; then
20709 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
20710 if $test -s Cppsym.got; then
20717 $tr " " "$trnl" | ./Cppsym.try
20723 cat <<EOSH > Cppsym.try
20725 cat <<'EOCP' > try.c
20728 #define STRINGIFY(a) "a"
20730 #if cpp_stuff == 42
20731 #define StGiFy(a) #a
20732 #define STRINGIFY(a) StGiFy(a)
20734 #if $cpp_stuff != 1 && $cpp_stuff != 42
20735 # include "Bletch: How does this C preprocessor stringify macros?"
20741 cat <<'EOSH' >> Cppsym.try
20743 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
20744 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
20745 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
20746 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
20748 echo 'return 0;}' >> try.c
20750 cat <<EOSH >> Cppsym.try
20752 case "$osname-$gccversion" in
20753 irix-) ccflags="\$ccflags -woff 1178" ;;
20754 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
20756 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
20758 chmod +x Cppsym.try
20759 $eunicefix Cppsym.try
20760 ./Cppsym < Cppsym.know > Cppsym.true
20761 : Add in any linux cpp "predefined macros":
20762 case "$osname::$gccversion" in
20765 rm -f $tHdrH'.h' $tHdrH
20767 if cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
20768 sed 's/#define[\ \ ]*//;s/[\ \ ].*$//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
20769 if [ -s $tHdrH'_cppsym.real' ]; then
20770 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
20773 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
20776 : now check the C compiler for additional symbols
20777 postprocess_cc_v=''
20779 aix) postprocess_cc_v="|$tr , ' '" ;;
20786 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
20789 -D*) echo "\$i" | $sed 's/^-D//';;
20790 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
20795 postprocess_cc_v=''
20798 ./ccsym > ccsym1.raw
20799 if $test -s ccsym1.raw; then
20800 $sort ccsym1.raw | $uniq >ccsym.raw
20802 mv ccsym1.raw ccsym.raw
20805 $awk '/\=/ { print $0; next }
20806 { print $0"=1" }' ccsym.raw >ccsym.list
20807 $comm -13 Cppsym.true ccsym.list >ccsym.own
20808 $comm -12 Cppsym.true ccsym.list >ccsym.com
20809 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
20811 if $test -z ccsym.raw; then
20812 echo "Your C compiler doesn't seem to define any symbols!" >&4
20814 echo "However, your C preprocessor defines the following symbols:"
20817 cppsymbols=`$cat Cppsym.true`
20818 cppsymbols=`echo $cppsymbols`
20819 cppccsymbols="$cppsymbols"
20821 if $test -s ccsym.com; then
20822 echo "Your C compiler and pre-processor define these symbols:"
20823 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
20826 cppccsymbols=`$cat ccsym.com`
20827 cppccsymbols=`echo $cppccsymbols`
20828 $test "$silent" || sleep 1
20830 if $test -s ccsym.cpp; then
20831 $test "$also" && echo " "
20832 echo "Your C pre-processor ${also}defines the following symbols:"
20833 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
20835 cppsymbols=`$cat ccsym.cpp`
20836 cppsymbols=`echo $cppsymbols`
20837 $test "$silent" || sleep 1
20839 if $test -s ccsym.own; then
20840 $test "$also" && echo " "
20841 echo "Your C compiler ${also}defines the following cpp symbols:"
20842 $sed -e 's/\(..*\)=1/\1/' ccsym.own
20843 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
20844 ccsymbols=`$cat ccsym.own`
20845 ccsymbols=`echo $ccsymbols`
20846 $test "$silent" || sleep 1
20850 : see if this is a termio system
20854 if $test `./findhdr termios.h`; then
20855 set tcsetattr i_termios
20861 "$define") echo "You have POSIX termios.h... good!" >&4;;
20862 *) if ./Cppsym pyr; then
20863 case "`/bin/universe`" in
20864 ucb) if $test `./findhdr sgtty.h`; then
20866 echo "<sgtty.h> found." >&4
20868 echo "System is pyramid with BSD universe."
20869 echo "<sgtty.h> not found--you could have problems." >&4
20871 *) if $test `./findhdr termio.h`; then
20873 echo "<termio.h> found." >&4
20875 echo "System is pyramid with USG universe."
20876 echo "<termio.h> not found--you could have problems." >&4
20880 if $test `./findhdr termio.h`; then
20881 echo "<termio.h> found." >&4
20883 elif $test `./findhdr sgtty.h`; then
20884 echo "<sgtty.h> found." >&4
20887 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
20890 if $test `./findhdr sgtty.h`; then
20891 echo "<sgtty.h> found." >&4
20893 elif $test `./findhdr termio.h`; then
20894 echo "<termio.h> found." >&4
20897 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
20901 set i_termio; eval $setvar
20902 val=$val2; set i_sgtty; eval $setvar
20903 val=$val3; set i_termios; eval $setvar
20905 : see if stddef is available
20906 set stddef.h i_stddef
20909 : see if sys/access.h is available
20910 set sys/access.h i_sysaccess
20913 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
20914 set sys/filio.h i_sysfilio
20917 if $test `./findhdr sys/ioctl.h`; then
20919 echo '<sys/ioctl.h> found.' >&4
20922 if $test $i_sysfilio = "$define"; then
20923 echo '<sys/ioctl.h> NOT found.' >&4
20925 $test $i_sgtty = "$define" && xxx="sgtty.h"
20926 $test $i_termio = "$define" && xxx="termio.h"
20927 $test $i_termios = "$define" && xxx="termios.h"
20928 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
20934 : see if socket ioctl defs are in sys/sockio.h
20936 xxx=`./findhdr sys/sockio.h`
20937 if $test "$xxx"; then
20938 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
20940 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
20943 echo "No socket ioctls found in <sys/sockio.h>." >&4
20948 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
20955 : see if this is a syslog.h system
20956 set syslog.h i_syslog
20960 : see if this is a sys/mode.h system
20961 set sys/mode.h i_sysmode
20964 : see if sys/resource.h has to be included
20965 set sys/resource.h i_sysresrc
20968 : see if sys/security.h is available
20969 set sys/security.h i_syssecrt
20972 : see if this is a sys/statvfs.h system
20973 set sys/statvfs.h i_sysstatvfs
20976 : see if this is a sys/un.h system
20977 set sys/un.h i_sysun
20981 : see if this is a sys/utsname.h system
20982 set sys/utsname.h i_sysutsname
20985 : see if this is a syswait system
20986 set sys/wait.h i_syswait
20989 : see if this is a ustat.h system
20990 set ustat.h i_ustat
20993 : see if this is an utime system
20994 set utime.h i_utime
20997 : see if this is a values.h system
20998 set values.h i_values
21001 : see if this is a vfork system
21004 set vfork.h i_vfork
21013 echo "Looking for extensions..." >&4
21014 : If we are using the old config.sh, known_extensions may contain
21015 : old or inaccurate or duplicate values.
21016 known_extensions=''
21017 nonxs_extensions=''
21018 : We do not use find because it might not be available.
21019 : We do not just use MANIFEST because the user may have dropped
21020 : some additional extensions into the source tree and expect them
21023 : Function to recursively find available extensions, ignoring DynaLoader
21024 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
21028 DynaLoader|dynaload) ;;
21030 if $test -f $xxx/$xxx.xs -o -f $xxx/$xxx.c; then
21031 known_extensions="$known_extensions $1$xxx";
21032 elif $test -f $xxx/Makefile.PL; then
21033 nonxs_extensions="$nonxs_extensions $1$xxx";
21035 if $test -d $xxx -a $# -lt 10; then
21038 eval $find_extensions;
21050 eval $find_extensions
21051 # Special case: Add in threads/shared since it is not picked up by the
21052 # recursive find above (and adding in general recursive finding breaks
21053 # SDBM_File/sdbm). A.D. 10/25/2001.
21054 known_extensions="$known_extensions threads/shared"
21055 set X $known_extensions
21057 known_extensions="$*"
21058 set X $nonxs_extensions
21060 nonxs_extensions="$*"
21063 : Now see which are supported on this system.
21065 for xxx in $known_extensions ; do
21069 $define) avail_ext="$avail_ext $xxx" ;;
21072 GDBM_File|gdbm_fil)
21074 $define) avail_ext="$avail_ext $xxx" ;;
21077 I18N/Langinfo|i18n_lan)
21078 case "$i_langinfo$d_nl_langinfo" in
21079 $define$define) avail_ext="$avail_ext $xxx" ;;
21083 : XXX Do we need a useipcsysv variable here
21084 case "${d_msg}${d_sem}${d_shm}" in
21085 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
21088 NDBM_File|ndbm_fil)
21091 case "$osname-$use64bitint" in
21094 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
21097 *) avail_ext="$avail_ext $xxx" ;;
21102 ODBM_File|odbm_fil)
21103 case "${i_dbm}${i_rpcsvcdbm}" in
21105 case "$d_cplusplus" in
21106 define) ;; # delete as a function name will not work
21107 *) case "$osname-$use64bitint" in
21110 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
21113 *) avail_ext="$avail_ext $xxx" ;;
21121 case "$useopcode" in
21122 true|define|y) avail_ext="$avail_ext $xxx" ;;
21126 case "$useposix" in
21127 true|define|y) avail_ext="$avail_ext $xxx" ;;
21131 case "$d_socket" in
21134 beos) ;; # not unless BONE
21135 *) avail_ext="$avail_ext $xxx" ;;
21140 Sys/Syslog|sys/syslog)
21141 : XXX syslog requires socket
21142 case "$d_socket" in
21143 true|$define|y) avail_ext="$avail_ext $xxx" ;;
21147 case "$usethreads" in
21149 case "$use5005threads" in
21150 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
21154 threads|threads/shared)
21155 # threads and threads::shared are special cases.
21156 # To stop people from asking "Perl 5.8.0 was supposed
21157 # to have this new fancy threads implementation but my
21158 # perl doesn't have it" and from people trying to
21159 # (re)install the threads module using CPAN.pm and
21160 # CPAN.pm then offering to reinstall Perl 5.8.0,
21161 # the threads.pm and threads/shared.pm will always be
21162 # there, croaking informatively ("you need to rebuild
21163 # all of Perl with threads, sorry") when threads haven't
21164 # been compiled in.
21166 avail_ext="$avail_ext $xxx"
21170 cygwin) avail_ext="$avail_ext $xxx" ;;
21173 XS/APItest|xs/apitest)
21174 # This is just for testing. Skip it unless we have dynamic loading.
21177 $define) avail_ext="$avail_ext $xxx" ;;
21180 XS/Typemap|xs/typemap)
21181 # This is just for testing. Skip it unless we have dynamic loading.
21183 $define) avail_ext="$avail_ext $xxx" ;;
21186 *) avail_ext="$avail_ext $xxx"
21195 case "$onlyextensions" in
21197 *) keepextensions=''
21198 echo "You have requested that only certains extensions be included..." >&4
21199 for i in $onlyextensions; do
21200 case " $avail_ext " in
21202 echo "Keeping extension $i."
21203 keepextensions="$keepextensions $i"
21205 *) echo "Ignoring extension $i." ;;
21208 avail_ext="$keepextensions"
21212 case "$noextensions" in
21214 *) keepextensions=''
21215 echo "You have requested that certain extensions be ignored..." >&4
21216 for i in $avail_ext; do
21217 case " $noextensions " in
21218 *" $i "*) echo "Ignoring extension $i." ;;
21219 *) echo "Keeping extension $i.";
21220 keepextensions="$keepextensions $i"
21224 avail_ext="$keepextensions"
21228 : Now see which nonxs extensions are supported on this system.
21229 : For now assume all are.
21231 for xxx in $nonxs_extensions ; do
21233 *) nonxs_ext="$nonxs_ext $xxx"
21245 A number of extensions are supplied with $package. You may choose to
21246 compile these extensions for dynamic loading (the default), compile
21247 them into the $package executable (static loading), or not include
21248 them at all. Answer "none" to include no extensions.
21249 Note that DynaLoader is always built and need not be mentioned here.
21252 case "$dynamic_ext" in
21254 : Exclude those listed in static_ext
21256 for xxx in $avail_ext; do
21257 case " $static_ext " in
21259 *) dflt="$dflt $xxx" ;;
21266 *) dflt="$dynamic_ext"
21267 # Perhaps we are reusing an old out-of-date config.sh.
21270 if test X"$dynamic_ext" != X"$avail_ext"; then
21272 NOTICE: Your previous config.sh list may be incorrect.
21273 The extensions now available to you are
21275 but the default list from your previous config.sh is
21287 rp="What extensions do you wish to load dynamically?"
21290 none) dynamic_ext=' ' ;;
21291 *) dynamic_ext="$ans" ;;
21294 case "$static_ext" in
21296 : Exclude those already listed in dynamic linking
21298 for xxx in $avail_ext; do
21299 case " $dynamic_ext " in
21301 *) dflt="$dflt $xxx" ;;
21308 *) dflt="$static_ext"
21315 rp="What extensions do you wish to load statically?"
21318 none) static_ext=' ' ;;
21319 *) static_ext="$ans" ;;
21324 A number of extensions are supplied with $package. Answer "none"
21325 to include no extensions.
21326 Note that DynaLoader is always built and need not be mentioned here.
21329 case "$static_ext" in
21330 '') dflt="$avail_ext" ;;
21331 *) dflt="$static_ext"
21332 # Perhaps we are reusing an old out-of-date config.sh.
21335 if test X"$static_ext" != X"$avail_ext"; then
21337 NOTICE: Your previous config.sh list may be incorrect.
21338 The extensions now available to you are
21340 but the default list from your previous config.sh is
21349 : Exclude those that are not xs extensions
21353 rp="What extensions do you wish to include?"
21356 none) static_ext=' ' ;;
21357 *) static_ext="$ans" ;;
21362 # Encode is a special case. If we are building Encode as a static
21363 # extension, we need to explicitly list its subextensions as well.
21364 # For other nested extensions, this is handled automatically by
21365 # the appropriate Makefile.PL.
21366 case " $static_ext " in
21367 *" Encode "*) # Add the subextensions of Encode
21369 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
21370 static_ext="$static_ext Encode/$xxx"
21376 set X $dynamic_ext $static_ext $nonxs_ext
21380 # Sanity check: We require an extension suitable for use with
21381 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
21382 # should show up as failures in the test suite, but it's helpful to
21383 # catch them now.) The 'extensions' list is normally sorted
21384 # alphabetically, so we need to accept either
21385 # DB_File ... Fcntl ... IO ....
21386 # or something like
21387 # Fcntl ... NDBM_File ... IO ....
21388 case " $extensions" in
21389 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
21390 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
21391 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
21392 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
21393 echo "WARNING: The Perl you are building will be quite crippled." >& 4
21397 : Remove libraries needed only for extensions
21398 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
21399 : The exception is SunOS 4.x, which needs them.
21400 case "${osname}X${osvers}" in
21404 *) case "$usedl" in
21405 $define|true|[yY]*)
21406 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
21410 *) perllibs="$libs"
21416 : Remove build directory name from cppstdin so it can be used from
21417 : either the present location or the final installed location.
21419 : Get out of the UU directory to get correct path name.
21421 case "$cppstdin" in
21423 echo "Stripping down cppstdin path name"
21429 : end of configuration questions
21431 echo "End of configuration questions."
21434 : back to where it started
21435 if test -d ../UU; then
21439 : configuration may be patched via a 'config.arch' file
21440 if $test -f config.arch; then
21441 echo "I see a config.arch file, loading it."
21445 : configuration may be patched via a 'config.over' file
21446 if $test -f config.over; then
21449 rp='I see a config.over file. Do you wish to load it?'
21452 n*) echo "OK, I'll ignore it.";;
21454 echo "Configuration override changes have been loaded."
21459 : in case they want portability, strip down executable paths
21460 case "$d_portable" in
21463 echo "Stripping down executable paths..." >&4
21464 for file in $loclist $trylist; do
21466 eval $file=`basename $temp`
21471 : create config.sh file
21473 echo "Creating config.sh..." >&4
21474 $spitshell <<EOT >config.sh
21477 # This file was produced by running the Configure script. It holds all the
21478 # definitions figured out by Configure. Should you modify one of these values,
21479 # do not forget to propagate your changes by running "Configure -der". You may
21480 # instead choose to run each of the .SH files by yourself, or "Configure -S".
21483 # Package name : $package
21484 # Source directory : $src
21485 # Configuration time: $cf_time
21486 # Configured by : $cf_by
21487 # Target system : $myuname
21497 Revision='$Revision'
21505 alignbytes='$alignbytes'
21506 ansi2knr='$ansi2knr'
21507 aphostname='$aphostname'
21508 api_revision='$api_revision'
21509 api_subversion='$api_subversion'
21510 api_version='$api_version'
21511 api_versionstring='$api_versionstring'
21514 archlibexp='$archlibexp'
21515 archname64='$archname64'
21516 archname='$archname'
21517 archobjs='$archobjs'
21518 asctime_r_proto='$asctime_r_proto'
21526 byteorder='$byteorder'
21528 castflags='$castflags'
21531 cccdlflags='$cccdlflags'
21532 ccdlflags='$ccdlflags'
21534 ccflags_uselargefiles='$ccflags_uselargefiles'
21536 ccsymbols='$ccsymbols'
21537 ccversion='$ccversion'
21539 cf_email='$cf_email'
21541 charsize='$charsize'
21545 clocktype='$clocktype'
21547 compress='$compress'
21548 contains='$contains'
21552 cpp_stuff='$cpp_stuff'
21553 cppccsymbols='$cppccsymbols'
21554 cppflags='$cppflags'
21556 cppminus='$cppminus'
21558 cppstdin='$cppstdin'
21559 cppsymbols='$cppsymbols'
21560 crypt_r_proto='$crypt_r_proto'
21561 cryptlib='$cryptlib'
21563 ctermid_r_proto='$ctermid_r_proto'
21564 ctime_r_proto='$ctime_r_proto'
21565 d_Gconvert='$d_Gconvert'
21566 d_PRIEUldbl='$d_PRIEUldbl'
21567 d_PRIFUldbl='$d_PRIFUldbl'
21568 d_PRIGUldbl='$d_PRIGUldbl'
21569 d_PRIXU64='$d_PRIXU64'
21570 d_PRId64='$d_PRId64'
21571 d_PRIeldbl='$d_PRIeldbl'
21572 d_PRIfldbl='$d_PRIfldbl'
21573 d_PRIgldbl='$d_PRIgldbl'
21574 d_PRIi64='$d_PRIi64'
21575 d_PRIo64='$d_PRIo64'
21576 d_PRIu64='$d_PRIu64'
21577 d_PRIx64='$d_PRIx64'
21578 d_SCNfldbl='$d_SCNfldbl'
21579 d__fwalk='$d__fwalk'
21580 d_access='$d_access'
21581 d_accessx='$d_accessx'
21584 d_archlib='$d_archlib'
21585 d_asctime_r='$d_asctime_r'
21588 d_attribute_format='$d_attribute_format'
21589 d_attribute_malloc='$d_attribute_malloc'
21590 d_attribute_nonnull='$d_attribute_nonnull'
21591 d_attribute_noreturn='$d_attribute_noreturn'
21592 d_attribute_pure='$d_attribute_pure'
21593 d_attribute_unused='$d_attribute_unused'
21594 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
21598 d_bsdgetpgrp='$d_bsdgetpgrp'
21599 d_bsdsetpgrp='$d_bsdsetpgrp'
21600 d_builtin_choose_expr='$d_builtin_choose_expr'
21601 d_builtin_expect='$d_builtin_expect'
21603 d_c99_variadic_macros='$d_c99_variadic_macros'
21604 d_casti32='$d_casti32'
21605 d_castneg='$d_castneg'
21606 d_charvspr='$d_charvspr'
21608 d_chroot='$d_chroot'
21609 d_chsize='$d_chsize'
21611 d_clearenv='$d_clearenv'
21612 d_closedir='$d_closedir'
21613 d_cmsghdr_s='$d_cmsghdr_s'
21615 d_copysignl='$d_copysignl'
21616 d_cplusplus='$d_cplusplus'
21618 d_crypt_r='$d_crypt_r'
21620 d_ctermid='$d_ctermid'
21621 d_ctermid_r='$d_ctermid_r'
21622 d_ctime_r='$d_ctime_r'
21623 d_cuserid='$d_cuserid'
21624 d_dbl_dig='$d_dbl_dig'
21625 d_dbminitproto='$d_dbminitproto'
21626 d_difftime='$d_difftime'
21627 d_dir_dd_fd='$d_dir_dd_fd'
21629 d_dirnamlen='$d_dirnamlen'
21630 d_dlerror='$d_dlerror'
21631 d_dlopen='$d_dlopen'
21632 d_dlsymun='$d_dlsymun'
21633 d_dosuid='$d_dosuid'
21634 d_drand48_r='$d_drand48_r'
21635 d_drand48proto='$d_drand48proto'
21637 d_eaccess='$d_eaccess'
21638 d_endgrent='$d_endgrent'
21639 d_endgrent_r='$d_endgrent_r'
21640 d_endhent='$d_endhent'
21641 d_endhostent_r='$d_endhostent_r'
21642 d_endnent='$d_endnent'
21643 d_endnetent_r='$d_endnetent_r'
21644 d_endpent='$d_endpent'
21645 d_endprotoent_r='$d_endprotoent_r'
21646 d_endpwent='$d_endpwent'
21647 d_endpwent_r='$d_endpwent_r'
21648 d_endsent='$d_endsent'
21649 d_endservent_r='$d_endservent_r'
21650 d_eofnblk='$d_eofnblk'
21651 d_eunice='$d_eunice'
21652 d_faststdio='$d_faststdio'
21653 d_fchdir='$d_fchdir'
21654 d_fchmod='$d_fchmod'
21655 d_fchown='$d_fchown'
21657 d_fcntl_can_lock='$d_fcntl_can_lock'
21658 d_fd_macros='$d_fd_macros'
21659 d_fd_set='$d_fd_set'
21660 d_fds_bits='$d_fds_bits'
21661 d_fgetpos='$d_fgetpos'
21662 d_finite='$d_finite'
21663 d_finitel='$d_finitel'
21664 d_flexfnam='$d_flexfnam'
21666 d_flockproto='$d_flockproto'
21668 d_fp_class='$d_fp_class'
21669 d_fpathconf='$d_fpathconf'
21670 d_fpclass='$d_fpclass'
21671 d_fpclassify='$d_fpclassify'
21672 d_fpclassl='$d_fpclassl'
21673 d_fpos64_t='$d_fpos64_t'
21674 d_frexpl='$d_frexpl'
21675 d_fs_data_s='$d_fs_data_s'
21676 d_fseeko='$d_fseeko'
21677 d_fsetpos='$d_fsetpos'
21678 d_fstatfs='$d_fstatfs'
21679 d_fstatvfs='$d_fstatvfs'
21681 d_ftello='$d_ftello'
21683 d_futimes='$d_futimes'
21684 d_getcwd='$d_getcwd'
21685 d_getespwnam='$d_getespwnam'
21686 d_getfsstat='$d_getfsstat'
21687 d_getgrent='$d_getgrent'
21688 d_getgrent_r='$d_getgrent_r'
21689 d_getgrgid_r='$d_getgrgid_r'
21690 d_getgrnam_r='$d_getgrnam_r'
21691 d_getgrps='$d_getgrps'
21692 d_gethbyaddr='$d_gethbyaddr'
21693 d_gethbyname='$d_gethbyname'
21694 d_gethent='$d_gethent'
21695 d_gethname='$d_gethname'
21696 d_gethostbyaddr_r='$d_gethostbyaddr_r'
21697 d_gethostbyname_r='$d_gethostbyname_r'
21698 d_gethostent_r='$d_gethostent_r'
21699 d_gethostprotos='$d_gethostprotos'
21700 d_getitimer='$d_getitimer'
21701 d_getlogin='$d_getlogin'
21702 d_getlogin_r='$d_getlogin_r'
21703 d_getmnt='$d_getmnt'
21704 d_getmntent='$d_getmntent'
21705 d_getnbyaddr='$d_getnbyaddr'
21706 d_getnbyname='$d_getnbyname'
21707 d_getnent='$d_getnent'
21708 d_getnetbyaddr_r='$d_getnetbyaddr_r'
21709 d_getnetbyname_r='$d_getnetbyname_r'
21710 d_getnetent_r='$d_getnetent_r'
21711 d_getnetprotos='$d_getnetprotos'
21712 d_getpagsz='$d_getpagsz'
21713 d_getpbyname='$d_getpbyname'
21714 d_getpbynumber='$d_getpbynumber'
21715 d_getpent='$d_getpent'
21716 d_getpgid='$d_getpgid'
21717 d_getpgrp2='$d_getpgrp2'
21718 d_getpgrp='$d_getpgrp'
21719 d_getppid='$d_getppid'
21720 d_getprior='$d_getprior'
21721 d_getprotobyname_r='$d_getprotobyname_r'
21722 d_getprotobynumber_r='$d_getprotobynumber_r'
21723 d_getprotoent_r='$d_getprotoent_r'
21724 d_getprotoprotos='$d_getprotoprotos'
21725 d_getprpwnam='$d_getprpwnam'
21726 d_getpwent='$d_getpwent'
21727 d_getpwent_r='$d_getpwent_r'
21728 d_getpwnam_r='$d_getpwnam_r'
21729 d_getpwuid_r='$d_getpwuid_r'
21730 d_getsbyname='$d_getsbyname'
21731 d_getsbyport='$d_getsbyport'
21732 d_getsent='$d_getsent'
21733 d_getservbyname_r='$d_getservbyname_r'
21734 d_getservbyport_r='$d_getservbyport_r'
21735 d_getservent_r='$d_getservent_r'
21736 d_getservprotos='$d_getservprotos'
21737 d_getspnam='$d_getspnam'
21738 d_getspnam_r='$d_getspnam_r'
21739 d_gettimeod='$d_gettimeod'
21740 d_gmtime_r='$d_gmtime_r'
21741 d_gnulibc='$d_gnulibc'
21742 d_grpasswd='$d_grpasswd'
21743 d_hasmntopt='$d_hasmntopt'
21745 d_ilogbl='$d_ilogbl'
21746 d_inc_version_list='$d_inc_version_list'
21748 d_inetaton='$d_inetaton'
21749 d_int64_t='$d_int64_t'
21750 d_isascii='$d_isascii'
21751 d_isfinite='$d_isfinite'
21754 d_isnanl='$d_isnanl'
21755 d_killpg='$d_killpg'
21756 d_lchown='$d_lchown'
21757 d_ldbl_dig='$d_ldbl_dig'
21758 d_libm_lib_version='$d_libm_lib_version'
21760 d_localtime_r='$d_localtime_r'
21761 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
21762 d_locconv='$d_locconv'
21764 d_longdbl='$d_longdbl'
21765 d_longlong='$d_longlong'
21766 d_lseekproto='$d_lseekproto'
21768 d_madvise='$d_madvise'
21769 d_malloc_good_size='$d_malloc_good_size'
21770 d_malloc_size='$d_malloc_size'
21772 d_mbstowcs='$d_mbstowcs'
21773 d_mbtowc='$d_mbtowc'
21774 d_memchr='$d_memchr'
21775 d_memcmp='$d_memcmp'
21776 d_memcpy='$d_memcpy'
21777 d_memmove='$d_memmove'
21778 d_memset='$d_memset'
21780 d_mkdtemp='$d_mkdtemp'
21781 d_mkfifo='$d_mkfifo'
21782 d_mkstemp='$d_mkstemp'
21783 d_mkstemps='$d_mkstemps'
21784 d_mktime='$d_mktime'
21787 d_modfl_pow32_bug='$d_modfl_pow32_bug'
21788 d_modflproto='$d_modflproto'
21789 d_mprotect='$d_mprotect'
21791 d_msg_ctrunc='$d_msg_ctrunc'
21792 d_msg_dontroute='$d_msg_dontroute'
21793 d_msg_oob='$d_msg_oob'
21794 d_msg_peek='$d_msg_peek'
21795 d_msg_proxy='$d_msg_proxy'
21796 d_msgctl='$d_msgctl'
21797 d_msgget='$d_msgget'
21798 d_msghdr_s='$d_msghdr_s'
21799 d_msgrcv='$d_msgrcv'
21800 d_msgsnd='$d_msgsnd'
21802 d_munmap='$d_munmap'
21803 d_mymalloc='$d_mymalloc'
21805 d_nl_langinfo='$d_nl_langinfo'
21806 d_nv_preserves_uv='$d_nv_preserves_uv'
21807 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
21808 d_off64_t='$d_off64_t'
21809 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
21810 d_oldpthreads='$d_oldpthreads'
21811 d_oldsock='$d_oldsock'
21813 d_pathconf='$d_pathconf'
21815 d_perl_otherlibdirs='$d_perl_otherlibdirs'
21816 d_phostname='$d_phostname'
21819 d_portable='$d_portable'
21820 d_printf_format_null='$d_printf_format_null'
21821 d_procselfexe='$d_procselfexe'
21822 d_pseudofork='$d_pseudofork'
21823 d_pthread_atfork='$d_pthread_atfork'
21824 d_pthread_attr_setscope='$d_pthread_attr_setscope'
21825 d_pthread_yield='$d_pthread_yield'
21827 d_pwchange='$d_pwchange'
21828 d_pwclass='$d_pwclass'
21829 d_pwcomment='$d_pwcomment'
21830 d_pwexpire='$d_pwexpire'
21831 d_pwgecos='$d_pwgecos'
21832 d_pwpasswd='$d_pwpasswd'
21833 d_pwquota='$d_pwquota'
21836 d_random_r='$d_random_r'
21837 d_readdir64_r='$d_readdir64_r'
21838 d_readdir='$d_readdir'
21839 d_readdir_r='$d_readdir_r'
21840 d_readlink='$d_readlink'
21842 d_recvmsg='$d_recvmsg'
21843 d_rename='$d_rename'
21844 d_rewinddir='$d_rewinddir'
21846 d_safebcpy='$d_safebcpy'
21847 d_safemcpy='$d_safemcpy'
21848 d_sanemcmp='$d_sanemcmp'
21849 d_sbrkproto='$d_sbrkproto'
21850 d_scalbnl='$d_scalbnl'
21851 d_sched_yield='$d_sched_yield'
21852 d_scm_rights='$d_scm_rights'
21853 d_seekdir='$d_seekdir'
21854 d_select='$d_select'
21856 d_semctl='$d_semctl'
21857 d_semctl_semid_ds='$d_semctl_semid_ds'
21858 d_semctl_semun='$d_semctl_semun'
21859 d_semget='$d_semget'
21861 d_sendmsg='$d_sendmsg'
21862 d_setegid='$d_setegid'
21863 d_seteuid='$d_seteuid'
21864 d_setgrent='$d_setgrent'
21865 d_setgrent_r='$d_setgrent_r'
21866 d_setgrps='$d_setgrps'
21867 d_sethent='$d_sethent'
21868 d_sethostent_r='$d_sethostent_r'
21869 d_setitimer='$d_setitimer'
21870 d_setlinebuf='$d_setlinebuf'
21871 d_setlocale='$d_setlocale'
21872 d_setlocale_r='$d_setlocale_r'
21873 d_setnent='$d_setnent'
21874 d_setnetent_r='$d_setnetent_r'
21875 d_setpent='$d_setpent'
21876 d_setpgid='$d_setpgid'
21877 d_setpgrp2='$d_setpgrp2'
21878 d_setpgrp='$d_setpgrp'
21879 d_setprior='$d_setprior'
21880 d_setproctitle='$d_setproctitle'
21881 d_setprotoent_r='$d_setprotoent_r'
21882 d_setpwent='$d_setpwent'
21883 d_setpwent_r='$d_setpwent_r'
21884 d_setregid='$d_setregid'
21885 d_setresgid='$d_setresgid'
21886 d_setresuid='$d_setresuid'
21887 d_setreuid='$d_setreuid'
21888 d_setrgid='$d_setrgid'
21889 d_setruid='$d_setruid'
21890 d_setsent='$d_setsent'
21891 d_setservent_r='$d_setservent_r'
21892 d_setsid='$d_setsid'
21893 d_setvbuf='$d_setvbuf'
21897 d_shmatprototype='$d_shmatprototype'
21898 d_shmctl='$d_shmctl'
21900 d_shmget='$d_shmget'
21901 d_sigaction='$d_sigaction'
21902 d_signbit='$d_signbit'
21903 d_sigprocmask='$d_sigprocmask'
21904 d_sigsetjmp='$d_sigsetjmp'
21905 d_sitearch='$d_sitearch'
21906 d_snprintf='$d_snprintf'
21907 d_sockatmark='$d_sockatmark'
21908 d_sockatmarkproto='$d_sockatmarkproto'
21909 d_socket='$d_socket'
21910 d_socklen_t='$d_socklen_t'
21911 d_sockpair='$d_sockpair'
21912 d_socks5_init='$d_socks5_init'
21913 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
21915 d_srand48_r='$d_srand48_r'
21916 d_srandom_r='$d_srandom_r'
21917 d_sresgproto='$d_sresgproto'
21918 d_sresuproto='$d_sresuproto'
21919 d_statblks='$d_statblks'
21920 d_statfs_f_flags='$d_statfs_f_flags'
21921 d_statfs_s='$d_statfs_s'
21922 d_statvfs='$d_statvfs'
21923 d_stdio_cnt_lval='$d_stdio_cnt_lval'
21924 d_stdio_ptr_lval='$d_stdio_ptr_lval'
21925 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
21926 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
21927 d_stdio_stream_array='$d_stdio_stream_array'
21928 d_stdiobase='$d_stdiobase'
21929 d_stdstdio='$d_stdstdio'
21930 d_strchr='$d_strchr'
21931 d_strcoll='$d_strcoll'
21932 d_strctcpy='$d_strctcpy'
21933 d_strerrm='$d_strerrm'
21934 d_strerror='$d_strerror'
21935 d_strerror_r='$d_strerror_r'
21936 d_strftime='$d_strftime'
21937 d_strlcat='$d_strlcat'
21938 d_strlcpy='$d_strlcpy'
21939 d_strtod='$d_strtod'
21940 d_strtol='$d_strtol'
21941 d_strtold='$d_strtold'
21942 d_strtoll='$d_strtoll'
21943 d_strtoq='$d_strtoq'
21944 d_strtoul='$d_strtoul'
21945 d_strtoull='$d_strtoull'
21946 d_strtouq='$d_strtouq'
21947 d_strxfrm='$d_strxfrm'
21948 d_suidsafe='$d_suidsafe'
21949 d_symlink='$d_symlink'
21950 d_syscall='$d_syscall'
21951 d_syscallproto='$d_syscallproto'
21952 d_sysconf='$d_sysconf'
21953 d_sysernlst='$d_sysernlst'
21954 d_syserrlst='$d_syserrlst'
21955 d_system='$d_system'
21956 d_tcgetpgrp='$d_tcgetpgrp'
21957 d_tcsetpgrp='$d_tcsetpgrp'
21958 d_telldir='$d_telldir'
21959 d_telldirproto='$d_telldirproto'
21962 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
21963 d_tm_tm_zone='$d_tm_tm_zone'
21964 d_tmpnam_r='$d_tmpnam_r'
21965 d_truncate='$d_truncate'
21966 d_ttyname_r='$d_ttyname_r'
21967 d_tzname='$d_tzname'
21968 d_u32align='$d_u32align'
21969 d_ualarm='$d_ualarm'
21972 d_union_semun='$d_union_semun'
21973 d_unordered='$d_unordered'
21974 d_unsetenv='$d_unsetenv'
21975 d_usleep='$d_usleep'
21976 d_usleepproto='$d_usleepproto'
21978 d_vendorarch='$d_vendorarch'
21979 d_vendorbin='$d_vendorbin'
21980 d_vendorlib='$d_vendorlib'
21981 d_vendorscript='$d_vendorscript'
21983 d_void_closedir='$d_void_closedir'
21984 d_voidsig='$d_voidsig'
21985 d_voidtty='$d_voidtty'
21986 d_volatile='$d_volatile'
21987 d_vprintf='$d_vprintf'
21988 d_vsnprintf='$d_vsnprintf'
21990 d_waitpid='$d_waitpid'
21991 d_wcstombs='$d_wcstombs'
21992 d_wctomb='$d_wctomb'
21993 d_writev='$d_writev'
21996 db_hashtype='$db_hashtype'
21997 db_prefixtype='$db_prefixtype'
21998 db_version_major='$db_version_major'
21999 db_version_minor='$db_version_minor'
22000 db_version_patch='$db_version_patch'
22001 defvoidused='$defvoidused'
22002 direntrytype='$direntrytype'
22005 doublesize='$doublesize'
22007 drand48_r_proto='$drand48_r_proto'
22008 dynamic_ext='$dynamic_ext'
22014 endgrent_r_proto='$endgrent_r_proto'
22015 endhostent_r_proto='$endhostent_r_proto'
22016 endnetent_r_proto='$endnetent_r_proto'
22017 endprotoent_r_proto='$endprotoent_r_proto'
22018 endpwent_r_proto='$endpwent_r_proto'
22019 endservent_r_proto='$endservent_r_proto'
22020 eunicefix='$eunicefix'
22023 extensions='$extensions'
22025 fflushNULL='$fflushNULL'
22026 fflushall='$fflushall'
22028 firstmakefile='$firstmakefile'
22030 fpossize='$fpossize'
22031 fpostype='$fpostype'
22032 freetype='$freetype'
22035 full_csh='$full_csh'
22036 full_sed='$full_sed'
22037 gccansipedantic='$gccansipedantic'
22038 gccosandvers='$gccosandvers'
22039 gccversion='$gccversion'
22040 getgrent_r_proto='$getgrent_r_proto'
22041 getgrgid_r_proto='$getgrgid_r_proto'
22042 getgrnam_r_proto='$getgrnam_r_proto'
22043 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
22044 gethostbyname_r_proto='$gethostbyname_r_proto'
22045 gethostent_r_proto='$gethostent_r_proto'
22046 getlogin_r_proto='$getlogin_r_proto'
22047 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
22048 getnetbyname_r_proto='$getnetbyname_r_proto'
22049 getnetent_r_proto='$getnetent_r_proto'
22050 getprotobyname_r_proto='$getprotobyname_r_proto'
22051 getprotobynumber_r_proto='$getprotobynumber_r_proto'
22052 getprotoent_r_proto='$getprotoent_r_proto'
22053 getpwent_r_proto='$getpwent_r_proto'
22054 getpwnam_r_proto='$getpwnam_r_proto'
22055 getpwuid_r_proto='$getpwuid_r_proto'
22056 getservbyname_r_proto='$getservbyname_r_proto'
22057 getservbyport_r_proto='$getservbyport_r_proto'
22058 getservent_r_proto='$getservent_r_proto'
22059 getspnam_r_proto='$getspnam_r_proto'
22060 gidformat='$gidformat'
22066 gmtime_r_proto='$gmtime_r_proto'
22067 gnulibc_version='$gnulibc_version'
22069 groupcat='$groupcat'
22070 groupstype='$groupstype'
22073 h_sysfile='$h_sysfile'
22076 html1dir='$html1dir'
22077 html1direxp='$html1direxp'
22078 html3dir='$html3dir'
22079 html3direxp='$html3direxp'
22088 i_arpainet='$i_arpainet'
22089 i_bsdioctl='$i_bsdioctl'
22093 i_dirent='$i_dirent'
22099 i_fp_class='$i_fp_class'
22102 i_ieeefp='$i_ieeefp'
22103 i_inttypes='$i_inttypes'
22104 i_langinfo='$i_langinfo'
22105 i_libutil='$i_libutil'
22106 i_limits='$i_limits'
22107 i_locale='$i_locale'
22108 i_machcthr='$i_machcthr'
22109 i_malloc='$i_malloc'
22111 i_memory='$i_memory'
22112 i_mntent='$i_mntent'
22115 i_neterrno='$i_neterrno'
22116 i_netinettcp='$i_netinettcp'
22120 i_pthread='$i_pthread'
22122 i_rpcsvcdbm='$i_rpcsvcdbm'
22125 i_shadow='$i_shadow'
22127 i_stdarg='$i_stdarg'
22128 i_stddef='$i_stddef'
22129 i_stdlib='$i_stdlib'
22130 i_string='$i_string'
22131 i_sunmath='$i_sunmath'
22132 i_sysaccess='$i_sysaccess'
22133 i_sysdir='$i_sysdir'
22134 i_sysfile='$i_sysfile'
22135 i_sysfilio='$i_sysfilio'
22137 i_sysioctl='$i_sysioctl'
22138 i_syslog='$i_syslog'
22139 i_sysmman='$i_sysmman'
22140 i_sysmode='$i_sysmode'
22141 i_sysmount='$i_sysmount'
22142 i_sysndir='$i_sysndir'
22143 i_sysparam='$i_sysparam'
22144 i_sysresrc='$i_sysresrc'
22145 i_syssecrt='$i_syssecrt'
22146 i_sysselct='$i_sysselct'
22147 i_syssockio='$i_syssockio'
22148 i_sysstat='$i_sysstat'
22149 i_sysstatfs='$i_sysstatfs'
22150 i_sysstatvfs='$i_sysstatvfs'
22151 i_systime='$i_systime'
22152 i_systimek='$i_systimek'
22153 i_systimes='$i_systimes'
22154 i_systypes='$i_systypes'
22155 i_sysuio='$i_sysuio'
22157 i_sysutsname='$i_sysutsname'
22158 i_sysvfs='$i_sysvfs'
22159 i_syswait='$i_syswait'
22160 i_termio='$i_termio'
22161 i_termios='$i_termios'
22163 i_unistd='$i_unistd'
22166 i_values='$i_values'
22167 i_varargs='$i_varargs'
22168 i_varhdr='$i_varhdr'
22170 ignore_versioned_solibs='$ignore_versioned_solibs'
22171 inc_version_list='$inc_version_list'
22172 inc_version_list_init='$inc_version_list_init'
22175 initialinstalllocation='$initialinstalllocation'
22176 installarchlib='$installarchlib'
22177 installbin='$installbin'
22178 installhtml1dir='$installhtml1dir'
22179 installhtml3dir='$installhtml3dir'
22180 installman1dir='$installman1dir'
22181 installman3dir='$installman3dir'
22182 installprefix='$installprefix'
22183 installprefixexp='$installprefixexp'
22184 installprivlib='$installprivlib'
22185 installscript='$installscript'
22186 installsitearch='$installsitearch'
22187 installsitebin='$installsitebin'
22188 installsitehtml1dir='$installsitehtml1dir'
22189 installsitehtml3dir='$installsitehtml3dir'
22190 installsitelib='$installsitelib'
22191 installsiteman1dir='$installsiteman1dir'
22192 installsiteman3dir='$installsiteman3dir'
22193 installsitescript='$installsitescript'
22194 installstyle='$installstyle'
22195 installusrbinperl='$installusrbinperl'
22196 installvendorarch='$installvendorarch'
22197 installvendorbin='$installvendorbin'
22198 installvendorhtml1dir='$installvendorhtml1dir'
22199 installvendorhtml3dir='$installvendorhtml3dir'
22200 installvendorlib='$installvendorlib'
22201 installvendorman1dir='$installvendorman1dir'
22202 installvendorman3dir='$installvendorman3dir'
22203 installvendorscript='$installvendorscript'
22205 issymlink='$issymlink'
22206 ivdformat='$ivdformat'
22209 known_extensions='$known_extensions'
22212 lddlflags='$lddlflags'
22214 ldflags_uselargefiles='$ldflags_uselargefiles'
22215 ldlibpthname='$ldlibpthname'
22222 libsdirs='$libsdirs'
22223 libsfiles='$libsfiles'
22224 libsfound='$libsfound'
22225 libspath='$libspath'
22226 libswanted='$libswanted'
22227 libswanted_uselargefiles='$libswanted_uselargefiles'
22233 localtime_r_proto='$localtime_r_proto'
22234 locincpth='$locincpth'
22235 loclibpth='$loclibpth'
22236 longdblsize='$longdblsize'
22237 longlongsize='$longlongsize'
22238 longsize='$longsize'
22242 lseeksize='$lseeksize'
22243 lseektype='$lseektype'
22246 madlyobj='$madlyobj'
22247 madlysrc='$madlysrc'
22251 make_set_make='$make_set_make'
22252 mallocobj='$mallocobj'
22253 mallocsrc='$mallocsrc'
22254 malloctype='$malloctype'
22256 man1direxp='$man1direxp'
22259 man3direxp='$man3direxp'
22261 mips_type='$mips_type'
22262 mistrustnm='$mistrustnm'
22264 mmaptype='$mmaptype'
22265 modetype='$modetype'
22267 multiarch='$multiarch'
22269 myarchname='$myarchname'
22270 mydomain='$mydomain'
22271 myhostname='$myhostname'
22274 need_va_copy='$need_va_copy'
22275 netdb_hlen_type='$netdb_hlen_type'
22276 netdb_host_type='$netdb_host_type'
22277 netdb_name_type='$netdb_name_type'
22278 netdb_net_type='$netdb_net_type'
22281 nm_so_opt='$nm_so_opt'
22282 nonxs_ext='$nonxs_ext'
22284 nvEUformat='$nvEUformat'
22285 nvFUformat='$nvFUformat'
22286 nvGUformat='$nvGUformat'
22287 nv_preserves_uv_bits='$nv_preserves_uv_bits'
22288 nveformat='$nveformat'
22289 nvfformat='$nvfformat'
22290 nvgformat='$nvgformat'
22293 o_nonblock='$o_nonblock'
22295 old_pthread_create_joinable='$old_pthread_create_joinable'
22296 optimize='$optimize'
22297 orderlib='$orderlib'
22300 otherlibdirs='$otherlibdirs'
22304 patchlevel='$patchlevel'
22305 path_sep='$path_sep'
22308 perl_patchlevel='$perl_patchlevel'
22309 perladmin='$perladmin'
22310 perllibs='$perllibs'
22311 perlpath='$perlpath'
22313 phostname='$phostname'
22319 prefixexp='$prefixexp'
22321 privlibexp='$privlibexp'
22322 procselfexe='$procselfexe'
22323 prototype='$prototype'
22325 quadkind='$quadkind'
22326 quadtype='$quadtype'
22327 randbits='$randbits'
22328 randfunc='$randfunc'
22329 random_r_proto='$random_r_proto'
22330 randseedtype='$randseedtype'
22332 rd_nodata='$rd_nodata'
22333 readdir64_r_proto='$readdir64_r_proto'
22334 readdir_r_proto='$readdir_r_proto'
22335 revision='$revision'
22341 sPRIEUldbl='$sPRIEUldbl'
22342 sPRIFUldbl='$sPRIFUldbl'
22343 sPRIGUldbl='$sPRIGUldbl'
22344 sPRIXU64='$sPRIXU64'
22346 sPRIeldbl='$sPRIeldbl'
22347 sPRIfldbl='$sPRIfldbl'
22348 sPRIgldbl='$sPRIgldbl'
22353 sSCNfldbl='$sSCNfldbl'
22354 sched_yield='$sched_yield'
22355 scriptdir='$scriptdir'
22356 scriptdirexp='$scriptdirexp'
22358 seedfunc='$seedfunc'
22359 selectminbits='$selectminbits'
22360 selecttype='$selecttype'
22361 sendmail='$sendmail'
22362 setgrent_r_proto='$setgrent_r_proto'
22363 sethostent_r_proto='$sethostent_r_proto'
22364 setlocale_r_proto='$setlocale_r_proto'
22365 setnetent_r_proto='$setnetent_r_proto'
22366 setprotoent_r_proto='$setprotoent_r_proto'
22367 setpwent_r_proto='$setpwent_r_proto'
22368 setservent_r_proto='$setservent_r_proto'
22371 sharpbang='$sharpbang'
22372 shmattype='$shmattype'
22373 shortsize='$shortsize'
22376 sig_count='$sig_count'
22377 sig_name='$sig_name'
22378 sig_name_init='$sig_name_init'
22380 sig_num_init='$sig_num_init'
22381 sig_size='$sig_size'
22382 signal_t='$signal_t'
22383 sitearch='$sitearch'
22384 sitearchexp='$sitearchexp'
22386 sitebinexp='$sitebinexp'
22387 sitehtml1dir='$sitehtml1dir'
22388 sitehtml1direxp='$sitehtml1direxp'
22389 sitehtml3dir='$sitehtml3dir'
22390 sitehtml3direxp='$sitehtml3direxp'
22392 sitelib_stem='$sitelib_stem'
22393 sitelibexp='$sitelibexp'
22394 siteman1dir='$siteman1dir'
22395 siteman1direxp='$siteman1direxp'
22396 siteman3dir='$siteman3dir'
22397 siteman3direxp='$siteman3direxp'
22398 siteprefix='$siteprefix'
22399 siteprefixexp='$siteprefixexp'
22400 sitescript='$sitescript'
22401 sitescriptexp='$sitescriptexp'
22402 sizesize='$sizesize'
22403 sizetype='$sizetype'
22407 sockethdr='$sockethdr'
22408 socketlib='$socketlib'
22409 socksizetype='$socksizetype'
22411 spackage='$spackage'
22412 spitshell='$spitshell'
22413 srand48_r_proto='$srand48_r_proto'
22414 srandom_r_proto='$srandom_r_proto'
22416 ssizetype='$ssizetype'
22417 startperl='$startperl'
22419 static_ext='$static_ext'
22421 stdio_base='$stdio_base'
22422 stdio_bufsiz='$stdio_bufsiz'
22423 stdio_cnt='$stdio_cnt'
22424 stdio_filbuf='$stdio_filbuf'
22425 stdio_ptr='$stdio_ptr'
22426 stdio_stream_array='$stdio_stream_array'
22427 strerror_r_proto='$strerror_r_proto'
22430 subversion='$subversion'
22434 targetarch='$targetarch'
22438 timeincl='$timeincl'
22439 timetype='$timetype'
22440 tmpnam_r_proto='$tmpnam_r_proto'
22446 ttyname_r_proto='$ttyname_r_proto'
22455 uidformat='$uidformat'
22461 uquadtype='$uquadtype'
22462 use5005threads='$use5005threads'
22463 use64bitall='$use64bitall'
22464 use64bitint='$use64bitint'
22465 usecrosscompile='$usecrosscompile'
22467 usefaststdio='$usefaststdio'
22468 useithreads='$useithreads'
22469 uselargefiles='$uselargefiles'
22470 uselongdouble='$uselongdouble'
22471 usemallocwrap='$usemallocwrap'
22472 usemorebits='$usemorebits'
22473 usemultiplicity='$usemultiplicity'
22474 usemymalloc='$usemymalloc'
22476 useopcode='$useopcode'
22477 useperlio='$useperlio'
22478 useposix='$useposix'
22479 usereentrant='$usereentrant'
22480 userelocatableinc='$userelocatableinc'
22482 useshrplib='$useshrplib'
22483 usesitecustomize='$usesitecustomize'
22484 usesocks='$usesocks'
22485 usethreads='$usethreads'
22486 usevendorprefix='$usevendorprefix'
22487 usevfork='$usevfork'
22490 uvXUformat='$uvXUformat'
22491 uvoformat='$uvoformat'
22494 uvuformat='$uvuformat'
22495 uvxformat='$uvxformat'
22496 vendorarch='$vendorarch'
22497 vendorarchexp='$vendorarchexp'
22498 vendorbin='$vendorbin'
22499 vendorbinexp='$vendorbinexp'
22500 vendorhtml1dir='$vendorhtml1dir'
22501 vendorhtml1direxp='$vendorhtml1direxp'
22502 vendorhtml3dir='$vendorhtml3dir'
22503 vendorhtml3direxp='$vendorhtml3direxp'
22504 vendorlib='$vendorlib'
22505 vendorlib_stem='$vendorlib_stem'
22506 vendorlibexp='$vendorlibexp'
22507 vendorman1dir='$vendorman1dir'
22508 vendorman1direxp='$vendorman1direxp'
22509 vendorman3dir='$vendorman3dir'
22510 vendorman3direxp='$vendorman3direxp'
22511 vendorprefix='$vendorprefix'
22512 vendorprefixexp='$vendorprefixexp'
22513 vendorscript='$vendorscript'
22514 vendorscriptexp='$vendorscriptexp'
22516 version_patchlevel_string='$version_patchlevel_string'
22517 versiononly='$versiononly'
22519 voidflags='$voidflags'
22522 yaccflags='$yaccflags'
22527 : Add in command line options if available
22528 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22530 : add special variables
22531 $test -f $src/patchlevel.h && \
22532 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
22533 echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
22534 echo "PERL_CONFIG_SH=true" >>config.sh
22536 : propagate old symbols
22537 if $test -f UU/config.sh; then
22538 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
22539 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
22540 $sort | $uniq -u >UU/oldsyms
22541 set X `cat UU/oldsyms`
22547 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
22549 echo "# Variables propagated from previous config.sh file." >>config.sh
22550 for sym in `cat UU/oldsyms`; do
22551 echo " Propagating $hint variable "'$'"$sym..."
22552 eval 'tmp="$'"${sym}"'"'
22554 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
22560 : Finish up by extracting the .SH files
22564 echo "Extraction done."
22574 If you'd like to make any changes to the config.sh file before I begin
22575 to configure things, do it as a shell escape now (e.g. !vi config.sh).
22578 rp="Press return or use a shell escape to edit config.sh:"
22583 *) : in case they cannot read
22584 sh 1>&4 -c "$ans";;
22589 : if this fails, just run all the .SH files by hand
22598 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
22605 Now you need to generate make dependencies by running "$make depend".
22606 You might prefer to run it in background: "$make depend > makedepend.out &"
22607 It can take a while, so you might not want to run it right now.
22612 rp="Run $make depend now?"
22616 $make depend && echo "Now you must run '$make'."
22619 echo "You must run '$make depend' then '$make'."
22622 elif test -f [Mm]akefile; then
22624 echo "Now you must run a $make."
22626 echo "Configure done."
22629 if $test -f Policy.sh; then
22632 If you compile $package on a different machine or from a different object
22633 directory, copy the Policy.sh file from this object directory to the
22634 new one before you run Configure -- this will help you with most of
22635 the policy defaults.
22639 if $test -f config.msg; then
22640 echo "Hmm. I also noted the following information while running:"
22642 $cat config.msg >&4
22645 $rm -f kit*isdone ark*isdone