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 Mon Nov 6 16:18:02 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=''
420 endhostent_r_proto=''
426 endprotoent_r_proto=''
432 endservent_r_proto=''
484 gethostbyaddr_r_proto=''
486 gethostbyname_r_proto=''
488 gethostent_r_proto=''
500 getnetbyaddr_r_proto=''
502 getnetbyname_r_proto=''
516 d_getprotobyname_r=''
517 getprotobyname_r_proto=''
518 d_getprotobynumber_r=''
519 getprotobynumber_r_proto=''
521 getprotoent_r_proto=''
533 getservbyname_r_proto=''
535 getservbyport_r_proto=''
537 getservent_r_proto=''
561 d_libm_lib_version=''
564 d_localtime_r_needs_tzset=''
575 d_malloc_good_size=''
617 d_old_pthread_create_joinable=''
618 old_pthread_create_joinable=''
620 d_pthread_attr_setscope=''
659 sethostent_r_proto=''
676 setprotoent_r_proto=''
688 setservent_r_proto=''
721 d_sprintf_returns_strlen=''
736 d_stdio_ptr_lval_nochange_cnt=''
737 d_stdio_ptr_lval_sets_cnt=''
940 d_inc_version_list=''
942 inc_version_list_init=''
961 ignore_versioned_solibs=''
1025 d_perl_otherlibdirs=''
1033 api_versionstring=''
1039 version_patchlevel_string=''
1043 d_nv_preserves_uv=''
1044 d_nv_zero_is_allbits_zero=''
1055 nv_preserves_uv_bits=''
1127 installsitehtml1dir=''
1130 installsitehtml3dir=''
1137 installsiteman1dir=''
1140 installsiteman3dir=''
1145 installsitescript=''
1160 d_stdio_stream_array=''
1161 stdio_stream_array=''
1172 ccflags_uselargefiles=''
1173 ldflags_uselargefiles=''
1174 libswanted_uselargefiles=''
1194 installvendorarch=''
1201 installvendorhtml1dir=''
1203 vendorhtml1direxp=''
1204 installvendorhtml3dir=''
1206 vendorhtml3direxp=''
1212 installvendorman1dir=''
1215 installvendorman3dir=''
1222 installvendorscript=''
1234 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1237 : We must find out about Eunice early
1239 if test -f /etc/unixtovms; then
1240 eunicefix=/etc/unixtovms
1242 if test -f /etc/unixtovms.exe; then
1243 eunicefix=/etc/unixtovms.exe
1246 : Set executable suffix now -- needed before hints available
1247 if test -f "/libs/version.library"; then
1250 elif test -f "/system/gnu_library/bin/ar.pm"; then
1253 elif test -n "$DJGPP"; then
1256 elif test -d c:/. -o -n "$is_os2" ; then
1265 : set useposix=false in your hint file to disable the POSIX extension.
1267 : set useopcode=false in your hint file to disable the Opcode extension.
1269 : Trailing extension. Override this in a hint file, if needed.
1270 : Extra object files, if any, needed on this platform.
1273 : Possible local include directories to search.
1274 : Set locincpth to "" in a hint file to defeat local include searches.
1275 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1276 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1278 : no include file wanted by default
1281 : Enable -DEBUGGING and -DDEBUGGING from the command line
1287 : change the next line if compiling for Xenix/286 on Xenix/386
1288 xlibpth='/usr/lib/386 /lib/386'
1289 : Possible local library directories to search.
1290 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1291 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1293 : general looking path for locating libraries
1294 glibpth="/lib /usr/lib $xlibpth"
1295 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1296 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1297 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1299 : Private path used by Configure to find libraries. Its value
1300 : is prepended to libpth. This variable takes care of special
1301 : machines, like the mips. Usually, it should be empty.
1304 : default library list
1306 : some systems want to use only the non-versioned libso:s
1307 ignore_versioned_solibs=''
1312 ccflags_uselargefiles=''
1313 ldflags_uselargefiles=''
1314 libswanted_uselargefiles=''
1315 : set usemultiplicity on the Configure command line to enable multiplicity.
1316 : set usesocks on the Configure command line to enable socks.
1317 : set usethreads on the Configure command line to enable threads.
1318 usereentrant='undef'
1319 : full support for void wanted by default
1322 : List of libraries we want.
1323 : If anyone needs extra -lxxx, put those in a hint file.
1324 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1325 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1326 : We probably want to search /usr/shlib before most other libraries.
1327 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1328 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1329 glibpth="/usr/shlib $glibpth"
1330 : Do not use vfork unless overridden by a hint file.
1333 : Find the basic shell for Bourne shell scripts
1337 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1340 if test -f "$xxx"; then
1343 : Build up a list and do a single loop so we can 'break' out.
1344 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1345 for xxx in sh bash ksh pdksh ash; do
1347 try="$try ${p}/${xxx}"
1351 if test -f "$xxx"; then
1354 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1357 elif test -f "$xxx.exe"; then
1368 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1370 Usually it's in /bin/sh. How did you even get this far?
1371 Please contact me (Perl Maintainers) at perlbug@perl.org and
1372 we'll try to straighten this all out.
1378 : see if sh knows # comments
1379 if `$sh -c '#' >/dev/null 2>&1`; then
1383 test -f $xcat$_exe || xcat=/usr/bin/cat
1384 if test ! -f $xcat$_exe; then
1385 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1386 if test -f $p/cat$_exe; then
1391 if test ! -f $xcat$_exe; then
1392 echo "Can't find cat anywhere!"
1396 echo "#!$xcat" >sharp
1400 if test -s today; then
1403 echo "#! $xcat" > sharp
1407 if test -s today; then
1415 echo "Your $sh doesn't grok # comments--I will strip them later on."
1418 echo "exec grep -v '^[ ]*#'" >spitshell
1420 $eunicefix spitshell
1421 spitshell=`pwd`/spitshell
1423 echo "I presume that if # doesn't work, #! won't work either!"
1428 : figure out how to guarantee sh startup
1430 '') startsh=${sharpbang}${sh} ;;
1442 : echo "Yup, it does."
1444 echo "Hmm... '$startsh' does not guarantee sh startup..."
1445 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1450 : Save command line options in file UU/cmdline.opt for later use in
1451 : generating config.sh.
1452 cat > cmdline.opt <<EOSH
1453 # Configure command line arguments.
1462 cat >>cmdline.opt <<EOSH
1463 config_arg$argn='$arg'
1465 # Extreme backslashitis: replace each ' by '"'"'
1466 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1469 arg_exp=`cat cmdl.opt`
1470 args_exp="$args_exp$args_sep'$arg_exp'"
1471 argn=`expr $argn + 1`
1474 # args_exp is good for restarting self: eval "set X $args_exp"; shift; $0 "$@"
1475 # used by ./hints/os2.sh
1478 : produce awk script to parse command line options
1479 cat >options.awk <<'EOF'
1481 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1483 len = length(optstr);
1484 for (i = 1; i <= len; i++) {
1485 c = substr(optstr, i, 1);
1486 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1497 if (substr(str, 1, 1) != "-") {
1498 printf("'%s'\n", str);
1502 for (i = 2; i <= len; i++) {
1503 c = substr(str, i, 1);
1505 printf("-%s\n", substr(str, i));
1511 printf("'%s'\n", substr(str, i + 1));
1524 : process the command line options
1525 set X `for arg in "$@"; do echo "X$arg"; done |
1526 sed -e s/X// | awk -f options.awk`
1531 : set up default values
1541 rm -f optdef.sh posthint.sh
1542 cat >optdef.sh <<EOS
1548 while test $# -gt 0; do
1550 -d) shift; fastread=yes;;
1551 -e) shift; alldone=cont;;
1555 if test -r "$1"; then
1558 echo "$me: cannot read config file $1." >&2
1563 -h) shift; error=true;;
1564 -r) shift; reuseval=true;;
1565 -s) shift; silent=true; realsilent=true;;
1566 -E) shift; alldone=exit;;
1567 -K) shift; knowitall=true;;
1568 -O) shift; override=true;;
1569 -S) shift; silent=true; extractsh=true;;
1574 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1575 echo "$me: ignoring -D $1" >&2
1578 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1579 *) echo "$1='define'" >> optdef.sh;;
1586 *=) echo "$1" >> optdef.sh;;
1588 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1589 echo "$me: ignoring -U $1" >&2
1591 *) echo "$1='undef'" >> optdef.sh;;
1602 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1606 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1607 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1613 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1614 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1615 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1616 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1617 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1618 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1624 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1626 echo "$yyy=''" >> posthint.sh ;;
1631 echo "$yyy='$zzz'" >> posthint.sh ;;
1633 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1635 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1640 echo "$yyy=$zzz" >> posthint.sh ;;
1641 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1645 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1648 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1656 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1657 [-U symbol] [-U symbol=] [-A command:symbol...]
1658 -d : use defaults for all answers.
1659 -e : go on without questioning past the production of config.sh.
1660 -f : specify an alternate default configuration file.
1661 -h : print this help message and exit (with an error status).
1662 -r : reuse C symbols value if possible (skips costly nm extraction).
1663 -s : silent mode, only echoes questions and essential information.
1664 -D : define symbol to have some value:
1665 -D symbol symbol gets the value 'define'
1666 -D symbol=value symbol gets the value 'value'
1667 -E : stop at the end of questions, after having produced config.sh.
1668 -K : do not use unless you know what you are doing.
1669 -O : let -D and -U override definitions from loaded configuration file.
1670 -S : perform variable substitutions on all .SH files (can mix with -f)
1671 -U : undefine symbol:
1672 -U symbol symbol gets the value 'undef'
1673 -U symbol= symbol gets completely empty
1674 -A : manipulate symbol after the platform specific hints have been applied:
1675 -A symbol=value append " "value to symbol
1676 -A append:symbol=value append value to symbol
1677 -A define:symbol=value define symbol to have value
1678 -A clear:symbol define symbol to be ''
1679 -A define:symbol define symbol to be 'define'
1680 -A eval:symbol=value define symbol to be eval of value
1681 -A prepend:symbol=value prepend value to symbol
1682 -A undef:symbol define symbol to be 'undef'
1683 -A undef:symbol= define symbol to be ''
1684 -V : print version number and exit (with a zero status).
1691 case "$fastread$alldone" in
1694 case "$extractsh" in
1697 if test ! -t 0; then
1698 echo "Say 'sh Configure', not 'sh <Configure'"
1708 true) exec 1>/dev/null;;
1711 : run the defines and the undefines, if any, but leave the file out there...
1714 : create the posthint manipulation script and leave the file out there...
1719 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1720 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1721 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1722 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1723 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1726 : Some greps do not return status, grrr.
1727 echo "grimblepritz" >grimble
1728 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1730 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1736 : the following should work in any shell
1740 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1741 cat >contains <<'EOSS'
1742 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1747 : Find the path to the source tree
1750 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1754 *) src=`cd ../$src && pwd` ;;
1767 if test -f $rsrc/Configure && \
1768 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1770 : found it, so we are ok.
1773 for src in . .. ../.. ../../.. ../../../..; do
1774 if test -f ../$src/Configure && \
1775 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1786 Sorry, I can't seem to locate the source dir for $package. Please start
1787 Configure with an explicit path -- i.e. /some/path/Configure.
1795 echo "Sources for $package found in \"$src\"." >&4
1799 : script used to extract .SH files with variable substitutions
1800 cat >extract <<'EOS'
1802 echo "Doing variable substitutions on .SH files..."
1803 if test -f MANIFEST; then
1804 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1806 echo "(Looking for .SH files under the source directory.)"
1807 set x `(cd "$src"; find . -name "*.SH" -print)`
1811 0) set x `(cd "$src"; echo *.SH)`; shift;;
1813 if test ! -f "$src/$1"; then
1819 while test $name; do
1820 if test ! -d "$name"; then
1821 create="$name $create";
1822 name=`echo $name | sed -e "s|^[^/]*$||"`;
1823 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1828 for file in $create; do
1837 dir=`expr X$file : 'X\(.*\)/'`
1838 file=`expr X$file : 'X.*/\(.*\)'`
1839 (cd "$dir" && . ./$file)
1849 dir=`expr X$file : 'X\(.*\)/'`
1850 file=`expr X$file : 'X.*/\(.*\)'`
1851 (set x $dir; shift; eval $mkdir_p)
1852 sh <"$src/$dir/$file"
1861 if test -f "$src/config_h.SH"; then
1862 if test ! -f config.h; then
1863 : oops, they left it out of MANIFEST, probably, so do it anyway.
1864 . "$src/config_h.SH"
1869 : extract files and exit if asked to do so
1870 case "$extractsh" in
1872 case "$realsilent" in
1876 case "$config_sh" in
1877 '') config_sh='config.sh';;
1880 echo "Fetching answers from $config_sh..."
1883 test "$override" && . ./optdef.sh
1887 echo "Extraction done."
1892 : Eunice requires " " instead of "", can you believe it
1895 echo "Beginning of configuration questions for $package."
1897 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1899 : first determine how to suppress newline on echo command
1901 echo "Checking echo to see how to suppress newlines..."
1902 (echo "hi there\c" ; echo " ") >.echotmp
1903 if $contains c .echotmp >/dev/null 2>&1 ; then
1914 echo $n "The star should be here-->$c"
1918 : Now test for existence of everything in MANIFEST
1920 if test -f "$rsrc/MANIFEST"; then
1921 echo "First let's make sure your kit is complete. Checking..." >&4
1922 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | (split -l 50 2>/dev/null || split -50)
1925 for filelist in x??; do
1926 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` >/dev/null 2>>"$tmppwd/missing")
1928 if test -s missing; then
1932 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1934 You have the option of continuing the configuration process, despite the
1935 distinct possibility that your kit is damaged, by typing 'y'es. If you
1936 do, don't blame me if something goes wrong. I advise you to type 'n'o
1937 and contact the author (perlbug@perl.org).
1940 echo $n "Continue? [n] $c" >&4
1944 echo "Continuing..." >&4
1948 echo "ABORTING..." >&4
1953 echo "Looks good..."
1956 echo "There is no MANIFEST file. I hope your kit is complete !"
1961 : Find the appropriate value for a newline for tr
1962 if test -n "$DJGPP"; then
1965 if test X"$trnl" = X; then
1966 case "`echo foo|tr '\n' x 2>/dev/null`" in
1970 if test X"$trnl" = X; then
1971 case "`echo foo|tr '\012' x 2>/dev/null`" in
1972 foox) trnl='\012' ;;
1975 if test X"$trnl" = X; then
1976 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
1977 fooxy) trnl='\n\r' ;;
1980 if test X"$trnl" = X; then
1983 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1989 : compute the number of columns on the terminal for proper question formatting
1994 : set up the echo used in my read
1995 myecho="case \"\$xxxm\" in
1996 '') echo $n \"\$rp $c\" >&4;;
1998 '') echo $n \"[\$xxxm] $c\";;
2000 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2002 echo $n \"[\$xxxm] $c\" >&4
2004 echo $n \"\$rp [\$xxxm] $c\" >&4
2010 : now set up to do reads with possible shell escape and default assignment
2016 case "\$fastread" in
2017 yes) case "\$dflt" in
2020 case "\$silent-\$rp" in
2025 *) case "\$silent" in
2026 true) case "\$rp" in
2031 while expr "X\$ans" : "X!" >/dev/null; do
2035 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2043 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2052 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2057 echo "(OK, I'll run with -d after this question.)" >&4
2060 echo "*** Sorry, \$1 not supported yet." >&4
2070 echo "*** Substitution done -- please confirm."
2072 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2077 echo "*** Error -- try again."
2084 case "\$ans\$xxxm\$nostick" in
2096 : create .config dir to save info across Configure sessions
2097 test -d ../.config || mkdir ../.config
2098 cat >../.config/README <<EOF
2099 This directory created by Configure to save information that should
2100 persist across sessions for $package.
2102 You may safely delete it if you wish.
2105 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2107 $define|true|[yY]*) ;;
2108 *) case "$xversion" in
2111 *** WHOA THERE!!! ***
2113 This is an UNSTABLE DEVELOPMENT release.
2114 The version of this $package distribution is $xversion, that is, odd,
2115 (as opposed to even) and that signifies a development release.
2116 If you want a maintenance release, you want an even-numbered version.
2118 Do ***NOT*** install this into production use.
2119 Data corruption and crashes are possible.
2121 It is most seriously suggested that you do not continue any further
2122 unless you want to help in developing and debugging Perl.
2124 If you *still* want to build perl, you can answer 'y' now,
2125 or pass -Dusedevel to Configure.
2128 rp='Do you really want to continue?'
2132 [yY]) echo >&4 "Okay, continuing."
2133 usedevel="$define" ;;
2134 *) echo >&4 "Okay, bye."
2144 case "$versiononly" in
2145 '') versiononly="$define" ;;
2147 case "$installusrbinperl" in
2148 '') installusrbinperl="$undef" ;;
2153 : general instructions
2156 user=`(logname) 2>/dev/null`
2158 '') user=`whoami 2>&1`;;
2160 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2163 rp='Would you like to see the instructions?'
2174 This installation shell script will examine your system and ask you questions
2175 to determine how the perl5 package should be installed. If you get
2176 stuck on a question, you may use a ! shell escape to start a subshell or
2177 execute a command. Many of the questions will have default answers in square
2178 brackets; typing carriage return will give you the default.
2180 On some of the questions which ask for file or directory names you are allowed
2181 to use the ~name construct to specify the login directory belonging to "name",
2182 even if you don't have a shell which knows about that. Questions where this is
2183 allowed will be marked "(~name ok)".
2187 dflt='Type carriage return to continue'
2191 The prompter used in this script allows you to use shell variables and
2192 backticks in your answers. You may use $1, $2, etc... to refer to the words
2193 in the default answer, as if the default line was a set of arguments given to a
2194 script shell. This means you may also use $* to repeat the whole default line,
2195 so you do not have to re-type everything to add something to the default.
2197 Everytime there is a substitution, you will have to confirm. If there is an
2198 error (e.g. an unmatched backtick), the default answer will remain unchanged
2199 and you will be prompted again.
2201 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2202 the questions and use the computed defaults (or the previous answers if there
2203 was already a config.sh file). Type 'Configure -h' for a list of options.
2204 You may also start interactively and then answer '& -d' at any prompt to turn
2205 on the non-interactive behaviour for the remainder of the execution.
2211 Much effort has been expended to ensure that this shell script will run on any
2212 Unix system. If despite that it blows up on yours, your best bet is to edit
2213 Configure and run it again. If you can't run Configure for some reason,
2214 you'll have to generate a config.sh file by hand. Whatever problems you
2215 have, let me (perlbug@perl.org) know how I blew it.
2217 This installation script affects things in two ways:
2219 1) it may do direct variable substitutions on some of the files included
2221 2) it builds a config.h file for inclusion in C programs. You may edit
2222 any of these files as the need arises after running this script.
2224 If you make a mistake on a question, there is no easy way to back up to it
2225 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2226 files. Configure will offer to let you do this before it runs the SH files.
2229 dflt='Type carriage return to continue'
2231 case "$firsttime" in
2232 true) echo $user >>../.config/instruct;;
2236 : find out where common programs are
2238 echo "Locating common programs..." >&4
2251 if test -d \$dir/\$thing; then
2257 for thisthing in \$dir/\$thing; do
2258 : just loop through to pick last item
2260 if test -f \$thisthing; then
2263 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2266 elif test -f \$dir/\$thing.exe; then
2267 if test -n "$DJGPP"; then
2268 echo \$dir/\$thing.exe
2269 elif test "$eunicefix" != ":"; then
2270 : on Eunice apparently
2324 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2325 pth="$pth /lib /usr/lib"
2326 for file in $loclist; do
2330 if test -f "$xxx"; then
2333 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2334 xxx=`./loc $file $file $pth`
2337 '') xxx=`./loc $file $file $pth`;;
2338 *) xxx=`./loc $xxx $xxx $pth`;;
2340 eval $file=$xxx$_exe
2344 echo $file is in $xxx.
2347 echo $file is in $xxx.
2350 echo "I don't know where '$file' is, and my life depends on it." >&4
2351 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2357 echo "Don't worry if any of the following aren't found..."
2359 for file in $trylist; do
2363 if test -f "$xxx"; then
2366 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2367 xxx=`./loc $file $file $pth`
2370 '') xxx=`./loc $file $file $pth`;;
2371 *) xxx=`./loc $xxx $xxx $pth`;;
2373 eval $file=$xxx$_exe
2377 echo $file is in $xxx.
2380 echo $file is in $xxx.
2383 echo "I don't see $file out there, $say."
2390 echo "Substituting grep for egrep."
2397 echo "Substituting cp for ln."
2406 echo "I can't find make or gmake, and my life depends on it." >&4
2407 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2415 *) # We can't have osname yet.
2416 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2417 # Assume that gmake, if found, is definitely GNU make
2418 # and prefer it over the system make.
2419 echo "Substituting gmake for make."
2427 echo "Hopefully test is built into your sh."
2430 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2431 echo "Using the test built into your sh."
2439 echo "Hopefully echo is built into your sh."
2444 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2445 $echo $n "hi there$c" >foo1
2446 echo $n "hi there$c" >foo2
2447 if cmp foo1 foo2 >/dev/null 2>&1; then
2448 echo "They are compatible. In fact, they may be identical."
2455 They are not compatible! You are probably running ksh on a non-USG system.
2456 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2457 have echo built in and we may have to run some Bourne shell scripts. That
2458 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2461 $echo $n "The star should be here-->$c"
2471 cat <<'EOSC' >>trygcc
2476 int main(int argc, char *argv[]) {
2480 if $cc -o try $ccflags $ldflags try.c; then
2483 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2489 case "`$cc -v -c try.c 2>&1`" in
2492 if $test X"$trygcc" = Xyes; then
2493 if gcc -o try -c try.c; then
2495 echo "You seem to have a working gcc, though." >&4
2496 rp="Would you like to use it?"
2498 if $test -f myread; then
2501 if $test -f UU/myread; then
2504 echo "Cannot find myread, sorry. Aborting." >&2
2509 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2510 if $test -f usethreads.cbu; then
2513 *** However, any setting of the C compiler flags (e.g. for thread support)
2514 *** has been lost. It may be necessary to pass -Dcc=gcc to Configure
2515 *** (together with e.g. -Dusethreads).
2531 cat <<'EOSC' >>checkcc
2536 int main(int argc, char *argv[]) {
2540 if $cc -o try $ccflags $ldflags try.c; then
2543 if $test X"$despair" = Xyes; then
2544 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2547 You need to find a working C compiler.
2548 Either (purchase and) install the C compiler supplied by your OS vendor,
2549 or for a free C compiler try http://gcc.gnu.org/
2550 I cannot continue any further, aborting.
2559 : determine whether symbolic links are supported
2562 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2563 echo "Symbolic links are supported." >&4
2566 echo "Symbolic links are NOT supported." >&4
2571 : determine whether symbolic links are supported
2575 echo "Checking how to test for symbolic links..." >&4
2577 if $test "X$issymlink" = X; then
2579 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2580 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2582 if test $? = 0; then
2585 echo "Your builtin 'test -h' may be broken." >&4
2588 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2591 if test -f "$p/$test"; then
2600 echo "Trying external '$test -h'." >&4
2601 issymlink="$test -h"
2602 if $test ! -h sym >/dev/null 2>&1; then
2603 echo "External '$test -h' is broken, too." >&4
2611 if $test "X$issymlink" = X; then
2612 if $test -L sym 2>/dev/null; then
2613 issymlink="$test -L"
2614 echo "The builtin '$test -L' worked." >&4
2617 if $test "X$issymlink" != X; then
2618 echo "You can test for symbolic links with '$issymlink'." >&4
2620 echo "I do not know how you can test for symbolic links." >&4
2624 *) echo "No symbolic links, so not testing for their testing..." >&4
2630 case "$mksymlinks" in
2633 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2636 *) case "$lns:$issymlink" in
2637 *"ln"*" -s:"*"test -"?)
2638 echo "Creating the symbolic links..." >&4
2639 echo "(First creating the subdirectories...)" >&4
2641 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2643 test -z "$directory" && break
2647 if test ! -d t/base; then
2648 echo "Failed to create the subdirectories. Aborting." >&4
2651 echo "(Then creating the symlinks...)" >&4
2652 awk '{print $1}' $src/MANIFEST | while true; do
2654 test -z "$filename" && break
2655 if test -f $filename; then
2656 if $issymlink $filename; then
2660 if test -f $filename; then
2661 echo "$filename already exists, not symlinking."
2663 ln -s $src/$filename $filename
2667 if test ! -f t/base/lex.t; then
2668 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2673 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2682 case "$usecrosscompile" in
2684 $echo "Cross-compiling..."
2687 *-*-gcc) # A cross-compiling gcc, probably.
2688 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2690 # leave out ld, choosing it is more complex
2692 ranlib=$targetarch-ranlib
2693 $echo 'extern int foo;' > try.c
2694 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2696 if $test $# -gt 0; then
2698 incpth="`$echo $incpth|$sed 's/^ //'`"
2699 echo "Guessing incpth '$incpth'." >&4
2701 j="`$echo $i|$sed 's,/include$,/lib,'`"
2702 if $test -d $j; then
2706 libpth="`$echo $libpth|$sed 's/^ //'`"
2707 echo "Guessing libpth '$libpth'." >&4
2712 case "$targetarch" in
2713 '') echo "Targetarch not defined." >&4; croak=y ;;
2714 *) echo "Using targetarch $targetarch." >&4 ;;
2717 '') echo "Incpth not defined." >&4; croak=y ;;
2718 *) echo "Using incpth '$incpth'." >&4 ;;
2721 '') echo "Libpth not defined." >&4; croak=y ;;
2722 *) echo "Using libpth '$libpth'." >&4 ;;
2725 '') for i in $incpth; do
2726 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2728 echo "Guessing usrinc $usrinc." >&4
2733 '') echo "Usrinc not defined." >&4; croak=y ;;
2736 *) echo "Using usrinc $usrinc." >&4 ;;
2738 case "$targethost" in
2739 '') echo "Targethost not defined." >&4; croak=y ;;
2740 *) echo "Using targethost $targethost." >&4
2745 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2748 /*) run=$src/Cross/run
2749 targetmkdir=$src/Cross/mkdir
2751 from=$src/Cross/from
2753 *) pwd=`$test -f ../Configure & cd ..; pwd`
2755 targetmkdir=$pwd/Cross/mkdir
2757 from=$pwd/Cross/from
2760 case "$targetrun" in
2761 '') targetrun=ssh ;;
2766 case "$targetfrom" in
2767 '') targetfrom=scp ;;
2771 from=$from-$targetfrom
2772 case "$targetdir" in
2774 echo "Guessing targetdir $targetdir." >&4
2777 case "$targetuser" in
2779 echo "Guessing targetuser $targetuser." >&4
2782 case "$targetfrom" in
2786 case "$targetrun" in
2798 '') cwd=$targetdir ;;
2802 if $test ! -f \$exe.xok; then
2806 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2809 *) echo "Unknown targetrun '$targetrun'" >&4
2813 case "$targetmkdir" in
2815 cat >$targetmkdir <<EOF
2817 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2819 $chmod a+rx $targetmkdir
2821 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2833 $targetmkdir \`dirname \$f\`
2834 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2837 $targetmkdir $targetdir/\`dirname \$f\`
2838 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2851 $mkdir -p $targetdir/\`dirname \$f\`
2852 $cp \$f $targetdir/\$f || exit 1
2855 $targetmkdir $targetdir/\`dirname \$f\`
2856 $cp \$f $targetdir/\$f || exit 1
2863 *) echo "Unknown targetto '$targetto'" >&4
2867 case "$targetfrom" in
2874 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2879 cp) cat >$from <<EOF
2884 cp $targetdir/\$f . || exit 1
2889 *) echo "Unknown targetfrom '$targetfrom'" >&4
2893 if $test ! -f $run; then
2894 echo "Target 'run' script '$run' not found." >&4
2898 if $test ! -f $to; then
2899 echo "Target 'to' script '$to' not found." >&4
2903 if $test ! -f $from; then
2904 echo "Target 'from' script '$from' not found." >&4
2908 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2912 Using '$run' for remote execution,
2913 and '$from' and '$to'
2914 for remote file transfer.
2920 usecrosscompile='undef'
2925 : see whether [:lower:] and [:upper:] are supported character classes
2927 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2929 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2933 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
2934 # (0xd9 and 0xe2), therefore that is a nice testing point.
2935 if test "X$up" = X -o "X$low" = X; then
2936 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
2942 if test "X$up" = X -o "X$low" = X; then
2943 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
2949 if test "X$up" = X -o "X$low" = X; then
2950 case "`echo RS | od -x 2>/dev/null`" in
2952 echo "Hey, this might be EBCDIC." >&4
2953 if test "X$up" = X -o "X$low" = X; then
2954 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2955 rs) up='[A-IJ-RS-Z]'
2960 if test "X$up" = X -o "X$low" = X; then
2961 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2971 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
2973 echo "Using $up and $low to convert case." >&4
2976 echo "I don't know how to translate letters from upper to lower case." >&4
2977 echo "Your tr is not acting any way I know of." >&4
2981 : set up the translation script tr, must be called with ./tr of course
2985 '[A-Z][a-z]') exec $tr '$up' '$low';;
2986 '[a-z][A-Z]') exec $tr '$low' '$up';;
2993 : Try to determine whether config.sh was made on this system
2994 case "$config_sh" in
2996 myuname=`$uname -a 2>/dev/null`
2997 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2998 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2999 # because the A-Z/a-z are not consecutive.
3000 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
3001 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3002 newmyuname="$myuname"
3004 case "$knowitall" in
3006 if test -f ../config.sh; then
3007 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3008 eval "`grep myuname= ../config.sh`"
3010 if test "X$myuname" = "X$newmyuname"; then
3018 : Get old answers from old config file if Configure was run on the
3019 : same system, otherwise use the hints.
3022 if test -f config.sh; then
3024 rp="I see a config.sh file. Shall I use it to set the defaults?"
3027 n*|N*) echo "OK, I'll ignore it."
3028 mv config.sh config.sh.old
3029 myuname="$newmyuname"
3031 *) echo "Fetching default answers from your old config.sh file..." >&4
3039 : Older versions did not always set $sh. Catch re-use of such
3049 if test ! -f config.sh; then
3052 First time through, eh? I have some defaults handy for some systems
3053 that need some extra help getting the Configure answers right:
3056 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3058 : Half the following guesses are probably wrong... If you have better
3059 : tests or hints, please send them to perlbug@perl.org
3060 : The metaconfig authors would also appreciate a copy...
3061 $test -f /irix && osname=irix
3062 $test -f /xenix && osname=sco_xenix
3063 $test -f /dynix && osname=dynix
3064 $test -f /dnix && osname=dnix
3065 $test -f /lynx.os && osname=lynxos
3066 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3067 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3068 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3069 $test -f /bin/mips && /bin/mips && osname=mips
3070 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3071 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3072 $test -d /usr/apollo/bin && osname=apollo
3073 $test -f /etc/saf/_sactab && osname=svr4
3074 $test -d /usr/include/minix && osname=minix
3075 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3076 if $test -d /MachTen -o -d /MachTen_Folder; then
3078 if $test -x /sbin/version; then
3079 osvers=`/sbin/version | $awk '{print $2}' |
3080 $sed -e 's/[A-Za-z]$//'`
3081 elif $test -x /usr/etc/version; then
3082 osvers=`/usr/etc/version | $awk '{print $2}' |
3083 $sed -e 's/[A-Za-z]$//'`
3089 $test -f /sys/posix.dll &&
3090 $test -f /usr/bin/what &&
3091 set X `/usr/bin/what /sys/posix.dll` &&
3092 $test "$3" = UWIN &&
3096 if $test -f $uname; then
3104 umips) osname=umips ;;
3107 [23]100) osname=mips ;;
3108 next*) osname=next ;;
3110 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3111 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3114 elif $test -f /etc/kconfig; then
3116 if test "$lns" = "$ln -s"; then
3118 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3120 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3127 if test -n "$DJGPP"; then
3136 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3138 # oslevel can fail with:
3139 # oslevel: Unable to acquire lock.
3140 *not\ found) osvers="$4"."$3" ;;
3141 '<3240'|'<>3240') osvers=3.2.0 ;;
3142 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3143 '=3250'|'>3250') osvers=3.2.5 ;;
3147 bsd386) osname=bsd386
3150 cygwin*) osname=cygwin
3153 *dc.osx) osname=dcosx
3159 domainos) osname=apollo
3165 dragonfly) osname=dragonfly
3168 dynixptx*) osname=dynixptx
3169 osvers=`echo "$4"|sed 's/^v//'`
3171 freebsd) osname=freebsd
3173 genix) osname=genix ;;
3177 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3193 netbsd*) osname=netbsd
3196 news-os) osvers="$3"
3198 4*) osname=newsos4 ;;
3202 next*) osname=next ;;
3203 nonstop-ux) osname=nonstopux ;;
3204 openbsd) osname=openbsd
3210 POSIX-BC | posix-bc ) osname=posix-bc
3213 powerux | power_ux | powermax_os | powermaxos | \
3214 powerunix | power_unix) osname=powerux
3220 solaris) osname=solaris
3222 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3229 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3233 titanos) osname=titanos
3242 ultrix) osname=ultrix
3245 osf1|mls+) case "$5" in
3248 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3251 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3254 hp*) osname=hp_osf1 ;;
3255 mips) osname=mips_osf1 ;;
3258 # UnixWare 7.1.2 is known as Open UNIX 8
3259 openunix|unixware) osname=svr5
3267 $2) case "$osname" in
3271 : svr4.x or possibly later
3281 if test -f /stand/boot ; then
3282 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3283 if test -n "$INITPROG" -a -f "$INITPROG"; then
3284 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3285 if test -n "$isesix"; then
3293 *) if test -f /etc/systemid; then
3295 set `echo $3 | $sed 's/\./ /g'` $4
3296 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3298 elif $test -f $src/hints/sco_$1_$2.sh; then
3300 elif $test -f $src/hints/sco_$1.sh; then
3305 '') : Still unknown. Probably a generic Sys V.
3314 *) case "$osname" in
3315 '') : Still unknown. Probably a generic BSD.
3323 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3324 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3325 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3328 $rm -f UU/kernel.what
3329 elif test -d c:/. -o -n "$is_os2" ; then
3336 case "$targetarch" in
3339 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3344 : Now look for a hint file osname_osvers, unless one has been
3345 : specified already.
3348 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3349 : Also try without trailing minor version numbers.
3350 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3351 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3352 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3353 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3356 *) case "$osvers" in
3359 *) if $test -f $src/hints/$file.sh ; then
3361 elif $test -f $src/hints/$xfile.sh ; then
3363 elif $test -f $src/hints/$xxfile.sh ; then
3365 elif $test -f $src/hints/$xxxfile.sh ; then
3367 elif $test -f $src/hints/$xxxxfile.sh ; then
3369 elif $test -f "$src/hints/${osname}.sh" ; then
3378 if $test -f Policy.sh ; then
3381 none) dflt="Policy" ;;
3382 *) dflt="Policy $dflt" ;;
3387 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3391 if $test -f Policy.sh ; then
3394 There's also a Policy hint file available, which should make the
3395 site-specific (policy) questions easier to answer.
3402 You may give one or more space-separated answers, or "none" if appropriate.
3403 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3404 previous run of Configure, you may specify it as well as or instead of
3405 OS-specific hints. If hints are provided for your OS, you should use them:
3406 although Perl can probably be built without hints on many platforms, using
3407 hints often improve performance and may enable features that Configure can't
3408 set up on its own. If there are no hints that match your OS, specify "none";
3409 DO NOT give a wrong version or a wrong OS.
3413 rp="Which of these apply, if any?"
3416 for file in $tans; do
3417 if $test X$file = XPolicy -a -f Policy.sh; then
3419 $cat Policy.sh >> UU/config.sh
3420 elif $test -f $src/hints/$file.sh; then
3421 . $src/hints/$file.sh
3422 $cat $src/hints/$file.sh >> UU/config.sh
3423 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3426 : Give one chance to correct a possible typo.
3427 echo "$file.sh does not exist"
3429 rp="hint to use instead?"
3431 for file in $ans; do
3432 if $test -f "$src/hints/$file.sh"; then
3433 . $src/hints/$file.sh
3434 $cat $src/hints/$file.sh >> UU/config.sh
3435 elif $test X$ans = X -o X$ans = Xnone ; then
3438 echo "$file.sh does not exist -- ignored."
3445 : Remember our hint file for later.
3446 if $test -f "$src/hints/$file.sh" ; then
3456 echo "Fetching default answers from $config_sh..." >&4
3460 cp $config_sh config.sh 2>/dev/null
3470 test "$override" && . ./optdef.sh
3472 : Restore computed paths
3473 for file in $loclist $trylist; do
3474 eval $file="\$_$file"
3479 Configure uses the operating system name and version to set some defaults.
3480 The default value is probably right if the name rings a bell. Otherwise,
3481 since spelling matters for me, either accept the default or answer "none"
3488 ''|' '|none) dflt=none ;;
3489 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3492 *) dflt="$osname" ;;
3494 rp="Operating system name?"
3498 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3504 ''|' '|none) dflt=none ;;
3505 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3506 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3508 ''|' ') dflt=none ;;
3513 *) dflt="$osvers" ;;
3515 rp="Operating system version?"
3525 : who configured the system
3526 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3529 cf_by=`(logname) 2>/dev/null`
3532 cf_by=`(whoami) 2>/dev/null`
3534 "") cf_by=unknown ;;
3539 : decide how portable to be. Allow command line overrides.
3540 case "$d_portable" in
3542 *) d_portable="$define" ;;
3545 : set up shell script to do ~ expansion
3551 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3554 if $test -f /bin/csh; then
3555 /bin/csh -f -c "glob \$1"
3560 name=\`$expr x\$1 : '..\([^/]*\)'\`
3561 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3562 if $test ! -d "\$dir"; then
3564 echo "\$me: can't locate home directory for: \$name" >&2
3569 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3585 : now set up to get a file name
3589 cat <<'EOSC' >>getfile
3605 : getfile will accept an answer from the comma-separated list
3606 : enclosed in parentheses even if it does not meet other criteria.
3607 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3608 fn=`echo $fn | sed 's/(.*)//'`
3614 loc_file=`expr $fn : '.*:\(.*\)'`
3615 fn=`expr $fn : '\(.*\):.*'`
3623 */*) fullpath=true;;
3632 *e*) exp_file=true;;
3635 *p*) nopath_ok=true;;
3640 *d*) type='Directory';;
3641 *l*) type='Locate';;
3646 Locate) what='File';;
3651 case "$d_portable" in
3659 while test "$type"; do
3664 true) rp="$rp (~name ok)";;
3667 if test -f UU/getfile.ok && \
3668 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3687 value=`UU/filexp $ans`
3690 if test "$ans" != "$value"; then
3691 echo "(That expands to $value on this system.)"
3705 /*) value="$ansexp" ;;
3706 [a-zA-Z]:/*) value="$ansexp" ;;
3711 echo "I shall only accept a full path name, as in /bin/ls." >&4
3712 echo "Use a ! shell escape if you wish to check pathnames." >&4
3715 echo "Please give a full path name, starting with slash." >&4
3718 echo "Note that using ~name is ok provided it expands well." >&4
3731 for fp in $gfpth; do
3732 if test "X$fp" = X.; then
3737 if test -f "$pf"; then
3739 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3741 echo "($value is not a plain file, but that's ok.)"
3744 if test X"$type" = X; then
3751 for fp in $gfpth; do
3752 if test "X$fp" = X.; then
3757 direxp="$fp/$ansexp"
3759 if test -d "$direxp"; then
3767 if test -d "$ansexp"; then
3768 echo "(Looking for $loc_file in directory $value.)"
3769 value="$value/$loc_file"
3770 ansexp="$ansexp/$loc_file"
3772 if test -f "$ansexp"; then
3775 case "$nopath_ok" in
3776 true) case "$value" in
3778 *) echo "Assuming $value will be in people's path."
3794 if test "$fastread" = yes; then
3799 rp="$what $value doesn't exist. Use that name anyway?"
3818 test "X$gfpthkeep" != Xy && gfpth=""
3821 : determine root of directory hierarchy where package will be installed.
3824 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3827 dflt=`echo "$prefix" | sed 's/.$//'`
3835 By default, $package will be installed in $dflt/bin, manual pages
3836 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3837 installation directories. Typically this is something like /usr/local.
3838 If you wish to have binaries under /usr/bin but other parts of the
3839 installation under /usr/local, that's ok: you will be prompted
3840 separately for each of the installation directories, the prefix being
3841 only used to set the defaults.
3845 rp='Installation prefix to use?'
3853 *) oldprefix="$prefix";;
3862 *) afsroot=$afsroot ;;
3868 $define|true) afs=true ;;
3869 $undef|false) afs=false ;;
3870 *) if test -d $afsroot; then
3878 echo "AFS may be running... I'll be extra cautious then..." >&4
3880 echo "AFS does not seem to be running..." >&4
3883 : determine installation prefix for where package is to be installed.
3887 Since you are running AFS, I need to distinguish the directory in which
3888 files will reside from the directory in which they are installed (and from
3889 which they are presumably copied to the former directory by occult means).
3892 case "$installprefix" in
3893 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
3894 *) dflt="$installprefix";;
3899 In some special cases, particularly when building $package for distribution,
3900 it is convenient to distinguish the directory in which files should be
3901 installed from the directory ($prefix) in which they will
3902 eventually reside. For most users, these two directories are the same.
3905 case "$installprefix" in
3907 *) dflt=$installprefix;;
3911 rp='What installation prefix should I use for installing files?'
3913 installprefix="$ans"
3914 installprefixexp="$ansexp"
3916 : Perform the prefixexp/installprefixexp correction if necessary
3917 cat <<EOS >installprefix
3920 cat <<'EOSC' >>installprefix
3921 : Change installation prefix, if necessary.
3922 if $test X"$prefix" != X"$installprefix"; then
3923 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
3925 eval "install${prefixvar}=\"\$${prefixvar}exp\""
3928 chmod +x installprefix
3929 $eunicefix installprefix
3931 : Set variables such as privlib and privlibexp from the output of ./getfile
3932 : performing the prefixexp/installprefixexp correction if necessary.
3933 cat <<EOS >setprefixvar
3936 cat <<'EOSC' >>setprefixvar
3937 eval "${prefixvar}=\"\$ans\""
3938 eval "${prefixvar}exp=\"\$ansexp\""
3941 chmod +x setprefixvar
3942 $eunicefix setprefixvar
3944 : set up the script used to warn in case of inconsistency
3951 echo "*** WHOA THERE!!! ***" >&4
3952 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
3953 rp=" Keep the $hint value?"
3956 y) td=$was; tu=$was;;
3960 : function used to set $1 to $val
3961 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
3963 $define$undef) . ./whoa; eval "$var=\$td";;
3964 $undef$define) . ./whoa; eval "$var=\$tu";;
3965 *) eval "$var=$val";;
3969 $define|true|[yY]*) dflt='y';;
3974 Perl can be built to use the SOCKS proxy protocol library. To do so,
3975 Configure must be run with -Dusesocks. If you use SOCKS you also need
3976 to use the PerlIO abstraction layer, this will be implicitly selected.
3978 If this doesn't make any sense to you, just accept the default '$dflt'.
3980 rp='Build Perl for SOCKS?'
3983 y|Y) val="$define" ;;
3990 $define|true|[yY]*) useperlio="$define";;
3993 case "$useperlio" in
3994 $define|true|[yY]*|'') dflt='y';;
3999 Previous version of $package used the standard IO mechanisms as
4000 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
4001 alternate IO mechanisms via the PerlIO abstraction layer, but the
4002 stdio mechanism is still available if needed. The abstraction layer
4003 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
4004 Using PerlIO with sfio may cause problems with some extension modules.
4006 If this doesn't make any sense to you, just accept the default '$dflt'.
4008 rp='Use the PerlIO abstraction layer?'
4015 echo "Ok, doing things the stdio way."
4024 case "$useperlio" in
4025 $define|true|[yY]*) ;;
4028 You are using the SOCKS proxy protocol library which means that you
4029 should also use the PerlIO layer. You may be headed for trouble.
4038 case "$usethreads" in
4039 $define|true|[yY]*) dflt='y';;
4040 *) # Catch case where user specified ithreads or 5005threads but
4041 # forgot -Dusethreads (A.D. 4/2002)
4042 case "$useithreads$use5005threads" in
4044 case "$useperlio" in
4045 "$define") dflt='y' ;;
4055 Perl can be built to take advantage of threads on some systems.
4056 To do so, Configure can be run with -Dusethreads.
4058 Note that Perl built with threading support runs slightly slower
4059 and uses more memory than plain Perl. The current implementation
4060 is believed to be stable, but it is fairly new, and so should be
4061 treated with caution.
4063 If this doesn't make any sense to you, just accept the default '$dflt'.
4065 rp='Build a threading Perl?'
4068 y|Y) val="$define" ;;
4074 case "$usethreads" in
4078 Since release 5.6, Perl has had two different threading implementations,
4079 the newer interpreter-based version (ithreads) with one interpreter per
4080 thread, and the older 5.005 version (5005threads).
4081 The 5005threads version is effectively unmaintained and will probably be
4082 removed in Perl 5.10, so there should be no need to build a Perl using it
4083 unless needed for backwards compatibility with some existing 5.005threads
4087 : Default to ithreads unless overridden on command line or with
4090 case "$use5005threads" in
4091 $define|true|[yY]*) dflt='n';;
4093 case "$useithreads" in
4094 $undef|false|[nN]*) dflt='n';;
4096 rp='Use the newer interpreter-based ithreads?'
4099 y|Y) val="$define" ;;
4104 : Now set use5005threads to the opposite value.
4105 case "$useithreads" in
4106 $define) val="$undef" ;;
4113 useithreads="$undef"
4114 use5005threads="$undef"
4118 case "$useithreads$use5005threads" in
4122 You cannot have both the ithreads and the 5.005 threads enabled
4123 at the same time. Disabling the 5.005 threads since they are
4124 much less stable than the ithreads.
4127 use5005threads="$undef"
4131 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
4134 *** To build with ithreads you must also use the PerlIO layer.
4135 *** Cannot continue, aborting.
4141 case "$d_oldpthreads" in
4142 '') : Configure tests would be welcome here. For now, assume undef.
4144 *) val="$d_oldpthreads" ;;
4150 : Look for a hint-file generated 'call-back-unit'. If the
4151 : user has specified that a threading perl is to be built,
4152 : we may need to set or change some other defaults.
4153 if $test -f usethreads.cbu; then
4154 echo "Your platform has some specific hints regarding threaded builds, using them..."
4157 case "$usethreads" in
4158 "$define"|true|[yY]*)
4160 (Your platform does not have any specific hints for threaded builds.
4161 Assuming POSIX threads, then.)
4169 Perl can be built so that multiple Perl interpreters can coexist
4170 within the same Perl executable.
4173 case "$useithreads" in
4176 This multiple interpreter support is required for interpreter-based threads.
4180 *) case "$usemultiplicity" in
4181 $define|true|[yY]*) dflt='y';;
4185 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4186 rp='Build Perl for multiplicity?'
4189 y|Y) val="$define" ;;
4198 case "$usemorebits" in
4199 "$define"|true|[yY]*)
4200 use64bitint="$define"
4201 uselongdouble="$define"
4202 usemorebits="$define"
4204 *) usemorebits="$undef"
4208 : make some quick guesses about what we are up against
4210 $echo $n "Hmm... $c"
4220 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
4221 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
4223 echo "Looks kind of like an OSF/1 system, but we'll see..."
4225 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4226 xxx=`./loc addbib blurfl $pth`
4227 if $test -f $xxx; then
4228 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4232 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4233 echo "Looks kind of like an extended USG system, but we'll see..."
4235 echo "Looks kind of like a USG system, but we'll see..."
4239 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4240 echo "Looks kind of like a BSD system, but we'll see..."
4244 echo "Looks kind of like a Version 7 system, but we'll see..."
4247 case "$eunicefix" in
4250 There is, however, a strange, musty smell in the air that reminds me of
4251 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4255 : it so happens the Eunice I know will not run shell scripts in Unix format
4259 echo "Congratulations. You aren't running Eunice."
4263 : Detect OS2. The p_ variable is set above in the Head.U unit.
4264 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4265 : semicolon as a patch separator
4270 I have the feeling something is not exactly right, however...don't tell me...
4271 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4272 (Or you may be running DOS with DJGPP.)
4277 if test -f /xenix; then
4278 echo "Actually, this looks more like a XENIX system..."
4283 echo "It's not Xenix..."
4288 if test -f /venix; then
4289 echo "Actually, this looks more like a VENIX system..."
4296 echo "Nor is it Venix..."
4299 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4300 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4307 rp="Use which C compiler?"
4311 : See if they have not cc but they do have gcc
4313 : Look for a hint-file generated 'call-back-unit'. Now that the
4314 : user has specified the compiler, we may need to set or change some
4316 if $test -f cc.cbu; then
4322 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4326 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4328 printf("%s\n", __VERSION__);
4330 printf("%s\n", "1");
4336 if $cc -o try $ccflags $ldflags try.c; then
4337 gccversion=`$run ./try`
4338 case "$gccversion" in
4339 '') echo "You are not using GNU cc." ;;
4340 *) echo "You are using GNU cc $gccversion."
4346 echo "*** WHOA THERE!!! ***" >&4
4347 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4348 case "$knowitall" in
4350 echo " You'd better start hunting for one and let me know about it." >&4
4356 case "$gccversion" in
4357 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4359 case "$gccversion" in
4360 '') gccosandvers='' ;;
4361 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4362 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4364 case "$gccosandvers" in
4365 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4366 $osname$osvers) ;; # looking good
4367 $osname*) cat <<EOM >&4
4369 *** WHOA THERE!!! ***
4371 Your gcc has not been compiled for the exact release of
4372 your operating system ($gccosandvers versus $osname$osvers).
4374 In general it is a good idea to keep gcc synchronized with
4375 the operating system because otherwise serious problems
4376 may ensue when trying to compile software, like Perl.
4378 I'm trying to be optimistic here, though, and will continue.
4379 If later during the configuration and build icky compilation
4380 problems appear (headerfile conflicts being the most common
4381 manifestation), I suggest reinstalling the gcc to match
4382 your operating system release.
4386 *) gccosandvers='' ;; # failed to parse, better be silent
4394 # gcc 3.* complain about adding -Idirectories that they already know about,
4395 # so we will take those off from locincpth.
4396 case "$gccversion" in
4398 echo "main(){}">try.c
4399 for incdir in $locincpth; do
4400 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4401 grep '^c[cp]p*[01]: warning: changing search order '`
4402 if test "X$warn" != X; then
4403 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4409 : What should the include directory be ?
4411 $echo $n "Hmm... $c"
4415 if $test -f /bin/mips && /bin/mips; then
4416 echo "Looks like a MIPS system..."
4417 $cat >usr.c <<'EOCP'
4418 #ifdef SYSTYPE_BSD43
4422 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4423 dflt='/bsd43/usr/include'
4427 mips_type='System V'
4429 $rm -f usr.c usr.out
4430 echo "and you're compiling with the $mips_type compiler and libraries."
4434 echo "Doesn't look like a MIPS system."
4444 case "$xxx_prompt" in
4447 rp='Where are the include files you want to use?'
4455 : see how we invoke the C preprocessor
4457 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4458 cat <<'EOT' >testcpp.c
4464 if test ! -f cppstdin; then
4465 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4466 # AIX cc -E doesn't show the absolute headerfile
4467 # locations but we'll cheat by using the -M flag.
4468 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
4470 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4473 echo "Keeping your $hint cppstdin wrapper."
4476 wrapper=`pwd`/cppstdin
4480 if $test "X$cppstdin" != "X" && \
4481 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4482 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4484 echo "You used to use $cppstdin $cppminus so we'll use that again."
4486 '') echo "But let's see if we can live without a wrapper..." ;;
4488 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4489 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4491 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4494 echo "(However, $cpprun $cpplast does not work, let's see...)"
4502 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4509 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4510 $cc -E <testcpp.c >testcpp.out 2>&1; \
4511 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4512 echo "Yup, it does."
4515 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4516 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4517 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4518 echo "Yup, it does."
4521 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4522 $cc -P <testcpp.c >testcpp.out 2>&1; \
4523 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4524 echo "Yipee, that works!"
4527 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4528 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4529 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4530 echo "At long last!"
4533 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4534 $cpp <testcpp.c >testcpp.out 2>&1; \
4535 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4539 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4540 $cpp - <testcpp.c >testcpp.out 2>&1; \
4541 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4542 echo "Hooray, it works! I was beginning to wonder."
4545 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4546 $wrapper <testcpp.c >testcpp.out 2>&1; \
4547 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4553 rp="No dice. I can't find a C preprocessor. Name one:"
4557 $x_cpp <testcpp.c >testcpp.out 2>&1
4558 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4559 echo "OK, that will do." >&4
4561 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4576 echo "Perhaps can we force $cc -E using a wrapper..."
4577 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4578 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4584 echo "Nope, we'll have to live without it..."
4598 "$wrapper"|'cppstdin') ;;
4599 *) $rm -f $wrapper;;
4601 $rm -f testcpp.c testcpp.out
4603 : Set private lib path
4606 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4611 '') dlist="$loclibpth $plibpth $glibpth";;
4612 *) dlist="$libpth";;
4615 : Now check and see which directories actually exist, avoiding duplicates
4619 if $test -d $xxx; then
4622 *) libpth="$libpth $xxx";;
4628 Some systems have incompatible or broken versions of libraries. Among
4629 the directories listed in the question below, please remove any you
4630 know not to be holding relevant libraries, and add any that are needed.
4631 Say "none" for none.
4642 rp="Directories to use for library searches?"
4649 : compute shared library extension
4652 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4662 On some systems, shared libraries may be available. Answer 'none' if
4663 you want to suppress searching of shared libraries for the remainder
4664 of this configuration.
4667 rp='What is the file extension used for shared libraries?'
4671 : Define several unixisms.
4672 : Hints files or command line option can be used to override them.
4673 : The convoluted testing is in case hints files set either the old
4676 '') case "$exe_ext" in
4678 *) _exe="$exe_ext" ;;
4683 '') case "$lib_ext" in
4690 '') case "$obj_ext" in
4697 '') case "$path_sep" in
4708 : Which makefile gets called first. This is used by make depend.
4709 case "$firstmakefile" in
4710 '') firstmakefile='makefile';;
4714 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4717 case "$uselongdouble" in
4718 $define|true|[yY]*) dflt='y';;
4723 Perl can be built to take advantage of long doubles which
4724 (if available) may give more accuracy and range for floating point numbers.
4726 If this doesn't make any sense to you, just accept the default '$dflt'.
4728 rp='Try to use long doubles if available?'
4731 y|Y) val="$define" ;;
4737 case "$uselongdouble" in
4738 true|[yY]*) uselongdouble="$define" ;;
4741 : Look for a hint-file generated 'call-back-unit'. If the
4742 : user has specified that long doubles should be used,
4743 : we may need to set or change some other defaults.
4744 if $test -f uselongdouble.cbu; then
4745 echo "Your platform has some specific hints regarding long doubles, using them..."
4746 . ./uselongdouble.cbu
4748 case "$uselongdouble" in
4751 (Your platform does not have any specific hints for long doubles.)
4757 : Looking for optional libraries
4759 echo "Checking for optional libraries..." >&4
4764 case "$libswanted" in
4765 '') libswanted='c_s';;
4768 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4774 for thisdir in $libpth $xlibpth; do
4775 test -d $thisdir && libspath="$libspath $thisdir"
4777 for thislib in $libswanted; do
4778 for thisdir in $libspath; do
4780 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4781 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4782 $test -f "$xxx" && eval $libscheck
4783 $test -f "$xxx" && libstyle=shared
4785 if test ! -f "$xxx"; then
4786 xxx=$thisdir/lib$thislib.$so
4787 $test -f "$xxx" && eval $libscheck
4788 $test -f "$xxx" && libstyle=shared
4790 if test ! -f "$xxx"; then
4791 xxx=$thisdir/lib$thislib$_a
4792 $test -f "$xxx" && eval $libscheck
4793 $test -f "$xxx" && libstyle=static
4795 if test ! -f "$xxx"; then
4796 xxx=$thisdir/$thislib$_a
4797 $test -f "$xxx" && eval $libscheck
4798 $test -f "$xxx" && libstyle=static
4800 if test ! -f "$xxx"; then
4801 xxx=$thisdir/lib${thislib}_s$_a
4802 $test -f "$xxx" && eval $libscheck
4803 $test -f "$xxx" && libstyle=static
4804 $test -f "$xxx" && thislib=${thislib}_s
4806 if test ! -f "$xxx"; then
4807 xxx=$thisdir/Slib$thislib$_a
4808 $test -f "$xxx" && eval $libscheck
4809 $test -f "$xxx" && libstyle=static
4811 if $test -f "$xxx"; then
4813 shared) echo "Found -l$thislib (shared)." ;;
4814 static) echo "Found -l$thislib." ;;
4815 *) echo "Found -l$thislib ($libstyle)." ;;
4819 *) dflt="$dflt -l$thislib"
4820 libsfound="$libsfound $xxx"
4822 libsfiles="$libsfiles $yyy"
4823 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4824 case " $libsdirs " in
4826 *) libsdirs="$libsdirs $yyy" ;;
4833 if $test ! -f "$xxx"; then
4834 echo "No -l$thislib."
4845 ' '|'') dflt='none';;
4850 In order to compile $package on your machine, a number of libraries
4851 are usually needed. Include any other special libraries here as well.
4852 Say "none" for none. The default list is almost always right.
4856 rp="What libraries to use?"
4863 : determine optimization, if desired, or use for debug flag also
4865 ' '|$undef) dflt='none';;
4867 *) dflt="$optimize";;
4871 By default, $package compiles with the -O flag to use the optimizer.
4872 Alternately, you might want to use the symbolic debugger, which uses
4873 the -g flag (on traditional Unix systems). Either flag can be
4874 specified here. To use neither flag, specify the word "none".
4877 rp="What optimizer/debugger flag should be used?"
4881 'none') optimize=" ";;
4884 : Check what DEBUGGING is required from the command line
4885 : -DEBUGGING or -DDEBUGGING or
4886 : -DEBUGGING=both = -g + -DDEBUGGING
4887 : -DEBUGGING=-g or -Doptimize=-g = -g
4888 : -DEBUGGING=none or -UDEBUGGING =
4889 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
4892 *) DEBUGGING=$EBUGGING ;;
4895 case "$DEBUGGING" in
4899 *) optimize="$optimize -g" ;;
4903 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
4911 case "$DEBUGGING" in
4912 both|$define) dflt='-DDEBUGGING'
4915 : We will not override a previous value, but we might want to
4916 : augment a hint file
4918 default|recommended)
4919 case "$gccversion" in
4920 1*) dflt="$dflt -fpcc-struct-return" ;;
4922 case "$optimize:$DEBUGGING" in
4923 *-g*:old) dflt="$dflt -DDEBUGGING";;
4925 case "$gccversion" in
4926 2*) if test -d /etc/conf/kconfig.d &&
4927 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4929 # Interactive Systems (ISC) POSIX mode.
4934 case "$gccversion" in
4938 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
4939 echo 'int main(void) { return 0; }' > gcctest.c
4940 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
4941 echo "Yes, it does." 2>&1
4944 echo "Leaving current flags $ccflags alone." 2>&1
4946 *) dflt="$dflt -fno-strict-aliasing" ;;
4949 echo "Nope, it doesn't, but that's ok." 2>&1
4953 # For gcc, adding -pipe speeds up compilations for some, but apparently
4954 # some assemblers can't read from stdin. (It also slows down compilations
4955 # in other cases, but those are apparently rarer these days.) AD 5/2004.
4956 case "$gccversion" in
4958 echo "Checking if your compiler accepts -pipe" 2>&1
4959 echo 'int main(void) { return 0; }' > gcctest.c
4960 if $cc -pipe -o gcctest gcctest.c; then
4961 echo "Yes, it does." 2>&1
4964 echo "Leaving current flags $ccflags alone." 2>&1
4966 *) dflt="$dflt -pipe" ;;
4969 echo "Nope, it doesn't, but that's ok." 2>&1
4976 case "$mips_type" in
4977 *BSD*|'') inclwanted="$locincpth $usrinc";;
4978 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4980 for thisincl in $inclwanted; do
4981 if $test -d $thisincl; then
4982 if $test x$thisincl != x$usrinc; then
4984 *" -I$thisincl "*);;
4985 *) dflt="$dflt -I$thisincl ";;
4991 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4993 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5001 *) dflt="$dflt -D$2";;
5005 set signal.h LANGUAGE_C; eval $inctest
5009 ccflags="$ccflags -DSOCKS"
5014 default|recommended) dflt="$ccflags $dflt" ;;
5015 *) dflt="$ccflags";;
5024 Your C compiler may want other flags. For this question you should include
5025 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5026 but you should NOT include libraries or ld flags like -lwhatever. If you
5027 want $package to honor its debug switch, you should include -DDEBUGGING here.
5028 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5030 To use no flags, specify the word "none".
5036 rp="Any additional cc flags?"
5043 : the following weeds options from ccflags that are of no interest to cpp
5045 '') cppflags="$ccflags" ;;
5046 *) cppflags="$cppflags $ccflags" ;;
5048 case "$gccversion" in
5049 1*) cppflags="$cppflags -D__GNUC__"
5051 case "$mips_type" in
5053 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5059 echo "Let me guess what the preprocessor flags are..." >&4
5073 *) ftry="$previous $flag";;
5075 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5076 >cpp1.out 2>/dev/null && \
5077 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5078 >cpp2.out 2>/dev/null && \
5079 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5080 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5082 cppflags="$cppflags $ftry"
5092 *-*) echo "They appear to be: $cppflags";;
5094 $rm -f cpp.c cpp?.out
5098 : flags used in final linking phase
5100 '') if ./venix; then
5106 *-posix*) dflt="$dflt -posix" ;;
5109 *) dflt="$ldflags";;
5112 : Try to guess additional flags to pick up local libraries.
5113 for thislibdir in $libpth; do
5114 case " $loclibpth " in
5117 *"-L$thislibdir "*) ;;
5118 *) dflt="$dflt -L$thislibdir" ;;
5130 Your C linker may need flags. For this question you should
5131 include -L/whatever and any other flags used by the C linker, but you
5132 should NOT include libraries like -lwhatever.
5134 Make sure you include the appropriate -L/path flags if your C linker
5135 does not normally search all of the directories you specified above,
5138 To use no flags, specify the word "none".
5142 rp="Any additional ld flags (NOT including libraries)?"
5148 rmlist="$rmlist pdp11"
5152 echo "Checking your choice of C compiler and flags for coherency..." >&4
5153 $cat > try.c <<'EOF'
5155 int main() { printf("Ok\n"); return(0); }
5157 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5159 $cat >try.msg <<'EOM'
5160 I've tried to compile and run the following simple program:
5163 $cat try.c >> try.msg
5165 $cat >> try.msg <<EOM
5172 and I got the following output:
5176 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5177 if $sh -c "$run ./try" >>try.msg 2>&1; then
5181 *) echo 'The program compiled OK, but produced no output.' >> try.msg
5184 cat >> try.msg <<'EOQS'
5185 If $libs contains -lsfio, and sfio is mis-configured, then it
5186 sometimes (apparently) runs and exits with a 0 status, but with no
5187 output! It may have to do with sfio's use of _exit vs. exit.
5190 rp="You have a big problem. Shall I abort Configure"
5197 echo "The program compiled OK, but exited with status $?." >>try.msg
5198 rp="You have a problem. Shall I abort Configure"
5202 echo "I can't compile the test program." >>try.msg
5203 rp="You have a BIG problem. Shall I abort Configure"
5209 case "$knowitall" in
5211 echo "(The supplied flags or libraries might be incorrect.)"
5219 *) echo "Ok. Stopping Configure." >&4
5224 n) echo "OK, that should do.";;
5226 $rm -f try try.* core
5228 : define a shorthand compile call
5232 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5233 : define a shorthand compile call for compilations that should be ok.
5237 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5239 : determine filename position in cpp output
5241 echo "Computing filename position in cpp output for #include directives..." >&4
5243 vos) testaccess=-e ;;
5246 echo '#include <stdio.h>' > foo.c
5249 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5250 $grep '^[ ]*#.*stdio\.h' | \
5251 while read cline; do
5254 while $test \$# -gt 0; do
5255 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5260 pos=\`expr \$pos + 1\`
5272 *) pos="${fieldn}th";;
5274 echo "Your cpp writes the filename in the $pos field of the line."
5277 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5278 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5281 : locate header file
5286 for usrincdir in $usrinc
5288 if test -f \$usrincdir/\$wanted; then
5289 echo "\$usrincdir/\$wanted"
5293 awkprg='{ print \$$fieldn }'
5294 echo "#include <\$wanted>" > foo\$\$.c
5295 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5296 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5297 while read cline; do
5298 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5300 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5301 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5306 # status = 0: grep returned 0 lines, case statement not executed
5307 # status = 1: headerfile found
5308 # status = 2: while loop executed, no headerfile found
5312 if test \$status -eq 1; then
5319 : define an alternate in-header-list? function
5320 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5321 cont=true; xxf="echo \"<\$1> found.\" >&4";
5322 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5323 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5325 case $# in 4) instead=instead;; *) instead="at last";; esac;
5326 while $test "$cont"; do
5328 var=$2; eval "was=\$$2";
5329 if $test "$xxx" && $test -r "$xxx";
5331 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5334 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5335 set $yyy; shift; shift; yyy=$@;
5336 case $# in 0) cont="";;
5337 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5338 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5339 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5340 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5344 do set $yyy; var=$2; eval "was=\$$2";
5345 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5346 set $yyy; shift; shift; yyy=$@;
5349 : see if stdlib is available
5350 set stdlib.h i_stdlib
5353 : check for lengths of integral types
5357 echo "Checking to see how big your integers are..." >&4
5366 printf("intsize=%d;\n", (int)sizeof(int));
5367 printf("longsize=%d;\n", (int)sizeof(long));
5368 printf("shortsize=%d;\n", (int)sizeof(short));
5373 if eval $compile_ok && $run ./try > /dev/null; then
5375 echo "Your integers are $intsize bytes long."
5376 echo "Your long integers are $longsize bytes long."
5377 echo "Your short integers are $shortsize bytes long."
5381 Help! I can't compile and run the intsize test program: please enlighten me!
5382 (This is probably a misconfiguration in your system or libraries, and
5383 you really ought to fix it. Still, I'll try anyway.)
5387 rp="What is the size of an integer (in bytes)?"
5391 rp="What is the size of a long integer (in bytes)?"
5395 rp="What is the size of a short integer (in bytes)?"
5403 : check for long long
5405 echo "Checking to see if you have long long..." >&4
5406 echo 'int main() { long long x = 7; return 0; }' > try.c
5408 if eval $compile; then
5410 echo "You have long long."
5413 echo "You do not have long long."
5419 : check for length of long long
5420 case "${d_longlong}${longlongsize}" in
5423 echo "Checking to see how big your long longs are..." >&4
5424 $cat >try.c <<'EOCP'
5428 printf("%d\n", (int)sizeof(long long));
5433 if eval $compile_ok; then
5434 longlongsize=`$run ./try`
5435 echo "Your long longs are $longlongsize bytes long."
5439 echo "(I can't seem to compile the test program. Guessing...)"
5440 rp="What is the size of a long long (in bytes)?"
5444 if $test "X$longsize" = "X$longlongsize"; then
5445 echo "(That isn't any different from an ordinary long.)"
5451 : see if inttypes.h is available
5452 : we want a real compile instead of Inhdr because some systems
5453 : have an inttypes.h which includes non-existent headers
5456 #include <inttypes.h>
5458 static int32_t foo32 = 0x12345678;
5462 if eval $compile; then
5463 echo "<inttypes.h> found." >&4
5466 echo "<inttypes.h> NOT found." >&4
5475 echo "Checking to see if you have int64_t..." >&4
5477 #include <sys/types.h>
5478 #$i_inttypes I_INTTYPES
5480 #include <inttypes.h>
5482 int main() { int64_t x = 7; }
5485 if eval $compile; then
5487 echo "You have int64_t."
5490 echo "You do not have int64_t."
5498 echo "Checking which 64-bit integer type we could use..." >&4
5504 val='"unsigned int"'
5509 *) case "$longsize" in
5513 val='"unsigned long"'
5518 *) case "$d_longlong:$longlongsize" in
5523 val='"unsigned long long"'
5528 *) case "$d_int64_t" in
5547 '') echo "Alas, no 64-bit integer types in sight." >&4
5550 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5556 case "$uselonglong" in
5557 "$define"|true|[yY]*)
5560 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5562 use64bitint="$define"
5565 case "$use64bits" in
5566 "$define"|true|[yY]*)
5569 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5571 use64bitint="$define"
5574 case "$use64bitints" in
5575 "$define"|true|[yY]*)
5578 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5580 use64bitint="$define"
5583 case "$use64bitsint" in
5584 "$define"|true|[yY]*)
5587 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5589 use64bitint="$define"
5592 case "$uselonglongs" in
5593 "$define"|true|[yY]*)
5596 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5598 use64bitint="$define"
5601 case "$use64bitsall" in
5602 "$define"|true|[yY]*)
5605 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5607 use64bitall="$define"
5612 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5614 case "$use64bitall" in
5615 "$define"|true|[yY]*) use64bitint="$define" ;;
5621 You have natively 64-bit long integers.
5625 *) case "$use64bitint" in
5626 "$define"|true|[yY]*) dflt='y';;
5635 Perl can be built to take advantage of 64-bit integer types
5636 on some systems. To do so, Configure can be run with -Duse64bitint.
5637 Choosing this option will most probably introduce binary incompatibilities.
5639 If this doesn't make any sense to you, just accept the default '$dflt'.
5640 (The default has been chosen based on your configuration.)
5642 rp='Try to use 64-bit integers, if available?'
5645 [yY]*) val="$define" ;;
5653 case "$use64bitall" in
5654 "$define"|true|[yY]*) dflt='y' ;;
5655 *) case "$longsize" in
5663 You may also choose to try maximal 64-bitness. It means using as much
5664 64-bitness as possible on the platform. This in turn means even more
5665 binary incompatibilities. On the other hand, your platform may not
5666 have any more 64-bitness available than what you already have chosen.
5668 If this doesn't make any sense to you, just accept the default '$dflt'.
5669 (The default has been chosen based on your configuration.)
5671 rp='Try to use maximal 64-bit support, if available?'
5674 [yY]*) val="$define" ;;
5679 case "$use64bitall" in
5681 case "$use64bitint" in
5685 Since you have chosen a maximally 64-bit build, I'm also turning on
5686 the use of 64-bit integers.
5688 use64bitint="$define" ;;
5693 : Look for a hint-file generated 'call-back-unit'. If the
5694 : user has specified that a 64-bit perl is to be built,
5695 : we may need to set or change some other defaults.
5696 if $test -f use64bitint.cbu; then
5697 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5700 case "$use64bitint" in
5701 "$define"|true|[yY]*)
5703 4) case "$archname64" in
5704 '') archname64=64int ;;
5711 : Look for a hint-file generated 'call-back-unit'. If the
5712 : user has specified that a maximally 64-bit perl is to be built,
5713 : we may need to set or change some other defaults.
5714 if $test -f use64bitall.cbu; then
5715 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5718 case "$use64bitall" in
5719 "$define"|true|[yY]*)
5721 4) case "$archname64" in
5722 ''|64int) archname64=64all ;;
5729 case "$d_quad:$use64bitint" in
5733 *** You have chosen to use 64-bit integers,
5734 *** but none can be found.
5735 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5736 *** Cannot continue, aborting.
5743 : check for length of double
5745 case "$doublesize" in
5747 echo "Checking to see how big your double precision numbers are..." >&4
5756 printf("%d\n", (int)sizeof(double));
5761 if eval $compile_ok; then
5762 doublesize=`$run ./try`
5763 echo "Your double is $doublesize bytes long."
5766 echo "(I can't seem to compile the test program. Guessing...)"
5767 rp="What is the size of a double precision number (in bytes)?"
5775 : check for long doubles
5777 echo "Checking to see if you have long double..." >&4
5778 echo 'int main() { long double x = 7.0; }' > try.c
5780 if eval $compile; then
5782 echo "You have long double."
5785 echo "You do not have long double."
5791 : check for length of long double
5792 case "${d_longdbl}${longdblsize}" in
5795 echo "Checking to see how big your long doubles are..." >&4
5796 $cat >try.c <<'EOCP'
5800 printf("%d\n", sizeof(long double));
5805 if eval $compile; then
5806 longdblsize=`$run ./try`
5807 echo "Your long doubles are $longdblsize bytes long."
5811 echo "(I can't seem to compile the test program. Guessing...)" >&4
5812 rp="What is the size of a long double (in bytes)?"
5816 if $test "X$doublesize" = "X$longdblsize"; then
5817 echo "That isn't any different from an ordinary double."
5818 echo "I'll keep your setting anyway, but you may see some"
5819 echo "harmless compilation warnings."
5825 : determine the architecture name
5827 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5828 tarch=`arch`"-$osname"
5829 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5830 if uname -m > tmparch 2>&1 ; then
5831 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5832 -e 's/$/'"-$osname/" tmparch`
5840 case "$myarchname" in
5843 echo "(Your architecture name used to be $myarchname.)"
5847 case "$targetarch" in
5849 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
5854 *) dflt="$archname";;
5856 rp='What is your architecture name'
5859 case "$usethreads" in
5861 echo "Threads selected." >&4
5863 *-thread*) echo "...and architecture name already has -thread." >&4
5865 *) archname="$archname-thread"
5866 echo "...setting architecture name to $archname." >&4
5871 case "$usemultiplicity" in
5873 echo "Multiplicity selected." >&4
5875 *-multi*) echo "...and architecture name already has -multi." >&4
5877 *) archname="$archname-multi"
5878 echo "...setting architecture name to $archname." >&4
5883 case "$use64bitint$use64bitall" in
5885 case "$archname64" in
5887 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
5890 case "$use64bitint" in
5891 "$define") echo "64 bit integers selected." >&4 ;;
5893 case "$use64bitall" in
5894 "$define") echo "Maximal 64 bitness selected." >&4 ;;
5897 *-$archname64*) echo "...and architecture name already has $archname64." >&4
5899 *) archname="$archname-$archname64"
5900 echo "...setting architecture name to $archname." >&4
5906 case "$uselongdouble" in
5908 echo "Long doubles selected." >&4
5909 case "$longdblsize" in
5911 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
5915 *-ld*) echo "...and architecture name already has -ld." >&4
5917 *) archname="$archname-ld"
5918 echo "...setting architecture name to $archname." >&4
5925 case "$useperlio" in
5927 echo "Perlio selected." >&4
5930 echo "Perlio not selected, using stdio." >&4
5932 *-stdio*) echo "...and architecture name already has -stdio." >&4
5934 *) archname="$archname-stdio"
5935 echo "...setting architecture name to $archname." >&4
5940 if $test -f archname.cbu; then
5941 echo "Your platform has some specific hints for architecture name, using them..."
5945 : set the prefixit variable, to compute a suitable default value
5946 prefixit='case "$3" in
5948 case "$oldprefix" in
5949 "") eval "$1=\"\$$2\"";;
5956 ""|" ") eval "$1=\"\$$2\"";;
5962 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
5964 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
5965 /*-$oldprefix/*|\~*-$oldprefix/*)
5966 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
5967 *) eval "$1=\"\$$2\"";;
5971 : get the patchlevel
5973 echo "Getting the current patchlevel..." >&4
5974 if $test -r $rsrc/patchlevel.h;then
5975 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
5976 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
5977 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5978 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
5979 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
5980 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5981 perl_patchlevel=`egrep 'define PERL_PATCHNUM [0-9][0-9]|,"MAINT[0-9][0-9]*"' $rsrc/patchlevel.h|sed 's/[^0-9]//g'`
5990 $echo "(You do not have patchlevel.h. Eek.)"
5992 if $test -r $rsrc/.patch ; then
5993 if $test "X$perl_patchlevel" = "X" || $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
5994 perl_patchlevel=`cat $rsrc/.patch`
5997 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
5998 version_patchlevel_string="version $patchlevel subversion $subversion"
5999 case "$perl_patchlevel" in
6001 *) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;;
6004 $echo "(You have $package $version_patchlevel_string.)"
6008 : XXX Should be a Configure test for double-dots in filenames.
6009 version=`echo $revision $patchlevel $subversion | \
6010 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
6011 api_versionstring=`echo $api_revision $api_version $api_subversion | \
6012 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
6015 version=`echo $revision $patchlevel $subversion | \
6016 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
6017 api_versionstring=`echo $api_revision $api_version $api_subversion | \
6018 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
6021 : Special case the 5.005_xx maintenance series, which used 5.005
6022 : without any subversion label as a subdirectory in $sitelib
6023 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
6024 api_versionstring='5.005'
6027 : determine installation style
6028 : For now, try to deduce it from prefix unless it is already set.
6029 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6030 case "$installstyle" in
6031 '') case "$prefix" in
6032 *perl*) dflt='lib';;
6033 *) dflt='lib/perl5' ;;
6036 *) dflt="$installstyle" ;;
6038 : Probably not worth prompting for this since we prompt for all
6039 : the directories individually, and the prompt would be too long and
6043 : determine where public executables go
6048 rp='Pathname where the public executables will reside?'
6050 if $test "X$ansexp" != "X$binexp"; then
6054 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6055 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
6056 : this via initialinstalllocation
6059 case "$userelocatableinc" in
6060 $define|true|[yY]*) dflt='y' ;;
6065 Would you like to build Perl so that the installation is relocatable, so that
6066 library paths in @INC are determined relative to the path of the perl binary?
6067 This is not advised for system Perl installs, or if you need to run setid
6068 scripts or scripts under taint mode.
6070 If this doesn't make any sense to you, just accept the default '$dflt'.
6072 rp='Use relocatable @INC?'
6075 y|Y) val="$define" ;;
6078 set userelocatableinc
6081 initialinstalllocation="$binexp"
6082 : Default prefix is now "up one level from where the binaries are"
6083 case "$userelocatableinc" in
6089 installprefixexp=".../.."
6093 : determine where private library files go
6094 : Usual default is /usr/local/lib/perl5/$version.
6095 : Also allow things like /opt/perl/lib/$version, since
6096 : /opt/perl/lib/perl5... would be redundant.
6097 : The default "style" setting is made in installstyle.U
6098 case "$installstyle" in
6099 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6100 *) set dflt privlib lib/$version ;;
6105 There are some auxiliary files for $package that need to be put into a
6106 private library directory that is accessible by everyone.
6111 rp='Pathname where the private library files will reside?'
6116 : set the prefixup variable, to restore leading tilda escape
6117 prefixup='case "$prefixexp" in
6119 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6122 : determine where public architecture dependent libraries go
6125 : privlib default is /usr/local/lib/$package/$version
6126 : archlib default is /usr/local/lib/$package/$version/$archname
6127 : privlib may have an optional trailing /share.
6128 tdflt=`echo $privlib | $sed 's,/share$,,'`
6129 tdflt=$tdflt/$archname
6138 $spackage contains architecture-dependent library files. If you are
6139 sharing libraries in a heterogeneous environment, you might store
6140 these files in a separate location. Otherwise, you can just include
6141 them with the rest of the public library files.
6146 rp='Where do you want to put the public architecture-dependent libraries?'
6150 if $test X"$archlib" = X"$privlib"; then
6156 : see if setuid scripts can be secure
6159 Some kernels have a bug that prevents setuid #! scripts from being
6160 secure. Some sites have disabled setuid #! scripts because of this.
6162 First let's decide if your kernel supports secure setuid #! scripts.
6163 (If setuid #! scripts would be secure but have been disabled anyway,
6164 don't say that they are secure if asked.)
6169 if $test -d /dev/fd; then
6170 echo "#!$ls" >reflect
6171 chmod +x,u+s reflect
6172 ./reflect >flect 2>&1
6173 if $contains "/dev/fd" flect >/dev/null; then
6174 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6178 If you are not sure if they are secure, I can check but I'll need a
6179 username and password different from the one you are using right now.
6180 If you don't have such a username or don't want me to test, simply
6184 rp='Other username to test security of setuid scripts with?'
6189 case "$d_suidsafe" in
6190 '') echo "I'll assume setuid scripts are *not* secure." >&4
6193 echo "Well, the $hint value is *not* secure." >&4
6195 *) echo "Well, the $hint value *is* secure." >&4
6200 $rm -f reflect flect
6201 echo "#!$ls" >reflect
6202 chmod +x,u+s reflect
6205 echo '"su" will (probably) prompt you for '"$ans's password."
6206 su $ans -c './reflect >flect'
6207 if $contains "/dev/fd" flect >/dev/null; then
6208 echo "Okay, it looks like setuid scripts are secure." >&4
6211 echo "I don't think setuid scripts are secure." >&4
6216 rp='Does your kernel have *secure* setuid scripts?'
6219 [yY]*) val="$define";;
6224 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6225 echo "(That's for file descriptors, not floppy disks.)"
6231 $rm -f reflect flect
6233 : now see if they want to do setuid emulation
6236 case "$d_suidsafe" in
6239 echo "No need to emulate SUID scripts since they are secure here." >&4
6243 Some systems have disabled setuid scripts, especially systems where
6244 setuid scripts cannot be secure. On systems where setuid scripts have
6245 been disabled, the setuid/setgid bits on scripts are currently
6246 useless. It is possible for $package to detect those bits and emulate
6247 setuid/setgid in a secure fashion. This emulation will only work if
6248 setuid scripts have been disabled in your kernel.
6252 "$define") dflt=y ;;
6255 rp="Do you want to do setuid/setgid emulation?"
6258 [yY]*) val="$define";;
6266 : Find perl5.005 or later.
6267 echo "Looking for a previously installed perl5.005 or later... "
6269 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6270 : Check if this perl is recent and can load a simple module
6271 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6274 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6284 '') echo "None found. That's ok.";;
6285 *) echo "Using $perl5." ;;
6290 After $package is installed, you may wish to install various
6291 add-on modules and utilities. Typically, these add-ons will
6292 be installed under $prefix with the rest
6293 of this package. However, you may wish to install such add-ons
6294 elsewhere under a different prefix.
6296 If you do not wish to put everything under a single prefix, that's
6297 ok. You will be prompted for the individual locations; this siteprefix
6298 is only used to suggest the defaults.
6300 The default should be fine for most people.
6304 rp='Installation prefix to use for add-on modules and utilities?'
6305 : XXX Here might be another good place for an installstyle setting.
6306 case "$siteprefix" in
6308 *) dflt=$siteprefix ;;
6311 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6313 case "$siteprefix" in
6317 *) oldsiteprefix="$prefix";;
6322 siteprefixexp="$ansexp"
6324 : determine where site specific libraries go.
6325 : Usual default is /usr/local/lib/perl5/site_perl/$version
6326 : The default "style" setting is made in installstyle.U
6327 : XXX No longer works with Prefixit stuff.
6328 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6330 '') case "$installstyle" in
6331 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6332 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6340 The installation process will create a directory for
6341 site-specific extensions and modules. Most users find it convenient
6342 to place all site-specific files in this directory rather than in the
6343 main distribution directory.
6347 rp='Pathname for the site-specific library files?'
6351 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6353 : Determine list of previous versions to include in @INC
6354 $cat > getverlist <<EOPL
6357 \$api_versionstring = "$api_versionstring";
6358 \$version = "$version";
6359 \$stem = "$sitelib_stem";
6360 \$archname = "$archname";
6362 $cat >> getverlist <<'EOPL'
6363 # The list found is store twice for each entry: the original name, and
6364 # the binary broken down version as pack "sss", so sorting is easy and
6365 # unambiguous. This will work for all versions that have a maximum of
6366 # three digit groups, separate by '.'s or '_'s. Names are extended with
6367 # ".0.0" to ensure at least three elements for the pack.
6368 # -- H.Merijn Brand (m)'06 23-10-2006
6370 # Can't have leading @ because metaconfig interprets it as a command!
6371 ;@inc_version_list=();
6372 # XXX Redo to do opendir/readdir?
6375 ;@candidates = map {
6376 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
6382 ($pversion, $aversion, $vsn5005) = map {
6383 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
6384 foreach $d (@candidates) {
6385 if ($d->[1] lt $pversion) {
6386 if ($d->[1] ge $aversion) {
6387 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
6389 elsif ($d->[1] ge $vsn5005) {
6390 unshift(@inc_version_list, grep { -d } $d->[0]);
6394 # Skip newer version. I.e. don't look in
6395 # 5.7.0 if we're installing 5.6.1.
6399 if (@inc_version_list) {
6400 print join(' ', @inc_version_list);
6403 # Blank space to preserve value for next Configure run.
6408 case "$inc_version_list" in
6409 '') if test -x "$perl5$exe_ext"; then
6410 dflt=`$perl5 getverlist`
6415 $undef) dflt='none' ;;
6416 *) eval dflt=\"$inc_version_list\" ;;
6419 ''|' ') dflt=none ;;
6426 In order to ease the process of upgrading, this version of perl
6427 can be configured to use modules built and installed with earlier
6428 versions of perl that were installed under $prefix. Specify here
6429 the list of earlier versions that this version of perl should check.
6430 If Configure detected no earlier versions of perl installed under
6431 $prefix, then the list will be empty. Answer 'none' to tell perl
6432 to not search earlier versions.
6434 The default should almost always be sensible, so if you're not sure,
6435 just accept the default.
6438 rp='List of earlier versions to include in @INC?'
6441 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6442 *) inc_version_list="$ans" ;;
6444 case "$inc_version_list" in
6446 inc_version_list_init='0'
6447 d_inc_version_list="$undef"
6449 *) inc_version_list_init=`echo $inc_version_list |
6450 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6451 d_inc_version_list="$define"
6456 : see if this is a malloc.h system
6457 : we want a real compile instead of Inhdr because some systems have a
6458 : malloc.h that just gives a compile error saying to use stdlib.h instead
6463 int main () { return 0; }
6466 if eval $compile; then
6467 echo "<malloc.h> found." >&4
6470 echo "<malloc.h> NOT found." >&4
6477 : check for void type
6479 echo "Checking to see how well your C compiler groks the void type..." >&4
6480 case "$voidflags" in
6492 extern void moo(); /* function returning void */
6493 void (*goo)(); /* ptr to func returning void */
6495 void *hue; /* generic ptr */
6508 int main() { sub(); }
6510 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6511 voidflags=$defvoidused
6512 echo "Good. It appears to support void to the level $package wants.">&4
6513 if $contains warning .out >/dev/null 2>&1; then
6514 echo "However, you might get some warnings that look like this:"
6518 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6519 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6520 echo "It supports 1..."
6521 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6522 echo "It also supports 2..."
6523 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6525 echo "And it supports 4 but not 8 definitely."
6527 echo "It doesn't support 4..."
6528 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6530 echo "But it supports 8."
6533 echo "Neither does it support 8."
6537 echo "It does not support 2..."
6538 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6540 echo "But it supports 4 and 8."
6542 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6544 echo "And it supports 4 but has not heard about 8."
6546 echo "However it supports 8 but not 4."
6551 echo "There is no support at all for void."
6556 case "$voidflags" in
6559 Support flag bits are:
6560 1: basic void declarations.
6561 2: arrays of pointers to functions returning void.
6562 4: operations between pointers to and addresses of void functions.
6563 8: generic void pointers.
6566 rp="Your void support flags add up to what?"
6573 : check for length of pointer
6577 echo "Checking to see how big your pointers are..." >&4
6578 if test "$voidflags" -gt 7; then
6579 echo '#define VOID_PTR char *' > try.c
6581 echo '#define VOID_PTR void *' > try.c
6591 printf("%d\n", (int)sizeof(VOID_PTR));
6596 if eval $compile_ok; then
6597 ptrsize=`$run ./try`
6598 echo "Your pointers are $ptrsize bytes long."
6601 echo "(I can't seem to compile the test program. Guessing...)" >&4
6602 rp="What is the size of a pointer (in bytes)?"
6609 case "$use64bitall" in
6610 "$define"|true|[yY]*)
6614 *** You have chosen a maximally 64-bit build,
6615 *** but your pointers are only 4 bytes wide.
6616 *** Please rerun Configure without -Duse64bitall.
6621 *** Since you have quads, you could possibly try with -Duse64bitint.
6626 *** Cannot continue, aborting.
6637 : determine whether to use malloc wrapping
6639 case "$usemallocwrap" in
6640 [yY]*|true|$define) dflt='y' ;;
6641 [nN]*|false|$undef) dflt='n' ;;
6642 *) case "$usedevel" in
6643 [yY]*|true|$define) dflt='y' ;;
6648 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6650 usemallocwrap="$ans"
6653 usemallocwrap="$define" ;;
6655 usemallocwrap="$undef" ;;
6658 : determine which malloc to compile in
6660 case "$usemymalloc" in
6661 [yY]*|true|$define) dflt='y' ;;
6662 [nN]*|false|$undef) dflt='n' ;;
6663 *) case "$ptrsize" in
6669 rp="Do you wish to attempt to use the malloc that comes with $package?"
6675 mallocsrc='malloc.c'
6676 mallocobj="malloc$_o"
6677 d_mymalloc="$define"
6680 : Remove malloc from list of libraries to use
6681 echo "Removing unneeded -lmalloc from library list" >&4
6682 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6685 echo "libs = $libs" >&4
6697 : compute the return types of malloc and free
6699 $cat >malloc.c <<END
6703 #include <sys/types.h>
6717 case "$malloctype" in
6719 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6726 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6730 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6737 echo "Your system uses $freetype free(), it would seem." >&4
6739 : determine where site specific architecture-dependent libraries go.
6740 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6741 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6742 : sitelib may have an optional trailing /share.
6744 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6745 dflt="$dflt/$archname"
6750 set sitearch sitearch none
6754 The installation process will also create a directory for
6755 architecture-dependent site-specific extensions and modules.
6759 rp='Pathname for the site-specific architecture-dependent library files?'
6763 if $test X"$sitearch" = X"$sitelib"; then
6766 d_sitearch="$define"
6771 The installation process will also create a directory for
6772 vendor-supplied add-ons. Vendors who supply perl with their system
6773 may find it convenient to place all vendor-supplied files in this
6774 directory rather than in the main distribution directory. This will
6775 ease upgrades between binary-compatible maintenance versions of perl.
6777 Of course you may also use these directories in whatever way you see
6778 fit. For example, you might use them to access modules shared over a
6779 company-wide network.
6781 The default answer should be fine for most people.
6782 This causes further questions about vendor add-ons to be skipped
6783 and no vendor-specific directories will be configured for perl.
6786 rp='Do you want to configure vendor-specific add-on directories?'
6787 case "$usevendorprefix" in
6788 define|true|[yY]*) dflt=y ;;
6789 *) : User may have set vendorprefix directly on Configure command line.
6790 case "$vendorprefix" in
6799 rp='Installation prefix to use for vendor-supplied add-ons?'
6800 case "$vendorprefix" in
6802 *) dflt=$vendorprefix ;;
6805 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6807 case "$vendorprefix" in
6811 *) oldvendorprefix="$prefix";;
6815 usevendorprefix="$define"
6817 vendorprefixexp="$ansexp"
6819 *) usevendorprefix="$undef"
6825 case "$vendorprefix" in
6826 '') d_vendorlib="$undef"
6830 *) d_vendorlib="$define"
6831 : determine where vendor-supplied modules go.
6832 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6833 case "$vendorlib" in
6835 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6836 case "$installstyle" in
6837 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6838 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6841 *) dflt="$vendorlib"
6845 rp='Pathname for the vendor-supplied library files?'
6848 vendorlibexp="$ansexp"
6851 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6855 case "$vendorprefix" in
6856 '') d_vendorarch="$undef"
6860 *) d_vendorarch="$define"
6861 : determine where vendor-supplied architecture-dependent libraries go.
6862 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6863 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6864 : vendorlib may have an optional trailing /share.
6865 case "$vendorarch" in
6866 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6867 dflt="$dflt/$archname"
6869 *) dflt="$vendorarch" ;;
6872 rp='Pathname for vendor-supplied architecture-dependent files?'
6875 vendorarchexp="$ansexp"
6878 prefixvar=vendorarch
6881 : Final catch-all directories to search
6884 Lastly, you can have perl look in other directories for extensions and
6885 modules in addition to those already specified.
6886 These directories will be searched after
6890 test X"$vendorlib" != "X" && echo ' ' $vendorlib
6891 test X"$vendorarch" != "X" && echo ' ' $vendorarch
6893 case "$otherlibdirs" in
6894 ''|' ') dflt='none' ;;
6895 *) dflt="$otherlibdirs" ;;
6898 Enter a colon-separated set of extra paths to include in perl's @INC
6899 search path, or enter 'none' for no extra paths.
6903 rp='Colon-separated list of additional directories for perl to search?'
6906 ' '|''|none) otherlibdirs=' ' ;;
6907 *) otherlibdirs="$ans" ;;
6909 case "$otherlibdirs" in
6913 set d_perl_otherlibdirs
6916 : Cruising for prototypes
6918 echo "Checking out function prototypes..." >&4
6919 $cat >prototype.c <<EOCP
6924 int main(int argc, char *argv[]) {
6927 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
6928 echo "Your C compiler appears to support function prototypes."
6931 echo "Your C compiler doesn't seem to understand function prototypes."
6938 case "$prototype" in
6940 *) ansi2knr='ansi2knr'
6945 This version of $package can only be compiled by a compiler that
6946 understands function prototypes. Unfortunately, your C compiler
6948 doesn't seem to understand them. Sorry about that.
6950 If GNU cc is available for your system, perhaps you could try that instead.
6952 Eventually, we hope to support building Perl with pre-ANSI compilers.
6953 If you would like to help in that effort, please contact <perlbug@perl.org>.
6955 Aborting Configure now.
6967 Perl can be built with extra modules or bundles of modules which
6968 will be fetched from the CPAN and installed alongside Perl.
6970 Notice that you will need access to the CPAN; either via the Internet,
6971 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
6972 be asked later to configure the CPAN.pm module which will in turn do
6973 the installation of the rest of the extra modules or bundles.)
6975 Notice also that if the modules require any external software such as
6976 libraries and headers (the libz library and the zlib.h header for the
6977 Compress::Zlib module, for example) you MUST have any such software
6978 already installed, this configuration process will NOT install such
6981 If this doesn't make any sense to you, just accept the default '$dflt'.
6983 rp='Install any extra modules (y or n)?'
6989 Please list any extra modules or bundles to be installed from CPAN,
6990 with spaces between the names. The names can be in any format the
6991 'install' command of CPAN.pm will understand. (Answer 'none',
6992 without the quotes, to install no extra modules or bundles.)
7002 $rm -f ../extras.lst
7004 *) echo "(Saving the list of extras for later...)"
7005 echo "$extras" > ../extras.lst
7013 : determine where html pages for programs go
7014 set html1dir html1dir none
7018 If you wish to install html files for programs in $spackage, indicate
7019 the appropriate directory here. To skip installing html files,
7023 ''|none|$undef|' ') dflt=none ;;
7024 *) dflt=$html1dir ;;
7027 rp="Directory for the main $spackage html pages?"
7031 : Use ' ' for none so value is preserved next time through Configure
7032 $test X"$html1dir" = "X" && html1dir=' '
7034 : determine where html pages for libraries and modules go
7035 set html3dir html3dir none
7039 If you wish to install html files for modules associated with $spackage,
7040 indicate the appropriate directory here. To skip installing html files,
7043 : There is no obvious default. If they have specified html1dir, then
7044 : try to key off that, possibly changing .../html1 into .../html3.
7046 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7047 *) dflt=$html3dir ;;
7050 rp="Directory for the $spackage module html pages?"
7054 : Use ' ' for none so value is preserved next time through Configure
7055 $test X"$html3dir" = "X" && html3dir=' '
7057 : determine whether to install perl also as /usr/bin/perl
7060 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7062 Many scripts expect perl to be installed as /usr/bin/perl.
7064 If you want to, I can install the perl you are about to compile
7065 as /usr/bin/perl (in addition to $bin/perl).
7067 if test -f /usr/bin/perl; then
7070 However, please note that because you already have a /usr/bin/perl,
7071 overwriting that with a new Perl would very probably cause problems.
7072 Therefore I'm assuming you don't want to do that (unless you insist).
7075 case "$installusrbinperl" in
7076 "$define"|[yY]*) dflt='y';;
7082 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7085 case "$installusrbinperl" in
7086 "$undef"|[nN]*) dflt='n';;
7090 rp="Do you want to install perl as /usr/bin/perl?"
7093 [yY]*) val="$define";;
7099 set installusrbinperl
7103 echo "Checking for GNU C Library..." >&4
7105 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7106 alone are insufficient to distinguish different versions, such as
7107 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7108 libc version 2.1.0. A. Dougherty, June 3, 2002.
7114 # ifdef __GLIBC_MINOR__
7115 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
7116 # include <gnu/libc-version.h>
7117 printf("%s\n", gnu_get_libc_version());
7119 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7122 printf("%d\n", __GLIBC__);
7131 if eval $compile_ok && $run ./try > glibc.ver; then
7133 gnulibc_version=`$cat glibc.ver`
7134 echo "You are using the GNU C Library version $gnulibc_version"
7138 echo "You are not using the GNU C Library"
7140 $rm -f try try.* glibc.ver
7144 : see if nm is to be used to determine whether a symbol is defined or not
7148 case "$d_gnulibc" in
7151 echo "nm probably won't work on the GNU C Library." >&4
7157 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7159 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7160 echo "'nm' won't be sufficient on this sytem." >&4
7166 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7167 if $test $dflt -gt 20; then
7177 true|$define) dflt=y;;
7184 I can use $nm to extract the symbols from your C libraries. This
7185 is a time consuming task which may generate huge output on the disk (up
7186 to 3 megabytes) but that should make the symbols extraction faster. The
7187 alternative is to skip the 'nm' extraction part and to compile a small
7188 test program instead to determine whether each symbol is present. If
7189 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7190 this may be the best solution.
7192 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7195 rp="Shall I use $nm to extract C symbols from the libraries?"
7198 [Nn]*) usenm=false;;
7207 : nm options which may be necessary
7209 '') if $test -f /mach_boot; then
7211 elif $test -d /usr/ccs/lib; then
7212 nm_opt='-p' # Solaris (and SunOS?)
7213 elif $test -f /dgux; then
7215 elif $test -f /lib64/rld; then
7216 nm_opt='-p' # 64-bit Irix
7222 : nm options which may be necessary for shared libraries but illegal
7223 : for archive libraries. Thank you, Linux.
7224 case "$nm_so_opt" in
7225 '') case "$myuname" in
7227 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7228 nm_so_opt='--dynamic'
7237 : get list of predefined functions in a handy place
7242 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7248 *) for thislib in $libs; do
7251 : Handle C library specially below.
7254 thislib=`echo $thislib | $sed -e 's/^-l//'`
7255 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7257 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7259 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7261 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7263 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7265 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7267 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7272 libnames="$libnames $try"
7274 *) libnames="$libnames $thislib" ;;
7283 for xxx in $libpth; do
7284 $test -r $1 || set $xxx/libc.$so
7285 : The messy sed command sorts on library version numbers.
7287 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7288 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7290 s/[0-9][0-9]*/0000&/g
7291 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7294 $sort | $sed -e 's/^.* //'`
7297 $test -r $1 || set /usr/ccs/lib/libc.$so
7298 $test -r $1 || set /lib/libsys_s$_a
7304 if $test -r "$1"; then
7305 echo "Your (shared) C library seems to be in $1."
7307 elif $test -r /lib/libc && $test -r /lib/clib; then
7308 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7310 libc='/lib/clib /lib/libc'
7311 if $test -r /lib/syslib; then
7312 echo "(Your math library is in /lib/syslib.)"
7313 libc="$libc /lib/syslib"
7315 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7316 echo "Your C library seems to be in $libc, as you said before."
7317 elif $test -r $incpath/usr/lib/libc$_a; then
7318 libc=$incpath/usr/lib/libc$_a;
7319 echo "Your C library seems to be in $libc. That's fine."
7320 elif $test -r /lib/libc$_a; then
7322 echo "Your C library seems to be in $libc. You're normal."
7324 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7326 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7327 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7328 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7330 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7332 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7335 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7337 if $test -r "$tans"; then
7338 echo "Your C library seems to be in $tans, of all places."
7344 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7348 If the guess above is wrong (which it might be if you're using a strange
7349 compiler, or your machine supports multiple models), you can override it here.
7354 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7356 I can't seem to find your C library. I've looked in the following places:
7359 $sed 's/^/ /' libpath
7362 None of these seems to contain your C library. I need to get its name...
7367 rp='Where is your C library?'
7372 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7373 set X `cat libnames`
7376 case $# in 1) xxx=file; esac
7377 echo "Extracting names from the following $xxx for later perusal:" >&4
7379 $sed 's/^/ /' libnames >&4
7381 $echo $n "This may take a while...$c" >&4
7385 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7386 *) $nm $nm_opt $file 2>/dev/null;;
7391 $grep fprintf libc.tmp > libc.ptf
7392 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7393 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7395 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7397 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7399 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7401 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7403 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7405 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7407 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7409 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7411 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7413 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7415 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7417 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7419 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7420 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7422 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7424 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7426 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7428 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7430 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7432 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7434 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7436 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7438 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7440 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7442 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7444 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7446 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7448 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7450 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7453 $nm -p $* 2>/dev/null >libc.tmp
7454 $grep fprintf libc.tmp > libc.ptf
7455 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7456 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7462 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7464 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
7465 for thisname in $libnames $libc; do
7466 $ar t $thisname >>libc.tmp
7468 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7470 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7471 # Repeat libc to extract forwarders to DLL entries too
7472 for thisname in $libnames $libc; do
7473 $ar tv $thisname >>libc.tmp
7474 # Revision 50 of EMX has bug in $ar.
7475 # it will not extract forwarders to DLL entries
7476 # Use emximp which will extract exactly them.
7477 emximp -o tmp.imp $thisname \
7479 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7480 < tmp.imp >>libc.tmp
7483 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7486 echo "$ar didn't seem to work right." >&4
7487 echo "Maybe this is a Cray...trying bld instead..." >&4
7488 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
7490 for thisname in $libnames; do
7492 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7493 $ar t $thisname >>libc.tmp
7497 echo "That didn't work either. Giving up." >&4
7507 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7508 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7510 *) if $test -f /lib/syscalls.exp; then
7512 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7513 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' /lib/syscalls.exp >>libc.list
7519 $rm -f libnames libpath
7521 : see if dld is available
7525 : is a C symbol defined?
7528 -v) tf=libc.tmp; tdc="";;
7529 -a) tf=libc.tmp; tdc="[]";;
7530 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7533 case "$reuseval-$4" in
7535 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7540 if $test "$runnm" = true; then
7541 if $contains $tlook $tf >/dev/null 2>&1; then
7543 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7544 echo "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7545 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7546 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7547 $rm -f try$_exe try.c core core.* try.core;
7550 echo "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7551 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7552 $rm -f try$_exe try.c;
7557 $define) tval=true;;
7564 : define an is-in-libc? function
7565 inlibc='echo " "; td=$define; tu=$undef;
7566 sym=$1; var=$2; eval "was=\$$2";
7568 case "$reuseval$was" in
7578 echo "$sym() found." >&4;
7579 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7581 echo "$sym() NOT found." >&4;
7582 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7586 $define) echo "$sym() found." >&4;;
7587 *) echo "$sym() NOT found." >&4;;
7593 echo "Checking for C++..." >&4
7607 if eval $compile_ok && $run ./try >cplusplus$$; then
7608 val=`$cat cplusplus$$`
7609 echo "You are using a C++ compiler."
7612 echo "You are not using a C++ compiler."
7614 $rm -f try try.* cplusplus$$
7618 : see if dlopen exists
7620 xxx_ccflags="$ccflags"
7622 : with g++ one needs -shared to get is-in-libc to work for dlopen
7623 case "$gccversion" in
7625 *) case "$d_cplusplus" in
7626 "$define") ccflags="$ccflags -shared" ;;
7633 ccflags="$xxx_ccflags"
7635 : see if this is a unistd.h system
7636 set unistd.h i_unistd
7639 : determine which dynamic loading, if any, to compile in
7641 dldir="ext/DynaLoader"
7654 $define) dflt='y' ;;
7657 $define) dflt='y' ;;
7659 : Does a dl_xxx.xs file exist for this operating system
7660 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7663 rp="Do you wish to use dynamic loading?"
7670 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7671 dflt="$dldir/dl_${osname}.xs"
7672 elif $test "$d_dlopen" = "$define" ; then
7673 dflt="$dldir/dl_dlopen.xs"
7674 elif $test "$i_dld" = "$define" ; then
7675 dflt="$dldir/dl_dld.xs"
7680 *) dflt="$dldir/$dlsrc"
7683 echo "The following dynamic loading files are available:"
7684 : Can not go over to $dldir because getfile has path hard-coded in.
7685 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7686 rp="Source file to use for dynamic loading"
7692 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7696 Some systems may require passing special flags to $cc -c to
7697 compile modules that will be used to create a shared library.
7698 To use no flags, say "none".
7701 case "$cccdlflags" in
7702 '') case "$gccversion" in
7703 '') case "$osname" in
7705 next) dflt='none' ;;
7706 irix*) dflt='-KPIC' ;;
7707 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7708 sunos) dflt='-pic' ;;
7712 *) case "$osname" in
7713 darwin) dflt='none' ;;
7714 svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7719 *) dflt="$cccdlflags" ;;
7721 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7724 none) cccdlflags=' ' ;;
7725 *) cccdlflags="$ans" ;;
7730 Some systems use ld to create libraries that can be dynamically loaded,
7731 while other systems (such as those using ELF) use $cc.
7735 '') $cat >try.c <<EOM
7736 /* Test for whether ELF binaries are produced */
7748 int i = open("a.out",O_RDONLY);
7751 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7752 exit(0); /* succeed (yes, it's ELF) */
7757 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7759 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7763 echo "I'll use ld to build dynamic libraries."
7772 rp="What command should be used to create dynamic libraries?"
7778 Some systems may require passing special flags to $ld to create a
7779 library that can be dynamically loaded. If your ld flags include
7780 -L/other/path options to locate libraries outside your loader's normal
7781 search path, you may need to specify those -L options here as well. To
7782 use no flags, say "none".
7785 case "$lddlflags" in
7786 '') case "$osname" in
7787 beos) dflt='-nostart' ;;
7789 case "$gccversion" in
7790 '') dflt="$dflt +vnocompatwarnings" ;;
7793 linux|irix*|gnu*) dflt='-shared' ;;
7794 next) dflt='none' ;;
7795 solaris) dflt='-G' ;;
7796 sunos) dflt='-assert nodefinitions' ;;
7797 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
7801 *) dflt="$lddlflags" ;;
7804 : Try to guess additional flags to pick up local libraries.
7805 : Be careful not to append to a plain 'none'
7809 for thisflag in $ldflags; do
7814 *) dflt="$dflt $thisflag" ;;
7821 ''|' ') dflt='none' ;;
7824 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
7827 none) lddlflags=' ' ;;
7828 *) lddlflags="$ans" ;;
7833 Some systems may require passing special flags to $cc to indicate that
7834 the resulting executable will use dynamic linking. To use no flags,
7838 case "$ccdlflags" in
7839 '') case "$osname" in
7840 linux|hpux|gnu*) dflt='-Wl,-E' ;;
7841 next|sunos) dflt='none' ;;
7845 *) dflt="$ccdlflags" ;;
7847 rp="Any special flags to pass to $cc to use dynamic linking?"
7850 none) ccdlflags=' ' ;;
7851 *) ccdlflags="$ans" ;;
7865 # No dynamic loading being used, so don't bother even to prompt.
7868 *) case "$useshrplib" in
7869 '') case "$osname" in
7870 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
7872 also='Building a shared libperl is required for dynamic loading to work on your system.'
7877 also='Building a shared libperl is needed for MAB support.'
7895 The perl executable is normally obtained by linking perlmain.c with
7896 libperl${_a}, any static extensions (usually just DynaLoader), and
7897 any other libraries needed on this system (such as -lm, etc.). Since
7898 your system supports dynamic loading, it is probably possible to build
7899 a shared libperl.$so. If you will have more than one executable linked
7900 to libperl.$so, this will significantly reduce the size of each
7901 executable, but it may have a noticeable effect on performance. The
7902 default is probably sensible for your system.
7906 rp="Build a shared libperl.$so (y/n)"
7910 useshrplib='true' ;;
7911 *) useshrplib='false' ;;
7916 case "$useshrplib" in
7920 # Figure out a good name for libperl.so. Since it gets stored in
7921 # a version-specific architecture-dependent library, the version
7922 # number isn't really that important, except for making cc/ld happy.
7924 # A name such as libperl.so.3.1
7925 majmin="libperl.$so.$patchlevel.$subversion"
7926 # A name such as libperl.so.301
7927 majonly=`echo $patchlevel $subversion |
7928 $awk '{printf "%d%02d", $1, $2}'`
7929 majonly=libperl.$so.$majonly
7930 # I'd prefer to keep the os-specific stuff here to a minimum, and
7931 # rely on figuring it out from the naming of libc.
7932 case "${osname}${osvers}" in
7935 # XXX How handle the --version stuff for MAB?
7937 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
7940 cygwin*) # ld links against an importlib
7941 dflt=libperl$lib_ext
7943 *) # Try to guess based on whether libc has major.minor.
7945 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
7946 *libc.$so.[0-9]*) dflt=$majonly ;;
7947 *) dflt=libperl.$so ;;
7957 I need to select a good name for the shared libperl. If your system uses
7958 library names with major and minor numbers, then you might want something
7959 like $majmin. Alternatively, if your system uses a single version
7960 number for shared libraries, then you might want to use $majonly.
7961 Or, your system might be quite happy with a simple libperl.$so.
7963 Since the shared libperl will get installed into a version-specific
7964 architecture-dependent directory, the version number of the shared perl
7965 library probably isn't important, so the default should be o.k.
7968 rp='What name do you want to give to the shared libperl?'
7971 echo "Ok, I'll use $libperl"
7974 libperl="libperl${_a}"
7978 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
7982 WARNING: Use of the shrpdir variable for the installation location of
7983 the shared $libperl is not supported. It was never documented and
7984 will not work in this version. Let me (perlbug@perl.org)
7985 know of any problems this may cause.
7991 But your current setting of $shrpdir is
7992 the default anyway, so it's harmless.
7997 Further, your current attempted setting of $shrpdir
7998 conflicts with the value of $archlibexp/CORE
7999 that installperl will use.
8006 # How will the perl executable find the installed shared $libperl?
8007 # Add $xxx to ccdlflags.
8008 # If we can't figure out a command-line option, use $shrpenv to
8009 # set env LD_RUN_PATH. The main perl makefile uses this.
8010 shrpdir=$archlibexp/CORE
8013 if "$useshrplib"; then
8016 # We'll set it in Makefile.SH...
8021 freebsd|netbsd|openbsd|interix|dragonfly)
8022 xxx="-Wl,-R$shrpdir"
8024 bsdos|linux|irix*|dec_osf|gnu*)
8025 xxx="-Wl,-rpath,$shrpdir"
8028 # next doesn't like the default...
8031 # beos doesn't like the default, either.
8034 # hpux doesn't like the default, either.
8035 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8038 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8044 # Only add $xxx if it isn't already in ccdlflags.
8045 case " $ccdlflags " in
8047 *) ccdlflags="$ccdlflags $xxx"
8050 Adding $xxx to the flags
8051 passed to $ld so that the perl executable will find the
8052 installed shared $libperl.
8060 # Fix ccdlflags in AIX for building external extensions.
8061 # (For building Perl itself bare -bE:perl.exp is needed,
8062 # Makefile.SH takes care of this.)
8064 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8066 # Respect a hint or command-line value.
8068 '') shrpenv="$tmp_shrpenv" ;;
8070 case "$ldlibpthname" in
8071 '') ldlibpthname=LD_LIBRARY_PATH ;;
8072 none) ldlibpthname='' ;;
8075 : determine where manual pages are on this system
8079 syspath='/usr/share/man/man1 /usr/man/man1'
8080 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8081 syspath="$syspath /usr/man/u_man/man1"
8082 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8083 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8084 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8085 sysman=`./loc . /usr/man/man1 $syspath`
8088 if $test -d "$sysman"; then
8089 echo "System manual is in $sysman." >&4
8091 echo "Could not find manual pages in source form." >&4
8094 : determine where manual pages go
8095 set man1dir man1dir none
8099 $spackage has manual pages available in source form.
8103 echo "However, you don't have nroff, so they're probably useless to you."
8105 '') man1dir="none";;
8108 echo "If you don't want the manual sources installed, answer 'none'."
8113 lookpath="$prefixexp/share/man/man1"
8114 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8115 lookpath="$lookpath $prefixexp/man/p_man/man1"
8116 lookpath="$lookpath $prefixexp/man/u_man/man1"
8117 lookpath="$lookpath $prefixexp/man/man.1"
8119 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8120 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8130 rp="Where do the main $spackage manual pages (source) go?"
8132 if $test "X$man1direxp" != "X$ansexp"; then
8143 : What suffix to use on installed man pages
8150 rp="What suffix should be used for the main $spackage man pages?"
8152 '') case "$man1dir" in
8166 *) dflt="$man1ext";;
8173 : see if we can have long filenames
8175 first=123456789abcdef
8177 if (echo hi >$first) 2>/dev/null; then
8178 if $test -f 123456789abcde; then
8179 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8182 echo 'You can have filenames longer than 14 characters.'>&4
8187 You can't have filenames longer than 14 chars.
8188 You can't even think about them!
8194 $rm -rf 123456789abcde*
8196 : determine where library module manual pages go
8197 set man3dir man3dir none
8201 $spackage has manual pages for many of the library modules.
8207 However, you don't have nroff, so they're probably useless to you.
8210 '') man3dir="none";;
8214 case "$d_flexfnam" in
8217 However, your system can't handle the long file names like File::Basename.3.
8220 '') man3dir="none";;
8224 echo "If you don't want the manual sources installed, answer 'none'."
8225 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8227 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8228 if $test -d "$privlib/man/man3"; then
8231 WARNING: Previous versions of perl installed man3 pages into
8232 $privlib/man/man3. This version will suggest a
8233 new default of $dflt.
8237 rp='Do you wish to preserve the old behavior?(y/n)'
8240 y*) dflt="$privlib/man/man3" ;;
8245 *) dflt="$man3dir" ;;
8252 rp="Where do the $package library man pages (source) go?"
8262 : What suffix to use on installed man pages
8268 rp="What suffix should be used for the $package library man pages?"
8270 '') case "$man3dir" in
8284 *) dflt="$man3ext";;
8291 : see if we have to deal with yellow pages, now NIS.
8292 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8293 if $test -f /usr/etc/nibindd; then
8295 echo "I'm fairly confident you're on a NeXT."
8297 rp='Do you get the hosts file via NetInfo?'
8306 y*) hostcat='nidump hosts .';;
8307 *) case "$hostcat" in
8308 nidump*) hostcat='';;
8318 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8326 rp='Are you getting the hosts file via yellow pages?'
8329 y*) hostcat='ypcat hosts';;
8330 *) hostcat='cat /etc/hosts';;
8336 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8339 '') test -f /etc/group && groupcat='cat /etc/group';;
8342 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8345 : now get the host name
8347 echo "Figuring out host name..." >&4
8348 case "$myhostname" in
8350 echo 'Maybe "hostname" will work...'
8351 if tans=`sh -c hostname 2>&1` ; then
8359 if $test "$cont"; then
8361 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8362 if tans=`cat /etc/systemid 2>&1` ; then
8364 phostname='cat /etc/systemid'
8365 echo "Whadyaknow. Xenix always was a bit strange..."
8368 elif $test -r /etc/systemid; then
8369 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8372 if $test "$cont"; then
8373 echo 'No, maybe "uuname -l" will work...'
8374 if tans=`sh -c 'uuname -l' 2>&1` ; then
8376 phostname='uuname -l'
8378 echo 'Strange. Maybe "uname -n" will work...'
8379 if tans=`sh -c 'uname -n' 2>&1` ; then
8381 phostname='uname -n'
8383 echo 'Oh well, maybe I can mine it out of whoami.h...'
8384 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8385 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8386 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8388 case "$myhostname" in
8389 '') echo "Does this machine have an identity crisis or something?"
8392 echo "Well, you said $myhostname before..."
8393 phostname='echo $myhostname';;
8399 case "$myhostname" in
8400 '') myhostname=noname ;;
8402 : you do not want to know about this
8407 if $test "$myhostname" ; then
8409 rp='Your host name appears to be "'$myhostname'".'" Right?"
8417 : bad guess or no guess
8418 while $test "X$myhostname" = X ; do
8420 rp="Please type the (one word) name of your host:"
8425 : translate upper to lower if necessary
8426 case "$myhostname" in
8428 echo "(Normalizing case in your host name)"
8429 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8433 case "$myhostname" in
8435 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8436 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8437 echo "(Trimming domain name from host name--host name is now $myhostname)"
8439 *) case "$mydomain" in
8442 test "X$hostcat" = "Xypcat hosts" &&
8443 ypmatch "$myhostname" hosts 2>/dev/null |\
8444 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8447 test "X$hostcat" != "X" &&
8448 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8449 /[ ]$myhostname[ . ]/p" > hosts
8452 if $test -f hosts; then
8453 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8454 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8455 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8456 hosts | $sort | $uniq | \
8457 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8458 case `$echo X$dflt` in
8459 X*\ *) echo "(Several hosts in the database matched hostname)"
8462 X.) echo "(You do not have fully-qualified names in the hosts database)"
8466 echo "(I cannot locate a hosts database anywhere)"
8471 tans=`./loc resolv.conf X /etc /usr/etc`
8472 if $test -f "$tans"; then
8473 echo "(Attempting domain name extraction from $tans)"
8474 dflt=.`$sed -n -e 's/ / /g' \
8475 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8476 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8478 .) dflt=.`$sed -n -e 's/ / /g' \
8479 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8480 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8487 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8488 dflt=.`sh -c domainname 2>/dev/null`
8491 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8495 case "$dflt$osname" in
8496 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8497 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8501 .) echo "(Lost all hope -- silly guess then)"
8507 *) dflt="$mydomain";;
8511 rp="What is your domain name?"
8521 : translate upper to lower if necessary
8524 echo "(Normalizing case in your domain name)"
8525 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8529 : a little sanity check here
8530 case "$phostname" in
8533 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8534 $myhostname$mydomain|$myhostname) ;;
8536 case "$phostname" in
8538 echo "(That doesn't agree with your whoami.h file, by the way.)"
8541 echo "(That doesn't agree with your $phostname command, by the way.)"
8551 I need to get your e-mail address in Internet format if possible, i.e.
8552 something like user@host.domain. Please answer accurately since I have
8553 no easy means to double check it. The default value provided below
8554 is most probably close to reality but may not be valid from outside
8555 your organization...
8559 while test "$cont"; do
8561 '') dflt="$cf_by@$myhostname$mydomain";;
8562 *) dflt="$cf_email";;
8564 rp='What is your e-mail address?'
8570 rp='Address does not look like an Internet one. Use it anyway?'
8586 If you or somebody else will be maintaining perl at your site, please
8587 fill in the correct e-mail address here so that they may be contacted
8588 if necessary. Currently, the "perlbug" program included with perl
8589 will send mail to this address in addition to perlbug@perl.org. You may
8590 enter "none" for no administrator.
8593 case "$perladmin" in
8594 '') dflt="$cf_email";;
8595 *) dflt="$perladmin";;
8597 rp='Perl administrator e-mail address'
8601 : determine whether to only install version-specific parts.
8604 Do you want to install only the version-specific parts of the perl
8605 distribution? Usually you do *not* want to do this.
8607 case "$versiononly" in
8608 "$define"|[Yy]*|true) dflt='y' ;;
8611 rp="Do you want to install only the version-specific parts of perl?"
8614 [yY]*) val="$define";;
8620 case "$versiononly" in
8621 "$define") inc_version_list=''
8622 inc_version_list_init=0
8626 : figure out how to guarantee perl startup
8627 : XXX Note that this currently takes advantage of the bug that binexp ignores
8628 : the Configure -Dinstallprefix setting, which in turn means that under
8629 : relocatable @INC, initialinstalllocation is what binexp started as.
8630 case "$startperl" in
8632 case "$sharpbang" in
8636 I can use the #! construct to start perl on your system. This will
8637 make startup of perl scripts faster, but may cause problems if you
8638 want to share those scripts and perl is not in a standard place
8639 ($initialinstalllocation/perl) on all your platforms. The alternative
8640 is to force a shell by starting the script with a single ':' character.
8643 case "$versiononly" in
8644 "$define") dflt="$initialinstalllocation/perl$version";;
8645 *) dflt="$initialinstalllocation/perl";;
8647 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8650 none) startperl=": # use perl";;
8651 *) startperl="#!$ans"
8652 if $test 30 -lt `echo "$ans" | wc -c`; then
8655 WARNING: Some systems limit the #! command to 32 characters.
8656 If you experience difficulty running Perl scripts with #!, try
8657 installing Perl in a directory with a shorter pathname.
8663 *) startperl=": # use perl"
8668 echo "I'll use $startperl to start perl scripts."
8670 : figure best path for perl in scripts
8673 case "$versiononly" in
8674 "$define") perlpath="$initialinstalllocation/perl$version";;
8675 *) perlpath="$initialinstalllocation/perl";;
8677 case "$startperl" in
8682 I will use the "eval 'exec'" idiom to start Perl on your system.
8683 I can use the full path of your Perl binary for this purpose, but
8684 doing so may cause problems if you want to share those scripts and
8685 Perl is not always in a standard place ($initialinstalllocation/perl).
8688 dflt="$initialinstalllocation/perl"
8689 rp="What path shall I use in \"eval 'exec'\"?"
8696 case "$startperl" in
8698 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8701 : determine where public executable scripts go
8702 set scriptdir scriptdir
8704 case "$scriptdir" in
8707 : guess some guesses
8708 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8709 $test -d /usr/share/bin && dflt=/usr/share/bin
8710 $test -d /usr/local/script && dflt=/usr/local/script
8711 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8712 $test -d $prefixexp/script && dflt=$prefixexp/script
8716 *) dflt="$scriptdir"
8721 Some installations have a separate directory just for executable scripts so
8722 that they can mount it across multiple architectures but keep the scripts in
8723 one spot. You might, for example, have a subdirectory of /usr/share for this.
8724 Or you might just lump your scripts in with all your other executables.
8728 rp='Where do you keep publicly executable scripts?'
8730 if $test "X$ansexp" != "X$scriptdirexp"; then
8736 : A little fix up for an irregularly named variable.
8737 installscript="$installscriptdir"
8739 : determine where add-on public executables go
8741 '') dflt=$siteprefix/bin ;;
8745 rp='Pathname where the add-on public executables should be installed?'
8750 : determine where add-on html pages go
8751 : There is no standard location, so try to copy the previously-selected
8752 : directory structure for the core html pages.
8753 case "$sitehtml1dir" in
8754 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8755 *) dflt=$sitehtml1dir ;;
8758 ''|' ') dflt=none ;;
8761 rp='Pathname where the site-specific html pages should be installed?'
8763 prefixvar=sitehtml1dir
8766 : determine where add-on library html pages go
8767 : There is no standard location, so try to copy the previously-selected
8768 : directory structure for the core html pages.
8769 case "$sitehtml3dir" in
8770 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8771 *) dflt=$sitehtml3dir ;;
8774 ''|' ') dflt=none ;;
8777 rp='Pathname where the site-specific library html pages should be installed?'
8779 prefixvar=sitehtml3dir
8782 : determine where add-on manual pages go
8783 case "$siteman1dir" in
8784 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
8785 *) dflt=$siteman1dir ;;
8788 ''|' ') dflt=none ;;
8791 rp='Pathname where the site-specific manual pages should be installed?'
8793 prefixvar=siteman1dir
8796 : determine where add-on library man pages go
8797 case "$siteman3dir" in
8798 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
8799 *) dflt=$siteman3dir ;;
8802 ''|' ') dflt=none ;;
8805 rp='Pathname where the site-specific library manual pages should be installed?'
8807 prefixvar=siteman3dir
8810 : determine where add-on public executable scripts go
8811 case "$sitescript" in
8812 '') dflt=$siteprefix/script
8813 $test -d $dflt || dflt=$sitebin ;;
8814 *) dflt="$sitescript" ;;
8817 rp='Pathname where add-on public executable scripts should be installed?'
8819 prefixvar=sitescript
8822 case "$usefaststdio" in
8823 $define|true|[yY]*|'')
8824 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
8834 Perl can be built to use 'fast stdio', which means using the stdio
8835 library but also directly manipulating the stdio buffers to enable
8836 faster I/O. Using stdio is better for backward compatibility (especially
8837 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
8838 interface has been preferred instead of stdio.
8840 If this doesn't make any sense to you, just accept the default '$dflt'.
8842 rp='Use the "fast stdio" if available?'
8845 y|Y) val="$define" ;;
8852 : define an is-a-typedef? function
8853 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8855 "") inclist="sys/types.h";;
8857 eval "varval=\$$var";
8861 for inc in $inclist; do
8862 echo "#include <$inc>" >>temp.c;
8864 echo "#ifdef $type" >> temp.c;
8865 echo "printf(\"We have $type\");" >> temp.c;
8866 echo "#endif" >> temp.c;
8867 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8868 if $contains $type temp.E >/dev/null 2>&1; then
8874 *) eval "$var=\$varval";;
8877 : define an is-a-typedef? function that prompts if the type is not available.
8878 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8880 "") inclist="sys/types.h";;
8882 eval "varval=\$$var";
8886 for inc in $inclist; do
8887 echo "#include <$inc>" >>temp.c;
8889 echo "#ifdef $type" >> temp.c;
8890 echo "printf(\"We have $type\");" >> temp.c;
8891 echo "#endif" >> temp.c;
8892 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8894 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
8895 if $contains $type temp.E >/dev/null 2>&1; then
8896 echo "$type found." >&4;
8899 echo "$type NOT found." >&4;
8905 *) eval "$var=\$varval";;
8908 : see what type lseek is declared as in the kernel
8909 rp="What is the type used for lseek's offset on this system?"
8910 set off_t lseektype long stdio.h sys/types.h
8914 echo "Checking to see how big your file offsets are..." >&4
8916 #include <sys/types.h>
8920 printf("%d\n", (int)sizeof($lseektype));
8925 if eval $compile_ok; then
8926 lseeksize=`$run ./try`
8927 echo "Your file offsets are $lseeksize bytes long."
8931 echo "(I can't seem to compile the test program. Guessing...)"
8932 rp="What is the size of your file offsets (in bytes)?"
8938 : see what type file positions are declared as in the library
8939 rp="What is the type for file position used by fsetpos()?"
8940 set fpos_t fpostype long stdio.h sys/types.h
8945 *_t) zzz="$fpostype" ;;
8948 echo "Checking the size of $zzz..." >&4
8950 #include <sys/types.h>
8957 printf("%d\n", (int)sizeof($fpostype));
8962 if eval $compile_ok; then
8966 echo "(I can't execute the test program--guessing $fpossize.)" >&4
8969 echo "Your $zzz is $fpossize bytes long."
8975 echo "(I can't compile the test program. Guessing...)" >&4
8976 rp="What is the size of your file positions (in bytes)?"
8981 # Backward compatibility (uselfs is deprecated).
8983 "$define"|true|[yY]*)
8986 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
8988 uselargefiles="$define"
8992 case "$lseeksize:$fpossize" in
8995 You can have files larger than 2 gigabytes.
8998 *) case "$uselargefiles" in
8999 "$undef"|false|[nN]*) dflt='n' ;;
9004 Perl can be built to understand large files (files larger than 2 gigabytes)
9005 on some systems. To do so, Configure can be run with -Duselargefiles.
9007 If this doesn't make any sense to you, just accept the default '$dflt'.
9009 rp='Try to understand large files, if available?'
9012 y|Y) val="$define" ;;
9019 : Look for a hint-file generated 'call-back-unit'. If the
9020 : user has specified that a large files perl is to be built,
9021 : we may need to set or change some other defaults.
9022 if $test -f uselargefiles.cbu; then
9023 echo "Your platform has some specific hints regarding large file builds, using them..."
9024 . ./uselargefiles.cbu
9026 case "$uselargefiles" in
9028 if $test -f uselargefiles.cbu; then
9030 echo "Rechecking to see how big your file offsets are..." >&4
9032 #include <sys/types.h>
9036 printf("%d\n", (int)sizeof($lseektype));
9041 if eval $compile_ok; then
9042 lseeksize=`$run ./try`
9043 $echo "Your file offsets are now $lseeksize bytes long."
9047 echo "(I can't seem to compile the test program. Guessing...)"
9048 rp="What is the size of your file offsets (in bytes)?"
9053 *_t) zzz="$fpostype" ;;
9056 $echo $n "Rechecking the size of $zzz...$c" >&4
9058 #include <sys/types.h>
9065 printf("%d\n", (int)sizeof($fpostype));
9070 if eval $compile_ok; then
9075 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9078 echo " $fpossize bytes." >&4
9084 echo "(I can't compile the test program. Guessing...)" >&4
9085 rp="What is the size of your file positions (in bytes)?"
9094 case "$vendorprefix" in
9095 '') d_vendorbin="$undef"
9099 *) d_vendorbin="$define"
9100 : determine where vendor-supplied executables go.
9101 case "$vendorbin" in
9102 '') dflt=$vendorprefix/bin ;;
9103 *) dflt="$vendorbin" ;;
9106 rp='Pathname for the vendor-supplied executables directory?'
9109 vendorbinexp="$ansexp"
9115 case "$vendorprefix" in
9116 '') vendorhtml1dir=''
9117 vendorhtml1direxp=''
9119 *) : determine where vendor-supplied html pages go.
9120 : There is no standard location, so try to copy the previously-selected
9121 : directory structure for the core html pages.
9122 : XXX Better default suggestions would be welcome.
9123 case "$vendorhtml1dir" in
9124 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9125 *) dflt=$vendorhtml1dir ;;
9128 ''|' ') dflt=none ;;
9131 rp='Pathname for the vendor-supplied html pages?'
9133 vendorhtml1dir="$ans"
9134 vendorhtml1direxp="$ansexp"
9137 : Use ' ' for none so value is preserved next time through Configure
9138 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9139 prefixvar=vendorhtml1dir
9142 case "$vendorprefix" in
9143 '') vendorhtml3dir=''
9144 vendorhtml3direxp=''
9146 *) : determine where vendor-supplied module html pages go.
9147 : There is no standard location, so try to copy the previously-selected
9148 : directory structure for the core html pages.
9149 : XXX Better default suggestions would be welcome.
9150 case "$vendorhtml3dir" in
9151 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9152 *) dflt=$vendorhtml3dir ;;
9155 ''|' ') dflt=none ;;
9158 rp='Pathname for the vendor-supplied html pages?'
9160 vendorhtml3dir="$ans"
9161 vendorhtml3direxp="$ansexp"
9164 : Use ' ' for none so value is preserved next time through Configure
9165 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9166 prefixvar=vendorhtml3dir
9169 case "$vendorprefix" in
9170 '') vendorman1dir=''
9173 *) : determine where vendor-supplied manual pages go.
9174 case "$vendorman1dir" in
9175 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9176 *) dflt=$vendorman1dir ;;
9179 ''|' ') dflt=none ;;
9182 rp='Pathname for the vendor-supplied manual section 1 pages?'
9184 vendorman1dir="$ans"
9185 vendorman1direxp="$ansexp"
9188 : Use ' ' for none so value is preserved next time through Configure
9189 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9190 prefixvar=vendorman1dir
9193 case "$vendorprefix" in
9194 '') vendorman3dir=''
9197 *) : determine where vendor-supplied module manual pages go.
9198 case "$vendorman3dir" in
9199 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9200 *) dflt=$vendorman3dir ;;
9203 ''|' ') dflt=none ;;
9206 rp='Pathname for the vendor-supplied manual section 3 pages?'
9208 vendorman3dir="$ans"
9209 vendorman3direxp="$ansexp"
9212 : Use ' ' for none so value is preserved next time through Configure
9213 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9214 prefixvar=vendorman3dir
9217 case "$vendorprefix" in
9218 '') d_vendorscript="$undef"
9222 *) d_vendorscript="$define"
9223 : determine where vendor-supplied scripts go.
9224 case "$vendorscript" in
9225 '') dflt=$vendorprefix/script
9226 $test -d $dflt || dflt=$vendorbin ;;
9227 *) dflt="$vendorscript" ;;
9231 The installation process will create a directory for
9232 vendor-supplied scripts.
9236 rp='Pathname for the vendor-supplied scripts directory?'
9239 vendorscriptexp="$ansexp"
9242 prefixvar=vendorscript
9245 : see if qgcvt exists
9251 if $test X"$d_longdbl" = X"$define"; then
9253 echo "Checking how to print long doubles..." >&4
9255 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9256 $cat >try.c <<'EOCP'
9257 #include <sys/types.h>
9261 printf("%.3f\n", d);
9265 if eval $compile; then
9269 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9270 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9271 echo "We will use %f."
9277 if $test X"$sPRIfldbl" = X; then
9278 $cat >try.c <<'EOCP'
9279 #include <sys/types.h>
9282 long double d = 123.456;
9283 printf("%.3Lf\n", d);
9287 if eval $compile; then
9291 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9292 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9293 echo "We will use %Lf."
9299 if $test X"$sPRIfldbl" = X; then
9300 $cat >try.c <<'EOCP'
9301 #include <sys/types.h>
9304 long double d = 123.456;
9305 printf("%.3llf\n", d);
9309 if eval $compile; then
9313 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9314 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9315 echo "We will use %llf."
9321 if $test X"$sPRIfldbl" = X; then
9322 $cat >try.c <<'EOCP'
9323 #include <sys/types.h>
9326 long double d = 123.456;
9327 printf("%.3lf\n", d);
9331 if eval $compile; then
9335 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9336 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9337 echo "We will use %lf."
9343 if $test X"$sPRIfldbl" = X; then
9344 echo "Cannot figure out how to print long doubles." >&4
9346 sSCNfldbl=$sPRIfldbl # expect consistency
9353 case "$sPRIfldbl" in
9354 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9355 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9356 d_SCNfldbl="$undef";
9358 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9359 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9360 d_SCNfldbl="$define";
9364 : Check how to convert floats to strings.
9366 if test "X$d_Gconvert" = X; then
9369 echo "Checking for an efficient way to convert floats to strings."
9371 case "$uselongdouble" in
9372 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9374 case "$d_longdbl" in
9375 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9377 case "$d_PRIgldbl" in
9378 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9382 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9383 char *myname = "gconvert";
9386 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9387 char *myname = "gcvt";
9390 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9391 char *myname = "qgcvt";
9392 #define DOUBLETYPE long double
9395 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9397 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9399 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9402 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9404 char *myname = "sprintf";
9408 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9409 #define DOUBLETYPE long double
9411 #define DOUBLETYPE double
9417 #define I_STDLIB $i_stdlib
9423 checkit(expect, got)
9427 if (strcmp(expect, got)) {
9428 printf("%s oddity: Expected %s, got %s\n",
9429 myname, expect, got);
9439 /* This must be 1st test on (which?) platform */
9440 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9441 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9442 checkit("0.1", buf);
9444 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9445 checkit("0.01", buf);
9447 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9448 checkit("0.001", buf);
9450 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9451 checkit("0.0001", buf);
9453 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9454 if (strlen(buf) > 5)
9455 checkit("9e-005", buf); /* for Microsoft ?? */
9457 checkit("9e-05", buf);
9459 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9462 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9463 checkit("1.1", buf);
9465 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9466 checkit("1.01", buf);
9468 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9469 checkit("1.001", buf);
9471 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9472 checkit("1.0001", buf);
9474 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9475 checkit("1.00001", buf);
9477 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9478 checkit("1.000001", buf);
9480 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9483 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9486 /* Some Linux gcvt's give 1.e+5 here. */
9487 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9488 checkit("100000", buf);
9490 /* Some Linux gcvt's give -1.e+5 here. */
9491 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9492 checkit("-100000", buf);
9494 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9495 checkit("123.456", buf);
9497 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9498 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9499 /* 34 should be enough to scare even long double
9500 * places into using the e notation. */
9501 if (strlen(buf) > 5)
9502 checkit("1e+034", buf); /* for Microsoft */
9504 checkit("1e+34", buf);
9506 /* For Perl, if you add additional tests here, also add them to
9507 * t/base/num.t for benefit of platforms not using Configure or
9508 * overriding d_Gconvert */
9513 : first add preferred functions to our list
9515 for xxx_convert in $gconvert_preference; do
9516 case $xxx_convert in
9517 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9518 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9521 : then add any others
9522 for xxx_convert in gconvert gcvt sprintf; do
9525 *) xxx_list="$xxx_list $xxx_convert" ;;
9529 case "$d_longdbl$uselongdouble" in
9531 : again, add prefered functions to our list first
9533 for xxx_convert in $gconvert_ld_preference; do
9534 case $xxx_convert in
9535 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9536 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9539 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9540 for xxx_convert in qgcvt sprintf $xxx_list; do
9541 case "$xxx_ld_list" in
9542 $xxx_convert*|*" $xxx_convert"*) ;;
9543 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9546 : if sprintf cannot do long doubles, move it to the end
9547 if test "$d_PRIgldbl" != "$define"; then
9548 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9550 : if no qgcvt, remove it
9551 if test "$d_qgcvt" != "$define"; then
9552 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9555 xxx_list="$xxx_ld_list"
9559 for xxx_convert in $xxx_list; do
9560 echo "Trying $xxx_convert..."
9562 set try -DTRY_$xxx_convert
9563 if eval $compile; then
9564 echo "$xxx_convert() found." >&4
9566 echo "I'll use $xxx_convert to convert floats into a string." >&4
9569 echo "...But $xxx_convert didn't work as I expected."
9573 echo "$xxx_convert NOT found." >&4
9577 if test X$xxx_convert = X; then
9578 echo "*** WHOA THERE!!! ***" >&4
9579 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9583 case "$xxx_convert" in
9584 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9585 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9586 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9587 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9588 "$define$define$define")
9589 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9590 "$define$define$undef")
9591 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9592 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9599 : see if _fwalk exists
9603 : Initialize h_fcntl
9606 : Initialize h_sysfile
9609 : access call always available on UNIX
9613 : locate the flags for 'access()'
9617 $cat >access.c <<EOCP
9618 #include <sys/types.h>
9623 #include <sys/file.h>
9636 : check sys/file.h first, no particular reason here
9637 if $test `./findhdr sys/file.h` && \
9638 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9640 echo "<sys/file.h> defines the *_OK access constants." >&4
9641 elif $test `./findhdr fcntl.h` && \
9642 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9644 echo "<fcntl.h> defines the *_OK access constants." >&4
9645 elif $test `./findhdr unistd.h` && \
9646 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9647 echo "<unistd.h> defines the *_OK access constants." >&4
9649 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9655 : see if accessx exists
9656 set accessx d_accessx
9659 : see if aintl exists
9663 : see if alarm exists
9667 : see if POSIX threads are available
9668 set pthread.h i_pthread
9671 : define a fucntion to check prototypes
9672 $cat > protochk <<EOSH
9675 optimize="$optimize"
9677 prototype="$prototype"
9680 usethreads=$usethreads
9681 i_pthread=$i_pthread
9682 pthread_h_first=$pthread_h_first
9685 $cat >> protochk <<'EOSH'
9690 while test $# -ge 2; do
9692 $define) echo "#include <$2>" >> try.c ;;
9693 literal) echo "$2" >> try.c ;;
9695 # Extra magic for the benefit of systems that need pthread.h
9696 # to be included early to correctly detect threadsafe functions.
9697 # Such functions must guarantee themselves, though, that the usethreads
9698 # and i_pthread have been defined, before calling protochk.
9699 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
9700 echo "#include <pthread.h>" >> try.c
9705 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
9706 cat >> try.c <<'EOCP'
9707 #ifdef CAN_PROTOTYPE
9708 #define _(args) args
9713 echo "$foo" >> try.c
9714 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
9715 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
9723 hasproto='varname=$1; func=$2; shift; shift;
9724 while $test $# -ge 2; do
9726 $define) echo "#include <$2>";;
9730 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
9731 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
9732 echo "$func() prototype found.";
9735 echo "$func() prototype NOT found.";
9740 $rm -f try.c tryout.c'
9742 : see if sys/types.h has to be included
9743 set sys/types.h i_systypes
9746 : see if sys/select.h has to be included
9747 set sys/select.h i_sysselct
9750 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
9751 while $test $# -ge 2; do
9753 $define) echo "#include <$2>";;
9757 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
9759 if eval $compile; then
9768 : see if we should include time.h, sys/time.h, or both
9770 if test "X$timeincl" = X; then
9771 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9772 $echo $n "I'm now running the test program...$c"
9774 #include <sys/types.h>
9779 #ifdef SYSTIMEKERNEL
9782 #include <sys/time.h>
9785 #include <sys/select.h>
9798 struct timezone tzp;
9800 if (foo.tm_sec == foo.tm_sec)
9803 if (bar.tv_sec == bar.tv_sec)
9810 for s_timezone in '-DS_TIMEZONE' ''; do
9812 for s_timeval in '-DS_TIMEVAL' ''; do
9813 for i_systimek in '' '-DSYSTIMEKERNEL'; do
9814 for i_time in '' '-DI_TIME'; do
9815 for i_systime in '-DI_SYSTIME' ''; do
9818 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
9819 if eval $compile; then
9820 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
9824 $echo $n "Succeeded with $flags$c"
9836 *SYSTIMEKERNEL*) i_systimek="$define"
9837 timeincl=`./findhdr sys/time.h`
9838 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
9839 *) i_systimek="$undef";;
9842 *I_TIME*) i_time="$define"
9843 timeincl=`./findhdr time.h`" $timeincl"
9844 echo "We'll include <time.h>." >&4;;
9845 *) i_time="$undef";;
9848 *I_SYSTIME*) i_systime="$define"
9849 timeincl=`./findhdr sys/time.h`" $timeincl"
9850 echo "We'll include <sys/time.h>." >&4;;
9851 *) i_systime="$undef";;
9855 : see if struct tm knows about tm_zone
9856 case "$i_systime$i_time" in
9859 echo "Checking to see if your struct tm has tm_zone field..." >&4
9860 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
9868 case "$d_tm_tm_zone" in
9869 "$define") echo "Yes, it does." ;;
9870 *) echo "No, it doesn't." ;;
9872 : see if struct tm knows about tm_gmtoff
9873 case "$i_systime$i_time" in
9876 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
9877 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
9885 case "$d_tm_tm_gmtoff" in
9886 "$define") echo "Yes, it does." ;;
9887 *) echo "No, it doesn't." ;;
9890 : see if asctime_r exists
9891 set asctime_r d_asctime_r
9893 case "$d_asctime_r" in
9895 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
9896 case "$d_asctime_r_proto:$usethreads" in
9897 ":define") d_asctime_r_proto=define
9898 set d_asctime_r_proto asctime_r $hdrs
9902 case "$d_asctime_r_proto" in
9904 case "$asctime_r_proto" in
9905 ''|0) try='char* asctime_r(const struct tm*, char*);'
9906 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SB ;;
9908 case "$asctime_r_proto" in
9909 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
9910 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SBI ;;
9912 case "$asctime_r_proto" in
9913 ''|0) try='int asctime_r(const struct tm*, char*);'
9914 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SB ;;
9916 case "$asctime_r_proto" in
9917 ''|0) try='int asctime_r(const struct tm*, char*, int);'
9918 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SBI ;;
9920 case "$asctime_r_proto" in
9921 ''|0) d_asctime_r=undef
9923 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
9924 * ) case "$asctime_r_proto" in
9925 REENTRANT_PROTO*) ;;
9926 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
9928 echo "Prototype: $try" ;;
9931 *) case "$usethreads" in
9932 define) echo "asctime_r has no prototype, not using it." >&4 ;;
9939 *) asctime_r_proto=0
9943 : see if atolf exists
9947 : see if atoll exists
9951 : Look for GCC-style attribute format
9952 case "$d_attribute_format" in
9955 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
9956 $cat >attrib.c <<'EOCP'
9958 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
9960 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9961 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9962 echo "Your C compiler doesn't support __attribute__((format))."
9965 echo "Your C compiler supports __attribute__((format))."
9969 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9973 *) val="$d_attribute_format" ;;
9975 set d_attribute_format
9979 : Look for GCC-style attribute malloc
9980 case "$d_attribute_malloc" in
9983 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
9984 $cat >attrib.c <<'EOCP'
9986 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
9988 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9989 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9990 echo "Your C compiler doesn't support __attribute__((malloc))."
9993 echo "Your C compiler supports __attribute__((malloc))."
9997 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10001 *) val="$d_attribute_malloc" ;;
10003 set d_attribute_malloc
10007 : Look for GCC-style attribute nonnull
10008 case "$d_attribute_nonnull" in
10011 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10012 $cat >attrib.c <<'EOCP'
10014 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10016 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10017 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10018 echo "Your C compiler doesn't support __attribute__((nonnull))."
10021 echo "Your C compiler supports __attribute__((nonnull))."
10025 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10029 *) val="$d_attribute_nonnull" ;;
10031 set d_attribute_nonnull
10035 : Look for GCC-style attribute noreturn
10036 case "$d_attribute_noreturn" in
10039 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10040 $cat >attrib.c <<'EOCP'
10042 void fall_over_dead( void ) __attribute__((noreturn));
10044 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10045 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10046 echo "Your C compiler doesn't support __attribute__((noreturn))."
10049 echo "Your C compiler supports __attribute__((noreturn))."
10053 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10057 *) val="$d_attribute_noreturn" ;;
10059 set d_attribute_noreturn
10063 : Look for GCC-style attribute pure
10064 case "$d_attribute_pure" in
10067 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10068 $cat >attrib.c <<'EOCP'
10070 int square( int n ) __attribute__((pure));
10072 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10073 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10074 echo "Your C compiler doesn't support __attribute__((pure))."
10077 echo "Your C compiler supports __attribute__((pure))."
10081 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10085 *) val="$d_attribute_pure" ;;
10087 set d_attribute_pure
10091 : Look for GCC-style attribute unused
10092 case "$d_attribute_unused" in
10095 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10096 $cat >attrib.c <<'EOCP'
10098 int do_something( int dummy __attribute__((unused)), int n );
10100 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10101 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10102 echo "Your C compiler doesn't support __attribute__((unused))."
10105 echo "Your C compiler supports __attribute__((unused))."
10109 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10113 *) val="$d_attribute_unused" ;;
10115 set d_attribute_unused
10119 : Look for GCC-style attribute warn_unused_result
10120 case "$d_attribute_warn_unused_result" in
10123 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10124 $cat >attrib.c <<'EOCP'
10126 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10128 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10129 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10130 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10133 echo "Your C compiler supports __attribute__((warn_unused_result))."
10137 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10141 *) val="$d_attribute_warn_unused_result" ;;
10143 set d_attribute_warn_unused_result
10147 : see if bcmp exists
10151 : see if bcopy exists
10155 : see if getpgrp exists
10156 set getpgrp d_getpgrp
10159 case "$d_getpgrp" in
10162 echo "Checking to see which flavor of getpgrp is in use..."
10164 #$i_unistd I_UNISTD
10165 #include <sys/types.h>
10167 # include <unistd.h>
10169 #$i_stdlib I_STDLIB
10171 #include <stdlib.h>
10175 if (getuid() == 0) {
10176 printf("(I see you are running Configure as super-user...)\n");
10179 #ifdef TRY_BSD_PGRP
10180 if (getpgrp(1) == 0)
10189 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10190 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10192 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10193 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10196 echo "I can't seem to compile and run the test program."
10198 xxx="a USG one, i.e. you use getpgrp()."
10200 # SVR4 systems can appear rather BSD-ish.
10201 case "$i_unistd" in
10203 xxx="a BSD one, i.e. you use getpgrp(pid)."
10207 xxx="probably a USG one, i.e. you use getpgrp()."
10212 echo "Assuming your getpgrp is $xxx" >&4
10221 : see if setpgrp exists
10222 set setpgrp d_setpgrp
10225 case "$d_setpgrp" in
10228 echo "Checking to see which flavor of setpgrp is in use..."
10230 #$i_unistd I_UNISTD
10231 #include <sys/types.h>
10233 # include <unistd.h>
10235 #$i_stdlib I_STDLIB
10237 #include <stdlib.h>
10241 if (getuid() == 0) {
10242 printf("(I see you are running Configure as super-user...)\n");
10245 #ifdef TRY_BSD_PGRP
10246 if (-1 == setpgrp(1, 1))
10249 if (setpgrp() != -1)
10255 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10256 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10258 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10259 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10262 echo "(I can't seem to compile and run the test program.)"
10264 xxx="a USG one, i.e. you use setpgrp()."
10266 # SVR4 systems can appear rather BSD-ish.
10267 case "$i_unistd" in
10269 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10273 xxx="probably a USG one, i.e. you use setpgrp()."
10278 echo "Assuming your setpgrp is $xxx" >&4
10286 : Look for GCC-style __builtin_choose_expr
10287 case "$d_builtin_choose_expr" in
10290 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10291 $cat >try.c <<'EOCP'
10292 #include <assert.h>
10293 #include <stdlib.h>
10296 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10299 assert( SYRINX(1) == 2112 );
10300 assert( SYRINX(1) != 5150 );
10301 assert( SYRINX(0) == 5150 );
10302 assert( SYRINX(0) != 2112 );
10303 puts( "All good!" );
10309 if eval $compile; then
10310 echo "Your C compiler supports __builtin_choose_expr."
10313 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10317 *) val="$d_builtin_choose_expr" ;;
10320 set d_builtin_choose_expr
10322 $rm -f try.* try core core.try.*
10324 : Look for GCC-style __builtin_expect
10325 case "$d_builtin_expect" in
10328 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10329 $cat >builtin.c <<'EOCP'
10332 if ( __builtin_expect(n, 0) ) n = 1;
10336 if eval $compile; then
10337 echo "Your C compiler supports __builtin_choose_expr."
10340 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10344 *) val="$d_builtin_expect" ;;
10347 set d_builtin_expect
10349 $rm -f try.* try core core.try.*
10351 : see if bzero exists
10355 : see if stdarg is available
10357 if $test `./findhdr stdarg.h`; then
10358 echo "<stdarg.h> found." >&4
10361 echo "<stdarg.h> NOT found." >&4
10365 : see if varags is available
10367 if $test `./findhdr varargs.h`; then
10368 echo "<varargs.h> found." >&4
10370 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
10373 : set up the varargs testing programs
10374 $cat > varargs.c <<EOP
10376 #include <stdarg.h>
10379 #include <varargs.h>
10383 int f(char *p, ...)
10397 p = va_arg(ap, char *);
10403 $cat > varargs <<EOP
10405 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
10414 : now check which varargs header should be included
10419 if `./varargs I_STDARG`; then
10421 elif `./varargs I_VARARGS`; then
10426 if `./varargs I_VARARGS`; then
10433 echo "I could not find the definition for va_dcl... You have problems..." >&4
10434 val="$undef"; set i_stdarg; eval $setvar
10435 val="$undef"; set i_varargs; eval $setvar
10440 case "$i_varhdr" in
10442 val="$define"; set i_stdarg; eval $setvar
10443 val="$undef"; set i_varargs; eval $setvar
10446 val="$undef"; set i_stdarg; eval $setvar
10447 val="$define"; set i_varargs; eval $setvar
10450 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
10454 : see if the Compiler supports C99 variadic macros
10455 case "$i_stdarg$i_stdlib" in
10457 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
10460 #include <stdarg.h>
10462 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
10466 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
10472 if eval $compile && $run ./try 2>&1 >/dev/null; then
10473 case "`$run ./try`" in
10475 echo "You have C99 variadic macros." >&4
10476 d_c99_variadic_macros="$define"
10479 echo "You don't have functional C99 variadic macros." >&4
10480 d_c99_variadic_macros="$undef"
10484 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
10485 d_c99_variadic_macros="$undef"
10487 $rm -f try.* try core core.try.*
10490 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
10491 d_c99_variadic_macros="$undef"
10495 : see if signal is declared as pointer to function returning int or void
10497 xxx=`./findhdr signal.h`
10498 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10499 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10500 echo "You have int (*signal())() instead of void." >&4
10502 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10503 echo "You have void (*signal())()." >&4
10505 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10506 echo "You have int (*signal())() instead of void." >&4
10508 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10509 echo "You have void (*signal())()." >&4
10512 case "$d_voidsig" in
10514 echo "I can't determine whether signal handler returns void or int..." >&4
10516 rp="What type does your signal handler return?"
10519 v*) val="$define";;
10523 echo "As you already told me, signal handler returns void." >&4
10526 *) echo "As you already told me, signal handler returns int." >&4
10533 case "$d_voidsig" in
10534 "$define") signal_t="void";;
10535 *) signal_t="int";;
10539 : check for ability to cast large floats to 32-bit ints.
10541 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10542 if $test "$intsize" -ge 4; then
10549 #$i_stdlib I_STDLIB
10551 #include <stdlib.h>
10553 #include <sys/types.h>
10554 #include <signal.h>
10555 $signal_t blech(int s) { exit(3); }
10562 signal(SIGFPE, blech);
10564 /* Don't let compiler optimize the test away. Store the number
10565 in a writable string for gcc to pass to sscanf under HP/UX.
10567 sprintf(str, "2147483647");
10568 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
10572 /* x86 processors will probably give 0x8000 0000, which is a
10573 sign change. We don't want that. We want to mimic SPARC
10574 behavior here, which is to preserve the sign and give
10577 if (i32 != ($xxx) f)
10583 if eval $compile_ok; then
10587 echo "(I can't seem to compile the test program--assuming it can't)"
10592 echo "Yup, it can."
10595 echo "Nope, it can't."
10602 : check for ability to cast negative floats to unsigned
10604 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
10607 #$i_stdlib I_STDLIB
10609 #include <stdlib.h>
10611 #include <sys/types.h>
10612 #include <signal.h>
10613 $signal_t blech(int s) { exit(7); }
10614 $signal_t blech_in_list(int s) { exit(4); }
10615 unsigned long dummy_long(unsigned long p) { return p; }
10616 unsigned int dummy_int(unsigned int p) { return p; }
10617 unsigned short dummy_short(unsigned short p) { return p; }
10621 unsigned long along;
10623 unsigned short ashort;
10627 /* Frustrate gcc-2.7.2's optimizer which failed this test with
10628 a direct f = -123. assignment. gcc-2.8.0 reportedly
10629 optimized the whole file away
10631 /* Store the number in a writable string for gcc to pass to
10632 sscanf under HP/UX.
10634 sprintf(str, "-123");
10635 sscanf(str, "%lf", &f); /* f = -123.; */
10637 signal(SIGFPE, blech);
10638 along = (unsigned long)f;
10639 aint = (unsigned int)f;
10640 ashort = (unsigned short)f;
10641 if (along != (unsigned long)-123)
10643 if (aint != (unsigned int)-123)
10645 if (ashort != (unsigned short)-123)
10647 sprintf(str, "1073741824.");
10648 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
10651 along = (unsigned long)f;
10652 if (along != 0x80000000)
10656 along = (unsigned long)f;
10657 if (along != 0x7fffffff)
10661 along = (unsigned long)f;
10662 if (along != 0x80000001)
10666 signal(SIGFPE, blech_in_list);
10667 sprintf(str, "123.");
10668 sscanf(str, "%lf", &f); /* f = 123.; */
10669 along = dummy_long((unsigned long)f);
10670 aint = dummy_int((unsigned int)f);
10671 ashort = dummy_short((unsigned short)f);
10672 if (along != (unsigned long)123)
10674 if (aint != (unsigned int)123)
10676 if (ashort != (unsigned short)123)
10683 if eval $compile_ok; then
10687 echo "(I can't seem to compile the test program--assuming it can't)"
10690 case "$castflags" in
10692 echo "Yup, it can."
10695 echo "Nope, it can't."
10702 : see if vprintf exists
10704 if set vprintf val -f d_vprintf; eval $csym; $val; then
10705 echo 'vprintf() found.' >&4
10708 #include <varargs.h>
10709 #$i_stdlib I_STDLIB
10711 #include <stdlib.h>
10714 int main() { xxx("foo"); }
10723 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
10727 if eval $compile && $run ./try; then
10728 echo "Your vsprintf() returns (int)." >&4
10731 echo "Your vsprintf() returns (char*)." >&4
10735 echo 'vprintf() NOT found.' >&4
10746 : see if chown exists
10750 : see if chroot exists
10751 set chroot d_chroot
10754 : see if chsize exists
10755 set chsize d_chsize
10758 : see if class exists
10762 : see if clearenv exists
10763 set clearenv d_clearenv
10766 hasstruct='varname=$1; struct=$2; shift; shift;
10767 while $test $# -ge 2; do
10769 $define) echo "#include <$2>";;
10773 echo "int main () { struct $struct foo; }" >> try.c;
10775 if eval $compile; then
10782 $rm -f try.c try.o'
10786 : see whether socket exists
10788 $echo $n "Hmm... $c" >&4
10789 if set socket val -f d_socket; eval $csym; $val; then
10790 echo "Looks like you have Berkeley networking support." >&4
10792 if set setsockopt val -f; eval $csym; $val; then
10795 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
10796 d_oldsock="$define"
10799 if $contains socklib libc.list >/dev/null 2>&1; then
10800 echo "Looks like you have Berkeley networking support." >&4
10802 : we will have to assume that it supports the 4.2 BSD interface
10805 echo "You don't have Berkeley networking in libc$_a..." >&4
10806 if test "X$d_socket" = "X$define"; then
10807 echo "...but you seem to believe that you have sockets." >&4
10809 for net in net socket
10811 if test -f /usr/lib/lib$net$_a; then
10812 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
10813 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
10814 if $contains socket libc.list >/dev/null 2>&1; then
10819 echo "...but the Wollongong group seems to have hacked it in." >&4
10820 sockethdr="-I/usr/netinclude"
10823 echo "Found Berkeley sockets interface in lib$net." >&4
10824 if $contains setsockopt libc.list >/dev/null 2>&1; then
10827 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
10828 d_oldsock="$define"
10834 if test "X$d_socket" != "X$define"; then
10835 echo "or anywhere else I see." >&4
10843 : see if socketpair exists
10844 set socketpair d_sockpair
10849 echo "Checking the availability of certain socket constants..." >&4
10850 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
10851 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
10853 #include <sys/types.h>
10854 #include <sys/socket.h>
10860 set try; if eval $compile; then
10863 set d_${enum}; eval $setvar
10867 : see if this is a sys/uio.h system
10868 set sys/uio.h i_sysuio
10873 echo "Checking to see if your system supports struct cmsghdr..." >&4
10874 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
10876 case "$d_cmsghdr_s" in
10877 "$define") echo "Yes, it does." ;;
10878 *) echo "No, it doesn't." ;;
10882 : check for const keyword
10884 echo 'Checking to see if your C compiler knows about "const"...' >&4
10885 $cat >const.c <<'EOCP'
10886 typedef struct spug { int drokk; } spug;
10890 const spug y = { 0 };
10893 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
10895 echo "Yup, it does."
10898 echo "Nope, it doesn't."
10903 : see if copysignl exists
10904 set copysignl d_copysignl
10907 : see if crypt exists
10912 $define) cryptlib='' ;;
10913 *) if set crypt val -f d_crypt; eval $csym; $val; then
10914 echo 'crypt() found.' >&4
10918 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
10919 if $test -z "$cryptlib"; then
10920 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
10924 if $test -z "$cryptlib"; then
10925 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
10929 if $test -z "$cryptlib"; then
10930 cryptlib=`./loc libcrypt$_a "" $libpth`
10934 if $test -z "$cryptlib"; then
10935 echo 'crypt() NOT found.' >&4
10946 : see if this is a crypt.h system
10947 set crypt.h i_crypt
10950 : see if crypt_r exists
10951 set crypt_r d_crypt_r
10953 case "$d_crypt_r" in
10955 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
10956 case "$d_crypt_r_proto:$usethreads" in
10957 ":define") d_crypt_r_proto=define
10958 set d_crypt_r_proto crypt_r $hdrs
10962 case "$d_crypt_r_proto" in
10964 case "$crypt_r_proto" in
10965 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
10966 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCS ;;
10968 case "$crypt_r_proto" in
10969 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
10970 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCD ;;
10972 case "$crypt_r_proto" in
10973 ''|0) d_crypt_r=undef
10975 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
10976 * ) case "$crypt_r_proto" in
10977 REENTRANT_PROTO*) ;;
10978 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
10980 echo "Prototype: $try" ;;
10983 *) case "$usethreads" in
10984 define) echo "crypt_r has no prototype, not using it." >&4 ;;
10995 : get csh whereabouts
10997 'csh') val="$undef" ;;
10998 *) val="$define" ;;
11002 : Respect a hint or command line value for full_csh.
11003 case "$full_csh" in
11004 '') full_csh=$csh ;;
11007 : see if ctermid exists
11008 set ctermid d_ctermid
11011 : see if ctermid_r exists
11012 set ctermid_r d_ctermid_r
11014 case "$d_ctermid_r" in
11016 hdrs="$i_systypes sys/types.h define stdio.h "
11017 case "$d_ctermid_r_proto:$usethreads" in
11018 ":define") d_ctermid_r_proto=define
11019 set d_ctermid_r_proto ctermid_r $hdrs
11023 case "$d_ctermid_r_proto" in
11025 case "$ctermid_r_proto" in
11026 ''|0) try='char* ctermid_r(char*);'
11027 ./protochk "extern $try" $hdrs && ctermid_r_proto=B_B ;;
11029 case "$ctermid_r_proto" in
11030 ''|0) d_ctermid_r=undef
11032 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
11033 * ) case "$ctermid_r_proto" in
11034 REENTRANT_PROTO*) ;;
11035 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
11037 echo "Prototype: $try" ;;
11040 *) case "$usethreads" in
11041 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
11048 *) ctermid_r_proto=0
11052 : see if ctime_r exists
11053 set ctime_r d_ctime_r
11055 case "$d_ctime_r" in
11057 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11058 case "$d_ctime_r_proto:$usethreads" in
11059 ":define") d_ctime_r_proto=define
11060 set d_ctime_r_proto ctime_r $hdrs
11064 case "$d_ctime_r_proto" in
11066 case "$ctime_r_proto" in
11067 ''|0) try='char* ctime_r(const time_t*, char*);'
11068 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SB ;;
11070 case "$ctime_r_proto" in
11071 ''|0) try='char* ctime_r(const time_t*, char*, int);'
11072 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SBI ;;
11074 case "$ctime_r_proto" in
11075 ''|0) try='int ctime_r(const time_t*, char*);'
11076 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SB ;;
11078 case "$ctime_r_proto" in
11079 ''|0) try='int ctime_r(const time_t*, char*, int);'
11080 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SBI ;;
11082 case "$ctime_r_proto" in
11083 ''|0) d_ctime_r=undef
11085 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
11086 * ) case "$ctime_r_proto" in
11087 REENTRANT_PROTO*) ;;
11088 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
11090 echo "Prototype: $try" ;;
11093 *) case "$usethreads" in
11094 define) echo "ctime_r has no prototype, not using it." >&4 ;;
11105 : see if cuserid exists
11106 set cuserid d_cuserid
11109 : see if this is a limits.h system
11110 set limits.h i_limits
11113 : see if this is a float.h system
11114 set float.h i_float
11117 : See if number of significant digits in a double precision number is known
11119 $cat >dbl_dig.c <<EOM
11120 #$i_limits I_LIMITS
11123 #include <limits.h>
11129 printf("Contains DBL_DIG");
11132 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
11133 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
11134 echo "DBL_DIG found." >&4
11137 echo "DBL_DIG NOT found." >&4
11144 : see if dbm.h is available
11145 : see if dbmclose exists
11146 set dbmclose d_dbmclose
11149 case "$d_dbmclose" in
11159 *) set rpcsvc/dbm.h i_rpcsvcdbm
11164 *) echo "We won't be including <dbm.h>"
11174 : see if prototype for dbminit is available
11176 set d_dbminitproto dbminit $i_dbm dbm.h
11179 : see if difftime exists
11180 set difftime d_difftime
11183 : see if this is a dirent system
11185 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
11187 echo "<dirent.h> found." >&4
11190 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
11191 echo "<sys/dir.h> found." >&4
11194 xinc=`./findhdr sys/ndir.h`
11196 echo "<dirent.h> NOT found." >&4
11201 : Look for type of directory structure.
11203 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11205 case "$direntrytype" in
11207 case "$i_dirent" in
11208 $define) guess1='struct dirent' ;;
11209 *) guess1='struct direct' ;;
11212 *) guess1="$direntrytype"
11217 'struct dirent') guess2='struct direct' ;;
11218 *) guess2='struct dirent' ;;
11221 if $contains "$guess1" try.c >/dev/null 2>&1; then
11222 direntrytype="$guess1"
11223 echo "Your directory entries are $direntrytype." >&4
11224 elif $contains "$guess2" try.c >/dev/null 2>&1; then
11225 direntrytype="$guess2"
11226 echo "Your directory entries seem to be $direntrytype." >&4
11228 echo "I don't recognize your system's directory entries." >&4
11229 rp="What type is used for directory entries on this system?"
11232 direntrytype="$ans"
11237 : see if the directory entry stores field length
11239 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11240 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
11241 echo "Good, your directory entry keeps length information in d_namlen." >&4
11244 echo "Your directory entry does not know about the d_namlen field." >&4
11251 : see if this is an sysdir system
11252 set sys/dir.h i_sysdir
11255 : see if this is an sysndir system
11256 set sys/ndir.h i_sysndir
11261 $cat >dirfd.c <<EOM
11263 #$i_stdlib I_STDLIB
11265 #include <stdlib.h>
11267 #$i_dirent I_DIRENT /**/
11268 #$i_sysdir I_SYS_DIR /**/
11269 #$i_sysndir I_SYS_NDIR /**/
11270 #$i_systypes I_SYS_TYPES /**/
11271 #if defined(I_SYS_TYPES)
11272 #include <sys/types.h>
11274 #if defined(I_DIRENT)
11275 #include <dirent.h>
11276 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11277 #include <sys/dir.h>
11281 #include <sys/ndir.h>
11285 #include <ndir.h> /* may be wrong in the future */
11287 #include <sys/dir.h>
11293 DIR *dirp = opendir(".");
11294 if (dirfd(dirp) >= 0)
11302 if eval $compile; then
11306 $define) echo "dirfd() found." >&4 ;;
11307 *) echo "dirfd() NOT found." >&4 ;;
11313 : see if dlerror exists
11316 set dlerror d_dlerror
11320 : see if dlfcn is available
11321 set dlfcn.h i_dlfcn
11328 On a few systems, the dynamically loaded modules that perl generates and uses
11329 will need a different extension than shared libs. The default will probably
11335 *) dflt="$dlext" ;;
11337 rp='What is the extension of dynamically loaded modules'
11346 : Check if dlsym need a leading underscore
11352 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11353 $cat >dyna.c <<'EOM'
11360 #$i_stdlib I_STDLIB
11362 #include <stdlib.h>
11366 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
11368 #include <sys/types.h>
11373 extern int fred() ;
11382 int mode = RTLD_LAZY ;
11384 handle = dlopen("./dyna.$dlext", mode) ;
11385 if (handle == NULL) {
11390 symbol = dlsym(handle, "fred") ;
11391 if (symbol == NULL) {
11392 /* try putting a leading underscore */
11393 symbol = dlsym(handle, "_fred") ;
11394 if (symbol == NULL) {
11407 : Call the object file tmp-dyna.o in case dlext=o.
11408 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
11409 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
11410 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
11411 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
11414 1) echo "Test program failed using dlopen." >&4
11415 echo "Perhaps you should not use dynamic loading." >&4;;
11416 2) echo "Test program failed using dlsym." >&4
11417 echo "Perhaps you should not use dynamic loading." >&4;;
11418 3) echo "dlsym needs a leading underscore" >&4
11420 4) echo "dlsym doesn't need a leading underscore." >&4;;
11423 echo "I can't compile and run the test program." >&4
11424 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
11429 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
11434 : see if drand48_r exists
11435 set drand48_r d_drand48_r
11437 case "$d_drand48_r" in
11439 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
11440 case "$d_drand48_r_proto:$usethreads" in
11441 ":define") d_drand48_r_proto=define
11442 set d_drand48_r_proto drand48_r $hdrs
11446 case "$d_drand48_r_proto" in
11448 case "$drand48_r_proto" in
11449 ''|0) try='int drand48_r(struct drand48_data*, double*);'
11450 ./protochk "extern $try" $hdrs && drand48_r_proto=I_ST ;;
11452 case "$drand48_r_proto" in
11453 ''|0) d_drand48_r=undef
11455 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
11456 * ) case "$drand48_r_proto" in
11457 REENTRANT_PROTO*) ;;
11458 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
11460 echo "Prototype: $try" ;;
11463 *) case "$usethreads" in
11464 define) echo "drand48_r has no prototype, not using it." >&4 ;;
11471 *) drand48_r_proto=0
11475 : see if prototype for drand48 is available
11477 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
11480 : see if dup2 exists
11484 : see if eaccess exists
11485 set eaccess d_eaccess
11488 : see if endgrent exists
11489 set endgrent d_endgrent
11492 : see if this is an grp system
11498 xxx=`./findhdr grp.h`
11499 $cppstdin $cppflags $cppminus < $xxx >$$.h
11501 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
11513 set d_grpasswd; eval $setvar
11517 : see if endgrent_r exists
11518 set endgrent_r d_endgrent_r
11520 case "$d_endgrent_r" in
11522 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11523 case "$d_endgrent_r_proto:$usethreads" in
11524 ":define") d_endgrent_r_proto=define
11525 set d_endgrent_r_proto endgrent_r $hdrs
11529 case "$d_endgrent_r_proto" in
11531 case "$endgrent_r_proto" in
11532 ''|0) try='int endgrent_r(FILE**);'
11533 ./protochk "extern $try" $hdrs && endgrent_r_proto=I_H ;;
11535 case "$endgrent_r_proto" in
11536 ''|0) try='void endgrent_r(FILE**);'
11537 ./protochk "extern $try" $hdrs && endgrent_r_proto=V_H ;;
11539 case "$endgrent_r_proto" in
11540 ''|0) d_endgrent_r=undef
11542 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
11543 * ) case "$endgrent_r_proto" in
11544 REENTRANT_PROTO*) ;;
11545 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
11547 echo "Prototype: $try" ;;
11550 *) case "$usethreads" in
11551 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
11558 *) endgrent_r_proto=0
11562 : see if endhostent exists
11563 set endhostent d_endhent
11566 : see if this is a netdb.h system
11567 set netdb.h i_netdb
11570 : see if endhostent_r exists
11571 set endhostent_r d_endhostent_r
11573 case "$d_endhostent_r" in
11575 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11576 case "$d_endhostent_r_proto:$usethreads" in
11577 ":define") d_endhostent_r_proto=define
11578 set d_endhostent_r_proto endhostent_r $hdrs
11582 case "$d_endhostent_r_proto" in
11584 case "$endhostent_r_proto" in
11585 ''|0) try='int endhostent_r(struct hostent_data*);'
11586 ./protochk "extern $try" $hdrs && endhostent_r_proto=I_D ;;
11588 case "$endhostent_r_proto" in
11589 ''|0) try='void endhostent_r(struct hostent_data*);'
11590 ./protochk "extern $try" $hdrs && endhostent_r_proto=V_D ;;
11592 case "$endhostent_r_proto" in
11593 ''|0) d_endhostent_r=undef
11594 endhostent_r_proto=0
11595 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
11596 * ) case "$endhostent_r_proto" in
11597 REENTRANT_PROTO*) ;;
11598 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
11600 echo "Prototype: $try" ;;
11603 *) case "$usethreads" in
11604 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
11606 d_endhostent_r=undef
11607 endhostent_r_proto=0
11611 *) endhostent_r_proto=0
11615 : see if endnetent exists
11616 set endnetent d_endnent
11619 : see if endnetent_r exists
11620 set endnetent_r d_endnetent_r
11622 case "$d_endnetent_r" in
11624 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11625 case "$d_endnetent_r_proto:$usethreads" in
11626 ":define") d_endnetent_r_proto=define
11627 set d_endnetent_r_proto endnetent_r $hdrs
11631 case "$d_endnetent_r_proto" in
11633 case "$endnetent_r_proto" in
11634 ''|0) try='int endnetent_r(struct netent_data*);'
11635 ./protochk "extern $try" $hdrs && endnetent_r_proto=I_D ;;
11637 case "$endnetent_r_proto" in
11638 ''|0) try='void endnetent_r(struct netent_data*);'
11639 ./protochk "extern $try" $hdrs && endnetent_r_proto=V_D ;;
11641 case "$endnetent_r_proto" in
11642 ''|0) d_endnetent_r=undef
11643 endnetent_r_proto=0
11644 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
11645 * ) case "$endnetent_r_proto" in
11646 REENTRANT_PROTO*) ;;
11647 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
11649 echo "Prototype: $try" ;;
11652 *) case "$usethreads" in
11653 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
11655 d_endnetent_r=undef
11656 endnetent_r_proto=0
11660 *) endnetent_r_proto=0
11664 : see if endprotoent exists
11665 set endprotoent d_endpent
11668 : see if endprotoent_r exists
11669 set endprotoent_r d_endprotoent_r
11671 case "$d_endprotoent_r" in
11673 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11674 case "$d_endprotoent_r_proto:$usethreads" in
11675 ":define") d_endprotoent_r_proto=define
11676 set d_endprotoent_r_proto endprotoent_r $hdrs
11680 case "$d_endprotoent_r_proto" in
11682 case "$endprotoent_r_proto" in
11683 ''|0) try='int endprotoent_r(struct protoent_data*);'
11684 ./protochk "extern $try" $hdrs && endprotoent_r_proto=I_D ;;
11686 case "$endprotoent_r_proto" in
11687 ''|0) try='void endprotoent_r(struct protoent_data*);'
11688 ./protochk "extern $try" $hdrs && endprotoent_r_proto=V_D ;;
11690 case "$endprotoent_r_proto" in
11691 ''|0) d_endprotoent_r=undef
11692 endprotoent_r_proto=0
11693 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
11694 * ) case "$endprotoent_r_proto" in
11695 REENTRANT_PROTO*) ;;
11696 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
11698 echo "Prototype: $try" ;;
11701 *) case "$usethreads" in
11702 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
11704 d_endprotoent_r=undef
11705 endprotoent_r_proto=0
11709 *) endprotoent_r_proto=0
11713 : see if endpwent exists
11714 set endpwent d_endpwent
11717 : see if this is a pwd.h system
11723 xxx=`./findhdr pwd.h`
11724 $cppstdin $cppflags $cppminus < $xxx >$$.h
11726 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
11734 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
11742 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
11750 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
11758 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
11766 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
11774 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
11782 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
11794 set d_pwquota; eval $setvar
11795 set d_pwage; eval $setvar
11796 set d_pwchange; eval $setvar
11797 set d_pwclass; eval $setvar
11798 set d_pwexpire; eval $setvar
11799 set d_pwcomment; eval $setvar
11800 set d_pwgecos; eval $setvar
11801 set d_pwpasswd; eval $setvar
11805 : see if endpwent_r exists
11806 set endpwent_r d_endpwent_r
11808 case "$d_endpwent_r" in
11810 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
11811 case "$d_endpwent_r_proto:$usethreads" in
11812 ":define") d_endpwent_r_proto=define
11813 set d_endpwent_r_proto endpwent_r $hdrs
11817 case "$d_endpwent_r_proto" in
11819 case "$endpwent_r_proto" in
11820 ''|0) try='int endpwent_r(FILE**);'
11821 ./protochk "extern $try" $hdrs && endpwent_r_proto=I_H ;;
11823 case "$endpwent_r_proto" in
11824 ''|0) try='void endpwent_r(FILE**);'
11825 ./protochk "extern $try" $hdrs && endpwent_r_proto=V_H ;;
11827 case "$endpwent_r_proto" in
11828 ''|0) d_endpwent_r=undef
11830 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
11831 * ) case "$endpwent_r_proto" in
11832 REENTRANT_PROTO*) ;;
11833 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
11835 echo "Prototype: $try" ;;
11838 *) case "$usethreads" in
11839 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
11846 *) endpwent_r_proto=0
11850 : see if endservent exists
11851 set endservent d_endsent
11854 : see if endservent_r exists
11855 set endservent_r d_endservent_r
11857 case "$d_endservent_r" in
11859 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11860 case "$d_endservent_r_proto:$usethreads" in
11861 ":define") d_endservent_r_proto=define
11862 set d_endservent_r_proto endservent_r $hdrs
11866 case "$d_endservent_r_proto" in
11868 case "$endservent_r_proto" in
11869 ''|0) try='int endservent_r(struct servent_data*);'
11870 ./protochk "extern $try" $hdrs && endservent_r_proto=I_D ;;
11872 case "$endservent_r_proto" in
11873 ''|0) try='void endservent_r(struct servent_data*);'
11874 ./protochk "extern $try" $hdrs && endservent_r_proto=V_D ;;
11876 case "$endservent_r_proto" in
11877 ''|0) d_endservent_r=undef
11878 endservent_r_proto=0
11879 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
11880 * ) case "$endservent_r_proto" in
11881 REENTRANT_PROTO*) ;;
11882 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
11884 echo "Prototype: $try" ;;
11887 *) case "$usethreads" in
11888 define) echo "endservent_r has no prototype, not using it." >&4 ;;
11890 d_endservent_r=undef
11891 endservent_r_proto=0
11895 *) endservent_r_proto=0
11899 : Locate the flags for 'open()'
11902 #include <sys/types.h>
11907 #include <sys/file.h>
11909 #$i_stdlib I_STDLIB
11911 #include <stdlib.h>
11922 : check sys/file.h first to get FREAD on Sun
11923 if $test `./findhdr sys/file.h` && \
11924 set try -DI_SYS_FILE && eval $compile; then
11926 echo "<sys/file.h> defines the O_* constants..." >&4
11927 if $run ./try; then
11928 echo "and you have the 3 argument form of open()." >&4
11931 echo "but not the 3 argument form of open(). Oh, well." >&4
11934 elif $test `./findhdr fcntl.h` && \
11935 set try -DI_FCNTL && eval $compile; then
11937 echo "<fcntl.h> defines the O_* constants..." >&4
11938 if $run ./try; then
11939 echo "and you have the 3 argument form of open()." >&4
11942 echo "but not the 3 argument form of open(). Oh, well." >&4
11947 echo "I can't find the O_* constant definitions! You got problems." >&4
11953 : see which of string.h or strings.h is needed
11955 strings=`./findhdr string.h`
11956 if $test "$strings" && $test -r "$strings"; then
11957 echo "Using <string.h> instead of <strings.h>." >&4
11961 strings=`./findhdr strings.h`
11962 if $test "$strings" && $test -r "$strings"; then
11963 echo "Using <strings.h> instead of <string.h>." >&4
11965 echo "No string header found -- You'll surely have problems." >&4
11970 case "$i_string" in
11971 "$undef") strings=`./findhdr strings.h`;;
11972 *) strings=`./findhdr string.h`;;
11975 : see if this is a sys/file.h system
11980 : do we need to include sys/file.h ?
11984 if $h_sysfile; then
11986 echo "We'll be including <sys/file.h>." >&4
11989 echo "We won't be including <sys/file.h>." >&4
11999 : see if fcntl.h is there
12004 : see if we can include fcntl.h
12010 echo "We'll be including <fcntl.h>." >&4
12013 if $h_sysfile; then
12014 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12016 echo "We won't be including <fcntl.h>." >&4
12028 : check for non-blocking I/O stuff
12029 case "$h_sysfile" in
12030 true) echo "#include <sys/file.h>" > head.c;;
12033 true) echo "#include <fcntl.h>" > head.c;;
12034 *) echo "#include <sys/fcntl.h>" > head.c;;
12039 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
12040 case "$o_nonblock" in
12042 $cat head.c > try.c
12043 $cat >>try.c <<EOCP
12045 #$i_stdlib I_STDLIB
12047 #include <stdlib.h>
12055 printf("O_NONBLOCK\n");
12059 printf("O_NDELAY\n");
12063 printf("FNDELAY\n");
12070 if eval $compile_ok; then
12071 o_nonblock=`$run ./try`
12072 case "$o_nonblock" in
12073 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
12074 *) echo "Seems like we can use $o_nonblock.";;
12077 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
12080 *) echo "Using $hint value $o_nonblock.";;
12082 $rm -f try try.* .out core
12085 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
12088 $cat head.c > try.c
12089 $cat >>try.c <<EOCP
12091 #include <sys/types.h>
12092 #include <signal.h>
12094 #$i_stdlib I_STDLIB
12096 #include <stdlib.h>
12102 #define MY_O_NONBLOCK $o_nonblock
12103 #ifndef errno /* XXX need better Configure test */
12106 #$i_unistd I_UNISTD
12108 #include <unistd.h>
12110 #$i_string I_STRING
12112 #include <string.h>
12114 #include <strings.h>
12116 $signal_t blech(int x) { exit(3); }
12118 $cat >> try.c <<'EOCP'
12126 pipe(pd); /* Down: child -> parent */
12127 pipe(pu); /* Up: parent -> child */
12130 close(pd[1]); /* Parent reads from pd[0] */
12131 close(pu[0]); /* Parent writes (blocking) to pu[1] */
12133 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
12138 signal(SIGALRM, blech);
12140 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
12142 sprintf(string, "%d\n", ret);
12143 write(2, string, strlen(string));
12146 if (errno == EAGAIN) {
12147 printf("EAGAIN\n");
12152 if (errno == EWOULDBLOCK)
12153 printf("EWOULDBLOCK\n");
12156 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
12157 sleep(2); /* Give it time to close our pipe */
12159 ret = read(pd[0], buf, 1); /* Should read EOF */
12161 sprintf(string, "%d\n", ret);
12162 write(4, string, strlen(string));
12166 close(pd[0]); /* We write to pd[1] */
12167 close(pu[1]); /* We read from pu[0] */
12168 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
12169 close(pd[1]); /* Pipe pd is now fully closed! */
12170 exit(0); /* Bye bye, thank you for playing! */
12174 if eval $compile_ok; then
12175 echo "$startsh" >mtry
12176 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
12178 ./mtry >/dev/null 2>&1
12180 0) eagain=`$cat try.out`;;
12181 1) echo "Could not perform non-blocking setting!";;
12182 2) echo "I did a successful read() for something that was not there!";;
12183 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
12184 4) echo "Could not find F_SETFL!";;
12185 *) echo "Something terribly wrong happened during testing.";;
12187 rd_nodata=`$cat try.ret`
12188 echo "A read() system call with no data present returns $rd_nodata."
12189 case "$rd_nodata" in
12192 echo "(That's peculiar, fixing that to be -1.)"
12198 echo "Forcing errno EAGAIN on read() with no data available."
12202 echo "Your read() sets errno to $eagain when no data is available."
12205 status=`$cat try.err`
12207 0) echo "And it correctly returns 0 to signal EOF.";;
12208 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
12209 *) echo "However, your read() returns '$status' on EOF??";;
12212 if test "$status" = "$rd_nodata"; then
12213 echo "WARNING: you can't distinguish between EOF and no data!"
12217 echo "I can't compile the test program--assuming errno EAGAIN will do."
12224 echo "Using $hint value $eagain."
12225 echo "Your read() returns $rd_nodata when no data is present."
12226 case "$d_eofnblk" in
12227 "$define") echo "And you can see EOF because read() returns 0.";;
12228 "$undef") echo "But you can't see EOF status from read() returned value.";;
12230 echo "(Assuming you can't see EOF status from read anyway.)"
12236 $rm -f try try.* .out core head.c mtry
12238 : see if _ptr and _cnt from stdio act std
12241 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12242 echo "(Looks like you have stdio.h from BSD.)"
12243 case "$stdio_ptr" in
12244 '') stdio_ptr='((fp)->_p)'
12247 *) ptr_lval=$d_stdio_ptr_lval;;
12249 case "$stdio_cnt" in
12250 '') stdio_cnt='((fp)->_r)'
12253 *) cnt_lval=$d_stdio_cnt_lval;;
12255 case "$stdio_base" in
12256 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12258 case "$stdio_bufsiz" in
12259 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12261 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12262 echo "(Looks like you have stdio.h from Linux.)"
12263 case "$stdio_ptr" in
12264 '') stdio_ptr='((fp)->_IO_read_ptr)'
12267 *) ptr_lval=$d_stdio_ptr_lval;;
12269 case "$stdio_cnt" in
12270 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12273 *) cnt_lval=$d_stdio_cnt_lval;;
12275 case "$stdio_base" in
12276 '') stdio_base='((fp)->_IO_read_base)';;
12278 case "$stdio_bufsiz" in
12279 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12282 case "$stdio_ptr" in
12283 '') stdio_ptr='((fp)->_ptr)'
12286 *) ptr_lval=$d_stdio_ptr_lval;;
12288 case "$stdio_cnt" in
12289 '') stdio_cnt='((fp)->_cnt)'
12292 *) cnt_lval=$d_stdio_cnt_lval;;
12294 case "$stdio_base" in
12295 '') stdio_base='((fp)->_base)';;
12297 case "$stdio_bufsiz" in
12298 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12302 : test whether _ptr and _cnt really work
12303 echo "Checking how std your stdio is..." >&4
12306 #$i_stdlib I_STDLIB
12308 #include <stdlib.h>
12310 #define FILE_ptr(fp) $stdio_ptr
12311 #define FILE_cnt(fp) $stdio_cnt
12313 FILE *fp = fopen("try.c", "r");
12316 18 <= FILE_cnt(fp) &&
12317 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12325 if eval $compile && $to try.c; then
12326 if $run ./try; then
12327 echo "Your stdio acts pretty std."
12330 echo "Your stdio isn't very std."
12333 echo "Your stdio doesn't appear very std."
12337 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12338 # direct buffer manipulation no longer works. The Configure tests
12339 # should be changed to correctly detect this, but until then,
12340 # the following check should at least let perl compile and run.
12341 # (This quick fix should be updated before 5.8.1.)
12342 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12343 # A. Dougherty, June 3, 2002.
12344 case "$d_gnulibc" in
12346 case "$gnulibc_version" in
12350 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12359 : Can _ptr be used as an lvalue?
12360 case "$d_stdstdio$ptr_lval" in
12361 $define$define) val=$define ;;
12364 set d_stdio_ptr_lval
12367 : Can _cnt be used as an lvalue?
12368 case "$d_stdstdio$cnt_lval" in
12369 $define$define) val=$define ;;
12372 set d_stdio_cnt_lval
12376 : test whether setting _ptr sets _cnt as a side effect
12377 d_stdio_ptr_lval_sets_cnt="$undef"
12378 d_stdio_ptr_lval_nochange_cnt="$undef"
12379 case "$d_stdio_ptr_lval$d_stdstdio" in
12381 echo "Checking to see what happens if we set the stdio ptr..." >&4
12384 /* Can we scream? */
12385 /* Eat dust sed :-) */
12386 /* In the buffer space, no one can hear you scream. */
12387 #$i_stdlib I_STDLIB
12389 #include <stdlib.h>
12391 #define FILE_ptr(fp) $stdio_ptr
12392 #define FILE_cnt(fp) $stdio_cnt
12393 #include <sys/types.h>
12395 FILE *fp = fopen("try.c", "r");
12400 puts("Fail even to read");
12403 c = getc(fp); /* Read away the first # */
12405 puts("Fail even to read");
12409 18 <= FILE_cnt(fp) &&
12410 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12412 puts("Fail even to read");
12415 ptr = (char*) FILE_ptr(fp);
12416 cnt = (size_t)FILE_cnt(fp);
12418 FILE_ptr(fp) += 42;
12420 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12421 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12424 if (FILE_cnt(fp) <= 20) {
12425 printf ("Fail (<20 chars to test)");
12428 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12429 puts("Fail compare");
12432 if (cnt == FILE_cnt(fp)) {
12433 puts("Pass_unchanged");
12436 if (FILE_cnt(fp) == (cnt - 42)) {
12437 puts("Pass_changed");
12440 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12446 if eval $compile && $to try.c; then
12447 case `$run ./try` in
12449 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12450 d_stdio_ptr_lval_sets_cnt="$define" ;;
12452 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12453 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12455 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12457 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12460 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12466 : see if _base is also standard
12468 case "$d_stdstdio" in
12472 #$i_stdlib I_STDLIB
12474 #include <stdlib.h>
12476 #define FILE_base(fp) $stdio_base
12477 #define FILE_bufsiz(fp) $stdio_bufsiz
12479 FILE *fp = fopen("try.c", "r");
12482 19 <= FILE_bufsiz(fp) &&
12483 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
12490 if eval $compile && $to try.c; then
12491 if $run ./try; then
12492 echo "And its _base field acts std."
12495 echo "But its _base field isn't std."
12498 echo "However, it seems to be lacking the _base field."
12506 : see if fast_stdio exists
12508 case "$d_stdstdio:$d_stdio_ptr_lval" in
12510 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
12512 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
12523 : see if fchdir exists
12524 set fchdir d_fchdir
12527 : see if fchmod exists
12528 set fchmod d_fchmod
12531 : see if fchown exists
12532 set fchown d_fchown
12535 : see if this is an fcntl system
12540 : See if fcntl-based locking works.
12542 #$i_stdlib I_STDLIB
12544 #include <stdlib.h>
12546 #include <unistd.h>
12548 #include <signal.h>
12549 $signal_t blech(int x) { exit(3); }
12551 #if defined(F_SETLK) && defined(F_SETLKW)
12552 struct flock flock;
12554 fd = open("try.c", O_RDONLY);
12555 flock.l_type = F_RDLCK;
12556 flock.l_whence = SEEK_SET;
12557 flock.l_start = flock.l_len = 0;
12558 signal(SIGALRM, blech);
12560 retval = fcntl(fd, F_SETLK, &flock);
12562 (retval < 0 ? exit(2) : exit(0));
12568 echo "Checking if fcntl-based file locking works... "
12572 if eval $compile_ok; then
12573 if $run ./try; then
12574 echo "Yes, it seems to work."
12577 echo "Nope, it didn't work."
12582 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
12583 *** This is (almost) impossible.
12584 *** If your NFS lock daemons are not feeling well, something like
12585 *** this may happen, please investigate. Cannot continue, aborting.
12593 echo "I'm unable to compile the test program, so I'll assume not."
12598 echo "Nope, since you don't even have fcntl()."
12601 set d_fcntl_can_lock
12606 : check for fd_set items
12609 Checking to see how well your C compiler handles fd_set and friends ...
12612 #$i_stdlib I_STDLIB
12614 #include <stdlib.h>
12616 #$i_systime I_SYS_TIME
12617 #$i_sysselct I_SYS_SELECT
12618 #$d_socket HAS_SOCKET
12619 #include <sys/types.h>
12621 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
12624 #include <sys/time.h>
12626 #ifdef I_SYS_SELECT
12627 #include <sys/select.h>
12636 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
12644 if eval $compile; then
12645 d_fds_bits="$define"
12647 echo "Well, your system knows about the normal fd_set typedef..." >&4
12648 if $run ./try; then
12649 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
12650 d_fd_macros="$define"
12653 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
12655 d_fd_macros="$undef"
12659 Hmm, your compiler has some difficulty with fd_set. Checking further...
12662 if eval $compile; then
12663 d_fds_bits="$undef"
12665 echo "Well, your system has some sort of fd_set available..." >&4
12666 if $run ./try; then
12667 echo "and you have the normal fd_set macros." >&4
12668 d_fd_macros="$define"
12671 but not the normal fd_set macros! Gross! More work for me...
12673 d_fd_macros="$undef"
12676 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
12678 d_fds_bits="$undef"
12679 d_fd_macros="$undef"
12684 : see if fgetpos exists
12685 set fgetpos d_fgetpos
12688 : see if finite exists
12689 set finite d_finite
12692 : see if finitel exists
12693 set finitel d_finitel
12696 : see if flock exists
12700 : see if prototype for flock is available
12702 set d_flockproto flock $i_sysfile sys/file.h
12705 : see if fork exists
12709 : see if fp_class exists
12710 set fp_class d_fp_class
12713 : see if pathconf exists
12714 set pathconf d_pathconf
12717 : see if fpathconf exists
12718 set fpathconf d_fpathconf
12721 : see if fpclass exists
12722 set fpclass d_fpclass
12725 : see if fpclassify exists
12726 set fpclassify d_fpclassify
12729 : see if fpclassl exists
12730 set fpclassl d_fpclassl
12734 : check for fpos64_t
12736 echo "Checking to see if you have fpos64_t..." >&4
12739 int main() { fpos64_t x = 7; }
12742 if eval $compile; then
12744 echo "You have fpos64_t."
12747 echo "You do not have fpos64_t."
12748 case "$fpossize" in
12749 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
12756 : see if frexpl exists
12757 set frexpl d_frexpl
12760 : see if this is a sys/param system
12761 set sys/param.h i_sysparam
12764 : see if this is a sys/mount.h system
12765 set sys/mount.h i_sysmount
12770 echo "Checking to see if your system supports struct fs_data..." >&4
12771 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
12773 case "$d_fs_data_s" in
12774 "$define") echo "Yes, it does." ;;
12775 *) echo "No, it doesn't." ;;
12778 : see if fseeko exists
12779 set fseeko d_fseeko
12781 case "$longsize" in
12782 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
12785 : see if fsetpos exists
12786 set fsetpos d_fsetpos
12790 : see if fstatfs exists
12791 set fstatfs d_fstatfs
12795 : see if statvfs exists
12796 set statvfs d_statvfs
12799 : see if fstatvfs exists
12800 set fstatvfs d_fstatvfs
12804 : see if fsync exists
12808 : see if ftello exists
12809 set ftello d_ftello
12811 case "$longsize" in
12812 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
12816 : check for a working futimes
12818 echo "Checking for a working futimes()" >&4
12821 #include <sys/time.h>
12828 fd = open ("try.c", O_RDWR);
12829 if (-1 == fd) exit (1);
12830 rv = futimes (fd, NULL);
12831 exit (rv == -1 ? errno : 0);
12835 if eval $compile; then
12839 0) echo "Yes, it does" >&4
12840 d_futimes="$define"
12842 *) echo "No, it has futimes, but it isn't working ($rc) (probably harmless)\n" >&4
12846 echo "No, it does not (probably harmless)\n" >&4
12848 $rm -f try.* try core core.try.*
12850 : see if getcwd exists
12851 set getcwd d_getcwd
12854 : see if getespwnam exists
12855 set getespwnam d_getespwnam
12859 : see if getfsstat exists
12860 set getfsstat d_getfsstat
12863 : see if getgrent exists
12864 set getgrent d_getgrent
12867 : see if getgrent_r exists
12868 set getgrent_r d_getgrent_r
12870 case "$d_getgrent_r" in
12872 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12873 case "$d_getgrent_r_proto:$usethreads" in
12874 ":define") d_getgrent_r_proto=define
12875 set d_getgrent_r_proto getgrent_r $hdrs
12879 case "$d_getgrent_r_proto" in
12881 case "$getgrent_r_proto" in
12882 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
12883 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBWR ;;
12885 case "$getgrent_r_proto" in
12886 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
12887 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIR ;;
12889 case "$getgrent_r_proto" in
12890 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
12891 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBW ;;
12893 case "$getgrent_r_proto" in
12894 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
12895 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBI ;;
12897 case "$getgrent_r_proto" in
12898 ''|0) try='int getgrent_r(struct group*, char*, int);'
12899 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBI ;;
12901 case "$getgrent_r_proto" in
12902 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
12903 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIH ;;
12905 case "$getgrent_r_proto" in
12906 ''|0) d_getgrent_r=undef
12908 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
12909 * ) case "$getgrent_r_proto" in
12910 REENTRANT_PROTO*) ;;
12911 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
12913 echo "Prototype: $try" ;;
12916 *) case "$usethreads" in
12917 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
12924 *) getgrent_r_proto=0
12928 : see if getgrgid_r exists
12929 set getgrgid_r d_getgrgid_r
12931 case "$d_getgrgid_r" in
12933 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12934 case "$d_getgrgid_r_proto:$usethreads" in
12935 ":define") d_getgrgid_r_proto=define
12936 set d_getgrgid_r_proto getgrgid_r $hdrs
12940 case "$d_getgrgid_r_proto" in
12942 case "$getgrgid_r_proto" in
12943 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
12944 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
12946 case "$getgrgid_r_proto" in
12947 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
12948 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
12950 case "$getgrgid_r_proto" in
12951 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
12952 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
12954 case "$getgrgid_r_proto" in
12955 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
12956 ./protochk "extern $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
12958 case "$getgrgid_r_proto" in
12959 ''|0) d_getgrgid_r=undef
12961 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
12962 * ) case "$getgrgid_r_proto" in
12963 REENTRANT_PROTO*) ;;
12964 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
12966 echo "Prototype: $try" ;;
12969 *) case "$usethreads" in
12970 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
12977 *) getgrgid_r_proto=0
12981 : see if getgrnam_r exists
12982 set getgrnam_r d_getgrnam_r
12984 case "$d_getgrnam_r" in
12986 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12987 case "$d_getgrnam_r_proto:$usethreads" in
12988 ":define") d_getgrnam_r_proto=define
12989 set d_getgrnam_r_proto getgrnam_r $hdrs
12993 case "$d_getgrnam_r_proto" in
12995 case "$getgrnam_r_proto" in
12996 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
12997 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
12999 case "$getgrnam_r_proto" in
13000 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
13001 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
13003 case "$getgrnam_r_proto" in
13004 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
13005 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CBI ;;
13007 case "$getgrnam_r_proto" in
13008 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
13009 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
13011 case "$getgrnam_r_proto" in
13012 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
13013 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
13015 case "$getgrnam_r_proto" in
13016 ''|0) d_getgrnam_r=undef
13018 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
13019 * ) case "$getgrnam_r_proto" in
13020 REENTRANT_PROTO*) ;;
13021 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
13023 echo "Prototype: $try" ;;
13026 *) case "$usethreads" in
13027 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
13034 *) getgrnam_r_proto=0
13038 : see if gethostbyaddr exists
13039 set gethostbyaddr d_gethbyaddr
13042 : see if gethostbyname exists
13043 set gethostbyname d_gethbyname
13046 : see if gethostent exists
13047 set gethostent d_gethent
13050 : see how we will look up host name
13053 if set gethostname val -f d_gethname; eval $csym; $val; then
13054 echo 'gethostname() found.' >&4
13055 d_gethname="$define"
13058 if set uname val -f d_uname; eval $csym; $val; then
13061 uname() was found, but you're running xenix, and older versions of xenix
13062 have a broken uname(). If you don't really know whether your xenix is old
13063 enough to have a broken system call, use the default answer.
13068 "$define") dflt=n;;
13070 rp='Is your uname() broken?'
13073 n*) d_uname="$define"; call=uname;;
13076 echo 'uname() found.' >&4
13083 case "$d_gethname" in
13084 '') d_gethname="$undef";;
13087 '') d_uname="$undef";;
13089 case "$d_uname$d_gethname" in
13094 Every now and then someone has a $call() that lies about the hostname
13095 but can't be fixed for political or economic reasons. If you wish, I can
13096 pretend $call() isn't there and maybe compute hostname at run-time
13097 thanks to the '$phostname' command.
13100 rp="Shall I ignore $call() from now on?"
13103 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
13106 case "$phostname" in
13107 '') aphostname='';;
13108 *) case "$aphostname" in
13110 *) set X $phostname
13114 file=`./loc $file $file $pth`
13115 aphostname=`echo $file $*`
13120 case "$d_uname$d_gethname" in
13123 case "$phostname" in
13125 echo "There will be no way for $package to get your hostname." >&4;;
13127 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
13131 case "$d_phostname" in
13132 '') d_phostname="$undef";;
13135 : see if gethostbyaddr_r exists
13136 set gethostbyaddr_r d_gethostbyaddr_r
13138 case "$d_gethostbyaddr_r" in
13140 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13141 case "$d_gethostbyaddr_r_proto:$usethreads" in
13142 ":define") d_gethostbyaddr_r_proto=define
13143 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
13147 case "$d_gethostbyaddr_r_proto" in
13149 case "$gethostbyaddr_r_proto" in
13150 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13151 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
13153 case "$gethostbyaddr_r_proto" in
13154 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
13155 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
13157 case "$gethostbyaddr_r_proto" in
13158 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
13159 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
13161 case "$gethostbyaddr_r_proto" in
13162 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
13163 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
13165 case "$gethostbyaddr_r_proto" in
13166 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
13167 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
13169 case "$gethostbyaddr_r_proto" in
13170 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
13171 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
13173 case "$gethostbyaddr_r_proto" in
13174 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
13175 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
13177 case "$gethostbyaddr_r_proto" in
13178 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
13179 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
13181 case "$gethostbyaddr_r_proto" in
13182 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
13183 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
13185 case "$gethostbyaddr_r_proto" in
13186 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
13187 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
13189 case "$gethostbyaddr_r_proto" in
13190 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13191 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
13193 case "$gethostbyaddr_r_proto" in
13194 ''|0) d_gethostbyaddr_r=undef
13195 gethostbyaddr_r_proto=0
13196 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
13197 * ) case "$gethostbyaddr_r_proto" in
13198 REENTRANT_PROTO*) ;;
13199 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
13201 echo "Prototype: $try" ;;
13204 *) case "$usethreads" in
13205 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
13207 d_gethostbyaddr_r=undef
13208 gethostbyaddr_r_proto=0
13212 *) gethostbyaddr_r_proto=0
13216 : see if gethostbyname_r exists
13217 set gethostbyname_r d_gethostbyname_r
13219 case "$d_gethostbyname_r" in
13221 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13222 case "$d_gethostbyname_r_proto:$usethreads" in
13223 ":define") d_gethostbyname_r_proto=define
13224 set d_gethostbyname_r_proto gethostbyname_r $hdrs
13228 case "$d_gethostbyname_r_proto" in
13230 case "$gethostbyname_r_proto" in
13231 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
13232 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
13234 case "$gethostbyname_r_proto" in
13235 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
13236 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
13238 case "$gethostbyname_r_proto" in
13239 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
13240 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
13242 case "$gethostbyname_r_proto" in
13243 ''|0) d_gethostbyname_r=undef
13244 gethostbyname_r_proto=0
13245 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
13246 * ) case "$gethostbyname_r_proto" in
13247 REENTRANT_PROTO*) ;;
13248 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
13250 echo "Prototype: $try" ;;
13253 *) case "$usethreads" in
13254 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13256 d_gethostbyname_r=undef
13257 gethostbyname_r_proto=0
13261 *) gethostbyname_r_proto=0
13265 : see if gethostent_r exists
13266 set gethostent_r d_gethostent_r
13268 case "$d_gethostent_r" in
13270 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13271 case "$d_gethostent_r_proto:$usethreads" in
13272 ":define") d_gethostent_r_proto=define
13273 set d_gethostent_r_proto gethostent_r $hdrs
13277 case "$d_gethostent_r_proto" in
13279 case "$gethostent_r_proto" in
13280 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
13281 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
13283 case "$gethostent_r_proto" in
13284 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
13285 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBIE ;;
13287 case "$gethostent_r_proto" in
13288 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
13289 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBIE ;;
13291 case "$gethostent_r_proto" in
13292 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
13293 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBI ;;
13295 case "$gethostent_r_proto" in
13296 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
13297 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBI ;;
13299 case "$gethostent_r_proto" in
13300 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13301 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SD ;;
13303 case "$gethostent_r_proto" in
13304 ''|0) d_gethostent_r=undef
13305 gethostent_r_proto=0
13306 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13307 * ) case "$gethostent_r_proto" in
13308 REENTRANT_PROTO*) ;;
13309 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13311 echo "Prototype: $try" ;;
13314 *) case "$usethreads" in
13315 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13317 d_gethostent_r=undef
13318 gethostent_r_proto=0
13322 *) gethostent_r_proto=0
13326 : see if prototypes for various gethostxxx netdb.h functions are available
13328 set d_gethostprotos gethostent $i_netdb netdb.h
13331 : see if getitimer exists
13332 set getitimer d_getitimer
13335 : see if getlogin exists
13336 set getlogin d_getlogin
13339 : see if getlogin_r exists
13340 set getlogin_r d_getlogin_r
13342 case "$d_getlogin_r" in
13344 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
13345 case "$d_getlogin_r_proto:$usethreads" in
13346 ":define") d_getlogin_r_proto=define
13347 set d_getlogin_r_proto getlogin_r $hdrs
13351 case "$d_getlogin_r_proto" in
13353 case "$getlogin_r_proto" in
13354 ''|0) try='int getlogin_r(char*, size_t);'
13355 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BW ;;
13357 case "$getlogin_r_proto" in
13358 ''|0) try='int getlogin_r(char*, int);'
13359 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BI ;;
13361 case "$getlogin_r_proto" in
13362 ''|0) try='char* getlogin_r(char*, size_t);'
13363 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BW ;;
13365 case "$getlogin_r_proto" in
13366 ''|0) try='char* getlogin_r(char*, int);'
13367 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BI ;;
13369 case "$getlogin_r_proto" in
13370 ''|0) d_getlogin_r=undef
13372 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
13373 * ) case "$getlogin_r_proto" in
13374 REENTRANT_PROTO*) ;;
13375 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
13377 echo "Prototype: $try" ;;
13380 *) case "$usethreads" in
13381 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
13388 *) getlogin_r_proto=0
13392 : see if getmnt exists
13393 set getmnt d_getmnt
13396 : see if getmntent exists
13397 set getmntent d_getmntent
13400 : see if getnetbyaddr exists
13401 set getnetbyaddr d_getnbyaddr
13404 : see if getnetbyname exists
13405 set getnetbyname d_getnbyname
13408 : see if getnetent exists
13409 set getnetent d_getnent
13412 : see if getnetbyaddr_r exists
13413 set getnetbyaddr_r d_getnetbyaddr_r
13415 case "$d_getnetbyaddr_r" in
13417 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13418 case "$d_getnetbyaddr_r_proto:$usethreads" in
13419 ":define") d_getnetbyaddr_r_proto=define
13420 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
13424 case "$d_getnetbyaddr_r_proto" in
13426 case "$getnetbyaddr_r_proto" in
13427 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
13428 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
13430 case "$getnetbyaddr_r_proto" in
13431 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
13432 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
13434 case "$getnetbyaddr_r_proto" in
13435 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
13436 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
13438 case "$getnetbyaddr_r_proto" in
13439 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
13440 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
13442 case "$getnetbyaddr_r_proto" in
13443 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
13444 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
13446 case "$getnetbyaddr_r_proto" in
13447 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
13448 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
13450 case "$getnetbyaddr_r_proto" in
13451 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
13452 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
13454 case "$getnetbyaddr_r_proto" in
13455 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
13456 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
13458 case "$getnetbyaddr_r_proto" in
13459 ''|0) d_getnetbyaddr_r=undef
13460 getnetbyaddr_r_proto=0
13461 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
13462 * ) case "$getnetbyaddr_r_proto" in
13463 REENTRANT_PROTO*) ;;
13464 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
13466 echo "Prototype: $try" ;;
13469 *) case "$usethreads" in
13470 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
13472 d_getnetbyaddr_r=undef
13473 getnetbyaddr_r_proto=0
13477 *) getnetbyaddr_r_proto=0
13481 : see if getnetbyname_r exists
13482 set getnetbyname_r d_getnetbyname_r
13484 case "$d_getnetbyname_r" in
13486 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13487 case "$d_getnetbyname_r_proto:$usethreads" in
13488 ":define") d_getnetbyname_r_proto=define
13489 set d_getnetbyname_r_proto getnetbyname_r $hdrs
13493 case "$d_getnetbyname_r_proto" in
13495 case "$getnetbyname_r_proto" in
13496 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
13497 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
13499 case "$getnetbyname_r_proto" in
13500 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
13501 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
13503 case "$getnetbyname_r_proto" in
13504 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
13505 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
13507 case "$getnetbyname_r_proto" in
13508 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
13509 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
13511 case "$getnetbyname_r_proto" in
13512 ''|0) d_getnetbyname_r=undef
13513 getnetbyname_r_proto=0
13514 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
13515 * ) case "$getnetbyname_r_proto" in
13516 REENTRANT_PROTO*) ;;
13517 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
13519 echo "Prototype: $try" ;;
13522 *) case "$usethreads" in
13523 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
13525 d_getnetbyname_r=undef
13526 getnetbyname_r_proto=0
13530 *) getnetbyname_r_proto=0
13534 : see if getnetent_r exists
13535 set getnetent_r d_getnetent_r
13537 case "$d_getnetent_r" in
13539 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13540 case "$d_getnetent_r_proto:$usethreads" in
13541 ":define") d_getnetent_r_proto=define
13542 set d_getnetent_r_proto getnetent_r $hdrs
13546 case "$d_getnetent_r_proto" in
13548 case "$getnetent_r_proto" in
13549 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
13550 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
13552 case "$getnetent_r_proto" in
13553 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
13554 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBIE ;;
13556 case "$getnetent_r_proto" in
13557 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
13558 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBIE ;;
13560 case "$getnetent_r_proto" in
13561 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
13562 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBI ;;
13564 case "$getnetent_r_proto" in
13565 ''|0) try='int getnetent_r(struct netent*, char*, int);'
13566 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBI ;;
13568 case "$getnetent_r_proto" in
13569 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
13570 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SD ;;
13572 case "$getnetent_r_proto" in
13573 ''|0) d_getnetent_r=undef
13574 getnetent_r_proto=0
13575 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
13576 * ) case "$getnetent_r_proto" in
13577 REENTRANT_PROTO*) ;;
13578 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
13580 echo "Prototype: $try" ;;
13583 *) case "$usethreads" in
13584 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
13586 d_getnetent_r=undef
13587 getnetent_r_proto=0
13591 *) getnetent_r_proto=0
13595 : see if prototypes for various getnetxxx netdb.h functions are available
13597 set d_getnetprotos getnetent $i_netdb netdb.h
13600 : see if getpagesize exists
13601 set getpagesize d_getpagsz
13605 : see if getprotobyname exists
13606 set getprotobyname d_getpbyname
13609 : see if getprotobynumber exists
13610 set getprotobynumber d_getpbynumber
13613 : see if getprotoent exists
13614 set getprotoent d_getpent
13617 : see if getpgid exists
13618 set getpgid d_getpgid
13621 : see if getpgrp2 exists
13622 set getpgrp2 d_getpgrp2
13625 : see if getppid exists
13626 set getppid d_getppid
13629 : see if getpriority exists
13630 set getpriority d_getprior
13633 : see if getprotobyname_r exists
13634 set getprotobyname_r d_getprotobyname_r
13636 case "$d_getprotobyname_r" in
13638 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13639 case "$d_getprotobyname_r_proto:$usethreads" in
13640 ":define") d_getprotobyname_r_proto=define
13641 set d_getprotobyname_r_proto getprotobyname_r $hdrs
13645 case "$d_getprotobyname_r_proto" in
13647 case "$getprotobyname_r_proto" in
13648 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
13649 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
13651 case "$getprotobyname_r_proto" in
13652 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
13653 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
13655 case "$getprotobyname_r_proto" in
13656 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
13657 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
13659 case "$getprotobyname_r_proto" in
13660 ''|0) d_getprotobyname_r=undef
13661 getprotobyname_r_proto=0
13662 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
13663 * ) case "$getprotobyname_r_proto" in
13664 REENTRANT_PROTO*) ;;
13665 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
13667 echo "Prototype: $try" ;;
13670 *) case "$usethreads" in
13671 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
13673 d_getprotobyname_r=undef
13674 getprotobyname_r_proto=0
13678 *) getprotobyname_r_proto=0
13682 : see if getprotobynumber_r exists
13683 set getprotobynumber_r d_getprotobynumber_r
13685 case "$d_getprotobynumber_r" in
13687 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13688 case "$d_getprotobynumber_r_proto:$usethreads" in
13689 ":define") d_getprotobynumber_r_proto=define
13690 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
13694 case "$d_getprotobynumber_r_proto" in
13696 case "$getprotobynumber_r_proto" in
13697 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
13698 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
13700 case "$getprotobynumber_r_proto" in
13701 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
13702 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
13704 case "$getprotobynumber_r_proto" in
13705 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
13706 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
13708 case "$getprotobynumber_r_proto" in
13709 ''|0) d_getprotobynumber_r=undef
13710 getprotobynumber_r_proto=0
13711 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
13712 * ) case "$getprotobynumber_r_proto" in
13713 REENTRANT_PROTO*) ;;
13714 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
13716 echo "Prototype: $try" ;;
13719 *) case "$usethreads" in
13720 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
13722 d_getprotobynumber_r=undef
13723 getprotobynumber_r_proto=0
13727 *) getprotobynumber_r_proto=0
13731 : see if getprotoent_r exists
13732 set getprotoent_r d_getprotoent_r
13734 case "$d_getprotoent_r" in
13736 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13737 case "$d_getprotoent_r_proto:$usethreads" in
13738 ":define") d_getprotoent_r_proto=define
13739 set d_getprotoent_r_proto getprotoent_r $hdrs
13743 case "$d_getprotoent_r_proto" in
13745 case "$getprotoent_r_proto" in
13746 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
13747 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
13749 case "$getprotoent_r_proto" in
13750 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
13751 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBI ;;
13753 case "$getprotoent_r_proto" in
13754 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
13755 ./protochk "extern $try" $hdrs && getprotoent_r_proto=S_SBI ;;
13757 case "$getprotoent_r_proto" in
13758 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
13759 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SD ;;
13761 case "$getprotoent_r_proto" in
13762 ''|0) d_getprotoent_r=undef
13763 getprotoent_r_proto=0
13764 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
13765 * ) case "$getprotoent_r_proto" in
13766 REENTRANT_PROTO*) ;;
13767 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
13769 echo "Prototype: $try" ;;
13772 *) case "$usethreads" in
13773 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
13775 d_getprotoent_r=undef
13776 getprotoent_r_proto=0
13780 *) getprotoent_r_proto=0
13784 : see if prototypes for various getprotoxxx netdb.h functions are available
13786 set d_getprotoprotos getprotoent $i_netdb netdb.h
13789 : see if getprpwnam exists
13790 set getprpwnam d_getprpwnam
13793 : see if getpwent exists
13794 set getpwent d_getpwent
13797 : see if getpwent_r exists
13798 set getpwent_r d_getpwent_r
13800 case "$d_getpwent_r" in
13802 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13803 case "$d_getpwent_r_proto:$usethreads" in
13804 ":define") d_getpwent_r_proto=define
13805 set d_getpwent_r_proto getpwent_r $hdrs
13809 case "$d_getpwent_r_proto" in
13811 case "$getpwent_r_proto" in
13812 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
13813 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBWR ;;
13815 case "$getpwent_r_proto" in
13816 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
13817 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIR ;;
13819 case "$getpwent_r_proto" in
13820 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
13821 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBW ;;
13823 case "$getpwent_r_proto" in
13824 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
13825 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBI ;;
13827 case "$getpwent_r_proto" in
13828 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
13829 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBI ;;
13831 case "$getpwent_r_proto" in
13832 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
13833 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIH ;;
13835 case "$getpwent_r_proto" in
13836 ''|0) d_getpwent_r=undef
13838 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
13839 * ) case "$getpwent_r_proto" in
13840 REENTRANT_PROTO*) ;;
13841 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
13843 echo "Prototype: $try" ;;
13846 *) case "$usethreads" in
13847 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
13854 *) getpwent_r_proto=0
13858 : see if getpwnam_r exists
13859 set getpwnam_r d_getpwnam_r
13861 case "$d_getpwnam_r" in
13863 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13864 case "$d_getpwnam_r_proto:$usethreads" in
13865 ":define") d_getpwnam_r_proto=define
13866 set d_getpwnam_r_proto getpwnam_r $hdrs
13870 case "$d_getpwnam_r_proto" in
13872 case "$getpwnam_r_proto" in
13873 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
13874 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
13876 case "$getpwnam_r_proto" in
13877 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
13878 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
13880 case "$getpwnam_r_proto" in
13881 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
13882 ./protochk "extern $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
13884 case "$getpwnam_r_proto" in
13885 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
13886 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
13888 case "$getpwnam_r_proto" in
13889 ''|0) d_getpwnam_r=undef
13891 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
13892 * ) case "$getpwnam_r_proto" in
13893 REENTRANT_PROTO*) ;;
13894 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
13896 echo "Prototype: $try" ;;
13899 *) case "$usethreads" in
13900 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
13907 *) getpwnam_r_proto=0
13911 : see if getpwuid_r exists
13912 set getpwuid_r d_getpwuid_r
13914 case "$d_getpwuid_r" in
13916 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13917 case "$d_getpwuid_r_proto:$usethreads" in
13918 ":define") d_getpwuid_r_proto=define
13919 set d_getpwuid_r_proto getpwuid_r $hdrs
13923 case "$d_getpwuid_r_proto" in
13925 case "$getpwuid_r_proto" in
13926 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
13927 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
13929 case "$getpwuid_r_proto" in
13930 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
13931 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
13933 case "$getpwuid_r_proto" in
13934 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
13935 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
13937 case "$getpwuid_r_proto" in
13938 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
13939 ./protochk "extern $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
13941 case "$getpwuid_r_proto" in
13942 ''|0) d_getpwuid_r=undef
13944 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
13945 * ) case "$getpwuid_r_proto" in
13946 REENTRANT_PROTO*) ;;
13947 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
13949 echo "Prototype: $try" ;;
13952 *) case "$usethreads" in
13953 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
13960 *) getpwuid_r_proto=0
13965 : see if getservbyname exists
13966 set getservbyname d_getsbyname
13969 : see if getservbyport exists
13970 set getservbyport d_getsbyport
13973 : see if getservent exists
13974 set getservent d_getsent
13977 : see if getservbyname_r exists
13978 set getservbyname_r d_getservbyname_r
13980 case "$d_getservbyname_r" in
13982 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13983 case "$d_getservbyname_r_proto:$usethreads" in
13984 ":define") d_getservbyname_r_proto=define
13985 set d_getservbyname_r_proto getservbyname_r $hdrs
13989 case "$d_getservbyname_r_proto" in
13991 case "$getservbyname_r_proto" in
13992 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
13993 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
13995 case "$getservbyname_r_proto" in
13996 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
13997 ./protochk "extern $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
13999 case "$getservbyname_r_proto" in
14000 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
14001 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
14003 case "$getservbyname_r_proto" in
14004 ''|0) d_getservbyname_r=undef
14005 getservbyname_r_proto=0
14006 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
14007 * ) case "$getservbyname_r_proto" in
14008 REENTRANT_PROTO*) ;;
14009 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
14011 echo "Prototype: $try" ;;
14014 *) case "$usethreads" in
14015 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
14017 d_getservbyname_r=undef
14018 getservbyname_r_proto=0
14022 *) getservbyname_r_proto=0
14026 : see if getservbyport_r exists
14027 set getservbyport_r d_getservbyport_r
14029 case "$d_getservbyport_r" in
14031 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14032 case "$d_getservbyport_r_proto:$usethreads" in
14033 ":define") d_getservbyport_r_proto=define
14034 set d_getservbyport_r_proto getservbyport_r $hdrs
14038 case "$d_getservbyport_r_proto" in
14040 case "$getservbyport_r_proto" in
14041 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
14042 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
14044 case "$getservbyport_r_proto" in
14045 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
14046 ./protochk "extern $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
14048 case "$getservbyport_r_proto" in
14049 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
14050 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
14052 case "$getservbyport_r_proto" in
14053 ''|0) d_getservbyport_r=undef
14054 getservbyport_r_proto=0
14055 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
14056 * ) case "$getservbyport_r_proto" in
14057 REENTRANT_PROTO*) ;;
14058 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
14060 echo "Prototype: $try" ;;
14063 *) case "$usethreads" in
14064 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
14066 d_getservbyport_r=undef
14067 getservbyport_r_proto=0
14071 *) getservbyport_r_proto=0
14075 : see if getservent_r exists
14076 set getservent_r d_getservent_r
14078 case "$d_getservent_r" in
14080 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14081 case "$d_getservent_r_proto:$usethreads" in
14082 ":define") d_getservent_r_proto=define
14083 set d_getservent_r_proto getservent_r $hdrs
14087 case "$d_getservent_r_proto" in
14089 case "$getservent_r_proto" in
14090 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
14091 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBWR ;;
14093 case "$getservent_r_proto" in
14094 ''|0) try='int getservent_r(struct servent*, char*, int);'
14095 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBI ;;
14097 case "$getservent_r_proto" in
14098 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
14099 ./protochk "extern $try" $hdrs && getservent_r_proto=S_SBI ;;
14101 case "$getservent_r_proto" in
14102 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
14103 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SD ;;
14105 case "$getservent_r_proto" in
14106 ''|0) d_getservent_r=undef
14107 getservent_r_proto=0
14108 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
14109 * ) case "$getservent_r_proto" in
14110 REENTRANT_PROTO*) ;;
14111 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
14113 echo "Prototype: $try" ;;
14116 *) case "$usethreads" in
14117 define) echo "getservent_r has no prototype, not using it." >&4 ;;
14119 d_getservent_r=undef
14120 getservent_r_proto=0
14124 *) getservent_r_proto=0
14128 : see if prototypes for various getservxxx netdb.h functions are available
14130 set d_getservprotos getservent $i_netdb netdb.h
14133 : see if getspnam exists
14134 set getspnam d_getspnam
14137 : see if this is a shadow.h system
14138 set shadow.h i_shadow
14141 : see if getspnam_r exists
14142 set getspnam_r d_getspnam_r
14144 case "$d_getspnam_r" in
14146 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
14147 case "$d_getspnam_r_proto:$usethreads" in
14148 ":define") d_getspnam_r_proto=define
14149 set d_getspnam_r_proto getspnam_r $hdrs
14153 case "$d_getspnam_r_proto" in
14155 case "$getspnam_r_proto" in
14156 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
14157 ./protochk "extern $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
14159 case "$getspnam_r_proto" in
14160 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
14161 ./protochk "extern $try" $hdrs && getspnam_r_proto=S_CSBI ;;
14163 case "$getspnam_r_proto" in
14164 ''|0) d_getspnam_r=undef
14166 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
14167 * ) case "$getspnam_r_proto" in
14168 REENTRANT_PROTO*) ;;
14169 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
14171 echo "Prototype: $try" ;;
14174 *) case "$usethreads" in
14175 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
14182 *) getspnam_r_proto=0
14186 : see if gettimeofday or ftime exists
14187 set gettimeofday d_gettimeod
14189 case "$d_gettimeod" in
14195 val="$undef"; set d_ftime; eval $setvar
14198 case "$d_gettimeod$d_ftime" in
14201 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
14205 : see if gmtime_r exists
14206 set gmtime_r d_gmtime_r
14208 case "$d_gmtime_r" in
14210 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14211 case "$d_gmtime_r_proto:$usethreads" in
14212 ":define") d_gmtime_r_proto=define
14213 set d_gmtime_r_proto gmtime_r $hdrs
14217 case "$d_gmtime_r_proto" in
14219 case "$gmtime_r_proto" in
14220 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
14221 ./protochk "extern $try" $hdrs && gmtime_r_proto=S_TS ;;
14223 case "$gmtime_r_proto" in
14224 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
14225 ./protochk "extern $try" $hdrs && gmtime_r_proto=I_TS ;;
14227 case "$gmtime_r_proto" in
14228 ''|0) d_gmtime_r=undef
14230 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
14231 * ) case "$gmtime_r_proto" in
14232 REENTRANT_PROTO*) ;;
14233 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
14235 echo "Prototype: $try" ;;
14238 *) case "$usethreads" in
14239 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
14246 *) gmtime_r_proto=0
14250 : see if hasmntopt exists
14251 set hasmntopt d_hasmntopt
14254 : see if this is a netinet/in.h or sys/in.h system
14255 set netinet/in.h i_niin sys/in.h i_sysin
14258 : see if arpa/inet.h has to be included
14259 set arpa/inet.h i_arpainet
14262 : see if htonl --and friends-- exists
14267 : Maybe they are macros.
14270 $cat >htonl.c <<EOM
14272 #include <sys/types.h>
14273 #$i_niin I_NETINET_IN
14275 #$i_arpainet I_ARPA_INET
14276 #ifdef I_NETINET_IN
14277 #include <netinet/in.h>
14280 #include <sys/in.h>
14283 #include <arpa/inet.h>
14286 printf("Defined as a macro.");
14289 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
14290 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
14292 echo "But it seems to be defined as a macro." >&4
14300 : see if ilogbl exists
14301 set ilogbl d_ilogbl
14306 if set index val -f; eval $csym; $val; then
14307 if set strchr val -f d_strchr; eval $csym; $val; then
14308 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14311 echo "strchr() found." >&4
14315 echo "index() found." >&4
14320 echo "index() found." >&4
14323 if set strchr val -f d_strchr; eval $csym; $val; then
14326 echo "strchr() found." >&4
14328 echo "No index() or strchr() found!" >&4
14333 set d_strchr; eval $setvar
14335 set d_index; eval $setvar
14337 : check whether inet_aton exists
14338 set inet_aton d_inetaton
14343 $cat >isascii.c <<EOCP
14346 #$i_stdlib I_STDLIB
14348 #include <stdlib.h>
14359 if eval $compile; then
14360 echo "isascii() found." >&4
14363 echo "isascii() NOT found." >&4
14370 : see if isfinite exists
14371 set isfinite d_isfinite
14374 : see if isinf exists
14378 : see if isnan exists
14382 : see if isnanl exists
14383 set isnanl d_isnanl
14386 : see if killpg exists
14387 set killpg d_killpg
14390 : see if lchown exists
14392 $cat > try.c <<'EOCP'
14393 /* System header to define __stub macros and hopefully few prototypes,
14394 which can conflict with char lchown(); below. */
14395 #include <assert.h>
14396 /* Override any gcc2 internal prototype to avoid an error. */
14397 /* We use char because int might match the return type of a gcc2
14398 builtin and then its argument prototype would still apply. */
14401 /* The GNU C library defines this for functions which it implements
14402 to always fail with ENOSYS. Some functions are actually named
14403 something starting with __ and the normal name is an alias. */
14404 #if defined (__stub_lchown) || defined (__stub___lchown)
14412 if eval $compile; then
14413 $echo "lchown() found." >&4
14416 $echo "lchown() NOT found." >&4
14422 : See if number of significant digits in a double precision number is known
14424 $cat >ldbl_dig.c <<EOM
14425 #$i_limits I_LIMITS
14428 #include <limits.h>
14434 printf("Contains LDBL_DIG");
14437 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
14438 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
14439 echo "LDBL_DIG found." >&4
14442 echo "LDBL_DIG NOT found." >&4
14449 : see if this is a math.h system
14453 d_libm_lib_version="$undef"
14456 : check to see if math.h defines _LIB_VERSION
14458 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
14460 #include <unistd.h>
14462 int main (int argc, char *argv[])
14464 printf ("%d\n", _LIB_VERSION);
14469 if eval $compile; then
14471 echo "Yes, it does ($foo)" >&4
14472 d_libm_lib_version="$define"
14474 echo "No, it does not (probably harmless)\n" >&4
14476 $rm -f try.* try core core.try.*
14481 : see if link exists
14485 : see if localtime_r exists
14486 set localtime_r d_localtime_r
14488 case "$d_localtime_r" in
14490 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14491 case "$d_localtime_r_proto:$usethreads" in
14492 ":define") d_localtime_r_proto=define
14493 set d_localtime_r_proto localtime_r $hdrs
14497 case "$d_localtime_r_proto" in
14499 case "$localtime_r_proto" in
14500 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
14501 ./protochk "extern $try" $hdrs && localtime_r_proto=S_TS ;;
14503 case "$localtime_r_proto" in
14504 ''|0) try='int localtime_r(const time_t*, struct tm*);'
14505 ./protochk "extern $try" $hdrs && localtime_r_proto=I_TS ;;
14507 case "$localtime_r_proto" in
14508 ''|0) d_localtime_r=undef
14509 localtime_r_proto=0
14510 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
14511 * ) case "$localtime_r_proto" in
14512 REENTRANT_PROTO*) ;;
14513 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
14515 echo "Prototype: $try" ;;
14518 *) case "$usethreads" in
14519 define) echo "localtime_r has no prototype, not using it." >&4 ;;
14521 d_localtime_r=undef
14522 localtime_r_proto=0
14526 *) localtime_r_proto=0
14530 : see if localtime_r calls tzset
14531 case "$localtime_r_proto" in
14534 /* Does our libc's localtime_r call tzset ?
14535 * return 0 if so, 1 otherwise.
14537 #include <sys/types.h>
14538 #include <unistd.h>
14540 #include <string.h>
14541 #include <malloc.h>
14544 time_t t = time(0L);
14545 char w_tz[]="TZ" "=GMT+5",
14546 e_tz[]="TZ" "=GMT-5",
14547 *tz_e = (char*)malloc(16),
14548 *tz_w = (char*)malloc(16);
14549 struct tm tm_e, tm_w;
14550 memset(&tm_e,'\0',sizeof(struct tm));
14551 memset(&tm_w,'\0',sizeof(struct tm));
14556 localtime_r(&t, &tm_e);
14559 localtime_r(&t, &tm_w);
14561 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
14567 if eval $compile; then
14569 d_localtime_r_needs_tzset=undef;
14571 d_localtime_r_needs_tzset=define;
14574 d_localtime_r_needs_tzset=undef;
14578 d_localtime_r_needs_tzset=undef;
14581 $rm -f try try.* core
14583 : see if localeconv exists
14584 set localeconv d_locconv
14587 : see if lockf exists
14591 : see if prototype for lseek is available
14593 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
14596 : see if lstat exists
14600 : see if madvise exists
14601 set madvise d_madvise
14604 : see if malloc_size exists
14605 set malloc_size d_malloc_size
14608 : see if malloc_size_good exists
14609 set malloc_good_size d_malloc_good_size
14612 : see if mblen exists
14616 : see if mbstowcs exists
14617 set mbstowcs d_mbstowcs
14620 : see if mbtowc exists
14621 set mbtowc d_mbtowc
14624 : see if memchr exists
14625 set memchr d_memchr
14628 : see if memcmp exists
14629 set memcmp d_memcmp
14632 : see if memcpy exists
14633 set memcpy d_memcpy
14636 : see if memmove exists
14637 set memmove d_memmove
14640 : see if memset exists
14641 set memset d_memset
14644 : see if mkdir exists
14648 : see if mkdtemp exists
14649 set mkdtemp d_mkdtemp
14652 : see if mkfifo exists
14653 set mkfifo d_mkfifo
14656 : see if mkstemp exists
14657 set mkstemp d_mkstemp
14660 : see if mkstemps exists
14661 set mkstemps d_mkstemps
14664 : see if mktime exists
14665 set mktime d_mktime
14668 : see if this is a sys/mman.h system
14669 set sys/mman.h i_sysmman
14672 : see if mmap exists
14675 : see what shmat returns
14676 : default to something harmless
14678 case "$i_sysmman$d_mmap" in
14680 $cat >mmap.c <<'END'
14681 #include <sys/mman.h>
14684 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
14689 echo "and it returns ($mmaptype)." >&4
14695 : see if sqrtl exists
14699 : see if scalbnl exists
14700 set scalbnl d_scalbnl
14703 : see if modfl exists
14707 : see if prototype for modfl is available
14709 set d_modflproto modfl $i_math math.h
14712 d_modfl_pow32_bug="$undef"
14714 case "$d_longdbl$d_modfl" in
14717 Checking to see whether your modfl() is okay for large values...
14723 if $test "X$d_modflproto" != "X$define"; then
14724 $cat >>try.c <<EOCP
14725 /* Sigh. many current glibcs provide the function, but do not prototype it. */
14726 long double modfl (long double, long double *);
14729 $cat >>try.c <<EOCP
14731 long double nv = 4294967303.15;
14737 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
14741 case "$osname:$gccversion" in
14742 aix:) saveccflags="$ccflags"
14743 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
14746 if eval $compile; then
14749 *" 4294967303.150000 1.150000 4294967302.000000")
14750 echo >&4 "Your modfl() is broken for large values."
14751 d_modfl_pow32_bug="$define"
14753 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
14757 *" 4294967303.150000 0.150000 4294967303.000000")
14758 echo >&4 "Your modfl() seems okay for large values."
14760 *) echo >&4 "I don't understand your modfl() at all."
14764 $rm -f try.* try core core.try.*
14766 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
14769 case "$osname:$gccversion" in
14770 aix:) ccflags="$saveccflags" ;; # restore
14775 if $test "$uselongdouble" = "$define"; then
14777 if $test "$d_sqrtl" != "$define"; then
14778 message="$message sqrtl"
14780 if $test "$d_modfl" != "$define"; then
14781 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
14782 echo "You have both aintl and copysignl, so I can emulate modfl."
14784 message="$message modfl"
14787 if $test "$d_frexpl" != "$define"; then
14788 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
14789 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
14791 message="$message frexpl"
14795 if $test "$message" != ""; then
14798 *** You requested the use of long doubles but you do not seem to have
14799 *** the following mathematical functions needed for long double support:
14801 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
14802 *** Cannot continue, aborting.
14810 : see if mprotect exists
14811 set mprotect d_mprotect
14814 : see if msgctl exists
14815 set msgctl d_msgctl
14818 : see if msgget exists
14819 set msgget d_msgget
14822 : see if msgsnd exists
14823 set msgsnd d_msgsnd
14826 : see if msgrcv exists
14827 set msgrcv d_msgrcv
14830 : see how much of the 'msg*(2)' library is present.
14833 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
14834 *"$undef"*) h_msg=false;;
14838 case "`ipcs 2>&1`" in
14839 "SVID messages"*"not configured"*)
14840 echo "Your $osname does not have the msg*(2) configured." >&4
14843 set msgctl d_msgctl
14845 set msgget d_msgget
14847 set msgsnd d_msgsnd
14849 set msgrcv d_msgrcv
14855 : we could also check for sys/ipc.h ...
14856 if $h_msg && $test `./findhdr sys/msg.h`; then
14857 echo "You have the full msg*(2) library." >&4
14860 echo "You don't have the full msg*(2) library." >&4
14868 echo "Checking to see if your system supports struct msghdr..." >&4
14869 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
14871 case "$d_msghdr_s" in
14872 "$define") echo "Yes, it does." ;;
14873 *) echo "No, it doesn't." ;;
14877 : see if msync exists
14881 : see if munmap exists
14882 set munmap d_munmap
14885 : see if nice exists
14889 : see if this is a langinfo.h system
14890 set langinfo.h i_langinfo
14893 : see if nl_langinfo exists
14894 set nl_langinfo d_nl_langinfo
14897 : check for length of character
14899 case "$charsize" in
14901 echo "Checking to see how big your characters are (hey, you never know)..." >&4
14904 #$i_stdlib I_STDLIB
14906 #include <stdlib.h>
14910 printf("%d\n", (int)sizeof(char));
14915 if eval $compile_ok; then
14919 echo "(I can't seem to compile the test program. Guessing...)"
14926 rp="What is the size of a character (in bytes)?"
14931 : check for volatile keyword
14933 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
14934 $cat >try.c <<'EOCP'
14937 typedef struct _goo_struct goo_struct;
14938 goo_struct * volatile goo = ((goo_struct *)0);
14939 struct _goo_struct {
14944 typedef unsigned short foo_t;
14945 char *volatile foo;
14947 volatile foo_t blech;
14951 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
14953 echo "Yup, it does."
14956 echo "Nope, it doesn't."
14964 $echo "Choosing the C types to be used for Perl's internal types..." >&4
14966 case "$use64bitint:$d_quad:$quadtype" in
14969 uvtype="$uquadtype"
14974 uvtype="unsigned long"
14980 case "$uselongdouble:$d_longdbl" in
14982 nvtype="long double"
14983 nvsize=$longdblsize
14990 $echo "(IV will be "$ivtype", $ivsize bytes)"
14991 $echo "(UV will be "$uvtype", $uvsize bytes)"
14992 $echo "(NV will be "$nvtype", $nvsize bytes)"
14995 #$i_inttypes I_INTTYPES
14997 #include <inttypes.h>
15002 int8_t i = INT8_MAX;
15003 uint8_t u = UINT8_MAX;
15004 printf("int8_t\n");
15007 int16_t i = INT16_MAX;
15008 uint16_t i = UINT16_MAX;
15009 printf("int16_t\n");
15012 int32_t i = INT32_MAX;
15013 uint32_t u = UINT32_MAX;
15014 printf("int32_t\n");
15020 '') case "$charsize" in
15022 u8type="unsigned char"
15031 if eval $compile; then
15032 case "`$run ./try`" in
15033 int8_t) i8type=int8_t
15043 '') if $test $charsize -ge 1; then
15045 u8type="unsigned char"
15053 '') case "$shortsize" in
15055 u16type="unsigned short"
15063 '') set try -DINT16
15064 if eval $compile; then
15065 case "`$run ./try`" in
15077 '') if $test $shortsize -ge 2; then
15079 u16type="unsigned short"
15087 '') case "$longsize" in
15089 u32type="unsigned long"
15093 *) case "$intsize" in
15095 u32type="unsigned int"
15105 '') set try -DINT32
15106 if eval $compile; then
15107 case "`$run ./try`" in
15119 '') if $test $intsize -ge 4; then
15121 u32type="unsigned int"
15129 '') case "$d_quad:$quadtype" in
15131 i64type="$quadtype"
15132 u64type="$uquadtype"
15140 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
15141 : volatile so that the compiler has to store it out to memory.
15142 if test X"$d_volatile" = X"$define"; then
15147 #$i_stdlib I_STDLIB
15149 #include <stdlib.h>
15151 #include <sys/types.h>
15152 #include <signal.h>
15154 $volatile int bletched = 0;
15155 $signal_t blech(int s) { bletched = 1; }
15160 int n = 8 * $uvsize;
15163 signal(SIGFPE, blech);
15166 for (i = 0; i < n; i++) {
15167 u = u << 1 | ($uvtype)1;
15169 if (($uvtype)d != u)
15173 d = ($nvtype)(u - 1);
15174 if (($uvtype)d != (u - 1))
15182 printf("%d\n", ((i == n) ? -n : i));
15188 d_nv_preserves_uv="$undef"
15189 if eval $compile; then
15190 nv_preserves_uv_bits="`$run ./try`"
15192 case "$nv_preserves_uv_bits" in
15194 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
15195 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
15196 d_nv_preserves_uv="$define"
15198 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
15199 d_nv_preserves_uv="$undef" ;;
15200 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
15201 nv_preserves_uv_bits="$undef" ;;
15206 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
15207 : volatile so that the compiler has to store it out to memory.
15208 if test X"$d_volatile" = X"$define"; then
15213 #$i_stdlib I_STDLIB
15215 #include <stdlib.h>
15217 #$i_string I_STRING
15219 # include <string.h>
15221 # include <strings.h>
15223 #include <sys/types.h>
15224 #include <signal.h>
15226 $volatile int bletched = 0;
15227 $signal_t blech(int s) { bletched = 1; }
15230 int checkit($nvtype d, char *where) {
15231 unsigned char *p = (char *)&d;
15232 unsigned char *end = p + sizeof(d);
15242 printf("No - %s: 0x", where);
15244 printf ("%02X", *p++);
15249 int main(int argc, char **argv) {
15252 fail += checkit(d, "0.0");
15254 /* The compiler shouldn't be assuming that bletched is 0 */
15257 fail += checkit(d, "bleched");
15260 signal(SIGFPE, blech);
15263 /* Paranoia - the compiler should have no way of knowing that ANSI says
15264 that argv[argc] will always be NULL. Actually, if it did assume this it
15265 would be buggy, as this is C and main() can be called from elsewhere in
15267 d = argv[argc] ? 1 : 0;
15270 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
15273 fail += checkit(d, "ternary");
15275 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
15278 printf("No - memset doesn't give 0.0\n");
15279 /* This might just blow up: */
15280 printf("(gives %g)\n", d);
15286 printf("No - something bleched\n");
15291 printf("No - %d fail(s)\n", fail);
15300 d_nv_zero_is_allbits_zero="$undef"
15301 if eval $compile; then
15307 0.0 is represented as all bits zero in memory
15309 d_nv_zero_is_allbits_zero="$define"
15312 0.0 is not represented as all bits zero in memory
15314 d_nv_zero_is_allbits_zero="$undef"
15319 0.0 is not represented as all bits zero in memory
15321 d_nv_zero_is_allbits_zero="$undef"
15329 : check for off64_t
15331 echo "Checking to see if you have off64_t..." >&4
15333 #include <sys/types.h>
15334 #include <unistd.h>
15335 int main() { off64_t x = 7; }
15338 if eval $compile; then
15340 echo "You have off64_t."
15343 echo "You do not have off64_t."
15344 case "$lseeksize" in
15345 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
15352 : how to create joinable pthreads
15353 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
15355 echo "Checking what constant to use for creating joinable pthreads..." >&4
15356 $cat >try.c <<'EOCP'
15357 #include <pthread.h>
15359 int detachstate = JOINABLE;
15362 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
15363 if eval $compile; then
15364 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
15365 val="$undef" # Yes, undef.
15366 set d_old_pthread_create_joinable
15369 set old_pthread_create_joinable
15372 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
15373 if eval $compile; then
15374 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
15376 set d_old_pthread_create_joinable
15378 val=PTHREAD_CREATE_UNDETACHED
15379 set old_pthread_create_joinable
15382 set try -DJOINABLE=__UNDETACHED
15383 if eval $compile; then
15384 echo "You seem to use __UNDETACHED." >&4
15386 set d_old_pthread_create_joinable
15389 set old_pthread_create_joinable
15392 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
15394 set d_old_pthread_create_joinable
15397 set old_pthread_create_joinable
15404 d_old_pthread_create_joinable="$undef"
15405 old_pthread_create_joinable=""
15408 : see if pause exists
15412 : see if pipe exists
15416 : see if poll exists
15420 : see if readlink exists
15421 set readlink d_readlink
15427 case "$d_readlink" in
15429 if $issymlink /proc/self/exe ; then
15430 $ls -l /proc/self/exe > reflect
15431 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15432 echo "You have Linux-like /proc/self/exe."
15433 procselfexe='"/proc/self/exe"'
15437 if $issymlink /proc/curproc/file ; then
15438 $ls -l /proc/curproc/file > reflect
15439 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15440 echo "You have BSD-like /proc/curproc/file."
15441 procselfexe='"/proc/curproc/file"'
15451 : see whether the pthread_atfork exists
15453 #include <pthread.h>
15456 #ifdef PTHREAD_ATFORK
15457 pthread_atfork(NULL,NULL,NULL);
15462 : see if pthread_atfork exists
15463 set try -DPTHREAD_ATFORK
15464 if eval $compile; then
15469 case "$usethreads" in
15472 $define) echo 'pthread_atfork found.' >&4 ;;
15473 *) echo 'pthread_atfork NOT found.' >&4 ;;
15476 set d_pthread_atfork
15479 : see if pthread_attr_setscope exists
15480 set pthread_attr_setscope d_pthread_attr_setscope
15484 : see whether the various POSIXish _yields exist
15486 #include <pthread.h>
15492 #ifdef PTHREAD_YIELD
15495 #ifdef PTHREAD_YIELD_NULL
15496 pthread_yield(NULL);
15502 : see if sched_yield exists
15503 set try -DSCHED_YIELD
15504 if eval $compile; then
15506 sched_yield='sched_yield()'
15510 case "$usethreads" in
15513 $define) echo 'sched_yield() found.' >&4 ;;
15514 *) echo 'sched_yield() NOT found.' >&4 ;;
15520 : see if pthread_yield exists
15521 set try -DPTHREAD_YIELD
15522 if eval $compile; then
15524 case "$sched_yield" in
15525 '') sched_yield='pthread_yield()' ;;
15528 set try -DPTHREAD_YIELD_NULL
15529 if eval $compile; then
15531 case "$sched_yield" in
15532 '') sched_yield='pthread_yield(NULL)' ;;
15538 case "$usethreads" in
15541 $define) echo 'pthread_yield() found.' >&4 ;;
15542 *) echo 'pthread_yield() NOT found.' >&4 ;;
15546 set d_pthread_yield
15549 case "$sched_yield" in
15550 '') sched_yield=undef ;;
15555 : see if random_r exists
15556 set random_r d_random_r
15558 case "$d_random_r" in
15560 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
15561 case "$d_random_r_proto:$usethreads" in
15562 ":define") d_random_r_proto=define
15563 set d_random_r_proto random_r $hdrs
15567 case "$d_random_r_proto" in
15569 case "$random_r_proto" in
15570 ''|0) try='int random_r(int*, struct random_data*);'
15571 ./protochk "extern $try" $hdrs && random_r_proto=I_iS ;;
15573 case "$random_r_proto" in
15574 ''|0) try='int random_r(long*, struct random_data*);'
15575 ./protochk "extern $try" $hdrs && random_r_proto=I_lS ;;
15577 case "$random_r_proto" in
15578 ''|0) try='int random_r(struct random_data*, int32_t*);'
15579 ./protochk "extern $try" $hdrs && random_r_proto=I_St ;;
15581 case "$random_r_proto" in
15582 ''|0) d_random_r=undef
15584 echo "Disabling random_r, cannot determine prototype." >&4 ;;
15585 * ) case "$random_r_proto" in
15586 REENTRANT_PROTO*) ;;
15587 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
15589 echo "Prototype: $try" ;;
15592 *) case "$usethreads" in
15593 define) echo "random_r has no prototype, not using it." >&4 ;;
15600 *) random_r_proto=0
15604 : see if readdir and friends exist
15605 set readdir d_readdir
15607 set seekdir d_seekdir
15609 set telldir d_telldir
15611 set rewinddir d_rewinddir
15614 : see if readdir64_r exists
15615 set readdir64_r d_readdir64_r
15617 case "$d_readdir64_r" in
15619 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15620 case "$d_readdir64_r_proto:$usethreads" in
15621 ":define") d_readdir64_r_proto=define
15622 set d_readdir64_r_proto readdir64_r $hdrs
15626 case "$d_readdir64_r_proto" in
15628 case "$readdir64_r_proto" in
15629 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
15630 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TSR ;;
15632 case "$readdir64_r_proto" in
15633 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
15634 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TS ;;
15636 case "$readdir64_r_proto" in
15637 ''|0) d_readdir64_r=undef
15638 readdir64_r_proto=0
15639 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
15640 * ) case "$readdir64_r_proto" in
15641 REENTRANT_PROTO*) ;;
15642 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
15644 echo "Prototype: $try" ;;
15647 *) case "$usethreads" in
15648 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
15650 d_readdir64_r=undef
15651 readdir64_r_proto=0
15655 *) readdir64_r_proto=0
15659 : see if readdir_r exists
15660 set readdir_r d_readdir_r
15662 case "$d_readdir_r" in
15664 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15665 case "$d_readdir_r_proto:$usethreads" in
15666 ":define") d_readdir_r_proto=define
15667 set d_readdir_r_proto readdir_r $hdrs
15671 case "$d_readdir_r_proto" in
15673 case "$readdir_r_proto" in
15674 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
15675 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TSR ;;
15677 case "$readdir_r_proto" in
15678 ''|0) try='int readdir_r(DIR*, struct dirent*);'
15679 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TS ;;
15681 case "$readdir_r_proto" in
15682 ''|0) d_readdir_r=undef
15684 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
15685 * ) case "$readdir_r_proto" in
15686 REENTRANT_PROTO*) ;;
15687 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
15689 echo "Prototype: $try" ;;
15692 *) case "$usethreads" in
15693 define) echo "readdir_r has no prototype, not using it." >&4 ;;
15700 *) readdir_r_proto=0
15704 : see if readv exists
15708 : see if recvmsg exists
15709 set recvmsg d_recvmsg
15712 : see if rename exists
15713 set rename d_rename
15716 : see if rmdir exists
15720 : see if memory.h is available.
15725 : See if it conflicts with string.h
15731 $cppstdin $cppflags $cppminus < $strings > mem.h
15732 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
15734 echo "We won't be including <memory.h>."
15744 : can bcopy handle overlapping blocks?
15747 case "$d_memmove" in
15748 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
15749 *) case "$d_bcopy" in
15751 echo "Checking to see if bcopy() can do overlapping copies..." >&4
15753 #$i_memory I_MEMORY
15754 #$i_stdlib I_STDLIB
15755 #$i_string I_STRING
15756 #$i_unistd I_UNISTD
15758 $cat >>try.c <<'EOCP'
15761 # include <memory.h>
15764 # include <stdlib.h>
15767 # include <string.h>
15769 # include <strings.h>
15772 # include <unistd.h> /* Needed for NetBSD */
15776 char buf[128], abc[128];
15782 /* Copy "abcde..." string to char abc[] so that gcc doesn't
15783 try to store the string in read-only memory. */
15784 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
15786 for (align = 7; align >= 0; align--) {
15787 for (len = 36; len; len--) {
15789 bcopy(abc, b, len);
15790 for (off = 1; off <= len; off++) {
15791 bcopy(b, b+off, len);
15792 bcopy(b+off, b, len);
15793 if (bcmp(b, abc, len))
15802 if eval $compile_ok; then
15803 if ./try 2>/dev/null; then
15804 echo "Yes, it can."
15807 echo "It can't, sorry."
15810 echo "(I can't compile the test program, so we'll assume not...)"
15814 $rm -f try.* try core
15820 : can memcpy handle overlapping blocks?
15823 case "$d_memmove" in
15824 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
15825 *) case "$d_memcpy" in
15827 echo "Checking to see if memcpy() can do overlapping copies..." >&4
15829 #$i_memory I_MEMORY
15830 #$i_stdlib I_STDLIB
15831 #$i_string I_STRING
15832 #$i_unistd I_UNISTD
15834 $cat >>try.c <<'EOCP'
15837 # include <memory.h>
15840 # include <stdlib.h>
15843 # include <string.h>
15845 # include <strings.h>
15848 # include <unistd.h> /* Needed for NetBSD */
15852 char buf[128], abc[128];
15858 /* Copy "abcde..." string to char abc[] so that gcc doesn't
15859 try to store the string in read-only memory. */
15860 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
15862 for (align = 7; align >= 0; align--) {
15863 for (len = 36; len; len--) {
15865 memcpy(b, abc, len);
15866 for (off = 1; off <= len; off++) {
15867 memcpy(b+off, b, len);
15868 memcpy(b, b+off, len);
15869 if (memcmp(b, abc, len))
15878 if eval $compile_ok; then
15879 if ./try 2>/dev/null; then
15880 echo "Yes, it can."
15883 echo "It can't, sorry."
15886 echo "(I can't compile the test program, so we'll assume not...)"
15890 $rm -f try.* try core
15896 : can memcmp be trusted to compare relative magnitude?
15898 case "$d_memcmp" in
15901 echo "Checking if your memcmp() can compare relative magnitude..." >&4
15903 #$i_memory I_MEMORY
15904 #$i_stdlib I_STDLIB
15905 #$i_string I_STRING
15906 #$i_unistd I_UNISTD
15908 $cat >>try.c <<'EOCP'
15911 # include <memory.h>
15914 # include <stdlib.h>
15917 # include <string.h>
15919 # include <strings.h>
15922 # include <unistd.h> /* Needed for NetBSD */
15928 if ((a < b) && memcmp(&a, &b, 1) < 0)
15934 if eval $compile_ok; then
15935 if $run ./try 2>/dev/null; then
15936 echo "Yes, it can."
15939 echo "No, it can't (it uses signed chars)."
15942 echo "(I can't compile the test program, so we'll assume not...)"
15946 $rm -f try.* try core
15950 : see if prototype for sbrk is available
15952 set d_sbrkproto sbrk $i_unistd unistd.h
15955 : see if select exists
15956 set select d_select
15959 : see if semctl exists
15960 set semctl d_semctl
15963 : see if semget exists
15964 set semget d_semget
15967 : see if semop exists
15971 : see how much of the 'sem*(2)' library is present.
15974 case "$d_semctl$d_semget$d_semop" in
15975 *"$undef"*) h_sem=false;;
15979 case "`ipcs 2>&1`" in
15980 "SVID messages"*"not configured"*)
15981 echo "Your $osname does not have the sem*(2) configured." >&4
15984 set semctl d_semctl
15986 set semget d_semget
15994 : we could also check for sys/ipc.h ...
15995 if $h_sem && $test `./findhdr sys/sem.h`; then
15996 echo "You have the full sem*(2) library." >&4
15999 echo "You don't have the full sem*(2) library." >&4
16005 : see whether sys/sem.h defines union semun
16007 $cat > try.c <<'END'
16008 #include <sys/types.h>
16009 #include <sys/ipc.h>
16010 #include <sys/sem.h>
16011 int main () { union semun semun; semun.buf = 0; }
16014 if eval $compile; then
16015 echo "You have union semun in <sys/sem.h>." >&4
16018 echo "You do not have union semun in <sys/sem.h>." >&4
16025 : see how to do semctl IPC_STAT
16032 # define S_IRUSR S_IREAD
16033 # define S_IWUSR S_IWRITE
16034 # define S_IXUSR S_IEXEC
16036 # define S_IRUSR 0400
16037 # define S_IWUSR 0200
16038 # define S_IXUSR 0100
16040 # define S_IRGRP (S_IRUSR>>3)
16041 # define S_IWGRP (S_IWUSR>>3)
16042 # define S_IXGRP (S_IXUSR>>3)
16043 # define S_IROTH (S_IRUSR>>6)
16044 # define S_IWOTH (S_IWUSR>>6)
16045 # define S_IXOTH (S_IXUSR>>6)
16048 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
16049 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
16050 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
16053 : see whether semctl IPC_STAT can use union semun
16054 case "$d_semctl_semun" in
16058 #include <sys/types.h>
16059 #include <sys/ipc.h>
16060 #include <sys/sem.h>
16061 #include <sys/stat.h>
16068 #$d_union_semun HAS_UNION_SEMUN
16071 #ifndef HAS_UNION_SEMUN
16074 struct semid_ds *buf;
16075 unsigned short *array;
16081 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16082 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16084 struct semid_ds argbuf;
16087 st = semctl(sem, 0, IPC_STAT, arg);
16091 # endif /* IPC_STAT */
16092 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16094 if (semctl(sem, 0, IPC_RMID, arg) != 0)
16095 # endif /* IPC_RMID */
16096 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16098 #endif /* IPC_PRIVATE && ... */
16099 printf("semget failed: errno = %d\n", errno);
16104 if eval $compile; then
16107 semun) val="$define" ;;
16115 case "$d_semctl_semun" in
16117 echo "You can use union semun for semctl IPC_STAT." >&4
16120 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
16125 : see whether semctl IPC_STAT can use struct semid_ds pointer
16126 case "$d_semctl_semid_ds" in
16129 $cat > try.c <<'END'
16130 #include <sys/types.h>
16131 #include <sys/ipc.h>
16132 #include <sys/sem.h>
16133 #include <sys/stat.h>
16141 struct semid_ds arg;
16144 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16145 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16148 st = semctl(sem, 0, IPC_STAT, &arg);
16150 printf("semid_ds\n");
16152 # endif /* IPC_STAT */
16153 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16155 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
16156 # endif /* IPC_RMID */
16157 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16159 #endif /* IPC_PRIVATE && ... */
16160 printf("semget failed: errno = %d\n", errno);
16166 if eval $compile; then
16169 semid_ds) val="$define" ;;
16173 set d_semctl_semid_ds
16177 case "$d_semctl_semid_ds" in
16179 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
16181 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
16188 # We do not have the full sem*(2) library, so assume we can not
16194 set d_semctl_semid_ds
16199 : see if sendmsg exists
16200 set sendmsg d_sendmsg
16203 : see if setegid exists
16204 set setegid d_setegid
16207 : see if seteuid exists
16208 set seteuid d_seteuid
16211 : see if setgrent exists
16212 set setgrent d_setgrent
16215 : see if setgrent_r exists
16216 set setgrent_r d_setgrent_r
16218 case "$d_setgrent_r" in
16220 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
16221 case "$d_setgrent_r_proto:$usethreads" in
16222 ":define") d_setgrent_r_proto=define
16223 set d_setgrent_r_proto setgrent_r $hdrs
16227 case "$d_setgrent_r_proto" in
16229 case "$setgrent_r_proto" in
16230 ''|0) try='int setgrent_r(FILE**);'
16231 ./protochk "extern $try" $hdrs && setgrent_r_proto=I_H ;;
16233 case "$setgrent_r_proto" in
16234 ''|0) try='void setgrent_r(FILE**);'
16235 ./protochk "extern $try" $hdrs && setgrent_r_proto=V_H ;;
16237 case "$setgrent_r_proto" in
16238 ''|0) d_setgrent_r=undef
16240 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
16241 * ) case "$setgrent_r_proto" in
16242 REENTRANT_PROTO*) ;;
16243 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
16245 echo "Prototype: $try" ;;
16248 *) case "$usethreads" in
16249 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
16256 *) setgrent_r_proto=0
16260 : see if sethostent exists
16261 set sethostent d_sethent
16264 : see if sethostent_r exists
16265 set sethostent_r d_sethostent_r
16267 case "$d_sethostent_r" in
16269 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16270 case "$d_sethostent_r_proto:$usethreads" in
16271 ":define") d_sethostent_r_proto=define
16272 set d_sethostent_r_proto sethostent_r $hdrs
16276 case "$d_sethostent_r_proto" in
16278 case "$sethostent_r_proto" in
16279 ''|0) try='int sethostent_r(int, struct hostent_data*);'
16280 ./protochk "extern $try" $hdrs && sethostent_r_proto=I_ID ;;
16282 case "$sethostent_r_proto" in
16283 ''|0) try='void sethostent_r(int, struct hostent_data*);'
16284 ./protochk "extern $try" $hdrs && sethostent_r_proto=V_ID ;;
16286 case "$sethostent_r_proto" in
16287 ''|0) d_sethostent_r=undef
16288 sethostent_r_proto=0
16289 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
16290 * ) case "$sethostent_r_proto" in
16291 REENTRANT_PROTO*) ;;
16292 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
16294 echo "Prototype: $try" ;;
16297 *) case "$usethreads" in
16298 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
16300 d_sethostent_r=undef
16301 sethostent_r_proto=0
16305 *) sethostent_r_proto=0
16309 : see if setitimer exists
16310 set setitimer d_setitimer
16313 : see if setlinebuf exists
16314 set setlinebuf d_setlinebuf
16317 : see if setlocale exists
16318 set setlocale d_setlocale
16321 : see if locale.h is available
16322 set locale.h i_locale
16325 : see if setlocale_r exists
16326 set setlocale_r d_setlocale_r
16328 case "$d_setlocale_r" in
16330 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
16331 case "$d_setlocale_r_proto:$usethreads" in
16332 ":define") d_setlocale_r_proto=define
16333 set d_setlocale_r_proto setlocale_r $hdrs
16337 case "$d_setlocale_r_proto" in
16339 case "$setlocale_r_proto" in
16340 ''|0) try='int setlocale_r(int, const char*, char*, int);'
16341 ./protochk "extern $try" $hdrs && setlocale_r_proto=I_ICBI ;;
16343 case "$setlocale_r_proto" in
16344 ''|0) d_setlocale_r=undef
16345 setlocale_r_proto=0
16346 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
16347 * ) case "$setlocale_r_proto" in
16348 REENTRANT_PROTO*) ;;
16349 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
16351 echo "Prototype: $try" ;;
16354 *) case "$usethreads" in
16355 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
16357 d_setlocale_r=undef
16358 setlocale_r_proto=0
16362 *) setlocale_r_proto=0
16366 : see if setnetent exists
16367 set setnetent d_setnent
16370 : see if setnetent_r exists
16371 set setnetent_r d_setnetent_r
16373 case "$d_setnetent_r" in
16375 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16376 case "$d_setnetent_r_proto:$usethreads" in
16377 ":define") d_setnetent_r_proto=define
16378 set d_setnetent_r_proto setnetent_r $hdrs
16382 case "$d_setnetent_r_proto" in
16384 case "$setnetent_r_proto" in
16385 ''|0) try='int setnetent_r(int, struct netent_data*);'
16386 ./protochk "extern $try" $hdrs && setnetent_r_proto=I_ID ;;
16388 case "$setnetent_r_proto" in
16389 ''|0) try='void setnetent_r(int, struct netent_data*);'
16390 ./protochk "extern $try" $hdrs && setnetent_r_proto=V_ID ;;
16392 case "$setnetent_r_proto" in
16393 ''|0) d_setnetent_r=undef
16394 setnetent_r_proto=0
16395 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
16396 * ) case "$setnetent_r_proto" in
16397 REENTRANT_PROTO*) ;;
16398 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
16400 echo "Prototype: $try" ;;
16403 *) case "$usethreads" in
16404 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
16406 d_setnetent_r=undef
16407 setnetent_r_proto=0
16411 *) setnetent_r_proto=0
16415 : see if setprotoent exists
16416 set setprotoent d_setpent
16419 : see if setpgid exists
16420 set setpgid d_setpgid
16423 : see if setpgrp2 exists
16424 set setpgrp2 d_setpgrp2
16427 : see if setpriority exists
16428 set setpriority d_setprior
16431 : see if setproctitle exists
16432 set setproctitle d_setproctitle
16435 : see if setprotoent_r exists
16436 set setprotoent_r d_setprotoent_r
16438 case "$d_setprotoent_r" in
16440 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16441 case "$d_setprotoent_r_proto:$usethreads" in
16442 ":define") d_setprotoent_r_proto=define
16443 set d_setprotoent_r_proto setprotoent_r $hdrs
16447 case "$d_setprotoent_r_proto" in
16449 case "$setprotoent_r_proto" in
16450 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
16451 ./protochk "extern $try" $hdrs && setprotoent_r_proto=I_ID ;;
16453 case "$setprotoent_r_proto" in
16454 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
16455 ./protochk "extern $try" $hdrs && setprotoent_r_proto=V_ID ;;
16457 case "$setprotoent_r_proto" in
16458 ''|0) d_setprotoent_r=undef
16459 setprotoent_r_proto=0
16460 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
16461 * ) case "$setprotoent_r_proto" in
16462 REENTRANT_PROTO*) ;;
16463 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
16465 echo "Prototype: $try" ;;
16468 *) case "$usethreads" in
16469 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
16471 d_setprotoent_r=undef
16472 setprotoent_r_proto=0
16476 *) setprotoent_r_proto=0
16480 : see if setpwent exists
16481 set setpwent d_setpwent
16484 : see if setpwent_r exists
16485 set setpwent_r d_setpwent_r
16487 case "$d_setpwent_r" in
16489 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
16490 case "$d_setpwent_r_proto:$usethreads" in
16491 ":define") d_setpwent_r_proto=define
16492 set d_setpwent_r_proto setpwent_r $hdrs
16496 case "$d_setpwent_r_proto" in
16498 case "$setpwent_r_proto" in
16499 ''|0) try='int setpwent_r(FILE**);'
16500 ./protochk "extern $try" $hdrs && setpwent_r_proto=I_H ;;
16502 case "$setpwent_r_proto" in
16503 ''|0) try='void setpwent_r(FILE**);'
16504 ./protochk "extern $try" $hdrs && setpwent_r_proto=V_H ;;
16506 case "$setpwent_r_proto" in
16507 ''|0) d_setpwent_r=undef
16509 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
16510 * ) case "$setpwent_r_proto" in
16511 REENTRANT_PROTO*) ;;
16512 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
16514 echo "Prototype: $try" ;;
16517 *) case "$usethreads" in
16518 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
16525 *) setpwent_r_proto=0
16529 : see if setregid exists
16530 set setregid d_setregid
16532 set setresgid d_setresgid
16535 : see if setreuid exists
16536 set setreuid d_setreuid
16538 set setresuid d_setresuid
16541 : see if setrgid exists
16542 set setrgid d_setrgid
16545 : see if setruid exists
16546 set setruid d_setruid
16549 : see if setservent exists
16550 set setservent d_setsent
16553 : see if setservent_r exists
16554 set setservent_r d_setservent_r
16556 case "$d_setservent_r" in
16558 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16559 case "$d_setservent_r_proto:$usethreads" in
16560 ":define") d_setservent_r_proto=define
16561 set d_setservent_r_proto setservent_r $hdrs
16565 case "$d_setservent_r_proto" in
16567 case "$setservent_r_proto" in
16568 ''|0) try='int setservent_r(int, struct servent_data*);'
16569 ./protochk "extern $try" $hdrs && setservent_r_proto=I_ID ;;
16571 case "$setservent_r_proto" in
16572 ''|0) try='void setservent_r(int, struct servent_data*);'
16573 ./protochk "extern $try" $hdrs && setservent_r_proto=V_ID ;;
16575 case "$setservent_r_proto" in
16576 ''|0) d_setservent_r=undef
16577 setservent_r_proto=0
16578 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
16579 * ) case "$setservent_r_proto" in
16580 REENTRANT_PROTO*) ;;
16581 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
16583 echo "Prototype: $try" ;;
16586 *) case "$usethreads" in
16587 define) echo "setservent_r has no prototype, not using it." >&4 ;;
16589 d_setservent_r=undef
16590 setservent_r_proto=0
16594 *) setservent_r_proto=0
16598 : see if setsid exists
16599 set setsid d_setsid
16602 : see if setvbuf exists
16603 set setvbuf d_setvbuf
16606 : see if sfio.h is available
16611 : see if sfio library is available
16622 : Ok, but do we want to use it.
16626 true|$define|[yY]*) dflt='y';;
16629 echo "$package can use the sfio library, but it is experimental."
16630 case "$useperlio" in
16632 echo "For sfio also the PerlIO abstraction layer is needed."
16633 echo "Earlier you said you wouldn't want that."
16636 rp="You seem to have sfio available, do you want to try using it?"
16639 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
16640 useperlio="$define"
16643 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
16648 *) case "$usesfio" in
16649 true|$define|[yY]*)
16650 echo "Sorry, cannot find sfio on this machine." >&4
16651 echo "Ignoring your setting of usesfio=$usesfio." >&4
16660 $define) usesfio='true';;
16661 *) usesfio='false';;
16665 *) : Remove sfio from list of libraries to use
16668 echo "Removing unneeded -lsfio from library list" >&4
16669 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
16672 echo "libs = $libs" >&4
16679 : see if shmctl exists
16680 set shmctl d_shmctl
16683 : see if shmget exists
16684 set shmget d_shmget
16687 : see if shmat exists
16690 : see what shmat returns
16693 $cat >shmat.c <<'END'
16694 #include <sys/shm.h>
16697 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
16702 echo "and it returns ($shmattype)." >&4
16703 : see if a prototype for shmat is available
16704 xxx=`./findhdr sys/shm.h`
16705 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
16706 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
16717 set d_shmatprototype
16720 : see if shmdt exists
16724 : see how much of the 'shm*(2)' library is present.
16727 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
16728 *"$undef"*) h_shm=false;;
16732 case "`ipcs 2>&1`" in
16733 "SVID shared memory"*"not configured"*)
16734 echo "Your $osname does not have the shm*(2) configured." >&4
16737 set shmctl d_shmctl
16739 set shmget d_shmget
16749 : we could also check for sys/ipc.h ...
16750 if $h_shm && $test `./findhdr sys/shm.h`; then
16751 echo "You have the full shm*(2) library." >&4
16754 echo "You don't have the full shm*(2) library." >&4
16761 : see if we have sigaction
16762 if set sigaction val -f d_sigaction; eval $csym; $val; then
16763 echo 'sigaction() found.' >&4
16766 #include <sys/types.h>
16767 #include <signal.h>
16768 #$i_stdlib I_STDLIB
16770 #include <stdlib.h>
16774 struct sigaction act, oact;
16776 oact.sa_handler = 0;
16777 /* so that act and oact are used */
16778 exit(act.sa_flags == 0 && oact.sa_handler == 0);
16782 if eval $compile_ok; then
16785 echo "But you don't seem to have a useable struct sigaction." >&4
16789 echo 'sigaction NOT found.' >&4
16792 set d_sigaction; eval $setvar
16793 $rm -f try try$_o try.c
16795 : see if sigprocmask exists
16796 set sigprocmask d_sigprocmask
16799 : see if sigsetjmp exists
16801 case "$d_sigsetjmp" in
16804 #include <setjmp.h>
16805 #$i_stdlib I_STDLIB
16807 #include <stdlib.h>
16813 if (sigsetjmp(env,1))
16816 siglongjmp(env, 1);
16821 if eval $compile; then
16822 if $run ./try >/dev/null 2>&1; then
16823 echo "POSIX sigsetjmp found." >&4
16827 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
16833 echo "sigsetjmp not found." >&4
16837 *) val="$d_sigsetjmp"
16838 case "$d_sigsetjmp" in
16839 $define) echo "POSIX sigsetjmp found." >&4;;
16840 $undef) echo "sigsetjmp not found." >&4;;
16848 : see if snprintf exists
16849 set snprintf d_snprintf
16852 : see if vsnprintf exists
16853 set vsnprintf d_vsnprintf
16856 case "$d_snprintf-$d_vsnprintf" in
16859 Checking whether your snprintf() and vsnprintf() work okay...
16861 $cat >try.c <<'EOCP'
16862 /* v?snprintf testing logic courtesy of Russ Allbery.
16863 * According to C99:
16864 * - if the buffer is too short it still must be \0-terminated
16865 * - if the buffer is too short the potentially required length
16866 * must be returned and not -1
16867 * - if the buffer is NULL the potentially required length
16868 * must be returned and not -1 or core dump
16871 #include <stdarg.h>
16875 int test (char *format, ...)
16880 va_start (args, format);
16881 count = vsnprintf (buf, sizeof buf, format, args);
16888 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
16889 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
16893 if eval $compile; then
16896 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
16898 Your snprintf() and snprintf() don't seem to be working okay.
16900 d_snprintf="$undef"
16901 d_vsnprintf="$undef"
16905 echo "(I can't seem to compile the test program--assuming they don't)"
16906 d_snprintf="$undef"
16907 d_vsnprintf="$undef"
16909 $rm -f try.* try core core.try.*
16913 : see if sockatmark exists
16914 set sockatmark d_sockatmark
16917 : see if prototype for sockatmark is available
16919 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
16922 : see if socks5_init exists
16923 set socks5_init d_socks5_init
16926 : see if sprintf returns the length of the string in the buffer as per ANSI
16927 $echo "Checking whether sprintf returns the length of the string..." >&4
16930 #$i_stdlib I_STDLIB
16932 #include <stdlib.h>
16934 #$i_string I_STRING
16936 # include <string.h>
16938 # include <strings.h>
16947 int check (size_t expect, int test) {
16948 size_t got = strlen(buffer);
16952 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
16957 int main(int argc, char **argv) {
16960 check(sprintf(buffer, ""), ++test);
16961 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
16962 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
16969 d_sprintf_returns_strlen="$undef"
16970 if eval $compile; then
16974 sprintf returns the length of the string (as ANSI says it should)
16976 d_sprintf_returns_strlen="$define"
16979 sprintf does not return the length of the string (how old is this system?)
16981 d_sprintf_returns_strlen="$undef"
16988 : see if srand48_r exists
16989 set srand48_r d_srand48_r
16991 case "$d_srand48_r" in
16993 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16994 case "$d_srand48_r_proto:$usethreads" in
16995 ":define") d_srand48_r_proto=define
16996 set d_srand48_r_proto srand48_r $hdrs
17000 case "$d_srand48_r_proto" in
17002 case "$srand48_r_proto" in
17003 ''|0) try='int srand48_r(long, struct drand48_data*);'
17004 ./protochk "extern $try" $hdrs && srand48_r_proto=I_LS ;;
17006 case "$srand48_r_proto" in
17007 ''|0) d_srand48_r=undef
17009 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
17010 * ) case "$srand48_r_proto" in
17011 REENTRANT_PROTO*) ;;
17012 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
17014 echo "Prototype: $try" ;;
17017 *) case "$usethreads" in
17018 define) echo "srand48_r has no prototype, not using it." >&4 ;;
17025 *) srand48_r_proto=0
17029 : see if srandom_r exists
17030 set srandom_r d_srandom_r
17032 case "$d_srandom_r" in
17034 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17035 case "$d_srandom_r_proto:$usethreads" in
17036 ":define") d_srandom_r_proto=define
17037 set d_srandom_r_proto srandom_r $hdrs
17041 case "$d_srandom_r_proto" in
17043 case "$srandom_r_proto" in
17044 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
17045 ./protochk "extern $try" $hdrs && srandom_r_proto=I_TS ;;
17047 case "$srandom_r_proto" in
17048 ''|0) d_srandom_r=undef
17050 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
17051 * ) case "$srandom_r_proto" in
17052 REENTRANT_PROTO*) ;;
17053 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
17055 echo "Prototype: $try" ;;
17058 *) case "$usethreads" in
17059 define) echo "srandom_r has no prototype, not using it." >&4 ;;
17066 *) srandom_r_proto=0
17070 : see if prototype for setresgid is available
17072 set d_sresgproto setresgid $i_unistd unistd.h
17075 : see if prototype for setresuid is available
17077 set d_sresuproto setresuid $i_unistd unistd.h
17080 : see if sys/stat.h is available
17081 set sys/stat.h i_sysstat
17085 : see if stat knows about block sizes
17087 echo "Checking to see if your struct stat has st_blocks field..." >&4
17088 set d_statblks stat st_blocks $i_sysstat sys/stat.h
17092 : see if this is a sys/vfs.h system
17093 set sys/vfs.h i_sysvfs
17097 : see if this is a sys/statfs.h system
17098 set sys/statfs.h i_sysstatfs
17103 echo "Checking to see if your system supports struct statfs..." >&4
17104 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
17106 case "$d_statfs_s" in
17107 "$define") echo "Yes, it does." ;;
17108 *) echo "No, it doesn't." ;;
17113 : see if struct statfs knows about f_flags
17114 case "$d_statfs_s" in
17117 echo "Checking to see if your struct statfs has f_flags field..." >&4
17118 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
17122 set d_statfs_f_flags
17126 case "$d_statfs_f_flags" in
17127 "$define") echo "Yes, it does." ;;
17128 *) echo "No, it doesn't." ;;
17132 Checking how to access stdio streams by file descriptor number...
17134 case "$stdio_stream_array" in
17135 '') $cat >try.c <<EOCP
17138 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
17142 for s in _iob __iob __sF
17144 set try -DSTDIO_STREAM_ARRAY=$s
17145 if eval $compile; then
17146 case "`$run ./try`" in
17147 yes) stdio_stream_array=$s; break ;;
17151 $rm -f try.* try$exe_ext
17153 case "$stdio_stream_array" in
17155 I can't figure out how to access stdio streams by file descriptor number.
17157 d_stdio_stream_array="$undef"
17160 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
17162 d_stdio_stream_array="$define"
17166 : see if strcoll exists
17167 set strcoll d_strcoll
17170 : check for structure copying
17172 echo "Checking to see if your C compiler can copy structs..." >&4
17173 $cat >try.c <<'EOCP'
17183 if $cc -c try.c >/dev/null 2>&1 ; then
17185 echo "Yup, it can."
17188 echo "Nope, it can't."
17194 : see if strerror and/or sys_errlist[] exist
17196 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
17197 if set strerror val -f d_strerror; eval $csym; $val; then
17198 echo 'strerror() found.' >&4
17199 d_strerror="$define"
17200 d_strerrm='strerror(e)'
17201 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17202 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
17203 d_syserrlst="$define"
17205 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
17206 d_syserrlst="$undef"
17208 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
17209 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
17210 echo 'strerror() found in string header.' >&4
17211 d_strerror="$define"
17212 d_strerrm='strerror(e)'
17213 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17214 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
17215 d_syserrlst="$define"
17217 echo "(You don't appear to have any sys_errlist[], how can this be?)"
17218 d_syserrlst="$undef"
17220 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17221 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
17222 d_strerror="$undef"
17223 d_syserrlst="$define"
17224 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
17226 echo 'strerror() and sys_errlist[] NOT found.' >&4
17227 d_strerror="$undef"
17228 d_syserrlst="$undef"
17229 d_strerrm='"unknown"'
17233 : see if strerror_r exists
17234 set strerror_r d_strerror_r
17236 case "$d_strerror_r" in
17238 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
17239 case "$d_strerror_r_proto:$usethreads" in
17240 ":define") d_strerror_r_proto=define
17241 set d_strerror_r_proto strerror_r $hdrs
17245 case "$d_strerror_r_proto" in
17247 case "$strerror_r_proto" in
17248 ''|0) try='int strerror_r(int, char*, size_t);'
17249 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBW ;;
17251 case "$strerror_r_proto" in
17252 ''|0) try='int strerror_r(int, char*, int);'
17253 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBI ;;
17255 case "$strerror_r_proto" in
17256 ''|0) try='char* strerror_r(int, char*, size_t);'
17257 ./protochk "extern $try" $hdrs && strerror_r_proto=B_IBW ;;
17259 case "$strerror_r_proto" in
17260 ''|0) d_strerror_r=undef
17262 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
17263 * ) case "$strerror_r_proto" in
17264 REENTRANT_PROTO*) ;;
17265 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
17267 echo "Prototype: $try" ;;
17270 *) case "$usethreads" in
17271 define) echo "strerror_r has no prototype, not using it." >&4 ;;
17278 *) strerror_r_proto=0
17282 : see if strftime exists
17283 set strftime d_strftime
17286 : see if strlcat exists
17287 set strlcat d_strlcat
17290 : see if strlcpy exists
17291 set strlcpy d_strlcpy
17294 : see if strtod exists
17295 set strtod d_strtod
17298 : see if strtol exists
17299 set strtol d_strtol
17302 : see if strtold exists
17303 set strtold d_strtold
17306 : see if strtoll exists
17307 set strtoll d_strtoll
17310 case "$d_longlong-$d_strtoll" in
17313 Checking whether your strtoll() works okay...
17315 $cat >try.c <<'EOCP'
17318 #define strtoll __strtoll
17321 #define strtoll _strtoll
17324 extern long long int strtoll(char *s, char **, int);
17325 static int bad = 0;
17326 int check(char *s, long long ell, int een) {
17329 gll = strtoll(s, 0, 10);
17330 if (!((gll == ell) && (errno == een)))
17334 check(" 1", 1LL, 0);
17335 check(" 0", 0LL, 0);
17336 check("-1", -1LL, 0);
17337 check("-9223372036854775808", -9223372036854775808LL, 0);
17338 check("-9223372036854775808", -9223372036854775808LL, 0);
17339 check(" 9223372036854775807", 9223372036854775807LL, 0);
17340 check("-9223372036854775808", -9223372036854775808LL, 0);
17341 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
17342 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
17348 if eval $compile; then
17351 ok) echo "Your strtoll() seems to be working okay." ;;
17353 Your strtoll() doesn't seem to be working okay.
17359 echo "(I can't seem to compile the test program--assuming it doesn't)"
17365 : see if strtoq exists
17366 set strtoq d_strtoq
17369 : see if strtoul exists
17370 set strtoul d_strtoul
17373 case "$d_strtoul" in
17376 Checking whether your strtoul() works okay...
17378 $cat >try.c <<'EOCP'
17381 extern unsigned long int strtoul(char *s, char **, int);
17382 static int bad = 0;
17383 void check(char *s, unsigned long eul, int een) {
17386 gul = strtoul(s, 0, 10);
17387 if (!((gul == eul) && (errno == een)))
17391 check(" 1", 1L, 0);
17392 check(" 0", 0L, 0);
17394 case "$longsize" in
17396 $cat >>try.c <<'EOCP'
17397 check("18446744073709551615", 18446744073709551615UL, 0);
17398 check("18446744073709551616", 18446744073709551615UL, ERANGE);
17399 #if 0 /* strtoul() for /^-/ strings is undefined. */
17400 check("-1", 18446744073709551615UL, 0);
17401 check("-18446744073709551614", 2, 0);
17402 check("-18446744073709551615", 1, 0);
17403 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
17404 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
17409 $cat >>try.c <<'EOCP'
17410 check("4294967295", 4294967295UL, 0);
17411 check("4294967296", 4294967295UL, ERANGE);
17412 #if 0 /* strtoul() for /^-/ strings is undefined. */
17413 check("-1", 4294967295UL, 0);
17414 check("-4294967294", 2, 0);
17415 check("-4294967295", 1, 0);
17416 check("-4294967296", 4294967295UL, ERANGE);
17417 check("-4294967297", 4294967295UL, ERANGE);
17422 : Should we write these tests to be more portable by sprintf-ing
17423 : ~0 and then manipulating that char string as input for strtol?
17426 $cat >>try.c <<'EOCP'
17433 if eval $compile; then
17434 case "`$run ./try`" in
17435 ok) echo "Your strtoul() seems to be working okay." ;;
17437 Your strtoul() doesn't seem to be working okay.
17446 : see if strtoull exists
17447 set strtoull d_strtoull
17450 case "$d_longlong-$d_strtoull" in
17453 Checking whether your strtoull() works okay...
17455 $cat >try.c <<'EOCP'
17458 #define strtoull __strtoull
17461 extern unsigned long long int strtoull(char *s, char **, int);
17462 static int bad = 0;
17463 int check(char *s, long long eull, int een) {
17466 gull = strtoull(s, 0, 10);
17467 if (!((gull == eull) && (errno == een)))
17471 check(" 1", 1LL, 0);
17472 check(" 0", 0LL, 0);
17473 check("18446744073709551615", 18446744073709551615ULL, 0);
17474 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17475 #if 0 /* strtoull() for /^-/ strings is undefined. */
17476 check("-1", 18446744073709551615ULL, 0);
17477 check("-18446744073709551614", 2LL, 0);
17478 check("-18446744073709551615", 1LL, 0);
17479 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17480 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17487 if eval $compile; then
17488 case "`$run ./try`" in
17489 ok) echo "Your strtoull() seems to be working okay." ;;
17491 Your strtoull() doesn't seem to be working okay.
17493 d_strtoull="$undef"
17500 : see if strtouq exists
17501 set strtouq d_strtouq
17504 case "$d_strtouq" in
17507 Checking whether your strtouq() works okay...
17509 $cat >try.c <<'EOCP'
17512 extern unsigned long long int strtouq(char *s, char **, int);
17513 static int bad = 0;
17514 void check(char *s, unsigned long long eull, int een) {
17515 unsigned long long gull;
17517 gull = strtouq(s, 0, 10);
17518 if (!((gull == eull) && (errno == een)))
17522 check(" 1", 1LL, 0);
17523 check(" 0", 0LL, 0);
17524 check("18446744073709551615", 18446744073709551615ULL, 0);
17525 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17526 #if 0 /* strtouq() for /^-/ strings is undefined. */
17527 check("-1", 18446744073709551615ULL, 0);
17528 check("-18446744073709551614", 2LL, 0);
17529 check("-18446744073709551615", 1LL, 0);
17530 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17531 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17539 if eval $compile; then
17540 case "`$run ./try`" in
17541 ok) echo "Your strtouq() seems to be working okay." ;;
17543 Your strtouq() doesn't seem to be working okay.
17552 : see if strxfrm exists
17553 set strxfrm d_strxfrm
17556 : see if symlink exists
17557 set symlink d_symlink
17560 : see if syscall exists
17561 set syscall d_syscall
17564 : see if prototype for syscall is available
17566 set d_syscallproto syscall $i_unistd unistd.h
17569 : see if sysconf exists
17570 set sysconf d_sysconf
17573 : see if system exists
17574 set system d_system
17577 : see if tcgetpgrp exists
17578 set tcgetpgrp d_tcgetpgrp
17581 : see if tcsetpgrp exists
17582 set tcsetpgrp d_tcsetpgrp
17585 : see if prototype for telldir is available
17587 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
17590 : see if time exists
17592 if test "X$d_time" = X -o X"$timetype" = X; then
17593 if set time val -f d_time; eval $csym; $val; then
17594 echo 'time() found.' >&4
17596 rp="What is the type returned by time() on this system?"
17597 set time_t timetype long stdio.h sys/types.h
17600 echo 'time() not found, hope that will do.' >&4
17608 : see if this is a sys/times.h system
17609 set sys/times.h i_systimes
17612 : see if times exists
17614 if set times val -f d_times; eval $csym; $val; then
17615 echo 'times() found.' >&4
17618 case "$i_systimes" in
17619 "$define") inc='sys/times.h';;
17621 rp="What is the type returned by times() on this system?"
17622 set clock_t clocktype long stdio.h sys/types.h $inc
17625 echo 'times() NOT found, hope that will do.' >&4
17630 : see if tmpnam_r exists
17631 set tmpnam_r d_tmpnam_r
17633 case "$d_tmpnam_r" in
17635 hdrs="$i_systypes sys/types.h define stdio.h "
17636 case "$d_tmpnam_r_proto:$usethreads" in
17637 ":define") d_tmpnam_r_proto=define
17638 set d_tmpnam_r_proto tmpnam_r $hdrs
17642 case "$d_tmpnam_r_proto" in
17644 case "$tmpnam_r_proto" in
17645 ''|0) try='char* tmpnam_r(char*);'
17646 ./protochk "extern $try" $hdrs && tmpnam_r_proto=B_B ;;
17648 case "$tmpnam_r_proto" in
17649 ''|0) d_tmpnam_r=undef
17651 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
17652 * ) case "$tmpnam_r_proto" in
17653 REENTRANT_PROTO*) ;;
17654 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
17656 echo "Prototype: $try" ;;
17659 *) case "$usethreads" in
17660 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
17667 *) tmpnam_r_proto=0
17671 : see if truncate exists
17672 set truncate d_truncate
17675 : see if ttyname_r exists
17676 set ttyname_r d_ttyname_r
17678 case "$d_ttyname_r" in
17680 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
17681 case "$d_ttyname_r_proto:$usethreads" in
17682 ":define") d_ttyname_r_proto=define
17683 set d_ttyname_r_proto ttyname_r $hdrs
17687 case "$d_ttyname_r_proto" in
17689 case "$ttyname_r_proto" in
17690 ''|0) try='int ttyname_r(int, char*, size_t);'
17691 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBW ;;
17693 case "$ttyname_r_proto" in
17694 ''|0) try='int ttyname_r(int, char*, int);'
17695 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBI ;;
17697 case "$ttyname_r_proto" in
17698 ''|0) try='char* ttyname_r(int, char*, int);'
17699 ./protochk "extern $try" $hdrs && ttyname_r_proto=B_IBI ;;
17701 case "$ttyname_r_proto" in
17702 ''|0) d_ttyname_r=undef
17704 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
17705 * ) case "$ttyname_r_proto" in
17706 REENTRANT_PROTO*) ;;
17707 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
17709 echo "Prototype: $try" ;;
17712 *) case "$usethreads" in
17713 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
17720 *) ttyname_r_proto=0
17724 : see if tzname[] exists
17726 if set tzname val -a d_tzname; eval $csym; $val; then
17728 echo 'tzname[] found.' >&4
17731 echo 'tzname[] NOT found.' >&4
17737 next|rhapsody|darwin) multiarch="$define" ;;
17739 case "$multiarch" in
17740 ''|[nN]*) multiarch="$undef" ;;
17743 : check for ordering of bytes in a UV
17745 case "$usecrosscompile$multiarch" in
17748 You seem to be either cross-compiling or doing a multiarchitecture build,
17749 skipping the byteorder check.
17755 case "$byteorder" in
17758 In the following, larger digits indicate more significance. A big-endian
17759 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
17760 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
17761 machines may have weird orders like 3412. A Cray will report 87654321,
17762 an Alpha will report 12345678. If the test program works the default is
17764 I'm now running the test program...
17768 #$i_stdlib I_STDLIB
17770 #include <stdlib.h>
17772 #include <sys/types.h>
17773 typedef $uvtype UV;
17783 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
17785 u.l = (UV)0x04030201;
17786 for (i = 0; i < $uvsize; i++)
17787 printf("%c", u.c[i]+'0');
17794 if eval $compile && ./try > /dev/null; then
17797 [1-4][1-4][1-4][1-4]|12345678|87654321)
17798 echo "(The test program ran ok.)"
17799 echo "byteorder=$dflt"
17802 ????|????????) echo "(The test program ran ok.)" ;;
17803 *) echo "(The test program didn't run right for some reason.)" ;;
17808 (I can't seem to compile the test program. Guessing big-endian...)
17811 case "$xxx_prompt" in
17813 rp="What is the order of bytes in $uvtype?"
17829 Checking to see whether you can access character data unalignedly...
17831 case "$d_u32align" in
17832 '') $cat >try.c <<EOCP
17834 #$i_stdlib I_STDLIB
17836 #include <stdlib.h>
17838 #define U32 $u32type
17839 #define BYTEORDER 0x$byteorder
17841 #include <signal.h>
17843 $signal_t bletch(int s) { exit(4); }
17846 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
17851 if (sizeof(U32) != 4) {
17852 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
17859 signal(SIGBUS, bletch);
17871 for (i = 0; i < 4; i++) {
17872 up = (U32*)(buf + i);
17873 if (! ((*up == 1 << (8*i)) || /* big-endian */
17874 (*up == 1 << (8*(3-i))) /* little-endian */
17878 printf("read failed (%x)\n", *up);
17884 for (i = 0; i < 4; i++) {
17885 up = (U32*)(buf + i);
17887 if (*up != 0xBeef) {
17888 printf("write failed (%x)\n", *up);
17902 if eval $compile_ok; then
17903 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
17904 $run ./try 2>&1 >/dev/null
17907 You can access character data pretty unalignedly.
17909 d_u32align="$undef"
17912 It seems that you must access character data in an aligned manner.
17914 d_u32align="$define"
17918 rp='Can you access character data at unaligned addresses?'
17922 [yY]*) d_u32align="$undef" ;;
17923 *) d_u32align="$define" ;;
17926 $rm -f core core.try.* try.core
17930 : see if ualarm exists
17931 set ualarm d_ualarm
17934 : see if umask exists
17938 : see if unordered exists
17939 set unordered d_unordered
17942 : see if unsetenv exists
17943 set unsetenv d_unsetenv
17946 : see if usleep exists
17947 set usleep d_usleep
17950 : see if prototype for usleep is available
17952 set d_usleepproto usleep $i_unistd unistd.h
17955 : see if ustat exists
17959 : backward compatibility for d_hvfork
17960 if test X$d_hvfork != X; then
17961 d_vfork="$d_hvfork"
17964 : see if there is a vfork
17969 : Ok, but do we want to use it. vfork is reportedly unreliable in
17970 : perl on Solaris 2.x, and probably elsewhere.
17974 case "$usevfork" in
17980 Perl can only use a vfork() that doesn't suffer from strict
17981 restrictions on calling functions or modifying global data in
17982 the child. For example, glibc-2.1 contains such a vfork()
17983 that is unsuitable. If your system provides a proper fork()
17984 call, chances are that you do NOT want perl to use vfork().
17987 rp="Do you still want to use vfork()?"
17992 echo "Ok, we won't use vfork()."
18001 $define) usevfork='true';;
18002 *) usevfork='false';;
18005 : see if closedir exists
18006 set closedir d_closedir
18009 case "$d_closedir" in
18012 echo "Checking whether closedir() returns a status..." >&4
18014 #$i_dirent I_DIRENT /**/
18015 #$i_sysdir I_SYS_DIR /**/
18016 #$i_sysndir I_SYS_NDIR /**/
18017 #$i_systypes I_SYS_TYPES /**/
18019 #if defined(I_SYS_TYPES)
18020 #include <sys/types.h>
18022 #if defined(I_DIRENT)
18023 #include <dirent.h>
18024 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
18025 #include <sys/dir.h>
18029 #include <sys/ndir.h>
18033 #include <ndir.h> /* may be wrong in the future */
18035 #include <sys/dir.h>
18040 int main() { return closedir(opendir(".")); }
18043 if eval $compile_ok; then
18044 if $run ./try > /dev/null 2>&1 ; then
18045 echo "Yes, it does."
18048 echo "No, it doesn't."
18052 echo "(I can't seem to compile the test program--assuming it doesn't)"
18060 set d_void_closedir
18063 : see if there is a wait4
18067 : see if waitpid exists
18068 set waitpid d_waitpid
18071 : see if wcstombs exists
18072 set wcstombs d_wcstombs
18075 : see if wctomb exists
18076 set wctomb d_wctomb
18079 : see if writev exists
18080 set writev d_writev
18083 : preserve RCS keywords in files with variable substitution, grrr
18088 Revision='$Revision'
18090 : check for alignment requirements
18092 case "$usecrosscompile$multiarch" in
18095 You seem to be either cross-compiling or doing a multiarchitecture build,
18096 skipping the memory alignment check.
18099 case "$alignbytes" in
18100 '') alignbytes=8 ;;
18104 case "$alignbytes" in
18105 '') echo "Checking alignment constraints..." >&4
18106 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
18107 $cat >try.c <<'EOCP'
18108 typedef long double NV;
18111 $cat >try.c <<'EOCP'
18115 $cat >>try.c <<'EOCP'
18123 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
18128 if eval $compile_ok; then
18132 echo "(I can't seem to compile the test program...)"
18135 *) dflt="$alignbytes"
18138 rp="Doubles must be aligned on a how-many-byte boundary?"
18146 : set the base revision
18149 : how do we concatenate cpp tokens here?
18151 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
18152 $cat >cpp_stuff.c <<'EOCP'
18153 #define RCAT(a,b)a/**/b
18154 #define ACAT(a,b)a ## b
18158 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
18159 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
18160 echo "Oh! Smells like ANSI's been here." >&4
18161 echo "We can catify or stringify, separately or together!"
18163 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
18164 echo "Ah, yes! The good old days!" >&4
18165 echo "However, in the good old days we don't know how to stringify and"
18166 echo "catify at the same time."
18170 Hmm, I don't seem to be able to concatenate tokens with your cpp.
18171 You're going to have to edit the values of CAT[2-5] in config.h...
18173 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
18177 : see if this is a db.h system
18183 : Check db version.
18185 echo "Checking Berkeley DB version ..." >&4
18191 #include <sys/types.h>
18193 #$i_stdlib I_STDLIB
18195 #include <stdlib.h>
18198 int main(int argc, char *argv[])
18200 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
18201 int Major, Minor, Patch ;
18202 unsigned long Version ;
18203 (void)db_version(&Major, &Minor, &Patch) ;
18205 printf("%d %d %d %d %d %d\n",
18206 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
18207 Major, Minor, Patch);
18210 printf("You have Berkeley DB Version 2 or greater.\n");
18212 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
18213 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
18214 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
18215 Major, Minor, Patch) ;
18217 /* check that db.h & libdb are compatible */
18218 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
18219 printf("db.h and libdb are incompatible.\n") ;
18223 printf("db.h and libdb are compatible.\n") ;
18225 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
18226 + DB_VERSION_PATCH ;
18228 /* needs to be >= 2.3.4 */
18229 if (Version < 2003004) {
18230 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
18231 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
18237 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
18242 printf("You have Berkeley DB Version 1.\n");
18243 exit(0); /* DB version < 2: the coast is clear. */
18245 exit(1); /* <db.h> not Berkeley DB? */
18251 if eval $compile_ok && $run ./try; then
18252 echo 'Looks OK.' >&4
18254 db_version_major=$1
18255 db_version_minor=$2
18256 db_version_patch=$3
18258 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
18262 : Remove db from list of libraries to use
18263 echo "Removing unusable -ldb from library list" >&4
18264 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
18267 echo "libs = $libs" >&4
18277 : Check the return type needed for hash
18279 echo "Checking return type needed for hash for Berkeley DB ..." >&4
18285 #include <sys/types.h>
18288 #ifndef DB_VERSION_MAJOR
18289 u_int32_t hash_cb (ptr, size)
18297 info.hash = hash_cb;
18301 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18302 if $contains warning try.out >>/dev/null 2>&1 ; then
18305 db_hashtype='u_int32_t'
18308 : XXX Maybe we should just give up here.
18309 db_hashtype=u_int32_t
18311 echo "Help: I can't seem to compile the db test program." >&4
18312 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
18315 echo "Your version of Berkeley DB uses $db_hashtype for hash."
18317 *) db_hashtype=u_int32_t
18322 : Check the return type needed for prefix
18324 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
18330 #include <sys/types.h>
18333 #ifndef DB_VERSION_MAJOR
18334 size_t prefix_cb (key1, key2)
18342 info.prefix = prefix_cb;
18346 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18347 if $contains warning try.out >>/dev/null 2>&1 ; then
18348 db_prefixtype='int'
18350 db_prefixtype='size_t'
18353 db_prefixtype='size_t'
18354 : XXX Maybe we should just give up here.
18356 echo "Help: I can't seem to compile the db test program." >&4
18357 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
18360 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
18362 *) db_prefixtype='size_t'
18367 : How can we generate normalized random numbers ?
18369 echo "Looking for a random number function..." >&4
18370 case "$randfunc" in
18372 if set drand48 val -f; eval $csym; $val; then
18374 echo "Good, found drand48()." >&4
18375 elif set random val -f; eval $csym; $val; then
18377 echo "OK, found random()." >&4
18380 echo "Yick, looks like I have to use rand()." >&4
18391 *-Dmy_rand=*|*-Dmy_srand=*)
18392 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
18393 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
18394 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
18395 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
18399 while $test "$cont"; do
18400 rp="Use which function to generate random numbers?"
18402 if $test "$ans" = "$dflt"; then
18408 if set $ans val -f; eval $csym; $val; then
18412 rp="I cannot find function $ans. Use that name anyway?"
18421 case "$randfunc" in
18423 drand01="drand48()"
18429 case "$randbits" in
18431 echo "Checking to see how many bits your $randfunc() function produces..." >&4
18433 #$i_unistd I_UNISTD
18434 #$i_stdlib I_STDLIB
18437 # include <unistd.h>
18440 # include <stdlib.h>
18445 register unsigned long tmp;
18446 register unsigned long max = 0L;
18448 for (i = 1000; i; i--) {
18449 tmp = (unsigned long) $randfunc();
18450 if (tmp > max) max = tmp;
18452 for (i = 0; max; i++)
18458 if eval $compile_ok; then
18462 echo "(I can't seem to compile the test program...)"
18469 rp="How many bits does your $randfunc() function produce?"
18473 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18474 seedfunc="s$randfunc"
18475 randseedtype=unsigned
18479 rp="How many bits does your $randfunc() function produce?"
18482 seedfunc="s$randfunc"
18483 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18484 if set $seedfunc val -f; eval $csym; $val; then
18485 echo "(Using $seedfunc() to seed random generator)"
18487 echo "(Warning: no $seedfunc() to seed random generator)"
18490 randseedtype=unsigned
18498 echo "Determining whether or not we are on an EBCDIC system..." >&4
18499 $cat >try.c <<'EOM'
18502 if ('M'==0xd4) return 0;
18509 if eval $compile_ok; then
18510 if $run ./try; then
18511 echo "You seem to speak EBCDIC." >&4
18514 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
18517 echo "I'm unable to compile the test program." >&4
18518 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
18526 Checking how to flush all pending stdio output...
18528 # I only know how to find the first 32 possibly open files on SunOS.
18529 # See also hints/sunos_4_1.sh and util.c --AD
18531 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
18533 $cat >>try.c <<EOCP
18535 #$i_stdlib I_STDLIB
18537 #include <stdlib.h>
18539 #$i_unistd I_UNISTD
18541 # include <unistd.h>
18543 #$d_sysconf HAS_SYSCONF
18544 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
18545 #ifdef HAS_STDIO_STREAM_ARRAY
18546 # define STDIO_STREAM_ARRAY $stdio_stream_array
18551 p = fopen("try.out", "w");
18555 # ifdef TRY_FPRINTF
18559 #ifdef TRY_FFLUSH_NULL
18562 #ifdef TRY_FFLUSH_ALL
18564 long open_max = -1;
18565 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
18566 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
18568 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
18569 open_max = sysconf(_SC_OPEN_MAX);
18572 open_max = FOPEN_MAX;
18575 open_max = OPEN_MAX;
18584 # ifdef HAS_STDIO_STREAM_ARRAY
18585 if (open_max > 0) {
18587 for (i = 0; i < open_max; i++)
18588 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
18589 STDIO_STREAM_ARRAY[i]._file < open_max &&
18590 STDIO_STREAM_ARRAY[i]._flag)
18591 fflush(&STDIO_STREAM_ARRAY[i]);
18599 : first we have to find out how _not_ to flush
18601 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
18603 set try -DTRY_FPUTC
18604 if eval $compile; then
18605 $run ./try 2>/dev/null
18608 if $test ! -s try.out -a "X$code" = X42; then
18614 set try -DTRY_FPRINTF
18615 if eval $compile; then
18616 $run ./try 2>/dev/null
18619 if $test ! -s try.out -a "X$code" = X42; then
18620 output=-DTRY_FPRINTF
18626 : check for fflush NULL behaviour
18627 case "$fflushNULL" in
18628 '') set try -DTRY_FFLUSH_NULL $output
18629 if eval $compile; then
18630 $run ./try 2>/dev/null
18633 if $test -s try.out -a "X$code" = X42; then
18634 fflushNULL="`$cat try.out`"
18636 if $test "X$code" != X42; then
18638 (If this test failed, don't worry, we'll try another method shortly.)
18643 $rm -f core try.core core.try.*
18644 case "$fflushNULL" in
18646 Your fflush(NULL) works okay for output streams.
18647 Let's see if it clobbers input pipes...
18649 # As of mid-March 2000 all versions of Solaris appear to have a stdio
18650 # bug that improperly flushes the input end of pipes. So we avoid the
18651 # autoflush on fork/system/exec support for now. :-(
18652 $cat >tryp.c <<EOCP
18655 main(int argc, char **argv)
18661 while ((i = getc(stdin)) != -1
18662 && (*bp++ = i) != '\n'
18663 && bp < &buf[1024])
18666 fprintf(stdout, "%s", buf);
18674 fflushNULL="$define"
18676 if eval $compile; then
18678 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
18679 if cmp tryp.c tryp.out >/dev/null 2>&1; then
18681 fflush(NULL) seems to behave okay with input streams.
18683 fflushNULL="$define"
18686 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
18688 fflushNULL="$undef"
18691 $rm -f core tryp.c tryp.core core.tryp.*
18694 Your fflush(NULL) isn't working (contrary to ANSI C).
18696 fflushNULL="$undef"
18699 Cannot figure out whether your fflush(NULL) works or not.
18700 I'm assuming it doesn't (contrary to ANSI C).
18702 fflushNULL="$undef"
18706 $define|true|[yY]*)
18707 fflushNULL="$define"
18710 fflushNULL="$undef"
18713 : check explicit looping only if NULL did not work, and if the pipe
18714 : bug does not show up on an explicit flush too
18715 case "$fflushNULL" in
18717 $cat >tryp.c <<EOCP
18720 main(int argc, char **argv)
18726 while ((i = getc(stdin)) != -1
18727 && (*bp++ = i) != '\n'
18728 && bp < &buf[1024])
18731 fprintf(stdout, "%s", buf);
18740 if eval $compile; then
18742 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
18743 if cmp tryp.c tryp.out >/dev/null 2>&1; then
18745 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
18747 : now check for fflushall behaviour
18748 case "$fflushall" in
18749 '') set try -DTRY_FFLUSH_ALL $output
18750 if eval $compile; then
18752 (Now testing the other method--but note that this also may fail.)
18754 $run ./try 2>/dev/null
18757 if $test -s try.out -a "X$code" = X42; then
18758 fflushall="`$cat try.out`"
18761 $rm -f core try.core core.try.*
18762 case "$fflushall" in
18764 Whew. Flushing explicitly all the stdio streams works.
18766 fflushall="$define"
18769 Sigh. Flushing explicitly all the stdio streams doesn't work.
18774 Cannot figure out whether flushing stdio streams explicitly works or not.
18775 I'm assuming it doesn't.
18781 "$define"|true|[yY]*)
18782 fflushall="$define"
18790 All is futile. Even fflush(stdin) clobbers input pipes!
18797 $rm -f core tryp.c tryp.core core.tryp.*
18799 *) fflushall="$undef"
18803 case "$fflushNULL$fflushall" in
18806 OK, I give up. I cannot figure out how to flush pending stdio output.
18807 We won't be flushing handles at all before fork/exec/popen.
18811 $rm -f try.* try$exe_ext
18813 : Store the full pathname to the ar program for use in the C program
18814 : Respect a hint or command line value for full_ar.
18819 : Store the full pathname to the sed program for use in the C program
18822 : see what type gids are declared as in the kernel
18824 echo "Looking for the type for group ids returned by getgid()."
18825 set gid_t gidtype xxx stdio.h sys/types.h
18829 xxx=`./findhdr sys/user.h`
18830 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
18832 unsigned) dflt="$1 $2" ;;
18836 *) dflt="$gidtype";;
18839 gid_t) echo "gid_t found." ;;
18840 *) rp="What is the type for group ids returned by getgid()?"
18848 *_t) zzz="$gidtype" ;;
18851 echo "Checking the size of $zzz..." >&4
18853 #include <sys/types.h>
18855 #$i_stdlib I_STDLIB
18857 #include <stdlib.h>
18860 printf("%d\n", (int)sizeof($gidtype));
18865 if eval $compile_ok; then
18869 echo "(I can't execute the test program--guessing $gidsize.)" >&4
18872 echo "Your $zzz is $gidsize bytes long."
18877 echo "(I can't compile the test program--guessing $gidsize.)" >&4
18883 *_t) zzz="$gidtype" ;;
18886 echo "Checking the sign of $zzz..." >&4
18888 #include <sys/types.h>
18899 if eval $compile; then
18903 echo "(I can't execute the test program--guessing unsigned.)" >&4
18907 1) echo "Your $zzz is unsigned." ;;
18908 -1) echo "Your $zzz is signed." ;;
18914 echo "(I can't compile the test program--guessing unsigned.)" >&4
18920 if $test X"$quadtype" != X; then
18922 echo "Checking how to print 64-bit integers..." >&4
18924 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
18925 $cat >try.c <<'EOCP'
18926 #include <sys/types.h>
18929 int q = 12345678901;
18930 printf("%ld\n", q);
18934 if eval $compile; then
18938 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
18939 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
18940 echo "We will use %d."
18946 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
18947 $cat >try.c <<'EOCP'
18948 #include <sys/types.h>
18951 long q = 12345678901;
18952 printf("%ld\n", q);
18956 if eval $compile; then
18960 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
18961 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
18962 echo "We will use %ld."
18968 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
18969 $cat >try.c <<'EOCP'
18970 #include <sys/types.h>
18971 #include <inttypes.h>
18974 int64_t q = 12345678901;
18975 printf("%" PRId64 "\n", q);
18979 if eval $compile; then
18983 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
18984 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
18985 echo "We will use the C9X style."
18991 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
18993 #include <sys/types.h>
18996 $quadtype q = 12345678901;
18997 printf("%Ld\n", q);
19001 if eval $compile; then
19005 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
19006 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
19007 echo "We will use %Ld."
19013 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
19014 $cat >try.c <<'EOCP'
19015 #include <sys/types.h>
19018 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
19019 printf("%lld\n", q);
19023 if eval $compile; then
19027 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
19028 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
19029 echo "We will use the %lld style."
19035 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19037 #include <sys/types.h>
19040 $quadtype q = 12345678901;
19041 printf("%qd\n", q);
19045 if eval $compile; then
19049 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
19050 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
19051 echo "We will use %qd."
19057 if $test X"$sPRId64" = X; then
19058 echo "Cannot figure out how to print 64-bit integers." >&4
19066 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
19067 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
19069 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
19070 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
19076 $echo "Checking the format strings to be used for Perl's internal types..." >&4
19078 if $test X"$ivsize" = X8; then
19079 ivdformat="$sPRId64"
19080 uvuformat="$sPRIu64"
19081 uvoformat="$sPRIo64"
19082 uvxformat="$sPRIx64"
19083 uvXUformat="$sPRIXU64"
19085 if $test X"$ivsize" = X"$longsize"; then
19092 if $test X"$ivsize" = X"$intsize"; then
19100 if $test X"$ivsize" = X"$shortsize"; then
19111 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
19112 nveformat="$sPRIeldbl"
19113 nvfformat="$sPRIfldbl"
19114 nvgformat="$sPRIgldbl"
19115 nvEUformat="$sPRIEUldbl"
19116 nvFUformat="$sPRIFUldbl"
19117 nvGUformat="$sPRIGUldbl"
19127 case "$ivdformat" in
19128 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
19135 $echo "Checking the format string to be used for gids..." >&4
19138 -1) if $test X"$gidsize" = X"$ivsize"; then
19139 gidformat="$ivdformat"
19141 if $test X"$gidsize" = X"$longsize"; then
19144 if $test X"$gidsize" = X"$intsize"; then
19147 if $test X"$gidsize" = X"$shortsize"; then
19154 *) if $test X"$gidsize" = X"$uvsize"; then
19155 gidformat="$uvuformat"
19157 if $test X"$gidsize" = X"$longsize"; then
19160 if $test X"$gidsize" = X"$intsize"; then
19163 if $test X"$gidsize" = X"$shortsize"; then
19172 : see if getgroups exists
19173 set getgroups d_getgrps
19176 : see if setgroups exists
19177 set setgroups d_setgrps
19181 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
19183 case "$d_getgrps$d_setgrps" in
19185 case "$groupstype" in
19186 '') dflt="$gidtype" ;;
19187 *) dflt="$groupstype" ;;
19190 What type of pointer is the second argument to getgroups() and setgroups()?
19191 Usually this is the same as group ids, $gidtype, but not always.
19194 rp='What type pointer is the second argument to getgroups() and setgroups()?'
19198 *) groupstype="$gidtype";;
19202 if $test $patchlevel -lt 9; then
19203 : MAD is not available in 5.8.x or earlier.
19207 $define|true|[yY]*) dflt='y' ;;
19212 Would you like to build with Misc Attribute Decoration? This is development
19213 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
19214 overhead on the interpreter.
19216 If this doesn't make any sense to you, just accept the default '$dflt'.
19218 rp='Build Perl with MAD?'
19223 madlyh='madly.h madly.act madly.tab'
19225 madlyobj="madly$_o" ;;
19235 echo "Checking if your $make program sets \$(MAKE)..." >&4
19236 case "$make_set_make" in
19238 $sed 's/^X //' > testmake.mak << 'EOF'
19240 X @echo 'maketemp="$(MAKE)"'
19242 case "`$make -f testmake.mak 2>/dev/null`" in
19243 *maketemp=*) make_set_make='#' ;;
19244 *) make_set_make="MAKE=$make" ;;
19246 $rm -f testmake.mak
19249 case "$make_set_make" in
19250 '#') echo "Yup, it does.";;
19251 *) echo "Nope, it doesn't.";;
19254 : see what type is used for mode_t
19255 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
19256 set mode_t modetype int stdio.h sys/types.h
19259 : see if we need va_copy
19261 case "$i_stdarg" in
19264 #include <stdarg.h>
19266 #$i_stdlib I_STDLIB
19268 #include <stdlib.h>
19270 #include <signal.h>
19273 ivfprintf(FILE *f, const char *fmt, va_list *valp)
19275 return vfprintf(f, fmt, *valp);
19279 myvfprintf(FILE *f, const char *fmt, va_list val)
19281 return ivfprintf(f, fmt, &val);
19285 myprintf(char *fmt, ...)
19288 va_start(val, fmt);
19289 return myvfprintf(stdout, fmt, val);
19293 main(int ac, char **av)
19295 signal(SIGSEGV, exit);
19297 myprintf("%s%cs all right, then\n", "that", '\'');
19302 if eval $compile && $run ./try 2>&1 >/dev/null; then
19303 case "`$run ./try`" in
19304 "that's all right, then")
19310 yes) echo "It seems that you don't need va_copy()." >&4
19311 need_va_copy="$undef"
19313 *) echo "It seems that va_copy() or similar will be needed." >&4
19314 need_va_copy="$define"
19317 $rm -f try.* core core.* *.core *.core.*
19319 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
19323 : see what type is used for size_t
19324 rp="What is the type used for the length parameter for string functions?"
19325 set size_t sizetype 'unsigned int' stdio.h sys/types.h
19328 : check for type of arguments to gethostbyaddr.
19329 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
19330 case "$d_gethbyaddr" in
19334 Checking to see what type of arguments are accepted by gethostbyaddr().
19336 hdrs="$define sys/types.h
19337 $d_socket sys/socket.h
19338 $i_niin netinet/in.h
19340 $i_unistd unistd.h"
19341 : The first arg can 'char *' or 'void *'
19342 : The second arg is some of integral type
19343 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
19344 for yyy in size_t long int; do
19345 case "$netdb_host_type" in
19346 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
19347 if ./protochk "$try" $hdrs; then
19348 echo "Your system accepts $xxx for the first arg."
19349 echo "...and $yyy for the second arg."
19350 netdb_host_type="$xxx"
19351 netdb_hlen_type="$yyy"
19357 : In case none of those worked, prompt the user.
19358 case "$netdb_host_type" in
19359 '') rp='What is the type for the 1st argument to gethostbyaddr?'
19362 netdb_host_type=$ans
19363 rp='What is the type for the 2nd argument to gethostbyaddr?'
19366 netdb_hlen_type=$ans
19370 *) : no gethostbyaddr, so pick harmless defaults
19371 netdb_host_type='char *'
19372 netdb_hlen_type="$sizetype"
19375 # Remove the "const" if needed. -- but then we'll have a
19377 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
19380 : check for type of argument to gethostbyname.
19381 if test "X$netdb_name_type" = X ; then
19382 case "$d_gethbyname" in
19386 Checking to see what type of argument is accepted by gethostbyname().
19388 hdrs="$define sys/types.h
19389 $d_socket sys/socket.h
19390 $i_niin netinet/in.h
19392 $i_unistd unistd.h"
19393 for xxx in "const char *" "char *"; do
19394 case "$netdb_name_type" in
19395 '') try="extern struct hostent *gethostbyname($xxx);"
19396 if ./protochk "$try" $hdrs; then
19397 echo "Your system accepts $xxx."
19398 netdb_name_type="$xxx"
19403 : In case none of those worked, prompt the user.
19404 case "$netdb_name_type" in
19405 '') rp='What is the type for the 1st argument to gethostbyname?'
19408 netdb_name_type=$ans
19412 *) : no gethostbyname, so pick harmless default
19413 netdb_name_type='char *'
19418 : check for type of 1st argument to getnetbyaddr.
19419 if test "X$netdb_net_type" = X ; then
19420 case "$d_getnbyaddr" in
19424 Checking to see what type of 1st argument is accepted by getnetbyaddr().
19426 hdrs="$define sys/types.h
19427 $d_socket sys/socket.h
19428 $i_niin netinet/in.h
19430 $i_unistd unistd.h"
19431 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
19432 case "$netdb_net_type" in
19433 '') try="extern struct netent *getnetbyaddr($xxx, int);"
19434 if ./protochk "$try" $hdrs; then
19435 echo "Your system accepts $xxx."
19436 netdb_net_type="$xxx"
19441 : In case none of those worked, prompt the user.
19442 case "$netdb_net_type" in
19443 '') rp='What is the type for the 1st argument to getnetbyaddr?'
19446 netdb_net_type=$ans
19450 *) : no getnetbyaddr, so pick harmless default
19451 netdb_net_type='long'
19455 : locate the preferred pager for this system
19462 [a-zA-Z]:/*) dflt=$pg;;
19466 [a-zA-Z]:/*) dflt=$more;;
19470 [a-zA-Z]:/*) dflt=$less;;
19473 '') dflt=/usr/ucb/more;;
19477 : Instruct ./getfile to trust the hinted or previous pager value,
19478 : even if it does not begin with a slash. For example, on os2,
19479 : pager might be cmd /c more. See comments in UU/getfile.
19484 rp='What pager is used on your system?'
19488 : see what type pids are declared as in the kernel
19489 rp="What is the type of process ids on this system?"
19490 set pid_t pidtype int stdio.h sys/types.h
19493 : see if ar generates random libraries by itself
19495 echo "Checking how to generate random libraries on your machine..." >&4
19496 echo 'int bar1() { return bar2(); }' > bar1.c
19497 echo 'int bar2() { return 2; }' > bar2.c
19499 #$i_stdlib I_STDLIB
19501 #include <stdlib.h>
19503 int main() { printf("%d\n", bar1()); exit(0); }
19505 $cc $ccflags -c bar1.c >/dev/null 2>&1
19506 $cc $ccflags -c bar2.c >/dev/null 2>&1
19507 $cc $ccflags -c foo.c >/dev/null 2>&1
19508 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
19509 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19510 $run ./foobar >/dev/null 2>&1; then
19511 echo "$ar appears to generate random libraries itself."
19513 if [ "X$ranlib" = "X" ]; then
19516 elif $ar s bar$_a >/dev/null 2>&1 &&
19517 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19518 $run ./foobar >/dev/null 2>&1; then
19519 echo "a table of contents needs to be added with '$ar s'."
19522 elif $ar ts bar$_a >/dev/null 2>&1 &&
19523 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19524 $run ./foobar >/dev/null 2>&1; then
19525 echo "a table of contents needs to be added with '$ar ts'."
19532 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
19533 $test -f $ranlib || ranlib=''
19536 if $test -n "$ranlib"; then
19537 echo "your system has '$ranlib'; we'll use that."
19540 echo "your system doesn't seem to support random libraries"
19541 echo "so we'll use lorder and tsort to order the libraries."
19548 : check for type of arguments to select.
19549 case "$selecttype" in
19550 '') case "$d_select" in
19554 Checking to see what type of arguments are accepted by select().
19556 hdrs="$define sys/types.h
19557 $i_systime sys/time.h
19558 $i_sysselct sys/select.h
19559 $d_socket sys/socket.h"
19560 : The first arg can be int, unsigned, or size_t
19561 : The last arg may or may not be 'const'
19563 : void pointer has been seen but using that
19564 : breaks the selectminbits test
19565 for xxx in 'fd_set *' 'int *'; do
19566 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
19567 for tmo in 'struct timeval *' 'const struct timeval *'; do
19569 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
19570 if ./protochk "$try" $hdrs; then
19571 echo "Your system accepts $xxx."
19580 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
19581 case "$d_fd_set" in
19582 $define) dflt="fd_set *" ;;
19591 *) : no select, so pick a harmless default
19598 : check for the select 'width'
19599 case "$selectminbits" in
19600 '') safebits=`expr $ptrsize \* 8`
19601 case "$d_select" in
19605 Checking to see on how many bits at a time your select() operates...
19608 #include <sys/types.h>
19610 #$i_systime I_SYS_TIME
19611 #$i_systimek I_SYS_TIME_KERNEL
19616 # ifdef I_SYS_TIME_KERNEL
19619 # include <sys/time.h>
19620 # ifdef I_SYS_TIME_KERNEL
19624 #$i_sysselct I_SYS_SELECT
19625 #ifdef I_SYS_SELECT
19626 #include <sys/select.h>
19628 #$d_socket HAS_SOCKET
19630 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
19633 #$i_stdlib I_STDLIB
19635 #include <stdlib.h>
19638 #define S sizeof(*(b))
19640 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
19641 #define NBITS (NBYTES * 8)
19643 char *s = (char *)malloc(NBYTES);
19652 fp = fopen("try.c", "r");
19658 b = ($selecttype)s;
19659 for (i = 0; i < NBITS; i++)
19663 select(fd + 1, b, 0, 0, &t);
19664 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
19666 printf("%d\n", i + 1);
19671 if eval $compile_ok; then
19672 selectminbits=`$run ./try`
19673 case "$selectminbits" in
19675 Cannot figure out on how many bits at a time your select() operates.
19676 I'll play safe and guess it is $safebits bits.
19678 selectminbits=$safebits
19679 bits="$safebits bits"
19682 *) bits="$selectminbits bits" ;;
19684 echo "Your select() operates on $bits at a time." >&4
19686 rp='What is the minimum number of bits your select() operates on?'
19687 case "$byteorder" in
19688 12345678) dflt=64 ;;
19694 selectminbits="$val"
19698 *) : no select, so pick a harmless default
19699 selectminbits=$safebits
19705 : Trace out the files included by signal.h, then look for SIGxxx names.
19706 : Remove SIGARRAYSIZE used by HPUX.
19707 : Remove SIGSTKSIZE used by Linux.
19708 : Remove SIGSTKSZ used by Posix.
19709 : Remove SIGTYP void lines used by OS2.
19710 : Some cpps, like os390, dont give the file name anywhere
19711 if [ "X$fieldn" = X ]; then
19712 : Just make some guesses. We check them later.
19713 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
19715 xxx=`echo '#include <signal.h>' |
19716 $cppstdin $cppminus $cppflags 2>/dev/null |
19717 $grep '^[ ]*#.*include' |
19718 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
19720 : Check this list of files to be sure we have parsed the cpp output ok.
19721 : This will also avoid potentially non-existent files, such
19724 for xx in $xxx /dev/null ; do
19725 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
19727 : If we have found no files, at least try signal.h
19728 case "$xxxfiles" in
19729 '') xxxfiles=`./findhdr signal.h` ;;
19732 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
19733 print substr($2, 4, 20)
19735 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
19736 print substr($3, 4, 20)
19738 : Append some common names just in case the awk scan failed.
19739 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
19740 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
19741 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
19742 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
19743 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
19745 : generate a few handy files for later
19746 $cat > signal.c <<EOCP
19747 #include <sys/types.h>
19748 #include <signal.h>
19749 #$i_stdlib I_STDLIB
19751 #include <stdlib.h>
19756 /* Strange style to avoid deeply-nested #if/#else/#endif */
19759 # define NSIG (_NSIG)
19765 # define NSIG (SIGMAX+1)
19771 # define NSIG (SIG_MAX+1)
19777 # define NSIG (_SIG_MAX+1)
19783 # define NSIG (MAXSIG+1)
19789 # define NSIG (MAX_SIG+1)
19794 # ifdef SIGARRAYSIZE
19795 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
19801 # define NSIG (_sys_nsig) /* Solaris 2.5 */
19805 /* Default to some arbitrary number that's big enough to get most
19806 of the common signals.
19812 printf("NSIG %d\n", NSIG);
19818 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
19820 printf "#ifdef SIG"; printf $1; printf "\n"
19821 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
19822 printf $1; printf ");\n"
19826 printf "#endif /* JUST_NSIG */\n";
19827 printf "exit(0);\n}\n";
19830 $cat >signal.awk <<'EOP'
19831 BEGIN { ndups = 0 }
19832 $1 ~ /^NSIG$/ { nsig = $2 }
19833 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
19834 if ($2 > maxsig) { maxsig = $2 }
19835 if (sig_name[$2]) {
19836 dup_name[ndups] = $1
19837 dup_num[ndups] = $2
19849 printf("NSIG %d\n", nsig);
19850 for (n = 1; n < nsig; n++) {
19852 printf("%s %d\n", sig_name[n], sig_num[n])
19855 printf("NUM%d %d\n", n, n)
19858 for (n = 0; n < ndups; n++) {
19859 printf("%s %d\n", dup_name[n], dup_num[n])
19863 $cat >signal_cmd <<EOS
19865 if $test -s signal.lst; then
19866 echo "Using your existing signal.lst file"
19871 $cat >>signal_cmd <<'EOS'
19874 if eval $compile_ok; then
19875 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) | $uniq | $awk -f signal.awk >signal.lst
19877 echo "(I can't seem be able to compile the whole test program)" >&4
19878 echo "(I'll try it in little pieces.)" >&4
19879 set signal -DJUST_NSIG
19880 if eval $compile_ok; then
19881 $run ./signal$_exe > signal.nsg
19884 echo "I can't seem to figure out how many signals you have." >&4
19885 echo "Guessing 50." >&4
19886 echo 'NSIG 50' > signal.nsg
19888 : Now look at all the signal names, one at a time.
19889 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
19890 $cat > signal.c <<EOCP
19891 #include <sys/types.h>
19892 #include <signal.h>
19895 printf("$xx %d\n", SIG${xx});
19900 if eval $compile; then
19901 echo "SIG${xx} found."
19902 $run ./signal$_exe >> signal.ls1
19904 echo "SIG${xx} NOT found."
19907 if $test -s signal.ls1; then
19908 $cat signal.nsg signal.ls1 |
19909 $sort -n | $uniq | $awk -f signal.awk >signal.lst
19913 if $test -s signal.lst; then
19916 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
19917 echo 'kill -l' >signal
19918 set X `csh -f <signal`
19922 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
19924 echo $@ | $tr ' ' $trnl | \
19925 $awk '{ printf "%s %d\n", $1, ++s; }
19926 END { printf "NSIG %d\n", ++s }' >signal.lst
19928 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
19930 chmod a+x signal_cmd
19931 $eunicefix signal_cmd
19933 : generate list of signal names
19935 case "$sig_name_init" in
19937 *) case "$sig_num_init" in
19938 ''|*,*) doinit=yes ;;
19943 echo "Generating a list of signal names and numbers..." >&4
19945 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
19946 sig_name=`$awk 'BEGIN { printf "ZERO " }
19947 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
19948 sig_num=`$awk 'BEGIN { printf "0 " }
19949 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
19950 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
19951 !/^NSIG/ { printf "\"%s\", ", $1 }
19952 END { printf "0\n" }' signal.lst`
19953 sig_num_init=`$awk 'BEGIN { printf "0, " }
19954 !/^NSIG/ { printf "%d, ", $2}
19955 END { printf "0\n"}' signal.lst`
19958 echo "The following $sig_count signals are available:"
19960 echo $sig_name | $awk \
19961 'BEGIN { linelen = 0 }
19963 for (i = 1; i <= NF; i++) {
19964 name = "SIG" $i " "
19965 linelen = linelen + length(name)
19966 if (linelen > 70) {
19968 linelen = length(name)
19974 sig_size=`echo $sig_name | awk '{print NF}'`
19975 $rm -f signal signal.c signal.awk signal.lst signal_cmd
19978 case "$sizetype" in
19979 *_t) zzz="$sizetype" ;;
19980 *) zzz="filesize" ;;
19982 echo "Checking the size of $zzz..." >&4
19984 #include <sys/types.h>
19986 #$i_stdlib I_STDLIB
19988 #include <stdlib.h>
19991 printf("%d\n", (int)sizeof($sizetype));
19996 if eval $compile_ok; then
20000 echo "(I can't execute the test program--guessing $sizesize.)" >&4
20003 echo "Your $zzz size is $sizesize bytes."
20008 echo "(I can't compile the test program--guessing $sizesize.)" >&4
20012 : check for socklen_t
20014 echo "Checking to see if you have socklen_t..." >&4
20016 #include <sys/types.h>
20017 #$d_socket HAS_SOCKET
20019 #include <sys/socket.h>
20021 int main() { socklen_t x = 16; }
20024 if eval $compile; then
20026 echo "You have socklen_t."
20029 echo "You do not have socklen_t."
20030 case "$sizetype" in
20031 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
20038 : see if this is a socks.h system
20039 set socks.h i_socks
20042 : check for type of the size argument to socket calls
20043 case "$d_socket" in
20047 Checking to see what type is the last argument of accept().
20050 case "$d_socklen_t" in
20051 "$define") yyy="$yyy socklen_t"
20053 yyy="$yyy $sizetype int long unsigned"
20054 for xxx in $yyy; do
20055 case "$socksizetype" in
20056 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
20057 case "$usesocks" in
20059 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
20060 echo "Your system accepts '$xxx *' for the last argument of accept()."
20061 socksizetype="$xxx"
20064 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
20065 echo "Your system accepts '$xxx *' for the last argument of accept()."
20066 socksizetype="$xxx"
20073 : In case none of those worked, prompt the user.
20074 case "$socksizetype" in
20075 '') rp='What is the type for socket address structure sizes?'
20082 *) : no sockets, so pick relatively harmless default
20087 : see what type is used for signed size_t
20088 set ssize_t ssizetype int stdio.h sys/types.h
20093 #$i_stdlib I_STDLIB
20095 #include <stdlib.h>
20097 #include <sys/types.h>
20098 #define Size_t $sizetype
20099 #define SSize_t $dflt
20102 if (sizeof(Size_t) == sizeof(SSize_t))
20104 else if (sizeof(Size_t) == sizeof(int))
20113 if eval $compile_ok && $run ./try > /dev/null; then
20114 ssizetype=`$run ./try`
20115 echo "I'll be using $ssizetype for functions returning a byte count." >&4
20118 Help! I can't compile and run the ssize_t test program: please enlighten me!
20119 (This is probably a misconfiguration in your system or libraries, and
20120 you really ought to fix it. Still, I'll try anyway.)
20122 I need a type that is the same size as $sizetype, but is guaranteed to
20123 be signed. Common values are ssize_t, int and long.
20126 rp="What signed type is the same size as $sizetype?"
20132 : see what type of char stdio uses.
20134 echo '#include <stdio.h>' > stdio.c
20135 $cppstdin $cppminus < stdio.c > stdioh
20136 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
20137 echo "Your stdio uses unsigned chars." >&4
20138 stdchar="unsigned char"
20140 echo "Your stdio uses signed chars." >&4
20143 $rm -f stdio.* stdioh
20145 : see what type uids are declared as in the kernel
20147 echo "Looking for the type for user ids returned by getuid()."
20148 set uid_t uidtype xxx stdio.h sys/types.h
20152 xxx=`./findhdr sys/user.h`
20153 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
20155 unsigned) dflt="$1 $2" ;;
20159 *) dflt="$uidtype";;
20162 uid_t) echo "uid_t found." ;;
20163 *) rp="What is the type for user ids returned by getuid()?"
20171 *_t) zzz="$uidtype" ;;
20174 echo "Checking the size of $zzz..." >&4
20176 #include <sys/types.h>
20178 #$i_stdlib I_STDLIB
20180 #include <stdlib.h>
20183 printf("%d\n", (int)sizeof($uidtype));
20188 if eval $compile_ok; then
20192 echo "(I can't execute the test program--guessing $uidsize.)" >&4
20195 echo "Your $zzz is $uidsize bytes long."
20200 echo "(I can't compile the test program--guessing $uidsize.)" >&4
20205 *_t) zzz="$uidtype" ;;
20208 echo "Checking the sign of $zzz..." >&4
20210 #include <sys/types.h>
20221 if eval $compile; then
20225 echo "(I can't execute the test program--guessing unsigned.)" >&4
20229 1) echo "Your $zzz is unsigned." ;;
20230 -1) echo "Your $zzz is signed." ;;
20236 echo "(I can't compile the test program--guessing unsigned.)" >&4
20242 $echo "Checking the format string to be used for uids..." >&4
20245 -1) if $test X"$uidsize" = X"$ivsize"; then
20246 uidformat="$ivdformat"
20248 if $test X"$uidsize" = X"$longsize"; then
20251 if $test X"$uidsize" = X"$intsize"; then
20254 if $test X"$uidsize" = X"$shortsize"; then
20261 *) if $test X"$uidsize" = X"$uvsize"; then
20262 uidformat="$uvuformat"
20264 if $test X"$uidsize" = X"$longsize"; then
20267 if $test X"$uidsize" = X"$intsize"; then
20270 if $test X"$uidsize" = X"$shortsize"; then
20280 case "$usesitecustomize" in
20281 $define|true|[Yy]*)
20282 usesitecustomize="$define"
20285 usesitecustomize="$undef"
20289 : determine compiler compiler
20298 if $test -f "$byacc$_exe"; then
20300 comp="byacc or $comp"
20302 if $test -f "$bison$_exe"; then
20303 comp="$comp or bison -y"
20305 rp="Which compiler compiler ($comp) shall I use?"
20314 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
20320 : see if this is a fp.h system
20324 : see if this is a fp_class.h system
20325 set fp_class.h i_fp_class
20328 : see if gdbm.h is available
20333 : see if gdbm_open exists
20334 set gdbm_open d_gdbm_open
20336 case "$d_gdbm_open" in
20339 echo "We won't be including <gdbm.h>"
20348 : see if this is a ieeefp.h system
20349 case "$i_ieeefp" in
20350 '' ) set ieeefp.h i_ieeefp
20355 : see if this is a libutil.h system
20356 set libutil.h i_libutil
20359 : see if mach cthreads are available
20360 if test "X$usethreads" = "X$define"; then
20361 set mach/cthreads.h i_machcthr
20364 i_machcthr="$undef"
20369 : see if this is a mntent.h system
20370 set mntent.h i_mntent
20373 : see if ndbm.h is available
20379 # Some Linux distributions such as RedHat 7.1 put the
20380 # ndbm.h header in /usr/include/gdbm/ndbm.h.
20381 if $test -f /usr/include/gdbm/ndbm.h; then
20382 echo '<gdbm/ndbm.h> found.'
20383 ccflags="$ccflags -I/usr/include/gdbm"
20384 cppflags="$cppflags -I/usr/include/gdbm"
20392 : see if dbm_open exists
20393 set dbm_open d_dbm_open
20395 case "$d_dbm_open" in
20398 echo "We won't be including <ndbm.h>"
20407 : see if net/errno.h is available
20409 set net/errno.h val
20412 : Unfortunately, it causes problems on some systems. Arrgh.
20415 cat > try.c <<'EOM'
20418 #include <net/errno.h>
20424 if $cc $ccflags -c try.c >/dev/null 2>&1; then
20425 echo "We'll be including <net/errno.h>." >&4
20427 echo "We won't be including <net/errno.h>." >&4
20436 : see if netinet/tcp.h is available
20437 set netinet/tcp.h i_netinettcp
20440 : see if this is a poll.h system
20444 : see if this is a prot.h system
20449 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
20450 $cat <<'EOSH' > Cppsym.know
20451 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
20452 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
20453 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
20454 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
20455 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
20456 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
20457 bull c cadmus clipper CMU COFF COMPILER_VERSION
20458 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
20459 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
20460 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
20461 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
20463 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
20464 H3050R H3050RX hbullx20 hcx host_mips
20465 hp200 hp300 hp700 HP700 hp800 hp9000
20466 hp9000s200 hp9000s300 hp9000s400 hp9000s500
20467 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
20468 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
20469 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
20470 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
20471 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
20472 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
20473 Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
20474 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
20475 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
20476 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
20477 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
20478 MATH_HAS_NO_SIDE_EFFECTS
20479 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
20480 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
20481 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
20482 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
20483 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
20484 NetBSD news1500 news1700 news1800 news1900 news3700
20485 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
20486 ns32016 ns32332 ns32k nsc32000
20487 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
20488 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
20489 pc532 pdp11 PGC PIC plexus PORTAR posix
20490 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
20491 POSIX_C_SOURCE POSIX_SOURCE POWER
20492 PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
20493 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
20494 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
20495 sony sony_news sonyrisc sparc sparclite spectrum
20496 stardent stdc STDC_EXT stratos sun sun3 sun386
20497 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
20498 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
20499 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
20500 sysV68 sysV88 Tek4132 Tek4300 titan
20501 TM3200 TM5400 TM5600
20502 tower tower32 tower32_200 tower32_600 tower32_700
20503 tower32_800 tower32_850 tss
20504 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
20505 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
20506 unix UNIX95 UNIX99 unixpc unos
20507 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
20508 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
20509 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
20511 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
20512 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
20513 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
20516 # Maybe put other stuff here too.
20517 cat <<EOSH >>Cppsym.know
20520 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
20521 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
20522 $cat Cppsym.know > Cppsym.c
20523 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
20524 $rm -f Cppsym.a Cppsym.b Cppsym.c
20525 cat <<EOSH > Cppsym
20527 if $test \$# -gt 0; then
20528 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
20529 if $test -s Cppsym.got; then
20536 $tr " " "$trnl" | ./Cppsym.try
20542 cat <<EOSH > Cppsym.try
20544 cat <<'EOCP' > try.c
20547 #define STRINGIFY(a) "a"
20549 #if cpp_stuff == 42
20550 #define StGiFy(a) #a
20551 #define STRINGIFY(a) StGiFy(a)
20553 #if $cpp_stuff != 1 && $cpp_stuff != 42
20554 # include "Bletch: How does this C preprocessor stringify macros?"
20560 cat <<'EOSH' >> Cppsym.try
20562 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
20563 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
20564 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
20565 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
20567 echo 'return 0;}' >> try.c
20569 cat <<EOSH >> Cppsym.try
20571 case "$osname-$gccversion" in
20572 irix-) ccflags="\$ccflags -woff 1178" ;;
20573 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
20575 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
20577 chmod +x Cppsym.try
20578 $eunicefix Cppsym.try
20579 ./Cppsym < Cppsym.know > Cppsym.true
20580 : Add in any linux cpp "predefined macros":
20581 case "$osname::$gccversion" in
20584 rm -f $tHdrH'.h' $tHdrH
20586 if cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
20587 sed 's/#define[\ \ ]*//;s/[\ \ ].*$//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
20588 if [ -s $tHdrH'_cppsym.real' ]; then
20589 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
20592 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
20595 : now check the C compiler for additional symbols
20596 postprocess_cc_v=''
20598 aix) postprocess_cc_v="|$tr , ' '" ;;
20605 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
20608 -D*) echo "\$i" | $sed 's/^-D//';;
20609 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
20614 postprocess_cc_v=''
20617 ./ccsym > ccsym1.raw
20618 if $test -s ccsym1.raw; then
20619 $sort ccsym1.raw | $uniq >ccsym.raw
20621 mv ccsym1.raw ccsym.raw
20624 $awk '/\=/ { print $0; next }
20625 { print $0"=1" }' ccsym.raw >ccsym.list
20626 $comm -13 Cppsym.true ccsym.list >ccsym.own
20627 $comm -12 Cppsym.true ccsym.list >ccsym.com
20628 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
20630 if $test -z ccsym.raw; then
20631 echo "Your C compiler doesn't seem to define any symbols!" >&4
20633 echo "However, your C preprocessor defines the following symbols:"
20636 cppsymbols=`$cat Cppsym.true`
20637 cppsymbols=`echo $cppsymbols`
20638 cppccsymbols="$cppsymbols"
20640 if $test -s ccsym.com; then
20641 echo "Your C compiler and pre-processor define these symbols:"
20642 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
20645 cppccsymbols=`$cat ccsym.com`
20646 cppccsymbols=`echo $cppccsymbols`
20647 $test "$silent" || sleep 1
20649 if $test -s ccsym.cpp; then
20650 $test "$also" && echo " "
20651 echo "Your C pre-processor ${also}defines the following symbols:"
20652 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
20654 cppsymbols=`$cat ccsym.cpp`
20655 cppsymbols=`echo $cppsymbols`
20656 $test "$silent" || sleep 1
20658 if $test -s ccsym.own; then
20659 $test "$also" && echo " "
20660 echo "Your C compiler ${also}defines the following cpp symbols:"
20661 $sed -e 's/\(..*\)=1/\1/' ccsym.own
20662 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
20663 ccsymbols=`$cat ccsym.own`
20664 ccsymbols=`echo $ccsymbols`
20665 $test "$silent" || sleep 1
20669 : see if this is a termio system
20673 if $test `./findhdr termios.h`; then
20674 set tcsetattr i_termios
20680 "$define") echo "You have POSIX termios.h... good!" >&4;;
20681 *) if ./Cppsym pyr; then
20682 case "`/bin/universe`" in
20683 ucb) if $test `./findhdr sgtty.h`; then
20685 echo "<sgtty.h> found." >&4
20687 echo "System is pyramid with BSD universe."
20688 echo "<sgtty.h> not found--you could have problems." >&4
20690 *) if $test `./findhdr termio.h`; then
20692 echo "<termio.h> found." >&4
20694 echo "System is pyramid with USG universe."
20695 echo "<termio.h> not found--you could have problems." >&4
20699 if $test `./findhdr termio.h`; then
20700 echo "<termio.h> found." >&4
20702 elif $test `./findhdr sgtty.h`; then
20703 echo "<sgtty.h> found." >&4
20706 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
20709 if $test `./findhdr sgtty.h`; then
20710 echo "<sgtty.h> found." >&4
20712 elif $test `./findhdr termio.h`; then
20713 echo "<termio.h> found." >&4
20716 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
20720 set i_termio; eval $setvar
20721 val=$val2; set i_sgtty; eval $setvar
20722 val=$val3; set i_termios; eval $setvar
20724 : see if stddef is available
20725 set stddef.h i_stddef
20728 : see if this is a sunmath.h system
20729 set sunmath.h i_sunmath
20732 : see if sys/access.h is available
20733 set sys/access.h i_sysaccess
20736 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
20737 set sys/filio.h i_sysfilio
20740 if $test `./findhdr sys/ioctl.h`; then
20742 echo '<sys/ioctl.h> found.' >&4
20745 if $test $i_sysfilio = "$define"; then
20746 echo '<sys/ioctl.h> NOT found.' >&4
20748 $test $i_sgtty = "$define" && xxx="sgtty.h"
20749 $test $i_termio = "$define" && xxx="termio.h"
20750 $test $i_termios = "$define" && xxx="termios.h"
20751 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
20757 : see if socket ioctl defs are in sys/sockio.h
20759 xxx=`./findhdr sys/sockio.h`
20760 if $test "$xxx"; then
20761 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
20763 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
20766 echo "No socket ioctls found in <sys/sockio.h>." >&4
20771 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
20778 : see if this is a syslog.h system
20779 set syslog.h i_syslog
20783 : see if this is a sys/mode.h system
20784 set sys/mode.h i_sysmode
20787 : see if sys/resource.h has to be included
20788 set sys/resource.h i_sysresrc
20791 : see if sys/security.h is available
20792 set sys/security.h i_syssecrt
20795 : see if this is a sys/statvfs.h system
20796 set sys/statvfs.h i_sysstatvfs
20799 : see if this is a sys/un.h system
20800 set sys/un.h i_sysun
20804 : see if this is a sys/utsname.h system
20805 set sys/utsname.h i_sysutsname
20808 : see if this is a syswait system
20809 set sys/wait.h i_syswait
20812 : see if this is a ustat.h system
20813 set ustat.h i_ustat
20816 : see if this is an utime system
20817 set utime.h i_utime
20820 : see if this is a values.h system
20821 set values.h i_values
20824 : see if this is a vfork system
20827 set vfork.h i_vfork
20836 echo "Looking for extensions..." >&4
20837 : If we are using the old config.sh, known_extensions may contain
20838 : old or inaccurate or duplicate values.
20839 known_extensions=''
20840 nonxs_extensions=''
20841 : We do not use find because it might not be available.
20842 : We do not just use MANIFEST because the user may have dropped
20843 : some additional extensions into the source tree and expect them
20846 : Function to recursively find available extensions, ignoring DynaLoader
20847 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
20851 DynaLoader|dynaload) ;;
20853 if $test -f $xxx/$xxx.xs; then
20854 known_extensions="$known_extensions $1$xxx";
20855 elif $test -f $xxx/Makefile.PL; then
20856 nonxs_extensions="$nonxs_extensions $1$xxx";
20858 if $test -d $xxx -a $# -lt 10; then
20861 eval $find_extensions;
20873 eval $find_extensions
20874 # Special case: Add in threads/shared since it is not picked up by the
20875 # recursive find above (and adding in general recursive finding breaks
20876 # SDBM_File/sdbm). A.D. 10/25/2001.
20877 known_extensions="$known_extensions threads/shared"
20878 set X $nonxs_extensions
20880 nonxs_extensions="$*"
20881 set X $known_extensions
20883 known_extensions="$*"
20886 : Now see which are supported on this system.
20888 for xxx in $known_extensions ; do
20892 $define) avail_ext="$avail_ext $xxx" ;;
20895 GDBM_File|gdbm_fil)
20897 $define) avail_ext="$avail_ext $xxx" ;;
20900 I18N/Langinfo|i18n_lan)
20901 case "$i_langinfo$d_nl_langinfo" in
20902 $define$define) avail_ext="$avail_ext $xxx" ;;
20905 NDBM_File|ndbm_fil)
20908 case "$osname-$use64bitint" in
20911 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
20914 *) avail_ext="$avail_ext $xxx" ;;
20919 ODBM_File|odbm_fil)
20920 case "${i_dbm}${i_rpcsvcdbm}" in
20922 case "$osname-$use64bitint" in
20925 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
20928 *) avail_ext="$avail_ext $xxx" ;;
20934 case "$useposix" in
20935 true|define|y) avail_ext="$avail_ext $xxx" ;;
20939 case "$useopcode" in
20940 true|define|y) avail_ext="$avail_ext $xxx" ;;
20944 case "$d_socket" in
20947 beos) ;; # not unless BONE
20948 *) avail_ext="$avail_ext $xxx" ;;
20953 Sys/Syslog|sys/syslog)
20954 : XXX syslog requires socket
20955 case "$d_socket" in
20956 true|$define|y) avail_ext="$avail_ext $xxx" ;;
20960 case "$usethreads" in
20962 case "$useithreads" in
20963 $undef|false|[nN]*) avail_ext="$avail_ext $xxx" ;;
20967 XS/APItest|xs/apitest)
20968 # This is just for testing. Skip it unless we have dynamic loading.
20971 $define) avail_ext="$avail_ext $xxx" ;;
20974 XS/Typemap|xs/typemap)
20975 # This is just for testing. Skip it unless we have dynamic loading.
20977 $define) avail_ext="$avail_ext $xxx" ;;
20980 threads|threads/shared)
20981 # threads and threads::shared are special cases.
20982 # To stop people from asking "Perl 5.8.0 was supposed
20983 # to have this new fancy threads implementation but my
20984 # perl doesn't have it" and from people trying to
20985 # (re)install the threads module using CPAN.pm and
20986 # CPAN.pm then offering to reinstall Perl 5.8.0,
20987 # the threads.pm and threads/shared.pm will always be
20988 # there, croaking informatively ("you need to rebuild
20989 # all of Perl with threads, sorry") when threads haven't
20990 # been compiled in.
20992 avail_ext="$avail_ext $xxx"
20995 : XXX Do we need a useipcsysv variable here
20996 case "${d_msg}${d_sem}${d_shm}" in
20997 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
21000 *) avail_ext="$avail_ext $xxx"
21009 case "$onlyextensions" in
21011 *) keepextensions=''
21012 echo "You have requested that only certains extensions be included..." >&4
21013 for i in $onlyextensions; do
21014 case " $avail_ext " in
21016 echo "Keeping extension $i."
21017 keepextensions="$keepextensions $i"
21019 *) echo "Ignoring extension $i." ;;
21022 avail_ext="$keepextensions"
21026 case "$noextensions" in
21028 *) keepextensions=''
21029 echo "You have requested that certain extensions be ignored..." >&4
21030 for i in $avail_ext; do
21031 case " $noextensions " in
21032 *" $i "*) echo "Ignoring extension $i." ;;
21033 *) echo "Keeping extension $i.";
21034 keepextensions="$keepextensions $i"
21038 avail_ext="$keepextensions"
21042 : Now see which nonxs extensions are supported on this system.
21043 : For now assume all are.
21045 for xxx in $nonxs_extensions ; do
21047 *) nonxs_ext="$nonxs_ext $xxx"
21059 A number of extensions are supplied with $package. You may choose to
21060 compile these extensions for dynamic loading (the default), compile
21061 them into the $package executable (static loading), or not include
21062 them at all. Answer "none" to include no extensions.
21063 Note that DynaLoader is always built and need not be mentioned here.
21066 case "$dynamic_ext" in
21068 : Exclude those listed in static_ext
21070 for xxx in $avail_ext; do
21071 case " $static_ext " in
21073 *) dflt="$dflt $xxx" ;;
21080 *) dflt="$dynamic_ext"
21081 # Perhaps we are reusing an old out-of-date config.sh.
21084 if test X"$dynamic_ext" != X"$avail_ext"; then
21086 NOTICE: Your previous config.sh list may be incorrect.
21087 The extensions now available to you are
21089 but the default list from your previous config.sh is
21101 rp="What extensions do you wish to load dynamically?"
21104 none) dynamic_ext=' ' ;;
21105 *) dynamic_ext="$ans" ;;
21108 case "$static_ext" in
21110 : Exclude those already listed in dynamic linking
21112 for xxx in $avail_ext; do
21113 case " $dynamic_ext " in
21115 *) dflt="$dflt $xxx" ;;
21122 *) dflt="$static_ext"
21129 rp="What extensions do you wish to load statically?"
21132 none) static_ext=' ' ;;
21133 *) static_ext="$ans" ;;
21138 A number of extensions are supplied with $package. Answer "none"
21139 to include no extensions.
21140 Note that DynaLoader is always built and need not be mentioned here.
21143 case "$static_ext" in
21144 '') dflt="$avail_ext" ;;
21145 *) dflt="$static_ext"
21146 # Perhaps we are reusing an old out-of-date config.sh.
21149 if test X"$static_ext" != X"$avail_ext"; then
21151 NOTICE: Your previous config.sh list may be incorrect.
21152 The extensions now available to you are
21154 but the default list from your previous config.sh is
21163 : Exclude those that are not xs extensions
21167 rp="What extensions do you wish to include?"
21170 none) static_ext=' ' ;;
21171 *) static_ext="$ans" ;;
21176 # Encode is a special case. If we are building Encode as a static
21177 # extension, we need to explicitly list its subextensions as well.
21178 # For other nested extensions, this is handled automatically by
21179 # the appropriate Makefile.PL.
21180 case " $static_ext " in
21181 *" Encode "*) # Add the subextensions of Encode
21183 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
21184 static_ext="$static_ext Encode/$xxx"
21190 set X $dynamic_ext $static_ext $nonxs_ext
21194 # Sanity check: We require an extension suitable for use with
21195 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
21196 # should show up as failures in the test suite, but it's helpful to
21197 # catch them now.) The 'extensions' list is normally sorted
21198 # alphabetically, so we need to accept either
21199 # DB_File ... Fcntl ... IO ....
21200 # or something like
21201 # Fcntl ... NDBM_File ... IO ....
21202 case " $extensions" in
21203 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
21204 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
21205 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
21206 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
21207 echo "WARNING: The Perl you are building will be quite crippled." >& 4
21211 : Remove libraries needed only for extensions
21212 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
21213 : The exception is SunOS 4.x, which needs them.
21214 case "${osname}X${osvers}" in
21218 *) case "$usedl" in
21219 $define|true|[yY]*)
21220 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
21224 *) perllibs="$libs"
21230 : Remove build directory name from cppstdin so it can be used from
21231 : either the present location or the final installed location.
21233 : Get out of the UU directory to get correct path name.
21235 case "$cppstdin" in
21237 echo "Stripping down cppstdin path name"
21243 : end of configuration questions
21245 echo "End of configuration questions."
21248 : back to where it started
21249 if test -d ../UU; then
21253 : configuration may be patched via a 'config.arch' file
21254 if $test -f config.arch; then
21255 echo "I see a config.arch file, loading it."
21259 : configuration may be patched via a 'config.over' file
21260 if $test -f config.over; then
21263 rp='I see a config.over file. Do you wish to load it?'
21266 n*) echo "OK, I'll ignore it.";;
21268 echo "Configuration override changes have been loaded."
21273 : in case they want portability, strip down executable paths
21274 case "$d_portable" in
21277 echo "Stripping down executable paths..." >&4
21278 for file in $loclist $trylist; do
21280 eval $file=`basename $temp`
21285 : create config.sh file
21287 echo "Creating config.sh..." >&4
21288 $spitshell <<EOT >config.sh
21291 # This file was produced by running the Configure script. It holds all the
21292 # definitions figured out by Configure. Should you modify one of these values,
21293 # do not forget to propagate your changes by running "Configure -der". You may
21294 # instead choose to run each of the .SH files by yourself, or "Configure -S".
21297 # Package name : $package
21298 # Source directory : $src
21299 # Configuration time: $cf_time
21300 # Configured by : $cf_by
21301 # Target system : $myuname
21311 Revision='$Revision'
21319 alignbytes='$alignbytes'
21320 ansi2knr='$ansi2knr'
21321 aphostname='$aphostname'
21322 api_revision='$api_revision'
21323 api_subversion='$api_subversion'
21324 api_version='$api_version'
21325 api_versionstring='$api_versionstring'
21328 archlibexp='$archlibexp'
21329 archname64='$archname64'
21330 archname='$archname'
21331 archobjs='$archobjs'
21332 asctime_r_proto='$asctime_r_proto'
21340 byteorder='$byteorder'
21342 castflags='$castflags'
21345 cccdlflags='$cccdlflags'
21346 ccdlflags='$ccdlflags'
21348 ccflags_uselargefiles='$ccflags_uselargefiles'
21350 ccsymbols='$ccsymbols'
21351 ccversion='$ccversion'
21353 cf_email='$cf_email'
21355 charsize='$charsize'
21359 clocktype='$clocktype'
21361 compress='$compress'
21362 contains='$contains'
21366 cpp_stuff='$cpp_stuff'
21367 cppccsymbols='$cppccsymbols'
21368 cppflags='$cppflags'
21370 cppminus='$cppminus'
21372 cppstdin='$cppstdin'
21373 cppsymbols='$cppsymbols'
21374 crypt_r_proto='$crypt_r_proto'
21375 cryptlib='$cryptlib'
21377 ctermid_r_proto='$ctermid_r_proto'
21378 ctime_r_proto='$ctime_r_proto'
21379 d_Gconvert='$d_Gconvert'
21380 d_PRIEUldbl='$d_PRIEUldbl'
21381 d_PRIFUldbl='$d_PRIFUldbl'
21382 d_PRIGUldbl='$d_PRIGUldbl'
21383 d_PRIXU64='$d_PRIXU64'
21384 d_PRId64='$d_PRId64'
21385 d_PRIeldbl='$d_PRIeldbl'
21386 d_PRIfldbl='$d_PRIfldbl'
21387 d_PRIgldbl='$d_PRIgldbl'
21388 d_PRIi64='$d_PRIi64'
21389 d_PRIo64='$d_PRIo64'
21390 d_PRIu64='$d_PRIu64'
21391 d_PRIx64='$d_PRIx64'
21392 d_SCNfldbl='$d_SCNfldbl'
21393 d__fwalk='$d__fwalk'
21394 d_access='$d_access'
21395 d_accessx='$d_accessx'
21398 d_archlib='$d_archlib'
21399 d_asctime_r='$d_asctime_r'
21402 d_attribute_format='$d_attribute_format'
21403 d_attribute_malloc='$d_attribute_malloc'
21404 d_attribute_nonnull='$d_attribute_nonnull'
21405 d_attribute_noreturn='$d_attribute_noreturn'
21406 d_attribute_pure='$d_attribute_pure'
21407 d_attribute_unused='$d_attribute_unused'
21408 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
21412 d_bsdgetpgrp='$d_bsdgetpgrp'
21413 d_bsdsetpgrp='$d_bsdsetpgrp'
21414 d_builtin_choose_expr='$d_builtin_choose_expr'
21415 d_builtin_expect='$d_builtin_expect'
21417 d_c99_variadic_macros='$d_c99_variadic_macros'
21418 d_casti32='$d_casti32'
21419 d_castneg='$d_castneg'
21420 d_charvspr='$d_charvspr'
21422 d_chroot='$d_chroot'
21423 d_chsize='$d_chsize'
21425 d_clearenv='$d_clearenv'
21426 d_closedir='$d_closedir'
21427 d_cmsghdr_s='$d_cmsghdr_s'
21429 d_copysignl='$d_copysignl'
21430 d_cplusplus='$d_cplusplus'
21432 d_crypt_r='$d_crypt_r'
21434 d_ctermid='$d_ctermid'
21435 d_ctermid_r='$d_ctermid_r'
21436 d_ctime_r='$d_ctime_r'
21437 d_cuserid='$d_cuserid'
21438 d_dbl_dig='$d_dbl_dig'
21439 d_dbminitproto='$d_dbminitproto'
21440 d_difftime='$d_difftime'
21442 d_dirnamlen='$d_dirnamlen'
21443 d_dlerror='$d_dlerror'
21444 d_dlopen='$d_dlopen'
21445 d_dlsymun='$d_dlsymun'
21446 d_dosuid='$d_dosuid'
21447 d_drand48_r='$d_drand48_r'
21448 d_drand48proto='$d_drand48proto'
21450 d_eaccess='$d_eaccess'
21451 d_endgrent='$d_endgrent'
21452 d_endgrent_r='$d_endgrent_r'
21453 d_endhent='$d_endhent'
21454 d_endhostent_r='$d_endhostent_r'
21455 d_endnent='$d_endnent'
21456 d_endnetent_r='$d_endnetent_r'
21457 d_endpent='$d_endpent'
21458 d_endprotoent_r='$d_endprotoent_r'
21459 d_endpwent='$d_endpwent'
21460 d_endpwent_r='$d_endpwent_r'
21461 d_endsent='$d_endsent'
21462 d_endservent_r='$d_endservent_r'
21463 d_eofnblk='$d_eofnblk'
21464 d_eunice='$d_eunice'
21465 d_faststdio='$d_faststdio'
21466 d_fchdir='$d_fchdir'
21467 d_fchmod='$d_fchmod'
21468 d_fchown='$d_fchown'
21470 d_fcntl_can_lock='$d_fcntl_can_lock'
21471 d_fd_macros='$d_fd_macros'
21472 d_fd_set='$d_fd_set'
21473 d_fds_bits='$d_fds_bits'
21474 d_fgetpos='$d_fgetpos'
21475 d_finite='$d_finite'
21476 d_finitel='$d_finitel'
21477 d_flexfnam='$d_flexfnam'
21479 d_flockproto='$d_flockproto'
21481 d_fp_class='$d_fp_class'
21482 d_fpathconf='$d_fpathconf'
21483 d_fpclass='$d_fpclass'
21484 d_fpclassify='$d_fpclassify'
21485 d_fpclassl='$d_fpclassl'
21486 d_fpos64_t='$d_fpos64_t'
21487 d_frexpl='$d_frexpl'
21488 d_fs_data_s='$d_fs_data_s'
21489 d_fseeko='$d_fseeko'
21490 d_fsetpos='$d_fsetpos'
21491 d_fstatfs='$d_fstatfs'
21492 d_fstatvfs='$d_fstatvfs'
21494 d_ftello='$d_ftello'
21496 d_futimes='$d_futimes'
21497 d_getcwd='$d_getcwd'
21498 d_getespwnam='$d_getespwnam'
21499 d_getfsstat='$d_getfsstat'
21500 d_getgrent='$d_getgrent'
21501 d_getgrent_r='$d_getgrent_r'
21502 d_getgrgid_r='$d_getgrgid_r'
21503 d_getgrnam_r='$d_getgrnam_r'
21504 d_getgrps='$d_getgrps'
21505 d_gethbyaddr='$d_gethbyaddr'
21506 d_gethbyname='$d_gethbyname'
21507 d_gethent='$d_gethent'
21508 d_gethname='$d_gethname'
21509 d_gethostbyaddr_r='$d_gethostbyaddr_r'
21510 d_gethostbyname_r='$d_gethostbyname_r'
21511 d_gethostent_r='$d_gethostent_r'
21512 d_gethostprotos='$d_gethostprotos'
21513 d_getitimer='$d_getitimer'
21514 d_getlogin='$d_getlogin'
21515 d_getlogin_r='$d_getlogin_r'
21516 d_getmnt='$d_getmnt'
21517 d_getmntent='$d_getmntent'
21518 d_getnbyaddr='$d_getnbyaddr'
21519 d_getnbyname='$d_getnbyname'
21520 d_getnent='$d_getnent'
21521 d_getnetbyaddr_r='$d_getnetbyaddr_r'
21522 d_getnetbyname_r='$d_getnetbyname_r'
21523 d_getnetent_r='$d_getnetent_r'
21524 d_getnetprotos='$d_getnetprotos'
21525 d_getpagsz='$d_getpagsz'
21526 d_getpbyname='$d_getpbyname'
21527 d_getpbynumber='$d_getpbynumber'
21528 d_getpent='$d_getpent'
21529 d_getpgid='$d_getpgid'
21530 d_getpgrp2='$d_getpgrp2'
21531 d_getpgrp='$d_getpgrp'
21532 d_getppid='$d_getppid'
21533 d_getprior='$d_getprior'
21534 d_getprotobyname_r='$d_getprotobyname_r'
21535 d_getprotobynumber_r='$d_getprotobynumber_r'
21536 d_getprotoent_r='$d_getprotoent_r'
21537 d_getprotoprotos='$d_getprotoprotos'
21538 d_getprpwnam='$d_getprpwnam'
21539 d_getpwent='$d_getpwent'
21540 d_getpwent_r='$d_getpwent_r'
21541 d_getpwnam_r='$d_getpwnam_r'
21542 d_getpwuid_r='$d_getpwuid_r'
21543 d_getsbyname='$d_getsbyname'
21544 d_getsbyport='$d_getsbyport'
21545 d_getsent='$d_getsent'
21546 d_getservbyname_r='$d_getservbyname_r'
21547 d_getservbyport_r='$d_getservbyport_r'
21548 d_getservent_r='$d_getservent_r'
21549 d_getservprotos='$d_getservprotos'
21550 d_getspnam='$d_getspnam'
21551 d_getspnam_r='$d_getspnam_r'
21552 d_gettimeod='$d_gettimeod'
21553 d_gmtime_r='$d_gmtime_r'
21554 d_gnulibc='$d_gnulibc'
21555 d_grpasswd='$d_grpasswd'
21556 d_hasmntopt='$d_hasmntopt'
21558 d_ilogbl='$d_ilogbl'
21559 d_inc_version_list='$d_inc_version_list'
21561 d_inetaton='$d_inetaton'
21562 d_int64_t='$d_int64_t'
21563 d_isascii='$d_isascii'
21564 d_isfinite='$d_isfinite'
21567 d_isnanl='$d_isnanl'
21568 d_killpg='$d_killpg'
21569 d_lchown='$d_lchown'
21570 d_ldbl_dig='$d_ldbl_dig'
21571 d_libm_lib_version='$d_libm_lib_version'
21573 d_localtime_r='$d_localtime_r'
21574 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
21575 d_locconv='$d_locconv'
21577 d_longdbl='$d_longdbl'
21578 d_longlong='$d_longlong'
21579 d_lseekproto='$d_lseekproto'
21581 d_madvise='$d_madvise'
21582 d_malloc_good_size='$d_malloc_good_size'
21583 d_malloc_size='$d_malloc_size'
21585 d_mbstowcs='$d_mbstowcs'
21586 d_mbtowc='$d_mbtowc'
21587 d_memchr='$d_memchr'
21588 d_memcmp='$d_memcmp'
21589 d_memcpy='$d_memcpy'
21590 d_memmove='$d_memmove'
21591 d_memset='$d_memset'
21593 d_mkdtemp='$d_mkdtemp'
21594 d_mkfifo='$d_mkfifo'
21595 d_mkstemp='$d_mkstemp'
21596 d_mkstemps='$d_mkstemps'
21597 d_mktime='$d_mktime'
21600 d_modfl_pow32_bug='$d_modfl_pow32_bug'
21601 d_modflproto='$d_modflproto'
21602 d_mprotect='$d_mprotect'
21604 d_msg_ctrunc='$d_msg_ctrunc'
21605 d_msg_dontroute='$d_msg_dontroute'
21606 d_msg_oob='$d_msg_oob'
21607 d_msg_peek='$d_msg_peek'
21608 d_msg_proxy='$d_msg_proxy'
21609 d_msgctl='$d_msgctl'
21610 d_msgget='$d_msgget'
21611 d_msghdr_s='$d_msghdr_s'
21612 d_msgrcv='$d_msgrcv'
21613 d_msgsnd='$d_msgsnd'
21615 d_munmap='$d_munmap'
21616 d_mymalloc='$d_mymalloc'
21618 d_nl_langinfo='$d_nl_langinfo'
21619 d_nv_preserves_uv='$d_nv_preserves_uv'
21620 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
21621 d_off64_t='$d_off64_t'
21622 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
21623 d_oldpthreads='$d_oldpthreads'
21624 d_oldsock='$d_oldsock'
21626 d_pathconf='$d_pathconf'
21628 d_perl_otherlibdirs='$d_perl_otherlibdirs'
21629 d_phostname='$d_phostname'
21632 d_portable='$d_portable'
21633 d_procselfexe='$d_procselfexe'
21634 d_pthread_atfork='$d_pthread_atfork'
21635 d_pthread_attr_setscope='$d_pthread_attr_setscope'
21636 d_pthread_yield='$d_pthread_yield'
21638 d_pwchange='$d_pwchange'
21639 d_pwclass='$d_pwclass'
21640 d_pwcomment='$d_pwcomment'
21641 d_pwexpire='$d_pwexpire'
21642 d_pwgecos='$d_pwgecos'
21643 d_pwpasswd='$d_pwpasswd'
21644 d_pwquota='$d_pwquota'
21647 d_random_r='$d_random_r'
21648 d_readdir64_r='$d_readdir64_r'
21649 d_readdir='$d_readdir'
21650 d_readdir_r='$d_readdir_r'
21651 d_readlink='$d_readlink'
21653 d_recvmsg='$d_recvmsg'
21654 d_rename='$d_rename'
21655 d_rewinddir='$d_rewinddir'
21657 d_safebcpy='$d_safebcpy'
21658 d_safemcpy='$d_safemcpy'
21659 d_sanemcmp='$d_sanemcmp'
21660 d_sbrkproto='$d_sbrkproto'
21661 d_scalbnl='$d_scalbnl'
21662 d_sched_yield='$d_sched_yield'
21663 d_scm_rights='$d_scm_rights'
21664 d_seekdir='$d_seekdir'
21665 d_select='$d_select'
21667 d_semctl='$d_semctl'
21668 d_semctl_semid_ds='$d_semctl_semid_ds'
21669 d_semctl_semun='$d_semctl_semun'
21670 d_semget='$d_semget'
21672 d_sendmsg='$d_sendmsg'
21673 d_setegid='$d_setegid'
21674 d_seteuid='$d_seteuid'
21675 d_setgrent='$d_setgrent'
21676 d_setgrent_r='$d_setgrent_r'
21677 d_setgrps='$d_setgrps'
21678 d_sethent='$d_sethent'
21679 d_sethostent_r='$d_sethostent_r'
21680 d_setitimer='$d_setitimer'
21681 d_setlinebuf='$d_setlinebuf'
21682 d_setlocale='$d_setlocale'
21683 d_setlocale_r='$d_setlocale_r'
21684 d_setnent='$d_setnent'
21685 d_setnetent_r='$d_setnetent_r'
21686 d_setpent='$d_setpent'
21687 d_setpgid='$d_setpgid'
21688 d_setpgrp2='$d_setpgrp2'
21689 d_setpgrp='$d_setpgrp'
21690 d_setprior='$d_setprior'
21691 d_setproctitle='$d_setproctitle'
21692 d_setprotoent_r='$d_setprotoent_r'
21693 d_setpwent='$d_setpwent'
21694 d_setpwent_r='$d_setpwent_r'
21695 d_setregid='$d_setregid'
21696 d_setresgid='$d_setresgid'
21697 d_setresuid='$d_setresuid'
21698 d_setreuid='$d_setreuid'
21699 d_setrgid='$d_setrgid'
21700 d_setruid='$d_setruid'
21701 d_setsent='$d_setsent'
21702 d_setservent_r='$d_setservent_r'
21703 d_setsid='$d_setsid'
21704 d_setvbuf='$d_setvbuf'
21708 d_shmatprototype='$d_shmatprototype'
21709 d_shmctl='$d_shmctl'
21711 d_shmget='$d_shmget'
21712 d_sigaction='$d_sigaction'
21713 d_sigprocmask='$d_sigprocmask'
21714 d_sigsetjmp='$d_sigsetjmp'
21715 d_sitearch='$d_sitearch'
21716 d_snprintf='$d_snprintf'
21717 d_sockatmark='$d_sockatmark'
21718 d_sockatmarkproto='$d_sockatmarkproto'
21719 d_socket='$d_socket'
21720 d_socklen_t='$d_socklen_t'
21721 d_sockpair='$d_sockpair'
21722 d_socks5_init='$d_socks5_init'
21723 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
21725 d_srand48_r='$d_srand48_r'
21726 d_srandom_r='$d_srandom_r'
21727 d_sresgproto='$d_sresgproto'
21728 d_sresuproto='$d_sresuproto'
21729 d_statblks='$d_statblks'
21730 d_statfs_f_flags='$d_statfs_f_flags'
21731 d_statfs_s='$d_statfs_s'
21732 d_statvfs='$d_statvfs'
21733 d_stdio_cnt_lval='$d_stdio_cnt_lval'
21734 d_stdio_ptr_lval='$d_stdio_ptr_lval'
21735 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
21736 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
21737 d_stdio_stream_array='$d_stdio_stream_array'
21738 d_stdiobase='$d_stdiobase'
21739 d_stdstdio='$d_stdstdio'
21740 d_strchr='$d_strchr'
21741 d_strcoll='$d_strcoll'
21742 d_strctcpy='$d_strctcpy'
21743 d_strerrm='$d_strerrm'
21744 d_strerror='$d_strerror'
21745 d_strerror_r='$d_strerror_r'
21746 d_strftime='$d_strftime'
21747 d_strlcat='$d_strlcat'
21748 d_strlcpy='$d_strlcpy'
21749 d_strtod='$d_strtod'
21750 d_strtol='$d_strtol'
21751 d_strtold='$d_strtold'
21752 d_strtoll='$d_strtoll'
21753 d_strtoq='$d_strtoq'
21754 d_strtoul='$d_strtoul'
21755 d_strtoull='$d_strtoull'
21756 d_strtouq='$d_strtouq'
21757 d_strxfrm='$d_strxfrm'
21758 d_suidsafe='$d_suidsafe'
21759 d_symlink='$d_symlink'
21760 d_syscall='$d_syscall'
21761 d_syscallproto='$d_syscallproto'
21762 d_sysconf='$d_sysconf'
21763 d_sysernlst='$d_sysernlst'
21764 d_syserrlst='$d_syserrlst'
21765 d_system='$d_system'
21766 d_tcgetpgrp='$d_tcgetpgrp'
21767 d_tcsetpgrp='$d_tcsetpgrp'
21768 d_telldir='$d_telldir'
21769 d_telldirproto='$d_telldirproto'
21772 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
21773 d_tm_tm_zone='$d_tm_tm_zone'
21774 d_tmpnam_r='$d_tmpnam_r'
21775 d_truncate='$d_truncate'
21776 d_ttyname_r='$d_ttyname_r'
21777 d_tzname='$d_tzname'
21778 d_u32align='$d_u32align'
21779 d_ualarm='$d_ualarm'
21782 d_union_semun='$d_union_semun'
21783 d_unordered='$d_unordered'
21784 d_unsetenv='$d_unsetenv'
21785 d_usleep='$d_usleep'
21786 d_usleepproto='$d_usleepproto'
21788 d_vendorarch='$d_vendorarch'
21789 d_vendorbin='$d_vendorbin'
21790 d_vendorlib='$d_vendorlib'
21791 d_vendorscript='$d_vendorscript'
21793 d_void_closedir='$d_void_closedir'
21794 d_voidsig='$d_voidsig'
21795 d_voidtty='$d_voidtty'
21796 d_volatile='$d_volatile'
21797 d_vprintf='$d_vprintf'
21798 d_vsnprintf='$d_vsnprintf'
21800 d_waitpid='$d_waitpid'
21801 d_wcstombs='$d_wcstombs'
21802 d_wctomb='$d_wctomb'
21803 d_writev='$d_writev'
21806 db_hashtype='$db_hashtype'
21807 db_prefixtype='$db_prefixtype'
21808 db_version_major='$db_version_major'
21809 db_version_minor='$db_version_minor'
21810 db_version_patch='$db_version_patch'
21811 defvoidused='$defvoidused'
21812 direntrytype='$direntrytype'
21815 doublesize='$doublesize'
21817 drand48_r_proto='$drand48_r_proto'
21818 dynamic_ext='$dynamic_ext'
21824 endgrent_r_proto='$endgrent_r_proto'
21825 endhostent_r_proto='$endhostent_r_proto'
21826 endnetent_r_proto='$endnetent_r_proto'
21827 endprotoent_r_proto='$endprotoent_r_proto'
21828 endpwent_r_proto='$endpwent_r_proto'
21829 endservent_r_proto='$endservent_r_proto'
21830 eunicefix='$eunicefix'
21833 extensions='$extensions'
21835 fflushNULL='$fflushNULL'
21836 fflushall='$fflushall'
21838 firstmakefile='$firstmakefile'
21840 fpossize='$fpossize'
21841 fpostype='$fpostype'
21842 freetype='$freetype'
21845 full_csh='$full_csh'
21846 full_sed='$full_sed'
21847 gccansipedantic='$gccansipedantic'
21848 gccosandvers='$gccosandvers'
21849 gccversion='$gccversion'
21850 getgrent_r_proto='$getgrent_r_proto'
21851 getgrgid_r_proto='$getgrgid_r_proto'
21852 getgrnam_r_proto='$getgrnam_r_proto'
21853 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
21854 gethostbyname_r_proto='$gethostbyname_r_proto'
21855 gethostent_r_proto='$gethostent_r_proto'
21856 getlogin_r_proto='$getlogin_r_proto'
21857 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
21858 getnetbyname_r_proto='$getnetbyname_r_proto'
21859 getnetent_r_proto='$getnetent_r_proto'
21860 getprotobyname_r_proto='$getprotobyname_r_proto'
21861 getprotobynumber_r_proto='$getprotobynumber_r_proto'
21862 getprotoent_r_proto='$getprotoent_r_proto'
21863 getpwent_r_proto='$getpwent_r_proto'
21864 getpwnam_r_proto='$getpwnam_r_proto'
21865 getpwuid_r_proto='$getpwuid_r_proto'
21866 getservbyname_r_proto='$getservbyname_r_proto'
21867 getservbyport_r_proto='$getservbyport_r_proto'
21868 getservent_r_proto='$getservent_r_proto'
21869 getspnam_r_proto='$getspnam_r_proto'
21870 gidformat='$gidformat'
21876 gmtime_r_proto='$gmtime_r_proto'
21877 gnulibc_version='$gnulibc_version'
21879 groupcat='$groupcat'
21880 groupstype='$groupstype'
21883 h_sysfile='$h_sysfile'
21886 html1dir='$html1dir'
21887 html1direxp='$html1direxp'
21888 html3dir='$html3dir'
21889 html3direxp='$html3direxp'
21898 i_arpainet='$i_arpainet'
21899 i_bsdioctl='$i_bsdioctl'
21903 i_dirent='$i_dirent'
21909 i_fp_class='$i_fp_class'
21912 i_ieeefp='$i_ieeefp'
21913 i_inttypes='$i_inttypes'
21914 i_langinfo='$i_langinfo'
21915 i_libutil='$i_libutil'
21916 i_limits='$i_limits'
21917 i_locale='$i_locale'
21918 i_machcthr='$i_machcthr'
21919 i_malloc='$i_malloc'
21921 i_memory='$i_memory'
21922 i_mntent='$i_mntent'
21925 i_neterrno='$i_neterrno'
21926 i_netinettcp='$i_netinettcp'
21930 i_pthread='$i_pthread'
21932 i_rpcsvcdbm='$i_rpcsvcdbm'
21935 i_shadow='$i_shadow'
21937 i_stdarg='$i_stdarg'
21938 i_stddef='$i_stddef'
21939 i_stdlib='$i_stdlib'
21940 i_string='$i_string'
21941 i_sunmath='$i_sunmath'
21942 i_sysaccess='$i_sysaccess'
21943 i_sysdir='$i_sysdir'
21944 i_sysfile='$i_sysfile'
21945 i_sysfilio='$i_sysfilio'
21947 i_sysioctl='$i_sysioctl'
21948 i_syslog='$i_syslog'
21949 i_sysmman='$i_sysmman'
21950 i_sysmode='$i_sysmode'
21951 i_sysmount='$i_sysmount'
21952 i_sysndir='$i_sysndir'
21953 i_sysparam='$i_sysparam'
21954 i_sysresrc='$i_sysresrc'
21955 i_syssecrt='$i_syssecrt'
21956 i_sysselct='$i_sysselct'
21957 i_syssockio='$i_syssockio'
21958 i_sysstat='$i_sysstat'
21959 i_sysstatfs='$i_sysstatfs'
21960 i_sysstatvfs='$i_sysstatvfs'
21961 i_systime='$i_systime'
21962 i_systimek='$i_systimek'
21963 i_systimes='$i_systimes'
21964 i_systypes='$i_systypes'
21965 i_sysuio='$i_sysuio'
21967 i_sysutsname='$i_sysutsname'
21968 i_sysvfs='$i_sysvfs'
21969 i_syswait='$i_syswait'
21970 i_termio='$i_termio'
21971 i_termios='$i_termios'
21973 i_unistd='$i_unistd'
21976 i_values='$i_values'
21977 i_varargs='$i_varargs'
21978 i_varhdr='$i_varhdr'
21980 ignore_versioned_solibs='$ignore_versioned_solibs'
21981 inc_version_list='$inc_version_list'
21982 inc_version_list_init='$inc_version_list_init'
21985 initialinstalllocation='$initialinstalllocation'
21986 installarchlib='$installarchlib'
21987 installbin='$installbin'
21988 installhtml1dir='$installhtml1dir'
21989 installhtml3dir='$installhtml3dir'
21990 installman1dir='$installman1dir'
21991 installman3dir='$installman3dir'
21992 installprefix='$installprefix'
21993 installprefixexp='$installprefixexp'
21994 installprivlib='$installprivlib'
21995 installscript='$installscript'
21996 installsitearch='$installsitearch'
21997 installsitebin='$installsitebin'
21998 installsitehtml1dir='$installsitehtml1dir'
21999 installsitehtml3dir='$installsitehtml3dir'
22000 installsitelib='$installsitelib'
22001 installsiteman1dir='$installsiteman1dir'
22002 installsiteman3dir='$installsiteman3dir'
22003 installsitescript='$installsitescript'
22004 installstyle='$installstyle'
22005 installusrbinperl='$installusrbinperl'
22006 installvendorarch='$installvendorarch'
22007 installvendorbin='$installvendorbin'
22008 installvendorhtml1dir='$installvendorhtml1dir'
22009 installvendorhtml3dir='$installvendorhtml3dir'
22010 installvendorlib='$installvendorlib'
22011 installvendorman1dir='$installvendorman1dir'
22012 installvendorman3dir='$installvendorman3dir'
22013 installvendorscript='$installvendorscript'
22015 issymlink='$issymlink'
22016 ivdformat='$ivdformat'
22019 known_extensions='$known_extensions'
22022 lddlflags='$lddlflags'
22024 ldflags_uselargefiles='$ldflags_uselargefiles'
22025 ldlibpthname='$ldlibpthname'
22032 libsdirs='$libsdirs'
22033 libsfiles='$libsfiles'
22034 libsfound='$libsfound'
22035 libspath='$libspath'
22036 libswanted='$libswanted'
22037 libswanted_uselargefiles='$libswanted_uselargefiles'
22043 localtime_r_proto='$localtime_r_proto'
22044 locincpth='$locincpth'
22045 loclibpth='$loclibpth'
22046 longdblsize='$longdblsize'
22047 longlongsize='$longlongsize'
22048 longsize='$longsize'
22052 lseeksize='$lseeksize'
22053 lseektype='$lseektype'
22056 madlyobj='$madlyobj'
22057 madlysrc='$madlysrc'
22061 make_set_make='$make_set_make'
22062 mallocobj='$mallocobj'
22063 mallocsrc='$mallocsrc'
22064 malloctype='$malloctype'
22066 man1direxp='$man1direxp'
22069 man3direxp='$man3direxp'
22071 mips_type='$mips_type'
22072 mistrustnm='$mistrustnm'
22074 mmaptype='$mmaptype'
22075 modetype='$modetype'
22077 multiarch='$multiarch'
22079 myarchname='$myarchname'
22080 mydomain='$mydomain'
22081 myhostname='$myhostname'
22084 need_va_copy='$need_va_copy'
22085 netdb_hlen_type='$netdb_hlen_type'
22086 netdb_host_type='$netdb_host_type'
22087 netdb_name_type='$netdb_name_type'
22088 netdb_net_type='$netdb_net_type'
22091 nm_so_opt='$nm_so_opt'
22092 nonxs_ext='$nonxs_ext'
22094 nvEUformat='$nvEUformat'
22095 nvFUformat='$nvFUformat'
22096 nvGUformat='$nvGUformat'
22097 nv_preserves_uv_bits='$nv_preserves_uv_bits'
22098 nveformat='$nveformat'
22099 nvfformat='$nvfformat'
22100 nvgformat='$nvgformat'
22103 o_nonblock='$o_nonblock'
22105 old_pthread_create_joinable='$old_pthread_create_joinable'
22106 optimize='$optimize'
22107 orderlib='$orderlib'
22110 otherlibdirs='$otherlibdirs'
22114 patchlevel='$patchlevel'
22115 path_sep='$path_sep'
22118 perl_patchlevel='$perl_patchlevel'
22119 perladmin='$perladmin'
22120 perllibs='$perllibs'
22121 perlpath='$perlpath'
22123 phostname='$phostname'
22129 prefixexp='$prefixexp'
22131 privlibexp='$privlibexp'
22132 procselfexe='$procselfexe'
22133 prototype='$prototype'
22135 quadkind='$quadkind'
22136 quadtype='$quadtype'
22137 randbits='$randbits'
22138 randfunc='$randfunc'
22139 random_r_proto='$random_r_proto'
22140 randseedtype='$randseedtype'
22142 rd_nodata='$rd_nodata'
22143 readdir64_r_proto='$readdir64_r_proto'
22144 readdir_r_proto='$readdir_r_proto'
22145 revision='$revision'
22150 sPRIEUldbl='$sPRIEUldbl'
22151 sPRIFUldbl='$sPRIFUldbl'
22152 sPRIGUldbl='$sPRIGUldbl'
22153 sPRIXU64='$sPRIXU64'
22155 sPRIeldbl='$sPRIeldbl'
22156 sPRIfldbl='$sPRIfldbl'
22157 sPRIgldbl='$sPRIgldbl'
22162 sSCNfldbl='$sSCNfldbl'
22163 sched_yield='$sched_yield'
22164 scriptdir='$scriptdir'
22165 scriptdirexp='$scriptdirexp'
22167 seedfunc='$seedfunc'
22168 selectminbits='$selectminbits'
22169 selecttype='$selecttype'
22170 sendmail='$sendmail'
22171 setgrent_r_proto='$setgrent_r_proto'
22172 sethostent_r_proto='$sethostent_r_proto'
22173 setlocale_r_proto='$setlocale_r_proto'
22174 setnetent_r_proto='$setnetent_r_proto'
22175 setprotoent_r_proto='$setprotoent_r_proto'
22176 setpwent_r_proto='$setpwent_r_proto'
22177 setservent_r_proto='$setservent_r_proto'
22180 sharpbang='$sharpbang'
22181 shmattype='$shmattype'
22182 shortsize='$shortsize'
22185 sig_count='$sig_count'
22186 sig_name='$sig_name'
22187 sig_name_init='$sig_name_init'
22189 sig_num_init='$sig_num_init'
22190 sig_size='$sig_size'
22191 signal_t='$signal_t'
22192 sitearch='$sitearch'
22193 sitearchexp='$sitearchexp'
22195 sitebinexp='$sitebinexp'
22196 sitehtml1dir='$sitehtml1dir'
22197 sitehtml1direxp='$sitehtml1direxp'
22198 sitehtml3dir='$sitehtml3dir'
22199 sitehtml3direxp='$sitehtml3direxp'
22201 sitelib_stem='$sitelib_stem'
22202 sitelibexp='$sitelibexp'
22203 siteman1dir='$siteman1dir'
22204 siteman1direxp='$siteman1direxp'
22205 siteman3dir='$siteman3dir'
22206 siteman3direxp='$siteman3direxp'
22207 siteprefix='$siteprefix'
22208 siteprefixexp='$siteprefixexp'
22209 sitescript='$sitescript'
22210 sitescriptexp='$sitescriptexp'
22211 sizesize='$sizesize'
22212 sizetype='$sizetype'
22216 sockethdr='$sockethdr'
22217 socketlib='$socketlib'
22218 socksizetype='$socksizetype'
22220 spackage='$spackage'
22221 spitshell='$spitshell'
22222 srand48_r_proto='$srand48_r_proto'
22223 srandom_r_proto='$srandom_r_proto'
22225 ssizetype='$ssizetype'
22226 startperl='$startperl'
22228 static_ext='$static_ext'
22230 stdio_base='$stdio_base'
22231 stdio_bufsiz='$stdio_bufsiz'
22232 stdio_cnt='$stdio_cnt'
22233 stdio_filbuf='$stdio_filbuf'
22234 stdio_ptr='$stdio_ptr'
22235 stdio_stream_array='$stdio_stream_array'
22236 strerror_r_proto='$strerror_r_proto'
22239 subversion='$subversion'
22243 targetarch='$targetarch'
22247 timeincl='$timeincl'
22248 timetype='$timetype'
22249 tmpnam_r_proto='$tmpnam_r_proto'
22255 ttyname_r_proto='$ttyname_r_proto'
22264 uidformat='$uidformat'
22270 uquadtype='$uquadtype'
22271 use5005threads='$use5005threads'
22272 use64bitall='$use64bitall'
22273 use64bitint='$use64bitint'
22274 usecrosscompile='$usecrosscompile'
22276 usefaststdio='$usefaststdio'
22277 useithreads='$useithreads'
22278 uselargefiles='$uselargefiles'
22279 uselongdouble='$uselongdouble'
22280 usemallocwrap='$usemallocwrap'
22281 usemorebits='$usemorebits'
22282 usemultiplicity='$usemultiplicity'
22283 usemymalloc='$usemymalloc'
22285 useopcode='$useopcode'
22286 useperlio='$useperlio'
22287 useposix='$useposix'
22288 usereentrant='$usereentrant'
22289 userelocatableinc='$userelocatableinc'
22291 useshrplib='$useshrplib'
22292 usesitecustomize='$usesitecustomize'
22293 usesocks='$usesocks'
22294 usethreads='$usethreads'
22295 usevendorprefix='$usevendorprefix'
22296 usevfork='$usevfork'
22299 uvXUformat='$uvXUformat'
22300 uvoformat='$uvoformat'
22303 uvuformat='$uvuformat'
22304 uvxformat='$uvxformat'
22305 vendorarch='$vendorarch'
22306 vendorarchexp='$vendorarchexp'
22307 vendorbin='$vendorbin'
22308 vendorbinexp='$vendorbinexp'
22309 vendorhtml1dir='$vendorhtml1dir'
22310 vendorhtml1direxp='$vendorhtml1direxp'
22311 vendorhtml3dir='$vendorhtml3dir'
22312 vendorhtml3direxp='$vendorhtml3direxp'
22313 vendorlib='$vendorlib'
22314 vendorlib_stem='$vendorlib_stem'
22315 vendorlibexp='$vendorlibexp'
22316 vendorman1dir='$vendorman1dir'
22317 vendorman1direxp='$vendorman1direxp'
22318 vendorman3dir='$vendorman3dir'
22319 vendorman3direxp='$vendorman3direxp'
22320 vendorprefix='$vendorprefix'
22321 vendorprefixexp='$vendorprefixexp'
22322 vendorscript='$vendorscript'
22323 vendorscriptexp='$vendorscriptexp'
22325 version_patchlevel_string='$version_patchlevel_string'
22326 versiononly='$versiononly'
22328 voidflags='$voidflags'
22331 yaccflags='$yaccflags'
22336 : Add in command line options if available
22337 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22339 : add special variables
22340 $test -f $src/patchlevel.h && \
22341 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
22342 echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
22343 echo "PERL_CONFIG_SH=true" >>config.sh
22345 : propagate old symbols
22346 if $test -f UU/config.sh; then
22347 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
22348 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
22349 $sort | $uniq -u >UU/oldsyms
22350 set X `cat UU/oldsyms`
22356 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
22358 echo "# Variables propagated from previous config.sh file." >>config.sh
22359 for sym in `cat UU/oldsyms`; do
22360 echo " Propagating $hint variable "'$'"$sym..."
22361 eval 'tmp="$'"${sym}"'"'
22363 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
22369 : Finish up by extracting the .SH files
22373 echo "Extraction done."
22383 If you'd like to make any changes to the config.sh file before I begin
22384 to configure things, do it as a shell escape now (e.g. !vi config.sh).
22387 rp="Press return or use a shell escape to edit config.sh:"
22392 *) : in case they cannot read
22393 sh 1>&4 -c "$ans";;
22398 : if this fails, just run all the .SH files by hand
22407 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
22414 Now you need to generate make dependencies by running "$make depend".
22415 You might prefer to run it in background: "$make depend > makedepend.out &"
22416 It can take a while, so you might not want to run it right now.
22421 rp="Run $make depend now?"
22425 $make depend && echo "Now you must run '$make'."
22428 echo "You must run '$make depend' then '$make'."
22431 elif test -f [Mm]akefile; then
22433 echo "Now you must run a $make."
22435 echo "Configure done."
22438 if $test -f Policy.sh; then
22441 If you compile $package on a different machine or from a different object
22442 directory, copy the Policy.sh file from this object directory to the
22443 new one before you run Configure -- this will help you with most of
22444 the policy defaults.
22448 if $test -f config.msg; then
22449 echo "Hmm. I also noted the following information while running:"
22451 $cat config.msg >&4
22454 $rm -f kit*isdone ark*isdone