3 # If these # comments don't work, trim them. Don't worry about any other
4 # shell scripts, Configure will trim # comments from them for you.
6 # (If you are trying to port this package to a machine without sh,
7 # I would suggest you have a look at the prototypical config_h.SH file
8 # and edit it to reflect your system. Some packages may include samples
9 # of config.h for certain machines, so you might look for one of those.)
11 # Yes, you may rip this off to use in other distribution packages. This
12 # script belongs to the public domain and cannot be copyrighted.
14 # (Note: this Configure script was generated automatically. Rather than
15 # working with this copy of Configure, you may wish to get metaconfig.
16 # The dist-3.0 package (which contains metaconfig) was posted in
17 # comp.sources.misc and is available on CPAN under authors/id/RAM so
18 # you may fetch it yourself from your nearest archive site.)
21 # Though this script was generated by metaconfig, it is OK to send
22 # patches against it. It's up to the Configure pumpkin to backport
23 # the patch to the metaunits if it is accepted.
24 # See Porting/pumpkin.pod for more information on metaconfig.
27 # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
29 # Generated on Mon Sep 12 15:44:06 CEST 2005 [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=''
400 endhostent_r_proto=''
406 endprotoent_r_proto=''
412 endservent_r_proto=''
463 gethostbyaddr_r_proto=''
465 gethostbyname_r_proto=''
467 gethostent_r_proto=''
479 getnetbyaddr_r_proto=''
481 getnetbyname_r_proto=''
495 d_getprotobyname_r=''
496 getprotobyname_r_proto=''
497 d_getprotobynumber_r=''
498 getprotobynumber_r_proto=''
500 getprotoent_r_proto=''
512 getservbyname_r_proto=''
514 getservbyport_r_proto=''
516 getservent_r_proto=''
540 d_libm_lib_version=''
553 d_malloc_good_size=''
595 d_old_pthread_create_joinable=''
596 old_pthread_create_joinable=''
598 d_pthread_attr_setscope=''
637 sethostent_r_proto=''
654 setprotoent_r_proto=''
666 setservent_r_proto=''
711 d_stdio_ptr_lval_nochange_cnt=''
712 d_stdio_ptr_lval_sets_cnt=''
915 inc_version_list_init=''
934 ignore_versioned_solibs=''
994 d_perl_otherlibdirs=''
1002 api_versionstring=''
1008 version_patchlevel_string=''
1012 d_nv_preserves_uv=''
1013 d_nv_zero_is_allbits_zero=''
1024 nv_preserves_uv_bits=''
1095 installsitehtml1dir=''
1098 installsitehtml3dir=''
1105 installsiteman1dir=''
1108 installsiteman3dir=''
1113 installsitescript=''
1128 d_stdio_stream_array=''
1129 stdio_stream_array=''
1140 ccflags_uselargefiles=''
1141 ldflags_uselargefiles=''
1142 libswanted_uselargefiles=''
1152 userelocatableinc=''
1163 installvendorarch=''
1170 installvendorhtml1dir=''
1172 vendorhtml1direxp=''
1173 installvendorhtml3dir=''
1175 vendorhtml3direxp=''
1181 installvendorman1dir=''
1184 installvendorman3dir=''
1191 installvendorscript=''
1203 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1206 : We must find out about Eunice early
1208 if test -f /etc/unixtovms; then
1209 eunicefix=/etc/unixtovms
1211 if test -f /etc/unixtovms.exe; then
1212 eunicefix=/etc/unixtovms.exe
1215 : Set executable suffix now -- needed before hints available
1216 if test -f "/libs/version.library"; then
1219 elif test -f "/system/gnu_library/bin/ar.pm"; then
1222 elif test -n "$DJGPP"; then
1225 elif test -d c:/. -o -n "$is_os2" ; then
1234 : set useposix=false in your hint file to disable the POSIX extension.
1236 : set useopcode=false in your hint file to disable the Opcode extension.
1238 : Trailing extension. Override this in a hint file, if needed.
1239 : Extra object files, if any, needed on this platform.
1242 : Possible local include directories to search.
1243 : Set locincpth to "" in a hint file to defeat local include searches.
1244 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1245 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1247 : no include file wanted by default
1252 : change the next line if compiling for Xenix/286 on Xenix/386
1253 xlibpth='/usr/lib/386 /lib/386'
1254 : Possible local library directories to search.
1255 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1256 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1258 : general looking path for locating libraries
1259 glibpth="/lib /usr/lib $xlibpth"
1260 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1261 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1262 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1264 : Private path used by Configure to find libraries. Its value
1265 : is prepended to libpth. This variable takes care of special
1266 : machines, like the mips. Usually, it should be empty.
1269 : default library list
1271 : some systems want to use only the non-versioned libso:s
1272 ignore_versioned_solibs=''
1277 ccflags_uselargefiles=''
1278 ldflags_uselargefiles=''
1279 libswanted_uselargefiles=''
1280 : set usemultiplicity on the Configure command line to enable multiplicity.
1281 : set usesocks on the Configure command line to enable socks.
1282 : set usethreads on the Configure command line to enable threads.
1283 usereentrant='undef'
1284 : full support for void wanted by default
1287 : List of libraries we want.
1288 : If anyone needs extra -lxxx, put those in a hint file.
1289 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1290 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1291 : We probably want to search /usr/shlib before most other libraries.
1292 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1293 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1294 glibpth="/usr/shlib $glibpth"
1295 : Do not use vfork unless overridden by a hint file.
1298 : Find the basic shell for Bourne shell scripts
1302 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1305 if test -f "$xxx"; then
1308 : Build up a list and do a single loop so we can 'break' out.
1309 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1310 for xxx in sh bash ksh pdksh ash; do
1312 try="$try ${p}/${xxx}"
1316 if test -f "$xxx"; then
1319 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1322 elif test -f "$xxx.exe"; then
1333 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1335 Usually it's in /bin/sh. How did you even get this far?
1336 Please contact me (Perl Maintainers) at perlbug@perl.org and
1337 we'll try to straighten this all out.
1343 : see if sh knows # comments
1344 if `$sh -c '#' >/dev/null 2>&1`; then
1348 test -f $xcat$_exe || xcat=/usr/bin/cat
1349 if test ! -f $xcat$_exe; then
1350 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1351 if test -f $p/cat$_exe; then
1356 if test ! -f $xcat$_exe; then
1357 echo "Can't find cat anywhere!"
1361 echo "#!$xcat" >sharp
1365 if test -s today; then
1368 echo "#! $xcat" > sharp
1372 if test -s today; then
1380 echo "Your $sh doesn't grok # comments--I will strip them later on."
1383 echo "exec grep -v '^[ ]*#'" >spitshell
1385 $eunicefix spitshell
1386 spitshell=`pwd`/spitshell
1388 echo "I presume that if # doesn't work, #! won't work either!"
1393 : figure out how to guarantee sh startup
1395 '') startsh=${sharpbang}${sh} ;;
1407 : echo "Yup, it does."
1409 echo "Hmm... '$startsh' does not guarantee sh startup..."
1410 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1415 : Save command line options in file UU/cmdline.opt for later use in
1416 : generating config.sh.
1417 cat > cmdline.opt <<EOSH
1418 # Configure command line arguments.
1427 cat >>cmdline.opt <<EOSH
1428 config_arg$argn='$arg'
1430 # Extreme backslashitis: replace each ' by '"'"'
1431 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1434 arg_exp=`cat cmdl.opt`
1435 args_exp="$args_exp$args_sep'$arg_exp'"
1436 argn=`expr $argn + 1`
1439 # args_exp is good for restarting self: eval "set X $args_exp"; shift; $0 "$@"
1440 # used by ./hints/os2.sh
1443 : produce awk script to parse command line options
1444 cat >options.awk <<'EOF'
1446 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1448 len = length(optstr);
1449 for (i = 1; i <= len; i++) {
1450 c = substr(optstr, i, 1);
1451 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1462 if (substr(str, 1, 1) != "-") {
1463 printf("'%s'\n", str);
1467 for (i = 2; i <= len; i++) {
1468 c = substr(str, i, 1);
1470 printf("-%s\n", substr(str, i));
1476 printf("'%s'\n", substr(str, i + 1));
1489 : process the command line options
1490 set X `for arg in "$@"; do echo "X$arg"; done |
1491 sed -e s/X// | awk -f options.awk`
1496 : set up default values
1506 rm -f optdef.sh posthint.sh
1507 cat >optdef.sh <<EOS
1513 while test $# -gt 0; do
1515 -d) shift; fastread=yes;;
1516 -e) shift; alldone=cont;;
1520 if test -r "$1"; then
1523 echo "$me: cannot read config file $1." >&2
1528 -h) shift; error=true;;
1529 -r) shift; reuseval=true;;
1530 -s) shift; silent=true; realsilent=true;;
1531 -E) shift; alldone=exit;;
1532 -K) shift; knowitall=true;;
1533 -O) shift; override=true;;
1534 -S) shift; silent=true; extractsh=true;;
1539 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1540 echo "$me: ignoring -D $1" >&2
1543 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1544 *) echo "$1='define'" >> optdef.sh;;
1551 *=) echo "$1" >> optdef.sh;;
1553 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1554 echo "$me: ignoring -U $1" >&2
1556 *) echo "$1='undef'" >> optdef.sh;;
1567 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1571 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1572 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1578 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1579 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1580 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1581 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1582 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1583 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1589 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1591 echo "$yyy=''" >> posthint.sh ;;
1596 echo "$yyy='$zzz'" >> posthint.sh ;;
1598 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1600 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1605 echo "$yyy=$zzz" >> posthint.sh ;;
1606 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1610 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1613 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1621 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1622 [-U symbol] [-U symbol=] [-A command:symbol...]
1623 -d : use defaults for all answers.
1624 -e : go on without questioning past the production of config.sh.
1625 -f : specify an alternate default configuration file.
1626 -h : print this help message and exit (with an error status).
1627 -r : reuse C symbols value if possible (skips costly nm extraction).
1628 -s : silent mode, only echoes questions and essential information.
1629 -D : define symbol to have some value:
1630 -D symbol symbol gets the value 'define'
1631 -D symbol=value symbol gets the value 'value'
1632 -E : stop at the end of questions, after having produced config.sh.
1633 -K : do not use unless you know what you are doing.
1634 -O : let -D and -U override definitions from loaded configuration file.
1635 -S : perform variable substitutions on all .SH files (can mix with -f)
1636 -U : undefine symbol:
1637 -U symbol symbol gets the value 'undef'
1638 -U symbol= symbol gets completely empty
1639 -A : manipulate symbol after the platform specific hints have been applied:
1640 -A symbol=value append " "value to symbol
1641 -A append:symbol=value append value to symbol
1642 -A define:symbol=value define symbol to have value
1643 -A clear:symbol define symbol to be ''
1644 -A define:symbol define symbol to be 'define'
1645 -A eval:symbol=value define symbol to be eval of value
1646 -A prepend:symbol=value prepend value to symbol
1647 -A undef:symbol define symbol to be 'undef'
1648 -A undef:symbol= define symbol to be ''
1649 -V : print version number and exit (with a zero status).
1656 case "$fastread$alldone" in
1659 case "$extractsh" in
1662 if test ! -t 0; then
1663 echo "Say 'sh Configure', not 'sh <Configure'"
1673 true) exec 1>/dev/null;;
1676 : run the defines and the undefines, if any, but leave the file out there...
1679 : create the posthint manipulation script and leave the file out there...
1684 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1685 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1686 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1687 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1688 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1691 : Some greps do not return status, grrr.
1692 echo "grimblepritz" >grimble
1693 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1695 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1701 : the following should work in any shell
1705 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1706 cat >contains <<'EOSS'
1707 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1712 : Find the path to the source tree
1715 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1719 *) src=`cd ../$src && pwd` ;;
1732 if test -f $rsrc/Configure && \
1733 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1735 : found it, so we are ok.
1738 for src in . .. ../.. ../../.. ../../../..; do
1739 if test -f ../$src/Configure && \
1740 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1751 Sorry, I can't seem to locate the source dir for $package. Please start
1752 Configure with an explicit path -- i.e. /some/path/Configure.
1760 echo "Sources for $package found in \"$src\"." >&4
1764 : script used to extract .SH files with variable substitutions
1765 cat >extract <<'EOS'
1767 echo "Doing variable substitutions on .SH files..."
1768 if test -f MANIFEST; then
1769 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1771 echo "(Looking for .SH files under the source directory.)"
1772 set x `(cd "$src"; find . -name "*.SH" -print)`
1776 0) set x `(cd "$src"; echo *.SH)`; shift;;
1778 if test ! -f "$src/$1"; then
1784 while test $name; do
1785 if test ! -d "$name"; then
1786 create="$name $create";
1787 name=`echo $name | sed -e "s|^[^/]*$||"`;
1788 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1793 for file in $create; do
1802 dir=`expr X$file : 'X\(.*\)/'`
1803 file=`expr X$file : 'X.*/\(.*\)'`
1804 (cd "$dir" && . ./$file)
1814 dir=`expr X$file : 'X\(.*\)/'`
1815 file=`expr X$file : 'X.*/\(.*\)'`
1816 (set x $dir; shift; eval $mkdir_p)
1817 sh <"$src/$dir/$file"
1826 if test -f "$src/config_h.SH"; then
1827 if test ! -f config.h; then
1828 : oops, they left it out of MANIFEST, probably, so do it anyway.
1829 . "$src/config_h.SH"
1834 : extract files and exit if asked to do so
1835 case "$extractsh" in
1837 case "$realsilent" in
1841 case "$config_sh" in
1842 '') config_sh='config.sh';;
1845 echo "Fetching answers from $config_sh..."
1848 test "$override" && . ./optdef.sh
1852 echo "Extraction done."
1857 : Eunice requires " " instead of "", can you believe it
1860 echo "Beginning of configuration questions for $package."
1862 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1864 : first determine how to suppress newline on echo command
1866 echo "Checking echo to see how to suppress newlines..."
1867 (echo "hi there\c" ; echo " ") >.echotmp
1868 if $contains c .echotmp >/dev/null 2>&1 ; then
1879 echo $n "The star should be here-->$c"
1883 : Now test for existence of everything in MANIFEST
1885 if test -f "$rsrc/MANIFEST"; then
1886 echo "First let's make sure your kit is complete. Checking..." >&4
1887 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | (split -l 50 2>/dev/null || split -50)
1890 for filelist in x??; do
1891 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` >/dev/null 2>>"$tmppwd/missing")
1893 if test -s missing; then
1897 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1899 You have the option of continuing the configuration process, despite the
1900 distinct possibility that your kit is damaged, by typing 'y'es. If you
1901 do, don't blame me if something goes wrong. I advise you to type 'n'o
1902 and contact the author (perlbug@perl.org).
1905 echo $n "Continue? [n] $c" >&4
1909 echo "Continuing..." >&4
1913 echo "ABORTING..." >&4
1918 echo "Looks good..."
1921 echo "There is no MANIFEST file. I hope your kit is complete !"
1926 : Find the appropriate value for a newline for tr
1927 if test -n "$DJGPP"; then
1930 if test X"$trnl" = X; then
1931 case "`echo foo|tr '\n' x 2>/dev/null`" in
1935 if test X"$trnl" = X; then
1936 case "`echo foo|tr '\012' x 2>/dev/null`" in
1937 foox) trnl='\012' ;;
1940 if test X"$trnl" = X; then
1941 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
1942 fooxy) trnl='\n\r' ;;
1945 if test X"$trnl" = X; then
1948 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1954 : compute the number of columns on the terminal for proper question formatting
1959 : set up the echo used in my read
1960 myecho="case \"\$xxxm\" in
1961 '') echo $n \"\$rp $c\" >&4;;
1963 '') echo $n \"[\$xxxm] $c\";;
1965 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1967 echo $n \"[\$xxxm] $c\" >&4
1969 echo $n \"\$rp [\$xxxm] $c\" >&4
1975 : now set up to do reads with possible shell escape and default assignment
1981 case "\$fastread" in
1982 yes) case "\$dflt" in
1985 case "\$silent-\$rp" in
1990 *) case "\$silent" in
1991 true) case "\$rp" in
1996 while expr "X\$ans" : "X!" >/dev/null; do
2000 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2008 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2017 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2022 echo "(OK, I'll run with -d after this question.)" >&4
2025 echo "*** Sorry, \$1 not supported yet." >&4
2035 echo "*** Substitution done -- please confirm."
2037 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2042 echo "*** Error -- try again."
2049 case "\$ans\$xxxm\$nostick" in
2061 : create .config dir to save info across Configure sessions
2062 test -d ../.config || mkdir ../.config
2063 cat >../.config/README <<EOF
2064 This directory created by Configure to save information that should
2065 persist across sessions for $package.
2067 You may safely delete it if you wish.
2070 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2072 $define|true|[yY]*) ;;
2073 *) case "$xversion" in
2076 *** WHOA THERE!!! ***
2078 This is an UNSTABLE DEVELOPMENT release.
2079 The version of this $package distribution is $xversion, that is, odd,
2080 (as opposed to even) and that signifies a development release.
2081 If you want a maintenance release, you want an even-numbered version.
2083 Do ***NOT*** install this into production use.
2084 Data corruption and crashes are possible.
2086 It is most seriously suggested that you do not continue any further
2087 unless you want to help in developing and debugging Perl.
2089 If you *still* want to build perl, you can answer 'y' now,
2090 or pass -Dusedevel to Configure.
2093 rp='Do you really want to continue?'
2097 [yY]) echo >&4 "Okay, continuing."
2098 usedevel="$define" ;;
2099 *) echo >&4 "Okay, bye."
2109 case "$versiononly" in
2110 '') versiononly="$define" ;;
2112 case "$installusrbinperl" in
2113 '') installusrbinperl="$undef" ;;
2118 : general instructions
2121 user=`(logname) 2>/dev/null`
2123 '') user=`whoami 2>&1`;;
2125 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2128 rp='Would you like to see the instructions?'
2139 This installation shell script will examine your system and ask you questions
2140 to determine how the perl5 package should be installed. If you get
2141 stuck on a question, you may use a ! shell escape to start a subshell or
2142 execute a command. Many of the questions will have default answers in square
2143 brackets; typing carriage return will give you the default.
2145 On some of the questions which ask for file or directory names you are allowed
2146 to use the ~name construct to specify the login directory belonging to "name",
2147 even if you don't have a shell which knows about that. Questions where this is
2148 allowed will be marked "(~name ok)".
2152 dflt='Type carriage return to continue'
2156 The prompter used in this script allows you to use shell variables and
2157 backticks in your answers. You may use $1, $2, etc... to refer to the words
2158 in the default answer, as if the default line was a set of arguments given to a
2159 script shell. This means you may also use $* to repeat the whole default line,
2160 so you do not have to re-type everything to add something to the default.
2162 Everytime there is a substitution, you will have to confirm. If there is an
2163 error (e.g. an unmatched backtick), the default answer will remain unchanged
2164 and you will be prompted again.
2166 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2167 the questions and use the computed defaults (or the previous answers if there
2168 was already a config.sh file). Type 'Configure -h' for a list of options.
2169 You may also start interactively and then answer '& -d' at any prompt to turn
2170 on the non-interactive behaviour for the remainder of the execution.
2176 Much effort has been expended to ensure that this shell script will run on any
2177 Unix system. If despite that it blows up on yours, your best bet is to edit
2178 Configure and run it again. If you can't run Configure for some reason,
2179 you'll have to generate a config.sh file by hand. Whatever problems you
2180 have, let me (perlbug@perl.org) know how I blew it.
2182 This installation script affects things in two ways:
2184 1) it may do direct variable substitutions on some of the files included
2186 2) it builds a config.h file for inclusion in C programs. You may edit
2187 any of these files as the need arises after running this script.
2189 If you make a mistake on a question, there is no easy way to back up to it
2190 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2191 files. Configure will offer to let you do this before it runs the SH files.
2194 dflt='Type carriage return to continue'
2196 case "$firsttime" in
2197 true) echo $user >>../.config/instruct;;
2201 : find out where common programs are
2203 echo "Locating common programs..." >&4
2216 if test -d \$dir/\$thing; then
2222 for thisthing in \$dir/\$thing; do
2223 : just loop through to pick last item
2225 if test -f \$thisthing; then
2228 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2231 elif test -f \$dir/\$thing.exe; then
2232 if test -n "$DJGPP"; then
2233 echo \$dir/\$thing.exe
2234 elif test "$eunicefix" != ":"; then
2235 : on Eunice apparently
2289 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2290 pth="$pth /lib /usr/lib"
2291 for file in $loclist; do
2295 if test -f "$xxx"; then
2298 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2299 xxx=`./loc $file $file $pth`
2302 '') xxx=`./loc $file $file $pth`;;
2303 *) xxx=`./loc $xxx $xxx $pth`;;
2305 eval $file=$xxx$_exe
2309 echo $file is in $xxx.
2312 echo $file is in $xxx.
2315 echo "I don't know where '$file' is, and my life depends on it." >&4
2316 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2322 echo "Don't worry if any of the following aren't found..."
2324 for file in $trylist; do
2328 if test -f "$xxx"; then
2331 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2332 xxx=`./loc $file $file $pth`
2335 '') xxx=`./loc $file $file $pth`;;
2336 *) xxx=`./loc $xxx $xxx $pth`;;
2338 eval $file=$xxx$_exe
2342 echo $file is in $xxx.
2345 echo $file is in $xxx.
2348 echo "I don't see $file out there, $say."
2355 echo "Substituting grep for egrep."
2362 echo "Substituting cp for ln."
2371 echo "I can't find make or gmake, and my life depends on it." >&4
2372 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2380 *) # We can't have osname yet.
2381 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2382 # Assume that gmake, if found, is definitely GNU make
2383 # and prefer it over the system make.
2384 echo "Substituting gmake for make."
2392 echo "Hopefully test is built into your sh."
2395 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2396 echo "Using the test built into your sh."
2404 echo "Hopefully echo is built into your sh."
2409 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2410 $echo $n "hi there$c" >foo1
2411 echo $n "hi there$c" >foo2
2412 if cmp foo1 foo2 >/dev/null 2>&1; then
2413 echo "They are compatible. In fact, they may be identical."
2420 They are not compatible! You are probably running ksh on a non-USG system.
2421 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2422 have echo built in and we may have to run some Bourne shell scripts. That
2423 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2426 $echo $n "The star should be here-->$c"
2436 cat <<'EOSC' >>trygcc
2441 int main(int argc, char *argv[]) {
2445 if $cc -o try $ccflags $ldflags try.c; then
2448 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2454 case "`$cc -v -c try.c 2>&1`" in
2457 if $test X"$trygcc" = Xyes; then
2458 if gcc -o try -c try.c; then
2460 echo "You seem to have a working gcc, though." >&4
2461 rp="Would you like to use it?"
2463 if $test -f myread; then
2466 if $test -f UU/myread; then
2469 echo "Cannot find myread, sorry. Aborting." >&2
2474 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2475 if $test -f usethreads.cbu; then
2478 *** However, any setting of the C compiler flags (e.g. for thread support)
2479 *** has been lost. It may be necessary to pass -Dcc=gcc to Configure
2480 *** (together with e.g. -Dusethreads).
2496 cat <<'EOSC' >>checkcc
2501 int main(int argc, char *argv[]) {
2505 if $cc -o try $ccflags $ldflags try.c; then
2508 if $test X"$despair" = Xyes; then
2509 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2512 You need to find a working C compiler.
2513 Either (purchase and) install the C compiler supplied by your OS vendor,
2514 or for a free C compiler try http://gcc.gnu.org/
2515 I cannot continue any further, aborting.
2524 : determine whether symbolic links are supported
2527 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2528 echo "Symbolic links are supported." >&4
2531 echo "Symbolic links are NOT supported." >&4
2536 : determine whether symbolic links are supported
2540 echo "Checking how to test for symbolic links..." >&4
2542 if $test "X$issymlink" = X; then
2544 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2545 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2547 if test $? = 0; then
2550 echo "Your builtin 'test -h' may be broken." >&4
2553 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2556 if test -f "$p/$test"; then
2565 echo "Trying external '$test -h'." >&4
2566 issymlink="$test -h"
2567 if $test ! -h sym >/dev/null 2>&1; then
2568 echo "External '$test -h' is broken, too." >&4
2576 if $test "X$issymlink" = X; then
2577 if $test -L sym 2>/dev/null; then
2578 issymlink="$test -L"
2579 echo "The builtin '$test -L' worked." >&4
2582 if $test "X$issymlink" != X; then
2583 echo "You can test for symbolic links with '$issymlink'." >&4
2585 echo "I do not know how you can test for symbolic links." >&4
2589 *) echo "No symbolic links, so not testing for their testing..." >&4
2595 case "$mksymlinks" in
2598 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2601 *) case "$lns:$issymlink" in
2602 *"ln"*" -s:"*"test -"?)
2603 echo "Creating the symbolic links..." >&4
2604 echo "(First creating the subdirectories...)" >&4
2606 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2608 test -z "$directory" && break
2612 if test ! -d t/base; then
2613 echo "Failed to create the subdirectories. Aborting." >&4
2616 echo "(Then creating the symlinks...)" >&4
2617 awk '{print $1}' $src/MANIFEST | while true; do
2619 test -z "$filename" && break
2620 if test -f $filename; then
2621 if $issymlink $filename; then
2625 if test -f $filename; then
2626 echo "$filename already exists, not symlinking."
2628 ln -s $src/$filename $filename
2632 if test ! -f t/base/lex.t; then
2633 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2638 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2647 case "$usecrosscompile" in
2649 $echo "Cross-compiling..."
2652 *-*-gcc) # A cross-compiling gcc, probably.
2653 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2655 # leave out ld, choosing it is more complex
2657 ranlib=$targetarch-ranlib
2658 $echo 'extern int foo;' > try.c
2659 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2661 if $test $# -gt 0; then
2663 incpth="`$echo $incpth|$sed 's/^ //'`"
2664 echo "Guessing incpth '$incpth'." >&4
2666 j="`$echo $i|$sed 's,/include$,/lib,'`"
2667 if $test -d $j; then
2671 libpth="`$echo $libpth|$sed 's/^ //'`"
2672 echo "Guessing libpth '$libpth'." >&4
2677 case "$targetarch" in
2678 '') echo "Targetarch not defined." >&4; croak=y ;;
2679 *) echo "Using targetarch $targetarch." >&4 ;;
2682 '') echo "Incpth not defined." >&4; croak=y ;;
2683 *) echo "Using incpth '$incpth'." >&4 ;;
2686 '') echo "Libpth not defined." >&4; croak=y ;;
2687 *) echo "Using libpth '$libpth'." >&4 ;;
2690 '') for i in $incpth; do
2691 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2693 echo "Guessing usrinc $usrinc." >&4
2698 '') echo "Usrinc not defined." >&4; croak=y ;;
2701 *) echo "Using usrinc $usrinc." >&4 ;;
2703 case "$targethost" in
2704 '') echo "Targethost not defined." >&4; croak=y ;;
2705 *) echo "Using targethost $targethost." >&4
2710 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2713 /*) run=$src/Cross/run
2714 targetmkdir=$src/Cross/mkdir
2716 from=$src/Cross/from
2718 *) pwd=`$test -f ../Configure & cd ..; pwd`
2720 targetmkdir=$pwd/Cross/mkdir
2722 from=$pwd/Cross/from
2725 case "$targetrun" in
2726 '') targetrun=ssh ;;
2731 case "$targetfrom" in
2732 '') targetfrom=scp ;;
2736 from=$from-$targetfrom
2737 case "$targetdir" in
2739 echo "Guessing targetdir $targetdir." >&4
2742 case "$targetuser" in
2744 echo "Guessing targetuser $targetuser." >&4
2747 case "$targetfrom" in
2751 case "$targetrun" in
2763 '') cwd=$targetdir ;;
2767 if $test ! -f \$exe.xok; then
2771 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2774 *) echo "Unknown targetrun '$targetrun'" >&4
2778 case "$targetmkdir" in
2780 cat >$targetmkdir <<EOF
2782 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2784 $chmod a+rx $targetmkdir
2786 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2798 $targetmkdir \`dirname \$f\`
2799 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2802 $targetmkdir $targetdir/\`dirname \$f\`
2803 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2816 $mkdir -p $targetdir/\`dirname \$f\`
2817 $cp \$f $targetdir/\$f || exit 1
2820 $targetmkdir $targetdir/\`dirname \$f\`
2821 $cp \$f $targetdir/\$f || exit 1
2828 *) echo "Unknown targetto '$targetto'" >&4
2832 case "$targetfrom" in
2839 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2844 cp) cat >$from <<EOF
2849 cp $targetdir/\$f . || exit 1
2854 *) echo "Unknown targetfrom '$targetfrom'" >&4
2858 if $test ! -f $run; then
2859 echo "Target 'run' script '$run' not found." >&4
2863 if $test ! -f $to; then
2864 echo "Target 'to' script '$to' not found." >&4
2868 if $test ! -f $from; then
2869 echo "Target 'from' script '$from' not found." >&4
2873 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2877 Using '$run' for remote execution,
2878 and '$from' and '$to'
2879 for remote file transfer.
2885 usecrosscompile='undef'
2890 : see whether [:lower:] and [:upper:] are supported character classes
2892 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2894 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2898 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
2899 # (0xd9 and 0xe2), therefore that is a nice testing point.
2900 if test "X$up" = X -o "X$low" = X; then
2901 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
2907 if test "X$up" = X -o "X$low" = X; then
2908 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
2914 if test "X$up" = X -o "X$low" = X; then
2915 case "`echo RS | od -x 2>/dev/null`" in
2917 echo "Hey, this might be EBCDIC." >&4
2918 if test "X$up" = X -o "X$low" = X; then
2919 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2920 rs) up='[A-IJ-RS-Z]'
2925 if test "X$up" = X -o "X$low" = X; then
2926 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2936 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
2938 echo "Using $up and $low to convert case." >&4
2941 echo "I don't know how to translate letters from upper to lower case." >&4
2942 echo "Your tr is not acting any way I know of." >&4
2946 : set up the translation script tr, must be called with ./tr of course
2950 '[A-Z][a-z]') exec $tr '$up' '$low';;
2951 '[a-z][A-Z]') exec $tr '$low' '$up';;
2958 : Try to determine whether config.sh was made on this system
2959 case "$config_sh" in
2961 myuname=`$uname -a 2>/dev/null`
2962 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2963 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2964 # because the A-Z/a-z are not consecutive.
2965 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2966 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2967 newmyuname="$myuname"
2969 case "$knowitall" in
2971 if test -f ../config.sh; then
2972 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2973 eval "`grep myuname= ../config.sh`"
2975 if test "X$myuname" = "X$newmyuname"; then
2983 : Get old answers from old config file if Configure was run on the
2984 : same system, otherwise use the hints.
2987 if test -f config.sh; then
2989 rp="I see a config.sh file. Shall I use it to set the defaults?"
2992 n*|N*) echo "OK, I'll ignore it."
2993 mv config.sh config.sh.old
2994 myuname="$newmyuname"
2996 *) echo "Fetching default answers from your old config.sh file..." >&4
3004 : Older versions did not always set $sh. Catch re-use of such
3014 if test ! -f config.sh; then
3017 First time through, eh? I have some defaults handy for some systems
3018 that need some extra help getting the Configure answers right:
3021 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3023 : Half the following guesses are probably wrong... If you have better
3024 : tests or hints, please send them to perlbug@perl.org
3025 : The metaconfig authors would also appreciate a copy...
3026 $test -f /irix && osname=irix
3027 $test -f /xenix && osname=sco_xenix
3028 $test -f /dynix && osname=dynix
3029 $test -f /dnix && osname=dnix
3030 $test -f /lynx.os && osname=lynxos
3031 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3032 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3033 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3034 $test -f /bin/mips && /bin/mips && osname=mips
3035 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3036 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3037 $test -d /usr/apollo/bin && osname=apollo
3038 $test -f /etc/saf/_sactab && osname=svr4
3039 $test -d /usr/include/minix && osname=minix
3040 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3041 if $test -d /MachTen -o -d /MachTen_Folder; then
3043 if $test -x /sbin/version; then
3044 osvers=`/sbin/version | $awk '{print $2}' |
3045 $sed -e 's/[A-Za-z]$//'`
3046 elif $test -x /usr/etc/version; then
3047 osvers=`/usr/etc/version | $awk '{print $2}' |
3048 $sed -e 's/[A-Za-z]$//'`
3054 $test -f /sys/posix.dll &&
3055 $test -f /usr/bin/what &&
3056 set X `/usr/bin/what /sys/posix.dll` &&
3057 $test "$3" = UWIN &&
3061 if $test -f $uname; then
3069 umips) osname=umips ;;
3072 [23]100) osname=mips ;;
3073 next*) osname=next ;;
3075 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3076 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3079 elif $test -f /etc/kconfig; then
3081 if test "$lns" = "$ln -s"; then
3083 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3085 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3092 if test -n "$DJGPP"; then
3101 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3103 # oslevel can fail with:
3104 # oslevel: Unable to acquire lock.
3105 *not\ found) osvers="$4"."$3" ;;
3106 '<3240'|'<>3240') osvers=3.2.0 ;;
3107 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3108 '=3250'|'>3250') osvers=3.2.5 ;;
3112 bsd386) osname=bsd386
3115 cygwin*) osname=cygwin
3118 *dc.osx) osname=dcosx
3124 domainos) osname=apollo
3130 dynixptx*) osname=dynixptx
3131 osvers=`echo "$4"|sed 's/^v//'`
3133 freebsd) osname=freebsd
3135 genix) osname=genix ;;
3139 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3155 netbsd*) osname=netbsd
3158 news-os) osvers="$3"
3160 4*) osname=newsos4 ;;
3164 next*) osname=next ;;
3165 nonstop-ux) osname=nonstopux ;;
3166 openbsd) osname=openbsd
3172 POSIX-BC | posix-bc ) osname=posix-bc
3175 powerux | power_ux | powermax_os | powermaxos | \
3176 powerunix | power_unix) osname=powerux
3182 solaris) osname=solaris
3184 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3191 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3195 titanos) osname=titanos
3204 ultrix) osname=ultrix
3207 osf1|mls+) case "$5" in
3210 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3213 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3216 hp*) osname=hp_osf1 ;;
3217 mips) osname=mips_osf1 ;;
3220 # UnixWare 7.1.2 is known as Open UNIX 8
3221 openunix|unixware) osname=svr5
3229 $2) case "$osname" in
3233 : svr4.x or possibly later
3243 if test -f /stand/boot ; then
3244 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3245 if test -n "$INITPROG" -a -f "$INITPROG"; then
3246 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3247 if test -n "$isesix"; then
3255 *) if test -f /etc/systemid; then
3257 set `echo $3 | $sed 's/\./ /g'` $4
3258 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3260 elif $test -f $src/hints/sco_$1_$2.sh; then
3262 elif $test -f $src/hints/sco_$1.sh; then
3267 '') : Still unknown. Probably a generic Sys V.
3276 *) case "$osname" in
3277 '') : Still unknown. Probably a generic BSD.
3285 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3286 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3287 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3290 $rm -f UU/kernel.what
3291 elif test -d c:/. -o -n "$is_os2" ; then
3298 case "$targetarch" in
3301 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3306 : Now look for a hint file osname_osvers, unless one has been
3307 : specified already.
3310 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3311 : Also try without trailing minor version numbers.
3312 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3313 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3314 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3315 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3318 *) case "$osvers" in
3321 *) if $test -f $src/hints/$file.sh ; then
3323 elif $test -f $src/hints/$xfile.sh ; then
3325 elif $test -f $src/hints/$xxfile.sh ; then
3327 elif $test -f $src/hints/$xxxfile.sh ; then
3329 elif $test -f $src/hints/$xxxxfile.sh ; then
3331 elif $test -f "$src/hints/${osname}.sh" ; then
3340 if $test -f Policy.sh ; then
3343 none) dflt="Policy" ;;
3344 *) dflt="Policy $dflt" ;;
3349 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3353 if $test -f Policy.sh ; then
3356 There's also a Policy hint file available, which should make the
3357 site-specific (policy) questions easier to answer.
3364 You may give one or more space-separated answers, or "none" if appropriate.
3365 A well-behaved OS will have no hints, so answering "none" or just "Policy"
3366 is a good thing. DO NOT give a wrong version or a wrong OS.
3370 rp="Which of these apply, if any?"
3373 for file in $tans; do
3374 if $test X$file = XPolicy -a -f Policy.sh; then
3376 $cat Policy.sh >> UU/config.sh
3377 elif $test -f $src/hints/$file.sh; then
3378 . $src/hints/$file.sh
3379 $cat $src/hints/$file.sh >> UU/config.sh
3380 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3383 : Give one chance to correct a possible typo.
3384 echo "$file.sh does not exist"
3386 rp="hint to use instead?"
3388 for file in $ans; do
3389 if $test -f "$src/hints/$file.sh"; then
3390 . $src/hints/$file.sh
3391 $cat $src/hints/$file.sh >> UU/config.sh
3392 elif $test X$ans = X -o X$ans = Xnone ; then
3395 echo "$file.sh does not exist -- ignored."
3402 : Remember our hint file for later.
3403 if $test -f "$src/hints/$file.sh" ; then
3413 echo "Fetching default answers from $config_sh..." >&4
3417 cp $config_sh config.sh 2>/dev/null
3427 test "$override" && . ./optdef.sh
3429 : Restore computed paths
3430 for file in $loclist $trylist; do
3431 eval $file="\$_$file"
3436 Configure uses the operating system name and version to set some defaults.
3437 The default value is probably right if the name rings a bell. Otherwise,
3438 since spelling matters for me, either accept the default or answer "none"
3445 ''|' '|none) dflt=none ;;
3446 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3449 *) dflt="$osname" ;;
3451 rp="Operating system name?"
3455 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3461 ''|' '|none) dflt=none ;;
3462 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3463 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3465 ''|' ') dflt=none ;;
3470 *) dflt="$osvers" ;;
3472 rp="Operating system version?"
3482 : who configured the system
3483 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3486 cf_by=`(logname) 2>/dev/null`
3489 cf_by=`(whoami) 2>/dev/null`
3491 "") cf_by=unknown ;;
3496 : set up the script used to warn in case of inconsistency
3503 echo "*** WHOA THERE!!! ***" >&4
3504 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
3505 rp=" Keep the $hint value?"
3508 y) td=$was; tu=$was;;
3512 : function used to set $1 to $val
3513 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
3515 $define$undef) . ./whoa; eval "$var=\$td";;
3516 $undef$define) . ./whoa; eval "$var=\$tu";;
3517 *) eval "$var=$val";;
3521 $define|true|[yY]*) dflt='y';;
3526 Perl can be built to use the SOCKS proxy protocol library. To do so,
3527 Configure must be run with -Dusesocks. If you use SOCKS you also need
3528 to use the PerlIO abstraction layer, this will be implicitly selected.
3530 If this doesn't make any sense to you, just accept the default '$dflt'.
3532 rp='Build Perl for SOCKS?'
3535 y|Y) val="$define" ;;
3542 $define|true|[yY]*) useperlio="$define";;
3545 case "$useperlio" in
3546 $define|true|[yY]*|'') dflt='y';;
3551 Previous version of $package used the standard IO mechanisms as
3552 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
3553 alternate IO mechanisms via the PerlIO abstraction layer, but the
3554 stdio mechanism is still available if needed. The abstraction layer
3555 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
3556 Using PerlIO with sfio may cause problems with some extension modules.
3558 If this doesn't make any sense to you, just accept the default '$dflt'.
3560 rp='Use the PerlIO abstraction layer?'
3567 echo "Ok, doing things the stdio way."
3576 case "$useperlio" in
3577 $define|true|[yY]*) ;;
3580 You are using the SOCKS proxy protocol library which means that you
3581 should also use the PerlIO layer. You may be headed for trouble.
3590 case "$usethreads" in
3591 $define|true|[yY]*) dflt='y';;
3592 *) # Catch case where user specified ithreads or 5005threads but
3593 # forgot -Dusethreads (A.D. 4/2002)
3594 case "$useithreads$use5005threads" in
3596 case "$useperlio" in
3597 "$define") dflt='y' ;;
3607 Perl can be built to take advantage of threads on some systems.
3608 To do so, Configure can be run with -Dusethreads.
3610 Note that Perl built with threading support runs slightly slower
3611 and uses more memory than plain Perl. The current implementation
3612 is believed to be stable, but it is fairly new, and so should be
3613 treated with caution.
3615 If this doesn't make any sense to you, just accept the default '$dflt'.
3617 rp='Build a threading Perl?'
3620 y|Y) val="$define" ;;
3626 case "$usethreads" in
3630 Since release 5.6, Perl has had two different threading implementations,
3631 the newer interpreter-based version (ithreads) with one interpreter per
3632 thread, and the older 5.005 version (5005threads).
3633 The 5005threads version is effectively unmaintained and will probably be
3634 removed in Perl 5.10, so there should be no need to build a Perl using it
3635 unless needed for backwards compatibility with some existing 5.005threads
3639 : Default to ithreads unless overridden on command line or with
3642 case "$use5005threads" in
3643 $define|true|[yY]*) dflt='n';;
3645 case "$useithreads" in
3646 $undef|false|[nN]*) dflt='n';;
3648 rp='Use the newer interpreter-based ithreads?'
3651 y|Y) val="$define" ;;
3656 : Now set use5005threads to the opposite value.
3657 case "$useithreads" in
3658 $define) val="$undef" ;;
3665 useithreads="$undef"
3666 use5005threads="$undef"
3670 case "$useithreads$use5005threads" in
3674 You cannot have both the ithreads and the 5.005 threads enabled
3675 at the same time. Disabling the 5.005 threads since they are
3676 much less stable than the ithreads.
3679 use5005threads="$undef"
3683 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
3686 *** To build with ithreads you must also use the PerlIO layer.
3687 *** Cannot continue, aborting.
3693 case "$d_oldpthreads" in
3694 '') : Configure tests would be welcome here. For now, assume undef.
3696 *) val="$d_oldpthreads" ;;
3702 : Look for a hint-file generated 'call-back-unit'. If the
3703 : user has specified that a threading perl is to be built,
3704 : we may need to set or change some other defaults.
3705 if $test -f usethreads.cbu; then
3706 echo "Your platform has some specific hints regarding threaded builds, using them..."
3709 case "$usethreads" in
3710 "$define"|true|[yY]*)
3712 (Your platform does not have any specific hints for threaded builds.
3713 Assuming POSIX threads, then.)
3721 Perl can be built so that multiple Perl interpreters can coexist
3722 within the same Perl executable.
3725 case "$useithreads" in
3728 This multiple interpreter support is required for interpreter-based threads.
3732 *) case "$usemultiplicity" in
3733 $define|true|[yY]*) dflt='y';;
3737 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
3738 rp='Build Perl for multiplicity?'
3741 y|Y) val="$define" ;;
3750 case "$usemorebits" in
3751 "$define"|true|[yY]*)
3752 use64bitint="$define"
3753 uselongdouble="$define"
3754 usemorebits="$define"
3756 *) usemorebits="$undef"
3760 : make some quick guesses about what we are up against
3762 $echo $n "Hmm... $c"
3772 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
3773 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
3775 echo "Looks kind of like an OSF/1 system, but we'll see..."
3777 elif test `echo abc | $tr a-z A-Z` = Abc ; then
3778 xxx=`./loc addbib blurfl $pth`
3779 if $test -f $xxx; then
3780 echo "Looks kind of like a USG system with BSD features, but we'll see..."
3784 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
3785 echo "Looks kind of like an extended USG system, but we'll see..."
3787 echo "Looks kind of like a USG system, but we'll see..."
3791 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
3792 echo "Looks kind of like a BSD system, but we'll see..."
3796 echo "Looks kind of like a Version 7 system, but we'll see..."
3799 case "$eunicefix" in
3802 There is, however, a strange, musty smell in the air that reminds me of
3803 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
3807 : it so happens the Eunice I know will not run shell scripts in Unix format
3811 echo "Congratulations. You aren't running Eunice."
3815 : Detect OS2. The p_ variable is set above in the Head.U unit.
3816 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
3817 : semicolon as a patch separator
3822 I have the feeling something is not exactly right, however...don't tell me...
3823 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
3824 (Or you may be running DOS with DJGPP.)
3829 if test -f /xenix; then
3830 echo "Actually, this looks more like a XENIX system..."
3835 echo "It's not Xenix..."
3840 if test -f /venix; then
3841 echo "Actually, this looks more like a VENIX system..."
3848 echo "Nor is it Venix..."
3851 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3852 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3859 rp="Use which C compiler?"
3863 : See if they have not cc but they do have gcc
3865 : Look for a hint-file generated 'call-back-unit'. Now that the
3866 : user has specified the compiler, we may need to set or change some
3868 if $test -f cc.cbu; then
3874 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3880 printf("%s\n", __VERSION__);
3882 printf("%s\n", "1");
3888 if $cc -o try $ccflags $ldflags try.c; then
3889 gccversion=`$run ./try`
3890 case "$gccversion" in
3891 '') echo "You are not using GNU cc." ;;
3892 *) echo "You are using GNU cc $gccversion."
3898 echo "*** WHOA THERE!!! ***" >&4
3899 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3900 case "$knowitall" in
3902 echo " You'd better start hunting for one and let me know about it." >&4
3908 case "$gccversion" in
3909 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3911 case "$gccversion" in
3912 '') gccosandvers='' ;;
3913 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
3914 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
3916 case "$gccosandvers" in
3917 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
3918 $osname$osvers) ;; # looking good
3919 $osname*) cat <<EOM >&4
3921 *** WHOA THERE!!! ***
3923 Your gcc has not been compiled for the exact release of
3924 your operating system ($gccosandvers versus $osname$osvers).
3926 In general it is a good idea to keep gcc synchronized with
3927 the operating system because otherwise serious problems
3928 may ensue when trying to compile software, like Perl.
3930 I'm trying to be optimistic here, though, and will continue.
3931 If later during the configuration and build icky compilation
3932 problems appear (headerfile conflicts being the most common
3933 manifestation), I suggest reinstalling the gcc to match
3934 your operating system release.
3938 *) gccosandvers='' ;; # failed to parse, better be silent
3946 # gcc 3.* complain about adding -Idirectories that they already know about,
3947 # so we will take those off from locincpth.
3948 case "$gccversion" in
3950 echo "main(){}">try.c
3951 for incdir in $locincpth; do
3952 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
3953 grep '^c[cp]p*[01]: warning: changing search order '`
3954 if test "X$warn" != X; then
3955 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
3961 : decide how portable to be. Allow command line overrides.
3962 case "$d_portable" in
3964 *) d_portable="$define" ;;
3967 : set up shell script to do ~ expansion
3973 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3976 if $test -f /bin/csh; then
3977 /bin/csh -f -c "glob \$1"
3982 name=\`$expr x\$1 : '..\([^/]*\)'\`
3983 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3984 if $test ! -d "\$dir"; then
3986 echo "\$me: can't locate home directory for: \$name" >&2
3991 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
4007 : now set up to get a file name
4011 cat <<'EOSC' >>getfile
4027 : getfile will accept an answer from the comma-separated list
4028 : enclosed in parentheses even if it does not meet other criteria.
4029 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
4030 fn=`echo $fn | sed 's/(.*)//'`
4036 loc_file=`expr $fn : '.*:\(.*\)'`
4037 fn=`expr $fn : '\(.*\):.*'`
4045 */*) fullpath=true;;
4054 *e*) exp_file=true;;
4057 *p*) nopath_ok=true;;
4062 *d*) type='Directory';;
4063 *l*) type='Locate';;
4068 Locate) what='File';;
4073 case "$d_portable" in
4081 while test "$type"; do
4086 true) rp="$rp (~name ok)";;
4089 if test -f UU/getfile.ok && \
4090 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
4109 value=`UU/filexp $ans`
4112 if test "$ans" != "$value"; then
4113 echo "(That expands to $value on this system.)"
4127 /*) value="$ansexp" ;;
4128 [a-zA-Z]:/*) value="$ansexp" ;;
4133 echo "I shall only accept a full path name, as in /bin/ls." >&4
4134 echo "Use a ! shell escape if you wish to check pathnames." >&4
4137 echo "Please give a full path name, starting with slash." >&4
4140 echo "Note that using ~name is ok provided it expands well." >&4
4153 for fp in $gfpth; do
4154 if test "X$fp" = X.; then
4159 if test -f "$pf"; then
4161 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
4163 echo "($value is not a plain file, but that's ok.)"
4166 if test X"$type" = X; then
4173 for fp in $gfpth; do
4174 if test "X$fp" = X.; then
4179 direxp="$fp/$ansexp"
4181 if test -d "$direxp"; then
4189 if test -d "$ansexp"; then
4190 echo "(Looking for $loc_file in directory $value.)"
4191 value="$value/$loc_file"
4192 ansexp="$ansexp/$loc_file"
4194 if test -f "$ansexp"; then
4197 case "$nopath_ok" in
4198 true) case "$value" in
4200 *) echo "Assuming $value will be in people's path."
4216 if test "$fastread" = yes; then
4221 rp="$what $value doesn't exist. Use that name anyway?"
4240 test "X$gfpthkeep" != Xy && gfpth=""
4243 : What should the include directory be ?
4245 $echo $n "Hmm... $c"
4249 if $test -f /bin/mips && /bin/mips; then
4250 echo "Looks like a MIPS system..."
4251 $cat >usr.c <<'EOCP'
4252 #ifdef SYSTYPE_BSD43
4256 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4257 dflt='/bsd43/usr/include'
4261 mips_type='System V'
4263 $rm -f usr.c usr.out
4264 echo "and you're compiling with the $mips_type compiler and libraries."
4268 echo "Doesn't look like a MIPS system."
4278 case "$xxx_prompt" in
4281 rp='Where are the include files you want to use?'
4289 : see how we invoke the C preprocessor
4291 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4292 cat <<'EOT' >testcpp.c
4298 if test ! -f cppstdin; then
4299 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4300 # AIX cc -E doesn't show the absolute headerfile
4301 # locations but we'll cheat by using the -M flag.
4302 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
4304 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4307 echo "Keeping your $hint cppstdin wrapper."
4310 wrapper=`pwd`/cppstdin
4314 if $test "X$cppstdin" != "X" && \
4315 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4316 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4318 echo "You used to use $cppstdin $cppminus so we'll use that again."
4320 '') echo "But let's see if we can live without a wrapper..." ;;
4322 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4323 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4325 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4328 echo "(However, $cpprun $cpplast does not work, let's see...)"
4336 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4343 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4344 $cc -E <testcpp.c >testcpp.out 2>&1; \
4345 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4346 echo "Yup, it does."
4349 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4350 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4351 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4352 echo "Yup, it does."
4355 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4356 $cc -P <testcpp.c >testcpp.out 2>&1; \
4357 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4358 echo "Yipee, that works!"
4361 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4362 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4363 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4364 echo "At long last!"
4367 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4368 $cpp <testcpp.c >testcpp.out 2>&1; \
4369 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4373 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4374 $cpp - <testcpp.c >testcpp.out 2>&1; \
4375 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4376 echo "Hooray, it works! I was beginning to wonder."
4379 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4380 $wrapper <testcpp.c >testcpp.out 2>&1; \
4381 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4387 rp="No dice. I can't find a C preprocessor. Name one:"
4391 $x_cpp <testcpp.c >testcpp.out 2>&1
4392 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4393 echo "OK, that will do." >&4
4395 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4410 echo "Perhaps can we force $cc -E using a wrapper..."
4411 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4412 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4418 echo "Nope, we'll have to live without it..."
4432 "$wrapper"|'cppstdin') ;;
4433 *) $rm -f $wrapper;;
4435 $rm -f testcpp.c testcpp.out
4437 : Set private lib path
4440 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4445 '') dlist="$loclibpth $plibpth $glibpth";;
4446 *) dlist="$libpth";;
4449 : Now check and see which directories actually exist, avoiding duplicates
4453 if $test -d $xxx; then
4456 *) libpth="$libpth $xxx";;
4462 Some systems have incompatible or broken versions of libraries. Among
4463 the directories listed in the question below, please remove any you
4464 know not to be holding relevant libraries, and add any that are needed.
4465 Say "none" for none.
4476 rp="Directories to use for library searches?"
4483 : compute shared library extension
4486 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4496 On some systems, shared libraries may be available. Answer 'none' if
4497 you want to suppress searching of shared libraries for the remainder
4498 of this configuration.
4501 rp='What is the file extension used for shared libraries?'
4505 : Define several unixisms.
4506 : Hints files or command line option can be used to override them.
4507 : The convoluted testing is in case hints files set either the old
4510 '') case "$exe_ext" in
4512 *) _exe="$exe_ext" ;;
4517 '') case "$lib_ext" in
4524 '') case "$obj_ext" in
4531 '') case "$path_sep" in
4542 : Which makefile gets called first. This is used by make depend.
4543 case "$firstmakefile" in
4544 '') firstmakefile='makefile';;
4548 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4551 case "$uselongdouble" in
4552 $define|true|[yY]*) dflt='y';;
4557 Perl can be built to take advantage of long doubles which
4558 (if available) may give more accuracy and range for floating point numbers.
4560 If this doesn't make any sense to you, just accept the default '$dflt'.
4562 rp='Try to use long doubles if available?'
4565 y|Y) val="$define" ;;
4571 case "$uselongdouble" in
4572 true|[yY]*) uselongdouble="$define" ;;
4575 : Look for a hint-file generated 'call-back-unit'. If the
4576 : user has specified that long doubles should be used,
4577 : we may need to set or change some other defaults.
4578 if $test -f uselongdouble.cbu; then
4579 echo "Your platform has some specific hints regarding long doubles, using them..."
4580 . ./uselongdouble.cbu
4582 case "$uselongdouble" in
4585 (Your platform does not have any specific hints for long doubles.)
4591 : Looking for optional libraries
4593 echo "Checking for optional libraries..." >&4
4598 case "$libswanted" in
4599 '') libswanted='c_s';;
4602 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4608 for thisdir in $libpth $xlibpth; do
4609 test -d $thisdir && libspath="$libspath $thisdir"
4611 for thislib in $libswanted; do
4612 for thisdir in $libspath; do
4614 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4615 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4616 $test -f "$xxx" && eval $libscheck
4617 $test -f "$xxx" && libstyle=shared
4619 if test ! -f "$xxx"; then
4620 xxx=$thisdir/lib$thislib.$so
4621 $test -f "$xxx" && eval $libscheck
4622 $test -f "$xxx" && libstyle=shared
4624 if test ! -f "$xxx"; then
4625 xxx=$thisdir/lib$thislib$_a
4626 $test -f "$xxx" && eval $libscheck
4627 $test -f "$xxx" && libstyle=static
4629 if test ! -f "$xxx"; then
4630 xxx=$thisdir/$thislib$_a
4631 $test -f "$xxx" && eval $libscheck
4632 $test -f "$xxx" && libstyle=static
4634 if test ! -f "$xxx"; then
4635 xxx=$thisdir/lib${thislib}_s$_a
4636 $test -f "$xxx" && eval $libscheck
4637 $test -f "$xxx" && libstyle=static
4638 $test -f "$xxx" && thislib=${thislib}_s
4640 if test ! -f "$xxx"; then
4641 xxx=$thisdir/Slib$thislib$_a
4642 $test -f "$xxx" && eval $libscheck
4643 $test -f "$xxx" && libstyle=static
4645 if $test -f "$xxx"; then
4647 shared) echo "Found -l$thislib (shared)." ;;
4648 static) echo "Found -l$thislib." ;;
4649 *) echo "Found -l$thislib ($libstyle)." ;;
4653 *) dflt="$dflt -l$thislib"
4654 libsfound="$libsfound $xxx"
4656 libsfiles="$libsfiles $yyy"
4657 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4658 case " $libsdirs " in
4660 *) libsdirs="$libsdirs $yyy" ;;
4667 if $test ! -f "$xxx"; then
4668 echo "No -l$thislib."
4679 ' '|'') dflt='none';;
4684 In order to compile $package on your machine, a number of libraries
4685 are usually needed. Include any other special libraries here as well.
4686 Say "none" for none. The default list is almost always right.
4690 rp="What libraries to use?"
4697 : determine optimization, if desired, or use for debug flag also
4699 ' '|$undef) dflt='none';;
4701 *) dflt="$optimize";;
4705 By default, $package compiles with the -O flag to use the optimizer.
4706 Alternately, you might want to use the symbolic debugger, which uses
4707 the -g flag (on traditional Unix systems). Either flag can be
4708 specified here. To use neither flag, specify the word "none".
4711 rp="What optimizer/debugger flag should be used?"
4715 'none') optimize=" ";;
4719 : We will not override a previous value, but we might want to
4720 : augment a hint file
4722 default|recommended)
4723 case "$gccversion" in
4724 1*) dflt='-fpcc-struct-return' ;;
4727 *-g*) dflt="$dflt -DDEBUGGING";;
4729 case "$gccversion" in
4730 2*) if test -d /etc/conf/kconfig.d &&
4731 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4733 # Interactive Systems (ISC) POSIX mode.
4738 case "$gccversion" in
4742 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
4743 echo 'int main(void) { return 0; }' > gcctest.c
4744 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
4745 echo "Yes, it does." 2>&1
4748 echo "Leaving current flags $ccflags alone." 2>&1
4750 *) dflt="$dflt -fno-strict-aliasing" ;;
4753 echo "Nope, it doesn't, but that's ok." 2>&1
4757 # For gcc, adding -pipe speeds up compilations for some, but apparently
4758 # some assemblers can't read from stdin. (It also slows down compilations
4759 # in other cases, but those are apparently rarer these days.) AD 5/2004.
4760 case "$gccversion" in
4762 echo "Checking if your compiler accepts -pipe" 2>&1
4763 echo 'int main(void) { return 0; }' > gcctest.c
4764 if $cc -pipe -o gcctest gcctest.c; then
4765 echo "Yes, it does." 2>&1
4768 echo "Leaving current flags $ccflags alone." 2>&1
4770 *) dflt="$dflt -pipe" ;;
4773 echo "Nope, it doesn't, but that's ok." 2>&1
4776 echo "Checking if your compiler accepts -Wdeclaration-after-statement" 2>&1
4777 echo 'int main(void) { return 0; }' > gcctest.c
4778 if $cc -Wdeclaration-after-statement -o gcctest gcctest.c; then
4779 echo "Yes, it does." 2>&1
4781 *-Wdeclaration-after-statement*)
4782 echo "Leaving current flags $ccflags alone." 2>&1
4784 *) dflt="$dflt -Wdeclaration-after-statement" ;;
4787 echo "Nope, it doesn't, but that's ok." 2>&1
4794 case "$mips_type" in
4795 *BSD*|'') inclwanted="$locincpth $usrinc";;
4796 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4798 for thisincl in $inclwanted; do
4799 if $test -d $thisincl; then
4800 if $test x$thisincl != x$usrinc; then
4802 *" -I$thisincl "*);;
4803 *) dflt="$dflt -I$thisincl ";;
4809 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4811 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4819 *) dflt="$dflt -D$2";;
4823 set signal.h LANGUAGE_C; eval $inctest
4827 ccflags="$ccflags -DSOCKS"
4832 default|recommended) dflt="$ccflags $dflt" ;;
4833 *) dflt="$ccflags";;
4842 Your C compiler may want other flags. For this question you should include
4843 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4844 but you should NOT include libraries or ld flags like -lwhatever. If you
4845 want $package to honor its debug switch, you should include -DDEBUGGING here.
4846 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4848 To use no flags, specify the word "none".
4854 rp="Any additional cc flags?"
4861 : the following weeds options from ccflags that are of no interest to cpp
4863 '') cppflags="$ccflags" ;;
4864 *) cppflags="$cppflags $ccflags" ;;
4866 case "$gccversion" in
4867 1*) cppflags="$cppflags -D__GNUC__"
4869 case "$mips_type" in
4871 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4877 echo "Let me guess what the preprocessor flags are..." >&4
4891 *) ftry="$previous $flag";;
4893 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4894 >cpp1.out 2>/dev/null && \
4895 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4896 >cpp2.out 2>/dev/null && \
4897 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4898 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4900 cppflags="$cppflags $ftry"
4910 *-*) echo "They appear to be: $cppflags";;
4912 $rm -f cpp.c cpp?.out
4916 : flags used in final linking phase
4918 '') if ./venix; then
4924 *-posix*) dflt="$dflt -posix" ;;
4927 *) dflt="$ldflags";;
4930 : Try to guess additional flags to pick up local libraries.
4931 for thislibdir in $libpth; do
4932 case " $loclibpth " in
4935 *"-L$thislibdir "*) ;;
4936 *) dflt="$dflt -L$thislibdir" ;;
4948 Your C linker may need flags. For this question you should
4949 include -L/whatever and any other flags used by the C linker, but you
4950 should NOT include libraries like -lwhatever.
4952 Make sure you include the appropriate -L/path flags if your C linker
4953 does not normally search all of the directories you specified above,
4956 To use no flags, specify the word "none".
4960 rp="Any additional ld flags (NOT including libraries)?"
4966 rmlist="$rmlist pdp11"
4970 echo "Checking your choice of C compiler and flags for coherency..." >&4
4971 $cat > try.c <<'EOF'
4973 int main() { printf("Ok\n"); return(0); }
4975 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
4977 $cat >try.msg <<'EOM'
4978 I've tried to compile and run the following simple program:
4981 $cat try.c >> try.msg
4983 $cat >> try.msg <<EOM
4990 and I got the following output:
4994 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
4995 if $sh -c "$run ./try" >>try.msg 2>&1; then
4999 *) echo 'The program compiled OK, but produced no output.' >> try.msg
5002 cat >> try.msg <<'EOQS'
5003 If $libs contains -lsfio, and sfio is mis-configured, then it
5004 sometimes (apparently) runs and exits with a 0 status, but with no
5005 output! It may have to do with sfio's use of _exit vs. exit.
5008 rp="You have a big problem. Shall I abort Configure"
5015 echo "The program compiled OK, but exited with status $?." >>try.msg
5016 rp="You have a problem. Shall I abort Configure"
5020 echo "I can't compile the test program." >>try.msg
5021 rp="You have a BIG problem. Shall I abort Configure"
5027 case "$knowitall" in
5029 echo "(The supplied flags or libraries might be incorrect.)"
5037 *) echo "Ok. Stopping Configure." >&4
5042 n) echo "OK, that should do.";;
5044 $rm -f try try.* core
5046 : define a shorthand compile call
5050 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5051 : define a shorthand compile call for compilations that should be ok.
5055 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5057 : determine filename position in cpp output
5059 echo "Computing filename position in cpp output for #include directives..." >&4
5061 vos) testaccess=-e ;;
5064 echo '#include <stdio.h>' > foo.c
5067 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5068 $grep '^[ ]*#.*stdio\.h' | \
5069 while read cline; do
5072 while $test \$# -gt 0; do
5073 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5078 pos=\`expr \$pos + 1\`
5090 *) pos="${fieldn}th";;
5092 echo "Your cpp writes the filename in the $pos field of the line."
5095 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5096 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5099 : locate header file
5104 for usrincdir in $usrinc
5106 if test -f \$usrincdir/\$wanted; then
5107 echo "\$usrincdir/\$wanted"
5111 awkprg='{ print \$$fieldn }'
5112 echo "#include <\$wanted>" > foo\$\$.c
5113 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5114 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5115 while read cline; do
5116 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5118 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5119 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5124 # status = 0: grep returned 0 lines, case statement not executed
5125 # status = 1: headerfile found
5126 # status = 2: while loop executed, no headerfile found
5130 if test \$status -eq 1; then
5137 : define an alternate in-header-list? function
5138 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5139 cont=true; xxf="echo \"<\$1> found.\" >&4";
5140 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5141 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5143 case $# in 4) instead=instead;; *) instead="at last";; esac;
5144 while $test "$cont"; do
5146 var=$2; eval "was=\$$2";
5147 if $test "$xxx" && $test -r "$xxx";
5149 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5152 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5153 set $yyy; shift; shift; yyy=$@;
5154 case $# in 0) cont="";;
5155 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5156 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5157 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5158 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5162 do set $yyy; var=$2; eval "was=\$$2";
5163 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5164 set $yyy; shift; shift; yyy=$@;
5167 : see if stdlib is available
5168 set stdlib.h i_stdlib
5171 : check for lengths of integral types
5175 echo "Checking to see how big your integers are..." >&4
5184 printf("intsize=%d;\n", (int)sizeof(int));
5185 printf("longsize=%d;\n", (int)sizeof(long));
5186 printf("shortsize=%d;\n", (int)sizeof(short));
5191 if eval $compile_ok && $run ./try > /dev/null; then
5193 echo "Your integers are $intsize bytes long."
5194 echo "Your long integers are $longsize bytes long."
5195 echo "Your short integers are $shortsize bytes long."
5199 Help! I can't compile and run the intsize test program: please enlighten me!
5200 (This is probably a misconfiguration in your system or libraries, and
5201 you really ought to fix it. Still, I'll try anyway.)
5205 rp="What is the size of an integer (in bytes)?"
5209 rp="What is the size of a long integer (in bytes)?"
5213 rp="What is the size of a short integer (in bytes)?"
5221 : check for long long
5223 echo "Checking to see if you have long long..." >&4
5224 echo 'int main() { long long x = 7; return 0; }' > try.c
5226 if eval $compile; then
5228 echo "You have long long."
5231 echo "You do not have long long."
5237 : check for length of long long
5238 case "${d_longlong}${longlongsize}" in
5241 echo "Checking to see how big your long longs are..." >&4
5242 $cat >try.c <<'EOCP'
5246 printf("%d\n", (int)sizeof(long long));
5251 if eval $compile_ok; then
5252 longlongsize=`$run ./try`
5253 echo "Your long longs are $longlongsize bytes long."
5257 echo "(I can't seem to compile the test program. Guessing...)"
5258 rp="What is the size of a long long (in bytes)?"
5262 if $test "X$longsize" = "X$longlongsize"; then
5263 echo "(That isn't any different from an ordinary long.)"
5269 : see if inttypes.h is available
5270 : we want a real compile instead of Inhdr because some systems
5271 : have an inttypes.h which includes non-existent headers
5274 #include <inttypes.h>
5276 static int32_t foo32 = 0x12345678;
5280 if eval $compile; then
5281 echo "<inttypes.h> found." >&4
5284 echo "<inttypes.h> NOT found." >&4
5293 echo "Checking to see if you have int64_t..." >&4
5295 #include <sys/types.h>
5296 #$i_inttypes I_INTTYPES
5298 #include <inttypes.h>
5300 int main() { int64_t x = 7; }
5303 if eval $compile; then
5305 echo "You have int64_t."
5308 echo "You do not have int64_t."
5316 echo "Checking which 64-bit integer type we could use..." >&4
5322 val='"unsigned int"'
5327 *) case "$longsize" in
5331 val='"unsigned long"'
5336 *) case "$d_longlong:$longlongsize" in
5341 val='"unsigned long long"'
5346 *) case "$d_int64_t" in
5365 '') echo "Alas, no 64-bit integer types in sight." >&4
5368 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5374 case "$uselonglong" in
5375 "$define"|true|[yY]*)
5378 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5380 use64bitint="$define"
5383 case "$use64bits" in
5384 "$define"|true|[yY]*)
5387 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5389 use64bitint="$define"
5392 case "$use64bitints" in
5393 "$define"|true|[yY]*)
5396 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5398 use64bitint="$define"
5401 case "$use64bitsint" in
5402 "$define"|true|[yY]*)
5405 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5407 use64bitint="$define"
5410 case "$uselonglongs" in
5411 "$define"|true|[yY]*)
5414 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5416 use64bitint="$define"
5419 case "$use64bitsall" in
5420 "$define"|true|[yY]*)
5423 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5425 use64bitall="$define"
5430 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5432 case "$use64bitall" in
5433 "$define"|true|[yY]*) use64bitint="$define" ;;
5439 You have natively 64-bit long integers.
5443 *) case "$use64bitint" in
5444 "$define"|true|[yY]*) dflt='y';;
5453 Perl can be built to take advantage of 64-bit integer types
5454 on some systems. To do so, Configure can be run with -Duse64bitint.
5455 Choosing this option will most probably introduce binary incompatibilities.
5457 If this doesn't make any sense to you, just accept the default '$dflt'.
5458 (The default has been chosen based on your configuration.)
5460 rp='Try to use 64-bit integers, if available?'
5463 [yY]*) val="$define" ;;
5471 case "$use64bitall" in
5472 "$define"|true|[yY]*) dflt='y' ;;
5473 *) case "$longsize" in
5481 You may also choose to try maximal 64-bitness. It means using as much
5482 64-bitness as possible on the platform. This in turn means even more
5483 binary incompatibilities. On the other hand, your platform may not
5484 have any more 64-bitness available than what you already have chosen.
5486 If this doesn't make any sense to you, just accept the default '$dflt'.
5487 (The default has been chosen based on your configuration.)
5489 rp='Try to use maximal 64-bit support, if available?'
5492 [yY]*) val="$define" ;;
5497 case "$use64bitall" in
5499 case "$use64bitint" in
5503 Since you have chosen a maximally 64-bit build, I'm also turning on
5504 the use of 64-bit integers.
5506 use64bitint="$define" ;;
5511 : Look for a hint-file generated 'call-back-unit'. If the
5512 : user has specified that a 64-bit perl is to be built,
5513 : we may need to set or change some other defaults.
5514 if $test -f use64bitint.cbu; then
5515 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5518 case "$use64bitint" in
5519 "$define"|true|[yY]*)
5521 4) case "$archname64" in
5522 '') archname64=64int ;;
5529 : Look for a hint-file generated 'call-back-unit'. If the
5530 : user has specified that a maximally 64-bit perl is to be built,
5531 : we may need to set or change some other defaults.
5532 if $test -f use64bitall.cbu; then
5533 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5536 case "$use64bitall" in
5537 "$define"|true|[yY]*)
5539 4) case "$archname64" in
5540 ''|64int) archname64=64all ;;
5547 case "$d_quad:$use64bitint" in
5551 *** You have chosen to use 64-bit integers,
5552 *** but none can be found.
5553 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5554 *** Cannot continue, aborting.
5561 : check for length of double
5563 case "$doublesize" in
5565 echo "Checking to see how big your double precision numbers are..." >&4
5574 printf("%d\n", (int)sizeof(double));
5579 if eval $compile_ok; then
5580 doublesize=`$run ./try`
5581 echo "Your double is $doublesize bytes long."
5584 echo "(I can't seem to compile the test program. Guessing...)"
5585 rp="What is the size of a double precision number (in bytes)?"
5593 : check for long doubles
5595 echo "Checking to see if you have long double..." >&4
5596 echo 'int main() { long double x = 7.0; }' > try.c
5598 if eval $compile; then
5600 echo "You have long double."
5603 echo "You do not have long double."
5609 : check for length of long double
5610 case "${d_longdbl}${longdblsize}" in
5613 echo "Checking to see how big your long doubles are..." >&4
5614 $cat >try.c <<'EOCP'
5618 printf("%d\n", sizeof(long double));
5623 if eval $compile; then
5624 longdblsize=`$run ./try`
5625 echo "Your long doubles are $longdblsize bytes long."
5629 echo "(I can't seem to compile the test program. Guessing...)" >&4
5630 rp="What is the size of a long double (in bytes)?"
5634 if $test "X$doublesize" = "X$longdblsize"; then
5635 echo "That isn't any different from an ordinary double."
5636 echo "I'll keep your setting anyway, but you may see some"
5637 echo "harmless compilation warnings."
5643 : determine the architecture name
5645 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5646 tarch=`arch`"-$osname"
5647 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5648 if uname -m > tmparch 2>&1 ; then
5649 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5650 -e 's/$/'"-$osname/" tmparch`
5658 case "$myarchname" in
5661 echo "(Your architecture name used to be $myarchname.)"
5665 case "$targetarch" in
5667 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
5672 *) dflt="$archname";;
5674 rp='What is your architecture name'
5677 case "$usethreads" in
5679 echo "Threads selected." >&4
5681 *-thread*) echo "...and architecture name already has -thread." >&4
5683 *) archname="$archname-thread"
5684 echo "...setting architecture name to $archname." >&4
5689 case "$usemultiplicity" in
5691 echo "Multiplicity selected." >&4
5693 *-multi*) echo "...and architecture name already has -multi." >&4
5695 *) archname="$archname-multi"
5696 echo "...setting architecture name to $archname." >&4
5701 case "$use64bitint$use64bitall" in
5703 case "$archname64" in
5705 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
5708 case "$use64bitint" in
5709 "$define") echo "64 bit integers selected." >&4 ;;
5711 case "$use64bitall" in
5712 "$define") echo "Maximal 64 bitness selected." >&4 ;;
5715 *-$archname64*) echo "...and architecture name already has $archname64." >&4
5717 *) archname="$archname-$archname64"
5718 echo "...setting architecture name to $archname." >&4
5724 case "$uselongdouble" in
5726 echo "Long doubles selected." >&4
5727 case "$longdblsize" in
5729 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
5733 *-ld*) echo "...and architecture name already has -ld." >&4
5735 *) archname="$archname-ld"
5736 echo "...setting architecture name to $archname." >&4
5743 case "$useperlio" in
5745 echo "Perlio selected." >&4
5748 echo "Perlio not selected, using stdio." >&4
5750 *-stdio*) echo "...and architecture name already has -stdio." >&4
5752 *) archname="$archname-stdio"
5753 echo "...setting architecture name to $archname." >&4
5758 if $test -f archname.cbu; then
5759 echo "Your platform has some specific hints for architecture name, using them..."
5763 : determine root of directory hierarchy where package will be installed.
5766 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
5769 dflt=`echo "$prefix" | sed 's/.$//'`
5777 By default, $package will be installed in $dflt/bin, manual pages
5778 under $dflt/man, etc..., i.e. with $dflt as prefix for all
5779 installation directories. Typically this is something like /usr/local.
5780 If you wish to have binaries under /usr/bin but other parts of the
5781 installation under /usr/local, that's ok: you will be prompted
5782 separately for each of the installation directories, the prefix being
5783 only used to set the defaults.
5787 rp='Installation prefix to use?'
5795 *) oldprefix="$prefix";;
5804 *) afsroot=$afsroot ;;
5810 $define|true) afs=true ;;
5811 $undef|false) afs=false ;;
5812 *) if test -d $afsroot; then
5820 echo "AFS may be running... I'll be extra cautious then..." >&4
5822 echo "AFS does not seem to be running..." >&4
5825 : determine installation prefix for where package is to be installed.
5829 Since you are running AFS, I need to distinguish the directory in which
5830 files will reside from the directory in which they are installed (and from
5831 which they are presumably copied to the former directory by occult means).
5834 case "$installprefix" in
5835 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
5836 *) dflt="$installprefix";;
5841 In some special cases, particularly when building $package for distribution,
5842 it is convenient to distinguish the directory in which files should be
5843 installed from the directory ($prefix) in which they will
5844 eventually reside. For most users, these two directories are the same.
5847 case "$installprefix" in
5849 *) dflt=$installprefix;;
5853 rp='What installation prefix should I use for installing files?'
5855 installprefix="$ans"
5856 installprefixexp="$ansexp"
5858 : set the prefixit variable, to compute a suitable default value
5859 prefixit='case "$3" in
5861 case "$oldprefix" in
5862 "") eval "$1=\"\$$2\"";;
5869 ""|" ") eval "$1=\"\$$2\"";;
5875 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
5877 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
5878 /*-$oldprefix/*|\~*-$oldprefix/*)
5879 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
5880 *) eval "$1=\"\$$2\"";;
5884 : get the patchlevel
5886 echo "Getting the current patchlevel..." >&4
5887 if $test -r $rsrc/patchlevel.h;then
5888 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
5889 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
5890 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5891 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
5892 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
5893 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5894 perl_patchlevel=`grep ',"DEVEL[0-9][0-9]*"' $rsrc/patchlevel.h|sed 's/[^0-9]//g'`
5903 $echo "(You do not have patchlevel.h. Eek.)"
5905 if $test -r $rsrc/.patch ; then
5906 if $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
5907 perl_patchlevel=`cat $rsrc/.patch`
5910 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
5911 version_patchlevel_string="version $patchlevel subversion $subversion"
5912 case "$perl_patchlevel" in
5914 *) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;;
5917 $echo "(You have $package $version_patchlevel_string.)"
5921 : XXX Should be a Configure test for double-dots in filenames.
5922 version=`echo $revision $patchlevel $subversion | \
5923 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
5924 api_versionstring=`echo $api_revision $api_version $api_subversion | \
5925 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
5928 version=`echo $revision $patchlevel $subversion | \
5929 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
5930 api_versionstring=`echo $api_revision $api_version $api_subversion | \
5931 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
5934 : Special case the 5.005_xx maintenance series, which used 5.005
5935 : without any subversion label as a subdirectory in $sitelib
5936 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
5937 api_versionstring='5.005'
5940 : determine installation style
5941 : For now, try to deduce it from prefix unless it is already set.
5942 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
5943 case "$installstyle" in
5944 '') case "$prefix" in
5945 *perl*) dflt='lib';;
5946 *) dflt='lib/perl5' ;;
5949 *) dflt="$installstyle" ;;
5951 : Probably not worth prompting for this since we prompt for all
5952 : the directories individually, and the prompt would be too long and
5956 : determine where private library files go
5957 : Usual default is /usr/local/lib/perl5/$version.
5958 : Also allow things like /opt/perl/lib/$version, since
5959 : /opt/perl/lib/perl5... would be redundant.
5960 : The default "style" setting is made in installstyle.U
5961 case "$installstyle" in
5962 *lib/perl5*) set dflt privlib lib/$package/$version ;;
5963 *) set dflt privlib lib/$version ;;
5968 There are some auxiliary files for $package that need to be put into a
5969 private library directory that is accessible by everyone.
5973 rp='Pathname where the private library files will reside?'
5976 privlibexp="$ansexp"
5977 : Change installation prefix, if necessary.
5978 if $test X"$prefix" != X"$installprefix"; then
5979 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
5981 installprivlib="$privlibexp"
5984 : set the prefixup variable, to restore leading tilda escape
5985 prefixup='case "$prefixexp" in
5987 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
5990 : determine where public architecture dependent libraries go
5993 : privlib default is /usr/local/lib/$package/$version
5994 : archlib default is /usr/local/lib/$package/$version/$archname
5995 : privlib may have an optional trailing /share.
5996 tdflt=`echo $privlib | $sed 's,/share$,,'`
5997 tdflt=$tdflt/$archname
6006 $spackage contains architecture-dependent library files. If you are
6007 sharing libraries in a heterogeneous environment, you might store
6008 these files in a separate location. Otherwise, you can just include
6009 them with the rest of the public library files.
6013 rp='Where do you want to put the public architecture-dependent libraries?'
6016 archlibexp="$ansexp"
6017 if $test X"$archlib" = X"$privlib"; then
6022 : Change installation prefix, if necessary.
6023 if $test X"$prefix" != X"$installprefix"; then
6024 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
6026 installarchlib="$archlibexp"
6029 : see if setuid scripts can be secure
6032 Some kernels have a bug that prevents setuid #! scripts from being
6033 secure. Some sites have disabled setuid #! scripts because of this.
6035 First let's decide if your kernel supports secure setuid #! scripts.
6036 (If setuid #! scripts would be secure but have been disabled anyway,
6037 don't say that they are secure if asked.)
6042 if $test -d /dev/fd; then
6043 echo "#!$ls" >reflect
6044 chmod +x,u+s reflect
6045 ./reflect >flect 2>&1
6046 if $contains "/dev/fd" flect >/dev/null; then
6047 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6051 If you are not sure if they are secure, I can check but I'll need a
6052 username and password different from the one you are using right now.
6053 If you don't have such a username or don't want me to test, simply
6057 rp='Other username to test security of setuid scripts with?'
6062 case "$d_suidsafe" in
6063 '') echo "I'll assume setuid scripts are *not* secure." >&4
6066 echo "Well, the $hint value is *not* secure." >&4
6068 *) echo "Well, the $hint value *is* secure." >&4
6073 $rm -f reflect flect
6074 echo "#!$ls" >reflect
6075 chmod +x,u+s reflect
6078 echo '"su" will (probably) prompt you for '"$ans's password."
6079 su $ans -c './reflect >flect'
6080 if $contains "/dev/fd" flect >/dev/null; then
6081 echo "Okay, it looks like setuid scripts are secure." >&4
6084 echo "I don't think setuid scripts are secure." >&4
6089 rp='Does your kernel have *secure* setuid scripts?'
6092 [yY]*) val="$define";;
6097 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6098 echo "(That's for file descriptors, not floppy disks.)"
6104 $rm -f reflect flect
6106 : now see if they want to do setuid emulation
6109 case "$d_suidsafe" in
6112 echo "No need to emulate SUID scripts since they are secure here." >&4
6116 Some systems have disabled setuid scripts, especially systems where
6117 setuid scripts cannot be secure. On systems where setuid scripts have
6118 been disabled, the setuid/setgid bits on scripts are currently
6119 useless. It is possible for $package to detect those bits and emulate
6120 setuid/setgid in a secure fashion. This emulation will only work if
6121 setuid scripts have been disabled in your kernel.
6125 "$define") dflt=y ;;
6128 rp="Do you want to do setuid/setgid emulation?"
6131 [yY]*) val="$define";;
6139 : see if this is a malloc.h system
6140 : we want a real compile instead of Inhdr because some systems have a
6141 : malloc.h that just gives a compile error saying to use stdlib.h instead
6146 int main () { return 0; }
6149 if eval $compile; then
6150 echo "<malloc.h> found." >&4
6153 echo "<malloc.h> NOT found." >&4
6160 : check for void type
6162 echo "Checking to see how well your C compiler groks the void type..." >&4
6163 case "$voidflags" in
6175 extern void moo(); /* function returning void */
6176 void (*goo)(); /* ptr to func returning void */
6178 void *hue; /* generic ptr */
6191 int main() { sub(); }
6193 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6194 voidflags=$defvoidused
6195 echo "Good. It appears to support void to the level $package wants.">&4
6196 if $contains warning .out >/dev/null 2>&1; then
6197 echo "However, you might get some warnings that look like this:"
6201 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6202 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6203 echo "It supports 1..."
6204 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6205 echo "It also supports 2..."
6206 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6208 echo "And it supports 4 but not 8 definitely."
6210 echo "It doesn't support 4..."
6211 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6213 echo "But it supports 8."
6216 echo "Neither does it support 8."
6220 echo "It does not support 2..."
6221 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6223 echo "But it supports 4 and 8."
6225 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6227 echo "And it supports 4 but has not heard about 8."
6229 echo "However it supports 8 but not 4."
6234 echo "There is no support at all for void."
6239 case "$voidflags" in
6242 Support flag bits are:
6243 1: basic void declarations.
6244 2: arrays of pointers to functions returning void.
6245 4: operations between pointers to and addresses of void functions.
6246 8: generic void pointers.
6249 rp="Your void support flags add up to what?"
6256 : check for length of pointer
6260 echo "Checking to see how big your pointers are..." >&4
6261 if test "$voidflags" -gt 7; then
6262 echo '#define VOID_PTR char *' > try.c
6264 echo '#define VOID_PTR void *' > try.c
6274 printf("%d\n", (int)sizeof(VOID_PTR));
6279 if eval $compile_ok; then
6280 ptrsize=`$run ./try`
6281 echo "Your pointers are $ptrsize bytes long."
6284 echo "(I can't seem to compile the test program. Guessing...)" >&4
6285 rp="What is the size of a pointer (in bytes)?"
6292 case "$use64bitall" in
6293 "$define"|true|[yY]*)
6297 *** You have chosen a maximally 64-bit build,
6298 *** but your pointers are only 4 bytes wide.
6299 *** Please rerun Configure without -Duse64bitall.
6304 *** Since you have quads, you could possibly try with -Duse64bitint.
6309 *** Cannot continue, aborting.
6320 : determine whether to use malloc wrapping
6322 case "$usemallocwrap" in
6323 [yY]*|true|$define) dflt='y' ;;
6324 [nN]*|false|$undef) dflt='n' ;;
6325 *) case "$usedevel" in
6326 [yY]*|true|$define) dflt='y' ;;
6331 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6333 usemallocwrap="$ans"
6336 usemallocwrap="$define" ;;
6338 usemallocwrap="$undef" ;;
6341 : determine which malloc to compile in
6343 case "$usemymalloc" in
6344 [yY]*|true|$define) dflt='y' ;;
6345 [nN]*|false|$undef) dflt='n' ;;
6346 *) case "$ptrsize" in
6352 rp="Do you wish to attempt to use the malloc that comes with $package?"
6358 mallocsrc='malloc.c'
6359 mallocobj="malloc$_o"
6360 d_mymalloc="$define"
6363 : Remove malloc from list of libraries to use
6364 echo "Removing unneeded -lmalloc from library list" >&4
6365 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6368 echo "libs = $libs" >&4
6380 : compute the return types of malloc and free
6382 $cat >malloc.c <<END
6386 #include <sys/types.h>
6400 case "$malloctype" in
6402 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6409 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6413 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6420 echo "Your system uses $freetype free(), it would seem." >&4
6424 After $package is installed, you may wish to install various
6425 add-on modules and utilities. Typically, these add-ons will
6426 be installed under $prefix with the rest
6427 of this package. However, you may wish to install such add-ons
6428 elsewhere under a different prefix.
6430 If you do not wish to put everything under a single prefix, that's
6431 ok. You will be prompted for the individual locations; this siteprefix
6432 is only used to suggest the defaults.
6434 The default should be fine for most people.
6438 rp='Installation prefix to use for add-on modules and utilities?'
6439 : XXX Here might be another good place for an installstyle setting.
6440 case "$siteprefix" in
6442 *) dflt=$siteprefix ;;
6445 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6447 case "$siteprefix" in
6451 *) oldsiteprefix="$prefix";;
6456 siteprefixexp="$ansexp"
6458 : determine where site specific libraries go.
6459 : Usual default is /usr/local/lib/perl5/site_perl/$version
6460 : The default "style" setting is made in installstyle.U
6461 : XXX No longer works with Prefixit stuff.
6462 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6464 '') case "$installstyle" in
6465 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6466 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6474 The installation process will create a directory for
6475 site-specific extensions and modules. Most users find it convenient
6476 to place all site-specific files in this directory rather than in the
6477 main distribution directory.
6481 rp='Pathname for the site-specific library files?'
6484 sitelibexp="$ansexp"
6485 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6486 : Change installation prefix, if necessary.
6487 if $test X"$prefix" != X"$installprefix"; then
6488 installsitelib=`echo $sitelibexp | $sed "s#^$prefix#$installprefix#"`
6490 installsitelib="$sitelibexp"
6493 : determine where site specific architecture-dependent libraries go.
6494 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6495 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6496 : sitelib may have an optional trailing /share.
6498 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6499 dflt="$dflt/$archname"
6504 set sitearch sitearch none
6508 The installation process will also create a directory for
6509 architecture-dependent site-specific extensions and modules.
6513 rp='Pathname for the site-specific architecture-dependent library files?'
6516 sitearchexp="$ansexp"
6517 : Change installation prefix, if necessary.
6518 if $test X"$prefix" != X"$installprefix"; then
6519 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
6521 installsitearch="$sitearchexp"
6526 The installation process will also create a directory for
6527 vendor-supplied add-ons. Vendors who supply perl with their system
6528 may find it convenient to place all vendor-supplied files in this
6529 directory rather than in the main distribution directory. This will
6530 ease upgrades between binary-compatible maintenance versions of perl.
6532 Of course you may also use these directories in whatever way you see
6533 fit. For example, you might use them to access modules shared over a
6534 company-wide network.
6536 The default answer should be fine for most people.
6537 This causes further questions about vendor add-ons to be skipped
6538 and no vendor-specific directories will be configured for perl.
6541 rp='Do you want to configure vendor-specific add-on directories?'
6542 case "$usevendorprefix" in
6543 define|true|[yY]*) dflt=y ;;
6544 *) : User may have set vendorprefix directly on Configure command line.
6545 case "$vendorprefix" in
6554 rp='Installation prefix to use for vendor-supplied add-ons?'
6555 case "$vendorprefix" in
6557 *) dflt=$vendorprefix ;;
6560 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6562 case "$vendorprefix" in
6566 *) oldvendorprefix="$prefix";;
6570 usevendorprefix="$define"
6572 vendorprefixexp="$ansexp"
6574 *) usevendorprefix="$undef"
6580 case "$vendorprefix" in
6581 '') d_vendorlib="$undef"
6585 *) d_vendorlib="$define"
6586 : determine where vendor-supplied modules go.
6587 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6588 case "$vendorlib" in
6590 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6591 case "$installstyle" in
6592 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6593 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6596 *) dflt="$vendorlib"
6600 rp='Pathname for the vendor-supplied library files?'
6603 vendorlibexp="$ansexp"
6606 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6607 : Change installation prefix, if necessary.
6608 if $test X"$prefix" != X"$installprefix"; then
6609 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
6611 installvendorlib="$vendorlibexp"
6614 case "$vendorprefix" in
6615 '') d_vendorarch="$undef"
6619 *) d_vendorarch="$define"
6620 : determine where vendor-supplied architecture-dependent libraries go.
6621 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6622 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6623 : vendorlib may have an optional trailing /share.
6624 case "$vendorarch" in
6625 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6626 dflt="$dflt/$archname"
6628 *) dflt="$vendorarch" ;;
6631 rp='Pathname for vendor-supplied architecture-dependent files?'
6634 vendorarchexp="$ansexp"
6637 : Change installation prefix, if necessary.
6638 if $test X"$prefix" != X"$installprefix"; then
6639 installvendorarch=`echo $vendorarchexp | sed "s#^$prefix#$installprefix#"`
6641 installvendorarch="$vendorarchexp"
6644 : Final catch-all directories to search
6647 Lastly, you can have perl look in other directories for extensions and
6648 modules in addition to those already specified.
6649 These directories will be searched after
6653 test X"$vendorlib" != "X" && echo ' ' $vendorlib
6654 test X"$vendorarch" != "X" && echo ' ' $vendorarch
6656 case "$otherlibdirs" in
6657 ''|' ') dflt='none' ;;
6658 *) dflt="$otherlibdirs" ;;
6661 Enter a colon-separated set of extra paths to include in perl's @INC
6662 search path, or enter 'none' for no extra paths.
6666 rp='Colon-separated list of additional directories for perl to search?'
6669 ' '|''|none) otherlibdirs=' ' ;;
6670 *) otherlibdirs="$ans" ;;
6672 case "$otherlibdirs" in
6676 set d_perl_otherlibdirs
6679 : Cruising for prototypes
6681 echo "Checking out function prototypes..." >&4
6682 $cat >prototype.c <<EOCP
6687 int main(int argc, char *argv[]) {
6690 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
6691 echo "Your C compiler appears to support function prototypes."
6694 echo "Your C compiler doesn't seem to understand function prototypes."
6701 case "$prototype" in
6703 *) ansi2knr='ansi2knr'
6708 This version of $package can only be compiled by a compiler that
6709 understands function prototypes. Unfortunately, your C compiler
6711 doesn't seem to understand them. Sorry about that.
6713 If GNU cc is available for your system, perhaps you could try that instead.
6715 Eventually, we hope to support building Perl with pre-ANSI compilers.
6716 If you would like to help in that effort, please contact <perlbug@perl.org>.
6718 Aborting Configure now.
6724 : determine where public executables go
6729 rp='Pathname where the public executables will reside?'
6731 if $test "X$ansexp" != "X$binexp"; then
6736 : Change installation prefix, if necessary.
6737 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6738 if $test X"$prefix" != X"$installprefix"; then
6739 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
6741 installbin="$binexp"
6750 Perl can be built with extra modules or bundles of modules which
6751 will be fetched from the CPAN and installed alongside Perl.
6753 Notice that you will need access to the CPAN; either via the Internet,
6754 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
6755 be asked later to configure the CPAN.pm module which will in turn do
6756 the installation of the rest of the extra modules or bundles.)
6758 Notice also that if the modules require any external software such as
6759 libraries and headers (the libz library and the zlib.h header for the
6760 Compress::Zlib module, for example) you MUST have any such software
6761 already installed, this configuration process will NOT install such
6764 If this doesn't make any sense to you, just accept the default '$dflt'.
6766 rp='Install any extra modules (y or n)?'
6772 Please list any extra modules or bundles to be installed from CPAN,
6773 with spaces between the names. The names can be in any format the
6774 'install' command of CPAN.pm will understand. (Answer 'none',
6775 without the quotes, to install no extra modules or bundles.)
6785 $rm -f ../extras.lst
6787 *) echo "(Saving the list of extras for later...)"
6788 echo "$extras" > ../extras.lst
6796 : determine where html pages for programs go
6797 set html1dir html1dir none
6801 If you wish to install html files for programs in $spackage, indicate
6802 the appropriate directory here. To skip installing html files,
6806 ''|none|$undef|' ') dflt=none ;;
6807 *) dflt=$html1dir ;;
6810 rp="Directory for the main $spackage html pages?"
6813 html1direxp="$ansexp"
6814 : Use ' ' for none so value is preserved next time through Configure
6815 $test X"$html1dir" = "X" && html1dir=' '
6816 : Change installation prefix, if necessary.
6817 if $test X"$prefix" != X"$installprefix"; then
6818 installhtml1dir=`echo $html1direxp | sed "s#^$prefix#$installprefix#"`
6820 installhtml1dir="$html1direxp"
6823 : determine where html pages for libraries and modules go
6824 set html3dir html3dir none
6828 If you wish to install html files for modules associated with $spackage,
6829 indicate the appropriate directory here. To skip installing html files,
6832 : There is no obvious default. If they have specified html1dir, then
6833 : try to key off that, possibly changing .../html1 into .../html3.
6835 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
6836 *) dflt=$html3dir ;;
6839 rp="Directory for the $spackage module html pages?"
6842 html3direxp="$ansexp"
6843 : Use ' ' for none so value is preserved next time through Configure
6844 $test X"$html3dir" = "X" && html3dir=' '
6845 : Change installation prefix, if necessary.
6846 if $test X"$prefix" != X"$installprefix"; then
6847 installhtml3dir=`echo $html3direxp | sed "s#^$prefix#$installprefix#"`
6849 installhtml3dir="$html3direxp"
6852 : Find perl5.005 or later.
6853 echo "Looking for a previously installed perl5.005 or later... "
6855 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6856 : Check if this perl is recent and can load a simple module
6857 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6860 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6870 '') echo "None found. That's ok.";;
6871 *) echo "Using $perl5." ;;
6874 : Determine list of previous versions to include in @INC
6875 $cat > getverlist <<EOPL
6878 \$api_versionstring = "$api_versionstring";
6879 \$version = "$version";
6880 \$stem = "$sitelib_stem";
6881 \$archname = "$archname";
6883 $cat >> getverlist <<'EOPL'
6884 # Can't have leading @ because metaconfig interprets it as a command!
6885 ;@inc_version_list=();
6886 # XXX Redo to do opendir/readdir?
6889 ;@candidates = glob("5.*");
6895 # XXX ToDo: These comparisons must be reworked when two-digit
6896 # subversions come along, so that 5.7.10 compares as greater than
6897 # 5.7.3! By that time, hope that 5.6.x is sufficiently
6898 # widespread that we can use the built-in version vectors rather
6899 # than reinventing them here. For 5.6.0, however, we must
6900 # assume this script will likely be run by 5.005_0x. --AD 1/2000.
6901 foreach $d (@candidates) {
6902 if ($d lt $version) {
6903 if ($d ge $api_versionstring) {
6904 unshift(@inc_version_list, grep { -d } "$d/$archname", $d);
6906 elsif ($d ge "5.005") {
6907 unshift(@inc_version_list, grep { -d } $d);
6911 # Skip newer version. I.e. don't look in
6912 # 5.7.0 if we're installing 5.6.1.
6916 if (@inc_version_list) {
6917 print join(' ', @inc_version_list);
6920 # Blank space to preserve value for next Configure run.
6925 case "$inc_version_list" in
6926 '') if test -x "$perl5$exe_ext"; then
6927 dflt=`$perl5 getverlist`
6932 $undef) dflt='none' ;;
6933 *) eval dflt=\"$inc_version_list\" ;;
6936 ''|' ') dflt=none ;;
6943 In order to ease the process of upgrading, this version of perl
6944 can be configured to use modules built and installed with earlier
6945 versions of perl that were installed under $prefix. Specify here
6946 the list of earlier versions that this version of perl should check.
6947 If Configure detected no earlier versions of perl installed under
6948 $prefix, then the list will be empty. Answer 'none' to tell perl
6949 to not search earlier versions.
6951 The default should almost always be sensible, so if you're not sure,
6952 just accept the default.
6955 rp='List of earlier versions to include in @INC?'
6958 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6959 *) inc_version_list="$ans" ;;
6961 case "$inc_version_list" in
6963 inc_version_list_init='0';;
6964 *) inc_version_list_init=`echo $inc_version_list |
6965 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6970 : determine whether to install perl also as /usr/bin/perl
6973 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
6975 Many scripts expect perl to be installed as /usr/bin/perl.
6977 If you want to, I can install the perl you are about to compile
6978 as /usr/bin/perl (in addition to $bin/perl).
6980 if test -f /usr/bin/perl; then
6983 However, please note that because you already have a /usr/bin/perl,
6984 overwriting that with a new Perl would very probably cause problems.
6985 Therefore I'm assuming you don't want to do that (unless you insist).
6988 case "$installusrbinperl" in
6989 "$define"|[yY]*) dflt='y';;
6995 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
6998 case "$installusrbinperl" in
6999 "$undef"|[nN]*) dflt='n';;
7003 rp="Do you want to install perl as /usr/bin/perl?"
7006 [yY]*) val="$define";;
7012 set installusrbinperl
7016 echo "Checking for GNU C Library..." >&4
7018 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7019 alone are insufficient to distinguish different versions, such as
7020 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7021 libc version 2.1.0. A. Dougherty, June 3, 2002.
7027 # ifdef __GLIBC_MINOR__
7028 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
7029 # include <gnu/libc-version.h>
7030 printf("%s\n", gnu_get_libc_version());
7032 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7035 printf("%d\n", __GLIBC__);
7044 if eval $compile_ok && $run ./try > glibc.ver; then
7046 gnulibc_version=`$cat glibc.ver`
7047 echo "You are using the GNU C Library version $gnulibc_version"
7051 echo "You are not using the GNU C Library"
7053 $rm -f try try.* glibc.ver
7057 : see if nm is to be used to determine whether a symbol is defined or not
7061 case "$d_gnulibc" in
7064 echo "nm probably won't work on the GNU C Library." >&4
7070 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7072 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7073 echo "'nm' won't be sufficient on this sytem." >&4
7079 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7080 if $test $dflt -gt 20; then
7090 true|$define) dflt=y;;
7097 I can use $nm to extract the symbols from your C libraries. This
7098 is a time consuming task which may generate huge output on the disk (up
7099 to 3 megabytes) but that should make the symbols extraction faster. The
7100 alternative is to skip the 'nm' extraction part and to compile a small
7101 test program instead to determine whether each symbol is present. If
7102 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7103 this may be the best solution.
7105 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7108 rp="Shall I use $nm to extract C symbols from the libraries?"
7111 [Nn]*) usenm=false;;
7120 : nm options which may be necessary
7122 '') if $test -f /mach_boot; then
7124 elif $test -d /usr/ccs/lib; then
7125 nm_opt='-p' # Solaris (and SunOS?)
7126 elif $test -f /dgux; then
7128 elif $test -f /lib64/rld; then
7129 nm_opt='-p' # 64-bit Irix
7135 : nm options which may be necessary for shared libraries but illegal
7136 : for archive libraries. Thank you, Linux.
7137 case "$nm_so_opt" in
7138 '') case "$myuname" in
7140 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7141 nm_so_opt='--dynamic'
7150 : get list of predefined functions in a handy place
7155 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7161 *) for thislib in $libs; do
7164 : Handle C library specially below.
7167 thislib=`echo $thislib | $sed -e 's/^-l//'`
7168 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7170 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7172 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7174 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7176 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7178 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7180 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7185 libnames="$libnames $try"
7187 *) libnames="$libnames $thislib" ;;
7196 for xxx in $libpth; do
7197 $test -r $1 || set $xxx/libc.$so
7198 : The messy sed command sorts on library version numbers.
7200 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7201 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7203 s/[0-9][0-9]*/0000&/g
7204 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7207 $sort | $sed -e 's/^.* //'`
7210 $test -r $1 || set /usr/ccs/lib/libc.$so
7211 $test -r $1 || set /lib/libsys_s$_a
7217 if $test -r "$1"; then
7218 echo "Your (shared) C library seems to be in $1."
7220 elif $test -r /lib/libc && $test -r /lib/clib; then
7221 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7223 libc='/lib/clib /lib/libc'
7224 if $test -r /lib/syslib; then
7225 echo "(Your math library is in /lib/syslib.)"
7226 libc="$libc /lib/syslib"
7228 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7229 echo "Your C library seems to be in $libc, as you said before."
7230 elif $test -r $incpath/usr/lib/libc$_a; then
7231 libc=$incpath/usr/lib/libc$_a;
7232 echo "Your C library seems to be in $libc. That's fine."
7233 elif $test -r /lib/libc$_a; then
7235 echo "Your C library seems to be in $libc. You're normal."
7237 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7239 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7240 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7241 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7243 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7245 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7248 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7250 if $test -r "$tans"; then
7251 echo "Your C library seems to be in $tans, of all places."
7257 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7261 If the guess above is wrong (which it might be if you're using a strange
7262 compiler, or your machine supports multiple models), you can override it here.
7267 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7269 I can't seem to find your C library. I've looked in the following places:
7272 $sed 's/^/ /' libpath
7275 None of these seems to contain your C library. I need to get its name...
7280 rp='Where is your C library?'
7285 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7286 set X `cat libnames`
7289 case $# in 1) xxx=file; esac
7290 echo "Extracting names from the following $xxx for later perusal:" >&4
7292 $sed 's/^/ /' libnames >&4
7294 $echo $n "This may take a while...$c" >&4
7298 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7299 *) $nm $nm_opt $file 2>/dev/null;;
7304 $grep fprintf libc.tmp > libc.ptf
7305 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7306 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7308 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7310 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7312 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7314 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7316 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7318 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7320 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7322 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7324 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7326 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7328 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7330 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7332 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7333 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7335 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7337 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7339 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7341 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7343 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7345 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7347 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7349 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7351 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7353 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7355 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7357 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7359 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7361 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7363 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7366 $nm -p $* 2>/dev/null >libc.tmp
7367 $grep fprintf libc.tmp > libc.ptf
7368 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7369 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7375 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7377 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
7378 for thisname in $libnames $libc; do
7379 $ar t $thisname >>libc.tmp
7381 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7383 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7384 # Repeat libc to extract forwarders to DLL entries too
7385 for thisname in $libnames $libc; do
7386 $ar tv $thisname >>libc.tmp
7387 # Revision 50 of EMX has bug in $ar.
7388 # it will not extract forwarders to DLL entries
7389 # Use emximp which will extract exactly them.
7390 emximp -o tmp.imp $thisname \
7392 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7393 < tmp.imp >>libc.tmp
7396 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7399 echo "$ar didn't seem to work right." >&4
7400 echo "Maybe this is a Cray...trying bld instead..." >&4
7401 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
7403 for thisname in $libnames; do
7405 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7406 $ar t $thisname >>libc.tmp
7410 echo "That didn't work either. Giving up." >&4
7420 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7421 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7423 *) if $test -f /lib/syscalls.exp; then
7425 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7426 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' /lib/syscalls.exp >>libc.list
7432 $rm -f libnames libpath
7434 : see if dld is available
7438 : is a C symbol defined?
7441 -v) tf=libc.tmp; tdc="";;
7442 -a) tf=libc.tmp; tdc="[]";;
7443 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7446 case "$reuseval-$4" in
7448 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7453 if $test "$runnm" = true; then
7454 if $contains $tlook $tf >/dev/null 2>&1; then
7456 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7457 echo "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7458 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7459 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7460 $rm -f try$_exe try.c core core.* try.core;
7463 echo "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7464 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7465 $rm -f try$_exe try.c;
7470 $define) tval=true;;
7477 : define an is-in-libc? function
7478 inlibc='echo " "; td=$define; tu=$undef;
7479 sym=$1; var=$2; eval "was=\$$2";
7481 case "$reuseval$was" in
7491 echo "$sym() found." >&4;
7492 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7494 echo "$sym() NOT found." >&4;
7495 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7499 $define) echo "$sym() found." >&4;;
7500 *) echo "$sym() NOT found." >&4;;
7504 : see if dlopen exists
7511 : determine which dynamic loading, if any, to compile in
7513 dldir="ext/DynaLoader"
7526 $define) dflt='y' ;;
7529 $define) dflt='y' ;;
7531 : Does a dl_xxx.xs file exist for this operating system
7532 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7535 rp="Do you wish to use dynamic loading?"
7542 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7543 dflt="$dldir/dl_${osname}.xs"
7544 elif $test "$d_dlopen" = "$define" ; then
7545 dflt="$dldir/dl_dlopen.xs"
7546 elif $test "$i_dld" = "$define" ; then
7547 dflt="$dldir/dl_dld.xs"
7552 *) dflt="$dldir/$dlsrc"
7555 echo "The following dynamic loading files are available:"
7556 : Can not go over to $dldir because getfile has path hard-coded in.
7557 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7558 rp="Source file to use for dynamic loading"
7564 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7568 Some systems may require passing special flags to $cc -c to
7569 compile modules that will be used to create a shared library.
7570 To use no flags, say "none".
7573 case "$cccdlflags" in
7574 '') case "$gccversion" in
7575 '') case "$osname" in
7577 next) dflt='none' ;;
7578 irix*) dflt='-KPIC' ;;
7579 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7580 sunos) dflt='-pic' ;;
7584 *) case "$osname" in
7585 darwin) dflt='none' ;;
7586 svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7591 *) dflt="$cccdlflags" ;;
7593 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7596 none) cccdlflags=' ' ;;
7597 *) cccdlflags="$ans" ;;
7602 Some systems use ld to create libraries that can be dynamically loaded,
7603 while other systems (such as those using ELF) use $cc.
7607 '') $cat >try.c <<EOM
7608 /* Test for whether ELF binaries are produced */
7616 int i = open("a.out",O_RDONLY);
7619 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7620 exit(0); /* succeed (yes, it's ELF) */
7625 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7627 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7631 echo "I'll use ld to build dynamic libraries."
7640 rp="What command should be used to create dynamic libraries?"
7646 Some systems may require passing special flags to $ld to create a
7647 library that can be dynamically loaded. If your ld flags include
7648 -L/other/path options to locate libraries outside your loader's normal
7649 search path, you may need to specify those -L options here as well. To
7650 use no flags, say "none".
7653 case "$lddlflags" in
7654 '') case "$osname" in
7655 beos) dflt='-nostart' ;;
7657 case "$gccversion" in
7658 '') dflt="$dflt +vnocompatwarnings" ;;
7661 linux|irix*|gnu*) dflt='-shared' ;;
7662 next) dflt='none' ;;
7663 solaris) dflt='-G' ;;
7664 sunos) dflt='-assert nodefinitions' ;;
7665 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
7669 *) dflt="$lddlflags" ;;
7672 : Try to guess additional flags to pick up local libraries.
7673 : Be careful not to append to a plain 'none'
7677 for thisflag in $ldflags; do
7682 *) dflt="$dflt $thisflag" ;;
7689 ''|' ') dflt='none' ;;
7692 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
7695 none) lddlflags=' ' ;;
7696 *) lddlflags="$ans" ;;
7701 Some systems may require passing special flags to $cc to indicate that
7702 the resulting executable will use dynamic linking. To use no flags,
7706 case "$ccdlflags" in
7707 '') case "$osname" in
7708 linux|hpux|gnu*) dflt='-Wl,-E' ;;
7709 next|sunos) dflt='none' ;;
7713 *) dflt="$ccdlflags" ;;
7715 rp="Any special flags to pass to $cc to use dynamic linking?"
7718 none) ccdlflags=' ' ;;
7719 *) ccdlflags="$ans" ;;
7733 # No dynamic loading being used, so don't bother even to prompt.
7736 *) case "$useshrplib" in
7737 '') case "$osname" in
7738 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
7740 also='Building a shared libperl is required for dynamic loading to work on your system.'
7745 also='Building a shared libperl is needed for MAB support.'
7763 The perl executable is normally obtained by linking perlmain.c with
7764 libperl${_a}, any static extensions (usually just DynaLoader), and
7765 any other libraries needed on this system (such as -lm, etc.). Since
7766 your system supports dynamic loading, it is probably possible to build
7767 a shared libperl.$so. If you will have more than one executable linked
7768 to libperl.$so, this will significantly reduce the size of each
7769 executable, but it may have a noticeable effect on performance. The
7770 default is probably sensible for your system.
7774 rp="Build a shared libperl.$so (y/n)"
7778 useshrplib='true' ;;
7779 *) useshrplib='false' ;;
7784 case "$useshrplib" in
7788 # Figure out a good name for libperl.so. Since it gets stored in
7789 # a version-specific architecture-dependent library, the version
7790 # number isn't really that important, except for making cc/ld happy.
7792 # A name such as libperl.so.3.1
7793 majmin="libperl.$so.$patchlevel.$subversion"
7794 # A name such as libperl.so.301
7795 majonly=`echo $patchlevel $subversion |
7796 $awk '{printf "%d%02d", $1, $2}'`
7797 majonly=libperl.$so.$majonly
7798 # I'd prefer to keep the os-specific stuff here to a minimum, and
7799 # rely on figuring it out from the naming of libc.
7800 case "${osname}${osvers}" in
7803 # XXX How handle the --version stuff for MAB?
7805 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
7808 cygwin*) # ld links against an importlib
7809 dflt=libperl$lib_ext
7811 *) # Try to guess based on whether libc has major.minor.
7813 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
7814 *libc.$so.[0-9]*) dflt=$majonly ;;
7815 *) dflt=libperl.$so ;;
7825 I need to select a good name for the shared libperl. If your system uses
7826 library names with major and minor numbers, then you might want something
7827 like $majmin. Alternatively, if your system uses a single version
7828 number for shared libraries, then you might want to use $majonly.
7829 Or, your system might be quite happy with a simple libperl.$so.
7831 Since the shared libperl will get installed into a version-specific
7832 architecture-dependent directory, the version number of the shared perl
7833 library probably isn't important, so the default should be o.k.
7836 rp='What name do you want to give to the shared libperl?'
7839 echo "Ok, I'll use $libperl"
7842 libperl="libperl${_a}"
7846 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
7850 WARNING: Use of the shrpdir variable for the installation location of
7851 the shared $libperl is not supported. It was never documented and
7852 will not work in this version. Let me (perlbug@perl.org)
7853 know of any problems this may cause.
7859 But your current setting of $shrpdir is
7860 the default anyway, so it's harmless.
7865 Further, your current attempted setting of $shrpdir
7866 conflicts with the value of $archlibexp/CORE
7867 that installperl will use.
7874 # How will the perl executable find the installed shared $libperl?
7875 # Add $xxx to ccdlflags.
7876 # If we can't figure out a command-line option, use $shrpenv to
7877 # set env LD_RUN_PATH. The main perl makefile uses this.
7878 shrpdir=$archlibexp/CORE
7881 if "$useshrplib"; then
7884 # We'll set it in Makefile.SH...
7889 freebsd|netbsd|openbsd|interix)
7890 xxx="-Wl,-R$shrpdir"
7892 bsdos|linux|irix*|dec_osf|gnu*)
7893 xxx="-Wl,-rpath,$shrpdir"
7896 # next doesn't like the default...
7899 # beos doesn't like the default, either.
7902 # hpux doesn't like the default, either.
7903 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
7906 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
7912 # Only add $xxx if it isn't already in ccdlflags.
7913 case " $ccdlflags " in
7915 *) ccdlflags="$ccdlflags $xxx"
7918 Adding $xxx to the flags
7919 passed to $ld so that the perl executable will find the
7920 installed shared $libperl.
7928 # Fix ccdlflags in AIX for building external extensions.
7929 # (For building Perl itself bare -bE:perl.exp is needed,
7930 # Makefile.SH takes care of this.)
7932 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
7934 # Respect a hint or command-line value.
7936 '') shrpenv="$tmp_shrpenv" ;;
7938 case "$ldlibpthname" in
7939 '') ldlibpthname=LD_LIBRARY_PATH ;;
7940 none) ldlibpthname='' ;;
7943 : determine where manual pages are on this system
7947 syspath='/usr/share/man/man1 /usr/man/man1'
7948 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
7949 syspath="$syspath /usr/man/u_man/man1"
7950 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
7951 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
7952 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
7953 sysman=`./loc . /usr/man/man1 $syspath`
7956 if $test -d "$sysman"; then
7957 echo "System manual is in $sysman." >&4
7959 echo "Could not find manual pages in source form." >&4
7962 : determine where manual pages go
7963 set man1dir man1dir none
7967 $spackage has manual pages available in source form.
7971 echo "However, you don't have nroff, so they're probably useless to you."
7973 '') man1dir="none";;
7976 echo "If you don't want the manual sources installed, answer 'none'."
7981 lookpath="$prefixexp/share/man/man1"
7982 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
7983 lookpath="$lookpath $prefixexp/man/p_man/man1"
7984 lookpath="$lookpath $prefixexp/man/u_man/man1"
7985 lookpath="$lookpath $prefixexp/man/man.1"
7987 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
7988 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
7998 rp="Where do the main $spackage manual pages (source) go?"
8000 if $test "X$man1direxp" != "X$ansexp"; then
8004 man1direxp="$ansexp"
8010 : Change installation prefix, if necessary.
8011 if $test X"$prefix" != X"$installprefix"; then
8012 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
8014 installman1dir="$man1direxp"
8017 : What suffix to use on installed man pages
8024 rp="What suffix should be used for the main $spackage man pages?"
8026 '') case "$man1dir" in
8040 *) dflt="$man1ext";;
8047 : see if we can have long filenames
8049 first=123456789abcdef
8051 if (echo hi >$first) 2>/dev/null; then
8052 if $test -f 123456789abcde; then
8053 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8056 echo 'You can have filenames longer than 14 characters.'>&4
8061 You can't have filenames longer than 14 chars.
8062 You can't even think about them!
8068 $rm -rf 123456789abcde*
8070 : determine where library module manual pages go
8071 set man3dir man3dir none
8075 $spackage has manual pages for many of the library modules.
8081 However, you don't have nroff, so they're probably useless to you.
8084 '') man3dir="none";;
8088 case "$d_flexfnam" in
8091 However, your system can't handle the long file names like File::Basename.3.
8094 '') man3dir="none";;
8098 echo "If you don't want the manual sources installed, answer 'none'."
8099 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8101 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8102 if $test -d "$privlib/man/man3"; then
8105 WARNING: Previous versions of perl installed man3 pages into
8106 $privlib/man/man3. This version will suggest a
8107 new default of $dflt.
8111 rp='Do you wish to preserve the old behavior?(y/n)'
8114 y*) dflt="$privlib/man/man3" ;;
8119 *) dflt="$man3dir" ;;
8126 rp="Where do the $package library man pages (source) go?"
8129 man3direxp="$ansexp"
8135 : Change installation prefix, if necessary.
8136 if $test X"$prefix" != X"$installprefix"; then
8137 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
8139 installman3dir="$man3direxp"
8142 : What suffix to use on installed man pages
8148 rp="What suffix should be used for the $package library man pages?"
8150 '') case "$man3dir" in
8164 *) dflt="$man3ext";;
8171 : see if we have to deal with yellow pages, now NIS.
8172 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8173 if $test -f /usr/etc/nibindd; then
8175 echo "I'm fairly confident you're on a NeXT."
8177 rp='Do you get the hosts file via NetInfo?'
8186 y*) hostcat='nidump hosts .';;
8187 *) case "$hostcat" in
8188 nidump*) hostcat='';;
8198 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8206 rp='Are you getting the hosts file via yellow pages?'
8209 y*) hostcat='ypcat hosts';;
8210 *) hostcat='cat /etc/hosts';;
8216 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8219 '') test -f /etc/group && groupcat='cat /etc/group';;
8222 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8225 : now get the host name
8227 echo "Figuring out host name..." >&4
8228 case "$myhostname" in
8230 echo 'Maybe "hostname" will work...'
8231 if tans=`sh -c hostname 2>&1` ; then
8239 if $test "$cont"; then
8241 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8242 if tans=`cat /etc/systemid 2>&1` ; then
8244 phostname='cat /etc/systemid'
8245 echo "Whadyaknow. Xenix always was a bit strange..."
8248 elif $test -r /etc/systemid; then
8249 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8252 if $test "$cont"; then
8253 echo 'No, maybe "uuname -l" will work...'
8254 if tans=`sh -c 'uuname -l' 2>&1` ; then
8256 phostname='uuname -l'
8258 echo 'Strange. Maybe "uname -n" will work...'
8259 if tans=`sh -c 'uname -n' 2>&1` ; then
8261 phostname='uname -n'
8263 echo 'Oh well, maybe I can mine it out of whoami.h...'
8264 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8265 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8266 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8268 case "$myhostname" in
8269 '') echo "Does this machine have an identity crisis or something?"
8272 echo "Well, you said $myhostname before..."
8273 phostname='echo $myhostname';;
8279 case "$myhostname" in
8280 '') myhostname=noname ;;
8282 : you do not want to know about this
8287 if $test "$myhostname" ; then
8289 rp='Your host name appears to be "'$myhostname'".'" Right?"
8297 : bad guess or no guess
8298 while $test "X$myhostname" = X ; do
8300 rp="Please type the (one word) name of your host:"
8305 : translate upper to lower if necessary
8306 case "$myhostname" in
8308 echo "(Normalizing case in your host name)"
8309 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8313 case "$myhostname" in
8315 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8316 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8317 echo "(Trimming domain name from host name--host name is now $myhostname)"
8319 *) case "$mydomain" in
8322 test "X$hostcat" = "Xypcat hosts" &&
8323 ypmatch "$myhostname" hosts 2>/dev/null |\
8324 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8327 test "X$hostcat" != "X" &&
8328 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8329 /[ ]$myhostname[ . ]/p" > hosts
8332 if $test -f hosts; then
8333 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8334 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8335 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8336 hosts | $sort | $uniq | \
8337 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8338 case `$echo X$dflt` in
8339 X*\ *) echo "(Several hosts in the database matched hostname)"
8342 X.) echo "(You do not have fully-qualified names in the hosts database)"
8346 echo "(I cannot locate a hosts database anywhere)"
8351 tans=`./loc resolv.conf X /etc /usr/etc`
8352 if $test -f "$tans"; then
8353 echo "(Attempting domain name extraction from $tans)"
8354 dflt=.`$sed -n -e 's/ / /g' \
8355 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8356 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8358 .) dflt=.`$sed -n -e 's/ / /g' \
8359 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8360 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8367 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8368 dflt=.`sh -c domainname 2>/dev/null`
8371 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8375 case "$dflt$osname" in
8376 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8377 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8381 .) echo "(Lost all hope -- silly guess then)"
8387 *) dflt="$mydomain";;
8391 rp="What is your domain name?"
8401 : translate upper to lower if necessary
8404 echo "(Normalizing case in your domain name)"
8405 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8409 : a little sanity check here
8410 case "$phostname" in
8413 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8414 $myhostname$mydomain|$myhostname) ;;
8416 case "$phostname" in
8418 echo "(That doesn't agree with your whoami.h file, by the way.)"
8421 echo "(That doesn't agree with your $phostname command, by the way.)"
8431 I need to get your e-mail address in Internet format if possible, i.e.
8432 something like user@host.domain. Please answer accurately since I have
8433 no easy means to double check it. The default value provided below
8434 is most probably close to reality but may not be valid from outside
8435 your organization...
8439 while test "$cont"; do
8441 '') dflt="$cf_by@$myhostname$mydomain";;
8442 *) dflt="$cf_email";;
8444 rp='What is your e-mail address?'
8450 rp='Address does not look like an Internet one. Use it anyway?'
8466 If you or somebody else will be maintaining perl at your site, please
8467 fill in the correct e-mail address here so that they may be contacted
8468 if necessary. Currently, the "perlbug" program included with perl
8469 will send mail to this address in addition to perlbug@perl.org. You may
8470 enter "none" for no administrator.
8473 case "$perladmin" in
8474 '') dflt="$cf_email";;
8475 *) dflt="$perladmin";;
8477 rp='Perl administrator e-mail address'
8481 : determine whether to only install version-specific parts.
8484 Do you want to install only the version-specific parts of the perl
8485 distribution? Usually you do *not* want to do this.
8487 case "$versiononly" in
8488 "$define"|[Yy]*|true) dflt='y' ;;
8491 rp="Do you want to install only the version-specific parts of perl?"
8494 [yY]*) val="$define";;
8500 case "$versiononly" in
8501 "$define") inc_version_list=''
8502 inc_version_list_init=0
8506 : figure out how to guarantee perl startup
8507 case "$startperl" in
8509 case "$sharpbang" in
8513 I can use the #! construct to start perl on your system. This will
8514 make startup of perl scripts faster, but may cause problems if you
8515 want to share those scripts and perl is not in a standard place
8516 ($binexp/perl) on all your platforms. The alternative is to force
8517 a shell by starting the script with a single ':' character.
8520 case "$versiononly" in
8521 "$define") dflt="$binexp/perl$version";;
8522 *) dflt="$binexp/perl";;
8524 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8527 none) startperl=": # use perl";;
8528 *) startperl="#!$ans"
8529 if $test 30 -lt `echo "$ans" | wc -c`; then
8532 WARNING: Some systems limit the #! command to 32 characters.
8533 If you experience difficulty running Perl scripts with #!, try
8534 installing Perl in a directory with a shorter pathname.
8540 *) startperl=": # use perl"
8545 echo "I'll use $startperl to start perl scripts."
8547 : figure best path for perl in scripts
8550 case "$versiononly" in
8551 "$define") perlpath="$binexp/perl$version";;
8552 *) perlpath="$binexp/perl";;
8554 case "$startperl" in
8559 I will use the "eval 'exec'" idiom to start Perl on your system.
8560 I can use the full path of your Perl binary for this purpose, but
8561 doing so may cause problems if you want to share those scripts and
8562 Perl is not always in a standard place ($binexp/perl).
8566 rp="What path shall I use in \"eval 'exec'\"?"
8573 case "$startperl" in
8575 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8578 : determine where public executable scripts go
8579 set scriptdir scriptdir
8581 case "$scriptdir" in
8584 : guess some guesses
8585 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8586 $test -d /usr/share/bin && dflt=/usr/share/bin
8587 $test -d /usr/local/script && dflt=/usr/local/script
8588 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8589 $test -d $prefixexp/script && dflt=$prefixexp/script
8593 *) dflt="$scriptdir"
8598 Some installations have a separate directory just for executable scripts so
8599 that they can mount it across multiple architectures but keep the scripts in
8600 one spot. You might, for example, have a subdirectory of /usr/share for this.
8601 Or you might just lump your scripts in with all your other executables.
8605 rp='Where do you keep publicly executable scripts?'
8607 if $test "X$ansexp" != "X$scriptdirexp"; then
8611 scriptdirexp="$ansexp"
8612 : Change installation prefix, if necessary.
8613 if $test X"$prefix" != X"$installprefix"; then
8614 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
8616 installscript="$scriptdirexp"
8619 : determine where add-on public executables go
8621 '') dflt=$siteprefix/bin ;;
8625 rp='Pathname where the add-on public executables should be installed?'
8628 sitebinexp="$ansexp"
8629 : Change installation prefix, if necessary.
8630 if $test X"$prefix" != X"$installprefix"; then
8631 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
8633 installsitebin="$sitebinexp"
8636 : determine where add-on html pages go
8637 : There is no standard location, so try to copy the previously-selected
8638 : directory structure for the core html pages.
8639 case "$sitehtml1dir" in
8640 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8641 *) dflt=$sitehtml1dir ;;
8644 ''|' ') dflt=none ;;
8647 rp='Pathname where the site-specific html pages should be installed?'
8650 sitehtml1direxp="$ansexp"
8651 : Change installation prefix, if necessary.
8652 if $test X"$prefix" != X"$installprefix"; then
8653 installsitehtml1dir=`echo $sitehtml1direxp | $sed "s#^$prefix#$installprefix#"`
8655 installsitehtml1dir="$sitehtml1direxp"
8658 : determine where add-on library html pages go
8659 : There is no standard location, so try to copy the previously-selected
8660 : directory structure for the core html pages.
8661 case "$sitehtml3dir" in
8662 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8663 *) dflt=$sitehtml3dir ;;
8666 ''|' ') dflt=none ;;
8669 rp='Pathname where the site-specific library html pages should be installed?'
8672 sitehtml3direxp="$ansexp"
8673 : Change installation prefix, if necessary.
8674 if $test X"$prefix" != X"$installprefix"; then
8675 installsitehtml3dir=`echo $sitehtml3direxp | $sed "s#^$prefix#$installprefix#"`
8677 installsitehtml3dir="$sitehtml3direxp"
8680 : determine where add-on manual pages go
8681 case "$siteman1dir" in
8682 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
8683 *) dflt=$siteman1dir ;;
8686 ''|' ') dflt=none ;;
8689 rp='Pathname where the site-specific manual pages should be installed?'
8692 siteman1direxp="$ansexp"
8693 : Change installation prefix, if necessary.
8694 if $test X"$prefix" != X"$installprefix"; then
8695 installsiteman1dir=`echo $siteman1direxp | $sed "s#^$prefix#$installprefix#"`
8697 installsiteman1dir="$siteman1direxp"
8700 : determine where add-on library man pages go
8701 case "$siteman3dir" in
8702 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
8703 *) dflt=$siteman3dir ;;
8706 ''|' ') dflt=none ;;
8709 rp='Pathname where the site-specific library manual pages should be installed?'
8712 siteman3direxp="$ansexp"
8713 : Change installation prefix, if necessary.
8714 if $test X"$prefix" != X"$installprefix"; then
8715 installsiteman3dir=`echo $siteman3direxp | $sed "s#^$prefix#$installprefix#"`
8717 installsiteman3dir="$siteman3direxp"
8720 : determine where add-on public executable scripts go
8721 case "$sitescript" in
8722 '') dflt=$siteprefix/script
8723 $test -d $dflt || dflt=$sitebin ;;
8724 *) dflt="$sitescript" ;;
8727 rp='Pathname where add-on public executable scripts should be installed?'
8730 sitescriptexp="$ansexp"
8731 : Change installation prefix, if necessary.
8732 if $test X"$prefix" != X"$installprefix"; then
8733 installsitescript=`echo $sitescriptexp | sed "s#^$prefix#$installprefix#"`
8735 installsitescript="$sitescriptexp"
8738 case "$usefaststdio" in
8739 $define|true|[yY]*|'')
8740 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
8750 Perl can be built to use 'fast stdio', which means using the stdio
8751 library but also directly manipulating the stdio buffers to enable
8752 faster I/O. Using stdio is better for backward compatibility (especially
8753 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
8754 interface has been preferred instead of stdio.
8756 If this doesn't make any sense to you, just accept the default '$dflt'.
8758 rp='Use the "fast stdio" if available?'
8761 y|Y) val="$define" ;;
8768 : define an is-a-typedef? function
8769 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8771 "") inclist="sys/types.h";;
8773 eval "varval=\$$var";
8777 for inc in $inclist; do
8778 echo "#include <$inc>" >>temp.c;
8780 echo "#ifdef $type" >> temp.c;
8781 echo "printf(\"We have $type\");" >> temp.c;
8782 echo "#endif" >> temp.c;
8783 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8784 if $contains $type temp.E >/dev/null 2>&1; then
8790 *) eval "$var=\$varval";;
8793 : define an is-a-typedef? function that prompts if the type is not available.
8794 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8796 "") inclist="sys/types.h";;
8798 eval "varval=\$$var";
8802 for inc in $inclist; do
8803 echo "#include <$inc>" >>temp.c;
8805 echo "#ifdef $type" >> temp.c;
8806 echo "printf(\"We have $type\");" >> temp.c;
8807 echo "#endif" >> temp.c;
8808 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8810 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
8811 if $contains $type temp.E >/dev/null 2>&1; then
8812 echo "$type found." >&4;
8815 echo "$type NOT found." >&4;
8821 *) eval "$var=\$varval";;
8824 : see what type lseek is declared as in the kernel
8825 rp="What is the type used for lseek's offset on this system?"
8826 set off_t lseektype long stdio.h sys/types.h
8830 echo "Checking to see how big your file offsets are..." >&4
8832 #include <sys/types.h>
8836 printf("%d\n", (int)sizeof($lseektype));
8841 if eval $compile_ok; then
8842 lseeksize=`$run ./try`
8843 echo "Your file offsets are $lseeksize bytes long."
8847 echo "(I can't seem to compile the test program. Guessing...)"
8848 rp="What is the size of your file offsets (in bytes)?"
8854 : see what type file positions are declared as in the library
8855 rp="What is the type for file position used by fsetpos()?"
8856 set fpos_t fpostype long stdio.h sys/types.h
8861 *_t) zzz="$fpostype" ;;
8864 echo "Checking the size of $zzz..." >&4
8866 #include <sys/types.h>
8873 printf("%d\n", (int)sizeof($fpostype));
8878 if eval $compile_ok; then
8882 echo "(I can't execute the test program--guessing $fpossize.)" >&4
8885 echo "Your $zzz is $fpossize bytes long."
8891 echo "(I can't compile the test program. Guessing...)" >&4
8892 rp="What is the size of your file positions (in bytes)?"
8897 # Backward compatibility (uselfs is deprecated).
8899 "$define"|true|[yY]*)
8902 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
8904 uselargefiles="$define"
8908 case "$lseeksize:$fpossize" in
8911 You can have files larger than 2 gigabytes.
8914 *) case "$uselargefiles" in
8915 "$undef"|false|[nN]*) dflt='n' ;;
8920 Perl can be built to understand large files (files larger than 2 gigabytes)
8921 on some systems. To do so, Configure can be run with -Duselargefiles.
8923 If this doesn't make any sense to you, just accept the default '$dflt'.
8925 rp='Try to understand large files, if available?'
8928 y|Y) val="$define" ;;
8935 : Look for a hint-file generated 'call-back-unit'. If the
8936 : user has specified that a large files perl is to be built,
8937 : we may need to set or change some other defaults.
8938 if $test -f uselargefiles.cbu; then
8939 echo "Your platform has some specific hints regarding large file builds, using them..."
8940 . ./uselargefiles.cbu
8942 case "$uselargefiles" in
8944 if $test -f uselargefiles.cbu; then
8946 echo "Rechecking to see how big your file offsets are..." >&4
8948 #include <sys/types.h>
8952 printf("%d\n", (int)sizeof($lseektype));
8957 if eval $compile_ok; then
8958 lseeksize=`$run ./try`
8959 $echo "Your file offsets are now $lseeksize bytes long."
8963 echo "(I can't seem to compile the test program. Guessing...)"
8964 rp="What is the size of your file offsets (in bytes)?"
8969 *_t) zzz="$fpostype" ;;
8972 $echo $n "Rechecking the size of $zzz...$c" >&4
8974 #include <sys/types.h>
8981 printf("%d\n", (int)sizeof($fpostype));
8986 if eval $compile_ok; then
8991 echo "(I can't execute the test program--guessing $fpossize.)" >&4
8994 echo " $fpossize bytes." >&4
9000 echo "(I can't compile the test program. Guessing...)" >&4
9001 rp="What is the size of your file positions (in bytes)?"
9010 # probably will refer to
9011 # $archlib $privlib $sitearch $sitelib $vendorarch $vendorlib
9013 userelocatableinc=undef
9015 case "$vendorprefix" in
9016 '') d_vendorbin="$undef"
9020 *) d_vendorbin="$define"
9021 : determine where vendor-supplied executables go.
9022 case "$vendorbin" in
9023 '') dflt=$vendorprefix/bin ;;
9024 *) dflt="$vendorbin" ;;
9027 rp='Pathname for the vendor-supplied executables directory?'
9030 vendorbinexp="$ansexp"
9033 : Change installation prefix, if necessary.
9034 if $test X"$prefix" != X"$installprefix"; then
9035 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
9037 installvendorbin="$vendorbinexp"
9040 case "$vendorprefix" in
9041 '') vendorhtml1dir=''
9042 vendorhtml1direxp=''
9044 *) : determine where vendor-supplied html pages go.
9045 : There is no standard location, so try to copy the previously-selected
9046 : directory structure for the core html pages.
9047 : XXX Better default suggestions would be welcome.
9048 case "$vendorhtml1dir" in
9049 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9050 *) dflt=$vendorhtml1dir ;;
9053 ''|' ') dflt=none ;;
9056 rp='Pathname for the vendor-supplied html pages?'
9058 vendorhtml1dir="$ans"
9059 vendorhtml1direxp="$ansexp"
9062 : Use ' ' for none so value is preserved next time through Configure
9063 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9064 : Change installation prefix, if necessary.
9065 if $test X"$prefix" != X"$installprefix"; then
9066 installvendorhtml1dir=`echo $vendorhtml1direxp | $sed "s#^$prefix#$installprefix#"`
9068 installvendorhtml1dir="$vendorhtml1direxp"
9071 case "$vendorprefix" in
9072 '') vendorhtml3dir=''
9073 vendorhtml3direxp=''
9075 *) : determine where vendor-supplied module html pages go.
9076 : There is no standard location, so try to copy the previously-selected
9077 : directory structure for the core html pages.
9078 : XXX Better default suggestions would be welcome.
9079 case "$vendorhtml3dir" in
9080 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9081 *) dflt=$vendorhtml3dir ;;
9084 ''|' ') dflt=none ;;
9087 rp='Pathname for the vendor-supplied html pages?'
9089 vendorhtml3dir="$ans"
9090 vendorhtml3direxp="$ansexp"
9093 : Use ' ' for none so value is preserved next time through Configure
9094 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9095 : Change installation prefix, if necessary.
9096 if $test X"$prefix" != X"$installprefix"; then
9097 installvendorhtml3dir=`echo $vendorhtml3direxp | $sed "s#^$prefix#$installprefix#"`
9099 installvendorhtml3dir="$vendorhtml3direxp"
9102 case "$vendorprefix" in
9103 '') vendorman1dir=''
9106 *) : determine where vendor-supplied manual pages go.
9107 case "$vendorman1dir" in
9108 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9109 *) dflt=$vendorman1dir ;;
9112 ''|' ') dflt=none ;;
9115 rp='Pathname for the vendor-supplied manual section 1 pages?'
9117 vendorman1dir="$ans"
9118 vendorman1direxp="$ansexp"
9121 : Use ' ' for none so value is preserved next time through Configure
9122 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9123 : Change installation prefix, if necessary.
9124 if $test X"$prefix" != X"$installprefix"; then
9125 installvendorman1dir=`echo "$vendorman1direxp" | $sed "s#^$prefix#$installprefix#"`
9127 installvendorman1dir="$vendorman1direxp"
9130 case "$vendorprefix" in
9131 '') vendorman3dir=''
9134 *) : determine where vendor-supplied module manual pages go.
9135 case "$vendorman3dir" in
9136 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9137 *) dflt=$vendorman3dir ;;
9140 ''|' ') dflt=none ;;
9143 rp='Pathname for the vendor-supplied manual section 3 pages?'
9145 vendorman3dir="$ans"
9146 vendorman3direxp="$ansexp"
9149 : Use ' ' for none so value is preserved next time through Configure
9150 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9151 : Change installation prefix, if necessary.
9152 if $test X"$prefix" != X"$installprefix"; then
9153 installvendorman3dir=`echo "$vendorman3direxp" | $sed "s#^$prefix#$installprefix#"`
9155 installvendorman3dir="$vendorman3direxp"
9158 case "$vendorprefix" in
9159 '') d_vendorscript="$undef"
9163 *) d_vendorscript="$define"
9164 : determine where vendor-supplied scripts go.
9165 case "$vendorscript" in
9166 '') dflt=$vendorprefix/script
9167 $test -d $dflt || dflt=$vendorbin ;;
9168 *) dflt="$vendorscript" ;;
9172 The installation process will create a directory for
9173 vendor-supplied scripts.
9177 rp='Pathname for the vendor-supplied scripts directory?'
9180 vendorscriptexp="$ansexp"
9183 : Change installation prefix, if necessary.
9184 if $test X"$prefix" != X"$installprefix"; then
9185 installvendorscript=`echo $vendorscriptexp | $sed "s#^$prefix#$installprefix#"`
9187 installvendorscript="$vendorscriptexp"
9190 : see if qgcvt exists
9196 if $test X"$d_longdbl" = X"$define"; then
9198 echo "Checking how to print long doubles..." >&4
9200 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9201 $cat >try.c <<'EOCP'
9202 #include <sys/types.h>
9206 printf("%.3f\n", d);
9210 if eval $compile; then
9214 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9215 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9216 echo "We will use %f."
9222 if $test X"$sPRIfldbl" = X; then
9223 $cat >try.c <<'EOCP'
9224 #include <sys/types.h>
9227 long double d = 123.456;
9228 printf("%.3Lf\n", d);
9232 if eval $compile; then
9236 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9237 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9238 echo "We will use %Lf."
9244 if $test X"$sPRIfldbl" = X; then
9245 $cat >try.c <<'EOCP'
9246 #include <sys/types.h>
9249 long double d = 123.456;
9250 printf("%.3llf\n", d);
9254 if eval $compile; then
9258 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9259 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9260 echo "We will use %llf."
9266 if $test X"$sPRIfldbl" = X; then
9267 $cat >try.c <<'EOCP'
9268 #include <sys/types.h>
9271 long double d = 123.456;
9272 printf("%.3lf\n", d);
9276 if eval $compile; then
9280 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9281 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9282 echo "We will use %lf."
9288 if $test X"$sPRIfldbl" = X; then
9289 echo "Cannot figure out how to print long doubles." >&4
9291 sSCNfldbl=$sPRIfldbl # expect consistency
9298 case "$sPRIfldbl" in
9299 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9300 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9301 d_SCNfldbl="$undef";
9303 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9304 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9305 d_SCNfldbl="$define";
9309 : Check how to convert floats to strings.
9311 if test "X$d_Gconvert" = X; then
9314 echo "Checking for an efficient way to convert floats to strings."
9316 case "$uselongdouble" in
9317 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9319 case "$d_longdbl" in
9320 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9322 case "$d_PRIgldbl" in
9323 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9327 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9328 char *myname = "gconvert";
9331 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9332 char *myname = "gcvt";
9335 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9336 char *myname = "qgcvt";
9337 #define DOUBLETYPE long double
9340 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9342 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9344 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9347 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9349 char *myname = "sprintf";
9353 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9354 #define DOUBLETYPE long double
9356 #define DOUBLETYPE double
9362 #define I_STDLIB $i_stdlib
9368 checkit(expect, got)
9372 if (strcmp(expect, got)) {
9373 printf("%s oddity: Expected %s, got %s\n",
9374 myname, expect, got);
9384 /* This must be 1st test on (which?) platform */
9385 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9386 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9387 checkit("0.1", buf);
9389 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9390 checkit("0.01", buf);
9392 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9393 checkit("0.001", buf);
9395 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9396 checkit("0.0001", buf);
9398 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9399 if (strlen(buf) > 5)
9400 checkit("9e-005", buf); /* for Microsoft ?? */
9402 checkit("9e-05", buf);
9404 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9407 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9408 checkit("1.1", buf);
9410 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9411 checkit("1.01", buf);
9413 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9414 checkit("1.001", buf);
9416 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9417 checkit("1.0001", buf);
9419 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9420 checkit("1.00001", buf);
9422 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9423 checkit("1.000001", buf);
9425 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9428 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9431 /* Some Linux gcvt's give 1.e+5 here. */
9432 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9433 checkit("100000", buf);
9435 /* Some Linux gcvt's give -1.e+5 here. */
9436 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9437 checkit("-100000", buf);
9439 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9440 checkit("123.456", buf);
9442 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9443 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9444 /* 34 should be enough to scare even long double
9445 * places into using the e notation. */
9446 if (strlen(buf) > 5)
9447 checkit("1e+034", buf); /* for Microsoft */
9449 checkit("1e+34", buf);
9451 /* For Perl, if you add additional tests here, also add them to
9452 * t/base/num.t for benefit of platforms not using Configure or
9453 * overriding d_Gconvert */
9458 : first add preferred functions to our list
9460 for xxx_convert in $gconvert_preference; do
9461 case $xxx_convert in
9462 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9463 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9466 : then add any others
9467 for xxx_convert in gconvert gcvt sprintf; do
9470 *) xxx_list="$xxx_list $xxx_convert" ;;
9474 case "$d_longdbl$uselongdouble" in
9476 : again, add prefered functions to our list first
9478 for xxx_convert in $gconvert_ld_preference; do
9479 case $xxx_convert in
9480 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9481 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9484 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9485 for xxx_convert in qgcvt sprintf $xxx_list; do
9486 case "$xxx_ld_list" in
9487 $xxx_convert*|*" $xxx_convert"*) ;;
9488 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9491 : if sprintf cannot do long doubles, move it to the end
9492 if test "$d_PRIgldbl" != "$define"; then
9493 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9495 : if no qgcvt, remove it
9496 if test "$d_qgcvt" != "$define"; then
9497 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9500 xxx_list="$xxx_ld_list"
9504 for xxx_convert in $xxx_list; do
9505 echo "Trying $xxx_convert..."
9507 set try -DTRY_$xxx_convert
9508 if eval $compile; then
9509 echo "$xxx_convert() found." >&4
9511 echo "I'll use $xxx_convert to convert floats into a string." >&4
9514 echo "...But $xxx_convert didn't work as I expected."
9518 echo "$xxx_convert NOT found." >&4
9522 if test X$xxx_convert = X; then
9523 echo "*** WHOA THERE!!! ***" >&4
9524 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9528 case "$xxx_convert" in
9529 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9530 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9531 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9532 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9533 "$define$define$define")
9534 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9535 "$define$define$undef")
9536 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9537 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9544 : see if _fwalk exists
9548 : Initialize h_fcntl
9551 : Initialize h_sysfile
9554 : access call always available on UNIX
9558 : locate the flags for 'access()'
9562 $cat >access.c <<EOCP
9563 #include <sys/types.h>
9568 #include <sys/file.h>
9581 : check sys/file.h first, no particular reason here
9582 if $test `./findhdr sys/file.h` && \
9583 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9585 echo "<sys/file.h> defines the *_OK access constants." >&4
9586 elif $test `./findhdr fcntl.h` && \
9587 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9589 echo "<fcntl.h> defines the *_OK access constants." >&4
9590 elif $test `./findhdr unistd.h` && \
9591 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9592 echo "<unistd.h> defines the *_OK access constants." >&4
9594 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9600 : see if accessx exists
9601 set accessx d_accessx
9604 : see if aintl exists
9608 : see if alarm exists
9612 : see if POSIX threads are available
9613 set pthread.h i_pthread
9616 : define a fucntion to check prototypes
9617 $cat > protochk <<EOSH
9620 optimize="$optimize"
9622 prototype="$prototype"
9625 usethreads=$usethreads
9626 i_pthread=$i_pthread
9627 pthread_h_first=$pthread_h_first
9630 $cat >> protochk <<'EOSH'
9635 while test $# -ge 2; do
9637 $define) echo "#include <$2>" >> try.c ;;
9638 literal) echo "$2" >> try.c ;;
9640 # Extra magic for the benefit of systems that need pthread.h
9641 # to be included early to correctly detect threadsafe functions.
9642 # Such functions must guarantee themselves, though, that the usethreads
9643 # and i_pthread have been defined, before calling protochk.
9644 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
9645 echo "#include <pthread.h>" >> try.c
9650 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
9651 cat >> try.c <<'EOCP'
9652 #ifdef CAN_PROTOTYPE
9653 #define _(args) args
9658 echo "$foo" >> try.c
9659 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
9660 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
9668 hasproto='varname=$1; func=$2; shift; shift;
9669 while $test $# -ge 2; do
9671 $define) echo "#include <$2>";;
9675 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
9676 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
9677 echo "$func() prototype found.";
9680 echo "$func() prototype NOT found.";
9685 $rm -f try.c tryout.c'
9687 : see if sys/types.h has to be included
9688 set sys/types.h i_systypes
9691 : see if sys/select.h has to be included
9692 set sys/select.h i_sysselct
9695 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
9696 while $test $# -ge 2; do
9698 $define) echo "#include <$2>";;
9702 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
9704 if eval $compile; then
9713 : see if we should include time.h, sys/time.h, or both
9715 if test "X$timeincl" = X; then
9716 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9717 $echo $n "I'm now running the test program...$c"
9719 #include <sys/types.h>
9724 #ifdef SYSTIMEKERNEL
9727 #include <sys/time.h>
9730 #include <sys/select.h>
9743 struct timezone tzp;
9745 if (foo.tm_sec == foo.tm_sec)
9748 if (bar.tv_sec == bar.tv_sec)
9755 for s_timezone in '-DS_TIMEZONE' ''; do
9757 for s_timeval in '-DS_TIMEVAL' ''; do
9758 for i_systimek in '' '-DSYSTIMEKERNEL'; do
9759 for i_time in '' '-DI_TIME'; do
9760 for i_systime in '-DI_SYSTIME' ''; do
9763 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
9764 if eval $compile; then
9765 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
9769 $echo $n "Succeeded with $flags$c"
9781 *SYSTIMEKERNEL*) i_systimek="$define"
9782 timeincl=`./findhdr sys/time.h`
9783 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
9784 *) i_systimek="$undef";;
9787 *I_TIME*) i_time="$define"
9788 timeincl=`./findhdr time.h`" $timeincl"
9789 echo "We'll include <time.h>." >&4;;
9790 *) i_time="$undef";;
9793 *I_SYSTIME*) i_systime="$define"
9794 timeincl=`./findhdr sys/time.h`" $timeincl"
9795 echo "We'll include <sys/time.h>." >&4;;
9796 *) i_systime="$undef";;
9800 : see if struct tm knows about tm_zone
9801 case "$i_systime$i_time" in
9804 echo "Checking to see if your struct tm has tm_zone field..." >&4
9805 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
9813 case "$d_tm_tm_zone" in
9814 "$define") echo "Yes, it does." ;;
9815 *) echo "No, it doesn't." ;;
9817 : see if struct tm knows about tm_gmtoff
9818 case "$i_systime$i_time" in
9821 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
9822 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
9830 case "$d_tm_tm_gmtoff" in
9831 "$define") echo "Yes, it does." ;;
9832 *) echo "No, it doesn't." ;;
9835 : see if asctime_r exists
9836 set asctime_r d_asctime_r
9838 case "$d_asctime_r" in
9840 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
9841 case "$d_asctime_r_proto:$usethreads" in
9842 ":define") d_asctime_r_proto=define
9843 set d_asctime_r_proto asctime_r $hdrs
9847 case "$d_asctime_r_proto" in
9849 case "$asctime_r_proto" in
9850 ''|0) try='char* asctime_r(const struct tm*, char*);'
9851 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SB ;;
9853 case "$asctime_r_proto" in
9854 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
9855 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SBI ;;
9857 case "$asctime_r_proto" in
9858 ''|0) try='int asctime_r(const struct tm*, char*);'
9859 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SB ;;
9861 case "$asctime_r_proto" in
9862 ''|0) try='int asctime_r(const struct tm*, char*, int);'
9863 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SBI ;;
9865 case "$asctime_r_proto" in
9866 ''|0) d_asctime_r=undef
9868 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
9869 * ) case "$asctime_r_proto" in
9870 REENTRANT_PROTO*) ;;
9871 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
9873 echo "Prototype: $try" ;;
9876 *) case "$usethreads" in
9877 define) echo "asctime_r has no prototype, not using it." >&4 ;;
9884 *) asctime_r_proto=0
9888 : see if atolf exists
9892 : see if atoll exists
9896 : Look for GCC-style attribute format
9897 case "$d_attribute_format" in
9900 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
9901 $cat >attrib.c <<'EOCP'
9903 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
9905 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9906 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9907 echo "Your C compiler doesn't support __attribute__((format))."
9910 echo "Your C compiler supports __attribute__((format))."
9914 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9918 *) val="$d_attribute_format" ;;
9920 set d_attribute_format
9924 : Look for GCC-style attribute malloc
9925 case "$d_attribute_malloc" in
9928 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
9929 $cat >attrib.c <<'EOCP'
9931 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
9933 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9934 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9935 echo "Your C compiler doesn't support __attribute__((malloc))."
9938 echo "Your C compiler supports __attribute__((malloc))."
9942 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9946 *) val="$d_attribute_malloc" ;;
9948 set d_attribute_malloc
9952 : Look for GCC-style attribute nonnull
9953 case "$d_attribute_nonnull" in
9956 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
9957 $cat >attrib.c <<'EOCP'
9959 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
9961 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9962 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9963 echo "Your C compiler doesn't support __attribute__((nonnull))."
9966 echo "Your C compiler supports __attribute__((nonnull))."
9970 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9974 *) val="$d_attribute_nonnull" ;;
9976 set d_attribute_nonnull
9980 : Look for GCC-style attribute noreturn
9981 case "$d_attribute_noreturn" in
9984 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
9985 $cat >attrib.c <<'EOCP'
9987 void fall_over_dead( void ) __attribute__((noreturn));
9989 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9990 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9991 echo "Your C compiler doesn't support __attribute__((noreturn))."
9994 echo "Your C compiler supports __attribute__((noreturn))."
9998 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10002 *) val="$d_attribute_noreturn" ;;
10004 set d_attribute_noreturn
10008 : Look for GCC-style attribute pure
10009 case "$d_attribute_pure" in
10012 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10013 $cat >attrib.c <<'EOCP'
10015 int square( int n ) __attribute__((pure));
10017 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10018 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10019 echo "Your C compiler doesn't support __attribute__((pure))."
10022 echo "Your C compiler supports __attribute__((pure))."
10026 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10030 *) val="$d_attribute_pure" ;;
10032 set d_attribute_pure
10036 : Look for GCC-style attribute unused
10037 case "$d_attribute_unused" in
10040 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10041 $cat >attrib.c <<'EOCP'
10043 int do_something( int dummy __attribute__((unused)), int n );
10045 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10046 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10047 echo "Your C compiler doesn't support __attribute__((unused))."
10050 echo "Your C compiler supports __attribute__((unused))."
10054 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10058 *) val="$d_attribute_unused" ;;
10060 set d_attribute_unused
10064 : Look for GCC-style attribute warn_unused_result
10065 case "$d_attribute_warn_unused_result" in
10068 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10069 $cat >attrib.c <<'EOCP'
10071 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10073 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10074 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10075 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10078 echo "Your C compiler supports __attribute__((warn_unused_result))."
10082 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10086 *) val="$d_attribute_warn_unused_result" ;;
10088 set d_attribute_warn_unused_result
10092 : see if bcmp exists
10096 : see if bcopy exists
10100 : see if this is a unistd.h system
10101 set unistd.h i_unistd
10104 : see if getpgrp exists
10105 set getpgrp d_getpgrp
10108 case "$d_getpgrp" in
10111 echo "Checking to see which flavor of getpgrp is in use..."
10113 #$i_unistd I_UNISTD
10114 #include <sys/types.h>
10116 # include <unistd.h>
10118 #$i_stdlib I_STDLIB
10120 #include <stdlib.h>
10124 if (getuid() == 0) {
10125 printf("(I see you are running Configure as super-user...)\n");
10128 #ifdef TRY_BSD_PGRP
10129 if (getpgrp(1) == 0)
10138 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10139 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10141 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10142 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10145 echo "I can't seem to compile and run the test program."
10147 xxx="a USG one, i.e. you use getpgrp()."
10149 # SVR4 systems can appear rather BSD-ish.
10150 case "$i_unistd" in
10152 xxx="a BSD one, i.e. you use getpgrp(pid)."
10156 xxx="probably a USG one, i.e. you use getpgrp()."
10161 echo "Assuming your getpgrp is $xxx" >&4
10170 : see if setpgrp exists
10171 set setpgrp d_setpgrp
10174 case "$d_setpgrp" in
10177 echo "Checking to see which flavor of setpgrp is in use..."
10179 #$i_unistd I_UNISTD
10180 #include <sys/types.h>
10182 # include <unistd.h>
10184 #$i_stdlib I_STDLIB
10186 #include <stdlib.h>
10190 if (getuid() == 0) {
10191 printf("(I see you are running Configure as super-user...)\n");
10194 #ifdef TRY_BSD_PGRP
10195 if (-1 == setpgrp(1, 1))
10198 if (setpgrp() != -1)
10204 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10205 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10207 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10208 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10211 echo "(I can't seem to compile and run the test program.)"
10213 xxx="a USG one, i.e. you use setpgrp()."
10215 # SVR4 systems can appear rather BSD-ish.
10216 case "$i_unistd" in
10218 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10222 xxx="probably a USG one, i.e. you use setpgrp()."
10227 echo "Assuming your setpgrp is $xxx" >&4
10235 : see if bzero exists
10239 : see if signal is declared as pointer to function returning int or void
10241 xxx=`./findhdr signal.h`
10242 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10243 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10244 echo "You have int (*signal())() instead of void." >&4
10246 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10247 echo "You have void (*signal())()." >&4
10249 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10250 echo "You have int (*signal())() instead of void." >&4
10252 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10253 echo "You have void (*signal())()." >&4
10256 case "$d_voidsig" in
10258 echo "I can't determine whether signal handler returns void or int..." >&4
10260 rp="What type does your signal handler return?"
10263 v*) val="$define";;
10267 echo "As you already told me, signal handler returns void." >&4
10270 *) echo "As you already told me, signal handler returns int." >&4
10277 case "$d_voidsig" in
10278 "$define") signal_t="void";;
10279 *) signal_t="int";;
10283 : check for ability to cast large floats to 32-bit ints.
10285 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10286 if $test "$intsize" -ge 4; then
10293 #$i_stdlib I_STDLIB
10295 #include <stdlib.h>
10297 #include <sys/types.h>
10298 #include <signal.h>
10299 $signal_t blech(s) int s; { exit(3); }
10306 signal(SIGFPE, blech);
10308 /* Don't let compiler optimize the test away. Store the number
10309 in a writable string for gcc to pass to sscanf under HP/UX.
10311 sprintf(str, "2147483647");
10312 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
10316 /* x86 processors will probably give 0x8000 0000, which is a
10317 sign change. We don't want that. We want to mimic SPARC
10318 behavior here, which is to preserve the sign and give
10321 if (i32 != ($xxx) f)
10327 if eval $compile_ok; then
10331 echo "(I can't seem to compile the test program--assuming it can't)"
10336 echo "Yup, it can."
10339 echo "Nope, it can't."
10346 : check for ability to cast negative floats to unsigned
10348 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
10351 #$i_stdlib I_STDLIB
10353 #include <stdlib.h>
10355 #include <sys/types.h>
10356 #include <signal.h>
10357 $signal_t blech(s) int s; { exit(7); }
10358 $signal_t blech_in_list(s) int s; { exit(4); }
10359 unsigned long dummy_long(p) unsigned long p; { return p; }
10360 unsigned int dummy_int(p) unsigned int p; { return p; }
10361 unsigned short dummy_short(p) unsigned short p; { return p; }
10365 unsigned long along;
10367 unsigned short ashort;
10371 /* Frustrate gcc-2.7.2's optimizer which failed this test with
10372 a direct f = -123. assignment. gcc-2.8.0 reportedly
10373 optimized the whole file away
10375 /* Store the number in a writable string for gcc to pass to
10376 sscanf under HP/UX.
10378 sprintf(str, "-123");
10379 sscanf(str, "%lf", &f); /* f = -123.; */
10381 signal(SIGFPE, blech);
10382 along = (unsigned long)f;
10383 aint = (unsigned int)f;
10384 ashort = (unsigned short)f;
10385 if (along != (unsigned long)-123)
10387 if (aint != (unsigned int)-123)
10389 if (ashort != (unsigned short)-123)
10391 sprintf(str, "1073741824.");
10392 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
10395 along = (unsigned long)f;
10396 if (along != 0x80000000)
10400 along = (unsigned long)f;
10401 if (along != 0x7fffffff)
10405 along = (unsigned long)f;
10406 if (along != 0x80000001)
10410 signal(SIGFPE, blech_in_list);
10411 sprintf(str, "123.");
10412 sscanf(str, "%lf", &f); /* f = 123.; */
10413 along = dummy_long((unsigned long)f);
10414 aint = dummy_int((unsigned int)f);
10415 ashort = dummy_short((unsigned short)f);
10416 if (along != (unsigned long)123)
10418 if (aint != (unsigned int)123)
10420 if (ashort != (unsigned short)123)
10427 if eval $compile_ok; then
10431 echo "(I can't seem to compile the test program--assuming it can't)"
10434 case "$castflags" in
10436 echo "Yup, it can."
10439 echo "Nope, it can't."
10446 : see if vprintf exists
10448 if set vprintf val -f d_vprintf; eval $csym; $val; then
10449 echo 'vprintf() found.' >&4
10452 #include <varargs.h>
10453 #$i_stdlib I_STDLIB
10455 #include <stdlib.h>
10458 int main() { xxx("foo"); }
10467 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
10471 if eval $compile && $run ./try; then
10472 echo "Your vsprintf() returns (int)." >&4
10475 echo "Your vsprintf() returns (char*)." >&4
10479 echo 'vprintf() NOT found.' >&4
10490 : see if chown exists
10494 : see if chroot exists
10495 set chroot d_chroot
10498 : see if chsize exists
10499 set chsize d_chsize
10502 : see if class exists
10506 hasstruct='varname=$1; struct=$2; shift; shift;
10507 while $test $# -ge 2; do
10509 $define) echo "#include <$2>";;
10513 echo "int main () { struct $struct foo; }" >> try.c;
10515 if eval $compile; then
10522 $rm -f try.c try.o'
10526 : see whether socket exists
10528 $echo $n "Hmm... $c" >&4
10529 if set socket val -f d_socket; eval $csym; $val; then
10530 echo "Looks like you have Berkeley networking support." >&4
10532 if set setsockopt val -f; eval $csym; $val; then
10535 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
10536 d_oldsock="$define"
10539 if $contains socklib libc.list >/dev/null 2>&1; then
10540 echo "Looks like you have Berkeley networking support." >&4
10542 : we will have to assume that it supports the 4.2 BSD interface
10545 echo "You don't have Berkeley networking in libc$_a..." >&4
10546 if test "X$d_socket" = "X$define"; then
10547 echo "...but you seem to believe that you have sockets." >&4
10549 for net in net socket
10551 if test -f /usr/lib/lib$net$_a; then
10552 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
10553 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
10554 if $contains socket libc.list >/dev/null 2>&1; then
10559 echo "...but the Wollongong group seems to have hacked it in." >&4
10560 sockethdr="-I/usr/netinclude"
10563 echo "Found Berkeley sockets interface in lib$net." >&4
10564 if $contains setsockopt libc.list >/dev/null 2>&1; then
10567 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
10568 d_oldsock="$define"
10574 if test "X$d_socket" != "X$define"; then
10575 echo "or anywhere else I see." >&4
10583 : see if socketpair exists
10584 set socketpair d_sockpair
10589 echo "Checking the availability of certain socket constants..." >&4
10590 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
10591 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
10593 #include <sys/types.h>
10594 #include <sys/socket.h>
10600 set try; if eval $compile; then
10603 set d_${enum}; eval $setvar
10607 : see if this is a sys/uio.h system
10608 set sys/uio.h i_sysuio
10613 echo "Checking to see if your system supports struct cmsghdr..." >&4
10614 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
10616 case "$d_cmsghdr_s" in
10617 "$define") echo "Yes, it does." ;;
10618 *) echo "No, it doesn't." ;;
10622 : check for const keyword
10624 echo 'Checking to see if your C compiler knows about "const"...' >&4
10625 $cat >const.c <<'EOCP'
10626 typedef struct spug { int drokk; } spug;
10633 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
10635 echo "Yup, it does."
10638 echo "Nope, it doesn't."
10643 : see if copysignl exists
10644 set copysignl d_copysignl
10647 : see if crypt exists
10652 $define) cryptlib='' ;;
10653 *) if set crypt val -f d_crypt; eval $csym; $val; then
10654 echo 'crypt() found.' >&4
10658 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
10659 if $test -z "$cryptlib"; then
10660 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
10664 if $test -z "$cryptlib"; then
10665 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
10669 if $test -z "$cryptlib"; then
10670 cryptlib=`./loc libcrypt$_a "" $libpth`
10674 if $test -z "$cryptlib"; then
10675 echo 'crypt() NOT found.' >&4
10686 : see if this is a crypt.h system
10687 set crypt.h i_crypt
10690 : see if crypt_r exists
10691 set crypt_r d_crypt_r
10693 case "$d_crypt_r" in
10695 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
10696 case "$d_crypt_r_proto:$usethreads" in
10697 ":define") d_crypt_r_proto=define
10698 set d_crypt_r_proto crypt_r $hdrs
10702 case "$d_crypt_r_proto" in
10704 case "$crypt_r_proto" in
10705 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
10706 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCS ;;
10708 case "$crypt_r_proto" in
10709 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
10710 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCD ;;
10712 case "$crypt_r_proto" in
10713 ''|0) d_crypt_r=undef
10715 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
10716 * ) case "$crypt_r_proto" in
10717 REENTRANT_PROTO*) ;;
10718 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
10720 echo "Prototype: $try" ;;
10723 *) case "$usethreads" in
10724 define) echo "crypt_r has no prototype, not using it." >&4 ;;
10735 : get csh whereabouts
10737 'csh') val="$undef" ;;
10738 *) val="$define" ;;
10742 : Respect a hint or command line value for full_csh.
10743 case "$full_csh" in
10744 '') full_csh=$csh ;;
10747 : see if ctermid_r exists
10748 set ctermid_r d_ctermid_r
10750 case "$d_ctermid_r" in
10752 hdrs="$i_systypes sys/types.h define stdio.h "
10753 case "$d_ctermid_r_proto:$usethreads" in
10754 ":define") d_ctermid_r_proto=define
10755 set d_ctermid_r_proto ctermid_r $hdrs
10759 case "$d_ctermid_r_proto" in
10761 case "$ctermid_r_proto" in
10762 ''|0) try='char* ctermid_r(char*);'
10763 ./protochk "extern $try" $hdrs && ctermid_r_proto=B_B ;;
10765 case "$ctermid_r_proto" in
10766 ''|0) d_ctermid_r=undef
10768 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
10769 * ) case "$ctermid_r_proto" in
10770 REENTRANT_PROTO*) ;;
10771 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
10773 echo "Prototype: $try" ;;
10776 *) case "$usethreads" in
10777 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
10784 *) ctermid_r_proto=0
10788 : see if ctime_r exists
10789 set ctime_r d_ctime_r
10791 case "$d_ctime_r" in
10793 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10794 case "$d_ctime_r_proto:$usethreads" in
10795 ":define") d_ctime_r_proto=define
10796 set d_ctime_r_proto ctime_r $hdrs
10800 case "$d_ctime_r_proto" in
10802 case "$ctime_r_proto" in
10803 ''|0) try='char* ctime_r(const time_t*, char*);'
10804 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SB ;;
10806 case "$ctime_r_proto" in
10807 ''|0) try='char* ctime_r(const time_t*, char*, int);'
10808 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SBI ;;
10810 case "$ctime_r_proto" in
10811 ''|0) try='int ctime_r(const time_t*, char*);'
10812 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SB ;;
10814 case "$ctime_r_proto" in
10815 ''|0) try='int ctime_r(const time_t*, char*, int);'
10816 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SBI ;;
10818 case "$ctime_r_proto" in
10819 ''|0) d_ctime_r=undef
10821 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
10822 * ) case "$ctime_r_proto" in
10823 REENTRANT_PROTO*) ;;
10824 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
10826 echo "Prototype: $try" ;;
10829 *) case "$usethreads" in
10830 define) echo "ctime_r has no prototype, not using it." >&4 ;;
10841 : see if cuserid exists
10842 set cuserid d_cuserid
10845 : see if this is a limits.h system
10846 set limits.h i_limits
10849 : see if this is a float.h system
10850 set float.h i_float
10853 : See if number of significant digits in a double precision number is known
10855 $cat >dbl_dig.c <<EOM
10856 #$i_limits I_LIMITS
10859 #include <limits.h>
10865 printf("Contains DBL_DIG");
10868 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
10869 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
10870 echo "DBL_DIG found." >&4
10873 echo "DBL_DIG NOT found." >&4
10880 : see if dbm.h is available
10881 : see if dbmclose exists
10882 set dbmclose d_dbmclose
10885 case "$d_dbmclose" in
10895 *) set rpcsvc/dbm.h i_rpcsvcdbm
10900 *) echo "We won't be including <dbm.h>"
10910 : see if prototype for dbminit is available
10912 set d_dbminitproto dbminit $i_dbm dbm.h
10915 : see if difftime exists
10916 set difftime d_difftime
10919 : see if this is a dirent system
10921 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
10923 echo "<dirent.h> found." >&4
10926 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
10927 echo "<sys/dir.h> found." >&4
10930 xinc=`./findhdr sys/ndir.h`
10932 echo "<dirent.h> NOT found." >&4
10937 : Look for type of directory structure.
10939 $cppstdin $cppflags $cppminus < "$xinc" > try.c
10941 case "$direntrytype" in
10943 case "$i_dirent" in
10944 $define) guess1='struct dirent' ;;
10945 *) guess1='struct direct' ;;
10948 *) guess1="$direntrytype"
10953 'struct dirent') guess2='struct direct' ;;
10954 *) guess2='struct dirent' ;;
10957 if $contains "$guess1" try.c >/dev/null 2>&1; then
10958 direntrytype="$guess1"
10959 echo "Your directory entries are $direntrytype." >&4
10960 elif $contains "$guess2" try.c >/dev/null 2>&1; then
10961 direntrytype="$guess2"
10962 echo "Your directory entries seem to be $direntrytype." >&4
10964 echo "I don't recognize your system's directory entries." >&4
10965 rp="What type is used for directory entries on this system?"
10968 direntrytype="$ans"
10973 : see if the directory entry stores field length
10975 $cppstdin $cppflags $cppminus < "$xinc" > try.c
10976 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
10977 echo "Good, your directory entry keeps length information in d_namlen." >&4
10980 echo "Your directory entry does not know about the d_namlen field." >&4
10987 : see if this is an sysdir system
10988 set sys/dir.h i_sysdir
10991 : see if this is an sysndir system
10992 set sys/ndir.h i_sysndir
10997 $cat >dirfd.c <<EOM
10999 #$i_stdlib I_STDLIB
11001 #include <stdlib.h>
11003 #$i_dirent I_DIRENT /**/
11004 #$i_sysdir I_SYS_DIR /**/
11005 #$i_sysndir I_SYS_NDIR /**/
11006 #$i_systypes I_SYS_TYPES /**/
11007 #if defined(I_SYS_TYPES)
11008 #include <sys/types.h>
11010 #if defined(I_DIRENT)
11011 #include <dirent.h>
11012 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11013 #include <sys/dir.h>
11017 #include <sys/ndir.h>
11021 #include <ndir.h> /* may be wrong in the future */
11023 #include <sys/dir.h>
11029 DIR *dirp = opendir(".");
11030 if (dirfd(dirp) >= 0)
11038 if eval $compile; then
11042 $define) echo "dirfd() found." >&4 ;;
11043 *) echo "dirfd() NOT found." >&4 ;;
11049 : see if dlerror exists
11052 set dlerror d_dlerror
11056 : see if dlfcn is available
11057 set dlfcn.h i_dlfcn
11064 On a few systems, the dynamically loaded modules that perl generates and uses
11065 will need a different extension than shared libs. The default will probably
11071 *) dflt="$dlext" ;;
11073 rp='What is the extension of dynamically loaded modules'
11082 : Check if dlsym need a leading underscore
11088 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11089 $cat >dyna.c <<'EOM'
11096 #$i_stdlib I_STDLIB
11098 #include <stdlib.h>
11102 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
11104 #include <sys/types.h>
11109 extern int fred() ;
11118 int mode = RTLD_LAZY ;
11120 handle = dlopen("./dyna.$dlext", mode) ;
11121 if (handle == NULL) {
11126 symbol = dlsym(handle, "fred") ;
11127 if (symbol == NULL) {
11128 /* try putting a leading underscore */
11129 symbol = dlsym(handle, "_fred") ;
11130 if (symbol == NULL) {
11143 : Call the object file tmp-dyna.o in case dlext=o.
11144 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
11145 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
11146 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
11147 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
11150 1) echo "Test program failed using dlopen." >&4
11151 echo "Perhaps you should not use dynamic loading." >&4;;
11152 2) echo "Test program failed using dlsym." >&4
11153 echo "Perhaps you should not use dynamic loading." >&4;;
11154 3) echo "dlsym needs a leading underscore" >&4
11156 4) echo "dlsym doesn't need a leading underscore." >&4;;
11159 echo "I can't compile and run the test program." >&4
11160 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
11165 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
11170 : see if drand48_r exists
11171 set drand48_r d_drand48_r
11173 case "$d_drand48_r" in
11175 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
11176 case "$d_drand48_r_proto:$usethreads" in
11177 ":define") d_drand48_r_proto=define
11178 set d_drand48_r_proto drand48_r $hdrs
11182 case "$d_drand48_r_proto" in
11184 case "$drand48_r_proto" in
11185 ''|0) try='int drand48_r(struct drand48_data*, double*);'
11186 ./protochk "extern $try" $hdrs && drand48_r_proto=I_ST ;;
11188 case "$drand48_r_proto" in
11189 ''|0) d_drand48_r=undef
11191 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
11192 * ) case "$drand48_r_proto" in
11193 REENTRANT_PROTO*) ;;
11194 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
11196 echo "Prototype: $try" ;;
11199 *) case "$usethreads" in
11200 define) echo "drand48_r has no prototype, not using it." >&4 ;;
11207 *) drand48_r_proto=0
11211 : see if prototype for drand48 is available
11213 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
11216 : see if dup2 exists
11220 : see if eaccess exists
11221 set eaccess d_eaccess
11224 : see if endgrent exists
11225 set endgrent d_endgrent
11228 : see if this is an grp system
11234 xxx=`./findhdr grp.h`
11235 $cppstdin $cppflags $cppminus < $xxx >$$.h
11237 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
11249 set d_grpasswd; eval $setvar
11253 : see if endgrent_r exists
11254 set endgrent_r d_endgrent_r
11256 case "$d_endgrent_r" in
11258 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11259 case "$d_endgrent_r_proto:$usethreads" in
11260 ":define") d_endgrent_r_proto=define
11261 set d_endgrent_r_proto endgrent_r $hdrs
11265 case "$d_endgrent_r_proto" in
11267 case "$endgrent_r_proto" in
11268 ''|0) try='int endgrent_r(FILE**);'
11269 ./protochk "extern $try" $hdrs && endgrent_r_proto=I_H ;;
11271 case "$endgrent_r_proto" in
11272 ''|0) try='void endgrent_r(FILE**);'
11273 ./protochk "extern $try" $hdrs && endgrent_r_proto=V_H ;;
11275 case "$endgrent_r_proto" in
11276 ''|0) d_endgrent_r=undef
11278 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
11279 * ) case "$endgrent_r_proto" in
11280 REENTRANT_PROTO*) ;;
11281 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
11283 echo "Prototype: $try" ;;
11286 *) case "$usethreads" in
11287 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
11294 *) endgrent_r_proto=0
11298 : see if endhostent exists
11299 set endhostent d_endhent
11302 : see if this is a netdb.h system
11303 set netdb.h i_netdb
11306 : see if endhostent_r exists
11307 set endhostent_r d_endhostent_r
11309 case "$d_endhostent_r" in
11311 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11312 case "$d_endhostent_r_proto:$usethreads" in
11313 ":define") d_endhostent_r_proto=define
11314 set d_endhostent_r_proto endhostent_r $hdrs
11318 case "$d_endhostent_r_proto" in
11320 case "$endhostent_r_proto" in
11321 ''|0) try='int endhostent_r(struct hostent_data*);'
11322 ./protochk "extern $try" $hdrs && endhostent_r_proto=I_D ;;
11324 case "$endhostent_r_proto" in
11325 ''|0) try='void endhostent_r(struct hostent_data*);'
11326 ./protochk "extern $try" $hdrs && endhostent_r_proto=V_D ;;
11328 case "$endhostent_r_proto" in
11329 ''|0) d_endhostent_r=undef
11330 endhostent_r_proto=0
11331 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
11332 * ) case "$endhostent_r_proto" in
11333 REENTRANT_PROTO*) ;;
11334 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
11336 echo "Prototype: $try" ;;
11339 *) case "$usethreads" in
11340 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
11342 d_endhostent_r=undef
11343 endhostent_r_proto=0
11347 *) endhostent_r_proto=0
11351 : see if endnetent exists
11352 set endnetent d_endnent
11355 : see if endnetent_r exists
11356 set endnetent_r d_endnetent_r
11358 case "$d_endnetent_r" in
11360 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11361 case "$d_endnetent_r_proto:$usethreads" in
11362 ":define") d_endnetent_r_proto=define
11363 set d_endnetent_r_proto endnetent_r $hdrs
11367 case "$d_endnetent_r_proto" in
11369 case "$endnetent_r_proto" in
11370 ''|0) try='int endnetent_r(struct netent_data*);'
11371 ./protochk "extern $try" $hdrs && endnetent_r_proto=I_D ;;
11373 case "$endnetent_r_proto" in
11374 ''|0) try='void endnetent_r(struct netent_data*);'
11375 ./protochk "extern $try" $hdrs && endnetent_r_proto=V_D ;;
11377 case "$endnetent_r_proto" in
11378 ''|0) d_endnetent_r=undef
11379 endnetent_r_proto=0
11380 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
11381 * ) case "$endnetent_r_proto" in
11382 REENTRANT_PROTO*) ;;
11383 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
11385 echo "Prototype: $try" ;;
11388 *) case "$usethreads" in
11389 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
11391 d_endnetent_r=undef
11392 endnetent_r_proto=0
11396 *) endnetent_r_proto=0
11400 : see if endprotoent exists
11401 set endprotoent d_endpent
11404 : see if endprotoent_r exists
11405 set endprotoent_r d_endprotoent_r
11407 case "$d_endprotoent_r" in
11409 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11410 case "$d_endprotoent_r_proto:$usethreads" in
11411 ":define") d_endprotoent_r_proto=define
11412 set d_endprotoent_r_proto endprotoent_r $hdrs
11416 case "$d_endprotoent_r_proto" in
11418 case "$endprotoent_r_proto" in
11419 ''|0) try='int endprotoent_r(struct protoent_data*);'
11420 ./protochk "extern $try" $hdrs && endprotoent_r_proto=I_D ;;
11422 case "$endprotoent_r_proto" in
11423 ''|0) try='void endprotoent_r(struct protoent_data*);'
11424 ./protochk "extern $try" $hdrs && endprotoent_r_proto=V_D ;;
11426 case "$endprotoent_r_proto" in
11427 ''|0) d_endprotoent_r=undef
11428 endprotoent_r_proto=0
11429 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
11430 * ) case "$endprotoent_r_proto" in
11431 REENTRANT_PROTO*) ;;
11432 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
11434 echo "Prototype: $try" ;;
11437 *) case "$usethreads" in
11438 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
11440 d_endprotoent_r=undef
11441 endprotoent_r_proto=0
11445 *) endprotoent_r_proto=0
11449 : see if endpwent exists
11450 set endpwent d_endpwent
11453 : see if this is a pwd.h system
11459 xxx=`./findhdr pwd.h`
11460 $cppstdin $cppflags $cppminus < $xxx >$$.h
11462 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
11470 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
11478 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
11486 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
11494 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
11502 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
11510 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
11518 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
11530 set d_pwquota; eval $setvar
11531 set d_pwage; eval $setvar
11532 set d_pwchange; eval $setvar
11533 set d_pwclass; eval $setvar
11534 set d_pwexpire; eval $setvar
11535 set d_pwcomment; eval $setvar
11536 set d_pwgecos; eval $setvar
11537 set d_pwpasswd; eval $setvar
11541 : see if endpwent_r exists
11542 set endpwent_r d_endpwent_r
11544 case "$d_endpwent_r" in
11546 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
11547 case "$d_endpwent_r_proto:$usethreads" in
11548 ":define") d_endpwent_r_proto=define
11549 set d_endpwent_r_proto endpwent_r $hdrs
11553 case "$d_endpwent_r_proto" in
11555 case "$endpwent_r_proto" in
11556 ''|0) try='int endpwent_r(FILE**);'
11557 ./protochk "extern $try" $hdrs && endpwent_r_proto=I_H ;;
11559 case "$endpwent_r_proto" in
11560 ''|0) try='void endpwent_r(FILE**);'
11561 ./protochk "extern $try" $hdrs && endpwent_r_proto=V_H ;;
11563 case "$endpwent_r_proto" in
11564 ''|0) d_endpwent_r=undef
11566 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
11567 * ) case "$endpwent_r_proto" in
11568 REENTRANT_PROTO*) ;;
11569 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
11571 echo "Prototype: $try" ;;
11574 *) case "$usethreads" in
11575 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
11582 *) endpwent_r_proto=0
11586 : see if endservent exists
11587 set endservent d_endsent
11590 : see if endservent_r exists
11591 set endservent_r d_endservent_r
11593 case "$d_endservent_r" in
11595 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11596 case "$d_endservent_r_proto:$usethreads" in
11597 ":define") d_endservent_r_proto=define
11598 set d_endservent_r_proto endservent_r $hdrs
11602 case "$d_endservent_r_proto" in
11604 case "$endservent_r_proto" in
11605 ''|0) try='int endservent_r(struct servent_data*);'
11606 ./protochk "extern $try" $hdrs && endservent_r_proto=I_D ;;
11608 case "$endservent_r_proto" in
11609 ''|0) try='void endservent_r(struct servent_data*);'
11610 ./protochk "extern $try" $hdrs && endservent_r_proto=V_D ;;
11612 case "$endservent_r_proto" in
11613 ''|0) d_endservent_r=undef
11614 endservent_r_proto=0
11615 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
11616 * ) case "$endservent_r_proto" in
11617 REENTRANT_PROTO*) ;;
11618 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
11620 echo "Prototype: $try" ;;
11623 *) case "$usethreads" in
11624 define) echo "endservent_r has no prototype, not using it." >&4 ;;
11626 d_endservent_r=undef
11627 endservent_r_proto=0
11631 *) endservent_r_proto=0
11635 : Locate the flags for 'open()'
11638 #include <sys/types.h>
11643 #include <sys/file.h>
11645 #$i_stdlib I_STDLIB
11647 #include <stdlib.h>
11658 : check sys/file.h first to get FREAD on Sun
11659 if $test `./findhdr sys/file.h` && \
11660 set try -DI_SYS_FILE && eval $compile; then
11662 echo "<sys/file.h> defines the O_* constants..." >&4
11663 if $run ./try; then
11664 echo "and you have the 3 argument form of open()." >&4
11667 echo "but not the 3 argument form of open(). Oh, well." >&4
11670 elif $test `./findhdr fcntl.h` && \
11671 set try -DI_FCNTL && eval $compile; then
11673 echo "<fcntl.h> defines the O_* constants..." >&4
11674 if $run ./try; then
11675 echo "and you have the 3 argument form of open()." >&4
11678 echo "but not the 3 argument form of open(). Oh, well." >&4
11683 echo "I can't find the O_* constant definitions! You got problems." >&4
11689 : see which of string.h or strings.h is needed
11691 strings=`./findhdr string.h`
11692 if $test "$strings" && $test -r "$strings"; then
11693 echo "Using <string.h> instead of <strings.h>." >&4
11697 strings=`./findhdr strings.h`
11698 if $test "$strings" && $test -r "$strings"; then
11699 echo "Using <strings.h> instead of <string.h>." >&4
11701 echo "No string header found -- You'll surely have problems." >&4
11706 case "$i_string" in
11707 "$undef") strings=`./findhdr strings.h`;;
11708 *) strings=`./findhdr string.h`;;
11711 : see if this is a sys/file.h system
11716 : do we need to include sys/file.h ?
11720 if $h_sysfile; then
11722 echo "We'll be including <sys/file.h>." >&4
11725 echo "We won't be including <sys/file.h>." >&4
11735 : see if fcntl.h is there
11740 : see if we can include fcntl.h
11746 echo "We'll be including <fcntl.h>." >&4
11749 if $h_sysfile; then
11750 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
11752 echo "We won't be including <fcntl.h>." >&4
11764 : check for non-blocking I/O stuff
11765 case "$h_sysfile" in
11766 true) echo "#include <sys/file.h>" > head.c;;
11769 true) echo "#include <fcntl.h>" > head.c;;
11770 *) echo "#include <sys/fcntl.h>" > head.c;;
11775 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
11776 case "$o_nonblock" in
11778 $cat head.c > try.c
11779 $cat >>try.c <<EOCP
11781 #$i_stdlib I_STDLIB
11783 #include <stdlib.h>
11791 printf("O_NONBLOCK\n");
11795 printf("O_NDELAY\n");
11799 printf("FNDELAY\n");
11806 if eval $compile_ok; then
11807 o_nonblock=`$run ./try`
11808 case "$o_nonblock" in
11809 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
11810 *) echo "Seems like we can use $o_nonblock.";;
11813 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
11816 *) echo "Using $hint value $o_nonblock.";;
11818 $rm -f try try.* .out core
11821 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
11824 $cat head.c > try.c
11825 $cat >>try.c <<EOCP
11827 #include <sys/types.h>
11828 #include <signal.h>
11830 #$i_stdlib I_STDLIB
11832 #include <stdlib.h>
11838 #define MY_O_NONBLOCK $o_nonblock
11839 #ifndef errno /* XXX need better Configure test */
11842 #$i_unistd I_UNISTD
11844 #include <unistd.h>
11846 #$i_string I_STRING
11848 #include <string.h>
11850 #include <strings.h>
11852 $signal_t blech(x) int x; { exit(3); }
11854 $cat >> try.c <<'EOCP'
11862 pipe(pd); /* Down: child -> parent */
11863 pipe(pu); /* Up: parent -> child */
11866 close(pd[1]); /* Parent reads from pd[0] */
11867 close(pu[0]); /* Parent writes (blocking) to pu[1] */
11869 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
11874 signal(SIGALRM, blech);
11876 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
11878 sprintf(string, "%d\n", ret);
11879 write(2, string, strlen(string));
11882 if (errno == EAGAIN) {
11883 printf("EAGAIN\n");
11888 if (errno == EWOULDBLOCK)
11889 printf("EWOULDBLOCK\n");
11892 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
11893 sleep(2); /* Give it time to close our pipe */
11895 ret = read(pd[0], buf, 1); /* Should read EOF */
11897 sprintf(string, "%d\n", ret);
11898 write(4, string, strlen(string));
11902 close(pd[0]); /* We write to pd[1] */
11903 close(pu[1]); /* We read from pu[0] */
11904 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
11905 close(pd[1]); /* Pipe pd is now fully closed! */
11906 exit(0); /* Bye bye, thank you for playing! */
11910 if eval $compile_ok; then
11911 echo "$startsh" >mtry
11912 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
11914 ./mtry >/dev/null 2>&1
11916 0) eagain=`$cat try.out`;;
11917 1) echo "Could not perform non-blocking setting!";;
11918 2) echo "I did a successful read() for something that was not there!";;
11919 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
11920 4) echo "Could not find F_SETFL!";;
11921 *) echo "Something terribly wrong happened during testing.";;
11923 rd_nodata=`$cat try.ret`
11924 echo "A read() system call with no data present returns $rd_nodata."
11925 case "$rd_nodata" in
11928 echo "(That's peculiar, fixing that to be -1.)"
11934 echo "Forcing errno EAGAIN on read() with no data available."
11938 echo "Your read() sets errno to $eagain when no data is available."
11941 status=`$cat try.err`
11943 0) echo "And it correctly returns 0 to signal EOF.";;
11944 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
11945 *) echo "However, your read() returns '$status' on EOF??";;
11948 if test "$status" = "$rd_nodata"; then
11949 echo "WARNING: you can't distinguish between EOF and no data!"
11953 echo "I can't compile the test program--assuming errno EAGAIN will do."
11960 echo "Using $hint value $eagain."
11961 echo "Your read() returns $rd_nodata when no data is present."
11962 case "$d_eofnblk" in
11963 "$define") echo "And you can see EOF because read() returns 0.";;
11964 "$undef") echo "But you can't see EOF status from read() returned value.";;
11966 echo "(Assuming you can't see EOF status from read anyway.)"
11972 $rm -f try try.* .out core head.c mtry
11974 : see if _ptr and _cnt from stdio act std
11977 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
11978 echo "(Looks like you have stdio.h from BSD.)"
11979 case "$stdio_ptr" in
11980 '') stdio_ptr='((fp)->_p)'
11983 *) ptr_lval=$d_stdio_ptr_lval;;
11985 case "$stdio_cnt" in
11986 '') stdio_cnt='((fp)->_r)'
11989 *) cnt_lval=$d_stdio_cnt_lval;;
11991 case "$stdio_base" in
11992 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
11994 case "$stdio_bufsiz" in
11995 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
11997 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
11998 echo "(Looks like you have stdio.h from Linux.)"
11999 case "$stdio_ptr" in
12000 '') stdio_ptr='((fp)->_IO_read_ptr)'
12003 *) ptr_lval=$d_stdio_ptr_lval;;
12005 case "$stdio_cnt" in
12006 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12009 *) cnt_lval=$d_stdio_cnt_lval;;
12011 case "$stdio_base" in
12012 '') stdio_base='((fp)->_IO_read_base)';;
12014 case "$stdio_bufsiz" in
12015 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12018 case "$stdio_ptr" in
12019 '') stdio_ptr='((fp)->_ptr)'
12022 *) ptr_lval=$d_stdio_ptr_lval;;
12024 case "$stdio_cnt" in
12025 '') stdio_cnt='((fp)->_cnt)'
12028 *) cnt_lval=$d_stdio_cnt_lval;;
12030 case "$stdio_base" in
12031 '') stdio_base='((fp)->_base)';;
12033 case "$stdio_bufsiz" in
12034 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12038 : test whether _ptr and _cnt really work
12039 echo "Checking how std your stdio is..." >&4
12042 #$i_stdlib I_STDLIB
12044 #include <stdlib.h>
12046 #define FILE_ptr(fp) $stdio_ptr
12047 #define FILE_cnt(fp) $stdio_cnt
12049 FILE *fp = fopen("try.c", "r");
12052 18 <= FILE_cnt(fp) &&
12053 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12061 if eval $compile && $to try.c; then
12062 if $run ./try; then
12063 echo "Your stdio acts pretty std."
12066 echo "Your stdio isn't very std."
12069 echo "Your stdio doesn't appear very std."
12073 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12074 # direct buffer manipulation no longer works. The Configure tests
12075 # should be changed to correctly detect this, but until then,
12076 # the following check should at least let perl compile and run.
12077 # (This quick fix should be updated before 5.8.1.)
12078 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12079 # A. Dougherty, June 3, 2002.
12080 case "$d_gnulibc" in
12082 case "$gnulibc_version" in
12086 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12095 : Can _ptr be used as an lvalue?
12096 case "$d_stdstdio$ptr_lval" in
12097 $define$define) val=$define ;;
12100 set d_stdio_ptr_lval
12103 : Can _cnt be used as an lvalue?
12104 case "$d_stdstdio$cnt_lval" in
12105 $define$define) val=$define ;;
12108 set d_stdio_cnt_lval
12112 : test whether setting _ptr sets _cnt as a side effect
12113 d_stdio_ptr_lval_sets_cnt="$undef"
12114 d_stdio_ptr_lval_nochange_cnt="$undef"
12115 case "$d_stdio_ptr_lval$d_stdstdio" in
12117 echo "Checking to see what happens if we set the stdio ptr..." >&4
12120 /* Can we scream? */
12121 /* Eat dust sed :-) */
12122 /* In the buffer space, no one can hear you scream. */
12123 #$i_stdlib I_STDLIB
12125 #include <stdlib.h>
12127 #define FILE_ptr(fp) $stdio_ptr
12128 #define FILE_cnt(fp) $stdio_cnt
12129 #include <sys/types.h>
12131 FILE *fp = fopen("try.c", "r");
12136 puts("Fail even to read");
12139 c = getc(fp); /* Read away the first # */
12141 puts("Fail even to read");
12145 18 <= FILE_cnt(fp) &&
12146 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12148 puts("Fail even to read");
12151 ptr = (char*) FILE_ptr(fp);
12152 cnt = (size_t)FILE_cnt(fp);
12154 FILE_ptr(fp) += 42;
12156 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12157 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12160 if (FILE_cnt(fp) <= 20) {
12161 printf ("Fail (<20 chars to test)");
12164 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12165 puts("Fail compare");
12168 if (cnt == FILE_cnt(fp)) {
12169 puts("Pass_unchanged");
12172 if (FILE_cnt(fp) == (cnt - 42)) {
12173 puts("Pass_changed");
12176 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12182 if eval $compile && $to try.c; then
12183 case `$run ./try` in
12185 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12186 d_stdio_ptr_lval_sets_cnt="$define" ;;
12188 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12189 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12191 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12193 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12196 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12202 : see if _base is also standard
12204 case "$d_stdstdio" in
12208 #$i_stdlib I_STDLIB
12210 #include <stdlib.h>
12212 #define FILE_base(fp) $stdio_base
12213 #define FILE_bufsiz(fp) $stdio_bufsiz
12215 FILE *fp = fopen("try.c", "r");
12218 19 <= FILE_bufsiz(fp) &&
12219 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
12226 if eval $compile && $to try.c; then
12227 if $run ./try; then
12228 echo "And its _base field acts std."
12231 echo "But its _base field isn't std."
12234 echo "However, it seems to be lacking the _base field."
12242 : see if fast_stdio exists
12244 case "$d_stdstdio:$d_stdio_ptr_lval" in
12246 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
12248 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
12259 : see if fchdir exists
12260 set fchdir d_fchdir
12263 : see if fchmod exists
12264 set fchmod d_fchmod
12267 : see if fchown exists
12268 set fchown d_fchown
12271 : see if this is an fcntl system
12276 : See if fcntl-based locking works.
12278 #$i_stdlib I_STDLIB
12280 #include <stdlib.h>
12282 #include <unistd.h>
12284 #include <signal.h>
12285 $signal_t blech(x) int x; { exit(3); }
12287 #if defined(F_SETLK) && defined(F_SETLKW)
12288 struct flock flock;
12290 fd = open("try.c", O_RDONLY);
12291 flock.l_type = F_RDLCK;
12292 flock.l_whence = SEEK_SET;
12293 flock.l_start = flock.l_len = 0;
12294 signal(SIGALRM, blech);
12296 retval = fcntl(fd, F_SETLK, &flock);
12298 (retval < 0 ? exit(2) : exit(0));
12304 echo "Checking if fcntl-based file locking works... "
12308 if eval $compile_ok; then
12309 if $run ./try; then
12310 echo "Yes, it seems to work."
12313 echo "Nope, it didn't work."
12318 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
12319 *** This is (almost) impossible.
12320 *** If your NFS lock daemons are not feeling well, something like
12321 *** this may happen, please investigate. Cannot continue, aborting.
12329 echo "I'm unable to compile the test program, so I'll assume not."
12334 echo "Nope, since you don't even have fcntl()."
12337 set d_fcntl_can_lock
12342 : check for fd_set items
12345 Checking to see how well your C compiler handles fd_set and friends ...
12348 #$i_stdlib I_STDLIB
12350 #include <stdlib.h>
12352 #$i_systime I_SYS_TIME
12353 #$i_sysselct I_SYS_SELECT
12354 #$d_socket HAS_SOCKET
12355 #include <sys/types.h>
12357 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
12360 #include <sys/time.h>
12362 #ifdef I_SYS_SELECT
12363 #include <sys/select.h>
12372 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
12380 if eval $compile; then
12381 d_fds_bits="$define"
12383 echo "Well, your system knows about the normal fd_set typedef..." >&4
12384 if $run ./try; then
12385 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
12386 d_fd_macros="$define"
12389 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
12391 d_fd_macros="$undef"
12395 Hmm, your compiler has some difficulty with fd_set. Checking further...
12398 if eval $compile; then
12399 d_fds_bits="$undef"
12401 echo "Well, your system has some sort of fd_set available..." >&4
12402 if $run ./try; then
12403 echo "and you have the normal fd_set macros." >&4
12404 d_fd_macros="$define"
12407 but not the normal fd_set macros! Gross! More work for me...
12409 d_fd_macros="$undef"
12412 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
12414 d_fds_bits="$undef"
12415 d_fd_macros="$undef"
12420 : see if fgetpos exists
12421 set fgetpos d_fgetpos
12424 : see if finite exists
12425 set finite d_finite
12428 : see if finitel exists
12429 set finitel d_finitel
12432 : see if flock exists
12436 : see if prototype for flock is available
12438 set d_flockproto flock $i_sysfile sys/file.h
12441 : see if fork exists
12445 : see if fp_class exists
12446 set fp_class d_fp_class
12449 : see if pathconf exists
12450 set pathconf d_pathconf
12453 : see if fpathconf exists
12454 set fpathconf d_fpathconf
12457 : see if fpclass exists
12458 set fpclass d_fpclass
12461 : see if fpclassify exists
12462 set fpclassify d_fpclassify
12465 : see if fpclassl exists
12466 set fpclassl d_fpclassl
12470 : check for fpos64_t
12472 echo "Checking to see if you have fpos64_t..." >&4
12475 int main() { fpos64_t x = 7; }
12478 if eval $compile; then
12480 echo "You have fpos64_t."
12483 echo "You do not have fpos64_t."
12484 case "$fpossize" in
12485 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
12492 : see if frexpl exists
12493 set frexpl d_frexpl
12496 : see if this is a sys/param system
12497 set sys/param.h i_sysparam
12500 : see if this is a sys/mount.h system
12501 set sys/mount.h i_sysmount
12506 echo "Checking to see if your system supports struct fs_data..." >&4
12507 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
12509 case "$d_fs_data_s" in
12510 "$define") echo "Yes, it does." ;;
12511 *) echo "No, it doesn't." ;;
12514 : see if fseeko exists
12515 set fseeko d_fseeko
12517 case "$longsize" in
12518 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
12521 : see if fsetpos exists
12522 set fsetpos d_fsetpos
12526 : see if fstatfs exists
12527 set fstatfs d_fstatfs
12531 : see if statvfs exists
12532 set statvfs d_statvfs
12535 : see if fstatvfs exists
12536 set fstatvfs d_fstatvfs
12540 : see if fsync exists
12544 : see if ftello exists
12545 set ftello d_ftello
12547 case "$longsize" in
12548 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
12551 : see if getcwd exists
12552 set getcwd d_getcwd
12555 : see if getespwnam exists
12556 set getespwnam d_getespwnam
12560 : see if getfsstat exists
12561 set getfsstat d_getfsstat
12564 : see if getgrent exists
12565 set getgrent d_getgrent
12568 : see if getgrent_r exists
12569 set getgrent_r d_getgrent_r
12571 case "$d_getgrent_r" in
12573 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12574 case "$d_getgrent_r_proto:$usethreads" in
12575 ":define") d_getgrent_r_proto=define
12576 set d_getgrent_r_proto getgrent_r $hdrs
12580 case "$d_getgrent_r_proto" in
12582 case "$getgrent_r_proto" in
12583 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
12584 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBWR ;;
12586 case "$getgrent_r_proto" in
12587 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
12588 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIR ;;
12590 case "$getgrent_r_proto" in
12591 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
12592 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBW ;;
12594 case "$getgrent_r_proto" in
12595 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
12596 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBI ;;
12598 case "$getgrent_r_proto" in
12599 ''|0) try='int getgrent_r(struct group*, char*, int);'
12600 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBI ;;
12602 case "$getgrent_r_proto" in
12603 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
12604 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIH ;;
12606 case "$getgrent_r_proto" in
12607 ''|0) d_getgrent_r=undef
12609 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
12610 * ) case "$getgrent_r_proto" in
12611 REENTRANT_PROTO*) ;;
12612 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
12614 echo "Prototype: $try" ;;
12617 *) case "$usethreads" in
12618 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
12625 *) getgrent_r_proto=0
12629 : see if getgrgid_r exists
12630 set getgrgid_r d_getgrgid_r
12632 case "$d_getgrgid_r" in
12634 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12635 case "$d_getgrgid_r_proto:$usethreads" in
12636 ":define") d_getgrgid_r_proto=define
12637 set d_getgrgid_r_proto getgrgid_r $hdrs
12641 case "$d_getgrgid_r_proto" in
12643 case "$getgrgid_r_proto" in
12644 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
12645 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
12647 case "$getgrgid_r_proto" in
12648 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
12649 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
12651 case "$getgrgid_r_proto" in
12652 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
12653 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
12655 case "$getgrgid_r_proto" in
12656 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
12657 ./protochk "extern $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
12659 case "$getgrgid_r_proto" in
12660 ''|0) d_getgrgid_r=undef
12662 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
12663 * ) case "$getgrgid_r_proto" in
12664 REENTRANT_PROTO*) ;;
12665 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
12667 echo "Prototype: $try" ;;
12670 *) case "$usethreads" in
12671 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
12678 *) getgrgid_r_proto=0
12682 : see if getgrnam_r exists
12683 set getgrnam_r d_getgrnam_r
12685 case "$d_getgrnam_r" in
12687 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12688 case "$d_getgrnam_r_proto:$usethreads" in
12689 ":define") d_getgrnam_r_proto=define
12690 set d_getgrnam_r_proto getgrnam_r $hdrs
12694 case "$d_getgrnam_r_proto" in
12696 case "$getgrnam_r_proto" in
12697 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
12698 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
12700 case "$getgrnam_r_proto" in
12701 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
12702 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
12704 case "$getgrnam_r_proto" in
12705 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
12706 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CBI ;;
12708 case "$getgrnam_r_proto" in
12709 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
12710 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
12712 case "$getgrnam_r_proto" in
12713 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
12714 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
12716 case "$getgrnam_r_proto" in
12717 ''|0) d_getgrnam_r=undef
12719 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
12720 * ) case "$getgrnam_r_proto" in
12721 REENTRANT_PROTO*) ;;
12722 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
12724 echo "Prototype: $try" ;;
12727 *) case "$usethreads" in
12728 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
12735 *) getgrnam_r_proto=0
12739 : see if gethostbyaddr exists
12740 set gethostbyaddr d_gethbyaddr
12743 : see if gethostbyname exists
12744 set gethostbyname d_gethbyname
12747 : see if gethostent exists
12748 set gethostent d_gethent
12751 : see how we will look up host name
12754 if set gethostname val -f d_gethname; eval $csym; $val; then
12755 echo 'gethostname() found.' >&4
12756 d_gethname="$define"
12759 if set uname val -f d_uname; eval $csym; $val; then
12762 uname() was found, but you're running xenix, and older versions of xenix
12763 have a broken uname(). If you don't really know whether your xenix is old
12764 enough to have a broken system call, use the default answer.
12769 "$define") dflt=n;;
12771 rp='Is your uname() broken?'
12774 n*) d_uname="$define"; call=uname;;
12777 echo 'uname() found.' >&4
12784 case "$d_gethname" in
12785 '') d_gethname="$undef";;
12788 '') d_uname="$undef";;
12790 case "$d_uname$d_gethname" in
12795 Every now and then someone has a $call() that lies about the hostname
12796 but can't be fixed for political or economic reasons. If you wish, I can
12797 pretend $call() isn't there and maybe compute hostname at run-time
12798 thanks to the '$phostname' command.
12801 rp="Shall I ignore $call() from now on?"
12804 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
12807 case "$phostname" in
12808 '') aphostname='';;
12809 *) case "$aphostname" in
12811 *) set X $phostname
12815 file=`./loc $file $file $pth`
12816 aphostname=`echo $file $*`
12821 case "$d_uname$d_gethname" in
12824 case "$phostname" in
12826 echo "There will be no way for $package to get your hostname." >&4;;
12828 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
12832 case "$d_phostname" in
12833 '') d_phostname="$undef";;
12836 : see if gethostbyaddr_r exists
12837 set gethostbyaddr_r d_gethostbyaddr_r
12839 case "$d_gethostbyaddr_r" in
12841 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12842 case "$d_gethostbyaddr_r_proto:$usethreads" in
12843 ":define") d_gethostbyaddr_r_proto=define
12844 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
12848 case "$d_gethostbyaddr_r_proto" in
12850 case "$gethostbyaddr_r_proto" in
12851 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
12852 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
12854 case "$gethostbyaddr_r_proto" in
12855 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
12856 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
12858 case "$gethostbyaddr_r_proto" in
12859 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
12860 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
12862 case "$gethostbyaddr_r_proto" in
12863 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
12864 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
12866 case "$gethostbyaddr_r_proto" in
12867 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
12868 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
12870 case "$gethostbyaddr_r_proto" in
12871 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
12872 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
12874 case "$gethostbyaddr_r_proto" in
12875 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
12876 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
12878 case "$gethostbyaddr_r_proto" in
12879 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
12880 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
12882 case "$gethostbyaddr_r_proto" in
12883 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
12884 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
12886 case "$gethostbyaddr_r_proto" in
12887 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
12888 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
12890 case "$gethostbyaddr_r_proto" in
12891 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
12892 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
12894 case "$gethostbyaddr_r_proto" in
12895 ''|0) d_gethostbyaddr_r=undef
12896 gethostbyaddr_r_proto=0
12897 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
12898 * ) case "$gethostbyaddr_r_proto" in
12899 REENTRANT_PROTO*) ;;
12900 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
12902 echo "Prototype: $try" ;;
12905 *) case "$usethreads" in
12906 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
12908 d_gethostbyaddr_r=undef
12909 gethostbyaddr_r_proto=0
12913 *) gethostbyaddr_r_proto=0
12917 : see if gethostbyname_r exists
12918 set gethostbyname_r d_gethostbyname_r
12920 case "$d_gethostbyname_r" in
12922 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12923 case "$d_gethostbyname_r_proto:$usethreads" in
12924 ":define") d_gethostbyname_r_proto=define
12925 set d_gethostbyname_r_proto gethostbyname_r $hdrs
12929 case "$d_gethostbyname_r_proto" in
12931 case "$gethostbyname_r_proto" in
12932 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
12933 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
12935 case "$gethostbyname_r_proto" in
12936 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
12937 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
12939 case "$gethostbyname_r_proto" in
12940 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
12941 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
12943 case "$gethostbyname_r_proto" in
12944 ''|0) d_gethostbyname_r=undef
12945 gethostbyname_r_proto=0
12946 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
12947 * ) case "$gethostbyname_r_proto" in
12948 REENTRANT_PROTO*) ;;
12949 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
12951 echo "Prototype: $try" ;;
12954 *) case "$usethreads" in
12955 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
12957 d_gethostbyname_r=undef
12958 gethostbyname_r_proto=0
12962 *) gethostbyname_r_proto=0
12966 : see if gethostent_r exists
12967 set gethostent_r d_gethostent_r
12969 case "$d_gethostent_r" in
12971 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12972 case "$d_gethostent_r_proto:$usethreads" in
12973 ":define") d_gethostent_r_proto=define
12974 set d_gethostent_r_proto gethostent_r $hdrs
12978 case "$d_gethostent_r_proto" in
12980 case "$gethostent_r_proto" in
12981 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
12982 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
12984 case "$gethostent_r_proto" in
12985 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
12986 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBIE ;;
12988 case "$gethostent_r_proto" in
12989 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
12990 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBIE ;;
12992 case "$gethostent_r_proto" in
12993 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
12994 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBI ;;
12996 case "$gethostent_r_proto" in
12997 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
12998 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBI ;;
13000 case "$gethostent_r_proto" in
13001 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13002 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SD ;;
13004 case "$gethostent_r_proto" in
13005 ''|0) d_gethostent_r=undef
13006 gethostent_r_proto=0
13007 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13008 * ) case "$gethostent_r_proto" in
13009 REENTRANT_PROTO*) ;;
13010 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13012 echo "Prototype: $try" ;;
13015 *) case "$usethreads" in
13016 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13018 d_gethostent_r=undef
13019 gethostent_r_proto=0
13023 *) gethostent_r_proto=0
13027 : see if prototypes for various gethostxxx netdb.h functions are available
13029 set d_gethostprotos gethostent $i_netdb netdb.h
13032 : see if getitimer exists
13033 set getitimer d_getitimer
13036 : see if getlogin exists
13037 set getlogin d_getlogin
13040 : see if getlogin_r exists
13041 set getlogin_r d_getlogin_r
13043 case "$d_getlogin_r" in
13045 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
13046 case "$d_getlogin_r_proto:$usethreads" in
13047 ":define") d_getlogin_r_proto=define
13048 set d_getlogin_r_proto getlogin_r $hdrs
13052 case "$d_getlogin_r_proto" in
13054 case "$getlogin_r_proto" in
13055 ''|0) try='int getlogin_r(char*, size_t);'
13056 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BW ;;
13058 case "$getlogin_r_proto" in
13059 ''|0) try='int getlogin_r(char*, int);'
13060 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BI ;;
13062 case "$getlogin_r_proto" in
13063 ''|0) try='char* getlogin_r(char*, size_t);'
13064 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BW ;;
13066 case "$getlogin_r_proto" in
13067 ''|0) try='char* getlogin_r(char*, int);'
13068 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BI ;;
13070 case "$getlogin_r_proto" in
13071 ''|0) d_getlogin_r=undef
13073 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
13074 * ) case "$getlogin_r_proto" in
13075 REENTRANT_PROTO*) ;;
13076 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
13078 echo "Prototype: $try" ;;
13081 *) case "$usethreads" in
13082 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
13089 *) getlogin_r_proto=0
13093 : see if getmnt exists
13094 set getmnt d_getmnt
13097 : see if getmntent exists
13098 set getmntent d_getmntent
13101 : see if getnetbyaddr exists
13102 set getnetbyaddr d_getnbyaddr
13105 : see if getnetbyname exists
13106 set getnetbyname d_getnbyname
13109 : see if getnetent exists
13110 set getnetent d_getnent
13113 : see if getnetbyaddr_r exists
13114 set getnetbyaddr_r d_getnetbyaddr_r
13116 case "$d_getnetbyaddr_r" in
13118 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13119 case "$d_getnetbyaddr_r_proto:$usethreads" in
13120 ":define") d_getnetbyaddr_r_proto=define
13121 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
13125 case "$d_getnetbyaddr_r_proto" in
13127 case "$getnetbyaddr_r_proto" in
13128 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
13129 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
13131 case "$getnetbyaddr_r_proto" in
13132 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
13133 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
13135 case "$getnetbyaddr_r_proto" in
13136 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
13137 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
13139 case "$getnetbyaddr_r_proto" in
13140 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
13141 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
13143 case "$getnetbyaddr_r_proto" in
13144 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
13145 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
13147 case "$getnetbyaddr_r_proto" in
13148 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
13149 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
13151 case "$getnetbyaddr_r_proto" in
13152 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
13153 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
13155 case "$getnetbyaddr_r_proto" in
13156 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
13157 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
13159 case "$getnetbyaddr_r_proto" in
13160 ''|0) d_getnetbyaddr_r=undef
13161 getnetbyaddr_r_proto=0
13162 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
13163 * ) case "$getnetbyaddr_r_proto" in
13164 REENTRANT_PROTO*) ;;
13165 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
13167 echo "Prototype: $try" ;;
13170 *) case "$usethreads" in
13171 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
13173 d_getnetbyaddr_r=undef
13174 getnetbyaddr_r_proto=0
13178 *) getnetbyaddr_r_proto=0
13182 : see if getnetbyname_r exists
13183 set getnetbyname_r d_getnetbyname_r
13185 case "$d_getnetbyname_r" in
13187 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13188 case "$d_getnetbyname_r_proto:$usethreads" in
13189 ":define") d_getnetbyname_r_proto=define
13190 set d_getnetbyname_r_proto getnetbyname_r $hdrs
13194 case "$d_getnetbyname_r_proto" in
13196 case "$getnetbyname_r_proto" in
13197 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
13198 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
13200 case "$getnetbyname_r_proto" in
13201 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
13202 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
13204 case "$getnetbyname_r_proto" in
13205 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
13206 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
13208 case "$getnetbyname_r_proto" in
13209 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
13210 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
13212 case "$getnetbyname_r_proto" in
13213 ''|0) d_getnetbyname_r=undef
13214 getnetbyname_r_proto=0
13215 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
13216 * ) case "$getnetbyname_r_proto" in
13217 REENTRANT_PROTO*) ;;
13218 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
13220 echo "Prototype: $try" ;;
13223 *) case "$usethreads" in
13224 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
13226 d_getnetbyname_r=undef
13227 getnetbyname_r_proto=0
13231 *) getnetbyname_r_proto=0
13235 : see if getnetent_r exists
13236 set getnetent_r d_getnetent_r
13238 case "$d_getnetent_r" in
13240 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13241 case "$d_getnetent_r_proto:$usethreads" in
13242 ":define") d_getnetent_r_proto=define
13243 set d_getnetent_r_proto getnetent_r $hdrs
13247 case "$d_getnetent_r_proto" in
13249 case "$getnetent_r_proto" in
13250 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
13251 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
13253 case "$getnetent_r_proto" in
13254 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
13255 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBIE ;;
13257 case "$getnetent_r_proto" in
13258 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
13259 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBIE ;;
13261 case "$getnetent_r_proto" in
13262 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
13263 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBI ;;
13265 case "$getnetent_r_proto" in
13266 ''|0) try='int getnetent_r(struct netent*, char*, int);'
13267 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBI ;;
13269 case "$getnetent_r_proto" in
13270 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
13271 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SD ;;
13273 case "$getnetent_r_proto" in
13274 ''|0) d_getnetent_r=undef
13275 getnetent_r_proto=0
13276 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
13277 * ) case "$getnetent_r_proto" in
13278 REENTRANT_PROTO*) ;;
13279 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
13281 echo "Prototype: $try" ;;
13284 *) case "$usethreads" in
13285 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
13287 d_getnetent_r=undef
13288 getnetent_r_proto=0
13292 *) getnetent_r_proto=0
13296 : see if prototypes for various getnetxxx netdb.h functions are available
13298 set d_getnetprotos getnetent $i_netdb netdb.h
13301 : see if getpagesize exists
13302 set getpagesize d_getpagsz
13306 : see if getprotobyname exists
13307 set getprotobyname d_getpbyname
13310 : see if getprotobynumber exists
13311 set getprotobynumber d_getpbynumber
13314 : see if getprotoent exists
13315 set getprotoent d_getpent
13318 : see if getpgid exists
13319 set getpgid d_getpgid
13322 : see if getpgrp2 exists
13323 set getpgrp2 d_getpgrp2
13326 : see if getppid exists
13327 set getppid d_getppid
13330 : see if getpriority exists
13331 set getpriority d_getprior
13334 : see if getprotobyname_r exists
13335 set getprotobyname_r d_getprotobyname_r
13337 case "$d_getprotobyname_r" in
13339 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13340 case "$d_getprotobyname_r_proto:$usethreads" in
13341 ":define") d_getprotobyname_r_proto=define
13342 set d_getprotobyname_r_proto getprotobyname_r $hdrs
13346 case "$d_getprotobyname_r_proto" in
13348 case "$getprotobyname_r_proto" in
13349 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
13350 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
13352 case "$getprotobyname_r_proto" in
13353 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
13354 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
13356 case "$getprotobyname_r_proto" in
13357 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
13358 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
13360 case "$getprotobyname_r_proto" in
13361 ''|0) d_getprotobyname_r=undef
13362 getprotobyname_r_proto=0
13363 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
13364 * ) case "$getprotobyname_r_proto" in
13365 REENTRANT_PROTO*) ;;
13366 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
13368 echo "Prototype: $try" ;;
13371 *) case "$usethreads" in
13372 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
13374 d_getprotobyname_r=undef
13375 getprotobyname_r_proto=0
13379 *) getprotobyname_r_proto=0
13383 : see if getprotobynumber_r exists
13384 set getprotobynumber_r d_getprotobynumber_r
13386 case "$d_getprotobynumber_r" in
13388 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13389 case "$d_getprotobynumber_r_proto:$usethreads" in
13390 ":define") d_getprotobynumber_r_proto=define
13391 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
13395 case "$d_getprotobynumber_r_proto" in
13397 case "$getprotobynumber_r_proto" in
13398 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
13399 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
13401 case "$getprotobynumber_r_proto" in
13402 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
13403 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
13405 case "$getprotobynumber_r_proto" in
13406 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
13407 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
13409 case "$getprotobynumber_r_proto" in
13410 ''|0) d_getprotobynumber_r=undef
13411 getprotobynumber_r_proto=0
13412 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
13413 * ) case "$getprotobynumber_r_proto" in
13414 REENTRANT_PROTO*) ;;
13415 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
13417 echo "Prototype: $try" ;;
13420 *) case "$usethreads" in
13421 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
13423 d_getprotobynumber_r=undef
13424 getprotobynumber_r_proto=0
13428 *) getprotobynumber_r_proto=0
13432 : see if getprotoent_r exists
13433 set getprotoent_r d_getprotoent_r
13435 case "$d_getprotoent_r" in
13437 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13438 case "$d_getprotoent_r_proto:$usethreads" in
13439 ":define") d_getprotoent_r_proto=define
13440 set d_getprotoent_r_proto getprotoent_r $hdrs
13444 case "$d_getprotoent_r_proto" in
13446 case "$getprotoent_r_proto" in
13447 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
13448 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
13450 case "$getprotoent_r_proto" in
13451 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
13452 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBI ;;
13454 case "$getprotoent_r_proto" in
13455 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
13456 ./protochk "extern $try" $hdrs && getprotoent_r_proto=S_SBI ;;
13458 case "$getprotoent_r_proto" in
13459 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
13460 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SD ;;
13462 case "$getprotoent_r_proto" in
13463 ''|0) d_getprotoent_r=undef
13464 getprotoent_r_proto=0
13465 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
13466 * ) case "$getprotoent_r_proto" in
13467 REENTRANT_PROTO*) ;;
13468 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
13470 echo "Prototype: $try" ;;
13473 *) case "$usethreads" in
13474 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
13476 d_getprotoent_r=undef
13477 getprotoent_r_proto=0
13481 *) getprotoent_r_proto=0
13485 : see if prototypes for various getprotoxxx netdb.h functions are available
13487 set d_getprotoprotos getprotoent $i_netdb netdb.h
13490 : see if getprpwnam exists
13491 set getprpwnam d_getprpwnam
13494 : see if getpwent exists
13495 set getpwent d_getpwent
13498 : see if getpwent_r exists
13499 set getpwent_r d_getpwent_r
13501 case "$d_getpwent_r" in
13503 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13504 case "$d_getpwent_r_proto:$usethreads" in
13505 ":define") d_getpwent_r_proto=define
13506 set d_getpwent_r_proto getpwent_r $hdrs
13510 case "$d_getpwent_r_proto" in
13512 case "$getpwent_r_proto" in
13513 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
13514 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBWR ;;
13516 case "$getpwent_r_proto" in
13517 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
13518 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIR ;;
13520 case "$getpwent_r_proto" in
13521 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
13522 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBW ;;
13524 case "$getpwent_r_proto" in
13525 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
13526 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBI ;;
13528 case "$getpwent_r_proto" in
13529 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
13530 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBI ;;
13532 case "$getpwent_r_proto" in
13533 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
13534 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIH ;;
13536 case "$getpwent_r_proto" in
13537 ''|0) d_getpwent_r=undef
13539 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
13540 * ) case "$getpwent_r_proto" in
13541 REENTRANT_PROTO*) ;;
13542 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
13544 echo "Prototype: $try" ;;
13547 *) case "$usethreads" in
13548 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
13555 *) getpwent_r_proto=0
13559 : see if getpwnam_r exists
13560 set getpwnam_r d_getpwnam_r
13562 case "$d_getpwnam_r" in
13564 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13565 case "$d_getpwnam_r_proto:$usethreads" in
13566 ":define") d_getpwnam_r_proto=define
13567 set d_getpwnam_r_proto getpwnam_r $hdrs
13571 case "$d_getpwnam_r_proto" in
13573 case "$getpwnam_r_proto" in
13574 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
13575 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
13577 case "$getpwnam_r_proto" in
13578 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
13579 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
13581 case "$getpwnam_r_proto" in
13582 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
13583 ./protochk "extern $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
13585 case "$getpwnam_r_proto" in
13586 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
13587 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
13589 case "$getpwnam_r_proto" in
13590 ''|0) d_getpwnam_r=undef
13592 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
13593 * ) case "$getpwnam_r_proto" in
13594 REENTRANT_PROTO*) ;;
13595 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
13597 echo "Prototype: $try" ;;
13600 *) case "$usethreads" in
13601 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
13608 *) getpwnam_r_proto=0
13612 : see if getpwuid_r exists
13613 set getpwuid_r d_getpwuid_r
13615 case "$d_getpwuid_r" in
13617 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13618 case "$d_getpwuid_r_proto:$usethreads" in
13619 ":define") d_getpwuid_r_proto=define
13620 set d_getpwuid_r_proto getpwuid_r $hdrs
13624 case "$d_getpwuid_r_proto" in
13626 case "$getpwuid_r_proto" in
13627 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
13628 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
13630 case "$getpwuid_r_proto" in
13631 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
13632 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
13634 case "$getpwuid_r_proto" in
13635 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
13636 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
13638 case "$getpwuid_r_proto" in
13639 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
13640 ./protochk "extern $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
13642 case "$getpwuid_r_proto" in
13643 ''|0) d_getpwuid_r=undef
13645 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
13646 * ) case "$getpwuid_r_proto" in
13647 REENTRANT_PROTO*) ;;
13648 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
13650 echo "Prototype: $try" ;;
13653 *) case "$usethreads" in
13654 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
13661 *) getpwuid_r_proto=0
13666 : see if getservbyname exists
13667 set getservbyname d_getsbyname
13670 : see if getservbyport exists
13671 set getservbyport d_getsbyport
13674 : see if getservent exists
13675 set getservent d_getsent
13678 : see if getservbyname_r exists
13679 set getservbyname_r d_getservbyname_r
13681 case "$d_getservbyname_r" in
13683 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13684 case "$d_getservbyname_r_proto:$usethreads" in
13685 ":define") d_getservbyname_r_proto=define
13686 set d_getservbyname_r_proto getservbyname_r $hdrs
13690 case "$d_getservbyname_r_proto" in
13692 case "$getservbyname_r_proto" in
13693 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
13694 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
13696 case "$getservbyname_r_proto" in
13697 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
13698 ./protochk "extern $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
13700 case "$getservbyname_r_proto" in
13701 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
13702 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
13704 case "$getservbyname_r_proto" in
13705 ''|0) d_getservbyname_r=undef
13706 getservbyname_r_proto=0
13707 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
13708 * ) case "$getservbyname_r_proto" in
13709 REENTRANT_PROTO*) ;;
13710 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
13712 echo "Prototype: $try" ;;
13715 *) case "$usethreads" in
13716 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
13718 d_getservbyname_r=undef
13719 getservbyname_r_proto=0
13723 *) getservbyname_r_proto=0
13727 : see if getservbyport_r exists
13728 set getservbyport_r d_getservbyport_r
13730 case "$d_getservbyport_r" in
13732 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13733 case "$d_getservbyport_r_proto:$usethreads" in
13734 ":define") d_getservbyport_r_proto=define
13735 set d_getservbyport_r_proto getservbyport_r $hdrs
13739 case "$d_getservbyport_r_proto" in
13741 case "$getservbyport_r_proto" in
13742 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
13743 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
13745 case "$getservbyport_r_proto" in
13746 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
13747 ./protochk "extern $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
13749 case "$getservbyport_r_proto" in
13750 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
13751 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
13753 case "$getservbyport_r_proto" in
13754 ''|0) d_getservbyport_r=undef
13755 getservbyport_r_proto=0
13756 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
13757 * ) case "$getservbyport_r_proto" in
13758 REENTRANT_PROTO*) ;;
13759 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
13761 echo "Prototype: $try" ;;
13764 *) case "$usethreads" in
13765 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
13767 d_getservbyport_r=undef
13768 getservbyport_r_proto=0
13772 *) getservbyport_r_proto=0
13776 : see if getservent_r exists
13777 set getservent_r d_getservent_r
13779 case "$d_getservent_r" in
13781 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13782 case "$d_getservent_r_proto:$usethreads" in
13783 ":define") d_getservent_r_proto=define
13784 set d_getservent_r_proto getservent_r $hdrs
13788 case "$d_getservent_r_proto" in
13790 case "$getservent_r_proto" in
13791 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
13792 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBWR ;;
13794 case "$getservent_r_proto" in
13795 ''|0) try='int getservent_r(struct servent*, char*, int);'
13796 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBI ;;
13798 case "$getservent_r_proto" in
13799 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
13800 ./protochk "extern $try" $hdrs && getservent_r_proto=S_SBI ;;
13802 case "$getservent_r_proto" in
13803 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
13804 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SD ;;
13806 case "$getservent_r_proto" in
13807 ''|0) d_getservent_r=undef
13808 getservent_r_proto=0
13809 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
13810 * ) case "$getservent_r_proto" in
13811 REENTRANT_PROTO*) ;;
13812 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
13814 echo "Prototype: $try" ;;
13817 *) case "$usethreads" in
13818 define) echo "getservent_r has no prototype, not using it." >&4 ;;
13820 d_getservent_r=undef
13821 getservent_r_proto=0
13825 *) getservent_r_proto=0
13829 : see if prototypes for various getservxxx netdb.h functions are available
13831 set d_getservprotos getservent $i_netdb netdb.h
13834 : see if getspnam exists
13835 set getspnam d_getspnam
13838 : see if this is a shadow.h system
13839 set shadow.h i_shadow
13842 : see if getspnam_r exists
13843 set getspnam_r d_getspnam_r
13845 case "$d_getspnam_r" in
13847 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
13848 case "$d_getspnam_r_proto:$usethreads" in
13849 ":define") d_getspnam_r_proto=define
13850 set d_getspnam_r_proto getspnam_r $hdrs
13854 case "$d_getspnam_r_proto" in
13856 case "$getspnam_r_proto" in
13857 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
13858 ./protochk "extern $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
13860 case "$getspnam_r_proto" in
13861 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
13862 ./protochk "extern $try" $hdrs && getspnam_r_proto=S_CSBI ;;
13864 case "$getspnam_r_proto" in
13865 ''|0) d_getspnam_r=undef
13867 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
13868 * ) case "$getspnam_r_proto" in
13869 REENTRANT_PROTO*) ;;
13870 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
13872 echo "Prototype: $try" ;;
13875 *) case "$usethreads" in
13876 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
13883 *) getspnam_r_proto=0
13887 : see if gettimeofday or ftime exists
13888 set gettimeofday d_gettimeod
13890 case "$d_gettimeod" in
13896 val="$undef"; set d_ftime; eval $setvar
13899 case "$d_gettimeod$d_ftime" in
13902 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
13906 : see if gmtime_r exists
13907 set gmtime_r d_gmtime_r
13909 case "$d_gmtime_r" in
13911 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
13912 case "$d_gmtime_r_proto:$usethreads" in
13913 ":define") d_gmtime_r_proto=define
13914 set d_gmtime_r_proto gmtime_r $hdrs
13918 case "$d_gmtime_r_proto" in
13920 case "$gmtime_r_proto" in
13921 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
13922 ./protochk "extern $try" $hdrs && gmtime_r_proto=S_TS ;;
13924 case "$gmtime_r_proto" in
13925 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
13926 ./protochk "extern $try" $hdrs && gmtime_r_proto=I_TS ;;
13928 case "$gmtime_r_proto" in
13929 ''|0) d_gmtime_r=undef
13931 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
13932 * ) case "$gmtime_r_proto" in
13933 REENTRANT_PROTO*) ;;
13934 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
13936 echo "Prototype: $try" ;;
13939 *) case "$usethreads" in
13940 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
13947 *) gmtime_r_proto=0
13951 : see if hasmntopt exists
13952 set hasmntopt d_hasmntopt
13955 : see if this is a netinet/in.h or sys/in.h system
13956 set netinet/in.h i_niin sys/in.h i_sysin
13959 : see if arpa/inet.h has to be included
13960 set arpa/inet.h i_arpainet
13963 : see if htonl --and friends-- exists
13968 : Maybe they are macros.
13971 $cat >htonl.c <<EOM
13973 #include <sys/types.h>
13974 #$i_niin I_NETINET_IN
13976 #$i_arpainet I_ARPA_INET
13977 #ifdef I_NETINET_IN
13978 #include <netinet/in.h>
13981 #include <sys/in.h>
13984 #include <arpa/inet.h>
13987 printf("Defined as a macro.");
13990 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
13991 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
13993 echo "But it seems to be defined as a macro." >&4
14001 : see if ilogbl exists
14002 set ilogbl d_ilogbl
14007 if set index val -f; eval $csym; $val; then
14008 if set strchr val -f d_strchr; eval $csym; $val; then
14009 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14012 echo "strchr() found." >&4
14016 echo "index() found." >&4
14021 echo "index() found." >&4
14024 if set strchr val -f d_strchr; eval $csym; $val; then
14027 echo "strchr() found." >&4
14029 echo "No index() or strchr() found!" >&4
14034 set d_strchr; eval $setvar
14036 set d_index; eval $setvar
14038 : check whether inet_aton exists
14039 set inet_aton d_inetaton
14044 $cat >isascii.c <<EOCP
14047 #$i_stdlib I_STDLIB
14049 #include <stdlib.h>
14060 if eval $compile; then
14061 echo "isascii() found." >&4
14064 echo "isascii() NOT found." >&4
14071 : see if isfinite exists
14072 set isfinite d_isfinite
14075 : see if isinf exists
14079 : see if isnan exists
14083 : see if isnanl exists
14084 set isnanl d_isnanl
14087 : see if killpg exists
14088 set killpg d_killpg
14091 : see if lchown exists
14093 $cat > try.c <<'EOCP'
14094 /* System header to define __stub macros and hopefully few prototypes,
14095 which can conflict with char lchown(); below. */
14096 #include <assert.h>
14097 /* Override any gcc2 internal prototype to avoid an error. */
14098 /* We use char because int might match the return type of a gcc2
14099 builtin and then its argument prototype would still apply. */
14102 /* The GNU C library defines this for functions which it implements
14103 to always fail with ENOSYS. Some functions are actually named
14104 something starting with __ and the normal name is an alias. */
14105 #if defined (__stub_lchown) || defined (__stub___lchown)
14113 if eval $compile; then
14114 $echo "lchown() found." >&4
14117 $echo "lchown() NOT found." >&4
14123 : See if number of significant digits in a double precision number is known
14125 $cat >ldbl_dig.c <<EOM
14126 #$i_limits I_LIMITS
14129 #include <limits.h>
14135 printf("Contains LDBL_DIG");
14138 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
14139 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
14140 echo "LDBL_DIG found." >&4
14143 echo "LDBL_DIG NOT found." >&4
14150 : see if this is a math.h system
14154 d_libm_lib_version="$undef"
14157 : check to see if math.h defines _LIB_VERSION
14159 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
14161 #include <unistd.h>
14163 int main (int argc, char *argv[])
14165 printf ("%d\n", _LIB_VERSION);
14170 if eval $compile; then
14172 echo "Yes, it does ($foo)" >&4
14173 d_libm_lib_version="$define"
14175 echo "No, it does not (probably harmless)\n" >&4
14177 $rm -f try.* try core core.try.*
14182 : see if link exists
14186 : see if localtime_r exists
14187 set localtime_r d_localtime_r
14189 case "$d_localtime_r" in
14191 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14192 case "$d_localtime_r_proto:$usethreads" in
14193 ":define") d_localtime_r_proto=define
14194 set d_localtime_r_proto localtime_r $hdrs
14198 case "$d_localtime_r_proto" in
14200 case "$localtime_r_proto" in
14201 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
14202 ./protochk "extern $try" $hdrs && localtime_r_proto=S_TS ;;
14204 case "$localtime_r_proto" in
14205 ''|0) try='int localtime_r(const time_t*, struct tm*);'
14206 ./protochk "extern $try" $hdrs && localtime_r_proto=I_TS ;;
14208 case "$localtime_r_proto" in
14209 ''|0) d_localtime_r=undef
14210 localtime_r_proto=0
14211 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
14212 * ) case "$localtime_r_proto" in
14213 REENTRANT_PROTO*) ;;
14214 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
14216 echo "Prototype: $try" ;;
14219 *) case "$usethreads" in
14220 define) echo "localtime_r has no prototype, not using it." >&4 ;;
14222 d_localtime_r=undef
14223 localtime_r_proto=0
14227 *) localtime_r_proto=0
14231 : see if localeconv exists
14232 set localeconv d_locconv
14235 : see if lockf exists
14239 : see if prototype for lseek is available
14241 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
14244 : see if lstat exists
14248 : see if madvise exists
14249 set madvise d_madvise
14252 : see if malloc_size exists
14253 set malloc_size d_malloc_size
14256 : see if malloc_size_good exists
14257 set malloc_good_size d_malloc_good_size
14260 : see if mblen exists
14264 : see if mbstowcs exists
14265 set mbstowcs d_mbstowcs
14268 : see if mbtowc exists
14269 set mbtowc d_mbtowc
14272 : see if memchr exists
14273 set memchr d_memchr
14276 : see if memcmp exists
14277 set memcmp d_memcmp
14280 : see if memcpy exists
14281 set memcpy d_memcpy
14284 : see if memmove exists
14285 set memmove d_memmove
14288 : see if memset exists
14289 set memset d_memset
14292 : see if mkdir exists
14296 : see if mkdtemp exists
14297 set mkdtemp d_mkdtemp
14300 : see if mkfifo exists
14301 set mkfifo d_mkfifo
14304 : see if mkstemp exists
14305 set mkstemp d_mkstemp
14308 : see if mkstemps exists
14309 set mkstemps d_mkstemps
14312 : see if mktime exists
14313 set mktime d_mktime
14316 : see if this is a sys/mman.h system
14317 set sys/mman.h i_sysmman
14320 : see if mmap exists
14323 : see what shmat returns
14324 : default to something harmless
14326 case "$i_sysmman$d_mmap" in
14328 $cat >mmap.c <<'END'
14329 #include <sys/mman.h>
14332 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
14337 echo "and it returns ($mmaptype)." >&4
14343 : see if sqrtl exists
14347 : see if scalbnl exists
14348 set scalbnl d_scalbnl
14351 : see if modfl exists
14355 : see if prototype for modfl is available
14357 set d_modflproto modfl $i_math math.h
14360 d_modfl_pow32_bug="$undef"
14362 case "$d_longdbl$d_modfl" in
14365 Checking to see whether your modfl() is okay for large values...
14371 if $test "X$d_modflproto" != "X$define"; then
14372 $cat >>try.c <<EOCP
14373 /* Sigh. many current glibcs provide the function, but do not prototype it. */
14374 long double modfl (long double, long double *);
14377 $cat >>try.c <<EOCP
14379 long double nv = 4294967303.15;
14385 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
14389 case "$osname:$gccversion" in
14390 aix:) saveccflags="$ccflags"
14391 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
14394 if eval $compile; then
14397 *" 4294967303.150000 1.150000 4294967302.000000")
14398 echo >&4 "Your modfl() is broken for large values."
14399 d_modfl_pow32_bug="$define"
14401 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
14405 *" 4294967303.150000 0.150000 4294967303.000000")
14406 echo >&4 "Your modfl() seems okay for large values."
14408 *) echo >&4 "I don't understand your modfl() at all."
14412 $rm -f try.* try core core.try.*
14414 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
14417 case "$osname:$gccversion" in
14418 aix:) ccflags="$saveccflags" ;; # restore
14423 if $test "$uselongdouble" = "$define"; then
14425 if $test "$d_sqrtl" != "$define"; then
14426 message="$message sqrtl"
14428 if $test "$d_modfl" != "$define"; then
14429 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
14430 echo "You have both aintl and copysignl, so I can emulate modfl."
14432 message="$message modfl"
14435 if $test "$d_frexpl" != "$define"; then
14436 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
14437 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
14439 message="$message frexpl"
14443 if $test "$message" != ""; then
14446 *** You requested the use of long doubles but you do not seem to have
14447 *** the following mathematical functions needed for long double support:
14449 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
14450 *** Cannot continue, aborting.
14458 : see if mprotect exists
14459 set mprotect d_mprotect
14462 : see if msgctl exists
14463 set msgctl d_msgctl
14466 : see if msgget exists
14467 set msgget d_msgget
14470 : see if msgsnd exists
14471 set msgsnd d_msgsnd
14474 : see if msgrcv exists
14475 set msgrcv d_msgrcv
14478 : see how much of the 'msg*(2)' library is present.
14481 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
14482 *"$undef"*) h_msg=false;;
14486 case "`ipcs 2>&1`" in
14487 "SVID messages"*"not configured"*)
14488 echo "Your $osname does not have the msg*(2) configured." >&4
14491 set msgctl d_msgctl
14493 set msgget d_msgget
14495 set msgsnd d_msgsnd
14497 set msgrcv d_msgrcv
14503 : we could also check for sys/ipc.h ...
14504 if $h_msg && $test `./findhdr sys/msg.h`; then
14505 echo "You have the full msg*(2) library." >&4
14508 echo "You don't have the full msg*(2) library." >&4
14516 echo "Checking to see if your system supports struct msghdr..." >&4
14517 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
14519 case "$d_msghdr_s" in
14520 "$define") echo "Yes, it does." ;;
14521 *) echo "No, it doesn't." ;;
14525 : see if msync exists
14529 : see if munmap exists
14530 set munmap d_munmap
14533 : see if nice exists
14537 : see if this is a langinfo.h system
14538 set langinfo.h i_langinfo
14541 : see if nl_langinfo exists
14542 set nl_langinfo d_nl_langinfo
14545 : check for length of character
14547 case "$charsize" in
14549 echo "Checking to see how big your characters are (hey, you never know)..." >&4
14552 #$i_stdlib I_STDLIB
14554 #include <stdlib.h>
14558 printf("%d\n", (int)sizeof(char));
14563 if eval $compile_ok; then
14567 echo "(I can't seem to compile the test program. Guessing...)"
14574 rp="What is the size of a character (in bytes)?"
14579 : check for volatile keyword
14581 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
14582 $cat >try.c <<'EOCP'
14585 typedef struct _goo_struct goo_struct;
14586 goo_struct * volatile goo = ((goo_struct *)0);
14587 struct _goo_struct {
14592 typedef unsigned short foo_t;
14593 char *volatile foo;
14595 volatile foo_t blech;
14599 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
14601 echo "Yup, it does."
14604 echo "Nope, it doesn't."
14612 $echo "Choosing the C types to be used for Perl's internal types..." >&4
14614 case "$use64bitint:$d_quad:$quadtype" in
14617 uvtype="$uquadtype"
14622 uvtype="unsigned long"
14628 case "$uselongdouble:$d_longdbl" in
14630 nvtype="long double"
14631 nvsize=$longdblsize
14638 $echo "(IV will be "$ivtype", $ivsize bytes)"
14639 $echo "(UV will be "$uvtype", $uvsize bytes)"
14640 $echo "(NV will be "$nvtype", $nvsize bytes)"
14643 #$i_inttypes I_INTTYPES
14645 #include <inttypes.h>
14650 int8_t i = INT8_MAX;
14651 uint8_t u = UINT8_MAX;
14652 printf("int8_t\n");
14655 int16_t i = INT16_MAX;
14656 uint16_t i = UINT16_MAX;
14657 printf("int16_t\n");
14660 int32_t i = INT32_MAX;
14661 uint32_t u = UINT32_MAX;
14662 printf("int32_t\n");
14668 '') case "$charsize" in
14670 u8type="unsigned char"
14679 if eval $compile; then
14680 case "`$run ./try`" in
14681 int8_t) i8type=int8_t
14691 '') if $test $charsize -ge 1; then
14693 u8type="unsigned char"
14701 '') case "$shortsize" in
14703 u16type="unsigned short"
14711 '') set try -DINT16
14712 if eval $compile; then
14713 case "`$run ./try`" in
14725 '') if $test $shortsize -ge 2; then
14727 u16type="unsigned short"
14735 '') case "$longsize" in
14737 u32type="unsigned long"
14741 *) case "$intsize" in
14743 u32type="unsigned int"
14753 '') set try -DINT32
14754 if eval $compile; then
14755 case "`$run ./try`" in
14767 '') if $test $intsize -ge 4; then
14769 u32type="unsigned int"
14777 '') case "$d_quad:$quadtype" in
14779 i64type="$quadtype"
14780 u64type="$uquadtype"
14788 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
14789 : volatile so that the compiler has to store it out to memory.
14790 if test X"$d_volatile" = X"$define"; then
14795 #$i_stdlib I_STDLIB
14797 #include <stdlib.h>
14799 #include <sys/types.h>
14800 #include <signal.h>
14802 $volatile int bletched = 0;
14803 $signal_t blech(s) int s; { bletched = 1; }
14808 int n = 8 * $uvsize;
14811 signal(SIGFPE, blech);
14814 for (i = 0; i < n; i++) {
14815 u = u << 1 | ($uvtype)1;
14817 if (($uvtype)d != u)
14821 d = ($nvtype)(u - 1);
14822 if (($uvtype)d != (u - 1))
14830 printf("%d\n", ((i == n) ? -n : i));
14836 d_nv_preserves_uv="$undef"
14837 if eval $compile; then
14838 nv_preserves_uv_bits="`$run ./try`"
14840 case "$nv_preserves_uv_bits" in
14842 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
14843 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
14844 d_nv_preserves_uv="$define"
14846 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
14847 d_nv_preserves_uv="$undef" ;;
14848 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
14849 nv_preserves_uv_bits="$undef" ;;
14854 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
14855 : volatile so that the compiler has to store it out to memory.
14856 if test X"$d_volatile" = X"$define"; then
14861 #$i_stdlib I_STDLIB
14863 #include <stdlib.h>
14865 #$i_string I_STRING
14867 # include <string.h>
14869 # include <strings.h>
14871 #include <sys/types.h>
14872 #include <signal.h>
14874 $volatile int bletched = 0;
14875 $signal_t blech(s) int s; { bletched = 1; }
14878 int checkit($nvtype d, char *where) {
14879 unsigned char *p = (char *)&d;
14880 unsigned char *end = p + sizeof(d);
14890 printf("No - %s: 0x", where);
14892 printf ("%02X", *p++);
14897 int main(int argc, char **argv) {
14900 fail += checkit(d, "0.0");
14902 /* The compiler shouldn't be assuming that bletched is 0 */
14905 fail += checkit(d, "bleched");
14908 signal(SIGFPE, blech);
14911 /* Paranoia - the compiler should have no way of knowing that ANSI says
14912 that argv[argc] will always be NULL. Actually, if it did assume this it
14913 would be buggy, as this is C and main() can be called from elsewhere in
14915 d = argv[argc] ? 1 : 0;
14918 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
14921 fail += checkit(d, "ternary");
14923 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
14926 printf("No - memset doesn't give 0.0\n");
14927 /* This might just blow up: */
14928 printf("(gives %g)\n", d);
14934 printf("No - something bleched\n");
14939 printf("No - %d fail(s)\n", fail);
14948 d_nv_zero_is_allbits_zero="$undef"
14949 if eval $compile; then
14955 0.0 is represented as all bits zero in memory
14957 d_nv_zero_is_allbits_zero="$define"
14960 0.0 is not represented as all bits zero in memory
14962 d_nv_zero_is_allbits_zero="$undef"
14967 0.0 is not represented as all bits zero in memory
14969 d_nv_zero_is_allbits_zero="$undef"
14977 : check for off64_t
14979 echo "Checking to see if you have off64_t..." >&4
14981 #include <sys/types.h>
14982 #include <unistd.h>
14983 int main() { off64_t x = 7; }
14986 if eval $compile; then
14988 echo "You have off64_t."
14991 echo "You do not have off64_t."
14992 case "$lseeksize" in
14993 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
15000 : how to create joinable pthreads
15001 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
15003 echo "Checking what constant to use for creating joinable pthreads..." >&4
15004 $cat >try.c <<'EOCP'
15005 #include <pthread.h>
15007 int detachstate = JOINABLE;
15010 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
15011 if eval $compile; then
15012 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
15013 val="$undef" # Yes, undef.
15014 set d_old_pthread_create_joinable
15017 set old_pthread_create_joinable
15020 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
15021 if eval $compile; then
15022 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
15024 set d_old_pthread_create_joinable
15026 val=PTHREAD_CREATE_UNDETACHED
15027 set old_pthread_create_joinable
15030 set try -DJOINABLE=__UNDETACHED
15031 if eval $compile; then
15032 echo "You seem to use __UNDETACHED." >&4
15034 set d_old_pthread_create_joinable
15037 set old_pthread_create_joinable
15040 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
15042 set d_old_pthread_create_joinable
15045 set old_pthread_create_joinable
15052 d_old_pthread_create_joinable="$undef"
15053 old_pthread_create_joinable=""
15056 : see if pause exists
15060 : see if pipe exists
15064 : see if poll exists
15068 : see if readlink exists
15069 set readlink d_readlink
15075 case "$d_readlink" in
15077 if $issymlink /proc/self/exe ; then
15078 $ls -l /proc/self/exe > reflect
15079 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15080 echo "You have Linux-like /proc/self/exe."
15081 procselfexe='"/proc/self/exe"'
15085 if $issymlink /proc/curproc/file ; then
15086 $ls -l /proc/curproc/file > reflect
15087 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15088 echo "You have BSD-like /proc/curproc/file."
15089 procselfexe='"/proc/curproc/file"'
15099 : see whether the pthread_atfork exists
15101 #include <pthread.h>
15104 #ifdef PTHREAD_ATFORK
15105 pthread_atfork(NULL,NULL,NULL);
15110 : see if pthread_atfork exists
15111 set try -DPTHREAD_ATFORK
15112 if eval $compile; then
15117 case "$usethreads" in
15120 $define) echo 'pthread_atfork found.' >&4 ;;
15121 *) echo 'pthread_atfork NOT found.' >&4 ;;
15124 set d_pthread_atfork
15127 : see if pthread_attr_setscope exists
15128 set pthread_attr_setscope d_pthread_attr_setscope
15132 : see whether the various POSIXish _yields exist
15134 #include <pthread.h>
15140 #ifdef PTHREAD_YIELD
15143 #ifdef PTHREAD_YIELD_NULL
15144 pthread_yield(NULL);
15150 : see if sched_yield exists
15151 set try -DSCHED_YIELD
15152 if eval $compile; then
15154 sched_yield='sched_yield()'
15158 case "$usethreads" in
15161 $define) echo 'sched_yield() found.' >&4 ;;
15162 *) echo 'sched_yield() NOT found.' >&4 ;;
15168 : see if pthread_yield exists
15169 set try -DPTHREAD_YIELD
15170 if eval $compile; then
15172 case "$sched_yield" in
15173 '') sched_yield='pthread_yield()' ;;
15176 set try -DPTHREAD_YIELD_NULL
15177 if eval $compile; then
15179 case "$sched_yield" in
15180 '') sched_yield='pthread_yield(NULL)' ;;
15186 case "$usethreads" in
15189 $define) echo 'pthread_yield() found.' >&4 ;;
15190 *) echo 'pthread_yield() NOT found.' >&4 ;;
15194 set d_pthread_yield
15197 case "$sched_yield" in
15198 '') sched_yield=undef ;;
15203 : see if random_r exists
15204 set random_r d_random_r
15206 case "$d_random_r" in
15208 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
15209 case "$d_random_r_proto:$usethreads" in
15210 ":define") d_random_r_proto=define
15211 set d_random_r_proto random_r $hdrs
15215 case "$d_random_r_proto" in
15217 case "$random_r_proto" in
15218 ''|0) try='int random_r(int*, struct random_data*);'
15219 ./protochk "extern $try" $hdrs && random_r_proto=I_iS ;;
15221 case "$random_r_proto" in
15222 ''|0) try='int random_r(long*, struct random_data*);'
15223 ./protochk "extern $try" $hdrs && random_r_proto=I_lS ;;
15225 case "$random_r_proto" in
15226 ''|0) try='int random_r(struct random_data*, int32_t*);'
15227 ./protochk "extern $try" $hdrs && random_r_proto=I_St ;;
15229 case "$random_r_proto" in
15230 ''|0) d_random_r=undef
15232 echo "Disabling random_r, cannot determine prototype." >&4 ;;
15233 * ) case "$random_r_proto" in
15234 REENTRANT_PROTO*) ;;
15235 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
15237 echo "Prototype: $try" ;;
15240 *) case "$usethreads" in
15241 define) echo "random_r has no prototype, not using it." >&4 ;;
15248 *) random_r_proto=0
15252 : see if readdir and friends exist
15253 set readdir d_readdir
15255 set seekdir d_seekdir
15257 set telldir d_telldir
15259 set rewinddir d_rewinddir
15262 : see if readdir64_r exists
15263 set readdir64_r d_readdir64_r
15265 case "$d_readdir64_r" in
15267 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15268 case "$d_readdir64_r_proto:$usethreads" in
15269 ":define") d_readdir64_r_proto=define
15270 set d_readdir64_r_proto readdir64_r $hdrs
15274 case "$d_readdir64_r_proto" in
15276 case "$readdir64_r_proto" in
15277 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
15278 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TSR ;;
15280 case "$readdir64_r_proto" in
15281 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
15282 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TS ;;
15284 case "$readdir64_r_proto" in
15285 ''|0) d_readdir64_r=undef
15286 readdir64_r_proto=0
15287 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
15288 * ) case "$readdir64_r_proto" in
15289 REENTRANT_PROTO*) ;;
15290 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
15292 echo "Prototype: $try" ;;
15295 *) case "$usethreads" in
15296 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
15298 d_readdir64_r=undef
15299 readdir64_r_proto=0
15303 *) readdir64_r_proto=0
15307 : see if readdir_r exists
15308 set readdir_r d_readdir_r
15310 case "$d_readdir_r" in
15312 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15313 case "$d_readdir_r_proto:$usethreads" in
15314 ":define") d_readdir_r_proto=define
15315 set d_readdir_r_proto readdir_r $hdrs
15319 case "$d_readdir_r_proto" in
15321 case "$readdir_r_proto" in
15322 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
15323 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TSR ;;
15325 case "$readdir_r_proto" in
15326 ''|0) try='int readdir_r(DIR*, struct dirent*);'
15327 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TS ;;
15329 case "$readdir_r_proto" in
15330 ''|0) d_readdir_r=undef
15332 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
15333 * ) case "$readdir_r_proto" in
15334 REENTRANT_PROTO*) ;;
15335 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
15337 echo "Prototype: $try" ;;
15340 *) case "$usethreads" in
15341 define) echo "readdir_r has no prototype, not using it." >&4 ;;
15348 *) readdir_r_proto=0
15352 : see if readv exists
15356 : see if recvmsg exists
15357 set recvmsg d_recvmsg
15360 : see if rename exists
15361 set rename d_rename
15364 : see if rmdir exists
15368 : see if memory.h is available.
15373 : See if it conflicts with string.h
15379 $cppstdin $cppflags $cppminus < $strings > mem.h
15380 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
15382 echo "We won't be including <memory.h>."
15392 : can bcopy handle overlapping blocks?
15395 case "$d_memmove" in
15396 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
15397 *) case "$d_bcopy" in
15399 echo "Checking to see if bcopy() can do overlapping copies..." >&4
15401 #$i_memory I_MEMORY
15402 #$i_stdlib I_STDLIB
15403 #$i_string I_STRING
15404 #$i_unistd I_UNISTD
15406 $cat >>try.c <<'EOCP'
15409 # include <memory.h>
15412 # include <stdlib.h>
15415 # include <string.h>
15417 # include <strings.h>
15420 # include <unistd.h> /* Needed for NetBSD */
15424 char buf[128], abc[128];
15430 /* Copy "abcde..." string to char abc[] so that gcc doesn't
15431 try to store the string in read-only memory. */
15432 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
15434 for (align = 7; align >= 0; align--) {
15435 for (len = 36; len; len--) {
15437 bcopy(abc, b, len);
15438 for (off = 1; off <= len; off++) {
15439 bcopy(b, b+off, len);
15440 bcopy(b+off, b, len);
15441 if (bcmp(b, abc, len))
15450 if eval $compile_ok; then
15451 if ./try 2>/dev/null; then
15452 echo "Yes, it can."
15455 echo "It can't, sorry."
15458 echo "(I can't compile the test program, so we'll assume not...)"
15462 $rm -f try.* try core
15468 : can memcpy handle overlapping blocks?
15471 case "$d_memmove" in
15472 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
15473 *) case "$d_memcpy" in
15475 echo "Checking to see if memcpy() can do overlapping copies..." >&4
15477 #$i_memory I_MEMORY
15478 #$i_stdlib I_STDLIB
15479 #$i_string I_STRING
15480 #$i_unistd I_UNISTD
15482 $cat >>try.c <<'EOCP'
15485 # include <memory.h>
15488 # include <stdlib.h>
15491 # include <string.h>
15493 # include <strings.h>
15496 # include <unistd.h> /* Needed for NetBSD */
15500 char buf[128], abc[128];
15506 /* Copy "abcde..." string to char abc[] so that gcc doesn't
15507 try to store the string in read-only memory. */
15508 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
15510 for (align = 7; align >= 0; align--) {
15511 for (len = 36; len; len--) {
15513 memcpy(b, abc, len);
15514 for (off = 1; off <= len; off++) {
15515 memcpy(b+off, b, len);
15516 memcpy(b, b+off, len);
15517 if (memcmp(b, abc, len))
15526 if eval $compile_ok; then
15527 if ./try 2>/dev/null; then
15528 echo "Yes, it can."
15531 echo "It can't, sorry."
15534 echo "(I can't compile the test program, so we'll assume not...)"
15538 $rm -f try.* try core
15544 : can memcmp be trusted to compare relative magnitude?
15546 case "$d_memcmp" in
15549 echo "Checking if your memcmp() can compare relative magnitude..." >&4
15551 #$i_memory I_MEMORY
15552 #$i_stdlib I_STDLIB
15553 #$i_string I_STRING
15554 #$i_unistd I_UNISTD
15556 $cat >>try.c <<'EOCP'
15559 # include <memory.h>
15562 # include <stdlib.h>
15565 # include <string.h>
15567 # include <strings.h>
15570 # include <unistd.h> /* Needed for NetBSD */
15576 if ((a < b) && memcmp(&a, &b, 1) < 0)
15582 if eval $compile_ok; then
15583 if $run ./try 2>/dev/null; then
15584 echo "Yes, it can."
15587 echo "No, it can't (it uses signed chars)."
15590 echo "(I can't compile the test program, so we'll assume not...)"
15594 $rm -f try.* try core
15598 : see if prototype for sbrk is available
15600 set d_sbrkproto sbrk $i_unistd unistd.h
15603 : see if select exists
15604 set select d_select
15607 : see if semctl exists
15608 set semctl d_semctl
15611 : see if semget exists
15612 set semget d_semget
15615 : see if semop exists
15619 : see how much of the 'sem*(2)' library is present.
15622 case "$d_semctl$d_semget$d_semop" in
15623 *"$undef"*) h_sem=false;;
15627 case "`ipcs 2>&1`" in
15628 "SVID messages"*"not configured"*)
15629 echo "Your $osname does not have the sem*(2) configured." >&4
15632 set semctl d_semctl
15634 set semget d_semget
15642 : we could also check for sys/ipc.h ...
15643 if $h_sem && $test `./findhdr sys/sem.h`; then
15644 echo "You have the full sem*(2) library." >&4
15647 echo "You don't have the full sem*(2) library." >&4
15653 : see whether sys/sem.h defines union semun
15655 $cat > try.c <<'END'
15656 #include <sys/types.h>
15657 #include <sys/ipc.h>
15658 #include <sys/sem.h>
15659 int main () { union semun semun; semun.buf = 0; }
15662 if eval $compile; then
15663 echo "You have union semun in <sys/sem.h>." >&4
15666 echo "You do not have union semun in <sys/sem.h>." >&4
15673 : see how to do semctl IPC_STAT
15680 # define S_IRUSR S_IREAD
15681 # define S_IWUSR S_IWRITE
15682 # define S_IXUSR S_IEXEC
15684 # define S_IRUSR 0400
15685 # define S_IWUSR 0200
15686 # define S_IXUSR 0100
15688 # define S_IRGRP (S_IRUSR>>3)
15689 # define S_IWGRP (S_IWUSR>>3)
15690 # define S_IXGRP (S_IXUSR>>3)
15691 # define S_IROTH (S_IRUSR>>6)
15692 # define S_IWOTH (S_IWUSR>>6)
15693 # define S_IXOTH (S_IXUSR>>6)
15696 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
15697 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
15698 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
15701 : see whether semctl IPC_STAT can use union semun
15703 case "$d_semctl_semun" in
15706 #include <sys/types.h>
15707 #include <sys/ipc.h>
15708 #include <sys/sem.h>
15709 #include <sys/stat.h>
15716 #$d_union_semun HAS_UNION_SEMUN
15719 #ifndef HAS_UNION_SEMUN
15722 struct semid_ds *buf;
15723 unsigned short *array;
15729 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
15730 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
15732 struct semid_ds argbuf;
15735 st = semctl(sem, 0, IPC_STAT, arg);
15739 # endif /* IPC_STAT */
15740 printf("semctl IPC_STAT failed: errno = %d\n", errno);
15742 if (semctl(sem, 0, IPC_RMID, arg) != 0)
15743 # endif /* IPC_RMID */
15744 printf("semctl IPC_RMID failed: errno = %d\n", errno);
15746 #endif /* IPC_PRIVATE && ... */
15747 printf("semget failed: errno = %d\n", errno);
15752 if eval $compile; then
15755 semun) val="$define" ;;
15763 case "$d_semctl_semun" in
15765 echo "You can use union semun for semctl IPC_STAT." >&4
15768 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
15773 : see whether semctl IPC_STAT can use struct semid_ds pointer
15775 case "$d_semctl_semid_ds" in
15777 $cat > try.c <<'END'
15778 #include <sys/types.h>
15779 #include <sys/ipc.h>
15780 #include <sys/sem.h>
15781 #include <sys/stat.h>
15789 struct semid_ds arg;
15792 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
15793 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
15796 st = semctl(sem, 0, IPC_STAT, &arg);
15798 printf("semid_ds\n");
15800 # endif /* IPC_STAT */
15801 printf("semctl IPC_STAT failed: errno = %d\n", errno);
15803 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
15804 # endif /* IPC_RMID */
15805 printf("semctl IPC_RMID failed: errno = %d\n", errno);
15807 #endif /* IPC_PRIVATE && ... */
15808 printf("semget failed: errno = %d\n", errno);
15814 if eval $compile; then
15817 semid_ds) val="$define" ;;
15823 set d_semctl_semid_ds
15825 case "$d_semctl_semid_ds" in
15827 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
15829 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
15836 # We do not have the full sem*(2) library, so assume we can not
15842 set d_semctl_semid_ds
15847 : see if sendmsg exists
15848 set sendmsg d_sendmsg
15851 : see if setegid exists
15852 set setegid d_setegid
15855 : see if seteuid exists
15856 set seteuid d_seteuid
15859 : see if setgrent exists
15860 set setgrent d_setgrent
15863 : see if setgrent_r exists
15864 set setgrent_r d_setgrent_r
15866 case "$d_setgrent_r" in
15868 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
15869 case "$d_setgrent_r_proto:$usethreads" in
15870 ":define") d_setgrent_r_proto=define
15871 set d_setgrent_r_proto setgrent_r $hdrs
15875 case "$d_setgrent_r_proto" in
15877 case "$setgrent_r_proto" in
15878 ''|0) try='int setgrent_r(FILE**);'
15879 ./protochk "extern $try" $hdrs && setgrent_r_proto=I_H ;;
15881 case "$setgrent_r_proto" in
15882 ''|0) try='void setgrent_r(FILE**);'
15883 ./protochk "extern $try" $hdrs && setgrent_r_proto=V_H ;;
15885 case "$setgrent_r_proto" in
15886 ''|0) d_setgrent_r=undef
15888 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
15889 * ) case "$setgrent_r_proto" in
15890 REENTRANT_PROTO*) ;;
15891 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
15893 echo "Prototype: $try" ;;
15896 *) case "$usethreads" in
15897 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
15904 *) setgrent_r_proto=0
15908 : see if sethostent exists
15909 set sethostent d_sethent
15912 : see if sethostent_r exists
15913 set sethostent_r d_sethostent_r
15915 case "$d_sethostent_r" in
15917 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15918 case "$d_sethostent_r_proto:$usethreads" in
15919 ":define") d_sethostent_r_proto=define
15920 set d_sethostent_r_proto sethostent_r $hdrs
15924 case "$d_sethostent_r_proto" in
15926 case "$sethostent_r_proto" in
15927 ''|0) try='int sethostent_r(int, struct hostent_data*);'
15928 ./protochk "extern $try" $hdrs && sethostent_r_proto=I_ID ;;
15930 case "$sethostent_r_proto" in
15931 ''|0) try='void sethostent_r(int, struct hostent_data*);'
15932 ./protochk "extern $try" $hdrs && sethostent_r_proto=V_ID ;;
15934 case "$sethostent_r_proto" in
15935 ''|0) d_sethostent_r=undef
15936 sethostent_r_proto=0
15937 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
15938 * ) case "$sethostent_r_proto" in
15939 REENTRANT_PROTO*) ;;
15940 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
15942 echo "Prototype: $try" ;;
15945 *) case "$usethreads" in
15946 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
15948 d_sethostent_r=undef
15949 sethostent_r_proto=0
15953 *) sethostent_r_proto=0
15957 : see if setitimer exists
15958 set setitimer d_setitimer
15961 : see if setlinebuf exists
15962 set setlinebuf d_setlinebuf
15965 : see if setlocale exists
15966 set setlocale d_setlocale
15969 : see if locale.h is available
15970 set locale.h i_locale
15973 : see if setlocale_r exists
15974 set setlocale_r d_setlocale_r
15976 case "$d_setlocale_r" in
15978 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
15979 case "$d_setlocale_r_proto:$usethreads" in
15980 ":define") d_setlocale_r_proto=define
15981 set d_setlocale_r_proto setlocale_r $hdrs
15985 case "$d_setlocale_r_proto" in
15987 case "$setlocale_r_proto" in
15988 ''|0) try='int setlocale_r(int, const char*, char*, int);'
15989 ./protochk "extern $try" $hdrs && setlocale_r_proto=I_ICBI ;;
15991 case "$setlocale_r_proto" in
15992 ''|0) d_setlocale_r=undef
15993 setlocale_r_proto=0
15994 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
15995 * ) case "$setlocale_r_proto" in
15996 REENTRANT_PROTO*) ;;
15997 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
15999 echo "Prototype: $try" ;;
16002 *) case "$usethreads" in
16003 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
16005 d_setlocale_r=undef
16006 setlocale_r_proto=0
16010 *) setlocale_r_proto=0
16014 : see if setnetent exists
16015 set setnetent d_setnent
16018 : see if setnetent_r exists
16019 set setnetent_r d_setnetent_r
16021 case "$d_setnetent_r" in
16023 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16024 case "$d_setnetent_r_proto:$usethreads" in
16025 ":define") d_setnetent_r_proto=define
16026 set d_setnetent_r_proto setnetent_r $hdrs
16030 case "$d_setnetent_r_proto" in
16032 case "$setnetent_r_proto" in
16033 ''|0) try='int setnetent_r(int, struct netent_data*);'
16034 ./protochk "extern $try" $hdrs && setnetent_r_proto=I_ID ;;
16036 case "$setnetent_r_proto" in
16037 ''|0) try='void setnetent_r(int, struct netent_data*);'
16038 ./protochk "extern $try" $hdrs && setnetent_r_proto=V_ID ;;
16040 case "$setnetent_r_proto" in
16041 ''|0) d_setnetent_r=undef
16042 setnetent_r_proto=0
16043 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
16044 * ) case "$setnetent_r_proto" in
16045 REENTRANT_PROTO*) ;;
16046 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
16048 echo "Prototype: $try" ;;
16051 *) case "$usethreads" in
16052 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
16054 d_setnetent_r=undef
16055 setnetent_r_proto=0
16059 *) setnetent_r_proto=0
16063 : see if setprotoent exists
16064 set setprotoent d_setpent
16067 : see if setpgid exists
16068 set setpgid d_setpgid
16071 : see if setpgrp2 exists
16072 set setpgrp2 d_setpgrp2
16075 : see if setpriority exists
16076 set setpriority d_setprior
16079 : see if setproctitle exists
16080 set setproctitle d_setproctitle
16083 : see if setprotoent_r exists
16084 set setprotoent_r d_setprotoent_r
16086 case "$d_setprotoent_r" in
16088 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16089 case "$d_setprotoent_r_proto:$usethreads" in
16090 ":define") d_setprotoent_r_proto=define
16091 set d_setprotoent_r_proto setprotoent_r $hdrs
16095 case "$d_setprotoent_r_proto" in
16097 case "$setprotoent_r_proto" in
16098 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
16099 ./protochk "extern $try" $hdrs && setprotoent_r_proto=I_ID ;;
16101 case "$setprotoent_r_proto" in
16102 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
16103 ./protochk "extern $try" $hdrs && setprotoent_r_proto=V_ID ;;
16105 case "$setprotoent_r_proto" in
16106 ''|0) d_setprotoent_r=undef
16107 setprotoent_r_proto=0
16108 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
16109 * ) case "$setprotoent_r_proto" in
16110 REENTRANT_PROTO*) ;;
16111 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
16113 echo "Prototype: $try" ;;
16116 *) case "$usethreads" in
16117 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
16119 d_setprotoent_r=undef
16120 setprotoent_r_proto=0
16124 *) setprotoent_r_proto=0
16128 : see if setpwent exists
16129 set setpwent d_setpwent
16132 : see if setpwent_r exists
16133 set setpwent_r d_setpwent_r
16135 case "$d_setpwent_r" in
16137 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
16138 case "$d_setpwent_r_proto:$usethreads" in
16139 ":define") d_setpwent_r_proto=define
16140 set d_setpwent_r_proto setpwent_r $hdrs
16144 case "$d_setpwent_r_proto" in
16146 case "$setpwent_r_proto" in
16147 ''|0) try='int setpwent_r(FILE**);'
16148 ./protochk "extern $try" $hdrs && setpwent_r_proto=I_H ;;
16150 case "$setpwent_r_proto" in
16151 ''|0) try='void setpwent_r(FILE**);'
16152 ./protochk "extern $try" $hdrs && setpwent_r_proto=V_H ;;
16154 case "$setpwent_r_proto" in
16155 ''|0) d_setpwent_r=undef
16157 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
16158 * ) case "$setpwent_r_proto" in
16159 REENTRANT_PROTO*) ;;
16160 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
16162 echo "Prototype: $try" ;;
16165 *) case "$usethreads" in
16166 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
16173 *) setpwent_r_proto=0
16177 : see if setregid exists
16178 set setregid d_setregid
16180 set setresgid d_setresgid
16183 : see if setreuid exists
16184 set setreuid d_setreuid
16186 set setresuid d_setresuid
16189 : see if setrgid exists
16190 set setrgid d_setrgid
16193 : see if setruid exists
16194 set setruid d_setruid
16197 : see if setservent exists
16198 set setservent d_setsent
16201 : see if setservent_r exists
16202 set setservent_r d_setservent_r
16204 case "$d_setservent_r" in
16206 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16207 case "$d_setservent_r_proto:$usethreads" in
16208 ":define") d_setservent_r_proto=define
16209 set d_setservent_r_proto setservent_r $hdrs
16213 case "$d_setservent_r_proto" in
16215 case "$setservent_r_proto" in
16216 ''|0) try='int setservent_r(int, struct servent_data*);'
16217 ./protochk "extern $try" $hdrs && setservent_r_proto=I_ID ;;
16219 case "$setservent_r_proto" in
16220 ''|0) try='void setservent_r(int, struct servent_data*);'
16221 ./protochk "extern $try" $hdrs && setservent_r_proto=V_ID ;;
16223 case "$setservent_r_proto" in
16224 ''|0) d_setservent_r=undef
16225 setservent_r_proto=0
16226 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
16227 * ) case "$setservent_r_proto" in
16228 REENTRANT_PROTO*) ;;
16229 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
16231 echo "Prototype: $try" ;;
16234 *) case "$usethreads" in
16235 define) echo "setservent_r has no prototype, not using it." >&4 ;;
16237 d_setservent_r=undef
16238 setservent_r_proto=0
16242 *) setservent_r_proto=0
16246 : see if setsid exists
16247 set setsid d_setsid
16250 : see if setvbuf exists
16251 set setvbuf d_setvbuf
16254 : see if sfio.h is available
16259 : see if sfio library is available
16270 : Ok, but do we want to use it.
16274 true|$define|[yY]*) dflt='y';;
16277 echo "$package can use the sfio library, but it is experimental."
16278 case "$useperlio" in
16280 echo "For sfio also the PerlIO abstraction layer is needed."
16281 echo "Earlier you said you wouldn't want that."
16284 rp="You seem to have sfio available, do you want to try using it?"
16287 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
16288 useperlio="$define"
16291 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
16296 *) case "$usesfio" in
16297 true|$define|[yY]*)
16298 echo "Sorry, cannot find sfio on this machine." >&4
16299 echo "Ignoring your setting of usesfio=$usesfio." >&4
16308 $define) usesfio='true';;
16309 *) usesfio='false';;
16313 *) : Remove sfio from list of libraries to use
16316 echo "Removing unneeded -lsfio from library list" >&4
16317 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
16320 echo "libs = $libs" >&4
16327 : see if shmctl exists
16328 set shmctl d_shmctl
16331 : see if shmget exists
16332 set shmget d_shmget
16335 : see if shmat exists
16338 : see what shmat returns
16341 $cat >shmat.c <<'END'
16342 #include <sys/shm.h>
16345 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
16350 echo "and it returns ($shmattype)." >&4
16351 : see if a prototype for shmat is available
16352 xxx=`./findhdr sys/shm.h`
16353 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
16354 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
16365 set d_shmatprototype
16368 : see if shmdt exists
16372 : see how much of the 'shm*(2)' library is present.
16375 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
16376 *"$undef"*) h_shm=false;;
16380 case "`ipcs 2>&1`" in
16381 "SVID shared memory"*"not configured"*)
16382 echo "Your $osname does not have the shm*(2) configured." >&4
16385 set shmctl d_shmctl
16387 set shmget d_shmget
16397 : we could also check for sys/ipc.h ...
16398 if $h_shm && $test `./findhdr sys/shm.h`; then
16399 echo "You have the full shm*(2) library." >&4
16402 echo "You don't have the full shm*(2) library." >&4
16409 : see if we have sigaction
16410 if set sigaction val -f d_sigaction; eval $csym; $val; then
16411 echo 'sigaction() found.' >&4
16414 #include <sys/types.h>
16415 #include <signal.h>
16416 #$i_stdlib I_STDLIB
16418 #include <stdlib.h>
16422 struct sigaction act, oact;
16424 oact.sa_handler = 0;
16425 /* so that act and oact are used */
16426 exit(act.sa_flags == 0 && oact.sa_handler == 0);
16430 if eval $compile_ok; then
16433 echo "But you don't seem to have a useable struct sigaction." >&4
16437 echo 'sigaction NOT found.' >&4
16440 set d_sigaction; eval $setvar
16441 $rm -f try try$_o try.c
16443 : see if sigprocmask exists
16444 set sigprocmask d_sigprocmask
16447 : see if sigsetjmp exists
16449 case "$d_sigsetjmp" in
16452 #include <setjmp.h>
16453 #$i_stdlib I_STDLIB
16455 #include <stdlib.h>
16461 if (sigsetjmp(env,1))
16464 siglongjmp(env, 1);
16469 if eval $compile; then
16470 if $run ./try >/dev/null 2>&1; then
16471 echo "POSIX sigsetjmp found." >&4
16475 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
16481 echo "sigsetjmp not found." >&4
16485 *) val="$d_sigsetjmp"
16486 case "$d_sigsetjmp" in
16487 $define) echo "POSIX sigsetjmp found." >&4;;
16488 $undef) echo "sigsetjmp not found." >&4;;
16496 : see if sockatmark exists
16497 set sockatmark d_sockatmark
16500 : see if prototype for sockatmark is available
16502 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
16505 : see if socks5_init exists
16506 set socks5_init d_socks5_init
16509 : see if srand48_r exists
16510 set srand48_r d_srand48_r
16512 case "$d_srand48_r" in
16514 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16515 case "$d_srand48_r_proto:$usethreads" in
16516 ":define") d_srand48_r_proto=define
16517 set d_srand48_r_proto srand48_r $hdrs
16521 case "$d_srand48_r_proto" in
16523 case "$srand48_r_proto" in
16524 ''|0) try='int srand48_r(long, struct drand48_data*);'
16525 ./protochk "extern $try" $hdrs && srand48_r_proto=I_LS ;;
16527 case "$srand48_r_proto" in
16528 ''|0) d_srand48_r=undef
16530 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
16531 * ) case "$srand48_r_proto" in
16532 REENTRANT_PROTO*) ;;
16533 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
16535 echo "Prototype: $try" ;;
16538 *) case "$usethreads" in
16539 define) echo "srand48_r has no prototype, not using it." >&4 ;;
16546 *) srand48_r_proto=0
16550 : see if srandom_r exists
16551 set srandom_r d_srandom_r
16553 case "$d_srandom_r" in
16555 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16556 case "$d_srandom_r_proto:$usethreads" in
16557 ":define") d_srandom_r_proto=define
16558 set d_srandom_r_proto srandom_r $hdrs
16562 case "$d_srandom_r_proto" in
16564 case "$srandom_r_proto" in
16565 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
16566 ./protochk "extern $try" $hdrs && srandom_r_proto=I_TS ;;
16568 case "$srandom_r_proto" in
16569 ''|0) d_srandom_r=undef
16571 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
16572 * ) case "$srandom_r_proto" in
16573 REENTRANT_PROTO*) ;;
16574 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
16576 echo "Prototype: $try" ;;
16579 *) case "$usethreads" in
16580 define) echo "srandom_r has no prototype, not using it." >&4 ;;
16587 *) srandom_r_proto=0
16591 : see if prototype for setresgid is available
16593 set d_sresgproto setresgid $i_unistd unistd.h
16596 : see if prototype for setresuid is available
16598 set d_sresuproto setresuid $i_unistd unistd.h
16601 : see if sys/stat.h is available
16602 set sys/stat.h i_sysstat
16606 : see if stat knows about block sizes
16608 echo "Checking to see if your struct stat has st_blocks field..." >&4
16609 set d_statblks stat st_blocks $i_sysstat sys/stat.h
16613 : see if this is a sys/vfs.h system
16614 set sys/vfs.h i_sysvfs
16618 : see if this is a sys/statfs.h system
16619 set sys/statfs.h i_sysstatfs
16624 echo "Checking to see if your system supports struct statfs..." >&4
16625 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
16627 case "$d_statfs_s" in
16628 "$define") echo "Yes, it does." ;;
16629 *) echo "No, it doesn't." ;;
16634 : see if struct statfs knows about f_flags
16635 case "$d_statfs_s" in
16638 echo "Checking to see if your struct statfs has f_flags field..." >&4
16639 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
16643 set d_statfs_f_flags
16647 case "$d_statfs_f_flags" in
16648 "$define") echo "Yes, it does." ;;
16649 *) echo "No, it doesn't." ;;
16653 Checking how to access stdio streams by file descriptor number...
16655 case "$stdio_stream_array" in
16656 '') $cat >try.c <<EOCP
16659 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
16663 for s in _iob __iob __sF
16665 set try -DSTDIO_STREAM_ARRAY=$s
16666 if eval $compile; then
16667 case "`$run ./try`" in
16668 yes) stdio_stream_array=$s; break ;;
16672 $rm -f try.* try$exe_ext
16674 case "$stdio_stream_array" in
16676 I can't figure out how to access stdio streams by file descriptor number.
16678 d_stdio_stream_array="$undef"
16681 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
16683 d_stdio_stream_array="$define"
16687 : see if strcoll exists
16688 set strcoll d_strcoll
16691 : check for structure copying
16693 echo "Checking to see if your C compiler can copy structs..." >&4
16694 $cat >try.c <<'EOCP'
16704 if $cc -c try.c >/dev/null 2>&1 ; then
16706 echo "Yup, it can."
16709 echo "Nope, it can't."
16715 : see if strerror and/or sys_errlist[] exist
16717 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
16718 if set strerror val -f d_strerror; eval $csym; $val; then
16719 echo 'strerror() found.' >&4
16720 d_strerror="$define"
16721 d_strerrm='strerror(e)'
16722 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
16723 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
16724 d_syserrlst="$define"
16726 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
16727 d_syserrlst="$undef"
16729 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
16730 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
16731 echo 'strerror() found in string header.' >&4
16732 d_strerror="$define"
16733 d_strerrm='strerror(e)'
16734 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
16735 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
16736 d_syserrlst="$define"
16738 echo "(You don't appear to have any sys_errlist[], how can this be?)"
16739 d_syserrlst="$undef"
16741 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
16742 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
16743 d_strerror="$undef"
16744 d_syserrlst="$define"
16745 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
16747 echo 'strerror() and sys_errlist[] NOT found.' >&4
16748 d_strerror="$undef"
16749 d_syserrlst="$undef"
16750 d_strerrm='"unknown"'
16754 : see if strerror_r exists
16755 set strerror_r d_strerror_r
16757 case "$d_strerror_r" in
16759 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
16760 case "$d_strerror_r_proto:$usethreads" in
16761 ":define") d_strerror_r_proto=define
16762 set d_strerror_r_proto strerror_r $hdrs
16766 case "$d_strerror_r_proto" in
16768 case "$strerror_r_proto" in
16769 ''|0) try='int strerror_r(int, char*, size_t);'
16770 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBW ;;
16772 case "$strerror_r_proto" in
16773 ''|0) try='int strerror_r(int, char*, int);'
16774 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBI ;;
16776 case "$strerror_r_proto" in
16777 ''|0) try='char* strerror_r(int, char*, size_t);'
16778 ./protochk "extern $try" $hdrs && strerror_r_proto=B_IBW ;;
16780 case "$strerror_r_proto" in
16781 ''|0) d_strerror_r=undef
16783 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
16784 * ) case "$strerror_r_proto" in
16785 REENTRANT_PROTO*) ;;
16786 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
16788 echo "Prototype: $try" ;;
16791 *) case "$usethreads" in
16792 define) echo "strerror_r has no prototype, not using it." >&4 ;;
16799 *) strerror_r_proto=0
16803 : see if strftime exists
16804 set strftime d_strftime
16807 : see if strlcat exists
16808 set strlcat d_strlcat
16811 : see if strlcpy exists
16812 set strlcpy d_strlcpy
16815 : see if strtod exists
16816 set strtod d_strtod
16819 : see if strtol exists
16820 set strtol d_strtol
16823 : see if strtold exists
16824 set strtold d_strtold
16827 : see if strtoll exists
16828 set strtoll d_strtoll
16831 case "$d_longlong-$d_strtoll" in
16834 Checking whether your strtoll() works okay...
16836 $cat >try.c <<'EOCP'
16839 #define strtoll __strtoll
16842 #define strtoll _strtoll
16845 extern long long int strtoll(char *s, char **, int);
16846 static int bad = 0;
16847 int check(char *s, long long ell, int een) {
16850 gll = strtoll(s, 0, 10);
16851 if (!((gll == ell) && (errno == een)))
16855 check(" 1", 1LL, 0);
16856 check(" 0", 0LL, 0);
16857 check("-1", -1LL, 0);
16858 check("-9223372036854775808", -9223372036854775808LL, 0);
16859 check("-9223372036854775808", -9223372036854775808LL, 0);
16860 check(" 9223372036854775807", 9223372036854775807LL, 0);
16861 check("-9223372036854775808", -9223372036854775808LL, 0);
16862 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
16863 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
16869 if eval $compile; then
16872 ok) echo "Your strtoll() seems to be working okay." ;;
16874 Your strtoll() doesn't seem to be working okay.
16880 echo "(I can't seem to compile the test program--assuming it doesn't)"
16886 : see if strtoq exists
16887 set strtoq d_strtoq
16890 : see if strtoul exists
16891 set strtoul d_strtoul
16894 case "$d_strtoul" in
16897 Checking whether your strtoul() works okay...
16899 $cat >try.c <<'EOCP'
16902 extern unsigned long int strtoul(char *s, char **, int);
16903 static int bad = 0;
16904 void check(char *s, unsigned long eul, int een) {
16907 gul = strtoul(s, 0, 10);
16908 if (!((gul == eul) && (errno == een)))
16912 check(" 1", 1L, 0);
16913 check(" 0", 0L, 0);
16915 case "$longsize" in
16917 $cat >>try.c <<'EOCP'
16918 check("18446744073709551615", 18446744073709551615UL, 0);
16919 check("18446744073709551616", 18446744073709551615UL, ERANGE);
16920 #if 0 /* strtoul() for /^-/ strings is undefined. */
16921 check("-1", 18446744073709551615UL, 0);
16922 check("-18446744073709551614", 2, 0);
16923 check("-18446744073709551615", 1, 0);
16924 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
16925 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
16930 $cat >>try.c <<'EOCP'
16931 check("4294967295", 4294967295UL, 0);
16932 check("4294967296", 4294967295UL, ERANGE);
16933 #if 0 /* strtoul() for /^-/ strings is undefined. */
16934 check("-1", 4294967295UL, 0);
16935 check("-4294967294", 2, 0);
16936 check("-4294967295", 1, 0);
16937 check("-4294967296", 4294967295UL, ERANGE);
16938 check("-4294967297", 4294967295UL, ERANGE);
16943 : Should we write these tests to be more portable by sprintf-ing
16944 : ~0 and then manipulating that char string as input for strtol?
16947 $cat >>try.c <<'EOCP'
16954 if eval $compile; then
16955 case "`$run ./try`" in
16956 ok) echo "Your strtoul() seems to be working okay." ;;
16958 Your strtoul() doesn't seem to be working okay.
16967 : see if strtoull exists
16968 set strtoull d_strtoull
16971 case "$d_longlong-$d_strtoull" in
16974 Checking whether your strtoull() works okay...
16976 $cat >try.c <<'EOCP'
16979 #define strtoull __strtoull
16982 extern unsigned long long int strtoull(char *s, char **, int);
16983 static int bad = 0;
16984 int check(char *s, long long eull, int een) {
16987 gull = strtoull(s, 0, 10);
16988 if (!((gull == eull) && (errno == een)))
16992 check(" 1", 1LL, 0);
16993 check(" 0", 0LL, 0);
16994 check("18446744073709551615", 18446744073709551615ULL, 0);
16995 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
16996 #if 0 /* strtoull() for /^-/ strings is undefined. */
16997 check("-1", 18446744073709551615ULL, 0);
16998 check("-18446744073709551614", 2LL, 0);
16999 check("-18446744073709551615", 1LL, 0);
17000 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17001 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17008 if eval $compile; then
17009 case "`$run ./try`" in
17010 ok) echo "Your strtoull() seems to be working okay." ;;
17012 Your strtoull() doesn't seem to be working okay.
17014 d_strtoull="$undef"
17021 : see if strtouq exists
17022 set strtouq d_strtouq
17025 case "$d_strtouq" in
17028 Checking whether your strtouq() works okay...
17030 $cat >try.c <<'EOCP'
17033 extern unsigned long long int strtouq(char *s, char **, int);
17034 static int bad = 0;
17035 void check(char *s, unsigned long long eull, int een) {
17036 unsigned long long gull;
17038 gull = strtouq(s, 0, 10);
17039 if (!((gull == eull) && (errno == een)))
17043 check(" 1", 1LL, 0);
17044 check(" 0", 0LL, 0);
17045 check("18446744073709551615", 18446744073709551615ULL, 0);
17046 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17047 #if 0 /* strtouq() for /^-/ strings is undefined. */
17048 check("-1", 18446744073709551615ULL, 0);
17049 check("-18446744073709551614", 2LL, 0);
17050 check("-18446744073709551615", 1LL, 0);
17051 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17052 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17060 if eval $compile; then
17061 case "`$run ./try`" in
17062 ok) echo "Your strtouq() seems to be working okay." ;;
17064 Your strtouq() doesn't seem to be working okay.
17073 : see if strxfrm exists
17074 set strxfrm d_strxfrm
17077 : see if symlink exists
17078 set symlink d_symlink
17081 : see if syscall exists
17082 set syscall d_syscall
17085 : see if prototype for syscall is available
17087 set d_syscallproto syscall $i_unistd unistd.h
17090 : see if sysconf exists
17091 set sysconf d_sysconf
17094 : see if system exists
17095 set system d_system
17098 : see if tcgetpgrp exists
17099 set tcgetpgrp d_tcgetpgrp
17102 : see if tcsetpgrp exists
17103 set tcsetpgrp d_tcsetpgrp
17106 : see if prototype for telldir is available
17108 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
17111 : see if time exists
17113 if test "X$d_time" = X -o X"$timetype" = X; then
17114 if set time val -f d_time; eval $csym; $val; then
17115 echo 'time() found.' >&4
17117 rp="What is the type returned by time() on this system?"
17118 set time_t timetype long stdio.h sys/types.h
17121 echo 'time() not found, hope that will do.' >&4
17129 : see if this is a sys/times.h system
17130 set sys/times.h i_systimes
17133 : see if times exists
17135 if set times val -f d_times; eval $csym; $val; then
17136 echo 'times() found.' >&4
17139 case "$i_systimes" in
17140 "$define") inc='sys/times.h';;
17142 rp="What is the type returned by times() on this system?"
17143 set clock_t clocktype long stdio.h sys/types.h $inc
17146 echo 'times() NOT found, hope that will do.' >&4
17151 : see if tmpnam_r exists
17152 set tmpnam_r d_tmpnam_r
17154 case "$d_tmpnam_r" in
17156 hdrs="$i_systypes sys/types.h define stdio.h "
17157 case "$d_tmpnam_r_proto:$usethreads" in
17158 ":define") d_tmpnam_r_proto=define
17159 set d_tmpnam_r_proto tmpnam_r $hdrs
17163 case "$d_tmpnam_r_proto" in
17165 case "$tmpnam_r_proto" in
17166 ''|0) try='char* tmpnam_r(char*);'
17167 ./protochk "extern $try" $hdrs && tmpnam_r_proto=B_B ;;
17169 case "$tmpnam_r_proto" in
17170 ''|0) d_tmpnam_r=undef
17172 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
17173 * ) case "$tmpnam_r_proto" in
17174 REENTRANT_PROTO*) ;;
17175 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
17177 echo "Prototype: $try" ;;
17180 *) case "$usethreads" in
17181 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
17188 *) tmpnam_r_proto=0
17192 : see if truncate exists
17193 set truncate d_truncate
17196 : see if ttyname_r exists
17197 set ttyname_r d_ttyname_r
17199 case "$d_ttyname_r" in
17201 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
17202 case "$d_ttyname_r_proto:$usethreads" in
17203 ":define") d_ttyname_r_proto=define
17204 set d_ttyname_r_proto ttyname_r $hdrs
17208 case "$d_ttyname_r_proto" in
17210 case "$ttyname_r_proto" in
17211 ''|0) try='int ttyname_r(int, char*, size_t);'
17212 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBW ;;
17214 case "$ttyname_r_proto" in
17215 ''|0) try='int ttyname_r(int, char*, int);'
17216 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBI ;;
17218 case "$ttyname_r_proto" in
17219 ''|0) try='char* ttyname_r(int, char*, int);'
17220 ./protochk "extern $try" $hdrs && ttyname_r_proto=B_IBI ;;
17222 case "$ttyname_r_proto" in
17223 ''|0) d_ttyname_r=undef
17225 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
17226 * ) case "$ttyname_r_proto" in
17227 REENTRANT_PROTO*) ;;
17228 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
17230 echo "Prototype: $try" ;;
17233 *) case "$usethreads" in
17234 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
17241 *) ttyname_r_proto=0
17245 : see if tzname[] exists
17247 if set tzname val -a d_tzname; eval $csym; $val; then
17249 echo 'tzname[] found.' >&4
17252 echo 'tzname[] NOT found.' >&4
17258 next|rhapsody|darwin) multiarch="$define" ;;
17260 case "$multiarch" in
17261 ''|[nN]*) multiarch="$undef" ;;
17264 : check for ordering of bytes in a UV
17266 case "$usecrosscompile$multiarch" in
17269 You seem to be either cross-compiling or doing a multiarchitecture build,
17270 skipping the byteorder check.
17276 case "$byteorder" in
17279 In the following, larger digits indicate more significance. A big-endian
17280 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
17281 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
17282 machines may have weird orders like 3412. A Cray will report 87654321,
17283 an Alpha will report 12345678. If the test program works the default is
17285 I'm now running the test program...
17289 #$i_stdlib I_STDLIB
17291 #include <stdlib.h>
17293 #include <sys/types.h>
17294 typedef $uvtype UV;
17304 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
17306 u.l = (UV)0x04030201;
17307 for (i = 0; i < $uvsize; i++)
17308 printf("%c", u.c[i]+'0');
17315 if eval $compile && ./try > /dev/null; then
17318 [1-4][1-4][1-4][1-4]|12345678|87654321)
17319 echo "(The test program ran ok.)"
17320 echo "byteorder=$dflt"
17323 ????|????????) echo "(The test program ran ok.)" ;;
17324 *) echo "(The test program didn't run right for some reason.)" ;;
17329 (I can't seem to compile the test program. Guessing big-endian...)
17332 case "$xxx_prompt" in
17334 rp="What is the order of bytes in $uvtype?"
17350 Checking to see whether you can access character data unalignedly...
17352 case "$d_u32align" in
17353 '') $cat >try.c <<EOCP
17355 #$i_stdlib I_STDLIB
17357 #include <stdlib.h>
17359 #define U32 $u32type
17360 #define BYTEORDER 0x$byteorder
17362 #include <signal.h>
17364 $signal_t bletch(s) int s; { exit(4); }
17367 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
17372 if (sizeof(U32) != 4) {
17373 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
17380 signal(SIGBUS, bletch);
17392 for (i = 0; i < 4; i++) {
17393 up = (U32*)(buf + i);
17394 if (! ((*up == 1 << (8*i)) || /* big-endian */
17395 (*up == 1 << (8*(3-i))) /* little-endian */
17399 printf("read failed (%x)\n", *up);
17405 for (i = 0; i < 4; i++) {
17406 up = (U32*)(buf + i);
17408 if (*up != 0xBeef) {
17409 printf("write failed (%x)\n", *up);
17423 if eval $compile_ok; then
17424 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
17425 $run ./try 2>&1 >/dev/null
17428 You can access character data pretty unalignedly.
17430 d_u32align="$undef"
17433 It seems that you must access character data in an aligned manner.
17435 d_u32align="$define"
17439 rp='Can you access character data at unaligned addresses?'
17443 [yY]*) d_u32align="$undef" ;;
17444 *) d_u32align="$define" ;;
17447 $rm -f core core.try.* try.core
17451 : see if ualarm exists
17452 set ualarm d_ualarm
17455 : see if umask exists
17459 : see if unordered exists
17460 set unordered d_unordered
17463 : see if usleep exists
17464 set usleep d_usleep
17467 : see if prototype for usleep is available
17469 set d_usleepproto usleep $i_unistd unistd.h
17472 : see if ustat exists
17476 : backward compatibility for d_hvfork
17477 if test X$d_hvfork != X; then
17478 d_vfork="$d_hvfork"
17481 : see if there is a vfork
17486 : Ok, but do we want to use it. vfork is reportedly unreliable in
17487 : perl on Solaris 2.x, and probably elsewhere.
17491 case "$usevfork" in
17497 Perl can only use a vfork() that doesn't suffer from strict
17498 restrictions on calling functions or modifying global data in
17499 the child. For example, glibc-2.1 contains such a vfork()
17500 that is unsuitable. If your system provides a proper fork()
17501 call, chances are that you do NOT want perl to use vfork().
17504 rp="Do you still want to use vfork()?"
17509 echo "Ok, we won't use vfork()."
17518 $define) usevfork='true';;
17519 *) usevfork='false';;
17522 : see if closedir exists
17523 set closedir d_closedir
17526 case "$d_closedir" in
17529 echo "Checking whether closedir() returns a status..." >&4
17531 #$i_dirent I_DIRENT /**/
17532 #$i_sysdir I_SYS_DIR /**/
17533 #$i_sysndir I_SYS_NDIR /**/
17534 #$i_systypes I_SYS_TYPES /**/
17536 #if defined(I_SYS_TYPES)
17537 #include <sys/types.h>
17539 #if defined(I_DIRENT)
17540 #include <dirent.h>
17541 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
17542 #include <sys/dir.h>
17546 #include <sys/ndir.h>
17550 #include <ndir.h> /* may be wrong in the future */
17552 #include <sys/dir.h>
17557 int main() { return closedir(opendir(".")); }
17560 if eval $compile_ok; then
17561 if $run ./try > /dev/null 2>&1 ; then
17562 echo "Yes, it does."
17565 echo "No, it doesn't."
17569 echo "(I can't seem to compile the test program--assuming it doesn't)"
17577 set d_void_closedir
17580 : see if there is a wait4
17584 : see if waitpid exists
17585 set waitpid d_waitpid
17588 : see if wcstombs exists
17589 set wcstombs d_wcstombs
17592 : see if wctomb exists
17593 set wctomb d_wctomb
17596 : see if writev exists
17597 set writev d_writev
17600 : preserve RCS keywords in files with variable substitution, grrr
17605 Revision='$Revision'
17607 : check for alignment requirements
17609 case "$usecrosscompile$multiarch" in
17612 You seem to be either cross-compiling or doing a multiarchitecture build,
17613 skipping the memory alignment check.
17616 case "$alignbytes" in
17617 '') alignbytes=8 ;;
17621 case "$alignbytes" in
17622 '') echo "Checking alignment constraints..." >&4
17623 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
17624 $cat >try.c <<'EOCP'
17625 typedef long double NV;
17628 $cat >try.c <<'EOCP'
17632 $cat >>try.c <<'EOCP'
17640 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
17645 if eval $compile_ok; then
17649 echo "(I can't seem to compile the test program...)"
17652 *) dflt="$alignbytes"
17655 rp="Doubles must be aligned on a how-many-byte boundary?"
17663 : set the base revision
17666 : how do we concatenate cpp tokens here?
17668 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
17669 $cat >cpp_stuff.c <<'EOCP'
17670 #define RCAT(a,b)a/**/b
17671 #define ACAT(a,b)a ## b
17675 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
17676 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
17677 echo "Oh! Smells like ANSI's been here." >&4
17678 echo "We can catify or stringify, separately or together!"
17680 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
17681 echo "Ah, yes! The good old days!" >&4
17682 echo "However, in the good old days we don't know how to stringify and"
17683 echo "catify at the same time."
17687 Hmm, I don't seem to be able to concatenate tokens with your cpp.
17688 You're going to have to edit the values of CAT[2-5] in config.h...
17690 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
17694 : see if this is a db.h system
17700 : Check db version.
17702 echo "Checking Berkeley DB version ..." >&4
17708 #include <sys/types.h>
17710 #$i_stdlib I_STDLIB
17712 #include <stdlib.h>
17715 int main(int argc, char *argv[])
17717 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
17718 int Major, Minor, Patch ;
17719 unsigned long Version ;
17720 (void)db_version(&Major, &Minor, &Patch) ;
17722 printf("%d %d %d %d %d %d\n",
17723 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
17724 Major, Minor, Patch);
17727 printf("You have Berkeley DB Version 2 or greater.\n");
17729 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
17730 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
17731 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
17732 Major, Minor, Patch) ;
17734 /* check that db.h & libdb are compatible */
17735 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
17736 printf("db.h and libdb are incompatible.\n") ;
17740 printf("db.h and libdb are compatible.\n") ;
17742 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
17743 + DB_VERSION_PATCH ;
17745 /* needs to be >= 2.3.4 */
17746 if (Version < 2003004) {
17747 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
17748 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
17754 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
17759 printf("You have Berkeley DB Version 1.\n");
17760 exit(0); /* DB version < 2: the coast is clear. */
17762 exit(1); /* <db.h> not Berkeley DB? */
17768 if eval $compile_ok && $run ./try; then
17769 echo 'Looks OK.' >&4
17771 db_version_major=$1
17772 db_version_minor=$2
17773 db_version_patch=$3
17775 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
17779 : Remove db from list of libraries to use
17780 echo "Removing unusable -ldb from library list" >&4
17781 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
17784 echo "libs = $libs" >&4
17794 : Check the return type needed for hash
17796 echo "Checking return type needed for hash for Berkeley DB ..." >&4
17802 #include <sys/types.h>
17805 #ifndef DB_VERSION_MAJOR
17806 u_int32_t hash_cb (ptr, size)
17814 info.hash = hash_cb;
17818 if $cc $ccflags -c try.c >try.out 2>&1 ; then
17819 if $contains warning try.out >>/dev/null 2>&1 ; then
17822 db_hashtype='u_int32_t'
17825 : XXX Maybe we should just give up here.
17826 db_hashtype=u_int32_t
17828 echo "Help: I can't seem to compile the db test program." >&4
17829 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
17832 echo "Your version of Berkeley DB uses $db_hashtype for hash."
17834 *) db_hashtype=u_int32_t
17839 : Check the return type needed for prefix
17841 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
17847 #include <sys/types.h>
17850 #ifndef DB_VERSION_MAJOR
17851 size_t prefix_cb (key1, key2)
17859 info.prefix = prefix_cb;
17863 if $cc $ccflags -c try.c >try.out 2>&1 ; then
17864 if $contains warning try.out >>/dev/null 2>&1 ; then
17865 db_prefixtype='int'
17867 db_prefixtype='size_t'
17870 db_prefixtype='size_t'
17871 : XXX Maybe we should just give up here.
17873 echo "Help: I can't seem to compile the db test program." >&4
17874 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
17877 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
17879 *) db_prefixtype='size_t'
17884 : How can we generate normalized random numbers ?
17886 echo "Looking for a random number function..." >&4
17887 case "$randfunc" in
17889 if set drand48 val -f; eval $csym; $val; then
17891 echo "Good, found drand48()." >&4
17892 elif set random val -f; eval $csym; $val; then
17894 echo "OK, found random()." >&4
17897 echo "Yick, looks like I have to use rand()." >&4
17908 *-Dmy_rand=*|*-Dmy_srand=*)
17909 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
17910 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
17911 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
17912 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
17916 while $test "$cont"; do
17917 rp="Use which function to generate random numbers?"
17919 if $test "$ans" = "$dflt"; then
17925 if set $ans val -f; eval $csym; $val; then
17929 rp="I cannot find function $ans. Use that name anyway?"
17938 case "$randfunc" in
17940 drand01="drand48()"
17946 case "$randbits" in
17948 echo "Checking to see how many bits your $randfunc() function produces..." >&4
17950 #$i_unistd I_UNISTD
17951 #$i_stdlib I_STDLIB
17954 # include <unistd.h>
17957 # include <stdlib.h>
17962 register unsigned long tmp;
17963 register unsigned long max = 0L;
17965 for (i = 1000; i; i--) {
17966 tmp = (unsigned long) $randfunc();
17967 if (tmp > max) max = tmp;
17969 for (i = 0; max; i++)
17975 if eval $compile_ok; then
17979 echo "(I can't seem to compile the test program...)"
17986 rp="How many bits does your $randfunc() function produce?"
17990 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
17991 seedfunc="s$randfunc"
17992 randseedtype=unsigned
17996 rp="How many bits does your $randfunc() function produce?"
17999 seedfunc="s$randfunc"
18000 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18001 if set $seedfunc val -f; eval $csym; $val; then
18002 echo "(Using $seedfunc() to seed random generator)"
18004 echo "(Warning: no $seedfunc() to seed random generator)"
18007 randseedtype=unsigned
18015 echo "Determining whether or not we are on an EBCDIC system..." >&4
18016 $cat >try.c <<'EOM'
18019 if ('M'==0xd4) return 0;
18026 if eval $compile_ok; then
18027 if $run ./try; then
18028 echo "You seem to speak EBCDIC." >&4
18031 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
18034 echo "I'm unable to compile the test program." >&4
18035 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
18043 Checking how to flush all pending stdio output...
18045 # I only know how to find the first 32 possibly open files on SunOS.
18046 # See also hints/sunos_4_1.sh and util.c --AD
18048 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
18050 $cat >>try.c <<EOCP
18052 #$i_stdlib I_STDLIB
18054 #include <stdlib.h>
18056 #$i_unistd I_UNISTD
18058 # include <unistd.h>
18060 #$d_sysconf HAS_SYSCONF
18061 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
18062 #ifdef HAS_STDIO_STREAM_ARRAY
18063 # define STDIO_STREAM_ARRAY $stdio_stream_array
18068 p = fopen("try.out", "w");
18072 # ifdef TRY_FPRINTF
18076 #ifdef TRY_FFLUSH_NULL
18079 #ifdef TRY_FFLUSH_ALL
18081 long open_max = -1;
18082 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
18083 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
18085 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
18086 open_max = sysconf(_SC_OPEN_MAX);
18089 open_max = FOPEN_MAX;
18092 open_max = OPEN_MAX;
18101 # ifdef HAS_STDIO_STREAM_ARRAY
18102 if (open_max > 0) {
18104 for (i = 0; i < open_max; i++)
18105 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
18106 STDIO_STREAM_ARRAY[i]._file < open_max &&
18107 STDIO_STREAM_ARRAY[i]._flag)
18108 fflush(&STDIO_STREAM_ARRAY[i]);
18116 : first we have to find out how _not_ to flush
18118 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
18120 set try -DTRY_FPUTC
18121 if eval $compile; then
18122 $run ./try 2>/dev/null
18125 if $test ! -s try.out -a "X$code" = X42; then
18131 set try -DTRY_FPRINTF
18132 if eval $compile; then
18133 $run ./try 2>/dev/null
18136 if $test ! -s try.out -a "X$code" = X42; then
18137 output=-DTRY_FPRINTF
18143 : check for fflush NULL behaviour
18144 case "$fflushNULL" in
18145 '') set try -DTRY_FFLUSH_NULL $output
18146 if eval $compile; then
18147 $run ./try 2>/dev/null
18150 if $test -s try.out -a "X$code" = X42; then
18151 fflushNULL="`$cat try.out`"
18153 if $test "X$code" != X42; then
18155 (If this test failed, don't worry, we'll try another method shortly.)
18160 $rm -f core try.core core.try.*
18161 case "$fflushNULL" in
18163 Your fflush(NULL) works okay for output streams.
18164 Let's see if it clobbers input pipes...
18166 # As of mid-March 2000 all versions of Solaris appear to have a stdio
18167 # bug that improperly flushes the input end of pipes. So we avoid the
18168 # autoflush on fork/system/exec support for now. :-(
18169 $cat >tryp.c <<EOCP
18172 main(int argc, char **argv)
18178 while ((i = getc(stdin)) != -1
18179 && (*bp++ = i) != '\n'
18180 && bp < &buf[1024])
18183 fprintf(stdout, "%s", buf);
18191 fflushNULL="$define"
18193 if eval $compile; then
18195 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
18196 if cmp tryp.c tryp.out >/dev/null 2>&1; then
18198 fflush(NULL) seems to behave okay with input streams.
18200 fflushNULL="$define"
18203 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
18205 fflushNULL="$undef"
18208 $rm -f core tryp.c tryp.core core.tryp.*
18211 Your fflush(NULL) isn't working (contrary to ANSI C).
18213 fflushNULL="$undef"
18216 Cannot figure out whether your fflush(NULL) works or not.
18217 I'm assuming it doesn't (contrary to ANSI C).
18219 fflushNULL="$undef"
18223 $define|true|[yY]*)
18224 fflushNULL="$define"
18227 fflushNULL="$undef"
18230 : check explicit looping only if NULL did not work, and if the pipe
18231 : bug does not show up on an explicit flush too
18232 case "$fflushNULL" in
18234 $cat >tryp.c <<EOCP
18237 main(int argc, char **argv)
18243 while ((i = getc(stdin)) != -1
18244 && (*bp++ = i) != '\n'
18245 && bp < &buf[1024])
18248 fprintf(stdout, "%s", buf);
18257 if eval $compile; then
18259 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
18260 if cmp tryp.c tryp.out >/dev/null 2>&1; then
18262 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
18264 : now check for fflushall behaviour
18265 case "$fflushall" in
18266 '') set try -DTRY_FFLUSH_ALL $output
18267 if eval $compile; then
18269 (Now testing the other method--but note that this also may fail.)
18271 $run ./try 2>/dev/null
18274 if $test -s try.out -a "X$code" = X42; then
18275 fflushall="`$cat try.out`"
18278 $rm -f core try.core core.try.*
18279 case "$fflushall" in
18281 Whew. Flushing explicitly all the stdio streams works.
18283 fflushall="$define"
18286 Sigh. Flushing explicitly all the stdio streams doesn't work.
18291 Cannot figure out whether flushing stdio streams explicitly works or not.
18292 I'm assuming it doesn't.
18298 "$define"|true|[yY]*)
18299 fflushall="$define"
18307 All is futile. Even fflush(stdin) clobbers input pipes!
18314 $rm -f core tryp.c tryp.core core.tryp.*
18316 *) fflushall="$undef"
18320 case "$fflushNULL$fflushall" in
18323 OK, I give up. I cannot figure out how to flush pending stdio output.
18324 We won't be flushing handles at all before fork/exec/popen.
18328 $rm -f try.* try$exe_ext
18330 : Store the full pathname to the ar program for use in the C program
18331 : Respect a hint or command line value for full_ar.
18336 : Store the full pathname to the sed program for use in the C program
18339 : see what type gids are declared as in the kernel
18341 echo "Looking for the type for group ids returned by getgid()."
18342 set gid_t gidtype xxx stdio.h sys/types.h
18346 xxx=`./findhdr sys/user.h`
18347 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
18349 unsigned) dflt="$1 $2" ;;
18353 *) dflt="$gidtype";;
18356 gid_t) echo "gid_t found." ;;
18357 *) rp="What is the type for group ids returned by getgid()?"
18365 *_t) zzz="$gidtype" ;;
18368 echo "Checking the size of $zzz..." >&4
18370 #include <sys/types.h>
18372 #$i_stdlib I_STDLIB
18374 #include <stdlib.h>
18377 printf("%d\n", (int)sizeof($gidtype));
18382 if eval $compile_ok; then
18386 echo "(I can't execute the test program--guessing $gidsize.)" >&4
18389 echo "Your $zzz is $gidsize bytes long."
18394 echo "(I can't compile the test program--guessing $gidsize.)" >&4
18400 *_t) zzz="$gidtype" ;;
18403 echo "Checking the sign of $zzz..." >&4
18405 #include <sys/types.h>
18416 if eval $compile; then
18420 echo "(I can't execute the test program--guessing unsigned.)" >&4
18424 1) echo "Your $zzz is unsigned." ;;
18425 -1) echo "Your $zzz is signed." ;;
18431 echo "(I can't compile the test program--guessing unsigned.)" >&4
18437 if $test X"$quadtype" != X; then
18439 echo "Checking how to print 64-bit integers..." >&4
18441 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
18442 $cat >try.c <<'EOCP'
18443 #include <sys/types.h>
18446 int q = 12345678901;
18447 printf("%ld\n", q);
18451 if eval $compile; then
18455 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
18456 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
18457 echo "We will use %d."
18463 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
18464 $cat >try.c <<'EOCP'
18465 #include <sys/types.h>
18468 long q = 12345678901;
18469 printf("%ld\n", q);
18473 if eval $compile; then
18477 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
18478 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
18479 echo "We will use %ld."
18485 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
18486 $cat >try.c <<'EOCP'
18487 #include <sys/types.h>
18488 #include <inttypes.h>
18491 int64_t q = 12345678901;
18492 printf("%" PRId64 "\n", q);
18496 if eval $compile; then
18500 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
18501 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
18502 echo "We will use the C9X style."
18508 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
18510 #include <sys/types.h>
18513 $quadtype q = 12345678901;
18514 printf("%Ld\n", q);
18518 if eval $compile; then
18522 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
18523 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
18524 echo "We will use %Ld."
18530 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
18531 $cat >try.c <<'EOCP'
18532 #include <sys/types.h>
18535 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
18536 printf("%lld\n", q);
18540 if eval $compile; then
18544 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
18545 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
18546 echo "We will use the %lld style."
18552 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
18554 #include <sys/types.h>
18557 $quadtype q = 12345678901;
18558 printf("%qd\n", q);
18562 if eval $compile; then
18566 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
18567 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
18568 echo "We will use %qd."
18574 if $test X"$sPRId64" = X; then
18575 echo "Cannot figure out how to print 64-bit integers." >&4
18583 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
18584 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
18586 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
18587 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
18593 $echo "Checking the format strings to be used for Perl's internal types..." >&4
18595 if $test X"$ivsize" = X8; then
18596 ivdformat="$sPRId64"
18597 uvuformat="$sPRIu64"
18598 uvoformat="$sPRIo64"
18599 uvxformat="$sPRIx64"
18600 uvXUformat="$sPRIXU64"
18602 if $test X"$ivsize" = X"$longsize"; then
18609 if $test X"$ivsize" = X"$intsize"; then
18617 if $test X"$ivsize" = X"$shortsize"; then
18628 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
18629 nveformat="$sPRIeldbl"
18630 nvfformat="$sPRIfldbl"
18631 nvgformat="$sPRIgldbl"
18632 nvEUformat="$sPRIEUldbl"
18633 nvFUformat="$sPRIFUldbl"
18634 nvGUformat="$sPRIGUldbl"
18644 case "$ivdformat" in
18645 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
18652 $echo "Checking the format string to be used for gids..." >&4
18655 -1) if $test X"$gidsize" = X"$ivsize"; then
18656 gidformat="$ivdformat"
18658 if $test X"$gidsize" = X"$longsize"; then
18661 if $test X"$gidsize" = X"$intsize"; then
18664 if $test X"$gidsize" = X"$shortsize"; then
18671 *) if $test X"$gidsize" = X"$uvsize"; then
18672 gidformat="$uvuformat"
18674 if $test X"$gidsize" = X"$longsize"; then
18677 if $test X"$gidsize" = X"$intsize"; then
18680 if $test X"$gidsize" = X"$shortsize"; then
18689 : see if getgroups exists
18690 set getgroups d_getgrps
18693 : see if setgroups exists
18694 set setgroups d_setgrps
18698 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
18700 case "$d_getgrps$d_setgrps" in
18702 case "$groupstype" in
18703 '') dflt="$gidtype" ;;
18704 *) dflt="$groupstype" ;;
18707 What type of pointer is the second argument to getgroups() and setgroups()?
18708 Usually this is the same as group ids, $gidtype, but not always.
18711 rp='What type pointer is the second argument to getgroups() and setgroups()?'
18715 *) groupstype="$gidtype";;
18719 echo "Checking if your $make program sets \$(MAKE)..." >&4
18720 case "$make_set_make" in
18722 $sed 's/^X //' > testmake.mak << 'EOF'
18724 X @echo 'maketemp="$(MAKE)"'
18726 case "`$make -f testmake.mak 2>/dev/null`" in
18727 *maketemp=*) make_set_make='#' ;;
18728 *) make_set_make="MAKE=$make" ;;
18730 $rm -f testmake.mak
18733 case "$make_set_make" in
18734 '#') echo "Yup, it does.";;
18735 *) echo "Nope, it doesn't.";;
18738 : see what type is used for mode_t
18739 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
18740 set mode_t modetype int stdio.h sys/types.h
18743 : see if stdarg is available
18745 if $test `./findhdr stdarg.h`; then
18746 echo "<stdarg.h> found." >&4
18749 echo "<stdarg.h> NOT found." >&4
18753 : see if varags is available
18755 if $test `./findhdr varargs.h`; then
18756 echo "<varargs.h> found." >&4
18758 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
18761 : set up the varargs testing programs
18762 $cat > varargs.c <<EOP
18764 #include <stdarg.h>
18767 #include <varargs.h>
18771 int f(char *p, ...)
18785 p = va_arg(ap, char *);
18790 $cat > varargs <<EOP
18792 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
18801 : now check which varargs header should be included
18806 if `./varargs I_STDARG`; then
18808 elif `./varargs I_VARARGS`; then
18813 if `./varargs I_VARARGS`; then
18820 echo "I could not find the definition for va_dcl... You have problems..." >&4
18821 val="$undef"; set i_stdarg; eval $setvar
18822 val="$undef"; set i_varargs; eval $setvar
18827 case "$i_varhdr" in
18829 val="$define"; set i_stdarg; eval $setvar
18830 val="$undef"; set i_varargs; eval $setvar
18833 val="$undef"; set i_stdarg; eval $setvar
18834 val="$define"; set i_varargs; eval $setvar
18837 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
18841 : see if we need va_copy
18843 case "$i_stdarg" in
18846 #include <stdarg.h>
18848 #$i_stdlib I_STDLIB
18850 #include <stdlib.h>
18852 #include <signal.h>
18855 ivfprintf(FILE *f, const char *fmt, va_list *valp)
18857 return vfprintf(f, fmt, *valp);
18861 myvfprintf(FILE *f, const char *fmt, va_list val)
18863 return ivfprintf(f, fmt, &val);
18867 myprintf(char *fmt, ...)
18870 va_start(val, fmt);
18871 return myvfprintf(stdout, fmt, val);
18875 main(int ac, char **av)
18877 signal(SIGSEGV, exit);
18879 myprintf("%s%cs all right, then\n", "that", '\'');
18884 if eval $compile && $run ./try 2>&1 >/dev/null; then
18885 case "`$run ./try`" in
18886 "that's all right, then")
18892 yes) echo "It seems that you don't need va_copy()." >&4
18893 need_va_copy="$undef"
18895 *) echo "It seems that va_copy() or similar will be needed." >&4
18896 need_va_copy="$define"
18899 $rm -f try.* core core.* *.core *.core.*
18901 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
18905 : see what type is used for size_t
18906 rp="What is the type used for the length parameter for string functions?"
18907 set size_t sizetype 'unsigned int' stdio.h sys/types.h
18910 : check for type of arguments to gethostbyaddr.
18911 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
18912 case "$d_gethbyaddr" in
18916 Checking to see what type of arguments are accepted by gethostbyaddr().
18918 hdrs="$define sys/types.h
18919 $d_socket sys/socket.h
18920 $i_niin netinet/in.h
18922 $i_unistd unistd.h"
18923 : The first arg can 'char *' or 'void *'
18924 : The second arg is some of integral type
18925 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
18926 for yyy in size_t long int; do
18927 case "$netdb_host_type" in
18928 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
18929 if ./protochk "$try" $hdrs; then
18930 echo "Your system accepts $xxx for the first arg."
18931 echo "...and $yyy for the second arg."
18932 netdb_host_type="$xxx"
18933 netdb_hlen_type="$yyy"
18939 : In case none of those worked, prompt the user.
18940 case "$netdb_host_type" in
18941 '') rp='What is the type for the 1st argument to gethostbyaddr?'
18944 netdb_host_type=$ans
18945 rp='What is the type for the 2nd argument to gethostbyaddr?'
18948 netdb_hlen_type=$ans
18952 *) : no gethostbyaddr, so pick harmless defaults
18953 netdb_host_type='char *'
18954 netdb_hlen_type="$sizetype"
18957 # Remove the "const" if needed. -- but then we'll have a
18959 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
18962 : check for type of argument to gethostbyname.
18963 if test "X$netdb_name_type" = X ; then
18964 case "$d_gethbyname" in
18968 Checking to see what type of argument is accepted by gethostbyname().
18970 hdrs="$define sys/types.h
18971 $d_socket sys/socket.h
18972 $i_niin netinet/in.h
18974 $i_unistd unistd.h"
18975 for xxx in "const char *" "char *"; do
18976 case "$netdb_name_type" in
18977 '') try="extern struct hostent *gethostbyname($xxx);"
18978 if ./protochk "$try" $hdrs; then
18979 echo "Your system accepts $xxx."
18980 netdb_name_type="$xxx"
18985 : In case none of those worked, prompt the user.
18986 case "$netdb_name_type" in
18987 '') rp='What is the type for the 1st argument to gethostbyname?'
18990 netdb_name_type=$ans
18994 *) : no gethostbyname, so pick harmless default
18995 netdb_name_type='char *'
19000 : check for type of 1st argument to getnetbyaddr.
19001 if test "X$netdb_net_type" = X ; then
19002 case "$d_getnbyaddr" in
19006 Checking to see what type of 1st argument is accepted by getnetbyaddr().
19008 hdrs="$define sys/types.h
19009 $d_socket sys/socket.h
19010 $i_niin netinet/in.h
19012 $i_unistd unistd.h"
19013 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
19014 case "$netdb_net_type" in
19015 '') try="extern struct netent *getnetbyaddr($xxx, int);"
19016 if ./protochk "$try" $hdrs; then
19017 echo "Your system accepts $xxx."
19018 netdb_net_type="$xxx"
19023 : In case none of those worked, prompt the user.
19024 case "$netdb_net_type" in
19025 '') rp='What is the type for the 1st argument to getnetbyaddr?'
19028 netdb_net_type=$ans
19032 *) : no getnetbyaddr, so pick harmless default
19033 netdb_net_type='long'
19037 : locate the preferred pager for this system
19044 [a-zA-Z]:/*) dflt=$pg;;
19048 [a-zA-Z]:/*) dflt=$more;;
19052 [a-zA-Z]:/*) dflt=$less;;
19055 '') dflt=/usr/ucb/more;;
19059 : Instruct ./getfile to trust the hinted or previous pager value,
19060 : even if it does not begin with a slash. For example, on os2,
19061 : pager might be cmd /c more. See comments in UU/getfile.
19066 rp='What pager is used on your system?'
19070 : see what type pids are declared as in the kernel
19071 rp="What is the type of process ids on this system?"
19072 set pid_t pidtype int stdio.h sys/types.h
19075 : see if ar generates random libraries by itself
19077 echo "Checking how to generate random libraries on your machine..." >&4
19078 echo 'int bar1() { return bar2(); }' > bar1.c
19079 echo 'int bar2() { return 2; }' > bar2.c
19081 #$i_stdlib I_STDLIB
19083 #include <stdlib.h>
19085 int main() { printf("%d\n", bar1()); exit(0); }
19087 $cc $ccflags -c bar1.c >/dev/null 2>&1
19088 $cc $ccflags -c bar2.c >/dev/null 2>&1
19089 $cc $ccflags -c foo.c >/dev/null 2>&1
19090 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
19091 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19092 $run ./foobar >/dev/null 2>&1; then
19093 echo "$ar appears to generate random libraries itself."
19095 if [ "X$ranlib" = "X" ]; then
19098 elif $ar ts bar$_a >/dev/null 2>&1 &&
19099 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19100 $run ./foobar >/dev/null 2>&1; then
19101 echo "a table of contents needs to be added with '$ar ts'."
19108 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
19109 $test -f $ranlib || ranlib=''
19112 if $test -n "$ranlib"; then
19113 echo "your system has '$ranlib'; we'll use that."
19116 echo "your system doesn't seem to support random libraries"
19117 echo "so we'll use lorder and tsort to order the libraries."
19124 : check for type of arguments to select.
19125 case "$selecttype" in
19126 '') case "$d_select" in
19130 Checking to see what type of arguments are accepted by select().
19132 hdrs="$define sys/types.h
19133 $i_systime sys/time.h
19134 $i_sysselct sys/select.h
19135 $d_socket sys/socket.h"
19136 : The first arg can be int, unsigned, or size_t
19137 : The last arg may or may not be 'const'
19139 : void pointer has been seen but using that
19140 : breaks the selectminbits test
19141 for xxx in 'fd_set *' 'int *'; do
19142 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
19143 for tmo in 'struct timeval *' 'const struct timeval *'; do
19145 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
19146 if ./protochk "$try" $hdrs; then
19147 echo "Your system accepts $xxx."
19156 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
19157 case "$d_fd_set" in
19158 $define) dflt="fd_set *" ;;
19167 *) : no select, so pick a harmless default
19174 : check for the select 'width'
19175 case "$selectminbits" in
19176 '') safebits=`expr $ptrsize \* 8`
19177 case "$d_select" in
19181 Checking to see on how many bits at a time your select() operates...
19184 #include <sys/types.h>
19186 #$i_systime I_SYS_TIME
19187 #$i_systimek I_SYS_TIME_KERNEL
19192 # ifdef I_SYS_TIME_KERNEL
19195 # include <sys/time.h>
19196 # ifdef I_SYS_TIME_KERNEL
19200 #$i_sysselct I_SYS_SELECT
19201 #ifdef I_SYS_SELECT
19202 #include <sys/select.h>
19204 #$d_socket HAS_SOCKET
19206 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
19209 #$i_stdlib I_STDLIB
19211 #include <stdlib.h>
19214 #define S sizeof(*(b))
19216 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
19217 #define NBITS (NBYTES * 8)
19219 char *s = malloc(NBYTES);
19228 fp = fopen("try.c", "r");
19234 b = ($selecttype)s;
19235 for (i = 0; i < NBITS; i++)
19239 select(fd + 1, b, 0, 0, &t);
19240 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
19242 printf("%d\n", i + 1);
19247 if eval $compile_ok; then
19248 selectminbits=`$run ./try`
19249 case "$selectminbits" in
19251 Cannot figure out on how many bits at a time your select() operates.
19252 I'll play safe and guess it is $safebits bits.
19254 selectminbits=$safebits
19255 bits="$safebits bits"
19258 *) bits="$selectminbits bits" ;;
19260 echo "Your select() operates on $bits at a time." >&4
19262 rp='What is the minimum number of bits your select() operates on?'
19263 case "$byteorder" in
19264 12345678) dflt=64 ;;
19270 selectminbits="$val"
19274 *) : no select, so pick a harmless default
19275 selectminbits=$safebits
19281 : Trace out the files included by signal.h, then look for SIGxxx names.
19282 : Remove SIGARRAYSIZE used by HPUX.
19283 : Remove SIGSTKSIZE used by Linux.
19284 : Remove SIGSTKSZ used by Posix.
19285 : Remove SIGTYP void lines used by OS2.
19286 : Some cpps, like os390, dont give the file name anywhere
19287 if [ "X$fieldn" = X ]; then
19288 : Just make some guesses. We check them later.
19289 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
19291 xxx=`echo '#include <signal.h>' |
19292 $cppstdin $cppminus $cppflags 2>/dev/null |
19293 $grep '^[ ]*#.*include' |
19294 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
19296 : Check this list of files to be sure we have parsed the cpp output ok.
19297 : This will also avoid potentially non-existent files, such
19300 for xx in $xxx /dev/null ; do
19301 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
19303 : If we have found no files, at least try signal.h
19304 case "$xxxfiles" in
19305 '') xxxfiles=`./findhdr signal.h` ;;
19308 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
19309 print substr($2, 4, 20)
19311 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
19312 print substr($3, 4, 20)
19314 : Append some common names just in case the awk scan failed.
19315 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
19316 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
19317 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
19318 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
19319 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
19321 : generate a few handy files for later
19322 $cat > signal.c <<EOCP
19323 #include <sys/types.h>
19324 #include <signal.h>
19325 #$i_stdlib I_STDLIB
19327 #include <stdlib.h>
19332 /* Strange style to avoid deeply-nested #if/#else/#endif */
19335 # define NSIG (_NSIG)
19341 # define NSIG (SIGMAX+1)
19347 # define NSIG (SIG_MAX+1)
19353 # define NSIG (_SIG_MAX+1)
19359 # define NSIG (MAXSIG+1)
19365 # define NSIG (MAX_SIG+1)
19370 # ifdef SIGARRAYSIZE
19371 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
19377 # define NSIG (_sys_nsig) /* Solaris 2.5 */
19381 /* Default to some arbitrary number that's big enough to get most
19382 of the common signals.
19388 printf("NSIG %d\n", NSIG);
19394 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
19396 printf "#ifdef SIG"; printf $1; printf "\n"
19397 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
19398 printf $1; printf ");\n"
19402 printf "#endif /* JUST_NSIG */\n";
19403 printf "exit(0);\n}\n";
19406 $cat >signal.awk <<'EOP'
19407 BEGIN { ndups = 0 }
19408 $1 ~ /^NSIG$/ { nsig = $2 }
19409 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
19410 if ($2 > maxsig) { maxsig = $2 }
19411 if (sig_name[$2]) {
19412 dup_name[ndups] = $1
19413 dup_num[ndups] = $2
19425 printf("NSIG %d\n", nsig);
19426 for (n = 1; n < nsig; n++) {
19428 printf("%s %d\n", sig_name[n], sig_num[n])
19431 printf("NUM%d %d\n", n, n)
19434 for (n = 0; n < ndups; n++) {
19435 printf("%s %d\n", dup_name[n], dup_num[n])
19439 $cat >signal_cmd <<EOS
19441 if $test -s signal.lst; then
19442 echo "Using your existing signal.lst file"
19447 $cat >>signal_cmd <<'EOS'
19450 if eval $compile_ok; then
19451 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) | $uniq | $awk -f signal.awk >signal.lst
19453 echo "(I can't seem be able to compile the whole test program)" >&4
19454 echo "(I'll try it in little pieces.)" >&4
19455 set signal -DJUST_NSIG
19456 if eval $compile_ok; then
19457 $run ./signal$_exe > signal.nsg
19460 echo "I can't seem to figure out how many signals you have." >&4
19461 echo "Guessing 50." >&4
19462 echo 'NSIG 50' > signal.nsg
19464 : Now look at all the signal names, one at a time.
19465 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
19466 $cat > signal.c <<EOCP
19467 #include <sys/types.h>
19468 #include <signal.h>
19471 printf("$xx %d\n", SIG${xx});
19476 if eval $compile; then
19477 echo "SIG${xx} found."
19478 $run ./signal$_exe >> signal.ls1
19480 echo "SIG${xx} NOT found."
19483 if $test -s signal.ls1; then
19484 $cat signal.nsg signal.ls1 |
19485 $sort -n | $uniq | $awk -f signal.awk >signal.lst
19489 if $test -s signal.lst; then
19492 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
19493 echo 'kill -l' >signal
19494 set X `csh -f <signal`
19498 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
19500 echo $@ | $tr ' ' $trnl | \
19501 $awk '{ printf "%s %d\n", $1, ++s; }
19502 END { printf "NSIG %d\n", ++s }' >signal.lst
19504 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
19506 chmod a+x signal_cmd
19507 $eunicefix signal_cmd
19509 : generate list of signal names
19511 case "$sig_name_init" in
19513 *) case "$sig_num_init" in
19514 ''|*,*) doinit=yes ;;
19519 echo "Generating a list of signal names and numbers..." >&4
19521 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
19522 sig_name=`$awk 'BEGIN { printf "ZERO " }
19523 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
19524 sig_num=`$awk 'BEGIN { printf "0 " }
19525 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
19526 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
19527 !/^NSIG/ { printf "\"%s\", ", $1 }
19528 END { printf "0\n" }' signal.lst`
19529 sig_num_init=`$awk 'BEGIN { printf "0, " }
19530 !/^NSIG/ { printf "%d, ", $2}
19531 END { printf "0\n"}' signal.lst`
19534 echo "The following $sig_count signals are available:"
19536 echo $sig_name | $awk \
19537 'BEGIN { linelen = 0 }
19539 for (i = 1; i <= NF; i++) {
19540 name = "SIG" $i " "
19541 linelen = linelen + length(name)
19542 if (linelen > 70) {
19544 linelen = length(name)
19550 sig_size=`echo $sig_name | awk '{print NF}'`
19551 $rm -f signal signal.c signal.awk signal.lst signal_cmd
19554 case "$sizetype" in
19555 *_t) zzz="$sizetype" ;;
19556 *) zzz="filesize" ;;
19558 echo "Checking the size of $zzz..." >&4
19560 #include <sys/types.h>
19562 #$i_stdlib I_STDLIB
19564 #include <stdlib.h>
19567 printf("%d\n", (int)sizeof($sizetype));
19572 if eval $compile_ok; then
19576 echo "(I can't execute the test program--guessing $sizesize.)" >&4
19579 echo "Your $zzz size is $sizesize bytes."
19584 echo "(I can't compile the test program--guessing $sizesize.)" >&4
19588 : check for socklen_t
19590 echo "Checking to see if you have socklen_t..." >&4
19592 #include <sys/types.h>
19593 #$d_socket HAS_SOCKET
19595 #include <sys/socket.h>
19597 int main() { socklen_t x = 16; }
19600 if eval $compile; then
19602 echo "You have socklen_t."
19605 echo "You do not have socklen_t."
19606 case "$sizetype" in
19607 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
19614 : see if this is a socks.h system
19615 set socks.h i_socks
19618 : check for type of the size argument to socket calls
19619 case "$d_socket" in
19623 Checking to see what type is the last argument of accept().
19626 case "$d_socklen_t" in
19627 "$define") yyy="$yyy socklen_t"
19629 yyy="$yyy $sizetype int long unsigned"
19630 for xxx in $yyy; do
19631 case "$socksizetype" in
19632 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
19633 case "$usesocks" in
19635 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
19636 echo "Your system accepts '$xxx *' for the last argument of accept()."
19637 socksizetype="$xxx"
19640 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
19641 echo "Your system accepts '$xxx *' for the last argument of accept()."
19642 socksizetype="$xxx"
19649 : In case none of those worked, prompt the user.
19650 case "$socksizetype" in
19651 '') rp='What is the type for socket address structure sizes?'
19658 *) : no sockets, so pick relatively harmless default
19663 : see what type is used for signed size_t
19664 set ssize_t ssizetype int stdio.h sys/types.h
19669 #$i_stdlib I_STDLIB
19671 #include <stdlib.h>
19673 #include <sys/types.h>
19674 #define Size_t $sizetype
19675 #define SSize_t $dflt
19678 if (sizeof(Size_t) == sizeof(SSize_t))
19680 else if (sizeof(Size_t) == sizeof(int))
19689 if eval $compile_ok && $run ./try > /dev/null; then
19690 ssizetype=`$run ./try`
19691 echo "I'll be using $ssizetype for functions returning a byte count." >&4
19694 Help! I can't compile and run the ssize_t test program: please enlighten me!
19695 (This is probably a misconfiguration in your system or libraries, and
19696 you really ought to fix it. Still, I'll try anyway.)
19698 I need a type that is the same size as $sizetype, but is guaranteed to
19699 be signed. Common values are ssize_t, int and long.
19702 rp="What signed type is the same size as $sizetype?"
19708 : see what type of char stdio uses.
19710 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
19711 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
19712 echo "Your stdio uses unsigned chars." >&4
19713 stdchar="unsigned char"
19715 echo "Your stdio uses signed chars." >&4
19722 : see what type uids are declared as in the kernel
19724 echo "Looking for the type for user ids returned by getuid()."
19725 set uid_t uidtype xxx stdio.h sys/types.h
19729 xxx=`./findhdr sys/user.h`
19730 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
19732 unsigned) dflt="$1 $2" ;;
19736 *) dflt="$uidtype";;
19739 uid_t) echo "uid_t found." ;;
19740 *) rp="What is the type for user ids returned by getuid()?"
19748 *_t) zzz="$uidtype" ;;
19751 echo "Checking the size of $zzz..." >&4
19753 #include <sys/types.h>
19755 #$i_stdlib I_STDLIB
19757 #include <stdlib.h>
19760 printf("%d\n", (int)sizeof($uidtype));
19765 if eval $compile_ok; then
19769 echo "(I can't execute the test program--guessing $uidsize.)" >&4
19772 echo "Your $zzz is $uidsize bytes long."
19777 echo "(I can't compile the test program--guessing $uidsize.)" >&4
19782 *_t) zzz="$uidtype" ;;
19785 echo "Checking the sign of $zzz..." >&4
19787 #include <sys/types.h>
19798 if eval $compile; then
19802 echo "(I can't execute the test program--guessing unsigned.)" >&4
19806 1) echo "Your $zzz is unsigned." ;;
19807 -1) echo "Your $zzz is signed." ;;
19813 echo "(I can't compile the test program--guessing unsigned.)" >&4
19819 $echo "Checking the format string to be used for uids..." >&4
19822 -1) if $test X"$uidsize" = X"$ivsize"; then
19823 uidformat="$ivdformat"
19825 if $test X"$uidsize" = X"$longsize"; then
19828 if $test X"$uidsize" = X"$intsize"; then
19831 if $test X"$uidsize" = X"$shortsize"; then
19838 *) if $test X"$uidsize" = X"$uvsize"; then
19839 uidformat="$uvuformat"
19841 if $test X"$uidsize" = X"$longsize"; then
19844 if $test X"$uidsize" = X"$intsize"; then
19847 if $test X"$uidsize" = X"$shortsize"; then
19857 case "$usesitecustomize" in
19858 $define|true|[Yy]*)
19859 usesitecustomize="$define"
19862 usesitecustomize="$undef"
19866 : determine compiler compiler
19875 if $test -f "$byacc$_exe"; then
19877 comp="byacc or $comp"
19879 if $test -f "$bison$_exe"; then
19880 comp="$comp or bison -y"
19882 rp="Which compiler compiler ($comp) shall I use?"
19891 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
19897 : see if this is a fp.h system
19901 : see if this is a fp_class.h system
19902 set fp_class.h i_fp_class
19905 : see if this is a ieeefp.h system
19906 case "$i_ieeefp" in
19907 '' ) set ieeefp.h i_ieeefp
19912 : see if this is a libutil.h system
19913 set libutil.h i_libutil
19916 : see if mach cthreads are available
19917 if test "X$usethreads" = "X$define"; then
19918 set mach/cthreads.h i_machcthr
19921 i_machcthr="$undef"
19926 : see if this is a mntent.h system
19927 set mntent.h i_mntent
19930 : see if ndbm.h is available
19936 # Some Linux distributions such as RedHat 7.1 put the
19937 # ndbm.h header in /usr/include/gdbm/ndbm.h.
19938 if $test -f /usr/include/gdbm/ndbm.h; then
19939 echo '<gdbm/ndbm.h> found.'
19940 ccflags="$ccflags -I/usr/include/gdbm"
19941 cppflags="$cppflags -I/usr/include/gdbm"
19949 : see if dbm_open exists
19950 set dbm_open d_dbm_open
19952 case "$d_dbm_open" in
19955 echo "We won't be including <ndbm.h>"
19964 : see if net/errno.h is available
19966 set net/errno.h val
19969 : Unfortunately, it causes problems on some systems. Arrgh.
19972 cat > try.c <<'EOM'
19975 #include <net/errno.h>
19981 if $cc $ccflags -c try.c >/dev/null 2>&1; then
19982 echo "We'll be including <net/errno.h>." >&4
19984 echo "We won't be including <net/errno.h>." >&4
19993 : see if netinet/tcp.h is available
19994 set netinet/tcp.h i_netinettcp
19997 : see if this is a poll.h system
20001 : see if this is a prot.h system
20006 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
20007 $cat <<'EOSH' > Cppsym.know
20008 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
20009 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
20010 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
20011 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
20012 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
20013 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
20014 bull c cadmus clipper CMU COFF COMPILER_VERSION
20015 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
20016 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
20017 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
20018 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
20020 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
20021 H3050R H3050RX hbullx20 hcx host_mips
20022 hp200 hp300 hp700 HP700 hp800 hp9000
20023 hp9000s200 hp9000s300 hp9000s400 hp9000s500
20024 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
20025 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
20026 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
20027 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
20028 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
20029 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
20030 Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
20031 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
20032 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
20033 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
20034 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
20035 MATH_HAS_NO_SIDE_EFFECTS
20036 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
20037 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
20038 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
20039 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
20040 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
20041 NetBSD news1500 news1700 news1800 news1900 news3700
20042 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
20043 ns32016 ns32332 ns32k nsc32000
20044 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
20045 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
20046 pc532 pdp11 PGC PIC plexus PORTAR posix
20047 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
20048 POSIX_C_SOURCE POSIX_SOURCE POWER
20049 PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
20050 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
20051 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
20052 sony sony_news sonyrisc sparc sparclite spectrum
20053 stardent stdc STDC_EXT stratos sun sun3 sun386
20054 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
20055 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
20056 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
20057 sysV68 sysV88 Tek4132 Tek4300 titan
20058 TM3200 TM5400 TM5600
20059 tower tower32 tower32_200 tower32_600 tower32_700
20060 tower32_800 tower32_850 tss
20061 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
20062 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
20063 unix UNIX95 UNIX99 unixpc unos
20064 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
20065 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
20066 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
20068 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
20069 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
20070 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
20073 # Maybe put other stuff here too.
20074 cat <<EOSH >>Cppsym.know
20077 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
20078 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
20079 $cat Cppsym.know > Cppsym.c
20080 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
20081 $rm -f Cppsym.a Cppsym.b Cppsym.c
20082 cat <<EOSH > Cppsym
20084 if $test \$# -gt 0; then
20085 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
20086 if $test -s Cppsym.got; then
20093 $tr " " "$trnl" | ./Cppsym.try
20099 cat <<EOSH > Cppsym.try
20101 cat <<'EOCP' > try.c
20107 cat <<'EOSH' >> Cppsym.try
20109 printf "#ifdef %s\n#if %s+0\nprintf(\"%s=%%ld\\n\", (long)%s);\n#else\nprintf(\"%s\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1
20110 printf "#ifdef _%s\n#if _%s+0\nprintf(\"_%s=%%ld\\n\", (long)_%s);\n#else\nprintf(\"_%s\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1
20111 printf "#ifdef __%s\n#if __%s+0\nprintf(\"__%s=%%ld\\n\", (long)__%s);\n#else\nprintf(\"__%s\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1
20112 printf "#ifdef __%s__\n#if __%s__+0\nprintf(\"__%s__=%%ld\\n\", (long)__%s__);\n#else\nprintf(\"__%s__\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1
20114 echo 'return 0;}' >> try.c
20116 cat <<EOSH >> Cppsym.try
20118 case "$osname-$gccversion" in
20119 irix-) ccflags="\$ccflags -woff 1178" ;;
20120 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
20122 $cc -o try $optimize \$ccflags $ldflags try.c $libs && $run ./try
20124 chmod +x Cppsym.try
20125 $eunicefix Cppsym.try
20126 ./Cppsym < Cppsym.know > Cppsym.true
20127 : now check the C compiler for additional symbols
20128 postprocess_cc_v=''
20130 aix) postprocess_cc_v="|$tr , ' '" ;;
20137 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
20140 -D*) echo "\$i" | $sed 's/^-D//';;
20141 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
20146 postprocess_cc_v=''
20149 ./ccsym > ccsym1.raw
20150 if $test -s ccsym1.raw; then
20151 $sort ccsym1.raw | $uniq >ccsym.raw
20153 mv ccsym1.raw ccsym.raw
20156 $awk '/\=/ { print $0; next }
20157 { print $0"=1" }' ccsym.raw >ccsym.list
20158 $awk '/\=/ { print $0; next }
20159 { print $0"=1" }' Cppsym.true >ccsym.true
20160 $comm -13 ccsym.true ccsym.list >ccsym.own
20161 $comm -12 ccsym.true ccsym.list >ccsym.com
20162 $comm -23 ccsym.true ccsym.list >ccsym.cpp
20164 if $test -z ccsym.raw; then
20165 echo "Your C compiler doesn't seem to define any symbols!" >&4
20167 echo "However, your C preprocessor defines the following symbols:"
20170 cppsymbols=`$cat Cppsym.true`
20171 cppsymbols=`echo $cppsymbols`
20172 cppccsymbols="$cppsymbols"
20174 if $test -s ccsym.com; then
20175 echo "Your C compiler and pre-processor define these symbols:"
20176 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
20179 cppccsymbols=`$cat ccsym.com`
20180 cppccsymbols=`echo $cppccsymbols`
20181 $test "$silent" || sleep 1
20183 if $test -s ccsym.cpp; then
20184 $test "$also" && echo " "
20185 echo "Your C pre-processor ${also}defines the following symbols:"
20186 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
20188 cppsymbols=`$cat ccsym.cpp`
20189 cppsymbols=`echo $cppsymbols`
20190 $test "$silent" || sleep 1
20192 if $test -s ccsym.own; then
20193 $test "$also" && echo " "
20194 echo "Your C compiler ${also}defines the following cpp symbols:"
20195 $sed -e 's/\(..*\)=1/\1/' ccsym.own
20196 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
20197 ccsymbols=`$cat ccsym.own`
20198 ccsymbols=`echo $ccsymbols`
20199 $test "$silent" || sleep 1
20203 : see if this is a termio system
20207 if $test `./findhdr termios.h`; then
20208 set tcsetattr i_termios
20214 "$define") echo "You have POSIX termios.h... good!" >&4;;
20215 *) if ./Cppsym pyr; then
20216 case "`/bin/universe`" in
20217 ucb) if $test `./findhdr sgtty.h`; then
20219 echo "<sgtty.h> found." >&4
20221 echo "System is pyramid with BSD universe."
20222 echo "<sgtty.h> not found--you could have problems." >&4
20224 *) if $test `./findhdr termio.h`; then
20226 echo "<termio.h> found." >&4
20228 echo "System is pyramid with USG universe."
20229 echo "<termio.h> not found--you could have problems." >&4
20233 if $test `./findhdr termio.h`; then
20234 echo "<termio.h> found." >&4
20236 elif $test `./findhdr sgtty.h`; then
20237 echo "<sgtty.h> found." >&4
20240 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
20243 if $test `./findhdr sgtty.h`; then
20244 echo "<sgtty.h> found." >&4
20246 elif $test `./findhdr termio.h`; then
20247 echo "<termio.h> found." >&4
20250 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
20254 set i_termio; eval $setvar
20255 val=$val2; set i_sgtty; eval $setvar
20256 val=$val3; set i_termios; eval $setvar
20258 : see if stddef is available
20259 set stddef.h i_stddef
20262 : see if this is a sunmath.h system
20263 set sunmath.h i_sunmath
20266 : see if sys/access.h is available
20267 set sys/access.h i_sysaccess
20270 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
20271 set sys/filio.h i_sysfilio
20274 if $test `./findhdr sys/ioctl.h`; then
20276 echo '<sys/ioctl.h> found.' >&4
20279 if $test $i_sysfilio = "$define"; then
20280 echo '<sys/ioctl.h> NOT found.' >&4
20282 $test $i_sgtty = "$define" && xxx="sgtty.h"
20283 $test $i_termio = "$define" && xxx="termio.h"
20284 $test $i_termios = "$define" && xxx="termios.h"
20285 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
20291 : see if socket ioctl defs are in sys/sockio.h
20293 xxx=`./findhdr sys/sockio.h`
20294 if $test "$xxx"; then
20295 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
20297 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
20300 echo "No socket ioctls found in <sys/sockio.h>." >&4
20305 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
20312 : see if this is a syslog.h system
20313 set syslog.h i_syslog
20317 : see if this is a sys/mode.h system
20318 set sys/mode.h i_sysmode
20321 : see if sys/resource.h has to be included
20322 set sys/resource.h i_sysresrc
20325 : see if sys/security.h is available
20326 set sys/security.h i_syssecrt
20329 : see if this is a sys/statvfs.h system
20330 set sys/statvfs.h i_sysstatvfs
20333 : see if this is a sys/un.h system
20334 set sys/un.h i_sysun
20338 : see if this is a sys/utsname.h system
20339 set sys/utsname.h i_sysutsname
20342 : see if this is a syswait system
20343 set sys/wait.h i_syswait
20346 : see if this is a ustat.h system
20347 set ustat.h i_ustat
20350 : see if this is an utime system
20351 set utime.h i_utime
20354 : see if this is a values.h system
20355 set values.h i_values
20358 : see if this is a vfork system
20361 set vfork.h i_vfork
20369 : see if gdbm.h is available
20374 : see if gdbm_open exists
20375 set gdbm_open d_gdbm_open
20377 case "$d_gdbm_open" in
20380 echo "We won't be including <gdbm.h>"
20390 echo "Looking for extensions..." >&4
20391 : If we are using the old config.sh, known_extensions may contain
20392 : old or inaccurate or duplicate values.
20393 known_extensions=''
20394 nonxs_extensions=''
20395 : We do not use find because it might not be available.
20396 : We do not just use MANIFEST because the user may have dropped
20397 : some additional extensions into the source tree and expect them
20400 : Function to recursively find available extensions, ignoring DynaLoader
20401 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
20405 DynaLoader|dynaload) ;;
20407 if $test -f $xxx/$xxx.xs; then
20408 known_extensions="$known_extensions $1$xxx";
20409 elif $test -f $xxx/Makefile.PL; then
20410 nonxs_extensions="$nonxs_extensions $1$xxx";
20412 if $test -d $xxx -a $# -lt 10; then
20415 eval $find_extensions;
20427 eval $find_extensions
20428 # Special case: Add in threads/shared since it is not picked up by the
20429 # recursive find above (and adding in general recursive finding breaks
20430 # SDBM_File/sdbm). A.D. 10/25/2001.
20431 known_extensions="$known_extensions threads/shared"
20432 set X $nonxs_extensions
20434 nonxs_extensions="$*"
20435 set X $known_extensions
20437 known_extensions="$*"
20440 : Now see which are supported on this system.
20442 for xxx in $known_extensions ; do
20446 $define) avail_ext="$avail_ext $xxx" ;;
20449 GDBM_File|gdbm_fil)
20451 $define) avail_ext="$avail_ext $xxx" ;;
20454 I18N/Langinfo|i18n_lan)
20455 case "$i_langinfo$d_nl_langinfo" in
20456 $define$define) avail_ext="$avail_ext $xxx" ;;
20459 NDBM_File|ndbm_fil)
20462 case "$osname-$use64bitint" in
20465 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
20468 *) avail_ext="$avail_ext $xxx" ;;
20473 ODBM_File|odbm_fil)
20474 case "${i_dbm}${i_rpcsvcdbm}" in
20476 case "$osname-$use64bitint" in
20479 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
20482 *) avail_ext="$avail_ext $xxx" ;;
20488 case "$useposix" in
20489 true|define|y) avail_ext="$avail_ext $xxx" ;;
20493 case "$useopcode" in
20494 true|define|y) avail_ext="$avail_ext $xxx" ;;
20498 case "$d_socket" in
20501 beos) ;; # not unless BONE
20502 *) avail_ext="$avail_ext $xxx" ;;
20507 Sys/Syslog|sys/syslog)
20508 : XXX syslog requires socket
20509 case "$d_socket" in
20510 true|$define|y) avail_ext="$avail_ext $xxx" ;;
20514 case "$usethreads" in
20516 case "$useithreads" in
20517 $undef|false|[nN]*) avail_ext="$avail_ext $xxx" ;;
20521 XS/APItest|xs/apitest)
20522 # This is just for testing. Skip it unless we have dynamic loading.
20525 $define) avail_ext="$avail_ext $xxx" ;;
20528 XS/Typemap|xs/typemap)
20529 # This is just for testing. Skip it unless we have dynamic loading.
20531 $define) avail_ext="$avail_ext $xxx" ;;
20534 threads|threads/shared)
20535 # threads and threads::shared are special cases.
20536 # To stop people from asking "Perl 5.8.0 was supposed
20537 # to have this new fancy threads implementation but my
20538 # perl doesn't have it" and from people trying to
20539 # (re)install the threads module using CPAN.pm and
20540 # CPAN.pm then offering to reinstall Perl 5.8.0,
20541 # the threads.pm and threads/shared.pm will always be
20542 # there, croaking informatively ("you need to rebuild
20543 # all of Perl with threads, sorry") when threads haven't
20544 # been compiled in.
20546 avail_ext="$avail_ext $xxx"
20549 : XXX Do we need a useipcsysv variable here
20550 case "${d_msg}${d_sem}${d_shm}" in
20551 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
20554 *) avail_ext="$avail_ext $xxx"
20563 case "$onlyextensions" in
20565 *) keepextensions=''
20566 echo "You have requested that only certains extensions be included..." >&4
20567 for i in $onlyextensions; do
20568 case " $avail_ext " in
20570 echo "Keeping extension $i."
20571 keepextensions="$keepextensions $i"
20573 *) echo "Ignoring extension $i." ;;
20576 avail_ext="$keepextensions"
20580 case "$noextensions" in
20582 *) keepextensions=''
20583 echo "You have requested that certain extensions be ignored..." >&4
20584 for i in $avail_ext; do
20585 case " $noextensions " in
20586 *" $i "*) echo "Ignoring extension $i." ;;
20587 *) echo "Keeping extension $i.";
20588 keepextensions="$keepextensions $i"
20592 avail_ext="$keepextensions"
20596 : Now see which nonxs extensions are supported on this system.
20597 : For now assume all are.
20599 for xxx in $nonxs_extensions ; do
20601 *) nonxs_ext="$nonxs_ext $xxx"
20613 A number of extensions are supplied with $package. You may choose to
20614 compile these extensions for dynamic loading (the default), compile
20615 them into the $package executable (static loading), or not include
20616 them at all. Answer "none" to include no extensions.
20617 Note that DynaLoader is always built and need not be mentioned here.
20620 case "$dynamic_ext" in
20622 : Exclude those listed in static_ext
20624 for xxx in $avail_ext; do
20625 case " $static_ext " in
20627 *) dflt="$dflt $xxx" ;;
20634 *) dflt="$dynamic_ext"
20635 # Perhaps we are reusing an old out-of-date config.sh.
20638 if test X"$dynamic_ext" != X"$avail_ext"; then
20640 NOTICE: Your previous config.sh list may be incorrect.
20641 The extensions now available to you are
20643 but the default list from your previous config.sh is
20655 rp="What extensions do you wish to load dynamically?"
20658 none) dynamic_ext=' ' ;;
20659 *) dynamic_ext="$ans" ;;
20662 case "$static_ext" in
20664 : Exclude those already listed in dynamic linking
20666 for xxx in $avail_ext; do
20667 case " $dynamic_ext " in
20669 *) dflt="$dflt $xxx" ;;
20676 *) dflt="$static_ext"
20683 rp="What extensions do you wish to load statically?"
20686 none) static_ext=' ' ;;
20687 *) static_ext="$ans" ;;
20692 A number of extensions are supplied with $package. Answer "none"
20693 to include no extensions.
20694 Note that DynaLoader is always built and need not be mentioned here.
20697 case "$static_ext" in
20698 '') dflt="$avail_ext" ;;
20699 *) dflt="$static_ext"
20700 # Perhaps we are reusing an old out-of-date config.sh.
20703 if test X"$static_ext" != X"$avail_ext"; then
20705 NOTICE: Your previous config.sh list may be incorrect.
20706 The extensions now available to you are
20708 but the default list from your previous config.sh is
20717 : Exclude those that are not xs extensions
20721 rp="What extensions do you wish to include?"
20724 none) static_ext=' ' ;;
20725 *) static_ext="$ans" ;;
20730 # Encode is a special case. If we are building Encode as a static
20731 # extension, we need to explicitly list its subextensions as well.
20732 # For other nested extensions, this is handled automatically by
20733 # the appropriate Makefile.PL.
20734 case " $static_ext " in
20735 *" Encode "*) # Add the subextensions of Encode
20737 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
20738 static_ext="$static_ext Encode/$xxx"
20744 set X $dynamic_ext $static_ext $nonxs_ext
20748 # Sanity check: We require an extension suitable for use with
20749 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
20750 # should show up as failures in the test suite, but it's helpful to
20751 # catch them now.) The 'extensions' list is normally sorted
20752 # alphabetically, so we need to accept either
20753 # DB_File ... Fcntl ... IO ....
20754 # or something like
20755 # Fcntl ... NDBM_File ... IO ....
20756 case " $extensions" in
20757 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
20758 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
20759 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
20760 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
20761 echo "WARNING: The Perl you are building will be quite crippled." >& 4
20765 : Remove libraries needed only for extensions
20766 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
20767 : The exception is SunOS 4.x, which needs them.
20768 case "${osname}X${osvers}" in
20772 *) case "$usedl" in
20773 $define|true|[yY]*)
20774 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
20778 *) perllibs="$libs"
20784 : Remove build directory name from cppstdin so it can be used from
20785 : either the present location or the final installed location.
20787 : Get out of the UU directory to get correct path name.
20789 case "$cppstdin" in
20791 echo "Stripping down cppstdin path name"
20797 : end of configuration questions
20799 echo "End of configuration questions."
20802 : back to where it started
20803 if test -d ../UU; then
20807 : configuration may be patched via a 'config.arch' file
20808 if $test -f config.arch; then
20809 echo "I see a config.arch file, loading it."
20813 : configuration may be patched via a 'config.over' file
20814 if $test -f config.over; then
20817 rp='I see a config.over file. Do you wish to load it?'
20820 n*) echo "OK, I'll ignore it.";;
20822 echo "Configuration override changes have been loaded."
20827 : in case they want portability, strip down executable paths
20828 case "$d_portable" in
20831 echo "Stripping down executable paths..." >&4
20832 for file in $loclist $trylist; do
20834 eval $file=`basename $temp`
20839 : create config.sh file
20841 echo "Creating config.sh..." >&4
20842 $spitshell <<EOT >config.sh
20845 # This file was produced by running the Configure script. It holds all the
20846 # definitions figured out by Configure. Should you modify one of these values,
20847 # do not forget to propagate your changes by running "Configure -der". You may
20848 # instead choose to run each of the .SH files by yourself, or "Configure -S".
20851 # Package name : $package
20852 # Source directory : $src
20853 # Configuration time: $cf_time
20854 # Configured by : $cf_by
20855 # Target system : $myuname
20865 Revision='$Revision'
20873 alignbytes='$alignbytes'
20874 ansi2knr='$ansi2knr'
20875 aphostname='$aphostname'
20876 api_revision='$api_revision'
20877 api_subversion='$api_subversion'
20878 api_version='$api_version'
20879 api_versionstring='$api_versionstring'
20882 archlibexp='$archlibexp'
20883 archname64='$archname64'
20884 archname='$archname'
20885 archobjs='$archobjs'
20886 asctime_r_proto='$asctime_r_proto'
20894 byteorder='$byteorder'
20896 castflags='$castflags'
20899 cccdlflags='$cccdlflags'
20900 ccdlflags='$ccdlflags'
20902 ccflags_uselargefiles='$ccflags_uselargefiles'
20904 ccsymbols='$ccsymbols'
20905 ccversion='$ccversion'
20907 cf_email='$cf_email'
20909 charsize='$charsize'
20913 clocktype='$clocktype'
20915 compress='$compress'
20916 contains='$contains'
20920 cpp_stuff='$cpp_stuff'
20921 cppccsymbols='$cppccsymbols'
20922 cppflags='$cppflags'
20924 cppminus='$cppminus'
20926 cppstdin='$cppstdin'
20927 cppsymbols='$cppsymbols'
20928 crypt_r_proto='$crypt_r_proto'
20929 cryptlib='$cryptlib'
20931 ctermid_r_proto='$ctermid_r_proto'
20932 ctime_r_proto='$ctime_r_proto'
20933 d_Gconvert='$d_Gconvert'
20934 d_PRIEUldbl='$d_PRIEUldbl'
20935 d_PRIFUldbl='$d_PRIFUldbl'
20936 d_PRIGUldbl='$d_PRIGUldbl'
20937 d_PRIXU64='$d_PRIXU64'
20938 d_PRId64='$d_PRId64'
20939 d_PRIeldbl='$d_PRIeldbl'
20940 d_PRIfldbl='$d_PRIfldbl'
20941 d_PRIgldbl='$d_PRIgldbl'
20942 d_PRIi64='$d_PRIi64'
20943 d_PRIo64='$d_PRIo64'
20944 d_PRIu64='$d_PRIu64'
20945 d_PRIx64='$d_PRIx64'
20946 d_SCNfldbl='$d_SCNfldbl'
20947 d__fwalk='$d__fwalk'
20948 d_access='$d_access'
20949 d_accessx='$d_accessx'
20952 d_archlib='$d_archlib'
20953 d_asctime_r='$d_asctime_r'
20956 d_attribute_format='$d_attribute_format'
20957 d_attribute_malloc='$d_attribute_malloc'
20958 d_attribute_nonnull='$d_attribute_nonnull'
20959 d_attribute_noreturn='$d_attribute_noreturn'
20960 d_attribute_pure='$d_attribute_pure'
20961 d_attribute_unused='$d_attribute_unused'
20962 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
20966 d_bsdgetpgrp='$d_bsdgetpgrp'
20967 d_bsdsetpgrp='$d_bsdsetpgrp'
20969 d_casti32='$d_casti32'
20970 d_castneg='$d_castneg'
20971 d_charvspr='$d_charvspr'
20973 d_chroot='$d_chroot'
20974 d_chsize='$d_chsize'
20976 d_closedir='$d_closedir'
20977 d_cmsghdr_s='$d_cmsghdr_s'
20979 d_copysignl='$d_copysignl'
20981 d_crypt_r='$d_crypt_r'
20983 d_ctermid_r='$d_ctermid_r'
20984 d_ctime_r='$d_ctime_r'
20985 d_cuserid='$d_cuserid'
20986 d_dbl_dig='$d_dbl_dig'
20987 d_dbminitproto='$d_dbminitproto'
20988 d_difftime='$d_difftime'
20990 d_dirnamlen='$d_dirnamlen'
20991 d_dlerror='$d_dlerror'
20992 d_dlopen='$d_dlopen'
20993 d_dlsymun='$d_dlsymun'
20994 d_dosuid='$d_dosuid'
20995 d_drand48_r='$d_drand48_r'
20996 d_drand48proto='$d_drand48proto'
20998 d_eaccess='$d_eaccess'
20999 d_endgrent='$d_endgrent'
21000 d_endgrent_r='$d_endgrent_r'
21001 d_endhent='$d_endhent'
21002 d_endhostent_r='$d_endhostent_r'
21003 d_endnent='$d_endnent'
21004 d_endnetent_r='$d_endnetent_r'
21005 d_endpent='$d_endpent'
21006 d_endprotoent_r='$d_endprotoent_r'
21007 d_endpwent='$d_endpwent'
21008 d_endpwent_r='$d_endpwent_r'
21009 d_endsent='$d_endsent'
21010 d_endservent_r='$d_endservent_r'
21011 d_eofnblk='$d_eofnblk'
21012 d_eunice='$d_eunice'
21013 d_faststdio='$d_faststdio'
21014 d_fchdir='$d_fchdir'
21015 d_fchmod='$d_fchmod'
21016 d_fchown='$d_fchown'
21018 d_fcntl_can_lock='$d_fcntl_can_lock'
21019 d_fd_macros='$d_fd_macros'
21020 d_fd_set='$d_fd_set'
21021 d_fds_bits='$d_fds_bits'
21022 d_fgetpos='$d_fgetpos'
21023 d_finite='$d_finite'
21024 d_finitel='$d_finitel'
21025 d_flexfnam='$d_flexfnam'
21027 d_flockproto='$d_flockproto'
21029 d_fp_class='$d_fp_class'
21030 d_fpathconf='$d_fpathconf'
21031 d_fpclass='$d_fpclass'
21032 d_fpclassify='$d_fpclassify'
21033 d_fpclassl='$d_fpclassl'
21034 d_fpos64_t='$d_fpos64_t'
21035 d_frexpl='$d_frexpl'
21036 d_fs_data_s='$d_fs_data_s'
21037 d_fseeko='$d_fseeko'
21038 d_fsetpos='$d_fsetpos'
21039 d_fstatfs='$d_fstatfs'
21040 d_fstatvfs='$d_fstatvfs'
21042 d_ftello='$d_ftello'
21044 d_getcwd='$d_getcwd'
21045 d_getespwnam='$d_getespwnam'
21046 d_getfsstat='$d_getfsstat'
21047 d_getgrent='$d_getgrent'
21048 d_getgrent_r='$d_getgrent_r'
21049 d_getgrgid_r='$d_getgrgid_r'
21050 d_getgrnam_r='$d_getgrnam_r'
21051 d_getgrps='$d_getgrps'
21052 d_gethbyaddr='$d_gethbyaddr'
21053 d_gethbyname='$d_gethbyname'
21054 d_gethent='$d_gethent'
21055 d_gethname='$d_gethname'
21056 d_gethostbyaddr_r='$d_gethostbyaddr_r'
21057 d_gethostbyname_r='$d_gethostbyname_r'
21058 d_gethostent_r='$d_gethostent_r'
21059 d_gethostprotos='$d_gethostprotos'
21060 d_getitimer='$d_getitimer'
21061 d_getlogin='$d_getlogin'
21062 d_getlogin_r='$d_getlogin_r'
21063 d_getmnt='$d_getmnt'
21064 d_getmntent='$d_getmntent'
21065 d_getnbyaddr='$d_getnbyaddr'
21066 d_getnbyname='$d_getnbyname'
21067 d_getnent='$d_getnent'
21068 d_getnetbyaddr_r='$d_getnetbyaddr_r'
21069 d_getnetbyname_r='$d_getnetbyname_r'
21070 d_getnetent_r='$d_getnetent_r'
21071 d_getnetprotos='$d_getnetprotos'
21072 d_getpagsz='$d_getpagsz'
21073 d_getpbyname='$d_getpbyname'
21074 d_getpbynumber='$d_getpbynumber'
21075 d_getpent='$d_getpent'
21076 d_getpgid='$d_getpgid'
21077 d_getpgrp2='$d_getpgrp2'
21078 d_getpgrp='$d_getpgrp'
21079 d_getppid='$d_getppid'
21080 d_getprior='$d_getprior'
21081 d_getprotobyname_r='$d_getprotobyname_r'
21082 d_getprotobynumber_r='$d_getprotobynumber_r'
21083 d_getprotoent_r='$d_getprotoent_r'
21084 d_getprotoprotos='$d_getprotoprotos'
21085 d_getprpwnam='$d_getprpwnam'
21086 d_getpwent='$d_getpwent'
21087 d_getpwent_r='$d_getpwent_r'
21088 d_getpwnam_r='$d_getpwnam_r'
21089 d_getpwuid_r='$d_getpwuid_r'
21090 d_getsbyname='$d_getsbyname'
21091 d_getsbyport='$d_getsbyport'
21092 d_getsent='$d_getsent'
21093 d_getservbyname_r='$d_getservbyname_r'
21094 d_getservbyport_r='$d_getservbyport_r'
21095 d_getservent_r='$d_getservent_r'
21096 d_getservprotos='$d_getservprotos'
21097 d_getspnam='$d_getspnam'
21098 d_getspnam_r='$d_getspnam_r'
21099 d_gettimeod='$d_gettimeod'
21100 d_gmtime_r='$d_gmtime_r'
21101 d_gnulibc='$d_gnulibc'
21102 d_grpasswd='$d_grpasswd'
21103 d_hasmntopt='$d_hasmntopt'
21105 d_ilogbl='$d_ilogbl'
21107 d_inetaton='$d_inetaton'
21108 d_int64_t='$d_int64_t'
21109 d_isascii='$d_isascii'
21110 d_isfinite='$d_isfinite'
21113 d_isnanl='$d_isnanl'
21114 d_killpg='$d_killpg'
21115 d_lchown='$d_lchown'
21116 d_ldbl_dig='$d_ldbl_dig'
21117 d_libm_lib_version='$d_libm_lib_version'
21119 d_localtime_r='$d_localtime_r'
21120 d_locconv='$d_locconv'
21122 d_longdbl='$d_longdbl'
21123 d_longlong='$d_longlong'
21124 d_lseekproto='$d_lseekproto'
21126 d_madvise='$d_madvise'
21127 d_malloc_good_size='$d_malloc_good_size'
21128 d_malloc_size='$d_malloc_size'
21130 d_mbstowcs='$d_mbstowcs'
21131 d_mbtowc='$d_mbtowc'
21132 d_memchr='$d_memchr'
21133 d_memcmp='$d_memcmp'
21134 d_memcpy='$d_memcpy'
21135 d_memmove='$d_memmove'
21136 d_memset='$d_memset'
21138 d_mkdtemp='$d_mkdtemp'
21139 d_mkfifo='$d_mkfifo'
21140 d_mkstemp='$d_mkstemp'
21141 d_mkstemps='$d_mkstemps'
21142 d_mktime='$d_mktime'
21145 d_modfl_pow32_bug='$d_modfl_pow32_bug'
21146 d_modflproto='$d_modflproto'
21147 d_mprotect='$d_mprotect'
21149 d_msg_ctrunc='$d_msg_ctrunc'
21150 d_msg_dontroute='$d_msg_dontroute'
21151 d_msg_oob='$d_msg_oob'
21152 d_msg_peek='$d_msg_peek'
21153 d_msg_proxy='$d_msg_proxy'
21154 d_msgctl='$d_msgctl'
21155 d_msgget='$d_msgget'
21156 d_msghdr_s='$d_msghdr_s'
21157 d_msgrcv='$d_msgrcv'
21158 d_msgsnd='$d_msgsnd'
21160 d_munmap='$d_munmap'
21161 d_mymalloc='$d_mymalloc'
21163 d_nl_langinfo='$d_nl_langinfo'
21164 d_nv_preserves_uv='$d_nv_preserves_uv'
21165 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
21166 d_off64_t='$d_off64_t'
21167 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
21168 d_oldpthreads='$d_oldpthreads'
21169 d_oldsock='$d_oldsock'
21171 d_pathconf='$d_pathconf'
21173 d_perl_otherlibdirs='$d_perl_otherlibdirs'
21174 d_phostname='$d_phostname'
21177 d_portable='$d_portable'
21178 d_procselfexe='$d_procselfexe'
21179 d_pthread_atfork='$d_pthread_atfork'
21180 d_pthread_attr_setscope='$d_pthread_attr_setscope'
21181 d_pthread_yield='$d_pthread_yield'
21183 d_pwchange='$d_pwchange'
21184 d_pwclass='$d_pwclass'
21185 d_pwcomment='$d_pwcomment'
21186 d_pwexpire='$d_pwexpire'
21187 d_pwgecos='$d_pwgecos'
21188 d_pwpasswd='$d_pwpasswd'
21189 d_pwquota='$d_pwquota'
21192 d_random_r='$d_random_r'
21193 d_readdir64_r='$d_readdir64_r'
21194 d_readdir='$d_readdir'
21195 d_readdir_r='$d_readdir_r'
21196 d_readlink='$d_readlink'
21198 d_recvmsg='$d_recvmsg'
21199 d_rename='$d_rename'
21200 d_rewinddir='$d_rewinddir'
21202 d_safebcpy='$d_safebcpy'
21203 d_safemcpy='$d_safemcpy'
21204 d_sanemcmp='$d_sanemcmp'
21205 d_sbrkproto='$d_sbrkproto'
21206 d_scalbnl='$d_scalbnl'
21207 d_sched_yield='$d_sched_yield'
21208 d_scm_rights='$d_scm_rights'
21209 d_seekdir='$d_seekdir'
21210 d_select='$d_select'
21212 d_semctl='$d_semctl'
21213 d_semctl_semid_ds='$d_semctl_semid_ds'
21214 d_semctl_semun='$d_semctl_semun'
21215 d_semget='$d_semget'
21217 d_sendmsg='$d_sendmsg'
21218 d_setegid='$d_setegid'
21219 d_seteuid='$d_seteuid'
21220 d_setgrent='$d_setgrent'
21221 d_setgrent_r='$d_setgrent_r'
21222 d_setgrps='$d_setgrps'
21223 d_sethent='$d_sethent'
21224 d_sethostent_r='$d_sethostent_r'
21225 d_setitimer='$d_setitimer'
21226 d_setlinebuf='$d_setlinebuf'
21227 d_setlocale='$d_setlocale'
21228 d_setlocale_r='$d_setlocale_r'
21229 d_setnent='$d_setnent'
21230 d_setnetent_r='$d_setnetent_r'
21231 d_setpent='$d_setpent'
21232 d_setpgid='$d_setpgid'
21233 d_setpgrp2='$d_setpgrp2'
21234 d_setpgrp='$d_setpgrp'
21235 d_setprior='$d_setprior'
21236 d_setproctitle='$d_setproctitle'
21237 d_setprotoent_r='$d_setprotoent_r'
21238 d_setpwent='$d_setpwent'
21239 d_setpwent_r='$d_setpwent_r'
21240 d_setregid='$d_setregid'
21241 d_setresgid='$d_setresgid'
21242 d_setresuid='$d_setresuid'
21243 d_setreuid='$d_setreuid'
21244 d_setrgid='$d_setrgid'
21245 d_setruid='$d_setruid'
21246 d_setsent='$d_setsent'
21247 d_setservent_r='$d_setservent_r'
21248 d_setsid='$d_setsid'
21249 d_setvbuf='$d_setvbuf'
21253 d_shmatprototype='$d_shmatprototype'
21254 d_shmctl='$d_shmctl'
21256 d_shmget='$d_shmget'
21257 d_sigaction='$d_sigaction'
21258 d_sigprocmask='$d_sigprocmask'
21259 d_sigsetjmp='$d_sigsetjmp'
21260 d_sockatmark='$d_sockatmark'
21261 d_sockatmarkproto='$d_sockatmarkproto'
21262 d_socket='$d_socket'
21263 d_socklen_t='$d_socklen_t'
21264 d_sockpair='$d_sockpair'
21265 d_socks5_init='$d_socks5_init'
21267 d_srand48_r='$d_srand48_r'
21268 d_srandom_r='$d_srandom_r'
21269 d_sresgproto='$d_sresgproto'
21270 d_sresuproto='$d_sresuproto'
21271 d_statblks='$d_statblks'
21272 d_statfs_f_flags='$d_statfs_f_flags'
21273 d_statfs_s='$d_statfs_s'
21274 d_statvfs='$d_statvfs'
21275 d_stdio_cnt_lval='$d_stdio_cnt_lval'
21276 d_stdio_ptr_lval='$d_stdio_ptr_lval'
21277 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
21278 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
21279 d_stdio_stream_array='$d_stdio_stream_array'
21280 d_stdiobase='$d_stdiobase'
21281 d_stdstdio='$d_stdstdio'
21282 d_strchr='$d_strchr'
21283 d_strcoll='$d_strcoll'
21284 d_strctcpy='$d_strctcpy'
21285 d_strerrm='$d_strerrm'
21286 d_strerror='$d_strerror'
21287 d_strerror_r='$d_strerror_r'
21288 d_strftime='$d_strftime'
21289 d_strlcat='$d_strlcat'
21290 d_strlcpy='$d_strlcpy'
21291 d_strtod='$d_strtod'
21292 d_strtol='$d_strtol'
21293 d_strtold='$d_strtold'
21294 d_strtoll='$d_strtoll'
21295 d_strtoq='$d_strtoq'
21296 d_strtoul='$d_strtoul'
21297 d_strtoull='$d_strtoull'
21298 d_strtouq='$d_strtouq'
21299 d_strxfrm='$d_strxfrm'
21300 d_suidsafe='$d_suidsafe'
21301 d_symlink='$d_symlink'
21302 d_syscall='$d_syscall'
21303 d_syscallproto='$d_syscallproto'
21304 d_sysconf='$d_sysconf'
21305 d_sysernlst='$d_sysernlst'
21306 d_syserrlst='$d_syserrlst'
21307 d_system='$d_system'
21308 d_tcgetpgrp='$d_tcgetpgrp'
21309 d_tcsetpgrp='$d_tcsetpgrp'
21310 d_telldir='$d_telldir'
21311 d_telldirproto='$d_telldirproto'
21314 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
21315 d_tm_tm_zone='$d_tm_tm_zone'
21316 d_tmpnam_r='$d_tmpnam_r'
21317 d_truncate='$d_truncate'
21318 d_ttyname_r='$d_ttyname_r'
21319 d_tzname='$d_tzname'
21320 d_u32align='$d_u32align'
21321 d_ualarm='$d_ualarm'
21324 d_union_semun='$d_union_semun'
21325 d_unordered='$d_unordered'
21326 d_usleep='$d_usleep'
21327 d_usleepproto='$d_usleepproto'
21329 d_vendorarch='$d_vendorarch'
21330 d_vendorbin='$d_vendorbin'
21331 d_vendorlib='$d_vendorlib'
21332 d_vendorscript='$d_vendorscript'
21334 d_void_closedir='$d_void_closedir'
21335 d_voidsig='$d_voidsig'
21336 d_voidtty='$d_voidtty'
21337 d_volatile='$d_volatile'
21338 d_vprintf='$d_vprintf'
21340 d_waitpid='$d_waitpid'
21341 d_wcstombs='$d_wcstombs'
21342 d_wctomb='$d_wctomb'
21343 d_writev='$d_writev'
21346 db_hashtype='$db_hashtype'
21347 db_prefixtype='$db_prefixtype'
21348 db_version_major='$db_version_major'
21349 db_version_minor='$db_version_minor'
21350 db_version_patch='$db_version_patch'
21351 defvoidused='$defvoidused'
21352 direntrytype='$direntrytype'
21355 doublesize='$doublesize'
21357 drand48_r_proto='$drand48_r_proto'
21358 dynamic_ext='$dynamic_ext'
21364 endgrent_r_proto='$endgrent_r_proto'
21365 endhostent_r_proto='$endhostent_r_proto'
21366 endnetent_r_proto='$endnetent_r_proto'
21367 endprotoent_r_proto='$endprotoent_r_proto'
21368 endpwent_r_proto='$endpwent_r_proto'
21369 endservent_r_proto='$endservent_r_proto'
21370 eunicefix='$eunicefix'
21373 extensions='$extensions'
21375 fflushNULL='$fflushNULL'
21376 fflushall='$fflushall'
21378 firstmakefile='$firstmakefile'
21380 fpossize='$fpossize'
21381 fpostype='$fpostype'
21382 freetype='$freetype'
21385 full_csh='$full_csh'
21386 full_sed='$full_sed'
21387 gccansipedantic='$gccansipedantic'
21388 gccosandvers='$gccosandvers'
21389 gccversion='$gccversion'
21390 getgrent_r_proto='$getgrent_r_proto'
21391 getgrgid_r_proto='$getgrgid_r_proto'
21392 getgrnam_r_proto='$getgrnam_r_proto'
21393 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
21394 gethostbyname_r_proto='$gethostbyname_r_proto'
21395 gethostent_r_proto='$gethostent_r_proto'
21396 getlogin_r_proto='$getlogin_r_proto'
21397 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
21398 getnetbyname_r_proto='$getnetbyname_r_proto'
21399 getnetent_r_proto='$getnetent_r_proto'
21400 getprotobyname_r_proto='$getprotobyname_r_proto'
21401 getprotobynumber_r_proto='$getprotobynumber_r_proto'
21402 getprotoent_r_proto='$getprotoent_r_proto'
21403 getpwent_r_proto='$getpwent_r_proto'
21404 getpwnam_r_proto='$getpwnam_r_proto'
21405 getpwuid_r_proto='$getpwuid_r_proto'
21406 getservbyname_r_proto='$getservbyname_r_proto'
21407 getservbyport_r_proto='$getservbyport_r_proto'
21408 getservent_r_proto='$getservent_r_proto'
21409 getspnam_r_proto='$getspnam_r_proto'
21410 gidformat='$gidformat'
21416 gmtime_r_proto='$gmtime_r_proto'
21417 gnulibc_version='$gnulibc_version'
21419 groupcat='$groupcat'
21420 groupstype='$groupstype'
21423 h_sysfile='$h_sysfile'
21426 html1dir='$html1dir'
21427 html1direxp='$html1direxp'
21428 html3dir='$html3dir'
21429 html3direxp='$html3direxp'
21438 i_arpainet='$i_arpainet'
21439 i_bsdioctl='$i_bsdioctl'
21443 i_dirent='$i_dirent'
21449 i_fp_class='$i_fp_class'
21452 i_ieeefp='$i_ieeefp'
21453 i_inttypes='$i_inttypes'
21454 i_langinfo='$i_langinfo'
21455 i_libutil='$i_libutil'
21456 i_limits='$i_limits'
21457 i_locale='$i_locale'
21458 i_machcthr='$i_machcthr'
21459 i_malloc='$i_malloc'
21461 i_memory='$i_memory'
21462 i_mntent='$i_mntent'
21465 i_neterrno='$i_neterrno'
21466 i_netinettcp='$i_netinettcp'
21470 i_pthread='$i_pthread'
21472 i_rpcsvcdbm='$i_rpcsvcdbm'
21475 i_shadow='$i_shadow'
21477 i_stdarg='$i_stdarg'
21478 i_stddef='$i_stddef'
21479 i_stdlib='$i_stdlib'
21480 i_string='$i_string'
21481 i_sunmath='$i_sunmath'
21482 i_sysaccess='$i_sysaccess'
21483 i_sysdir='$i_sysdir'
21484 i_sysfile='$i_sysfile'
21485 i_sysfilio='$i_sysfilio'
21487 i_sysioctl='$i_sysioctl'
21488 i_syslog='$i_syslog'
21489 i_sysmman='$i_sysmman'
21490 i_sysmode='$i_sysmode'
21491 i_sysmount='$i_sysmount'
21492 i_sysndir='$i_sysndir'
21493 i_sysparam='$i_sysparam'
21494 i_sysresrc='$i_sysresrc'
21495 i_syssecrt='$i_syssecrt'
21496 i_sysselct='$i_sysselct'
21497 i_syssockio='$i_syssockio'
21498 i_sysstat='$i_sysstat'
21499 i_sysstatfs='$i_sysstatfs'
21500 i_sysstatvfs='$i_sysstatvfs'
21501 i_systime='$i_systime'
21502 i_systimek='$i_systimek'
21503 i_systimes='$i_systimes'
21504 i_systypes='$i_systypes'
21505 i_sysuio='$i_sysuio'
21507 i_sysutsname='$i_sysutsname'
21508 i_sysvfs='$i_sysvfs'
21509 i_syswait='$i_syswait'
21510 i_termio='$i_termio'
21511 i_termios='$i_termios'
21513 i_unistd='$i_unistd'
21516 i_values='$i_values'
21517 i_varargs='$i_varargs'
21518 i_varhdr='$i_varhdr'
21520 ignore_versioned_solibs='$ignore_versioned_solibs'
21521 inc_version_list='$inc_version_list'
21522 inc_version_list_init='$inc_version_list_init'
21525 installarchlib='$installarchlib'
21526 installbin='$installbin'
21527 installhtml1dir='$installhtml1dir'
21528 installhtml3dir='$installhtml3dir'
21529 installman1dir='$installman1dir'
21530 installman3dir='$installman3dir'
21531 installprefix='$installprefix'
21532 installprefixexp='$installprefixexp'
21533 installprivlib='$installprivlib'
21534 installscript='$installscript'
21535 installsitearch='$installsitearch'
21536 installsitebin='$installsitebin'
21537 installsitehtml1dir='$installsitehtml1dir'
21538 installsitehtml3dir='$installsitehtml3dir'
21539 installsitelib='$installsitelib'
21540 installsiteman1dir='$installsiteman1dir'
21541 installsiteman3dir='$installsiteman3dir'
21542 installsitescript='$installsitescript'
21543 installstyle='$installstyle'
21544 installusrbinperl='$installusrbinperl'
21545 installvendorarch='$installvendorarch'
21546 installvendorbin='$installvendorbin'
21547 installvendorhtml1dir='$installvendorhtml1dir'
21548 installvendorhtml3dir='$installvendorhtml3dir'
21549 installvendorlib='$installvendorlib'
21550 installvendorman1dir='$installvendorman1dir'
21551 installvendorman3dir='$installvendorman3dir'
21552 installvendorscript='$installvendorscript'
21554 issymlink='$issymlink'
21555 ivdformat='$ivdformat'
21558 known_extensions='$known_extensions'
21561 lddlflags='$lddlflags'
21563 ldflags_uselargefiles='$ldflags_uselargefiles'
21564 ldlibpthname='$ldlibpthname'
21571 libsdirs='$libsdirs'
21572 libsfiles='$libsfiles'
21573 libsfound='$libsfound'
21574 libspath='$libspath'
21575 libswanted='$libswanted'
21576 libswanted_uselargefiles='$libswanted_uselargefiles'
21582 localtime_r_proto='$localtime_r_proto'
21583 locincpth='$locincpth'
21584 loclibpth='$loclibpth'
21585 longdblsize='$longdblsize'
21586 longlongsize='$longlongsize'
21587 longsize='$longsize'
21591 lseeksize='$lseeksize'
21592 lseektype='$lseektype'
21596 make_set_make='$make_set_make'
21597 mallocobj='$mallocobj'
21598 mallocsrc='$mallocsrc'
21599 malloctype='$malloctype'
21601 man1direxp='$man1direxp'
21604 man3direxp='$man3direxp'
21606 mips_type='$mips_type'
21607 mistrustnm='$mistrustnm'
21609 mmaptype='$mmaptype'
21610 modetype='$modetype'
21612 multiarch='$multiarch'
21614 myarchname='$myarchname'
21615 mydomain='$mydomain'
21616 myhostname='$myhostname'
21619 need_va_copy='$need_va_copy'
21620 netdb_hlen_type='$netdb_hlen_type'
21621 netdb_host_type='$netdb_host_type'
21622 netdb_name_type='$netdb_name_type'
21623 netdb_net_type='$netdb_net_type'
21626 nm_so_opt='$nm_so_opt'
21627 nonxs_ext='$nonxs_ext'
21629 nvEUformat='$nvEUformat'
21630 nvFUformat='$nvFUformat'
21631 nvGUformat='$nvGUformat'
21632 nv_preserves_uv_bits='$nv_preserves_uv_bits'
21633 nveformat='$nveformat'
21634 nvfformat='$nvfformat'
21635 nvgformat='$nvgformat'
21638 o_nonblock='$o_nonblock'
21640 old_pthread_create_joinable='$old_pthread_create_joinable'
21641 optimize='$optimize'
21642 orderlib='$orderlib'
21645 otherlibdirs='$otherlibdirs'
21649 patchlevel='$patchlevel'
21650 path_sep='$path_sep'
21653 perl_patchlevel='$perl_patchlevel'
21654 perladmin='$perladmin'
21655 perllibs='$perllibs'
21656 perlpath='$perlpath'
21658 phostname='$phostname'
21664 prefixexp='$prefixexp'
21666 privlibexp='$privlibexp'
21667 procselfexe='$procselfexe'
21668 prototype='$prototype'
21670 quadkind='$quadkind'
21671 quadtype='$quadtype'
21672 randbits='$randbits'
21673 randfunc='$randfunc'
21674 random_r_proto='$random_r_proto'
21675 randseedtype='$randseedtype'
21677 rd_nodata='$rd_nodata'
21678 readdir64_r_proto='$readdir64_r_proto'
21679 readdir_r_proto='$readdir_r_proto'
21680 revision='$revision'
21685 sPRIEUldbl='$sPRIEUldbl'
21686 sPRIFUldbl='$sPRIFUldbl'
21687 sPRIGUldbl='$sPRIGUldbl'
21688 sPRIXU64='$sPRIXU64'
21690 sPRIeldbl='$sPRIeldbl'
21691 sPRIfldbl='$sPRIfldbl'
21692 sPRIgldbl='$sPRIgldbl'
21697 sSCNfldbl='$sSCNfldbl'
21698 sched_yield='$sched_yield'
21699 scriptdir='$scriptdir'
21700 scriptdirexp='$scriptdirexp'
21702 seedfunc='$seedfunc'
21703 selectminbits='$selectminbits'
21704 selecttype='$selecttype'
21705 sendmail='$sendmail'
21706 setgrent_r_proto='$setgrent_r_proto'
21707 sethostent_r_proto='$sethostent_r_proto'
21708 setlocale_r_proto='$setlocale_r_proto'
21709 setnetent_r_proto='$setnetent_r_proto'
21710 setprotoent_r_proto='$setprotoent_r_proto'
21711 setpwent_r_proto='$setpwent_r_proto'
21712 setservent_r_proto='$setservent_r_proto'
21715 sharpbang='$sharpbang'
21716 shmattype='$shmattype'
21717 shortsize='$shortsize'
21720 sig_count='$sig_count'
21721 sig_name='$sig_name'
21722 sig_name_init='$sig_name_init'
21724 sig_num_init='$sig_num_init'
21725 sig_size='$sig_size'
21726 signal_t='$signal_t'
21727 sitearch='$sitearch'
21728 sitearchexp='$sitearchexp'
21730 sitebinexp='$sitebinexp'
21731 sitehtml1dir='$sitehtml1dir'
21732 sitehtml1direxp='$sitehtml1direxp'
21733 sitehtml3dir='$sitehtml3dir'
21734 sitehtml3direxp='$sitehtml3direxp'
21736 sitelib_stem='$sitelib_stem'
21737 sitelibexp='$sitelibexp'
21738 siteman1dir='$siteman1dir'
21739 siteman1direxp='$siteman1direxp'
21740 siteman3dir='$siteman3dir'
21741 siteman3direxp='$siteman3direxp'
21742 siteprefix='$siteprefix'
21743 siteprefixexp='$siteprefixexp'
21744 sitescript='$sitescript'
21745 sitescriptexp='$sitescriptexp'
21746 sizesize='$sizesize'
21747 sizetype='$sizetype'
21751 sockethdr='$sockethdr'
21752 socketlib='$socketlib'
21753 socksizetype='$socksizetype'
21755 spackage='$spackage'
21756 spitshell='$spitshell'
21757 srand48_r_proto='$srand48_r_proto'
21758 srandom_r_proto='$srandom_r_proto'
21760 ssizetype='$ssizetype'
21761 startperl='$startperl'
21763 static_ext='$static_ext'
21765 stdio_base='$stdio_base'
21766 stdio_bufsiz='$stdio_bufsiz'
21767 stdio_cnt='$stdio_cnt'
21768 stdio_filbuf='$stdio_filbuf'
21769 stdio_ptr='$stdio_ptr'
21770 stdio_stream_array='$stdio_stream_array'
21771 strerror_r_proto='$strerror_r_proto'
21774 subversion='$subversion'
21778 targetarch='$targetarch'
21782 timeincl='$timeincl'
21783 timetype='$timetype'
21784 tmpnam_r_proto='$tmpnam_r_proto'
21790 ttyname_r_proto='$ttyname_r_proto'
21799 uidformat='$uidformat'
21805 uquadtype='$uquadtype'
21806 use5005threads='$use5005threads'
21807 use64bitall='$use64bitall'
21808 use64bitint='$use64bitint'
21809 usecrosscompile='$usecrosscompile'
21811 usefaststdio='$usefaststdio'
21812 useithreads='$useithreads'
21813 uselargefiles='$uselargefiles'
21814 uselongdouble='$uselongdouble'
21815 usemallocwrap='$usemallocwrap'
21816 usemorebits='$usemorebits'
21817 usemultiplicity='$usemultiplicity'
21818 usemymalloc='$usemymalloc'
21820 useopcode='$useopcode'
21821 useperlio='$useperlio'
21822 useposix='$useposix'
21823 usereentrant='$usereentrant'
21824 userelocatableinc='$userelocatableinc'
21826 useshrplib='$useshrplib'
21827 usesitecustomize='$usesitecustomize'
21828 usesocks='$usesocks'
21829 usethreads='$usethreads'
21830 usevendorprefix='$usevendorprefix'
21831 usevfork='$usevfork'
21834 uvXUformat='$uvXUformat'
21835 uvoformat='$uvoformat'
21838 uvuformat='$uvuformat'
21839 uvxformat='$uvxformat'
21840 vendorarch='$vendorarch'
21841 vendorarchexp='$vendorarchexp'
21842 vendorbin='$vendorbin'
21843 vendorbinexp='$vendorbinexp'
21844 vendorhtml1dir='$vendorhtml1dir'
21845 vendorhtml1direxp='$vendorhtml1direxp'
21846 vendorhtml3dir='$vendorhtml3dir'
21847 vendorhtml3direxp='$vendorhtml3direxp'
21848 vendorlib='$vendorlib'
21849 vendorlib_stem='$vendorlib_stem'
21850 vendorlibexp='$vendorlibexp'
21851 vendorman1dir='$vendorman1dir'
21852 vendorman1direxp='$vendorman1direxp'
21853 vendorman3dir='$vendorman3dir'
21854 vendorman3direxp='$vendorman3direxp'
21855 vendorprefix='$vendorprefix'
21856 vendorprefixexp='$vendorprefixexp'
21857 vendorscript='$vendorscript'
21858 vendorscriptexp='$vendorscriptexp'
21860 version_patchlevel_string='$version_patchlevel_string'
21861 versiononly='$versiononly'
21863 voidflags='$voidflags'
21866 yaccflags='$yaccflags'
21871 : Add in command line options if available
21872 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
21874 : add special variables
21875 $test -f $src/patchlevel.h && \
21876 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
21877 echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
21878 echo "PERL_CONFIG_SH=true" >>config.sh
21880 : propagate old symbols
21881 if $test -f UU/config.sh; then
21882 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
21883 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
21884 $sort | $uniq -u >UU/oldsyms
21885 set X `cat UU/oldsyms`
21891 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
21893 echo "# Variables propagated from previous config.sh file." >>config.sh
21894 for sym in `cat UU/oldsyms`; do
21895 echo " Propagating $hint variable "'$'"$sym..."
21896 eval 'tmp="$'"${sym}"'"'
21898 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
21904 : Finish up by extracting the .SH files
21908 echo "Extraction done."
21918 If you'd like to make any changes to the config.sh file before I begin
21919 to configure things, do it as a shell escape now (e.g. !vi config.sh).
21922 rp="Press return or use a shell escape to edit config.sh:"
21927 *) : in case they cannot read
21928 sh 1>&4 -c "$ans";;
21933 : if this fails, just run all the .SH files by hand
21942 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
21949 Now you need to generate make dependencies by running "$make depend".
21950 You might prefer to run it in background: "$make depend > makedepend.out &"
21951 It can take a while, so you might not want to run it right now.
21956 rp="Run $make depend now?"
21960 $make depend && echo "Now you must run '$make'."
21963 echo "You must run '$make depend' then '$make'."
21966 elif test -f [Mm]akefile; then
21968 echo "Now you must run a $make."
21970 echo "Configure done."
21973 if $test -f Policy.sh; then
21976 If you compile $package on a different machine or from a different object
21977 directory, copy the Policy.sh file from this object directory to the
21978 new one before you run Configure -- this will help you with most of
21979 the policy defaults.
21983 if $test -f config.msg; then
21984 echo "Hmm. I also noted the following information while running:"
21986 $cat config.msg >&4
21989 $rm -f kit*isdone ark*isdone