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 Apr 3 12:00:10 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=''
405 endhostent_r_proto=''
411 endprotoent_r_proto=''
417 endservent_r_proto=''
469 gethostbyaddr_r_proto=''
471 gethostbyname_r_proto=''
473 gethostent_r_proto=''
485 getnetbyaddr_r_proto=''
487 getnetbyname_r_proto=''
501 d_getprotobyname_r=''
502 getprotobyname_r_proto=''
503 d_getprotobynumber_r=''
504 getprotobynumber_r_proto=''
506 getprotoent_r_proto=''
518 getservbyname_r_proto=''
520 getservbyport_r_proto=''
522 getservent_r_proto=''
546 d_libm_lib_version=''
559 d_malloc_good_size=''
601 d_old_pthread_create_joinable=''
602 old_pthread_create_joinable=''
604 d_pthread_attr_setscope=''
643 sethostent_r_proto=''
660 setprotoent_r_proto=''
672 setservent_r_proto=''
705 d_sprintf_returns_strlen=''
720 d_stdio_ptr_lval_nochange_cnt=''
721 d_stdio_ptr_lval_sets_cnt=''
924 d_inc_version_list=''
926 inc_version_list_init=''
945 ignore_versioned_solibs=''
1009 d_perl_otherlibdirs=''
1017 api_versionstring=''
1023 version_patchlevel_string=''
1027 d_nv_preserves_uv=''
1028 d_nv_zero_is_allbits_zero=''
1039 nv_preserves_uv_bits=''
1111 installsitehtml1dir=''
1114 installsitehtml3dir=''
1121 installsiteman1dir=''
1124 installsiteman3dir=''
1129 installsitescript=''
1144 d_stdio_stream_array=''
1145 stdio_stream_array=''
1156 ccflags_uselargefiles=''
1157 ldflags_uselargefiles=''
1158 libswanted_uselargefiles=''
1178 installvendorarch=''
1185 installvendorhtml1dir=''
1187 vendorhtml1direxp=''
1188 installvendorhtml3dir=''
1190 vendorhtml3direxp=''
1196 installvendorman1dir=''
1199 installvendorman3dir=''
1206 installvendorscript=''
1218 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1221 : We must find out about Eunice early
1223 if test -f /etc/unixtovms; then
1224 eunicefix=/etc/unixtovms
1226 if test -f /etc/unixtovms.exe; then
1227 eunicefix=/etc/unixtovms.exe
1230 : Set executable suffix now -- needed before hints available
1231 if test -f "/libs/version.library"; then
1234 elif test -f "/system/gnu_library/bin/ar.pm"; then
1237 elif test -n "$DJGPP"; then
1240 elif test -d c:/. -o -n "$is_os2" ; then
1249 : set useposix=false in your hint file to disable the POSIX extension.
1251 : set useopcode=false in your hint file to disable the Opcode extension.
1253 : Trailing extension. Override this in a hint file, if needed.
1254 : Extra object files, if any, needed on this platform.
1257 : Possible local include directories to search.
1258 : Set locincpth to "" in a hint file to defeat local include searches.
1259 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1260 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1262 : no include file wanted by default
1267 : change the next line if compiling for Xenix/286 on Xenix/386
1268 xlibpth='/usr/lib/386 /lib/386'
1269 : Possible local library directories to search.
1270 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1271 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1273 : general looking path for locating libraries
1274 glibpth="/lib /usr/lib $xlibpth"
1275 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1276 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1277 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1279 : Private path used by Configure to find libraries. Its value
1280 : is prepended to libpth. This variable takes care of special
1281 : machines, like the mips. Usually, it should be empty.
1284 : default library list
1286 : some systems want to use only the non-versioned libso:s
1287 ignore_versioned_solibs=''
1292 ccflags_uselargefiles=''
1293 ldflags_uselargefiles=''
1294 libswanted_uselargefiles=''
1295 : set usemultiplicity on the Configure command line to enable multiplicity.
1296 : set usesocks on the Configure command line to enable socks.
1297 : set usethreads on the Configure command line to enable threads.
1298 usereentrant='undef'
1299 : full support for void wanted by default
1302 : List of libraries we want.
1303 : If anyone needs extra -lxxx, put those in a hint file.
1304 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1305 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1306 : We probably want to search /usr/shlib before most other libraries.
1307 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1308 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1309 glibpth="/usr/shlib $glibpth"
1310 : Do not use vfork unless overridden by a hint file.
1313 : Find the basic shell for Bourne shell scripts
1317 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1320 if test -f "$xxx"; then
1323 : Build up a list and do a single loop so we can 'break' out.
1324 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1325 for xxx in sh bash ksh pdksh ash; do
1327 try="$try ${p}/${xxx}"
1331 if test -f "$xxx"; then
1334 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1337 elif test -f "$xxx.exe"; then
1348 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1350 Usually it's in /bin/sh. How did you even get this far?
1351 Please contact me (Perl Maintainers) at perlbug@perl.org and
1352 we'll try to straighten this all out.
1358 : see if sh knows # comments
1359 if `$sh -c '#' >/dev/null 2>&1`; then
1363 test -f $xcat$_exe || xcat=/usr/bin/cat
1364 if test ! -f $xcat$_exe; then
1365 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1366 if test -f $p/cat$_exe; then
1371 if test ! -f $xcat$_exe; then
1372 echo "Can't find cat anywhere!"
1376 echo "#!$xcat" >sharp
1380 if test -s today; then
1383 echo "#! $xcat" > sharp
1387 if test -s today; then
1395 echo "Your $sh doesn't grok # comments--I will strip them later on."
1398 echo "exec grep -v '^[ ]*#'" >spitshell
1400 $eunicefix spitshell
1401 spitshell=`pwd`/spitshell
1403 echo "I presume that if # doesn't work, #! won't work either!"
1408 : figure out how to guarantee sh startup
1410 '') startsh=${sharpbang}${sh} ;;
1422 : echo "Yup, it does."
1424 echo "Hmm... '$startsh' does not guarantee sh startup..."
1425 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1430 : Save command line options in file UU/cmdline.opt for later use in
1431 : generating config.sh.
1432 cat > cmdline.opt <<EOSH
1433 # Configure command line arguments.
1442 cat >>cmdline.opt <<EOSH
1443 config_arg$argn='$arg'
1445 # Extreme backslashitis: replace each ' by '"'"'
1446 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1449 arg_exp=`cat cmdl.opt`
1450 args_exp="$args_exp$args_sep'$arg_exp'"
1451 argn=`expr $argn + 1`
1454 # args_exp is good for restarting self: eval "set X $args_exp"; shift; $0 "$@"
1455 # used by ./hints/os2.sh
1458 : produce awk script to parse command line options
1459 cat >options.awk <<'EOF'
1461 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1463 len = length(optstr);
1464 for (i = 1; i <= len; i++) {
1465 c = substr(optstr, i, 1);
1466 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1477 if (substr(str, 1, 1) != "-") {
1478 printf("'%s'\n", str);
1482 for (i = 2; i <= len; i++) {
1483 c = substr(str, i, 1);
1485 printf("-%s\n", substr(str, i));
1491 printf("'%s'\n", substr(str, i + 1));
1504 : process the command line options
1505 set X `for arg in "$@"; do echo "X$arg"; done |
1506 sed -e s/X// | awk -f options.awk`
1511 : set up default values
1521 rm -f optdef.sh posthint.sh
1522 cat >optdef.sh <<EOS
1528 while test $# -gt 0; do
1530 -d) shift; fastread=yes;;
1531 -e) shift; alldone=cont;;
1535 if test -r "$1"; then
1538 echo "$me: cannot read config file $1." >&2
1543 -h) shift; error=true;;
1544 -r) shift; reuseval=true;;
1545 -s) shift; silent=true; realsilent=true;;
1546 -E) shift; alldone=exit;;
1547 -K) shift; knowitall=true;;
1548 -O) shift; override=true;;
1549 -S) shift; silent=true; extractsh=true;;
1554 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1555 echo "$me: ignoring -D $1" >&2
1558 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1559 *) echo "$1='define'" >> optdef.sh;;
1566 *=) echo "$1" >> optdef.sh;;
1568 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1569 echo "$me: ignoring -U $1" >&2
1571 *) echo "$1='undef'" >> optdef.sh;;
1582 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1586 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1587 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1593 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1594 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1595 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1596 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1597 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1598 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1604 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1606 echo "$yyy=''" >> posthint.sh ;;
1611 echo "$yyy='$zzz'" >> posthint.sh ;;
1613 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1615 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1620 echo "$yyy=$zzz" >> posthint.sh ;;
1621 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1625 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1628 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1636 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1637 [-U symbol] [-U symbol=] [-A command:symbol...]
1638 -d : use defaults for all answers.
1639 -e : go on without questioning past the production of config.sh.
1640 -f : specify an alternate default configuration file.
1641 -h : print this help message and exit (with an error status).
1642 -r : reuse C symbols value if possible (skips costly nm extraction).
1643 -s : silent mode, only echoes questions and essential information.
1644 -D : define symbol to have some value:
1645 -D symbol symbol gets the value 'define'
1646 -D symbol=value symbol gets the value 'value'
1647 -E : stop at the end of questions, after having produced config.sh.
1648 -K : do not use unless you know what you are doing.
1649 -O : let -D and -U override definitions from loaded configuration file.
1650 -S : perform variable substitutions on all .SH files (can mix with -f)
1651 -U : undefine symbol:
1652 -U symbol symbol gets the value 'undef'
1653 -U symbol= symbol gets completely empty
1654 -A : manipulate symbol after the platform specific hints have been applied:
1655 -A symbol=value append " "value to symbol
1656 -A append:symbol=value append value to symbol
1657 -A define:symbol=value define symbol to have value
1658 -A clear:symbol define symbol to be ''
1659 -A define:symbol define symbol to be 'define'
1660 -A eval:symbol=value define symbol to be eval of value
1661 -A prepend:symbol=value prepend value to symbol
1662 -A undef:symbol define symbol to be 'undef'
1663 -A undef:symbol= define symbol to be ''
1664 -V : print version number and exit (with a zero status).
1671 case "$fastread$alldone" in
1674 case "$extractsh" in
1677 if test ! -t 0; then
1678 echo "Say 'sh Configure', not 'sh <Configure'"
1688 true) exec 1>/dev/null;;
1691 : run the defines and the undefines, if any, but leave the file out there...
1694 : create the posthint manipulation script and leave the file out there...
1699 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1700 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1701 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1702 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1703 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1706 : Some greps do not return status, grrr.
1707 echo "grimblepritz" >grimble
1708 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1710 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1716 : the following should work in any shell
1720 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1721 cat >contains <<'EOSS'
1722 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1727 : Find the path to the source tree
1730 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1734 *) src=`cd ../$src && pwd` ;;
1747 if test -f $rsrc/Configure && \
1748 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1750 : found it, so we are ok.
1753 for src in . .. ../.. ../../.. ../../../..; do
1754 if test -f ../$src/Configure && \
1755 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1766 Sorry, I can't seem to locate the source dir for $package. Please start
1767 Configure with an explicit path -- i.e. /some/path/Configure.
1775 echo "Sources for $package found in \"$src\"." >&4
1779 : script used to extract .SH files with variable substitutions
1780 cat >extract <<'EOS'
1782 echo "Doing variable substitutions on .SH files..."
1783 if test -f MANIFEST; then
1784 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1786 echo "(Looking for .SH files under the source directory.)"
1787 set x `(cd "$src"; find . -name "*.SH" -print)`
1791 0) set x `(cd "$src"; echo *.SH)`; shift;;
1793 if test ! -f "$src/$1"; then
1799 while test $name; do
1800 if test ! -d "$name"; then
1801 create="$name $create";
1802 name=`echo $name | sed -e "s|^[^/]*$||"`;
1803 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1808 for file in $create; do
1817 dir=`expr X$file : 'X\(.*\)/'`
1818 file=`expr X$file : 'X.*/\(.*\)'`
1819 (cd "$dir" && . ./$file)
1829 dir=`expr X$file : 'X\(.*\)/'`
1830 file=`expr X$file : 'X.*/\(.*\)'`
1831 (set x $dir; shift; eval $mkdir_p)
1832 sh <"$src/$dir/$file"
1841 if test -f "$src/config_h.SH"; then
1842 if test ! -f config.h; then
1843 : oops, they left it out of MANIFEST, probably, so do it anyway.
1844 . "$src/config_h.SH"
1849 : extract files and exit if asked to do so
1850 case "$extractsh" in
1852 case "$realsilent" in
1856 case "$config_sh" in
1857 '') config_sh='config.sh';;
1860 echo "Fetching answers from $config_sh..."
1863 test "$override" && . ./optdef.sh
1867 echo "Extraction done."
1872 : Eunice requires " " instead of "", can you believe it
1875 echo "Beginning of configuration questions for $package."
1877 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1879 : first determine how to suppress newline on echo command
1881 echo "Checking echo to see how to suppress newlines..."
1882 (echo "hi there\c" ; echo " ") >.echotmp
1883 if $contains c .echotmp >/dev/null 2>&1 ; then
1894 echo $n "The star should be here-->$c"
1898 : Now test for existence of everything in MANIFEST
1900 if test -f "$rsrc/MANIFEST"; then
1901 echo "First let's make sure your kit is complete. Checking..." >&4
1902 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | (split -l 50 2>/dev/null || split -50)
1905 for filelist in x??; do
1906 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` >/dev/null 2>>"$tmppwd/missing")
1908 if test -s missing; then
1912 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1914 You have the option of continuing the configuration process, despite the
1915 distinct possibility that your kit is damaged, by typing 'y'es. If you
1916 do, don't blame me if something goes wrong. I advise you to type 'n'o
1917 and contact the author (perlbug@perl.org).
1920 echo $n "Continue? [n] $c" >&4
1924 echo "Continuing..." >&4
1928 echo "ABORTING..." >&4
1933 echo "Looks good..."
1936 echo "There is no MANIFEST file. I hope your kit is complete !"
1941 : Find the appropriate value for a newline for tr
1942 if test -n "$DJGPP"; then
1945 if test X"$trnl" = X; then
1946 case "`echo foo|tr '\n' x 2>/dev/null`" in
1950 if test X"$trnl" = X; then
1951 case "`echo foo|tr '\012' x 2>/dev/null`" in
1952 foox) trnl='\012' ;;
1955 if test X"$trnl" = X; then
1956 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
1957 fooxy) trnl='\n\r' ;;
1960 if test X"$trnl" = X; then
1963 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1969 : compute the number of columns on the terminal for proper question formatting
1974 : set up the echo used in my read
1975 myecho="case \"\$xxxm\" in
1976 '') echo $n \"\$rp $c\" >&4;;
1978 '') echo $n \"[\$xxxm] $c\";;
1980 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1982 echo $n \"[\$xxxm] $c\" >&4
1984 echo $n \"\$rp [\$xxxm] $c\" >&4
1990 : now set up to do reads with possible shell escape and default assignment
1996 case "\$fastread" in
1997 yes) case "\$dflt" in
2000 case "\$silent-\$rp" in
2005 *) case "\$silent" in
2006 true) case "\$rp" in
2011 while expr "X\$ans" : "X!" >/dev/null; do
2015 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2023 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2032 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2037 echo "(OK, I'll run with -d after this question.)" >&4
2040 echo "*** Sorry, \$1 not supported yet." >&4
2050 echo "*** Substitution done -- please confirm."
2052 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2057 echo "*** Error -- try again."
2064 case "\$ans\$xxxm\$nostick" in
2076 : create .config dir to save info across Configure sessions
2077 test -d ../.config || mkdir ../.config
2078 cat >../.config/README <<EOF
2079 This directory created by Configure to save information that should
2080 persist across sessions for $package.
2082 You may safely delete it if you wish.
2085 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2087 $define|true|[yY]*) ;;
2088 *) case "$xversion" in
2091 *** WHOA THERE!!! ***
2093 This is an UNSTABLE DEVELOPMENT release.
2094 The version of this $package distribution is $xversion, that is, odd,
2095 (as opposed to even) and that signifies a development release.
2096 If you want a maintenance release, you want an even-numbered version.
2098 Do ***NOT*** install this into production use.
2099 Data corruption and crashes are possible.
2101 It is most seriously suggested that you do not continue any further
2102 unless you want to help in developing and debugging Perl.
2104 If you *still* want to build perl, you can answer 'y' now,
2105 or pass -Dusedevel to Configure.
2108 rp='Do you really want to continue?'
2112 [yY]) echo >&4 "Okay, continuing."
2113 usedevel="$define" ;;
2114 *) echo >&4 "Okay, bye."
2124 case "$versiononly" in
2125 '') versiononly="$define" ;;
2127 case "$installusrbinperl" in
2128 '') installusrbinperl="$undef" ;;
2133 : general instructions
2136 user=`(logname) 2>/dev/null`
2138 '') user=`whoami 2>&1`;;
2140 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2143 rp='Would you like to see the instructions?'
2154 This installation shell script will examine your system and ask you questions
2155 to determine how the perl5 package should be installed. If you get
2156 stuck on a question, you may use a ! shell escape to start a subshell or
2157 execute a command. Many of the questions will have default answers in square
2158 brackets; typing carriage return will give you the default.
2160 On some of the questions which ask for file or directory names you are allowed
2161 to use the ~name construct to specify the login directory belonging to "name",
2162 even if you don't have a shell which knows about that. Questions where this is
2163 allowed will be marked "(~name ok)".
2167 dflt='Type carriage return to continue'
2171 The prompter used in this script allows you to use shell variables and
2172 backticks in your answers. You may use $1, $2, etc... to refer to the words
2173 in the default answer, as if the default line was a set of arguments given to a
2174 script shell. This means you may also use $* to repeat the whole default line,
2175 so you do not have to re-type everything to add something to the default.
2177 Everytime there is a substitution, you will have to confirm. If there is an
2178 error (e.g. an unmatched backtick), the default answer will remain unchanged
2179 and you will be prompted again.
2181 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2182 the questions and use the computed defaults (or the previous answers if there
2183 was already a config.sh file). Type 'Configure -h' for a list of options.
2184 You may also start interactively and then answer '& -d' at any prompt to turn
2185 on the non-interactive behaviour for the remainder of the execution.
2191 Much effort has been expended to ensure that this shell script will run on any
2192 Unix system. If despite that it blows up on yours, your best bet is to edit
2193 Configure and run it again. If you can't run Configure for some reason,
2194 you'll have to generate a config.sh file by hand. Whatever problems you
2195 have, let me (perlbug@perl.org) know how I blew it.
2197 This installation script affects things in two ways:
2199 1) it may do direct variable substitutions on some of the files included
2201 2) it builds a config.h file for inclusion in C programs. You may edit
2202 any of these files as the need arises after running this script.
2204 If you make a mistake on a question, there is no easy way to back up to it
2205 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2206 files. Configure will offer to let you do this before it runs the SH files.
2209 dflt='Type carriage return to continue'
2211 case "$firsttime" in
2212 true) echo $user >>../.config/instruct;;
2216 : find out where common programs are
2218 echo "Locating common programs..." >&4
2231 if test -d \$dir/\$thing; then
2237 for thisthing in \$dir/\$thing; do
2238 : just loop through to pick last item
2240 if test -f \$thisthing; then
2243 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2246 elif test -f \$dir/\$thing.exe; then
2247 if test -n "$DJGPP"; then
2248 echo \$dir/\$thing.exe
2249 elif test "$eunicefix" != ":"; then
2250 : on Eunice apparently
2304 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2305 pth="$pth /lib /usr/lib"
2306 for file in $loclist; do
2310 if test -f "$xxx"; then
2313 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2314 xxx=`./loc $file $file $pth`
2317 '') xxx=`./loc $file $file $pth`;;
2318 *) xxx=`./loc $xxx $xxx $pth`;;
2320 eval $file=$xxx$_exe
2324 echo $file is in $xxx.
2327 echo $file is in $xxx.
2330 echo "I don't know where '$file' is, and my life depends on it." >&4
2331 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2337 echo "Don't worry if any of the following aren't found..."
2339 for file in $trylist; do
2343 if test -f "$xxx"; then
2346 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2347 xxx=`./loc $file $file $pth`
2350 '') xxx=`./loc $file $file $pth`;;
2351 *) xxx=`./loc $xxx $xxx $pth`;;
2353 eval $file=$xxx$_exe
2357 echo $file is in $xxx.
2360 echo $file is in $xxx.
2363 echo "I don't see $file out there, $say."
2370 echo "Substituting grep for egrep."
2377 echo "Substituting cp for ln."
2386 echo "I can't find make or gmake, and my life depends on it." >&4
2387 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2395 *) # We can't have osname yet.
2396 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2397 # Assume that gmake, if found, is definitely GNU make
2398 # and prefer it over the system make.
2399 echo "Substituting gmake for make."
2407 echo "Hopefully test is built into your sh."
2410 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2411 echo "Using the test built into your sh."
2419 echo "Hopefully echo is built into your sh."
2424 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2425 $echo $n "hi there$c" >foo1
2426 echo $n "hi there$c" >foo2
2427 if cmp foo1 foo2 >/dev/null 2>&1; then
2428 echo "They are compatible. In fact, they may be identical."
2435 They are not compatible! You are probably running ksh on a non-USG system.
2436 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2437 have echo built in and we may have to run some Bourne shell scripts. That
2438 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2441 $echo $n "The star should be here-->$c"
2451 cat <<'EOSC' >>trygcc
2456 int main(int argc, char *argv[]) {
2460 if $cc -o try $ccflags $ldflags try.c; then
2463 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2469 case "`$cc -v -c try.c 2>&1`" in
2472 if $test X"$trygcc" = Xyes; then
2473 if gcc -o try -c try.c; then
2475 echo "You seem to have a working gcc, though." >&4
2476 rp="Would you like to use it?"
2478 if $test -f myread; then
2481 if $test -f UU/myread; then
2484 echo "Cannot find myread, sorry. Aborting." >&2
2489 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2490 if $test -f usethreads.cbu; then
2493 *** However, any setting of the C compiler flags (e.g. for thread support)
2494 *** has been lost. It may be necessary to pass -Dcc=gcc to Configure
2495 *** (together with e.g. -Dusethreads).
2511 cat <<'EOSC' >>checkcc
2516 int main(int argc, char *argv[]) {
2520 if $cc -o try $ccflags $ldflags try.c; then
2523 if $test X"$despair" = Xyes; then
2524 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2527 You need to find a working C compiler.
2528 Either (purchase and) install the C compiler supplied by your OS vendor,
2529 or for a free C compiler try http://gcc.gnu.org/
2530 I cannot continue any further, aborting.
2539 : determine whether symbolic links are supported
2542 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2543 echo "Symbolic links are supported." >&4
2546 echo "Symbolic links are NOT supported." >&4
2551 : determine whether symbolic links are supported
2555 echo "Checking how to test for symbolic links..." >&4
2557 if $test "X$issymlink" = X; then
2559 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2560 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2562 if test $? = 0; then
2565 echo "Your builtin 'test -h' may be broken." >&4
2568 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2571 if test -f "$p/$test"; then
2580 echo "Trying external '$test -h'." >&4
2581 issymlink="$test -h"
2582 if $test ! -h sym >/dev/null 2>&1; then
2583 echo "External '$test -h' is broken, too." >&4
2591 if $test "X$issymlink" = X; then
2592 if $test -L sym 2>/dev/null; then
2593 issymlink="$test -L"
2594 echo "The builtin '$test -L' worked." >&4
2597 if $test "X$issymlink" != X; then
2598 echo "You can test for symbolic links with '$issymlink'." >&4
2600 echo "I do not know how you can test for symbolic links." >&4
2604 *) echo "No symbolic links, so not testing for their testing..." >&4
2610 case "$mksymlinks" in
2613 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2616 *) case "$lns:$issymlink" in
2617 *"ln"*" -s:"*"test -"?)
2618 echo "Creating the symbolic links..." >&4
2619 echo "(First creating the subdirectories...)" >&4
2621 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2623 test -z "$directory" && break
2627 if test ! -d t/base; then
2628 echo "Failed to create the subdirectories. Aborting." >&4
2631 echo "(Then creating the symlinks...)" >&4
2632 awk '{print $1}' $src/MANIFEST | while true; do
2634 test -z "$filename" && break
2635 if test -f $filename; then
2636 if $issymlink $filename; then
2640 if test -f $filename; then
2641 echo "$filename already exists, not symlinking."
2643 ln -s $src/$filename $filename
2647 if test ! -f t/base/lex.t; then
2648 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2653 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2662 case "$usecrosscompile" in
2664 $echo "Cross-compiling..."
2667 *-*-gcc) # A cross-compiling gcc, probably.
2668 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2670 # leave out ld, choosing it is more complex
2672 ranlib=$targetarch-ranlib
2673 $echo 'extern int foo;' > try.c
2674 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2676 if $test $# -gt 0; then
2678 incpth="`$echo $incpth|$sed 's/^ //'`"
2679 echo "Guessing incpth '$incpth'." >&4
2681 j="`$echo $i|$sed 's,/include$,/lib,'`"
2682 if $test -d $j; then
2686 libpth="`$echo $libpth|$sed 's/^ //'`"
2687 echo "Guessing libpth '$libpth'." >&4
2692 case "$targetarch" in
2693 '') echo "Targetarch not defined." >&4; croak=y ;;
2694 *) echo "Using targetarch $targetarch." >&4 ;;
2697 '') echo "Incpth not defined." >&4; croak=y ;;
2698 *) echo "Using incpth '$incpth'." >&4 ;;
2701 '') echo "Libpth not defined." >&4; croak=y ;;
2702 *) echo "Using libpth '$libpth'." >&4 ;;
2705 '') for i in $incpth; do
2706 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2708 echo "Guessing usrinc $usrinc." >&4
2713 '') echo "Usrinc not defined." >&4; croak=y ;;
2716 *) echo "Using usrinc $usrinc." >&4 ;;
2718 case "$targethost" in
2719 '') echo "Targethost not defined." >&4; croak=y ;;
2720 *) echo "Using targethost $targethost." >&4
2725 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2728 /*) run=$src/Cross/run
2729 targetmkdir=$src/Cross/mkdir
2731 from=$src/Cross/from
2733 *) pwd=`$test -f ../Configure & cd ..; pwd`
2735 targetmkdir=$pwd/Cross/mkdir
2737 from=$pwd/Cross/from
2740 case "$targetrun" in
2741 '') targetrun=ssh ;;
2746 case "$targetfrom" in
2747 '') targetfrom=scp ;;
2751 from=$from-$targetfrom
2752 case "$targetdir" in
2754 echo "Guessing targetdir $targetdir." >&4
2757 case "$targetuser" in
2759 echo "Guessing targetuser $targetuser." >&4
2762 case "$targetfrom" in
2766 case "$targetrun" in
2778 '') cwd=$targetdir ;;
2782 if $test ! -f \$exe.xok; then
2786 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2789 *) echo "Unknown targetrun '$targetrun'" >&4
2793 case "$targetmkdir" in
2795 cat >$targetmkdir <<EOF
2797 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2799 $chmod a+rx $targetmkdir
2801 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2813 $targetmkdir \`dirname \$f\`
2814 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2817 $targetmkdir $targetdir/\`dirname \$f\`
2818 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2831 $mkdir -p $targetdir/\`dirname \$f\`
2832 $cp \$f $targetdir/\$f || exit 1
2835 $targetmkdir $targetdir/\`dirname \$f\`
2836 $cp \$f $targetdir/\$f || exit 1
2843 *) echo "Unknown targetto '$targetto'" >&4
2847 case "$targetfrom" in
2854 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2859 cp) cat >$from <<EOF
2864 cp $targetdir/\$f . || exit 1
2869 *) echo "Unknown targetfrom '$targetfrom'" >&4
2873 if $test ! -f $run; then
2874 echo "Target 'run' script '$run' not found." >&4
2878 if $test ! -f $to; then
2879 echo "Target 'to' script '$to' not found." >&4
2883 if $test ! -f $from; then
2884 echo "Target 'from' script '$from' not found." >&4
2888 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2892 Using '$run' for remote execution,
2893 and '$from' and '$to'
2894 for remote file transfer.
2900 usecrosscompile='undef'
2905 : see whether [:lower:] and [:upper:] are supported character classes
2907 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2909 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2913 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
2914 # (0xd9 and 0xe2), therefore that is a nice testing point.
2915 if test "X$up" = X -o "X$low" = X; then
2916 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
2922 if test "X$up" = X -o "X$low" = X; then
2923 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
2929 if test "X$up" = X -o "X$low" = X; then
2930 case "`echo RS | od -x 2>/dev/null`" in
2932 echo "Hey, this might be EBCDIC." >&4
2933 if test "X$up" = X -o "X$low" = X; then
2934 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2935 rs) up='[A-IJ-RS-Z]'
2940 if test "X$up" = X -o "X$low" = X; then
2941 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2951 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
2953 echo "Using $up and $low to convert case." >&4
2956 echo "I don't know how to translate letters from upper to lower case." >&4
2957 echo "Your tr is not acting any way I know of." >&4
2961 : set up the translation script tr, must be called with ./tr of course
2965 '[A-Z][a-z]') exec $tr '$up' '$low';;
2966 '[a-z][A-Z]') exec $tr '$low' '$up';;
2973 : Try to determine whether config.sh was made on this system
2974 case "$config_sh" in
2976 myuname=`$uname -a 2>/dev/null`
2977 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2978 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2979 # because the A-Z/a-z are not consecutive.
2980 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2981 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2982 newmyuname="$myuname"
2984 case "$knowitall" in
2986 if test -f ../config.sh; then
2987 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2988 eval "`grep myuname= ../config.sh`"
2990 if test "X$myuname" = "X$newmyuname"; then
2998 : Get old answers from old config file if Configure was run on the
2999 : same system, otherwise use the hints.
3002 if test -f config.sh; then
3004 rp="I see a config.sh file. Shall I use it to set the defaults?"
3007 n*|N*) echo "OK, I'll ignore it."
3008 mv config.sh config.sh.old
3009 myuname="$newmyuname"
3011 *) echo "Fetching default answers from your old config.sh file..." >&4
3019 : Older versions did not always set $sh. Catch re-use of such
3029 if test ! -f config.sh; then
3032 First time through, eh? I have some defaults handy for some systems
3033 that need some extra help getting the Configure answers right:
3036 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3038 : Half the following guesses are probably wrong... If you have better
3039 : tests or hints, please send them to perlbug@perl.org
3040 : The metaconfig authors would also appreciate a copy...
3041 $test -f /irix && osname=irix
3042 $test -f /xenix && osname=sco_xenix
3043 $test -f /dynix && osname=dynix
3044 $test -f /dnix && osname=dnix
3045 $test -f /lynx.os && osname=lynxos
3046 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3047 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3048 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3049 $test -f /bin/mips && /bin/mips && osname=mips
3050 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3051 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3052 $test -d /usr/apollo/bin && osname=apollo
3053 $test -f /etc/saf/_sactab && osname=svr4
3054 $test -d /usr/include/minix && osname=minix
3055 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3056 if $test -d /MachTen -o -d /MachTen_Folder; then
3058 if $test -x /sbin/version; then
3059 osvers=`/sbin/version | $awk '{print $2}' |
3060 $sed -e 's/[A-Za-z]$//'`
3061 elif $test -x /usr/etc/version; then
3062 osvers=`/usr/etc/version | $awk '{print $2}' |
3063 $sed -e 's/[A-Za-z]$//'`
3069 $test -f /sys/posix.dll &&
3070 $test -f /usr/bin/what &&
3071 set X `/usr/bin/what /sys/posix.dll` &&
3072 $test "$3" = UWIN &&
3076 if $test -f $uname; then
3084 umips) osname=umips ;;
3087 [23]100) osname=mips ;;
3088 next*) osname=next ;;
3090 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3091 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3094 elif $test -f /etc/kconfig; then
3096 if test "$lns" = "$ln -s"; then
3098 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3100 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3107 if test -n "$DJGPP"; then
3116 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3118 # oslevel can fail with:
3119 # oslevel: Unable to acquire lock.
3120 *not\ found) osvers="$4"."$3" ;;
3121 '<3240'|'<>3240') osvers=3.2.0 ;;
3122 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3123 '=3250'|'>3250') osvers=3.2.5 ;;
3127 bsd386) osname=bsd386
3130 cygwin*) osname=cygwin
3133 *dc.osx) osname=dcosx
3139 domainos) osname=apollo
3145 dragonfly) osname=dragonfly
3148 dynixptx*) osname=dynixptx
3149 osvers=`echo "$4"|sed 's/^v//'`
3151 freebsd) osname=freebsd
3153 genix) osname=genix ;;
3157 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3173 netbsd*) osname=netbsd
3176 news-os) osvers="$3"
3178 4*) osname=newsos4 ;;
3182 next*) osname=next ;;
3183 nonstop-ux) osname=nonstopux ;;
3184 openbsd) osname=openbsd
3190 POSIX-BC | posix-bc ) osname=posix-bc
3193 powerux | power_ux | powermax_os | powermaxos | \
3194 powerunix | power_unix) osname=powerux
3200 solaris) osname=solaris
3202 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3209 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3213 titanos) osname=titanos
3222 ultrix) osname=ultrix
3225 osf1|mls+) case "$5" in
3228 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3231 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3234 hp*) osname=hp_osf1 ;;
3235 mips) osname=mips_osf1 ;;
3238 # UnixWare 7.1.2 is known as Open UNIX 8
3239 openunix|unixware) osname=svr5
3247 $2) case "$osname" in
3251 : svr4.x or possibly later
3261 if test -f /stand/boot ; then
3262 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3263 if test -n "$INITPROG" -a -f "$INITPROG"; then
3264 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3265 if test -n "$isesix"; then
3273 *) if test -f /etc/systemid; then
3275 set `echo $3 | $sed 's/\./ /g'` $4
3276 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3278 elif $test -f $src/hints/sco_$1_$2.sh; then
3280 elif $test -f $src/hints/sco_$1.sh; then
3285 '') : Still unknown. Probably a generic Sys V.
3294 *) case "$osname" in
3295 '') : Still unknown. Probably a generic BSD.
3303 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3304 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3305 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3308 $rm -f UU/kernel.what
3309 elif test -d c:/. -o -n "$is_os2" ; then
3316 case "$targetarch" in
3319 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3324 : Now look for a hint file osname_osvers, unless one has been
3325 : specified already.
3328 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3329 : Also try without trailing minor version numbers.
3330 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3331 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3332 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3333 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3336 *) case "$osvers" in
3339 *) if $test -f $src/hints/$file.sh ; then
3341 elif $test -f $src/hints/$xfile.sh ; then
3343 elif $test -f $src/hints/$xxfile.sh ; then
3345 elif $test -f $src/hints/$xxxfile.sh ; then
3347 elif $test -f $src/hints/$xxxxfile.sh ; then
3349 elif $test -f "$src/hints/${osname}.sh" ; then
3358 if $test -f Policy.sh ; then
3361 none) dflt="Policy" ;;
3362 *) dflt="Policy $dflt" ;;
3367 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3371 if $test -f Policy.sh ; then
3374 There's also a Policy hint file available, which should make the
3375 site-specific (policy) questions easier to answer.
3382 You may give one or more space-separated answers, or "none" if appropriate.
3383 A well-behaved OS will have no hints, so answering "none" or just "Policy"
3384 is a good thing. DO NOT give a wrong version or a wrong OS.
3388 rp="Which of these apply, if any?"
3391 for file in $tans; do
3392 if $test X$file = XPolicy -a -f Policy.sh; then
3394 $cat Policy.sh >> UU/config.sh
3395 elif $test -f $src/hints/$file.sh; then
3396 . $src/hints/$file.sh
3397 $cat $src/hints/$file.sh >> UU/config.sh
3398 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3401 : Give one chance to correct a possible typo.
3402 echo "$file.sh does not exist"
3404 rp="hint to use instead?"
3406 for file in $ans; do
3407 if $test -f "$src/hints/$file.sh"; then
3408 . $src/hints/$file.sh
3409 $cat $src/hints/$file.sh >> UU/config.sh
3410 elif $test X$ans = X -o X$ans = Xnone ; then
3413 echo "$file.sh does not exist -- ignored."
3420 : Remember our hint file for later.
3421 if $test -f "$src/hints/$file.sh" ; then
3431 echo "Fetching default answers from $config_sh..." >&4
3435 cp $config_sh config.sh 2>/dev/null
3445 test "$override" && . ./optdef.sh
3447 : Restore computed paths
3448 for file in $loclist $trylist; do
3449 eval $file="\$_$file"
3454 Configure uses the operating system name and version to set some defaults.
3455 The default value is probably right if the name rings a bell. Otherwise,
3456 since spelling matters for me, either accept the default or answer "none"
3463 ''|' '|none) dflt=none ;;
3464 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3467 *) dflt="$osname" ;;
3469 rp="Operating system name?"
3473 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3479 ''|' '|none) dflt=none ;;
3480 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3481 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3483 ''|' ') dflt=none ;;
3488 *) dflt="$osvers" ;;
3490 rp="Operating system version?"
3500 : who configured the system
3501 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3504 cf_by=`(logname) 2>/dev/null`
3507 cf_by=`(whoami) 2>/dev/null`
3509 "") cf_by=unknown ;;
3514 : decide how portable to be. Allow command line overrides.
3515 case "$d_portable" in
3517 *) d_portable="$define" ;;
3520 : set up shell script to do ~ expansion
3526 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3529 if $test -f /bin/csh; then
3530 /bin/csh -f -c "glob \$1"
3535 name=\`$expr x\$1 : '..\([^/]*\)'\`
3536 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3537 if $test ! -d "\$dir"; then
3539 echo "\$me: can't locate home directory for: \$name" >&2
3544 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3560 : now set up to get a file name
3564 cat <<'EOSC' >>getfile
3580 : getfile will accept an answer from the comma-separated list
3581 : enclosed in parentheses even if it does not meet other criteria.
3582 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3583 fn=`echo $fn | sed 's/(.*)//'`
3589 loc_file=`expr $fn : '.*:\(.*\)'`
3590 fn=`expr $fn : '\(.*\):.*'`
3598 */*) fullpath=true;;
3607 *e*) exp_file=true;;
3610 *p*) nopath_ok=true;;
3615 *d*) type='Directory';;
3616 *l*) type='Locate';;
3621 Locate) what='File';;
3626 case "$d_portable" in
3634 while test "$type"; do
3639 true) rp="$rp (~name ok)";;
3642 if test -f UU/getfile.ok && \
3643 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3662 value=`UU/filexp $ans`
3665 if test "$ans" != "$value"; then
3666 echo "(That expands to $value on this system.)"
3680 /*) value="$ansexp" ;;
3681 [a-zA-Z]:/*) value="$ansexp" ;;
3686 echo "I shall only accept a full path name, as in /bin/ls." >&4
3687 echo "Use a ! shell escape if you wish to check pathnames." >&4
3690 echo "Please give a full path name, starting with slash." >&4
3693 echo "Note that using ~name is ok provided it expands well." >&4
3706 for fp in $gfpth; do
3707 if test "X$fp" = X.; then
3712 if test -f "$pf"; then
3714 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3716 echo "($value is not a plain file, but that's ok.)"
3719 if test X"$type" = X; then
3726 for fp in $gfpth; do
3727 if test "X$fp" = X.; then
3732 direxp="$fp/$ansexp"
3734 if test -d "$direxp"; then
3742 if test -d "$ansexp"; then
3743 echo "(Looking for $loc_file in directory $value.)"
3744 value="$value/$loc_file"
3745 ansexp="$ansexp/$loc_file"
3747 if test -f "$ansexp"; then
3750 case "$nopath_ok" in
3751 true) case "$value" in
3753 *) echo "Assuming $value will be in people's path."
3769 if test "$fastread" = yes; then
3774 rp="$what $value doesn't exist. Use that name anyway?"
3793 test "X$gfpthkeep" != Xy && gfpth=""
3796 : determine root of directory hierarchy where package will be installed.
3799 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3802 dflt=`echo "$prefix" | sed 's/.$//'`
3810 By default, $package will be installed in $dflt/bin, manual pages
3811 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3812 installation directories. Typically this is something like /usr/local.
3813 If you wish to have binaries under /usr/bin but other parts of the
3814 installation under /usr/local, that's ok: you will be prompted
3815 separately for each of the installation directories, the prefix being
3816 only used to set the defaults.
3820 rp='Installation prefix to use?'
3828 *) oldprefix="$prefix";;
3837 *) afsroot=$afsroot ;;
3843 $define|true) afs=true ;;
3844 $undef|false) afs=false ;;
3845 *) if test -d $afsroot; then
3853 echo "AFS may be running... I'll be extra cautious then..." >&4
3855 echo "AFS does not seem to be running..." >&4
3858 : determine installation prefix for where package is to be installed.
3862 Since you are running AFS, I need to distinguish the directory in which
3863 files will reside from the directory in which they are installed (and from
3864 which they are presumably copied to the former directory by occult means).
3867 case "$installprefix" in
3868 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
3869 *) dflt="$installprefix";;
3874 In some special cases, particularly when building $package for distribution,
3875 it is convenient to distinguish the directory in which files should be
3876 installed from the directory ($prefix) in which they will
3877 eventually reside. For most users, these two directories are the same.
3880 case "$installprefix" in
3882 *) dflt=$installprefix;;
3886 rp='What installation prefix should I use for installing files?'
3888 installprefix="$ans"
3889 installprefixexp="$ansexp"
3891 : Perform the prefixexp/installprefixexp correction if necessary
3892 cat <<EOS >installprefix
3895 cat <<'EOSC' >>installprefix
3896 : Change installation prefix, if necessary.
3897 if $test X"$prefix" != X"$installprefix"; then
3898 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
3900 eval "install${prefixvar}=\"\$${prefixvar}exp\""
3903 chmod +x installprefix
3904 $eunicefix installprefix
3906 : Set variables such as privlib and privlibexp from the output of ./getfile
3907 : performing the prefixexp/installprefixexp correction if necessary.
3908 cat <<EOS >setprefixvar
3911 cat <<'EOSC' >>setprefixvar
3912 eval "${prefixvar}=\"\$ans\""
3913 eval "${prefixvar}exp=\"\$ansexp\""
3916 chmod +x setprefixvar
3917 $eunicefix setprefixvar
3919 : set up the script used to warn in case of inconsistency
3926 echo "*** WHOA THERE!!! ***" >&4
3927 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
3928 rp=" Keep the $hint value?"
3931 y) td=$was; tu=$was;;
3935 : function used to set $1 to $val
3936 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
3938 $define$undef) . ./whoa; eval "$var=\$td";;
3939 $undef$define) . ./whoa; eval "$var=\$tu";;
3940 *) eval "$var=$val";;
3944 $define|true|[yY]*) dflt='y';;
3949 Perl can be built to use the SOCKS proxy protocol library. To do so,
3950 Configure must be run with -Dusesocks. If you use SOCKS you also need
3951 to use the PerlIO abstraction layer, this will be implicitly selected.
3953 If this doesn't make any sense to you, just accept the default '$dflt'.
3955 rp='Build Perl for SOCKS?'
3958 y|Y) val="$define" ;;
3965 $define|true|[yY]*) useperlio="$define";;
3968 case "$useperlio" in
3969 $define|true|[yY]*|'') dflt='y';;
3974 Previous version of $package used the standard IO mechanisms as
3975 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
3976 alternate IO mechanisms via the PerlIO abstraction layer, but the
3977 stdio mechanism is still available if needed. The abstraction layer
3978 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
3979 Using PerlIO with sfio may cause problems with some extension modules.
3981 If this doesn't make any sense to you, just accept the default '$dflt'.
3983 rp='Use the PerlIO abstraction layer?'
3990 echo "Ok, doing things the stdio way."
3999 case "$useperlio" in
4000 $define|true|[yY]*) ;;
4003 You are using the SOCKS proxy protocol library which means that you
4004 should also use the PerlIO layer. You may be headed for trouble.
4013 case "$usethreads" in
4014 $define|true|[yY]*) dflt='y';;
4015 *) # Catch case where user specified ithreads or 5005threads but
4016 # forgot -Dusethreads (A.D. 4/2002)
4017 case "$useithreads$use5005threads" in
4019 case "$useperlio" in
4020 "$define") dflt='y' ;;
4030 Perl can be built to take advantage of threads on some systems.
4031 To do so, Configure can be run with -Dusethreads.
4033 Note that Perl built with threading support runs slightly slower
4034 and uses more memory than plain Perl. The current implementation
4035 is believed to be stable, but it is fairly new, and so should be
4036 treated with caution.
4038 If this doesn't make any sense to you, just accept the default '$dflt'.
4040 rp='Build a threading Perl?'
4043 y|Y) val="$define" ;;
4049 case "$usethreads" in
4053 Since release 5.6, Perl has had two different threading implementations,
4054 the newer interpreter-based version (ithreads) with one interpreter per
4055 thread, and the older 5.005 version (5005threads).
4056 The 5005threads version is effectively unmaintained and will probably be
4057 removed in Perl 5.10, so there should be no need to build a Perl using it
4058 unless needed for backwards compatibility with some existing 5.005threads
4062 : Default to ithreads unless overridden on command line or with
4065 case "$use5005threads" in
4066 $define|true|[yY]*) dflt='n';;
4068 case "$useithreads" in
4069 $undef|false|[nN]*) dflt='n';;
4071 rp='Use the newer interpreter-based ithreads?'
4074 y|Y) val="$define" ;;
4079 : Now set use5005threads to the opposite value.
4080 case "$useithreads" in
4081 $define) val="$undef" ;;
4088 useithreads="$undef"
4089 use5005threads="$undef"
4093 case "$useithreads$use5005threads" in
4097 You cannot have both the ithreads and the 5.005 threads enabled
4098 at the same time. Disabling the 5.005 threads since they are
4099 much less stable than the ithreads.
4102 use5005threads="$undef"
4106 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
4109 *** To build with ithreads you must also use the PerlIO layer.
4110 *** Cannot continue, aborting.
4116 case "$d_oldpthreads" in
4117 '') : Configure tests would be welcome here. For now, assume undef.
4119 *) val="$d_oldpthreads" ;;
4125 : Look for a hint-file generated 'call-back-unit'. If the
4126 : user has specified that a threading perl is to be built,
4127 : we may need to set or change some other defaults.
4128 if $test -f usethreads.cbu; then
4129 echo "Your platform has some specific hints regarding threaded builds, using them..."
4132 case "$usethreads" in
4133 "$define"|true|[yY]*)
4135 (Your platform does not have any specific hints for threaded builds.
4136 Assuming POSIX threads, then.)
4144 Perl can be built so that multiple Perl interpreters can coexist
4145 within the same Perl executable.
4148 case "$useithreads" in
4151 This multiple interpreter support is required for interpreter-based threads.
4155 *) case "$usemultiplicity" in
4156 $define|true|[yY]*) dflt='y';;
4160 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4161 rp='Build Perl for multiplicity?'
4164 y|Y) val="$define" ;;
4173 case "$usemorebits" in
4174 "$define"|true|[yY]*)
4175 use64bitint="$define"
4176 uselongdouble="$define"
4177 usemorebits="$define"
4179 *) usemorebits="$undef"
4183 : make some quick guesses about what we are up against
4185 $echo $n "Hmm... $c"
4195 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
4196 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
4198 echo "Looks kind of like an OSF/1 system, but we'll see..."
4200 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4201 xxx=`./loc addbib blurfl $pth`
4202 if $test -f $xxx; then
4203 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4207 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4208 echo "Looks kind of like an extended USG system, but we'll see..."
4210 echo "Looks kind of like a USG system, but we'll see..."
4214 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4215 echo "Looks kind of like a BSD system, but we'll see..."
4219 echo "Looks kind of like a Version 7 system, but we'll see..."
4222 case "$eunicefix" in
4225 There is, however, a strange, musty smell in the air that reminds me of
4226 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4230 : it so happens the Eunice I know will not run shell scripts in Unix format
4234 echo "Congratulations. You aren't running Eunice."
4238 : Detect OS2. The p_ variable is set above in the Head.U unit.
4239 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4240 : semicolon as a patch separator
4245 I have the feeling something is not exactly right, however...don't tell me...
4246 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4247 (Or you may be running DOS with DJGPP.)
4252 if test -f /xenix; then
4253 echo "Actually, this looks more like a XENIX system..."
4258 echo "It's not Xenix..."
4263 if test -f /venix; then
4264 echo "Actually, this looks more like a VENIX system..."
4271 echo "Nor is it Venix..."
4274 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4275 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4282 rp="Use which C compiler?"
4286 : See if they have not cc but they do have gcc
4288 : Look for a hint-file generated 'call-back-unit'. Now that the
4289 : user has specified the compiler, we may need to set or change some
4291 if $test -f cc.cbu; then
4297 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4303 printf("%s\n", __VERSION__);
4305 printf("%s\n", "1");
4311 if $cc -o try $ccflags $ldflags try.c; then
4312 gccversion=`$run ./try`
4313 case "$gccversion" in
4314 '') echo "You are not using GNU cc." ;;
4315 *) echo "You are using GNU cc $gccversion."
4321 echo "*** WHOA THERE!!! ***" >&4
4322 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4323 case "$knowitall" in
4325 echo " You'd better start hunting for one and let me know about it." >&4
4331 case "$gccversion" in
4332 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4334 case "$gccversion" in
4335 '') gccosandvers='' ;;
4336 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4337 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4339 case "$gccosandvers" in
4340 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4341 $osname$osvers) ;; # looking good
4342 $osname*) cat <<EOM >&4
4344 *** WHOA THERE!!! ***
4346 Your gcc has not been compiled for the exact release of
4347 your operating system ($gccosandvers versus $osname$osvers).
4349 In general it is a good idea to keep gcc synchronized with
4350 the operating system because otherwise serious problems
4351 may ensue when trying to compile software, like Perl.
4353 I'm trying to be optimistic here, though, and will continue.
4354 If later during the configuration and build icky compilation
4355 problems appear (headerfile conflicts being the most common
4356 manifestation), I suggest reinstalling the gcc to match
4357 your operating system release.
4361 *) gccosandvers='' ;; # failed to parse, better be silent
4369 # gcc 3.* complain about adding -Idirectories that they already know about,
4370 # so we will take those off from locincpth.
4371 case "$gccversion" in
4373 echo "main(){}">try.c
4374 for incdir in $locincpth; do
4375 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4376 grep '^c[cp]p*[01]: warning: changing search order '`
4377 if test "X$warn" != X; then
4378 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4384 : What should the include directory be ?
4386 $echo $n "Hmm... $c"
4390 if $test -f /bin/mips && /bin/mips; then
4391 echo "Looks like a MIPS system..."
4392 $cat >usr.c <<'EOCP'
4393 #ifdef SYSTYPE_BSD43
4397 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4398 dflt='/bsd43/usr/include'
4402 mips_type='System V'
4404 $rm -f usr.c usr.out
4405 echo "and you're compiling with the $mips_type compiler and libraries."
4409 echo "Doesn't look like a MIPS system."
4419 case "$xxx_prompt" in
4422 rp='Where are the include files you want to use?'
4430 : see how we invoke the C preprocessor
4432 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4433 cat <<'EOT' >testcpp.c
4439 if test ! -f cppstdin; then
4440 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4441 # AIX cc -E doesn't show the absolute headerfile
4442 # locations but we'll cheat by using the -M flag.
4443 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
4445 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4448 echo "Keeping your $hint cppstdin wrapper."
4451 wrapper=`pwd`/cppstdin
4455 if $test "X$cppstdin" != "X" && \
4456 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4457 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4459 echo "You used to use $cppstdin $cppminus so we'll use that again."
4461 '') echo "But let's see if we can live without a wrapper..." ;;
4463 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4464 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4466 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4469 echo "(However, $cpprun $cpplast does not work, let's see...)"
4477 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4484 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4485 $cc -E <testcpp.c >testcpp.out 2>&1; \
4486 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4487 echo "Yup, it does."
4490 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4491 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4492 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4493 echo "Yup, it does."
4496 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4497 $cc -P <testcpp.c >testcpp.out 2>&1; \
4498 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4499 echo "Yipee, that works!"
4502 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4503 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4504 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4505 echo "At long last!"
4508 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4509 $cpp <testcpp.c >testcpp.out 2>&1; \
4510 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4514 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4515 $cpp - <testcpp.c >testcpp.out 2>&1; \
4516 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4517 echo "Hooray, it works! I was beginning to wonder."
4520 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4521 $wrapper <testcpp.c >testcpp.out 2>&1; \
4522 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4528 rp="No dice. I can't find a C preprocessor. Name one:"
4532 $x_cpp <testcpp.c >testcpp.out 2>&1
4533 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4534 echo "OK, that will do." >&4
4536 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4551 echo "Perhaps can we force $cc -E using a wrapper..."
4552 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4553 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4559 echo "Nope, we'll have to live without it..."
4573 "$wrapper"|'cppstdin') ;;
4574 *) $rm -f $wrapper;;
4576 $rm -f testcpp.c testcpp.out
4578 : Set private lib path
4581 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4586 '') dlist="$loclibpth $plibpth $glibpth";;
4587 *) dlist="$libpth";;
4590 : Now check and see which directories actually exist, avoiding duplicates
4594 if $test -d $xxx; then
4597 *) libpth="$libpth $xxx";;
4603 Some systems have incompatible or broken versions of libraries. Among
4604 the directories listed in the question below, please remove any you
4605 know not to be holding relevant libraries, and add any that are needed.
4606 Say "none" for none.
4617 rp="Directories to use for library searches?"
4624 : compute shared library extension
4627 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4637 On some systems, shared libraries may be available. Answer 'none' if
4638 you want to suppress searching of shared libraries for the remainder
4639 of this configuration.
4642 rp='What is the file extension used for shared libraries?'
4646 : Define several unixisms.
4647 : Hints files or command line option can be used to override them.
4648 : The convoluted testing is in case hints files set either the old
4651 '') case "$exe_ext" in
4653 *) _exe="$exe_ext" ;;
4658 '') case "$lib_ext" in
4665 '') case "$obj_ext" in
4672 '') case "$path_sep" in
4683 : Which makefile gets called first. This is used by make depend.
4684 case "$firstmakefile" in
4685 '') firstmakefile='makefile';;
4689 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4692 case "$uselongdouble" in
4693 $define|true|[yY]*) dflt='y';;
4698 Perl can be built to take advantage of long doubles which
4699 (if available) may give more accuracy and range for floating point numbers.
4701 If this doesn't make any sense to you, just accept the default '$dflt'.
4703 rp='Try to use long doubles if available?'
4706 y|Y) val="$define" ;;
4712 case "$uselongdouble" in
4713 true|[yY]*) uselongdouble="$define" ;;
4716 : Look for a hint-file generated 'call-back-unit'. If the
4717 : user has specified that long doubles should be used,
4718 : we may need to set or change some other defaults.
4719 if $test -f uselongdouble.cbu; then
4720 echo "Your platform has some specific hints regarding long doubles, using them..."
4721 . ./uselongdouble.cbu
4723 case "$uselongdouble" in
4726 (Your platform does not have any specific hints for long doubles.)
4732 : Looking for optional libraries
4734 echo "Checking for optional libraries..." >&4
4739 case "$libswanted" in
4740 '') libswanted='c_s';;
4743 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4749 for thisdir in $libpth $xlibpth; do
4750 test -d $thisdir && libspath="$libspath $thisdir"
4752 for thislib in $libswanted; do
4753 for thisdir in $libspath; do
4755 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4756 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4757 $test -f "$xxx" && eval $libscheck
4758 $test -f "$xxx" && libstyle=shared
4760 if test ! -f "$xxx"; then
4761 xxx=$thisdir/lib$thislib.$so
4762 $test -f "$xxx" && eval $libscheck
4763 $test -f "$xxx" && libstyle=shared
4765 if test ! -f "$xxx"; then
4766 xxx=$thisdir/lib$thislib$_a
4767 $test -f "$xxx" && eval $libscheck
4768 $test -f "$xxx" && libstyle=static
4770 if test ! -f "$xxx"; then
4771 xxx=$thisdir/$thislib$_a
4772 $test -f "$xxx" && eval $libscheck
4773 $test -f "$xxx" && libstyle=static
4775 if test ! -f "$xxx"; then
4776 xxx=$thisdir/lib${thislib}_s$_a
4777 $test -f "$xxx" && eval $libscheck
4778 $test -f "$xxx" && libstyle=static
4779 $test -f "$xxx" && thislib=${thislib}_s
4781 if test ! -f "$xxx"; then
4782 xxx=$thisdir/Slib$thislib$_a
4783 $test -f "$xxx" && eval $libscheck
4784 $test -f "$xxx" && libstyle=static
4786 if $test -f "$xxx"; then
4788 shared) echo "Found -l$thislib (shared)." ;;
4789 static) echo "Found -l$thislib." ;;
4790 *) echo "Found -l$thislib ($libstyle)." ;;
4794 *) dflt="$dflt -l$thislib"
4795 libsfound="$libsfound $xxx"
4797 libsfiles="$libsfiles $yyy"
4798 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4799 case " $libsdirs " in
4801 *) libsdirs="$libsdirs $yyy" ;;
4808 if $test ! -f "$xxx"; then
4809 echo "No -l$thislib."
4820 ' '|'') dflt='none';;
4825 In order to compile $package on your machine, a number of libraries
4826 are usually needed. Include any other special libraries here as well.
4827 Say "none" for none. The default list is almost always right.
4831 rp="What libraries to use?"
4838 : determine optimization, if desired, or use for debug flag also
4840 ' '|$undef) dflt='none';;
4842 *) dflt="$optimize";;
4846 By default, $package compiles with the -O flag to use the optimizer.
4847 Alternately, you might want to use the symbolic debugger, which uses
4848 the -g flag (on traditional Unix systems). Either flag can be
4849 specified here. To use neither flag, specify the word "none".
4852 rp="What optimizer/debugger flag should be used?"
4856 'none') optimize=" ";;
4860 : We will not override a previous value, but we might want to
4861 : augment a hint file
4863 default|recommended)
4864 case "$gccversion" in
4865 1*) dflt='-fpcc-struct-return' ;;
4868 *-g*) dflt="$dflt -DDEBUGGING";;
4870 case "$gccversion" in
4871 2*) if test -d /etc/conf/kconfig.d &&
4872 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4874 # Interactive Systems (ISC) POSIX mode.
4879 case "$gccversion" in
4883 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
4884 echo 'int main(void) { return 0; }' > gcctest.c
4885 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
4886 echo "Yes, it does." 2>&1
4889 echo "Leaving current flags $ccflags alone." 2>&1
4891 *) dflt="$dflt -fno-strict-aliasing" ;;
4894 echo "Nope, it doesn't, but that's ok." 2>&1
4898 # For gcc, adding -pipe speeds up compilations for some, but apparently
4899 # some assemblers can't read from stdin. (It also slows down compilations
4900 # in other cases, but those are apparently rarer these days.) AD 5/2004.
4901 case "$gccversion" in
4903 echo "Checking if your compiler accepts -pipe" 2>&1
4904 echo 'int main(void) { return 0; }' > gcctest.c
4905 if $cc -pipe -o gcctest gcctest.c; then
4906 echo "Yes, it does." 2>&1
4909 echo "Leaving current flags $ccflags alone." 2>&1
4911 *) dflt="$dflt -pipe" ;;
4914 echo "Nope, it doesn't, but that's ok." 2>&1
4917 echo "Checking if your compiler accepts -Wdeclaration-after-statement" 2>&1
4918 echo 'int main(void) { return 0; }' > gcctest.c
4919 if $cc -Wdeclaration-after-statement -o gcctest gcctest.c; then
4920 echo "Yes, it does." 2>&1
4922 *-Wdeclaration-after-statement*)
4923 echo "Leaving current flags $ccflags alone." 2>&1
4925 *) dflt="$dflt -Wdeclaration-after-statement" ;;
4928 echo "Nope, it doesn't, but that's ok." 2>&1
4935 case "$mips_type" in
4936 *BSD*|'') inclwanted="$locincpth $usrinc";;
4937 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4939 for thisincl in $inclwanted; do
4940 if $test -d $thisincl; then
4941 if $test x$thisincl != x$usrinc; then
4943 *" -I$thisincl "*);;
4944 *) dflt="$dflt -I$thisincl ";;
4950 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4952 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4960 *) dflt="$dflt -D$2";;
4964 set signal.h LANGUAGE_C; eval $inctest
4968 ccflags="$ccflags -DSOCKS"
4973 default|recommended) dflt="$ccflags $dflt" ;;
4974 *) dflt="$ccflags";;
4983 Your C compiler may want other flags. For this question you should include
4984 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4985 but you should NOT include libraries or ld flags like -lwhatever. If you
4986 want $package to honor its debug switch, you should include -DDEBUGGING here.
4987 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4989 To use no flags, specify the word "none".
4995 rp="Any additional cc flags?"
5002 : the following weeds options from ccflags that are of no interest to cpp
5004 '') cppflags="$ccflags" ;;
5005 *) cppflags="$cppflags $ccflags" ;;
5007 case "$gccversion" in
5008 1*) cppflags="$cppflags -D__GNUC__"
5010 case "$mips_type" in
5012 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5018 echo "Let me guess what the preprocessor flags are..." >&4
5032 *) ftry="$previous $flag";;
5034 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5035 >cpp1.out 2>/dev/null && \
5036 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5037 >cpp2.out 2>/dev/null && \
5038 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5039 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5041 cppflags="$cppflags $ftry"
5051 *-*) echo "They appear to be: $cppflags";;
5053 $rm -f cpp.c cpp?.out
5057 : flags used in final linking phase
5059 '') if ./venix; then
5065 *-posix*) dflt="$dflt -posix" ;;
5068 *) dflt="$ldflags";;
5071 : Try to guess additional flags to pick up local libraries.
5072 for thislibdir in $libpth; do
5073 case " $loclibpth " in
5076 *"-L$thislibdir "*) ;;
5077 *) dflt="$dflt -L$thislibdir" ;;
5089 Your C linker may need flags. For this question you should
5090 include -L/whatever and any other flags used by the C linker, but you
5091 should NOT include libraries like -lwhatever.
5093 Make sure you include the appropriate -L/path flags if your C linker
5094 does not normally search all of the directories you specified above,
5097 To use no flags, specify the word "none".
5101 rp="Any additional ld flags (NOT including libraries)?"
5107 rmlist="$rmlist pdp11"
5111 echo "Checking your choice of C compiler and flags for coherency..." >&4
5112 $cat > try.c <<'EOF'
5114 int main() { printf("Ok\n"); return(0); }
5116 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5118 $cat >try.msg <<'EOM'
5119 I've tried to compile and run the following simple program:
5122 $cat try.c >> try.msg
5124 $cat >> try.msg <<EOM
5131 and I got the following output:
5135 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5136 if $sh -c "$run ./try" >>try.msg 2>&1; then
5140 *) echo 'The program compiled OK, but produced no output.' >> try.msg
5143 cat >> try.msg <<'EOQS'
5144 If $libs contains -lsfio, and sfio is mis-configured, then it
5145 sometimes (apparently) runs and exits with a 0 status, but with no
5146 output! It may have to do with sfio's use of _exit vs. exit.
5149 rp="You have a big problem. Shall I abort Configure"
5156 echo "The program compiled OK, but exited with status $?." >>try.msg
5157 rp="You have a problem. Shall I abort Configure"
5161 echo "I can't compile the test program." >>try.msg
5162 rp="You have a BIG problem. Shall I abort Configure"
5168 case "$knowitall" in
5170 echo "(The supplied flags or libraries might be incorrect.)"
5178 *) echo "Ok. Stopping Configure." >&4
5183 n) echo "OK, that should do.";;
5185 $rm -f try try.* core
5187 : define a shorthand compile call
5191 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5192 : define a shorthand compile call for compilations that should be ok.
5196 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5198 : determine filename position in cpp output
5200 echo "Computing filename position in cpp output for #include directives..." >&4
5202 vos) testaccess=-e ;;
5205 echo '#include <stdio.h>' > foo.c
5208 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5209 $grep '^[ ]*#.*stdio\.h' | \
5210 while read cline; do
5213 while $test \$# -gt 0; do
5214 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5219 pos=\`expr \$pos + 1\`
5231 *) pos="${fieldn}th";;
5233 echo "Your cpp writes the filename in the $pos field of the line."
5236 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5237 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5240 : locate header file
5245 for usrincdir in $usrinc
5247 if test -f \$usrincdir/\$wanted; then
5248 echo "\$usrincdir/\$wanted"
5252 awkprg='{ print \$$fieldn }'
5253 echo "#include <\$wanted>" > foo\$\$.c
5254 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5255 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5256 while read cline; do
5257 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5259 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5260 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5265 # status = 0: grep returned 0 lines, case statement not executed
5266 # status = 1: headerfile found
5267 # status = 2: while loop executed, no headerfile found
5271 if test \$status -eq 1; then
5278 : define an alternate in-header-list? function
5279 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5280 cont=true; xxf="echo \"<\$1> found.\" >&4";
5281 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5282 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5284 case $# in 4) instead=instead;; *) instead="at last";; esac;
5285 while $test "$cont"; do
5287 var=$2; eval "was=\$$2";
5288 if $test "$xxx" && $test -r "$xxx";
5290 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5293 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5294 set $yyy; shift; shift; yyy=$@;
5295 case $# in 0) cont="";;
5296 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5297 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5298 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5299 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5303 do set $yyy; var=$2; eval "was=\$$2";
5304 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5305 set $yyy; shift; shift; yyy=$@;
5308 : see if stdlib is available
5309 set stdlib.h i_stdlib
5312 : check for lengths of integral types
5316 echo "Checking to see how big your integers are..." >&4
5325 printf("intsize=%d;\n", (int)sizeof(int));
5326 printf("longsize=%d;\n", (int)sizeof(long));
5327 printf("shortsize=%d;\n", (int)sizeof(short));
5332 if eval $compile_ok && $run ./try > /dev/null; then
5334 echo "Your integers are $intsize bytes long."
5335 echo "Your long integers are $longsize bytes long."
5336 echo "Your short integers are $shortsize bytes long."
5340 Help! I can't compile and run the intsize test program: please enlighten me!
5341 (This is probably a misconfiguration in your system or libraries, and
5342 you really ought to fix it. Still, I'll try anyway.)
5346 rp="What is the size of an integer (in bytes)?"
5350 rp="What is the size of a long integer (in bytes)?"
5354 rp="What is the size of a short integer (in bytes)?"
5362 : check for long long
5364 echo "Checking to see if you have long long..." >&4
5365 echo 'int main() { long long x = 7; return 0; }' > try.c
5367 if eval $compile; then
5369 echo "You have long long."
5372 echo "You do not have long long."
5378 : check for length of long long
5379 case "${d_longlong}${longlongsize}" in
5382 echo "Checking to see how big your long longs are..." >&4
5383 $cat >try.c <<'EOCP'
5387 printf("%d\n", (int)sizeof(long long));
5392 if eval $compile_ok; then
5393 longlongsize=`$run ./try`
5394 echo "Your long longs are $longlongsize bytes long."
5398 echo "(I can't seem to compile the test program. Guessing...)"
5399 rp="What is the size of a long long (in bytes)?"
5403 if $test "X$longsize" = "X$longlongsize"; then
5404 echo "(That isn't any different from an ordinary long.)"
5410 : see if inttypes.h is available
5411 : we want a real compile instead of Inhdr because some systems
5412 : have an inttypes.h which includes non-existent headers
5415 #include <inttypes.h>
5417 static int32_t foo32 = 0x12345678;
5421 if eval $compile; then
5422 echo "<inttypes.h> found." >&4
5425 echo "<inttypes.h> NOT found." >&4
5434 echo "Checking to see if you have int64_t..." >&4
5436 #include <sys/types.h>
5437 #$i_inttypes I_INTTYPES
5439 #include <inttypes.h>
5441 int main() { int64_t x = 7; }
5444 if eval $compile; then
5446 echo "You have int64_t."
5449 echo "You do not have int64_t."
5457 echo "Checking which 64-bit integer type we could use..." >&4
5463 val='"unsigned int"'
5468 *) case "$longsize" in
5472 val='"unsigned long"'
5477 *) case "$d_longlong:$longlongsize" in
5482 val='"unsigned long long"'
5487 *) case "$d_int64_t" in
5506 '') echo "Alas, no 64-bit integer types in sight." >&4
5509 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5515 case "$uselonglong" in
5516 "$define"|true|[yY]*)
5519 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5521 use64bitint="$define"
5524 case "$use64bits" in
5525 "$define"|true|[yY]*)
5528 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5530 use64bitint="$define"
5533 case "$use64bitints" in
5534 "$define"|true|[yY]*)
5537 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5539 use64bitint="$define"
5542 case "$use64bitsint" in
5543 "$define"|true|[yY]*)
5546 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5548 use64bitint="$define"
5551 case "$uselonglongs" in
5552 "$define"|true|[yY]*)
5555 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5557 use64bitint="$define"
5560 case "$use64bitsall" in
5561 "$define"|true|[yY]*)
5564 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5566 use64bitall="$define"
5571 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5573 case "$use64bitall" in
5574 "$define"|true|[yY]*) use64bitint="$define" ;;
5580 You have natively 64-bit long integers.
5584 *) case "$use64bitint" in
5585 "$define"|true|[yY]*) dflt='y';;
5594 Perl can be built to take advantage of 64-bit integer types
5595 on some systems. To do so, Configure can be run with -Duse64bitint.
5596 Choosing this option will most probably introduce binary incompatibilities.
5598 If this doesn't make any sense to you, just accept the default '$dflt'.
5599 (The default has been chosen based on your configuration.)
5601 rp='Try to use 64-bit integers, if available?'
5604 [yY]*) val="$define" ;;
5612 case "$use64bitall" in
5613 "$define"|true|[yY]*) dflt='y' ;;
5614 *) case "$longsize" in
5622 You may also choose to try maximal 64-bitness. It means using as much
5623 64-bitness as possible on the platform. This in turn means even more
5624 binary incompatibilities. On the other hand, your platform may not
5625 have any more 64-bitness available than what you already have chosen.
5627 If this doesn't make any sense to you, just accept the default '$dflt'.
5628 (The default has been chosen based on your configuration.)
5630 rp='Try to use maximal 64-bit support, if available?'
5633 [yY]*) val="$define" ;;
5638 case "$use64bitall" in
5640 case "$use64bitint" in
5644 Since you have chosen a maximally 64-bit build, I'm also turning on
5645 the use of 64-bit integers.
5647 use64bitint="$define" ;;
5652 : Look for a hint-file generated 'call-back-unit'. If the
5653 : user has specified that a 64-bit perl is to be built,
5654 : we may need to set or change some other defaults.
5655 if $test -f use64bitint.cbu; then
5656 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5659 case "$use64bitint" in
5660 "$define"|true|[yY]*)
5662 4) case "$archname64" in
5663 '') archname64=64int ;;
5670 : Look for a hint-file generated 'call-back-unit'. If the
5671 : user has specified that a maximally 64-bit perl is to be built,
5672 : we may need to set or change some other defaults.
5673 if $test -f use64bitall.cbu; then
5674 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5677 case "$use64bitall" in
5678 "$define"|true|[yY]*)
5680 4) case "$archname64" in
5681 ''|64int) archname64=64all ;;
5688 case "$d_quad:$use64bitint" in
5692 *** You have chosen to use 64-bit integers,
5693 *** but none can be found.
5694 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5695 *** Cannot continue, aborting.
5702 : check for length of double
5704 case "$doublesize" in
5706 echo "Checking to see how big your double precision numbers are..." >&4
5715 printf("%d\n", (int)sizeof(double));
5720 if eval $compile_ok; then
5721 doublesize=`$run ./try`
5722 echo "Your double is $doublesize bytes long."
5725 echo "(I can't seem to compile the test program. Guessing...)"
5726 rp="What is the size of a double precision number (in bytes)?"
5734 : check for long doubles
5736 echo "Checking to see if you have long double..." >&4
5737 echo 'int main() { long double x = 7.0; }' > try.c
5739 if eval $compile; then
5741 echo "You have long double."
5744 echo "You do not have long double."
5750 : check for length of long double
5751 case "${d_longdbl}${longdblsize}" in
5754 echo "Checking to see how big your long doubles are..." >&4
5755 $cat >try.c <<'EOCP'
5759 printf("%d\n", sizeof(long double));
5764 if eval $compile; then
5765 longdblsize=`$run ./try`
5766 echo "Your long doubles are $longdblsize bytes long."
5770 echo "(I can't seem to compile the test program. Guessing...)" >&4
5771 rp="What is the size of a long double (in bytes)?"
5775 if $test "X$doublesize" = "X$longdblsize"; then
5776 echo "That isn't any different from an ordinary double."
5777 echo "I'll keep your setting anyway, but you may see some"
5778 echo "harmless compilation warnings."
5784 : determine the architecture name
5786 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5787 tarch=`arch`"-$osname"
5788 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5789 if uname -m > tmparch 2>&1 ; then
5790 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5791 -e 's/$/'"-$osname/" tmparch`
5799 case "$myarchname" in
5802 echo "(Your architecture name used to be $myarchname.)"
5806 case "$targetarch" in
5808 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
5813 *) dflt="$archname";;
5815 rp='What is your architecture name'
5818 case "$usethreads" in
5820 echo "Threads selected." >&4
5822 *-thread*) echo "...and architecture name already has -thread." >&4
5824 *) archname="$archname-thread"
5825 echo "...setting architecture name to $archname." >&4
5830 case "$usemultiplicity" in
5832 echo "Multiplicity selected." >&4
5834 *-multi*) echo "...and architecture name already has -multi." >&4
5836 *) archname="$archname-multi"
5837 echo "...setting architecture name to $archname." >&4
5842 case "$use64bitint$use64bitall" in
5844 case "$archname64" in
5846 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
5849 case "$use64bitint" in
5850 "$define") echo "64 bit integers selected." >&4 ;;
5852 case "$use64bitall" in
5853 "$define") echo "Maximal 64 bitness selected." >&4 ;;
5856 *-$archname64*) echo "...and architecture name already has $archname64." >&4
5858 *) archname="$archname-$archname64"
5859 echo "...setting architecture name to $archname." >&4
5865 case "$uselongdouble" in
5867 echo "Long doubles selected." >&4
5868 case "$longdblsize" in
5870 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
5874 *-ld*) echo "...and architecture name already has -ld." >&4
5876 *) archname="$archname-ld"
5877 echo "...setting architecture name to $archname." >&4
5884 case "$useperlio" in
5886 echo "Perlio selected." >&4
5889 echo "Perlio not selected, using stdio." >&4
5891 *-stdio*) echo "...and architecture name already has -stdio." >&4
5893 *) archname="$archname-stdio"
5894 echo "...setting architecture name to $archname." >&4
5899 if $test -f archname.cbu; then
5900 echo "Your platform has some specific hints for architecture name, using them..."
5904 : set the prefixit variable, to compute a suitable default value
5905 prefixit='case "$3" in
5907 case "$oldprefix" in
5908 "") eval "$1=\"\$$2\"";;
5915 ""|" ") eval "$1=\"\$$2\"";;
5921 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
5923 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
5924 /*-$oldprefix/*|\~*-$oldprefix/*)
5925 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
5926 *) eval "$1=\"\$$2\"";;
5930 : get the patchlevel
5932 echo "Getting the current patchlevel..." >&4
5933 if $test -r $rsrc/patchlevel.h;then
5934 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
5935 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
5936 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5937 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
5938 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
5939 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5940 perl_patchlevel=`egrep 'define PERL_PATCHNUM [0-9][0-9]|,"MAINT[0-9][0-9]*"' $rsrc/patchlevel.h|sed 's/[^0-9]//g'`
5949 $echo "(You do not have patchlevel.h. Eek.)"
5951 if $test -r $rsrc/.patch ; then
5952 if $test "X$perl_patchlevel" = "X" || $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
5953 perl_patchlevel=`cat $rsrc/.patch`
5956 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
5957 version_patchlevel_string="version $patchlevel subversion $subversion"
5958 case "$perl_patchlevel" in
5960 *) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;;
5963 $echo "(You have $package $version_patchlevel_string.)"
5967 : XXX Should be a Configure test for double-dots in filenames.
5968 version=`echo $revision $patchlevel $subversion | \
5969 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
5970 api_versionstring=`echo $api_revision $api_version $api_subversion | \
5971 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
5974 version=`echo $revision $patchlevel $subversion | \
5975 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
5976 api_versionstring=`echo $api_revision $api_version $api_subversion | \
5977 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
5980 : Special case the 5.005_xx maintenance series, which used 5.005
5981 : without any subversion label as a subdirectory in $sitelib
5982 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
5983 api_versionstring='5.005'
5986 : determine installation style
5987 : For now, try to deduce it from prefix unless it is already set.
5988 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
5989 case "$installstyle" in
5990 '') case "$prefix" in
5991 *perl*) dflt='lib';;
5992 *) dflt='lib/perl5' ;;
5995 *) dflt="$installstyle" ;;
5997 : Probably not worth prompting for this since we prompt for all
5998 : the directories individually, and the prompt would be too long and
6002 : determine where private library files go
6003 : Usual default is /usr/local/lib/perl5/$version.
6004 : Also allow things like /opt/perl/lib/$version, since
6005 : /opt/perl/lib/perl5... would be redundant.
6006 : The default "style" setting is made in installstyle.U
6007 case "$installstyle" in
6008 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6009 *) set dflt privlib lib/$version ;;
6014 There are some auxiliary files for $package that need to be put into a
6015 private library directory that is accessible by everyone.
6019 rp='Pathname where the private library files will reside?'
6024 : set the prefixup variable, to restore leading tilda escape
6025 prefixup='case "$prefixexp" in
6027 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6030 : determine where public architecture dependent libraries go
6033 : privlib default is /usr/local/lib/$package/$version
6034 : archlib default is /usr/local/lib/$package/$version/$archname
6035 : privlib may have an optional trailing /share.
6036 tdflt=`echo $privlib | $sed 's,/share$,,'`
6037 tdflt=$tdflt/$archname
6046 $spackage contains architecture-dependent library files. If you are
6047 sharing libraries in a heterogeneous environment, you might store
6048 these files in a separate location. Otherwise, you can just include
6049 them with the rest of the public library files.
6053 rp='Where do you want to put the public architecture-dependent libraries?'
6057 if $test X"$archlib" = X"$privlib"; then
6063 : see if setuid scripts can be secure
6066 Some kernels have a bug that prevents setuid #! scripts from being
6067 secure. Some sites have disabled setuid #! scripts because of this.
6069 First let's decide if your kernel supports secure setuid #! scripts.
6070 (If setuid #! scripts would be secure but have been disabled anyway,
6071 don't say that they are secure if asked.)
6076 if $test -d /dev/fd; then
6077 echo "#!$ls" >reflect
6078 chmod +x,u+s reflect
6079 ./reflect >flect 2>&1
6080 if $contains "/dev/fd" flect >/dev/null; then
6081 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6085 If you are not sure if they are secure, I can check but I'll need a
6086 username and password different from the one you are using right now.
6087 If you don't have such a username or don't want me to test, simply
6091 rp='Other username to test security of setuid scripts with?'
6096 case "$d_suidsafe" in
6097 '') echo "I'll assume setuid scripts are *not* secure." >&4
6100 echo "Well, the $hint value is *not* secure." >&4
6102 *) echo "Well, the $hint value *is* secure." >&4
6107 $rm -f reflect flect
6108 echo "#!$ls" >reflect
6109 chmod +x,u+s reflect
6112 echo '"su" will (probably) prompt you for '"$ans's password."
6113 su $ans -c './reflect >flect'
6114 if $contains "/dev/fd" flect >/dev/null; then
6115 echo "Okay, it looks like setuid scripts are secure." >&4
6118 echo "I don't think setuid scripts are secure." >&4
6123 rp='Does your kernel have *secure* setuid scripts?'
6126 [yY]*) val="$define";;
6131 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6132 echo "(That's for file descriptors, not floppy disks.)"
6138 $rm -f reflect flect
6140 : now see if they want to do setuid emulation
6143 case "$d_suidsafe" in
6146 echo "No need to emulate SUID scripts since they are secure here." >&4
6150 Some systems have disabled setuid scripts, especially systems where
6151 setuid scripts cannot be secure. On systems where setuid scripts have
6152 been disabled, the setuid/setgid bits on scripts are currently
6153 useless. It is possible for $package to detect those bits and emulate
6154 setuid/setgid in a secure fashion. This emulation will only work if
6155 setuid scripts have been disabled in your kernel.
6159 "$define") dflt=y ;;
6162 rp="Do you want to do setuid/setgid emulation?"
6165 [yY]*) val="$define";;
6173 : determine where public executables go
6178 rp='Pathname where the public executables will reside?'
6180 if $test "X$ansexp" != "X$binexp"; then
6184 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6187 case "$userelocatableinc" in
6188 $define|true|[yY]*) dflt='y' ;;
6193 Would you like to build Perl so that the installation is relocatable, so that
6194 library paths in @INC are determined relative to the path of the perl binary?
6195 This is not advised for system Perl installs, or if you need to run setid
6196 scripts or scripts under taint mode.
6198 If this doesn't make any sense to you, just accept the default '$dflt'.
6200 rp='Use relocatable @INC?'
6203 y|Y) val="$define" ;;
6206 set userelocatableinc
6209 : Default prefix is now "up one level from where the binaries are"
6210 case "$userelocatableinc" in
6212 initialinstalllocation="$binexp"
6217 installprefixexp=".../.."
6221 : Find perl5.005 or later.
6222 echo "Looking for a previously installed perl5.005 or later... "
6224 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6225 : Check if this perl is recent and can load a simple module
6226 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6229 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6239 '') echo "None found. That's ok.";;
6240 *) echo "Using $perl5." ;;
6245 After $package is installed, you may wish to install various
6246 add-on modules and utilities. Typically, these add-ons will
6247 be installed under $prefix with the rest
6248 of this package. However, you may wish to install such add-ons
6249 elsewhere under a different prefix.
6251 If you do not wish to put everything under a single prefix, that's
6252 ok. You will be prompted for the individual locations; this siteprefix
6253 is only used to suggest the defaults.
6255 The default should be fine for most people.
6259 rp='Installation prefix to use for add-on modules and utilities?'
6260 : XXX Here might be another good place for an installstyle setting.
6261 case "$siteprefix" in
6263 *) dflt=$siteprefix ;;
6266 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6268 case "$siteprefix" in
6272 *) oldsiteprefix="$prefix";;
6277 siteprefixexp="$ansexp"
6279 : determine where site specific libraries go.
6280 : Usual default is /usr/local/lib/perl5/site_perl/$version
6281 : The default "style" setting is made in installstyle.U
6282 : XXX No longer works with Prefixit stuff.
6283 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6285 '') case "$installstyle" in
6286 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6287 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6295 The installation process will create a directory for
6296 site-specific extensions and modules. Most users find it convenient
6297 to place all site-specific files in this directory rather than in the
6298 main distribution directory.
6302 rp='Pathname for the site-specific library files?'
6306 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6308 : Determine list of previous versions to include in @INC
6309 $cat > getverlist <<EOPL
6312 \$api_versionstring = "$api_versionstring";
6313 \$version = "$version";
6314 \$stem = "$sitelib_stem";
6315 \$archname = "$archname";
6317 $cat >> getverlist <<'EOPL'
6318 # Can't have leading @ because metaconfig interprets it as a command!
6319 ;@inc_version_list=();
6320 # XXX Redo to do opendir/readdir?
6323 ;@candidates = glob("5.*");
6329 # XXX ToDo: These comparisons must be reworked when two-digit
6330 # subversions come along, so that 5.7.10 compares as greater than
6331 # 5.7.3! By that time, hope that 5.6.x is sufficiently
6332 # widespread that we can use the built-in version vectors rather
6333 # than reinventing them here. For 5.6.0, however, we must
6334 # assume this script will likely be run by 5.005_0x. --AD 1/2000.
6335 foreach $d (@candidates) {
6336 if ($d lt $version) {
6337 if ($d ge $api_versionstring) {
6338 unshift(@inc_version_list, grep { -d } "$d/$archname", $d);
6340 elsif ($d ge "5.005") {
6341 unshift(@inc_version_list, grep { -d } $d);
6345 # Skip newer version. I.e. don't look in
6346 # 5.7.0 if we're installing 5.6.1.
6350 if (@inc_version_list) {
6351 print join(' ', @inc_version_list);
6354 # Blank space to preserve value for next Configure run.
6359 case "$inc_version_list" in
6360 '') if test -x "$perl5$exe_ext"; then
6361 dflt=`$perl5 getverlist`
6366 $undef) dflt='none' ;;
6367 *) eval dflt=\"$inc_version_list\" ;;
6370 ''|' ') dflt=none ;;
6377 In order to ease the process of upgrading, this version of perl
6378 can be configured to use modules built and installed with earlier
6379 versions of perl that were installed under $prefix. Specify here
6380 the list of earlier versions that this version of perl should check.
6381 If Configure detected no earlier versions of perl installed under
6382 $prefix, then the list will be empty. Answer 'none' to tell perl
6383 to not search earlier versions.
6385 The default should almost always be sensible, so if you're not sure,
6386 just accept the default.
6389 rp='List of earlier versions to include in @INC?'
6392 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6393 *) inc_version_list="$ans" ;;
6395 case "$inc_version_list" in
6397 inc_version_list_init='0'
6398 d_inc_version_list="$undef"
6400 *) inc_version_list_init=`echo $inc_version_list |
6401 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6402 d_inc_version_list="$define"
6407 : see if this is a malloc.h system
6408 : we want a real compile instead of Inhdr because some systems have a
6409 : malloc.h that just gives a compile error saying to use stdlib.h instead
6414 int main () { return 0; }
6417 if eval $compile; then
6418 echo "<malloc.h> found." >&4
6421 echo "<malloc.h> NOT found." >&4
6428 : check for void type
6430 echo "Checking to see how well your C compiler groks the void type..." >&4
6431 case "$voidflags" in
6443 extern void moo(); /* function returning void */
6444 void (*goo)(); /* ptr to func returning void */
6446 void *hue; /* generic ptr */
6459 int main() { sub(); }
6461 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6462 voidflags=$defvoidused
6463 echo "Good. It appears to support void to the level $package wants.">&4
6464 if $contains warning .out >/dev/null 2>&1; then
6465 echo "However, you might get some warnings that look like this:"
6469 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6470 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6471 echo "It supports 1..."
6472 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6473 echo "It also supports 2..."
6474 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6476 echo "And it supports 4 but not 8 definitely."
6478 echo "It doesn't support 4..."
6479 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6481 echo "But it supports 8."
6484 echo "Neither does it support 8."
6488 echo "It does not support 2..."
6489 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6491 echo "But it supports 4 and 8."
6493 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6495 echo "And it supports 4 but has not heard about 8."
6497 echo "However it supports 8 but not 4."
6502 echo "There is no support at all for void."
6507 case "$voidflags" in
6510 Support flag bits are:
6511 1: basic void declarations.
6512 2: arrays of pointers to functions returning void.
6513 4: operations between pointers to and addresses of void functions.
6514 8: generic void pointers.
6517 rp="Your void support flags add up to what?"
6524 : check for length of pointer
6528 echo "Checking to see how big your pointers are..." >&4
6529 if test "$voidflags" -gt 7; then
6530 echo '#define VOID_PTR char *' > try.c
6532 echo '#define VOID_PTR void *' > try.c
6542 printf("%d\n", (int)sizeof(VOID_PTR));
6547 if eval $compile_ok; then
6548 ptrsize=`$run ./try`
6549 echo "Your pointers are $ptrsize bytes long."
6552 echo "(I can't seem to compile the test program. Guessing...)" >&4
6553 rp="What is the size of a pointer (in bytes)?"
6560 case "$use64bitall" in
6561 "$define"|true|[yY]*)
6565 *** You have chosen a maximally 64-bit build,
6566 *** but your pointers are only 4 bytes wide.
6567 *** Please rerun Configure without -Duse64bitall.
6572 *** Since you have quads, you could possibly try with -Duse64bitint.
6577 *** Cannot continue, aborting.
6588 : determine whether to use malloc wrapping
6590 case "$usemallocwrap" in
6591 [yY]*|true|$define) dflt='y' ;;
6592 [nN]*|false|$undef) dflt='n' ;;
6593 *) case "$usedevel" in
6594 [yY]*|true|$define) dflt='y' ;;
6599 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6601 usemallocwrap="$ans"
6604 usemallocwrap="$define" ;;
6606 usemallocwrap="$undef" ;;
6609 : determine which malloc to compile in
6611 case "$usemymalloc" in
6612 [yY]*|true|$define) dflt='y' ;;
6613 [nN]*|false|$undef) dflt='n' ;;
6614 *) case "$ptrsize" in
6620 rp="Do you wish to attempt to use the malloc that comes with $package?"
6626 mallocsrc='malloc.c'
6627 mallocobj="malloc$_o"
6628 d_mymalloc="$define"
6631 : Remove malloc from list of libraries to use
6632 echo "Removing unneeded -lmalloc from library list" >&4
6633 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6636 echo "libs = $libs" >&4
6648 : compute the return types of malloc and free
6650 $cat >malloc.c <<END
6654 #include <sys/types.h>
6668 case "$malloctype" in
6670 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6677 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6681 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6688 echo "Your system uses $freetype free(), it would seem." >&4
6690 : determine where site specific architecture-dependent libraries go.
6691 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6692 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6693 : sitelib may have an optional trailing /share.
6695 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6696 dflt="$dflt/$archname"
6701 set sitearch sitearch none
6705 The installation process will also create a directory for
6706 architecture-dependent site-specific extensions and modules.
6710 rp='Pathname for the site-specific architecture-dependent library files?'
6714 if $test X"$sitearch" = X"$sitelib"; then
6717 d_sitearch="$define"
6722 The installation process will also create a directory for
6723 vendor-supplied add-ons. Vendors who supply perl with their system
6724 may find it convenient to place all vendor-supplied files in this
6725 directory rather than in the main distribution directory. This will
6726 ease upgrades between binary-compatible maintenance versions of perl.
6728 Of course you may also use these directories in whatever way you see
6729 fit. For example, you might use them to access modules shared over a
6730 company-wide network.
6732 The default answer should be fine for most people.
6733 This causes further questions about vendor add-ons to be skipped
6734 and no vendor-specific directories will be configured for perl.
6737 rp='Do you want to configure vendor-specific add-on directories?'
6738 case "$usevendorprefix" in
6739 define|true|[yY]*) dflt=y ;;
6740 *) : User may have set vendorprefix directly on Configure command line.
6741 case "$vendorprefix" in
6750 rp='Installation prefix to use for vendor-supplied add-ons?'
6751 case "$vendorprefix" in
6753 *) dflt=$vendorprefix ;;
6756 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6758 case "$vendorprefix" in
6762 *) oldvendorprefix="$prefix";;
6766 usevendorprefix="$define"
6768 vendorprefixexp="$ansexp"
6770 *) usevendorprefix="$undef"
6776 case "$vendorprefix" in
6777 '') d_vendorlib="$undef"
6781 *) d_vendorlib="$define"
6782 : determine where vendor-supplied modules go.
6783 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6784 case "$vendorlib" in
6786 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6787 case "$installstyle" in
6788 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6789 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6792 *) dflt="$vendorlib"
6796 rp='Pathname for the vendor-supplied library files?'
6799 vendorlibexp="$ansexp"
6802 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6806 case "$vendorprefix" in
6807 '') d_vendorarch="$undef"
6811 *) d_vendorarch="$define"
6812 : determine where vendor-supplied architecture-dependent libraries go.
6813 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6814 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6815 : vendorlib may have an optional trailing /share.
6816 case "$vendorarch" in
6817 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6818 dflt="$dflt/$archname"
6820 *) dflt="$vendorarch" ;;
6823 rp='Pathname for vendor-supplied architecture-dependent files?'
6826 vendorarchexp="$ansexp"
6829 prefixvar=vendorarch
6832 : Final catch-all directories to search
6835 Lastly, you can have perl look in other directories for extensions and
6836 modules in addition to those already specified.
6837 These directories will be searched after
6841 test X"$vendorlib" != "X" && echo ' ' $vendorlib
6842 test X"$vendorarch" != "X" && echo ' ' $vendorarch
6844 case "$otherlibdirs" in
6845 ''|' ') dflt='none' ;;
6846 *) dflt="$otherlibdirs" ;;
6849 Enter a colon-separated set of extra paths to include in perl's @INC
6850 search path, or enter 'none' for no extra paths.
6854 rp='Colon-separated list of additional directories for perl to search?'
6857 ' '|''|none) otherlibdirs=' ' ;;
6858 *) otherlibdirs="$ans" ;;
6860 case "$otherlibdirs" in
6864 set d_perl_otherlibdirs
6867 : Cruising for prototypes
6869 echo "Checking out function prototypes..." >&4
6870 $cat >prototype.c <<EOCP
6875 int main(int argc, char *argv[]) {
6878 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
6879 echo "Your C compiler appears to support function prototypes."
6882 echo "Your C compiler doesn't seem to understand function prototypes."
6889 case "$prototype" in
6891 *) ansi2knr='ansi2knr'
6896 This version of $package can only be compiled by a compiler that
6897 understands function prototypes. Unfortunately, your C compiler
6899 doesn't seem to understand them. Sorry about that.
6901 If GNU cc is available for your system, perhaps you could try that instead.
6903 Eventually, we hope to support building Perl with pre-ANSI compilers.
6904 If you would like to help in that effort, please contact <perlbug@perl.org>.
6906 Aborting Configure now.
6918 Perl can be built with extra modules or bundles of modules which
6919 will be fetched from the CPAN and installed alongside Perl.
6921 Notice that you will need access to the CPAN; either via the Internet,
6922 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
6923 be asked later to configure the CPAN.pm module which will in turn do
6924 the installation of the rest of the extra modules or bundles.)
6926 Notice also that if the modules require any external software such as
6927 libraries and headers (the libz library and the zlib.h header for the
6928 Compress::Zlib module, for example) you MUST have any such software
6929 already installed, this configuration process will NOT install such
6932 If this doesn't make any sense to you, just accept the default '$dflt'.
6934 rp='Install any extra modules (y or n)?'
6940 Please list any extra modules or bundles to be installed from CPAN,
6941 with spaces between the names. The names can be in any format the
6942 'install' command of CPAN.pm will understand. (Answer 'none',
6943 without the quotes, to install no extra modules or bundles.)
6953 $rm -f ../extras.lst
6955 *) echo "(Saving the list of extras for later...)"
6956 echo "$extras" > ../extras.lst
6964 : determine where html pages for programs go
6965 set html1dir html1dir none
6969 If you wish to install html files for programs in $spackage, indicate
6970 the appropriate directory here. To skip installing html files,
6974 ''|none|$undef|' ') dflt=none ;;
6975 *) dflt=$html1dir ;;
6978 rp="Directory for the main $spackage html pages?"
6982 : Use ' ' for none so value is preserved next time through Configure
6983 $test X"$html1dir" = "X" && html1dir=' '
6985 : determine where html pages for libraries and modules go
6986 set html3dir html3dir none
6990 If you wish to install html files for modules associated with $spackage,
6991 indicate the appropriate directory here. To skip installing html files,
6994 : There is no obvious default. If they have specified html1dir, then
6995 : try to key off that, possibly changing .../html1 into .../html3.
6997 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
6998 *) dflt=$html3dir ;;
7001 rp="Directory for the $spackage module html pages?"
7005 : Use ' ' for none so value is preserved next time through Configure
7006 $test X"$html3dir" = "X" && html3dir=' '
7008 : determine whether to install perl also as /usr/bin/perl
7011 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7013 Many scripts expect perl to be installed as /usr/bin/perl.
7015 If you want to, I can install the perl you are about to compile
7016 as /usr/bin/perl (in addition to $bin/perl).
7018 if test -f /usr/bin/perl; then
7021 However, please note that because you already have a /usr/bin/perl,
7022 overwriting that with a new Perl would very probably cause problems.
7023 Therefore I'm assuming you don't want to do that (unless you insist).
7026 case "$installusrbinperl" in
7027 "$define"|[yY]*) dflt='y';;
7033 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7036 case "$installusrbinperl" in
7037 "$undef"|[nN]*) dflt='n';;
7041 rp="Do you want to install perl as /usr/bin/perl?"
7044 [yY]*) val="$define";;
7050 set installusrbinperl
7054 echo "Checking for GNU C Library..." >&4
7056 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7057 alone are insufficient to distinguish different versions, such as
7058 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7059 libc version 2.1.0. A. Dougherty, June 3, 2002.
7065 # ifdef __GLIBC_MINOR__
7066 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
7067 # include <gnu/libc-version.h>
7068 printf("%s\n", gnu_get_libc_version());
7070 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7073 printf("%d\n", __GLIBC__);
7082 if eval $compile_ok && $run ./try > glibc.ver; then
7084 gnulibc_version=`$cat glibc.ver`
7085 echo "You are using the GNU C Library version $gnulibc_version"
7089 echo "You are not using the GNU C Library"
7091 $rm -f try try.* glibc.ver
7095 : see if nm is to be used to determine whether a symbol is defined or not
7099 case "$d_gnulibc" in
7102 echo "nm probably won't work on the GNU C Library." >&4
7108 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7110 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7111 echo "'nm' won't be sufficient on this sytem." >&4
7117 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7118 if $test $dflt -gt 20; then
7128 true|$define) dflt=y;;
7135 I can use $nm to extract the symbols from your C libraries. This
7136 is a time consuming task which may generate huge output on the disk (up
7137 to 3 megabytes) but that should make the symbols extraction faster. The
7138 alternative is to skip the 'nm' extraction part and to compile a small
7139 test program instead to determine whether each symbol is present. If
7140 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7141 this may be the best solution.
7143 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7146 rp="Shall I use $nm to extract C symbols from the libraries?"
7149 [Nn]*) usenm=false;;
7158 : nm options which may be necessary
7160 '') if $test -f /mach_boot; then
7162 elif $test -d /usr/ccs/lib; then
7163 nm_opt='-p' # Solaris (and SunOS?)
7164 elif $test -f /dgux; then
7166 elif $test -f /lib64/rld; then
7167 nm_opt='-p' # 64-bit Irix
7173 : nm options which may be necessary for shared libraries but illegal
7174 : for archive libraries. Thank you, Linux.
7175 case "$nm_so_opt" in
7176 '') case "$myuname" in
7178 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7179 nm_so_opt='--dynamic'
7188 : get list of predefined functions in a handy place
7193 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7199 *) for thislib in $libs; do
7202 : Handle C library specially below.
7205 thislib=`echo $thislib | $sed -e 's/^-l//'`
7206 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7208 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7210 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7212 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7214 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7216 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7218 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7223 libnames="$libnames $try"
7225 *) libnames="$libnames $thislib" ;;
7234 for xxx in $libpth; do
7235 $test -r $1 || set $xxx/libc.$so
7236 : The messy sed command sorts on library version numbers.
7238 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7239 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7241 s/[0-9][0-9]*/0000&/g
7242 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7245 $sort | $sed -e 's/^.* //'`
7248 $test -r $1 || set /usr/ccs/lib/libc.$so
7249 $test -r $1 || set /lib/libsys_s$_a
7255 if $test -r "$1"; then
7256 echo "Your (shared) C library seems to be in $1."
7258 elif $test -r /lib/libc && $test -r /lib/clib; then
7259 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7261 libc='/lib/clib /lib/libc'
7262 if $test -r /lib/syslib; then
7263 echo "(Your math library is in /lib/syslib.)"
7264 libc="$libc /lib/syslib"
7266 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7267 echo "Your C library seems to be in $libc, as you said before."
7268 elif $test -r $incpath/usr/lib/libc$_a; then
7269 libc=$incpath/usr/lib/libc$_a;
7270 echo "Your C library seems to be in $libc. That's fine."
7271 elif $test -r /lib/libc$_a; then
7273 echo "Your C library seems to be in $libc. You're normal."
7275 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7277 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7278 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7279 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7281 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7283 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7286 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7288 if $test -r "$tans"; then
7289 echo "Your C library seems to be in $tans, of all places."
7295 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7299 If the guess above is wrong (which it might be if you're using a strange
7300 compiler, or your machine supports multiple models), you can override it here.
7305 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7307 I can't seem to find your C library. I've looked in the following places:
7310 $sed 's/^/ /' libpath
7313 None of these seems to contain your C library. I need to get its name...
7318 rp='Where is your C library?'
7323 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7324 set X `cat libnames`
7327 case $# in 1) xxx=file; esac
7328 echo "Extracting names from the following $xxx for later perusal:" >&4
7330 $sed 's/^/ /' libnames >&4
7332 $echo $n "This may take a while...$c" >&4
7336 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7337 *) $nm $nm_opt $file 2>/dev/null;;
7342 $grep fprintf libc.tmp > libc.ptf
7343 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7344 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7346 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7348 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7350 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7352 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7354 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7356 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7358 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7360 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7362 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7364 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7366 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7368 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7370 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7371 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7373 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7375 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7377 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7379 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7381 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7383 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7385 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7387 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7389 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7391 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7393 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7395 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7397 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7399 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7401 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7404 $nm -p $* 2>/dev/null >libc.tmp
7405 $grep fprintf libc.tmp > libc.ptf
7406 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7407 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7413 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7415 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
7416 for thisname in $libnames $libc; do
7417 $ar t $thisname >>libc.tmp
7419 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7421 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7422 # Repeat libc to extract forwarders to DLL entries too
7423 for thisname in $libnames $libc; do
7424 $ar tv $thisname >>libc.tmp
7425 # Revision 50 of EMX has bug in $ar.
7426 # it will not extract forwarders to DLL entries
7427 # Use emximp which will extract exactly them.
7428 emximp -o tmp.imp $thisname \
7430 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7431 < tmp.imp >>libc.tmp
7434 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7437 echo "$ar didn't seem to work right." >&4
7438 echo "Maybe this is a Cray...trying bld instead..." >&4
7439 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
7441 for thisname in $libnames; do
7443 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7444 $ar t $thisname >>libc.tmp
7448 echo "That didn't work either. Giving up." >&4
7458 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7459 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7461 *) if $test -f /lib/syscalls.exp; then
7463 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7464 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' /lib/syscalls.exp >>libc.list
7470 $rm -f libnames libpath
7472 : see if dld is available
7476 : is a C symbol defined?
7479 -v) tf=libc.tmp; tdc="";;
7480 -a) tf=libc.tmp; tdc="[]";;
7481 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7484 case "$reuseval-$4" in
7486 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7491 if $test "$runnm" = true; then
7492 if $contains $tlook $tf >/dev/null 2>&1; then
7494 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7495 echo "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7496 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7497 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7498 $rm -f try$_exe try.c core core.* try.core;
7501 echo "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7502 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7503 $rm -f try$_exe try.c;
7508 $define) tval=true;;
7515 : define an is-in-libc? function
7516 inlibc='echo " "; td=$define; tu=$undef;
7517 sym=$1; var=$2; eval "was=\$$2";
7519 case "$reuseval$was" in
7529 echo "$sym() found." >&4;
7530 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7532 echo "$sym() NOT found." >&4;
7533 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7537 $define) echo "$sym() found." >&4;;
7538 *) echo "$sym() NOT found." >&4;;
7542 : see if dlopen exists
7549 : determine which dynamic loading, if any, to compile in
7551 dldir="ext/DynaLoader"
7564 $define) dflt='y' ;;
7567 $define) dflt='y' ;;
7569 : Does a dl_xxx.xs file exist for this operating system
7570 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7573 rp="Do you wish to use dynamic loading?"
7580 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7581 dflt="$dldir/dl_${osname}.xs"
7582 elif $test "$d_dlopen" = "$define" ; then
7583 dflt="$dldir/dl_dlopen.xs"
7584 elif $test "$i_dld" = "$define" ; then
7585 dflt="$dldir/dl_dld.xs"
7590 *) dflt="$dldir/$dlsrc"
7593 echo "The following dynamic loading files are available:"
7594 : Can not go over to $dldir because getfile has path hard-coded in.
7595 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7596 rp="Source file to use for dynamic loading"
7602 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7606 Some systems may require passing special flags to $cc -c to
7607 compile modules that will be used to create a shared library.
7608 To use no flags, say "none".
7611 case "$cccdlflags" in
7612 '') case "$gccversion" in
7613 '') case "$osname" in
7615 next) dflt='none' ;;
7616 irix*) dflt='-KPIC' ;;
7617 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7618 sunos) dflt='-pic' ;;
7622 *) case "$osname" in
7623 darwin) dflt='none' ;;
7624 svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7629 *) dflt="$cccdlflags" ;;
7631 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7634 none) cccdlflags=' ' ;;
7635 *) cccdlflags="$ans" ;;
7640 Some systems use ld to create libraries that can be dynamically loaded,
7641 while other systems (such as those using ELF) use $cc.
7645 '') $cat >try.c <<EOM
7646 /* Test for whether ELF binaries are produced */
7654 int i = open("a.out",O_RDONLY);
7657 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7658 exit(0); /* succeed (yes, it's ELF) */
7663 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7665 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7669 echo "I'll use ld to build dynamic libraries."
7678 rp="What command should be used to create dynamic libraries?"
7684 Some systems may require passing special flags to $ld to create a
7685 library that can be dynamically loaded. If your ld flags include
7686 -L/other/path options to locate libraries outside your loader's normal
7687 search path, you may need to specify those -L options here as well. To
7688 use no flags, say "none".
7691 case "$lddlflags" in
7692 '') case "$osname" in
7693 beos) dflt='-nostart' ;;
7695 case "$gccversion" in
7696 '') dflt="$dflt +vnocompatwarnings" ;;
7699 linux|irix*|gnu*) dflt='-shared' ;;
7700 next) dflt='none' ;;
7701 solaris) dflt='-G' ;;
7702 sunos) dflt='-assert nodefinitions' ;;
7703 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
7707 *) dflt="$lddlflags" ;;
7710 : Try to guess additional flags to pick up local libraries.
7711 : Be careful not to append to a plain 'none'
7715 for thisflag in $ldflags; do
7720 *) dflt="$dflt $thisflag" ;;
7727 ''|' ') dflt='none' ;;
7730 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
7733 none) lddlflags=' ' ;;
7734 *) lddlflags="$ans" ;;
7739 Some systems may require passing special flags to $cc to indicate that
7740 the resulting executable will use dynamic linking. To use no flags,
7744 case "$ccdlflags" in
7745 '') case "$osname" in
7746 linux|hpux|gnu*) dflt='-Wl,-E' ;;
7747 next|sunos) dflt='none' ;;
7751 *) dflt="$ccdlflags" ;;
7753 rp="Any special flags to pass to $cc to use dynamic linking?"
7756 none) ccdlflags=' ' ;;
7757 *) ccdlflags="$ans" ;;
7771 # No dynamic loading being used, so don't bother even to prompt.
7774 *) case "$useshrplib" in
7775 '') case "$osname" in
7776 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
7778 also='Building a shared libperl is required for dynamic loading to work on your system.'
7783 also='Building a shared libperl is needed for MAB support.'
7801 The perl executable is normally obtained by linking perlmain.c with
7802 libperl${_a}, any static extensions (usually just DynaLoader), and
7803 any other libraries needed on this system (such as -lm, etc.). Since
7804 your system supports dynamic loading, it is probably possible to build
7805 a shared libperl.$so. If you will have more than one executable linked
7806 to libperl.$so, this will significantly reduce the size of each
7807 executable, but it may have a noticeable effect on performance. The
7808 default is probably sensible for your system.
7812 rp="Build a shared libperl.$so (y/n)"
7816 useshrplib='true' ;;
7817 *) useshrplib='false' ;;
7822 case "$useshrplib" in
7826 # Figure out a good name for libperl.so. Since it gets stored in
7827 # a version-specific architecture-dependent library, the version
7828 # number isn't really that important, except for making cc/ld happy.
7830 # A name such as libperl.so.3.1
7831 majmin="libperl.$so.$patchlevel.$subversion"
7832 # A name such as libperl.so.301
7833 majonly=`echo $patchlevel $subversion |
7834 $awk '{printf "%d%02d", $1, $2}'`
7835 majonly=libperl.$so.$majonly
7836 # I'd prefer to keep the os-specific stuff here to a minimum, and
7837 # rely on figuring it out from the naming of libc.
7838 case "${osname}${osvers}" in
7841 # XXX How handle the --version stuff for MAB?
7843 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
7846 cygwin*) # ld links against an importlib
7847 dflt=libperl$lib_ext
7849 *) # Try to guess based on whether libc has major.minor.
7851 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
7852 *libc.$so.[0-9]*) dflt=$majonly ;;
7853 *) dflt=libperl.$so ;;
7863 I need to select a good name for the shared libperl. If your system uses
7864 library names with major and minor numbers, then you might want something
7865 like $majmin. Alternatively, if your system uses a single version
7866 number for shared libraries, then you might want to use $majonly.
7867 Or, your system might be quite happy with a simple libperl.$so.
7869 Since the shared libperl will get installed into a version-specific
7870 architecture-dependent directory, the version number of the shared perl
7871 library probably isn't important, so the default should be o.k.
7874 rp='What name do you want to give to the shared libperl?'
7877 echo "Ok, I'll use $libperl"
7880 libperl="libperl${_a}"
7884 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
7888 WARNING: Use of the shrpdir variable for the installation location of
7889 the shared $libperl is not supported. It was never documented and
7890 will not work in this version. Let me (perlbug@perl.org)
7891 know of any problems this may cause.
7897 But your current setting of $shrpdir is
7898 the default anyway, so it's harmless.
7903 Further, your current attempted setting of $shrpdir
7904 conflicts with the value of $archlibexp/CORE
7905 that installperl will use.
7912 # How will the perl executable find the installed shared $libperl?
7913 # Add $xxx to ccdlflags.
7914 # If we can't figure out a command-line option, use $shrpenv to
7915 # set env LD_RUN_PATH. The main perl makefile uses this.
7916 shrpdir=$archlibexp/CORE
7919 if "$useshrplib"; then
7922 # We'll set it in Makefile.SH...
7927 freebsd|netbsd|openbsd|interix|dragonfly)
7928 xxx="-Wl,-R$shrpdir"
7930 bsdos|linux|irix*|dec_osf|gnu*)
7931 xxx="-Wl,-rpath,$shrpdir"
7934 # next doesn't like the default...
7937 # beos doesn't like the default, either.
7940 # hpux doesn't like the default, either.
7941 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
7944 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
7950 # Only add $xxx if it isn't already in ccdlflags.
7951 case " $ccdlflags " in
7953 *) ccdlflags="$ccdlflags $xxx"
7956 Adding $xxx to the flags
7957 passed to $ld so that the perl executable will find the
7958 installed shared $libperl.
7966 # Fix ccdlflags in AIX for building external extensions.
7967 # (For building Perl itself bare -bE:perl.exp is needed,
7968 # Makefile.SH takes care of this.)
7970 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
7972 # Respect a hint or command-line value.
7974 '') shrpenv="$tmp_shrpenv" ;;
7976 case "$ldlibpthname" in
7977 '') ldlibpthname=LD_LIBRARY_PATH ;;
7978 none) ldlibpthname='' ;;
7981 : determine where manual pages are on this system
7985 syspath='/usr/share/man/man1 /usr/man/man1'
7986 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
7987 syspath="$syspath /usr/man/u_man/man1"
7988 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
7989 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
7990 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
7991 sysman=`./loc . /usr/man/man1 $syspath`
7994 if $test -d "$sysman"; then
7995 echo "System manual is in $sysman." >&4
7997 echo "Could not find manual pages in source form." >&4
8000 : determine where manual pages go
8001 set man1dir man1dir none
8005 $spackage has manual pages available in source form.
8009 echo "However, you don't have nroff, so they're probably useless to you."
8011 '') man1dir="none";;
8014 echo "If you don't want the manual sources installed, answer 'none'."
8019 lookpath="$prefixexp/share/man/man1"
8020 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8021 lookpath="$lookpath $prefixexp/man/p_man/man1"
8022 lookpath="$lookpath $prefixexp/man/u_man/man1"
8023 lookpath="$lookpath $prefixexp/man/man.1"
8025 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8026 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8036 rp="Where do the main $spackage manual pages (source) go?"
8038 if $test "X$man1direxp" != "X$ansexp"; then
8049 : What suffix to use on installed man pages
8056 rp="What suffix should be used for the main $spackage man pages?"
8058 '') case "$man1dir" in
8072 *) dflt="$man1ext";;
8079 : see if we can have long filenames
8081 first=123456789abcdef
8083 if (echo hi >$first) 2>/dev/null; then
8084 if $test -f 123456789abcde; then
8085 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8088 echo 'You can have filenames longer than 14 characters.'>&4
8093 You can't have filenames longer than 14 chars.
8094 You can't even think about them!
8100 $rm -rf 123456789abcde*
8102 : determine where library module manual pages go
8103 set man3dir man3dir none
8107 $spackage has manual pages for many of the library modules.
8113 However, you don't have nroff, so they're probably useless to you.
8116 '') man3dir="none";;
8120 case "$d_flexfnam" in
8123 However, your system can't handle the long file names like File::Basename.3.
8126 '') man3dir="none";;
8130 echo "If you don't want the manual sources installed, answer 'none'."
8131 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8133 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8134 if $test -d "$privlib/man/man3"; then
8137 WARNING: Previous versions of perl installed man3 pages into
8138 $privlib/man/man3. This version will suggest a
8139 new default of $dflt.
8143 rp='Do you wish to preserve the old behavior?(y/n)'
8146 y*) dflt="$privlib/man/man3" ;;
8151 *) dflt="$man3dir" ;;
8158 rp="Where do the $package library man pages (source) go?"
8168 : What suffix to use on installed man pages
8174 rp="What suffix should be used for the $package library man pages?"
8176 '') case "$man3dir" in
8190 *) dflt="$man3ext";;
8197 : see if we have to deal with yellow pages, now NIS.
8198 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8199 if $test -f /usr/etc/nibindd; then
8201 echo "I'm fairly confident you're on a NeXT."
8203 rp='Do you get the hosts file via NetInfo?'
8212 y*) hostcat='nidump hosts .';;
8213 *) case "$hostcat" in
8214 nidump*) hostcat='';;
8224 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8232 rp='Are you getting the hosts file via yellow pages?'
8235 y*) hostcat='ypcat hosts';;
8236 *) hostcat='cat /etc/hosts';;
8242 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8245 '') test -f /etc/group && groupcat='cat /etc/group';;
8248 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8251 : now get the host name
8253 echo "Figuring out host name..." >&4
8254 case "$myhostname" in
8256 echo 'Maybe "hostname" will work...'
8257 if tans=`sh -c hostname 2>&1` ; then
8265 if $test "$cont"; then
8267 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8268 if tans=`cat /etc/systemid 2>&1` ; then
8270 phostname='cat /etc/systemid'
8271 echo "Whadyaknow. Xenix always was a bit strange..."
8274 elif $test -r /etc/systemid; then
8275 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8278 if $test "$cont"; then
8279 echo 'No, maybe "uuname -l" will work...'
8280 if tans=`sh -c 'uuname -l' 2>&1` ; then
8282 phostname='uuname -l'
8284 echo 'Strange. Maybe "uname -n" will work...'
8285 if tans=`sh -c 'uname -n' 2>&1` ; then
8287 phostname='uname -n'
8289 echo 'Oh well, maybe I can mine it out of whoami.h...'
8290 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8291 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8292 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8294 case "$myhostname" in
8295 '') echo "Does this machine have an identity crisis or something?"
8298 echo "Well, you said $myhostname before..."
8299 phostname='echo $myhostname';;
8305 case "$myhostname" in
8306 '') myhostname=noname ;;
8308 : you do not want to know about this
8313 if $test "$myhostname" ; then
8315 rp='Your host name appears to be "'$myhostname'".'" Right?"
8323 : bad guess or no guess
8324 while $test "X$myhostname" = X ; do
8326 rp="Please type the (one word) name of your host:"
8331 : translate upper to lower if necessary
8332 case "$myhostname" in
8334 echo "(Normalizing case in your host name)"
8335 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8339 case "$myhostname" in
8341 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8342 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8343 echo "(Trimming domain name from host name--host name is now $myhostname)"
8345 *) case "$mydomain" in
8348 test "X$hostcat" = "Xypcat hosts" &&
8349 ypmatch "$myhostname" hosts 2>/dev/null |\
8350 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8353 test "X$hostcat" != "X" &&
8354 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8355 /[ ]$myhostname[ . ]/p" > hosts
8358 if $test -f hosts; then
8359 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8360 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8361 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8362 hosts | $sort | $uniq | \
8363 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8364 case `$echo X$dflt` in
8365 X*\ *) echo "(Several hosts in the database matched hostname)"
8368 X.) echo "(You do not have fully-qualified names in the hosts database)"
8372 echo "(I cannot locate a hosts database anywhere)"
8377 tans=`./loc resolv.conf X /etc /usr/etc`
8378 if $test -f "$tans"; then
8379 echo "(Attempting domain name extraction from $tans)"
8380 dflt=.`$sed -n -e 's/ / /g' \
8381 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8382 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8384 .) dflt=.`$sed -n -e 's/ / /g' \
8385 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8386 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8393 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8394 dflt=.`sh -c domainname 2>/dev/null`
8397 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8401 case "$dflt$osname" in
8402 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8403 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8407 .) echo "(Lost all hope -- silly guess then)"
8413 *) dflt="$mydomain";;
8417 rp="What is your domain name?"
8427 : translate upper to lower if necessary
8430 echo "(Normalizing case in your domain name)"
8431 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8435 : a little sanity check here
8436 case "$phostname" in
8439 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8440 $myhostname$mydomain|$myhostname) ;;
8442 case "$phostname" in
8444 echo "(That doesn't agree with your whoami.h file, by the way.)"
8447 echo "(That doesn't agree with your $phostname command, by the way.)"
8457 I need to get your e-mail address in Internet format if possible, i.e.
8458 something like user@host.domain. Please answer accurately since I have
8459 no easy means to double check it. The default value provided below
8460 is most probably close to reality but may not be valid from outside
8461 your organization...
8465 while test "$cont"; do
8467 '') dflt="$cf_by@$myhostname$mydomain";;
8468 *) dflt="$cf_email";;
8470 rp='What is your e-mail address?'
8476 rp='Address does not look like an Internet one. Use it anyway?'
8492 If you or somebody else will be maintaining perl at your site, please
8493 fill in the correct e-mail address here so that they may be contacted
8494 if necessary. Currently, the "perlbug" program included with perl
8495 will send mail to this address in addition to perlbug@perl.org. You may
8496 enter "none" for no administrator.
8499 case "$perladmin" in
8500 '') dflt="$cf_email";;
8501 *) dflt="$perladmin";;
8503 rp='Perl administrator e-mail address'
8507 : determine whether to only install version-specific parts.
8510 Do you want to install only the version-specific parts of the perl
8511 distribution? Usually you do *not* want to do this.
8513 case "$versiononly" in
8514 "$define"|[Yy]*|true) dflt='y' ;;
8517 rp="Do you want to install only the version-specific parts of perl?"
8520 [yY]*) val="$define";;
8526 case "$versiononly" in
8527 "$define") inc_version_list=''
8528 inc_version_list_init=0
8532 : figure out how to guarantee perl startup
8533 case "$startperl" in
8535 case "$sharpbang" in
8539 I can use the #! construct to start perl on your system. This will
8540 make startup of perl scripts faster, but may cause problems if you
8541 want to share those scripts and perl is not in a standard place
8542 ($binexp/perl) on all your platforms. The alternative is to force
8543 a shell by starting the script with a single ':' character.
8546 case "$versiononly" in
8547 "$define") dflt="$binexp/perl$version";;
8548 *) dflt="$binexp/perl";;
8550 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8553 none) startperl=": # use perl";;
8554 *) startperl="#!$ans"
8555 if $test 30 -lt `echo "$ans" | wc -c`; then
8558 WARNING: Some systems limit the #! command to 32 characters.
8559 If you experience difficulty running Perl scripts with #!, try
8560 installing Perl in a directory with a shorter pathname.
8566 *) startperl=": # use perl"
8571 echo "I'll use $startperl to start perl scripts."
8573 : figure best path for perl in scripts
8576 case "$versiononly" in
8577 "$define") perlpath="$binexp/perl$version";;
8578 *) perlpath="$binexp/perl";;
8580 case "$startperl" in
8585 I will use the "eval 'exec'" idiom to start Perl on your system.
8586 I can use the full path of your Perl binary for this purpose, but
8587 doing so may cause problems if you want to share those scripts and
8588 Perl is not always in a standard place ($binexp/perl).
8592 rp="What path shall I use in \"eval 'exec'\"?"
8599 case "$startperl" in
8601 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8604 : determine where public executable scripts go
8605 set scriptdir scriptdir
8607 case "$scriptdir" in
8610 : guess some guesses
8611 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8612 $test -d /usr/share/bin && dflt=/usr/share/bin
8613 $test -d /usr/local/script && dflt=/usr/local/script
8614 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8615 $test -d $prefixexp/script && dflt=$prefixexp/script
8619 *) dflt="$scriptdir"
8624 Some installations have a separate directory just for executable scripts so
8625 that they can mount it across multiple architectures but keep the scripts in
8626 one spot. You might, for example, have a subdirectory of /usr/share for this.
8627 Or you might just lump your scripts in with all your other executables.
8631 rp='Where do you keep publicly executable scripts?'
8633 if $test "X$ansexp" != "X$scriptdirexp"; then
8639 : A little fix up for an irregularly named variable.
8640 installscript="$installscriptdir"
8642 : determine where add-on public executables go
8644 '') dflt=$siteprefix/bin ;;
8648 rp='Pathname where the add-on public executables should be installed?'
8653 : determine where add-on html pages go
8654 : There is no standard location, so try to copy the previously-selected
8655 : directory structure for the core html pages.
8656 case "$sitehtml1dir" in
8657 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8658 *) dflt=$sitehtml1dir ;;
8661 ''|' ') dflt=none ;;
8664 rp='Pathname where the site-specific html pages should be installed?'
8666 prefixvar=sitehtml1dir
8669 : determine where add-on library html pages go
8670 : There is no standard location, so try to copy the previously-selected
8671 : directory structure for the core html pages.
8672 case "$sitehtml3dir" in
8673 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8674 *) dflt=$sitehtml3dir ;;
8677 ''|' ') dflt=none ;;
8680 rp='Pathname where the site-specific library html pages should be installed?'
8682 prefixvar=sitehtml3dir
8685 : determine where add-on manual pages go
8686 case "$siteman1dir" in
8687 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
8688 *) dflt=$siteman1dir ;;
8691 ''|' ') dflt=none ;;
8694 rp='Pathname where the site-specific manual pages should be installed?'
8696 prefixvar=siteman1dir
8699 : determine where add-on library man pages go
8700 case "$siteman3dir" in
8701 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
8702 *) dflt=$siteman3dir ;;
8705 ''|' ') dflt=none ;;
8708 rp='Pathname where the site-specific library manual pages should be installed?'
8710 prefixvar=siteman3dir
8713 : determine where add-on public executable scripts go
8714 case "$sitescript" in
8715 '') dflt=$siteprefix/script
8716 $test -d $dflt || dflt=$sitebin ;;
8717 *) dflt="$sitescript" ;;
8720 rp='Pathname where add-on public executable scripts should be installed?'
8722 prefixvar=sitescript
8725 case "$usefaststdio" in
8726 $define|true|[yY]*|'')
8727 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
8737 Perl can be built to use 'fast stdio', which means using the stdio
8738 library but also directly manipulating the stdio buffers to enable
8739 faster I/O. Using stdio is better for backward compatibility (especially
8740 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
8741 interface has been preferred instead of stdio.
8743 If this doesn't make any sense to you, just accept the default '$dflt'.
8745 rp='Use the "fast stdio" if available?'
8748 y|Y) val="$define" ;;
8755 : define an is-a-typedef? function
8756 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8758 "") inclist="sys/types.h";;
8760 eval "varval=\$$var";
8764 for inc in $inclist; do
8765 echo "#include <$inc>" >>temp.c;
8767 echo "#ifdef $type" >> temp.c;
8768 echo "printf(\"We have $type\");" >> temp.c;
8769 echo "#endif" >> temp.c;
8770 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8771 if $contains $type temp.E >/dev/null 2>&1; then
8777 *) eval "$var=\$varval";;
8780 : define an is-a-typedef? function that prompts if the type is not available.
8781 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8783 "") inclist="sys/types.h";;
8785 eval "varval=\$$var";
8789 for inc in $inclist; do
8790 echo "#include <$inc>" >>temp.c;
8792 echo "#ifdef $type" >> temp.c;
8793 echo "printf(\"We have $type\");" >> temp.c;
8794 echo "#endif" >> temp.c;
8795 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8797 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
8798 if $contains $type temp.E >/dev/null 2>&1; then
8799 echo "$type found." >&4;
8802 echo "$type NOT found." >&4;
8808 *) eval "$var=\$varval";;
8811 : see what type lseek is declared as in the kernel
8812 rp="What is the type used for lseek's offset on this system?"
8813 set off_t lseektype long stdio.h sys/types.h
8817 echo "Checking to see how big your file offsets are..." >&4
8819 #include <sys/types.h>
8823 printf("%d\n", (int)sizeof($lseektype));
8828 if eval $compile_ok; then
8829 lseeksize=`$run ./try`
8830 echo "Your file offsets are $lseeksize bytes long."
8834 echo "(I can't seem to compile the test program. Guessing...)"
8835 rp="What is the size of your file offsets (in bytes)?"
8841 : see what type file positions are declared as in the library
8842 rp="What is the type for file position used by fsetpos()?"
8843 set fpos_t fpostype long stdio.h sys/types.h
8848 *_t) zzz="$fpostype" ;;
8851 echo "Checking the size of $zzz..." >&4
8853 #include <sys/types.h>
8860 printf("%d\n", (int)sizeof($fpostype));
8865 if eval $compile_ok; then
8869 echo "(I can't execute the test program--guessing $fpossize.)" >&4
8872 echo "Your $zzz is $fpossize bytes long."
8878 echo "(I can't compile the test program. Guessing...)" >&4
8879 rp="What is the size of your file positions (in bytes)?"
8884 # Backward compatibility (uselfs is deprecated).
8886 "$define"|true|[yY]*)
8889 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
8891 uselargefiles="$define"
8895 case "$lseeksize:$fpossize" in
8898 You can have files larger than 2 gigabytes.
8901 *) case "$uselargefiles" in
8902 "$undef"|false|[nN]*) dflt='n' ;;
8907 Perl can be built to understand large files (files larger than 2 gigabytes)
8908 on some systems. To do so, Configure can be run with -Duselargefiles.
8910 If this doesn't make any sense to you, just accept the default '$dflt'.
8912 rp='Try to understand large files, if available?'
8915 y|Y) val="$define" ;;
8922 : Look for a hint-file generated 'call-back-unit'. If the
8923 : user has specified that a large files perl is to be built,
8924 : we may need to set or change some other defaults.
8925 if $test -f uselargefiles.cbu; then
8926 echo "Your platform has some specific hints regarding large file builds, using them..."
8927 . ./uselargefiles.cbu
8929 case "$uselargefiles" in
8931 if $test -f uselargefiles.cbu; then
8933 echo "Rechecking to see how big your file offsets are..." >&4
8935 #include <sys/types.h>
8939 printf("%d\n", (int)sizeof($lseektype));
8944 if eval $compile_ok; then
8945 lseeksize=`$run ./try`
8946 $echo "Your file offsets are now $lseeksize bytes long."
8950 echo "(I can't seem to compile the test program. Guessing...)"
8951 rp="What is the size of your file offsets (in bytes)?"
8956 *_t) zzz="$fpostype" ;;
8959 $echo $n "Rechecking the size of $zzz...$c" >&4
8961 #include <sys/types.h>
8968 printf("%d\n", (int)sizeof($fpostype));
8973 if eval $compile_ok; then
8978 echo "(I can't execute the test program--guessing $fpossize.)" >&4
8981 echo " $fpossize bytes." >&4
8987 echo "(I can't compile the test program. Guessing...)" >&4
8988 rp="What is the size of your file positions (in bytes)?"
8997 case "$vendorprefix" in
8998 '') d_vendorbin="$undef"
9002 *) d_vendorbin="$define"
9003 : determine where vendor-supplied executables go.
9004 case "$vendorbin" in
9005 '') dflt=$vendorprefix/bin ;;
9006 *) dflt="$vendorbin" ;;
9009 rp='Pathname for the vendor-supplied executables directory?'
9012 vendorbinexp="$ansexp"
9018 case "$vendorprefix" in
9019 '') vendorhtml1dir=''
9020 vendorhtml1direxp=''
9022 *) : determine where vendor-supplied html pages go.
9023 : There is no standard location, so try to copy the previously-selected
9024 : directory structure for the core html pages.
9025 : XXX Better default suggestions would be welcome.
9026 case "$vendorhtml1dir" in
9027 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9028 *) dflt=$vendorhtml1dir ;;
9031 ''|' ') dflt=none ;;
9034 rp='Pathname for the vendor-supplied html pages?'
9036 vendorhtml1dir="$ans"
9037 vendorhtml1direxp="$ansexp"
9040 : Use ' ' for none so value is preserved next time through Configure
9041 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9042 prefixvar=vendorhtml1dir
9045 case "$vendorprefix" in
9046 '') vendorhtml3dir=''
9047 vendorhtml3direxp=''
9049 *) : determine where vendor-supplied module html pages go.
9050 : There is no standard location, so try to copy the previously-selected
9051 : directory structure for the core html pages.
9052 : XXX Better default suggestions would be welcome.
9053 case "$vendorhtml3dir" in
9054 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9055 *) dflt=$vendorhtml3dir ;;
9058 ''|' ') dflt=none ;;
9061 rp='Pathname for the vendor-supplied html pages?'
9063 vendorhtml3dir="$ans"
9064 vendorhtml3direxp="$ansexp"
9067 : Use ' ' for none so value is preserved next time through Configure
9068 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9069 prefixvar=vendorhtml3dir
9072 case "$vendorprefix" in
9073 '') vendorman1dir=''
9076 *) : determine where vendor-supplied manual pages go.
9077 case "$vendorman1dir" in
9078 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9079 *) dflt=$vendorman1dir ;;
9082 ''|' ') dflt=none ;;
9085 rp='Pathname for the vendor-supplied manual section 1 pages?'
9087 vendorman1dir="$ans"
9088 vendorman1direxp="$ansexp"
9091 : Use ' ' for none so value is preserved next time through Configure
9092 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9093 prefixvar=vendorman1dir
9096 case "$vendorprefix" in
9097 '') vendorman3dir=''
9100 *) : determine where vendor-supplied module manual pages go.
9101 case "$vendorman3dir" in
9102 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9103 *) dflt=$vendorman3dir ;;
9106 ''|' ') dflt=none ;;
9109 rp='Pathname for the vendor-supplied manual section 3 pages?'
9111 vendorman3dir="$ans"
9112 vendorman3direxp="$ansexp"
9115 : Use ' ' for none so value is preserved next time through Configure
9116 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9117 prefixvar=vendorman3dir
9120 case "$vendorprefix" in
9121 '') d_vendorscript="$undef"
9125 *) d_vendorscript="$define"
9126 : determine where vendor-supplied scripts go.
9127 case "$vendorscript" in
9128 '') dflt=$vendorprefix/script
9129 $test -d $dflt || dflt=$vendorbin ;;
9130 *) dflt="$vendorscript" ;;
9134 The installation process will create a directory for
9135 vendor-supplied scripts.
9139 rp='Pathname for the vendor-supplied scripts directory?'
9142 vendorscriptexp="$ansexp"
9145 prefixvar=vendorscript
9148 : see if qgcvt exists
9154 if $test X"$d_longdbl" = X"$define"; then
9156 echo "Checking how to print long doubles..." >&4
9158 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9159 $cat >try.c <<'EOCP'
9160 #include <sys/types.h>
9164 printf("%.3f\n", d);
9168 if eval $compile; then
9172 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9173 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9174 echo "We will use %f."
9180 if $test X"$sPRIfldbl" = X; then
9181 $cat >try.c <<'EOCP'
9182 #include <sys/types.h>
9185 long double d = 123.456;
9186 printf("%.3Lf\n", d);
9190 if eval $compile; then
9194 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9195 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9196 echo "We will use %Lf."
9202 if $test X"$sPRIfldbl" = X; then
9203 $cat >try.c <<'EOCP'
9204 #include <sys/types.h>
9207 long double d = 123.456;
9208 printf("%.3llf\n", d);
9212 if eval $compile; then
9216 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9217 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9218 echo "We will use %llf."
9224 if $test X"$sPRIfldbl" = X; then
9225 $cat >try.c <<'EOCP'
9226 #include <sys/types.h>
9229 long double d = 123.456;
9230 printf("%.3lf\n", d);
9234 if eval $compile; then
9238 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9239 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9240 echo "We will use %lf."
9246 if $test X"$sPRIfldbl" = X; then
9247 echo "Cannot figure out how to print long doubles." >&4
9249 sSCNfldbl=$sPRIfldbl # expect consistency
9256 case "$sPRIfldbl" in
9257 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9258 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9259 d_SCNfldbl="$undef";
9261 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9262 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9263 d_SCNfldbl="$define";
9267 : Check how to convert floats to strings.
9269 if test "X$d_Gconvert" = X; then
9272 echo "Checking for an efficient way to convert floats to strings."
9274 case "$uselongdouble" in
9275 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9277 case "$d_longdbl" in
9278 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9280 case "$d_PRIgldbl" in
9281 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9285 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9286 char *myname = "gconvert";
9289 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9290 char *myname = "gcvt";
9293 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9294 char *myname = "qgcvt";
9295 #define DOUBLETYPE long double
9298 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9300 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9302 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9305 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9307 char *myname = "sprintf";
9311 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9312 #define DOUBLETYPE long double
9314 #define DOUBLETYPE double
9320 #define I_STDLIB $i_stdlib
9326 checkit(expect, got)
9330 if (strcmp(expect, got)) {
9331 printf("%s oddity: Expected %s, got %s\n",
9332 myname, expect, got);
9342 /* This must be 1st test on (which?) platform */
9343 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9344 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9345 checkit("0.1", buf);
9347 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9348 checkit("0.01", buf);
9350 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9351 checkit("0.001", buf);
9353 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9354 checkit("0.0001", buf);
9356 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9357 if (strlen(buf) > 5)
9358 checkit("9e-005", buf); /* for Microsoft ?? */
9360 checkit("9e-05", buf);
9362 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9365 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9366 checkit("1.1", buf);
9368 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9369 checkit("1.01", buf);
9371 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9372 checkit("1.001", buf);
9374 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9375 checkit("1.0001", buf);
9377 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9378 checkit("1.00001", buf);
9380 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9381 checkit("1.000001", buf);
9383 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9386 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9389 /* Some Linux gcvt's give 1.e+5 here. */
9390 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9391 checkit("100000", buf);
9393 /* Some Linux gcvt's give -1.e+5 here. */
9394 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9395 checkit("-100000", buf);
9397 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9398 checkit("123.456", buf);
9400 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9401 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9402 /* 34 should be enough to scare even long double
9403 * places into using the e notation. */
9404 if (strlen(buf) > 5)
9405 checkit("1e+034", buf); /* for Microsoft */
9407 checkit("1e+34", buf);
9409 /* For Perl, if you add additional tests here, also add them to
9410 * t/base/num.t for benefit of platforms not using Configure or
9411 * overriding d_Gconvert */
9416 : first add preferred functions to our list
9418 for xxx_convert in $gconvert_preference; do
9419 case $xxx_convert in
9420 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9421 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9424 : then add any others
9425 for xxx_convert in gconvert gcvt sprintf; do
9428 *) xxx_list="$xxx_list $xxx_convert" ;;
9432 case "$d_longdbl$uselongdouble" in
9434 : again, add prefered functions to our list first
9436 for xxx_convert in $gconvert_ld_preference; do
9437 case $xxx_convert in
9438 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9439 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9442 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9443 for xxx_convert in qgcvt sprintf $xxx_list; do
9444 case "$xxx_ld_list" in
9445 $xxx_convert*|*" $xxx_convert"*) ;;
9446 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9449 : if sprintf cannot do long doubles, move it to the end
9450 if test "$d_PRIgldbl" != "$define"; then
9451 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9453 : if no qgcvt, remove it
9454 if test "$d_qgcvt" != "$define"; then
9455 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9458 xxx_list="$xxx_ld_list"
9462 for xxx_convert in $xxx_list; do
9463 echo "Trying $xxx_convert..."
9465 set try -DTRY_$xxx_convert
9466 if eval $compile; then
9467 echo "$xxx_convert() found." >&4
9469 echo "I'll use $xxx_convert to convert floats into a string." >&4
9472 echo "...But $xxx_convert didn't work as I expected."
9476 echo "$xxx_convert NOT found." >&4
9480 if test X$xxx_convert = X; then
9481 echo "*** WHOA THERE!!! ***" >&4
9482 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9486 case "$xxx_convert" in
9487 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9488 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9489 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9490 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9491 "$define$define$define")
9492 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9493 "$define$define$undef")
9494 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9495 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9502 : see if _fwalk exists
9506 : Initialize h_fcntl
9509 : Initialize h_sysfile
9512 : access call always available on UNIX
9516 : locate the flags for 'access()'
9520 $cat >access.c <<EOCP
9521 #include <sys/types.h>
9526 #include <sys/file.h>
9539 : check sys/file.h first, no particular reason here
9540 if $test `./findhdr sys/file.h` && \
9541 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9543 echo "<sys/file.h> defines the *_OK access constants." >&4
9544 elif $test `./findhdr fcntl.h` && \
9545 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9547 echo "<fcntl.h> defines the *_OK access constants." >&4
9548 elif $test `./findhdr unistd.h` && \
9549 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9550 echo "<unistd.h> defines the *_OK access constants." >&4
9552 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9558 : see if accessx exists
9559 set accessx d_accessx
9562 : see if aintl exists
9566 : see if alarm exists
9570 : see if POSIX threads are available
9571 set pthread.h i_pthread
9574 : define a fucntion to check prototypes
9575 $cat > protochk <<EOSH
9578 optimize="$optimize"
9580 prototype="$prototype"
9583 usethreads=$usethreads
9584 i_pthread=$i_pthread
9585 pthread_h_first=$pthread_h_first
9588 $cat >> protochk <<'EOSH'
9593 while test $# -ge 2; do
9595 $define) echo "#include <$2>" >> try.c ;;
9596 literal) echo "$2" >> try.c ;;
9598 # Extra magic for the benefit of systems that need pthread.h
9599 # to be included early to correctly detect threadsafe functions.
9600 # Such functions must guarantee themselves, though, that the usethreads
9601 # and i_pthread have been defined, before calling protochk.
9602 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
9603 echo "#include <pthread.h>" >> try.c
9608 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
9609 cat >> try.c <<'EOCP'
9610 #ifdef CAN_PROTOTYPE
9611 #define _(args) args
9616 echo "$foo" >> try.c
9617 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
9618 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
9626 hasproto='varname=$1; func=$2; shift; shift;
9627 while $test $# -ge 2; do
9629 $define) echo "#include <$2>";;
9633 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
9634 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
9635 echo "$func() prototype found.";
9638 echo "$func() prototype NOT found.";
9643 $rm -f try.c tryout.c'
9645 : see if sys/types.h has to be included
9646 set sys/types.h i_systypes
9649 : see if sys/select.h has to be included
9650 set sys/select.h i_sysselct
9653 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
9654 while $test $# -ge 2; do
9656 $define) echo "#include <$2>";;
9660 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
9662 if eval $compile; then
9671 : see if we should include time.h, sys/time.h, or both
9673 if test "X$timeincl" = X; then
9674 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9675 $echo $n "I'm now running the test program...$c"
9677 #include <sys/types.h>
9682 #ifdef SYSTIMEKERNEL
9685 #include <sys/time.h>
9688 #include <sys/select.h>
9701 struct timezone tzp;
9703 if (foo.tm_sec == foo.tm_sec)
9706 if (bar.tv_sec == bar.tv_sec)
9713 for s_timezone in '-DS_TIMEZONE' ''; do
9715 for s_timeval in '-DS_TIMEVAL' ''; do
9716 for i_systimek in '' '-DSYSTIMEKERNEL'; do
9717 for i_time in '' '-DI_TIME'; do
9718 for i_systime in '-DI_SYSTIME' ''; do
9721 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
9722 if eval $compile; then
9723 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
9727 $echo $n "Succeeded with $flags$c"
9739 *SYSTIMEKERNEL*) i_systimek="$define"
9740 timeincl=`./findhdr sys/time.h`
9741 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
9742 *) i_systimek="$undef";;
9745 *I_TIME*) i_time="$define"
9746 timeincl=`./findhdr time.h`" $timeincl"
9747 echo "We'll include <time.h>." >&4;;
9748 *) i_time="$undef";;
9751 *I_SYSTIME*) i_systime="$define"
9752 timeincl=`./findhdr sys/time.h`" $timeincl"
9753 echo "We'll include <sys/time.h>." >&4;;
9754 *) i_systime="$undef";;
9758 : see if struct tm knows about tm_zone
9759 case "$i_systime$i_time" in
9762 echo "Checking to see if your struct tm has tm_zone field..." >&4
9763 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
9771 case "$d_tm_tm_zone" in
9772 "$define") echo "Yes, it does." ;;
9773 *) echo "No, it doesn't." ;;
9775 : see if struct tm knows about tm_gmtoff
9776 case "$i_systime$i_time" in
9779 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
9780 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
9788 case "$d_tm_tm_gmtoff" in
9789 "$define") echo "Yes, it does." ;;
9790 *) echo "No, it doesn't." ;;
9793 : see if asctime_r exists
9794 set asctime_r d_asctime_r
9796 case "$d_asctime_r" in
9798 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
9799 case "$d_asctime_r_proto:$usethreads" in
9800 ":define") d_asctime_r_proto=define
9801 set d_asctime_r_proto asctime_r $hdrs
9805 case "$d_asctime_r_proto" in
9807 case "$asctime_r_proto" in
9808 ''|0) try='char* asctime_r(const struct tm*, char*);'
9809 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SB ;;
9811 case "$asctime_r_proto" in
9812 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
9813 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SBI ;;
9815 case "$asctime_r_proto" in
9816 ''|0) try='int asctime_r(const struct tm*, char*);'
9817 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SB ;;
9819 case "$asctime_r_proto" in
9820 ''|0) try='int asctime_r(const struct tm*, char*, int);'
9821 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SBI ;;
9823 case "$asctime_r_proto" in
9824 ''|0) d_asctime_r=undef
9826 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
9827 * ) case "$asctime_r_proto" in
9828 REENTRANT_PROTO*) ;;
9829 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
9831 echo "Prototype: $try" ;;
9834 *) case "$usethreads" in
9835 define) echo "asctime_r has no prototype, not using it." >&4 ;;
9842 *) asctime_r_proto=0
9846 : see if atolf exists
9850 : see if atoll exists
9854 : Look for GCC-style attribute format
9855 case "$d_attribute_format" in
9858 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
9859 $cat >attrib.c <<'EOCP'
9861 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
9863 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9864 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9865 echo "Your C compiler doesn't support __attribute__((format))."
9868 echo "Your C compiler supports __attribute__((format))."
9872 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9876 *) val="$d_attribute_format" ;;
9878 set d_attribute_format
9882 : Look for GCC-style attribute malloc
9883 case "$d_attribute_malloc" in
9886 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
9887 $cat >attrib.c <<'EOCP'
9889 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
9891 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9892 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9893 echo "Your C compiler doesn't support __attribute__((malloc))."
9896 echo "Your C compiler supports __attribute__((malloc))."
9900 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9904 *) val="$d_attribute_malloc" ;;
9906 set d_attribute_malloc
9910 : Look for GCC-style attribute nonnull
9911 case "$d_attribute_nonnull" in
9914 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
9915 $cat >attrib.c <<'EOCP'
9917 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
9919 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9920 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9921 echo "Your C compiler doesn't support __attribute__((nonnull))."
9924 echo "Your C compiler supports __attribute__((nonnull))."
9928 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9932 *) val="$d_attribute_nonnull" ;;
9934 set d_attribute_nonnull
9938 : Look for GCC-style attribute noreturn
9939 case "$d_attribute_noreturn" in
9942 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
9943 $cat >attrib.c <<'EOCP'
9945 void fall_over_dead( void ) __attribute__((noreturn));
9947 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9948 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9949 echo "Your C compiler doesn't support __attribute__((noreturn))."
9952 echo "Your C compiler supports __attribute__((noreturn))."
9956 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9960 *) val="$d_attribute_noreturn" ;;
9962 set d_attribute_noreturn
9966 : Look for GCC-style attribute pure
9967 case "$d_attribute_pure" in
9970 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
9971 $cat >attrib.c <<'EOCP'
9973 int square( int n ) __attribute__((pure));
9975 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9976 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9977 echo "Your C compiler doesn't support __attribute__((pure))."
9980 echo "Your C compiler supports __attribute__((pure))."
9984 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9988 *) val="$d_attribute_pure" ;;
9990 set d_attribute_pure
9994 : Look for GCC-style attribute unused
9995 case "$d_attribute_unused" in
9998 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
9999 $cat >attrib.c <<'EOCP'
10001 int do_something( int dummy __attribute__((unused)), int n );
10003 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10004 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10005 echo "Your C compiler doesn't support __attribute__((unused))."
10008 echo "Your C compiler supports __attribute__((unused))."
10012 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10016 *) val="$d_attribute_unused" ;;
10018 set d_attribute_unused
10022 : Look for GCC-style attribute warn_unused_result
10023 case "$d_attribute_warn_unused_result" in
10026 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10027 $cat >attrib.c <<'EOCP'
10029 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10031 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10032 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10033 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10036 echo "Your C compiler supports __attribute__((warn_unused_result))."
10040 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10044 *) val="$d_attribute_warn_unused_result" ;;
10046 set d_attribute_warn_unused_result
10050 : see if bcmp exists
10054 : see if bcopy exists
10058 : see if this is a unistd.h system
10059 set unistd.h i_unistd
10062 : see if getpgrp exists
10063 set getpgrp d_getpgrp
10066 case "$d_getpgrp" in
10069 echo "Checking to see which flavor of getpgrp is in use..."
10071 #$i_unistd I_UNISTD
10072 #include <sys/types.h>
10074 # include <unistd.h>
10076 #$i_stdlib I_STDLIB
10078 #include <stdlib.h>
10082 if (getuid() == 0) {
10083 printf("(I see you are running Configure as super-user...)\n");
10086 #ifdef TRY_BSD_PGRP
10087 if (getpgrp(1) == 0)
10096 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10097 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10099 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10100 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10103 echo "I can't seem to compile and run the test program."
10105 xxx="a USG one, i.e. you use getpgrp()."
10107 # SVR4 systems can appear rather BSD-ish.
10108 case "$i_unistd" in
10110 xxx="a BSD one, i.e. you use getpgrp(pid)."
10114 xxx="probably a USG one, i.e. you use getpgrp()."
10119 echo "Assuming your getpgrp is $xxx" >&4
10128 : see if setpgrp exists
10129 set setpgrp d_setpgrp
10132 case "$d_setpgrp" in
10135 echo "Checking to see which flavor of setpgrp is in use..."
10137 #$i_unistd I_UNISTD
10138 #include <sys/types.h>
10140 # include <unistd.h>
10142 #$i_stdlib I_STDLIB
10144 #include <stdlib.h>
10148 if (getuid() == 0) {
10149 printf("(I see you are running Configure as super-user...)\n");
10152 #ifdef TRY_BSD_PGRP
10153 if (-1 == setpgrp(1, 1))
10156 if (setpgrp() != -1)
10162 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10163 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10165 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10166 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10169 echo "(I can't seem to compile and run the test program.)"
10171 xxx="a USG one, i.e. you use setpgrp()."
10173 # SVR4 systems can appear rather BSD-ish.
10174 case "$i_unistd" in
10176 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10180 xxx="probably a USG one, i.e. you use setpgrp()."
10185 echo "Assuming your setpgrp is $xxx" >&4
10193 : Look for GCC-style __builtin_choose_expr
10194 case "$d_builtin_choose_expr" in
10197 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10198 $cat >try.c <<'EOCP'
10199 #include <assert.h>
10200 #include <stdlib.h>
10203 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10206 assert( SYRINX(1) == 2112 );
10207 assert( SYRINX(1) != 5150 );
10208 assert( SYRINX(0) == 5150 );
10209 assert( SYRINX(0) != 2112 );
10210 puts( "All good!" );
10216 if eval $compile; then
10217 echo "Your C compiler supports __builtin_choose_expr."
10220 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10224 *) val="$d_builtin_choose_expr" ;;
10227 set d_builtin_choose_expr
10229 $rm -f try.* try core core.try.*
10231 : Look for GCC-style __builtin_expect
10232 case "$d_builtin_expect" in
10235 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10236 $cat >builtin.c <<'EOCP'
10239 if ( __builtin_expect(n, 0) ) n = 1;
10243 if eval $compile; then
10244 echo "Your C compiler supports __builtin_choose_expr."
10247 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10251 *) val="$d_builtin_expect" ;;
10254 set d_builtin_expect
10256 $rm -f try.* try core core.try.*
10258 : see if bzero exists
10262 : see if signal is declared as pointer to function returning int or void
10264 xxx=`./findhdr signal.h`
10265 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10266 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10267 echo "You have int (*signal())() instead of void." >&4
10269 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10270 echo "You have void (*signal())()." >&4
10272 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10273 echo "You have int (*signal())() instead of void." >&4
10275 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10276 echo "You have void (*signal())()." >&4
10279 case "$d_voidsig" in
10281 echo "I can't determine whether signal handler returns void or int..." >&4
10283 rp="What type does your signal handler return?"
10286 v*) val="$define";;
10290 echo "As you already told me, signal handler returns void." >&4
10293 *) echo "As you already told me, signal handler returns int." >&4
10300 case "$d_voidsig" in
10301 "$define") signal_t="void";;
10302 *) signal_t="int";;
10306 : check for ability to cast large floats to 32-bit ints.
10308 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10309 if $test "$intsize" -ge 4; then
10316 #$i_stdlib I_STDLIB
10318 #include <stdlib.h>
10320 #include <sys/types.h>
10321 #include <signal.h>
10322 $signal_t blech(s) int s; { exit(3); }
10329 signal(SIGFPE, blech);
10331 /* Don't let compiler optimize the test away. Store the number
10332 in a writable string for gcc to pass to sscanf under HP/UX.
10334 sprintf(str, "2147483647");
10335 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
10339 /* x86 processors will probably give 0x8000 0000, which is a
10340 sign change. We don't want that. We want to mimic SPARC
10341 behavior here, which is to preserve the sign and give
10344 if (i32 != ($xxx) f)
10350 if eval $compile_ok; then
10354 echo "(I can't seem to compile the test program--assuming it can't)"
10359 echo "Yup, it can."
10362 echo "Nope, it can't."
10369 : check for ability to cast negative floats to unsigned
10371 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
10374 #$i_stdlib I_STDLIB
10376 #include <stdlib.h>
10378 #include <sys/types.h>
10379 #include <signal.h>
10380 $signal_t blech(s) int s; { exit(7); }
10381 $signal_t blech_in_list(s) int s; { exit(4); }
10382 unsigned long dummy_long(p) unsigned long p; { return p; }
10383 unsigned int dummy_int(p) unsigned int p; { return p; }
10384 unsigned short dummy_short(p) unsigned short p; { return p; }
10388 unsigned long along;
10390 unsigned short ashort;
10394 /* Frustrate gcc-2.7.2's optimizer which failed this test with
10395 a direct f = -123. assignment. gcc-2.8.0 reportedly
10396 optimized the whole file away
10398 /* Store the number in a writable string for gcc to pass to
10399 sscanf under HP/UX.
10401 sprintf(str, "-123");
10402 sscanf(str, "%lf", &f); /* f = -123.; */
10404 signal(SIGFPE, blech);
10405 along = (unsigned long)f;
10406 aint = (unsigned int)f;
10407 ashort = (unsigned short)f;
10408 if (along != (unsigned long)-123)
10410 if (aint != (unsigned int)-123)
10412 if (ashort != (unsigned short)-123)
10414 sprintf(str, "1073741824.");
10415 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
10418 along = (unsigned long)f;
10419 if (along != 0x80000000)
10423 along = (unsigned long)f;
10424 if (along != 0x7fffffff)
10428 along = (unsigned long)f;
10429 if (along != 0x80000001)
10433 signal(SIGFPE, blech_in_list);
10434 sprintf(str, "123.");
10435 sscanf(str, "%lf", &f); /* f = 123.; */
10436 along = dummy_long((unsigned long)f);
10437 aint = dummy_int((unsigned int)f);
10438 ashort = dummy_short((unsigned short)f);
10439 if (along != (unsigned long)123)
10441 if (aint != (unsigned int)123)
10443 if (ashort != (unsigned short)123)
10450 if eval $compile_ok; then
10454 echo "(I can't seem to compile the test program--assuming it can't)"
10457 case "$castflags" in
10459 echo "Yup, it can."
10462 echo "Nope, it can't."
10469 : see if vprintf exists
10471 if set vprintf val -f d_vprintf; eval $csym; $val; then
10472 echo 'vprintf() found.' >&4
10475 #include <varargs.h>
10476 #$i_stdlib I_STDLIB
10478 #include <stdlib.h>
10481 int main() { xxx("foo"); }
10490 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
10494 if eval $compile && $run ./try; then
10495 echo "Your vsprintf() returns (int)." >&4
10498 echo "Your vsprintf() returns (char*)." >&4
10502 echo 'vprintf() NOT found.' >&4
10513 : see if chown exists
10517 : see if chroot exists
10518 set chroot d_chroot
10521 : see if chsize exists
10522 set chsize d_chsize
10525 : see if class exists
10529 : see if clearenv exists
10530 set clearenv d_clearenv
10533 hasstruct='varname=$1; struct=$2; shift; shift;
10534 while $test $# -ge 2; do
10536 $define) echo "#include <$2>";;
10540 echo "int main () { struct $struct foo; }" >> try.c;
10542 if eval $compile; then
10549 $rm -f try.c try.o'
10553 : see whether socket exists
10555 $echo $n "Hmm... $c" >&4
10556 if set socket val -f d_socket; eval $csym; $val; then
10557 echo "Looks like you have Berkeley networking support." >&4
10559 if set setsockopt val -f; eval $csym; $val; then
10562 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
10563 d_oldsock="$define"
10566 if $contains socklib libc.list >/dev/null 2>&1; then
10567 echo "Looks like you have Berkeley networking support." >&4
10569 : we will have to assume that it supports the 4.2 BSD interface
10572 echo "You don't have Berkeley networking in libc$_a..." >&4
10573 if test "X$d_socket" = "X$define"; then
10574 echo "...but you seem to believe that you have sockets." >&4
10576 for net in net socket
10578 if test -f /usr/lib/lib$net$_a; then
10579 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
10580 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
10581 if $contains socket libc.list >/dev/null 2>&1; then
10586 echo "...but the Wollongong group seems to have hacked it in." >&4
10587 sockethdr="-I/usr/netinclude"
10590 echo "Found Berkeley sockets interface in lib$net." >&4
10591 if $contains setsockopt libc.list >/dev/null 2>&1; then
10594 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
10595 d_oldsock="$define"
10601 if test "X$d_socket" != "X$define"; then
10602 echo "or anywhere else I see." >&4
10610 : see if socketpair exists
10611 set socketpair d_sockpair
10616 echo "Checking the availability of certain socket constants..." >&4
10617 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
10618 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
10620 #include <sys/types.h>
10621 #include <sys/socket.h>
10627 set try; if eval $compile; then
10630 set d_${enum}; eval $setvar
10634 : see if this is a sys/uio.h system
10635 set sys/uio.h i_sysuio
10640 echo "Checking to see if your system supports struct cmsghdr..." >&4
10641 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
10643 case "$d_cmsghdr_s" in
10644 "$define") echo "Yes, it does." ;;
10645 *) echo "No, it doesn't." ;;
10649 : check for const keyword
10651 echo 'Checking to see if your C compiler knows about "const"...' >&4
10652 $cat >const.c <<'EOCP'
10653 typedef struct spug { int drokk; } spug;
10660 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
10662 echo "Yup, it does."
10665 echo "Nope, it doesn't."
10670 : see if copysignl exists
10671 set copysignl d_copysignl
10674 : see if crypt exists
10679 $define) cryptlib='' ;;
10680 *) if set crypt val -f d_crypt; eval $csym; $val; then
10681 echo 'crypt() found.' >&4
10685 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
10686 if $test -z "$cryptlib"; then
10687 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
10691 if $test -z "$cryptlib"; then
10692 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
10696 if $test -z "$cryptlib"; then
10697 cryptlib=`./loc libcrypt$_a "" $libpth`
10701 if $test -z "$cryptlib"; then
10702 echo 'crypt() NOT found.' >&4
10713 : see if this is a crypt.h system
10714 set crypt.h i_crypt
10717 : see if crypt_r exists
10718 set crypt_r d_crypt_r
10720 case "$d_crypt_r" in
10722 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
10723 case "$d_crypt_r_proto:$usethreads" in
10724 ":define") d_crypt_r_proto=define
10725 set d_crypt_r_proto crypt_r $hdrs
10729 case "$d_crypt_r_proto" in
10731 case "$crypt_r_proto" in
10732 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
10733 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCS ;;
10735 case "$crypt_r_proto" in
10736 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
10737 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCD ;;
10739 case "$crypt_r_proto" in
10740 ''|0) d_crypt_r=undef
10742 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
10743 * ) case "$crypt_r_proto" in
10744 REENTRANT_PROTO*) ;;
10745 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
10747 echo "Prototype: $try" ;;
10750 *) case "$usethreads" in
10751 define) echo "crypt_r has no prototype, not using it." >&4 ;;
10762 : get csh whereabouts
10764 'csh') val="$undef" ;;
10765 *) val="$define" ;;
10769 : Respect a hint or command line value for full_csh.
10770 case "$full_csh" in
10771 '') full_csh=$csh ;;
10774 : see if ctermid_r exists
10775 set ctermid_r d_ctermid_r
10777 case "$d_ctermid_r" in
10779 hdrs="$i_systypes sys/types.h define stdio.h "
10780 case "$d_ctermid_r_proto:$usethreads" in
10781 ":define") d_ctermid_r_proto=define
10782 set d_ctermid_r_proto ctermid_r $hdrs
10786 case "$d_ctermid_r_proto" in
10788 case "$ctermid_r_proto" in
10789 ''|0) try='char* ctermid_r(char*);'
10790 ./protochk "extern $try" $hdrs && ctermid_r_proto=B_B ;;
10792 case "$ctermid_r_proto" in
10793 ''|0) d_ctermid_r=undef
10795 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
10796 * ) case "$ctermid_r_proto" in
10797 REENTRANT_PROTO*) ;;
10798 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
10800 echo "Prototype: $try" ;;
10803 *) case "$usethreads" in
10804 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
10811 *) ctermid_r_proto=0
10815 : see if ctime_r exists
10816 set ctime_r d_ctime_r
10818 case "$d_ctime_r" in
10820 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10821 case "$d_ctime_r_proto:$usethreads" in
10822 ":define") d_ctime_r_proto=define
10823 set d_ctime_r_proto ctime_r $hdrs
10827 case "$d_ctime_r_proto" in
10829 case "$ctime_r_proto" in
10830 ''|0) try='char* ctime_r(const time_t*, char*);'
10831 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SB ;;
10833 case "$ctime_r_proto" in
10834 ''|0) try='char* ctime_r(const time_t*, char*, int);'
10835 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SBI ;;
10837 case "$ctime_r_proto" in
10838 ''|0) try='int ctime_r(const time_t*, char*);'
10839 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SB ;;
10841 case "$ctime_r_proto" in
10842 ''|0) try='int ctime_r(const time_t*, char*, int);'
10843 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SBI ;;
10845 case "$ctime_r_proto" in
10846 ''|0) d_ctime_r=undef
10848 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
10849 * ) case "$ctime_r_proto" in
10850 REENTRANT_PROTO*) ;;
10851 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
10853 echo "Prototype: $try" ;;
10856 *) case "$usethreads" in
10857 define) echo "ctime_r has no prototype, not using it." >&4 ;;
10868 : see if cuserid exists
10869 set cuserid d_cuserid
10872 : see if this is a limits.h system
10873 set limits.h i_limits
10876 : see if this is a float.h system
10877 set float.h i_float
10880 : See if number of significant digits in a double precision number is known
10882 $cat >dbl_dig.c <<EOM
10883 #$i_limits I_LIMITS
10886 #include <limits.h>
10892 printf("Contains DBL_DIG");
10895 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
10896 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
10897 echo "DBL_DIG found." >&4
10900 echo "DBL_DIG NOT found." >&4
10907 : see if dbm.h is available
10908 : see if dbmclose exists
10909 set dbmclose d_dbmclose
10912 case "$d_dbmclose" in
10922 *) set rpcsvc/dbm.h i_rpcsvcdbm
10927 *) echo "We won't be including <dbm.h>"
10937 : see if prototype for dbminit is available
10939 set d_dbminitproto dbminit $i_dbm dbm.h
10942 : see if difftime exists
10943 set difftime d_difftime
10946 : see if this is a dirent system
10948 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
10950 echo "<dirent.h> found." >&4
10953 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
10954 echo "<sys/dir.h> found." >&4
10957 xinc=`./findhdr sys/ndir.h`
10959 echo "<dirent.h> NOT found." >&4
10964 : Look for type of directory structure.
10966 $cppstdin $cppflags $cppminus < "$xinc" > try.c
10968 case "$direntrytype" in
10970 case "$i_dirent" in
10971 $define) guess1='struct dirent' ;;
10972 *) guess1='struct direct' ;;
10975 *) guess1="$direntrytype"
10980 'struct dirent') guess2='struct direct' ;;
10981 *) guess2='struct dirent' ;;
10984 if $contains "$guess1" try.c >/dev/null 2>&1; then
10985 direntrytype="$guess1"
10986 echo "Your directory entries are $direntrytype." >&4
10987 elif $contains "$guess2" try.c >/dev/null 2>&1; then
10988 direntrytype="$guess2"
10989 echo "Your directory entries seem to be $direntrytype." >&4
10991 echo "I don't recognize your system's directory entries." >&4
10992 rp="What type is used for directory entries on this system?"
10995 direntrytype="$ans"
11000 : see if the directory entry stores field length
11002 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11003 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
11004 echo "Good, your directory entry keeps length information in d_namlen." >&4
11007 echo "Your directory entry does not know about the d_namlen field." >&4
11014 : see if this is an sysdir system
11015 set sys/dir.h i_sysdir
11018 : see if this is an sysndir system
11019 set sys/ndir.h i_sysndir
11024 $cat >dirfd.c <<EOM
11026 #$i_stdlib I_STDLIB
11028 #include <stdlib.h>
11030 #$i_dirent I_DIRENT /**/
11031 #$i_sysdir I_SYS_DIR /**/
11032 #$i_sysndir I_SYS_NDIR /**/
11033 #$i_systypes I_SYS_TYPES /**/
11034 #if defined(I_SYS_TYPES)
11035 #include <sys/types.h>
11037 #if defined(I_DIRENT)
11038 #include <dirent.h>
11039 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11040 #include <sys/dir.h>
11044 #include <sys/ndir.h>
11048 #include <ndir.h> /* may be wrong in the future */
11050 #include <sys/dir.h>
11056 DIR *dirp = opendir(".");
11057 if (dirfd(dirp) >= 0)
11065 if eval $compile; then
11069 $define) echo "dirfd() found." >&4 ;;
11070 *) echo "dirfd() NOT found." >&4 ;;
11076 : see if dlerror exists
11079 set dlerror d_dlerror
11083 : see if dlfcn is available
11084 set dlfcn.h i_dlfcn
11091 On a few systems, the dynamically loaded modules that perl generates and uses
11092 will need a different extension than shared libs. The default will probably
11098 *) dflt="$dlext" ;;
11100 rp='What is the extension of dynamically loaded modules'
11109 : Check if dlsym need a leading underscore
11115 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11116 $cat >dyna.c <<'EOM'
11123 #$i_stdlib I_STDLIB
11125 #include <stdlib.h>
11129 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
11131 #include <sys/types.h>
11136 extern int fred() ;
11145 int mode = RTLD_LAZY ;
11147 handle = dlopen("./dyna.$dlext", mode) ;
11148 if (handle == NULL) {
11153 symbol = dlsym(handle, "fred") ;
11154 if (symbol == NULL) {
11155 /* try putting a leading underscore */
11156 symbol = dlsym(handle, "_fred") ;
11157 if (symbol == NULL) {
11170 : Call the object file tmp-dyna.o in case dlext=o.
11171 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
11172 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
11173 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
11174 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
11177 1) echo "Test program failed using dlopen." >&4
11178 echo "Perhaps you should not use dynamic loading." >&4;;
11179 2) echo "Test program failed using dlsym." >&4
11180 echo "Perhaps you should not use dynamic loading." >&4;;
11181 3) echo "dlsym needs a leading underscore" >&4
11183 4) echo "dlsym doesn't need a leading underscore." >&4;;
11186 echo "I can't compile and run the test program." >&4
11187 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
11192 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
11197 : see if drand48_r exists
11198 set drand48_r d_drand48_r
11200 case "$d_drand48_r" in
11202 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
11203 case "$d_drand48_r_proto:$usethreads" in
11204 ":define") d_drand48_r_proto=define
11205 set d_drand48_r_proto drand48_r $hdrs
11209 case "$d_drand48_r_proto" in
11211 case "$drand48_r_proto" in
11212 ''|0) try='int drand48_r(struct drand48_data*, double*);'
11213 ./protochk "extern $try" $hdrs && drand48_r_proto=I_ST ;;
11215 case "$drand48_r_proto" in
11216 ''|0) d_drand48_r=undef
11218 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
11219 * ) case "$drand48_r_proto" in
11220 REENTRANT_PROTO*) ;;
11221 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
11223 echo "Prototype: $try" ;;
11226 *) case "$usethreads" in
11227 define) echo "drand48_r has no prototype, not using it." >&4 ;;
11234 *) drand48_r_proto=0
11238 : see if prototype for drand48 is available
11240 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
11243 : see if dup2 exists
11247 : see if eaccess exists
11248 set eaccess d_eaccess
11251 : see if endgrent exists
11252 set endgrent d_endgrent
11255 : see if this is an grp system
11261 xxx=`./findhdr grp.h`
11262 $cppstdin $cppflags $cppminus < $xxx >$$.h
11264 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
11276 set d_grpasswd; eval $setvar
11280 : see if endgrent_r exists
11281 set endgrent_r d_endgrent_r
11283 case "$d_endgrent_r" in
11285 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11286 case "$d_endgrent_r_proto:$usethreads" in
11287 ":define") d_endgrent_r_proto=define
11288 set d_endgrent_r_proto endgrent_r $hdrs
11292 case "$d_endgrent_r_proto" in
11294 case "$endgrent_r_proto" in
11295 ''|0) try='int endgrent_r(FILE**);'
11296 ./protochk "extern $try" $hdrs && endgrent_r_proto=I_H ;;
11298 case "$endgrent_r_proto" in
11299 ''|0) try='void endgrent_r(FILE**);'
11300 ./protochk "extern $try" $hdrs && endgrent_r_proto=V_H ;;
11302 case "$endgrent_r_proto" in
11303 ''|0) d_endgrent_r=undef
11305 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
11306 * ) case "$endgrent_r_proto" in
11307 REENTRANT_PROTO*) ;;
11308 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
11310 echo "Prototype: $try" ;;
11313 *) case "$usethreads" in
11314 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
11321 *) endgrent_r_proto=0
11325 : see if endhostent exists
11326 set endhostent d_endhent
11329 : see if this is a netdb.h system
11330 set netdb.h i_netdb
11333 : see if endhostent_r exists
11334 set endhostent_r d_endhostent_r
11336 case "$d_endhostent_r" in
11338 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11339 case "$d_endhostent_r_proto:$usethreads" in
11340 ":define") d_endhostent_r_proto=define
11341 set d_endhostent_r_proto endhostent_r $hdrs
11345 case "$d_endhostent_r_proto" in
11347 case "$endhostent_r_proto" in
11348 ''|0) try='int endhostent_r(struct hostent_data*);'
11349 ./protochk "extern $try" $hdrs && endhostent_r_proto=I_D ;;
11351 case "$endhostent_r_proto" in
11352 ''|0) try='void endhostent_r(struct hostent_data*);'
11353 ./protochk "extern $try" $hdrs && endhostent_r_proto=V_D ;;
11355 case "$endhostent_r_proto" in
11356 ''|0) d_endhostent_r=undef
11357 endhostent_r_proto=0
11358 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
11359 * ) case "$endhostent_r_proto" in
11360 REENTRANT_PROTO*) ;;
11361 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
11363 echo "Prototype: $try" ;;
11366 *) case "$usethreads" in
11367 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
11369 d_endhostent_r=undef
11370 endhostent_r_proto=0
11374 *) endhostent_r_proto=0
11378 : see if endnetent exists
11379 set endnetent d_endnent
11382 : see if endnetent_r exists
11383 set endnetent_r d_endnetent_r
11385 case "$d_endnetent_r" in
11387 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11388 case "$d_endnetent_r_proto:$usethreads" in
11389 ":define") d_endnetent_r_proto=define
11390 set d_endnetent_r_proto endnetent_r $hdrs
11394 case "$d_endnetent_r_proto" in
11396 case "$endnetent_r_proto" in
11397 ''|0) try='int endnetent_r(struct netent_data*);'
11398 ./protochk "extern $try" $hdrs && endnetent_r_proto=I_D ;;
11400 case "$endnetent_r_proto" in
11401 ''|0) try='void endnetent_r(struct netent_data*);'
11402 ./protochk "extern $try" $hdrs && endnetent_r_proto=V_D ;;
11404 case "$endnetent_r_proto" in
11405 ''|0) d_endnetent_r=undef
11406 endnetent_r_proto=0
11407 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
11408 * ) case "$endnetent_r_proto" in
11409 REENTRANT_PROTO*) ;;
11410 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
11412 echo "Prototype: $try" ;;
11415 *) case "$usethreads" in
11416 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
11418 d_endnetent_r=undef
11419 endnetent_r_proto=0
11423 *) endnetent_r_proto=0
11427 : see if endprotoent exists
11428 set endprotoent d_endpent
11431 : see if endprotoent_r exists
11432 set endprotoent_r d_endprotoent_r
11434 case "$d_endprotoent_r" in
11436 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11437 case "$d_endprotoent_r_proto:$usethreads" in
11438 ":define") d_endprotoent_r_proto=define
11439 set d_endprotoent_r_proto endprotoent_r $hdrs
11443 case "$d_endprotoent_r_proto" in
11445 case "$endprotoent_r_proto" in
11446 ''|0) try='int endprotoent_r(struct protoent_data*);'
11447 ./protochk "extern $try" $hdrs && endprotoent_r_proto=I_D ;;
11449 case "$endprotoent_r_proto" in
11450 ''|0) try='void endprotoent_r(struct protoent_data*);'
11451 ./protochk "extern $try" $hdrs && endprotoent_r_proto=V_D ;;
11453 case "$endprotoent_r_proto" in
11454 ''|0) d_endprotoent_r=undef
11455 endprotoent_r_proto=0
11456 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
11457 * ) case "$endprotoent_r_proto" in
11458 REENTRANT_PROTO*) ;;
11459 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
11461 echo "Prototype: $try" ;;
11464 *) case "$usethreads" in
11465 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
11467 d_endprotoent_r=undef
11468 endprotoent_r_proto=0
11472 *) endprotoent_r_proto=0
11476 : see if endpwent exists
11477 set endpwent d_endpwent
11480 : see if this is a pwd.h system
11486 xxx=`./findhdr pwd.h`
11487 $cppstdin $cppflags $cppminus < $xxx >$$.h
11489 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
11497 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
11505 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
11513 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
11521 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
11529 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
11537 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
11545 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
11557 set d_pwquota; eval $setvar
11558 set d_pwage; eval $setvar
11559 set d_pwchange; eval $setvar
11560 set d_pwclass; eval $setvar
11561 set d_pwexpire; eval $setvar
11562 set d_pwcomment; eval $setvar
11563 set d_pwgecos; eval $setvar
11564 set d_pwpasswd; eval $setvar
11568 : see if endpwent_r exists
11569 set endpwent_r d_endpwent_r
11571 case "$d_endpwent_r" in
11573 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
11574 case "$d_endpwent_r_proto:$usethreads" in
11575 ":define") d_endpwent_r_proto=define
11576 set d_endpwent_r_proto endpwent_r $hdrs
11580 case "$d_endpwent_r_proto" in
11582 case "$endpwent_r_proto" in
11583 ''|0) try='int endpwent_r(FILE**);'
11584 ./protochk "extern $try" $hdrs && endpwent_r_proto=I_H ;;
11586 case "$endpwent_r_proto" in
11587 ''|0) try='void endpwent_r(FILE**);'
11588 ./protochk "extern $try" $hdrs && endpwent_r_proto=V_H ;;
11590 case "$endpwent_r_proto" in
11591 ''|0) d_endpwent_r=undef
11593 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
11594 * ) case "$endpwent_r_proto" in
11595 REENTRANT_PROTO*) ;;
11596 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
11598 echo "Prototype: $try" ;;
11601 *) case "$usethreads" in
11602 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
11609 *) endpwent_r_proto=0
11613 : see if endservent exists
11614 set endservent d_endsent
11617 : see if endservent_r exists
11618 set endservent_r d_endservent_r
11620 case "$d_endservent_r" in
11622 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11623 case "$d_endservent_r_proto:$usethreads" in
11624 ":define") d_endservent_r_proto=define
11625 set d_endservent_r_proto endservent_r $hdrs
11629 case "$d_endservent_r_proto" in
11631 case "$endservent_r_proto" in
11632 ''|0) try='int endservent_r(struct servent_data*);'
11633 ./protochk "extern $try" $hdrs && endservent_r_proto=I_D ;;
11635 case "$endservent_r_proto" in
11636 ''|0) try='void endservent_r(struct servent_data*);'
11637 ./protochk "extern $try" $hdrs && endservent_r_proto=V_D ;;
11639 case "$endservent_r_proto" in
11640 ''|0) d_endservent_r=undef
11641 endservent_r_proto=0
11642 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
11643 * ) case "$endservent_r_proto" in
11644 REENTRANT_PROTO*) ;;
11645 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
11647 echo "Prototype: $try" ;;
11650 *) case "$usethreads" in
11651 define) echo "endservent_r has no prototype, not using it." >&4 ;;
11653 d_endservent_r=undef
11654 endservent_r_proto=0
11658 *) endservent_r_proto=0
11662 : Locate the flags for 'open()'
11665 #include <sys/types.h>
11670 #include <sys/file.h>
11672 #$i_stdlib I_STDLIB
11674 #include <stdlib.h>
11685 : check sys/file.h first to get FREAD on Sun
11686 if $test `./findhdr sys/file.h` && \
11687 set try -DI_SYS_FILE && eval $compile; then
11689 echo "<sys/file.h> defines the O_* constants..." >&4
11690 if $run ./try; then
11691 echo "and you have the 3 argument form of open()." >&4
11694 echo "but not the 3 argument form of open(). Oh, well." >&4
11697 elif $test `./findhdr fcntl.h` && \
11698 set try -DI_FCNTL && eval $compile; then
11700 echo "<fcntl.h> defines the O_* constants..." >&4
11701 if $run ./try; then
11702 echo "and you have the 3 argument form of open()." >&4
11705 echo "but not the 3 argument form of open(). Oh, well." >&4
11710 echo "I can't find the O_* constant definitions! You got problems." >&4
11716 : see which of string.h or strings.h is needed
11718 strings=`./findhdr string.h`
11719 if $test "$strings" && $test -r "$strings"; then
11720 echo "Using <string.h> instead of <strings.h>." >&4
11724 strings=`./findhdr strings.h`
11725 if $test "$strings" && $test -r "$strings"; then
11726 echo "Using <strings.h> instead of <string.h>." >&4
11728 echo "No string header found -- You'll surely have problems." >&4
11733 case "$i_string" in
11734 "$undef") strings=`./findhdr strings.h`;;
11735 *) strings=`./findhdr string.h`;;
11738 : see if this is a sys/file.h system
11743 : do we need to include sys/file.h ?
11747 if $h_sysfile; then
11749 echo "We'll be including <sys/file.h>." >&4
11752 echo "We won't be including <sys/file.h>." >&4
11762 : see if fcntl.h is there
11767 : see if we can include fcntl.h
11773 echo "We'll be including <fcntl.h>." >&4
11776 if $h_sysfile; then
11777 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
11779 echo "We won't be including <fcntl.h>." >&4
11791 : check for non-blocking I/O stuff
11792 case "$h_sysfile" in
11793 true) echo "#include <sys/file.h>" > head.c;;
11796 true) echo "#include <fcntl.h>" > head.c;;
11797 *) echo "#include <sys/fcntl.h>" > head.c;;
11802 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
11803 case "$o_nonblock" in
11805 $cat head.c > try.c
11806 $cat >>try.c <<EOCP
11808 #$i_stdlib I_STDLIB
11810 #include <stdlib.h>
11818 printf("O_NONBLOCK\n");
11822 printf("O_NDELAY\n");
11826 printf("FNDELAY\n");
11833 if eval $compile_ok; then
11834 o_nonblock=`$run ./try`
11835 case "$o_nonblock" in
11836 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
11837 *) echo "Seems like we can use $o_nonblock.";;
11840 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
11843 *) echo "Using $hint value $o_nonblock.";;
11845 $rm -f try try.* .out core
11848 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
11851 $cat head.c > try.c
11852 $cat >>try.c <<EOCP
11854 #include <sys/types.h>
11855 #include <signal.h>
11857 #$i_stdlib I_STDLIB
11859 #include <stdlib.h>
11865 #define MY_O_NONBLOCK $o_nonblock
11866 #ifndef errno /* XXX need better Configure test */
11869 #$i_unistd I_UNISTD
11871 #include <unistd.h>
11873 #$i_string I_STRING
11875 #include <string.h>
11877 #include <strings.h>
11879 $signal_t blech(x) int x; { exit(3); }
11881 $cat >> try.c <<'EOCP'
11889 pipe(pd); /* Down: child -> parent */
11890 pipe(pu); /* Up: parent -> child */
11893 close(pd[1]); /* Parent reads from pd[0] */
11894 close(pu[0]); /* Parent writes (blocking) to pu[1] */
11896 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
11901 signal(SIGALRM, blech);
11903 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
11905 sprintf(string, "%d\n", ret);
11906 write(2, string, strlen(string));
11909 if (errno == EAGAIN) {
11910 printf("EAGAIN\n");
11915 if (errno == EWOULDBLOCK)
11916 printf("EWOULDBLOCK\n");
11919 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
11920 sleep(2); /* Give it time to close our pipe */
11922 ret = read(pd[0], buf, 1); /* Should read EOF */
11924 sprintf(string, "%d\n", ret);
11925 write(4, string, strlen(string));
11929 close(pd[0]); /* We write to pd[1] */
11930 close(pu[1]); /* We read from pu[0] */
11931 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
11932 close(pd[1]); /* Pipe pd is now fully closed! */
11933 exit(0); /* Bye bye, thank you for playing! */
11937 if eval $compile_ok; then
11938 echo "$startsh" >mtry
11939 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
11941 ./mtry >/dev/null 2>&1
11943 0) eagain=`$cat try.out`;;
11944 1) echo "Could not perform non-blocking setting!";;
11945 2) echo "I did a successful read() for something that was not there!";;
11946 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
11947 4) echo "Could not find F_SETFL!";;
11948 *) echo "Something terribly wrong happened during testing.";;
11950 rd_nodata=`$cat try.ret`
11951 echo "A read() system call with no data present returns $rd_nodata."
11952 case "$rd_nodata" in
11955 echo "(That's peculiar, fixing that to be -1.)"
11961 echo "Forcing errno EAGAIN on read() with no data available."
11965 echo "Your read() sets errno to $eagain when no data is available."
11968 status=`$cat try.err`
11970 0) echo "And it correctly returns 0 to signal EOF.";;
11971 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
11972 *) echo "However, your read() returns '$status' on EOF??";;
11975 if test "$status" = "$rd_nodata"; then
11976 echo "WARNING: you can't distinguish between EOF and no data!"
11980 echo "I can't compile the test program--assuming errno EAGAIN will do."
11987 echo "Using $hint value $eagain."
11988 echo "Your read() returns $rd_nodata when no data is present."
11989 case "$d_eofnblk" in
11990 "$define") echo "And you can see EOF because read() returns 0.";;
11991 "$undef") echo "But you can't see EOF status from read() returned value.";;
11993 echo "(Assuming you can't see EOF status from read anyway.)"
11999 $rm -f try try.* .out core head.c mtry
12001 : see if _ptr and _cnt from stdio act std
12004 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12005 echo "(Looks like you have stdio.h from BSD.)"
12006 case "$stdio_ptr" in
12007 '') stdio_ptr='((fp)->_p)'
12010 *) ptr_lval=$d_stdio_ptr_lval;;
12012 case "$stdio_cnt" in
12013 '') stdio_cnt='((fp)->_r)'
12016 *) cnt_lval=$d_stdio_cnt_lval;;
12018 case "$stdio_base" in
12019 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12021 case "$stdio_bufsiz" in
12022 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12024 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12025 echo "(Looks like you have stdio.h from Linux.)"
12026 case "$stdio_ptr" in
12027 '') stdio_ptr='((fp)->_IO_read_ptr)'
12030 *) ptr_lval=$d_stdio_ptr_lval;;
12032 case "$stdio_cnt" in
12033 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12036 *) cnt_lval=$d_stdio_cnt_lval;;
12038 case "$stdio_base" in
12039 '') stdio_base='((fp)->_IO_read_base)';;
12041 case "$stdio_bufsiz" in
12042 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12045 case "$stdio_ptr" in
12046 '') stdio_ptr='((fp)->_ptr)'
12049 *) ptr_lval=$d_stdio_ptr_lval;;
12051 case "$stdio_cnt" in
12052 '') stdio_cnt='((fp)->_cnt)'
12055 *) cnt_lval=$d_stdio_cnt_lval;;
12057 case "$stdio_base" in
12058 '') stdio_base='((fp)->_base)';;
12060 case "$stdio_bufsiz" in
12061 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12065 : test whether _ptr and _cnt really work
12066 echo "Checking how std your stdio is..." >&4
12069 #$i_stdlib I_STDLIB
12071 #include <stdlib.h>
12073 #define FILE_ptr(fp) $stdio_ptr
12074 #define FILE_cnt(fp) $stdio_cnt
12076 FILE *fp = fopen("try.c", "r");
12079 18 <= FILE_cnt(fp) &&
12080 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12088 if eval $compile && $to try.c; then
12089 if $run ./try; then
12090 echo "Your stdio acts pretty std."
12093 echo "Your stdio isn't very std."
12096 echo "Your stdio doesn't appear very std."
12100 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12101 # direct buffer manipulation no longer works. The Configure tests
12102 # should be changed to correctly detect this, but until then,
12103 # the following check should at least let perl compile and run.
12104 # (This quick fix should be updated before 5.8.1.)
12105 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12106 # A. Dougherty, June 3, 2002.
12107 case "$d_gnulibc" in
12109 case "$gnulibc_version" in
12113 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12122 : Can _ptr be used as an lvalue?
12123 case "$d_stdstdio$ptr_lval" in
12124 $define$define) val=$define ;;
12127 set d_stdio_ptr_lval
12130 : Can _cnt be used as an lvalue?
12131 case "$d_stdstdio$cnt_lval" in
12132 $define$define) val=$define ;;
12135 set d_stdio_cnt_lval
12139 : test whether setting _ptr sets _cnt as a side effect
12140 d_stdio_ptr_lval_sets_cnt="$undef"
12141 d_stdio_ptr_lval_nochange_cnt="$undef"
12142 case "$d_stdio_ptr_lval$d_stdstdio" in
12144 echo "Checking to see what happens if we set the stdio ptr..." >&4
12147 /* Can we scream? */
12148 /* Eat dust sed :-) */
12149 /* In the buffer space, no one can hear you scream. */
12150 #$i_stdlib I_STDLIB
12152 #include <stdlib.h>
12154 #define FILE_ptr(fp) $stdio_ptr
12155 #define FILE_cnt(fp) $stdio_cnt
12156 #include <sys/types.h>
12158 FILE *fp = fopen("try.c", "r");
12163 puts("Fail even to read");
12166 c = getc(fp); /* Read away the first # */
12168 puts("Fail even to read");
12172 18 <= FILE_cnt(fp) &&
12173 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12175 puts("Fail even to read");
12178 ptr = (char*) FILE_ptr(fp);
12179 cnt = (size_t)FILE_cnt(fp);
12181 FILE_ptr(fp) += 42;
12183 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12184 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12187 if (FILE_cnt(fp) <= 20) {
12188 printf ("Fail (<20 chars to test)");
12191 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12192 puts("Fail compare");
12195 if (cnt == FILE_cnt(fp)) {
12196 puts("Pass_unchanged");
12199 if (FILE_cnt(fp) == (cnt - 42)) {
12200 puts("Pass_changed");
12203 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12209 if eval $compile && $to try.c; then
12210 case `$run ./try` in
12212 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12213 d_stdio_ptr_lval_sets_cnt="$define" ;;
12215 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12216 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12218 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12220 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12223 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12229 : see if _base is also standard
12231 case "$d_stdstdio" in
12235 #$i_stdlib I_STDLIB
12237 #include <stdlib.h>
12239 #define FILE_base(fp) $stdio_base
12240 #define FILE_bufsiz(fp) $stdio_bufsiz
12242 FILE *fp = fopen("try.c", "r");
12245 19 <= FILE_bufsiz(fp) &&
12246 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
12253 if eval $compile && $to try.c; then
12254 if $run ./try; then
12255 echo "And its _base field acts std."
12258 echo "But its _base field isn't std."
12261 echo "However, it seems to be lacking the _base field."
12269 : see if fast_stdio exists
12271 case "$d_stdstdio:$d_stdio_ptr_lval" in
12273 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
12275 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
12286 : see if fchdir exists
12287 set fchdir d_fchdir
12290 : see if fchmod exists
12291 set fchmod d_fchmod
12294 : see if fchown exists
12295 set fchown d_fchown
12298 : see if this is an fcntl system
12303 : See if fcntl-based locking works.
12305 #$i_stdlib I_STDLIB
12307 #include <stdlib.h>
12309 #include <unistd.h>
12311 #include <signal.h>
12312 $signal_t blech(x) int x; { exit(3); }
12314 #if defined(F_SETLK) && defined(F_SETLKW)
12315 struct flock flock;
12317 fd = open("try.c", O_RDONLY);
12318 flock.l_type = F_RDLCK;
12319 flock.l_whence = SEEK_SET;
12320 flock.l_start = flock.l_len = 0;
12321 signal(SIGALRM, blech);
12323 retval = fcntl(fd, F_SETLK, &flock);
12325 (retval < 0 ? exit(2) : exit(0));
12331 echo "Checking if fcntl-based file locking works... "
12335 if eval $compile_ok; then
12336 if $run ./try; then
12337 echo "Yes, it seems to work."
12340 echo "Nope, it didn't work."
12345 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
12346 *** This is (almost) impossible.
12347 *** If your NFS lock daemons are not feeling well, something like
12348 *** this may happen, please investigate. Cannot continue, aborting.
12356 echo "I'm unable to compile the test program, so I'll assume not."
12361 echo "Nope, since you don't even have fcntl()."
12364 set d_fcntl_can_lock
12369 : check for fd_set items
12372 Checking to see how well your C compiler handles fd_set and friends ...
12375 #$i_stdlib I_STDLIB
12377 #include <stdlib.h>
12379 #$i_systime I_SYS_TIME
12380 #$i_sysselct I_SYS_SELECT
12381 #$d_socket HAS_SOCKET
12382 #include <sys/types.h>
12384 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
12387 #include <sys/time.h>
12389 #ifdef I_SYS_SELECT
12390 #include <sys/select.h>
12399 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
12407 if eval $compile; then
12408 d_fds_bits="$define"
12410 echo "Well, your system knows about the normal fd_set typedef..." >&4
12411 if $run ./try; then
12412 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
12413 d_fd_macros="$define"
12416 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
12418 d_fd_macros="$undef"
12422 Hmm, your compiler has some difficulty with fd_set. Checking further...
12425 if eval $compile; then
12426 d_fds_bits="$undef"
12428 echo "Well, your system has some sort of fd_set available..." >&4
12429 if $run ./try; then
12430 echo "and you have the normal fd_set macros." >&4
12431 d_fd_macros="$define"
12434 but not the normal fd_set macros! Gross! More work for me...
12436 d_fd_macros="$undef"
12439 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
12441 d_fds_bits="$undef"
12442 d_fd_macros="$undef"
12447 : see if fgetpos exists
12448 set fgetpos d_fgetpos
12451 : see if finite exists
12452 set finite d_finite
12455 : see if finitel exists
12456 set finitel d_finitel
12459 : see if flock exists
12463 : see if prototype for flock is available
12465 set d_flockproto flock $i_sysfile sys/file.h
12468 : see if fork exists
12472 : see if fp_class exists
12473 set fp_class d_fp_class
12476 : see if pathconf exists
12477 set pathconf d_pathconf
12480 : see if fpathconf exists
12481 set fpathconf d_fpathconf
12484 : see if fpclass exists
12485 set fpclass d_fpclass
12488 : see if fpclassify exists
12489 set fpclassify d_fpclassify
12492 : see if fpclassl exists
12493 set fpclassl d_fpclassl
12497 : check for fpos64_t
12499 echo "Checking to see if you have fpos64_t..." >&4
12502 int main() { fpos64_t x = 7; }
12505 if eval $compile; then
12507 echo "You have fpos64_t."
12510 echo "You do not have fpos64_t."
12511 case "$fpossize" in
12512 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
12519 : see if frexpl exists
12520 set frexpl d_frexpl
12523 : see if this is a sys/param system
12524 set sys/param.h i_sysparam
12527 : see if this is a sys/mount.h system
12528 set sys/mount.h i_sysmount
12533 echo "Checking to see if your system supports struct fs_data..." >&4
12534 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
12536 case "$d_fs_data_s" in
12537 "$define") echo "Yes, it does." ;;
12538 *) echo "No, it doesn't." ;;
12541 : see if fseeko exists
12542 set fseeko d_fseeko
12544 case "$longsize" in
12545 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
12548 : see if fsetpos exists
12549 set fsetpos d_fsetpos
12553 : see if fstatfs exists
12554 set fstatfs d_fstatfs
12558 : see if statvfs exists
12559 set statvfs d_statvfs
12562 : see if fstatvfs exists
12563 set fstatvfs d_fstatvfs
12567 : see if fsync exists
12571 : see if ftello exists
12572 set ftello d_ftello
12574 case "$longsize" in
12575 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
12579 : check for a working futimes
12581 echo "Checking for a working futimes()" >&4
12584 #include <sys/time.h>
12591 fd = open ("try.c", O_RDWR);
12592 if (-1 == fd) exit (1);
12593 rv = futimes (fd, NULL);
12594 exit (rv == -1 ? errno : 0);
12598 if eval $compile; then
12602 0) echo "Yes, it does" >&4
12603 d_futimes="$define"
12605 *) echo "No, it has futimes, but it isn't working ($rc) (probably harmless)\n" >&4
12609 echo "No, it does not (probably harmless)\n" >&4
12611 $rm -f try.* try core core.try.*
12613 : see if getcwd exists
12614 set getcwd d_getcwd
12617 : see if getespwnam exists
12618 set getespwnam d_getespwnam
12622 : see if getfsstat exists
12623 set getfsstat d_getfsstat
12626 : see if getgrent exists
12627 set getgrent d_getgrent
12630 : see if getgrent_r exists
12631 set getgrent_r d_getgrent_r
12633 case "$d_getgrent_r" in
12635 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12636 case "$d_getgrent_r_proto:$usethreads" in
12637 ":define") d_getgrent_r_proto=define
12638 set d_getgrent_r_proto getgrent_r $hdrs
12642 case "$d_getgrent_r_proto" in
12644 case "$getgrent_r_proto" in
12645 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
12646 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBWR ;;
12648 case "$getgrent_r_proto" in
12649 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
12650 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIR ;;
12652 case "$getgrent_r_proto" in
12653 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
12654 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBW ;;
12656 case "$getgrent_r_proto" in
12657 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
12658 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBI ;;
12660 case "$getgrent_r_proto" in
12661 ''|0) try='int getgrent_r(struct group*, char*, int);'
12662 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBI ;;
12664 case "$getgrent_r_proto" in
12665 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
12666 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIH ;;
12668 case "$getgrent_r_proto" in
12669 ''|0) d_getgrent_r=undef
12671 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
12672 * ) case "$getgrent_r_proto" in
12673 REENTRANT_PROTO*) ;;
12674 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
12676 echo "Prototype: $try" ;;
12679 *) case "$usethreads" in
12680 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
12687 *) getgrent_r_proto=0
12691 : see if getgrgid_r exists
12692 set getgrgid_r d_getgrgid_r
12694 case "$d_getgrgid_r" in
12696 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12697 case "$d_getgrgid_r_proto:$usethreads" in
12698 ":define") d_getgrgid_r_proto=define
12699 set d_getgrgid_r_proto getgrgid_r $hdrs
12703 case "$d_getgrgid_r_proto" in
12705 case "$getgrgid_r_proto" in
12706 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
12707 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
12709 case "$getgrgid_r_proto" in
12710 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
12711 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
12713 case "$getgrgid_r_proto" in
12714 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
12715 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
12717 case "$getgrgid_r_proto" in
12718 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
12719 ./protochk "extern $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
12721 case "$getgrgid_r_proto" in
12722 ''|0) d_getgrgid_r=undef
12724 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
12725 * ) case "$getgrgid_r_proto" in
12726 REENTRANT_PROTO*) ;;
12727 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
12729 echo "Prototype: $try" ;;
12732 *) case "$usethreads" in
12733 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
12740 *) getgrgid_r_proto=0
12744 : see if getgrnam_r exists
12745 set getgrnam_r d_getgrnam_r
12747 case "$d_getgrnam_r" in
12749 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12750 case "$d_getgrnam_r_proto:$usethreads" in
12751 ":define") d_getgrnam_r_proto=define
12752 set d_getgrnam_r_proto getgrnam_r $hdrs
12756 case "$d_getgrnam_r_proto" in
12758 case "$getgrnam_r_proto" in
12759 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
12760 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
12762 case "$getgrnam_r_proto" in
12763 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
12764 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
12766 case "$getgrnam_r_proto" in
12767 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
12768 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CBI ;;
12770 case "$getgrnam_r_proto" in
12771 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
12772 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
12774 case "$getgrnam_r_proto" in
12775 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
12776 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
12778 case "$getgrnam_r_proto" in
12779 ''|0) d_getgrnam_r=undef
12781 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
12782 * ) case "$getgrnam_r_proto" in
12783 REENTRANT_PROTO*) ;;
12784 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
12786 echo "Prototype: $try" ;;
12789 *) case "$usethreads" in
12790 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
12797 *) getgrnam_r_proto=0
12801 : see if gethostbyaddr exists
12802 set gethostbyaddr d_gethbyaddr
12805 : see if gethostbyname exists
12806 set gethostbyname d_gethbyname
12809 : see if gethostent exists
12810 set gethostent d_gethent
12813 : see how we will look up host name
12816 if set gethostname val -f d_gethname; eval $csym; $val; then
12817 echo 'gethostname() found.' >&4
12818 d_gethname="$define"
12821 if set uname val -f d_uname; eval $csym; $val; then
12824 uname() was found, but you're running xenix, and older versions of xenix
12825 have a broken uname(). If you don't really know whether your xenix is old
12826 enough to have a broken system call, use the default answer.
12831 "$define") dflt=n;;
12833 rp='Is your uname() broken?'
12836 n*) d_uname="$define"; call=uname;;
12839 echo 'uname() found.' >&4
12846 case "$d_gethname" in
12847 '') d_gethname="$undef";;
12850 '') d_uname="$undef";;
12852 case "$d_uname$d_gethname" in
12857 Every now and then someone has a $call() that lies about the hostname
12858 but can't be fixed for political or economic reasons. If you wish, I can
12859 pretend $call() isn't there and maybe compute hostname at run-time
12860 thanks to the '$phostname' command.
12863 rp="Shall I ignore $call() from now on?"
12866 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
12869 case "$phostname" in
12870 '') aphostname='';;
12871 *) case "$aphostname" in
12873 *) set X $phostname
12877 file=`./loc $file $file $pth`
12878 aphostname=`echo $file $*`
12883 case "$d_uname$d_gethname" in
12886 case "$phostname" in
12888 echo "There will be no way for $package to get your hostname." >&4;;
12890 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
12894 case "$d_phostname" in
12895 '') d_phostname="$undef";;
12898 : see if gethostbyaddr_r exists
12899 set gethostbyaddr_r d_gethostbyaddr_r
12901 case "$d_gethostbyaddr_r" in
12903 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12904 case "$d_gethostbyaddr_r_proto:$usethreads" in
12905 ":define") d_gethostbyaddr_r_proto=define
12906 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
12910 case "$d_gethostbyaddr_r_proto" in
12912 case "$gethostbyaddr_r_proto" in
12913 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
12914 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
12916 case "$gethostbyaddr_r_proto" in
12917 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
12918 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
12920 case "$gethostbyaddr_r_proto" in
12921 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
12922 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
12924 case "$gethostbyaddr_r_proto" in
12925 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
12926 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
12928 case "$gethostbyaddr_r_proto" in
12929 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
12930 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
12932 case "$gethostbyaddr_r_proto" in
12933 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
12934 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
12936 case "$gethostbyaddr_r_proto" in
12937 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
12938 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
12940 case "$gethostbyaddr_r_proto" in
12941 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
12942 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
12944 case "$gethostbyaddr_r_proto" in
12945 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
12946 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
12948 case "$gethostbyaddr_r_proto" in
12949 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
12950 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
12952 case "$gethostbyaddr_r_proto" in
12953 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
12954 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
12956 case "$gethostbyaddr_r_proto" in
12957 ''|0) d_gethostbyaddr_r=undef
12958 gethostbyaddr_r_proto=0
12959 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
12960 * ) case "$gethostbyaddr_r_proto" in
12961 REENTRANT_PROTO*) ;;
12962 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
12964 echo "Prototype: $try" ;;
12967 *) case "$usethreads" in
12968 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
12970 d_gethostbyaddr_r=undef
12971 gethostbyaddr_r_proto=0
12975 *) gethostbyaddr_r_proto=0
12979 : see if gethostbyname_r exists
12980 set gethostbyname_r d_gethostbyname_r
12982 case "$d_gethostbyname_r" in
12984 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12985 case "$d_gethostbyname_r_proto:$usethreads" in
12986 ":define") d_gethostbyname_r_proto=define
12987 set d_gethostbyname_r_proto gethostbyname_r $hdrs
12991 case "$d_gethostbyname_r_proto" in
12993 case "$gethostbyname_r_proto" in
12994 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
12995 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
12997 case "$gethostbyname_r_proto" in
12998 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
12999 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
13001 case "$gethostbyname_r_proto" in
13002 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
13003 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
13005 case "$gethostbyname_r_proto" in
13006 ''|0) d_gethostbyname_r=undef
13007 gethostbyname_r_proto=0
13008 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
13009 * ) case "$gethostbyname_r_proto" in
13010 REENTRANT_PROTO*) ;;
13011 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
13013 echo "Prototype: $try" ;;
13016 *) case "$usethreads" in
13017 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13019 d_gethostbyname_r=undef
13020 gethostbyname_r_proto=0
13024 *) gethostbyname_r_proto=0
13028 : see if gethostent_r exists
13029 set gethostent_r d_gethostent_r
13031 case "$d_gethostent_r" in
13033 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13034 case "$d_gethostent_r_proto:$usethreads" in
13035 ":define") d_gethostent_r_proto=define
13036 set d_gethostent_r_proto gethostent_r $hdrs
13040 case "$d_gethostent_r_proto" in
13042 case "$gethostent_r_proto" in
13043 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
13044 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
13046 case "$gethostent_r_proto" in
13047 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
13048 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBIE ;;
13050 case "$gethostent_r_proto" in
13051 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
13052 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBIE ;;
13054 case "$gethostent_r_proto" in
13055 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
13056 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBI ;;
13058 case "$gethostent_r_proto" in
13059 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
13060 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBI ;;
13062 case "$gethostent_r_proto" in
13063 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13064 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SD ;;
13066 case "$gethostent_r_proto" in
13067 ''|0) d_gethostent_r=undef
13068 gethostent_r_proto=0
13069 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13070 * ) case "$gethostent_r_proto" in
13071 REENTRANT_PROTO*) ;;
13072 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13074 echo "Prototype: $try" ;;
13077 *) case "$usethreads" in
13078 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13080 d_gethostent_r=undef
13081 gethostent_r_proto=0
13085 *) gethostent_r_proto=0
13089 : see if prototypes for various gethostxxx netdb.h functions are available
13091 set d_gethostprotos gethostent $i_netdb netdb.h
13094 : see if getitimer exists
13095 set getitimer d_getitimer
13098 : see if getlogin exists
13099 set getlogin d_getlogin
13102 : see if getlogin_r exists
13103 set getlogin_r d_getlogin_r
13105 case "$d_getlogin_r" in
13107 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
13108 case "$d_getlogin_r_proto:$usethreads" in
13109 ":define") d_getlogin_r_proto=define
13110 set d_getlogin_r_proto getlogin_r $hdrs
13114 case "$d_getlogin_r_proto" in
13116 case "$getlogin_r_proto" in
13117 ''|0) try='int getlogin_r(char*, size_t);'
13118 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BW ;;
13120 case "$getlogin_r_proto" in
13121 ''|0) try='int getlogin_r(char*, int);'
13122 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BI ;;
13124 case "$getlogin_r_proto" in
13125 ''|0) try='char* getlogin_r(char*, size_t);'
13126 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BW ;;
13128 case "$getlogin_r_proto" in
13129 ''|0) try='char* getlogin_r(char*, int);'
13130 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BI ;;
13132 case "$getlogin_r_proto" in
13133 ''|0) d_getlogin_r=undef
13135 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
13136 * ) case "$getlogin_r_proto" in
13137 REENTRANT_PROTO*) ;;
13138 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
13140 echo "Prototype: $try" ;;
13143 *) case "$usethreads" in
13144 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
13151 *) getlogin_r_proto=0
13155 : see if getmnt exists
13156 set getmnt d_getmnt
13159 : see if getmntent exists
13160 set getmntent d_getmntent
13163 : see if getnetbyaddr exists
13164 set getnetbyaddr d_getnbyaddr
13167 : see if getnetbyname exists
13168 set getnetbyname d_getnbyname
13171 : see if getnetent exists
13172 set getnetent d_getnent
13175 : see if getnetbyaddr_r exists
13176 set getnetbyaddr_r d_getnetbyaddr_r
13178 case "$d_getnetbyaddr_r" in
13180 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13181 case "$d_getnetbyaddr_r_proto:$usethreads" in
13182 ":define") d_getnetbyaddr_r_proto=define
13183 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
13187 case "$d_getnetbyaddr_r_proto" in
13189 case "$getnetbyaddr_r_proto" in
13190 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
13191 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
13193 case "$getnetbyaddr_r_proto" in
13194 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
13195 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
13197 case "$getnetbyaddr_r_proto" in
13198 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
13199 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
13201 case "$getnetbyaddr_r_proto" in
13202 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
13203 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
13205 case "$getnetbyaddr_r_proto" in
13206 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
13207 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
13209 case "$getnetbyaddr_r_proto" in
13210 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
13211 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
13213 case "$getnetbyaddr_r_proto" in
13214 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
13215 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
13217 case "$getnetbyaddr_r_proto" in
13218 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
13219 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
13221 case "$getnetbyaddr_r_proto" in
13222 ''|0) d_getnetbyaddr_r=undef
13223 getnetbyaddr_r_proto=0
13224 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
13225 * ) case "$getnetbyaddr_r_proto" in
13226 REENTRANT_PROTO*) ;;
13227 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
13229 echo "Prototype: $try" ;;
13232 *) case "$usethreads" in
13233 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
13235 d_getnetbyaddr_r=undef
13236 getnetbyaddr_r_proto=0
13240 *) getnetbyaddr_r_proto=0
13244 : see if getnetbyname_r exists
13245 set getnetbyname_r d_getnetbyname_r
13247 case "$d_getnetbyname_r" in
13249 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13250 case "$d_getnetbyname_r_proto:$usethreads" in
13251 ":define") d_getnetbyname_r_proto=define
13252 set d_getnetbyname_r_proto getnetbyname_r $hdrs
13256 case "$d_getnetbyname_r_proto" in
13258 case "$getnetbyname_r_proto" in
13259 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
13260 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
13262 case "$getnetbyname_r_proto" in
13263 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
13264 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
13266 case "$getnetbyname_r_proto" in
13267 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
13268 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
13270 case "$getnetbyname_r_proto" in
13271 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
13272 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
13274 case "$getnetbyname_r_proto" in
13275 ''|0) d_getnetbyname_r=undef
13276 getnetbyname_r_proto=0
13277 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
13278 * ) case "$getnetbyname_r_proto" in
13279 REENTRANT_PROTO*) ;;
13280 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
13282 echo "Prototype: $try" ;;
13285 *) case "$usethreads" in
13286 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
13288 d_getnetbyname_r=undef
13289 getnetbyname_r_proto=0
13293 *) getnetbyname_r_proto=0
13297 : see if getnetent_r exists
13298 set getnetent_r d_getnetent_r
13300 case "$d_getnetent_r" in
13302 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13303 case "$d_getnetent_r_proto:$usethreads" in
13304 ":define") d_getnetent_r_proto=define
13305 set d_getnetent_r_proto getnetent_r $hdrs
13309 case "$d_getnetent_r_proto" in
13311 case "$getnetent_r_proto" in
13312 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
13313 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
13315 case "$getnetent_r_proto" in
13316 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
13317 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBIE ;;
13319 case "$getnetent_r_proto" in
13320 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
13321 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBIE ;;
13323 case "$getnetent_r_proto" in
13324 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
13325 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBI ;;
13327 case "$getnetent_r_proto" in
13328 ''|0) try='int getnetent_r(struct netent*, char*, int);'
13329 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBI ;;
13331 case "$getnetent_r_proto" in
13332 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
13333 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SD ;;
13335 case "$getnetent_r_proto" in
13336 ''|0) d_getnetent_r=undef
13337 getnetent_r_proto=0
13338 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
13339 * ) case "$getnetent_r_proto" in
13340 REENTRANT_PROTO*) ;;
13341 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
13343 echo "Prototype: $try" ;;
13346 *) case "$usethreads" in
13347 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
13349 d_getnetent_r=undef
13350 getnetent_r_proto=0
13354 *) getnetent_r_proto=0
13358 : see if prototypes for various getnetxxx netdb.h functions are available
13360 set d_getnetprotos getnetent $i_netdb netdb.h
13363 : see if getpagesize exists
13364 set getpagesize d_getpagsz
13368 : see if getprotobyname exists
13369 set getprotobyname d_getpbyname
13372 : see if getprotobynumber exists
13373 set getprotobynumber d_getpbynumber
13376 : see if getprotoent exists
13377 set getprotoent d_getpent
13380 : see if getpgid exists
13381 set getpgid d_getpgid
13384 : see if getpgrp2 exists
13385 set getpgrp2 d_getpgrp2
13388 : see if getppid exists
13389 set getppid d_getppid
13392 : see if getpriority exists
13393 set getpriority d_getprior
13396 : see if getprotobyname_r exists
13397 set getprotobyname_r d_getprotobyname_r
13399 case "$d_getprotobyname_r" in
13401 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13402 case "$d_getprotobyname_r_proto:$usethreads" in
13403 ":define") d_getprotobyname_r_proto=define
13404 set d_getprotobyname_r_proto getprotobyname_r $hdrs
13408 case "$d_getprotobyname_r_proto" in
13410 case "$getprotobyname_r_proto" in
13411 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
13412 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
13414 case "$getprotobyname_r_proto" in
13415 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
13416 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
13418 case "$getprotobyname_r_proto" in
13419 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
13420 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
13422 case "$getprotobyname_r_proto" in
13423 ''|0) d_getprotobyname_r=undef
13424 getprotobyname_r_proto=0
13425 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
13426 * ) case "$getprotobyname_r_proto" in
13427 REENTRANT_PROTO*) ;;
13428 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
13430 echo "Prototype: $try" ;;
13433 *) case "$usethreads" in
13434 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
13436 d_getprotobyname_r=undef
13437 getprotobyname_r_proto=0
13441 *) getprotobyname_r_proto=0
13445 : see if getprotobynumber_r exists
13446 set getprotobynumber_r d_getprotobynumber_r
13448 case "$d_getprotobynumber_r" in
13450 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13451 case "$d_getprotobynumber_r_proto:$usethreads" in
13452 ":define") d_getprotobynumber_r_proto=define
13453 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
13457 case "$d_getprotobynumber_r_proto" in
13459 case "$getprotobynumber_r_proto" in
13460 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
13461 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
13463 case "$getprotobynumber_r_proto" in
13464 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
13465 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
13467 case "$getprotobynumber_r_proto" in
13468 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
13469 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
13471 case "$getprotobynumber_r_proto" in
13472 ''|0) d_getprotobynumber_r=undef
13473 getprotobynumber_r_proto=0
13474 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
13475 * ) case "$getprotobynumber_r_proto" in
13476 REENTRANT_PROTO*) ;;
13477 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
13479 echo "Prototype: $try" ;;
13482 *) case "$usethreads" in
13483 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
13485 d_getprotobynumber_r=undef
13486 getprotobynumber_r_proto=0
13490 *) getprotobynumber_r_proto=0
13494 : see if getprotoent_r exists
13495 set getprotoent_r d_getprotoent_r
13497 case "$d_getprotoent_r" in
13499 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13500 case "$d_getprotoent_r_proto:$usethreads" in
13501 ":define") d_getprotoent_r_proto=define
13502 set d_getprotoent_r_proto getprotoent_r $hdrs
13506 case "$d_getprotoent_r_proto" in
13508 case "$getprotoent_r_proto" in
13509 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
13510 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
13512 case "$getprotoent_r_proto" in
13513 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
13514 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBI ;;
13516 case "$getprotoent_r_proto" in
13517 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
13518 ./protochk "extern $try" $hdrs && getprotoent_r_proto=S_SBI ;;
13520 case "$getprotoent_r_proto" in
13521 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
13522 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SD ;;
13524 case "$getprotoent_r_proto" in
13525 ''|0) d_getprotoent_r=undef
13526 getprotoent_r_proto=0
13527 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
13528 * ) case "$getprotoent_r_proto" in
13529 REENTRANT_PROTO*) ;;
13530 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
13532 echo "Prototype: $try" ;;
13535 *) case "$usethreads" in
13536 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
13538 d_getprotoent_r=undef
13539 getprotoent_r_proto=0
13543 *) getprotoent_r_proto=0
13547 : see if prototypes for various getprotoxxx netdb.h functions are available
13549 set d_getprotoprotos getprotoent $i_netdb netdb.h
13552 : see if getprpwnam exists
13553 set getprpwnam d_getprpwnam
13556 : see if getpwent exists
13557 set getpwent d_getpwent
13560 : see if getpwent_r exists
13561 set getpwent_r d_getpwent_r
13563 case "$d_getpwent_r" in
13565 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13566 case "$d_getpwent_r_proto:$usethreads" in
13567 ":define") d_getpwent_r_proto=define
13568 set d_getpwent_r_proto getpwent_r $hdrs
13572 case "$d_getpwent_r_proto" in
13574 case "$getpwent_r_proto" in
13575 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
13576 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBWR ;;
13578 case "$getpwent_r_proto" in
13579 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
13580 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIR ;;
13582 case "$getpwent_r_proto" in
13583 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
13584 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBW ;;
13586 case "$getpwent_r_proto" in
13587 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
13588 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBI ;;
13590 case "$getpwent_r_proto" in
13591 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
13592 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBI ;;
13594 case "$getpwent_r_proto" in
13595 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
13596 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIH ;;
13598 case "$getpwent_r_proto" in
13599 ''|0) d_getpwent_r=undef
13601 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
13602 * ) case "$getpwent_r_proto" in
13603 REENTRANT_PROTO*) ;;
13604 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
13606 echo "Prototype: $try" ;;
13609 *) case "$usethreads" in
13610 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
13617 *) getpwent_r_proto=0
13621 : see if getpwnam_r exists
13622 set getpwnam_r d_getpwnam_r
13624 case "$d_getpwnam_r" in
13626 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13627 case "$d_getpwnam_r_proto:$usethreads" in
13628 ":define") d_getpwnam_r_proto=define
13629 set d_getpwnam_r_proto getpwnam_r $hdrs
13633 case "$d_getpwnam_r_proto" in
13635 case "$getpwnam_r_proto" in
13636 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
13637 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
13639 case "$getpwnam_r_proto" in
13640 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
13641 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
13643 case "$getpwnam_r_proto" in
13644 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
13645 ./protochk "extern $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
13647 case "$getpwnam_r_proto" in
13648 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
13649 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
13651 case "$getpwnam_r_proto" in
13652 ''|0) d_getpwnam_r=undef
13654 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
13655 * ) case "$getpwnam_r_proto" in
13656 REENTRANT_PROTO*) ;;
13657 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
13659 echo "Prototype: $try" ;;
13662 *) case "$usethreads" in
13663 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
13670 *) getpwnam_r_proto=0
13674 : see if getpwuid_r exists
13675 set getpwuid_r d_getpwuid_r
13677 case "$d_getpwuid_r" in
13679 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13680 case "$d_getpwuid_r_proto:$usethreads" in
13681 ":define") d_getpwuid_r_proto=define
13682 set d_getpwuid_r_proto getpwuid_r $hdrs
13686 case "$d_getpwuid_r_proto" in
13688 case "$getpwuid_r_proto" in
13689 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
13690 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
13692 case "$getpwuid_r_proto" in
13693 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
13694 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
13696 case "$getpwuid_r_proto" in
13697 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
13698 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
13700 case "$getpwuid_r_proto" in
13701 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
13702 ./protochk "extern $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
13704 case "$getpwuid_r_proto" in
13705 ''|0) d_getpwuid_r=undef
13707 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
13708 * ) case "$getpwuid_r_proto" in
13709 REENTRANT_PROTO*) ;;
13710 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
13712 echo "Prototype: $try" ;;
13715 *) case "$usethreads" in
13716 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
13723 *) getpwuid_r_proto=0
13728 : see if getservbyname exists
13729 set getservbyname d_getsbyname
13732 : see if getservbyport exists
13733 set getservbyport d_getsbyport
13736 : see if getservent exists
13737 set getservent d_getsent
13740 : see if getservbyname_r exists
13741 set getservbyname_r d_getservbyname_r
13743 case "$d_getservbyname_r" in
13745 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13746 case "$d_getservbyname_r_proto:$usethreads" in
13747 ":define") d_getservbyname_r_proto=define
13748 set d_getservbyname_r_proto getservbyname_r $hdrs
13752 case "$d_getservbyname_r_proto" in
13754 case "$getservbyname_r_proto" in
13755 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
13756 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
13758 case "$getservbyname_r_proto" in
13759 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
13760 ./protochk "extern $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
13762 case "$getservbyname_r_proto" in
13763 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
13764 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
13766 case "$getservbyname_r_proto" in
13767 ''|0) d_getservbyname_r=undef
13768 getservbyname_r_proto=0
13769 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
13770 * ) case "$getservbyname_r_proto" in
13771 REENTRANT_PROTO*) ;;
13772 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
13774 echo "Prototype: $try" ;;
13777 *) case "$usethreads" in
13778 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
13780 d_getservbyname_r=undef
13781 getservbyname_r_proto=0
13785 *) getservbyname_r_proto=0
13789 : see if getservbyport_r exists
13790 set getservbyport_r d_getservbyport_r
13792 case "$d_getservbyport_r" in
13794 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13795 case "$d_getservbyport_r_proto:$usethreads" in
13796 ":define") d_getservbyport_r_proto=define
13797 set d_getservbyport_r_proto getservbyport_r $hdrs
13801 case "$d_getservbyport_r_proto" in
13803 case "$getservbyport_r_proto" in
13804 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
13805 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
13807 case "$getservbyport_r_proto" in
13808 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
13809 ./protochk "extern $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
13811 case "$getservbyport_r_proto" in
13812 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
13813 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
13815 case "$getservbyport_r_proto" in
13816 ''|0) d_getservbyport_r=undef
13817 getservbyport_r_proto=0
13818 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
13819 * ) case "$getservbyport_r_proto" in
13820 REENTRANT_PROTO*) ;;
13821 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
13823 echo "Prototype: $try" ;;
13826 *) case "$usethreads" in
13827 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
13829 d_getservbyport_r=undef
13830 getservbyport_r_proto=0
13834 *) getservbyport_r_proto=0
13838 : see if getservent_r exists
13839 set getservent_r d_getservent_r
13841 case "$d_getservent_r" in
13843 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13844 case "$d_getservent_r_proto:$usethreads" in
13845 ":define") d_getservent_r_proto=define
13846 set d_getservent_r_proto getservent_r $hdrs
13850 case "$d_getservent_r_proto" in
13852 case "$getservent_r_proto" in
13853 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
13854 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBWR ;;
13856 case "$getservent_r_proto" in
13857 ''|0) try='int getservent_r(struct servent*, char*, int);'
13858 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBI ;;
13860 case "$getservent_r_proto" in
13861 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
13862 ./protochk "extern $try" $hdrs && getservent_r_proto=S_SBI ;;
13864 case "$getservent_r_proto" in
13865 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
13866 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SD ;;
13868 case "$getservent_r_proto" in
13869 ''|0) d_getservent_r=undef
13870 getservent_r_proto=0
13871 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
13872 * ) case "$getservent_r_proto" in
13873 REENTRANT_PROTO*) ;;
13874 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
13876 echo "Prototype: $try" ;;
13879 *) case "$usethreads" in
13880 define) echo "getservent_r has no prototype, not using it." >&4 ;;
13882 d_getservent_r=undef
13883 getservent_r_proto=0
13887 *) getservent_r_proto=0
13891 : see if prototypes for various getservxxx netdb.h functions are available
13893 set d_getservprotos getservent $i_netdb netdb.h
13896 : see if getspnam exists
13897 set getspnam d_getspnam
13900 : see if this is a shadow.h system
13901 set shadow.h i_shadow
13904 : see if getspnam_r exists
13905 set getspnam_r d_getspnam_r
13907 case "$d_getspnam_r" in
13909 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
13910 case "$d_getspnam_r_proto:$usethreads" in
13911 ":define") d_getspnam_r_proto=define
13912 set d_getspnam_r_proto getspnam_r $hdrs
13916 case "$d_getspnam_r_proto" in
13918 case "$getspnam_r_proto" in
13919 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
13920 ./protochk "extern $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
13922 case "$getspnam_r_proto" in
13923 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
13924 ./protochk "extern $try" $hdrs && getspnam_r_proto=S_CSBI ;;
13926 case "$getspnam_r_proto" in
13927 ''|0) d_getspnam_r=undef
13929 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
13930 * ) case "$getspnam_r_proto" in
13931 REENTRANT_PROTO*) ;;
13932 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
13934 echo "Prototype: $try" ;;
13937 *) case "$usethreads" in
13938 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
13945 *) getspnam_r_proto=0
13949 : see if gettimeofday or ftime exists
13950 set gettimeofday d_gettimeod
13952 case "$d_gettimeod" in
13958 val="$undef"; set d_ftime; eval $setvar
13961 case "$d_gettimeod$d_ftime" in
13964 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
13968 : see if gmtime_r exists
13969 set gmtime_r d_gmtime_r
13971 case "$d_gmtime_r" in
13973 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
13974 case "$d_gmtime_r_proto:$usethreads" in
13975 ":define") d_gmtime_r_proto=define
13976 set d_gmtime_r_proto gmtime_r $hdrs
13980 case "$d_gmtime_r_proto" in
13982 case "$gmtime_r_proto" in
13983 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
13984 ./protochk "extern $try" $hdrs && gmtime_r_proto=S_TS ;;
13986 case "$gmtime_r_proto" in
13987 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
13988 ./protochk "extern $try" $hdrs && gmtime_r_proto=I_TS ;;
13990 case "$gmtime_r_proto" in
13991 ''|0) d_gmtime_r=undef
13993 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
13994 * ) case "$gmtime_r_proto" in
13995 REENTRANT_PROTO*) ;;
13996 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
13998 echo "Prototype: $try" ;;
14001 *) case "$usethreads" in
14002 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
14009 *) gmtime_r_proto=0
14013 : see if hasmntopt exists
14014 set hasmntopt d_hasmntopt
14017 : see if this is a netinet/in.h or sys/in.h system
14018 set netinet/in.h i_niin sys/in.h i_sysin
14021 : see if arpa/inet.h has to be included
14022 set arpa/inet.h i_arpainet
14025 : see if htonl --and friends-- exists
14030 : Maybe they are macros.
14033 $cat >htonl.c <<EOM
14035 #include <sys/types.h>
14036 #$i_niin I_NETINET_IN
14038 #$i_arpainet I_ARPA_INET
14039 #ifdef I_NETINET_IN
14040 #include <netinet/in.h>
14043 #include <sys/in.h>
14046 #include <arpa/inet.h>
14049 printf("Defined as a macro.");
14052 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
14053 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
14055 echo "But it seems to be defined as a macro." >&4
14063 : see if ilogbl exists
14064 set ilogbl d_ilogbl
14069 if set index val -f; eval $csym; $val; then
14070 if set strchr val -f d_strchr; eval $csym; $val; then
14071 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14074 echo "strchr() found." >&4
14078 echo "index() found." >&4
14083 echo "index() found." >&4
14086 if set strchr val -f d_strchr; eval $csym; $val; then
14089 echo "strchr() found." >&4
14091 echo "No index() or strchr() found!" >&4
14096 set d_strchr; eval $setvar
14098 set d_index; eval $setvar
14100 : check whether inet_aton exists
14101 set inet_aton d_inetaton
14106 $cat >isascii.c <<EOCP
14109 #$i_stdlib I_STDLIB
14111 #include <stdlib.h>
14122 if eval $compile; then
14123 echo "isascii() found." >&4
14126 echo "isascii() NOT found." >&4
14133 : see if isfinite exists
14134 set isfinite d_isfinite
14137 : see if isinf exists
14141 : see if isnan exists
14145 : see if isnanl exists
14146 set isnanl d_isnanl
14149 : see if killpg exists
14150 set killpg d_killpg
14153 : see if lchown exists
14155 $cat > try.c <<'EOCP'
14156 /* System header to define __stub macros and hopefully few prototypes,
14157 which can conflict with char lchown(); below. */
14158 #include <assert.h>
14159 /* Override any gcc2 internal prototype to avoid an error. */
14160 /* We use char because int might match the return type of a gcc2
14161 builtin and then its argument prototype would still apply. */
14164 /* The GNU C library defines this for functions which it implements
14165 to always fail with ENOSYS. Some functions are actually named
14166 something starting with __ and the normal name is an alias. */
14167 #if defined (__stub_lchown) || defined (__stub___lchown)
14175 if eval $compile; then
14176 $echo "lchown() found." >&4
14179 $echo "lchown() NOT found." >&4
14185 : See if number of significant digits in a double precision number is known
14187 $cat >ldbl_dig.c <<EOM
14188 #$i_limits I_LIMITS
14191 #include <limits.h>
14197 printf("Contains LDBL_DIG");
14200 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
14201 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
14202 echo "LDBL_DIG found." >&4
14205 echo "LDBL_DIG NOT found." >&4
14212 : see if this is a math.h system
14216 d_libm_lib_version="$undef"
14219 : check to see if math.h defines _LIB_VERSION
14221 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
14223 #include <unistd.h>
14225 int main (int argc, char *argv[])
14227 printf ("%d\n", _LIB_VERSION);
14232 if eval $compile; then
14234 echo "Yes, it does ($foo)" >&4
14235 d_libm_lib_version="$define"
14237 echo "No, it does not (probably harmless)\n" >&4
14239 $rm -f try.* try core core.try.*
14244 : see if link exists
14248 : see if localtime_r exists
14249 set localtime_r d_localtime_r
14251 case "$d_localtime_r" in
14253 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14254 case "$d_localtime_r_proto:$usethreads" in
14255 ":define") d_localtime_r_proto=define
14256 set d_localtime_r_proto localtime_r $hdrs
14260 case "$d_localtime_r_proto" in
14262 case "$localtime_r_proto" in
14263 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
14264 ./protochk "extern $try" $hdrs && localtime_r_proto=S_TS ;;
14266 case "$localtime_r_proto" in
14267 ''|0) try='int localtime_r(const time_t*, struct tm*);'
14268 ./protochk "extern $try" $hdrs && localtime_r_proto=I_TS ;;
14270 case "$localtime_r_proto" in
14271 ''|0) d_localtime_r=undef
14272 localtime_r_proto=0
14273 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
14274 * ) case "$localtime_r_proto" in
14275 REENTRANT_PROTO*) ;;
14276 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
14278 echo "Prototype: $try" ;;
14281 *) case "$usethreads" in
14282 define) echo "localtime_r has no prototype, not using it." >&4 ;;
14284 d_localtime_r=undef
14285 localtime_r_proto=0
14289 *) localtime_r_proto=0
14293 : see if localeconv exists
14294 set localeconv d_locconv
14297 : see if lockf exists
14301 : see if prototype for lseek is available
14303 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
14306 : see if lstat exists
14310 : see if madvise exists
14311 set madvise d_madvise
14314 : see if malloc_size exists
14315 set malloc_size d_malloc_size
14318 : see if malloc_size_good exists
14319 set malloc_good_size d_malloc_good_size
14322 : see if mblen exists
14326 : see if mbstowcs exists
14327 set mbstowcs d_mbstowcs
14330 : see if mbtowc exists
14331 set mbtowc d_mbtowc
14334 : see if memchr exists
14335 set memchr d_memchr
14338 : see if memcmp exists
14339 set memcmp d_memcmp
14342 : see if memcpy exists
14343 set memcpy d_memcpy
14346 : see if memmove exists
14347 set memmove d_memmove
14350 : see if memset exists
14351 set memset d_memset
14354 : see if mkdir exists
14358 : see if mkdtemp exists
14359 set mkdtemp d_mkdtemp
14362 : see if mkfifo exists
14363 set mkfifo d_mkfifo
14366 : see if mkstemp exists
14367 set mkstemp d_mkstemp
14370 : see if mkstemps exists
14371 set mkstemps d_mkstemps
14374 : see if mktime exists
14375 set mktime d_mktime
14378 : see if this is a sys/mman.h system
14379 set sys/mman.h i_sysmman
14382 : see if mmap exists
14385 : see what shmat returns
14386 : default to something harmless
14388 case "$i_sysmman$d_mmap" in
14390 $cat >mmap.c <<'END'
14391 #include <sys/mman.h>
14394 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
14399 echo "and it returns ($mmaptype)." >&4
14405 : see if sqrtl exists
14409 : see if scalbnl exists
14410 set scalbnl d_scalbnl
14413 : see if modfl exists
14417 : see if prototype for modfl is available
14419 set d_modflproto modfl $i_math math.h
14422 d_modfl_pow32_bug="$undef"
14424 case "$d_longdbl$d_modfl" in
14427 Checking to see whether your modfl() is okay for large values...
14433 if $test "X$d_modflproto" != "X$define"; then
14434 $cat >>try.c <<EOCP
14435 /* Sigh. many current glibcs provide the function, but do not prototype it. */
14436 long double modfl (long double, long double *);
14439 $cat >>try.c <<EOCP
14441 long double nv = 4294967303.15;
14447 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
14451 case "$osname:$gccversion" in
14452 aix:) saveccflags="$ccflags"
14453 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
14456 if eval $compile; then
14459 *" 4294967303.150000 1.150000 4294967302.000000")
14460 echo >&4 "Your modfl() is broken for large values."
14461 d_modfl_pow32_bug="$define"
14463 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
14467 *" 4294967303.150000 0.150000 4294967303.000000")
14468 echo >&4 "Your modfl() seems okay for large values."
14470 *) echo >&4 "I don't understand your modfl() at all."
14474 $rm -f try.* try core core.try.*
14476 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
14479 case "$osname:$gccversion" in
14480 aix:) ccflags="$saveccflags" ;; # restore
14485 if $test "$uselongdouble" = "$define"; then
14487 if $test "$d_sqrtl" != "$define"; then
14488 message="$message sqrtl"
14490 if $test "$d_modfl" != "$define"; then
14491 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
14492 echo "You have both aintl and copysignl, so I can emulate modfl."
14494 message="$message modfl"
14497 if $test "$d_frexpl" != "$define"; then
14498 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
14499 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
14501 message="$message frexpl"
14505 if $test "$message" != ""; then
14508 *** You requested the use of long doubles but you do not seem to have
14509 *** the following mathematical functions needed for long double support:
14511 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
14512 *** Cannot continue, aborting.
14520 : see if mprotect exists
14521 set mprotect d_mprotect
14524 : see if msgctl exists
14525 set msgctl d_msgctl
14528 : see if msgget exists
14529 set msgget d_msgget
14532 : see if msgsnd exists
14533 set msgsnd d_msgsnd
14536 : see if msgrcv exists
14537 set msgrcv d_msgrcv
14540 : see how much of the 'msg*(2)' library is present.
14543 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
14544 *"$undef"*) h_msg=false;;
14548 case "`ipcs 2>&1`" in
14549 "SVID messages"*"not configured"*)
14550 echo "Your $osname does not have the msg*(2) configured." >&4
14553 set msgctl d_msgctl
14555 set msgget d_msgget
14557 set msgsnd d_msgsnd
14559 set msgrcv d_msgrcv
14565 : we could also check for sys/ipc.h ...
14566 if $h_msg && $test `./findhdr sys/msg.h`; then
14567 echo "You have the full msg*(2) library." >&4
14570 echo "You don't have the full msg*(2) library." >&4
14578 echo "Checking to see if your system supports struct msghdr..." >&4
14579 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
14581 case "$d_msghdr_s" in
14582 "$define") echo "Yes, it does." ;;
14583 *) echo "No, it doesn't." ;;
14587 : see if msync exists
14591 : see if munmap exists
14592 set munmap d_munmap
14595 : see if nice exists
14599 : see if this is a langinfo.h system
14600 set langinfo.h i_langinfo
14603 : see if nl_langinfo exists
14604 set nl_langinfo d_nl_langinfo
14607 : check for length of character
14609 case "$charsize" in
14611 echo "Checking to see how big your characters are (hey, you never know)..." >&4
14614 #$i_stdlib I_STDLIB
14616 #include <stdlib.h>
14620 printf("%d\n", (int)sizeof(char));
14625 if eval $compile_ok; then
14629 echo "(I can't seem to compile the test program. Guessing...)"
14636 rp="What is the size of a character (in bytes)?"
14641 : check for volatile keyword
14643 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
14644 $cat >try.c <<'EOCP'
14647 typedef struct _goo_struct goo_struct;
14648 goo_struct * volatile goo = ((goo_struct *)0);
14649 struct _goo_struct {
14654 typedef unsigned short foo_t;
14655 char *volatile foo;
14657 volatile foo_t blech;
14661 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
14663 echo "Yup, it does."
14666 echo "Nope, it doesn't."
14674 $echo "Choosing the C types to be used for Perl's internal types..." >&4
14676 case "$use64bitint:$d_quad:$quadtype" in
14679 uvtype="$uquadtype"
14684 uvtype="unsigned long"
14690 case "$uselongdouble:$d_longdbl" in
14692 nvtype="long double"
14693 nvsize=$longdblsize
14700 $echo "(IV will be "$ivtype", $ivsize bytes)"
14701 $echo "(UV will be "$uvtype", $uvsize bytes)"
14702 $echo "(NV will be "$nvtype", $nvsize bytes)"
14705 #$i_inttypes I_INTTYPES
14707 #include <inttypes.h>
14712 int8_t i = INT8_MAX;
14713 uint8_t u = UINT8_MAX;
14714 printf("int8_t\n");
14717 int16_t i = INT16_MAX;
14718 uint16_t i = UINT16_MAX;
14719 printf("int16_t\n");
14722 int32_t i = INT32_MAX;
14723 uint32_t u = UINT32_MAX;
14724 printf("int32_t\n");
14730 '') case "$charsize" in
14732 u8type="unsigned char"
14741 if eval $compile; then
14742 case "`$run ./try`" in
14743 int8_t) i8type=int8_t
14753 '') if $test $charsize -ge 1; then
14755 u8type="unsigned char"
14763 '') case "$shortsize" in
14765 u16type="unsigned short"
14773 '') set try -DINT16
14774 if eval $compile; then
14775 case "`$run ./try`" in
14787 '') if $test $shortsize -ge 2; then
14789 u16type="unsigned short"
14797 '') case "$longsize" in
14799 u32type="unsigned long"
14803 *) case "$intsize" in
14805 u32type="unsigned int"
14815 '') set try -DINT32
14816 if eval $compile; then
14817 case "`$run ./try`" in
14829 '') if $test $intsize -ge 4; then
14831 u32type="unsigned int"
14839 '') case "$d_quad:$quadtype" in
14841 i64type="$quadtype"
14842 u64type="$uquadtype"
14850 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
14851 : volatile so that the compiler has to store it out to memory.
14852 if test X"$d_volatile" = X"$define"; then
14857 #$i_stdlib I_STDLIB
14859 #include <stdlib.h>
14861 #include <sys/types.h>
14862 #include <signal.h>
14864 $volatile int bletched = 0;
14865 $signal_t blech(s) int s; { bletched = 1; }
14870 int n = 8 * $uvsize;
14873 signal(SIGFPE, blech);
14876 for (i = 0; i < n; i++) {
14877 u = u << 1 | ($uvtype)1;
14879 if (($uvtype)d != u)
14883 d = ($nvtype)(u - 1);
14884 if (($uvtype)d != (u - 1))
14892 printf("%d\n", ((i == n) ? -n : i));
14898 d_nv_preserves_uv="$undef"
14899 if eval $compile; then
14900 nv_preserves_uv_bits="`$run ./try`"
14902 case "$nv_preserves_uv_bits" in
14904 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
14905 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
14906 d_nv_preserves_uv="$define"
14908 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
14909 d_nv_preserves_uv="$undef" ;;
14910 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
14911 nv_preserves_uv_bits="$undef" ;;
14916 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
14917 : volatile so that the compiler has to store it out to memory.
14918 if test X"$d_volatile" = X"$define"; then
14923 #$i_stdlib I_STDLIB
14925 #include <stdlib.h>
14927 #$i_string I_STRING
14929 # include <string.h>
14931 # include <strings.h>
14933 #include <sys/types.h>
14934 #include <signal.h>
14936 $volatile int bletched = 0;
14937 $signal_t blech(s) int s; { bletched = 1; }
14940 int checkit($nvtype d, char *where) {
14941 unsigned char *p = (char *)&d;
14942 unsigned char *end = p + sizeof(d);
14952 printf("No - %s: 0x", where);
14954 printf ("%02X", *p++);
14959 int main(int argc, char **argv) {
14962 fail += checkit(d, "0.0");
14964 /* The compiler shouldn't be assuming that bletched is 0 */
14967 fail += checkit(d, "bleched");
14970 signal(SIGFPE, blech);
14973 /* Paranoia - the compiler should have no way of knowing that ANSI says
14974 that argv[argc] will always be NULL. Actually, if it did assume this it
14975 would be buggy, as this is C and main() can be called from elsewhere in
14977 d = argv[argc] ? 1 : 0;
14980 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
14983 fail += checkit(d, "ternary");
14985 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
14988 printf("No - memset doesn't give 0.0\n");
14989 /* This might just blow up: */
14990 printf("(gives %g)\n", d);
14996 printf("No - something bleched\n");
15001 printf("No - %d fail(s)\n", fail);
15010 d_nv_zero_is_allbits_zero="$undef"
15011 if eval $compile; then
15017 0.0 is represented as all bits zero in memory
15019 d_nv_zero_is_allbits_zero="$define"
15022 0.0 is not represented as all bits zero in memory
15024 d_nv_zero_is_allbits_zero="$undef"
15029 0.0 is not represented as all bits zero in memory
15031 d_nv_zero_is_allbits_zero="$undef"
15039 : check for off64_t
15041 echo "Checking to see if you have off64_t..." >&4
15043 #include <sys/types.h>
15044 #include <unistd.h>
15045 int main() { off64_t x = 7; }
15048 if eval $compile; then
15050 echo "You have off64_t."
15053 echo "You do not have off64_t."
15054 case "$lseeksize" in
15055 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
15062 : how to create joinable pthreads
15063 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
15065 echo "Checking what constant to use for creating joinable pthreads..." >&4
15066 $cat >try.c <<'EOCP'
15067 #include <pthread.h>
15069 int detachstate = JOINABLE;
15072 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
15073 if eval $compile; then
15074 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
15075 val="$undef" # Yes, undef.
15076 set d_old_pthread_create_joinable
15079 set old_pthread_create_joinable
15082 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
15083 if eval $compile; then
15084 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
15086 set d_old_pthread_create_joinable
15088 val=PTHREAD_CREATE_UNDETACHED
15089 set old_pthread_create_joinable
15092 set try -DJOINABLE=__UNDETACHED
15093 if eval $compile; then
15094 echo "You seem to use __UNDETACHED." >&4
15096 set d_old_pthread_create_joinable
15099 set old_pthread_create_joinable
15102 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
15104 set d_old_pthread_create_joinable
15107 set old_pthread_create_joinable
15114 d_old_pthread_create_joinable="$undef"
15115 old_pthread_create_joinable=""
15118 : see if pause exists
15122 : see if pipe exists
15126 : see if poll exists
15130 : see if readlink exists
15131 set readlink d_readlink
15137 case "$d_readlink" in
15139 if $issymlink /proc/self/exe ; then
15140 $ls -l /proc/self/exe > reflect
15141 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15142 echo "You have Linux-like /proc/self/exe."
15143 procselfexe='"/proc/self/exe"'
15147 if $issymlink /proc/curproc/file ; then
15148 $ls -l /proc/curproc/file > reflect
15149 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15150 echo "You have BSD-like /proc/curproc/file."
15151 procselfexe='"/proc/curproc/file"'
15161 : see whether the pthread_atfork exists
15163 #include <pthread.h>
15166 #ifdef PTHREAD_ATFORK
15167 pthread_atfork(NULL,NULL,NULL);
15172 : see if pthread_atfork exists
15173 set try -DPTHREAD_ATFORK
15174 if eval $compile; then
15179 case "$usethreads" in
15182 $define) echo 'pthread_atfork found.' >&4 ;;
15183 *) echo 'pthread_atfork NOT found.' >&4 ;;
15186 set d_pthread_atfork
15189 : see if pthread_attr_setscope exists
15190 set pthread_attr_setscope d_pthread_attr_setscope
15194 : see whether the various POSIXish _yields exist
15196 #include <pthread.h>
15202 #ifdef PTHREAD_YIELD
15205 #ifdef PTHREAD_YIELD_NULL
15206 pthread_yield(NULL);
15212 : see if sched_yield exists
15213 set try -DSCHED_YIELD
15214 if eval $compile; then
15216 sched_yield='sched_yield()'
15220 case "$usethreads" in
15223 $define) echo 'sched_yield() found.' >&4 ;;
15224 *) echo 'sched_yield() NOT found.' >&4 ;;
15230 : see if pthread_yield exists
15231 set try -DPTHREAD_YIELD
15232 if eval $compile; then
15234 case "$sched_yield" in
15235 '') sched_yield='pthread_yield()' ;;
15238 set try -DPTHREAD_YIELD_NULL
15239 if eval $compile; then
15241 case "$sched_yield" in
15242 '') sched_yield='pthread_yield(NULL)' ;;
15248 case "$usethreads" in
15251 $define) echo 'pthread_yield() found.' >&4 ;;
15252 *) echo 'pthread_yield() NOT found.' >&4 ;;
15256 set d_pthread_yield
15259 case "$sched_yield" in
15260 '') sched_yield=undef ;;
15265 : see if random_r exists
15266 set random_r d_random_r
15268 case "$d_random_r" in
15270 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
15271 case "$d_random_r_proto:$usethreads" in
15272 ":define") d_random_r_proto=define
15273 set d_random_r_proto random_r $hdrs
15277 case "$d_random_r_proto" in
15279 case "$random_r_proto" in
15280 ''|0) try='int random_r(int*, struct random_data*);'
15281 ./protochk "extern $try" $hdrs && random_r_proto=I_iS ;;
15283 case "$random_r_proto" in
15284 ''|0) try='int random_r(long*, struct random_data*);'
15285 ./protochk "extern $try" $hdrs && random_r_proto=I_lS ;;
15287 case "$random_r_proto" in
15288 ''|0) try='int random_r(struct random_data*, int32_t*);'
15289 ./protochk "extern $try" $hdrs && random_r_proto=I_St ;;
15291 case "$random_r_proto" in
15292 ''|0) d_random_r=undef
15294 echo "Disabling random_r, cannot determine prototype." >&4 ;;
15295 * ) case "$random_r_proto" in
15296 REENTRANT_PROTO*) ;;
15297 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
15299 echo "Prototype: $try" ;;
15302 *) case "$usethreads" in
15303 define) echo "random_r has no prototype, not using it." >&4 ;;
15310 *) random_r_proto=0
15314 : see if readdir and friends exist
15315 set readdir d_readdir
15317 set seekdir d_seekdir
15319 set telldir d_telldir
15321 set rewinddir d_rewinddir
15324 : see if readdir64_r exists
15325 set readdir64_r d_readdir64_r
15327 case "$d_readdir64_r" in
15329 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15330 case "$d_readdir64_r_proto:$usethreads" in
15331 ":define") d_readdir64_r_proto=define
15332 set d_readdir64_r_proto readdir64_r $hdrs
15336 case "$d_readdir64_r_proto" in
15338 case "$readdir64_r_proto" in
15339 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
15340 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TSR ;;
15342 case "$readdir64_r_proto" in
15343 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
15344 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TS ;;
15346 case "$readdir64_r_proto" in
15347 ''|0) d_readdir64_r=undef
15348 readdir64_r_proto=0
15349 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
15350 * ) case "$readdir64_r_proto" in
15351 REENTRANT_PROTO*) ;;
15352 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
15354 echo "Prototype: $try" ;;
15357 *) case "$usethreads" in
15358 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
15360 d_readdir64_r=undef
15361 readdir64_r_proto=0
15365 *) readdir64_r_proto=0
15369 : see if readdir_r exists
15370 set readdir_r d_readdir_r
15372 case "$d_readdir_r" in
15374 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15375 case "$d_readdir_r_proto:$usethreads" in
15376 ":define") d_readdir_r_proto=define
15377 set d_readdir_r_proto readdir_r $hdrs
15381 case "$d_readdir_r_proto" in
15383 case "$readdir_r_proto" in
15384 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
15385 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TSR ;;
15387 case "$readdir_r_proto" in
15388 ''|0) try='int readdir_r(DIR*, struct dirent*);'
15389 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TS ;;
15391 case "$readdir_r_proto" in
15392 ''|0) d_readdir_r=undef
15394 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
15395 * ) case "$readdir_r_proto" in
15396 REENTRANT_PROTO*) ;;
15397 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
15399 echo "Prototype: $try" ;;
15402 *) case "$usethreads" in
15403 define) echo "readdir_r has no prototype, not using it." >&4 ;;
15410 *) readdir_r_proto=0
15414 : see if readv exists
15418 : see if recvmsg exists
15419 set recvmsg d_recvmsg
15422 : see if rename exists
15423 set rename d_rename
15426 : see if rmdir exists
15430 : see if memory.h is available.
15435 : See if it conflicts with string.h
15441 $cppstdin $cppflags $cppminus < $strings > mem.h
15442 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
15444 echo "We won't be including <memory.h>."
15454 : can bcopy handle overlapping blocks?
15457 case "$d_memmove" in
15458 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
15459 *) case "$d_bcopy" in
15461 echo "Checking to see if bcopy() can do overlapping copies..." >&4
15463 #$i_memory I_MEMORY
15464 #$i_stdlib I_STDLIB
15465 #$i_string I_STRING
15466 #$i_unistd I_UNISTD
15468 $cat >>try.c <<'EOCP'
15471 # include <memory.h>
15474 # include <stdlib.h>
15477 # include <string.h>
15479 # include <strings.h>
15482 # include <unistd.h> /* Needed for NetBSD */
15486 char buf[128], abc[128];
15492 /* Copy "abcde..." string to char abc[] so that gcc doesn't
15493 try to store the string in read-only memory. */
15494 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
15496 for (align = 7; align >= 0; align--) {
15497 for (len = 36; len; len--) {
15499 bcopy(abc, b, len);
15500 for (off = 1; off <= len; off++) {
15501 bcopy(b, b+off, len);
15502 bcopy(b+off, b, len);
15503 if (bcmp(b, abc, len))
15512 if eval $compile_ok; then
15513 if ./try 2>/dev/null; then
15514 echo "Yes, it can."
15517 echo "It can't, sorry."
15520 echo "(I can't compile the test program, so we'll assume not...)"
15524 $rm -f try.* try core
15530 : can memcpy handle overlapping blocks?
15533 case "$d_memmove" in
15534 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
15535 *) case "$d_memcpy" in
15537 echo "Checking to see if memcpy() can do overlapping copies..." >&4
15539 #$i_memory I_MEMORY
15540 #$i_stdlib I_STDLIB
15541 #$i_string I_STRING
15542 #$i_unistd I_UNISTD
15544 $cat >>try.c <<'EOCP'
15547 # include <memory.h>
15550 # include <stdlib.h>
15553 # include <string.h>
15555 # include <strings.h>
15558 # include <unistd.h> /* Needed for NetBSD */
15562 char buf[128], abc[128];
15568 /* Copy "abcde..." string to char abc[] so that gcc doesn't
15569 try to store the string in read-only memory. */
15570 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
15572 for (align = 7; align >= 0; align--) {
15573 for (len = 36; len; len--) {
15575 memcpy(b, abc, len);
15576 for (off = 1; off <= len; off++) {
15577 memcpy(b+off, b, len);
15578 memcpy(b, b+off, len);
15579 if (memcmp(b, abc, len))
15588 if eval $compile_ok; then
15589 if ./try 2>/dev/null; then
15590 echo "Yes, it can."
15593 echo "It can't, sorry."
15596 echo "(I can't compile the test program, so we'll assume not...)"
15600 $rm -f try.* try core
15606 : can memcmp be trusted to compare relative magnitude?
15608 case "$d_memcmp" in
15611 echo "Checking if your memcmp() can compare relative magnitude..." >&4
15613 #$i_memory I_MEMORY
15614 #$i_stdlib I_STDLIB
15615 #$i_string I_STRING
15616 #$i_unistd I_UNISTD
15618 $cat >>try.c <<'EOCP'
15621 # include <memory.h>
15624 # include <stdlib.h>
15627 # include <string.h>
15629 # include <strings.h>
15632 # include <unistd.h> /* Needed for NetBSD */
15638 if ((a < b) && memcmp(&a, &b, 1) < 0)
15644 if eval $compile_ok; then
15645 if $run ./try 2>/dev/null; then
15646 echo "Yes, it can."
15649 echo "No, it can't (it uses signed chars)."
15652 echo "(I can't compile the test program, so we'll assume not...)"
15656 $rm -f try.* try core
15660 : see if prototype for sbrk is available
15662 set d_sbrkproto sbrk $i_unistd unistd.h
15665 : see if select exists
15666 set select d_select
15669 : see if semctl exists
15670 set semctl d_semctl
15673 : see if semget exists
15674 set semget d_semget
15677 : see if semop exists
15681 : see how much of the 'sem*(2)' library is present.
15684 case "$d_semctl$d_semget$d_semop" in
15685 *"$undef"*) h_sem=false;;
15689 case "`ipcs 2>&1`" in
15690 "SVID messages"*"not configured"*)
15691 echo "Your $osname does not have the sem*(2) configured." >&4
15694 set semctl d_semctl
15696 set semget d_semget
15704 : we could also check for sys/ipc.h ...
15705 if $h_sem && $test `./findhdr sys/sem.h`; then
15706 echo "You have the full sem*(2) library." >&4
15709 echo "You don't have the full sem*(2) library." >&4
15715 : see whether sys/sem.h defines union semun
15717 $cat > try.c <<'END'
15718 #include <sys/types.h>
15719 #include <sys/ipc.h>
15720 #include <sys/sem.h>
15721 int main () { union semun semun; semun.buf = 0; }
15724 if eval $compile; then
15725 echo "You have union semun in <sys/sem.h>." >&4
15728 echo "You do not have union semun in <sys/sem.h>." >&4
15735 : see how to do semctl IPC_STAT
15742 # define S_IRUSR S_IREAD
15743 # define S_IWUSR S_IWRITE
15744 # define S_IXUSR S_IEXEC
15746 # define S_IRUSR 0400
15747 # define S_IWUSR 0200
15748 # define S_IXUSR 0100
15750 # define S_IRGRP (S_IRUSR>>3)
15751 # define S_IWGRP (S_IWUSR>>3)
15752 # define S_IXGRP (S_IXUSR>>3)
15753 # define S_IROTH (S_IRUSR>>6)
15754 # define S_IWOTH (S_IWUSR>>6)
15755 # define S_IXOTH (S_IXUSR>>6)
15758 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
15759 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
15760 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
15763 : see whether semctl IPC_STAT can use union semun
15764 case "$d_semctl_semun" in
15768 #include <sys/types.h>
15769 #include <sys/ipc.h>
15770 #include <sys/sem.h>
15771 #include <sys/stat.h>
15778 #$d_union_semun HAS_UNION_SEMUN
15781 #ifndef HAS_UNION_SEMUN
15784 struct semid_ds *buf;
15785 unsigned short *array;
15791 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
15792 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
15794 struct semid_ds argbuf;
15797 st = semctl(sem, 0, IPC_STAT, arg);
15801 # endif /* IPC_STAT */
15802 printf("semctl IPC_STAT failed: errno = %d\n", errno);
15804 if (semctl(sem, 0, IPC_RMID, arg) != 0)
15805 # endif /* IPC_RMID */
15806 printf("semctl IPC_RMID failed: errno = %d\n", errno);
15808 #endif /* IPC_PRIVATE && ... */
15809 printf("semget failed: errno = %d\n", errno);
15814 if eval $compile; then
15817 semun) val="$define" ;;
15825 case "$d_semctl_semun" in
15827 echo "You can use union semun for semctl IPC_STAT." >&4
15830 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
15835 : see whether semctl IPC_STAT can use struct semid_ds pointer
15836 case "$d_semctl_semid_ds" in
15839 $cat > try.c <<'END'
15840 #include <sys/types.h>
15841 #include <sys/ipc.h>
15842 #include <sys/sem.h>
15843 #include <sys/stat.h>
15851 struct semid_ds arg;
15854 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
15855 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
15858 st = semctl(sem, 0, IPC_STAT, &arg);
15860 printf("semid_ds\n");
15862 # endif /* IPC_STAT */
15863 printf("semctl IPC_STAT failed: errno = %d\n", errno);
15865 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
15866 # endif /* IPC_RMID */
15867 printf("semctl IPC_RMID failed: errno = %d\n", errno);
15869 #endif /* IPC_PRIVATE && ... */
15870 printf("semget failed: errno = %d\n", errno);
15876 if eval $compile; then
15879 semid_ds) val="$define" ;;
15883 set d_semctl_semid_ds
15887 case "$d_semctl_semid_ds" in
15889 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
15891 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
15898 # We do not have the full sem*(2) library, so assume we can not
15904 set d_semctl_semid_ds
15909 : see if sendmsg exists
15910 set sendmsg d_sendmsg
15913 : see if setegid exists
15914 set setegid d_setegid
15917 : see if seteuid exists
15918 set seteuid d_seteuid
15921 : see if setgrent exists
15922 set setgrent d_setgrent
15925 : see if setgrent_r exists
15926 set setgrent_r d_setgrent_r
15928 case "$d_setgrent_r" in
15930 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
15931 case "$d_setgrent_r_proto:$usethreads" in
15932 ":define") d_setgrent_r_proto=define
15933 set d_setgrent_r_proto setgrent_r $hdrs
15937 case "$d_setgrent_r_proto" in
15939 case "$setgrent_r_proto" in
15940 ''|0) try='int setgrent_r(FILE**);'
15941 ./protochk "extern $try" $hdrs && setgrent_r_proto=I_H ;;
15943 case "$setgrent_r_proto" in
15944 ''|0) try='void setgrent_r(FILE**);'
15945 ./protochk "extern $try" $hdrs && setgrent_r_proto=V_H ;;
15947 case "$setgrent_r_proto" in
15948 ''|0) d_setgrent_r=undef
15950 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
15951 * ) case "$setgrent_r_proto" in
15952 REENTRANT_PROTO*) ;;
15953 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
15955 echo "Prototype: $try" ;;
15958 *) case "$usethreads" in
15959 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
15966 *) setgrent_r_proto=0
15970 : see if sethostent exists
15971 set sethostent d_sethent
15974 : see if sethostent_r exists
15975 set sethostent_r d_sethostent_r
15977 case "$d_sethostent_r" in
15979 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15980 case "$d_sethostent_r_proto:$usethreads" in
15981 ":define") d_sethostent_r_proto=define
15982 set d_sethostent_r_proto sethostent_r $hdrs
15986 case "$d_sethostent_r_proto" in
15988 case "$sethostent_r_proto" in
15989 ''|0) try='int sethostent_r(int, struct hostent_data*);'
15990 ./protochk "extern $try" $hdrs && sethostent_r_proto=I_ID ;;
15992 case "$sethostent_r_proto" in
15993 ''|0) try='void sethostent_r(int, struct hostent_data*);'
15994 ./protochk "extern $try" $hdrs && sethostent_r_proto=V_ID ;;
15996 case "$sethostent_r_proto" in
15997 ''|0) d_sethostent_r=undef
15998 sethostent_r_proto=0
15999 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
16000 * ) case "$sethostent_r_proto" in
16001 REENTRANT_PROTO*) ;;
16002 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
16004 echo "Prototype: $try" ;;
16007 *) case "$usethreads" in
16008 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
16010 d_sethostent_r=undef
16011 sethostent_r_proto=0
16015 *) sethostent_r_proto=0
16019 : see if setitimer exists
16020 set setitimer d_setitimer
16023 : see if setlinebuf exists
16024 set setlinebuf d_setlinebuf
16027 : see if setlocale exists
16028 set setlocale d_setlocale
16031 : see if locale.h is available
16032 set locale.h i_locale
16035 : see if setlocale_r exists
16036 set setlocale_r d_setlocale_r
16038 case "$d_setlocale_r" in
16040 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
16041 case "$d_setlocale_r_proto:$usethreads" in
16042 ":define") d_setlocale_r_proto=define
16043 set d_setlocale_r_proto setlocale_r $hdrs
16047 case "$d_setlocale_r_proto" in
16049 case "$setlocale_r_proto" in
16050 ''|0) try='int setlocale_r(int, const char*, char*, int);'
16051 ./protochk "extern $try" $hdrs && setlocale_r_proto=I_ICBI ;;
16053 case "$setlocale_r_proto" in
16054 ''|0) d_setlocale_r=undef
16055 setlocale_r_proto=0
16056 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
16057 * ) case "$setlocale_r_proto" in
16058 REENTRANT_PROTO*) ;;
16059 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
16061 echo "Prototype: $try" ;;
16064 *) case "$usethreads" in
16065 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
16067 d_setlocale_r=undef
16068 setlocale_r_proto=0
16072 *) setlocale_r_proto=0
16076 : see if setnetent exists
16077 set setnetent d_setnent
16080 : see if setnetent_r exists
16081 set setnetent_r d_setnetent_r
16083 case "$d_setnetent_r" in
16085 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16086 case "$d_setnetent_r_proto:$usethreads" in
16087 ":define") d_setnetent_r_proto=define
16088 set d_setnetent_r_proto setnetent_r $hdrs
16092 case "$d_setnetent_r_proto" in
16094 case "$setnetent_r_proto" in
16095 ''|0) try='int setnetent_r(int, struct netent_data*);'
16096 ./protochk "extern $try" $hdrs && setnetent_r_proto=I_ID ;;
16098 case "$setnetent_r_proto" in
16099 ''|0) try='void setnetent_r(int, struct netent_data*);'
16100 ./protochk "extern $try" $hdrs && setnetent_r_proto=V_ID ;;
16102 case "$setnetent_r_proto" in
16103 ''|0) d_setnetent_r=undef
16104 setnetent_r_proto=0
16105 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
16106 * ) case "$setnetent_r_proto" in
16107 REENTRANT_PROTO*) ;;
16108 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
16110 echo "Prototype: $try" ;;
16113 *) case "$usethreads" in
16114 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
16116 d_setnetent_r=undef
16117 setnetent_r_proto=0
16121 *) setnetent_r_proto=0
16125 : see if setprotoent exists
16126 set setprotoent d_setpent
16129 : see if setpgid exists
16130 set setpgid d_setpgid
16133 : see if setpgrp2 exists
16134 set setpgrp2 d_setpgrp2
16137 : see if setpriority exists
16138 set setpriority d_setprior
16141 : see if setproctitle exists
16142 set setproctitle d_setproctitle
16145 : see if setprotoent_r exists
16146 set setprotoent_r d_setprotoent_r
16148 case "$d_setprotoent_r" in
16150 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16151 case "$d_setprotoent_r_proto:$usethreads" in
16152 ":define") d_setprotoent_r_proto=define
16153 set d_setprotoent_r_proto setprotoent_r $hdrs
16157 case "$d_setprotoent_r_proto" in
16159 case "$setprotoent_r_proto" in
16160 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
16161 ./protochk "extern $try" $hdrs && setprotoent_r_proto=I_ID ;;
16163 case "$setprotoent_r_proto" in
16164 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
16165 ./protochk "extern $try" $hdrs && setprotoent_r_proto=V_ID ;;
16167 case "$setprotoent_r_proto" in
16168 ''|0) d_setprotoent_r=undef
16169 setprotoent_r_proto=0
16170 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
16171 * ) case "$setprotoent_r_proto" in
16172 REENTRANT_PROTO*) ;;
16173 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
16175 echo "Prototype: $try" ;;
16178 *) case "$usethreads" in
16179 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
16181 d_setprotoent_r=undef
16182 setprotoent_r_proto=0
16186 *) setprotoent_r_proto=0
16190 : see if setpwent exists
16191 set setpwent d_setpwent
16194 : see if setpwent_r exists
16195 set setpwent_r d_setpwent_r
16197 case "$d_setpwent_r" in
16199 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
16200 case "$d_setpwent_r_proto:$usethreads" in
16201 ":define") d_setpwent_r_proto=define
16202 set d_setpwent_r_proto setpwent_r $hdrs
16206 case "$d_setpwent_r_proto" in
16208 case "$setpwent_r_proto" in
16209 ''|0) try='int setpwent_r(FILE**);'
16210 ./protochk "extern $try" $hdrs && setpwent_r_proto=I_H ;;
16212 case "$setpwent_r_proto" in
16213 ''|0) try='void setpwent_r(FILE**);'
16214 ./protochk "extern $try" $hdrs && setpwent_r_proto=V_H ;;
16216 case "$setpwent_r_proto" in
16217 ''|0) d_setpwent_r=undef
16219 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
16220 * ) case "$setpwent_r_proto" in
16221 REENTRANT_PROTO*) ;;
16222 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
16224 echo "Prototype: $try" ;;
16227 *) case "$usethreads" in
16228 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
16235 *) setpwent_r_proto=0
16239 : see if setregid exists
16240 set setregid d_setregid
16242 set setresgid d_setresgid
16245 : see if setreuid exists
16246 set setreuid d_setreuid
16248 set setresuid d_setresuid
16251 : see if setrgid exists
16252 set setrgid d_setrgid
16255 : see if setruid exists
16256 set setruid d_setruid
16259 : see if setservent exists
16260 set setservent d_setsent
16263 : see if setservent_r exists
16264 set setservent_r d_setservent_r
16266 case "$d_setservent_r" in
16268 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16269 case "$d_setservent_r_proto:$usethreads" in
16270 ":define") d_setservent_r_proto=define
16271 set d_setservent_r_proto setservent_r $hdrs
16275 case "$d_setservent_r_proto" in
16277 case "$setservent_r_proto" in
16278 ''|0) try='int setservent_r(int, struct servent_data*);'
16279 ./protochk "extern $try" $hdrs && setservent_r_proto=I_ID ;;
16281 case "$setservent_r_proto" in
16282 ''|0) try='void setservent_r(int, struct servent_data*);'
16283 ./protochk "extern $try" $hdrs && setservent_r_proto=V_ID ;;
16285 case "$setservent_r_proto" in
16286 ''|0) d_setservent_r=undef
16287 setservent_r_proto=0
16288 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
16289 * ) case "$setservent_r_proto" in
16290 REENTRANT_PROTO*) ;;
16291 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
16293 echo "Prototype: $try" ;;
16296 *) case "$usethreads" in
16297 define) echo "setservent_r has no prototype, not using it." >&4 ;;
16299 d_setservent_r=undef
16300 setservent_r_proto=0
16304 *) setservent_r_proto=0
16308 : see if setsid exists
16309 set setsid d_setsid
16312 : see if setvbuf exists
16313 set setvbuf d_setvbuf
16316 : see if sfio.h is available
16321 : see if sfio library is available
16332 : Ok, but do we want to use it.
16336 true|$define|[yY]*) dflt='y';;
16339 echo "$package can use the sfio library, but it is experimental."
16340 case "$useperlio" in
16342 echo "For sfio also the PerlIO abstraction layer is needed."
16343 echo "Earlier you said you wouldn't want that."
16346 rp="You seem to have sfio available, do you want to try using it?"
16349 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
16350 useperlio="$define"
16353 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
16358 *) case "$usesfio" in
16359 true|$define|[yY]*)
16360 echo "Sorry, cannot find sfio on this machine." >&4
16361 echo "Ignoring your setting of usesfio=$usesfio." >&4
16370 $define) usesfio='true';;
16371 *) usesfio='false';;
16375 *) : Remove sfio from list of libraries to use
16378 echo "Removing unneeded -lsfio from library list" >&4
16379 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
16382 echo "libs = $libs" >&4
16389 : see if shmctl exists
16390 set shmctl d_shmctl
16393 : see if shmget exists
16394 set shmget d_shmget
16397 : see if shmat exists
16400 : see what shmat returns
16403 $cat >shmat.c <<'END'
16404 #include <sys/shm.h>
16407 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
16412 echo "and it returns ($shmattype)." >&4
16413 : see if a prototype for shmat is available
16414 xxx=`./findhdr sys/shm.h`
16415 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
16416 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
16427 set d_shmatprototype
16430 : see if shmdt exists
16434 : see how much of the 'shm*(2)' library is present.
16437 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
16438 *"$undef"*) h_shm=false;;
16442 case "`ipcs 2>&1`" in
16443 "SVID shared memory"*"not configured"*)
16444 echo "Your $osname does not have the shm*(2) configured." >&4
16447 set shmctl d_shmctl
16449 set shmget d_shmget
16459 : we could also check for sys/ipc.h ...
16460 if $h_shm && $test `./findhdr sys/shm.h`; then
16461 echo "You have the full shm*(2) library." >&4
16464 echo "You don't have the full shm*(2) library." >&4
16471 : see if we have sigaction
16472 if set sigaction val -f d_sigaction; eval $csym; $val; then
16473 echo 'sigaction() found.' >&4
16476 #include <sys/types.h>
16477 #include <signal.h>
16478 #$i_stdlib I_STDLIB
16480 #include <stdlib.h>
16484 struct sigaction act, oact;
16486 oact.sa_handler = 0;
16487 /* so that act and oact are used */
16488 exit(act.sa_flags == 0 && oact.sa_handler == 0);
16492 if eval $compile_ok; then
16495 echo "But you don't seem to have a useable struct sigaction." >&4
16499 echo 'sigaction NOT found.' >&4
16502 set d_sigaction; eval $setvar
16503 $rm -f try try$_o try.c
16505 : see if sigprocmask exists
16506 set sigprocmask d_sigprocmask
16509 : see if sigsetjmp exists
16511 case "$d_sigsetjmp" in
16514 #include <setjmp.h>
16515 #$i_stdlib I_STDLIB
16517 #include <stdlib.h>
16523 if (sigsetjmp(env,1))
16526 siglongjmp(env, 1);
16531 if eval $compile; then
16532 if $run ./try >/dev/null 2>&1; then
16533 echo "POSIX sigsetjmp found." >&4
16537 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
16543 echo "sigsetjmp not found." >&4
16547 *) val="$d_sigsetjmp"
16548 case "$d_sigsetjmp" in
16549 $define) echo "POSIX sigsetjmp found." >&4;;
16550 $undef) echo "sigsetjmp not found." >&4;;
16558 : see if snprintf exists
16559 set snprintf d_snprintf
16562 : see if vsnprintf exists
16563 set vsnprintf d_vsnprintf
16566 case "$d_snprintf-$d_vsnprintf" in
16569 Checking whether your snprintf() and vsnprintf() work okay...
16571 $cat >try.c <<'EOCP'
16572 /* v?snprintf testing logic courtesy of Russ Allbery.
16573 * According to C99:
16574 * - if the buffer is too short it still must be \0-terminated
16575 * - if the buffer is too short the potentially required length
16576 * must be returned and not -1
16577 * - if the buffer is NULL the potentially required length
16578 * must be returned and not -1 or core dump
16581 #include <stdarg.h>
16585 int test (char *format, ...)
16590 va_start (args, format);
16591 count = vsnprintf (buf, sizeof buf, format, args);
16598 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
16599 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
16603 if eval $compile; then
16606 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
16608 Your snprintf() and snprintf() don't seem to be working okay.
16610 d_snprintf="$undef"
16611 d_vsnprintf="$undef"
16615 echo "(I can't seem to compile the test program--assuming they don't)"
16616 d_snprintf="$undef"
16617 d_vsnprintf="$undef"
16619 $rm -f try.* try core core.try.*
16623 : see if sockatmark exists
16624 set sockatmark d_sockatmark
16627 : see if prototype for sockatmark is available
16629 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
16632 : see if socks5_init exists
16633 set socks5_init d_socks5_init
16636 : see if sprintf returns the length of the string in the buffer as per ANSI
16637 $echo "Checking whether sprintf returns the length of the string..." >&4
16640 #$i_stdlib I_STDLIB
16642 #include <stdlib.h>
16644 #$i_string I_STRING
16646 # include <string.h>
16648 # include <strings.h>
16657 int check (size_t expect, int test) {
16658 size_t got = strlen(buffer);
16662 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
16667 int main(int argc, char **argv) {
16670 check(sprintf(buffer, ""), ++test);
16671 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
16672 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
16679 d_sprintf_returns_strlen="$undef"
16680 if eval $compile; then
16684 sprintf returns the length of the string (as ANSI says it should)
16686 d_sprintf_returns_strlen="$define"
16689 sprintf does not return the length of the string (how old is this system?)
16691 d_sprintf_returns_strlen="$undef"
16698 : see if srand48_r exists
16699 set srand48_r d_srand48_r
16701 case "$d_srand48_r" in
16703 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16704 case "$d_srand48_r_proto:$usethreads" in
16705 ":define") d_srand48_r_proto=define
16706 set d_srand48_r_proto srand48_r $hdrs
16710 case "$d_srand48_r_proto" in
16712 case "$srand48_r_proto" in
16713 ''|0) try='int srand48_r(long, struct drand48_data*);'
16714 ./protochk "extern $try" $hdrs && srand48_r_proto=I_LS ;;
16716 case "$srand48_r_proto" in
16717 ''|0) d_srand48_r=undef
16719 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
16720 * ) case "$srand48_r_proto" in
16721 REENTRANT_PROTO*) ;;
16722 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
16724 echo "Prototype: $try" ;;
16727 *) case "$usethreads" in
16728 define) echo "srand48_r has no prototype, not using it." >&4 ;;
16735 *) srand48_r_proto=0
16739 : see if srandom_r exists
16740 set srandom_r d_srandom_r
16742 case "$d_srandom_r" in
16744 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16745 case "$d_srandom_r_proto:$usethreads" in
16746 ":define") d_srandom_r_proto=define
16747 set d_srandom_r_proto srandom_r $hdrs
16751 case "$d_srandom_r_proto" in
16753 case "$srandom_r_proto" in
16754 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
16755 ./protochk "extern $try" $hdrs && srandom_r_proto=I_TS ;;
16757 case "$srandom_r_proto" in
16758 ''|0) d_srandom_r=undef
16760 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
16761 * ) case "$srandom_r_proto" in
16762 REENTRANT_PROTO*) ;;
16763 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
16765 echo "Prototype: $try" ;;
16768 *) case "$usethreads" in
16769 define) echo "srandom_r has no prototype, not using it." >&4 ;;
16776 *) srandom_r_proto=0
16780 : see if prototype for setresgid is available
16782 set d_sresgproto setresgid $i_unistd unistd.h
16785 : see if prototype for setresuid is available
16787 set d_sresuproto setresuid $i_unistd unistd.h
16790 : see if sys/stat.h is available
16791 set sys/stat.h i_sysstat
16795 : see if stat knows about block sizes
16797 echo "Checking to see if your struct stat has st_blocks field..." >&4
16798 set d_statblks stat st_blocks $i_sysstat sys/stat.h
16802 : see if this is a sys/vfs.h system
16803 set sys/vfs.h i_sysvfs
16807 : see if this is a sys/statfs.h system
16808 set sys/statfs.h i_sysstatfs
16813 echo "Checking to see if your system supports struct statfs..." >&4
16814 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
16816 case "$d_statfs_s" in
16817 "$define") echo "Yes, it does." ;;
16818 *) echo "No, it doesn't." ;;
16823 : see if struct statfs knows about f_flags
16824 case "$d_statfs_s" in
16827 echo "Checking to see if your struct statfs has f_flags field..." >&4
16828 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
16832 set d_statfs_f_flags
16836 case "$d_statfs_f_flags" in
16837 "$define") echo "Yes, it does." ;;
16838 *) echo "No, it doesn't." ;;
16842 Checking how to access stdio streams by file descriptor number...
16844 case "$stdio_stream_array" in
16845 '') $cat >try.c <<EOCP
16848 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
16852 for s in _iob __iob __sF
16854 set try -DSTDIO_STREAM_ARRAY=$s
16855 if eval $compile; then
16856 case "`$run ./try`" in
16857 yes) stdio_stream_array=$s; break ;;
16861 $rm -f try.* try$exe_ext
16863 case "$stdio_stream_array" in
16865 I can't figure out how to access stdio streams by file descriptor number.
16867 d_stdio_stream_array="$undef"
16870 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
16872 d_stdio_stream_array="$define"
16876 : see if strcoll exists
16877 set strcoll d_strcoll
16880 : check for structure copying
16882 echo "Checking to see if your C compiler can copy structs..." >&4
16883 $cat >try.c <<'EOCP'
16893 if $cc -c try.c >/dev/null 2>&1 ; then
16895 echo "Yup, it can."
16898 echo "Nope, it can't."
16904 : see if strerror and/or sys_errlist[] exist
16906 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
16907 if set strerror val -f d_strerror; eval $csym; $val; then
16908 echo 'strerror() found.' >&4
16909 d_strerror="$define"
16910 d_strerrm='strerror(e)'
16911 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
16912 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
16913 d_syserrlst="$define"
16915 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
16916 d_syserrlst="$undef"
16918 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
16919 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
16920 echo 'strerror() found in string header.' >&4
16921 d_strerror="$define"
16922 d_strerrm='strerror(e)'
16923 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
16924 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
16925 d_syserrlst="$define"
16927 echo "(You don't appear to have any sys_errlist[], how can this be?)"
16928 d_syserrlst="$undef"
16930 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
16931 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
16932 d_strerror="$undef"
16933 d_syserrlst="$define"
16934 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
16936 echo 'strerror() and sys_errlist[] NOT found.' >&4
16937 d_strerror="$undef"
16938 d_syserrlst="$undef"
16939 d_strerrm='"unknown"'
16943 : see if strerror_r exists
16944 set strerror_r d_strerror_r
16946 case "$d_strerror_r" in
16948 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
16949 case "$d_strerror_r_proto:$usethreads" in
16950 ":define") d_strerror_r_proto=define
16951 set d_strerror_r_proto strerror_r $hdrs
16955 case "$d_strerror_r_proto" in
16957 case "$strerror_r_proto" in
16958 ''|0) try='int strerror_r(int, char*, size_t);'
16959 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBW ;;
16961 case "$strerror_r_proto" in
16962 ''|0) try='int strerror_r(int, char*, int);'
16963 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBI ;;
16965 case "$strerror_r_proto" in
16966 ''|0) try='char* strerror_r(int, char*, size_t);'
16967 ./protochk "extern $try" $hdrs && strerror_r_proto=B_IBW ;;
16969 case "$strerror_r_proto" in
16970 ''|0) d_strerror_r=undef
16972 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
16973 * ) case "$strerror_r_proto" in
16974 REENTRANT_PROTO*) ;;
16975 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
16977 echo "Prototype: $try" ;;
16980 *) case "$usethreads" in
16981 define) echo "strerror_r has no prototype, not using it." >&4 ;;
16988 *) strerror_r_proto=0
16992 : see if strftime exists
16993 set strftime d_strftime
16996 : see if strlcat exists
16997 set strlcat d_strlcat
17000 : see if strlcpy exists
17001 set strlcpy d_strlcpy
17004 : see if strtod exists
17005 set strtod d_strtod
17008 : see if strtol exists
17009 set strtol d_strtol
17012 : see if strtold exists
17013 set strtold d_strtold
17016 : see if strtoll exists
17017 set strtoll d_strtoll
17020 case "$d_longlong-$d_strtoll" in
17023 Checking whether your strtoll() works okay...
17025 $cat >try.c <<'EOCP'
17028 #define strtoll __strtoll
17031 #define strtoll _strtoll
17034 extern long long int strtoll(char *s, char **, int);
17035 static int bad = 0;
17036 int check(char *s, long long ell, int een) {
17039 gll = strtoll(s, 0, 10);
17040 if (!((gll == ell) && (errno == een)))
17044 check(" 1", 1LL, 0);
17045 check(" 0", 0LL, 0);
17046 check("-1", -1LL, 0);
17047 check("-9223372036854775808", -9223372036854775808LL, 0);
17048 check("-9223372036854775808", -9223372036854775808LL, 0);
17049 check(" 9223372036854775807", 9223372036854775807LL, 0);
17050 check("-9223372036854775808", -9223372036854775808LL, 0);
17051 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
17052 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
17058 if eval $compile; then
17061 ok) echo "Your strtoll() seems to be working okay." ;;
17063 Your strtoll() doesn't seem to be working okay.
17069 echo "(I can't seem to compile the test program--assuming it doesn't)"
17075 : see if strtoq exists
17076 set strtoq d_strtoq
17079 : see if strtoul exists
17080 set strtoul d_strtoul
17083 case "$d_strtoul" in
17086 Checking whether your strtoul() works okay...
17088 $cat >try.c <<'EOCP'
17091 extern unsigned long int strtoul(char *s, char **, int);
17092 static int bad = 0;
17093 void check(char *s, unsigned long eul, int een) {
17096 gul = strtoul(s, 0, 10);
17097 if (!((gul == eul) && (errno == een)))
17101 check(" 1", 1L, 0);
17102 check(" 0", 0L, 0);
17104 case "$longsize" in
17106 $cat >>try.c <<'EOCP'
17107 check("18446744073709551615", 18446744073709551615UL, 0);
17108 check("18446744073709551616", 18446744073709551615UL, ERANGE);
17109 #if 0 /* strtoul() for /^-/ strings is undefined. */
17110 check("-1", 18446744073709551615UL, 0);
17111 check("-18446744073709551614", 2, 0);
17112 check("-18446744073709551615", 1, 0);
17113 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
17114 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
17119 $cat >>try.c <<'EOCP'
17120 check("4294967295", 4294967295UL, 0);
17121 check("4294967296", 4294967295UL, ERANGE);
17122 #if 0 /* strtoul() for /^-/ strings is undefined. */
17123 check("-1", 4294967295UL, 0);
17124 check("-4294967294", 2, 0);
17125 check("-4294967295", 1, 0);
17126 check("-4294967296", 4294967295UL, ERANGE);
17127 check("-4294967297", 4294967295UL, ERANGE);
17132 : Should we write these tests to be more portable by sprintf-ing
17133 : ~0 and then manipulating that char string as input for strtol?
17136 $cat >>try.c <<'EOCP'
17143 if eval $compile; then
17144 case "`$run ./try`" in
17145 ok) echo "Your strtoul() seems to be working okay." ;;
17147 Your strtoul() doesn't seem to be working okay.
17156 : see if strtoull exists
17157 set strtoull d_strtoull
17160 case "$d_longlong-$d_strtoull" in
17163 Checking whether your strtoull() works okay...
17165 $cat >try.c <<'EOCP'
17168 #define strtoull __strtoull
17171 extern unsigned long long int strtoull(char *s, char **, int);
17172 static int bad = 0;
17173 int check(char *s, long long eull, int een) {
17176 gull = strtoull(s, 0, 10);
17177 if (!((gull == eull) && (errno == een)))
17181 check(" 1", 1LL, 0);
17182 check(" 0", 0LL, 0);
17183 check("18446744073709551615", 18446744073709551615ULL, 0);
17184 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17185 #if 0 /* strtoull() for /^-/ strings is undefined. */
17186 check("-1", 18446744073709551615ULL, 0);
17187 check("-18446744073709551614", 2LL, 0);
17188 check("-18446744073709551615", 1LL, 0);
17189 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17190 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17197 if eval $compile; then
17198 case "`$run ./try`" in
17199 ok) echo "Your strtoull() seems to be working okay." ;;
17201 Your strtoull() doesn't seem to be working okay.
17203 d_strtoull="$undef"
17210 : see if strtouq exists
17211 set strtouq d_strtouq
17214 case "$d_strtouq" in
17217 Checking whether your strtouq() works okay...
17219 $cat >try.c <<'EOCP'
17222 extern unsigned long long int strtouq(char *s, char **, int);
17223 static int bad = 0;
17224 void check(char *s, unsigned long long eull, int een) {
17225 unsigned long long gull;
17227 gull = strtouq(s, 0, 10);
17228 if (!((gull == eull) && (errno == een)))
17232 check(" 1", 1LL, 0);
17233 check(" 0", 0LL, 0);
17234 check("18446744073709551615", 18446744073709551615ULL, 0);
17235 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17236 #if 0 /* strtouq() for /^-/ strings is undefined. */
17237 check("-1", 18446744073709551615ULL, 0);
17238 check("-18446744073709551614", 2LL, 0);
17239 check("-18446744073709551615", 1LL, 0);
17240 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17241 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17249 if eval $compile; then
17250 case "`$run ./try`" in
17251 ok) echo "Your strtouq() seems to be working okay." ;;
17253 Your strtouq() doesn't seem to be working okay.
17262 : see if strxfrm exists
17263 set strxfrm d_strxfrm
17266 : see if symlink exists
17267 set symlink d_symlink
17270 : see if syscall exists
17271 set syscall d_syscall
17274 : see if prototype for syscall is available
17276 set d_syscallproto syscall $i_unistd unistd.h
17279 : see if sysconf exists
17280 set sysconf d_sysconf
17283 : see if system exists
17284 set system d_system
17287 : see if tcgetpgrp exists
17288 set tcgetpgrp d_tcgetpgrp
17291 : see if tcsetpgrp exists
17292 set tcsetpgrp d_tcsetpgrp
17295 : see if prototype for telldir is available
17297 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
17300 : see if time exists
17302 if test "X$d_time" = X -o X"$timetype" = X; then
17303 if set time val -f d_time; eval $csym; $val; then
17304 echo 'time() found.' >&4
17306 rp="What is the type returned by time() on this system?"
17307 set time_t timetype long stdio.h sys/types.h
17310 echo 'time() not found, hope that will do.' >&4
17318 : see if this is a sys/times.h system
17319 set sys/times.h i_systimes
17322 : see if times exists
17324 if set times val -f d_times; eval $csym; $val; then
17325 echo 'times() found.' >&4
17328 case "$i_systimes" in
17329 "$define") inc='sys/times.h';;
17331 rp="What is the type returned by times() on this system?"
17332 set clock_t clocktype long stdio.h sys/types.h $inc
17335 echo 'times() NOT found, hope that will do.' >&4
17340 : see if tmpnam_r exists
17341 set tmpnam_r d_tmpnam_r
17343 case "$d_tmpnam_r" in
17345 hdrs="$i_systypes sys/types.h define stdio.h "
17346 case "$d_tmpnam_r_proto:$usethreads" in
17347 ":define") d_tmpnam_r_proto=define
17348 set d_tmpnam_r_proto tmpnam_r $hdrs
17352 case "$d_tmpnam_r_proto" in
17354 case "$tmpnam_r_proto" in
17355 ''|0) try='char* tmpnam_r(char*);'
17356 ./protochk "extern $try" $hdrs && tmpnam_r_proto=B_B ;;
17358 case "$tmpnam_r_proto" in
17359 ''|0) d_tmpnam_r=undef
17361 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
17362 * ) case "$tmpnam_r_proto" in
17363 REENTRANT_PROTO*) ;;
17364 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
17366 echo "Prototype: $try" ;;
17369 *) case "$usethreads" in
17370 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
17377 *) tmpnam_r_proto=0
17381 : see if truncate exists
17382 set truncate d_truncate
17385 : see if ttyname_r exists
17386 set ttyname_r d_ttyname_r
17388 case "$d_ttyname_r" in
17390 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
17391 case "$d_ttyname_r_proto:$usethreads" in
17392 ":define") d_ttyname_r_proto=define
17393 set d_ttyname_r_proto ttyname_r $hdrs
17397 case "$d_ttyname_r_proto" in
17399 case "$ttyname_r_proto" in
17400 ''|0) try='int ttyname_r(int, char*, size_t);'
17401 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBW ;;
17403 case "$ttyname_r_proto" in
17404 ''|0) try='int ttyname_r(int, char*, int);'
17405 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBI ;;
17407 case "$ttyname_r_proto" in
17408 ''|0) try='char* ttyname_r(int, char*, int);'
17409 ./protochk "extern $try" $hdrs && ttyname_r_proto=B_IBI ;;
17411 case "$ttyname_r_proto" in
17412 ''|0) d_ttyname_r=undef
17414 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
17415 * ) case "$ttyname_r_proto" in
17416 REENTRANT_PROTO*) ;;
17417 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
17419 echo "Prototype: $try" ;;
17422 *) case "$usethreads" in
17423 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
17430 *) ttyname_r_proto=0
17434 : see if tzname[] exists
17436 if set tzname val -a d_tzname; eval $csym; $val; then
17438 echo 'tzname[] found.' >&4
17441 echo 'tzname[] NOT found.' >&4
17447 next|rhapsody|darwin) multiarch="$define" ;;
17449 case "$multiarch" in
17450 ''|[nN]*) multiarch="$undef" ;;
17453 : check for ordering of bytes in a UV
17455 case "$usecrosscompile$multiarch" in
17458 You seem to be either cross-compiling or doing a multiarchitecture build,
17459 skipping the byteorder check.
17465 case "$byteorder" in
17468 In the following, larger digits indicate more significance. A big-endian
17469 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
17470 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
17471 machines may have weird orders like 3412. A Cray will report 87654321,
17472 an Alpha will report 12345678. If the test program works the default is
17474 I'm now running the test program...
17478 #$i_stdlib I_STDLIB
17480 #include <stdlib.h>
17482 #include <sys/types.h>
17483 typedef $uvtype UV;
17493 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
17495 u.l = (UV)0x04030201;
17496 for (i = 0; i < $uvsize; i++)
17497 printf("%c", u.c[i]+'0');
17504 if eval $compile && ./try > /dev/null; then
17507 [1-4][1-4][1-4][1-4]|12345678|87654321)
17508 echo "(The test program ran ok.)"
17509 echo "byteorder=$dflt"
17512 ????|????????) echo "(The test program ran ok.)" ;;
17513 *) echo "(The test program didn't run right for some reason.)" ;;
17518 (I can't seem to compile the test program. Guessing big-endian...)
17521 case "$xxx_prompt" in
17523 rp="What is the order of bytes in $uvtype?"
17539 Checking to see whether you can access character data unalignedly...
17541 case "$d_u32align" in
17542 '') $cat >try.c <<EOCP
17544 #$i_stdlib I_STDLIB
17546 #include <stdlib.h>
17548 #define U32 $u32type
17549 #define BYTEORDER 0x$byteorder
17551 #include <signal.h>
17553 $signal_t bletch(s) int s; { exit(4); }
17556 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
17561 if (sizeof(U32) != 4) {
17562 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
17569 signal(SIGBUS, bletch);
17581 for (i = 0; i < 4; i++) {
17582 up = (U32*)(buf + i);
17583 if (! ((*up == 1 << (8*i)) || /* big-endian */
17584 (*up == 1 << (8*(3-i))) /* little-endian */
17588 printf("read failed (%x)\n", *up);
17594 for (i = 0; i < 4; i++) {
17595 up = (U32*)(buf + i);
17597 if (*up != 0xBeef) {
17598 printf("write failed (%x)\n", *up);
17612 if eval $compile_ok; then
17613 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
17614 $run ./try 2>&1 >/dev/null
17617 You can access character data pretty unalignedly.
17619 d_u32align="$undef"
17622 It seems that you must access character data in an aligned manner.
17624 d_u32align="$define"
17628 rp='Can you access character data at unaligned addresses?'
17632 [yY]*) d_u32align="$undef" ;;
17633 *) d_u32align="$define" ;;
17636 $rm -f core core.try.* try.core
17640 : see if ualarm exists
17641 set ualarm d_ualarm
17644 : see if umask exists
17648 : see if unordered exists
17649 set unordered d_unordered
17652 : see if unsetenv exists
17653 set unsetenv d_unsetenv
17656 : see if usleep exists
17657 set usleep d_usleep
17660 : see if prototype for usleep is available
17662 set d_usleepproto usleep $i_unistd unistd.h
17665 : see if ustat exists
17669 : backward compatibility for d_hvfork
17670 if test X$d_hvfork != X; then
17671 d_vfork="$d_hvfork"
17674 : see if there is a vfork
17679 : Ok, but do we want to use it. vfork is reportedly unreliable in
17680 : perl on Solaris 2.x, and probably elsewhere.
17684 case "$usevfork" in
17690 Perl can only use a vfork() that doesn't suffer from strict
17691 restrictions on calling functions or modifying global data in
17692 the child. For example, glibc-2.1 contains such a vfork()
17693 that is unsuitable. If your system provides a proper fork()
17694 call, chances are that you do NOT want perl to use vfork().
17697 rp="Do you still want to use vfork()?"
17702 echo "Ok, we won't use vfork()."
17711 $define) usevfork='true';;
17712 *) usevfork='false';;
17715 : see if closedir exists
17716 set closedir d_closedir
17719 case "$d_closedir" in
17722 echo "Checking whether closedir() returns a status..." >&4
17724 #$i_dirent I_DIRENT /**/
17725 #$i_sysdir I_SYS_DIR /**/
17726 #$i_sysndir I_SYS_NDIR /**/
17727 #$i_systypes I_SYS_TYPES /**/
17729 #if defined(I_SYS_TYPES)
17730 #include <sys/types.h>
17732 #if defined(I_DIRENT)
17733 #include <dirent.h>
17734 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
17735 #include <sys/dir.h>
17739 #include <sys/ndir.h>
17743 #include <ndir.h> /* may be wrong in the future */
17745 #include <sys/dir.h>
17750 int main() { return closedir(opendir(".")); }
17753 if eval $compile_ok; then
17754 if $run ./try > /dev/null 2>&1 ; then
17755 echo "Yes, it does."
17758 echo "No, it doesn't."
17762 echo "(I can't seem to compile the test program--assuming it doesn't)"
17770 set d_void_closedir
17773 : see if there is a wait4
17777 : see if waitpid exists
17778 set waitpid d_waitpid
17781 : see if wcstombs exists
17782 set wcstombs d_wcstombs
17785 : see if wctomb exists
17786 set wctomb d_wctomb
17789 : see if writev exists
17790 set writev d_writev
17793 : preserve RCS keywords in files with variable substitution, grrr
17798 Revision='$Revision'
17800 : check for alignment requirements
17802 case "$usecrosscompile$multiarch" in
17805 You seem to be either cross-compiling or doing a multiarchitecture build,
17806 skipping the memory alignment check.
17809 case "$alignbytes" in
17810 '') alignbytes=8 ;;
17814 case "$alignbytes" in
17815 '') echo "Checking alignment constraints..." >&4
17816 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
17817 $cat >try.c <<'EOCP'
17818 typedef long double NV;
17821 $cat >try.c <<'EOCP'
17825 $cat >>try.c <<'EOCP'
17833 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
17838 if eval $compile_ok; then
17842 echo "(I can't seem to compile the test program...)"
17845 *) dflt="$alignbytes"
17848 rp="Doubles must be aligned on a how-many-byte boundary?"
17856 : set the base revision
17859 : how do we concatenate cpp tokens here?
17861 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
17862 $cat >cpp_stuff.c <<'EOCP'
17863 #define RCAT(a,b)a/**/b
17864 #define ACAT(a,b)a ## b
17868 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
17869 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
17870 echo "Oh! Smells like ANSI's been here." >&4
17871 echo "We can catify or stringify, separately or together!"
17873 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
17874 echo "Ah, yes! The good old days!" >&4
17875 echo "However, in the good old days we don't know how to stringify and"
17876 echo "catify at the same time."
17880 Hmm, I don't seem to be able to concatenate tokens with your cpp.
17881 You're going to have to edit the values of CAT[2-5] in config.h...
17883 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
17887 : see if this is a db.h system
17893 : Check db version.
17895 echo "Checking Berkeley DB version ..." >&4
17901 #include <sys/types.h>
17903 #$i_stdlib I_STDLIB
17905 #include <stdlib.h>
17908 int main(int argc, char *argv[])
17910 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
17911 int Major, Minor, Patch ;
17912 unsigned long Version ;
17913 (void)db_version(&Major, &Minor, &Patch) ;
17915 printf("%d %d %d %d %d %d\n",
17916 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
17917 Major, Minor, Patch);
17920 printf("You have Berkeley DB Version 2 or greater.\n");
17922 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
17923 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
17924 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
17925 Major, Minor, Patch) ;
17927 /* check that db.h & libdb are compatible */
17928 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
17929 printf("db.h and libdb are incompatible.\n") ;
17933 printf("db.h and libdb are compatible.\n") ;
17935 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
17936 + DB_VERSION_PATCH ;
17938 /* needs to be >= 2.3.4 */
17939 if (Version < 2003004) {
17940 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
17941 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
17947 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
17952 printf("You have Berkeley DB Version 1.\n");
17953 exit(0); /* DB version < 2: the coast is clear. */
17955 exit(1); /* <db.h> not Berkeley DB? */
17961 if eval $compile_ok && $run ./try; then
17962 echo 'Looks OK.' >&4
17964 db_version_major=$1
17965 db_version_minor=$2
17966 db_version_patch=$3
17968 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
17972 : Remove db from list of libraries to use
17973 echo "Removing unusable -ldb from library list" >&4
17974 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
17977 echo "libs = $libs" >&4
17987 : Check the return type needed for hash
17989 echo "Checking return type needed for hash for Berkeley DB ..." >&4
17995 #include <sys/types.h>
17998 #ifndef DB_VERSION_MAJOR
17999 u_int32_t hash_cb (ptr, size)
18007 info.hash = hash_cb;
18011 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18012 if $contains warning try.out >>/dev/null 2>&1 ; then
18015 db_hashtype='u_int32_t'
18018 : XXX Maybe we should just give up here.
18019 db_hashtype=u_int32_t
18021 echo "Help: I can't seem to compile the db test program." >&4
18022 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
18025 echo "Your version of Berkeley DB uses $db_hashtype for hash."
18027 *) db_hashtype=u_int32_t
18032 : Check the return type needed for prefix
18034 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
18040 #include <sys/types.h>
18043 #ifndef DB_VERSION_MAJOR
18044 size_t prefix_cb (key1, key2)
18052 info.prefix = prefix_cb;
18056 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18057 if $contains warning try.out >>/dev/null 2>&1 ; then
18058 db_prefixtype='int'
18060 db_prefixtype='size_t'
18063 db_prefixtype='size_t'
18064 : XXX Maybe we should just give up here.
18066 echo "Help: I can't seem to compile the db test program." >&4
18067 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
18070 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
18072 *) db_prefixtype='size_t'
18077 : How can we generate normalized random numbers ?
18079 echo "Looking for a random number function..." >&4
18080 case "$randfunc" in
18082 if set drand48 val -f; eval $csym; $val; then
18084 echo "Good, found drand48()." >&4
18085 elif set random val -f; eval $csym; $val; then
18087 echo "OK, found random()." >&4
18090 echo "Yick, looks like I have to use rand()." >&4
18101 *-Dmy_rand=*|*-Dmy_srand=*)
18102 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
18103 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
18104 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
18105 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
18109 while $test "$cont"; do
18110 rp="Use which function to generate random numbers?"
18112 if $test "$ans" = "$dflt"; then
18118 if set $ans val -f; eval $csym; $val; then
18122 rp="I cannot find function $ans. Use that name anyway?"
18131 case "$randfunc" in
18133 drand01="drand48()"
18139 case "$randbits" in
18141 echo "Checking to see how many bits your $randfunc() function produces..." >&4
18143 #$i_unistd I_UNISTD
18144 #$i_stdlib I_STDLIB
18147 # include <unistd.h>
18150 # include <stdlib.h>
18155 register unsigned long tmp;
18156 register unsigned long max = 0L;
18158 for (i = 1000; i; i--) {
18159 tmp = (unsigned long) $randfunc();
18160 if (tmp > max) max = tmp;
18162 for (i = 0; max; i++)
18168 if eval $compile_ok; then
18172 echo "(I can't seem to compile the test program...)"
18179 rp="How many bits does your $randfunc() function produce?"
18183 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18184 seedfunc="s$randfunc"
18185 randseedtype=unsigned
18189 rp="How many bits does your $randfunc() function produce?"
18192 seedfunc="s$randfunc"
18193 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18194 if set $seedfunc val -f; eval $csym; $val; then
18195 echo "(Using $seedfunc() to seed random generator)"
18197 echo "(Warning: no $seedfunc() to seed random generator)"
18200 randseedtype=unsigned
18208 echo "Determining whether or not we are on an EBCDIC system..." >&4
18209 $cat >try.c <<'EOM'
18212 if ('M'==0xd4) return 0;
18219 if eval $compile_ok; then
18220 if $run ./try; then
18221 echo "You seem to speak EBCDIC." >&4
18224 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
18227 echo "I'm unable to compile the test program." >&4
18228 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
18236 Checking how to flush all pending stdio output...
18238 # I only know how to find the first 32 possibly open files on SunOS.
18239 # See also hints/sunos_4_1.sh and util.c --AD
18241 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
18243 $cat >>try.c <<EOCP
18245 #$i_stdlib I_STDLIB
18247 #include <stdlib.h>
18249 #$i_unistd I_UNISTD
18251 # include <unistd.h>
18253 #$d_sysconf HAS_SYSCONF
18254 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
18255 #ifdef HAS_STDIO_STREAM_ARRAY
18256 # define STDIO_STREAM_ARRAY $stdio_stream_array
18261 p = fopen("try.out", "w");
18265 # ifdef TRY_FPRINTF
18269 #ifdef TRY_FFLUSH_NULL
18272 #ifdef TRY_FFLUSH_ALL
18274 long open_max = -1;
18275 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
18276 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
18278 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
18279 open_max = sysconf(_SC_OPEN_MAX);
18282 open_max = FOPEN_MAX;
18285 open_max = OPEN_MAX;
18294 # ifdef HAS_STDIO_STREAM_ARRAY
18295 if (open_max > 0) {
18297 for (i = 0; i < open_max; i++)
18298 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
18299 STDIO_STREAM_ARRAY[i]._file < open_max &&
18300 STDIO_STREAM_ARRAY[i]._flag)
18301 fflush(&STDIO_STREAM_ARRAY[i]);
18309 : first we have to find out how _not_ to flush
18311 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
18313 set try -DTRY_FPUTC
18314 if eval $compile; then
18315 $run ./try 2>/dev/null
18318 if $test ! -s try.out -a "X$code" = X42; then
18324 set try -DTRY_FPRINTF
18325 if eval $compile; then
18326 $run ./try 2>/dev/null
18329 if $test ! -s try.out -a "X$code" = X42; then
18330 output=-DTRY_FPRINTF
18336 : check for fflush NULL behaviour
18337 case "$fflushNULL" in
18338 '') set try -DTRY_FFLUSH_NULL $output
18339 if eval $compile; then
18340 $run ./try 2>/dev/null
18343 if $test -s try.out -a "X$code" = X42; then
18344 fflushNULL="`$cat try.out`"
18346 if $test "X$code" != X42; then
18348 (If this test failed, don't worry, we'll try another method shortly.)
18353 $rm -f core try.core core.try.*
18354 case "$fflushNULL" in
18356 Your fflush(NULL) works okay for output streams.
18357 Let's see if it clobbers input pipes...
18359 # As of mid-March 2000 all versions of Solaris appear to have a stdio
18360 # bug that improperly flushes the input end of pipes. So we avoid the
18361 # autoflush on fork/system/exec support for now. :-(
18362 $cat >tryp.c <<EOCP
18365 main(int argc, char **argv)
18371 while ((i = getc(stdin)) != -1
18372 && (*bp++ = i) != '\n'
18373 && bp < &buf[1024])
18376 fprintf(stdout, "%s", buf);
18384 fflushNULL="$define"
18386 if eval $compile; then
18388 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
18389 if cmp tryp.c tryp.out >/dev/null 2>&1; then
18391 fflush(NULL) seems to behave okay with input streams.
18393 fflushNULL="$define"
18396 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
18398 fflushNULL="$undef"
18401 $rm -f core tryp.c tryp.core core.tryp.*
18404 Your fflush(NULL) isn't working (contrary to ANSI C).
18406 fflushNULL="$undef"
18409 Cannot figure out whether your fflush(NULL) works or not.
18410 I'm assuming it doesn't (contrary to ANSI C).
18412 fflushNULL="$undef"
18416 $define|true|[yY]*)
18417 fflushNULL="$define"
18420 fflushNULL="$undef"
18423 : check explicit looping only if NULL did not work, and if the pipe
18424 : bug does not show up on an explicit flush too
18425 case "$fflushNULL" in
18427 $cat >tryp.c <<EOCP
18430 main(int argc, char **argv)
18436 while ((i = getc(stdin)) != -1
18437 && (*bp++ = i) != '\n'
18438 && bp < &buf[1024])
18441 fprintf(stdout, "%s", buf);
18450 if eval $compile; then
18452 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
18453 if cmp tryp.c tryp.out >/dev/null 2>&1; then
18455 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
18457 : now check for fflushall behaviour
18458 case "$fflushall" in
18459 '') set try -DTRY_FFLUSH_ALL $output
18460 if eval $compile; then
18462 (Now testing the other method--but note that this also may fail.)
18464 $run ./try 2>/dev/null
18467 if $test -s try.out -a "X$code" = X42; then
18468 fflushall="`$cat try.out`"
18471 $rm -f core try.core core.try.*
18472 case "$fflushall" in
18474 Whew. Flushing explicitly all the stdio streams works.
18476 fflushall="$define"
18479 Sigh. Flushing explicitly all the stdio streams doesn't work.
18484 Cannot figure out whether flushing stdio streams explicitly works or not.
18485 I'm assuming it doesn't.
18491 "$define"|true|[yY]*)
18492 fflushall="$define"
18500 All is futile. Even fflush(stdin) clobbers input pipes!
18507 $rm -f core tryp.c tryp.core core.tryp.*
18509 *) fflushall="$undef"
18513 case "$fflushNULL$fflushall" in
18516 OK, I give up. I cannot figure out how to flush pending stdio output.
18517 We won't be flushing handles at all before fork/exec/popen.
18521 $rm -f try.* try$exe_ext
18523 : Store the full pathname to the ar program for use in the C program
18524 : Respect a hint or command line value for full_ar.
18529 : Store the full pathname to the sed program for use in the C program
18532 : see what type gids are declared as in the kernel
18534 echo "Looking for the type for group ids returned by getgid()."
18535 set gid_t gidtype xxx stdio.h sys/types.h
18539 xxx=`./findhdr sys/user.h`
18540 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
18542 unsigned) dflt="$1 $2" ;;
18546 *) dflt="$gidtype";;
18549 gid_t) echo "gid_t found." ;;
18550 *) rp="What is the type for group ids returned by getgid()?"
18558 *_t) zzz="$gidtype" ;;
18561 echo "Checking the size of $zzz..." >&4
18563 #include <sys/types.h>
18565 #$i_stdlib I_STDLIB
18567 #include <stdlib.h>
18570 printf("%d\n", (int)sizeof($gidtype));
18575 if eval $compile_ok; then
18579 echo "(I can't execute the test program--guessing $gidsize.)" >&4
18582 echo "Your $zzz is $gidsize bytes long."
18587 echo "(I can't compile the test program--guessing $gidsize.)" >&4
18593 *_t) zzz="$gidtype" ;;
18596 echo "Checking the sign of $zzz..." >&4
18598 #include <sys/types.h>
18609 if eval $compile; then
18613 echo "(I can't execute the test program--guessing unsigned.)" >&4
18617 1) echo "Your $zzz is unsigned." ;;
18618 -1) echo "Your $zzz is signed." ;;
18624 echo "(I can't compile the test program--guessing unsigned.)" >&4
18630 if $test X"$quadtype" != X; then
18632 echo "Checking how to print 64-bit integers..." >&4
18634 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
18635 $cat >try.c <<'EOCP'
18636 #include <sys/types.h>
18639 int q = 12345678901;
18640 printf("%ld\n", q);
18644 if eval $compile; then
18648 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
18649 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
18650 echo "We will use %d."
18656 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
18657 $cat >try.c <<'EOCP'
18658 #include <sys/types.h>
18661 long q = 12345678901;
18662 printf("%ld\n", q);
18666 if eval $compile; then
18670 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
18671 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
18672 echo "We will use %ld."
18678 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
18679 $cat >try.c <<'EOCP'
18680 #include <sys/types.h>
18681 #include <inttypes.h>
18684 int64_t q = 12345678901;
18685 printf("%" PRId64 "\n", q);
18689 if eval $compile; then
18693 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
18694 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
18695 echo "We will use the C9X style."
18701 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
18703 #include <sys/types.h>
18706 $quadtype q = 12345678901;
18707 printf("%Ld\n", q);
18711 if eval $compile; then
18715 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
18716 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
18717 echo "We will use %Ld."
18723 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
18724 $cat >try.c <<'EOCP'
18725 #include <sys/types.h>
18728 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
18729 printf("%lld\n", q);
18733 if eval $compile; then
18737 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
18738 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
18739 echo "We will use the %lld style."
18745 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
18747 #include <sys/types.h>
18750 $quadtype q = 12345678901;
18751 printf("%qd\n", q);
18755 if eval $compile; then
18759 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
18760 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
18761 echo "We will use %qd."
18767 if $test X"$sPRId64" = X; then
18768 echo "Cannot figure out how to print 64-bit integers." >&4
18776 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
18777 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
18779 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
18780 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
18786 $echo "Checking the format strings to be used for Perl's internal types..." >&4
18788 if $test X"$ivsize" = X8; then
18789 ivdformat="$sPRId64"
18790 uvuformat="$sPRIu64"
18791 uvoformat="$sPRIo64"
18792 uvxformat="$sPRIx64"
18793 uvXUformat="$sPRIXU64"
18795 if $test X"$ivsize" = X"$longsize"; then
18802 if $test X"$ivsize" = X"$intsize"; then
18810 if $test X"$ivsize" = X"$shortsize"; then
18821 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
18822 nveformat="$sPRIeldbl"
18823 nvfformat="$sPRIfldbl"
18824 nvgformat="$sPRIgldbl"
18825 nvEUformat="$sPRIEUldbl"
18826 nvFUformat="$sPRIFUldbl"
18827 nvGUformat="$sPRIGUldbl"
18837 case "$ivdformat" in
18838 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
18845 $echo "Checking the format string to be used for gids..." >&4
18848 -1) if $test X"$gidsize" = X"$ivsize"; then
18849 gidformat="$ivdformat"
18851 if $test X"$gidsize" = X"$longsize"; then
18854 if $test X"$gidsize" = X"$intsize"; then
18857 if $test X"$gidsize" = X"$shortsize"; then
18864 *) if $test X"$gidsize" = X"$uvsize"; then
18865 gidformat="$uvuformat"
18867 if $test X"$gidsize" = X"$longsize"; then
18870 if $test X"$gidsize" = X"$intsize"; then
18873 if $test X"$gidsize" = X"$shortsize"; then
18882 : see if getgroups exists
18883 set getgroups d_getgrps
18886 : see if setgroups exists
18887 set setgroups d_setgrps
18891 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
18893 case "$d_getgrps$d_setgrps" in
18895 case "$groupstype" in
18896 '') dflt="$gidtype" ;;
18897 *) dflt="$groupstype" ;;
18900 What type of pointer is the second argument to getgroups() and setgroups()?
18901 Usually this is the same as group ids, $gidtype, but not always.
18904 rp='What type pointer is the second argument to getgroups() and setgroups()?'
18908 *) groupstype="$gidtype";;
18913 $define|true|[yY]*) dflt='y' ;;
18918 Would you like to build with Misc Attribute Decoration? This is development
18919 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
18920 overhead on the interpreter.
18922 If this doesn't make any sense to you, just accept the default '$dflt'.
18924 rp='Build Perl with MAD?'
18928 madlyh='madly.h madly.act madly.tab'
18930 madlyobj="madly$_o" ;;
18940 echo "Checking if your $make program sets \$(MAKE)..." >&4
18941 case "$make_set_make" in
18943 $sed 's/^X //' > testmake.mak << 'EOF'
18945 X @echo 'maketemp="$(MAKE)"'
18947 case "`$make -f testmake.mak 2>/dev/null`" in
18948 *maketemp=*) make_set_make='#' ;;
18949 *) make_set_make="MAKE=$make" ;;
18951 $rm -f testmake.mak
18954 case "$make_set_make" in
18955 '#') echo "Yup, it does.";;
18956 *) echo "Nope, it doesn't.";;
18959 : see what type is used for mode_t
18960 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
18961 set mode_t modetype int stdio.h sys/types.h
18964 : see if stdarg is available
18966 if $test `./findhdr stdarg.h`; then
18967 echo "<stdarg.h> found." >&4
18970 echo "<stdarg.h> NOT found." >&4
18974 : see if varags is available
18976 if $test `./findhdr varargs.h`; then
18977 echo "<varargs.h> found." >&4
18979 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
18982 : set up the varargs testing programs
18983 $cat > varargs.c <<EOP
18985 #include <stdarg.h>
18988 #include <varargs.h>
18992 int f(char *p, ...)
19006 p = va_arg(ap, char *);
19011 $cat > varargs <<EOP
19013 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
19022 : now check which varargs header should be included
19027 if `./varargs I_STDARG`; then
19029 elif `./varargs I_VARARGS`; then
19034 if `./varargs I_VARARGS`; then
19041 echo "I could not find the definition for va_dcl... You have problems..." >&4
19042 val="$undef"; set i_stdarg; eval $setvar
19043 val="$undef"; set i_varargs; eval $setvar
19048 case "$i_varhdr" in
19050 val="$define"; set i_stdarg; eval $setvar
19051 val="$undef"; set i_varargs; eval $setvar
19054 val="$undef"; set i_stdarg; eval $setvar
19055 val="$define"; set i_varargs; eval $setvar
19058 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
19062 : see if we need va_copy
19064 case "$i_stdarg" in
19067 #include <stdarg.h>
19069 #$i_stdlib I_STDLIB
19071 #include <stdlib.h>
19073 #include <signal.h>
19076 ivfprintf(FILE *f, const char *fmt, va_list *valp)
19078 return vfprintf(f, fmt, *valp);
19082 myvfprintf(FILE *f, const char *fmt, va_list val)
19084 return ivfprintf(f, fmt, &val);
19088 myprintf(char *fmt, ...)
19091 va_start(val, fmt);
19092 return myvfprintf(stdout, fmt, val);
19096 main(int ac, char **av)
19098 signal(SIGSEGV, exit);
19100 myprintf("%s%cs all right, then\n", "that", '\'');
19105 if eval $compile && $run ./try 2>&1 >/dev/null; then
19106 case "`$run ./try`" in
19107 "that's all right, then")
19113 yes) echo "It seems that you don't need va_copy()." >&4
19114 need_va_copy="$undef"
19116 *) echo "It seems that va_copy() or similar will be needed." >&4
19117 need_va_copy="$define"
19120 $rm -f try.* core core.* *.core *.core.*
19122 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
19126 : see what type is used for size_t
19127 rp="What is the type used for the length parameter for string functions?"
19128 set size_t sizetype 'unsigned int' stdio.h sys/types.h
19131 : check for type of arguments to gethostbyaddr.
19132 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
19133 case "$d_gethbyaddr" in
19137 Checking to see what type of arguments are accepted by gethostbyaddr().
19139 hdrs="$define sys/types.h
19140 $d_socket sys/socket.h
19141 $i_niin netinet/in.h
19143 $i_unistd unistd.h"
19144 : The first arg can 'char *' or 'void *'
19145 : The second arg is some of integral type
19146 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
19147 for yyy in size_t long int; do
19148 case "$netdb_host_type" in
19149 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
19150 if ./protochk "$try" $hdrs; then
19151 echo "Your system accepts $xxx for the first arg."
19152 echo "...and $yyy for the second arg."
19153 netdb_host_type="$xxx"
19154 netdb_hlen_type="$yyy"
19160 : In case none of those worked, prompt the user.
19161 case "$netdb_host_type" in
19162 '') rp='What is the type for the 1st argument to gethostbyaddr?'
19165 netdb_host_type=$ans
19166 rp='What is the type for the 2nd argument to gethostbyaddr?'
19169 netdb_hlen_type=$ans
19173 *) : no gethostbyaddr, so pick harmless defaults
19174 netdb_host_type='char *'
19175 netdb_hlen_type="$sizetype"
19178 # Remove the "const" if needed. -- but then we'll have a
19180 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
19183 : check for type of argument to gethostbyname.
19184 if test "X$netdb_name_type" = X ; then
19185 case "$d_gethbyname" in
19189 Checking to see what type of argument is accepted by gethostbyname().
19191 hdrs="$define sys/types.h
19192 $d_socket sys/socket.h
19193 $i_niin netinet/in.h
19195 $i_unistd unistd.h"
19196 for xxx in "const char *" "char *"; do
19197 case "$netdb_name_type" in
19198 '') try="extern struct hostent *gethostbyname($xxx);"
19199 if ./protochk "$try" $hdrs; then
19200 echo "Your system accepts $xxx."
19201 netdb_name_type="$xxx"
19206 : In case none of those worked, prompt the user.
19207 case "$netdb_name_type" in
19208 '') rp='What is the type for the 1st argument to gethostbyname?'
19211 netdb_name_type=$ans
19215 *) : no gethostbyname, so pick harmless default
19216 netdb_name_type='char *'
19221 : check for type of 1st argument to getnetbyaddr.
19222 if test "X$netdb_net_type" = X ; then
19223 case "$d_getnbyaddr" in
19227 Checking to see what type of 1st argument is accepted by getnetbyaddr().
19229 hdrs="$define sys/types.h
19230 $d_socket sys/socket.h
19231 $i_niin netinet/in.h
19233 $i_unistd unistd.h"
19234 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
19235 case "$netdb_net_type" in
19236 '') try="extern struct netent *getnetbyaddr($xxx, int);"
19237 if ./protochk "$try" $hdrs; then
19238 echo "Your system accepts $xxx."
19239 netdb_net_type="$xxx"
19244 : In case none of those worked, prompt the user.
19245 case "$netdb_net_type" in
19246 '') rp='What is the type for the 1st argument to getnetbyaddr?'
19249 netdb_net_type=$ans
19253 *) : no getnetbyaddr, so pick harmless default
19254 netdb_net_type='long'
19258 : locate the preferred pager for this system
19265 [a-zA-Z]:/*) dflt=$pg;;
19269 [a-zA-Z]:/*) dflt=$more;;
19273 [a-zA-Z]:/*) dflt=$less;;
19276 '') dflt=/usr/ucb/more;;
19280 : Instruct ./getfile to trust the hinted or previous pager value,
19281 : even if it does not begin with a slash. For example, on os2,
19282 : pager might be cmd /c more. See comments in UU/getfile.
19287 rp='What pager is used on your system?'
19291 : see what type pids are declared as in the kernel
19292 rp="What is the type of process ids on this system?"
19293 set pid_t pidtype int stdio.h sys/types.h
19296 : see if ar generates random libraries by itself
19298 echo "Checking how to generate random libraries on your machine..." >&4
19299 echo 'int bar1() { return bar2(); }' > bar1.c
19300 echo 'int bar2() { return 2; }' > bar2.c
19302 #$i_stdlib I_STDLIB
19304 #include <stdlib.h>
19306 int main() { printf("%d\n", bar1()); exit(0); }
19308 $cc $ccflags -c bar1.c >/dev/null 2>&1
19309 $cc $ccflags -c bar2.c >/dev/null 2>&1
19310 $cc $ccflags -c foo.c >/dev/null 2>&1
19311 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
19312 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19313 $run ./foobar >/dev/null 2>&1; then
19314 echo "$ar appears to generate random libraries itself."
19316 if [ "X$ranlib" = "X" ]; then
19319 elif $ar s bar$_a >/dev/null 2>&1 &&
19320 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19321 $run ./foobar >/dev/null 2>&1; then
19322 echo "a table of contents needs to be added with '$ar s'."
19325 elif $ar ts bar$_a >/dev/null 2>&1 &&
19326 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19327 $run ./foobar >/dev/null 2>&1; then
19328 echo "a table of contents needs to be added with '$ar ts'."
19335 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
19336 $test -f $ranlib || ranlib=''
19339 if $test -n "$ranlib"; then
19340 echo "your system has '$ranlib'; we'll use that."
19343 echo "your system doesn't seem to support random libraries"
19344 echo "so we'll use lorder and tsort to order the libraries."
19351 : check for type of arguments to select.
19352 case "$selecttype" in
19353 '') case "$d_select" in
19357 Checking to see what type of arguments are accepted by select().
19359 hdrs="$define sys/types.h
19360 $i_systime sys/time.h
19361 $i_sysselct sys/select.h
19362 $d_socket sys/socket.h"
19363 : The first arg can be int, unsigned, or size_t
19364 : The last arg may or may not be 'const'
19366 : void pointer has been seen but using that
19367 : breaks the selectminbits test
19368 for xxx in 'fd_set *' 'int *'; do
19369 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
19370 for tmo in 'struct timeval *' 'const struct timeval *'; do
19372 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
19373 if ./protochk "$try" $hdrs; then
19374 echo "Your system accepts $xxx."
19383 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
19384 case "$d_fd_set" in
19385 $define) dflt="fd_set *" ;;
19394 *) : no select, so pick a harmless default
19401 : check for the select 'width'
19402 case "$selectminbits" in
19403 '') safebits=`expr $ptrsize \* 8`
19404 case "$d_select" in
19408 Checking to see on how many bits at a time your select() operates...
19411 #include <sys/types.h>
19413 #$i_systime I_SYS_TIME
19414 #$i_systimek I_SYS_TIME_KERNEL
19419 # ifdef I_SYS_TIME_KERNEL
19422 # include <sys/time.h>
19423 # ifdef I_SYS_TIME_KERNEL
19427 #$i_sysselct I_SYS_SELECT
19428 #ifdef I_SYS_SELECT
19429 #include <sys/select.h>
19431 #$d_socket HAS_SOCKET
19433 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
19436 #$i_stdlib I_STDLIB
19438 #include <stdlib.h>
19441 #define S sizeof(*(b))
19443 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
19444 #define NBITS (NBYTES * 8)
19446 char *s = malloc(NBYTES);
19455 fp = fopen("try.c", "r");
19461 b = ($selecttype)s;
19462 for (i = 0; i < NBITS; i++)
19466 select(fd + 1, b, 0, 0, &t);
19467 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
19469 printf("%d\n", i + 1);
19474 if eval $compile_ok; then
19475 selectminbits=`$run ./try`
19476 case "$selectminbits" in
19478 Cannot figure out on how many bits at a time your select() operates.
19479 I'll play safe and guess it is $safebits bits.
19481 selectminbits=$safebits
19482 bits="$safebits bits"
19485 *) bits="$selectminbits bits" ;;
19487 echo "Your select() operates on $bits at a time." >&4
19489 rp='What is the minimum number of bits your select() operates on?'
19490 case "$byteorder" in
19491 12345678) dflt=64 ;;
19497 selectminbits="$val"
19501 *) : no select, so pick a harmless default
19502 selectminbits=$safebits
19508 : Trace out the files included by signal.h, then look for SIGxxx names.
19509 : Remove SIGARRAYSIZE used by HPUX.
19510 : Remove SIGSTKSIZE used by Linux.
19511 : Remove SIGSTKSZ used by Posix.
19512 : Remove SIGTYP void lines used by OS2.
19513 : Some cpps, like os390, dont give the file name anywhere
19514 if [ "X$fieldn" = X ]; then
19515 : Just make some guesses. We check them later.
19516 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
19518 xxx=`echo '#include <signal.h>' |
19519 $cppstdin $cppminus $cppflags 2>/dev/null |
19520 $grep '^[ ]*#.*include' |
19521 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
19523 : Check this list of files to be sure we have parsed the cpp output ok.
19524 : This will also avoid potentially non-existent files, such
19527 for xx in $xxx /dev/null ; do
19528 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
19530 : If we have found no files, at least try signal.h
19531 case "$xxxfiles" in
19532 '') xxxfiles=`./findhdr signal.h` ;;
19535 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
19536 print substr($2, 4, 20)
19538 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
19539 print substr($3, 4, 20)
19541 : Append some common names just in case the awk scan failed.
19542 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
19543 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
19544 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
19545 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
19546 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
19548 : generate a few handy files for later
19549 $cat > signal.c <<EOCP
19550 #include <sys/types.h>
19551 #include <signal.h>
19552 #$i_stdlib I_STDLIB
19554 #include <stdlib.h>
19559 /* Strange style to avoid deeply-nested #if/#else/#endif */
19562 # define NSIG (_NSIG)
19568 # define NSIG (SIGMAX+1)
19574 # define NSIG (SIG_MAX+1)
19580 # define NSIG (_SIG_MAX+1)
19586 # define NSIG (MAXSIG+1)
19592 # define NSIG (MAX_SIG+1)
19597 # ifdef SIGARRAYSIZE
19598 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
19604 # define NSIG (_sys_nsig) /* Solaris 2.5 */
19608 /* Default to some arbitrary number that's big enough to get most
19609 of the common signals.
19615 printf("NSIG %d\n", NSIG);
19621 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
19623 printf "#ifdef SIG"; printf $1; printf "\n"
19624 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
19625 printf $1; printf ");\n"
19629 printf "#endif /* JUST_NSIG */\n";
19630 printf "exit(0);\n}\n";
19633 $cat >signal.awk <<'EOP'
19634 BEGIN { ndups = 0 }
19635 $1 ~ /^NSIG$/ { nsig = $2 }
19636 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
19637 if ($2 > maxsig) { maxsig = $2 }
19638 if (sig_name[$2]) {
19639 dup_name[ndups] = $1
19640 dup_num[ndups] = $2
19652 printf("NSIG %d\n", nsig);
19653 for (n = 1; n < nsig; n++) {
19655 printf("%s %d\n", sig_name[n], sig_num[n])
19658 printf("NUM%d %d\n", n, n)
19661 for (n = 0; n < ndups; n++) {
19662 printf("%s %d\n", dup_name[n], dup_num[n])
19666 $cat >signal_cmd <<EOS
19668 if $test -s signal.lst; then
19669 echo "Using your existing signal.lst file"
19674 $cat >>signal_cmd <<'EOS'
19677 if eval $compile_ok; then
19678 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) | $uniq | $awk -f signal.awk >signal.lst
19680 echo "(I can't seem be able to compile the whole test program)" >&4
19681 echo "(I'll try it in little pieces.)" >&4
19682 set signal -DJUST_NSIG
19683 if eval $compile_ok; then
19684 $run ./signal$_exe > signal.nsg
19687 echo "I can't seem to figure out how many signals you have." >&4
19688 echo "Guessing 50." >&4
19689 echo 'NSIG 50' > signal.nsg
19691 : Now look at all the signal names, one at a time.
19692 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
19693 $cat > signal.c <<EOCP
19694 #include <sys/types.h>
19695 #include <signal.h>
19698 printf("$xx %d\n", SIG${xx});
19703 if eval $compile; then
19704 echo "SIG${xx} found."
19705 $run ./signal$_exe >> signal.ls1
19707 echo "SIG${xx} NOT found."
19710 if $test -s signal.ls1; then
19711 $cat signal.nsg signal.ls1 |
19712 $sort -n | $uniq | $awk -f signal.awk >signal.lst
19716 if $test -s signal.lst; then
19719 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
19720 echo 'kill -l' >signal
19721 set X `csh -f <signal`
19725 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
19727 echo $@ | $tr ' ' $trnl | \
19728 $awk '{ printf "%s %d\n", $1, ++s; }
19729 END { printf "NSIG %d\n", ++s }' >signal.lst
19731 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
19733 chmod a+x signal_cmd
19734 $eunicefix signal_cmd
19736 : generate list of signal names
19738 case "$sig_name_init" in
19740 *) case "$sig_num_init" in
19741 ''|*,*) doinit=yes ;;
19746 echo "Generating a list of signal names and numbers..." >&4
19748 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
19749 sig_name=`$awk 'BEGIN { printf "ZERO " }
19750 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
19751 sig_num=`$awk 'BEGIN { printf "0 " }
19752 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
19753 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
19754 !/^NSIG/ { printf "\"%s\", ", $1 }
19755 END { printf "0\n" }' signal.lst`
19756 sig_num_init=`$awk 'BEGIN { printf "0, " }
19757 !/^NSIG/ { printf "%d, ", $2}
19758 END { printf "0\n"}' signal.lst`
19761 echo "The following $sig_count signals are available:"
19763 echo $sig_name | $awk \
19764 'BEGIN { linelen = 0 }
19766 for (i = 1; i <= NF; i++) {
19767 name = "SIG" $i " "
19768 linelen = linelen + length(name)
19769 if (linelen > 70) {
19771 linelen = length(name)
19777 sig_size=`echo $sig_name | awk '{print NF}'`
19778 $rm -f signal signal.c signal.awk signal.lst signal_cmd
19781 case "$sizetype" in
19782 *_t) zzz="$sizetype" ;;
19783 *) zzz="filesize" ;;
19785 echo "Checking the size of $zzz..." >&4
19787 #include <sys/types.h>
19789 #$i_stdlib I_STDLIB
19791 #include <stdlib.h>
19794 printf("%d\n", (int)sizeof($sizetype));
19799 if eval $compile_ok; then
19803 echo "(I can't execute the test program--guessing $sizesize.)" >&4
19806 echo "Your $zzz size is $sizesize bytes."
19811 echo "(I can't compile the test program--guessing $sizesize.)" >&4
19815 : check for socklen_t
19817 echo "Checking to see if you have socklen_t..." >&4
19819 #include <sys/types.h>
19820 #$d_socket HAS_SOCKET
19822 #include <sys/socket.h>
19824 int main() { socklen_t x = 16; }
19827 if eval $compile; then
19829 echo "You have socklen_t."
19832 echo "You do not have socklen_t."
19833 case "$sizetype" in
19834 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
19841 : see if this is a socks.h system
19842 set socks.h i_socks
19845 : check for type of the size argument to socket calls
19846 case "$d_socket" in
19850 Checking to see what type is the last argument of accept().
19853 case "$d_socklen_t" in
19854 "$define") yyy="$yyy socklen_t"
19856 yyy="$yyy $sizetype int long unsigned"
19857 for xxx in $yyy; do
19858 case "$socksizetype" in
19859 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
19860 case "$usesocks" in
19862 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
19863 echo "Your system accepts '$xxx *' for the last argument of accept()."
19864 socksizetype="$xxx"
19867 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
19868 echo "Your system accepts '$xxx *' for the last argument of accept()."
19869 socksizetype="$xxx"
19876 : In case none of those worked, prompt the user.
19877 case "$socksizetype" in
19878 '') rp='What is the type for socket address structure sizes?'
19885 *) : no sockets, so pick relatively harmless default
19890 : see what type is used for signed size_t
19891 set ssize_t ssizetype int stdio.h sys/types.h
19896 #$i_stdlib I_STDLIB
19898 #include <stdlib.h>
19900 #include <sys/types.h>
19901 #define Size_t $sizetype
19902 #define SSize_t $dflt
19905 if (sizeof(Size_t) == sizeof(SSize_t))
19907 else if (sizeof(Size_t) == sizeof(int))
19916 if eval $compile_ok && $run ./try > /dev/null; then
19917 ssizetype=`$run ./try`
19918 echo "I'll be using $ssizetype for functions returning a byte count." >&4
19921 Help! I can't compile and run the ssize_t test program: please enlighten me!
19922 (This is probably a misconfiguration in your system or libraries, and
19923 you really ought to fix it. Still, I'll try anyway.)
19925 I need a type that is the same size as $sizetype, but is guaranteed to
19926 be signed. Common values are ssize_t, int and long.
19929 rp="What signed type is the same size as $sizetype?"
19935 : see what type of char stdio uses.
19937 echo '#include <stdio.h>' > stdio.c
19938 $cppstdin $cppminus < stdio.c > stdioh
19939 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
19940 echo "Your stdio uses unsigned chars." >&4
19941 stdchar="unsigned char"
19943 echo "Your stdio uses signed chars." >&4
19946 $rm -f stdio.* stdioh
19948 : see what type uids are declared as in the kernel
19950 echo "Looking for the type for user ids returned by getuid()."
19951 set uid_t uidtype xxx stdio.h sys/types.h
19955 xxx=`./findhdr sys/user.h`
19956 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
19958 unsigned) dflt="$1 $2" ;;
19962 *) dflt="$uidtype";;
19965 uid_t) echo "uid_t found." ;;
19966 *) rp="What is the type for user ids returned by getuid()?"
19974 *_t) zzz="$uidtype" ;;
19977 echo "Checking the size of $zzz..." >&4
19979 #include <sys/types.h>
19981 #$i_stdlib I_STDLIB
19983 #include <stdlib.h>
19986 printf("%d\n", (int)sizeof($uidtype));
19991 if eval $compile_ok; then
19995 echo "(I can't execute the test program--guessing $uidsize.)" >&4
19998 echo "Your $zzz is $uidsize bytes long."
20003 echo "(I can't compile the test program--guessing $uidsize.)" >&4
20008 *_t) zzz="$uidtype" ;;
20011 echo "Checking the sign of $zzz..." >&4
20013 #include <sys/types.h>
20024 if eval $compile; then
20028 echo "(I can't execute the test program--guessing unsigned.)" >&4
20032 1) echo "Your $zzz is unsigned." ;;
20033 -1) echo "Your $zzz is signed." ;;
20039 echo "(I can't compile the test program--guessing unsigned.)" >&4
20045 $echo "Checking the format string to be used for uids..." >&4
20048 -1) if $test X"$uidsize" = X"$ivsize"; then
20049 uidformat="$ivdformat"
20051 if $test X"$uidsize" = X"$longsize"; then
20054 if $test X"$uidsize" = X"$intsize"; then
20057 if $test X"$uidsize" = X"$shortsize"; then
20064 *) if $test X"$uidsize" = X"$uvsize"; then
20065 uidformat="$uvuformat"
20067 if $test X"$uidsize" = X"$longsize"; then
20070 if $test X"$uidsize" = X"$intsize"; then
20073 if $test X"$uidsize" = X"$shortsize"; then
20083 case "$usesitecustomize" in
20084 $define|true|[Yy]*)
20085 usesitecustomize="$define"
20088 usesitecustomize="$undef"
20092 : determine compiler compiler
20101 if $test -f "$byacc$_exe"; then
20103 comp="byacc or $comp"
20105 if $test -f "$bison$_exe"; then
20106 comp="$comp or bison -y"
20108 rp="Which compiler compiler ($comp) shall I use?"
20117 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
20123 : see if this is a fp.h system
20127 : see if this is a fp_class.h system
20128 set fp_class.h i_fp_class
20131 : see if this is a ieeefp.h system
20132 case "$i_ieeefp" in
20133 '' ) set ieeefp.h i_ieeefp
20138 : see if this is a libutil.h system
20139 set libutil.h i_libutil
20142 : see if mach cthreads are available
20143 if test "X$usethreads" = "X$define"; then
20144 set mach/cthreads.h i_machcthr
20147 i_machcthr="$undef"
20152 : see if this is a mntent.h system
20153 set mntent.h i_mntent
20156 : see if ndbm.h is available
20162 # Some Linux distributions such as RedHat 7.1 put the
20163 # ndbm.h header in /usr/include/gdbm/ndbm.h.
20164 if $test -f /usr/include/gdbm/ndbm.h; then
20165 echo '<gdbm/ndbm.h> found.'
20166 ccflags="$ccflags -I/usr/include/gdbm"
20167 cppflags="$cppflags -I/usr/include/gdbm"
20175 : see if dbm_open exists
20176 set dbm_open d_dbm_open
20178 case "$d_dbm_open" in
20181 echo "We won't be including <ndbm.h>"
20190 : see if net/errno.h is available
20192 set net/errno.h val
20195 : Unfortunately, it causes problems on some systems. Arrgh.
20198 cat > try.c <<'EOM'
20201 #include <net/errno.h>
20207 if $cc $ccflags -c try.c >/dev/null 2>&1; then
20208 echo "We'll be including <net/errno.h>." >&4
20210 echo "We won't be including <net/errno.h>." >&4
20219 : see if netinet/tcp.h is available
20220 set netinet/tcp.h i_netinettcp
20223 : see if this is a poll.h system
20227 : see if this is a prot.h system
20232 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
20233 $cat <<'EOSH' > Cppsym.know
20234 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
20235 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
20236 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
20237 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
20238 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
20239 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
20240 bull c cadmus clipper CMU COFF COMPILER_VERSION
20241 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
20242 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
20243 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
20244 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
20246 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
20247 H3050R H3050RX hbullx20 hcx host_mips
20248 hp200 hp300 hp700 HP700 hp800 hp9000
20249 hp9000s200 hp9000s300 hp9000s400 hp9000s500
20250 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
20251 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
20252 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
20253 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
20254 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
20255 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
20256 Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
20257 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
20258 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
20259 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
20260 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
20261 MATH_HAS_NO_SIDE_EFFECTS
20262 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
20263 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
20264 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
20265 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
20266 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
20267 NetBSD news1500 news1700 news1800 news1900 news3700
20268 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
20269 ns32016 ns32332 ns32k nsc32000
20270 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
20271 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
20272 pc532 pdp11 PGC PIC plexus PORTAR posix
20273 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
20274 POSIX_C_SOURCE POSIX_SOURCE POWER
20275 PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
20276 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
20277 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
20278 sony sony_news sonyrisc sparc sparclite spectrum
20279 stardent stdc STDC_EXT stratos sun sun3 sun386
20280 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
20281 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
20282 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
20283 sysV68 sysV88 Tek4132 Tek4300 titan
20284 TM3200 TM5400 TM5600
20285 tower tower32 tower32_200 tower32_600 tower32_700
20286 tower32_800 tower32_850 tss
20287 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
20288 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
20289 unix UNIX95 UNIX99 unixpc unos
20290 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
20291 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
20292 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
20294 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
20295 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
20296 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
20299 # Maybe put other stuff here too.
20300 cat <<EOSH >>Cppsym.know
20303 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
20304 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
20305 $cat Cppsym.know > Cppsym.c
20306 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
20307 $rm -f Cppsym.a Cppsym.b Cppsym.c
20308 cat <<EOSH > Cppsym
20310 if $test \$# -gt 0; then
20311 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
20312 if $test -s Cppsym.got; then
20319 $tr " " "$trnl" | ./Cppsym.try
20325 cat <<EOSH > Cppsym.try
20327 cat <<'EOCP' > try.c
20330 #define STRINGIFY(a) "a"
20332 #if cpp_stuff == 42
20333 #define StGiFy(a) #a
20334 #define STRINGIFY(a) StGiFy(a)
20336 #if $cpp_stuff != 1 && $cpp_stuff != 42
20337 # include "Bletch: How does this C preprocessor stringify macros?"
20343 cat <<'EOSH' >> Cppsym.try
20345 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
20346 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
20347 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
20348 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
20350 echo 'return 0;}' >> try.c
20352 cat <<EOSH >> Cppsym.try
20354 case "$osname-$gccversion" in
20355 irix-) ccflags="\$ccflags -woff 1178" ;;
20356 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
20358 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
20360 chmod +x Cppsym.try
20361 $eunicefix Cppsym.try
20362 ./Cppsym < Cppsym.know > Cppsym.true
20363 : Add in any linux cpp "predefined macros":
20364 case "$osname::$gccversion" in
20367 rm -f $tHdrH'.h' $tHdrH
20369 if cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
20370 sed 's/#define[\ \ ]*//;s/[\ \ ].*$//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
20371 if [ -s $tHdrH'_cppsym.real' ]; then
20372 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
20375 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
20378 : now check the C compiler for additional symbols
20379 postprocess_cc_v=''
20381 aix) postprocess_cc_v="|$tr , ' '" ;;
20388 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
20391 -D*) echo "\$i" | $sed 's/^-D//';;
20392 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
20397 postprocess_cc_v=''
20400 ./ccsym > ccsym1.raw
20401 if $test -s ccsym1.raw; then
20402 $sort ccsym1.raw | $uniq >ccsym.raw
20404 mv ccsym1.raw ccsym.raw
20407 $awk '/\=/ { print $0; next }
20408 { print $0"=1" }' ccsym.raw >ccsym.list
20409 $comm -13 Cppsym.true ccsym.list >ccsym.own
20410 $comm -12 Cppsym.true ccsym.list >ccsym.com
20411 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
20413 if $test -z ccsym.raw; then
20414 echo "Your C compiler doesn't seem to define any symbols!" >&4
20416 echo "However, your C preprocessor defines the following symbols:"
20419 cppsymbols=`$cat Cppsym.true`
20420 cppsymbols=`echo $cppsymbols`
20421 cppccsymbols="$cppsymbols"
20423 if $test -s ccsym.com; then
20424 echo "Your C compiler and pre-processor define these symbols:"
20425 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
20428 cppccsymbols=`$cat ccsym.com`
20429 cppccsymbols=`echo $cppccsymbols`
20430 $test "$silent" || sleep 1
20432 if $test -s ccsym.cpp; then
20433 $test "$also" && echo " "
20434 echo "Your C pre-processor ${also}defines the following symbols:"
20435 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
20437 cppsymbols=`$cat ccsym.cpp`
20438 cppsymbols=`echo $cppsymbols`
20439 $test "$silent" || sleep 1
20441 if $test -s ccsym.own; then
20442 $test "$also" && echo " "
20443 echo "Your C compiler ${also}defines the following cpp symbols:"
20444 $sed -e 's/\(..*\)=1/\1/' ccsym.own
20445 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
20446 ccsymbols=`$cat ccsym.own`
20447 ccsymbols=`echo $ccsymbols`
20448 $test "$silent" || sleep 1
20452 : see if this is a termio system
20456 if $test `./findhdr termios.h`; then
20457 set tcsetattr i_termios
20463 "$define") echo "You have POSIX termios.h... good!" >&4;;
20464 *) if ./Cppsym pyr; then
20465 case "`/bin/universe`" in
20466 ucb) if $test `./findhdr sgtty.h`; then
20468 echo "<sgtty.h> found." >&4
20470 echo "System is pyramid with BSD universe."
20471 echo "<sgtty.h> not found--you could have problems." >&4
20473 *) if $test `./findhdr termio.h`; then
20475 echo "<termio.h> found." >&4
20477 echo "System is pyramid with USG universe."
20478 echo "<termio.h> not found--you could have problems." >&4
20482 if $test `./findhdr termio.h`; then
20483 echo "<termio.h> found." >&4
20485 elif $test `./findhdr sgtty.h`; then
20486 echo "<sgtty.h> found." >&4
20489 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
20492 if $test `./findhdr sgtty.h`; then
20493 echo "<sgtty.h> found." >&4
20495 elif $test `./findhdr termio.h`; then
20496 echo "<termio.h> found." >&4
20499 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
20503 set i_termio; eval $setvar
20504 val=$val2; set i_sgtty; eval $setvar
20505 val=$val3; set i_termios; eval $setvar
20507 : see if stddef is available
20508 set stddef.h i_stddef
20511 : see if this is a sunmath.h system
20512 set sunmath.h i_sunmath
20515 : see if sys/access.h is available
20516 set sys/access.h i_sysaccess
20519 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
20520 set sys/filio.h i_sysfilio
20523 if $test `./findhdr sys/ioctl.h`; then
20525 echo '<sys/ioctl.h> found.' >&4
20528 if $test $i_sysfilio = "$define"; then
20529 echo '<sys/ioctl.h> NOT found.' >&4
20531 $test $i_sgtty = "$define" && xxx="sgtty.h"
20532 $test $i_termio = "$define" && xxx="termio.h"
20533 $test $i_termios = "$define" && xxx="termios.h"
20534 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
20540 : see if socket ioctl defs are in sys/sockio.h
20542 xxx=`./findhdr sys/sockio.h`
20543 if $test "$xxx"; then
20544 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
20546 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
20549 echo "No socket ioctls found in <sys/sockio.h>." >&4
20554 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
20561 : see if this is a syslog.h system
20562 set syslog.h i_syslog
20566 : see if this is a sys/mode.h system
20567 set sys/mode.h i_sysmode
20570 : see if sys/resource.h has to be included
20571 set sys/resource.h i_sysresrc
20574 : see if sys/security.h is available
20575 set sys/security.h i_syssecrt
20578 : see if this is a sys/statvfs.h system
20579 set sys/statvfs.h i_sysstatvfs
20582 : see if this is a sys/un.h system
20583 set sys/un.h i_sysun
20587 : see if this is a sys/utsname.h system
20588 set sys/utsname.h i_sysutsname
20591 : see if this is a syswait system
20592 set sys/wait.h i_syswait
20595 : see if this is a ustat.h system
20596 set ustat.h i_ustat
20599 : see if this is an utime system
20600 set utime.h i_utime
20603 : see if this is a values.h system
20604 set values.h i_values
20607 : see if this is a vfork system
20610 set vfork.h i_vfork
20618 : see if gdbm.h is available
20623 : see if gdbm_open exists
20624 set gdbm_open d_gdbm_open
20626 case "$d_gdbm_open" in
20629 echo "We won't be including <gdbm.h>"
20639 echo "Looking for extensions..." >&4
20640 : If we are using the old config.sh, known_extensions may contain
20641 : old or inaccurate or duplicate values.
20642 known_extensions=''
20643 nonxs_extensions=''
20644 : We do not use find because it might not be available.
20645 : We do not just use MANIFEST because the user may have dropped
20646 : some additional extensions into the source tree and expect them
20649 : Function to recursively find available extensions, ignoring DynaLoader
20650 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
20654 DynaLoader|dynaload) ;;
20656 if $test -f $xxx/$xxx.xs; then
20657 known_extensions="$known_extensions $1$xxx";
20658 elif $test -f $xxx/Makefile.PL; then
20659 nonxs_extensions="$nonxs_extensions $1$xxx";
20661 if $test -d $xxx -a $# -lt 10; then
20664 eval $find_extensions;
20676 eval $find_extensions
20677 # Special case: Add in threads/shared since it is not picked up by the
20678 # recursive find above (and adding in general recursive finding breaks
20679 # SDBM_File/sdbm). A.D. 10/25/2001.
20680 known_extensions="$known_extensions threads/shared"
20681 set X $nonxs_extensions
20683 nonxs_extensions="$*"
20684 set X $known_extensions
20686 known_extensions="$*"
20689 : Now see which are supported on this system.
20691 for xxx in $known_extensions ; do
20695 $define) avail_ext="$avail_ext $xxx" ;;
20698 GDBM_File|gdbm_fil)
20700 $define) avail_ext="$avail_ext $xxx" ;;
20703 I18N/Langinfo|i18n_lan)
20704 case "$i_langinfo$d_nl_langinfo" in
20705 $define$define) avail_ext="$avail_ext $xxx" ;;
20708 NDBM_File|ndbm_fil)
20711 case "$osname-$use64bitint" in
20714 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
20717 *) avail_ext="$avail_ext $xxx" ;;
20722 ODBM_File|odbm_fil)
20723 case "${i_dbm}${i_rpcsvcdbm}" in
20725 case "$osname-$use64bitint" in
20728 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
20731 *) avail_ext="$avail_ext $xxx" ;;
20737 case "$useposix" in
20738 true|define|y) avail_ext="$avail_ext $xxx" ;;
20742 case "$useopcode" in
20743 true|define|y) avail_ext="$avail_ext $xxx" ;;
20747 case "$d_socket" in
20750 beos) ;; # not unless BONE
20751 *) avail_ext="$avail_ext $xxx" ;;
20756 Sys/Syslog|sys/syslog)
20757 : XXX syslog requires socket
20758 case "$d_socket" in
20759 true|$define|y) avail_ext="$avail_ext $xxx" ;;
20763 case "$usethreads" in
20765 case "$useithreads" in
20766 $undef|false|[nN]*) avail_ext="$avail_ext $xxx" ;;
20770 XS/APItest|xs/apitest)
20771 # This is just for testing. Skip it unless we have dynamic loading.
20774 $define) avail_ext="$avail_ext $xxx" ;;
20777 XS/Typemap|xs/typemap)
20778 # This is just for testing. Skip it unless we have dynamic loading.
20780 $define) avail_ext="$avail_ext $xxx" ;;
20783 threads|threads/shared)
20784 # threads and threads::shared are special cases.
20785 # To stop people from asking "Perl 5.8.0 was supposed
20786 # to have this new fancy threads implementation but my
20787 # perl doesn't have it" and from people trying to
20788 # (re)install the threads module using CPAN.pm and
20789 # CPAN.pm then offering to reinstall Perl 5.8.0,
20790 # the threads.pm and threads/shared.pm will always be
20791 # there, croaking informatively ("you need to rebuild
20792 # all of Perl with threads, sorry") when threads haven't
20793 # been compiled in.
20795 avail_ext="$avail_ext $xxx"
20798 : XXX Do we need a useipcsysv variable here
20799 case "${d_msg}${d_sem}${d_shm}" in
20800 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
20803 *) avail_ext="$avail_ext $xxx"
20812 case "$onlyextensions" in
20814 *) keepextensions=''
20815 echo "You have requested that only certains extensions be included..." >&4
20816 for i in $onlyextensions; do
20817 case " $avail_ext " in
20819 echo "Keeping extension $i."
20820 keepextensions="$keepextensions $i"
20822 *) echo "Ignoring extension $i." ;;
20825 avail_ext="$keepextensions"
20829 case "$noextensions" in
20831 *) keepextensions=''
20832 echo "You have requested that certain extensions be ignored..." >&4
20833 for i in $avail_ext; do
20834 case " $noextensions " in
20835 *" $i "*) echo "Ignoring extension $i." ;;
20836 *) echo "Keeping extension $i.";
20837 keepextensions="$keepextensions $i"
20841 avail_ext="$keepextensions"
20845 : Now see which nonxs extensions are supported on this system.
20846 : For now assume all are.
20848 for xxx in $nonxs_extensions ; do
20850 *) nonxs_ext="$nonxs_ext $xxx"
20862 A number of extensions are supplied with $package. You may choose to
20863 compile these extensions for dynamic loading (the default), compile
20864 them into the $package executable (static loading), or not include
20865 them at all. Answer "none" to include no extensions.
20866 Note that DynaLoader is always built and need not be mentioned here.
20869 case "$dynamic_ext" in
20871 : Exclude those listed in static_ext
20873 for xxx in $avail_ext; do
20874 case " $static_ext " in
20876 *) dflt="$dflt $xxx" ;;
20883 *) dflt="$dynamic_ext"
20884 # Perhaps we are reusing an old out-of-date config.sh.
20887 if test X"$dynamic_ext" != X"$avail_ext"; then
20889 NOTICE: Your previous config.sh list may be incorrect.
20890 The extensions now available to you are
20892 but the default list from your previous config.sh is
20904 rp="What extensions do you wish to load dynamically?"
20907 none) dynamic_ext=' ' ;;
20908 *) dynamic_ext="$ans" ;;
20911 case "$static_ext" in
20913 : Exclude those already listed in dynamic linking
20915 for xxx in $avail_ext; do
20916 case " $dynamic_ext " in
20918 *) dflt="$dflt $xxx" ;;
20925 *) dflt="$static_ext"
20932 rp="What extensions do you wish to load statically?"
20935 none) static_ext=' ' ;;
20936 *) static_ext="$ans" ;;
20941 A number of extensions are supplied with $package. Answer "none"
20942 to include no extensions.
20943 Note that DynaLoader is always built and need not be mentioned here.
20946 case "$static_ext" in
20947 '') dflt="$avail_ext" ;;
20948 *) dflt="$static_ext"
20949 # Perhaps we are reusing an old out-of-date config.sh.
20952 if test X"$static_ext" != X"$avail_ext"; then
20954 NOTICE: Your previous config.sh list may be incorrect.
20955 The extensions now available to you are
20957 but the default list from your previous config.sh is
20966 : Exclude those that are not xs extensions
20970 rp="What extensions do you wish to include?"
20973 none) static_ext=' ' ;;
20974 *) static_ext="$ans" ;;
20979 # Encode is a special case. If we are building Encode as a static
20980 # extension, we need to explicitly list its subextensions as well.
20981 # For other nested extensions, this is handled automatically by
20982 # the appropriate Makefile.PL.
20983 case " $static_ext " in
20984 *" Encode "*) # Add the subextensions of Encode
20986 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
20987 static_ext="$static_ext Encode/$xxx"
20993 set X $dynamic_ext $static_ext $nonxs_ext
20997 # Sanity check: We require an extension suitable for use with
20998 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
20999 # should show up as failures in the test suite, but it's helpful to
21000 # catch them now.) The 'extensions' list is normally sorted
21001 # alphabetically, so we need to accept either
21002 # DB_File ... Fcntl ... IO ....
21003 # or something like
21004 # Fcntl ... NDBM_File ... IO ....
21005 case " $extensions" in
21006 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
21007 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
21008 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
21009 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
21010 echo "WARNING: The Perl you are building will be quite crippled." >& 4
21014 : Remove libraries needed only for extensions
21015 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
21016 : The exception is SunOS 4.x, which needs them.
21017 case "${osname}X${osvers}" in
21021 *) case "$usedl" in
21022 $define|true|[yY]*)
21023 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
21027 *) perllibs="$libs"
21033 : Remove build directory name from cppstdin so it can be used from
21034 : either the present location or the final installed location.
21036 : Get out of the UU directory to get correct path name.
21038 case "$cppstdin" in
21040 echo "Stripping down cppstdin path name"
21046 : end of configuration questions
21048 echo "End of configuration questions."
21051 : back to where it started
21052 if test -d ../UU; then
21056 : configuration may be patched via a 'config.arch' file
21057 if $test -f config.arch; then
21058 echo "I see a config.arch file, loading it."
21062 : configuration may be patched via a 'config.over' file
21063 if $test -f config.over; then
21066 rp='I see a config.over file. Do you wish to load it?'
21069 n*) echo "OK, I'll ignore it.";;
21071 echo "Configuration override changes have been loaded."
21076 : in case they want portability, strip down executable paths
21077 case "$d_portable" in
21080 echo "Stripping down executable paths..." >&4
21081 for file in $loclist $trylist; do
21083 eval $file=`basename $temp`
21088 : create config.sh file
21090 echo "Creating config.sh..." >&4
21091 $spitshell <<EOT >config.sh
21094 # This file was produced by running the Configure script. It holds all the
21095 # definitions figured out by Configure. Should you modify one of these values,
21096 # do not forget to propagate your changes by running "Configure -der". You may
21097 # instead choose to run each of the .SH files by yourself, or "Configure -S".
21100 # Package name : $package
21101 # Source directory : $src
21102 # Configuration time: $cf_time
21103 # Configured by : $cf_by
21104 # Target system : $myuname
21114 Revision='$Revision'
21122 alignbytes='$alignbytes'
21123 ansi2knr='$ansi2knr'
21124 aphostname='$aphostname'
21125 api_revision='$api_revision'
21126 api_subversion='$api_subversion'
21127 api_version='$api_version'
21128 api_versionstring='$api_versionstring'
21131 archlibexp='$archlibexp'
21132 archname64='$archname64'
21133 archname='$archname'
21134 archobjs='$archobjs'
21135 asctime_r_proto='$asctime_r_proto'
21143 byteorder='$byteorder'
21145 castflags='$castflags'
21148 cccdlflags='$cccdlflags'
21149 ccdlflags='$ccdlflags'
21151 ccflags_uselargefiles='$ccflags_uselargefiles'
21153 ccsymbols='$ccsymbols'
21154 ccversion='$ccversion'
21156 cf_email='$cf_email'
21158 charsize='$charsize'
21162 clocktype='$clocktype'
21164 compress='$compress'
21165 contains='$contains'
21169 cpp_stuff='$cpp_stuff'
21170 cppccsymbols='$cppccsymbols'
21171 cppflags='$cppflags'
21173 cppminus='$cppminus'
21175 cppstdin='$cppstdin'
21176 cppsymbols='$cppsymbols'
21177 crypt_r_proto='$crypt_r_proto'
21178 cryptlib='$cryptlib'
21180 ctermid_r_proto='$ctermid_r_proto'
21181 ctime_r_proto='$ctime_r_proto'
21182 d_Gconvert='$d_Gconvert'
21183 d_PRIEUldbl='$d_PRIEUldbl'
21184 d_PRIFUldbl='$d_PRIFUldbl'
21185 d_PRIGUldbl='$d_PRIGUldbl'
21186 d_PRIXU64='$d_PRIXU64'
21187 d_PRId64='$d_PRId64'
21188 d_PRIeldbl='$d_PRIeldbl'
21189 d_PRIfldbl='$d_PRIfldbl'
21190 d_PRIgldbl='$d_PRIgldbl'
21191 d_PRIi64='$d_PRIi64'
21192 d_PRIo64='$d_PRIo64'
21193 d_PRIu64='$d_PRIu64'
21194 d_PRIx64='$d_PRIx64'
21195 d_SCNfldbl='$d_SCNfldbl'
21196 d__fwalk='$d__fwalk'
21197 d_access='$d_access'
21198 d_accessx='$d_accessx'
21201 d_archlib='$d_archlib'
21202 d_asctime_r='$d_asctime_r'
21205 d_attribute_format='$d_attribute_format'
21206 d_attribute_malloc='$d_attribute_malloc'
21207 d_attribute_nonnull='$d_attribute_nonnull'
21208 d_attribute_noreturn='$d_attribute_noreturn'
21209 d_attribute_pure='$d_attribute_pure'
21210 d_attribute_unused='$d_attribute_unused'
21211 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
21215 d_bsdgetpgrp='$d_bsdgetpgrp'
21216 d_bsdsetpgrp='$d_bsdsetpgrp'
21217 d_builtin_choose_expr='$d_builtin_choose_expr'
21218 d_builtin_expect='$d_builtin_expect'
21220 d_casti32='$d_casti32'
21221 d_castneg='$d_castneg'
21222 d_charvspr='$d_charvspr'
21224 d_chroot='$d_chroot'
21225 d_chsize='$d_chsize'
21227 d_clearenv='$d_clearenv'
21228 d_closedir='$d_closedir'
21229 d_cmsghdr_s='$d_cmsghdr_s'
21231 d_copysignl='$d_copysignl'
21233 d_crypt_r='$d_crypt_r'
21235 d_ctermid_r='$d_ctermid_r'
21236 d_ctime_r='$d_ctime_r'
21237 d_cuserid='$d_cuserid'
21238 d_dbl_dig='$d_dbl_dig'
21239 d_dbminitproto='$d_dbminitproto'
21240 d_difftime='$d_difftime'
21242 d_dirnamlen='$d_dirnamlen'
21243 d_dlerror='$d_dlerror'
21244 d_dlopen='$d_dlopen'
21245 d_dlsymun='$d_dlsymun'
21246 d_dosuid='$d_dosuid'
21247 d_drand48_r='$d_drand48_r'
21248 d_drand48proto='$d_drand48proto'
21250 d_eaccess='$d_eaccess'
21251 d_endgrent='$d_endgrent'
21252 d_endgrent_r='$d_endgrent_r'
21253 d_endhent='$d_endhent'
21254 d_endhostent_r='$d_endhostent_r'
21255 d_endnent='$d_endnent'
21256 d_endnetent_r='$d_endnetent_r'
21257 d_endpent='$d_endpent'
21258 d_endprotoent_r='$d_endprotoent_r'
21259 d_endpwent='$d_endpwent'
21260 d_endpwent_r='$d_endpwent_r'
21261 d_endsent='$d_endsent'
21262 d_endservent_r='$d_endservent_r'
21263 d_eofnblk='$d_eofnblk'
21264 d_eunice='$d_eunice'
21265 d_faststdio='$d_faststdio'
21266 d_fchdir='$d_fchdir'
21267 d_fchmod='$d_fchmod'
21268 d_fchown='$d_fchown'
21270 d_fcntl_can_lock='$d_fcntl_can_lock'
21271 d_fd_macros='$d_fd_macros'
21272 d_fd_set='$d_fd_set'
21273 d_fds_bits='$d_fds_bits'
21274 d_fgetpos='$d_fgetpos'
21275 d_finite='$d_finite'
21276 d_finitel='$d_finitel'
21277 d_flexfnam='$d_flexfnam'
21279 d_flockproto='$d_flockproto'
21281 d_fp_class='$d_fp_class'
21282 d_fpathconf='$d_fpathconf'
21283 d_fpclass='$d_fpclass'
21284 d_fpclassify='$d_fpclassify'
21285 d_fpclassl='$d_fpclassl'
21286 d_fpos64_t='$d_fpos64_t'
21287 d_frexpl='$d_frexpl'
21288 d_fs_data_s='$d_fs_data_s'
21289 d_fseeko='$d_fseeko'
21290 d_fsetpos='$d_fsetpos'
21291 d_fstatfs='$d_fstatfs'
21292 d_fstatvfs='$d_fstatvfs'
21294 d_ftello='$d_ftello'
21296 d_futimes='$d_futimes'
21297 d_getcwd='$d_getcwd'
21298 d_getespwnam='$d_getespwnam'
21299 d_getfsstat='$d_getfsstat'
21300 d_getgrent='$d_getgrent'
21301 d_getgrent_r='$d_getgrent_r'
21302 d_getgrgid_r='$d_getgrgid_r'
21303 d_getgrnam_r='$d_getgrnam_r'
21304 d_getgrps='$d_getgrps'
21305 d_gethbyaddr='$d_gethbyaddr'
21306 d_gethbyname='$d_gethbyname'
21307 d_gethent='$d_gethent'
21308 d_gethname='$d_gethname'
21309 d_gethostbyaddr_r='$d_gethostbyaddr_r'
21310 d_gethostbyname_r='$d_gethostbyname_r'
21311 d_gethostent_r='$d_gethostent_r'
21312 d_gethostprotos='$d_gethostprotos'
21313 d_getitimer='$d_getitimer'
21314 d_getlogin='$d_getlogin'
21315 d_getlogin_r='$d_getlogin_r'
21316 d_getmnt='$d_getmnt'
21317 d_getmntent='$d_getmntent'
21318 d_getnbyaddr='$d_getnbyaddr'
21319 d_getnbyname='$d_getnbyname'
21320 d_getnent='$d_getnent'
21321 d_getnetbyaddr_r='$d_getnetbyaddr_r'
21322 d_getnetbyname_r='$d_getnetbyname_r'
21323 d_getnetent_r='$d_getnetent_r'
21324 d_getnetprotos='$d_getnetprotos'
21325 d_getpagsz='$d_getpagsz'
21326 d_getpbyname='$d_getpbyname'
21327 d_getpbynumber='$d_getpbynumber'
21328 d_getpent='$d_getpent'
21329 d_getpgid='$d_getpgid'
21330 d_getpgrp2='$d_getpgrp2'
21331 d_getpgrp='$d_getpgrp'
21332 d_getppid='$d_getppid'
21333 d_getprior='$d_getprior'
21334 d_getprotobyname_r='$d_getprotobyname_r'
21335 d_getprotobynumber_r='$d_getprotobynumber_r'
21336 d_getprotoent_r='$d_getprotoent_r'
21337 d_getprotoprotos='$d_getprotoprotos'
21338 d_getprpwnam='$d_getprpwnam'
21339 d_getpwent='$d_getpwent'
21340 d_getpwent_r='$d_getpwent_r'
21341 d_getpwnam_r='$d_getpwnam_r'
21342 d_getpwuid_r='$d_getpwuid_r'
21343 d_getsbyname='$d_getsbyname'
21344 d_getsbyport='$d_getsbyport'
21345 d_getsent='$d_getsent'
21346 d_getservbyname_r='$d_getservbyname_r'
21347 d_getservbyport_r='$d_getservbyport_r'
21348 d_getservent_r='$d_getservent_r'
21349 d_getservprotos='$d_getservprotos'
21350 d_getspnam='$d_getspnam'
21351 d_getspnam_r='$d_getspnam_r'
21352 d_gettimeod='$d_gettimeod'
21353 d_gmtime_r='$d_gmtime_r'
21354 d_gnulibc='$d_gnulibc'
21355 d_grpasswd='$d_grpasswd'
21356 d_hasmntopt='$d_hasmntopt'
21358 d_ilogbl='$d_ilogbl'
21359 d_inc_version_list='$d_inc_version_list'
21361 d_inetaton='$d_inetaton'
21362 d_int64_t='$d_int64_t'
21363 d_isascii='$d_isascii'
21364 d_isfinite='$d_isfinite'
21367 d_isnanl='$d_isnanl'
21368 d_killpg='$d_killpg'
21369 d_lchown='$d_lchown'
21370 d_ldbl_dig='$d_ldbl_dig'
21371 d_libm_lib_version='$d_libm_lib_version'
21373 d_localtime_r='$d_localtime_r'
21374 d_locconv='$d_locconv'
21376 d_longdbl='$d_longdbl'
21377 d_longlong='$d_longlong'
21378 d_lseekproto='$d_lseekproto'
21380 d_madvise='$d_madvise'
21381 d_malloc_good_size='$d_malloc_good_size'
21382 d_malloc_size='$d_malloc_size'
21384 d_mbstowcs='$d_mbstowcs'
21385 d_mbtowc='$d_mbtowc'
21386 d_memchr='$d_memchr'
21387 d_memcmp='$d_memcmp'
21388 d_memcpy='$d_memcpy'
21389 d_memmove='$d_memmove'
21390 d_memset='$d_memset'
21392 d_mkdtemp='$d_mkdtemp'
21393 d_mkfifo='$d_mkfifo'
21394 d_mkstemp='$d_mkstemp'
21395 d_mkstemps='$d_mkstemps'
21396 d_mktime='$d_mktime'
21399 d_modfl_pow32_bug='$d_modfl_pow32_bug'
21400 d_modflproto='$d_modflproto'
21401 d_mprotect='$d_mprotect'
21403 d_msg_ctrunc='$d_msg_ctrunc'
21404 d_msg_dontroute='$d_msg_dontroute'
21405 d_msg_oob='$d_msg_oob'
21406 d_msg_peek='$d_msg_peek'
21407 d_msg_proxy='$d_msg_proxy'
21408 d_msgctl='$d_msgctl'
21409 d_msgget='$d_msgget'
21410 d_msghdr_s='$d_msghdr_s'
21411 d_msgrcv='$d_msgrcv'
21412 d_msgsnd='$d_msgsnd'
21414 d_munmap='$d_munmap'
21415 d_mymalloc='$d_mymalloc'
21417 d_nl_langinfo='$d_nl_langinfo'
21418 d_nv_preserves_uv='$d_nv_preserves_uv'
21419 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
21420 d_off64_t='$d_off64_t'
21421 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
21422 d_oldpthreads='$d_oldpthreads'
21423 d_oldsock='$d_oldsock'
21425 d_pathconf='$d_pathconf'
21427 d_perl_otherlibdirs='$d_perl_otherlibdirs'
21428 d_phostname='$d_phostname'
21431 d_portable='$d_portable'
21432 d_procselfexe='$d_procselfexe'
21433 d_pthread_atfork='$d_pthread_atfork'
21434 d_pthread_attr_setscope='$d_pthread_attr_setscope'
21435 d_pthread_yield='$d_pthread_yield'
21437 d_pwchange='$d_pwchange'
21438 d_pwclass='$d_pwclass'
21439 d_pwcomment='$d_pwcomment'
21440 d_pwexpire='$d_pwexpire'
21441 d_pwgecos='$d_pwgecos'
21442 d_pwpasswd='$d_pwpasswd'
21443 d_pwquota='$d_pwquota'
21446 d_random_r='$d_random_r'
21447 d_readdir64_r='$d_readdir64_r'
21448 d_readdir='$d_readdir'
21449 d_readdir_r='$d_readdir_r'
21450 d_readlink='$d_readlink'
21452 d_recvmsg='$d_recvmsg'
21453 d_rename='$d_rename'
21454 d_rewinddir='$d_rewinddir'
21456 d_safebcpy='$d_safebcpy'
21457 d_safemcpy='$d_safemcpy'
21458 d_sanemcmp='$d_sanemcmp'
21459 d_sbrkproto='$d_sbrkproto'
21460 d_scalbnl='$d_scalbnl'
21461 d_sched_yield='$d_sched_yield'
21462 d_scm_rights='$d_scm_rights'
21463 d_seekdir='$d_seekdir'
21464 d_select='$d_select'
21466 d_semctl='$d_semctl'
21467 d_semctl_semid_ds='$d_semctl_semid_ds'
21468 d_semctl_semun='$d_semctl_semun'
21469 d_semget='$d_semget'
21471 d_sendmsg='$d_sendmsg'
21472 d_setegid='$d_setegid'
21473 d_seteuid='$d_seteuid'
21474 d_setgrent='$d_setgrent'
21475 d_setgrent_r='$d_setgrent_r'
21476 d_setgrps='$d_setgrps'
21477 d_sethent='$d_sethent'
21478 d_sethostent_r='$d_sethostent_r'
21479 d_setitimer='$d_setitimer'
21480 d_setlinebuf='$d_setlinebuf'
21481 d_setlocale='$d_setlocale'
21482 d_setlocale_r='$d_setlocale_r'
21483 d_setnent='$d_setnent'
21484 d_setnetent_r='$d_setnetent_r'
21485 d_setpent='$d_setpent'
21486 d_setpgid='$d_setpgid'
21487 d_setpgrp2='$d_setpgrp2'
21488 d_setpgrp='$d_setpgrp'
21489 d_setprior='$d_setprior'
21490 d_setproctitle='$d_setproctitle'
21491 d_setprotoent_r='$d_setprotoent_r'
21492 d_setpwent='$d_setpwent'
21493 d_setpwent_r='$d_setpwent_r'
21494 d_setregid='$d_setregid'
21495 d_setresgid='$d_setresgid'
21496 d_setresuid='$d_setresuid'
21497 d_setreuid='$d_setreuid'
21498 d_setrgid='$d_setrgid'
21499 d_setruid='$d_setruid'
21500 d_setsent='$d_setsent'
21501 d_setservent_r='$d_setservent_r'
21502 d_setsid='$d_setsid'
21503 d_setvbuf='$d_setvbuf'
21507 d_shmatprototype='$d_shmatprototype'
21508 d_shmctl='$d_shmctl'
21510 d_shmget='$d_shmget'
21511 d_sigaction='$d_sigaction'
21512 d_sigprocmask='$d_sigprocmask'
21513 d_sigsetjmp='$d_sigsetjmp'
21514 d_sitearch='$d_sitearch'
21515 d_snprintf='$d_snprintf'
21516 d_sockatmark='$d_sockatmark'
21517 d_sockatmarkproto='$d_sockatmarkproto'
21518 d_socket='$d_socket'
21519 d_socklen_t='$d_socklen_t'
21520 d_sockpair='$d_sockpair'
21521 d_socks5_init='$d_socks5_init'
21522 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
21524 d_srand48_r='$d_srand48_r'
21525 d_srandom_r='$d_srandom_r'
21526 d_sresgproto='$d_sresgproto'
21527 d_sresuproto='$d_sresuproto'
21528 d_statblks='$d_statblks'
21529 d_statfs_f_flags='$d_statfs_f_flags'
21530 d_statfs_s='$d_statfs_s'
21531 d_statvfs='$d_statvfs'
21532 d_stdio_cnt_lval='$d_stdio_cnt_lval'
21533 d_stdio_ptr_lval='$d_stdio_ptr_lval'
21534 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
21535 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
21536 d_stdio_stream_array='$d_stdio_stream_array'
21537 d_stdiobase='$d_stdiobase'
21538 d_stdstdio='$d_stdstdio'
21539 d_strchr='$d_strchr'
21540 d_strcoll='$d_strcoll'
21541 d_strctcpy='$d_strctcpy'
21542 d_strerrm='$d_strerrm'
21543 d_strerror='$d_strerror'
21544 d_strerror_r='$d_strerror_r'
21545 d_strftime='$d_strftime'
21546 d_strlcat='$d_strlcat'
21547 d_strlcpy='$d_strlcpy'
21548 d_strtod='$d_strtod'
21549 d_strtol='$d_strtol'
21550 d_strtold='$d_strtold'
21551 d_strtoll='$d_strtoll'
21552 d_strtoq='$d_strtoq'
21553 d_strtoul='$d_strtoul'
21554 d_strtoull='$d_strtoull'
21555 d_strtouq='$d_strtouq'
21556 d_strxfrm='$d_strxfrm'
21557 d_suidsafe='$d_suidsafe'
21558 d_symlink='$d_symlink'
21559 d_syscall='$d_syscall'
21560 d_syscallproto='$d_syscallproto'
21561 d_sysconf='$d_sysconf'
21562 d_sysernlst='$d_sysernlst'
21563 d_syserrlst='$d_syserrlst'
21564 d_system='$d_system'
21565 d_tcgetpgrp='$d_tcgetpgrp'
21566 d_tcsetpgrp='$d_tcsetpgrp'
21567 d_telldir='$d_telldir'
21568 d_telldirproto='$d_telldirproto'
21571 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
21572 d_tm_tm_zone='$d_tm_tm_zone'
21573 d_tmpnam_r='$d_tmpnam_r'
21574 d_truncate='$d_truncate'
21575 d_ttyname_r='$d_ttyname_r'
21576 d_tzname='$d_tzname'
21577 d_u32align='$d_u32align'
21578 d_ualarm='$d_ualarm'
21581 d_union_semun='$d_union_semun'
21582 d_unordered='$d_unordered'
21583 d_unsetenv='$d_unsetenv'
21584 d_usleep='$d_usleep'
21585 d_usleepproto='$d_usleepproto'
21587 d_vendorarch='$d_vendorarch'
21588 d_vendorbin='$d_vendorbin'
21589 d_vendorlib='$d_vendorlib'
21590 d_vendorscript='$d_vendorscript'
21592 d_void_closedir='$d_void_closedir'
21593 d_voidsig='$d_voidsig'
21594 d_voidtty='$d_voidtty'
21595 d_volatile='$d_volatile'
21596 d_vprintf='$d_vprintf'
21597 d_vsnprintf='$d_vsnprintf'
21599 d_waitpid='$d_waitpid'
21600 d_wcstombs='$d_wcstombs'
21601 d_wctomb='$d_wctomb'
21602 d_writev='$d_writev'
21605 db_hashtype='$db_hashtype'
21606 db_prefixtype='$db_prefixtype'
21607 db_version_major='$db_version_major'
21608 db_version_minor='$db_version_minor'
21609 db_version_patch='$db_version_patch'
21610 defvoidused='$defvoidused'
21611 direntrytype='$direntrytype'
21614 doublesize='$doublesize'
21616 drand48_r_proto='$drand48_r_proto'
21617 dynamic_ext='$dynamic_ext'
21623 endgrent_r_proto='$endgrent_r_proto'
21624 endhostent_r_proto='$endhostent_r_proto'
21625 endnetent_r_proto='$endnetent_r_proto'
21626 endprotoent_r_proto='$endprotoent_r_proto'
21627 endpwent_r_proto='$endpwent_r_proto'
21628 endservent_r_proto='$endservent_r_proto'
21629 eunicefix='$eunicefix'
21632 extensions='$extensions'
21634 fflushNULL='$fflushNULL'
21635 fflushall='$fflushall'
21637 firstmakefile='$firstmakefile'
21639 fpossize='$fpossize'
21640 fpostype='$fpostype'
21641 freetype='$freetype'
21644 full_csh='$full_csh'
21645 full_sed='$full_sed'
21646 gccansipedantic='$gccansipedantic'
21647 gccosandvers='$gccosandvers'
21648 gccversion='$gccversion'
21649 getgrent_r_proto='$getgrent_r_proto'
21650 getgrgid_r_proto='$getgrgid_r_proto'
21651 getgrnam_r_proto='$getgrnam_r_proto'
21652 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
21653 gethostbyname_r_proto='$gethostbyname_r_proto'
21654 gethostent_r_proto='$gethostent_r_proto'
21655 getlogin_r_proto='$getlogin_r_proto'
21656 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
21657 getnetbyname_r_proto='$getnetbyname_r_proto'
21658 getnetent_r_proto='$getnetent_r_proto'
21659 getprotobyname_r_proto='$getprotobyname_r_proto'
21660 getprotobynumber_r_proto='$getprotobynumber_r_proto'
21661 getprotoent_r_proto='$getprotoent_r_proto'
21662 getpwent_r_proto='$getpwent_r_proto'
21663 getpwnam_r_proto='$getpwnam_r_proto'
21664 getpwuid_r_proto='$getpwuid_r_proto'
21665 getservbyname_r_proto='$getservbyname_r_proto'
21666 getservbyport_r_proto='$getservbyport_r_proto'
21667 getservent_r_proto='$getservent_r_proto'
21668 getspnam_r_proto='$getspnam_r_proto'
21669 gidformat='$gidformat'
21675 gmtime_r_proto='$gmtime_r_proto'
21676 gnulibc_version='$gnulibc_version'
21678 groupcat='$groupcat'
21679 groupstype='$groupstype'
21682 h_sysfile='$h_sysfile'
21685 html1dir='$html1dir'
21686 html1direxp='$html1direxp'
21687 html3dir='$html3dir'
21688 html3direxp='$html3direxp'
21697 i_arpainet='$i_arpainet'
21698 i_bsdioctl='$i_bsdioctl'
21702 i_dirent='$i_dirent'
21708 i_fp_class='$i_fp_class'
21711 i_ieeefp='$i_ieeefp'
21712 i_inttypes='$i_inttypes'
21713 i_langinfo='$i_langinfo'
21714 i_libutil='$i_libutil'
21715 i_limits='$i_limits'
21716 i_locale='$i_locale'
21717 i_machcthr='$i_machcthr'
21718 i_malloc='$i_malloc'
21720 i_memory='$i_memory'
21721 i_mntent='$i_mntent'
21724 i_neterrno='$i_neterrno'
21725 i_netinettcp='$i_netinettcp'
21729 i_pthread='$i_pthread'
21731 i_rpcsvcdbm='$i_rpcsvcdbm'
21734 i_shadow='$i_shadow'
21736 i_stdarg='$i_stdarg'
21737 i_stddef='$i_stddef'
21738 i_stdlib='$i_stdlib'
21739 i_string='$i_string'
21740 i_sunmath='$i_sunmath'
21741 i_sysaccess='$i_sysaccess'
21742 i_sysdir='$i_sysdir'
21743 i_sysfile='$i_sysfile'
21744 i_sysfilio='$i_sysfilio'
21746 i_sysioctl='$i_sysioctl'
21747 i_syslog='$i_syslog'
21748 i_sysmman='$i_sysmman'
21749 i_sysmode='$i_sysmode'
21750 i_sysmount='$i_sysmount'
21751 i_sysndir='$i_sysndir'
21752 i_sysparam='$i_sysparam'
21753 i_sysresrc='$i_sysresrc'
21754 i_syssecrt='$i_syssecrt'
21755 i_sysselct='$i_sysselct'
21756 i_syssockio='$i_syssockio'
21757 i_sysstat='$i_sysstat'
21758 i_sysstatfs='$i_sysstatfs'
21759 i_sysstatvfs='$i_sysstatvfs'
21760 i_systime='$i_systime'
21761 i_systimek='$i_systimek'
21762 i_systimes='$i_systimes'
21763 i_systypes='$i_systypes'
21764 i_sysuio='$i_sysuio'
21766 i_sysutsname='$i_sysutsname'
21767 i_sysvfs='$i_sysvfs'
21768 i_syswait='$i_syswait'
21769 i_termio='$i_termio'
21770 i_termios='$i_termios'
21772 i_unistd='$i_unistd'
21775 i_values='$i_values'
21776 i_varargs='$i_varargs'
21777 i_varhdr='$i_varhdr'
21779 ignore_versioned_solibs='$ignore_versioned_solibs'
21780 inc_version_list='$inc_version_list'
21781 inc_version_list_init='$inc_version_list_init'
21784 initialinstalllocation='$initialinstalllocation'
21785 installarchlib='$installarchlib'
21786 installbin='$installbin'
21787 installhtml1dir='$installhtml1dir'
21788 installhtml3dir='$installhtml3dir'
21789 installman1dir='$installman1dir'
21790 installman3dir='$installman3dir'
21791 installprefix='$installprefix'
21792 installprefixexp='$installprefixexp'
21793 installprivlib='$installprivlib'
21794 installscript='$installscript'
21795 installsitearch='$installsitearch'
21796 installsitebin='$installsitebin'
21797 installsitehtml1dir='$installsitehtml1dir'
21798 installsitehtml3dir='$installsitehtml3dir'
21799 installsitelib='$installsitelib'
21800 installsiteman1dir='$installsiteman1dir'
21801 installsiteman3dir='$installsiteman3dir'
21802 installsitescript='$installsitescript'
21803 installstyle='$installstyle'
21804 installusrbinperl='$installusrbinperl'
21805 installvendorarch='$installvendorarch'
21806 installvendorbin='$installvendorbin'
21807 installvendorhtml1dir='$installvendorhtml1dir'
21808 installvendorhtml3dir='$installvendorhtml3dir'
21809 installvendorlib='$installvendorlib'
21810 installvendorman1dir='$installvendorman1dir'
21811 installvendorman3dir='$installvendorman3dir'
21812 installvendorscript='$installvendorscript'
21814 issymlink='$issymlink'
21815 ivdformat='$ivdformat'
21818 known_extensions='$known_extensions'
21821 lddlflags='$lddlflags'
21823 ldflags_uselargefiles='$ldflags_uselargefiles'
21824 ldlibpthname='$ldlibpthname'
21831 libsdirs='$libsdirs'
21832 libsfiles='$libsfiles'
21833 libsfound='$libsfound'
21834 libspath='$libspath'
21835 libswanted='$libswanted'
21836 libswanted_uselargefiles='$libswanted_uselargefiles'
21842 localtime_r_proto='$localtime_r_proto'
21843 locincpth='$locincpth'
21844 loclibpth='$loclibpth'
21845 longdblsize='$longdblsize'
21846 longlongsize='$longlongsize'
21847 longsize='$longsize'
21851 lseeksize='$lseeksize'
21852 lseektype='$lseektype'
21855 madlyobj='$madlyobj'
21856 madlysrc='$madlysrc'
21860 make_set_make='$make_set_make'
21861 mallocobj='$mallocobj'
21862 mallocsrc='$mallocsrc'
21863 malloctype='$malloctype'
21865 man1direxp='$man1direxp'
21868 man3direxp='$man3direxp'
21870 mips_type='$mips_type'
21871 mistrustnm='$mistrustnm'
21873 mmaptype='$mmaptype'
21874 modetype='$modetype'
21876 multiarch='$multiarch'
21878 myarchname='$myarchname'
21879 mydomain='$mydomain'
21880 myhostname='$myhostname'
21883 need_va_copy='$need_va_copy'
21884 netdb_hlen_type='$netdb_hlen_type'
21885 netdb_host_type='$netdb_host_type'
21886 netdb_name_type='$netdb_name_type'
21887 netdb_net_type='$netdb_net_type'
21890 nm_so_opt='$nm_so_opt'
21891 nonxs_ext='$nonxs_ext'
21893 nvEUformat='$nvEUformat'
21894 nvFUformat='$nvFUformat'
21895 nvGUformat='$nvGUformat'
21896 nv_preserves_uv_bits='$nv_preserves_uv_bits'
21897 nveformat='$nveformat'
21898 nvfformat='$nvfformat'
21899 nvgformat='$nvgformat'
21902 o_nonblock='$o_nonblock'
21904 old_pthread_create_joinable='$old_pthread_create_joinable'
21905 optimize='$optimize'
21906 orderlib='$orderlib'
21909 otherlibdirs='$otherlibdirs'
21913 patchlevel='$patchlevel'
21914 path_sep='$path_sep'
21917 perl_patchlevel='$perl_patchlevel'
21918 perladmin='$perladmin'
21919 perllibs='$perllibs'
21920 perlpath='$perlpath'
21922 phostname='$phostname'
21928 prefixexp='$prefixexp'
21930 privlibexp='$privlibexp'
21931 procselfexe='$procselfexe'
21932 prototype='$prototype'
21934 quadkind='$quadkind'
21935 quadtype='$quadtype'
21936 randbits='$randbits'
21937 randfunc='$randfunc'
21938 random_r_proto='$random_r_proto'
21939 randseedtype='$randseedtype'
21941 rd_nodata='$rd_nodata'
21942 readdir64_r_proto='$readdir64_r_proto'
21943 readdir_r_proto='$readdir_r_proto'
21944 revision='$revision'
21949 sPRIEUldbl='$sPRIEUldbl'
21950 sPRIFUldbl='$sPRIFUldbl'
21951 sPRIGUldbl='$sPRIGUldbl'
21952 sPRIXU64='$sPRIXU64'
21954 sPRIeldbl='$sPRIeldbl'
21955 sPRIfldbl='$sPRIfldbl'
21956 sPRIgldbl='$sPRIgldbl'
21961 sSCNfldbl='$sSCNfldbl'
21962 sched_yield='$sched_yield'
21963 scriptdir='$scriptdir'
21964 scriptdirexp='$scriptdirexp'
21966 seedfunc='$seedfunc'
21967 selectminbits='$selectminbits'
21968 selecttype='$selecttype'
21969 sendmail='$sendmail'
21970 setgrent_r_proto='$setgrent_r_proto'
21971 sethostent_r_proto='$sethostent_r_proto'
21972 setlocale_r_proto='$setlocale_r_proto'
21973 setnetent_r_proto='$setnetent_r_proto'
21974 setprotoent_r_proto='$setprotoent_r_proto'
21975 setpwent_r_proto='$setpwent_r_proto'
21976 setservent_r_proto='$setservent_r_proto'
21979 sharpbang='$sharpbang'
21980 shmattype='$shmattype'
21981 shortsize='$shortsize'
21984 sig_count='$sig_count'
21985 sig_name='$sig_name'
21986 sig_name_init='$sig_name_init'
21988 sig_num_init='$sig_num_init'
21989 sig_size='$sig_size'
21990 signal_t='$signal_t'
21991 sitearch='$sitearch'
21992 sitearchexp='$sitearchexp'
21994 sitebinexp='$sitebinexp'
21995 sitehtml1dir='$sitehtml1dir'
21996 sitehtml1direxp='$sitehtml1direxp'
21997 sitehtml3dir='$sitehtml3dir'
21998 sitehtml3direxp='$sitehtml3direxp'
22000 sitelib_stem='$sitelib_stem'
22001 sitelibexp='$sitelibexp'
22002 siteman1dir='$siteman1dir'
22003 siteman1direxp='$siteman1direxp'
22004 siteman3dir='$siteman3dir'
22005 siteman3direxp='$siteman3direxp'
22006 siteprefix='$siteprefix'
22007 siteprefixexp='$siteprefixexp'
22008 sitescript='$sitescript'
22009 sitescriptexp='$sitescriptexp'
22010 sizesize='$sizesize'
22011 sizetype='$sizetype'
22015 sockethdr='$sockethdr'
22016 socketlib='$socketlib'
22017 socksizetype='$socksizetype'
22019 spackage='$spackage'
22020 spitshell='$spitshell'
22021 srand48_r_proto='$srand48_r_proto'
22022 srandom_r_proto='$srandom_r_proto'
22024 ssizetype='$ssizetype'
22025 startperl='$startperl'
22027 static_ext='$static_ext'
22029 stdio_base='$stdio_base'
22030 stdio_bufsiz='$stdio_bufsiz'
22031 stdio_cnt='$stdio_cnt'
22032 stdio_filbuf='$stdio_filbuf'
22033 stdio_ptr='$stdio_ptr'
22034 stdio_stream_array='$stdio_stream_array'
22035 strerror_r_proto='$strerror_r_proto'
22038 subversion='$subversion'
22042 targetarch='$targetarch'
22046 timeincl='$timeincl'
22047 timetype='$timetype'
22048 tmpnam_r_proto='$tmpnam_r_proto'
22054 ttyname_r_proto='$ttyname_r_proto'
22063 uidformat='$uidformat'
22069 uquadtype='$uquadtype'
22070 use5005threads='$use5005threads'
22071 use64bitall='$use64bitall'
22072 use64bitint='$use64bitint'
22073 usecrosscompile='$usecrosscompile'
22075 usefaststdio='$usefaststdio'
22076 useithreads='$useithreads'
22077 uselargefiles='$uselargefiles'
22078 uselongdouble='$uselongdouble'
22079 usemallocwrap='$usemallocwrap'
22080 usemorebits='$usemorebits'
22081 usemultiplicity='$usemultiplicity'
22082 usemymalloc='$usemymalloc'
22084 useopcode='$useopcode'
22085 useperlio='$useperlio'
22086 useposix='$useposix'
22087 usereentrant='$usereentrant'
22088 userelocatableinc='$userelocatableinc'
22090 useshrplib='$useshrplib'
22091 usesitecustomize='$usesitecustomize'
22092 usesocks='$usesocks'
22093 usethreads='$usethreads'
22094 usevendorprefix='$usevendorprefix'
22095 usevfork='$usevfork'
22098 uvXUformat='$uvXUformat'
22099 uvoformat='$uvoformat'
22102 uvuformat='$uvuformat'
22103 uvxformat='$uvxformat'
22104 vendorarch='$vendorarch'
22105 vendorarchexp='$vendorarchexp'
22106 vendorbin='$vendorbin'
22107 vendorbinexp='$vendorbinexp'
22108 vendorhtml1dir='$vendorhtml1dir'
22109 vendorhtml1direxp='$vendorhtml1direxp'
22110 vendorhtml3dir='$vendorhtml3dir'
22111 vendorhtml3direxp='$vendorhtml3direxp'
22112 vendorlib='$vendorlib'
22113 vendorlib_stem='$vendorlib_stem'
22114 vendorlibexp='$vendorlibexp'
22115 vendorman1dir='$vendorman1dir'
22116 vendorman1direxp='$vendorman1direxp'
22117 vendorman3dir='$vendorman3dir'
22118 vendorman3direxp='$vendorman3direxp'
22119 vendorprefix='$vendorprefix'
22120 vendorprefixexp='$vendorprefixexp'
22121 vendorscript='$vendorscript'
22122 vendorscriptexp='$vendorscriptexp'
22124 version_patchlevel_string='$version_patchlevel_string'
22125 versiononly='$versiononly'
22127 voidflags='$voidflags'
22130 yaccflags='$yaccflags'
22135 : Add in command line options if available
22136 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22138 : add special variables
22139 $test -f $src/patchlevel.h && \
22140 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
22141 echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
22142 echo "PERL_CONFIG_SH=true" >>config.sh
22144 : propagate old symbols
22145 if $test -f UU/config.sh; then
22146 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
22147 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
22148 $sort | $uniq -u >UU/oldsyms
22149 set X `cat UU/oldsyms`
22155 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
22157 echo "# Variables propagated from previous config.sh file." >>config.sh
22158 for sym in `cat UU/oldsyms`; do
22159 echo " Propagating $hint variable "'$'"$sym..."
22160 eval 'tmp="$'"${sym}"'"'
22162 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
22168 : Finish up by extracting the .SH files
22172 echo "Extraction done."
22182 If you'd like to make any changes to the config.sh file before I begin
22183 to configure things, do it as a shell escape now (e.g. !vi config.sh).
22186 rp="Press return or use a shell escape to edit config.sh:"
22191 *) : in case they cannot read
22192 sh 1>&4 -c "$ans";;
22197 : if this fails, just run all the .SH files by hand
22206 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
22213 Now you need to generate make dependencies by running "$make depend".
22214 You might prefer to run it in background: "$make depend > makedepend.out &"
22215 It can take a while, so you might not want to run it right now.
22220 rp="Run $make depend now?"
22224 $make depend && echo "Now you must run '$make'."
22227 echo "You must run '$make depend' then '$make'."
22230 elif test -f [Mm]akefile; then
22232 echo "Now you must run a $make."
22234 echo "Configure done."
22237 if $test -f Policy.sh; then
22240 If you compile $package on a different machine or from a different object
22241 directory, copy the Policy.sh file from this object directory to the
22242 new one before you run Configure -- this will help you with most of
22243 the policy defaults.
22247 if $test -f config.msg; then
22248 echo "Hmm. I also noted the following information while running:"
22250 $cat config.msg >&4
22253 $rm -f kit*isdone ark*isdone