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 May 22 19:21:39 CEST 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 : compute my invocation name
72 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
77 : Proper separator for the PATH environment variable
79 : On OS/2 this directory should exist if this is not floppy only system :-]
80 if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' ) 2>&1 >/dev/null ; then
81 if test -n "$OS2_SHELL"; then
83 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
84 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
86 elif test -n "$DJGPP"; then
87 case "X${MACHTYPE:-nonesuchmach}" in
95 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
96 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
97 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
98 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
99 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
100 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
101 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
102 paths="$paths /sbin /usr/sbin /usr/libexec"
103 paths="$paths /system/gnu_library/bin"
107 case "$p_$PATH$p_" in
109 *) test -d $p && PATH=$PATH$p_$p ;;
116 : shall we be using ksh?
122 if (PATH=.; alias -x) >/dev/null 2>&1; then
125 if test -f /hp-ux -a -f /bin/ksh; then
126 needksh='to avoid sh bug in "here document" expansion'
128 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
129 if test X`/usr/bin/uname -v` = X4; then
130 avoidksh="to avoid AIX 4's /bin/sh"
134 if test -f /osf_boot -a -f /usr/sbin/setld; then
135 if test X`/usr/bin/uname -s` = XOSF1; then
136 avoidksh="to avoid Digital UNIX' ksh"
138 unset BIN_SH # if this is 'xpg4' sh will start up ksh
141 case "$inksh/$needksh" in
148 case "$inksh/$avoidksh" in
154 case "$inksh/$needksh-$avoidksh-" in
157 (I see you are using the Korn shell. Some ksh's blow up on $me,
158 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
165 echo "(Feeding myself to $newsh $reason.)"
167 Configure|*/Configure) exec $newsh $0 "$@";;
168 *) exec $newsh Configure "$@";;
173 : if needed set CDPATH to a harmless value that is not chatty
174 : avoid bash 2.02 problems with empty CDPATH.
178 *bash*) CDPATH='.' ;;
183 : Configure runs within the UU subdirectory
184 test -d UU || mkdir UU
322 initialinstalllocation=''
350 d_attribute_format=''
351 d_attribute_malloc=''
352 d_attribute_nonnull=''
353 d_attribute_noreturn=''
355 d_attribute_unused=''
356 d_attribute_warn_unused_result=''
359 d_builtin_choose_expr=''
362 d_c99_variadic_macros=''
406 endhostent_r_proto=''
412 endprotoent_r_proto=''
418 endservent_r_proto=''
470 gethostbyaddr_r_proto=''
472 gethostbyname_r_proto=''
474 gethostent_r_proto=''
486 getnetbyaddr_r_proto=''
488 getnetbyname_r_proto=''
502 d_getprotobyname_r=''
503 getprotobyname_r_proto=''
504 d_getprotobynumber_r=''
505 getprotobynumber_r_proto=''
507 getprotoent_r_proto=''
519 getservbyname_r_proto=''
521 getservbyport_r_proto=''
523 getservent_r_proto=''
547 d_libm_lib_version=''
560 d_malloc_good_size=''
602 d_old_pthread_create_joinable=''
603 old_pthread_create_joinable=''
605 d_pthread_attr_setscope=''
644 sethostent_r_proto=''
661 setprotoent_r_proto=''
673 setservent_r_proto=''
706 d_sprintf_returns_strlen=''
721 d_stdio_ptr_lval_nochange_cnt=''
722 d_stdio_ptr_lval_sets_cnt=''
925 d_inc_version_list=''
927 inc_version_list_init=''
946 ignore_versioned_solibs=''
1010 d_perl_otherlibdirs=''
1018 api_versionstring=''
1024 version_patchlevel_string=''
1028 d_nv_preserves_uv=''
1029 d_nv_zero_is_allbits_zero=''
1040 nv_preserves_uv_bits=''
1112 installsitehtml1dir=''
1115 installsitehtml3dir=''
1122 installsiteman1dir=''
1125 installsiteman3dir=''
1130 installsitescript=''
1145 d_stdio_stream_array=''
1146 stdio_stream_array=''
1157 ccflags_uselargefiles=''
1158 ldflags_uselargefiles=''
1159 libswanted_uselargefiles=''
1179 installvendorarch=''
1186 installvendorhtml1dir=''
1188 vendorhtml1direxp=''
1189 installvendorhtml3dir=''
1191 vendorhtml3direxp=''
1197 installvendorman1dir=''
1200 installvendorman3dir=''
1207 installvendorscript=''
1219 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1222 : We must find out about Eunice early
1224 if test -f /etc/unixtovms; then
1225 eunicefix=/etc/unixtovms
1227 if test -f /etc/unixtovms.exe; then
1228 eunicefix=/etc/unixtovms.exe
1231 : Set executable suffix now -- needed before hints available
1232 if test -f "/libs/version.library"; then
1235 elif test -f "/system/gnu_library/bin/ar.pm"; then
1238 elif test -n "$DJGPP"; then
1241 elif test -d c:/. -o -n "$is_os2" ; then
1250 : set useposix=false in your hint file to disable the POSIX extension.
1252 : set useopcode=false in your hint file to disable the Opcode extension.
1254 : Trailing extension. Override this in a hint file, if needed.
1255 : Extra object files, if any, needed on this platform.
1258 : Possible local include directories to search.
1259 : Set locincpth to "" in a hint file to defeat local include searches.
1260 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1261 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1263 : no include file wanted by default
1266 : Enable -DEBUGGING and -DDEBUGGING from the command line
1272 : change the next line if compiling for Xenix/286 on Xenix/386
1273 xlibpth='/usr/lib/386 /lib/386'
1274 : Possible local library directories to search.
1275 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1276 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1278 : general looking path for locating libraries
1279 glibpth="/lib /usr/lib $xlibpth"
1280 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1281 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1282 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1284 : Private path used by Configure to find libraries. Its value
1285 : is prepended to libpth. This variable takes care of special
1286 : machines, like the mips. Usually, it should be empty.
1289 : default library list
1291 : some systems want to use only the non-versioned libso:s
1292 ignore_versioned_solibs=''
1297 ccflags_uselargefiles=''
1298 ldflags_uselargefiles=''
1299 libswanted_uselargefiles=''
1300 : set usemultiplicity on the Configure command line to enable multiplicity.
1301 : set usesocks on the Configure command line to enable socks.
1302 : set usethreads on the Configure command line to enable threads.
1303 usereentrant='undef'
1304 : full support for void wanted by default
1307 : List of libraries we want.
1308 : If anyone needs extra -lxxx, put those in a hint file.
1309 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1310 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1311 : We probably want to search /usr/shlib before most other libraries.
1312 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1313 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1314 glibpth="/usr/shlib $glibpth"
1315 : Do not use vfork unless overridden by a hint file.
1318 : Find the basic shell for Bourne shell scripts
1322 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1325 if test -f "$xxx"; then
1328 : Build up a list and do a single loop so we can 'break' out.
1329 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1330 for xxx in sh bash ksh pdksh ash; do
1332 try="$try ${p}/${xxx}"
1336 if test -f "$xxx"; then
1339 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1342 elif test -f "$xxx.exe"; then
1353 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1355 Usually it's in /bin/sh. How did you even get this far?
1356 Please contact me (Perl Maintainers) at perlbug@perl.org and
1357 we'll try to straighten this all out.
1363 : see if sh knows # comments
1364 if `$sh -c '#' >/dev/null 2>&1`; then
1368 test -f $xcat$_exe || xcat=/usr/bin/cat
1369 if test ! -f $xcat$_exe; then
1370 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1371 if test -f $p/cat$_exe; then
1376 if test ! -f $xcat$_exe; then
1377 echo "Can't find cat anywhere!"
1381 echo "#!$xcat" >sharp
1385 if test -s today; then
1388 echo "#! $xcat" > sharp
1392 if test -s today; then
1400 echo "Your $sh doesn't grok # comments--I will strip them later on."
1403 echo "exec grep -v '^[ ]*#'" >spitshell
1405 $eunicefix spitshell
1406 spitshell=`pwd`/spitshell
1408 echo "I presume that if # doesn't work, #! won't work either!"
1413 : figure out how to guarantee sh startup
1415 '') startsh=${sharpbang}${sh} ;;
1427 : echo "Yup, it does."
1429 echo "Hmm... '$startsh' does not guarantee sh startup..."
1430 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1435 : Save command line options in file UU/cmdline.opt for later use in
1436 : generating config.sh.
1437 cat > cmdline.opt <<EOSH
1438 # Configure command line arguments.
1447 cat >>cmdline.opt <<EOSH
1448 config_arg$argn='$arg'
1450 # Extreme backslashitis: replace each ' by '"'"'
1451 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1454 arg_exp=`cat cmdl.opt`
1455 args_exp="$args_exp$args_sep'$arg_exp'"
1456 argn=`expr $argn + 1`
1459 # args_exp is good for restarting self: eval "set X $args_exp"; shift; $0 "$@"
1460 # used by ./hints/os2.sh
1463 : produce awk script to parse command line options
1464 cat >options.awk <<'EOF'
1466 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1468 len = length(optstr);
1469 for (i = 1; i <= len; i++) {
1470 c = substr(optstr, i, 1);
1471 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1482 if (substr(str, 1, 1) != "-") {
1483 printf("'%s'\n", str);
1487 for (i = 2; i <= len; i++) {
1488 c = substr(str, i, 1);
1490 printf("-%s\n", substr(str, i));
1496 printf("'%s'\n", substr(str, i + 1));
1509 : process the command line options
1510 set X `for arg in "$@"; do echo "X$arg"; done |
1511 sed -e s/X// | awk -f options.awk`
1516 : set up default values
1526 rm -f optdef.sh posthint.sh
1527 cat >optdef.sh <<EOS
1533 while test $# -gt 0; do
1535 -d) shift; fastread=yes;;
1536 -e) shift; alldone=cont;;
1540 if test -r "$1"; then
1543 echo "$me: cannot read config file $1." >&2
1548 -h) shift; error=true;;
1549 -r) shift; reuseval=true;;
1550 -s) shift; silent=true; realsilent=true;;
1551 -E) shift; alldone=exit;;
1552 -K) shift; knowitall=true;;
1553 -O) shift; override=true;;
1554 -S) shift; silent=true; extractsh=true;;
1559 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1560 echo "$me: ignoring -D $1" >&2
1563 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1564 *) echo "$1='define'" >> optdef.sh;;
1571 *=) echo "$1" >> optdef.sh;;
1573 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1574 echo "$me: ignoring -U $1" >&2
1576 *) echo "$1='undef'" >> optdef.sh;;
1587 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1591 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1592 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1598 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1599 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1600 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1601 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1602 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1603 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1609 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1611 echo "$yyy=''" >> posthint.sh ;;
1616 echo "$yyy='$zzz'" >> posthint.sh ;;
1618 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1620 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1625 echo "$yyy=$zzz" >> posthint.sh ;;
1626 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1630 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1633 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1641 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1642 [-U symbol] [-U symbol=] [-A command:symbol...]
1643 -d : use defaults for all answers.
1644 -e : go on without questioning past the production of config.sh.
1645 -f : specify an alternate default configuration file.
1646 -h : print this help message and exit (with an error status).
1647 -r : reuse C symbols value if possible (skips costly nm extraction).
1648 -s : silent mode, only echoes questions and essential information.
1649 -D : define symbol to have some value:
1650 -D symbol symbol gets the value 'define'
1651 -D symbol=value symbol gets the value 'value'
1652 -E : stop at the end of questions, after having produced config.sh.
1653 -K : do not use unless you know what you are doing.
1654 -O : let -D and -U override definitions from loaded configuration file.
1655 -S : perform variable substitutions on all .SH files (can mix with -f)
1656 -U : undefine symbol:
1657 -U symbol symbol gets the value 'undef'
1658 -U symbol= symbol gets completely empty
1659 -A : manipulate symbol after the platform specific hints have been applied:
1660 -A symbol=value append " "value to symbol
1661 -A append:symbol=value append value to symbol
1662 -A define:symbol=value define symbol to have value
1663 -A clear:symbol define symbol to be ''
1664 -A define:symbol define symbol to be 'define'
1665 -A eval:symbol=value define symbol to be eval of value
1666 -A prepend:symbol=value prepend value to symbol
1667 -A undef:symbol define symbol to be 'undef'
1668 -A undef:symbol= define symbol to be ''
1669 -V : print version number and exit (with a zero status).
1676 case "$fastread$alldone" in
1679 case "$extractsh" in
1682 if test ! -t 0; then
1683 echo "Say 'sh Configure', not 'sh <Configure'"
1693 true) exec 1>/dev/null;;
1696 : run the defines and the undefines, if any, but leave the file out there...
1699 : create the posthint manipulation script and leave the file out there...
1704 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1705 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1706 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1707 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1708 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1711 : Some greps do not return status, grrr.
1712 echo "grimblepritz" >grimble
1713 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1715 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1721 : the following should work in any shell
1725 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1726 cat >contains <<'EOSS'
1727 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1732 : Find the path to the source tree
1735 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1739 *) src=`cd ../$src && pwd` ;;
1752 if test -f $rsrc/Configure && \
1753 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1755 : found it, so we are ok.
1758 for src in . .. ../.. ../../.. ../../../..; do
1759 if test -f ../$src/Configure && \
1760 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1771 Sorry, I can't seem to locate the source dir for $package. Please start
1772 Configure with an explicit path -- i.e. /some/path/Configure.
1780 echo "Sources for $package found in \"$src\"." >&4
1784 : script used to extract .SH files with variable substitutions
1785 cat >extract <<'EOS'
1787 echo "Doing variable substitutions on .SH files..."
1788 if test -f MANIFEST; then
1789 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1791 echo "(Looking for .SH files under the source directory.)"
1792 set x `(cd "$src"; find . -name "*.SH" -print)`
1796 0) set x `(cd "$src"; echo *.SH)`; shift;;
1798 if test ! -f "$src/$1"; then
1804 while test $name; do
1805 if test ! -d "$name"; then
1806 create="$name $create";
1807 name=`echo $name | sed -e "s|^[^/]*$||"`;
1808 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1813 for file in $create; do
1822 dir=`expr X$file : 'X\(.*\)/'`
1823 file=`expr X$file : 'X.*/\(.*\)'`
1824 (cd "$dir" && . ./$file)
1834 dir=`expr X$file : 'X\(.*\)/'`
1835 file=`expr X$file : 'X.*/\(.*\)'`
1836 (set x $dir; shift; eval $mkdir_p)
1837 sh <"$src/$dir/$file"
1846 if test -f "$src/config_h.SH"; then
1847 if test ! -f config.h; then
1848 : oops, they left it out of MANIFEST, probably, so do it anyway.
1849 . "$src/config_h.SH"
1854 : extract files and exit if asked to do so
1855 case "$extractsh" in
1857 case "$realsilent" in
1861 case "$config_sh" in
1862 '') config_sh='config.sh';;
1865 echo "Fetching answers from $config_sh..."
1868 test "$override" && . ./optdef.sh
1872 echo "Extraction done."
1877 : Eunice requires " " instead of "", can you believe it
1880 echo "Beginning of configuration questions for $package."
1882 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1884 : first determine how to suppress newline on echo command
1886 echo "Checking echo to see how to suppress newlines..."
1887 (echo "hi there\c" ; echo " ") >.echotmp
1888 if $contains c .echotmp >/dev/null 2>&1 ; then
1899 echo $n "The star should be here-->$c"
1903 : Now test for existence of everything in MANIFEST
1905 if test -f "$rsrc/MANIFEST"; then
1906 echo "First let's make sure your kit is complete. Checking..." >&4
1907 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | (split -l 50 2>/dev/null || split -50)
1910 for filelist in x??; do
1911 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` >/dev/null 2>>"$tmppwd/missing")
1913 if test -s missing; then
1917 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1919 You have the option of continuing the configuration process, despite the
1920 distinct possibility that your kit is damaged, by typing 'y'es. If you
1921 do, don't blame me if something goes wrong. I advise you to type 'n'o
1922 and contact the author (perlbug@perl.org).
1925 echo $n "Continue? [n] $c" >&4
1929 echo "Continuing..." >&4
1933 echo "ABORTING..." >&4
1938 echo "Looks good..."
1941 echo "There is no MANIFEST file. I hope your kit is complete !"
1946 : Find the appropriate value for a newline for tr
1947 if test -n "$DJGPP"; then
1950 if test X"$trnl" = X; then
1951 case "`echo foo|tr '\n' x 2>/dev/null`" in
1955 if test X"$trnl" = X; then
1956 case "`echo foo|tr '\012' x 2>/dev/null`" in
1957 foox) trnl='\012' ;;
1960 if test X"$trnl" = X; then
1961 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
1962 fooxy) trnl='\n\r' ;;
1965 if test X"$trnl" = X; then
1968 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1974 : compute the number of columns on the terminal for proper question formatting
1979 : set up the echo used in my read
1980 myecho="case \"\$xxxm\" in
1981 '') echo $n \"\$rp $c\" >&4;;
1983 '') echo $n \"[\$xxxm] $c\";;
1985 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1987 echo $n \"[\$xxxm] $c\" >&4
1989 echo $n \"\$rp [\$xxxm] $c\" >&4
1995 : now set up to do reads with possible shell escape and default assignment
2001 case "\$fastread" in
2002 yes) case "\$dflt" in
2005 case "\$silent-\$rp" in
2010 *) case "\$silent" in
2011 true) case "\$rp" in
2016 while expr "X\$ans" : "X!" >/dev/null; do
2020 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2028 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2037 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2042 echo "(OK, I'll run with -d after this question.)" >&4
2045 echo "*** Sorry, \$1 not supported yet." >&4
2055 echo "*** Substitution done -- please confirm."
2057 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2062 echo "*** Error -- try again."
2069 case "\$ans\$xxxm\$nostick" in
2081 : create .config dir to save info across Configure sessions
2082 test -d ../.config || mkdir ../.config
2083 cat >../.config/README <<EOF
2084 This directory created by Configure to save information that should
2085 persist across sessions for $package.
2087 You may safely delete it if you wish.
2090 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2092 $define|true|[yY]*) ;;
2093 *) case "$xversion" in
2096 *** WHOA THERE!!! ***
2098 This is an UNSTABLE DEVELOPMENT release.
2099 The version of this $package distribution is $xversion, that is, odd,
2100 (as opposed to even) and that signifies a development release.
2101 If you want a maintenance release, you want an even-numbered version.
2103 Do ***NOT*** install this into production use.
2104 Data corruption and crashes are possible.
2106 It is most seriously suggested that you do not continue any further
2107 unless you want to help in developing and debugging Perl.
2109 If you *still* want to build perl, you can answer 'y' now,
2110 or pass -Dusedevel to Configure.
2113 rp='Do you really want to continue?'
2117 [yY]) echo >&4 "Okay, continuing."
2118 usedevel="$define" ;;
2119 *) echo >&4 "Okay, bye."
2129 case "$versiononly" in
2130 '') versiononly="$define" ;;
2132 case "$installusrbinperl" in
2133 '') installusrbinperl="$undef" ;;
2138 : general instructions
2141 user=`(logname) 2>/dev/null`
2143 '') user=`whoami 2>&1`;;
2145 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2148 rp='Would you like to see the instructions?'
2159 This installation shell script will examine your system and ask you questions
2160 to determine how the perl5 package should be installed. If you get
2161 stuck on a question, you may use a ! shell escape to start a subshell or
2162 execute a command. Many of the questions will have default answers in square
2163 brackets; typing carriage return will give you the default.
2165 On some of the questions which ask for file or directory names you are allowed
2166 to use the ~name construct to specify the login directory belonging to "name",
2167 even if you don't have a shell which knows about that. Questions where this is
2168 allowed will be marked "(~name ok)".
2172 dflt='Type carriage return to continue'
2176 The prompter used in this script allows you to use shell variables and
2177 backticks in your answers. You may use $1, $2, etc... to refer to the words
2178 in the default answer, as if the default line was a set of arguments given to a
2179 script shell. This means you may also use $* to repeat the whole default line,
2180 so you do not have to re-type everything to add something to the default.
2182 Everytime there is a substitution, you will have to confirm. If there is an
2183 error (e.g. an unmatched backtick), the default answer will remain unchanged
2184 and you will be prompted again.
2186 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2187 the questions and use the computed defaults (or the previous answers if there
2188 was already a config.sh file). Type 'Configure -h' for a list of options.
2189 You may also start interactively and then answer '& -d' at any prompt to turn
2190 on the non-interactive behaviour for the remainder of the execution.
2196 Much effort has been expended to ensure that this shell script will run on any
2197 Unix system. If despite that it blows up on yours, your best bet is to edit
2198 Configure and run it again. If you can't run Configure for some reason,
2199 you'll have to generate a config.sh file by hand. Whatever problems you
2200 have, let me (perlbug@perl.org) know how I blew it.
2202 This installation script affects things in two ways:
2204 1) it may do direct variable substitutions on some of the files included
2206 2) it builds a config.h file for inclusion in C programs. You may edit
2207 any of these files as the need arises after running this script.
2209 If you make a mistake on a question, there is no easy way to back up to it
2210 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2211 files. Configure will offer to let you do this before it runs the SH files.
2214 dflt='Type carriage return to continue'
2216 case "$firsttime" in
2217 true) echo $user >>../.config/instruct;;
2221 : find out where common programs are
2223 echo "Locating common programs..." >&4
2236 if test -d \$dir/\$thing; then
2242 for thisthing in \$dir/\$thing; do
2243 : just loop through to pick last item
2245 if test -f \$thisthing; then
2248 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2251 elif test -f \$dir/\$thing.exe; then
2252 if test -n "$DJGPP"; then
2253 echo \$dir/\$thing.exe
2254 elif test "$eunicefix" != ":"; then
2255 : on Eunice apparently
2309 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2310 pth="$pth /lib /usr/lib"
2311 for file in $loclist; do
2315 if test -f "$xxx"; then
2318 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2319 xxx=`./loc $file $file $pth`
2322 '') xxx=`./loc $file $file $pth`;;
2323 *) xxx=`./loc $xxx $xxx $pth`;;
2325 eval $file=$xxx$_exe
2329 echo $file is in $xxx.
2332 echo $file is in $xxx.
2335 echo "I don't know where '$file' is, and my life depends on it." >&4
2336 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2342 echo "Don't worry if any of the following aren't found..."
2344 for file in $trylist; do
2348 if test -f "$xxx"; then
2351 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2352 xxx=`./loc $file $file $pth`
2355 '') xxx=`./loc $file $file $pth`;;
2356 *) xxx=`./loc $xxx $xxx $pth`;;
2358 eval $file=$xxx$_exe
2362 echo $file is in $xxx.
2365 echo $file is in $xxx.
2368 echo "I don't see $file out there, $say."
2375 echo "Substituting grep for egrep."
2382 echo "Substituting cp for ln."
2391 echo "I can't find make or gmake, and my life depends on it." >&4
2392 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2400 *) # We can't have osname yet.
2401 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2402 # Assume that gmake, if found, is definitely GNU make
2403 # and prefer it over the system make.
2404 echo "Substituting gmake for make."
2412 echo "Hopefully test is built into your sh."
2415 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2416 echo "Using the test built into your sh."
2424 echo "Hopefully echo is built into your sh."
2429 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2430 $echo $n "hi there$c" >foo1
2431 echo $n "hi there$c" >foo2
2432 if cmp foo1 foo2 >/dev/null 2>&1; then
2433 echo "They are compatible. In fact, they may be identical."
2440 They are not compatible! You are probably running ksh on a non-USG system.
2441 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2442 have echo built in and we may have to run some Bourne shell scripts. That
2443 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2446 $echo $n "The star should be here-->$c"
2456 cat <<'EOSC' >>trygcc
2461 int main(int argc, char *argv[]) {
2465 if $cc -o try $ccflags $ldflags try.c; then
2468 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2474 case "`$cc -v -c try.c 2>&1`" in
2477 if $test X"$trygcc" = Xyes; then
2478 if gcc -o try -c try.c; then
2480 echo "You seem to have a working gcc, though." >&4
2481 rp="Would you like to use it?"
2483 if $test -f myread; then
2486 if $test -f UU/myread; then
2489 echo "Cannot find myread, sorry. Aborting." >&2
2494 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2495 if $test -f usethreads.cbu; then
2498 *** However, any setting of the C compiler flags (e.g. for thread support)
2499 *** has been lost. It may be necessary to pass -Dcc=gcc to Configure
2500 *** (together with e.g. -Dusethreads).
2516 cat <<'EOSC' >>checkcc
2521 int main(int argc, char *argv[]) {
2525 if $cc -o try $ccflags $ldflags try.c; then
2528 if $test X"$despair" = Xyes; then
2529 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2532 You need to find a working C compiler.
2533 Either (purchase and) install the C compiler supplied by your OS vendor,
2534 or for a free C compiler try http://gcc.gnu.org/
2535 I cannot continue any further, aborting.
2544 : determine whether symbolic links are supported
2547 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2548 echo "Symbolic links are supported." >&4
2551 echo "Symbolic links are NOT supported." >&4
2556 : determine whether symbolic links are supported
2560 echo "Checking how to test for symbolic links..." >&4
2562 if $test "X$issymlink" = X; then
2564 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2565 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2567 if test $? = 0; then
2570 echo "Your builtin 'test -h' may be broken." >&4
2573 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2576 if test -f "$p/$test"; then
2585 echo "Trying external '$test -h'." >&4
2586 issymlink="$test -h"
2587 if $test ! -h sym >/dev/null 2>&1; then
2588 echo "External '$test -h' is broken, too." >&4
2596 if $test "X$issymlink" = X; then
2597 if $test -L sym 2>/dev/null; then
2598 issymlink="$test -L"
2599 echo "The builtin '$test -L' worked." >&4
2602 if $test "X$issymlink" != X; then
2603 echo "You can test for symbolic links with '$issymlink'." >&4
2605 echo "I do not know how you can test for symbolic links." >&4
2609 *) echo "No symbolic links, so not testing for their testing..." >&4
2615 case "$mksymlinks" in
2618 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2621 *) case "$lns:$issymlink" in
2622 *"ln"*" -s:"*"test -"?)
2623 echo "Creating the symbolic links..." >&4
2624 echo "(First creating the subdirectories...)" >&4
2626 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2628 test -z "$directory" && break
2632 if test ! -d t/base; then
2633 echo "Failed to create the subdirectories. Aborting." >&4
2636 echo "(Then creating the symlinks...)" >&4
2637 awk '{print $1}' $src/MANIFEST | while true; do
2639 test -z "$filename" && break
2640 if test -f $filename; then
2641 if $issymlink $filename; then
2645 if test -f $filename; then
2646 echo "$filename already exists, not symlinking."
2648 ln -s $src/$filename $filename
2652 if test ! -f t/base/lex.t; then
2653 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2658 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2667 case "$usecrosscompile" in
2669 $echo "Cross-compiling..."
2672 *-*-gcc) # A cross-compiling gcc, probably.
2673 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2675 # leave out ld, choosing it is more complex
2677 ranlib=$targetarch-ranlib
2678 $echo 'extern int foo;' > try.c
2679 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2681 if $test $# -gt 0; then
2683 incpth="`$echo $incpth|$sed 's/^ //'`"
2684 echo "Guessing incpth '$incpth'." >&4
2686 j="`$echo $i|$sed 's,/include$,/lib,'`"
2687 if $test -d $j; then
2691 libpth="`$echo $libpth|$sed 's/^ //'`"
2692 echo "Guessing libpth '$libpth'." >&4
2697 case "$targetarch" in
2698 '') echo "Targetarch not defined." >&4; croak=y ;;
2699 *) echo "Using targetarch $targetarch." >&4 ;;
2702 '') echo "Incpth not defined." >&4; croak=y ;;
2703 *) echo "Using incpth '$incpth'." >&4 ;;
2706 '') echo "Libpth not defined." >&4; croak=y ;;
2707 *) echo "Using libpth '$libpth'." >&4 ;;
2710 '') for i in $incpth; do
2711 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2713 echo "Guessing usrinc $usrinc." >&4
2718 '') echo "Usrinc not defined." >&4; croak=y ;;
2721 *) echo "Using usrinc $usrinc." >&4 ;;
2723 case "$targethost" in
2724 '') echo "Targethost not defined." >&4; croak=y ;;
2725 *) echo "Using targethost $targethost." >&4
2730 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2733 /*) run=$src/Cross/run
2734 targetmkdir=$src/Cross/mkdir
2736 from=$src/Cross/from
2738 *) pwd=`$test -f ../Configure & cd ..; pwd`
2740 targetmkdir=$pwd/Cross/mkdir
2742 from=$pwd/Cross/from
2745 case "$targetrun" in
2746 '') targetrun=ssh ;;
2751 case "$targetfrom" in
2752 '') targetfrom=scp ;;
2756 from=$from-$targetfrom
2757 case "$targetdir" in
2759 echo "Guessing targetdir $targetdir." >&4
2762 case "$targetuser" in
2764 echo "Guessing targetuser $targetuser." >&4
2767 case "$targetfrom" in
2771 case "$targetrun" in
2783 '') cwd=$targetdir ;;
2787 if $test ! -f \$exe.xok; then
2791 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2794 *) echo "Unknown targetrun '$targetrun'" >&4
2798 case "$targetmkdir" in
2800 cat >$targetmkdir <<EOF
2802 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2804 $chmod a+rx $targetmkdir
2806 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2818 $targetmkdir \`dirname \$f\`
2819 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2822 $targetmkdir $targetdir/\`dirname \$f\`
2823 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2836 $mkdir -p $targetdir/\`dirname \$f\`
2837 $cp \$f $targetdir/\$f || exit 1
2840 $targetmkdir $targetdir/\`dirname \$f\`
2841 $cp \$f $targetdir/\$f || exit 1
2848 *) echo "Unknown targetto '$targetto'" >&4
2852 case "$targetfrom" in
2859 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2864 cp) cat >$from <<EOF
2869 cp $targetdir/\$f . || exit 1
2874 *) echo "Unknown targetfrom '$targetfrom'" >&4
2878 if $test ! -f $run; then
2879 echo "Target 'run' script '$run' not found." >&4
2883 if $test ! -f $to; then
2884 echo "Target 'to' script '$to' not found." >&4
2888 if $test ! -f $from; then
2889 echo "Target 'from' script '$from' not found." >&4
2893 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2897 Using '$run' for remote execution,
2898 and '$from' and '$to'
2899 for remote file transfer.
2905 usecrosscompile='undef'
2910 : see whether [:lower:] and [:upper:] are supported character classes
2912 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2914 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2918 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
2919 # (0xd9 and 0xe2), therefore that is a nice testing point.
2920 if test "X$up" = X -o "X$low" = X; then
2921 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
2927 if test "X$up" = X -o "X$low" = X; then
2928 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
2934 if test "X$up" = X -o "X$low" = X; then
2935 case "`echo RS | od -x 2>/dev/null`" in
2937 echo "Hey, this might be EBCDIC." >&4
2938 if test "X$up" = X -o "X$low" = X; then
2939 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2940 rs) up='[A-IJ-RS-Z]'
2945 if test "X$up" = X -o "X$low" = X; then
2946 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2956 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
2958 echo "Using $up and $low to convert case." >&4
2961 echo "I don't know how to translate letters from upper to lower case." >&4
2962 echo "Your tr is not acting any way I know of." >&4
2966 : set up the translation script tr, must be called with ./tr of course
2970 '[A-Z][a-z]') exec $tr '$up' '$low';;
2971 '[a-z][A-Z]') exec $tr '$low' '$up';;
2978 : Try to determine whether config.sh was made on this system
2979 case "$config_sh" in
2981 myuname=`$uname -a 2>/dev/null`
2982 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2983 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2984 # because the A-Z/a-z are not consecutive.
2985 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2986 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2987 newmyuname="$myuname"
2989 case "$knowitall" in
2991 if test -f ../config.sh; then
2992 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2993 eval "`grep myuname= ../config.sh`"
2995 if test "X$myuname" = "X$newmyuname"; then
3003 : Get old answers from old config file if Configure was run on the
3004 : same system, otherwise use the hints.
3007 if test -f config.sh; then
3009 rp="I see a config.sh file. Shall I use it to set the defaults?"
3012 n*|N*) echo "OK, I'll ignore it."
3013 mv config.sh config.sh.old
3014 myuname="$newmyuname"
3016 *) echo "Fetching default answers from your old config.sh file..." >&4
3024 : Older versions did not always set $sh. Catch re-use of such
3034 if test ! -f config.sh; then
3037 First time through, eh? I have some defaults handy for some systems
3038 that need some extra help getting the Configure answers right:
3041 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3043 : Half the following guesses are probably wrong... If you have better
3044 : tests or hints, please send them to perlbug@perl.org
3045 : The metaconfig authors would also appreciate a copy...
3046 $test -f /irix && osname=irix
3047 $test -f /xenix && osname=sco_xenix
3048 $test -f /dynix && osname=dynix
3049 $test -f /dnix && osname=dnix
3050 $test -f /lynx.os && osname=lynxos
3051 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3052 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3053 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3054 $test -f /bin/mips && /bin/mips && osname=mips
3055 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3056 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3057 $test -d /usr/apollo/bin && osname=apollo
3058 $test -f /etc/saf/_sactab && osname=svr4
3059 $test -d /usr/include/minix && osname=minix
3060 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3061 if $test -d /MachTen -o -d /MachTen_Folder; then
3063 if $test -x /sbin/version; then
3064 osvers=`/sbin/version | $awk '{print $2}' |
3065 $sed -e 's/[A-Za-z]$//'`
3066 elif $test -x /usr/etc/version; then
3067 osvers=`/usr/etc/version | $awk '{print $2}' |
3068 $sed -e 's/[A-Za-z]$//'`
3074 $test -f /sys/posix.dll &&
3075 $test -f /usr/bin/what &&
3076 set X `/usr/bin/what /sys/posix.dll` &&
3077 $test "$3" = UWIN &&
3081 if $test -f $uname; then
3089 umips) osname=umips ;;
3092 [23]100) osname=mips ;;
3093 next*) osname=next ;;
3095 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3096 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3099 elif $test -f /etc/kconfig; then
3101 if test "$lns" = "$ln -s"; then
3103 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3105 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3112 if test -n "$DJGPP"; then
3121 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3123 # oslevel can fail with:
3124 # oslevel: Unable to acquire lock.
3125 *not\ found) osvers="$4"."$3" ;;
3126 '<3240'|'<>3240') osvers=3.2.0 ;;
3127 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3128 '=3250'|'>3250') osvers=3.2.5 ;;
3132 bsd386) osname=bsd386
3135 cygwin*) osname=cygwin
3138 *dc.osx) osname=dcosx
3144 domainos) osname=apollo
3150 dragonfly) osname=dragonfly
3153 dynixptx*) osname=dynixptx
3154 osvers=`echo "$4"|sed 's/^v//'`
3156 freebsd) osname=freebsd
3158 genix) osname=genix ;;
3162 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3178 netbsd*) osname=netbsd
3181 news-os) osvers="$3"
3183 4*) osname=newsos4 ;;
3187 next*) osname=next ;;
3188 nonstop-ux) osname=nonstopux ;;
3189 openbsd) osname=openbsd
3195 POSIX-BC | posix-bc ) osname=posix-bc
3198 powerux | power_ux | powermax_os | powermaxos | \
3199 powerunix | power_unix) osname=powerux
3205 solaris) osname=solaris
3207 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3214 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3218 titanos) osname=titanos
3227 ultrix) osname=ultrix
3230 osf1|mls+) case "$5" in
3233 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3236 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3239 hp*) osname=hp_osf1 ;;
3240 mips) osname=mips_osf1 ;;
3243 # UnixWare 7.1.2 is known as Open UNIX 8
3244 openunix|unixware) osname=svr5
3252 $2) case "$osname" in
3256 : svr4.x or possibly later
3266 if test -f /stand/boot ; then
3267 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3268 if test -n "$INITPROG" -a -f "$INITPROG"; then
3269 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3270 if test -n "$isesix"; then
3278 *) if test -f /etc/systemid; then
3280 set `echo $3 | $sed 's/\./ /g'` $4
3281 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3283 elif $test -f $src/hints/sco_$1_$2.sh; then
3285 elif $test -f $src/hints/sco_$1.sh; then
3290 '') : Still unknown. Probably a generic Sys V.
3299 *) case "$osname" in
3300 '') : Still unknown. Probably a generic BSD.
3308 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3309 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3310 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3313 $rm -f UU/kernel.what
3314 elif test -d c:/. -o -n "$is_os2" ; then
3321 case "$targetarch" in
3324 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3329 : Now look for a hint file osname_osvers, unless one has been
3330 : specified already.
3333 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3334 : Also try without trailing minor version numbers.
3335 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3336 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3337 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3338 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3341 *) case "$osvers" in
3344 *) if $test -f $src/hints/$file.sh ; then
3346 elif $test -f $src/hints/$xfile.sh ; then
3348 elif $test -f $src/hints/$xxfile.sh ; then
3350 elif $test -f $src/hints/$xxxfile.sh ; then
3352 elif $test -f $src/hints/$xxxxfile.sh ; then
3354 elif $test -f "$src/hints/${osname}.sh" ; then
3363 if $test -f Policy.sh ; then
3366 none) dflt="Policy" ;;
3367 *) dflt="Policy $dflt" ;;
3372 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3376 if $test -f Policy.sh ; then
3379 There's also a Policy hint file available, which should make the
3380 site-specific (policy) questions easier to answer.
3387 You may give one or more space-separated answers, or "none" if appropriate.
3388 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3389 previous run of Configure, you may specify it as well as or instead of
3390 OS-specific hints. If hints are provided for your OS, you should use them:
3391 although Perl can probably be built without hints on many platforms, using
3392 hints often improve performance and may enable features that Configure can't
3393 set up on its own. If there are no hints that match your OS, specify "none";
3394 DO NOT give a wrong version or a wrong OS.
3398 rp="Which of these apply, if any?"
3401 for file in $tans; do
3402 if $test X$file = XPolicy -a -f Policy.sh; then
3404 $cat Policy.sh >> UU/config.sh
3405 elif $test -f $src/hints/$file.sh; then
3406 . $src/hints/$file.sh
3407 $cat $src/hints/$file.sh >> UU/config.sh
3408 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3411 : Give one chance to correct a possible typo.
3412 echo "$file.sh does not exist"
3414 rp="hint to use instead?"
3416 for file in $ans; do
3417 if $test -f "$src/hints/$file.sh"; then
3418 . $src/hints/$file.sh
3419 $cat $src/hints/$file.sh >> UU/config.sh
3420 elif $test X$ans = X -o X$ans = Xnone ; then
3423 echo "$file.sh does not exist -- ignored."
3430 : Remember our hint file for later.
3431 if $test -f "$src/hints/$file.sh" ; then
3441 echo "Fetching default answers from $config_sh..." >&4
3445 cp $config_sh config.sh 2>/dev/null
3455 test "$override" && . ./optdef.sh
3457 : Restore computed paths
3458 for file in $loclist $trylist; do
3459 eval $file="\$_$file"
3464 Configure uses the operating system name and version to set some defaults.
3465 The default value is probably right if the name rings a bell. Otherwise,
3466 since spelling matters for me, either accept the default or answer "none"
3473 ''|' '|none) dflt=none ;;
3474 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3477 *) dflt="$osname" ;;
3479 rp="Operating system name?"
3483 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3489 ''|' '|none) dflt=none ;;
3490 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3491 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3493 ''|' ') dflt=none ;;
3498 *) dflt="$osvers" ;;
3500 rp="Operating system version?"
3510 : who configured the system
3511 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3514 cf_by=`(logname) 2>/dev/null`
3517 cf_by=`(whoami) 2>/dev/null`
3519 "") cf_by=unknown ;;
3524 : decide how portable to be. Allow command line overrides.
3525 case "$d_portable" in
3527 *) d_portable="$define" ;;
3530 : set up shell script to do ~ expansion
3536 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3539 if $test -f /bin/csh; then
3540 /bin/csh -f -c "glob \$1"
3545 name=\`$expr x\$1 : '..\([^/]*\)'\`
3546 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3547 if $test ! -d "\$dir"; then
3549 echo "\$me: can't locate home directory for: \$name" >&2
3554 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3570 : now set up to get a file name
3574 cat <<'EOSC' >>getfile
3590 : getfile will accept an answer from the comma-separated list
3591 : enclosed in parentheses even if it does not meet other criteria.
3592 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3593 fn=`echo $fn | sed 's/(.*)//'`
3599 loc_file=`expr $fn : '.*:\(.*\)'`
3600 fn=`expr $fn : '\(.*\):.*'`
3608 */*) fullpath=true;;
3617 *e*) exp_file=true;;
3620 *p*) nopath_ok=true;;
3625 *d*) type='Directory';;
3626 *l*) type='Locate';;
3631 Locate) what='File';;
3636 case "$d_portable" in
3644 while test "$type"; do
3649 true) rp="$rp (~name ok)";;
3652 if test -f UU/getfile.ok && \
3653 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3672 value=`UU/filexp $ans`
3675 if test "$ans" != "$value"; then
3676 echo "(That expands to $value on this system.)"
3690 /*) value="$ansexp" ;;
3691 [a-zA-Z]:/*) value="$ansexp" ;;
3696 echo "I shall only accept a full path name, as in /bin/ls." >&4
3697 echo "Use a ! shell escape if you wish to check pathnames." >&4
3700 echo "Please give a full path name, starting with slash." >&4
3703 echo "Note that using ~name is ok provided it expands well." >&4
3716 for fp in $gfpth; do
3717 if test "X$fp" = X.; then
3722 if test -f "$pf"; then
3724 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3726 echo "($value is not a plain file, but that's ok.)"
3729 if test X"$type" = X; then
3736 for fp in $gfpth; do
3737 if test "X$fp" = X.; then
3742 direxp="$fp/$ansexp"
3744 if test -d "$direxp"; then
3752 if test -d "$ansexp"; then
3753 echo "(Looking for $loc_file in directory $value.)"
3754 value="$value/$loc_file"
3755 ansexp="$ansexp/$loc_file"
3757 if test -f "$ansexp"; then
3760 case "$nopath_ok" in
3761 true) case "$value" in
3763 *) echo "Assuming $value will be in people's path."
3779 if test "$fastread" = yes; then
3784 rp="$what $value doesn't exist. Use that name anyway?"
3803 test "X$gfpthkeep" != Xy && gfpth=""
3806 : determine root of directory hierarchy where package will be installed.
3809 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3812 dflt=`echo "$prefix" | sed 's/.$//'`
3820 By default, $package will be installed in $dflt/bin, manual pages
3821 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3822 installation directories. Typically this is something like /usr/local.
3823 If you wish to have binaries under /usr/bin but other parts of the
3824 installation under /usr/local, that's ok: you will be prompted
3825 separately for each of the installation directories, the prefix being
3826 only used to set the defaults.
3830 rp='Installation prefix to use?'
3838 *) oldprefix="$prefix";;
3847 *) afsroot=$afsroot ;;
3853 $define|true) afs=true ;;
3854 $undef|false) afs=false ;;
3855 *) if test -d $afsroot; then
3863 echo "AFS may be running... I'll be extra cautious then..." >&4
3865 echo "AFS does not seem to be running..." >&4
3868 : determine installation prefix for where package is to be installed.
3872 Since you are running AFS, I need to distinguish the directory in which
3873 files will reside from the directory in which they are installed (and from
3874 which they are presumably copied to the former directory by occult means).
3877 case "$installprefix" in
3878 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
3879 *) dflt="$installprefix";;
3884 In some special cases, particularly when building $package for distribution,
3885 it is convenient to distinguish the directory in which files should be
3886 installed from the directory ($prefix) in which they will
3887 eventually reside. For most users, these two directories are the same.
3890 case "$installprefix" in
3892 *) dflt=$installprefix;;
3896 rp='What installation prefix should I use for installing files?'
3898 installprefix="$ans"
3899 installprefixexp="$ansexp"
3901 : Perform the prefixexp/installprefixexp correction if necessary
3902 cat <<EOS >installprefix
3905 cat <<'EOSC' >>installprefix
3906 : Change installation prefix, if necessary.
3907 if $test X"$prefix" != X"$installprefix"; then
3908 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
3910 eval "install${prefixvar}=\"\$${prefixvar}exp\""
3913 chmod +x installprefix
3914 $eunicefix installprefix
3916 : Set variables such as privlib and privlibexp from the output of ./getfile
3917 : performing the prefixexp/installprefixexp correction if necessary.
3918 cat <<EOS >setprefixvar
3921 cat <<'EOSC' >>setprefixvar
3922 eval "${prefixvar}=\"\$ans\""
3923 eval "${prefixvar}exp=\"\$ansexp\""
3926 chmod +x setprefixvar
3927 $eunicefix setprefixvar
3929 : set up the script used to warn in case of inconsistency
3936 echo "*** WHOA THERE!!! ***" >&4
3937 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
3938 rp=" Keep the $hint value?"
3941 y) td=$was; tu=$was;;
3945 : function used to set $1 to $val
3946 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
3948 $define$undef) . ./whoa; eval "$var=\$td";;
3949 $undef$define) . ./whoa; eval "$var=\$tu";;
3950 *) eval "$var=$val";;
3954 $define|true|[yY]*) dflt='y';;
3959 Perl can be built to use the SOCKS proxy protocol library. To do so,
3960 Configure must be run with -Dusesocks. If you use SOCKS you also need
3961 to use the PerlIO abstraction layer, this will be implicitly selected.
3963 If this doesn't make any sense to you, just accept the default '$dflt'.
3965 rp='Build Perl for SOCKS?'
3968 y|Y) val="$define" ;;
3975 $define|true|[yY]*) useperlio="$define";;
3978 case "$useperlio" in
3979 $define|true|[yY]*|'') dflt='y';;
3984 Previous version of $package used the standard IO mechanisms as
3985 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
3986 alternate IO mechanisms via the PerlIO abstraction layer, but the
3987 stdio mechanism is still available if needed. The abstraction layer
3988 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
3989 Using PerlIO with sfio may cause problems with some extension modules.
3991 If this doesn't make any sense to you, just accept the default '$dflt'.
3993 rp='Use the PerlIO abstraction layer?'
4000 echo "Ok, doing things the stdio way."
4009 case "$useperlio" in
4010 $define|true|[yY]*) ;;
4013 You are using the SOCKS proxy protocol library which means that you
4014 should also use the PerlIO layer. You may be headed for trouble.
4023 case "$usethreads" in
4024 $define|true|[yY]*) dflt='y';;
4025 *) # Catch case where user specified ithreads or 5005threads but
4026 # forgot -Dusethreads (A.D. 4/2002)
4027 case "$useithreads$use5005threads" in
4029 case "$useperlio" in
4030 "$define") dflt='y' ;;
4040 Perl can be built to take advantage of threads on some systems.
4041 To do so, Configure can be run with -Dusethreads.
4043 Note that Perl built with threading support runs slightly slower
4044 and uses more memory than plain Perl. The current implementation
4045 is believed to be stable, but it is fairly new, and so should be
4046 treated with caution.
4048 If this doesn't make any sense to you, just accept the default '$dflt'.
4050 rp='Build a threading Perl?'
4053 y|Y) val="$define" ;;
4059 case "$usethreads" in
4063 Since release 5.6, Perl has had two different threading implementations,
4064 the newer interpreter-based version (ithreads) with one interpreter per
4065 thread, and the older 5.005 version (5005threads).
4066 The 5005threads version is effectively unmaintained and will probably be
4067 removed in Perl 5.10, so there should be no need to build a Perl using it
4068 unless needed for backwards compatibility with some existing 5.005threads
4072 : Default to ithreads unless overridden on command line or with
4075 case "$use5005threads" in
4076 $define|true|[yY]*) dflt='n';;
4078 case "$useithreads" in
4079 $undef|false|[nN]*) dflt='n';;
4081 rp='Use the newer interpreter-based ithreads?'
4084 y|Y) val="$define" ;;
4089 : Now set use5005threads to the opposite value.
4090 case "$useithreads" in
4091 $define) val="$undef" ;;
4098 useithreads="$undef"
4099 use5005threads="$undef"
4103 case "$useithreads$use5005threads" in
4107 You cannot have both the ithreads and the 5.005 threads enabled
4108 at the same time. Disabling the 5.005 threads since they are
4109 much less stable than the ithreads.
4112 use5005threads="$undef"
4116 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
4119 *** To build with ithreads you must also use the PerlIO layer.
4120 *** Cannot continue, aborting.
4126 case "$d_oldpthreads" in
4127 '') : Configure tests would be welcome here. For now, assume undef.
4129 *) val="$d_oldpthreads" ;;
4135 : Look for a hint-file generated 'call-back-unit'. If the
4136 : user has specified that a threading perl is to be built,
4137 : we may need to set or change some other defaults.
4138 if $test -f usethreads.cbu; then
4139 echo "Your platform has some specific hints regarding threaded builds, using them..."
4142 case "$usethreads" in
4143 "$define"|true|[yY]*)
4145 (Your platform does not have any specific hints for threaded builds.
4146 Assuming POSIX threads, then.)
4154 Perl can be built so that multiple Perl interpreters can coexist
4155 within the same Perl executable.
4158 case "$useithreads" in
4161 This multiple interpreter support is required for interpreter-based threads.
4165 *) case "$usemultiplicity" in
4166 $define|true|[yY]*) dflt='y';;
4170 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4171 rp='Build Perl for multiplicity?'
4174 y|Y) val="$define" ;;
4183 case "$usemorebits" in
4184 "$define"|true|[yY]*)
4185 use64bitint="$define"
4186 uselongdouble="$define"
4187 usemorebits="$define"
4189 *) usemorebits="$undef"
4193 : make some quick guesses about what we are up against
4195 $echo $n "Hmm... $c"
4205 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
4206 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
4208 echo "Looks kind of like an OSF/1 system, but we'll see..."
4210 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4211 xxx=`./loc addbib blurfl $pth`
4212 if $test -f $xxx; then
4213 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4217 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4218 echo "Looks kind of like an extended USG system, but we'll see..."
4220 echo "Looks kind of like a USG system, but we'll see..."
4224 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4225 echo "Looks kind of like a BSD system, but we'll see..."
4229 echo "Looks kind of like a Version 7 system, but we'll see..."
4232 case "$eunicefix" in
4235 There is, however, a strange, musty smell in the air that reminds me of
4236 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4240 : it so happens the Eunice I know will not run shell scripts in Unix format
4244 echo "Congratulations. You aren't running Eunice."
4248 : Detect OS2. The p_ variable is set above in the Head.U unit.
4249 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4250 : semicolon as a patch separator
4255 I have the feeling something is not exactly right, however...don't tell me...
4256 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4257 (Or you may be running DOS with DJGPP.)
4262 if test -f /xenix; then
4263 echo "Actually, this looks more like a XENIX system..."
4268 echo "It's not Xenix..."
4273 if test -f /venix; then
4274 echo "Actually, this looks more like a VENIX system..."
4281 echo "Nor is it Venix..."
4284 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4285 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4292 rp="Use which C compiler?"
4296 : See if they have not cc but they do have gcc
4298 : Look for a hint-file generated 'call-back-unit'. Now that the
4299 : user has specified the compiler, we may need to set or change some
4301 if $test -f cc.cbu; then
4307 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4313 printf("%s\n", __VERSION__);
4315 printf("%s\n", "1");
4321 if $cc -o try $ccflags $ldflags try.c; then
4322 gccversion=`$run ./try`
4323 case "$gccversion" in
4324 '') echo "You are not using GNU cc." ;;
4325 *) echo "You are using GNU cc $gccversion."
4331 echo "*** WHOA THERE!!! ***" >&4
4332 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4333 case "$knowitall" in
4335 echo " You'd better start hunting for one and let me know about it." >&4
4341 case "$gccversion" in
4342 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4344 case "$gccversion" in
4345 '') gccosandvers='' ;;
4346 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4347 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4349 case "$gccosandvers" in
4350 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4351 $osname$osvers) ;; # looking good
4352 $osname*) cat <<EOM >&4
4354 *** WHOA THERE!!! ***
4356 Your gcc has not been compiled for the exact release of
4357 your operating system ($gccosandvers versus $osname$osvers).
4359 In general it is a good idea to keep gcc synchronized with
4360 the operating system because otherwise serious problems
4361 may ensue when trying to compile software, like Perl.
4363 I'm trying to be optimistic here, though, and will continue.
4364 If later during the configuration and build icky compilation
4365 problems appear (headerfile conflicts being the most common
4366 manifestation), I suggest reinstalling the gcc to match
4367 your operating system release.
4371 *) gccosandvers='' ;; # failed to parse, better be silent
4379 # gcc 3.* complain about adding -Idirectories that they already know about,
4380 # so we will take those off from locincpth.
4381 case "$gccversion" in
4383 echo "main(){}">try.c
4384 for incdir in $locincpth; do
4385 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4386 grep '^c[cp]p*[01]: warning: changing search order '`
4387 if test "X$warn" != X; then
4388 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4394 : What should the include directory be ?
4396 $echo $n "Hmm... $c"
4400 if $test -f /bin/mips && /bin/mips; then
4401 echo "Looks like a MIPS system..."
4402 $cat >usr.c <<'EOCP'
4403 #ifdef SYSTYPE_BSD43
4407 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4408 dflt='/bsd43/usr/include'
4412 mips_type='System V'
4414 $rm -f usr.c usr.out
4415 echo "and you're compiling with the $mips_type compiler and libraries."
4419 echo "Doesn't look like a MIPS system."
4429 case "$xxx_prompt" in
4432 rp='Where are the include files you want to use?'
4440 : see how we invoke the C preprocessor
4442 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4443 cat <<'EOT' >testcpp.c
4449 if test ! -f cppstdin; then
4450 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4451 # AIX cc -E doesn't show the absolute headerfile
4452 # locations but we'll cheat by using the -M flag.
4453 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
4455 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4458 echo "Keeping your $hint cppstdin wrapper."
4461 wrapper=`pwd`/cppstdin
4465 if $test "X$cppstdin" != "X" && \
4466 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4467 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4469 echo "You used to use $cppstdin $cppminus so we'll use that again."
4471 '') echo "But let's see if we can live without a wrapper..." ;;
4473 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4474 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4476 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4479 echo "(However, $cpprun $cpplast does not work, let's see...)"
4487 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4494 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4495 $cc -E <testcpp.c >testcpp.out 2>&1; \
4496 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4497 echo "Yup, it does."
4500 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4501 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4502 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4503 echo "Yup, it does."
4506 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4507 $cc -P <testcpp.c >testcpp.out 2>&1; \
4508 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4509 echo "Yipee, that works!"
4512 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4513 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4514 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4515 echo "At long last!"
4518 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4519 $cpp <testcpp.c >testcpp.out 2>&1; \
4520 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4524 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4525 $cpp - <testcpp.c >testcpp.out 2>&1; \
4526 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4527 echo "Hooray, it works! I was beginning to wonder."
4530 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4531 $wrapper <testcpp.c >testcpp.out 2>&1; \
4532 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4538 rp="No dice. I can't find a C preprocessor. Name one:"
4542 $x_cpp <testcpp.c >testcpp.out 2>&1
4543 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4544 echo "OK, that will do." >&4
4546 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4561 echo "Perhaps can we force $cc -E using a wrapper..."
4562 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4563 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4569 echo "Nope, we'll have to live without it..."
4583 "$wrapper"|'cppstdin') ;;
4584 *) $rm -f $wrapper;;
4586 $rm -f testcpp.c testcpp.out
4588 : Set private lib path
4591 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4596 '') dlist="$loclibpth $plibpth $glibpth";;
4597 *) dlist="$libpth";;
4600 : Now check and see which directories actually exist, avoiding duplicates
4604 if $test -d $xxx; then
4607 *) libpth="$libpth $xxx";;
4613 Some systems have incompatible or broken versions of libraries. Among
4614 the directories listed in the question below, please remove any you
4615 know not to be holding relevant libraries, and add any that are needed.
4616 Say "none" for none.
4627 rp="Directories to use for library searches?"
4634 : compute shared library extension
4637 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4647 On some systems, shared libraries may be available. Answer 'none' if
4648 you want to suppress searching of shared libraries for the remainder
4649 of this configuration.
4652 rp='What is the file extension used for shared libraries?'
4656 : Define several unixisms.
4657 : Hints files or command line option can be used to override them.
4658 : The convoluted testing is in case hints files set either the old
4661 '') case "$exe_ext" in
4663 *) _exe="$exe_ext" ;;
4668 '') case "$lib_ext" in
4675 '') case "$obj_ext" in
4682 '') case "$path_sep" in
4693 : Which makefile gets called first. This is used by make depend.
4694 case "$firstmakefile" in
4695 '') firstmakefile='makefile';;
4699 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4702 case "$uselongdouble" in
4703 $define|true|[yY]*) dflt='y';;
4708 Perl can be built to take advantage of long doubles which
4709 (if available) may give more accuracy and range for floating point numbers.
4711 If this doesn't make any sense to you, just accept the default '$dflt'.
4713 rp='Try to use long doubles if available?'
4716 y|Y) val="$define" ;;
4722 case "$uselongdouble" in
4723 true|[yY]*) uselongdouble="$define" ;;
4726 : Look for a hint-file generated 'call-back-unit'. If the
4727 : user has specified that long doubles should be used,
4728 : we may need to set or change some other defaults.
4729 if $test -f uselongdouble.cbu; then
4730 echo "Your platform has some specific hints regarding long doubles, using them..."
4731 . ./uselongdouble.cbu
4733 case "$uselongdouble" in
4736 (Your platform does not have any specific hints for long doubles.)
4742 : Looking for optional libraries
4744 echo "Checking for optional libraries..." >&4
4749 case "$libswanted" in
4750 '') libswanted='c_s';;
4753 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4759 for thisdir in $libpth $xlibpth; do
4760 test -d $thisdir && libspath="$libspath $thisdir"
4762 for thislib in $libswanted; do
4763 for thisdir in $libspath; do
4765 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4766 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4767 $test -f "$xxx" && eval $libscheck
4768 $test -f "$xxx" && libstyle=shared
4770 if test ! -f "$xxx"; then
4771 xxx=$thisdir/lib$thislib.$so
4772 $test -f "$xxx" && eval $libscheck
4773 $test -f "$xxx" && libstyle=shared
4775 if test ! -f "$xxx"; then
4776 xxx=$thisdir/lib$thislib$_a
4777 $test -f "$xxx" && eval $libscheck
4778 $test -f "$xxx" && libstyle=static
4780 if test ! -f "$xxx"; then
4781 xxx=$thisdir/$thislib$_a
4782 $test -f "$xxx" && eval $libscheck
4783 $test -f "$xxx" && libstyle=static
4785 if test ! -f "$xxx"; then
4786 xxx=$thisdir/lib${thislib}_s$_a
4787 $test -f "$xxx" && eval $libscheck
4788 $test -f "$xxx" && libstyle=static
4789 $test -f "$xxx" && thislib=${thislib}_s
4791 if test ! -f "$xxx"; then
4792 xxx=$thisdir/Slib$thislib$_a
4793 $test -f "$xxx" && eval $libscheck
4794 $test -f "$xxx" && libstyle=static
4796 if $test -f "$xxx"; then
4798 shared) echo "Found -l$thislib (shared)." ;;
4799 static) echo "Found -l$thislib." ;;
4800 *) echo "Found -l$thislib ($libstyle)." ;;
4804 *) dflt="$dflt -l$thislib"
4805 libsfound="$libsfound $xxx"
4807 libsfiles="$libsfiles $yyy"
4808 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4809 case " $libsdirs " in
4811 *) libsdirs="$libsdirs $yyy" ;;
4818 if $test ! -f "$xxx"; then
4819 echo "No -l$thislib."
4830 ' '|'') dflt='none';;
4835 In order to compile $package on your machine, a number of libraries
4836 are usually needed. Include any other special libraries here as well.
4837 Say "none" for none. The default list is almost always right.
4841 rp="What libraries to use?"
4848 : determine optimization, if desired, or use for debug flag also
4850 ' '|$undef) dflt='none';;
4852 *) dflt="$optimize";;
4856 By default, $package compiles with the -O flag to use the optimizer.
4857 Alternately, you might want to use the symbolic debugger, which uses
4858 the -g flag (on traditional Unix systems). Either flag can be
4859 specified here. To use neither flag, specify the word "none".
4862 rp="What optimizer/debugger flag should be used?"
4866 'none') optimize=" ";;
4869 : Check what DEBUGGING is required from the command line
4870 : -DEBUGGING or -DDEBUGGING or
4871 : -DEBUGGING=both = -g + -DDEBUGGING
4872 : -DEBUGGING=-g or -Doptimize=-g = -g
4873 : -DEBUGGING=none or -UDEBUGGING =
4874 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
4877 *) DEBUGGING=$EBUGGING ;;
4880 case "$DEBUGGING" in
4884 *) optimize="$optimize -g" ;;
4888 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
4896 case "$DEBUGGING" in
4897 both|$define) dflt='-DDEBUGGING'
4900 : We will not override a previous value, but we might want to
4901 : augment a hint file
4903 default|recommended)
4904 case "$gccversion" in
4905 1*) dflt="$dflt -fpcc-struct-return" ;;
4907 case "$optimize:$DEBUGGING" in
4908 *-g*:old) dflt="$dflt -DDEBUGGING";;
4910 case "$gccversion" in
4911 2*) if test -d /etc/conf/kconfig.d &&
4912 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4914 # Interactive Systems (ISC) POSIX mode.
4919 case "$gccversion" in
4923 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
4924 echo 'int main(void) { return 0; }' > gcctest.c
4925 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
4926 echo "Yes, it does." 2>&1
4929 echo "Leaving current flags $ccflags alone." 2>&1
4931 *) dflt="$dflt -fno-strict-aliasing" ;;
4934 echo "Nope, it doesn't, but that's ok." 2>&1
4938 # For gcc, adding -pipe speeds up compilations for some, but apparently
4939 # some assemblers can't read from stdin. (It also slows down compilations
4940 # in other cases, but those are apparently rarer these days.) AD 5/2004.
4941 case "$gccversion" in
4943 echo "Checking if your compiler accepts -pipe" 2>&1
4944 echo 'int main(void) { return 0; }' > gcctest.c
4945 if $cc -pipe -o gcctest gcctest.c; then
4946 echo "Yes, it does." 2>&1
4949 echo "Leaving current flags $ccflags alone." 2>&1
4951 *) dflt="$dflt -pipe" ;;
4954 echo "Nope, it doesn't, but that's ok." 2>&1
4957 echo "Checking if your compiler accepts -Wdeclaration-after-statement" 2>&1
4958 echo 'int main(void) { return 0; }' > gcctest.c
4959 if $cc -Wdeclaration-after-statement -o gcctest gcctest.c; then
4960 echo "Yes, it does." 2>&1
4962 *-Wdeclaration-after-statement*)
4963 echo "Leaving current flags $ccflags alone." 2>&1
4965 *) dflt="$dflt -Wdeclaration-after-statement" ;;
4968 echo "Nope, it doesn't, but that's ok." 2>&1
4975 case "$mips_type" in
4976 *BSD*|'') inclwanted="$locincpth $usrinc";;
4977 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4979 for thisincl in $inclwanted; do
4980 if $test -d $thisincl; then
4981 if $test x$thisincl != x$usrinc; then
4983 *" -I$thisincl "*);;
4984 *) dflt="$dflt -I$thisincl ";;
4990 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4992 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5000 *) dflt="$dflt -D$2";;
5004 set signal.h LANGUAGE_C; eval $inctest
5008 ccflags="$ccflags -DSOCKS"
5013 default|recommended) dflt="$ccflags $dflt" ;;
5014 *) dflt="$ccflags";;
5023 Your C compiler may want other flags. For this question you should include
5024 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5025 but you should NOT include libraries or ld flags like -lwhatever. If you
5026 want $package to honor its debug switch, you should include -DDEBUGGING here.
5027 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5029 To use no flags, specify the word "none".
5035 rp="Any additional cc flags?"
5042 : the following weeds options from ccflags that are of no interest to cpp
5044 '') cppflags="$ccflags" ;;
5045 *) cppflags="$cppflags $ccflags" ;;
5047 case "$gccversion" in
5048 1*) cppflags="$cppflags -D__GNUC__"
5050 case "$mips_type" in
5052 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5058 echo "Let me guess what the preprocessor flags are..." >&4
5072 *) ftry="$previous $flag";;
5074 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5075 >cpp1.out 2>/dev/null && \
5076 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5077 >cpp2.out 2>/dev/null && \
5078 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5079 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5081 cppflags="$cppflags $ftry"
5091 *-*) echo "They appear to be: $cppflags";;
5093 $rm -f cpp.c cpp?.out
5097 : flags used in final linking phase
5099 '') if ./venix; then
5105 *-posix*) dflt="$dflt -posix" ;;
5108 *) dflt="$ldflags";;
5111 : Try to guess additional flags to pick up local libraries.
5112 for thislibdir in $libpth; do
5113 case " $loclibpth " in
5116 *"-L$thislibdir "*) ;;
5117 *) dflt="$dflt -L$thislibdir" ;;
5129 Your C linker may need flags. For this question you should
5130 include -L/whatever and any other flags used by the C linker, but you
5131 should NOT include libraries like -lwhatever.
5133 Make sure you include the appropriate -L/path flags if your C linker
5134 does not normally search all of the directories you specified above,
5137 To use no flags, specify the word "none".
5141 rp="Any additional ld flags (NOT including libraries)?"
5147 rmlist="$rmlist pdp11"
5151 echo "Checking your choice of C compiler and flags for coherency..." >&4
5152 $cat > try.c <<'EOF'
5154 int main() { printf("Ok\n"); return(0); }
5156 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5158 $cat >try.msg <<'EOM'
5159 I've tried to compile and run the following simple program:
5162 $cat try.c >> try.msg
5164 $cat >> try.msg <<EOM
5171 and I got the following output:
5175 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5176 if $sh -c "$run ./try" >>try.msg 2>&1; then
5180 *) echo 'The program compiled OK, but produced no output.' >> try.msg
5183 cat >> try.msg <<'EOQS'
5184 If $libs contains -lsfio, and sfio is mis-configured, then it
5185 sometimes (apparently) runs and exits with a 0 status, but with no
5186 output! It may have to do with sfio's use of _exit vs. exit.
5189 rp="You have a big problem. Shall I abort Configure"
5196 echo "The program compiled OK, but exited with status $?." >>try.msg
5197 rp="You have a problem. Shall I abort Configure"
5201 echo "I can't compile the test program." >>try.msg
5202 rp="You have a BIG problem. Shall I abort Configure"
5208 case "$knowitall" in
5210 echo "(The supplied flags or libraries might be incorrect.)"
5218 *) echo "Ok. Stopping Configure." >&4
5223 n) echo "OK, that should do.";;
5225 $rm -f try try.* core
5227 : define a shorthand compile call
5231 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5232 : define a shorthand compile call for compilations that should be ok.
5236 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5238 : determine filename position in cpp output
5240 echo "Computing filename position in cpp output for #include directives..." >&4
5242 vos) testaccess=-e ;;
5245 echo '#include <stdio.h>' > foo.c
5248 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5249 $grep '^[ ]*#.*stdio\.h' | \
5250 while read cline; do
5253 while $test \$# -gt 0; do
5254 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5259 pos=\`expr \$pos + 1\`
5271 *) pos="${fieldn}th";;
5273 echo "Your cpp writes the filename in the $pos field of the line."
5276 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5277 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5280 : locate header file
5285 for usrincdir in $usrinc
5287 if test -f \$usrincdir/\$wanted; then
5288 echo "\$usrincdir/\$wanted"
5292 awkprg='{ print \$$fieldn }'
5293 echo "#include <\$wanted>" > foo\$\$.c
5294 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5295 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5296 while read cline; do
5297 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5299 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5300 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5305 # status = 0: grep returned 0 lines, case statement not executed
5306 # status = 1: headerfile found
5307 # status = 2: while loop executed, no headerfile found
5311 if test \$status -eq 1; then
5318 : define an alternate in-header-list? function
5319 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5320 cont=true; xxf="echo \"<\$1> found.\" >&4";
5321 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5322 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5324 case $# in 4) instead=instead;; *) instead="at last";; esac;
5325 while $test "$cont"; do
5327 var=$2; eval "was=\$$2";
5328 if $test "$xxx" && $test -r "$xxx";
5330 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5333 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5334 set $yyy; shift; shift; yyy=$@;
5335 case $# in 0) cont="";;
5336 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5337 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5338 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5339 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5343 do set $yyy; var=$2; eval "was=\$$2";
5344 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5345 set $yyy; shift; shift; yyy=$@;
5348 : see if stdlib is available
5349 set stdlib.h i_stdlib
5352 : check for lengths of integral types
5356 echo "Checking to see how big your integers are..." >&4
5365 printf("intsize=%d;\n", (int)sizeof(int));
5366 printf("longsize=%d;\n", (int)sizeof(long));
5367 printf("shortsize=%d;\n", (int)sizeof(short));
5372 if eval $compile_ok && $run ./try > /dev/null; then
5374 echo "Your integers are $intsize bytes long."
5375 echo "Your long integers are $longsize bytes long."
5376 echo "Your short integers are $shortsize bytes long."
5380 Help! I can't compile and run the intsize test program: please enlighten me!
5381 (This is probably a misconfiguration in your system or libraries, and
5382 you really ought to fix it. Still, I'll try anyway.)
5386 rp="What is the size of an integer (in bytes)?"
5390 rp="What is the size of a long integer (in bytes)?"
5394 rp="What is the size of a short integer (in bytes)?"
5402 : check for long long
5404 echo "Checking to see if you have long long..." >&4
5405 echo 'int main() { long long x = 7; return 0; }' > try.c
5407 if eval $compile; then
5409 echo "You have long long."
5412 echo "You do not have long long."
5418 : check for length of long long
5419 case "${d_longlong}${longlongsize}" in
5422 echo "Checking to see how big your long longs are..." >&4
5423 $cat >try.c <<'EOCP'
5427 printf("%d\n", (int)sizeof(long long));
5432 if eval $compile_ok; then
5433 longlongsize=`$run ./try`
5434 echo "Your long longs are $longlongsize bytes long."
5438 echo "(I can't seem to compile the test program. Guessing...)"
5439 rp="What is the size of a long long (in bytes)?"
5443 if $test "X$longsize" = "X$longlongsize"; then
5444 echo "(That isn't any different from an ordinary long.)"
5450 : see if inttypes.h is available
5451 : we want a real compile instead of Inhdr because some systems
5452 : have an inttypes.h which includes non-existent headers
5455 #include <inttypes.h>
5457 static int32_t foo32 = 0x12345678;
5461 if eval $compile; then
5462 echo "<inttypes.h> found." >&4
5465 echo "<inttypes.h> NOT found." >&4
5474 echo "Checking to see if you have int64_t..." >&4
5476 #include <sys/types.h>
5477 #$i_inttypes I_INTTYPES
5479 #include <inttypes.h>
5481 int main() { int64_t x = 7; }
5484 if eval $compile; then
5486 echo "You have int64_t."
5489 echo "You do not have int64_t."
5497 echo "Checking which 64-bit integer type we could use..." >&4
5503 val='"unsigned int"'
5508 *) case "$longsize" in
5512 val='"unsigned long"'
5517 *) case "$d_longlong:$longlongsize" in
5522 val='"unsigned long long"'
5527 *) case "$d_int64_t" in
5546 '') echo "Alas, no 64-bit integer types in sight." >&4
5549 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5555 case "$uselonglong" in
5556 "$define"|true|[yY]*)
5559 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5561 use64bitint="$define"
5564 case "$use64bits" in
5565 "$define"|true|[yY]*)
5568 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5570 use64bitint="$define"
5573 case "$use64bitints" in
5574 "$define"|true|[yY]*)
5577 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5579 use64bitint="$define"
5582 case "$use64bitsint" in
5583 "$define"|true|[yY]*)
5586 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5588 use64bitint="$define"
5591 case "$uselonglongs" in
5592 "$define"|true|[yY]*)
5595 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5597 use64bitint="$define"
5600 case "$use64bitsall" in
5601 "$define"|true|[yY]*)
5604 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5606 use64bitall="$define"
5611 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5613 case "$use64bitall" in
5614 "$define"|true|[yY]*) use64bitint="$define" ;;
5620 You have natively 64-bit long integers.
5624 *) case "$use64bitint" in
5625 "$define"|true|[yY]*) dflt='y';;
5634 Perl can be built to take advantage of 64-bit integer types
5635 on some systems. To do so, Configure can be run with -Duse64bitint.
5636 Choosing this option will most probably introduce binary incompatibilities.
5638 If this doesn't make any sense to you, just accept the default '$dflt'.
5639 (The default has been chosen based on your configuration.)
5641 rp='Try to use 64-bit integers, if available?'
5644 [yY]*) val="$define" ;;
5652 case "$use64bitall" in
5653 "$define"|true|[yY]*) dflt='y' ;;
5654 *) case "$longsize" in
5662 You may also choose to try maximal 64-bitness. It means using as much
5663 64-bitness as possible on the platform. This in turn means even more
5664 binary incompatibilities. On the other hand, your platform may not
5665 have any more 64-bitness available than what you already have chosen.
5667 If this doesn't make any sense to you, just accept the default '$dflt'.
5668 (The default has been chosen based on your configuration.)
5670 rp='Try to use maximal 64-bit support, if available?'
5673 [yY]*) val="$define" ;;
5678 case "$use64bitall" in
5680 case "$use64bitint" in
5684 Since you have chosen a maximally 64-bit build, I'm also turning on
5685 the use of 64-bit integers.
5687 use64bitint="$define" ;;
5692 : Look for a hint-file generated 'call-back-unit'. If the
5693 : user has specified that a 64-bit perl is to be built,
5694 : we may need to set or change some other defaults.
5695 if $test -f use64bitint.cbu; then
5696 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5699 case "$use64bitint" in
5700 "$define"|true|[yY]*)
5702 4) case "$archname64" in
5703 '') archname64=64int ;;
5710 : Look for a hint-file generated 'call-back-unit'. If the
5711 : user has specified that a maximally 64-bit perl is to be built,
5712 : we may need to set or change some other defaults.
5713 if $test -f use64bitall.cbu; then
5714 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5717 case "$use64bitall" in
5718 "$define"|true|[yY]*)
5720 4) case "$archname64" in
5721 ''|64int) archname64=64all ;;
5728 case "$d_quad:$use64bitint" in
5732 *** You have chosen to use 64-bit integers,
5733 *** but none can be found.
5734 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5735 *** Cannot continue, aborting.
5742 : check for length of double
5744 case "$doublesize" in
5746 echo "Checking to see how big your double precision numbers are..." >&4
5755 printf("%d\n", (int)sizeof(double));
5760 if eval $compile_ok; then
5761 doublesize=`$run ./try`
5762 echo "Your double is $doublesize bytes long."
5765 echo "(I can't seem to compile the test program. Guessing...)"
5766 rp="What is the size of a double precision number (in bytes)?"
5774 : check for long doubles
5776 echo "Checking to see if you have long double..." >&4
5777 echo 'int main() { long double x = 7.0; }' > try.c
5779 if eval $compile; then
5781 echo "You have long double."
5784 echo "You do not have long double."
5790 : check for length of long double
5791 case "${d_longdbl}${longdblsize}" in
5794 echo "Checking to see how big your long doubles are..." >&4
5795 $cat >try.c <<'EOCP'
5799 printf("%d\n", sizeof(long double));
5804 if eval $compile; then
5805 longdblsize=`$run ./try`
5806 echo "Your long doubles are $longdblsize bytes long."
5810 echo "(I can't seem to compile the test program. Guessing...)" >&4
5811 rp="What is the size of a long double (in bytes)?"
5815 if $test "X$doublesize" = "X$longdblsize"; then
5816 echo "That isn't any different from an ordinary double."
5817 echo "I'll keep your setting anyway, but you may see some"
5818 echo "harmless compilation warnings."
5824 : determine the architecture name
5826 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5827 tarch=`arch`"-$osname"
5828 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5829 if uname -m > tmparch 2>&1 ; then
5830 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5831 -e 's/$/'"-$osname/" tmparch`
5839 case "$myarchname" in
5842 echo "(Your architecture name used to be $myarchname.)"
5846 case "$targetarch" in
5848 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
5853 *) dflt="$archname";;
5855 rp='What is your architecture name'
5858 case "$usethreads" in
5860 echo "Threads selected." >&4
5862 *-thread*) echo "...and architecture name already has -thread." >&4
5864 *) archname="$archname-thread"
5865 echo "...setting architecture name to $archname." >&4
5870 case "$usemultiplicity" in
5872 echo "Multiplicity selected." >&4
5874 *-multi*) echo "...and architecture name already has -multi." >&4
5876 *) archname="$archname-multi"
5877 echo "...setting architecture name to $archname." >&4
5882 case "$use64bitint$use64bitall" in
5884 case "$archname64" in
5886 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
5889 case "$use64bitint" in
5890 "$define") echo "64 bit integers selected." >&4 ;;
5892 case "$use64bitall" in
5893 "$define") echo "Maximal 64 bitness selected." >&4 ;;
5896 *-$archname64*) echo "...and architecture name already has $archname64." >&4
5898 *) archname="$archname-$archname64"
5899 echo "...setting architecture name to $archname." >&4
5905 case "$uselongdouble" in
5907 echo "Long doubles selected." >&4
5908 case "$longdblsize" in
5910 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
5914 *-ld*) echo "...and architecture name already has -ld." >&4
5916 *) archname="$archname-ld"
5917 echo "...setting architecture name to $archname." >&4
5924 case "$useperlio" in
5926 echo "Perlio selected." >&4
5929 echo "Perlio not selected, using stdio." >&4
5931 *-stdio*) echo "...and architecture name already has -stdio." >&4
5933 *) archname="$archname-stdio"
5934 echo "...setting architecture name to $archname." >&4
5939 if $test -f archname.cbu; then
5940 echo "Your platform has some specific hints for architecture name, using them..."
5944 : set the prefixit variable, to compute a suitable default value
5945 prefixit='case "$3" in
5947 case "$oldprefix" in
5948 "") eval "$1=\"\$$2\"";;
5955 ""|" ") eval "$1=\"\$$2\"";;
5961 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
5963 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
5964 /*-$oldprefix/*|\~*-$oldprefix/*)
5965 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
5966 *) eval "$1=\"\$$2\"";;
5970 : get the patchlevel
5972 echo "Getting the current patchlevel..." >&4
5973 if $test -r $rsrc/patchlevel.h;then
5974 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
5975 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
5976 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5977 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
5978 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
5979 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5980 perl_patchlevel=`egrep 'define PERL_PATCHNUM [0-9][0-9]|,"MAINT[0-9][0-9]*"' $rsrc/patchlevel.h|sed 's/[^0-9]//g'`
5989 $echo "(You do not have patchlevel.h. Eek.)"
5991 if $test -r $rsrc/.patch ; then
5992 if $test "X$perl_patchlevel" = "X" || $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
5993 perl_patchlevel=`cat $rsrc/.patch`
5996 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
5997 version_patchlevel_string="version $patchlevel subversion $subversion"
5998 case "$perl_patchlevel" in
6000 *) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;;
6003 $echo "(You have $package $version_patchlevel_string.)"
6007 : XXX Should be a Configure test for double-dots in filenames.
6008 version=`echo $revision $patchlevel $subversion | \
6009 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
6010 api_versionstring=`echo $api_revision $api_version $api_subversion | \
6011 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
6014 version=`echo $revision $patchlevel $subversion | \
6015 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
6016 api_versionstring=`echo $api_revision $api_version $api_subversion | \
6017 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
6020 : Special case the 5.005_xx maintenance series, which used 5.005
6021 : without any subversion label as a subdirectory in $sitelib
6022 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
6023 api_versionstring='5.005'
6026 : determine installation style
6027 : For now, try to deduce it from prefix unless it is already set.
6028 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6029 case "$installstyle" in
6030 '') case "$prefix" in
6031 *perl*) dflt='lib';;
6032 *) dflt='lib/perl5' ;;
6035 *) dflt="$installstyle" ;;
6037 : Probably not worth prompting for this since we prompt for all
6038 : the directories individually, and the prompt would be too long and
6042 : determine where public executables go
6047 rp='Pathname where the public executables will reside?'
6049 if $test "X$ansexp" != "X$binexp"; then
6053 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6054 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
6055 : this via initialinstalllocation
6058 case "$userelocatableinc" in
6059 $define|true|[yY]*) dflt='y' ;;
6064 Would you like to build Perl so that the installation is relocatable, so that
6065 library paths in @INC are determined relative to the path of the perl binary?
6066 This is not advised for system Perl installs, or if you need to run setid
6067 scripts or scripts under taint mode.
6069 If this doesn't make any sense to you, just accept the default '$dflt'.
6071 rp='Use relocatable @INC?'
6074 y|Y) val="$define" ;;
6077 set userelocatableinc
6080 initialinstalllocation="$binexp"
6081 : Default prefix is now "up one level from where the binaries are"
6082 case "$userelocatableinc" in
6088 installprefixexp=".../.."
6092 : determine where private library files go
6093 : Usual default is /usr/local/lib/perl5/$version.
6094 : Also allow things like /opt/perl/lib/$version, since
6095 : /opt/perl/lib/perl5... would be redundant.
6096 : The default "style" setting is made in installstyle.U
6097 case "$installstyle" in
6098 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6099 *) set dflt privlib lib/$version ;;
6104 There are some auxiliary files for $package that need to be put into a
6105 private library directory that is accessible by everyone.
6110 rp='Pathname where the private library files will reside?'
6115 : set the prefixup variable, to restore leading tilda escape
6116 prefixup='case "$prefixexp" in
6118 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6121 : determine where public architecture dependent libraries go
6124 : privlib default is /usr/local/lib/$package/$version
6125 : archlib default is /usr/local/lib/$package/$version/$archname
6126 : privlib may have an optional trailing /share.
6127 tdflt=`echo $privlib | $sed 's,/share$,,'`
6128 tdflt=$tdflt/$archname
6137 $spackage contains architecture-dependent library files. If you are
6138 sharing libraries in a heterogeneous environment, you might store
6139 these files in a separate location. Otherwise, you can just include
6140 them with the rest of the public library files.
6145 rp='Where do you want to put the public architecture-dependent libraries?'
6149 if $test X"$archlib" = X"$privlib"; then
6155 : see if setuid scripts can be secure
6158 Some kernels have a bug that prevents setuid #! scripts from being
6159 secure. Some sites have disabled setuid #! scripts because of this.
6161 First let's decide if your kernel supports secure setuid #! scripts.
6162 (If setuid #! scripts would be secure but have been disabled anyway,
6163 don't say that they are secure if asked.)
6168 if $test -d /dev/fd; then
6169 echo "#!$ls" >reflect
6170 chmod +x,u+s reflect
6171 ./reflect >flect 2>&1
6172 if $contains "/dev/fd" flect >/dev/null; then
6173 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6177 If you are not sure if they are secure, I can check but I'll need a
6178 username and password different from the one you are using right now.
6179 If you don't have such a username or don't want me to test, simply
6183 rp='Other username to test security of setuid scripts with?'
6188 case "$d_suidsafe" in
6189 '') echo "I'll assume setuid scripts are *not* secure." >&4
6192 echo "Well, the $hint value is *not* secure." >&4
6194 *) echo "Well, the $hint value *is* secure." >&4
6199 $rm -f reflect flect
6200 echo "#!$ls" >reflect
6201 chmod +x,u+s reflect
6204 echo '"su" will (probably) prompt you for '"$ans's password."
6205 su $ans -c './reflect >flect'
6206 if $contains "/dev/fd" flect >/dev/null; then
6207 echo "Okay, it looks like setuid scripts are secure." >&4
6210 echo "I don't think setuid scripts are secure." >&4
6215 rp='Does your kernel have *secure* setuid scripts?'
6218 [yY]*) val="$define";;
6223 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6224 echo "(That's for file descriptors, not floppy disks.)"
6230 $rm -f reflect flect
6232 : now see if they want to do setuid emulation
6235 case "$d_suidsafe" in
6238 echo "No need to emulate SUID scripts since they are secure here." >&4
6242 Some systems have disabled setuid scripts, especially systems where
6243 setuid scripts cannot be secure. On systems where setuid scripts have
6244 been disabled, the setuid/setgid bits on scripts are currently
6245 useless. It is possible for $package to detect those bits and emulate
6246 setuid/setgid in a secure fashion. This emulation will only work if
6247 setuid scripts have been disabled in your kernel.
6251 "$define") dflt=y ;;
6254 rp="Do you want to do setuid/setgid emulation?"
6257 [yY]*) val="$define";;
6265 : Find perl5.005 or later.
6266 echo "Looking for a previously installed perl5.005 or later... "
6268 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6269 : Check if this perl is recent and can load a simple module
6270 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6273 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6283 '') echo "None found. That's ok.";;
6284 *) echo "Using $perl5." ;;
6289 After $package is installed, you may wish to install various
6290 add-on modules and utilities. Typically, these add-ons will
6291 be installed under $prefix with the rest
6292 of this package. However, you may wish to install such add-ons
6293 elsewhere under a different prefix.
6295 If you do not wish to put everything under a single prefix, that's
6296 ok. You will be prompted for the individual locations; this siteprefix
6297 is only used to suggest the defaults.
6299 The default should be fine for most people.
6303 rp='Installation prefix to use for add-on modules and utilities?'
6304 : XXX Here might be another good place for an installstyle setting.
6305 case "$siteprefix" in
6307 *) dflt=$siteprefix ;;
6310 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6312 case "$siteprefix" in
6316 *) oldsiteprefix="$prefix";;
6321 siteprefixexp="$ansexp"
6323 : determine where site specific libraries go.
6324 : Usual default is /usr/local/lib/perl5/site_perl/$version
6325 : The default "style" setting is made in installstyle.U
6326 : XXX No longer works with Prefixit stuff.
6327 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6329 '') case "$installstyle" in
6330 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6331 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6339 The installation process will create a directory for
6340 site-specific extensions and modules. Most users find it convenient
6341 to place all site-specific files in this directory rather than in the
6342 main distribution directory.
6346 rp='Pathname for the site-specific library files?'
6350 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6352 : Determine list of previous versions to include in @INC
6353 $cat > getverlist <<EOPL
6356 \$api_versionstring = "$api_versionstring";
6357 \$version = "$version";
6358 \$stem = "$sitelib_stem";
6359 \$archname = "$archname";
6361 $cat >> getverlist <<'EOPL'
6362 # Can't have leading @ because metaconfig interprets it as a command!
6363 ;@inc_version_list=();
6364 # XXX Redo to do opendir/readdir?
6367 ;@candidates = glob("5.*");
6373 # XXX ToDo: These comparisons must be reworked when two-digit
6374 # subversions come along, so that 5.7.10 compares as greater than
6375 # 5.7.3! By that time, hope that 5.6.x is sufficiently
6376 # widespread that we can use the built-in version vectors rather
6377 # than reinventing them here. For 5.6.0, however, we must
6378 # assume this script will likely be run by 5.005_0x. --AD 1/2000.
6379 foreach $d (@candidates) {
6380 if ($d lt $version) {
6381 if ($d ge $api_versionstring) {
6382 unshift(@inc_version_list, grep { -d } "$d/$archname", $d);
6384 elsif ($d ge "5.005") {
6385 unshift(@inc_version_list, grep { -d } $d);
6389 # Skip newer version. I.e. don't look in
6390 # 5.7.0 if we're installing 5.6.1.
6394 if (@inc_version_list) {
6395 print join(' ', @inc_version_list);
6398 # Blank space to preserve value for next Configure run.
6403 case "$inc_version_list" in
6404 '') if test -x "$perl5$exe_ext"; then
6405 dflt=`$perl5 getverlist`
6410 $undef) dflt='none' ;;
6411 *) eval dflt=\"$inc_version_list\" ;;
6414 ''|' ') dflt=none ;;
6421 In order to ease the process of upgrading, this version of perl
6422 can be configured to use modules built and installed with earlier
6423 versions of perl that were installed under $prefix. Specify here
6424 the list of earlier versions that this version of perl should check.
6425 If Configure detected no earlier versions of perl installed under
6426 $prefix, then the list will be empty. Answer 'none' to tell perl
6427 to not search earlier versions.
6429 The default should almost always be sensible, so if you're not sure,
6430 just accept the default.
6433 rp='List of earlier versions to include in @INC?'
6436 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6437 *) inc_version_list="$ans" ;;
6439 case "$inc_version_list" in
6441 inc_version_list_init='0'
6442 d_inc_version_list="$undef"
6444 *) inc_version_list_init=`echo $inc_version_list |
6445 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6446 d_inc_version_list="$define"
6451 : see if this is a malloc.h system
6452 : we want a real compile instead of Inhdr because some systems have a
6453 : malloc.h that just gives a compile error saying to use stdlib.h instead
6458 int main () { return 0; }
6461 if eval $compile; then
6462 echo "<malloc.h> found." >&4
6465 echo "<malloc.h> NOT found." >&4
6472 : check for void type
6474 echo "Checking to see how well your C compiler groks the void type..." >&4
6475 case "$voidflags" in
6487 extern void moo(); /* function returning void */
6488 void (*goo)(); /* ptr to func returning void */
6490 void *hue; /* generic ptr */
6503 int main() { sub(); }
6505 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6506 voidflags=$defvoidused
6507 echo "Good. It appears to support void to the level $package wants.">&4
6508 if $contains warning .out >/dev/null 2>&1; then
6509 echo "However, you might get some warnings that look like this:"
6513 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6514 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6515 echo "It supports 1..."
6516 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6517 echo "It also supports 2..."
6518 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6520 echo "And it supports 4 but not 8 definitely."
6522 echo "It doesn't support 4..."
6523 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6525 echo "But it supports 8."
6528 echo "Neither does it support 8."
6532 echo "It does not support 2..."
6533 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6535 echo "But it supports 4 and 8."
6537 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6539 echo "And it supports 4 but has not heard about 8."
6541 echo "However it supports 8 but not 4."
6546 echo "There is no support at all for void."
6551 case "$voidflags" in
6554 Support flag bits are:
6555 1: basic void declarations.
6556 2: arrays of pointers to functions returning void.
6557 4: operations between pointers to and addresses of void functions.
6558 8: generic void pointers.
6561 rp="Your void support flags add up to what?"
6568 : check for length of pointer
6572 echo "Checking to see how big your pointers are..." >&4
6573 if test "$voidflags" -gt 7; then
6574 echo '#define VOID_PTR char *' > try.c
6576 echo '#define VOID_PTR void *' > try.c
6586 printf("%d\n", (int)sizeof(VOID_PTR));
6591 if eval $compile_ok; then
6592 ptrsize=`$run ./try`
6593 echo "Your pointers are $ptrsize bytes long."
6596 echo "(I can't seem to compile the test program. Guessing...)" >&4
6597 rp="What is the size of a pointer (in bytes)?"
6604 case "$use64bitall" in
6605 "$define"|true|[yY]*)
6609 *** You have chosen a maximally 64-bit build,
6610 *** but your pointers are only 4 bytes wide.
6611 *** Please rerun Configure without -Duse64bitall.
6616 *** Since you have quads, you could possibly try with -Duse64bitint.
6621 *** Cannot continue, aborting.
6632 : determine whether to use malloc wrapping
6634 case "$usemallocwrap" in
6635 [yY]*|true|$define) dflt='y' ;;
6636 [nN]*|false|$undef) dflt='n' ;;
6637 *) case "$usedevel" in
6638 [yY]*|true|$define) dflt='y' ;;
6643 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6645 usemallocwrap="$ans"
6648 usemallocwrap="$define" ;;
6650 usemallocwrap="$undef" ;;
6653 : determine which malloc to compile in
6655 case "$usemymalloc" in
6656 [yY]*|true|$define) dflt='y' ;;
6657 [nN]*|false|$undef) dflt='n' ;;
6658 *) case "$ptrsize" in
6664 rp="Do you wish to attempt to use the malloc that comes with $package?"
6670 mallocsrc='malloc.c'
6671 mallocobj="malloc$_o"
6672 d_mymalloc="$define"
6675 : Remove malloc from list of libraries to use
6676 echo "Removing unneeded -lmalloc from library list" >&4
6677 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6680 echo "libs = $libs" >&4
6692 : compute the return types of malloc and free
6694 $cat >malloc.c <<END
6698 #include <sys/types.h>
6712 case "$malloctype" in
6714 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6721 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6725 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6732 echo "Your system uses $freetype free(), it would seem." >&4
6734 : determine where site specific architecture-dependent libraries go.
6735 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6736 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6737 : sitelib may have an optional trailing /share.
6739 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6740 dflt="$dflt/$archname"
6745 set sitearch sitearch none
6749 The installation process will also create a directory for
6750 architecture-dependent site-specific extensions and modules.
6754 rp='Pathname for the site-specific architecture-dependent library files?'
6758 if $test X"$sitearch" = X"$sitelib"; then
6761 d_sitearch="$define"
6766 The installation process will also create a directory for
6767 vendor-supplied add-ons. Vendors who supply perl with their system
6768 may find it convenient to place all vendor-supplied files in this
6769 directory rather than in the main distribution directory. This will
6770 ease upgrades between binary-compatible maintenance versions of perl.
6772 Of course you may also use these directories in whatever way you see
6773 fit. For example, you might use them to access modules shared over a
6774 company-wide network.
6776 The default answer should be fine for most people.
6777 This causes further questions about vendor add-ons to be skipped
6778 and no vendor-specific directories will be configured for perl.
6781 rp='Do you want to configure vendor-specific add-on directories?'
6782 case "$usevendorprefix" in
6783 define|true|[yY]*) dflt=y ;;
6784 *) : User may have set vendorprefix directly on Configure command line.
6785 case "$vendorprefix" in
6794 rp='Installation prefix to use for vendor-supplied add-ons?'
6795 case "$vendorprefix" in
6797 *) dflt=$vendorprefix ;;
6800 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6802 case "$vendorprefix" in
6806 *) oldvendorprefix="$prefix";;
6810 usevendorprefix="$define"
6812 vendorprefixexp="$ansexp"
6814 *) usevendorprefix="$undef"
6820 case "$vendorprefix" in
6821 '') d_vendorlib="$undef"
6825 *) d_vendorlib="$define"
6826 : determine where vendor-supplied modules go.
6827 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6828 case "$vendorlib" in
6830 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6831 case "$installstyle" in
6832 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6833 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6836 *) dflt="$vendorlib"
6840 rp='Pathname for the vendor-supplied library files?'
6843 vendorlibexp="$ansexp"
6846 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6850 case "$vendorprefix" in
6851 '') d_vendorarch="$undef"
6855 *) d_vendorarch="$define"
6856 : determine where vendor-supplied architecture-dependent libraries go.
6857 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6858 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6859 : vendorlib may have an optional trailing /share.
6860 case "$vendorarch" in
6861 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6862 dflt="$dflt/$archname"
6864 *) dflt="$vendorarch" ;;
6867 rp='Pathname for vendor-supplied architecture-dependent files?'
6870 vendorarchexp="$ansexp"
6873 prefixvar=vendorarch
6876 : Final catch-all directories to search
6879 Lastly, you can have perl look in other directories for extensions and
6880 modules in addition to those already specified.
6881 These directories will be searched after
6885 test X"$vendorlib" != "X" && echo ' ' $vendorlib
6886 test X"$vendorarch" != "X" && echo ' ' $vendorarch
6888 case "$otherlibdirs" in
6889 ''|' ') dflt='none' ;;
6890 *) dflt="$otherlibdirs" ;;
6893 Enter a colon-separated set of extra paths to include in perl's @INC
6894 search path, or enter 'none' for no extra paths.
6898 rp='Colon-separated list of additional directories for perl to search?'
6901 ' '|''|none) otherlibdirs=' ' ;;
6902 *) otherlibdirs="$ans" ;;
6904 case "$otherlibdirs" in
6908 set d_perl_otherlibdirs
6911 : Cruising for prototypes
6913 echo "Checking out function prototypes..." >&4
6914 $cat >prototype.c <<EOCP
6919 int main(int argc, char *argv[]) {
6922 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
6923 echo "Your C compiler appears to support function prototypes."
6926 echo "Your C compiler doesn't seem to understand function prototypes."
6933 case "$prototype" in
6935 *) ansi2knr='ansi2knr'
6940 This version of $package can only be compiled by a compiler that
6941 understands function prototypes. Unfortunately, your C compiler
6943 doesn't seem to understand them. Sorry about that.
6945 If GNU cc is available for your system, perhaps you could try that instead.
6947 Eventually, we hope to support building Perl with pre-ANSI compilers.
6948 If you would like to help in that effort, please contact <perlbug@perl.org>.
6950 Aborting Configure now.
6962 Perl can be built with extra modules or bundles of modules which
6963 will be fetched from the CPAN and installed alongside Perl.
6965 Notice that you will need access to the CPAN; either via the Internet,
6966 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
6967 be asked later to configure the CPAN.pm module which will in turn do
6968 the installation of the rest of the extra modules or bundles.)
6970 Notice also that if the modules require any external software such as
6971 libraries and headers (the libz library and the zlib.h header for the
6972 Compress::Zlib module, for example) you MUST have any such software
6973 already installed, this configuration process will NOT install such
6976 If this doesn't make any sense to you, just accept the default '$dflt'.
6978 rp='Install any extra modules (y or n)?'
6984 Please list any extra modules or bundles to be installed from CPAN,
6985 with spaces between the names. The names can be in any format the
6986 'install' command of CPAN.pm will understand. (Answer 'none',
6987 without the quotes, to install no extra modules or bundles.)
6997 $rm -f ../extras.lst
6999 *) echo "(Saving the list of extras for later...)"
7000 echo "$extras" > ../extras.lst
7008 : determine where html pages for programs go
7009 set html1dir html1dir none
7013 If you wish to install html files for programs in $spackage, indicate
7014 the appropriate directory here. To skip installing html files,
7018 ''|none|$undef|' ') dflt=none ;;
7019 *) dflt=$html1dir ;;
7022 rp="Directory for the main $spackage html pages?"
7026 : Use ' ' for none so value is preserved next time through Configure
7027 $test X"$html1dir" = "X" && html1dir=' '
7029 : determine where html pages for libraries and modules go
7030 set html3dir html3dir none
7034 If you wish to install html files for modules associated with $spackage,
7035 indicate the appropriate directory here. To skip installing html files,
7038 : There is no obvious default. If they have specified html1dir, then
7039 : try to key off that, possibly changing .../html1 into .../html3.
7041 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7042 *) dflt=$html3dir ;;
7045 rp="Directory for the $spackage module html pages?"
7049 : Use ' ' for none so value is preserved next time through Configure
7050 $test X"$html3dir" = "X" && html3dir=' '
7052 : determine whether to install perl also as /usr/bin/perl
7055 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7057 Many scripts expect perl to be installed as /usr/bin/perl.
7059 If you want to, I can install the perl you are about to compile
7060 as /usr/bin/perl (in addition to $bin/perl).
7062 if test -f /usr/bin/perl; then
7065 However, please note that because you already have a /usr/bin/perl,
7066 overwriting that with a new Perl would very probably cause problems.
7067 Therefore I'm assuming you don't want to do that (unless you insist).
7070 case "$installusrbinperl" in
7071 "$define"|[yY]*) dflt='y';;
7077 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7080 case "$installusrbinperl" in
7081 "$undef"|[nN]*) dflt='n';;
7085 rp="Do you want to install perl as /usr/bin/perl?"
7088 [yY]*) val="$define";;
7094 set installusrbinperl
7098 echo "Checking for GNU C Library..." >&4
7100 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7101 alone are insufficient to distinguish different versions, such as
7102 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7103 libc version 2.1.0. A. Dougherty, June 3, 2002.
7109 # ifdef __GLIBC_MINOR__
7110 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
7111 # include <gnu/libc-version.h>
7112 printf("%s\n", gnu_get_libc_version());
7114 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7117 printf("%d\n", __GLIBC__);
7126 if eval $compile_ok && $run ./try > glibc.ver; then
7128 gnulibc_version=`$cat glibc.ver`
7129 echo "You are using the GNU C Library version $gnulibc_version"
7133 echo "You are not using the GNU C Library"
7135 $rm -f try try.* glibc.ver
7139 : see if nm is to be used to determine whether a symbol is defined or not
7143 case "$d_gnulibc" in
7146 echo "nm probably won't work on the GNU C Library." >&4
7152 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7154 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7155 echo "'nm' won't be sufficient on this sytem." >&4
7161 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7162 if $test $dflt -gt 20; then
7172 true|$define) dflt=y;;
7179 I can use $nm to extract the symbols from your C libraries. This
7180 is a time consuming task which may generate huge output on the disk (up
7181 to 3 megabytes) but that should make the symbols extraction faster. The
7182 alternative is to skip the 'nm' extraction part and to compile a small
7183 test program instead to determine whether each symbol is present. If
7184 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7185 this may be the best solution.
7187 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7190 rp="Shall I use $nm to extract C symbols from the libraries?"
7193 [Nn]*) usenm=false;;
7202 : nm options which may be necessary
7204 '') if $test -f /mach_boot; then
7206 elif $test -d /usr/ccs/lib; then
7207 nm_opt='-p' # Solaris (and SunOS?)
7208 elif $test -f /dgux; then
7210 elif $test -f /lib64/rld; then
7211 nm_opt='-p' # 64-bit Irix
7217 : nm options which may be necessary for shared libraries but illegal
7218 : for archive libraries. Thank you, Linux.
7219 case "$nm_so_opt" in
7220 '') case "$myuname" in
7222 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7223 nm_so_opt='--dynamic'
7232 : get list of predefined functions in a handy place
7237 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7243 *) for thislib in $libs; do
7246 : Handle C library specially below.
7249 thislib=`echo $thislib | $sed -e 's/^-l//'`
7250 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7252 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7254 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7256 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7258 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7260 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7262 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7267 libnames="$libnames $try"
7269 *) libnames="$libnames $thislib" ;;
7278 for xxx in $libpth; do
7279 $test -r $1 || set $xxx/libc.$so
7280 : The messy sed command sorts on library version numbers.
7282 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7283 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7285 s/[0-9][0-9]*/0000&/g
7286 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7289 $sort | $sed -e 's/^.* //'`
7292 $test -r $1 || set /usr/ccs/lib/libc.$so
7293 $test -r $1 || set /lib/libsys_s$_a
7299 if $test -r "$1"; then
7300 echo "Your (shared) C library seems to be in $1."
7302 elif $test -r /lib/libc && $test -r /lib/clib; then
7303 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7305 libc='/lib/clib /lib/libc'
7306 if $test -r /lib/syslib; then
7307 echo "(Your math library is in /lib/syslib.)"
7308 libc="$libc /lib/syslib"
7310 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7311 echo "Your C library seems to be in $libc, as you said before."
7312 elif $test -r $incpath/usr/lib/libc$_a; then
7313 libc=$incpath/usr/lib/libc$_a;
7314 echo "Your C library seems to be in $libc. That's fine."
7315 elif $test -r /lib/libc$_a; then
7317 echo "Your C library seems to be in $libc. You're normal."
7319 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7321 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7322 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7323 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7325 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7327 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7330 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7332 if $test -r "$tans"; then
7333 echo "Your C library seems to be in $tans, of all places."
7339 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7343 If the guess above is wrong (which it might be if you're using a strange
7344 compiler, or your machine supports multiple models), you can override it here.
7349 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7351 I can't seem to find your C library. I've looked in the following places:
7354 $sed 's/^/ /' libpath
7357 None of these seems to contain your C library. I need to get its name...
7362 rp='Where is your C library?'
7367 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7368 set X `cat libnames`
7371 case $# in 1) xxx=file; esac
7372 echo "Extracting names from the following $xxx for later perusal:" >&4
7374 $sed 's/^/ /' libnames >&4
7376 $echo $n "This may take a while...$c" >&4
7380 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7381 *) $nm $nm_opt $file 2>/dev/null;;
7386 $grep fprintf libc.tmp > libc.ptf
7387 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7388 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7390 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7392 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7394 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7396 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7398 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7400 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7402 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7404 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7406 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7408 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7410 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7412 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7414 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7415 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7417 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7419 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7421 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7423 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7425 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7427 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7429 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7431 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7433 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7435 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7437 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7439 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7441 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7443 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7445 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7448 $nm -p $* 2>/dev/null >libc.tmp
7449 $grep fprintf libc.tmp > libc.ptf
7450 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7451 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7457 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7459 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
7460 for thisname in $libnames $libc; do
7461 $ar t $thisname >>libc.tmp
7463 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7465 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7466 # Repeat libc to extract forwarders to DLL entries too
7467 for thisname in $libnames $libc; do
7468 $ar tv $thisname >>libc.tmp
7469 # Revision 50 of EMX has bug in $ar.
7470 # it will not extract forwarders to DLL entries
7471 # Use emximp which will extract exactly them.
7472 emximp -o tmp.imp $thisname \
7474 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7475 < tmp.imp >>libc.tmp
7478 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7481 echo "$ar didn't seem to work right." >&4
7482 echo "Maybe this is a Cray...trying bld instead..." >&4
7483 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
7485 for thisname in $libnames; do
7487 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7488 $ar t $thisname >>libc.tmp
7492 echo "That didn't work either. Giving up." >&4
7502 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7503 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7505 *) if $test -f /lib/syscalls.exp; then
7507 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7508 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' /lib/syscalls.exp >>libc.list
7514 $rm -f libnames libpath
7516 : see if dld is available
7520 : is a C symbol defined?
7523 -v) tf=libc.tmp; tdc="";;
7524 -a) tf=libc.tmp; tdc="[]";;
7525 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7528 case "$reuseval-$4" in
7530 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7535 if $test "$runnm" = true; then
7536 if $contains $tlook $tf >/dev/null 2>&1; then
7538 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7539 echo "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7540 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7541 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7542 $rm -f try$_exe try.c core core.* try.core;
7545 echo "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7546 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7547 $rm -f try$_exe try.c;
7552 $define) tval=true;;
7559 : define an is-in-libc? function
7560 inlibc='echo " "; td=$define; tu=$undef;
7561 sym=$1; var=$2; eval "was=\$$2";
7563 case "$reuseval$was" in
7573 echo "$sym() found." >&4;
7574 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7576 echo "$sym() NOT found." >&4;
7577 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7581 $define) echo "$sym() found." >&4;;
7582 *) echo "$sym() NOT found." >&4;;
7586 : see if dlopen exists
7593 : determine which dynamic loading, if any, to compile in
7595 dldir="ext/DynaLoader"
7608 $define) dflt='y' ;;
7611 $define) dflt='y' ;;
7613 : Does a dl_xxx.xs file exist for this operating system
7614 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7617 rp="Do you wish to use dynamic loading?"
7624 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7625 dflt="$dldir/dl_${osname}.xs"
7626 elif $test "$d_dlopen" = "$define" ; then
7627 dflt="$dldir/dl_dlopen.xs"
7628 elif $test "$i_dld" = "$define" ; then
7629 dflt="$dldir/dl_dld.xs"
7634 *) dflt="$dldir/$dlsrc"
7637 echo "The following dynamic loading files are available:"
7638 : Can not go over to $dldir because getfile has path hard-coded in.
7639 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7640 rp="Source file to use for dynamic loading"
7646 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7650 Some systems may require passing special flags to $cc -c to
7651 compile modules that will be used to create a shared library.
7652 To use no flags, say "none".
7655 case "$cccdlflags" in
7656 '') case "$gccversion" in
7657 '') case "$osname" in
7659 next) dflt='none' ;;
7660 irix*) dflt='-KPIC' ;;
7661 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7662 sunos) dflt='-pic' ;;
7666 *) case "$osname" in
7667 darwin) dflt='none' ;;
7668 svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7673 *) dflt="$cccdlflags" ;;
7675 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7678 none) cccdlflags=' ' ;;
7679 *) cccdlflags="$ans" ;;
7684 Some systems use ld to create libraries that can be dynamically loaded,
7685 while other systems (such as those using ELF) use $cc.
7689 '') $cat >try.c <<EOM
7690 /* Test for whether ELF binaries are produced */
7698 int i = open("a.out",O_RDONLY);
7701 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7702 exit(0); /* succeed (yes, it's ELF) */
7707 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7709 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7713 echo "I'll use ld to build dynamic libraries."
7722 rp="What command should be used to create dynamic libraries?"
7728 Some systems may require passing special flags to $ld to create a
7729 library that can be dynamically loaded. If your ld flags include
7730 -L/other/path options to locate libraries outside your loader's normal
7731 search path, you may need to specify those -L options here as well. To
7732 use no flags, say "none".
7735 case "$lddlflags" in
7736 '') case "$osname" in
7737 beos) dflt='-nostart' ;;
7739 case "$gccversion" in
7740 '') dflt="$dflt +vnocompatwarnings" ;;
7743 linux|irix*|gnu*) dflt='-shared' ;;
7744 next) dflt='none' ;;
7745 solaris) dflt='-G' ;;
7746 sunos) dflt='-assert nodefinitions' ;;
7747 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
7751 *) dflt="$lddlflags" ;;
7754 : Try to guess additional flags to pick up local libraries.
7755 : Be careful not to append to a plain 'none'
7759 for thisflag in $ldflags; do
7764 *) dflt="$dflt $thisflag" ;;
7771 ''|' ') dflt='none' ;;
7774 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
7777 none) lddlflags=' ' ;;
7778 *) lddlflags="$ans" ;;
7783 Some systems may require passing special flags to $cc to indicate that
7784 the resulting executable will use dynamic linking. To use no flags,
7788 case "$ccdlflags" in
7789 '') case "$osname" in
7790 linux|hpux|gnu*) dflt='-Wl,-E' ;;
7791 next|sunos) dflt='none' ;;
7795 *) dflt="$ccdlflags" ;;
7797 rp="Any special flags to pass to $cc to use dynamic linking?"
7800 none) ccdlflags=' ' ;;
7801 *) ccdlflags="$ans" ;;
7815 # No dynamic loading being used, so don't bother even to prompt.
7818 *) case "$useshrplib" in
7819 '') case "$osname" in
7820 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
7822 also='Building a shared libperl is required for dynamic loading to work on your system.'
7827 also='Building a shared libperl is needed for MAB support.'
7845 The perl executable is normally obtained by linking perlmain.c with
7846 libperl${_a}, any static extensions (usually just DynaLoader), and
7847 any other libraries needed on this system (such as -lm, etc.). Since
7848 your system supports dynamic loading, it is probably possible to build
7849 a shared libperl.$so. If you will have more than one executable linked
7850 to libperl.$so, this will significantly reduce the size of each
7851 executable, but it may have a noticeable effect on performance. The
7852 default is probably sensible for your system.
7856 rp="Build a shared libperl.$so (y/n)"
7860 useshrplib='true' ;;
7861 *) useshrplib='false' ;;
7866 case "$useshrplib" in
7870 # Figure out a good name for libperl.so. Since it gets stored in
7871 # a version-specific architecture-dependent library, the version
7872 # number isn't really that important, except for making cc/ld happy.
7874 # A name such as libperl.so.3.1
7875 majmin="libperl.$so.$patchlevel.$subversion"
7876 # A name such as libperl.so.301
7877 majonly=`echo $patchlevel $subversion |
7878 $awk '{printf "%d%02d", $1, $2}'`
7879 majonly=libperl.$so.$majonly
7880 # I'd prefer to keep the os-specific stuff here to a minimum, and
7881 # rely on figuring it out from the naming of libc.
7882 case "${osname}${osvers}" in
7885 # XXX How handle the --version stuff for MAB?
7887 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
7890 cygwin*) # ld links against an importlib
7891 dflt=libperl$lib_ext
7893 *) # Try to guess based on whether libc has major.minor.
7895 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
7896 *libc.$so.[0-9]*) dflt=$majonly ;;
7897 *) dflt=libperl.$so ;;
7907 I need to select a good name for the shared libperl. If your system uses
7908 library names with major and minor numbers, then you might want something
7909 like $majmin. Alternatively, if your system uses a single version
7910 number for shared libraries, then you might want to use $majonly.
7911 Or, your system might be quite happy with a simple libperl.$so.
7913 Since the shared libperl will get installed into a version-specific
7914 architecture-dependent directory, the version number of the shared perl
7915 library probably isn't important, so the default should be o.k.
7918 rp='What name do you want to give to the shared libperl?'
7921 echo "Ok, I'll use $libperl"
7924 libperl="libperl${_a}"
7928 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
7932 WARNING: Use of the shrpdir variable for the installation location of
7933 the shared $libperl is not supported. It was never documented and
7934 will not work in this version. Let me (perlbug@perl.org)
7935 know of any problems this may cause.
7941 But your current setting of $shrpdir is
7942 the default anyway, so it's harmless.
7947 Further, your current attempted setting of $shrpdir
7948 conflicts with the value of $archlibexp/CORE
7949 that installperl will use.
7956 # How will the perl executable find the installed shared $libperl?
7957 # Add $xxx to ccdlflags.
7958 # If we can't figure out a command-line option, use $shrpenv to
7959 # set env LD_RUN_PATH. The main perl makefile uses this.
7960 shrpdir=$archlibexp/CORE
7963 if "$useshrplib"; then
7966 # We'll set it in Makefile.SH...
7971 freebsd|netbsd|openbsd|interix|dragonfly)
7972 xxx="-Wl,-R$shrpdir"
7974 bsdos|linux|irix*|dec_osf|gnu*)
7975 xxx="-Wl,-rpath,$shrpdir"
7978 # next doesn't like the default...
7981 # beos doesn't like the default, either.
7984 # hpux doesn't like the default, either.
7985 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
7988 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
7994 # Only add $xxx if it isn't already in ccdlflags.
7995 case " $ccdlflags " in
7997 *) ccdlflags="$ccdlflags $xxx"
8000 Adding $xxx to the flags
8001 passed to $ld so that the perl executable will find the
8002 installed shared $libperl.
8010 # Fix ccdlflags in AIX for building external extensions.
8011 # (For building Perl itself bare -bE:perl.exp is needed,
8012 # Makefile.SH takes care of this.)
8014 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8016 # Respect a hint or command-line value.
8018 '') shrpenv="$tmp_shrpenv" ;;
8020 case "$ldlibpthname" in
8021 '') ldlibpthname=LD_LIBRARY_PATH ;;
8022 none) ldlibpthname='' ;;
8025 : determine where manual pages are on this system
8029 syspath='/usr/share/man/man1 /usr/man/man1'
8030 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8031 syspath="$syspath /usr/man/u_man/man1"
8032 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8033 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8034 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8035 sysman=`./loc . /usr/man/man1 $syspath`
8038 if $test -d "$sysman"; then
8039 echo "System manual is in $sysman." >&4
8041 echo "Could not find manual pages in source form." >&4
8044 : determine where manual pages go
8045 set man1dir man1dir none
8049 $spackage has manual pages available in source form.
8053 echo "However, you don't have nroff, so they're probably useless to you."
8055 '') man1dir="none";;
8058 echo "If you don't want the manual sources installed, answer 'none'."
8063 lookpath="$prefixexp/share/man/man1"
8064 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8065 lookpath="$lookpath $prefixexp/man/p_man/man1"
8066 lookpath="$lookpath $prefixexp/man/u_man/man1"
8067 lookpath="$lookpath $prefixexp/man/man.1"
8069 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8070 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8080 rp="Where do the main $spackage manual pages (source) go?"
8082 if $test "X$man1direxp" != "X$ansexp"; then
8093 : What suffix to use on installed man pages
8100 rp="What suffix should be used for the main $spackage man pages?"
8102 '') case "$man1dir" in
8116 *) dflt="$man1ext";;
8123 : see if we can have long filenames
8125 first=123456789abcdef
8127 if (echo hi >$first) 2>/dev/null; then
8128 if $test -f 123456789abcde; then
8129 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8132 echo 'You can have filenames longer than 14 characters.'>&4
8137 You can't have filenames longer than 14 chars.
8138 You can't even think about them!
8144 $rm -rf 123456789abcde*
8146 : determine where library module manual pages go
8147 set man3dir man3dir none
8151 $spackage has manual pages for many of the library modules.
8157 However, you don't have nroff, so they're probably useless to you.
8160 '') man3dir="none";;
8164 case "$d_flexfnam" in
8167 However, your system can't handle the long file names like File::Basename.3.
8170 '') man3dir="none";;
8174 echo "If you don't want the manual sources installed, answer 'none'."
8175 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8177 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8178 if $test -d "$privlib/man/man3"; then
8181 WARNING: Previous versions of perl installed man3 pages into
8182 $privlib/man/man3. This version will suggest a
8183 new default of $dflt.
8187 rp='Do you wish to preserve the old behavior?(y/n)'
8190 y*) dflt="$privlib/man/man3" ;;
8195 *) dflt="$man3dir" ;;
8202 rp="Where do the $package library man pages (source) go?"
8212 : What suffix to use on installed man pages
8218 rp="What suffix should be used for the $package library man pages?"
8220 '') case "$man3dir" in
8234 *) dflt="$man3ext";;
8241 : see if we have to deal with yellow pages, now NIS.
8242 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8243 if $test -f /usr/etc/nibindd; then
8245 echo "I'm fairly confident you're on a NeXT."
8247 rp='Do you get the hosts file via NetInfo?'
8256 y*) hostcat='nidump hosts .';;
8257 *) case "$hostcat" in
8258 nidump*) hostcat='';;
8268 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8276 rp='Are you getting the hosts file via yellow pages?'
8279 y*) hostcat='ypcat hosts';;
8280 *) hostcat='cat /etc/hosts';;
8286 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8289 '') test -f /etc/group && groupcat='cat /etc/group';;
8292 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8295 : now get the host name
8297 echo "Figuring out host name..." >&4
8298 case "$myhostname" in
8300 echo 'Maybe "hostname" will work...'
8301 if tans=`sh -c hostname 2>&1` ; then
8309 if $test "$cont"; then
8311 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8312 if tans=`cat /etc/systemid 2>&1` ; then
8314 phostname='cat /etc/systemid'
8315 echo "Whadyaknow. Xenix always was a bit strange..."
8318 elif $test -r /etc/systemid; then
8319 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8322 if $test "$cont"; then
8323 echo 'No, maybe "uuname -l" will work...'
8324 if tans=`sh -c 'uuname -l' 2>&1` ; then
8326 phostname='uuname -l'
8328 echo 'Strange. Maybe "uname -n" will work...'
8329 if tans=`sh -c 'uname -n' 2>&1` ; then
8331 phostname='uname -n'
8333 echo 'Oh well, maybe I can mine it out of whoami.h...'
8334 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8335 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8336 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8338 case "$myhostname" in
8339 '') echo "Does this machine have an identity crisis or something?"
8342 echo "Well, you said $myhostname before..."
8343 phostname='echo $myhostname';;
8349 case "$myhostname" in
8350 '') myhostname=noname ;;
8352 : you do not want to know about this
8357 if $test "$myhostname" ; then
8359 rp='Your host name appears to be "'$myhostname'".'" Right?"
8367 : bad guess or no guess
8368 while $test "X$myhostname" = X ; do
8370 rp="Please type the (one word) name of your host:"
8375 : translate upper to lower if necessary
8376 case "$myhostname" in
8378 echo "(Normalizing case in your host name)"
8379 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8383 case "$myhostname" in
8385 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8386 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8387 echo "(Trimming domain name from host name--host name is now $myhostname)"
8389 *) case "$mydomain" in
8392 test "X$hostcat" = "Xypcat hosts" &&
8393 ypmatch "$myhostname" hosts 2>/dev/null |\
8394 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8397 test "X$hostcat" != "X" &&
8398 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8399 /[ ]$myhostname[ . ]/p" > hosts
8402 if $test -f hosts; then
8403 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8404 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8405 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8406 hosts | $sort | $uniq | \
8407 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8408 case `$echo X$dflt` in
8409 X*\ *) echo "(Several hosts in the database matched hostname)"
8412 X.) echo "(You do not have fully-qualified names in the hosts database)"
8416 echo "(I cannot locate a hosts database anywhere)"
8421 tans=`./loc resolv.conf X /etc /usr/etc`
8422 if $test -f "$tans"; then
8423 echo "(Attempting domain name extraction from $tans)"
8424 dflt=.`$sed -n -e 's/ / /g' \
8425 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8426 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8428 .) dflt=.`$sed -n -e 's/ / /g' \
8429 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8430 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8437 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8438 dflt=.`sh -c domainname 2>/dev/null`
8441 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8445 case "$dflt$osname" in
8446 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8447 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8451 .) echo "(Lost all hope -- silly guess then)"
8457 *) dflt="$mydomain";;
8461 rp="What is your domain name?"
8471 : translate upper to lower if necessary
8474 echo "(Normalizing case in your domain name)"
8475 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8479 : a little sanity check here
8480 case "$phostname" in
8483 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8484 $myhostname$mydomain|$myhostname) ;;
8486 case "$phostname" in
8488 echo "(That doesn't agree with your whoami.h file, by the way.)"
8491 echo "(That doesn't agree with your $phostname command, by the way.)"
8501 I need to get your e-mail address in Internet format if possible, i.e.
8502 something like user@host.domain. Please answer accurately since I have
8503 no easy means to double check it. The default value provided below
8504 is most probably close to reality but may not be valid from outside
8505 your organization...
8509 while test "$cont"; do
8511 '') dflt="$cf_by@$myhostname$mydomain";;
8512 *) dflt="$cf_email";;
8514 rp='What is your e-mail address?'
8520 rp='Address does not look like an Internet one. Use it anyway?'
8536 If you or somebody else will be maintaining perl at your site, please
8537 fill in the correct e-mail address here so that they may be contacted
8538 if necessary. Currently, the "perlbug" program included with perl
8539 will send mail to this address in addition to perlbug@perl.org. You may
8540 enter "none" for no administrator.
8543 case "$perladmin" in
8544 '') dflt="$cf_email";;
8545 *) dflt="$perladmin";;
8547 rp='Perl administrator e-mail address'
8551 : determine whether to only install version-specific parts.
8554 Do you want to install only the version-specific parts of the perl
8555 distribution? Usually you do *not* want to do this.
8557 case "$versiononly" in
8558 "$define"|[Yy]*|true) dflt='y' ;;
8561 rp="Do you want to install only the version-specific parts of perl?"
8564 [yY]*) val="$define";;
8570 case "$versiononly" in
8571 "$define") inc_version_list=''
8572 inc_version_list_init=0
8576 : figure out how to guarantee perl startup
8577 : XXX Note that this currently takes advantage of the bug that binexp ignores
8578 : the Configure -Dinstallprefix setting, which in turn means that under
8579 : relocatable @INC, initialinstalllocation is what binexp started as.
8580 case "$startperl" in
8582 case "$sharpbang" in
8586 I can use the #! construct to start perl on your system. This will
8587 make startup of perl scripts faster, but may cause problems if you
8588 want to share those scripts and perl is not in a standard place
8589 ($initialinstalllocation/perl) on all your platforms. The alternative
8590 is to force a shell by starting the script with a single ':' character.
8593 case "$versiononly" in
8594 "$define") dflt="$initialinstalllocation/perl$version";;
8595 *) dflt="$initialinstalllocation/perl";;
8597 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8600 none) startperl=": # use perl";;
8601 *) startperl="#!$ans"
8602 if $test 30 -lt `echo "$ans" | wc -c`; then
8605 WARNING: Some systems limit the #! command to 32 characters.
8606 If you experience difficulty running Perl scripts with #!, try
8607 installing Perl in a directory with a shorter pathname.
8613 *) startperl=": # use perl"
8618 echo "I'll use $startperl to start perl scripts."
8620 : figure best path for perl in scripts
8623 case "$versiononly" in
8624 "$define") perlpath="$initialinstalllocation/perl$version";;
8625 *) perlpath="$initialinstalllocation/perl";;
8627 case "$startperl" in
8632 I will use the "eval 'exec'" idiom to start Perl on your system.
8633 I can use the full path of your Perl binary for this purpose, but
8634 doing so may cause problems if you want to share those scripts and
8635 Perl is not always in a standard place ($initialinstalllocation/perl).
8638 dflt="$initialinstalllocation/perl"
8639 rp="What path shall I use in \"eval 'exec'\"?"
8646 case "$startperl" in
8648 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8651 : determine where public executable scripts go
8652 set scriptdir scriptdir
8654 case "$scriptdir" in
8657 : guess some guesses
8658 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8659 $test -d /usr/share/bin && dflt=/usr/share/bin
8660 $test -d /usr/local/script && dflt=/usr/local/script
8661 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8662 $test -d $prefixexp/script && dflt=$prefixexp/script
8666 *) dflt="$scriptdir"
8671 Some installations have a separate directory just for executable scripts so
8672 that they can mount it across multiple architectures but keep the scripts in
8673 one spot. You might, for example, have a subdirectory of /usr/share for this.
8674 Or you might just lump your scripts in with all your other executables.
8678 rp='Where do you keep publicly executable scripts?'
8680 if $test "X$ansexp" != "X$scriptdirexp"; then
8686 : A little fix up for an irregularly named variable.
8687 installscript="$installscriptdir"
8689 : determine where add-on public executables go
8691 '') dflt=$siteprefix/bin ;;
8695 rp='Pathname where the add-on public executables should be installed?'
8700 : determine where add-on html pages go
8701 : There is no standard location, so try to copy the previously-selected
8702 : directory structure for the core html pages.
8703 case "$sitehtml1dir" in
8704 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8705 *) dflt=$sitehtml1dir ;;
8708 ''|' ') dflt=none ;;
8711 rp='Pathname where the site-specific html pages should be installed?'
8713 prefixvar=sitehtml1dir
8716 : determine where add-on library html pages go
8717 : There is no standard location, so try to copy the previously-selected
8718 : directory structure for the core html pages.
8719 case "$sitehtml3dir" in
8720 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8721 *) dflt=$sitehtml3dir ;;
8724 ''|' ') dflt=none ;;
8727 rp='Pathname where the site-specific library html pages should be installed?'
8729 prefixvar=sitehtml3dir
8732 : determine where add-on manual pages go
8733 case "$siteman1dir" in
8734 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
8735 *) dflt=$siteman1dir ;;
8738 ''|' ') dflt=none ;;
8741 rp='Pathname where the site-specific manual pages should be installed?'
8743 prefixvar=siteman1dir
8746 : determine where add-on library man pages go
8747 case "$siteman3dir" in
8748 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
8749 *) dflt=$siteman3dir ;;
8752 ''|' ') dflt=none ;;
8755 rp='Pathname where the site-specific library manual pages should be installed?'
8757 prefixvar=siteman3dir
8760 : determine where add-on public executable scripts go
8761 case "$sitescript" in
8762 '') dflt=$siteprefix/script
8763 $test -d $dflt || dflt=$sitebin ;;
8764 *) dflt="$sitescript" ;;
8767 rp='Pathname where add-on public executable scripts should be installed?'
8769 prefixvar=sitescript
8772 case "$usefaststdio" in
8773 $define|true|[yY]*|'')
8774 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
8784 Perl can be built to use 'fast stdio', which means using the stdio
8785 library but also directly manipulating the stdio buffers to enable
8786 faster I/O. Using stdio is better for backward compatibility (especially
8787 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
8788 interface has been preferred instead of stdio.
8790 If this doesn't make any sense to you, just accept the default '$dflt'.
8792 rp='Use the "fast stdio" if available?'
8795 y|Y) val="$define" ;;
8802 : define an is-a-typedef? function
8803 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8805 "") inclist="sys/types.h";;
8807 eval "varval=\$$var";
8811 for inc in $inclist; do
8812 echo "#include <$inc>" >>temp.c;
8814 echo "#ifdef $type" >> temp.c;
8815 echo "printf(\"We have $type\");" >> temp.c;
8816 echo "#endif" >> temp.c;
8817 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8818 if $contains $type temp.E >/dev/null 2>&1; then
8824 *) eval "$var=\$varval";;
8827 : define an is-a-typedef? function that prompts if the type is not available.
8828 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8830 "") inclist="sys/types.h";;
8832 eval "varval=\$$var";
8836 for inc in $inclist; do
8837 echo "#include <$inc>" >>temp.c;
8839 echo "#ifdef $type" >> temp.c;
8840 echo "printf(\"We have $type\");" >> temp.c;
8841 echo "#endif" >> temp.c;
8842 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8844 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
8845 if $contains $type temp.E >/dev/null 2>&1; then
8846 echo "$type found." >&4;
8849 echo "$type NOT found." >&4;
8855 *) eval "$var=\$varval";;
8858 : see what type lseek is declared as in the kernel
8859 rp="What is the type used for lseek's offset on this system?"
8860 set off_t lseektype long stdio.h sys/types.h
8864 echo "Checking to see how big your file offsets are..." >&4
8866 #include <sys/types.h>
8870 printf("%d\n", (int)sizeof($lseektype));
8875 if eval $compile_ok; then
8876 lseeksize=`$run ./try`
8877 echo "Your file offsets are $lseeksize bytes long."
8881 echo "(I can't seem to compile the test program. Guessing...)"
8882 rp="What is the size of your file offsets (in bytes)?"
8888 : see what type file positions are declared as in the library
8889 rp="What is the type for file position used by fsetpos()?"
8890 set fpos_t fpostype long stdio.h sys/types.h
8895 *_t) zzz="$fpostype" ;;
8898 echo "Checking the size of $zzz..." >&4
8900 #include <sys/types.h>
8907 printf("%d\n", (int)sizeof($fpostype));
8912 if eval $compile_ok; then
8916 echo "(I can't execute the test program--guessing $fpossize.)" >&4
8919 echo "Your $zzz is $fpossize bytes long."
8925 echo "(I can't compile the test program. Guessing...)" >&4
8926 rp="What is the size of your file positions (in bytes)?"
8931 # Backward compatibility (uselfs is deprecated).
8933 "$define"|true|[yY]*)
8936 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
8938 uselargefiles="$define"
8942 case "$lseeksize:$fpossize" in
8945 You can have files larger than 2 gigabytes.
8948 *) case "$uselargefiles" in
8949 "$undef"|false|[nN]*) dflt='n' ;;
8954 Perl can be built to understand large files (files larger than 2 gigabytes)
8955 on some systems. To do so, Configure can be run with -Duselargefiles.
8957 If this doesn't make any sense to you, just accept the default '$dflt'.
8959 rp='Try to understand large files, if available?'
8962 y|Y) val="$define" ;;
8969 : Look for a hint-file generated 'call-back-unit'. If the
8970 : user has specified that a large files perl is to be built,
8971 : we may need to set or change some other defaults.
8972 if $test -f uselargefiles.cbu; then
8973 echo "Your platform has some specific hints regarding large file builds, using them..."
8974 . ./uselargefiles.cbu
8976 case "$uselargefiles" in
8978 if $test -f uselargefiles.cbu; then
8980 echo "Rechecking to see how big your file offsets are..." >&4
8982 #include <sys/types.h>
8986 printf("%d\n", (int)sizeof($lseektype));
8991 if eval $compile_ok; then
8992 lseeksize=`$run ./try`
8993 $echo "Your file offsets are now $lseeksize bytes long."
8997 echo "(I can't seem to compile the test program. Guessing...)"
8998 rp="What is the size of your file offsets (in bytes)?"
9003 *_t) zzz="$fpostype" ;;
9006 $echo $n "Rechecking the size of $zzz...$c" >&4
9008 #include <sys/types.h>
9015 printf("%d\n", (int)sizeof($fpostype));
9020 if eval $compile_ok; then
9025 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9028 echo " $fpossize bytes." >&4
9034 echo "(I can't compile the test program. Guessing...)" >&4
9035 rp="What is the size of your file positions (in bytes)?"
9044 case "$vendorprefix" in
9045 '') d_vendorbin="$undef"
9049 *) d_vendorbin="$define"
9050 : determine where vendor-supplied executables go.
9051 case "$vendorbin" in
9052 '') dflt=$vendorprefix/bin ;;
9053 *) dflt="$vendorbin" ;;
9056 rp='Pathname for the vendor-supplied executables directory?'
9059 vendorbinexp="$ansexp"
9065 case "$vendorprefix" in
9066 '') vendorhtml1dir=''
9067 vendorhtml1direxp=''
9069 *) : determine where vendor-supplied html pages go.
9070 : There is no standard location, so try to copy the previously-selected
9071 : directory structure for the core html pages.
9072 : XXX Better default suggestions would be welcome.
9073 case "$vendorhtml1dir" in
9074 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9075 *) dflt=$vendorhtml1dir ;;
9078 ''|' ') dflt=none ;;
9081 rp='Pathname for the vendor-supplied html pages?'
9083 vendorhtml1dir="$ans"
9084 vendorhtml1direxp="$ansexp"
9087 : Use ' ' for none so value is preserved next time through Configure
9088 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9089 prefixvar=vendorhtml1dir
9092 case "$vendorprefix" in
9093 '') vendorhtml3dir=''
9094 vendorhtml3direxp=''
9096 *) : determine where vendor-supplied module html pages go.
9097 : There is no standard location, so try to copy the previously-selected
9098 : directory structure for the core html pages.
9099 : XXX Better default suggestions would be welcome.
9100 case "$vendorhtml3dir" in
9101 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9102 *) dflt=$vendorhtml3dir ;;
9105 ''|' ') dflt=none ;;
9108 rp='Pathname for the vendor-supplied html pages?'
9110 vendorhtml3dir="$ans"
9111 vendorhtml3direxp="$ansexp"
9114 : Use ' ' for none so value is preserved next time through Configure
9115 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9116 prefixvar=vendorhtml3dir
9119 case "$vendorprefix" in
9120 '') vendorman1dir=''
9123 *) : determine where vendor-supplied manual pages go.
9124 case "$vendorman1dir" in
9125 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9126 *) dflt=$vendorman1dir ;;
9129 ''|' ') dflt=none ;;
9132 rp='Pathname for the vendor-supplied manual section 1 pages?'
9134 vendorman1dir="$ans"
9135 vendorman1direxp="$ansexp"
9138 : Use ' ' for none so value is preserved next time through Configure
9139 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9140 prefixvar=vendorman1dir
9143 case "$vendorprefix" in
9144 '') vendorman3dir=''
9147 *) : determine where vendor-supplied module manual pages go.
9148 case "$vendorman3dir" in
9149 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9150 *) dflt=$vendorman3dir ;;
9153 ''|' ') dflt=none ;;
9156 rp='Pathname for the vendor-supplied manual section 3 pages?'
9158 vendorman3dir="$ans"
9159 vendorman3direxp="$ansexp"
9162 : Use ' ' for none so value is preserved next time through Configure
9163 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9164 prefixvar=vendorman3dir
9167 case "$vendorprefix" in
9168 '') d_vendorscript="$undef"
9172 *) d_vendorscript="$define"
9173 : determine where vendor-supplied scripts go.
9174 case "$vendorscript" in
9175 '') dflt=$vendorprefix/script
9176 $test -d $dflt || dflt=$vendorbin ;;
9177 *) dflt="$vendorscript" ;;
9181 The installation process will create a directory for
9182 vendor-supplied scripts.
9186 rp='Pathname for the vendor-supplied scripts directory?'
9189 vendorscriptexp="$ansexp"
9192 prefixvar=vendorscript
9195 : see if qgcvt exists
9201 if $test X"$d_longdbl" = X"$define"; then
9203 echo "Checking how to print long doubles..." >&4
9205 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9206 $cat >try.c <<'EOCP'
9207 #include <sys/types.h>
9211 printf("%.3f\n", d);
9215 if eval $compile; then
9219 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9220 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9221 echo "We will use %f."
9227 if $test X"$sPRIfldbl" = X; then
9228 $cat >try.c <<'EOCP'
9229 #include <sys/types.h>
9232 long double d = 123.456;
9233 printf("%.3Lf\n", d);
9237 if eval $compile; then
9241 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9242 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9243 echo "We will use %Lf."
9249 if $test X"$sPRIfldbl" = X; then
9250 $cat >try.c <<'EOCP'
9251 #include <sys/types.h>
9254 long double d = 123.456;
9255 printf("%.3llf\n", d);
9259 if eval $compile; then
9263 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9264 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9265 echo "We will use %llf."
9271 if $test X"$sPRIfldbl" = X; then
9272 $cat >try.c <<'EOCP'
9273 #include <sys/types.h>
9276 long double d = 123.456;
9277 printf("%.3lf\n", d);
9281 if eval $compile; then
9285 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9286 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9287 echo "We will use %lf."
9293 if $test X"$sPRIfldbl" = X; then
9294 echo "Cannot figure out how to print long doubles." >&4
9296 sSCNfldbl=$sPRIfldbl # expect consistency
9303 case "$sPRIfldbl" in
9304 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9305 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9306 d_SCNfldbl="$undef";
9308 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9309 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9310 d_SCNfldbl="$define";
9314 : Check how to convert floats to strings.
9316 if test "X$d_Gconvert" = X; then
9319 echo "Checking for an efficient way to convert floats to strings."
9321 case "$uselongdouble" in
9322 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9324 case "$d_longdbl" in
9325 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9327 case "$d_PRIgldbl" in
9328 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9332 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9333 char *myname = "gconvert";
9336 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9337 char *myname = "gcvt";
9340 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9341 char *myname = "qgcvt";
9342 #define DOUBLETYPE long double
9345 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9347 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9349 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9352 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9354 char *myname = "sprintf";
9358 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9359 #define DOUBLETYPE long double
9361 #define DOUBLETYPE double
9367 #define I_STDLIB $i_stdlib
9373 checkit(expect, got)
9377 if (strcmp(expect, got)) {
9378 printf("%s oddity: Expected %s, got %s\n",
9379 myname, expect, got);
9389 /* This must be 1st test on (which?) platform */
9390 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9391 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9392 checkit("0.1", buf);
9394 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9395 checkit("0.01", buf);
9397 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9398 checkit("0.001", buf);
9400 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9401 checkit("0.0001", buf);
9403 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9404 if (strlen(buf) > 5)
9405 checkit("9e-005", buf); /* for Microsoft ?? */
9407 checkit("9e-05", buf);
9409 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9412 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9413 checkit("1.1", buf);
9415 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9416 checkit("1.01", buf);
9418 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9419 checkit("1.001", buf);
9421 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9422 checkit("1.0001", buf);
9424 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9425 checkit("1.00001", buf);
9427 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9428 checkit("1.000001", buf);
9430 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9433 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9436 /* Some Linux gcvt's give 1.e+5 here. */
9437 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9438 checkit("100000", buf);
9440 /* Some Linux gcvt's give -1.e+5 here. */
9441 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9442 checkit("-100000", buf);
9444 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9445 checkit("123.456", buf);
9447 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9448 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9449 /* 34 should be enough to scare even long double
9450 * places into using the e notation. */
9451 if (strlen(buf) > 5)
9452 checkit("1e+034", buf); /* for Microsoft */
9454 checkit("1e+34", buf);
9456 /* For Perl, if you add additional tests here, also add them to
9457 * t/base/num.t for benefit of platforms not using Configure or
9458 * overriding d_Gconvert */
9463 : first add preferred functions to our list
9465 for xxx_convert in $gconvert_preference; do
9466 case $xxx_convert in
9467 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9468 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9471 : then add any others
9472 for xxx_convert in gconvert gcvt sprintf; do
9475 *) xxx_list="$xxx_list $xxx_convert" ;;
9479 case "$d_longdbl$uselongdouble" in
9481 : again, add prefered functions to our list first
9483 for xxx_convert in $gconvert_ld_preference; do
9484 case $xxx_convert in
9485 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9486 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9489 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9490 for xxx_convert in qgcvt sprintf $xxx_list; do
9491 case "$xxx_ld_list" in
9492 $xxx_convert*|*" $xxx_convert"*) ;;
9493 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9496 : if sprintf cannot do long doubles, move it to the end
9497 if test "$d_PRIgldbl" != "$define"; then
9498 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9500 : if no qgcvt, remove it
9501 if test "$d_qgcvt" != "$define"; then
9502 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9505 xxx_list="$xxx_ld_list"
9509 for xxx_convert in $xxx_list; do
9510 echo "Trying $xxx_convert..."
9512 set try -DTRY_$xxx_convert
9513 if eval $compile; then
9514 echo "$xxx_convert() found." >&4
9516 echo "I'll use $xxx_convert to convert floats into a string." >&4
9519 echo "...But $xxx_convert didn't work as I expected."
9523 echo "$xxx_convert NOT found." >&4
9527 if test X$xxx_convert = X; then
9528 echo "*** WHOA THERE!!! ***" >&4
9529 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9533 case "$xxx_convert" in
9534 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9535 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9536 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9537 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9538 "$define$define$define")
9539 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9540 "$define$define$undef")
9541 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9542 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9549 : see if _fwalk exists
9553 : Initialize h_fcntl
9556 : Initialize h_sysfile
9559 : access call always available on UNIX
9563 : locate the flags for 'access()'
9567 $cat >access.c <<EOCP
9568 #include <sys/types.h>
9573 #include <sys/file.h>
9586 : check sys/file.h first, no particular reason here
9587 if $test `./findhdr sys/file.h` && \
9588 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9590 echo "<sys/file.h> defines the *_OK access constants." >&4
9591 elif $test `./findhdr fcntl.h` && \
9592 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9594 echo "<fcntl.h> defines the *_OK access constants." >&4
9595 elif $test `./findhdr unistd.h` && \
9596 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9597 echo "<unistd.h> defines the *_OK access constants." >&4
9599 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9605 : see if accessx exists
9606 set accessx d_accessx
9609 : see if aintl exists
9613 : see if alarm exists
9617 : see if POSIX threads are available
9618 set pthread.h i_pthread
9621 : define a fucntion to check prototypes
9622 $cat > protochk <<EOSH
9625 optimize="$optimize"
9627 prototype="$prototype"
9630 usethreads=$usethreads
9631 i_pthread=$i_pthread
9632 pthread_h_first=$pthread_h_first
9635 $cat >> protochk <<'EOSH'
9640 while test $# -ge 2; do
9642 $define) echo "#include <$2>" >> try.c ;;
9643 literal) echo "$2" >> try.c ;;
9645 # Extra magic for the benefit of systems that need pthread.h
9646 # to be included early to correctly detect threadsafe functions.
9647 # Such functions must guarantee themselves, though, that the usethreads
9648 # and i_pthread have been defined, before calling protochk.
9649 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
9650 echo "#include <pthread.h>" >> try.c
9655 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
9656 cat >> try.c <<'EOCP'
9657 #ifdef CAN_PROTOTYPE
9658 #define _(args) args
9663 echo "$foo" >> try.c
9664 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
9665 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
9673 hasproto='varname=$1; func=$2; shift; shift;
9674 while $test $# -ge 2; do
9676 $define) echo "#include <$2>";;
9680 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
9681 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
9682 echo "$func() prototype found.";
9685 echo "$func() prototype NOT found.";
9690 $rm -f try.c tryout.c'
9692 : see if sys/types.h has to be included
9693 set sys/types.h i_systypes
9696 : see if sys/select.h has to be included
9697 set sys/select.h i_sysselct
9700 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
9701 while $test $# -ge 2; do
9703 $define) echo "#include <$2>";;
9707 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
9709 if eval $compile; then
9718 : see if we should include time.h, sys/time.h, or both
9720 if test "X$timeincl" = X; then
9721 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9722 $echo $n "I'm now running the test program...$c"
9724 #include <sys/types.h>
9729 #ifdef SYSTIMEKERNEL
9732 #include <sys/time.h>
9735 #include <sys/select.h>
9748 struct timezone tzp;
9750 if (foo.tm_sec == foo.tm_sec)
9753 if (bar.tv_sec == bar.tv_sec)
9760 for s_timezone in '-DS_TIMEZONE' ''; do
9762 for s_timeval in '-DS_TIMEVAL' ''; do
9763 for i_systimek in '' '-DSYSTIMEKERNEL'; do
9764 for i_time in '' '-DI_TIME'; do
9765 for i_systime in '-DI_SYSTIME' ''; do
9768 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
9769 if eval $compile; then
9770 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
9774 $echo $n "Succeeded with $flags$c"
9786 *SYSTIMEKERNEL*) i_systimek="$define"
9787 timeincl=`./findhdr sys/time.h`
9788 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
9789 *) i_systimek="$undef";;
9792 *I_TIME*) i_time="$define"
9793 timeincl=`./findhdr time.h`" $timeincl"
9794 echo "We'll include <time.h>." >&4;;
9795 *) i_time="$undef";;
9798 *I_SYSTIME*) i_systime="$define"
9799 timeincl=`./findhdr sys/time.h`" $timeincl"
9800 echo "We'll include <sys/time.h>." >&4;;
9801 *) i_systime="$undef";;
9805 : see if struct tm knows about tm_zone
9806 case "$i_systime$i_time" in
9809 echo "Checking to see if your struct tm has tm_zone field..." >&4
9810 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
9818 case "$d_tm_tm_zone" in
9819 "$define") echo "Yes, it does." ;;
9820 *) echo "No, it doesn't." ;;
9822 : see if struct tm knows about tm_gmtoff
9823 case "$i_systime$i_time" in
9826 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
9827 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
9835 case "$d_tm_tm_gmtoff" in
9836 "$define") echo "Yes, it does." ;;
9837 *) echo "No, it doesn't." ;;
9840 : see if asctime_r exists
9841 set asctime_r d_asctime_r
9843 case "$d_asctime_r" in
9845 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
9846 case "$d_asctime_r_proto:$usethreads" in
9847 ":define") d_asctime_r_proto=define
9848 set d_asctime_r_proto asctime_r $hdrs
9852 case "$d_asctime_r_proto" in
9854 case "$asctime_r_proto" in
9855 ''|0) try='char* asctime_r(const struct tm*, char*);'
9856 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SB ;;
9858 case "$asctime_r_proto" in
9859 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
9860 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SBI ;;
9862 case "$asctime_r_proto" in
9863 ''|0) try='int asctime_r(const struct tm*, char*);'
9864 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SB ;;
9866 case "$asctime_r_proto" in
9867 ''|0) try='int asctime_r(const struct tm*, char*, int);'
9868 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SBI ;;
9870 case "$asctime_r_proto" in
9871 ''|0) d_asctime_r=undef
9873 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
9874 * ) case "$asctime_r_proto" in
9875 REENTRANT_PROTO*) ;;
9876 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
9878 echo "Prototype: $try" ;;
9881 *) case "$usethreads" in
9882 define) echo "asctime_r has no prototype, not using it." >&4 ;;
9889 *) asctime_r_proto=0
9893 : see if atolf exists
9897 : see if atoll exists
9901 : Look for GCC-style attribute format
9902 case "$d_attribute_format" in
9905 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
9906 $cat >attrib.c <<'EOCP'
9908 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
9910 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9911 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9912 echo "Your C compiler doesn't support __attribute__((format))."
9915 echo "Your C compiler supports __attribute__((format))."
9919 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9923 *) val="$d_attribute_format" ;;
9925 set d_attribute_format
9929 : Look for GCC-style attribute malloc
9930 case "$d_attribute_malloc" in
9933 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
9934 $cat >attrib.c <<'EOCP'
9936 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
9938 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9939 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9940 echo "Your C compiler doesn't support __attribute__((malloc))."
9943 echo "Your C compiler supports __attribute__((malloc))."
9947 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9951 *) val="$d_attribute_malloc" ;;
9953 set d_attribute_malloc
9957 : Look for GCC-style attribute nonnull
9958 case "$d_attribute_nonnull" in
9961 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
9962 $cat >attrib.c <<'EOCP'
9964 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
9966 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9967 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9968 echo "Your C compiler doesn't support __attribute__((nonnull))."
9971 echo "Your C compiler supports __attribute__((nonnull))."
9975 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9979 *) val="$d_attribute_nonnull" ;;
9981 set d_attribute_nonnull
9985 : Look for GCC-style attribute noreturn
9986 case "$d_attribute_noreturn" in
9989 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
9990 $cat >attrib.c <<'EOCP'
9992 void fall_over_dead( void ) __attribute__((noreturn));
9994 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9995 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9996 echo "Your C compiler doesn't support __attribute__((noreturn))."
9999 echo "Your C compiler supports __attribute__((noreturn))."
10003 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10007 *) val="$d_attribute_noreturn" ;;
10009 set d_attribute_noreturn
10013 : Look for GCC-style attribute pure
10014 case "$d_attribute_pure" in
10017 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10018 $cat >attrib.c <<'EOCP'
10020 int square( int n ) __attribute__((pure));
10022 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10023 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10024 echo "Your C compiler doesn't support __attribute__((pure))."
10027 echo "Your C compiler supports __attribute__((pure))."
10031 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10035 *) val="$d_attribute_pure" ;;
10037 set d_attribute_pure
10041 : Look for GCC-style attribute unused
10042 case "$d_attribute_unused" in
10045 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10046 $cat >attrib.c <<'EOCP'
10048 int do_something( int dummy __attribute__((unused)), int n );
10050 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10051 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10052 echo "Your C compiler doesn't support __attribute__((unused))."
10055 echo "Your C compiler supports __attribute__((unused))."
10059 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10063 *) val="$d_attribute_unused" ;;
10065 set d_attribute_unused
10069 : Look for GCC-style attribute warn_unused_result
10070 case "$d_attribute_warn_unused_result" in
10073 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10074 $cat >attrib.c <<'EOCP'
10076 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10078 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10079 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10080 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10083 echo "Your C compiler supports __attribute__((warn_unused_result))."
10087 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10091 *) val="$d_attribute_warn_unused_result" ;;
10093 set d_attribute_warn_unused_result
10097 : see if bcmp exists
10101 : see if bcopy exists
10105 : see if this is a unistd.h system
10106 set unistd.h i_unistd
10109 : see if getpgrp exists
10110 set getpgrp d_getpgrp
10113 case "$d_getpgrp" in
10116 echo "Checking to see which flavor of getpgrp is in use..."
10118 #$i_unistd I_UNISTD
10119 #include <sys/types.h>
10121 # include <unistd.h>
10123 #$i_stdlib I_STDLIB
10125 #include <stdlib.h>
10129 if (getuid() == 0) {
10130 printf("(I see you are running Configure as super-user...)\n");
10133 #ifdef TRY_BSD_PGRP
10134 if (getpgrp(1) == 0)
10143 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10144 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10146 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10147 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10150 echo "I can't seem to compile and run the test program."
10152 xxx="a USG one, i.e. you use getpgrp()."
10154 # SVR4 systems can appear rather BSD-ish.
10155 case "$i_unistd" in
10157 xxx="a BSD one, i.e. you use getpgrp(pid)."
10161 xxx="probably a USG one, i.e. you use getpgrp()."
10166 echo "Assuming your getpgrp is $xxx" >&4
10175 : see if setpgrp exists
10176 set setpgrp d_setpgrp
10179 case "$d_setpgrp" in
10182 echo "Checking to see which flavor of setpgrp is in use..."
10184 #$i_unistd I_UNISTD
10185 #include <sys/types.h>
10187 # include <unistd.h>
10189 #$i_stdlib I_STDLIB
10191 #include <stdlib.h>
10195 if (getuid() == 0) {
10196 printf("(I see you are running Configure as super-user...)\n");
10199 #ifdef TRY_BSD_PGRP
10200 if (-1 == setpgrp(1, 1))
10203 if (setpgrp() != -1)
10209 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10210 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10212 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10213 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10216 echo "(I can't seem to compile and run the test program.)"
10218 xxx="a USG one, i.e. you use setpgrp()."
10220 # SVR4 systems can appear rather BSD-ish.
10221 case "$i_unistd" in
10223 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10227 xxx="probably a USG one, i.e. you use setpgrp()."
10232 echo "Assuming your setpgrp is $xxx" >&4
10240 : Look for GCC-style __builtin_choose_expr
10241 case "$d_builtin_choose_expr" in
10244 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10245 $cat >try.c <<'EOCP'
10246 #include <assert.h>
10247 #include <stdlib.h>
10250 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10253 assert( SYRINX(1) == 2112 );
10254 assert( SYRINX(1) != 5150 );
10255 assert( SYRINX(0) == 5150 );
10256 assert( SYRINX(0) != 2112 );
10257 puts( "All good!" );
10263 if eval $compile; then
10264 echo "Your C compiler supports __builtin_choose_expr."
10267 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10271 *) val="$d_builtin_choose_expr" ;;
10274 set d_builtin_choose_expr
10276 $rm -f try.* try core core.try.*
10278 : Look for GCC-style __builtin_expect
10279 case "$d_builtin_expect" in
10282 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10283 $cat >builtin.c <<'EOCP'
10286 if ( __builtin_expect(n, 0) ) n = 1;
10290 if eval $compile; then
10291 echo "Your C compiler supports __builtin_choose_expr."
10294 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10298 *) val="$d_builtin_expect" ;;
10301 set d_builtin_expect
10303 $rm -f try.* try core core.try.*
10305 : see if bzero exists
10309 : see if stdarg is available
10311 if $test `./findhdr stdarg.h`; then
10312 echo "<stdarg.h> found." >&4
10315 echo "<stdarg.h> NOT found." >&4
10319 : see if varags is available
10321 if $test `./findhdr varargs.h`; then
10322 echo "<varargs.h> found." >&4
10324 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
10327 : set up the varargs testing programs
10328 $cat > varargs.c <<EOP
10330 #include <stdarg.h>
10333 #include <varargs.h>
10337 int f(char *p, ...)
10351 p = va_arg(ap, char *);
10356 $cat > varargs <<EOP
10358 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
10367 : now check which varargs header should be included
10372 if `./varargs I_STDARG`; then
10374 elif `./varargs I_VARARGS`; then
10379 if `./varargs I_VARARGS`; then
10386 echo "I could not find the definition for va_dcl... You have problems..." >&4
10387 val="$undef"; set i_stdarg; eval $setvar
10388 val="$undef"; set i_varargs; eval $setvar
10393 case "$i_varhdr" in
10395 val="$define"; set i_stdarg; eval $setvar
10396 val="$undef"; set i_varargs; eval $setvar
10399 val="$undef"; set i_stdarg; eval $setvar
10400 val="$define"; set i_varargs; eval $setvar
10403 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
10407 : see if the Compiler supports C99 variadic macros
10408 case "$i_stdarg$i_stdlib" in
10410 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
10413 #include <stdarg.h>
10415 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
10419 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
10425 if eval $compile && $run ./try 2>&1 >/dev/null; then
10426 case "`$run ./try`" in
10428 echo "You have C99 variadic macros." >&4
10429 d_c99_variadic_macros="$define"
10432 echo "You don't have functional C99 variadic macros." >&4
10433 d_c99_variadic_macros="$undef"
10437 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
10438 d_c99_variadic_macros="$undef"
10440 $rm -f try.* try core core.try.*
10443 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
10444 d_c99_variadic_macros="$undef"
10448 : see if signal is declared as pointer to function returning int or void
10450 xxx=`./findhdr signal.h`
10451 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10452 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10453 echo "You have int (*signal())() instead of void." >&4
10455 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10456 echo "You have void (*signal())()." >&4
10458 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10459 echo "You have int (*signal())() instead of void." >&4
10461 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10462 echo "You have void (*signal())()." >&4
10465 case "$d_voidsig" in
10467 echo "I can't determine whether signal handler returns void or int..." >&4
10469 rp="What type does your signal handler return?"
10472 v*) val="$define";;
10476 echo "As you already told me, signal handler returns void." >&4
10479 *) echo "As you already told me, signal handler returns int." >&4
10486 case "$d_voidsig" in
10487 "$define") signal_t="void";;
10488 *) signal_t="int";;
10492 : check for ability to cast large floats to 32-bit ints.
10494 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10495 if $test "$intsize" -ge 4; then
10502 #$i_stdlib I_STDLIB
10504 #include <stdlib.h>
10506 #include <sys/types.h>
10507 #include <signal.h>
10508 $signal_t blech(s) int s; { exit(3); }
10515 signal(SIGFPE, blech);
10517 /* Don't let compiler optimize the test away. Store the number
10518 in a writable string for gcc to pass to sscanf under HP/UX.
10520 sprintf(str, "2147483647");
10521 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
10525 /* x86 processors will probably give 0x8000 0000, which is a
10526 sign change. We don't want that. We want to mimic SPARC
10527 behavior here, which is to preserve the sign and give
10530 if (i32 != ($xxx) f)
10536 if eval $compile_ok; then
10540 echo "(I can't seem to compile the test program--assuming it can't)"
10545 echo "Yup, it can."
10548 echo "Nope, it can't."
10555 : check for ability to cast negative floats to unsigned
10557 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
10560 #$i_stdlib I_STDLIB
10562 #include <stdlib.h>
10564 #include <sys/types.h>
10565 #include <signal.h>
10566 $signal_t blech(s) int s; { exit(7); }
10567 $signal_t blech_in_list(s) int s; { exit(4); }
10568 unsigned long dummy_long(p) unsigned long p; { return p; }
10569 unsigned int dummy_int(p) unsigned int p; { return p; }
10570 unsigned short dummy_short(p) unsigned short p; { return p; }
10574 unsigned long along;
10576 unsigned short ashort;
10580 /* Frustrate gcc-2.7.2's optimizer which failed this test with
10581 a direct f = -123. assignment. gcc-2.8.0 reportedly
10582 optimized the whole file away
10584 /* Store the number in a writable string for gcc to pass to
10585 sscanf under HP/UX.
10587 sprintf(str, "-123");
10588 sscanf(str, "%lf", &f); /* f = -123.; */
10590 signal(SIGFPE, blech);
10591 along = (unsigned long)f;
10592 aint = (unsigned int)f;
10593 ashort = (unsigned short)f;
10594 if (along != (unsigned long)-123)
10596 if (aint != (unsigned int)-123)
10598 if (ashort != (unsigned short)-123)
10600 sprintf(str, "1073741824.");
10601 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
10604 along = (unsigned long)f;
10605 if (along != 0x80000000)
10609 along = (unsigned long)f;
10610 if (along != 0x7fffffff)
10614 along = (unsigned long)f;
10615 if (along != 0x80000001)
10619 signal(SIGFPE, blech_in_list);
10620 sprintf(str, "123.");
10621 sscanf(str, "%lf", &f); /* f = 123.; */
10622 along = dummy_long((unsigned long)f);
10623 aint = dummy_int((unsigned int)f);
10624 ashort = dummy_short((unsigned short)f);
10625 if (along != (unsigned long)123)
10627 if (aint != (unsigned int)123)
10629 if (ashort != (unsigned short)123)
10636 if eval $compile_ok; then
10640 echo "(I can't seem to compile the test program--assuming it can't)"
10643 case "$castflags" in
10645 echo "Yup, it can."
10648 echo "Nope, it can't."
10655 : see if vprintf exists
10657 if set vprintf val -f d_vprintf; eval $csym; $val; then
10658 echo 'vprintf() found.' >&4
10661 #include <varargs.h>
10662 #$i_stdlib I_STDLIB
10664 #include <stdlib.h>
10667 int main() { xxx("foo"); }
10676 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
10680 if eval $compile && $run ./try; then
10681 echo "Your vsprintf() returns (int)." >&4
10684 echo "Your vsprintf() returns (char*)." >&4
10688 echo 'vprintf() NOT found.' >&4
10699 : see if chown exists
10703 : see if chroot exists
10704 set chroot d_chroot
10707 : see if chsize exists
10708 set chsize d_chsize
10711 : see if class exists
10715 : see if clearenv exists
10716 set clearenv d_clearenv
10719 hasstruct='varname=$1; struct=$2; shift; shift;
10720 while $test $# -ge 2; do
10722 $define) echo "#include <$2>";;
10726 echo "int main () { struct $struct foo; }" >> try.c;
10728 if eval $compile; then
10735 $rm -f try.c try.o'
10739 : see whether socket exists
10741 $echo $n "Hmm... $c" >&4
10742 if set socket val -f d_socket; eval $csym; $val; then
10743 echo "Looks like you have Berkeley networking support." >&4
10745 if set setsockopt val -f; eval $csym; $val; then
10748 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
10749 d_oldsock="$define"
10752 if $contains socklib libc.list >/dev/null 2>&1; then
10753 echo "Looks like you have Berkeley networking support." >&4
10755 : we will have to assume that it supports the 4.2 BSD interface
10758 echo "You don't have Berkeley networking in libc$_a..." >&4
10759 if test "X$d_socket" = "X$define"; then
10760 echo "...but you seem to believe that you have sockets." >&4
10762 for net in net socket
10764 if test -f /usr/lib/lib$net$_a; then
10765 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
10766 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
10767 if $contains socket libc.list >/dev/null 2>&1; then
10772 echo "...but the Wollongong group seems to have hacked it in." >&4
10773 sockethdr="-I/usr/netinclude"
10776 echo "Found Berkeley sockets interface in lib$net." >&4
10777 if $contains setsockopt libc.list >/dev/null 2>&1; then
10780 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
10781 d_oldsock="$define"
10787 if test "X$d_socket" != "X$define"; then
10788 echo "or anywhere else I see." >&4
10796 : see if socketpair exists
10797 set socketpair d_sockpair
10802 echo "Checking the availability of certain socket constants..." >&4
10803 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
10804 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
10806 #include <sys/types.h>
10807 #include <sys/socket.h>
10813 set try; if eval $compile; then
10816 set d_${enum}; eval $setvar
10820 : see if this is a sys/uio.h system
10821 set sys/uio.h i_sysuio
10826 echo "Checking to see if your system supports struct cmsghdr..." >&4
10827 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
10829 case "$d_cmsghdr_s" in
10830 "$define") echo "Yes, it does." ;;
10831 *) echo "No, it doesn't." ;;
10835 : check for const keyword
10837 echo 'Checking to see if your C compiler knows about "const"...' >&4
10838 $cat >const.c <<'EOCP'
10839 typedef struct spug { int drokk; } spug;
10846 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
10848 echo "Yup, it does."
10851 echo "Nope, it doesn't."
10856 : see if copysignl exists
10857 set copysignl d_copysignl
10860 : see if crypt exists
10865 $define) cryptlib='' ;;
10866 *) if set crypt val -f d_crypt; eval $csym; $val; then
10867 echo 'crypt() found.' >&4
10871 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
10872 if $test -z "$cryptlib"; then
10873 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
10877 if $test -z "$cryptlib"; then
10878 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
10882 if $test -z "$cryptlib"; then
10883 cryptlib=`./loc libcrypt$_a "" $libpth`
10887 if $test -z "$cryptlib"; then
10888 echo 'crypt() NOT found.' >&4
10899 : see if this is a crypt.h system
10900 set crypt.h i_crypt
10903 : see if crypt_r exists
10904 set crypt_r d_crypt_r
10906 case "$d_crypt_r" in
10908 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
10909 case "$d_crypt_r_proto:$usethreads" in
10910 ":define") d_crypt_r_proto=define
10911 set d_crypt_r_proto crypt_r $hdrs
10915 case "$d_crypt_r_proto" in
10917 case "$crypt_r_proto" in
10918 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
10919 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCS ;;
10921 case "$crypt_r_proto" in
10922 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
10923 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCD ;;
10925 case "$crypt_r_proto" in
10926 ''|0) d_crypt_r=undef
10928 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
10929 * ) case "$crypt_r_proto" in
10930 REENTRANT_PROTO*) ;;
10931 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
10933 echo "Prototype: $try" ;;
10936 *) case "$usethreads" in
10937 define) echo "crypt_r has no prototype, not using it." >&4 ;;
10948 : get csh whereabouts
10950 'csh') val="$undef" ;;
10951 *) val="$define" ;;
10955 : Respect a hint or command line value for full_csh.
10956 case "$full_csh" in
10957 '') full_csh=$csh ;;
10960 : see if ctermid_r exists
10961 set ctermid_r d_ctermid_r
10963 case "$d_ctermid_r" in
10965 hdrs="$i_systypes sys/types.h define stdio.h "
10966 case "$d_ctermid_r_proto:$usethreads" in
10967 ":define") d_ctermid_r_proto=define
10968 set d_ctermid_r_proto ctermid_r $hdrs
10972 case "$d_ctermid_r_proto" in
10974 case "$ctermid_r_proto" in
10975 ''|0) try='char* ctermid_r(char*);'
10976 ./protochk "extern $try" $hdrs && ctermid_r_proto=B_B ;;
10978 case "$ctermid_r_proto" in
10979 ''|0) d_ctermid_r=undef
10981 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
10982 * ) case "$ctermid_r_proto" in
10983 REENTRANT_PROTO*) ;;
10984 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
10986 echo "Prototype: $try" ;;
10989 *) case "$usethreads" in
10990 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
10997 *) ctermid_r_proto=0
11001 : see if ctime_r exists
11002 set ctime_r d_ctime_r
11004 case "$d_ctime_r" in
11006 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11007 case "$d_ctime_r_proto:$usethreads" in
11008 ":define") d_ctime_r_proto=define
11009 set d_ctime_r_proto ctime_r $hdrs
11013 case "$d_ctime_r_proto" in
11015 case "$ctime_r_proto" in
11016 ''|0) try='char* ctime_r(const time_t*, char*);'
11017 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SB ;;
11019 case "$ctime_r_proto" in
11020 ''|0) try='char* ctime_r(const time_t*, char*, int);'
11021 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SBI ;;
11023 case "$ctime_r_proto" in
11024 ''|0) try='int ctime_r(const time_t*, char*);'
11025 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SB ;;
11027 case "$ctime_r_proto" in
11028 ''|0) try='int ctime_r(const time_t*, char*, int);'
11029 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SBI ;;
11031 case "$ctime_r_proto" in
11032 ''|0) d_ctime_r=undef
11034 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
11035 * ) case "$ctime_r_proto" in
11036 REENTRANT_PROTO*) ;;
11037 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
11039 echo "Prototype: $try" ;;
11042 *) case "$usethreads" in
11043 define) echo "ctime_r has no prototype, not using it." >&4 ;;
11054 : see if cuserid exists
11055 set cuserid d_cuserid
11058 : see if this is a limits.h system
11059 set limits.h i_limits
11062 : see if this is a float.h system
11063 set float.h i_float
11066 : See if number of significant digits in a double precision number is known
11068 $cat >dbl_dig.c <<EOM
11069 #$i_limits I_LIMITS
11072 #include <limits.h>
11078 printf("Contains DBL_DIG");
11081 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
11082 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
11083 echo "DBL_DIG found." >&4
11086 echo "DBL_DIG NOT found." >&4
11093 : see if dbm.h is available
11094 : see if dbmclose exists
11095 set dbmclose d_dbmclose
11098 case "$d_dbmclose" in
11108 *) set rpcsvc/dbm.h i_rpcsvcdbm
11113 *) echo "We won't be including <dbm.h>"
11123 : see if prototype for dbminit is available
11125 set d_dbminitproto dbminit $i_dbm dbm.h
11128 : see if difftime exists
11129 set difftime d_difftime
11132 : see if this is a dirent system
11134 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
11136 echo "<dirent.h> found." >&4
11139 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
11140 echo "<sys/dir.h> found." >&4
11143 xinc=`./findhdr sys/ndir.h`
11145 echo "<dirent.h> NOT found." >&4
11150 : Look for type of directory structure.
11152 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11154 case "$direntrytype" in
11156 case "$i_dirent" in
11157 $define) guess1='struct dirent' ;;
11158 *) guess1='struct direct' ;;
11161 *) guess1="$direntrytype"
11166 'struct dirent') guess2='struct direct' ;;
11167 *) guess2='struct dirent' ;;
11170 if $contains "$guess1" try.c >/dev/null 2>&1; then
11171 direntrytype="$guess1"
11172 echo "Your directory entries are $direntrytype." >&4
11173 elif $contains "$guess2" try.c >/dev/null 2>&1; then
11174 direntrytype="$guess2"
11175 echo "Your directory entries seem to be $direntrytype." >&4
11177 echo "I don't recognize your system's directory entries." >&4
11178 rp="What type is used for directory entries on this system?"
11181 direntrytype="$ans"
11186 : see if the directory entry stores field length
11188 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11189 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
11190 echo "Good, your directory entry keeps length information in d_namlen." >&4
11193 echo "Your directory entry does not know about the d_namlen field." >&4
11200 : see if this is an sysdir system
11201 set sys/dir.h i_sysdir
11204 : see if this is an sysndir system
11205 set sys/ndir.h i_sysndir
11210 $cat >dirfd.c <<EOM
11212 #$i_stdlib I_STDLIB
11214 #include <stdlib.h>
11216 #$i_dirent I_DIRENT /**/
11217 #$i_sysdir I_SYS_DIR /**/
11218 #$i_sysndir I_SYS_NDIR /**/
11219 #$i_systypes I_SYS_TYPES /**/
11220 #if defined(I_SYS_TYPES)
11221 #include <sys/types.h>
11223 #if defined(I_DIRENT)
11224 #include <dirent.h>
11225 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11226 #include <sys/dir.h>
11230 #include <sys/ndir.h>
11234 #include <ndir.h> /* may be wrong in the future */
11236 #include <sys/dir.h>
11242 DIR *dirp = opendir(".");
11243 if (dirfd(dirp) >= 0)
11251 if eval $compile; then
11255 $define) echo "dirfd() found." >&4 ;;
11256 *) echo "dirfd() NOT found." >&4 ;;
11262 : see if dlerror exists
11265 set dlerror d_dlerror
11269 : see if dlfcn is available
11270 set dlfcn.h i_dlfcn
11277 On a few systems, the dynamically loaded modules that perl generates and uses
11278 will need a different extension than shared libs. The default will probably
11284 *) dflt="$dlext" ;;
11286 rp='What is the extension of dynamically loaded modules'
11295 : Check if dlsym need a leading underscore
11301 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11302 $cat >dyna.c <<'EOM'
11309 #$i_stdlib I_STDLIB
11311 #include <stdlib.h>
11315 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
11317 #include <sys/types.h>
11322 extern int fred() ;
11331 int mode = RTLD_LAZY ;
11333 handle = dlopen("./dyna.$dlext", mode) ;
11334 if (handle == NULL) {
11339 symbol = dlsym(handle, "fred") ;
11340 if (symbol == NULL) {
11341 /* try putting a leading underscore */
11342 symbol = dlsym(handle, "_fred") ;
11343 if (symbol == NULL) {
11356 : Call the object file tmp-dyna.o in case dlext=o.
11357 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
11358 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
11359 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
11360 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
11363 1) echo "Test program failed using dlopen." >&4
11364 echo "Perhaps you should not use dynamic loading." >&4;;
11365 2) echo "Test program failed using dlsym." >&4
11366 echo "Perhaps you should not use dynamic loading." >&4;;
11367 3) echo "dlsym needs a leading underscore" >&4
11369 4) echo "dlsym doesn't need a leading underscore." >&4;;
11372 echo "I can't compile and run the test program." >&4
11373 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
11378 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
11383 : see if drand48_r exists
11384 set drand48_r d_drand48_r
11386 case "$d_drand48_r" in
11388 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
11389 case "$d_drand48_r_proto:$usethreads" in
11390 ":define") d_drand48_r_proto=define
11391 set d_drand48_r_proto drand48_r $hdrs
11395 case "$d_drand48_r_proto" in
11397 case "$drand48_r_proto" in
11398 ''|0) try='int drand48_r(struct drand48_data*, double*);'
11399 ./protochk "extern $try" $hdrs && drand48_r_proto=I_ST ;;
11401 case "$drand48_r_proto" in
11402 ''|0) d_drand48_r=undef
11404 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
11405 * ) case "$drand48_r_proto" in
11406 REENTRANT_PROTO*) ;;
11407 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
11409 echo "Prototype: $try" ;;
11412 *) case "$usethreads" in
11413 define) echo "drand48_r has no prototype, not using it." >&4 ;;
11420 *) drand48_r_proto=0
11424 : see if prototype for drand48 is available
11426 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
11429 : see if dup2 exists
11433 : see if eaccess exists
11434 set eaccess d_eaccess
11437 : see if endgrent exists
11438 set endgrent d_endgrent
11441 : see if this is an grp system
11447 xxx=`./findhdr grp.h`
11448 $cppstdin $cppflags $cppminus < $xxx >$$.h
11450 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
11462 set d_grpasswd; eval $setvar
11466 : see if endgrent_r exists
11467 set endgrent_r d_endgrent_r
11469 case "$d_endgrent_r" in
11471 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11472 case "$d_endgrent_r_proto:$usethreads" in
11473 ":define") d_endgrent_r_proto=define
11474 set d_endgrent_r_proto endgrent_r $hdrs
11478 case "$d_endgrent_r_proto" in
11480 case "$endgrent_r_proto" in
11481 ''|0) try='int endgrent_r(FILE**);'
11482 ./protochk "extern $try" $hdrs && endgrent_r_proto=I_H ;;
11484 case "$endgrent_r_proto" in
11485 ''|0) try='void endgrent_r(FILE**);'
11486 ./protochk "extern $try" $hdrs && endgrent_r_proto=V_H ;;
11488 case "$endgrent_r_proto" in
11489 ''|0) d_endgrent_r=undef
11491 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
11492 * ) case "$endgrent_r_proto" in
11493 REENTRANT_PROTO*) ;;
11494 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
11496 echo "Prototype: $try" ;;
11499 *) case "$usethreads" in
11500 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
11507 *) endgrent_r_proto=0
11511 : see if endhostent exists
11512 set endhostent d_endhent
11515 : see if this is a netdb.h system
11516 set netdb.h i_netdb
11519 : see if endhostent_r exists
11520 set endhostent_r d_endhostent_r
11522 case "$d_endhostent_r" in
11524 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11525 case "$d_endhostent_r_proto:$usethreads" in
11526 ":define") d_endhostent_r_proto=define
11527 set d_endhostent_r_proto endhostent_r $hdrs
11531 case "$d_endhostent_r_proto" in
11533 case "$endhostent_r_proto" in
11534 ''|0) try='int endhostent_r(struct hostent_data*);'
11535 ./protochk "extern $try" $hdrs && endhostent_r_proto=I_D ;;
11537 case "$endhostent_r_proto" in
11538 ''|0) try='void endhostent_r(struct hostent_data*);'
11539 ./protochk "extern $try" $hdrs && endhostent_r_proto=V_D ;;
11541 case "$endhostent_r_proto" in
11542 ''|0) d_endhostent_r=undef
11543 endhostent_r_proto=0
11544 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
11545 * ) case "$endhostent_r_proto" in
11546 REENTRANT_PROTO*) ;;
11547 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
11549 echo "Prototype: $try" ;;
11552 *) case "$usethreads" in
11553 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
11555 d_endhostent_r=undef
11556 endhostent_r_proto=0
11560 *) endhostent_r_proto=0
11564 : see if endnetent exists
11565 set endnetent d_endnent
11568 : see if endnetent_r exists
11569 set endnetent_r d_endnetent_r
11571 case "$d_endnetent_r" in
11573 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11574 case "$d_endnetent_r_proto:$usethreads" in
11575 ":define") d_endnetent_r_proto=define
11576 set d_endnetent_r_proto endnetent_r $hdrs
11580 case "$d_endnetent_r_proto" in
11582 case "$endnetent_r_proto" in
11583 ''|0) try='int endnetent_r(struct netent_data*);'
11584 ./protochk "extern $try" $hdrs && endnetent_r_proto=I_D ;;
11586 case "$endnetent_r_proto" in
11587 ''|0) try='void endnetent_r(struct netent_data*);'
11588 ./protochk "extern $try" $hdrs && endnetent_r_proto=V_D ;;
11590 case "$endnetent_r_proto" in
11591 ''|0) d_endnetent_r=undef
11592 endnetent_r_proto=0
11593 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
11594 * ) case "$endnetent_r_proto" in
11595 REENTRANT_PROTO*) ;;
11596 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
11598 echo "Prototype: $try" ;;
11601 *) case "$usethreads" in
11602 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
11604 d_endnetent_r=undef
11605 endnetent_r_proto=0
11609 *) endnetent_r_proto=0
11613 : see if endprotoent exists
11614 set endprotoent d_endpent
11617 : see if endprotoent_r exists
11618 set endprotoent_r d_endprotoent_r
11620 case "$d_endprotoent_r" in
11622 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11623 case "$d_endprotoent_r_proto:$usethreads" in
11624 ":define") d_endprotoent_r_proto=define
11625 set d_endprotoent_r_proto endprotoent_r $hdrs
11629 case "$d_endprotoent_r_proto" in
11631 case "$endprotoent_r_proto" in
11632 ''|0) try='int endprotoent_r(struct protoent_data*);'
11633 ./protochk "extern $try" $hdrs && endprotoent_r_proto=I_D ;;
11635 case "$endprotoent_r_proto" in
11636 ''|0) try='void endprotoent_r(struct protoent_data*);'
11637 ./protochk "extern $try" $hdrs && endprotoent_r_proto=V_D ;;
11639 case "$endprotoent_r_proto" in
11640 ''|0) d_endprotoent_r=undef
11641 endprotoent_r_proto=0
11642 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
11643 * ) case "$endprotoent_r_proto" in
11644 REENTRANT_PROTO*) ;;
11645 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
11647 echo "Prototype: $try" ;;
11650 *) case "$usethreads" in
11651 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
11653 d_endprotoent_r=undef
11654 endprotoent_r_proto=0
11658 *) endprotoent_r_proto=0
11662 : see if endpwent exists
11663 set endpwent d_endpwent
11666 : see if this is a pwd.h system
11672 xxx=`./findhdr pwd.h`
11673 $cppstdin $cppflags $cppminus < $xxx >$$.h
11675 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
11683 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
11691 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
11699 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
11707 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
11715 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
11723 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
11731 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
11743 set d_pwquota; eval $setvar
11744 set d_pwage; eval $setvar
11745 set d_pwchange; eval $setvar
11746 set d_pwclass; eval $setvar
11747 set d_pwexpire; eval $setvar
11748 set d_pwcomment; eval $setvar
11749 set d_pwgecos; eval $setvar
11750 set d_pwpasswd; eval $setvar
11754 : see if endpwent_r exists
11755 set endpwent_r d_endpwent_r
11757 case "$d_endpwent_r" in
11759 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
11760 case "$d_endpwent_r_proto:$usethreads" in
11761 ":define") d_endpwent_r_proto=define
11762 set d_endpwent_r_proto endpwent_r $hdrs
11766 case "$d_endpwent_r_proto" in
11768 case "$endpwent_r_proto" in
11769 ''|0) try='int endpwent_r(FILE**);'
11770 ./protochk "extern $try" $hdrs && endpwent_r_proto=I_H ;;
11772 case "$endpwent_r_proto" in
11773 ''|0) try='void endpwent_r(FILE**);'
11774 ./protochk "extern $try" $hdrs && endpwent_r_proto=V_H ;;
11776 case "$endpwent_r_proto" in
11777 ''|0) d_endpwent_r=undef
11779 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
11780 * ) case "$endpwent_r_proto" in
11781 REENTRANT_PROTO*) ;;
11782 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
11784 echo "Prototype: $try" ;;
11787 *) case "$usethreads" in
11788 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
11795 *) endpwent_r_proto=0
11799 : see if endservent exists
11800 set endservent d_endsent
11803 : see if endservent_r exists
11804 set endservent_r d_endservent_r
11806 case "$d_endservent_r" in
11808 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11809 case "$d_endservent_r_proto:$usethreads" in
11810 ":define") d_endservent_r_proto=define
11811 set d_endservent_r_proto endservent_r $hdrs
11815 case "$d_endservent_r_proto" in
11817 case "$endservent_r_proto" in
11818 ''|0) try='int endservent_r(struct servent_data*);'
11819 ./protochk "extern $try" $hdrs && endservent_r_proto=I_D ;;
11821 case "$endservent_r_proto" in
11822 ''|0) try='void endservent_r(struct servent_data*);'
11823 ./protochk "extern $try" $hdrs && endservent_r_proto=V_D ;;
11825 case "$endservent_r_proto" in
11826 ''|0) d_endservent_r=undef
11827 endservent_r_proto=0
11828 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
11829 * ) case "$endservent_r_proto" in
11830 REENTRANT_PROTO*) ;;
11831 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
11833 echo "Prototype: $try" ;;
11836 *) case "$usethreads" in
11837 define) echo "endservent_r has no prototype, not using it." >&4 ;;
11839 d_endservent_r=undef
11840 endservent_r_proto=0
11844 *) endservent_r_proto=0
11848 : Locate the flags for 'open()'
11851 #include <sys/types.h>
11856 #include <sys/file.h>
11858 #$i_stdlib I_STDLIB
11860 #include <stdlib.h>
11871 : check sys/file.h first to get FREAD on Sun
11872 if $test `./findhdr sys/file.h` && \
11873 set try -DI_SYS_FILE && eval $compile; then
11875 echo "<sys/file.h> defines the O_* constants..." >&4
11876 if $run ./try; then
11877 echo "and you have the 3 argument form of open()." >&4
11880 echo "but not the 3 argument form of open(). Oh, well." >&4
11883 elif $test `./findhdr fcntl.h` && \
11884 set try -DI_FCNTL && eval $compile; then
11886 echo "<fcntl.h> defines the O_* constants..." >&4
11887 if $run ./try; then
11888 echo "and you have the 3 argument form of open()." >&4
11891 echo "but not the 3 argument form of open(). Oh, well." >&4
11896 echo "I can't find the O_* constant definitions! You got problems." >&4
11902 : see which of string.h or strings.h is needed
11904 strings=`./findhdr string.h`
11905 if $test "$strings" && $test -r "$strings"; then
11906 echo "Using <string.h> instead of <strings.h>." >&4
11910 strings=`./findhdr strings.h`
11911 if $test "$strings" && $test -r "$strings"; then
11912 echo "Using <strings.h> instead of <string.h>." >&4
11914 echo "No string header found -- You'll surely have problems." >&4
11919 case "$i_string" in
11920 "$undef") strings=`./findhdr strings.h`;;
11921 *) strings=`./findhdr string.h`;;
11924 : see if this is a sys/file.h system
11929 : do we need to include sys/file.h ?
11933 if $h_sysfile; then
11935 echo "We'll be including <sys/file.h>." >&4
11938 echo "We won't be including <sys/file.h>." >&4
11948 : see if fcntl.h is there
11953 : see if we can include fcntl.h
11959 echo "We'll be including <fcntl.h>." >&4
11962 if $h_sysfile; then
11963 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
11965 echo "We won't be including <fcntl.h>." >&4
11977 : check for non-blocking I/O stuff
11978 case "$h_sysfile" in
11979 true) echo "#include <sys/file.h>" > head.c;;
11982 true) echo "#include <fcntl.h>" > head.c;;
11983 *) echo "#include <sys/fcntl.h>" > head.c;;
11988 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
11989 case "$o_nonblock" in
11991 $cat head.c > try.c
11992 $cat >>try.c <<EOCP
11994 #$i_stdlib I_STDLIB
11996 #include <stdlib.h>
12004 printf("O_NONBLOCK\n");
12008 printf("O_NDELAY\n");
12012 printf("FNDELAY\n");
12019 if eval $compile_ok; then
12020 o_nonblock=`$run ./try`
12021 case "$o_nonblock" in
12022 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
12023 *) echo "Seems like we can use $o_nonblock.";;
12026 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
12029 *) echo "Using $hint value $o_nonblock.";;
12031 $rm -f try try.* .out core
12034 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
12037 $cat head.c > try.c
12038 $cat >>try.c <<EOCP
12040 #include <sys/types.h>
12041 #include <signal.h>
12043 #$i_stdlib I_STDLIB
12045 #include <stdlib.h>
12051 #define MY_O_NONBLOCK $o_nonblock
12052 #ifndef errno /* XXX need better Configure test */
12055 #$i_unistd I_UNISTD
12057 #include <unistd.h>
12059 #$i_string I_STRING
12061 #include <string.h>
12063 #include <strings.h>
12065 $signal_t blech(x) int x; { exit(3); }
12067 $cat >> try.c <<'EOCP'
12075 pipe(pd); /* Down: child -> parent */
12076 pipe(pu); /* Up: parent -> child */
12079 close(pd[1]); /* Parent reads from pd[0] */
12080 close(pu[0]); /* Parent writes (blocking) to pu[1] */
12082 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
12087 signal(SIGALRM, blech);
12089 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
12091 sprintf(string, "%d\n", ret);
12092 write(2, string, strlen(string));
12095 if (errno == EAGAIN) {
12096 printf("EAGAIN\n");
12101 if (errno == EWOULDBLOCK)
12102 printf("EWOULDBLOCK\n");
12105 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
12106 sleep(2); /* Give it time to close our pipe */
12108 ret = read(pd[0], buf, 1); /* Should read EOF */
12110 sprintf(string, "%d\n", ret);
12111 write(4, string, strlen(string));
12115 close(pd[0]); /* We write to pd[1] */
12116 close(pu[1]); /* We read from pu[0] */
12117 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
12118 close(pd[1]); /* Pipe pd is now fully closed! */
12119 exit(0); /* Bye bye, thank you for playing! */
12123 if eval $compile_ok; then
12124 echo "$startsh" >mtry
12125 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
12127 ./mtry >/dev/null 2>&1
12129 0) eagain=`$cat try.out`;;
12130 1) echo "Could not perform non-blocking setting!";;
12131 2) echo "I did a successful read() for something that was not there!";;
12132 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
12133 4) echo "Could not find F_SETFL!";;
12134 *) echo "Something terribly wrong happened during testing.";;
12136 rd_nodata=`$cat try.ret`
12137 echo "A read() system call with no data present returns $rd_nodata."
12138 case "$rd_nodata" in
12141 echo "(That's peculiar, fixing that to be -1.)"
12147 echo "Forcing errno EAGAIN on read() with no data available."
12151 echo "Your read() sets errno to $eagain when no data is available."
12154 status=`$cat try.err`
12156 0) echo "And it correctly returns 0 to signal EOF.";;
12157 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
12158 *) echo "However, your read() returns '$status' on EOF??";;
12161 if test "$status" = "$rd_nodata"; then
12162 echo "WARNING: you can't distinguish between EOF and no data!"
12166 echo "I can't compile the test program--assuming errno EAGAIN will do."
12173 echo "Using $hint value $eagain."
12174 echo "Your read() returns $rd_nodata when no data is present."
12175 case "$d_eofnblk" in
12176 "$define") echo "And you can see EOF because read() returns 0.";;
12177 "$undef") echo "But you can't see EOF status from read() returned value.";;
12179 echo "(Assuming you can't see EOF status from read anyway.)"
12185 $rm -f try try.* .out core head.c mtry
12187 : see if _ptr and _cnt from stdio act std
12190 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12191 echo "(Looks like you have stdio.h from BSD.)"
12192 case "$stdio_ptr" in
12193 '') stdio_ptr='((fp)->_p)'
12196 *) ptr_lval=$d_stdio_ptr_lval;;
12198 case "$stdio_cnt" in
12199 '') stdio_cnt='((fp)->_r)'
12202 *) cnt_lval=$d_stdio_cnt_lval;;
12204 case "$stdio_base" in
12205 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12207 case "$stdio_bufsiz" in
12208 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12210 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12211 echo "(Looks like you have stdio.h from Linux.)"
12212 case "$stdio_ptr" in
12213 '') stdio_ptr='((fp)->_IO_read_ptr)'
12216 *) ptr_lval=$d_stdio_ptr_lval;;
12218 case "$stdio_cnt" in
12219 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12222 *) cnt_lval=$d_stdio_cnt_lval;;
12224 case "$stdio_base" in
12225 '') stdio_base='((fp)->_IO_read_base)';;
12227 case "$stdio_bufsiz" in
12228 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12231 case "$stdio_ptr" in
12232 '') stdio_ptr='((fp)->_ptr)'
12235 *) ptr_lval=$d_stdio_ptr_lval;;
12237 case "$stdio_cnt" in
12238 '') stdio_cnt='((fp)->_cnt)'
12241 *) cnt_lval=$d_stdio_cnt_lval;;
12243 case "$stdio_base" in
12244 '') stdio_base='((fp)->_base)';;
12246 case "$stdio_bufsiz" in
12247 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12251 : test whether _ptr and _cnt really work
12252 echo "Checking how std your stdio is..." >&4
12255 #$i_stdlib I_STDLIB
12257 #include <stdlib.h>
12259 #define FILE_ptr(fp) $stdio_ptr
12260 #define FILE_cnt(fp) $stdio_cnt
12262 FILE *fp = fopen("try.c", "r");
12265 18 <= FILE_cnt(fp) &&
12266 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12274 if eval $compile && $to try.c; then
12275 if $run ./try; then
12276 echo "Your stdio acts pretty std."
12279 echo "Your stdio isn't very std."
12282 echo "Your stdio doesn't appear very std."
12286 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12287 # direct buffer manipulation no longer works. The Configure tests
12288 # should be changed to correctly detect this, but until then,
12289 # the following check should at least let perl compile and run.
12290 # (This quick fix should be updated before 5.8.1.)
12291 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12292 # A. Dougherty, June 3, 2002.
12293 case "$d_gnulibc" in
12295 case "$gnulibc_version" in
12299 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12308 : Can _ptr be used as an lvalue?
12309 case "$d_stdstdio$ptr_lval" in
12310 $define$define) val=$define ;;
12313 set d_stdio_ptr_lval
12316 : Can _cnt be used as an lvalue?
12317 case "$d_stdstdio$cnt_lval" in
12318 $define$define) val=$define ;;
12321 set d_stdio_cnt_lval
12325 : test whether setting _ptr sets _cnt as a side effect
12326 d_stdio_ptr_lval_sets_cnt="$undef"
12327 d_stdio_ptr_lval_nochange_cnt="$undef"
12328 case "$d_stdio_ptr_lval$d_stdstdio" in
12330 echo "Checking to see what happens if we set the stdio ptr..." >&4
12333 /* Can we scream? */
12334 /* Eat dust sed :-) */
12335 /* In the buffer space, no one can hear you scream. */
12336 #$i_stdlib I_STDLIB
12338 #include <stdlib.h>
12340 #define FILE_ptr(fp) $stdio_ptr
12341 #define FILE_cnt(fp) $stdio_cnt
12342 #include <sys/types.h>
12344 FILE *fp = fopen("try.c", "r");
12349 puts("Fail even to read");
12352 c = getc(fp); /* Read away the first # */
12354 puts("Fail even to read");
12358 18 <= FILE_cnt(fp) &&
12359 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12361 puts("Fail even to read");
12364 ptr = (char*) FILE_ptr(fp);
12365 cnt = (size_t)FILE_cnt(fp);
12367 FILE_ptr(fp) += 42;
12369 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12370 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12373 if (FILE_cnt(fp) <= 20) {
12374 printf ("Fail (<20 chars to test)");
12377 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12378 puts("Fail compare");
12381 if (cnt == FILE_cnt(fp)) {
12382 puts("Pass_unchanged");
12385 if (FILE_cnt(fp) == (cnt - 42)) {
12386 puts("Pass_changed");
12389 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12395 if eval $compile && $to try.c; then
12396 case `$run ./try` in
12398 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12399 d_stdio_ptr_lval_sets_cnt="$define" ;;
12401 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12402 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12404 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12406 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12409 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12415 : see if _base is also standard
12417 case "$d_stdstdio" in
12421 #$i_stdlib I_STDLIB
12423 #include <stdlib.h>
12425 #define FILE_base(fp) $stdio_base
12426 #define FILE_bufsiz(fp) $stdio_bufsiz
12428 FILE *fp = fopen("try.c", "r");
12431 19 <= FILE_bufsiz(fp) &&
12432 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
12439 if eval $compile && $to try.c; then
12440 if $run ./try; then
12441 echo "And its _base field acts std."
12444 echo "But its _base field isn't std."
12447 echo "However, it seems to be lacking the _base field."
12455 : see if fast_stdio exists
12457 case "$d_stdstdio:$d_stdio_ptr_lval" in
12459 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
12461 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
12472 : see if fchdir exists
12473 set fchdir d_fchdir
12476 : see if fchmod exists
12477 set fchmod d_fchmod
12480 : see if fchown exists
12481 set fchown d_fchown
12484 : see if this is an fcntl system
12489 : See if fcntl-based locking works.
12491 #$i_stdlib I_STDLIB
12493 #include <stdlib.h>
12495 #include <unistd.h>
12497 #include <signal.h>
12498 $signal_t blech(x) int x; { exit(3); }
12500 #if defined(F_SETLK) && defined(F_SETLKW)
12501 struct flock flock;
12503 fd = open("try.c", O_RDONLY);
12504 flock.l_type = F_RDLCK;
12505 flock.l_whence = SEEK_SET;
12506 flock.l_start = flock.l_len = 0;
12507 signal(SIGALRM, blech);
12509 retval = fcntl(fd, F_SETLK, &flock);
12511 (retval < 0 ? exit(2) : exit(0));
12517 echo "Checking if fcntl-based file locking works... "
12521 if eval $compile_ok; then
12522 if $run ./try; then
12523 echo "Yes, it seems to work."
12526 echo "Nope, it didn't work."
12531 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
12532 *** This is (almost) impossible.
12533 *** If your NFS lock daemons are not feeling well, something like
12534 *** this may happen, please investigate. Cannot continue, aborting.
12542 echo "I'm unable to compile the test program, so I'll assume not."
12547 echo "Nope, since you don't even have fcntl()."
12550 set d_fcntl_can_lock
12555 : check for fd_set items
12558 Checking to see how well your C compiler handles fd_set and friends ...
12561 #$i_stdlib I_STDLIB
12563 #include <stdlib.h>
12565 #$i_systime I_SYS_TIME
12566 #$i_sysselct I_SYS_SELECT
12567 #$d_socket HAS_SOCKET
12568 #include <sys/types.h>
12570 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
12573 #include <sys/time.h>
12575 #ifdef I_SYS_SELECT
12576 #include <sys/select.h>
12585 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
12593 if eval $compile; then
12594 d_fds_bits="$define"
12596 echo "Well, your system knows about the normal fd_set typedef..." >&4
12597 if $run ./try; then
12598 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
12599 d_fd_macros="$define"
12602 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
12604 d_fd_macros="$undef"
12608 Hmm, your compiler has some difficulty with fd_set. Checking further...
12611 if eval $compile; then
12612 d_fds_bits="$undef"
12614 echo "Well, your system has some sort of fd_set available..." >&4
12615 if $run ./try; then
12616 echo "and you have the normal fd_set macros." >&4
12617 d_fd_macros="$define"
12620 but not the normal fd_set macros! Gross! More work for me...
12622 d_fd_macros="$undef"
12625 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
12627 d_fds_bits="$undef"
12628 d_fd_macros="$undef"
12633 : see if fgetpos exists
12634 set fgetpos d_fgetpos
12637 : see if finite exists
12638 set finite d_finite
12641 : see if finitel exists
12642 set finitel d_finitel
12645 : see if flock exists
12649 : see if prototype for flock is available
12651 set d_flockproto flock $i_sysfile sys/file.h
12654 : see if fork exists
12658 : see if fp_class exists
12659 set fp_class d_fp_class
12662 : see if pathconf exists
12663 set pathconf d_pathconf
12666 : see if fpathconf exists
12667 set fpathconf d_fpathconf
12670 : see if fpclass exists
12671 set fpclass d_fpclass
12674 : see if fpclassify exists
12675 set fpclassify d_fpclassify
12678 : see if fpclassl exists
12679 set fpclassl d_fpclassl
12683 : check for fpos64_t
12685 echo "Checking to see if you have fpos64_t..." >&4
12688 int main() { fpos64_t x = 7; }
12691 if eval $compile; then
12693 echo "You have fpos64_t."
12696 echo "You do not have fpos64_t."
12697 case "$fpossize" in
12698 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
12705 : see if frexpl exists
12706 set frexpl d_frexpl
12709 : see if this is a sys/param system
12710 set sys/param.h i_sysparam
12713 : see if this is a sys/mount.h system
12714 set sys/mount.h i_sysmount
12719 echo "Checking to see if your system supports struct fs_data..." >&4
12720 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
12722 case "$d_fs_data_s" in
12723 "$define") echo "Yes, it does." ;;
12724 *) echo "No, it doesn't." ;;
12727 : see if fseeko exists
12728 set fseeko d_fseeko
12730 case "$longsize" in
12731 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
12734 : see if fsetpos exists
12735 set fsetpos d_fsetpos
12739 : see if fstatfs exists
12740 set fstatfs d_fstatfs
12744 : see if statvfs exists
12745 set statvfs d_statvfs
12748 : see if fstatvfs exists
12749 set fstatvfs d_fstatvfs
12753 : see if fsync exists
12757 : see if ftello exists
12758 set ftello d_ftello
12760 case "$longsize" in
12761 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
12765 : check for a working futimes
12767 echo "Checking for a working futimes()" >&4
12770 #include <sys/time.h>
12777 fd = open ("try.c", O_RDWR);
12778 if (-1 == fd) exit (1);
12779 rv = futimes (fd, NULL);
12780 exit (rv == -1 ? errno : 0);
12784 if eval $compile; then
12788 0) echo "Yes, it does" >&4
12789 d_futimes="$define"
12791 *) echo "No, it has futimes, but it isn't working ($rc) (probably harmless)\n" >&4
12795 echo "No, it does not (probably harmless)\n" >&4
12797 $rm -f try.* try core core.try.*
12799 : see if getcwd exists
12800 set getcwd d_getcwd
12803 : see if getespwnam exists
12804 set getespwnam d_getespwnam
12808 : see if getfsstat exists
12809 set getfsstat d_getfsstat
12812 : see if getgrent exists
12813 set getgrent d_getgrent
12816 : see if getgrent_r exists
12817 set getgrent_r d_getgrent_r
12819 case "$d_getgrent_r" in
12821 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12822 case "$d_getgrent_r_proto:$usethreads" in
12823 ":define") d_getgrent_r_proto=define
12824 set d_getgrent_r_proto getgrent_r $hdrs
12828 case "$d_getgrent_r_proto" in
12830 case "$getgrent_r_proto" in
12831 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
12832 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBWR ;;
12834 case "$getgrent_r_proto" in
12835 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
12836 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIR ;;
12838 case "$getgrent_r_proto" in
12839 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
12840 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBW ;;
12842 case "$getgrent_r_proto" in
12843 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
12844 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBI ;;
12846 case "$getgrent_r_proto" in
12847 ''|0) try='int getgrent_r(struct group*, char*, int);'
12848 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBI ;;
12850 case "$getgrent_r_proto" in
12851 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
12852 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIH ;;
12854 case "$getgrent_r_proto" in
12855 ''|0) d_getgrent_r=undef
12857 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
12858 * ) case "$getgrent_r_proto" in
12859 REENTRANT_PROTO*) ;;
12860 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
12862 echo "Prototype: $try" ;;
12865 *) case "$usethreads" in
12866 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
12873 *) getgrent_r_proto=0
12877 : see if getgrgid_r exists
12878 set getgrgid_r d_getgrgid_r
12880 case "$d_getgrgid_r" in
12882 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12883 case "$d_getgrgid_r_proto:$usethreads" in
12884 ":define") d_getgrgid_r_proto=define
12885 set d_getgrgid_r_proto getgrgid_r $hdrs
12889 case "$d_getgrgid_r_proto" in
12891 case "$getgrgid_r_proto" in
12892 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
12893 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
12895 case "$getgrgid_r_proto" in
12896 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
12897 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
12899 case "$getgrgid_r_proto" in
12900 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
12901 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
12903 case "$getgrgid_r_proto" in
12904 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
12905 ./protochk "extern $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
12907 case "$getgrgid_r_proto" in
12908 ''|0) d_getgrgid_r=undef
12910 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
12911 * ) case "$getgrgid_r_proto" in
12912 REENTRANT_PROTO*) ;;
12913 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
12915 echo "Prototype: $try" ;;
12918 *) case "$usethreads" in
12919 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
12926 *) getgrgid_r_proto=0
12930 : see if getgrnam_r exists
12931 set getgrnam_r d_getgrnam_r
12933 case "$d_getgrnam_r" in
12935 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12936 case "$d_getgrnam_r_proto:$usethreads" in
12937 ":define") d_getgrnam_r_proto=define
12938 set d_getgrnam_r_proto getgrnam_r $hdrs
12942 case "$d_getgrnam_r_proto" in
12944 case "$getgrnam_r_proto" in
12945 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
12946 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
12948 case "$getgrnam_r_proto" in
12949 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
12950 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
12952 case "$getgrnam_r_proto" in
12953 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
12954 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CBI ;;
12956 case "$getgrnam_r_proto" in
12957 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
12958 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
12960 case "$getgrnam_r_proto" in
12961 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
12962 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
12964 case "$getgrnam_r_proto" in
12965 ''|0) d_getgrnam_r=undef
12967 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
12968 * ) case "$getgrnam_r_proto" in
12969 REENTRANT_PROTO*) ;;
12970 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
12972 echo "Prototype: $try" ;;
12975 *) case "$usethreads" in
12976 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
12983 *) getgrnam_r_proto=0
12987 : see if gethostbyaddr exists
12988 set gethostbyaddr d_gethbyaddr
12991 : see if gethostbyname exists
12992 set gethostbyname d_gethbyname
12995 : see if gethostent exists
12996 set gethostent d_gethent
12999 : see how we will look up host name
13002 if set gethostname val -f d_gethname; eval $csym; $val; then
13003 echo 'gethostname() found.' >&4
13004 d_gethname="$define"
13007 if set uname val -f d_uname; eval $csym; $val; then
13010 uname() was found, but you're running xenix, and older versions of xenix
13011 have a broken uname(). If you don't really know whether your xenix is old
13012 enough to have a broken system call, use the default answer.
13017 "$define") dflt=n;;
13019 rp='Is your uname() broken?'
13022 n*) d_uname="$define"; call=uname;;
13025 echo 'uname() found.' >&4
13032 case "$d_gethname" in
13033 '') d_gethname="$undef";;
13036 '') d_uname="$undef";;
13038 case "$d_uname$d_gethname" in
13043 Every now and then someone has a $call() that lies about the hostname
13044 but can't be fixed for political or economic reasons. If you wish, I can
13045 pretend $call() isn't there and maybe compute hostname at run-time
13046 thanks to the '$phostname' command.
13049 rp="Shall I ignore $call() from now on?"
13052 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
13055 case "$phostname" in
13056 '') aphostname='';;
13057 *) case "$aphostname" in
13059 *) set X $phostname
13063 file=`./loc $file $file $pth`
13064 aphostname=`echo $file $*`
13069 case "$d_uname$d_gethname" in
13072 case "$phostname" in
13074 echo "There will be no way for $package to get your hostname." >&4;;
13076 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
13080 case "$d_phostname" in
13081 '') d_phostname="$undef";;
13084 : see if gethostbyaddr_r exists
13085 set gethostbyaddr_r d_gethostbyaddr_r
13087 case "$d_gethostbyaddr_r" in
13089 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13090 case "$d_gethostbyaddr_r_proto:$usethreads" in
13091 ":define") d_gethostbyaddr_r_proto=define
13092 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
13096 case "$d_gethostbyaddr_r_proto" in
13098 case "$gethostbyaddr_r_proto" in
13099 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13100 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
13102 case "$gethostbyaddr_r_proto" in
13103 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
13104 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
13106 case "$gethostbyaddr_r_proto" in
13107 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
13108 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
13110 case "$gethostbyaddr_r_proto" in
13111 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
13112 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
13114 case "$gethostbyaddr_r_proto" in
13115 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
13116 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
13118 case "$gethostbyaddr_r_proto" in
13119 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
13120 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
13122 case "$gethostbyaddr_r_proto" in
13123 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
13124 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
13126 case "$gethostbyaddr_r_proto" in
13127 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
13128 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
13130 case "$gethostbyaddr_r_proto" in
13131 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
13132 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
13134 case "$gethostbyaddr_r_proto" in
13135 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
13136 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
13138 case "$gethostbyaddr_r_proto" in
13139 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13140 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
13142 case "$gethostbyaddr_r_proto" in
13143 ''|0) d_gethostbyaddr_r=undef
13144 gethostbyaddr_r_proto=0
13145 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
13146 * ) case "$gethostbyaddr_r_proto" in
13147 REENTRANT_PROTO*) ;;
13148 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
13150 echo "Prototype: $try" ;;
13153 *) case "$usethreads" in
13154 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
13156 d_gethostbyaddr_r=undef
13157 gethostbyaddr_r_proto=0
13161 *) gethostbyaddr_r_proto=0
13165 : see if gethostbyname_r exists
13166 set gethostbyname_r d_gethostbyname_r
13168 case "$d_gethostbyname_r" in
13170 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13171 case "$d_gethostbyname_r_proto:$usethreads" in
13172 ":define") d_gethostbyname_r_proto=define
13173 set d_gethostbyname_r_proto gethostbyname_r $hdrs
13177 case "$d_gethostbyname_r_proto" in
13179 case "$gethostbyname_r_proto" in
13180 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
13181 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
13183 case "$gethostbyname_r_proto" in
13184 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
13185 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
13187 case "$gethostbyname_r_proto" in
13188 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
13189 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
13191 case "$gethostbyname_r_proto" in
13192 ''|0) d_gethostbyname_r=undef
13193 gethostbyname_r_proto=0
13194 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
13195 * ) case "$gethostbyname_r_proto" in
13196 REENTRANT_PROTO*) ;;
13197 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
13199 echo "Prototype: $try" ;;
13202 *) case "$usethreads" in
13203 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13205 d_gethostbyname_r=undef
13206 gethostbyname_r_proto=0
13210 *) gethostbyname_r_proto=0
13214 : see if gethostent_r exists
13215 set gethostent_r d_gethostent_r
13217 case "$d_gethostent_r" in
13219 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13220 case "$d_gethostent_r_proto:$usethreads" in
13221 ":define") d_gethostent_r_proto=define
13222 set d_gethostent_r_proto gethostent_r $hdrs
13226 case "$d_gethostent_r_proto" in
13228 case "$gethostent_r_proto" in
13229 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
13230 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
13232 case "$gethostent_r_proto" in
13233 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
13234 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBIE ;;
13236 case "$gethostent_r_proto" in
13237 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
13238 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBIE ;;
13240 case "$gethostent_r_proto" in
13241 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
13242 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBI ;;
13244 case "$gethostent_r_proto" in
13245 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
13246 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBI ;;
13248 case "$gethostent_r_proto" in
13249 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13250 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SD ;;
13252 case "$gethostent_r_proto" in
13253 ''|0) d_gethostent_r=undef
13254 gethostent_r_proto=0
13255 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13256 * ) case "$gethostent_r_proto" in
13257 REENTRANT_PROTO*) ;;
13258 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13260 echo "Prototype: $try" ;;
13263 *) case "$usethreads" in
13264 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13266 d_gethostent_r=undef
13267 gethostent_r_proto=0
13271 *) gethostent_r_proto=0
13275 : see if prototypes for various gethostxxx netdb.h functions are available
13277 set d_gethostprotos gethostent $i_netdb netdb.h
13280 : see if getitimer exists
13281 set getitimer d_getitimer
13284 : see if getlogin exists
13285 set getlogin d_getlogin
13288 : see if getlogin_r exists
13289 set getlogin_r d_getlogin_r
13291 case "$d_getlogin_r" in
13293 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
13294 case "$d_getlogin_r_proto:$usethreads" in
13295 ":define") d_getlogin_r_proto=define
13296 set d_getlogin_r_proto getlogin_r $hdrs
13300 case "$d_getlogin_r_proto" in
13302 case "$getlogin_r_proto" in
13303 ''|0) try='int getlogin_r(char*, size_t);'
13304 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BW ;;
13306 case "$getlogin_r_proto" in
13307 ''|0) try='int getlogin_r(char*, int);'
13308 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BI ;;
13310 case "$getlogin_r_proto" in
13311 ''|0) try='char* getlogin_r(char*, size_t);'
13312 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BW ;;
13314 case "$getlogin_r_proto" in
13315 ''|0) try='char* getlogin_r(char*, int);'
13316 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BI ;;
13318 case "$getlogin_r_proto" in
13319 ''|0) d_getlogin_r=undef
13321 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
13322 * ) case "$getlogin_r_proto" in
13323 REENTRANT_PROTO*) ;;
13324 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
13326 echo "Prototype: $try" ;;
13329 *) case "$usethreads" in
13330 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
13337 *) getlogin_r_proto=0
13341 : see if getmnt exists
13342 set getmnt d_getmnt
13345 : see if getmntent exists
13346 set getmntent d_getmntent
13349 : see if getnetbyaddr exists
13350 set getnetbyaddr d_getnbyaddr
13353 : see if getnetbyname exists
13354 set getnetbyname d_getnbyname
13357 : see if getnetent exists
13358 set getnetent d_getnent
13361 : see if getnetbyaddr_r exists
13362 set getnetbyaddr_r d_getnetbyaddr_r
13364 case "$d_getnetbyaddr_r" in
13366 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13367 case "$d_getnetbyaddr_r_proto:$usethreads" in
13368 ":define") d_getnetbyaddr_r_proto=define
13369 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
13373 case "$d_getnetbyaddr_r_proto" in
13375 case "$getnetbyaddr_r_proto" in
13376 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
13377 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
13379 case "$getnetbyaddr_r_proto" in
13380 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
13381 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
13383 case "$getnetbyaddr_r_proto" in
13384 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
13385 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
13387 case "$getnetbyaddr_r_proto" in
13388 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
13389 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
13391 case "$getnetbyaddr_r_proto" in
13392 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
13393 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
13395 case "$getnetbyaddr_r_proto" in
13396 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
13397 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
13399 case "$getnetbyaddr_r_proto" in
13400 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
13401 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
13403 case "$getnetbyaddr_r_proto" in
13404 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
13405 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
13407 case "$getnetbyaddr_r_proto" in
13408 ''|0) d_getnetbyaddr_r=undef
13409 getnetbyaddr_r_proto=0
13410 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
13411 * ) case "$getnetbyaddr_r_proto" in
13412 REENTRANT_PROTO*) ;;
13413 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
13415 echo "Prototype: $try" ;;
13418 *) case "$usethreads" in
13419 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
13421 d_getnetbyaddr_r=undef
13422 getnetbyaddr_r_proto=0
13426 *) getnetbyaddr_r_proto=0
13430 : see if getnetbyname_r exists
13431 set getnetbyname_r d_getnetbyname_r
13433 case "$d_getnetbyname_r" in
13435 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13436 case "$d_getnetbyname_r_proto:$usethreads" in
13437 ":define") d_getnetbyname_r_proto=define
13438 set d_getnetbyname_r_proto getnetbyname_r $hdrs
13442 case "$d_getnetbyname_r_proto" in
13444 case "$getnetbyname_r_proto" in
13445 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
13446 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
13448 case "$getnetbyname_r_proto" in
13449 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
13450 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
13452 case "$getnetbyname_r_proto" in
13453 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
13454 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
13456 case "$getnetbyname_r_proto" in
13457 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
13458 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
13460 case "$getnetbyname_r_proto" in
13461 ''|0) d_getnetbyname_r=undef
13462 getnetbyname_r_proto=0
13463 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
13464 * ) case "$getnetbyname_r_proto" in
13465 REENTRANT_PROTO*) ;;
13466 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
13468 echo "Prototype: $try" ;;
13471 *) case "$usethreads" in
13472 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
13474 d_getnetbyname_r=undef
13475 getnetbyname_r_proto=0
13479 *) getnetbyname_r_proto=0
13483 : see if getnetent_r exists
13484 set getnetent_r d_getnetent_r
13486 case "$d_getnetent_r" in
13488 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13489 case "$d_getnetent_r_proto:$usethreads" in
13490 ":define") d_getnetent_r_proto=define
13491 set d_getnetent_r_proto getnetent_r $hdrs
13495 case "$d_getnetent_r_proto" in
13497 case "$getnetent_r_proto" in
13498 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
13499 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
13501 case "$getnetent_r_proto" in
13502 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
13503 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBIE ;;
13505 case "$getnetent_r_proto" in
13506 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
13507 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBIE ;;
13509 case "$getnetent_r_proto" in
13510 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
13511 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBI ;;
13513 case "$getnetent_r_proto" in
13514 ''|0) try='int getnetent_r(struct netent*, char*, int);'
13515 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBI ;;
13517 case "$getnetent_r_proto" in
13518 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
13519 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SD ;;
13521 case "$getnetent_r_proto" in
13522 ''|0) d_getnetent_r=undef
13523 getnetent_r_proto=0
13524 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
13525 * ) case "$getnetent_r_proto" in
13526 REENTRANT_PROTO*) ;;
13527 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
13529 echo "Prototype: $try" ;;
13532 *) case "$usethreads" in
13533 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
13535 d_getnetent_r=undef
13536 getnetent_r_proto=0
13540 *) getnetent_r_proto=0
13544 : see if prototypes for various getnetxxx netdb.h functions are available
13546 set d_getnetprotos getnetent $i_netdb netdb.h
13549 : see if getpagesize exists
13550 set getpagesize d_getpagsz
13554 : see if getprotobyname exists
13555 set getprotobyname d_getpbyname
13558 : see if getprotobynumber exists
13559 set getprotobynumber d_getpbynumber
13562 : see if getprotoent exists
13563 set getprotoent d_getpent
13566 : see if getpgid exists
13567 set getpgid d_getpgid
13570 : see if getpgrp2 exists
13571 set getpgrp2 d_getpgrp2
13574 : see if getppid exists
13575 set getppid d_getppid
13578 : see if getpriority exists
13579 set getpriority d_getprior
13582 : see if getprotobyname_r exists
13583 set getprotobyname_r d_getprotobyname_r
13585 case "$d_getprotobyname_r" in
13587 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13588 case "$d_getprotobyname_r_proto:$usethreads" in
13589 ":define") d_getprotobyname_r_proto=define
13590 set d_getprotobyname_r_proto getprotobyname_r $hdrs
13594 case "$d_getprotobyname_r_proto" in
13596 case "$getprotobyname_r_proto" in
13597 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
13598 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
13600 case "$getprotobyname_r_proto" in
13601 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
13602 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
13604 case "$getprotobyname_r_proto" in
13605 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
13606 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
13608 case "$getprotobyname_r_proto" in
13609 ''|0) d_getprotobyname_r=undef
13610 getprotobyname_r_proto=0
13611 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
13612 * ) case "$getprotobyname_r_proto" in
13613 REENTRANT_PROTO*) ;;
13614 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
13616 echo "Prototype: $try" ;;
13619 *) case "$usethreads" in
13620 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
13622 d_getprotobyname_r=undef
13623 getprotobyname_r_proto=0
13627 *) getprotobyname_r_proto=0
13631 : see if getprotobynumber_r exists
13632 set getprotobynumber_r d_getprotobynumber_r
13634 case "$d_getprotobynumber_r" in
13636 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13637 case "$d_getprotobynumber_r_proto:$usethreads" in
13638 ":define") d_getprotobynumber_r_proto=define
13639 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
13643 case "$d_getprotobynumber_r_proto" in
13645 case "$getprotobynumber_r_proto" in
13646 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
13647 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
13649 case "$getprotobynumber_r_proto" in
13650 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
13651 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
13653 case "$getprotobynumber_r_proto" in
13654 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
13655 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
13657 case "$getprotobynumber_r_proto" in
13658 ''|0) d_getprotobynumber_r=undef
13659 getprotobynumber_r_proto=0
13660 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
13661 * ) case "$getprotobynumber_r_proto" in
13662 REENTRANT_PROTO*) ;;
13663 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
13665 echo "Prototype: $try" ;;
13668 *) case "$usethreads" in
13669 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
13671 d_getprotobynumber_r=undef
13672 getprotobynumber_r_proto=0
13676 *) getprotobynumber_r_proto=0
13680 : see if getprotoent_r exists
13681 set getprotoent_r d_getprotoent_r
13683 case "$d_getprotoent_r" in
13685 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13686 case "$d_getprotoent_r_proto:$usethreads" in
13687 ":define") d_getprotoent_r_proto=define
13688 set d_getprotoent_r_proto getprotoent_r $hdrs
13692 case "$d_getprotoent_r_proto" in
13694 case "$getprotoent_r_proto" in
13695 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
13696 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
13698 case "$getprotoent_r_proto" in
13699 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
13700 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBI ;;
13702 case "$getprotoent_r_proto" in
13703 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
13704 ./protochk "extern $try" $hdrs && getprotoent_r_proto=S_SBI ;;
13706 case "$getprotoent_r_proto" in
13707 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
13708 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SD ;;
13710 case "$getprotoent_r_proto" in
13711 ''|0) d_getprotoent_r=undef
13712 getprotoent_r_proto=0
13713 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
13714 * ) case "$getprotoent_r_proto" in
13715 REENTRANT_PROTO*) ;;
13716 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
13718 echo "Prototype: $try" ;;
13721 *) case "$usethreads" in
13722 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
13724 d_getprotoent_r=undef
13725 getprotoent_r_proto=0
13729 *) getprotoent_r_proto=0
13733 : see if prototypes for various getprotoxxx netdb.h functions are available
13735 set d_getprotoprotos getprotoent $i_netdb netdb.h
13738 : see if getprpwnam exists
13739 set getprpwnam d_getprpwnam
13742 : see if getpwent exists
13743 set getpwent d_getpwent
13746 : see if getpwent_r exists
13747 set getpwent_r d_getpwent_r
13749 case "$d_getpwent_r" in
13751 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13752 case "$d_getpwent_r_proto:$usethreads" in
13753 ":define") d_getpwent_r_proto=define
13754 set d_getpwent_r_proto getpwent_r $hdrs
13758 case "$d_getpwent_r_proto" in
13760 case "$getpwent_r_proto" in
13761 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
13762 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBWR ;;
13764 case "$getpwent_r_proto" in
13765 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
13766 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIR ;;
13768 case "$getpwent_r_proto" in
13769 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
13770 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBW ;;
13772 case "$getpwent_r_proto" in
13773 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
13774 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBI ;;
13776 case "$getpwent_r_proto" in
13777 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
13778 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBI ;;
13780 case "$getpwent_r_proto" in
13781 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
13782 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIH ;;
13784 case "$getpwent_r_proto" in
13785 ''|0) d_getpwent_r=undef
13787 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
13788 * ) case "$getpwent_r_proto" in
13789 REENTRANT_PROTO*) ;;
13790 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
13792 echo "Prototype: $try" ;;
13795 *) case "$usethreads" in
13796 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
13803 *) getpwent_r_proto=0
13807 : see if getpwnam_r exists
13808 set getpwnam_r d_getpwnam_r
13810 case "$d_getpwnam_r" in
13812 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13813 case "$d_getpwnam_r_proto:$usethreads" in
13814 ":define") d_getpwnam_r_proto=define
13815 set d_getpwnam_r_proto getpwnam_r $hdrs
13819 case "$d_getpwnam_r_proto" in
13821 case "$getpwnam_r_proto" in
13822 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
13823 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
13825 case "$getpwnam_r_proto" in
13826 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
13827 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
13829 case "$getpwnam_r_proto" in
13830 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
13831 ./protochk "extern $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
13833 case "$getpwnam_r_proto" in
13834 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
13835 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
13837 case "$getpwnam_r_proto" in
13838 ''|0) d_getpwnam_r=undef
13840 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
13841 * ) case "$getpwnam_r_proto" in
13842 REENTRANT_PROTO*) ;;
13843 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
13845 echo "Prototype: $try" ;;
13848 *) case "$usethreads" in
13849 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
13856 *) getpwnam_r_proto=0
13860 : see if getpwuid_r exists
13861 set getpwuid_r d_getpwuid_r
13863 case "$d_getpwuid_r" in
13865 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13866 case "$d_getpwuid_r_proto:$usethreads" in
13867 ":define") d_getpwuid_r_proto=define
13868 set d_getpwuid_r_proto getpwuid_r $hdrs
13872 case "$d_getpwuid_r_proto" in
13874 case "$getpwuid_r_proto" in
13875 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
13876 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
13878 case "$getpwuid_r_proto" in
13879 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
13880 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
13882 case "$getpwuid_r_proto" in
13883 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
13884 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
13886 case "$getpwuid_r_proto" in
13887 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
13888 ./protochk "extern $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
13890 case "$getpwuid_r_proto" in
13891 ''|0) d_getpwuid_r=undef
13893 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
13894 * ) case "$getpwuid_r_proto" in
13895 REENTRANT_PROTO*) ;;
13896 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
13898 echo "Prototype: $try" ;;
13901 *) case "$usethreads" in
13902 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
13909 *) getpwuid_r_proto=0
13914 : see if getservbyname exists
13915 set getservbyname d_getsbyname
13918 : see if getservbyport exists
13919 set getservbyport d_getsbyport
13922 : see if getservent exists
13923 set getservent d_getsent
13926 : see if getservbyname_r exists
13927 set getservbyname_r d_getservbyname_r
13929 case "$d_getservbyname_r" in
13931 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13932 case "$d_getservbyname_r_proto:$usethreads" in
13933 ":define") d_getservbyname_r_proto=define
13934 set d_getservbyname_r_proto getservbyname_r $hdrs
13938 case "$d_getservbyname_r_proto" in
13940 case "$getservbyname_r_proto" in
13941 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
13942 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
13944 case "$getservbyname_r_proto" in
13945 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
13946 ./protochk "extern $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
13948 case "$getservbyname_r_proto" in
13949 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
13950 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
13952 case "$getservbyname_r_proto" in
13953 ''|0) d_getservbyname_r=undef
13954 getservbyname_r_proto=0
13955 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
13956 * ) case "$getservbyname_r_proto" in
13957 REENTRANT_PROTO*) ;;
13958 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
13960 echo "Prototype: $try" ;;
13963 *) case "$usethreads" in
13964 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
13966 d_getservbyname_r=undef
13967 getservbyname_r_proto=0
13971 *) getservbyname_r_proto=0
13975 : see if getservbyport_r exists
13976 set getservbyport_r d_getservbyport_r
13978 case "$d_getservbyport_r" in
13980 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13981 case "$d_getservbyport_r_proto:$usethreads" in
13982 ":define") d_getservbyport_r_proto=define
13983 set d_getservbyport_r_proto getservbyport_r $hdrs
13987 case "$d_getservbyport_r_proto" in
13989 case "$getservbyport_r_proto" in
13990 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
13991 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
13993 case "$getservbyport_r_proto" in
13994 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
13995 ./protochk "extern $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
13997 case "$getservbyport_r_proto" in
13998 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
13999 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
14001 case "$getservbyport_r_proto" in
14002 ''|0) d_getservbyport_r=undef
14003 getservbyport_r_proto=0
14004 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
14005 * ) case "$getservbyport_r_proto" in
14006 REENTRANT_PROTO*) ;;
14007 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
14009 echo "Prototype: $try" ;;
14012 *) case "$usethreads" in
14013 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
14015 d_getservbyport_r=undef
14016 getservbyport_r_proto=0
14020 *) getservbyport_r_proto=0
14024 : see if getservent_r exists
14025 set getservent_r d_getservent_r
14027 case "$d_getservent_r" in
14029 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14030 case "$d_getservent_r_proto:$usethreads" in
14031 ":define") d_getservent_r_proto=define
14032 set d_getservent_r_proto getservent_r $hdrs
14036 case "$d_getservent_r_proto" in
14038 case "$getservent_r_proto" in
14039 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
14040 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBWR ;;
14042 case "$getservent_r_proto" in
14043 ''|0) try='int getservent_r(struct servent*, char*, int);'
14044 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBI ;;
14046 case "$getservent_r_proto" in
14047 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
14048 ./protochk "extern $try" $hdrs && getservent_r_proto=S_SBI ;;
14050 case "$getservent_r_proto" in
14051 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
14052 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SD ;;
14054 case "$getservent_r_proto" in
14055 ''|0) d_getservent_r=undef
14056 getservent_r_proto=0
14057 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
14058 * ) case "$getservent_r_proto" in
14059 REENTRANT_PROTO*) ;;
14060 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
14062 echo "Prototype: $try" ;;
14065 *) case "$usethreads" in
14066 define) echo "getservent_r has no prototype, not using it." >&4 ;;
14068 d_getservent_r=undef
14069 getservent_r_proto=0
14073 *) getservent_r_proto=0
14077 : see if prototypes for various getservxxx netdb.h functions are available
14079 set d_getservprotos getservent $i_netdb netdb.h
14082 : see if getspnam exists
14083 set getspnam d_getspnam
14086 : see if this is a shadow.h system
14087 set shadow.h i_shadow
14090 : see if getspnam_r exists
14091 set getspnam_r d_getspnam_r
14093 case "$d_getspnam_r" in
14095 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
14096 case "$d_getspnam_r_proto:$usethreads" in
14097 ":define") d_getspnam_r_proto=define
14098 set d_getspnam_r_proto getspnam_r $hdrs
14102 case "$d_getspnam_r_proto" in
14104 case "$getspnam_r_proto" in
14105 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
14106 ./protochk "extern $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
14108 case "$getspnam_r_proto" in
14109 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
14110 ./protochk "extern $try" $hdrs && getspnam_r_proto=S_CSBI ;;
14112 case "$getspnam_r_proto" in
14113 ''|0) d_getspnam_r=undef
14115 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
14116 * ) case "$getspnam_r_proto" in
14117 REENTRANT_PROTO*) ;;
14118 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
14120 echo "Prototype: $try" ;;
14123 *) case "$usethreads" in
14124 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
14131 *) getspnam_r_proto=0
14135 : see if gettimeofday or ftime exists
14136 set gettimeofday d_gettimeod
14138 case "$d_gettimeod" in
14144 val="$undef"; set d_ftime; eval $setvar
14147 case "$d_gettimeod$d_ftime" in
14150 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
14154 : see if gmtime_r exists
14155 set gmtime_r d_gmtime_r
14157 case "$d_gmtime_r" in
14159 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14160 case "$d_gmtime_r_proto:$usethreads" in
14161 ":define") d_gmtime_r_proto=define
14162 set d_gmtime_r_proto gmtime_r $hdrs
14166 case "$d_gmtime_r_proto" in
14168 case "$gmtime_r_proto" in
14169 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
14170 ./protochk "extern $try" $hdrs && gmtime_r_proto=S_TS ;;
14172 case "$gmtime_r_proto" in
14173 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
14174 ./protochk "extern $try" $hdrs && gmtime_r_proto=I_TS ;;
14176 case "$gmtime_r_proto" in
14177 ''|0) d_gmtime_r=undef
14179 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
14180 * ) case "$gmtime_r_proto" in
14181 REENTRANT_PROTO*) ;;
14182 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
14184 echo "Prototype: $try" ;;
14187 *) case "$usethreads" in
14188 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
14195 *) gmtime_r_proto=0
14199 : see if hasmntopt exists
14200 set hasmntopt d_hasmntopt
14203 : see if this is a netinet/in.h or sys/in.h system
14204 set netinet/in.h i_niin sys/in.h i_sysin
14207 : see if arpa/inet.h has to be included
14208 set arpa/inet.h i_arpainet
14211 : see if htonl --and friends-- exists
14216 : Maybe they are macros.
14219 $cat >htonl.c <<EOM
14221 #include <sys/types.h>
14222 #$i_niin I_NETINET_IN
14224 #$i_arpainet I_ARPA_INET
14225 #ifdef I_NETINET_IN
14226 #include <netinet/in.h>
14229 #include <sys/in.h>
14232 #include <arpa/inet.h>
14235 printf("Defined as a macro.");
14238 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
14239 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
14241 echo "But it seems to be defined as a macro." >&4
14249 : see if ilogbl exists
14250 set ilogbl d_ilogbl
14255 if set index val -f; eval $csym; $val; then
14256 if set strchr val -f d_strchr; eval $csym; $val; then
14257 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14260 echo "strchr() found." >&4
14264 echo "index() found." >&4
14269 echo "index() found." >&4
14272 if set strchr val -f d_strchr; eval $csym; $val; then
14275 echo "strchr() found." >&4
14277 echo "No index() or strchr() found!" >&4
14282 set d_strchr; eval $setvar
14284 set d_index; eval $setvar
14286 : check whether inet_aton exists
14287 set inet_aton d_inetaton
14292 $cat >isascii.c <<EOCP
14295 #$i_stdlib I_STDLIB
14297 #include <stdlib.h>
14308 if eval $compile; then
14309 echo "isascii() found." >&4
14312 echo "isascii() NOT found." >&4
14319 : see if isfinite exists
14320 set isfinite d_isfinite
14323 : see if isinf exists
14327 : see if isnan exists
14331 : see if isnanl exists
14332 set isnanl d_isnanl
14335 : see if killpg exists
14336 set killpg d_killpg
14339 : see if lchown exists
14341 $cat > try.c <<'EOCP'
14342 /* System header to define __stub macros and hopefully few prototypes,
14343 which can conflict with char lchown(); below. */
14344 #include <assert.h>
14345 /* Override any gcc2 internal prototype to avoid an error. */
14346 /* We use char because int might match the return type of a gcc2
14347 builtin and then its argument prototype would still apply. */
14350 /* The GNU C library defines this for functions which it implements
14351 to always fail with ENOSYS. Some functions are actually named
14352 something starting with __ and the normal name is an alias. */
14353 #if defined (__stub_lchown) || defined (__stub___lchown)
14361 if eval $compile; then
14362 $echo "lchown() found." >&4
14365 $echo "lchown() NOT found." >&4
14371 : See if number of significant digits in a double precision number is known
14373 $cat >ldbl_dig.c <<EOM
14374 #$i_limits I_LIMITS
14377 #include <limits.h>
14383 printf("Contains LDBL_DIG");
14386 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
14387 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
14388 echo "LDBL_DIG found." >&4
14391 echo "LDBL_DIG NOT found." >&4
14398 : see if this is a math.h system
14402 d_libm_lib_version="$undef"
14405 : check to see if math.h defines _LIB_VERSION
14407 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
14409 #include <unistd.h>
14411 int main (int argc, char *argv[])
14413 printf ("%d\n", _LIB_VERSION);
14418 if eval $compile; then
14420 echo "Yes, it does ($foo)" >&4
14421 d_libm_lib_version="$define"
14423 echo "No, it does not (probably harmless)\n" >&4
14425 $rm -f try.* try core core.try.*
14430 : see if link exists
14434 : see if localtime_r exists
14435 set localtime_r d_localtime_r
14437 case "$d_localtime_r" in
14439 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14440 case "$d_localtime_r_proto:$usethreads" in
14441 ":define") d_localtime_r_proto=define
14442 set d_localtime_r_proto localtime_r $hdrs
14446 case "$d_localtime_r_proto" in
14448 case "$localtime_r_proto" in
14449 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
14450 ./protochk "extern $try" $hdrs && localtime_r_proto=S_TS ;;
14452 case "$localtime_r_proto" in
14453 ''|0) try='int localtime_r(const time_t*, struct tm*);'
14454 ./protochk "extern $try" $hdrs && localtime_r_proto=I_TS ;;
14456 case "$localtime_r_proto" in
14457 ''|0) d_localtime_r=undef
14458 localtime_r_proto=0
14459 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
14460 * ) case "$localtime_r_proto" in
14461 REENTRANT_PROTO*) ;;
14462 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
14464 echo "Prototype: $try" ;;
14467 *) case "$usethreads" in
14468 define) echo "localtime_r has no prototype, not using it." >&4 ;;
14470 d_localtime_r=undef
14471 localtime_r_proto=0
14475 *) localtime_r_proto=0
14479 : see if localeconv exists
14480 set localeconv d_locconv
14483 : see if lockf exists
14487 : see if prototype for lseek is available
14489 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
14492 : see if lstat exists
14496 : see if madvise exists
14497 set madvise d_madvise
14500 : see if malloc_size exists
14501 set malloc_size d_malloc_size
14504 : see if malloc_size_good exists
14505 set malloc_good_size d_malloc_good_size
14508 : see if mblen exists
14512 : see if mbstowcs exists
14513 set mbstowcs d_mbstowcs
14516 : see if mbtowc exists
14517 set mbtowc d_mbtowc
14520 : see if memchr exists
14521 set memchr d_memchr
14524 : see if memcmp exists
14525 set memcmp d_memcmp
14528 : see if memcpy exists
14529 set memcpy d_memcpy
14532 : see if memmove exists
14533 set memmove d_memmove
14536 : see if memset exists
14537 set memset d_memset
14540 : see if mkdir exists
14544 : see if mkdtemp exists
14545 set mkdtemp d_mkdtemp
14548 : see if mkfifo exists
14549 set mkfifo d_mkfifo
14552 : see if mkstemp exists
14553 set mkstemp d_mkstemp
14556 : see if mkstemps exists
14557 set mkstemps d_mkstemps
14560 : see if mktime exists
14561 set mktime d_mktime
14564 : see if this is a sys/mman.h system
14565 set sys/mman.h i_sysmman
14568 : see if mmap exists
14571 : see what shmat returns
14572 : default to something harmless
14574 case "$i_sysmman$d_mmap" in
14576 $cat >mmap.c <<'END'
14577 #include <sys/mman.h>
14580 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
14585 echo "and it returns ($mmaptype)." >&4
14591 : see if sqrtl exists
14595 : see if scalbnl exists
14596 set scalbnl d_scalbnl
14599 : see if modfl exists
14603 : see if prototype for modfl is available
14605 set d_modflproto modfl $i_math math.h
14608 d_modfl_pow32_bug="$undef"
14610 case "$d_longdbl$d_modfl" in
14613 Checking to see whether your modfl() is okay for large values...
14619 if $test "X$d_modflproto" != "X$define"; then
14620 $cat >>try.c <<EOCP
14621 /* Sigh. many current glibcs provide the function, but do not prototype it. */
14622 long double modfl (long double, long double *);
14625 $cat >>try.c <<EOCP
14627 long double nv = 4294967303.15;
14633 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
14637 case "$osname:$gccversion" in
14638 aix:) saveccflags="$ccflags"
14639 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
14642 if eval $compile; then
14645 *" 4294967303.150000 1.150000 4294967302.000000")
14646 echo >&4 "Your modfl() is broken for large values."
14647 d_modfl_pow32_bug="$define"
14649 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
14653 *" 4294967303.150000 0.150000 4294967303.000000")
14654 echo >&4 "Your modfl() seems okay for large values."
14656 *) echo >&4 "I don't understand your modfl() at all."
14660 $rm -f try.* try core core.try.*
14662 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
14665 case "$osname:$gccversion" in
14666 aix:) ccflags="$saveccflags" ;; # restore
14671 if $test "$uselongdouble" = "$define"; then
14673 if $test "$d_sqrtl" != "$define"; then
14674 message="$message sqrtl"
14676 if $test "$d_modfl" != "$define"; then
14677 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
14678 echo "You have both aintl and copysignl, so I can emulate modfl."
14680 message="$message modfl"
14683 if $test "$d_frexpl" != "$define"; then
14684 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
14685 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
14687 message="$message frexpl"
14691 if $test "$message" != ""; then
14694 *** You requested the use of long doubles but you do not seem to have
14695 *** the following mathematical functions needed for long double support:
14697 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
14698 *** Cannot continue, aborting.
14706 : see if mprotect exists
14707 set mprotect d_mprotect
14710 : see if msgctl exists
14711 set msgctl d_msgctl
14714 : see if msgget exists
14715 set msgget d_msgget
14718 : see if msgsnd exists
14719 set msgsnd d_msgsnd
14722 : see if msgrcv exists
14723 set msgrcv d_msgrcv
14726 : see how much of the 'msg*(2)' library is present.
14729 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
14730 *"$undef"*) h_msg=false;;
14734 case "`ipcs 2>&1`" in
14735 "SVID messages"*"not configured"*)
14736 echo "Your $osname does not have the msg*(2) configured." >&4
14739 set msgctl d_msgctl
14741 set msgget d_msgget
14743 set msgsnd d_msgsnd
14745 set msgrcv d_msgrcv
14751 : we could also check for sys/ipc.h ...
14752 if $h_msg && $test `./findhdr sys/msg.h`; then
14753 echo "You have the full msg*(2) library." >&4
14756 echo "You don't have the full msg*(2) library." >&4
14764 echo "Checking to see if your system supports struct msghdr..." >&4
14765 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
14767 case "$d_msghdr_s" in
14768 "$define") echo "Yes, it does." ;;
14769 *) echo "No, it doesn't." ;;
14773 : see if msync exists
14777 : see if munmap exists
14778 set munmap d_munmap
14781 : see if nice exists
14785 : see if this is a langinfo.h system
14786 set langinfo.h i_langinfo
14789 : see if nl_langinfo exists
14790 set nl_langinfo d_nl_langinfo
14793 : check for length of character
14795 case "$charsize" in
14797 echo "Checking to see how big your characters are (hey, you never know)..." >&4
14800 #$i_stdlib I_STDLIB
14802 #include <stdlib.h>
14806 printf("%d\n", (int)sizeof(char));
14811 if eval $compile_ok; then
14815 echo "(I can't seem to compile the test program. Guessing...)"
14822 rp="What is the size of a character (in bytes)?"
14827 : check for volatile keyword
14829 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
14830 $cat >try.c <<'EOCP'
14833 typedef struct _goo_struct goo_struct;
14834 goo_struct * volatile goo = ((goo_struct *)0);
14835 struct _goo_struct {
14840 typedef unsigned short foo_t;
14841 char *volatile foo;
14843 volatile foo_t blech;
14847 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
14849 echo "Yup, it does."
14852 echo "Nope, it doesn't."
14860 $echo "Choosing the C types to be used for Perl's internal types..." >&4
14862 case "$use64bitint:$d_quad:$quadtype" in
14865 uvtype="$uquadtype"
14870 uvtype="unsigned long"
14876 case "$uselongdouble:$d_longdbl" in
14878 nvtype="long double"
14879 nvsize=$longdblsize
14886 $echo "(IV will be "$ivtype", $ivsize bytes)"
14887 $echo "(UV will be "$uvtype", $uvsize bytes)"
14888 $echo "(NV will be "$nvtype", $nvsize bytes)"
14891 #$i_inttypes I_INTTYPES
14893 #include <inttypes.h>
14898 int8_t i = INT8_MAX;
14899 uint8_t u = UINT8_MAX;
14900 printf("int8_t\n");
14903 int16_t i = INT16_MAX;
14904 uint16_t i = UINT16_MAX;
14905 printf("int16_t\n");
14908 int32_t i = INT32_MAX;
14909 uint32_t u = UINT32_MAX;
14910 printf("int32_t\n");
14916 '') case "$charsize" in
14918 u8type="unsigned char"
14927 if eval $compile; then
14928 case "`$run ./try`" in
14929 int8_t) i8type=int8_t
14939 '') if $test $charsize -ge 1; then
14941 u8type="unsigned char"
14949 '') case "$shortsize" in
14951 u16type="unsigned short"
14959 '') set try -DINT16
14960 if eval $compile; then
14961 case "`$run ./try`" in
14973 '') if $test $shortsize -ge 2; then
14975 u16type="unsigned short"
14983 '') case "$longsize" in
14985 u32type="unsigned long"
14989 *) case "$intsize" in
14991 u32type="unsigned int"
15001 '') set try -DINT32
15002 if eval $compile; then
15003 case "`$run ./try`" in
15015 '') if $test $intsize -ge 4; then
15017 u32type="unsigned int"
15025 '') case "$d_quad:$quadtype" in
15027 i64type="$quadtype"
15028 u64type="$uquadtype"
15036 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
15037 : volatile so that the compiler has to store it out to memory.
15038 if test X"$d_volatile" = X"$define"; then
15043 #$i_stdlib I_STDLIB
15045 #include <stdlib.h>
15047 #include <sys/types.h>
15048 #include <signal.h>
15050 $volatile int bletched = 0;
15051 $signal_t blech(s) int s; { bletched = 1; }
15056 int n = 8 * $uvsize;
15059 signal(SIGFPE, blech);
15062 for (i = 0; i < n; i++) {
15063 u = u << 1 | ($uvtype)1;
15065 if (($uvtype)d != u)
15069 d = ($nvtype)(u - 1);
15070 if (($uvtype)d != (u - 1))
15078 printf("%d\n", ((i == n) ? -n : i));
15084 d_nv_preserves_uv="$undef"
15085 if eval $compile; then
15086 nv_preserves_uv_bits="`$run ./try`"
15088 case "$nv_preserves_uv_bits" in
15090 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
15091 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
15092 d_nv_preserves_uv="$define"
15094 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
15095 d_nv_preserves_uv="$undef" ;;
15096 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
15097 nv_preserves_uv_bits="$undef" ;;
15102 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
15103 : volatile so that the compiler has to store it out to memory.
15104 if test X"$d_volatile" = X"$define"; then
15109 #$i_stdlib I_STDLIB
15111 #include <stdlib.h>
15113 #$i_string I_STRING
15115 # include <string.h>
15117 # include <strings.h>
15119 #include <sys/types.h>
15120 #include <signal.h>
15122 $volatile int bletched = 0;
15123 $signal_t blech(s) int s; { bletched = 1; }
15126 int checkit($nvtype d, char *where) {
15127 unsigned char *p = (char *)&d;
15128 unsigned char *end = p + sizeof(d);
15138 printf("No - %s: 0x", where);
15140 printf ("%02X", *p++);
15145 int main(int argc, char **argv) {
15148 fail += checkit(d, "0.0");
15150 /* The compiler shouldn't be assuming that bletched is 0 */
15153 fail += checkit(d, "bleched");
15156 signal(SIGFPE, blech);
15159 /* Paranoia - the compiler should have no way of knowing that ANSI says
15160 that argv[argc] will always be NULL. Actually, if it did assume this it
15161 would be buggy, as this is C and main() can be called from elsewhere in
15163 d = argv[argc] ? 1 : 0;
15166 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
15169 fail += checkit(d, "ternary");
15171 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
15174 printf("No - memset doesn't give 0.0\n");
15175 /* This might just blow up: */
15176 printf("(gives %g)\n", d);
15182 printf("No - something bleched\n");
15187 printf("No - %d fail(s)\n", fail);
15196 d_nv_zero_is_allbits_zero="$undef"
15197 if eval $compile; then
15203 0.0 is represented as all bits zero in memory
15205 d_nv_zero_is_allbits_zero="$define"
15208 0.0 is not represented as all bits zero in memory
15210 d_nv_zero_is_allbits_zero="$undef"
15215 0.0 is not represented as all bits zero in memory
15217 d_nv_zero_is_allbits_zero="$undef"
15225 : check for off64_t
15227 echo "Checking to see if you have off64_t..." >&4
15229 #include <sys/types.h>
15230 #include <unistd.h>
15231 int main() { off64_t x = 7; }
15234 if eval $compile; then
15236 echo "You have off64_t."
15239 echo "You do not have off64_t."
15240 case "$lseeksize" in
15241 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
15248 : how to create joinable pthreads
15249 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
15251 echo "Checking what constant to use for creating joinable pthreads..." >&4
15252 $cat >try.c <<'EOCP'
15253 #include <pthread.h>
15255 int detachstate = JOINABLE;
15258 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
15259 if eval $compile; then
15260 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
15261 val="$undef" # Yes, undef.
15262 set d_old_pthread_create_joinable
15265 set old_pthread_create_joinable
15268 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
15269 if eval $compile; then
15270 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
15272 set d_old_pthread_create_joinable
15274 val=PTHREAD_CREATE_UNDETACHED
15275 set old_pthread_create_joinable
15278 set try -DJOINABLE=__UNDETACHED
15279 if eval $compile; then
15280 echo "You seem to use __UNDETACHED." >&4
15282 set d_old_pthread_create_joinable
15285 set old_pthread_create_joinable
15288 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
15290 set d_old_pthread_create_joinable
15293 set old_pthread_create_joinable
15300 d_old_pthread_create_joinable="$undef"
15301 old_pthread_create_joinable=""
15304 : see if pause exists
15308 : see if pipe exists
15312 : see if poll exists
15316 : see if readlink exists
15317 set readlink d_readlink
15323 case "$d_readlink" in
15325 if $issymlink /proc/self/exe ; then
15326 $ls -l /proc/self/exe > reflect
15327 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15328 echo "You have Linux-like /proc/self/exe."
15329 procselfexe='"/proc/self/exe"'
15333 if $issymlink /proc/curproc/file ; then
15334 $ls -l /proc/curproc/file > reflect
15335 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15336 echo "You have BSD-like /proc/curproc/file."
15337 procselfexe='"/proc/curproc/file"'
15347 : see whether the pthread_atfork exists
15349 #include <pthread.h>
15352 #ifdef PTHREAD_ATFORK
15353 pthread_atfork(NULL,NULL,NULL);
15358 : see if pthread_atfork exists
15359 set try -DPTHREAD_ATFORK
15360 if eval $compile; then
15365 case "$usethreads" in
15368 $define) echo 'pthread_atfork found.' >&4 ;;
15369 *) echo 'pthread_atfork NOT found.' >&4 ;;
15372 set d_pthread_atfork
15375 : see if pthread_attr_setscope exists
15376 set pthread_attr_setscope d_pthread_attr_setscope
15380 : see whether the various POSIXish _yields exist
15382 #include <pthread.h>
15388 #ifdef PTHREAD_YIELD
15391 #ifdef PTHREAD_YIELD_NULL
15392 pthread_yield(NULL);
15398 : see if sched_yield exists
15399 set try -DSCHED_YIELD
15400 if eval $compile; then
15402 sched_yield='sched_yield()'
15406 case "$usethreads" in
15409 $define) echo 'sched_yield() found.' >&4 ;;
15410 *) echo 'sched_yield() NOT found.' >&4 ;;
15416 : see if pthread_yield exists
15417 set try -DPTHREAD_YIELD
15418 if eval $compile; then
15420 case "$sched_yield" in
15421 '') sched_yield='pthread_yield()' ;;
15424 set try -DPTHREAD_YIELD_NULL
15425 if eval $compile; then
15427 case "$sched_yield" in
15428 '') sched_yield='pthread_yield(NULL)' ;;
15434 case "$usethreads" in
15437 $define) echo 'pthread_yield() found.' >&4 ;;
15438 *) echo 'pthread_yield() NOT found.' >&4 ;;
15442 set d_pthread_yield
15445 case "$sched_yield" in
15446 '') sched_yield=undef ;;
15451 : see if random_r exists
15452 set random_r d_random_r
15454 case "$d_random_r" in
15456 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
15457 case "$d_random_r_proto:$usethreads" in
15458 ":define") d_random_r_proto=define
15459 set d_random_r_proto random_r $hdrs
15463 case "$d_random_r_proto" in
15465 case "$random_r_proto" in
15466 ''|0) try='int random_r(int*, struct random_data*);'
15467 ./protochk "extern $try" $hdrs && random_r_proto=I_iS ;;
15469 case "$random_r_proto" in
15470 ''|0) try='int random_r(long*, struct random_data*);'
15471 ./protochk "extern $try" $hdrs && random_r_proto=I_lS ;;
15473 case "$random_r_proto" in
15474 ''|0) try='int random_r(struct random_data*, int32_t*);'
15475 ./protochk "extern $try" $hdrs && random_r_proto=I_St ;;
15477 case "$random_r_proto" in
15478 ''|0) d_random_r=undef
15480 echo "Disabling random_r, cannot determine prototype." >&4 ;;
15481 * ) case "$random_r_proto" in
15482 REENTRANT_PROTO*) ;;
15483 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
15485 echo "Prototype: $try" ;;
15488 *) case "$usethreads" in
15489 define) echo "random_r has no prototype, not using it." >&4 ;;
15496 *) random_r_proto=0
15500 : see if readdir and friends exist
15501 set readdir d_readdir
15503 set seekdir d_seekdir
15505 set telldir d_telldir
15507 set rewinddir d_rewinddir
15510 : see if readdir64_r exists
15511 set readdir64_r d_readdir64_r
15513 case "$d_readdir64_r" in
15515 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15516 case "$d_readdir64_r_proto:$usethreads" in
15517 ":define") d_readdir64_r_proto=define
15518 set d_readdir64_r_proto readdir64_r $hdrs
15522 case "$d_readdir64_r_proto" in
15524 case "$readdir64_r_proto" in
15525 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
15526 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TSR ;;
15528 case "$readdir64_r_proto" in
15529 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
15530 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TS ;;
15532 case "$readdir64_r_proto" in
15533 ''|0) d_readdir64_r=undef
15534 readdir64_r_proto=0
15535 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
15536 * ) case "$readdir64_r_proto" in
15537 REENTRANT_PROTO*) ;;
15538 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
15540 echo "Prototype: $try" ;;
15543 *) case "$usethreads" in
15544 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
15546 d_readdir64_r=undef
15547 readdir64_r_proto=0
15551 *) readdir64_r_proto=0
15555 : see if readdir_r exists
15556 set readdir_r d_readdir_r
15558 case "$d_readdir_r" in
15560 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15561 case "$d_readdir_r_proto:$usethreads" in
15562 ":define") d_readdir_r_proto=define
15563 set d_readdir_r_proto readdir_r $hdrs
15567 case "$d_readdir_r_proto" in
15569 case "$readdir_r_proto" in
15570 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
15571 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TSR ;;
15573 case "$readdir_r_proto" in
15574 ''|0) try='int readdir_r(DIR*, struct dirent*);'
15575 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TS ;;
15577 case "$readdir_r_proto" in
15578 ''|0) d_readdir_r=undef
15580 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
15581 * ) case "$readdir_r_proto" in
15582 REENTRANT_PROTO*) ;;
15583 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
15585 echo "Prototype: $try" ;;
15588 *) case "$usethreads" in
15589 define) echo "readdir_r has no prototype, not using it." >&4 ;;
15596 *) readdir_r_proto=0
15600 : see if readv exists
15604 : see if recvmsg exists
15605 set recvmsg d_recvmsg
15608 : see if rename exists
15609 set rename d_rename
15612 : see if rmdir exists
15616 : see if memory.h is available.
15621 : See if it conflicts with string.h
15627 $cppstdin $cppflags $cppminus < $strings > mem.h
15628 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
15630 echo "We won't be including <memory.h>."
15640 : can bcopy handle overlapping blocks?
15643 case "$d_memmove" in
15644 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
15645 *) case "$d_bcopy" in
15647 echo "Checking to see if bcopy() can do overlapping copies..." >&4
15649 #$i_memory I_MEMORY
15650 #$i_stdlib I_STDLIB
15651 #$i_string I_STRING
15652 #$i_unistd I_UNISTD
15654 $cat >>try.c <<'EOCP'
15657 # include <memory.h>
15660 # include <stdlib.h>
15663 # include <string.h>
15665 # include <strings.h>
15668 # include <unistd.h> /* Needed for NetBSD */
15672 char buf[128], abc[128];
15678 /* Copy "abcde..." string to char abc[] so that gcc doesn't
15679 try to store the string in read-only memory. */
15680 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
15682 for (align = 7; align >= 0; align--) {
15683 for (len = 36; len; len--) {
15685 bcopy(abc, b, len);
15686 for (off = 1; off <= len; off++) {
15687 bcopy(b, b+off, len);
15688 bcopy(b+off, b, len);
15689 if (bcmp(b, abc, len))
15698 if eval $compile_ok; then
15699 if ./try 2>/dev/null; then
15700 echo "Yes, it can."
15703 echo "It can't, sorry."
15706 echo "(I can't compile the test program, so we'll assume not...)"
15710 $rm -f try.* try core
15716 : can memcpy handle overlapping blocks?
15719 case "$d_memmove" in
15720 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
15721 *) case "$d_memcpy" in
15723 echo "Checking to see if memcpy() can do overlapping copies..." >&4
15725 #$i_memory I_MEMORY
15726 #$i_stdlib I_STDLIB
15727 #$i_string I_STRING
15728 #$i_unistd I_UNISTD
15730 $cat >>try.c <<'EOCP'
15733 # include <memory.h>
15736 # include <stdlib.h>
15739 # include <string.h>
15741 # include <strings.h>
15744 # include <unistd.h> /* Needed for NetBSD */
15748 char buf[128], abc[128];
15754 /* Copy "abcde..." string to char abc[] so that gcc doesn't
15755 try to store the string in read-only memory. */
15756 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
15758 for (align = 7; align >= 0; align--) {
15759 for (len = 36; len; len--) {
15761 memcpy(b, abc, len);
15762 for (off = 1; off <= len; off++) {
15763 memcpy(b+off, b, len);
15764 memcpy(b, b+off, len);
15765 if (memcmp(b, abc, len))
15774 if eval $compile_ok; then
15775 if ./try 2>/dev/null; then
15776 echo "Yes, it can."
15779 echo "It can't, sorry."
15782 echo "(I can't compile the test program, so we'll assume not...)"
15786 $rm -f try.* try core
15792 : can memcmp be trusted to compare relative magnitude?
15794 case "$d_memcmp" in
15797 echo "Checking if your memcmp() can compare relative magnitude..." >&4
15799 #$i_memory I_MEMORY
15800 #$i_stdlib I_STDLIB
15801 #$i_string I_STRING
15802 #$i_unistd I_UNISTD
15804 $cat >>try.c <<'EOCP'
15807 # include <memory.h>
15810 # include <stdlib.h>
15813 # include <string.h>
15815 # include <strings.h>
15818 # include <unistd.h> /* Needed for NetBSD */
15824 if ((a < b) && memcmp(&a, &b, 1) < 0)
15830 if eval $compile_ok; then
15831 if $run ./try 2>/dev/null; then
15832 echo "Yes, it can."
15835 echo "No, it can't (it uses signed chars)."
15838 echo "(I can't compile the test program, so we'll assume not...)"
15842 $rm -f try.* try core
15846 : see if prototype for sbrk is available
15848 set d_sbrkproto sbrk $i_unistd unistd.h
15851 : see if select exists
15852 set select d_select
15855 : see if semctl exists
15856 set semctl d_semctl
15859 : see if semget exists
15860 set semget d_semget
15863 : see if semop exists
15867 : see how much of the 'sem*(2)' library is present.
15870 case "$d_semctl$d_semget$d_semop" in
15871 *"$undef"*) h_sem=false;;
15875 case "`ipcs 2>&1`" in
15876 "SVID messages"*"not configured"*)
15877 echo "Your $osname does not have the sem*(2) configured." >&4
15880 set semctl d_semctl
15882 set semget d_semget
15890 : we could also check for sys/ipc.h ...
15891 if $h_sem && $test `./findhdr sys/sem.h`; then
15892 echo "You have the full sem*(2) library." >&4
15895 echo "You don't have the full sem*(2) library." >&4
15901 : see whether sys/sem.h defines union semun
15903 $cat > try.c <<'END'
15904 #include <sys/types.h>
15905 #include <sys/ipc.h>
15906 #include <sys/sem.h>
15907 int main () { union semun semun; semun.buf = 0; }
15910 if eval $compile; then
15911 echo "You have union semun in <sys/sem.h>." >&4
15914 echo "You do not have union semun in <sys/sem.h>." >&4
15921 : see how to do semctl IPC_STAT
15928 # define S_IRUSR S_IREAD
15929 # define S_IWUSR S_IWRITE
15930 # define S_IXUSR S_IEXEC
15932 # define S_IRUSR 0400
15933 # define S_IWUSR 0200
15934 # define S_IXUSR 0100
15936 # define S_IRGRP (S_IRUSR>>3)
15937 # define S_IWGRP (S_IWUSR>>3)
15938 # define S_IXGRP (S_IXUSR>>3)
15939 # define S_IROTH (S_IRUSR>>6)
15940 # define S_IWOTH (S_IWUSR>>6)
15941 # define S_IXOTH (S_IXUSR>>6)
15944 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
15945 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
15946 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
15949 : see whether semctl IPC_STAT can use union semun
15950 case "$d_semctl_semun" in
15954 #include <sys/types.h>
15955 #include <sys/ipc.h>
15956 #include <sys/sem.h>
15957 #include <sys/stat.h>
15964 #$d_union_semun HAS_UNION_SEMUN
15967 #ifndef HAS_UNION_SEMUN
15970 struct semid_ds *buf;
15971 unsigned short *array;
15977 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
15978 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
15980 struct semid_ds argbuf;
15983 st = semctl(sem, 0, IPC_STAT, arg);
15987 # endif /* IPC_STAT */
15988 printf("semctl IPC_STAT failed: errno = %d\n", errno);
15990 if (semctl(sem, 0, IPC_RMID, arg) != 0)
15991 # endif /* IPC_RMID */
15992 printf("semctl IPC_RMID failed: errno = %d\n", errno);
15994 #endif /* IPC_PRIVATE && ... */
15995 printf("semget failed: errno = %d\n", errno);
16000 if eval $compile; then
16003 semun) val="$define" ;;
16011 case "$d_semctl_semun" in
16013 echo "You can use union semun for semctl IPC_STAT." >&4
16016 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
16021 : see whether semctl IPC_STAT can use struct semid_ds pointer
16022 case "$d_semctl_semid_ds" in
16025 $cat > try.c <<'END'
16026 #include <sys/types.h>
16027 #include <sys/ipc.h>
16028 #include <sys/sem.h>
16029 #include <sys/stat.h>
16037 struct semid_ds arg;
16040 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16041 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16044 st = semctl(sem, 0, IPC_STAT, &arg);
16046 printf("semid_ds\n");
16048 # endif /* IPC_STAT */
16049 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16051 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
16052 # endif /* IPC_RMID */
16053 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16055 #endif /* IPC_PRIVATE && ... */
16056 printf("semget failed: errno = %d\n", errno);
16062 if eval $compile; then
16065 semid_ds) val="$define" ;;
16069 set d_semctl_semid_ds
16073 case "$d_semctl_semid_ds" in
16075 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
16077 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
16084 # We do not have the full sem*(2) library, so assume we can not
16090 set d_semctl_semid_ds
16095 : see if sendmsg exists
16096 set sendmsg d_sendmsg
16099 : see if setegid exists
16100 set setegid d_setegid
16103 : see if seteuid exists
16104 set seteuid d_seteuid
16107 : see if setgrent exists
16108 set setgrent d_setgrent
16111 : see if setgrent_r exists
16112 set setgrent_r d_setgrent_r
16114 case "$d_setgrent_r" in
16116 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
16117 case "$d_setgrent_r_proto:$usethreads" in
16118 ":define") d_setgrent_r_proto=define
16119 set d_setgrent_r_proto setgrent_r $hdrs
16123 case "$d_setgrent_r_proto" in
16125 case "$setgrent_r_proto" in
16126 ''|0) try='int setgrent_r(FILE**);'
16127 ./protochk "extern $try" $hdrs && setgrent_r_proto=I_H ;;
16129 case "$setgrent_r_proto" in
16130 ''|0) try='void setgrent_r(FILE**);'
16131 ./protochk "extern $try" $hdrs && setgrent_r_proto=V_H ;;
16133 case "$setgrent_r_proto" in
16134 ''|0) d_setgrent_r=undef
16136 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
16137 * ) case "$setgrent_r_proto" in
16138 REENTRANT_PROTO*) ;;
16139 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
16141 echo "Prototype: $try" ;;
16144 *) case "$usethreads" in
16145 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
16152 *) setgrent_r_proto=0
16156 : see if sethostent exists
16157 set sethostent d_sethent
16160 : see if sethostent_r exists
16161 set sethostent_r d_sethostent_r
16163 case "$d_sethostent_r" in
16165 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16166 case "$d_sethostent_r_proto:$usethreads" in
16167 ":define") d_sethostent_r_proto=define
16168 set d_sethostent_r_proto sethostent_r $hdrs
16172 case "$d_sethostent_r_proto" in
16174 case "$sethostent_r_proto" in
16175 ''|0) try='int sethostent_r(int, struct hostent_data*);'
16176 ./protochk "extern $try" $hdrs && sethostent_r_proto=I_ID ;;
16178 case "$sethostent_r_proto" in
16179 ''|0) try='void sethostent_r(int, struct hostent_data*);'
16180 ./protochk "extern $try" $hdrs && sethostent_r_proto=V_ID ;;
16182 case "$sethostent_r_proto" in
16183 ''|0) d_sethostent_r=undef
16184 sethostent_r_proto=0
16185 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
16186 * ) case "$sethostent_r_proto" in
16187 REENTRANT_PROTO*) ;;
16188 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
16190 echo "Prototype: $try" ;;
16193 *) case "$usethreads" in
16194 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
16196 d_sethostent_r=undef
16197 sethostent_r_proto=0
16201 *) sethostent_r_proto=0
16205 : see if setitimer exists
16206 set setitimer d_setitimer
16209 : see if setlinebuf exists
16210 set setlinebuf d_setlinebuf
16213 : see if setlocale exists
16214 set setlocale d_setlocale
16217 : see if locale.h is available
16218 set locale.h i_locale
16221 : see if setlocale_r exists
16222 set setlocale_r d_setlocale_r
16224 case "$d_setlocale_r" in
16226 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
16227 case "$d_setlocale_r_proto:$usethreads" in
16228 ":define") d_setlocale_r_proto=define
16229 set d_setlocale_r_proto setlocale_r $hdrs
16233 case "$d_setlocale_r_proto" in
16235 case "$setlocale_r_proto" in
16236 ''|0) try='int setlocale_r(int, const char*, char*, int);'
16237 ./protochk "extern $try" $hdrs && setlocale_r_proto=I_ICBI ;;
16239 case "$setlocale_r_proto" in
16240 ''|0) d_setlocale_r=undef
16241 setlocale_r_proto=0
16242 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
16243 * ) case "$setlocale_r_proto" in
16244 REENTRANT_PROTO*) ;;
16245 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
16247 echo "Prototype: $try" ;;
16250 *) case "$usethreads" in
16251 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
16253 d_setlocale_r=undef
16254 setlocale_r_proto=0
16258 *) setlocale_r_proto=0
16262 : see if setnetent exists
16263 set setnetent d_setnent
16266 : see if setnetent_r exists
16267 set setnetent_r d_setnetent_r
16269 case "$d_setnetent_r" in
16271 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16272 case "$d_setnetent_r_proto:$usethreads" in
16273 ":define") d_setnetent_r_proto=define
16274 set d_setnetent_r_proto setnetent_r $hdrs
16278 case "$d_setnetent_r_proto" in
16280 case "$setnetent_r_proto" in
16281 ''|0) try='int setnetent_r(int, struct netent_data*);'
16282 ./protochk "extern $try" $hdrs && setnetent_r_proto=I_ID ;;
16284 case "$setnetent_r_proto" in
16285 ''|0) try='void setnetent_r(int, struct netent_data*);'
16286 ./protochk "extern $try" $hdrs && setnetent_r_proto=V_ID ;;
16288 case "$setnetent_r_proto" in
16289 ''|0) d_setnetent_r=undef
16290 setnetent_r_proto=0
16291 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
16292 * ) case "$setnetent_r_proto" in
16293 REENTRANT_PROTO*) ;;
16294 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
16296 echo "Prototype: $try" ;;
16299 *) case "$usethreads" in
16300 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
16302 d_setnetent_r=undef
16303 setnetent_r_proto=0
16307 *) setnetent_r_proto=0
16311 : see if setprotoent exists
16312 set setprotoent d_setpent
16315 : see if setpgid exists
16316 set setpgid d_setpgid
16319 : see if setpgrp2 exists
16320 set setpgrp2 d_setpgrp2
16323 : see if setpriority exists
16324 set setpriority d_setprior
16327 : see if setproctitle exists
16328 set setproctitle d_setproctitle
16331 : see if setprotoent_r exists
16332 set setprotoent_r d_setprotoent_r
16334 case "$d_setprotoent_r" in
16336 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16337 case "$d_setprotoent_r_proto:$usethreads" in
16338 ":define") d_setprotoent_r_proto=define
16339 set d_setprotoent_r_proto setprotoent_r $hdrs
16343 case "$d_setprotoent_r_proto" in
16345 case "$setprotoent_r_proto" in
16346 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
16347 ./protochk "extern $try" $hdrs && setprotoent_r_proto=I_ID ;;
16349 case "$setprotoent_r_proto" in
16350 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
16351 ./protochk "extern $try" $hdrs && setprotoent_r_proto=V_ID ;;
16353 case "$setprotoent_r_proto" in
16354 ''|0) d_setprotoent_r=undef
16355 setprotoent_r_proto=0
16356 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
16357 * ) case "$setprotoent_r_proto" in
16358 REENTRANT_PROTO*) ;;
16359 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
16361 echo "Prototype: $try" ;;
16364 *) case "$usethreads" in
16365 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
16367 d_setprotoent_r=undef
16368 setprotoent_r_proto=0
16372 *) setprotoent_r_proto=0
16376 : see if setpwent exists
16377 set setpwent d_setpwent
16380 : see if setpwent_r exists
16381 set setpwent_r d_setpwent_r
16383 case "$d_setpwent_r" in
16385 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
16386 case "$d_setpwent_r_proto:$usethreads" in
16387 ":define") d_setpwent_r_proto=define
16388 set d_setpwent_r_proto setpwent_r $hdrs
16392 case "$d_setpwent_r_proto" in
16394 case "$setpwent_r_proto" in
16395 ''|0) try='int setpwent_r(FILE**);'
16396 ./protochk "extern $try" $hdrs && setpwent_r_proto=I_H ;;
16398 case "$setpwent_r_proto" in
16399 ''|0) try='void setpwent_r(FILE**);'
16400 ./protochk "extern $try" $hdrs && setpwent_r_proto=V_H ;;
16402 case "$setpwent_r_proto" in
16403 ''|0) d_setpwent_r=undef
16405 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
16406 * ) case "$setpwent_r_proto" in
16407 REENTRANT_PROTO*) ;;
16408 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
16410 echo "Prototype: $try" ;;
16413 *) case "$usethreads" in
16414 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
16421 *) setpwent_r_proto=0
16425 : see if setregid exists
16426 set setregid d_setregid
16428 set setresgid d_setresgid
16431 : see if setreuid exists
16432 set setreuid d_setreuid
16434 set setresuid d_setresuid
16437 : see if setrgid exists
16438 set setrgid d_setrgid
16441 : see if setruid exists
16442 set setruid d_setruid
16445 : see if setservent exists
16446 set setservent d_setsent
16449 : see if setservent_r exists
16450 set setservent_r d_setservent_r
16452 case "$d_setservent_r" in
16454 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16455 case "$d_setservent_r_proto:$usethreads" in
16456 ":define") d_setservent_r_proto=define
16457 set d_setservent_r_proto setservent_r $hdrs
16461 case "$d_setservent_r_proto" in
16463 case "$setservent_r_proto" in
16464 ''|0) try='int setservent_r(int, struct servent_data*);'
16465 ./protochk "extern $try" $hdrs && setservent_r_proto=I_ID ;;
16467 case "$setservent_r_proto" in
16468 ''|0) try='void setservent_r(int, struct servent_data*);'
16469 ./protochk "extern $try" $hdrs && setservent_r_proto=V_ID ;;
16471 case "$setservent_r_proto" in
16472 ''|0) d_setservent_r=undef
16473 setservent_r_proto=0
16474 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
16475 * ) case "$setservent_r_proto" in
16476 REENTRANT_PROTO*) ;;
16477 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
16479 echo "Prototype: $try" ;;
16482 *) case "$usethreads" in
16483 define) echo "setservent_r has no prototype, not using it." >&4 ;;
16485 d_setservent_r=undef
16486 setservent_r_proto=0
16490 *) setservent_r_proto=0
16494 : see if setsid exists
16495 set setsid d_setsid
16498 : see if setvbuf exists
16499 set setvbuf d_setvbuf
16502 : see if sfio.h is available
16507 : see if sfio library is available
16518 : Ok, but do we want to use it.
16522 true|$define|[yY]*) dflt='y';;
16525 echo "$package can use the sfio library, but it is experimental."
16526 case "$useperlio" in
16528 echo "For sfio also the PerlIO abstraction layer is needed."
16529 echo "Earlier you said you wouldn't want that."
16532 rp="You seem to have sfio available, do you want to try using it?"
16535 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
16536 useperlio="$define"
16539 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
16544 *) case "$usesfio" in
16545 true|$define|[yY]*)
16546 echo "Sorry, cannot find sfio on this machine." >&4
16547 echo "Ignoring your setting of usesfio=$usesfio." >&4
16556 $define) usesfio='true';;
16557 *) usesfio='false';;
16561 *) : Remove sfio from list of libraries to use
16564 echo "Removing unneeded -lsfio from library list" >&4
16565 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
16568 echo "libs = $libs" >&4
16575 : see if shmctl exists
16576 set shmctl d_shmctl
16579 : see if shmget exists
16580 set shmget d_shmget
16583 : see if shmat exists
16586 : see what shmat returns
16589 $cat >shmat.c <<'END'
16590 #include <sys/shm.h>
16593 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
16598 echo "and it returns ($shmattype)." >&4
16599 : see if a prototype for shmat is available
16600 xxx=`./findhdr sys/shm.h`
16601 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
16602 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
16613 set d_shmatprototype
16616 : see if shmdt exists
16620 : see how much of the 'shm*(2)' library is present.
16623 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
16624 *"$undef"*) h_shm=false;;
16628 case "`ipcs 2>&1`" in
16629 "SVID shared memory"*"not configured"*)
16630 echo "Your $osname does not have the shm*(2) configured." >&4
16633 set shmctl d_shmctl
16635 set shmget d_shmget
16645 : we could also check for sys/ipc.h ...
16646 if $h_shm && $test `./findhdr sys/shm.h`; then
16647 echo "You have the full shm*(2) library." >&4
16650 echo "You don't have the full shm*(2) library." >&4
16657 : see if we have sigaction
16658 if set sigaction val -f d_sigaction; eval $csym; $val; then
16659 echo 'sigaction() found.' >&4
16662 #include <sys/types.h>
16663 #include <signal.h>
16664 #$i_stdlib I_STDLIB
16666 #include <stdlib.h>
16670 struct sigaction act, oact;
16672 oact.sa_handler = 0;
16673 /* so that act and oact are used */
16674 exit(act.sa_flags == 0 && oact.sa_handler == 0);
16678 if eval $compile_ok; then
16681 echo "But you don't seem to have a useable struct sigaction." >&4
16685 echo 'sigaction NOT found.' >&4
16688 set d_sigaction; eval $setvar
16689 $rm -f try try$_o try.c
16691 : see if sigprocmask exists
16692 set sigprocmask d_sigprocmask
16695 : see if sigsetjmp exists
16697 case "$d_sigsetjmp" in
16700 #include <setjmp.h>
16701 #$i_stdlib I_STDLIB
16703 #include <stdlib.h>
16709 if (sigsetjmp(env,1))
16712 siglongjmp(env, 1);
16717 if eval $compile; then
16718 if $run ./try >/dev/null 2>&1; then
16719 echo "POSIX sigsetjmp found." >&4
16723 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
16729 echo "sigsetjmp not found." >&4
16733 *) val="$d_sigsetjmp"
16734 case "$d_sigsetjmp" in
16735 $define) echo "POSIX sigsetjmp found." >&4;;
16736 $undef) echo "sigsetjmp not found." >&4;;
16744 : see if snprintf exists
16745 set snprintf d_snprintf
16748 : see if vsnprintf exists
16749 set vsnprintf d_vsnprintf
16752 case "$d_snprintf-$d_vsnprintf" in
16755 Checking whether your snprintf() and vsnprintf() work okay...
16757 $cat >try.c <<'EOCP'
16758 /* v?snprintf testing logic courtesy of Russ Allbery.
16759 * According to C99:
16760 * - if the buffer is too short it still must be \0-terminated
16761 * - if the buffer is too short the potentially required length
16762 * must be returned and not -1
16763 * - if the buffer is NULL the potentially required length
16764 * must be returned and not -1 or core dump
16767 #include <stdarg.h>
16771 int test (char *format, ...)
16776 va_start (args, format);
16777 count = vsnprintf (buf, sizeof buf, format, args);
16784 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
16785 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
16789 if eval $compile; then
16792 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
16794 Your snprintf() and snprintf() don't seem to be working okay.
16796 d_snprintf="$undef"
16797 d_vsnprintf="$undef"
16801 echo "(I can't seem to compile the test program--assuming they don't)"
16802 d_snprintf="$undef"
16803 d_vsnprintf="$undef"
16805 $rm -f try.* try core core.try.*
16809 : see if sockatmark exists
16810 set sockatmark d_sockatmark
16813 : see if prototype for sockatmark is available
16815 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
16818 : see if socks5_init exists
16819 set socks5_init d_socks5_init
16822 : see if sprintf returns the length of the string in the buffer as per ANSI
16823 $echo "Checking whether sprintf returns the length of the string..." >&4
16826 #$i_stdlib I_STDLIB
16828 #include <stdlib.h>
16830 #$i_string I_STRING
16832 # include <string.h>
16834 # include <strings.h>
16843 int check (size_t expect, int test) {
16844 size_t got = strlen(buffer);
16848 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
16853 int main(int argc, char **argv) {
16856 check(sprintf(buffer, ""), ++test);
16857 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
16858 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
16865 d_sprintf_returns_strlen="$undef"
16866 if eval $compile; then
16870 sprintf returns the length of the string (as ANSI says it should)
16872 d_sprintf_returns_strlen="$define"
16875 sprintf does not return the length of the string (how old is this system?)
16877 d_sprintf_returns_strlen="$undef"
16884 : see if srand48_r exists
16885 set srand48_r d_srand48_r
16887 case "$d_srand48_r" in
16889 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16890 case "$d_srand48_r_proto:$usethreads" in
16891 ":define") d_srand48_r_proto=define
16892 set d_srand48_r_proto srand48_r $hdrs
16896 case "$d_srand48_r_proto" in
16898 case "$srand48_r_proto" in
16899 ''|0) try='int srand48_r(long, struct drand48_data*);'
16900 ./protochk "extern $try" $hdrs && srand48_r_proto=I_LS ;;
16902 case "$srand48_r_proto" in
16903 ''|0) d_srand48_r=undef
16905 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
16906 * ) case "$srand48_r_proto" in
16907 REENTRANT_PROTO*) ;;
16908 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
16910 echo "Prototype: $try" ;;
16913 *) case "$usethreads" in
16914 define) echo "srand48_r has no prototype, not using it." >&4 ;;
16921 *) srand48_r_proto=0
16925 : see if srandom_r exists
16926 set srandom_r d_srandom_r
16928 case "$d_srandom_r" in
16930 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16931 case "$d_srandom_r_proto:$usethreads" in
16932 ":define") d_srandom_r_proto=define
16933 set d_srandom_r_proto srandom_r $hdrs
16937 case "$d_srandom_r_proto" in
16939 case "$srandom_r_proto" in
16940 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
16941 ./protochk "extern $try" $hdrs && srandom_r_proto=I_TS ;;
16943 case "$srandom_r_proto" in
16944 ''|0) d_srandom_r=undef
16946 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
16947 * ) case "$srandom_r_proto" in
16948 REENTRANT_PROTO*) ;;
16949 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
16951 echo "Prototype: $try" ;;
16954 *) case "$usethreads" in
16955 define) echo "srandom_r has no prototype, not using it." >&4 ;;
16962 *) srandom_r_proto=0
16966 : see if prototype for setresgid is available
16968 set d_sresgproto setresgid $i_unistd unistd.h
16971 : see if prototype for setresuid is available
16973 set d_sresuproto setresuid $i_unistd unistd.h
16976 : see if sys/stat.h is available
16977 set sys/stat.h i_sysstat
16981 : see if stat knows about block sizes
16983 echo "Checking to see if your struct stat has st_blocks field..." >&4
16984 set d_statblks stat st_blocks $i_sysstat sys/stat.h
16988 : see if this is a sys/vfs.h system
16989 set sys/vfs.h i_sysvfs
16993 : see if this is a sys/statfs.h system
16994 set sys/statfs.h i_sysstatfs
16999 echo "Checking to see if your system supports struct statfs..." >&4
17000 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
17002 case "$d_statfs_s" in
17003 "$define") echo "Yes, it does." ;;
17004 *) echo "No, it doesn't." ;;
17009 : see if struct statfs knows about f_flags
17010 case "$d_statfs_s" in
17013 echo "Checking to see if your struct statfs has f_flags field..." >&4
17014 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
17018 set d_statfs_f_flags
17022 case "$d_statfs_f_flags" in
17023 "$define") echo "Yes, it does." ;;
17024 *) echo "No, it doesn't." ;;
17028 Checking how to access stdio streams by file descriptor number...
17030 case "$stdio_stream_array" in
17031 '') $cat >try.c <<EOCP
17034 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
17038 for s in _iob __iob __sF
17040 set try -DSTDIO_STREAM_ARRAY=$s
17041 if eval $compile; then
17042 case "`$run ./try`" in
17043 yes) stdio_stream_array=$s; break ;;
17047 $rm -f try.* try$exe_ext
17049 case "$stdio_stream_array" in
17051 I can't figure out how to access stdio streams by file descriptor number.
17053 d_stdio_stream_array="$undef"
17056 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
17058 d_stdio_stream_array="$define"
17062 : see if strcoll exists
17063 set strcoll d_strcoll
17066 : check for structure copying
17068 echo "Checking to see if your C compiler can copy structs..." >&4
17069 $cat >try.c <<'EOCP'
17079 if $cc -c try.c >/dev/null 2>&1 ; then
17081 echo "Yup, it can."
17084 echo "Nope, it can't."
17090 : see if strerror and/or sys_errlist[] exist
17092 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
17093 if set strerror val -f d_strerror; eval $csym; $val; then
17094 echo 'strerror() found.' >&4
17095 d_strerror="$define"
17096 d_strerrm='strerror(e)'
17097 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17098 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
17099 d_syserrlst="$define"
17101 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
17102 d_syserrlst="$undef"
17104 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
17105 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
17106 echo 'strerror() found in string header.' >&4
17107 d_strerror="$define"
17108 d_strerrm='strerror(e)'
17109 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17110 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
17111 d_syserrlst="$define"
17113 echo "(You don't appear to have any sys_errlist[], how can this be?)"
17114 d_syserrlst="$undef"
17116 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17117 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
17118 d_strerror="$undef"
17119 d_syserrlst="$define"
17120 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
17122 echo 'strerror() and sys_errlist[] NOT found.' >&4
17123 d_strerror="$undef"
17124 d_syserrlst="$undef"
17125 d_strerrm='"unknown"'
17129 : see if strerror_r exists
17130 set strerror_r d_strerror_r
17132 case "$d_strerror_r" in
17134 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
17135 case "$d_strerror_r_proto:$usethreads" in
17136 ":define") d_strerror_r_proto=define
17137 set d_strerror_r_proto strerror_r $hdrs
17141 case "$d_strerror_r_proto" in
17143 case "$strerror_r_proto" in
17144 ''|0) try='int strerror_r(int, char*, size_t);'
17145 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBW ;;
17147 case "$strerror_r_proto" in
17148 ''|0) try='int strerror_r(int, char*, int);'
17149 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBI ;;
17151 case "$strerror_r_proto" in
17152 ''|0) try='char* strerror_r(int, char*, size_t);'
17153 ./protochk "extern $try" $hdrs && strerror_r_proto=B_IBW ;;
17155 case "$strerror_r_proto" in
17156 ''|0) d_strerror_r=undef
17158 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
17159 * ) case "$strerror_r_proto" in
17160 REENTRANT_PROTO*) ;;
17161 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
17163 echo "Prototype: $try" ;;
17166 *) case "$usethreads" in
17167 define) echo "strerror_r has no prototype, not using it." >&4 ;;
17174 *) strerror_r_proto=0
17178 : see if strftime exists
17179 set strftime d_strftime
17182 : see if strlcat exists
17183 set strlcat d_strlcat
17186 : see if strlcpy exists
17187 set strlcpy d_strlcpy
17190 : see if strtod exists
17191 set strtod d_strtod
17194 : see if strtol exists
17195 set strtol d_strtol
17198 : see if strtold exists
17199 set strtold d_strtold
17202 : see if strtoll exists
17203 set strtoll d_strtoll
17206 case "$d_longlong-$d_strtoll" in
17209 Checking whether your strtoll() works okay...
17211 $cat >try.c <<'EOCP'
17214 #define strtoll __strtoll
17217 #define strtoll _strtoll
17220 extern long long int strtoll(char *s, char **, int);
17221 static int bad = 0;
17222 int check(char *s, long long ell, int een) {
17225 gll = strtoll(s, 0, 10);
17226 if (!((gll == ell) && (errno == een)))
17230 check(" 1", 1LL, 0);
17231 check(" 0", 0LL, 0);
17232 check("-1", -1LL, 0);
17233 check("-9223372036854775808", -9223372036854775808LL, 0);
17234 check("-9223372036854775808", -9223372036854775808LL, 0);
17235 check(" 9223372036854775807", 9223372036854775807LL, 0);
17236 check("-9223372036854775808", -9223372036854775808LL, 0);
17237 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
17238 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
17244 if eval $compile; then
17247 ok) echo "Your strtoll() seems to be working okay." ;;
17249 Your strtoll() doesn't seem to be working okay.
17255 echo "(I can't seem to compile the test program--assuming it doesn't)"
17261 : see if strtoq exists
17262 set strtoq d_strtoq
17265 : see if strtoul exists
17266 set strtoul d_strtoul
17269 case "$d_strtoul" in
17272 Checking whether your strtoul() works okay...
17274 $cat >try.c <<'EOCP'
17277 extern unsigned long int strtoul(char *s, char **, int);
17278 static int bad = 0;
17279 void check(char *s, unsigned long eul, int een) {
17282 gul = strtoul(s, 0, 10);
17283 if (!((gul == eul) && (errno == een)))
17287 check(" 1", 1L, 0);
17288 check(" 0", 0L, 0);
17290 case "$longsize" in
17292 $cat >>try.c <<'EOCP'
17293 check("18446744073709551615", 18446744073709551615UL, 0);
17294 check("18446744073709551616", 18446744073709551615UL, ERANGE);
17295 #if 0 /* strtoul() for /^-/ strings is undefined. */
17296 check("-1", 18446744073709551615UL, 0);
17297 check("-18446744073709551614", 2, 0);
17298 check("-18446744073709551615", 1, 0);
17299 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
17300 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
17305 $cat >>try.c <<'EOCP'
17306 check("4294967295", 4294967295UL, 0);
17307 check("4294967296", 4294967295UL, ERANGE);
17308 #if 0 /* strtoul() for /^-/ strings is undefined. */
17309 check("-1", 4294967295UL, 0);
17310 check("-4294967294", 2, 0);
17311 check("-4294967295", 1, 0);
17312 check("-4294967296", 4294967295UL, ERANGE);
17313 check("-4294967297", 4294967295UL, ERANGE);
17318 : Should we write these tests to be more portable by sprintf-ing
17319 : ~0 and then manipulating that char string as input for strtol?
17322 $cat >>try.c <<'EOCP'
17329 if eval $compile; then
17330 case "`$run ./try`" in
17331 ok) echo "Your strtoul() seems to be working okay." ;;
17333 Your strtoul() doesn't seem to be working okay.
17342 : see if strtoull exists
17343 set strtoull d_strtoull
17346 case "$d_longlong-$d_strtoull" in
17349 Checking whether your strtoull() works okay...
17351 $cat >try.c <<'EOCP'
17354 #define strtoull __strtoull
17357 extern unsigned long long int strtoull(char *s, char **, int);
17358 static int bad = 0;
17359 int check(char *s, long long eull, int een) {
17362 gull = strtoull(s, 0, 10);
17363 if (!((gull == eull) && (errno == een)))
17367 check(" 1", 1LL, 0);
17368 check(" 0", 0LL, 0);
17369 check("18446744073709551615", 18446744073709551615ULL, 0);
17370 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17371 #if 0 /* strtoull() for /^-/ strings is undefined. */
17372 check("-1", 18446744073709551615ULL, 0);
17373 check("-18446744073709551614", 2LL, 0);
17374 check("-18446744073709551615", 1LL, 0);
17375 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17376 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17383 if eval $compile; then
17384 case "`$run ./try`" in
17385 ok) echo "Your strtoull() seems to be working okay." ;;
17387 Your strtoull() doesn't seem to be working okay.
17389 d_strtoull="$undef"
17396 : see if strtouq exists
17397 set strtouq d_strtouq
17400 case "$d_strtouq" in
17403 Checking whether your strtouq() works okay...
17405 $cat >try.c <<'EOCP'
17408 extern unsigned long long int strtouq(char *s, char **, int);
17409 static int bad = 0;
17410 void check(char *s, unsigned long long eull, int een) {
17411 unsigned long long gull;
17413 gull = strtouq(s, 0, 10);
17414 if (!((gull == eull) && (errno == een)))
17418 check(" 1", 1LL, 0);
17419 check(" 0", 0LL, 0);
17420 check("18446744073709551615", 18446744073709551615ULL, 0);
17421 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17422 #if 0 /* strtouq() for /^-/ strings is undefined. */
17423 check("-1", 18446744073709551615ULL, 0);
17424 check("-18446744073709551614", 2LL, 0);
17425 check("-18446744073709551615", 1LL, 0);
17426 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17427 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17435 if eval $compile; then
17436 case "`$run ./try`" in
17437 ok) echo "Your strtouq() seems to be working okay." ;;
17439 Your strtouq() doesn't seem to be working okay.
17448 : see if strxfrm exists
17449 set strxfrm d_strxfrm
17452 : see if symlink exists
17453 set symlink d_symlink
17456 : see if syscall exists
17457 set syscall d_syscall
17460 : see if prototype for syscall is available
17462 set d_syscallproto syscall $i_unistd unistd.h
17465 : see if sysconf exists
17466 set sysconf d_sysconf
17469 : see if system exists
17470 set system d_system
17473 : see if tcgetpgrp exists
17474 set tcgetpgrp d_tcgetpgrp
17477 : see if tcsetpgrp exists
17478 set tcsetpgrp d_tcsetpgrp
17481 : see if prototype for telldir is available
17483 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
17486 : see if time exists
17488 if test "X$d_time" = X -o X"$timetype" = X; then
17489 if set time val -f d_time; eval $csym; $val; then
17490 echo 'time() found.' >&4
17492 rp="What is the type returned by time() on this system?"
17493 set time_t timetype long stdio.h sys/types.h
17496 echo 'time() not found, hope that will do.' >&4
17504 : see if this is a sys/times.h system
17505 set sys/times.h i_systimes
17508 : see if times exists
17510 if set times val -f d_times; eval $csym; $val; then
17511 echo 'times() found.' >&4
17514 case "$i_systimes" in
17515 "$define") inc='sys/times.h';;
17517 rp="What is the type returned by times() on this system?"
17518 set clock_t clocktype long stdio.h sys/types.h $inc
17521 echo 'times() NOT found, hope that will do.' >&4
17526 : see if tmpnam_r exists
17527 set tmpnam_r d_tmpnam_r
17529 case "$d_tmpnam_r" in
17531 hdrs="$i_systypes sys/types.h define stdio.h "
17532 case "$d_tmpnam_r_proto:$usethreads" in
17533 ":define") d_tmpnam_r_proto=define
17534 set d_tmpnam_r_proto tmpnam_r $hdrs
17538 case "$d_tmpnam_r_proto" in
17540 case "$tmpnam_r_proto" in
17541 ''|0) try='char* tmpnam_r(char*);'
17542 ./protochk "extern $try" $hdrs && tmpnam_r_proto=B_B ;;
17544 case "$tmpnam_r_proto" in
17545 ''|0) d_tmpnam_r=undef
17547 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
17548 * ) case "$tmpnam_r_proto" in
17549 REENTRANT_PROTO*) ;;
17550 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
17552 echo "Prototype: $try" ;;
17555 *) case "$usethreads" in
17556 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
17563 *) tmpnam_r_proto=0
17567 : see if truncate exists
17568 set truncate d_truncate
17571 : see if ttyname_r exists
17572 set ttyname_r d_ttyname_r
17574 case "$d_ttyname_r" in
17576 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
17577 case "$d_ttyname_r_proto:$usethreads" in
17578 ":define") d_ttyname_r_proto=define
17579 set d_ttyname_r_proto ttyname_r $hdrs
17583 case "$d_ttyname_r_proto" in
17585 case "$ttyname_r_proto" in
17586 ''|0) try='int ttyname_r(int, char*, size_t);'
17587 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBW ;;
17589 case "$ttyname_r_proto" in
17590 ''|0) try='int ttyname_r(int, char*, int);'
17591 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBI ;;
17593 case "$ttyname_r_proto" in
17594 ''|0) try='char* ttyname_r(int, char*, int);'
17595 ./protochk "extern $try" $hdrs && ttyname_r_proto=B_IBI ;;
17597 case "$ttyname_r_proto" in
17598 ''|0) d_ttyname_r=undef
17600 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
17601 * ) case "$ttyname_r_proto" in
17602 REENTRANT_PROTO*) ;;
17603 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
17605 echo "Prototype: $try" ;;
17608 *) case "$usethreads" in
17609 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
17616 *) ttyname_r_proto=0
17620 : see if tzname[] exists
17622 if set tzname val -a d_tzname; eval $csym; $val; then
17624 echo 'tzname[] found.' >&4
17627 echo 'tzname[] NOT found.' >&4
17633 next|rhapsody|darwin) multiarch="$define" ;;
17635 case "$multiarch" in
17636 ''|[nN]*) multiarch="$undef" ;;
17639 : check for ordering of bytes in a UV
17641 case "$usecrosscompile$multiarch" in
17644 You seem to be either cross-compiling or doing a multiarchitecture build,
17645 skipping the byteorder check.
17651 case "$byteorder" in
17654 In the following, larger digits indicate more significance. A big-endian
17655 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
17656 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
17657 machines may have weird orders like 3412. A Cray will report 87654321,
17658 an Alpha will report 12345678. If the test program works the default is
17660 I'm now running the test program...
17664 #$i_stdlib I_STDLIB
17666 #include <stdlib.h>
17668 #include <sys/types.h>
17669 typedef $uvtype UV;
17679 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
17681 u.l = (UV)0x04030201;
17682 for (i = 0; i < $uvsize; i++)
17683 printf("%c", u.c[i]+'0');
17690 if eval $compile && ./try > /dev/null; then
17693 [1-4][1-4][1-4][1-4]|12345678|87654321)
17694 echo "(The test program ran ok.)"
17695 echo "byteorder=$dflt"
17698 ????|????????) echo "(The test program ran ok.)" ;;
17699 *) echo "(The test program didn't run right for some reason.)" ;;
17704 (I can't seem to compile the test program. Guessing big-endian...)
17707 case "$xxx_prompt" in
17709 rp="What is the order of bytes in $uvtype?"
17725 Checking to see whether you can access character data unalignedly...
17727 case "$d_u32align" in
17728 '') $cat >try.c <<EOCP
17730 #$i_stdlib I_STDLIB
17732 #include <stdlib.h>
17734 #define U32 $u32type
17735 #define BYTEORDER 0x$byteorder
17737 #include <signal.h>
17739 $signal_t bletch(s) int s; { exit(4); }
17742 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
17747 if (sizeof(U32) != 4) {
17748 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
17755 signal(SIGBUS, bletch);
17767 for (i = 0; i < 4; i++) {
17768 up = (U32*)(buf + i);
17769 if (! ((*up == 1 << (8*i)) || /* big-endian */
17770 (*up == 1 << (8*(3-i))) /* little-endian */
17774 printf("read failed (%x)\n", *up);
17780 for (i = 0; i < 4; i++) {
17781 up = (U32*)(buf + i);
17783 if (*up != 0xBeef) {
17784 printf("write failed (%x)\n", *up);
17798 if eval $compile_ok; then
17799 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
17800 $run ./try 2>&1 >/dev/null
17803 You can access character data pretty unalignedly.
17805 d_u32align="$undef"
17808 It seems that you must access character data in an aligned manner.
17810 d_u32align="$define"
17814 rp='Can you access character data at unaligned addresses?'
17818 [yY]*) d_u32align="$undef" ;;
17819 *) d_u32align="$define" ;;
17822 $rm -f core core.try.* try.core
17826 : see if ualarm exists
17827 set ualarm d_ualarm
17830 : see if umask exists
17834 : see if unordered exists
17835 set unordered d_unordered
17838 : see if unsetenv exists
17839 set unsetenv d_unsetenv
17842 : see if usleep exists
17843 set usleep d_usleep
17846 : see if prototype for usleep is available
17848 set d_usleepproto usleep $i_unistd unistd.h
17851 : see if ustat exists
17855 : backward compatibility for d_hvfork
17856 if test X$d_hvfork != X; then
17857 d_vfork="$d_hvfork"
17860 : see if there is a vfork
17865 : Ok, but do we want to use it. vfork is reportedly unreliable in
17866 : perl on Solaris 2.x, and probably elsewhere.
17870 case "$usevfork" in
17876 Perl can only use a vfork() that doesn't suffer from strict
17877 restrictions on calling functions or modifying global data in
17878 the child. For example, glibc-2.1 contains such a vfork()
17879 that is unsuitable. If your system provides a proper fork()
17880 call, chances are that you do NOT want perl to use vfork().
17883 rp="Do you still want to use vfork()?"
17888 echo "Ok, we won't use vfork()."
17897 $define) usevfork='true';;
17898 *) usevfork='false';;
17901 : see if closedir exists
17902 set closedir d_closedir
17905 case "$d_closedir" in
17908 echo "Checking whether closedir() returns a status..." >&4
17910 #$i_dirent I_DIRENT /**/
17911 #$i_sysdir I_SYS_DIR /**/
17912 #$i_sysndir I_SYS_NDIR /**/
17913 #$i_systypes I_SYS_TYPES /**/
17915 #if defined(I_SYS_TYPES)
17916 #include <sys/types.h>
17918 #if defined(I_DIRENT)
17919 #include <dirent.h>
17920 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
17921 #include <sys/dir.h>
17925 #include <sys/ndir.h>
17929 #include <ndir.h> /* may be wrong in the future */
17931 #include <sys/dir.h>
17936 int main() { return closedir(opendir(".")); }
17939 if eval $compile_ok; then
17940 if $run ./try > /dev/null 2>&1 ; then
17941 echo "Yes, it does."
17944 echo "No, it doesn't."
17948 echo "(I can't seem to compile the test program--assuming it doesn't)"
17956 set d_void_closedir
17959 : see if there is a wait4
17963 : see if waitpid exists
17964 set waitpid d_waitpid
17967 : see if wcstombs exists
17968 set wcstombs d_wcstombs
17971 : see if wctomb exists
17972 set wctomb d_wctomb
17975 : see if writev exists
17976 set writev d_writev
17979 : preserve RCS keywords in files with variable substitution, grrr
17984 Revision='$Revision'
17986 : check for alignment requirements
17988 case "$usecrosscompile$multiarch" in
17991 You seem to be either cross-compiling or doing a multiarchitecture build,
17992 skipping the memory alignment check.
17995 case "$alignbytes" in
17996 '') alignbytes=8 ;;
18000 case "$alignbytes" in
18001 '') echo "Checking alignment constraints..." >&4
18002 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
18003 $cat >try.c <<'EOCP'
18004 typedef long double NV;
18007 $cat >try.c <<'EOCP'
18011 $cat >>try.c <<'EOCP'
18019 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
18024 if eval $compile_ok; then
18028 echo "(I can't seem to compile the test program...)"
18031 *) dflt="$alignbytes"
18034 rp="Doubles must be aligned on a how-many-byte boundary?"
18042 : set the base revision
18045 : how do we concatenate cpp tokens here?
18047 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
18048 $cat >cpp_stuff.c <<'EOCP'
18049 #define RCAT(a,b)a/**/b
18050 #define ACAT(a,b)a ## b
18054 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
18055 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
18056 echo "Oh! Smells like ANSI's been here." >&4
18057 echo "We can catify or stringify, separately or together!"
18059 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
18060 echo "Ah, yes! The good old days!" >&4
18061 echo "However, in the good old days we don't know how to stringify and"
18062 echo "catify at the same time."
18066 Hmm, I don't seem to be able to concatenate tokens with your cpp.
18067 You're going to have to edit the values of CAT[2-5] in config.h...
18069 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
18073 : see if this is a db.h system
18079 : Check db version.
18081 echo "Checking Berkeley DB version ..." >&4
18087 #include <sys/types.h>
18089 #$i_stdlib I_STDLIB
18091 #include <stdlib.h>
18094 int main(int argc, char *argv[])
18096 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
18097 int Major, Minor, Patch ;
18098 unsigned long Version ;
18099 (void)db_version(&Major, &Minor, &Patch) ;
18101 printf("%d %d %d %d %d %d\n",
18102 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
18103 Major, Minor, Patch);
18106 printf("You have Berkeley DB Version 2 or greater.\n");
18108 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
18109 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
18110 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
18111 Major, Minor, Patch) ;
18113 /* check that db.h & libdb are compatible */
18114 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
18115 printf("db.h and libdb are incompatible.\n") ;
18119 printf("db.h and libdb are compatible.\n") ;
18121 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
18122 + DB_VERSION_PATCH ;
18124 /* needs to be >= 2.3.4 */
18125 if (Version < 2003004) {
18126 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
18127 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
18133 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
18138 printf("You have Berkeley DB Version 1.\n");
18139 exit(0); /* DB version < 2: the coast is clear. */
18141 exit(1); /* <db.h> not Berkeley DB? */
18147 if eval $compile_ok && $run ./try; then
18148 echo 'Looks OK.' >&4
18150 db_version_major=$1
18151 db_version_minor=$2
18152 db_version_patch=$3
18154 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
18158 : Remove db from list of libraries to use
18159 echo "Removing unusable -ldb from library list" >&4
18160 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
18163 echo "libs = $libs" >&4
18173 : Check the return type needed for hash
18175 echo "Checking return type needed for hash for Berkeley DB ..." >&4
18181 #include <sys/types.h>
18184 #ifndef DB_VERSION_MAJOR
18185 u_int32_t hash_cb (ptr, size)
18193 info.hash = hash_cb;
18197 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18198 if $contains warning try.out >>/dev/null 2>&1 ; then
18201 db_hashtype='u_int32_t'
18204 : XXX Maybe we should just give up here.
18205 db_hashtype=u_int32_t
18207 echo "Help: I can't seem to compile the db test program." >&4
18208 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
18211 echo "Your version of Berkeley DB uses $db_hashtype for hash."
18213 *) db_hashtype=u_int32_t
18218 : Check the return type needed for prefix
18220 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
18226 #include <sys/types.h>
18229 #ifndef DB_VERSION_MAJOR
18230 size_t prefix_cb (key1, key2)
18238 info.prefix = prefix_cb;
18242 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18243 if $contains warning try.out >>/dev/null 2>&1 ; then
18244 db_prefixtype='int'
18246 db_prefixtype='size_t'
18249 db_prefixtype='size_t'
18250 : XXX Maybe we should just give up here.
18252 echo "Help: I can't seem to compile the db test program." >&4
18253 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
18256 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
18258 *) db_prefixtype='size_t'
18263 : How can we generate normalized random numbers ?
18265 echo "Looking for a random number function..." >&4
18266 case "$randfunc" in
18268 if set drand48 val -f; eval $csym; $val; then
18270 echo "Good, found drand48()." >&4
18271 elif set random val -f; eval $csym; $val; then
18273 echo "OK, found random()." >&4
18276 echo "Yick, looks like I have to use rand()." >&4
18287 *-Dmy_rand=*|*-Dmy_srand=*)
18288 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
18289 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
18290 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
18291 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
18295 while $test "$cont"; do
18296 rp="Use which function to generate random numbers?"
18298 if $test "$ans" = "$dflt"; then
18304 if set $ans val -f; eval $csym; $val; then
18308 rp="I cannot find function $ans. Use that name anyway?"
18317 case "$randfunc" in
18319 drand01="drand48()"
18325 case "$randbits" in
18327 echo "Checking to see how many bits your $randfunc() function produces..." >&4
18329 #$i_unistd I_UNISTD
18330 #$i_stdlib I_STDLIB
18333 # include <unistd.h>
18336 # include <stdlib.h>
18341 register unsigned long tmp;
18342 register unsigned long max = 0L;
18344 for (i = 1000; i; i--) {
18345 tmp = (unsigned long) $randfunc();
18346 if (tmp > max) max = tmp;
18348 for (i = 0; max; i++)
18354 if eval $compile_ok; then
18358 echo "(I can't seem to compile the test program...)"
18365 rp="How many bits does your $randfunc() function produce?"
18369 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18370 seedfunc="s$randfunc"
18371 randseedtype=unsigned
18375 rp="How many bits does your $randfunc() function produce?"
18378 seedfunc="s$randfunc"
18379 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18380 if set $seedfunc val -f; eval $csym; $val; then
18381 echo "(Using $seedfunc() to seed random generator)"
18383 echo "(Warning: no $seedfunc() to seed random generator)"
18386 randseedtype=unsigned
18394 echo "Determining whether or not we are on an EBCDIC system..." >&4
18395 $cat >try.c <<'EOM'
18398 if ('M'==0xd4) return 0;
18405 if eval $compile_ok; then
18406 if $run ./try; then
18407 echo "You seem to speak EBCDIC." >&4
18410 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
18413 echo "I'm unable to compile the test program." >&4
18414 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
18422 Checking how to flush all pending stdio output...
18424 # I only know how to find the first 32 possibly open files on SunOS.
18425 # See also hints/sunos_4_1.sh and util.c --AD
18427 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
18429 $cat >>try.c <<EOCP
18431 #$i_stdlib I_STDLIB
18433 #include <stdlib.h>
18435 #$i_unistd I_UNISTD
18437 # include <unistd.h>
18439 #$d_sysconf HAS_SYSCONF
18440 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
18441 #ifdef HAS_STDIO_STREAM_ARRAY
18442 # define STDIO_STREAM_ARRAY $stdio_stream_array
18447 p = fopen("try.out", "w");
18451 # ifdef TRY_FPRINTF
18455 #ifdef TRY_FFLUSH_NULL
18458 #ifdef TRY_FFLUSH_ALL
18460 long open_max = -1;
18461 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
18462 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
18464 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
18465 open_max = sysconf(_SC_OPEN_MAX);
18468 open_max = FOPEN_MAX;
18471 open_max = OPEN_MAX;
18480 # ifdef HAS_STDIO_STREAM_ARRAY
18481 if (open_max > 0) {
18483 for (i = 0; i < open_max; i++)
18484 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
18485 STDIO_STREAM_ARRAY[i]._file < open_max &&
18486 STDIO_STREAM_ARRAY[i]._flag)
18487 fflush(&STDIO_STREAM_ARRAY[i]);
18495 : first we have to find out how _not_ to flush
18497 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
18499 set try -DTRY_FPUTC
18500 if eval $compile; then
18501 $run ./try 2>/dev/null
18504 if $test ! -s try.out -a "X$code" = X42; then
18510 set try -DTRY_FPRINTF
18511 if eval $compile; then
18512 $run ./try 2>/dev/null
18515 if $test ! -s try.out -a "X$code" = X42; then
18516 output=-DTRY_FPRINTF
18522 : check for fflush NULL behaviour
18523 case "$fflushNULL" in
18524 '') set try -DTRY_FFLUSH_NULL $output
18525 if eval $compile; then
18526 $run ./try 2>/dev/null
18529 if $test -s try.out -a "X$code" = X42; then
18530 fflushNULL="`$cat try.out`"
18532 if $test "X$code" != X42; then
18534 (If this test failed, don't worry, we'll try another method shortly.)
18539 $rm -f core try.core core.try.*
18540 case "$fflushNULL" in
18542 Your fflush(NULL) works okay for output streams.
18543 Let's see if it clobbers input pipes...
18545 # As of mid-March 2000 all versions of Solaris appear to have a stdio
18546 # bug that improperly flushes the input end of pipes. So we avoid the
18547 # autoflush on fork/system/exec support for now. :-(
18548 $cat >tryp.c <<EOCP
18551 main(int argc, char **argv)
18557 while ((i = getc(stdin)) != -1
18558 && (*bp++ = i) != '\n'
18559 && bp < &buf[1024])
18562 fprintf(stdout, "%s", buf);
18570 fflushNULL="$define"
18572 if eval $compile; then
18574 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
18575 if cmp tryp.c tryp.out >/dev/null 2>&1; then
18577 fflush(NULL) seems to behave okay with input streams.
18579 fflushNULL="$define"
18582 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
18584 fflushNULL="$undef"
18587 $rm -f core tryp.c tryp.core core.tryp.*
18590 Your fflush(NULL) isn't working (contrary to ANSI C).
18592 fflushNULL="$undef"
18595 Cannot figure out whether your fflush(NULL) works or not.
18596 I'm assuming it doesn't (contrary to ANSI C).
18598 fflushNULL="$undef"
18602 $define|true|[yY]*)
18603 fflushNULL="$define"
18606 fflushNULL="$undef"
18609 : check explicit looping only if NULL did not work, and if the pipe
18610 : bug does not show up on an explicit flush too
18611 case "$fflushNULL" in
18613 $cat >tryp.c <<EOCP
18616 main(int argc, char **argv)
18622 while ((i = getc(stdin)) != -1
18623 && (*bp++ = i) != '\n'
18624 && bp < &buf[1024])
18627 fprintf(stdout, "%s", buf);
18636 if eval $compile; then
18638 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
18639 if cmp tryp.c tryp.out >/dev/null 2>&1; then
18641 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
18643 : now check for fflushall behaviour
18644 case "$fflushall" in
18645 '') set try -DTRY_FFLUSH_ALL $output
18646 if eval $compile; then
18648 (Now testing the other method--but note that this also may fail.)
18650 $run ./try 2>/dev/null
18653 if $test -s try.out -a "X$code" = X42; then
18654 fflushall="`$cat try.out`"
18657 $rm -f core try.core core.try.*
18658 case "$fflushall" in
18660 Whew. Flushing explicitly all the stdio streams works.
18662 fflushall="$define"
18665 Sigh. Flushing explicitly all the stdio streams doesn't work.
18670 Cannot figure out whether flushing stdio streams explicitly works or not.
18671 I'm assuming it doesn't.
18677 "$define"|true|[yY]*)
18678 fflushall="$define"
18686 All is futile. Even fflush(stdin) clobbers input pipes!
18693 $rm -f core tryp.c tryp.core core.tryp.*
18695 *) fflushall="$undef"
18699 case "$fflushNULL$fflushall" in
18702 OK, I give up. I cannot figure out how to flush pending stdio output.
18703 We won't be flushing handles at all before fork/exec/popen.
18707 $rm -f try.* try$exe_ext
18709 : Store the full pathname to the ar program for use in the C program
18710 : Respect a hint or command line value for full_ar.
18715 : Store the full pathname to the sed program for use in the C program
18718 : see what type gids are declared as in the kernel
18720 echo "Looking for the type for group ids returned by getgid()."
18721 set gid_t gidtype xxx stdio.h sys/types.h
18725 xxx=`./findhdr sys/user.h`
18726 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
18728 unsigned) dflt="$1 $2" ;;
18732 *) dflt="$gidtype";;
18735 gid_t) echo "gid_t found." ;;
18736 *) rp="What is the type for group ids returned by getgid()?"
18744 *_t) zzz="$gidtype" ;;
18747 echo "Checking the size of $zzz..." >&4
18749 #include <sys/types.h>
18751 #$i_stdlib I_STDLIB
18753 #include <stdlib.h>
18756 printf("%d\n", (int)sizeof($gidtype));
18761 if eval $compile_ok; then
18765 echo "(I can't execute the test program--guessing $gidsize.)" >&4
18768 echo "Your $zzz is $gidsize bytes long."
18773 echo "(I can't compile the test program--guessing $gidsize.)" >&4
18779 *_t) zzz="$gidtype" ;;
18782 echo "Checking the sign of $zzz..." >&4
18784 #include <sys/types.h>
18795 if eval $compile; then
18799 echo "(I can't execute the test program--guessing unsigned.)" >&4
18803 1) echo "Your $zzz is unsigned." ;;
18804 -1) echo "Your $zzz is signed." ;;
18810 echo "(I can't compile the test program--guessing unsigned.)" >&4
18816 if $test X"$quadtype" != X; then
18818 echo "Checking how to print 64-bit integers..." >&4
18820 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
18821 $cat >try.c <<'EOCP'
18822 #include <sys/types.h>
18825 int q = 12345678901;
18826 printf("%ld\n", q);
18830 if eval $compile; then
18834 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
18835 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
18836 echo "We will use %d."
18842 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
18843 $cat >try.c <<'EOCP'
18844 #include <sys/types.h>
18847 long q = 12345678901;
18848 printf("%ld\n", q);
18852 if eval $compile; then
18856 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
18857 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
18858 echo "We will use %ld."
18864 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
18865 $cat >try.c <<'EOCP'
18866 #include <sys/types.h>
18867 #include <inttypes.h>
18870 int64_t q = 12345678901;
18871 printf("%" PRId64 "\n", q);
18875 if eval $compile; then
18879 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
18880 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
18881 echo "We will use the C9X style."
18887 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
18889 #include <sys/types.h>
18892 $quadtype q = 12345678901;
18893 printf("%Ld\n", q);
18897 if eval $compile; then
18901 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
18902 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
18903 echo "We will use %Ld."
18909 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
18910 $cat >try.c <<'EOCP'
18911 #include <sys/types.h>
18914 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
18915 printf("%lld\n", q);
18919 if eval $compile; then
18923 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
18924 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
18925 echo "We will use the %lld style."
18931 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
18933 #include <sys/types.h>
18936 $quadtype q = 12345678901;
18937 printf("%qd\n", q);
18941 if eval $compile; then
18945 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
18946 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
18947 echo "We will use %qd."
18953 if $test X"$sPRId64" = X; then
18954 echo "Cannot figure out how to print 64-bit integers." >&4
18962 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
18963 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
18965 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
18966 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
18972 $echo "Checking the format strings to be used for Perl's internal types..." >&4
18974 if $test X"$ivsize" = X8; then
18975 ivdformat="$sPRId64"
18976 uvuformat="$sPRIu64"
18977 uvoformat="$sPRIo64"
18978 uvxformat="$sPRIx64"
18979 uvXUformat="$sPRIXU64"
18981 if $test X"$ivsize" = X"$longsize"; then
18988 if $test X"$ivsize" = X"$intsize"; then
18996 if $test X"$ivsize" = X"$shortsize"; then
19007 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
19008 nveformat="$sPRIeldbl"
19009 nvfformat="$sPRIfldbl"
19010 nvgformat="$sPRIgldbl"
19011 nvEUformat="$sPRIEUldbl"
19012 nvFUformat="$sPRIFUldbl"
19013 nvGUformat="$sPRIGUldbl"
19023 case "$ivdformat" in
19024 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
19031 $echo "Checking the format string to be used for gids..." >&4
19034 -1) if $test X"$gidsize" = X"$ivsize"; then
19035 gidformat="$ivdformat"
19037 if $test X"$gidsize" = X"$longsize"; then
19040 if $test X"$gidsize" = X"$intsize"; then
19043 if $test X"$gidsize" = X"$shortsize"; then
19050 *) if $test X"$gidsize" = X"$uvsize"; then
19051 gidformat="$uvuformat"
19053 if $test X"$gidsize" = X"$longsize"; then
19056 if $test X"$gidsize" = X"$intsize"; then
19059 if $test X"$gidsize" = X"$shortsize"; then
19068 : see if getgroups exists
19069 set getgroups d_getgrps
19072 : see if setgroups exists
19073 set setgroups d_setgrps
19077 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
19079 case "$d_getgrps$d_setgrps" in
19081 case "$groupstype" in
19082 '') dflt="$gidtype" ;;
19083 *) dflt="$groupstype" ;;
19086 What type of pointer is the second argument to getgroups() and setgroups()?
19087 Usually this is the same as group ids, $gidtype, but not always.
19090 rp='What type pointer is the second argument to getgroups() and setgroups()?'
19094 *) groupstype="$gidtype";;
19098 if $test $patchlevel -lt 9; then
19099 : MAD is not available in 5.8.x or earlier.
19103 $define|true|[yY]*) dflt='y' ;;
19108 Would you like to build with Misc Attribute Decoration? This is development
19109 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
19110 overhead on the interpreter.
19112 If this doesn't make any sense to you, just accept the default '$dflt'.
19114 rp='Build Perl with MAD?'
19119 madlyh='madly.h madly.act madly.tab'
19121 madlyobj="madly$_o" ;;
19131 echo "Checking if your $make program sets \$(MAKE)..." >&4
19132 case "$make_set_make" in
19134 $sed 's/^X //' > testmake.mak << 'EOF'
19136 X @echo 'maketemp="$(MAKE)"'
19138 case "`$make -f testmake.mak 2>/dev/null`" in
19139 *maketemp=*) make_set_make='#' ;;
19140 *) make_set_make="MAKE=$make" ;;
19142 $rm -f testmake.mak
19145 case "$make_set_make" in
19146 '#') echo "Yup, it does.";;
19147 *) echo "Nope, it doesn't.";;
19150 : see what type is used for mode_t
19151 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
19152 set mode_t modetype int stdio.h sys/types.h
19155 : see if we need va_copy
19157 case "$i_stdarg" in
19160 #include <stdarg.h>
19162 #$i_stdlib I_STDLIB
19164 #include <stdlib.h>
19166 #include <signal.h>
19169 ivfprintf(FILE *f, const char *fmt, va_list *valp)
19171 return vfprintf(f, fmt, *valp);
19175 myvfprintf(FILE *f, const char *fmt, va_list val)
19177 return ivfprintf(f, fmt, &val);
19181 myprintf(char *fmt, ...)
19184 va_start(val, fmt);
19185 return myvfprintf(stdout, fmt, val);
19189 main(int ac, char **av)
19191 signal(SIGSEGV, exit);
19193 myprintf("%s%cs all right, then\n", "that", '\'');
19198 if eval $compile && $run ./try 2>&1 >/dev/null; then
19199 case "`$run ./try`" in
19200 "that's all right, then")
19206 yes) echo "It seems that you don't need va_copy()." >&4
19207 need_va_copy="$undef"
19209 *) echo "It seems that va_copy() or similar will be needed." >&4
19210 need_va_copy="$define"
19213 $rm -f try.* core core.* *.core *.core.*
19215 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
19219 : see what type is used for size_t
19220 rp="What is the type used for the length parameter for string functions?"
19221 set size_t sizetype 'unsigned int' stdio.h sys/types.h
19224 : check for type of arguments to gethostbyaddr.
19225 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
19226 case "$d_gethbyaddr" in
19230 Checking to see what type of arguments are accepted by gethostbyaddr().
19232 hdrs="$define sys/types.h
19233 $d_socket sys/socket.h
19234 $i_niin netinet/in.h
19236 $i_unistd unistd.h"
19237 : The first arg can 'char *' or 'void *'
19238 : The second arg is some of integral type
19239 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
19240 for yyy in size_t long int; do
19241 case "$netdb_host_type" in
19242 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
19243 if ./protochk "$try" $hdrs; then
19244 echo "Your system accepts $xxx for the first arg."
19245 echo "...and $yyy for the second arg."
19246 netdb_host_type="$xxx"
19247 netdb_hlen_type="$yyy"
19253 : In case none of those worked, prompt the user.
19254 case "$netdb_host_type" in
19255 '') rp='What is the type for the 1st argument to gethostbyaddr?'
19258 netdb_host_type=$ans
19259 rp='What is the type for the 2nd argument to gethostbyaddr?'
19262 netdb_hlen_type=$ans
19266 *) : no gethostbyaddr, so pick harmless defaults
19267 netdb_host_type='char *'
19268 netdb_hlen_type="$sizetype"
19271 # Remove the "const" if needed. -- but then we'll have a
19273 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
19276 : check for type of argument to gethostbyname.
19277 if test "X$netdb_name_type" = X ; then
19278 case "$d_gethbyname" in
19282 Checking to see what type of argument is accepted by gethostbyname().
19284 hdrs="$define sys/types.h
19285 $d_socket sys/socket.h
19286 $i_niin netinet/in.h
19288 $i_unistd unistd.h"
19289 for xxx in "const char *" "char *"; do
19290 case "$netdb_name_type" in
19291 '') try="extern struct hostent *gethostbyname($xxx);"
19292 if ./protochk "$try" $hdrs; then
19293 echo "Your system accepts $xxx."
19294 netdb_name_type="$xxx"
19299 : In case none of those worked, prompt the user.
19300 case "$netdb_name_type" in
19301 '') rp='What is the type for the 1st argument to gethostbyname?'
19304 netdb_name_type=$ans
19308 *) : no gethostbyname, so pick harmless default
19309 netdb_name_type='char *'
19314 : check for type of 1st argument to getnetbyaddr.
19315 if test "X$netdb_net_type" = X ; then
19316 case "$d_getnbyaddr" in
19320 Checking to see what type of 1st argument is accepted by getnetbyaddr().
19322 hdrs="$define sys/types.h
19323 $d_socket sys/socket.h
19324 $i_niin netinet/in.h
19326 $i_unistd unistd.h"
19327 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
19328 case "$netdb_net_type" in
19329 '') try="extern struct netent *getnetbyaddr($xxx, int);"
19330 if ./protochk "$try" $hdrs; then
19331 echo "Your system accepts $xxx."
19332 netdb_net_type="$xxx"
19337 : In case none of those worked, prompt the user.
19338 case "$netdb_net_type" in
19339 '') rp='What is the type for the 1st argument to getnetbyaddr?'
19342 netdb_net_type=$ans
19346 *) : no getnetbyaddr, so pick harmless default
19347 netdb_net_type='long'
19351 : locate the preferred pager for this system
19358 [a-zA-Z]:/*) dflt=$pg;;
19362 [a-zA-Z]:/*) dflt=$more;;
19366 [a-zA-Z]:/*) dflt=$less;;
19369 '') dflt=/usr/ucb/more;;
19373 : Instruct ./getfile to trust the hinted or previous pager value,
19374 : even if it does not begin with a slash. For example, on os2,
19375 : pager might be cmd /c more. See comments in UU/getfile.
19380 rp='What pager is used on your system?'
19384 : see what type pids are declared as in the kernel
19385 rp="What is the type of process ids on this system?"
19386 set pid_t pidtype int stdio.h sys/types.h
19389 : see if ar generates random libraries by itself
19391 echo "Checking how to generate random libraries on your machine..." >&4
19392 echo 'int bar1() { return bar2(); }' > bar1.c
19393 echo 'int bar2() { return 2; }' > bar2.c
19395 #$i_stdlib I_STDLIB
19397 #include <stdlib.h>
19399 int main() { printf("%d\n", bar1()); exit(0); }
19401 $cc $ccflags -c bar1.c >/dev/null 2>&1
19402 $cc $ccflags -c bar2.c >/dev/null 2>&1
19403 $cc $ccflags -c foo.c >/dev/null 2>&1
19404 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
19405 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19406 $run ./foobar >/dev/null 2>&1; then
19407 echo "$ar appears to generate random libraries itself."
19409 if [ "X$ranlib" = "X" ]; then
19412 elif $ar s bar$_a >/dev/null 2>&1 &&
19413 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19414 $run ./foobar >/dev/null 2>&1; then
19415 echo "a table of contents needs to be added with '$ar s'."
19418 elif $ar ts bar$_a >/dev/null 2>&1 &&
19419 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19420 $run ./foobar >/dev/null 2>&1; then
19421 echo "a table of contents needs to be added with '$ar ts'."
19428 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
19429 $test -f $ranlib || ranlib=''
19432 if $test -n "$ranlib"; then
19433 echo "your system has '$ranlib'; we'll use that."
19436 echo "your system doesn't seem to support random libraries"
19437 echo "so we'll use lorder and tsort to order the libraries."
19444 : check for type of arguments to select.
19445 case "$selecttype" in
19446 '') case "$d_select" in
19450 Checking to see what type of arguments are accepted by select().
19452 hdrs="$define sys/types.h
19453 $i_systime sys/time.h
19454 $i_sysselct sys/select.h
19455 $d_socket sys/socket.h"
19456 : The first arg can be int, unsigned, or size_t
19457 : The last arg may or may not be 'const'
19459 : void pointer has been seen but using that
19460 : breaks the selectminbits test
19461 for xxx in 'fd_set *' 'int *'; do
19462 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
19463 for tmo in 'struct timeval *' 'const struct timeval *'; do
19465 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
19466 if ./protochk "$try" $hdrs; then
19467 echo "Your system accepts $xxx."
19476 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
19477 case "$d_fd_set" in
19478 $define) dflt="fd_set *" ;;
19487 *) : no select, so pick a harmless default
19494 : check for the select 'width'
19495 case "$selectminbits" in
19496 '') safebits=`expr $ptrsize \* 8`
19497 case "$d_select" in
19501 Checking to see on how many bits at a time your select() operates...
19504 #include <sys/types.h>
19506 #$i_systime I_SYS_TIME
19507 #$i_systimek I_SYS_TIME_KERNEL
19512 # ifdef I_SYS_TIME_KERNEL
19515 # include <sys/time.h>
19516 # ifdef I_SYS_TIME_KERNEL
19520 #$i_sysselct I_SYS_SELECT
19521 #ifdef I_SYS_SELECT
19522 #include <sys/select.h>
19524 #$d_socket HAS_SOCKET
19526 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
19529 #$i_stdlib I_STDLIB
19531 #include <stdlib.h>
19534 #define S sizeof(*(b))
19536 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
19537 #define NBITS (NBYTES * 8)
19539 char *s = malloc(NBYTES);
19548 fp = fopen("try.c", "r");
19554 b = ($selecttype)s;
19555 for (i = 0; i < NBITS; i++)
19559 select(fd + 1, b, 0, 0, &t);
19560 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
19562 printf("%d\n", i + 1);
19567 if eval $compile_ok; then
19568 selectminbits=`$run ./try`
19569 case "$selectminbits" in
19571 Cannot figure out on how many bits at a time your select() operates.
19572 I'll play safe and guess it is $safebits bits.
19574 selectminbits=$safebits
19575 bits="$safebits bits"
19578 *) bits="$selectminbits bits" ;;
19580 echo "Your select() operates on $bits at a time." >&4
19582 rp='What is the minimum number of bits your select() operates on?'
19583 case "$byteorder" in
19584 12345678) dflt=64 ;;
19590 selectminbits="$val"
19594 *) : no select, so pick a harmless default
19595 selectminbits=$safebits
19601 : Trace out the files included by signal.h, then look for SIGxxx names.
19602 : Remove SIGARRAYSIZE used by HPUX.
19603 : Remove SIGSTKSIZE used by Linux.
19604 : Remove SIGSTKSZ used by Posix.
19605 : Remove SIGTYP void lines used by OS2.
19606 : Some cpps, like os390, dont give the file name anywhere
19607 if [ "X$fieldn" = X ]; then
19608 : Just make some guesses. We check them later.
19609 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
19611 xxx=`echo '#include <signal.h>' |
19612 $cppstdin $cppminus $cppflags 2>/dev/null |
19613 $grep '^[ ]*#.*include' |
19614 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
19616 : Check this list of files to be sure we have parsed the cpp output ok.
19617 : This will also avoid potentially non-existent files, such
19620 for xx in $xxx /dev/null ; do
19621 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
19623 : If we have found no files, at least try signal.h
19624 case "$xxxfiles" in
19625 '') xxxfiles=`./findhdr signal.h` ;;
19628 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
19629 print substr($2, 4, 20)
19631 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
19632 print substr($3, 4, 20)
19634 : Append some common names just in case the awk scan failed.
19635 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
19636 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
19637 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
19638 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
19639 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
19641 : generate a few handy files for later
19642 $cat > signal.c <<EOCP
19643 #include <sys/types.h>
19644 #include <signal.h>
19645 #$i_stdlib I_STDLIB
19647 #include <stdlib.h>
19652 /* Strange style to avoid deeply-nested #if/#else/#endif */
19655 # define NSIG (_NSIG)
19661 # define NSIG (SIGMAX+1)
19667 # define NSIG (SIG_MAX+1)
19673 # define NSIG (_SIG_MAX+1)
19679 # define NSIG (MAXSIG+1)
19685 # define NSIG (MAX_SIG+1)
19690 # ifdef SIGARRAYSIZE
19691 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
19697 # define NSIG (_sys_nsig) /* Solaris 2.5 */
19701 /* Default to some arbitrary number that's big enough to get most
19702 of the common signals.
19708 printf("NSIG %d\n", NSIG);
19714 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
19716 printf "#ifdef SIG"; printf $1; printf "\n"
19717 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
19718 printf $1; printf ");\n"
19722 printf "#endif /* JUST_NSIG */\n";
19723 printf "exit(0);\n}\n";
19726 $cat >signal.awk <<'EOP'
19727 BEGIN { ndups = 0 }
19728 $1 ~ /^NSIG$/ { nsig = $2 }
19729 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
19730 if ($2 > maxsig) { maxsig = $2 }
19731 if (sig_name[$2]) {
19732 dup_name[ndups] = $1
19733 dup_num[ndups] = $2
19745 printf("NSIG %d\n", nsig);
19746 for (n = 1; n < nsig; n++) {
19748 printf("%s %d\n", sig_name[n], sig_num[n])
19751 printf("NUM%d %d\n", n, n)
19754 for (n = 0; n < ndups; n++) {
19755 printf("%s %d\n", dup_name[n], dup_num[n])
19759 $cat >signal_cmd <<EOS
19761 if $test -s signal.lst; then
19762 echo "Using your existing signal.lst file"
19767 $cat >>signal_cmd <<'EOS'
19770 if eval $compile_ok; then
19771 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) | $uniq | $awk -f signal.awk >signal.lst
19773 echo "(I can't seem be able to compile the whole test program)" >&4
19774 echo "(I'll try it in little pieces.)" >&4
19775 set signal -DJUST_NSIG
19776 if eval $compile_ok; then
19777 $run ./signal$_exe > signal.nsg
19780 echo "I can't seem to figure out how many signals you have." >&4
19781 echo "Guessing 50." >&4
19782 echo 'NSIG 50' > signal.nsg
19784 : Now look at all the signal names, one at a time.
19785 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
19786 $cat > signal.c <<EOCP
19787 #include <sys/types.h>
19788 #include <signal.h>
19791 printf("$xx %d\n", SIG${xx});
19796 if eval $compile; then
19797 echo "SIG${xx} found."
19798 $run ./signal$_exe >> signal.ls1
19800 echo "SIG${xx} NOT found."
19803 if $test -s signal.ls1; then
19804 $cat signal.nsg signal.ls1 |
19805 $sort -n | $uniq | $awk -f signal.awk >signal.lst
19809 if $test -s signal.lst; then
19812 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
19813 echo 'kill -l' >signal
19814 set X `csh -f <signal`
19818 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
19820 echo $@ | $tr ' ' $trnl | \
19821 $awk '{ printf "%s %d\n", $1, ++s; }
19822 END { printf "NSIG %d\n", ++s }' >signal.lst
19824 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
19826 chmod a+x signal_cmd
19827 $eunicefix signal_cmd
19829 : generate list of signal names
19831 case "$sig_name_init" in
19833 *) case "$sig_num_init" in
19834 ''|*,*) doinit=yes ;;
19839 echo "Generating a list of signal names and numbers..." >&4
19841 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
19842 sig_name=`$awk 'BEGIN { printf "ZERO " }
19843 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
19844 sig_num=`$awk 'BEGIN { printf "0 " }
19845 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
19846 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
19847 !/^NSIG/ { printf "\"%s\", ", $1 }
19848 END { printf "0\n" }' signal.lst`
19849 sig_num_init=`$awk 'BEGIN { printf "0, " }
19850 !/^NSIG/ { printf "%d, ", $2}
19851 END { printf "0\n"}' signal.lst`
19854 echo "The following $sig_count signals are available:"
19856 echo $sig_name | $awk \
19857 'BEGIN { linelen = 0 }
19859 for (i = 1; i <= NF; i++) {
19860 name = "SIG" $i " "
19861 linelen = linelen + length(name)
19862 if (linelen > 70) {
19864 linelen = length(name)
19870 sig_size=`echo $sig_name | awk '{print NF}'`
19871 $rm -f signal signal.c signal.awk signal.lst signal_cmd
19874 case "$sizetype" in
19875 *_t) zzz="$sizetype" ;;
19876 *) zzz="filesize" ;;
19878 echo "Checking the size of $zzz..." >&4
19880 #include <sys/types.h>
19882 #$i_stdlib I_STDLIB
19884 #include <stdlib.h>
19887 printf("%d\n", (int)sizeof($sizetype));
19892 if eval $compile_ok; then
19896 echo "(I can't execute the test program--guessing $sizesize.)" >&4
19899 echo "Your $zzz size is $sizesize bytes."
19904 echo "(I can't compile the test program--guessing $sizesize.)" >&4
19908 : check for socklen_t
19910 echo "Checking to see if you have socklen_t..." >&4
19912 #include <sys/types.h>
19913 #$d_socket HAS_SOCKET
19915 #include <sys/socket.h>
19917 int main() { socklen_t x = 16; }
19920 if eval $compile; then
19922 echo "You have socklen_t."
19925 echo "You do not have socklen_t."
19926 case "$sizetype" in
19927 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
19934 : see if this is a socks.h system
19935 set socks.h i_socks
19938 : check for type of the size argument to socket calls
19939 case "$d_socket" in
19943 Checking to see what type is the last argument of accept().
19946 case "$d_socklen_t" in
19947 "$define") yyy="$yyy socklen_t"
19949 yyy="$yyy $sizetype int long unsigned"
19950 for xxx in $yyy; do
19951 case "$socksizetype" in
19952 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
19953 case "$usesocks" in
19955 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
19956 echo "Your system accepts '$xxx *' for the last argument of accept()."
19957 socksizetype="$xxx"
19960 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
19961 echo "Your system accepts '$xxx *' for the last argument of accept()."
19962 socksizetype="$xxx"
19969 : In case none of those worked, prompt the user.
19970 case "$socksizetype" in
19971 '') rp='What is the type for socket address structure sizes?'
19978 *) : no sockets, so pick relatively harmless default
19983 : see what type is used for signed size_t
19984 set ssize_t ssizetype int stdio.h sys/types.h
19989 #$i_stdlib I_STDLIB
19991 #include <stdlib.h>
19993 #include <sys/types.h>
19994 #define Size_t $sizetype
19995 #define SSize_t $dflt
19998 if (sizeof(Size_t) == sizeof(SSize_t))
20000 else if (sizeof(Size_t) == sizeof(int))
20009 if eval $compile_ok && $run ./try > /dev/null; then
20010 ssizetype=`$run ./try`
20011 echo "I'll be using $ssizetype for functions returning a byte count." >&4
20014 Help! I can't compile and run the ssize_t test program: please enlighten me!
20015 (This is probably a misconfiguration in your system or libraries, and
20016 you really ought to fix it. Still, I'll try anyway.)
20018 I need a type that is the same size as $sizetype, but is guaranteed to
20019 be signed. Common values are ssize_t, int and long.
20022 rp="What signed type is the same size as $sizetype?"
20028 : see what type of char stdio uses.
20030 echo '#include <stdio.h>' > stdio.c
20031 $cppstdin $cppminus < stdio.c > stdioh
20032 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
20033 echo "Your stdio uses unsigned chars." >&4
20034 stdchar="unsigned char"
20036 echo "Your stdio uses signed chars." >&4
20039 $rm -f stdio.* stdioh
20041 : see what type uids are declared as in the kernel
20043 echo "Looking for the type for user ids returned by getuid()."
20044 set uid_t uidtype xxx stdio.h sys/types.h
20048 xxx=`./findhdr sys/user.h`
20049 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
20051 unsigned) dflt="$1 $2" ;;
20055 *) dflt="$uidtype";;
20058 uid_t) echo "uid_t found." ;;
20059 *) rp="What is the type for user ids returned by getuid()?"
20067 *_t) zzz="$uidtype" ;;
20070 echo "Checking the size of $zzz..." >&4
20072 #include <sys/types.h>
20074 #$i_stdlib I_STDLIB
20076 #include <stdlib.h>
20079 printf("%d\n", (int)sizeof($uidtype));
20084 if eval $compile_ok; then
20088 echo "(I can't execute the test program--guessing $uidsize.)" >&4
20091 echo "Your $zzz is $uidsize bytes long."
20096 echo "(I can't compile the test program--guessing $uidsize.)" >&4
20101 *_t) zzz="$uidtype" ;;
20104 echo "Checking the sign of $zzz..." >&4
20106 #include <sys/types.h>
20117 if eval $compile; then
20121 echo "(I can't execute the test program--guessing unsigned.)" >&4
20125 1) echo "Your $zzz is unsigned." ;;
20126 -1) echo "Your $zzz is signed." ;;
20132 echo "(I can't compile the test program--guessing unsigned.)" >&4
20138 $echo "Checking the format string to be used for uids..." >&4
20141 -1) if $test X"$uidsize" = X"$ivsize"; then
20142 uidformat="$ivdformat"
20144 if $test X"$uidsize" = X"$longsize"; then
20147 if $test X"$uidsize" = X"$intsize"; then
20150 if $test X"$uidsize" = X"$shortsize"; then
20157 *) if $test X"$uidsize" = X"$uvsize"; then
20158 uidformat="$uvuformat"
20160 if $test X"$uidsize" = X"$longsize"; then
20163 if $test X"$uidsize" = X"$intsize"; then
20166 if $test X"$uidsize" = X"$shortsize"; then
20176 case "$usesitecustomize" in
20177 $define|true|[Yy]*)
20178 usesitecustomize="$define"
20181 usesitecustomize="$undef"
20185 : determine compiler compiler
20194 if $test -f "$byacc$_exe"; then
20196 comp="byacc or $comp"
20198 if $test -f "$bison$_exe"; then
20199 comp="$comp or bison -y"
20201 rp="Which compiler compiler ($comp) shall I use?"
20210 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
20216 : see if this is a fp.h system
20220 : see if this is a fp_class.h system
20221 set fp_class.h i_fp_class
20224 : see if this is a ieeefp.h system
20225 case "$i_ieeefp" in
20226 '' ) set ieeefp.h i_ieeefp
20231 : see if this is a libutil.h system
20232 set libutil.h i_libutil
20235 : see if mach cthreads are available
20236 if test "X$usethreads" = "X$define"; then
20237 set mach/cthreads.h i_machcthr
20240 i_machcthr="$undef"
20245 : see if this is a mntent.h system
20246 set mntent.h i_mntent
20249 : see if ndbm.h is available
20255 # Some Linux distributions such as RedHat 7.1 put the
20256 # ndbm.h header in /usr/include/gdbm/ndbm.h.
20257 if $test -f /usr/include/gdbm/ndbm.h; then
20258 echo '<gdbm/ndbm.h> found.'
20259 ccflags="$ccflags -I/usr/include/gdbm"
20260 cppflags="$cppflags -I/usr/include/gdbm"
20268 : see if dbm_open exists
20269 set dbm_open d_dbm_open
20271 case "$d_dbm_open" in
20274 echo "We won't be including <ndbm.h>"
20283 : see if net/errno.h is available
20285 set net/errno.h val
20288 : Unfortunately, it causes problems on some systems. Arrgh.
20291 cat > try.c <<'EOM'
20294 #include <net/errno.h>
20300 if $cc $ccflags -c try.c >/dev/null 2>&1; then
20301 echo "We'll be including <net/errno.h>." >&4
20303 echo "We won't be including <net/errno.h>." >&4
20312 : see if netinet/tcp.h is available
20313 set netinet/tcp.h i_netinettcp
20316 : see if this is a poll.h system
20320 : see if this is a prot.h system
20325 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
20326 $cat <<'EOSH' > Cppsym.know
20327 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
20328 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
20329 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
20330 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
20331 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
20332 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
20333 bull c cadmus clipper CMU COFF COMPILER_VERSION
20334 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
20335 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
20336 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
20337 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
20339 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
20340 H3050R H3050RX hbullx20 hcx host_mips
20341 hp200 hp300 hp700 HP700 hp800 hp9000
20342 hp9000s200 hp9000s300 hp9000s400 hp9000s500
20343 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
20344 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
20345 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
20346 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
20347 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
20348 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
20349 Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
20350 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
20351 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
20352 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
20353 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
20354 MATH_HAS_NO_SIDE_EFFECTS
20355 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
20356 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
20357 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
20358 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
20359 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
20360 NetBSD news1500 news1700 news1800 news1900 news3700
20361 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
20362 ns32016 ns32332 ns32k nsc32000
20363 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
20364 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
20365 pc532 pdp11 PGC PIC plexus PORTAR posix
20366 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
20367 POSIX_C_SOURCE POSIX_SOURCE POWER
20368 PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
20369 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
20370 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
20371 sony sony_news sonyrisc sparc sparclite spectrum
20372 stardent stdc STDC_EXT stratos sun sun3 sun386
20373 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
20374 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
20375 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
20376 sysV68 sysV88 Tek4132 Tek4300 titan
20377 TM3200 TM5400 TM5600
20378 tower tower32 tower32_200 tower32_600 tower32_700
20379 tower32_800 tower32_850 tss
20380 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
20381 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
20382 unix UNIX95 UNIX99 unixpc unos
20383 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
20384 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
20385 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
20387 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
20388 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
20389 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
20392 # Maybe put other stuff here too.
20393 cat <<EOSH >>Cppsym.know
20396 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
20397 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
20398 $cat Cppsym.know > Cppsym.c
20399 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
20400 $rm -f Cppsym.a Cppsym.b Cppsym.c
20401 cat <<EOSH > Cppsym
20403 if $test \$# -gt 0; then
20404 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
20405 if $test -s Cppsym.got; then
20412 $tr " " "$trnl" | ./Cppsym.try
20418 cat <<EOSH > Cppsym.try
20420 cat <<'EOCP' > try.c
20423 #define STRINGIFY(a) "a"
20425 #if cpp_stuff == 42
20426 #define StGiFy(a) #a
20427 #define STRINGIFY(a) StGiFy(a)
20429 #if $cpp_stuff != 1 && $cpp_stuff != 42
20430 # include "Bletch: How does this C preprocessor stringify macros?"
20436 cat <<'EOSH' >> Cppsym.try
20438 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
20439 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
20440 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
20441 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
20443 echo 'return 0;}' >> try.c
20445 cat <<EOSH >> Cppsym.try
20447 case "$osname-$gccversion" in
20448 irix-) ccflags="\$ccflags -woff 1178" ;;
20449 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
20451 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
20453 chmod +x Cppsym.try
20454 $eunicefix Cppsym.try
20455 ./Cppsym < Cppsym.know > Cppsym.true
20456 : Add in any linux cpp "predefined macros":
20457 case "$osname::$gccversion" in
20460 rm -f $tHdrH'.h' $tHdrH
20462 if cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
20463 sed 's/#define[\ \ ]*//;s/[\ \ ].*$//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
20464 if [ -s $tHdrH'_cppsym.real' ]; then
20465 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
20468 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
20471 : now check the C compiler for additional symbols
20472 postprocess_cc_v=''
20474 aix) postprocess_cc_v="|$tr , ' '" ;;
20481 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
20484 -D*) echo "\$i" | $sed 's/^-D//';;
20485 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
20490 postprocess_cc_v=''
20493 ./ccsym > ccsym1.raw
20494 if $test -s ccsym1.raw; then
20495 $sort ccsym1.raw | $uniq >ccsym.raw
20497 mv ccsym1.raw ccsym.raw
20500 $awk '/\=/ { print $0; next }
20501 { print $0"=1" }' ccsym.raw >ccsym.list
20502 $comm -13 Cppsym.true ccsym.list >ccsym.own
20503 $comm -12 Cppsym.true ccsym.list >ccsym.com
20504 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
20506 if $test -z ccsym.raw; then
20507 echo "Your C compiler doesn't seem to define any symbols!" >&4
20509 echo "However, your C preprocessor defines the following symbols:"
20512 cppsymbols=`$cat Cppsym.true`
20513 cppsymbols=`echo $cppsymbols`
20514 cppccsymbols="$cppsymbols"
20516 if $test -s ccsym.com; then
20517 echo "Your C compiler and pre-processor define these symbols:"
20518 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
20521 cppccsymbols=`$cat ccsym.com`
20522 cppccsymbols=`echo $cppccsymbols`
20523 $test "$silent" || sleep 1
20525 if $test -s ccsym.cpp; then
20526 $test "$also" && echo " "
20527 echo "Your C pre-processor ${also}defines the following symbols:"
20528 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
20530 cppsymbols=`$cat ccsym.cpp`
20531 cppsymbols=`echo $cppsymbols`
20532 $test "$silent" || sleep 1
20534 if $test -s ccsym.own; then
20535 $test "$also" && echo " "
20536 echo "Your C compiler ${also}defines the following cpp symbols:"
20537 $sed -e 's/\(..*\)=1/\1/' ccsym.own
20538 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
20539 ccsymbols=`$cat ccsym.own`
20540 ccsymbols=`echo $ccsymbols`
20541 $test "$silent" || sleep 1
20545 : see if this is a termio system
20549 if $test `./findhdr termios.h`; then
20550 set tcsetattr i_termios
20556 "$define") echo "You have POSIX termios.h... good!" >&4;;
20557 *) if ./Cppsym pyr; then
20558 case "`/bin/universe`" in
20559 ucb) if $test `./findhdr sgtty.h`; then
20561 echo "<sgtty.h> found." >&4
20563 echo "System is pyramid with BSD universe."
20564 echo "<sgtty.h> not found--you could have problems." >&4
20566 *) if $test `./findhdr termio.h`; then
20568 echo "<termio.h> found." >&4
20570 echo "System is pyramid with USG universe."
20571 echo "<termio.h> not found--you could have problems." >&4
20575 if $test `./findhdr termio.h`; then
20576 echo "<termio.h> found." >&4
20578 elif $test `./findhdr sgtty.h`; then
20579 echo "<sgtty.h> found." >&4
20582 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
20585 if $test `./findhdr sgtty.h`; then
20586 echo "<sgtty.h> found." >&4
20588 elif $test `./findhdr termio.h`; then
20589 echo "<termio.h> found." >&4
20592 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
20596 set i_termio; eval $setvar
20597 val=$val2; set i_sgtty; eval $setvar
20598 val=$val3; set i_termios; eval $setvar
20600 : see if stddef is available
20601 set stddef.h i_stddef
20604 : see if this is a sunmath.h system
20605 set sunmath.h i_sunmath
20608 : see if sys/access.h is available
20609 set sys/access.h i_sysaccess
20612 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
20613 set sys/filio.h i_sysfilio
20616 if $test `./findhdr sys/ioctl.h`; then
20618 echo '<sys/ioctl.h> found.' >&4
20621 if $test $i_sysfilio = "$define"; then
20622 echo '<sys/ioctl.h> NOT found.' >&4
20624 $test $i_sgtty = "$define" && xxx="sgtty.h"
20625 $test $i_termio = "$define" && xxx="termio.h"
20626 $test $i_termios = "$define" && xxx="termios.h"
20627 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
20633 : see if socket ioctl defs are in sys/sockio.h
20635 xxx=`./findhdr sys/sockio.h`
20636 if $test "$xxx"; then
20637 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
20639 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
20642 echo "No socket ioctls found in <sys/sockio.h>." >&4
20647 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
20654 : see if this is a syslog.h system
20655 set syslog.h i_syslog
20659 : see if this is a sys/mode.h system
20660 set sys/mode.h i_sysmode
20663 : see if sys/resource.h has to be included
20664 set sys/resource.h i_sysresrc
20667 : see if sys/security.h is available
20668 set sys/security.h i_syssecrt
20671 : see if this is a sys/statvfs.h system
20672 set sys/statvfs.h i_sysstatvfs
20675 : see if this is a sys/un.h system
20676 set sys/un.h i_sysun
20680 : see if this is a sys/utsname.h system
20681 set sys/utsname.h i_sysutsname
20684 : see if this is a syswait system
20685 set sys/wait.h i_syswait
20688 : see if this is a ustat.h system
20689 set ustat.h i_ustat
20692 : see if this is an utime system
20693 set utime.h i_utime
20696 : see if this is a values.h system
20697 set values.h i_values
20700 : see if this is a vfork system
20703 set vfork.h i_vfork
20711 : see if gdbm.h is available
20716 : see if gdbm_open exists
20717 set gdbm_open d_gdbm_open
20719 case "$d_gdbm_open" in
20722 echo "We won't be including <gdbm.h>"
20732 echo "Looking for extensions..." >&4
20733 : If we are using the old config.sh, known_extensions may contain
20734 : old or inaccurate or duplicate values.
20735 known_extensions=''
20736 nonxs_extensions=''
20737 : We do not use find because it might not be available.
20738 : We do not just use MANIFEST because the user may have dropped
20739 : some additional extensions into the source tree and expect them
20742 : Function to recursively find available extensions, ignoring DynaLoader
20743 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
20747 DynaLoader|dynaload) ;;
20749 if $test -f $xxx/$xxx.xs; then
20750 known_extensions="$known_extensions $1$xxx";
20751 elif $test -f $xxx/Makefile.PL; then
20752 nonxs_extensions="$nonxs_extensions $1$xxx";
20754 if $test -d $xxx -a $# -lt 10; then
20757 eval $find_extensions;
20769 eval $find_extensions
20770 # Special case: Add in threads/shared since it is not picked up by the
20771 # recursive find above (and adding in general recursive finding breaks
20772 # SDBM_File/sdbm). A.D. 10/25/2001.
20773 known_extensions="$known_extensions threads/shared"
20774 set X $nonxs_extensions
20776 nonxs_extensions="$*"
20777 set X $known_extensions
20779 known_extensions="$*"
20782 : Now see which are supported on this system.
20784 for xxx in $known_extensions ; do
20788 $define) avail_ext="$avail_ext $xxx" ;;
20791 GDBM_File|gdbm_fil)
20793 $define) avail_ext="$avail_ext $xxx" ;;
20796 I18N/Langinfo|i18n_lan)
20797 case "$i_langinfo$d_nl_langinfo" in
20798 $define$define) avail_ext="$avail_ext $xxx" ;;
20801 NDBM_File|ndbm_fil)
20804 case "$osname-$use64bitint" in
20807 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
20810 *) avail_ext="$avail_ext $xxx" ;;
20815 ODBM_File|odbm_fil)
20816 case "${i_dbm}${i_rpcsvcdbm}" in
20818 case "$osname-$use64bitint" in
20821 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
20824 *) avail_ext="$avail_ext $xxx" ;;
20830 case "$useposix" in
20831 true|define|y) avail_ext="$avail_ext $xxx" ;;
20835 case "$useopcode" in
20836 true|define|y) avail_ext="$avail_ext $xxx" ;;
20840 case "$d_socket" in
20843 beos) ;; # not unless BONE
20844 *) avail_ext="$avail_ext $xxx" ;;
20849 Sys/Syslog|sys/syslog)
20850 : XXX syslog requires socket
20851 case "$d_socket" in
20852 true|$define|y) avail_ext="$avail_ext $xxx" ;;
20856 case "$usethreads" in
20858 case "$useithreads" in
20859 $undef|false|[nN]*) avail_ext="$avail_ext $xxx" ;;
20863 XS/APItest|xs/apitest)
20864 # This is just for testing. Skip it unless we have dynamic loading.
20867 $define) avail_ext="$avail_ext $xxx" ;;
20870 XS/Typemap|xs/typemap)
20871 # This is just for testing. Skip it unless we have dynamic loading.
20873 $define) avail_ext="$avail_ext $xxx" ;;
20876 threads|threads/shared)
20877 # threads and threads::shared are special cases.
20878 # To stop people from asking "Perl 5.8.0 was supposed
20879 # to have this new fancy threads implementation but my
20880 # perl doesn't have it" and from people trying to
20881 # (re)install the threads module using CPAN.pm and
20882 # CPAN.pm then offering to reinstall Perl 5.8.0,
20883 # the threads.pm and threads/shared.pm will always be
20884 # there, croaking informatively ("you need to rebuild
20885 # all of Perl with threads, sorry") when threads haven't
20886 # been compiled in.
20888 avail_ext="$avail_ext $xxx"
20891 : XXX Do we need a useipcsysv variable here
20892 case "${d_msg}${d_sem}${d_shm}" in
20893 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
20896 *) avail_ext="$avail_ext $xxx"
20905 case "$onlyextensions" in
20907 *) keepextensions=''
20908 echo "You have requested that only certains extensions be included..." >&4
20909 for i in $onlyextensions; do
20910 case " $avail_ext " in
20912 echo "Keeping extension $i."
20913 keepextensions="$keepextensions $i"
20915 *) echo "Ignoring extension $i." ;;
20918 avail_ext="$keepextensions"
20922 case "$noextensions" in
20924 *) keepextensions=''
20925 echo "You have requested that certain extensions be ignored..." >&4
20926 for i in $avail_ext; do
20927 case " $noextensions " in
20928 *" $i "*) echo "Ignoring extension $i." ;;
20929 *) echo "Keeping extension $i.";
20930 keepextensions="$keepextensions $i"
20934 avail_ext="$keepextensions"
20938 : Now see which nonxs extensions are supported on this system.
20939 : For now assume all are.
20941 for xxx in $nonxs_extensions ; do
20943 *) nonxs_ext="$nonxs_ext $xxx"
20955 A number of extensions are supplied with $package. You may choose to
20956 compile these extensions for dynamic loading (the default), compile
20957 them into the $package executable (static loading), or not include
20958 them at all. Answer "none" to include no extensions.
20959 Note that DynaLoader is always built and need not be mentioned here.
20962 case "$dynamic_ext" in
20964 : Exclude those listed in static_ext
20966 for xxx in $avail_ext; do
20967 case " $static_ext " in
20969 *) dflt="$dflt $xxx" ;;
20976 *) dflt="$dynamic_ext"
20977 # Perhaps we are reusing an old out-of-date config.sh.
20980 if test X"$dynamic_ext" != X"$avail_ext"; then
20982 NOTICE: Your previous config.sh list may be incorrect.
20983 The extensions now available to you are
20985 but the default list from your previous config.sh is
20997 rp="What extensions do you wish to load dynamically?"
21000 none) dynamic_ext=' ' ;;
21001 *) dynamic_ext="$ans" ;;
21004 case "$static_ext" in
21006 : Exclude those already listed in dynamic linking
21008 for xxx in $avail_ext; do
21009 case " $dynamic_ext " in
21011 *) dflt="$dflt $xxx" ;;
21018 *) dflt="$static_ext"
21025 rp="What extensions do you wish to load statically?"
21028 none) static_ext=' ' ;;
21029 *) static_ext="$ans" ;;
21034 A number of extensions are supplied with $package. Answer "none"
21035 to include no extensions.
21036 Note that DynaLoader is always built and need not be mentioned here.
21039 case "$static_ext" in
21040 '') dflt="$avail_ext" ;;
21041 *) dflt="$static_ext"
21042 # Perhaps we are reusing an old out-of-date config.sh.
21045 if test X"$static_ext" != X"$avail_ext"; then
21047 NOTICE: Your previous config.sh list may be incorrect.
21048 The extensions now available to you are
21050 but the default list from your previous config.sh is
21059 : Exclude those that are not xs extensions
21063 rp="What extensions do you wish to include?"
21066 none) static_ext=' ' ;;
21067 *) static_ext="$ans" ;;
21072 # Encode is a special case. If we are building Encode as a static
21073 # extension, we need to explicitly list its subextensions as well.
21074 # For other nested extensions, this is handled automatically by
21075 # the appropriate Makefile.PL.
21076 case " $static_ext " in
21077 *" Encode "*) # Add the subextensions of Encode
21079 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
21080 static_ext="$static_ext Encode/$xxx"
21086 set X $dynamic_ext $static_ext $nonxs_ext
21090 # Sanity check: We require an extension suitable for use with
21091 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
21092 # should show up as failures in the test suite, but it's helpful to
21093 # catch them now.) The 'extensions' list is normally sorted
21094 # alphabetically, so we need to accept either
21095 # DB_File ... Fcntl ... IO ....
21096 # or something like
21097 # Fcntl ... NDBM_File ... IO ....
21098 case " $extensions" in
21099 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
21100 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
21101 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
21102 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
21103 echo "WARNING: The Perl you are building will be quite crippled." >& 4
21107 : Remove libraries needed only for extensions
21108 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
21109 : The exception is SunOS 4.x, which needs them.
21110 case "${osname}X${osvers}" in
21114 *) case "$usedl" in
21115 $define|true|[yY]*)
21116 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
21120 *) perllibs="$libs"
21126 : Remove build directory name from cppstdin so it can be used from
21127 : either the present location or the final installed location.
21129 : Get out of the UU directory to get correct path name.
21131 case "$cppstdin" in
21133 echo "Stripping down cppstdin path name"
21139 : end of configuration questions
21141 echo "End of configuration questions."
21144 : back to where it started
21145 if test -d ../UU; then
21149 : configuration may be patched via a 'config.arch' file
21150 if $test -f config.arch; then
21151 echo "I see a config.arch file, loading it."
21155 : configuration may be patched via a 'config.over' file
21156 if $test -f config.over; then
21159 rp='I see a config.over file. Do you wish to load it?'
21162 n*) echo "OK, I'll ignore it.";;
21164 echo "Configuration override changes have been loaded."
21169 : in case they want portability, strip down executable paths
21170 case "$d_portable" in
21173 echo "Stripping down executable paths..." >&4
21174 for file in $loclist $trylist; do
21176 eval $file=`basename $temp`
21181 : create config.sh file
21183 echo "Creating config.sh..." >&4
21184 $spitshell <<EOT >config.sh
21187 # This file was produced by running the Configure script. It holds all the
21188 # definitions figured out by Configure. Should you modify one of these values,
21189 # do not forget to propagate your changes by running "Configure -der". You may
21190 # instead choose to run each of the .SH files by yourself, or "Configure -S".
21193 # Package name : $package
21194 # Source directory : $src
21195 # Configuration time: $cf_time
21196 # Configured by : $cf_by
21197 # Target system : $myuname
21207 Revision='$Revision'
21215 alignbytes='$alignbytes'
21216 ansi2knr='$ansi2knr'
21217 aphostname='$aphostname'
21218 api_revision='$api_revision'
21219 api_subversion='$api_subversion'
21220 api_version='$api_version'
21221 api_versionstring='$api_versionstring'
21224 archlibexp='$archlibexp'
21225 archname64='$archname64'
21226 archname='$archname'
21227 archobjs='$archobjs'
21228 asctime_r_proto='$asctime_r_proto'
21236 byteorder='$byteorder'
21238 castflags='$castflags'
21241 cccdlflags='$cccdlflags'
21242 ccdlflags='$ccdlflags'
21244 ccflags_uselargefiles='$ccflags_uselargefiles'
21246 ccsymbols='$ccsymbols'
21247 ccversion='$ccversion'
21249 cf_email='$cf_email'
21251 charsize='$charsize'
21255 clocktype='$clocktype'
21257 compress='$compress'
21258 contains='$contains'
21262 cpp_stuff='$cpp_stuff'
21263 cppccsymbols='$cppccsymbols'
21264 cppflags='$cppflags'
21266 cppminus='$cppminus'
21268 cppstdin='$cppstdin'
21269 cppsymbols='$cppsymbols'
21270 crypt_r_proto='$crypt_r_proto'
21271 cryptlib='$cryptlib'
21273 ctermid_r_proto='$ctermid_r_proto'
21274 ctime_r_proto='$ctime_r_proto'
21275 d_Gconvert='$d_Gconvert'
21276 d_PRIEUldbl='$d_PRIEUldbl'
21277 d_PRIFUldbl='$d_PRIFUldbl'
21278 d_PRIGUldbl='$d_PRIGUldbl'
21279 d_PRIXU64='$d_PRIXU64'
21280 d_PRId64='$d_PRId64'
21281 d_PRIeldbl='$d_PRIeldbl'
21282 d_PRIfldbl='$d_PRIfldbl'
21283 d_PRIgldbl='$d_PRIgldbl'
21284 d_PRIi64='$d_PRIi64'
21285 d_PRIo64='$d_PRIo64'
21286 d_PRIu64='$d_PRIu64'
21287 d_PRIx64='$d_PRIx64'
21288 d_SCNfldbl='$d_SCNfldbl'
21289 d__fwalk='$d__fwalk'
21290 d_access='$d_access'
21291 d_accessx='$d_accessx'
21294 d_archlib='$d_archlib'
21295 d_asctime_r='$d_asctime_r'
21298 d_attribute_format='$d_attribute_format'
21299 d_attribute_malloc='$d_attribute_malloc'
21300 d_attribute_nonnull='$d_attribute_nonnull'
21301 d_attribute_noreturn='$d_attribute_noreturn'
21302 d_attribute_pure='$d_attribute_pure'
21303 d_attribute_unused='$d_attribute_unused'
21304 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
21308 d_bsdgetpgrp='$d_bsdgetpgrp'
21309 d_bsdsetpgrp='$d_bsdsetpgrp'
21310 d_builtin_choose_expr='$d_builtin_choose_expr'
21311 d_builtin_expect='$d_builtin_expect'
21313 d_c99_variadic_macros='$d_c99_variadic_macros'
21314 d_casti32='$d_casti32'
21315 d_castneg='$d_castneg'
21316 d_charvspr='$d_charvspr'
21318 d_chroot='$d_chroot'
21319 d_chsize='$d_chsize'
21321 d_clearenv='$d_clearenv'
21322 d_closedir='$d_closedir'
21323 d_cmsghdr_s='$d_cmsghdr_s'
21325 d_copysignl='$d_copysignl'
21327 d_crypt_r='$d_crypt_r'
21329 d_ctermid_r='$d_ctermid_r'
21330 d_ctime_r='$d_ctime_r'
21331 d_cuserid='$d_cuserid'
21332 d_dbl_dig='$d_dbl_dig'
21333 d_dbminitproto='$d_dbminitproto'
21334 d_difftime='$d_difftime'
21336 d_dirnamlen='$d_dirnamlen'
21337 d_dlerror='$d_dlerror'
21338 d_dlopen='$d_dlopen'
21339 d_dlsymun='$d_dlsymun'
21340 d_dosuid='$d_dosuid'
21341 d_drand48_r='$d_drand48_r'
21342 d_drand48proto='$d_drand48proto'
21344 d_eaccess='$d_eaccess'
21345 d_endgrent='$d_endgrent'
21346 d_endgrent_r='$d_endgrent_r'
21347 d_endhent='$d_endhent'
21348 d_endhostent_r='$d_endhostent_r'
21349 d_endnent='$d_endnent'
21350 d_endnetent_r='$d_endnetent_r'
21351 d_endpent='$d_endpent'
21352 d_endprotoent_r='$d_endprotoent_r'
21353 d_endpwent='$d_endpwent'
21354 d_endpwent_r='$d_endpwent_r'
21355 d_endsent='$d_endsent'
21356 d_endservent_r='$d_endservent_r'
21357 d_eofnblk='$d_eofnblk'
21358 d_eunice='$d_eunice'
21359 d_faststdio='$d_faststdio'
21360 d_fchdir='$d_fchdir'
21361 d_fchmod='$d_fchmod'
21362 d_fchown='$d_fchown'
21364 d_fcntl_can_lock='$d_fcntl_can_lock'
21365 d_fd_macros='$d_fd_macros'
21366 d_fd_set='$d_fd_set'
21367 d_fds_bits='$d_fds_bits'
21368 d_fgetpos='$d_fgetpos'
21369 d_finite='$d_finite'
21370 d_finitel='$d_finitel'
21371 d_flexfnam='$d_flexfnam'
21373 d_flockproto='$d_flockproto'
21375 d_fp_class='$d_fp_class'
21376 d_fpathconf='$d_fpathconf'
21377 d_fpclass='$d_fpclass'
21378 d_fpclassify='$d_fpclassify'
21379 d_fpclassl='$d_fpclassl'
21380 d_fpos64_t='$d_fpos64_t'
21381 d_frexpl='$d_frexpl'
21382 d_fs_data_s='$d_fs_data_s'
21383 d_fseeko='$d_fseeko'
21384 d_fsetpos='$d_fsetpos'
21385 d_fstatfs='$d_fstatfs'
21386 d_fstatvfs='$d_fstatvfs'
21388 d_ftello='$d_ftello'
21390 d_futimes='$d_futimes'
21391 d_getcwd='$d_getcwd'
21392 d_getespwnam='$d_getespwnam'
21393 d_getfsstat='$d_getfsstat'
21394 d_getgrent='$d_getgrent'
21395 d_getgrent_r='$d_getgrent_r'
21396 d_getgrgid_r='$d_getgrgid_r'
21397 d_getgrnam_r='$d_getgrnam_r'
21398 d_getgrps='$d_getgrps'
21399 d_gethbyaddr='$d_gethbyaddr'
21400 d_gethbyname='$d_gethbyname'
21401 d_gethent='$d_gethent'
21402 d_gethname='$d_gethname'
21403 d_gethostbyaddr_r='$d_gethostbyaddr_r'
21404 d_gethostbyname_r='$d_gethostbyname_r'
21405 d_gethostent_r='$d_gethostent_r'
21406 d_gethostprotos='$d_gethostprotos'
21407 d_getitimer='$d_getitimer'
21408 d_getlogin='$d_getlogin'
21409 d_getlogin_r='$d_getlogin_r'
21410 d_getmnt='$d_getmnt'
21411 d_getmntent='$d_getmntent'
21412 d_getnbyaddr='$d_getnbyaddr'
21413 d_getnbyname='$d_getnbyname'
21414 d_getnent='$d_getnent'
21415 d_getnetbyaddr_r='$d_getnetbyaddr_r'
21416 d_getnetbyname_r='$d_getnetbyname_r'
21417 d_getnetent_r='$d_getnetent_r'
21418 d_getnetprotos='$d_getnetprotos'
21419 d_getpagsz='$d_getpagsz'
21420 d_getpbyname='$d_getpbyname'
21421 d_getpbynumber='$d_getpbynumber'
21422 d_getpent='$d_getpent'
21423 d_getpgid='$d_getpgid'
21424 d_getpgrp2='$d_getpgrp2'
21425 d_getpgrp='$d_getpgrp'
21426 d_getppid='$d_getppid'
21427 d_getprior='$d_getprior'
21428 d_getprotobyname_r='$d_getprotobyname_r'
21429 d_getprotobynumber_r='$d_getprotobynumber_r'
21430 d_getprotoent_r='$d_getprotoent_r'
21431 d_getprotoprotos='$d_getprotoprotos'
21432 d_getprpwnam='$d_getprpwnam'
21433 d_getpwent='$d_getpwent'
21434 d_getpwent_r='$d_getpwent_r'
21435 d_getpwnam_r='$d_getpwnam_r'
21436 d_getpwuid_r='$d_getpwuid_r'
21437 d_getsbyname='$d_getsbyname'
21438 d_getsbyport='$d_getsbyport'
21439 d_getsent='$d_getsent'
21440 d_getservbyname_r='$d_getservbyname_r'
21441 d_getservbyport_r='$d_getservbyport_r'
21442 d_getservent_r='$d_getservent_r'
21443 d_getservprotos='$d_getservprotos'
21444 d_getspnam='$d_getspnam'
21445 d_getspnam_r='$d_getspnam_r'
21446 d_gettimeod='$d_gettimeod'
21447 d_gmtime_r='$d_gmtime_r'
21448 d_gnulibc='$d_gnulibc'
21449 d_grpasswd='$d_grpasswd'
21450 d_hasmntopt='$d_hasmntopt'
21452 d_ilogbl='$d_ilogbl'
21453 d_inc_version_list='$d_inc_version_list'
21455 d_inetaton='$d_inetaton'
21456 d_int64_t='$d_int64_t'
21457 d_isascii='$d_isascii'
21458 d_isfinite='$d_isfinite'
21461 d_isnanl='$d_isnanl'
21462 d_killpg='$d_killpg'
21463 d_lchown='$d_lchown'
21464 d_ldbl_dig='$d_ldbl_dig'
21465 d_libm_lib_version='$d_libm_lib_version'
21467 d_localtime_r='$d_localtime_r'
21468 d_locconv='$d_locconv'
21470 d_longdbl='$d_longdbl'
21471 d_longlong='$d_longlong'
21472 d_lseekproto='$d_lseekproto'
21474 d_madvise='$d_madvise'
21475 d_malloc_good_size='$d_malloc_good_size'
21476 d_malloc_size='$d_malloc_size'
21478 d_mbstowcs='$d_mbstowcs'
21479 d_mbtowc='$d_mbtowc'
21480 d_memchr='$d_memchr'
21481 d_memcmp='$d_memcmp'
21482 d_memcpy='$d_memcpy'
21483 d_memmove='$d_memmove'
21484 d_memset='$d_memset'
21486 d_mkdtemp='$d_mkdtemp'
21487 d_mkfifo='$d_mkfifo'
21488 d_mkstemp='$d_mkstemp'
21489 d_mkstemps='$d_mkstemps'
21490 d_mktime='$d_mktime'
21493 d_modfl_pow32_bug='$d_modfl_pow32_bug'
21494 d_modflproto='$d_modflproto'
21495 d_mprotect='$d_mprotect'
21497 d_msg_ctrunc='$d_msg_ctrunc'
21498 d_msg_dontroute='$d_msg_dontroute'
21499 d_msg_oob='$d_msg_oob'
21500 d_msg_peek='$d_msg_peek'
21501 d_msg_proxy='$d_msg_proxy'
21502 d_msgctl='$d_msgctl'
21503 d_msgget='$d_msgget'
21504 d_msghdr_s='$d_msghdr_s'
21505 d_msgrcv='$d_msgrcv'
21506 d_msgsnd='$d_msgsnd'
21508 d_munmap='$d_munmap'
21509 d_mymalloc='$d_mymalloc'
21511 d_nl_langinfo='$d_nl_langinfo'
21512 d_nv_preserves_uv='$d_nv_preserves_uv'
21513 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
21514 d_off64_t='$d_off64_t'
21515 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
21516 d_oldpthreads='$d_oldpthreads'
21517 d_oldsock='$d_oldsock'
21519 d_pathconf='$d_pathconf'
21521 d_perl_otherlibdirs='$d_perl_otherlibdirs'
21522 d_phostname='$d_phostname'
21525 d_portable='$d_portable'
21526 d_procselfexe='$d_procselfexe'
21527 d_pthread_atfork='$d_pthread_atfork'
21528 d_pthread_attr_setscope='$d_pthread_attr_setscope'
21529 d_pthread_yield='$d_pthread_yield'
21531 d_pwchange='$d_pwchange'
21532 d_pwclass='$d_pwclass'
21533 d_pwcomment='$d_pwcomment'
21534 d_pwexpire='$d_pwexpire'
21535 d_pwgecos='$d_pwgecos'
21536 d_pwpasswd='$d_pwpasswd'
21537 d_pwquota='$d_pwquota'
21540 d_random_r='$d_random_r'
21541 d_readdir64_r='$d_readdir64_r'
21542 d_readdir='$d_readdir'
21543 d_readdir_r='$d_readdir_r'
21544 d_readlink='$d_readlink'
21546 d_recvmsg='$d_recvmsg'
21547 d_rename='$d_rename'
21548 d_rewinddir='$d_rewinddir'
21550 d_safebcpy='$d_safebcpy'
21551 d_safemcpy='$d_safemcpy'
21552 d_sanemcmp='$d_sanemcmp'
21553 d_sbrkproto='$d_sbrkproto'
21554 d_scalbnl='$d_scalbnl'
21555 d_sched_yield='$d_sched_yield'
21556 d_scm_rights='$d_scm_rights'
21557 d_seekdir='$d_seekdir'
21558 d_select='$d_select'
21560 d_semctl='$d_semctl'
21561 d_semctl_semid_ds='$d_semctl_semid_ds'
21562 d_semctl_semun='$d_semctl_semun'
21563 d_semget='$d_semget'
21565 d_sendmsg='$d_sendmsg'
21566 d_setegid='$d_setegid'
21567 d_seteuid='$d_seteuid'
21568 d_setgrent='$d_setgrent'
21569 d_setgrent_r='$d_setgrent_r'
21570 d_setgrps='$d_setgrps'
21571 d_sethent='$d_sethent'
21572 d_sethostent_r='$d_sethostent_r'
21573 d_setitimer='$d_setitimer'
21574 d_setlinebuf='$d_setlinebuf'
21575 d_setlocale='$d_setlocale'
21576 d_setlocale_r='$d_setlocale_r'
21577 d_setnent='$d_setnent'
21578 d_setnetent_r='$d_setnetent_r'
21579 d_setpent='$d_setpent'
21580 d_setpgid='$d_setpgid'
21581 d_setpgrp2='$d_setpgrp2'
21582 d_setpgrp='$d_setpgrp'
21583 d_setprior='$d_setprior'
21584 d_setproctitle='$d_setproctitle'
21585 d_setprotoent_r='$d_setprotoent_r'
21586 d_setpwent='$d_setpwent'
21587 d_setpwent_r='$d_setpwent_r'
21588 d_setregid='$d_setregid'
21589 d_setresgid='$d_setresgid'
21590 d_setresuid='$d_setresuid'
21591 d_setreuid='$d_setreuid'
21592 d_setrgid='$d_setrgid'
21593 d_setruid='$d_setruid'
21594 d_setsent='$d_setsent'
21595 d_setservent_r='$d_setservent_r'
21596 d_setsid='$d_setsid'
21597 d_setvbuf='$d_setvbuf'
21601 d_shmatprototype='$d_shmatprototype'
21602 d_shmctl='$d_shmctl'
21604 d_shmget='$d_shmget'
21605 d_sigaction='$d_sigaction'
21606 d_sigprocmask='$d_sigprocmask'
21607 d_sigsetjmp='$d_sigsetjmp'
21608 d_sitearch='$d_sitearch'
21609 d_snprintf='$d_snprintf'
21610 d_sockatmark='$d_sockatmark'
21611 d_sockatmarkproto='$d_sockatmarkproto'
21612 d_socket='$d_socket'
21613 d_socklen_t='$d_socklen_t'
21614 d_sockpair='$d_sockpair'
21615 d_socks5_init='$d_socks5_init'
21616 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
21618 d_srand48_r='$d_srand48_r'
21619 d_srandom_r='$d_srandom_r'
21620 d_sresgproto='$d_sresgproto'
21621 d_sresuproto='$d_sresuproto'
21622 d_statblks='$d_statblks'
21623 d_statfs_f_flags='$d_statfs_f_flags'
21624 d_statfs_s='$d_statfs_s'
21625 d_statvfs='$d_statvfs'
21626 d_stdio_cnt_lval='$d_stdio_cnt_lval'
21627 d_stdio_ptr_lval='$d_stdio_ptr_lval'
21628 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
21629 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
21630 d_stdio_stream_array='$d_stdio_stream_array'
21631 d_stdiobase='$d_stdiobase'
21632 d_stdstdio='$d_stdstdio'
21633 d_strchr='$d_strchr'
21634 d_strcoll='$d_strcoll'
21635 d_strctcpy='$d_strctcpy'
21636 d_strerrm='$d_strerrm'
21637 d_strerror='$d_strerror'
21638 d_strerror_r='$d_strerror_r'
21639 d_strftime='$d_strftime'
21640 d_strlcat='$d_strlcat'
21641 d_strlcpy='$d_strlcpy'
21642 d_strtod='$d_strtod'
21643 d_strtol='$d_strtol'
21644 d_strtold='$d_strtold'
21645 d_strtoll='$d_strtoll'
21646 d_strtoq='$d_strtoq'
21647 d_strtoul='$d_strtoul'
21648 d_strtoull='$d_strtoull'
21649 d_strtouq='$d_strtouq'
21650 d_strxfrm='$d_strxfrm'
21651 d_suidsafe='$d_suidsafe'
21652 d_symlink='$d_symlink'
21653 d_syscall='$d_syscall'
21654 d_syscallproto='$d_syscallproto'
21655 d_sysconf='$d_sysconf'
21656 d_sysernlst='$d_sysernlst'
21657 d_syserrlst='$d_syserrlst'
21658 d_system='$d_system'
21659 d_tcgetpgrp='$d_tcgetpgrp'
21660 d_tcsetpgrp='$d_tcsetpgrp'
21661 d_telldir='$d_telldir'
21662 d_telldirproto='$d_telldirproto'
21665 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
21666 d_tm_tm_zone='$d_tm_tm_zone'
21667 d_tmpnam_r='$d_tmpnam_r'
21668 d_truncate='$d_truncate'
21669 d_ttyname_r='$d_ttyname_r'
21670 d_tzname='$d_tzname'
21671 d_u32align='$d_u32align'
21672 d_ualarm='$d_ualarm'
21675 d_union_semun='$d_union_semun'
21676 d_unordered='$d_unordered'
21677 d_unsetenv='$d_unsetenv'
21678 d_usleep='$d_usleep'
21679 d_usleepproto='$d_usleepproto'
21681 d_vendorarch='$d_vendorarch'
21682 d_vendorbin='$d_vendorbin'
21683 d_vendorlib='$d_vendorlib'
21684 d_vendorscript='$d_vendorscript'
21686 d_void_closedir='$d_void_closedir'
21687 d_voidsig='$d_voidsig'
21688 d_voidtty='$d_voidtty'
21689 d_volatile='$d_volatile'
21690 d_vprintf='$d_vprintf'
21691 d_vsnprintf='$d_vsnprintf'
21693 d_waitpid='$d_waitpid'
21694 d_wcstombs='$d_wcstombs'
21695 d_wctomb='$d_wctomb'
21696 d_writev='$d_writev'
21699 db_hashtype='$db_hashtype'
21700 db_prefixtype='$db_prefixtype'
21701 db_version_major='$db_version_major'
21702 db_version_minor='$db_version_minor'
21703 db_version_patch='$db_version_patch'
21704 defvoidused='$defvoidused'
21705 direntrytype='$direntrytype'
21708 doublesize='$doublesize'
21710 drand48_r_proto='$drand48_r_proto'
21711 dynamic_ext='$dynamic_ext'
21717 endgrent_r_proto='$endgrent_r_proto'
21718 endhostent_r_proto='$endhostent_r_proto'
21719 endnetent_r_proto='$endnetent_r_proto'
21720 endprotoent_r_proto='$endprotoent_r_proto'
21721 endpwent_r_proto='$endpwent_r_proto'
21722 endservent_r_proto='$endservent_r_proto'
21723 eunicefix='$eunicefix'
21726 extensions='$extensions'
21728 fflushNULL='$fflushNULL'
21729 fflushall='$fflushall'
21731 firstmakefile='$firstmakefile'
21733 fpossize='$fpossize'
21734 fpostype='$fpostype'
21735 freetype='$freetype'
21738 full_csh='$full_csh'
21739 full_sed='$full_sed'
21740 gccansipedantic='$gccansipedantic'
21741 gccosandvers='$gccosandvers'
21742 gccversion='$gccversion'
21743 getgrent_r_proto='$getgrent_r_proto'
21744 getgrgid_r_proto='$getgrgid_r_proto'
21745 getgrnam_r_proto='$getgrnam_r_proto'
21746 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
21747 gethostbyname_r_proto='$gethostbyname_r_proto'
21748 gethostent_r_proto='$gethostent_r_proto'
21749 getlogin_r_proto='$getlogin_r_proto'
21750 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
21751 getnetbyname_r_proto='$getnetbyname_r_proto'
21752 getnetent_r_proto='$getnetent_r_proto'
21753 getprotobyname_r_proto='$getprotobyname_r_proto'
21754 getprotobynumber_r_proto='$getprotobynumber_r_proto'
21755 getprotoent_r_proto='$getprotoent_r_proto'
21756 getpwent_r_proto='$getpwent_r_proto'
21757 getpwnam_r_proto='$getpwnam_r_proto'
21758 getpwuid_r_proto='$getpwuid_r_proto'
21759 getservbyname_r_proto='$getservbyname_r_proto'
21760 getservbyport_r_proto='$getservbyport_r_proto'
21761 getservent_r_proto='$getservent_r_proto'
21762 getspnam_r_proto='$getspnam_r_proto'
21763 gidformat='$gidformat'
21769 gmtime_r_proto='$gmtime_r_proto'
21770 gnulibc_version='$gnulibc_version'
21772 groupcat='$groupcat'
21773 groupstype='$groupstype'
21776 h_sysfile='$h_sysfile'
21779 html1dir='$html1dir'
21780 html1direxp='$html1direxp'
21781 html3dir='$html3dir'
21782 html3direxp='$html3direxp'
21791 i_arpainet='$i_arpainet'
21792 i_bsdioctl='$i_bsdioctl'
21796 i_dirent='$i_dirent'
21802 i_fp_class='$i_fp_class'
21805 i_ieeefp='$i_ieeefp'
21806 i_inttypes='$i_inttypes'
21807 i_langinfo='$i_langinfo'
21808 i_libutil='$i_libutil'
21809 i_limits='$i_limits'
21810 i_locale='$i_locale'
21811 i_machcthr='$i_machcthr'
21812 i_malloc='$i_malloc'
21814 i_memory='$i_memory'
21815 i_mntent='$i_mntent'
21818 i_neterrno='$i_neterrno'
21819 i_netinettcp='$i_netinettcp'
21823 i_pthread='$i_pthread'
21825 i_rpcsvcdbm='$i_rpcsvcdbm'
21828 i_shadow='$i_shadow'
21830 i_stdarg='$i_stdarg'
21831 i_stddef='$i_stddef'
21832 i_stdlib='$i_stdlib'
21833 i_string='$i_string'
21834 i_sunmath='$i_sunmath'
21835 i_sysaccess='$i_sysaccess'
21836 i_sysdir='$i_sysdir'
21837 i_sysfile='$i_sysfile'
21838 i_sysfilio='$i_sysfilio'
21840 i_sysioctl='$i_sysioctl'
21841 i_syslog='$i_syslog'
21842 i_sysmman='$i_sysmman'
21843 i_sysmode='$i_sysmode'
21844 i_sysmount='$i_sysmount'
21845 i_sysndir='$i_sysndir'
21846 i_sysparam='$i_sysparam'
21847 i_sysresrc='$i_sysresrc'
21848 i_syssecrt='$i_syssecrt'
21849 i_sysselct='$i_sysselct'
21850 i_syssockio='$i_syssockio'
21851 i_sysstat='$i_sysstat'
21852 i_sysstatfs='$i_sysstatfs'
21853 i_sysstatvfs='$i_sysstatvfs'
21854 i_systime='$i_systime'
21855 i_systimek='$i_systimek'
21856 i_systimes='$i_systimes'
21857 i_systypes='$i_systypes'
21858 i_sysuio='$i_sysuio'
21860 i_sysutsname='$i_sysutsname'
21861 i_sysvfs='$i_sysvfs'
21862 i_syswait='$i_syswait'
21863 i_termio='$i_termio'
21864 i_termios='$i_termios'
21866 i_unistd='$i_unistd'
21869 i_values='$i_values'
21870 i_varargs='$i_varargs'
21871 i_varhdr='$i_varhdr'
21873 ignore_versioned_solibs='$ignore_versioned_solibs'
21874 inc_version_list='$inc_version_list'
21875 inc_version_list_init='$inc_version_list_init'
21878 initialinstalllocation='$initialinstalllocation'
21879 installarchlib='$installarchlib'
21880 installbin='$installbin'
21881 installhtml1dir='$installhtml1dir'
21882 installhtml3dir='$installhtml3dir'
21883 installman1dir='$installman1dir'
21884 installman3dir='$installman3dir'
21885 installprefix='$installprefix'
21886 installprefixexp='$installprefixexp'
21887 installprivlib='$installprivlib'
21888 installscript='$installscript'
21889 installsitearch='$installsitearch'
21890 installsitebin='$installsitebin'
21891 installsitehtml1dir='$installsitehtml1dir'
21892 installsitehtml3dir='$installsitehtml3dir'
21893 installsitelib='$installsitelib'
21894 installsiteman1dir='$installsiteman1dir'
21895 installsiteman3dir='$installsiteman3dir'
21896 installsitescript='$installsitescript'
21897 installstyle='$installstyle'
21898 installusrbinperl='$installusrbinperl'
21899 installvendorarch='$installvendorarch'
21900 installvendorbin='$installvendorbin'
21901 installvendorhtml1dir='$installvendorhtml1dir'
21902 installvendorhtml3dir='$installvendorhtml3dir'
21903 installvendorlib='$installvendorlib'
21904 installvendorman1dir='$installvendorman1dir'
21905 installvendorman3dir='$installvendorman3dir'
21906 installvendorscript='$installvendorscript'
21908 issymlink='$issymlink'
21909 ivdformat='$ivdformat'
21912 known_extensions='$known_extensions'
21915 lddlflags='$lddlflags'
21917 ldflags_uselargefiles='$ldflags_uselargefiles'
21918 ldlibpthname='$ldlibpthname'
21925 libsdirs='$libsdirs'
21926 libsfiles='$libsfiles'
21927 libsfound='$libsfound'
21928 libspath='$libspath'
21929 libswanted='$libswanted'
21930 libswanted_uselargefiles='$libswanted_uselargefiles'
21936 localtime_r_proto='$localtime_r_proto'
21937 locincpth='$locincpth'
21938 loclibpth='$loclibpth'
21939 longdblsize='$longdblsize'
21940 longlongsize='$longlongsize'
21941 longsize='$longsize'
21945 lseeksize='$lseeksize'
21946 lseektype='$lseektype'
21949 madlyobj='$madlyobj'
21950 madlysrc='$madlysrc'
21954 make_set_make='$make_set_make'
21955 mallocobj='$mallocobj'
21956 mallocsrc='$mallocsrc'
21957 malloctype='$malloctype'
21959 man1direxp='$man1direxp'
21962 man3direxp='$man3direxp'
21964 mips_type='$mips_type'
21965 mistrustnm='$mistrustnm'
21967 mmaptype='$mmaptype'
21968 modetype='$modetype'
21970 multiarch='$multiarch'
21972 myarchname='$myarchname'
21973 mydomain='$mydomain'
21974 myhostname='$myhostname'
21977 need_va_copy='$need_va_copy'
21978 netdb_hlen_type='$netdb_hlen_type'
21979 netdb_host_type='$netdb_host_type'
21980 netdb_name_type='$netdb_name_type'
21981 netdb_net_type='$netdb_net_type'
21984 nm_so_opt='$nm_so_opt'
21985 nonxs_ext='$nonxs_ext'
21987 nvEUformat='$nvEUformat'
21988 nvFUformat='$nvFUformat'
21989 nvGUformat='$nvGUformat'
21990 nv_preserves_uv_bits='$nv_preserves_uv_bits'
21991 nveformat='$nveformat'
21992 nvfformat='$nvfformat'
21993 nvgformat='$nvgformat'
21996 o_nonblock='$o_nonblock'
21998 old_pthread_create_joinable='$old_pthread_create_joinable'
21999 optimize='$optimize'
22000 orderlib='$orderlib'
22003 otherlibdirs='$otherlibdirs'
22007 patchlevel='$patchlevel'
22008 path_sep='$path_sep'
22011 perl_patchlevel='$perl_patchlevel'
22012 perladmin='$perladmin'
22013 perllibs='$perllibs'
22014 perlpath='$perlpath'
22016 phostname='$phostname'
22022 prefixexp='$prefixexp'
22024 privlibexp='$privlibexp'
22025 procselfexe='$procselfexe'
22026 prototype='$prototype'
22028 quadkind='$quadkind'
22029 quadtype='$quadtype'
22030 randbits='$randbits'
22031 randfunc='$randfunc'
22032 random_r_proto='$random_r_proto'
22033 randseedtype='$randseedtype'
22035 rd_nodata='$rd_nodata'
22036 readdir64_r_proto='$readdir64_r_proto'
22037 readdir_r_proto='$readdir_r_proto'
22038 revision='$revision'
22043 sPRIEUldbl='$sPRIEUldbl'
22044 sPRIFUldbl='$sPRIFUldbl'
22045 sPRIGUldbl='$sPRIGUldbl'
22046 sPRIXU64='$sPRIXU64'
22048 sPRIeldbl='$sPRIeldbl'
22049 sPRIfldbl='$sPRIfldbl'
22050 sPRIgldbl='$sPRIgldbl'
22055 sSCNfldbl='$sSCNfldbl'
22056 sched_yield='$sched_yield'
22057 scriptdir='$scriptdir'
22058 scriptdirexp='$scriptdirexp'
22060 seedfunc='$seedfunc'
22061 selectminbits='$selectminbits'
22062 selecttype='$selecttype'
22063 sendmail='$sendmail'
22064 setgrent_r_proto='$setgrent_r_proto'
22065 sethostent_r_proto='$sethostent_r_proto'
22066 setlocale_r_proto='$setlocale_r_proto'
22067 setnetent_r_proto='$setnetent_r_proto'
22068 setprotoent_r_proto='$setprotoent_r_proto'
22069 setpwent_r_proto='$setpwent_r_proto'
22070 setservent_r_proto='$setservent_r_proto'
22073 sharpbang='$sharpbang'
22074 shmattype='$shmattype'
22075 shortsize='$shortsize'
22078 sig_count='$sig_count'
22079 sig_name='$sig_name'
22080 sig_name_init='$sig_name_init'
22082 sig_num_init='$sig_num_init'
22083 sig_size='$sig_size'
22084 signal_t='$signal_t'
22085 sitearch='$sitearch'
22086 sitearchexp='$sitearchexp'
22088 sitebinexp='$sitebinexp'
22089 sitehtml1dir='$sitehtml1dir'
22090 sitehtml1direxp='$sitehtml1direxp'
22091 sitehtml3dir='$sitehtml3dir'
22092 sitehtml3direxp='$sitehtml3direxp'
22094 sitelib_stem='$sitelib_stem'
22095 sitelibexp='$sitelibexp'
22096 siteman1dir='$siteman1dir'
22097 siteman1direxp='$siteman1direxp'
22098 siteman3dir='$siteman3dir'
22099 siteman3direxp='$siteman3direxp'
22100 siteprefix='$siteprefix'
22101 siteprefixexp='$siteprefixexp'
22102 sitescript='$sitescript'
22103 sitescriptexp='$sitescriptexp'
22104 sizesize='$sizesize'
22105 sizetype='$sizetype'
22109 sockethdr='$sockethdr'
22110 socketlib='$socketlib'
22111 socksizetype='$socksizetype'
22113 spackage='$spackage'
22114 spitshell='$spitshell'
22115 srand48_r_proto='$srand48_r_proto'
22116 srandom_r_proto='$srandom_r_proto'
22118 ssizetype='$ssizetype'
22119 startperl='$startperl'
22121 static_ext='$static_ext'
22123 stdio_base='$stdio_base'
22124 stdio_bufsiz='$stdio_bufsiz'
22125 stdio_cnt='$stdio_cnt'
22126 stdio_filbuf='$stdio_filbuf'
22127 stdio_ptr='$stdio_ptr'
22128 stdio_stream_array='$stdio_stream_array'
22129 strerror_r_proto='$strerror_r_proto'
22132 subversion='$subversion'
22136 targetarch='$targetarch'
22140 timeincl='$timeincl'
22141 timetype='$timetype'
22142 tmpnam_r_proto='$tmpnam_r_proto'
22148 ttyname_r_proto='$ttyname_r_proto'
22157 uidformat='$uidformat'
22163 uquadtype='$uquadtype'
22164 use5005threads='$use5005threads'
22165 use64bitall='$use64bitall'
22166 use64bitint='$use64bitint'
22167 usecrosscompile='$usecrosscompile'
22169 usefaststdio='$usefaststdio'
22170 useithreads='$useithreads'
22171 uselargefiles='$uselargefiles'
22172 uselongdouble='$uselongdouble'
22173 usemallocwrap='$usemallocwrap'
22174 usemorebits='$usemorebits'
22175 usemultiplicity='$usemultiplicity'
22176 usemymalloc='$usemymalloc'
22178 useopcode='$useopcode'
22179 useperlio='$useperlio'
22180 useposix='$useposix'
22181 usereentrant='$usereentrant'
22182 userelocatableinc='$userelocatableinc'
22184 useshrplib='$useshrplib'
22185 usesitecustomize='$usesitecustomize'
22186 usesocks='$usesocks'
22187 usethreads='$usethreads'
22188 usevendorprefix='$usevendorprefix'
22189 usevfork='$usevfork'
22192 uvXUformat='$uvXUformat'
22193 uvoformat='$uvoformat'
22196 uvuformat='$uvuformat'
22197 uvxformat='$uvxformat'
22198 vendorarch='$vendorarch'
22199 vendorarchexp='$vendorarchexp'
22200 vendorbin='$vendorbin'
22201 vendorbinexp='$vendorbinexp'
22202 vendorhtml1dir='$vendorhtml1dir'
22203 vendorhtml1direxp='$vendorhtml1direxp'
22204 vendorhtml3dir='$vendorhtml3dir'
22205 vendorhtml3direxp='$vendorhtml3direxp'
22206 vendorlib='$vendorlib'
22207 vendorlib_stem='$vendorlib_stem'
22208 vendorlibexp='$vendorlibexp'
22209 vendorman1dir='$vendorman1dir'
22210 vendorman1direxp='$vendorman1direxp'
22211 vendorman3dir='$vendorman3dir'
22212 vendorman3direxp='$vendorman3direxp'
22213 vendorprefix='$vendorprefix'
22214 vendorprefixexp='$vendorprefixexp'
22215 vendorscript='$vendorscript'
22216 vendorscriptexp='$vendorscriptexp'
22218 version_patchlevel_string='$version_patchlevel_string'
22219 versiononly='$versiononly'
22221 voidflags='$voidflags'
22224 yaccflags='$yaccflags'
22229 : Add in command line options if available
22230 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22232 : add special variables
22233 $test -f $src/patchlevel.h && \
22234 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
22235 echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
22236 echo "PERL_CONFIG_SH=true" >>config.sh
22238 : propagate old symbols
22239 if $test -f UU/config.sh; then
22240 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
22241 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
22242 $sort | $uniq -u >UU/oldsyms
22243 set X `cat UU/oldsyms`
22249 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
22251 echo "# Variables propagated from previous config.sh file." >>config.sh
22252 for sym in `cat UU/oldsyms`; do
22253 echo " Propagating $hint variable "'$'"$sym..."
22254 eval 'tmp="$'"${sym}"'"'
22256 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
22262 : Finish up by extracting the .SH files
22266 echo "Extraction done."
22276 If you'd like to make any changes to the config.sh file before I begin
22277 to configure things, do it as a shell escape now (e.g. !vi config.sh).
22280 rp="Press return or use a shell escape to edit config.sh:"
22285 *) : in case they cannot read
22286 sh 1>&4 -c "$ans";;
22291 : if this fails, just run all the .SH files by hand
22300 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
22307 Now you need to generate make dependencies by running "$make depend".
22308 You might prefer to run it in background: "$make depend > makedepend.out &"
22309 It can take a while, so you might not want to run it right now.
22314 rp="Run $make depend now?"
22318 $make depend && echo "Now you must run '$make'."
22321 echo "You must run '$make depend' then '$make'."
22324 elif test -f [Mm]akefile; then
22326 echo "Now you must run a $make."
22328 echo "Configure done."
22331 if $test -f Policy.sh; then
22334 If you compile $package on a different machine or from a different object
22335 directory, copy the Policy.sh file from this object directory to the
22336 new one before you run Configure -- this will help you with most of
22337 the policy defaults.
22341 if $test -f config.msg; then
22342 echo "Hmm. I also noted the following information while running:"
22344 $cat config.msg >&4
22347 $rm -f kit*isdone ark*isdone