3 # If these # comments don't work, trim them. Don't worry about any other
4 # shell scripts, Configure will trim # comments from them for you.
6 # (If you are trying to port this package to a machine without sh,
7 # I would suggest you have a look at the prototypical config_h.SH file
8 # and edit it to reflect your system. Some packages may include samples
9 # of config.h for certain machines, so you might look for one of those.)
11 # Yes, you may rip this off to use in other distribution packages. This
12 # script belongs to the public domain and cannot be copyrighted.
14 # (Note: this Configure script was generated automatically. Rather than
15 # working with this copy of Configure, you may wish to get metaconfig.
16 # The dist-3.0 package (which contains metaconfig) was posted in
17 # comp.sources.misc and is available on CPAN under authors/id/RAM so
18 # you may fetch it yourself from your nearest archive site.)
21 # Though this script was generated by metaconfig, it is OK to send
22 # patches against it. It's up to the Configure pumpkin to backport
23 # the patch to the metaunits if it is accepted.
24 # See Porting/pumpkin.pod for more information on metaconfig.
27 # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
29 # Generated on Wed Sep 13 08:48:56 CEST 2006 [metaconfig 3.0 PL70]
30 # (with additional metaconfig patches by perlbug@perl.org)
35 SCO csh still thinks true is false. Write to SCO today and tell them that next
36 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
38 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
39 we'd have to do is go in and swap the && and || tokens, wherever they are.)
41 [End of diatribe. We now return you to your regularly scheduled programming...]
45 OOPS! You naughty creature! You didn't run Configure with sh!
46 I will attempt to remedy the situation by running sh for you...
50 true || exec sh $0 $argv:q
52 (exit $?0) || cat c2$$
53 (exit $?0) || exec sh $0 $argv:q
56 if test -f /dev/cputype -a -f /dev/drivers -a -f /dev/osversion; then
59 *** I'm sorry but this system looks like Plan 9 and Plan 9 doesn't do
60 *** Configure that well. (Plan 9 is close to UNIX but not close enough.)
61 *** Please read the README.plan9 for further instructions.
62 *** Cannot continue, aborting.
68 : compute my invocation name
72 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
77 : Proper separator for the PATH environment variable
79 : On OS/2 this directory should exist if this is not floppy only system :-]
80 if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' ) 2>&1 >/dev/null ; then
81 if test -n "$OS2_SHELL"; then
83 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
84 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
86 elif test -n "$DJGPP"; then
87 case "X${MACHTYPE:-nonesuchmach}" in
95 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
96 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
97 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
98 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
99 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
100 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
101 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
102 paths="$paths /sbin /usr/sbin /usr/libexec"
103 paths="$paths /system/gnu_library/bin"
107 case "$p_$PATH$p_" in
109 *) test -d $p && PATH=$PATH$p_$p ;;
116 : shall we be using ksh?
122 if (PATH=.; alias -x) >/dev/null 2>&1; then
125 if test -f /hp-ux -a -f /bin/ksh; then
126 needksh='to avoid sh bug in "here document" expansion'
128 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
129 if test X`/usr/bin/uname -v` = X4; then
130 avoidksh="to avoid AIX 4's /bin/sh"
134 if test -f /osf_boot -a -f /usr/sbin/setld; then
135 if test X`/usr/bin/uname -s` = XOSF1; then
136 avoidksh="to avoid Digital UNIX' ksh"
138 unset BIN_SH # if this is 'xpg4' sh will start up ksh
141 case "$inksh/$needksh" in
148 case "$inksh/$avoidksh" in
154 case "$inksh/$needksh-$avoidksh-" in
157 (I see you are using the Korn shell. Some ksh's blow up on $me,
158 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
165 echo "(Feeding myself to $newsh $reason.)"
167 Configure|*/Configure) exec $newsh $0 "$@";;
168 *) exec $newsh Configure "$@";;
173 : if needed set CDPATH to a harmless value that is not chatty
174 : avoid bash 2.02 problems with empty CDPATH.
178 *bash*) CDPATH='.' ;;
183 : Configure runs within the UU subdirectory
184 test -d UU || mkdir UU
322 initialinstalllocation=''
350 d_attribute_format=''
351 d_attribute_malloc=''
352 d_attribute_nonnull=''
353 d_attribute_noreturn=''
355 d_attribute_unused=''
356 d_attribute_warn_unused_result=''
359 d_builtin_choose_expr=''
362 d_c99_variadic_macros=''
407 endhostent_r_proto=''
413 endprotoent_r_proto=''
419 endservent_r_proto=''
471 gethostbyaddr_r_proto=''
473 gethostbyname_r_proto=''
475 gethostent_r_proto=''
487 getnetbyaddr_r_proto=''
489 getnetbyname_r_proto=''
503 d_getprotobyname_r=''
504 getprotobyname_r_proto=''
505 d_getprotobynumber_r=''
506 getprotobynumber_r_proto=''
508 getprotoent_r_proto=''
520 getservbyname_r_proto=''
522 getservbyport_r_proto=''
524 getservent_r_proto=''
548 d_libm_lib_version=''
561 d_malloc_good_size=''
603 d_old_pthread_create_joinable=''
604 old_pthread_create_joinable=''
606 d_pthread_attr_setscope=''
645 sethostent_r_proto=''
662 setprotoent_r_proto=''
674 setservent_r_proto=''
707 d_sprintf_returns_strlen=''
722 d_stdio_ptr_lval_nochange_cnt=''
723 d_stdio_ptr_lval_sets_cnt=''
926 d_inc_version_list=''
928 inc_version_list_init=''
947 ignore_versioned_solibs=''
1011 d_perl_otherlibdirs=''
1019 api_versionstring=''
1025 version_patchlevel_string=''
1029 d_nv_preserves_uv=''
1030 d_nv_zero_is_allbits_zero=''
1041 nv_preserves_uv_bits=''
1113 installsitehtml1dir=''
1116 installsitehtml3dir=''
1123 installsiteman1dir=''
1126 installsiteman3dir=''
1131 installsitescript=''
1146 d_stdio_stream_array=''
1147 stdio_stream_array=''
1158 ccflags_uselargefiles=''
1159 ldflags_uselargefiles=''
1160 libswanted_uselargefiles=''
1180 installvendorarch=''
1187 installvendorhtml1dir=''
1189 vendorhtml1direxp=''
1190 installvendorhtml3dir=''
1192 vendorhtml3direxp=''
1198 installvendorman1dir=''
1201 installvendorman3dir=''
1208 installvendorscript=''
1220 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1223 : We must find out about Eunice early
1225 if test -f /etc/unixtovms; then
1226 eunicefix=/etc/unixtovms
1228 if test -f /etc/unixtovms.exe; then
1229 eunicefix=/etc/unixtovms.exe
1232 : Set executable suffix now -- needed before hints available
1233 if test -f "/libs/version.library"; then
1236 elif test -f "/system/gnu_library/bin/ar.pm"; then
1239 elif test -n "$DJGPP"; then
1242 elif test -d c:/. -o -n "$is_os2" ; then
1251 : set useposix=false in your hint file to disable the POSIX extension.
1253 : set useopcode=false in your hint file to disable the Opcode extension.
1255 : Trailing extension. Override this in a hint file, if needed.
1256 : Extra object files, if any, needed on this platform.
1259 : Possible local include directories to search.
1260 : Set locincpth to "" in a hint file to defeat local include searches.
1261 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1262 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1264 : no include file wanted by default
1267 : Enable -DEBUGGING and -DDEBUGGING from the command line
1273 : change the next line if compiling for Xenix/286 on Xenix/386
1274 xlibpth='/usr/lib/386 /lib/386'
1275 : Possible local library directories to search.
1276 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1277 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1279 : general looking path for locating libraries
1280 glibpth="/lib /usr/lib $xlibpth"
1281 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1282 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1283 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1285 : Private path used by Configure to find libraries. Its value
1286 : is prepended to libpth. This variable takes care of special
1287 : machines, like the mips. Usually, it should be empty.
1290 : default library list
1292 : some systems want to use only the non-versioned libso:s
1293 ignore_versioned_solibs=''
1298 ccflags_uselargefiles=''
1299 ldflags_uselargefiles=''
1300 libswanted_uselargefiles=''
1301 : set usemultiplicity on the Configure command line to enable multiplicity.
1302 : set usesocks on the Configure command line to enable socks.
1303 : set usethreads on the Configure command line to enable threads.
1304 usereentrant='undef'
1305 : full support for void wanted by default
1308 : List of libraries we want.
1309 : If anyone needs extra -lxxx, put those in a hint file.
1310 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1311 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1312 : We probably want to search /usr/shlib before most other libraries.
1313 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1314 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1315 glibpth="/usr/shlib $glibpth"
1316 : Do not use vfork unless overridden by a hint file.
1319 : Find the basic shell for Bourne shell scripts
1323 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1326 if test -f "$xxx"; then
1329 : Build up a list and do a single loop so we can 'break' out.
1330 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1331 for xxx in sh bash ksh pdksh ash; do
1333 try="$try ${p}/${xxx}"
1337 if test -f "$xxx"; then
1340 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1343 elif test -f "$xxx.exe"; then
1354 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1356 Usually it's in /bin/sh. How did you even get this far?
1357 Please contact me (Perl Maintainers) at perlbug@perl.org and
1358 we'll try to straighten this all out.
1364 : see if sh knows # comments
1365 if `$sh -c '#' >/dev/null 2>&1`; then
1369 test -f $xcat$_exe || xcat=/usr/bin/cat
1370 if test ! -f $xcat$_exe; then
1371 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1372 if test -f $p/cat$_exe; then
1377 if test ! -f $xcat$_exe; then
1378 echo "Can't find cat anywhere!"
1382 echo "#!$xcat" >sharp
1386 if test -s today; then
1389 echo "#! $xcat" > sharp
1393 if test -s today; then
1401 echo "Your $sh doesn't grok # comments--I will strip them later on."
1404 echo "exec grep -v '^[ ]*#'" >spitshell
1406 $eunicefix spitshell
1407 spitshell=`pwd`/spitshell
1409 echo "I presume that if # doesn't work, #! won't work either!"
1414 : figure out how to guarantee sh startup
1416 '') startsh=${sharpbang}${sh} ;;
1428 : echo "Yup, it does."
1430 echo "Hmm... '$startsh' does not guarantee sh startup..."
1431 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1436 : Save command line options in file UU/cmdline.opt for later use in
1437 : generating config.sh.
1438 cat > cmdline.opt <<EOSH
1439 # Configure command line arguments.
1448 cat >>cmdline.opt <<EOSH
1449 config_arg$argn='$arg'
1451 # Extreme backslashitis: replace each ' by '"'"'
1452 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1455 arg_exp=`cat cmdl.opt`
1456 args_exp="$args_exp$args_sep'$arg_exp'"
1457 argn=`expr $argn + 1`
1460 # args_exp is good for restarting self: eval "set X $args_exp"; shift; $0 "$@"
1461 # used by ./hints/os2.sh
1464 : produce awk script to parse command line options
1465 cat >options.awk <<'EOF'
1467 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1469 len = length(optstr);
1470 for (i = 1; i <= len; i++) {
1471 c = substr(optstr, i, 1);
1472 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1483 if (substr(str, 1, 1) != "-") {
1484 printf("'%s'\n", str);
1488 for (i = 2; i <= len; i++) {
1489 c = substr(str, i, 1);
1491 printf("-%s\n", substr(str, i));
1497 printf("'%s'\n", substr(str, i + 1));
1510 : process the command line options
1511 set X `for arg in "$@"; do echo "X$arg"; done |
1512 sed -e s/X// | awk -f options.awk`
1517 : set up default values
1527 rm -f optdef.sh posthint.sh
1528 cat >optdef.sh <<EOS
1534 while test $# -gt 0; do
1536 -d) shift; fastread=yes;;
1537 -e) shift; alldone=cont;;
1541 if test -r "$1"; then
1544 echo "$me: cannot read config file $1." >&2
1549 -h) shift; error=true;;
1550 -r) shift; reuseval=true;;
1551 -s) shift; silent=true; realsilent=true;;
1552 -E) shift; alldone=exit;;
1553 -K) shift; knowitall=true;;
1554 -O) shift; override=true;;
1555 -S) shift; silent=true; extractsh=true;;
1560 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1561 echo "$me: ignoring -D $1" >&2
1564 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1565 *) echo "$1='define'" >> optdef.sh;;
1572 *=) echo "$1" >> optdef.sh;;
1574 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1575 echo "$me: ignoring -U $1" >&2
1577 *) echo "$1='undef'" >> optdef.sh;;
1588 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1592 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1593 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1599 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1600 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1601 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1602 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1603 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1604 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1610 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1612 echo "$yyy=''" >> posthint.sh ;;
1617 echo "$yyy='$zzz'" >> posthint.sh ;;
1619 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1621 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1626 echo "$yyy=$zzz" >> posthint.sh ;;
1627 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1631 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1634 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1642 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1643 [-U symbol] [-U symbol=] [-A command:symbol...]
1644 -d : use defaults for all answers.
1645 -e : go on without questioning past the production of config.sh.
1646 -f : specify an alternate default configuration file.
1647 -h : print this help message and exit (with an error status).
1648 -r : reuse C symbols value if possible (skips costly nm extraction).
1649 -s : silent mode, only echoes questions and essential information.
1650 -D : define symbol to have some value:
1651 -D symbol symbol gets the value 'define'
1652 -D symbol=value symbol gets the value 'value'
1653 -E : stop at the end of questions, after having produced config.sh.
1654 -K : do not use unless you know what you are doing.
1655 -O : let -D and -U override definitions from loaded configuration file.
1656 -S : perform variable substitutions on all .SH files (can mix with -f)
1657 -U : undefine symbol:
1658 -U symbol symbol gets the value 'undef'
1659 -U symbol= symbol gets completely empty
1660 -A : manipulate symbol after the platform specific hints have been applied:
1661 -A symbol=value append " "value to symbol
1662 -A append:symbol=value append value to symbol
1663 -A define:symbol=value define symbol to have value
1664 -A clear:symbol define symbol to be ''
1665 -A define:symbol define symbol to be 'define'
1666 -A eval:symbol=value define symbol to be eval of value
1667 -A prepend:symbol=value prepend value to symbol
1668 -A undef:symbol define symbol to be 'undef'
1669 -A undef:symbol= define symbol to be ''
1670 -V : print version number and exit (with a zero status).
1677 case "$fastread$alldone" in
1680 case "$extractsh" in
1683 if test ! -t 0; then
1684 echo "Say 'sh Configure', not 'sh <Configure'"
1694 true) exec 1>/dev/null;;
1697 : run the defines and the undefines, if any, but leave the file out there...
1700 : create the posthint manipulation script and leave the file out there...
1705 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1706 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1707 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1708 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1709 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1712 : Some greps do not return status, grrr.
1713 echo "grimblepritz" >grimble
1714 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1716 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1722 : the following should work in any shell
1726 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1727 cat >contains <<'EOSS'
1728 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1733 : Find the path to the source tree
1736 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1740 *) src=`cd ../$src && pwd` ;;
1753 if test -f $rsrc/Configure && \
1754 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1756 : found it, so we are ok.
1759 for src in . .. ../.. ../../.. ../../../..; do
1760 if test -f ../$src/Configure && \
1761 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1772 Sorry, I can't seem to locate the source dir for $package. Please start
1773 Configure with an explicit path -- i.e. /some/path/Configure.
1781 echo "Sources for $package found in \"$src\"." >&4
1785 : script used to extract .SH files with variable substitutions
1786 cat >extract <<'EOS'
1788 echo "Doing variable substitutions on .SH files..."
1789 if test -f MANIFEST; then
1790 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1792 echo "(Looking for .SH files under the source directory.)"
1793 set x `(cd "$src"; find . -name "*.SH" -print)`
1797 0) set x `(cd "$src"; echo *.SH)`; shift;;
1799 if test ! -f "$src/$1"; then
1805 while test $name; do
1806 if test ! -d "$name"; then
1807 create="$name $create";
1808 name=`echo $name | sed -e "s|^[^/]*$||"`;
1809 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1814 for file in $create; do
1823 dir=`expr X$file : 'X\(.*\)/'`
1824 file=`expr X$file : 'X.*/\(.*\)'`
1825 (cd "$dir" && . ./$file)
1835 dir=`expr X$file : 'X\(.*\)/'`
1836 file=`expr X$file : 'X.*/\(.*\)'`
1837 (set x $dir; shift; eval $mkdir_p)
1838 sh <"$src/$dir/$file"
1847 if test -f "$src/config_h.SH"; then
1848 if test ! -f config.h; then
1849 : oops, they left it out of MANIFEST, probably, so do it anyway.
1850 . "$src/config_h.SH"
1855 : extract files and exit if asked to do so
1856 case "$extractsh" in
1858 case "$realsilent" in
1862 case "$config_sh" in
1863 '') config_sh='config.sh';;
1866 echo "Fetching answers from $config_sh..."
1869 test "$override" && . ./optdef.sh
1873 echo "Extraction done."
1878 : Eunice requires " " instead of "", can you believe it
1881 echo "Beginning of configuration questions for $package."
1883 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1885 : first determine how to suppress newline on echo command
1887 echo "Checking echo to see how to suppress newlines..."
1888 (echo "hi there\c" ; echo " ") >.echotmp
1889 if $contains c .echotmp >/dev/null 2>&1 ; then
1900 echo $n "The star should be here-->$c"
1904 : Now test for existence of everything in MANIFEST
1906 if test -f "$rsrc/MANIFEST"; then
1907 echo "First let's make sure your kit is complete. Checking..." >&4
1908 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | (split -l 50 2>/dev/null || split -50)
1911 for filelist in x??; do
1912 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` >/dev/null 2>>"$tmppwd/missing")
1914 if test -s missing; then
1918 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1920 You have the option of continuing the configuration process, despite the
1921 distinct possibility that your kit is damaged, by typing 'y'es. If you
1922 do, don't blame me if something goes wrong. I advise you to type 'n'o
1923 and contact the author (perlbug@perl.org).
1926 echo $n "Continue? [n] $c" >&4
1930 echo "Continuing..." >&4
1934 echo "ABORTING..." >&4
1939 echo "Looks good..."
1942 echo "There is no MANIFEST file. I hope your kit is complete !"
1947 : Find the appropriate value for a newline for tr
1948 if test -n "$DJGPP"; then
1951 if test X"$trnl" = X; then
1952 case "`echo foo|tr '\n' x 2>/dev/null`" in
1956 if test X"$trnl" = X; then
1957 case "`echo foo|tr '\012' x 2>/dev/null`" in
1958 foox) trnl='\012' ;;
1961 if test X"$trnl" = X; then
1962 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
1963 fooxy) trnl='\n\r' ;;
1966 if test X"$trnl" = X; then
1969 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1975 : compute the number of columns on the terminal for proper question formatting
1980 : set up the echo used in my read
1981 myecho="case \"\$xxxm\" in
1982 '') echo $n \"\$rp $c\" >&4;;
1984 '') echo $n \"[\$xxxm] $c\";;
1986 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1988 echo $n \"[\$xxxm] $c\" >&4
1990 echo $n \"\$rp [\$xxxm] $c\" >&4
1996 : now set up to do reads with possible shell escape and default assignment
2002 case "\$fastread" in
2003 yes) case "\$dflt" in
2006 case "\$silent-\$rp" in
2011 *) case "\$silent" in
2012 true) case "\$rp" in
2017 while expr "X\$ans" : "X!" >/dev/null; do
2021 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2029 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2038 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2043 echo "(OK, I'll run with -d after this question.)" >&4
2046 echo "*** Sorry, \$1 not supported yet." >&4
2056 echo "*** Substitution done -- please confirm."
2058 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2063 echo "*** Error -- try again."
2070 case "\$ans\$xxxm\$nostick" in
2082 : create .config dir to save info across Configure sessions
2083 test -d ../.config || mkdir ../.config
2084 cat >../.config/README <<EOF
2085 This directory created by Configure to save information that should
2086 persist across sessions for $package.
2088 You may safely delete it if you wish.
2091 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2093 $define|true|[yY]*) ;;
2094 *) case "$xversion" in
2097 *** WHOA THERE!!! ***
2099 This is an UNSTABLE DEVELOPMENT release.
2100 The version of this $package distribution is $xversion, that is, odd,
2101 (as opposed to even) and that signifies a development release.
2102 If you want a maintenance release, you want an even-numbered version.
2104 Do ***NOT*** install this into production use.
2105 Data corruption and crashes are possible.
2107 It is most seriously suggested that you do not continue any further
2108 unless you want to help in developing and debugging Perl.
2110 If you *still* want to build perl, you can answer 'y' now,
2111 or pass -Dusedevel to Configure.
2114 rp='Do you really want to continue?'
2118 [yY]) echo >&4 "Okay, continuing."
2119 usedevel="$define" ;;
2120 *) echo >&4 "Okay, bye."
2130 case "$versiononly" in
2131 '') versiononly="$define" ;;
2133 case "$installusrbinperl" in
2134 '') installusrbinperl="$undef" ;;
2139 : general instructions
2142 user=`(logname) 2>/dev/null`
2144 '') user=`whoami 2>&1`;;
2146 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2149 rp='Would you like to see the instructions?'
2160 This installation shell script will examine your system and ask you questions
2161 to determine how the perl5 package should be installed. If you get
2162 stuck on a question, you may use a ! shell escape to start a subshell or
2163 execute a command. Many of the questions will have default answers in square
2164 brackets; typing carriage return will give you the default.
2166 On some of the questions which ask for file or directory names you are allowed
2167 to use the ~name construct to specify the login directory belonging to "name",
2168 even if you don't have a shell which knows about that. Questions where this is
2169 allowed will be marked "(~name ok)".
2173 dflt='Type carriage return to continue'
2177 The prompter used in this script allows you to use shell variables and
2178 backticks in your answers. You may use $1, $2, etc... to refer to the words
2179 in the default answer, as if the default line was a set of arguments given to a
2180 script shell. This means you may also use $* to repeat the whole default line,
2181 so you do not have to re-type everything to add something to the default.
2183 Everytime there is a substitution, you will have to confirm. If there is an
2184 error (e.g. an unmatched backtick), the default answer will remain unchanged
2185 and you will be prompted again.
2187 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2188 the questions and use the computed defaults (or the previous answers if there
2189 was already a config.sh file). Type 'Configure -h' for a list of options.
2190 You may also start interactively and then answer '& -d' at any prompt to turn
2191 on the non-interactive behaviour for the remainder of the execution.
2197 Much effort has been expended to ensure that this shell script will run on any
2198 Unix system. If despite that it blows up on yours, your best bet is to edit
2199 Configure and run it again. If you can't run Configure for some reason,
2200 you'll have to generate a config.sh file by hand. Whatever problems you
2201 have, let me (perlbug@perl.org) know how I blew it.
2203 This installation script affects things in two ways:
2205 1) it may do direct variable substitutions on some of the files included
2207 2) it builds a config.h file for inclusion in C programs. You may edit
2208 any of these files as the need arises after running this script.
2210 If you make a mistake on a question, there is no easy way to back up to it
2211 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2212 files. Configure will offer to let you do this before it runs the SH files.
2215 dflt='Type carriage return to continue'
2217 case "$firsttime" in
2218 true) echo $user >>../.config/instruct;;
2222 : find out where common programs are
2224 echo "Locating common programs..." >&4
2237 if test -d \$dir/\$thing; then
2243 for thisthing in \$dir/\$thing; do
2244 : just loop through to pick last item
2246 if test -f \$thisthing; then
2249 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2252 elif test -f \$dir/\$thing.exe; then
2253 if test -n "$DJGPP"; then
2254 echo \$dir/\$thing.exe
2255 elif test "$eunicefix" != ":"; then
2256 : on Eunice apparently
2310 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2311 pth="$pth /lib /usr/lib"
2312 for file in $loclist; do
2316 if test -f "$xxx"; then
2319 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2320 xxx=`./loc $file $file $pth`
2323 '') xxx=`./loc $file $file $pth`;;
2324 *) xxx=`./loc $xxx $xxx $pth`;;
2326 eval $file=$xxx$_exe
2330 echo $file is in $xxx.
2333 echo $file is in $xxx.
2336 echo "I don't know where '$file' is, and my life depends on it." >&4
2337 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2343 echo "Don't worry if any of the following aren't found..."
2345 for file in $trylist; do
2349 if test -f "$xxx"; then
2352 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2353 xxx=`./loc $file $file $pth`
2356 '') xxx=`./loc $file $file $pth`;;
2357 *) xxx=`./loc $xxx $xxx $pth`;;
2359 eval $file=$xxx$_exe
2363 echo $file is in $xxx.
2366 echo $file is in $xxx.
2369 echo "I don't see $file out there, $say."
2376 echo "Substituting grep for egrep."
2383 echo "Substituting cp for ln."
2392 echo "I can't find make or gmake, and my life depends on it." >&4
2393 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2401 *) # We can't have osname yet.
2402 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2403 # Assume that gmake, if found, is definitely GNU make
2404 # and prefer it over the system make.
2405 echo "Substituting gmake for make."
2413 echo "Hopefully test is built into your sh."
2416 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2417 echo "Using the test built into your sh."
2425 echo "Hopefully echo is built into your sh."
2430 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2431 $echo $n "hi there$c" >foo1
2432 echo $n "hi there$c" >foo2
2433 if cmp foo1 foo2 >/dev/null 2>&1; then
2434 echo "They are compatible. In fact, they may be identical."
2441 They are not compatible! You are probably running ksh on a non-USG system.
2442 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2443 have echo built in and we may have to run some Bourne shell scripts. That
2444 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2447 $echo $n "The star should be here-->$c"
2457 cat <<'EOSC' >>trygcc
2462 int main(int argc, char *argv[]) {
2466 if $cc -o try $ccflags $ldflags try.c; then
2469 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2475 case "`$cc -v -c try.c 2>&1`" in
2478 if $test X"$trygcc" = Xyes; then
2479 if gcc -o try -c try.c; then
2481 echo "You seem to have a working gcc, though." >&4
2482 rp="Would you like to use it?"
2484 if $test -f myread; then
2487 if $test -f UU/myread; then
2490 echo "Cannot find myread, sorry. Aborting." >&2
2495 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2496 if $test -f usethreads.cbu; then
2499 *** However, any setting of the C compiler flags (e.g. for thread support)
2500 *** has been lost. It may be necessary to pass -Dcc=gcc to Configure
2501 *** (together with e.g. -Dusethreads).
2517 cat <<'EOSC' >>checkcc
2522 int main(int argc, char *argv[]) {
2526 if $cc -o try $ccflags $ldflags try.c; then
2529 if $test X"$despair" = Xyes; then
2530 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2533 You need to find a working C compiler.
2534 Either (purchase and) install the C compiler supplied by your OS vendor,
2535 or for a free C compiler try http://gcc.gnu.org/
2536 I cannot continue any further, aborting.
2545 : determine whether symbolic links are supported
2548 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2549 echo "Symbolic links are supported." >&4
2552 echo "Symbolic links are NOT supported." >&4
2557 : determine whether symbolic links are supported
2561 echo "Checking how to test for symbolic links..." >&4
2563 if $test "X$issymlink" = X; then
2565 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2566 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2568 if test $? = 0; then
2571 echo "Your builtin 'test -h' may be broken." >&4
2574 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2577 if test -f "$p/$test"; then
2586 echo "Trying external '$test -h'." >&4
2587 issymlink="$test -h"
2588 if $test ! -h sym >/dev/null 2>&1; then
2589 echo "External '$test -h' is broken, too." >&4
2597 if $test "X$issymlink" = X; then
2598 if $test -L sym 2>/dev/null; then
2599 issymlink="$test -L"
2600 echo "The builtin '$test -L' worked." >&4
2603 if $test "X$issymlink" != X; then
2604 echo "You can test for symbolic links with '$issymlink'." >&4
2606 echo "I do not know how you can test for symbolic links." >&4
2610 *) echo "No symbolic links, so not testing for their testing..." >&4
2616 case "$mksymlinks" in
2619 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2622 *) case "$lns:$issymlink" in
2623 *"ln"*" -s:"*"test -"?)
2624 echo "Creating the symbolic links..." >&4
2625 echo "(First creating the subdirectories...)" >&4
2627 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2629 test -z "$directory" && break
2633 if test ! -d t/base; then
2634 echo "Failed to create the subdirectories. Aborting." >&4
2637 echo "(Then creating the symlinks...)" >&4
2638 awk '{print $1}' $src/MANIFEST | while true; do
2640 test -z "$filename" && break
2641 if test -f $filename; then
2642 if $issymlink $filename; then
2646 if test -f $filename; then
2647 echo "$filename already exists, not symlinking."
2649 ln -s $src/$filename $filename
2653 if test ! -f t/base/lex.t; then
2654 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2659 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2668 case "$usecrosscompile" in
2670 $echo "Cross-compiling..."
2673 *-*-gcc) # A cross-compiling gcc, probably.
2674 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2676 # leave out ld, choosing it is more complex
2678 ranlib=$targetarch-ranlib
2679 $echo 'extern int foo;' > try.c
2680 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2682 if $test $# -gt 0; then
2684 incpth="`$echo $incpth|$sed 's/^ //'`"
2685 echo "Guessing incpth '$incpth'." >&4
2687 j="`$echo $i|$sed 's,/include$,/lib,'`"
2688 if $test -d $j; then
2692 libpth="`$echo $libpth|$sed 's/^ //'`"
2693 echo "Guessing libpth '$libpth'." >&4
2698 case "$targetarch" in
2699 '') echo "Targetarch not defined." >&4; croak=y ;;
2700 *) echo "Using targetarch $targetarch." >&4 ;;
2703 '') echo "Incpth not defined." >&4; croak=y ;;
2704 *) echo "Using incpth '$incpth'." >&4 ;;
2707 '') echo "Libpth not defined." >&4; croak=y ;;
2708 *) echo "Using libpth '$libpth'." >&4 ;;
2711 '') for i in $incpth; do
2712 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2714 echo "Guessing usrinc $usrinc." >&4
2719 '') echo "Usrinc not defined." >&4; croak=y ;;
2722 *) echo "Using usrinc $usrinc." >&4 ;;
2724 case "$targethost" in
2725 '') echo "Targethost not defined." >&4; croak=y ;;
2726 *) echo "Using targethost $targethost." >&4
2731 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2734 /*) run=$src/Cross/run
2735 targetmkdir=$src/Cross/mkdir
2737 from=$src/Cross/from
2739 *) pwd=`$test -f ../Configure & cd ..; pwd`
2741 targetmkdir=$pwd/Cross/mkdir
2743 from=$pwd/Cross/from
2746 case "$targetrun" in
2747 '') targetrun=ssh ;;
2752 case "$targetfrom" in
2753 '') targetfrom=scp ;;
2757 from=$from-$targetfrom
2758 case "$targetdir" in
2760 echo "Guessing targetdir $targetdir." >&4
2763 case "$targetuser" in
2765 echo "Guessing targetuser $targetuser." >&4
2768 case "$targetfrom" in
2772 case "$targetrun" in
2784 '') cwd=$targetdir ;;
2788 if $test ! -f \$exe.xok; then
2792 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2795 *) echo "Unknown targetrun '$targetrun'" >&4
2799 case "$targetmkdir" in
2801 cat >$targetmkdir <<EOF
2803 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2805 $chmod a+rx $targetmkdir
2807 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2819 $targetmkdir \`dirname \$f\`
2820 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2823 $targetmkdir $targetdir/\`dirname \$f\`
2824 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2837 $mkdir -p $targetdir/\`dirname \$f\`
2838 $cp \$f $targetdir/\$f || exit 1
2841 $targetmkdir $targetdir/\`dirname \$f\`
2842 $cp \$f $targetdir/\$f || exit 1
2849 *) echo "Unknown targetto '$targetto'" >&4
2853 case "$targetfrom" in
2860 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2865 cp) cat >$from <<EOF
2870 cp $targetdir/\$f . || exit 1
2875 *) echo "Unknown targetfrom '$targetfrom'" >&4
2879 if $test ! -f $run; then
2880 echo "Target 'run' script '$run' not found." >&4
2884 if $test ! -f $to; then
2885 echo "Target 'to' script '$to' not found." >&4
2889 if $test ! -f $from; then
2890 echo "Target 'from' script '$from' not found." >&4
2894 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2898 Using '$run' for remote execution,
2899 and '$from' and '$to'
2900 for remote file transfer.
2906 usecrosscompile='undef'
2911 : see whether [:lower:] and [:upper:] are supported character classes
2913 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2915 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2919 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
2920 # (0xd9 and 0xe2), therefore that is a nice testing point.
2921 if test "X$up" = X -o "X$low" = X; then
2922 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
2928 if test "X$up" = X -o "X$low" = X; then
2929 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
2935 if test "X$up" = X -o "X$low" = X; then
2936 case "`echo RS | od -x 2>/dev/null`" in
2938 echo "Hey, this might be EBCDIC." >&4
2939 if test "X$up" = X -o "X$low" = X; then
2940 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2941 rs) up='[A-IJ-RS-Z]'
2946 if test "X$up" = X -o "X$low" = X; then
2947 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2957 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
2959 echo "Using $up and $low to convert case." >&4
2962 echo "I don't know how to translate letters from upper to lower case." >&4
2963 echo "Your tr is not acting any way I know of." >&4
2967 : set up the translation script tr, must be called with ./tr of course
2971 '[A-Z][a-z]') exec $tr '$up' '$low';;
2972 '[a-z][A-Z]') exec $tr '$low' '$up';;
2979 : Try to determine whether config.sh was made on this system
2980 case "$config_sh" in
2982 myuname=`$uname -a 2>/dev/null`
2983 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2984 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2985 # because the A-Z/a-z are not consecutive.
2986 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2987 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2988 newmyuname="$myuname"
2990 case "$knowitall" in
2992 if test -f ../config.sh; then
2993 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2994 eval "`grep myuname= ../config.sh`"
2996 if test "X$myuname" = "X$newmyuname"; then
3004 : Get old answers from old config file if Configure was run on the
3005 : same system, otherwise use the hints.
3008 if test -f config.sh; then
3010 rp="I see a config.sh file. Shall I use it to set the defaults?"
3013 n*|N*) echo "OK, I'll ignore it."
3014 mv config.sh config.sh.old
3015 myuname="$newmyuname"
3017 *) echo "Fetching default answers from your old config.sh file..." >&4
3025 : Older versions did not always set $sh. Catch re-use of such
3035 if test ! -f config.sh; then
3038 First time through, eh? I have some defaults handy for some systems
3039 that need some extra help getting the Configure answers right:
3042 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3044 : Half the following guesses are probably wrong... If you have better
3045 : tests or hints, please send them to perlbug@perl.org
3046 : The metaconfig authors would also appreciate a copy...
3047 $test -f /irix && osname=irix
3048 $test -f /xenix && osname=sco_xenix
3049 $test -f /dynix && osname=dynix
3050 $test -f /dnix && osname=dnix
3051 $test -f /lynx.os && osname=lynxos
3052 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3053 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3054 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3055 $test -f /bin/mips && /bin/mips && osname=mips
3056 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3057 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3058 $test -d /usr/apollo/bin && osname=apollo
3059 $test -f /etc/saf/_sactab && osname=svr4
3060 $test -d /usr/include/minix && osname=minix
3061 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3062 if $test -d /MachTen -o -d /MachTen_Folder; then
3064 if $test -x /sbin/version; then
3065 osvers=`/sbin/version | $awk '{print $2}' |
3066 $sed -e 's/[A-Za-z]$//'`
3067 elif $test -x /usr/etc/version; then
3068 osvers=`/usr/etc/version | $awk '{print $2}' |
3069 $sed -e 's/[A-Za-z]$//'`
3075 $test -f /sys/posix.dll &&
3076 $test -f /usr/bin/what &&
3077 set X `/usr/bin/what /sys/posix.dll` &&
3078 $test "$3" = UWIN &&
3082 if $test -f $uname; then
3090 umips) osname=umips ;;
3093 [23]100) osname=mips ;;
3094 next*) osname=next ;;
3096 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3097 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3100 elif $test -f /etc/kconfig; then
3102 if test "$lns" = "$ln -s"; then
3104 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3106 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3113 if test -n "$DJGPP"; then
3122 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3124 # oslevel can fail with:
3125 # oslevel: Unable to acquire lock.
3126 *not\ found) osvers="$4"."$3" ;;
3127 '<3240'|'<>3240') osvers=3.2.0 ;;
3128 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3129 '=3250'|'>3250') osvers=3.2.5 ;;
3133 bsd386) osname=bsd386
3136 cygwin*) osname=cygwin
3139 *dc.osx) osname=dcosx
3145 domainos) osname=apollo
3151 dragonfly) osname=dragonfly
3154 dynixptx*) osname=dynixptx
3155 osvers=`echo "$4"|sed 's/^v//'`
3157 freebsd) osname=freebsd
3159 genix) osname=genix ;;
3163 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3179 netbsd*) osname=netbsd
3182 news-os) osvers="$3"
3184 4*) osname=newsos4 ;;
3188 next*) osname=next ;;
3189 nonstop-ux) osname=nonstopux ;;
3190 openbsd) osname=openbsd
3196 POSIX-BC | posix-bc ) osname=posix-bc
3199 powerux | power_ux | powermax_os | powermaxos | \
3200 powerunix | power_unix) osname=powerux
3206 solaris) osname=solaris
3208 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3215 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3219 titanos) osname=titanos
3228 ultrix) osname=ultrix
3231 osf1|mls+) case "$5" in
3234 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3237 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3240 hp*) osname=hp_osf1 ;;
3241 mips) osname=mips_osf1 ;;
3244 # UnixWare 7.1.2 is known as Open UNIX 8
3245 openunix|unixware) osname=svr5
3253 $2) case "$osname" in
3257 : svr4.x or possibly later
3267 if test -f /stand/boot ; then
3268 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3269 if test -n "$INITPROG" -a -f "$INITPROG"; then
3270 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3271 if test -n "$isesix"; then
3279 *) if test -f /etc/systemid; then
3281 set `echo $3 | $sed 's/\./ /g'` $4
3282 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3284 elif $test -f $src/hints/sco_$1_$2.sh; then
3286 elif $test -f $src/hints/sco_$1.sh; then
3291 '') : Still unknown. Probably a generic Sys V.
3300 *) case "$osname" in
3301 '') : Still unknown. Probably a generic BSD.
3309 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3310 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3311 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3314 $rm -f UU/kernel.what
3315 elif test -d c:/. -o -n "$is_os2" ; then
3322 case "$targetarch" in
3325 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3330 : Now look for a hint file osname_osvers, unless one has been
3331 : specified already.
3334 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3335 : Also try without trailing minor version numbers.
3336 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3337 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3338 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3339 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3342 *) case "$osvers" in
3345 *) if $test -f $src/hints/$file.sh ; then
3347 elif $test -f $src/hints/$xfile.sh ; then
3349 elif $test -f $src/hints/$xxfile.sh ; then
3351 elif $test -f $src/hints/$xxxfile.sh ; then
3353 elif $test -f $src/hints/$xxxxfile.sh ; then
3355 elif $test -f "$src/hints/${osname}.sh" ; then
3364 if $test -f Policy.sh ; then
3367 none) dflt="Policy" ;;
3368 *) dflt="Policy $dflt" ;;
3373 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3377 if $test -f Policy.sh ; then
3380 There's also a Policy hint file available, which should make the
3381 site-specific (policy) questions easier to answer.
3388 You may give one or more space-separated answers, or "none" if appropriate.
3389 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3390 previous run of Configure, you may specify it as well as or instead of
3391 OS-specific hints. If hints are provided for your OS, you should use them:
3392 although Perl can probably be built without hints on many platforms, using
3393 hints often improve performance and may enable features that Configure can't
3394 set up on its own. If there are no hints that match your OS, specify "none";
3395 DO NOT give a wrong version or a wrong OS.
3399 rp="Which of these apply, if any?"
3402 for file in $tans; do
3403 if $test X$file = XPolicy -a -f Policy.sh; then
3405 $cat Policy.sh >> UU/config.sh
3406 elif $test -f $src/hints/$file.sh; then
3407 . $src/hints/$file.sh
3408 $cat $src/hints/$file.sh >> UU/config.sh
3409 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3412 : Give one chance to correct a possible typo.
3413 echo "$file.sh does not exist"
3415 rp="hint to use instead?"
3417 for file in $ans; do
3418 if $test -f "$src/hints/$file.sh"; then
3419 . $src/hints/$file.sh
3420 $cat $src/hints/$file.sh >> UU/config.sh
3421 elif $test X$ans = X -o X$ans = Xnone ; then
3424 echo "$file.sh does not exist -- ignored."
3431 : Remember our hint file for later.
3432 if $test -f "$src/hints/$file.sh" ; then
3442 echo "Fetching default answers from $config_sh..." >&4
3446 cp $config_sh config.sh 2>/dev/null
3456 test "$override" && . ./optdef.sh
3458 : Restore computed paths
3459 for file in $loclist $trylist; do
3460 eval $file="\$_$file"
3465 Configure uses the operating system name and version to set some defaults.
3466 The default value is probably right if the name rings a bell. Otherwise,
3467 since spelling matters for me, either accept the default or answer "none"
3474 ''|' '|none) dflt=none ;;
3475 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3478 *) dflt="$osname" ;;
3480 rp="Operating system name?"
3484 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3490 ''|' '|none) dflt=none ;;
3491 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3492 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3494 ''|' ') dflt=none ;;
3499 *) dflt="$osvers" ;;
3501 rp="Operating system version?"
3511 : who configured the system
3512 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3515 cf_by=`(logname) 2>/dev/null`
3518 cf_by=`(whoami) 2>/dev/null`
3520 "") cf_by=unknown ;;
3525 : decide how portable to be. Allow command line overrides.
3526 case "$d_portable" in
3528 *) d_portable="$define" ;;
3531 : set up shell script to do ~ expansion
3537 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3540 if $test -f /bin/csh; then
3541 /bin/csh -f -c "glob \$1"
3546 name=\`$expr x\$1 : '..\([^/]*\)'\`
3547 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3548 if $test ! -d "\$dir"; then
3550 echo "\$me: can't locate home directory for: \$name" >&2
3555 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3571 : now set up to get a file name
3575 cat <<'EOSC' >>getfile
3591 : getfile will accept an answer from the comma-separated list
3592 : enclosed in parentheses even if it does not meet other criteria.
3593 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3594 fn=`echo $fn | sed 's/(.*)//'`
3600 loc_file=`expr $fn : '.*:\(.*\)'`
3601 fn=`expr $fn : '\(.*\):.*'`
3609 */*) fullpath=true;;
3618 *e*) exp_file=true;;
3621 *p*) nopath_ok=true;;
3626 *d*) type='Directory';;
3627 *l*) type='Locate';;
3632 Locate) what='File';;
3637 case "$d_portable" in
3645 while test "$type"; do
3650 true) rp="$rp (~name ok)";;
3653 if test -f UU/getfile.ok && \
3654 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3673 value=`UU/filexp $ans`
3676 if test "$ans" != "$value"; then
3677 echo "(That expands to $value on this system.)"
3691 /*) value="$ansexp" ;;
3692 [a-zA-Z]:/*) value="$ansexp" ;;
3697 echo "I shall only accept a full path name, as in /bin/ls." >&4
3698 echo "Use a ! shell escape if you wish to check pathnames." >&4
3701 echo "Please give a full path name, starting with slash." >&4
3704 echo "Note that using ~name is ok provided it expands well." >&4
3717 for fp in $gfpth; do
3718 if test "X$fp" = X.; then
3723 if test -f "$pf"; then
3725 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3727 echo "($value is not a plain file, but that's ok.)"
3730 if test X"$type" = X; then
3737 for fp in $gfpth; do
3738 if test "X$fp" = X.; then
3743 direxp="$fp/$ansexp"
3745 if test -d "$direxp"; then
3753 if test -d "$ansexp"; then
3754 echo "(Looking for $loc_file in directory $value.)"
3755 value="$value/$loc_file"
3756 ansexp="$ansexp/$loc_file"
3758 if test -f "$ansexp"; then
3761 case "$nopath_ok" in
3762 true) case "$value" in
3764 *) echo "Assuming $value will be in people's path."
3780 if test "$fastread" = yes; then
3785 rp="$what $value doesn't exist. Use that name anyway?"
3804 test "X$gfpthkeep" != Xy && gfpth=""
3807 : determine root of directory hierarchy where package will be installed.
3810 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3813 dflt=`echo "$prefix" | sed 's/.$//'`
3821 By default, $package will be installed in $dflt/bin, manual pages
3822 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3823 installation directories. Typically this is something like /usr/local.
3824 If you wish to have binaries under /usr/bin but other parts of the
3825 installation under /usr/local, that's ok: you will be prompted
3826 separately for each of the installation directories, the prefix being
3827 only used to set the defaults.
3831 rp='Installation prefix to use?'
3839 *) oldprefix="$prefix";;
3848 *) afsroot=$afsroot ;;
3854 $define|true) afs=true ;;
3855 $undef|false) afs=false ;;
3856 *) if test -d $afsroot; then
3864 echo "AFS may be running... I'll be extra cautious then..." >&4
3866 echo "AFS does not seem to be running..." >&4
3869 : determine installation prefix for where package is to be installed.
3873 Since you are running AFS, I need to distinguish the directory in which
3874 files will reside from the directory in which they are installed (and from
3875 which they are presumably copied to the former directory by occult means).
3878 case "$installprefix" in
3879 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
3880 *) dflt="$installprefix";;
3885 In some special cases, particularly when building $package for distribution,
3886 it is convenient to distinguish the directory in which files should be
3887 installed from the directory ($prefix) in which they will
3888 eventually reside. For most users, these two directories are the same.
3891 case "$installprefix" in
3893 *) dflt=$installprefix;;
3897 rp='What installation prefix should I use for installing files?'
3899 installprefix="$ans"
3900 installprefixexp="$ansexp"
3902 : Perform the prefixexp/installprefixexp correction if necessary
3903 cat <<EOS >installprefix
3906 cat <<'EOSC' >>installprefix
3907 : Change installation prefix, if necessary.
3908 if $test X"$prefix" != X"$installprefix"; then
3909 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
3911 eval "install${prefixvar}=\"\$${prefixvar}exp\""
3914 chmod +x installprefix
3915 $eunicefix installprefix
3917 : Set variables such as privlib and privlibexp from the output of ./getfile
3918 : performing the prefixexp/installprefixexp correction if necessary.
3919 cat <<EOS >setprefixvar
3922 cat <<'EOSC' >>setprefixvar
3923 eval "${prefixvar}=\"\$ans\""
3924 eval "${prefixvar}exp=\"\$ansexp\""
3927 chmod +x setprefixvar
3928 $eunicefix setprefixvar
3930 : set up the script used to warn in case of inconsistency
3937 echo "*** WHOA THERE!!! ***" >&4
3938 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
3939 rp=" Keep the $hint value?"
3942 y) td=$was; tu=$was;;
3946 : function used to set $1 to $val
3947 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
3949 $define$undef) . ./whoa; eval "$var=\$td";;
3950 $undef$define) . ./whoa; eval "$var=\$tu";;
3951 *) eval "$var=$val";;
3955 $define|true|[yY]*) dflt='y';;
3960 Perl can be built to use the SOCKS proxy protocol library. To do so,
3961 Configure must be run with -Dusesocks. If you use SOCKS you also need
3962 to use the PerlIO abstraction layer, this will be implicitly selected.
3964 If this doesn't make any sense to you, just accept the default '$dflt'.
3966 rp='Build Perl for SOCKS?'
3969 y|Y) val="$define" ;;
3976 $define|true|[yY]*) useperlio="$define";;
3979 case "$useperlio" in
3980 $define|true|[yY]*|'') dflt='y';;
3985 Previous version of $package used the standard IO mechanisms as
3986 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
3987 alternate IO mechanisms via the PerlIO abstraction layer, but the
3988 stdio mechanism is still available if needed. The abstraction layer
3989 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
3990 Using PerlIO with sfio may cause problems with some extension modules.
3992 If this doesn't make any sense to you, just accept the default '$dflt'.
3994 rp='Use the PerlIO abstraction layer?'
4001 echo "Ok, doing things the stdio way."
4010 case "$useperlio" in
4011 $define|true|[yY]*) ;;
4014 You are using the SOCKS proxy protocol library which means that you
4015 should also use the PerlIO layer. You may be headed for trouble.
4024 case "$usethreads" in
4025 $define|true|[yY]*) dflt='y';;
4026 *) # Catch case where user specified ithreads or 5005threads but
4027 # forgot -Dusethreads (A.D. 4/2002)
4028 case "$useithreads$use5005threads" in
4030 case "$useperlio" in
4031 "$define") dflt='y' ;;
4041 Perl can be built to take advantage of threads on some systems.
4042 To do so, Configure can be run with -Dusethreads.
4044 Note that Perl built with threading support runs slightly slower
4045 and uses more memory than plain Perl. The current implementation
4046 is believed to be stable, but it is fairly new, and so should be
4047 treated with caution.
4049 If this doesn't make any sense to you, just accept the default '$dflt'.
4051 rp='Build a threading Perl?'
4054 y|Y) val="$define" ;;
4060 case "$usethreads" in
4064 Since release 5.6, Perl has had two different threading implementations,
4065 the newer interpreter-based version (ithreads) with one interpreter per
4066 thread, and the older 5.005 version (5005threads).
4067 The 5005threads version is effectively unmaintained and will probably be
4068 removed in Perl 5.10, so there should be no need to build a Perl using it
4069 unless needed for backwards compatibility with some existing 5.005threads
4073 : Default to ithreads unless overridden on command line or with
4076 case "$use5005threads" in
4077 $define|true|[yY]*) dflt='n';;
4079 case "$useithreads" in
4080 $undef|false|[nN]*) dflt='n';;
4082 rp='Use the newer interpreter-based ithreads?'
4085 y|Y) val="$define" ;;
4090 : Now set use5005threads to the opposite value.
4091 case "$useithreads" in
4092 $define) val="$undef" ;;
4099 useithreads="$undef"
4100 use5005threads="$undef"
4104 case "$useithreads$use5005threads" in
4108 You cannot have both the ithreads and the 5.005 threads enabled
4109 at the same time. Disabling the 5.005 threads since they are
4110 much less stable than the ithreads.
4113 use5005threads="$undef"
4117 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
4120 *** To build with ithreads you must also use the PerlIO layer.
4121 *** Cannot continue, aborting.
4127 case "$d_oldpthreads" in
4128 '') : Configure tests would be welcome here. For now, assume undef.
4130 *) val="$d_oldpthreads" ;;
4136 : Look for a hint-file generated 'call-back-unit'. If the
4137 : user has specified that a threading perl is to be built,
4138 : we may need to set or change some other defaults.
4139 if $test -f usethreads.cbu; then
4140 echo "Your platform has some specific hints regarding threaded builds, using them..."
4143 case "$usethreads" in
4144 "$define"|true|[yY]*)
4146 (Your platform does not have any specific hints for threaded builds.
4147 Assuming POSIX threads, then.)
4155 Perl can be built so that multiple Perl interpreters can coexist
4156 within the same Perl executable.
4159 case "$useithreads" in
4162 This multiple interpreter support is required for interpreter-based threads.
4166 *) case "$usemultiplicity" in
4167 $define|true|[yY]*) dflt='y';;
4171 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4172 rp='Build Perl for multiplicity?'
4175 y|Y) val="$define" ;;
4184 case "$usemorebits" in
4185 "$define"|true|[yY]*)
4186 use64bitint="$define"
4187 uselongdouble="$define"
4188 usemorebits="$define"
4190 *) usemorebits="$undef"
4194 : make some quick guesses about what we are up against
4196 $echo $n "Hmm... $c"
4206 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
4207 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
4209 echo "Looks kind of like an OSF/1 system, but we'll see..."
4211 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4212 xxx=`./loc addbib blurfl $pth`
4213 if $test -f $xxx; then
4214 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4218 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4219 echo "Looks kind of like an extended USG system, but we'll see..."
4221 echo "Looks kind of like a USG system, but we'll see..."
4225 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4226 echo "Looks kind of like a BSD system, but we'll see..."
4230 echo "Looks kind of like a Version 7 system, but we'll see..."
4233 case "$eunicefix" in
4236 There is, however, a strange, musty smell in the air that reminds me of
4237 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4241 : it so happens the Eunice I know will not run shell scripts in Unix format
4245 echo "Congratulations. You aren't running Eunice."
4249 : Detect OS2. The p_ variable is set above in the Head.U unit.
4250 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4251 : semicolon as a patch separator
4256 I have the feeling something is not exactly right, however...don't tell me...
4257 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4258 (Or you may be running DOS with DJGPP.)
4263 if test -f /xenix; then
4264 echo "Actually, this looks more like a XENIX system..."
4269 echo "It's not Xenix..."
4274 if test -f /venix; then
4275 echo "Actually, this looks more like a VENIX system..."
4282 echo "Nor is it Venix..."
4285 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4286 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4293 rp="Use which C compiler?"
4297 : See if they have not cc but they do have gcc
4299 : Look for a hint-file generated 'call-back-unit'. Now that the
4300 : user has specified the compiler, we may need to set or change some
4302 if $test -f cc.cbu; then
4308 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4312 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4314 printf("%s\n", __VERSION__);
4316 printf("%s\n", "1");
4322 if $cc -o try $ccflags $ldflags try.c; then
4323 gccversion=`$run ./try`
4324 case "$gccversion" in
4325 '') echo "You are not using GNU cc." ;;
4326 *) echo "You are using GNU cc $gccversion."
4332 echo "*** WHOA THERE!!! ***" >&4
4333 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4334 case "$knowitall" in
4336 echo " You'd better start hunting for one and let me know about it." >&4
4342 case "$gccversion" in
4343 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4345 case "$gccversion" in
4346 '') gccosandvers='' ;;
4347 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4348 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4350 case "$gccosandvers" in
4351 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4352 $osname$osvers) ;; # looking good
4353 $osname*) cat <<EOM >&4
4355 *** WHOA THERE!!! ***
4357 Your gcc has not been compiled for the exact release of
4358 your operating system ($gccosandvers versus $osname$osvers).
4360 In general it is a good idea to keep gcc synchronized with
4361 the operating system because otherwise serious problems
4362 may ensue when trying to compile software, like Perl.
4364 I'm trying to be optimistic here, though, and will continue.
4365 If later during the configuration and build icky compilation
4366 problems appear (headerfile conflicts being the most common
4367 manifestation), I suggest reinstalling the gcc to match
4368 your operating system release.
4372 *) gccosandvers='' ;; # failed to parse, better be silent
4380 # gcc 3.* complain about adding -Idirectories that they already know about,
4381 # so we will take those off from locincpth.
4382 case "$gccversion" in
4384 echo "main(){}">try.c
4385 for incdir in $locincpth; do
4386 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4387 grep '^c[cp]p*[01]: warning: changing search order '`
4388 if test "X$warn" != X; then
4389 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4395 : What should the include directory be ?
4397 $echo $n "Hmm... $c"
4401 if $test -f /bin/mips && /bin/mips; then
4402 echo "Looks like a MIPS system..."
4403 $cat >usr.c <<'EOCP'
4404 #ifdef SYSTYPE_BSD43
4408 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4409 dflt='/bsd43/usr/include'
4413 mips_type='System V'
4415 $rm -f usr.c usr.out
4416 echo "and you're compiling with the $mips_type compiler and libraries."
4420 echo "Doesn't look like a MIPS system."
4430 case "$xxx_prompt" in
4433 rp='Where are the include files you want to use?'
4441 : see how we invoke the C preprocessor
4443 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4444 cat <<'EOT' >testcpp.c
4450 if test ! -f cppstdin; then
4451 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4452 # AIX cc -E doesn't show the absolute headerfile
4453 # locations but we'll cheat by using the -M flag.
4454 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
4456 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4459 echo "Keeping your $hint cppstdin wrapper."
4462 wrapper=`pwd`/cppstdin
4466 if $test "X$cppstdin" != "X" && \
4467 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4468 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4470 echo "You used to use $cppstdin $cppminus so we'll use that again."
4472 '') echo "But let's see if we can live without a wrapper..." ;;
4474 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4475 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4477 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4480 echo "(However, $cpprun $cpplast does not work, let's see...)"
4488 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4495 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4496 $cc -E <testcpp.c >testcpp.out 2>&1; \
4497 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4498 echo "Yup, it does."
4501 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4502 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4503 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4504 echo "Yup, it does."
4507 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4508 $cc -P <testcpp.c >testcpp.out 2>&1; \
4509 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4510 echo "Yipee, that works!"
4513 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4514 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4515 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4516 echo "At long last!"
4519 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4520 $cpp <testcpp.c >testcpp.out 2>&1; \
4521 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4525 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4526 $cpp - <testcpp.c >testcpp.out 2>&1; \
4527 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4528 echo "Hooray, it works! I was beginning to wonder."
4531 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4532 $wrapper <testcpp.c >testcpp.out 2>&1; \
4533 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4539 rp="No dice. I can't find a C preprocessor. Name one:"
4543 $x_cpp <testcpp.c >testcpp.out 2>&1
4544 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4545 echo "OK, that will do." >&4
4547 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4562 echo "Perhaps can we force $cc -E using a wrapper..."
4563 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4564 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4570 echo "Nope, we'll have to live without it..."
4584 "$wrapper"|'cppstdin') ;;
4585 *) $rm -f $wrapper;;
4587 $rm -f testcpp.c testcpp.out
4589 : Set private lib path
4592 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4597 '') dlist="$loclibpth $plibpth $glibpth";;
4598 *) dlist="$libpth";;
4601 : Now check and see which directories actually exist, avoiding duplicates
4605 if $test -d $xxx; then
4608 *) libpth="$libpth $xxx";;
4614 Some systems have incompatible or broken versions of libraries. Among
4615 the directories listed in the question below, please remove any you
4616 know not to be holding relevant libraries, and add any that are needed.
4617 Say "none" for none.
4628 rp="Directories to use for library searches?"
4635 : compute shared library extension
4638 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4648 On some systems, shared libraries may be available. Answer 'none' if
4649 you want to suppress searching of shared libraries for the remainder
4650 of this configuration.
4653 rp='What is the file extension used for shared libraries?'
4657 : Define several unixisms.
4658 : Hints files or command line option can be used to override them.
4659 : The convoluted testing is in case hints files set either the old
4662 '') case "$exe_ext" in
4664 *) _exe="$exe_ext" ;;
4669 '') case "$lib_ext" in
4676 '') case "$obj_ext" in
4683 '') case "$path_sep" in
4694 : Which makefile gets called first. This is used by make depend.
4695 case "$firstmakefile" in
4696 '') firstmakefile='makefile';;
4700 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4703 case "$uselongdouble" in
4704 $define|true|[yY]*) dflt='y';;
4709 Perl can be built to take advantage of long doubles which
4710 (if available) may give more accuracy and range for floating point numbers.
4712 If this doesn't make any sense to you, just accept the default '$dflt'.
4714 rp='Try to use long doubles if available?'
4717 y|Y) val="$define" ;;
4723 case "$uselongdouble" in
4724 true|[yY]*) uselongdouble="$define" ;;
4727 : Look for a hint-file generated 'call-back-unit'. If the
4728 : user has specified that long doubles should be used,
4729 : we may need to set or change some other defaults.
4730 if $test -f uselongdouble.cbu; then
4731 echo "Your platform has some specific hints regarding long doubles, using them..."
4732 . ./uselongdouble.cbu
4734 case "$uselongdouble" in
4737 (Your platform does not have any specific hints for long doubles.)
4743 : Looking for optional libraries
4745 echo "Checking for optional libraries..." >&4
4750 case "$libswanted" in
4751 '') libswanted='c_s';;
4754 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4760 for thisdir in $libpth $xlibpth; do
4761 test -d $thisdir && libspath="$libspath $thisdir"
4763 for thislib in $libswanted; do
4764 for thisdir in $libspath; do
4766 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4767 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4768 $test -f "$xxx" && eval $libscheck
4769 $test -f "$xxx" && libstyle=shared
4771 if test ! -f "$xxx"; then
4772 xxx=$thisdir/lib$thislib.$so
4773 $test -f "$xxx" && eval $libscheck
4774 $test -f "$xxx" && libstyle=shared
4776 if test ! -f "$xxx"; then
4777 xxx=$thisdir/lib$thislib$_a
4778 $test -f "$xxx" && eval $libscheck
4779 $test -f "$xxx" && libstyle=static
4781 if test ! -f "$xxx"; then
4782 xxx=$thisdir/$thislib$_a
4783 $test -f "$xxx" && eval $libscheck
4784 $test -f "$xxx" && libstyle=static
4786 if test ! -f "$xxx"; then
4787 xxx=$thisdir/lib${thislib}_s$_a
4788 $test -f "$xxx" && eval $libscheck
4789 $test -f "$xxx" && libstyle=static
4790 $test -f "$xxx" && thislib=${thislib}_s
4792 if test ! -f "$xxx"; then
4793 xxx=$thisdir/Slib$thislib$_a
4794 $test -f "$xxx" && eval $libscheck
4795 $test -f "$xxx" && libstyle=static
4797 if $test -f "$xxx"; then
4799 shared) echo "Found -l$thislib (shared)." ;;
4800 static) echo "Found -l$thislib." ;;
4801 *) echo "Found -l$thislib ($libstyle)." ;;
4805 *) dflt="$dflt -l$thislib"
4806 libsfound="$libsfound $xxx"
4808 libsfiles="$libsfiles $yyy"
4809 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4810 case " $libsdirs " in
4812 *) libsdirs="$libsdirs $yyy" ;;
4819 if $test ! -f "$xxx"; then
4820 echo "No -l$thislib."
4831 ' '|'') dflt='none';;
4836 In order to compile $package on your machine, a number of libraries
4837 are usually needed. Include any other special libraries here as well.
4838 Say "none" for none. The default list is almost always right.
4842 rp="What libraries to use?"
4849 : determine optimization, if desired, or use for debug flag also
4851 ' '|$undef) dflt='none';;
4853 *) dflt="$optimize";;
4857 By default, $package compiles with the -O flag to use the optimizer.
4858 Alternately, you might want to use the symbolic debugger, which uses
4859 the -g flag (on traditional Unix systems). Either flag can be
4860 specified here. To use neither flag, specify the word "none".
4863 rp="What optimizer/debugger flag should be used?"
4867 'none') optimize=" ";;
4870 : Check what DEBUGGING is required from the command line
4871 : -DEBUGGING or -DDEBUGGING or
4872 : -DEBUGGING=both = -g + -DDEBUGGING
4873 : -DEBUGGING=-g or -Doptimize=-g = -g
4874 : -DEBUGGING=none or -UDEBUGGING =
4875 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
4878 *) DEBUGGING=$EBUGGING ;;
4881 case "$DEBUGGING" in
4885 *) optimize="$optimize -g" ;;
4889 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
4897 case "$DEBUGGING" in
4898 both|$define) dflt='-DDEBUGGING'
4901 : We will not override a previous value, but we might want to
4902 : augment a hint file
4904 default|recommended)
4905 case "$gccversion" in
4906 1*) dflt="$dflt -fpcc-struct-return" ;;
4908 case "$optimize:$DEBUGGING" in
4909 *-g*:old) dflt="$dflt -DDEBUGGING";;
4911 case "$gccversion" in
4912 2*) if test -d /etc/conf/kconfig.d &&
4913 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4915 # Interactive Systems (ISC) POSIX mode.
4920 case "$gccversion" in
4924 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
4925 echo 'int main(void) { return 0; }' > gcctest.c
4926 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
4927 echo "Yes, it does." 2>&1
4930 echo "Leaving current flags $ccflags alone." 2>&1
4932 *) dflt="$dflt -fno-strict-aliasing" ;;
4935 echo "Nope, it doesn't, but that's ok." 2>&1
4939 # For gcc, adding -pipe speeds up compilations for some, but apparently
4940 # some assemblers can't read from stdin. (It also slows down compilations
4941 # in other cases, but those are apparently rarer these days.) AD 5/2004.
4942 case "$gccversion" in
4944 echo "Checking if your compiler accepts -pipe" 2>&1
4945 echo 'int main(void) { return 0; }' > gcctest.c
4946 if $cc -pipe -o gcctest gcctest.c; then
4947 echo "Yes, it does." 2>&1
4950 echo "Leaving current flags $ccflags alone." 2>&1
4952 *) dflt="$dflt -pipe" ;;
4955 echo "Nope, it doesn't, but that's ok." 2>&1
4962 case "$mips_type" in
4963 *BSD*|'') inclwanted="$locincpth $usrinc";;
4964 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4966 for thisincl in $inclwanted; do
4967 if $test -d $thisincl; then
4968 if $test x$thisincl != x$usrinc; then
4970 *" -I$thisincl "*);;
4971 *) dflt="$dflt -I$thisincl ";;
4977 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4979 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4987 *) dflt="$dflt -D$2";;
4991 set signal.h LANGUAGE_C; eval $inctest
4995 ccflags="$ccflags -DSOCKS"
5000 default|recommended) dflt="$ccflags $dflt" ;;
5001 *) dflt="$ccflags";;
5010 Your C compiler may want other flags. For this question you should include
5011 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5012 but you should NOT include libraries or ld flags like -lwhatever. If you
5013 want $package to honor its debug switch, you should include -DDEBUGGING here.
5014 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5016 To use no flags, specify the word "none".
5022 rp="Any additional cc flags?"
5029 : the following weeds options from ccflags that are of no interest to cpp
5031 '') cppflags="$ccflags" ;;
5032 *) cppflags="$cppflags $ccflags" ;;
5034 case "$gccversion" in
5035 1*) cppflags="$cppflags -D__GNUC__"
5037 case "$mips_type" in
5039 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5045 echo "Let me guess what the preprocessor flags are..." >&4
5059 *) ftry="$previous $flag";;
5061 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5062 >cpp1.out 2>/dev/null && \
5063 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5064 >cpp2.out 2>/dev/null && \
5065 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5066 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5068 cppflags="$cppflags $ftry"
5078 *-*) echo "They appear to be: $cppflags";;
5080 $rm -f cpp.c cpp?.out
5084 : flags used in final linking phase
5086 '') if ./venix; then
5092 *-posix*) dflt="$dflt -posix" ;;
5095 *) dflt="$ldflags";;
5098 : Try to guess additional flags to pick up local libraries.
5099 for thislibdir in $libpth; do
5100 case " $loclibpth " in
5103 *"-L$thislibdir "*) ;;
5104 *) dflt="$dflt -L$thislibdir" ;;
5116 Your C linker may need flags. For this question you should
5117 include -L/whatever and any other flags used by the C linker, but you
5118 should NOT include libraries like -lwhatever.
5120 Make sure you include the appropriate -L/path flags if your C linker
5121 does not normally search all of the directories you specified above,
5124 To use no flags, specify the word "none".
5128 rp="Any additional ld flags (NOT including libraries)?"
5134 rmlist="$rmlist pdp11"
5138 echo "Checking your choice of C compiler and flags for coherency..." >&4
5139 $cat > try.c <<'EOF'
5141 int main() { printf("Ok\n"); return(0); }
5143 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5145 $cat >try.msg <<'EOM'
5146 I've tried to compile and run the following simple program:
5149 $cat try.c >> try.msg
5151 $cat >> try.msg <<EOM
5158 and I got the following output:
5162 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5163 if $sh -c "$run ./try" >>try.msg 2>&1; then
5167 *) echo 'The program compiled OK, but produced no output.' >> try.msg
5170 cat >> try.msg <<'EOQS'
5171 If $libs contains -lsfio, and sfio is mis-configured, then it
5172 sometimes (apparently) runs and exits with a 0 status, but with no
5173 output! It may have to do with sfio's use of _exit vs. exit.
5176 rp="You have a big problem. Shall I abort Configure"
5183 echo "The program compiled OK, but exited with status $?." >>try.msg
5184 rp="You have a problem. Shall I abort Configure"
5188 echo "I can't compile the test program." >>try.msg
5189 rp="You have a BIG problem. Shall I abort Configure"
5195 case "$knowitall" in
5197 echo "(The supplied flags or libraries might be incorrect.)"
5205 *) echo "Ok. Stopping Configure." >&4
5210 n) echo "OK, that should do.";;
5212 $rm -f try try.* core
5214 : define a shorthand compile call
5218 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5219 : define a shorthand compile call for compilations that should be ok.
5223 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5225 : determine filename position in cpp output
5227 echo "Computing filename position in cpp output for #include directives..." >&4
5229 vos) testaccess=-e ;;
5232 echo '#include <stdio.h>' > foo.c
5235 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5236 $grep '^[ ]*#.*stdio\.h' | \
5237 while read cline; do
5240 while $test \$# -gt 0; do
5241 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5246 pos=\`expr \$pos + 1\`
5258 *) pos="${fieldn}th";;
5260 echo "Your cpp writes the filename in the $pos field of the line."
5263 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5264 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5267 : locate header file
5272 for usrincdir in $usrinc
5274 if test -f \$usrincdir/\$wanted; then
5275 echo "\$usrincdir/\$wanted"
5279 awkprg='{ print \$$fieldn }'
5280 echo "#include <\$wanted>" > foo\$\$.c
5281 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5282 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5283 while read cline; do
5284 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5286 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5287 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5292 # status = 0: grep returned 0 lines, case statement not executed
5293 # status = 1: headerfile found
5294 # status = 2: while loop executed, no headerfile found
5298 if test \$status -eq 1; then
5305 : define an alternate in-header-list? function
5306 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5307 cont=true; xxf="echo \"<\$1> found.\" >&4";
5308 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5309 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5311 case $# in 4) instead=instead;; *) instead="at last";; esac;
5312 while $test "$cont"; do
5314 var=$2; eval "was=\$$2";
5315 if $test "$xxx" && $test -r "$xxx";
5317 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5320 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5321 set $yyy; shift; shift; yyy=$@;
5322 case $# in 0) cont="";;
5323 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5324 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5325 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5326 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5330 do set $yyy; var=$2; eval "was=\$$2";
5331 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5332 set $yyy; shift; shift; yyy=$@;
5335 : see if stdlib is available
5336 set stdlib.h i_stdlib
5339 : check for lengths of integral types
5343 echo "Checking to see how big your integers are..." >&4
5352 printf("intsize=%d;\n", (int)sizeof(int));
5353 printf("longsize=%d;\n", (int)sizeof(long));
5354 printf("shortsize=%d;\n", (int)sizeof(short));
5359 if eval $compile_ok && $run ./try > /dev/null; then
5361 echo "Your integers are $intsize bytes long."
5362 echo "Your long integers are $longsize bytes long."
5363 echo "Your short integers are $shortsize bytes long."
5367 Help! I can't compile and run the intsize test program: please enlighten me!
5368 (This is probably a misconfiguration in your system or libraries, and
5369 you really ought to fix it. Still, I'll try anyway.)
5373 rp="What is the size of an integer (in bytes)?"
5377 rp="What is the size of a long integer (in bytes)?"
5381 rp="What is the size of a short integer (in bytes)?"
5389 : check for long long
5391 echo "Checking to see if you have long long..." >&4
5392 echo 'int main() { long long x = 7; return 0; }' > try.c
5394 if eval $compile; then
5396 echo "You have long long."
5399 echo "You do not have long long."
5405 : check for length of long long
5406 case "${d_longlong}${longlongsize}" in
5409 echo "Checking to see how big your long longs are..." >&4
5410 $cat >try.c <<'EOCP'
5414 printf("%d\n", (int)sizeof(long long));
5419 if eval $compile_ok; then
5420 longlongsize=`$run ./try`
5421 echo "Your long longs are $longlongsize bytes long."
5425 echo "(I can't seem to compile the test program. Guessing...)"
5426 rp="What is the size of a long long (in bytes)?"
5430 if $test "X$longsize" = "X$longlongsize"; then
5431 echo "(That isn't any different from an ordinary long.)"
5437 : see if inttypes.h is available
5438 : we want a real compile instead of Inhdr because some systems
5439 : have an inttypes.h which includes non-existent headers
5442 #include <inttypes.h>
5444 static int32_t foo32 = 0x12345678;
5448 if eval $compile; then
5449 echo "<inttypes.h> found." >&4
5452 echo "<inttypes.h> NOT found." >&4
5461 echo "Checking to see if you have int64_t..." >&4
5463 #include <sys/types.h>
5464 #$i_inttypes I_INTTYPES
5466 #include <inttypes.h>
5468 int main() { int64_t x = 7; }
5471 if eval $compile; then
5473 echo "You have int64_t."
5476 echo "You do not have int64_t."
5484 echo "Checking which 64-bit integer type we could use..." >&4
5490 val='"unsigned int"'
5495 *) case "$longsize" in
5499 val='"unsigned long"'
5504 *) case "$d_longlong:$longlongsize" in
5509 val='"unsigned long long"'
5514 *) case "$d_int64_t" in
5533 '') echo "Alas, no 64-bit integer types in sight." >&4
5536 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5542 case "$uselonglong" in
5543 "$define"|true|[yY]*)
5546 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5548 use64bitint="$define"
5551 case "$use64bits" in
5552 "$define"|true|[yY]*)
5555 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5557 use64bitint="$define"
5560 case "$use64bitints" in
5561 "$define"|true|[yY]*)
5564 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5566 use64bitint="$define"
5569 case "$use64bitsint" in
5570 "$define"|true|[yY]*)
5573 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5575 use64bitint="$define"
5578 case "$uselonglongs" in
5579 "$define"|true|[yY]*)
5582 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5584 use64bitint="$define"
5587 case "$use64bitsall" in
5588 "$define"|true|[yY]*)
5591 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5593 use64bitall="$define"
5598 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5600 case "$use64bitall" in
5601 "$define"|true|[yY]*) use64bitint="$define" ;;
5607 You have natively 64-bit long integers.
5611 *) case "$use64bitint" in
5612 "$define"|true|[yY]*) dflt='y';;
5621 Perl can be built to take advantage of 64-bit integer types
5622 on some systems. To do so, Configure can be run with -Duse64bitint.
5623 Choosing this option will most probably introduce binary incompatibilities.
5625 If this doesn't make any sense to you, just accept the default '$dflt'.
5626 (The default has been chosen based on your configuration.)
5628 rp='Try to use 64-bit integers, if available?'
5631 [yY]*) val="$define" ;;
5639 case "$use64bitall" in
5640 "$define"|true|[yY]*) dflt='y' ;;
5641 *) case "$longsize" in
5649 You may also choose to try maximal 64-bitness. It means using as much
5650 64-bitness as possible on the platform. This in turn means even more
5651 binary incompatibilities. On the other hand, your platform may not
5652 have any more 64-bitness available than what you already have chosen.
5654 If this doesn't make any sense to you, just accept the default '$dflt'.
5655 (The default has been chosen based on your configuration.)
5657 rp='Try to use maximal 64-bit support, if available?'
5660 [yY]*) val="$define" ;;
5665 case "$use64bitall" in
5667 case "$use64bitint" in
5671 Since you have chosen a maximally 64-bit build, I'm also turning on
5672 the use of 64-bit integers.
5674 use64bitint="$define" ;;
5679 : Look for a hint-file generated 'call-back-unit'. If the
5680 : user has specified that a 64-bit perl is to be built,
5681 : we may need to set or change some other defaults.
5682 if $test -f use64bitint.cbu; then
5683 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5686 case "$use64bitint" in
5687 "$define"|true|[yY]*)
5689 4) case "$archname64" in
5690 '') archname64=64int ;;
5697 : Look for a hint-file generated 'call-back-unit'. If the
5698 : user has specified that a maximally 64-bit perl is to be built,
5699 : we may need to set or change some other defaults.
5700 if $test -f use64bitall.cbu; then
5701 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5704 case "$use64bitall" in
5705 "$define"|true|[yY]*)
5707 4) case "$archname64" in
5708 ''|64int) archname64=64all ;;
5715 case "$d_quad:$use64bitint" in
5719 *** You have chosen to use 64-bit integers,
5720 *** but none can be found.
5721 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5722 *** Cannot continue, aborting.
5729 : check for length of double
5731 case "$doublesize" in
5733 echo "Checking to see how big your double precision numbers are..." >&4
5742 printf("%d\n", (int)sizeof(double));
5747 if eval $compile_ok; then
5748 doublesize=`$run ./try`
5749 echo "Your double is $doublesize bytes long."
5752 echo "(I can't seem to compile the test program. Guessing...)"
5753 rp="What is the size of a double precision number (in bytes)?"
5761 : check for long doubles
5763 echo "Checking to see if you have long double..." >&4
5764 echo 'int main() { long double x = 7.0; }' > try.c
5766 if eval $compile; then
5768 echo "You have long double."
5771 echo "You do not have long double."
5777 : check for length of long double
5778 case "${d_longdbl}${longdblsize}" in
5781 echo "Checking to see how big your long doubles are..." >&4
5782 $cat >try.c <<'EOCP'
5786 printf("%d\n", sizeof(long double));
5791 if eval $compile; then
5792 longdblsize=`$run ./try`
5793 echo "Your long doubles are $longdblsize bytes long."
5797 echo "(I can't seem to compile the test program. Guessing...)" >&4
5798 rp="What is the size of a long double (in bytes)?"
5802 if $test "X$doublesize" = "X$longdblsize"; then
5803 echo "That isn't any different from an ordinary double."
5804 echo "I'll keep your setting anyway, but you may see some"
5805 echo "harmless compilation warnings."
5811 : determine the architecture name
5813 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5814 tarch=`arch`"-$osname"
5815 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5816 if uname -m > tmparch 2>&1 ; then
5817 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5818 -e 's/$/'"-$osname/" tmparch`
5826 case "$myarchname" in
5829 echo "(Your architecture name used to be $myarchname.)"
5833 case "$targetarch" in
5835 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
5840 *) dflt="$archname";;
5842 rp='What is your architecture name'
5845 case "$usethreads" in
5847 echo "Threads selected." >&4
5849 *-thread*) echo "...and architecture name already has -thread." >&4
5851 *) archname="$archname-thread"
5852 echo "...setting architecture name to $archname." >&4
5857 case "$usemultiplicity" in
5859 echo "Multiplicity selected." >&4
5861 *-multi*) echo "...and architecture name already has -multi." >&4
5863 *) archname="$archname-multi"
5864 echo "...setting architecture name to $archname." >&4
5869 case "$use64bitint$use64bitall" in
5871 case "$archname64" in
5873 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
5876 case "$use64bitint" in
5877 "$define") echo "64 bit integers selected." >&4 ;;
5879 case "$use64bitall" in
5880 "$define") echo "Maximal 64 bitness selected." >&4 ;;
5883 *-$archname64*) echo "...and architecture name already has $archname64." >&4
5885 *) archname="$archname-$archname64"
5886 echo "...setting architecture name to $archname." >&4
5892 case "$uselongdouble" in
5894 echo "Long doubles selected." >&4
5895 case "$longdblsize" in
5897 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
5901 *-ld*) echo "...and architecture name already has -ld." >&4
5903 *) archname="$archname-ld"
5904 echo "...setting architecture name to $archname." >&4
5911 case "$useperlio" in
5913 echo "Perlio selected." >&4
5916 echo "Perlio not selected, using stdio." >&4
5918 *-stdio*) echo "...and architecture name already has -stdio." >&4
5920 *) archname="$archname-stdio"
5921 echo "...setting architecture name to $archname." >&4
5926 if $test -f archname.cbu; then
5927 echo "Your platform has some specific hints for architecture name, using them..."
5931 : set the prefixit variable, to compute a suitable default value
5932 prefixit='case "$3" in
5934 case "$oldprefix" in
5935 "") eval "$1=\"\$$2\"";;
5942 ""|" ") eval "$1=\"\$$2\"";;
5948 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
5950 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
5951 /*-$oldprefix/*|\~*-$oldprefix/*)
5952 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
5953 *) eval "$1=\"\$$2\"";;
5957 : get the patchlevel
5959 echo "Getting the current patchlevel..." >&4
5960 if $test -r $rsrc/patchlevel.h;then
5961 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
5962 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
5963 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5964 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
5965 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
5966 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5967 perl_patchlevel=`egrep 'define PERL_PATCHNUM [0-9][0-9]|,"MAINT[0-9][0-9]*"' $rsrc/patchlevel.h|sed 's/[^0-9]//g'`
5976 $echo "(You do not have patchlevel.h. Eek.)"
5978 if $test -r $rsrc/.patch ; then
5979 if $test "X$perl_patchlevel" = "X" || $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
5980 perl_patchlevel=`cat $rsrc/.patch`
5983 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
5984 version_patchlevel_string="version $patchlevel subversion $subversion"
5985 case "$perl_patchlevel" in
5987 *) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;;
5990 $echo "(You have $package $version_patchlevel_string.)"
5994 : XXX Should be a Configure test for double-dots in filenames.
5995 version=`echo $revision $patchlevel $subversion | \
5996 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
5997 api_versionstring=`echo $api_revision $api_version $api_subversion | \
5998 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
6001 version=`echo $revision $patchlevel $subversion | \
6002 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
6003 api_versionstring=`echo $api_revision $api_version $api_subversion | \
6004 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
6007 : Special case the 5.005_xx maintenance series, which used 5.005
6008 : without any subversion label as a subdirectory in $sitelib
6009 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
6010 api_versionstring='5.005'
6013 : determine installation style
6014 : For now, try to deduce it from prefix unless it is already set.
6015 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6016 case "$installstyle" in
6017 '') case "$prefix" in
6018 *perl*) dflt='lib';;
6019 *) dflt='lib/perl5' ;;
6022 *) dflt="$installstyle" ;;
6024 : Probably not worth prompting for this since we prompt for all
6025 : the directories individually, and the prompt would be too long and
6029 : determine where public executables go
6034 rp='Pathname where the public executables will reside?'
6036 if $test "X$ansexp" != "X$binexp"; then
6040 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6041 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
6042 : this via initialinstalllocation
6045 case "$userelocatableinc" in
6046 $define|true|[yY]*) dflt='y' ;;
6051 Would you like to build Perl so that the installation is relocatable, so that
6052 library paths in @INC are determined relative to the path of the perl binary?
6053 This is not advised for system Perl installs, or if you need to run setid
6054 scripts or scripts under taint mode.
6056 If this doesn't make any sense to you, just accept the default '$dflt'.
6058 rp='Use relocatable @INC?'
6061 y|Y) val="$define" ;;
6064 set userelocatableinc
6067 initialinstalllocation="$binexp"
6068 : Default prefix is now "up one level from where the binaries are"
6069 case "$userelocatableinc" in
6075 installprefixexp=".../.."
6079 : determine where private library files go
6080 : Usual default is /usr/local/lib/perl5/$version.
6081 : Also allow things like /opt/perl/lib/$version, since
6082 : /opt/perl/lib/perl5... would be redundant.
6083 : The default "style" setting is made in installstyle.U
6084 case "$installstyle" in
6085 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6086 *) set dflt privlib lib/$version ;;
6091 There are some auxiliary files for $package that need to be put into a
6092 private library directory that is accessible by everyone.
6097 rp='Pathname where the private library files will reside?'
6102 : set the prefixup variable, to restore leading tilda escape
6103 prefixup='case "$prefixexp" in
6105 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6108 : determine where public architecture dependent libraries go
6111 : privlib default is /usr/local/lib/$package/$version
6112 : archlib default is /usr/local/lib/$package/$version/$archname
6113 : privlib may have an optional trailing /share.
6114 tdflt=`echo $privlib | $sed 's,/share$,,'`
6115 tdflt=$tdflt/$archname
6124 $spackage contains architecture-dependent library files. If you are
6125 sharing libraries in a heterogeneous environment, you might store
6126 these files in a separate location. Otherwise, you can just include
6127 them with the rest of the public library files.
6132 rp='Where do you want to put the public architecture-dependent libraries?'
6136 if $test X"$archlib" = X"$privlib"; then
6142 : see if setuid scripts can be secure
6145 Some kernels have a bug that prevents setuid #! scripts from being
6146 secure. Some sites have disabled setuid #! scripts because of this.
6148 First let's decide if your kernel supports secure setuid #! scripts.
6149 (If setuid #! scripts would be secure but have been disabled anyway,
6150 don't say that they are secure if asked.)
6155 if $test -d /dev/fd; then
6156 echo "#!$ls" >reflect
6157 chmod +x,u+s reflect
6158 ./reflect >flect 2>&1
6159 if $contains "/dev/fd" flect >/dev/null; then
6160 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6164 If you are not sure if they are secure, I can check but I'll need a
6165 username and password different from the one you are using right now.
6166 If you don't have such a username or don't want me to test, simply
6170 rp='Other username to test security of setuid scripts with?'
6175 case "$d_suidsafe" in
6176 '') echo "I'll assume setuid scripts are *not* secure." >&4
6179 echo "Well, the $hint value is *not* secure." >&4
6181 *) echo "Well, the $hint value *is* secure." >&4
6186 $rm -f reflect flect
6187 echo "#!$ls" >reflect
6188 chmod +x,u+s reflect
6191 echo '"su" will (probably) prompt you for '"$ans's password."
6192 su $ans -c './reflect >flect'
6193 if $contains "/dev/fd" flect >/dev/null; then
6194 echo "Okay, it looks like setuid scripts are secure." >&4
6197 echo "I don't think setuid scripts are secure." >&4
6202 rp='Does your kernel have *secure* setuid scripts?'
6205 [yY]*) val="$define";;
6210 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6211 echo "(That's for file descriptors, not floppy disks.)"
6217 $rm -f reflect flect
6219 : now see if they want to do setuid emulation
6222 case "$d_suidsafe" in
6225 echo "No need to emulate SUID scripts since they are secure here." >&4
6229 Some systems have disabled setuid scripts, especially systems where
6230 setuid scripts cannot be secure. On systems where setuid scripts have
6231 been disabled, the setuid/setgid bits on scripts are currently
6232 useless. It is possible for $package to detect those bits and emulate
6233 setuid/setgid in a secure fashion. This emulation will only work if
6234 setuid scripts have been disabled in your kernel.
6238 "$define") dflt=y ;;
6241 rp="Do you want to do setuid/setgid emulation?"
6244 [yY]*) val="$define";;
6252 : Find perl5.005 or later.
6253 echo "Looking for a previously installed perl5.005 or later... "
6255 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6256 : Check if this perl is recent and can load a simple module
6257 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6260 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6270 '') echo "None found. That's ok.";;
6271 *) echo "Using $perl5." ;;
6276 After $package is installed, you may wish to install various
6277 add-on modules and utilities. Typically, these add-ons will
6278 be installed under $prefix with the rest
6279 of this package. However, you may wish to install such add-ons
6280 elsewhere under a different prefix.
6282 If you do not wish to put everything under a single prefix, that's
6283 ok. You will be prompted for the individual locations; this siteprefix
6284 is only used to suggest the defaults.
6286 The default should be fine for most people.
6290 rp='Installation prefix to use for add-on modules and utilities?'
6291 : XXX Here might be another good place for an installstyle setting.
6292 case "$siteprefix" in
6294 *) dflt=$siteprefix ;;
6297 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6299 case "$siteprefix" in
6303 *) oldsiteprefix="$prefix";;
6308 siteprefixexp="$ansexp"
6310 : determine where site specific libraries go.
6311 : Usual default is /usr/local/lib/perl5/site_perl/$version
6312 : The default "style" setting is made in installstyle.U
6313 : XXX No longer works with Prefixit stuff.
6314 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6316 '') case "$installstyle" in
6317 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6318 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6326 The installation process will create a directory for
6327 site-specific extensions and modules. Most users find it convenient
6328 to place all site-specific files in this directory rather than in the
6329 main distribution directory.
6333 rp='Pathname for the site-specific library files?'
6337 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6339 : Determine list of previous versions to include in @INC
6340 $cat > getverlist <<EOPL
6343 \$api_versionstring = "$api_versionstring";
6344 \$version = "$version";
6345 \$stem = "$sitelib_stem";
6346 \$archname = "$archname";
6348 $cat >> getverlist <<'EOPL'
6349 # Can't have leading @ because metaconfig interprets it as a command!
6350 ;@inc_version_list=();
6351 # XXX Redo to do opendir/readdir?
6354 ;@candidates = glob("5.*");
6360 # XXX ToDo: These comparisons must be reworked when two-digit
6361 # subversions come along, so that 5.7.10 compares as greater than
6362 # 5.7.3! By that time, hope that 5.6.x is sufficiently
6363 # widespread that we can use the built-in version vectors rather
6364 # than reinventing them here. For 5.6.0, however, we must
6365 # assume this script will likely be run by 5.005_0x. --AD 1/2000.
6366 foreach $d (@candidates) {
6367 if ($d lt $version) {
6368 if ($d ge $api_versionstring) {
6369 unshift(@inc_version_list, grep { -d } "$d/$archname", $d);
6371 elsif ($d ge "5.005") {
6372 unshift(@inc_version_list, grep { -d } $d);
6376 # Skip newer version. I.e. don't look in
6377 # 5.7.0 if we're installing 5.6.1.
6381 if (@inc_version_list) {
6382 print join(' ', @inc_version_list);
6385 # Blank space to preserve value for next Configure run.
6390 case "$inc_version_list" in
6391 '') if test -x "$perl5$exe_ext"; then
6392 dflt=`$perl5 getverlist`
6397 $undef) dflt='none' ;;
6398 *) eval dflt=\"$inc_version_list\" ;;
6401 ''|' ') dflt=none ;;
6408 In order to ease the process of upgrading, this version of perl
6409 can be configured to use modules built and installed with earlier
6410 versions of perl that were installed under $prefix. Specify here
6411 the list of earlier versions that this version of perl should check.
6412 If Configure detected no earlier versions of perl installed under
6413 $prefix, then the list will be empty. Answer 'none' to tell perl
6414 to not search earlier versions.
6416 The default should almost always be sensible, so if you're not sure,
6417 just accept the default.
6420 rp='List of earlier versions to include in @INC?'
6423 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6424 *) inc_version_list="$ans" ;;
6426 case "$inc_version_list" in
6428 inc_version_list_init='0'
6429 d_inc_version_list="$undef"
6431 *) inc_version_list_init=`echo $inc_version_list |
6432 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6433 d_inc_version_list="$define"
6438 : see if this is a malloc.h system
6439 : we want a real compile instead of Inhdr because some systems have a
6440 : malloc.h that just gives a compile error saying to use stdlib.h instead
6445 int main () { return 0; }
6448 if eval $compile; then
6449 echo "<malloc.h> found." >&4
6452 echo "<malloc.h> NOT found." >&4
6459 : check for void type
6461 echo "Checking to see how well your C compiler groks the void type..." >&4
6462 case "$voidflags" in
6474 extern void moo(); /* function returning void */
6475 void (*goo)(); /* ptr to func returning void */
6477 void *hue; /* generic ptr */
6490 int main() { sub(); }
6492 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6493 voidflags=$defvoidused
6494 echo "Good. It appears to support void to the level $package wants.">&4
6495 if $contains warning .out >/dev/null 2>&1; then
6496 echo "However, you might get some warnings that look like this:"
6500 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6501 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6502 echo "It supports 1..."
6503 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6504 echo "It also supports 2..."
6505 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6507 echo "And it supports 4 but not 8 definitely."
6509 echo "It doesn't support 4..."
6510 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6512 echo "But it supports 8."
6515 echo "Neither does it support 8."
6519 echo "It does not support 2..."
6520 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6522 echo "But it supports 4 and 8."
6524 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6526 echo "And it supports 4 but has not heard about 8."
6528 echo "However it supports 8 but not 4."
6533 echo "There is no support at all for void."
6538 case "$voidflags" in
6541 Support flag bits are:
6542 1: basic void declarations.
6543 2: arrays of pointers to functions returning void.
6544 4: operations between pointers to and addresses of void functions.
6545 8: generic void pointers.
6548 rp="Your void support flags add up to what?"
6555 : check for length of pointer
6559 echo "Checking to see how big your pointers are..." >&4
6560 if test "$voidflags" -gt 7; then
6561 echo '#define VOID_PTR char *' > try.c
6563 echo '#define VOID_PTR void *' > try.c
6573 printf("%d\n", (int)sizeof(VOID_PTR));
6578 if eval $compile_ok; then
6579 ptrsize=`$run ./try`
6580 echo "Your pointers are $ptrsize bytes long."
6583 echo "(I can't seem to compile the test program. Guessing...)" >&4
6584 rp="What is the size of a pointer (in bytes)?"
6591 case "$use64bitall" in
6592 "$define"|true|[yY]*)
6596 *** You have chosen a maximally 64-bit build,
6597 *** but your pointers are only 4 bytes wide.
6598 *** Please rerun Configure without -Duse64bitall.
6603 *** Since you have quads, you could possibly try with -Duse64bitint.
6608 *** Cannot continue, aborting.
6619 : determine whether to use malloc wrapping
6621 case "$usemallocwrap" in
6622 [yY]*|true|$define) dflt='y' ;;
6623 [nN]*|false|$undef) dflt='n' ;;
6624 *) case "$usedevel" in
6625 [yY]*|true|$define) dflt='y' ;;
6630 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6632 usemallocwrap="$ans"
6635 usemallocwrap="$define" ;;
6637 usemallocwrap="$undef" ;;
6640 : determine which malloc to compile in
6642 case "$usemymalloc" in
6643 [yY]*|true|$define) dflt='y' ;;
6644 [nN]*|false|$undef) dflt='n' ;;
6645 *) case "$ptrsize" in
6651 rp="Do you wish to attempt to use the malloc that comes with $package?"
6657 mallocsrc='malloc.c'
6658 mallocobj="malloc$_o"
6659 d_mymalloc="$define"
6662 : Remove malloc from list of libraries to use
6663 echo "Removing unneeded -lmalloc from library list" >&4
6664 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6667 echo "libs = $libs" >&4
6679 : compute the return types of malloc and free
6681 $cat >malloc.c <<END
6685 #include <sys/types.h>
6699 case "$malloctype" in
6701 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6708 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6712 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6719 echo "Your system uses $freetype free(), it would seem." >&4
6721 : determine where site specific architecture-dependent libraries go.
6722 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6723 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6724 : sitelib may have an optional trailing /share.
6726 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6727 dflt="$dflt/$archname"
6732 set sitearch sitearch none
6736 The installation process will also create a directory for
6737 architecture-dependent site-specific extensions and modules.
6741 rp='Pathname for the site-specific architecture-dependent library files?'
6745 if $test X"$sitearch" = X"$sitelib"; then
6748 d_sitearch="$define"
6753 The installation process will also create a directory for
6754 vendor-supplied add-ons. Vendors who supply perl with their system
6755 may find it convenient to place all vendor-supplied files in this
6756 directory rather than in the main distribution directory. This will
6757 ease upgrades between binary-compatible maintenance versions of perl.
6759 Of course you may also use these directories in whatever way you see
6760 fit. For example, you might use them to access modules shared over a
6761 company-wide network.
6763 The default answer should be fine for most people.
6764 This causes further questions about vendor add-ons to be skipped
6765 and no vendor-specific directories will be configured for perl.
6768 rp='Do you want to configure vendor-specific add-on directories?'
6769 case "$usevendorprefix" in
6770 define|true|[yY]*) dflt=y ;;
6771 *) : User may have set vendorprefix directly on Configure command line.
6772 case "$vendorprefix" in
6781 rp='Installation prefix to use for vendor-supplied add-ons?'
6782 case "$vendorprefix" in
6784 *) dflt=$vendorprefix ;;
6787 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6789 case "$vendorprefix" in
6793 *) oldvendorprefix="$prefix";;
6797 usevendorprefix="$define"
6799 vendorprefixexp="$ansexp"
6801 *) usevendorprefix="$undef"
6807 case "$vendorprefix" in
6808 '') d_vendorlib="$undef"
6812 *) d_vendorlib="$define"
6813 : determine where vendor-supplied modules go.
6814 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6815 case "$vendorlib" in
6817 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6818 case "$installstyle" in
6819 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6820 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6823 *) dflt="$vendorlib"
6827 rp='Pathname for the vendor-supplied library files?'
6830 vendorlibexp="$ansexp"
6833 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6837 case "$vendorprefix" in
6838 '') d_vendorarch="$undef"
6842 *) d_vendorarch="$define"
6843 : determine where vendor-supplied architecture-dependent libraries go.
6844 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6845 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6846 : vendorlib may have an optional trailing /share.
6847 case "$vendorarch" in
6848 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6849 dflt="$dflt/$archname"
6851 *) dflt="$vendorarch" ;;
6854 rp='Pathname for vendor-supplied architecture-dependent files?'
6857 vendorarchexp="$ansexp"
6860 prefixvar=vendorarch
6863 : Final catch-all directories to search
6866 Lastly, you can have perl look in other directories for extensions and
6867 modules in addition to those already specified.
6868 These directories will be searched after
6872 test X"$vendorlib" != "X" && echo ' ' $vendorlib
6873 test X"$vendorarch" != "X" && echo ' ' $vendorarch
6875 case "$otherlibdirs" in
6876 ''|' ') dflt='none' ;;
6877 *) dflt="$otherlibdirs" ;;
6880 Enter a colon-separated set of extra paths to include in perl's @INC
6881 search path, or enter 'none' for no extra paths.
6885 rp='Colon-separated list of additional directories for perl to search?'
6888 ' '|''|none) otherlibdirs=' ' ;;
6889 *) otherlibdirs="$ans" ;;
6891 case "$otherlibdirs" in
6895 set d_perl_otherlibdirs
6898 : Cruising for prototypes
6900 echo "Checking out function prototypes..." >&4
6901 $cat >prototype.c <<EOCP
6906 int main(int argc, char *argv[]) {
6909 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
6910 echo "Your C compiler appears to support function prototypes."
6913 echo "Your C compiler doesn't seem to understand function prototypes."
6920 case "$prototype" in
6922 *) ansi2knr='ansi2knr'
6927 This version of $package can only be compiled by a compiler that
6928 understands function prototypes. Unfortunately, your C compiler
6930 doesn't seem to understand them. Sorry about that.
6932 If GNU cc is available for your system, perhaps you could try that instead.
6934 Eventually, we hope to support building Perl with pre-ANSI compilers.
6935 If you would like to help in that effort, please contact <perlbug@perl.org>.
6937 Aborting Configure now.
6949 Perl can be built with extra modules or bundles of modules which
6950 will be fetched from the CPAN and installed alongside Perl.
6952 Notice that you will need access to the CPAN; either via the Internet,
6953 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
6954 be asked later to configure the CPAN.pm module which will in turn do
6955 the installation of the rest of the extra modules or bundles.)
6957 Notice also that if the modules require any external software such as
6958 libraries and headers (the libz library and the zlib.h header for the
6959 Compress::Zlib module, for example) you MUST have any such software
6960 already installed, this configuration process will NOT install such
6963 If this doesn't make any sense to you, just accept the default '$dflt'.
6965 rp='Install any extra modules (y or n)?'
6971 Please list any extra modules or bundles to be installed from CPAN,
6972 with spaces between the names. The names can be in any format the
6973 'install' command of CPAN.pm will understand. (Answer 'none',
6974 without the quotes, to install no extra modules or bundles.)
6984 $rm -f ../extras.lst
6986 *) echo "(Saving the list of extras for later...)"
6987 echo "$extras" > ../extras.lst
6995 : determine where html pages for programs go
6996 set html1dir html1dir none
7000 If you wish to install html files for programs in $spackage, indicate
7001 the appropriate directory here. To skip installing html files,
7005 ''|none|$undef|' ') dflt=none ;;
7006 *) dflt=$html1dir ;;
7009 rp="Directory for the main $spackage html pages?"
7013 : Use ' ' for none so value is preserved next time through Configure
7014 $test X"$html1dir" = "X" && html1dir=' '
7016 : determine where html pages for libraries and modules go
7017 set html3dir html3dir none
7021 If you wish to install html files for modules associated with $spackage,
7022 indicate the appropriate directory here. To skip installing html files,
7025 : There is no obvious default. If they have specified html1dir, then
7026 : try to key off that, possibly changing .../html1 into .../html3.
7028 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7029 *) dflt=$html3dir ;;
7032 rp="Directory for the $spackage module html pages?"
7036 : Use ' ' for none so value is preserved next time through Configure
7037 $test X"$html3dir" = "X" && html3dir=' '
7039 : determine whether to install perl also as /usr/bin/perl
7042 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7044 Many scripts expect perl to be installed as /usr/bin/perl.
7046 If you want to, I can install the perl you are about to compile
7047 as /usr/bin/perl (in addition to $bin/perl).
7049 if test -f /usr/bin/perl; then
7052 However, please note that because you already have a /usr/bin/perl,
7053 overwriting that with a new Perl would very probably cause problems.
7054 Therefore I'm assuming you don't want to do that (unless you insist).
7057 case "$installusrbinperl" in
7058 "$define"|[yY]*) dflt='y';;
7064 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7067 case "$installusrbinperl" in
7068 "$undef"|[nN]*) dflt='n';;
7072 rp="Do you want to install perl as /usr/bin/perl?"
7075 [yY]*) val="$define";;
7081 set installusrbinperl
7085 echo "Checking for GNU C Library..." >&4
7087 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7088 alone are insufficient to distinguish different versions, such as
7089 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7090 libc version 2.1.0. A. Dougherty, June 3, 2002.
7096 # ifdef __GLIBC_MINOR__
7097 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
7098 # include <gnu/libc-version.h>
7099 printf("%s\n", gnu_get_libc_version());
7101 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7104 printf("%d\n", __GLIBC__);
7113 if eval $compile_ok && $run ./try > glibc.ver; then
7115 gnulibc_version=`$cat glibc.ver`
7116 echo "You are using the GNU C Library version $gnulibc_version"
7120 echo "You are not using the GNU C Library"
7122 $rm -f try try.* glibc.ver
7126 : see if nm is to be used to determine whether a symbol is defined or not
7130 case "$d_gnulibc" in
7133 echo "nm probably won't work on the GNU C Library." >&4
7139 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7141 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7142 echo "'nm' won't be sufficient on this sytem." >&4
7148 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7149 if $test $dflt -gt 20; then
7159 true|$define) dflt=y;;
7166 I can use $nm to extract the symbols from your C libraries. This
7167 is a time consuming task which may generate huge output on the disk (up
7168 to 3 megabytes) but that should make the symbols extraction faster. The
7169 alternative is to skip the 'nm' extraction part and to compile a small
7170 test program instead to determine whether each symbol is present. If
7171 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7172 this may be the best solution.
7174 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7177 rp="Shall I use $nm to extract C symbols from the libraries?"
7180 [Nn]*) usenm=false;;
7189 : nm options which may be necessary
7191 '') if $test -f /mach_boot; then
7193 elif $test -d /usr/ccs/lib; then
7194 nm_opt='-p' # Solaris (and SunOS?)
7195 elif $test -f /dgux; then
7197 elif $test -f /lib64/rld; then
7198 nm_opt='-p' # 64-bit Irix
7204 : nm options which may be necessary for shared libraries but illegal
7205 : for archive libraries. Thank you, Linux.
7206 case "$nm_so_opt" in
7207 '') case "$myuname" in
7209 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7210 nm_so_opt='--dynamic'
7219 : get list of predefined functions in a handy place
7224 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7230 *) for thislib in $libs; do
7233 : Handle C library specially below.
7236 thislib=`echo $thislib | $sed -e 's/^-l//'`
7237 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7239 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7241 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7243 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7245 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7247 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7249 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7254 libnames="$libnames $try"
7256 *) libnames="$libnames $thislib" ;;
7265 for xxx in $libpth; do
7266 $test -r $1 || set $xxx/libc.$so
7267 : The messy sed command sorts on library version numbers.
7269 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7270 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7272 s/[0-9][0-9]*/0000&/g
7273 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7276 $sort | $sed -e 's/^.* //'`
7279 $test -r $1 || set /usr/ccs/lib/libc.$so
7280 $test -r $1 || set /lib/libsys_s$_a
7286 if $test -r "$1"; then
7287 echo "Your (shared) C library seems to be in $1."
7289 elif $test -r /lib/libc && $test -r /lib/clib; then
7290 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7292 libc='/lib/clib /lib/libc'
7293 if $test -r /lib/syslib; then
7294 echo "(Your math library is in /lib/syslib.)"
7295 libc="$libc /lib/syslib"
7297 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7298 echo "Your C library seems to be in $libc, as you said before."
7299 elif $test -r $incpath/usr/lib/libc$_a; then
7300 libc=$incpath/usr/lib/libc$_a;
7301 echo "Your C library seems to be in $libc. That's fine."
7302 elif $test -r /lib/libc$_a; then
7304 echo "Your C library seems to be in $libc. You're normal."
7306 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7308 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7309 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7310 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7312 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7314 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7317 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7319 if $test -r "$tans"; then
7320 echo "Your C library seems to be in $tans, of all places."
7326 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7330 If the guess above is wrong (which it might be if you're using a strange
7331 compiler, or your machine supports multiple models), you can override it here.
7336 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7338 I can't seem to find your C library. I've looked in the following places:
7341 $sed 's/^/ /' libpath
7344 None of these seems to contain your C library. I need to get its name...
7349 rp='Where is your C library?'
7354 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7355 set X `cat libnames`
7358 case $# in 1) xxx=file; esac
7359 echo "Extracting names from the following $xxx for later perusal:" >&4
7361 $sed 's/^/ /' libnames >&4
7363 $echo $n "This may take a while...$c" >&4
7367 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7368 *) $nm $nm_opt $file 2>/dev/null;;
7373 $grep fprintf libc.tmp > libc.ptf
7374 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7375 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7377 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7379 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7381 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7383 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7385 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7387 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7389 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7391 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7393 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7395 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7397 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7399 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7401 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7402 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7404 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7406 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7408 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7410 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7412 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7414 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7416 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7418 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7420 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7422 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7424 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7426 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7428 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7430 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7432 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7435 $nm -p $* 2>/dev/null >libc.tmp
7436 $grep fprintf libc.tmp > libc.ptf
7437 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7438 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7444 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7446 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
7447 for thisname in $libnames $libc; do
7448 $ar t $thisname >>libc.tmp
7450 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7452 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7453 # Repeat libc to extract forwarders to DLL entries too
7454 for thisname in $libnames $libc; do
7455 $ar tv $thisname >>libc.tmp
7456 # Revision 50 of EMX has bug in $ar.
7457 # it will not extract forwarders to DLL entries
7458 # Use emximp which will extract exactly them.
7459 emximp -o tmp.imp $thisname \
7461 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7462 < tmp.imp >>libc.tmp
7465 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7468 echo "$ar didn't seem to work right." >&4
7469 echo "Maybe this is a Cray...trying bld instead..." >&4
7470 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
7472 for thisname in $libnames; do
7474 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7475 $ar t $thisname >>libc.tmp
7479 echo "That didn't work either. Giving up." >&4
7489 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7490 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7492 *) if $test -f /lib/syscalls.exp; then
7494 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7495 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' /lib/syscalls.exp >>libc.list
7501 $rm -f libnames libpath
7503 : see if dld is available
7507 : is a C symbol defined?
7510 -v) tf=libc.tmp; tdc="";;
7511 -a) tf=libc.tmp; tdc="[]";;
7512 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7515 case "$reuseval-$4" in
7517 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7522 if $test "$runnm" = true; then
7523 if $contains $tlook $tf >/dev/null 2>&1; then
7525 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7526 echo "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7527 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7528 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7529 $rm -f try$_exe try.c core core.* try.core;
7532 echo "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7533 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7534 $rm -f try$_exe try.c;
7539 $define) tval=true;;
7546 : define an is-in-libc? function
7547 inlibc='echo " "; td=$define; tu=$undef;
7548 sym=$1; var=$2; eval "was=\$$2";
7550 case "$reuseval$was" in
7560 echo "$sym() found." >&4;
7561 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7563 echo "$sym() NOT found." >&4;
7564 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7568 $define) echo "$sym() found." >&4;;
7569 *) echo "$sym() NOT found." >&4;;
7575 echo "Checking for C++..." >&4
7589 if eval $compile_ok && $run ./try >cplusplus$$; then
7590 val=`$cat cplusplus$$`
7591 echo "You are using a C++ compiler."
7594 echo "You are not using a C++ compiler."
7596 $rm -f try try.* cplusplus$$
7600 : see if dlopen exists
7602 xxx_ccflags="$ccflags"
7604 : with g++ one needs -shared to get is-in-libc to work for dlopen
7605 case "$gccversion" in
7607 *) case "$d_cplusplus" in
7608 "$define") ccflags="$ccflags -shared" ;;
7615 ccflags="$xxx_ccflags"
7617 : see if this is a unistd.h system
7618 set unistd.h i_unistd
7621 : determine which dynamic loading, if any, to compile in
7623 dldir="ext/DynaLoader"
7636 $define) dflt='y' ;;
7639 $define) dflt='y' ;;
7641 : Does a dl_xxx.xs file exist for this operating system
7642 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7645 rp="Do you wish to use dynamic loading?"
7652 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7653 dflt="$dldir/dl_${osname}.xs"
7654 elif $test "$d_dlopen" = "$define" ; then
7655 dflt="$dldir/dl_dlopen.xs"
7656 elif $test "$i_dld" = "$define" ; then
7657 dflt="$dldir/dl_dld.xs"
7662 *) dflt="$dldir/$dlsrc"
7665 echo "The following dynamic loading files are available:"
7666 : Can not go over to $dldir because getfile has path hard-coded in.
7667 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7668 rp="Source file to use for dynamic loading"
7674 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7678 Some systems may require passing special flags to $cc -c to
7679 compile modules that will be used to create a shared library.
7680 To use no flags, say "none".
7683 case "$cccdlflags" in
7684 '') case "$gccversion" in
7685 '') case "$osname" in
7687 next) dflt='none' ;;
7688 irix*) dflt='-KPIC' ;;
7689 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7690 sunos) dflt='-pic' ;;
7694 *) case "$osname" in
7695 darwin) dflt='none' ;;
7696 svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7701 *) dflt="$cccdlflags" ;;
7703 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7706 none) cccdlflags=' ' ;;
7707 *) cccdlflags="$ans" ;;
7712 Some systems use ld to create libraries that can be dynamically loaded,
7713 while other systems (such as those using ELF) use $cc.
7717 '') $cat >try.c <<EOM
7718 /* Test for whether ELF binaries are produced */
7730 int i = open("a.out",O_RDONLY);
7733 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7734 exit(0); /* succeed (yes, it's ELF) */
7739 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7741 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7745 echo "I'll use ld to build dynamic libraries."
7754 rp="What command should be used to create dynamic libraries?"
7760 Some systems may require passing special flags to $ld to create a
7761 library that can be dynamically loaded. If your ld flags include
7762 -L/other/path options to locate libraries outside your loader's normal
7763 search path, you may need to specify those -L options here as well. To
7764 use no flags, say "none".
7767 case "$lddlflags" in
7768 '') case "$osname" in
7769 beos) dflt='-nostart' ;;
7771 case "$gccversion" in
7772 '') dflt="$dflt +vnocompatwarnings" ;;
7775 linux|irix*|gnu*) dflt='-shared' ;;
7776 next) dflt='none' ;;
7777 solaris) dflt='-G' ;;
7778 sunos) dflt='-assert nodefinitions' ;;
7779 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
7783 *) dflt="$lddlflags" ;;
7786 : Try to guess additional flags to pick up local libraries.
7787 : Be careful not to append to a plain 'none'
7791 for thisflag in $ldflags; do
7796 *) dflt="$dflt $thisflag" ;;
7803 ''|' ') dflt='none' ;;
7806 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
7809 none) lddlflags=' ' ;;
7810 *) lddlflags="$ans" ;;
7815 Some systems may require passing special flags to $cc to indicate that
7816 the resulting executable will use dynamic linking. To use no flags,
7820 case "$ccdlflags" in
7821 '') case "$osname" in
7822 linux|hpux|gnu*) dflt='-Wl,-E' ;;
7823 next|sunos) dflt='none' ;;
7827 *) dflt="$ccdlflags" ;;
7829 rp="Any special flags to pass to $cc to use dynamic linking?"
7832 none) ccdlflags=' ' ;;
7833 *) ccdlflags="$ans" ;;
7847 # No dynamic loading being used, so don't bother even to prompt.
7850 *) case "$useshrplib" in
7851 '') case "$osname" in
7852 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
7854 also='Building a shared libperl is required for dynamic loading to work on your system.'
7859 also='Building a shared libperl is needed for MAB support.'
7877 The perl executable is normally obtained by linking perlmain.c with
7878 libperl${_a}, any static extensions (usually just DynaLoader), and
7879 any other libraries needed on this system (such as -lm, etc.). Since
7880 your system supports dynamic loading, it is probably possible to build
7881 a shared libperl.$so. If you will have more than one executable linked
7882 to libperl.$so, this will significantly reduce the size of each
7883 executable, but it may have a noticeable effect on performance. The
7884 default is probably sensible for your system.
7888 rp="Build a shared libperl.$so (y/n)"
7892 useshrplib='true' ;;
7893 *) useshrplib='false' ;;
7898 case "$useshrplib" in
7902 # Figure out a good name for libperl.so. Since it gets stored in
7903 # a version-specific architecture-dependent library, the version
7904 # number isn't really that important, except for making cc/ld happy.
7906 # A name such as libperl.so.3.1
7907 majmin="libperl.$so.$patchlevel.$subversion"
7908 # A name such as libperl.so.301
7909 majonly=`echo $patchlevel $subversion |
7910 $awk '{printf "%d%02d", $1, $2}'`
7911 majonly=libperl.$so.$majonly
7912 # I'd prefer to keep the os-specific stuff here to a minimum, and
7913 # rely on figuring it out from the naming of libc.
7914 case "${osname}${osvers}" in
7917 # XXX How handle the --version stuff for MAB?
7919 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
7922 cygwin*) # ld links against an importlib
7923 dflt=libperl$lib_ext
7925 *) # Try to guess based on whether libc has major.minor.
7927 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
7928 *libc.$so.[0-9]*) dflt=$majonly ;;
7929 *) dflt=libperl.$so ;;
7939 I need to select a good name for the shared libperl. If your system uses
7940 library names with major and minor numbers, then you might want something
7941 like $majmin. Alternatively, if your system uses a single version
7942 number for shared libraries, then you might want to use $majonly.
7943 Or, your system might be quite happy with a simple libperl.$so.
7945 Since the shared libperl will get installed into a version-specific
7946 architecture-dependent directory, the version number of the shared perl
7947 library probably isn't important, so the default should be o.k.
7950 rp='What name do you want to give to the shared libperl?'
7953 echo "Ok, I'll use $libperl"
7956 libperl="libperl${_a}"
7960 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
7964 WARNING: Use of the shrpdir variable for the installation location of
7965 the shared $libperl is not supported. It was never documented and
7966 will not work in this version. Let me (perlbug@perl.org)
7967 know of any problems this may cause.
7973 But your current setting of $shrpdir is
7974 the default anyway, so it's harmless.
7979 Further, your current attempted setting of $shrpdir
7980 conflicts with the value of $archlibexp/CORE
7981 that installperl will use.
7988 # How will the perl executable find the installed shared $libperl?
7989 # Add $xxx to ccdlflags.
7990 # If we can't figure out a command-line option, use $shrpenv to
7991 # set env LD_RUN_PATH. The main perl makefile uses this.
7992 shrpdir=$archlibexp/CORE
7995 if "$useshrplib"; then
7998 # We'll set it in Makefile.SH...
8003 freebsd|netbsd|openbsd|interix|dragonfly)
8004 xxx="-Wl,-R$shrpdir"
8006 bsdos|linux|irix*|dec_osf|gnu*)
8007 xxx="-Wl,-rpath,$shrpdir"
8010 # next doesn't like the default...
8013 # beos doesn't like the default, either.
8016 # hpux doesn't like the default, either.
8017 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8020 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8026 # Only add $xxx if it isn't already in ccdlflags.
8027 case " $ccdlflags " in
8029 *) ccdlflags="$ccdlflags $xxx"
8032 Adding $xxx to the flags
8033 passed to $ld so that the perl executable will find the
8034 installed shared $libperl.
8042 # Fix ccdlflags in AIX for building external extensions.
8043 # (For building Perl itself bare -bE:perl.exp is needed,
8044 # Makefile.SH takes care of this.)
8046 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8048 # Respect a hint or command-line value.
8050 '') shrpenv="$tmp_shrpenv" ;;
8052 case "$ldlibpthname" in
8053 '') ldlibpthname=LD_LIBRARY_PATH ;;
8054 none) ldlibpthname='' ;;
8057 : determine where manual pages are on this system
8061 syspath='/usr/share/man/man1 /usr/man/man1'
8062 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8063 syspath="$syspath /usr/man/u_man/man1"
8064 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8065 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8066 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8067 sysman=`./loc . /usr/man/man1 $syspath`
8070 if $test -d "$sysman"; then
8071 echo "System manual is in $sysman." >&4
8073 echo "Could not find manual pages in source form." >&4
8076 : determine where manual pages go
8077 set man1dir man1dir none
8081 $spackage has manual pages available in source form.
8085 echo "However, you don't have nroff, so they're probably useless to you."
8087 '') man1dir="none";;
8090 echo "If you don't want the manual sources installed, answer 'none'."
8095 lookpath="$prefixexp/share/man/man1"
8096 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8097 lookpath="$lookpath $prefixexp/man/p_man/man1"
8098 lookpath="$lookpath $prefixexp/man/u_man/man1"
8099 lookpath="$lookpath $prefixexp/man/man.1"
8101 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8102 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8112 rp="Where do the main $spackage manual pages (source) go?"
8114 if $test "X$man1direxp" != "X$ansexp"; then
8125 : What suffix to use on installed man pages
8132 rp="What suffix should be used for the main $spackage man pages?"
8134 '') case "$man1dir" in
8148 *) dflt="$man1ext";;
8155 : see if we can have long filenames
8157 first=123456789abcdef
8159 if (echo hi >$first) 2>/dev/null; then
8160 if $test -f 123456789abcde; then
8161 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8164 echo 'You can have filenames longer than 14 characters.'>&4
8169 You can't have filenames longer than 14 chars.
8170 You can't even think about them!
8176 $rm -rf 123456789abcde*
8178 : determine where library module manual pages go
8179 set man3dir man3dir none
8183 $spackage has manual pages for many of the library modules.
8189 However, you don't have nroff, so they're probably useless to you.
8192 '') man3dir="none";;
8196 case "$d_flexfnam" in
8199 However, your system can't handle the long file names like File::Basename.3.
8202 '') man3dir="none";;
8206 echo "If you don't want the manual sources installed, answer 'none'."
8207 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8209 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8210 if $test -d "$privlib/man/man3"; then
8213 WARNING: Previous versions of perl installed man3 pages into
8214 $privlib/man/man3. This version will suggest a
8215 new default of $dflt.
8219 rp='Do you wish to preserve the old behavior?(y/n)'
8222 y*) dflt="$privlib/man/man3" ;;
8227 *) dflt="$man3dir" ;;
8234 rp="Where do the $package library man pages (source) go?"
8244 : What suffix to use on installed man pages
8250 rp="What suffix should be used for the $package library man pages?"
8252 '') case "$man3dir" in
8266 *) dflt="$man3ext";;
8273 : see if we have to deal with yellow pages, now NIS.
8274 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8275 if $test -f /usr/etc/nibindd; then
8277 echo "I'm fairly confident you're on a NeXT."
8279 rp='Do you get the hosts file via NetInfo?'
8288 y*) hostcat='nidump hosts .';;
8289 *) case "$hostcat" in
8290 nidump*) hostcat='';;
8300 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8308 rp='Are you getting the hosts file via yellow pages?'
8311 y*) hostcat='ypcat hosts';;
8312 *) hostcat='cat /etc/hosts';;
8318 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8321 '') test -f /etc/group && groupcat='cat /etc/group';;
8324 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8327 : now get the host name
8329 echo "Figuring out host name..." >&4
8330 case "$myhostname" in
8332 echo 'Maybe "hostname" will work...'
8333 if tans=`sh -c hostname 2>&1` ; then
8341 if $test "$cont"; then
8343 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8344 if tans=`cat /etc/systemid 2>&1` ; then
8346 phostname='cat /etc/systemid'
8347 echo "Whadyaknow. Xenix always was a bit strange..."
8350 elif $test -r /etc/systemid; then
8351 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8354 if $test "$cont"; then
8355 echo 'No, maybe "uuname -l" will work...'
8356 if tans=`sh -c 'uuname -l' 2>&1` ; then
8358 phostname='uuname -l'
8360 echo 'Strange. Maybe "uname -n" will work...'
8361 if tans=`sh -c 'uname -n' 2>&1` ; then
8363 phostname='uname -n'
8365 echo 'Oh well, maybe I can mine it out of whoami.h...'
8366 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8367 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8368 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8370 case "$myhostname" in
8371 '') echo "Does this machine have an identity crisis or something?"
8374 echo "Well, you said $myhostname before..."
8375 phostname='echo $myhostname';;
8381 case "$myhostname" in
8382 '') myhostname=noname ;;
8384 : you do not want to know about this
8389 if $test "$myhostname" ; then
8391 rp='Your host name appears to be "'$myhostname'".'" Right?"
8399 : bad guess or no guess
8400 while $test "X$myhostname" = X ; do
8402 rp="Please type the (one word) name of your host:"
8407 : translate upper to lower if necessary
8408 case "$myhostname" in
8410 echo "(Normalizing case in your host name)"
8411 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8415 case "$myhostname" in
8417 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8418 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8419 echo "(Trimming domain name from host name--host name is now $myhostname)"
8421 *) case "$mydomain" in
8424 test "X$hostcat" = "Xypcat hosts" &&
8425 ypmatch "$myhostname" hosts 2>/dev/null |\
8426 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8429 test "X$hostcat" != "X" &&
8430 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8431 /[ ]$myhostname[ . ]/p" > hosts
8434 if $test -f hosts; then
8435 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8436 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8437 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8438 hosts | $sort | $uniq | \
8439 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8440 case `$echo X$dflt` in
8441 X*\ *) echo "(Several hosts in the database matched hostname)"
8444 X.) echo "(You do not have fully-qualified names in the hosts database)"
8448 echo "(I cannot locate a hosts database anywhere)"
8453 tans=`./loc resolv.conf X /etc /usr/etc`
8454 if $test -f "$tans"; then
8455 echo "(Attempting domain name extraction from $tans)"
8456 dflt=.`$sed -n -e 's/ / /g' \
8457 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8458 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8460 .) dflt=.`$sed -n -e 's/ / /g' \
8461 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8462 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8469 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8470 dflt=.`sh -c domainname 2>/dev/null`
8473 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8477 case "$dflt$osname" in
8478 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8479 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8483 .) echo "(Lost all hope -- silly guess then)"
8489 *) dflt="$mydomain";;
8493 rp="What is your domain name?"
8503 : translate upper to lower if necessary
8506 echo "(Normalizing case in your domain name)"
8507 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8511 : a little sanity check here
8512 case "$phostname" in
8515 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8516 $myhostname$mydomain|$myhostname) ;;
8518 case "$phostname" in
8520 echo "(That doesn't agree with your whoami.h file, by the way.)"
8523 echo "(That doesn't agree with your $phostname command, by the way.)"
8533 I need to get your e-mail address in Internet format if possible, i.e.
8534 something like user@host.domain. Please answer accurately since I have
8535 no easy means to double check it. The default value provided below
8536 is most probably close to reality but may not be valid from outside
8537 your organization...
8541 while test "$cont"; do
8543 '') dflt="$cf_by@$myhostname$mydomain";;
8544 *) dflt="$cf_email";;
8546 rp='What is your e-mail address?'
8552 rp='Address does not look like an Internet one. Use it anyway?'
8568 If you or somebody else will be maintaining perl at your site, please
8569 fill in the correct e-mail address here so that they may be contacted
8570 if necessary. Currently, the "perlbug" program included with perl
8571 will send mail to this address in addition to perlbug@perl.org. You may
8572 enter "none" for no administrator.
8575 case "$perladmin" in
8576 '') dflt="$cf_email";;
8577 *) dflt="$perladmin";;
8579 rp='Perl administrator e-mail address'
8583 : determine whether to only install version-specific parts.
8586 Do you want to install only the version-specific parts of the perl
8587 distribution? Usually you do *not* want to do this.
8589 case "$versiononly" in
8590 "$define"|[Yy]*|true) dflt='y' ;;
8593 rp="Do you want to install only the version-specific parts of perl?"
8596 [yY]*) val="$define";;
8602 case "$versiononly" in
8603 "$define") inc_version_list=''
8604 inc_version_list_init=0
8608 : figure out how to guarantee perl startup
8609 : XXX Note that this currently takes advantage of the bug that binexp ignores
8610 : the Configure -Dinstallprefix setting, which in turn means that under
8611 : relocatable @INC, initialinstalllocation is what binexp started as.
8612 case "$startperl" in
8614 case "$sharpbang" in
8618 I can use the #! construct to start perl on your system. This will
8619 make startup of perl scripts faster, but may cause problems if you
8620 want to share those scripts and perl is not in a standard place
8621 ($initialinstalllocation/perl) on all your platforms. The alternative
8622 is to force a shell by starting the script with a single ':' character.
8625 case "$versiononly" in
8626 "$define") dflt="$initialinstalllocation/perl$version";;
8627 *) dflt="$initialinstalllocation/perl";;
8629 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8632 none) startperl=": # use perl";;
8633 *) startperl="#!$ans"
8634 if $test 30 -lt `echo "$ans" | wc -c`; then
8637 WARNING: Some systems limit the #! command to 32 characters.
8638 If you experience difficulty running Perl scripts with #!, try
8639 installing Perl in a directory with a shorter pathname.
8645 *) startperl=": # use perl"
8650 echo "I'll use $startperl to start perl scripts."
8652 : figure best path for perl in scripts
8655 case "$versiononly" in
8656 "$define") perlpath="$initialinstalllocation/perl$version";;
8657 *) perlpath="$initialinstalllocation/perl";;
8659 case "$startperl" in
8664 I will use the "eval 'exec'" idiom to start Perl on your system.
8665 I can use the full path of your Perl binary for this purpose, but
8666 doing so may cause problems if you want to share those scripts and
8667 Perl is not always in a standard place ($initialinstalllocation/perl).
8670 dflt="$initialinstalllocation/perl"
8671 rp="What path shall I use in \"eval 'exec'\"?"
8678 case "$startperl" in
8680 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8683 : determine where public executable scripts go
8684 set scriptdir scriptdir
8686 case "$scriptdir" in
8689 : guess some guesses
8690 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8691 $test -d /usr/share/bin && dflt=/usr/share/bin
8692 $test -d /usr/local/script && dflt=/usr/local/script
8693 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8694 $test -d $prefixexp/script && dflt=$prefixexp/script
8698 *) dflt="$scriptdir"
8703 Some installations have a separate directory just for executable scripts so
8704 that they can mount it across multiple architectures but keep the scripts in
8705 one spot. You might, for example, have a subdirectory of /usr/share for this.
8706 Or you might just lump your scripts in with all your other executables.
8710 rp='Where do you keep publicly executable scripts?'
8712 if $test "X$ansexp" != "X$scriptdirexp"; then
8718 : A little fix up for an irregularly named variable.
8719 installscript="$installscriptdir"
8721 : determine where add-on public executables go
8723 '') dflt=$siteprefix/bin ;;
8727 rp='Pathname where the add-on public executables should be installed?'
8732 : determine where add-on html pages go
8733 : There is no standard location, so try to copy the previously-selected
8734 : directory structure for the core html pages.
8735 case "$sitehtml1dir" in
8736 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8737 *) dflt=$sitehtml1dir ;;
8740 ''|' ') dflt=none ;;
8743 rp='Pathname where the site-specific html pages should be installed?'
8745 prefixvar=sitehtml1dir
8748 : determine where add-on library html pages go
8749 : There is no standard location, so try to copy the previously-selected
8750 : directory structure for the core html pages.
8751 case "$sitehtml3dir" in
8752 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8753 *) dflt=$sitehtml3dir ;;
8756 ''|' ') dflt=none ;;
8759 rp='Pathname where the site-specific library html pages should be installed?'
8761 prefixvar=sitehtml3dir
8764 : determine where add-on manual pages go
8765 case "$siteman1dir" in
8766 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
8767 *) dflt=$siteman1dir ;;
8770 ''|' ') dflt=none ;;
8773 rp='Pathname where the site-specific manual pages should be installed?'
8775 prefixvar=siteman1dir
8778 : determine where add-on library man pages go
8779 case "$siteman3dir" in
8780 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
8781 *) dflt=$siteman3dir ;;
8784 ''|' ') dflt=none ;;
8787 rp='Pathname where the site-specific library manual pages should be installed?'
8789 prefixvar=siteman3dir
8792 : determine where add-on public executable scripts go
8793 case "$sitescript" in
8794 '') dflt=$siteprefix/script
8795 $test -d $dflt || dflt=$sitebin ;;
8796 *) dflt="$sitescript" ;;
8799 rp='Pathname where add-on public executable scripts should be installed?'
8801 prefixvar=sitescript
8804 case "$usefaststdio" in
8805 $define|true|[yY]*|'')
8806 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
8816 Perl can be built to use 'fast stdio', which means using the stdio
8817 library but also directly manipulating the stdio buffers to enable
8818 faster I/O. Using stdio is better for backward compatibility (especially
8819 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
8820 interface has been preferred instead of stdio.
8822 If this doesn't make any sense to you, just accept the default '$dflt'.
8824 rp='Use the "fast stdio" if available?'
8827 y|Y) val="$define" ;;
8834 : define an is-a-typedef? function
8835 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8837 "") inclist="sys/types.h";;
8839 eval "varval=\$$var";
8843 for inc in $inclist; do
8844 echo "#include <$inc>" >>temp.c;
8846 echo "#ifdef $type" >> temp.c;
8847 echo "printf(\"We have $type\");" >> temp.c;
8848 echo "#endif" >> temp.c;
8849 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8850 if $contains $type temp.E >/dev/null 2>&1; then
8856 *) eval "$var=\$varval";;
8859 : define an is-a-typedef? function that prompts if the type is not available.
8860 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8862 "") inclist="sys/types.h";;
8864 eval "varval=\$$var";
8868 for inc in $inclist; do
8869 echo "#include <$inc>" >>temp.c;
8871 echo "#ifdef $type" >> temp.c;
8872 echo "printf(\"We have $type\");" >> temp.c;
8873 echo "#endif" >> temp.c;
8874 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8876 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
8877 if $contains $type temp.E >/dev/null 2>&1; then
8878 echo "$type found." >&4;
8881 echo "$type NOT found." >&4;
8887 *) eval "$var=\$varval";;
8890 : see what type lseek is declared as in the kernel
8891 rp="What is the type used for lseek's offset on this system?"
8892 set off_t lseektype long stdio.h sys/types.h
8896 echo "Checking to see how big your file offsets are..." >&4
8898 #include <sys/types.h>
8902 printf("%d\n", (int)sizeof($lseektype));
8907 if eval $compile_ok; then
8908 lseeksize=`$run ./try`
8909 echo "Your file offsets are $lseeksize bytes long."
8913 echo "(I can't seem to compile the test program. Guessing...)"
8914 rp="What is the size of your file offsets (in bytes)?"
8920 : see what type file positions are declared as in the library
8921 rp="What is the type for file position used by fsetpos()?"
8922 set fpos_t fpostype long stdio.h sys/types.h
8927 *_t) zzz="$fpostype" ;;
8930 echo "Checking the size of $zzz..." >&4
8932 #include <sys/types.h>
8939 printf("%d\n", (int)sizeof($fpostype));
8944 if eval $compile_ok; then
8948 echo "(I can't execute the test program--guessing $fpossize.)" >&4
8951 echo "Your $zzz is $fpossize bytes long."
8957 echo "(I can't compile the test program. Guessing...)" >&4
8958 rp="What is the size of your file positions (in bytes)?"
8963 # Backward compatibility (uselfs is deprecated).
8965 "$define"|true|[yY]*)
8968 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
8970 uselargefiles="$define"
8974 case "$lseeksize:$fpossize" in
8977 You can have files larger than 2 gigabytes.
8980 *) case "$uselargefiles" in
8981 "$undef"|false|[nN]*) dflt='n' ;;
8986 Perl can be built to understand large files (files larger than 2 gigabytes)
8987 on some systems. To do so, Configure can be run with -Duselargefiles.
8989 If this doesn't make any sense to you, just accept the default '$dflt'.
8991 rp='Try to understand large files, if available?'
8994 y|Y) val="$define" ;;
9001 : Look for a hint-file generated 'call-back-unit'. If the
9002 : user has specified that a large files perl is to be built,
9003 : we may need to set or change some other defaults.
9004 if $test -f uselargefiles.cbu; then
9005 echo "Your platform has some specific hints regarding large file builds, using them..."
9006 . ./uselargefiles.cbu
9008 case "$uselargefiles" in
9010 if $test -f uselargefiles.cbu; then
9012 echo "Rechecking to see how big your file offsets are..." >&4
9014 #include <sys/types.h>
9018 printf("%d\n", (int)sizeof($lseektype));
9023 if eval $compile_ok; then
9024 lseeksize=`$run ./try`
9025 $echo "Your file offsets are now $lseeksize bytes long."
9029 echo "(I can't seem to compile the test program. Guessing...)"
9030 rp="What is the size of your file offsets (in bytes)?"
9035 *_t) zzz="$fpostype" ;;
9038 $echo $n "Rechecking the size of $zzz...$c" >&4
9040 #include <sys/types.h>
9047 printf("%d\n", (int)sizeof($fpostype));
9052 if eval $compile_ok; then
9057 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9060 echo " $fpossize bytes." >&4
9066 echo "(I can't compile the test program. Guessing...)" >&4
9067 rp="What is the size of your file positions (in bytes)?"
9076 case "$vendorprefix" in
9077 '') d_vendorbin="$undef"
9081 *) d_vendorbin="$define"
9082 : determine where vendor-supplied executables go.
9083 case "$vendorbin" in
9084 '') dflt=$vendorprefix/bin ;;
9085 *) dflt="$vendorbin" ;;
9088 rp='Pathname for the vendor-supplied executables directory?'
9091 vendorbinexp="$ansexp"
9097 case "$vendorprefix" in
9098 '') vendorhtml1dir=''
9099 vendorhtml1direxp=''
9101 *) : determine where vendor-supplied html pages go.
9102 : There is no standard location, so try to copy the previously-selected
9103 : directory structure for the core html pages.
9104 : XXX Better default suggestions would be welcome.
9105 case "$vendorhtml1dir" in
9106 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9107 *) dflt=$vendorhtml1dir ;;
9110 ''|' ') dflt=none ;;
9113 rp='Pathname for the vendor-supplied html pages?'
9115 vendorhtml1dir="$ans"
9116 vendorhtml1direxp="$ansexp"
9119 : Use ' ' for none so value is preserved next time through Configure
9120 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9121 prefixvar=vendorhtml1dir
9124 case "$vendorprefix" in
9125 '') vendorhtml3dir=''
9126 vendorhtml3direxp=''
9128 *) : determine where vendor-supplied module html pages go.
9129 : There is no standard location, so try to copy the previously-selected
9130 : directory structure for the core html pages.
9131 : XXX Better default suggestions would be welcome.
9132 case "$vendorhtml3dir" in
9133 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9134 *) dflt=$vendorhtml3dir ;;
9137 ''|' ') dflt=none ;;
9140 rp='Pathname for the vendor-supplied html pages?'
9142 vendorhtml3dir="$ans"
9143 vendorhtml3direxp="$ansexp"
9146 : Use ' ' for none so value is preserved next time through Configure
9147 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9148 prefixvar=vendorhtml3dir
9151 case "$vendorprefix" in
9152 '') vendorman1dir=''
9155 *) : determine where vendor-supplied manual pages go.
9156 case "$vendorman1dir" in
9157 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9158 *) dflt=$vendorman1dir ;;
9161 ''|' ') dflt=none ;;
9164 rp='Pathname for the vendor-supplied manual section 1 pages?'
9166 vendorman1dir="$ans"
9167 vendorman1direxp="$ansexp"
9170 : Use ' ' for none so value is preserved next time through Configure
9171 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9172 prefixvar=vendorman1dir
9175 case "$vendorprefix" in
9176 '') vendorman3dir=''
9179 *) : determine where vendor-supplied module manual pages go.
9180 case "$vendorman3dir" in
9181 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9182 *) dflt=$vendorman3dir ;;
9185 ''|' ') dflt=none ;;
9188 rp='Pathname for the vendor-supplied manual section 3 pages?'
9190 vendorman3dir="$ans"
9191 vendorman3direxp="$ansexp"
9194 : Use ' ' for none so value is preserved next time through Configure
9195 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9196 prefixvar=vendorman3dir
9199 case "$vendorprefix" in
9200 '') d_vendorscript="$undef"
9204 *) d_vendorscript="$define"
9205 : determine where vendor-supplied scripts go.
9206 case "$vendorscript" in
9207 '') dflt=$vendorprefix/script
9208 $test -d $dflt || dflt=$vendorbin ;;
9209 *) dflt="$vendorscript" ;;
9213 The installation process will create a directory for
9214 vendor-supplied scripts.
9218 rp='Pathname for the vendor-supplied scripts directory?'
9221 vendorscriptexp="$ansexp"
9224 prefixvar=vendorscript
9227 : see if qgcvt exists
9233 if $test X"$d_longdbl" = X"$define"; then
9235 echo "Checking how to print long doubles..." >&4
9237 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9238 $cat >try.c <<'EOCP'
9239 #include <sys/types.h>
9243 printf("%.3f\n", d);
9247 if eval $compile; then
9251 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9252 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9253 echo "We will use %f."
9259 if $test X"$sPRIfldbl" = X; then
9260 $cat >try.c <<'EOCP'
9261 #include <sys/types.h>
9264 long double d = 123.456;
9265 printf("%.3Lf\n", d);
9269 if eval $compile; then
9273 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9274 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9275 echo "We will use %Lf."
9281 if $test X"$sPRIfldbl" = X; then
9282 $cat >try.c <<'EOCP'
9283 #include <sys/types.h>
9286 long double d = 123.456;
9287 printf("%.3llf\n", d);
9291 if eval $compile; then
9295 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9296 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9297 echo "We will use %llf."
9303 if $test X"$sPRIfldbl" = X; then
9304 $cat >try.c <<'EOCP'
9305 #include <sys/types.h>
9308 long double d = 123.456;
9309 printf("%.3lf\n", d);
9313 if eval $compile; then
9317 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9318 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9319 echo "We will use %lf."
9325 if $test X"$sPRIfldbl" = X; then
9326 echo "Cannot figure out how to print long doubles." >&4
9328 sSCNfldbl=$sPRIfldbl # expect consistency
9335 case "$sPRIfldbl" in
9336 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9337 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9338 d_SCNfldbl="$undef";
9340 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9341 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9342 d_SCNfldbl="$define";
9346 : Check how to convert floats to strings.
9348 if test "X$d_Gconvert" = X; then
9351 echo "Checking for an efficient way to convert floats to strings."
9353 case "$uselongdouble" in
9354 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9356 case "$d_longdbl" in
9357 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9359 case "$d_PRIgldbl" in
9360 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9364 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9365 char *myname = "gconvert";
9368 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9369 char *myname = "gcvt";
9372 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9373 char *myname = "qgcvt";
9374 #define DOUBLETYPE long double
9377 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9379 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9381 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9384 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9386 char *myname = "sprintf";
9390 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9391 #define DOUBLETYPE long double
9393 #define DOUBLETYPE double
9399 #define I_STDLIB $i_stdlib
9405 checkit(expect, got)
9409 if (strcmp(expect, got)) {
9410 printf("%s oddity: Expected %s, got %s\n",
9411 myname, expect, got);
9421 /* This must be 1st test on (which?) platform */
9422 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9423 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9424 checkit("0.1", buf);
9426 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9427 checkit("0.01", buf);
9429 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9430 checkit("0.001", buf);
9432 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9433 checkit("0.0001", buf);
9435 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9436 if (strlen(buf) > 5)
9437 checkit("9e-005", buf); /* for Microsoft ?? */
9439 checkit("9e-05", buf);
9441 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9444 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9445 checkit("1.1", buf);
9447 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9448 checkit("1.01", buf);
9450 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9451 checkit("1.001", buf);
9453 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9454 checkit("1.0001", buf);
9456 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9457 checkit("1.00001", buf);
9459 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9460 checkit("1.000001", buf);
9462 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9465 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9468 /* Some Linux gcvt's give 1.e+5 here. */
9469 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9470 checkit("100000", buf);
9472 /* Some Linux gcvt's give -1.e+5 here. */
9473 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9474 checkit("-100000", buf);
9476 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9477 checkit("123.456", buf);
9479 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9480 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9481 /* 34 should be enough to scare even long double
9482 * places into using the e notation. */
9483 if (strlen(buf) > 5)
9484 checkit("1e+034", buf); /* for Microsoft */
9486 checkit("1e+34", buf);
9488 /* For Perl, if you add additional tests here, also add them to
9489 * t/base/num.t for benefit of platforms not using Configure or
9490 * overriding d_Gconvert */
9495 : first add preferred functions to our list
9497 for xxx_convert in $gconvert_preference; do
9498 case $xxx_convert in
9499 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9500 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9503 : then add any others
9504 for xxx_convert in gconvert gcvt sprintf; do
9507 *) xxx_list="$xxx_list $xxx_convert" ;;
9511 case "$d_longdbl$uselongdouble" in
9513 : again, add prefered functions to our list first
9515 for xxx_convert in $gconvert_ld_preference; do
9516 case $xxx_convert in
9517 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9518 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9521 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9522 for xxx_convert in qgcvt sprintf $xxx_list; do
9523 case "$xxx_ld_list" in
9524 $xxx_convert*|*" $xxx_convert"*) ;;
9525 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9528 : if sprintf cannot do long doubles, move it to the end
9529 if test "$d_PRIgldbl" != "$define"; then
9530 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9532 : if no qgcvt, remove it
9533 if test "$d_qgcvt" != "$define"; then
9534 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9537 xxx_list="$xxx_ld_list"
9541 for xxx_convert in $xxx_list; do
9542 echo "Trying $xxx_convert..."
9544 set try -DTRY_$xxx_convert
9545 if eval $compile; then
9546 echo "$xxx_convert() found." >&4
9548 echo "I'll use $xxx_convert to convert floats into a string." >&4
9551 echo "...But $xxx_convert didn't work as I expected."
9555 echo "$xxx_convert NOT found." >&4
9559 if test X$xxx_convert = X; then
9560 echo "*** WHOA THERE!!! ***" >&4
9561 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9565 case "$xxx_convert" in
9566 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9567 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9568 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9569 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9570 "$define$define$define")
9571 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9572 "$define$define$undef")
9573 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9574 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9581 : see if _fwalk exists
9585 : Initialize h_fcntl
9588 : Initialize h_sysfile
9591 : access call always available on UNIX
9595 : locate the flags for 'access()'
9599 $cat >access.c <<EOCP
9600 #include <sys/types.h>
9605 #include <sys/file.h>
9618 : check sys/file.h first, no particular reason here
9619 if $test `./findhdr sys/file.h` && \
9620 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9622 echo "<sys/file.h> defines the *_OK access constants." >&4
9623 elif $test `./findhdr fcntl.h` && \
9624 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9626 echo "<fcntl.h> defines the *_OK access constants." >&4
9627 elif $test `./findhdr unistd.h` && \
9628 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9629 echo "<unistd.h> defines the *_OK access constants." >&4
9631 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9637 : see if accessx exists
9638 set accessx d_accessx
9641 : see if aintl exists
9645 : see if alarm exists
9649 : see if POSIX threads are available
9650 set pthread.h i_pthread
9653 : define a fucntion to check prototypes
9654 $cat > protochk <<EOSH
9657 optimize="$optimize"
9659 prototype="$prototype"
9662 usethreads=$usethreads
9663 i_pthread=$i_pthread
9664 pthread_h_first=$pthread_h_first
9667 $cat >> protochk <<'EOSH'
9672 while test $# -ge 2; do
9674 $define) echo "#include <$2>" >> try.c ;;
9675 literal) echo "$2" >> try.c ;;
9677 # Extra magic for the benefit of systems that need pthread.h
9678 # to be included early to correctly detect threadsafe functions.
9679 # Such functions must guarantee themselves, though, that the usethreads
9680 # and i_pthread have been defined, before calling protochk.
9681 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
9682 echo "#include <pthread.h>" >> try.c
9687 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
9688 cat >> try.c <<'EOCP'
9689 #ifdef CAN_PROTOTYPE
9690 #define _(args) args
9695 echo "$foo" >> try.c
9696 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
9697 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
9705 hasproto='varname=$1; func=$2; shift; shift;
9706 while $test $# -ge 2; do
9708 $define) echo "#include <$2>";;
9712 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
9713 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
9714 echo "$func() prototype found.";
9717 echo "$func() prototype NOT found.";
9722 $rm -f try.c tryout.c'
9724 : see if sys/types.h has to be included
9725 set sys/types.h i_systypes
9728 : see if sys/select.h has to be included
9729 set sys/select.h i_sysselct
9732 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
9733 while $test $# -ge 2; do
9735 $define) echo "#include <$2>";;
9739 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
9741 if eval $compile; then
9750 : see if we should include time.h, sys/time.h, or both
9752 if test "X$timeincl" = X; then
9753 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9754 $echo $n "I'm now running the test program...$c"
9756 #include <sys/types.h>
9761 #ifdef SYSTIMEKERNEL
9764 #include <sys/time.h>
9767 #include <sys/select.h>
9780 struct timezone tzp;
9782 if (foo.tm_sec == foo.tm_sec)
9785 if (bar.tv_sec == bar.tv_sec)
9792 for s_timezone in '-DS_TIMEZONE' ''; do
9794 for s_timeval in '-DS_TIMEVAL' ''; do
9795 for i_systimek in '' '-DSYSTIMEKERNEL'; do
9796 for i_time in '' '-DI_TIME'; do
9797 for i_systime in '-DI_SYSTIME' ''; do
9800 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
9801 if eval $compile; then
9802 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
9806 $echo $n "Succeeded with $flags$c"
9818 *SYSTIMEKERNEL*) i_systimek="$define"
9819 timeincl=`./findhdr sys/time.h`
9820 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
9821 *) i_systimek="$undef";;
9824 *I_TIME*) i_time="$define"
9825 timeincl=`./findhdr time.h`" $timeincl"
9826 echo "We'll include <time.h>." >&4;;
9827 *) i_time="$undef";;
9830 *I_SYSTIME*) i_systime="$define"
9831 timeincl=`./findhdr sys/time.h`" $timeincl"
9832 echo "We'll include <sys/time.h>." >&4;;
9833 *) i_systime="$undef";;
9837 : see if struct tm knows about tm_zone
9838 case "$i_systime$i_time" in
9841 echo "Checking to see if your struct tm has tm_zone field..." >&4
9842 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
9850 case "$d_tm_tm_zone" in
9851 "$define") echo "Yes, it does." ;;
9852 *) echo "No, it doesn't." ;;
9854 : see if struct tm knows about tm_gmtoff
9855 case "$i_systime$i_time" in
9858 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
9859 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
9867 case "$d_tm_tm_gmtoff" in
9868 "$define") echo "Yes, it does." ;;
9869 *) echo "No, it doesn't." ;;
9872 : see if asctime_r exists
9873 set asctime_r d_asctime_r
9875 case "$d_asctime_r" in
9877 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
9878 case "$d_asctime_r_proto:$usethreads" in
9879 ":define") d_asctime_r_proto=define
9880 set d_asctime_r_proto asctime_r $hdrs
9884 case "$d_asctime_r_proto" in
9886 case "$asctime_r_proto" in
9887 ''|0) try='char* asctime_r(const struct tm*, char*);'
9888 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SB ;;
9890 case "$asctime_r_proto" in
9891 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
9892 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SBI ;;
9894 case "$asctime_r_proto" in
9895 ''|0) try='int asctime_r(const struct tm*, char*);'
9896 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SB ;;
9898 case "$asctime_r_proto" in
9899 ''|0) try='int asctime_r(const struct tm*, char*, int);'
9900 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SBI ;;
9902 case "$asctime_r_proto" in
9903 ''|0) d_asctime_r=undef
9905 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
9906 * ) case "$asctime_r_proto" in
9907 REENTRANT_PROTO*) ;;
9908 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
9910 echo "Prototype: $try" ;;
9913 *) case "$usethreads" in
9914 define) echo "asctime_r has no prototype, not using it." >&4 ;;
9921 *) asctime_r_proto=0
9925 : see if atolf exists
9929 : see if atoll exists
9933 : Look for GCC-style attribute format
9934 case "$d_attribute_format" in
9937 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
9938 $cat >attrib.c <<'EOCP'
9940 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
9942 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9943 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9944 echo "Your C compiler doesn't support __attribute__((format))."
9947 echo "Your C compiler supports __attribute__((format))."
9951 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9955 *) val="$d_attribute_format" ;;
9957 set d_attribute_format
9961 : Look for GCC-style attribute malloc
9962 case "$d_attribute_malloc" in
9965 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
9966 $cat >attrib.c <<'EOCP'
9968 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
9970 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9971 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9972 echo "Your C compiler doesn't support __attribute__((malloc))."
9975 echo "Your C compiler supports __attribute__((malloc))."
9979 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9983 *) val="$d_attribute_malloc" ;;
9985 set d_attribute_malloc
9989 : Look for GCC-style attribute nonnull
9990 case "$d_attribute_nonnull" in
9993 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
9994 $cat >attrib.c <<'EOCP'
9996 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
9998 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9999 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10000 echo "Your C compiler doesn't support __attribute__((nonnull))."
10003 echo "Your C compiler supports __attribute__((nonnull))."
10007 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10011 *) val="$d_attribute_nonnull" ;;
10013 set d_attribute_nonnull
10017 : Look for GCC-style attribute noreturn
10018 case "$d_attribute_noreturn" in
10021 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10022 $cat >attrib.c <<'EOCP'
10024 void fall_over_dead( void ) __attribute__((noreturn));
10026 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10027 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10028 echo "Your C compiler doesn't support __attribute__((noreturn))."
10031 echo "Your C compiler supports __attribute__((noreturn))."
10035 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10039 *) val="$d_attribute_noreturn" ;;
10041 set d_attribute_noreturn
10045 : Look for GCC-style attribute pure
10046 case "$d_attribute_pure" in
10049 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10050 $cat >attrib.c <<'EOCP'
10052 int square( int n ) __attribute__((pure));
10054 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10055 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10056 echo "Your C compiler doesn't support __attribute__((pure))."
10059 echo "Your C compiler supports __attribute__((pure))."
10063 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10067 *) val="$d_attribute_pure" ;;
10069 set d_attribute_pure
10073 : Look for GCC-style attribute unused
10074 case "$d_attribute_unused" in
10077 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10078 $cat >attrib.c <<'EOCP'
10080 int do_something( int dummy __attribute__((unused)), int n );
10082 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10083 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10084 echo "Your C compiler doesn't support __attribute__((unused))."
10087 echo "Your C compiler supports __attribute__((unused))."
10091 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10095 *) val="$d_attribute_unused" ;;
10097 set d_attribute_unused
10101 : Look for GCC-style attribute warn_unused_result
10102 case "$d_attribute_warn_unused_result" in
10105 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10106 $cat >attrib.c <<'EOCP'
10108 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10110 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10111 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10112 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10115 echo "Your C compiler supports __attribute__((warn_unused_result))."
10119 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10123 *) val="$d_attribute_warn_unused_result" ;;
10125 set d_attribute_warn_unused_result
10129 : see if bcmp exists
10133 : see if bcopy exists
10137 : see if getpgrp exists
10138 set getpgrp d_getpgrp
10141 case "$d_getpgrp" in
10144 echo "Checking to see which flavor of getpgrp is in use..."
10146 #$i_unistd I_UNISTD
10147 #include <sys/types.h>
10149 # include <unistd.h>
10151 #$i_stdlib I_STDLIB
10153 #include <stdlib.h>
10157 if (getuid() == 0) {
10158 printf("(I see you are running Configure as super-user...)\n");
10161 #ifdef TRY_BSD_PGRP
10162 if (getpgrp(1) == 0)
10171 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10172 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10174 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10175 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10178 echo "I can't seem to compile and run the test program."
10180 xxx="a USG one, i.e. you use getpgrp()."
10182 # SVR4 systems can appear rather BSD-ish.
10183 case "$i_unistd" in
10185 xxx="a BSD one, i.e. you use getpgrp(pid)."
10189 xxx="probably a USG one, i.e. you use getpgrp()."
10194 echo "Assuming your getpgrp is $xxx" >&4
10203 : see if setpgrp exists
10204 set setpgrp d_setpgrp
10207 case "$d_setpgrp" in
10210 echo "Checking to see which flavor of setpgrp is in use..."
10212 #$i_unistd I_UNISTD
10213 #include <sys/types.h>
10215 # include <unistd.h>
10217 #$i_stdlib I_STDLIB
10219 #include <stdlib.h>
10223 if (getuid() == 0) {
10224 printf("(I see you are running Configure as super-user...)\n");
10227 #ifdef TRY_BSD_PGRP
10228 if (-1 == setpgrp(1, 1))
10231 if (setpgrp() != -1)
10237 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10238 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10240 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10241 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10244 echo "(I can't seem to compile and run the test program.)"
10246 xxx="a USG one, i.e. you use setpgrp()."
10248 # SVR4 systems can appear rather BSD-ish.
10249 case "$i_unistd" in
10251 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10255 xxx="probably a USG one, i.e. you use setpgrp()."
10260 echo "Assuming your setpgrp is $xxx" >&4
10268 : Look for GCC-style __builtin_choose_expr
10269 case "$d_builtin_choose_expr" in
10272 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10273 $cat >try.c <<'EOCP'
10274 #include <assert.h>
10275 #include <stdlib.h>
10278 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10281 assert( SYRINX(1) == 2112 );
10282 assert( SYRINX(1) != 5150 );
10283 assert( SYRINX(0) == 5150 );
10284 assert( SYRINX(0) != 2112 );
10285 puts( "All good!" );
10291 if eval $compile; then
10292 echo "Your C compiler supports __builtin_choose_expr."
10295 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10299 *) val="$d_builtin_choose_expr" ;;
10302 set d_builtin_choose_expr
10304 $rm -f try.* try core core.try.*
10306 : Look for GCC-style __builtin_expect
10307 case "$d_builtin_expect" in
10310 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10311 $cat >builtin.c <<'EOCP'
10314 if ( __builtin_expect(n, 0) ) n = 1;
10318 if eval $compile; then
10319 echo "Your C compiler supports __builtin_choose_expr."
10322 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10326 *) val="$d_builtin_expect" ;;
10329 set d_builtin_expect
10331 $rm -f try.* try core core.try.*
10333 : see if bzero exists
10337 : see if stdarg is available
10339 if $test `./findhdr stdarg.h`; then
10340 echo "<stdarg.h> found." >&4
10343 echo "<stdarg.h> NOT found." >&4
10347 : see if varags is available
10349 if $test `./findhdr varargs.h`; then
10350 echo "<varargs.h> found." >&4
10352 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
10355 : set up the varargs testing programs
10356 $cat > varargs.c <<EOP
10358 #include <stdarg.h>
10361 #include <varargs.h>
10365 int f(char *p, ...)
10379 p = va_arg(ap, char *);
10385 $cat > varargs <<EOP
10387 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
10396 : now check which varargs header should be included
10401 if `./varargs I_STDARG`; then
10403 elif `./varargs I_VARARGS`; then
10408 if `./varargs I_VARARGS`; then
10415 echo "I could not find the definition for va_dcl... You have problems..." >&4
10416 val="$undef"; set i_stdarg; eval $setvar
10417 val="$undef"; set i_varargs; eval $setvar
10422 case "$i_varhdr" in
10424 val="$define"; set i_stdarg; eval $setvar
10425 val="$undef"; set i_varargs; eval $setvar
10428 val="$undef"; set i_stdarg; eval $setvar
10429 val="$define"; set i_varargs; eval $setvar
10432 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
10436 : see if the Compiler supports C99 variadic macros
10437 case "$i_stdarg$i_stdlib" in
10439 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
10442 #include <stdarg.h>
10444 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
10448 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
10454 if eval $compile && $run ./try 2>&1 >/dev/null; then
10455 case "`$run ./try`" in
10457 echo "You have C99 variadic macros." >&4
10458 d_c99_variadic_macros="$define"
10461 echo "You don't have functional C99 variadic macros." >&4
10462 d_c99_variadic_macros="$undef"
10466 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
10467 d_c99_variadic_macros="$undef"
10469 $rm -f try.* try core core.try.*
10472 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
10473 d_c99_variadic_macros="$undef"
10477 : see if signal is declared as pointer to function returning int or void
10479 xxx=`./findhdr signal.h`
10480 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10481 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10482 echo "You have int (*signal())() instead of void." >&4
10484 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10485 echo "You have void (*signal())()." >&4
10487 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10488 echo "You have int (*signal())() instead of void." >&4
10490 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10491 echo "You have void (*signal())()." >&4
10494 case "$d_voidsig" in
10496 echo "I can't determine whether signal handler returns void or int..." >&4
10498 rp="What type does your signal handler return?"
10501 v*) val="$define";;
10505 echo "As you already told me, signal handler returns void." >&4
10508 *) echo "As you already told me, signal handler returns int." >&4
10515 case "$d_voidsig" in
10516 "$define") signal_t="void";;
10517 *) signal_t="int";;
10521 : check for ability to cast large floats to 32-bit ints.
10523 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10524 if $test "$intsize" -ge 4; then
10531 #$i_stdlib I_STDLIB
10533 #include <stdlib.h>
10535 #include <sys/types.h>
10536 #include <signal.h>
10537 $signal_t blech(int s) { exit(3); }
10544 signal(SIGFPE, blech);
10546 /* Don't let compiler optimize the test away. Store the number
10547 in a writable string for gcc to pass to sscanf under HP/UX.
10549 sprintf(str, "2147483647");
10550 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
10554 /* x86 processors will probably give 0x8000 0000, which is a
10555 sign change. We don't want that. We want to mimic SPARC
10556 behavior here, which is to preserve the sign and give
10559 if (i32 != ($xxx) f)
10565 if eval $compile_ok; then
10569 echo "(I can't seem to compile the test program--assuming it can't)"
10574 echo "Yup, it can."
10577 echo "Nope, it can't."
10584 : check for ability to cast negative floats to unsigned
10586 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
10589 #$i_stdlib I_STDLIB
10591 #include <stdlib.h>
10593 #include <sys/types.h>
10594 #include <signal.h>
10595 $signal_t blech(int s) { exit(7); }
10596 $signal_t blech_in_list(int s) { exit(4); }
10597 unsigned long dummy_long(unsigned long p) { return p; }
10598 unsigned int dummy_int(unsigned int p) { return p; }
10599 unsigned short dummy_short(unsigned short p) { return p; }
10603 unsigned long along;
10605 unsigned short ashort;
10609 /* Frustrate gcc-2.7.2's optimizer which failed this test with
10610 a direct f = -123. assignment. gcc-2.8.0 reportedly
10611 optimized the whole file away
10613 /* Store the number in a writable string for gcc to pass to
10614 sscanf under HP/UX.
10616 sprintf(str, "-123");
10617 sscanf(str, "%lf", &f); /* f = -123.; */
10619 signal(SIGFPE, blech);
10620 along = (unsigned long)f;
10621 aint = (unsigned int)f;
10622 ashort = (unsigned short)f;
10623 if (along != (unsigned long)-123)
10625 if (aint != (unsigned int)-123)
10627 if (ashort != (unsigned short)-123)
10629 sprintf(str, "1073741824.");
10630 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
10633 along = (unsigned long)f;
10634 if (along != 0x80000000)
10638 along = (unsigned long)f;
10639 if (along != 0x7fffffff)
10643 along = (unsigned long)f;
10644 if (along != 0x80000001)
10648 signal(SIGFPE, blech_in_list);
10649 sprintf(str, "123.");
10650 sscanf(str, "%lf", &f); /* f = 123.; */
10651 along = dummy_long((unsigned long)f);
10652 aint = dummy_int((unsigned int)f);
10653 ashort = dummy_short((unsigned short)f);
10654 if (along != (unsigned long)123)
10656 if (aint != (unsigned int)123)
10658 if (ashort != (unsigned short)123)
10665 if eval $compile_ok; then
10669 echo "(I can't seem to compile the test program--assuming it can't)"
10672 case "$castflags" in
10674 echo "Yup, it can."
10677 echo "Nope, it can't."
10684 : see if vprintf exists
10686 if set vprintf val -f d_vprintf; eval $csym; $val; then
10687 echo 'vprintf() found.' >&4
10690 #include <varargs.h>
10691 #$i_stdlib I_STDLIB
10693 #include <stdlib.h>
10696 int main() { xxx("foo"); }
10705 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
10709 if eval $compile && $run ./try; then
10710 echo "Your vsprintf() returns (int)." >&4
10713 echo "Your vsprintf() returns (char*)." >&4
10717 echo 'vprintf() NOT found.' >&4
10728 : see if chown exists
10732 : see if chroot exists
10733 set chroot d_chroot
10736 : see if chsize exists
10737 set chsize d_chsize
10740 : see if class exists
10744 : see if clearenv exists
10745 set clearenv d_clearenv
10748 hasstruct='varname=$1; struct=$2; shift; shift;
10749 while $test $# -ge 2; do
10751 $define) echo "#include <$2>";;
10755 echo "int main () { struct $struct foo; }" >> try.c;
10757 if eval $compile; then
10764 $rm -f try.c try.o'
10768 : see whether socket exists
10770 $echo $n "Hmm... $c" >&4
10771 if set socket val -f d_socket; eval $csym; $val; then
10772 echo "Looks like you have Berkeley networking support." >&4
10774 if set setsockopt val -f; eval $csym; $val; then
10777 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
10778 d_oldsock="$define"
10781 if $contains socklib libc.list >/dev/null 2>&1; then
10782 echo "Looks like you have Berkeley networking support." >&4
10784 : we will have to assume that it supports the 4.2 BSD interface
10787 echo "You don't have Berkeley networking in libc$_a..." >&4
10788 if test "X$d_socket" = "X$define"; then
10789 echo "...but you seem to believe that you have sockets." >&4
10791 for net in net socket
10793 if test -f /usr/lib/lib$net$_a; then
10794 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
10795 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
10796 if $contains socket libc.list >/dev/null 2>&1; then
10801 echo "...but the Wollongong group seems to have hacked it in." >&4
10802 sockethdr="-I/usr/netinclude"
10805 echo "Found Berkeley sockets interface in lib$net." >&4
10806 if $contains setsockopt libc.list >/dev/null 2>&1; then
10809 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
10810 d_oldsock="$define"
10816 if test "X$d_socket" != "X$define"; then
10817 echo "or anywhere else I see." >&4
10825 : see if socketpair exists
10826 set socketpair d_sockpair
10831 echo "Checking the availability of certain socket constants..." >&4
10832 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
10833 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
10835 #include <sys/types.h>
10836 #include <sys/socket.h>
10842 set try; if eval $compile; then
10845 set d_${enum}; eval $setvar
10849 : see if this is a sys/uio.h system
10850 set sys/uio.h i_sysuio
10855 echo "Checking to see if your system supports struct cmsghdr..." >&4
10856 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
10858 case "$d_cmsghdr_s" in
10859 "$define") echo "Yes, it does." ;;
10860 *) echo "No, it doesn't." ;;
10864 : check for const keyword
10866 echo 'Checking to see if your C compiler knows about "const"...' >&4
10867 $cat >const.c <<'EOCP'
10868 typedef struct spug { int drokk; } spug;
10872 const spug y = { 0 };
10875 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
10877 echo "Yup, it does."
10880 echo "Nope, it doesn't."
10885 : see if copysignl exists
10886 set copysignl d_copysignl
10889 : see if crypt exists
10894 $define) cryptlib='' ;;
10895 *) if set crypt val -f d_crypt; eval $csym; $val; then
10896 echo 'crypt() found.' >&4
10900 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
10901 if $test -z "$cryptlib"; then
10902 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
10906 if $test -z "$cryptlib"; then
10907 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
10911 if $test -z "$cryptlib"; then
10912 cryptlib=`./loc libcrypt$_a "" $libpth`
10916 if $test -z "$cryptlib"; then
10917 echo 'crypt() NOT found.' >&4
10928 : see if this is a crypt.h system
10929 set crypt.h i_crypt
10932 : see if crypt_r exists
10933 set crypt_r d_crypt_r
10935 case "$d_crypt_r" in
10937 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
10938 case "$d_crypt_r_proto:$usethreads" in
10939 ":define") d_crypt_r_proto=define
10940 set d_crypt_r_proto crypt_r $hdrs
10944 case "$d_crypt_r_proto" in
10946 case "$crypt_r_proto" in
10947 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
10948 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCS ;;
10950 case "$crypt_r_proto" in
10951 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
10952 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCD ;;
10954 case "$crypt_r_proto" in
10955 ''|0) d_crypt_r=undef
10957 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
10958 * ) case "$crypt_r_proto" in
10959 REENTRANT_PROTO*) ;;
10960 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
10962 echo "Prototype: $try" ;;
10965 *) case "$usethreads" in
10966 define) echo "crypt_r has no prototype, not using it." >&4 ;;
10977 : get csh whereabouts
10979 'csh') val="$undef" ;;
10980 *) val="$define" ;;
10984 : Respect a hint or command line value for full_csh.
10985 case "$full_csh" in
10986 '') full_csh=$csh ;;
10989 : see if ctermid_r exists
10990 set ctermid_r d_ctermid_r
10992 case "$d_ctermid_r" in
10994 hdrs="$i_systypes sys/types.h define stdio.h "
10995 case "$d_ctermid_r_proto:$usethreads" in
10996 ":define") d_ctermid_r_proto=define
10997 set d_ctermid_r_proto ctermid_r $hdrs
11001 case "$d_ctermid_r_proto" in
11003 case "$ctermid_r_proto" in
11004 ''|0) try='char* ctermid_r(char*);'
11005 ./protochk "extern $try" $hdrs && ctermid_r_proto=B_B ;;
11007 case "$ctermid_r_proto" in
11008 ''|0) d_ctermid_r=undef
11010 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
11011 * ) case "$ctermid_r_proto" in
11012 REENTRANT_PROTO*) ;;
11013 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
11015 echo "Prototype: $try" ;;
11018 *) case "$usethreads" in
11019 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
11026 *) ctermid_r_proto=0
11030 : see if ctime_r exists
11031 set ctime_r d_ctime_r
11033 case "$d_ctime_r" in
11035 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11036 case "$d_ctime_r_proto:$usethreads" in
11037 ":define") d_ctime_r_proto=define
11038 set d_ctime_r_proto ctime_r $hdrs
11042 case "$d_ctime_r_proto" in
11044 case "$ctime_r_proto" in
11045 ''|0) try='char* ctime_r(const time_t*, char*);'
11046 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SB ;;
11048 case "$ctime_r_proto" in
11049 ''|0) try='char* ctime_r(const time_t*, char*, int);'
11050 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SBI ;;
11052 case "$ctime_r_proto" in
11053 ''|0) try='int ctime_r(const time_t*, char*);'
11054 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SB ;;
11056 case "$ctime_r_proto" in
11057 ''|0) try='int ctime_r(const time_t*, char*, int);'
11058 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SBI ;;
11060 case "$ctime_r_proto" in
11061 ''|0) d_ctime_r=undef
11063 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
11064 * ) case "$ctime_r_proto" in
11065 REENTRANT_PROTO*) ;;
11066 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
11068 echo "Prototype: $try" ;;
11071 *) case "$usethreads" in
11072 define) echo "ctime_r has no prototype, not using it." >&4 ;;
11083 : see if cuserid exists
11084 set cuserid d_cuserid
11087 : see if this is a limits.h system
11088 set limits.h i_limits
11091 : see if this is a float.h system
11092 set float.h i_float
11095 : See if number of significant digits in a double precision number is known
11097 $cat >dbl_dig.c <<EOM
11098 #$i_limits I_LIMITS
11101 #include <limits.h>
11107 printf("Contains DBL_DIG");
11110 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
11111 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
11112 echo "DBL_DIG found." >&4
11115 echo "DBL_DIG NOT found." >&4
11122 : see if dbm.h is available
11123 : see if dbmclose exists
11124 set dbmclose d_dbmclose
11127 case "$d_dbmclose" in
11137 *) set rpcsvc/dbm.h i_rpcsvcdbm
11142 *) echo "We won't be including <dbm.h>"
11152 : see if prototype for dbminit is available
11154 set d_dbminitproto dbminit $i_dbm dbm.h
11157 : see if difftime exists
11158 set difftime d_difftime
11161 : see if this is a dirent system
11163 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
11165 echo "<dirent.h> found." >&4
11168 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
11169 echo "<sys/dir.h> found." >&4
11172 xinc=`./findhdr sys/ndir.h`
11174 echo "<dirent.h> NOT found." >&4
11179 : Look for type of directory structure.
11181 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11183 case "$direntrytype" in
11185 case "$i_dirent" in
11186 $define) guess1='struct dirent' ;;
11187 *) guess1='struct direct' ;;
11190 *) guess1="$direntrytype"
11195 'struct dirent') guess2='struct direct' ;;
11196 *) guess2='struct dirent' ;;
11199 if $contains "$guess1" try.c >/dev/null 2>&1; then
11200 direntrytype="$guess1"
11201 echo "Your directory entries are $direntrytype." >&4
11202 elif $contains "$guess2" try.c >/dev/null 2>&1; then
11203 direntrytype="$guess2"
11204 echo "Your directory entries seem to be $direntrytype." >&4
11206 echo "I don't recognize your system's directory entries." >&4
11207 rp="What type is used for directory entries on this system?"
11210 direntrytype="$ans"
11215 : see if the directory entry stores field length
11217 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11218 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
11219 echo "Good, your directory entry keeps length information in d_namlen." >&4
11222 echo "Your directory entry does not know about the d_namlen field." >&4
11229 : see if this is an sysdir system
11230 set sys/dir.h i_sysdir
11233 : see if this is an sysndir system
11234 set sys/ndir.h i_sysndir
11239 $cat >dirfd.c <<EOM
11241 #$i_stdlib I_STDLIB
11243 #include <stdlib.h>
11245 #$i_dirent I_DIRENT /**/
11246 #$i_sysdir I_SYS_DIR /**/
11247 #$i_sysndir I_SYS_NDIR /**/
11248 #$i_systypes I_SYS_TYPES /**/
11249 #if defined(I_SYS_TYPES)
11250 #include <sys/types.h>
11252 #if defined(I_DIRENT)
11253 #include <dirent.h>
11254 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11255 #include <sys/dir.h>
11259 #include <sys/ndir.h>
11263 #include <ndir.h> /* may be wrong in the future */
11265 #include <sys/dir.h>
11271 DIR *dirp = opendir(".");
11272 if (dirfd(dirp) >= 0)
11280 if eval $compile; then
11284 $define) echo "dirfd() found." >&4 ;;
11285 *) echo "dirfd() NOT found." >&4 ;;
11291 : see if dlerror exists
11294 set dlerror d_dlerror
11298 : see if dlfcn is available
11299 set dlfcn.h i_dlfcn
11306 On a few systems, the dynamically loaded modules that perl generates and uses
11307 will need a different extension than shared libs. The default will probably
11313 *) dflt="$dlext" ;;
11315 rp='What is the extension of dynamically loaded modules'
11324 : Check if dlsym need a leading underscore
11330 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11331 $cat >dyna.c <<'EOM'
11338 #$i_stdlib I_STDLIB
11340 #include <stdlib.h>
11344 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
11346 #include <sys/types.h>
11351 extern int fred() ;
11360 int mode = RTLD_LAZY ;
11362 handle = dlopen("./dyna.$dlext", mode) ;
11363 if (handle == NULL) {
11368 symbol = dlsym(handle, "fred") ;
11369 if (symbol == NULL) {
11370 /* try putting a leading underscore */
11371 symbol = dlsym(handle, "_fred") ;
11372 if (symbol == NULL) {
11385 : Call the object file tmp-dyna.o in case dlext=o.
11386 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
11387 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
11388 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
11389 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
11392 1) echo "Test program failed using dlopen." >&4
11393 echo "Perhaps you should not use dynamic loading." >&4;;
11394 2) echo "Test program failed using dlsym." >&4
11395 echo "Perhaps you should not use dynamic loading." >&4;;
11396 3) echo "dlsym needs a leading underscore" >&4
11398 4) echo "dlsym doesn't need a leading underscore." >&4;;
11401 echo "I can't compile and run the test program." >&4
11402 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
11407 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
11412 : see if drand48_r exists
11413 set drand48_r d_drand48_r
11415 case "$d_drand48_r" in
11417 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
11418 case "$d_drand48_r_proto:$usethreads" in
11419 ":define") d_drand48_r_proto=define
11420 set d_drand48_r_proto drand48_r $hdrs
11424 case "$d_drand48_r_proto" in
11426 case "$drand48_r_proto" in
11427 ''|0) try='int drand48_r(struct drand48_data*, double*);'
11428 ./protochk "extern $try" $hdrs && drand48_r_proto=I_ST ;;
11430 case "$drand48_r_proto" in
11431 ''|0) d_drand48_r=undef
11433 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
11434 * ) case "$drand48_r_proto" in
11435 REENTRANT_PROTO*) ;;
11436 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
11438 echo "Prototype: $try" ;;
11441 *) case "$usethreads" in
11442 define) echo "drand48_r has no prototype, not using it." >&4 ;;
11449 *) drand48_r_proto=0
11453 : see if prototype for drand48 is available
11455 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
11458 : see if dup2 exists
11462 : see if eaccess exists
11463 set eaccess d_eaccess
11466 : see if endgrent exists
11467 set endgrent d_endgrent
11470 : see if this is an grp system
11476 xxx=`./findhdr grp.h`
11477 $cppstdin $cppflags $cppminus < $xxx >$$.h
11479 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
11491 set d_grpasswd; eval $setvar
11495 : see if endgrent_r exists
11496 set endgrent_r d_endgrent_r
11498 case "$d_endgrent_r" in
11500 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11501 case "$d_endgrent_r_proto:$usethreads" in
11502 ":define") d_endgrent_r_proto=define
11503 set d_endgrent_r_proto endgrent_r $hdrs
11507 case "$d_endgrent_r_proto" in
11509 case "$endgrent_r_proto" in
11510 ''|0) try='int endgrent_r(FILE**);'
11511 ./protochk "extern $try" $hdrs && endgrent_r_proto=I_H ;;
11513 case "$endgrent_r_proto" in
11514 ''|0) try='void endgrent_r(FILE**);'
11515 ./protochk "extern $try" $hdrs && endgrent_r_proto=V_H ;;
11517 case "$endgrent_r_proto" in
11518 ''|0) d_endgrent_r=undef
11520 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
11521 * ) case "$endgrent_r_proto" in
11522 REENTRANT_PROTO*) ;;
11523 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
11525 echo "Prototype: $try" ;;
11528 *) case "$usethreads" in
11529 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
11536 *) endgrent_r_proto=0
11540 : see if endhostent exists
11541 set endhostent d_endhent
11544 : see if this is a netdb.h system
11545 set netdb.h i_netdb
11548 : see if endhostent_r exists
11549 set endhostent_r d_endhostent_r
11551 case "$d_endhostent_r" in
11553 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11554 case "$d_endhostent_r_proto:$usethreads" in
11555 ":define") d_endhostent_r_proto=define
11556 set d_endhostent_r_proto endhostent_r $hdrs
11560 case "$d_endhostent_r_proto" in
11562 case "$endhostent_r_proto" in
11563 ''|0) try='int endhostent_r(struct hostent_data*);'
11564 ./protochk "extern $try" $hdrs && endhostent_r_proto=I_D ;;
11566 case "$endhostent_r_proto" in
11567 ''|0) try='void endhostent_r(struct hostent_data*);'
11568 ./protochk "extern $try" $hdrs && endhostent_r_proto=V_D ;;
11570 case "$endhostent_r_proto" in
11571 ''|0) d_endhostent_r=undef
11572 endhostent_r_proto=0
11573 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
11574 * ) case "$endhostent_r_proto" in
11575 REENTRANT_PROTO*) ;;
11576 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
11578 echo "Prototype: $try" ;;
11581 *) case "$usethreads" in
11582 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
11584 d_endhostent_r=undef
11585 endhostent_r_proto=0
11589 *) endhostent_r_proto=0
11593 : see if endnetent exists
11594 set endnetent d_endnent
11597 : see if endnetent_r exists
11598 set endnetent_r d_endnetent_r
11600 case "$d_endnetent_r" in
11602 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11603 case "$d_endnetent_r_proto:$usethreads" in
11604 ":define") d_endnetent_r_proto=define
11605 set d_endnetent_r_proto endnetent_r $hdrs
11609 case "$d_endnetent_r_proto" in
11611 case "$endnetent_r_proto" in
11612 ''|0) try='int endnetent_r(struct netent_data*);'
11613 ./protochk "extern $try" $hdrs && endnetent_r_proto=I_D ;;
11615 case "$endnetent_r_proto" in
11616 ''|0) try='void endnetent_r(struct netent_data*);'
11617 ./protochk "extern $try" $hdrs && endnetent_r_proto=V_D ;;
11619 case "$endnetent_r_proto" in
11620 ''|0) d_endnetent_r=undef
11621 endnetent_r_proto=0
11622 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
11623 * ) case "$endnetent_r_proto" in
11624 REENTRANT_PROTO*) ;;
11625 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
11627 echo "Prototype: $try" ;;
11630 *) case "$usethreads" in
11631 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
11633 d_endnetent_r=undef
11634 endnetent_r_proto=0
11638 *) endnetent_r_proto=0
11642 : see if endprotoent exists
11643 set endprotoent d_endpent
11646 : see if endprotoent_r exists
11647 set endprotoent_r d_endprotoent_r
11649 case "$d_endprotoent_r" in
11651 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11652 case "$d_endprotoent_r_proto:$usethreads" in
11653 ":define") d_endprotoent_r_proto=define
11654 set d_endprotoent_r_proto endprotoent_r $hdrs
11658 case "$d_endprotoent_r_proto" in
11660 case "$endprotoent_r_proto" in
11661 ''|0) try='int endprotoent_r(struct protoent_data*);'
11662 ./protochk "extern $try" $hdrs && endprotoent_r_proto=I_D ;;
11664 case "$endprotoent_r_proto" in
11665 ''|0) try='void endprotoent_r(struct protoent_data*);'
11666 ./protochk "extern $try" $hdrs && endprotoent_r_proto=V_D ;;
11668 case "$endprotoent_r_proto" in
11669 ''|0) d_endprotoent_r=undef
11670 endprotoent_r_proto=0
11671 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
11672 * ) case "$endprotoent_r_proto" in
11673 REENTRANT_PROTO*) ;;
11674 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
11676 echo "Prototype: $try" ;;
11679 *) case "$usethreads" in
11680 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
11682 d_endprotoent_r=undef
11683 endprotoent_r_proto=0
11687 *) endprotoent_r_proto=0
11691 : see if endpwent exists
11692 set endpwent d_endpwent
11695 : see if this is a pwd.h system
11701 xxx=`./findhdr pwd.h`
11702 $cppstdin $cppflags $cppminus < $xxx >$$.h
11704 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
11712 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
11720 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
11728 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
11736 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
11744 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
11752 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
11760 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
11772 set d_pwquota; eval $setvar
11773 set d_pwage; eval $setvar
11774 set d_pwchange; eval $setvar
11775 set d_pwclass; eval $setvar
11776 set d_pwexpire; eval $setvar
11777 set d_pwcomment; eval $setvar
11778 set d_pwgecos; eval $setvar
11779 set d_pwpasswd; eval $setvar
11783 : see if endpwent_r exists
11784 set endpwent_r d_endpwent_r
11786 case "$d_endpwent_r" in
11788 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
11789 case "$d_endpwent_r_proto:$usethreads" in
11790 ":define") d_endpwent_r_proto=define
11791 set d_endpwent_r_proto endpwent_r $hdrs
11795 case "$d_endpwent_r_proto" in
11797 case "$endpwent_r_proto" in
11798 ''|0) try='int endpwent_r(FILE**);'
11799 ./protochk "extern $try" $hdrs && endpwent_r_proto=I_H ;;
11801 case "$endpwent_r_proto" in
11802 ''|0) try='void endpwent_r(FILE**);'
11803 ./protochk "extern $try" $hdrs && endpwent_r_proto=V_H ;;
11805 case "$endpwent_r_proto" in
11806 ''|0) d_endpwent_r=undef
11808 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
11809 * ) case "$endpwent_r_proto" in
11810 REENTRANT_PROTO*) ;;
11811 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
11813 echo "Prototype: $try" ;;
11816 *) case "$usethreads" in
11817 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
11824 *) endpwent_r_proto=0
11828 : see if endservent exists
11829 set endservent d_endsent
11832 : see if endservent_r exists
11833 set endservent_r d_endservent_r
11835 case "$d_endservent_r" in
11837 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11838 case "$d_endservent_r_proto:$usethreads" in
11839 ":define") d_endservent_r_proto=define
11840 set d_endservent_r_proto endservent_r $hdrs
11844 case "$d_endservent_r_proto" in
11846 case "$endservent_r_proto" in
11847 ''|0) try='int endservent_r(struct servent_data*);'
11848 ./protochk "extern $try" $hdrs && endservent_r_proto=I_D ;;
11850 case "$endservent_r_proto" in
11851 ''|0) try='void endservent_r(struct servent_data*);'
11852 ./protochk "extern $try" $hdrs && endservent_r_proto=V_D ;;
11854 case "$endservent_r_proto" in
11855 ''|0) d_endservent_r=undef
11856 endservent_r_proto=0
11857 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
11858 * ) case "$endservent_r_proto" in
11859 REENTRANT_PROTO*) ;;
11860 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
11862 echo "Prototype: $try" ;;
11865 *) case "$usethreads" in
11866 define) echo "endservent_r has no prototype, not using it." >&4 ;;
11868 d_endservent_r=undef
11869 endservent_r_proto=0
11873 *) endservent_r_proto=0
11877 : Locate the flags for 'open()'
11880 #include <sys/types.h>
11885 #include <sys/file.h>
11887 #$i_stdlib I_STDLIB
11889 #include <stdlib.h>
11900 : check sys/file.h first to get FREAD on Sun
11901 if $test `./findhdr sys/file.h` && \
11902 set try -DI_SYS_FILE && eval $compile; then
11904 echo "<sys/file.h> defines the O_* constants..." >&4
11905 if $run ./try; then
11906 echo "and you have the 3 argument form of open()." >&4
11909 echo "but not the 3 argument form of open(). Oh, well." >&4
11912 elif $test `./findhdr fcntl.h` && \
11913 set try -DI_FCNTL && eval $compile; then
11915 echo "<fcntl.h> defines the O_* constants..." >&4
11916 if $run ./try; then
11917 echo "and you have the 3 argument form of open()." >&4
11920 echo "but not the 3 argument form of open(). Oh, well." >&4
11925 echo "I can't find the O_* constant definitions! You got problems." >&4
11931 : see which of string.h or strings.h is needed
11933 strings=`./findhdr string.h`
11934 if $test "$strings" && $test -r "$strings"; then
11935 echo "Using <string.h> instead of <strings.h>." >&4
11939 strings=`./findhdr strings.h`
11940 if $test "$strings" && $test -r "$strings"; then
11941 echo "Using <strings.h> instead of <string.h>." >&4
11943 echo "No string header found -- You'll surely have problems." >&4
11948 case "$i_string" in
11949 "$undef") strings=`./findhdr strings.h`;;
11950 *) strings=`./findhdr string.h`;;
11953 : see if this is a sys/file.h system
11958 : do we need to include sys/file.h ?
11962 if $h_sysfile; then
11964 echo "We'll be including <sys/file.h>." >&4
11967 echo "We won't be including <sys/file.h>." >&4
11977 : see if fcntl.h is there
11982 : see if we can include fcntl.h
11988 echo "We'll be including <fcntl.h>." >&4
11991 if $h_sysfile; then
11992 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
11994 echo "We won't be including <fcntl.h>." >&4
12006 : check for non-blocking I/O stuff
12007 case "$h_sysfile" in
12008 true) echo "#include <sys/file.h>" > head.c;;
12011 true) echo "#include <fcntl.h>" > head.c;;
12012 *) echo "#include <sys/fcntl.h>" > head.c;;
12017 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
12018 case "$o_nonblock" in
12020 $cat head.c > try.c
12021 $cat >>try.c <<EOCP
12023 #$i_stdlib I_STDLIB
12025 #include <stdlib.h>
12033 printf("O_NONBLOCK\n");
12037 printf("O_NDELAY\n");
12041 printf("FNDELAY\n");
12048 if eval $compile_ok; then
12049 o_nonblock=`$run ./try`
12050 case "$o_nonblock" in
12051 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
12052 *) echo "Seems like we can use $o_nonblock.";;
12055 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
12058 *) echo "Using $hint value $o_nonblock.";;
12060 $rm -f try try.* .out core
12063 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
12066 $cat head.c > try.c
12067 $cat >>try.c <<EOCP
12069 #include <sys/types.h>
12070 #include <signal.h>
12072 #$i_stdlib I_STDLIB
12074 #include <stdlib.h>
12080 #define MY_O_NONBLOCK $o_nonblock
12081 #ifndef errno /* XXX need better Configure test */
12084 #$i_unistd I_UNISTD
12086 #include <unistd.h>
12088 #$i_string I_STRING
12090 #include <string.h>
12092 #include <strings.h>
12094 $signal_t blech(int x) { exit(3); }
12096 $cat >> try.c <<'EOCP'
12104 pipe(pd); /* Down: child -> parent */
12105 pipe(pu); /* Up: parent -> child */
12108 close(pd[1]); /* Parent reads from pd[0] */
12109 close(pu[0]); /* Parent writes (blocking) to pu[1] */
12111 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
12116 signal(SIGALRM, blech);
12118 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
12120 sprintf(string, "%d\n", ret);
12121 write(2, string, strlen(string));
12124 if (errno == EAGAIN) {
12125 printf("EAGAIN\n");
12130 if (errno == EWOULDBLOCK)
12131 printf("EWOULDBLOCK\n");
12134 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
12135 sleep(2); /* Give it time to close our pipe */
12137 ret = read(pd[0], buf, 1); /* Should read EOF */
12139 sprintf(string, "%d\n", ret);
12140 write(4, string, strlen(string));
12144 close(pd[0]); /* We write to pd[1] */
12145 close(pu[1]); /* We read from pu[0] */
12146 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
12147 close(pd[1]); /* Pipe pd is now fully closed! */
12148 exit(0); /* Bye bye, thank you for playing! */
12152 if eval $compile_ok; then
12153 echo "$startsh" >mtry
12154 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
12156 ./mtry >/dev/null 2>&1
12158 0) eagain=`$cat try.out`;;
12159 1) echo "Could not perform non-blocking setting!";;
12160 2) echo "I did a successful read() for something that was not there!";;
12161 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
12162 4) echo "Could not find F_SETFL!";;
12163 *) echo "Something terribly wrong happened during testing.";;
12165 rd_nodata=`$cat try.ret`
12166 echo "A read() system call with no data present returns $rd_nodata."
12167 case "$rd_nodata" in
12170 echo "(That's peculiar, fixing that to be -1.)"
12176 echo "Forcing errno EAGAIN on read() with no data available."
12180 echo "Your read() sets errno to $eagain when no data is available."
12183 status=`$cat try.err`
12185 0) echo "And it correctly returns 0 to signal EOF.";;
12186 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
12187 *) echo "However, your read() returns '$status' on EOF??";;
12190 if test "$status" = "$rd_nodata"; then
12191 echo "WARNING: you can't distinguish between EOF and no data!"
12195 echo "I can't compile the test program--assuming errno EAGAIN will do."
12202 echo "Using $hint value $eagain."
12203 echo "Your read() returns $rd_nodata when no data is present."
12204 case "$d_eofnblk" in
12205 "$define") echo "And you can see EOF because read() returns 0.";;
12206 "$undef") echo "But you can't see EOF status from read() returned value.";;
12208 echo "(Assuming you can't see EOF status from read anyway.)"
12214 $rm -f try try.* .out core head.c mtry
12216 : see if _ptr and _cnt from stdio act std
12219 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12220 echo "(Looks like you have stdio.h from BSD.)"
12221 case "$stdio_ptr" in
12222 '') stdio_ptr='((fp)->_p)'
12225 *) ptr_lval=$d_stdio_ptr_lval;;
12227 case "$stdio_cnt" in
12228 '') stdio_cnt='((fp)->_r)'
12231 *) cnt_lval=$d_stdio_cnt_lval;;
12233 case "$stdio_base" in
12234 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12236 case "$stdio_bufsiz" in
12237 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12239 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12240 echo "(Looks like you have stdio.h from Linux.)"
12241 case "$stdio_ptr" in
12242 '') stdio_ptr='((fp)->_IO_read_ptr)'
12245 *) ptr_lval=$d_stdio_ptr_lval;;
12247 case "$stdio_cnt" in
12248 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12251 *) cnt_lval=$d_stdio_cnt_lval;;
12253 case "$stdio_base" in
12254 '') stdio_base='((fp)->_IO_read_base)';;
12256 case "$stdio_bufsiz" in
12257 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12260 case "$stdio_ptr" in
12261 '') stdio_ptr='((fp)->_ptr)'
12264 *) ptr_lval=$d_stdio_ptr_lval;;
12266 case "$stdio_cnt" in
12267 '') stdio_cnt='((fp)->_cnt)'
12270 *) cnt_lval=$d_stdio_cnt_lval;;
12272 case "$stdio_base" in
12273 '') stdio_base='((fp)->_base)';;
12275 case "$stdio_bufsiz" in
12276 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12280 : test whether _ptr and _cnt really work
12281 echo "Checking how std your stdio is..." >&4
12284 #$i_stdlib I_STDLIB
12286 #include <stdlib.h>
12288 #define FILE_ptr(fp) $stdio_ptr
12289 #define FILE_cnt(fp) $stdio_cnt
12291 FILE *fp = fopen("try.c", "r");
12294 18 <= FILE_cnt(fp) &&
12295 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12303 if eval $compile && $to try.c; then
12304 if $run ./try; then
12305 echo "Your stdio acts pretty std."
12308 echo "Your stdio isn't very std."
12311 echo "Your stdio doesn't appear very std."
12315 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12316 # direct buffer manipulation no longer works. The Configure tests
12317 # should be changed to correctly detect this, but until then,
12318 # the following check should at least let perl compile and run.
12319 # (This quick fix should be updated before 5.8.1.)
12320 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12321 # A. Dougherty, June 3, 2002.
12322 case "$d_gnulibc" in
12324 case "$gnulibc_version" in
12328 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12337 : Can _ptr be used as an lvalue?
12338 case "$d_stdstdio$ptr_lval" in
12339 $define$define) val=$define ;;
12342 set d_stdio_ptr_lval
12345 : Can _cnt be used as an lvalue?
12346 case "$d_stdstdio$cnt_lval" in
12347 $define$define) val=$define ;;
12350 set d_stdio_cnt_lval
12354 : test whether setting _ptr sets _cnt as a side effect
12355 d_stdio_ptr_lval_sets_cnt="$undef"
12356 d_stdio_ptr_lval_nochange_cnt="$undef"
12357 case "$d_stdio_ptr_lval$d_stdstdio" in
12359 echo "Checking to see what happens if we set the stdio ptr..." >&4
12362 /* Can we scream? */
12363 /* Eat dust sed :-) */
12364 /* In the buffer space, no one can hear you scream. */
12365 #$i_stdlib I_STDLIB
12367 #include <stdlib.h>
12369 #define FILE_ptr(fp) $stdio_ptr
12370 #define FILE_cnt(fp) $stdio_cnt
12371 #include <sys/types.h>
12373 FILE *fp = fopen("try.c", "r");
12378 puts("Fail even to read");
12381 c = getc(fp); /* Read away the first # */
12383 puts("Fail even to read");
12387 18 <= FILE_cnt(fp) &&
12388 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12390 puts("Fail even to read");
12393 ptr = (char*) FILE_ptr(fp);
12394 cnt = (size_t)FILE_cnt(fp);
12396 FILE_ptr(fp) += 42;
12398 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12399 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12402 if (FILE_cnt(fp) <= 20) {
12403 printf ("Fail (<20 chars to test)");
12406 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12407 puts("Fail compare");
12410 if (cnt == FILE_cnt(fp)) {
12411 puts("Pass_unchanged");
12414 if (FILE_cnt(fp) == (cnt - 42)) {
12415 puts("Pass_changed");
12418 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12424 if eval $compile && $to try.c; then
12425 case `$run ./try` in
12427 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12428 d_stdio_ptr_lval_sets_cnt="$define" ;;
12430 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12431 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12433 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12435 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12438 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12444 : see if _base is also standard
12446 case "$d_stdstdio" in
12450 #$i_stdlib I_STDLIB
12452 #include <stdlib.h>
12454 #define FILE_base(fp) $stdio_base
12455 #define FILE_bufsiz(fp) $stdio_bufsiz
12457 FILE *fp = fopen("try.c", "r");
12460 19 <= FILE_bufsiz(fp) &&
12461 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
12468 if eval $compile && $to try.c; then
12469 if $run ./try; then
12470 echo "And its _base field acts std."
12473 echo "But its _base field isn't std."
12476 echo "However, it seems to be lacking the _base field."
12484 : see if fast_stdio exists
12486 case "$d_stdstdio:$d_stdio_ptr_lval" in
12488 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
12490 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
12501 : see if fchdir exists
12502 set fchdir d_fchdir
12505 : see if fchmod exists
12506 set fchmod d_fchmod
12509 : see if fchown exists
12510 set fchown d_fchown
12513 : see if this is an fcntl system
12518 : See if fcntl-based locking works.
12520 #$i_stdlib I_STDLIB
12522 #include <stdlib.h>
12524 #include <unistd.h>
12526 #include <signal.h>
12527 $signal_t blech(int x) { exit(3); }
12529 #if defined(F_SETLK) && defined(F_SETLKW)
12530 struct flock flock;
12532 fd = open("try.c", O_RDONLY);
12533 flock.l_type = F_RDLCK;
12534 flock.l_whence = SEEK_SET;
12535 flock.l_start = flock.l_len = 0;
12536 signal(SIGALRM, blech);
12538 retval = fcntl(fd, F_SETLK, &flock);
12540 (retval < 0 ? exit(2) : exit(0));
12546 echo "Checking if fcntl-based file locking works... "
12550 if eval $compile_ok; then
12551 if $run ./try; then
12552 echo "Yes, it seems to work."
12555 echo "Nope, it didn't work."
12560 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
12561 *** This is (almost) impossible.
12562 *** If your NFS lock daemons are not feeling well, something like
12563 *** this may happen, please investigate. Cannot continue, aborting.
12571 echo "I'm unable to compile the test program, so I'll assume not."
12576 echo "Nope, since you don't even have fcntl()."
12579 set d_fcntl_can_lock
12584 : check for fd_set items
12587 Checking to see how well your C compiler handles fd_set and friends ...
12590 #$i_stdlib I_STDLIB
12592 #include <stdlib.h>
12594 #$i_systime I_SYS_TIME
12595 #$i_sysselct I_SYS_SELECT
12596 #$d_socket HAS_SOCKET
12597 #include <sys/types.h>
12599 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
12602 #include <sys/time.h>
12604 #ifdef I_SYS_SELECT
12605 #include <sys/select.h>
12614 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
12622 if eval $compile; then
12623 d_fds_bits="$define"
12625 echo "Well, your system knows about the normal fd_set typedef..." >&4
12626 if $run ./try; then
12627 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
12628 d_fd_macros="$define"
12631 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
12633 d_fd_macros="$undef"
12637 Hmm, your compiler has some difficulty with fd_set. Checking further...
12640 if eval $compile; then
12641 d_fds_bits="$undef"
12643 echo "Well, your system has some sort of fd_set available..." >&4
12644 if $run ./try; then
12645 echo "and you have the normal fd_set macros." >&4
12646 d_fd_macros="$define"
12649 but not the normal fd_set macros! Gross! More work for me...
12651 d_fd_macros="$undef"
12654 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
12656 d_fds_bits="$undef"
12657 d_fd_macros="$undef"
12662 : see if fgetpos exists
12663 set fgetpos d_fgetpos
12666 : see if finite exists
12667 set finite d_finite
12670 : see if finitel exists
12671 set finitel d_finitel
12674 : see if flock exists
12678 : see if prototype for flock is available
12680 set d_flockproto flock $i_sysfile sys/file.h
12683 : see if fork exists
12687 : see if fp_class exists
12688 set fp_class d_fp_class
12691 : see if pathconf exists
12692 set pathconf d_pathconf
12695 : see if fpathconf exists
12696 set fpathconf d_fpathconf
12699 : see if fpclass exists
12700 set fpclass d_fpclass
12703 : see if fpclassify exists
12704 set fpclassify d_fpclassify
12707 : see if fpclassl exists
12708 set fpclassl d_fpclassl
12712 : check for fpos64_t
12714 echo "Checking to see if you have fpos64_t..." >&4
12717 int main() { fpos64_t x = 7; }
12720 if eval $compile; then
12722 echo "You have fpos64_t."
12725 echo "You do not have fpos64_t."
12726 case "$fpossize" in
12727 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
12734 : see if frexpl exists
12735 set frexpl d_frexpl
12738 : see if this is a sys/param system
12739 set sys/param.h i_sysparam
12742 : see if this is a sys/mount.h system
12743 set sys/mount.h i_sysmount
12748 echo "Checking to see if your system supports struct fs_data..." >&4
12749 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
12751 case "$d_fs_data_s" in
12752 "$define") echo "Yes, it does." ;;
12753 *) echo "No, it doesn't." ;;
12756 : see if fseeko exists
12757 set fseeko d_fseeko
12759 case "$longsize" in
12760 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
12763 : see if fsetpos exists
12764 set fsetpos d_fsetpos
12768 : see if fstatfs exists
12769 set fstatfs d_fstatfs
12773 : see if statvfs exists
12774 set statvfs d_statvfs
12777 : see if fstatvfs exists
12778 set fstatvfs d_fstatvfs
12782 : see if fsync exists
12786 : see if ftello exists
12787 set ftello d_ftello
12789 case "$longsize" in
12790 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
12794 : check for a working futimes
12796 echo "Checking for a working futimes()" >&4
12799 #include <sys/time.h>
12806 fd = open ("try.c", O_RDWR);
12807 if (-1 == fd) exit (1);
12808 rv = futimes (fd, NULL);
12809 exit (rv == -1 ? errno : 0);
12813 if eval $compile; then
12817 0) echo "Yes, it does" >&4
12818 d_futimes="$define"
12820 *) echo "No, it has futimes, but it isn't working ($rc) (probably harmless)\n" >&4
12824 echo "No, it does not (probably harmless)\n" >&4
12826 $rm -f try.* try core core.try.*
12828 : see if getcwd exists
12829 set getcwd d_getcwd
12832 : see if getespwnam exists
12833 set getespwnam d_getespwnam
12837 : see if getfsstat exists
12838 set getfsstat d_getfsstat
12841 : see if getgrent exists
12842 set getgrent d_getgrent
12845 : see if getgrent_r exists
12846 set getgrent_r d_getgrent_r
12848 case "$d_getgrent_r" in
12850 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12851 case "$d_getgrent_r_proto:$usethreads" in
12852 ":define") d_getgrent_r_proto=define
12853 set d_getgrent_r_proto getgrent_r $hdrs
12857 case "$d_getgrent_r_proto" in
12859 case "$getgrent_r_proto" in
12860 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
12861 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBWR ;;
12863 case "$getgrent_r_proto" in
12864 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
12865 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIR ;;
12867 case "$getgrent_r_proto" in
12868 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
12869 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBW ;;
12871 case "$getgrent_r_proto" in
12872 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
12873 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBI ;;
12875 case "$getgrent_r_proto" in
12876 ''|0) try='int getgrent_r(struct group*, char*, int);'
12877 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBI ;;
12879 case "$getgrent_r_proto" in
12880 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
12881 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIH ;;
12883 case "$getgrent_r_proto" in
12884 ''|0) d_getgrent_r=undef
12886 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
12887 * ) case "$getgrent_r_proto" in
12888 REENTRANT_PROTO*) ;;
12889 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
12891 echo "Prototype: $try" ;;
12894 *) case "$usethreads" in
12895 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
12902 *) getgrent_r_proto=0
12906 : see if getgrgid_r exists
12907 set getgrgid_r d_getgrgid_r
12909 case "$d_getgrgid_r" in
12911 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12912 case "$d_getgrgid_r_proto:$usethreads" in
12913 ":define") d_getgrgid_r_proto=define
12914 set d_getgrgid_r_proto getgrgid_r $hdrs
12918 case "$d_getgrgid_r_proto" in
12920 case "$getgrgid_r_proto" in
12921 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
12922 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
12924 case "$getgrgid_r_proto" in
12925 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
12926 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
12928 case "$getgrgid_r_proto" in
12929 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
12930 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
12932 case "$getgrgid_r_proto" in
12933 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
12934 ./protochk "extern $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
12936 case "$getgrgid_r_proto" in
12937 ''|0) d_getgrgid_r=undef
12939 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
12940 * ) case "$getgrgid_r_proto" in
12941 REENTRANT_PROTO*) ;;
12942 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
12944 echo "Prototype: $try" ;;
12947 *) case "$usethreads" in
12948 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
12955 *) getgrgid_r_proto=0
12959 : see if getgrnam_r exists
12960 set getgrnam_r d_getgrnam_r
12962 case "$d_getgrnam_r" in
12964 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12965 case "$d_getgrnam_r_proto:$usethreads" in
12966 ":define") d_getgrnam_r_proto=define
12967 set d_getgrnam_r_proto getgrnam_r $hdrs
12971 case "$d_getgrnam_r_proto" in
12973 case "$getgrnam_r_proto" in
12974 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
12975 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
12977 case "$getgrnam_r_proto" in
12978 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
12979 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
12981 case "$getgrnam_r_proto" in
12982 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
12983 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CBI ;;
12985 case "$getgrnam_r_proto" in
12986 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
12987 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
12989 case "$getgrnam_r_proto" in
12990 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
12991 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
12993 case "$getgrnam_r_proto" in
12994 ''|0) d_getgrnam_r=undef
12996 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
12997 * ) case "$getgrnam_r_proto" in
12998 REENTRANT_PROTO*) ;;
12999 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
13001 echo "Prototype: $try" ;;
13004 *) case "$usethreads" in
13005 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
13012 *) getgrnam_r_proto=0
13016 : see if gethostbyaddr exists
13017 set gethostbyaddr d_gethbyaddr
13020 : see if gethostbyname exists
13021 set gethostbyname d_gethbyname
13024 : see if gethostent exists
13025 set gethostent d_gethent
13028 : see how we will look up host name
13031 if set gethostname val -f d_gethname; eval $csym; $val; then
13032 echo 'gethostname() found.' >&4
13033 d_gethname="$define"
13036 if set uname val -f d_uname; eval $csym; $val; then
13039 uname() was found, but you're running xenix, and older versions of xenix
13040 have a broken uname(). If you don't really know whether your xenix is old
13041 enough to have a broken system call, use the default answer.
13046 "$define") dflt=n;;
13048 rp='Is your uname() broken?'
13051 n*) d_uname="$define"; call=uname;;
13054 echo 'uname() found.' >&4
13061 case "$d_gethname" in
13062 '') d_gethname="$undef";;
13065 '') d_uname="$undef";;
13067 case "$d_uname$d_gethname" in
13072 Every now and then someone has a $call() that lies about the hostname
13073 but can't be fixed for political or economic reasons. If you wish, I can
13074 pretend $call() isn't there and maybe compute hostname at run-time
13075 thanks to the '$phostname' command.
13078 rp="Shall I ignore $call() from now on?"
13081 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
13084 case "$phostname" in
13085 '') aphostname='';;
13086 *) case "$aphostname" in
13088 *) set X $phostname
13092 file=`./loc $file $file $pth`
13093 aphostname=`echo $file $*`
13098 case "$d_uname$d_gethname" in
13101 case "$phostname" in
13103 echo "There will be no way for $package to get your hostname." >&4;;
13105 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
13109 case "$d_phostname" in
13110 '') d_phostname="$undef";;
13113 : see if gethostbyaddr_r exists
13114 set gethostbyaddr_r d_gethostbyaddr_r
13116 case "$d_gethostbyaddr_r" in
13118 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13119 case "$d_gethostbyaddr_r_proto:$usethreads" in
13120 ":define") d_gethostbyaddr_r_proto=define
13121 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
13125 case "$d_gethostbyaddr_r_proto" in
13127 case "$gethostbyaddr_r_proto" in
13128 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13129 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
13131 case "$gethostbyaddr_r_proto" in
13132 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
13133 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
13135 case "$gethostbyaddr_r_proto" in
13136 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
13137 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
13139 case "$gethostbyaddr_r_proto" in
13140 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
13141 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
13143 case "$gethostbyaddr_r_proto" in
13144 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
13145 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
13147 case "$gethostbyaddr_r_proto" in
13148 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
13149 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
13151 case "$gethostbyaddr_r_proto" in
13152 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
13153 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
13155 case "$gethostbyaddr_r_proto" in
13156 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
13157 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
13159 case "$gethostbyaddr_r_proto" in
13160 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
13161 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
13163 case "$gethostbyaddr_r_proto" in
13164 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
13165 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
13167 case "$gethostbyaddr_r_proto" in
13168 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13169 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
13171 case "$gethostbyaddr_r_proto" in
13172 ''|0) d_gethostbyaddr_r=undef
13173 gethostbyaddr_r_proto=0
13174 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
13175 * ) case "$gethostbyaddr_r_proto" in
13176 REENTRANT_PROTO*) ;;
13177 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
13179 echo "Prototype: $try" ;;
13182 *) case "$usethreads" in
13183 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
13185 d_gethostbyaddr_r=undef
13186 gethostbyaddr_r_proto=0
13190 *) gethostbyaddr_r_proto=0
13194 : see if gethostbyname_r exists
13195 set gethostbyname_r d_gethostbyname_r
13197 case "$d_gethostbyname_r" in
13199 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13200 case "$d_gethostbyname_r_proto:$usethreads" in
13201 ":define") d_gethostbyname_r_proto=define
13202 set d_gethostbyname_r_proto gethostbyname_r $hdrs
13206 case "$d_gethostbyname_r_proto" in
13208 case "$gethostbyname_r_proto" in
13209 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
13210 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
13212 case "$gethostbyname_r_proto" in
13213 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
13214 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
13216 case "$gethostbyname_r_proto" in
13217 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
13218 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
13220 case "$gethostbyname_r_proto" in
13221 ''|0) d_gethostbyname_r=undef
13222 gethostbyname_r_proto=0
13223 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
13224 * ) case "$gethostbyname_r_proto" in
13225 REENTRANT_PROTO*) ;;
13226 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
13228 echo "Prototype: $try" ;;
13231 *) case "$usethreads" in
13232 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13234 d_gethostbyname_r=undef
13235 gethostbyname_r_proto=0
13239 *) gethostbyname_r_proto=0
13243 : see if gethostent_r exists
13244 set gethostent_r d_gethostent_r
13246 case "$d_gethostent_r" in
13248 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13249 case "$d_gethostent_r_proto:$usethreads" in
13250 ":define") d_gethostent_r_proto=define
13251 set d_gethostent_r_proto gethostent_r $hdrs
13255 case "$d_gethostent_r_proto" in
13257 case "$gethostent_r_proto" in
13258 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
13259 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
13261 case "$gethostent_r_proto" in
13262 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
13263 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBIE ;;
13265 case "$gethostent_r_proto" in
13266 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
13267 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBIE ;;
13269 case "$gethostent_r_proto" in
13270 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
13271 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBI ;;
13273 case "$gethostent_r_proto" in
13274 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
13275 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBI ;;
13277 case "$gethostent_r_proto" in
13278 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13279 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SD ;;
13281 case "$gethostent_r_proto" in
13282 ''|0) d_gethostent_r=undef
13283 gethostent_r_proto=0
13284 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13285 * ) case "$gethostent_r_proto" in
13286 REENTRANT_PROTO*) ;;
13287 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13289 echo "Prototype: $try" ;;
13292 *) case "$usethreads" in
13293 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13295 d_gethostent_r=undef
13296 gethostent_r_proto=0
13300 *) gethostent_r_proto=0
13304 : see if prototypes for various gethostxxx netdb.h functions are available
13306 set d_gethostprotos gethostent $i_netdb netdb.h
13309 : see if getitimer exists
13310 set getitimer d_getitimer
13313 : see if getlogin exists
13314 set getlogin d_getlogin
13317 : see if getlogin_r exists
13318 set getlogin_r d_getlogin_r
13320 case "$d_getlogin_r" in
13322 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
13323 case "$d_getlogin_r_proto:$usethreads" in
13324 ":define") d_getlogin_r_proto=define
13325 set d_getlogin_r_proto getlogin_r $hdrs
13329 case "$d_getlogin_r_proto" in
13331 case "$getlogin_r_proto" in
13332 ''|0) try='int getlogin_r(char*, size_t);'
13333 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BW ;;
13335 case "$getlogin_r_proto" in
13336 ''|0) try='int getlogin_r(char*, int);'
13337 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BI ;;
13339 case "$getlogin_r_proto" in
13340 ''|0) try='char* getlogin_r(char*, size_t);'
13341 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BW ;;
13343 case "$getlogin_r_proto" in
13344 ''|0) try='char* getlogin_r(char*, int);'
13345 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BI ;;
13347 case "$getlogin_r_proto" in
13348 ''|0) d_getlogin_r=undef
13350 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
13351 * ) case "$getlogin_r_proto" in
13352 REENTRANT_PROTO*) ;;
13353 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
13355 echo "Prototype: $try" ;;
13358 *) case "$usethreads" in
13359 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
13366 *) getlogin_r_proto=0
13370 : see if getmnt exists
13371 set getmnt d_getmnt
13374 : see if getmntent exists
13375 set getmntent d_getmntent
13378 : see if getnetbyaddr exists
13379 set getnetbyaddr d_getnbyaddr
13382 : see if getnetbyname exists
13383 set getnetbyname d_getnbyname
13386 : see if getnetent exists
13387 set getnetent d_getnent
13390 : see if getnetbyaddr_r exists
13391 set getnetbyaddr_r d_getnetbyaddr_r
13393 case "$d_getnetbyaddr_r" in
13395 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13396 case "$d_getnetbyaddr_r_proto:$usethreads" in
13397 ":define") d_getnetbyaddr_r_proto=define
13398 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
13402 case "$d_getnetbyaddr_r_proto" in
13404 case "$getnetbyaddr_r_proto" in
13405 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
13406 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
13408 case "$getnetbyaddr_r_proto" in
13409 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
13410 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
13412 case "$getnetbyaddr_r_proto" in
13413 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
13414 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
13416 case "$getnetbyaddr_r_proto" in
13417 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
13418 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
13420 case "$getnetbyaddr_r_proto" in
13421 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
13422 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
13424 case "$getnetbyaddr_r_proto" in
13425 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
13426 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
13428 case "$getnetbyaddr_r_proto" in
13429 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
13430 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
13432 case "$getnetbyaddr_r_proto" in
13433 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
13434 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
13436 case "$getnetbyaddr_r_proto" in
13437 ''|0) d_getnetbyaddr_r=undef
13438 getnetbyaddr_r_proto=0
13439 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
13440 * ) case "$getnetbyaddr_r_proto" in
13441 REENTRANT_PROTO*) ;;
13442 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
13444 echo "Prototype: $try" ;;
13447 *) case "$usethreads" in
13448 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
13450 d_getnetbyaddr_r=undef
13451 getnetbyaddr_r_proto=0
13455 *) getnetbyaddr_r_proto=0
13459 : see if getnetbyname_r exists
13460 set getnetbyname_r d_getnetbyname_r
13462 case "$d_getnetbyname_r" in
13464 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13465 case "$d_getnetbyname_r_proto:$usethreads" in
13466 ":define") d_getnetbyname_r_proto=define
13467 set d_getnetbyname_r_proto getnetbyname_r $hdrs
13471 case "$d_getnetbyname_r_proto" in
13473 case "$getnetbyname_r_proto" in
13474 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
13475 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
13477 case "$getnetbyname_r_proto" in
13478 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
13479 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
13481 case "$getnetbyname_r_proto" in
13482 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
13483 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
13485 case "$getnetbyname_r_proto" in
13486 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
13487 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
13489 case "$getnetbyname_r_proto" in
13490 ''|0) d_getnetbyname_r=undef
13491 getnetbyname_r_proto=0
13492 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
13493 * ) case "$getnetbyname_r_proto" in
13494 REENTRANT_PROTO*) ;;
13495 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
13497 echo "Prototype: $try" ;;
13500 *) case "$usethreads" in
13501 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
13503 d_getnetbyname_r=undef
13504 getnetbyname_r_proto=0
13508 *) getnetbyname_r_proto=0
13512 : see if getnetent_r exists
13513 set getnetent_r d_getnetent_r
13515 case "$d_getnetent_r" in
13517 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13518 case "$d_getnetent_r_proto:$usethreads" in
13519 ":define") d_getnetent_r_proto=define
13520 set d_getnetent_r_proto getnetent_r $hdrs
13524 case "$d_getnetent_r_proto" in
13526 case "$getnetent_r_proto" in
13527 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
13528 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
13530 case "$getnetent_r_proto" in
13531 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
13532 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBIE ;;
13534 case "$getnetent_r_proto" in
13535 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
13536 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBIE ;;
13538 case "$getnetent_r_proto" in
13539 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
13540 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBI ;;
13542 case "$getnetent_r_proto" in
13543 ''|0) try='int getnetent_r(struct netent*, char*, int);'
13544 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBI ;;
13546 case "$getnetent_r_proto" in
13547 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
13548 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SD ;;
13550 case "$getnetent_r_proto" in
13551 ''|0) d_getnetent_r=undef
13552 getnetent_r_proto=0
13553 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
13554 * ) case "$getnetent_r_proto" in
13555 REENTRANT_PROTO*) ;;
13556 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
13558 echo "Prototype: $try" ;;
13561 *) case "$usethreads" in
13562 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
13564 d_getnetent_r=undef
13565 getnetent_r_proto=0
13569 *) getnetent_r_proto=0
13573 : see if prototypes for various getnetxxx netdb.h functions are available
13575 set d_getnetprotos getnetent $i_netdb netdb.h
13578 : see if getpagesize exists
13579 set getpagesize d_getpagsz
13583 : see if getprotobyname exists
13584 set getprotobyname d_getpbyname
13587 : see if getprotobynumber exists
13588 set getprotobynumber d_getpbynumber
13591 : see if getprotoent exists
13592 set getprotoent d_getpent
13595 : see if getpgid exists
13596 set getpgid d_getpgid
13599 : see if getpgrp2 exists
13600 set getpgrp2 d_getpgrp2
13603 : see if getppid exists
13604 set getppid d_getppid
13607 : see if getpriority exists
13608 set getpriority d_getprior
13611 : see if getprotobyname_r exists
13612 set getprotobyname_r d_getprotobyname_r
13614 case "$d_getprotobyname_r" in
13616 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13617 case "$d_getprotobyname_r_proto:$usethreads" in
13618 ":define") d_getprotobyname_r_proto=define
13619 set d_getprotobyname_r_proto getprotobyname_r $hdrs
13623 case "$d_getprotobyname_r_proto" in
13625 case "$getprotobyname_r_proto" in
13626 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
13627 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
13629 case "$getprotobyname_r_proto" in
13630 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
13631 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
13633 case "$getprotobyname_r_proto" in
13634 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
13635 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
13637 case "$getprotobyname_r_proto" in
13638 ''|0) d_getprotobyname_r=undef
13639 getprotobyname_r_proto=0
13640 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
13641 * ) case "$getprotobyname_r_proto" in
13642 REENTRANT_PROTO*) ;;
13643 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
13645 echo "Prototype: $try" ;;
13648 *) case "$usethreads" in
13649 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
13651 d_getprotobyname_r=undef
13652 getprotobyname_r_proto=0
13656 *) getprotobyname_r_proto=0
13660 : see if getprotobynumber_r exists
13661 set getprotobynumber_r d_getprotobynumber_r
13663 case "$d_getprotobynumber_r" in
13665 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13666 case "$d_getprotobynumber_r_proto:$usethreads" in
13667 ":define") d_getprotobynumber_r_proto=define
13668 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
13672 case "$d_getprotobynumber_r_proto" in
13674 case "$getprotobynumber_r_proto" in
13675 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
13676 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
13678 case "$getprotobynumber_r_proto" in
13679 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
13680 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
13682 case "$getprotobynumber_r_proto" in
13683 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
13684 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
13686 case "$getprotobynumber_r_proto" in
13687 ''|0) d_getprotobynumber_r=undef
13688 getprotobynumber_r_proto=0
13689 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
13690 * ) case "$getprotobynumber_r_proto" in
13691 REENTRANT_PROTO*) ;;
13692 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
13694 echo "Prototype: $try" ;;
13697 *) case "$usethreads" in
13698 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
13700 d_getprotobynumber_r=undef
13701 getprotobynumber_r_proto=0
13705 *) getprotobynumber_r_proto=0
13709 : see if getprotoent_r exists
13710 set getprotoent_r d_getprotoent_r
13712 case "$d_getprotoent_r" in
13714 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13715 case "$d_getprotoent_r_proto:$usethreads" in
13716 ":define") d_getprotoent_r_proto=define
13717 set d_getprotoent_r_proto getprotoent_r $hdrs
13721 case "$d_getprotoent_r_proto" in
13723 case "$getprotoent_r_proto" in
13724 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
13725 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
13727 case "$getprotoent_r_proto" in
13728 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
13729 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBI ;;
13731 case "$getprotoent_r_proto" in
13732 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
13733 ./protochk "extern $try" $hdrs && getprotoent_r_proto=S_SBI ;;
13735 case "$getprotoent_r_proto" in
13736 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
13737 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SD ;;
13739 case "$getprotoent_r_proto" in
13740 ''|0) d_getprotoent_r=undef
13741 getprotoent_r_proto=0
13742 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
13743 * ) case "$getprotoent_r_proto" in
13744 REENTRANT_PROTO*) ;;
13745 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
13747 echo "Prototype: $try" ;;
13750 *) case "$usethreads" in
13751 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
13753 d_getprotoent_r=undef
13754 getprotoent_r_proto=0
13758 *) getprotoent_r_proto=0
13762 : see if prototypes for various getprotoxxx netdb.h functions are available
13764 set d_getprotoprotos getprotoent $i_netdb netdb.h
13767 : see if getprpwnam exists
13768 set getprpwnam d_getprpwnam
13771 : see if getpwent exists
13772 set getpwent d_getpwent
13775 : see if getpwent_r exists
13776 set getpwent_r d_getpwent_r
13778 case "$d_getpwent_r" in
13780 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13781 case "$d_getpwent_r_proto:$usethreads" in
13782 ":define") d_getpwent_r_proto=define
13783 set d_getpwent_r_proto getpwent_r $hdrs
13787 case "$d_getpwent_r_proto" in
13789 case "$getpwent_r_proto" in
13790 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
13791 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBWR ;;
13793 case "$getpwent_r_proto" in
13794 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
13795 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIR ;;
13797 case "$getpwent_r_proto" in
13798 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
13799 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBW ;;
13801 case "$getpwent_r_proto" in
13802 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
13803 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBI ;;
13805 case "$getpwent_r_proto" in
13806 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
13807 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBI ;;
13809 case "$getpwent_r_proto" in
13810 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
13811 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIH ;;
13813 case "$getpwent_r_proto" in
13814 ''|0) d_getpwent_r=undef
13816 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
13817 * ) case "$getpwent_r_proto" in
13818 REENTRANT_PROTO*) ;;
13819 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
13821 echo "Prototype: $try" ;;
13824 *) case "$usethreads" in
13825 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
13832 *) getpwent_r_proto=0
13836 : see if getpwnam_r exists
13837 set getpwnam_r d_getpwnam_r
13839 case "$d_getpwnam_r" in
13841 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13842 case "$d_getpwnam_r_proto:$usethreads" in
13843 ":define") d_getpwnam_r_proto=define
13844 set d_getpwnam_r_proto getpwnam_r $hdrs
13848 case "$d_getpwnam_r_proto" in
13850 case "$getpwnam_r_proto" in
13851 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
13852 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
13854 case "$getpwnam_r_proto" in
13855 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
13856 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
13858 case "$getpwnam_r_proto" in
13859 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
13860 ./protochk "extern $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
13862 case "$getpwnam_r_proto" in
13863 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
13864 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
13866 case "$getpwnam_r_proto" in
13867 ''|0) d_getpwnam_r=undef
13869 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
13870 * ) case "$getpwnam_r_proto" in
13871 REENTRANT_PROTO*) ;;
13872 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
13874 echo "Prototype: $try" ;;
13877 *) case "$usethreads" in
13878 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
13885 *) getpwnam_r_proto=0
13889 : see if getpwuid_r exists
13890 set getpwuid_r d_getpwuid_r
13892 case "$d_getpwuid_r" in
13894 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13895 case "$d_getpwuid_r_proto:$usethreads" in
13896 ":define") d_getpwuid_r_proto=define
13897 set d_getpwuid_r_proto getpwuid_r $hdrs
13901 case "$d_getpwuid_r_proto" in
13903 case "$getpwuid_r_proto" in
13904 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
13905 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
13907 case "$getpwuid_r_proto" in
13908 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
13909 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
13911 case "$getpwuid_r_proto" in
13912 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
13913 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
13915 case "$getpwuid_r_proto" in
13916 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
13917 ./protochk "extern $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
13919 case "$getpwuid_r_proto" in
13920 ''|0) d_getpwuid_r=undef
13922 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
13923 * ) case "$getpwuid_r_proto" in
13924 REENTRANT_PROTO*) ;;
13925 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
13927 echo "Prototype: $try" ;;
13930 *) case "$usethreads" in
13931 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
13938 *) getpwuid_r_proto=0
13943 : see if getservbyname exists
13944 set getservbyname d_getsbyname
13947 : see if getservbyport exists
13948 set getservbyport d_getsbyport
13951 : see if getservent exists
13952 set getservent d_getsent
13955 : see if getservbyname_r exists
13956 set getservbyname_r d_getservbyname_r
13958 case "$d_getservbyname_r" in
13960 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13961 case "$d_getservbyname_r_proto:$usethreads" in
13962 ":define") d_getservbyname_r_proto=define
13963 set d_getservbyname_r_proto getservbyname_r $hdrs
13967 case "$d_getservbyname_r_proto" in
13969 case "$getservbyname_r_proto" in
13970 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
13971 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
13973 case "$getservbyname_r_proto" in
13974 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
13975 ./protochk "extern $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
13977 case "$getservbyname_r_proto" in
13978 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
13979 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
13981 case "$getservbyname_r_proto" in
13982 ''|0) d_getservbyname_r=undef
13983 getservbyname_r_proto=0
13984 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
13985 * ) case "$getservbyname_r_proto" in
13986 REENTRANT_PROTO*) ;;
13987 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
13989 echo "Prototype: $try" ;;
13992 *) case "$usethreads" in
13993 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
13995 d_getservbyname_r=undef
13996 getservbyname_r_proto=0
14000 *) getservbyname_r_proto=0
14004 : see if getservbyport_r exists
14005 set getservbyport_r d_getservbyport_r
14007 case "$d_getservbyport_r" in
14009 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14010 case "$d_getservbyport_r_proto:$usethreads" in
14011 ":define") d_getservbyport_r_proto=define
14012 set d_getservbyport_r_proto getservbyport_r $hdrs
14016 case "$d_getservbyport_r_proto" in
14018 case "$getservbyport_r_proto" in
14019 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
14020 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
14022 case "$getservbyport_r_proto" in
14023 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
14024 ./protochk "extern $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
14026 case "$getservbyport_r_proto" in
14027 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
14028 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
14030 case "$getservbyport_r_proto" in
14031 ''|0) d_getservbyport_r=undef
14032 getservbyport_r_proto=0
14033 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
14034 * ) case "$getservbyport_r_proto" in
14035 REENTRANT_PROTO*) ;;
14036 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
14038 echo "Prototype: $try" ;;
14041 *) case "$usethreads" in
14042 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
14044 d_getservbyport_r=undef
14045 getservbyport_r_proto=0
14049 *) getservbyport_r_proto=0
14053 : see if getservent_r exists
14054 set getservent_r d_getservent_r
14056 case "$d_getservent_r" in
14058 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14059 case "$d_getservent_r_proto:$usethreads" in
14060 ":define") d_getservent_r_proto=define
14061 set d_getservent_r_proto getservent_r $hdrs
14065 case "$d_getservent_r_proto" in
14067 case "$getservent_r_proto" in
14068 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
14069 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBWR ;;
14071 case "$getservent_r_proto" in
14072 ''|0) try='int getservent_r(struct servent*, char*, int);'
14073 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBI ;;
14075 case "$getservent_r_proto" in
14076 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
14077 ./protochk "extern $try" $hdrs && getservent_r_proto=S_SBI ;;
14079 case "$getservent_r_proto" in
14080 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
14081 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SD ;;
14083 case "$getservent_r_proto" in
14084 ''|0) d_getservent_r=undef
14085 getservent_r_proto=0
14086 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
14087 * ) case "$getservent_r_proto" in
14088 REENTRANT_PROTO*) ;;
14089 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
14091 echo "Prototype: $try" ;;
14094 *) case "$usethreads" in
14095 define) echo "getservent_r has no prototype, not using it." >&4 ;;
14097 d_getservent_r=undef
14098 getservent_r_proto=0
14102 *) getservent_r_proto=0
14106 : see if prototypes for various getservxxx netdb.h functions are available
14108 set d_getservprotos getservent $i_netdb netdb.h
14111 : see if getspnam exists
14112 set getspnam d_getspnam
14115 : see if this is a shadow.h system
14116 set shadow.h i_shadow
14119 : see if getspnam_r exists
14120 set getspnam_r d_getspnam_r
14122 case "$d_getspnam_r" in
14124 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
14125 case "$d_getspnam_r_proto:$usethreads" in
14126 ":define") d_getspnam_r_proto=define
14127 set d_getspnam_r_proto getspnam_r $hdrs
14131 case "$d_getspnam_r_proto" in
14133 case "$getspnam_r_proto" in
14134 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
14135 ./protochk "extern $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
14137 case "$getspnam_r_proto" in
14138 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
14139 ./protochk "extern $try" $hdrs && getspnam_r_proto=S_CSBI ;;
14141 case "$getspnam_r_proto" in
14142 ''|0) d_getspnam_r=undef
14144 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
14145 * ) case "$getspnam_r_proto" in
14146 REENTRANT_PROTO*) ;;
14147 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
14149 echo "Prototype: $try" ;;
14152 *) case "$usethreads" in
14153 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
14160 *) getspnam_r_proto=0
14164 : see if gettimeofday or ftime exists
14165 set gettimeofday d_gettimeod
14167 case "$d_gettimeod" in
14173 val="$undef"; set d_ftime; eval $setvar
14176 case "$d_gettimeod$d_ftime" in
14179 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
14183 : see if gmtime_r exists
14184 set gmtime_r d_gmtime_r
14186 case "$d_gmtime_r" in
14188 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14189 case "$d_gmtime_r_proto:$usethreads" in
14190 ":define") d_gmtime_r_proto=define
14191 set d_gmtime_r_proto gmtime_r $hdrs
14195 case "$d_gmtime_r_proto" in
14197 case "$gmtime_r_proto" in
14198 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
14199 ./protochk "extern $try" $hdrs && gmtime_r_proto=S_TS ;;
14201 case "$gmtime_r_proto" in
14202 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
14203 ./protochk "extern $try" $hdrs && gmtime_r_proto=I_TS ;;
14205 case "$gmtime_r_proto" in
14206 ''|0) d_gmtime_r=undef
14208 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
14209 * ) case "$gmtime_r_proto" in
14210 REENTRANT_PROTO*) ;;
14211 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
14213 echo "Prototype: $try" ;;
14216 *) case "$usethreads" in
14217 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
14224 *) gmtime_r_proto=0
14228 : see if hasmntopt exists
14229 set hasmntopt d_hasmntopt
14232 : see if this is a netinet/in.h or sys/in.h system
14233 set netinet/in.h i_niin sys/in.h i_sysin
14236 : see if arpa/inet.h has to be included
14237 set arpa/inet.h i_arpainet
14240 : see if htonl --and friends-- exists
14245 : Maybe they are macros.
14248 $cat >htonl.c <<EOM
14250 #include <sys/types.h>
14251 #$i_niin I_NETINET_IN
14253 #$i_arpainet I_ARPA_INET
14254 #ifdef I_NETINET_IN
14255 #include <netinet/in.h>
14258 #include <sys/in.h>
14261 #include <arpa/inet.h>
14264 printf("Defined as a macro.");
14267 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
14268 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
14270 echo "But it seems to be defined as a macro." >&4
14278 : see if ilogbl exists
14279 set ilogbl d_ilogbl
14284 if set index val -f; eval $csym; $val; then
14285 if set strchr val -f d_strchr; eval $csym; $val; then
14286 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14289 echo "strchr() found." >&4
14293 echo "index() found." >&4
14298 echo "index() found." >&4
14301 if set strchr val -f d_strchr; eval $csym; $val; then
14304 echo "strchr() found." >&4
14306 echo "No index() or strchr() found!" >&4
14311 set d_strchr; eval $setvar
14313 set d_index; eval $setvar
14315 : check whether inet_aton exists
14316 set inet_aton d_inetaton
14321 $cat >isascii.c <<EOCP
14324 #$i_stdlib I_STDLIB
14326 #include <stdlib.h>
14337 if eval $compile; then
14338 echo "isascii() found." >&4
14341 echo "isascii() NOT found." >&4
14348 : see if isfinite exists
14349 set isfinite d_isfinite
14352 : see if isinf exists
14356 : see if isnan exists
14360 : see if isnanl exists
14361 set isnanl d_isnanl
14364 : see if killpg exists
14365 set killpg d_killpg
14368 : see if lchown exists
14370 $cat > try.c <<'EOCP'
14371 /* System header to define __stub macros and hopefully few prototypes,
14372 which can conflict with char lchown(); below. */
14373 #include <assert.h>
14374 /* Override any gcc2 internal prototype to avoid an error. */
14375 /* We use char because int might match the return type of a gcc2
14376 builtin and then its argument prototype would still apply. */
14379 /* The GNU C library defines this for functions which it implements
14380 to always fail with ENOSYS. Some functions are actually named
14381 something starting with __ and the normal name is an alias. */
14382 #if defined (__stub_lchown) || defined (__stub___lchown)
14390 if eval $compile; then
14391 $echo "lchown() found." >&4
14394 $echo "lchown() NOT found." >&4
14400 : See if number of significant digits in a double precision number is known
14402 $cat >ldbl_dig.c <<EOM
14403 #$i_limits I_LIMITS
14406 #include <limits.h>
14412 printf("Contains LDBL_DIG");
14415 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
14416 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
14417 echo "LDBL_DIG found." >&4
14420 echo "LDBL_DIG NOT found." >&4
14427 : see if this is a math.h system
14431 d_libm_lib_version="$undef"
14434 : check to see if math.h defines _LIB_VERSION
14436 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
14438 #include <unistd.h>
14440 int main (int argc, char *argv[])
14442 printf ("%d\n", _LIB_VERSION);
14447 if eval $compile; then
14449 echo "Yes, it does ($foo)" >&4
14450 d_libm_lib_version="$define"
14452 echo "No, it does not (probably harmless)\n" >&4
14454 $rm -f try.* try core core.try.*
14459 : see if link exists
14463 : see if localtime_r exists
14464 set localtime_r d_localtime_r
14466 case "$d_localtime_r" in
14468 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14469 case "$d_localtime_r_proto:$usethreads" in
14470 ":define") d_localtime_r_proto=define
14471 set d_localtime_r_proto localtime_r $hdrs
14475 case "$d_localtime_r_proto" in
14477 case "$localtime_r_proto" in
14478 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
14479 ./protochk "extern $try" $hdrs && localtime_r_proto=S_TS ;;
14481 case "$localtime_r_proto" in
14482 ''|0) try='int localtime_r(const time_t*, struct tm*);'
14483 ./protochk "extern $try" $hdrs && localtime_r_proto=I_TS ;;
14485 case "$localtime_r_proto" in
14486 ''|0) d_localtime_r=undef
14487 localtime_r_proto=0
14488 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
14489 * ) case "$localtime_r_proto" in
14490 REENTRANT_PROTO*) ;;
14491 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
14493 echo "Prototype: $try" ;;
14496 *) case "$usethreads" in
14497 define) echo "localtime_r has no prototype, not using it." >&4 ;;
14499 d_localtime_r=undef
14500 localtime_r_proto=0
14504 *) localtime_r_proto=0
14508 : see if localeconv exists
14509 set localeconv d_locconv
14512 : see if lockf exists
14516 : see if prototype for lseek is available
14518 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
14521 : see if lstat exists
14525 : see if madvise exists
14526 set madvise d_madvise
14529 : see if malloc_size exists
14530 set malloc_size d_malloc_size
14533 : see if malloc_size_good exists
14534 set malloc_good_size d_malloc_good_size
14537 : see if mblen exists
14541 : see if mbstowcs exists
14542 set mbstowcs d_mbstowcs
14545 : see if mbtowc exists
14546 set mbtowc d_mbtowc
14549 : see if memchr exists
14550 set memchr d_memchr
14553 : see if memcmp exists
14554 set memcmp d_memcmp
14557 : see if memcpy exists
14558 set memcpy d_memcpy
14561 : see if memmove exists
14562 set memmove d_memmove
14565 : see if memset exists
14566 set memset d_memset
14569 : see if mkdir exists
14573 : see if mkdtemp exists
14574 set mkdtemp d_mkdtemp
14577 : see if mkfifo exists
14578 set mkfifo d_mkfifo
14581 : see if mkstemp exists
14582 set mkstemp d_mkstemp
14585 : see if mkstemps exists
14586 set mkstemps d_mkstemps
14589 : see if mktime exists
14590 set mktime d_mktime
14593 : see if this is a sys/mman.h system
14594 set sys/mman.h i_sysmman
14597 : see if mmap exists
14600 : see what shmat returns
14601 : default to something harmless
14603 case "$i_sysmman$d_mmap" in
14605 $cat >mmap.c <<'END'
14606 #include <sys/mman.h>
14609 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
14614 echo "and it returns ($mmaptype)." >&4
14620 : see if sqrtl exists
14624 : see if scalbnl exists
14625 set scalbnl d_scalbnl
14628 : see if modfl exists
14632 : see if prototype for modfl is available
14634 set d_modflproto modfl $i_math math.h
14637 d_modfl_pow32_bug="$undef"
14639 case "$d_longdbl$d_modfl" in
14642 Checking to see whether your modfl() is okay for large values...
14648 if $test "X$d_modflproto" != "X$define"; then
14649 $cat >>try.c <<EOCP
14650 /* Sigh. many current glibcs provide the function, but do not prototype it. */
14651 long double modfl (long double, long double *);
14654 $cat >>try.c <<EOCP
14656 long double nv = 4294967303.15;
14662 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
14666 case "$osname:$gccversion" in
14667 aix:) saveccflags="$ccflags"
14668 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
14671 if eval $compile; then
14674 *" 4294967303.150000 1.150000 4294967302.000000")
14675 echo >&4 "Your modfl() is broken for large values."
14676 d_modfl_pow32_bug="$define"
14678 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
14682 *" 4294967303.150000 0.150000 4294967303.000000")
14683 echo >&4 "Your modfl() seems okay for large values."
14685 *) echo >&4 "I don't understand your modfl() at all."
14689 $rm -f try.* try core core.try.*
14691 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
14694 case "$osname:$gccversion" in
14695 aix:) ccflags="$saveccflags" ;; # restore
14700 if $test "$uselongdouble" = "$define"; then
14702 if $test "$d_sqrtl" != "$define"; then
14703 message="$message sqrtl"
14705 if $test "$d_modfl" != "$define"; then
14706 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
14707 echo "You have both aintl and copysignl, so I can emulate modfl."
14709 message="$message modfl"
14712 if $test "$d_frexpl" != "$define"; then
14713 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
14714 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
14716 message="$message frexpl"
14720 if $test "$message" != ""; then
14723 *** You requested the use of long doubles but you do not seem to have
14724 *** the following mathematical functions needed for long double support:
14726 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
14727 *** Cannot continue, aborting.
14735 : see if mprotect exists
14736 set mprotect d_mprotect
14739 : see if msgctl exists
14740 set msgctl d_msgctl
14743 : see if msgget exists
14744 set msgget d_msgget
14747 : see if msgsnd exists
14748 set msgsnd d_msgsnd
14751 : see if msgrcv exists
14752 set msgrcv d_msgrcv
14755 : see how much of the 'msg*(2)' library is present.
14758 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
14759 *"$undef"*) h_msg=false;;
14763 case "`ipcs 2>&1`" in
14764 "SVID messages"*"not configured"*)
14765 echo "Your $osname does not have the msg*(2) configured." >&4
14768 set msgctl d_msgctl
14770 set msgget d_msgget
14772 set msgsnd d_msgsnd
14774 set msgrcv d_msgrcv
14780 : we could also check for sys/ipc.h ...
14781 if $h_msg && $test `./findhdr sys/msg.h`; then
14782 echo "You have the full msg*(2) library." >&4
14785 echo "You don't have the full msg*(2) library." >&4
14793 echo "Checking to see if your system supports struct msghdr..." >&4
14794 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
14796 case "$d_msghdr_s" in
14797 "$define") echo "Yes, it does." ;;
14798 *) echo "No, it doesn't." ;;
14802 : see if msync exists
14806 : see if munmap exists
14807 set munmap d_munmap
14810 : see if nice exists
14814 : see if this is a langinfo.h system
14815 set langinfo.h i_langinfo
14818 : see if nl_langinfo exists
14819 set nl_langinfo d_nl_langinfo
14822 : check for length of character
14824 case "$charsize" in
14826 echo "Checking to see how big your characters are (hey, you never know)..." >&4
14829 #$i_stdlib I_STDLIB
14831 #include <stdlib.h>
14835 printf("%d\n", (int)sizeof(char));
14840 if eval $compile_ok; then
14844 echo "(I can't seem to compile the test program. Guessing...)"
14851 rp="What is the size of a character (in bytes)?"
14856 : check for volatile keyword
14858 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
14859 $cat >try.c <<'EOCP'
14862 typedef struct _goo_struct goo_struct;
14863 goo_struct * volatile goo = ((goo_struct *)0);
14864 struct _goo_struct {
14869 typedef unsigned short foo_t;
14870 char *volatile foo;
14872 volatile foo_t blech;
14876 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
14878 echo "Yup, it does."
14881 echo "Nope, it doesn't."
14889 $echo "Choosing the C types to be used for Perl's internal types..." >&4
14891 case "$use64bitint:$d_quad:$quadtype" in
14894 uvtype="$uquadtype"
14899 uvtype="unsigned long"
14905 case "$uselongdouble:$d_longdbl" in
14907 nvtype="long double"
14908 nvsize=$longdblsize
14915 $echo "(IV will be "$ivtype", $ivsize bytes)"
14916 $echo "(UV will be "$uvtype", $uvsize bytes)"
14917 $echo "(NV will be "$nvtype", $nvsize bytes)"
14920 #$i_inttypes I_INTTYPES
14922 #include <inttypes.h>
14927 int8_t i = INT8_MAX;
14928 uint8_t u = UINT8_MAX;
14929 printf("int8_t\n");
14932 int16_t i = INT16_MAX;
14933 uint16_t i = UINT16_MAX;
14934 printf("int16_t\n");
14937 int32_t i = INT32_MAX;
14938 uint32_t u = UINT32_MAX;
14939 printf("int32_t\n");
14945 '') case "$charsize" in
14947 u8type="unsigned char"
14956 if eval $compile; then
14957 case "`$run ./try`" in
14958 int8_t) i8type=int8_t
14968 '') if $test $charsize -ge 1; then
14970 u8type="unsigned char"
14978 '') case "$shortsize" in
14980 u16type="unsigned short"
14988 '') set try -DINT16
14989 if eval $compile; then
14990 case "`$run ./try`" in
15002 '') if $test $shortsize -ge 2; then
15004 u16type="unsigned short"
15012 '') case "$longsize" in
15014 u32type="unsigned long"
15018 *) case "$intsize" in
15020 u32type="unsigned int"
15030 '') set try -DINT32
15031 if eval $compile; then
15032 case "`$run ./try`" in
15044 '') if $test $intsize -ge 4; then
15046 u32type="unsigned int"
15054 '') case "$d_quad:$quadtype" in
15056 i64type="$quadtype"
15057 u64type="$uquadtype"
15065 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
15066 : volatile so that the compiler has to store it out to memory.
15067 if test X"$d_volatile" = X"$define"; then
15072 #$i_stdlib I_STDLIB
15074 #include <stdlib.h>
15076 #include <sys/types.h>
15077 #include <signal.h>
15079 $volatile int bletched = 0;
15080 $signal_t blech(int s) { bletched = 1; }
15085 int n = 8 * $uvsize;
15088 signal(SIGFPE, blech);
15091 for (i = 0; i < n; i++) {
15092 u = u << 1 | ($uvtype)1;
15094 if (($uvtype)d != u)
15098 d = ($nvtype)(u - 1);
15099 if (($uvtype)d != (u - 1))
15107 printf("%d\n", ((i == n) ? -n : i));
15113 d_nv_preserves_uv="$undef"
15114 if eval $compile; then
15115 nv_preserves_uv_bits="`$run ./try`"
15117 case "$nv_preserves_uv_bits" in
15119 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
15120 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
15121 d_nv_preserves_uv="$define"
15123 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
15124 d_nv_preserves_uv="$undef" ;;
15125 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
15126 nv_preserves_uv_bits="$undef" ;;
15131 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
15132 : volatile so that the compiler has to store it out to memory.
15133 if test X"$d_volatile" = X"$define"; then
15138 #$i_stdlib I_STDLIB
15140 #include <stdlib.h>
15142 #$i_string I_STRING
15144 # include <string.h>
15146 # include <strings.h>
15148 #include <sys/types.h>
15149 #include <signal.h>
15151 $volatile int bletched = 0;
15152 $signal_t blech(int s) { bletched = 1; }
15155 int checkit($nvtype d, char *where) {
15156 unsigned char *p = (char *)&d;
15157 unsigned char *end = p + sizeof(d);
15167 printf("No - %s: 0x", where);
15169 printf ("%02X", *p++);
15174 int main(int argc, char **argv) {
15177 fail += checkit(d, "0.0");
15179 /* The compiler shouldn't be assuming that bletched is 0 */
15182 fail += checkit(d, "bleched");
15185 signal(SIGFPE, blech);
15188 /* Paranoia - the compiler should have no way of knowing that ANSI says
15189 that argv[argc] will always be NULL. Actually, if it did assume this it
15190 would be buggy, as this is C and main() can be called from elsewhere in
15192 d = argv[argc] ? 1 : 0;
15195 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
15198 fail += checkit(d, "ternary");
15200 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
15203 printf("No - memset doesn't give 0.0\n");
15204 /* This might just blow up: */
15205 printf("(gives %g)\n", d);
15211 printf("No - something bleched\n");
15216 printf("No - %d fail(s)\n", fail);
15225 d_nv_zero_is_allbits_zero="$undef"
15226 if eval $compile; then
15232 0.0 is represented as all bits zero in memory
15234 d_nv_zero_is_allbits_zero="$define"
15237 0.0 is not represented as all bits zero in memory
15239 d_nv_zero_is_allbits_zero="$undef"
15244 0.0 is not represented as all bits zero in memory
15246 d_nv_zero_is_allbits_zero="$undef"
15254 : check for off64_t
15256 echo "Checking to see if you have off64_t..." >&4
15258 #include <sys/types.h>
15259 #include <unistd.h>
15260 int main() { off64_t x = 7; }
15263 if eval $compile; then
15265 echo "You have off64_t."
15268 echo "You do not have off64_t."
15269 case "$lseeksize" in
15270 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
15277 : how to create joinable pthreads
15278 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
15280 echo "Checking what constant to use for creating joinable pthreads..." >&4
15281 $cat >try.c <<'EOCP'
15282 #include <pthread.h>
15284 int detachstate = JOINABLE;
15287 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
15288 if eval $compile; then
15289 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
15290 val="$undef" # Yes, undef.
15291 set d_old_pthread_create_joinable
15294 set old_pthread_create_joinable
15297 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
15298 if eval $compile; then
15299 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
15301 set d_old_pthread_create_joinable
15303 val=PTHREAD_CREATE_UNDETACHED
15304 set old_pthread_create_joinable
15307 set try -DJOINABLE=__UNDETACHED
15308 if eval $compile; then
15309 echo "You seem to use __UNDETACHED." >&4
15311 set d_old_pthread_create_joinable
15314 set old_pthread_create_joinable
15317 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
15319 set d_old_pthread_create_joinable
15322 set old_pthread_create_joinable
15329 d_old_pthread_create_joinable="$undef"
15330 old_pthread_create_joinable=""
15333 : see if pause exists
15337 : see if pipe exists
15341 : see if poll exists
15345 : see if readlink exists
15346 set readlink d_readlink
15352 case "$d_readlink" in
15354 if $issymlink /proc/self/exe ; then
15355 $ls -l /proc/self/exe > reflect
15356 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15357 echo "You have Linux-like /proc/self/exe."
15358 procselfexe='"/proc/self/exe"'
15362 if $issymlink /proc/curproc/file ; then
15363 $ls -l /proc/curproc/file > reflect
15364 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15365 echo "You have BSD-like /proc/curproc/file."
15366 procselfexe='"/proc/curproc/file"'
15376 : see whether the pthread_atfork exists
15378 #include <pthread.h>
15381 #ifdef PTHREAD_ATFORK
15382 pthread_atfork(NULL,NULL,NULL);
15387 : see if pthread_atfork exists
15388 set try -DPTHREAD_ATFORK
15389 if eval $compile; then
15394 case "$usethreads" in
15397 $define) echo 'pthread_atfork found.' >&4 ;;
15398 *) echo 'pthread_atfork NOT found.' >&4 ;;
15401 set d_pthread_atfork
15404 : see if pthread_attr_setscope exists
15405 set pthread_attr_setscope d_pthread_attr_setscope
15409 : see whether the various POSIXish _yields exist
15411 #include <pthread.h>
15417 #ifdef PTHREAD_YIELD
15420 #ifdef PTHREAD_YIELD_NULL
15421 pthread_yield(NULL);
15427 : see if sched_yield exists
15428 set try -DSCHED_YIELD
15429 if eval $compile; then
15431 sched_yield='sched_yield()'
15435 case "$usethreads" in
15438 $define) echo 'sched_yield() found.' >&4 ;;
15439 *) echo 'sched_yield() NOT found.' >&4 ;;
15445 : see if pthread_yield exists
15446 set try -DPTHREAD_YIELD
15447 if eval $compile; then
15449 case "$sched_yield" in
15450 '') sched_yield='pthread_yield()' ;;
15453 set try -DPTHREAD_YIELD_NULL
15454 if eval $compile; then
15456 case "$sched_yield" in
15457 '') sched_yield='pthread_yield(NULL)' ;;
15463 case "$usethreads" in
15466 $define) echo 'pthread_yield() found.' >&4 ;;
15467 *) echo 'pthread_yield() NOT found.' >&4 ;;
15471 set d_pthread_yield
15474 case "$sched_yield" in
15475 '') sched_yield=undef ;;
15480 : see if random_r exists
15481 set random_r d_random_r
15483 case "$d_random_r" in
15485 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
15486 case "$d_random_r_proto:$usethreads" in
15487 ":define") d_random_r_proto=define
15488 set d_random_r_proto random_r $hdrs
15492 case "$d_random_r_proto" in
15494 case "$random_r_proto" in
15495 ''|0) try='int random_r(int*, struct random_data*);'
15496 ./protochk "extern $try" $hdrs && random_r_proto=I_iS ;;
15498 case "$random_r_proto" in
15499 ''|0) try='int random_r(long*, struct random_data*);'
15500 ./protochk "extern $try" $hdrs && random_r_proto=I_lS ;;
15502 case "$random_r_proto" in
15503 ''|0) try='int random_r(struct random_data*, int32_t*);'
15504 ./protochk "extern $try" $hdrs && random_r_proto=I_St ;;
15506 case "$random_r_proto" in
15507 ''|0) d_random_r=undef
15509 echo "Disabling random_r, cannot determine prototype." >&4 ;;
15510 * ) case "$random_r_proto" in
15511 REENTRANT_PROTO*) ;;
15512 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
15514 echo "Prototype: $try" ;;
15517 *) case "$usethreads" in
15518 define) echo "random_r has no prototype, not using it." >&4 ;;
15525 *) random_r_proto=0
15529 : see if readdir and friends exist
15530 set readdir d_readdir
15532 set seekdir d_seekdir
15534 set telldir d_telldir
15536 set rewinddir d_rewinddir
15539 : see if readdir64_r exists
15540 set readdir64_r d_readdir64_r
15542 case "$d_readdir64_r" in
15544 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15545 case "$d_readdir64_r_proto:$usethreads" in
15546 ":define") d_readdir64_r_proto=define
15547 set d_readdir64_r_proto readdir64_r $hdrs
15551 case "$d_readdir64_r_proto" in
15553 case "$readdir64_r_proto" in
15554 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
15555 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TSR ;;
15557 case "$readdir64_r_proto" in
15558 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
15559 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TS ;;
15561 case "$readdir64_r_proto" in
15562 ''|0) d_readdir64_r=undef
15563 readdir64_r_proto=0
15564 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
15565 * ) case "$readdir64_r_proto" in
15566 REENTRANT_PROTO*) ;;
15567 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
15569 echo "Prototype: $try" ;;
15572 *) case "$usethreads" in
15573 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
15575 d_readdir64_r=undef
15576 readdir64_r_proto=0
15580 *) readdir64_r_proto=0
15584 : see if readdir_r exists
15585 set readdir_r d_readdir_r
15587 case "$d_readdir_r" in
15589 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15590 case "$d_readdir_r_proto:$usethreads" in
15591 ":define") d_readdir_r_proto=define
15592 set d_readdir_r_proto readdir_r $hdrs
15596 case "$d_readdir_r_proto" in
15598 case "$readdir_r_proto" in
15599 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
15600 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TSR ;;
15602 case "$readdir_r_proto" in
15603 ''|0) try='int readdir_r(DIR*, struct dirent*);'
15604 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TS ;;
15606 case "$readdir_r_proto" in
15607 ''|0) d_readdir_r=undef
15609 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
15610 * ) case "$readdir_r_proto" in
15611 REENTRANT_PROTO*) ;;
15612 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
15614 echo "Prototype: $try" ;;
15617 *) case "$usethreads" in
15618 define) echo "readdir_r has no prototype, not using it." >&4 ;;
15625 *) readdir_r_proto=0
15629 : see if readv exists
15633 : see if recvmsg exists
15634 set recvmsg d_recvmsg
15637 : see if rename exists
15638 set rename d_rename
15641 : see if rmdir exists
15645 : see if memory.h is available.
15650 : See if it conflicts with string.h
15656 $cppstdin $cppflags $cppminus < $strings > mem.h
15657 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
15659 echo "We won't be including <memory.h>."
15669 : can bcopy handle overlapping blocks?
15672 case "$d_memmove" in
15673 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
15674 *) case "$d_bcopy" in
15676 echo "Checking to see if bcopy() can do overlapping copies..." >&4
15678 #$i_memory I_MEMORY
15679 #$i_stdlib I_STDLIB
15680 #$i_string I_STRING
15681 #$i_unistd I_UNISTD
15683 $cat >>try.c <<'EOCP'
15686 # include <memory.h>
15689 # include <stdlib.h>
15692 # include <string.h>
15694 # include <strings.h>
15697 # include <unistd.h> /* Needed for NetBSD */
15701 char buf[128], abc[128];
15707 /* Copy "abcde..." string to char abc[] so that gcc doesn't
15708 try to store the string in read-only memory. */
15709 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
15711 for (align = 7; align >= 0; align--) {
15712 for (len = 36; len; len--) {
15714 bcopy(abc, b, len);
15715 for (off = 1; off <= len; off++) {
15716 bcopy(b, b+off, len);
15717 bcopy(b+off, b, len);
15718 if (bcmp(b, abc, len))
15727 if eval $compile_ok; then
15728 if ./try 2>/dev/null; then
15729 echo "Yes, it can."
15732 echo "It can't, sorry."
15735 echo "(I can't compile the test program, so we'll assume not...)"
15739 $rm -f try.* try core
15745 : can memcpy handle overlapping blocks?
15748 case "$d_memmove" in
15749 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
15750 *) case "$d_memcpy" in
15752 echo "Checking to see if memcpy() can do overlapping copies..." >&4
15754 #$i_memory I_MEMORY
15755 #$i_stdlib I_STDLIB
15756 #$i_string I_STRING
15757 #$i_unistd I_UNISTD
15759 $cat >>try.c <<'EOCP'
15762 # include <memory.h>
15765 # include <stdlib.h>
15768 # include <string.h>
15770 # include <strings.h>
15773 # include <unistd.h> /* Needed for NetBSD */
15777 char buf[128], abc[128];
15783 /* Copy "abcde..." string to char abc[] so that gcc doesn't
15784 try to store the string in read-only memory. */
15785 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
15787 for (align = 7; align >= 0; align--) {
15788 for (len = 36; len; len--) {
15790 memcpy(b, abc, len);
15791 for (off = 1; off <= len; off++) {
15792 memcpy(b+off, b, len);
15793 memcpy(b, b+off, len);
15794 if (memcmp(b, abc, len))
15803 if eval $compile_ok; then
15804 if ./try 2>/dev/null; then
15805 echo "Yes, it can."
15808 echo "It can't, sorry."
15811 echo "(I can't compile the test program, so we'll assume not...)"
15815 $rm -f try.* try core
15821 : can memcmp be trusted to compare relative magnitude?
15823 case "$d_memcmp" in
15826 echo "Checking if your memcmp() can compare relative magnitude..." >&4
15828 #$i_memory I_MEMORY
15829 #$i_stdlib I_STDLIB
15830 #$i_string I_STRING
15831 #$i_unistd I_UNISTD
15833 $cat >>try.c <<'EOCP'
15836 # include <memory.h>
15839 # include <stdlib.h>
15842 # include <string.h>
15844 # include <strings.h>
15847 # include <unistd.h> /* Needed for NetBSD */
15853 if ((a < b) && memcmp(&a, &b, 1) < 0)
15859 if eval $compile_ok; then
15860 if $run ./try 2>/dev/null; then
15861 echo "Yes, it can."
15864 echo "No, it can't (it uses signed chars)."
15867 echo "(I can't compile the test program, so we'll assume not...)"
15871 $rm -f try.* try core
15875 : see if prototype for sbrk is available
15877 set d_sbrkproto sbrk $i_unistd unistd.h
15880 : see if select exists
15881 set select d_select
15884 : see if semctl exists
15885 set semctl d_semctl
15888 : see if semget exists
15889 set semget d_semget
15892 : see if semop exists
15896 : see how much of the 'sem*(2)' library is present.
15899 case "$d_semctl$d_semget$d_semop" in
15900 *"$undef"*) h_sem=false;;
15904 case "`ipcs 2>&1`" in
15905 "SVID messages"*"not configured"*)
15906 echo "Your $osname does not have the sem*(2) configured." >&4
15909 set semctl d_semctl
15911 set semget d_semget
15919 : we could also check for sys/ipc.h ...
15920 if $h_sem && $test `./findhdr sys/sem.h`; then
15921 echo "You have the full sem*(2) library." >&4
15924 echo "You don't have the full sem*(2) library." >&4
15930 : see whether sys/sem.h defines union semun
15932 $cat > try.c <<'END'
15933 #include <sys/types.h>
15934 #include <sys/ipc.h>
15935 #include <sys/sem.h>
15936 int main () { union semun semun; semun.buf = 0; }
15939 if eval $compile; then
15940 echo "You have union semun in <sys/sem.h>." >&4
15943 echo "You do not have union semun in <sys/sem.h>." >&4
15950 : see how to do semctl IPC_STAT
15957 # define S_IRUSR S_IREAD
15958 # define S_IWUSR S_IWRITE
15959 # define S_IXUSR S_IEXEC
15961 # define S_IRUSR 0400
15962 # define S_IWUSR 0200
15963 # define S_IXUSR 0100
15965 # define S_IRGRP (S_IRUSR>>3)
15966 # define S_IWGRP (S_IWUSR>>3)
15967 # define S_IXGRP (S_IXUSR>>3)
15968 # define S_IROTH (S_IRUSR>>6)
15969 # define S_IWOTH (S_IWUSR>>6)
15970 # define S_IXOTH (S_IXUSR>>6)
15973 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
15974 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
15975 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
15978 : see whether semctl IPC_STAT can use union semun
15979 case "$d_semctl_semun" in
15983 #include <sys/types.h>
15984 #include <sys/ipc.h>
15985 #include <sys/sem.h>
15986 #include <sys/stat.h>
15993 #$d_union_semun HAS_UNION_SEMUN
15996 #ifndef HAS_UNION_SEMUN
15999 struct semid_ds *buf;
16000 unsigned short *array;
16006 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16007 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16009 struct semid_ds argbuf;
16012 st = semctl(sem, 0, IPC_STAT, arg);
16016 # endif /* IPC_STAT */
16017 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16019 if (semctl(sem, 0, IPC_RMID, arg) != 0)
16020 # endif /* IPC_RMID */
16021 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16023 #endif /* IPC_PRIVATE && ... */
16024 printf("semget failed: errno = %d\n", errno);
16029 if eval $compile; then
16032 semun) val="$define" ;;
16040 case "$d_semctl_semun" in
16042 echo "You can use union semun for semctl IPC_STAT." >&4
16045 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
16050 : see whether semctl IPC_STAT can use struct semid_ds pointer
16051 case "$d_semctl_semid_ds" in
16054 $cat > try.c <<'END'
16055 #include <sys/types.h>
16056 #include <sys/ipc.h>
16057 #include <sys/sem.h>
16058 #include <sys/stat.h>
16066 struct semid_ds arg;
16069 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16070 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16073 st = semctl(sem, 0, IPC_STAT, &arg);
16075 printf("semid_ds\n");
16077 # endif /* IPC_STAT */
16078 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16080 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
16081 # endif /* IPC_RMID */
16082 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16084 #endif /* IPC_PRIVATE && ... */
16085 printf("semget failed: errno = %d\n", errno);
16091 if eval $compile; then
16094 semid_ds) val="$define" ;;
16098 set d_semctl_semid_ds
16102 case "$d_semctl_semid_ds" in
16104 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
16106 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
16113 # We do not have the full sem*(2) library, so assume we can not
16119 set d_semctl_semid_ds
16124 : see if sendmsg exists
16125 set sendmsg d_sendmsg
16128 : see if setegid exists
16129 set setegid d_setegid
16132 : see if seteuid exists
16133 set seteuid d_seteuid
16136 : see if setgrent exists
16137 set setgrent d_setgrent
16140 : see if setgrent_r exists
16141 set setgrent_r d_setgrent_r
16143 case "$d_setgrent_r" in
16145 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
16146 case "$d_setgrent_r_proto:$usethreads" in
16147 ":define") d_setgrent_r_proto=define
16148 set d_setgrent_r_proto setgrent_r $hdrs
16152 case "$d_setgrent_r_proto" in
16154 case "$setgrent_r_proto" in
16155 ''|0) try='int setgrent_r(FILE**);'
16156 ./protochk "extern $try" $hdrs && setgrent_r_proto=I_H ;;
16158 case "$setgrent_r_proto" in
16159 ''|0) try='void setgrent_r(FILE**);'
16160 ./protochk "extern $try" $hdrs && setgrent_r_proto=V_H ;;
16162 case "$setgrent_r_proto" in
16163 ''|0) d_setgrent_r=undef
16165 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
16166 * ) case "$setgrent_r_proto" in
16167 REENTRANT_PROTO*) ;;
16168 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
16170 echo "Prototype: $try" ;;
16173 *) case "$usethreads" in
16174 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
16181 *) setgrent_r_proto=0
16185 : see if sethostent exists
16186 set sethostent d_sethent
16189 : see if sethostent_r exists
16190 set sethostent_r d_sethostent_r
16192 case "$d_sethostent_r" in
16194 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16195 case "$d_sethostent_r_proto:$usethreads" in
16196 ":define") d_sethostent_r_proto=define
16197 set d_sethostent_r_proto sethostent_r $hdrs
16201 case "$d_sethostent_r_proto" in
16203 case "$sethostent_r_proto" in
16204 ''|0) try='int sethostent_r(int, struct hostent_data*);'
16205 ./protochk "extern $try" $hdrs && sethostent_r_proto=I_ID ;;
16207 case "$sethostent_r_proto" in
16208 ''|0) try='void sethostent_r(int, struct hostent_data*);'
16209 ./protochk "extern $try" $hdrs && sethostent_r_proto=V_ID ;;
16211 case "$sethostent_r_proto" in
16212 ''|0) d_sethostent_r=undef
16213 sethostent_r_proto=0
16214 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
16215 * ) case "$sethostent_r_proto" in
16216 REENTRANT_PROTO*) ;;
16217 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
16219 echo "Prototype: $try" ;;
16222 *) case "$usethreads" in
16223 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
16225 d_sethostent_r=undef
16226 sethostent_r_proto=0
16230 *) sethostent_r_proto=0
16234 : see if setitimer exists
16235 set setitimer d_setitimer
16238 : see if setlinebuf exists
16239 set setlinebuf d_setlinebuf
16242 : see if setlocale exists
16243 set setlocale d_setlocale
16246 : see if locale.h is available
16247 set locale.h i_locale
16250 : see if setlocale_r exists
16251 set setlocale_r d_setlocale_r
16253 case "$d_setlocale_r" in
16255 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
16256 case "$d_setlocale_r_proto:$usethreads" in
16257 ":define") d_setlocale_r_proto=define
16258 set d_setlocale_r_proto setlocale_r $hdrs
16262 case "$d_setlocale_r_proto" in
16264 case "$setlocale_r_proto" in
16265 ''|0) try='int setlocale_r(int, const char*, char*, int);'
16266 ./protochk "extern $try" $hdrs && setlocale_r_proto=I_ICBI ;;
16268 case "$setlocale_r_proto" in
16269 ''|0) d_setlocale_r=undef
16270 setlocale_r_proto=0
16271 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
16272 * ) case "$setlocale_r_proto" in
16273 REENTRANT_PROTO*) ;;
16274 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
16276 echo "Prototype: $try" ;;
16279 *) case "$usethreads" in
16280 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
16282 d_setlocale_r=undef
16283 setlocale_r_proto=0
16287 *) setlocale_r_proto=0
16291 : see if setnetent exists
16292 set setnetent d_setnent
16295 : see if setnetent_r exists
16296 set setnetent_r d_setnetent_r
16298 case "$d_setnetent_r" in
16300 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16301 case "$d_setnetent_r_proto:$usethreads" in
16302 ":define") d_setnetent_r_proto=define
16303 set d_setnetent_r_proto setnetent_r $hdrs
16307 case "$d_setnetent_r_proto" in
16309 case "$setnetent_r_proto" in
16310 ''|0) try='int setnetent_r(int, struct netent_data*);'
16311 ./protochk "extern $try" $hdrs && setnetent_r_proto=I_ID ;;
16313 case "$setnetent_r_proto" in
16314 ''|0) try='void setnetent_r(int, struct netent_data*);'
16315 ./protochk "extern $try" $hdrs && setnetent_r_proto=V_ID ;;
16317 case "$setnetent_r_proto" in
16318 ''|0) d_setnetent_r=undef
16319 setnetent_r_proto=0
16320 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
16321 * ) case "$setnetent_r_proto" in
16322 REENTRANT_PROTO*) ;;
16323 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
16325 echo "Prototype: $try" ;;
16328 *) case "$usethreads" in
16329 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
16331 d_setnetent_r=undef
16332 setnetent_r_proto=0
16336 *) setnetent_r_proto=0
16340 : see if setprotoent exists
16341 set setprotoent d_setpent
16344 : see if setpgid exists
16345 set setpgid d_setpgid
16348 : see if setpgrp2 exists
16349 set setpgrp2 d_setpgrp2
16352 : see if setpriority exists
16353 set setpriority d_setprior
16356 : see if setproctitle exists
16357 set setproctitle d_setproctitle
16360 : see if setprotoent_r exists
16361 set setprotoent_r d_setprotoent_r
16363 case "$d_setprotoent_r" in
16365 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16366 case "$d_setprotoent_r_proto:$usethreads" in
16367 ":define") d_setprotoent_r_proto=define
16368 set d_setprotoent_r_proto setprotoent_r $hdrs
16372 case "$d_setprotoent_r_proto" in
16374 case "$setprotoent_r_proto" in
16375 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
16376 ./protochk "extern $try" $hdrs && setprotoent_r_proto=I_ID ;;
16378 case "$setprotoent_r_proto" in
16379 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
16380 ./protochk "extern $try" $hdrs && setprotoent_r_proto=V_ID ;;
16382 case "$setprotoent_r_proto" in
16383 ''|0) d_setprotoent_r=undef
16384 setprotoent_r_proto=0
16385 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
16386 * ) case "$setprotoent_r_proto" in
16387 REENTRANT_PROTO*) ;;
16388 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
16390 echo "Prototype: $try" ;;
16393 *) case "$usethreads" in
16394 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
16396 d_setprotoent_r=undef
16397 setprotoent_r_proto=0
16401 *) setprotoent_r_proto=0
16405 : see if setpwent exists
16406 set setpwent d_setpwent
16409 : see if setpwent_r exists
16410 set setpwent_r d_setpwent_r
16412 case "$d_setpwent_r" in
16414 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
16415 case "$d_setpwent_r_proto:$usethreads" in
16416 ":define") d_setpwent_r_proto=define
16417 set d_setpwent_r_proto setpwent_r $hdrs
16421 case "$d_setpwent_r_proto" in
16423 case "$setpwent_r_proto" in
16424 ''|0) try='int setpwent_r(FILE**);'
16425 ./protochk "extern $try" $hdrs && setpwent_r_proto=I_H ;;
16427 case "$setpwent_r_proto" in
16428 ''|0) try='void setpwent_r(FILE**);'
16429 ./protochk "extern $try" $hdrs && setpwent_r_proto=V_H ;;
16431 case "$setpwent_r_proto" in
16432 ''|0) d_setpwent_r=undef
16434 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
16435 * ) case "$setpwent_r_proto" in
16436 REENTRANT_PROTO*) ;;
16437 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
16439 echo "Prototype: $try" ;;
16442 *) case "$usethreads" in
16443 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
16450 *) setpwent_r_proto=0
16454 : see if setregid exists
16455 set setregid d_setregid
16457 set setresgid d_setresgid
16460 : see if setreuid exists
16461 set setreuid d_setreuid
16463 set setresuid d_setresuid
16466 : see if setrgid exists
16467 set setrgid d_setrgid
16470 : see if setruid exists
16471 set setruid d_setruid
16474 : see if setservent exists
16475 set setservent d_setsent
16478 : see if setservent_r exists
16479 set setservent_r d_setservent_r
16481 case "$d_setservent_r" in
16483 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16484 case "$d_setservent_r_proto:$usethreads" in
16485 ":define") d_setservent_r_proto=define
16486 set d_setservent_r_proto setservent_r $hdrs
16490 case "$d_setservent_r_proto" in
16492 case "$setservent_r_proto" in
16493 ''|0) try='int setservent_r(int, struct servent_data*);'
16494 ./protochk "extern $try" $hdrs && setservent_r_proto=I_ID ;;
16496 case "$setservent_r_proto" in
16497 ''|0) try='void setservent_r(int, struct servent_data*);'
16498 ./protochk "extern $try" $hdrs && setservent_r_proto=V_ID ;;
16500 case "$setservent_r_proto" in
16501 ''|0) d_setservent_r=undef
16502 setservent_r_proto=0
16503 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
16504 * ) case "$setservent_r_proto" in
16505 REENTRANT_PROTO*) ;;
16506 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
16508 echo "Prototype: $try" ;;
16511 *) case "$usethreads" in
16512 define) echo "setservent_r has no prototype, not using it." >&4 ;;
16514 d_setservent_r=undef
16515 setservent_r_proto=0
16519 *) setservent_r_proto=0
16523 : see if setsid exists
16524 set setsid d_setsid
16527 : see if setvbuf exists
16528 set setvbuf d_setvbuf
16531 : see if sfio.h is available
16536 : see if sfio library is available
16547 : Ok, but do we want to use it.
16551 true|$define|[yY]*) dflt='y';;
16554 echo "$package can use the sfio library, but it is experimental."
16555 case "$useperlio" in
16557 echo "For sfio also the PerlIO abstraction layer is needed."
16558 echo "Earlier you said you wouldn't want that."
16561 rp="You seem to have sfio available, do you want to try using it?"
16564 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
16565 useperlio="$define"
16568 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
16573 *) case "$usesfio" in
16574 true|$define|[yY]*)
16575 echo "Sorry, cannot find sfio on this machine." >&4
16576 echo "Ignoring your setting of usesfio=$usesfio." >&4
16585 $define) usesfio='true';;
16586 *) usesfio='false';;
16590 *) : Remove sfio from list of libraries to use
16593 echo "Removing unneeded -lsfio from library list" >&4
16594 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
16597 echo "libs = $libs" >&4
16604 : see if shmctl exists
16605 set shmctl d_shmctl
16608 : see if shmget exists
16609 set shmget d_shmget
16612 : see if shmat exists
16615 : see what shmat returns
16618 $cat >shmat.c <<'END'
16619 #include <sys/shm.h>
16622 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
16627 echo "and it returns ($shmattype)." >&4
16628 : see if a prototype for shmat is available
16629 xxx=`./findhdr sys/shm.h`
16630 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
16631 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
16642 set d_shmatprototype
16645 : see if shmdt exists
16649 : see how much of the 'shm*(2)' library is present.
16652 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
16653 *"$undef"*) h_shm=false;;
16657 case "`ipcs 2>&1`" in
16658 "SVID shared memory"*"not configured"*)
16659 echo "Your $osname does not have the shm*(2) configured." >&4
16662 set shmctl d_shmctl
16664 set shmget d_shmget
16674 : we could also check for sys/ipc.h ...
16675 if $h_shm && $test `./findhdr sys/shm.h`; then
16676 echo "You have the full shm*(2) library." >&4
16679 echo "You don't have the full shm*(2) library." >&4
16686 : see if we have sigaction
16687 if set sigaction val -f d_sigaction; eval $csym; $val; then
16688 echo 'sigaction() found.' >&4
16691 #include <sys/types.h>
16692 #include <signal.h>
16693 #$i_stdlib I_STDLIB
16695 #include <stdlib.h>
16699 struct sigaction act, oact;
16701 oact.sa_handler = 0;
16702 /* so that act and oact are used */
16703 exit(act.sa_flags == 0 && oact.sa_handler == 0);
16707 if eval $compile_ok; then
16710 echo "But you don't seem to have a useable struct sigaction." >&4
16714 echo 'sigaction NOT found.' >&4
16717 set d_sigaction; eval $setvar
16718 $rm -f try try$_o try.c
16720 : see if sigprocmask exists
16721 set sigprocmask d_sigprocmask
16724 : see if sigsetjmp exists
16726 case "$d_sigsetjmp" in
16729 #include <setjmp.h>
16730 #$i_stdlib I_STDLIB
16732 #include <stdlib.h>
16738 if (sigsetjmp(env,1))
16741 siglongjmp(env, 1);
16746 if eval $compile; then
16747 if $run ./try >/dev/null 2>&1; then
16748 echo "POSIX sigsetjmp found." >&4
16752 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
16758 echo "sigsetjmp not found." >&4
16762 *) val="$d_sigsetjmp"
16763 case "$d_sigsetjmp" in
16764 $define) echo "POSIX sigsetjmp found." >&4;;
16765 $undef) echo "sigsetjmp not found." >&4;;
16773 : see if snprintf exists
16774 set snprintf d_snprintf
16777 : see if vsnprintf exists
16778 set vsnprintf d_vsnprintf
16781 case "$d_snprintf-$d_vsnprintf" in
16784 Checking whether your snprintf() and vsnprintf() work okay...
16786 $cat >try.c <<'EOCP'
16787 /* v?snprintf testing logic courtesy of Russ Allbery.
16788 * According to C99:
16789 * - if the buffer is too short it still must be \0-terminated
16790 * - if the buffer is too short the potentially required length
16791 * must be returned and not -1
16792 * - if the buffer is NULL the potentially required length
16793 * must be returned and not -1 or core dump
16796 #include <stdarg.h>
16800 int test (char *format, ...)
16805 va_start (args, format);
16806 count = vsnprintf (buf, sizeof buf, format, args);
16813 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
16814 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
16818 if eval $compile; then
16821 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
16823 Your snprintf() and snprintf() don't seem to be working okay.
16825 d_snprintf="$undef"
16826 d_vsnprintf="$undef"
16830 echo "(I can't seem to compile the test program--assuming they don't)"
16831 d_snprintf="$undef"
16832 d_vsnprintf="$undef"
16834 $rm -f try.* try core core.try.*
16838 : see if sockatmark exists
16839 set sockatmark d_sockatmark
16842 : see if prototype for sockatmark is available
16844 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
16847 : see if socks5_init exists
16848 set socks5_init d_socks5_init
16851 : see if sprintf returns the length of the string in the buffer as per ANSI
16852 $echo "Checking whether sprintf returns the length of the string..." >&4
16855 #$i_stdlib I_STDLIB
16857 #include <stdlib.h>
16859 #$i_string I_STRING
16861 # include <string.h>
16863 # include <strings.h>
16872 int check (size_t expect, int test) {
16873 size_t got = strlen(buffer);
16877 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
16882 int main(int argc, char **argv) {
16885 check(sprintf(buffer, ""), ++test);
16886 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
16887 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
16894 d_sprintf_returns_strlen="$undef"
16895 if eval $compile; then
16899 sprintf returns the length of the string (as ANSI says it should)
16901 d_sprintf_returns_strlen="$define"
16904 sprintf does not return the length of the string (how old is this system?)
16906 d_sprintf_returns_strlen="$undef"
16913 : see if srand48_r exists
16914 set srand48_r d_srand48_r
16916 case "$d_srand48_r" in
16918 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16919 case "$d_srand48_r_proto:$usethreads" in
16920 ":define") d_srand48_r_proto=define
16921 set d_srand48_r_proto srand48_r $hdrs
16925 case "$d_srand48_r_proto" in
16927 case "$srand48_r_proto" in
16928 ''|0) try='int srand48_r(long, struct drand48_data*);'
16929 ./protochk "extern $try" $hdrs && srand48_r_proto=I_LS ;;
16931 case "$srand48_r_proto" in
16932 ''|0) d_srand48_r=undef
16934 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
16935 * ) case "$srand48_r_proto" in
16936 REENTRANT_PROTO*) ;;
16937 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
16939 echo "Prototype: $try" ;;
16942 *) case "$usethreads" in
16943 define) echo "srand48_r has no prototype, not using it." >&4 ;;
16950 *) srand48_r_proto=0
16954 : see if srandom_r exists
16955 set srandom_r d_srandom_r
16957 case "$d_srandom_r" in
16959 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16960 case "$d_srandom_r_proto:$usethreads" in
16961 ":define") d_srandom_r_proto=define
16962 set d_srandom_r_proto srandom_r $hdrs
16966 case "$d_srandom_r_proto" in
16968 case "$srandom_r_proto" in
16969 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
16970 ./protochk "extern $try" $hdrs && srandom_r_proto=I_TS ;;
16972 case "$srandom_r_proto" in
16973 ''|0) d_srandom_r=undef
16975 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
16976 * ) case "$srandom_r_proto" in
16977 REENTRANT_PROTO*) ;;
16978 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
16980 echo "Prototype: $try" ;;
16983 *) case "$usethreads" in
16984 define) echo "srandom_r has no prototype, not using it." >&4 ;;
16991 *) srandom_r_proto=0
16995 : see if prototype for setresgid is available
16997 set d_sresgproto setresgid $i_unistd unistd.h
17000 : see if prototype for setresuid is available
17002 set d_sresuproto setresuid $i_unistd unistd.h
17005 : see if sys/stat.h is available
17006 set sys/stat.h i_sysstat
17010 : see if stat knows about block sizes
17012 echo "Checking to see if your struct stat has st_blocks field..." >&4
17013 set d_statblks stat st_blocks $i_sysstat sys/stat.h
17017 : see if this is a sys/vfs.h system
17018 set sys/vfs.h i_sysvfs
17022 : see if this is a sys/statfs.h system
17023 set sys/statfs.h i_sysstatfs
17028 echo "Checking to see if your system supports struct statfs..." >&4
17029 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
17031 case "$d_statfs_s" in
17032 "$define") echo "Yes, it does." ;;
17033 *) echo "No, it doesn't." ;;
17038 : see if struct statfs knows about f_flags
17039 case "$d_statfs_s" in
17042 echo "Checking to see if your struct statfs has f_flags field..." >&4
17043 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
17047 set d_statfs_f_flags
17051 case "$d_statfs_f_flags" in
17052 "$define") echo "Yes, it does." ;;
17053 *) echo "No, it doesn't." ;;
17057 Checking how to access stdio streams by file descriptor number...
17059 case "$stdio_stream_array" in
17060 '') $cat >try.c <<EOCP
17063 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
17067 for s in _iob __iob __sF
17069 set try -DSTDIO_STREAM_ARRAY=$s
17070 if eval $compile; then
17071 case "`$run ./try`" in
17072 yes) stdio_stream_array=$s; break ;;
17076 $rm -f try.* try$exe_ext
17078 case "$stdio_stream_array" in
17080 I can't figure out how to access stdio streams by file descriptor number.
17082 d_stdio_stream_array="$undef"
17085 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
17087 d_stdio_stream_array="$define"
17091 : see if strcoll exists
17092 set strcoll d_strcoll
17095 : check for structure copying
17097 echo "Checking to see if your C compiler can copy structs..." >&4
17098 $cat >try.c <<'EOCP'
17108 if $cc -c try.c >/dev/null 2>&1 ; then
17110 echo "Yup, it can."
17113 echo "Nope, it can't."
17119 : see if strerror and/or sys_errlist[] exist
17121 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
17122 if set strerror val -f d_strerror; eval $csym; $val; then
17123 echo 'strerror() found.' >&4
17124 d_strerror="$define"
17125 d_strerrm='strerror(e)'
17126 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17127 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
17128 d_syserrlst="$define"
17130 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
17131 d_syserrlst="$undef"
17133 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
17134 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
17135 echo 'strerror() found in string header.' >&4
17136 d_strerror="$define"
17137 d_strerrm='strerror(e)'
17138 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17139 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
17140 d_syserrlst="$define"
17142 echo "(You don't appear to have any sys_errlist[], how can this be?)"
17143 d_syserrlst="$undef"
17145 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17146 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
17147 d_strerror="$undef"
17148 d_syserrlst="$define"
17149 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
17151 echo 'strerror() and sys_errlist[] NOT found.' >&4
17152 d_strerror="$undef"
17153 d_syserrlst="$undef"
17154 d_strerrm='"unknown"'
17158 : see if strerror_r exists
17159 set strerror_r d_strerror_r
17161 case "$d_strerror_r" in
17163 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
17164 case "$d_strerror_r_proto:$usethreads" in
17165 ":define") d_strerror_r_proto=define
17166 set d_strerror_r_proto strerror_r $hdrs
17170 case "$d_strerror_r_proto" in
17172 case "$strerror_r_proto" in
17173 ''|0) try='int strerror_r(int, char*, size_t);'
17174 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBW ;;
17176 case "$strerror_r_proto" in
17177 ''|0) try='int strerror_r(int, char*, int);'
17178 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBI ;;
17180 case "$strerror_r_proto" in
17181 ''|0) try='char* strerror_r(int, char*, size_t);'
17182 ./protochk "extern $try" $hdrs && strerror_r_proto=B_IBW ;;
17184 case "$strerror_r_proto" in
17185 ''|0) d_strerror_r=undef
17187 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
17188 * ) case "$strerror_r_proto" in
17189 REENTRANT_PROTO*) ;;
17190 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
17192 echo "Prototype: $try" ;;
17195 *) case "$usethreads" in
17196 define) echo "strerror_r has no prototype, not using it." >&4 ;;
17203 *) strerror_r_proto=0
17207 : see if strftime exists
17208 set strftime d_strftime
17211 : see if strlcat exists
17212 set strlcat d_strlcat
17215 : see if strlcpy exists
17216 set strlcpy d_strlcpy
17219 : see if strtod exists
17220 set strtod d_strtod
17223 : see if strtol exists
17224 set strtol d_strtol
17227 : see if strtold exists
17228 set strtold d_strtold
17231 : see if strtoll exists
17232 set strtoll d_strtoll
17235 case "$d_longlong-$d_strtoll" in
17238 Checking whether your strtoll() works okay...
17240 $cat >try.c <<'EOCP'
17243 #define strtoll __strtoll
17246 #define strtoll _strtoll
17249 extern long long int strtoll(char *s, char **, int);
17250 static int bad = 0;
17251 int check(char *s, long long ell, int een) {
17254 gll = strtoll(s, 0, 10);
17255 if (!((gll == ell) && (errno == een)))
17259 check(" 1", 1LL, 0);
17260 check(" 0", 0LL, 0);
17261 check("-1", -1LL, 0);
17262 check("-9223372036854775808", -9223372036854775808LL, 0);
17263 check("-9223372036854775808", -9223372036854775808LL, 0);
17264 check(" 9223372036854775807", 9223372036854775807LL, 0);
17265 check("-9223372036854775808", -9223372036854775808LL, 0);
17266 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
17267 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
17273 if eval $compile; then
17276 ok) echo "Your strtoll() seems to be working okay." ;;
17278 Your strtoll() doesn't seem to be working okay.
17284 echo "(I can't seem to compile the test program--assuming it doesn't)"
17290 : see if strtoq exists
17291 set strtoq d_strtoq
17294 : see if strtoul exists
17295 set strtoul d_strtoul
17298 case "$d_strtoul" in
17301 Checking whether your strtoul() works okay...
17303 $cat >try.c <<'EOCP'
17306 extern unsigned long int strtoul(char *s, char **, int);
17307 static int bad = 0;
17308 void check(char *s, unsigned long eul, int een) {
17311 gul = strtoul(s, 0, 10);
17312 if (!((gul == eul) && (errno == een)))
17316 check(" 1", 1L, 0);
17317 check(" 0", 0L, 0);
17319 case "$longsize" in
17321 $cat >>try.c <<'EOCP'
17322 check("18446744073709551615", 18446744073709551615UL, 0);
17323 check("18446744073709551616", 18446744073709551615UL, ERANGE);
17324 #if 0 /* strtoul() for /^-/ strings is undefined. */
17325 check("-1", 18446744073709551615UL, 0);
17326 check("-18446744073709551614", 2, 0);
17327 check("-18446744073709551615", 1, 0);
17328 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
17329 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
17334 $cat >>try.c <<'EOCP'
17335 check("4294967295", 4294967295UL, 0);
17336 check("4294967296", 4294967295UL, ERANGE);
17337 #if 0 /* strtoul() for /^-/ strings is undefined. */
17338 check("-1", 4294967295UL, 0);
17339 check("-4294967294", 2, 0);
17340 check("-4294967295", 1, 0);
17341 check("-4294967296", 4294967295UL, ERANGE);
17342 check("-4294967297", 4294967295UL, ERANGE);
17347 : Should we write these tests to be more portable by sprintf-ing
17348 : ~0 and then manipulating that char string as input for strtol?
17351 $cat >>try.c <<'EOCP'
17358 if eval $compile; then
17359 case "`$run ./try`" in
17360 ok) echo "Your strtoul() seems to be working okay." ;;
17362 Your strtoul() doesn't seem to be working okay.
17371 : see if strtoull exists
17372 set strtoull d_strtoull
17375 case "$d_longlong-$d_strtoull" in
17378 Checking whether your strtoull() works okay...
17380 $cat >try.c <<'EOCP'
17383 #define strtoull __strtoull
17386 extern unsigned long long int strtoull(char *s, char **, int);
17387 static int bad = 0;
17388 int check(char *s, long long eull, int een) {
17391 gull = strtoull(s, 0, 10);
17392 if (!((gull == eull) && (errno == een)))
17396 check(" 1", 1LL, 0);
17397 check(" 0", 0LL, 0);
17398 check("18446744073709551615", 18446744073709551615ULL, 0);
17399 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17400 #if 0 /* strtoull() for /^-/ strings is undefined. */
17401 check("-1", 18446744073709551615ULL, 0);
17402 check("-18446744073709551614", 2LL, 0);
17403 check("-18446744073709551615", 1LL, 0);
17404 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17405 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17412 if eval $compile; then
17413 case "`$run ./try`" in
17414 ok) echo "Your strtoull() seems to be working okay." ;;
17416 Your strtoull() doesn't seem to be working okay.
17418 d_strtoull="$undef"
17425 : see if strtouq exists
17426 set strtouq d_strtouq
17429 case "$d_strtouq" in
17432 Checking whether your strtouq() works okay...
17434 $cat >try.c <<'EOCP'
17437 extern unsigned long long int strtouq(char *s, char **, int);
17438 static int bad = 0;
17439 void check(char *s, unsigned long long eull, int een) {
17440 unsigned long long gull;
17442 gull = strtouq(s, 0, 10);
17443 if (!((gull == eull) && (errno == een)))
17447 check(" 1", 1LL, 0);
17448 check(" 0", 0LL, 0);
17449 check("18446744073709551615", 18446744073709551615ULL, 0);
17450 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17451 #if 0 /* strtouq() for /^-/ strings is undefined. */
17452 check("-1", 18446744073709551615ULL, 0);
17453 check("-18446744073709551614", 2LL, 0);
17454 check("-18446744073709551615", 1LL, 0);
17455 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17456 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17464 if eval $compile; then
17465 case "`$run ./try`" in
17466 ok) echo "Your strtouq() seems to be working okay." ;;
17468 Your strtouq() doesn't seem to be working okay.
17477 : see if strxfrm exists
17478 set strxfrm d_strxfrm
17481 : see if symlink exists
17482 set symlink d_symlink
17485 : see if syscall exists
17486 set syscall d_syscall
17489 : see if prototype for syscall is available
17491 set d_syscallproto syscall $i_unistd unistd.h
17494 : see if sysconf exists
17495 set sysconf d_sysconf
17498 : see if system exists
17499 set system d_system
17502 : see if tcgetpgrp exists
17503 set tcgetpgrp d_tcgetpgrp
17506 : see if tcsetpgrp exists
17507 set tcsetpgrp d_tcsetpgrp
17510 : see if prototype for telldir is available
17512 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
17515 : see if time exists
17517 if test "X$d_time" = X -o X"$timetype" = X; then
17518 if set time val -f d_time; eval $csym; $val; then
17519 echo 'time() found.' >&4
17521 rp="What is the type returned by time() on this system?"
17522 set time_t timetype long stdio.h sys/types.h
17525 echo 'time() not found, hope that will do.' >&4
17533 : see if this is a sys/times.h system
17534 set sys/times.h i_systimes
17537 : see if times exists
17539 if set times val -f d_times; eval $csym; $val; then
17540 echo 'times() found.' >&4
17543 case "$i_systimes" in
17544 "$define") inc='sys/times.h';;
17546 rp="What is the type returned by times() on this system?"
17547 set clock_t clocktype long stdio.h sys/types.h $inc
17550 echo 'times() NOT found, hope that will do.' >&4
17555 : see if tmpnam_r exists
17556 set tmpnam_r d_tmpnam_r
17558 case "$d_tmpnam_r" in
17560 hdrs="$i_systypes sys/types.h define stdio.h "
17561 case "$d_tmpnam_r_proto:$usethreads" in
17562 ":define") d_tmpnam_r_proto=define
17563 set d_tmpnam_r_proto tmpnam_r $hdrs
17567 case "$d_tmpnam_r_proto" in
17569 case "$tmpnam_r_proto" in
17570 ''|0) try='char* tmpnam_r(char*);'
17571 ./protochk "extern $try" $hdrs && tmpnam_r_proto=B_B ;;
17573 case "$tmpnam_r_proto" in
17574 ''|0) d_tmpnam_r=undef
17576 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
17577 * ) case "$tmpnam_r_proto" in
17578 REENTRANT_PROTO*) ;;
17579 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
17581 echo "Prototype: $try" ;;
17584 *) case "$usethreads" in
17585 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
17592 *) tmpnam_r_proto=0
17596 : see if truncate exists
17597 set truncate d_truncate
17600 : see if ttyname_r exists
17601 set ttyname_r d_ttyname_r
17603 case "$d_ttyname_r" in
17605 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
17606 case "$d_ttyname_r_proto:$usethreads" in
17607 ":define") d_ttyname_r_proto=define
17608 set d_ttyname_r_proto ttyname_r $hdrs
17612 case "$d_ttyname_r_proto" in
17614 case "$ttyname_r_proto" in
17615 ''|0) try='int ttyname_r(int, char*, size_t);'
17616 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBW ;;
17618 case "$ttyname_r_proto" in
17619 ''|0) try='int ttyname_r(int, char*, int);'
17620 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBI ;;
17622 case "$ttyname_r_proto" in
17623 ''|0) try='char* ttyname_r(int, char*, int);'
17624 ./protochk "extern $try" $hdrs && ttyname_r_proto=B_IBI ;;
17626 case "$ttyname_r_proto" in
17627 ''|0) d_ttyname_r=undef
17629 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
17630 * ) case "$ttyname_r_proto" in
17631 REENTRANT_PROTO*) ;;
17632 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
17634 echo "Prototype: $try" ;;
17637 *) case "$usethreads" in
17638 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
17645 *) ttyname_r_proto=0
17649 : see if tzname[] exists
17651 if set tzname val -a d_tzname; eval $csym; $val; then
17653 echo 'tzname[] found.' >&4
17656 echo 'tzname[] NOT found.' >&4
17662 next|rhapsody|darwin) multiarch="$define" ;;
17664 case "$multiarch" in
17665 ''|[nN]*) multiarch="$undef" ;;
17668 : check for ordering of bytes in a UV
17670 case "$usecrosscompile$multiarch" in
17673 You seem to be either cross-compiling or doing a multiarchitecture build,
17674 skipping the byteorder check.
17680 case "$byteorder" in
17683 In the following, larger digits indicate more significance. A big-endian
17684 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
17685 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
17686 machines may have weird orders like 3412. A Cray will report 87654321,
17687 an Alpha will report 12345678. If the test program works the default is
17689 I'm now running the test program...
17693 #$i_stdlib I_STDLIB
17695 #include <stdlib.h>
17697 #include <sys/types.h>
17698 typedef $uvtype UV;
17708 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
17710 u.l = (UV)0x04030201;
17711 for (i = 0; i < $uvsize; i++)
17712 printf("%c", u.c[i]+'0');
17719 if eval $compile && ./try > /dev/null; then
17722 [1-4][1-4][1-4][1-4]|12345678|87654321)
17723 echo "(The test program ran ok.)"
17724 echo "byteorder=$dflt"
17727 ????|????????) echo "(The test program ran ok.)" ;;
17728 *) echo "(The test program didn't run right for some reason.)" ;;
17733 (I can't seem to compile the test program. Guessing big-endian...)
17736 case "$xxx_prompt" in
17738 rp="What is the order of bytes in $uvtype?"
17754 Checking to see whether you can access character data unalignedly...
17756 case "$d_u32align" in
17757 '') $cat >try.c <<EOCP
17759 #$i_stdlib I_STDLIB
17761 #include <stdlib.h>
17763 #define U32 $u32type
17764 #define BYTEORDER 0x$byteorder
17766 #include <signal.h>
17768 $signal_t bletch(int s) { exit(4); }
17771 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
17776 if (sizeof(U32) != 4) {
17777 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
17784 signal(SIGBUS, bletch);
17796 for (i = 0; i < 4; i++) {
17797 up = (U32*)(buf + i);
17798 if (! ((*up == 1 << (8*i)) || /* big-endian */
17799 (*up == 1 << (8*(3-i))) /* little-endian */
17803 printf("read failed (%x)\n", *up);
17809 for (i = 0; i < 4; i++) {
17810 up = (U32*)(buf + i);
17812 if (*up != 0xBeef) {
17813 printf("write failed (%x)\n", *up);
17827 if eval $compile_ok; then
17828 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
17829 $run ./try 2>&1 >/dev/null
17832 You can access character data pretty unalignedly.
17834 d_u32align="$undef"
17837 It seems that you must access character data in an aligned manner.
17839 d_u32align="$define"
17843 rp='Can you access character data at unaligned addresses?'
17847 [yY]*) d_u32align="$undef" ;;
17848 *) d_u32align="$define" ;;
17851 $rm -f core core.try.* try.core
17855 : see if ualarm exists
17856 set ualarm d_ualarm
17859 : see if umask exists
17863 : see if unordered exists
17864 set unordered d_unordered
17867 : see if unsetenv exists
17868 set unsetenv d_unsetenv
17871 : see if usleep exists
17872 set usleep d_usleep
17875 : see if prototype for usleep is available
17877 set d_usleepproto usleep $i_unistd unistd.h
17880 : see if ustat exists
17884 : backward compatibility for d_hvfork
17885 if test X$d_hvfork != X; then
17886 d_vfork="$d_hvfork"
17889 : see if there is a vfork
17894 : Ok, but do we want to use it. vfork is reportedly unreliable in
17895 : perl on Solaris 2.x, and probably elsewhere.
17899 case "$usevfork" in
17905 Perl can only use a vfork() that doesn't suffer from strict
17906 restrictions on calling functions or modifying global data in
17907 the child. For example, glibc-2.1 contains such a vfork()
17908 that is unsuitable. If your system provides a proper fork()
17909 call, chances are that you do NOT want perl to use vfork().
17912 rp="Do you still want to use vfork()?"
17917 echo "Ok, we won't use vfork()."
17926 $define) usevfork='true';;
17927 *) usevfork='false';;
17930 : see if closedir exists
17931 set closedir d_closedir
17934 case "$d_closedir" in
17937 echo "Checking whether closedir() returns a status..." >&4
17939 #$i_dirent I_DIRENT /**/
17940 #$i_sysdir I_SYS_DIR /**/
17941 #$i_sysndir I_SYS_NDIR /**/
17942 #$i_systypes I_SYS_TYPES /**/
17944 #if defined(I_SYS_TYPES)
17945 #include <sys/types.h>
17947 #if defined(I_DIRENT)
17948 #include <dirent.h>
17949 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
17950 #include <sys/dir.h>
17954 #include <sys/ndir.h>
17958 #include <ndir.h> /* may be wrong in the future */
17960 #include <sys/dir.h>
17965 int main() { return closedir(opendir(".")); }
17968 if eval $compile_ok; then
17969 if $run ./try > /dev/null 2>&1 ; then
17970 echo "Yes, it does."
17973 echo "No, it doesn't."
17977 echo "(I can't seem to compile the test program--assuming it doesn't)"
17985 set d_void_closedir
17988 : see if there is a wait4
17992 : see if waitpid exists
17993 set waitpid d_waitpid
17996 : see if wcstombs exists
17997 set wcstombs d_wcstombs
18000 : see if wctomb exists
18001 set wctomb d_wctomb
18004 : see if writev exists
18005 set writev d_writev
18008 : preserve RCS keywords in files with variable substitution, grrr
18013 Revision='$Revision'
18015 : check for alignment requirements
18017 case "$usecrosscompile$multiarch" in
18020 You seem to be either cross-compiling or doing a multiarchitecture build,
18021 skipping the memory alignment check.
18024 case "$alignbytes" in
18025 '') alignbytes=8 ;;
18029 case "$alignbytes" in
18030 '') echo "Checking alignment constraints..." >&4
18031 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
18032 $cat >try.c <<'EOCP'
18033 typedef long double NV;
18036 $cat >try.c <<'EOCP'
18040 $cat >>try.c <<'EOCP'
18048 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
18053 if eval $compile_ok; then
18057 echo "(I can't seem to compile the test program...)"
18060 *) dflt="$alignbytes"
18063 rp="Doubles must be aligned on a how-many-byte boundary?"
18071 : set the base revision
18074 : how do we concatenate cpp tokens here?
18076 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
18077 $cat >cpp_stuff.c <<'EOCP'
18078 #define RCAT(a,b)a/**/b
18079 #define ACAT(a,b)a ## b
18083 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
18084 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
18085 echo "Oh! Smells like ANSI's been here." >&4
18086 echo "We can catify or stringify, separately or together!"
18088 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
18089 echo "Ah, yes! The good old days!" >&4
18090 echo "However, in the good old days we don't know how to stringify and"
18091 echo "catify at the same time."
18095 Hmm, I don't seem to be able to concatenate tokens with your cpp.
18096 You're going to have to edit the values of CAT[2-5] in config.h...
18098 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
18102 : see if this is a db.h system
18108 : Check db version.
18110 echo "Checking Berkeley DB version ..." >&4
18116 #include <sys/types.h>
18118 #$i_stdlib I_STDLIB
18120 #include <stdlib.h>
18123 int main(int argc, char *argv[])
18125 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
18126 int Major, Minor, Patch ;
18127 unsigned long Version ;
18128 (void)db_version(&Major, &Minor, &Patch) ;
18130 printf("%d %d %d %d %d %d\n",
18131 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
18132 Major, Minor, Patch);
18135 printf("You have Berkeley DB Version 2 or greater.\n");
18137 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
18138 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
18139 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
18140 Major, Minor, Patch) ;
18142 /* check that db.h & libdb are compatible */
18143 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
18144 printf("db.h and libdb are incompatible.\n") ;
18148 printf("db.h and libdb are compatible.\n") ;
18150 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
18151 + DB_VERSION_PATCH ;
18153 /* needs to be >= 2.3.4 */
18154 if (Version < 2003004) {
18155 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
18156 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
18162 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
18167 printf("You have Berkeley DB Version 1.\n");
18168 exit(0); /* DB version < 2: the coast is clear. */
18170 exit(1); /* <db.h> not Berkeley DB? */
18176 if eval $compile_ok && $run ./try; then
18177 echo 'Looks OK.' >&4
18179 db_version_major=$1
18180 db_version_minor=$2
18181 db_version_patch=$3
18183 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
18187 : Remove db from list of libraries to use
18188 echo "Removing unusable -ldb from library list" >&4
18189 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
18192 echo "libs = $libs" >&4
18202 : Check the return type needed for hash
18204 echo "Checking return type needed for hash for Berkeley DB ..." >&4
18210 #include <sys/types.h>
18213 #ifndef DB_VERSION_MAJOR
18214 u_int32_t hash_cb (ptr, size)
18222 info.hash = hash_cb;
18226 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18227 if $contains warning try.out >>/dev/null 2>&1 ; then
18230 db_hashtype='u_int32_t'
18233 : XXX Maybe we should just give up here.
18234 db_hashtype=u_int32_t
18236 echo "Help: I can't seem to compile the db test program." >&4
18237 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
18240 echo "Your version of Berkeley DB uses $db_hashtype for hash."
18242 *) db_hashtype=u_int32_t
18247 : Check the return type needed for prefix
18249 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
18255 #include <sys/types.h>
18258 #ifndef DB_VERSION_MAJOR
18259 size_t prefix_cb (key1, key2)
18267 info.prefix = prefix_cb;
18271 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18272 if $contains warning try.out >>/dev/null 2>&1 ; then
18273 db_prefixtype='int'
18275 db_prefixtype='size_t'
18278 db_prefixtype='size_t'
18279 : XXX Maybe we should just give up here.
18281 echo "Help: I can't seem to compile the db test program." >&4
18282 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
18285 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
18287 *) db_prefixtype='size_t'
18292 : How can we generate normalized random numbers ?
18294 echo "Looking for a random number function..." >&4
18295 case "$randfunc" in
18297 if set drand48 val -f; eval $csym; $val; then
18299 echo "Good, found drand48()." >&4
18300 elif set random val -f; eval $csym; $val; then
18302 echo "OK, found random()." >&4
18305 echo "Yick, looks like I have to use rand()." >&4
18316 *-Dmy_rand=*|*-Dmy_srand=*)
18317 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
18318 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
18319 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
18320 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
18324 while $test "$cont"; do
18325 rp="Use which function to generate random numbers?"
18327 if $test "$ans" = "$dflt"; then
18333 if set $ans val -f; eval $csym; $val; then
18337 rp="I cannot find function $ans. Use that name anyway?"
18346 case "$randfunc" in
18348 drand01="drand48()"
18354 case "$randbits" in
18356 echo "Checking to see how many bits your $randfunc() function produces..." >&4
18358 #$i_unistd I_UNISTD
18359 #$i_stdlib I_STDLIB
18362 # include <unistd.h>
18365 # include <stdlib.h>
18370 register unsigned long tmp;
18371 register unsigned long max = 0L;
18373 for (i = 1000; i; i--) {
18374 tmp = (unsigned long) $randfunc();
18375 if (tmp > max) max = tmp;
18377 for (i = 0; max; i++)
18383 if eval $compile_ok; then
18387 echo "(I can't seem to compile the test program...)"
18394 rp="How many bits does your $randfunc() function produce?"
18398 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18399 seedfunc="s$randfunc"
18400 randseedtype=unsigned
18404 rp="How many bits does your $randfunc() function produce?"
18407 seedfunc="s$randfunc"
18408 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18409 if set $seedfunc val -f; eval $csym; $val; then
18410 echo "(Using $seedfunc() to seed random generator)"
18412 echo "(Warning: no $seedfunc() to seed random generator)"
18415 randseedtype=unsigned
18423 echo "Determining whether or not we are on an EBCDIC system..." >&4
18424 $cat >try.c <<'EOM'
18427 if ('M'==0xd4) return 0;
18434 if eval $compile_ok; then
18435 if $run ./try; then
18436 echo "You seem to speak EBCDIC." >&4
18439 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
18442 echo "I'm unable to compile the test program." >&4
18443 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
18451 Checking how to flush all pending stdio output...
18453 # I only know how to find the first 32 possibly open files on SunOS.
18454 # See also hints/sunos_4_1.sh and util.c --AD
18456 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
18458 $cat >>try.c <<EOCP
18460 #$i_stdlib I_STDLIB
18462 #include <stdlib.h>
18464 #$i_unistd I_UNISTD
18466 # include <unistd.h>
18468 #$d_sysconf HAS_SYSCONF
18469 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
18470 #ifdef HAS_STDIO_STREAM_ARRAY
18471 # define STDIO_STREAM_ARRAY $stdio_stream_array
18476 p = fopen("try.out", "w");
18480 # ifdef TRY_FPRINTF
18484 #ifdef TRY_FFLUSH_NULL
18487 #ifdef TRY_FFLUSH_ALL
18489 long open_max = -1;
18490 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
18491 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
18493 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
18494 open_max = sysconf(_SC_OPEN_MAX);
18497 open_max = FOPEN_MAX;
18500 open_max = OPEN_MAX;
18509 # ifdef HAS_STDIO_STREAM_ARRAY
18510 if (open_max > 0) {
18512 for (i = 0; i < open_max; i++)
18513 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
18514 STDIO_STREAM_ARRAY[i]._file < open_max &&
18515 STDIO_STREAM_ARRAY[i]._flag)
18516 fflush(&STDIO_STREAM_ARRAY[i]);
18524 : first we have to find out how _not_ to flush
18526 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
18528 set try -DTRY_FPUTC
18529 if eval $compile; then
18530 $run ./try 2>/dev/null
18533 if $test ! -s try.out -a "X$code" = X42; then
18539 set try -DTRY_FPRINTF
18540 if eval $compile; then
18541 $run ./try 2>/dev/null
18544 if $test ! -s try.out -a "X$code" = X42; then
18545 output=-DTRY_FPRINTF
18551 : check for fflush NULL behaviour
18552 case "$fflushNULL" in
18553 '') set try -DTRY_FFLUSH_NULL $output
18554 if eval $compile; then
18555 $run ./try 2>/dev/null
18558 if $test -s try.out -a "X$code" = X42; then
18559 fflushNULL="`$cat try.out`"
18561 if $test "X$code" != X42; then
18563 (If this test failed, don't worry, we'll try another method shortly.)
18568 $rm -f core try.core core.try.*
18569 case "$fflushNULL" in
18571 Your fflush(NULL) works okay for output streams.
18572 Let's see if it clobbers input pipes...
18574 # As of mid-March 2000 all versions of Solaris appear to have a stdio
18575 # bug that improperly flushes the input end of pipes. So we avoid the
18576 # autoflush on fork/system/exec support for now. :-(
18577 $cat >tryp.c <<EOCP
18580 main(int argc, char **argv)
18586 while ((i = getc(stdin)) != -1
18587 && (*bp++ = i) != '\n'
18588 && bp < &buf[1024])
18591 fprintf(stdout, "%s", buf);
18599 fflushNULL="$define"
18601 if eval $compile; then
18603 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
18604 if cmp tryp.c tryp.out >/dev/null 2>&1; then
18606 fflush(NULL) seems to behave okay with input streams.
18608 fflushNULL="$define"
18611 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
18613 fflushNULL="$undef"
18616 $rm -f core tryp.c tryp.core core.tryp.*
18619 Your fflush(NULL) isn't working (contrary to ANSI C).
18621 fflushNULL="$undef"
18624 Cannot figure out whether your fflush(NULL) works or not.
18625 I'm assuming it doesn't (contrary to ANSI C).
18627 fflushNULL="$undef"
18631 $define|true|[yY]*)
18632 fflushNULL="$define"
18635 fflushNULL="$undef"
18638 : check explicit looping only if NULL did not work, and if the pipe
18639 : bug does not show up on an explicit flush too
18640 case "$fflushNULL" in
18642 $cat >tryp.c <<EOCP
18645 main(int argc, char **argv)
18651 while ((i = getc(stdin)) != -1
18652 && (*bp++ = i) != '\n'
18653 && bp < &buf[1024])
18656 fprintf(stdout, "%s", buf);
18665 if eval $compile; then
18667 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
18668 if cmp tryp.c tryp.out >/dev/null 2>&1; then
18670 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
18672 : now check for fflushall behaviour
18673 case "$fflushall" in
18674 '') set try -DTRY_FFLUSH_ALL $output
18675 if eval $compile; then
18677 (Now testing the other method--but note that this also may fail.)
18679 $run ./try 2>/dev/null
18682 if $test -s try.out -a "X$code" = X42; then
18683 fflushall="`$cat try.out`"
18686 $rm -f core try.core core.try.*
18687 case "$fflushall" in
18689 Whew. Flushing explicitly all the stdio streams works.
18691 fflushall="$define"
18694 Sigh. Flushing explicitly all the stdio streams doesn't work.
18699 Cannot figure out whether flushing stdio streams explicitly works or not.
18700 I'm assuming it doesn't.
18706 "$define"|true|[yY]*)
18707 fflushall="$define"
18715 All is futile. Even fflush(stdin) clobbers input pipes!
18722 $rm -f core tryp.c tryp.core core.tryp.*
18724 *) fflushall="$undef"
18728 case "$fflushNULL$fflushall" in
18731 OK, I give up. I cannot figure out how to flush pending stdio output.
18732 We won't be flushing handles at all before fork/exec/popen.
18736 $rm -f try.* try$exe_ext
18738 : Store the full pathname to the ar program for use in the C program
18739 : Respect a hint or command line value for full_ar.
18744 : Store the full pathname to the sed program for use in the C program
18747 : see what type gids are declared as in the kernel
18749 echo "Looking for the type for group ids returned by getgid()."
18750 set gid_t gidtype xxx stdio.h sys/types.h
18754 xxx=`./findhdr sys/user.h`
18755 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
18757 unsigned) dflt="$1 $2" ;;
18761 *) dflt="$gidtype";;
18764 gid_t) echo "gid_t found." ;;
18765 *) rp="What is the type for group ids returned by getgid()?"
18773 *_t) zzz="$gidtype" ;;
18776 echo "Checking the size of $zzz..." >&4
18778 #include <sys/types.h>
18780 #$i_stdlib I_STDLIB
18782 #include <stdlib.h>
18785 printf("%d\n", (int)sizeof($gidtype));
18790 if eval $compile_ok; then
18794 echo "(I can't execute the test program--guessing $gidsize.)" >&4
18797 echo "Your $zzz is $gidsize bytes long."
18802 echo "(I can't compile the test program--guessing $gidsize.)" >&4
18808 *_t) zzz="$gidtype" ;;
18811 echo "Checking the sign of $zzz..." >&4
18813 #include <sys/types.h>
18824 if eval $compile; then
18828 echo "(I can't execute the test program--guessing unsigned.)" >&4
18832 1) echo "Your $zzz is unsigned." ;;
18833 -1) echo "Your $zzz is signed." ;;
18839 echo "(I can't compile the test program--guessing unsigned.)" >&4
18845 if $test X"$quadtype" != X; then
18847 echo "Checking how to print 64-bit integers..." >&4
18849 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
18850 $cat >try.c <<'EOCP'
18851 #include <sys/types.h>
18854 int q = 12345678901;
18855 printf("%ld\n", q);
18859 if eval $compile; then
18863 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
18864 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
18865 echo "We will use %d."
18871 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
18872 $cat >try.c <<'EOCP'
18873 #include <sys/types.h>
18876 long q = 12345678901;
18877 printf("%ld\n", q);
18881 if eval $compile; then
18885 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
18886 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
18887 echo "We will use %ld."
18893 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
18894 $cat >try.c <<'EOCP'
18895 #include <sys/types.h>
18896 #include <inttypes.h>
18899 int64_t q = 12345678901;
18900 printf("%" PRId64 "\n", q);
18904 if eval $compile; then
18908 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
18909 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
18910 echo "We will use the C9X style."
18916 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
18918 #include <sys/types.h>
18921 $quadtype q = 12345678901;
18922 printf("%Ld\n", q);
18926 if eval $compile; then
18930 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
18931 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
18932 echo "We will use %Ld."
18938 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
18939 $cat >try.c <<'EOCP'
18940 #include <sys/types.h>
18943 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
18944 printf("%lld\n", q);
18948 if eval $compile; then
18952 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
18953 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
18954 echo "We will use the %lld style."
18960 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
18962 #include <sys/types.h>
18965 $quadtype q = 12345678901;
18966 printf("%qd\n", q);
18970 if eval $compile; then
18974 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
18975 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
18976 echo "We will use %qd."
18982 if $test X"$sPRId64" = X; then
18983 echo "Cannot figure out how to print 64-bit integers." >&4
18991 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
18992 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
18994 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
18995 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
19001 $echo "Checking the format strings to be used for Perl's internal types..." >&4
19003 if $test X"$ivsize" = X8; then
19004 ivdformat="$sPRId64"
19005 uvuformat="$sPRIu64"
19006 uvoformat="$sPRIo64"
19007 uvxformat="$sPRIx64"
19008 uvXUformat="$sPRIXU64"
19010 if $test X"$ivsize" = X"$longsize"; then
19017 if $test X"$ivsize" = X"$intsize"; then
19025 if $test X"$ivsize" = X"$shortsize"; then
19036 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
19037 nveformat="$sPRIeldbl"
19038 nvfformat="$sPRIfldbl"
19039 nvgformat="$sPRIgldbl"
19040 nvEUformat="$sPRIEUldbl"
19041 nvFUformat="$sPRIFUldbl"
19042 nvGUformat="$sPRIGUldbl"
19052 case "$ivdformat" in
19053 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
19060 $echo "Checking the format string to be used for gids..." >&4
19063 -1) if $test X"$gidsize" = X"$ivsize"; then
19064 gidformat="$ivdformat"
19066 if $test X"$gidsize" = X"$longsize"; then
19069 if $test X"$gidsize" = X"$intsize"; then
19072 if $test X"$gidsize" = X"$shortsize"; then
19079 *) if $test X"$gidsize" = X"$uvsize"; then
19080 gidformat="$uvuformat"
19082 if $test X"$gidsize" = X"$longsize"; then
19085 if $test X"$gidsize" = X"$intsize"; then
19088 if $test X"$gidsize" = X"$shortsize"; then
19097 : see if getgroups exists
19098 set getgroups d_getgrps
19101 : see if setgroups exists
19102 set setgroups d_setgrps
19106 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
19108 case "$d_getgrps$d_setgrps" in
19110 case "$groupstype" in
19111 '') dflt="$gidtype" ;;
19112 *) dflt="$groupstype" ;;
19115 What type of pointer is the second argument to getgroups() and setgroups()?
19116 Usually this is the same as group ids, $gidtype, but not always.
19119 rp='What type pointer is the second argument to getgroups() and setgroups()?'
19123 *) groupstype="$gidtype";;
19127 if $test $patchlevel -lt 9; then
19128 : MAD is not available in 5.8.x or earlier.
19132 $define|true|[yY]*) dflt='y' ;;
19137 Would you like to build with Misc Attribute Decoration? This is development
19138 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
19139 overhead on the interpreter.
19141 If this doesn't make any sense to you, just accept the default '$dflt'.
19143 rp='Build Perl with MAD?'
19148 madlyh='madly.h madly.act madly.tab'
19150 madlyobj="madly$_o" ;;
19160 echo "Checking if your $make program sets \$(MAKE)..." >&4
19161 case "$make_set_make" in
19163 $sed 's/^X //' > testmake.mak << 'EOF'
19165 X @echo 'maketemp="$(MAKE)"'
19167 case "`$make -f testmake.mak 2>/dev/null`" in
19168 *maketemp=*) make_set_make='#' ;;
19169 *) make_set_make="MAKE=$make" ;;
19171 $rm -f testmake.mak
19174 case "$make_set_make" in
19175 '#') echo "Yup, it does.";;
19176 *) echo "Nope, it doesn't.";;
19179 : see what type is used for mode_t
19180 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
19181 set mode_t modetype int stdio.h sys/types.h
19184 : see if we need va_copy
19186 case "$i_stdarg" in
19189 #include <stdarg.h>
19191 #$i_stdlib I_STDLIB
19193 #include <stdlib.h>
19195 #include <signal.h>
19198 ivfprintf(FILE *f, const char *fmt, va_list *valp)
19200 return vfprintf(f, fmt, *valp);
19204 myvfprintf(FILE *f, const char *fmt, va_list val)
19206 return ivfprintf(f, fmt, &val);
19210 myprintf(char *fmt, ...)
19213 va_start(val, fmt);
19214 return myvfprintf(stdout, fmt, val);
19218 main(int ac, char **av)
19220 signal(SIGSEGV, exit);
19222 myprintf("%s%cs all right, then\n", "that", '\'');
19227 if eval $compile && $run ./try 2>&1 >/dev/null; then
19228 case "`$run ./try`" in
19229 "that's all right, then")
19235 yes) echo "It seems that you don't need va_copy()." >&4
19236 need_va_copy="$undef"
19238 *) echo "It seems that va_copy() or similar will be needed." >&4
19239 need_va_copy="$define"
19242 $rm -f try.* core core.* *.core *.core.*
19244 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
19248 : see what type is used for size_t
19249 rp="What is the type used for the length parameter for string functions?"
19250 set size_t sizetype 'unsigned int' stdio.h sys/types.h
19253 : check for type of arguments to gethostbyaddr.
19254 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
19255 case "$d_gethbyaddr" in
19259 Checking to see what type of arguments are accepted by gethostbyaddr().
19261 hdrs="$define sys/types.h
19262 $d_socket sys/socket.h
19263 $i_niin netinet/in.h
19265 $i_unistd unistd.h"
19266 : The first arg can 'char *' or 'void *'
19267 : The second arg is some of integral type
19268 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
19269 for yyy in size_t long int; do
19270 case "$netdb_host_type" in
19271 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
19272 if ./protochk "$try" $hdrs; then
19273 echo "Your system accepts $xxx for the first arg."
19274 echo "...and $yyy for the second arg."
19275 netdb_host_type="$xxx"
19276 netdb_hlen_type="$yyy"
19282 : In case none of those worked, prompt the user.
19283 case "$netdb_host_type" in
19284 '') rp='What is the type for the 1st argument to gethostbyaddr?'
19287 netdb_host_type=$ans
19288 rp='What is the type for the 2nd argument to gethostbyaddr?'
19291 netdb_hlen_type=$ans
19295 *) : no gethostbyaddr, so pick harmless defaults
19296 netdb_host_type='char *'
19297 netdb_hlen_type="$sizetype"
19300 # Remove the "const" if needed. -- but then we'll have a
19302 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
19305 : check for type of argument to gethostbyname.
19306 if test "X$netdb_name_type" = X ; then
19307 case "$d_gethbyname" in
19311 Checking to see what type of argument is accepted by gethostbyname().
19313 hdrs="$define sys/types.h
19314 $d_socket sys/socket.h
19315 $i_niin netinet/in.h
19317 $i_unistd unistd.h"
19318 for xxx in "const char *" "char *"; do
19319 case "$netdb_name_type" in
19320 '') try="extern struct hostent *gethostbyname($xxx);"
19321 if ./protochk "$try" $hdrs; then
19322 echo "Your system accepts $xxx."
19323 netdb_name_type="$xxx"
19328 : In case none of those worked, prompt the user.
19329 case "$netdb_name_type" in
19330 '') rp='What is the type for the 1st argument to gethostbyname?'
19333 netdb_name_type=$ans
19337 *) : no gethostbyname, so pick harmless default
19338 netdb_name_type='char *'
19343 : check for type of 1st argument to getnetbyaddr.
19344 if test "X$netdb_net_type" = X ; then
19345 case "$d_getnbyaddr" in
19349 Checking to see what type of 1st argument is accepted by getnetbyaddr().
19351 hdrs="$define sys/types.h
19352 $d_socket sys/socket.h
19353 $i_niin netinet/in.h
19355 $i_unistd unistd.h"
19356 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
19357 case "$netdb_net_type" in
19358 '') try="extern struct netent *getnetbyaddr($xxx, int);"
19359 if ./protochk "$try" $hdrs; then
19360 echo "Your system accepts $xxx."
19361 netdb_net_type="$xxx"
19366 : In case none of those worked, prompt the user.
19367 case "$netdb_net_type" in
19368 '') rp='What is the type for the 1st argument to getnetbyaddr?'
19371 netdb_net_type=$ans
19375 *) : no getnetbyaddr, so pick harmless default
19376 netdb_net_type='long'
19380 : locate the preferred pager for this system
19387 [a-zA-Z]:/*) dflt=$pg;;
19391 [a-zA-Z]:/*) dflt=$more;;
19395 [a-zA-Z]:/*) dflt=$less;;
19398 '') dflt=/usr/ucb/more;;
19402 : Instruct ./getfile to trust the hinted or previous pager value,
19403 : even if it does not begin with a slash. For example, on os2,
19404 : pager might be cmd /c more. See comments in UU/getfile.
19409 rp='What pager is used on your system?'
19413 : see what type pids are declared as in the kernel
19414 rp="What is the type of process ids on this system?"
19415 set pid_t pidtype int stdio.h sys/types.h
19418 : see if ar generates random libraries by itself
19420 echo "Checking how to generate random libraries on your machine..." >&4
19421 echo 'int bar1() { return bar2(); }' > bar1.c
19422 echo 'int bar2() { return 2; }' > bar2.c
19424 #$i_stdlib I_STDLIB
19426 #include <stdlib.h>
19428 int main() { printf("%d\n", bar1()); exit(0); }
19430 $cc $ccflags -c bar1.c >/dev/null 2>&1
19431 $cc $ccflags -c bar2.c >/dev/null 2>&1
19432 $cc $ccflags -c foo.c >/dev/null 2>&1
19433 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
19434 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19435 $run ./foobar >/dev/null 2>&1; then
19436 echo "$ar appears to generate random libraries itself."
19438 if [ "X$ranlib" = "X" ]; then
19441 elif $ar s bar$_a >/dev/null 2>&1 &&
19442 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19443 $run ./foobar >/dev/null 2>&1; then
19444 echo "a table of contents needs to be added with '$ar s'."
19447 elif $ar ts bar$_a >/dev/null 2>&1 &&
19448 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19449 $run ./foobar >/dev/null 2>&1; then
19450 echo "a table of contents needs to be added with '$ar ts'."
19457 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
19458 $test -f $ranlib || ranlib=''
19461 if $test -n "$ranlib"; then
19462 echo "your system has '$ranlib'; we'll use that."
19465 echo "your system doesn't seem to support random libraries"
19466 echo "so we'll use lorder and tsort to order the libraries."
19473 : check for type of arguments to select.
19474 case "$selecttype" in
19475 '') case "$d_select" in
19479 Checking to see what type of arguments are accepted by select().
19481 hdrs="$define sys/types.h
19482 $i_systime sys/time.h
19483 $i_sysselct sys/select.h
19484 $d_socket sys/socket.h"
19485 : The first arg can be int, unsigned, or size_t
19486 : The last arg may or may not be 'const'
19488 : void pointer has been seen but using that
19489 : breaks the selectminbits test
19490 for xxx in 'fd_set *' 'int *'; do
19491 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
19492 for tmo in 'struct timeval *' 'const struct timeval *'; do
19494 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
19495 if ./protochk "$try" $hdrs; then
19496 echo "Your system accepts $xxx."
19505 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
19506 case "$d_fd_set" in
19507 $define) dflt="fd_set *" ;;
19516 *) : no select, so pick a harmless default
19523 : check for the select 'width'
19524 case "$selectminbits" in
19525 '') safebits=`expr $ptrsize \* 8`
19526 case "$d_select" in
19530 Checking to see on how many bits at a time your select() operates...
19533 #include <sys/types.h>
19535 #$i_systime I_SYS_TIME
19536 #$i_systimek I_SYS_TIME_KERNEL
19541 # ifdef I_SYS_TIME_KERNEL
19544 # include <sys/time.h>
19545 # ifdef I_SYS_TIME_KERNEL
19549 #$i_sysselct I_SYS_SELECT
19550 #ifdef I_SYS_SELECT
19551 #include <sys/select.h>
19553 #$d_socket HAS_SOCKET
19555 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
19558 #$i_stdlib I_STDLIB
19560 #include <stdlib.h>
19563 #define S sizeof(*(b))
19565 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
19566 #define NBITS (NBYTES * 8)
19568 char *s = (char *)malloc(NBYTES);
19577 fp = fopen("try.c", "r");
19583 b = ($selecttype)s;
19584 for (i = 0; i < NBITS; i++)
19588 select(fd + 1, b, 0, 0, &t);
19589 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
19591 printf("%d\n", i + 1);
19596 if eval $compile_ok; then
19597 selectminbits=`$run ./try`
19598 case "$selectminbits" in
19600 Cannot figure out on how many bits at a time your select() operates.
19601 I'll play safe and guess it is $safebits bits.
19603 selectminbits=$safebits
19604 bits="$safebits bits"
19607 *) bits="$selectminbits bits" ;;
19609 echo "Your select() operates on $bits at a time." >&4
19611 rp='What is the minimum number of bits your select() operates on?'
19612 case "$byteorder" in
19613 12345678) dflt=64 ;;
19619 selectminbits="$val"
19623 *) : no select, so pick a harmless default
19624 selectminbits=$safebits
19630 : Trace out the files included by signal.h, then look for SIGxxx names.
19631 : Remove SIGARRAYSIZE used by HPUX.
19632 : Remove SIGSTKSIZE used by Linux.
19633 : Remove SIGSTKSZ used by Posix.
19634 : Remove SIGTYP void lines used by OS2.
19635 : Some cpps, like os390, dont give the file name anywhere
19636 if [ "X$fieldn" = X ]; then
19637 : Just make some guesses. We check them later.
19638 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
19640 xxx=`echo '#include <signal.h>' |
19641 $cppstdin $cppminus $cppflags 2>/dev/null |
19642 $grep '^[ ]*#.*include' |
19643 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
19645 : Check this list of files to be sure we have parsed the cpp output ok.
19646 : This will also avoid potentially non-existent files, such
19649 for xx in $xxx /dev/null ; do
19650 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
19652 : If we have found no files, at least try signal.h
19653 case "$xxxfiles" in
19654 '') xxxfiles=`./findhdr signal.h` ;;
19657 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
19658 print substr($2, 4, 20)
19660 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
19661 print substr($3, 4, 20)
19663 : Append some common names just in case the awk scan failed.
19664 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
19665 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
19666 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
19667 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
19668 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
19670 : generate a few handy files for later
19671 $cat > signal.c <<EOCP
19672 #include <sys/types.h>
19673 #include <signal.h>
19674 #$i_stdlib I_STDLIB
19676 #include <stdlib.h>
19681 /* Strange style to avoid deeply-nested #if/#else/#endif */
19684 # define NSIG (_NSIG)
19690 # define NSIG (SIGMAX+1)
19696 # define NSIG (SIG_MAX+1)
19702 # define NSIG (_SIG_MAX+1)
19708 # define NSIG (MAXSIG+1)
19714 # define NSIG (MAX_SIG+1)
19719 # ifdef SIGARRAYSIZE
19720 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
19726 # define NSIG (_sys_nsig) /* Solaris 2.5 */
19730 /* Default to some arbitrary number that's big enough to get most
19731 of the common signals.
19737 printf("NSIG %d\n", NSIG);
19743 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
19745 printf "#ifdef SIG"; printf $1; printf "\n"
19746 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
19747 printf $1; printf ");\n"
19751 printf "#endif /* JUST_NSIG */\n";
19752 printf "exit(0);\n}\n";
19755 $cat >signal.awk <<'EOP'
19756 BEGIN { ndups = 0 }
19757 $1 ~ /^NSIG$/ { nsig = $2 }
19758 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
19759 if ($2 > maxsig) { maxsig = $2 }
19760 if (sig_name[$2]) {
19761 dup_name[ndups] = $1
19762 dup_num[ndups] = $2
19774 printf("NSIG %d\n", nsig);
19775 for (n = 1; n < nsig; n++) {
19777 printf("%s %d\n", sig_name[n], sig_num[n])
19780 printf("NUM%d %d\n", n, n)
19783 for (n = 0; n < ndups; n++) {
19784 printf("%s %d\n", dup_name[n], dup_num[n])
19788 $cat >signal_cmd <<EOS
19790 if $test -s signal.lst; then
19791 echo "Using your existing signal.lst file"
19796 $cat >>signal_cmd <<'EOS'
19799 if eval $compile_ok; then
19800 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) | $uniq | $awk -f signal.awk >signal.lst
19802 echo "(I can't seem be able to compile the whole test program)" >&4
19803 echo "(I'll try it in little pieces.)" >&4
19804 set signal -DJUST_NSIG
19805 if eval $compile_ok; then
19806 $run ./signal$_exe > signal.nsg
19809 echo "I can't seem to figure out how many signals you have." >&4
19810 echo "Guessing 50." >&4
19811 echo 'NSIG 50' > signal.nsg
19813 : Now look at all the signal names, one at a time.
19814 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
19815 $cat > signal.c <<EOCP
19816 #include <sys/types.h>
19817 #include <signal.h>
19820 printf("$xx %d\n", SIG${xx});
19825 if eval $compile; then
19826 echo "SIG${xx} found."
19827 $run ./signal$_exe >> signal.ls1
19829 echo "SIG${xx} NOT found."
19832 if $test -s signal.ls1; then
19833 $cat signal.nsg signal.ls1 |
19834 $sort -n | $uniq | $awk -f signal.awk >signal.lst
19838 if $test -s signal.lst; then
19841 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
19842 echo 'kill -l' >signal
19843 set X `csh -f <signal`
19847 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
19849 echo $@ | $tr ' ' $trnl | \
19850 $awk '{ printf "%s %d\n", $1, ++s; }
19851 END { printf "NSIG %d\n", ++s }' >signal.lst
19853 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
19855 chmod a+x signal_cmd
19856 $eunicefix signal_cmd
19858 : generate list of signal names
19860 case "$sig_name_init" in
19862 *) case "$sig_num_init" in
19863 ''|*,*) doinit=yes ;;
19868 echo "Generating a list of signal names and numbers..." >&4
19870 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
19871 sig_name=`$awk 'BEGIN { printf "ZERO " }
19872 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
19873 sig_num=`$awk 'BEGIN { printf "0 " }
19874 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
19875 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
19876 !/^NSIG/ { printf "\"%s\", ", $1 }
19877 END { printf "0\n" }' signal.lst`
19878 sig_num_init=`$awk 'BEGIN { printf "0, " }
19879 !/^NSIG/ { printf "%d, ", $2}
19880 END { printf "0\n"}' signal.lst`
19883 echo "The following $sig_count signals are available:"
19885 echo $sig_name | $awk \
19886 'BEGIN { linelen = 0 }
19888 for (i = 1; i <= NF; i++) {
19889 name = "SIG" $i " "
19890 linelen = linelen + length(name)
19891 if (linelen > 70) {
19893 linelen = length(name)
19899 sig_size=`echo $sig_name | awk '{print NF}'`
19900 $rm -f signal signal.c signal.awk signal.lst signal_cmd
19903 case "$sizetype" in
19904 *_t) zzz="$sizetype" ;;
19905 *) zzz="filesize" ;;
19907 echo "Checking the size of $zzz..." >&4
19909 #include <sys/types.h>
19911 #$i_stdlib I_STDLIB
19913 #include <stdlib.h>
19916 printf("%d\n", (int)sizeof($sizetype));
19921 if eval $compile_ok; then
19925 echo "(I can't execute the test program--guessing $sizesize.)" >&4
19928 echo "Your $zzz size is $sizesize bytes."
19933 echo "(I can't compile the test program--guessing $sizesize.)" >&4
19937 : check for socklen_t
19939 echo "Checking to see if you have socklen_t..." >&4
19941 #include <sys/types.h>
19942 #$d_socket HAS_SOCKET
19944 #include <sys/socket.h>
19946 int main() { socklen_t x = 16; }
19949 if eval $compile; then
19951 echo "You have socklen_t."
19954 echo "You do not have socklen_t."
19955 case "$sizetype" in
19956 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
19963 : see if this is a socks.h system
19964 set socks.h i_socks
19967 : check for type of the size argument to socket calls
19968 case "$d_socket" in
19972 Checking to see what type is the last argument of accept().
19975 case "$d_socklen_t" in
19976 "$define") yyy="$yyy socklen_t"
19978 yyy="$yyy $sizetype int long unsigned"
19979 for xxx in $yyy; do
19980 case "$socksizetype" in
19981 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
19982 case "$usesocks" in
19984 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
19985 echo "Your system accepts '$xxx *' for the last argument of accept()."
19986 socksizetype="$xxx"
19989 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
19990 echo "Your system accepts '$xxx *' for the last argument of accept()."
19991 socksizetype="$xxx"
19998 : In case none of those worked, prompt the user.
19999 case "$socksizetype" in
20000 '') rp='What is the type for socket address structure sizes?'
20007 *) : no sockets, so pick relatively harmless default
20012 : see what type is used for signed size_t
20013 set ssize_t ssizetype int stdio.h sys/types.h
20018 #$i_stdlib I_STDLIB
20020 #include <stdlib.h>
20022 #include <sys/types.h>
20023 #define Size_t $sizetype
20024 #define SSize_t $dflt
20027 if (sizeof(Size_t) == sizeof(SSize_t))
20029 else if (sizeof(Size_t) == sizeof(int))
20038 if eval $compile_ok && $run ./try > /dev/null; then
20039 ssizetype=`$run ./try`
20040 echo "I'll be using $ssizetype for functions returning a byte count." >&4
20043 Help! I can't compile and run the ssize_t test program: please enlighten me!
20044 (This is probably a misconfiguration in your system or libraries, and
20045 you really ought to fix it. Still, I'll try anyway.)
20047 I need a type that is the same size as $sizetype, but is guaranteed to
20048 be signed. Common values are ssize_t, int and long.
20051 rp="What signed type is the same size as $sizetype?"
20057 : see what type of char stdio uses.
20059 echo '#include <stdio.h>' > stdio.c
20060 $cppstdin $cppminus < stdio.c > stdioh
20061 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
20062 echo "Your stdio uses unsigned chars." >&4
20063 stdchar="unsigned char"
20065 echo "Your stdio uses signed chars." >&4
20068 $rm -f stdio.* stdioh
20070 : see what type uids are declared as in the kernel
20072 echo "Looking for the type for user ids returned by getuid()."
20073 set uid_t uidtype xxx stdio.h sys/types.h
20077 xxx=`./findhdr sys/user.h`
20078 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
20080 unsigned) dflt="$1 $2" ;;
20084 *) dflt="$uidtype";;
20087 uid_t) echo "uid_t found." ;;
20088 *) rp="What is the type for user ids returned by getuid()?"
20096 *_t) zzz="$uidtype" ;;
20099 echo "Checking the size of $zzz..." >&4
20101 #include <sys/types.h>
20103 #$i_stdlib I_STDLIB
20105 #include <stdlib.h>
20108 printf("%d\n", (int)sizeof($uidtype));
20113 if eval $compile_ok; then
20117 echo "(I can't execute the test program--guessing $uidsize.)" >&4
20120 echo "Your $zzz is $uidsize bytes long."
20125 echo "(I can't compile the test program--guessing $uidsize.)" >&4
20130 *_t) zzz="$uidtype" ;;
20133 echo "Checking the sign of $zzz..." >&4
20135 #include <sys/types.h>
20146 if eval $compile; then
20150 echo "(I can't execute the test program--guessing unsigned.)" >&4
20154 1) echo "Your $zzz is unsigned." ;;
20155 -1) echo "Your $zzz is signed." ;;
20161 echo "(I can't compile the test program--guessing unsigned.)" >&4
20167 $echo "Checking the format string to be used for uids..." >&4
20170 -1) if $test X"$uidsize" = X"$ivsize"; then
20171 uidformat="$ivdformat"
20173 if $test X"$uidsize" = X"$longsize"; then
20176 if $test X"$uidsize" = X"$intsize"; then
20179 if $test X"$uidsize" = X"$shortsize"; then
20186 *) if $test X"$uidsize" = X"$uvsize"; then
20187 uidformat="$uvuformat"
20189 if $test X"$uidsize" = X"$longsize"; then
20192 if $test X"$uidsize" = X"$intsize"; then
20195 if $test X"$uidsize" = X"$shortsize"; then
20205 case "$usesitecustomize" in
20206 $define|true|[Yy]*)
20207 usesitecustomize="$define"
20210 usesitecustomize="$undef"
20214 : determine compiler compiler
20223 if $test -f "$byacc$_exe"; then
20225 comp="byacc or $comp"
20227 if $test -f "$bison$_exe"; then
20228 comp="$comp or bison -y"
20230 rp="Which compiler compiler ($comp) shall I use?"
20239 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
20245 : see if this is a fp.h system
20249 : see if this is a fp_class.h system
20250 set fp_class.h i_fp_class
20253 : see if this is a ieeefp.h system
20254 case "$i_ieeefp" in
20255 '' ) set ieeefp.h i_ieeefp
20260 : see if this is a libutil.h system
20261 set libutil.h i_libutil
20264 : see if mach cthreads are available
20265 if test "X$usethreads" = "X$define"; then
20266 set mach/cthreads.h i_machcthr
20269 i_machcthr="$undef"
20274 : see if this is a mntent.h system
20275 set mntent.h i_mntent
20278 : see if ndbm.h is available
20284 # Some Linux distributions such as RedHat 7.1 put the
20285 # ndbm.h header in /usr/include/gdbm/ndbm.h.
20286 if $test -f /usr/include/gdbm/ndbm.h; then
20287 echo '<gdbm/ndbm.h> found.'
20288 ccflags="$ccflags -I/usr/include/gdbm"
20289 cppflags="$cppflags -I/usr/include/gdbm"
20297 : see if dbm_open exists
20298 set dbm_open d_dbm_open
20300 case "$d_dbm_open" in
20303 echo "We won't be including <ndbm.h>"
20312 : see if net/errno.h is available
20314 set net/errno.h val
20317 : Unfortunately, it causes problems on some systems. Arrgh.
20320 cat > try.c <<'EOM'
20323 #include <net/errno.h>
20329 if $cc $ccflags -c try.c >/dev/null 2>&1; then
20330 echo "We'll be including <net/errno.h>." >&4
20332 echo "We won't be including <net/errno.h>." >&4
20341 : see if netinet/tcp.h is available
20342 set netinet/tcp.h i_netinettcp
20345 : see if this is a poll.h system
20349 : see if this is a prot.h system
20354 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
20355 $cat <<'EOSH' > Cppsym.know
20356 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
20357 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
20358 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
20359 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
20360 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
20361 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
20362 bull c cadmus clipper CMU COFF COMPILER_VERSION
20363 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
20364 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
20365 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
20366 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
20368 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
20369 H3050R H3050RX hbullx20 hcx host_mips
20370 hp200 hp300 hp700 HP700 hp800 hp9000
20371 hp9000s200 hp9000s300 hp9000s400 hp9000s500
20372 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
20373 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
20374 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
20375 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
20376 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
20377 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
20378 Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
20379 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
20380 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
20381 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
20382 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
20383 MATH_HAS_NO_SIDE_EFFECTS
20384 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
20385 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
20386 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
20387 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
20388 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
20389 NetBSD news1500 news1700 news1800 news1900 news3700
20390 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
20391 ns32016 ns32332 ns32k nsc32000
20392 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
20393 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
20394 pc532 pdp11 PGC PIC plexus PORTAR posix
20395 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
20396 POSIX_C_SOURCE POSIX_SOURCE POWER
20397 PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
20398 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
20399 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
20400 sony sony_news sonyrisc sparc sparclite spectrum
20401 stardent stdc STDC_EXT stratos sun sun3 sun386
20402 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
20403 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
20404 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
20405 sysV68 sysV88 Tek4132 Tek4300 titan
20406 TM3200 TM5400 TM5600
20407 tower tower32 tower32_200 tower32_600 tower32_700
20408 tower32_800 tower32_850 tss
20409 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
20410 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
20411 unix UNIX95 UNIX99 unixpc unos
20412 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
20413 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
20414 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
20416 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
20417 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
20418 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
20421 # Maybe put other stuff here too.
20422 cat <<EOSH >>Cppsym.know
20425 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
20426 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
20427 $cat Cppsym.know > Cppsym.c
20428 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
20429 $rm -f Cppsym.a Cppsym.b Cppsym.c
20430 cat <<EOSH > Cppsym
20432 if $test \$# -gt 0; then
20433 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
20434 if $test -s Cppsym.got; then
20441 $tr " " "$trnl" | ./Cppsym.try
20447 cat <<EOSH > Cppsym.try
20449 cat <<'EOCP' > try.c
20452 #define STRINGIFY(a) "a"
20454 #if cpp_stuff == 42
20455 #define StGiFy(a) #a
20456 #define STRINGIFY(a) StGiFy(a)
20458 #if $cpp_stuff != 1 && $cpp_stuff != 42
20459 # include "Bletch: How does this C preprocessor stringify macros?"
20465 cat <<'EOSH' >> Cppsym.try
20467 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
20468 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
20469 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
20470 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
20472 echo 'return 0;}' >> try.c
20474 cat <<EOSH >> Cppsym.try
20476 case "$osname-$gccversion" in
20477 irix-) ccflags="\$ccflags -woff 1178" ;;
20478 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
20480 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
20482 chmod +x Cppsym.try
20483 $eunicefix Cppsym.try
20484 ./Cppsym < Cppsym.know > Cppsym.true
20485 : Add in any linux cpp "predefined macros":
20486 case "$osname::$gccversion" in
20489 rm -f $tHdrH'.h' $tHdrH
20491 if cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
20492 sed 's/#define[\ \ ]*//;s/[\ \ ].*$//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
20493 if [ -s $tHdrH'_cppsym.real' ]; then
20494 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
20497 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
20500 : now check the C compiler for additional symbols
20501 postprocess_cc_v=''
20503 aix) postprocess_cc_v="|$tr , ' '" ;;
20510 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
20513 -D*) echo "\$i" | $sed 's/^-D//';;
20514 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
20519 postprocess_cc_v=''
20522 ./ccsym > ccsym1.raw
20523 if $test -s ccsym1.raw; then
20524 $sort ccsym1.raw | $uniq >ccsym.raw
20526 mv ccsym1.raw ccsym.raw
20529 $awk '/\=/ { print $0; next }
20530 { print $0"=1" }' ccsym.raw >ccsym.list
20531 $comm -13 Cppsym.true ccsym.list >ccsym.own
20532 $comm -12 Cppsym.true ccsym.list >ccsym.com
20533 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
20535 if $test -z ccsym.raw; then
20536 echo "Your C compiler doesn't seem to define any symbols!" >&4
20538 echo "However, your C preprocessor defines the following symbols:"
20541 cppsymbols=`$cat Cppsym.true`
20542 cppsymbols=`echo $cppsymbols`
20543 cppccsymbols="$cppsymbols"
20545 if $test -s ccsym.com; then
20546 echo "Your C compiler and pre-processor define these symbols:"
20547 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
20550 cppccsymbols=`$cat ccsym.com`
20551 cppccsymbols=`echo $cppccsymbols`
20552 $test "$silent" || sleep 1
20554 if $test -s ccsym.cpp; then
20555 $test "$also" && echo " "
20556 echo "Your C pre-processor ${also}defines the following symbols:"
20557 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
20559 cppsymbols=`$cat ccsym.cpp`
20560 cppsymbols=`echo $cppsymbols`
20561 $test "$silent" || sleep 1
20563 if $test -s ccsym.own; then
20564 $test "$also" && echo " "
20565 echo "Your C compiler ${also}defines the following cpp symbols:"
20566 $sed -e 's/\(..*\)=1/\1/' ccsym.own
20567 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
20568 ccsymbols=`$cat ccsym.own`
20569 ccsymbols=`echo $ccsymbols`
20570 $test "$silent" || sleep 1
20574 : see if this is a termio system
20578 if $test `./findhdr termios.h`; then
20579 set tcsetattr i_termios
20585 "$define") echo "You have POSIX termios.h... good!" >&4;;
20586 *) if ./Cppsym pyr; then
20587 case "`/bin/universe`" in
20588 ucb) if $test `./findhdr sgtty.h`; then
20590 echo "<sgtty.h> found." >&4
20592 echo "System is pyramid with BSD universe."
20593 echo "<sgtty.h> not found--you could have problems." >&4
20595 *) if $test `./findhdr termio.h`; then
20597 echo "<termio.h> found." >&4
20599 echo "System is pyramid with USG universe."
20600 echo "<termio.h> not found--you could have problems." >&4
20604 if $test `./findhdr termio.h`; then
20605 echo "<termio.h> found." >&4
20607 elif $test `./findhdr sgtty.h`; then
20608 echo "<sgtty.h> found." >&4
20611 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
20614 if $test `./findhdr sgtty.h`; then
20615 echo "<sgtty.h> found." >&4
20617 elif $test `./findhdr termio.h`; then
20618 echo "<termio.h> found." >&4
20621 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
20625 set i_termio; eval $setvar
20626 val=$val2; set i_sgtty; eval $setvar
20627 val=$val3; set i_termios; eval $setvar
20629 : see if stddef is available
20630 set stddef.h i_stddef
20633 : see if this is a sunmath.h system
20634 set sunmath.h i_sunmath
20637 : see if sys/access.h is available
20638 set sys/access.h i_sysaccess
20641 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
20642 set sys/filio.h i_sysfilio
20645 if $test `./findhdr sys/ioctl.h`; then
20647 echo '<sys/ioctl.h> found.' >&4
20650 if $test $i_sysfilio = "$define"; then
20651 echo '<sys/ioctl.h> NOT found.' >&4
20653 $test $i_sgtty = "$define" && xxx="sgtty.h"
20654 $test $i_termio = "$define" && xxx="termio.h"
20655 $test $i_termios = "$define" && xxx="termios.h"
20656 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
20662 : see if socket ioctl defs are in sys/sockio.h
20664 xxx=`./findhdr sys/sockio.h`
20665 if $test "$xxx"; then
20666 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
20668 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
20671 echo "No socket ioctls found in <sys/sockio.h>." >&4
20676 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
20683 : see if this is a syslog.h system
20684 set syslog.h i_syslog
20688 : see if this is a sys/mode.h system
20689 set sys/mode.h i_sysmode
20692 : see if sys/resource.h has to be included
20693 set sys/resource.h i_sysresrc
20696 : see if sys/security.h is available
20697 set sys/security.h i_syssecrt
20700 : see if this is a sys/statvfs.h system
20701 set sys/statvfs.h i_sysstatvfs
20704 : see if this is a sys/un.h system
20705 set sys/un.h i_sysun
20709 : see if this is a sys/utsname.h system
20710 set sys/utsname.h i_sysutsname
20713 : see if this is a syswait system
20714 set sys/wait.h i_syswait
20717 : see if this is a ustat.h system
20718 set ustat.h i_ustat
20721 : see if this is an utime system
20722 set utime.h i_utime
20725 : see if this is a values.h system
20726 set values.h i_values
20729 : see if this is a vfork system
20732 set vfork.h i_vfork
20740 : see if gdbm.h is available
20745 : see if gdbm_open exists
20746 set gdbm_open d_gdbm_open
20748 case "$d_gdbm_open" in
20751 echo "We won't be including <gdbm.h>"
20761 echo "Looking for extensions..." >&4
20762 : If we are using the old config.sh, known_extensions may contain
20763 : old or inaccurate or duplicate values.
20764 known_extensions=''
20765 nonxs_extensions=''
20766 : We do not use find because it might not be available.
20767 : We do not just use MANIFEST because the user may have dropped
20768 : some additional extensions into the source tree and expect them
20771 : Function to recursively find available extensions, ignoring DynaLoader
20772 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
20776 DynaLoader|dynaload) ;;
20778 if $test -f $xxx/$xxx.xs; then
20779 known_extensions="$known_extensions $1$xxx";
20780 elif $test -f $xxx/Makefile.PL; then
20781 nonxs_extensions="$nonxs_extensions $1$xxx";
20783 if $test -d $xxx -a $# -lt 10; then
20786 eval $find_extensions;
20798 eval $find_extensions
20799 # Special case: Add in threads/shared since it is not picked up by the
20800 # recursive find above (and adding in general recursive finding breaks
20801 # SDBM_File/sdbm). A.D. 10/25/2001.
20802 known_extensions="$known_extensions threads/shared"
20803 set X $nonxs_extensions
20805 nonxs_extensions="$*"
20806 set X $known_extensions
20808 known_extensions="$*"
20811 : Now see which are supported on this system.
20813 for xxx in $known_extensions ; do
20817 $define) avail_ext="$avail_ext $xxx" ;;
20820 GDBM_File|gdbm_fil)
20822 $define) avail_ext="$avail_ext $xxx" ;;
20825 I18N/Langinfo|i18n_lan)
20826 case "$i_langinfo$d_nl_langinfo" in
20827 $define$define) avail_ext="$avail_ext $xxx" ;;
20830 NDBM_File|ndbm_fil)
20833 case "$osname-$use64bitint" in
20836 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
20839 *) avail_ext="$avail_ext $xxx" ;;
20844 ODBM_File|odbm_fil)
20845 case "${i_dbm}${i_rpcsvcdbm}" in
20847 case "$osname-$use64bitint" in
20850 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
20853 *) avail_ext="$avail_ext $xxx" ;;
20859 case "$useposix" in
20860 true|define|y) avail_ext="$avail_ext $xxx" ;;
20864 case "$useopcode" in
20865 true|define|y) avail_ext="$avail_ext $xxx" ;;
20869 case "$d_socket" in
20872 beos) ;; # not unless BONE
20873 *) avail_ext="$avail_ext $xxx" ;;
20878 Sys/Syslog|sys/syslog)
20879 : XXX syslog requires socket
20880 case "$d_socket" in
20881 true|$define|y) avail_ext="$avail_ext $xxx" ;;
20885 case "$usethreads" in
20887 case "$useithreads" in
20888 $undef|false|[nN]*) avail_ext="$avail_ext $xxx" ;;
20892 XS/APItest|xs/apitest)
20893 # This is just for testing. Skip it unless we have dynamic loading.
20896 $define) avail_ext="$avail_ext $xxx" ;;
20899 XS/Typemap|xs/typemap)
20900 # This is just for testing. Skip it unless we have dynamic loading.
20902 $define) avail_ext="$avail_ext $xxx" ;;
20905 threads|threads/shared)
20906 # threads and threads::shared are special cases.
20907 # To stop people from asking "Perl 5.8.0 was supposed
20908 # to have this new fancy threads implementation but my
20909 # perl doesn't have it" and from people trying to
20910 # (re)install the threads module using CPAN.pm and
20911 # CPAN.pm then offering to reinstall Perl 5.8.0,
20912 # the threads.pm and threads/shared.pm will always be
20913 # there, croaking informatively ("you need to rebuild
20914 # all of Perl with threads, sorry") when threads haven't
20915 # been compiled in.
20917 avail_ext="$avail_ext $xxx"
20920 : XXX Do we need a useipcsysv variable here
20921 case "${d_msg}${d_sem}${d_shm}" in
20922 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
20925 *) avail_ext="$avail_ext $xxx"
20934 case "$onlyextensions" in
20936 *) keepextensions=''
20937 echo "You have requested that only certains extensions be included..." >&4
20938 for i in $onlyextensions; do
20939 case " $avail_ext " in
20941 echo "Keeping extension $i."
20942 keepextensions="$keepextensions $i"
20944 *) echo "Ignoring extension $i." ;;
20947 avail_ext="$keepextensions"
20951 case "$noextensions" in
20953 *) keepextensions=''
20954 echo "You have requested that certain extensions be ignored..." >&4
20955 for i in $avail_ext; do
20956 case " $noextensions " in
20957 *" $i "*) echo "Ignoring extension $i." ;;
20958 *) echo "Keeping extension $i.";
20959 keepextensions="$keepextensions $i"
20963 avail_ext="$keepextensions"
20967 : Now see which nonxs extensions are supported on this system.
20968 : For now assume all are.
20970 for xxx in $nonxs_extensions ; do
20972 *) nonxs_ext="$nonxs_ext $xxx"
20984 A number of extensions are supplied with $package. You may choose to
20985 compile these extensions for dynamic loading (the default), compile
20986 them into the $package executable (static loading), or not include
20987 them at all. Answer "none" to include no extensions.
20988 Note that DynaLoader is always built and need not be mentioned here.
20991 case "$dynamic_ext" in
20993 : Exclude those listed in static_ext
20995 for xxx in $avail_ext; do
20996 case " $static_ext " in
20998 *) dflt="$dflt $xxx" ;;
21005 *) dflt="$dynamic_ext"
21006 # Perhaps we are reusing an old out-of-date config.sh.
21009 if test X"$dynamic_ext" != X"$avail_ext"; then
21011 NOTICE: Your previous config.sh list may be incorrect.
21012 The extensions now available to you are
21014 but the default list from your previous config.sh is
21026 rp="What extensions do you wish to load dynamically?"
21029 none) dynamic_ext=' ' ;;
21030 *) dynamic_ext="$ans" ;;
21033 case "$static_ext" in
21035 : Exclude those already listed in dynamic linking
21037 for xxx in $avail_ext; do
21038 case " $dynamic_ext " in
21040 *) dflt="$dflt $xxx" ;;
21047 *) dflt="$static_ext"
21054 rp="What extensions do you wish to load statically?"
21057 none) static_ext=' ' ;;
21058 *) static_ext="$ans" ;;
21063 A number of extensions are supplied with $package. Answer "none"
21064 to include no extensions.
21065 Note that DynaLoader is always built and need not be mentioned here.
21068 case "$static_ext" in
21069 '') dflt="$avail_ext" ;;
21070 *) dflt="$static_ext"
21071 # Perhaps we are reusing an old out-of-date config.sh.
21074 if test X"$static_ext" != X"$avail_ext"; then
21076 NOTICE: Your previous config.sh list may be incorrect.
21077 The extensions now available to you are
21079 but the default list from your previous config.sh is
21088 : Exclude those that are not xs extensions
21092 rp="What extensions do you wish to include?"
21095 none) static_ext=' ' ;;
21096 *) static_ext="$ans" ;;
21101 # Encode is a special case. If we are building Encode as a static
21102 # extension, we need to explicitly list its subextensions as well.
21103 # For other nested extensions, this is handled automatically by
21104 # the appropriate Makefile.PL.
21105 case " $static_ext " in
21106 *" Encode "*) # Add the subextensions of Encode
21108 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
21109 static_ext="$static_ext Encode/$xxx"
21115 set X $dynamic_ext $static_ext $nonxs_ext
21119 # Sanity check: We require an extension suitable for use with
21120 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
21121 # should show up as failures in the test suite, but it's helpful to
21122 # catch them now.) The 'extensions' list is normally sorted
21123 # alphabetically, so we need to accept either
21124 # DB_File ... Fcntl ... IO ....
21125 # or something like
21126 # Fcntl ... NDBM_File ... IO ....
21127 case " $extensions" in
21128 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
21129 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
21130 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
21131 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
21132 echo "WARNING: The Perl you are building will be quite crippled." >& 4
21136 : Remove libraries needed only for extensions
21137 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
21138 : The exception is SunOS 4.x, which needs them.
21139 case "${osname}X${osvers}" in
21143 *) case "$usedl" in
21144 $define|true|[yY]*)
21145 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
21149 *) perllibs="$libs"
21155 : Remove build directory name from cppstdin so it can be used from
21156 : either the present location or the final installed location.
21158 : Get out of the UU directory to get correct path name.
21160 case "$cppstdin" in
21162 echo "Stripping down cppstdin path name"
21168 : end of configuration questions
21170 echo "End of configuration questions."
21173 : back to where it started
21174 if test -d ../UU; then
21178 : configuration may be patched via a 'config.arch' file
21179 if $test -f config.arch; then
21180 echo "I see a config.arch file, loading it."
21184 : configuration may be patched via a 'config.over' file
21185 if $test -f config.over; then
21188 rp='I see a config.over file. Do you wish to load it?'
21191 n*) echo "OK, I'll ignore it.";;
21193 echo "Configuration override changes have been loaded."
21198 : in case they want portability, strip down executable paths
21199 case "$d_portable" in
21202 echo "Stripping down executable paths..." >&4
21203 for file in $loclist $trylist; do
21205 eval $file=`basename $temp`
21210 : create config.sh file
21212 echo "Creating config.sh..." >&4
21213 $spitshell <<EOT >config.sh
21216 # This file was produced by running the Configure script. It holds all the
21217 # definitions figured out by Configure. Should you modify one of these values,
21218 # do not forget to propagate your changes by running "Configure -der". You may
21219 # instead choose to run each of the .SH files by yourself, or "Configure -S".
21222 # Package name : $package
21223 # Source directory : $src
21224 # Configuration time: $cf_time
21225 # Configured by : $cf_by
21226 # Target system : $myuname
21236 Revision='$Revision'
21244 alignbytes='$alignbytes'
21245 ansi2knr='$ansi2knr'
21246 aphostname='$aphostname'
21247 api_revision='$api_revision'
21248 api_subversion='$api_subversion'
21249 api_version='$api_version'
21250 api_versionstring='$api_versionstring'
21253 archlibexp='$archlibexp'
21254 archname64='$archname64'
21255 archname='$archname'
21256 archobjs='$archobjs'
21257 asctime_r_proto='$asctime_r_proto'
21265 byteorder='$byteorder'
21267 castflags='$castflags'
21270 cccdlflags='$cccdlflags'
21271 ccdlflags='$ccdlflags'
21273 ccflags_uselargefiles='$ccflags_uselargefiles'
21275 ccsymbols='$ccsymbols'
21276 ccversion='$ccversion'
21278 cf_email='$cf_email'
21280 charsize='$charsize'
21284 clocktype='$clocktype'
21286 compress='$compress'
21287 contains='$contains'
21291 cpp_stuff='$cpp_stuff'
21292 cppccsymbols='$cppccsymbols'
21293 cppflags='$cppflags'
21295 cppminus='$cppminus'
21297 cppstdin='$cppstdin'
21298 cppsymbols='$cppsymbols'
21299 crypt_r_proto='$crypt_r_proto'
21300 cryptlib='$cryptlib'
21302 ctermid_r_proto='$ctermid_r_proto'
21303 ctime_r_proto='$ctime_r_proto'
21304 d_Gconvert='$d_Gconvert'
21305 d_PRIEUldbl='$d_PRIEUldbl'
21306 d_PRIFUldbl='$d_PRIFUldbl'
21307 d_PRIGUldbl='$d_PRIGUldbl'
21308 d_PRIXU64='$d_PRIXU64'
21309 d_PRId64='$d_PRId64'
21310 d_PRIeldbl='$d_PRIeldbl'
21311 d_PRIfldbl='$d_PRIfldbl'
21312 d_PRIgldbl='$d_PRIgldbl'
21313 d_PRIi64='$d_PRIi64'
21314 d_PRIo64='$d_PRIo64'
21315 d_PRIu64='$d_PRIu64'
21316 d_PRIx64='$d_PRIx64'
21317 d_SCNfldbl='$d_SCNfldbl'
21318 d__fwalk='$d__fwalk'
21319 d_access='$d_access'
21320 d_accessx='$d_accessx'
21323 d_archlib='$d_archlib'
21324 d_asctime_r='$d_asctime_r'
21327 d_attribute_format='$d_attribute_format'
21328 d_attribute_malloc='$d_attribute_malloc'
21329 d_attribute_nonnull='$d_attribute_nonnull'
21330 d_attribute_noreturn='$d_attribute_noreturn'
21331 d_attribute_pure='$d_attribute_pure'
21332 d_attribute_unused='$d_attribute_unused'
21333 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
21337 d_bsdgetpgrp='$d_bsdgetpgrp'
21338 d_bsdsetpgrp='$d_bsdsetpgrp'
21339 d_builtin_choose_expr='$d_builtin_choose_expr'
21340 d_builtin_expect='$d_builtin_expect'
21342 d_c99_variadic_macros='$d_c99_variadic_macros'
21343 d_casti32='$d_casti32'
21344 d_castneg='$d_castneg'
21345 d_charvspr='$d_charvspr'
21347 d_chroot='$d_chroot'
21348 d_chsize='$d_chsize'
21350 d_clearenv='$d_clearenv'
21351 d_closedir='$d_closedir'
21352 d_cmsghdr_s='$d_cmsghdr_s'
21354 d_copysignl='$d_copysignl'
21355 d_cplusplus='$d_cplusplus'
21357 d_crypt_r='$d_crypt_r'
21359 d_ctermid_r='$d_ctermid_r'
21360 d_ctime_r='$d_ctime_r'
21361 d_cuserid='$d_cuserid'
21362 d_dbl_dig='$d_dbl_dig'
21363 d_dbminitproto='$d_dbminitproto'
21364 d_difftime='$d_difftime'
21366 d_dirnamlen='$d_dirnamlen'
21367 d_dlerror='$d_dlerror'
21368 d_dlopen='$d_dlopen'
21369 d_dlsymun='$d_dlsymun'
21370 d_dosuid='$d_dosuid'
21371 d_drand48_r='$d_drand48_r'
21372 d_drand48proto='$d_drand48proto'
21374 d_eaccess='$d_eaccess'
21375 d_endgrent='$d_endgrent'
21376 d_endgrent_r='$d_endgrent_r'
21377 d_endhent='$d_endhent'
21378 d_endhostent_r='$d_endhostent_r'
21379 d_endnent='$d_endnent'
21380 d_endnetent_r='$d_endnetent_r'
21381 d_endpent='$d_endpent'
21382 d_endprotoent_r='$d_endprotoent_r'
21383 d_endpwent='$d_endpwent'
21384 d_endpwent_r='$d_endpwent_r'
21385 d_endsent='$d_endsent'
21386 d_endservent_r='$d_endservent_r'
21387 d_eofnblk='$d_eofnblk'
21388 d_eunice='$d_eunice'
21389 d_faststdio='$d_faststdio'
21390 d_fchdir='$d_fchdir'
21391 d_fchmod='$d_fchmod'
21392 d_fchown='$d_fchown'
21394 d_fcntl_can_lock='$d_fcntl_can_lock'
21395 d_fd_macros='$d_fd_macros'
21396 d_fd_set='$d_fd_set'
21397 d_fds_bits='$d_fds_bits'
21398 d_fgetpos='$d_fgetpos'
21399 d_finite='$d_finite'
21400 d_finitel='$d_finitel'
21401 d_flexfnam='$d_flexfnam'
21403 d_flockproto='$d_flockproto'
21405 d_fp_class='$d_fp_class'
21406 d_fpathconf='$d_fpathconf'
21407 d_fpclass='$d_fpclass'
21408 d_fpclassify='$d_fpclassify'
21409 d_fpclassl='$d_fpclassl'
21410 d_fpos64_t='$d_fpos64_t'
21411 d_frexpl='$d_frexpl'
21412 d_fs_data_s='$d_fs_data_s'
21413 d_fseeko='$d_fseeko'
21414 d_fsetpos='$d_fsetpos'
21415 d_fstatfs='$d_fstatfs'
21416 d_fstatvfs='$d_fstatvfs'
21418 d_ftello='$d_ftello'
21420 d_futimes='$d_futimes'
21421 d_getcwd='$d_getcwd'
21422 d_getespwnam='$d_getespwnam'
21423 d_getfsstat='$d_getfsstat'
21424 d_getgrent='$d_getgrent'
21425 d_getgrent_r='$d_getgrent_r'
21426 d_getgrgid_r='$d_getgrgid_r'
21427 d_getgrnam_r='$d_getgrnam_r'
21428 d_getgrps='$d_getgrps'
21429 d_gethbyaddr='$d_gethbyaddr'
21430 d_gethbyname='$d_gethbyname'
21431 d_gethent='$d_gethent'
21432 d_gethname='$d_gethname'
21433 d_gethostbyaddr_r='$d_gethostbyaddr_r'
21434 d_gethostbyname_r='$d_gethostbyname_r'
21435 d_gethostent_r='$d_gethostent_r'
21436 d_gethostprotos='$d_gethostprotos'
21437 d_getitimer='$d_getitimer'
21438 d_getlogin='$d_getlogin'
21439 d_getlogin_r='$d_getlogin_r'
21440 d_getmnt='$d_getmnt'
21441 d_getmntent='$d_getmntent'
21442 d_getnbyaddr='$d_getnbyaddr'
21443 d_getnbyname='$d_getnbyname'
21444 d_getnent='$d_getnent'
21445 d_getnetbyaddr_r='$d_getnetbyaddr_r'
21446 d_getnetbyname_r='$d_getnetbyname_r'
21447 d_getnetent_r='$d_getnetent_r'
21448 d_getnetprotos='$d_getnetprotos'
21449 d_getpagsz='$d_getpagsz'
21450 d_getpbyname='$d_getpbyname'
21451 d_getpbynumber='$d_getpbynumber'
21452 d_getpent='$d_getpent'
21453 d_getpgid='$d_getpgid'
21454 d_getpgrp2='$d_getpgrp2'
21455 d_getpgrp='$d_getpgrp'
21456 d_getppid='$d_getppid'
21457 d_getprior='$d_getprior'
21458 d_getprotobyname_r='$d_getprotobyname_r'
21459 d_getprotobynumber_r='$d_getprotobynumber_r'
21460 d_getprotoent_r='$d_getprotoent_r'
21461 d_getprotoprotos='$d_getprotoprotos'
21462 d_getprpwnam='$d_getprpwnam'
21463 d_getpwent='$d_getpwent'
21464 d_getpwent_r='$d_getpwent_r'
21465 d_getpwnam_r='$d_getpwnam_r'
21466 d_getpwuid_r='$d_getpwuid_r'
21467 d_getsbyname='$d_getsbyname'
21468 d_getsbyport='$d_getsbyport'
21469 d_getsent='$d_getsent'
21470 d_getservbyname_r='$d_getservbyname_r'
21471 d_getservbyport_r='$d_getservbyport_r'
21472 d_getservent_r='$d_getservent_r'
21473 d_getservprotos='$d_getservprotos'
21474 d_getspnam='$d_getspnam'
21475 d_getspnam_r='$d_getspnam_r'
21476 d_gettimeod='$d_gettimeod'
21477 d_gmtime_r='$d_gmtime_r'
21478 d_gnulibc='$d_gnulibc'
21479 d_grpasswd='$d_grpasswd'
21480 d_hasmntopt='$d_hasmntopt'
21482 d_ilogbl='$d_ilogbl'
21483 d_inc_version_list='$d_inc_version_list'
21485 d_inetaton='$d_inetaton'
21486 d_int64_t='$d_int64_t'
21487 d_isascii='$d_isascii'
21488 d_isfinite='$d_isfinite'
21491 d_isnanl='$d_isnanl'
21492 d_killpg='$d_killpg'
21493 d_lchown='$d_lchown'
21494 d_ldbl_dig='$d_ldbl_dig'
21495 d_libm_lib_version='$d_libm_lib_version'
21497 d_localtime_r='$d_localtime_r'
21498 d_locconv='$d_locconv'
21500 d_longdbl='$d_longdbl'
21501 d_longlong='$d_longlong'
21502 d_lseekproto='$d_lseekproto'
21504 d_madvise='$d_madvise'
21505 d_malloc_good_size='$d_malloc_good_size'
21506 d_malloc_size='$d_malloc_size'
21508 d_mbstowcs='$d_mbstowcs'
21509 d_mbtowc='$d_mbtowc'
21510 d_memchr='$d_memchr'
21511 d_memcmp='$d_memcmp'
21512 d_memcpy='$d_memcpy'
21513 d_memmove='$d_memmove'
21514 d_memset='$d_memset'
21516 d_mkdtemp='$d_mkdtemp'
21517 d_mkfifo='$d_mkfifo'
21518 d_mkstemp='$d_mkstemp'
21519 d_mkstemps='$d_mkstemps'
21520 d_mktime='$d_mktime'
21523 d_modfl_pow32_bug='$d_modfl_pow32_bug'
21524 d_modflproto='$d_modflproto'
21525 d_mprotect='$d_mprotect'
21527 d_msg_ctrunc='$d_msg_ctrunc'
21528 d_msg_dontroute='$d_msg_dontroute'
21529 d_msg_oob='$d_msg_oob'
21530 d_msg_peek='$d_msg_peek'
21531 d_msg_proxy='$d_msg_proxy'
21532 d_msgctl='$d_msgctl'
21533 d_msgget='$d_msgget'
21534 d_msghdr_s='$d_msghdr_s'
21535 d_msgrcv='$d_msgrcv'
21536 d_msgsnd='$d_msgsnd'
21538 d_munmap='$d_munmap'
21539 d_mymalloc='$d_mymalloc'
21541 d_nl_langinfo='$d_nl_langinfo'
21542 d_nv_preserves_uv='$d_nv_preserves_uv'
21543 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
21544 d_off64_t='$d_off64_t'
21545 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
21546 d_oldpthreads='$d_oldpthreads'
21547 d_oldsock='$d_oldsock'
21549 d_pathconf='$d_pathconf'
21551 d_perl_otherlibdirs='$d_perl_otherlibdirs'
21552 d_phostname='$d_phostname'
21555 d_portable='$d_portable'
21556 d_procselfexe='$d_procselfexe'
21557 d_pthread_atfork='$d_pthread_atfork'
21558 d_pthread_attr_setscope='$d_pthread_attr_setscope'
21559 d_pthread_yield='$d_pthread_yield'
21561 d_pwchange='$d_pwchange'
21562 d_pwclass='$d_pwclass'
21563 d_pwcomment='$d_pwcomment'
21564 d_pwexpire='$d_pwexpire'
21565 d_pwgecos='$d_pwgecos'
21566 d_pwpasswd='$d_pwpasswd'
21567 d_pwquota='$d_pwquota'
21570 d_random_r='$d_random_r'
21571 d_readdir64_r='$d_readdir64_r'
21572 d_readdir='$d_readdir'
21573 d_readdir_r='$d_readdir_r'
21574 d_readlink='$d_readlink'
21576 d_recvmsg='$d_recvmsg'
21577 d_rename='$d_rename'
21578 d_rewinddir='$d_rewinddir'
21580 d_safebcpy='$d_safebcpy'
21581 d_safemcpy='$d_safemcpy'
21582 d_sanemcmp='$d_sanemcmp'
21583 d_sbrkproto='$d_sbrkproto'
21584 d_scalbnl='$d_scalbnl'
21585 d_sched_yield='$d_sched_yield'
21586 d_scm_rights='$d_scm_rights'
21587 d_seekdir='$d_seekdir'
21588 d_select='$d_select'
21590 d_semctl='$d_semctl'
21591 d_semctl_semid_ds='$d_semctl_semid_ds'
21592 d_semctl_semun='$d_semctl_semun'
21593 d_semget='$d_semget'
21595 d_sendmsg='$d_sendmsg'
21596 d_setegid='$d_setegid'
21597 d_seteuid='$d_seteuid'
21598 d_setgrent='$d_setgrent'
21599 d_setgrent_r='$d_setgrent_r'
21600 d_setgrps='$d_setgrps'
21601 d_sethent='$d_sethent'
21602 d_sethostent_r='$d_sethostent_r'
21603 d_setitimer='$d_setitimer'
21604 d_setlinebuf='$d_setlinebuf'
21605 d_setlocale='$d_setlocale'
21606 d_setlocale_r='$d_setlocale_r'
21607 d_setnent='$d_setnent'
21608 d_setnetent_r='$d_setnetent_r'
21609 d_setpent='$d_setpent'
21610 d_setpgid='$d_setpgid'
21611 d_setpgrp2='$d_setpgrp2'
21612 d_setpgrp='$d_setpgrp'
21613 d_setprior='$d_setprior'
21614 d_setproctitle='$d_setproctitle'
21615 d_setprotoent_r='$d_setprotoent_r'
21616 d_setpwent='$d_setpwent'
21617 d_setpwent_r='$d_setpwent_r'
21618 d_setregid='$d_setregid'
21619 d_setresgid='$d_setresgid'
21620 d_setresuid='$d_setresuid'
21621 d_setreuid='$d_setreuid'
21622 d_setrgid='$d_setrgid'
21623 d_setruid='$d_setruid'
21624 d_setsent='$d_setsent'
21625 d_setservent_r='$d_setservent_r'
21626 d_setsid='$d_setsid'
21627 d_setvbuf='$d_setvbuf'
21631 d_shmatprototype='$d_shmatprototype'
21632 d_shmctl='$d_shmctl'
21634 d_shmget='$d_shmget'
21635 d_sigaction='$d_sigaction'
21636 d_sigprocmask='$d_sigprocmask'
21637 d_sigsetjmp='$d_sigsetjmp'
21638 d_sitearch='$d_sitearch'
21639 d_snprintf='$d_snprintf'
21640 d_sockatmark='$d_sockatmark'
21641 d_sockatmarkproto='$d_sockatmarkproto'
21642 d_socket='$d_socket'
21643 d_socklen_t='$d_socklen_t'
21644 d_sockpair='$d_sockpair'
21645 d_socks5_init='$d_socks5_init'
21646 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
21648 d_srand48_r='$d_srand48_r'
21649 d_srandom_r='$d_srandom_r'
21650 d_sresgproto='$d_sresgproto'
21651 d_sresuproto='$d_sresuproto'
21652 d_statblks='$d_statblks'
21653 d_statfs_f_flags='$d_statfs_f_flags'
21654 d_statfs_s='$d_statfs_s'
21655 d_statvfs='$d_statvfs'
21656 d_stdio_cnt_lval='$d_stdio_cnt_lval'
21657 d_stdio_ptr_lval='$d_stdio_ptr_lval'
21658 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
21659 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
21660 d_stdio_stream_array='$d_stdio_stream_array'
21661 d_stdiobase='$d_stdiobase'
21662 d_stdstdio='$d_stdstdio'
21663 d_strchr='$d_strchr'
21664 d_strcoll='$d_strcoll'
21665 d_strctcpy='$d_strctcpy'
21666 d_strerrm='$d_strerrm'
21667 d_strerror='$d_strerror'
21668 d_strerror_r='$d_strerror_r'
21669 d_strftime='$d_strftime'
21670 d_strlcat='$d_strlcat'
21671 d_strlcpy='$d_strlcpy'
21672 d_strtod='$d_strtod'
21673 d_strtol='$d_strtol'
21674 d_strtold='$d_strtold'
21675 d_strtoll='$d_strtoll'
21676 d_strtoq='$d_strtoq'
21677 d_strtoul='$d_strtoul'
21678 d_strtoull='$d_strtoull'
21679 d_strtouq='$d_strtouq'
21680 d_strxfrm='$d_strxfrm'
21681 d_suidsafe='$d_suidsafe'
21682 d_symlink='$d_symlink'
21683 d_syscall='$d_syscall'
21684 d_syscallproto='$d_syscallproto'
21685 d_sysconf='$d_sysconf'
21686 d_sysernlst='$d_sysernlst'
21687 d_syserrlst='$d_syserrlst'
21688 d_system='$d_system'
21689 d_tcgetpgrp='$d_tcgetpgrp'
21690 d_tcsetpgrp='$d_tcsetpgrp'
21691 d_telldir='$d_telldir'
21692 d_telldirproto='$d_telldirproto'
21695 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
21696 d_tm_tm_zone='$d_tm_tm_zone'
21697 d_tmpnam_r='$d_tmpnam_r'
21698 d_truncate='$d_truncate'
21699 d_ttyname_r='$d_ttyname_r'
21700 d_tzname='$d_tzname'
21701 d_u32align='$d_u32align'
21702 d_ualarm='$d_ualarm'
21705 d_union_semun='$d_union_semun'
21706 d_unordered='$d_unordered'
21707 d_unsetenv='$d_unsetenv'
21708 d_usleep='$d_usleep'
21709 d_usleepproto='$d_usleepproto'
21711 d_vendorarch='$d_vendorarch'
21712 d_vendorbin='$d_vendorbin'
21713 d_vendorlib='$d_vendorlib'
21714 d_vendorscript='$d_vendorscript'
21716 d_void_closedir='$d_void_closedir'
21717 d_voidsig='$d_voidsig'
21718 d_voidtty='$d_voidtty'
21719 d_volatile='$d_volatile'
21720 d_vprintf='$d_vprintf'
21721 d_vsnprintf='$d_vsnprintf'
21723 d_waitpid='$d_waitpid'
21724 d_wcstombs='$d_wcstombs'
21725 d_wctomb='$d_wctomb'
21726 d_writev='$d_writev'
21729 db_hashtype='$db_hashtype'
21730 db_prefixtype='$db_prefixtype'
21731 db_version_major='$db_version_major'
21732 db_version_minor='$db_version_minor'
21733 db_version_patch='$db_version_patch'
21734 defvoidused='$defvoidused'
21735 direntrytype='$direntrytype'
21738 doublesize='$doublesize'
21740 drand48_r_proto='$drand48_r_proto'
21741 dynamic_ext='$dynamic_ext'
21747 endgrent_r_proto='$endgrent_r_proto'
21748 endhostent_r_proto='$endhostent_r_proto'
21749 endnetent_r_proto='$endnetent_r_proto'
21750 endprotoent_r_proto='$endprotoent_r_proto'
21751 endpwent_r_proto='$endpwent_r_proto'
21752 endservent_r_proto='$endservent_r_proto'
21753 eunicefix='$eunicefix'
21756 extensions='$extensions'
21758 fflushNULL='$fflushNULL'
21759 fflushall='$fflushall'
21761 firstmakefile='$firstmakefile'
21763 fpossize='$fpossize'
21764 fpostype='$fpostype'
21765 freetype='$freetype'
21768 full_csh='$full_csh'
21769 full_sed='$full_sed'
21770 gccansipedantic='$gccansipedantic'
21771 gccosandvers='$gccosandvers'
21772 gccversion='$gccversion'
21773 getgrent_r_proto='$getgrent_r_proto'
21774 getgrgid_r_proto='$getgrgid_r_proto'
21775 getgrnam_r_proto='$getgrnam_r_proto'
21776 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
21777 gethostbyname_r_proto='$gethostbyname_r_proto'
21778 gethostent_r_proto='$gethostent_r_proto'
21779 getlogin_r_proto='$getlogin_r_proto'
21780 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
21781 getnetbyname_r_proto='$getnetbyname_r_proto'
21782 getnetent_r_proto='$getnetent_r_proto'
21783 getprotobyname_r_proto='$getprotobyname_r_proto'
21784 getprotobynumber_r_proto='$getprotobynumber_r_proto'
21785 getprotoent_r_proto='$getprotoent_r_proto'
21786 getpwent_r_proto='$getpwent_r_proto'
21787 getpwnam_r_proto='$getpwnam_r_proto'
21788 getpwuid_r_proto='$getpwuid_r_proto'
21789 getservbyname_r_proto='$getservbyname_r_proto'
21790 getservbyport_r_proto='$getservbyport_r_proto'
21791 getservent_r_proto='$getservent_r_proto'
21792 getspnam_r_proto='$getspnam_r_proto'
21793 gidformat='$gidformat'
21799 gmtime_r_proto='$gmtime_r_proto'
21800 gnulibc_version='$gnulibc_version'
21802 groupcat='$groupcat'
21803 groupstype='$groupstype'
21806 h_sysfile='$h_sysfile'
21809 html1dir='$html1dir'
21810 html1direxp='$html1direxp'
21811 html3dir='$html3dir'
21812 html3direxp='$html3direxp'
21821 i_arpainet='$i_arpainet'
21822 i_bsdioctl='$i_bsdioctl'
21826 i_dirent='$i_dirent'
21832 i_fp_class='$i_fp_class'
21835 i_ieeefp='$i_ieeefp'
21836 i_inttypes='$i_inttypes'
21837 i_langinfo='$i_langinfo'
21838 i_libutil='$i_libutil'
21839 i_limits='$i_limits'
21840 i_locale='$i_locale'
21841 i_machcthr='$i_machcthr'
21842 i_malloc='$i_malloc'
21844 i_memory='$i_memory'
21845 i_mntent='$i_mntent'
21848 i_neterrno='$i_neterrno'
21849 i_netinettcp='$i_netinettcp'
21853 i_pthread='$i_pthread'
21855 i_rpcsvcdbm='$i_rpcsvcdbm'
21858 i_shadow='$i_shadow'
21860 i_stdarg='$i_stdarg'
21861 i_stddef='$i_stddef'
21862 i_stdlib='$i_stdlib'
21863 i_string='$i_string'
21864 i_sunmath='$i_sunmath'
21865 i_sysaccess='$i_sysaccess'
21866 i_sysdir='$i_sysdir'
21867 i_sysfile='$i_sysfile'
21868 i_sysfilio='$i_sysfilio'
21870 i_sysioctl='$i_sysioctl'
21871 i_syslog='$i_syslog'
21872 i_sysmman='$i_sysmman'
21873 i_sysmode='$i_sysmode'
21874 i_sysmount='$i_sysmount'
21875 i_sysndir='$i_sysndir'
21876 i_sysparam='$i_sysparam'
21877 i_sysresrc='$i_sysresrc'
21878 i_syssecrt='$i_syssecrt'
21879 i_sysselct='$i_sysselct'
21880 i_syssockio='$i_syssockio'
21881 i_sysstat='$i_sysstat'
21882 i_sysstatfs='$i_sysstatfs'
21883 i_sysstatvfs='$i_sysstatvfs'
21884 i_systime='$i_systime'
21885 i_systimek='$i_systimek'
21886 i_systimes='$i_systimes'
21887 i_systypes='$i_systypes'
21888 i_sysuio='$i_sysuio'
21890 i_sysutsname='$i_sysutsname'
21891 i_sysvfs='$i_sysvfs'
21892 i_syswait='$i_syswait'
21893 i_termio='$i_termio'
21894 i_termios='$i_termios'
21896 i_unistd='$i_unistd'
21899 i_values='$i_values'
21900 i_varargs='$i_varargs'
21901 i_varhdr='$i_varhdr'
21903 ignore_versioned_solibs='$ignore_versioned_solibs'
21904 inc_version_list='$inc_version_list'
21905 inc_version_list_init='$inc_version_list_init'
21908 initialinstalllocation='$initialinstalllocation'
21909 installarchlib='$installarchlib'
21910 installbin='$installbin'
21911 installhtml1dir='$installhtml1dir'
21912 installhtml3dir='$installhtml3dir'
21913 installman1dir='$installman1dir'
21914 installman3dir='$installman3dir'
21915 installprefix='$installprefix'
21916 installprefixexp='$installprefixexp'
21917 installprivlib='$installprivlib'
21918 installscript='$installscript'
21919 installsitearch='$installsitearch'
21920 installsitebin='$installsitebin'
21921 installsitehtml1dir='$installsitehtml1dir'
21922 installsitehtml3dir='$installsitehtml3dir'
21923 installsitelib='$installsitelib'
21924 installsiteman1dir='$installsiteman1dir'
21925 installsiteman3dir='$installsiteman3dir'
21926 installsitescript='$installsitescript'
21927 installstyle='$installstyle'
21928 installusrbinperl='$installusrbinperl'
21929 installvendorarch='$installvendorarch'
21930 installvendorbin='$installvendorbin'
21931 installvendorhtml1dir='$installvendorhtml1dir'
21932 installvendorhtml3dir='$installvendorhtml3dir'
21933 installvendorlib='$installvendorlib'
21934 installvendorman1dir='$installvendorman1dir'
21935 installvendorman3dir='$installvendorman3dir'
21936 installvendorscript='$installvendorscript'
21938 issymlink='$issymlink'
21939 ivdformat='$ivdformat'
21942 known_extensions='$known_extensions'
21945 lddlflags='$lddlflags'
21947 ldflags_uselargefiles='$ldflags_uselargefiles'
21948 ldlibpthname='$ldlibpthname'
21955 libsdirs='$libsdirs'
21956 libsfiles='$libsfiles'
21957 libsfound='$libsfound'
21958 libspath='$libspath'
21959 libswanted='$libswanted'
21960 libswanted_uselargefiles='$libswanted_uselargefiles'
21966 localtime_r_proto='$localtime_r_proto'
21967 locincpth='$locincpth'
21968 loclibpth='$loclibpth'
21969 longdblsize='$longdblsize'
21970 longlongsize='$longlongsize'
21971 longsize='$longsize'
21975 lseeksize='$lseeksize'
21976 lseektype='$lseektype'
21979 madlyobj='$madlyobj'
21980 madlysrc='$madlysrc'
21984 make_set_make='$make_set_make'
21985 mallocobj='$mallocobj'
21986 mallocsrc='$mallocsrc'
21987 malloctype='$malloctype'
21989 man1direxp='$man1direxp'
21992 man3direxp='$man3direxp'
21994 mips_type='$mips_type'
21995 mistrustnm='$mistrustnm'
21997 mmaptype='$mmaptype'
21998 modetype='$modetype'
22000 multiarch='$multiarch'
22002 myarchname='$myarchname'
22003 mydomain='$mydomain'
22004 myhostname='$myhostname'
22007 need_va_copy='$need_va_copy'
22008 netdb_hlen_type='$netdb_hlen_type'
22009 netdb_host_type='$netdb_host_type'
22010 netdb_name_type='$netdb_name_type'
22011 netdb_net_type='$netdb_net_type'
22014 nm_so_opt='$nm_so_opt'
22015 nonxs_ext='$nonxs_ext'
22017 nvEUformat='$nvEUformat'
22018 nvFUformat='$nvFUformat'
22019 nvGUformat='$nvGUformat'
22020 nv_preserves_uv_bits='$nv_preserves_uv_bits'
22021 nveformat='$nveformat'
22022 nvfformat='$nvfformat'
22023 nvgformat='$nvgformat'
22026 o_nonblock='$o_nonblock'
22028 old_pthread_create_joinable='$old_pthread_create_joinable'
22029 optimize='$optimize'
22030 orderlib='$orderlib'
22033 otherlibdirs='$otherlibdirs'
22037 patchlevel='$patchlevel'
22038 path_sep='$path_sep'
22041 perl_patchlevel='$perl_patchlevel'
22042 perladmin='$perladmin'
22043 perllibs='$perllibs'
22044 perlpath='$perlpath'
22046 phostname='$phostname'
22052 prefixexp='$prefixexp'
22054 privlibexp='$privlibexp'
22055 procselfexe='$procselfexe'
22056 prototype='$prototype'
22058 quadkind='$quadkind'
22059 quadtype='$quadtype'
22060 randbits='$randbits'
22061 randfunc='$randfunc'
22062 random_r_proto='$random_r_proto'
22063 randseedtype='$randseedtype'
22065 rd_nodata='$rd_nodata'
22066 readdir64_r_proto='$readdir64_r_proto'
22067 readdir_r_proto='$readdir_r_proto'
22068 revision='$revision'
22073 sPRIEUldbl='$sPRIEUldbl'
22074 sPRIFUldbl='$sPRIFUldbl'
22075 sPRIGUldbl='$sPRIGUldbl'
22076 sPRIXU64='$sPRIXU64'
22078 sPRIeldbl='$sPRIeldbl'
22079 sPRIfldbl='$sPRIfldbl'
22080 sPRIgldbl='$sPRIgldbl'
22085 sSCNfldbl='$sSCNfldbl'
22086 sched_yield='$sched_yield'
22087 scriptdir='$scriptdir'
22088 scriptdirexp='$scriptdirexp'
22090 seedfunc='$seedfunc'
22091 selectminbits='$selectminbits'
22092 selecttype='$selecttype'
22093 sendmail='$sendmail'
22094 setgrent_r_proto='$setgrent_r_proto'
22095 sethostent_r_proto='$sethostent_r_proto'
22096 setlocale_r_proto='$setlocale_r_proto'
22097 setnetent_r_proto='$setnetent_r_proto'
22098 setprotoent_r_proto='$setprotoent_r_proto'
22099 setpwent_r_proto='$setpwent_r_proto'
22100 setservent_r_proto='$setservent_r_proto'
22103 sharpbang='$sharpbang'
22104 shmattype='$shmattype'
22105 shortsize='$shortsize'
22108 sig_count='$sig_count'
22109 sig_name='$sig_name'
22110 sig_name_init='$sig_name_init'
22112 sig_num_init='$sig_num_init'
22113 sig_size='$sig_size'
22114 signal_t='$signal_t'
22115 sitearch='$sitearch'
22116 sitearchexp='$sitearchexp'
22118 sitebinexp='$sitebinexp'
22119 sitehtml1dir='$sitehtml1dir'
22120 sitehtml1direxp='$sitehtml1direxp'
22121 sitehtml3dir='$sitehtml3dir'
22122 sitehtml3direxp='$sitehtml3direxp'
22124 sitelib_stem='$sitelib_stem'
22125 sitelibexp='$sitelibexp'
22126 siteman1dir='$siteman1dir'
22127 siteman1direxp='$siteman1direxp'
22128 siteman3dir='$siteman3dir'
22129 siteman3direxp='$siteman3direxp'
22130 siteprefix='$siteprefix'
22131 siteprefixexp='$siteprefixexp'
22132 sitescript='$sitescript'
22133 sitescriptexp='$sitescriptexp'
22134 sizesize='$sizesize'
22135 sizetype='$sizetype'
22139 sockethdr='$sockethdr'
22140 socketlib='$socketlib'
22141 socksizetype='$socksizetype'
22143 spackage='$spackage'
22144 spitshell='$spitshell'
22145 srand48_r_proto='$srand48_r_proto'
22146 srandom_r_proto='$srandom_r_proto'
22148 ssizetype='$ssizetype'
22149 startperl='$startperl'
22151 static_ext='$static_ext'
22153 stdio_base='$stdio_base'
22154 stdio_bufsiz='$stdio_bufsiz'
22155 stdio_cnt='$stdio_cnt'
22156 stdio_filbuf='$stdio_filbuf'
22157 stdio_ptr='$stdio_ptr'
22158 stdio_stream_array='$stdio_stream_array'
22159 strerror_r_proto='$strerror_r_proto'
22162 subversion='$subversion'
22166 targetarch='$targetarch'
22170 timeincl='$timeincl'
22171 timetype='$timetype'
22172 tmpnam_r_proto='$tmpnam_r_proto'
22178 ttyname_r_proto='$ttyname_r_proto'
22187 uidformat='$uidformat'
22193 uquadtype='$uquadtype'
22194 use5005threads='$use5005threads'
22195 use64bitall='$use64bitall'
22196 use64bitint='$use64bitint'
22197 usecrosscompile='$usecrosscompile'
22199 usefaststdio='$usefaststdio'
22200 useithreads='$useithreads'
22201 uselargefiles='$uselargefiles'
22202 uselongdouble='$uselongdouble'
22203 usemallocwrap='$usemallocwrap'
22204 usemorebits='$usemorebits'
22205 usemultiplicity='$usemultiplicity'
22206 usemymalloc='$usemymalloc'
22208 useopcode='$useopcode'
22209 useperlio='$useperlio'
22210 useposix='$useposix'
22211 usereentrant='$usereentrant'
22212 userelocatableinc='$userelocatableinc'
22214 useshrplib='$useshrplib'
22215 usesitecustomize='$usesitecustomize'
22216 usesocks='$usesocks'
22217 usethreads='$usethreads'
22218 usevendorprefix='$usevendorprefix'
22219 usevfork='$usevfork'
22222 uvXUformat='$uvXUformat'
22223 uvoformat='$uvoformat'
22226 uvuformat='$uvuformat'
22227 uvxformat='$uvxformat'
22228 vendorarch='$vendorarch'
22229 vendorarchexp='$vendorarchexp'
22230 vendorbin='$vendorbin'
22231 vendorbinexp='$vendorbinexp'
22232 vendorhtml1dir='$vendorhtml1dir'
22233 vendorhtml1direxp='$vendorhtml1direxp'
22234 vendorhtml3dir='$vendorhtml3dir'
22235 vendorhtml3direxp='$vendorhtml3direxp'
22236 vendorlib='$vendorlib'
22237 vendorlib_stem='$vendorlib_stem'
22238 vendorlibexp='$vendorlibexp'
22239 vendorman1dir='$vendorman1dir'
22240 vendorman1direxp='$vendorman1direxp'
22241 vendorman3dir='$vendorman3dir'
22242 vendorman3direxp='$vendorman3direxp'
22243 vendorprefix='$vendorprefix'
22244 vendorprefixexp='$vendorprefixexp'
22245 vendorscript='$vendorscript'
22246 vendorscriptexp='$vendorscriptexp'
22248 version_patchlevel_string='$version_patchlevel_string'
22249 versiononly='$versiononly'
22251 voidflags='$voidflags'
22254 yaccflags='$yaccflags'
22259 : Add in command line options if available
22260 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22262 : add special variables
22263 $test -f $src/patchlevel.h && \
22264 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
22265 echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
22266 echo "PERL_CONFIG_SH=true" >>config.sh
22268 : propagate old symbols
22269 if $test -f UU/config.sh; then
22270 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
22271 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
22272 $sort | $uniq -u >UU/oldsyms
22273 set X `cat UU/oldsyms`
22279 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
22281 echo "# Variables propagated from previous config.sh file." >>config.sh
22282 for sym in `cat UU/oldsyms`; do
22283 echo " Propagating $hint variable "'$'"$sym..."
22284 eval 'tmp="$'"${sym}"'"'
22286 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
22292 : Finish up by extracting the .SH files
22296 echo "Extraction done."
22306 If you'd like to make any changes to the config.sh file before I begin
22307 to configure things, do it as a shell escape now (e.g. !vi config.sh).
22310 rp="Press return or use a shell escape to edit config.sh:"
22315 *) : in case they cannot read
22316 sh 1>&4 -c "$ans";;
22321 : if this fails, just run all the .SH files by hand
22330 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
22337 Now you need to generate make dependencies by running "$make depend".
22338 You might prefer to run it in background: "$make depend > makedepend.out &"
22339 It can take a while, so you might not want to run it right now.
22344 rp="Run $make depend now?"
22348 $make depend && echo "Now you must run '$make'."
22351 echo "You must run '$make depend' then '$make'."
22354 elif test -f [Mm]akefile; then
22356 echo "Now you must run a $make."
22358 echo "Configure done."
22361 if $test -f Policy.sh; then
22364 If you compile $package on a different machine or from a different object
22365 directory, copy the Policy.sh file from this object directory to the
22366 new one before you run Configure -- this will help you with most of
22367 the policy defaults.
22371 if $test -f config.msg; then
22372 echo "Hmm. I also noted the following information while running:"
22374 $cat config.msg >&4
22377 $rm -f kit*isdone ark*isdone