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 Nov 8 17:31:20 CET 2006 [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
334 initialinstalllocation=''
362 d_attribute_format=''
363 d_attribute_malloc=''
364 d_attribute_nonnull=''
365 d_attribute_noreturn=''
367 d_attribute_unused=''
368 d_attribute_warn_unused_result=''
371 d_builtin_choose_expr=''
374 d_c99_variadic_macros=''
421 endhostent_r_proto=''
427 endprotoent_r_proto=''
433 endservent_r_proto=''
485 gethostbyaddr_r_proto=''
487 gethostbyname_r_proto=''
489 gethostent_r_proto=''
501 getnetbyaddr_r_proto=''
503 getnetbyname_r_proto=''
517 d_getprotobyname_r=''
518 getprotobyname_r_proto=''
519 d_getprotobynumber_r=''
520 getprotobynumber_r_proto=''
522 getprotoent_r_proto=''
534 getservbyname_r_proto=''
536 getservbyport_r_proto=''
538 getservent_r_proto=''
562 d_libm_lib_version=''
565 d_localtime_r_needs_tzset=''
576 d_malloc_good_size=''
618 d_old_pthread_create_joinable=''
619 old_pthread_create_joinable=''
621 d_pthread_attr_setscope=''
660 sethostent_r_proto=''
677 setprotoent_r_proto=''
689 setservent_r_proto=''
722 d_sprintf_returns_strlen=''
737 d_stdio_ptr_lval_nochange_cnt=''
738 d_stdio_ptr_lval_sets_cnt=''
941 d_inc_version_list=''
943 inc_version_list_init=''
962 ignore_versioned_solibs=''
1026 d_perl_otherlibdirs=''
1034 api_versionstring=''
1040 version_patchlevel_string=''
1044 d_nv_preserves_uv=''
1045 d_nv_zero_is_allbits_zero=''
1056 nv_preserves_uv_bits=''
1128 installsitehtml1dir=''
1131 installsitehtml3dir=''
1138 installsiteman1dir=''
1141 installsiteman3dir=''
1146 installsitescript=''
1161 d_stdio_stream_array=''
1162 stdio_stream_array=''
1173 ccflags_uselargefiles=''
1174 ldflags_uselargefiles=''
1175 libswanted_uselargefiles=''
1195 installvendorarch=''
1202 installvendorhtml1dir=''
1204 vendorhtml1direxp=''
1205 installvendorhtml3dir=''
1207 vendorhtml3direxp=''
1213 installvendorman1dir=''
1216 installvendorman3dir=''
1223 installvendorscript=''
1235 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1238 : We must find out about Eunice early
1240 if test -f /etc/unixtovms; then
1241 eunicefix=/etc/unixtovms
1243 if test -f /etc/unixtovms.exe; then
1244 eunicefix=/etc/unixtovms.exe
1247 : Set executable suffix now -- needed before hints available
1248 if test -f "/libs/version.library"; then
1251 elif test -f "/system/gnu_library/bin/ar.pm"; then
1254 elif test -n "$DJGPP"; then
1257 elif test -d c:/. -o -n "$is_os2" ; then
1266 : set useposix=false in your hint file to disable the POSIX extension.
1268 : set useopcode=false in your hint file to disable the Opcode extension.
1270 : Trailing extension. Override this in a hint file, if needed.
1271 : Extra object files, if any, needed on this platform.
1274 : Possible local include directories to search.
1275 : Set locincpth to "" in a hint file to defeat local include searches.
1276 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1277 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1279 : no include file wanted by default
1282 : Enable -DEBUGGING and -DDEBUGGING from the command line
1288 : change the next line if compiling for Xenix/286 on Xenix/386
1289 xlibpth='/usr/lib/386 /lib/386'
1290 : Possible local library directories to search.
1291 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1292 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1294 : general looking path for locating libraries
1295 glibpth="/lib /usr/lib $xlibpth"
1296 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1297 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1298 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1300 : Private path used by Configure to find libraries. Its value
1301 : is prepended to libpth. This variable takes care of special
1302 : machines, like the mips. Usually, it should be empty.
1305 : default library list
1307 : some systems want to use only the non-versioned libso:s
1308 ignore_versioned_solibs=''
1313 ccflags_uselargefiles=''
1314 ldflags_uselargefiles=''
1315 libswanted_uselargefiles=''
1316 : set usemultiplicity on the Configure command line to enable multiplicity.
1317 : set usesocks on the Configure command line to enable socks.
1318 : set usethreads on the Configure command line to enable threads.
1319 usereentrant='undef'
1320 : full support for void wanted by default
1323 : List of libraries we want.
1324 : If anyone needs extra -lxxx, put those in a hint file.
1325 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1326 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1327 : We probably want to search /usr/shlib before most other libraries.
1328 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1329 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1330 glibpth="/usr/shlib $glibpth"
1331 : Do not use vfork unless overridden by a hint file.
1334 : Find the basic shell for Bourne shell scripts
1338 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1341 if test -f "$xxx"; then
1344 : Build up a list and do a single loop so we can 'break' out.
1345 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1346 for xxx in sh bash ksh pdksh ash; do
1348 try="$try ${p}/${xxx}"
1352 if test -f "$xxx"; then
1355 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1358 elif test -f "$xxx.exe"; then
1369 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1371 Usually it's in /bin/sh. How did you even get this far?
1372 Please contact me (Perl Maintainers) at perlbug@perl.org and
1373 we'll try to straighten this all out.
1379 : see if sh knows # comments
1380 if `$sh -c '#' >/dev/null 2>&1`; then
1384 test -f $xcat$_exe || xcat=/usr/bin/cat
1385 if test ! -f $xcat$_exe; then
1386 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1387 if test -f $p/cat$_exe; then
1392 if test ! -f $xcat$_exe; then
1393 echo "Can't find cat anywhere!"
1397 echo "#!$xcat" >sharp
1401 if test -s today; then
1404 echo "#! $xcat" > sharp
1408 if test -s today; then
1416 echo "Your $sh doesn't grok # comments--I will strip them later on."
1419 echo "exec grep -v '^[ ]*#'" >spitshell
1421 $eunicefix spitshell
1422 spitshell=`pwd`/spitshell
1424 echo "I presume that if # doesn't work, #! won't work either!"
1429 : figure out how to guarantee sh startup
1431 '') startsh=${sharpbang}${sh} ;;
1443 : echo "Yup, it does."
1445 echo "Hmm... '$startsh' does not guarantee sh startup..."
1446 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1451 : Save command line options in file UU/cmdline.opt for later use in
1452 : generating config.sh.
1453 cat > cmdline.opt <<EOSH
1454 # Configure command line arguments.
1463 cat >>cmdline.opt <<EOSH
1464 config_arg$argn='$arg'
1466 # Extreme backslashitis: replace each ' by '"'"'
1467 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1470 arg_exp=`cat cmdl.opt`
1471 args_exp="$args_exp$args_sep'$arg_exp'"
1472 argn=`expr $argn + 1`
1475 # args_exp is good for restarting self: eval "set X $args_exp"; shift; $0 "$@"
1476 # used by ./hints/os2.sh
1479 : produce awk script to parse command line options
1480 cat >options.awk <<'EOF'
1482 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1484 len = length(optstr);
1485 for (i = 1; i <= len; i++) {
1486 c = substr(optstr, i, 1);
1487 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1498 if (substr(str, 1, 1) != "-") {
1499 printf("'%s'\n", str);
1503 for (i = 2; i <= len; i++) {
1504 c = substr(str, i, 1);
1506 printf("-%s\n", substr(str, i));
1512 printf("'%s'\n", substr(str, i + 1));
1525 : process the command line options
1526 set X `for arg in "$@"; do echo "X$arg"; done |
1527 sed -e s/X// | awk -f options.awk`
1532 : set up default values
1542 rm -f optdef.sh posthint.sh
1543 cat >optdef.sh <<EOS
1549 while test $# -gt 0; do
1551 -d) shift; fastread=yes;;
1552 -e) shift; alldone=cont;;
1556 if test -r "$1"; then
1559 echo "$me: cannot read config file $1." >&2
1564 -h) shift; error=true;;
1565 -r) shift; reuseval=true;;
1566 -s) shift; silent=true; realsilent=true;;
1567 -E) shift; alldone=exit;;
1568 -K) shift; knowitall=true;;
1569 -O) shift; override=true;;
1570 -S) shift; silent=true; extractsh=true;;
1575 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1576 echo "$me: ignoring -D $1" >&2
1579 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1580 *) echo "$1='define'" >> optdef.sh;;
1587 *=) echo "$1" >> optdef.sh;;
1589 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1590 echo "$me: ignoring -U $1" >&2
1592 *) echo "$1='undef'" >> optdef.sh;;
1603 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1607 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1608 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1614 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1615 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1616 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1617 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1618 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1619 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1625 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1627 echo "$yyy=''" >> posthint.sh ;;
1632 echo "$yyy='$zzz'" >> posthint.sh ;;
1634 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1636 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1641 echo "$yyy=$zzz" >> posthint.sh ;;
1642 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1646 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1649 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1657 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1658 [-U symbol] [-U symbol=] [-A command:symbol...]
1659 -d : use defaults for all answers.
1660 -e : go on without questioning past the production of config.sh.
1661 -f : specify an alternate default configuration file.
1662 -h : print this help message and exit (with an error status).
1663 -r : reuse C symbols value if possible (skips costly nm extraction).
1664 -s : silent mode, only echoes questions and essential information.
1665 -D : define symbol to have some value:
1666 -D symbol symbol gets the value 'define'
1667 -D symbol=value symbol gets the value 'value'
1668 -E : stop at the end of questions, after having produced config.sh.
1669 -K : do not use unless you know what you are doing.
1670 -O : let -D and -U override definitions from loaded configuration file.
1671 -S : perform variable substitutions on all .SH files (can mix with -f)
1672 -U : undefine symbol:
1673 -U symbol symbol gets the value 'undef'
1674 -U symbol= symbol gets completely empty
1675 -A : manipulate symbol after the platform specific hints have been applied:
1676 -A symbol=value append " "value to symbol
1677 -A append:symbol=value append value to symbol
1678 -A define:symbol=value define symbol to have value
1679 -A clear:symbol define symbol to be ''
1680 -A define:symbol define symbol to be 'define'
1681 -A eval:symbol=value define symbol to be eval of value
1682 -A prepend:symbol=value prepend value to symbol
1683 -A undef:symbol define symbol to be 'undef'
1684 -A undef:symbol= define symbol to be ''
1685 -V : print version number and exit (with a zero status).
1692 case "$fastread$alldone" in
1695 case "$extractsh" in
1698 if test ! -t 0; then
1699 echo "Say 'sh Configure', not 'sh <Configure'"
1709 true) exec 1>/dev/null;;
1712 : run the defines and the undefines, if any, but leave the file out there...
1715 : create the posthint manipulation script and leave the file out there...
1720 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1721 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1722 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1723 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1724 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1727 : Some greps do not return status, grrr.
1728 echo "grimblepritz" >grimble
1729 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1731 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1737 : the following should work in any shell
1741 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1742 cat >contains <<'EOSS'
1743 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1748 : Find the path to the source tree
1751 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1755 *) src=`cd ../$src && pwd` ;;
1768 if test -f $rsrc/Configure && \
1769 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1771 : found it, so we are ok.
1774 for src in . .. ../.. ../../.. ../../../..; do
1775 if test -f ../$src/Configure && \
1776 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1787 Sorry, I can't seem to locate the source dir for $package. Please start
1788 Configure with an explicit path -- i.e. /some/path/Configure.
1796 echo "Sources for $package found in \"$src\"." >&4
1800 : script used to extract .SH files with variable substitutions
1801 cat >extract <<'EOS'
1803 echo "Doing variable substitutions on .SH files..."
1804 if test -f MANIFEST; then
1805 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1807 echo "(Looking for .SH files under the source directory.)"
1808 set x `(cd "$src"; find . -name "*.SH" -print)`
1812 0) set x `(cd "$src"; echo *.SH)`; shift;;
1814 if test ! -f "$src/$1"; then
1820 while test $name; do
1821 if test ! -d "$name"; then
1822 create="$name $create";
1823 name=`echo $name | sed -e "s|^[^/]*$||"`;
1824 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1829 for file in $create; do
1838 dir=`expr X$file : 'X\(.*\)/'`
1839 file=`expr X$file : 'X.*/\(.*\)'`
1840 (cd "$dir" && . ./$file)
1850 dir=`expr X$file : 'X\(.*\)/'`
1851 file=`expr X$file : 'X.*/\(.*\)'`
1852 (set x $dir; shift; eval $mkdir_p)
1853 sh <"$src/$dir/$file"
1862 if test -f "$src/config_h.SH"; then
1863 if test ! -f config.h; then
1864 : oops, they left it out of MANIFEST, probably, so do it anyway.
1865 . "$src/config_h.SH"
1870 : extract files and exit if asked to do so
1871 case "$extractsh" in
1873 case "$realsilent" in
1877 case "$config_sh" in
1878 '') config_sh='config.sh';;
1881 echo "Fetching answers from $config_sh..."
1884 test "$override" && . ./optdef.sh
1888 echo "Extraction done."
1893 : Eunice requires " " instead of "", can you believe it
1896 echo "Beginning of configuration questions for $package."
1898 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1900 : first determine how to suppress newline on echo command
1902 echo "Checking echo to see how to suppress newlines..."
1903 (echo "hi there\c" ; echo " ") >.echotmp
1904 if $contains c .echotmp >/dev/null 2>&1 ; then
1915 echo $n "The star should be here-->$c"
1919 : Now test for existence of everything in MANIFEST
1921 if test -f "$rsrc/MANIFEST"; then
1922 echo "First let's make sure your kit is complete. Checking..." >&4
1923 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | (split -l 50 2>/dev/null || split -50)
1926 for filelist in x??; do
1927 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` >/dev/null 2>>"$tmppwd/missing")
1929 if test -s missing; then
1933 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1935 You have the option of continuing the configuration process, despite the
1936 distinct possibility that your kit is damaged, by typing 'y'es. If you
1937 do, don't blame me if something goes wrong. I advise you to type 'n'o
1938 and contact the author (perlbug@perl.org).
1941 echo $n "Continue? [n] $c" >&4
1945 echo "Continuing..." >&4
1949 echo "ABORTING..." >&4
1954 echo "Looks good..."
1957 echo "There is no MANIFEST file. I hope your kit is complete !"
1962 : Find the appropriate value for a newline for tr
1963 if test -n "$DJGPP"; then
1966 if test X"$trnl" = X; then
1967 case "`echo foo|tr '\n' x 2>/dev/null`" in
1971 if test X"$trnl" = X; then
1972 case "`echo foo|tr '\012' x 2>/dev/null`" in
1973 foox) trnl='\012' ;;
1976 if test X"$trnl" = X; then
1977 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
1978 fooxy) trnl='\n\r' ;;
1981 if test X"$trnl" = X; then
1984 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1990 : compute the number of columns on the terminal for proper question formatting
1995 : set up the echo used in my read
1996 myecho="case \"\$xxxm\" in
1997 '') echo $n \"\$rp $c\" >&4;;
1999 '') echo $n \"[\$xxxm] $c\";;
2001 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2003 echo $n \"[\$xxxm] $c\" >&4
2005 echo $n \"\$rp [\$xxxm] $c\" >&4
2011 : now set up to do reads with possible shell escape and default assignment
2017 case "\$fastread" in
2018 yes) case "\$dflt" in
2021 case "\$silent-\$rp" in
2026 *) case "\$silent" in
2027 true) case "\$rp" in
2032 while expr "X\$ans" : "X!" >/dev/null; do
2036 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2044 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2053 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2058 echo "(OK, I'll run with -d after this question.)" >&4
2061 echo "*** Sorry, \$1 not supported yet." >&4
2071 echo "*** Substitution done -- please confirm."
2073 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2078 echo "*** Error -- try again."
2085 case "\$ans\$xxxm\$nostick" in
2097 : create .config dir to save info across Configure sessions
2098 test -d ../.config || mkdir ../.config
2099 cat >../.config/README <<EOF
2100 This directory created by Configure to save information that should
2101 persist across sessions for $package.
2103 You may safely delete it if you wish.
2106 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2108 $define|true|[yY]*) ;;
2109 *) case "$xversion" in
2112 *** WHOA THERE!!! ***
2114 This is an UNSTABLE DEVELOPMENT release.
2115 The version of this $package distribution is $xversion, that is, odd,
2116 (as opposed to even) and that signifies a development release.
2117 If you want a maintenance release, you want an even-numbered version.
2119 Do ***NOT*** install this into production use.
2120 Data corruption and crashes are possible.
2122 It is most seriously suggested that you do not continue any further
2123 unless you want to help in developing and debugging Perl.
2125 If you *still* want to build perl, you can answer 'y' now,
2126 or pass -Dusedevel to Configure.
2129 rp='Do you really want to continue?'
2133 [yY]) echo >&4 "Okay, continuing."
2134 usedevel="$define" ;;
2135 *) echo >&4 "Okay, bye."
2145 case "$versiononly" in
2146 '') versiononly="$define" ;;
2148 case "$installusrbinperl" in
2149 '') installusrbinperl="$undef" ;;
2154 : general instructions
2157 user=`(logname) 2>/dev/null`
2159 '') user=`whoami 2>&1`;;
2161 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2164 rp='Would you like to see the instructions?'
2175 This installation shell script will examine your system and ask you questions
2176 to determine how the perl5 package should be installed. If you get
2177 stuck on a question, you may use a ! shell escape to start a subshell or
2178 execute a command. Many of the questions will have default answers in square
2179 brackets; typing carriage return will give you the default.
2181 On some of the questions which ask for file or directory names you are allowed
2182 to use the ~name construct to specify the login directory belonging to "name",
2183 even if you don't have a shell which knows about that. Questions where this is
2184 allowed will be marked "(~name ok)".
2188 dflt='Type carriage return to continue'
2192 The prompter used in this script allows you to use shell variables and
2193 backticks in your answers. You may use $1, $2, etc... to refer to the words
2194 in the default answer, as if the default line was a set of arguments given to a
2195 script shell. This means you may also use $* to repeat the whole default line,
2196 so you do not have to re-type everything to add something to the default.
2198 Everytime there is a substitution, you will have to confirm. If there is an
2199 error (e.g. an unmatched backtick), the default answer will remain unchanged
2200 and you will be prompted again.
2202 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2203 the questions and use the computed defaults (or the previous answers if there
2204 was already a config.sh file). Type 'Configure -h' for a list of options.
2205 You may also start interactively and then answer '& -d' at any prompt to turn
2206 on the non-interactive behaviour for the remainder of the execution.
2212 Much effort has been expended to ensure that this shell script will run on any
2213 Unix system. If despite that it blows up on yours, your best bet is to edit
2214 Configure and run it again. If you can't run Configure for some reason,
2215 you'll have to generate a config.sh file by hand. Whatever problems you
2216 have, let me (perlbug@perl.org) know how I blew it.
2218 This installation script affects things in two ways:
2220 1) it may do direct variable substitutions on some of the files included
2222 2) it builds a config.h file for inclusion in C programs. You may edit
2223 any of these files as the need arises after running this script.
2225 If you make a mistake on a question, there is no easy way to back up to it
2226 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2227 files. Configure will offer to let you do this before it runs the SH files.
2230 dflt='Type carriage return to continue'
2232 case "$firsttime" in
2233 true) echo $user >>../.config/instruct;;
2237 : find out where common programs are
2239 echo "Locating common programs..." >&4
2252 if test -d \$dir/\$thing; then
2258 for thisthing in \$dir/\$thing; do
2259 : just loop through to pick last item
2261 if test -f \$thisthing; then
2264 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2267 elif test -f \$dir/\$thing.exe; then
2268 if test -n "$DJGPP"; then
2269 echo \$dir/\$thing.exe
2270 elif test "$eunicefix" != ":"; then
2271 : on Eunice apparently
2325 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2326 pth="$pth /lib /usr/lib"
2327 for file in $loclist; do
2331 if test -f "$xxx"; then
2334 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2335 xxx=`./loc $file $file $pth`
2338 '') xxx=`./loc $file $file $pth`;;
2339 *) xxx=`./loc $xxx $xxx $pth`;;
2341 eval $file=$xxx$_exe
2345 echo $file is in $xxx.
2348 echo $file is in $xxx.
2351 echo "I don't know where '$file' is, and my life depends on it." >&4
2352 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2358 echo "Don't worry if any of the following aren't found..."
2360 for file in $trylist; do
2364 if test -f "$xxx"; then
2367 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2368 xxx=`./loc $file $file $pth`
2371 '') xxx=`./loc $file $file $pth`;;
2372 *) xxx=`./loc $xxx $xxx $pth`;;
2374 eval $file=$xxx$_exe
2378 echo $file is in $xxx.
2381 echo $file is in $xxx.
2384 echo "I don't see $file out there, $say."
2391 echo "Substituting grep for egrep."
2398 echo "Substituting cp for ln."
2407 echo "I can't find make or gmake, and my life depends on it." >&4
2408 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2416 *) # We can't have osname yet.
2417 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2418 # Assume that gmake, if found, is definitely GNU make
2419 # and prefer it over the system make.
2420 echo "Substituting gmake for make."
2428 echo "Hopefully test is built into your sh."
2431 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2432 echo "Using the test built into your sh."
2440 echo "Hopefully echo is built into your sh."
2445 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2446 $echo $n "hi there$c" >foo1
2447 echo $n "hi there$c" >foo2
2448 if cmp foo1 foo2 >/dev/null 2>&1; then
2449 echo "They are compatible. In fact, they may be identical."
2456 They are not compatible! You are probably running ksh on a non-USG system.
2457 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2458 have echo built in and we may have to run some Bourne shell scripts. That
2459 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2462 $echo $n "The star should be here-->$c"
2472 cat <<'EOSC' >>trygcc
2477 int main(int argc, char *argv[]) {
2481 if $cc -o try $ccflags $ldflags try.c; then
2484 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2490 case "`$cc -v -c try.c 2>&1`" in
2493 if $test X"$trygcc" = Xyes; then
2494 if gcc -o try -c try.c; then
2496 echo "You seem to have a working gcc, though." >&4
2497 rp="Would you like to use it?"
2499 if $test -f myread; then
2502 if $test -f UU/myread; then
2505 echo "Cannot find myread, sorry. Aborting." >&2
2510 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2511 if $test -f usethreads.cbu; then
2514 *** However, any setting of the C compiler flags (e.g. for thread support)
2515 *** has been lost. It may be necessary to pass -Dcc=gcc to Configure
2516 *** (together with e.g. -Dusethreads).
2532 cat <<'EOSC' >>checkcc
2537 int main(int argc, char *argv[]) {
2541 if $cc -o try $ccflags $ldflags try.c; then
2544 if $test X"$despair" = Xyes; then
2545 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2548 You need to find a working C compiler.
2549 Either (purchase and) install the C compiler supplied by your OS vendor,
2550 or for a free C compiler try http://gcc.gnu.org/
2551 I cannot continue any further, aborting.
2560 : determine whether symbolic links are supported
2563 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2564 echo "Symbolic links are supported." >&4
2567 echo "Symbolic links are NOT supported." >&4
2572 : determine whether symbolic links are supported
2576 echo "Checking how to test for symbolic links..." >&4
2578 if $test "X$issymlink" = X; then
2580 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2581 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2583 if test $? = 0; then
2586 echo "Your builtin 'test -h' may be broken." >&4
2589 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2592 if test -f "$p/$test"; then
2601 echo "Trying external '$test -h'." >&4
2602 issymlink="$test -h"
2603 if $test ! -h sym >/dev/null 2>&1; then
2604 echo "External '$test -h' is broken, too." >&4
2612 if $test "X$issymlink" = X; then
2613 if $test -L sym 2>/dev/null; then
2614 issymlink="$test -L"
2615 echo "The builtin '$test -L' worked." >&4
2618 if $test "X$issymlink" != X; then
2619 echo "You can test for symbolic links with '$issymlink'." >&4
2621 echo "I do not know how you can test for symbolic links." >&4
2625 *) echo "No symbolic links, so not testing for their testing..." >&4
2631 case "$mksymlinks" in
2634 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2637 *) case "$lns:$issymlink" in
2638 *"ln"*" -s:"*"test -"?)
2639 echo "Creating the symbolic links..." >&4
2640 echo "(First creating the subdirectories...)" >&4
2642 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2644 test -z "$directory" && break
2648 if test ! -d t/base; then
2649 echo "Failed to create the subdirectories. Aborting." >&4
2652 echo "(Then creating the symlinks...)" >&4
2653 awk '{print $1}' $src/MANIFEST | while true; do
2655 test -z "$filename" && break
2656 if test -f $filename; then
2657 if $issymlink $filename; then
2661 if test -f $filename; then
2662 echo "$filename already exists, not symlinking."
2664 ln -s $src/$filename $filename
2668 if test ! -f t/base/lex.t; then
2669 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2674 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2683 case "$usecrosscompile" in
2685 $echo "Cross-compiling..."
2688 *-*-gcc) # A cross-compiling gcc, probably.
2689 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2691 # leave out ld, choosing it is more complex
2693 ranlib=$targetarch-ranlib
2694 $echo 'extern int foo;' > try.c
2695 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2697 if $test $# -gt 0; then
2699 incpth="`$echo $incpth|$sed 's/^ //'`"
2700 echo "Guessing incpth '$incpth'." >&4
2702 j="`$echo $i|$sed 's,/include$,/lib,'`"
2703 if $test -d $j; then
2707 libpth="`$echo $libpth|$sed 's/^ //'`"
2708 echo "Guessing libpth '$libpth'." >&4
2713 case "$targetarch" in
2714 '') echo "Targetarch not defined." >&4; croak=y ;;
2715 *) echo "Using targetarch $targetarch." >&4 ;;
2718 '') echo "Incpth not defined." >&4; croak=y ;;
2719 *) echo "Using incpth '$incpth'." >&4 ;;
2722 '') echo "Libpth not defined." >&4; croak=y ;;
2723 *) echo "Using libpth '$libpth'." >&4 ;;
2726 '') for i in $incpth; do
2727 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2729 echo "Guessing usrinc $usrinc." >&4
2734 '') echo "Usrinc not defined." >&4; croak=y ;;
2737 *) echo "Using usrinc $usrinc." >&4 ;;
2739 case "$targethost" in
2740 '') echo "Targethost not defined." >&4; croak=y ;;
2741 *) echo "Using targethost $targethost." >&4
2746 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2749 /*) run=$src/Cross/run
2750 targetmkdir=$src/Cross/mkdir
2752 from=$src/Cross/from
2754 *) pwd=`$test -f ../Configure & cd ..; pwd`
2756 targetmkdir=$pwd/Cross/mkdir
2758 from=$pwd/Cross/from
2761 case "$targetrun" in
2762 '') targetrun=ssh ;;
2767 case "$targetfrom" in
2768 '') targetfrom=scp ;;
2772 from=$from-$targetfrom
2773 case "$targetdir" in
2775 echo "Guessing targetdir $targetdir." >&4
2778 case "$targetuser" in
2780 echo "Guessing targetuser $targetuser." >&4
2783 case "$targetfrom" in
2787 case "$targetrun" in
2799 '') cwd=$targetdir ;;
2803 if $test ! -f \$exe.xok; then
2807 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2810 *) echo "Unknown targetrun '$targetrun'" >&4
2814 case "$targetmkdir" in
2816 cat >$targetmkdir <<EOF
2818 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2820 $chmod a+rx $targetmkdir
2822 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2834 $targetmkdir \`dirname \$f\`
2835 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2838 $targetmkdir $targetdir/\`dirname \$f\`
2839 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2852 $mkdir -p $targetdir/\`dirname \$f\`
2853 $cp \$f $targetdir/\$f || exit 1
2856 $targetmkdir $targetdir/\`dirname \$f\`
2857 $cp \$f $targetdir/\$f || exit 1
2864 *) echo "Unknown targetto '$targetto'" >&4
2868 case "$targetfrom" in
2875 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2880 cp) cat >$from <<EOF
2885 cp $targetdir/\$f . || exit 1
2890 *) echo "Unknown targetfrom '$targetfrom'" >&4
2894 if $test ! -f $run; then
2895 echo "Target 'run' script '$run' not found." >&4
2899 if $test ! -f $to; then
2900 echo "Target 'to' script '$to' not found." >&4
2904 if $test ! -f $from; then
2905 echo "Target 'from' script '$from' not found." >&4
2909 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2913 Using '$run' for remote execution,
2914 and '$from' and '$to'
2915 for remote file transfer.
2921 usecrosscompile='undef'
2926 : see whether [:lower:] and [:upper:] are supported character classes
2928 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2930 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2934 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
2935 # (0xd9 and 0xe2), therefore that is a nice testing point.
2936 if test "X$up" = X -o "X$low" = X; then
2937 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
2943 if test "X$up" = X -o "X$low" = X; then
2944 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
2950 if test "X$up" = X -o "X$low" = X; then
2951 case "`echo RS | od -x 2>/dev/null`" in
2953 echo "Hey, this might be EBCDIC." >&4
2954 if test "X$up" = X -o "X$low" = X; then
2955 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2956 rs) up='[A-IJ-RS-Z]'
2961 if test "X$up" = X -o "X$low" = X; then
2962 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2972 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
2974 echo "Using $up and $low to convert case." >&4
2977 echo "I don't know how to translate letters from upper to lower case." >&4
2978 echo "Your tr is not acting any way I know of." >&4
2982 : set up the translation script tr, must be called with ./tr of course
2986 '[A-Z][a-z]') exec $tr '$up' '$low';;
2987 '[a-z][A-Z]') exec $tr '$low' '$up';;
2994 : Try to determine whether config.sh was made on this system
2995 case "$config_sh" in
2997 myuname=`$uname -a 2>/dev/null`
2998 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2999 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3000 # because the A-Z/a-z are not consecutive.
3001 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
3002 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3003 newmyuname="$myuname"
3005 case "$knowitall" in
3007 if test -f ../config.sh; then
3008 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3009 eval "`grep myuname= ../config.sh`"
3011 if test "X$myuname" = "X$newmyuname"; then
3019 : Get old answers from old config file if Configure was run on the
3020 : same system, otherwise use the hints.
3023 if test -f config.sh; then
3025 rp="I see a config.sh file. Shall I use it to set the defaults?"
3028 n*|N*) echo "OK, I'll ignore it."
3029 mv config.sh config.sh.old
3030 myuname="$newmyuname"
3032 *) echo "Fetching default answers from your old config.sh file..." >&4
3040 : Older versions did not always set $sh. Catch re-use of such
3050 if test ! -f config.sh; then
3053 First time through, eh? I have some defaults handy for some systems
3054 that need some extra help getting the Configure answers right:
3057 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3059 : Half the following guesses are probably wrong... If you have better
3060 : tests or hints, please send them to perlbug@perl.org
3061 : The metaconfig authors would also appreciate a copy...
3062 $test -f /irix && osname=irix
3063 $test -f /xenix && osname=sco_xenix
3064 $test -f /dynix && osname=dynix
3065 $test -f /dnix && osname=dnix
3066 $test -f /lynx.os && osname=lynxos
3067 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3068 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3069 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3070 $test -f /bin/mips && /bin/mips && osname=mips
3071 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3072 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3073 $test -d /usr/apollo/bin && osname=apollo
3074 $test -f /etc/saf/_sactab && osname=svr4
3075 $test -d /usr/include/minix && osname=minix
3076 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3077 if $test -d /MachTen -o -d /MachTen_Folder; then
3079 if $test -x /sbin/version; then
3080 osvers=`/sbin/version | $awk '{print $2}' |
3081 $sed -e 's/[A-Za-z]$//'`
3082 elif $test -x /usr/etc/version; then
3083 osvers=`/usr/etc/version | $awk '{print $2}' |
3084 $sed -e 's/[A-Za-z]$//'`
3090 $test -f /sys/posix.dll &&
3091 $test -f /usr/bin/what &&
3092 set X `/usr/bin/what /sys/posix.dll` &&
3093 $test "$3" = UWIN &&
3097 if $test -f $uname; then
3105 umips) osname=umips ;;
3108 [23]100) osname=mips ;;
3109 next*) osname=next ;;
3111 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3112 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3115 elif $test -f /etc/kconfig; then
3117 if test "$lns" = "$ln -s"; then
3119 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3121 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3128 if test -n "$DJGPP"; then
3137 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3139 # oslevel can fail with:
3140 # oslevel: Unable to acquire lock.
3141 *not\ found) osvers="$4"."$3" ;;
3142 '<3240'|'<>3240') osvers=3.2.0 ;;
3143 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3144 '=3250'|'>3250') osvers=3.2.5 ;;
3148 bsd386) osname=bsd386
3151 cygwin*) osname=cygwin
3154 *dc.osx) osname=dcosx
3160 domainos) osname=apollo
3166 dragonfly) osname=dragonfly
3169 dynixptx*) osname=dynixptx
3170 osvers=`echo "$4"|sed 's/^v//'`
3172 freebsd) osname=freebsd
3174 genix) osname=genix ;;
3178 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3194 netbsd*) osname=netbsd
3197 news-os) osvers="$3"
3199 4*) osname=newsos4 ;;
3203 next*) osname=next ;;
3204 nonstop-ux) osname=nonstopux ;;
3205 openbsd) osname=openbsd
3211 POSIX-BC | posix-bc ) osname=posix-bc
3214 powerux | power_ux | powermax_os | powermaxos | \
3215 powerunix | power_unix) osname=powerux
3221 solaris) osname=solaris
3223 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3230 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3234 titanos) osname=titanos
3243 ultrix) osname=ultrix
3246 osf1|mls+) case "$5" in
3249 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3252 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3255 hp*) osname=hp_osf1 ;;
3256 mips) osname=mips_osf1 ;;
3259 # UnixWare 7.1.2 is known as Open UNIX 8
3260 openunix|unixware) osname=svr5
3268 $2) case "$osname" in
3272 : svr4.x or possibly later
3282 if test -f /stand/boot ; then
3283 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3284 if test -n "$INITPROG" -a -f "$INITPROG"; then
3285 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3286 if test -n "$isesix"; then
3294 *) if test -f /etc/systemid; then
3296 set `echo $3 | $sed 's/\./ /g'` $4
3297 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3299 elif $test -f $src/hints/sco_$1_$2.sh; then
3301 elif $test -f $src/hints/sco_$1.sh; then
3306 '') : Still unknown. Probably a generic Sys V.
3315 *) case "$osname" in
3316 '') : Still unknown. Probably a generic BSD.
3324 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3325 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3326 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3329 $rm -f UU/kernel.what
3330 elif test -d c:/. -o -n "$is_os2" ; then
3337 case "$targetarch" in
3340 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3345 : Now look for a hint file osname_osvers, unless one has been
3346 : specified already.
3349 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3350 : Also try without trailing minor version numbers.
3351 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3352 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3353 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3354 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3357 *) case "$osvers" in
3360 *) if $test -f $src/hints/$file.sh ; then
3362 elif $test -f $src/hints/$xfile.sh ; then
3364 elif $test -f $src/hints/$xxfile.sh ; then
3366 elif $test -f $src/hints/$xxxfile.sh ; then
3368 elif $test -f $src/hints/$xxxxfile.sh ; then
3370 elif $test -f "$src/hints/${osname}.sh" ; then
3379 if $test -f Policy.sh ; then
3382 none) dflt="Policy" ;;
3383 *) dflt="Policy $dflt" ;;
3388 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3392 if $test -f Policy.sh ; then
3395 There's also a Policy hint file available, which should make the
3396 site-specific (policy) questions easier to answer.
3403 You may give one or more space-separated answers, or "none" if appropriate.
3404 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3405 previous run of Configure, you may specify it as well as or instead of
3406 OS-specific hints. If hints are provided for your OS, you should use them:
3407 although Perl can probably be built without hints on many platforms, using
3408 hints often improve performance and may enable features that Configure can't
3409 set up on its own. If there are no hints that match your OS, specify "none";
3410 DO NOT give a wrong version or a wrong OS.
3414 rp="Which of these apply, if any?"
3417 for file in $tans; do
3418 if $test X$file = XPolicy -a -f Policy.sh; then
3420 $cat Policy.sh >> UU/config.sh
3421 elif $test -f $src/hints/$file.sh; then
3422 . $src/hints/$file.sh
3423 $cat $src/hints/$file.sh >> UU/config.sh
3424 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3427 : Give one chance to correct a possible typo.
3428 echo "$file.sh does not exist"
3430 rp="hint to use instead?"
3432 for file in $ans; do
3433 if $test -f "$src/hints/$file.sh"; then
3434 . $src/hints/$file.sh
3435 $cat $src/hints/$file.sh >> UU/config.sh
3436 elif $test X$ans = X -o X$ans = Xnone ; then
3439 echo "$file.sh does not exist -- ignored."
3446 : Remember our hint file for later.
3447 if $test -f "$src/hints/$file.sh" ; then
3457 echo "Fetching default answers from $config_sh..." >&4
3461 cp $config_sh config.sh 2>/dev/null
3471 test "$override" && . ./optdef.sh
3473 : Restore computed paths
3474 for file in $loclist $trylist; do
3475 eval $file="\$_$file"
3480 Configure uses the operating system name and version to set some defaults.
3481 The default value is probably right if the name rings a bell. Otherwise,
3482 since spelling matters for me, either accept the default or answer "none"
3489 ''|' '|none) dflt=none ;;
3490 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3493 *) dflt="$osname" ;;
3495 rp="Operating system name?"
3499 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3505 ''|' '|none) dflt=none ;;
3506 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3507 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3509 ''|' ') dflt=none ;;
3514 *) dflt="$osvers" ;;
3516 rp="Operating system version?"
3526 : who configured the system
3527 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3530 cf_by=`(logname) 2>/dev/null`
3533 cf_by=`(whoami) 2>/dev/null`
3535 "") cf_by=unknown ;;
3540 : decide how portable to be. Allow command line overrides.
3541 case "$d_portable" in
3543 *) d_portable="$define" ;;
3546 : set up shell script to do ~ expansion
3552 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3555 if $test -f /bin/csh; then
3556 /bin/csh -f -c "glob \$1"
3561 name=\`$expr x\$1 : '..\([^/]*\)'\`
3562 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3563 if $test ! -d "\$dir"; then
3565 echo "\$me: can't locate home directory for: \$name" >&2
3570 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3586 : now set up to get a file name
3590 cat <<'EOSC' >>getfile
3606 : getfile will accept an answer from the comma-separated list
3607 : enclosed in parentheses even if it does not meet other criteria.
3608 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3609 fn=`echo $fn | sed 's/(.*)//'`
3615 loc_file=`expr $fn : '.*:\(.*\)'`
3616 fn=`expr $fn : '\(.*\):.*'`
3624 */*) fullpath=true;;
3633 *e*) exp_file=true;;
3636 *p*) nopath_ok=true;;
3641 *d*) type='Directory';;
3642 *l*) type='Locate';;
3647 Locate) what='File';;
3652 case "$d_portable" in
3660 while test "$type"; do
3665 true) rp="$rp (~name ok)";;
3668 if test -f UU/getfile.ok && \
3669 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3688 value=`UU/filexp $ans`
3691 if test "$ans" != "$value"; then
3692 echo "(That expands to $value on this system.)"
3706 /*) value="$ansexp" ;;
3707 [a-zA-Z]:/*) value="$ansexp" ;;
3712 echo "I shall only accept a full path name, as in /bin/ls." >&4
3713 echo "Use a ! shell escape if you wish to check pathnames." >&4
3716 echo "Please give a full path name, starting with slash." >&4
3719 echo "Note that using ~name is ok provided it expands well." >&4
3732 for fp in $gfpth; do
3733 if test "X$fp" = X.; then
3738 if test -f "$pf"; then
3740 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3742 echo "($value is not a plain file, but that's ok.)"
3745 if test X"$type" = X; then
3752 for fp in $gfpth; do
3753 if test "X$fp" = X.; then
3758 direxp="$fp/$ansexp"
3760 if test -d "$direxp"; then
3768 if test -d "$ansexp"; then
3769 echo "(Looking for $loc_file in directory $value.)"
3770 value="$value/$loc_file"
3771 ansexp="$ansexp/$loc_file"
3773 if test -f "$ansexp"; then
3776 case "$nopath_ok" in
3777 true) case "$value" in
3779 *) echo "Assuming $value will be in people's path."
3795 if test "$fastread" = yes; then
3800 rp="$what $value doesn't exist. Use that name anyway?"
3819 test "X$gfpthkeep" != Xy && gfpth=""
3822 : determine root of directory hierarchy where package will be installed.
3825 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3828 dflt=`echo "$prefix" | sed 's/.$//'`
3836 By default, $package will be installed in $dflt/bin, manual pages
3837 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3838 installation directories. Typically this is something like /usr/local.
3839 If you wish to have binaries under /usr/bin but other parts of the
3840 installation under /usr/local, that's ok: you will be prompted
3841 separately for each of the installation directories, the prefix being
3842 only used to set the defaults.
3846 rp='Installation prefix to use?'
3854 *) oldprefix="$prefix";;
3863 *) afsroot=$afsroot ;;
3869 $define|true) afs=true ;;
3870 $undef|false) afs=false ;;
3871 *) if test -d $afsroot; then
3879 echo "AFS may be running... I'll be extra cautious then..." >&4
3881 echo "AFS does not seem to be running..." >&4
3884 : determine installation prefix for where package is to be installed.
3888 Since you are running AFS, I need to distinguish the directory in which
3889 files will reside from the directory in which they are installed (and from
3890 which they are presumably copied to the former directory by occult means).
3893 case "$installprefix" in
3894 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
3895 *) dflt="$installprefix";;
3900 In some special cases, particularly when building $package for distribution,
3901 it is convenient to distinguish the directory in which files should be
3902 installed from the directory ($prefix) in which they will
3903 eventually reside. For most users, these two directories are the same.
3906 case "$installprefix" in
3908 *) dflt=$installprefix;;
3912 rp='What installation prefix should I use for installing files?'
3914 installprefix="$ans"
3915 installprefixexp="$ansexp"
3917 : Perform the prefixexp/installprefixexp correction if necessary
3918 cat <<EOS >installprefix
3921 cat <<'EOSC' >>installprefix
3922 : Change installation prefix, if necessary.
3923 if $test X"$prefix" != X"$installprefix"; then
3924 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
3926 eval "install${prefixvar}=\"\$${prefixvar}exp\""
3929 chmod +x installprefix
3930 $eunicefix installprefix
3932 : Set variables such as privlib and privlibexp from the output of ./getfile
3933 : performing the prefixexp/installprefixexp correction if necessary.
3934 cat <<EOS >setprefixvar
3937 cat <<'EOSC' >>setprefixvar
3938 eval "${prefixvar}=\"\$ans\""
3939 eval "${prefixvar}exp=\"\$ansexp\""
3942 chmod +x setprefixvar
3943 $eunicefix setprefixvar
3945 : set up the script used to warn in case of inconsistency
3952 echo "*** WHOA THERE!!! ***" >&4
3953 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
3954 rp=" Keep the $hint value?"
3957 y) td=$was; tu=$was;;
3961 : function used to set $1 to $val
3962 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
3964 $define$undef) . ./whoa; eval "$var=\$td";;
3965 $undef$define) . ./whoa; eval "$var=\$tu";;
3966 *) eval "$var=$val";;
3970 $define|true|[yY]*) dflt='y';;
3975 Perl can be built to use the SOCKS proxy protocol library. To do so,
3976 Configure must be run with -Dusesocks. If you use SOCKS you also need
3977 to use the PerlIO abstraction layer, this will be implicitly selected.
3979 If this doesn't make any sense to you, just accept the default '$dflt'.
3981 rp='Build Perl for SOCKS?'
3984 y|Y) val="$define" ;;
3991 $define|true|[yY]*) useperlio="$define";;
3994 case "$useperlio" in
3995 $define|true|[yY]*|'') dflt='y';;
4000 Previous version of $package used the standard IO mechanisms as
4001 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
4002 alternate IO mechanisms via the PerlIO abstraction layer, but the
4003 stdio mechanism is still available if needed. The abstraction layer
4004 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
4005 Using PerlIO with sfio may cause problems with some extension modules.
4007 If this doesn't make any sense to you, just accept the default '$dflt'.
4009 rp='Use the PerlIO abstraction layer?'
4016 echo "Ok, doing things the stdio way."
4025 case "$useperlio" in
4026 $define|true|[yY]*) ;;
4029 You are using the SOCKS proxy protocol library which means that you
4030 should also use the PerlIO layer. You may be headed for trouble.
4039 case "$usethreads" in
4040 $define|true|[yY]*) dflt='y';;
4041 *) # Catch case where user specified ithreads or 5005threads but
4042 # forgot -Dusethreads (A.D. 4/2002)
4043 case "$useithreads$use5005threads" in
4045 case "$useperlio" in
4046 "$define") dflt='y' ;;
4056 Perl can be built to take advantage of threads on some systems.
4057 To do so, Configure can be run with -Dusethreads.
4059 Note that Perl built with threading support runs slightly slower
4060 and uses more memory than plain Perl. The current implementation
4061 is believed to be stable, but it is fairly new, and so should be
4062 treated with caution.
4064 If this doesn't make any sense to you, just accept the default '$dflt'.
4066 rp='Build a threading Perl?'
4069 y|Y) val="$define" ;;
4075 case "$usethreads" in
4079 Since release 5.6, Perl has had two different threading implementations,
4080 the newer interpreter-based version (ithreads) with one interpreter per
4081 thread, and the older 5.005 version (5005threads).
4082 The 5005threads version is effectively unmaintained and will probably be
4083 removed in Perl 5.10, so there should be no need to build a Perl using it
4084 unless needed for backwards compatibility with some existing 5.005threads
4088 : Default to ithreads unless overridden on command line or with
4091 case "$use5005threads" in
4092 $define|true|[yY]*) dflt='n';;
4094 case "$useithreads" in
4095 $undef|false|[nN]*) dflt='n';;
4097 rp='Use the newer interpreter-based ithreads?'
4100 y|Y) val="$define" ;;
4105 : Now set use5005threads to the opposite value.
4106 case "$useithreads" in
4107 $define) val="$undef" ;;
4114 useithreads="$undef"
4115 use5005threads="$undef"
4119 case "$useithreads$use5005threads" in
4123 You cannot have both the ithreads and the 5.005 threads enabled
4124 at the same time. Disabling the 5.005 threads since they are
4125 much less stable than the ithreads.
4128 use5005threads="$undef"
4132 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
4135 *** To build with ithreads you must also use the PerlIO layer.
4136 *** Cannot continue, aborting.
4142 case "$d_oldpthreads" in
4143 '') : Configure tests would be welcome here. For now, assume undef.
4145 *) val="$d_oldpthreads" ;;
4151 : Look for a hint-file generated 'call-back-unit'. If the
4152 : user has specified that a threading perl is to be built,
4153 : we may need to set or change some other defaults.
4154 if $test -f usethreads.cbu; then
4155 echo "Your platform has some specific hints regarding threaded builds, using them..."
4158 case "$usethreads" in
4159 "$define"|true|[yY]*)
4161 (Your platform does not have any specific hints for threaded builds.
4162 Assuming POSIX threads, then.)
4170 Perl can be built so that multiple Perl interpreters can coexist
4171 within the same Perl executable.
4174 case "$useithreads" in
4177 This multiple interpreter support is required for interpreter-based threads.
4181 *) case "$usemultiplicity" in
4182 $define|true|[yY]*) dflt='y';;
4186 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4187 rp='Build Perl for multiplicity?'
4190 y|Y) val="$define" ;;
4199 case "$usemorebits" in
4200 "$define"|true|[yY]*)
4201 use64bitint="$define"
4202 uselongdouble="$define"
4203 usemorebits="$define"
4205 *) usemorebits="$undef"
4209 : make some quick guesses about what we are up against
4211 $echo $n "Hmm... $c"
4221 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
4222 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
4224 echo "Looks kind of like an OSF/1 system, but we'll see..."
4226 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4227 xxx=`./loc addbib blurfl $pth`
4228 if $test -f $xxx; then
4229 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4233 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4234 echo "Looks kind of like an extended USG system, but we'll see..."
4236 echo "Looks kind of like a USG system, but we'll see..."
4240 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4241 echo "Looks kind of like a BSD system, but we'll see..."
4245 echo "Looks kind of like a Version 7 system, but we'll see..."
4248 case "$eunicefix" in
4251 There is, however, a strange, musty smell in the air that reminds me of
4252 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4256 : it so happens the Eunice I know will not run shell scripts in Unix format
4260 echo "Congratulations. You aren't running Eunice."
4264 : Detect OS2. The p_ variable is set above in the Head.U unit.
4265 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4266 : semicolon as a patch separator
4271 I have the feeling something is not exactly right, however...don't tell me...
4272 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4273 (Or you may be running DOS with DJGPP.)
4278 if test -f /xenix; then
4279 echo "Actually, this looks more like a XENIX system..."
4284 echo "It's not Xenix..."
4289 if test -f /venix; then
4290 echo "Actually, this looks more like a VENIX system..."
4297 echo "Nor is it Venix..."
4300 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4301 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4308 rp="Use which C compiler?"
4312 : See if they have not cc but they do have gcc
4314 : Look for a hint-file generated 'call-back-unit'. Now that the
4315 : user has specified the compiler, we may need to set or change some
4317 if $test -f cc.cbu; then
4323 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4327 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4329 printf("%s\n", __VERSION__);
4331 printf("%s\n", "1");
4337 if $cc -o try $ccflags $ldflags try.c; then
4338 gccversion=`$run ./try`
4339 case "$gccversion" in
4340 '') echo "You are not using GNU cc." ;;
4341 *) echo "You are using GNU cc $gccversion."
4347 echo "*** WHOA THERE!!! ***" >&4
4348 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4349 case "$knowitall" in
4351 echo " You'd better start hunting for one and let me know about it." >&4
4357 case "$gccversion" in
4358 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4360 case "$gccversion" in
4361 '') gccosandvers='' ;;
4362 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4363 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4365 case "$gccosandvers" in
4366 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4367 $osname$osvers) ;; # looking good
4368 $osname*) cat <<EOM >&4
4370 *** WHOA THERE!!! ***
4372 Your gcc has not been compiled for the exact release of
4373 your operating system ($gccosandvers versus $osname$osvers).
4375 In general it is a good idea to keep gcc synchronized with
4376 the operating system because otherwise serious problems
4377 may ensue when trying to compile software, like Perl.
4379 I'm trying to be optimistic here, though, and will continue.
4380 If later during the configuration and build icky compilation
4381 problems appear (headerfile conflicts being the most common
4382 manifestation), I suggest reinstalling the gcc to match
4383 your operating system release.
4387 *) gccosandvers='' ;; # failed to parse, better be silent
4395 # gcc 3.* complain about adding -Idirectories that they already know about,
4396 # so we will take those off from locincpth.
4397 case "$gccversion" in
4399 echo "main(){}">try.c
4400 for incdir in $locincpth; do
4401 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4402 grep '^c[cp]p*[01]: warning: changing search order '`
4403 if test "X$warn" != X; then
4404 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4410 : What should the include directory be ?
4412 $echo $n "Hmm... $c"
4416 if $test -f /bin/mips && /bin/mips; then
4417 echo "Looks like a MIPS system..."
4418 $cat >usr.c <<'EOCP'
4419 #ifdef SYSTYPE_BSD43
4423 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4424 dflt='/bsd43/usr/include'
4428 mips_type='System V'
4430 $rm -f usr.c usr.out
4431 echo "and you're compiling with the $mips_type compiler and libraries."
4435 echo "Doesn't look like a MIPS system."
4445 case "$xxx_prompt" in
4448 rp='Where are the include files you want to use?'
4456 : see how we invoke the C preprocessor
4458 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4459 cat <<'EOT' >testcpp.c
4465 if test ! -f cppstdin; then
4466 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4467 # AIX cc -E doesn't show the absolute headerfile
4468 # locations but we'll cheat by using the -M flag.
4469 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
4471 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4474 echo "Keeping your $hint cppstdin wrapper."
4477 wrapper=`pwd`/cppstdin
4481 if $test "X$cppstdin" != "X" && \
4482 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4483 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4485 echo "You used to use $cppstdin $cppminus so we'll use that again."
4487 '') echo "But let's see if we can live without a wrapper..." ;;
4489 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4490 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4492 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4495 echo "(However, $cpprun $cpplast does not work, let's see...)"
4503 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4510 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4511 $cc -E <testcpp.c >testcpp.out 2>&1; \
4512 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4513 echo "Yup, it does."
4516 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4517 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4518 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4519 echo "Yup, it does."
4522 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4523 $cc -P <testcpp.c >testcpp.out 2>&1; \
4524 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4525 echo "Yipee, that works!"
4528 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4529 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4530 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4531 echo "At long last!"
4534 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4535 $cpp <testcpp.c >testcpp.out 2>&1; \
4536 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4540 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4541 $cpp - <testcpp.c >testcpp.out 2>&1; \
4542 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4543 echo "Hooray, it works! I was beginning to wonder."
4546 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4547 $wrapper <testcpp.c >testcpp.out 2>&1; \
4548 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4554 rp="No dice. I can't find a C preprocessor. Name one:"
4558 $x_cpp <testcpp.c >testcpp.out 2>&1
4559 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4560 echo "OK, that will do." >&4
4562 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4577 echo "Perhaps can we force $cc -E using a wrapper..."
4578 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4579 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4585 echo "Nope, we'll have to live without it..."
4599 "$wrapper"|'cppstdin') ;;
4600 *) $rm -f $wrapper;;
4602 $rm -f testcpp.c testcpp.out
4604 : Set private lib path
4607 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4612 '') dlist="$loclibpth $plibpth $glibpth";;
4613 *) dlist="$libpth";;
4616 : Now check and see which directories actually exist, avoiding duplicates
4620 if $test -d $xxx; then
4623 *) libpth="$libpth $xxx";;
4629 Some systems have incompatible or broken versions of libraries. Among
4630 the directories listed in the question below, please remove any you
4631 know not to be holding relevant libraries, and add any that are needed.
4632 Say "none" for none.
4643 rp="Directories to use for library searches?"
4650 : compute shared library extension
4653 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4663 On some systems, shared libraries may be available. Answer 'none' if
4664 you want to suppress searching of shared libraries for the remainder
4665 of this configuration.
4668 rp='What is the file extension used for shared libraries?'
4672 : Define several unixisms.
4673 : Hints files or command line option can be used to override them.
4674 : The convoluted testing is in case hints files set either the old
4677 '') case "$exe_ext" in
4679 *) _exe="$exe_ext" ;;
4684 '') case "$lib_ext" in
4691 '') case "$obj_ext" in
4698 '') case "$path_sep" in
4709 : Which makefile gets called first. This is used by make depend.
4710 case "$firstmakefile" in
4711 '') firstmakefile='makefile';;
4715 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4718 case "$uselongdouble" in
4719 $define|true|[yY]*) dflt='y';;
4724 Perl can be built to take advantage of long doubles which
4725 (if available) may give more accuracy and range for floating point numbers.
4727 If this doesn't make any sense to you, just accept the default '$dflt'.
4729 rp='Try to use long doubles if available?'
4732 y|Y) val="$define" ;;
4738 case "$uselongdouble" in
4739 true|[yY]*) uselongdouble="$define" ;;
4742 : Look for a hint-file generated 'call-back-unit'. If the
4743 : user has specified that long doubles should be used,
4744 : we may need to set or change some other defaults.
4745 if $test -f uselongdouble.cbu; then
4746 echo "Your platform has some specific hints regarding long doubles, using them..."
4747 . ./uselongdouble.cbu
4749 case "$uselongdouble" in
4752 (Your platform does not have any specific hints for long doubles.)
4758 : Looking for optional libraries
4760 echo "Checking for optional libraries..." >&4
4765 case "$libswanted" in
4766 '') libswanted='c_s';;
4769 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4775 for thisdir in $libpth $xlibpth; do
4776 test -d $thisdir && libspath="$libspath $thisdir"
4778 for thislib in $libswanted; do
4779 for thisdir in $libspath; do
4781 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4782 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4783 $test -f "$xxx" && eval $libscheck
4784 $test -f "$xxx" && libstyle=shared
4786 if test ! -f "$xxx"; then
4787 xxx=$thisdir/lib$thislib.$so
4788 $test -f "$xxx" && eval $libscheck
4789 $test -f "$xxx" && libstyle=shared
4791 if test ! -f "$xxx"; then
4792 xxx=$thisdir/lib$thislib$_a
4793 $test -f "$xxx" && eval $libscheck
4794 $test -f "$xxx" && libstyle=static
4796 if test ! -f "$xxx"; then
4797 xxx=$thisdir/$thislib$_a
4798 $test -f "$xxx" && eval $libscheck
4799 $test -f "$xxx" && libstyle=static
4801 if test ! -f "$xxx"; then
4802 xxx=$thisdir/lib${thislib}_s$_a
4803 $test -f "$xxx" && eval $libscheck
4804 $test -f "$xxx" && libstyle=static
4805 $test -f "$xxx" && thislib=${thislib}_s
4807 if test ! -f "$xxx"; then
4808 xxx=$thisdir/Slib$thislib$_a
4809 $test -f "$xxx" && eval $libscheck
4810 $test -f "$xxx" && libstyle=static
4812 if $test -f "$xxx"; then
4814 shared) echo "Found -l$thislib (shared)." ;;
4815 static) echo "Found -l$thislib." ;;
4816 *) echo "Found -l$thislib ($libstyle)." ;;
4820 *) dflt="$dflt -l$thislib"
4821 libsfound="$libsfound $xxx"
4823 libsfiles="$libsfiles $yyy"
4824 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4825 case " $libsdirs " in
4827 *) libsdirs="$libsdirs $yyy" ;;
4834 if $test ! -f "$xxx"; then
4835 echo "No -l$thislib."
4846 ' '|'') dflt='none';;
4851 In order to compile $package on your machine, a number of libraries
4852 are usually needed. Include any other special libraries here as well.
4853 Say "none" for none. The default list is almost always right.
4857 rp="What libraries to use?"
4864 : determine optimization, if desired, or use for debug flag also
4866 ' '|$undef) dflt='none';;
4868 *) dflt="$optimize";;
4872 By default, $package compiles with the -O flag to use the optimizer.
4873 Alternately, you might want to use the symbolic debugger, which uses
4874 the -g flag (on traditional Unix systems). Either flag can be
4875 specified here. To use neither flag, specify the word "none".
4878 rp="What optimizer/debugger flag should be used?"
4882 'none') optimize=" ";;
4885 : Check what DEBUGGING is required from the command line
4886 : -DEBUGGING or -DDEBUGGING or
4887 : -DEBUGGING=both = -g + -DDEBUGGING
4888 : -DEBUGGING=-g or -Doptimize=-g = -g
4889 : -DEBUGGING=none or -UDEBUGGING =
4890 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
4893 *) DEBUGGING=$EBUGGING ;;
4896 case "$DEBUGGING" in
4900 *) optimize="$optimize -g" ;;
4904 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
4912 case "$DEBUGGING" in
4913 both|$define) dflt='-DDEBUGGING'
4916 : We will not override a previous value, but we might want to
4917 : augment a hint file
4919 default|recommended)
4920 case "$gccversion" in
4921 1*) dflt="$dflt -fpcc-struct-return" ;;
4923 case "$optimize:$DEBUGGING" in
4924 *-g*:old) dflt="$dflt -DDEBUGGING";;
4926 case "$gccversion" in
4927 2*) if test -d /etc/conf/kconfig.d &&
4928 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4930 # Interactive Systems (ISC) POSIX mode.
4935 case "$gccversion" in
4939 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
4940 echo 'int main(void) { return 0; }' > gcctest.c
4941 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
4942 echo "Yes, it does." 2>&1
4945 echo "Leaving current flags $ccflags alone." 2>&1
4947 *) dflt="$dflt -fno-strict-aliasing" ;;
4950 echo "Nope, it doesn't, but that's ok." 2>&1
4954 # For gcc, adding -pipe speeds up compilations for some, but apparently
4955 # some assemblers can't read from stdin. (It also slows down compilations
4956 # in other cases, but those are apparently rarer these days.) AD 5/2004.
4957 case "$gccversion" in
4959 echo "Checking if your compiler accepts -pipe" 2>&1
4960 echo 'int main(void) { return 0; }' > gcctest.c
4961 if $cc -pipe -o gcctest gcctest.c; then
4962 echo "Yes, it does." 2>&1
4965 echo "Leaving current flags $ccflags alone." 2>&1
4967 *) dflt="$dflt -pipe" ;;
4970 echo "Nope, it doesn't, but that's ok." 2>&1
4977 case "$mips_type" in
4978 *BSD*|'') inclwanted="$locincpth $usrinc";;
4979 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4981 for thisincl in $inclwanted; do
4982 if $test -d $thisincl; then
4983 if $test x$thisincl != x$usrinc; then
4985 *" -I$thisincl "*);;
4986 *) dflt="$dflt -I$thisincl ";;
4992 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4994 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5002 *) dflt="$dflt -D$2";;
5006 set signal.h LANGUAGE_C; eval $inctest
5010 ccflags="$ccflags -DSOCKS"
5015 default|recommended) dflt="$ccflags $dflt" ;;
5016 *) dflt="$ccflags";;
5025 Your C compiler may want other flags. For this question you should include
5026 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5027 but you should NOT include libraries or ld flags like -lwhatever. If you
5028 want $package to honor its debug switch, you should include -DDEBUGGING here.
5029 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5031 To use no flags, specify the word "none".
5037 rp="Any additional cc flags?"
5044 : the following weeds options from ccflags that are of no interest to cpp
5046 '') cppflags="$ccflags" ;;
5047 *) cppflags="$cppflags $ccflags" ;;
5049 case "$gccversion" in
5050 1*) cppflags="$cppflags -D__GNUC__"
5052 case "$mips_type" in
5054 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5060 echo "Let me guess what the preprocessor flags are..." >&4
5074 *) ftry="$previous $flag";;
5076 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5077 >cpp1.out 2>/dev/null && \
5078 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5079 >cpp2.out 2>/dev/null && \
5080 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5081 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5083 cppflags="$cppflags $ftry"
5093 *-*) echo "They appear to be: $cppflags";;
5095 $rm -f cpp.c cpp?.out
5099 : flags used in final linking phase
5101 '') if ./venix; then
5107 *-posix*) dflt="$dflt -posix" ;;
5110 *) dflt="$ldflags";;
5113 : Try to guess additional flags to pick up local libraries.
5114 for thislibdir in $libpth; do
5115 case " $loclibpth " in
5118 *"-L$thislibdir "*) ;;
5119 *) dflt="$dflt -L$thislibdir" ;;
5131 Your C linker may need flags. For this question you should
5132 include -L/whatever and any other flags used by the C linker, but you
5133 should NOT include libraries like -lwhatever.
5135 Make sure you include the appropriate -L/path flags if your C linker
5136 does not normally search all of the directories you specified above,
5139 To use no flags, specify the word "none".
5143 rp="Any additional ld flags (NOT including libraries)?"
5149 rmlist="$rmlist pdp11"
5153 echo "Checking your choice of C compiler and flags for coherency..." >&4
5154 $cat > try.c <<'EOF'
5156 int main() { printf("Ok\n"); return(0); }
5158 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5160 $cat >try.msg <<'EOM'
5161 I've tried to compile and run the following simple program:
5164 $cat try.c >> try.msg
5166 $cat >> try.msg <<EOM
5173 and I got the following output:
5177 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5178 if $sh -c "$run ./try" >>try.msg 2>&1; then
5182 *) echo 'The program compiled OK, but produced no output.' >> try.msg
5185 cat >> try.msg <<'EOQS'
5186 If $libs contains -lsfio, and sfio is mis-configured, then it
5187 sometimes (apparently) runs and exits with a 0 status, but with no
5188 output! It may have to do with sfio's use of _exit vs. exit.
5191 rp="You have a big problem. Shall I abort Configure"
5198 echo "The program compiled OK, but exited with status $?." >>try.msg
5199 rp="You have a problem. Shall I abort Configure"
5203 echo "I can't compile the test program." >>try.msg
5204 rp="You have a BIG problem. Shall I abort Configure"
5210 case "$knowitall" in
5212 echo "(The supplied flags or libraries might be incorrect.)"
5220 *) echo "Ok. Stopping Configure." >&4
5225 n) echo "OK, that should do.";;
5227 $rm -f try try.* core
5229 : define a shorthand compile call
5233 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5234 : define a shorthand compile call for compilations that should be ok.
5238 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5240 : determine filename position in cpp output
5242 echo "Computing filename position in cpp output for #include directives..." >&4
5244 vos) testaccess=-e ;;
5247 echo '#include <stdio.h>' > foo.c
5250 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5251 $grep '^[ ]*#.*stdio\.h' | \
5252 while read cline; do
5255 while $test \$# -gt 0; do
5256 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5261 pos=\`expr \$pos + 1\`
5273 *) pos="${fieldn}th";;
5275 echo "Your cpp writes the filename in the $pos field of the line."
5278 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5279 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5282 : locate header file
5287 for usrincdir in $usrinc
5289 if test -f \$usrincdir/\$wanted; then
5290 echo "\$usrincdir/\$wanted"
5294 awkprg='{ print \$$fieldn }'
5295 echo "#include <\$wanted>" > foo\$\$.c
5296 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5297 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5298 while read cline; do
5299 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5301 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5302 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5307 # status = 0: grep returned 0 lines, case statement not executed
5308 # status = 1: headerfile found
5309 # status = 2: while loop executed, no headerfile found
5313 if test \$status -eq 1; then
5320 : define an alternate in-header-list? function
5321 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5322 cont=true; xxf="echo \"<\$1> found.\" >&4";
5323 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5324 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5326 case $# in 4) instead=instead;; *) instead="at last";; esac;
5327 while $test "$cont"; do
5329 var=$2; eval "was=\$$2";
5330 if $test "$xxx" && $test -r "$xxx";
5332 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5335 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5336 set $yyy; shift; shift; yyy=$@;
5337 case $# in 0) cont="";;
5338 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5339 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5340 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5341 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5345 do set $yyy; var=$2; eval "was=\$$2";
5346 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5347 set $yyy; shift; shift; yyy=$@;
5350 : see if stdlib is available
5351 set stdlib.h i_stdlib
5354 : check for lengths of integral types
5358 echo "Checking to see how big your integers are..." >&4
5367 printf("intsize=%d;\n", (int)sizeof(int));
5368 printf("longsize=%d;\n", (int)sizeof(long));
5369 printf("shortsize=%d;\n", (int)sizeof(short));
5374 if eval $compile_ok && $run ./try > /dev/null; then
5376 echo "Your integers are $intsize bytes long."
5377 echo "Your long integers are $longsize bytes long."
5378 echo "Your short integers are $shortsize bytes long."
5382 Help! I can't compile and run the intsize test program: please enlighten me!
5383 (This is probably a misconfiguration in your system or libraries, and
5384 you really ought to fix it. Still, I'll try anyway.)
5388 rp="What is the size of an integer (in bytes)?"
5392 rp="What is the size of a long integer (in bytes)?"
5396 rp="What is the size of a short integer (in bytes)?"
5404 : check for long long
5406 echo "Checking to see if you have long long..." >&4
5407 echo 'int main() { long long x = 7; return 0; }' > try.c
5409 if eval $compile; then
5411 echo "You have long long."
5414 echo "You do not have long long."
5420 : check for length of long long
5421 case "${d_longlong}${longlongsize}" in
5424 echo "Checking to see how big your long longs are..." >&4
5425 $cat >try.c <<'EOCP'
5429 printf("%d\n", (int)sizeof(long long));
5434 if eval $compile_ok; then
5435 longlongsize=`$run ./try`
5436 echo "Your long longs are $longlongsize bytes long."
5440 echo "(I can't seem to compile the test program. Guessing...)"
5441 rp="What is the size of a long long (in bytes)?"
5445 if $test "X$longsize" = "X$longlongsize"; then
5446 echo "(That isn't any different from an ordinary long.)"
5452 : see if inttypes.h is available
5453 : we want a real compile instead of Inhdr because some systems
5454 : have an inttypes.h which includes non-existent headers
5457 #include <inttypes.h>
5459 static int32_t foo32 = 0x12345678;
5463 if eval $compile; then
5464 echo "<inttypes.h> found." >&4
5467 echo "<inttypes.h> NOT found." >&4
5476 echo "Checking to see if you have int64_t..." >&4
5478 #include <sys/types.h>
5479 #$i_inttypes I_INTTYPES
5481 #include <inttypes.h>
5483 int main() { int64_t x = 7; }
5486 if eval $compile; then
5488 echo "You have int64_t."
5491 echo "You do not have int64_t."
5499 echo "Checking which 64-bit integer type we could use..." >&4
5505 val='"unsigned int"'
5510 *) case "$longsize" in
5514 val='"unsigned long"'
5519 *) case "$d_longlong:$longlongsize" in
5524 val='"unsigned long long"'
5529 *) case "$d_int64_t" in
5548 '') echo "Alas, no 64-bit integer types in sight." >&4
5551 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5557 case "$uselonglong" in
5558 "$define"|true|[yY]*)
5561 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5563 use64bitint="$define"
5566 case "$use64bits" in
5567 "$define"|true|[yY]*)
5570 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5572 use64bitint="$define"
5575 case "$use64bitints" in
5576 "$define"|true|[yY]*)
5579 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5581 use64bitint="$define"
5584 case "$use64bitsint" in
5585 "$define"|true|[yY]*)
5588 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5590 use64bitint="$define"
5593 case "$uselonglongs" in
5594 "$define"|true|[yY]*)
5597 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5599 use64bitint="$define"
5602 case "$use64bitsall" in
5603 "$define"|true|[yY]*)
5606 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5608 use64bitall="$define"
5613 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5615 case "$use64bitall" in
5616 "$define"|true|[yY]*) use64bitint="$define" ;;
5622 You have natively 64-bit long integers.
5626 *) case "$use64bitint" in
5627 "$define"|true|[yY]*) dflt='y';;
5636 Perl can be built to take advantage of 64-bit integer types
5637 on some systems. To do so, Configure can be run with -Duse64bitint.
5638 Choosing this option will most probably introduce binary incompatibilities.
5640 If this doesn't make any sense to you, just accept the default '$dflt'.
5641 (The default has been chosen based on your configuration.)
5643 rp='Try to use 64-bit integers, if available?'
5646 [yY]*) val="$define" ;;
5654 case "$use64bitall" in
5655 "$define"|true|[yY]*) dflt='y' ;;
5656 *) case "$longsize" in
5664 You may also choose to try maximal 64-bitness. It means using as much
5665 64-bitness as possible on the platform. This in turn means even more
5666 binary incompatibilities. On the other hand, your platform may not
5667 have any more 64-bitness available than what you already have chosen.
5669 If this doesn't make any sense to you, just accept the default '$dflt'.
5670 (The default has been chosen based on your configuration.)
5672 rp='Try to use maximal 64-bit support, if available?'
5675 [yY]*) val="$define" ;;
5680 case "$use64bitall" in
5682 case "$use64bitint" in
5686 Since you have chosen a maximally 64-bit build, I'm also turning on
5687 the use of 64-bit integers.
5689 use64bitint="$define" ;;
5694 : Look for a hint-file generated 'call-back-unit'. If the
5695 : user has specified that a 64-bit perl is to be built,
5696 : we may need to set or change some other defaults.
5697 if $test -f use64bitint.cbu; then
5698 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5701 case "$use64bitint" in
5702 "$define"|true|[yY]*)
5704 4) case "$archname64" in
5705 '') archname64=64int ;;
5712 : Look for a hint-file generated 'call-back-unit'. If the
5713 : user has specified that a maximally 64-bit perl is to be built,
5714 : we may need to set or change some other defaults.
5715 if $test -f use64bitall.cbu; then
5716 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5719 case "$use64bitall" in
5720 "$define"|true|[yY]*)
5722 4) case "$archname64" in
5723 ''|64int) archname64=64all ;;
5730 case "$d_quad:$use64bitint" in
5734 *** You have chosen to use 64-bit integers,
5735 *** but none can be found.
5736 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5737 *** Cannot continue, aborting.
5744 : check for length of double
5746 case "$doublesize" in
5748 echo "Checking to see how big your double precision numbers are..." >&4
5757 printf("%d\n", (int)sizeof(double));
5762 if eval $compile_ok; then
5763 doublesize=`$run ./try`
5764 echo "Your double is $doublesize bytes long."
5767 echo "(I can't seem to compile the test program. Guessing...)"
5768 rp="What is the size of a double precision number (in bytes)?"
5776 : check for long doubles
5778 echo "Checking to see if you have long double..." >&4
5779 echo 'int main() { long double x = 7.0; }' > try.c
5781 if eval $compile; then
5783 echo "You have long double."
5786 echo "You do not have long double."
5792 : check for length of long double
5793 case "${d_longdbl}${longdblsize}" in
5796 echo "Checking to see how big your long doubles are..." >&4
5797 $cat >try.c <<'EOCP'
5801 printf("%d\n", sizeof(long double));
5806 if eval $compile; then
5807 longdblsize=`$run ./try`
5808 echo "Your long doubles are $longdblsize bytes long."
5812 echo "(I can't seem to compile the test program. Guessing...)" >&4
5813 rp="What is the size of a long double (in bytes)?"
5817 if $test "X$doublesize" = "X$longdblsize"; then
5818 echo "That isn't any different from an ordinary double."
5819 echo "I'll keep your setting anyway, but you may see some"
5820 echo "harmless compilation warnings."
5826 : determine the architecture name
5828 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5829 tarch=`arch`"-$osname"
5830 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5831 if uname -m > tmparch 2>&1 ; then
5832 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5833 -e 's/$/'"-$osname/" tmparch`
5841 case "$myarchname" in
5844 echo "(Your architecture name used to be $myarchname.)"
5848 case "$targetarch" in
5850 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
5855 *) dflt="$archname";;
5857 rp='What is your architecture name'
5860 case "$usethreads" in
5862 echo "Threads selected." >&4
5864 *-thread*) echo "...and architecture name already has -thread." >&4
5866 *) archname="$archname-thread"
5867 echo "...setting architecture name to $archname." >&4
5872 case "$usemultiplicity" in
5874 echo "Multiplicity selected." >&4
5876 *-multi*) echo "...and architecture name already has -multi." >&4
5878 *) archname="$archname-multi"
5879 echo "...setting architecture name to $archname." >&4
5884 case "$use64bitint$use64bitall" in
5886 case "$archname64" in
5888 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
5891 case "$use64bitint" in
5892 "$define") echo "64 bit integers selected." >&4 ;;
5894 case "$use64bitall" in
5895 "$define") echo "Maximal 64 bitness selected." >&4 ;;
5898 *-$archname64*) echo "...and architecture name already has $archname64." >&4
5900 *) archname="$archname-$archname64"
5901 echo "...setting architecture name to $archname." >&4
5907 case "$uselongdouble" in
5909 echo "Long doubles selected." >&4
5910 case "$longdblsize" in
5912 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
5916 *-ld*) echo "...and architecture name already has -ld." >&4
5918 *) archname="$archname-ld"
5919 echo "...setting architecture name to $archname." >&4
5926 case "$useperlio" in
5928 echo "Perlio selected." >&4
5931 echo "Perlio not selected, using stdio." >&4
5933 *-stdio*) echo "...and architecture name already has -stdio." >&4
5935 *) archname="$archname-stdio"
5936 echo "...setting architecture name to $archname." >&4
5941 if $test -f archname.cbu; then
5942 echo "Your platform has some specific hints for architecture name, using them..."
5946 : set the prefixit variable, to compute a suitable default value
5947 prefixit='case "$3" in
5949 case "$oldprefix" in
5950 "") eval "$1=\"\$$2\"";;
5957 ""|" ") eval "$1=\"\$$2\"";;
5963 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
5965 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
5966 /*-$oldprefix/*|\~*-$oldprefix/*)
5967 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
5968 *) eval "$1=\"\$$2\"";;
5972 : get the patchlevel
5974 echo "Getting the current patchlevel..." >&4
5975 if $test -r $rsrc/patchlevel.h;then
5976 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
5977 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
5978 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5979 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
5980 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
5981 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5982 perl_patchlevel=`egrep 'define PERL_PATCHNUM [0-9][0-9]|,"MAINT[0-9][0-9]*"' $rsrc/patchlevel.h|sed 's/[^0-9]//g'`
5991 $echo "(You do not have patchlevel.h. Eek.)"
5993 if $test -r $rsrc/.patch ; then
5994 if $test "X$perl_patchlevel" = "X" || $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
5995 perl_patchlevel=`cat $rsrc/.patch`
5998 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
5999 version_patchlevel_string="version $patchlevel subversion $subversion"
6000 case "$perl_patchlevel" in
6002 *) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;;
6005 $echo "(You have $package $version_patchlevel_string.)"
6009 : XXX Should be a Configure test for double-dots in filenames.
6010 version=`echo $revision $patchlevel $subversion | \
6011 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
6012 api_versionstring=`echo $api_revision $api_version $api_subversion | \
6013 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
6016 version=`echo $revision $patchlevel $subversion | \
6017 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
6018 api_versionstring=`echo $api_revision $api_version $api_subversion | \
6019 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
6022 : Special case the 5.005_xx maintenance series, which used 5.005
6023 : without any subversion label as a subdirectory in $sitelib
6024 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
6025 api_versionstring='5.005'
6028 : determine installation style
6029 : For now, try to deduce it from prefix unless it is already set.
6030 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6031 case "$installstyle" in
6032 '') case "$prefix" in
6033 *perl*) dflt='lib';;
6034 *) dflt='lib/perl5' ;;
6037 *) dflt="$installstyle" ;;
6039 : Probably not worth prompting for this since we prompt for all
6040 : the directories individually, and the prompt would be too long and
6044 : determine where public executables go
6049 rp='Pathname where the public executables will reside?'
6051 if $test "X$ansexp" != "X$binexp"; then
6055 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6056 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
6057 : this via initialinstalllocation
6060 case "$userelocatableinc" in
6061 $define|true|[yY]*) dflt='y' ;;
6066 Would you like to build Perl so that the installation is relocatable, so that
6067 library paths in @INC are determined relative to the path of the perl binary?
6068 This is not advised for system Perl installs, or if you need to run setid
6069 scripts or scripts under taint mode.
6071 If this doesn't make any sense to you, just accept the default '$dflt'.
6073 rp='Use relocatable @INC?'
6076 y|Y) val="$define" ;;
6079 set userelocatableinc
6082 initialinstalllocation="$binexp"
6083 : Default prefix is now "up one level from where the binaries are"
6084 case "$userelocatableinc" in
6090 installprefixexp=".../.."
6094 : determine where private library files go
6095 : Usual default is /usr/local/lib/perl5/$version.
6096 : Also allow things like /opt/perl/lib/$version, since
6097 : /opt/perl/lib/perl5... would be redundant.
6098 : The default "style" setting is made in installstyle.U
6099 case "$installstyle" in
6100 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6101 *) set dflt privlib lib/$version ;;
6106 There are some auxiliary files for $package that need to be put into a
6107 private library directory that is accessible by everyone.
6112 rp='Pathname where the private library files will reside?'
6117 : set the prefixup variable, to restore leading tilda escape
6118 prefixup='case "$prefixexp" in
6120 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6123 : determine where public architecture dependent libraries go
6126 : privlib default is /usr/local/lib/$package/$version
6127 : archlib default is /usr/local/lib/$package/$version/$archname
6128 : privlib may have an optional trailing /share.
6129 tdflt=`echo $privlib | $sed 's,/share$,,'`
6130 tdflt=$tdflt/$archname
6139 $spackage contains architecture-dependent library files. If you are
6140 sharing libraries in a heterogeneous environment, you might store
6141 these files in a separate location. Otherwise, you can just include
6142 them with the rest of the public library files.
6147 rp='Where do you want to put the public architecture-dependent libraries?'
6151 if $test X"$archlib" = X"$privlib"; then
6157 : see if setuid scripts can be secure
6160 Some kernels have a bug that prevents setuid #! scripts from being
6161 secure. Some sites have disabled setuid #! scripts because of this.
6163 First let's decide if your kernel supports secure setuid #! scripts.
6164 (If setuid #! scripts would be secure but have been disabled anyway,
6165 don't say that they are secure if asked.)
6170 if $test -d /dev/fd; then
6171 echo "#!$ls" >reflect
6172 chmod +x,u+s reflect
6173 ./reflect >flect 2>&1
6174 if $contains "/dev/fd" flect >/dev/null; then
6175 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6179 If you are not sure if they are secure, I can check but I'll need a
6180 username and password different from the one you are using right now.
6181 If you don't have such a username or don't want me to test, simply
6185 rp='Other username to test security of setuid scripts with?'
6190 case "$d_suidsafe" in
6191 '') echo "I'll assume setuid scripts are *not* secure." >&4
6194 echo "Well, the $hint value is *not* secure." >&4
6196 *) echo "Well, the $hint value *is* secure." >&4
6201 $rm -f reflect flect
6202 echo "#!$ls" >reflect
6203 chmod +x,u+s reflect
6206 echo '"su" will (probably) prompt you for '"$ans's password."
6207 su $ans -c './reflect >flect'
6208 if $contains "/dev/fd" flect >/dev/null; then
6209 echo "Okay, it looks like setuid scripts are secure." >&4
6212 echo "I don't think setuid scripts are secure." >&4
6217 rp='Does your kernel have *secure* setuid scripts?'
6220 [yY]*) val="$define";;
6225 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6226 echo "(That's for file descriptors, not floppy disks.)"
6232 $rm -f reflect flect
6234 : now see if they want to do setuid emulation
6237 case "$d_suidsafe" in
6240 echo "No need to emulate SUID scripts since they are secure here." >&4
6244 Some systems have disabled setuid scripts, especially systems where
6245 setuid scripts cannot be secure. On systems where setuid scripts have
6246 been disabled, the setuid/setgid bits on scripts are currently
6247 useless. It is possible for $package to detect those bits and emulate
6248 setuid/setgid in a secure fashion. This emulation will only work if
6249 setuid scripts have been disabled in your kernel.
6253 "$define") dflt=y ;;
6256 rp="Do you want to do setuid/setgid emulation?"
6259 [yY]*) val="$define";;
6267 : Find perl5.005 or later.
6268 echo "Looking for a previously installed perl5.005 or later... "
6270 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6271 : Check if this perl is recent and can load a simple module
6272 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6275 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6285 '') echo "None found. That's ok.";;
6286 *) echo "Using $perl5." ;;
6291 After $package is installed, you may wish to install various
6292 add-on modules and utilities. Typically, these add-ons will
6293 be installed under $prefix with the rest
6294 of this package. However, you may wish to install such add-ons
6295 elsewhere under a different prefix.
6297 If you do not wish to put everything under a single prefix, that's
6298 ok. You will be prompted for the individual locations; this siteprefix
6299 is only used to suggest the defaults.
6301 The default should be fine for most people.
6305 rp='Installation prefix to use for add-on modules and utilities?'
6306 : XXX Here might be another good place for an installstyle setting.
6307 case "$siteprefix" in
6309 *) dflt=$siteprefix ;;
6312 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6314 case "$siteprefix" in
6318 *) oldsiteprefix="$prefix";;
6323 siteprefixexp="$ansexp"
6325 : determine where site specific libraries go.
6326 : Usual default is /usr/local/lib/perl5/site_perl/$version
6327 : The default "style" setting is made in installstyle.U
6328 : XXX No longer works with Prefixit stuff.
6329 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6331 '') case "$installstyle" in
6332 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6333 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6341 The installation process will create a directory for
6342 site-specific extensions and modules. Most users find it convenient
6343 to place all site-specific files in this directory rather than in the
6344 main distribution directory.
6348 rp='Pathname for the site-specific library files?'
6352 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6354 : Determine list of previous versions to include in @INC
6355 $cat > getverlist <<EOPL
6358 \$api_versionstring = "$api_versionstring";
6359 \$version = "$version";
6360 \$stem = "$sitelib_stem";
6361 \$archname = "$archname";
6363 $cat >> getverlist <<'EOPL'
6364 # The list found is store twice for each entry: the original name, and
6365 # the binary broken down version as pack "sss", so sorting is easy and
6366 # unambiguous. This will work for all versions that have a maximum of
6367 # three digit groups, separate by '.'s or '_'s. Names are extended with
6368 # ".0.0" to ensure at least three elements for the pack.
6369 # -- H.Merijn Brand (m)'06 23-10-2006
6371 # Can't have leading @ because metaconfig interprets it as a command!
6372 ;@inc_version_list=();
6373 # XXX Redo to do opendir/readdir?
6376 ;@candidates = map {
6377 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
6383 ($pversion, $aversion, $vsn5005) = map {
6384 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
6385 foreach $d (@candidates) {
6386 if ($d->[1] lt $pversion) {
6387 if ($d->[1] ge $aversion) {
6388 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
6390 elsif ($d->[1] ge $vsn5005) {
6391 unshift(@inc_version_list, grep { -d } $d->[0]);
6395 # Skip newer version. I.e. don't look in
6396 # 5.7.0 if we're installing 5.6.1.
6400 if (@inc_version_list) {
6401 print join(' ', @inc_version_list);
6404 # Blank space to preserve value for next Configure run.
6409 case "$inc_version_list" in
6410 '') if test -x "$perl5$exe_ext"; then
6411 dflt=`$perl5 getverlist`
6416 $undef) dflt='none' ;;
6417 *) eval dflt=\"$inc_version_list\" ;;
6420 ''|' ') dflt=none ;;
6427 In order to ease the process of upgrading, this version of perl
6428 can be configured to use modules built and installed with earlier
6429 versions of perl that were installed under $prefix. Specify here
6430 the list of earlier versions that this version of perl should check.
6431 If Configure detected no earlier versions of perl installed under
6432 $prefix, then the list will be empty. Answer 'none' to tell perl
6433 to not search earlier versions.
6435 The default should almost always be sensible, so if you're not sure,
6436 just accept the default.
6439 rp='List of earlier versions to include in @INC?'
6442 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6443 *) inc_version_list="$ans" ;;
6445 case "$inc_version_list" in
6447 inc_version_list_init='0'
6448 d_inc_version_list="$undef"
6450 *) inc_version_list_init=`echo $inc_version_list |
6451 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6452 d_inc_version_list="$define"
6457 : see if this is a malloc.h system
6458 : we want a real compile instead of Inhdr because some systems have a
6459 : malloc.h that just gives a compile error saying to use stdlib.h instead
6464 int main () { return 0; }
6467 if eval $compile; then
6468 echo "<malloc.h> found." >&4
6471 echo "<malloc.h> NOT found." >&4
6478 : check for void type
6480 echo "Checking to see how well your C compiler groks the void type..." >&4
6481 case "$voidflags" in
6493 extern void moo(); /* function returning void */
6494 void (*goo)(); /* ptr to func returning void */
6496 void *hue; /* generic ptr */
6509 int main() { sub(); }
6511 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6512 voidflags=$defvoidused
6513 echo "Good. It appears to support void to the level $package wants.">&4
6514 if $contains warning .out >/dev/null 2>&1; then
6515 echo "However, you might get some warnings that look like this:"
6519 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6520 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6521 echo "It supports 1..."
6522 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6523 echo "It also supports 2..."
6524 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6526 echo "And it supports 4 but not 8 definitely."
6528 echo "It doesn't support 4..."
6529 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6531 echo "But it supports 8."
6534 echo "Neither does it support 8."
6538 echo "It does not support 2..."
6539 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6541 echo "But it supports 4 and 8."
6543 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6545 echo "And it supports 4 but has not heard about 8."
6547 echo "However it supports 8 but not 4."
6552 echo "There is no support at all for void."
6557 case "$voidflags" in
6560 Support flag bits are:
6561 1: basic void declarations.
6562 2: arrays of pointers to functions returning void.
6563 4: operations between pointers to and addresses of void functions.
6564 8: generic void pointers.
6567 rp="Your void support flags add up to what?"
6574 : check for length of pointer
6578 echo "Checking to see how big your pointers are..." >&4
6579 if test "$voidflags" -gt 7; then
6580 echo '#define VOID_PTR char *' > try.c
6582 echo '#define VOID_PTR void *' > try.c
6592 printf("%d\n", (int)sizeof(VOID_PTR));
6597 if eval $compile_ok; then
6598 ptrsize=`$run ./try`
6599 echo "Your pointers are $ptrsize bytes long."
6602 echo "(I can't seem to compile the test program. Guessing...)" >&4
6603 rp="What is the size of a pointer (in bytes)?"
6610 case "$use64bitall" in
6611 "$define"|true|[yY]*)
6615 *** You have chosen a maximally 64-bit build,
6616 *** but your pointers are only 4 bytes wide.
6617 *** Please rerun Configure without -Duse64bitall.
6622 *** Since you have quads, you could possibly try with -Duse64bitint.
6627 *** Cannot continue, aborting.
6638 : determine whether to use malloc wrapping
6640 case "$usemallocwrap" in
6641 [yY]*|true|$define) dflt='y' ;;
6642 [nN]*|false|$undef) dflt='n' ;;
6643 *) case "$usedevel" in
6644 [yY]*|true|$define) dflt='y' ;;
6649 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6651 usemallocwrap="$ans"
6654 usemallocwrap="$define" ;;
6656 usemallocwrap="$undef" ;;
6659 : determine which malloc to compile in
6661 case "$usemymalloc" in
6662 [yY]*|true|$define) dflt='y' ;;
6663 [nN]*|false|$undef) dflt='n' ;;
6664 *) case "$ptrsize" in
6670 rp="Do you wish to attempt to use the malloc that comes with $package?"
6676 mallocsrc='malloc.c'
6677 mallocobj="malloc$_o"
6678 d_mymalloc="$define"
6681 : Remove malloc from list of libraries to use
6682 echo "Removing unneeded -lmalloc from library list" >&4
6683 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6686 echo "libs = $libs" >&4
6698 : compute the return types of malloc and free
6700 $cat >malloc.c <<END
6704 #include <sys/types.h>
6718 case "$malloctype" in
6720 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6727 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6731 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6738 echo "Your system uses $freetype free(), it would seem." >&4
6740 : determine where site specific architecture-dependent libraries go.
6741 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6742 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6743 : sitelib may have an optional trailing /share.
6745 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6746 dflt="$dflt/$archname"
6751 set sitearch sitearch none
6755 The installation process will also create a directory for
6756 architecture-dependent site-specific extensions and modules.
6760 rp='Pathname for the site-specific architecture-dependent library files?'
6764 if $test X"$sitearch" = X"$sitelib"; then
6767 d_sitearch="$define"
6772 The installation process will also create a directory for
6773 vendor-supplied add-ons. Vendors who supply perl with their system
6774 may find it convenient to place all vendor-supplied files in this
6775 directory rather than in the main distribution directory. This will
6776 ease upgrades between binary-compatible maintenance versions of perl.
6778 Of course you may also use these directories in whatever way you see
6779 fit. For example, you might use them to access modules shared over a
6780 company-wide network.
6782 The default answer should be fine for most people.
6783 This causes further questions about vendor add-ons to be skipped
6784 and no vendor-specific directories will be configured for perl.
6787 rp='Do you want to configure vendor-specific add-on directories?'
6788 case "$usevendorprefix" in
6789 define|true|[yY]*) dflt=y ;;
6790 *) : User may have set vendorprefix directly on Configure command line.
6791 case "$vendorprefix" in
6800 rp='Installation prefix to use for vendor-supplied add-ons?'
6801 case "$vendorprefix" in
6803 *) dflt=$vendorprefix ;;
6806 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6808 case "$vendorprefix" in
6812 *) oldvendorprefix="$prefix";;
6816 usevendorprefix="$define"
6818 vendorprefixexp="$ansexp"
6820 *) usevendorprefix="$undef"
6826 case "$vendorprefix" in
6827 '') d_vendorlib="$undef"
6831 *) d_vendorlib="$define"
6832 : determine where vendor-supplied modules go.
6833 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6834 case "$vendorlib" in
6836 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6837 case "$installstyle" in
6838 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6839 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6842 *) dflt="$vendorlib"
6846 rp='Pathname for the vendor-supplied library files?'
6849 vendorlibexp="$ansexp"
6852 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6856 case "$vendorprefix" in
6857 '') d_vendorarch="$undef"
6861 *) d_vendorarch="$define"
6862 : determine where vendor-supplied architecture-dependent libraries go.
6863 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6864 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6865 : vendorlib may have an optional trailing /share.
6866 case "$vendorarch" in
6867 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6868 dflt="$dflt/$archname"
6870 *) dflt="$vendorarch" ;;
6873 rp='Pathname for vendor-supplied architecture-dependent files?'
6876 vendorarchexp="$ansexp"
6879 prefixvar=vendorarch
6882 : Final catch-all directories to search
6885 Lastly, you can have perl look in other directories for extensions and
6886 modules in addition to those already specified.
6887 These directories will be searched after
6891 test X"$vendorlib" != "X" && echo ' ' $vendorlib
6892 test X"$vendorarch" != "X" && echo ' ' $vendorarch
6894 case "$otherlibdirs" in
6895 ''|' ') dflt='none' ;;
6896 *) dflt="$otherlibdirs" ;;
6899 Enter a colon-separated set of extra paths to include in perl's @INC
6900 search path, or enter 'none' for no extra paths.
6904 rp='Colon-separated list of additional directories for perl to search?'
6907 ' '|''|none) otherlibdirs=' ' ;;
6908 *) otherlibdirs="$ans" ;;
6910 case "$otherlibdirs" in
6914 set d_perl_otherlibdirs
6917 : Cruising for prototypes
6919 echo "Checking out function prototypes..." >&4
6920 $cat >prototype.c <<EOCP
6925 int main(int argc, char *argv[]) {
6928 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
6929 echo "Your C compiler appears to support function prototypes."
6932 echo "Your C compiler doesn't seem to understand function prototypes."
6939 case "$prototype" in
6941 *) ansi2knr='ansi2knr'
6946 This version of $package can only be compiled by a compiler that
6947 understands function prototypes. Unfortunately, your C compiler
6949 doesn't seem to understand them. Sorry about that.
6951 If GNU cc is available for your system, perhaps you could try that instead.
6953 Eventually, we hope to support building Perl with pre-ANSI compilers.
6954 If you would like to help in that effort, please contact <perlbug@perl.org>.
6956 Aborting Configure now.
6968 Perl can be built with extra modules or bundles of modules which
6969 will be fetched from the CPAN and installed alongside Perl.
6971 Notice that you will need access to the CPAN; either via the Internet,
6972 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
6973 be asked later to configure the CPAN.pm module which will in turn do
6974 the installation of the rest of the extra modules or bundles.)
6976 Notice also that if the modules require any external software such as
6977 libraries and headers (the libz library and the zlib.h header for the
6978 Compress::Zlib module, for example) you MUST have any such software
6979 already installed, this configuration process will NOT install such
6982 If this doesn't make any sense to you, just accept the default '$dflt'.
6984 rp='Install any extra modules (y or n)?'
6990 Please list any extra modules or bundles to be installed from CPAN,
6991 with spaces between the names. The names can be in any format the
6992 'install' command of CPAN.pm will understand. (Answer 'none',
6993 without the quotes, to install no extra modules or bundles.)
7003 $rm -f ../extras.lst
7005 *) echo "(Saving the list of extras for later...)"
7006 echo "$extras" > ../extras.lst
7014 : determine where html pages for programs go
7015 set html1dir html1dir none
7019 If you wish to install html files for programs in $spackage, indicate
7020 the appropriate directory here. To skip installing html files,
7024 ''|none|$undef|' ') dflt=none ;;
7025 *) dflt=$html1dir ;;
7028 rp="Directory for the main $spackage html pages?"
7032 : Use ' ' for none so value is preserved next time through Configure
7033 $test X"$html1dir" = "X" && html1dir=' '
7035 : determine where html pages for libraries and modules go
7036 set html3dir html3dir none
7040 If you wish to install html files for modules associated with $spackage,
7041 indicate the appropriate directory here. To skip installing html files,
7044 : There is no obvious default. If they have specified html1dir, then
7045 : try to key off that, possibly changing .../html1 into .../html3.
7047 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7048 *) dflt=$html3dir ;;
7051 rp="Directory for the $spackage module html pages?"
7055 : Use ' ' for none so value is preserved next time through Configure
7056 $test X"$html3dir" = "X" && html3dir=' '
7058 : determine whether to install perl also as /usr/bin/perl
7061 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7063 Many scripts expect perl to be installed as /usr/bin/perl.
7065 If you want to, I can install the perl you are about to compile
7066 as /usr/bin/perl (in addition to $bin/perl).
7068 if test -f /usr/bin/perl; then
7071 However, please note that because you already have a /usr/bin/perl,
7072 overwriting that with a new Perl would very probably cause problems.
7073 Therefore I'm assuming you don't want to do that (unless you insist).
7076 case "$installusrbinperl" in
7077 "$define"|[yY]*) dflt='y';;
7083 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7086 case "$installusrbinperl" in
7087 "$undef"|[nN]*) dflt='n';;
7091 rp="Do you want to install perl as /usr/bin/perl?"
7094 [yY]*) val="$define";;
7100 set installusrbinperl
7104 echo "Checking for GNU C Library..." >&4
7106 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7107 alone are insufficient to distinguish different versions, such as
7108 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7109 libc version 2.1.0. A. Dougherty, June 3, 2002.
7115 # ifdef __GLIBC_MINOR__
7116 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
7117 # include <gnu/libc-version.h>
7118 printf("%s\n", gnu_get_libc_version());
7120 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7123 printf("%d\n", __GLIBC__);
7132 if eval $compile_ok && $run ./try > glibc.ver; then
7134 gnulibc_version=`$cat glibc.ver`
7135 echo "You are using the GNU C Library version $gnulibc_version"
7139 echo "You are not using the GNU C Library"
7141 $rm -f try try.* glibc.ver
7145 : see if nm is to be used to determine whether a symbol is defined or not
7149 case "$d_gnulibc" in
7152 echo "nm probably won't work on the GNU C Library." >&4
7158 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7160 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7161 echo "'nm' won't be sufficient on this sytem." >&4
7167 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7168 if $test $dflt -gt 20; then
7178 true|$define) dflt=y;;
7185 I can use $nm to extract the symbols from your C libraries. This
7186 is a time consuming task which may generate huge output on the disk (up
7187 to 3 megabytes) but that should make the symbols extraction faster. The
7188 alternative is to skip the 'nm' extraction part and to compile a small
7189 test program instead to determine whether each symbol is present. If
7190 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7191 this may be the best solution.
7193 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7196 rp="Shall I use $nm to extract C symbols from the libraries?"
7199 [Nn]*) usenm=false;;
7208 : nm options which may be necessary
7210 '') if $test -f /mach_boot; then
7212 elif $test -d /usr/ccs/lib; then
7213 nm_opt='-p' # Solaris (and SunOS?)
7214 elif $test -f /dgux; then
7216 elif $test -f /lib64/rld; then
7217 nm_opt='-p' # 64-bit Irix
7223 : nm options which may be necessary for shared libraries but illegal
7224 : for archive libraries. Thank you, Linux.
7225 case "$nm_so_opt" in
7226 '') case "$myuname" in
7228 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7229 nm_so_opt='--dynamic'
7238 : get list of predefined functions in a handy place
7243 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7249 *) for thislib in $libs; do
7252 : Handle C library specially below.
7255 thislib=`echo $thislib | $sed -e 's/^-l//'`
7256 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7258 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7260 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7262 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7264 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7266 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7268 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7273 libnames="$libnames $try"
7275 *) libnames="$libnames $thislib" ;;
7284 for xxx in $libpth; do
7285 $test -r $1 || set $xxx/libc.$so
7286 : The messy sed command sorts on library version numbers.
7288 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7289 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7291 s/[0-9][0-9]*/0000&/g
7292 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7295 $sort | $sed -e 's/^.* //'`
7298 $test -r $1 || set /usr/ccs/lib/libc.$so
7299 $test -r $1 || set /lib/libsys_s$_a
7305 if $test -r "$1"; then
7306 echo "Your (shared) C library seems to be in $1."
7308 elif $test -r /lib/libc && $test -r /lib/clib; then
7309 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7311 libc='/lib/clib /lib/libc'
7312 if $test -r /lib/syslib; then
7313 echo "(Your math library is in /lib/syslib.)"
7314 libc="$libc /lib/syslib"
7316 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7317 echo "Your C library seems to be in $libc, as you said before."
7318 elif $test -r $incpath/usr/lib/libc$_a; then
7319 libc=$incpath/usr/lib/libc$_a;
7320 echo "Your C library seems to be in $libc. That's fine."
7321 elif $test -r /lib/libc$_a; then
7323 echo "Your C library seems to be in $libc. You're normal."
7325 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7327 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7328 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7329 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7331 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7333 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7336 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7338 if $test -r "$tans"; then
7339 echo "Your C library seems to be in $tans, of all places."
7345 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7349 If the guess above is wrong (which it might be if you're using a strange
7350 compiler, or your machine supports multiple models), you can override it here.
7355 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7357 I can't seem to find your C library. I've looked in the following places:
7360 $sed 's/^/ /' libpath
7363 None of these seems to contain your C library. I need to get its name...
7368 rp='Where is your C library?'
7373 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7374 set X `cat libnames`
7377 case $# in 1) xxx=file; esac
7378 echo "Extracting names from the following $xxx for later perusal:" >&4
7380 $sed 's/^/ /' libnames >&4
7382 $echo $n "This may take a while...$c" >&4
7386 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7387 *) $nm $nm_opt $file 2>/dev/null;;
7392 $grep fprintf libc.tmp > libc.ptf
7393 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7394 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7396 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7398 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7400 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7402 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7404 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7406 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7408 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7410 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7412 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7414 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7416 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7418 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7420 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7421 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7423 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7425 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7427 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7429 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7431 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7433 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7435 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7437 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7439 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7441 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7443 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7445 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7447 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7449 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7451 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7454 $nm -p $* 2>/dev/null >libc.tmp
7455 $grep fprintf libc.tmp > libc.ptf
7456 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7457 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7463 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7465 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
7466 for thisname in $libnames $libc; do
7467 $ar t $thisname >>libc.tmp
7469 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7471 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7472 # Repeat libc to extract forwarders to DLL entries too
7473 for thisname in $libnames $libc; do
7474 $ar tv $thisname >>libc.tmp
7475 # Revision 50 of EMX has bug in $ar.
7476 # it will not extract forwarders to DLL entries
7477 # Use emximp which will extract exactly them.
7478 emximp -o tmp.imp $thisname \
7480 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7481 < tmp.imp >>libc.tmp
7484 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7487 echo "$ar didn't seem to work right." >&4
7488 echo "Maybe this is a Cray...trying bld instead..." >&4
7489 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
7491 for thisname in $libnames; do
7493 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7494 $ar t $thisname >>libc.tmp
7498 echo "That didn't work either. Giving up." >&4
7508 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7509 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7511 *) if $test -f /lib/syscalls.exp; then
7513 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7514 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' /lib/syscalls.exp >>libc.list
7520 $rm -f libnames libpath
7522 : see if dld is available
7526 : is a C symbol defined?
7529 -v) tf=libc.tmp; tdc="";;
7530 -a) tf=libc.tmp; tdc="[]";;
7531 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7534 case "$reuseval-$4" in
7536 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7541 if $test "$runnm" = true; then
7542 if $contains $tlook $tf >/dev/null 2>&1; then
7544 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7545 echo "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7546 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7547 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7548 $rm -f try$_exe try.c core core.* try.core;
7551 echo "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7552 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7553 $rm -f try$_exe try.c;
7558 $define) tval=true;;
7565 : define an is-in-libc? function
7566 inlibc='echo " "; td=$define; tu=$undef;
7567 sym=$1; var=$2; eval "was=\$$2";
7569 case "$reuseval$was" in
7579 echo "$sym() found." >&4;
7580 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7582 echo "$sym() NOT found." >&4;
7583 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7587 $define) echo "$sym() found." >&4;;
7588 *) echo "$sym() NOT found." >&4;;
7594 echo "Checking for C++..." >&4
7608 if eval $compile_ok && $run ./try >cplusplus$$; then
7609 val=`$cat cplusplus$$`
7610 echo "You are using a C++ compiler."
7613 echo "You are not using a C++ compiler."
7615 $rm -f try try.* cplusplus$$
7619 : see if dlopen exists
7621 xxx_ccflags="$ccflags"
7623 : with g++ one needs -shared to get is-in-libc to work for dlopen
7624 case "$gccversion" in
7626 *) case "$d_cplusplus" in
7627 "$define") ccflags="$ccflags -shared" ;;
7634 ccflags="$xxx_ccflags"
7636 : see if this is a unistd.h system
7637 set unistd.h i_unistd
7640 : determine which dynamic loading, if any, to compile in
7642 dldir="ext/DynaLoader"
7655 $define) dflt='y' ;;
7658 $define) dflt='y' ;;
7660 : Does a dl_xxx.xs file exist for this operating system
7661 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7664 rp="Do you wish to use dynamic loading?"
7671 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7672 dflt="$dldir/dl_${osname}.xs"
7673 elif $test "$d_dlopen" = "$define" ; then
7674 dflt="$dldir/dl_dlopen.xs"
7675 elif $test "$i_dld" = "$define" ; then
7676 dflt="$dldir/dl_dld.xs"
7681 *) dflt="$dldir/$dlsrc"
7684 echo "The following dynamic loading files are available:"
7685 : Can not go over to $dldir because getfile has path hard-coded in.
7686 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7687 rp="Source file to use for dynamic loading"
7693 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7697 Some systems may require passing special flags to $cc -c to
7698 compile modules that will be used to create a shared library.
7699 To use no flags, say "none".
7702 case "$cccdlflags" in
7703 '') case "$gccversion" in
7704 '') case "$osname" in
7706 next) dflt='none' ;;
7707 irix*) dflt='-KPIC' ;;
7708 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7709 sunos) dflt='-pic' ;;
7713 *) case "$osname" in
7714 darwin) dflt='none' ;;
7715 svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7720 *) dflt="$cccdlflags" ;;
7722 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7725 none) cccdlflags=' ' ;;
7726 *) cccdlflags="$ans" ;;
7731 Some systems use ld to create libraries that can be dynamically loaded,
7732 while other systems (such as those using ELF) use $cc.
7736 '') $cat >try.c <<EOM
7737 /* Test for whether ELF binaries are produced */
7749 int i = open("a.out",O_RDONLY);
7752 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7753 exit(0); /* succeed (yes, it's ELF) */
7758 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7760 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7764 echo "I'll use ld to build dynamic libraries."
7773 rp="What command should be used to create dynamic libraries?"
7779 Some systems may require passing special flags to $ld to create a
7780 library that can be dynamically loaded. If your ld flags include
7781 -L/other/path options to locate libraries outside your loader's normal
7782 search path, you may need to specify those -L options here as well. To
7783 use no flags, say "none".
7786 case "$lddlflags" in
7787 '') case "$osname" in
7788 beos) dflt='-nostart' ;;
7790 case "$gccversion" in
7791 '') dflt="$dflt +vnocompatwarnings" ;;
7794 linux|irix*|gnu*) dflt='-shared' ;;
7795 next) dflt='none' ;;
7796 solaris) dflt='-G' ;;
7797 sunos) dflt='-assert nodefinitions' ;;
7798 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
7802 *) dflt="$lddlflags" ;;
7805 : Try to guess additional flags to pick up local libraries.
7806 : Be careful not to append to a plain 'none'
7810 for thisflag in $ldflags; do
7815 *) dflt="$dflt $thisflag" ;;
7822 ''|' ') dflt='none' ;;
7825 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
7828 none) lddlflags=' ' ;;
7829 *) lddlflags="$ans" ;;
7834 Some systems may require passing special flags to $cc to indicate that
7835 the resulting executable will use dynamic linking. To use no flags,
7839 case "$ccdlflags" in
7840 '') case "$osname" in
7841 linux|hpux|gnu*) dflt='-Wl,-E' ;;
7842 next|sunos) dflt='none' ;;
7846 *) dflt="$ccdlflags" ;;
7848 rp="Any special flags to pass to $cc to use dynamic linking?"
7851 none) ccdlflags=' ' ;;
7852 *) ccdlflags="$ans" ;;
7866 # No dynamic loading being used, so don't bother even to prompt.
7869 *) case "$useshrplib" in
7870 '') case "$osname" in
7871 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
7873 also='Building a shared libperl is required for dynamic loading to work on your system.'
7878 also='Building a shared libperl is needed for MAB support.'
7896 The perl executable is normally obtained by linking perlmain.c with
7897 libperl${_a}, any static extensions (usually just DynaLoader), and
7898 any other libraries needed on this system (such as -lm, etc.). Since
7899 your system supports dynamic loading, it is probably possible to build
7900 a shared libperl.$so. If you will have more than one executable linked
7901 to libperl.$so, this will significantly reduce the size of each
7902 executable, but it may have a noticeable effect on performance. The
7903 default is probably sensible for your system.
7907 rp="Build a shared libperl.$so (y/n)"
7911 useshrplib='true' ;;
7912 *) useshrplib='false' ;;
7917 case "$useshrplib" in
7921 # Figure out a good name for libperl.so. Since it gets stored in
7922 # a version-specific architecture-dependent library, the version
7923 # number isn't really that important, except for making cc/ld happy.
7925 # A name such as libperl.so.3.1
7926 majmin="libperl.$so.$patchlevel.$subversion"
7927 # A name such as libperl.so.301
7928 majonly=`echo $patchlevel $subversion |
7929 $awk '{printf "%d%02d", $1, $2}'`
7930 majonly=libperl.$so.$majonly
7931 # I'd prefer to keep the os-specific stuff here to a minimum, and
7932 # rely on figuring it out from the naming of libc.
7933 case "${osname}${osvers}" in
7936 # XXX How handle the --version stuff for MAB?
7938 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
7941 cygwin*) # ld links against an importlib
7942 dflt=libperl$lib_ext
7944 *) # Try to guess based on whether libc has major.minor.
7946 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
7947 *libc.$so.[0-9]*) dflt=$majonly ;;
7948 *) dflt=libperl.$so ;;
7958 I need to select a good name for the shared libperl. If your system uses
7959 library names with major and minor numbers, then you might want something
7960 like $majmin. Alternatively, if your system uses a single version
7961 number for shared libraries, then you might want to use $majonly.
7962 Or, your system might be quite happy with a simple libperl.$so.
7964 Since the shared libperl will get installed into a version-specific
7965 architecture-dependent directory, the version number of the shared perl
7966 library probably isn't important, so the default should be o.k.
7969 rp='What name do you want to give to the shared libperl?'
7972 echo "Ok, I'll use $libperl"
7975 libperl="libperl${_a}"
7979 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
7983 WARNING: Use of the shrpdir variable for the installation location of
7984 the shared $libperl is not supported. It was never documented and
7985 will not work in this version. Let me (perlbug@perl.org)
7986 know of any problems this may cause.
7992 But your current setting of $shrpdir is
7993 the default anyway, so it's harmless.
7998 Further, your current attempted setting of $shrpdir
7999 conflicts with the value of $archlibexp/CORE
8000 that installperl will use.
8007 # How will the perl executable find the installed shared $libperl?
8008 # Add $xxx to ccdlflags.
8009 # If we can't figure out a command-line option, use $shrpenv to
8010 # set env LD_RUN_PATH. The main perl makefile uses this.
8011 shrpdir=$archlibexp/CORE
8014 if "$useshrplib"; then
8017 # We'll set it in Makefile.SH...
8022 freebsd|netbsd|openbsd|interix|dragonfly)
8023 xxx="-Wl,-R$shrpdir"
8025 bsdos|linux|irix*|dec_osf|gnu*)
8026 xxx="-Wl,-rpath,$shrpdir"
8029 # next doesn't like the default...
8032 # beos doesn't like the default, either.
8035 # hpux doesn't like the default, either.
8036 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8039 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8045 # Only add $xxx if it isn't already in ccdlflags.
8046 case " $ccdlflags " in
8048 *) ccdlflags="$ccdlflags $xxx"
8051 Adding $xxx to the flags
8052 passed to $ld so that the perl executable will find the
8053 installed shared $libperl.
8061 # Fix ccdlflags in AIX for building external extensions.
8062 # (For building Perl itself bare -bE:perl.exp is needed,
8063 # Makefile.SH takes care of this.)
8065 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8067 # Respect a hint or command-line value.
8069 '') shrpenv="$tmp_shrpenv" ;;
8071 case "$ldlibpthname" in
8072 '') ldlibpthname=LD_LIBRARY_PATH ;;
8073 none) ldlibpthname='' ;;
8076 : determine where manual pages are on this system
8080 syspath='/usr/share/man/man1 /usr/man/man1'
8081 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8082 syspath="$syspath /usr/man/u_man/man1"
8083 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8084 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8085 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8086 sysman=`./loc . /usr/man/man1 $syspath`
8089 if $test -d "$sysman"; then
8090 echo "System manual is in $sysman." >&4
8092 echo "Could not find manual pages in source form." >&4
8095 : determine where manual pages go
8096 set man1dir man1dir none
8100 $spackage has manual pages available in source form.
8104 echo "However, you don't have nroff, so they're probably useless to you."
8106 '') man1dir="none";;
8109 echo "If you don't want the manual sources installed, answer 'none'."
8114 lookpath="$prefixexp/share/man/man1"
8115 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8116 lookpath="$lookpath $prefixexp/man/p_man/man1"
8117 lookpath="$lookpath $prefixexp/man/u_man/man1"
8118 lookpath="$lookpath $prefixexp/man/man.1"
8120 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8121 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8131 rp="Where do the main $spackage manual pages (source) go?"
8133 if $test "X$man1direxp" != "X$ansexp"; then
8144 : What suffix to use on installed man pages
8151 rp="What suffix should be used for the main $spackage man pages?"
8153 '') case "$man1dir" in
8167 *) dflt="$man1ext";;
8174 : see if we can have long filenames
8176 first=123456789abcdef
8178 if (echo hi >$first) 2>/dev/null; then
8179 if $test -f 123456789abcde; then
8180 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8183 echo 'You can have filenames longer than 14 characters.'>&4
8188 You can't have filenames longer than 14 chars.
8189 You can't even think about them!
8195 $rm -rf 123456789abcde*
8197 : determine where library module manual pages go
8198 set man3dir man3dir none
8202 $spackage has manual pages for many of the library modules.
8208 However, you don't have nroff, so they're probably useless to you.
8211 '') man3dir="none";;
8215 case "$d_flexfnam" in
8218 However, your system can't handle the long file names like File::Basename.3.
8221 '') man3dir="none";;
8225 echo "If you don't want the manual sources installed, answer 'none'."
8226 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8228 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8229 if $test -d "$privlib/man/man3"; then
8232 WARNING: Previous versions of perl installed man3 pages into
8233 $privlib/man/man3. This version will suggest a
8234 new default of $dflt.
8238 rp='Do you wish to preserve the old behavior?(y/n)'
8241 y*) dflt="$privlib/man/man3" ;;
8246 *) dflt="$man3dir" ;;
8253 rp="Where do the $package library man pages (source) go?"
8263 : What suffix to use on installed man pages
8269 rp="What suffix should be used for the $package library man pages?"
8271 '') case "$man3dir" in
8285 *) dflt="$man3ext";;
8292 : see if we have to deal with yellow pages, now NIS.
8293 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8294 if $test -f /usr/etc/nibindd; then
8296 echo "I'm fairly confident you're on a NeXT."
8298 rp='Do you get the hosts file via NetInfo?'
8307 y*) hostcat='nidump hosts .';;
8308 *) case "$hostcat" in
8309 nidump*) hostcat='';;
8319 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8327 rp='Are you getting the hosts file via yellow pages?'
8330 y*) hostcat='ypcat hosts';;
8331 *) hostcat='cat /etc/hosts';;
8337 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8340 '') test -f /etc/group && groupcat='cat /etc/group';;
8343 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8346 : now get the host name
8348 echo "Figuring out host name..." >&4
8349 case "$myhostname" in
8351 echo 'Maybe "hostname" will work...'
8352 if tans=`sh -c hostname 2>&1` ; then
8360 if $test "$cont"; then
8362 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8363 if tans=`cat /etc/systemid 2>&1` ; then
8365 phostname='cat /etc/systemid'
8366 echo "Whadyaknow. Xenix always was a bit strange..."
8369 elif $test -r /etc/systemid; then
8370 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8373 if $test "$cont"; then
8374 echo 'No, maybe "uuname -l" will work...'
8375 if tans=`sh -c 'uuname -l' 2>&1` ; then
8377 phostname='uuname -l'
8379 echo 'Strange. Maybe "uname -n" will work...'
8380 if tans=`sh -c 'uname -n' 2>&1` ; then
8382 phostname='uname -n'
8384 echo 'Oh well, maybe I can mine it out of whoami.h...'
8385 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8386 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8387 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8389 case "$myhostname" in
8390 '') echo "Does this machine have an identity crisis or something?"
8393 echo "Well, you said $myhostname before..."
8394 phostname='echo $myhostname';;
8400 case "$myhostname" in
8401 '') myhostname=noname ;;
8403 : you do not want to know about this
8408 if $test "$myhostname" ; then
8410 rp='Your host name appears to be "'$myhostname'".'" Right?"
8418 : bad guess or no guess
8419 while $test "X$myhostname" = X ; do
8421 rp="Please type the (one word) name of your host:"
8426 : translate upper to lower if necessary
8427 case "$myhostname" in
8429 echo "(Normalizing case in your host name)"
8430 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8434 case "$myhostname" in
8436 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8437 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8438 echo "(Trimming domain name from host name--host name is now $myhostname)"
8440 *) case "$mydomain" in
8443 test "X$hostcat" = "Xypcat hosts" &&
8444 ypmatch "$myhostname" hosts 2>/dev/null |\
8445 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8448 test "X$hostcat" != "X" &&
8449 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8450 /[ ]$myhostname[ . ]/p" > hosts
8453 if $test -f hosts; then
8454 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8455 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8456 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8457 hosts | $sort | $uniq | \
8458 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8459 case `$echo X$dflt` in
8460 X*\ *) echo "(Several hosts in the database matched hostname)"
8463 X.) echo "(You do not have fully-qualified names in the hosts database)"
8467 echo "(I cannot locate a hosts database anywhere)"
8472 tans=`./loc resolv.conf X /etc /usr/etc`
8473 if $test -f "$tans"; then
8474 echo "(Attempting domain name extraction from $tans)"
8475 dflt=.`$sed -n -e 's/ / /g' \
8476 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8477 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8479 .) dflt=.`$sed -n -e 's/ / /g' \
8480 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8481 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8488 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8489 dflt=.`sh -c domainname 2>/dev/null`
8492 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8496 case "$dflt$osname" in
8497 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8498 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8502 .) echo "(Lost all hope -- silly guess then)"
8508 *) dflt="$mydomain";;
8512 rp="What is your domain name?"
8522 : translate upper to lower if necessary
8525 echo "(Normalizing case in your domain name)"
8526 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8530 : a little sanity check here
8531 case "$phostname" in
8534 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8535 $myhostname$mydomain|$myhostname) ;;
8537 case "$phostname" in
8539 echo "(That doesn't agree with your whoami.h file, by the way.)"
8542 echo "(That doesn't agree with your $phostname command, by the way.)"
8552 I need to get your e-mail address in Internet format if possible, i.e.
8553 something like user@host.domain. Please answer accurately since I have
8554 no easy means to double check it. The default value provided below
8555 is most probably close to reality but may not be valid from outside
8556 your organization...
8560 while test "$cont"; do
8562 '') dflt="$cf_by@$myhostname$mydomain";;
8563 *) dflt="$cf_email";;
8565 rp='What is your e-mail address?'
8571 rp='Address does not look like an Internet one. Use it anyway?'
8587 If you or somebody else will be maintaining perl at your site, please
8588 fill in the correct e-mail address here so that they may be contacted
8589 if necessary. Currently, the "perlbug" program included with perl
8590 will send mail to this address in addition to perlbug@perl.org. You may
8591 enter "none" for no administrator.
8594 case "$perladmin" in
8595 '') dflt="$cf_email";;
8596 *) dflt="$perladmin";;
8598 rp='Perl administrator e-mail address'
8602 : determine whether to only install version-specific parts.
8605 Do you want to install only the version-specific parts of the perl
8606 distribution? Usually you do *not* want to do this.
8608 case "$versiononly" in
8609 "$define"|[Yy]*|true) dflt='y' ;;
8612 rp="Do you want to install only the version-specific parts of perl?"
8615 [yY]*) val="$define";;
8621 case "$versiononly" in
8622 "$define") inc_version_list=''
8623 inc_version_list_init=0
8627 : figure out how to guarantee perl startup
8628 : XXX Note that this currently takes advantage of the bug that binexp ignores
8629 : the Configure -Dinstallprefix setting, which in turn means that under
8630 : relocatable @INC, initialinstalllocation is what binexp started as.
8631 case "$startperl" in
8633 case "$sharpbang" in
8637 I can use the #! construct to start perl on your system. This will
8638 make startup of perl scripts faster, but may cause problems if you
8639 want to share those scripts and perl is not in a standard place
8640 ($initialinstalllocation/perl) on all your platforms. The alternative
8641 is to force a shell by starting the script with a single ':' character.
8644 case "$versiononly" in
8645 "$define") dflt="$initialinstalllocation/perl$version";;
8646 *) dflt="$initialinstalllocation/perl";;
8648 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8651 none) startperl=": # use perl";;
8652 *) startperl="#!$ans"
8653 if $test 30 -lt `echo "$ans" | wc -c`; then
8656 WARNING: Some systems limit the #! command to 32 characters.
8657 If you experience difficulty running Perl scripts with #!, try
8658 installing Perl in a directory with a shorter pathname.
8664 *) startperl=": # use perl"
8669 echo "I'll use $startperl to start perl scripts."
8671 : figure best path for perl in scripts
8674 case "$versiononly" in
8675 "$define") perlpath="$initialinstalllocation/perl$version";;
8676 *) perlpath="$initialinstalllocation/perl";;
8678 case "$startperl" in
8683 I will use the "eval 'exec'" idiom to start Perl on your system.
8684 I can use the full path of your Perl binary for this purpose, but
8685 doing so may cause problems if you want to share those scripts and
8686 Perl is not always in a standard place ($initialinstalllocation/perl).
8689 dflt="$initialinstalllocation/perl"
8690 rp="What path shall I use in \"eval 'exec'\"?"
8697 case "$startperl" in
8699 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8702 : determine where public executable scripts go
8703 set scriptdir scriptdir
8705 case "$scriptdir" in
8708 : guess some guesses
8709 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8710 $test -d /usr/share/bin && dflt=/usr/share/bin
8711 $test -d /usr/local/script && dflt=/usr/local/script
8712 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8713 $test -d $prefixexp/script && dflt=$prefixexp/script
8717 *) dflt="$scriptdir"
8722 Some installations have a separate directory just for executable scripts so
8723 that they can mount it across multiple architectures but keep the scripts in
8724 one spot. You might, for example, have a subdirectory of /usr/share for this.
8725 Or you might just lump your scripts in with all your other executables.
8729 rp='Where do you keep publicly executable scripts?'
8731 if $test "X$ansexp" != "X$scriptdirexp"; then
8737 : A little fix up for an irregularly named variable.
8738 installscript="$installscriptdir"
8740 : determine where add-on public executables go
8742 '') dflt=$siteprefix/bin ;;
8746 rp='Pathname where the add-on public executables should be installed?'
8751 : determine where add-on html pages go
8752 : There is no standard location, so try to copy the previously-selected
8753 : directory structure for the core html pages.
8754 case "$sitehtml1dir" in
8755 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8756 *) dflt=$sitehtml1dir ;;
8759 ''|' ') dflt=none ;;
8762 rp='Pathname where the site-specific html pages should be installed?'
8764 prefixvar=sitehtml1dir
8767 : determine where add-on library html pages go
8768 : There is no standard location, so try to copy the previously-selected
8769 : directory structure for the core html pages.
8770 case "$sitehtml3dir" in
8771 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8772 *) dflt=$sitehtml3dir ;;
8775 ''|' ') dflt=none ;;
8778 rp='Pathname where the site-specific library html pages should be installed?'
8780 prefixvar=sitehtml3dir
8783 : determine where add-on manual pages go
8784 case "$siteman1dir" in
8785 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
8786 *) dflt=$siteman1dir ;;
8789 ''|' ') dflt=none ;;
8792 rp='Pathname where the site-specific manual pages should be installed?'
8794 prefixvar=siteman1dir
8797 : determine where add-on library man pages go
8798 case "$siteman3dir" in
8799 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
8800 *) dflt=$siteman3dir ;;
8803 ''|' ') dflt=none ;;
8806 rp='Pathname where the site-specific library manual pages should be installed?'
8808 prefixvar=siteman3dir
8811 : determine where add-on public executable scripts go
8812 case "$sitescript" in
8813 '') dflt=$siteprefix/script
8814 $test -d $dflt || dflt=$sitebin ;;
8815 *) dflt="$sitescript" ;;
8818 rp='Pathname where add-on public executable scripts should be installed?'
8820 prefixvar=sitescript
8823 case "$usefaststdio" in
8824 $define|true|[yY]*|'')
8825 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
8835 Perl can be built to use 'fast stdio', which means using the stdio
8836 library but also directly manipulating the stdio buffers to enable
8837 faster I/O. Using stdio is better for backward compatibility (especially
8838 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
8839 interface has been preferred instead of stdio.
8841 If this doesn't make any sense to you, just accept the default '$dflt'.
8843 rp='Use the "fast stdio" if available?'
8846 y|Y) val="$define" ;;
8853 : define an is-a-typedef? function
8854 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8856 "") inclist="sys/types.h";;
8858 eval "varval=\$$var";
8862 for inc in $inclist; do
8863 echo "#include <$inc>" >>temp.c;
8865 echo "#ifdef $type" >> temp.c;
8866 echo "printf(\"We have $type\");" >> temp.c;
8867 echo "#endif" >> temp.c;
8868 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8869 if $contains $type temp.E >/dev/null 2>&1; then
8875 *) eval "$var=\$varval";;
8878 : define an is-a-typedef? function that prompts if the type is not available.
8879 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8881 "") inclist="sys/types.h";;
8883 eval "varval=\$$var";
8887 for inc in $inclist; do
8888 echo "#include <$inc>" >>temp.c;
8890 echo "#ifdef $type" >> temp.c;
8891 echo "printf(\"We have $type\");" >> temp.c;
8892 echo "#endif" >> temp.c;
8893 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8895 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
8896 if $contains $type temp.E >/dev/null 2>&1; then
8897 echo "$type found." >&4;
8900 echo "$type NOT found." >&4;
8906 *) eval "$var=\$varval";;
8909 : see what type lseek is declared as in the kernel
8910 rp="What is the type used for lseek's offset on this system?"
8911 set off_t lseektype long stdio.h sys/types.h
8915 echo "Checking to see how big your file offsets are..." >&4
8917 #include <sys/types.h>
8921 printf("%d\n", (int)sizeof($lseektype));
8926 if eval $compile_ok; then
8927 lseeksize=`$run ./try`
8928 echo "Your file offsets are $lseeksize bytes long."
8932 echo "(I can't seem to compile the test program. Guessing...)"
8933 rp="What is the size of your file offsets (in bytes)?"
8939 : see what type file positions are declared as in the library
8940 rp="What is the type for file position used by fsetpos()?"
8941 set fpos_t fpostype long stdio.h sys/types.h
8946 *_t) zzz="$fpostype" ;;
8949 echo "Checking the size of $zzz..." >&4
8951 #include <sys/types.h>
8958 printf("%d\n", (int)sizeof($fpostype));
8963 if eval $compile_ok; then
8967 echo "(I can't execute the test program--guessing $fpossize.)" >&4
8970 echo "Your $zzz is $fpossize bytes long."
8976 echo "(I can't compile the test program. Guessing...)" >&4
8977 rp="What is the size of your file positions (in bytes)?"
8982 # Backward compatibility (uselfs is deprecated).
8984 "$define"|true|[yY]*)
8987 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
8989 uselargefiles="$define"
8993 case "$lseeksize:$fpossize" in
8996 You can have files larger than 2 gigabytes.
8999 *) case "$uselargefiles" in
9000 "$undef"|false|[nN]*) dflt='n' ;;
9005 Perl can be built to understand large files (files larger than 2 gigabytes)
9006 on some systems. To do so, Configure can be run with -Duselargefiles.
9008 If this doesn't make any sense to you, just accept the default '$dflt'.
9010 rp='Try to understand large files, if available?'
9013 y|Y) val="$define" ;;
9020 : Look for a hint-file generated 'call-back-unit'. If the
9021 : user has specified that a large files perl is to be built,
9022 : we may need to set or change some other defaults.
9023 if $test -f uselargefiles.cbu; then
9024 echo "Your platform has some specific hints regarding large file builds, using them..."
9025 . ./uselargefiles.cbu
9027 case "$uselargefiles" in
9029 if $test -f uselargefiles.cbu; then
9031 echo "Rechecking to see how big your file offsets are..." >&4
9033 #include <sys/types.h>
9037 printf("%d\n", (int)sizeof($lseektype));
9042 if eval $compile_ok; then
9043 lseeksize=`$run ./try`
9044 $echo "Your file offsets are now $lseeksize bytes long."
9048 echo "(I can't seem to compile the test program. Guessing...)"
9049 rp="What is the size of your file offsets (in bytes)?"
9054 *_t) zzz="$fpostype" ;;
9057 $echo $n "Rechecking the size of $zzz...$c" >&4
9059 #include <sys/types.h>
9066 printf("%d\n", (int)sizeof($fpostype));
9071 if eval $compile_ok; then
9076 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9079 echo " $fpossize bytes." >&4
9085 echo "(I can't compile the test program. Guessing...)" >&4
9086 rp="What is the size of your file positions (in bytes)?"
9095 case "$vendorprefix" in
9096 '') d_vendorbin="$undef"
9100 *) d_vendorbin="$define"
9101 : determine where vendor-supplied executables go.
9102 case "$vendorbin" in
9103 '') dflt=$vendorprefix/bin ;;
9104 *) dflt="$vendorbin" ;;
9107 rp='Pathname for the vendor-supplied executables directory?'
9110 vendorbinexp="$ansexp"
9116 case "$vendorprefix" in
9117 '') vendorhtml1dir=''
9118 vendorhtml1direxp=''
9120 *) : determine where vendor-supplied html pages go.
9121 : There is no standard location, so try to copy the previously-selected
9122 : directory structure for the core html pages.
9123 : XXX Better default suggestions would be welcome.
9124 case "$vendorhtml1dir" in
9125 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9126 *) dflt=$vendorhtml1dir ;;
9129 ''|' ') dflt=none ;;
9132 rp='Pathname for the vendor-supplied html pages?'
9134 vendorhtml1dir="$ans"
9135 vendorhtml1direxp="$ansexp"
9138 : Use ' ' for none so value is preserved next time through Configure
9139 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9140 prefixvar=vendorhtml1dir
9143 case "$vendorprefix" in
9144 '') vendorhtml3dir=''
9145 vendorhtml3direxp=''
9147 *) : determine where vendor-supplied module html pages go.
9148 : There is no standard location, so try to copy the previously-selected
9149 : directory structure for the core html pages.
9150 : XXX Better default suggestions would be welcome.
9151 case "$vendorhtml3dir" in
9152 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9153 *) dflt=$vendorhtml3dir ;;
9156 ''|' ') dflt=none ;;
9159 rp='Pathname for the vendor-supplied html pages?'
9161 vendorhtml3dir="$ans"
9162 vendorhtml3direxp="$ansexp"
9165 : Use ' ' for none so value is preserved next time through Configure
9166 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9167 prefixvar=vendorhtml3dir
9170 case "$vendorprefix" in
9171 '') vendorman1dir=''
9174 *) : determine where vendor-supplied manual pages go.
9175 case "$vendorman1dir" in
9176 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9177 *) dflt=$vendorman1dir ;;
9180 ''|' ') dflt=none ;;
9183 rp='Pathname for the vendor-supplied manual section 1 pages?'
9185 vendorman1dir="$ans"
9186 vendorman1direxp="$ansexp"
9189 : Use ' ' for none so value is preserved next time through Configure
9190 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9191 prefixvar=vendorman1dir
9194 case "$vendorprefix" in
9195 '') vendorman3dir=''
9198 *) : determine where vendor-supplied module manual pages go.
9199 case "$vendorman3dir" in
9200 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9201 *) dflt=$vendorman3dir ;;
9204 ''|' ') dflt=none ;;
9207 rp='Pathname for the vendor-supplied manual section 3 pages?'
9209 vendorman3dir="$ans"
9210 vendorman3direxp="$ansexp"
9213 : Use ' ' for none so value is preserved next time through Configure
9214 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9215 prefixvar=vendorman3dir
9218 case "$vendorprefix" in
9219 '') d_vendorscript="$undef"
9223 *) d_vendorscript="$define"
9224 : determine where vendor-supplied scripts go.
9225 case "$vendorscript" in
9226 '') dflt=$vendorprefix/script
9227 $test -d $dflt || dflt=$vendorbin ;;
9228 *) dflt="$vendorscript" ;;
9232 The installation process will create a directory for
9233 vendor-supplied scripts.
9237 rp='Pathname for the vendor-supplied scripts directory?'
9240 vendorscriptexp="$ansexp"
9243 prefixvar=vendorscript
9246 : see if qgcvt exists
9252 if $test X"$d_longdbl" = X"$define"; then
9254 echo "Checking how to print long doubles..." >&4
9256 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9257 $cat >try.c <<'EOCP'
9258 #include <sys/types.h>
9262 printf("%.3f\n", d);
9266 if eval $compile; then
9270 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9271 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9272 echo "We will use %f."
9278 if $test X"$sPRIfldbl" = X; then
9279 $cat >try.c <<'EOCP'
9280 #include <sys/types.h>
9283 long double d = 123.456;
9284 printf("%.3Lf\n", d);
9288 if eval $compile; then
9292 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9293 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9294 echo "We will use %Lf."
9300 if $test X"$sPRIfldbl" = X; then
9301 $cat >try.c <<'EOCP'
9302 #include <sys/types.h>
9305 long double d = 123.456;
9306 printf("%.3llf\n", d);
9310 if eval $compile; then
9314 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9315 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9316 echo "We will use %llf."
9322 if $test X"$sPRIfldbl" = X; then
9323 $cat >try.c <<'EOCP'
9324 #include <sys/types.h>
9327 long double d = 123.456;
9328 printf("%.3lf\n", d);
9332 if eval $compile; then
9336 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9337 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9338 echo "We will use %lf."
9344 if $test X"$sPRIfldbl" = X; then
9345 echo "Cannot figure out how to print long doubles." >&4
9347 sSCNfldbl=$sPRIfldbl # expect consistency
9354 case "$sPRIfldbl" in
9355 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9356 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9357 d_SCNfldbl="$undef";
9359 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9360 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9361 d_SCNfldbl="$define";
9365 : Check how to convert floats to strings.
9367 if test "X$d_Gconvert" = X; then
9370 echo "Checking for an efficient way to convert floats to strings."
9372 case "$uselongdouble" in
9373 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9375 case "$d_longdbl" in
9376 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9378 case "$d_PRIgldbl" in
9379 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9383 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9384 char *myname = "gconvert";
9387 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9388 char *myname = "gcvt";
9391 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9392 char *myname = "qgcvt";
9393 #define DOUBLETYPE long double
9396 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9398 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9400 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9403 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9405 char *myname = "sprintf";
9409 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9410 #define DOUBLETYPE long double
9412 #define DOUBLETYPE double
9418 #define I_STDLIB $i_stdlib
9424 checkit(expect, got)
9428 if (strcmp(expect, got)) {
9429 printf("%s oddity: Expected %s, got %s\n",
9430 myname, expect, got);
9440 /* This must be 1st test on (which?) platform */
9441 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9442 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9443 checkit("0.1", buf);
9445 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9446 checkit("0.01", buf);
9448 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9449 checkit("0.001", buf);
9451 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9452 checkit("0.0001", buf);
9454 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9455 if (strlen(buf) > 5)
9456 checkit("9e-005", buf); /* for Microsoft ?? */
9458 checkit("9e-05", buf);
9460 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9463 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9464 checkit("1.1", buf);
9466 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9467 checkit("1.01", buf);
9469 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9470 checkit("1.001", buf);
9472 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9473 checkit("1.0001", buf);
9475 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9476 checkit("1.00001", buf);
9478 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9479 checkit("1.000001", buf);
9481 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9484 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9487 /* Some Linux gcvt's give 1.e+5 here. */
9488 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9489 checkit("100000", buf);
9491 /* Some Linux gcvt's give -1.e+5 here. */
9492 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9493 checkit("-100000", buf);
9495 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9496 checkit("123.456", buf);
9498 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9499 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9500 /* 34 should be enough to scare even long double
9501 * places into using the e notation. */
9502 if (strlen(buf) > 5)
9503 checkit("1e+034", buf); /* for Microsoft */
9505 checkit("1e+34", buf);
9507 /* For Perl, if you add additional tests here, also add them to
9508 * t/base/num.t for benefit of platforms not using Configure or
9509 * overriding d_Gconvert */
9514 : first add preferred functions to our list
9516 for xxx_convert in $gconvert_preference; do
9517 case $xxx_convert in
9518 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9519 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9522 : then add any others
9523 for xxx_convert in gconvert gcvt sprintf; do
9526 *) xxx_list="$xxx_list $xxx_convert" ;;
9530 case "$d_longdbl$uselongdouble" in
9532 : again, add prefered functions to our list first
9534 for xxx_convert in $gconvert_ld_preference; do
9535 case $xxx_convert in
9536 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9537 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9540 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9541 for xxx_convert in qgcvt sprintf $xxx_list; do
9542 case "$xxx_ld_list" in
9543 $xxx_convert*|*" $xxx_convert"*) ;;
9544 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9547 : if sprintf cannot do long doubles, move it to the end
9548 if test "$d_PRIgldbl" != "$define"; then
9549 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9551 : if no qgcvt, remove it
9552 if test "$d_qgcvt" != "$define"; then
9553 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9556 xxx_list="$xxx_ld_list"
9560 for xxx_convert in $xxx_list; do
9561 echo "Trying $xxx_convert..."
9563 set try -DTRY_$xxx_convert
9564 if eval $compile; then
9565 echo "$xxx_convert() found." >&4
9567 echo "I'll use $xxx_convert to convert floats into a string." >&4
9570 echo "...But $xxx_convert didn't work as I expected."
9574 echo "$xxx_convert NOT found." >&4
9578 if test X$xxx_convert = X; then
9579 echo "*** WHOA THERE!!! ***" >&4
9580 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9584 case "$xxx_convert" in
9585 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9586 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9587 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9588 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9589 "$define$define$define")
9590 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9591 "$define$define$undef")
9592 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9593 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9600 : see if _fwalk exists
9604 : Initialize h_fcntl
9607 : Initialize h_sysfile
9610 : access call always available on UNIX
9614 : locate the flags for 'access()'
9618 $cat >access.c <<EOCP
9619 #include <sys/types.h>
9624 #include <sys/file.h>
9637 : check sys/file.h first, no particular reason here
9638 if $test `./findhdr sys/file.h` && \
9639 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9641 echo "<sys/file.h> defines the *_OK access constants." >&4
9642 elif $test `./findhdr fcntl.h` && \
9643 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9645 echo "<fcntl.h> defines the *_OK access constants." >&4
9646 elif $test `./findhdr unistd.h` && \
9647 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9648 echo "<unistd.h> defines the *_OK access constants." >&4
9650 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9656 : see if accessx exists
9657 set accessx d_accessx
9660 : see if aintl exists
9664 : see if alarm exists
9668 : see if POSIX threads are available
9669 set pthread.h i_pthread
9672 : define a fucntion to check prototypes
9673 $cat > protochk <<EOSH
9676 optimize="$optimize"
9678 prototype="$prototype"
9681 usethreads=$usethreads
9682 i_pthread=$i_pthread
9683 pthread_h_first=$pthread_h_first
9686 $cat >> protochk <<'EOSH'
9691 while test $# -ge 2; do
9693 $define) echo "#include <$2>" >> try.c ;;
9694 literal) echo "$2" >> try.c ;;
9696 # Extra magic for the benefit of systems that need pthread.h
9697 # to be included early to correctly detect threadsafe functions.
9698 # Such functions must guarantee themselves, though, that the usethreads
9699 # and i_pthread have been defined, before calling protochk.
9700 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
9701 echo "#include <pthread.h>" >> try.c
9706 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
9707 cat >> try.c <<'EOCP'
9708 #ifdef CAN_PROTOTYPE
9709 #define _(args) args
9714 echo "$foo" >> try.c
9715 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
9716 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
9724 hasproto='varname=$1; func=$2; shift; shift;
9725 while $test $# -ge 2; do
9727 $define) echo "#include <$2>";;
9731 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
9732 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
9733 echo "$func() prototype found.";
9736 echo "$func() prototype NOT found.";
9741 $rm -f try.c tryout.c'
9743 : see if sys/types.h has to be included
9744 set sys/types.h i_systypes
9747 : see if sys/select.h has to be included
9748 set sys/select.h i_sysselct
9751 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
9752 while $test $# -ge 2; do
9754 $define) echo "#include <$2>";;
9758 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
9760 if eval $compile; then
9769 : see if we should include time.h, sys/time.h, or both
9771 if test "X$timeincl" = X; then
9772 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9773 $echo $n "I'm now running the test program...$c"
9775 #include <sys/types.h>
9780 #ifdef SYSTIMEKERNEL
9783 #include <sys/time.h>
9786 #include <sys/select.h>
9799 struct timezone tzp;
9801 if (foo.tm_sec == foo.tm_sec)
9804 if (bar.tv_sec == bar.tv_sec)
9811 for s_timezone in '-DS_TIMEZONE' ''; do
9813 for s_timeval in '-DS_TIMEVAL' ''; do
9814 for i_systimek in '' '-DSYSTIMEKERNEL'; do
9815 for i_time in '' '-DI_TIME'; do
9816 for i_systime in '-DI_SYSTIME' ''; do
9819 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
9820 if eval $compile; then
9821 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
9825 $echo $n "Succeeded with $flags$c"
9837 *SYSTIMEKERNEL*) i_systimek="$define"
9838 timeincl=`./findhdr sys/time.h`
9839 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
9840 *) i_systimek="$undef";;
9843 *I_TIME*) i_time="$define"
9844 timeincl=`./findhdr time.h`" $timeincl"
9845 echo "We'll include <time.h>." >&4;;
9846 *) i_time="$undef";;
9849 *I_SYSTIME*) i_systime="$define"
9850 timeincl=`./findhdr sys/time.h`" $timeincl"
9851 echo "We'll include <sys/time.h>." >&4;;
9852 *) i_systime="$undef";;
9856 : see if struct tm knows about tm_zone
9857 case "$i_systime$i_time" in
9860 echo "Checking to see if your struct tm has tm_zone field..." >&4
9861 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
9869 case "$d_tm_tm_zone" in
9870 "$define") echo "Yes, it does." ;;
9871 *) echo "No, it doesn't." ;;
9873 : see if struct tm knows about tm_gmtoff
9874 case "$i_systime$i_time" in
9877 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
9878 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
9886 case "$d_tm_tm_gmtoff" in
9887 "$define") echo "Yes, it does." ;;
9888 *) echo "No, it doesn't." ;;
9891 : see if asctime_r exists
9892 set asctime_r d_asctime_r
9894 case "$d_asctime_r" in
9896 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
9897 case "$d_asctime_r_proto:$usethreads" in
9898 ":define") d_asctime_r_proto=define
9899 set d_asctime_r_proto asctime_r $hdrs
9903 case "$d_asctime_r_proto" in
9905 case "$asctime_r_proto" in
9906 ''|0) try='char* asctime_r(const struct tm*, char*);'
9907 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SB ;;
9909 case "$asctime_r_proto" in
9910 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
9911 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SBI ;;
9913 case "$asctime_r_proto" in
9914 ''|0) try='int asctime_r(const struct tm*, char*);'
9915 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SB ;;
9917 case "$asctime_r_proto" in
9918 ''|0) try='int asctime_r(const struct tm*, char*, int);'
9919 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SBI ;;
9921 case "$asctime_r_proto" in
9922 ''|0) d_asctime_r=undef
9924 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
9925 * ) case "$asctime_r_proto" in
9926 REENTRANT_PROTO*) ;;
9927 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
9929 echo "Prototype: $try" ;;
9932 *) case "$usethreads" in
9933 define) echo "asctime_r has no prototype, not using it." >&4 ;;
9940 *) asctime_r_proto=0
9944 : see if atolf exists
9948 : see if atoll exists
9952 : Look for GCC-style attribute format
9953 case "$d_attribute_format" in
9956 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
9957 $cat >attrib.c <<'EOCP'
9959 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
9961 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9962 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9963 echo "Your C compiler doesn't support __attribute__((format))."
9966 echo "Your C compiler supports __attribute__((format))."
9970 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9974 *) val="$d_attribute_format" ;;
9976 set d_attribute_format
9980 : Look for GCC-style attribute malloc
9981 case "$d_attribute_malloc" in
9984 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
9985 $cat >attrib.c <<'EOCP'
9987 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
9989 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9990 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9991 echo "Your C compiler doesn't support __attribute__((malloc))."
9994 echo "Your C compiler supports __attribute__((malloc))."
9998 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10002 *) val="$d_attribute_malloc" ;;
10004 set d_attribute_malloc
10008 : Look for GCC-style attribute nonnull
10009 case "$d_attribute_nonnull" in
10012 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10013 $cat >attrib.c <<'EOCP'
10015 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10017 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10018 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10019 echo "Your C compiler doesn't support __attribute__((nonnull))."
10022 echo "Your C compiler supports __attribute__((nonnull))."
10026 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10030 *) val="$d_attribute_nonnull" ;;
10032 set d_attribute_nonnull
10036 : Look for GCC-style attribute noreturn
10037 case "$d_attribute_noreturn" in
10040 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10041 $cat >attrib.c <<'EOCP'
10043 void fall_over_dead( void ) __attribute__((noreturn));
10045 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10046 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10047 echo "Your C compiler doesn't support __attribute__((noreturn))."
10050 echo "Your C compiler supports __attribute__((noreturn))."
10054 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10058 *) val="$d_attribute_noreturn" ;;
10060 set d_attribute_noreturn
10064 : Look for GCC-style attribute pure
10065 case "$d_attribute_pure" in
10068 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10069 $cat >attrib.c <<'EOCP'
10071 int square( int n ) __attribute__((pure));
10073 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10074 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10075 echo "Your C compiler doesn't support __attribute__((pure))."
10078 echo "Your C compiler supports __attribute__((pure))."
10082 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10086 *) val="$d_attribute_pure" ;;
10088 set d_attribute_pure
10092 : Look for GCC-style attribute unused
10093 case "$d_attribute_unused" in
10096 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10097 $cat >attrib.c <<'EOCP'
10099 int do_something( int dummy __attribute__((unused)), int n );
10101 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10102 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10103 echo "Your C compiler doesn't support __attribute__((unused))."
10106 echo "Your C compiler supports __attribute__((unused))."
10110 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10114 *) val="$d_attribute_unused" ;;
10116 set d_attribute_unused
10120 : Look for GCC-style attribute warn_unused_result
10121 case "$d_attribute_warn_unused_result" in
10124 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10125 $cat >attrib.c <<'EOCP'
10127 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10129 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10130 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10131 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10134 echo "Your C compiler supports __attribute__((warn_unused_result))."
10138 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10142 *) val="$d_attribute_warn_unused_result" ;;
10144 set d_attribute_warn_unused_result
10148 : see if bcmp exists
10152 : see if bcopy exists
10156 : see if getpgrp exists
10157 set getpgrp d_getpgrp
10160 case "$d_getpgrp" in
10163 echo "Checking to see which flavor of getpgrp is in use..."
10165 #$i_unistd I_UNISTD
10166 #include <sys/types.h>
10168 # include <unistd.h>
10170 #$i_stdlib I_STDLIB
10172 #include <stdlib.h>
10176 if (getuid() == 0) {
10177 printf("(I see you are running Configure as super-user...)\n");
10180 #ifdef TRY_BSD_PGRP
10181 if (getpgrp(1) == 0)
10190 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10191 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10193 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10194 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10197 echo "I can't seem to compile and run the test program."
10199 xxx="a USG one, i.e. you use getpgrp()."
10201 # SVR4 systems can appear rather BSD-ish.
10202 case "$i_unistd" in
10204 xxx="a BSD one, i.e. you use getpgrp(pid)."
10208 xxx="probably a USG one, i.e. you use getpgrp()."
10213 echo "Assuming your getpgrp is $xxx" >&4
10222 : see if setpgrp exists
10223 set setpgrp d_setpgrp
10226 case "$d_setpgrp" in
10229 echo "Checking to see which flavor of setpgrp is in use..."
10231 #$i_unistd I_UNISTD
10232 #include <sys/types.h>
10234 # include <unistd.h>
10236 #$i_stdlib I_STDLIB
10238 #include <stdlib.h>
10242 if (getuid() == 0) {
10243 printf("(I see you are running Configure as super-user...)\n");
10246 #ifdef TRY_BSD_PGRP
10247 if (-1 == setpgrp(1, 1))
10250 if (setpgrp() != -1)
10256 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10257 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10259 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10260 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10263 echo "(I can't seem to compile and run the test program.)"
10265 xxx="a USG one, i.e. you use setpgrp()."
10267 # SVR4 systems can appear rather BSD-ish.
10268 case "$i_unistd" in
10270 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10274 xxx="probably a USG one, i.e. you use setpgrp()."
10279 echo "Assuming your setpgrp is $xxx" >&4
10287 : Look for GCC-style __builtin_choose_expr
10288 case "$d_builtin_choose_expr" in
10291 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10292 $cat >try.c <<'EOCP'
10293 #include <assert.h>
10294 #include <stdlib.h>
10297 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10300 assert( SYRINX(1) == 2112 );
10301 assert( SYRINX(1) != 5150 );
10302 assert( SYRINX(0) == 5150 );
10303 assert( SYRINX(0) != 2112 );
10304 puts( "All good!" );
10310 if eval $compile; then
10311 echo "Your C compiler supports __builtin_choose_expr."
10314 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10318 *) val="$d_builtin_choose_expr" ;;
10321 set d_builtin_choose_expr
10323 $rm -f try.* try core core.try.*
10325 : Look for GCC-style __builtin_expect
10326 case "$d_builtin_expect" in
10329 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10330 $cat >builtin.c <<'EOCP'
10333 if ( __builtin_expect(n, 0) ) n = 1;
10337 if eval $compile; then
10338 echo "Your C compiler supports __builtin_choose_expr."
10341 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10345 *) val="$d_builtin_expect" ;;
10348 set d_builtin_expect
10350 $rm -f try.* try core core.try.*
10352 : see if bzero exists
10356 : see if stdarg is available
10358 if $test `./findhdr stdarg.h`; then
10359 echo "<stdarg.h> found." >&4
10362 echo "<stdarg.h> NOT found." >&4
10366 : see if varags is available
10368 if $test `./findhdr varargs.h`; then
10369 echo "<varargs.h> found." >&4
10371 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
10374 : set up the varargs testing programs
10375 $cat > varargs.c <<EOP
10377 #include <stdarg.h>
10380 #include <varargs.h>
10384 int f(char *p, ...)
10398 p = va_arg(ap, char *);
10404 $cat > varargs <<EOP
10406 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
10415 : now check which varargs header should be included
10420 if `./varargs I_STDARG`; then
10422 elif `./varargs I_VARARGS`; then
10427 if `./varargs I_VARARGS`; then
10434 echo "I could not find the definition for va_dcl... You have problems..." >&4
10435 val="$undef"; set i_stdarg; eval $setvar
10436 val="$undef"; set i_varargs; eval $setvar
10441 case "$i_varhdr" in
10443 val="$define"; set i_stdarg; eval $setvar
10444 val="$undef"; set i_varargs; eval $setvar
10447 val="$undef"; set i_stdarg; eval $setvar
10448 val="$define"; set i_varargs; eval $setvar
10451 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
10455 : see if the Compiler supports C99 variadic macros
10456 case "$i_stdarg$i_stdlib" in
10458 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
10461 #include <stdarg.h>
10463 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
10467 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
10473 if eval $compile && $run ./try 2>&1 >/dev/null; then
10474 case "`$run ./try`" in
10476 echo "You have C99 variadic macros." >&4
10477 d_c99_variadic_macros="$define"
10480 echo "You don't have functional C99 variadic macros." >&4
10481 d_c99_variadic_macros="$undef"
10485 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
10486 d_c99_variadic_macros="$undef"
10488 $rm -f try.* try core core.try.*
10491 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
10492 d_c99_variadic_macros="$undef"
10496 : see if signal is declared as pointer to function returning int or void
10498 xxx=`./findhdr signal.h`
10499 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10500 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10501 echo "You have int (*signal())() instead of void." >&4
10503 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10504 echo "You have void (*signal())()." >&4
10506 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10507 echo "You have int (*signal())() instead of void." >&4
10509 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10510 echo "You have void (*signal())()." >&4
10513 case "$d_voidsig" in
10515 echo "I can't determine whether signal handler returns void or int..." >&4
10517 rp="What type does your signal handler return?"
10520 v*) val="$define";;
10524 echo "As you already told me, signal handler returns void." >&4
10527 *) echo "As you already told me, signal handler returns int." >&4
10534 case "$d_voidsig" in
10535 "$define") signal_t="void";;
10536 *) signal_t="int";;
10540 : check for ability to cast large floats to 32-bit ints.
10542 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10543 if $test "$intsize" -ge 4; then
10550 #$i_stdlib I_STDLIB
10552 #include <stdlib.h>
10554 #include <sys/types.h>
10555 #include <signal.h>
10556 $signal_t blech(int s) { exit(3); }
10563 signal(SIGFPE, blech);
10565 /* Don't let compiler optimize the test away. Store the number
10566 in a writable string for gcc to pass to sscanf under HP/UX.
10568 sprintf(str, "2147483647");
10569 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
10573 /* x86 processors will probably give 0x8000 0000, which is a
10574 sign change. We don't want that. We want to mimic SPARC
10575 behavior here, which is to preserve the sign and give
10578 if (i32 != ($xxx) f)
10584 if eval $compile_ok; then
10588 echo "(I can't seem to compile the test program--assuming it can't)"
10593 echo "Yup, it can."
10596 echo "Nope, it can't."
10603 : check for ability to cast negative floats to unsigned
10605 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
10608 #$i_stdlib I_STDLIB
10610 #include <stdlib.h>
10612 #include <sys/types.h>
10613 #include <signal.h>
10614 $signal_t blech(int s) { exit(7); }
10615 $signal_t blech_in_list(int s) { exit(4); }
10616 unsigned long dummy_long(unsigned long p) { return p; }
10617 unsigned int dummy_int(unsigned int p) { return p; }
10618 unsigned short dummy_short(unsigned short p) { return p; }
10622 unsigned long along;
10624 unsigned short ashort;
10628 /* Frustrate gcc-2.7.2's optimizer which failed this test with
10629 a direct f = -123. assignment. gcc-2.8.0 reportedly
10630 optimized the whole file away
10632 /* Store the number in a writable string for gcc to pass to
10633 sscanf under HP/UX.
10635 sprintf(str, "-123");
10636 sscanf(str, "%lf", &f); /* f = -123.; */
10638 signal(SIGFPE, blech);
10639 along = (unsigned long)f;
10640 aint = (unsigned int)f;
10641 ashort = (unsigned short)f;
10642 if (along != (unsigned long)-123)
10644 if (aint != (unsigned int)-123)
10646 if (ashort != (unsigned short)-123)
10648 sprintf(str, "1073741824.");
10649 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
10652 along = (unsigned long)f;
10653 if (along != 0x80000000)
10657 along = (unsigned long)f;
10658 if (along != 0x7fffffff)
10662 along = (unsigned long)f;
10663 if (along != 0x80000001)
10667 signal(SIGFPE, blech_in_list);
10668 sprintf(str, "123.");
10669 sscanf(str, "%lf", &f); /* f = 123.; */
10670 along = dummy_long((unsigned long)f);
10671 aint = dummy_int((unsigned int)f);
10672 ashort = dummy_short((unsigned short)f);
10673 if (along != (unsigned long)123)
10675 if (aint != (unsigned int)123)
10677 if (ashort != (unsigned short)123)
10684 if eval $compile_ok; then
10688 echo "(I can't seem to compile the test program--assuming it can't)"
10691 case "$castflags" in
10693 echo "Yup, it can."
10696 echo "Nope, it can't."
10703 : see if vprintf exists
10705 if set vprintf val -f d_vprintf; eval $csym; $val; then
10706 echo 'vprintf() found.' >&4
10709 #include <varargs.h>
10710 #$i_stdlib I_STDLIB
10712 #include <stdlib.h>
10715 int main() { xxx("foo"); }
10724 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
10728 if eval $compile && $run ./try; then
10729 echo "Your vsprintf() returns (int)." >&4
10732 echo "Your vsprintf() returns (char*)." >&4
10736 echo 'vprintf() NOT found.' >&4
10747 : see if chown exists
10751 : see if chroot exists
10752 set chroot d_chroot
10755 : see if chsize exists
10756 set chsize d_chsize
10759 : see if class exists
10763 : see if clearenv exists
10764 set clearenv d_clearenv
10767 hasstruct='varname=$1; struct=$2; shift; shift;
10768 while $test $# -ge 2; do
10770 $define) echo "#include <$2>";;
10774 echo "int main () { struct $struct foo; }" >> try.c;
10776 if eval $compile; then
10783 $rm -f try.c try.o'
10787 : see whether socket exists
10789 $echo $n "Hmm... $c" >&4
10790 if set socket val -f d_socket; eval $csym; $val; then
10791 echo "Looks like you have Berkeley networking support." >&4
10793 if set setsockopt val -f; eval $csym; $val; then
10796 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
10797 d_oldsock="$define"
10800 if $contains socklib libc.list >/dev/null 2>&1; then
10801 echo "Looks like you have Berkeley networking support." >&4
10803 : we will have to assume that it supports the 4.2 BSD interface
10806 echo "You don't have Berkeley networking in libc$_a..." >&4
10807 if test "X$d_socket" = "X$define"; then
10808 echo "...but you seem to believe that you have sockets." >&4
10810 for net in net socket
10812 if test -f /usr/lib/lib$net$_a; then
10813 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
10814 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
10815 if $contains socket libc.list >/dev/null 2>&1; then
10820 echo "...but the Wollongong group seems to have hacked it in." >&4
10821 sockethdr="-I/usr/netinclude"
10824 echo "Found Berkeley sockets interface in lib$net." >&4
10825 if $contains setsockopt libc.list >/dev/null 2>&1; then
10828 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
10829 d_oldsock="$define"
10835 if test "X$d_socket" != "X$define"; then
10836 echo "or anywhere else I see." >&4
10844 : see if socketpair exists
10845 set socketpair d_sockpair
10850 echo "Checking the availability of certain socket constants..." >&4
10851 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
10852 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
10854 #include <sys/types.h>
10855 #include <sys/socket.h>
10861 set try; if eval $compile; then
10864 set d_${enum}; eval $setvar
10868 : see if this is a sys/uio.h system
10869 set sys/uio.h i_sysuio
10874 echo "Checking to see if your system supports struct cmsghdr..." >&4
10875 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
10877 case "$d_cmsghdr_s" in
10878 "$define") echo "Yes, it does." ;;
10879 *) echo "No, it doesn't." ;;
10883 : check for const keyword
10885 echo 'Checking to see if your C compiler knows about "const"...' >&4
10886 $cat >const.c <<'EOCP'
10887 typedef struct spug { int drokk; } spug;
10891 const spug y = { 0 };
10894 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
10896 echo "Yup, it does."
10899 echo "Nope, it doesn't."
10904 : see if copysignl exists
10905 set copysignl d_copysignl
10908 : see if crypt exists
10913 $define) cryptlib='' ;;
10914 *) if set crypt val -f d_crypt; eval $csym; $val; then
10915 echo 'crypt() found.' >&4
10919 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
10920 if $test -z "$cryptlib"; then
10921 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
10925 if $test -z "$cryptlib"; then
10926 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
10930 if $test -z "$cryptlib"; then
10931 cryptlib=`./loc libcrypt$_a "" $libpth`
10935 if $test -z "$cryptlib"; then
10936 echo 'crypt() NOT found.' >&4
10947 : see if this is a crypt.h system
10948 set crypt.h i_crypt
10951 : see if crypt_r exists
10952 set crypt_r d_crypt_r
10954 case "$d_crypt_r" in
10956 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
10957 case "$d_crypt_r_proto:$usethreads" in
10958 ":define") d_crypt_r_proto=define
10959 set d_crypt_r_proto crypt_r $hdrs
10963 case "$d_crypt_r_proto" in
10965 case "$crypt_r_proto" in
10966 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
10967 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCS ;;
10969 case "$crypt_r_proto" in
10970 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
10971 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCD ;;
10973 case "$crypt_r_proto" in
10974 ''|0) d_crypt_r=undef
10976 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
10977 * ) case "$crypt_r_proto" in
10978 REENTRANT_PROTO*) ;;
10979 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
10981 echo "Prototype: $try" ;;
10984 *) case "$usethreads" in
10985 define) echo "crypt_r has no prototype, not using it." >&4 ;;
10996 : get csh whereabouts
10998 'csh') val="$undef" ;;
10999 *) val="$define" ;;
11003 : Respect a hint or command line value for full_csh.
11004 case "$full_csh" in
11005 '') full_csh=$csh ;;
11008 : see if ctermid exists
11009 set ctermid d_ctermid
11012 : see if ctermid_r exists
11013 set ctermid_r d_ctermid_r
11015 case "$d_ctermid_r" in
11017 hdrs="$i_systypes sys/types.h define stdio.h "
11018 case "$d_ctermid_r_proto:$usethreads" in
11019 ":define") d_ctermid_r_proto=define
11020 set d_ctermid_r_proto ctermid_r $hdrs
11024 case "$d_ctermid_r_proto" in
11026 case "$ctermid_r_proto" in
11027 ''|0) try='char* ctermid_r(char*);'
11028 ./protochk "extern $try" $hdrs && ctermid_r_proto=B_B ;;
11030 case "$ctermid_r_proto" in
11031 ''|0) d_ctermid_r=undef
11033 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
11034 * ) case "$ctermid_r_proto" in
11035 REENTRANT_PROTO*) ;;
11036 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
11038 echo "Prototype: $try" ;;
11041 *) case "$usethreads" in
11042 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
11049 *) ctermid_r_proto=0
11053 : see if ctime_r exists
11054 set ctime_r d_ctime_r
11056 case "$d_ctime_r" in
11058 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11059 case "$d_ctime_r_proto:$usethreads" in
11060 ":define") d_ctime_r_proto=define
11061 set d_ctime_r_proto ctime_r $hdrs
11065 case "$d_ctime_r_proto" in
11067 case "$ctime_r_proto" in
11068 ''|0) try='char* ctime_r(const time_t*, char*);'
11069 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SB ;;
11071 case "$ctime_r_proto" in
11072 ''|0) try='char* ctime_r(const time_t*, char*, int);'
11073 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SBI ;;
11075 case "$ctime_r_proto" in
11076 ''|0) try='int ctime_r(const time_t*, char*);'
11077 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SB ;;
11079 case "$ctime_r_proto" in
11080 ''|0) try='int ctime_r(const time_t*, char*, int);'
11081 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SBI ;;
11083 case "$ctime_r_proto" in
11084 ''|0) d_ctime_r=undef
11086 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
11087 * ) case "$ctime_r_proto" in
11088 REENTRANT_PROTO*) ;;
11089 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
11091 echo "Prototype: $try" ;;
11094 *) case "$usethreads" in
11095 define) echo "ctime_r has no prototype, not using it." >&4 ;;
11106 : see if cuserid exists
11107 set cuserid d_cuserid
11110 : see if this is a limits.h system
11111 set limits.h i_limits
11114 : see if this is a float.h system
11115 set float.h i_float
11118 : See if number of significant digits in a double precision number is known
11120 $cat >dbl_dig.c <<EOM
11121 #$i_limits I_LIMITS
11124 #include <limits.h>
11130 printf("Contains DBL_DIG");
11133 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
11134 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
11135 echo "DBL_DIG found." >&4
11138 echo "DBL_DIG NOT found." >&4
11145 : see if dbm.h is available
11146 : see if dbmclose exists
11147 set dbmclose d_dbmclose
11150 case "$d_dbmclose" in
11160 *) set rpcsvc/dbm.h i_rpcsvcdbm
11165 *) echo "We won't be including <dbm.h>"
11175 : see if prototype for dbminit is available
11177 set d_dbminitproto dbminit $i_dbm dbm.h
11180 : see if difftime exists
11181 set difftime d_difftime
11184 : see if this is a dirent system
11186 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
11188 echo "<dirent.h> found." >&4
11191 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
11192 echo "<sys/dir.h> found." >&4
11195 xinc=`./findhdr sys/ndir.h`
11197 echo "<dirent.h> NOT found." >&4
11202 : Look for type of directory structure.
11204 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11206 case "$direntrytype" in
11208 case "$i_dirent" in
11209 $define) guess1='struct dirent' ;;
11210 *) guess1='struct direct' ;;
11213 *) guess1="$direntrytype"
11218 'struct dirent') guess2='struct direct' ;;
11219 *) guess2='struct dirent' ;;
11222 if $contains "$guess1" try.c >/dev/null 2>&1; then
11223 direntrytype="$guess1"
11224 echo "Your directory entries are $direntrytype." >&4
11225 elif $contains "$guess2" try.c >/dev/null 2>&1; then
11226 direntrytype="$guess2"
11227 echo "Your directory entries seem to be $direntrytype." >&4
11229 echo "I don't recognize your system's directory entries." >&4
11230 rp="What type is used for directory entries on this system?"
11233 direntrytype="$ans"
11238 : see if the directory entry stores field length
11240 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11241 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
11242 echo "Good, your directory entry keeps length information in d_namlen." >&4
11245 echo "Your directory entry does not know about the d_namlen field." >&4
11252 : Look for DIR.dd_fd
11253 case "$i_dirent" in
11255 echo "Checking to see if DIR has a dd_fd member variable" >&4
11257 #$i_stdlib I_STDLIB
11259 #include <stdlib.h>
11261 #include <dirent.h>
11271 if eval $compile; then
11272 echo "Yes, it does."
11275 echo "No, it does not."
11280 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
11288 : see if this is an sysdir system
11289 set sys/dir.h i_sysdir
11292 : see if this is an sysndir system
11293 set sys/ndir.h i_sysndir
11298 $cat >dirfd.c <<EOM
11300 #$i_stdlib I_STDLIB
11302 #include <stdlib.h>
11304 #$i_dirent I_DIRENT /**/
11305 #$i_sysdir I_SYS_DIR /**/
11306 #$i_sysndir I_SYS_NDIR /**/
11307 #$i_systypes I_SYS_TYPES /**/
11308 #if defined(I_SYS_TYPES)
11309 #include <sys/types.h>
11311 #if defined(I_DIRENT)
11312 #include <dirent.h>
11313 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11314 #include <sys/dir.h>
11318 #include <sys/ndir.h>
11322 #include <ndir.h> /* may be wrong in the future */
11324 #include <sys/dir.h>
11330 DIR *dirp = opendir(".");
11331 if (dirfd(dirp) >= 0)
11339 if eval $compile; then
11343 $define) echo "dirfd() found." >&4 ;;
11344 *) echo "dirfd() NOT found." >&4 ;;
11350 : see if dlerror exists
11353 set dlerror d_dlerror
11357 : see if dlfcn is available
11358 set dlfcn.h i_dlfcn
11365 On a few systems, the dynamically loaded modules that perl generates and uses
11366 will need a different extension than shared libs. The default will probably
11372 *) dflt="$dlext" ;;
11374 rp='What is the extension of dynamically loaded modules'
11383 : Check if dlsym need a leading underscore
11389 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11390 $cat >dyna.c <<'EOM'
11397 #$i_stdlib I_STDLIB
11399 #include <stdlib.h>
11403 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
11405 #include <sys/types.h>
11410 extern int fred() ;
11419 int mode = RTLD_LAZY ;
11421 handle = dlopen("./dyna.$dlext", mode) ;
11422 if (handle == NULL) {
11427 symbol = dlsym(handle, "fred") ;
11428 if (symbol == NULL) {
11429 /* try putting a leading underscore */
11430 symbol = dlsym(handle, "_fred") ;
11431 if (symbol == NULL) {
11444 : Call the object file tmp-dyna.o in case dlext=o.
11445 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
11446 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
11447 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
11448 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
11451 1) echo "Test program failed using dlopen." >&4
11452 echo "Perhaps you should not use dynamic loading." >&4;;
11453 2) echo "Test program failed using dlsym." >&4
11454 echo "Perhaps you should not use dynamic loading." >&4;;
11455 3) echo "dlsym needs a leading underscore" >&4
11457 4) echo "dlsym doesn't need a leading underscore." >&4;;
11460 echo "I can't compile and run the test program." >&4
11461 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
11466 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
11471 : see if drand48_r exists
11472 set drand48_r d_drand48_r
11474 case "$d_drand48_r" in
11476 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
11477 case "$d_drand48_r_proto:$usethreads" in
11478 ":define") d_drand48_r_proto=define
11479 set d_drand48_r_proto drand48_r $hdrs
11483 case "$d_drand48_r_proto" in
11485 case "$drand48_r_proto" in
11486 ''|0) try='int drand48_r(struct drand48_data*, double*);'
11487 ./protochk "extern $try" $hdrs && drand48_r_proto=I_ST ;;
11489 case "$drand48_r_proto" in
11490 ''|0) d_drand48_r=undef
11492 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
11493 * ) case "$drand48_r_proto" in
11494 REENTRANT_PROTO*) ;;
11495 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
11497 echo "Prototype: $try" ;;
11500 *) case "$usethreads" in
11501 define) echo "drand48_r has no prototype, not using it." >&4 ;;
11508 *) drand48_r_proto=0
11512 : see if prototype for drand48 is available
11514 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
11517 : see if dup2 exists
11521 : see if eaccess exists
11522 set eaccess d_eaccess
11525 : see if endgrent exists
11526 set endgrent d_endgrent
11529 : see if this is an grp system
11535 xxx=`./findhdr grp.h`
11536 $cppstdin $cppflags $cppminus < $xxx >$$.h
11538 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
11550 set d_grpasswd; eval $setvar
11554 : see if endgrent_r exists
11555 set endgrent_r d_endgrent_r
11557 case "$d_endgrent_r" in
11559 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11560 case "$d_endgrent_r_proto:$usethreads" in
11561 ":define") d_endgrent_r_proto=define
11562 set d_endgrent_r_proto endgrent_r $hdrs
11566 case "$d_endgrent_r_proto" in
11568 case "$endgrent_r_proto" in
11569 ''|0) try='int endgrent_r(FILE**);'
11570 ./protochk "extern $try" $hdrs && endgrent_r_proto=I_H ;;
11572 case "$endgrent_r_proto" in
11573 ''|0) try='void endgrent_r(FILE**);'
11574 ./protochk "extern $try" $hdrs && endgrent_r_proto=V_H ;;
11576 case "$endgrent_r_proto" in
11577 ''|0) d_endgrent_r=undef
11579 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
11580 * ) case "$endgrent_r_proto" in
11581 REENTRANT_PROTO*) ;;
11582 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
11584 echo "Prototype: $try" ;;
11587 *) case "$usethreads" in
11588 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
11595 *) endgrent_r_proto=0
11599 : see if endhostent exists
11600 set endhostent d_endhent
11603 : see if this is a netdb.h system
11604 set netdb.h i_netdb
11607 : see if endhostent_r exists
11608 set endhostent_r d_endhostent_r
11610 case "$d_endhostent_r" in
11612 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11613 case "$d_endhostent_r_proto:$usethreads" in
11614 ":define") d_endhostent_r_proto=define
11615 set d_endhostent_r_proto endhostent_r $hdrs
11619 case "$d_endhostent_r_proto" in
11621 case "$endhostent_r_proto" in
11622 ''|0) try='int endhostent_r(struct hostent_data*);'
11623 ./protochk "extern $try" $hdrs && endhostent_r_proto=I_D ;;
11625 case "$endhostent_r_proto" in
11626 ''|0) try='void endhostent_r(struct hostent_data*);'
11627 ./protochk "extern $try" $hdrs && endhostent_r_proto=V_D ;;
11629 case "$endhostent_r_proto" in
11630 ''|0) d_endhostent_r=undef
11631 endhostent_r_proto=0
11632 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
11633 * ) case "$endhostent_r_proto" in
11634 REENTRANT_PROTO*) ;;
11635 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
11637 echo "Prototype: $try" ;;
11640 *) case "$usethreads" in
11641 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
11643 d_endhostent_r=undef
11644 endhostent_r_proto=0
11648 *) endhostent_r_proto=0
11652 : see if endnetent exists
11653 set endnetent d_endnent
11656 : see if endnetent_r exists
11657 set endnetent_r d_endnetent_r
11659 case "$d_endnetent_r" in
11661 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11662 case "$d_endnetent_r_proto:$usethreads" in
11663 ":define") d_endnetent_r_proto=define
11664 set d_endnetent_r_proto endnetent_r $hdrs
11668 case "$d_endnetent_r_proto" in
11670 case "$endnetent_r_proto" in
11671 ''|0) try='int endnetent_r(struct netent_data*);'
11672 ./protochk "extern $try" $hdrs && endnetent_r_proto=I_D ;;
11674 case "$endnetent_r_proto" in
11675 ''|0) try='void endnetent_r(struct netent_data*);'
11676 ./protochk "extern $try" $hdrs && endnetent_r_proto=V_D ;;
11678 case "$endnetent_r_proto" in
11679 ''|0) d_endnetent_r=undef
11680 endnetent_r_proto=0
11681 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
11682 * ) case "$endnetent_r_proto" in
11683 REENTRANT_PROTO*) ;;
11684 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
11686 echo "Prototype: $try" ;;
11689 *) case "$usethreads" in
11690 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
11692 d_endnetent_r=undef
11693 endnetent_r_proto=0
11697 *) endnetent_r_proto=0
11701 : see if endprotoent exists
11702 set endprotoent d_endpent
11705 : see if endprotoent_r exists
11706 set endprotoent_r d_endprotoent_r
11708 case "$d_endprotoent_r" in
11710 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11711 case "$d_endprotoent_r_proto:$usethreads" in
11712 ":define") d_endprotoent_r_proto=define
11713 set d_endprotoent_r_proto endprotoent_r $hdrs
11717 case "$d_endprotoent_r_proto" in
11719 case "$endprotoent_r_proto" in
11720 ''|0) try='int endprotoent_r(struct protoent_data*);'
11721 ./protochk "extern $try" $hdrs && endprotoent_r_proto=I_D ;;
11723 case "$endprotoent_r_proto" in
11724 ''|0) try='void endprotoent_r(struct protoent_data*);'
11725 ./protochk "extern $try" $hdrs && endprotoent_r_proto=V_D ;;
11727 case "$endprotoent_r_proto" in
11728 ''|0) d_endprotoent_r=undef
11729 endprotoent_r_proto=0
11730 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
11731 * ) case "$endprotoent_r_proto" in
11732 REENTRANT_PROTO*) ;;
11733 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
11735 echo "Prototype: $try" ;;
11738 *) case "$usethreads" in
11739 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
11741 d_endprotoent_r=undef
11742 endprotoent_r_proto=0
11746 *) endprotoent_r_proto=0
11750 : see if endpwent exists
11751 set endpwent d_endpwent
11754 : see if this is a pwd.h system
11760 xxx=`./findhdr pwd.h`
11761 $cppstdin $cppflags $cppminus < $xxx >$$.h
11763 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
11771 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
11779 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
11787 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
11795 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
11803 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
11811 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
11819 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
11831 set d_pwquota; eval $setvar
11832 set d_pwage; eval $setvar
11833 set d_pwchange; eval $setvar
11834 set d_pwclass; eval $setvar
11835 set d_pwexpire; eval $setvar
11836 set d_pwcomment; eval $setvar
11837 set d_pwgecos; eval $setvar
11838 set d_pwpasswd; eval $setvar
11842 : see if endpwent_r exists
11843 set endpwent_r d_endpwent_r
11845 case "$d_endpwent_r" in
11847 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
11848 case "$d_endpwent_r_proto:$usethreads" in
11849 ":define") d_endpwent_r_proto=define
11850 set d_endpwent_r_proto endpwent_r $hdrs
11854 case "$d_endpwent_r_proto" in
11856 case "$endpwent_r_proto" in
11857 ''|0) try='int endpwent_r(FILE**);'
11858 ./protochk "extern $try" $hdrs && endpwent_r_proto=I_H ;;
11860 case "$endpwent_r_proto" in
11861 ''|0) try='void endpwent_r(FILE**);'
11862 ./protochk "extern $try" $hdrs && endpwent_r_proto=V_H ;;
11864 case "$endpwent_r_proto" in
11865 ''|0) d_endpwent_r=undef
11867 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
11868 * ) case "$endpwent_r_proto" in
11869 REENTRANT_PROTO*) ;;
11870 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
11872 echo "Prototype: $try" ;;
11875 *) case "$usethreads" in
11876 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
11883 *) endpwent_r_proto=0
11887 : see if endservent exists
11888 set endservent d_endsent
11891 : see if endservent_r exists
11892 set endservent_r d_endservent_r
11894 case "$d_endservent_r" in
11896 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11897 case "$d_endservent_r_proto:$usethreads" in
11898 ":define") d_endservent_r_proto=define
11899 set d_endservent_r_proto endservent_r $hdrs
11903 case "$d_endservent_r_proto" in
11905 case "$endservent_r_proto" in
11906 ''|0) try='int endservent_r(struct servent_data*);'
11907 ./protochk "extern $try" $hdrs && endservent_r_proto=I_D ;;
11909 case "$endservent_r_proto" in
11910 ''|0) try='void endservent_r(struct servent_data*);'
11911 ./protochk "extern $try" $hdrs && endservent_r_proto=V_D ;;
11913 case "$endservent_r_proto" in
11914 ''|0) d_endservent_r=undef
11915 endservent_r_proto=0
11916 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
11917 * ) case "$endservent_r_proto" in
11918 REENTRANT_PROTO*) ;;
11919 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
11921 echo "Prototype: $try" ;;
11924 *) case "$usethreads" in
11925 define) echo "endservent_r has no prototype, not using it." >&4 ;;
11927 d_endservent_r=undef
11928 endservent_r_proto=0
11932 *) endservent_r_proto=0
11936 : Locate the flags for 'open()'
11939 #include <sys/types.h>
11944 #include <sys/file.h>
11946 #$i_stdlib I_STDLIB
11948 #include <stdlib.h>
11959 : check sys/file.h first to get FREAD on Sun
11960 if $test `./findhdr sys/file.h` && \
11961 set try -DI_SYS_FILE && eval $compile; then
11963 echo "<sys/file.h> defines the O_* constants..." >&4
11964 if $run ./try; then
11965 echo "and you have the 3 argument form of open()." >&4
11968 echo "but not the 3 argument form of open(). Oh, well." >&4
11971 elif $test `./findhdr fcntl.h` && \
11972 set try -DI_FCNTL && eval $compile; then
11974 echo "<fcntl.h> defines the O_* constants..." >&4
11975 if $run ./try; then
11976 echo "and you have the 3 argument form of open()." >&4
11979 echo "but not the 3 argument form of open(). Oh, well." >&4
11984 echo "I can't find the O_* constant definitions! You got problems." >&4
11990 : see which of string.h or strings.h is needed
11992 strings=`./findhdr string.h`
11993 if $test "$strings" && $test -r "$strings"; then
11994 echo "Using <string.h> instead of <strings.h>." >&4
11998 strings=`./findhdr strings.h`
11999 if $test "$strings" && $test -r "$strings"; then
12000 echo "Using <strings.h> instead of <string.h>." >&4
12002 echo "No string header found -- You'll surely have problems." >&4
12007 case "$i_string" in
12008 "$undef") strings=`./findhdr strings.h`;;
12009 *) strings=`./findhdr string.h`;;
12012 : see if this is a sys/file.h system
12017 : do we need to include sys/file.h ?
12021 if $h_sysfile; then
12023 echo "We'll be including <sys/file.h>." >&4
12026 echo "We won't be including <sys/file.h>." >&4
12036 : see if fcntl.h is there
12041 : see if we can include fcntl.h
12047 echo "We'll be including <fcntl.h>." >&4
12050 if $h_sysfile; then
12051 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12053 echo "We won't be including <fcntl.h>." >&4
12065 : check for non-blocking I/O stuff
12066 case "$h_sysfile" in
12067 true) echo "#include <sys/file.h>" > head.c;;
12070 true) echo "#include <fcntl.h>" > head.c;;
12071 *) echo "#include <sys/fcntl.h>" > head.c;;
12076 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
12077 case "$o_nonblock" in
12079 $cat head.c > try.c
12080 $cat >>try.c <<EOCP
12082 #$i_stdlib I_STDLIB
12084 #include <stdlib.h>
12092 printf("O_NONBLOCK\n");
12096 printf("O_NDELAY\n");
12100 printf("FNDELAY\n");
12107 if eval $compile_ok; then
12108 o_nonblock=`$run ./try`
12109 case "$o_nonblock" in
12110 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
12111 *) echo "Seems like we can use $o_nonblock.";;
12114 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
12117 *) echo "Using $hint value $o_nonblock.";;
12119 $rm -f try try.* .out core
12122 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
12125 $cat head.c > try.c
12126 $cat >>try.c <<EOCP
12128 #include <sys/types.h>
12129 #include <signal.h>
12131 #$i_stdlib I_STDLIB
12133 #include <stdlib.h>
12139 #define MY_O_NONBLOCK $o_nonblock
12140 #ifndef errno /* XXX need better Configure test */
12143 #$i_unistd I_UNISTD
12145 #include <unistd.h>
12147 #$i_string I_STRING
12149 #include <string.h>
12151 #include <strings.h>
12153 $signal_t blech(int x) { exit(3); }
12155 $cat >> try.c <<'EOCP'
12163 pipe(pd); /* Down: child -> parent */
12164 pipe(pu); /* Up: parent -> child */
12167 close(pd[1]); /* Parent reads from pd[0] */
12168 close(pu[0]); /* Parent writes (blocking) to pu[1] */
12170 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
12175 signal(SIGALRM, blech);
12177 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
12179 sprintf(string, "%d\n", ret);
12180 write(2, string, strlen(string));
12183 if (errno == EAGAIN) {
12184 printf("EAGAIN\n");
12189 if (errno == EWOULDBLOCK)
12190 printf("EWOULDBLOCK\n");
12193 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
12194 sleep(2); /* Give it time to close our pipe */
12196 ret = read(pd[0], buf, 1); /* Should read EOF */
12198 sprintf(string, "%d\n", ret);
12199 write(4, string, strlen(string));
12203 close(pd[0]); /* We write to pd[1] */
12204 close(pu[1]); /* We read from pu[0] */
12205 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
12206 close(pd[1]); /* Pipe pd is now fully closed! */
12207 exit(0); /* Bye bye, thank you for playing! */
12211 if eval $compile_ok; then
12212 echo "$startsh" >mtry
12213 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
12215 ./mtry >/dev/null 2>&1
12217 0) eagain=`$cat try.out`;;
12218 1) echo "Could not perform non-blocking setting!";;
12219 2) echo "I did a successful read() for something that was not there!";;
12220 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
12221 4) echo "Could not find F_SETFL!";;
12222 *) echo "Something terribly wrong happened during testing.";;
12224 rd_nodata=`$cat try.ret`
12225 echo "A read() system call with no data present returns $rd_nodata."
12226 case "$rd_nodata" in
12229 echo "(That's peculiar, fixing that to be -1.)"
12235 echo "Forcing errno EAGAIN on read() with no data available."
12239 echo "Your read() sets errno to $eagain when no data is available."
12242 status=`$cat try.err`
12244 0) echo "And it correctly returns 0 to signal EOF.";;
12245 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
12246 *) echo "However, your read() returns '$status' on EOF??";;
12249 if test "$status" = "$rd_nodata"; then
12250 echo "WARNING: you can't distinguish between EOF and no data!"
12254 echo "I can't compile the test program--assuming errno EAGAIN will do."
12261 echo "Using $hint value $eagain."
12262 echo "Your read() returns $rd_nodata when no data is present."
12263 case "$d_eofnblk" in
12264 "$define") echo "And you can see EOF because read() returns 0.";;
12265 "$undef") echo "But you can't see EOF status from read() returned value.";;
12267 echo "(Assuming you can't see EOF status from read anyway.)"
12273 $rm -f try try.* .out core head.c mtry
12275 : see if _ptr and _cnt from stdio act std
12278 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12279 echo "(Looks like you have stdio.h from BSD.)"
12280 case "$stdio_ptr" in
12281 '') stdio_ptr='((fp)->_p)'
12284 *) ptr_lval=$d_stdio_ptr_lval;;
12286 case "$stdio_cnt" in
12287 '') stdio_cnt='((fp)->_r)'
12290 *) cnt_lval=$d_stdio_cnt_lval;;
12292 case "$stdio_base" in
12293 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12295 case "$stdio_bufsiz" in
12296 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12298 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12299 echo "(Looks like you have stdio.h from Linux.)"
12300 case "$stdio_ptr" in
12301 '') stdio_ptr='((fp)->_IO_read_ptr)'
12304 *) ptr_lval=$d_stdio_ptr_lval;;
12306 case "$stdio_cnt" in
12307 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12310 *) cnt_lval=$d_stdio_cnt_lval;;
12312 case "$stdio_base" in
12313 '') stdio_base='((fp)->_IO_read_base)';;
12315 case "$stdio_bufsiz" in
12316 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12319 case "$stdio_ptr" in
12320 '') stdio_ptr='((fp)->_ptr)'
12323 *) ptr_lval=$d_stdio_ptr_lval;;
12325 case "$stdio_cnt" in
12326 '') stdio_cnt='((fp)->_cnt)'
12329 *) cnt_lval=$d_stdio_cnt_lval;;
12331 case "$stdio_base" in
12332 '') stdio_base='((fp)->_base)';;
12334 case "$stdio_bufsiz" in
12335 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12339 : test whether _ptr and _cnt really work
12340 echo "Checking how std your stdio is..." >&4
12343 #$i_stdlib I_STDLIB
12345 #include <stdlib.h>
12347 #define FILE_ptr(fp) $stdio_ptr
12348 #define FILE_cnt(fp) $stdio_cnt
12350 FILE *fp = fopen("try.c", "r");
12353 18 <= FILE_cnt(fp) &&
12354 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12362 if eval $compile && $to try.c; then
12363 if $run ./try; then
12364 echo "Your stdio acts pretty std."
12367 echo "Your stdio isn't very std."
12370 echo "Your stdio doesn't appear very std."
12374 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12375 # direct buffer manipulation no longer works. The Configure tests
12376 # should be changed to correctly detect this, but until then,
12377 # the following check should at least let perl compile and run.
12378 # (This quick fix should be updated before 5.8.1.)
12379 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12380 # A. Dougherty, June 3, 2002.
12381 case "$d_gnulibc" in
12383 case "$gnulibc_version" in
12387 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12396 : Can _ptr be used as an lvalue?
12397 case "$d_stdstdio$ptr_lval" in
12398 $define$define) val=$define ;;
12401 set d_stdio_ptr_lval
12404 : Can _cnt be used as an lvalue?
12405 case "$d_stdstdio$cnt_lval" in
12406 $define$define) val=$define ;;
12409 set d_stdio_cnt_lval
12413 : test whether setting _ptr sets _cnt as a side effect
12414 d_stdio_ptr_lval_sets_cnt="$undef"
12415 d_stdio_ptr_lval_nochange_cnt="$undef"
12416 case "$d_stdio_ptr_lval$d_stdstdio" in
12418 echo "Checking to see what happens if we set the stdio ptr..." >&4
12421 /* Can we scream? */
12422 /* Eat dust sed :-) */
12423 /* In the buffer space, no one can hear you scream. */
12424 #$i_stdlib I_STDLIB
12426 #include <stdlib.h>
12428 #define FILE_ptr(fp) $stdio_ptr
12429 #define FILE_cnt(fp) $stdio_cnt
12430 #include <sys/types.h>
12432 FILE *fp = fopen("try.c", "r");
12437 puts("Fail even to read");
12440 c = getc(fp); /* Read away the first # */
12442 puts("Fail even to read");
12446 18 <= FILE_cnt(fp) &&
12447 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12449 puts("Fail even to read");
12452 ptr = (char*) FILE_ptr(fp);
12453 cnt = (size_t)FILE_cnt(fp);
12455 FILE_ptr(fp) += 42;
12457 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12458 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12461 if (FILE_cnt(fp) <= 20) {
12462 printf ("Fail (<20 chars to test)");
12465 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12466 puts("Fail compare");
12469 if (cnt == FILE_cnt(fp)) {
12470 puts("Pass_unchanged");
12473 if (FILE_cnt(fp) == (cnt - 42)) {
12474 puts("Pass_changed");
12477 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12483 if eval $compile && $to try.c; then
12484 case `$run ./try` in
12486 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12487 d_stdio_ptr_lval_sets_cnt="$define" ;;
12489 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12490 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12492 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12494 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12497 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12503 : see if _base is also standard
12505 case "$d_stdstdio" in
12509 #$i_stdlib I_STDLIB
12511 #include <stdlib.h>
12513 #define FILE_base(fp) $stdio_base
12514 #define FILE_bufsiz(fp) $stdio_bufsiz
12516 FILE *fp = fopen("try.c", "r");
12519 19 <= FILE_bufsiz(fp) &&
12520 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
12527 if eval $compile && $to try.c; then
12528 if $run ./try; then
12529 echo "And its _base field acts std."
12532 echo "But its _base field isn't std."
12535 echo "However, it seems to be lacking the _base field."
12543 : see if fast_stdio exists
12545 case "$d_stdstdio:$d_stdio_ptr_lval" in
12547 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
12549 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
12560 : see if fchdir exists
12561 set fchdir d_fchdir
12564 : see if fchmod exists
12565 set fchmod d_fchmod
12568 : see if fchown exists
12569 set fchown d_fchown
12572 : see if this is an fcntl system
12577 : See if fcntl-based locking works.
12579 #$i_stdlib I_STDLIB
12581 #include <stdlib.h>
12583 #include <unistd.h>
12585 #include <signal.h>
12586 $signal_t blech(int x) { exit(3); }
12588 #if defined(F_SETLK) && defined(F_SETLKW)
12589 struct flock flock;
12591 fd = open("try.c", O_RDONLY);
12592 flock.l_type = F_RDLCK;
12593 flock.l_whence = SEEK_SET;
12594 flock.l_start = flock.l_len = 0;
12595 signal(SIGALRM, blech);
12597 retval = fcntl(fd, F_SETLK, &flock);
12599 (retval < 0 ? exit(2) : exit(0));
12605 echo "Checking if fcntl-based file locking works... "
12609 if eval $compile_ok; then
12610 if $run ./try; then
12611 echo "Yes, it seems to work."
12614 echo "Nope, it didn't work."
12619 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
12620 *** This is (almost) impossible.
12621 *** If your NFS lock daemons are not feeling well, something like
12622 *** this may happen, please investigate. Cannot continue, aborting.
12630 echo "I'm unable to compile the test program, so I'll assume not."
12635 echo "Nope, since you don't even have fcntl()."
12638 set d_fcntl_can_lock
12643 : check for fd_set items
12646 Checking to see how well your C compiler handles fd_set and friends ...
12649 #$i_stdlib I_STDLIB
12651 #include <stdlib.h>
12653 #$i_systime I_SYS_TIME
12654 #$i_sysselct I_SYS_SELECT
12655 #$d_socket HAS_SOCKET
12656 #include <sys/types.h>
12658 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
12661 #include <sys/time.h>
12663 #ifdef I_SYS_SELECT
12664 #include <sys/select.h>
12673 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
12681 if eval $compile; then
12682 d_fds_bits="$define"
12684 echo "Well, your system knows about the normal fd_set typedef..." >&4
12685 if $run ./try; then
12686 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
12687 d_fd_macros="$define"
12690 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
12692 d_fd_macros="$undef"
12696 Hmm, your compiler has some difficulty with fd_set. Checking further...
12699 if eval $compile; then
12700 d_fds_bits="$undef"
12702 echo "Well, your system has some sort of fd_set available..." >&4
12703 if $run ./try; then
12704 echo "and you have the normal fd_set macros." >&4
12705 d_fd_macros="$define"
12708 but not the normal fd_set macros! Gross! More work for me...
12710 d_fd_macros="$undef"
12713 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
12715 d_fds_bits="$undef"
12716 d_fd_macros="$undef"
12721 : see if fgetpos exists
12722 set fgetpos d_fgetpos
12725 : see if finite exists
12726 set finite d_finite
12729 : see if finitel exists
12730 set finitel d_finitel
12733 : see if flock exists
12737 : see if prototype for flock is available
12739 set d_flockproto flock $i_sysfile sys/file.h
12742 : see if fork exists
12746 : see if fp_class exists
12747 set fp_class d_fp_class
12750 : see if pathconf exists
12751 set pathconf d_pathconf
12754 : see if fpathconf exists
12755 set fpathconf d_fpathconf
12758 : see if fpclass exists
12759 set fpclass d_fpclass
12762 : see if fpclassify exists
12763 set fpclassify d_fpclassify
12766 : see if fpclassl exists
12767 set fpclassl d_fpclassl
12771 : check for fpos64_t
12773 echo "Checking to see if you have fpos64_t..." >&4
12776 int main() { fpos64_t x = 7; }
12779 if eval $compile; then
12781 echo "You have fpos64_t."
12784 echo "You do not have fpos64_t."
12785 case "$fpossize" in
12786 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
12793 : see if frexpl exists
12794 set frexpl d_frexpl
12797 : see if this is a sys/param system
12798 set sys/param.h i_sysparam
12801 : see if this is a sys/mount.h system
12802 set sys/mount.h i_sysmount
12807 echo "Checking to see if your system supports struct fs_data..." >&4
12808 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
12810 case "$d_fs_data_s" in
12811 "$define") echo "Yes, it does." ;;
12812 *) echo "No, it doesn't." ;;
12815 : see if fseeko exists
12816 set fseeko d_fseeko
12818 case "$longsize" in
12819 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
12822 : see if fsetpos exists
12823 set fsetpos d_fsetpos
12827 : see if fstatfs exists
12828 set fstatfs d_fstatfs
12832 : see if statvfs exists
12833 set statvfs d_statvfs
12836 : see if fstatvfs exists
12837 set fstatvfs d_fstatvfs
12841 : see if fsync exists
12845 : see if ftello exists
12846 set ftello d_ftello
12848 case "$longsize" in
12849 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
12853 : check for a working futimes
12855 echo "Checking for a working futimes()" >&4
12858 #include <sys/time.h>
12865 fd = open ("try.c", O_RDWR);
12866 if (-1 == fd) exit (1);
12867 rv = futimes (fd, NULL);
12868 exit (rv == -1 ? errno : 0);
12872 if eval $compile; then
12876 0) echo "Yes, it does" >&4
12877 d_futimes="$define"
12879 *) echo "No, it has futimes, but it isn't working ($rc) (probably harmless)\n" >&4
12883 echo "No, it does not (probably harmless)\n" >&4
12885 $rm -f try.* try core core.try.*
12887 : see if getcwd exists
12888 set getcwd d_getcwd
12891 : see if getespwnam exists
12892 set getespwnam d_getespwnam
12896 : see if getfsstat exists
12897 set getfsstat d_getfsstat
12900 : see if getgrent exists
12901 set getgrent d_getgrent
12904 : see if getgrent_r exists
12905 set getgrent_r d_getgrent_r
12907 case "$d_getgrent_r" in
12909 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12910 case "$d_getgrent_r_proto:$usethreads" in
12911 ":define") d_getgrent_r_proto=define
12912 set d_getgrent_r_proto getgrent_r $hdrs
12916 case "$d_getgrent_r_proto" in
12918 case "$getgrent_r_proto" in
12919 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
12920 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBWR ;;
12922 case "$getgrent_r_proto" in
12923 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
12924 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIR ;;
12926 case "$getgrent_r_proto" in
12927 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
12928 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBW ;;
12930 case "$getgrent_r_proto" in
12931 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
12932 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBI ;;
12934 case "$getgrent_r_proto" in
12935 ''|0) try='int getgrent_r(struct group*, char*, int);'
12936 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBI ;;
12938 case "$getgrent_r_proto" in
12939 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
12940 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIH ;;
12942 case "$getgrent_r_proto" in
12943 ''|0) d_getgrent_r=undef
12945 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
12946 * ) case "$getgrent_r_proto" in
12947 REENTRANT_PROTO*) ;;
12948 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
12950 echo "Prototype: $try" ;;
12953 *) case "$usethreads" in
12954 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
12961 *) getgrent_r_proto=0
12965 : see if getgrgid_r exists
12966 set getgrgid_r d_getgrgid_r
12968 case "$d_getgrgid_r" in
12970 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12971 case "$d_getgrgid_r_proto:$usethreads" in
12972 ":define") d_getgrgid_r_proto=define
12973 set d_getgrgid_r_proto getgrgid_r $hdrs
12977 case "$d_getgrgid_r_proto" in
12979 case "$getgrgid_r_proto" in
12980 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
12981 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
12983 case "$getgrgid_r_proto" in
12984 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
12985 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
12987 case "$getgrgid_r_proto" in
12988 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
12989 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
12991 case "$getgrgid_r_proto" in
12992 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
12993 ./protochk "extern $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
12995 case "$getgrgid_r_proto" in
12996 ''|0) d_getgrgid_r=undef
12998 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
12999 * ) case "$getgrgid_r_proto" in
13000 REENTRANT_PROTO*) ;;
13001 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
13003 echo "Prototype: $try" ;;
13006 *) case "$usethreads" in
13007 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
13014 *) getgrgid_r_proto=0
13018 : see if getgrnam_r exists
13019 set getgrnam_r d_getgrnam_r
13021 case "$d_getgrnam_r" in
13023 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13024 case "$d_getgrnam_r_proto:$usethreads" in
13025 ":define") d_getgrnam_r_proto=define
13026 set d_getgrnam_r_proto getgrnam_r $hdrs
13030 case "$d_getgrnam_r_proto" in
13032 case "$getgrnam_r_proto" in
13033 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
13034 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
13036 case "$getgrnam_r_proto" in
13037 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
13038 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
13040 case "$getgrnam_r_proto" in
13041 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
13042 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CBI ;;
13044 case "$getgrnam_r_proto" in
13045 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
13046 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
13048 case "$getgrnam_r_proto" in
13049 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
13050 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
13052 case "$getgrnam_r_proto" in
13053 ''|0) d_getgrnam_r=undef
13055 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
13056 * ) case "$getgrnam_r_proto" in
13057 REENTRANT_PROTO*) ;;
13058 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
13060 echo "Prototype: $try" ;;
13063 *) case "$usethreads" in
13064 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
13071 *) getgrnam_r_proto=0
13075 : see if gethostbyaddr exists
13076 set gethostbyaddr d_gethbyaddr
13079 : see if gethostbyname exists
13080 set gethostbyname d_gethbyname
13083 : see if gethostent exists
13084 set gethostent d_gethent
13087 : see how we will look up host name
13090 if set gethostname val -f d_gethname; eval $csym; $val; then
13091 echo 'gethostname() found.' >&4
13092 d_gethname="$define"
13095 if set uname val -f d_uname; eval $csym; $val; then
13098 uname() was found, but you're running xenix, and older versions of xenix
13099 have a broken uname(). If you don't really know whether your xenix is old
13100 enough to have a broken system call, use the default answer.
13105 "$define") dflt=n;;
13107 rp='Is your uname() broken?'
13110 n*) d_uname="$define"; call=uname;;
13113 echo 'uname() found.' >&4
13120 case "$d_gethname" in
13121 '') d_gethname="$undef";;
13124 '') d_uname="$undef";;
13126 case "$d_uname$d_gethname" in
13131 Every now and then someone has a $call() that lies about the hostname
13132 but can't be fixed for political or economic reasons. If you wish, I can
13133 pretend $call() isn't there and maybe compute hostname at run-time
13134 thanks to the '$phostname' command.
13137 rp="Shall I ignore $call() from now on?"
13140 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
13143 case "$phostname" in
13144 '') aphostname='';;
13145 *) case "$aphostname" in
13147 *) set X $phostname
13151 file=`./loc $file $file $pth`
13152 aphostname=`echo $file $*`
13157 case "$d_uname$d_gethname" in
13160 case "$phostname" in
13162 echo "There will be no way for $package to get your hostname." >&4;;
13164 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
13168 case "$d_phostname" in
13169 '') d_phostname="$undef";;
13172 : see if gethostbyaddr_r exists
13173 set gethostbyaddr_r d_gethostbyaddr_r
13175 case "$d_gethostbyaddr_r" in
13177 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13178 case "$d_gethostbyaddr_r_proto:$usethreads" in
13179 ":define") d_gethostbyaddr_r_proto=define
13180 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
13184 case "$d_gethostbyaddr_r_proto" in
13186 case "$gethostbyaddr_r_proto" in
13187 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13188 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
13190 case "$gethostbyaddr_r_proto" in
13191 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
13192 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
13194 case "$gethostbyaddr_r_proto" in
13195 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
13196 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
13198 case "$gethostbyaddr_r_proto" in
13199 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
13200 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
13202 case "$gethostbyaddr_r_proto" in
13203 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
13204 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
13206 case "$gethostbyaddr_r_proto" in
13207 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
13208 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
13210 case "$gethostbyaddr_r_proto" in
13211 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
13212 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
13214 case "$gethostbyaddr_r_proto" in
13215 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
13216 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
13218 case "$gethostbyaddr_r_proto" in
13219 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
13220 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
13222 case "$gethostbyaddr_r_proto" in
13223 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
13224 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
13226 case "$gethostbyaddr_r_proto" in
13227 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13228 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
13230 case "$gethostbyaddr_r_proto" in
13231 ''|0) d_gethostbyaddr_r=undef
13232 gethostbyaddr_r_proto=0
13233 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
13234 * ) case "$gethostbyaddr_r_proto" in
13235 REENTRANT_PROTO*) ;;
13236 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
13238 echo "Prototype: $try" ;;
13241 *) case "$usethreads" in
13242 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
13244 d_gethostbyaddr_r=undef
13245 gethostbyaddr_r_proto=0
13249 *) gethostbyaddr_r_proto=0
13253 : see if gethostbyname_r exists
13254 set gethostbyname_r d_gethostbyname_r
13256 case "$d_gethostbyname_r" in
13258 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13259 case "$d_gethostbyname_r_proto:$usethreads" in
13260 ":define") d_gethostbyname_r_proto=define
13261 set d_gethostbyname_r_proto gethostbyname_r $hdrs
13265 case "$d_gethostbyname_r_proto" in
13267 case "$gethostbyname_r_proto" in
13268 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
13269 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
13271 case "$gethostbyname_r_proto" in
13272 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
13273 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
13275 case "$gethostbyname_r_proto" in
13276 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
13277 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
13279 case "$gethostbyname_r_proto" in
13280 ''|0) d_gethostbyname_r=undef
13281 gethostbyname_r_proto=0
13282 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
13283 * ) case "$gethostbyname_r_proto" in
13284 REENTRANT_PROTO*) ;;
13285 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
13287 echo "Prototype: $try" ;;
13290 *) case "$usethreads" in
13291 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13293 d_gethostbyname_r=undef
13294 gethostbyname_r_proto=0
13298 *) gethostbyname_r_proto=0
13302 : see if gethostent_r exists
13303 set gethostent_r d_gethostent_r
13305 case "$d_gethostent_r" in
13307 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13308 case "$d_gethostent_r_proto:$usethreads" in
13309 ":define") d_gethostent_r_proto=define
13310 set d_gethostent_r_proto gethostent_r $hdrs
13314 case "$d_gethostent_r_proto" in
13316 case "$gethostent_r_proto" in
13317 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
13318 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
13320 case "$gethostent_r_proto" in
13321 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
13322 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBIE ;;
13324 case "$gethostent_r_proto" in
13325 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
13326 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBIE ;;
13328 case "$gethostent_r_proto" in
13329 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
13330 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBI ;;
13332 case "$gethostent_r_proto" in
13333 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
13334 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBI ;;
13336 case "$gethostent_r_proto" in
13337 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13338 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SD ;;
13340 case "$gethostent_r_proto" in
13341 ''|0) d_gethostent_r=undef
13342 gethostent_r_proto=0
13343 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13344 * ) case "$gethostent_r_proto" in
13345 REENTRANT_PROTO*) ;;
13346 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13348 echo "Prototype: $try" ;;
13351 *) case "$usethreads" in
13352 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13354 d_gethostent_r=undef
13355 gethostent_r_proto=0
13359 *) gethostent_r_proto=0
13363 : see if prototypes for various gethostxxx netdb.h functions are available
13365 set d_gethostprotos gethostent $i_netdb netdb.h
13368 : see if getitimer exists
13369 set getitimer d_getitimer
13372 : see if getlogin exists
13373 set getlogin d_getlogin
13376 : see if getlogin_r exists
13377 set getlogin_r d_getlogin_r
13379 case "$d_getlogin_r" in
13381 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
13382 case "$d_getlogin_r_proto:$usethreads" in
13383 ":define") d_getlogin_r_proto=define
13384 set d_getlogin_r_proto getlogin_r $hdrs
13388 case "$d_getlogin_r_proto" in
13390 case "$getlogin_r_proto" in
13391 ''|0) try='int getlogin_r(char*, size_t);'
13392 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BW ;;
13394 case "$getlogin_r_proto" in
13395 ''|0) try='int getlogin_r(char*, int);'
13396 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BI ;;
13398 case "$getlogin_r_proto" in
13399 ''|0) try='char* getlogin_r(char*, size_t);'
13400 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BW ;;
13402 case "$getlogin_r_proto" in
13403 ''|0) try='char* getlogin_r(char*, int);'
13404 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BI ;;
13406 case "$getlogin_r_proto" in
13407 ''|0) d_getlogin_r=undef
13409 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
13410 * ) case "$getlogin_r_proto" in
13411 REENTRANT_PROTO*) ;;
13412 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
13414 echo "Prototype: $try" ;;
13417 *) case "$usethreads" in
13418 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
13425 *) getlogin_r_proto=0
13429 : see if getmnt exists
13430 set getmnt d_getmnt
13433 : see if getmntent exists
13434 set getmntent d_getmntent
13437 : see if getnetbyaddr exists
13438 set getnetbyaddr d_getnbyaddr
13441 : see if getnetbyname exists
13442 set getnetbyname d_getnbyname
13445 : see if getnetent exists
13446 set getnetent d_getnent
13449 : see if getnetbyaddr_r exists
13450 set getnetbyaddr_r d_getnetbyaddr_r
13452 case "$d_getnetbyaddr_r" in
13454 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13455 case "$d_getnetbyaddr_r_proto:$usethreads" in
13456 ":define") d_getnetbyaddr_r_proto=define
13457 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
13461 case "$d_getnetbyaddr_r_proto" in
13463 case "$getnetbyaddr_r_proto" in
13464 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
13465 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
13467 case "$getnetbyaddr_r_proto" in
13468 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
13469 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
13471 case "$getnetbyaddr_r_proto" in
13472 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
13473 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
13475 case "$getnetbyaddr_r_proto" in
13476 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
13477 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
13479 case "$getnetbyaddr_r_proto" in
13480 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
13481 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
13483 case "$getnetbyaddr_r_proto" in
13484 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
13485 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
13487 case "$getnetbyaddr_r_proto" in
13488 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
13489 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
13491 case "$getnetbyaddr_r_proto" in
13492 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
13493 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
13495 case "$getnetbyaddr_r_proto" in
13496 ''|0) d_getnetbyaddr_r=undef
13497 getnetbyaddr_r_proto=0
13498 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
13499 * ) case "$getnetbyaddr_r_proto" in
13500 REENTRANT_PROTO*) ;;
13501 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
13503 echo "Prototype: $try" ;;
13506 *) case "$usethreads" in
13507 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
13509 d_getnetbyaddr_r=undef
13510 getnetbyaddr_r_proto=0
13514 *) getnetbyaddr_r_proto=0
13518 : see if getnetbyname_r exists
13519 set getnetbyname_r d_getnetbyname_r
13521 case "$d_getnetbyname_r" in
13523 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13524 case "$d_getnetbyname_r_proto:$usethreads" in
13525 ":define") d_getnetbyname_r_proto=define
13526 set d_getnetbyname_r_proto getnetbyname_r $hdrs
13530 case "$d_getnetbyname_r_proto" in
13532 case "$getnetbyname_r_proto" in
13533 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
13534 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
13536 case "$getnetbyname_r_proto" in
13537 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
13538 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
13540 case "$getnetbyname_r_proto" in
13541 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
13542 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
13544 case "$getnetbyname_r_proto" in
13545 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
13546 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
13548 case "$getnetbyname_r_proto" in
13549 ''|0) d_getnetbyname_r=undef
13550 getnetbyname_r_proto=0
13551 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
13552 * ) case "$getnetbyname_r_proto" in
13553 REENTRANT_PROTO*) ;;
13554 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
13556 echo "Prototype: $try" ;;
13559 *) case "$usethreads" in
13560 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
13562 d_getnetbyname_r=undef
13563 getnetbyname_r_proto=0
13567 *) getnetbyname_r_proto=0
13571 : see if getnetent_r exists
13572 set getnetent_r d_getnetent_r
13574 case "$d_getnetent_r" in
13576 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13577 case "$d_getnetent_r_proto:$usethreads" in
13578 ":define") d_getnetent_r_proto=define
13579 set d_getnetent_r_proto getnetent_r $hdrs
13583 case "$d_getnetent_r_proto" in
13585 case "$getnetent_r_proto" in
13586 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
13587 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
13589 case "$getnetent_r_proto" in
13590 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
13591 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBIE ;;
13593 case "$getnetent_r_proto" in
13594 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
13595 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBIE ;;
13597 case "$getnetent_r_proto" in
13598 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
13599 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBI ;;
13601 case "$getnetent_r_proto" in
13602 ''|0) try='int getnetent_r(struct netent*, char*, int);'
13603 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBI ;;
13605 case "$getnetent_r_proto" in
13606 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
13607 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SD ;;
13609 case "$getnetent_r_proto" in
13610 ''|0) d_getnetent_r=undef
13611 getnetent_r_proto=0
13612 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
13613 * ) case "$getnetent_r_proto" in
13614 REENTRANT_PROTO*) ;;
13615 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
13617 echo "Prototype: $try" ;;
13620 *) case "$usethreads" in
13621 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
13623 d_getnetent_r=undef
13624 getnetent_r_proto=0
13628 *) getnetent_r_proto=0
13632 : see if prototypes for various getnetxxx netdb.h functions are available
13634 set d_getnetprotos getnetent $i_netdb netdb.h
13637 : see if getpagesize exists
13638 set getpagesize d_getpagsz
13642 : see if getprotobyname exists
13643 set getprotobyname d_getpbyname
13646 : see if getprotobynumber exists
13647 set getprotobynumber d_getpbynumber
13650 : see if getprotoent exists
13651 set getprotoent d_getpent
13654 : see if getpgid exists
13655 set getpgid d_getpgid
13658 : see if getpgrp2 exists
13659 set getpgrp2 d_getpgrp2
13662 : see if getppid exists
13663 set getppid d_getppid
13666 : see if getpriority exists
13667 set getpriority d_getprior
13670 : see if getprotobyname_r exists
13671 set getprotobyname_r d_getprotobyname_r
13673 case "$d_getprotobyname_r" in
13675 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13676 case "$d_getprotobyname_r_proto:$usethreads" in
13677 ":define") d_getprotobyname_r_proto=define
13678 set d_getprotobyname_r_proto getprotobyname_r $hdrs
13682 case "$d_getprotobyname_r_proto" in
13684 case "$getprotobyname_r_proto" in
13685 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
13686 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
13688 case "$getprotobyname_r_proto" in
13689 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
13690 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
13692 case "$getprotobyname_r_proto" in
13693 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
13694 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
13696 case "$getprotobyname_r_proto" in
13697 ''|0) d_getprotobyname_r=undef
13698 getprotobyname_r_proto=0
13699 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
13700 * ) case "$getprotobyname_r_proto" in
13701 REENTRANT_PROTO*) ;;
13702 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
13704 echo "Prototype: $try" ;;
13707 *) case "$usethreads" in
13708 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
13710 d_getprotobyname_r=undef
13711 getprotobyname_r_proto=0
13715 *) getprotobyname_r_proto=0
13719 : see if getprotobynumber_r exists
13720 set getprotobynumber_r d_getprotobynumber_r
13722 case "$d_getprotobynumber_r" in
13724 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13725 case "$d_getprotobynumber_r_proto:$usethreads" in
13726 ":define") d_getprotobynumber_r_proto=define
13727 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
13731 case "$d_getprotobynumber_r_proto" in
13733 case "$getprotobynumber_r_proto" in
13734 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
13735 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
13737 case "$getprotobynumber_r_proto" in
13738 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
13739 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
13741 case "$getprotobynumber_r_proto" in
13742 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
13743 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
13745 case "$getprotobynumber_r_proto" in
13746 ''|0) d_getprotobynumber_r=undef
13747 getprotobynumber_r_proto=0
13748 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
13749 * ) case "$getprotobynumber_r_proto" in
13750 REENTRANT_PROTO*) ;;
13751 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
13753 echo "Prototype: $try" ;;
13756 *) case "$usethreads" in
13757 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
13759 d_getprotobynumber_r=undef
13760 getprotobynumber_r_proto=0
13764 *) getprotobynumber_r_proto=0
13768 : see if getprotoent_r exists
13769 set getprotoent_r d_getprotoent_r
13771 case "$d_getprotoent_r" in
13773 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13774 case "$d_getprotoent_r_proto:$usethreads" in
13775 ":define") d_getprotoent_r_proto=define
13776 set d_getprotoent_r_proto getprotoent_r $hdrs
13780 case "$d_getprotoent_r_proto" in
13782 case "$getprotoent_r_proto" in
13783 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
13784 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
13786 case "$getprotoent_r_proto" in
13787 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
13788 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBI ;;
13790 case "$getprotoent_r_proto" in
13791 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
13792 ./protochk "extern $try" $hdrs && getprotoent_r_proto=S_SBI ;;
13794 case "$getprotoent_r_proto" in
13795 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
13796 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SD ;;
13798 case "$getprotoent_r_proto" in
13799 ''|0) d_getprotoent_r=undef
13800 getprotoent_r_proto=0
13801 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
13802 * ) case "$getprotoent_r_proto" in
13803 REENTRANT_PROTO*) ;;
13804 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
13806 echo "Prototype: $try" ;;
13809 *) case "$usethreads" in
13810 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
13812 d_getprotoent_r=undef
13813 getprotoent_r_proto=0
13817 *) getprotoent_r_proto=0
13821 : see if prototypes for various getprotoxxx netdb.h functions are available
13823 set d_getprotoprotos getprotoent $i_netdb netdb.h
13826 : see if getprpwnam exists
13827 set getprpwnam d_getprpwnam
13830 : see if getpwent exists
13831 set getpwent d_getpwent
13834 : see if getpwent_r exists
13835 set getpwent_r d_getpwent_r
13837 case "$d_getpwent_r" in
13839 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13840 case "$d_getpwent_r_proto:$usethreads" in
13841 ":define") d_getpwent_r_proto=define
13842 set d_getpwent_r_proto getpwent_r $hdrs
13846 case "$d_getpwent_r_proto" in
13848 case "$getpwent_r_proto" in
13849 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
13850 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBWR ;;
13852 case "$getpwent_r_proto" in
13853 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
13854 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIR ;;
13856 case "$getpwent_r_proto" in
13857 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
13858 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBW ;;
13860 case "$getpwent_r_proto" in
13861 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
13862 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBI ;;
13864 case "$getpwent_r_proto" in
13865 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
13866 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBI ;;
13868 case "$getpwent_r_proto" in
13869 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
13870 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIH ;;
13872 case "$getpwent_r_proto" in
13873 ''|0) d_getpwent_r=undef
13875 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
13876 * ) case "$getpwent_r_proto" in
13877 REENTRANT_PROTO*) ;;
13878 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
13880 echo "Prototype: $try" ;;
13883 *) case "$usethreads" in
13884 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
13891 *) getpwent_r_proto=0
13895 : see if getpwnam_r exists
13896 set getpwnam_r d_getpwnam_r
13898 case "$d_getpwnam_r" in
13900 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13901 case "$d_getpwnam_r_proto:$usethreads" in
13902 ":define") d_getpwnam_r_proto=define
13903 set d_getpwnam_r_proto getpwnam_r $hdrs
13907 case "$d_getpwnam_r_proto" in
13909 case "$getpwnam_r_proto" in
13910 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
13911 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
13913 case "$getpwnam_r_proto" in
13914 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
13915 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
13917 case "$getpwnam_r_proto" in
13918 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
13919 ./protochk "extern $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
13921 case "$getpwnam_r_proto" in
13922 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
13923 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
13925 case "$getpwnam_r_proto" in
13926 ''|0) d_getpwnam_r=undef
13928 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
13929 * ) case "$getpwnam_r_proto" in
13930 REENTRANT_PROTO*) ;;
13931 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
13933 echo "Prototype: $try" ;;
13936 *) case "$usethreads" in
13937 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
13944 *) getpwnam_r_proto=0
13948 : see if getpwuid_r exists
13949 set getpwuid_r d_getpwuid_r
13951 case "$d_getpwuid_r" in
13953 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13954 case "$d_getpwuid_r_proto:$usethreads" in
13955 ":define") d_getpwuid_r_proto=define
13956 set d_getpwuid_r_proto getpwuid_r $hdrs
13960 case "$d_getpwuid_r_proto" in
13962 case "$getpwuid_r_proto" in
13963 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
13964 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
13966 case "$getpwuid_r_proto" in
13967 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
13968 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
13970 case "$getpwuid_r_proto" in
13971 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
13972 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
13974 case "$getpwuid_r_proto" in
13975 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
13976 ./protochk "extern $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
13978 case "$getpwuid_r_proto" in
13979 ''|0) d_getpwuid_r=undef
13981 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
13982 * ) case "$getpwuid_r_proto" in
13983 REENTRANT_PROTO*) ;;
13984 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
13986 echo "Prototype: $try" ;;
13989 *) case "$usethreads" in
13990 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
13997 *) getpwuid_r_proto=0
14002 : see if getservbyname exists
14003 set getservbyname d_getsbyname
14006 : see if getservbyport exists
14007 set getservbyport d_getsbyport
14010 : see if getservent exists
14011 set getservent d_getsent
14014 : see if getservbyname_r exists
14015 set getservbyname_r d_getservbyname_r
14017 case "$d_getservbyname_r" in
14019 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14020 case "$d_getservbyname_r_proto:$usethreads" in
14021 ":define") d_getservbyname_r_proto=define
14022 set d_getservbyname_r_proto getservbyname_r $hdrs
14026 case "$d_getservbyname_r_proto" in
14028 case "$getservbyname_r_proto" in
14029 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
14030 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
14032 case "$getservbyname_r_proto" in
14033 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
14034 ./protochk "extern $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
14036 case "$getservbyname_r_proto" in
14037 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
14038 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
14040 case "$getservbyname_r_proto" in
14041 ''|0) d_getservbyname_r=undef
14042 getservbyname_r_proto=0
14043 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
14044 * ) case "$getservbyname_r_proto" in
14045 REENTRANT_PROTO*) ;;
14046 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
14048 echo "Prototype: $try" ;;
14051 *) case "$usethreads" in
14052 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
14054 d_getservbyname_r=undef
14055 getservbyname_r_proto=0
14059 *) getservbyname_r_proto=0
14063 : see if getservbyport_r exists
14064 set getservbyport_r d_getservbyport_r
14066 case "$d_getservbyport_r" in
14068 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14069 case "$d_getservbyport_r_proto:$usethreads" in
14070 ":define") d_getservbyport_r_proto=define
14071 set d_getservbyport_r_proto getservbyport_r $hdrs
14075 case "$d_getservbyport_r_proto" in
14077 case "$getservbyport_r_proto" in
14078 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
14079 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
14081 case "$getservbyport_r_proto" in
14082 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
14083 ./protochk "extern $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
14085 case "$getservbyport_r_proto" in
14086 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
14087 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
14089 case "$getservbyport_r_proto" in
14090 ''|0) d_getservbyport_r=undef
14091 getservbyport_r_proto=0
14092 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
14093 * ) case "$getservbyport_r_proto" in
14094 REENTRANT_PROTO*) ;;
14095 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
14097 echo "Prototype: $try" ;;
14100 *) case "$usethreads" in
14101 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
14103 d_getservbyport_r=undef
14104 getservbyport_r_proto=0
14108 *) getservbyport_r_proto=0
14112 : see if getservent_r exists
14113 set getservent_r d_getservent_r
14115 case "$d_getservent_r" in
14117 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14118 case "$d_getservent_r_proto:$usethreads" in
14119 ":define") d_getservent_r_proto=define
14120 set d_getservent_r_proto getservent_r $hdrs
14124 case "$d_getservent_r_proto" in
14126 case "$getservent_r_proto" in
14127 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
14128 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBWR ;;
14130 case "$getservent_r_proto" in
14131 ''|0) try='int getservent_r(struct servent*, char*, int);'
14132 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBI ;;
14134 case "$getservent_r_proto" in
14135 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
14136 ./protochk "extern $try" $hdrs && getservent_r_proto=S_SBI ;;
14138 case "$getservent_r_proto" in
14139 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
14140 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SD ;;
14142 case "$getservent_r_proto" in
14143 ''|0) d_getservent_r=undef
14144 getservent_r_proto=0
14145 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
14146 * ) case "$getservent_r_proto" in
14147 REENTRANT_PROTO*) ;;
14148 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
14150 echo "Prototype: $try" ;;
14153 *) case "$usethreads" in
14154 define) echo "getservent_r has no prototype, not using it." >&4 ;;
14156 d_getservent_r=undef
14157 getservent_r_proto=0
14161 *) getservent_r_proto=0
14165 : see if prototypes for various getservxxx netdb.h functions are available
14167 set d_getservprotos getservent $i_netdb netdb.h
14170 : see if getspnam exists
14171 set getspnam d_getspnam
14174 : see if this is a shadow.h system
14175 set shadow.h i_shadow
14178 : see if getspnam_r exists
14179 set getspnam_r d_getspnam_r
14181 case "$d_getspnam_r" in
14183 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
14184 case "$d_getspnam_r_proto:$usethreads" in
14185 ":define") d_getspnam_r_proto=define
14186 set d_getspnam_r_proto getspnam_r $hdrs
14190 case "$d_getspnam_r_proto" in
14192 case "$getspnam_r_proto" in
14193 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
14194 ./protochk "extern $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
14196 case "$getspnam_r_proto" in
14197 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
14198 ./protochk "extern $try" $hdrs && getspnam_r_proto=S_CSBI ;;
14200 case "$getspnam_r_proto" in
14201 ''|0) d_getspnam_r=undef
14203 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
14204 * ) case "$getspnam_r_proto" in
14205 REENTRANT_PROTO*) ;;
14206 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
14208 echo "Prototype: $try" ;;
14211 *) case "$usethreads" in
14212 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
14219 *) getspnam_r_proto=0
14223 : see if gettimeofday or ftime exists
14224 set gettimeofday d_gettimeod
14226 case "$d_gettimeod" in
14232 val="$undef"; set d_ftime; eval $setvar
14235 case "$d_gettimeod$d_ftime" in
14238 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
14242 : see if gmtime_r exists
14243 set gmtime_r d_gmtime_r
14245 case "$d_gmtime_r" in
14247 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14248 case "$d_gmtime_r_proto:$usethreads" in
14249 ":define") d_gmtime_r_proto=define
14250 set d_gmtime_r_proto gmtime_r $hdrs
14254 case "$d_gmtime_r_proto" in
14256 case "$gmtime_r_proto" in
14257 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
14258 ./protochk "extern $try" $hdrs && gmtime_r_proto=S_TS ;;
14260 case "$gmtime_r_proto" in
14261 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
14262 ./protochk "extern $try" $hdrs && gmtime_r_proto=I_TS ;;
14264 case "$gmtime_r_proto" in
14265 ''|0) d_gmtime_r=undef
14267 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
14268 * ) case "$gmtime_r_proto" in
14269 REENTRANT_PROTO*) ;;
14270 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
14272 echo "Prototype: $try" ;;
14275 *) case "$usethreads" in
14276 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
14283 *) gmtime_r_proto=0
14287 : see if hasmntopt exists
14288 set hasmntopt d_hasmntopt
14291 : see if this is a netinet/in.h or sys/in.h system
14292 set netinet/in.h i_niin sys/in.h i_sysin
14295 : see if arpa/inet.h has to be included
14296 set arpa/inet.h i_arpainet
14299 : see if htonl --and friends-- exists
14304 : Maybe they are macros.
14307 $cat >htonl.c <<EOM
14309 #include <sys/types.h>
14310 #$i_niin I_NETINET_IN
14312 #$i_arpainet I_ARPA_INET
14313 #ifdef I_NETINET_IN
14314 #include <netinet/in.h>
14317 #include <sys/in.h>
14320 #include <arpa/inet.h>
14323 printf("Defined as a macro.");
14326 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
14327 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
14329 echo "But it seems to be defined as a macro." >&4
14337 : see if ilogbl exists
14338 set ilogbl d_ilogbl
14343 if set index val -f; eval $csym; $val; then
14344 if set strchr val -f d_strchr; eval $csym; $val; then
14345 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14348 echo "strchr() found." >&4
14352 echo "index() found." >&4
14357 echo "index() found." >&4
14360 if set strchr val -f d_strchr; eval $csym; $val; then
14363 echo "strchr() found." >&4
14365 echo "No index() or strchr() found!" >&4
14370 set d_strchr; eval $setvar
14372 set d_index; eval $setvar
14374 : check whether inet_aton exists
14375 set inet_aton d_inetaton
14380 $cat >isascii.c <<EOCP
14383 #$i_stdlib I_STDLIB
14385 #include <stdlib.h>
14396 if eval $compile; then
14397 echo "isascii() found." >&4
14400 echo "isascii() NOT found." >&4
14407 : see if isfinite exists
14408 set isfinite d_isfinite
14411 : see if isinf exists
14415 : see if isnan exists
14419 : see if isnanl exists
14420 set isnanl d_isnanl
14423 : see if killpg exists
14424 set killpg d_killpg
14427 : see if lchown exists
14429 $cat > try.c <<'EOCP'
14430 /* System header to define __stub macros and hopefully few prototypes,
14431 which can conflict with char lchown(); below. */
14432 #include <assert.h>
14433 /* Override any gcc2 internal prototype to avoid an error. */
14434 /* We use char because int might match the return type of a gcc2
14435 builtin and then its argument prototype would still apply. */
14438 /* The GNU C library defines this for functions which it implements
14439 to always fail with ENOSYS. Some functions are actually named
14440 something starting with __ and the normal name is an alias. */
14441 #if defined (__stub_lchown) || defined (__stub___lchown)
14449 if eval $compile; then
14450 $echo "lchown() found." >&4
14453 $echo "lchown() NOT found." >&4
14459 : See if number of significant digits in a double precision number is known
14461 $cat >ldbl_dig.c <<EOM
14462 #$i_limits I_LIMITS
14465 #include <limits.h>
14471 printf("Contains LDBL_DIG");
14474 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
14475 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
14476 echo "LDBL_DIG found." >&4
14479 echo "LDBL_DIG NOT found." >&4
14486 : see if this is a math.h system
14490 d_libm_lib_version="$undef"
14493 : check to see if math.h defines _LIB_VERSION
14495 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
14497 #include <unistd.h>
14499 int main (int argc, char *argv[])
14501 printf ("%d\n", _LIB_VERSION);
14506 if eval $compile; then
14508 echo "Yes, it does ($foo)" >&4
14509 d_libm_lib_version="$define"
14511 echo "No, it does not (probably harmless)\n" >&4
14513 $rm -f try.* try core core.try.*
14518 : see if link exists
14522 : see if localtime_r exists
14523 set localtime_r d_localtime_r
14525 case "$d_localtime_r" in
14527 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14528 case "$d_localtime_r_proto:$usethreads" in
14529 ":define") d_localtime_r_proto=define
14530 set d_localtime_r_proto localtime_r $hdrs
14534 case "$d_localtime_r_proto" in
14536 case "$localtime_r_proto" in
14537 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
14538 ./protochk "extern $try" $hdrs && localtime_r_proto=S_TS ;;
14540 case "$localtime_r_proto" in
14541 ''|0) try='int localtime_r(const time_t*, struct tm*);'
14542 ./protochk "extern $try" $hdrs && localtime_r_proto=I_TS ;;
14544 case "$localtime_r_proto" in
14545 ''|0) d_localtime_r=undef
14546 localtime_r_proto=0
14547 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
14548 * ) case "$localtime_r_proto" in
14549 REENTRANT_PROTO*) ;;
14550 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
14552 echo "Prototype: $try" ;;
14555 *) case "$usethreads" in
14556 define) echo "localtime_r has no prototype, not using it." >&4 ;;
14558 d_localtime_r=undef
14559 localtime_r_proto=0
14563 *) localtime_r_proto=0
14567 : see if localtime_r calls tzset
14568 case "$localtime_r_proto" in
14571 /* Does our libc's localtime_r call tzset ?
14572 * return 0 if so, 1 otherwise.
14574 #include <sys/types.h>
14575 #include <unistd.h>
14577 #include <string.h>
14578 #include <malloc.h>
14581 time_t t = time(0L);
14582 char w_tz[]="TZ" "=GMT+5",
14583 e_tz[]="TZ" "=GMT-5",
14584 *tz_e = (char*)malloc(16),
14585 *tz_w = (char*)malloc(16);
14586 struct tm tm_e, tm_w;
14587 memset(&tm_e,'\0',sizeof(struct tm));
14588 memset(&tm_w,'\0',sizeof(struct tm));
14593 localtime_r(&t, &tm_e);
14596 localtime_r(&t, &tm_w);
14598 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
14604 if eval $compile; then
14606 d_localtime_r_needs_tzset=undef;
14608 d_localtime_r_needs_tzset=define;
14611 d_localtime_r_needs_tzset=undef;
14615 d_localtime_r_needs_tzset=undef;
14618 $rm -f try try.* core
14620 : see if localeconv exists
14621 set localeconv d_locconv
14624 : see if lockf exists
14628 : see if prototype for lseek is available
14630 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
14633 : see if lstat exists
14637 : see if madvise exists
14638 set madvise d_madvise
14641 : see if malloc_size exists
14642 set malloc_size d_malloc_size
14645 : see if malloc_size_good exists
14646 set malloc_good_size d_malloc_good_size
14649 : see if mblen exists
14653 : see if mbstowcs exists
14654 set mbstowcs d_mbstowcs
14657 : see if mbtowc exists
14658 set mbtowc d_mbtowc
14661 : see if memchr exists
14662 set memchr d_memchr
14665 : see if memcmp exists
14666 set memcmp d_memcmp
14669 : see if memcpy exists
14670 set memcpy d_memcpy
14673 : see if memmove exists
14674 set memmove d_memmove
14677 : see if memset exists
14678 set memset d_memset
14681 : see if mkdir exists
14685 : see if mkdtemp exists
14686 set mkdtemp d_mkdtemp
14689 : see if mkfifo exists
14690 set mkfifo d_mkfifo
14693 : see if mkstemp exists
14694 set mkstemp d_mkstemp
14697 : see if mkstemps exists
14698 set mkstemps d_mkstemps
14701 : see if mktime exists
14702 set mktime d_mktime
14705 : see if this is a sys/mman.h system
14706 set sys/mman.h i_sysmman
14709 : see if mmap exists
14712 : see what shmat returns
14713 : default to something harmless
14715 case "$i_sysmman$d_mmap" in
14717 $cat >mmap.c <<'END'
14718 #include <sys/mman.h>
14721 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
14726 echo "and it returns ($mmaptype)." >&4
14732 : see if sqrtl exists
14736 : see if scalbnl exists
14737 set scalbnl d_scalbnl
14740 : see if modfl exists
14744 : see if prototype for modfl is available
14746 set d_modflproto modfl $i_math math.h
14749 d_modfl_pow32_bug="$undef"
14751 case "$d_longdbl$d_modfl" in
14754 Checking to see whether your modfl() is okay for large values...
14760 if $test "X$d_modflproto" != "X$define"; then
14761 $cat >>try.c <<EOCP
14762 /* Sigh. many current glibcs provide the function, but do not prototype it. */
14763 long double modfl (long double, long double *);
14766 $cat >>try.c <<EOCP
14768 long double nv = 4294967303.15;
14774 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
14778 case "$osname:$gccversion" in
14779 aix:) saveccflags="$ccflags"
14780 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
14783 if eval $compile; then
14786 *" 4294967303.150000 1.150000 4294967302.000000")
14787 echo >&4 "Your modfl() is broken for large values."
14788 d_modfl_pow32_bug="$define"
14790 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
14794 *" 4294967303.150000 0.150000 4294967303.000000")
14795 echo >&4 "Your modfl() seems okay for large values."
14797 *) echo >&4 "I don't understand your modfl() at all."
14801 $rm -f try.* try core core.try.*
14803 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
14806 case "$osname:$gccversion" in
14807 aix:) ccflags="$saveccflags" ;; # restore
14812 if $test "$uselongdouble" = "$define"; then
14814 if $test "$d_sqrtl" != "$define"; then
14815 message="$message sqrtl"
14817 if $test "$d_modfl" != "$define"; then
14818 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
14819 echo "You have both aintl and copysignl, so I can emulate modfl."
14821 message="$message modfl"
14824 if $test "$d_frexpl" != "$define"; then
14825 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
14826 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
14828 message="$message frexpl"
14832 if $test "$message" != ""; then
14835 *** You requested the use of long doubles but you do not seem to have
14836 *** the following mathematical functions needed for long double support:
14838 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
14839 *** Cannot continue, aborting.
14847 : see if mprotect exists
14848 set mprotect d_mprotect
14851 : see if msgctl exists
14852 set msgctl d_msgctl
14855 : see if msgget exists
14856 set msgget d_msgget
14859 : see if msgsnd exists
14860 set msgsnd d_msgsnd
14863 : see if msgrcv exists
14864 set msgrcv d_msgrcv
14867 : see how much of the 'msg*(2)' library is present.
14870 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
14871 *"$undef"*) h_msg=false;;
14875 case "`ipcs 2>&1`" in
14876 "SVID messages"*"not configured"*)
14877 echo "Your $osname does not have the msg*(2) configured." >&4
14880 set msgctl d_msgctl
14882 set msgget d_msgget
14884 set msgsnd d_msgsnd
14886 set msgrcv d_msgrcv
14892 : we could also check for sys/ipc.h ...
14893 if $h_msg && $test `./findhdr sys/msg.h`; then
14894 echo "You have the full msg*(2) library." >&4
14897 echo "You don't have the full msg*(2) library." >&4
14905 echo "Checking to see if your system supports struct msghdr..." >&4
14906 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
14908 case "$d_msghdr_s" in
14909 "$define") echo "Yes, it does." ;;
14910 *) echo "No, it doesn't." ;;
14914 : see if msync exists
14918 : see if munmap exists
14919 set munmap d_munmap
14922 : see if nice exists
14926 : see if this is a langinfo.h system
14927 set langinfo.h i_langinfo
14930 : see if nl_langinfo exists
14931 set nl_langinfo d_nl_langinfo
14934 : check for length of character
14936 case "$charsize" in
14938 echo "Checking to see how big your characters are (hey, you never know)..." >&4
14941 #$i_stdlib I_STDLIB
14943 #include <stdlib.h>
14947 printf("%d\n", (int)sizeof(char));
14952 if eval $compile_ok; then
14956 echo "(I can't seem to compile the test program. Guessing...)"
14963 rp="What is the size of a character (in bytes)?"
14968 : check for volatile keyword
14970 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
14971 $cat >try.c <<'EOCP'
14974 typedef struct _goo_struct goo_struct;
14975 goo_struct * volatile goo = ((goo_struct *)0);
14976 struct _goo_struct {
14981 typedef unsigned short foo_t;
14982 char *volatile foo;
14984 volatile foo_t blech;
14988 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
14990 echo "Yup, it does."
14993 echo "Nope, it doesn't."
15001 $echo "Choosing the C types to be used for Perl's internal types..." >&4
15003 case "$use64bitint:$d_quad:$quadtype" in
15006 uvtype="$uquadtype"
15011 uvtype="unsigned long"
15017 case "$uselongdouble:$d_longdbl" in
15019 nvtype="long double"
15020 nvsize=$longdblsize
15027 $echo "(IV will be "$ivtype", $ivsize bytes)"
15028 $echo "(UV will be "$uvtype", $uvsize bytes)"
15029 $echo "(NV will be "$nvtype", $nvsize bytes)"
15032 #$i_inttypes I_INTTYPES
15034 #include <inttypes.h>
15039 int8_t i = INT8_MAX;
15040 uint8_t u = UINT8_MAX;
15041 printf("int8_t\n");
15044 int16_t i = INT16_MAX;
15045 uint16_t i = UINT16_MAX;
15046 printf("int16_t\n");
15049 int32_t i = INT32_MAX;
15050 uint32_t u = UINT32_MAX;
15051 printf("int32_t\n");
15057 '') case "$charsize" in
15059 u8type="unsigned char"
15068 if eval $compile; then
15069 case "`$run ./try`" in
15070 int8_t) i8type=int8_t
15080 '') if $test $charsize -ge 1; then
15082 u8type="unsigned char"
15090 '') case "$shortsize" in
15092 u16type="unsigned short"
15100 '') set try -DINT16
15101 if eval $compile; then
15102 case "`$run ./try`" in
15114 '') if $test $shortsize -ge 2; then
15116 u16type="unsigned short"
15124 '') case "$longsize" in
15126 u32type="unsigned long"
15130 *) case "$intsize" in
15132 u32type="unsigned int"
15142 '') set try -DINT32
15143 if eval $compile; then
15144 case "`$run ./try`" in
15156 '') if $test $intsize -ge 4; then
15158 u32type="unsigned int"
15166 '') case "$d_quad:$quadtype" in
15168 i64type="$quadtype"
15169 u64type="$uquadtype"
15177 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
15178 : volatile so that the compiler has to store it out to memory.
15179 if test X"$d_volatile" = X"$define"; then
15184 #$i_stdlib I_STDLIB
15186 #include <stdlib.h>
15188 #include <sys/types.h>
15189 #include <signal.h>
15191 $volatile int bletched = 0;
15192 $signal_t blech(int s) { bletched = 1; }
15197 int n = 8 * $uvsize;
15200 signal(SIGFPE, blech);
15203 for (i = 0; i < n; i++) {
15204 u = u << 1 | ($uvtype)1;
15206 if (($uvtype)d != u)
15210 d = ($nvtype)(u - 1);
15211 if (($uvtype)d != (u - 1))
15219 printf("%d\n", ((i == n) ? -n : i));
15225 d_nv_preserves_uv="$undef"
15226 if eval $compile; then
15227 nv_preserves_uv_bits="`$run ./try`"
15229 case "$nv_preserves_uv_bits" in
15231 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
15232 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
15233 d_nv_preserves_uv="$define"
15235 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
15236 d_nv_preserves_uv="$undef" ;;
15237 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
15238 nv_preserves_uv_bits="$undef" ;;
15243 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
15244 : volatile so that the compiler has to store it out to memory.
15245 if test X"$d_volatile" = X"$define"; then
15250 #$i_stdlib I_STDLIB
15252 #include <stdlib.h>
15254 #$i_string I_STRING
15256 # include <string.h>
15258 # include <strings.h>
15260 #include <sys/types.h>
15261 #include <signal.h>
15263 $volatile int bletched = 0;
15264 $signal_t blech(int s) { bletched = 1; }
15267 int checkit($nvtype d, char *where) {
15268 unsigned char *p = (char *)&d;
15269 unsigned char *end = p + sizeof(d);
15279 printf("No - %s: 0x", where);
15281 printf ("%02X", *p++);
15286 int main(int argc, char **argv) {
15289 fail += checkit(d, "0.0");
15291 /* The compiler shouldn't be assuming that bletched is 0 */
15294 fail += checkit(d, "bleched");
15297 signal(SIGFPE, blech);
15300 /* Paranoia - the compiler should have no way of knowing that ANSI says
15301 that argv[argc] will always be NULL. Actually, if it did assume this it
15302 would be buggy, as this is C and main() can be called from elsewhere in
15304 d = argv[argc] ? 1 : 0;
15307 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
15310 fail += checkit(d, "ternary");
15312 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
15315 printf("No - memset doesn't give 0.0\n");
15316 /* This might just blow up: */
15317 printf("(gives %g)\n", d);
15323 printf("No - something bleched\n");
15328 printf("No - %d fail(s)\n", fail);
15337 d_nv_zero_is_allbits_zero="$undef"
15338 if eval $compile; then
15344 0.0 is represented as all bits zero in memory
15346 d_nv_zero_is_allbits_zero="$define"
15349 0.0 is not represented as all bits zero in memory
15351 d_nv_zero_is_allbits_zero="$undef"
15356 0.0 is not represented as all bits zero in memory
15358 d_nv_zero_is_allbits_zero="$undef"
15366 : check for off64_t
15368 echo "Checking to see if you have off64_t..." >&4
15370 #include <sys/types.h>
15371 #include <unistd.h>
15372 int main() { off64_t x = 7; }
15375 if eval $compile; then
15377 echo "You have off64_t."
15380 echo "You do not have off64_t."
15381 case "$lseeksize" in
15382 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
15389 : how to create joinable pthreads
15390 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
15392 echo "Checking what constant to use for creating joinable pthreads..." >&4
15393 $cat >try.c <<'EOCP'
15394 #include <pthread.h>
15396 int detachstate = JOINABLE;
15399 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
15400 if eval $compile; then
15401 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
15402 val="$undef" # Yes, undef.
15403 set d_old_pthread_create_joinable
15406 set old_pthread_create_joinable
15409 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
15410 if eval $compile; then
15411 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
15413 set d_old_pthread_create_joinable
15415 val=PTHREAD_CREATE_UNDETACHED
15416 set old_pthread_create_joinable
15419 set try -DJOINABLE=__UNDETACHED
15420 if eval $compile; then
15421 echo "You seem to use __UNDETACHED." >&4
15423 set d_old_pthread_create_joinable
15426 set old_pthread_create_joinable
15429 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
15431 set d_old_pthread_create_joinable
15434 set old_pthread_create_joinable
15441 d_old_pthread_create_joinable="$undef"
15442 old_pthread_create_joinable=""
15445 : see if pause exists
15449 : see if pipe exists
15453 : see if poll exists
15457 : see if readlink exists
15458 set readlink d_readlink
15464 case "$d_readlink" in
15466 if $issymlink /proc/self/exe ; then
15467 $ls -l /proc/self/exe > reflect
15468 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15469 echo "You have Linux-like /proc/self/exe."
15470 procselfexe='"/proc/self/exe"'
15474 if $issymlink /proc/curproc/file ; then
15475 $ls -l /proc/curproc/file > reflect
15476 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15477 echo "You have BSD-like /proc/curproc/file."
15478 procselfexe='"/proc/curproc/file"'
15488 : see whether the pthread_atfork exists
15490 #include <pthread.h>
15493 #ifdef PTHREAD_ATFORK
15494 pthread_atfork(NULL,NULL,NULL);
15499 : see if pthread_atfork exists
15500 set try -DPTHREAD_ATFORK
15501 if eval $compile; then
15506 case "$usethreads" in
15509 $define) echo 'pthread_atfork found.' >&4 ;;
15510 *) echo 'pthread_atfork NOT found.' >&4 ;;
15513 set d_pthread_atfork
15516 : see if pthread_attr_setscope exists
15517 set pthread_attr_setscope d_pthread_attr_setscope
15521 : see whether the various POSIXish _yields exist
15523 #include <pthread.h>
15529 #ifdef PTHREAD_YIELD
15532 #ifdef PTHREAD_YIELD_NULL
15533 pthread_yield(NULL);
15539 : see if sched_yield exists
15540 set try -DSCHED_YIELD
15541 if eval $compile; then
15543 sched_yield='sched_yield()'
15547 case "$usethreads" in
15550 $define) echo 'sched_yield() found.' >&4 ;;
15551 *) echo 'sched_yield() NOT found.' >&4 ;;
15557 : see if pthread_yield exists
15558 set try -DPTHREAD_YIELD
15559 if eval $compile; then
15561 case "$sched_yield" in
15562 '') sched_yield='pthread_yield()' ;;
15565 set try -DPTHREAD_YIELD_NULL
15566 if eval $compile; then
15568 case "$sched_yield" in
15569 '') sched_yield='pthread_yield(NULL)' ;;
15575 case "$usethreads" in
15578 $define) echo 'pthread_yield() found.' >&4 ;;
15579 *) echo 'pthread_yield() NOT found.' >&4 ;;
15583 set d_pthread_yield
15586 case "$sched_yield" in
15587 '') sched_yield=undef ;;
15592 : see if random_r exists
15593 set random_r d_random_r
15595 case "$d_random_r" in
15597 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
15598 case "$d_random_r_proto:$usethreads" in
15599 ":define") d_random_r_proto=define
15600 set d_random_r_proto random_r $hdrs
15604 case "$d_random_r_proto" in
15606 case "$random_r_proto" in
15607 ''|0) try='int random_r(int*, struct random_data*);'
15608 ./protochk "extern $try" $hdrs && random_r_proto=I_iS ;;
15610 case "$random_r_proto" in
15611 ''|0) try='int random_r(long*, struct random_data*);'
15612 ./protochk "extern $try" $hdrs && random_r_proto=I_lS ;;
15614 case "$random_r_proto" in
15615 ''|0) try='int random_r(struct random_data*, int32_t*);'
15616 ./protochk "extern $try" $hdrs && random_r_proto=I_St ;;
15618 case "$random_r_proto" in
15619 ''|0) d_random_r=undef
15621 echo "Disabling random_r, cannot determine prototype." >&4 ;;
15622 * ) case "$random_r_proto" in
15623 REENTRANT_PROTO*) ;;
15624 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
15626 echo "Prototype: $try" ;;
15629 *) case "$usethreads" in
15630 define) echo "random_r has no prototype, not using it." >&4 ;;
15637 *) random_r_proto=0
15641 : see if readdir and friends exist
15642 set readdir d_readdir
15644 set seekdir d_seekdir
15646 set telldir d_telldir
15648 set rewinddir d_rewinddir
15651 : see if readdir64_r exists
15652 set readdir64_r d_readdir64_r
15654 case "$d_readdir64_r" in
15656 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15657 case "$d_readdir64_r_proto:$usethreads" in
15658 ":define") d_readdir64_r_proto=define
15659 set d_readdir64_r_proto readdir64_r $hdrs
15663 case "$d_readdir64_r_proto" in
15665 case "$readdir64_r_proto" in
15666 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
15667 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TSR ;;
15669 case "$readdir64_r_proto" in
15670 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
15671 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TS ;;
15673 case "$readdir64_r_proto" in
15674 ''|0) d_readdir64_r=undef
15675 readdir64_r_proto=0
15676 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
15677 * ) case "$readdir64_r_proto" in
15678 REENTRANT_PROTO*) ;;
15679 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
15681 echo "Prototype: $try" ;;
15684 *) case "$usethreads" in
15685 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
15687 d_readdir64_r=undef
15688 readdir64_r_proto=0
15692 *) readdir64_r_proto=0
15696 : see if readdir_r exists
15697 set readdir_r d_readdir_r
15699 case "$d_readdir_r" in
15701 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15702 case "$d_readdir_r_proto:$usethreads" in
15703 ":define") d_readdir_r_proto=define
15704 set d_readdir_r_proto readdir_r $hdrs
15708 case "$d_readdir_r_proto" in
15710 case "$readdir_r_proto" in
15711 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
15712 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TSR ;;
15714 case "$readdir_r_proto" in
15715 ''|0) try='int readdir_r(DIR*, struct dirent*);'
15716 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TS ;;
15718 case "$readdir_r_proto" in
15719 ''|0) d_readdir_r=undef
15721 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
15722 * ) case "$readdir_r_proto" in
15723 REENTRANT_PROTO*) ;;
15724 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
15726 echo "Prototype: $try" ;;
15729 *) case "$usethreads" in
15730 define) echo "readdir_r has no prototype, not using it." >&4 ;;
15737 *) readdir_r_proto=0
15741 : see if readv exists
15745 : see if recvmsg exists
15746 set recvmsg d_recvmsg
15749 : see if rename exists
15750 set rename d_rename
15753 : see if rmdir exists
15757 : see if memory.h is available.
15762 : See if it conflicts with string.h
15768 $cppstdin $cppflags $cppminus < $strings > mem.h
15769 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
15771 echo "We won't be including <memory.h>."
15781 : can bcopy handle overlapping blocks?
15784 case "$d_memmove" in
15785 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
15786 *) case "$d_bcopy" in
15788 echo "Checking to see if bcopy() can do overlapping copies..." >&4
15790 #$i_memory I_MEMORY
15791 #$i_stdlib I_STDLIB
15792 #$i_string I_STRING
15793 #$i_unistd I_UNISTD
15795 $cat >>try.c <<'EOCP'
15798 # include <memory.h>
15801 # include <stdlib.h>
15804 # include <string.h>
15806 # include <strings.h>
15809 # include <unistd.h> /* Needed for NetBSD */
15813 char buf[128], abc[128];
15819 /* Copy "abcde..." string to char abc[] so that gcc doesn't
15820 try to store the string in read-only memory. */
15821 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
15823 for (align = 7; align >= 0; align--) {
15824 for (len = 36; len; len--) {
15826 bcopy(abc, b, len);
15827 for (off = 1; off <= len; off++) {
15828 bcopy(b, b+off, len);
15829 bcopy(b+off, b, len);
15830 if (bcmp(b, abc, len))
15839 if eval $compile_ok; then
15840 if ./try 2>/dev/null; then
15841 echo "Yes, it can."
15844 echo "It can't, sorry."
15847 echo "(I can't compile the test program, so we'll assume not...)"
15851 $rm -f try.* try core
15857 : can memcpy handle overlapping blocks?
15860 case "$d_memmove" in
15861 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
15862 *) case "$d_memcpy" in
15864 echo "Checking to see if memcpy() can do overlapping copies..." >&4
15866 #$i_memory I_MEMORY
15867 #$i_stdlib I_STDLIB
15868 #$i_string I_STRING
15869 #$i_unistd I_UNISTD
15871 $cat >>try.c <<'EOCP'
15874 # include <memory.h>
15877 # include <stdlib.h>
15880 # include <string.h>
15882 # include <strings.h>
15885 # include <unistd.h> /* Needed for NetBSD */
15889 char buf[128], abc[128];
15895 /* Copy "abcde..." string to char abc[] so that gcc doesn't
15896 try to store the string in read-only memory. */
15897 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
15899 for (align = 7; align >= 0; align--) {
15900 for (len = 36; len; len--) {
15902 memcpy(b, abc, len);
15903 for (off = 1; off <= len; off++) {
15904 memcpy(b+off, b, len);
15905 memcpy(b, b+off, len);
15906 if (memcmp(b, abc, len))
15915 if eval $compile_ok; then
15916 if ./try 2>/dev/null; then
15917 echo "Yes, it can."
15920 echo "It can't, sorry."
15923 echo "(I can't compile the test program, so we'll assume not...)"
15927 $rm -f try.* try core
15933 : can memcmp be trusted to compare relative magnitude?
15935 case "$d_memcmp" in
15938 echo "Checking if your memcmp() can compare relative magnitude..." >&4
15940 #$i_memory I_MEMORY
15941 #$i_stdlib I_STDLIB
15942 #$i_string I_STRING
15943 #$i_unistd I_UNISTD
15945 $cat >>try.c <<'EOCP'
15948 # include <memory.h>
15951 # include <stdlib.h>
15954 # include <string.h>
15956 # include <strings.h>
15959 # include <unistd.h> /* Needed for NetBSD */
15965 if ((a < b) && memcmp(&a, &b, 1) < 0)
15971 if eval $compile_ok; then
15972 if $run ./try 2>/dev/null; then
15973 echo "Yes, it can."
15976 echo "No, it can't (it uses signed chars)."
15979 echo "(I can't compile the test program, so we'll assume not...)"
15983 $rm -f try.* try core
15987 : see if prototype for sbrk is available
15989 set d_sbrkproto sbrk $i_unistd unistd.h
15992 : see if select exists
15993 set select d_select
15996 : see if semctl exists
15997 set semctl d_semctl
16000 : see if semget exists
16001 set semget d_semget
16004 : see if semop exists
16008 : see how much of the 'sem*(2)' library is present.
16011 case "$d_semctl$d_semget$d_semop" in
16012 *"$undef"*) h_sem=false;;
16016 case "`ipcs 2>&1`" in
16017 "SVID messages"*"not configured"*)
16018 echo "Your $osname does not have the sem*(2) configured." >&4
16021 set semctl d_semctl
16023 set semget d_semget
16031 : we could also check for sys/ipc.h ...
16032 if $h_sem && $test `./findhdr sys/sem.h`; then
16033 echo "You have the full sem*(2) library." >&4
16036 echo "You don't have the full sem*(2) library." >&4
16042 : see whether sys/sem.h defines union semun
16044 $cat > try.c <<'END'
16045 #include <sys/types.h>
16046 #include <sys/ipc.h>
16047 #include <sys/sem.h>
16048 int main () { union semun semun; semun.buf = 0; }
16051 if eval $compile; then
16052 echo "You have union semun in <sys/sem.h>." >&4
16055 echo "You do not have union semun in <sys/sem.h>." >&4
16062 : see how to do semctl IPC_STAT
16069 # define S_IRUSR S_IREAD
16070 # define S_IWUSR S_IWRITE
16071 # define S_IXUSR S_IEXEC
16073 # define S_IRUSR 0400
16074 # define S_IWUSR 0200
16075 # define S_IXUSR 0100
16077 # define S_IRGRP (S_IRUSR>>3)
16078 # define S_IWGRP (S_IWUSR>>3)
16079 # define S_IXGRP (S_IXUSR>>3)
16080 # define S_IROTH (S_IRUSR>>6)
16081 # define S_IWOTH (S_IWUSR>>6)
16082 # define S_IXOTH (S_IXUSR>>6)
16085 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
16086 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
16087 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
16090 : see whether semctl IPC_STAT can use union semun
16091 case "$d_semctl_semun" in
16095 #include <sys/types.h>
16096 #include <sys/ipc.h>
16097 #include <sys/sem.h>
16098 #include <sys/stat.h>
16105 #$d_union_semun HAS_UNION_SEMUN
16108 #ifndef HAS_UNION_SEMUN
16111 struct semid_ds *buf;
16112 unsigned short *array;
16118 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16119 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16121 struct semid_ds argbuf;
16124 st = semctl(sem, 0, IPC_STAT, arg);
16128 # endif /* IPC_STAT */
16129 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16131 if (semctl(sem, 0, IPC_RMID, arg) != 0)
16132 # endif /* IPC_RMID */
16133 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16135 #endif /* IPC_PRIVATE && ... */
16136 printf("semget failed: errno = %d\n", errno);
16141 if eval $compile; then
16144 semun) val="$define" ;;
16152 case "$d_semctl_semun" in
16154 echo "You can use union semun for semctl IPC_STAT." >&4
16157 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
16162 : see whether semctl IPC_STAT can use struct semid_ds pointer
16163 case "$d_semctl_semid_ds" in
16166 $cat > try.c <<'END'
16167 #include <sys/types.h>
16168 #include <sys/ipc.h>
16169 #include <sys/sem.h>
16170 #include <sys/stat.h>
16178 struct semid_ds arg;
16181 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16182 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16185 st = semctl(sem, 0, IPC_STAT, &arg);
16187 printf("semid_ds\n");
16189 # endif /* IPC_STAT */
16190 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16192 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
16193 # endif /* IPC_RMID */
16194 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16196 #endif /* IPC_PRIVATE && ... */
16197 printf("semget failed: errno = %d\n", errno);
16203 if eval $compile; then
16206 semid_ds) val="$define" ;;
16210 set d_semctl_semid_ds
16214 case "$d_semctl_semid_ds" in
16216 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
16218 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
16225 # We do not have the full sem*(2) library, so assume we can not
16231 set d_semctl_semid_ds
16236 : see if sendmsg exists
16237 set sendmsg d_sendmsg
16240 : see if setegid exists
16241 set setegid d_setegid
16244 : see if seteuid exists
16245 set seteuid d_seteuid
16248 : see if setgrent exists
16249 set setgrent d_setgrent
16252 : see if setgrent_r exists
16253 set setgrent_r d_setgrent_r
16255 case "$d_setgrent_r" in
16257 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
16258 case "$d_setgrent_r_proto:$usethreads" in
16259 ":define") d_setgrent_r_proto=define
16260 set d_setgrent_r_proto setgrent_r $hdrs
16264 case "$d_setgrent_r_proto" in
16266 case "$setgrent_r_proto" in
16267 ''|0) try='int setgrent_r(FILE**);'
16268 ./protochk "extern $try" $hdrs && setgrent_r_proto=I_H ;;
16270 case "$setgrent_r_proto" in
16271 ''|0) try='void setgrent_r(FILE**);'
16272 ./protochk "extern $try" $hdrs && setgrent_r_proto=V_H ;;
16274 case "$setgrent_r_proto" in
16275 ''|0) d_setgrent_r=undef
16277 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
16278 * ) case "$setgrent_r_proto" in
16279 REENTRANT_PROTO*) ;;
16280 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
16282 echo "Prototype: $try" ;;
16285 *) case "$usethreads" in
16286 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
16293 *) setgrent_r_proto=0
16297 : see if sethostent exists
16298 set sethostent d_sethent
16301 : see if sethostent_r exists
16302 set sethostent_r d_sethostent_r
16304 case "$d_sethostent_r" in
16306 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16307 case "$d_sethostent_r_proto:$usethreads" in
16308 ":define") d_sethostent_r_proto=define
16309 set d_sethostent_r_proto sethostent_r $hdrs
16313 case "$d_sethostent_r_proto" in
16315 case "$sethostent_r_proto" in
16316 ''|0) try='int sethostent_r(int, struct hostent_data*);'
16317 ./protochk "extern $try" $hdrs && sethostent_r_proto=I_ID ;;
16319 case "$sethostent_r_proto" in
16320 ''|0) try='void sethostent_r(int, struct hostent_data*);'
16321 ./protochk "extern $try" $hdrs && sethostent_r_proto=V_ID ;;
16323 case "$sethostent_r_proto" in
16324 ''|0) d_sethostent_r=undef
16325 sethostent_r_proto=0
16326 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
16327 * ) case "$sethostent_r_proto" in
16328 REENTRANT_PROTO*) ;;
16329 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
16331 echo "Prototype: $try" ;;
16334 *) case "$usethreads" in
16335 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
16337 d_sethostent_r=undef
16338 sethostent_r_proto=0
16342 *) sethostent_r_proto=0
16346 : see if setitimer exists
16347 set setitimer d_setitimer
16350 : see if setlinebuf exists
16351 set setlinebuf d_setlinebuf
16354 : see if setlocale exists
16355 set setlocale d_setlocale
16358 : see if locale.h is available
16359 set locale.h i_locale
16362 : see if setlocale_r exists
16363 set setlocale_r d_setlocale_r
16365 case "$d_setlocale_r" in
16367 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
16368 case "$d_setlocale_r_proto:$usethreads" in
16369 ":define") d_setlocale_r_proto=define
16370 set d_setlocale_r_proto setlocale_r $hdrs
16374 case "$d_setlocale_r_proto" in
16376 case "$setlocale_r_proto" in
16377 ''|0) try='int setlocale_r(int, const char*, char*, int);'
16378 ./protochk "extern $try" $hdrs && setlocale_r_proto=I_ICBI ;;
16380 case "$setlocale_r_proto" in
16381 ''|0) d_setlocale_r=undef
16382 setlocale_r_proto=0
16383 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
16384 * ) case "$setlocale_r_proto" in
16385 REENTRANT_PROTO*) ;;
16386 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
16388 echo "Prototype: $try" ;;
16391 *) case "$usethreads" in
16392 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
16394 d_setlocale_r=undef
16395 setlocale_r_proto=0
16399 *) setlocale_r_proto=0
16403 : see if setnetent exists
16404 set setnetent d_setnent
16407 : see if setnetent_r exists
16408 set setnetent_r d_setnetent_r
16410 case "$d_setnetent_r" in
16412 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16413 case "$d_setnetent_r_proto:$usethreads" in
16414 ":define") d_setnetent_r_proto=define
16415 set d_setnetent_r_proto setnetent_r $hdrs
16419 case "$d_setnetent_r_proto" in
16421 case "$setnetent_r_proto" in
16422 ''|0) try='int setnetent_r(int, struct netent_data*);'
16423 ./protochk "extern $try" $hdrs && setnetent_r_proto=I_ID ;;
16425 case "$setnetent_r_proto" in
16426 ''|0) try='void setnetent_r(int, struct netent_data*);'
16427 ./protochk "extern $try" $hdrs && setnetent_r_proto=V_ID ;;
16429 case "$setnetent_r_proto" in
16430 ''|0) d_setnetent_r=undef
16431 setnetent_r_proto=0
16432 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
16433 * ) case "$setnetent_r_proto" in
16434 REENTRANT_PROTO*) ;;
16435 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
16437 echo "Prototype: $try" ;;
16440 *) case "$usethreads" in
16441 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
16443 d_setnetent_r=undef
16444 setnetent_r_proto=0
16448 *) setnetent_r_proto=0
16452 : see if setprotoent exists
16453 set setprotoent d_setpent
16456 : see if setpgid exists
16457 set setpgid d_setpgid
16460 : see if setpgrp2 exists
16461 set setpgrp2 d_setpgrp2
16464 : see if setpriority exists
16465 set setpriority d_setprior
16468 : see if setproctitle exists
16469 set setproctitle d_setproctitle
16472 : see if setprotoent_r exists
16473 set setprotoent_r d_setprotoent_r
16475 case "$d_setprotoent_r" in
16477 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16478 case "$d_setprotoent_r_proto:$usethreads" in
16479 ":define") d_setprotoent_r_proto=define
16480 set d_setprotoent_r_proto setprotoent_r $hdrs
16484 case "$d_setprotoent_r_proto" in
16486 case "$setprotoent_r_proto" in
16487 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
16488 ./protochk "extern $try" $hdrs && setprotoent_r_proto=I_ID ;;
16490 case "$setprotoent_r_proto" in
16491 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
16492 ./protochk "extern $try" $hdrs && setprotoent_r_proto=V_ID ;;
16494 case "$setprotoent_r_proto" in
16495 ''|0) d_setprotoent_r=undef
16496 setprotoent_r_proto=0
16497 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
16498 * ) case "$setprotoent_r_proto" in
16499 REENTRANT_PROTO*) ;;
16500 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
16502 echo "Prototype: $try" ;;
16505 *) case "$usethreads" in
16506 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
16508 d_setprotoent_r=undef
16509 setprotoent_r_proto=0
16513 *) setprotoent_r_proto=0
16517 : see if setpwent exists
16518 set setpwent d_setpwent
16521 : see if setpwent_r exists
16522 set setpwent_r d_setpwent_r
16524 case "$d_setpwent_r" in
16526 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
16527 case "$d_setpwent_r_proto:$usethreads" in
16528 ":define") d_setpwent_r_proto=define
16529 set d_setpwent_r_proto setpwent_r $hdrs
16533 case "$d_setpwent_r_proto" in
16535 case "$setpwent_r_proto" in
16536 ''|0) try='int setpwent_r(FILE**);'
16537 ./protochk "extern $try" $hdrs && setpwent_r_proto=I_H ;;
16539 case "$setpwent_r_proto" in
16540 ''|0) try='void setpwent_r(FILE**);'
16541 ./protochk "extern $try" $hdrs && setpwent_r_proto=V_H ;;
16543 case "$setpwent_r_proto" in
16544 ''|0) d_setpwent_r=undef
16546 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
16547 * ) case "$setpwent_r_proto" in
16548 REENTRANT_PROTO*) ;;
16549 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
16551 echo "Prototype: $try" ;;
16554 *) case "$usethreads" in
16555 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
16562 *) setpwent_r_proto=0
16566 : see if setregid exists
16567 set setregid d_setregid
16569 set setresgid d_setresgid
16572 : see if setreuid exists
16573 set setreuid d_setreuid
16575 set setresuid d_setresuid
16578 : see if setrgid exists
16579 set setrgid d_setrgid
16582 : see if setruid exists
16583 set setruid d_setruid
16586 : see if setservent exists
16587 set setservent d_setsent
16590 : see if setservent_r exists
16591 set setservent_r d_setservent_r
16593 case "$d_setservent_r" in
16595 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16596 case "$d_setservent_r_proto:$usethreads" in
16597 ":define") d_setservent_r_proto=define
16598 set d_setservent_r_proto setservent_r $hdrs
16602 case "$d_setservent_r_proto" in
16604 case "$setservent_r_proto" in
16605 ''|0) try='int setservent_r(int, struct servent_data*);'
16606 ./protochk "extern $try" $hdrs && setservent_r_proto=I_ID ;;
16608 case "$setservent_r_proto" in
16609 ''|0) try='void setservent_r(int, struct servent_data*);'
16610 ./protochk "extern $try" $hdrs && setservent_r_proto=V_ID ;;
16612 case "$setservent_r_proto" in
16613 ''|0) d_setservent_r=undef
16614 setservent_r_proto=0
16615 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
16616 * ) case "$setservent_r_proto" in
16617 REENTRANT_PROTO*) ;;
16618 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
16620 echo "Prototype: $try" ;;
16623 *) case "$usethreads" in
16624 define) echo "setservent_r has no prototype, not using it." >&4 ;;
16626 d_setservent_r=undef
16627 setservent_r_proto=0
16631 *) setservent_r_proto=0
16635 : see if setsid exists
16636 set setsid d_setsid
16639 : see if setvbuf exists
16640 set setvbuf d_setvbuf
16643 : see if sfio.h is available
16648 : see if sfio library is available
16659 : Ok, but do we want to use it.
16663 true|$define|[yY]*) dflt='y';;
16666 echo "$package can use the sfio library, but it is experimental."
16667 case "$useperlio" in
16669 echo "For sfio also the PerlIO abstraction layer is needed."
16670 echo "Earlier you said you wouldn't want that."
16673 rp="You seem to have sfio available, do you want to try using it?"
16676 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
16677 useperlio="$define"
16680 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
16685 *) case "$usesfio" in
16686 true|$define|[yY]*)
16687 echo "Sorry, cannot find sfio on this machine." >&4
16688 echo "Ignoring your setting of usesfio=$usesfio." >&4
16697 $define) usesfio='true';;
16698 *) usesfio='false';;
16702 *) : Remove sfio from list of libraries to use
16705 echo "Removing unneeded -lsfio from library list" >&4
16706 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
16709 echo "libs = $libs" >&4
16716 : see if shmctl exists
16717 set shmctl d_shmctl
16720 : see if shmget exists
16721 set shmget d_shmget
16724 : see if shmat exists
16727 : see what shmat returns
16730 $cat >shmat.c <<'END'
16731 #include <sys/shm.h>
16734 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
16739 echo "and it returns ($shmattype)." >&4
16740 : see if a prototype for shmat is available
16741 xxx=`./findhdr sys/shm.h`
16742 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
16743 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
16754 set d_shmatprototype
16757 : see if shmdt exists
16761 : see how much of the 'shm*(2)' library is present.
16764 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
16765 *"$undef"*) h_shm=false;;
16769 case "`ipcs 2>&1`" in
16770 "SVID shared memory"*"not configured"*)
16771 echo "Your $osname does not have the shm*(2) configured." >&4
16774 set shmctl d_shmctl
16776 set shmget d_shmget
16786 : we could also check for sys/ipc.h ...
16787 if $h_shm && $test `./findhdr sys/shm.h`; then
16788 echo "You have the full shm*(2) library." >&4
16791 echo "You don't have the full shm*(2) library." >&4
16798 : see if we have sigaction
16799 if set sigaction val -f d_sigaction; eval $csym; $val; then
16800 echo 'sigaction() found.' >&4
16803 #include <sys/types.h>
16804 #include <signal.h>
16805 #$i_stdlib I_STDLIB
16807 #include <stdlib.h>
16811 struct sigaction act, oact;
16813 oact.sa_handler = 0;
16814 /* so that act and oact are used */
16815 exit(act.sa_flags == 0 && oact.sa_handler == 0);
16819 if eval $compile_ok; then
16822 echo "But you don't seem to have a useable struct sigaction." >&4
16826 echo 'sigaction NOT found.' >&4
16829 set d_sigaction; eval $setvar
16830 $rm -f try try$_o try.c
16832 : see if sigprocmask exists
16833 set sigprocmask d_sigprocmask
16836 : see if sigsetjmp exists
16838 case "$d_sigsetjmp" in
16841 #include <setjmp.h>
16842 #$i_stdlib I_STDLIB
16844 #include <stdlib.h>
16850 if (sigsetjmp(env,1))
16853 siglongjmp(env, 1);
16858 if eval $compile; then
16859 if $run ./try >/dev/null 2>&1; then
16860 echo "POSIX sigsetjmp found." >&4
16864 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
16870 echo "sigsetjmp not found." >&4
16874 *) val="$d_sigsetjmp"
16875 case "$d_sigsetjmp" in
16876 $define) echo "POSIX sigsetjmp found." >&4;;
16877 $undef) echo "sigsetjmp not found." >&4;;
16885 : see if snprintf exists
16886 set snprintf d_snprintf
16889 : see if vsnprintf exists
16890 set vsnprintf d_vsnprintf
16893 case "$d_snprintf-$d_vsnprintf" in
16896 Checking whether your snprintf() and vsnprintf() work okay...
16898 $cat >try.c <<'EOCP'
16899 /* v?snprintf testing logic courtesy of Russ Allbery.
16900 * According to C99:
16901 * - if the buffer is too short it still must be \0-terminated
16902 * - if the buffer is too short the potentially required length
16903 * must be returned and not -1
16904 * - if the buffer is NULL the potentially required length
16905 * must be returned and not -1 or core dump
16908 #include <stdarg.h>
16912 int test (char *format, ...)
16917 va_start (args, format);
16918 count = vsnprintf (buf, sizeof buf, format, args);
16925 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
16926 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
16930 if eval $compile; then
16933 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
16935 Your snprintf() and snprintf() don't seem to be working okay.
16937 d_snprintf="$undef"
16938 d_vsnprintf="$undef"
16942 echo "(I can't seem to compile the test program--assuming they don't)"
16943 d_snprintf="$undef"
16944 d_vsnprintf="$undef"
16946 $rm -f try.* try core core.try.*
16950 : see if sockatmark exists
16951 set sockatmark d_sockatmark
16954 : see if prototype for sockatmark is available
16956 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
16959 : see if socks5_init exists
16960 set socks5_init d_socks5_init
16963 : see if sprintf returns the length of the string in the buffer as per ANSI
16964 $echo "Checking whether sprintf returns the length of the string..." >&4
16967 #$i_stdlib I_STDLIB
16969 #include <stdlib.h>
16971 #$i_string I_STRING
16973 # include <string.h>
16975 # include <strings.h>
16984 int check (size_t expect, int test) {
16985 size_t got = strlen(buffer);
16989 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
16994 int main(int argc, char **argv) {
16997 check(sprintf(buffer, ""), ++test);
16998 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
16999 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
17006 d_sprintf_returns_strlen="$undef"
17007 if eval $compile; then
17011 sprintf returns the length of the string (as ANSI says it should)
17013 d_sprintf_returns_strlen="$define"
17016 sprintf does not return the length of the string (how old is this system?)
17018 d_sprintf_returns_strlen="$undef"
17025 : see if srand48_r exists
17026 set srand48_r d_srand48_r
17028 case "$d_srand48_r" in
17030 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17031 case "$d_srand48_r_proto:$usethreads" in
17032 ":define") d_srand48_r_proto=define
17033 set d_srand48_r_proto srand48_r $hdrs
17037 case "$d_srand48_r_proto" in
17039 case "$srand48_r_proto" in
17040 ''|0) try='int srand48_r(long, struct drand48_data*);'
17041 ./protochk "extern $try" $hdrs && srand48_r_proto=I_LS ;;
17043 case "$srand48_r_proto" in
17044 ''|0) d_srand48_r=undef
17046 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
17047 * ) case "$srand48_r_proto" in
17048 REENTRANT_PROTO*) ;;
17049 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
17051 echo "Prototype: $try" ;;
17054 *) case "$usethreads" in
17055 define) echo "srand48_r has no prototype, not using it." >&4 ;;
17062 *) srand48_r_proto=0
17066 : see if srandom_r exists
17067 set srandom_r d_srandom_r
17069 case "$d_srandom_r" in
17071 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17072 case "$d_srandom_r_proto:$usethreads" in
17073 ":define") d_srandom_r_proto=define
17074 set d_srandom_r_proto srandom_r $hdrs
17078 case "$d_srandom_r_proto" in
17080 case "$srandom_r_proto" in
17081 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
17082 ./protochk "extern $try" $hdrs && srandom_r_proto=I_TS ;;
17084 case "$srandom_r_proto" in
17085 ''|0) d_srandom_r=undef
17087 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
17088 * ) case "$srandom_r_proto" in
17089 REENTRANT_PROTO*) ;;
17090 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
17092 echo "Prototype: $try" ;;
17095 *) case "$usethreads" in
17096 define) echo "srandom_r has no prototype, not using it." >&4 ;;
17103 *) srandom_r_proto=0
17107 : see if prototype for setresgid is available
17109 set d_sresgproto setresgid $i_unistd unistd.h
17112 : see if prototype for setresuid is available
17114 set d_sresuproto setresuid $i_unistd unistd.h
17117 : see if sys/stat.h is available
17118 set sys/stat.h i_sysstat
17122 : see if stat knows about block sizes
17124 echo "Checking to see if your struct stat has st_blocks field..." >&4
17125 set d_statblks stat st_blocks $i_sysstat sys/stat.h
17129 : see if this is a sys/vfs.h system
17130 set sys/vfs.h i_sysvfs
17134 : see if this is a sys/statfs.h system
17135 set sys/statfs.h i_sysstatfs
17140 echo "Checking to see if your system supports struct statfs..." >&4
17141 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
17143 case "$d_statfs_s" in
17144 "$define") echo "Yes, it does." ;;
17145 *) echo "No, it doesn't." ;;
17150 : see if struct statfs knows about f_flags
17151 case "$d_statfs_s" in
17154 echo "Checking to see if your struct statfs has f_flags field..." >&4
17155 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
17159 set d_statfs_f_flags
17163 case "$d_statfs_f_flags" in
17164 "$define") echo "Yes, it does." ;;
17165 *) echo "No, it doesn't." ;;
17169 Checking how to access stdio streams by file descriptor number...
17171 case "$stdio_stream_array" in
17172 '') $cat >try.c <<EOCP
17175 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
17179 for s in _iob __iob __sF
17181 set try -DSTDIO_STREAM_ARRAY=$s
17182 if eval $compile; then
17183 case "`$run ./try`" in
17184 yes) stdio_stream_array=$s; break ;;
17188 $rm -f try.* try$exe_ext
17190 case "$stdio_stream_array" in
17192 I can't figure out how to access stdio streams by file descriptor number.
17194 d_stdio_stream_array="$undef"
17197 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
17199 d_stdio_stream_array="$define"
17203 : see if strcoll exists
17204 set strcoll d_strcoll
17207 : check for structure copying
17209 echo "Checking to see if your C compiler can copy structs..." >&4
17210 $cat >try.c <<'EOCP'
17220 if $cc -c try.c >/dev/null 2>&1 ; then
17222 echo "Yup, it can."
17225 echo "Nope, it can't."
17231 : see if strerror and/or sys_errlist[] exist
17233 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
17234 if set strerror val -f d_strerror; eval $csym; $val; then
17235 echo 'strerror() found.' >&4
17236 d_strerror="$define"
17237 d_strerrm='strerror(e)'
17238 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17239 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
17240 d_syserrlst="$define"
17242 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
17243 d_syserrlst="$undef"
17245 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
17246 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
17247 echo 'strerror() found in string header.' >&4
17248 d_strerror="$define"
17249 d_strerrm='strerror(e)'
17250 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17251 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
17252 d_syserrlst="$define"
17254 echo "(You don't appear to have any sys_errlist[], how can this be?)"
17255 d_syserrlst="$undef"
17257 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17258 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
17259 d_strerror="$undef"
17260 d_syserrlst="$define"
17261 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
17263 echo 'strerror() and sys_errlist[] NOT found.' >&4
17264 d_strerror="$undef"
17265 d_syserrlst="$undef"
17266 d_strerrm='"unknown"'
17270 : see if strerror_r exists
17271 set strerror_r d_strerror_r
17273 case "$d_strerror_r" in
17275 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
17276 case "$d_strerror_r_proto:$usethreads" in
17277 ":define") d_strerror_r_proto=define
17278 set d_strerror_r_proto strerror_r $hdrs
17282 case "$d_strerror_r_proto" in
17284 case "$strerror_r_proto" in
17285 ''|0) try='int strerror_r(int, char*, size_t);'
17286 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBW ;;
17288 case "$strerror_r_proto" in
17289 ''|0) try='int strerror_r(int, char*, int);'
17290 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBI ;;
17292 case "$strerror_r_proto" in
17293 ''|0) try='char* strerror_r(int, char*, size_t);'
17294 ./protochk "extern $try" $hdrs && strerror_r_proto=B_IBW ;;
17296 case "$strerror_r_proto" in
17297 ''|0) d_strerror_r=undef
17299 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
17300 * ) case "$strerror_r_proto" in
17301 REENTRANT_PROTO*) ;;
17302 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
17304 echo "Prototype: $try" ;;
17307 *) case "$usethreads" in
17308 define) echo "strerror_r has no prototype, not using it." >&4 ;;
17315 *) strerror_r_proto=0
17319 : see if strftime exists
17320 set strftime d_strftime
17323 : see if strlcat exists
17324 set strlcat d_strlcat
17327 : see if strlcpy exists
17328 set strlcpy d_strlcpy
17331 : see if strtod exists
17332 set strtod d_strtod
17335 : see if strtol exists
17336 set strtol d_strtol
17339 : see if strtold exists
17340 set strtold d_strtold
17343 : see if strtoll exists
17344 set strtoll d_strtoll
17347 case "$d_longlong-$d_strtoll" in
17350 Checking whether your strtoll() works okay...
17352 $cat >try.c <<'EOCP'
17355 #define strtoll __strtoll
17358 #define strtoll _strtoll
17361 extern long long int strtoll(char *s, char **, int);
17362 static int bad = 0;
17363 int check(char *s, long long ell, int een) {
17366 gll = strtoll(s, 0, 10);
17367 if (!((gll == ell) && (errno == een)))
17371 check(" 1", 1LL, 0);
17372 check(" 0", 0LL, 0);
17373 check("-1", -1LL, 0);
17374 check("-9223372036854775808", -9223372036854775808LL, 0);
17375 check("-9223372036854775808", -9223372036854775808LL, 0);
17376 check(" 9223372036854775807", 9223372036854775807LL, 0);
17377 check("-9223372036854775808", -9223372036854775808LL, 0);
17378 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
17379 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
17385 if eval $compile; then
17388 ok) echo "Your strtoll() seems to be working okay." ;;
17390 Your strtoll() doesn't seem to be working okay.
17396 echo "(I can't seem to compile the test program--assuming it doesn't)"
17402 : see if strtoq exists
17403 set strtoq d_strtoq
17406 : see if strtoul exists
17407 set strtoul d_strtoul
17410 case "$d_strtoul" in
17413 Checking whether your strtoul() works okay...
17415 $cat >try.c <<'EOCP'
17418 extern unsigned long int strtoul(char *s, char **, int);
17419 static int bad = 0;
17420 void check(char *s, unsigned long eul, int een) {
17423 gul = strtoul(s, 0, 10);
17424 if (!((gul == eul) && (errno == een)))
17428 check(" 1", 1L, 0);
17429 check(" 0", 0L, 0);
17431 case "$longsize" in
17433 $cat >>try.c <<'EOCP'
17434 check("18446744073709551615", 18446744073709551615UL, 0);
17435 check("18446744073709551616", 18446744073709551615UL, ERANGE);
17436 #if 0 /* strtoul() for /^-/ strings is undefined. */
17437 check("-1", 18446744073709551615UL, 0);
17438 check("-18446744073709551614", 2, 0);
17439 check("-18446744073709551615", 1, 0);
17440 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
17441 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
17446 $cat >>try.c <<'EOCP'
17447 check("4294967295", 4294967295UL, 0);
17448 check("4294967296", 4294967295UL, ERANGE);
17449 #if 0 /* strtoul() for /^-/ strings is undefined. */
17450 check("-1", 4294967295UL, 0);
17451 check("-4294967294", 2, 0);
17452 check("-4294967295", 1, 0);
17453 check("-4294967296", 4294967295UL, ERANGE);
17454 check("-4294967297", 4294967295UL, ERANGE);
17459 : Should we write these tests to be more portable by sprintf-ing
17460 : ~0 and then manipulating that char string as input for strtol?
17463 $cat >>try.c <<'EOCP'
17470 if eval $compile; then
17471 case "`$run ./try`" in
17472 ok) echo "Your strtoul() seems to be working okay." ;;
17474 Your strtoul() doesn't seem to be working okay.
17483 : see if strtoull exists
17484 set strtoull d_strtoull
17487 case "$d_longlong-$d_strtoull" in
17490 Checking whether your strtoull() works okay...
17492 $cat >try.c <<'EOCP'
17495 #define strtoull __strtoull
17498 extern unsigned long long int strtoull(char *s, char **, int);
17499 static int bad = 0;
17500 int check(char *s, long long eull, int een) {
17503 gull = strtoull(s, 0, 10);
17504 if (!((gull == eull) && (errno == een)))
17508 check(" 1", 1LL, 0);
17509 check(" 0", 0LL, 0);
17510 check("18446744073709551615", 18446744073709551615ULL, 0);
17511 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17512 #if 0 /* strtoull() for /^-/ strings is undefined. */
17513 check("-1", 18446744073709551615ULL, 0);
17514 check("-18446744073709551614", 2LL, 0);
17515 check("-18446744073709551615", 1LL, 0);
17516 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17517 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17524 if eval $compile; then
17525 case "`$run ./try`" in
17526 ok) echo "Your strtoull() seems to be working okay." ;;
17528 Your strtoull() doesn't seem to be working okay.
17530 d_strtoull="$undef"
17537 : see if strtouq exists
17538 set strtouq d_strtouq
17541 case "$d_strtouq" in
17544 Checking whether your strtouq() works okay...
17546 $cat >try.c <<'EOCP'
17549 extern unsigned long long int strtouq(char *s, char **, int);
17550 static int bad = 0;
17551 void check(char *s, unsigned long long eull, int een) {
17552 unsigned long long gull;
17554 gull = strtouq(s, 0, 10);
17555 if (!((gull == eull) && (errno == een)))
17559 check(" 1", 1LL, 0);
17560 check(" 0", 0LL, 0);
17561 check("18446744073709551615", 18446744073709551615ULL, 0);
17562 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17563 #if 0 /* strtouq() for /^-/ strings is undefined. */
17564 check("-1", 18446744073709551615ULL, 0);
17565 check("-18446744073709551614", 2LL, 0);
17566 check("-18446744073709551615", 1LL, 0);
17567 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17568 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17576 if eval $compile; then
17577 case "`$run ./try`" in
17578 ok) echo "Your strtouq() seems to be working okay." ;;
17580 Your strtouq() doesn't seem to be working okay.
17589 : see if strxfrm exists
17590 set strxfrm d_strxfrm
17593 : see if symlink exists
17594 set symlink d_symlink
17597 : see if syscall exists
17598 set syscall d_syscall
17601 : see if prototype for syscall is available
17603 set d_syscallproto syscall $i_unistd unistd.h
17606 : see if sysconf exists
17607 set sysconf d_sysconf
17610 : see if system exists
17611 set system d_system
17614 : see if tcgetpgrp exists
17615 set tcgetpgrp d_tcgetpgrp
17618 : see if tcsetpgrp exists
17619 set tcsetpgrp d_tcsetpgrp
17622 : see if prototype for telldir is available
17624 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
17627 : see if time exists
17629 if test "X$d_time" = X -o X"$timetype" = X; then
17630 if set time val -f d_time; eval $csym; $val; then
17631 echo 'time() found.' >&4
17633 rp="What is the type returned by time() on this system?"
17634 set time_t timetype long stdio.h sys/types.h
17637 echo 'time() not found, hope that will do.' >&4
17645 : see if this is a sys/times.h system
17646 set sys/times.h i_systimes
17649 : see if times exists
17651 if set times val -f d_times; eval $csym; $val; then
17652 echo 'times() found.' >&4
17655 case "$i_systimes" in
17656 "$define") inc='sys/times.h';;
17658 rp="What is the type returned by times() on this system?"
17659 set clock_t clocktype long stdio.h sys/types.h $inc
17662 echo 'times() NOT found, hope that will do.' >&4
17667 : see if tmpnam_r exists
17668 set tmpnam_r d_tmpnam_r
17670 case "$d_tmpnam_r" in
17672 hdrs="$i_systypes sys/types.h define stdio.h "
17673 case "$d_tmpnam_r_proto:$usethreads" in
17674 ":define") d_tmpnam_r_proto=define
17675 set d_tmpnam_r_proto tmpnam_r $hdrs
17679 case "$d_tmpnam_r_proto" in
17681 case "$tmpnam_r_proto" in
17682 ''|0) try='char* tmpnam_r(char*);'
17683 ./protochk "extern $try" $hdrs && tmpnam_r_proto=B_B ;;
17685 case "$tmpnam_r_proto" in
17686 ''|0) d_tmpnam_r=undef
17688 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
17689 * ) case "$tmpnam_r_proto" in
17690 REENTRANT_PROTO*) ;;
17691 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
17693 echo "Prototype: $try" ;;
17696 *) case "$usethreads" in
17697 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
17704 *) tmpnam_r_proto=0
17708 : see if truncate exists
17709 set truncate d_truncate
17712 : see if ttyname_r exists
17713 set ttyname_r d_ttyname_r
17715 case "$d_ttyname_r" in
17717 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
17718 case "$d_ttyname_r_proto:$usethreads" in
17719 ":define") d_ttyname_r_proto=define
17720 set d_ttyname_r_proto ttyname_r $hdrs
17724 case "$d_ttyname_r_proto" in
17726 case "$ttyname_r_proto" in
17727 ''|0) try='int ttyname_r(int, char*, size_t);'
17728 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBW ;;
17730 case "$ttyname_r_proto" in
17731 ''|0) try='int ttyname_r(int, char*, int);'
17732 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBI ;;
17734 case "$ttyname_r_proto" in
17735 ''|0) try='char* ttyname_r(int, char*, int);'
17736 ./protochk "extern $try" $hdrs && ttyname_r_proto=B_IBI ;;
17738 case "$ttyname_r_proto" in
17739 ''|0) d_ttyname_r=undef
17741 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
17742 * ) case "$ttyname_r_proto" in
17743 REENTRANT_PROTO*) ;;
17744 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
17746 echo "Prototype: $try" ;;
17749 *) case "$usethreads" in
17750 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
17757 *) ttyname_r_proto=0
17761 : see if tzname[] exists
17763 if set tzname val -a d_tzname; eval $csym; $val; then
17765 echo 'tzname[] found.' >&4
17768 echo 'tzname[] NOT found.' >&4
17774 next|rhapsody|darwin) multiarch="$define" ;;
17776 case "$multiarch" in
17777 ''|[nN]*) multiarch="$undef" ;;
17780 : check for ordering of bytes in a UV
17782 case "$usecrosscompile$multiarch" in
17785 You seem to be either cross-compiling or doing a multiarchitecture build,
17786 skipping the byteorder check.
17792 case "$byteorder" in
17795 In the following, larger digits indicate more significance. A big-endian
17796 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
17797 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
17798 machines may have weird orders like 3412. A Cray will report 87654321,
17799 an Alpha will report 12345678. If the test program works the default is
17801 I'm now running the test program...
17805 #$i_stdlib I_STDLIB
17807 #include <stdlib.h>
17809 #include <sys/types.h>
17810 typedef $uvtype UV;
17820 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
17822 u.l = (UV)0x04030201;
17823 for (i = 0; i < $uvsize; i++)
17824 printf("%c", u.c[i]+'0');
17831 if eval $compile && ./try > /dev/null; then
17834 [1-4][1-4][1-4][1-4]|12345678|87654321)
17835 echo "(The test program ran ok.)"
17836 echo "byteorder=$dflt"
17839 ????|????????) echo "(The test program ran ok.)" ;;
17840 *) echo "(The test program didn't run right for some reason.)" ;;
17845 (I can't seem to compile the test program. Guessing big-endian...)
17848 case "$xxx_prompt" in
17850 rp="What is the order of bytes in $uvtype?"
17866 Checking to see whether you can access character data unalignedly...
17868 case "$d_u32align" in
17869 '') $cat >try.c <<EOCP
17871 #$i_stdlib I_STDLIB
17873 #include <stdlib.h>
17875 #define U32 $u32type
17876 #define BYTEORDER 0x$byteorder
17878 #include <signal.h>
17880 $signal_t bletch(int s) { exit(4); }
17883 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
17888 if (sizeof(U32) != 4) {
17889 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
17896 signal(SIGBUS, bletch);
17908 for (i = 0; i < 4; i++) {
17909 up = (U32*)(buf + i);
17910 if (! ((*up == 1 << (8*i)) || /* big-endian */
17911 (*up == 1 << (8*(3-i))) /* little-endian */
17915 printf("read failed (%x)\n", *up);
17921 for (i = 0; i < 4; i++) {
17922 up = (U32*)(buf + i);
17924 if (*up != 0xBeef) {
17925 printf("write failed (%x)\n", *up);
17939 if eval $compile_ok; then
17940 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
17941 $run ./try 2>&1 >/dev/null
17944 You can access character data pretty unalignedly.
17946 d_u32align="$undef"
17949 It seems that you must access character data in an aligned manner.
17951 d_u32align="$define"
17955 rp='Can you access character data at unaligned addresses?'
17959 [yY]*) d_u32align="$undef" ;;
17960 *) d_u32align="$define" ;;
17963 $rm -f core core.try.* try.core
17967 : see if ualarm exists
17968 set ualarm d_ualarm
17971 : see if umask exists
17975 : see if unordered exists
17976 set unordered d_unordered
17979 : see if unsetenv exists
17980 set unsetenv d_unsetenv
17983 : see if usleep exists
17984 set usleep d_usleep
17987 : see if prototype for usleep is available
17989 set d_usleepproto usleep $i_unistd unistd.h
17992 : see if ustat exists
17996 : backward compatibility for d_hvfork
17997 if test X$d_hvfork != X; then
17998 d_vfork="$d_hvfork"
18001 : see if there is a vfork
18006 : Ok, but do we want to use it. vfork is reportedly unreliable in
18007 : perl on Solaris 2.x, and probably elsewhere.
18011 case "$usevfork" in
18017 Perl can only use a vfork() that doesn't suffer from strict
18018 restrictions on calling functions or modifying global data in
18019 the child. For example, glibc-2.1 contains such a vfork()
18020 that is unsuitable. If your system provides a proper fork()
18021 call, chances are that you do NOT want perl to use vfork().
18024 rp="Do you still want to use vfork()?"
18029 echo "Ok, we won't use vfork()."
18038 $define) usevfork='true';;
18039 *) usevfork='false';;
18042 : see if closedir exists
18043 set closedir d_closedir
18046 case "$d_closedir" in
18049 echo "Checking whether closedir() returns a status..." >&4
18051 #$i_dirent I_DIRENT /**/
18052 #$i_sysdir I_SYS_DIR /**/
18053 #$i_sysndir I_SYS_NDIR /**/
18054 #$i_systypes I_SYS_TYPES /**/
18056 #if defined(I_SYS_TYPES)
18057 #include <sys/types.h>
18059 #if defined(I_DIRENT)
18060 #include <dirent.h>
18061 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
18062 #include <sys/dir.h>
18066 #include <sys/ndir.h>
18070 #include <ndir.h> /* may be wrong in the future */
18072 #include <sys/dir.h>
18077 int main() { return closedir(opendir(".")); }
18080 if eval $compile_ok; then
18081 if $run ./try > /dev/null 2>&1 ; then
18082 echo "Yes, it does."
18085 echo "No, it doesn't."
18089 echo "(I can't seem to compile the test program--assuming it doesn't)"
18097 set d_void_closedir
18100 : see if there is a wait4
18104 : see if waitpid exists
18105 set waitpid d_waitpid
18108 : see if wcstombs exists
18109 set wcstombs d_wcstombs
18112 : see if wctomb exists
18113 set wctomb d_wctomb
18116 : see if writev exists
18117 set writev d_writev
18120 : preserve RCS keywords in files with variable substitution, grrr
18125 Revision='$Revision'
18127 : check for alignment requirements
18129 case "$usecrosscompile$multiarch" in
18132 You seem to be either cross-compiling or doing a multiarchitecture build,
18133 skipping the memory alignment check.
18136 case "$alignbytes" in
18137 '') alignbytes=8 ;;
18141 case "$alignbytes" in
18142 '') echo "Checking alignment constraints..." >&4
18143 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
18144 $cat >try.c <<'EOCP'
18145 typedef long double NV;
18148 $cat >try.c <<'EOCP'
18152 $cat >>try.c <<'EOCP'
18160 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
18165 if eval $compile_ok; then
18169 echo "(I can't seem to compile the test program...)"
18172 *) dflt="$alignbytes"
18175 rp="Doubles must be aligned on a how-many-byte boundary?"
18183 : set the base revision
18186 : how do we concatenate cpp tokens here?
18188 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
18189 $cat >cpp_stuff.c <<'EOCP'
18190 #define RCAT(a,b)a/**/b
18191 #define ACAT(a,b)a ## b
18195 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
18196 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
18197 echo "Oh! Smells like ANSI's been here." >&4
18198 echo "We can catify or stringify, separately or together!"
18200 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
18201 echo "Ah, yes! The good old days!" >&4
18202 echo "However, in the good old days we don't know how to stringify and"
18203 echo "catify at the same time."
18207 Hmm, I don't seem to be able to concatenate tokens with your cpp.
18208 You're going to have to edit the values of CAT[2-5] in config.h...
18210 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
18214 : see if this is a db.h system
18220 : Check db version.
18222 echo "Checking Berkeley DB version ..." >&4
18228 #include <sys/types.h>
18230 #$i_stdlib I_STDLIB
18232 #include <stdlib.h>
18235 int main(int argc, char *argv[])
18237 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
18238 int Major, Minor, Patch ;
18239 unsigned long Version ;
18240 (void)db_version(&Major, &Minor, &Patch) ;
18242 printf("%d %d %d %d %d %d\n",
18243 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
18244 Major, Minor, Patch);
18247 printf("You have Berkeley DB Version 2 or greater.\n");
18249 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
18250 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
18251 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
18252 Major, Minor, Patch) ;
18254 /* check that db.h & libdb are compatible */
18255 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
18256 printf("db.h and libdb are incompatible.\n") ;
18260 printf("db.h and libdb are compatible.\n") ;
18262 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
18263 + DB_VERSION_PATCH ;
18265 /* needs to be >= 2.3.4 */
18266 if (Version < 2003004) {
18267 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
18268 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
18274 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
18279 printf("You have Berkeley DB Version 1.\n");
18280 exit(0); /* DB version < 2: the coast is clear. */
18282 exit(1); /* <db.h> not Berkeley DB? */
18288 if eval $compile_ok && $run ./try; then
18289 echo 'Looks OK.' >&4
18291 db_version_major=$1
18292 db_version_minor=$2
18293 db_version_patch=$3
18295 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
18299 : Remove db from list of libraries to use
18300 echo "Removing unusable -ldb from library list" >&4
18301 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
18304 echo "libs = $libs" >&4
18314 : Check the return type needed for hash
18316 echo "Checking return type needed for hash for Berkeley DB ..." >&4
18322 #include <sys/types.h>
18325 #ifndef DB_VERSION_MAJOR
18326 u_int32_t hash_cb (ptr, size)
18334 info.hash = hash_cb;
18338 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18339 if $contains warning try.out >>/dev/null 2>&1 ; then
18342 db_hashtype='u_int32_t'
18345 : XXX Maybe we should just give up here.
18346 db_hashtype=u_int32_t
18348 echo "Help: I can't seem to compile the db test program." >&4
18349 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
18352 echo "Your version of Berkeley DB uses $db_hashtype for hash."
18354 *) db_hashtype=u_int32_t
18359 : Check the return type needed for prefix
18361 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
18367 #include <sys/types.h>
18370 #ifndef DB_VERSION_MAJOR
18371 size_t prefix_cb (key1, key2)
18379 info.prefix = prefix_cb;
18383 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18384 if $contains warning try.out >>/dev/null 2>&1 ; then
18385 db_prefixtype='int'
18387 db_prefixtype='size_t'
18390 db_prefixtype='size_t'
18391 : XXX Maybe we should just give up here.
18393 echo "Help: I can't seem to compile the db test program." >&4
18394 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
18397 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
18399 *) db_prefixtype='size_t'
18404 : How can we generate normalized random numbers ?
18406 echo "Looking for a random number function..." >&4
18407 case "$randfunc" in
18409 if set drand48 val -f; eval $csym; $val; then
18411 echo "Good, found drand48()." >&4
18412 elif set random val -f; eval $csym; $val; then
18414 echo "OK, found random()." >&4
18417 echo "Yick, looks like I have to use rand()." >&4
18428 *-Dmy_rand=*|*-Dmy_srand=*)
18429 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
18430 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
18431 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
18432 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
18436 while $test "$cont"; do
18437 rp="Use which function to generate random numbers?"
18439 if $test "$ans" = "$dflt"; then
18445 if set $ans val -f; eval $csym; $val; then
18449 rp="I cannot find function $ans. Use that name anyway?"
18458 case "$randfunc" in
18460 drand01="drand48()"
18466 case "$randbits" in
18468 echo "Checking to see how many bits your $randfunc() function produces..." >&4
18470 #$i_unistd I_UNISTD
18471 #$i_stdlib I_STDLIB
18474 # include <unistd.h>
18477 # include <stdlib.h>
18482 register unsigned long tmp;
18483 register unsigned long max = 0L;
18485 for (i = 1000; i; i--) {
18486 tmp = (unsigned long) $randfunc();
18487 if (tmp > max) max = tmp;
18489 for (i = 0; max; i++)
18495 if eval $compile_ok; then
18499 echo "(I can't seem to compile the test program...)"
18506 rp="How many bits does your $randfunc() function produce?"
18510 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18511 seedfunc="s$randfunc"
18512 randseedtype=unsigned
18516 rp="How many bits does your $randfunc() function produce?"
18519 seedfunc="s$randfunc"
18520 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18521 if set $seedfunc val -f; eval $csym; $val; then
18522 echo "(Using $seedfunc() to seed random generator)"
18524 echo "(Warning: no $seedfunc() to seed random generator)"
18527 randseedtype=unsigned
18535 echo "Determining whether or not we are on an EBCDIC system..." >&4
18536 $cat >try.c <<'EOM'
18539 if ('M'==0xd4) return 0;
18546 if eval $compile_ok; then
18547 if $run ./try; then
18548 echo "You seem to speak EBCDIC." >&4
18551 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
18554 echo "I'm unable to compile the test program." >&4
18555 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
18563 Checking how to flush all pending stdio output...
18565 # I only know how to find the first 32 possibly open files on SunOS.
18566 # See also hints/sunos_4_1.sh and util.c --AD
18568 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
18570 $cat >>try.c <<EOCP
18572 #$i_stdlib I_STDLIB
18574 #include <stdlib.h>
18576 #$i_unistd I_UNISTD
18578 # include <unistd.h>
18580 #$d_sysconf HAS_SYSCONF
18581 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
18582 #ifdef HAS_STDIO_STREAM_ARRAY
18583 # define STDIO_STREAM_ARRAY $stdio_stream_array
18588 p = fopen("try.out", "w");
18592 # ifdef TRY_FPRINTF
18596 #ifdef TRY_FFLUSH_NULL
18599 #ifdef TRY_FFLUSH_ALL
18601 long open_max = -1;
18602 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
18603 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
18605 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
18606 open_max = sysconf(_SC_OPEN_MAX);
18609 open_max = FOPEN_MAX;
18612 open_max = OPEN_MAX;
18621 # ifdef HAS_STDIO_STREAM_ARRAY
18622 if (open_max > 0) {
18624 for (i = 0; i < open_max; i++)
18625 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
18626 STDIO_STREAM_ARRAY[i]._file < open_max &&
18627 STDIO_STREAM_ARRAY[i]._flag)
18628 fflush(&STDIO_STREAM_ARRAY[i]);
18636 : first we have to find out how _not_ to flush
18638 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
18640 set try -DTRY_FPUTC
18641 if eval $compile; then
18642 $run ./try 2>/dev/null
18645 if $test ! -s try.out -a "X$code" = X42; then
18651 set try -DTRY_FPRINTF
18652 if eval $compile; then
18653 $run ./try 2>/dev/null
18656 if $test ! -s try.out -a "X$code" = X42; then
18657 output=-DTRY_FPRINTF
18663 : check for fflush NULL behaviour
18664 case "$fflushNULL" in
18665 '') set try -DTRY_FFLUSH_NULL $output
18666 if eval $compile; then
18667 $run ./try 2>/dev/null
18670 if $test -s try.out -a "X$code" = X42; then
18671 fflushNULL="`$cat try.out`"
18673 if $test "X$code" != X42; then
18675 (If this test failed, don't worry, we'll try another method shortly.)
18680 $rm -f core try.core core.try.*
18681 case "$fflushNULL" in
18683 Your fflush(NULL) works okay for output streams.
18684 Let's see if it clobbers input pipes...
18686 # As of mid-March 2000 all versions of Solaris appear to have a stdio
18687 # bug that improperly flushes the input end of pipes. So we avoid the
18688 # autoflush on fork/system/exec support for now. :-(
18689 $cat >tryp.c <<EOCP
18692 main(int argc, char **argv)
18698 while ((i = getc(stdin)) != -1
18699 && (*bp++ = i) != '\n'
18700 && bp < &buf[1024])
18703 fprintf(stdout, "%s", buf);
18711 fflushNULL="$define"
18713 if eval $compile; then
18715 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
18716 if cmp tryp.c tryp.out >/dev/null 2>&1; then
18718 fflush(NULL) seems to behave okay with input streams.
18720 fflushNULL="$define"
18723 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
18725 fflushNULL="$undef"
18728 $rm -f core tryp.c tryp.core core.tryp.*
18731 Your fflush(NULL) isn't working (contrary to ANSI C).
18733 fflushNULL="$undef"
18736 Cannot figure out whether your fflush(NULL) works or not.
18737 I'm assuming it doesn't (contrary to ANSI C).
18739 fflushNULL="$undef"
18743 $define|true|[yY]*)
18744 fflushNULL="$define"
18747 fflushNULL="$undef"
18750 : check explicit looping only if NULL did not work, and if the pipe
18751 : bug does not show up on an explicit flush too
18752 case "$fflushNULL" in
18754 $cat >tryp.c <<EOCP
18757 main(int argc, char **argv)
18763 while ((i = getc(stdin)) != -1
18764 && (*bp++ = i) != '\n'
18765 && bp < &buf[1024])
18768 fprintf(stdout, "%s", buf);
18777 if eval $compile; then
18779 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
18780 if cmp tryp.c tryp.out >/dev/null 2>&1; then
18782 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
18784 : now check for fflushall behaviour
18785 case "$fflushall" in
18786 '') set try -DTRY_FFLUSH_ALL $output
18787 if eval $compile; then
18789 (Now testing the other method--but note that this also may fail.)
18791 $run ./try 2>/dev/null
18794 if $test -s try.out -a "X$code" = X42; then
18795 fflushall="`$cat try.out`"
18798 $rm -f core try.core core.try.*
18799 case "$fflushall" in
18801 Whew. Flushing explicitly all the stdio streams works.
18803 fflushall="$define"
18806 Sigh. Flushing explicitly all the stdio streams doesn't work.
18811 Cannot figure out whether flushing stdio streams explicitly works or not.
18812 I'm assuming it doesn't.
18818 "$define"|true|[yY]*)
18819 fflushall="$define"
18827 All is futile. Even fflush(stdin) clobbers input pipes!
18834 $rm -f core tryp.c tryp.core core.tryp.*
18836 *) fflushall="$undef"
18840 case "$fflushNULL$fflushall" in
18843 OK, I give up. I cannot figure out how to flush pending stdio output.
18844 We won't be flushing handles at all before fork/exec/popen.
18848 $rm -f try.* try$exe_ext
18850 : Store the full pathname to the ar program for use in the C program
18851 : Respect a hint or command line value for full_ar.
18856 : Store the full pathname to the sed program for use in the C program
18859 : see what type gids are declared as in the kernel
18861 echo "Looking for the type for group ids returned by getgid()."
18862 set gid_t gidtype xxx stdio.h sys/types.h
18866 xxx=`./findhdr sys/user.h`
18867 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
18869 unsigned) dflt="$1 $2" ;;
18873 *) dflt="$gidtype";;
18876 gid_t) echo "gid_t found." ;;
18877 *) rp="What is the type for group ids returned by getgid()?"
18885 *_t) zzz="$gidtype" ;;
18888 echo "Checking the size of $zzz..." >&4
18890 #include <sys/types.h>
18892 #$i_stdlib I_STDLIB
18894 #include <stdlib.h>
18897 printf("%d\n", (int)sizeof($gidtype));
18902 if eval $compile_ok; then
18906 echo "(I can't execute the test program--guessing $gidsize.)" >&4
18909 echo "Your $zzz is $gidsize bytes long."
18914 echo "(I can't compile the test program--guessing $gidsize.)" >&4
18920 *_t) zzz="$gidtype" ;;
18923 echo "Checking the sign of $zzz..." >&4
18925 #include <sys/types.h>
18936 if eval $compile; then
18940 echo "(I can't execute the test program--guessing unsigned.)" >&4
18944 1) echo "Your $zzz is unsigned." ;;
18945 -1) echo "Your $zzz is signed." ;;
18951 echo "(I can't compile the test program--guessing unsigned.)" >&4
18957 if $test X"$quadtype" != X; then
18959 echo "Checking how to print 64-bit integers..." >&4
18961 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
18962 $cat >try.c <<'EOCP'
18963 #include <sys/types.h>
18966 int q = 12345678901;
18967 printf("%ld\n", q);
18971 if eval $compile; then
18975 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
18976 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
18977 echo "We will use %d."
18983 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
18984 $cat >try.c <<'EOCP'
18985 #include <sys/types.h>
18988 long q = 12345678901;
18989 printf("%ld\n", q);
18993 if eval $compile; then
18997 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
18998 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
18999 echo "We will use %ld."
19005 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
19006 $cat >try.c <<'EOCP'
19007 #include <sys/types.h>
19008 #include <inttypes.h>
19011 int64_t q = 12345678901;
19012 printf("%" PRId64 "\n", q);
19016 if eval $compile; then
19020 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
19021 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
19022 echo "We will use the C9X style."
19028 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19030 #include <sys/types.h>
19033 $quadtype q = 12345678901;
19034 printf("%Ld\n", q);
19038 if eval $compile; then
19042 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
19043 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
19044 echo "We will use %Ld."
19050 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
19051 $cat >try.c <<'EOCP'
19052 #include <sys/types.h>
19055 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
19056 printf("%lld\n", q);
19060 if eval $compile; then
19064 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
19065 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
19066 echo "We will use the %lld style."
19072 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19074 #include <sys/types.h>
19077 $quadtype q = 12345678901;
19078 printf("%qd\n", q);
19082 if eval $compile; then
19086 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
19087 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
19088 echo "We will use %qd."
19094 if $test X"$sPRId64" = X; then
19095 echo "Cannot figure out how to print 64-bit integers." >&4
19103 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
19104 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
19106 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
19107 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
19113 $echo "Checking the format strings to be used for Perl's internal types..." >&4
19115 if $test X"$ivsize" = X8; then
19116 ivdformat="$sPRId64"
19117 uvuformat="$sPRIu64"
19118 uvoformat="$sPRIo64"
19119 uvxformat="$sPRIx64"
19120 uvXUformat="$sPRIXU64"
19122 if $test X"$ivsize" = X"$longsize"; then
19129 if $test X"$ivsize" = X"$intsize"; then
19137 if $test X"$ivsize" = X"$shortsize"; then
19148 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
19149 nveformat="$sPRIeldbl"
19150 nvfformat="$sPRIfldbl"
19151 nvgformat="$sPRIgldbl"
19152 nvEUformat="$sPRIEUldbl"
19153 nvFUformat="$sPRIFUldbl"
19154 nvGUformat="$sPRIGUldbl"
19164 case "$ivdformat" in
19165 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
19172 $echo "Checking the format string to be used for gids..." >&4
19175 -1) if $test X"$gidsize" = X"$ivsize"; then
19176 gidformat="$ivdformat"
19178 if $test X"$gidsize" = X"$longsize"; then
19181 if $test X"$gidsize" = X"$intsize"; then
19184 if $test X"$gidsize" = X"$shortsize"; then
19191 *) if $test X"$gidsize" = X"$uvsize"; then
19192 gidformat="$uvuformat"
19194 if $test X"$gidsize" = X"$longsize"; then
19197 if $test X"$gidsize" = X"$intsize"; then
19200 if $test X"$gidsize" = X"$shortsize"; then
19209 : see if getgroups exists
19210 set getgroups d_getgrps
19213 : see if setgroups exists
19214 set setgroups d_setgrps
19218 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
19220 case "$d_getgrps$d_setgrps" in
19222 case "$groupstype" in
19223 '') dflt="$gidtype" ;;
19224 *) dflt="$groupstype" ;;
19227 What type of pointer is the second argument to getgroups() and setgroups()?
19228 Usually this is the same as group ids, $gidtype, but not always.
19231 rp='What type pointer is the second argument to getgroups() and setgroups()?'
19235 *) groupstype="$gidtype";;
19239 if $test $patchlevel -lt 9; then
19240 : MAD is not available in 5.8.x or earlier.
19244 $define|true|[yY]*) dflt='y' ;;
19249 Would you like to build with Misc Attribute Decoration? This is development
19250 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
19251 overhead on the interpreter.
19253 If this doesn't make any sense to you, just accept the default '$dflt'.
19255 rp='Build Perl with MAD?'
19260 madlyh='madly.h madly.act madly.tab'
19262 madlyobj="madly$_o" ;;
19272 echo "Checking if your $make program sets \$(MAKE)..." >&4
19273 case "$make_set_make" in
19275 $sed 's/^X //' > testmake.mak << 'EOF'
19277 X @echo 'maketemp="$(MAKE)"'
19279 case "`$make -f testmake.mak 2>/dev/null`" in
19280 *maketemp=*) make_set_make='#' ;;
19281 *) make_set_make="MAKE=$make" ;;
19283 $rm -f testmake.mak
19286 case "$make_set_make" in
19287 '#') echo "Yup, it does.";;
19288 *) echo "Nope, it doesn't.";;
19291 : see what type is used for mode_t
19292 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
19293 set mode_t modetype int stdio.h sys/types.h
19296 : see if we need va_copy
19298 case "$i_stdarg" in
19301 #include <stdarg.h>
19303 #$i_stdlib I_STDLIB
19305 #include <stdlib.h>
19307 #include <signal.h>
19310 ivfprintf(FILE *f, const char *fmt, va_list *valp)
19312 return vfprintf(f, fmt, *valp);
19316 myvfprintf(FILE *f, const char *fmt, va_list val)
19318 return ivfprintf(f, fmt, &val);
19322 myprintf(char *fmt, ...)
19325 va_start(val, fmt);
19326 return myvfprintf(stdout, fmt, val);
19330 main(int ac, char **av)
19332 signal(SIGSEGV, exit);
19334 myprintf("%s%cs all right, then\n", "that", '\'');
19339 if eval $compile && $run ./try 2>&1 >/dev/null; then
19340 case "`$run ./try`" in
19341 "that's all right, then")
19347 yes) echo "It seems that you don't need va_copy()." >&4
19348 need_va_copy="$undef"
19350 *) echo "It seems that va_copy() or similar will be needed." >&4
19351 need_va_copy="$define"
19354 $rm -f try.* core core.* *.core *.core.*
19356 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
19360 : see what type is used for size_t
19361 rp="What is the type used for the length parameter for string functions?"
19362 set size_t sizetype 'unsigned int' stdio.h sys/types.h
19365 : check for type of arguments to gethostbyaddr.
19366 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
19367 case "$d_gethbyaddr" in
19371 Checking to see what type of arguments are accepted by gethostbyaddr().
19373 hdrs="$define sys/types.h
19374 $d_socket sys/socket.h
19375 $i_niin netinet/in.h
19377 $i_unistd unistd.h"
19378 : The first arg can 'char *' or 'void *'
19379 : The second arg is some of integral type
19380 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
19381 for yyy in size_t long int; do
19382 case "$netdb_host_type" in
19383 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
19384 if ./protochk "$try" $hdrs; then
19385 echo "Your system accepts $xxx for the first arg."
19386 echo "...and $yyy for the second arg."
19387 netdb_host_type="$xxx"
19388 netdb_hlen_type="$yyy"
19394 : In case none of those worked, prompt the user.
19395 case "$netdb_host_type" in
19396 '') rp='What is the type for the 1st argument to gethostbyaddr?'
19399 netdb_host_type=$ans
19400 rp='What is the type for the 2nd argument to gethostbyaddr?'
19403 netdb_hlen_type=$ans
19407 *) : no gethostbyaddr, so pick harmless defaults
19408 netdb_host_type='char *'
19409 netdb_hlen_type="$sizetype"
19412 # Remove the "const" if needed. -- but then we'll have a
19414 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
19417 : check for type of argument to gethostbyname.
19418 if test "X$netdb_name_type" = X ; then
19419 case "$d_gethbyname" in
19423 Checking to see what type of argument is accepted by gethostbyname().
19425 hdrs="$define sys/types.h
19426 $d_socket sys/socket.h
19427 $i_niin netinet/in.h
19429 $i_unistd unistd.h"
19430 for xxx in "const char *" "char *"; do
19431 case "$netdb_name_type" in
19432 '') try="extern struct hostent *gethostbyname($xxx);"
19433 if ./protochk "$try" $hdrs; then
19434 echo "Your system accepts $xxx."
19435 netdb_name_type="$xxx"
19440 : In case none of those worked, prompt the user.
19441 case "$netdb_name_type" in
19442 '') rp='What is the type for the 1st argument to gethostbyname?'
19445 netdb_name_type=$ans
19449 *) : no gethostbyname, so pick harmless default
19450 netdb_name_type='char *'
19455 : check for type of 1st argument to getnetbyaddr.
19456 if test "X$netdb_net_type" = X ; then
19457 case "$d_getnbyaddr" in
19461 Checking to see what type of 1st argument is accepted by getnetbyaddr().
19463 hdrs="$define sys/types.h
19464 $d_socket sys/socket.h
19465 $i_niin netinet/in.h
19467 $i_unistd unistd.h"
19468 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
19469 case "$netdb_net_type" in
19470 '') try="extern struct netent *getnetbyaddr($xxx, int);"
19471 if ./protochk "$try" $hdrs; then
19472 echo "Your system accepts $xxx."
19473 netdb_net_type="$xxx"
19478 : In case none of those worked, prompt the user.
19479 case "$netdb_net_type" in
19480 '') rp='What is the type for the 1st argument to getnetbyaddr?'
19483 netdb_net_type=$ans
19487 *) : no getnetbyaddr, so pick harmless default
19488 netdb_net_type='long'
19492 : locate the preferred pager for this system
19499 [a-zA-Z]:/*) dflt=$pg;;
19503 [a-zA-Z]:/*) dflt=$more;;
19507 [a-zA-Z]:/*) dflt=$less;;
19510 '') dflt=/usr/ucb/more;;
19514 : Instruct ./getfile to trust the hinted or previous pager value,
19515 : even if it does not begin with a slash. For example, on os2,
19516 : pager might be cmd /c more. See comments in UU/getfile.
19521 rp='What pager is used on your system?'
19525 : see what type pids are declared as in the kernel
19526 rp="What is the type of process ids on this system?"
19527 set pid_t pidtype int stdio.h sys/types.h
19530 : see if ar generates random libraries by itself
19532 echo "Checking how to generate random libraries on your machine..." >&4
19533 echo 'int bar1() { return bar2(); }' > bar1.c
19534 echo 'int bar2() { return 2; }' > bar2.c
19536 #$i_stdlib I_STDLIB
19538 #include <stdlib.h>
19540 int main() { printf("%d\n", bar1()); exit(0); }
19542 $cc $ccflags -c bar1.c >/dev/null 2>&1
19543 $cc $ccflags -c bar2.c >/dev/null 2>&1
19544 $cc $ccflags -c foo.c >/dev/null 2>&1
19545 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
19546 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19547 $run ./foobar >/dev/null 2>&1; then
19548 echo "$ar appears to generate random libraries itself."
19550 if [ "X$ranlib" = "X" ]; then
19553 elif $ar s bar$_a >/dev/null 2>&1 &&
19554 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19555 $run ./foobar >/dev/null 2>&1; then
19556 echo "a table of contents needs to be added with '$ar s'."
19559 elif $ar ts bar$_a >/dev/null 2>&1 &&
19560 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19561 $run ./foobar >/dev/null 2>&1; then
19562 echo "a table of contents needs to be added with '$ar ts'."
19569 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
19570 $test -f $ranlib || ranlib=''
19573 if $test -n "$ranlib"; then
19574 echo "your system has '$ranlib'; we'll use that."
19577 echo "your system doesn't seem to support random libraries"
19578 echo "so we'll use lorder and tsort to order the libraries."
19585 : check for type of arguments to select.
19586 case "$selecttype" in
19587 '') case "$d_select" in
19591 Checking to see what type of arguments are accepted by select().
19593 hdrs="$define sys/types.h
19594 $i_systime sys/time.h
19595 $i_sysselct sys/select.h
19596 $d_socket sys/socket.h"
19597 : The first arg can be int, unsigned, or size_t
19598 : The last arg may or may not be 'const'
19600 : void pointer has been seen but using that
19601 : breaks the selectminbits test
19602 for xxx in 'fd_set *' 'int *'; do
19603 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
19604 for tmo in 'struct timeval *' 'const struct timeval *'; do
19606 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
19607 if ./protochk "$try" $hdrs; then
19608 echo "Your system accepts $xxx."
19617 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
19618 case "$d_fd_set" in
19619 $define) dflt="fd_set *" ;;
19628 *) : no select, so pick a harmless default
19635 : check for the select 'width'
19636 case "$selectminbits" in
19637 '') safebits=`expr $ptrsize \* 8`
19638 case "$d_select" in
19642 Checking to see on how many bits at a time your select() operates...
19645 #include <sys/types.h>
19647 #$i_systime I_SYS_TIME
19648 #$i_systimek I_SYS_TIME_KERNEL
19653 # ifdef I_SYS_TIME_KERNEL
19656 # include <sys/time.h>
19657 # ifdef I_SYS_TIME_KERNEL
19661 #$i_sysselct I_SYS_SELECT
19662 #ifdef I_SYS_SELECT
19663 #include <sys/select.h>
19665 #$d_socket HAS_SOCKET
19667 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
19670 #$i_stdlib I_STDLIB
19672 #include <stdlib.h>
19675 #define S sizeof(*(b))
19677 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
19678 #define NBITS (NBYTES * 8)
19680 char *s = (char *)malloc(NBYTES);
19689 fp = fopen("try.c", "r");
19695 b = ($selecttype)s;
19696 for (i = 0; i < NBITS; i++)
19700 select(fd + 1, b, 0, 0, &t);
19701 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
19703 printf("%d\n", i + 1);
19708 if eval $compile_ok; then
19709 selectminbits=`$run ./try`
19710 case "$selectminbits" in
19712 Cannot figure out on how many bits at a time your select() operates.
19713 I'll play safe and guess it is $safebits bits.
19715 selectminbits=$safebits
19716 bits="$safebits bits"
19719 *) bits="$selectminbits bits" ;;
19721 echo "Your select() operates on $bits at a time." >&4
19723 rp='What is the minimum number of bits your select() operates on?'
19724 case "$byteorder" in
19725 12345678) dflt=64 ;;
19731 selectminbits="$val"
19735 *) : no select, so pick a harmless default
19736 selectminbits=$safebits
19742 : Trace out the files included by signal.h, then look for SIGxxx names.
19743 : Remove SIGARRAYSIZE used by HPUX.
19744 : Remove SIGSTKSIZE used by Linux.
19745 : Remove SIGSTKSZ used by Posix.
19746 : Remove SIGTYP void lines used by OS2.
19747 : Some cpps, like os390, dont give the file name anywhere
19748 if [ "X$fieldn" = X ]; then
19749 : Just make some guesses. We check them later.
19750 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
19752 xxx=`echo '#include <signal.h>' |
19753 $cppstdin $cppminus $cppflags 2>/dev/null |
19754 $grep '^[ ]*#.*include' |
19755 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
19757 : Check this list of files to be sure we have parsed the cpp output ok.
19758 : This will also avoid potentially non-existent files, such
19761 for xx in $xxx /dev/null ; do
19762 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
19764 : If we have found no files, at least try signal.h
19765 case "$xxxfiles" in
19766 '') xxxfiles=`./findhdr signal.h` ;;
19769 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
19770 print substr($2, 4, 20)
19772 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
19773 print substr($3, 4, 20)
19775 : Append some common names just in case the awk scan failed.
19776 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
19777 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
19778 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
19779 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
19780 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
19782 : generate a few handy files for later
19783 $cat > signal.c <<EOCP
19784 #include <sys/types.h>
19785 #include <signal.h>
19786 #$i_stdlib I_STDLIB
19788 #include <stdlib.h>
19793 /* Strange style to avoid deeply-nested #if/#else/#endif */
19796 # define NSIG (_NSIG)
19802 # define NSIG (SIGMAX+1)
19808 # define NSIG (SIG_MAX+1)
19814 # define NSIG (_SIG_MAX+1)
19820 # define NSIG (MAXSIG+1)
19826 # define NSIG (MAX_SIG+1)
19831 # ifdef SIGARRAYSIZE
19832 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
19838 # define NSIG (_sys_nsig) /* Solaris 2.5 */
19842 /* Default to some arbitrary number that's big enough to get most
19843 of the common signals.
19849 printf("NSIG %d\n", NSIG);
19855 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
19857 printf "#ifdef SIG"; printf $1; printf "\n"
19858 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
19859 printf $1; printf ");\n"
19863 printf "#endif /* JUST_NSIG */\n";
19864 printf "exit(0);\n}\n";
19867 $cat >signal.awk <<'EOP'
19868 BEGIN { ndups = 0 }
19869 $1 ~ /^NSIG$/ { nsig = $2 }
19870 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
19871 if ($2 > maxsig) { maxsig = $2 }
19872 if (sig_name[$2]) {
19873 dup_name[ndups] = $1
19874 dup_num[ndups] = $2
19886 printf("NSIG %d\n", nsig);
19887 for (n = 1; n < nsig; n++) {
19889 printf("%s %d\n", sig_name[n], sig_num[n])
19892 printf("NUM%d %d\n", n, n)
19895 for (n = 0; n < ndups; n++) {
19896 printf("%s %d\n", dup_name[n], dup_num[n])
19900 $cat >signal_cmd <<EOS
19902 if $test -s signal.lst; then
19903 echo "Using your existing signal.lst file"
19908 $cat >>signal_cmd <<'EOS'
19911 if eval $compile_ok; then
19912 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) | $uniq | $awk -f signal.awk >signal.lst
19914 echo "(I can't seem be able to compile the whole test program)" >&4
19915 echo "(I'll try it in little pieces.)" >&4
19916 set signal -DJUST_NSIG
19917 if eval $compile_ok; then
19918 $run ./signal$_exe > signal.nsg
19921 echo "I can't seem to figure out how many signals you have." >&4
19922 echo "Guessing 50." >&4
19923 echo 'NSIG 50' > signal.nsg
19925 : Now look at all the signal names, one at a time.
19926 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
19927 $cat > signal.c <<EOCP
19928 #include <sys/types.h>
19929 #include <signal.h>
19932 printf("$xx %d\n", SIG${xx});
19937 if eval $compile; then
19938 echo "SIG${xx} found."
19939 $run ./signal$_exe >> signal.ls1
19941 echo "SIG${xx} NOT found."
19944 if $test -s signal.ls1; then
19945 $cat signal.nsg signal.ls1 |
19946 $sort -n | $uniq | $awk -f signal.awk >signal.lst
19950 if $test -s signal.lst; then
19953 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
19954 echo 'kill -l' >signal
19955 set X `csh -f <signal`
19959 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
19961 echo $@ | $tr ' ' $trnl | \
19962 $awk '{ printf "%s %d\n", $1, ++s; }
19963 END { printf "NSIG %d\n", ++s }' >signal.lst
19965 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
19967 chmod a+x signal_cmd
19968 $eunicefix signal_cmd
19970 : generate list of signal names
19972 case "$sig_name_init" in
19974 *) case "$sig_num_init" in
19975 ''|*,*) doinit=yes ;;
19980 echo "Generating a list of signal names and numbers..." >&4
19982 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
19983 sig_name=`$awk 'BEGIN { printf "ZERO " }
19984 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
19985 sig_num=`$awk 'BEGIN { printf "0 " }
19986 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
19987 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
19988 !/^NSIG/ { printf "\"%s\", ", $1 }
19989 END { printf "0\n" }' signal.lst`
19990 sig_num_init=`$awk 'BEGIN { printf "0, " }
19991 !/^NSIG/ { printf "%d, ", $2}
19992 END { printf "0\n"}' signal.lst`
19995 echo "The following $sig_count signals are available:"
19997 echo $sig_name | $awk \
19998 'BEGIN { linelen = 0 }
20000 for (i = 1; i <= NF; i++) {
20001 name = "SIG" $i " "
20002 linelen = linelen + length(name)
20003 if (linelen > 70) {
20005 linelen = length(name)
20011 sig_size=`echo $sig_name | awk '{print NF}'`
20012 $rm -f signal signal.c signal.awk signal.lst signal_cmd
20015 case "$sizetype" in
20016 *_t) zzz="$sizetype" ;;
20017 *) zzz="filesize" ;;
20019 echo "Checking the size of $zzz..." >&4
20021 #include <sys/types.h>
20023 #$i_stdlib I_STDLIB
20025 #include <stdlib.h>
20028 printf("%d\n", (int)sizeof($sizetype));
20033 if eval $compile_ok; then
20037 echo "(I can't execute the test program--guessing $sizesize.)" >&4
20040 echo "Your $zzz size is $sizesize bytes."
20045 echo "(I can't compile the test program--guessing $sizesize.)" >&4
20049 : check for socklen_t
20051 echo "Checking to see if you have socklen_t..." >&4
20053 #include <sys/types.h>
20054 #$d_socket HAS_SOCKET
20056 #include <sys/socket.h>
20058 int main() { socklen_t x = 16; }
20061 if eval $compile; then
20063 echo "You have socklen_t."
20066 echo "You do not have socklen_t."
20067 case "$sizetype" in
20068 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
20075 : see if this is a socks.h system
20076 set socks.h i_socks
20079 : check for type of the size argument to socket calls
20080 case "$d_socket" in
20084 Checking to see what type is the last argument of accept().
20087 case "$d_socklen_t" in
20088 "$define") yyy="$yyy socklen_t"
20090 yyy="$yyy $sizetype int long unsigned"
20091 for xxx in $yyy; do
20092 case "$socksizetype" in
20093 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
20094 case "$usesocks" in
20096 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
20097 echo "Your system accepts '$xxx *' for the last argument of accept()."
20098 socksizetype="$xxx"
20101 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
20102 echo "Your system accepts '$xxx *' for the last argument of accept()."
20103 socksizetype="$xxx"
20110 : In case none of those worked, prompt the user.
20111 case "$socksizetype" in
20112 '') rp='What is the type for socket address structure sizes?'
20119 *) : no sockets, so pick relatively harmless default
20124 : see what type is used for signed size_t
20125 set ssize_t ssizetype int stdio.h sys/types.h
20130 #$i_stdlib I_STDLIB
20132 #include <stdlib.h>
20134 #include <sys/types.h>
20135 #define Size_t $sizetype
20136 #define SSize_t $dflt
20139 if (sizeof(Size_t) == sizeof(SSize_t))
20141 else if (sizeof(Size_t) == sizeof(int))
20150 if eval $compile_ok && $run ./try > /dev/null; then
20151 ssizetype=`$run ./try`
20152 echo "I'll be using $ssizetype for functions returning a byte count." >&4
20155 Help! I can't compile and run the ssize_t test program: please enlighten me!
20156 (This is probably a misconfiguration in your system or libraries, and
20157 you really ought to fix it. Still, I'll try anyway.)
20159 I need a type that is the same size as $sizetype, but is guaranteed to
20160 be signed. Common values are ssize_t, int and long.
20163 rp="What signed type is the same size as $sizetype?"
20169 : see what type of char stdio uses.
20171 echo '#include <stdio.h>' > stdio.c
20172 $cppstdin $cppminus < stdio.c > stdioh
20173 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
20174 echo "Your stdio uses unsigned chars." >&4
20175 stdchar="unsigned char"
20177 echo "Your stdio uses signed chars." >&4
20180 $rm -f stdio.* stdioh
20182 : see what type uids are declared as in the kernel
20184 echo "Looking for the type for user ids returned by getuid()."
20185 set uid_t uidtype xxx stdio.h sys/types.h
20189 xxx=`./findhdr sys/user.h`
20190 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
20192 unsigned) dflt="$1 $2" ;;
20196 *) dflt="$uidtype";;
20199 uid_t) echo "uid_t found." ;;
20200 *) rp="What is the type for user ids returned by getuid()?"
20208 *_t) zzz="$uidtype" ;;
20211 echo "Checking the size of $zzz..." >&4
20213 #include <sys/types.h>
20215 #$i_stdlib I_STDLIB
20217 #include <stdlib.h>
20220 printf("%d\n", (int)sizeof($uidtype));
20225 if eval $compile_ok; then
20229 echo "(I can't execute the test program--guessing $uidsize.)" >&4
20232 echo "Your $zzz is $uidsize bytes long."
20237 echo "(I can't compile the test program--guessing $uidsize.)" >&4
20242 *_t) zzz="$uidtype" ;;
20245 echo "Checking the sign of $zzz..." >&4
20247 #include <sys/types.h>
20258 if eval $compile; then
20262 echo "(I can't execute the test program--guessing unsigned.)" >&4
20266 1) echo "Your $zzz is unsigned." ;;
20267 -1) echo "Your $zzz is signed." ;;
20273 echo "(I can't compile the test program--guessing unsigned.)" >&4
20279 $echo "Checking the format string to be used for uids..." >&4
20282 -1) if $test X"$uidsize" = X"$ivsize"; then
20283 uidformat="$ivdformat"
20285 if $test X"$uidsize" = X"$longsize"; then
20288 if $test X"$uidsize" = X"$intsize"; then
20291 if $test X"$uidsize" = X"$shortsize"; then
20298 *) if $test X"$uidsize" = X"$uvsize"; then
20299 uidformat="$uvuformat"
20301 if $test X"$uidsize" = X"$longsize"; then
20304 if $test X"$uidsize" = X"$intsize"; then
20307 if $test X"$uidsize" = X"$shortsize"; then
20317 case "$usesitecustomize" in
20318 $define|true|[Yy]*)
20319 usesitecustomize="$define"
20322 usesitecustomize="$undef"
20326 : determine compiler compiler
20335 if $test -f "$byacc$_exe"; then
20337 comp="byacc or $comp"
20339 if $test -f "$bison$_exe"; then
20340 comp="$comp or bison -y"
20342 rp="Which compiler compiler ($comp) shall I use?"
20351 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
20357 : see if this is a fp.h system
20361 : see if this is a fp_class.h system
20362 set fp_class.h i_fp_class
20365 : see if gdbm.h is available
20370 : see if gdbm_open exists
20371 set gdbm_open d_gdbm_open
20373 case "$d_gdbm_open" in
20376 echo "We won't be including <gdbm.h>"
20385 : see if this is a ieeefp.h system
20386 case "$i_ieeefp" in
20387 '' ) set ieeefp.h i_ieeefp
20392 : see if this is a libutil.h system
20393 set libutil.h i_libutil
20396 : see if mach cthreads are available
20397 if test "X$usethreads" = "X$define"; then
20398 set mach/cthreads.h i_machcthr
20401 i_machcthr="$undef"
20406 : see if this is a mntent.h system
20407 set mntent.h i_mntent
20410 : see if ndbm.h is available
20416 # Some Linux distributions such as RedHat 7.1 put the
20417 # ndbm.h header in /usr/include/gdbm/ndbm.h.
20418 if $test -f /usr/include/gdbm/ndbm.h; then
20419 echo '<gdbm/ndbm.h> found.'
20420 ccflags="$ccflags -I/usr/include/gdbm"
20421 cppflags="$cppflags -I/usr/include/gdbm"
20429 : see if dbm_open exists
20430 set dbm_open d_dbm_open
20432 case "$d_dbm_open" in
20435 echo "We won't be including <ndbm.h>"
20444 : see if net/errno.h is available
20446 set net/errno.h val
20449 : Unfortunately, it causes problems on some systems. Arrgh.
20452 cat > try.c <<'EOM'
20455 #include <net/errno.h>
20461 if $cc $ccflags -c try.c >/dev/null 2>&1; then
20462 echo "We'll be including <net/errno.h>." >&4
20464 echo "We won't be including <net/errno.h>." >&4
20473 : see if netinet/tcp.h is available
20474 set netinet/tcp.h i_netinettcp
20477 : see if this is a poll.h system
20481 : see if this is a prot.h system
20486 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
20487 $cat <<'EOSH' > Cppsym.know
20488 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
20489 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
20490 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
20491 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
20492 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
20493 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
20494 bull c cadmus clipper CMU COFF COMPILER_VERSION
20495 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
20496 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
20497 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
20498 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
20500 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
20501 H3050R H3050RX hbullx20 hcx host_mips
20502 hp200 hp300 hp700 HP700 hp800 hp9000
20503 hp9000s200 hp9000s300 hp9000s400 hp9000s500
20504 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
20505 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
20506 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
20507 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
20508 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
20509 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
20510 Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
20511 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
20512 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
20513 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
20514 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
20515 MATH_HAS_NO_SIDE_EFFECTS
20516 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
20517 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
20518 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
20519 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
20520 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
20521 NetBSD news1500 news1700 news1800 news1900 news3700
20522 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
20523 ns32016 ns32332 ns32k nsc32000
20524 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
20525 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
20526 pc532 pdp11 PGC PIC plexus PORTAR posix
20527 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
20528 POSIX_C_SOURCE POSIX_SOURCE POWER
20529 PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
20530 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
20531 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
20532 sony sony_news sonyrisc sparc sparclite spectrum
20533 stardent stdc STDC_EXT stratos sun sun3 sun386
20534 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
20535 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
20536 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
20537 sysV68 sysV88 Tek4132 Tek4300 titan
20538 TM3200 TM5400 TM5600
20539 tower tower32 tower32_200 tower32_600 tower32_700
20540 tower32_800 tower32_850 tss
20541 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
20542 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
20543 unix UNIX95 UNIX99 unixpc unos
20544 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
20545 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
20546 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
20548 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
20549 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
20550 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
20553 # Maybe put other stuff here too.
20554 cat <<EOSH >>Cppsym.know
20557 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
20558 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
20559 $cat Cppsym.know > Cppsym.c
20560 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
20561 $rm -f Cppsym.a Cppsym.b Cppsym.c
20562 cat <<EOSH > Cppsym
20564 if $test \$# -gt 0; then
20565 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
20566 if $test -s Cppsym.got; then
20573 $tr " " "$trnl" | ./Cppsym.try
20579 cat <<EOSH > Cppsym.try
20581 cat <<'EOCP' > try.c
20584 #define STRINGIFY(a) "a"
20586 #if cpp_stuff == 42
20587 #define StGiFy(a) #a
20588 #define STRINGIFY(a) StGiFy(a)
20590 #if $cpp_stuff != 1 && $cpp_stuff != 42
20591 # include "Bletch: How does this C preprocessor stringify macros?"
20597 cat <<'EOSH' >> Cppsym.try
20599 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
20600 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
20601 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
20602 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
20604 echo 'return 0;}' >> try.c
20606 cat <<EOSH >> Cppsym.try
20608 case "$osname-$gccversion" in
20609 irix-) ccflags="\$ccflags -woff 1178" ;;
20610 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
20612 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
20614 chmod +x Cppsym.try
20615 $eunicefix Cppsym.try
20616 ./Cppsym < Cppsym.know > Cppsym.true
20617 : Add in any linux cpp "predefined macros":
20618 case "$osname::$gccversion" in
20621 rm -f $tHdrH'.h' $tHdrH
20623 if cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
20624 sed 's/#define[\ \ ]*//;s/[\ \ ].*$//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
20625 if [ -s $tHdrH'_cppsym.real' ]; then
20626 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
20629 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
20632 : now check the C compiler for additional symbols
20633 postprocess_cc_v=''
20635 aix) postprocess_cc_v="|$tr , ' '" ;;
20642 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
20645 -D*) echo "\$i" | $sed 's/^-D//';;
20646 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
20651 postprocess_cc_v=''
20654 ./ccsym > ccsym1.raw
20655 if $test -s ccsym1.raw; then
20656 $sort ccsym1.raw | $uniq >ccsym.raw
20658 mv ccsym1.raw ccsym.raw
20661 $awk '/\=/ { print $0; next }
20662 { print $0"=1" }' ccsym.raw >ccsym.list
20663 $comm -13 Cppsym.true ccsym.list >ccsym.own
20664 $comm -12 Cppsym.true ccsym.list >ccsym.com
20665 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
20667 if $test -z ccsym.raw; then
20668 echo "Your C compiler doesn't seem to define any symbols!" >&4
20670 echo "However, your C preprocessor defines the following symbols:"
20673 cppsymbols=`$cat Cppsym.true`
20674 cppsymbols=`echo $cppsymbols`
20675 cppccsymbols="$cppsymbols"
20677 if $test -s ccsym.com; then
20678 echo "Your C compiler and pre-processor define these symbols:"
20679 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
20682 cppccsymbols=`$cat ccsym.com`
20683 cppccsymbols=`echo $cppccsymbols`
20684 $test "$silent" || sleep 1
20686 if $test -s ccsym.cpp; then
20687 $test "$also" && echo " "
20688 echo "Your C pre-processor ${also}defines the following symbols:"
20689 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
20691 cppsymbols=`$cat ccsym.cpp`
20692 cppsymbols=`echo $cppsymbols`
20693 $test "$silent" || sleep 1
20695 if $test -s ccsym.own; then
20696 $test "$also" && echo " "
20697 echo "Your C compiler ${also}defines the following cpp symbols:"
20698 $sed -e 's/\(..*\)=1/\1/' ccsym.own
20699 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
20700 ccsymbols=`$cat ccsym.own`
20701 ccsymbols=`echo $ccsymbols`
20702 $test "$silent" || sleep 1
20706 : see if this is a termio system
20710 if $test `./findhdr termios.h`; then
20711 set tcsetattr i_termios
20717 "$define") echo "You have POSIX termios.h... good!" >&4;;
20718 *) if ./Cppsym pyr; then
20719 case "`/bin/universe`" in
20720 ucb) if $test `./findhdr sgtty.h`; then
20722 echo "<sgtty.h> found." >&4
20724 echo "System is pyramid with BSD universe."
20725 echo "<sgtty.h> not found--you could have problems." >&4
20727 *) if $test `./findhdr termio.h`; then
20729 echo "<termio.h> found." >&4
20731 echo "System is pyramid with USG universe."
20732 echo "<termio.h> not found--you could have problems." >&4
20736 if $test `./findhdr termio.h`; then
20737 echo "<termio.h> found." >&4
20739 elif $test `./findhdr sgtty.h`; then
20740 echo "<sgtty.h> found." >&4
20743 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
20746 if $test `./findhdr sgtty.h`; then
20747 echo "<sgtty.h> found." >&4
20749 elif $test `./findhdr termio.h`; then
20750 echo "<termio.h> found." >&4
20753 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
20757 set i_termio; eval $setvar
20758 val=$val2; set i_sgtty; eval $setvar
20759 val=$val3; set i_termios; eval $setvar
20761 : see if stddef is available
20762 set stddef.h i_stddef
20765 : see if this is a sunmath.h system
20766 set sunmath.h i_sunmath
20769 : see if sys/access.h is available
20770 set sys/access.h i_sysaccess
20773 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
20774 set sys/filio.h i_sysfilio
20777 if $test `./findhdr sys/ioctl.h`; then
20779 echo '<sys/ioctl.h> found.' >&4
20782 if $test $i_sysfilio = "$define"; then
20783 echo '<sys/ioctl.h> NOT found.' >&4
20785 $test $i_sgtty = "$define" && xxx="sgtty.h"
20786 $test $i_termio = "$define" && xxx="termio.h"
20787 $test $i_termios = "$define" && xxx="termios.h"
20788 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
20794 : see if socket ioctl defs are in sys/sockio.h
20796 xxx=`./findhdr sys/sockio.h`
20797 if $test "$xxx"; then
20798 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
20800 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
20803 echo "No socket ioctls found in <sys/sockio.h>." >&4
20808 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
20815 : see if this is a syslog.h system
20816 set syslog.h i_syslog
20820 : see if this is a sys/mode.h system
20821 set sys/mode.h i_sysmode
20824 : see if sys/resource.h has to be included
20825 set sys/resource.h i_sysresrc
20828 : see if sys/security.h is available
20829 set sys/security.h i_syssecrt
20832 : see if this is a sys/statvfs.h system
20833 set sys/statvfs.h i_sysstatvfs
20836 : see if this is a sys/un.h system
20837 set sys/un.h i_sysun
20841 : see if this is a sys/utsname.h system
20842 set sys/utsname.h i_sysutsname
20845 : see if this is a syswait system
20846 set sys/wait.h i_syswait
20849 : see if this is a ustat.h system
20850 set ustat.h i_ustat
20853 : see if this is an utime system
20854 set utime.h i_utime
20857 : see if this is a values.h system
20858 set values.h i_values
20861 : see if this is a vfork system
20864 set vfork.h i_vfork
20873 echo "Looking for extensions..." >&4
20874 : If we are using the old config.sh, known_extensions may contain
20875 : old or inaccurate or duplicate values.
20876 known_extensions=''
20877 nonxs_extensions=''
20878 : We do not use find because it might not be available.
20879 : We do not just use MANIFEST because the user may have dropped
20880 : some additional extensions into the source tree and expect them
20883 : Function to recursively find available extensions, ignoring DynaLoader
20884 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
20888 DynaLoader|dynaload) ;;
20890 if $test -f $xxx/$xxx.xs; then
20891 known_extensions="$known_extensions $1$xxx";
20892 elif $test -f $xxx/Makefile.PL; then
20893 nonxs_extensions="$nonxs_extensions $1$xxx";
20895 if $test -d $xxx -a $# -lt 10; then
20898 eval $find_extensions;
20910 eval $find_extensions
20911 # Special case: Add in threads/shared since it is not picked up by the
20912 # recursive find above (and adding in general recursive finding breaks
20913 # SDBM_File/sdbm). A.D. 10/25/2001.
20914 known_extensions="$known_extensions threads/shared"
20915 set X $nonxs_extensions
20917 nonxs_extensions="$*"
20918 set X $known_extensions
20920 known_extensions="$*"
20923 : Now see which are supported on this system.
20925 for xxx in $known_extensions ; do
20929 $define) avail_ext="$avail_ext $xxx" ;;
20932 GDBM_File|gdbm_fil)
20934 $define) avail_ext="$avail_ext $xxx" ;;
20937 I18N/Langinfo|i18n_lan)
20938 case "$i_langinfo$d_nl_langinfo" in
20939 $define$define) avail_ext="$avail_ext $xxx" ;;
20942 NDBM_File|ndbm_fil)
20945 case "$osname-$use64bitint" in
20948 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
20951 *) avail_ext="$avail_ext $xxx" ;;
20956 ODBM_File|odbm_fil)
20957 case "${i_dbm}${i_rpcsvcdbm}" in
20959 case "$osname-$use64bitint" in
20962 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
20965 *) avail_ext="$avail_ext $xxx" ;;
20971 case "$useposix" in
20972 true|define|y) avail_ext="$avail_ext $xxx" ;;
20976 case "$useopcode" in
20977 true|define|y) avail_ext="$avail_ext $xxx" ;;
20981 case "$d_socket" in
20984 beos) ;; # not unless BONE
20985 *) avail_ext="$avail_ext $xxx" ;;
20990 Sys/Syslog|sys/syslog)
20991 : XXX syslog requires socket
20992 case "$d_socket" in
20993 true|$define|y) avail_ext="$avail_ext $xxx" ;;
20997 case "$usethreads" in
20999 case "$useithreads" in
21000 $undef|false|[nN]*) avail_ext="$avail_ext $xxx" ;;
21004 XS/APItest|xs/apitest)
21005 # This is just for testing. Skip it unless we have dynamic loading.
21008 $define) avail_ext="$avail_ext $xxx" ;;
21011 XS/Typemap|xs/typemap)
21012 # This is just for testing. Skip it unless we have dynamic loading.
21014 $define) avail_ext="$avail_ext $xxx" ;;
21017 threads|threads/shared)
21018 # threads and threads::shared are special cases.
21019 # To stop people from asking "Perl 5.8.0 was supposed
21020 # to have this new fancy threads implementation but my
21021 # perl doesn't have it" and from people trying to
21022 # (re)install the threads module using CPAN.pm and
21023 # CPAN.pm then offering to reinstall Perl 5.8.0,
21024 # the threads.pm and threads/shared.pm will always be
21025 # there, croaking informatively ("you need to rebuild
21026 # all of Perl with threads, sorry") when threads haven't
21027 # been compiled in.
21029 avail_ext="$avail_ext $xxx"
21032 : XXX Do we need a useipcsysv variable here
21033 case "${d_msg}${d_sem}${d_shm}" in
21034 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
21037 *) avail_ext="$avail_ext $xxx"
21046 case "$onlyextensions" in
21048 *) keepextensions=''
21049 echo "You have requested that only certains extensions be included..." >&4
21050 for i in $onlyextensions; do
21051 case " $avail_ext " in
21053 echo "Keeping extension $i."
21054 keepextensions="$keepextensions $i"
21056 *) echo "Ignoring extension $i." ;;
21059 avail_ext="$keepextensions"
21063 case "$noextensions" in
21065 *) keepextensions=''
21066 echo "You have requested that certain extensions be ignored..." >&4
21067 for i in $avail_ext; do
21068 case " $noextensions " in
21069 *" $i "*) echo "Ignoring extension $i." ;;
21070 *) echo "Keeping extension $i.";
21071 keepextensions="$keepextensions $i"
21075 avail_ext="$keepextensions"
21079 : Now see which nonxs extensions are supported on this system.
21080 : For now assume all are.
21082 for xxx in $nonxs_extensions ; do
21084 *) nonxs_ext="$nonxs_ext $xxx"
21096 A number of extensions are supplied with $package. You may choose to
21097 compile these extensions for dynamic loading (the default), compile
21098 them into the $package executable (static loading), or not include
21099 them at all. Answer "none" to include no extensions.
21100 Note that DynaLoader is always built and need not be mentioned here.
21103 case "$dynamic_ext" in
21105 : Exclude those listed in static_ext
21107 for xxx in $avail_ext; do
21108 case " $static_ext " in
21110 *) dflt="$dflt $xxx" ;;
21117 *) dflt="$dynamic_ext"
21118 # Perhaps we are reusing an old out-of-date config.sh.
21121 if test X"$dynamic_ext" != X"$avail_ext"; then
21123 NOTICE: Your previous config.sh list may be incorrect.
21124 The extensions now available to you are
21126 but the default list from your previous config.sh is
21138 rp="What extensions do you wish to load dynamically?"
21141 none) dynamic_ext=' ' ;;
21142 *) dynamic_ext="$ans" ;;
21145 case "$static_ext" in
21147 : Exclude those already listed in dynamic linking
21149 for xxx in $avail_ext; do
21150 case " $dynamic_ext " in
21152 *) dflt="$dflt $xxx" ;;
21159 *) dflt="$static_ext"
21166 rp="What extensions do you wish to load statically?"
21169 none) static_ext=' ' ;;
21170 *) static_ext="$ans" ;;
21175 A number of extensions are supplied with $package. Answer "none"
21176 to include no extensions.
21177 Note that DynaLoader is always built and need not be mentioned here.
21180 case "$static_ext" in
21181 '') dflt="$avail_ext" ;;
21182 *) dflt="$static_ext"
21183 # Perhaps we are reusing an old out-of-date config.sh.
21186 if test X"$static_ext" != X"$avail_ext"; then
21188 NOTICE: Your previous config.sh list may be incorrect.
21189 The extensions now available to you are
21191 but the default list from your previous config.sh is
21200 : Exclude those that are not xs extensions
21204 rp="What extensions do you wish to include?"
21207 none) static_ext=' ' ;;
21208 *) static_ext="$ans" ;;
21213 # Encode is a special case. If we are building Encode as a static
21214 # extension, we need to explicitly list its subextensions as well.
21215 # For other nested extensions, this is handled automatically by
21216 # the appropriate Makefile.PL.
21217 case " $static_ext " in
21218 *" Encode "*) # Add the subextensions of Encode
21220 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
21221 static_ext="$static_ext Encode/$xxx"
21227 set X $dynamic_ext $static_ext $nonxs_ext
21231 # Sanity check: We require an extension suitable for use with
21232 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
21233 # should show up as failures in the test suite, but it's helpful to
21234 # catch them now.) The 'extensions' list is normally sorted
21235 # alphabetically, so we need to accept either
21236 # DB_File ... Fcntl ... IO ....
21237 # or something like
21238 # Fcntl ... NDBM_File ... IO ....
21239 case " $extensions" in
21240 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
21241 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
21242 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
21243 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
21244 echo "WARNING: The Perl you are building will be quite crippled." >& 4
21248 : Remove libraries needed only for extensions
21249 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
21250 : The exception is SunOS 4.x, which needs them.
21251 case "${osname}X${osvers}" in
21255 *) case "$usedl" in
21256 $define|true|[yY]*)
21257 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
21261 *) perllibs="$libs"
21267 : Remove build directory name from cppstdin so it can be used from
21268 : either the present location or the final installed location.
21270 : Get out of the UU directory to get correct path name.
21272 case "$cppstdin" in
21274 echo "Stripping down cppstdin path name"
21280 : end of configuration questions
21282 echo "End of configuration questions."
21285 : back to where it started
21286 if test -d ../UU; then
21290 : configuration may be patched via a 'config.arch' file
21291 if $test -f config.arch; then
21292 echo "I see a config.arch file, loading it."
21296 : configuration may be patched via a 'config.over' file
21297 if $test -f config.over; then
21300 rp='I see a config.over file. Do you wish to load it?'
21303 n*) echo "OK, I'll ignore it.";;
21305 echo "Configuration override changes have been loaded."
21310 : in case they want portability, strip down executable paths
21311 case "$d_portable" in
21314 echo "Stripping down executable paths..." >&4
21315 for file in $loclist $trylist; do
21317 eval $file=`basename $temp`
21322 : create config.sh file
21324 echo "Creating config.sh..." >&4
21325 $spitshell <<EOT >config.sh
21328 # This file was produced by running the Configure script. It holds all the
21329 # definitions figured out by Configure. Should you modify one of these values,
21330 # do not forget to propagate your changes by running "Configure -der". You may
21331 # instead choose to run each of the .SH files by yourself, or "Configure -S".
21334 # Package name : $package
21335 # Source directory : $src
21336 # Configuration time: $cf_time
21337 # Configured by : $cf_by
21338 # Target system : $myuname
21348 Revision='$Revision'
21356 alignbytes='$alignbytes'
21357 ansi2knr='$ansi2knr'
21358 aphostname='$aphostname'
21359 api_revision='$api_revision'
21360 api_subversion='$api_subversion'
21361 api_version='$api_version'
21362 api_versionstring='$api_versionstring'
21365 archlibexp='$archlibexp'
21366 archname64='$archname64'
21367 archname='$archname'
21368 archobjs='$archobjs'
21369 asctime_r_proto='$asctime_r_proto'
21377 byteorder='$byteorder'
21379 castflags='$castflags'
21382 cccdlflags='$cccdlflags'
21383 ccdlflags='$ccdlflags'
21385 ccflags_uselargefiles='$ccflags_uselargefiles'
21387 ccsymbols='$ccsymbols'
21388 ccversion='$ccversion'
21390 cf_email='$cf_email'
21392 charsize='$charsize'
21396 clocktype='$clocktype'
21398 compress='$compress'
21399 contains='$contains'
21403 cpp_stuff='$cpp_stuff'
21404 cppccsymbols='$cppccsymbols'
21405 cppflags='$cppflags'
21407 cppminus='$cppminus'
21409 cppstdin='$cppstdin'
21410 cppsymbols='$cppsymbols'
21411 crypt_r_proto='$crypt_r_proto'
21412 cryptlib='$cryptlib'
21414 ctermid_r_proto='$ctermid_r_proto'
21415 ctime_r_proto='$ctime_r_proto'
21416 d_Gconvert='$d_Gconvert'
21417 d_PRIEUldbl='$d_PRIEUldbl'
21418 d_PRIFUldbl='$d_PRIFUldbl'
21419 d_PRIGUldbl='$d_PRIGUldbl'
21420 d_PRIXU64='$d_PRIXU64'
21421 d_PRId64='$d_PRId64'
21422 d_PRIeldbl='$d_PRIeldbl'
21423 d_PRIfldbl='$d_PRIfldbl'
21424 d_PRIgldbl='$d_PRIgldbl'
21425 d_PRIi64='$d_PRIi64'
21426 d_PRIo64='$d_PRIo64'
21427 d_PRIu64='$d_PRIu64'
21428 d_PRIx64='$d_PRIx64'
21429 d_SCNfldbl='$d_SCNfldbl'
21430 d__fwalk='$d__fwalk'
21431 d_access='$d_access'
21432 d_accessx='$d_accessx'
21435 d_archlib='$d_archlib'
21436 d_asctime_r='$d_asctime_r'
21439 d_attribute_format='$d_attribute_format'
21440 d_attribute_malloc='$d_attribute_malloc'
21441 d_attribute_nonnull='$d_attribute_nonnull'
21442 d_attribute_noreturn='$d_attribute_noreturn'
21443 d_attribute_pure='$d_attribute_pure'
21444 d_attribute_unused='$d_attribute_unused'
21445 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
21449 d_bsdgetpgrp='$d_bsdgetpgrp'
21450 d_bsdsetpgrp='$d_bsdsetpgrp'
21451 d_builtin_choose_expr='$d_builtin_choose_expr'
21452 d_builtin_expect='$d_builtin_expect'
21454 d_c99_variadic_macros='$d_c99_variadic_macros'
21455 d_casti32='$d_casti32'
21456 d_castneg='$d_castneg'
21457 d_charvspr='$d_charvspr'
21459 d_chroot='$d_chroot'
21460 d_chsize='$d_chsize'
21462 d_clearenv='$d_clearenv'
21463 d_closedir='$d_closedir'
21464 d_cmsghdr_s='$d_cmsghdr_s'
21466 d_copysignl='$d_copysignl'
21467 d_cplusplus='$d_cplusplus'
21469 d_crypt_r='$d_crypt_r'
21471 d_ctermid='$d_ctermid'
21472 d_ctermid_r='$d_ctermid_r'
21473 d_ctime_r='$d_ctime_r'
21474 d_cuserid='$d_cuserid'
21475 d_dbl_dig='$d_dbl_dig'
21476 d_dbminitproto='$d_dbminitproto'
21477 d_difftime='$d_difftime'
21478 d_dir_dd_fd='$d_dir_dd_fd'
21480 d_dirnamlen='$d_dirnamlen'
21481 d_dlerror='$d_dlerror'
21482 d_dlopen='$d_dlopen'
21483 d_dlsymun='$d_dlsymun'
21484 d_dosuid='$d_dosuid'
21485 d_drand48_r='$d_drand48_r'
21486 d_drand48proto='$d_drand48proto'
21488 d_eaccess='$d_eaccess'
21489 d_endgrent='$d_endgrent'
21490 d_endgrent_r='$d_endgrent_r'
21491 d_endhent='$d_endhent'
21492 d_endhostent_r='$d_endhostent_r'
21493 d_endnent='$d_endnent'
21494 d_endnetent_r='$d_endnetent_r'
21495 d_endpent='$d_endpent'
21496 d_endprotoent_r='$d_endprotoent_r'
21497 d_endpwent='$d_endpwent'
21498 d_endpwent_r='$d_endpwent_r'
21499 d_endsent='$d_endsent'
21500 d_endservent_r='$d_endservent_r'
21501 d_eofnblk='$d_eofnblk'
21502 d_eunice='$d_eunice'
21503 d_faststdio='$d_faststdio'
21504 d_fchdir='$d_fchdir'
21505 d_fchmod='$d_fchmod'
21506 d_fchown='$d_fchown'
21508 d_fcntl_can_lock='$d_fcntl_can_lock'
21509 d_fd_macros='$d_fd_macros'
21510 d_fd_set='$d_fd_set'
21511 d_fds_bits='$d_fds_bits'
21512 d_fgetpos='$d_fgetpos'
21513 d_finite='$d_finite'
21514 d_finitel='$d_finitel'
21515 d_flexfnam='$d_flexfnam'
21517 d_flockproto='$d_flockproto'
21519 d_fp_class='$d_fp_class'
21520 d_fpathconf='$d_fpathconf'
21521 d_fpclass='$d_fpclass'
21522 d_fpclassify='$d_fpclassify'
21523 d_fpclassl='$d_fpclassl'
21524 d_fpos64_t='$d_fpos64_t'
21525 d_frexpl='$d_frexpl'
21526 d_fs_data_s='$d_fs_data_s'
21527 d_fseeko='$d_fseeko'
21528 d_fsetpos='$d_fsetpos'
21529 d_fstatfs='$d_fstatfs'
21530 d_fstatvfs='$d_fstatvfs'
21532 d_ftello='$d_ftello'
21534 d_futimes='$d_futimes'
21535 d_getcwd='$d_getcwd'
21536 d_getespwnam='$d_getespwnam'
21537 d_getfsstat='$d_getfsstat'
21538 d_getgrent='$d_getgrent'
21539 d_getgrent_r='$d_getgrent_r'
21540 d_getgrgid_r='$d_getgrgid_r'
21541 d_getgrnam_r='$d_getgrnam_r'
21542 d_getgrps='$d_getgrps'
21543 d_gethbyaddr='$d_gethbyaddr'
21544 d_gethbyname='$d_gethbyname'
21545 d_gethent='$d_gethent'
21546 d_gethname='$d_gethname'
21547 d_gethostbyaddr_r='$d_gethostbyaddr_r'
21548 d_gethostbyname_r='$d_gethostbyname_r'
21549 d_gethostent_r='$d_gethostent_r'
21550 d_gethostprotos='$d_gethostprotos'
21551 d_getitimer='$d_getitimer'
21552 d_getlogin='$d_getlogin'
21553 d_getlogin_r='$d_getlogin_r'
21554 d_getmnt='$d_getmnt'
21555 d_getmntent='$d_getmntent'
21556 d_getnbyaddr='$d_getnbyaddr'
21557 d_getnbyname='$d_getnbyname'
21558 d_getnent='$d_getnent'
21559 d_getnetbyaddr_r='$d_getnetbyaddr_r'
21560 d_getnetbyname_r='$d_getnetbyname_r'
21561 d_getnetent_r='$d_getnetent_r'
21562 d_getnetprotos='$d_getnetprotos'
21563 d_getpagsz='$d_getpagsz'
21564 d_getpbyname='$d_getpbyname'
21565 d_getpbynumber='$d_getpbynumber'
21566 d_getpent='$d_getpent'
21567 d_getpgid='$d_getpgid'
21568 d_getpgrp2='$d_getpgrp2'
21569 d_getpgrp='$d_getpgrp'
21570 d_getppid='$d_getppid'
21571 d_getprior='$d_getprior'
21572 d_getprotobyname_r='$d_getprotobyname_r'
21573 d_getprotobynumber_r='$d_getprotobynumber_r'
21574 d_getprotoent_r='$d_getprotoent_r'
21575 d_getprotoprotos='$d_getprotoprotos'
21576 d_getprpwnam='$d_getprpwnam'
21577 d_getpwent='$d_getpwent'
21578 d_getpwent_r='$d_getpwent_r'
21579 d_getpwnam_r='$d_getpwnam_r'
21580 d_getpwuid_r='$d_getpwuid_r'
21581 d_getsbyname='$d_getsbyname'
21582 d_getsbyport='$d_getsbyport'
21583 d_getsent='$d_getsent'
21584 d_getservbyname_r='$d_getservbyname_r'
21585 d_getservbyport_r='$d_getservbyport_r'
21586 d_getservent_r='$d_getservent_r'
21587 d_getservprotos='$d_getservprotos'
21588 d_getspnam='$d_getspnam'
21589 d_getspnam_r='$d_getspnam_r'
21590 d_gettimeod='$d_gettimeod'
21591 d_gmtime_r='$d_gmtime_r'
21592 d_gnulibc='$d_gnulibc'
21593 d_grpasswd='$d_grpasswd'
21594 d_hasmntopt='$d_hasmntopt'
21596 d_ilogbl='$d_ilogbl'
21597 d_inc_version_list='$d_inc_version_list'
21599 d_inetaton='$d_inetaton'
21600 d_int64_t='$d_int64_t'
21601 d_isascii='$d_isascii'
21602 d_isfinite='$d_isfinite'
21605 d_isnanl='$d_isnanl'
21606 d_killpg='$d_killpg'
21607 d_lchown='$d_lchown'
21608 d_ldbl_dig='$d_ldbl_dig'
21609 d_libm_lib_version='$d_libm_lib_version'
21611 d_localtime_r='$d_localtime_r'
21612 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
21613 d_locconv='$d_locconv'
21615 d_longdbl='$d_longdbl'
21616 d_longlong='$d_longlong'
21617 d_lseekproto='$d_lseekproto'
21619 d_madvise='$d_madvise'
21620 d_malloc_good_size='$d_malloc_good_size'
21621 d_malloc_size='$d_malloc_size'
21623 d_mbstowcs='$d_mbstowcs'
21624 d_mbtowc='$d_mbtowc'
21625 d_memchr='$d_memchr'
21626 d_memcmp='$d_memcmp'
21627 d_memcpy='$d_memcpy'
21628 d_memmove='$d_memmove'
21629 d_memset='$d_memset'
21631 d_mkdtemp='$d_mkdtemp'
21632 d_mkfifo='$d_mkfifo'
21633 d_mkstemp='$d_mkstemp'
21634 d_mkstemps='$d_mkstemps'
21635 d_mktime='$d_mktime'
21638 d_modfl_pow32_bug='$d_modfl_pow32_bug'
21639 d_modflproto='$d_modflproto'
21640 d_mprotect='$d_mprotect'
21642 d_msg_ctrunc='$d_msg_ctrunc'
21643 d_msg_dontroute='$d_msg_dontroute'
21644 d_msg_oob='$d_msg_oob'
21645 d_msg_peek='$d_msg_peek'
21646 d_msg_proxy='$d_msg_proxy'
21647 d_msgctl='$d_msgctl'
21648 d_msgget='$d_msgget'
21649 d_msghdr_s='$d_msghdr_s'
21650 d_msgrcv='$d_msgrcv'
21651 d_msgsnd='$d_msgsnd'
21653 d_munmap='$d_munmap'
21654 d_mymalloc='$d_mymalloc'
21656 d_nl_langinfo='$d_nl_langinfo'
21657 d_nv_preserves_uv='$d_nv_preserves_uv'
21658 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
21659 d_off64_t='$d_off64_t'
21660 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
21661 d_oldpthreads='$d_oldpthreads'
21662 d_oldsock='$d_oldsock'
21664 d_pathconf='$d_pathconf'
21666 d_perl_otherlibdirs='$d_perl_otherlibdirs'
21667 d_phostname='$d_phostname'
21670 d_portable='$d_portable'
21671 d_procselfexe='$d_procselfexe'
21672 d_pthread_atfork='$d_pthread_atfork'
21673 d_pthread_attr_setscope='$d_pthread_attr_setscope'
21674 d_pthread_yield='$d_pthread_yield'
21676 d_pwchange='$d_pwchange'
21677 d_pwclass='$d_pwclass'
21678 d_pwcomment='$d_pwcomment'
21679 d_pwexpire='$d_pwexpire'
21680 d_pwgecos='$d_pwgecos'
21681 d_pwpasswd='$d_pwpasswd'
21682 d_pwquota='$d_pwquota'
21685 d_random_r='$d_random_r'
21686 d_readdir64_r='$d_readdir64_r'
21687 d_readdir='$d_readdir'
21688 d_readdir_r='$d_readdir_r'
21689 d_readlink='$d_readlink'
21691 d_recvmsg='$d_recvmsg'
21692 d_rename='$d_rename'
21693 d_rewinddir='$d_rewinddir'
21695 d_safebcpy='$d_safebcpy'
21696 d_safemcpy='$d_safemcpy'
21697 d_sanemcmp='$d_sanemcmp'
21698 d_sbrkproto='$d_sbrkproto'
21699 d_scalbnl='$d_scalbnl'
21700 d_sched_yield='$d_sched_yield'
21701 d_scm_rights='$d_scm_rights'
21702 d_seekdir='$d_seekdir'
21703 d_select='$d_select'
21705 d_semctl='$d_semctl'
21706 d_semctl_semid_ds='$d_semctl_semid_ds'
21707 d_semctl_semun='$d_semctl_semun'
21708 d_semget='$d_semget'
21710 d_sendmsg='$d_sendmsg'
21711 d_setegid='$d_setegid'
21712 d_seteuid='$d_seteuid'
21713 d_setgrent='$d_setgrent'
21714 d_setgrent_r='$d_setgrent_r'
21715 d_setgrps='$d_setgrps'
21716 d_sethent='$d_sethent'
21717 d_sethostent_r='$d_sethostent_r'
21718 d_setitimer='$d_setitimer'
21719 d_setlinebuf='$d_setlinebuf'
21720 d_setlocale='$d_setlocale'
21721 d_setlocale_r='$d_setlocale_r'
21722 d_setnent='$d_setnent'
21723 d_setnetent_r='$d_setnetent_r'
21724 d_setpent='$d_setpent'
21725 d_setpgid='$d_setpgid'
21726 d_setpgrp2='$d_setpgrp2'
21727 d_setpgrp='$d_setpgrp'
21728 d_setprior='$d_setprior'
21729 d_setproctitle='$d_setproctitle'
21730 d_setprotoent_r='$d_setprotoent_r'
21731 d_setpwent='$d_setpwent'
21732 d_setpwent_r='$d_setpwent_r'
21733 d_setregid='$d_setregid'
21734 d_setresgid='$d_setresgid'
21735 d_setresuid='$d_setresuid'
21736 d_setreuid='$d_setreuid'
21737 d_setrgid='$d_setrgid'
21738 d_setruid='$d_setruid'
21739 d_setsent='$d_setsent'
21740 d_setservent_r='$d_setservent_r'
21741 d_setsid='$d_setsid'
21742 d_setvbuf='$d_setvbuf'
21746 d_shmatprototype='$d_shmatprototype'
21747 d_shmctl='$d_shmctl'
21749 d_shmget='$d_shmget'
21750 d_sigaction='$d_sigaction'
21751 d_sigprocmask='$d_sigprocmask'
21752 d_sigsetjmp='$d_sigsetjmp'
21753 d_sitearch='$d_sitearch'
21754 d_snprintf='$d_snprintf'
21755 d_sockatmark='$d_sockatmark'
21756 d_sockatmarkproto='$d_sockatmarkproto'
21757 d_socket='$d_socket'
21758 d_socklen_t='$d_socklen_t'
21759 d_sockpair='$d_sockpair'
21760 d_socks5_init='$d_socks5_init'
21761 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
21763 d_srand48_r='$d_srand48_r'
21764 d_srandom_r='$d_srandom_r'
21765 d_sresgproto='$d_sresgproto'
21766 d_sresuproto='$d_sresuproto'
21767 d_statblks='$d_statblks'
21768 d_statfs_f_flags='$d_statfs_f_flags'
21769 d_statfs_s='$d_statfs_s'
21770 d_statvfs='$d_statvfs'
21771 d_stdio_cnt_lval='$d_stdio_cnt_lval'
21772 d_stdio_ptr_lval='$d_stdio_ptr_lval'
21773 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
21774 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
21775 d_stdio_stream_array='$d_stdio_stream_array'
21776 d_stdiobase='$d_stdiobase'
21777 d_stdstdio='$d_stdstdio'
21778 d_strchr='$d_strchr'
21779 d_strcoll='$d_strcoll'
21780 d_strctcpy='$d_strctcpy'
21781 d_strerrm='$d_strerrm'
21782 d_strerror='$d_strerror'
21783 d_strerror_r='$d_strerror_r'
21784 d_strftime='$d_strftime'
21785 d_strlcat='$d_strlcat'
21786 d_strlcpy='$d_strlcpy'
21787 d_strtod='$d_strtod'
21788 d_strtol='$d_strtol'
21789 d_strtold='$d_strtold'
21790 d_strtoll='$d_strtoll'
21791 d_strtoq='$d_strtoq'
21792 d_strtoul='$d_strtoul'
21793 d_strtoull='$d_strtoull'
21794 d_strtouq='$d_strtouq'
21795 d_strxfrm='$d_strxfrm'
21796 d_suidsafe='$d_suidsafe'
21797 d_symlink='$d_symlink'
21798 d_syscall='$d_syscall'
21799 d_syscallproto='$d_syscallproto'
21800 d_sysconf='$d_sysconf'
21801 d_sysernlst='$d_sysernlst'
21802 d_syserrlst='$d_syserrlst'
21803 d_system='$d_system'
21804 d_tcgetpgrp='$d_tcgetpgrp'
21805 d_tcsetpgrp='$d_tcsetpgrp'
21806 d_telldir='$d_telldir'
21807 d_telldirproto='$d_telldirproto'
21810 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
21811 d_tm_tm_zone='$d_tm_tm_zone'
21812 d_tmpnam_r='$d_tmpnam_r'
21813 d_truncate='$d_truncate'
21814 d_ttyname_r='$d_ttyname_r'
21815 d_tzname='$d_tzname'
21816 d_u32align='$d_u32align'
21817 d_ualarm='$d_ualarm'
21820 d_union_semun='$d_union_semun'
21821 d_unordered='$d_unordered'
21822 d_unsetenv='$d_unsetenv'
21823 d_usleep='$d_usleep'
21824 d_usleepproto='$d_usleepproto'
21826 d_vendorarch='$d_vendorarch'
21827 d_vendorbin='$d_vendorbin'
21828 d_vendorlib='$d_vendorlib'
21829 d_vendorscript='$d_vendorscript'
21831 d_void_closedir='$d_void_closedir'
21832 d_voidsig='$d_voidsig'
21833 d_voidtty='$d_voidtty'
21834 d_volatile='$d_volatile'
21835 d_vprintf='$d_vprintf'
21836 d_vsnprintf='$d_vsnprintf'
21838 d_waitpid='$d_waitpid'
21839 d_wcstombs='$d_wcstombs'
21840 d_wctomb='$d_wctomb'
21841 d_writev='$d_writev'
21844 db_hashtype='$db_hashtype'
21845 db_prefixtype='$db_prefixtype'
21846 db_version_major='$db_version_major'
21847 db_version_minor='$db_version_minor'
21848 db_version_patch='$db_version_patch'
21849 defvoidused='$defvoidused'
21850 direntrytype='$direntrytype'
21853 doublesize='$doublesize'
21855 drand48_r_proto='$drand48_r_proto'
21856 dynamic_ext='$dynamic_ext'
21862 endgrent_r_proto='$endgrent_r_proto'
21863 endhostent_r_proto='$endhostent_r_proto'
21864 endnetent_r_proto='$endnetent_r_proto'
21865 endprotoent_r_proto='$endprotoent_r_proto'
21866 endpwent_r_proto='$endpwent_r_proto'
21867 endservent_r_proto='$endservent_r_proto'
21868 eunicefix='$eunicefix'
21871 extensions='$extensions'
21873 fflushNULL='$fflushNULL'
21874 fflushall='$fflushall'
21876 firstmakefile='$firstmakefile'
21878 fpossize='$fpossize'
21879 fpostype='$fpostype'
21880 freetype='$freetype'
21883 full_csh='$full_csh'
21884 full_sed='$full_sed'
21885 gccansipedantic='$gccansipedantic'
21886 gccosandvers='$gccosandvers'
21887 gccversion='$gccversion'
21888 getgrent_r_proto='$getgrent_r_proto'
21889 getgrgid_r_proto='$getgrgid_r_proto'
21890 getgrnam_r_proto='$getgrnam_r_proto'
21891 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
21892 gethostbyname_r_proto='$gethostbyname_r_proto'
21893 gethostent_r_proto='$gethostent_r_proto'
21894 getlogin_r_proto='$getlogin_r_proto'
21895 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
21896 getnetbyname_r_proto='$getnetbyname_r_proto'
21897 getnetent_r_proto='$getnetent_r_proto'
21898 getprotobyname_r_proto='$getprotobyname_r_proto'
21899 getprotobynumber_r_proto='$getprotobynumber_r_proto'
21900 getprotoent_r_proto='$getprotoent_r_proto'
21901 getpwent_r_proto='$getpwent_r_proto'
21902 getpwnam_r_proto='$getpwnam_r_proto'
21903 getpwuid_r_proto='$getpwuid_r_proto'
21904 getservbyname_r_proto='$getservbyname_r_proto'
21905 getservbyport_r_proto='$getservbyport_r_proto'
21906 getservent_r_proto='$getservent_r_proto'
21907 getspnam_r_proto='$getspnam_r_proto'
21908 gidformat='$gidformat'
21914 gmtime_r_proto='$gmtime_r_proto'
21915 gnulibc_version='$gnulibc_version'
21917 groupcat='$groupcat'
21918 groupstype='$groupstype'
21921 h_sysfile='$h_sysfile'
21924 html1dir='$html1dir'
21925 html1direxp='$html1direxp'
21926 html3dir='$html3dir'
21927 html3direxp='$html3direxp'
21936 i_arpainet='$i_arpainet'
21937 i_bsdioctl='$i_bsdioctl'
21941 i_dirent='$i_dirent'
21947 i_fp_class='$i_fp_class'
21950 i_ieeefp='$i_ieeefp'
21951 i_inttypes='$i_inttypes'
21952 i_langinfo='$i_langinfo'
21953 i_libutil='$i_libutil'
21954 i_limits='$i_limits'
21955 i_locale='$i_locale'
21956 i_machcthr='$i_machcthr'
21957 i_malloc='$i_malloc'
21959 i_memory='$i_memory'
21960 i_mntent='$i_mntent'
21963 i_neterrno='$i_neterrno'
21964 i_netinettcp='$i_netinettcp'
21968 i_pthread='$i_pthread'
21970 i_rpcsvcdbm='$i_rpcsvcdbm'
21973 i_shadow='$i_shadow'
21975 i_stdarg='$i_stdarg'
21976 i_stddef='$i_stddef'
21977 i_stdlib='$i_stdlib'
21978 i_string='$i_string'
21979 i_sunmath='$i_sunmath'
21980 i_sysaccess='$i_sysaccess'
21981 i_sysdir='$i_sysdir'
21982 i_sysfile='$i_sysfile'
21983 i_sysfilio='$i_sysfilio'
21985 i_sysioctl='$i_sysioctl'
21986 i_syslog='$i_syslog'
21987 i_sysmman='$i_sysmman'
21988 i_sysmode='$i_sysmode'
21989 i_sysmount='$i_sysmount'
21990 i_sysndir='$i_sysndir'
21991 i_sysparam='$i_sysparam'
21992 i_sysresrc='$i_sysresrc'
21993 i_syssecrt='$i_syssecrt'
21994 i_sysselct='$i_sysselct'
21995 i_syssockio='$i_syssockio'
21996 i_sysstat='$i_sysstat'
21997 i_sysstatfs='$i_sysstatfs'
21998 i_sysstatvfs='$i_sysstatvfs'
21999 i_systime='$i_systime'
22000 i_systimek='$i_systimek'
22001 i_systimes='$i_systimes'
22002 i_systypes='$i_systypes'
22003 i_sysuio='$i_sysuio'
22005 i_sysutsname='$i_sysutsname'
22006 i_sysvfs='$i_sysvfs'
22007 i_syswait='$i_syswait'
22008 i_termio='$i_termio'
22009 i_termios='$i_termios'
22011 i_unistd='$i_unistd'
22014 i_values='$i_values'
22015 i_varargs='$i_varargs'
22016 i_varhdr='$i_varhdr'
22018 ignore_versioned_solibs='$ignore_versioned_solibs'
22019 inc_version_list='$inc_version_list'
22020 inc_version_list_init='$inc_version_list_init'
22023 initialinstalllocation='$initialinstalllocation'
22024 installarchlib='$installarchlib'
22025 installbin='$installbin'
22026 installhtml1dir='$installhtml1dir'
22027 installhtml3dir='$installhtml3dir'
22028 installman1dir='$installman1dir'
22029 installman3dir='$installman3dir'
22030 installprefix='$installprefix'
22031 installprefixexp='$installprefixexp'
22032 installprivlib='$installprivlib'
22033 installscript='$installscript'
22034 installsitearch='$installsitearch'
22035 installsitebin='$installsitebin'
22036 installsitehtml1dir='$installsitehtml1dir'
22037 installsitehtml3dir='$installsitehtml3dir'
22038 installsitelib='$installsitelib'
22039 installsiteman1dir='$installsiteman1dir'
22040 installsiteman3dir='$installsiteman3dir'
22041 installsitescript='$installsitescript'
22042 installstyle='$installstyle'
22043 installusrbinperl='$installusrbinperl'
22044 installvendorarch='$installvendorarch'
22045 installvendorbin='$installvendorbin'
22046 installvendorhtml1dir='$installvendorhtml1dir'
22047 installvendorhtml3dir='$installvendorhtml3dir'
22048 installvendorlib='$installvendorlib'
22049 installvendorman1dir='$installvendorman1dir'
22050 installvendorman3dir='$installvendorman3dir'
22051 installvendorscript='$installvendorscript'
22053 issymlink='$issymlink'
22054 ivdformat='$ivdformat'
22057 known_extensions='$known_extensions'
22060 lddlflags='$lddlflags'
22062 ldflags_uselargefiles='$ldflags_uselargefiles'
22063 ldlibpthname='$ldlibpthname'
22070 libsdirs='$libsdirs'
22071 libsfiles='$libsfiles'
22072 libsfound='$libsfound'
22073 libspath='$libspath'
22074 libswanted='$libswanted'
22075 libswanted_uselargefiles='$libswanted_uselargefiles'
22081 localtime_r_proto='$localtime_r_proto'
22082 locincpth='$locincpth'
22083 loclibpth='$loclibpth'
22084 longdblsize='$longdblsize'
22085 longlongsize='$longlongsize'
22086 longsize='$longsize'
22090 lseeksize='$lseeksize'
22091 lseektype='$lseektype'
22094 madlyobj='$madlyobj'
22095 madlysrc='$madlysrc'
22099 make_set_make='$make_set_make'
22100 mallocobj='$mallocobj'
22101 mallocsrc='$mallocsrc'
22102 malloctype='$malloctype'
22104 man1direxp='$man1direxp'
22107 man3direxp='$man3direxp'
22109 mips_type='$mips_type'
22110 mistrustnm='$mistrustnm'
22112 mmaptype='$mmaptype'
22113 modetype='$modetype'
22115 multiarch='$multiarch'
22117 myarchname='$myarchname'
22118 mydomain='$mydomain'
22119 myhostname='$myhostname'
22122 need_va_copy='$need_va_copy'
22123 netdb_hlen_type='$netdb_hlen_type'
22124 netdb_host_type='$netdb_host_type'
22125 netdb_name_type='$netdb_name_type'
22126 netdb_net_type='$netdb_net_type'
22129 nm_so_opt='$nm_so_opt'
22130 nonxs_ext='$nonxs_ext'
22132 nvEUformat='$nvEUformat'
22133 nvFUformat='$nvFUformat'
22134 nvGUformat='$nvGUformat'
22135 nv_preserves_uv_bits='$nv_preserves_uv_bits'
22136 nveformat='$nveformat'
22137 nvfformat='$nvfformat'
22138 nvgformat='$nvgformat'
22141 o_nonblock='$o_nonblock'
22143 old_pthread_create_joinable='$old_pthread_create_joinable'
22144 optimize='$optimize'
22145 orderlib='$orderlib'
22148 otherlibdirs='$otherlibdirs'
22152 patchlevel='$patchlevel'
22153 path_sep='$path_sep'
22156 perl_patchlevel='$perl_patchlevel'
22157 perladmin='$perladmin'
22158 perllibs='$perllibs'
22159 perlpath='$perlpath'
22161 phostname='$phostname'
22167 prefixexp='$prefixexp'
22169 privlibexp='$privlibexp'
22170 procselfexe='$procselfexe'
22171 prototype='$prototype'
22173 quadkind='$quadkind'
22174 quadtype='$quadtype'
22175 randbits='$randbits'
22176 randfunc='$randfunc'
22177 random_r_proto='$random_r_proto'
22178 randseedtype='$randseedtype'
22180 rd_nodata='$rd_nodata'
22181 readdir64_r_proto='$readdir64_r_proto'
22182 readdir_r_proto='$readdir_r_proto'
22183 revision='$revision'
22188 sPRIEUldbl='$sPRIEUldbl'
22189 sPRIFUldbl='$sPRIFUldbl'
22190 sPRIGUldbl='$sPRIGUldbl'
22191 sPRIXU64='$sPRIXU64'
22193 sPRIeldbl='$sPRIeldbl'
22194 sPRIfldbl='$sPRIfldbl'
22195 sPRIgldbl='$sPRIgldbl'
22200 sSCNfldbl='$sSCNfldbl'
22201 sched_yield='$sched_yield'
22202 scriptdir='$scriptdir'
22203 scriptdirexp='$scriptdirexp'
22205 seedfunc='$seedfunc'
22206 selectminbits='$selectminbits'
22207 selecttype='$selecttype'
22208 sendmail='$sendmail'
22209 setgrent_r_proto='$setgrent_r_proto'
22210 sethostent_r_proto='$sethostent_r_proto'
22211 setlocale_r_proto='$setlocale_r_proto'
22212 setnetent_r_proto='$setnetent_r_proto'
22213 setprotoent_r_proto='$setprotoent_r_proto'
22214 setpwent_r_proto='$setpwent_r_proto'
22215 setservent_r_proto='$setservent_r_proto'
22218 sharpbang='$sharpbang'
22219 shmattype='$shmattype'
22220 shortsize='$shortsize'
22223 sig_count='$sig_count'
22224 sig_name='$sig_name'
22225 sig_name_init='$sig_name_init'
22227 sig_num_init='$sig_num_init'
22228 sig_size='$sig_size'
22229 signal_t='$signal_t'
22230 sitearch='$sitearch'
22231 sitearchexp='$sitearchexp'
22233 sitebinexp='$sitebinexp'
22234 sitehtml1dir='$sitehtml1dir'
22235 sitehtml1direxp='$sitehtml1direxp'
22236 sitehtml3dir='$sitehtml3dir'
22237 sitehtml3direxp='$sitehtml3direxp'
22239 sitelib_stem='$sitelib_stem'
22240 sitelibexp='$sitelibexp'
22241 siteman1dir='$siteman1dir'
22242 siteman1direxp='$siteman1direxp'
22243 siteman3dir='$siteman3dir'
22244 siteman3direxp='$siteman3direxp'
22245 siteprefix='$siteprefix'
22246 siteprefixexp='$siteprefixexp'
22247 sitescript='$sitescript'
22248 sitescriptexp='$sitescriptexp'
22249 sizesize='$sizesize'
22250 sizetype='$sizetype'
22254 sockethdr='$sockethdr'
22255 socketlib='$socketlib'
22256 socksizetype='$socksizetype'
22258 spackage='$spackage'
22259 spitshell='$spitshell'
22260 srand48_r_proto='$srand48_r_proto'
22261 srandom_r_proto='$srandom_r_proto'
22263 ssizetype='$ssizetype'
22264 startperl='$startperl'
22266 static_ext='$static_ext'
22268 stdio_base='$stdio_base'
22269 stdio_bufsiz='$stdio_bufsiz'
22270 stdio_cnt='$stdio_cnt'
22271 stdio_filbuf='$stdio_filbuf'
22272 stdio_ptr='$stdio_ptr'
22273 stdio_stream_array='$stdio_stream_array'
22274 strerror_r_proto='$strerror_r_proto'
22277 subversion='$subversion'
22281 targetarch='$targetarch'
22285 timeincl='$timeincl'
22286 timetype='$timetype'
22287 tmpnam_r_proto='$tmpnam_r_proto'
22293 ttyname_r_proto='$ttyname_r_proto'
22302 uidformat='$uidformat'
22308 uquadtype='$uquadtype'
22309 use5005threads='$use5005threads'
22310 use64bitall='$use64bitall'
22311 use64bitint='$use64bitint'
22312 usecrosscompile='$usecrosscompile'
22314 usefaststdio='$usefaststdio'
22315 useithreads='$useithreads'
22316 uselargefiles='$uselargefiles'
22317 uselongdouble='$uselongdouble'
22318 usemallocwrap='$usemallocwrap'
22319 usemorebits='$usemorebits'
22320 usemultiplicity='$usemultiplicity'
22321 usemymalloc='$usemymalloc'
22323 useopcode='$useopcode'
22324 useperlio='$useperlio'
22325 useposix='$useposix'
22326 usereentrant='$usereentrant'
22327 userelocatableinc='$userelocatableinc'
22329 useshrplib='$useshrplib'
22330 usesitecustomize='$usesitecustomize'
22331 usesocks='$usesocks'
22332 usethreads='$usethreads'
22333 usevendorprefix='$usevendorprefix'
22334 usevfork='$usevfork'
22337 uvXUformat='$uvXUformat'
22338 uvoformat='$uvoformat'
22341 uvuformat='$uvuformat'
22342 uvxformat='$uvxformat'
22343 vendorarch='$vendorarch'
22344 vendorarchexp='$vendorarchexp'
22345 vendorbin='$vendorbin'
22346 vendorbinexp='$vendorbinexp'
22347 vendorhtml1dir='$vendorhtml1dir'
22348 vendorhtml1direxp='$vendorhtml1direxp'
22349 vendorhtml3dir='$vendorhtml3dir'
22350 vendorhtml3direxp='$vendorhtml3direxp'
22351 vendorlib='$vendorlib'
22352 vendorlib_stem='$vendorlib_stem'
22353 vendorlibexp='$vendorlibexp'
22354 vendorman1dir='$vendorman1dir'
22355 vendorman1direxp='$vendorman1direxp'
22356 vendorman3dir='$vendorman3dir'
22357 vendorman3direxp='$vendorman3direxp'
22358 vendorprefix='$vendorprefix'
22359 vendorprefixexp='$vendorprefixexp'
22360 vendorscript='$vendorscript'
22361 vendorscriptexp='$vendorscriptexp'
22363 version_patchlevel_string='$version_patchlevel_string'
22364 versiononly='$versiononly'
22366 voidflags='$voidflags'
22369 yaccflags='$yaccflags'
22374 : Add in command line options if available
22375 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22377 : add special variables
22378 $test -f $src/patchlevel.h && \
22379 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
22380 echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
22381 echo "PERL_CONFIG_SH=true" >>config.sh
22383 : propagate old symbols
22384 if $test -f UU/config.sh; then
22385 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
22386 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
22387 $sort | $uniq -u >UU/oldsyms
22388 set X `cat UU/oldsyms`
22394 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
22396 echo "# Variables propagated from previous config.sh file." >>config.sh
22397 for sym in `cat UU/oldsyms`; do
22398 echo " Propagating $hint variable "'$'"$sym..."
22399 eval 'tmp="$'"${sym}"'"'
22401 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
22407 : Finish up by extracting the .SH files
22411 echo "Extraction done."
22421 If you'd like to make any changes to the config.sh file before I begin
22422 to configure things, do it as a shell escape now (e.g. !vi config.sh).
22425 rp="Press return or use a shell escape to edit config.sh:"
22430 *) : in case they cannot read
22431 sh 1>&4 -c "$ans";;
22436 : if this fails, just run all the .SH files by hand
22445 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
22452 Now you need to generate make dependencies by running "$make depend".
22453 You might prefer to run it in background: "$make depend > makedepend.out &"
22454 It can take a while, so you might not want to run it right now.
22459 rp="Run $make depend now?"
22463 $make depend && echo "Now you must run '$make'."
22466 echo "You must run '$make depend' then '$make'."
22469 elif test -f [Mm]akefile; then
22471 echo "Now you must run a $make."
22473 echo "Configure done."
22476 if $test -f Policy.sh; then
22479 If you compile $package on a different machine or from a different object
22480 directory, copy the Policy.sh file from this object directory to the
22481 new one before you run Configure -- this will help you with most of
22482 the policy defaults.
22486 if $test -f config.msg; then
22487 echo "Hmm. I also noted the following information while running:"
22489 $cat config.msg >&4
22492 $rm -f kit*isdone ark*isdone