3 # If these # comments don't work, trim them. Don't worry about any other
4 # shell scripts, Configure will trim # comments from them for you.
6 # (If you are trying to port this package to a machine without sh,
7 # I would suggest you have a look at the prototypical config_h.SH file
8 # and edit it to reflect your system. Some packages may include samples
9 # of config.h for certain machines, so you might look for one of those.)
11 # Yes, you may rip this off to use in other distribution packages. This
12 # script belongs to the public domain and cannot be copyrighted.
14 # (Note: this Configure script was generated automatically. Rather than
15 # working with this copy of Configure, you may wish to get metaconfig.
16 # The dist-3.0 package (which contains metaconfig) was posted in
17 # comp.sources.misc and is available on CPAN under authors/id/RAM so
18 # you may fetch it yourself from your nearest archive site.)
21 # Though this script was generated by metaconfig, it is OK to send
22 # patches against it. It's up to the Configure pumpkin to backport
23 # the patch to the metaunits if it is accepted.
24 # See Porting/pumpkin.pod for more information on metaconfig.
27 # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
29 # Generated on Wed Mar 8 09:08:03 CET 2006 [metaconfig 3.0 PL70]
30 # (with additional metaconfig patches by perlbug@perl.org)
35 SCO csh still thinks true is false. Write to SCO today and tell them that next
36 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
38 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
39 we'd have to do is go in and swap the && and || tokens, wherever they are.)
41 [End of diatribe. We now return you to your regularly scheduled programming...]
45 OOPS! You naughty creature! You didn't run Configure with sh!
46 I will attempt to remedy the situation by running sh for you...
50 true || exec sh $0 $argv:q
52 (exit $?0) || cat c2$$
53 (exit $?0) || exec sh $0 $argv:q
56 if test -f /dev/cputype -a -f /dev/drivers -a -f /dev/osversion; then
59 *** I'm sorry but this system looks like Plan 9 and Plan 9 doesn't do
60 *** Configure that well. (Plan 9 is close to UNIX but not close enough.)
61 *** Please read the README.plan9 for further instructions.
62 *** Cannot continue, aborting.
68 : 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
348 d_attribute_format=''
349 d_attribute_malloc=''
350 d_attribute_nonnull=''
351 d_attribute_noreturn=''
353 d_attribute_unused=''
354 d_attribute_warn_unused_result=''
357 d_builtin_choose_expr=''
403 endhostent_r_proto=''
409 endprotoent_r_proto=''
415 endservent_r_proto=''
467 gethostbyaddr_r_proto=''
469 gethostbyname_r_proto=''
471 gethostent_r_proto=''
483 getnetbyaddr_r_proto=''
485 getnetbyname_r_proto=''
499 d_getprotobyname_r=''
500 getprotobyname_r_proto=''
501 d_getprotobynumber_r=''
502 getprotobynumber_r_proto=''
504 getprotoent_r_proto=''
516 getservbyname_r_proto=''
518 getservbyport_r_proto=''
520 getservent_r_proto=''
544 d_libm_lib_version=''
557 d_malloc_good_size=''
599 d_old_pthread_create_joinable=''
600 old_pthread_create_joinable=''
602 d_pthread_attr_setscope=''
641 sethostent_r_proto=''
658 setprotoent_r_proto=''
670 setservent_r_proto=''
703 d_sprintf_returns_strlen=''
718 d_stdio_ptr_lval_nochange_cnt=''
719 d_stdio_ptr_lval_sets_cnt=''
923 inc_version_list_init=''
924 d_inc_version_list=''
943 ignore_versioned_solibs=''
1007 d_perl_otherlibdirs=''
1015 api_versionstring=''
1021 version_patchlevel_string=''
1025 d_nv_preserves_uv=''
1026 d_nv_zero_is_allbits_zero=''
1037 nv_preserves_uv_bits=''
1109 installsitehtml1dir=''
1112 installsitehtml3dir=''
1119 installsiteman1dir=''
1122 installsiteman3dir=''
1127 installsitescript=''
1142 d_stdio_stream_array=''
1143 stdio_stream_array=''
1154 ccflags_uselargefiles=''
1155 ldflags_uselargefiles=''
1156 libswanted_uselargefiles=''
1166 initialinstalllocation=''
1167 userelocatableinc=''
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 : set up the script used to warn in case of inconsistency
3521 echo "*** WHOA THERE!!! ***" >&4
3522 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
3523 rp=" Keep the $hint value?"
3526 y) td=$was; tu=$was;;
3530 : function used to set $1 to $val
3531 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
3533 $define$undef) . ./whoa; eval "$var=\$td";;
3534 $undef$define) . ./whoa; eval "$var=\$tu";;
3535 *) eval "$var=$val";;
3539 $define|true|[yY]*) dflt='y';;
3544 Perl can be built to use the SOCKS proxy protocol library. To do so,
3545 Configure must be run with -Dusesocks. If you use SOCKS you also need
3546 to use the PerlIO abstraction layer, this will be implicitly selected.
3548 If this doesn't make any sense to you, just accept the default '$dflt'.
3550 rp='Build Perl for SOCKS?'
3553 y|Y) val="$define" ;;
3560 $define|true|[yY]*) useperlio="$define";;
3563 case "$useperlio" in
3564 $define|true|[yY]*|'') dflt='y';;
3569 Previous version of $package used the standard IO mechanisms as
3570 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
3571 alternate IO mechanisms via the PerlIO abstraction layer, but the
3572 stdio mechanism is still available if needed. The abstraction layer
3573 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
3574 Using PerlIO with sfio may cause problems with some extension modules.
3576 If this doesn't make any sense to you, just accept the default '$dflt'.
3578 rp='Use the PerlIO abstraction layer?'
3585 echo "Ok, doing things the stdio way."
3594 case "$useperlio" in
3595 $define|true|[yY]*) ;;
3598 You are using the SOCKS proxy protocol library which means that you
3599 should also use the PerlIO layer. You may be headed for trouble.
3608 case "$usethreads" in
3609 $define|true|[yY]*) dflt='y';;
3610 *) # Catch case where user specified ithreads or 5005threads but
3611 # forgot -Dusethreads (A.D. 4/2002)
3612 case "$useithreads$use5005threads" in
3614 case "$useperlio" in
3615 "$define") dflt='y' ;;
3625 Perl can be built to take advantage of threads on some systems.
3626 To do so, Configure can be run with -Dusethreads.
3628 Note that Perl built with threading support runs slightly slower
3629 and uses more memory than plain Perl. The current implementation
3630 is believed to be stable, but it is fairly new, and so should be
3631 treated with caution.
3633 If this doesn't make any sense to you, just accept the default '$dflt'.
3635 rp='Build a threading Perl?'
3638 y|Y) val="$define" ;;
3644 case "$usethreads" in
3648 Since release 5.6, Perl has had two different threading implementations,
3649 the newer interpreter-based version (ithreads) with one interpreter per
3650 thread, and the older 5.005 version (5005threads).
3651 The 5005threads version is effectively unmaintained and will probably be
3652 removed in Perl 5.10, so there should be no need to build a Perl using it
3653 unless needed for backwards compatibility with some existing 5.005threads
3657 : Default to ithreads unless overridden on command line or with
3660 case "$use5005threads" in
3661 $define|true|[yY]*) dflt='n';;
3663 case "$useithreads" in
3664 $undef|false|[nN]*) dflt='n';;
3666 rp='Use the newer interpreter-based ithreads?'
3669 y|Y) val="$define" ;;
3674 : Now set use5005threads to the opposite value.
3675 case "$useithreads" in
3676 $define) val="$undef" ;;
3683 useithreads="$undef"
3684 use5005threads="$undef"
3688 case "$useithreads$use5005threads" in
3692 You cannot have both the ithreads and the 5.005 threads enabled
3693 at the same time. Disabling the 5.005 threads since they are
3694 much less stable than the ithreads.
3697 use5005threads="$undef"
3701 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
3704 *** To build with ithreads you must also use the PerlIO layer.
3705 *** Cannot continue, aborting.
3711 case "$d_oldpthreads" in
3712 '') : Configure tests would be welcome here. For now, assume undef.
3714 *) val="$d_oldpthreads" ;;
3720 : Look for a hint-file generated 'call-back-unit'. If the
3721 : user has specified that a threading perl is to be built,
3722 : we may need to set or change some other defaults.
3723 if $test -f usethreads.cbu; then
3724 echo "Your platform has some specific hints regarding threaded builds, using them..."
3727 case "$usethreads" in
3728 "$define"|true|[yY]*)
3730 (Your platform does not have any specific hints for threaded builds.
3731 Assuming POSIX threads, then.)
3739 Perl can be built so that multiple Perl interpreters can coexist
3740 within the same Perl executable.
3743 case "$useithreads" in
3746 This multiple interpreter support is required for interpreter-based threads.
3750 *) case "$usemultiplicity" in
3751 $define|true|[yY]*) dflt='y';;
3755 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
3756 rp='Build Perl for multiplicity?'
3759 y|Y) val="$define" ;;
3768 case "$usemorebits" in
3769 "$define"|true|[yY]*)
3770 use64bitint="$define"
3771 uselongdouble="$define"
3772 usemorebits="$define"
3774 *) usemorebits="$undef"
3778 : make some quick guesses about what we are up against
3780 $echo $n "Hmm... $c"
3790 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
3791 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
3793 echo "Looks kind of like an OSF/1 system, but we'll see..."
3795 elif test `echo abc | $tr a-z A-Z` = Abc ; then
3796 xxx=`./loc addbib blurfl $pth`
3797 if $test -f $xxx; then
3798 echo "Looks kind of like a USG system with BSD features, but we'll see..."
3802 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
3803 echo "Looks kind of like an extended USG system, but we'll see..."
3805 echo "Looks kind of like a USG system, but we'll see..."
3809 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
3810 echo "Looks kind of like a BSD system, but we'll see..."
3814 echo "Looks kind of like a Version 7 system, but we'll see..."
3817 case "$eunicefix" in
3820 There is, however, a strange, musty smell in the air that reminds me of
3821 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
3825 : it so happens the Eunice I know will not run shell scripts in Unix format
3829 echo "Congratulations. You aren't running Eunice."
3833 : Detect OS2. The p_ variable is set above in the Head.U unit.
3834 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
3835 : semicolon as a patch separator
3840 I have the feeling something is not exactly right, however...don't tell me...
3841 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
3842 (Or you may be running DOS with DJGPP.)
3847 if test -f /xenix; then
3848 echo "Actually, this looks more like a XENIX system..."
3853 echo "It's not Xenix..."
3858 if test -f /venix; then
3859 echo "Actually, this looks more like a VENIX system..."
3866 echo "Nor is it Venix..."
3869 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3870 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3877 rp="Use which C compiler?"
3881 : See if they have not cc but they do have gcc
3883 : Look for a hint-file generated 'call-back-unit'. Now that the
3884 : user has specified the compiler, we may need to set or change some
3886 if $test -f cc.cbu; then
3892 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3898 printf("%s\n", __VERSION__);
3900 printf("%s\n", "1");
3906 if $cc -o try $ccflags $ldflags try.c; then
3907 gccversion=`$run ./try`
3908 case "$gccversion" in
3909 '') echo "You are not using GNU cc." ;;
3910 *) echo "You are using GNU cc $gccversion."
3916 echo "*** WHOA THERE!!! ***" >&4
3917 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3918 case "$knowitall" in
3920 echo " You'd better start hunting for one and let me know about it." >&4
3926 case "$gccversion" in
3927 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3929 case "$gccversion" in
3930 '') gccosandvers='' ;;
3931 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
3932 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
3934 case "$gccosandvers" in
3935 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
3936 $osname$osvers) ;; # looking good
3937 $osname*) cat <<EOM >&4
3939 *** WHOA THERE!!! ***
3941 Your gcc has not been compiled for the exact release of
3942 your operating system ($gccosandvers versus $osname$osvers).
3944 In general it is a good idea to keep gcc synchronized with
3945 the operating system because otherwise serious problems
3946 may ensue when trying to compile software, like Perl.
3948 I'm trying to be optimistic here, though, and will continue.
3949 If later during the configuration and build icky compilation
3950 problems appear (headerfile conflicts being the most common
3951 manifestation), I suggest reinstalling the gcc to match
3952 your operating system release.
3956 *) gccosandvers='' ;; # failed to parse, better be silent
3964 # gcc 3.* complain about adding -Idirectories that they already know about,
3965 # so we will take those off from locincpth.
3966 case "$gccversion" in
3968 echo "main(){}">try.c
3969 for incdir in $locincpth; do
3970 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
3971 grep '^c[cp]p*[01]: warning: changing search order '`
3972 if test "X$warn" != X; then
3973 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
3979 : decide how portable to be. Allow command line overrides.
3980 case "$d_portable" in
3982 *) d_portable="$define" ;;
3985 : set up shell script to do ~ expansion
3991 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3994 if $test -f /bin/csh; then
3995 /bin/csh -f -c "glob \$1"
4000 name=\`$expr x\$1 : '..\([^/]*\)'\`
4001 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
4002 if $test ! -d "\$dir"; then
4004 echo "\$me: can't locate home directory for: \$name" >&2
4009 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
4025 : now set up to get a file name
4029 cat <<'EOSC' >>getfile
4045 : getfile will accept an answer from the comma-separated list
4046 : enclosed in parentheses even if it does not meet other criteria.
4047 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
4048 fn=`echo $fn | sed 's/(.*)//'`
4054 loc_file=`expr $fn : '.*:\(.*\)'`
4055 fn=`expr $fn : '\(.*\):.*'`
4063 */*) fullpath=true;;
4072 *e*) exp_file=true;;
4075 *p*) nopath_ok=true;;
4080 *d*) type='Directory';;
4081 *l*) type='Locate';;
4086 Locate) what='File';;
4091 case "$d_portable" in
4099 while test "$type"; do
4104 true) rp="$rp (~name ok)";;
4107 if test -f UU/getfile.ok && \
4108 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
4127 value=`UU/filexp $ans`
4130 if test "$ans" != "$value"; then
4131 echo "(That expands to $value on this system.)"
4145 /*) value="$ansexp" ;;
4146 [a-zA-Z]:/*) value="$ansexp" ;;
4151 echo "I shall only accept a full path name, as in /bin/ls." >&4
4152 echo "Use a ! shell escape if you wish to check pathnames." >&4
4155 echo "Please give a full path name, starting with slash." >&4
4158 echo "Note that using ~name is ok provided it expands well." >&4
4171 for fp in $gfpth; do
4172 if test "X$fp" = X.; then
4177 if test -f "$pf"; then
4179 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
4181 echo "($value is not a plain file, but that's ok.)"
4184 if test X"$type" = X; then
4191 for fp in $gfpth; do
4192 if test "X$fp" = X.; then
4197 direxp="$fp/$ansexp"
4199 if test -d "$direxp"; then
4207 if test -d "$ansexp"; then
4208 echo "(Looking for $loc_file in directory $value.)"
4209 value="$value/$loc_file"
4210 ansexp="$ansexp/$loc_file"
4212 if test -f "$ansexp"; then
4215 case "$nopath_ok" in
4216 true) case "$value" in
4218 *) echo "Assuming $value will be in people's path."
4234 if test "$fastread" = yes; then
4239 rp="$what $value doesn't exist. Use that name anyway?"
4258 test "X$gfpthkeep" != Xy && gfpth=""
4261 : What should the include directory be ?
4263 $echo $n "Hmm... $c"
4267 if $test -f /bin/mips && /bin/mips; then
4268 echo "Looks like a MIPS system..."
4269 $cat >usr.c <<'EOCP'
4270 #ifdef SYSTYPE_BSD43
4274 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4275 dflt='/bsd43/usr/include'
4279 mips_type='System V'
4281 $rm -f usr.c usr.out
4282 echo "and you're compiling with the $mips_type compiler and libraries."
4286 echo "Doesn't look like a MIPS system."
4296 case "$xxx_prompt" in
4299 rp='Where are the include files you want to use?'
4307 : see how we invoke the C preprocessor
4309 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4310 cat <<'EOT' >testcpp.c
4316 if test ! -f cppstdin; then
4317 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4318 # AIX cc -E doesn't show the absolute headerfile
4319 # locations but we'll cheat by using the -M flag.
4320 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
4322 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4325 echo "Keeping your $hint cppstdin wrapper."
4328 wrapper=`pwd`/cppstdin
4332 if $test "X$cppstdin" != "X" && \
4333 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4334 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4336 echo "You used to use $cppstdin $cppminus so we'll use that again."
4338 '') echo "But let's see if we can live without a wrapper..." ;;
4340 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4341 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4343 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4346 echo "(However, $cpprun $cpplast does not work, let's see...)"
4354 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4361 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4362 $cc -E <testcpp.c >testcpp.out 2>&1; \
4363 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4364 echo "Yup, it does."
4367 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4368 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4369 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4370 echo "Yup, it does."
4373 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4374 $cc -P <testcpp.c >testcpp.out 2>&1; \
4375 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4376 echo "Yipee, that works!"
4379 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4380 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4381 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4382 echo "At long last!"
4385 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4386 $cpp <testcpp.c >testcpp.out 2>&1; \
4387 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4391 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4392 $cpp - <testcpp.c >testcpp.out 2>&1; \
4393 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4394 echo "Hooray, it works! I was beginning to wonder."
4397 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4398 $wrapper <testcpp.c >testcpp.out 2>&1; \
4399 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4405 rp="No dice. I can't find a C preprocessor. Name one:"
4409 $x_cpp <testcpp.c >testcpp.out 2>&1
4410 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4411 echo "OK, that will do." >&4
4413 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4428 echo "Perhaps can we force $cc -E using a wrapper..."
4429 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4430 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4436 echo "Nope, we'll have to live without it..."
4450 "$wrapper"|'cppstdin') ;;
4451 *) $rm -f $wrapper;;
4453 $rm -f testcpp.c testcpp.out
4455 : Set private lib path
4458 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4463 '') dlist="$loclibpth $plibpth $glibpth";;
4464 *) dlist="$libpth";;
4467 : Now check and see which directories actually exist, avoiding duplicates
4471 if $test -d $xxx; then
4474 *) libpth="$libpth $xxx";;
4480 Some systems have incompatible or broken versions of libraries. Among
4481 the directories listed in the question below, please remove any you
4482 know not to be holding relevant libraries, and add any that are needed.
4483 Say "none" for none.
4494 rp="Directories to use for library searches?"
4501 : compute shared library extension
4504 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4514 On some systems, shared libraries may be available. Answer 'none' if
4515 you want to suppress searching of shared libraries for the remainder
4516 of this configuration.
4519 rp='What is the file extension used for shared libraries?'
4523 : Define several unixisms.
4524 : Hints files or command line option can be used to override them.
4525 : The convoluted testing is in case hints files set either the old
4528 '') case "$exe_ext" in
4530 *) _exe="$exe_ext" ;;
4535 '') case "$lib_ext" in
4542 '') case "$obj_ext" in
4549 '') case "$path_sep" in
4560 : Which makefile gets called first. This is used by make depend.
4561 case "$firstmakefile" in
4562 '') firstmakefile='makefile';;
4566 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4569 case "$uselongdouble" in
4570 $define|true|[yY]*) dflt='y';;
4575 Perl can be built to take advantage of long doubles which
4576 (if available) may give more accuracy and range for floating point numbers.
4578 If this doesn't make any sense to you, just accept the default '$dflt'.
4580 rp='Try to use long doubles if available?'
4583 y|Y) val="$define" ;;
4589 case "$uselongdouble" in
4590 true|[yY]*) uselongdouble="$define" ;;
4593 : Look for a hint-file generated 'call-back-unit'. If the
4594 : user has specified that long doubles should be used,
4595 : we may need to set or change some other defaults.
4596 if $test -f uselongdouble.cbu; then
4597 echo "Your platform has some specific hints regarding long doubles, using them..."
4598 . ./uselongdouble.cbu
4600 case "$uselongdouble" in
4603 (Your platform does not have any specific hints for long doubles.)
4609 : Looking for optional libraries
4611 echo "Checking for optional libraries..." >&4
4616 case "$libswanted" in
4617 '') libswanted='c_s';;
4620 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4626 for thisdir in $libpth $xlibpth; do
4627 test -d $thisdir && libspath="$libspath $thisdir"
4629 for thislib in $libswanted; do
4630 for thisdir in $libspath; do
4632 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4633 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4634 $test -f "$xxx" && eval $libscheck
4635 $test -f "$xxx" && libstyle=shared
4637 if test ! -f "$xxx"; then
4638 xxx=$thisdir/lib$thislib.$so
4639 $test -f "$xxx" && eval $libscheck
4640 $test -f "$xxx" && libstyle=shared
4642 if test ! -f "$xxx"; then
4643 xxx=$thisdir/lib$thislib$_a
4644 $test -f "$xxx" && eval $libscheck
4645 $test -f "$xxx" && libstyle=static
4647 if test ! -f "$xxx"; then
4648 xxx=$thisdir/$thislib$_a
4649 $test -f "$xxx" && eval $libscheck
4650 $test -f "$xxx" && libstyle=static
4652 if test ! -f "$xxx"; then
4653 xxx=$thisdir/lib${thislib}_s$_a
4654 $test -f "$xxx" && eval $libscheck
4655 $test -f "$xxx" && libstyle=static
4656 $test -f "$xxx" && thislib=${thislib}_s
4658 if test ! -f "$xxx"; then
4659 xxx=$thisdir/Slib$thislib$_a
4660 $test -f "$xxx" && eval $libscheck
4661 $test -f "$xxx" && libstyle=static
4663 if $test -f "$xxx"; then
4665 shared) echo "Found -l$thislib (shared)." ;;
4666 static) echo "Found -l$thislib." ;;
4667 *) echo "Found -l$thislib ($libstyle)." ;;
4671 *) dflt="$dflt -l$thislib"
4672 libsfound="$libsfound $xxx"
4674 libsfiles="$libsfiles $yyy"
4675 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4676 case " $libsdirs " in
4678 *) libsdirs="$libsdirs $yyy" ;;
4685 if $test ! -f "$xxx"; then
4686 echo "No -l$thislib."
4697 ' '|'') dflt='none';;
4702 In order to compile $package on your machine, a number of libraries
4703 are usually needed. Include any other special libraries here as well.
4704 Say "none" for none. The default list is almost always right.
4708 rp="What libraries to use?"
4715 : determine optimization, if desired, or use for debug flag also
4717 ' '|$undef) dflt='none';;
4719 *) dflt="$optimize";;
4723 By default, $package compiles with the -O flag to use the optimizer.
4724 Alternately, you might want to use the symbolic debugger, which uses
4725 the -g flag (on traditional Unix systems). Either flag can be
4726 specified here. To use neither flag, specify the word "none".
4729 rp="What optimizer/debugger flag should be used?"
4733 'none') optimize=" ";;
4737 : We will not override a previous value, but we might want to
4738 : augment a hint file
4740 default|recommended)
4741 case "$gccversion" in
4742 1*) dflt='-fpcc-struct-return' ;;
4745 *-g*) dflt="$dflt -DDEBUGGING";;
4747 case "$gccversion" in
4748 2*) if test -d /etc/conf/kconfig.d &&
4749 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4751 # Interactive Systems (ISC) POSIX mode.
4756 case "$gccversion" in
4760 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
4761 echo 'int main(void) { return 0; }' > gcctest.c
4762 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
4763 echo "Yes, it does." 2>&1
4766 echo "Leaving current flags $ccflags alone." 2>&1
4768 *) dflt="$dflt -fno-strict-aliasing" ;;
4771 echo "Nope, it doesn't, but that's ok." 2>&1
4775 # For gcc, adding -pipe speeds up compilations for some, but apparently
4776 # some assemblers can't read from stdin. (It also slows down compilations
4777 # in other cases, but those are apparently rarer these days.) AD 5/2004.
4778 case "$gccversion" in
4780 echo "Checking if your compiler accepts -pipe" 2>&1
4781 echo 'int main(void) { return 0; }' > gcctest.c
4782 if $cc -pipe -o gcctest gcctest.c; then
4783 echo "Yes, it does." 2>&1
4786 echo "Leaving current flags $ccflags alone." 2>&1
4788 *) dflt="$dflt -pipe" ;;
4791 echo "Nope, it doesn't, but that's ok." 2>&1
4794 echo "Checking if your compiler accepts -Wdeclaration-after-statement" 2>&1
4795 echo 'int main(void) { return 0; }' > gcctest.c
4796 if $cc -Wdeclaration-after-statement -o gcctest gcctest.c; then
4797 echo "Yes, it does." 2>&1
4799 *-Wdeclaration-after-statement*)
4800 echo "Leaving current flags $ccflags alone." 2>&1
4802 *) dflt="$dflt -Wdeclaration-after-statement" ;;
4805 echo "Nope, it doesn't, but that's ok." 2>&1
4812 case "$mips_type" in
4813 *BSD*|'') inclwanted="$locincpth $usrinc";;
4814 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4816 for thisincl in $inclwanted; do
4817 if $test -d $thisincl; then
4818 if $test x$thisincl != x$usrinc; then
4820 *" -I$thisincl "*);;
4821 *) dflt="$dflt -I$thisincl ";;
4827 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4829 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4837 *) dflt="$dflt -D$2";;
4841 set signal.h LANGUAGE_C; eval $inctest
4845 ccflags="$ccflags -DSOCKS"
4850 default|recommended) dflt="$ccflags $dflt" ;;
4851 *) dflt="$ccflags";;
4860 Your C compiler may want other flags. For this question you should include
4861 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4862 but you should NOT include libraries or ld flags like -lwhatever. If you
4863 want $package to honor its debug switch, you should include -DDEBUGGING here.
4864 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4866 To use no flags, specify the word "none".
4872 rp="Any additional cc flags?"
4879 : the following weeds options from ccflags that are of no interest to cpp
4881 '') cppflags="$ccflags" ;;
4882 *) cppflags="$cppflags $ccflags" ;;
4884 case "$gccversion" in
4885 1*) cppflags="$cppflags -D__GNUC__"
4887 case "$mips_type" in
4889 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4895 echo "Let me guess what the preprocessor flags are..." >&4
4909 *) ftry="$previous $flag";;
4911 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4912 >cpp1.out 2>/dev/null && \
4913 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4914 >cpp2.out 2>/dev/null && \
4915 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4916 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4918 cppflags="$cppflags $ftry"
4928 *-*) echo "They appear to be: $cppflags";;
4930 $rm -f cpp.c cpp?.out
4934 : flags used in final linking phase
4936 '') if ./venix; then
4942 *-posix*) dflt="$dflt -posix" ;;
4945 *) dflt="$ldflags";;
4948 : Try to guess additional flags to pick up local libraries.
4949 for thislibdir in $libpth; do
4950 case " $loclibpth " in
4953 *"-L$thislibdir "*) ;;
4954 *) dflt="$dflt -L$thislibdir" ;;
4966 Your C linker may need flags. For this question you should
4967 include -L/whatever and any other flags used by the C linker, but you
4968 should NOT include libraries like -lwhatever.
4970 Make sure you include the appropriate -L/path flags if your C linker
4971 does not normally search all of the directories you specified above,
4974 To use no flags, specify the word "none".
4978 rp="Any additional ld flags (NOT including libraries)?"
4984 rmlist="$rmlist pdp11"
4988 echo "Checking your choice of C compiler and flags for coherency..." >&4
4989 $cat > try.c <<'EOF'
4991 int main() { printf("Ok\n"); return(0); }
4993 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
4995 $cat >try.msg <<'EOM'
4996 I've tried to compile and run the following simple program:
4999 $cat try.c >> try.msg
5001 $cat >> try.msg <<EOM
5008 and I got the following output:
5012 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5013 if $sh -c "$run ./try" >>try.msg 2>&1; then
5017 *) echo 'The program compiled OK, but produced no output.' >> try.msg
5020 cat >> try.msg <<'EOQS'
5021 If $libs contains -lsfio, and sfio is mis-configured, then it
5022 sometimes (apparently) runs and exits with a 0 status, but with no
5023 output! It may have to do with sfio's use of _exit vs. exit.
5026 rp="You have a big problem. Shall I abort Configure"
5033 echo "The program compiled OK, but exited with status $?." >>try.msg
5034 rp="You have a problem. Shall I abort Configure"
5038 echo "I can't compile the test program." >>try.msg
5039 rp="You have a BIG problem. Shall I abort Configure"
5045 case "$knowitall" in
5047 echo "(The supplied flags or libraries might be incorrect.)"
5055 *) echo "Ok. Stopping Configure." >&4
5060 n) echo "OK, that should do.";;
5062 $rm -f try try.* core
5064 : define a shorthand compile call
5068 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5069 : define a shorthand compile call for compilations that should be ok.
5073 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5075 : determine filename position in cpp output
5077 echo "Computing filename position in cpp output for #include directives..." >&4
5079 vos) testaccess=-e ;;
5082 echo '#include <stdio.h>' > foo.c
5085 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5086 $grep '^[ ]*#.*stdio\.h' | \
5087 while read cline; do
5090 while $test \$# -gt 0; do
5091 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5096 pos=\`expr \$pos + 1\`
5108 *) pos="${fieldn}th";;
5110 echo "Your cpp writes the filename in the $pos field of the line."
5113 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5114 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5117 : locate header file
5122 for usrincdir in $usrinc
5124 if test -f \$usrincdir/\$wanted; then
5125 echo "\$usrincdir/\$wanted"
5129 awkprg='{ print \$$fieldn }'
5130 echo "#include <\$wanted>" > foo\$\$.c
5131 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5132 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5133 while read cline; do
5134 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5136 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5137 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5142 # status = 0: grep returned 0 lines, case statement not executed
5143 # status = 1: headerfile found
5144 # status = 2: while loop executed, no headerfile found
5148 if test \$status -eq 1; then
5155 : define an alternate in-header-list? function
5156 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5157 cont=true; xxf="echo \"<\$1> found.\" >&4";
5158 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5159 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5161 case $# in 4) instead=instead;; *) instead="at last";; esac;
5162 while $test "$cont"; do
5164 var=$2; eval "was=\$$2";
5165 if $test "$xxx" && $test -r "$xxx";
5167 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5170 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5171 set $yyy; shift; shift; yyy=$@;
5172 case $# in 0) cont="";;
5173 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5174 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5175 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5176 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5180 do set $yyy; var=$2; eval "was=\$$2";
5181 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5182 set $yyy; shift; shift; yyy=$@;
5185 : see if stdlib is available
5186 set stdlib.h i_stdlib
5189 : check for lengths of integral types
5193 echo "Checking to see how big your integers are..." >&4
5202 printf("intsize=%d;\n", (int)sizeof(int));
5203 printf("longsize=%d;\n", (int)sizeof(long));
5204 printf("shortsize=%d;\n", (int)sizeof(short));
5209 if eval $compile_ok && $run ./try > /dev/null; then
5211 echo "Your integers are $intsize bytes long."
5212 echo "Your long integers are $longsize bytes long."
5213 echo "Your short integers are $shortsize bytes long."
5217 Help! I can't compile and run the intsize test program: please enlighten me!
5218 (This is probably a misconfiguration in your system or libraries, and
5219 you really ought to fix it. Still, I'll try anyway.)
5223 rp="What is the size of an integer (in bytes)?"
5227 rp="What is the size of a long integer (in bytes)?"
5231 rp="What is the size of a short integer (in bytes)?"
5239 : check for long long
5241 echo "Checking to see if you have long long..." >&4
5242 echo 'int main() { long long x = 7; return 0; }' > try.c
5244 if eval $compile; then
5246 echo "You have long long."
5249 echo "You do not have long long."
5255 : check for length of long long
5256 case "${d_longlong}${longlongsize}" in
5259 echo "Checking to see how big your long longs are..." >&4
5260 $cat >try.c <<'EOCP'
5264 printf("%d\n", (int)sizeof(long long));
5269 if eval $compile_ok; then
5270 longlongsize=`$run ./try`
5271 echo "Your long longs are $longlongsize bytes long."
5275 echo "(I can't seem to compile the test program. Guessing...)"
5276 rp="What is the size of a long long (in bytes)?"
5280 if $test "X$longsize" = "X$longlongsize"; then
5281 echo "(That isn't any different from an ordinary long.)"
5287 : see if inttypes.h is available
5288 : we want a real compile instead of Inhdr because some systems
5289 : have an inttypes.h which includes non-existent headers
5292 #include <inttypes.h>
5294 static int32_t foo32 = 0x12345678;
5298 if eval $compile; then
5299 echo "<inttypes.h> found." >&4
5302 echo "<inttypes.h> NOT found." >&4
5311 echo "Checking to see if you have int64_t..." >&4
5313 #include <sys/types.h>
5314 #$i_inttypes I_INTTYPES
5316 #include <inttypes.h>
5318 int main() { int64_t x = 7; }
5321 if eval $compile; then
5323 echo "You have int64_t."
5326 echo "You do not have int64_t."
5334 echo "Checking which 64-bit integer type we could use..." >&4
5340 val='"unsigned int"'
5345 *) case "$longsize" in
5349 val='"unsigned long"'
5354 *) case "$d_longlong:$longlongsize" in
5359 val='"unsigned long long"'
5364 *) case "$d_int64_t" in
5383 '') echo "Alas, no 64-bit integer types in sight." >&4
5386 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5392 case "$uselonglong" in
5393 "$define"|true|[yY]*)
5396 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5398 use64bitint="$define"
5401 case "$use64bits" in
5402 "$define"|true|[yY]*)
5405 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5407 use64bitint="$define"
5410 case "$use64bitints" in
5411 "$define"|true|[yY]*)
5414 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5416 use64bitint="$define"
5419 case "$use64bitsint" in
5420 "$define"|true|[yY]*)
5423 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5425 use64bitint="$define"
5428 case "$uselonglongs" in
5429 "$define"|true|[yY]*)
5432 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5434 use64bitint="$define"
5437 case "$use64bitsall" in
5438 "$define"|true|[yY]*)
5441 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5443 use64bitall="$define"
5448 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5450 case "$use64bitall" in
5451 "$define"|true|[yY]*) use64bitint="$define" ;;
5457 You have natively 64-bit long integers.
5461 *) case "$use64bitint" in
5462 "$define"|true|[yY]*) dflt='y';;
5471 Perl can be built to take advantage of 64-bit integer types
5472 on some systems. To do so, Configure can be run with -Duse64bitint.
5473 Choosing this option will most probably introduce binary incompatibilities.
5475 If this doesn't make any sense to you, just accept the default '$dflt'.
5476 (The default has been chosen based on your configuration.)
5478 rp='Try to use 64-bit integers, if available?'
5481 [yY]*) val="$define" ;;
5489 case "$use64bitall" in
5490 "$define"|true|[yY]*) dflt='y' ;;
5491 *) case "$longsize" in
5499 You may also choose to try maximal 64-bitness. It means using as much
5500 64-bitness as possible on the platform. This in turn means even more
5501 binary incompatibilities. On the other hand, your platform may not
5502 have any more 64-bitness available than what you already have chosen.
5504 If this doesn't make any sense to you, just accept the default '$dflt'.
5505 (The default has been chosen based on your configuration.)
5507 rp='Try to use maximal 64-bit support, if available?'
5510 [yY]*) val="$define" ;;
5515 case "$use64bitall" in
5517 case "$use64bitint" in
5521 Since you have chosen a maximally 64-bit build, I'm also turning on
5522 the use of 64-bit integers.
5524 use64bitint="$define" ;;
5529 : Look for a hint-file generated 'call-back-unit'. If the
5530 : user has specified that a 64-bit perl is to be built,
5531 : we may need to set or change some other defaults.
5532 if $test -f use64bitint.cbu; then
5533 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5536 case "$use64bitint" in
5537 "$define"|true|[yY]*)
5539 4) case "$archname64" in
5540 '') archname64=64int ;;
5547 : Look for a hint-file generated 'call-back-unit'. If the
5548 : user has specified that a maximally 64-bit perl is to be built,
5549 : we may need to set or change some other defaults.
5550 if $test -f use64bitall.cbu; then
5551 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5554 case "$use64bitall" in
5555 "$define"|true|[yY]*)
5557 4) case "$archname64" in
5558 ''|64int) archname64=64all ;;
5565 case "$d_quad:$use64bitint" in
5569 *** You have chosen to use 64-bit integers,
5570 *** but none can be found.
5571 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5572 *** Cannot continue, aborting.
5579 : check for length of double
5581 case "$doublesize" in
5583 echo "Checking to see how big your double precision numbers are..." >&4
5592 printf("%d\n", (int)sizeof(double));
5597 if eval $compile_ok; then
5598 doublesize=`$run ./try`
5599 echo "Your double is $doublesize bytes long."
5602 echo "(I can't seem to compile the test program. Guessing...)"
5603 rp="What is the size of a double precision number (in bytes)?"
5611 : check for long doubles
5613 echo "Checking to see if you have long double..." >&4
5614 echo 'int main() { long double x = 7.0; }' > try.c
5616 if eval $compile; then
5618 echo "You have long double."
5621 echo "You do not have long double."
5627 : check for length of long double
5628 case "${d_longdbl}${longdblsize}" in
5631 echo "Checking to see how big your long doubles are..." >&4
5632 $cat >try.c <<'EOCP'
5636 printf("%d\n", sizeof(long double));
5641 if eval $compile; then
5642 longdblsize=`$run ./try`
5643 echo "Your long doubles are $longdblsize bytes long."
5647 echo "(I can't seem to compile the test program. Guessing...)" >&4
5648 rp="What is the size of a long double (in bytes)?"
5652 if $test "X$doublesize" = "X$longdblsize"; then
5653 echo "That isn't any different from an ordinary double."
5654 echo "I'll keep your setting anyway, but you may see some"
5655 echo "harmless compilation warnings."
5661 : determine the architecture name
5663 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5664 tarch=`arch`"-$osname"
5665 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5666 if uname -m > tmparch 2>&1 ; then
5667 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5668 -e 's/$/'"-$osname/" tmparch`
5676 case "$myarchname" in
5679 echo "(Your architecture name used to be $myarchname.)"
5683 case "$targetarch" in
5685 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
5690 *) dflt="$archname";;
5692 rp='What is your architecture name'
5695 case "$usethreads" in
5697 echo "Threads selected." >&4
5699 *-thread*) echo "...and architecture name already has -thread." >&4
5701 *) archname="$archname-thread"
5702 echo "...setting architecture name to $archname." >&4
5707 case "$usemultiplicity" in
5709 echo "Multiplicity selected." >&4
5711 *-multi*) echo "...and architecture name already has -multi." >&4
5713 *) archname="$archname-multi"
5714 echo "...setting architecture name to $archname." >&4
5719 case "$use64bitint$use64bitall" in
5721 case "$archname64" in
5723 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
5726 case "$use64bitint" in
5727 "$define") echo "64 bit integers selected." >&4 ;;
5729 case "$use64bitall" in
5730 "$define") echo "Maximal 64 bitness selected." >&4 ;;
5733 *-$archname64*) echo "...and architecture name already has $archname64." >&4
5735 *) archname="$archname-$archname64"
5736 echo "...setting architecture name to $archname." >&4
5742 case "$uselongdouble" in
5744 echo "Long doubles selected." >&4
5745 case "$longdblsize" in
5747 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
5751 *-ld*) echo "...and architecture name already has -ld." >&4
5753 *) archname="$archname-ld"
5754 echo "...setting architecture name to $archname." >&4
5761 case "$useperlio" in
5763 echo "Perlio selected." >&4
5766 echo "Perlio not selected, using stdio." >&4
5768 *-stdio*) echo "...and architecture name already has -stdio." >&4
5770 *) archname="$archname-stdio"
5771 echo "...setting architecture name to $archname." >&4
5776 if $test -f archname.cbu; then
5777 echo "Your platform has some specific hints for architecture name, using them..."
5781 : determine root of directory hierarchy where package will be installed.
5784 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
5787 dflt=`echo "$prefix" | sed 's/.$//'`
5795 By default, $package will be installed in $dflt/bin, manual pages
5796 under $dflt/man, etc..., i.e. with $dflt as prefix for all
5797 installation directories. Typically this is something like /usr/local.
5798 If you wish to have binaries under /usr/bin but other parts of the
5799 installation under /usr/local, that's ok: you will be prompted
5800 separately for each of the installation directories, the prefix being
5801 only used to set the defaults.
5805 rp='Installation prefix to use?'
5813 *) oldprefix="$prefix";;
5822 *) afsroot=$afsroot ;;
5828 $define|true) afs=true ;;
5829 $undef|false) afs=false ;;
5830 *) if test -d $afsroot; then
5838 echo "AFS may be running... I'll be extra cautious then..." >&4
5840 echo "AFS does not seem to be running..." >&4
5843 : determine installation prefix for where package is to be installed.
5847 Since you are running AFS, I need to distinguish the directory in which
5848 files will reside from the directory in which they are installed (and from
5849 which they are presumably copied to the former directory by occult means).
5852 case "$installprefix" in
5853 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
5854 *) dflt="$installprefix";;
5859 In some special cases, particularly when building $package for distribution,
5860 it is convenient to distinguish the directory in which files should be
5861 installed from the directory ($prefix) in which they will
5862 eventually reside. For most users, these two directories are the same.
5865 case "$installprefix" in
5867 *) dflt=$installprefix;;
5871 rp='What installation prefix should I use for installing files?'
5873 installprefix="$ans"
5874 installprefixexp="$ansexp"
5876 : set the prefixit variable, to compute a suitable default value
5877 prefixit='case "$3" in
5879 case "$oldprefix" in
5880 "") eval "$1=\"\$$2\"";;
5887 ""|" ") eval "$1=\"\$$2\"";;
5893 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
5895 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
5896 /*-$oldprefix/*|\~*-$oldprefix/*)
5897 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
5898 *) eval "$1=\"\$$2\"";;
5902 : get the patchlevel
5904 echo "Getting the current patchlevel..." >&4
5905 if $test -r $rsrc/patchlevel.h;then
5906 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
5907 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
5908 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5909 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
5910 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
5911 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5912 perl_patchlevel=`egrep 'define PERL_PATCHNUM [0-9][0-9]|,"MAINT[0-9][0-9]*"' $rsrc/patchlevel.h|sed 's/[^0-9]//g'`
5921 $echo "(You do not have patchlevel.h. Eek.)"
5923 if $test -r $rsrc/.patch ; then
5924 if $test "X$perl_patchlevel" = "X" || $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
5925 perl_patchlevel=`cat $rsrc/.patch`
5928 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
5929 version_patchlevel_string="version $patchlevel subversion $subversion"
5930 case "$perl_patchlevel" in
5932 *) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;;
5935 $echo "(You have $package $version_patchlevel_string.)"
5939 : XXX Should be a Configure test for double-dots in filenames.
5940 version=`echo $revision $patchlevel $subversion | \
5941 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
5942 api_versionstring=`echo $api_revision $api_version $api_subversion | \
5943 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
5946 version=`echo $revision $patchlevel $subversion | \
5947 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
5948 api_versionstring=`echo $api_revision $api_version $api_subversion | \
5949 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
5952 : Special case the 5.005_xx maintenance series, which used 5.005
5953 : without any subversion label as a subdirectory in $sitelib
5954 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
5955 api_versionstring='5.005'
5958 : determine installation style
5959 : For now, try to deduce it from prefix unless it is already set.
5960 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
5961 case "$installstyle" in
5962 '') case "$prefix" in
5963 *perl*) dflt='lib';;
5964 *) dflt='lib/perl5' ;;
5967 *) dflt="$installstyle" ;;
5969 : Probably not worth prompting for this since we prompt for all
5970 : the directories individually, and the prompt would be too long and
5975 : Perform the prefixexp/installprefixexp correction if necessary
5976 cat <<EOS >installprefix
5979 cat <<'EOSC' >>installprefix
5980 : Change installation prefix, if necessary.
5981 if $test X"$prefix" != X"$installprefix"; then
5982 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
5984 eval "install${prefixvar}=\"\$${prefixvar}exp\""
5988 : Set variables such as privlib and privlibexp from the output of ./getfile
5989 : performing the prefixexp/installprefixexp correction if necessary.
5990 cat <<EOS >setprefixvar
5993 cat <<'EOSC' >>setprefixvar
5994 eval "${prefixvar}=\"\$ans\""
5995 eval "${prefixvar}exp=\"\$ansexp\""
5999 : determine where public executables go
6004 rp='Pathname where the public executables will reside?'
6006 if $test "X$ansexp" != "X$binexp"; then
6010 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6013 case "$userelocatableinc" in
6014 $define|true|[yY]*) dflt='y';;
6019 Would you like to build Perl so that the installation is relocatable, so that
6020 library paths in @INC are determined relative to the path of the perl binary?
6021 This is not advised for system Perl installs, or if you need to run setid
6022 scripts or scripts under taint mode.
6024 If this doesn't make any sense to you, just accept the default '$dflt'.
6026 rp='Use relocatable @INC?'
6029 y|Y) val="$define" ;;
6032 set userelocatableinc
6035 : Default prefix is now "up one level from where the binaries are"
6036 case "$userelocatableinc" in
6037 $define|true|[yY]*) initialinstalllocation="$binexp"
6042 installprefixexp=".../..";;
6046 : determine where private library files go
6047 : Usual default is /usr/local/lib/perl5/$version.
6048 : Also allow things like /opt/perl/lib/$version, since
6049 : /opt/perl/lib/perl5... would be redundant.
6050 : The default "style" setting is made in installstyle.U
6051 case "$installstyle" in
6052 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6053 *) set dflt privlib lib/$version ;;
6058 There are some auxiliary files for $package that need to be put into a
6059 private library directory that is accessible by everyone.
6063 rp='Pathname where the private library files will reside?'
6068 : set the prefixup variable, to restore leading tilda escape
6069 prefixup='case "$prefixexp" in
6071 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6074 : determine where public architecture dependent libraries go
6077 : privlib default is /usr/local/lib/$package/$version
6078 : archlib default is /usr/local/lib/$package/$version/$archname
6079 : privlib may have an optional trailing /share.
6080 tdflt=`echo $privlib | $sed 's,/share$,,'`
6081 tdflt=$tdflt/$archname
6090 $spackage contains architecture-dependent library files. If you are
6091 sharing libraries in a heterogeneous environment, you might store
6092 these files in a separate location. Otherwise, you can just include
6093 them with the rest of the public library files.
6097 rp='Where do you want to put the public architecture-dependent libraries?'
6101 if $test X"$archlib" = X"$privlib"; then
6107 : see if setuid scripts can be secure
6110 Some kernels have a bug that prevents setuid #! scripts from being
6111 secure. Some sites have disabled setuid #! scripts because of this.
6113 First let's decide if your kernel supports secure setuid #! scripts.
6114 (If setuid #! scripts would be secure but have been disabled anyway,
6115 don't say that they are secure if asked.)
6120 if $test -d /dev/fd; then
6121 echo "#!$ls" >reflect
6122 chmod +x,u+s reflect
6123 ./reflect >flect 2>&1
6124 if $contains "/dev/fd" flect >/dev/null; then
6125 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6129 If you are not sure if they are secure, I can check but I'll need a
6130 username and password different from the one you are using right now.
6131 If you don't have such a username or don't want me to test, simply
6135 rp='Other username to test security of setuid scripts with?'
6140 case "$d_suidsafe" in
6141 '') echo "I'll assume setuid scripts are *not* secure." >&4
6144 echo "Well, the $hint value is *not* secure." >&4
6146 *) echo "Well, the $hint value *is* secure." >&4
6151 $rm -f reflect flect
6152 echo "#!$ls" >reflect
6153 chmod +x,u+s reflect
6156 echo '"su" will (probably) prompt you for '"$ans's password."
6157 su $ans -c './reflect >flect'
6158 if $contains "/dev/fd" flect >/dev/null; then
6159 echo "Okay, it looks like setuid scripts are secure." >&4
6162 echo "I don't think setuid scripts are secure." >&4
6167 rp='Does your kernel have *secure* setuid scripts?'
6170 [yY]*) val="$define";;
6175 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6176 echo "(That's for file descriptors, not floppy disks.)"
6182 $rm -f reflect flect
6184 : now see if they want to do setuid emulation
6187 case "$d_suidsafe" in
6190 echo "No need to emulate SUID scripts since they are secure here." >&4
6194 Some systems have disabled setuid scripts, especially systems where
6195 setuid scripts cannot be secure. On systems where setuid scripts have
6196 been disabled, the setuid/setgid bits on scripts are currently
6197 useless. It is possible for $package to detect those bits and emulate
6198 setuid/setgid in a secure fashion. This emulation will only work if
6199 setuid scripts have been disabled in your kernel.
6203 "$define") dflt=y ;;
6206 rp="Do you want to do setuid/setgid emulation?"
6209 [yY]*) val="$define";;
6217 : see if this is a malloc.h system
6218 : we want a real compile instead of Inhdr because some systems have a
6219 : malloc.h that just gives a compile error saying to use stdlib.h instead
6224 int main () { return 0; }
6227 if eval $compile; then
6228 echo "<malloc.h> found." >&4
6231 echo "<malloc.h> NOT found." >&4
6238 : check for void type
6240 echo "Checking to see how well your C compiler groks the void type..." >&4
6241 case "$voidflags" in
6253 extern void moo(); /* function returning void */
6254 void (*goo)(); /* ptr to func returning void */
6256 void *hue; /* generic ptr */
6269 int main() { sub(); }
6271 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6272 voidflags=$defvoidused
6273 echo "Good. It appears to support void to the level $package wants.">&4
6274 if $contains warning .out >/dev/null 2>&1; then
6275 echo "However, you might get some warnings that look like this:"
6279 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6280 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6281 echo "It supports 1..."
6282 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6283 echo "It also supports 2..."
6284 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6286 echo "And it supports 4 but not 8 definitely."
6288 echo "It doesn't support 4..."
6289 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6291 echo "But it supports 8."
6294 echo "Neither does it support 8."
6298 echo "It does not support 2..."
6299 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6301 echo "But it supports 4 and 8."
6303 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6305 echo "And it supports 4 but has not heard about 8."
6307 echo "However it supports 8 but not 4."
6312 echo "There is no support at all for void."
6317 case "$voidflags" in
6320 Support flag bits are:
6321 1: basic void declarations.
6322 2: arrays of pointers to functions returning void.
6323 4: operations between pointers to and addresses of void functions.
6324 8: generic void pointers.
6327 rp="Your void support flags add up to what?"
6334 : check for length of pointer
6338 echo "Checking to see how big your pointers are..." >&4
6339 if test "$voidflags" -gt 7; then
6340 echo '#define VOID_PTR char *' > try.c
6342 echo '#define VOID_PTR void *' > try.c
6352 printf("%d\n", (int)sizeof(VOID_PTR));
6357 if eval $compile_ok; then
6358 ptrsize=`$run ./try`
6359 echo "Your pointers are $ptrsize bytes long."
6362 echo "(I can't seem to compile the test program. Guessing...)" >&4
6363 rp="What is the size of a pointer (in bytes)?"
6370 case "$use64bitall" in
6371 "$define"|true|[yY]*)
6375 *** You have chosen a maximally 64-bit build,
6376 *** but your pointers are only 4 bytes wide.
6377 *** Please rerun Configure without -Duse64bitall.
6382 *** Since you have quads, you could possibly try with -Duse64bitint.
6387 *** Cannot continue, aborting.
6398 : determine whether to use malloc wrapping
6400 case "$usemallocwrap" in
6401 [yY]*|true|$define) dflt='y' ;;
6402 [nN]*|false|$undef) dflt='n' ;;
6403 *) case "$usedevel" in
6404 [yY]*|true|$define) dflt='y' ;;
6409 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6411 usemallocwrap="$ans"
6414 usemallocwrap="$define" ;;
6416 usemallocwrap="$undef" ;;
6419 : determine which malloc to compile in
6421 case "$usemymalloc" in
6422 [yY]*|true|$define) dflt='y' ;;
6423 [nN]*|false|$undef) dflt='n' ;;
6424 *) case "$ptrsize" in
6430 rp="Do you wish to attempt to use the malloc that comes with $package?"
6436 mallocsrc='malloc.c'
6437 mallocobj="malloc$_o"
6438 d_mymalloc="$define"
6441 : Remove malloc from list of libraries to use
6442 echo "Removing unneeded -lmalloc from library list" >&4
6443 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6446 echo "libs = $libs" >&4
6458 : compute the return types of malloc and free
6460 $cat >malloc.c <<END
6464 #include <sys/types.h>
6478 case "$malloctype" in
6480 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6487 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6491 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6498 echo "Your system uses $freetype free(), it would seem." >&4
6502 After $package is installed, you may wish to install various
6503 add-on modules and utilities. Typically, these add-ons will
6504 be installed under $prefix with the rest
6505 of this package. However, you may wish to install such add-ons
6506 elsewhere under a different prefix.
6508 If you do not wish to put everything under a single prefix, that's
6509 ok. You will be prompted for the individual locations; this siteprefix
6510 is only used to suggest the defaults.
6512 The default should be fine for most people.
6516 rp='Installation prefix to use for add-on modules and utilities?'
6517 : XXX Here might be another good place for an installstyle setting.
6518 case "$siteprefix" in
6520 *) dflt=$siteprefix ;;
6523 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6525 case "$siteprefix" in
6529 *) oldsiteprefix="$prefix";;
6534 siteprefixexp="$ansexp"
6536 : determine where site specific libraries go.
6537 : Usual default is /usr/local/lib/perl5/site_perl/$version
6538 : The default "style" setting is made in installstyle.U
6539 : XXX No longer works with Prefixit stuff.
6540 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6542 '') case "$installstyle" in
6543 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6544 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6552 The installation process will create a directory for
6553 site-specific extensions and modules. Most users find it convenient
6554 to place all site-specific files in this directory rather than in the
6555 main distribution directory.
6559 rp='Pathname for the site-specific library files?'
6563 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6565 : determine where site specific architecture-dependent libraries go.
6566 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6567 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6568 : sitelib may have an optional trailing /share.
6570 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6571 dflt="$dflt/$archname"
6576 set sitearch sitearch none
6580 The installation process will also create a directory for
6581 architecture-dependent site-specific extensions and modules.
6585 rp='Pathname for the site-specific architecture-dependent library files?'
6589 if $test X"$sitearch" = X"$sitelib"; then
6592 d_sitearch="$define"
6597 The installation process will also create a directory for
6598 vendor-supplied add-ons. Vendors who supply perl with their system
6599 may find it convenient to place all vendor-supplied files in this
6600 directory rather than in the main distribution directory. This will
6601 ease upgrades between binary-compatible maintenance versions of perl.
6603 Of course you may also use these directories in whatever way you see
6604 fit. For example, you might use them to access modules shared over a
6605 company-wide network.
6607 The default answer should be fine for most people.
6608 This causes further questions about vendor add-ons to be skipped
6609 and no vendor-specific directories will be configured for perl.
6612 rp='Do you want to configure vendor-specific add-on directories?'
6613 case "$usevendorprefix" in
6614 define|true|[yY]*) dflt=y ;;
6615 *) : User may have set vendorprefix directly on Configure command line.
6616 case "$vendorprefix" in
6625 rp='Installation prefix to use for vendor-supplied add-ons?'
6626 case "$vendorprefix" in
6628 *) dflt=$vendorprefix ;;
6631 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6633 case "$vendorprefix" in
6637 *) oldvendorprefix="$prefix";;
6641 usevendorprefix="$define"
6643 vendorprefixexp="$ansexp"
6645 *) usevendorprefix="$undef"
6651 case "$vendorprefix" in
6652 '') d_vendorlib="$undef"
6656 *) d_vendorlib="$define"
6657 : determine where vendor-supplied modules go.
6658 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6659 case "$vendorlib" in
6661 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6662 case "$installstyle" in
6663 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6664 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6667 *) dflt="$vendorlib"
6671 rp='Pathname for the vendor-supplied library files?'
6674 vendorlibexp="$ansexp"
6677 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6681 case "$vendorprefix" in
6682 '') d_vendorarch="$undef"
6686 *) d_vendorarch="$define"
6687 : determine where vendor-supplied architecture-dependent libraries go.
6688 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6689 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6690 : vendorlib may have an optional trailing /share.
6691 case "$vendorarch" in
6692 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6693 dflt="$dflt/$archname"
6695 *) dflt="$vendorarch" ;;
6698 rp='Pathname for vendor-supplied architecture-dependent files?'
6701 vendorarchexp="$ansexp"
6704 prefixvar=vendorarch
6707 : Final catch-all directories to search
6710 Lastly, you can have perl look in other directories for extensions and
6711 modules in addition to those already specified.
6712 These directories will be searched after
6716 test X"$vendorlib" != "X" && echo ' ' $vendorlib
6717 test X"$vendorarch" != "X" && echo ' ' $vendorarch
6719 case "$otherlibdirs" in
6720 ''|' ') dflt='none' ;;
6721 *) dflt="$otherlibdirs" ;;
6724 Enter a colon-separated set of extra paths to include in perl's @INC
6725 search path, or enter 'none' for no extra paths.
6729 rp='Colon-separated list of additional directories for perl to search?'
6732 ' '|''|none) otherlibdirs=' ' ;;
6733 *) otherlibdirs="$ans" ;;
6735 case "$otherlibdirs" in
6739 set d_perl_otherlibdirs
6742 : Cruising for prototypes
6744 echo "Checking out function prototypes..." >&4
6745 $cat >prototype.c <<EOCP
6750 int main(int argc, char *argv[]) {
6753 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
6754 echo "Your C compiler appears to support function prototypes."
6757 echo "Your C compiler doesn't seem to understand function prototypes."
6764 case "$prototype" in
6766 *) ansi2knr='ansi2knr'
6771 This version of $package can only be compiled by a compiler that
6772 understands function prototypes. Unfortunately, your C compiler
6774 doesn't seem to understand them. Sorry about that.
6776 If GNU cc is available for your system, perhaps you could try that instead.
6778 Eventually, we hope to support building Perl with pre-ANSI compilers.
6779 If you would like to help in that effort, please contact <perlbug@perl.org>.
6781 Aborting Configure now.
6793 Perl can be built with extra modules or bundles of modules which
6794 will be fetched from the CPAN and installed alongside Perl.
6796 Notice that you will need access to the CPAN; either via the Internet,
6797 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
6798 be asked later to configure the CPAN.pm module which will in turn do
6799 the installation of the rest of the extra modules or bundles.)
6801 Notice also that if the modules require any external software such as
6802 libraries and headers (the libz library and the zlib.h header for the
6803 Compress::Zlib module, for example) you MUST have any such software
6804 already installed, this configuration process will NOT install such
6807 If this doesn't make any sense to you, just accept the default '$dflt'.
6809 rp='Install any extra modules (y or n)?'
6815 Please list any extra modules or bundles to be installed from CPAN,
6816 with spaces between the names. The names can be in any format the
6817 'install' command of CPAN.pm will understand. (Answer 'none',
6818 without the quotes, to install no extra modules or bundles.)
6828 $rm -f ../extras.lst
6830 *) echo "(Saving the list of extras for later...)"
6831 echo "$extras" > ../extras.lst
6839 : determine where html pages for programs go
6840 set html1dir html1dir none
6844 If you wish to install html files for programs in $spackage, indicate
6845 the appropriate directory here. To skip installing html files,
6849 ''|none|$undef|' ') dflt=none ;;
6850 *) dflt=$html1dir ;;
6853 rp="Directory for the main $spackage html pages?"
6857 : Use ' ' for none so value is preserved next time through Configure
6858 $test X"$html1dir" = "X" && html1dir=' '
6860 : determine where html pages for libraries and modules go
6861 set html3dir html3dir none
6865 If you wish to install html files for modules associated with $spackage,
6866 indicate the appropriate directory here. To skip installing html files,
6869 : There is no obvious default. If they have specified html1dir, then
6870 : try to key off that, possibly changing .../html1 into .../html3.
6872 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
6873 *) dflt=$html3dir ;;
6876 rp="Directory for the $spackage module html pages?"
6880 : Use ' ' for none so value is preserved next time through Configure
6881 $test X"$html3dir" = "X" && html3dir=' '
6883 : Find perl5.005 or later.
6884 echo "Looking for a previously installed perl5.005 or later... "
6886 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6887 : Check if this perl is recent and can load a simple module
6888 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6891 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6901 '') echo "None found. That's ok.";;
6902 *) echo "Using $perl5." ;;
6905 : Determine list of previous versions to include in @INC
6906 $cat > getverlist <<EOPL
6909 \$api_versionstring = "$api_versionstring";
6910 \$version = "$version";
6911 \$stem = "$sitelib_stem";
6912 \$archname = "$archname";
6914 $cat >> getverlist <<'EOPL'
6915 # Can't have leading @ because metaconfig interprets it as a command!
6916 ;@inc_version_list=();
6917 # XXX Redo to do opendir/readdir?
6920 ;@candidates = glob("5.*");
6926 # XXX ToDo: These comparisons must be reworked when two-digit
6927 # subversions come along, so that 5.7.10 compares as greater than
6928 # 5.7.3! By that time, hope that 5.6.x is sufficiently
6929 # widespread that we can use the built-in version vectors rather
6930 # than reinventing them here. For 5.6.0, however, we must
6931 # assume this script will likely be run by 5.005_0x. --AD 1/2000.
6932 foreach $d (@candidates) {
6933 if ($d lt $version) {
6934 if ($d ge $api_versionstring) {
6935 unshift(@inc_version_list, grep { -d } "$d/$archname", $d);
6937 elsif ($d ge "5.005") {
6938 unshift(@inc_version_list, grep { -d } $d);
6942 # Skip newer version. I.e. don't look in
6943 # 5.7.0 if we're installing 5.6.1.
6947 if (@inc_version_list) {
6948 print join(' ', @inc_version_list);
6951 # Blank space to preserve value for next Configure run.
6956 case "$inc_version_list" in
6957 '') if test -x "$perl5$exe_ext"; then
6958 dflt=`$perl5 getverlist`
6963 $undef) dflt='none' ;;
6964 *) eval dflt=\"$inc_version_list\" ;;
6967 ''|' ') dflt=none ;;
6974 In order to ease the process of upgrading, this version of perl
6975 can be configured to use modules built and installed with earlier
6976 versions of perl that were installed under $prefix. Specify here
6977 the list of earlier versions that this version of perl should check.
6978 If Configure detected no earlier versions of perl installed under
6979 $prefix, then the list will be empty. Answer 'none' to tell perl
6980 to not search earlier versions.
6982 The default should almost always be sensible, so if you're not sure,
6983 just accept the default.
6986 rp='List of earlier versions to include in @INC?'
6989 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6990 *) inc_version_list="$ans" ;;
6992 case "$inc_version_list" in
6994 inc_version_list_init='0'
6995 d_inc_version_list="$undef"
6997 *) inc_version_list_init=`echo $inc_version_list |
6998 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6999 d_inc_version_list="$define"
7004 : determine whether to install perl also as /usr/bin/perl
7007 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7009 Many scripts expect perl to be installed as /usr/bin/perl.
7011 If you want to, I can install the perl you are about to compile
7012 as /usr/bin/perl (in addition to $bin/perl).
7014 if test -f /usr/bin/perl; then
7017 However, please note that because you already have a /usr/bin/perl,
7018 overwriting that with a new Perl would very probably cause problems.
7019 Therefore I'm assuming you don't want to do that (unless you insist).
7022 case "$installusrbinperl" in
7023 "$define"|[yY]*) dflt='y';;
7029 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7032 case "$installusrbinperl" in
7033 "$undef"|[nN]*) dflt='n';;
7037 rp="Do you want to install perl as /usr/bin/perl?"
7040 [yY]*) val="$define";;
7046 set installusrbinperl
7050 echo "Checking for GNU C Library..." >&4
7052 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7053 alone are insufficient to distinguish different versions, such as
7054 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7055 libc version 2.1.0. A. Dougherty, June 3, 2002.
7061 # ifdef __GLIBC_MINOR__
7062 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
7063 # include <gnu/libc-version.h>
7064 printf("%s\n", gnu_get_libc_version());
7066 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7069 printf("%d\n", __GLIBC__);
7078 if eval $compile_ok && $run ./try > glibc.ver; then
7080 gnulibc_version=`$cat glibc.ver`
7081 echo "You are using the GNU C Library version $gnulibc_version"
7085 echo "You are not using the GNU C Library"
7087 $rm -f try try.* glibc.ver
7091 : see if nm is to be used to determine whether a symbol is defined or not
7095 case "$d_gnulibc" in
7098 echo "nm probably won't work on the GNU C Library." >&4
7104 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7106 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7107 echo "'nm' won't be sufficient on this sytem." >&4
7113 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7114 if $test $dflt -gt 20; then
7124 true|$define) dflt=y;;
7131 I can use $nm to extract the symbols from your C libraries. This
7132 is a time consuming task which may generate huge output on the disk (up
7133 to 3 megabytes) but that should make the symbols extraction faster. The
7134 alternative is to skip the 'nm' extraction part and to compile a small
7135 test program instead to determine whether each symbol is present. If
7136 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7137 this may be the best solution.
7139 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7142 rp="Shall I use $nm to extract C symbols from the libraries?"
7145 [Nn]*) usenm=false;;
7154 : nm options which may be necessary
7156 '') if $test -f /mach_boot; then
7158 elif $test -d /usr/ccs/lib; then
7159 nm_opt='-p' # Solaris (and SunOS?)
7160 elif $test -f /dgux; then
7162 elif $test -f /lib64/rld; then
7163 nm_opt='-p' # 64-bit Irix
7169 : nm options which may be necessary for shared libraries but illegal
7170 : for archive libraries. Thank you, Linux.
7171 case "$nm_so_opt" in
7172 '') case "$myuname" in
7174 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7175 nm_so_opt='--dynamic'
7184 : get list of predefined functions in a handy place
7189 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7195 *) for thislib in $libs; do
7198 : Handle C library specially below.
7201 thislib=`echo $thislib | $sed -e 's/^-l//'`
7202 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7204 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7206 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7208 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7210 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7212 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7214 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7219 libnames="$libnames $try"
7221 *) libnames="$libnames $thislib" ;;
7230 for xxx in $libpth; do
7231 $test -r $1 || set $xxx/libc.$so
7232 : The messy sed command sorts on library version numbers.
7234 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7235 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7237 s/[0-9][0-9]*/0000&/g
7238 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7241 $sort | $sed -e 's/^.* //'`
7244 $test -r $1 || set /usr/ccs/lib/libc.$so
7245 $test -r $1 || set /lib/libsys_s$_a
7251 if $test -r "$1"; then
7252 echo "Your (shared) C library seems to be in $1."
7254 elif $test -r /lib/libc && $test -r /lib/clib; then
7255 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7257 libc='/lib/clib /lib/libc'
7258 if $test -r /lib/syslib; then
7259 echo "(Your math library is in /lib/syslib.)"
7260 libc="$libc /lib/syslib"
7262 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7263 echo "Your C library seems to be in $libc, as you said before."
7264 elif $test -r $incpath/usr/lib/libc$_a; then
7265 libc=$incpath/usr/lib/libc$_a;
7266 echo "Your C library seems to be in $libc. That's fine."
7267 elif $test -r /lib/libc$_a; then
7269 echo "Your C library seems to be in $libc. You're normal."
7271 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7273 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7274 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7275 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7277 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7279 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7282 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7284 if $test -r "$tans"; then
7285 echo "Your C library seems to be in $tans, of all places."
7291 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7295 If the guess above is wrong (which it might be if you're using a strange
7296 compiler, or your machine supports multiple models), you can override it here.
7301 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7303 I can't seem to find your C library. I've looked in the following places:
7306 $sed 's/^/ /' libpath
7309 None of these seems to contain your C library. I need to get its name...
7314 rp='Where is your C library?'
7319 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7320 set X `cat libnames`
7323 case $# in 1) xxx=file; esac
7324 echo "Extracting names from the following $xxx for later perusal:" >&4
7326 $sed 's/^/ /' libnames >&4
7328 $echo $n "This may take a while...$c" >&4
7332 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7333 *) $nm $nm_opt $file 2>/dev/null;;
7338 $grep fprintf libc.tmp > libc.ptf
7339 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7340 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7342 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7344 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7346 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7348 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7350 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7352 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7354 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7356 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7358 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7360 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7362 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7364 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7366 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7367 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7369 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7371 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7373 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7375 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7377 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7379 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7381 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7383 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7385 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7387 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7389 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7391 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7393 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7395 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7397 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7400 $nm -p $* 2>/dev/null >libc.tmp
7401 $grep fprintf libc.tmp > libc.ptf
7402 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7403 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7409 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7411 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
7412 for thisname in $libnames $libc; do
7413 $ar t $thisname >>libc.tmp
7415 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7417 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7418 # Repeat libc to extract forwarders to DLL entries too
7419 for thisname in $libnames $libc; do
7420 $ar tv $thisname >>libc.tmp
7421 # Revision 50 of EMX has bug in $ar.
7422 # it will not extract forwarders to DLL entries
7423 # Use emximp which will extract exactly them.
7424 emximp -o tmp.imp $thisname \
7426 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7427 < tmp.imp >>libc.tmp
7430 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7433 echo "$ar didn't seem to work right." >&4
7434 echo "Maybe this is a Cray...trying bld instead..." >&4
7435 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
7437 for thisname in $libnames; do
7439 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7440 $ar t $thisname >>libc.tmp
7444 echo "That didn't work either. Giving up." >&4
7454 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7455 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7457 *) if $test -f /lib/syscalls.exp; then
7459 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7460 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' /lib/syscalls.exp >>libc.list
7466 $rm -f libnames libpath
7468 : see if dld is available
7472 : is a C symbol defined?
7475 -v) tf=libc.tmp; tdc="";;
7476 -a) tf=libc.tmp; tdc="[]";;
7477 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7480 case "$reuseval-$4" in
7482 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7487 if $test "$runnm" = true; then
7488 if $contains $tlook $tf >/dev/null 2>&1; then
7490 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7491 echo "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7492 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7493 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7494 $rm -f try$_exe try.c core core.* try.core;
7497 echo "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7498 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7499 $rm -f try$_exe try.c;
7504 $define) tval=true;;
7511 : define an is-in-libc? function
7512 inlibc='echo " "; td=$define; tu=$undef;
7513 sym=$1; var=$2; eval "was=\$$2";
7515 case "$reuseval$was" in
7525 echo "$sym() found." >&4;
7526 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7528 echo "$sym() NOT found." >&4;
7529 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7533 $define) echo "$sym() found." >&4;;
7534 *) echo "$sym() NOT found." >&4;;
7538 : see if dlopen exists
7545 : determine which dynamic loading, if any, to compile in
7547 dldir="ext/DynaLoader"
7560 $define) dflt='y' ;;
7563 $define) dflt='y' ;;
7565 : Does a dl_xxx.xs file exist for this operating system
7566 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7569 rp="Do you wish to use dynamic loading?"
7576 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7577 dflt="$dldir/dl_${osname}.xs"
7578 elif $test "$d_dlopen" = "$define" ; then
7579 dflt="$dldir/dl_dlopen.xs"
7580 elif $test "$i_dld" = "$define" ; then
7581 dflt="$dldir/dl_dld.xs"
7586 *) dflt="$dldir/$dlsrc"
7589 echo "The following dynamic loading files are available:"
7590 : Can not go over to $dldir because getfile has path hard-coded in.
7591 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7592 rp="Source file to use for dynamic loading"
7598 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7602 Some systems may require passing special flags to $cc -c to
7603 compile modules that will be used to create a shared library.
7604 To use no flags, say "none".
7607 case "$cccdlflags" in
7608 '') case "$gccversion" in
7609 '') case "$osname" in
7611 next) dflt='none' ;;
7612 irix*) dflt='-KPIC' ;;
7613 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7614 sunos) dflt='-pic' ;;
7618 *) case "$osname" in
7619 darwin) dflt='none' ;;
7620 svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7625 *) dflt="$cccdlflags" ;;
7627 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7630 none) cccdlflags=' ' ;;
7631 *) cccdlflags="$ans" ;;
7636 Some systems use ld to create libraries that can be dynamically loaded,
7637 while other systems (such as those using ELF) use $cc.
7641 '') $cat >try.c <<EOM
7642 /* Test for whether ELF binaries are produced */
7650 int i = open("a.out",O_RDONLY);
7653 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7654 exit(0); /* succeed (yes, it's ELF) */
7659 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7661 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7665 echo "I'll use ld to build dynamic libraries."
7674 rp="What command should be used to create dynamic libraries?"
7680 Some systems may require passing special flags to $ld to create a
7681 library that can be dynamically loaded. If your ld flags include
7682 -L/other/path options to locate libraries outside your loader's normal
7683 search path, you may need to specify those -L options here as well. To
7684 use no flags, say "none".
7687 case "$lddlflags" in
7688 '') case "$osname" in
7689 beos) dflt='-nostart' ;;
7691 case "$gccversion" in
7692 '') dflt="$dflt +vnocompatwarnings" ;;
7695 linux|irix*|gnu*) dflt='-shared' ;;
7696 next) dflt='none' ;;
7697 solaris) dflt='-G' ;;
7698 sunos) dflt='-assert nodefinitions' ;;
7699 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
7703 *) dflt="$lddlflags" ;;
7706 : Try to guess additional flags to pick up local libraries.
7707 : Be careful not to append to a plain 'none'
7711 for thisflag in $ldflags; do
7716 *) dflt="$dflt $thisflag" ;;
7723 ''|' ') dflt='none' ;;
7726 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
7729 none) lddlflags=' ' ;;
7730 *) lddlflags="$ans" ;;
7735 Some systems may require passing special flags to $cc to indicate that
7736 the resulting executable will use dynamic linking. To use no flags,
7740 case "$ccdlflags" in
7741 '') case "$osname" in
7742 linux|hpux|gnu*) dflt='-Wl,-E' ;;
7743 next|sunos) dflt='none' ;;
7747 *) dflt="$ccdlflags" ;;
7749 rp="Any special flags to pass to $cc to use dynamic linking?"
7752 none) ccdlflags=' ' ;;
7753 *) ccdlflags="$ans" ;;
7767 # No dynamic loading being used, so don't bother even to prompt.
7770 *) case "$useshrplib" in
7771 '') case "$osname" in
7772 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
7774 also='Building a shared libperl is required for dynamic loading to work on your system.'
7779 also='Building a shared libperl is needed for MAB support.'
7797 The perl executable is normally obtained by linking perlmain.c with
7798 libperl${_a}, any static extensions (usually just DynaLoader), and
7799 any other libraries needed on this system (such as -lm, etc.). Since
7800 your system supports dynamic loading, it is probably possible to build
7801 a shared libperl.$so. If you will have more than one executable linked
7802 to libperl.$so, this will significantly reduce the size of each
7803 executable, but it may have a noticeable effect on performance. The
7804 default is probably sensible for your system.
7808 rp="Build a shared libperl.$so (y/n)"
7812 useshrplib='true' ;;
7813 *) useshrplib='false' ;;
7818 case "$useshrplib" in
7822 # Figure out a good name for libperl.so. Since it gets stored in
7823 # a version-specific architecture-dependent library, the version
7824 # number isn't really that important, except for making cc/ld happy.
7826 # A name such as libperl.so.3.1
7827 majmin="libperl.$so.$patchlevel.$subversion"
7828 # A name such as libperl.so.301
7829 majonly=`echo $patchlevel $subversion |
7830 $awk '{printf "%d%02d", $1, $2}'`
7831 majonly=libperl.$so.$majonly
7832 # I'd prefer to keep the os-specific stuff here to a minimum, and
7833 # rely on figuring it out from the naming of libc.
7834 case "${osname}${osvers}" in
7837 # XXX How handle the --version stuff for MAB?
7839 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
7842 cygwin*) # ld links against an importlib
7843 dflt=libperl$lib_ext
7845 *) # Try to guess based on whether libc has major.minor.
7847 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
7848 *libc.$so.[0-9]*) dflt=$majonly ;;
7849 *) dflt=libperl.$so ;;
7859 I need to select a good name for the shared libperl. If your system uses
7860 library names with major and minor numbers, then you might want something
7861 like $majmin. Alternatively, if your system uses a single version
7862 number for shared libraries, then you might want to use $majonly.
7863 Or, your system might be quite happy with a simple libperl.$so.
7865 Since the shared libperl will get installed into a version-specific
7866 architecture-dependent directory, the version number of the shared perl
7867 library probably isn't important, so the default should be o.k.
7870 rp='What name do you want to give to the shared libperl?'
7873 echo "Ok, I'll use $libperl"
7876 libperl="libperl${_a}"
7880 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
7884 WARNING: Use of the shrpdir variable for the installation location of
7885 the shared $libperl is not supported. It was never documented and
7886 will not work in this version. Let me (perlbug@perl.org)
7887 know of any problems this may cause.
7893 But your current setting of $shrpdir is
7894 the default anyway, so it's harmless.
7899 Further, your current attempted setting of $shrpdir
7900 conflicts with the value of $archlibexp/CORE
7901 that installperl will use.
7908 # How will the perl executable find the installed shared $libperl?
7909 # Add $xxx to ccdlflags.
7910 # If we can't figure out a command-line option, use $shrpenv to
7911 # set env LD_RUN_PATH. The main perl makefile uses this.
7912 shrpdir=$archlibexp/CORE
7915 if "$useshrplib"; then
7918 # We'll set it in Makefile.SH...
7923 freebsd|netbsd|openbsd|interix|dragonfly)
7924 xxx="-Wl,-R$shrpdir"
7926 bsdos|linux|irix*|dec_osf|gnu*)
7927 xxx="-Wl,-rpath,$shrpdir"
7930 # next doesn't like the default...
7933 # beos doesn't like the default, either.
7936 # hpux doesn't like the default, either.
7937 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
7940 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
7946 # Only add $xxx if it isn't already in ccdlflags.
7947 case " $ccdlflags " in
7949 *) ccdlflags="$ccdlflags $xxx"
7952 Adding $xxx to the flags
7953 passed to $ld so that the perl executable will find the
7954 installed shared $libperl.
7962 # Fix ccdlflags in AIX for building external extensions.
7963 # (For building Perl itself bare -bE:perl.exp is needed,
7964 # Makefile.SH takes care of this.)
7966 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
7968 # Respect a hint or command-line value.
7970 '') shrpenv="$tmp_shrpenv" ;;
7972 case "$ldlibpthname" in
7973 '') ldlibpthname=LD_LIBRARY_PATH ;;
7974 none) ldlibpthname='' ;;
7977 : determine where manual pages are on this system
7981 syspath='/usr/share/man/man1 /usr/man/man1'
7982 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
7983 syspath="$syspath /usr/man/u_man/man1"
7984 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
7985 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
7986 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
7987 sysman=`./loc . /usr/man/man1 $syspath`
7990 if $test -d "$sysman"; then
7991 echo "System manual is in $sysman." >&4
7993 echo "Could not find manual pages in source form." >&4
7996 : determine where manual pages go
7997 set man1dir man1dir none
8001 $spackage has manual pages available in source form.
8005 echo "However, you don't have nroff, so they're probably useless to you."
8007 '') man1dir="none";;
8010 echo "If you don't want the manual sources installed, answer 'none'."
8015 lookpath="$prefixexp/share/man/man1"
8016 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8017 lookpath="$lookpath $prefixexp/man/p_man/man1"
8018 lookpath="$lookpath $prefixexp/man/u_man/man1"
8019 lookpath="$lookpath $prefixexp/man/man.1"
8021 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8022 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8032 rp="Where do the main $spackage manual pages (source) go?"
8034 if $test "X$man1direxp" != "X$ansexp"; then
8045 : What suffix to use on installed man pages
8052 rp="What suffix should be used for the main $spackage man pages?"
8054 '') case "$man1dir" in
8068 *) dflt="$man1ext";;
8075 : see if we can have long filenames
8077 first=123456789abcdef
8079 if (echo hi >$first) 2>/dev/null; then
8080 if $test -f 123456789abcde; then
8081 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8084 echo 'You can have filenames longer than 14 characters.'>&4
8089 You can't have filenames longer than 14 chars.
8090 You can't even think about them!
8096 $rm -rf 123456789abcde*
8098 : determine where library module manual pages go
8099 set man3dir man3dir none
8103 $spackage has manual pages for many of the library modules.
8109 However, you don't have nroff, so they're probably useless to you.
8112 '') man3dir="none";;
8116 case "$d_flexfnam" in
8119 However, your system can't handle the long file names like File::Basename.3.
8122 '') man3dir="none";;
8126 echo "If you don't want the manual sources installed, answer 'none'."
8127 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8129 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8130 if $test -d "$privlib/man/man3"; then
8133 WARNING: Previous versions of perl installed man3 pages into
8134 $privlib/man/man3. This version will suggest a
8135 new default of $dflt.
8139 rp='Do you wish to preserve the old behavior?(y/n)'
8142 y*) dflt="$privlib/man/man3" ;;
8147 *) dflt="$man3dir" ;;
8154 rp="Where do the $package library man pages (source) go?"
8164 : What suffix to use on installed man pages
8170 rp="What suffix should be used for the $package library man pages?"
8172 '') case "$man3dir" in
8186 *) dflt="$man3ext";;
8193 : see if we have to deal with yellow pages, now NIS.
8194 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8195 if $test -f /usr/etc/nibindd; then
8197 echo "I'm fairly confident you're on a NeXT."
8199 rp='Do you get the hosts file via NetInfo?'
8208 y*) hostcat='nidump hosts .';;
8209 *) case "$hostcat" in
8210 nidump*) hostcat='';;
8220 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8228 rp='Are you getting the hosts file via yellow pages?'
8231 y*) hostcat='ypcat hosts';;
8232 *) hostcat='cat /etc/hosts';;
8238 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8241 '') test -f /etc/group && groupcat='cat /etc/group';;
8244 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8247 : now get the host name
8249 echo "Figuring out host name..." >&4
8250 case "$myhostname" in
8252 echo 'Maybe "hostname" will work...'
8253 if tans=`sh -c hostname 2>&1` ; then
8261 if $test "$cont"; then
8263 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8264 if tans=`cat /etc/systemid 2>&1` ; then
8266 phostname='cat /etc/systemid'
8267 echo "Whadyaknow. Xenix always was a bit strange..."
8270 elif $test -r /etc/systemid; then
8271 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8274 if $test "$cont"; then
8275 echo 'No, maybe "uuname -l" will work...'
8276 if tans=`sh -c 'uuname -l' 2>&1` ; then
8278 phostname='uuname -l'
8280 echo 'Strange. Maybe "uname -n" will work...'
8281 if tans=`sh -c 'uname -n' 2>&1` ; then
8283 phostname='uname -n'
8285 echo 'Oh well, maybe I can mine it out of whoami.h...'
8286 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8287 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8288 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8290 case "$myhostname" in
8291 '') echo "Does this machine have an identity crisis or something?"
8294 echo "Well, you said $myhostname before..."
8295 phostname='echo $myhostname';;
8301 case "$myhostname" in
8302 '') myhostname=noname ;;
8304 : you do not want to know about this
8309 if $test "$myhostname" ; then
8311 rp='Your host name appears to be "'$myhostname'".'" Right?"
8319 : bad guess or no guess
8320 while $test "X$myhostname" = X ; do
8322 rp="Please type the (one word) name of your host:"
8327 : translate upper to lower if necessary
8328 case "$myhostname" in
8330 echo "(Normalizing case in your host name)"
8331 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8335 case "$myhostname" in
8337 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8338 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8339 echo "(Trimming domain name from host name--host name is now $myhostname)"
8341 *) case "$mydomain" in
8344 test "X$hostcat" = "Xypcat hosts" &&
8345 ypmatch "$myhostname" hosts 2>/dev/null |\
8346 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8349 test "X$hostcat" != "X" &&
8350 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8351 /[ ]$myhostname[ . ]/p" > hosts
8354 if $test -f hosts; then
8355 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8356 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8357 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8358 hosts | $sort | $uniq | \
8359 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8360 case `$echo X$dflt` in
8361 X*\ *) echo "(Several hosts in the database matched hostname)"
8364 X.) echo "(You do not have fully-qualified names in the hosts database)"
8368 echo "(I cannot locate a hosts database anywhere)"
8373 tans=`./loc resolv.conf X /etc /usr/etc`
8374 if $test -f "$tans"; then
8375 echo "(Attempting domain name extraction from $tans)"
8376 dflt=.`$sed -n -e 's/ / /g' \
8377 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8378 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8380 .) dflt=.`$sed -n -e 's/ / /g' \
8381 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8382 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8389 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8390 dflt=.`sh -c domainname 2>/dev/null`
8393 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8397 case "$dflt$osname" in
8398 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8399 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8403 .) echo "(Lost all hope -- silly guess then)"
8409 *) dflt="$mydomain";;
8413 rp="What is your domain name?"
8423 : translate upper to lower if necessary
8426 echo "(Normalizing case in your domain name)"
8427 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8431 : a little sanity check here
8432 case "$phostname" in
8435 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8436 $myhostname$mydomain|$myhostname) ;;
8438 case "$phostname" in
8440 echo "(That doesn't agree with your whoami.h file, by the way.)"
8443 echo "(That doesn't agree with your $phostname command, by the way.)"
8453 I need to get your e-mail address in Internet format if possible, i.e.
8454 something like user@host.domain. Please answer accurately since I have
8455 no easy means to double check it. The default value provided below
8456 is most probably close to reality but may not be valid from outside
8457 your organization...
8461 while test "$cont"; do
8463 '') dflt="$cf_by@$myhostname$mydomain";;
8464 *) dflt="$cf_email";;
8466 rp='What is your e-mail address?'
8472 rp='Address does not look like an Internet one. Use it anyway?'
8488 If you or somebody else will be maintaining perl at your site, please
8489 fill in the correct e-mail address here so that they may be contacted
8490 if necessary. Currently, the "perlbug" program included with perl
8491 will send mail to this address in addition to perlbug@perl.org. You may
8492 enter "none" for no administrator.
8495 case "$perladmin" in
8496 '') dflt="$cf_email";;
8497 *) dflt="$perladmin";;
8499 rp='Perl administrator e-mail address'
8503 : determine whether to only install version-specific parts.
8506 Do you want to install only the version-specific parts of the perl
8507 distribution? Usually you do *not* want to do this.
8509 case "$versiononly" in
8510 "$define"|[Yy]*|true) dflt='y' ;;
8513 rp="Do you want to install only the version-specific parts of perl?"
8516 [yY]*) val="$define";;
8522 case "$versiononly" in
8523 "$define") inc_version_list=''
8524 inc_version_list_init=0
8528 : figure out how to guarantee perl startup
8529 case "$startperl" in
8531 case "$sharpbang" in
8535 I can use the #! construct to start perl on your system. This will
8536 make startup of perl scripts faster, but may cause problems if you
8537 want to share those scripts and perl is not in a standard place
8538 ($binexp/perl) on all your platforms. The alternative is to force
8539 a shell by starting the script with a single ':' character.
8542 case "$versiononly" in
8543 "$define") dflt="$binexp/perl$version";;
8544 *) dflt="$binexp/perl";;
8546 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8549 none) startperl=": # use perl";;
8550 *) startperl="#!$ans"
8551 if $test 30 -lt `echo "$ans" | wc -c`; then
8554 WARNING: Some systems limit the #! command to 32 characters.
8555 If you experience difficulty running Perl scripts with #!, try
8556 installing Perl in a directory with a shorter pathname.
8562 *) startperl=": # use perl"
8567 echo "I'll use $startperl to start perl scripts."
8569 : figure best path for perl in scripts
8572 case "$versiononly" in
8573 "$define") perlpath="$binexp/perl$version";;
8574 *) perlpath="$binexp/perl";;
8576 case "$startperl" in
8581 I will use the "eval 'exec'" idiom to start Perl on your system.
8582 I can use the full path of your Perl binary for this purpose, but
8583 doing so may cause problems if you want to share those scripts and
8584 Perl is not always in a standard place ($binexp/perl).
8588 rp="What path shall I use in \"eval 'exec'\"?"
8595 case "$startperl" in
8597 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8600 : determine where public executable scripts go
8601 set scriptdir scriptdir
8603 case "$scriptdir" in
8606 : guess some guesses
8607 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8608 $test -d /usr/share/bin && dflt=/usr/share/bin
8609 $test -d /usr/local/script && dflt=/usr/local/script
8610 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8611 $test -d $prefixexp/script && dflt=$prefixexp/script
8615 *) dflt="$scriptdir"
8620 Some installations have a separate directory just for executable scripts so
8621 that they can mount it across multiple architectures but keep the scripts in
8622 one spot. You might, for example, have a subdirectory of /usr/share for this.
8623 Or you might just lump your scripts in with all your other executables.
8627 rp='Where do you keep publicly executable scripts?'
8629 if $test "X$ansexp" != "X$scriptdirexp"; then
8634 : A little fix up for an irregularly named variable.
8635 installscript="$installscriptdir"
8638 : determine where add-on public executables go
8640 '') dflt=$siteprefix/bin ;;
8644 rp='Pathname where the add-on public executables should be installed?'
8649 : determine where add-on html pages go
8650 : There is no standard location, so try to copy the previously-selected
8651 : directory structure for the core html pages.
8652 case "$sitehtml1dir" in
8653 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8654 *) dflt=$sitehtml1dir ;;
8657 ''|' ') dflt=none ;;
8660 rp='Pathname where the site-specific html pages should be installed?'
8662 prefixvar=sitehtml1dir
8665 : determine where add-on library html pages go
8666 : There is no standard location, so try to copy the previously-selected
8667 : directory structure for the core html pages.
8668 case "$sitehtml3dir" in
8669 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8670 *) dflt=$sitehtml3dir ;;
8673 ''|' ') dflt=none ;;
8676 rp='Pathname where the site-specific library html pages should be installed?'
8678 prefixvar=sitehtml3dir
8681 : determine where add-on manual pages go
8682 case "$siteman1dir" in
8683 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
8684 *) dflt=$siteman1dir ;;
8687 ''|' ') dflt=none ;;
8690 rp='Pathname where the site-specific manual pages should be installed?'
8692 prefixvar=siteman1dir
8695 : determine where add-on library man pages go
8696 case "$siteman3dir" in
8697 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
8698 *) dflt=$siteman3dir ;;
8701 ''|' ') dflt=none ;;
8704 rp='Pathname where the site-specific library manual pages should be installed?'
8706 prefixvar=siteman3dir
8709 : determine where add-on public executable scripts go
8710 case "$sitescript" in
8711 '') dflt=$siteprefix/script
8712 $test -d $dflt || dflt=$sitebin ;;
8713 *) dflt="$sitescript" ;;
8716 rp='Pathname where add-on public executable scripts should be installed?'
8718 prefixvar=sitescript
8721 case "$usefaststdio" in
8722 $define|true|[yY]*|'')
8723 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
8733 Perl can be built to use 'fast stdio', which means using the stdio
8734 library but also directly manipulating the stdio buffers to enable
8735 faster I/O. Using stdio is better for backward compatibility (especially
8736 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
8737 interface has been preferred instead of stdio.
8739 If this doesn't make any sense to you, just accept the default '$dflt'.
8741 rp='Use the "fast stdio" if available?'
8744 y|Y) val="$define" ;;
8751 : define an is-a-typedef? function
8752 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8754 "") inclist="sys/types.h";;
8756 eval "varval=\$$var";
8760 for inc in $inclist; do
8761 echo "#include <$inc>" >>temp.c;
8763 echo "#ifdef $type" >> temp.c;
8764 echo "printf(\"We have $type\");" >> temp.c;
8765 echo "#endif" >> temp.c;
8766 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8767 if $contains $type temp.E >/dev/null 2>&1; then
8773 *) eval "$var=\$varval";;
8776 : define an is-a-typedef? function that prompts if the type is not available.
8777 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8779 "") inclist="sys/types.h";;
8781 eval "varval=\$$var";
8785 for inc in $inclist; do
8786 echo "#include <$inc>" >>temp.c;
8788 echo "#ifdef $type" >> temp.c;
8789 echo "printf(\"We have $type\");" >> temp.c;
8790 echo "#endif" >> temp.c;
8791 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8793 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
8794 if $contains $type temp.E >/dev/null 2>&1; then
8795 echo "$type found." >&4;
8798 echo "$type NOT found." >&4;
8804 *) eval "$var=\$varval";;
8807 : see what type lseek is declared as in the kernel
8808 rp="What is the type used for lseek's offset on this system?"
8809 set off_t lseektype long stdio.h sys/types.h
8813 echo "Checking to see how big your file offsets are..." >&4
8815 #include <sys/types.h>
8819 printf("%d\n", (int)sizeof($lseektype));
8824 if eval $compile_ok; then
8825 lseeksize=`$run ./try`
8826 echo "Your file offsets are $lseeksize bytes long."
8830 echo "(I can't seem to compile the test program. Guessing...)"
8831 rp="What is the size of your file offsets (in bytes)?"
8837 : see what type file positions are declared as in the library
8838 rp="What is the type for file position used by fsetpos()?"
8839 set fpos_t fpostype long stdio.h sys/types.h
8844 *_t) zzz="$fpostype" ;;
8847 echo "Checking the size of $zzz..." >&4
8849 #include <sys/types.h>
8856 printf("%d\n", (int)sizeof($fpostype));
8861 if eval $compile_ok; then
8865 echo "(I can't execute the test program--guessing $fpossize.)" >&4
8868 echo "Your $zzz is $fpossize bytes long."
8874 echo "(I can't compile the test program. Guessing...)" >&4
8875 rp="What is the size of your file positions (in bytes)?"
8880 # Backward compatibility (uselfs is deprecated).
8882 "$define"|true|[yY]*)
8885 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
8887 uselargefiles="$define"
8891 case "$lseeksize:$fpossize" in
8894 You can have files larger than 2 gigabytes.
8897 *) case "$uselargefiles" in
8898 "$undef"|false|[nN]*) dflt='n' ;;
8903 Perl can be built to understand large files (files larger than 2 gigabytes)
8904 on some systems. To do so, Configure can be run with -Duselargefiles.
8906 If this doesn't make any sense to you, just accept the default '$dflt'.
8908 rp='Try to understand large files, if available?'
8911 y|Y) val="$define" ;;
8918 : Look for a hint-file generated 'call-back-unit'. If the
8919 : user has specified that a large files perl is to be built,
8920 : we may need to set or change some other defaults.
8921 if $test -f uselargefiles.cbu; then
8922 echo "Your platform has some specific hints regarding large file builds, using them..."
8923 . ./uselargefiles.cbu
8925 case "$uselargefiles" in
8927 if $test -f uselargefiles.cbu; then
8929 echo "Rechecking to see how big your file offsets are..." >&4
8931 #include <sys/types.h>
8935 printf("%d\n", (int)sizeof($lseektype));
8940 if eval $compile_ok; then
8941 lseeksize=`$run ./try`
8942 $echo "Your file offsets are now $lseeksize bytes long."
8946 echo "(I can't seem to compile the test program. Guessing...)"
8947 rp="What is the size of your file offsets (in bytes)?"
8952 *_t) zzz="$fpostype" ;;
8955 $echo $n "Rechecking the size of $zzz...$c" >&4
8957 #include <sys/types.h>
8964 printf("%d\n", (int)sizeof($fpostype));
8969 if eval $compile_ok; then
8974 echo "(I can't execute the test program--guessing $fpossize.)" >&4
8977 echo " $fpossize bytes." >&4
8983 echo "(I can't compile the test program. Guessing...)" >&4
8984 rp="What is the size of your file positions (in bytes)?"
8993 case "$vendorprefix" in
8994 '') d_vendorbin="$undef"
8998 *) d_vendorbin="$define"
8999 : determine where vendor-supplied executables go.
9000 case "$vendorbin" in
9001 '') dflt=$vendorprefix/bin ;;
9002 *) dflt="$vendorbin" ;;
9005 rp='Pathname for the vendor-supplied executables directory?'
9008 vendorbinexp="$ansexp"
9014 case "$vendorprefix" in
9015 '') vendorhtml1dir=''
9016 vendorhtml1direxp=''
9018 *) : determine where vendor-supplied html pages go.
9019 : There is no standard location, so try to copy the previously-selected
9020 : directory structure for the core html pages.
9021 : XXX Better default suggestions would be welcome.
9022 case "$vendorhtml1dir" in
9023 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9024 *) dflt=$vendorhtml1dir ;;
9027 ''|' ') dflt=none ;;
9030 rp='Pathname for the vendor-supplied html pages?'
9032 vendorhtml1dir="$ans"
9033 vendorhtml1direxp="$ansexp"
9036 : Use ' ' for none so value is preserved next time through Configure
9037 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9038 prefixvar=vendorhtml1dir
9041 case "$vendorprefix" in
9042 '') vendorhtml3dir=''
9043 vendorhtml3direxp=''
9045 *) : determine where vendor-supplied module html pages go.
9046 : There is no standard location, so try to copy the previously-selected
9047 : directory structure for the core html pages.
9048 : XXX Better default suggestions would be welcome.
9049 case "$vendorhtml3dir" in
9050 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9051 *) dflt=$vendorhtml3dir ;;
9054 ''|' ') dflt=none ;;
9057 rp='Pathname for the vendor-supplied html pages?'
9059 vendorhtml3dir="$ans"
9060 vendorhtml3direxp="$ansexp"
9063 : Use ' ' for none so value is preserved next time through Configure
9064 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9065 prefixvar=vendorhtml3dir
9068 case "$vendorprefix" in
9069 '') vendorman1dir=''
9072 *) : determine where vendor-supplied manual pages go.
9073 case "$vendorman1dir" in
9074 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9075 *) dflt=$vendorman1dir ;;
9078 ''|' ') dflt=none ;;
9081 rp='Pathname for the vendor-supplied manual section 1 pages?'
9083 vendorman1dir="$ans"
9084 vendorman1direxp="$ansexp"
9087 : Use ' ' for none so value is preserved next time through Configure
9088 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9089 prefixvar=vendorman1dir
9092 case "$vendorprefix" in
9093 '') vendorman3dir=''
9096 *) : determine where vendor-supplied module manual pages go.
9097 case "$vendorman3dir" in
9098 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9099 *) dflt=$vendorman3dir ;;
9102 ''|' ') dflt=none ;;
9105 rp='Pathname for the vendor-supplied manual section 3 pages?'
9107 vendorman3dir="$ans"
9108 vendorman3direxp="$ansexp"
9111 : Use ' ' for none so value is preserved next time through Configure
9112 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9113 prefixvar=vendorman3dir
9116 case "$vendorprefix" in
9117 '') d_vendorscript="$undef"
9121 *) d_vendorscript="$define"
9122 : determine where vendor-supplied scripts go.
9123 case "$vendorscript" in
9124 '') dflt=$vendorprefix/script
9125 $test -d $dflt || dflt=$vendorbin ;;
9126 *) dflt="$vendorscript" ;;
9130 The installation process will create a directory for
9131 vendor-supplied scripts.
9135 rp='Pathname for the vendor-supplied scripts directory?'
9138 vendorscriptexp="$ansexp"
9141 prefixvar=vendorscript
9144 : see if qgcvt exists
9150 if $test X"$d_longdbl" = X"$define"; then
9152 echo "Checking how to print long doubles..." >&4
9154 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9155 $cat >try.c <<'EOCP'
9156 #include <sys/types.h>
9160 printf("%.3f\n", d);
9164 if eval $compile; then
9168 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9169 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9170 echo "We will use %f."
9176 if $test X"$sPRIfldbl" = X; then
9177 $cat >try.c <<'EOCP'
9178 #include <sys/types.h>
9181 long double d = 123.456;
9182 printf("%.3Lf\n", d);
9186 if eval $compile; then
9190 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9191 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9192 echo "We will use %Lf."
9198 if $test X"$sPRIfldbl" = X; then
9199 $cat >try.c <<'EOCP'
9200 #include <sys/types.h>
9203 long double d = 123.456;
9204 printf("%.3llf\n", d);
9208 if eval $compile; then
9212 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9213 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9214 echo "We will use %llf."
9220 if $test X"$sPRIfldbl" = X; then
9221 $cat >try.c <<'EOCP'
9222 #include <sys/types.h>
9225 long double d = 123.456;
9226 printf("%.3lf\n", d);
9230 if eval $compile; then
9234 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9235 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9236 echo "We will use %lf."
9242 if $test X"$sPRIfldbl" = X; then
9243 echo "Cannot figure out how to print long doubles." >&4
9245 sSCNfldbl=$sPRIfldbl # expect consistency
9252 case "$sPRIfldbl" in
9253 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9254 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9255 d_SCNfldbl="$undef";
9257 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9258 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9259 d_SCNfldbl="$define";
9263 : Check how to convert floats to strings.
9265 if test "X$d_Gconvert" = X; then
9268 echo "Checking for an efficient way to convert floats to strings."
9270 case "$uselongdouble" in
9271 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9273 case "$d_longdbl" in
9274 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9276 case "$d_PRIgldbl" in
9277 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9281 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9282 char *myname = "gconvert";
9285 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9286 char *myname = "gcvt";
9289 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9290 char *myname = "qgcvt";
9291 #define DOUBLETYPE long double
9294 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9296 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9298 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9301 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9303 char *myname = "sprintf";
9307 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9308 #define DOUBLETYPE long double
9310 #define DOUBLETYPE double
9316 #define I_STDLIB $i_stdlib
9322 checkit(expect, got)
9326 if (strcmp(expect, got)) {
9327 printf("%s oddity: Expected %s, got %s\n",
9328 myname, expect, got);
9338 /* This must be 1st test on (which?) platform */
9339 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9340 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9341 checkit("0.1", buf);
9343 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9344 checkit("0.01", buf);
9346 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9347 checkit("0.001", buf);
9349 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9350 checkit("0.0001", buf);
9352 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9353 if (strlen(buf) > 5)
9354 checkit("9e-005", buf); /* for Microsoft ?? */
9356 checkit("9e-05", buf);
9358 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9361 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9362 checkit("1.1", buf);
9364 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9365 checkit("1.01", buf);
9367 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9368 checkit("1.001", buf);
9370 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9371 checkit("1.0001", buf);
9373 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9374 checkit("1.00001", buf);
9376 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9377 checkit("1.000001", buf);
9379 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9382 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9385 /* Some Linux gcvt's give 1.e+5 here. */
9386 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9387 checkit("100000", buf);
9389 /* Some Linux gcvt's give -1.e+5 here. */
9390 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9391 checkit("-100000", buf);
9393 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9394 checkit("123.456", buf);
9396 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9397 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9398 /* 34 should be enough to scare even long double
9399 * places into using the e notation. */
9400 if (strlen(buf) > 5)
9401 checkit("1e+034", buf); /* for Microsoft */
9403 checkit("1e+34", buf);
9405 /* For Perl, if you add additional tests here, also add them to
9406 * t/base/num.t for benefit of platforms not using Configure or
9407 * overriding d_Gconvert */
9412 : first add preferred functions to our list
9414 for xxx_convert in $gconvert_preference; do
9415 case $xxx_convert in
9416 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9417 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9420 : then add any others
9421 for xxx_convert in gconvert gcvt sprintf; do
9424 *) xxx_list="$xxx_list $xxx_convert" ;;
9428 case "$d_longdbl$uselongdouble" in
9430 : again, add prefered functions to our list first
9432 for xxx_convert in $gconvert_ld_preference; do
9433 case $xxx_convert in
9434 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9435 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9438 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9439 for xxx_convert in qgcvt sprintf $xxx_list; do
9440 case "$xxx_ld_list" in
9441 $xxx_convert*|*" $xxx_convert"*) ;;
9442 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9445 : if sprintf cannot do long doubles, move it to the end
9446 if test "$d_PRIgldbl" != "$define"; then
9447 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9449 : if no qgcvt, remove it
9450 if test "$d_qgcvt" != "$define"; then
9451 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9454 xxx_list="$xxx_ld_list"
9458 for xxx_convert in $xxx_list; do
9459 echo "Trying $xxx_convert..."
9461 set try -DTRY_$xxx_convert
9462 if eval $compile; then
9463 echo "$xxx_convert() found." >&4
9465 echo "I'll use $xxx_convert to convert floats into a string." >&4
9468 echo "...But $xxx_convert didn't work as I expected."
9472 echo "$xxx_convert NOT found." >&4
9476 if test X$xxx_convert = X; then
9477 echo "*** WHOA THERE!!! ***" >&4
9478 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9482 case "$xxx_convert" in
9483 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9484 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9485 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9486 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9487 "$define$define$define")
9488 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9489 "$define$define$undef")
9490 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9491 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9498 : see if _fwalk exists
9502 : Initialize h_fcntl
9505 : Initialize h_sysfile
9508 : access call always available on UNIX
9512 : locate the flags for 'access()'
9516 $cat >access.c <<EOCP
9517 #include <sys/types.h>
9522 #include <sys/file.h>
9535 : check sys/file.h first, no particular reason here
9536 if $test `./findhdr sys/file.h` && \
9537 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9539 echo "<sys/file.h> defines the *_OK access constants." >&4
9540 elif $test `./findhdr fcntl.h` && \
9541 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9543 echo "<fcntl.h> defines the *_OK access constants." >&4
9544 elif $test `./findhdr unistd.h` && \
9545 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9546 echo "<unistd.h> defines the *_OK access constants." >&4
9548 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9554 : see if accessx exists
9555 set accessx d_accessx
9558 : see if aintl exists
9562 : see if alarm exists
9566 : see if POSIX threads are available
9567 set pthread.h i_pthread
9570 : define a fucntion to check prototypes
9571 $cat > protochk <<EOSH
9574 optimize="$optimize"
9576 prototype="$prototype"
9579 usethreads=$usethreads
9580 i_pthread=$i_pthread
9581 pthread_h_first=$pthread_h_first
9584 $cat >> protochk <<'EOSH'
9589 while test $# -ge 2; do
9591 $define) echo "#include <$2>" >> try.c ;;
9592 literal) echo "$2" >> try.c ;;
9594 # Extra magic for the benefit of systems that need pthread.h
9595 # to be included early to correctly detect threadsafe functions.
9596 # Such functions must guarantee themselves, though, that the usethreads
9597 # and i_pthread have been defined, before calling protochk.
9598 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
9599 echo "#include <pthread.h>" >> try.c
9604 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
9605 cat >> try.c <<'EOCP'
9606 #ifdef CAN_PROTOTYPE
9607 #define _(args) args
9612 echo "$foo" >> try.c
9613 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
9614 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
9622 hasproto='varname=$1; func=$2; shift; shift;
9623 while $test $# -ge 2; do
9625 $define) echo "#include <$2>";;
9629 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
9630 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
9631 echo "$func() prototype found.";
9634 echo "$func() prototype NOT found.";
9639 $rm -f try.c tryout.c'
9641 : see if sys/types.h has to be included
9642 set sys/types.h i_systypes
9645 : see if sys/select.h has to be included
9646 set sys/select.h i_sysselct
9649 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
9650 while $test $# -ge 2; do
9652 $define) echo "#include <$2>";;
9656 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
9658 if eval $compile; then
9667 : see if we should include time.h, sys/time.h, or both
9669 if test "X$timeincl" = X; then
9670 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9671 $echo $n "I'm now running the test program...$c"
9673 #include <sys/types.h>
9678 #ifdef SYSTIMEKERNEL
9681 #include <sys/time.h>
9684 #include <sys/select.h>
9697 struct timezone tzp;
9699 if (foo.tm_sec == foo.tm_sec)
9702 if (bar.tv_sec == bar.tv_sec)
9709 for s_timezone in '-DS_TIMEZONE' ''; do
9711 for s_timeval in '-DS_TIMEVAL' ''; do
9712 for i_systimek in '' '-DSYSTIMEKERNEL'; do
9713 for i_time in '' '-DI_TIME'; do
9714 for i_systime in '-DI_SYSTIME' ''; do
9717 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
9718 if eval $compile; then
9719 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
9723 $echo $n "Succeeded with $flags$c"
9735 *SYSTIMEKERNEL*) i_systimek="$define"
9736 timeincl=`./findhdr sys/time.h`
9737 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
9738 *) i_systimek="$undef";;
9741 *I_TIME*) i_time="$define"
9742 timeincl=`./findhdr time.h`" $timeincl"
9743 echo "We'll include <time.h>." >&4;;
9744 *) i_time="$undef";;
9747 *I_SYSTIME*) i_systime="$define"
9748 timeincl=`./findhdr sys/time.h`" $timeincl"
9749 echo "We'll include <sys/time.h>." >&4;;
9750 *) i_systime="$undef";;
9754 : see if struct tm knows about tm_zone
9755 case "$i_systime$i_time" in
9758 echo "Checking to see if your struct tm has tm_zone field..." >&4
9759 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
9767 case "$d_tm_tm_zone" in
9768 "$define") echo "Yes, it does." ;;
9769 *) echo "No, it doesn't." ;;
9771 : see if struct tm knows about tm_gmtoff
9772 case "$i_systime$i_time" in
9775 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
9776 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
9784 case "$d_tm_tm_gmtoff" in
9785 "$define") echo "Yes, it does." ;;
9786 *) echo "No, it doesn't." ;;
9789 : see if asctime_r exists
9790 set asctime_r d_asctime_r
9792 case "$d_asctime_r" in
9794 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
9795 case "$d_asctime_r_proto:$usethreads" in
9796 ":define") d_asctime_r_proto=define
9797 set d_asctime_r_proto asctime_r $hdrs
9801 case "$d_asctime_r_proto" in
9803 case "$asctime_r_proto" in
9804 ''|0) try='char* asctime_r(const struct tm*, char*);'
9805 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SB ;;
9807 case "$asctime_r_proto" in
9808 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
9809 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SBI ;;
9811 case "$asctime_r_proto" in
9812 ''|0) try='int asctime_r(const struct tm*, char*);'
9813 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SB ;;
9815 case "$asctime_r_proto" in
9816 ''|0) try='int asctime_r(const struct tm*, char*, int);'
9817 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SBI ;;
9819 case "$asctime_r_proto" in
9820 ''|0) d_asctime_r=undef
9822 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
9823 * ) case "$asctime_r_proto" in
9824 REENTRANT_PROTO*) ;;
9825 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
9827 echo "Prototype: $try" ;;
9830 *) case "$usethreads" in
9831 define) echo "asctime_r has no prototype, not using it." >&4 ;;
9838 *) asctime_r_proto=0
9842 : see if atolf exists
9846 : see if atoll exists
9850 : Look for GCC-style attribute format
9851 case "$d_attribute_format" in
9854 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
9855 $cat >attrib.c <<'EOCP'
9857 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
9859 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9860 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9861 echo "Your C compiler doesn't support __attribute__((format))."
9864 echo "Your C compiler supports __attribute__((format))."
9868 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9872 *) val="$d_attribute_format" ;;
9874 set d_attribute_format
9878 : Look for GCC-style attribute malloc
9879 case "$d_attribute_malloc" in
9882 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
9883 $cat >attrib.c <<'EOCP'
9885 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
9887 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9888 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9889 echo "Your C compiler doesn't support __attribute__((malloc))."
9892 echo "Your C compiler supports __attribute__((malloc))."
9896 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9900 *) val="$d_attribute_malloc" ;;
9902 set d_attribute_malloc
9906 : Look for GCC-style attribute nonnull
9907 case "$d_attribute_nonnull" in
9910 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
9911 $cat >attrib.c <<'EOCP'
9913 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
9915 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9916 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9917 echo "Your C compiler doesn't support __attribute__((nonnull))."
9920 echo "Your C compiler supports __attribute__((nonnull))."
9924 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9928 *) val="$d_attribute_nonnull" ;;
9930 set d_attribute_nonnull
9934 : Look for GCC-style attribute noreturn
9935 case "$d_attribute_noreturn" in
9938 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
9939 $cat >attrib.c <<'EOCP'
9941 void fall_over_dead( void ) __attribute__((noreturn));
9943 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9944 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9945 echo "Your C compiler doesn't support __attribute__((noreturn))."
9948 echo "Your C compiler supports __attribute__((noreturn))."
9952 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9956 *) val="$d_attribute_noreturn" ;;
9958 set d_attribute_noreturn
9962 : Look for GCC-style attribute pure
9963 case "$d_attribute_pure" in
9966 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
9967 $cat >attrib.c <<'EOCP'
9969 int square( int n ) __attribute__((pure));
9971 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9972 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9973 echo "Your C compiler doesn't support __attribute__((pure))."
9976 echo "Your C compiler supports __attribute__((pure))."
9980 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9984 *) val="$d_attribute_pure" ;;
9986 set d_attribute_pure
9990 : Look for GCC-style attribute unused
9991 case "$d_attribute_unused" in
9994 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
9995 $cat >attrib.c <<'EOCP'
9997 int do_something( int dummy __attribute__((unused)), int n );
9999 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10000 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10001 echo "Your C compiler doesn't support __attribute__((unused))."
10004 echo "Your C compiler supports __attribute__((unused))."
10008 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10012 *) val="$d_attribute_unused" ;;
10014 set d_attribute_unused
10018 : Look for GCC-style attribute warn_unused_result
10019 case "$d_attribute_warn_unused_result" in
10022 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10023 $cat >attrib.c <<'EOCP'
10025 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10027 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10028 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10029 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10032 echo "Your C compiler supports __attribute__((warn_unused_result))."
10036 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10040 *) val="$d_attribute_warn_unused_result" ;;
10042 set d_attribute_warn_unused_result
10046 : see if bcmp exists
10050 : see if bcopy exists
10054 : see if this is a unistd.h system
10055 set unistd.h i_unistd
10058 : see if getpgrp exists
10059 set getpgrp d_getpgrp
10062 case "$d_getpgrp" in
10065 echo "Checking to see which flavor of getpgrp is in use..."
10067 #$i_unistd I_UNISTD
10068 #include <sys/types.h>
10070 # include <unistd.h>
10072 #$i_stdlib I_STDLIB
10074 #include <stdlib.h>
10078 if (getuid() == 0) {
10079 printf("(I see you are running Configure as super-user...)\n");
10082 #ifdef TRY_BSD_PGRP
10083 if (getpgrp(1) == 0)
10092 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10093 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10095 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10096 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10099 echo "I can't seem to compile and run the test program."
10101 xxx="a USG one, i.e. you use getpgrp()."
10103 # SVR4 systems can appear rather BSD-ish.
10104 case "$i_unistd" in
10106 xxx="a BSD one, i.e. you use getpgrp(pid)."
10110 xxx="probably a USG one, i.e. you use getpgrp()."
10115 echo "Assuming your getpgrp is $xxx" >&4
10124 : see if setpgrp exists
10125 set setpgrp d_setpgrp
10128 case "$d_setpgrp" in
10131 echo "Checking to see which flavor of setpgrp is in use..."
10133 #$i_unistd I_UNISTD
10134 #include <sys/types.h>
10136 # include <unistd.h>
10138 #$i_stdlib I_STDLIB
10140 #include <stdlib.h>
10144 if (getuid() == 0) {
10145 printf("(I see you are running Configure as super-user...)\n");
10148 #ifdef TRY_BSD_PGRP
10149 if (-1 == setpgrp(1, 1))
10152 if (setpgrp() != -1)
10158 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10159 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10161 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10162 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10165 echo "(I can't seem to compile and run the test program.)"
10167 xxx="a USG one, i.e. you use setpgrp()."
10169 # SVR4 systems can appear rather BSD-ish.
10170 case "$i_unistd" in
10172 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10176 xxx="probably a USG one, i.e. you use setpgrp()."
10181 echo "Assuming your setpgrp is $xxx" >&4
10189 : Look for GCC-style __builtin_choose_expr
10190 case "$d_builtin_choose_expr" in
10193 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10194 $cat >try.c <<'EOCP'
10195 #include <assert.h>
10196 #include <stdlib.h>
10199 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10202 assert( SYRINX(1) == 2112 );
10203 assert( SYRINX(1) != 5150 );
10204 assert( SYRINX(0) == 5150 );
10205 assert( SYRINX(0) != 2112 );
10206 puts( "All good!" );
10212 if eval $compile; then
10213 echo "Your C compiler supports __builtin_choose_expr."
10216 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10220 *) val="$d_builtin_choose_expr" ;;
10223 set d_builtin_choose_expr
10225 $rm -f try.* try core core.try.*
10227 : Look for GCC-style __builtin_expect
10228 case "$d_builtin_expect" in
10231 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10232 $cat >builtin.c <<'EOCP'
10235 if ( __builtin_expect(n, 0) ) n = 1;
10239 if eval $compile; then
10240 echo "Your C compiler supports __builtin_choose_expr."
10243 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10247 *) val="$d_builtin_expect" ;;
10250 set d_builtin_expect
10252 $rm -f try.* try core core.try.*
10254 : see if bzero exists
10258 : see if signal is declared as pointer to function returning int or void
10260 xxx=`./findhdr signal.h`
10261 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10262 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10263 echo "You have int (*signal())() instead of void." >&4
10265 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10266 echo "You have void (*signal())()." >&4
10268 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10269 echo "You have int (*signal())() instead of void." >&4
10271 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10272 echo "You have void (*signal())()." >&4
10275 case "$d_voidsig" in
10277 echo "I can't determine whether signal handler returns void or int..." >&4
10279 rp="What type does your signal handler return?"
10282 v*) val="$define";;
10286 echo "As you already told me, signal handler returns void." >&4
10289 *) echo "As you already told me, signal handler returns int." >&4
10296 case "$d_voidsig" in
10297 "$define") signal_t="void";;
10298 *) signal_t="int";;
10302 : check for ability to cast large floats to 32-bit ints.
10304 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10305 if $test "$intsize" -ge 4; then
10312 #$i_stdlib I_STDLIB
10314 #include <stdlib.h>
10316 #include <sys/types.h>
10317 #include <signal.h>
10318 $signal_t blech(s) int s; { exit(3); }
10325 signal(SIGFPE, blech);
10327 /* Don't let compiler optimize the test away. Store the number
10328 in a writable string for gcc to pass to sscanf under HP/UX.
10330 sprintf(str, "2147483647");
10331 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
10335 /* x86 processors will probably give 0x8000 0000, which is a
10336 sign change. We don't want that. We want to mimic SPARC
10337 behavior here, which is to preserve the sign and give
10340 if (i32 != ($xxx) f)
10346 if eval $compile_ok; then
10350 echo "(I can't seem to compile the test program--assuming it can't)"
10355 echo "Yup, it can."
10358 echo "Nope, it can't."
10365 : check for ability to cast negative floats to unsigned
10367 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
10370 #$i_stdlib I_STDLIB
10372 #include <stdlib.h>
10374 #include <sys/types.h>
10375 #include <signal.h>
10376 $signal_t blech(s) int s; { exit(7); }
10377 $signal_t blech_in_list(s) int s; { exit(4); }
10378 unsigned long dummy_long(p) unsigned long p; { return p; }
10379 unsigned int dummy_int(p) unsigned int p; { return p; }
10380 unsigned short dummy_short(p) unsigned short p; { return p; }
10384 unsigned long along;
10386 unsigned short ashort;
10390 /* Frustrate gcc-2.7.2's optimizer which failed this test with
10391 a direct f = -123. assignment. gcc-2.8.0 reportedly
10392 optimized the whole file away
10394 /* Store the number in a writable string for gcc to pass to
10395 sscanf under HP/UX.
10397 sprintf(str, "-123");
10398 sscanf(str, "%lf", &f); /* f = -123.; */
10400 signal(SIGFPE, blech);
10401 along = (unsigned long)f;
10402 aint = (unsigned int)f;
10403 ashort = (unsigned short)f;
10404 if (along != (unsigned long)-123)
10406 if (aint != (unsigned int)-123)
10408 if (ashort != (unsigned short)-123)
10410 sprintf(str, "1073741824.");
10411 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
10414 along = (unsigned long)f;
10415 if (along != 0x80000000)
10419 along = (unsigned long)f;
10420 if (along != 0x7fffffff)
10424 along = (unsigned long)f;
10425 if (along != 0x80000001)
10429 signal(SIGFPE, blech_in_list);
10430 sprintf(str, "123.");
10431 sscanf(str, "%lf", &f); /* f = 123.; */
10432 along = dummy_long((unsigned long)f);
10433 aint = dummy_int((unsigned int)f);
10434 ashort = dummy_short((unsigned short)f);
10435 if (along != (unsigned long)123)
10437 if (aint != (unsigned int)123)
10439 if (ashort != (unsigned short)123)
10446 if eval $compile_ok; then
10450 echo "(I can't seem to compile the test program--assuming it can't)"
10453 case "$castflags" in
10455 echo "Yup, it can."
10458 echo "Nope, it can't."
10465 : see if vprintf exists
10467 if set vprintf val -f d_vprintf; eval $csym; $val; then
10468 echo 'vprintf() found.' >&4
10471 #include <varargs.h>
10472 #$i_stdlib I_STDLIB
10474 #include <stdlib.h>
10477 int main() { xxx("foo"); }
10486 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
10490 if eval $compile && $run ./try; then
10491 echo "Your vsprintf() returns (int)." >&4
10494 echo "Your vsprintf() returns (char*)." >&4
10498 echo 'vprintf() NOT found.' >&4
10509 : see if chown exists
10513 : see if chroot exists
10514 set chroot d_chroot
10517 : see if chsize exists
10518 set chsize d_chsize
10521 : see if class exists
10525 : see if clearenv exists
10526 set clearenv d_clearenv
10529 hasstruct='varname=$1; struct=$2; shift; shift;
10530 while $test $# -ge 2; do
10532 $define) echo "#include <$2>";;
10536 echo "int main () { struct $struct foo; }" >> try.c;
10538 if eval $compile; then
10545 $rm -f try.c try.o'
10549 : see whether socket exists
10551 $echo $n "Hmm... $c" >&4
10552 if set socket val -f d_socket; eval $csym; $val; then
10553 echo "Looks like you have Berkeley networking support." >&4
10555 if set setsockopt val -f; eval $csym; $val; then
10558 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
10559 d_oldsock="$define"
10562 if $contains socklib libc.list >/dev/null 2>&1; then
10563 echo "Looks like you have Berkeley networking support." >&4
10565 : we will have to assume that it supports the 4.2 BSD interface
10568 echo "You don't have Berkeley networking in libc$_a..." >&4
10569 if test "X$d_socket" = "X$define"; then
10570 echo "...but you seem to believe that you have sockets." >&4
10572 for net in net socket
10574 if test -f /usr/lib/lib$net$_a; then
10575 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
10576 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
10577 if $contains socket libc.list >/dev/null 2>&1; then
10582 echo "...but the Wollongong group seems to have hacked it in." >&4
10583 sockethdr="-I/usr/netinclude"
10586 echo "Found Berkeley sockets interface in lib$net." >&4
10587 if $contains setsockopt libc.list >/dev/null 2>&1; then
10590 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
10591 d_oldsock="$define"
10597 if test "X$d_socket" != "X$define"; then
10598 echo "or anywhere else I see." >&4
10606 : see if socketpair exists
10607 set socketpair d_sockpair
10612 echo "Checking the availability of certain socket constants..." >&4
10613 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
10614 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
10616 #include <sys/types.h>
10617 #include <sys/socket.h>
10623 set try; if eval $compile; then
10626 set d_${enum}; eval $setvar
10630 : see if this is a sys/uio.h system
10631 set sys/uio.h i_sysuio
10636 echo "Checking to see if your system supports struct cmsghdr..." >&4
10637 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
10639 case "$d_cmsghdr_s" in
10640 "$define") echo "Yes, it does." ;;
10641 *) echo "No, it doesn't." ;;
10645 : check for const keyword
10647 echo 'Checking to see if your C compiler knows about "const"...' >&4
10648 $cat >const.c <<'EOCP'
10649 typedef struct spug { int drokk; } spug;
10656 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
10658 echo "Yup, it does."
10661 echo "Nope, it doesn't."
10666 : see if copysignl exists
10667 set copysignl d_copysignl
10670 : see if crypt exists
10675 $define) cryptlib='' ;;
10676 *) if set crypt val -f d_crypt; eval $csym; $val; then
10677 echo 'crypt() found.' >&4
10681 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
10682 if $test -z "$cryptlib"; then
10683 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
10687 if $test -z "$cryptlib"; then
10688 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
10692 if $test -z "$cryptlib"; then
10693 cryptlib=`./loc libcrypt$_a "" $libpth`
10697 if $test -z "$cryptlib"; then
10698 echo 'crypt() NOT found.' >&4
10709 : see if this is a crypt.h system
10710 set crypt.h i_crypt
10713 : see if crypt_r exists
10714 set crypt_r d_crypt_r
10716 case "$d_crypt_r" in
10718 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
10719 case "$d_crypt_r_proto:$usethreads" in
10720 ":define") d_crypt_r_proto=define
10721 set d_crypt_r_proto crypt_r $hdrs
10725 case "$d_crypt_r_proto" in
10727 case "$crypt_r_proto" in
10728 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
10729 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCS ;;
10731 case "$crypt_r_proto" in
10732 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
10733 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCD ;;
10735 case "$crypt_r_proto" in
10736 ''|0) d_crypt_r=undef
10738 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
10739 * ) case "$crypt_r_proto" in
10740 REENTRANT_PROTO*) ;;
10741 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
10743 echo "Prototype: $try" ;;
10746 *) case "$usethreads" in
10747 define) echo "crypt_r has no prototype, not using it." >&4 ;;
10758 : get csh whereabouts
10760 'csh') val="$undef" ;;
10761 *) val="$define" ;;
10765 : Respect a hint or command line value for full_csh.
10766 case "$full_csh" in
10767 '') full_csh=$csh ;;
10770 : see if ctermid_r exists
10771 set ctermid_r d_ctermid_r
10773 case "$d_ctermid_r" in
10775 hdrs="$i_systypes sys/types.h define stdio.h "
10776 case "$d_ctermid_r_proto:$usethreads" in
10777 ":define") d_ctermid_r_proto=define
10778 set d_ctermid_r_proto ctermid_r $hdrs
10782 case "$d_ctermid_r_proto" in
10784 case "$ctermid_r_proto" in
10785 ''|0) try='char* ctermid_r(char*);'
10786 ./protochk "extern $try" $hdrs && ctermid_r_proto=B_B ;;
10788 case "$ctermid_r_proto" in
10789 ''|0) d_ctermid_r=undef
10791 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
10792 * ) case "$ctermid_r_proto" in
10793 REENTRANT_PROTO*) ;;
10794 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
10796 echo "Prototype: $try" ;;
10799 *) case "$usethreads" in
10800 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
10807 *) ctermid_r_proto=0
10811 : see if ctime_r exists
10812 set ctime_r d_ctime_r
10814 case "$d_ctime_r" in
10816 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10817 case "$d_ctime_r_proto:$usethreads" in
10818 ":define") d_ctime_r_proto=define
10819 set d_ctime_r_proto ctime_r $hdrs
10823 case "$d_ctime_r_proto" in
10825 case "$ctime_r_proto" in
10826 ''|0) try='char* ctime_r(const time_t*, char*);'
10827 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SB ;;
10829 case "$ctime_r_proto" in
10830 ''|0) try='char* ctime_r(const time_t*, char*, int);'
10831 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SBI ;;
10833 case "$ctime_r_proto" in
10834 ''|0) try='int ctime_r(const time_t*, char*);'
10835 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SB ;;
10837 case "$ctime_r_proto" in
10838 ''|0) try='int ctime_r(const time_t*, char*, int);'
10839 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SBI ;;
10841 case "$ctime_r_proto" in
10842 ''|0) d_ctime_r=undef
10844 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
10845 * ) case "$ctime_r_proto" in
10846 REENTRANT_PROTO*) ;;
10847 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
10849 echo "Prototype: $try" ;;
10852 *) case "$usethreads" in
10853 define) echo "ctime_r has no prototype, not using it." >&4 ;;
10864 : see if cuserid exists
10865 set cuserid d_cuserid
10868 : see if this is a limits.h system
10869 set limits.h i_limits
10872 : see if this is a float.h system
10873 set float.h i_float
10876 : See if number of significant digits in a double precision number is known
10878 $cat >dbl_dig.c <<EOM
10879 #$i_limits I_LIMITS
10882 #include <limits.h>
10888 printf("Contains DBL_DIG");
10891 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
10892 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
10893 echo "DBL_DIG found." >&4
10896 echo "DBL_DIG NOT found." >&4
10903 : see if dbm.h is available
10904 : see if dbmclose exists
10905 set dbmclose d_dbmclose
10908 case "$d_dbmclose" in
10918 *) set rpcsvc/dbm.h i_rpcsvcdbm
10923 *) echo "We won't be including <dbm.h>"
10933 : see if prototype for dbminit is available
10935 set d_dbminitproto dbminit $i_dbm dbm.h
10938 : see if difftime exists
10939 set difftime d_difftime
10942 : see if this is a dirent system
10944 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
10946 echo "<dirent.h> found." >&4
10949 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
10950 echo "<sys/dir.h> found." >&4
10953 xinc=`./findhdr sys/ndir.h`
10955 echo "<dirent.h> NOT found." >&4
10960 : Look for type of directory structure.
10962 $cppstdin $cppflags $cppminus < "$xinc" > try.c
10964 case "$direntrytype" in
10966 case "$i_dirent" in
10967 $define) guess1='struct dirent' ;;
10968 *) guess1='struct direct' ;;
10971 *) guess1="$direntrytype"
10976 'struct dirent') guess2='struct direct' ;;
10977 *) guess2='struct dirent' ;;
10980 if $contains "$guess1" try.c >/dev/null 2>&1; then
10981 direntrytype="$guess1"
10982 echo "Your directory entries are $direntrytype." >&4
10983 elif $contains "$guess2" try.c >/dev/null 2>&1; then
10984 direntrytype="$guess2"
10985 echo "Your directory entries seem to be $direntrytype." >&4
10987 echo "I don't recognize your system's directory entries." >&4
10988 rp="What type is used for directory entries on this system?"
10991 direntrytype="$ans"
10996 : see if the directory entry stores field length
10998 $cppstdin $cppflags $cppminus < "$xinc" > try.c
10999 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
11000 echo "Good, your directory entry keeps length information in d_namlen." >&4
11003 echo "Your directory entry does not know about the d_namlen field." >&4
11010 : see if this is an sysdir system
11011 set sys/dir.h i_sysdir
11014 : see if this is an sysndir system
11015 set sys/ndir.h i_sysndir
11020 $cat >dirfd.c <<EOM
11022 #$i_stdlib I_STDLIB
11024 #include <stdlib.h>
11026 #$i_dirent I_DIRENT /**/
11027 #$i_sysdir I_SYS_DIR /**/
11028 #$i_sysndir I_SYS_NDIR /**/
11029 #$i_systypes I_SYS_TYPES /**/
11030 #if defined(I_SYS_TYPES)
11031 #include <sys/types.h>
11033 #if defined(I_DIRENT)
11034 #include <dirent.h>
11035 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11036 #include <sys/dir.h>
11040 #include <sys/ndir.h>
11044 #include <ndir.h> /* may be wrong in the future */
11046 #include <sys/dir.h>
11052 DIR *dirp = opendir(".");
11053 if (dirfd(dirp) >= 0)
11061 if eval $compile; then
11065 $define) echo "dirfd() found." >&4 ;;
11066 *) echo "dirfd() NOT found." >&4 ;;
11072 : see if dlerror exists
11075 set dlerror d_dlerror
11079 : see if dlfcn is available
11080 set dlfcn.h i_dlfcn
11087 On a few systems, the dynamically loaded modules that perl generates and uses
11088 will need a different extension than shared libs. The default will probably
11094 *) dflt="$dlext" ;;
11096 rp='What is the extension of dynamically loaded modules'
11105 : Check if dlsym need a leading underscore
11111 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11112 $cat >dyna.c <<'EOM'
11119 #$i_stdlib I_STDLIB
11121 #include <stdlib.h>
11125 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
11127 #include <sys/types.h>
11132 extern int fred() ;
11141 int mode = RTLD_LAZY ;
11143 handle = dlopen("./dyna.$dlext", mode) ;
11144 if (handle == NULL) {
11149 symbol = dlsym(handle, "fred") ;
11150 if (symbol == NULL) {
11151 /* try putting a leading underscore */
11152 symbol = dlsym(handle, "_fred") ;
11153 if (symbol == NULL) {
11166 : Call the object file tmp-dyna.o in case dlext=o.
11167 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
11168 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
11169 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
11170 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
11173 1) echo "Test program failed using dlopen." >&4
11174 echo "Perhaps you should not use dynamic loading." >&4;;
11175 2) echo "Test program failed using dlsym." >&4
11176 echo "Perhaps you should not use dynamic loading." >&4;;
11177 3) echo "dlsym needs a leading underscore" >&4
11179 4) echo "dlsym doesn't need a leading underscore." >&4;;
11182 echo "I can't compile and run the test program." >&4
11183 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
11188 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
11193 : see if drand48_r exists
11194 set drand48_r d_drand48_r
11196 case "$d_drand48_r" in
11198 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
11199 case "$d_drand48_r_proto:$usethreads" in
11200 ":define") d_drand48_r_proto=define
11201 set d_drand48_r_proto drand48_r $hdrs
11205 case "$d_drand48_r_proto" in
11207 case "$drand48_r_proto" in
11208 ''|0) try='int drand48_r(struct drand48_data*, double*);'
11209 ./protochk "extern $try" $hdrs && drand48_r_proto=I_ST ;;
11211 case "$drand48_r_proto" in
11212 ''|0) d_drand48_r=undef
11214 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
11215 * ) case "$drand48_r_proto" in
11216 REENTRANT_PROTO*) ;;
11217 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
11219 echo "Prototype: $try" ;;
11222 *) case "$usethreads" in
11223 define) echo "drand48_r has no prototype, not using it." >&4 ;;
11230 *) drand48_r_proto=0
11234 : see if prototype for drand48 is available
11236 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
11239 : see if dup2 exists
11243 : see if eaccess exists
11244 set eaccess d_eaccess
11247 : see if endgrent exists
11248 set endgrent d_endgrent
11251 : see if this is an grp system
11257 xxx=`./findhdr grp.h`
11258 $cppstdin $cppflags $cppminus < $xxx >$$.h
11260 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
11272 set d_grpasswd; eval $setvar
11276 : see if endgrent_r exists
11277 set endgrent_r d_endgrent_r
11279 case "$d_endgrent_r" in
11281 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11282 case "$d_endgrent_r_proto:$usethreads" in
11283 ":define") d_endgrent_r_proto=define
11284 set d_endgrent_r_proto endgrent_r $hdrs
11288 case "$d_endgrent_r_proto" in
11290 case "$endgrent_r_proto" in
11291 ''|0) try='int endgrent_r(FILE**);'
11292 ./protochk "extern $try" $hdrs && endgrent_r_proto=I_H ;;
11294 case "$endgrent_r_proto" in
11295 ''|0) try='void endgrent_r(FILE**);'
11296 ./protochk "extern $try" $hdrs && endgrent_r_proto=V_H ;;
11298 case "$endgrent_r_proto" in
11299 ''|0) d_endgrent_r=undef
11301 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
11302 * ) case "$endgrent_r_proto" in
11303 REENTRANT_PROTO*) ;;
11304 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
11306 echo "Prototype: $try" ;;
11309 *) case "$usethreads" in
11310 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
11317 *) endgrent_r_proto=0
11321 : see if endhostent exists
11322 set endhostent d_endhent
11325 : see if this is a netdb.h system
11326 set netdb.h i_netdb
11329 : see if endhostent_r exists
11330 set endhostent_r d_endhostent_r
11332 case "$d_endhostent_r" in
11334 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11335 case "$d_endhostent_r_proto:$usethreads" in
11336 ":define") d_endhostent_r_proto=define
11337 set d_endhostent_r_proto endhostent_r $hdrs
11341 case "$d_endhostent_r_proto" in
11343 case "$endhostent_r_proto" in
11344 ''|0) try='int endhostent_r(struct hostent_data*);'
11345 ./protochk "extern $try" $hdrs && endhostent_r_proto=I_D ;;
11347 case "$endhostent_r_proto" in
11348 ''|0) try='void endhostent_r(struct hostent_data*);'
11349 ./protochk "extern $try" $hdrs && endhostent_r_proto=V_D ;;
11351 case "$endhostent_r_proto" in
11352 ''|0) d_endhostent_r=undef
11353 endhostent_r_proto=0
11354 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
11355 * ) case "$endhostent_r_proto" in
11356 REENTRANT_PROTO*) ;;
11357 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
11359 echo "Prototype: $try" ;;
11362 *) case "$usethreads" in
11363 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
11365 d_endhostent_r=undef
11366 endhostent_r_proto=0
11370 *) endhostent_r_proto=0
11374 : see if endnetent exists
11375 set endnetent d_endnent
11378 : see if endnetent_r exists
11379 set endnetent_r d_endnetent_r
11381 case "$d_endnetent_r" in
11383 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11384 case "$d_endnetent_r_proto:$usethreads" in
11385 ":define") d_endnetent_r_proto=define
11386 set d_endnetent_r_proto endnetent_r $hdrs
11390 case "$d_endnetent_r_proto" in
11392 case "$endnetent_r_proto" in
11393 ''|0) try='int endnetent_r(struct netent_data*);'
11394 ./protochk "extern $try" $hdrs && endnetent_r_proto=I_D ;;
11396 case "$endnetent_r_proto" in
11397 ''|0) try='void endnetent_r(struct netent_data*);'
11398 ./protochk "extern $try" $hdrs && endnetent_r_proto=V_D ;;
11400 case "$endnetent_r_proto" in
11401 ''|0) d_endnetent_r=undef
11402 endnetent_r_proto=0
11403 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
11404 * ) case "$endnetent_r_proto" in
11405 REENTRANT_PROTO*) ;;
11406 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
11408 echo "Prototype: $try" ;;
11411 *) case "$usethreads" in
11412 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
11414 d_endnetent_r=undef
11415 endnetent_r_proto=0
11419 *) endnetent_r_proto=0
11423 : see if endprotoent exists
11424 set endprotoent d_endpent
11427 : see if endprotoent_r exists
11428 set endprotoent_r d_endprotoent_r
11430 case "$d_endprotoent_r" in
11432 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11433 case "$d_endprotoent_r_proto:$usethreads" in
11434 ":define") d_endprotoent_r_proto=define
11435 set d_endprotoent_r_proto endprotoent_r $hdrs
11439 case "$d_endprotoent_r_proto" in
11441 case "$endprotoent_r_proto" in
11442 ''|0) try='int endprotoent_r(struct protoent_data*);'
11443 ./protochk "extern $try" $hdrs && endprotoent_r_proto=I_D ;;
11445 case "$endprotoent_r_proto" in
11446 ''|0) try='void endprotoent_r(struct protoent_data*);'
11447 ./protochk "extern $try" $hdrs && endprotoent_r_proto=V_D ;;
11449 case "$endprotoent_r_proto" in
11450 ''|0) d_endprotoent_r=undef
11451 endprotoent_r_proto=0
11452 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
11453 * ) case "$endprotoent_r_proto" in
11454 REENTRANT_PROTO*) ;;
11455 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
11457 echo "Prototype: $try" ;;
11460 *) case "$usethreads" in
11461 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
11463 d_endprotoent_r=undef
11464 endprotoent_r_proto=0
11468 *) endprotoent_r_proto=0
11472 : see if endpwent exists
11473 set endpwent d_endpwent
11476 : see if this is a pwd.h system
11482 xxx=`./findhdr pwd.h`
11483 $cppstdin $cppflags $cppminus < $xxx >$$.h
11485 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
11493 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
11501 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
11509 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
11517 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
11525 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
11533 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
11541 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
11553 set d_pwquota; eval $setvar
11554 set d_pwage; eval $setvar
11555 set d_pwchange; eval $setvar
11556 set d_pwclass; eval $setvar
11557 set d_pwexpire; eval $setvar
11558 set d_pwcomment; eval $setvar
11559 set d_pwgecos; eval $setvar
11560 set d_pwpasswd; eval $setvar
11564 : see if endpwent_r exists
11565 set endpwent_r d_endpwent_r
11567 case "$d_endpwent_r" in
11569 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
11570 case "$d_endpwent_r_proto:$usethreads" in
11571 ":define") d_endpwent_r_proto=define
11572 set d_endpwent_r_proto endpwent_r $hdrs
11576 case "$d_endpwent_r_proto" in
11578 case "$endpwent_r_proto" in
11579 ''|0) try='int endpwent_r(FILE**);'
11580 ./protochk "extern $try" $hdrs && endpwent_r_proto=I_H ;;
11582 case "$endpwent_r_proto" in
11583 ''|0) try='void endpwent_r(FILE**);'
11584 ./protochk "extern $try" $hdrs && endpwent_r_proto=V_H ;;
11586 case "$endpwent_r_proto" in
11587 ''|0) d_endpwent_r=undef
11589 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
11590 * ) case "$endpwent_r_proto" in
11591 REENTRANT_PROTO*) ;;
11592 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
11594 echo "Prototype: $try" ;;
11597 *) case "$usethreads" in
11598 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
11605 *) endpwent_r_proto=0
11609 : see if endservent exists
11610 set endservent d_endsent
11613 : see if endservent_r exists
11614 set endservent_r d_endservent_r
11616 case "$d_endservent_r" in
11618 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11619 case "$d_endservent_r_proto:$usethreads" in
11620 ":define") d_endservent_r_proto=define
11621 set d_endservent_r_proto endservent_r $hdrs
11625 case "$d_endservent_r_proto" in
11627 case "$endservent_r_proto" in
11628 ''|0) try='int endservent_r(struct servent_data*);'
11629 ./protochk "extern $try" $hdrs && endservent_r_proto=I_D ;;
11631 case "$endservent_r_proto" in
11632 ''|0) try='void endservent_r(struct servent_data*);'
11633 ./protochk "extern $try" $hdrs && endservent_r_proto=V_D ;;
11635 case "$endservent_r_proto" in
11636 ''|0) d_endservent_r=undef
11637 endservent_r_proto=0
11638 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
11639 * ) case "$endservent_r_proto" in
11640 REENTRANT_PROTO*) ;;
11641 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
11643 echo "Prototype: $try" ;;
11646 *) case "$usethreads" in
11647 define) echo "endservent_r has no prototype, not using it." >&4 ;;
11649 d_endservent_r=undef
11650 endservent_r_proto=0
11654 *) endservent_r_proto=0
11658 : Locate the flags for 'open()'
11661 #include <sys/types.h>
11666 #include <sys/file.h>
11668 #$i_stdlib I_STDLIB
11670 #include <stdlib.h>
11681 : check sys/file.h first to get FREAD on Sun
11682 if $test `./findhdr sys/file.h` && \
11683 set try -DI_SYS_FILE && eval $compile; then
11685 echo "<sys/file.h> defines the O_* constants..." >&4
11686 if $run ./try; then
11687 echo "and you have the 3 argument form of open()." >&4
11690 echo "but not the 3 argument form of open(). Oh, well." >&4
11693 elif $test `./findhdr fcntl.h` && \
11694 set try -DI_FCNTL && eval $compile; then
11696 echo "<fcntl.h> defines the O_* constants..." >&4
11697 if $run ./try; then
11698 echo "and you have the 3 argument form of open()." >&4
11701 echo "but not the 3 argument form of open(). Oh, well." >&4
11706 echo "I can't find the O_* constant definitions! You got problems." >&4
11712 : see which of string.h or strings.h is needed
11714 strings=`./findhdr string.h`
11715 if $test "$strings" && $test -r "$strings"; then
11716 echo "Using <string.h> instead of <strings.h>." >&4
11720 strings=`./findhdr strings.h`
11721 if $test "$strings" && $test -r "$strings"; then
11722 echo "Using <strings.h> instead of <string.h>." >&4
11724 echo "No string header found -- You'll surely have problems." >&4
11729 case "$i_string" in
11730 "$undef") strings=`./findhdr strings.h`;;
11731 *) strings=`./findhdr string.h`;;
11734 : see if this is a sys/file.h system
11739 : do we need to include sys/file.h ?
11743 if $h_sysfile; then
11745 echo "We'll be including <sys/file.h>." >&4
11748 echo "We won't be including <sys/file.h>." >&4
11758 : see if fcntl.h is there
11763 : see if we can include fcntl.h
11769 echo "We'll be including <fcntl.h>." >&4
11772 if $h_sysfile; then
11773 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
11775 echo "We won't be including <fcntl.h>." >&4
11787 : check for non-blocking I/O stuff
11788 case "$h_sysfile" in
11789 true) echo "#include <sys/file.h>" > head.c;;
11792 true) echo "#include <fcntl.h>" > head.c;;
11793 *) echo "#include <sys/fcntl.h>" > head.c;;
11798 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
11799 case "$o_nonblock" in
11801 $cat head.c > try.c
11802 $cat >>try.c <<EOCP
11804 #$i_stdlib I_STDLIB
11806 #include <stdlib.h>
11814 printf("O_NONBLOCK\n");
11818 printf("O_NDELAY\n");
11822 printf("FNDELAY\n");
11829 if eval $compile_ok; then
11830 o_nonblock=`$run ./try`
11831 case "$o_nonblock" in
11832 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
11833 *) echo "Seems like we can use $o_nonblock.";;
11836 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
11839 *) echo "Using $hint value $o_nonblock.";;
11841 $rm -f try try.* .out core
11844 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
11847 $cat head.c > try.c
11848 $cat >>try.c <<EOCP
11850 #include <sys/types.h>
11851 #include <signal.h>
11853 #$i_stdlib I_STDLIB
11855 #include <stdlib.h>
11861 #define MY_O_NONBLOCK $o_nonblock
11862 #ifndef errno /* XXX need better Configure test */
11865 #$i_unistd I_UNISTD
11867 #include <unistd.h>
11869 #$i_string I_STRING
11871 #include <string.h>
11873 #include <strings.h>
11875 $signal_t blech(x) int x; { exit(3); }
11877 $cat >> try.c <<'EOCP'
11885 pipe(pd); /* Down: child -> parent */
11886 pipe(pu); /* Up: parent -> child */
11889 close(pd[1]); /* Parent reads from pd[0] */
11890 close(pu[0]); /* Parent writes (blocking) to pu[1] */
11892 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
11897 signal(SIGALRM, blech);
11899 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
11901 sprintf(string, "%d\n", ret);
11902 write(2, string, strlen(string));
11905 if (errno == EAGAIN) {
11906 printf("EAGAIN\n");
11911 if (errno == EWOULDBLOCK)
11912 printf("EWOULDBLOCK\n");
11915 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
11916 sleep(2); /* Give it time to close our pipe */
11918 ret = read(pd[0], buf, 1); /* Should read EOF */
11920 sprintf(string, "%d\n", ret);
11921 write(4, string, strlen(string));
11925 close(pd[0]); /* We write to pd[1] */
11926 close(pu[1]); /* We read from pu[0] */
11927 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
11928 close(pd[1]); /* Pipe pd is now fully closed! */
11929 exit(0); /* Bye bye, thank you for playing! */
11933 if eval $compile_ok; then
11934 echo "$startsh" >mtry
11935 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
11937 ./mtry >/dev/null 2>&1
11939 0) eagain=`$cat try.out`;;
11940 1) echo "Could not perform non-blocking setting!";;
11941 2) echo "I did a successful read() for something that was not there!";;
11942 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
11943 4) echo "Could not find F_SETFL!";;
11944 *) echo "Something terribly wrong happened during testing.";;
11946 rd_nodata=`$cat try.ret`
11947 echo "A read() system call with no data present returns $rd_nodata."
11948 case "$rd_nodata" in
11951 echo "(That's peculiar, fixing that to be -1.)"
11957 echo "Forcing errno EAGAIN on read() with no data available."
11961 echo "Your read() sets errno to $eagain when no data is available."
11964 status=`$cat try.err`
11966 0) echo "And it correctly returns 0 to signal EOF.";;
11967 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
11968 *) echo "However, your read() returns '$status' on EOF??";;
11971 if test "$status" = "$rd_nodata"; then
11972 echo "WARNING: you can't distinguish between EOF and no data!"
11976 echo "I can't compile the test program--assuming errno EAGAIN will do."
11983 echo "Using $hint value $eagain."
11984 echo "Your read() returns $rd_nodata when no data is present."
11985 case "$d_eofnblk" in
11986 "$define") echo "And you can see EOF because read() returns 0.";;
11987 "$undef") echo "But you can't see EOF status from read() returned value.";;
11989 echo "(Assuming you can't see EOF status from read anyway.)"
11995 $rm -f try try.* .out core head.c mtry
11997 : see if _ptr and _cnt from stdio act std
12000 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12001 echo "(Looks like you have stdio.h from BSD.)"
12002 case "$stdio_ptr" in
12003 '') stdio_ptr='((fp)->_p)'
12006 *) ptr_lval=$d_stdio_ptr_lval;;
12008 case "$stdio_cnt" in
12009 '') stdio_cnt='((fp)->_r)'
12012 *) cnt_lval=$d_stdio_cnt_lval;;
12014 case "$stdio_base" in
12015 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12017 case "$stdio_bufsiz" in
12018 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12020 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12021 echo "(Looks like you have stdio.h from Linux.)"
12022 case "$stdio_ptr" in
12023 '') stdio_ptr='((fp)->_IO_read_ptr)'
12026 *) ptr_lval=$d_stdio_ptr_lval;;
12028 case "$stdio_cnt" in
12029 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12032 *) cnt_lval=$d_stdio_cnt_lval;;
12034 case "$stdio_base" in
12035 '') stdio_base='((fp)->_IO_read_base)';;
12037 case "$stdio_bufsiz" in
12038 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12041 case "$stdio_ptr" in
12042 '') stdio_ptr='((fp)->_ptr)'
12045 *) ptr_lval=$d_stdio_ptr_lval;;
12047 case "$stdio_cnt" in
12048 '') stdio_cnt='((fp)->_cnt)'
12051 *) cnt_lval=$d_stdio_cnt_lval;;
12053 case "$stdio_base" in
12054 '') stdio_base='((fp)->_base)';;
12056 case "$stdio_bufsiz" in
12057 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12061 : test whether _ptr and _cnt really work
12062 echo "Checking how std your stdio is..." >&4
12065 #$i_stdlib I_STDLIB
12067 #include <stdlib.h>
12069 #define FILE_ptr(fp) $stdio_ptr
12070 #define FILE_cnt(fp) $stdio_cnt
12072 FILE *fp = fopen("try.c", "r");
12075 18 <= FILE_cnt(fp) &&
12076 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12084 if eval $compile && $to try.c; then
12085 if $run ./try; then
12086 echo "Your stdio acts pretty std."
12089 echo "Your stdio isn't very std."
12092 echo "Your stdio doesn't appear very std."
12096 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12097 # direct buffer manipulation no longer works. The Configure tests
12098 # should be changed to correctly detect this, but until then,
12099 # the following check should at least let perl compile and run.
12100 # (This quick fix should be updated before 5.8.1.)
12101 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12102 # A. Dougherty, June 3, 2002.
12103 case "$d_gnulibc" in
12105 case "$gnulibc_version" in
12109 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12118 : Can _ptr be used as an lvalue?
12119 case "$d_stdstdio$ptr_lval" in
12120 $define$define) val=$define ;;
12123 set d_stdio_ptr_lval
12126 : Can _cnt be used as an lvalue?
12127 case "$d_stdstdio$cnt_lval" in
12128 $define$define) val=$define ;;
12131 set d_stdio_cnt_lval
12135 : test whether setting _ptr sets _cnt as a side effect
12136 d_stdio_ptr_lval_sets_cnt="$undef"
12137 d_stdio_ptr_lval_nochange_cnt="$undef"
12138 case "$d_stdio_ptr_lval$d_stdstdio" in
12140 echo "Checking to see what happens if we set the stdio ptr..." >&4
12143 /* Can we scream? */
12144 /* Eat dust sed :-) */
12145 /* In the buffer space, no one can hear you scream. */
12146 #$i_stdlib I_STDLIB
12148 #include <stdlib.h>
12150 #define FILE_ptr(fp) $stdio_ptr
12151 #define FILE_cnt(fp) $stdio_cnt
12152 #include <sys/types.h>
12154 FILE *fp = fopen("try.c", "r");
12159 puts("Fail even to read");
12162 c = getc(fp); /* Read away the first # */
12164 puts("Fail even to read");
12168 18 <= FILE_cnt(fp) &&
12169 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12171 puts("Fail even to read");
12174 ptr = (char*) FILE_ptr(fp);
12175 cnt = (size_t)FILE_cnt(fp);
12177 FILE_ptr(fp) += 42;
12179 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12180 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12183 if (FILE_cnt(fp) <= 20) {
12184 printf ("Fail (<20 chars to test)");
12187 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12188 puts("Fail compare");
12191 if (cnt == FILE_cnt(fp)) {
12192 puts("Pass_unchanged");
12195 if (FILE_cnt(fp) == (cnt - 42)) {
12196 puts("Pass_changed");
12199 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12205 if eval $compile && $to try.c; then
12206 case `$run ./try` in
12208 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12209 d_stdio_ptr_lval_sets_cnt="$define" ;;
12211 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12212 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12214 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12216 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12219 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12225 : see if _base is also standard
12227 case "$d_stdstdio" in
12231 #$i_stdlib I_STDLIB
12233 #include <stdlib.h>
12235 #define FILE_base(fp) $stdio_base
12236 #define FILE_bufsiz(fp) $stdio_bufsiz
12238 FILE *fp = fopen("try.c", "r");
12241 19 <= FILE_bufsiz(fp) &&
12242 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
12249 if eval $compile && $to try.c; then
12250 if $run ./try; then
12251 echo "And its _base field acts std."
12254 echo "But its _base field isn't std."
12257 echo "However, it seems to be lacking the _base field."
12265 : see if fast_stdio exists
12267 case "$d_stdstdio:$d_stdio_ptr_lval" in
12269 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
12271 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
12282 : see if fchdir exists
12283 set fchdir d_fchdir
12286 : see if fchmod exists
12287 set fchmod d_fchmod
12290 : see if fchown exists
12291 set fchown d_fchown
12294 : see if this is an fcntl system
12299 : See if fcntl-based locking works.
12301 #$i_stdlib I_STDLIB
12303 #include <stdlib.h>
12305 #include <unistd.h>
12307 #include <signal.h>
12308 $signal_t blech(x) int x; { exit(3); }
12310 #if defined(F_SETLK) && defined(F_SETLKW)
12311 struct flock flock;
12313 fd = open("try.c", O_RDONLY);
12314 flock.l_type = F_RDLCK;
12315 flock.l_whence = SEEK_SET;
12316 flock.l_start = flock.l_len = 0;
12317 signal(SIGALRM, blech);
12319 retval = fcntl(fd, F_SETLK, &flock);
12321 (retval < 0 ? exit(2) : exit(0));
12327 echo "Checking if fcntl-based file locking works... "
12331 if eval $compile_ok; then
12332 if $run ./try; then
12333 echo "Yes, it seems to work."
12336 echo "Nope, it didn't work."
12341 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
12342 *** This is (almost) impossible.
12343 *** If your NFS lock daemons are not feeling well, something like
12344 *** this may happen, please investigate. Cannot continue, aborting.
12352 echo "I'm unable to compile the test program, so I'll assume not."
12357 echo "Nope, since you don't even have fcntl()."
12360 set d_fcntl_can_lock
12365 : check for fd_set items
12368 Checking to see how well your C compiler handles fd_set and friends ...
12371 #$i_stdlib I_STDLIB
12373 #include <stdlib.h>
12375 #$i_systime I_SYS_TIME
12376 #$i_sysselct I_SYS_SELECT
12377 #$d_socket HAS_SOCKET
12378 #include <sys/types.h>
12380 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
12383 #include <sys/time.h>
12385 #ifdef I_SYS_SELECT
12386 #include <sys/select.h>
12395 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
12403 if eval $compile; then
12404 d_fds_bits="$define"
12406 echo "Well, your system knows about the normal fd_set typedef..." >&4
12407 if $run ./try; then
12408 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
12409 d_fd_macros="$define"
12412 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
12414 d_fd_macros="$undef"
12418 Hmm, your compiler has some difficulty with fd_set. Checking further...
12421 if eval $compile; then
12422 d_fds_bits="$undef"
12424 echo "Well, your system has some sort of fd_set available..." >&4
12425 if $run ./try; then
12426 echo "and you have the normal fd_set macros." >&4
12427 d_fd_macros="$define"
12430 but not the normal fd_set macros! Gross! More work for me...
12432 d_fd_macros="$undef"
12435 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
12437 d_fds_bits="$undef"
12438 d_fd_macros="$undef"
12443 : see if fgetpos exists
12444 set fgetpos d_fgetpos
12447 : see if finite exists
12448 set finite d_finite
12451 : see if finitel exists
12452 set finitel d_finitel
12455 : see if flock exists
12459 : see if prototype for flock is available
12461 set d_flockproto flock $i_sysfile sys/file.h
12464 : see if fork exists
12468 : see if fp_class exists
12469 set fp_class d_fp_class
12472 : see if pathconf exists
12473 set pathconf d_pathconf
12476 : see if fpathconf exists
12477 set fpathconf d_fpathconf
12480 : see if fpclass exists
12481 set fpclass d_fpclass
12484 : see if fpclassify exists
12485 set fpclassify d_fpclassify
12488 : see if fpclassl exists
12489 set fpclassl d_fpclassl
12493 : check for fpos64_t
12495 echo "Checking to see if you have fpos64_t..." >&4
12498 int main() { fpos64_t x = 7; }
12501 if eval $compile; then
12503 echo "You have fpos64_t."
12506 echo "You do not have fpos64_t."
12507 case "$fpossize" in
12508 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
12515 : see if frexpl exists
12516 set frexpl d_frexpl
12519 : see if this is a sys/param system
12520 set sys/param.h i_sysparam
12523 : see if this is a sys/mount.h system
12524 set sys/mount.h i_sysmount
12529 echo "Checking to see if your system supports struct fs_data..." >&4
12530 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
12532 case "$d_fs_data_s" in
12533 "$define") echo "Yes, it does." ;;
12534 *) echo "No, it doesn't." ;;
12537 : see if fseeko exists
12538 set fseeko d_fseeko
12540 case "$longsize" in
12541 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
12544 : see if fsetpos exists
12545 set fsetpos d_fsetpos
12549 : see if fstatfs exists
12550 set fstatfs d_fstatfs
12554 : see if statvfs exists
12555 set statvfs d_statvfs
12558 : see if fstatvfs exists
12559 set fstatvfs d_fstatvfs
12563 : see if fsync exists
12567 : see if ftello exists
12568 set ftello d_ftello
12570 case "$longsize" in
12571 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
12575 : check for a working futimes
12577 echo "Checking for a working futimes()" >&4
12580 #include <sys/time.h>
12587 fd = open ("try.c", O_RDWR);
12588 if (-1 == fd) exit (1);
12589 rv = futimes (fd, NULL);
12590 exit (rv == -1 ? errno : 0);
12594 if eval $compile; then
12598 0) echo "Yes, it does" >&4
12599 d_futimes="$define"
12601 *) echo "No, it has futimes, but it isn't working ($rc) (probably harmless)\n" >&4
12605 echo "No, it does not (probably harmless)\n" >&4
12607 $rm -f try.* try core core.try.*
12609 : see if getcwd exists
12610 set getcwd d_getcwd
12613 : see if getespwnam exists
12614 set getespwnam d_getespwnam
12618 : see if getfsstat exists
12619 set getfsstat d_getfsstat
12622 : see if getgrent exists
12623 set getgrent d_getgrent
12626 : see if getgrent_r exists
12627 set getgrent_r d_getgrent_r
12629 case "$d_getgrent_r" in
12631 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12632 case "$d_getgrent_r_proto:$usethreads" in
12633 ":define") d_getgrent_r_proto=define
12634 set d_getgrent_r_proto getgrent_r $hdrs
12638 case "$d_getgrent_r_proto" in
12640 case "$getgrent_r_proto" in
12641 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
12642 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBWR ;;
12644 case "$getgrent_r_proto" in
12645 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
12646 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIR ;;
12648 case "$getgrent_r_proto" in
12649 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
12650 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBW ;;
12652 case "$getgrent_r_proto" in
12653 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
12654 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBI ;;
12656 case "$getgrent_r_proto" in
12657 ''|0) try='int getgrent_r(struct group*, char*, int);'
12658 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBI ;;
12660 case "$getgrent_r_proto" in
12661 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
12662 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIH ;;
12664 case "$getgrent_r_proto" in
12665 ''|0) d_getgrent_r=undef
12667 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
12668 * ) case "$getgrent_r_proto" in
12669 REENTRANT_PROTO*) ;;
12670 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
12672 echo "Prototype: $try" ;;
12675 *) case "$usethreads" in
12676 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
12683 *) getgrent_r_proto=0
12687 : see if getgrgid_r exists
12688 set getgrgid_r d_getgrgid_r
12690 case "$d_getgrgid_r" in
12692 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12693 case "$d_getgrgid_r_proto:$usethreads" in
12694 ":define") d_getgrgid_r_proto=define
12695 set d_getgrgid_r_proto getgrgid_r $hdrs
12699 case "$d_getgrgid_r_proto" in
12701 case "$getgrgid_r_proto" in
12702 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
12703 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
12705 case "$getgrgid_r_proto" in
12706 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
12707 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
12709 case "$getgrgid_r_proto" in
12710 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
12711 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
12713 case "$getgrgid_r_proto" in
12714 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
12715 ./protochk "extern $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
12717 case "$getgrgid_r_proto" in
12718 ''|0) d_getgrgid_r=undef
12720 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
12721 * ) case "$getgrgid_r_proto" in
12722 REENTRANT_PROTO*) ;;
12723 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
12725 echo "Prototype: $try" ;;
12728 *) case "$usethreads" in
12729 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
12736 *) getgrgid_r_proto=0
12740 : see if getgrnam_r exists
12741 set getgrnam_r d_getgrnam_r
12743 case "$d_getgrnam_r" in
12745 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12746 case "$d_getgrnam_r_proto:$usethreads" in
12747 ":define") d_getgrnam_r_proto=define
12748 set d_getgrnam_r_proto getgrnam_r $hdrs
12752 case "$d_getgrnam_r_proto" in
12754 case "$getgrnam_r_proto" in
12755 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
12756 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
12758 case "$getgrnam_r_proto" in
12759 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
12760 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
12762 case "$getgrnam_r_proto" in
12763 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
12764 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CBI ;;
12766 case "$getgrnam_r_proto" in
12767 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
12768 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
12770 case "$getgrnam_r_proto" in
12771 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
12772 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
12774 case "$getgrnam_r_proto" in
12775 ''|0) d_getgrnam_r=undef
12777 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
12778 * ) case "$getgrnam_r_proto" in
12779 REENTRANT_PROTO*) ;;
12780 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
12782 echo "Prototype: $try" ;;
12785 *) case "$usethreads" in
12786 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
12793 *) getgrnam_r_proto=0
12797 : see if gethostbyaddr exists
12798 set gethostbyaddr d_gethbyaddr
12801 : see if gethostbyname exists
12802 set gethostbyname d_gethbyname
12805 : see if gethostent exists
12806 set gethostent d_gethent
12809 : see how we will look up host name
12812 if set gethostname val -f d_gethname; eval $csym; $val; then
12813 echo 'gethostname() found.' >&4
12814 d_gethname="$define"
12817 if set uname val -f d_uname; eval $csym; $val; then
12820 uname() was found, but you're running xenix, and older versions of xenix
12821 have a broken uname(). If you don't really know whether your xenix is old
12822 enough to have a broken system call, use the default answer.
12827 "$define") dflt=n;;
12829 rp='Is your uname() broken?'
12832 n*) d_uname="$define"; call=uname;;
12835 echo 'uname() found.' >&4
12842 case "$d_gethname" in
12843 '') d_gethname="$undef";;
12846 '') d_uname="$undef";;
12848 case "$d_uname$d_gethname" in
12853 Every now and then someone has a $call() that lies about the hostname
12854 but can't be fixed for political or economic reasons. If you wish, I can
12855 pretend $call() isn't there and maybe compute hostname at run-time
12856 thanks to the '$phostname' command.
12859 rp="Shall I ignore $call() from now on?"
12862 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
12865 case "$phostname" in
12866 '') aphostname='';;
12867 *) case "$aphostname" in
12869 *) set X $phostname
12873 file=`./loc $file $file $pth`
12874 aphostname=`echo $file $*`
12879 case "$d_uname$d_gethname" in
12882 case "$phostname" in
12884 echo "There will be no way for $package to get your hostname." >&4;;
12886 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
12890 case "$d_phostname" in
12891 '') d_phostname="$undef";;
12894 : see if gethostbyaddr_r exists
12895 set gethostbyaddr_r d_gethostbyaddr_r
12897 case "$d_gethostbyaddr_r" in
12899 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12900 case "$d_gethostbyaddr_r_proto:$usethreads" in
12901 ":define") d_gethostbyaddr_r_proto=define
12902 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
12906 case "$d_gethostbyaddr_r_proto" in
12908 case "$gethostbyaddr_r_proto" in
12909 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
12910 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
12912 case "$gethostbyaddr_r_proto" in
12913 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
12914 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
12916 case "$gethostbyaddr_r_proto" in
12917 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
12918 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
12920 case "$gethostbyaddr_r_proto" in
12921 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
12922 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
12924 case "$gethostbyaddr_r_proto" in
12925 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
12926 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
12928 case "$gethostbyaddr_r_proto" in
12929 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
12930 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
12932 case "$gethostbyaddr_r_proto" in
12933 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
12934 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
12936 case "$gethostbyaddr_r_proto" in
12937 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
12938 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
12940 case "$gethostbyaddr_r_proto" in
12941 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
12942 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
12944 case "$gethostbyaddr_r_proto" in
12945 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
12946 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
12948 case "$gethostbyaddr_r_proto" in
12949 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
12950 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
12952 case "$gethostbyaddr_r_proto" in
12953 ''|0) d_gethostbyaddr_r=undef
12954 gethostbyaddr_r_proto=0
12955 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
12956 * ) case "$gethostbyaddr_r_proto" in
12957 REENTRANT_PROTO*) ;;
12958 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
12960 echo "Prototype: $try" ;;
12963 *) case "$usethreads" in
12964 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
12966 d_gethostbyaddr_r=undef
12967 gethostbyaddr_r_proto=0
12971 *) gethostbyaddr_r_proto=0
12975 : see if gethostbyname_r exists
12976 set gethostbyname_r d_gethostbyname_r
12978 case "$d_gethostbyname_r" in
12980 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12981 case "$d_gethostbyname_r_proto:$usethreads" in
12982 ":define") d_gethostbyname_r_proto=define
12983 set d_gethostbyname_r_proto gethostbyname_r $hdrs
12987 case "$d_gethostbyname_r_proto" in
12989 case "$gethostbyname_r_proto" in
12990 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
12991 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
12993 case "$gethostbyname_r_proto" in
12994 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
12995 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
12997 case "$gethostbyname_r_proto" in
12998 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
12999 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
13001 case "$gethostbyname_r_proto" in
13002 ''|0) d_gethostbyname_r=undef
13003 gethostbyname_r_proto=0
13004 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
13005 * ) case "$gethostbyname_r_proto" in
13006 REENTRANT_PROTO*) ;;
13007 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
13009 echo "Prototype: $try" ;;
13012 *) case "$usethreads" in
13013 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13015 d_gethostbyname_r=undef
13016 gethostbyname_r_proto=0
13020 *) gethostbyname_r_proto=0
13024 : see if gethostent_r exists
13025 set gethostent_r d_gethostent_r
13027 case "$d_gethostent_r" in
13029 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13030 case "$d_gethostent_r_proto:$usethreads" in
13031 ":define") d_gethostent_r_proto=define
13032 set d_gethostent_r_proto gethostent_r $hdrs
13036 case "$d_gethostent_r_proto" in
13038 case "$gethostent_r_proto" in
13039 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
13040 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
13042 case "$gethostent_r_proto" in
13043 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
13044 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBIE ;;
13046 case "$gethostent_r_proto" in
13047 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
13048 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBIE ;;
13050 case "$gethostent_r_proto" in
13051 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
13052 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBI ;;
13054 case "$gethostent_r_proto" in
13055 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
13056 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBI ;;
13058 case "$gethostent_r_proto" in
13059 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13060 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SD ;;
13062 case "$gethostent_r_proto" in
13063 ''|0) d_gethostent_r=undef
13064 gethostent_r_proto=0
13065 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13066 * ) case "$gethostent_r_proto" in
13067 REENTRANT_PROTO*) ;;
13068 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13070 echo "Prototype: $try" ;;
13073 *) case "$usethreads" in
13074 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13076 d_gethostent_r=undef
13077 gethostent_r_proto=0
13081 *) gethostent_r_proto=0
13085 : see if prototypes for various gethostxxx netdb.h functions are available
13087 set d_gethostprotos gethostent $i_netdb netdb.h
13090 : see if getitimer exists
13091 set getitimer d_getitimer
13094 : see if getlogin exists
13095 set getlogin d_getlogin
13098 : see if getlogin_r exists
13099 set getlogin_r d_getlogin_r
13101 case "$d_getlogin_r" in
13103 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
13104 case "$d_getlogin_r_proto:$usethreads" in
13105 ":define") d_getlogin_r_proto=define
13106 set d_getlogin_r_proto getlogin_r $hdrs
13110 case "$d_getlogin_r_proto" in
13112 case "$getlogin_r_proto" in
13113 ''|0) try='int getlogin_r(char*, size_t);'
13114 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BW ;;
13116 case "$getlogin_r_proto" in
13117 ''|0) try='int getlogin_r(char*, int);'
13118 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BI ;;
13120 case "$getlogin_r_proto" in
13121 ''|0) try='char* getlogin_r(char*, size_t);'
13122 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BW ;;
13124 case "$getlogin_r_proto" in
13125 ''|0) try='char* getlogin_r(char*, int);'
13126 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BI ;;
13128 case "$getlogin_r_proto" in
13129 ''|0) d_getlogin_r=undef
13131 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
13132 * ) case "$getlogin_r_proto" in
13133 REENTRANT_PROTO*) ;;
13134 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
13136 echo "Prototype: $try" ;;
13139 *) case "$usethreads" in
13140 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
13147 *) getlogin_r_proto=0
13151 : see if getmnt exists
13152 set getmnt d_getmnt
13155 : see if getmntent exists
13156 set getmntent d_getmntent
13159 : see if getnetbyaddr exists
13160 set getnetbyaddr d_getnbyaddr
13163 : see if getnetbyname exists
13164 set getnetbyname d_getnbyname
13167 : see if getnetent exists
13168 set getnetent d_getnent
13171 : see if getnetbyaddr_r exists
13172 set getnetbyaddr_r d_getnetbyaddr_r
13174 case "$d_getnetbyaddr_r" in
13176 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13177 case "$d_getnetbyaddr_r_proto:$usethreads" in
13178 ":define") d_getnetbyaddr_r_proto=define
13179 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
13183 case "$d_getnetbyaddr_r_proto" in
13185 case "$getnetbyaddr_r_proto" in
13186 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
13187 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
13189 case "$getnetbyaddr_r_proto" in
13190 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
13191 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
13193 case "$getnetbyaddr_r_proto" in
13194 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
13195 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
13197 case "$getnetbyaddr_r_proto" in
13198 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
13199 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
13201 case "$getnetbyaddr_r_proto" in
13202 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
13203 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
13205 case "$getnetbyaddr_r_proto" in
13206 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
13207 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
13209 case "$getnetbyaddr_r_proto" in
13210 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
13211 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
13213 case "$getnetbyaddr_r_proto" in
13214 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
13215 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
13217 case "$getnetbyaddr_r_proto" in
13218 ''|0) d_getnetbyaddr_r=undef
13219 getnetbyaddr_r_proto=0
13220 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
13221 * ) case "$getnetbyaddr_r_proto" in
13222 REENTRANT_PROTO*) ;;
13223 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
13225 echo "Prototype: $try" ;;
13228 *) case "$usethreads" in
13229 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
13231 d_getnetbyaddr_r=undef
13232 getnetbyaddr_r_proto=0
13236 *) getnetbyaddr_r_proto=0
13240 : see if getnetbyname_r exists
13241 set getnetbyname_r d_getnetbyname_r
13243 case "$d_getnetbyname_r" in
13245 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13246 case "$d_getnetbyname_r_proto:$usethreads" in
13247 ":define") d_getnetbyname_r_proto=define
13248 set d_getnetbyname_r_proto getnetbyname_r $hdrs
13252 case "$d_getnetbyname_r_proto" in
13254 case "$getnetbyname_r_proto" in
13255 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
13256 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
13258 case "$getnetbyname_r_proto" in
13259 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
13260 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
13262 case "$getnetbyname_r_proto" in
13263 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
13264 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
13266 case "$getnetbyname_r_proto" in
13267 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
13268 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
13270 case "$getnetbyname_r_proto" in
13271 ''|0) d_getnetbyname_r=undef
13272 getnetbyname_r_proto=0
13273 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
13274 * ) case "$getnetbyname_r_proto" in
13275 REENTRANT_PROTO*) ;;
13276 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
13278 echo "Prototype: $try" ;;
13281 *) case "$usethreads" in
13282 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
13284 d_getnetbyname_r=undef
13285 getnetbyname_r_proto=0
13289 *) getnetbyname_r_proto=0
13293 : see if getnetent_r exists
13294 set getnetent_r d_getnetent_r
13296 case "$d_getnetent_r" in
13298 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13299 case "$d_getnetent_r_proto:$usethreads" in
13300 ":define") d_getnetent_r_proto=define
13301 set d_getnetent_r_proto getnetent_r $hdrs
13305 case "$d_getnetent_r_proto" in
13307 case "$getnetent_r_proto" in
13308 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
13309 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
13311 case "$getnetent_r_proto" in
13312 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
13313 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBIE ;;
13315 case "$getnetent_r_proto" in
13316 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
13317 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBIE ;;
13319 case "$getnetent_r_proto" in
13320 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
13321 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBI ;;
13323 case "$getnetent_r_proto" in
13324 ''|0) try='int getnetent_r(struct netent*, char*, int);'
13325 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBI ;;
13327 case "$getnetent_r_proto" in
13328 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
13329 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SD ;;
13331 case "$getnetent_r_proto" in
13332 ''|0) d_getnetent_r=undef
13333 getnetent_r_proto=0
13334 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
13335 * ) case "$getnetent_r_proto" in
13336 REENTRANT_PROTO*) ;;
13337 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
13339 echo "Prototype: $try" ;;
13342 *) case "$usethreads" in
13343 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
13345 d_getnetent_r=undef
13346 getnetent_r_proto=0
13350 *) getnetent_r_proto=0
13354 : see if prototypes for various getnetxxx netdb.h functions are available
13356 set d_getnetprotos getnetent $i_netdb netdb.h
13359 : see if getpagesize exists
13360 set getpagesize d_getpagsz
13364 : see if getprotobyname exists
13365 set getprotobyname d_getpbyname
13368 : see if getprotobynumber exists
13369 set getprotobynumber d_getpbynumber
13372 : see if getprotoent exists
13373 set getprotoent d_getpent
13376 : see if getpgid exists
13377 set getpgid d_getpgid
13380 : see if getpgrp2 exists
13381 set getpgrp2 d_getpgrp2
13384 : see if getppid exists
13385 set getppid d_getppid
13388 : see if getpriority exists
13389 set getpriority d_getprior
13392 : see if getprotobyname_r exists
13393 set getprotobyname_r d_getprotobyname_r
13395 case "$d_getprotobyname_r" in
13397 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13398 case "$d_getprotobyname_r_proto:$usethreads" in
13399 ":define") d_getprotobyname_r_proto=define
13400 set d_getprotobyname_r_proto getprotobyname_r $hdrs
13404 case "$d_getprotobyname_r_proto" in
13406 case "$getprotobyname_r_proto" in
13407 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
13408 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
13410 case "$getprotobyname_r_proto" in
13411 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
13412 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
13414 case "$getprotobyname_r_proto" in
13415 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
13416 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
13418 case "$getprotobyname_r_proto" in
13419 ''|0) d_getprotobyname_r=undef
13420 getprotobyname_r_proto=0
13421 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
13422 * ) case "$getprotobyname_r_proto" in
13423 REENTRANT_PROTO*) ;;
13424 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
13426 echo "Prototype: $try" ;;
13429 *) case "$usethreads" in
13430 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
13432 d_getprotobyname_r=undef
13433 getprotobyname_r_proto=0
13437 *) getprotobyname_r_proto=0
13441 : see if getprotobynumber_r exists
13442 set getprotobynumber_r d_getprotobynumber_r
13444 case "$d_getprotobynumber_r" in
13446 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13447 case "$d_getprotobynumber_r_proto:$usethreads" in
13448 ":define") d_getprotobynumber_r_proto=define
13449 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
13453 case "$d_getprotobynumber_r_proto" in
13455 case "$getprotobynumber_r_proto" in
13456 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
13457 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
13459 case "$getprotobynumber_r_proto" in
13460 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
13461 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
13463 case "$getprotobynumber_r_proto" in
13464 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
13465 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
13467 case "$getprotobynumber_r_proto" in
13468 ''|0) d_getprotobynumber_r=undef
13469 getprotobynumber_r_proto=0
13470 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
13471 * ) case "$getprotobynumber_r_proto" in
13472 REENTRANT_PROTO*) ;;
13473 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
13475 echo "Prototype: $try" ;;
13478 *) case "$usethreads" in
13479 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
13481 d_getprotobynumber_r=undef
13482 getprotobynumber_r_proto=0
13486 *) getprotobynumber_r_proto=0
13490 : see if getprotoent_r exists
13491 set getprotoent_r d_getprotoent_r
13493 case "$d_getprotoent_r" in
13495 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13496 case "$d_getprotoent_r_proto:$usethreads" in
13497 ":define") d_getprotoent_r_proto=define
13498 set d_getprotoent_r_proto getprotoent_r $hdrs
13502 case "$d_getprotoent_r_proto" in
13504 case "$getprotoent_r_proto" in
13505 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
13506 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
13508 case "$getprotoent_r_proto" in
13509 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
13510 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBI ;;
13512 case "$getprotoent_r_proto" in
13513 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
13514 ./protochk "extern $try" $hdrs && getprotoent_r_proto=S_SBI ;;
13516 case "$getprotoent_r_proto" in
13517 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
13518 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SD ;;
13520 case "$getprotoent_r_proto" in
13521 ''|0) d_getprotoent_r=undef
13522 getprotoent_r_proto=0
13523 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
13524 * ) case "$getprotoent_r_proto" in
13525 REENTRANT_PROTO*) ;;
13526 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
13528 echo "Prototype: $try" ;;
13531 *) case "$usethreads" in
13532 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
13534 d_getprotoent_r=undef
13535 getprotoent_r_proto=0
13539 *) getprotoent_r_proto=0
13543 : see if prototypes for various getprotoxxx netdb.h functions are available
13545 set d_getprotoprotos getprotoent $i_netdb netdb.h
13548 : see if getprpwnam exists
13549 set getprpwnam d_getprpwnam
13552 : see if getpwent exists
13553 set getpwent d_getpwent
13556 : see if getpwent_r exists
13557 set getpwent_r d_getpwent_r
13559 case "$d_getpwent_r" in
13561 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13562 case "$d_getpwent_r_proto:$usethreads" in
13563 ":define") d_getpwent_r_proto=define
13564 set d_getpwent_r_proto getpwent_r $hdrs
13568 case "$d_getpwent_r_proto" in
13570 case "$getpwent_r_proto" in
13571 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
13572 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBWR ;;
13574 case "$getpwent_r_proto" in
13575 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
13576 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIR ;;
13578 case "$getpwent_r_proto" in
13579 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
13580 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBW ;;
13582 case "$getpwent_r_proto" in
13583 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
13584 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBI ;;
13586 case "$getpwent_r_proto" in
13587 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
13588 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBI ;;
13590 case "$getpwent_r_proto" in
13591 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
13592 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIH ;;
13594 case "$getpwent_r_proto" in
13595 ''|0) d_getpwent_r=undef
13597 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
13598 * ) case "$getpwent_r_proto" in
13599 REENTRANT_PROTO*) ;;
13600 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
13602 echo "Prototype: $try" ;;
13605 *) case "$usethreads" in
13606 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
13613 *) getpwent_r_proto=0
13617 : see if getpwnam_r exists
13618 set getpwnam_r d_getpwnam_r
13620 case "$d_getpwnam_r" in
13622 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13623 case "$d_getpwnam_r_proto:$usethreads" in
13624 ":define") d_getpwnam_r_proto=define
13625 set d_getpwnam_r_proto getpwnam_r $hdrs
13629 case "$d_getpwnam_r_proto" in
13631 case "$getpwnam_r_proto" in
13632 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
13633 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
13635 case "$getpwnam_r_proto" in
13636 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
13637 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
13639 case "$getpwnam_r_proto" in
13640 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
13641 ./protochk "extern $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
13643 case "$getpwnam_r_proto" in
13644 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
13645 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
13647 case "$getpwnam_r_proto" in
13648 ''|0) d_getpwnam_r=undef
13650 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
13651 * ) case "$getpwnam_r_proto" in
13652 REENTRANT_PROTO*) ;;
13653 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
13655 echo "Prototype: $try" ;;
13658 *) case "$usethreads" in
13659 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
13666 *) getpwnam_r_proto=0
13670 : see if getpwuid_r exists
13671 set getpwuid_r d_getpwuid_r
13673 case "$d_getpwuid_r" in
13675 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13676 case "$d_getpwuid_r_proto:$usethreads" in
13677 ":define") d_getpwuid_r_proto=define
13678 set d_getpwuid_r_proto getpwuid_r $hdrs
13682 case "$d_getpwuid_r_proto" in
13684 case "$getpwuid_r_proto" in
13685 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
13686 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
13688 case "$getpwuid_r_proto" in
13689 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
13690 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
13692 case "$getpwuid_r_proto" in
13693 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
13694 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
13696 case "$getpwuid_r_proto" in
13697 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
13698 ./protochk "extern $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
13700 case "$getpwuid_r_proto" in
13701 ''|0) d_getpwuid_r=undef
13703 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
13704 * ) case "$getpwuid_r_proto" in
13705 REENTRANT_PROTO*) ;;
13706 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
13708 echo "Prototype: $try" ;;
13711 *) case "$usethreads" in
13712 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
13719 *) getpwuid_r_proto=0
13724 : see if getservbyname exists
13725 set getservbyname d_getsbyname
13728 : see if getservbyport exists
13729 set getservbyport d_getsbyport
13732 : see if getservent exists
13733 set getservent d_getsent
13736 : see if getservbyname_r exists
13737 set getservbyname_r d_getservbyname_r
13739 case "$d_getservbyname_r" in
13741 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13742 case "$d_getservbyname_r_proto:$usethreads" in
13743 ":define") d_getservbyname_r_proto=define
13744 set d_getservbyname_r_proto getservbyname_r $hdrs
13748 case "$d_getservbyname_r_proto" in
13750 case "$getservbyname_r_proto" in
13751 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
13752 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
13754 case "$getservbyname_r_proto" in
13755 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
13756 ./protochk "extern $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
13758 case "$getservbyname_r_proto" in
13759 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
13760 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
13762 case "$getservbyname_r_proto" in
13763 ''|0) d_getservbyname_r=undef
13764 getservbyname_r_proto=0
13765 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
13766 * ) case "$getservbyname_r_proto" in
13767 REENTRANT_PROTO*) ;;
13768 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
13770 echo "Prototype: $try" ;;
13773 *) case "$usethreads" in
13774 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
13776 d_getservbyname_r=undef
13777 getservbyname_r_proto=0
13781 *) getservbyname_r_proto=0
13785 : see if getservbyport_r exists
13786 set getservbyport_r d_getservbyport_r
13788 case "$d_getservbyport_r" in
13790 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13791 case "$d_getservbyport_r_proto:$usethreads" in
13792 ":define") d_getservbyport_r_proto=define
13793 set d_getservbyport_r_proto getservbyport_r $hdrs
13797 case "$d_getservbyport_r_proto" in
13799 case "$getservbyport_r_proto" in
13800 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
13801 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
13803 case "$getservbyport_r_proto" in
13804 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
13805 ./protochk "extern $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
13807 case "$getservbyport_r_proto" in
13808 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
13809 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
13811 case "$getservbyport_r_proto" in
13812 ''|0) d_getservbyport_r=undef
13813 getservbyport_r_proto=0
13814 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
13815 * ) case "$getservbyport_r_proto" in
13816 REENTRANT_PROTO*) ;;
13817 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
13819 echo "Prototype: $try" ;;
13822 *) case "$usethreads" in
13823 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
13825 d_getservbyport_r=undef
13826 getservbyport_r_proto=0
13830 *) getservbyport_r_proto=0
13834 : see if getservent_r exists
13835 set getservent_r d_getservent_r
13837 case "$d_getservent_r" in
13839 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13840 case "$d_getservent_r_proto:$usethreads" in
13841 ":define") d_getservent_r_proto=define
13842 set d_getservent_r_proto getservent_r $hdrs
13846 case "$d_getservent_r_proto" in
13848 case "$getservent_r_proto" in
13849 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
13850 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBWR ;;
13852 case "$getservent_r_proto" in
13853 ''|0) try='int getservent_r(struct servent*, char*, int);'
13854 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBI ;;
13856 case "$getservent_r_proto" in
13857 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
13858 ./protochk "extern $try" $hdrs && getservent_r_proto=S_SBI ;;
13860 case "$getservent_r_proto" in
13861 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
13862 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SD ;;
13864 case "$getservent_r_proto" in
13865 ''|0) d_getservent_r=undef
13866 getservent_r_proto=0
13867 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
13868 * ) case "$getservent_r_proto" in
13869 REENTRANT_PROTO*) ;;
13870 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
13872 echo "Prototype: $try" ;;
13875 *) case "$usethreads" in
13876 define) echo "getservent_r has no prototype, not using it." >&4 ;;
13878 d_getservent_r=undef
13879 getservent_r_proto=0
13883 *) getservent_r_proto=0
13887 : see if prototypes for various getservxxx netdb.h functions are available
13889 set d_getservprotos getservent $i_netdb netdb.h
13892 : see if getspnam exists
13893 set getspnam d_getspnam
13896 : see if this is a shadow.h system
13897 set shadow.h i_shadow
13900 : see if getspnam_r exists
13901 set getspnam_r d_getspnam_r
13903 case "$d_getspnam_r" in
13905 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
13906 case "$d_getspnam_r_proto:$usethreads" in
13907 ":define") d_getspnam_r_proto=define
13908 set d_getspnam_r_proto getspnam_r $hdrs
13912 case "$d_getspnam_r_proto" in
13914 case "$getspnam_r_proto" in
13915 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
13916 ./protochk "extern $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
13918 case "$getspnam_r_proto" in
13919 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
13920 ./protochk "extern $try" $hdrs && getspnam_r_proto=S_CSBI ;;
13922 case "$getspnam_r_proto" in
13923 ''|0) d_getspnam_r=undef
13925 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
13926 * ) case "$getspnam_r_proto" in
13927 REENTRANT_PROTO*) ;;
13928 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
13930 echo "Prototype: $try" ;;
13933 *) case "$usethreads" in
13934 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
13941 *) getspnam_r_proto=0
13945 : see if gettimeofday or ftime exists
13946 set gettimeofday d_gettimeod
13948 case "$d_gettimeod" in
13954 val="$undef"; set d_ftime; eval $setvar
13957 case "$d_gettimeod$d_ftime" in
13960 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
13964 : see if gmtime_r exists
13965 set gmtime_r d_gmtime_r
13967 case "$d_gmtime_r" in
13969 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
13970 case "$d_gmtime_r_proto:$usethreads" in
13971 ":define") d_gmtime_r_proto=define
13972 set d_gmtime_r_proto gmtime_r $hdrs
13976 case "$d_gmtime_r_proto" in
13978 case "$gmtime_r_proto" in
13979 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
13980 ./protochk "extern $try" $hdrs && gmtime_r_proto=S_TS ;;
13982 case "$gmtime_r_proto" in
13983 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
13984 ./protochk "extern $try" $hdrs && gmtime_r_proto=I_TS ;;
13986 case "$gmtime_r_proto" in
13987 ''|0) d_gmtime_r=undef
13989 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
13990 * ) case "$gmtime_r_proto" in
13991 REENTRANT_PROTO*) ;;
13992 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
13994 echo "Prototype: $try" ;;
13997 *) case "$usethreads" in
13998 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
14005 *) gmtime_r_proto=0
14009 : see if hasmntopt exists
14010 set hasmntopt d_hasmntopt
14013 : see if this is a netinet/in.h or sys/in.h system
14014 set netinet/in.h i_niin sys/in.h i_sysin
14017 : see if arpa/inet.h has to be included
14018 set arpa/inet.h i_arpainet
14021 : see if htonl --and friends-- exists
14026 : Maybe they are macros.
14029 $cat >htonl.c <<EOM
14031 #include <sys/types.h>
14032 #$i_niin I_NETINET_IN
14034 #$i_arpainet I_ARPA_INET
14035 #ifdef I_NETINET_IN
14036 #include <netinet/in.h>
14039 #include <sys/in.h>
14042 #include <arpa/inet.h>
14045 printf("Defined as a macro.");
14048 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
14049 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
14051 echo "But it seems to be defined as a macro." >&4
14059 : see if ilogbl exists
14060 set ilogbl d_ilogbl
14065 if set index val -f; eval $csym; $val; then
14066 if set strchr val -f d_strchr; eval $csym; $val; then
14067 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14070 echo "strchr() found." >&4
14074 echo "index() found." >&4
14079 echo "index() found." >&4
14082 if set strchr val -f d_strchr; eval $csym; $val; then
14085 echo "strchr() found." >&4
14087 echo "No index() or strchr() found!" >&4
14092 set d_strchr; eval $setvar
14094 set d_index; eval $setvar
14096 : check whether inet_aton exists
14097 set inet_aton d_inetaton
14102 $cat >isascii.c <<EOCP
14105 #$i_stdlib I_STDLIB
14107 #include <stdlib.h>
14118 if eval $compile; then
14119 echo "isascii() found." >&4
14122 echo "isascii() NOT found." >&4
14129 : see if isfinite exists
14130 set isfinite d_isfinite
14133 : see if isinf exists
14137 : see if isnan exists
14141 : see if isnanl exists
14142 set isnanl d_isnanl
14145 : see if killpg exists
14146 set killpg d_killpg
14149 : see if lchown exists
14151 $cat > try.c <<'EOCP'
14152 /* System header to define __stub macros and hopefully few prototypes,
14153 which can conflict with char lchown(); below. */
14154 #include <assert.h>
14155 /* Override any gcc2 internal prototype to avoid an error. */
14156 /* We use char because int might match the return type of a gcc2
14157 builtin and then its argument prototype would still apply. */
14160 /* The GNU C library defines this for functions which it implements
14161 to always fail with ENOSYS. Some functions are actually named
14162 something starting with __ and the normal name is an alias. */
14163 #if defined (__stub_lchown) || defined (__stub___lchown)
14171 if eval $compile; then
14172 $echo "lchown() found." >&4
14175 $echo "lchown() NOT found." >&4
14181 : See if number of significant digits in a double precision number is known
14183 $cat >ldbl_dig.c <<EOM
14184 #$i_limits I_LIMITS
14187 #include <limits.h>
14193 printf("Contains LDBL_DIG");
14196 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
14197 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
14198 echo "LDBL_DIG found." >&4
14201 echo "LDBL_DIG NOT found." >&4
14208 : see if this is a math.h system
14212 d_libm_lib_version="$undef"
14215 : check to see if math.h defines _LIB_VERSION
14217 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
14219 #include <unistd.h>
14221 int main (int argc, char *argv[])
14223 printf ("%d\n", _LIB_VERSION);
14228 if eval $compile; then
14230 echo "Yes, it does ($foo)" >&4
14231 d_libm_lib_version="$define"
14233 echo "No, it does not (probably harmless)\n" >&4
14235 $rm -f try.* try core core.try.*
14240 : see if link exists
14244 : see if localtime_r exists
14245 set localtime_r d_localtime_r
14247 case "$d_localtime_r" in
14249 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14250 case "$d_localtime_r_proto:$usethreads" in
14251 ":define") d_localtime_r_proto=define
14252 set d_localtime_r_proto localtime_r $hdrs
14256 case "$d_localtime_r_proto" in
14258 case "$localtime_r_proto" in
14259 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
14260 ./protochk "extern $try" $hdrs && localtime_r_proto=S_TS ;;
14262 case "$localtime_r_proto" in
14263 ''|0) try='int localtime_r(const time_t*, struct tm*);'
14264 ./protochk "extern $try" $hdrs && localtime_r_proto=I_TS ;;
14266 case "$localtime_r_proto" in
14267 ''|0) d_localtime_r=undef
14268 localtime_r_proto=0
14269 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
14270 * ) case "$localtime_r_proto" in
14271 REENTRANT_PROTO*) ;;
14272 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
14274 echo "Prototype: $try" ;;
14277 *) case "$usethreads" in
14278 define) echo "localtime_r has no prototype, not using it." >&4 ;;
14280 d_localtime_r=undef
14281 localtime_r_proto=0
14285 *) localtime_r_proto=0
14289 : see if localeconv exists
14290 set localeconv d_locconv
14293 : see if lockf exists
14297 : see if prototype for lseek is available
14299 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
14302 : see if lstat exists
14306 : see if madvise exists
14307 set madvise d_madvise
14310 : see if malloc_size exists
14311 set malloc_size d_malloc_size
14314 : see if malloc_size_good exists
14315 set malloc_good_size d_malloc_good_size
14318 : see if mblen exists
14322 : see if mbstowcs exists
14323 set mbstowcs d_mbstowcs
14326 : see if mbtowc exists
14327 set mbtowc d_mbtowc
14330 : see if memchr exists
14331 set memchr d_memchr
14334 : see if memcmp exists
14335 set memcmp d_memcmp
14338 : see if memcpy exists
14339 set memcpy d_memcpy
14342 : see if memmove exists
14343 set memmove d_memmove
14346 : see if memset exists
14347 set memset d_memset
14350 : see if mkdir exists
14354 : see if mkdtemp exists
14355 set mkdtemp d_mkdtemp
14358 : see if mkfifo exists
14359 set mkfifo d_mkfifo
14362 : see if mkstemp exists
14363 set mkstemp d_mkstemp
14366 : see if mkstemps exists
14367 set mkstemps d_mkstemps
14370 : see if mktime exists
14371 set mktime d_mktime
14374 : see if this is a sys/mman.h system
14375 set sys/mman.h i_sysmman
14378 : see if mmap exists
14381 : see what shmat returns
14382 : default to something harmless
14384 case "$i_sysmman$d_mmap" in
14386 $cat >mmap.c <<'END'
14387 #include <sys/mman.h>
14390 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
14395 echo "and it returns ($mmaptype)." >&4
14401 : see if sqrtl exists
14405 : see if scalbnl exists
14406 set scalbnl d_scalbnl
14409 : see if modfl exists
14413 : see if prototype for modfl is available
14415 set d_modflproto modfl $i_math math.h
14418 d_modfl_pow32_bug="$undef"
14420 case "$d_longdbl$d_modfl" in
14423 Checking to see whether your modfl() is okay for large values...
14429 if $test "X$d_modflproto" != "X$define"; then
14430 $cat >>try.c <<EOCP
14431 /* Sigh. many current glibcs provide the function, but do not prototype it. */
14432 long double modfl (long double, long double *);
14435 $cat >>try.c <<EOCP
14437 long double nv = 4294967303.15;
14443 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
14447 case "$osname:$gccversion" in
14448 aix:) saveccflags="$ccflags"
14449 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
14452 if eval $compile; then
14455 *" 4294967303.150000 1.150000 4294967302.000000")
14456 echo >&4 "Your modfl() is broken for large values."
14457 d_modfl_pow32_bug="$define"
14459 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
14463 *" 4294967303.150000 0.150000 4294967303.000000")
14464 echo >&4 "Your modfl() seems okay for large values."
14466 *) echo >&4 "I don't understand your modfl() at all."
14470 $rm -f try.* try core core.try.*
14472 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
14475 case "$osname:$gccversion" in
14476 aix:) ccflags="$saveccflags" ;; # restore
14481 if $test "$uselongdouble" = "$define"; then
14483 if $test "$d_sqrtl" != "$define"; then
14484 message="$message sqrtl"
14486 if $test "$d_modfl" != "$define"; then
14487 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
14488 echo "You have both aintl and copysignl, so I can emulate modfl."
14490 message="$message modfl"
14493 if $test "$d_frexpl" != "$define"; then
14494 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
14495 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
14497 message="$message frexpl"
14501 if $test "$message" != ""; then
14504 *** You requested the use of long doubles but you do not seem to have
14505 *** the following mathematical functions needed for long double support:
14507 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
14508 *** Cannot continue, aborting.
14516 : see if mprotect exists
14517 set mprotect d_mprotect
14520 : see if msgctl exists
14521 set msgctl d_msgctl
14524 : see if msgget exists
14525 set msgget d_msgget
14528 : see if msgsnd exists
14529 set msgsnd d_msgsnd
14532 : see if msgrcv exists
14533 set msgrcv d_msgrcv
14536 : see how much of the 'msg*(2)' library is present.
14539 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
14540 *"$undef"*) h_msg=false;;
14544 case "`ipcs 2>&1`" in
14545 "SVID messages"*"not configured"*)
14546 echo "Your $osname does not have the msg*(2) configured." >&4
14549 set msgctl d_msgctl
14551 set msgget d_msgget
14553 set msgsnd d_msgsnd
14555 set msgrcv d_msgrcv
14561 : we could also check for sys/ipc.h ...
14562 if $h_msg && $test `./findhdr sys/msg.h`; then
14563 echo "You have the full msg*(2) library." >&4
14566 echo "You don't have the full msg*(2) library." >&4
14574 echo "Checking to see if your system supports struct msghdr..." >&4
14575 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
14577 case "$d_msghdr_s" in
14578 "$define") echo "Yes, it does." ;;
14579 *) echo "No, it doesn't." ;;
14583 : see if msync exists
14587 : see if munmap exists
14588 set munmap d_munmap
14591 : see if nice exists
14595 : see if this is a langinfo.h system
14596 set langinfo.h i_langinfo
14599 : see if nl_langinfo exists
14600 set nl_langinfo d_nl_langinfo
14603 : check for length of character
14605 case "$charsize" in
14607 echo "Checking to see how big your characters are (hey, you never know)..." >&4
14610 #$i_stdlib I_STDLIB
14612 #include <stdlib.h>
14616 printf("%d\n", (int)sizeof(char));
14621 if eval $compile_ok; then
14625 echo "(I can't seem to compile the test program. Guessing...)"
14632 rp="What is the size of a character (in bytes)?"
14637 : check for volatile keyword
14639 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
14640 $cat >try.c <<'EOCP'
14643 typedef struct _goo_struct goo_struct;
14644 goo_struct * volatile goo = ((goo_struct *)0);
14645 struct _goo_struct {
14650 typedef unsigned short foo_t;
14651 char *volatile foo;
14653 volatile foo_t blech;
14657 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
14659 echo "Yup, it does."
14662 echo "Nope, it doesn't."
14670 $echo "Choosing the C types to be used for Perl's internal types..." >&4
14672 case "$use64bitint:$d_quad:$quadtype" in
14675 uvtype="$uquadtype"
14680 uvtype="unsigned long"
14686 case "$uselongdouble:$d_longdbl" in
14688 nvtype="long double"
14689 nvsize=$longdblsize
14696 $echo "(IV will be "$ivtype", $ivsize bytes)"
14697 $echo "(UV will be "$uvtype", $uvsize bytes)"
14698 $echo "(NV will be "$nvtype", $nvsize bytes)"
14701 #$i_inttypes I_INTTYPES
14703 #include <inttypes.h>
14708 int8_t i = INT8_MAX;
14709 uint8_t u = UINT8_MAX;
14710 printf("int8_t\n");
14713 int16_t i = INT16_MAX;
14714 uint16_t i = UINT16_MAX;
14715 printf("int16_t\n");
14718 int32_t i = INT32_MAX;
14719 uint32_t u = UINT32_MAX;
14720 printf("int32_t\n");
14726 '') case "$charsize" in
14728 u8type="unsigned char"
14737 if eval $compile; then
14738 case "`$run ./try`" in
14739 int8_t) i8type=int8_t
14749 '') if $test $charsize -ge 1; then
14751 u8type="unsigned char"
14759 '') case "$shortsize" in
14761 u16type="unsigned short"
14769 '') set try -DINT16
14770 if eval $compile; then
14771 case "`$run ./try`" in
14783 '') if $test $shortsize -ge 2; then
14785 u16type="unsigned short"
14793 '') case "$longsize" in
14795 u32type="unsigned long"
14799 *) case "$intsize" in
14801 u32type="unsigned int"
14811 '') set try -DINT32
14812 if eval $compile; then
14813 case "`$run ./try`" in
14825 '') if $test $intsize -ge 4; then
14827 u32type="unsigned int"
14835 '') case "$d_quad:$quadtype" in
14837 i64type="$quadtype"
14838 u64type="$uquadtype"
14846 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
14847 : volatile so that the compiler has to store it out to memory.
14848 if test X"$d_volatile" = X"$define"; then
14853 #$i_stdlib I_STDLIB
14855 #include <stdlib.h>
14857 #include <sys/types.h>
14858 #include <signal.h>
14860 $volatile int bletched = 0;
14861 $signal_t blech(s) int s; { bletched = 1; }
14866 int n = 8 * $uvsize;
14869 signal(SIGFPE, blech);
14872 for (i = 0; i < n; i++) {
14873 u = u << 1 | ($uvtype)1;
14875 if (($uvtype)d != u)
14879 d = ($nvtype)(u - 1);
14880 if (($uvtype)d != (u - 1))
14888 printf("%d\n", ((i == n) ? -n : i));
14894 d_nv_preserves_uv="$undef"
14895 if eval $compile; then
14896 nv_preserves_uv_bits="`$run ./try`"
14898 case "$nv_preserves_uv_bits" in
14900 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
14901 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
14902 d_nv_preserves_uv="$define"
14904 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
14905 d_nv_preserves_uv="$undef" ;;
14906 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
14907 nv_preserves_uv_bits="$undef" ;;
14912 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
14913 : volatile so that the compiler has to store it out to memory.
14914 if test X"$d_volatile" = X"$define"; then
14919 #$i_stdlib I_STDLIB
14921 #include <stdlib.h>
14923 #$i_string I_STRING
14925 # include <string.h>
14927 # include <strings.h>
14929 #include <sys/types.h>
14930 #include <signal.h>
14932 $volatile int bletched = 0;
14933 $signal_t blech(s) int s; { bletched = 1; }
14936 int checkit($nvtype d, char *where) {
14937 unsigned char *p = (char *)&d;
14938 unsigned char *end = p + sizeof(d);
14948 printf("No - %s: 0x", where);
14950 printf ("%02X", *p++);
14955 int main(int argc, char **argv) {
14958 fail += checkit(d, "0.0");
14960 /* The compiler shouldn't be assuming that bletched is 0 */
14963 fail += checkit(d, "bleched");
14966 signal(SIGFPE, blech);
14969 /* Paranoia - the compiler should have no way of knowing that ANSI says
14970 that argv[argc] will always be NULL. Actually, if it did assume this it
14971 would be buggy, as this is C and main() can be called from elsewhere in
14973 d = argv[argc] ? 1 : 0;
14976 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
14979 fail += checkit(d, "ternary");
14981 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
14984 printf("No - memset doesn't give 0.0\n");
14985 /* This might just blow up: */
14986 printf("(gives %g)\n", d);
14992 printf("No - something bleched\n");
14997 printf("No - %d fail(s)\n", fail);
15006 d_nv_zero_is_allbits_zero="$undef"
15007 if eval $compile; then
15013 0.0 is represented as all bits zero in memory
15015 d_nv_zero_is_allbits_zero="$define"
15018 0.0 is not represented as all bits zero in memory
15020 d_nv_zero_is_allbits_zero="$undef"
15025 0.0 is not represented as all bits zero in memory
15027 d_nv_zero_is_allbits_zero="$undef"
15035 : check for off64_t
15037 echo "Checking to see if you have off64_t..." >&4
15039 #include <sys/types.h>
15040 #include <unistd.h>
15041 int main() { off64_t x = 7; }
15044 if eval $compile; then
15046 echo "You have off64_t."
15049 echo "You do not have off64_t."
15050 case "$lseeksize" in
15051 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
15058 : how to create joinable pthreads
15059 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
15061 echo "Checking what constant to use for creating joinable pthreads..." >&4
15062 $cat >try.c <<'EOCP'
15063 #include <pthread.h>
15065 int detachstate = JOINABLE;
15068 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
15069 if eval $compile; then
15070 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
15071 val="$undef" # Yes, undef.
15072 set d_old_pthread_create_joinable
15075 set old_pthread_create_joinable
15078 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
15079 if eval $compile; then
15080 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
15082 set d_old_pthread_create_joinable
15084 val=PTHREAD_CREATE_UNDETACHED
15085 set old_pthread_create_joinable
15088 set try -DJOINABLE=__UNDETACHED
15089 if eval $compile; then
15090 echo "You seem to use __UNDETACHED." >&4
15092 set d_old_pthread_create_joinable
15095 set old_pthread_create_joinable
15098 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
15100 set d_old_pthread_create_joinable
15103 set old_pthread_create_joinable
15110 d_old_pthread_create_joinable="$undef"
15111 old_pthread_create_joinable=""
15114 : see if pause exists
15118 : see if pipe exists
15122 : see if poll exists
15126 : see if readlink exists
15127 set readlink d_readlink
15133 case "$d_readlink" in
15135 if $issymlink /proc/self/exe ; then
15136 $ls -l /proc/self/exe > reflect
15137 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15138 echo "You have Linux-like /proc/self/exe."
15139 procselfexe='"/proc/self/exe"'
15143 if $issymlink /proc/curproc/file ; then
15144 $ls -l /proc/curproc/file > reflect
15145 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15146 echo "You have BSD-like /proc/curproc/file."
15147 procselfexe='"/proc/curproc/file"'
15157 : see whether the pthread_atfork exists
15159 #include <pthread.h>
15162 #ifdef PTHREAD_ATFORK
15163 pthread_atfork(NULL,NULL,NULL);
15168 : see if pthread_atfork exists
15169 set try -DPTHREAD_ATFORK
15170 if eval $compile; then
15175 case "$usethreads" in
15178 $define) echo 'pthread_atfork found.' >&4 ;;
15179 *) echo 'pthread_atfork NOT found.' >&4 ;;
15182 set d_pthread_atfork
15185 : see if pthread_attr_setscope exists
15186 set pthread_attr_setscope d_pthread_attr_setscope
15190 : see whether the various POSIXish _yields exist
15192 #include <pthread.h>
15198 #ifdef PTHREAD_YIELD
15201 #ifdef PTHREAD_YIELD_NULL
15202 pthread_yield(NULL);
15208 : see if sched_yield exists
15209 set try -DSCHED_YIELD
15210 if eval $compile; then
15212 sched_yield='sched_yield()'
15216 case "$usethreads" in
15219 $define) echo 'sched_yield() found.' >&4 ;;
15220 *) echo 'sched_yield() NOT found.' >&4 ;;
15226 : see if pthread_yield exists
15227 set try -DPTHREAD_YIELD
15228 if eval $compile; then
15230 case "$sched_yield" in
15231 '') sched_yield='pthread_yield()' ;;
15234 set try -DPTHREAD_YIELD_NULL
15235 if eval $compile; then
15237 case "$sched_yield" in
15238 '') sched_yield='pthread_yield(NULL)' ;;
15244 case "$usethreads" in
15247 $define) echo 'pthread_yield() found.' >&4 ;;
15248 *) echo 'pthread_yield() NOT found.' >&4 ;;
15252 set d_pthread_yield
15255 case "$sched_yield" in
15256 '') sched_yield=undef ;;
15261 : see if random_r exists
15262 set random_r d_random_r
15264 case "$d_random_r" in
15266 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
15267 case "$d_random_r_proto:$usethreads" in
15268 ":define") d_random_r_proto=define
15269 set d_random_r_proto random_r $hdrs
15273 case "$d_random_r_proto" in
15275 case "$random_r_proto" in
15276 ''|0) try='int random_r(int*, struct random_data*);'
15277 ./protochk "extern $try" $hdrs && random_r_proto=I_iS ;;
15279 case "$random_r_proto" in
15280 ''|0) try='int random_r(long*, struct random_data*);'
15281 ./protochk "extern $try" $hdrs && random_r_proto=I_lS ;;
15283 case "$random_r_proto" in
15284 ''|0) try='int random_r(struct random_data*, int32_t*);'
15285 ./protochk "extern $try" $hdrs && random_r_proto=I_St ;;
15287 case "$random_r_proto" in
15288 ''|0) d_random_r=undef
15290 echo "Disabling random_r, cannot determine prototype." >&4 ;;
15291 * ) case "$random_r_proto" in
15292 REENTRANT_PROTO*) ;;
15293 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
15295 echo "Prototype: $try" ;;
15298 *) case "$usethreads" in
15299 define) echo "random_r has no prototype, not using it." >&4 ;;
15306 *) random_r_proto=0
15310 : see if readdir and friends exist
15311 set readdir d_readdir
15313 set seekdir d_seekdir
15315 set telldir d_telldir
15317 set rewinddir d_rewinddir
15320 : see if readdir64_r exists
15321 set readdir64_r d_readdir64_r
15323 case "$d_readdir64_r" in
15325 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15326 case "$d_readdir64_r_proto:$usethreads" in
15327 ":define") d_readdir64_r_proto=define
15328 set d_readdir64_r_proto readdir64_r $hdrs
15332 case "$d_readdir64_r_proto" in
15334 case "$readdir64_r_proto" in
15335 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
15336 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TSR ;;
15338 case "$readdir64_r_proto" in
15339 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
15340 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TS ;;
15342 case "$readdir64_r_proto" in
15343 ''|0) d_readdir64_r=undef
15344 readdir64_r_proto=0
15345 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
15346 * ) case "$readdir64_r_proto" in
15347 REENTRANT_PROTO*) ;;
15348 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
15350 echo "Prototype: $try" ;;
15353 *) case "$usethreads" in
15354 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
15356 d_readdir64_r=undef
15357 readdir64_r_proto=0
15361 *) readdir64_r_proto=0
15365 : see if readdir_r exists
15366 set readdir_r d_readdir_r
15368 case "$d_readdir_r" in
15370 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15371 case "$d_readdir_r_proto:$usethreads" in
15372 ":define") d_readdir_r_proto=define
15373 set d_readdir_r_proto readdir_r $hdrs
15377 case "$d_readdir_r_proto" in
15379 case "$readdir_r_proto" in
15380 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
15381 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TSR ;;
15383 case "$readdir_r_proto" in
15384 ''|0) try='int readdir_r(DIR*, struct dirent*);'
15385 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TS ;;
15387 case "$readdir_r_proto" in
15388 ''|0) d_readdir_r=undef
15390 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
15391 * ) case "$readdir_r_proto" in
15392 REENTRANT_PROTO*) ;;
15393 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
15395 echo "Prototype: $try" ;;
15398 *) case "$usethreads" in
15399 define) echo "readdir_r has no prototype, not using it." >&4 ;;
15406 *) readdir_r_proto=0
15410 : see if readv exists
15414 : see if recvmsg exists
15415 set recvmsg d_recvmsg
15418 : see if rename exists
15419 set rename d_rename
15422 : see if rmdir exists
15426 : see if memory.h is available.
15431 : See if it conflicts with string.h
15437 $cppstdin $cppflags $cppminus < $strings > mem.h
15438 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
15440 echo "We won't be including <memory.h>."
15450 : can bcopy handle overlapping blocks?
15453 case "$d_memmove" in
15454 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
15455 *) case "$d_bcopy" in
15457 echo "Checking to see if bcopy() can do overlapping copies..." >&4
15459 #$i_memory I_MEMORY
15460 #$i_stdlib I_STDLIB
15461 #$i_string I_STRING
15462 #$i_unistd I_UNISTD
15464 $cat >>try.c <<'EOCP'
15467 # include <memory.h>
15470 # include <stdlib.h>
15473 # include <string.h>
15475 # include <strings.h>
15478 # include <unistd.h> /* Needed for NetBSD */
15482 char buf[128], abc[128];
15488 /* Copy "abcde..." string to char abc[] so that gcc doesn't
15489 try to store the string in read-only memory. */
15490 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
15492 for (align = 7; align >= 0; align--) {
15493 for (len = 36; len; len--) {
15495 bcopy(abc, b, len);
15496 for (off = 1; off <= len; off++) {
15497 bcopy(b, b+off, len);
15498 bcopy(b+off, b, len);
15499 if (bcmp(b, abc, len))
15508 if eval $compile_ok; then
15509 if ./try 2>/dev/null; then
15510 echo "Yes, it can."
15513 echo "It can't, sorry."
15516 echo "(I can't compile the test program, so we'll assume not...)"
15520 $rm -f try.* try core
15526 : can memcpy handle overlapping blocks?
15529 case "$d_memmove" in
15530 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
15531 *) case "$d_memcpy" in
15533 echo "Checking to see if memcpy() can do overlapping copies..." >&4
15535 #$i_memory I_MEMORY
15536 #$i_stdlib I_STDLIB
15537 #$i_string I_STRING
15538 #$i_unistd I_UNISTD
15540 $cat >>try.c <<'EOCP'
15543 # include <memory.h>
15546 # include <stdlib.h>
15549 # include <string.h>
15551 # include <strings.h>
15554 # include <unistd.h> /* Needed for NetBSD */
15558 char buf[128], abc[128];
15564 /* Copy "abcde..." string to char abc[] so that gcc doesn't
15565 try to store the string in read-only memory. */
15566 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
15568 for (align = 7; align >= 0; align--) {
15569 for (len = 36; len; len--) {
15571 memcpy(b, abc, len);
15572 for (off = 1; off <= len; off++) {
15573 memcpy(b+off, b, len);
15574 memcpy(b, b+off, len);
15575 if (memcmp(b, abc, len))
15584 if eval $compile_ok; then
15585 if ./try 2>/dev/null; then
15586 echo "Yes, it can."
15589 echo "It can't, sorry."
15592 echo "(I can't compile the test program, so we'll assume not...)"
15596 $rm -f try.* try core
15602 : can memcmp be trusted to compare relative magnitude?
15604 case "$d_memcmp" in
15607 echo "Checking if your memcmp() can compare relative magnitude..." >&4
15609 #$i_memory I_MEMORY
15610 #$i_stdlib I_STDLIB
15611 #$i_string I_STRING
15612 #$i_unistd I_UNISTD
15614 $cat >>try.c <<'EOCP'
15617 # include <memory.h>
15620 # include <stdlib.h>
15623 # include <string.h>
15625 # include <strings.h>
15628 # include <unistd.h> /* Needed for NetBSD */
15634 if ((a < b) && memcmp(&a, &b, 1) < 0)
15640 if eval $compile_ok; then
15641 if $run ./try 2>/dev/null; then
15642 echo "Yes, it can."
15645 echo "No, it can't (it uses signed chars)."
15648 echo "(I can't compile the test program, so we'll assume not...)"
15652 $rm -f try.* try core
15656 : see if prototype for sbrk is available
15658 set d_sbrkproto sbrk $i_unistd unistd.h
15661 : see if select exists
15662 set select d_select
15665 : see if semctl exists
15666 set semctl d_semctl
15669 : see if semget exists
15670 set semget d_semget
15673 : see if semop exists
15677 : see how much of the 'sem*(2)' library is present.
15680 case "$d_semctl$d_semget$d_semop" in
15681 *"$undef"*) h_sem=false;;
15685 case "`ipcs 2>&1`" in
15686 "SVID messages"*"not configured"*)
15687 echo "Your $osname does not have the sem*(2) configured." >&4
15690 set semctl d_semctl
15692 set semget d_semget
15700 : we could also check for sys/ipc.h ...
15701 if $h_sem && $test `./findhdr sys/sem.h`; then
15702 echo "You have the full sem*(2) library." >&4
15705 echo "You don't have the full sem*(2) library." >&4
15711 : see whether sys/sem.h defines union semun
15713 $cat > try.c <<'END'
15714 #include <sys/types.h>
15715 #include <sys/ipc.h>
15716 #include <sys/sem.h>
15717 int main () { union semun semun; semun.buf = 0; }
15720 if eval $compile; then
15721 echo "You have union semun in <sys/sem.h>." >&4
15724 echo "You do not have union semun in <sys/sem.h>." >&4
15731 : see how to do semctl IPC_STAT
15738 # define S_IRUSR S_IREAD
15739 # define S_IWUSR S_IWRITE
15740 # define S_IXUSR S_IEXEC
15742 # define S_IRUSR 0400
15743 # define S_IWUSR 0200
15744 # define S_IXUSR 0100
15746 # define S_IRGRP (S_IRUSR>>3)
15747 # define S_IWGRP (S_IWUSR>>3)
15748 # define S_IXGRP (S_IXUSR>>3)
15749 # define S_IROTH (S_IRUSR>>6)
15750 # define S_IWOTH (S_IWUSR>>6)
15751 # define S_IXOTH (S_IXUSR>>6)
15754 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
15755 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
15756 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
15759 : see whether semctl IPC_STAT can use union semun
15760 case "$d_semctl_semun" in
15764 #include <sys/types.h>
15765 #include <sys/ipc.h>
15766 #include <sys/sem.h>
15767 #include <sys/stat.h>
15774 #$d_union_semun HAS_UNION_SEMUN
15777 #ifndef HAS_UNION_SEMUN
15780 struct semid_ds *buf;
15781 unsigned short *array;
15787 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
15788 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
15790 struct semid_ds argbuf;
15793 st = semctl(sem, 0, IPC_STAT, arg);
15797 # endif /* IPC_STAT */
15798 printf("semctl IPC_STAT failed: errno = %d\n", errno);
15800 if (semctl(sem, 0, IPC_RMID, arg) != 0)
15801 # endif /* IPC_RMID */
15802 printf("semctl IPC_RMID failed: errno = %d\n", errno);
15804 #endif /* IPC_PRIVATE && ... */
15805 printf("semget failed: errno = %d\n", errno);
15810 if eval $compile; then
15813 semun) val="$define" ;;
15821 case "$d_semctl_semun" in
15823 echo "You can use union semun for semctl IPC_STAT." >&4
15826 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
15831 : see whether semctl IPC_STAT can use struct semid_ds pointer
15832 case "$d_semctl_semid_ds" in
15835 $cat > try.c <<'END'
15836 #include <sys/types.h>
15837 #include <sys/ipc.h>
15838 #include <sys/sem.h>
15839 #include <sys/stat.h>
15847 struct semid_ds arg;
15850 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
15851 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
15854 st = semctl(sem, 0, IPC_STAT, &arg);
15856 printf("semid_ds\n");
15858 # endif /* IPC_STAT */
15859 printf("semctl IPC_STAT failed: errno = %d\n", errno);
15861 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
15862 # endif /* IPC_RMID */
15863 printf("semctl IPC_RMID failed: errno = %d\n", errno);
15865 #endif /* IPC_PRIVATE && ... */
15866 printf("semget failed: errno = %d\n", errno);
15872 if eval $compile; then
15875 semid_ds) val="$define" ;;
15879 set d_semctl_semid_ds
15883 case "$d_semctl_semid_ds" in
15885 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
15887 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
15894 # We do not have the full sem*(2) library, so assume we can not
15900 set d_semctl_semid_ds
15905 : see if sendmsg exists
15906 set sendmsg d_sendmsg
15909 : see if setegid exists
15910 set setegid d_setegid
15913 : see if seteuid exists
15914 set seteuid d_seteuid
15917 : see if setgrent exists
15918 set setgrent d_setgrent
15921 : see if setgrent_r exists
15922 set setgrent_r d_setgrent_r
15924 case "$d_setgrent_r" in
15926 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
15927 case "$d_setgrent_r_proto:$usethreads" in
15928 ":define") d_setgrent_r_proto=define
15929 set d_setgrent_r_proto setgrent_r $hdrs
15933 case "$d_setgrent_r_proto" in
15935 case "$setgrent_r_proto" in
15936 ''|0) try='int setgrent_r(FILE**);'
15937 ./protochk "extern $try" $hdrs && setgrent_r_proto=I_H ;;
15939 case "$setgrent_r_proto" in
15940 ''|0) try='void setgrent_r(FILE**);'
15941 ./protochk "extern $try" $hdrs && setgrent_r_proto=V_H ;;
15943 case "$setgrent_r_proto" in
15944 ''|0) d_setgrent_r=undef
15946 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
15947 * ) case "$setgrent_r_proto" in
15948 REENTRANT_PROTO*) ;;
15949 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
15951 echo "Prototype: $try" ;;
15954 *) case "$usethreads" in
15955 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
15962 *) setgrent_r_proto=0
15966 : see if sethostent exists
15967 set sethostent d_sethent
15970 : see if sethostent_r exists
15971 set sethostent_r d_sethostent_r
15973 case "$d_sethostent_r" in
15975 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15976 case "$d_sethostent_r_proto:$usethreads" in
15977 ":define") d_sethostent_r_proto=define
15978 set d_sethostent_r_proto sethostent_r $hdrs
15982 case "$d_sethostent_r_proto" in
15984 case "$sethostent_r_proto" in
15985 ''|0) try='int sethostent_r(int, struct hostent_data*);'
15986 ./protochk "extern $try" $hdrs && sethostent_r_proto=I_ID ;;
15988 case "$sethostent_r_proto" in
15989 ''|0) try='void sethostent_r(int, struct hostent_data*);'
15990 ./protochk "extern $try" $hdrs && sethostent_r_proto=V_ID ;;
15992 case "$sethostent_r_proto" in
15993 ''|0) d_sethostent_r=undef
15994 sethostent_r_proto=0
15995 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
15996 * ) case "$sethostent_r_proto" in
15997 REENTRANT_PROTO*) ;;
15998 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
16000 echo "Prototype: $try" ;;
16003 *) case "$usethreads" in
16004 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
16006 d_sethostent_r=undef
16007 sethostent_r_proto=0
16011 *) sethostent_r_proto=0
16015 : see if setitimer exists
16016 set setitimer d_setitimer
16019 : see if setlinebuf exists
16020 set setlinebuf d_setlinebuf
16023 : see if setlocale exists
16024 set setlocale d_setlocale
16027 : see if locale.h is available
16028 set locale.h i_locale
16031 : see if setlocale_r exists
16032 set setlocale_r d_setlocale_r
16034 case "$d_setlocale_r" in
16036 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
16037 case "$d_setlocale_r_proto:$usethreads" in
16038 ":define") d_setlocale_r_proto=define
16039 set d_setlocale_r_proto setlocale_r $hdrs
16043 case "$d_setlocale_r_proto" in
16045 case "$setlocale_r_proto" in
16046 ''|0) try='int setlocale_r(int, const char*, char*, int);'
16047 ./protochk "extern $try" $hdrs && setlocale_r_proto=I_ICBI ;;
16049 case "$setlocale_r_proto" in
16050 ''|0) d_setlocale_r=undef
16051 setlocale_r_proto=0
16052 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
16053 * ) case "$setlocale_r_proto" in
16054 REENTRANT_PROTO*) ;;
16055 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
16057 echo "Prototype: $try" ;;
16060 *) case "$usethreads" in
16061 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
16063 d_setlocale_r=undef
16064 setlocale_r_proto=0
16068 *) setlocale_r_proto=0
16072 : see if setnetent exists
16073 set setnetent d_setnent
16076 : see if setnetent_r exists
16077 set setnetent_r d_setnetent_r
16079 case "$d_setnetent_r" in
16081 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16082 case "$d_setnetent_r_proto:$usethreads" in
16083 ":define") d_setnetent_r_proto=define
16084 set d_setnetent_r_proto setnetent_r $hdrs
16088 case "$d_setnetent_r_proto" in
16090 case "$setnetent_r_proto" in
16091 ''|0) try='int setnetent_r(int, struct netent_data*);'
16092 ./protochk "extern $try" $hdrs && setnetent_r_proto=I_ID ;;
16094 case "$setnetent_r_proto" in
16095 ''|0) try='void setnetent_r(int, struct netent_data*);'
16096 ./protochk "extern $try" $hdrs && setnetent_r_proto=V_ID ;;
16098 case "$setnetent_r_proto" in
16099 ''|0) d_setnetent_r=undef
16100 setnetent_r_proto=0
16101 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
16102 * ) case "$setnetent_r_proto" in
16103 REENTRANT_PROTO*) ;;
16104 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
16106 echo "Prototype: $try" ;;
16109 *) case "$usethreads" in
16110 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
16112 d_setnetent_r=undef
16113 setnetent_r_proto=0
16117 *) setnetent_r_proto=0
16121 : see if setprotoent exists
16122 set setprotoent d_setpent
16125 : see if setpgid exists
16126 set setpgid d_setpgid
16129 : see if setpgrp2 exists
16130 set setpgrp2 d_setpgrp2
16133 : see if setpriority exists
16134 set setpriority d_setprior
16137 : see if setproctitle exists
16138 set setproctitle d_setproctitle
16141 : see if setprotoent_r exists
16142 set setprotoent_r d_setprotoent_r
16144 case "$d_setprotoent_r" in
16146 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16147 case "$d_setprotoent_r_proto:$usethreads" in
16148 ":define") d_setprotoent_r_proto=define
16149 set d_setprotoent_r_proto setprotoent_r $hdrs
16153 case "$d_setprotoent_r_proto" in
16155 case "$setprotoent_r_proto" in
16156 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
16157 ./protochk "extern $try" $hdrs && setprotoent_r_proto=I_ID ;;
16159 case "$setprotoent_r_proto" in
16160 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
16161 ./protochk "extern $try" $hdrs && setprotoent_r_proto=V_ID ;;
16163 case "$setprotoent_r_proto" in
16164 ''|0) d_setprotoent_r=undef
16165 setprotoent_r_proto=0
16166 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
16167 * ) case "$setprotoent_r_proto" in
16168 REENTRANT_PROTO*) ;;
16169 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
16171 echo "Prototype: $try" ;;
16174 *) case "$usethreads" in
16175 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
16177 d_setprotoent_r=undef
16178 setprotoent_r_proto=0
16182 *) setprotoent_r_proto=0
16186 : see if setpwent exists
16187 set setpwent d_setpwent
16190 : see if setpwent_r exists
16191 set setpwent_r d_setpwent_r
16193 case "$d_setpwent_r" in
16195 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
16196 case "$d_setpwent_r_proto:$usethreads" in
16197 ":define") d_setpwent_r_proto=define
16198 set d_setpwent_r_proto setpwent_r $hdrs
16202 case "$d_setpwent_r_proto" in
16204 case "$setpwent_r_proto" in
16205 ''|0) try='int setpwent_r(FILE**);'
16206 ./protochk "extern $try" $hdrs && setpwent_r_proto=I_H ;;
16208 case "$setpwent_r_proto" in
16209 ''|0) try='void setpwent_r(FILE**);'
16210 ./protochk "extern $try" $hdrs && setpwent_r_proto=V_H ;;
16212 case "$setpwent_r_proto" in
16213 ''|0) d_setpwent_r=undef
16215 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
16216 * ) case "$setpwent_r_proto" in
16217 REENTRANT_PROTO*) ;;
16218 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
16220 echo "Prototype: $try" ;;
16223 *) case "$usethreads" in
16224 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
16231 *) setpwent_r_proto=0
16235 : see if setregid exists
16236 set setregid d_setregid
16238 set setresgid d_setresgid
16241 : see if setreuid exists
16242 set setreuid d_setreuid
16244 set setresuid d_setresuid
16247 : see if setrgid exists
16248 set setrgid d_setrgid
16251 : see if setruid exists
16252 set setruid d_setruid
16255 : see if setservent exists
16256 set setservent d_setsent
16259 : see if setservent_r exists
16260 set setservent_r d_setservent_r
16262 case "$d_setservent_r" in
16264 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16265 case "$d_setservent_r_proto:$usethreads" in
16266 ":define") d_setservent_r_proto=define
16267 set d_setservent_r_proto setservent_r $hdrs
16271 case "$d_setservent_r_proto" in
16273 case "$setservent_r_proto" in
16274 ''|0) try='int setservent_r(int, struct servent_data*);'
16275 ./protochk "extern $try" $hdrs && setservent_r_proto=I_ID ;;
16277 case "$setservent_r_proto" in
16278 ''|0) try='void setservent_r(int, struct servent_data*);'
16279 ./protochk "extern $try" $hdrs && setservent_r_proto=V_ID ;;
16281 case "$setservent_r_proto" in
16282 ''|0) d_setservent_r=undef
16283 setservent_r_proto=0
16284 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
16285 * ) case "$setservent_r_proto" in
16286 REENTRANT_PROTO*) ;;
16287 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
16289 echo "Prototype: $try" ;;
16292 *) case "$usethreads" in
16293 define) echo "setservent_r has no prototype, not using it." >&4 ;;
16295 d_setservent_r=undef
16296 setservent_r_proto=0
16300 *) setservent_r_proto=0
16304 : see if setsid exists
16305 set setsid d_setsid
16308 : see if setvbuf exists
16309 set setvbuf d_setvbuf
16312 : see if sfio.h is available
16317 : see if sfio library is available
16328 : Ok, but do we want to use it.
16332 true|$define|[yY]*) dflt='y';;
16335 echo "$package can use the sfio library, but it is experimental."
16336 case "$useperlio" in
16338 echo "For sfio also the PerlIO abstraction layer is needed."
16339 echo "Earlier you said you wouldn't want that."
16342 rp="You seem to have sfio available, do you want to try using it?"
16345 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
16346 useperlio="$define"
16349 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
16354 *) case "$usesfio" in
16355 true|$define|[yY]*)
16356 echo "Sorry, cannot find sfio on this machine." >&4
16357 echo "Ignoring your setting of usesfio=$usesfio." >&4
16366 $define) usesfio='true';;
16367 *) usesfio='false';;
16371 *) : Remove sfio from list of libraries to use
16374 echo "Removing unneeded -lsfio from library list" >&4
16375 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
16378 echo "libs = $libs" >&4
16385 : see if shmctl exists
16386 set shmctl d_shmctl
16389 : see if shmget exists
16390 set shmget d_shmget
16393 : see if shmat exists
16396 : see what shmat returns
16399 $cat >shmat.c <<'END'
16400 #include <sys/shm.h>
16403 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
16408 echo "and it returns ($shmattype)." >&4
16409 : see if a prototype for shmat is available
16410 xxx=`./findhdr sys/shm.h`
16411 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
16412 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
16423 set d_shmatprototype
16426 : see if shmdt exists
16430 : see how much of the 'shm*(2)' library is present.
16433 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
16434 *"$undef"*) h_shm=false;;
16438 case "`ipcs 2>&1`" in
16439 "SVID shared memory"*"not configured"*)
16440 echo "Your $osname does not have the shm*(2) configured." >&4
16443 set shmctl d_shmctl
16445 set shmget d_shmget
16455 : we could also check for sys/ipc.h ...
16456 if $h_shm && $test `./findhdr sys/shm.h`; then
16457 echo "You have the full shm*(2) library." >&4
16460 echo "You don't have the full shm*(2) library." >&4
16467 : see if we have sigaction
16468 if set sigaction val -f d_sigaction; eval $csym; $val; then
16469 echo 'sigaction() found.' >&4
16472 #include <sys/types.h>
16473 #include <signal.h>
16474 #$i_stdlib I_STDLIB
16476 #include <stdlib.h>
16480 struct sigaction act, oact;
16482 oact.sa_handler = 0;
16483 /* so that act and oact are used */
16484 exit(act.sa_flags == 0 && oact.sa_handler == 0);
16488 if eval $compile_ok; then
16491 echo "But you don't seem to have a useable struct sigaction." >&4
16495 echo 'sigaction NOT found.' >&4
16498 set d_sigaction; eval $setvar
16499 $rm -f try try$_o try.c
16501 : see if sigprocmask exists
16502 set sigprocmask d_sigprocmask
16505 : see if sigsetjmp exists
16507 case "$d_sigsetjmp" in
16510 #include <setjmp.h>
16511 #$i_stdlib I_STDLIB
16513 #include <stdlib.h>
16519 if (sigsetjmp(env,1))
16522 siglongjmp(env, 1);
16527 if eval $compile; then
16528 if $run ./try >/dev/null 2>&1; then
16529 echo "POSIX sigsetjmp found." >&4
16533 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
16539 echo "sigsetjmp not found." >&4
16543 *) val="$d_sigsetjmp"
16544 case "$d_sigsetjmp" in
16545 $define) echo "POSIX sigsetjmp found." >&4;;
16546 $undef) echo "sigsetjmp not found." >&4;;
16554 : see if snprintf exists
16555 set snprintf d_snprintf
16558 : see if vsnprintf exists
16559 set vsnprintf d_vsnprintf
16562 case "$d_snprintf-$d_vsnprintf" in
16565 Checking whether your snprintf() and vsnprintf() work okay...
16567 $cat >try.c <<'EOCP'
16568 /* v?snprintf testing logic courtesy of Russ Allbery.
16569 * According to C99:
16570 * - if the buffer is too short it still must be \0-terminated
16571 * - if the buffer is too short the potentially required length
16572 * must be returned and not -1
16573 * - if the buffer is NULL the potentially required length
16574 * must be returned and not -1 or core dump
16577 #include <stdarg.h>
16581 int test (char *format, ...)
16586 va_start (args, format);
16587 count = vsnprintf (buf, sizeof buf, format, args);
16594 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
16595 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
16599 if eval $compile; then
16602 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
16604 Your snprintf() and snprintf() don't seem to be working okay.
16606 d_snprintf="$undef"
16607 d_vsnprintf="$undef"
16611 echo "(I can't seem to compile the test program--assuming they don't)"
16612 d_snprintf="$undef"
16613 d_vsnprintf="$undef"
16615 $rm -f try.* try core core.try.*
16619 : see if sockatmark exists
16620 set sockatmark d_sockatmark
16623 : see if prototype for sockatmark is available
16625 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
16628 : see if socks5_init exists
16629 set socks5_init d_socks5_init
16632 : see if sprintf returns the length of the string in the buffer as per ANSI
16633 $echo "Checking whether sprintf returns the length of the string..." >&4
16636 #$i_stdlib I_STDLIB
16638 #include <stdlib.h>
16640 #$i_string I_STRING
16642 # include <string.h>
16644 # include <strings.h>
16653 int check (size_t expect, int test) {
16654 size_t got = strlen(buffer);
16658 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
16663 int main(int argc, char **argv) {
16666 check(sprintf(buffer, ""), ++test);
16667 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
16668 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
16675 d_sprintf_returns_strlen="$undef"
16676 if eval $compile; then
16680 sprintf returns the length of the string (as ANSI says it should)
16682 d_sprintf_returns_strlen="$define"
16685 sprintf does not return the length of the string (how old is this system?)
16687 d_sprintf_returns_strlen="$undef"
16694 : see if srand48_r exists
16695 set srand48_r d_srand48_r
16697 case "$d_srand48_r" in
16699 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16700 case "$d_srand48_r_proto:$usethreads" in
16701 ":define") d_srand48_r_proto=define
16702 set d_srand48_r_proto srand48_r $hdrs
16706 case "$d_srand48_r_proto" in
16708 case "$srand48_r_proto" in
16709 ''|0) try='int srand48_r(long, struct drand48_data*);'
16710 ./protochk "extern $try" $hdrs && srand48_r_proto=I_LS ;;
16712 case "$srand48_r_proto" in
16713 ''|0) d_srand48_r=undef
16715 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
16716 * ) case "$srand48_r_proto" in
16717 REENTRANT_PROTO*) ;;
16718 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
16720 echo "Prototype: $try" ;;
16723 *) case "$usethreads" in
16724 define) echo "srand48_r has no prototype, not using it." >&4 ;;
16731 *) srand48_r_proto=0
16735 : see if srandom_r exists
16736 set srandom_r d_srandom_r
16738 case "$d_srandom_r" in
16740 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16741 case "$d_srandom_r_proto:$usethreads" in
16742 ":define") d_srandom_r_proto=define
16743 set d_srandom_r_proto srandom_r $hdrs
16747 case "$d_srandom_r_proto" in
16749 case "$srandom_r_proto" in
16750 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
16751 ./protochk "extern $try" $hdrs && srandom_r_proto=I_TS ;;
16753 case "$srandom_r_proto" in
16754 ''|0) d_srandom_r=undef
16756 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
16757 * ) case "$srandom_r_proto" in
16758 REENTRANT_PROTO*) ;;
16759 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
16761 echo "Prototype: $try" ;;
16764 *) case "$usethreads" in
16765 define) echo "srandom_r has no prototype, not using it." >&4 ;;
16772 *) srandom_r_proto=0
16776 : see if prototype for setresgid is available
16778 set d_sresgproto setresgid $i_unistd unistd.h
16781 : see if prototype for setresuid is available
16783 set d_sresuproto setresuid $i_unistd unistd.h
16786 : see if sys/stat.h is available
16787 set sys/stat.h i_sysstat
16791 : see if stat knows about block sizes
16793 echo "Checking to see if your struct stat has st_blocks field..." >&4
16794 set d_statblks stat st_blocks $i_sysstat sys/stat.h
16798 : see if this is a sys/vfs.h system
16799 set sys/vfs.h i_sysvfs
16803 : see if this is a sys/statfs.h system
16804 set sys/statfs.h i_sysstatfs
16809 echo "Checking to see if your system supports struct statfs..." >&4
16810 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
16812 case "$d_statfs_s" in
16813 "$define") echo "Yes, it does." ;;
16814 *) echo "No, it doesn't." ;;
16819 : see if struct statfs knows about f_flags
16820 case "$d_statfs_s" in
16823 echo "Checking to see if your struct statfs has f_flags field..." >&4
16824 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
16828 set d_statfs_f_flags
16832 case "$d_statfs_f_flags" in
16833 "$define") echo "Yes, it does." ;;
16834 *) echo "No, it doesn't." ;;
16838 Checking how to access stdio streams by file descriptor number...
16840 case "$stdio_stream_array" in
16841 '') $cat >try.c <<EOCP
16844 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
16848 for s in _iob __iob __sF
16850 set try -DSTDIO_STREAM_ARRAY=$s
16851 if eval $compile; then
16852 case "`$run ./try`" in
16853 yes) stdio_stream_array=$s; break ;;
16857 $rm -f try.* try$exe_ext
16859 case "$stdio_stream_array" in
16861 I can't figure out how to access stdio streams by file descriptor number.
16863 d_stdio_stream_array="$undef"
16866 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
16868 d_stdio_stream_array="$define"
16872 : see if strcoll exists
16873 set strcoll d_strcoll
16876 : check for structure copying
16878 echo "Checking to see if your C compiler can copy structs..." >&4
16879 $cat >try.c <<'EOCP'
16889 if $cc -c try.c >/dev/null 2>&1 ; then
16891 echo "Yup, it can."
16894 echo "Nope, it can't."
16900 : see if strerror and/or sys_errlist[] exist
16902 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
16903 if set strerror val -f d_strerror; eval $csym; $val; then
16904 echo 'strerror() found.' >&4
16905 d_strerror="$define"
16906 d_strerrm='strerror(e)'
16907 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
16908 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
16909 d_syserrlst="$define"
16911 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
16912 d_syserrlst="$undef"
16914 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
16915 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
16916 echo 'strerror() found in string header.' >&4
16917 d_strerror="$define"
16918 d_strerrm='strerror(e)'
16919 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
16920 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
16921 d_syserrlst="$define"
16923 echo "(You don't appear to have any sys_errlist[], how can this be?)"
16924 d_syserrlst="$undef"
16926 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
16927 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
16928 d_strerror="$undef"
16929 d_syserrlst="$define"
16930 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
16932 echo 'strerror() and sys_errlist[] NOT found.' >&4
16933 d_strerror="$undef"
16934 d_syserrlst="$undef"
16935 d_strerrm='"unknown"'
16939 : see if strerror_r exists
16940 set strerror_r d_strerror_r
16942 case "$d_strerror_r" in
16944 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
16945 case "$d_strerror_r_proto:$usethreads" in
16946 ":define") d_strerror_r_proto=define
16947 set d_strerror_r_proto strerror_r $hdrs
16951 case "$d_strerror_r_proto" in
16953 case "$strerror_r_proto" in
16954 ''|0) try='int strerror_r(int, char*, size_t);'
16955 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBW ;;
16957 case "$strerror_r_proto" in
16958 ''|0) try='int strerror_r(int, char*, int);'
16959 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBI ;;
16961 case "$strerror_r_proto" in
16962 ''|0) try='char* strerror_r(int, char*, size_t);'
16963 ./protochk "extern $try" $hdrs && strerror_r_proto=B_IBW ;;
16965 case "$strerror_r_proto" in
16966 ''|0) d_strerror_r=undef
16968 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
16969 * ) case "$strerror_r_proto" in
16970 REENTRANT_PROTO*) ;;
16971 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
16973 echo "Prototype: $try" ;;
16976 *) case "$usethreads" in
16977 define) echo "strerror_r has no prototype, not using it." >&4 ;;
16984 *) strerror_r_proto=0
16988 : see if strftime exists
16989 set strftime d_strftime
16992 : see if strlcat exists
16993 set strlcat d_strlcat
16996 : see if strlcpy exists
16997 set strlcpy d_strlcpy
17000 : see if strtod exists
17001 set strtod d_strtod
17004 : see if strtol exists
17005 set strtol d_strtol
17008 : see if strtold exists
17009 set strtold d_strtold
17012 : see if strtoll exists
17013 set strtoll d_strtoll
17016 case "$d_longlong-$d_strtoll" in
17019 Checking whether your strtoll() works okay...
17021 $cat >try.c <<'EOCP'
17024 #define strtoll __strtoll
17027 #define strtoll _strtoll
17030 extern long long int strtoll(char *s, char **, int);
17031 static int bad = 0;
17032 int check(char *s, long long ell, int een) {
17035 gll = strtoll(s, 0, 10);
17036 if (!((gll == ell) && (errno == een)))
17040 check(" 1", 1LL, 0);
17041 check(" 0", 0LL, 0);
17042 check("-1", -1LL, 0);
17043 check("-9223372036854775808", -9223372036854775808LL, 0);
17044 check("-9223372036854775808", -9223372036854775808LL, 0);
17045 check(" 9223372036854775807", 9223372036854775807LL, 0);
17046 check("-9223372036854775808", -9223372036854775808LL, 0);
17047 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
17048 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
17054 if eval $compile; then
17057 ok) echo "Your strtoll() seems to be working okay." ;;
17059 Your strtoll() doesn't seem to be working okay.
17065 echo "(I can't seem to compile the test program--assuming it doesn't)"
17071 : see if strtoq exists
17072 set strtoq d_strtoq
17075 : see if strtoul exists
17076 set strtoul d_strtoul
17079 case "$d_strtoul" in
17082 Checking whether your strtoul() works okay...
17084 $cat >try.c <<'EOCP'
17087 extern unsigned long int strtoul(char *s, char **, int);
17088 static int bad = 0;
17089 void check(char *s, unsigned long eul, int een) {
17092 gul = strtoul(s, 0, 10);
17093 if (!((gul == eul) && (errno == een)))
17097 check(" 1", 1L, 0);
17098 check(" 0", 0L, 0);
17100 case "$longsize" in
17102 $cat >>try.c <<'EOCP'
17103 check("18446744073709551615", 18446744073709551615UL, 0);
17104 check("18446744073709551616", 18446744073709551615UL, ERANGE);
17105 #if 0 /* strtoul() for /^-/ strings is undefined. */
17106 check("-1", 18446744073709551615UL, 0);
17107 check("-18446744073709551614", 2, 0);
17108 check("-18446744073709551615", 1, 0);
17109 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
17110 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
17115 $cat >>try.c <<'EOCP'
17116 check("4294967295", 4294967295UL, 0);
17117 check("4294967296", 4294967295UL, ERANGE);
17118 #if 0 /* strtoul() for /^-/ strings is undefined. */
17119 check("-1", 4294967295UL, 0);
17120 check("-4294967294", 2, 0);
17121 check("-4294967295", 1, 0);
17122 check("-4294967296", 4294967295UL, ERANGE);
17123 check("-4294967297", 4294967295UL, ERANGE);
17128 : Should we write these tests to be more portable by sprintf-ing
17129 : ~0 and then manipulating that char string as input for strtol?
17132 $cat >>try.c <<'EOCP'
17139 if eval $compile; then
17140 case "`$run ./try`" in
17141 ok) echo "Your strtoul() seems to be working okay." ;;
17143 Your strtoul() doesn't seem to be working okay.
17152 : see if strtoull exists
17153 set strtoull d_strtoull
17156 case "$d_longlong-$d_strtoull" in
17159 Checking whether your strtoull() works okay...
17161 $cat >try.c <<'EOCP'
17164 #define strtoull __strtoull
17167 extern unsigned long long int strtoull(char *s, char **, int);
17168 static int bad = 0;
17169 int check(char *s, long long eull, int een) {
17172 gull = strtoull(s, 0, 10);
17173 if (!((gull == eull) && (errno == een)))
17177 check(" 1", 1LL, 0);
17178 check(" 0", 0LL, 0);
17179 check("18446744073709551615", 18446744073709551615ULL, 0);
17180 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17181 #if 0 /* strtoull() for /^-/ strings is undefined. */
17182 check("-1", 18446744073709551615ULL, 0);
17183 check("-18446744073709551614", 2LL, 0);
17184 check("-18446744073709551615", 1LL, 0);
17185 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17186 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17193 if eval $compile; then
17194 case "`$run ./try`" in
17195 ok) echo "Your strtoull() seems to be working okay." ;;
17197 Your strtoull() doesn't seem to be working okay.
17199 d_strtoull="$undef"
17206 : see if strtouq exists
17207 set strtouq d_strtouq
17210 case "$d_strtouq" in
17213 Checking whether your strtouq() works okay...
17215 $cat >try.c <<'EOCP'
17218 extern unsigned long long int strtouq(char *s, char **, int);
17219 static int bad = 0;
17220 void check(char *s, unsigned long long eull, int een) {
17221 unsigned long long gull;
17223 gull = strtouq(s, 0, 10);
17224 if (!((gull == eull) && (errno == een)))
17228 check(" 1", 1LL, 0);
17229 check(" 0", 0LL, 0);
17230 check("18446744073709551615", 18446744073709551615ULL, 0);
17231 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17232 #if 0 /* strtouq() for /^-/ strings is undefined. */
17233 check("-1", 18446744073709551615ULL, 0);
17234 check("-18446744073709551614", 2LL, 0);
17235 check("-18446744073709551615", 1LL, 0);
17236 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17237 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17245 if eval $compile; then
17246 case "`$run ./try`" in
17247 ok) echo "Your strtouq() seems to be working okay." ;;
17249 Your strtouq() doesn't seem to be working okay.
17258 : see if strxfrm exists
17259 set strxfrm d_strxfrm
17262 : see if symlink exists
17263 set symlink d_symlink
17266 : see if syscall exists
17267 set syscall d_syscall
17270 : see if prototype for syscall is available
17272 set d_syscallproto syscall $i_unistd unistd.h
17275 : see if sysconf exists
17276 set sysconf d_sysconf
17279 : see if system exists
17280 set system d_system
17283 : see if tcgetpgrp exists
17284 set tcgetpgrp d_tcgetpgrp
17287 : see if tcsetpgrp exists
17288 set tcsetpgrp d_tcsetpgrp
17291 : see if prototype for telldir is available
17293 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
17296 : see if time exists
17298 if test "X$d_time" = X -o X"$timetype" = X; then
17299 if set time val -f d_time; eval $csym; $val; then
17300 echo 'time() found.' >&4
17302 rp="What is the type returned by time() on this system?"
17303 set time_t timetype long stdio.h sys/types.h
17306 echo 'time() not found, hope that will do.' >&4
17314 : see if this is a sys/times.h system
17315 set sys/times.h i_systimes
17318 : see if times exists
17320 if set times val -f d_times; eval $csym; $val; then
17321 echo 'times() found.' >&4
17324 case "$i_systimes" in
17325 "$define") inc='sys/times.h';;
17327 rp="What is the type returned by times() on this system?"
17328 set clock_t clocktype long stdio.h sys/types.h $inc
17331 echo 'times() NOT found, hope that will do.' >&4
17336 : see if tmpnam_r exists
17337 set tmpnam_r d_tmpnam_r
17339 case "$d_tmpnam_r" in
17341 hdrs="$i_systypes sys/types.h define stdio.h "
17342 case "$d_tmpnam_r_proto:$usethreads" in
17343 ":define") d_tmpnam_r_proto=define
17344 set d_tmpnam_r_proto tmpnam_r $hdrs
17348 case "$d_tmpnam_r_proto" in
17350 case "$tmpnam_r_proto" in
17351 ''|0) try='char* tmpnam_r(char*);'
17352 ./protochk "extern $try" $hdrs && tmpnam_r_proto=B_B ;;
17354 case "$tmpnam_r_proto" in
17355 ''|0) d_tmpnam_r=undef
17357 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
17358 * ) case "$tmpnam_r_proto" in
17359 REENTRANT_PROTO*) ;;
17360 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
17362 echo "Prototype: $try" ;;
17365 *) case "$usethreads" in
17366 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
17373 *) tmpnam_r_proto=0
17377 : see if truncate exists
17378 set truncate d_truncate
17381 : see if ttyname_r exists
17382 set ttyname_r d_ttyname_r
17384 case "$d_ttyname_r" in
17386 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
17387 case "$d_ttyname_r_proto:$usethreads" in
17388 ":define") d_ttyname_r_proto=define
17389 set d_ttyname_r_proto ttyname_r $hdrs
17393 case "$d_ttyname_r_proto" in
17395 case "$ttyname_r_proto" in
17396 ''|0) try='int ttyname_r(int, char*, size_t);'
17397 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBW ;;
17399 case "$ttyname_r_proto" in
17400 ''|0) try='int ttyname_r(int, char*, int);'
17401 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBI ;;
17403 case "$ttyname_r_proto" in
17404 ''|0) try='char* ttyname_r(int, char*, int);'
17405 ./protochk "extern $try" $hdrs && ttyname_r_proto=B_IBI ;;
17407 case "$ttyname_r_proto" in
17408 ''|0) d_ttyname_r=undef
17410 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
17411 * ) case "$ttyname_r_proto" in
17412 REENTRANT_PROTO*) ;;
17413 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
17415 echo "Prototype: $try" ;;
17418 *) case "$usethreads" in
17419 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
17426 *) ttyname_r_proto=0
17430 : see if tzname[] exists
17432 if set tzname val -a d_tzname; eval $csym; $val; then
17434 echo 'tzname[] found.' >&4
17437 echo 'tzname[] NOT found.' >&4
17443 next|rhapsody|darwin) multiarch="$define" ;;
17445 case "$multiarch" in
17446 ''|[nN]*) multiarch="$undef" ;;
17449 : check for ordering of bytes in a UV
17451 case "$usecrosscompile$multiarch" in
17454 You seem to be either cross-compiling or doing a multiarchitecture build,
17455 skipping the byteorder check.
17461 case "$byteorder" in
17464 In the following, larger digits indicate more significance. A big-endian
17465 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
17466 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
17467 machines may have weird orders like 3412. A Cray will report 87654321,
17468 an Alpha will report 12345678. If the test program works the default is
17470 I'm now running the test program...
17474 #$i_stdlib I_STDLIB
17476 #include <stdlib.h>
17478 #include <sys/types.h>
17479 typedef $uvtype UV;
17489 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
17491 u.l = (UV)0x04030201;
17492 for (i = 0; i < $uvsize; i++)
17493 printf("%c", u.c[i]+'0');
17500 if eval $compile && ./try > /dev/null; then
17503 [1-4][1-4][1-4][1-4]|12345678|87654321)
17504 echo "(The test program ran ok.)"
17505 echo "byteorder=$dflt"
17508 ????|????????) echo "(The test program ran ok.)" ;;
17509 *) echo "(The test program didn't run right for some reason.)" ;;
17514 (I can't seem to compile the test program. Guessing big-endian...)
17517 case "$xxx_prompt" in
17519 rp="What is the order of bytes in $uvtype?"
17535 Checking to see whether you can access character data unalignedly...
17537 case "$d_u32align" in
17538 '') $cat >try.c <<EOCP
17540 #$i_stdlib I_STDLIB
17542 #include <stdlib.h>
17544 #define U32 $u32type
17545 #define BYTEORDER 0x$byteorder
17547 #include <signal.h>
17549 $signal_t bletch(s) int s; { exit(4); }
17552 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
17557 if (sizeof(U32) != 4) {
17558 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
17565 signal(SIGBUS, bletch);
17577 for (i = 0; i < 4; i++) {
17578 up = (U32*)(buf + i);
17579 if (! ((*up == 1 << (8*i)) || /* big-endian */
17580 (*up == 1 << (8*(3-i))) /* little-endian */
17584 printf("read failed (%x)\n", *up);
17590 for (i = 0; i < 4; i++) {
17591 up = (U32*)(buf + i);
17593 if (*up != 0xBeef) {
17594 printf("write failed (%x)\n", *up);
17608 if eval $compile_ok; then
17609 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
17610 $run ./try 2>&1 >/dev/null
17613 You can access character data pretty unalignedly.
17615 d_u32align="$undef"
17618 It seems that you must access character data in an aligned manner.
17620 d_u32align="$define"
17624 rp='Can you access character data at unaligned addresses?'
17628 [yY]*) d_u32align="$undef" ;;
17629 *) d_u32align="$define" ;;
17632 $rm -f core core.try.* try.core
17636 : see if ualarm exists
17637 set ualarm d_ualarm
17640 : see if umask exists
17644 : see if unordered exists
17645 set unordered d_unordered
17648 : see if unsetenv exists
17649 set unsetenv d_unsetenv
17652 : see if usleep exists
17653 set usleep d_usleep
17656 : see if prototype for usleep is available
17658 set d_usleepproto usleep $i_unistd unistd.h
17661 : see if ustat exists
17665 : backward compatibility for d_hvfork
17666 if test X$d_hvfork != X; then
17667 d_vfork="$d_hvfork"
17670 : see if there is a vfork
17675 : Ok, but do we want to use it. vfork is reportedly unreliable in
17676 : perl on Solaris 2.x, and probably elsewhere.
17680 case "$usevfork" in
17686 Perl can only use a vfork() that doesn't suffer from strict
17687 restrictions on calling functions or modifying global data in
17688 the child. For example, glibc-2.1 contains such a vfork()
17689 that is unsuitable. If your system provides a proper fork()
17690 call, chances are that you do NOT want perl to use vfork().
17693 rp="Do you still want to use vfork()?"
17698 echo "Ok, we won't use vfork()."
17707 $define) usevfork='true';;
17708 *) usevfork='false';;
17711 : see if closedir exists
17712 set closedir d_closedir
17715 case "$d_closedir" in
17718 echo "Checking whether closedir() returns a status..." >&4
17720 #$i_dirent I_DIRENT /**/
17721 #$i_sysdir I_SYS_DIR /**/
17722 #$i_sysndir I_SYS_NDIR /**/
17723 #$i_systypes I_SYS_TYPES /**/
17725 #if defined(I_SYS_TYPES)
17726 #include <sys/types.h>
17728 #if defined(I_DIRENT)
17729 #include <dirent.h>
17730 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
17731 #include <sys/dir.h>
17735 #include <sys/ndir.h>
17739 #include <ndir.h> /* may be wrong in the future */
17741 #include <sys/dir.h>
17746 int main() { return closedir(opendir(".")); }
17749 if eval $compile_ok; then
17750 if $run ./try > /dev/null 2>&1 ; then
17751 echo "Yes, it does."
17754 echo "No, it doesn't."
17758 echo "(I can't seem to compile the test program--assuming it doesn't)"
17766 set d_void_closedir
17769 : see if there is a wait4
17773 : see if waitpid exists
17774 set waitpid d_waitpid
17777 : see if wcstombs exists
17778 set wcstombs d_wcstombs
17781 : see if wctomb exists
17782 set wctomb d_wctomb
17785 : see if writev exists
17786 set writev d_writev
17789 : preserve RCS keywords in files with variable substitution, grrr
17794 Revision='$Revision'
17796 : check for alignment requirements
17798 case "$usecrosscompile$multiarch" in
17801 You seem to be either cross-compiling or doing a multiarchitecture build,
17802 skipping the memory alignment check.
17805 case "$alignbytes" in
17806 '') alignbytes=8 ;;
17810 case "$alignbytes" in
17811 '') echo "Checking alignment constraints..." >&4
17812 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
17813 $cat >try.c <<'EOCP'
17814 typedef long double NV;
17817 $cat >try.c <<'EOCP'
17821 $cat >>try.c <<'EOCP'
17829 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
17834 if eval $compile_ok; then
17838 echo "(I can't seem to compile the test program...)"
17841 *) dflt="$alignbytes"
17844 rp="Doubles must be aligned on a how-many-byte boundary?"
17852 : set the base revision
17855 : how do we concatenate cpp tokens here?
17857 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
17858 $cat >cpp_stuff.c <<'EOCP'
17859 #define RCAT(a,b)a/**/b
17860 #define ACAT(a,b)a ## b
17864 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
17865 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
17866 echo "Oh! Smells like ANSI's been here." >&4
17867 echo "We can catify or stringify, separately or together!"
17869 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
17870 echo "Ah, yes! The good old days!" >&4
17871 echo "However, in the good old days we don't know how to stringify and"
17872 echo "catify at the same time."
17876 Hmm, I don't seem to be able to concatenate tokens with your cpp.
17877 You're going to have to edit the values of CAT[2-5] in config.h...
17879 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
17883 : see if this is a db.h system
17889 : Check db version.
17891 echo "Checking Berkeley DB version ..." >&4
17897 #include <sys/types.h>
17899 #$i_stdlib I_STDLIB
17901 #include <stdlib.h>
17904 int main(int argc, char *argv[])
17906 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
17907 int Major, Minor, Patch ;
17908 unsigned long Version ;
17909 (void)db_version(&Major, &Minor, &Patch) ;
17911 printf("%d %d %d %d %d %d\n",
17912 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
17913 Major, Minor, Patch);
17916 printf("You have Berkeley DB Version 2 or greater.\n");
17918 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
17919 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
17920 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
17921 Major, Minor, Patch) ;
17923 /* check that db.h & libdb are compatible */
17924 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
17925 printf("db.h and libdb are incompatible.\n") ;
17929 printf("db.h and libdb are compatible.\n") ;
17931 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
17932 + DB_VERSION_PATCH ;
17934 /* needs to be >= 2.3.4 */
17935 if (Version < 2003004) {
17936 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
17937 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
17943 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
17948 printf("You have Berkeley DB Version 1.\n");
17949 exit(0); /* DB version < 2: the coast is clear. */
17951 exit(1); /* <db.h> not Berkeley DB? */
17957 if eval $compile_ok && $run ./try; then
17958 echo 'Looks OK.' >&4
17960 db_version_major=$1
17961 db_version_minor=$2
17962 db_version_patch=$3
17964 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
17968 : Remove db from list of libraries to use
17969 echo "Removing unusable -ldb from library list" >&4
17970 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
17973 echo "libs = $libs" >&4
17983 : Check the return type needed for hash
17985 echo "Checking return type needed for hash for Berkeley DB ..." >&4
17991 #include <sys/types.h>
17994 #ifndef DB_VERSION_MAJOR
17995 u_int32_t hash_cb (ptr, size)
18003 info.hash = hash_cb;
18007 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18008 if $contains warning try.out >>/dev/null 2>&1 ; then
18011 db_hashtype='u_int32_t'
18014 : XXX Maybe we should just give up here.
18015 db_hashtype=u_int32_t
18017 echo "Help: I can't seem to compile the db test program." >&4
18018 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
18021 echo "Your version of Berkeley DB uses $db_hashtype for hash."
18023 *) db_hashtype=u_int32_t
18028 : Check the return type needed for prefix
18030 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
18036 #include <sys/types.h>
18039 #ifndef DB_VERSION_MAJOR
18040 size_t prefix_cb (key1, key2)
18048 info.prefix = prefix_cb;
18052 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18053 if $contains warning try.out >>/dev/null 2>&1 ; then
18054 db_prefixtype='int'
18056 db_prefixtype='size_t'
18059 db_prefixtype='size_t'
18060 : XXX Maybe we should just give up here.
18062 echo "Help: I can't seem to compile the db test program." >&4
18063 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
18066 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
18068 *) db_prefixtype='size_t'
18073 : How can we generate normalized random numbers ?
18075 echo "Looking for a random number function..." >&4
18076 case "$randfunc" in
18078 if set drand48 val -f; eval $csym; $val; then
18080 echo "Good, found drand48()." >&4
18081 elif set random val -f; eval $csym; $val; then
18083 echo "OK, found random()." >&4
18086 echo "Yick, looks like I have to use rand()." >&4
18097 *-Dmy_rand=*|*-Dmy_srand=*)
18098 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
18099 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
18100 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
18101 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
18105 while $test "$cont"; do
18106 rp="Use which function to generate random numbers?"
18108 if $test "$ans" = "$dflt"; then
18114 if set $ans val -f; eval $csym; $val; then
18118 rp="I cannot find function $ans. Use that name anyway?"
18127 case "$randfunc" in
18129 drand01="drand48()"
18135 case "$randbits" in
18137 echo "Checking to see how many bits your $randfunc() function produces..." >&4
18139 #$i_unistd I_UNISTD
18140 #$i_stdlib I_STDLIB
18143 # include <unistd.h>
18146 # include <stdlib.h>
18151 register unsigned long tmp;
18152 register unsigned long max = 0L;
18154 for (i = 1000; i; i--) {
18155 tmp = (unsigned long) $randfunc();
18156 if (tmp > max) max = tmp;
18158 for (i = 0; max; i++)
18164 if eval $compile_ok; then
18168 echo "(I can't seem to compile the test program...)"
18175 rp="How many bits does your $randfunc() function produce?"
18179 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18180 seedfunc="s$randfunc"
18181 randseedtype=unsigned
18185 rp="How many bits does your $randfunc() function produce?"
18188 seedfunc="s$randfunc"
18189 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18190 if set $seedfunc val -f; eval $csym; $val; then
18191 echo "(Using $seedfunc() to seed random generator)"
18193 echo "(Warning: no $seedfunc() to seed random generator)"
18196 randseedtype=unsigned
18204 echo "Determining whether or not we are on an EBCDIC system..." >&4
18205 $cat >try.c <<'EOM'
18208 if ('M'==0xd4) return 0;
18215 if eval $compile_ok; then
18216 if $run ./try; then
18217 echo "You seem to speak EBCDIC." >&4
18220 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
18223 echo "I'm unable to compile the test program." >&4
18224 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
18232 Checking how to flush all pending stdio output...
18234 # I only know how to find the first 32 possibly open files on SunOS.
18235 # See also hints/sunos_4_1.sh and util.c --AD
18237 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
18239 $cat >>try.c <<EOCP
18241 #$i_stdlib I_STDLIB
18243 #include <stdlib.h>
18245 #$i_unistd I_UNISTD
18247 # include <unistd.h>
18249 #$d_sysconf HAS_SYSCONF
18250 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
18251 #ifdef HAS_STDIO_STREAM_ARRAY
18252 # define STDIO_STREAM_ARRAY $stdio_stream_array
18257 p = fopen("try.out", "w");
18261 # ifdef TRY_FPRINTF
18265 #ifdef TRY_FFLUSH_NULL
18268 #ifdef TRY_FFLUSH_ALL
18270 long open_max = -1;
18271 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
18272 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
18274 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
18275 open_max = sysconf(_SC_OPEN_MAX);
18278 open_max = FOPEN_MAX;
18281 open_max = OPEN_MAX;
18290 # ifdef HAS_STDIO_STREAM_ARRAY
18291 if (open_max > 0) {
18293 for (i = 0; i < open_max; i++)
18294 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
18295 STDIO_STREAM_ARRAY[i]._file < open_max &&
18296 STDIO_STREAM_ARRAY[i]._flag)
18297 fflush(&STDIO_STREAM_ARRAY[i]);
18305 : first we have to find out how _not_ to flush
18307 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
18309 set try -DTRY_FPUTC
18310 if eval $compile; then
18311 $run ./try 2>/dev/null
18314 if $test ! -s try.out -a "X$code" = X42; then
18320 set try -DTRY_FPRINTF
18321 if eval $compile; then
18322 $run ./try 2>/dev/null
18325 if $test ! -s try.out -a "X$code" = X42; then
18326 output=-DTRY_FPRINTF
18332 : check for fflush NULL behaviour
18333 case "$fflushNULL" in
18334 '') set try -DTRY_FFLUSH_NULL $output
18335 if eval $compile; then
18336 $run ./try 2>/dev/null
18339 if $test -s try.out -a "X$code" = X42; then
18340 fflushNULL="`$cat try.out`"
18342 if $test "X$code" != X42; then
18344 (If this test failed, don't worry, we'll try another method shortly.)
18349 $rm -f core try.core core.try.*
18350 case "$fflushNULL" in
18352 Your fflush(NULL) works okay for output streams.
18353 Let's see if it clobbers input pipes...
18355 # As of mid-March 2000 all versions of Solaris appear to have a stdio
18356 # bug that improperly flushes the input end of pipes. So we avoid the
18357 # autoflush on fork/system/exec support for now. :-(
18358 $cat >tryp.c <<EOCP
18361 main(int argc, char **argv)
18367 while ((i = getc(stdin)) != -1
18368 && (*bp++ = i) != '\n'
18369 && bp < &buf[1024])
18372 fprintf(stdout, "%s", buf);
18380 fflushNULL="$define"
18382 if eval $compile; then
18384 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
18385 if cmp tryp.c tryp.out >/dev/null 2>&1; then
18387 fflush(NULL) seems to behave okay with input streams.
18389 fflushNULL="$define"
18392 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
18394 fflushNULL="$undef"
18397 $rm -f core tryp.c tryp.core core.tryp.*
18400 Your fflush(NULL) isn't working (contrary to ANSI C).
18402 fflushNULL="$undef"
18405 Cannot figure out whether your fflush(NULL) works or not.
18406 I'm assuming it doesn't (contrary to ANSI C).
18408 fflushNULL="$undef"
18412 $define|true|[yY]*)
18413 fflushNULL="$define"
18416 fflushNULL="$undef"
18419 : check explicit looping only if NULL did not work, and if the pipe
18420 : bug does not show up on an explicit flush too
18421 case "$fflushNULL" in
18423 $cat >tryp.c <<EOCP
18426 main(int argc, char **argv)
18432 while ((i = getc(stdin)) != -1
18433 && (*bp++ = i) != '\n'
18434 && bp < &buf[1024])
18437 fprintf(stdout, "%s", buf);
18446 if eval $compile; then
18448 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
18449 if cmp tryp.c tryp.out >/dev/null 2>&1; then
18451 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
18453 : now check for fflushall behaviour
18454 case "$fflushall" in
18455 '') set try -DTRY_FFLUSH_ALL $output
18456 if eval $compile; then
18458 (Now testing the other method--but note that this also may fail.)
18460 $run ./try 2>/dev/null
18463 if $test -s try.out -a "X$code" = X42; then
18464 fflushall="`$cat try.out`"
18467 $rm -f core try.core core.try.*
18468 case "$fflushall" in
18470 Whew. Flushing explicitly all the stdio streams works.
18472 fflushall="$define"
18475 Sigh. Flushing explicitly all the stdio streams doesn't work.
18480 Cannot figure out whether flushing stdio streams explicitly works or not.
18481 I'm assuming it doesn't.
18487 "$define"|true|[yY]*)
18488 fflushall="$define"
18496 All is futile. Even fflush(stdin) clobbers input pipes!
18503 $rm -f core tryp.c tryp.core core.tryp.*
18505 *) fflushall="$undef"
18509 case "$fflushNULL$fflushall" in
18512 OK, I give up. I cannot figure out how to flush pending stdio output.
18513 We won't be flushing handles at all before fork/exec/popen.
18517 $rm -f try.* try$exe_ext
18519 : Store the full pathname to the ar program for use in the C program
18520 : Respect a hint or command line value for full_ar.
18525 : Store the full pathname to the sed program for use in the C program
18528 : see what type gids are declared as in the kernel
18530 echo "Looking for the type for group ids returned by getgid()."
18531 set gid_t gidtype xxx stdio.h sys/types.h
18535 xxx=`./findhdr sys/user.h`
18536 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
18538 unsigned) dflt="$1 $2" ;;
18542 *) dflt="$gidtype";;
18545 gid_t) echo "gid_t found." ;;
18546 *) rp="What is the type for group ids returned by getgid()?"
18554 *_t) zzz="$gidtype" ;;
18557 echo "Checking the size of $zzz..." >&4
18559 #include <sys/types.h>
18561 #$i_stdlib I_STDLIB
18563 #include <stdlib.h>
18566 printf("%d\n", (int)sizeof($gidtype));
18571 if eval $compile_ok; then
18575 echo "(I can't execute the test program--guessing $gidsize.)" >&4
18578 echo "Your $zzz is $gidsize bytes long."
18583 echo "(I can't compile the test program--guessing $gidsize.)" >&4
18589 *_t) zzz="$gidtype" ;;
18592 echo "Checking the sign of $zzz..." >&4
18594 #include <sys/types.h>
18605 if eval $compile; then
18609 echo "(I can't execute the test program--guessing unsigned.)" >&4
18613 1) echo "Your $zzz is unsigned." ;;
18614 -1) echo "Your $zzz is signed." ;;
18620 echo "(I can't compile the test program--guessing unsigned.)" >&4
18626 if $test X"$quadtype" != X; then
18628 echo "Checking how to print 64-bit integers..." >&4
18630 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
18631 $cat >try.c <<'EOCP'
18632 #include <sys/types.h>
18635 int q = 12345678901;
18636 printf("%ld\n", q);
18640 if eval $compile; then
18644 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
18645 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
18646 echo "We will use %d."
18652 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
18653 $cat >try.c <<'EOCP'
18654 #include <sys/types.h>
18657 long q = 12345678901;
18658 printf("%ld\n", q);
18662 if eval $compile; then
18666 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
18667 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
18668 echo "We will use %ld."
18674 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
18675 $cat >try.c <<'EOCP'
18676 #include <sys/types.h>
18677 #include <inttypes.h>
18680 int64_t q = 12345678901;
18681 printf("%" PRId64 "\n", q);
18685 if eval $compile; then
18689 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
18690 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
18691 echo "We will use the C9X style."
18697 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
18699 #include <sys/types.h>
18702 $quadtype q = 12345678901;
18703 printf("%Ld\n", q);
18707 if eval $compile; then
18711 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
18712 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
18713 echo "We will use %Ld."
18719 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
18720 $cat >try.c <<'EOCP'
18721 #include <sys/types.h>
18724 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
18725 printf("%lld\n", q);
18729 if eval $compile; then
18733 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
18734 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
18735 echo "We will use the %lld style."
18741 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
18743 #include <sys/types.h>
18746 $quadtype q = 12345678901;
18747 printf("%qd\n", q);
18751 if eval $compile; then
18755 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
18756 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
18757 echo "We will use %qd."
18763 if $test X"$sPRId64" = X; then
18764 echo "Cannot figure out how to print 64-bit integers." >&4
18772 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
18773 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
18775 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
18776 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
18782 $echo "Checking the format strings to be used for Perl's internal types..." >&4
18784 if $test X"$ivsize" = X8; then
18785 ivdformat="$sPRId64"
18786 uvuformat="$sPRIu64"
18787 uvoformat="$sPRIo64"
18788 uvxformat="$sPRIx64"
18789 uvXUformat="$sPRIXU64"
18791 if $test X"$ivsize" = X"$longsize"; then
18798 if $test X"$ivsize" = X"$intsize"; then
18806 if $test X"$ivsize" = X"$shortsize"; then
18817 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
18818 nveformat="$sPRIeldbl"
18819 nvfformat="$sPRIfldbl"
18820 nvgformat="$sPRIgldbl"
18821 nvEUformat="$sPRIEUldbl"
18822 nvFUformat="$sPRIFUldbl"
18823 nvGUformat="$sPRIGUldbl"
18833 case "$ivdformat" in
18834 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
18841 $echo "Checking the format string to be used for gids..." >&4
18844 -1) if $test X"$gidsize" = X"$ivsize"; then
18845 gidformat="$ivdformat"
18847 if $test X"$gidsize" = X"$longsize"; then
18850 if $test X"$gidsize" = X"$intsize"; then
18853 if $test X"$gidsize" = X"$shortsize"; then
18860 *) if $test X"$gidsize" = X"$uvsize"; then
18861 gidformat="$uvuformat"
18863 if $test X"$gidsize" = X"$longsize"; then
18866 if $test X"$gidsize" = X"$intsize"; then
18869 if $test X"$gidsize" = X"$shortsize"; then
18878 : see if getgroups exists
18879 set getgroups d_getgrps
18882 : see if setgroups exists
18883 set setgroups d_setgrps
18887 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
18889 case "$d_getgrps$d_setgrps" in
18891 case "$groupstype" in
18892 '') dflt="$gidtype" ;;
18893 *) dflt="$groupstype" ;;
18896 What type of pointer is the second argument to getgroups() and setgroups()?
18897 Usually this is the same as group ids, $gidtype, but not always.
18900 rp='What type pointer is the second argument to getgroups() and setgroups()?'
18904 *) groupstype="$gidtype";;
18909 $define|true|[yY]*) dflt='y' ;;
18914 Would you like to build with Misc Attribute Decoration? This is development
18915 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
18916 overhead on the interpreter.
18918 If this doesn't make any sense to you, just accept the default '$dflt'.
18920 rp='Build Perl with MAD?'
18924 madlyh='madly.h madly.act madly.tab'
18926 madlyobj="madly$_o" ;;
18936 echo "Checking if your $make program sets \$(MAKE)..." >&4
18937 case "$make_set_make" in
18939 $sed 's/^X //' > testmake.mak << 'EOF'
18941 X @echo 'maketemp="$(MAKE)"'
18943 case "`$make -f testmake.mak 2>/dev/null`" in
18944 *maketemp=*) make_set_make='#' ;;
18945 *) make_set_make="MAKE=$make" ;;
18947 $rm -f testmake.mak
18950 case "$make_set_make" in
18951 '#') echo "Yup, it does.";;
18952 *) echo "Nope, it doesn't.";;
18955 : see what type is used for mode_t
18956 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
18957 set mode_t modetype int stdio.h sys/types.h
18960 : see if stdarg is available
18962 if $test `./findhdr stdarg.h`; then
18963 echo "<stdarg.h> found." >&4
18966 echo "<stdarg.h> NOT found." >&4
18970 : see if varags is available
18972 if $test `./findhdr varargs.h`; then
18973 echo "<varargs.h> found." >&4
18975 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
18978 : set up the varargs testing programs
18979 $cat > varargs.c <<EOP
18981 #include <stdarg.h>
18984 #include <varargs.h>
18988 int f(char *p, ...)
19002 p = va_arg(ap, char *);
19007 $cat > varargs <<EOP
19009 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
19018 : now check which varargs header should be included
19023 if `./varargs I_STDARG`; then
19025 elif `./varargs I_VARARGS`; then
19030 if `./varargs I_VARARGS`; then
19037 echo "I could not find the definition for va_dcl... You have problems..." >&4
19038 val="$undef"; set i_stdarg; eval $setvar
19039 val="$undef"; set i_varargs; eval $setvar
19044 case "$i_varhdr" in
19046 val="$define"; set i_stdarg; eval $setvar
19047 val="$undef"; set i_varargs; eval $setvar
19050 val="$undef"; set i_stdarg; eval $setvar
19051 val="$define"; set i_varargs; eval $setvar
19054 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
19058 : see if we need va_copy
19060 case "$i_stdarg" in
19063 #include <stdarg.h>
19065 #$i_stdlib I_STDLIB
19067 #include <stdlib.h>
19069 #include <signal.h>
19072 ivfprintf(FILE *f, const char *fmt, va_list *valp)
19074 return vfprintf(f, fmt, *valp);
19078 myvfprintf(FILE *f, const char *fmt, va_list val)
19080 return ivfprintf(f, fmt, &val);
19084 myprintf(char *fmt, ...)
19087 va_start(val, fmt);
19088 return myvfprintf(stdout, fmt, val);
19092 main(int ac, char **av)
19094 signal(SIGSEGV, exit);
19096 myprintf("%s%cs all right, then\n", "that", '\'');
19101 if eval $compile && $run ./try 2>&1 >/dev/null; then
19102 case "`$run ./try`" in
19103 "that's all right, then")
19109 yes) echo "It seems that you don't need va_copy()." >&4
19110 need_va_copy="$undef"
19112 *) echo "It seems that va_copy() or similar will be needed." >&4
19113 need_va_copy="$define"
19116 $rm -f try.* core core.* *.core *.core.*
19118 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
19122 : see what type is used for size_t
19123 rp="What is the type used for the length parameter for string functions?"
19124 set size_t sizetype 'unsigned int' stdio.h sys/types.h
19127 : check for type of arguments to gethostbyaddr.
19128 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
19129 case "$d_gethbyaddr" in
19133 Checking to see what type of arguments are accepted by gethostbyaddr().
19135 hdrs="$define sys/types.h
19136 $d_socket sys/socket.h
19137 $i_niin netinet/in.h
19139 $i_unistd unistd.h"
19140 : The first arg can 'char *' or 'void *'
19141 : The second arg is some of integral type
19142 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
19143 for yyy in size_t long int; do
19144 case "$netdb_host_type" in
19145 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
19146 if ./protochk "$try" $hdrs; then
19147 echo "Your system accepts $xxx for the first arg."
19148 echo "...and $yyy for the second arg."
19149 netdb_host_type="$xxx"
19150 netdb_hlen_type="$yyy"
19156 : In case none of those worked, prompt the user.
19157 case "$netdb_host_type" in
19158 '') rp='What is the type for the 1st argument to gethostbyaddr?'
19161 netdb_host_type=$ans
19162 rp='What is the type for the 2nd argument to gethostbyaddr?'
19165 netdb_hlen_type=$ans
19169 *) : no gethostbyaddr, so pick harmless defaults
19170 netdb_host_type='char *'
19171 netdb_hlen_type="$sizetype"
19174 # Remove the "const" if needed. -- but then we'll have a
19176 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
19179 : check for type of argument to gethostbyname.
19180 if test "X$netdb_name_type" = X ; then
19181 case "$d_gethbyname" in
19185 Checking to see what type of argument is accepted by gethostbyname().
19187 hdrs="$define sys/types.h
19188 $d_socket sys/socket.h
19189 $i_niin netinet/in.h
19191 $i_unistd unistd.h"
19192 for xxx in "const char *" "char *"; do
19193 case "$netdb_name_type" in
19194 '') try="extern struct hostent *gethostbyname($xxx);"
19195 if ./protochk "$try" $hdrs; then
19196 echo "Your system accepts $xxx."
19197 netdb_name_type="$xxx"
19202 : In case none of those worked, prompt the user.
19203 case "$netdb_name_type" in
19204 '') rp='What is the type for the 1st argument to gethostbyname?'
19207 netdb_name_type=$ans
19211 *) : no gethostbyname, so pick harmless default
19212 netdb_name_type='char *'
19217 : check for type of 1st argument to getnetbyaddr.
19218 if test "X$netdb_net_type" = X ; then
19219 case "$d_getnbyaddr" in
19223 Checking to see what type of 1st argument is accepted by getnetbyaddr().
19225 hdrs="$define sys/types.h
19226 $d_socket sys/socket.h
19227 $i_niin netinet/in.h
19229 $i_unistd unistd.h"
19230 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
19231 case "$netdb_net_type" in
19232 '') try="extern struct netent *getnetbyaddr($xxx, int);"
19233 if ./protochk "$try" $hdrs; then
19234 echo "Your system accepts $xxx."
19235 netdb_net_type="$xxx"
19240 : In case none of those worked, prompt the user.
19241 case "$netdb_net_type" in
19242 '') rp='What is the type for the 1st argument to getnetbyaddr?'
19245 netdb_net_type=$ans
19249 *) : no getnetbyaddr, so pick harmless default
19250 netdb_net_type='long'
19254 : locate the preferred pager for this system
19261 [a-zA-Z]:/*) dflt=$pg;;
19265 [a-zA-Z]:/*) dflt=$more;;
19269 [a-zA-Z]:/*) dflt=$less;;
19272 '') dflt=/usr/ucb/more;;
19276 : Instruct ./getfile to trust the hinted or previous pager value,
19277 : even if it does not begin with a slash. For example, on os2,
19278 : pager might be cmd /c more. See comments in UU/getfile.
19283 rp='What pager is used on your system?'
19287 : see what type pids are declared as in the kernel
19288 rp="What is the type of process ids on this system?"
19289 set pid_t pidtype int stdio.h sys/types.h
19292 : see if ar generates random libraries by itself
19294 echo "Checking how to generate random libraries on your machine..." >&4
19295 echo 'int bar1() { return bar2(); }' > bar1.c
19296 echo 'int bar2() { return 2; }' > bar2.c
19298 #$i_stdlib I_STDLIB
19300 #include <stdlib.h>
19302 int main() { printf("%d\n", bar1()); exit(0); }
19304 $cc $ccflags -c bar1.c >/dev/null 2>&1
19305 $cc $ccflags -c bar2.c >/dev/null 2>&1
19306 $cc $ccflags -c foo.c >/dev/null 2>&1
19307 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
19308 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19309 $run ./foobar >/dev/null 2>&1; then
19310 echo "$ar appears to generate random libraries itself."
19312 if [ "X$ranlib" = "X" ]; then
19315 elif $ar s bar$_a >/dev/null 2>&1 &&
19316 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19317 $run ./foobar >/dev/null 2>&1; then
19318 echo "a table of contents needs to be added with '$ar s'."
19321 elif $ar ts bar$_a >/dev/null 2>&1 &&
19322 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19323 $run ./foobar >/dev/null 2>&1; then
19324 echo "a table of contents needs to be added with '$ar ts'."
19331 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
19332 $test -f $ranlib || ranlib=''
19335 if $test -n "$ranlib"; then
19336 echo "your system has '$ranlib'; we'll use that."
19339 echo "your system doesn't seem to support random libraries"
19340 echo "so we'll use lorder and tsort to order the libraries."
19347 : check for type of arguments to select.
19348 case "$selecttype" in
19349 '') case "$d_select" in
19353 Checking to see what type of arguments are accepted by select().
19355 hdrs="$define sys/types.h
19356 $i_systime sys/time.h
19357 $i_sysselct sys/select.h
19358 $d_socket sys/socket.h"
19359 : The first arg can be int, unsigned, or size_t
19360 : The last arg may or may not be 'const'
19362 : void pointer has been seen but using that
19363 : breaks the selectminbits test
19364 for xxx in 'fd_set *' 'int *'; do
19365 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
19366 for tmo in 'struct timeval *' 'const struct timeval *'; do
19368 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
19369 if ./protochk "$try" $hdrs; then
19370 echo "Your system accepts $xxx."
19379 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
19380 case "$d_fd_set" in
19381 $define) dflt="fd_set *" ;;
19390 *) : no select, so pick a harmless default
19397 : check for the select 'width'
19398 case "$selectminbits" in
19399 '') safebits=`expr $ptrsize \* 8`
19400 case "$d_select" in
19404 Checking to see on how many bits at a time your select() operates...
19407 #include <sys/types.h>
19409 #$i_systime I_SYS_TIME
19410 #$i_systimek I_SYS_TIME_KERNEL
19415 # ifdef I_SYS_TIME_KERNEL
19418 # include <sys/time.h>
19419 # ifdef I_SYS_TIME_KERNEL
19423 #$i_sysselct I_SYS_SELECT
19424 #ifdef I_SYS_SELECT
19425 #include <sys/select.h>
19427 #$d_socket HAS_SOCKET
19429 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
19432 #$i_stdlib I_STDLIB
19434 #include <stdlib.h>
19437 #define S sizeof(*(b))
19439 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
19440 #define NBITS (NBYTES * 8)
19442 char *s = malloc(NBYTES);
19451 fp = fopen("try.c", "r");
19457 b = ($selecttype)s;
19458 for (i = 0; i < NBITS; i++)
19462 select(fd + 1, b, 0, 0, &t);
19463 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
19465 printf("%d\n", i + 1);
19470 if eval $compile_ok; then
19471 selectminbits=`$run ./try`
19472 case "$selectminbits" in
19474 Cannot figure out on how many bits at a time your select() operates.
19475 I'll play safe and guess it is $safebits bits.
19477 selectminbits=$safebits
19478 bits="$safebits bits"
19481 *) bits="$selectminbits bits" ;;
19483 echo "Your select() operates on $bits at a time." >&4
19485 rp='What is the minimum number of bits your select() operates on?'
19486 case "$byteorder" in
19487 12345678) dflt=64 ;;
19493 selectminbits="$val"
19497 *) : no select, so pick a harmless default
19498 selectminbits=$safebits
19504 : Trace out the files included by signal.h, then look for SIGxxx names.
19505 : Remove SIGARRAYSIZE used by HPUX.
19506 : Remove SIGSTKSIZE used by Linux.
19507 : Remove SIGSTKSZ used by Posix.
19508 : Remove SIGTYP void lines used by OS2.
19509 : Some cpps, like os390, dont give the file name anywhere
19510 if [ "X$fieldn" = X ]; then
19511 : Just make some guesses. We check them later.
19512 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
19514 xxx=`echo '#include <signal.h>' |
19515 $cppstdin $cppminus $cppflags 2>/dev/null |
19516 $grep '^[ ]*#.*include' |
19517 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
19519 : Check this list of files to be sure we have parsed the cpp output ok.
19520 : This will also avoid potentially non-existent files, such
19523 for xx in $xxx /dev/null ; do
19524 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
19526 : If we have found no files, at least try signal.h
19527 case "$xxxfiles" in
19528 '') xxxfiles=`./findhdr signal.h` ;;
19531 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
19532 print substr($2, 4, 20)
19534 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
19535 print substr($3, 4, 20)
19537 : Append some common names just in case the awk scan failed.
19538 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
19539 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
19540 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
19541 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
19542 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
19544 : generate a few handy files for later
19545 $cat > signal.c <<EOCP
19546 #include <sys/types.h>
19547 #include <signal.h>
19548 #$i_stdlib I_STDLIB
19550 #include <stdlib.h>
19555 /* Strange style to avoid deeply-nested #if/#else/#endif */
19558 # define NSIG (_NSIG)
19564 # define NSIG (SIGMAX+1)
19570 # define NSIG (SIG_MAX+1)
19576 # define NSIG (_SIG_MAX+1)
19582 # define NSIG (MAXSIG+1)
19588 # define NSIG (MAX_SIG+1)
19593 # ifdef SIGARRAYSIZE
19594 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
19600 # define NSIG (_sys_nsig) /* Solaris 2.5 */
19604 /* Default to some arbitrary number that's big enough to get most
19605 of the common signals.
19611 printf("NSIG %d\n", NSIG);
19617 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
19619 printf "#ifdef SIG"; printf $1; printf "\n"
19620 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
19621 printf $1; printf ");\n"
19625 printf "#endif /* JUST_NSIG */\n";
19626 printf "exit(0);\n}\n";
19629 $cat >signal.awk <<'EOP'
19630 BEGIN { ndups = 0 }
19631 $1 ~ /^NSIG$/ { nsig = $2 }
19632 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
19633 if ($2 > maxsig) { maxsig = $2 }
19634 if (sig_name[$2]) {
19635 dup_name[ndups] = $1
19636 dup_num[ndups] = $2
19648 printf("NSIG %d\n", nsig);
19649 for (n = 1; n < nsig; n++) {
19651 printf("%s %d\n", sig_name[n], sig_num[n])
19654 printf("NUM%d %d\n", n, n)
19657 for (n = 0; n < ndups; n++) {
19658 printf("%s %d\n", dup_name[n], dup_num[n])
19662 $cat >signal_cmd <<EOS
19664 if $test -s signal.lst; then
19665 echo "Using your existing signal.lst file"
19670 $cat >>signal_cmd <<'EOS'
19673 if eval $compile_ok; then
19674 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) | $uniq | $awk -f signal.awk >signal.lst
19676 echo "(I can't seem be able to compile the whole test program)" >&4
19677 echo "(I'll try it in little pieces.)" >&4
19678 set signal -DJUST_NSIG
19679 if eval $compile_ok; then
19680 $run ./signal$_exe > signal.nsg
19683 echo "I can't seem to figure out how many signals you have." >&4
19684 echo "Guessing 50." >&4
19685 echo 'NSIG 50' > signal.nsg
19687 : Now look at all the signal names, one at a time.
19688 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
19689 $cat > signal.c <<EOCP
19690 #include <sys/types.h>
19691 #include <signal.h>
19694 printf("$xx %d\n", SIG${xx});
19699 if eval $compile; then
19700 echo "SIG${xx} found."
19701 $run ./signal$_exe >> signal.ls1
19703 echo "SIG${xx} NOT found."
19706 if $test -s signal.ls1; then
19707 $cat signal.nsg signal.ls1 |
19708 $sort -n | $uniq | $awk -f signal.awk >signal.lst
19712 if $test -s signal.lst; then
19715 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
19716 echo 'kill -l' >signal
19717 set X `csh -f <signal`
19721 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
19723 echo $@ | $tr ' ' $trnl | \
19724 $awk '{ printf "%s %d\n", $1, ++s; }
19725 END { printf "NSIG %d\n", ++s }' >signal.lst
19727 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
19729 chmod a+x signal_cmd
19730 $eunicefix signal_cmd
19732 : generate list of signal names
19734 case "$sig_name_init" in
19736 *) case "$sig_num_init" in
19737 ''|*,*) doinit=yes ;;
19742 echo "Generating a list of signal names and numbers..." >&4
19744 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
19745 sig_name=`$awk 'BEGIN { printf "ZERO " }
19746 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
19747 sig_num=`$awk 'BEGIN { printf "0 " }
19748 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
19749 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
19750 !/^NSIG/ { printf "\"%s\", ", $1 }
19751 END { printf "0\n" }' signal.lst`
19752 sig_num_init=`$awk 'BEGIN { printf "0, " }
19753 !/^NSIG/ { printf "%d, ", $2}
19754 END { printf "0\n"}' signal.lst`
19757 echo "The following $sig_count signals are available:"
19759 echo $sig_name | $awk \
19760 'BEGIN { linelen = 0 }
19762 for (i = 1; i <= NF; i++) {
19763 name = "SIG" $i " "
19764 linelen = linelen + length(name)
19765 if (linelen > 70) {
19767 linelen = length(name)
19773 sig_size=`echo $sig_name | awk '{print NF}'`
19774 $rm -f signal signal.c signal.awk signal.lst signal_cmd
19777 case "$sizetype" in
19778 *_t) zzz="$sizetype" ;;
19779 *) zzz="filesize" ;;
19781 echo "Checking the size of $zzz..." >&4
19783 #include <sys/types.h>
19785 #$i_stdlib I_STDLIB
19787 #include <stdlib.h>
19790 printf("%d\n", (int)sizeof($sizetype));
19795 if eval $compile_ok; then
19799 echo "(I can't execute the test program--guessing $sizesize.)" >&4
19802 echo "Your $zzz size is $sizesize bytes."
19807 echo "(I can't compile the test program--guessing $sizesize.)" >&4
19811 : check for socklen_t
19813 echo "Checking to see if you have socklen_t..." >&4
19815 #include <sys/types.h>
19816 #$d_socket HAS_SOCKET
19818 #include <sys/socket.h>
19820 int main() { socklen_t x = 16; }
19823 if eval $compile; then
19825 echo "You have socklen_t."
19828 echo "You do not have socklen_t."
19829 case "$sizetype" in
19830 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
19837 : see if this is a socks.h system
19838 set socks.h i_socks
19841 : check for type of the size argument to socket calls
19842 case "$d_socket" in
19846 Checking to see what type is the last argument of accept().
19849 case "$d_socklen_t" in
19850 "$define") yyy="$yyy socklen_t"
19852 yyy="$yyy $sizetype int long unsigned"
19853 for xxx in $yyy; do
19854 case "$socksizetype" in
19855 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
19856 case "$usesocks" in
19858 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
19859 echo "Your system accepts '$xxx *' for the last argument of accept()."
19860 socksizetype="$xxx"
19863 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
19864 echo "Your system accepts '$xxx *' for the last argument of accept()."
19865 socksizetype="$xxx"
19872 : In case none of those worked, prompt the user.
19873 case "$socksizetype" in
19874 '') rp='What is the type for socket address structure sizes?'
19881 *) : no sockets, so pick relatively harmless default
19886 : see what type is used for signed size_t
19887 set ssize_t ssizetype int stdio.h sys/types.h
19892 #$i_stdlib I_STDLIB
19894 #include <stdlib.h>
19896 #include <sys/types.h>
19897 #define Size_t $sizetype
19898 #define SSize_t $dflt
19901 if (sizeof(Size_t) == sizeof(SSize_t))
19903 else if (sizeof(Size_t) == sizeof(int))
19912 if eval $compile_ok && $run ./try > /dev/null; then
19913 ssizetype=`$run ./try`
19914 echo "I'll be using $ssizetype for functions returning a byte count." >&4
19917 Help! I can't compile and run the ssize_t test program: please enlighten me!
19918 (This is probably a misconfiguration in your system or libraries, and
19919 you really ought to fix it. Still, I'll try anyway.)
19921 I need a type that is the same size as $sizetype, but is guaranteed to
19922 be signed. Common values are ssize_t, int and long.
19925 rp="What signed type is the same size as $sizetype?"
19931 : see what type of char stdio uses.
19933 echo '#include <stdio.h>' > stdio.c
19934 $cppstdin $cppminus < stdio.c > stdioh
19935 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
19936 echo "Your stdio uses unsigned chars." >&4
19937 stdchar="unsigned char"
19939 echo "Your stdio uses signed chars." >&4
19942 $rm -f stdio.* stdioh
19944 : see what type uids are declared as in the kernel
19946 echo "Looking for the type for user ids returned by getuid()."
19947 set uid_t uidtype xxx stdio.h sys/types.h
19951 xxx=`./findhdr sys/user.h`
19952 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
19954 unsigned) dflt="$1 $2" ;;
19958 *) dflt="$uidtype";;
19961 uid_t) echo "uid_t found." ;;
19962 *) rp="What is the type for user ids returned by getuid()?"
19970 *_t) zzz="$uidtype" ;;
19973 echo "Checking the size of $zzz..." >&4
19975 #include <sys/types.h>
19977 #$i_stdlib I_STDLIB
19979 #include <stdlib.h>
19982 printf("%d\n", (int)sizeof($uidtype));
19987 if eval $compile_ok; then
19991 echo "(I can't execute the test program--guessing $uidsize.)" >&4
19994 echo "Your $zzz is $uidsize bytes long."
19999 echo "(I can't compile the test program--guessing $uidsize.)" >&4
20004 *_t) zzz="$uidtype" ;;
20007 echo "Checking the sign of $zzz..." >&4
20009 #include <sys/types.h>
20020 if eval $compile; then
20024 echo "(I can't execute the test program--guessing unsigned.)" >&4
20028 1) echo "Your $zzz is unsigned." ;;
20029 -1) echo "Your $zzz is signed." ;;
20035 echo "(I can't compile the test program--guessing unsigned.)" >&4
20041 $echo "Checking the format string to be used for uids..." >&4
20044 -1) if $test X"$uidsize" = X"$ivsize"; then
20045 uidformat="$ivdformat"
20047 if $test X"$uidsize" = X"$longsize"; then
20050 if $test X"$uidsize" = X"$intsize"; then
20053 if $test X"$uidsize" = X"$shortsize"; then
20060 *) if $test X"$uidsize" = X"$uvsize"; then
20061 uidformat="$uvuformat"
20063 if $test X"$uidsize" = X"$longsize"; then
20066 if $test X"$uidsize" = X"$intsize"; then
20069 if $test X"$uidsize" = X"$shortsize"; then
20079 case "$usesitecustomize" in
20080 $define|true|[Yy]*)
20081 usesitecustomize="$define"
20084 usesitecustomize="$undef"
20088 : determine compiler compiler
20097 if $test -f "$byacc$_exe"; then
20099 comp="byacc or $comp"
20101 if $test -f "$bison$_exe"; then
20102 comp="$comp or bison -y"
20104 rp="Which compiler compiler ($comp) shall I use?"
20113 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
20119 : see if this is a fp.h system
20123 : see if this is a fp_class.h system
20124 set fp_class.h i_fp_class
20127 : see if this is a ieeefp.h system
20128 case "$i_ieeefp" in
20129 '' ) set ieeefp.h i_ieeefp
20134 : see if this is a libutil.h system
20135 set libutil.h i_libutil
20138 : see if mach cthreads are available
20139 if test "X$usethreads" = "X$define"; then
20140 set mach/cthreads.h i_machcthr
20143 i_machcthr="$undef"
20148 : see if this is a mntent.h system
20149 set mntent.h i_mntent
20152 : see if ndbm.h is available
20158 # Some Linux distributions such as RedHat 7.1 put the
20159 # ndbm.h header in /usr/include/gdbm/ndbm.h.
20160 if $test -f /usr/include/gdbm/ndbm.h; then
20161 echo '<gdbm/ndbm.h> found.'
20162 ccflags="$ccflags -I/usr/include/gdbm"
20163 cppflags="$cppflags -I/usr/include/gdbm"
20171 : see if dbm_open exists
20172 set dbm_open d_dbm_open
20174 case "$d_dbm_open" in
20177 echo "We won't be including <ndbm.h>"
20186 : see if net/errno.h is available
20188 set net/errno.h val
20191 : Unfortunately, it causes problems on some systems. Arrgh.
20194 cat > try.c <<'EOM'
20197 #include <net/errno.h>
20203 if $cc $ccflags -c try.c >/dev/null 2>&1; then
20204 echo "We'll be including <net/errno.h>." >&4
20206 echo "We won't be including <net/errno.h>." >&4
20215 : see if netinet/tcp.h is available
20216 set netinet/tcp.h i_netinettcp
20219 : see if this is a poll.h system
20223 : see if this is a prot.h system
20228 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
20229 $cat <<'EOSH' > Cppsym.know
20230 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
20231 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
20232 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
20233 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
20234 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
20235 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
20236 bull c cadmus clipper CMU COFF COMPILER_VERSION
20237 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
20238 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
20239 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
20240 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
20242 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
20243 H3050R H3050RX hbullx20 hcx host_mips
20244 hp200 hp300 hp700 HP700 hp800 hp9000
20245 hp9000s200 hp9000s300 hp9000s400 hp9000s500
20246 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
20247 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
20248 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
20249 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
20250 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
20251 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
20252 Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
20253 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
20254 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
20255 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
20256 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
20257 MATH_HAS_NO_SIDE_EFFECTS
20258 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
20259 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
20260 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
20261 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
20262 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
20263 NetBSD news1500 news1700 news1800 news1900 news3700
20264 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
20265 ns32016 ns32332 ns32k nsc32000
20266 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
20267 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
20268 pc532 pdp11 PGC PIC plexus PORTAR posix
20269 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
20270 POSIX_C_SOURCE POSIX_SOURCE POWER
20271 PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
20272 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
20273 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
20274 sony sony_news sonyrisc sparc sparclite spectrum
20275 stardent stdc STDC_EXT stratos sun sun3 sun386
20276 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
20277 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
20278 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
20279 sysV68 sysV88 Tek4132 Tek4300 titan
20280 TM3200 TM5400 TM5600
20281 tower tower32 tower32_200 tower32_600 tower32_700
20282 tower32_800 tower32_850 tss
20283 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
20284 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
20285 unix UNIX95 UNIX99 unixpc unos
20286 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
20287 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
20288 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
20290 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
20291 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
20292 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
20295 # Maybe put other stuff here too.
20296 cat <<EOSH >>Cppsym.know
20299 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
20300 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
20301 $cat Cppsym.know > Cppsym.c
20302 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
20303 $rm -f Cppsym.a Cppsym.b Cppsym.c
20304 cat <<EOSH > Cppsym
20306 if $test \$# -gt 0; then
20307 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
20308 if $test -s Cppsym.got; then
20315 $tr " " "$trnl" | ./Cppsym.try
20321 cat <<EOSH > Cppsym.try
20323 cat <<'EOCP' > try.c
20326 #define STRINGIFY(a) "a"
20328 #if cpp_stuff == 42
20329 #define StGiFy(a) #a
20330 #define STRINGIFY(a) StGiFy(a)
20332 #if $cpp_stuff != 1 && $cpp_stuff != 42
20333 # include "Bletch: How does this C preprocessor stringify macros?"
20339 cat <<'EOSH' >> Cppsym.try
20341 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
20342 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
20343 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
20344 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
20346 echo 'return 0;}' >> try.c
20348 cat <<EOSH >> Cppsym.try
20350 case "$osname-$gccversion" in
20351 irix-) ccflags="\$ccflags -woff 1178" ;;
20352 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
20354 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
20356 chmod +x Cppsym.try
20357 $eunicefix Cppsym.try
20358 ./Cppsym < Cppsym.know > Cppsym.true
20359 : Add in any linux cpp "predefined macros":
20360 case "$osname::$gccversion" in
20363 rm -f $tHdrH'.h' $tHdrH
20365 if cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
20366 sed 's/#define[\ \ ]*//;s/[\ \ ].*$//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
20367 if [ -s $tHdrH'_cppsym.real' ]; then
20368 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
20371 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
20374 : now check the C compiler for additional symbols
20375 postprocess_cc_v=''
20377 aix) postprocess_cc_v="|$tr , ' '" ;;
20384 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
20387 -D*) echo "\$i" | $sed 's/^-D//';;
20388 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
20393 postprocess_cc_v=''
20396 ./ccsym > ccsym1.raw
20397 if $test -s ccsym1.raw; then
20398 $sort ccsym1.raw | $uniq >ccsym.raw
20400 mv ccsym1.raw ccsym.raw
20403 $awk '/\=/ { print $0; next }
20404 { print $0"=1" }' ccsym.raw >ccsym.list
20405 $comm -13 Cppsym.true ccsym.list >ccsym.own
20406 $comm -12 Cppsym.true ccsym.list >ccsym.com
20407 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
20409 if $test -z ccsym.raw; then
20410 echo "Your C compiler doesn't seem to define any symbols!" >&4
20412 echo "However, your C preprocessor defines the following symbols:"
20415 cppsymbols=`$cat Cppsym.true`
20416 cppsymbols=`echo $cppsymbols`
20417 cppccsymbols="$cppsymbols"
20419 if $test -s ccsym.com; then
20420 echo "Your C compiler and pre-processor define these symbols:"
20421 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
20424 cppccsymbols=`$cat ccsym.com`
20425 cppccsymbols=`echo $cppccsymbols`
20426 $test "$silent" || sleep 1
20428 if $test -s ccsym.cpp; then
20429 $test "$also" && echo " "
20430 echo "Your C pre-processor ${also}defines the following symbols:"
20431 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
20433 cppsymbols=`$cat ccsym.cpp`
20434 cppsymbols=`echo $cppsymbols`
20435 $test "$silent" || sleep 1
20437 if $test -s ccsym.own; then
20438 $test "$also" && echo " "
20439 echo "Your C compiler ${also}defines the following cpp symbols:"
20440 $sed -e 's/\(..*\)=1/\1/' ccsym.own
20441 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
20442 ccsymbols=`$cat ccsym.own`
20443 ccsymbols=`echo $ccsymbols`
20444 $test "$silent" || sleep 1
20448 : see if this is a termio system
20452 if $test `./findhdr termios.h`; then
20453 set tcsetattr i_termios
20459 "$define") echo "You have POSIX termios.h... good!" >&4;;
20460 *) if ./Cppsym pyr; then
20461 case "`/bin/universe`" in
20462 ucb) if $test `./findhdr sgtty.h`; then
20464 echo "<sgtty.h> found." >&4
20466 echo "System is pyramid with BSD universe."
20467 echo "<sgtty.h> not found--you could have problems." >&4
20469 *) if $test `./findhdr termio.h`; then
20471 echo "<termio.h> found." >&4
20473 echo "System is pyramid with USG universe."
20474 echo "<termio.h> not found--you could have problems." >&4
20478 if $test `./findhdr termio.h`; then
20479 echo "<termio.h> found." >&4
20481 elif $test `./findhdr sgtty.h`; then
20482 echo "<sgtty.h> found." >&4
20485 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
20488 if $test `./findhdr sgtty.h`; then
20489 echo "<sgtty.h> found." >&4
20491 elif $test `./findhdr termio.h`; then
20492 echo "<termio.h> found." >&4
20495 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
20499 set i_termio; eval $setvar
20500 val=$val2; set i_sgtty; eval $setvar
20501 val=$val3; set i_termios; eval $setvar
20503 : see if stddef is available
20504 set stddef.h i_stddef
20507 : see if this is a sunmath.h system
20508 set sunmath.h i_sunmath
20511 : see if sys/access.h is available
20512 set sys/access.h i_sysaccess
20515 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
20516 set sys/filio.h i_sysfilio
20519 if $test `./findhdr sys/ioctl.h`; then
20521 echo '<sys/ioctl.h> found.' >&4
20524 if $test $i_sysfilio = "$define"; then
20525 echo '<sys/ioctl.h> NOT found.' >&4
20527 $test $i_sgtty = "$define" && xxx="sgtty.h"
20528 $test $i_termio = "$define" && xxx="termio.h"
20529 $test $i_termios = "$define" && xxx="termios.h"
20530 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
20536 : see if socket ioctl defs are in sys/sockio.h
20538 xxx=`./findhdr sys/sockio.h`
20539 if $test "$xxx"; then
20540 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
20542 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
20545 echo "No socket ioctls found in <sys/sockio.h>." >&4
20550 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
20557 : see if this is a syslog.h system
20558 set syslog.h i_syslog
20562 : see if this is a sys/mode.h system
20563 set sys/mode.h i_sysmode
20566 : see if sys/resource.h has to be included
20567 set sys/resource.h i_sysresrc
20570 : see if sys/security.h is available
20571 set sys/security.h i_syssecrt
20574 : see if this is a sys/statvfs.h system
20575 set sys/statvfs.h i_sysstatvfs
20578 : see if this is a sys/un.h system
20579 set sys/un.h i_sysun
20583 : see if this is a sys/utsname.h system
20584 set sys/utsname.h i_sysutsname
20587 : see if this is a syswait system
20588 set sys/wait.h i_syswait
20591 : see if this is a ustat.h system
20592 set ustat.h i_ustat
20595 : see if this is an utime system
20596 set utime.h i_utime
20599 : see if this is a values.h system
20600 set values.h i_values
20603 : see if this is a vfork system
20606 set vfork.h i_vfork
20614 : see if gdbm.h is available
20619 : see if gdbm_open exists
20620 set gdbm_open d_gdbm_open
20622 case "$d_gdbm_open" in
20625 echo "We won't be including <gdbm.h>"
20635 echo "Looking for extensions..." >&4
20636 : If we are using the old config.sh, known_extensions may contain
20637 : old or inaccurate or duplicate values.
20638 known_extensions=''
20639 nonxs_extensions=''
20640 : We do not use find because it might not be available.
20641 : We do not just use MANIFEST because the user may have dropped
20642 : some additional extensions into the source tree and expect them
20645 : Function to recursively find available extensions, ignoring DynaLoader
20646 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
20650 DynaLoader|dynaload) ;;
20652 if $test -f $xxx/$xxx.xs; then
20653 known_extensions="$known_extensions $1$xxx";
20654 elif $test -f $xxx/Makefile.PL; then
20655 nonxs_extensions="$nonxs_extensions $1$xxx";
20657 if $test -d $xxx -a $# -lt 10; then
20660 eval $find_extensions;
20672 eval $find_extensions
20673 # Special case: Add in threads/shared since it is not picked up by the
20674 # recursive find above (and adding in general recursive finding breaks
20675 # SDBM_File/sdbm). A.D. 10/25/2001.
20676 known_extensions="$known_extensions threads/shared"
20677 set X $nonxs_extensions
20679 nonxs_extensions="$*"
20680 set X $known_extensions
20682 known_extensions="$*"
20685 : Now see which are supported on this system.
20687 for xxx in $known_extensions ; do
20691 $define) avail_ext="$avail_ext $xxx" ;;
20694 GDBM_File|gdbm_fil)
20696 $define) avail_ext="$avail_ext $xxx" ;;
20699 I18N/Langinfo|i18n_lan)
20700 case "$i_langinfo$d_nl_langinfo" in
20701 $define$define) avail_ext="$avail_ext $xxx" ;;
20704 NDBM_File|ndbm_fil)
20707 case "$osname-$use64bitint" in
20710 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
20713 *) avail_ext="$avail_ext $xxx" ;;
20718 ODBM_File|odbm_fil)
20719 case "${i_dbm}${i_rpcsvcdbm}" in
20721 case "$osname-$use64bitint" in
20724 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
20727 *) avail_ext="$avail_ext $xxx" ;;
20733 case "$useposix" in
20734 true|define|y) avail_ext="$avail_ext $xxx" ;;
20738 case "$useopcode" in
20739 true|define|y) avail_ext="$avail_ext $xxx" ;;
20743 case "$d_socket" in
20746 beos) ;; # not unless BONE
20747 *) avail_ext="$avail_ext $xxx" ;;
20752 Sys/Syslog|sys/syslog)
20753 : XXX syslog requires socket
20754 case "$d_socket" in
20755 true|$define|y) avail_ext="$avail_ext $xxx" ;;
20759 case "$usethreads" in
20761 case "$useithreads" in
20762 $undef|false|[nN]*) avail_ext="$avail_ext $xxx" ;;
20766 XS/APItest|xs/apitest)
20767 # This is just for testing. Skip it unless we have dynamic loading.
20770 $define) avail_ext="$avail_ext $xxx" ;;
20773 XS/Typemap|xs/typemap)
20774 # This is just for testing. Skip it unless we have dynamic loading.
20776 $define) avail_ext="$avail_ext $xxx" ;;
20779 threads|threads/shared)
20780 # threads and threads::shared are special cases.
20781 # To stop people from asking "Perl 5.8.0 was supposed
20782 # to have this new fancy threads implementation but my
20783 # perl doesn't have it" and from people trying to
20784 # (re)install the threads module using CPAN.pm and
20785 # CPAN.pm then offering to reinstall Perl 5.8.0,
20786 # the threads.pm and threads/shared.pm will always be
20787 # there, croaking informatively ("you need to rebuild
20788 # all of Perl with threads, sorry") when threads haven't
20789 # been compiled in.
20791 avail_ext="$avail_ext $xxx"
20794 : XXX Do we need a useipcsysv variable here
20795 case "${d_msg}${d_sem}${d_shm}" in
20796 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
20799 *) avail_ext="$avail_ext $xxx"
20808 case "$onlyextensions" in
20810 *) keepextensions=''
20811 echo "You have requested that only certains extensions be included..." >&4
20812 for i in $onlyextensions; do
20813 case " $avail_ext " in
20815 echo "Keeping extension $i."
20816 keepextensions="$keepextensions $i"
20818 *) echo "Ignoring extension $i." ;;
20821 avail_ext="$keepextensions"
20825 case "$noextensions" in
20827 *) keepextensions=''
20828 echo "You have requested that certain extensions be ignored..." >&4
20829 for i in $avail_ext; do
20830 case " $noextensions " in
20831 *" $i "*) echo "Ignoring extension $i." ;;
20832 *) echo "Keeping extension $i.";
20833 keepextensions="$keepextensions $i"
20837 avail_ext="$keepextensions"
20841 : Now see which nonxs extensions are supported on this system.
20842 : For now assume all are.
20844 for xxx in $nonxs_extensions ; do
20846 *) nonxs_ext="$nonxs_ext $xxx"
20858 A number of extensions are supplied with $package. You may choose to
20859 compile these extensions for dynamic loading (the default), compile
20860 them into the $package executable (static loading), or not include
20861 them at all. Answer "none" to include no extensions.
20862 Note that DynaLoader is always built and need not be mentioned here.
20865 case "$dynamic_ext" in
20867 : Exclude those listed in static_ext
20869 for xxx in $avail_ext; do
20870 case " $static_ext " in
20872 *) dflt="$dflt $xxx" ;;
20879 *) dflt="$dynamic_ext"
20880 # Perhaps we are reusing an old out-of-date config.sh.
20883 if test X"$dynamic_ext" != X"$avail_ext"; then
20885 NOTICE: Your previous config.sh list may be incorrect.
20886 The extensions now available to you are
20888 but the default list from your previous config.sh is
20900 rp="What extensions do you wish to load dynamically?"
20903 none) dynamic_ext=' ' ;;
20904 *) dynamic_ext="$ans" ;;
20907 case "$static_ext" in
20909 : Exclude those already listed in dynamic linking
20911 for xxx in $avail_ext; do
20912 case " $dynamic_ext " in
20914 *) dflt="$dflt $xxx" ;;
20921 *) dflt="$static_ext"
20928 rp="What extensions do you wish to load statically?"
20931 none) static_ext=' ' ;;
20932 *) static_ext="$ans" ;;
20937 A number of extensions are supplied with $package. Answer "none"
20938 to include no extensions.
20939 Note that DynaLoader is always built and need not be mentioned here.
20942 case "$static_ext" in
20943 '') dflt="$avail_ext" ;;
20944 *) dflt="$static_ext"
20945 # Perhaps we are reusing an old out-of-date config.sh.
20948 if test X"$static_ext" != X"$avail_ext"; then
20950 NOTICE: Your previous config.sh list may be incorrect.
20951 The extensions now available to you are
20953 but the default list from your previous config.sh is
20962 : Exclude those that are not xs extensions
20966 rp="What extensions do you wish to include?"
20969 none) static_ext=' ' ;;
20970 *) static_ext="$ans" ;;
20975 # Encode is a special case. If we are building Encode as a static
20976 # extension, we need to explicitly list its subextensions as well.
20977 # For other nested extensions, this is handled automatically by
20978 # the appropriate Makefile.PL.
20979 case " $static_ext " in
20980 *" Encode "*) # Add the subextensions of Encode
20982 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
20983 static_ext="$static_ext Encode/$xxx"
20989 set X $dynamic_ext $static_ext $nonxs_ext
20993 # Sanity check: We require an extension suitable for use with
20994 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
20995 # should show up as failures in the test suite, but it's helpful to
20996 # catch them now.) The 'extensions' list is normally sorted
20997 # alphabetically, so we need to accept either
20998 # DB_File ... Fcntl ... IO ....
20999 # or something like
21000 # Fcntl ... NDBM_File ... IO ....
21001 case " $extensions" in
21002 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
21003 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
21004 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
21005 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
21006 echo "WARNING: The Perl you are building will be quite crippled." >& 4
21010 : Remove libraries needed only for extensions
21011 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
21012 : The exception is SunOS 4.x, which needs them.
21013 case "${osname}X${osvers}" in
21017 *) case "$usedl" in
21018 $define|true|[yY]*)
21019 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
21023 *) perllibs="$libs"
21029 : Remove build directory name from cppstdin so it can be used from
21030 : either the present location or the final installed location.
21032 : Get out of the UU directory to get correct path name.
21034 case "$cppstdin" in
21036 echo "Stripping down cppstdin path name"
21042 : end of configuration questions
21044 echo "End of configuration questions."
21047 : back to where it started
21048 if test -d ../UU; then
21052 : configuration may be patched via a 'config.arch' file
21053 if $test -f config.arch; then
21054 echo "I see a config.arch file, loading it."
21058 : configuration may be patched via a 'config.over' file
21059 if $test -f config.over; then
21062 rp='I see a config.over file. Do you wish to load it?'
21065 n*) echo "OK, I'll ignore it.";;
21067 echo "Configuration override changes have been loaded."
21072 : in case they want portability, strip down executable paths
21073 case "$d_portable" in
21076 echo "Stripping down executable paths..." >&4
21077 for file in $loclist $trylist; do
21079 eval $file=`basename $temp`
21084 : create config.sh file
21086 echo "Creating config.sh..." >&4
21087 $spitshell <<EOT >config.sh
21090 # This file was produced by running the Configure script. It holds all the
21091 # definitions figured out by Configure. Should you modify one of these values,
21092 # do not forget to propagate your changes by running "Configure -der". You may
21093 # instead choose to run each of the .SH files by yourself, or "Configure -S".
21096 # Package name : $package
21097 # Source directory : $src
21098 # Configuration time: $cf_time
21099 # Configured by : $cf_by
21100 # Target system : $myuname
21110 Revision='$Revision'
21118 alignbytes='$alignbytes'
21119 ansi2knr='$ansi2knr'
21120 aphostname='$aphostname'
21121 api_revision='$api_revision'
21122 api_subversion='$api_subversion'
21123 api_version='$api_version'
21124 api_versionstring='$api_versionstring'
21127 archlibexp='$archlibexp'
21128 archname64='$archname64'
21129 archname='$archname'
21130 archobjs='$archobjs'
21131 asctime_r_proto='$asctime_r_proto'
21139 byteorder='$byteorder'
21141 castflags='$castflags'
21144 cccdlflags='$cccdlflags'
21145 ccdlflags='$ccdlflags'
21147 ccflags_uselargefiles='$ccflags_uselargefiles'
21149 ccsymbols='$ccsymbols'
21150 ccversion='$ccversion'
21152 cf_email='$cf_email'
21154 charsize='$charsize'
21158 clocktype='$clocktype'
21160 compress='$compress'
21161 contains='$contains'
21165 cpp_stuff='$cpp_stuff'
21166 cppccsymbols='$cppccsymbols'
21167 cppflags='$cppflags'
21169 cppminus='$cppminus'
21171 cppstdin='$cppstdin'
21172 cppsymbols='$cppsymbols'
21173 crypt_r_proto='$crypt_r_proto'
21174 cryptlib='$cryptlib'
21176 ctermid_r_proto='$ctermid_r_proto'
21177 ctime_r_proto='$ctime_r_proto'
21178 d_Gconvert='$d_Gconvert'
21179 d_PRIEUldbl='$d_PRIEUldbl'
21180 d_PRIFUldbl='$d_PRIFUldbl'
21181 d_PRIGUldbl='$d_PRIGUldbl'
21182 d_PRIXU64='$d_PRIXU64'
21183 d_PRId64='$d_PRId64'
21184 d_PRIeldbl='$d_PRIeldbl'
21185 d_PRIfldbl='$d_PRIfldbl'
21186 d_PRIgldbl='$d_PRIgldbl'
21187 d_PRIi64='$d_PRIi64'
21188 d_PRIo64='$d_PRIo64'
21189 d_PRIu64='$d_PRIu64'
21190 d_PRIx64='$d_PRIx64'
21191 d_SCNfldbl='$d_SCNfldbl'
21192 d__fwalk='$d__fwalk'
21193 d_access='$d_access'
21194 d_accessx='$d_accessx'
21197 d_archlib='$d_archlib'
21198 d_asctime_r='$d_asctime_r'
21201 d_attribute_format='$d_attribute_format'
21202 d_attribute_malloc='$d_attribute_malloc'
21203 d_attribute_nonnull='$d_attribute_nonnull'
21204 d_attribute_noreturn='$d_attribute_noreturn'
21205 d_attribute_pure='$d_attribute_pure'
21206 d_attribute_unused='$d_attribute_unused'
21207 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
21211 d_bsdgetpgrp='$d_bsdgetpgrp'
21212 d_bsdsetpgrp='$d_bsdsetpgrp'
21213 d_builtin_choose_expr='$d_builtin_choose_expr'
21214 d_builtin_expect='$d_builtin_expect'
21216 d_casti32='$d_casti32'
21217 d_castneg='$d_castneg'
21218 d_charvspr='$d_charvspr'
21220 d_chroot='$d_chroot'
21221 d_chsize='$d_chsize'
21223 d_clearenv='$d_clearenv'
21224 d_closedir='$d_closedir'
21225 d_cmsghdr_s='$d_cmsghdr_s'
21227 d_copysignl='$d_copysignl'
21229 d_crypt_r='$d_crypt_r'
21231 d_ctermid_r='$d_ctermid_r'
21232 d_ctime_r='$d_ctime_r'
21233 d_cuserid='$d_cuserid'
21234 d_dbl_dig='$d_dbl_dig'
21235 d_dbminitproto='$d_dbminitproto'
21236 d_difftime='$d_difftime'
21238 d_dirnamlen='$d_dirnamlen'
21239 d_dlerror='$d_dlerror'
21240 d_dlopen='$d_dlopen'
21241 d_dlsymun='$d_dlsymun'
21242 d_dosuid='$d_dosuid'
21243 d_drand48_r='$d_drand48_r'
21244 d_drand48proto='$d_drand48proto'
21246 d_eaccess='$d_eaccess'
21247 d_endgrent='$d_endgrent'
21248 d_endgrent_r='$d_endgrent_r'
21249 d_endhent='$d_endhent'
21250 d_endhostent_r='$d_endhostent_r'
21251 d_endnent='$d_endnent'
21252 d_endnetent_r='$d_endnetent_r'
21253 d_endpent='$d_endpent'
21254 d_endprotoent_r='$d_endprotoent_r'
21255 d_endpwent='$d_endpwent'
21256 d_endpwent_r='$d_endpwent_r'
21257 d_endsent='$d_endsent'
21258 d_endservent_r='$d_endservent_r'
21259 d_eofnblk='$d_eofnblk'
21260 d_eunice='$d_eunice'
21261 d_faststdio='$d_faststdio'
21262 d_fchdir='$d_fchdir'
21263 d_fchmod='$d_fchmod'
21264 d_fchown='$d_fchown'
21266 d_fcntl_can_lock='$d_fcntl_can_lock'
21267 d_fd_macros='$d_fd_macros'
21268 d_fd_set='$d_fd_set'
21269 d_fds_bits='$d_fds_bits'
21270 d_fgetpos='$d_fgetpos'
21271 d_finite='$d_finite'
21272 d_finitel='$d_finitel'
21273 d_flexfnam='$d_flexfnam'
21275 d_flockproto='$d_flockproto'
21277 d_fp_class='$d_fp_class'
21278 d_fpathconf='$d_fpathconf'
21279 d_fpclass='$d_fpclass'
21280 d_fpclassify='$d_fpclassify'
21281 d_fpclassl='$d_fpclassl'
21282 d_fpos64_t='$d_fpos64_t'
21283 d_frexpl='$d_frexpl'
21284 d_fs_data_s='$d_fs_data_s'
21285 d_fseeko='$d_fseeko'
21286 d_fsetpos='$d_fsetpos'
21287 d_fstatfs='$d_fstatfs'
21288 d_fstatvfs='$d_fstatvfs'
21290 d_ftello='$d_ftello'
21292 d_futimes='$d_futimes'
21293 d_getcwd='$d_getcwd'
21294 d_getespwnam='$d_getespwnam'
21295 d_getfsstat='$d_getfsstat'
21296 d_getgrent='$d_getgrent'
21297 d_getgrent_r='$d_getgrent_r'
21298 d_getgrgid_r='$d_getgrgid_r'
21299 d_getgrnam_r='$d_getgrnam_r'
21300 d_getgrps='$d_getgrps'
21301 d_gethbyaddr='$d_gethbyaddr'
21302 d_gethbyname='$d_gethbyname'
21303 d_gethent='$d_gethent'
21304 d_gethname='$d_gethname'
21305 d_gethostbyaddr_r='$d_gethostbyaddr_r'
21306 d_gethostbyname_r='$d_gethostbyname_r'
21307 d_gethostent_r='$d_gethostent_r'
21308 d_gethostprotos='$d_gethostprotos'
21309 d_getitimer='$d_getitimer'
21310 d_getlogin='$d_getlogin'
21311 d_getlogin_r='$d_getlogin_r'
21312 d_getmnt='$d_getmnt'
21313 d_getmntent='$d_getmntent'
21314 d_getnbyaddr='$d_getnbyaddr'
21315 d_getnbyname='$d_getnbyname'
21316 d_getnent='$d_getnent'
21317 d_getnetbyaddr_r='$d_getnetbyaddr_r'
21318 d_getnetbyname_r='$d_getnetbyname_r'
21319 d_getnetent_r='$d_getnetent_r'
21320 d_getnetprotos='$d_getnetprotos'
21321 d_getpagsz='$d_getpagsz'
21322 d_getpbyname='$d_getpbyname'
21323 d_getpbynumber='$d_getpbynumber'
21324 d_getpent='$d_getpent'
21325 d_getpgid='$d_getpgid'
21326 d_getpgrp2='$d_getpgrp2'
21327 d_getpgrp='$d_getpgrp'
21328 d_getppid='$d_getppid'
21329 d_getprior='$d_getprior'
21330 d_getprotobyname_r='$d_getprotobyname_r'
21331 d_getprotobynumber_r='$d_getprotobynumber_r'
21332 d_getprotoent_r='$d_getprotoent_r'
21333 d_getprotoprotos='$d_getprotoprotos'
21334 d_getprpwnam='$d_getprpwnam'
21335 d_getpwent='$d_getpwent'
21336 d_getpwent_r='$d_getpwent_r'
21337 d_getpwnam_r='$d_getpwnam_r'
21338 d_getpwuid_r='$d_getpwuid_r'
21339 d_getsbyname='$d_getsbyname'
21340 d_getsbyport='$d_getsbyport'
21341 d_getsent='$d_getsent'
21342 d_getservbyname_r='$d_getservbyname_r'
21343 d_getservbyport_r='$d_getservbyport_r'
21344 d_getservent_r='$d_getservent_r'
21345 d_getservprotos='$d_getservprotos'
21346 d_getspnam='$d_getspnam'
21347 d_getspnam_r='$d_getspnam_r'
21348 d_gettimeod='$d_gettimeod'
21349 d_gmtime_r='$d_gmtime_r'
21350 d_gnulibc='$d_gnulibc'
21351 d_grpasswd='$d_grpasswd'
21352 d_hasmntopt='$d_hasmntopt'
21354 d_ilogbl='$d_ilogbl'
21355 d_inc_version_list="$d_inc_version_list"
21357 d_inetaton='$d_inetaton'
21358 d_int64_t='$d_int64_t'
21359 d_isascii='$d_isascii'
21360 d_isfinite='$d_isfinite'
21363 d_isnanl='$d_isnanl'
21364 d_killpg='$d_killpg'
21365 d_lchown='$d_lchown'
21366 d_ldbl_dig='$d_ldbl_dig'
21367 d_libm_lib_version='$d_libm_lib_version'
21369 d_localtime_r='$d_localtime_r'
21370 d_locconv='$d_locconv'
21372 d_longdbl='$d_longdbl'
21373 d_longlong='$d_longlong'
21374 d_lseekproto='$d_lseekproto'
21376 d_madvise='$d_madvise'
21377 d_malloc_good_size='$d_malloc_good_size'
21378 d_malloc_size='$d_malloc_size'
21380 d_mbstowcs='$d_mbstowcs'
21381 d_mbtowc='$d_mbtowc'
21382 d_memchr='$d_memchr'
21383 d_memcmp='$d_memcmp'
21384 d_memcpy='$d_memcpy'
21385 d_memmove='$d_memmove'
21386 d_memset='$d_memset'
21388 d_mkdtemp='$d_mkdtemp'
21389 d_mkfifo='$d_mkfifo'
21390 d_mkstemp='$d_mkstemp'
21391 d_mkstemps='$d_mkstemps'
21392 d_mktime='$d_mktime'
21395 d_modfl_pow32_bug='$d_modfl_pow32_bug'
21396 d_modflproto='$d_modflproto'
21397 d_mprotect='$d_mprotect'
21399 d_msg_ctrunc='$d_msg_ctrunc'
21400 d_msg_dontroute='$d_msg_dontroute'
21401 d_msg_oob='$d_msg_oob'
21402 d_msg_peek='$d_msg_peek'
21403 d_msg_proxy='$d_msg_proxy'
21404 d_msgctl='$d_msgctl'
21405 d_msgget='$d_msgget'
21406 d_msghdr_s='$d_msghdr_s'
21407 d_msgrcv='$d_msgrcv'
21408 d_msgsnd='$d_msgsnd'
21410 d_munmap='$d_munmap'
21411 d_mymalloc='$d_mymalloc'
21413 d_nl_langinfo='$d_nl_langinfo'
21414 d_nv_preserves_uv='$d_nv_preserves_uv'
21415 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
21416 d_off64_t='$d_off64_t'
21417 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
21418 d_oldpthreads='$d_oldpthreads'
21419 d_oldsock='$d_oldsock'
21421 d_pathconf='$d_pathconf'
21423 d_perl_otherlibdirs='$d_perl_otherlibdirs'
21424 d_phostname='$d_phostname'
21427 d_portable='$d_portable'
21428 d_procselfexe='$d_procselfexe'
21429 d_pthread_atfork='$d_pthread_atfork'
21430 d_pthread_attr_setscope='$d_pthread_attr_setscope'
21431 d_pthread_yield='$d_pthread_yield'
21433 d_pwchange='$d_pwchange'
21434 d_pwclass='$d_pwclass'
21435 d_pwcomment='$d_pwcomment'
21436 d_pwexpire='$d_pwexpire'
21437 d_pwgecos='$d_pwgecos'
21438 d_pwpasswd='$d_pwpasswd'
21439 d_pwquota='$d_pwquota'
21442 d_random_r='$d_random_r'
21443 d_readdir64_r='$d_readdir64_r'
21444 d_readdir='$d_readdir'
21445 d_readdir_r='$d_readdir_r'
21446 d_readlink='$d_readlink'
21448 d_recvmsg='$d_recvmsg'
21449 d_rename='$d_rename'
21450 d_rewinddir='$d_rewinddir'
21452 d_safebcpy='$d_safebcpy'
21453 d_safemcpy='$d_safemcpy'
21454 d_sanemcmp='$d_sanemcmp'
21455 d_sbrkproto='$d_sbrkproto'
21456 d_scalbnl='$d_scalbnl'
21457 d_sched_yield='$d_sched_yield'
21458 d_scm_rights='$d_scm_rights'
21459 d_seekdir='$d_seekdir'
21460 d_select='$d_select'
21462 d_semctl='$d_semctl'
21463 d_semctl_semid_ds='$d_semctl_semid_ds'
21464 d_semctl_semun='$d_semctl_semun'
21465 d_semget='$d_semget'
21467 d_sendmsg='$d_sendmsg'
21468 d_setegid='$d_setegid'
21469 d_seteuid='$d_seteuid'
21470 d_setgrent='$d_setgrent'
21471 d_setgrent_r='$d_setgrent_r'
21472 d_setgrps='$d_setgrps'
21473 d_sethent='$d_sethent'
21474 d_sethostent_r='$d_sethostent_r'
21475 d_setitimer='$d_setitimer'
21476 d_setlinebuf='$d_setlinebuf'
21477 d_setlocale='$d_setlocale'
21478 d_setlocale_r='$d_setlocale_r'
21479 d_setnent='$d_setnent'
21480 d_setnetent_r='$d_setnetent_r'
21481 d_setpent='$d_setpent'
21482 d_setpgid='$d_setpgid'
21483 d_setpgrp2='$d_setpgrp2'
21484 d_setpgrp='$d_setpgrp'
21485 d_setprior='$d_setprior'
21486 d_setproctitle='$d_setproctitle'
21487 d_setprotoent_r='$d_setprotoent_r'
21488 d_setpwent='$d_setpwent'
21489 d_setpwent_r='$d_setpwent_r'
21490 d_setregid='$d_setregid'
21491 d_setresgid='$d_setresgid'
21492 d_setresuid='$d_setresuid'
21493 d_setreuid='$d_setreuid'
21494 d_setrgid='$d_setrgid'
21495 d_setruid='$d_setruid'
21496 d_setsent='$d_setsent'
21497 d_setservent_r='$d_setservent_r'
21498 d_setsid='$d_setsid'
21499 d_setvbuf='$d_setvbuf'
21503 d_shmatprototype='$d_shmatprototype'
21504 d_shmctl='$d_shmctl'
21506 d_shmget='$d_shmget'
21507 d_sigaction='$d_sigaction'
21508 d_sigprocmask='$d_sigprocmask'
21509 d_sigsetjmp='$d_sigsetjmp'
21510 d_sitearch='$d_sitearch'
21511 d_snprintf='$d_snprintf'
21512 d_sockatmark='$d_sockatmark'
21513 d_sockatmarkproto='$d_sockatmarkproto'
21514 d_socket='$d_socket'
21515 d_socklen_t='$d_socklen_t'
21516 d_sockpair='$d_sockpair'
21517 d_socks5_init='$d_socks5_init'
21518 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
21520 d_srand48_r='$d_srand48_r'
21521 d_srandom_r='$d_srandom_r'
21522 d_sresgproto='$d_sresgproto'
21523 d_sresuproto='$d_sresuproto'
21524 d_statblks='$d_statblks'
21525 d_statfs_f_flags='$d_statfs_f_flags'
21526 d_statfs_s='$d_statfs_s'
21527 d_statvfs='$d_statvfs'
21528 d_stdio_cnt_lval='$d_stdio_cnt_lval'
21529 d_stdio_ptr_lval='$d_stdio_ptr_lval'
21530 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
21531 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
21532 d_stdio_stream_array='$d_stdio_stream_array'
21533 d_stdiobase='$d_stdiobase'
21534 d_stdstdio='$d_stdstdio'
21535 d_strchr='$d_strchr'
21536 d_strcoll='$d_strcoll'
21537 d_strctcpy='$d_strctcpy'
21538 d_strerrm='$d_strerrm'
21539 d_strerror='$d_strerror'
21540 d_strerror_r='$d_strerror_r'
21541 d_strftime='$d_strftime'
21542 d_strlcat='$d_strlcat'
21543 d_strlcpy='$d_strlcpy'
21544 d_strtod='$d_strtod'
21545 d_strtol='$d_strtol'
21546 d_strtold='$d_strtold'
21547 d_strtoll='$d_strtoll'
21548 d_strtoq='$d_strtoq'
21549 d_strtoul='$d_strtoul'
21550 d_strtoull='$d_strtoull'
21551 d_strtouq='$d_strtouq'
21552 d_strxfrm='$d_strxfrm'
21553 d_suidsafe='$d_suidsafe'
21554 d_symlink='$d_symlink'
21555 d_syscall='$d_syscall'
21556 d_syscallproto='$d_syscallproto'
21557 d_sysconf='$d_sysconf'
21558 d_sysernlst='$d_sysernlst'
21559 d_syserrlst='$d_syserrlst'
21560 d_system='$d_system'
21561 d_tcgetpgrp='$d_tcgetpgrp'
21562 d_tcsetpgrp='$d_tcsetpgrp'
21563 d_telldir='$d_telldir'
21564 d_telldirproto='$d_telldirproto'
21567 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
21568 d_tm_tm_zone='$d_tm_tm_zone'
21569 d_tmpnam_r='$d_tmpnam_r'
21570 d_truncate='$d_truncate'
21571 d_ttyname_r='$d_ttyname_r'
21572 d_tzname='$d_tzname'
21573 d_u32align='$d_u32align'
21574 d_ualarm='$d_ualarm'
21577 d_union_semun='$d_union_semun'
21578 d_unordered='$d_unordered'
21579 d_unsetenv='$d_unsetenv'
21580 d_usleep='$d_usleep'
21581 d_usleepproto='$d_usleepproto'
21583 d_vendorarch='$d_vendorarch'
21584 d_vendorbin='$d_vendorbin'
21585 d_vendorlib='$d_vendorlib'
21586 d_vendorscript='$d_vendorscript'
21588 d_void_closedir='$d_void_closedir'
21589 d_voidsig='$d_voidsig'
21590 d_voidtty='$d_voidtty'
21591 d_volatile='$d_volatile'
21592 d_vprintf='$d_vprintf'
21593 d_vsnprintf='$d_vsnprintf'
21595 d_waitpid='$d_waitpid'
21596 d_wcstombs='$d_wcstombs'
21597 d_wctomb='$d_wctomb'
21598 d_writev='$d_writev'
21601 db_hashtype='$db_hashtype'
21602 db_prefixtype='$db_prefixtype'
21603 db_version_major='$db_version_major'
21604 db_version_minor='$db_version_minor'
21605 db_version_patch='$db_version_patch'
21606 defvoidused='$defvoidused'
21607 direntrytype='$direntrytype'
21610 doublesize='$doublesize'
21612 drand48_r_proto='$drand48_r_proto'
21613 dynamic_ext='$dynamic_ext'
21619 endgrent_r_proto='$endgrent_r_proto'
21620 endhostent_r_proto='$endhostent_r_proto'
21621 endnetent_r_proto='$endnetent_r_proto'
21622 endprotoent_r_proto='$endprotoent_r_proto'
21623 endpwent_r_proto='$endpwent_r_proto'
21624 endservent_r_proto='$endservent_r_proto'
21625 eunicefix='$eunicefix'
21628 extensions='$extensions'
21630 fflushNULL='$fflushNULL'
21631 fflushall='$fflushall'
21633 firstmakefile='$firstmakefile'
21635 fpossize='$fpossize'
21636 fpostype='$fpostype'
21637 freetype='$freetype'
21640 full_csh='$full_csh'
21641 full_sed='$full_sed'
21642 gccansipedantic='$gccansipedantic'
21643 gccosandvers='$gccosandvers'
21644 gccversion='$gccversion'
21645 getgrent_r_proto='$getgrent_r_proto'
21646 getgrgid_r_proto='$getgrgid_r_proto'
21647 getgrnam_r_proto='$getgrnam_r_proto'
21648 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
21649 gethostbyname_r_proto='$gethostbyname_r_proto'
21650 gethostent_r_proto='$gethostent_r_proto'
21651 getlogin_r_proto='$getlogin_r_proto'
21652 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
21653 getnetbyname_r_proto='$getnetbyname_r_proto'
21654 getnetent_r_proto='$getnetent_r_proto'
21655 getprotobyname_r_proto='$getprotobyname_r_proto'
21656 getprotobynumber_r_proto='$getprotobynumber_r_proto'
21657 getprotoent_r_proto='$getprotoent_r_proto'
21658 getpwent_r_proto='$getpwent_r_proto'
21659 getpwnam_r_proto='$getpwnam_r_proto'
21660 getpwuid_r_proto='$getpwuid_r_proto'
21661 getservbyname_r_proto='$getservbyname_r_proto'
21662 getservbyport_r_proto='$getservbyport_r_proto'
21663 getservent_r_proto='$getservent_r_proto'
21664 getspnam_r_proto='$getspnam_r_proto'
21665 gidformat='$gidformat'
21671 gmtime_r_proto='$gmtime_r_proto'
21672 gnulibc_version='$gnulibc_version'
21674 groupcat='$groupcat'
21675 groupstype='$groupstype'
21678 h_sysfile='$h_sysfile'
21681 html1dir='$html1dir'
21682 html1direxp='$html1direxp'
21683 html3dir='$html3dir'
21684 html3direxp='$html3direxp'
21693 i_arpainet='$i_arpainet'
21694 i_bsdioctl='$i_bsdioctl'
21698 i_dirent='$i_dirent'
21704 i_fp_class='$i_fp_class'
21707 i_ieeefp='$i_ieeefp'
21708 i_inttypes='$i_inttypes'
21709 i_langinfo='$i_langinfo'
21710 i_libutil='$i_libutil'
21711 i_limits='$i_limits'
21712 i_locale='$i_locale'
21713 i_machcthr='$i_machcthr'
21714 i_malloc='$i_malloc'
21716 i_memory='$i_memory'
21717 i_mntent='$i_mntent'
21720 i_neterrno='$i_neterrno'
21721 i_netinettcp='$i_netinettcp'
21725 i_pthread='$i_pthread'
21727 i_rpcsvcdbm='$i_rpcsvcdbm'
21730 i_shadow='$i_shadow'
21732 i_stdarg='$i_stdarg'
21733 i_stddef='$i_stddef'
21734 i_stdlib='$i_stdlib'
21735 i_string='$i_string'
21736 i_sunmath='$i_sunmath'
21737 i_sysaccess='$i_sysaccess'
21738 i_sysdir='$i_sysdir'
21739 i_sysfile='$i_sysfile'
21740 i_sysfilio='$i_sysfilio'
21742 i_sysioctl='$i_sysioctl'
21743 i_syslog='$i_syslog'
21744 i_sysmman='$i_sysmman'
21745 i_sysmode='$i_sysmode'
21746 i_sysmount='$i_sysmount'
21747 i_sysndir='$i_sysndir'
21748 i_sysparam='$i_sysparam'
21749 i_sysresrc='$i_sysresrc'
21750 i_syssecrt='$i_syssecrt'
21751 i_sysselct='$i_sysselct'
21752 i_syssockio='$i_syssockio'
21753 i_sysstat='$i_sysstat'
21754 i_sysstatfs='$i_sysstatfs'
21755 i_sysstatvfs='$i_sysstatvfs'
21756 i_systime='$i_systime'
21757 i_systimek='$i_systimek'
21758 i_systimes='$i_systimes'
21759 i_systypes='$i_systypes'
21760 i_sysuio='$i_sysuio'
21762 i_sysutsname='$i_sysutsname'
21763 i_sysvfs='$i_sysvfs'
21764 i_syswait='$i_syswait'
21765 i_termio='$i_termio'
21766 i_termios='$i_termios'
21768 i_unistd='$i_unistd'
21771 i_values='$i_values'
21772 i_varargs='$i_varargs'
21773 i_varhdr='$i_varhdr'
21775 ignore_versioned_solibs='$ignore_versioned_solibs'
21776 inc_version_list='$inc_version_list'
21777 inc_version_list_init='$inc_version_list_init'
21780 installarchlib='$installarchlib'
21781 installbin='$installbin'
21782 installhtml1dir='$installhtml1dir'
21783 installhtml3dir='$installhtml3dir'
21784 installman1dir='$installman1dir'
21785 installman3dir='$installman3dir'
21786 installprefix='$installprefix'
21787 installprefixexp='$installprefixexp'
21788 installprivlib='$installprivlib'
21789 installscript='$installscript'
21790 installsitearch='$installsitearch'
21791 installsitebin='$installsitebin'
21792 installsitehtml1dir='$installsitehtml1dir'
21793 installsitehtml3dir='$installsitehtml3dir'
21794 installsitelib='$installsitelib'
21795 installsiteman1dir='$installsiteman1dir'
21796 installsiteman3dir='$installsiteman3dir'
21797 installsitescript='$installsitescript'
21798 installstyle='$installstyle'
21799 installusrbinperl='$installusrbinperl'
21800 installvendorarch='$installvendorarch'
21801 installvendorbin='$installvendorbin'
21802 installvendorhtml1dir='$installvendorhtml1dir'
21803 installvendorhtml3dir='$installvendorhtml3dir'
21804 installvendorlib='$installvendorlib'
21805 installvendorman1dir='$installvendorman1dir'
21806 installvendorman3dir='$installvendorman3dir'
21807 installvendorscript='$installvendorscript'
21809 issymlink='$issymlink'
21810 ivdformat='$ivdformat'
21813 known_extensions='$known_extensions'
21816 lddlflags='$lddlflags'
21818 ldflags_uselargefiles='$ldflags_uselargefiles'
21819 ldlibpthname='$ldlibpthname'
21826 libsdirs='$libsdirs'
21827 libsfiles='$libsfiles'
21828 libsfound='$libsfound'
21829 libspath='$libspath'
21830 libswanted='$libswanted'
21831 libswanted_uselargefiles='$libswanted_uselargefiles'
21837 localtime_r_proto='$localtime_r_proto'
21838 locincpth='$locincpth'
21839 loclibpth='$loclibpth'
21840 longdblsize='$longdblsize'
21841 longlongsize='$longlongsize'
21842 longsize='$longsize'
21846 lseeksize='$lseeksize'
21847 lseektype='$lseektype'
21852 make_set_make='$make_set_make'
21853 mallocobj='$mallocobj'
21854 mallocsrc='$mallocsrc'
21856 madlyobj='$madlyobj'
21857 madlysrc='$madlysrc'
21858 malloctype='$malloctype'
21860 man1direxp='$man1direxp'
21863 man3direxp='$man3direxp'
21865 mips_type='$mips_type'
21866 mistrustnm='$mistrustnm'
21868 mmaptype='$mmaptype'
21869 modetype='$modetype'
21871 multiarch='$multiarch'
21873 myarchname='$myarchname'
21874 mydomain='$mydomain'
21875 myhostname='$myhostname'
21878 need_va_copy='$need_va_copy'
21879 netdb_hlen_type='$netdb_hlen_type'
21880 netdb_host_type='$netdb_host_type'
21881 netdb_name_type='$netdb_name_type'
21882 netdb_net_type='$netdb_net_type'
21885 nm_so_opt='$nm_so_opt'
21886 nonxs_ext='$nonxs_ext'
21888 nvEUformat='$nvEUformat'
21889 nvFUformat='$nvFUformat'
21890 nvGUformat='$nvGUformat'
21891 nv_preserves_uv_bits='$nv_preserves_uv_bits'
21892 nveformat='$nveformat'
21893 nvfformat='$nvfformat'
21894 nvgformat='$nvgformat'
21897 o_nonblock='$o_nonblock'
21899 old_pthread_create_joinable='$old_pthread_create_joinable'
21900 optimize='$optimize'
21901 orderlib='$orderlib'
21904 otherlibdirs='$otherlibdirs'
21908 patchlevel='$patchlevel'
21909 path_sep='$path_sep'
21912 perl_patchlevel='$perl_patchlevel'
21913 perladmin='$perladmin'
21914 perllibs='$perllibs'
21915 perlpath='$perlpath'
21917 phostname='$phostname'
21923 prefixexp='$prefixexp'
21925 privlibexp='$privlibexp'
21926 procselfexe='$procselfexe'
21927 prototype='$prototype'
21929 quadkind='$quadkind'
21930 quadtype='$quadtype'
21931 randbits='$randbits'
21932 randfunc='$randfunc'
21933 random_r_proto='$random_r_proto'
21934 randseedtype='$randseedtype'
21936 rd_nodata='$rd_nodata'
21937 readdir64_r_proto='$readdir64_r_proto'
21938 readdir_r_proto='$readdir_r_proto'
21939 revision='$revision'
21944 sPRIEUldbl='$sPRIEUldbl'
21945 sPRIFUldbl='$sPRIFUldbl'
21946 sPRIGUldbl='$sPRIGUldbl'
21947 sPRIXU64='$sPRIXU64'
21949 sPRIeldbl='$sPRIeldbl'
21950 sPRIfldbl='$sPRIfldbl'
21951 sPRIgldbl='$sPRIgldbl'
21956 sSCNfldbl='$sSCNfldbl'
21957 sched_yield='$sched_yield'
21958 scriptdir='$scriptdir'
21959 scriptdirexp='$scriptdirexp'
21961 seedfunc='$seedfunc'
21962 selectminbits='$selectminbits'
21963 selecttype='$selecttype'
21964 sendmail='$sendmail'
21965 setgrent_r_proto='$setgrent_r_proto'
21966 sethostent_r_proto='$sethostent_r_proto'
21967 setlocale_r_proto='$setlocale_r_proto'
21968 setnetent_r_proto='$setnetent_r_proto'
21969 setprotoent_r_proto='$setprotoent_r_proto'
21970 setpwent_r_proto='$setpwent_r_proto'
21971 setservent_r_proto='$setservent_r_proto'
21974 sharpbang='$sharpbang'
21975 shmattype='$shmattype'
21976 shortsize='$shortsize'
21979 sig_count='$sig_count'
21980 sig_name='$sig_name'
21981 sig_name_init='$sig_name_init'
21983 sig_num_init='$sig_num_init'
21984 sig_size='$sig_size'
21985 signal_t='$signal_t'
21986 sitearch='$sitearch'
21987 sitearchexp='$sitearchexp'
21989 sitebinexp='$sitebinexp'
21990 sitehtml1dir='$sitehtml1dir'
21991 sitehtml1direxp='$sitehtml1direxp'
21992 sitehtml3dir='$sitehtml3dir'
21993 sitehtml3direxp='$sitehtml3direxp'
21995 sitelib_stem='$sitelib_stem'
21996 sitelibexp='$sitelibexp'
21997 siteman1dir='$siteman1dir'
21998 siteman1direxp='$siteman1direxp'
21999 siteman3dir='$siteman3dir'
22000 siteman3direxp='$siteman3direxp'
22001 siteprefix='$siteprefix'
22002 siteprefixexp='$siteprefixexp'
22003 sitescript='$sitescript'
22004 sitescriptexp='$sitescriptexp'
22005 sizesize='$sizesize'
22006 sizetype='$sizetype'
22010 sockethdr='$sockethdr'
22011 socketlib='$socketlib'
22012 socksizetype='$socksizetype'
22014 spackage='$spackage'
22015 spitshell='$spitshell'
22016 srand48_r_proto='$srand48_r_proto'
22017 srandom_r_proto='$srandom_r_proto'
22019 ssizetype='$ssizetype'
22020 startperl='$startperl'
22022 static_ext='$static_ext'
22024 stdio_base='$stdio_base'
22025 stdio_bufsiz='$stdio_bufsiz'
22026 stdio_cnt='$stdio_cnt'
22027 stdio_filbuf='$stdio_filbuf'
22028 stdio_ptr='$stdio_ptr'
22029 stdio_stream_array='$stdio_stream_array'
22030 strerror_r_proto='$strerror_r_proto'
22033 subversion='$subversion'
22037 targetarch='$targetarch'
22041 timeincl='$timeincl'
22042 timetype='$timetype'
22043 tmpnam_r_proto='$tmpnam_r_proto'
22049 ttyname_r_proto='$ttyname_r_proto'
22058 uidformat='$uidformat'
22064 uquadtype='$uquadtype'
22065 use5005threads='$use5005threads'
22066 use64bitall='$use64bitall'
22067 use64bitint='$use64bitint'
22068 usecrosscompile='$usecrosscompile'
22070 usefaststdio='$usefaststdio'
22071 useithreads='$useithreads'
22072 uselargefiles='$uselargefiles'
22073 uselongdouble='$uselongdouble'
22074 usemallocwrap='$usemallocwrap'
22075 usemorebits='$usemorebits'
22076 usemultiplicity='$usemultiplicity'
22077 usemymalloc='$usemymalloc'
22079 useopcode='$useopcode'
22080 useperlio='$useperlio'
22081 useposix='$useposix'
22082 usereentrant='$usereentrant'
22083 initialinstalllocation="$initialinstalllocation"
22084 userelocatableinc='$userelocatableinc'
22086 useshrplib='$useshrplib'
22087 usesitecustomize='$usesitecustomize'
22088 usesocks='$usesocks'
22089 usethreads='$usethreads'
22090 usevendorprefix='$usevendorprefix'
22091 usevfork='$usevfork'
22094 uvXUformat='$uvXUformat'
22095 uvoformat='$uvoformat'
22098 uvuformat='$uvuformat'
22099 uvxformat='$uvxformat'
22100 vendorarch='$vendorarch'
22101 vendorarchexp='$vendorarchexp'
22102 vendorbin='$vendorbin'
22103 vendorbinexp='$vendorbinexp'
22104 vendorhtml1dir='$vendorhtml1dir'
22105 vendorhtml1direxp='$vendorhtml1direxp'
22106 vendorhtml3dir='$vendorhtml3dir'
22107 vendorhtml3direxp='$vendorhtml3direxp'
22108 vendorlib='$vendorlib'
22109 vendorlib_stem='$vendorlib_stem'
22110 vendorlibexp='$vendorlibexp'
22111 vendorman1dir='$vendorman1dir'
22112 vendorman1direxp='$vendorman1direxp'
22113 vendorman3dir='$vendorman3dir'
22114 vendorman3direxp='$vendorman3direxp'
22115 vendorprefix='$vendorprefix'
22116 vendorprefixexp='$vendorprefixexp'
22117 vendorscript='$vendorscript'
22118 vendorscriptexp='$vendorscriptexp'
22120 version_patchlevel_string='$version_patchlevel_string'
22121 versiononly='$versiononly'
22123 voidflags='$voidflags'
22126 yaccflags='$yaccflags'
22131 : Add in command line options if available
22132 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22134 : add special variables
22135 $test -f $src/patchlevel.h && \
22136 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
22137 echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
22138 echo "PERL_CONFIG_SH=true" >>config.sh
22140 : propagate old symbols
22141 if $test -f UU/config.sh; then
22142 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
22143 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
22144 $sort | $uniq -u >UU/oldsyms
22145 set X `cat UU/oldsyms`
22151 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
22153 echo "# Variables propagated from previous config.sh file." >>config.sh
22154 for sym in `cat UU/oldsyms`; do
22155 echo " Propagating $hint variable "'$'"$sym..."
22156 eval 'tmp="$'"${sym}"'"'
22158 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
22164 : Finish up by extracting the .SH files
22168 echo "Extraction done."
22178 If you'd like to make any changes to the config.sh file before I begin
22179 to configure things, do it as a shell escape now (e.g. !vi config.sh).
22182 rp="Press return or use a shell escape to edit config.sh:"
22187 *) : in case they cannot read
22188 sh 1>&4 -c "$ans";;
22193 : if this fails, just run all the .SH files by hand
22202 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
22209 Now you need to generate make dependencies by running "$make depend".
22210 You might prefer to run it in background: "$make depend > makedepend.out &"
22211 It can take a while, so you might not want to run it right now.
22216 rp="Run $make depend now?"
22220 $make depend && echo "Now you must run '$make'."
22223 echo "You must run '$make depend' then '$make'."
22226 elif test -f [Mm]akefile; then
22228 echo "Now you must run a $make."
22230 echo "Configure done."
22233 if $test -f Policy.sh; then
22236 If you compile $package on a different machine or from a different object
22237 directory, copy the Policy.sh file from this object directory to the
22238 new one before you run Configure -- this will help you with most of
22239 the policy defaults.
22243 if $test -f config.msg; then
22244 echo "Hmm. I also noted the following information while running:"
22246 $cat config.msg >&4
22249 $rm -f kit*isdone ark*isdone